index.vue 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359
  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. <view class="fast-top">送至:XXXXXXXXXXXXXXXXXXX <text>XXX</text> 收 19992837748<text class="iconfont icon-zhankai"></text></view>
  21. <navigator url="/pages/substitute_fast_mail/take_fast_mail/index">
  22. <view class="flex-center fast-top">
  23. <view class="fast-jia flex-center">
  24. </view>
  25. <view>添加代取快递信息</view>
  26. </view>
  27. </navigator>
  28. <scroll-view scroll-y scroll-with-animation style="flex: 1;overflow: hidden;">
  29. <view class="fast-box">
  30. <view class="flex-between-center">
  31. <view>
  32. <view class="fast-yz">XXXXXXXXXXXXXX驿站</view>
  33. <view class="fast-xx">XXXXXXXXXXXXXXXXXXXXXXXX宿舍</view>
  34. </view>
  35. <view class="flex-y-center">
  36. <image src="/static/img/phone.png" class="image2" /><text>联系驿站</text>
  37. </view>
  38. </view>
  39. <view class="flex-around-center fast-item">
  40. <radio class="radio" value="" color="#FF6702" />
  41. <image style="width: 135rpx; height: 135rpx;border-radius: 30rpx;" src="/static/img/ic-qu-chengse.png"></image>
  42. <view>
  43. <view class="fast-yz">取件码 <text>9-9-9999</text></view>
  44. <view class="fast-xx">圆通快递 YT1208768435738849</view>
  45. </view>
  46. <view>
  47. <view class="fast-yz">134m</view>
  48. <view class="bg-color-cash">¥<text class="fast-cash">2.50</text></view>
  49. </view>
  50. </view>
  51. </view>
  52. </scroll-view>
  53. <!-- <view class='list' style="flex: 1;">
  54. <template v-if="active == 1">
  55. <take-fast-mail ref="takeFastMailRef" :addressObj="addressItem" :addressExpressObj="addressExpressItem"></take-fast-mail>
  56. </template>
  57. <template v-if="active == 2">
  58. <send-fast-mail></send-fast-mail>
  59. </template>
  60. </view> -->
  61. <!-- 购物车栏 begin -->
  62. <view class="cart-box">
  63. <view class="mark-box">
  64. <view class="mark">应付 ¥ <text style="font-size: 31rpx;">{{orderPrice}}</text></view>
  65. <view class="tips">普通用户 | 查看明细 》</view>
  66. </view>
  67. <button type="primary" class="pay-btn" @tap="toPay">
  68. 提交订单
  69. </button>
  70. </view>
  71. <!-- </view> -->
  72. <fast-mail-order v-if="isOrder" @onCancel="onCanCel"></fast-mail-order>
  73. </view>
  74. </template>
  75. <script>
  76. // +----------------------------------------------------------------------
  77. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  78. // +----------------------------------------------------------------------
  79. // | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
  80. // +----------------------------------------------------------------------
  81. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  82. // +----------------------------------------------------------------------
  83. // | Author: CRMEB Team <admin@crmeb.com>
  84. // +----------------------------------------------------------------------
  85. import navBar from '@/components/navBar';
  86. import animationType from '@/utils/animationType.js'
  87. import tuiSkeleton from '@/components/base/tui-skeleton.vue';
  88. import sendFastMail from '../components/send_fast_mail/index.vue'
  89. import fastMailOrder from '../components/fast_mail_order/index.vue'
  90. import {
  91. preExpressApi
  92. } from '@/api/fastMail.js';
  93. let app = getApp();
  94. export default {
  95. components: {
  96. tuiSkeleton,
  97. navBar,
  98. sendFastMail,
  99. fastMailOrder
  100. },
  101. data() {
  102. return {
  103. isOrder: false, // 提交快递订单弹窗
  104. winHeight: 0,
  105. isNodes: 0, //控制什么时候开始抓取元素节点,只要数值改变就重新抓取
  106. autoplay: true,
  107. navList: [{
  108. id: 1,
  109. name: '取快递',
  110. preOrderType: 'take'
  111. }, {
  112. id: 2,
  113. name: '寄快递',
  114. preOrderType: 'send'
  115. }],
  116. navListIndex: 0,
  117. active: 0,
  118. scrollLeft: 0,
  119. addressItem: {},
  120. orderPrice: 0,
  121. addressExpressItem: {}
  122. };
  123. },
  124. onLoad() {
  125. let that = this;
  126. uni.getSystemInfo({
  127. success: function(res) {
  128. that.winHeight = res.windowHeight
  129. },
  130. });
  131. },
  132. /**
  133. * 生命周期函数--监听页面显示
  134. */
  135. onShow: function() {
  136. },
  137. methods: {
  138. tabSelect(active, e) {
  139. this.active = active;
  140. this.navListIndex = e;
  141. this.scrollLeft = e * 60;
  142. },
  143. toPay() {
  144. const refTake = this.$refs.takeFastMailRef;
  145. // uni.showLoading({
  146. // title: '保存中',
  147. // mask: true
  148. // })
  149. this.orderPrice = +(refTake.fastMailObj.giveTips || 0) + +refTake.fastMailObj.sepec.fee || 0
  150. let value = {
  151. giveTips: refTake.fastMailObj.giveTips,
  152. orderDetails: [{
  153. expressInfo: refTake.fastMailObj.expressInfo || '',
  154. expressNum: 1,
  155. image: refTake.fastMailObj.figureArr ? refTake.fastMailObj.figureArr[0] : '',
  156. orderNo: "",
  157. price: this.orderPrice || 0,
  158. remark: refTake.fastMailObj.remark || '',
  159. sepec: +refTake.fastMailObj.sepec.fee || 0
  160. }],
  161. postAddressId: refTake.addressExpressObj.id,
  162. preOrderType: this.navList[this.navListIndex].preOrderType,
  163. userAddressId: refTake.addressObj.id
  164. }
  165. const tips = this.checkData(value)
  166. if (tips) {
  167. return this.$util.Tips({
  168. title: tips
  169. });
  170. }
  171. preExpressApi(value).then(res => {
  172. this.isOrder = true;
  173. console.log(res)
  174. // uni.hideLoading();
  175. }).catch(err => {
  176. uni.showToast({
  177. title: err,
  178. icon: 'none'
  179. })
  180. })
  181. console.log(value)
  182. },
  183. onCanCel(val) {
  184. this.isOrder = val
  185. },
  186. checkData(val) {
  187. if (!val.postAddressId) return '请填写取件地'
  188. if (!val.userAddressId) return '请填写收件人信息'
  189. if (!val.orderDetails[0].sepec) return '快递规格必选'
  190. if (!val.orderDetails[0].expressInfo) return '请填写快递信息'
  191. }
  192. }
  193. }
  194. </script>
  195. <style lang="scss">
  196. .courie {
  197. padding: 14rpx 24rpx 0 24rpx;
  198. font-weight: 500;
  199. font-size: 23rpx;
  200. color: $bg-color-primary;
  201. background-color: #fff;
  202. image {
  203. width: 46rpx;
  204. height: 46rpx;
  205. margin-right: 15rpx;
  206. }
  207. }
  208. .fast-top {
  209. width: 100%;
  210. height: 80rpx;
  211. padding: 0 30rpx;
  212. line-height: 80rpx;
  213. font-weight: 600;
  214. font-size: 27rpx;
  215. color: #141414;
  216. background-color: #fff;
  217. margin-bottom: 20rpx;
  218. border-radius: 20rpx;
  219. }
  220. .image2 {
  221. width: 42rpx;
  222. height: 42rpx;
  223. margin-right: 20rpx;
  224. }
  225. .fast-jia {
  226. width: 44rpx;
  227. height: 44rpx;
  228. color: #fff;
  229. font-size: 40rpx;
  230. border-radius: 50%;
  231. background-color: $bg-color-primary;
  232. margin-right: 20rpx;
  233. }
  234. .fast-box {
  235. padding: 30rpx;
  236. background-color: #fff;
  237. .fast-item {
  238. padding: 20rpx 0;
  239. background-color: #F8F9FB;
  240. margin-bottom: 10rpx;
  241. }
  242. .flex-between-center {
  243. margin-bottom: 20rpx;
  244. }
  245. .fast-yz {
  246. font-weight: 600;
  247. font-size: 27rpx;
  248. color: #141414;
  249. text {
  250. color: #FF0000;
  251. }
  252. }
  253. .fast-xx {
  254. font-weight: 500;
  255. font-size: 23rpx;
  256. color: #646464;
  257. margin-top: 10rpx;
  258. }
  259. .bg-color-cash {
  260. margin-top: 30rpx;
  261. color: $bg-color-primary;
  262. text {
  263. font-weight: 500;
  264. font-size: 25rpx;
  265. }
  266. }
  267. }
  268. .newsList .nav {
  269. padding: 0 24rpx;
  270. width: 100%;
  271. white-space: nowrap;
  272. box-sizing: border-box;
  273. padding-top: 43rpx;
  274. border-top-right-radius: 23rpx;
  275. }
  276. .newsList .nav .item {
  277. // max-width: 156rpx;
  278. display: inline-block;
  279. font-size: 32rpx;
  280. color: #999;
  281. }
  282. .newsList .nav .item.on {
  283. color: #282828;
  284. }
  285. .newsList .nav .item~.item {
  286. margin-left: 46rpx;
  287. }
  288. .newsList .nav .item .line {
  289. // width: 24rpx;
  290. height: 10rpx;
  291. border-radius: 6rpx;
  292. margin: 10rpx auto 0 auto;
  293. background-color: $bg-color-primary;
  294. }
  295. .newsList .nav .item .line1 {
  296. color: $bg-color-primary;
  297. }
  298. .cart-box {
  299. height: 96rpx;
  300. border-radius: 48rpx;
  301. box-shadow: 0 0 20rpx rgba(0, 0, 0, 0.2);
  302. background-color: #000;
  303. display: flex;
  304. align-items: center;
  305. justify-content: space-between;
  306. z-index: 9999;
  307. .pay-btn {
  308. height: 100%;
  309. padding: 0 30rpx;
  310. color: #FFFFFF;
  311. border-radius: 0 50rpx 50rpx 0;
  312. display: flex;
  313. align-items: center;
  314. font-size: $font-size-base;
  315. background-color: $bg-color-primary;
  316. }
  317. .mark-box {
  318. padding-left: 46rpx;
  319. margin-right: 30rpx;
  320. position: relative;
  321. .mark {
  322. font-weight: 500;
  323. font-size: 23rpx;
  324. color: #FFFFFF;
  325. }
  326. .tips {
  327. font-weight: 500;
  328. font-size: 27rpx;
  329. color: #999999;
  330. }
  331. }
  332. }
  333. </style>