orderDetail.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788
  1. <template>
  2. <block>
  3. <!-- <login @onLoginBack="onLoginBack"></login> -->
  4. <view class="content">
  5. <view class="orderStatus">
  6. <image :src="
  7. info.state == 2
  8. ? 'https://ymyun-oss.oss-cn-hangzhou.aliyuncs.com/yidu_tc/public/upload/12/8/74354f7d56ad4043e279760e09307bef.png'
  9. : info.state == 3
  10. ? 'https://ymyun-oss.oss-cn-hangzhou.aliyuncs.com/yidu_tc/public/upload/12/8/cb6d9cec19387616fa955f95d8470bc5.png'
  11. : info.state == 5
  12. ? 'https://ymyun-oss.oss-cn-hangzhou.aliyuncs.com/yidu_tc/public/upload/12/8/f05de1ad262ae8a303f5b38ca2419eae.png'
  13. : ''
  14. "></image>
  15. <view>
  16. {{
  17. info.state == 2
  18. ? '待发货'
  19. : info.state == 3
  20. ? '待收货'
  21. : info.state == 5
  22. ? '已完成'
  23. : ''
  24. }}
  25. </view>
  26. </view>
  27. <view class="p-common">
  28. <view class="p-list icenterY">
  29. <text>手机号码</text>
  30. <text class="cPhone">{{ info.delivery.username }}{{ info.delivery.mobile }}</text>
  31. </view>
  32. <view class="p-list">
  33. <text>收货地址</text>
  34. <text class="cArea">{{ info.delivery.address }}</text>
  35. <view class="cDetailAddress">{{ info.receiver_address }}</view>
  36. </view>
  37. </view>
  38. <!-- <view class="p-common iflexC" v-if="info.receive_type == 2">
  39. <text>物流信息</text>
  40. <text class="p-con">快递单号:{{ info.deliver_no || '暂无物流信息' }}</text>
  41. <view class="p-con">
  42. <text>快递名称:{{ info.send_comp || '暂无物流信息' }}</text>
  43. </view>
  44. </view> -->
  45. <view class="p-common iflex radiuBot">
  46. <image class="p-goodsImg" :src="info.products[0].image"></image>
  47. <view class="p-goods">
  48. <text class="p-goodsName bold">{{ info.products[0].title }}</text>
  49. <!-- <text class="p-goodsTips">{{ info.good_info ? info.good_info : '' }}</text> -->
  50. <view class="p-sku ibetween">
  51. <!-- <text class="p-red"><text wx:if="{{info.pay_money}}">¥{{info.pay_money}} +</text> {{info.integral}}{{unit}}</text> -->
  52. <text class="p-con">×{{ info.products[0].number }}</text>
  53. </view>
  54. </view>
  55. </view>
  56. <view class="p-common radiuTop">
  57. <view class="ibetween p-list icenterY">
  58. <text>商品价格:</text>
  59. <text class="p-con">¥{{ info.products[0].price }}</text>
  60. </view>
  61. <view class="ibetween p-list">
  62. <text>商品积分:</text>
  63. <text class="p-con">{{ info.products[0].price }}积分</text>
  64. </view>
  65. <view class="ibetween p-list">
  66. <text>运费:</text>
  67. <text class="p-con">¥{{ info.delivery_price }}</text>
  68. </view>
  69. <view class="ibetween p-list icenterY">
  70. <text>支付方式:</text>
  71. <text class="p-con">
  72. {{ info.remark }}
  73. </text>
  74. </view>
  75. <view class="ibetween p-list">
  76. <text>实际支付:</text>
  77. <text class="p-con colorActive">
  78. <text class="p-red">
  79. <text v-if="info.delivery_price!='0.00'">¥{{ info.delivery_price }}+</text>
  80. {{ info.products[0].price}}
  81. </text>
  82. 积分
  83. </text>
  84. </view>
  85. </view>
  86. <!-- <view class="p-common iflex">
  87. <text class="message">买家留言:</text>
  88. <text>{{ info.user_mark ? info.user_mark : '暂无留言' }}</text>
  89. </view>
  90. <view class="p-common" v-if="info.is_comment == 1">
  91. <view class="p-list icenterY">
  92. <text>买家评价:</text>
  93. <text class="p-con">{{ info.inorder_comment ? info.inorder_comment.content : '暂无评价' }}</text>
  94. </view> -->
  95. <!-- <view class="p-list icenterY">
  96. <text>商家回复:</text>
  97. <text class="p-con">{{info.reply ? info.reply : '暂无回复'}}</text>
  98. </view> -->
  99. <view class="orderInfo">
  100. <view class="orderInfoTip">订单信息</view>
  101. <view class="orderItem">
  102. <view>下单编号:</view>
  103. <view>{{ info.out_trade_no }}</view>
  104. <view @tap="copy" :data-on="info.out_trade_no">复制</view>
  105. </view>
  106. <view class="orderItem">
  107. <view>下单时间:</view>
  108. <view>{{ info.createtime }}</view>
  109. </view>
  110. </view>
  111. </view>
  112. <view class="p-footer iflex isFixed icenterY"
  113. v-if="info.state == 3 || info.state == 5">
  114. <!-- <button wx:if="{{info.integral_money}}" bindtap="backMoney">申请退款</button> -->
  115. <button @tap="confirm(id)" v-if="info.state == 3" class="activeBtn1">确认收货</button>
  116. <button @click.stop="buyNext(info.products[0].id)" v-if="info.state == 5" class="activeBtn2">再次购买</button>
  117. </view>
  118. </block>
  119. </template>
  120. <script>
  121. var app = getApp();
  122. export default {
  123. data() {
  124. return {
  125. info: {
  126. },
  127. id: '',
  128. };
  129. }
  130. /**
  131. * 生命周期函数--监听页面加载
  132. */
  133. ,
  134. onLoad: function(options) {
  135. this.id = options.id;
  136. this.getInfo()
  137. },
  138. onShow: function() {},
  139. onPullDownRefresh: function() {
  140. this.getInfo();
  141. },
  142. /**
  143. * 页面上拉触底事件的处理函数
  144. */
  145. onReachBottom: function() {},
  146. /**
  147. * 用户点击右上角分享
  148. */
  149. onShareAppMessage: function() {},
  150. methods: {
  151. async confirm(id) {
  152. // 确认收货
  153. let that = this;
  154. let [error, res] = await uni.showModal({
  155. title: '确认收货?'
  156. });
  157. if (res.confirm == true) {
  158. let res = await that.$api.request('/order/received', 'GET', {
  159. order_id: id,
  160. type:1
  161. });
  162. if (res) {
  163. that.getInfo()
  164. }
  165. return true;
  166. }
  167. this.$api.msg('收货失败');
  168. return false;
  169. },
  170. buyNext(id) {
  171. uni.navigateTo({
  172. url: `/pages/intergalShop/goodsDetail?id=${id}`
  173. });
  174. },
  175. copy(e) {
  176. uni.setClipboardData({
  177. data: e.currentTarget.dataset.on,
  178. success: function(res) {
  179. uni.showToast({
  180. title: '复制成功',
  181. icon: 'none'
  182. });
  183. }
  184. });
  185. },
  186. lookOrder() {
  187. uni.navigateTo({
  188. url: `/pages/other/logistics/logistics?phone=${this.info.receiver_mobile}&no=${this.info.deliver_no}`
  189. });
  190. },
  191. async getInfo() {
  192. let data = await this.$api.request('/order/detail', 'GET', {
  193. type: 1,
  194. order_id: this.id
  195. });
  196. console.log(data)
  197. this.info = data;
  198. },
  199. toPage(e) {
  200. app.globalData.toPage(e);
  201. }
  202. }
  203. };
  204. </script>
  205. <style>
  206. /* yidu_tc/pages/jifen/integral/orderDetail/orderDetail.wxss */
  207. page {
  208. background: #f4f4f4;
  209. }
  210. .content {
  211. width: 100%;
  212. box-sizing: border-box;
  213. padding: 20rpx 20rpx 120rpx;
  214. }
  215. .p-common {
  216. border-radius: 20rpx;
  217. padding: 26rpx 30rpx;
  218. margin-bottom: 20rpx;
  219. background: white;
  220. /* width: calc(100% - 132rpx); */
  221. position: relative;
  222. }
  223. .p-common input {
  224. width: 74%;
  225. }
  226. .p-img {
  227. height: 44rpx;
  228. width: 44rpx;
  229. margin-right: 8rpx;
  230. color: #333;
  231. vertical-align: top;
  232. }
  233. .shareicon {
  234. position: absolute;
  235. right: 30rpx;
  236. top: calc(50% - 8px);
  237. }
  238. .p-goods {
  239. width: 72%;
  240. }
  241. .p-goodsImg {
  242. height: 128rpx;
  243. width: 128rpx;
  244. margin-right: 18rpx;
  245. flex-shrink: 0;
  246. }
  247. .p-goodsName {
  248. text-overflow: ellipsis;
  249. white-space: nowrap;
  250. overflow: hidden;
  251. display: block;
  252. font-size: 32rpx;
  253. }
  254. .p-goodsTips {
  255. color: #666;
  256. font-size: 24rpx;
  257. }
  258. .p-con {
  259. font-size: 24rpx;
  260. color: #666;
  261. }
  262. .p-list {
  263. border-bottom: 1px solid #f2f2f2;
  264. padding: 26rpx 0;
  265. }
  266. .p-list:first-child {
  267. padding-top: 0;
  268. }
  269. .p-list:last-child {
  270. border: none;
  271. padding-bottom: 0;
  272. }
  273. .p-red {
  274. color: #fe6000;
  275. font-size: 28rpx;
  276. font-weight: 700;
  277. }
  278. .isFixed {
  279. position: fixed;
  280. bottom: 32rpx;
  281. }
  282. .p-total {
  283. width: 50%;
  284. text-align: center;
  285. }
  286. .p-btn {
  287. border: none;
  288. background: #f62e2e;
  289. color: white;
  290. height: 100%;
  291. border-radius: 0 20rpx 20rpx 0;
  292. width: 50%;
  293. }
  294. .p-common:last-child {
  295. padding: 0;
  296. /* width: calc(100% - 72rpx); */
  297. margin-bottom: 0;
  298. }
  299. .bold {
  300. font-weight: bold;
  301. }
  302. input {
  303. margin-top: -4rpx;
  304. }
  305. .p-icon {
  306. height: 30rpx;
  307. width: 30rpx;
  308. margin-right: 8rpx;
  309. vertical-align: center;
  310. }
  311. .p-sku {
  312. position: absolute;
  313. bottom: 20rpx;
  314. width: calc(72% - 30rpx);
  315. }
  316. .message {
  317. flex-shrink: 0;
  318. }
  319. .p-footer {
  320. position: fixed;
  321. bottom: 0;
  322. width: 100%;
  323. left: 0;
  324. background: white;
  325. height: 100rpx;
  326. display: flex;
  327. flex-direction: row-reverse !important;
  328. }
  329. button {
  330. width: 188rpx;
  331. border-radius: 40rpx;
  332. border: 1px solid #999;
  333. background: none;
  334. color: #666;
  335. font-size: 28rpx;
  336. margin-right: 22rpx;
  337. margin-left: 0;
  338. }
  339. button::after {
  340. border: none;
  341. }
  342. .p-common:last-child {
  343. padding: 26rpx 30rpx !important;
  344. /* width: calc(100% - 60rpx); */
  345. margin-bottom: 0;
  346. }
  347. .orderStatus {
  348. display: flex;
  349. align-items: center;
  350. justify-content: center;
  351. padding: 12rpx 0 30rpx;
  352. }
  353. .orderStatus>image {
  354. width: 46rpx;
  355. height: 46rpx;
  356. margin-top: 8rpx;
  357. }
  358. .orderStatus>view {
  359. font-size: 35rpx;
  360. font-weight: 700;
  361. color: #333333;
  362. margin-left: 16rpx;
  363. }
  364. .hxCode {
  365. display: flex;
  366. align-items: center;
  367. }
  368. .hxCode>view {
  369. color: #fe6b05;
  370. font-size: 28rpx;
  371. }
  372. .hxCode>image {
  373. width: 28rpx;
  374. margin-right: 10rpx;
  375. margin-top: 4rpx;
  376. }
  377. .cPhone {
  378. font-size: 28rpx;
  379. color: #333333;
  380. margin-left: 30rpx;
  381. }
  382. .cArea {
  383. font-size: 28rpx;
  384. color: #333333;
  385. margin-left: 30rpx;
  386. }
  387. .cDetailAddress {
  388. color: #666666;
  389. margin-top: 12rpx;
  390. }
  391. .shopInfo {
  392. padding: 24rpx 24rpx 30rpx 24rpx;
  393. margin: 18rpx 0rpx;
  394. border-radius: 20rpx;
  395. }
  396. .shopTop-name {
  397. font-size: 28rpx;
  398. width: 500rpx;
  399. color: #000;
  400. }
  401. .shopTop-btn {
  402. width: 83rpx;
  403. height: 35rpx;
  404. display: flex;
  405. justify-content: center;
  406. align-items: center;
  407. color: #fd6000;
  408. border: 1px solid #fd6000;
  409. border-radius: 30rpx;
  410. font-size: 25rpx;
  411. }
  412. .shopBot {
  413. margin-top: 30rpx;
  414. }
  415. .shopTD {
  416. flex: 1;
  417. display: flex;
  418. flex-direction: column;
  419. }
  420. .l-shopTime,
  421. .l-shopAddress {
  422. font-size: 25rpx;
  423. color: #666;
  424. line-height: 1;
  425. }
  426. .l-shopAddress {
  427. width: 410rpx;
  428. margin-top: 18rpx;
  429. }
  430. .shoploc:first-of-type {
  431. max-width: 104rpx;
  432. }
  433. .shoploc {
  434. font-size: 20rpx;
  435. color: #999;
  436. line-height: 1;
  437. }
  438. .shoploc image {
  439. width: 42rpx;
  440. height: 42rpx;
  441. margin-bottom: 12rpx;
  442. }
  443. .shopSu {
  444. height: 48rpx;
  445. width: 1rpx;
  446. background: #999999;
  447. margin: 0 38rpx;
  448. }
  449. .radiuBot {
  450. border-radius: 20rpx 20rpx 0 0 !important;
  451. margin-bottom: 0;
  452. }
  453. .radiuTop {
  454. border-radius: 0 0 20rpx 20rpx !important;
  455. }
  456. .colorActive {
  457. color: #fe6000;
  458. }
  459. .orderInfo {
  460. margin-top: 20rpx;
  461. background: #fff;
  462. border-radius: 20rpx;
  463. padding-bottom: 20rpx;
  464. }
  465. .iflexC {
  466. display: flex;
  467. flex-direction: column
  468. }
  469. .orderInfoTip {
  470. padding: 30rpx 30rpx 26rpx 30rpx;
  471. box-sizing: border-box;
  472. font-weight: 700;
  473. font-size: 28rpx;
  474. color: #333333;
  475. border-bottom: 1px solid #dcdcdc;
  476. margin-bottom: 30rpx;
  477. }
  478. .orderItem {
  479. padding: 0rpx 0 0rpx 30rpx;
  480. display: flex;
  481. align-items: center;
  482. margin: 20rpx 0;
  483. }
  484. .orderItem>view:nth-child(1) {
  485. font-size: 26rpx;
  486. color: #999999;
  487. }
  488. .orderItem>view:nth-child(2) {
  489. font-size: 26rpx;
  490. color: #333;
  491. margin-left: 8rpx;
  492. }
  493. .orderItem>view:nth-child(3) {
  494. width: 72rpx;
  495. height: 34rpx;
  496. line-height: 34rpx;
  497. text-align: center;
  498. border-radius: 12rpx;
  499. font-size: 25rpx;
  500. color: #000;
  501. border: 1px solid #898989;
  502. margin-left: 22rpx;
  503. }
  504. .activeBtn1 {
  505. background:#FB4C6F;
  506. color: #fff !important;
  507. border: none;
  508. }
  509. .activeBtn2 {
  510. background:#FB4C6F;
  511. color: #fff !important;
  512. border: none;
  513. }
  514. .boxWrap {
  515. width: 524rpx;
  516. border-radius: 30rpx;
  517. background: #fff;
  518. }
  519. .codeInfo {
  520. box-sizing: border-box;
  521. display: flex;
  522. align-items: center;
  523. background: linear-gradient(to right, #fda401, #fe6b05);
  524. padding: 35rpx 53rpx 27rpx 17rpx;
  525. border-radius: 12rpx 12rpx 0 0;
  526. }
  527. .codeInfo>image {
  528. width: 86rpx;
  529. height: 86rpx;
  530. border-radius: 12rpx;
  531. }
  532. .goodBoxInfo {
  533. color: #fff;
  534. margin-left: 18rpx;
  535. }
  536. .goodBoxInfo>view:nth-child(1) {
  537. font-size: 28rpx;
  538. color: #ffffff;
  539. font-weight: 700;
  540. }
  541. .goodBoxInfo>view:nth-child(2) {
  542. font-size: 28rpx;
  543. color: #ffffff;
  544. overflow: hidden;
  545. text-overflow: ellipsis;
  546. display: -webkit-box;
  547. -webkit-line-clamp: 2;
  548. -webkit-box-orient: vertical;
  549. }
  550. .codeWrap {
  551. display: flex;
  552. flex-direction: column;
  553. align-items: center;
  554. justify-content: center;
  555. padding: 33rpx 0;
  556. }
  557. .code1 {
  558. display: flex;
  559. align-items: center;
  560. }
  561. .code1>view:nth-child(1),
  562. .code1>view:nth-child(3) {
  563. width: 74rpx;
  564. height: 1px;
  565. background: #333333;
  566. }
  567. .code1>view:nth-child(2) {
  568. font-size: 24rpx;
  569. color: #333;
  570. font-weight: 700;
  571. margin: 0 20rpx;
  572. }
  573. .hxcodeImg {
  574. width: 340rpx;
  575. height: 340rpx;
  576. margin: 20rpx 0;
  577. }
  578. .codeTip {
  579. font-size: 24rpx;
  580. color: #333;
  581. }
  582. .download {
  583. width: 351rpx;
  584. height: 82rpx;
  585. display: flex;
  586. align-items: center;
  587. justify-content: center;
  588. background: linear-gradient(to right, #fda401, #fe6b05);
  589. border-radius: 40rpx;
  590. margin-top: 20rpx;
  591. }
  592. .download>view {
  593. font-size: 31rpx;
  594. color: #fff;
  595. }
  596. .download>image {
  597. width: 30rpx;
  598. height: 30rpx;
  599. margin-left: 24rpx;
  600. }
  601. .allBox {
  602. display: flex;
  603. flex-direction: column;
  604. align-items: center;
  605. position: absolute;
  606. top: 50%;
  607. left: 50%;
  608. transform: translate(-50%, -50%);
  609. }
  610. .closeBox {
  611. width: 50rpx;
  612. height: 50rpx;
  613. margin-top: 30rpx;
  614. }
  615. .iflex {
  616. display: flex;
  617. }
  618. .icentery,
  619. .icenterY {
  620. display: flex;
  621. align-items: center;
  622. flex-direction: row;
  623. }
  624. .ibetween {
  625. display: flex;
  626. justify-content: space-between
  627. }
  628. .mengban {
  629. position: fixed;
  630. top: 0;
  631. left: 0;
  632. right: 0;
  633. bottom: 0;
  634. background: rgba(0, 0, 0, 0.7);
  635. }
  636. </style>