packageCard.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. <template>
  2. <view class="card" @click="$emit('toInformation', itemInfo)">
  3. <view class="top-detail">
  4. <view class="top-left">
  5. <view class="_label-1" v-if="itemInfo.mall_order_id > 0">
  6. 平台自购
  7. </view>
  8. <view class="_label-2" v-else-if="itemInfo.mall_order_id == 0">
  9. 自寄
  10. </view>
  11. <view class="order-num">
  12. <text>订单编号:</text>
  13. <text>{{ itemInfo.order_no }}</text>
  14. </view>
  15. </view>
  16. <view class="top-right">
  17. {{ itemInfo.status_text }}
  18. </view>
  19. </view>
  20. <view class="content-center">
  21. <view class="center-left-right">
  22. <view class="address"> {{ itemInfo.from_province_name || "" }} </view>
  23. <view class="name"> {{ itemInfo.from_name }} </view>
  24. </view>
  25. <image class="arrow" src="../../../static/mine/337.png" mode=""></image>
  26. <view class="center-left-right">
  27. <view class="address"> {{ itemInfo.to_province_name || "" }} </view>
  28. <view class="name"> {{ itemInfo.to_name }} </view>
  29. </view>
  30. </view>
  31. <view class="price" v-if="itemInfo.status == 'unpaid'">
  32. <text style="font-size: 24rpx; color: #333">合计</text>
  33. <view style="color: #f83224; font-weight: 600">
  34. <text style="font-size: 20rpx">¥</text>
  35. <text>{{ itemInfo.actual_price.split(".")[0] }}</text
  36. >.
  37. <text style="font-size: 20rpx">{{
  38. itemInfo.actual_price.split(".")[1]
  39. }}</text>
  40. </view>
  41. </view>
  42. <view class="card-bottom">
  43. <view class="package-weight">
  44. <text>包裹重量:</text>
  45. <text>{{ Number(itemInfo.actual_weight) }}kg</text>
  46. </view>
  47. <view class="btn-list">
  48. <button
  49. class="btn-2"
  50. v-show="
  51. itemInfo.status == 'domestic_delivered' ||
  52. itemInfo.status == 'domestic_received'
  53. "
  54. @click.stop="freeze"
  55. >
  56. {{ itemInfo.is_frozen == 0 ? "冻结" : "恢复" }}
  57. </button>
  58. <button
  59. class="btn-2"
  60. v-show="
  61. itemInfo.status == 'domestic_delivered' ||
  62. itemInfo.status == 'overseas_undelivered' ||
  63. itemInfo.status == 'overseas_delivered'
  64. "
  65. @click.stop="$emit('toInformation', itemInfo)"
  66. >
  67. 查看详情
  68. </button>
  69. <button
  70. class="btn-1"
  71. v-show="
  72. itemInfo.status == 'unpaid' || itemInfo.status == 'group_unpaid'
  73. "
  74. @click.stop="toPayment"
  75. >
  76. 立即付款
  77. </button>
  78. <button
  79. class="btn-1"
  80. @click.stop="toSending"
  81. v-show="
  82. (itemInfo.type == 'group_package' ||
  83. itemInfo.type == 'express_order') &&
  84. itemInfo.status == 'domestic_undelivered'
  85. "
  86. >
  87. 去寄件
  88. </button>
  89. </view>
  90. </view>
  91. </view>
  92. </template>
  93. <script>
  94. export default {
  95. props: {
  96. itemInfo: {
  97. typeof: Object,
  98. default: {},
  99. },
  100. },
  101. computed: {
  102. orderDetail() {
  103. if (this.itemInfo.orderStatus == 0) {
  104. return "待平台收货";
  105. } else if (this.itemInfo.orderStatus == 1) {
  106. return "待付款";
  107. } else if (this.itemInfo.orderStatus == 2) {
  108. return "待发货";
  109. } else if (this.itemInfo.orderStatus == 3) {
  110. return "拼包中";
  111. } else if (this.itemInfo.orderStatus == 4) {
  112. return "待寄件";
  113. }
  114. },
  115. },
  116. data() {
  117. return {};
  118. },
  119. methods: {
  120. //冻结
  121. freeze() {
  122. uni.$u.http
  123. .post(`/api/express-order/froze/${this.itemInfo.id}`)
  124. .then((res) => {
  125. uni.showToast({
  126. title: this.itemInfo.is_frozen == 0 ? "已冻结" : "已恢复",
  127. icon: "none",
  128. });
  129. });
  130. },
  131. toPayment() {
  132. uni.navigateTo({
  133. url: `/pageD/paymentOrder/paymentOrder?money=${this.itemInfo.actual_price}&weight=${this.itemInfo.actual_weight}&type=${this.itemInfo.goods[0].type_text}&num=${this.itemInfo.goods[0].number}&orderid=${this.itemInfo.id}`,
  134. });
  135. },
  136. toSending() {
  137. uni.navigateTo({
  138. url: "/pageD/sending/sending?orderId=" + this.itemInfo.id,
  139. });
  140. },
  141. },
  142. };
  143. </script>
  144. <style lang="scss" scoped>
  145. .card {
  146. padding: 28rpx 20rpx 0;
  147. background-color: #fff;
  148. border-radius: 16rpx;
  149. margin-top: 20rpx;
  150. .top-detail {
  151. display: flex;
  152. align-items: center;
  153. justify-content: space-between;
  154. .top-left {
  155. display: flex;
  156. align-items: center;
  157. ._label-1 {
  158. padding: 4rpx 8rpx;
  159. background-color: #ff1515;
  160. border-radius: 4rpx;
  161. color: #fff;
  162. font-size: 20rpx;
  163. margin-right: 10rpx;
  164. }
  165. ._label-2 {
  166. padding: 4rpx 8rpx;
  167. background-color: #ff6700;
  168. border-radius: 4rpx;
  169. color: #fff;
  170. font-size: 20rpx;
  171. margin-right: 10rpx;
  172. }
  173. .order-num {
  174. font-size: 26rpx;
  175. color: #333333;
  176. }
  177. }
  178. .top-right {
  179. color: #f83224;
  180. font-size: 26rpx;
  181. }
  182. }
  183. .content-center {
  184. display: flex;
  185. justify-content: space-around;
  186. align-items: center;
  187. margin-top: 44rpx;
  188. margin-bottom: 40rpx;
  189. .arrow {
  190. width: 130rpx;
  191. height: 10rpx;
  192. }
  193. .center-left-right {
  194. display: flex;
  195. flex-direction: column;
  196. align-items: center;
  197. justify-content: center;
  198. .address {
  199. font-weight: 600;
  200. }
  201. .name {
  202. font-size: 24rpx;
  203. color: rgba(34, 34, 34, 0.7);
  204. margin-top: 10rpx;
  205. }
  206. }
  207. }
  208. .price {
  209. display: flex;
  210. justify-content: flex-end;
  211. align-items: center;
  212. margin-bottom: 28rpx;
  213. }
  214. .card-bottom {
  215. display: flex;
  216. justify-content: space-between;
  217. align-items: center;
  218. padding: 30rpx 0 28rpx;
  219. border-top: 2rpx solid rgba(151, 151, 151, 0.2);
  220. .package-weight {
  221. font-size: 26rpx;
  222. color: #444444;
  223. }
  224. .btn-list {
  225. display: flex;
  226. .btn-1 {
  227. font-size: 28rpx;
  228. color: #fff;
  229. // border: 2rpx solid #f83224;
  230. background-color: #f83224;
  231. margin: 0;
  232. border-radius: 34rpx;
  233. min-width: 132rpx;
  234. margin-left: 20rpx;
  235. height: 68rpx;
  236. line-height: 68rpx;
  237. }
  238. .btn-2 {
  239. font-size: 28rpx;
  240. color: #222;
  241. border: 2rpx solid rgba(151, 151, 151, 0.7);
  242. background-color: #fff;
  243. margin: 0;
  244. border-radius: 34rpx;
  245. padding: 0;
  246. min-width: 132rpx;
  247. margin-left: 20rpx;
  248. padding: 0 20rpx;
  249. height: 68rpx;
  250. line-height: 68rpx;
  251. }
  252. }
  253. }
  254. }
  255. </style>