doum
18 小时以前 a997c45ed4675d2eb045090fddb933235f4279cd
mini-program/pages/mine/mine.vue
@@ -8,7 +8,7 @@
         <view class="user">
            <view class="user-left">
               <view class="user-image">
                  <image :src="userInfo.imgFullUrl" mode="widthFix"></image>
                  <image :src="userInfo.imgFullUrl?userInfo.imgFullUrl:'/static/icon/default.png'" mode="widthFix"></image>
               </view>
               <view class="user-name">
                  <button open-type="getPhoneNumber" @getphonenumber="getphonenumber" v-if="!userInfo">获取手机号</button>
@@ -20,25 +20,25 @@
                  <image src="/static/icon/ic_option@2x.png" mode="widthFix"></image>
               </view>
               <view class="user-right-item" @click="jumpNotice">
                  <view class="user-right-item-tips" v-if="objNum && objNum.unRead === 1"></view>
                  <view class="user-right-item-tips" v-if="objNum && objNum.unRead === 0"></view>
                  <image src="/static/icon/ic_notice@2x.png" mode="widthFix"></image>
               </view>
            </view>
         </view>
         <view class="cate">
            <view class="cate-item">
            <view class="cate-item" @click="jumpTo(1)">
               <text>{{objNum ? objNum.cartTypeNum : 0}}</text>
               <text>购物车</text>
            </view>
            <view class="cate-item">
            <view class="cate-item" @click="jumpTo(2)">
               <text>{{objNum ? objNum.member.integral : 0}}</text>
               <text>积分</text>
            </view>
            <view class="cate-item">
            <view class="cate-item" @click="jumpTo(3)">
               <text>{{objNum ? objNum.couponNum : 0}}</text>
               <text>优惠券</text>
            </view>
            <view class="cate-item">
            <view class="cate-item" @click="jumpTo(4)">
               <text>{{objNum ? objNum.collectNum : 0}}</text>
               <text>收藏</text>
            </view>
@@ -46,38 +46,39 @@
         <view class="func">
            <view class="func-top">
               <view class="func-top-title">我的订单</view>
               <view class="func-top-to" @click="jumpOrder">
               <view class="func-top-to" @click="jumpOrder(0)">
                  全部订单
                  <image src="/static/icon/ic_ar2@2x.png" mode="widthFix"></image>
               </view>
            </view>
            <view class="func-list">
               <view class="func-list-item" @click="jumpOrder(0)">
               <view class="func-list-item" @click="jumpOrder(1)">
                  <view class="func-list-item-num" v-if="orderNum && orderNum.waitPayOrders > 0">{{orderNum.waitPayOrders}}</view>
                  <image src="/static/icon/mine_ic_daifukuan@2x.png" mode="widthFix"></image>
                  <text>待支付</text>
               </view>
               <view class="func-list-item" @click="jumpOrder(1)">
               <view class="func-list-item" @click="jumpOrder(2)">
                  <view class="func-list-item-num" v-if="orderNum && orderNum.waitOrders > 0">{{orderNum.waitOrders}}</view>
                  <image src="/static/icon/mine_ic_daifahuo@2x.png" mode="widthFix"></image>
                  <text>待发货/自提</text>
               </view>
               <view class="func-list-item" @click="jumpOrder(2)">
                  <view class="func-list-item-num" v-if="orderNum && orderNum.waitOrders > 0">{{orderNum.waitReceivedOrders}}</view>
               <view class="func-list-item" @click="jumpOrder(3)">
                  <view class="func-list-item-num" v-if="orderNum && orderNum.waitReceivedOrders > 0">{{orderNum.waitReceivedOrders}}</view>
                  <image src="/static/icon/mine_ic_daishouhuo@2x.png" mode="widthFix"></image>
                  <text>待收货</text>
               </view>
            </view>
         </view>
         <view class="guanggao">
            <image src="/static/images/share@2x.png" mode="widthFix"></image>
         <view class="guanggao" @click="jumpShare()">
            <image :src="share"  mode="widthFix"></image>
         </view>
         <view class="gn">
            <view class="gn-item">
            <view class="gn-item" @click="jump()">
               <text>我是经销商</text>
               <image src="/static/icon/ic_ar2@2x.png" mode="widthFix"></image>
            </view>
            <view class="gn-item">
               <button open-type="contact">客服</button>
               <text>在线客服</text>
               <image src="/static/icon/ic_ar2@2x.png" mode="widthFix"></image>
            </view>
