order.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  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. let isform = 1;
  154. return;
  155. uni.navigateTo({
  156. url:`/pages/myOrder/paymoment?order_id=${order_id}
  157. &prices=${prices}&isform=${isform}`
  158. })
  159. },
  160. // 催单
  161. reminder() {
  162. uni.navigateTo({
  163. url: './reminder'
  164. })
  165. },
  166. // 评价晒单
  167. estimate() {
  168. uni.navigateTo({
  169. url: './estimate'
  170. })
  171. }
  172. }
  173. }
  174. </script>
  175. <style lang="scss">
  176. page {
  177. background-color: #F5F5F5;
  178. }
  179. .cart-list {
  180. background-color: #fff;
  181. }
  182. .topTip {
  183. display: flex;
  184. align-items: center;
  185. justify-content: flex-start;
  186. /* justify-content: space-between; */
  187. padding: 20upx 36upx;
  188. }
  189. .changewidth {
  190. color: #303133;
  191. font-size: 32upx;
  192. font-weight: 100!important;
  193. }
  194. .priceClass {
  195. color:#303133!important;
  196. font-weight: 100!important;
  197. font-size: 36upx;
  198. }
  199. .van-card {
  200. background-color: #fff!important;
  201. }
  202. .shoplist {
  203. display: flex;
  204. justify-content: space-between;
  205. align-items: center;
  206. }
  207. .adress {
  208. padding: 35upx 36upx;
  209. border-bottom: 14upx solid #F5F5F5;
  210. }
  211. .adressDetail {
  212. padding: 6upx 0;
  213. }
  214. .orderCode {
  215. padding-left: 15upx;
  216. font-weight: 500;
  217. }
  218. .adressbottom {
  219. padding: 0 36upx;
  220. color: #606266;
  221. border-top: 16upx solid #F5F5F5;
  222. padding-bottom: 32upx;
  223. view {
  224. padding: 32upx 0 0 0;
  225. }
  226. .time {
  227. padding-left: 16upx;
  228. }
  229. }
  230. .adressbutton {
  231. position: fixed;
  232. bottom: 0;
  233. width: 100%;
  234. .buttonStatus {
  235. display: flex;
  236. text-align: center;
  237. .deleteOrder {
  238. flex: 1;
  239. color: #303133;
  240. font-size: 32upx;
  241. background-color: #fff;
  242. padding: 10px 0;
  243. }
  244. .payOrder {
  245. flex: 1;
  246. font-size: 32upx;
  247. color: #fff;
  248. background-color: #D9332E;
  249. padding: 10px 0;
  250. }
  251. }
  252. }
  253. </style>