xuxueyang
2024-07-26 799b6a04bbc0a56972c5be392518c9da6308e6e0
pages/login/supplier-reg.vue
@@ -5,7 +5,7 @@
      <view style="padding: 20rpx;text-align: center;background-color: #fff;">仅限花满芫合伙人入驻</view>
      <!-- #endif -->e
      <view v-if="source==='step'" class="" style="background-color: #fff;margin-top: 20rpx;padding: 20rpx;">
      <view v-if="source==='step'" class="" style="background-color:#ffffff;padding: 20rpx;padding-top: 60rpx;">
        <u-steps current="1">
          <u-steps-item title="信息填写" class="u-steps-item">
          </u-steps-item>
@@ -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: '登陆中'
      });
@@ -256,7 +302,7 @@
        tjson = this.$storage.getItem('cache_partner_info')
        // #endif
        // #ifdef PUB_CUSTOMER
        this.$storage.getItem('cache_customer_info')
        tjson = this.$storage.getItem('cache_customer_info')
        // #endif
        if (!tjson) {
@@ -266,6 +312,7 @@
        var dto = JSON.parse(tjson)
        post.dto = dto
      }
      post.wxcode = wxcode
      // const {
      // code