DorderDetail.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516
  1. <template>
  2. <view style="height: 100%;">
  3. <u-navbar v-if="navFixed" title="订单详情" title-color="#ffffff" back-icon-color="#ffffff" :border-bottom="false" :background="{ backgroundImage: primaryJb }"></u-navbar>
  4. <view class="box" v-if="order_detail.orderStatus">
  5. <view class="top-view primary-btn">
  6. <uniStatusBar/>
  7. <view class="nav-bar">
  8. <image @click="backPage" class="nv-back" src="https://onlineimg.qianniao.vip/ic-back-fff.png" mode="aspectFit"></image>
  9. <text class="title-text">订单详情</text>
  10. </view>
  11. <view class="order-status-view clearfix">
  12. <view class="float_left">
  13. <view class="order-status-text">
  14. <text>
  15. {{
  16. order_detail.orderStatus === 1
  17. ? '待付款'
  18. : order_detail.orderStatus === 2
  19. ? '待付款'
  20. : order_detail.orderStatus === 3
  21. ? '待发货'
  22. : order_detail.orderStatus === 4
  23. ? '待收货'
  24. : order_detail.orderStatus === 5
  25. ? '已完成'
  26. : order_detail.orderStatus === 6
  27. ? '已关闭'
  28. : ''
  29. }}
  30. </text>
  31. <view class="children-order-status">
  32. {{
  33. order_detail.orderStatus === 1
  34. ? '请尽快付款,宝贝才能快些到您身边哦'
  35. : order_detail.orderStatus === 2
  36. ? '请尽快付款,宝贝才能快些到您身边哦'
  37. : order_detail.orderStatus === 3
  38. ? '正在为您紧急备货中……'
  39. : order_detail.orderStatus === 4
  40. ? '确认宝贝无误后再签收哦!'
  41. : order_detail.orderStatus === 5
  42. ? '本次交易已完成'
  43. : order_detail.orderStatus === 6
  44. ? '本次交易已关闭'
  45. : ''
  46. }}
  47. </view>
  48. </view>
  49. </view>
  50. <view class="float_right">
  51. <text
  52. class="ibonfont order-icon"
  53. :class="[
  54. order_detail.orderStatus === 1
  55. ? 'ibondaifukuan1'
  56. : order_detail.orderStatus === 2
  57. ? 'ibondaifukuan1'
  58. : order_detail.orderStatus === 3
  59. ? 'ibondaifahuo1'
  60. : order_detail.orderStatus === 4
  61. ? 'ibondaishouhuo'
  62. : order_detail.orderStatus === 5
  63. ? 'ibonyiwancheng'
  64. : order_detail.orderStatus === 6
  65. ? 'ibonjiaoyiguanbix'
  66. : ''
  67. ]"
  68. ></text>
  69. </view>
  70. </view>
  71. </view>
  72. <view class="address-view view-main clearfix">
  73. <view class="vip-info">
  74. <text class="vip-i-label">会员:</text>
  75. <image class="customerAvatar" :src="order_detail.customerAvatar" mode="aspectFill"></image>
  76. <text>{{ order_detail.customerName }}</text>
  77. </view>
  78. <view class="vip-info">
  79. <text class="vip-i-label">分销层级:</text>
  80. <text>{{ order_detail.retLevelMsg }}</text>
  81. </view>
  82. </view>
  83. <view class="goods-view view-main">
  84. <block v-for="(it, gindex) in order_detail.orderGoods" :key="gindex">
  85. <view class="goods-li clearfix" @click="goPage(`/pagesT/product/product?id=${it.goodsId}`)">
  86. <image class="goods-img float_left" :src="it.goodsImages" mode="aspectFit"></image>
  87. <view class="float_right goods-right">
  88. <view class="goods-name">{{ it.goodsName }}</view>
  89. <view class="goods-descrip">
  90. 规格:
  91. <text style="padding-right: 6upx;">{{ it.unitName }}</text>
  92. <block v-for="(ip, indexSP) in it.specGroup" :key="indexSP">
  93. <text v-if="indexSP > 0">-</text>
  94. <text>{{ ip.specValueName }}</text>
  95. </block>
  96. </view>
  97. <view class="goods-price clearfix">
  98. <view class="float_left">
  99. <text class="price primary-color">¥{{ it.price }}</text>
  100. </view>
  101. <view class="float_right">
  102. <text class="icon-jia">*</text>
  103. <text class="goods-num">{{ it.buyNum }}</text>
  104. </view>
  105. </view>
  106. </view>
  107. </view>
  108. </block>
  109. </view>
  110. <view class="view-main order-info-view">
  111. <view class="order-info-tit">订单信息</view>
  112. <view class="order-info-cont">
  113. <view class="order-info-li">
  114. <view class="clearfix info-item">
  115. <text class="subtitle float_left">订单编号:</text>
  116. <text class="titledetail float_right">{{ order_detail.orderNo || '--' }}</text>
  117. </view>
  118. <view class="clearfix info-item">
  119. <text class="subtitle float_left">下单时间:</text>
  120. <text class="titledetail float_right">{{ $_utils.formatDate(order_detail.createTime) || '--' }}</text>
  121. </view>
  122. </view>
  123. <view class="order-info-li order-money-view">
  124. <view class="clearfix info-item">
  125. <text class="subtitle float_left">支付方式</text>
  126. <text class="money-val float_right">{{ order_detail.payTypeMsg }}</text>
  127. </view>
  128. <view class="clearfix info-item">
  129. <text class="subtitle float_left">配送方式</text>
  130. <text class="money-val float_right">{{ order_detail.deliveryMsg || '--' }}</text>
  131. </view>
  132. </view>
  133. </view>
  134. <view class="order-price-view clearfix">
  135. <view class="float_left">
  136. <span>{{ text_set.commission || '佣金' }}:</span>
  137. <span class="price primary-color">¥{{ order_detail.retMoney }}</span>
  138. </view>
  139. <view class="float_right">
  140. <span>实付款:</span>
  141. <span class="price primary-color">¥{{ order_detail.payAmount }}</span>
  142. </view>
  143. </view>
  144. </view>
  145. </view>
  146. <view class="clearfix botton-btn-view" v-if="[1, 2, 4, 5].includes(order_detail.orderStatus)">
  147. <!-- #ifdef APP-PLUS||MP-WEIXIN -->
  148. <BtnView @click="gopay" class=" float_right" v-if="order_detail.orderStatus === 1 || order_detail.orderStatus === 2"><view class="btnS">去付款</view></BtnView>
  149. <!-- #endif -->
  150. <BtnView class="float_right" v-if="order_detail.orderStatus === 4" @click="confirmOrder"><view class="btnS">确认收货</view></BtnView>
  151. <BtnView class="float_right" v-if="order_detail.orderStatus === 5" @click="againPay"><view class="btnS">再次购买</view></BtnView>
  152. <span @click="cancelOrder" class="clearBtnS float_right" v-if="order_detail.orderStatus === 1 || order_detail.orderStatus === 2">取消订单</span>
  153. </view>
  154. </view>
  155. </template>
  156. <script>
  157. import uniStatusBar from '@/components/uni-status-bar/uni-status-bar.vue';
  158. export default {
  159. components: {
  160. uniStatusBar
  161. },
  162. data() {
  163. return {
  164. navFixed: false,
  165. order_id: 0,
  166. price: '',
  167. order_detail: {
  168. receiveData: {
  169. area: {}
  170. },
  171. deliveryMsg: ''
  172. },
  173. no: '',
  174. // 再次购买的goodsData
  175. goodsData: [],
  176. Dorder_id: 0,
  177. text_set: {}
  178. };
  179. },
  180. onLoad(options) {
  181. this.Dorder_id = options.id;
  182. this.text_set = this.$store.state.distributionTextSet;
  183. },
  184. onShow() {
  185. this.getOrderInfoById();
  186. },
  187. onPageScroll(val) {
  188. this.navFixed = val.scrollTop > 5;
  189. },
  190. methods: {
  191. // 再次购买
  192. againPay() {
  193. // if (this.$store.state.baseSet.personnelReview === 5) {
  194. // 验证账户状态
  195. this.userAudit();
  196. if (!this.isUserAudit) {
  197. return;
  198. }
  199. // }
  200. this.goodsData = this.order_detail.goodsData.map(item => {
  201. return {
  202. goodsId: item.goodsId,
  203. buyNum: item.buyNum,
  204. shopId: item.shopId,
  205. skuId: item.skuId,
  206. source: this.$common.source(),
  207. goodsBasicId: item.goodsBasicId
  208. };
  209. });
  210. this.$u.api.addCart({
  211. goodsData: this.goodsData
  212. }).then(res=>{
  213. this.goPage('/pages/cart/cart', 'switchTab');
  214. });
  215. },
  216. // 获取订单详情
  217. getOrderInfoById() {
  218. this.$u.api.getCommissionOrderInfo(this.Dorder_id).then(data=>{
  219. this.order_detail = data.data;
  220. this.price = this.order_detail.totalMoney;
  221. this.no = this.order_detail.no;
  222. this.order_id = data.data.orderId;
  223. });
  224. },
  225. // 去支付
  226. gopay() {
  227. uni.navigateTo({
  228. url: `/pagesT/money/pay?id=${this.order_id}&price=${this.price}&no=${this.no}&payType=${this.order_detail.payType}`
  229. });
  230. },
  231. //取消订单
  232. cancelOrder() {
  233. uni.showModal({
  234. title: '提示',
  235. content: '确定要取消该订单吗?',
  236. success: res => {
  237. if (res.confirm) {
  238. this.$u.api.updateOrderStatus(this.order_id, {
  239. orderStatus: 6
  240. }).then(res=>{
  241. this.$api.msg('取消成功');
  242. this.getOrderInfoById();
  243. });
  244. }
  245. }
  246. });
  247. },
  248. confirmOrder() {
  249. uni.showModal({
  250. title: '提示',
  251. content: '确定要确认收货吗?',
  252. success: res => {
  253. if (res.confirm) {
  254. this.$u.api.updateOrderStatus(this.order_id, {
  255. orderStatus: 5
  256. }).then(res=>{
  257. this.$api.msg('操作成功');
  258. this.getOrderInfoById();
  259. });
  260. }
  261. }
  262. });
  263. }
  264. }
  265. };
  266. </script>
  267. <style lang="scss">
  268. body {
  269. background: $page-color-base;
  270. }
  271. .top-view {
  272. background: $base-btn-bg;
  273. .nav-bar {
  274. padding: 24upx 0;
  275. position: relative;
  276. .nv-back {
  277. position: absolute;
  278. top: 24upx;
  279. left: 24upx;
  280. }
  281. .title-text {
  282. font-size: 32upx;
  283. color: #fff;
  284. display: inline-block;
  285. width: 100%;
  286. text-align: center;
  287. height: 40upx;
  288. }
  289. }
  290. .order-status-view {
  291. color: #fff;
  292. font-size: 36upx;
  293. padding: 40upx;
  294. .order-icon {
  295. margin-right: 10upx;
  296. font-size: 80upx;
  297. opacity: 0.9;
  298. }
  299. .children-order-status {
  300. font-size: 24upx;
  301. font-weight: 300;
  302. padding-top: 10upx;
  303. }
  304. }
  305. }
  306. .box {
  307. width: 100%;
  308. // overflow-y: scroll;
  309. padding-bottom: 140upx;
  310. // height: 100%;
  311. // margin-bottom: 130upx;
  312. background: $page-color-base;
  313. .view-main {
  314. margin-bottom: 24upx;
  315. background: #fff;
  316. // border-radius: 12upx;
  317. padding: 24upx;
  318. }
  319. .goods-view {
  320. padding: 24upx 0;
  321. .shop-name {
  322. color: #333;
  323. font-weight: bold;
  324. font-size: 24upx;
  325. padding: 0 24upx 24upx;
  326. line-height: 30upx;
  327. .shop-logo {
  328. width: 30upx;
  329. height: 30upx;
  330. vertical-align: middle;
  331. margin-right: 10upx;
  332. }
  333. .order-status {
  334. color: $uni-color-primary;
  335. }
  336. }
  337. .goods-li:last-child {
  338. margin-bottom: 0;
  339. }
  340. .goods-li {
  341. background: #fafafa;
  342. padding: 30upx 20upx;
  343. margin-bottom: 20upx;
  344. .goods-img {
  345. width: 180upx;
  346. height: 180upx;
  347. }
  348. .goods-right {
  349. width: 500upx;
  350. margin-left: 20upx;
  351. .goods-name {
  352. color: #333;
  353. font-size: 32upx;
  354. margin-bottom: 19upx;
  355. text-overflow: -o-ellipsis-lastline;
  356. overflow: hidden;
  357. text-overflow: ellipsis;
  358. display: -webkit-box;
  359. -webkit-line-clamp: 1;
  360. line-clamp: 1;
  361. -webkit-box-orient: vertical;
  362. }
  363. .goods-descrip {
  364. font-size: 22upx;
  365. color: #999;
  366. margin-bottom: 28upx;
  367. font-weight: 300;
  368. text-overflow: -o-ellipsis-lastline;
  369. overflow: hidden;
  370. text-overflow: ellipsis;
  371. display: -webkit-box;
  372. -webkit-line-clamp: 1;
  373. line-clamp: 1;
  374. -webkit-box-orient: vertical;
  375. }
  376. .goods-price {
  377. .price {
  378. color: $price-color;
  379. font-size: 40upx;
  380. }
  381. .sku {
  382. font-size: 22upx;
  383. font-weight: 300;
  384. color: #666;
  385. }
  386. .icon-jia {
  387. color: #666;
  388. font-size: 24upx;
  389. }
  390. .goods-num {
  391. font-size: 24upx;
  392. }
  393. }
  394. }
  395. }
  396. }
  397. }
  398. .address-view {
  399. font-size: 28upx;
  400. .vip-info {
  401. padding-bottom: 20upx;
  402. .vip-i-label {
  403. font-size: 24upx;
  404. color: #666;
  405. }
  406. .customerAvatar {
  407. width: 50upx;
  408. height: 50upx;
  409. border-radius: 100%;
  410. margin-right: 20upx;
  411. vertical-align: middle;
  412. }
  413. }
  414. }
  415. .order-info-view {
  416. // font-size: 24upx;
  417. color: #3c3c3c;
  418. .order-info-tit {
  419. font-size: 28upx;
  420. padding-bottom: 20upx;
  421. }
  422. .order-info-cont {
  423. font-size: 24upx;
  424. .info-item {
  425. padding-bottom: 10upx;
  426. .subtitle {
  427. color: #666;
  428. }
  429. }
  430. }
  431. .order-info-li {
  432. border-bottom: 1upx solid #eee;
  433. padding-bottom: 24upx;
  434. margin-bottom: 24upx;
  435. .info-item {
  436. padding-bottom: 10upx;
  437. .subtitle {
  438. color: #666;
  439. font-weight: 300;
  440. }
  441. }
  442. }
  443. .order-price-view {
  444. text-align: right;
  445. font-size: 26upx;
  446. .price {
  447. color: $price-color;
  448. padding-left: 6upx;
  449. font-size: 32upx;
  450. font-weight: 600;
  451. }
  452. }
  453. }
  454. .botton-btn-view {
  455. background: #fff;
  456. position: fixed;
  457. box-shadow: 0upx -2upx 10upx 0upx rgba(136, 136, 136, 0.24);
  458. left: 0;
  459. bottom: 0;
  460. width: 100%;
  461. padding: 20upx;
  462. font-size: 28upx;
  463. .btnS {
  464. width: 240upx;
  465. line-height: 64upx;
  466. color: #ffffff;
  467. text-align: center;
  468. height: 64upx;
  469. // background: $base-btn-bg;
  470. // box-shadow: 0px 2upx 14upx 0upx rgba(116, 190, 66, 0.4);
  471. border-radius: 40upx;
  472. }
  473. .clearBtnS {
  474. width: 240upx;
  475. line-height: 64upx;
  476. color: #6e6e6e;
  477. text-align: center;
  478. margin-right: 10upx;
  479. height: 64upx;
  480. background: rgba(241, 241, 241, 1);
  481. border-radius: 40upx;
  482. }
  483. }
  484. .circleSty {
  485. display: inline-block;
  486. background-color: #9e9e9e;
  487. width: 20upx;
  488. height: 20upx;
  489. border-radius: 50%;
  490. margin-left: 20upx;
  491. }
  492. .subOrder {
  493. position: absolute;
  494. top: -10upx;
  495. left: 60upx;
  496. }
  497. </style>