info.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606
  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">
  156. <text>商品金额</text>
  157. <text>¥{{info.total_detail.goods_total}}</text>
  158. </view>
  159. <view class="thr_1">
  160. <text>运费</text>
  161. <text>¥{{info.total_detail.freight_total}}</text>
  162. </view>
  163. <view class="thr_1">
  164. <text>实付金额</text>
  165. <text>¥{{info.goods_total}}</text>
  166. </view>
  167. </view>
  168. <view class="four">
  169. <view class="four_1">
  170. <text>订单号</text>
  171. <text>{{info.no}}</text>
  172. </view>
  173. <view class="four_1">
  174. <text>订单状态</text>
  175. <text>{{info.zhStatus||'未识别'}}</text>
  176. </view>
  177. <view class="four_1">
  178. <text>下单时间</text>
  179. <text>{{info.buy_time}}</text>
  180. </view>
  181. <view class="four_1">
  182. <text>订单备注</text>
  183. <text>{{info.remarks}}</text>
  184. </view>
  185. </view>
  186. </view>
  187. </scroll-view>
  188. </view>
  189. <view class="zero_1">
  190. <text>合计</text>
  191. <text>¥{{info.goods_total}}</text>
  192. </view>
  193. </view>
  194. </mobile-frame>
  195. </template>
  196. <script>
  197. export default {
  198. data() {
  199. return {
  200. id: '',
  201. status: '',
  202. info: {},
  203. // 售后状态
  204. statusList: [],
  205. };
  206. },
  207. onLoad: async function(e) {
  208. const that = this;
  209. that.$set(that, `id`, e.id);
  210. that.$set(that, `status`, e.status);
  211. await that.searchOther();
  212. await that.search()
  213. },
  214. onShow: function() {},
  215. methods: {
  216. // 查询详情
  217. async search() {
  218. uni.showLoading({
  219. title: '加载中'
  220. });
  221. const that = this;
  222. let res;
  223. // 待付款
  224. if (that.id && that.status == '0') {
  225. res = await that.$api(`/order/${that.id}`);
  226. } else {
  227. res = await that.$api(`/orderDetail/${that.id}`);
  228. }
  229. if (res.errcode == '0') {
  230. let status = that.statusList.find(i => i.value == res.data.status)
  231. if (status) res.data.zhStatus = status.label;
  232. // 计算优惠劵
  233. // 运费总数和商品总数相加
  234. let total = that.$plus(res.data.total_detail.freight_total, res.data.total_detail.goods_total)
  235. if (res.data?.total_detail?.discount_detail) {
  236. // 有优惠券
  237. var key = Object.keys(res.data.total_detail.discount_detail);
  238. var discount_detail = 0;
  239. for (let val of key) {
  240. for (let var1 in res.data.total_detail.discount_detail[val]) {
  241. // object取key和value
  242. if (Object.hasOwnProperty.call(res.data.total_detail.discount_detail[val], var1)) {
  243. var value = res.data.total_detail.discount_detail[val][var1]
  244. discount_detail = that.$plus(discount_detail, value)
  245. }
  246. }
  247. }
  248. // 优惠劵相减
  249. total = that.$minus(total, discount_detail);
  250. }
  251. if (res.data?.total_detail?.act) {
  252. let act_total = 0;
  253. for (let val of res.data.total_detail.act) act_total = that.$plus(act_total, val.discount)
  254. // 活动相减
  255. total = that.$minus(total, act_total);
  256. }
  257. res.data.goods_total = total
  258. that.$set(that, `info`, res.data);
  259. uni.hideLoading();
  260. }
  261. },
  262. // 查询其他信息
  263. async searchOther() {
  264. const that = this;
  265. let res;
  266. // 查询状态
  267. res = await that.$api(`/dictData`, 'GET', {
  268. code: 'order_process'
  269. })
  270. if (res.errcode == '0') {
  271. that.$set(that, `statusList`, res.data);
  272. }
  273. },
  274. }
  275. }
  276. </script>
  277. <style lang="scss">
  278. .main {
  279. display: flex;
  280. flex-direction: column;
  281. width: 100vw;
  282. height: 100vh;
  283. background-color: #f5f5f5;
  284. .zero {
  285. position: relative;
  286. flex-grow: 1;
  287. .one {
  288. background-color: #fff;
  289. margin: 0 0 2vw 0;
  290. display: flex;
  291. justify-content: space-between;
  292. padding: 2vw;
  293. border-bottom: 2px dashed #ff0000;
  294. .one_1 {
  295. width: 8vw;
  296. text-align: center;
  297. padding: 3vw 0 0;
  298. }
  299. .one_2 {
  300. width: 86vw;
  301. .name {
  302. font-size: 16px;
  303. margin: 0 0 1vw 0;
  304. text {
  305. padding: 0 0 0 2vw;
  306. }
  307. }
  308. .address {
  309. font-size: 14px;
  310. color: #858585;
  311. text {
  312. padding: 0 0 0 2vw;
  313. }
  314. }
  315. }
  316. }
  317. .two {
  318. background-color: #fff;
  319. margin: 0 0 2vw 0;
  320. padding: 2vw;
  321. .two_0 {
  322. text-align: right;
  323. color: #ff0000;
  324. }
  325. .two_1 {
  326. display: flex;
  327. flex-direction: column;
  328. .list {
  329. margin: 0 0 1vw 0;
  330. .list_1 {
  331. font-size: 16px;
  332. margin: 0 0 1vw 0;
  333. text:last-child {
  334. padding: 0 0 0 2vw;
  335. }
  336. }
  337. .list_2 {
  338. display: flex;
  339. flex-direction: column;
  340. .goods {
  341. border-bottom: 1px dashed #f1f1f1;
  342. padding: 2vw 0;
  343. .goods_1 {
  344. display: flex;
  345. .url {
  346. width: 20vw;
  347. .image {
  348. width: 100%;
  349. height: 20vw;
  350. border-radius: 5px;
  351. }
  352. }
  353. .goodsname {
  354. display: flex;
  355. flex-direction: column;
  356. width: 60vw;
  357. padding: 0 2vw;
  358. font-size: 16px;
  359. .specs {
  360. color: var(--f85Color);
  361. font-size: var(--font12Size);
  362. }
  363. .other {
  364. display: flex;
  365. padding: 1vw 0 0 0;
  366. .gift {
  367. margin: 0 1vw 0 0;
  368. font-size: 12px;
  369. color: #FFA500;
  370. border: 1px solid #FFA500;
  371. border-radius: 5px;
  372. padding: 0 1vw;
  373. }
  374. .act {
  375. font-size: 12px;
  376. border: 1px solid var(--fFB1Color);
  377. color: var(--fFB1Color);
  378. border-radius: 5px;
  379. padding: 0 1vw;
  380. }
  381. }
  382. }
  383. .goodsother {
  384. width: 15vw;
  385. text-align: right;
  386. }
  387. }
  388. .goods_2 {
  389. padding: 0 1vw 1vw 0;
  390. font-size: var(--font14Size);
  391. }
  392. .goods_3 {
  393. display: flex;
  394. justify-content: space-between;
  395. border: 1px solid var(--fcColor);
  396. border-radius: 5px;
  397. margin: 0 0 1vw 0;
  398. padding: 1vw;
  399. .left {
  400. .name {
  401. font-size: 14px;
  402. }
  403. .Spec {
  404. font-size: var(--font12Size);
  405. color: var(--f85Color);
  406. }
  407. }
  408. }
  409. }
  410. }
  411. }
  412. }
  413. .two_2 {
  414. .list_1 {
  415. font-size: 16px;
  416. margin: 0 0 1vw 0;
  417. text:last-child {
  418. padding: 0 0 0 2vw;
  419. }
  420. }
  421. .list_2 {
  422. display: flex;
  423. flex-direction: column;
  424. .goods {
  425. border-bottom: 1px dashed #f1f1f1;
  426. padding: 2vw 0;
  427. .goods_1 {
  428. display: flex;
  429. .url {
  430. width: 20vw;
  431. .image {
  432. width: 100%;
  433. height: 20vw;
  434. border-radius: 5px;
  435. }
  436. }
  437. .goodsname {
  438. display: flex;
  439. flex-direction: column;
  440. width: 60vw;
  441. padding: 0 2vw;
  442. font-size: 16px;
  443. .specs {
  444. color: var(--f85Color);
  445. font-size: var(--font12Size);
  446. }
  447. .other {
  448. display: flex;
  449. padding: 1vw 0 0 0;
  450. .gift {
  451. margin: 0 1vw 0 0;
  452. font-size: 12px;
  453. color: #FFA500;
  454. border: 1px solid #FFA500;
  455. border-radius: 5px;
  456. padding: 0 1vw;
  457. }
  458. .act {
  459. font-size: 12px;
  460. border: 1px solid var(--fFB1Color);
  461. color: var(--fFB1Color);
  462. border-radius: 5px;
  463. padding: 0 1vw;
  464. }
  465. }
  466. }
  467. .goodsother {
  468. width: 15vw;
  469. text-align: right;
  470. }
  471. }
  472. .goods_2 {
  473. padding: 0 1vw 1vw 0;
  474. font-size: var(--font14Size);
  475. }
  476. .goods_3 {
  477. display: flex;
  478. justify-content: space-between;
  479. border: 1px solid var(--fcColor);
  480. border-radius: 5px;
  481. margin: 0 0 1vw 0;
  482. padding: 1vw;
  483. .left {
  484. .name {
  485. font-size: 14px;
  486. }
  487. .Spec {
  488. font-size: var(--font12Size);
  489. color: var(--f85Color);
  490. }
  491. }
  492. }
  493. }
  494. }
  495. }
  496. }
  497. .thr {
  498. background-color: #fff;
  499. margin: 0 0 2vw 0;
  500. padding: 0 2vw;
  501. .thr_1 {
  502. margin: 2vw 0;
  503. font-size: 15px;
  504. display: flex;
  505. justify-content: space-between;
  506. }
  507. .thr_1:last-child {
  508. text:last-child {
  509. color: #ff0000;
  510. }
  511. }
  512. }
  513. .four {
  514. background-color: #fff;
  515. margin: 0 0 2vw 0;
  516. padding: 0 2vw;
  517. .four_1 {
  518. margin: 2vw 0;
  519. font-size: 15px;
  520. display: flex;
  521. justify-content: space-between;
  522. }
  523. }
  524. }
  525. .zero_1 {
  526. background-color: white;
  527. width: 96vw;
  528. padding: 4vw 2vw;
  529. font-size: 16px;
  530. text:last-child {
  531. color: #ff0000;
  532. padding: 0 0 0 2vw;
  533. }
  534. }
  535. }
  536. .scroll-view {
  537. position: absolute;
  538. top: 0;
  539. left: 0;
  540. right: 0;
  541. bottom: 0;
  542. .list-scroll-view {
  543. display: flex;
  544. flex-direction: column;
  545. }
  546. }
  547. </style>