order.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  1. <template>
  2. <view class="cart-list">
  3. <view v-if="detail.refund_state == 0" style="padding: 0 36upx;line-height: 70upx;border-bottom: 14upx solid #F5F5F5;">
  4. <span v-if="detail.order_state == 10">未付款</span>
  5. <span v-if="detail.order_state == 0">已取消</span>
  6. <span v-if="detail.order_state == 20">待发货</span>
  7. <!-- 已付款 -->
  8. <span v-if="detail.order_state == 30">已发货</span>
  9. <span v-if="detail.order_state == 40">已收货</span>
  10. </view>
  11. <view v-else style="padding: 0 36upx;line-height: 70upx;border-bottom: 14upx solid #F5F5F5;">
  12. <span v-if="detail.refund_state == 1">等待酒店处理退货申请</span>
  13. <span v-if="detail.refund_state == 2">同意退款售后</span>
  14. <span v-if="detail.order_state == 3">拒绝退款</span>
  15. </view>
  16. <view class="adress">
  17. <view class="adressDetail">{{detail.reciver_info.mob_phone}}</view>
  18. <view>{{detail.reciver_info.address}}</view>
  19. </view>
  20. <view style="padding: 30upx 36upx 15upx 36upx;border-bottom: 1px solid #F5F5F5;">
  21. <image :src="pictureUrl+'/uploads/home/store/'+detail.store_id+'/'+detail.store_avatar" style="border-radius: 50%;
  22. width: 50upx;height: 50upx;vertical-align: middle;"></image>
  23. <span style="padding-left: 16upx;">{{detail.store_name}}</span>
  24. </view>
  25. <view class="shoplist">
  26. <view>
  27. <van-card
  28. title-class="changewidth"
  29. price-class ="priceClass"
  30. price="10.00"
  31. desc="描述信息"
  32. title="商品标题"
  33. thumb="https://gd3.alicdn.com/imgextra/i3/0/O1CN01IiyFQI1UGShoFKt1O_!!0-item_pic.jpg_400x400.jpg"
  34. >
  35. </van-card>
  36. </view>
  37. </view>
  38. <view class="topTip">
  39. <view style="font-size: 28upx;">合计:{{detail.order_amount}}</view>
  40. <view style="padding-left: 20upx;">运费: {{detail.shipping_fee}}</view>
  41. </view>
  42. <view style="padding: 15upx 36upx;">订单编号:<text class="orderCode">{{detail.order_sn}}</text></view>
  43. <view class="adressbottom">
  44. <view>下单时间: <text style="font-weight: 500;" class="time">{{detail.add_time}}</text></view>
  45. <view>支付订单:
  46. <text class="time" v-if="detail.order_state == 10 || detail.order_state == 0">未支付</text>
  47. <text class="time" v-else>{{detail.payment_time}}</text>
  48. </view>
  49. <view>商家发货:
  50. <text class="time" v-if="detail.order_state == 10 || detail.order_state == 0">未发货</text>
  51. <text class="time" v-else>{{detail.shipping_time}}</text>
  52. </view>
  53. <view>确认收货:
  54. <text class="time" v-if="detail.order_state == 10 || detail.order_state == 0">未确认</text>
  55. <text class="time" v-else>{{detail.finnshed_time}}</text>
  56. </view>
  57. </view>
  58. <view class="adressbutton">
  59. <view v-if="detail.refund_state == 0" class="buttonStatus">
  60. <view v-if="detail.order_state == 0 || detail.order_state == 40 " @click="cancelOrder(2)" class="deleteOrder">删除订单</view>
  61. <view @click="reminder" v-if="detail.order_state == 20" class="deleteOrder">催单</view>
  62. <view @click="cancelOrder(1)" v-if="detail.order_state == 10" class="deleteOrder">取消订单</view>
  63. <view class="payOrder" v-if="detail.order_state == 10" @click="goPay">去付款</view>
  64. </view>
  65. <view v-else>
  66. <view v-if="detail.refund_state == 2">删除订单</view>
  67. </view>
  68. </view>
  69. <Dialog :orderCancel="orderCancel"
  70. :titles="titles"
  71. @colseDialog="cancelDialog"
  72. @confirmPay="confirmOrder"
  73. />
  74. </view>
  75. </template>
  76. <script>
  77. import Dialog from '@/component/Dialog.vue'
  78. export default {
  79. components: {
  80. Dialog
  81. },
  82. data() {
  83. return {
  84. isCancel: false,
  85. isDelete: false,
  86. titles:'',
  87. pictureUrl: this.pictureUrl,
  88. orderCancel: false,
  89. detail:{},
  90. id: '' ,// 订单id
  91. }
  92. },
  93. onLoad(e) {
  94. console.log(e);
  95. this.id = e.id;
  96. this.getDetail();
  97. },
  98. methods: {
  99. getDetail() {
  100. this.request({
  101. url: '/v2/order/info',
  102. method: 'post',
  103. data: {
  104. order_id: this.id
  105. },
  106. success: (res) => {
  107. this.detail = res.data.data;
  108. console.log(this.detail);
  109. }
  110. })
  111. },
  112. // 取消订单
  113. cancelOrder(e) {
  114. if(e == 1) {
  115. this.titles="确认取消订单?"
  116. this.isCancel = true;
  117. }else {
  118. this.titles="确认删除订单?"
  119. this.isDelete = true;
  120. }
  121. this.orderCancel = true;
  122. },
  123. cancelDialog() {
  124. this.isCancel = false;
  125. this.isDelete = false;
  126. this.orderCancel = false;
  127. },
  128. confirmOrder() {
  129. let url = '';
  130. this.orderCancel = false;
  131. // 取消
  132. if(this.isCancel) {
  133. url = '/v2/order/cancel';
  134. }else if(this.isDelete) {
  135. // 删除
  136. url = '/v2/order/drop';
  137. }
  138. this.request({
  139. url: url,
  140. method:'post',
  141. data: {
  142. order_id: this.id
  143. },
  144. success: (res) => {
  145. uni.$emit("refehlist");
  146. uni.navigateBack();
  147. }
  148. })
  149. },
  150. goPay() {
  151. let prices = this.detail.order_amount;
  152. let order_id = this.id;
  153. uni.navigateTo({
  154. url:`/pages/myOrder/paymoment?order_id=${order_id}&prices=${prices}`
  155. })
  156. },
  157. // 催单
  158. reminder() {
  159. uni.navigateTo({
  160. url: './reminder'
  161. })
  162. },
  163. // 评价晒单
  164. estimate() {
  165. uni.navigateTo({
  166. url: './estimate'
  167. })
  168. }
  169. }
  170. }
  171. </script>
  172. <style lang="scss">
  173. page {
  174. background-color: #F5F5F5;
  175. }
  176. .cart-list {
  177. background-color: #fff;
  178. }
  179. .topTip {
  180. display: flex;
  181. align-items: center;
  182. justify-content: flex-start;
  183. /* justify-content: space-between; */
  184. padding: 20upx 36upx;
  185. }
  186. .changewidth {
  187. color: #303133;
  188. font-size: 32upx;
  189. font-weight: 100!important;
  190. }
  191. .priceClass {
  192. color:#303133!important;
  193. font-weight: 100!important;
  194. font-size: 36upx;
  195. }
  196. .van-card {
  197. background-color: #fff!important;
  198. }
  199. .shoplist {
  200. display: flex;
  201. justify-content: space-between;
  202. align-items: center;
  203. }
  204. .adress {
  205. padding: 35upx 36upx;
  206. border-bottom: 14upx solid #F5F5F5;
  207. }
  208. .adressDetail {
  209. padding: 6upx 0;
  210. }
  211. .orderCode {
  212. padding-left: 15upx;
  213. font-weight: 500;
  214. }
  215. .adressbottom {
  216. padding: 0 36upx;
  217. color: #606266;
  218. border-top: 16upx solid #F5F5F5;
  219. padding-bottom: 32upx;
  220. view {
  221. padding: 32upx 0 0 0;
  222. }
  223. .time {
  224. padding-left: 16upx;
  225. }
  226. }
  227. .adressbutton {
  228. position: fixed;
  229. bottom: 0;
  230. width: 100%;
  231. .buttonStatus {
  232. display: flex;
  233. text-align: center;
  234. .deleteOrder {
  235. flex: 1;
  236. color: #303133;
  237. font-size: 32upx;
  238. background-color: #fff;
  239. padding: 10px 0;
  240. }
  241. .payOrder {
  242. flex: 1;
  243. font-size: 32upx;
  244. color: #fff;
  245. background-color: #D9332E;
  246. padding: 10px 0;
  247. }
  248. }
  249. }
  250. </style>