MrShi
2026-03-06 cdca21c0c12fa79ad4e85321d0f0960c0c4c3f33
mini-program/pages/settings/settings.vue
@@ -2,7 +2,7 @@
   <view class="box">
      <view class="box-tx">
         <view class="box-tx-image">
            <image :src="form.imgFullUrl" mode="widthFix"></image>
            <image :src="form.imgFullUrl || '/static/icon/default.png'" mode="widthFix"></image>
         </view>
         <button open-type="chooseAvatar" @chooseavatar="getAvatar">更换头像</button>
      </view>
@@ -32,7 +32,7 @@
               <image src="/static/icon/ar_next@2x.png" mode="widthFix"></image>
            </view>
         </view>
         <view class="list-item">
         <view class="list-item" @click="jumpxy">
            <view class="list-item-label">协议与说明</view>
            <view class="list-item-val">
               <image src="/static/icon/ar_next@2x.png" mode="widthFix"></image>
@@ -85,12 +85,22 @@
         this.form.phone1 = this.returnPhone(this.userInfo.phone)
         this.form.imgFullUrl = this.userInfo.imgFullUrl
         this.form.imgurl = this.userInfo.imgurl
         uni.$on('phone', () => {
            this.form.phone = this.userInfo.phone
            this.form.phone1 = this.returnPhone(this.userInfo.phone)
         })
      },
      methods: {
         jumpxy() {
            uni.navigateTo({
               url: '/pages/agreement-description/agreement-description'
            })
         },
         returnPhone(phone) {
            return formatPhoneStar(phone)
         },
         jumpPhone() {
            this.show = false
            uni.navigateTo({
               url: '/pages/change-binding/change-binding'
            })
@@ -123,9 +133,17 @@
            this.$u.api.updateMember(this.form)
               .then(res => {
                  if (res.code === 200) {
                     console.log(res)
                     this.setUserInfo()
                  }
               })
         },
         // 缓存最新用户信息
         async setUserInfo() {
            let res = await this.$u.api.getUserInfo()
            if (res.code === 200) {
               await this.$store.commit('setUserInfo', res.data)
               await this.$store.commit('setOpenId', res.data.openId)
            }
         },
         // 退出登录
         tuichu() {
@@ -133,6 +151,7 @@
               .then(res => {
                  if (res.code === 200) {
                     this.$store.commit('clear')
                     uni.$emit('loginOut')
                     uni.switchTab({
                        url: '/pages/index/index'
                     })