k94314517
2025-07-17 bbd9c436f23f5fdbe712c4a22d90b457066bdf38
small-program/pages/mine/mine.vue
@@ -7,96 +7,121 @@
         </view>
         <view class="info">
            <view class="info-box">
               <view class="info-box-head">
                  <view class="info-box-head-image">
                     <image src="/static/logo.png" mode="widthFix"></image>
               <view class="info-box-head" >
                  <view class="info-box-head-image" @click="jump(isLogin?1:5)">
                     <image v-if="userInfo.fullCoverImage&&userInfo.fullCoverImage !=''" :src="userInfo.fullCoverImage" mode="widthFix"></image>
                     <image v-else src="/static/logo.png" mode="widthFix"></image>
                  </view>
                  <view class="info-box-head-info">
                     <view class="info-box-head-info-name">杨婷瑞</view>
                  <view class="info-box-head-info" v-if="isLogin">
                     <view class="info-box-head-info-name"  @click="jump(1)">{{userInfo.nickName||'匿名'}}</view>
                     <view class="info-box-head-info-type">
                        <view class="info-box-head-info-type-val">用工发布方</view>
                        <view class="info-box-head-info-type-wz">切换</view>
                        <view class="info-box-head-info-type-val">{{userInfo.useIdentity==1?'用工接单方':'用工发布方'}}</view>
                        <view class="info-box-head-info-type-wz" @click="editUseIdentity">切换</view>
                     </view>
                  </view>
                  <view class="info-box-head-info" v-else @click="jump(5)">
                     <view class="info-box-head-info-name">点击登录</view>
                     <view class="info-box-head-info-type">
                        <view class="info-box-head-info-type-wz">微信授权登录</view>
                     </view>
                  </view>
               </view>
               <view class="info-box-label">账户余额</view>
               <view class="info-box-price">
                  <text>¥1000.00</text>
                  <view class="info-box-price-btn" @click="jumpTX">去提现</view>
                  <text>¥{{isLogin?(userInfo.amount || 0) :0.00}}</text>
                  <view class="info-box-price-btn" @click="jump(6)">去提现</view>
               </view>
            </view>
         </view>
         <view class="statistics">
            <view class="statistics-box">
               <view class="statistics-item">
                  <text>248</text>
            <view class="statistics-box" v-if="!isLogin || userInfo.useIdentity !=1">
               <view class="statistics-item" >
                  <text>{{isLogin?(userInfo.userCenterVO.releaseTaskTotal||0):'-'}}</text>
                  <text>总发单数</text>
               </view>
               <view class="statistics-x"></view>
               <view class="statistics-item">
                  <text>1</text>
                  <text class="redtxt">{{isLogin?(userInfo.userCenterVO.waitReceiveTotal||0):'-'}}</text>
                  <text>待接单</text>
               </view>
               <view class="statistics-item">
                  <text>2</text>
                  <text>{{isLogin?(userInfo.userCenterVO.doingTotal||0):'-'}}</text>
                  <text>进行中</text>
               </view>
               <view class="statistics-item">
                  <text>2</text>
                  <text>{{isLogin?(userInfo.userCenterVO.waitCommentTotal||0):'-'}}</text>
                  <text>待评价</text>
               </view>
            </view>
            <view class="statistics-box" v-else>
               <view class="statistics-item" >
                  <text>{{isLogin?(userInfo.userCenterVO.receiveTotal||0):'-'}}</text>
                  <text>已接单</text>
               </view>
               <view class="statistics-x"></view>
               <view class="statistics-item">
                  <text>{{isLogin?(userInfo.userCenterVO.taskingTotal||0):'-'}}</text>
                  <text>进行中</text>
               </view>
               <view class="statistics-item">
                  <text>{{isLogin?(userInfo.userCenterVO.doneTotal||0):'-'}}</text>
                  <text>已完成</text>
               </view>
            </view>
         </view>
         <view class="guanggao">
            <view class="guanggao-image">
               <image src="/static/image/share@2x.png" mode="widthFix"></image>
               <button  mode="widthFix"class='sharebtn' open-type="share"></button>
            </view>
         </view>
         <view class="paidan">
         <view class="paidan"  v-if="isLogin && userInfo.useIdentity ==1">
            <view class="paidan-box">
               <view class="paidan-label">接受系统自动派单</view>
               <view class="paidan-right">
                  <text>关闭</text>
                  <u-switch activeColor="#00BC12" v-model="value"></u-switch>
                  <u-switch activeColor="#00BC12" v-model="autoReceiveStatus"></u-switch>
               </view>
            </view>
         </view>
         <view class="list">
            <view class="list-hz">
               <view class="list-hz-item">
               <view class="list-hz-item"@click="jumpService(1)">
                  <text>服务介绍</text>
                  <u-icon name="arrow-right" color="#111111" size="18"></u-icon>
                  <u-icon name="arrow-right"   color="#111111" size="18"></u-icon>
               </view>
               <view class="list-hz-item">
               <view class="list-hz-item" @click="jumpService(2)">
                  <text>收费标准</text>
                  <u-icon name="arrow-right" color="#111111" size="18"></u-icon>
               </view>
               <view class="list-hz-item">
               <view class="list-hz-item" @click="jump(2)">
                  <text>工人赚钱</text>
                  <view class="list-hz-item-r">
                     <text>可接用工订单</text>
                     <u-icon name="arrow-right" color="#111111" size="18"></u-icon>
                  </view>
               </view>
               <view class="list-hz-item">
               <view class="list-hz-item" @click="jump(3)">
                  <text>司机赚钱</text>
                  <view class="list-hz-item-r">
                     <text>可接用工订单</text>
                     <u-icon name="arrow-right" color="#111111" size="18"></u-icon>
                  </view>
               </view>
               <view class="list-hz-item">
               <view class="list-hz-item" @click="jump(4)">
                  <text>我能供餐</text>
                  <view class="list-hz-item-r">
                     <text>可接用工订单</text>
                     <u-icon name="arrow-right" color="#111111" size="18"></u-icon>
                  </view>
               </view>
               <view class="list-hz-item">
               <view class="list-hz-item" @click="jumpService(3)">
                  <text>关于我们</text>
                  <u-icon name="arrow-right" color="#111111" size="18"></u-icon>
               </view>
            </view>
            <view class="setup-sub" v-if="isLogin" @click="logOffDo">退出登录</view>
            <view class="setup-sub" v-if="!isLogin" @click="jump(5)">去登录</view>
         </view>
      </view>
   </view>
