info.vue 16 KB

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