index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443
  1. <template>
  2. <view class="flex-col" :style="{height: winHeight + 'px'}">
  3. <!-- #ifdef MP -->
  4. <view class="cart_nav">
  5. <nav-bar iconColor='#fff' ref="navBarRef" navTitle="代取快递" backgroundColor="#FF6702" :isBackgroundColor="false">
  6. </nav-bar>
  7. </view>
  8. <!-- #endif -->
  9. <!-- <view class='newsList tui-skeleton flex-col' style="background-color: #fff;flex: 1;"> -->
  10. <!-- <view class='nav'>
  11. <scroll-view class="scroll-view_x" scroll-x scroll-with-animation :scroll-left="scrollLeft" style="width:auto;overflow:hidden;">
  12. <block v-for="(item,index) in navList" :key="index">
  13. <view class='item borRadius14 tui-skeleton-rect' :class='active==item.id?"on":""' @click='tabSelect(item.id, index)'>
  14. <view class="line1">{{item.name}}</view>
  15. <view class='line bg_color' v-if="active==item.id"></view>
  16. </view>
  17. </block>
  18. </scroll-view>
  19. </view> -->
  20. <navigator url="/pages/address/user_address_list/index">
  21. <view class="fast-top">
  22. <view>
  23. 送至:{{addressItem.province}}{{addressItem.city}}{{addressItem.district}}{{addressItem.street}}{{addressItem.detail}}
  24. </view>
  25. <view style="margin-top: 10rpx;">
  26. <text>{{addressItem.realName}}</text> 收 {{addressItem.phone}}<text class="iconfont icon-jiantou"></text>
  27. </view>
  28. </view>
  29. </navigator>
  30. <!-- <navigator url="/pages/substitute_fast_mail/take_fast_mail/index"> -->
  31. <view class="flex-center fast-top" @tap="onAddFastMail">
  32. <view class="fast-jia">
  33. </view>
  34. <view>添加代取快递信息</view>
  35. </view>
  36. <!-- </navigator> -->
  37. <scroll-view scroll-y scroll-with-animation style="flex: 1;overflow: hidden;">
  38. <view class="fast-box" v-for="(item, index) in fastMailData.postOrderList || []" :key="index">
  39. <view class="flex-between-center">
  40. <view>
  41. <view class="fast-yz">{{item.postName}}</view>
  42. <view class="fast-xx">{{item.addressDetail}}</view>
  43. </view>
  44. <view class="flex-y-center">
  45. <image src="/static/img/phone.png" class="image2" /><text>联系驿站</text>
  46. </view>
  47. </view>
  48. <view class="fast-item" v-for="(value, index) in item.orderInfoList">
  49. <view class="flex-between-center">
  50. <radio class="radios" :checked="value.radio" color="#FF6702" @tap="value.radio = !value.radio" />
  51. <image style="width: 135rpx; height: 135rpx;border-radius: 30rpx;" src="/static/img/ic-qu-chengse.png"></image>
  52. <view>
  53. <view class="fast-yz">取件码 <text>{{value.pickUpCode}}</text></view>
  54. <view class="fast-xx">{{value.expressCompany}} {{value.expressNo}}</view>
  55. <view class="fast-yz">规格:{{value.spec}}</view>
  56. </view>
  57. <view>
  58. <!-- <view class="fast-yz">134m</view> -->
  59. <view class="bg-color-cash">¥<text class="fast-cash">{{value.price}}</text></view>
  60. </view>
  61. </view>
  62. <view class="fast-remark">
  63. <view v-if="value.remark">备注:{{value.remark}}</view>
  64. <view class="flex-y-center" v-if="value.image" @tap="lookImg(value.image)">
  65. <text>附图:</text>
  66. <image style="width: 38rpx; height: 38rpx;" src="/static/img/ic-figure.png"></image>
  67. </view>
  68. </view>
  69. </view>
  70. </view>
  71. </scroll-view>
  72. <!-- <view class='list' style="flex: 1;">
  73. <template v-if="active == 1">
  74. </template>
  75. <template v-if="active == 2">
  76. <send-fast-mail></send-fast-mail>
  77. </template>
  78. </view> -->
  79. <view class="fast-tip flex-y-center">
  80. <radio :checked="radioArr" color="#FF6702" @tap="onRadioChang()" />全选
  81. <view style="margin-left: 30rpx;">删除</view>
  82. </view>
  83. <view class="flex-between-center fast-tip" @tap="isTip = true">
  84. <view class="remark-name">小费</view>
  85. <view class="flex-y-center">
  86. <text style="font-weight: 400;font-size: 27rpx;color: #646464;">{{giveTips}}</text>
  87. <view class='iconfont icon-jiantou' style="font-size: 30rpx;margin: 0 19rpx;"></view>
  88. </view>
  89. </view>
  90. <!-- 购物车栏 begin -->
  91. <view class="cart-box">
  92. <view class="mark-box">
  93. <view class="mark">应付 ¥ <text style="font-size: 31rpx;">{{orderPrice}}</text></view>
  94. <view class="tips">普通用户 | 查看明细 》</view>
  95. </view>
  96. <button type="primary" class="pay-btn" @tap="toPay">
  97. 提交订单
  98. </button>
  99. </view>
  100. <!-- </view> -->
  101. <fast-mail-order v-if="isOrder" @onCancel="onCanCel"></fast-mail-order>
  102. <take-fast-mail v-if="isTake" :orderNo="preOrderNo" :addressObj="addressItem" @onTakeFastOk="onTakeChang" @onCancel="onCanCel"></take-fast-mail>
  103. <fast-mail-tip v-if="isTip" :value="giveTips" @tipValue="onTipValue" @onCancel="onCanCel"></fast-mail-tip>
  104. </view>
  105. </template>
  106. <script>
  107. // +----------------------------------------------------------------------
  108. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  109. // +----------------------------------------------------------------------
  110. // | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
  111. // +----------------------------------------------------------------------
  112. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  113. // +----------------------------------------------------------------------
  114. // | Author: CRMEB Team <admin@crmeb.com>
  115. // +----------------------------------------------------------------------
  116. import navBar from '@/components/navBar';
  117. import animationType from '@/utils/animationType.js'
  118. import tuiSkeleton from '@/components/base/tui-skeleton.vue';
  119. import sendFastMail from '../components/send_fast_mail/index.vue'
  120. import takeFastMail from '../take_fast_mail/index.vue'
  121. import fastMailOrder from '../components/fast_mail_order/index.vue'
  122. import fastMailTip from '../components/fast_mail_tip/index.vue'
  123. import {
  124. preExpressApi,
  125. loadPreExpressApi
  126. } from '@/api/fastMail.js';
  127. import {
  128. getAddressDefault,
  129. getAddressExpressDefault
  130. } from '@/api/user.js';
  131. let app = getApp();
  132. export default {
  133. components: {
  134. tuiSkeleton,
  135. navBar,
  136. sendFastMail,
  137. fastMailOrder,
  138. takeFastMail,
  139. fastMailTip
  140. },
  141. data() {
  142. return {
  143. isOrder: false, // 提交快递订单弹窗
  144. isTake: false, // 新增快递弹窗
  145. isTip: false, // 小费弹窗
  146. giveTips: '',
  147. winHeight: 0,
  148. isNodes: 0, //控制什么时候开始抓取元素节点,只要数值改变就重新抓取
  149. autoplay: true,
  150. radioArr: false,
  151. radioDel: false,
  152. preOrderNo: '',
  153. navList: [{
  154. id: 1,
  155. name: '取快递',
  156. preOrderType: 'take'
  157. }, {
  158. id: 2,
  159. name: '寄快递',
  160. preOrderType: 'send'
  161. }],
  162. fastMailData: {},
  163. navListIndex: 0,
  164. active: 0,
  165. scrollLeft: 0,
  166. addressItem: {},
  167. orderPrice: 0
  168. };
  169. },
  170. onLoad() {
  171. let that = this;
  172. uni.getSystemInfo({
  173. success: function(res) {
  174. that.winHeight = res.windowHeight
  175. },
  176. });
  177. getAddressDefault().then(res => {
  178. console.log('地址', res)
  179. this.addressItem = res.data || {}
  180. })
  181. // this.getPreExpressApi()
  182. },
  183. /**
  184. * 生命周期函数--监听页面显示
  185. */
  186. onShow: function() {
  187. uni.$on('addressItem', function(res) {
  188. that.$set(this, 'addressItem', res);
  189. this.preOrderNo = ''
  190. this.fastMailData = {}
  191. this.orderPrice = 0
  192. })
  193. },
  194. methods: {
  195. lookImg(url) {
  196. uni.previewImage({
  197. urls: url
  198. });
  199. },
  200. getPreExpressApi(orderNo) {
  201. loadPreExpressApi(orderNo).then(res => {
  202. this.fastMailData = res.data
  203. this.orderPrice = res.data.payFee
  204. })
  205. },
  206. onAddFastMail() {
  207. if (Object.keys(this.addressItem).length == 0) return this.$util.Tips({
  208. title: '请选择地址'
  209. });
  210. this.isTake = true
  211. },
  212. tabSelect(active, e) {
  213. this.active = active;
  214. this.navListIndex = e;
  215. this.scrollLeft = e * 60;
  216. },
  217. toPay() {
  218. console.log(this.fastMailData)
  219. console.log('提交订单')
  220. },
  221. pay(item) {
  222. uni.showLoading({
  223. title: '加载中...'
  224. });
  225. this.getToPayment(item.secondType, item)
  226. },
  227. onTipValue(value) {
  228. this.giveTips = value
  229. this.isTip = false;
  230. console.log(value)
  231. },
  232. onTakeChang(data) {
  233. this.isTake = false
  234. this.preOrderNo = data.orderNo
  235. this.getPreExpressApi(data.orderNo)
  236. },
  237. onCanCel(val) {
  238. this.isOrder = val
  239. this.isTake = val
  240. this.isTip = val
  241. },
  242. onRadioChang() {
  243. this.radioArr = !this.radioArr
  244. if (!this.fastMailData.postOrderList) return
  245. this.fastMailData.postOrderList.forEach(item => {
  246. item.orderInfoList.forEach(val => {
  247. val.radar = this.radioArr
  248. })
  249. })
  250. }
  251. }
  252. }
  253. </script>
  254. <style lang="scss">
  255. .courie {
  256. padding: 14rpx 24rpx 0 24rpx;
  257. font-weight: 500;
  258. font-size: 23rpx;
  259. color: $bg-color-primary;
  260. background-color: #fff;
  261. image {
  262. width: 46rpx;
  263. height: 46rpx;
  264. margin-right: 15rpx;
  265. }
  266. }
  267. .fast-top {
  268. width: 100%;
  269. padding: 28rpx 30rpx;
  270. font-weight: 600;
  271. font-size: 27rpx;
  272. color: #141414;
  273. background-color: #fff;
  274. margin-bottom: 20rpx;
  275. border-radius: 20rpx;
  276. }
  277. .remark-name {
  278. font-weight: 600;
  279. font-size: 27rpx;
  280. color: #141414;
  281. }
  282. .fast-tip {
  283. background-color: #fff;
  284. margin-top: 20rpx;
  285. padding: 20rpx;
  286. }
  287. .image2 {
  288. width: 42rpx;
  289. height: 42rpx;
  290. margin-right: 20rpx;
  291. }
  292. .fast-jia {
  293. width: 44rpx;
  294. height: 44rpx;
  295. line-height: 44rpx;
  296. text-align: center;
  297. color: #fff;
  298. font-size: 40rpx;
  299. border-radius: 50%;
  300. background-color: $bg-color-primary;
  301. margin-right: 20rpx;
  302. }
  303. .fast-box {
  304. padding: 30rpx;
  305. background-color: #fff;
  306. .fast-item {
  307. padding: 20rpx 20rpx 20rpx 84rpx;
  308. background-color: #F8F9FB;
  309. margin-bottom: 10rpx;
  310. }
  311. .radios {
  312. position: absolute;
  313. left: 38rpx;
  314. }
  315. .fast-remark {
  316. font-weight: 400;
  317. font-size: 21rpx;
  318. color: #999999;
  319. }
  320. .flex-between-center {
  321. margin-bottom: 20rpx;
  322. }
  323. .fast-yz {
  324. font-weight: 500;
  325. font-size: 21rpx;
  326. color: #141414;
  327. text {
  328. color: #FF0202;
  329. margin-left: 20rpx;
  330. }
  331. }
  332. .fast-xx {
  333. font-weight: 400;
  334. font-size: 21rpx;
  335. color: #646464;
  336. margin: 10rpx 0;
  337. }
  338. .bg-color-cash {
  339. margin-top: 30rpx;
  340. color: $bg-color-primary;
  341. .fast-cash {
  342. font-weight: 600;
  343. font-size: 27rpx;
  344. color: #FF6702;
  345. }
  346. }
  347. }
  348. .newsList .nav {
  349. padding: 0 24rpx;
  350. width: 100%;
  351. white-space: nowrap;
  352. box-sizing: border-box;
  353. padding-top: 43rpx;
  354. border-top-right-radius: 23rpx;
  355. }
  356. .newsList .nav .item {
  357. // max-width: 156rpx;
  358. display: inline-block;
  359. font-size: 32rpx;
  360. color: #999;
  361. }
  362. .newsList .nav .item.on {
  363. color: #282828;
  364. }
  365. .newsList .nav .item~.item {
  366. margin-left: 46rpx;
  367. }
  368. .newsList .nav .item .line {
  369. // width: 24rpx;
  370. height: 10rpx;
  371. border-radius: 6rpx;
  372. margin: 10rpx auto 0 auto;
  373. background-color: $bg-color-primary;
  374. }
  375. .newsList .nav .item .line1 {
  376. color: $bg-color-primary;
  377. }
  378. .cart-box {
  379. height: 96rpx;
  380. border-radius: 48rpx;
  381. box-shadow: 0 0 20rpx rgba(0, 0, 0, 0.2);
  382. background-color: #000;
  383. display: flex;
  384. align-items: center;
  385. justify-content: space-between;
  386. z-index: 9999;
  387. .pay-btn {
  388. height: 100%;
  389. padding: 0 30rpx;
  390. color: #FFFFFF;
  391. border-radius: 0 50rpx 50rpx 0;
  392. display: flex;
  393. align-items: center;
  394. font-size: $font-size-base;
  395. background-color: $bg-color-primary;
  396. }
  397. .mark-box {
  398. padding-left: 46rpx;
  399. margin-right: 30rpx;
  400. position: relative;
  401. .mark {
  402. font-weight: 500;
  403. font-size: 23rpx;
  404. color: #FFFFFF;
  405. }
  406. .tips {
  407. font-weight: 500;
  408. font-size: 27rpx;
  409. color: #999999;
  410. }
  411. }
  412. }
  413. </style>