@@ -106,19 +131,123 @@
   import { mapState } from 'vuex'
   export default {
      computed: {
         ...mapState(['navHeight', 'statusbarHeight'])
         ...mapState(['navHeight', 'statusbarHeight','userInfo','token','openid'])
      },
      data() {
         return {
            value: false
            changing:false,
            changing1:false,
            autoReceiveStatus: false,
            isLogin:false,
            useIdentity:0
         }
      },
      onShow(options){
         this.isLogin=false
         this.autoReceiveStatus=false;
         this.useIdentity =0
         if(this.token &&this.token!='' && this.userInfo && JSON.stringify(this.userInfo) != '{}'){
            this.isLogin=true
            this.getUserInfo()
            this.autoReceiveStatus = this.userInfo.autoReceiveStatus === 1
            this.useIdentity = this.userInfo.useIdentity
         }
      },
      methods: {
         jumpTX() {
         getUserInfo() {
            var that = this;
            this.$u.api.getMemberInfo({}).then(res =>{
               if (res&&res.code ===200) {
                  that.$store.commit('setUserInfo', res.data)
                  that.$isResolve()
               }else{
                  that.$store.commit('setToken','')
                  that.$store.commit('setUserInfo',{})
                  that.$isResolve()
               }
            })
         },
         jumpService(flag) {
            uni.navigateTo({
               url: '/pages/withdrawal/withdrawal'
            })
         }
         },
         jump(type) {
            switch(type) {
               case 1:
                  uni.navigateTo({
                     url: '/pages/set-up/set-up'
                  })
                  break;
               case 2:
                  uni.navigateTo({
                     url: '/pages/employment-certification/employment-certification'
                  })
                  break;
               case 3:
                  uni.navigateTo({
                     url: '/pages/freight-certification/freight-certification'
                  })
                  break;
               case 4:
                  uni.navigateTo({
                     url: '/pages/catering-certification/catering-certification'
                  })
                  break;
               case 5:
                  uni.navigateTo({
                     url: '/pages/login/login'
                  })
                  break;
               case 6:
                  uni.navigateTo({
                     url: '/pages/withdrawal/withdrawal'
                  })
                  break;
            }
         },
         logOffDo() {
           var that = this
           this.$u.api.logOff({}).then(res =>{
                //退出登录成功
               that.isLogin =false
                that.$store.commit("empty")
            })
         } ,
         editUseIdentity() {
           if(this.changing1){
               return
           }
           this.changing1 = true
           var that = this
           var param ={useIdentity:this.userInfo.useIdentity==1?0:1}
           that.$u.api.editUseIdentity(param)
           .then(res =>{
                console.log(222,res)
               if(res.code ===200){
                  that.userInfo.useIdentity = param.useIdentity
               }
            }).finally(() => {
               that.changing1 = false
            })
         } ,
         updateMemberInfo() {
            if(this.changing){
               return
            }
           this.changing = true
           var that = this
           var param ={ autoReceiveStatus:that.autoReceiveStatus?1:0}
           this.$u.api.editMemberInfo(param).then(res =>{
              if(res.code ===200){
                that.userInfo.autoReceiveStatus = param.autoReceiveStatus
               }
            }).finally(() => {
                   that.changing = false
               })
         }
      }
   }
</script>
@@ -210,6 +339,20 @@
               image {
                  width: 100%;
                  height: 100%;
                  z-index: 999;
               }
               .sharebtn{
                  position: relative;
                  top: -150rpx;
                  left: 0;
                  outline:none;
                  padding:0px;
                  cursor: pointer;
                  border: none;
                  opacity: 0;
                  width: 100%;
                  height: 100%;
                  z-index: 1000;
               }
            }
         }
@@ -377,4 +520,20 @@
         }
      }
   }
   .setup-sub {
      width: 100%;
      height: 88rpx;
      line-height: 88rpx;
      text-align: center;
      box-shadow: 0rpx 8rpx 12rpx 0rpx rgba(91,190,56,0.16);
      border-radius: 44rpx;
      font-weight: 500;
      font-size: 32rpx;
      color: #5BBE38;
      margin-top: 80rpx;
      border: 1rpx solid #15CF52;
   }
   .redtxt{
      color:#FF0000 !important ;
   }
</style>