detail.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. <!-- 门店订单详情 -->
  2. <template>
  3. <view class="order-detail-wrap">
  4. <!-- 订单卡片 -->
  5. <view class="card-box">
  6. <view class="order-goods-item u-m-b-10" v-for="item in orderDetail.item" :key="item.id">
  7. <shopro-mini-card :title="item.goods_title" :image="item.goods_image">
  8. <template #describe>
  9. <view class="order-sku u-ellipsis-1">
  10. <text class="order-num">数量:{{ item.goods_num || 0 }};</text>
  11. {{ item.goods_sku_text ? item.goods_sku_text : '' }}
  12. </view>
  13. </template>
  14. <template #cardBottom>
  15. <view class="card-price-box u-flex">
  16. <text class="order-price font-OPPOSANS">¥{{ item.goods_price || 0 }}</text>
  17. <button class="u-reset-button status-btn" v-if="item.status_name">{{ item.status_name }}</button>
  18. </view>
  19. </template>
  20. </shopro-mini-card>
  21. <view class="goods-phone card-item" v-show="item.ext_arr.dispatch_phone">
  22. <text class="item-title">预留电话:</text>
  23. <text class="item-content">{{ item.ext_arr.dispatch_phone }}</text>
  24. </view>
  25. <view class="goods-date card-item">
  26. <text class="item-title" v-show="item.dispatch_type === 'selfetch'">到店/自提时间:</text>
  27. <text class="item-title" v-show="item.dispatch_type === 'store'">配送时间:</text>
  28. <text class="item-content">{{ item.ext_arr.dispatch_date || '' }}</text>
  29. </view>
  30. </view>
  31. </view>
  32. <!-- 订单信息 -->
  33. <view class="order-detail-card">
  34. <view class="card-title u-flex ">订单信息</view>
  35. <view class="detial-content">
  36. <view class="detail-item u-flex">
  37. <view class="item-title">订单状态:</view>
  38. <view class="item-content">{{ orderDetail.status_name }}</view>
  39. </view>
  40. <view class="detail-item u-flex">
  41. <view class="item-title">订单编号:</view>
  42. <view class="item-content">{{ orderDetail.order_sn }}</view>
  43. </view>
  44. <view class="detail-item u-flex">
  45. <view class="item-title">下单时间:</view>
  46. <view class="item-content">{{ orderDetail.paytime }}</view>
  47. </view>
  48. <view class="detail-item u-flex" v-if="orderDetail.remark">
  49. <view class="item-title">备注:</view>
  50. <view class="item-content">{{ orderDetail.remark }}</view>
  51. </view>
  52. <view class="detail-item address-item" v-if="orderType.includes('store')">
  53. <view class="item-title">配送地址:</view>
  54. <view class="item-content address-content">
  55. {{ orderDetail.province_name || '' }}{{ orderDetail.city_name || '' }}{{ orderDetail.area_name || '' }}{{ orderDetail.address || '' }}
  56. </view>
  57. </view>
  58. </view>
  59. </view>
  60. <view class="bottom-hack" v-if="orderDetail.status_code == 'nosend'">
  61. <view class="bottom-box u-flex u-row-center u-col-center"><button class="cu-btn send-btn" @tap="sendOrder">发货</button></view>
  62. </view>
  63. </view>
  64. </template>
  65. <script>
  66. export default {
  67. components: {},
  68. data() {
  69. return {
  70. orderDetail: {},
  71. orderType: []
  72. };
  73. },
  74. computed: {},
  75. onLoad() {
  76. this.getOrderDetail();
  77. },
  78. methods: {
  79. // 订单详情
  80. getOrderDetail() {
  81. let that = this;
  82. that.$http('store.orderDetail', {
  83. id: that.$Route.query.orderId,
  84. store_id: uni.getStorageSync('storeId')
  85. }).then(res => {
  86. if (res.code === 1) {
  87. that.orderDetail = res.data;
  88. that.orderDetail.paytime = that.$u.timeFormat(res.data.paytime, 'yyyy-mm-dd hh:MM');
  89. that.orderDetail.item.forEach(goods => {
  90. that.orderType.push(goods.dispatch_type);
  91. });
  92. }
  93. });
  94. },
  95. // 订单发货
  96. sendOrder() {
  97. let that = this;
  98. that.$http(
  99. 'store.orderSend',
  100. {
  101. id: that.orderDetail.id,
  102. store_id: uni.getStorageSync('storeId')
  103. },
  104. '发货中...'
  105. ).then(res => {
  106. if (res.code === 1) {
  107. that.$u.toast(res.msg);
  108. that.getOrderDetail();
  109. }
  110. });
  111. }
  112. }
  113. };
  114. </script>
  115. <style lang="scss">
  116. .order-detail-wrap {
  117. height: 100%;
  118. .bottom-hack {
  119. width: 750rpx;
  120. height: 100rpx;
  121. }
  122. .bottom-box {
  123. position: fixed;
  124. width: 750rpx;
  125. height: 100rpx;
  126. bottom: 0;
  127. left: 0;
  128. background-color: #fff;
  129. padding: 10rpx 0;
  130. .send-btn {
  131. width: 710rpx;
  132. height: 80rpx;
  133. background: linear-gradient(90deg, #2eae9c, #6cc29f);
  134. border: 1rpx solid rgba(237, 237, 237, 1);
  135. border-radius: 40rpx;
  136. font-size: 30rpx;
  137. font-weight: 500;
  138. color: rgba(255, 255, 255, 1);
  139. }
  140. }
  141. }
  142. // 订单卡片
  143. .card-box {
  144. margin-bottom: 20rpx;
  145. background-color: #fff;
  146. .order-goods-item {
  147. border-bottom: 1rpx solid rgba(237, 237, 237, 1);
  148. padding: 20rpx;
  149. .card-item {
  150. line-height: 60rpx;
  151. .item-title {
  152. font-size: 28rpx;
  153. color: #999;
  154. }
  155. .item-content {
  156. font-size: 26rpx;
  157. color: #333;
  158. }
  159. }
  160. }
  161. .order-sku {
  162. font-size: 24rpx;
  163. font-weight: 400;
  164. color: rgba(153, 153, 153, 1);
  165. width: 450rpx;
  166. margin-bottom: 20rpx;
  167. .order-num {
  168. margin-right: 10rpx;
  169. }
  170. }
  171. .card-price-box {
  172. .status-btn {
  173. height: 32rpx;
  174. border: 1rpx solid rgba(207, 169, 114, 1);
  175. border-radius: 15rpx;
  176. font-size: 20rpx;
  177. font-weight: 400;
  178. color: rgba(168, 112, 13, 1);
  179. padding: 0 10rpx;
  180. margin-left: 20rpx;
  181. background: rgba(233, 183, 102, 0.16);
  182. }
  183. .order-price {
  184. font-size: 26rpx;
  185. font-weight: 600;
  186. color: rgba(51, 51, 51, 1);
  187. }
  188. }
  189. }
  190. .order-detail-card {
  191. background-color: #fff;
  192. margin: 20rpx 0;
  193. .card-title {
  194. font-size: 30rpx;
  195. font-weight: 500;
  196. color: rgba(51, 51, 51, 1);
  197. height: 80rpx;
  198. padding: 0 20rpx;
  199. border-bottom: 1rpx solid rgba(223, 223, 223, 0.5);
  200. }
  201. .detial-content {
  202. padding: 20rpx;
  203. .detail-item {
  204. min-height: 60rpx;
  205. .item-title {
  206. font-size: 28rpx;
  207. color: #999;
  208. }
  209. .item-content {
  210. font-size: 26rpx;
  211. color: #333;
  212. }
  213. }
  214. .address-item {
  215. display: flex;
  216. .address-content {
  217. width: 550rpx;
  218. }
  219. }
  220. }
  221. }
  222. </style>