1
0

detail.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582
  1. <template>
  2. <app-layout>
  3. <view class='status'>
  4. <image class='status-bg' :src='clerkImg.detail'></image>
  5. <view class="status-text" v-if="detail.is_use == 1 && detail.cancel_status == 0">已核销</view>
  6. <view class='status-info' v-if="detail.is_use == 1 ||detail.clerk_id > 0">
  7. <view v-if="card_id > 0">核销时间:{{detail.clerked_at}}</view>
  8. <view v-if="id > 0">核销时间:{{detail.orderClerk.updated_at}}</view>
  9. <view class="status-price" v-if="id > 0">核销金额:¥{{detail.total_pay_price}}</view>
  10. </view>
  11. <view class="status-text" v-if="(detail.is_use == 0 && card_id > 0) || (detail.clerk_id == 0&&detail.cancel_status == 0)">未核销</view>
  12. <view class="status-text" v-if="detail.cancel_status == 1">已退款</view>
  13. <view class='status-info' v-if="detail.cancel_status == 1">
  14. <view v-if="id > 0">退款时间:{{detail.cancel_time}}</view>
  15. </view>
  16. <view v-if="id > 0 && detail.store && detail.store.address" class='address-info'>
  17. <image src='./../image/address.png'></image>
  18. <view>{{detail.store.name ? detail.store.name : ''}} {{detail.store.mobile ? detail.store.mobile : ''}}</view>
  19. <view class="address">{{detail.store.address}}</view>
  20. </view>
  21. <view v-if="card_id > 0" class="card-info">
  22. <view class='dir-left-nowrap cross-center'>
  23. <image class="card-img" :src='detail.pic_url'></image>
  24. <view class="card-name t-omit-two">{{detail.card_name}}</view>
  25. </view>
  26. <view class='card-other'>
  27. <view v-if="detail.is_show_history" class="history-button" @click="isShow = true">
  28. <span>历史核销记录</span>
  29. <image class="icon" src="/static/image/icon/red-arrow.png"></image>
  30. </view>
  31. <view class='other-label'>有效时间</view>
  32. <view>{{detail.start_time}} - {{detail.end_time}}</view>
  33. <view class='other-label'>发放时间</view>
  34. <view>{{detail.created_at}}</view>
  35. <view class='other-label'>使用说明</view>
  36. <text>{{detail.content}}</text>
  37. </view>
  38. </view>
  39. </view>
  40. <view v-if="id > 0" class='order-info'>
  41. <view class="goods" :style="{'margin-top':`${index == 0 ?'0':'12'}px`}" v-for="goods in detail.detail" :key="goods.id">
  42. <image :src='goods.goods.goodsWarehouse.cover_pic'></image>
  43. <view class='goods-info'>
  44. <view class='goods-name t-omit-two'>{{goods.goods.goodsWarehouse.name}}</view>
  45. <view class="goods-attr">
  46. <text v-for="attr in goods.attr_list" :key="attr.id">{{attr.attr_group_name}}:{{attr.attr_name}}</text>
  47. </view>
  48. <view>x{{goods.num}}</view>
  49. </view>
  50. <view class='goods-price'>¥ {{goods.total_price ? goods.total_price : '0.00'}}</view>
  51. </view>
  52. <view class="main-between price-item">
  53. <view class="price-label">商品总价</view>
  54. <view>¥{{ detail.total_goods_price ? detail.total_goods_price : '0.00' }}</view>
  55. </view>
  56. <view class="main-between price-item">
  57. <view class="price-label">运费</view>
  58. <view>¥{{ detail.express_price ? detail.express_price : '0.00' }}</view>
  59. </view>
  60. <view class="main-between price-item" v-if="detail.member_discount_price > 0">
  61. <view class="price-label">会员折扣</view>
  62. <view>¥{{ detail.member_discount_price }}</view>
  63. </view>
  64. <view class="main-between price-item" v-if="detail.integral_deduction_price > 0">
  65. <view class="price-label">积分抵扣</view>
  66. <view>¥-{{ detail.integral_deduction_price }}</view>
  67. </view>
  68. <view class="main-between price-item" v-if="detail.coupon_discount_price > 0">
  69. <view class="price-label">优惠券抵扣</view>
  70. <view>-¥{{ detail.coupon_discount_price }}</view>
  71. </view>
  72. <view class="main-between price-item">
  73. <view class="price-label total-label">订单总价</view>
  74. <view class="total-price">¥{{ detail.total_pay_price ? detail.total_pay_price : '0.00' }}</view>
  75. </view>
  76. </view>
  77. <view class='order-info' v-if="detail.name">
  78. <view class='info-title'>收货信息</view>
  79. <view class="dir-left-nowrap price-item">
  80. <view class="price-label">收货人:</view>
  81. <view>{{detail.name}}</view>
  82. </view>
  83. <view class="dir-left-nowrap price-item">
  84. <view class="price-label">联系方式:</view>
  85. <view>{{detail.mobile}}</view>
  86. </view>
  87. </view>
  88. <view v-if="id > 0" class='order-info'>
  89. <view class='info-title'>订单信息</view>
  90. <view class="dir-left-nowrap price-item">
  91. <view class="price-label">下单时间:</view>
  92. <view>{{detail.created_at}}</view>
  93. </view>
  94. <view class="dir-left-nowrap price-item">
  95. <view class="price-label">订单号:</view>
  96. <view>{{detail.order_no}}</view>
  97. </view>
  98. <view class="dir-left-nowrap price-item" v-if="detail.remark">
  99. <view class="price-label">买家备注:</view>
  100. <view>{{detail.remark}}</view>
  101. </view>
  102. <view class="dir-left-nowrap price-item">
  103. <view class="price-label">支付方式:</view>
  104. <view v-if="detail.pay_type == 1">线上支付</view>
  105. <view v-else-if="detail.pay_type == 3">余额支付</view>
  106. <view v-else-if="detail.pay_type == 2">货到付款</view>
  107. <view v-else>未支付</view>
  108. </view>
  109. <view class="dir-left-nowrap price-item">
  110. <view class="price-label">收货方式:</view>
  111. <view v-if="detail.send_type == 1">到店自提</view>
  112. <view v-if="detail.send_type == 0">快递配送</view>
  113. </view>
  114. </view>
  115. <view v-if="id > 0" class='order-info'>
  116. <app-form-data :detail="detail.detail"></app-form-data>
  117. </view>
  118. <view v-if="detail.is_show_history == 1" class='order-info'
  119. :style="{'margin-bottom': `${detail.clerk_id > 0 ? '12':'28'}px;`}">
  120. <view class='info-title'>核销信息</view>
  121. <view class="dir-left-nowrap price-item">
  122. <view class="price-label">剩余次数:</view>
  123. <view>{{detail.number - detail.use_number}}次</view>
  124. </view>
  125. <view class="dir-left-nowrap price-item">
  126. <view class="price-label">已核销次数:</view>
  127. <view>{{detail.use_number}}次</view>
  128. </view>
  129. <view class="dir-left-nowrap price-item">
  130. <view class="price-label">总次数:</view>
  131. <view>{{detail.number}}次</view>
  132. </view>
  133. </view>
  134. <view style="height: 140rpx; width: 100%"></view>
  135. <view v-if="detail.clerk_id == 0 && id > 0 && detail.is_pay == 1 && detail.cancel_status == 0" @click="toClerk(detail.id)" class="to-clerk">
  136. <button>去核销</button>
  137. </view>
  138. <view v-if="detail.clerk_id == 0 && id > 0 && detail.is_pay == 0 && detail.cancel_status == 0" class="to-clerk" @click="checkPay=!checkPay">
  139. <button>确认收款</button>
  140. </view>
  141. <view v-if="detail.is_use == 0 && card_id > 0 && detail.receive_id == 0" @click="toClerkCard(detail.id)" class="to-clerk">
  142. <button>去核销</button>
  143. </view>
  144. <view class="bg cross-center main-center" v-if="checkPay">
  145. <view class="dialog">
  146. <view class="dialog-title">提示</view>
  147. <view class="dialog-msg">确认是否已当面支付款项给您!</view>
  148. <view class="dialog-btn main-center">
  149. <view @click="checkPay=!checkPay" class="dialog-close">取消</view>
  150. <view class="line"></view>
  151. <view class="dialog-submit" @click="clerkAffirmPay">确认</view>
  152. </view>
  153. </view>
  154. </view>
  155. <app-clerk-historys :user-card-id="detail.id" :is-show.sync="isShow"></app-clerk-historys>
  156. </app-layout>
  157. </template>
  158. <script>
  159. import appClerkHistorys from '../../../components/page-component/app-clerk-historys/app-clerk-historys.vue';
  160. import appFormData from "../../../components/basic-component/app-order/app-form-data.vue";
  161. import { mapState } from "vuex";
  162. export default {
  163. name: "detail",
  164. components: {
  165. appClerkHistorys,
  166. appFormData,
  167. },
  168. data() {
  169. return {
  170. detail: {
  171. start_time: '',
  172. end_time: '',
  173. },
  174. card_id: null,
  175. checkPay: false,
  176. id: null,
  177. isShow: false,
  178. };
  179. },
  180. computed: {
  181. ...mapState({
  182. clerkImg: state => state.mallConfig.__wxapp_img.clerk,
  183. mall: state => state.mallConfig.mall
  184. }),
  185. },
  186. onLoad(options) {
  187. this.$showLoading({
  188. text: '加载中...'
  189. });
  190. if (options.id > 0) {
  191. this.id = options.id;
  192. uni.setNavigationBarTitle({
  193. title: "订单详情",
  194. })
  195. }else if (options.card_id > 0) {
  196. this.card_id = options.card_id;
  197. uni.setNavigationBarTitle({
  198. title: "卡券详情",
  199. })
  200. }
  201. },
  202. onShow: function() {
  203. if (this.id > 0) {
  204. this.getDetail();
  205. }else if (this.card_id > 0) {
  206. this.getCardDetail();
  207. }
  208. },
  209. methods: {
  210. toClerk(id) {
  211. uni.navigateTo({
  212. url: '/pages/order/clerk/clerk?id=' + id
  213. });
  214. },
  215. toClerkCard(id) {
  216. uni.navigateTo({
  217. url: '/pages/card/clerk/clerk?cardId=' + id
  218. });
  219. },
  220. getDetail() {
  221. let that = this;
  222. that.$request({
  223. url: that.$api.clerk.detail,
  224. data: {
  225. order_id: this.id
  226. },
  227. }).then(response=>{
  228. that.$hideLoading();
  229. if(response.code == 0) {
  230. that.detail = response.data.order;
  231. }else {
  232. uni.showToast({
  233. title: response.msg,
  234. icon: 'none',
  235. duration: 1000
  236. });
  237. }
  238. }).catch(response => {
  239. that.$hideLoading();
  240. });
  241. },
  242. getCardDetail() {
  243. let that = this;
  244. that.$request({
  245. url: that.$api.clerk.card_detail,
  246. data: {
  247. cardId: this.card_id
  248. },
  249. }).then(response=>{
  250. that.$hideLoading();
  251. if(response.code == 0) {
  252. that.detail = response.data.card;
  253. }else {
  254. uni.showToast({
  255. title: response.msg,
  256. icon: 'none',
  257. duration: 1000
  258. });
  259. }
  260. }).catch(response => {
  261. that.$hideLoading();
  262. });
  263. },
  264. clerkAffirmPay() {
  265. let that = this;
  266. that.$request({
  267. url: that.$api.order.clerk_affirm_pay,
  268. data: {
  269. id: that.id,
  270. action_type: 1,
  271. },
  272. }).then(response=>{
  273. that.$hideLoading();
  274. if(response.code == 0) {
  275. that.checkPay = !that.checkPay;
  276. that.getDetail();
  277. }else {
  278. uni.showToast({
  279. title: response.msg,
  280. icon: 'none',
  281. duration: 1000
  282. });
  283. }
  284. }).catch(response => {
  285. that.$hideLoading();
  286. });
  287. }
  288. }
  289. }
  290. </script>
  291. <style scoped lang="scss">
  292. .status {
  293. position: relative;
  294. padding-top: #{140rpx};
  295. }
  296. .status-price {
  297. margin-top: #{4rpx};
  298. }
  299. .status-bg {
  300. position: absolute;
  301. top: 0;
  302. left: 0;
  303. height: #{220rpx};
  304. width: 100%;
  305. z-index: 0;
  306. }
  307. .status-text {
  308. font-size: #{32rpx};
  309. color: #fff;
  310. position: absolute;
  311. top: #{42rpx};
  312. left: #{48rpx};
  313. }
  314. .address-info {
  315. width: #{702rpx};
  316. margin: 0 auto;
  317. font-size: #{26rpx};
  318. color: #353535;
  319. background-color: #fff;
  320. border-radius: #{16rpx};
  321. position: relative;
  322. padding: #{28rpx} #{24rpx} #{28rpx} #{92rpx};
  323. }
  324. .address-info image {
  325. position: absolute;
  326. top: #{40rpx};
  327. left: #{24rpx};
  328. height: #{44rpx};
  329. width: #{44rpx};
  330. }
  331. .address {
  332. margin-top: #{8rpx};
  333. }
  334. .order-info {
  335. margin: #{24rpx} #{38rpx};
  336. padding: #{28rpx} #{24rpx};
  337. background-color: #fff;
  338. border-radius: #{16rpx};
  339. }
  340. .goods {
  341. height: #{160rpx};
  342. position: relative;
  343. margin-bottom: #{20rpx};
  344. }
  345. .goods image {
  346. height: #{160rpx};
  347. width: #{160rpx};
  348. border-radius: #{10rpx};
  349. float: left;
  350. margin-right: #{20rpx};
  351. }
  352. .goods-info {
  353. font-size: #{24rpx};
  354. color: #999999;
  355. }
  356. .goods-name {
  357. color: #353535;
  358. height: #{72rpx};
  359. }
  360. .goods-price {
  361. color: #353535;
  362. font-size: #{24rpx};
  363. position: absolute;
  364. bottom: 0;
  365. right: 0;
  366. }
  367. .total {
  368. font-size: #{24rpx};
  369. margin-top: #{28rpx};
  370. color: #999999;
  371. text-align: right;
  372. }
  373. .price-item {
  374. margin-top: #{10rpx};
  375. font-size: #{24rpx};
  376. color: #353535;
  377. }
  378. .price-item:first-of-type {
  379. margin-top: #{24rpx};
  380. }
  381. .price-label {
  382. color: #999;
  383. font-size: #{24rpx};
  384. }
  385. .price-label.total-label {
  386. font-size: #{24rpx};
  387. color:#353535;
  388. }
  389. .total-price {
  390. font-size: #{28rpx};
  391. color: #ff4544;
  392. font-weight: bold;
  393. }
  394. .info-title {
  395. font-size: #{24rpx};
  396. color: #353535;
  397. margin-bottom: #{20rpx};
  398. }
  399. .status-info {
  400. position: absolute;
  401. right: #{48rpx};
  402. top: #{42rpx};
  403. color: #fff;
  404. font-size: #{24rpx};
  405. text-align: right;
  406. }
  407. .to-clerk {
  408. position: fixed;
  409. bottom: 0;
  410. height: 140#{rpx};
  411. width: 100%;
  412. padding: 0 24#{rpx};
  413. border-top: 1#{rpx} solid #e2e2e2;
  414. background: #ffffff;
  415. display: flex;
  416. align-items: center;
  417. }
  418. .to-clerk button {
  419. width: #{702rpx};
  420. margin: 0 auto;
  421. font-size: #{32rpx};
  422. color: #fff;
  423. height: #{88rpx};
  424. line-height: #{88rpx};
  425. border-radius: #{44rpx};
  426. background-color: #ff4544;
  427. text-align: center;
  428. }
  429. .card-info {
  430. width: 90%;
  431. margin: 0 auto;
  432. border-radius: #{15rpx};
  433. background-color: #fff;
  434. position: relative;
  435. padding: #{40rpx} #{24rpx};
  436. margin-bottom: #{20rpx};
  437. }
  438. .card-img {
  439. height: #{88rpx};
  440. width: #{88rpx};
  441. margin-right: #{20rpx};
  442. border-radius: #{44rpx};
  443. }
  444. .card-name {
  445. font-size: #{32rpx};
  446. color: #353535;
  447. width: #{546rpx};
  448. }
  449. .info-label {
  450. color: #999999;
  451. }
  452. .card-other {
  453. text-align: left;
  454. font-size: #{28rpx};
  455. margin-top: #{40rpx};
  456. color: #353535;
  457. border-top: #{1rpx} solid #e2e2e2;
  458. }
  459. .other-label {
  460. color: #999999;
  461. margin: #{30rpx} 0 #{22rpx};
  462. }
  463. .bg {
  464. position: fixed;
  465. top: 0;
  466. left: 0;
  467. height: 100%;
  468. width: 100%;
  469. background-color: rgba(0, 0, 0, .3);
  470. z-index: 10;
  471. }
  472. .dialog {
  473. position: fixed;
  474. top: #{400rpx};
  475. left: 0;
  476. right: 0;
  477. height: #{300rpx};
  478. width: #{640rpx};
  479. margin: 0 auto;
  480. z-index: 21;
  481. background-color: #fff;
  482. border-radius: 10px;
  483. text-align: center;
  484. font-size: #{30rpx};
  485. }
  486. .dialog-title {
  487. margin: #{40rpx} auto #{35rpx};
  488. }
  489. .dialog-msg {
  490. color: #ff4544;
  491. }
  492. .dialog-btn {
  493. height: #{88rpx};
  494. width: #{640rpx};
  495. border-top: #{1rpx} solid #e2e2e2;
  496. line-height: #{88rpx};
  497. position: absolute;
  498. bottom: 0;
  499. left: 0;
  500. }
  501. .dialog-close,.dialog-submit {
  502. width: 50%;
  503. }
  504. .line {
  505. height: #{44rpx};
  506. margin-top: #{22rpx};
  507. width: #{1rpx};
  508. background-color: #e2e2e2;
  509. }
  510. .dialog-submit {
  511. color: #ff4544;
  512. }
  513. .goods-attr {
  514. margin-bottom: #{16rpx};
  515. }
  516. .goods-attr text {
  517. margin-right: #{18rpx};
  518. }
  519. .history-button {
  520. width: 215#{rpx};
  521. height:60#{rpx};
  522. padding:18#{rpx} 23#{rpx};
  523. display: flex;
  524. color: #ff4544;
  525. font-size:24#{rpx};
  526. margin:30#{rpx} 0;
  527. align-items: center;
  528. justify-content:center;
  529. background: #ffebeb;
  530. border-radius: 30#{rpx};
  531. .icon {
  532. width: 12#{rpx};
  533. height:22#{rpx};
  534. margin-left:12#{rpx};
  535. }
  536. }
  537. </style>