info.vue 16 KB

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