pick_up.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343
  1. <template>
  2. <view>
  3. <view class="font3 paddingX14 tip" >
  4. <text class="cuIcon-warnfill" style="font-size: 32rpx;margin-right: 12rpx;"></text> 您的包裹一般在5个工作日内发货,如遇特殊情况可能会有延迟,敬请谅解~
  5. </view>
  6. <scroll-view
  7. class="wrapper"
  8. :style="{ top: top + 35 + 'px' }"
  9. scroll-y
  10. refresher-enabled
  11. refresher-default-style="white"
  12. @refresherrefresh="pullRefresh"
  13. :refresher-triggered="refreshing"
  14. @scrolltolower="loadMore"
  15. >
  16. <view class="paddingX14">
  17. <view v-for="item in tableData" :key="item.tradeNo" class="cell">
  18. <view class="top font2">
  19. <view class="flex-align-between">
  20. <text class="">下单时间:{{ item.createTime }}</text>
  21. <text class="color-money" v-if="item.status === 0">待支付运费</text>
  22. <text class="color-green" v-if="item.status === 99">已完成</text>
  23. <text class="color-money" v-else-if="item.status === 1">
  24. 已进仓库进行配货
  25. </text>
  26. <text class="color-money" v-else-if="item.status === 2">待收货</text>
  27. <text class="color-money" v-else-if="item.status === 10">已取消</text>
  28. <text class="color-money" v-else-if="item.status === 11">超时取消</text>
  29. <text class="color-money" v-else-if="item.status === 12">系统取消</text>
  30. </view>
  31. <view v-if="item.status === 0" class="paddingT5">
  32. {{ item.paymentTimeoutTime }} 将自动取消该订单,如有优惠券,将自动退回
  33. </view>
  34. </view>
  35. <view class="express flex-align">
  36. <view class="location cuIcon-locationfill" style="font-size: 32rpx"></view>
  37. <view class="flex1 marginL10">
  38. <view class="font4 bold">
  39. {{ item.contactName }},{{ item.contactNo }}
  40. </view>
  41. <view class="font4 paddingT7">
  42. {{ item.province }}{{ item.city }}{{ item.district
  43. }}{{ item.address }}
  44. </view>
  45. </view>
  46. </view>
  47. <view class="itemListBox">
  48. <scroll-view
  49. scroll-x
  50. class="scroll-wrapper itemList"
  51. v-if="item.list.length > 4"
  52. >
  53. <view class="item" v-for="(goods, index) in item.list" :key="index">
  54. <image
  55. class="super-image translateX"
  56. mode="aspectFit"
  57. :src="goods.data.cover"
  58. />
  59. <view
  60. class="bg-title bold"
  61. :style="
  62. 'background-image:url(' + ossurl.welfare.detail.numBg + ')'
  63. "
  64. >
  65. x{{ goods.total }}
  66. </view>
  67. </view>
  68. </scroll-view>
  69. <view v-else class="flex-align-around padding14 itemList">
  70. <view class="item" v-for="(goods, index) in item.list" :key="index">
  71. <image
  72. class="super-image translateX"
  73. mode="aspectFit"
  74. :src="goods.data.cover"
  75. />
  76. <view
  77. class="bg-title bold"
  78. :style="
  79. 'background-image:url(' + ossurl.welfare.detail.numBg + ')'
  80. "
  81. >
  82. x {{ goods.total }}
  83. </view>
  84. </view>
  85. </view>
  86. </view>
  87. <view class="flex-align font4 marginX15 paddingT14 border-top">
  88. <text style="color: #666666" class="flex-shrink0">订单号:</text>
  89. <view class="color-2 text-right flex1 line-ellipsis ">
  90. {{ item.tradeNo }}
  91. </view>
  92. <button
  93. class="btn-clear copy marginL5 flex-shrink0"
  94. @click.stop="copy(item.tradeNo)"
  95. >
  96. 复制
  97. </button>
  98. </view>
  99. <view
  100. class="flex-align font4 paddingX15 paddingT15"
  101. v-if="item.paymentTime"
  102. >
  103. <text style="color: #666666">付款时间:</text>
  104. <view class="color-2">{{ item.paymentTime }}</view>
  105. </view>
  106. <view
  107. class="flex-align-between font4 paddingX15 paddingT15"
  108. v-if="item.status === 12 && item.cancelRemark"
  109. >
  110. <text style="color: #666666">备注</text>
  111. <view class="color-money">{{ item.cancelRemark }}</view>
  112. </view>
  113. <view class="flex-align-end paddingX15 paddingY15">
  114. <view class="flex-align">
  115. <view class="font4">
  116. <text class="">配送费:</text>
  117. <text class="color-theme">¥{{ item.expressAmount }}</text>
  118. </view>
  119. <button
  120. v-if="[1, 2, 99].includes(item.status)"
  121. class="btn marginL15"
  122. @click="showExpress(item)"
  123. >
  124. 物流信息
  125. </button>
  126. </view>
  127. </view>
  128. </view>
  129. </view>
  130. <empty v-if="isEmpty" :top="200" />
  131. </scroll-view>
  132. </view>
  133. </template>
  134. <script>
  135. import pageMixin from './../../mixin/page'
  136. import empty from '@/components/empty'
  137. import { LEVEL_MAP } from '@/utils/config'
  138. import { throttle } from '@/utils'
  139. import ossurl from '@/utils/ossurl'
  140. export default {
  141. mixins: [pageMixin],
  142. components: { empty },
  143. data() {
  144. return {
  145. ossurl,
  146. LEVEL_MAP,
  147. refreshing: false
  148. }
  149. },
  150. computed: {
  151. top() {
  152. let height = this.$store.state.systemInfo.statusBarHeight + 36 + 50 + 10
  153. return height
  154. },
  155. itemWidth() {
  156. let width = this.$store.state.systemInfo.screenWidth
  157. width = (width - 8 - 40) / 3
  158. let height = (165 / 109) * width
  159. return { width, height }
  160. }
  161. },
  162. mounted() {
  163. this.refresh(true)
  164. },
  165. methods: {
  166. pullRefresh() {
  167. this.refreshing = true
  168. this.refresh()
  169. },
  170. async loadData(loading = false) {
  171. const res = await this.$service.award.takeList(this.pageNum, this.pageSize, loading)
  172. setTimeout(() => {
  173. this.refreshing = false
  174. }, 1000)
  175. return this.changeData(res)
  176. },
  177. changeData(res) {
  178. if (!res) return false
  179. res.forEach((item) => {
  180. let goods = item.itemList
  181. let goodsMap = {}
  182. goods.forEach((item) => {
  183. let key = item.spuId + '_' + item.level
  184. let obj = goodsMap[key]
  185. if (obj) {
  186. goodsMap[key] = {
  187. total: obj.total + 1,
  188. data: obj.data
  189. }
  190. } else {
  191. goodsMap[key] = {
  192. total: 1,
  193. data: item
  194. }
  195. }
  196. })
  197. item.list = Object.values(goodsMap)
  198. })
  199. return res
  200. },
  201. copy(text) {
  202. this.$common.copy(text)
  203. },
  204. pay(item) {
  205. throttle.call(() => {
  206. this.realPay(item)
  207. })
  208. },
  209. realPay(item) {},
  210. showExpress(item) {
  211. this.$router.push('packages', { type: 2, tradeNo: item.tradeNo })
  212. }
  213. }
  214. }
  215. </script>
  216. <style lang="scss" scoped>
  217. .bg {
  218. position: fixed;
  219. z-index: -1;
  220. left: 0;
  221. right: 0;
  222. top: 0;
  223. width: 100%;
  224. height: 100%;
  225. opacity: 0.3;
  226. }
  227. .wrapper {
  228. position: fixed;
  229. left: 0;
  230. right: 0;
  231. bottom: 0;
  232. }
  233. .cell {
  234. background: #fff;
  235. border-radius: 16rpx;
  236. padding: 0;
  237. margin-bottom: 20rpx;
  238. position: relative;
  239. overflow: hidden;
  240. .top {
  241. margin: 0 30rpx;
  242. padding: 20rpx 0;
  243. // height: 60rpx;
  244. border-bottom: 2rpx solid rgba(0,0,0,0.05);;
  245. }
  246. .express {
  247. padding: 28rpx 0;
  248. margin: 0 30rpx;
  249. border-bottom: 2rpx solid rgba(0,0,0,0.05);;
  250. }
  251. .item-wrapper {
  252. margin: 40rpx 0 30rpx 0;
  253. height: 182rpx;
  254. width: 100%;
  255. }
  256. .scroll-wrapper {
  257. margin: 28rpx 0 28rpx 28rpx;
  258. overflow: hidden;
  259. height: 182rpx;
  260. white-space: nowrap;
  261. width: 100%;
  262. .item {
  263. display: inline-block;
  264. margin-right: 8rpx;
  265. }
  266. }
  267. .item {
  268. width: 158rpx;
  269. height: 206rpx;
  270. background: #ffffff;
  271. border-radius: 12rpx 12rpx 12rpx 12rpx;
  272. opacity: 1;
  273. position: relative;
  274. .super {
  275. position: absolute;
  276. z-index: 0;
  277. left: 0;
  278. top: 0;
  279. width: 120rpx;
  280. height: 182rpx;
  281. }
  282. .super-image {
  283. width: 146rpx;
  284. height: 170rpx;
  285. }
  286. .bg-title {
  287. width: 36rpx;
  288. height: 32rpx;
  289. background-size: 100% 100%;
  290. font-size: 20rpx;
  291. font-family: Arial, Arial;
  292. font-weight: 400;
  293. color: #ffffff;
  294. line-height: 32rpx;
  295. text-align: center;
  296. position: absolute;
  297. right: 0;
  298. top: 0;
  299. }
  300. }
  301. .copy {
  302. padding: 0 6rpx;
  303. height: 32rpx;
  304. line-height: 32rpx;
  305. border-radius: 8rpx;
  306. text-align: center;
  307. color: #000;
  308. font-size: 24rpx;
  309. background: #FEC433;
  310. }
  311. .btn {
  312. height: 48rpx;
  313. line-height: 48rpx;
  314. text-align: center;
  315. padding: 0 20rpx;
  316. color: #000;
  317. font-size: 24rpx;
  318. background: #FEC433;
  319. border-radius: 24rpx;
  320. ::after{
  321. display: none;
  322. }
  323. }
  324. }
  325. .border-top {
  326. border-top: 2rpx solid rgba(0,0,0,0.05);;
  327. }
  328. .itemList {
  329. background: #f8f8f8;
  330. border-radius: 12rpx;
  331. }
  332. .itemListBox {
  333. padding: 20rpx 28rpx;
  334. }
  335. .tip{
  336. font-size: 24rpx;
  337. background-color: #FEC433;
  338. padding: 8rpx 20rpx;
  339. display: flex;
  340. align-items: center;
  341. }
  342. </style>