xuxueyang
2024-07-26 480a7eb5fa89aa602167a7b5f42df5c6d79053b2
pages/login/supplier-reg.vue
@@ -66,10 +66,19 @@
              <u-input :password="true" :border="false" placeholder="请输入密码" v-model="password"></u-input>
            </view>
            <button @tap="login()" class="bottom-button">注 册</button>
            <!-- #ifndef PUB_CUSTOMER -->
            <button @tap="reg('')" class="bottom-button">注 册</button>
            <!-- #endif -->
            <!-- #ifdef PUB_CUSTOMER -->
            <!--            open-type="getUserInfo"-->
            <button @tap="wxreg('')" class="bottom-button">注 册</button>
            <!-- #endif -->
            <view class="flex">
              <view class="topic-font m-l-0 m-r-a" @click="backInfoPage" v-if="source==='step'">返回上一步</view>
              <view class="topic-font m-l-0 m-r-a" @click="backInfoPage" v-if="source==='step'">返回上一步
              </view>
              <view class="topic-font m-l-a m-r-0" @click="toLogin">前往登录</view>
            </view>
@@ -213,7 +222,44 @@
    changeAll(e) {
      this.pcfvalue = e.detail.value[0]
    },
    async login() {
    // async wxreg(e) {
    //   wx.login({
    //     success: async res => {
    //       if (res.code) {
    //
    //       }
    //     },
    //     fail() {
    //       this.$message.showToast('获取微信信息失败')
    //     }
    //   })
    // },
    wxreg(e) {
      let tmp = this
      wx.login({
        success: async res => {
          console.log(res)
          if (res.code) {
            tmp.reg(res.code)
          } else {
            tmp.$message.showToast('微信登录失败');
          }
        },
        error: res => {
          console.log('wx.login error', res)
          tmp.$message.showToast('获取微信信息失败:' + res);
        }
      });
    },
    async reg(wxcode) {
      // console.log('e', e)
      // this.$message.showLoading()
      // const res = await wx.getUserProfile({
      //   desc: '用于完善会员资料',
      // });
      // console.log(res);
      // this.$message.hideLoading()
      uni.showLoading({
        title: '登陆中'
      });
@@ -266,6 +312,7 @@
        var dto = JSON.parse(tjson)
        post.dto = dto
      }
      post.wxcode = wxcode
      // const {
      // code