@@ -94,19 +95,58 @@
   import { mapState } from 'vuex'
   export default {
      computed: {
         ...mapState(['navHeight', 'statusbarHeight', 'openid', 'userInfo'])
         ...mapState(['navHeight', 'statusbarHeight', 'openid', 'userInfo','recshopid','recuserid'])
      },
      data() {
         return {
            objNum: null,
            orderNum: null
            orderNum: null,
            share: ''
         };
      },
      onLoad() {
         this.getMyInfo()
      async onLoad() {
         await this.$onLaunched;
         if (uni.getStorageSync('backgroundImage')) {
            this.share = uni.getStorageSync('backgroundImage').centerInviteBg
         }
         this.ordersStatistics()
      },
      async onShow() {
         await this.$onLaunched;
         if (this.userInfo) {
            this.getMyInfo()
         }
      },
      methods: {
         jumpTo(type) {
            if (type === 1) {
               uni.navigateTo({
                  url: '/pages/shopping-cart/shopping-cart'
               })
            } else if (type === 2) {
               uni.navigateTo({
                  url: '/pages/my-points/my-points'
               })
            } else if (type === 3) {
               uni.navigateTo({
                  url: '/pages/coupon/coupon'
               })
            } else if (type === 4) {
               uni.navigateTo({
                  url: '/pages/my-collection/my-collection'
               })
            }
         },
         jump() {
            uni.navigateTo({
               url: '/pages/login/login'
            })
         },
         jumpShare(){
            uni.navigateTo({
               url: '/pages/share/share'
            })
         },
         // 跳转消息
         jumpNotice() {
            uni.navigateTo({
@@ -121,15 +161,21 @@
         },
         // 授权手机号
         getphonenumber(e) {
            this.$u.api.wxPhone({
               code: e.detail.code,
               openid: this.openid
            }).then(res => {
               if (res.code === 200) {
                  this.$store.commit('setUserInfo', res.data.member)
                  this.$store.commit('setToken', res.data.token)
               }
            })
            if (e.detail.errMsg === 'getPhoneNumber:ok') {
               this.$u.api.wxPhone({
                  code: e.detail.code,
                  shopId:this.recshopid,
                  recId:this.recuserid,
                  openid: this.openid
               }).then(res => {
                  if (res.code === 200) {
                     this.$store.commit('setUserInfo', res.data.member)
                     this.$store.commit('setToken', res.data.token)
                      this.$store.commit('setRecShopId','')
                      this.$store.commit('setRecUserId','')
                  }
               })
            }
         },
         // 获取收藏等数量
         getMyInfo() {
@@ -151,15 +197,9 @@
         },
         // 跳转订单列表
         jumpOrder(status) {
            if (status >= 0) {
               uni.navigateTo({
                  url: '/pages/order/order?status=' + status
               })
            } else {
               uni.navigateTo({
                  url: '/pages/order/order'
               })
            }
            uni.navigateTo({
               url: '/pagesA/pages/order/order?userType=0&status=' + status
            })
         }
      }
   }
@@ -214,9 +254,19 @@
               align-items: center;
               justify-content: space-between;
               border-bottom: 1rpx solid #E5E5E5;
               position: relative;
               &:last-child {
                  border: none !important;
               }
               button {
                  position: absolute;
                  top: 0;
                  left: 0;
                  width: 100%;
                  height: 100%;
                  opacity: 0;
                  z-index: 99;
               }
               text {
                  font-weight: 400;
                  font-size: 30rpx;