order.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  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. detail.order_amount
  109. console.log(this.detail);
  110. }
  111. })
  112. },
  113. // 取消订单
  114. cancelOrder(e) {
  115. if(e == 1) {
  116. this.titles="确认取消订单?"
  117. this.isCancel = true;
  118. }else {
  119. this.titles="确认删除订单?"
  120. this.isDelete = true;
  121. }
  122. this.orderCancel = true;
  123. },
  124. cancelDialog() {
  125. this.isCancel = false;
  126. this.isDelete = false;
  127. this.orderCancel = false;
  128. },
  129. confirmOrder() {
  130. let url = '';
  131. this.orderCancel = false;
  132. // 取消
  133. if(this.isCancel) {
  134. url = '/v2/order/cancel';
  135. }else if(this.isDelete) {
  136. // 删除
  137. url = '/v2/order/drop';
  138. }
  139. this.request({
  140. url: url,
  141. method:'post',
  142. data: {
  143. order_id: this.id
  144. },
  145. success: (res) => {
  146. uni.$emit("refehlist");
  147. uni.navigateBack();
  148. }
  149. })
  150. },
  151. goPay() {
  152. let prices = this.detail.order_amount;
  153. let order_id = this.id;
  154. uni.navigateTo({
  155. url:`/pages/myOrder/paymoment?order_id=${order_id}&prices=${prices}`
  156. })
  157. },
  158. // 催单
  159. reminder() {
  160. uni.navigateTo({
  161. url: './reminder'
  162. })
  163. },
  164. // 评价晒单
  165. estimate() {
  166. uni.navigateTo({
  167. url: './estimate'
  168. })
  169. }
  170. }
  171. }
  172. </script>
  173. <style lang="scss">
  174. page {
  175. background-color: #F5F5F5;
  176. }
  177. .cart-list {
  178. background-color: #fff;
  179. }
  180. .topTip {
  181. display: flex;
  182. align-items: center;
  183. justify-content: flex-start;
  184. /* justify-content: space-between; */
  185. padding: 20upx 36upx;
  186. }
  187. .changewidth {
  188. color: #303133;
  189. font-size: 32upx;
  190. font-weight: 100!important;
  191. }
  192. .priceClass {
  193. color:#303133!important;
  194. font-weight: 100!important;
  195. font-size: 36upx;
  196. }
  197. .van-card {
  198. background-color: #fff!important;
  199. }
  200. .shoplist {
  201. display: flex;
  202. justify-content: space-between;
  203. align-items: center;
  204. }
  205. .adress {
  206. padding: 35upx 36upx;
  207. border-bottom: 14upx solid #F5F5F5;
  208. }
  209. .adressDetail {
  210. padding: 6upx 0;
  211. }
  212. .orderCode {
  213. padding-left: 15upx;
  214. font-weight: 500;
  215. }
  216. .adressbottom {
  217. padding: 0 36upx;
  218. color: #606266;
  219. border-top: 16upx solid #F5F5F5;
  220. padding-bottom: 32upx;
  221. view {
  222. padding: 32upx 0 0 0;
  223. }
  224. .time {
  225. padding-left: 16upx;
  226. }
  227. }
  228. .adressbutton {
  229. position: fixed;
  230. bottom: 0;
  231. width: 100%;
  232. .buttonStatus {
  233. display: flex;
  234. text-align: center;
  235. .deleteOrder {
  236. flex: 1;
  237. color: #303133;
  238. font-size: 32upx;
  239. background-color: #fff;
  240. padding: 10px 0;
  241. }
  242. .payOrder {
  243. flex: 1;
  244. font-size: 32upx;
  245. color: #fff;
  246. background-color: #D9332E;
  247. padding: 10px 0;
  248. }
  249. }
  250. }
  251. </style>