info.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580
  1. <template>
  2. <mobile-frame>
  3. <view class="main">
  4. <view class="zero">
  5. <scroll-view scroll-y="true" class="scroll-view">
  6. <view class="list-scroll-view">
  7. <view class="one">
  8. <view class="one_1">
  9. <text class="iconfont icon-dingweixiao"></text>
  10. </view>
  11. <view class="one_2">
  12. <view class="name">
  13. <text>{{info.address.name}}</text>
  14. <text>{{info.address.phone}}</text>
  15. </view>
  16. <view class="address">
  17. <text>{{info.address.province}}</text>
  18. <text>{{info.address.city}}</text>
  19. <text>{{info.address.area}}</text>
  20. <text>{{info.address.address}}</text>
  21. </view>
  22. </view>
  23. </view>
  24. <view class="two">
  25. <view class="two_0">
  26. <text>{{info.zhStatus||'未识别'}}</text>
  27. </view>
  28. <view class="two_1" v-if="info.status=='0'">
  29. <view class="list" v-for="(item,index) in info.goods" :key="index">
  30. <view class="list_1">
  31. <text class="iconfont icon-shangdian"></text>
  32. <text>{{item.shop_name}}</text>
  33. </view>
  34. <view class="list_2">
  35. <view class="goods" v-for="(tag,indexs) in item.goods" :key="indexs">
  36. <view class="goods_1">
  37. <view class="url">
  38. <image class="image"
  39. :src="tag.goods.file&&tag.goods.file.length>0?tag.goods.file[0].url:tag.goods.goods.file[0].url"
  40. mode=""></image>
  41. </view>
  42. <view class="goodsname">
  43. {{tag.goods.name}}
  44. <view class="specs">
  45. {{tag.name}}
  46. </view>
  47. <view class="other">
  48. <text v-if="tag.gift.length>0" class="gift">赠品</text>
  49. <text v-if="tag.sp_price" class="act">特价</text>
  50. </view>
  51. </view>
  52. <view class="goodsother">
  53. <view v-if="info.type=='0'" class="price">
  54. ¥{{tag.price||tag.sell_money}}
  55. </view>
  56. <view v-else class="price">
  57. ¥{{tag.group_config.money}}
  58. </view>
  59. <view class="num">
  60. ×{{tag.buy_num}}
  61. </view>
  62. </view>
  63. </view>
  64. <view class="goods_2" v-if="tag.gift.length>0">赠品</view>
  65. <view class="goods_3" v-if="tag.gift.length>0"
  66. v-for="(tags,indexx) in tag.gift" :key="indexx">
  67. <view class="left">
  68. <view class="name">
  69. {{tags.goods_name}}
  70. </view>
  71. <view class="Spec">
  72. 规格:{{tags.spec_name}}
  73. </view>
  74. <view class="Spec">
  75. 说明:{{tags.desc}}
  76. </view>
  77. </view>
  78. <view class="right">
  79. <view class="price">
  80. ¥{{tags.money||0}}
  81. </view>
  82. <view class="num">
  83. ×{{tags.num}}
  84. </view>
  85. </view>
  86. </view>
  87. </view>
  88. </view>
  89. </view>
  90. </view>
  91. <view class="two_2" v-else>
  92. <view class="list_1">
  93. <text class="iconfont icon-shangdian"></text>
  94. <text>{{info.shop.name}}</text>
  95. </view>
  96. <view class="list_2">
  97. <view class="goods" v-for="(item,index) in info.goods" :key="index">
  98. <view class="goods_1">
  99. <view class="url">
  100. <image class="image"
  101. :src="item.file&&item.file.length>0?item.file[0].url:item.goods.file[0].url"
  102. mode="">
  103. </image>
  104. </view>
  105. <view class="goodsname">
  106. {{item.goods.name}}
  107. <view class="specs">
  108. {{item.name}}
  109. </view>
  110. <view class="other">
  111. <text v-if="item.gift.length>0" class="gift">赠品</text>
  112. <text v-if="item.sp_price" class="act">特价</text>
  113. </view>
  114. </view>
  115. <view class="goodsother">
  116. <view v-if="info.type=='0'" class="price">
  117. ¥{{item.price||item.sell_money}}
  118. </view>
  119. <view v-else class="price">
  120. ¥{{item.group_config.money}}
  121. </view>
  122. <view class="num">
  123. ×{{item.buy_num}}
  124. </view>
  125. </view>
  126. </view>
  127. <view class="goods_2" v-if="item.gift.length>0">赠品</view>
  128. <view class="goods_3" v-if="item.gift.length>0"
  129. v-for="(tag,indexx) in item.gift" :key="indexx">
  130. <view class="left">
  131. <view class="name">
  132. {{tag.goods_name}}
  133. </view>
  134. <view class="Spec">
  135. 规格:{{tag.spec_name}}
  136. </view>
  137. <view class="Spec">
  138. 说明:{{tag.desc}}
  139. </view>
  140. </view>
  141. <view class="right">
  142. <view class="price">
  143. ¥{{tag.money||0}}
  144. </view>
  145. <view class="num">
  146. ×{{tag.num}}
  147. </view>
  148. </view>
  149. </view>
  150. </view>
  151. </view>
  152. </view>
  153. </view>
  154. <view class="thr">
  155. <view class="thr_1" v-for="(item,index) in info.total_detail" :key="index">
  156. <text>{{item.zh}}</text>
  157. <text>¥{{item.money}}</text>
  158. </view>
  159. <view class="thr_1">
  160. <text>实付金额</text>
  161. <text>¥{{info.goods_total}}</text>
  162. </view>
  163. </view>
  164. <view class="four">
  165. <view class="four_1">
  166. <text>订单号</text>
  167. <text>{{info.no}}</text>
  168. </view>
  169. <view class="four_1">
  170. <text>订单状态</text>
  171. <text>{{info.zhStatus||'未识别'}}</text>
  172. </view>
  173. <view class="four_1">
  174. <text>下单时间</text>
  175. <text>{{info.buy_time}}</text>
  176. </view>
  177. <view class="four_1">
  178. <text>订单备注</text>
  179. <text>{{info.remarks}}</text>
  180. </view>
  181. </view>
  182. </view>
  183. </scroll-view>
  184. </view>
  185. <view class="zero_1">
  186. <text>合计:</text>
  187. <text>¥{{info.goods_total}}</text>
  188. </view>
  189. </view>
  190. </mobile-frame>
  191. </template>
  192. <script>
  193. export default {
  194. data() {
  195. return {
  196. id: '',
  197. status: '',
  198. info: {},
  199. // 售后状态
  200. statusList: [],
  201. };
  202. },
  203. onLoad: async function(e) {
  204. const that = this;
  205. that.$set(that, `id`, e.id);
  206. that.$set(that, `status`, e.status);
  207. await that.searchOther();
  208. await that.search()
  209. },
  210. onShow: function() {},
  211. methods: {
  212. // 查询详情
  213. async search() {
  214. uni.showLoading({
  215. title: '加载中'
  216. });
  217. const that = this;
  218. let res;
  219. // 待付款
  220. if (that.id && that.status == '0') {
  221. res = await that.$api(`/order/${that.id}`);
  222. } else {
  223. res = await that.$api(`/orderDetail/${that.id}`);
  224. }
  225. if (res.errcode == '0') {
  226. let status = that.statusList.find(i => i.value == res.data.status)
  227. if (status) res.data.zhStatus = status.label;
  228. // 运费总数和商品总数相加
  229. let total = 0;
  230. for (let val of res.data?.total_detail) total = this.$plus(total, val.money)
  231. res.data.goods_total = total
  232. that.$set(that, `info`, res.data);
  233. uni.hideLoading();
  234. }
  235. },
  236. // 查询其他信息
  237. async searchOther() {
  238. const that = this;
  239. let res;
  240. // 查询状态
  241. res = await that.$api(`/dictData`, 'GET', {
  242. code: 'order_process'
  243. })
  244. if (res.errcode == '0') {
  245. that.$set(that, `statusList`, res.data);
  246. }
  247. },
  248. }
  249. }
  250. </script>
  251. <style lang="scss">
  252. .main {
  253. display: flex;
  254. flex-direction: column;
  255. width: 100vw;
  256. height: 100vh;
  257. background-color: #f5f5f5;
  258. .zero {
  259. position: relative;
  260. flex-grow: 1;
  261. .one {
  262. background-color: #fff;
  263. margin: 0 0 2vw 0;
  264. display: flex;
  265. justify-content: space-between;
  266. padding: 2vw;
  267. border-bottom: 2px dashed #ff0000;
  268. .one_1 {
  269. width: 8vw;
  270. text-align: center;
  271. padding: 3vw 0 0;
  272. }
  273. .one_2 {
  274. width: 86vw;
  275. .name {
  276. font-size: 16px;
  277. margin: 0 0 1vw 0;
  278. text {
  279. padding: 0 0 0 2vw;
  280. }
  281. }
  282. .address {
  283. font-size: 14px;
  284. color: #858585;
  285. text {
  286. padding: 0 0 0 2vw;
  287. }
  288. }
  289. }
  290. }
  291. .two {
  292. background-color: #fff;
  293. margin: 0 0 2vw 0;
  294. padding: 2vw;
  295. .two_0 {
  296. text-align: right;
  297. color: #ff0000;
  298. }
  299. .two_1 {
  300. display: flex;
  301. flex-direction: column;
  302. .list {
  303. margin: 0 0 1vw 0;
  304. .list_1 {
  305. font-size: 16px;
  306. margin: 0 0 1vw 0;
  307. text:last-child {
  308. padding: 0 0 0 2vw;
  309. }
  310. }
  311. .list_2 {
  312. display: flex;
  313. flex-direction: column;
  314. .goods {
  315. border-bottom: 1px dashed #f1f1f1;
  316. padding: 2vw 0;
  317. .goods_1 {
  318. display: flex;
  319. .url {
  320. width: 20vw;
  321. .image {
  322. width: 100%;
  323. height: 20vw;
  324. border-radius: 5px;
  325. }
  326. }
  327. .goodsname {
  328. display: flex;
  329. flex-direction: column;
  330. width: 60vw;
  331. padding: 0 2vw;
  332. font-size: 16px;
  333. .specs {
  334. color: var(--f85Color);
  335. font-size: var(--font12Size);
  336. }
  337. .other {
  338. display: flex;
  339. padding: 1vw 0 0 0;
  340. .gift {
  341. margin: 0 1vw 0 0;
  342. font-size: 12px;
  343. color: #FFA500;
  344. border: 1px solid #FFA500;
  345. border-radius: 5px;
  346. padding: 0 1vw;
  347. }
  348. .act {
  349. font-size: 12px;
  350. border: 1px solid var(--fFB1Color);
  351. color: var(--fFB1Color);
  352. border-radius: 5px;
  353. padding: 0 1vw;
  354. }
  355. }
  356. }
  357. .goodsother {
  358. width: 15vw;
  359. text-align: right;
  360. }
  361. }
  362. .goods_2 {
  363. padding: 0 1vw 1vw 0;
  364. font-size: var(--font14Size);
  365. }
  366. .goods_3 {
  367. display: flex;
  368. justify-content: space-between;
  369. border: 1px solid var(--fcColor);
  370. border-radius: 5px;
  371. margin: 0 0 1vw 0;
  372. padding: 1vw;
  373. .left {
  374. .name {
  375. font-size: 14px;
  376. }
  377. .Spec {
  378. font-size: var(--font12Size);
  379. color: var(--f85Color);
  380. }
  381. }
  382. }
  383. }
  384. }
  385. }
  386. }
  387. .two_2 {
  388. .list_1 {
  389. font-size: 16px;
  390. margin: 0 0 1vw 0;
  391. text:last-child {
  392. padding: 0 0 0 2vw;
  393. }
  394. }
  395. .list_2 {
  396. display: flex;
  397. flex-direction: column;
  398. .goods {
  399. border-bottom: 1px dashed #f1f1f1;
  400. padding: 2vw 0;
  401. .goods_1 {
  402. display: flex;
  403. .url {
  404. width: 20vw;
  405. .image {
  406. width: 100%;
  407. height: 20vw;
  408. border-radius: 5px;
  409. }
  410. }
  411. .goodsname {
  412. display: flex;
  413. flex-direction: column;
  414. width: 60vw;
  415. padding: 0 2vw;
  416. font-size: 16px;
  417. .specs {
  418. color: var(--f85Color);
  419. font-size: var(--font12Size);
  420. }
  421. .other {
  422. display: flex;
  423. padding: 1vw 0 0 0;
  424. .gift {
  425. margin: 0 1vw 0 0;
  426. font-size: 12px;
  427. color: #FFA500;
  428. border: 1px solid #FFA500;
  429. border-radius: 5px;
  430. padding: 0 1vw;
  431. }
  432. .act {
  433. font-size: 12px;
  434. border: 1px solid var(--fFB1Color);
  435. color: var(--fFB1Color);
  436. border-radius: 5px;
  437. padding: 0 1vw;
  438. }
  439. }
  440. }
  441. .goodsother {
  442. width: 15vw;
  443. text-align: right;
  444. }
  445. }
  446. .goods_2 {
  447. padding: 0 1vw 1vw 0;
  448. font-size: var(--font14Size);
  449. }
  450. .goods_3 {
  451. display: flex;
  452. justify-content: space-between;
  453. border: 1px solid var(--fcColor);
  454. border-radius: 5px;
  455. margin: 0 0 1vw 0;
  456. padding: 1vw;
  457. .left {
  458. .name {
  459. font-size: 14px;
  460. }
  461. .Spec {
  462. font-size: var(--font12Size);
  463. color: var(--f85Color);
  464. }
  465. }
  466. }
  467. }
  468. }
  469. }
  470. }
  471. .thr {
  472. background-color: #fff;
  473. margin: 0 0 2vw 0;
  474. padding: 0 2vw;
  475. .thr_1 {
  476. margin: 2vw 0;
  477. font-size: 15px;
  478. display: flex;
  479. justify-content: space-between;
  480. }
  481. .thr_1:last-child {
  482. text:last-child {
  483. color: #ff0000;
  484. }
  485. }
  486. }
  487. .four {
  488. background-color: #fff;
  489. margin: 0 0 2vw 0;
  490. padding: 0 2vw;
  491. .four_1 {
  492. margin: 2vw 0;
  493. font-size: 15px;
  494. display: flex;
  495. justify-content: space-between;
  496. }
  497. }
  498. }
  499. .zero_1 {
  500. background-color: white;
  501. width: 96vw;
  502. padding: 4vw 2vw;
  503. font-size: 16px;
  504. text:last-child {
  505. color: #ff0000;
  506. padding: 0 0 0 2vw;
  507. }
  508. }
  509. }
  510. .scroll-view {
  511. position: absolute;
  512. top: 0;
  513. left: 0;
  514. right: 0;
  515. bottom: 0;
  516. .list-scroll-view {
  517. display: flex;
  518. flex-direction: column;
  519. }
  520. }
  521. </style>