info.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578
  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') that.$set(that, `statusList`, res.data);
  245. },
  246. }
  247. }
  248. </script>
  249. <style lang="scss">
  250. .main {
  251. display: flex;
  252. flex-direction: column;
  253. width: 100vw;
  254. height: 100vh;
  255. background-color: #f5f5f5;
  256. .zero {
  257. position: relative;
  258. flex-grow: 1;
  259. .one {
  260. background-color: #fff;
  261. margin: 0 0 2vw 0;
  262. display: flex;
  263. justify-content: space-between;
  264. padding: 2vw;
  265. border-bottom: 2px dashed #ff0000;
  266. .one_1 {
  267. width: 8vw;
  268. text-align: center;
  269. padding: 3vw 0 0;
  270. }
  271. .one_2 {
  272. width: 86vw;
  273. .name {
  274. font-size: 16px;
  275. margin: 0 0 1vw 0;
  276. text {
  277. padding: 0 0 0 2vw;
  278. }
  279. }
  280. .address {
  281. font-size: 14px;
  282. color: #858585;
  283. text {
  284. padding: 0 0 0 2vw;
  285. }
  286. }
  287. }
  288. }
  289. .two {
  290. background-color: #fff;
  291. margin: 0 0 2vw 0;
  292. padding: 2vw;
  293. .two_0 {
  294. text-align: right;
  295. color: #ff0000;
  296. }
  297. .two_1 {
  298. display: flex;
  299. flex-direction: column;
  300. .list {
  301. margin: 0 0 1vw 0;
  302. .list_1 {
  303. font-size: 16px;
  304. margin: 0 0 1vw 0;
  305. text:last-child {
  306. padding: 0 0 0 2vw;
  307. }
  308. }
  309. .list_2 {
  310. display: flex;
  311. flex-direction: column;
  312. .goods {
  313. border-bottom: 1px dashed #f1f1f1;
  314. padding: 2vw 0;
  315. .goods_1 {
  316. display: flex;
  317. .url {
  318. width: 20vw;
  319. .image {
  320. width: 100%;
  321. height: 20vw;
  322. border-radius: 5px;
  323. }
  324. }
  325. .goodsname {
  326. display: flex;
  327. flex-direction: column;
  328. width: 60vw;
  329. padding: 0 2vw;
  330. font-size: 16px;
  331. .specs {
  332. color: var(--f85Color);
  333. font-size: var(--font12Size);
  334. }
  335. .other {
  336. display: flex;
  337. padding: 1vw 0 0 0;
  338. .gift {
  339. margin: 0 1vw 0 0;
  340. font-size: 12px;
  341. color: #FFA500;
  342. border: 1px solid #FFA500;
  343. border-radius: 5px;
  344. padding: 0 1vw;
  345. }
  346. .act {
  347. font-size: 12px;
  348. border: 1px solid var(--fFB1Color);
  349. color: var(--fFB1Color);
  350. border-radius: 5px;
  351. padding: 0 1vw;
  352. }
  353. }
  354. }
  355. .goodsother {
  356. width: 15vw;
  357. text-align: right;
  358. }
  359. }
  360. .goods_2 {
  361. padding: 0 1vw 1vw 0;
  362. font-size: var(--font14Size);
  363. }
  364. .goods_3 {
  365. display: flex;
  366. justify-content: space-between;
  367. border: 1px solid var(--fcColor);
  368. border-radius: 5px;
  369. margin: 0 0 1vw 0;
  370. padding: 1vw;
  371. .left {
  372. .name {
  373. font-size: 14px;
  374. }
  375. .Spec {
  376. font-size: var(--font12Size);
  377. color: var(--f85Color);
  378. }
  379. }
  380. }
  381. }
  382. }
  383. }
  384. }
  385. .two_2 {
  386. .list_1 {
  387. font-size: 16px;
  388. margin: 0 0 1vw 0;
  389. text:last-child {
  390. padding: 0 0 0 2vw;
  391. }
  392. }
  393. .list_2 {
  394. display: flex;
  395. flex-direction: column;
  396. .goods {
  397. border-bottom: 1px dashed #f1f1f1;
  398. padding: 2vw 0;
  399. .goods_1 {
  400. display: flex;
  401. .url {
  402. width: 20vw;
  403. .image {
  404. width: 100%;
  405. height: 20vw;
  406. border-radius: 5px;
  407. }
  408. }
  409. .goodsname {
  410. display: flex;
  411. flex-direction: column;
  412. width: 60vw;
  413. padding: 0 2vw;
  414. font-size: 16px;
  415. .specs {
  416. color: var(--f85Color);
  417. font-size: var(--font12Size);
  418. }
  419. .other {
  420. display: flex;
  421. padding: 1vw 0 0 0;
  422. .gift {
  423. margin: 0 1vw 0 0;
  424. font-size: 12px;
  425. color: #FFA500;
  426. border: 1px solid #FFA500;
  427. border-radius: 5px;
  428. padding: 0 1vw;
  429. }
  430. .act {
  431. font-size: 12px;
  432. border: 1px solid var(--fFB1Color);
  433. color: var(--fFB1Color);
  434. border-radius: 5px;
  435. padding: 0 1vw;
  436. }
  437. }
  438. }
  439. .goodsother {
  440. width: 15vw;
  441. text-align: right;
  442. }
  443. }
  444. .goods_2 {
  445. padding: 0 1vw 1vw 0;
  446. font-size: var(--font14Size);
  447. }
  448. .goods_3 {
  449. display: flex;
  450. justify-content: space-between;
  451. border: 1px solid var(--fcColor);
  452. border-radius: 5px;
  453. margin: 0 0 1vw 0;
  454. padding: 1vw;
  455. .left {
  456. .name {
  457. font-size: 14px;
  458. }
  459. .Spec {
  460. font-size: var(--font12Size);
  461. color: var(--f85Color);
  462. }
  463. }
  464. }
  465. }
  466. }
  467. }
  468. }
  469. .thr {
  470. background-color: #fff;
  471. margin: 0 0 2vw 0;
  472. padding: 0 2vw;
  473. .thr_1 {
  474. margin: 2vw 0;
  475. font-size: 15px;
  476. display: flex;
  477. justify-content: space-between;
  478. }
  479. .thr_1:last-child {
  480. text:last-child {
  481. color: #ff0000;
  482. }
  483. }
  484. }
  485. .four {
  486. background-color: #fff;
  487. margin: 0 0 2vw 0;
  488. padding: 0 2vw;
  489. .four_1 {
  490. margin: 2vw 0;
  491. font-size: 15px;
  492. display: flex;
  493. justify-content: space-between;
  494. }
  495. }
  496. }
  497. .zero_1 {
  498. background-color: white;
  499. width: 96vw;
  500. padding: 4vw 2vw;
  501. font-size: 16px;
  502. text:last-child {
  503. color: #ff0000;
  504. padding: 0 0 0 2vw;
  505. }
  506. }
  507. }
  508. .scroll-view {
  509. position: absolute;
  510. top: 0;
  511. left: 0;
  512. right: 0;
  513. bottom: 0;
  514. .list-scroll-view {
  515. display: flex;
  516. flex-direction: column;
  517. }
  518. }
  519. </style>