info.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699
  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'||is_order=='true'">
  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. is_order: false,
  246. info: {},
  247. // 售后状态
  248. statusList: [],
  249. };
  250. },
  251. onLoad: async function(e) {
  252. const that = this;
  253. that.$set(that, `id`, e.id);
  254. that.$set(that, `status`, e.status);
  255. that.$set(that, `is_order`, e.is_order);
  256. await that.searchOther();
  257. await that.search()
  258. },
  259. onShow: function() {},
  260. methods: {
  261. // 查询详情
  262. async search() {
  263. uni.showLoading({
  264. title: '加载中'
  265. });
  266. const that = this;
  267. let res;
  268. // 待付款
  269. if (that.id) {
  270. if (that.is_order) {
  271. if (JSON.parse(that.is_order)) {
  272. res = await that.$api(`/order/${that.id}`);
  273. } else {
  274. res = await that.$api(`/orderDetail/${that.id}`);
  275. }
  276. } else {
  277. if (that.status == '0') {
  278. res = await that.$api(`/order/${that.id}`);
  279. } else {
  280. res = await that.$api(`/orderDetail/${that.id}`);
  281. }
  282. }
  283. if (res.errcode == '0') {
  284. let status = that.statusList.find(i => i.value == res.data.status)
  285. if (status) res.data.zhStatus = status.label;
  286. // 运费总数和商品总数相加
  287. let total = 0;
  288. for (let val of res.data?.total_detail) total = this.$plus(total, val.money)
  289. res.data.goods_total = total
  290. that.$set(that, `info`, res.data);
  291. uni.hideLoading();
  292. }
  293. }
  294. },
  295. // 查询其他信息
  296. async searchOther() {
  297. const that = this;
  298. let res;
  299. // 查询状态
  300. res = await that.$api(`/dictData`, 'GET', {
  301. code: 'order_process'
  302. })
  303. if (res.errcode == '0') that.$set(that, `statusList`, res.data);
  304. },
  305. }
  306. }
  307. </script>
  308. <style lang="scss">
  309. .main {
  310. display: flex;
  311. flex-direction: column;
  312. width: 100vw;
  313. height: 100vh;
  314. background-color: #f5f5f5;
  315. .zero {
  316. position: relative;
  317. flex-grow: 1;
  318. .one {
  319. background-color: #fff;
  320. margin: 0 0 2vw 0;
  321. display: flex;
  322. justify-content: space-between;
  323. padding: 2vw;
  324. border-bottom: 2px dashed #ff0000;
  325. .one_1 {
  326. width: 8vw;
  327. text-align: center;
  328. padding: 3vw 0 0;
  329. }
  330. .one_2 {
  331. width: 86vw;
  332. .name {
  333. font-size: 16px;
  334. margin: 0 0 1vw 0;
  335. text {
  336. padding: 0 0 0 2vw;
  337. }
  338. }
  339. .address {
  340. font-size: 14px;
  341. color: #858585;
  342. text {
  343. padding: 0 0 0 2vw;
  344. }
  345. }
  346. }
  347. }
  348. .two {
  349. background-color: #fff;
  350. margin: 0 0 2vw 0;
  351. padding: 2vw;
  352. .two_0 {
  353. text-align: right;
  354. color: #ff0000;
  355. }
  356. .two_1 {
  357. display: flex;
  358. flex-direction: column;
  359. .list {
  360. margin: 0 0 1vw 0;
  361. .list_1 {
  362. font-size: 16px;
  363. margin: 0 0 1vw 0;
  364. text:last-child {
  365. padding: 0 0 0 2vw;
  366. }
  367. .r {
  368. .set {
  369. margin: 0 1vw 0 0;
  370. font-size: 12px;
  371. border-radius: 5px;
  372. padding: 0 1vw;
  373. color: #ffffff;
  374. background-color: #FF6347;
  375. border: 1px solid #FFA500;
  376. }
  377. }
  378. }
  379. .list_2 {
  380. display: flex;
  381. flex-direction: column;
  382. .goods {
  383. border-bottom: 1px dashed #f1f1f1;
  384. padding: 2vw 0;
  385. .goods_1 {
  386. display: flex;
  387. .url {
  388. width: 20vw;
  389. .image {
  390. width: 100%;
  391. height: 20vw;
  392. border-radius: 5px;
  393. }
  394. }
  395. .goodsname {
  396. display: flex;
  397. flex-direction: column;
  398. width: 60vw;
  399. padding: 0 2vw;
  400. font-size: 16px;
  401. .specs {
  402. color: var(--f85Color);
  403. font-size: var(--font12Size);
  404. }
  405. .other {
  406. display: flex;
  407. padding: 1vw 0 0 0;
  408. .gift {
  409. margin: 0 1vw 0 0;
  410. font-size: 12px;
  411. color: #FFA500;
  412. border: 1px solid #FFA500;
  413. border-radius: 5px;
  414. padding: 0 1vw;
  415. }
  416. .act {
  417. font-size: 12px;
  418. border: 1px solid var(--fFB1Color);
  419. color: var(--fFB1Color);
  420. border-radius: 5px;
  421. padding: 0 1vw;
  422. }
  423. }
  424. }
  425. .goodsother {
  426. width: 15vw;
  427. text-align: right;
  428. }
  429. }
  430. .goods_2 {
  431. padding: 0 1vw 1vw 0;
  432. font-size: var(--font14Size);
  433. }
  434. .goods_3 {
  435. display: flex;
  436. justify-content: space-between;
  437. border: 1px solid var(--fcColor);
  438. border-radius: 5px;
  439. margin: 0 0 1vw 0;
  440. padding: 1vw;
  441. .left {
  442. .name {
  443. font-size: 14px;
  444. }
  445. .Spec {
  446. font-size: var(--font12Size);
  447. color: var(--f85Color);
  448. }
  449. }
  450. }
  451. }
  452. }
  453. .list_3 {
  454. display: flex;
  455. justify-content: space-between;
  456. margin: 0 0 2vw 0;
  457. padding: 2vw 0;
  458. .list_3_1 {
  459. font-size: var(--font16Size);
  460. color: var(--f85Color);
  461. }
  462. text {
  463. padding: 0 1vw 0 0;
  464. font-size: var(--font20Szie);
  465. }
  466. }
  467. }
  468. }
  469. .two_2 {
  470. .list_1 {
  471. font-size: 16px;
  472. margin: 0 0 1vw 0;
  473. text:last-child {
  474. padding: 0 0 0 2vw;
  475. }
  476. }
  477. .list_2 {
  478. display: flex;
  479. flex-direction: column;
  480. .goods {
  481. border-bottom: 1px dashed #f1f1f1;
  482. padding: 2vw 0;
  483. .set_name {
  484. padding: 2vw;
  485. .r {
  486. .set {
  487. margin: 0 1vw 0 0;
  488. font-size: 12px;
  489. border-radius: 5px;
  490. padding: 0 1vw;
  491. color: #ffffff;
  492. background-color: #FF6347;
  493. border: 1px solid #FFA500;
  494. }
  495. }
  496. }
  497. .goods_1 {
  498. display: flex;
  499. .url {
  500. width: 20vw;
  501. .image {
  502. width: 100%;
  503. height: 20vw;
  504. border-radius: 5px;
  505. }
  506. }
  507. .goodsname {
  508. display: flex;
  509. flex-direction: column;
  510. width: 60vw;
  511. padding: 0 2vw;
  512. font-size: 16px;
  513. .specs {
  514. color: var(--f85Color);
  515. font-size: var(--font12Size);
  516. }
  517. .other {
  518. display: flex;
  519. padding: 1vw 0 0 0;
  520. .gift {
  521. margin: 0 1vw 0 0;
  522. font-size: 12px;
  523. color: #FFA500;
  524. border: 1px solid #FFA500;
  525. border-radius: 5px;
  526. padding: 0 1vw;
  527. }
  528. .act {
  529. font-size: 12px;
  530. border: 1px solid var(--fFB1Color);
  531. color: var(--fFB1Color);
  532. border-radius: 5px;
  533. padding: 0 1vw;
  534. }
  535. }
  536. }
  537. .goodsother {
  538. width: 15vw;
  539. text-align: right;
  540. }
  541. }
  542. .goods_2 {
  543. padding: 0 1vw 1vw 0;
  544. font-size: var(--font14Size);
  545. }
  546. .goods_3 {
  547. display: flex;
  548. justify-content: space-between;
  549. border: 1px solid var(--fcColor);
  550. border-radius: 5px;
  551. margin: 0 0 1vw 0;
  552. padding: 1vw;
  553. .left {
  554. .name {
  555. font-size: 14px;
  556. }
  557. .Spec {
  558. font-size: var(--font12Size);
  559. color: var(--f85Color);
  560. }
  561. }
  562. }
  563. .goods_4 {
  564. display: flex;
  565. justify-content: space-between;
  566. margin: 0 0 2vw 0;
  567. padding: 2vw 0;
  568. .goods_4_1 {
  569. font-size: var(--font16Size);
  570. color: var(--f85Color);
  571. }
  572. text {
  573. padding: 0 1vw 0 0;
  574. font-size: var(--font20Szie);
  575. }
  576. }
  577. }
  578. }
  579. }
  580. }
  581. .thr {
  582. background-color: #fff;
  583. margin: 0 0 2vw 0;
  584. padding: 0 2vw;
  585. .thr_1 {
  586. margin: 2vw 0;
  587. font-size: 15px;
  588. display: flex;
  589. justify-content: space-between;
  590. }
  591. .thr_1:last-child {
  592. text:last-child {
  593. color: #ff0000;
  594. }
  595. }
  596. }
  597. .four {
  598. background-color: #fff;
  599. margin: 0 0 2vw 0;
  600. padding: 0 2vw;
  601. .four_1 {
  602. margin: 2vw 0;
  603. font-size: 15px;
  604. display: flex;
  605. justify-content: space-between;
  606. }
  607. }
  608. }
  609. .zero_1 {
  610. background-color: white;
  611. width: 96vw;
  612. padding: 4vw 2vw;
  613. font-size: 16px;
  614. text:last-child {
  615. color: #ff0000;
  616. padding: 0 0 0 2vw;
  617. }
  618. }
  619. }
  620. .scroll-view {
  621. position: absolute;
  622. top: 0;
  623. left: 0;
  624. right: 0;
  625. bottom: 0;
  626. .list-scroll-view {
  627. display: flex;
  628. flex-direction: column;
  629. }
  630. }
  631. </style>