index.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  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='list' style="flex: 1;">
  21. <template v-if="active == 1">
  22. <take-fast-mail ref="takeFastMailRef" :addressObj="addressItem"></take-fast-mail>
  23. </template>
  24. <template v-if="active == 2">
  25. <send-fast-mail></send-fast-mail>
  26. </template>
  27. </view>
  28. <!-- 购物车栏 begin -->
  29. <view class="cart-box">
  30. <view class="mark-box">
  31. <view class="mark">应付 ¥ <text style="font-size: 31rpx;">8.00</text></view>
  32. <view class="tips">普通用户 | 查看明细 》</view>
  33. </view>
  34. <button type="primary" class="pay-btn" @tap="toPay">
  35. 提交订单
  36. </button>
  37. </view>
  38. </view>
  39. <fast-mail-order v-if="isOrder"></fast-mail-order>
  40. </view>
  41. </template>
  42. <script>
  43. // +----------------------------------------------------------------------
  44. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  45. // +----------------------------------------------------------------------
  46. // | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
  47. // +----------------------------------------------------------------------
  48. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  49. // +----------------------------------------------------------------------
  50. // | Author: CRMEB Team <admin@crmeb.com>
  51. // +----------------------------------------------------------------------
  52. import navBar from '@/components/navBar';
  53. import animationType from '@/utils/animationType.js'
  54. import tuiSkeleton from '@/components/base/tui-skeleton.vue';
  55. import sendFastMail from '../components/send_fast_mail/index.vue'
  56. import takeFastMail from '../components/take_fast_mail/index.vue'
  57. import fastMailOrder from '../components/fast_mail_order/index.vue'
  58. import {
  59. getAddressList
  60. } from '@/api/user.js';
  61. let app = getApp();
  62. export default {
  63. components: {
  64. tuiSkeleton,
  65. navBar,
  66. sendFastMail,
  67. takeFastMail,
  68. fastMailOrder
  69. },
  70. data() {
  71. return {
  72. isOrder: false,
  73. winHeight: 0,
  74. isNodes: 0, //控制什么时候开始抓取元素节点,只要数值改变就重新抓取
  75. autoplay: true,
  76. navList: [{
  77. id: 1,
  78. name: '取快递'
  79. }, {
  80. id: 2,
  81. name: '寄快递'
  82. }],
  83. active: 1,
  84. scrollLeft: 0,
  85. addressItem: {}
  86. };
  87. },
  88. onLoad() {
  89. let that = this;
  90. uni.getSystemInfo({
  91. success: function(res) {
  92. that.winHeight = res.windowHeight
  93. },
  94. });
  95. this.getaddressInfo()
  96. },
  97. /**
  98. * 生命周期函数--监听页面显示
  99. */
  100. onShow: function() {
  101. let that = this;
  102. uni.$on('addressItem', function(res) {
  103. that.$set(that, 'addressItem', res);
  104. })
  105. },
  106. methods: {
  107. tabSelect(active, e) {
  108. this.active = active;
  109. this.scrollLeft = e * 60;
  110. },
  111. /*
  112. * 获取默认收货地址或者获取某条地址信息
  113. */
  114. getaddressInfo: function() {
  115. getAddressList().then(res => {
  116. console.log('地址', res)
  117. if (res.code = 200) {
  118. if (res.data.length !== 0) {
  119. this.addressItem = res.data.find(item => item.isDefault === true) || {} // this.addressItem = res.data[0];
  120. } else {
  121. this.addressItem = {}
  122. }
  123. console.log('默认地址', this.addressItem)
  124. }
  125. })
  126. },
  127. toPay() {
  128. this.isOrder = true
  129. console.log(this.$refs.takeFastMailRef, 'refffffffffffffffffffffffff')
  130. console.log(this.formsObj, 1111111)
  131. }
  132. }
  133. }
  134. </script>
  135. <style lang="scss">
  136. .courie {
  137. padding: 14rpx 24rpx 0 24rpx;
  138. font-weight: 500;
  139. font-size: 23rpx;
  140. color: $bg-color-primary;
  141. background-color: #fff;
  142. image {
  143. width: 46rpx;
  144. height: 46rpx;
  145. margin-right: 15rpx;
  146. }
  147. }
  148. .newsList .swiper {
  149. width: 100%;
  150. position: relative;
  151. box-sizing: border-box;
  152. padding: 0 30rpx;
  153. }
  154. .newsList .swiper swiper {
  155. width: 100%;
  156. height: 365rpx;
  157. position: relative;
  158. }
  159. .newsList .swiper .slide-image {
  160. width: 100%;
  161. height: 335rpx;
  162. border-radius: 14rpx;
  163. }
  164. // #ifdef MP-WEIXIN
  165. .newsList .swiper .wx-swiper-dot {
  166. width: 12rpx !important;
  167. height: 12rpx !important;
  168. border-radius: 0;
  169. transform: rotate(-45deg);
  170. transform-origin: 0 100%;
  171. }
  172. .newsList .swiper .wx-swiper-dot~.wx-swiper-dot {
  173. margin-left: 5rpx;
  174. }
  175. .newsList .swiper .wx-swiper-dots.wx-swiper-dots-horizontal {
  176. margin-bottom: -15rpx;
  177. }
  178. // #endif
  179. // #ifdef APP-PLUS || H5
  180. .newsList .swiper .uni-swiper-dot {
  181. width: 12rpx !important;
  182. height: 12rpx !important;
  183. border-radius: 0;
  184. transform: rotate(-45deg);
  185. transform-origin: 0 100%;
  186. }
  187. .newsList .swiper .uni-swiper-dot~.uni-swiper-dot {
  188. margin-left: 5rpx;
  189. }
  190. .newsList .swiper .uni-swiper-dots.uni-swiper-dots-horizontal {
  191. margin-bottom: -15rpx;
  192. }
  193. // #endif
  194. .newsList .nav {
  195. padding: 0 24rpx;
  196. width: 100%;
  197. white-space: nowrap;
  198. box-sizing: border-box;
  199. padding-top: 43rpx;
  200. border-top-right-radius: 23rpx;
  201. }
  202. .newsList .nav .item {
  203. // max-width: 156rpx;
  204. display: inline-block;
  205. font-size: 32rpx;
  206. color: #999;
  207. }
  208. .newsList .nav .item.on {
  209. color: #282828;
  210. }
  211. .newsList .nav .item~.item {
  212. margin-left: 46rpx;
  213. }
  214. .newsList .nav .item .line {
  215. // width: 24rpx;
  216. height: 10rpx;
  217. border-radius: 6rpx;
  218. margin: 10rpx auto 0 auto;
  219. background-color: $bg-color-primary;
  220. }
  221. .newsList .nav .item .line1 {
  222. color: $bg-color-primary;
  223. }
  224. .cart-box {
  225. height: 96rpx;
  226. border-radius: 48rpx;
  227. box-shadow: 0 0 20rpx rgba(0, 0, 0, 0.2);
  228. background-color: #000;
  229. display: flex;
  230. align-items: center;
  231. justify-content: space-between;
  232. z-index: 9999;
  233. .pay-btn {
  234. height: 100%;
  235. padding: 0 30rpx;
  236. color: #FFFFFF;
  237. border-radius: 0 50rpx 50rpx 0;
  238. display: flex;
  239. align-items: center;
  240. font-size: $font-size-base;
  241. background-color: $bg-color-primary;
  242. }
  243. .mark-box {
  244. padding-left: 46rpx;
  245. margin-right: 30rpx;
  246. position: relative;
  247. .mark {
  248. font-weight: 500;
  249. font-size: 23rpx;
  250. color: #FFFFFF;
  251. }
  252. .tips {
  253. font-weight: 500;
  254. font-size: 27rpx;
  255. color: #999999;
  256. }
  257. }
  258. }
  259. .send-item {
  260. flex: 1;
  261. overflow: hidden;
  262. margin-top: 10rpx;
  263. padding: 88rpx 0rpx 0 23rpx;
  264. background: #FFFFFF;
  265. border-radius: 23rpx 23rpx 0rpx 0rpx;
  266. .remark-name {
  267. font-weight: 600;
  268. font-size: 27rpx;
  269. color: #141414;
  270. }
  271. .flex-between-center {
  272. // padding: 19rpx 0;
  273. height: 80rpx;
  274. border-bottom: 2rpx solid #D6D7DC;
  275. .flex-y-center {
  276. height: 100%;
  277. }
  278. }
  279. }
  280. </style>