From d251119bcbfdfc0106c24fec917fa3f1ba9be371 Mon Sep 17 00:00:00 2001
From: xuxy <1059738716@qq.com>
Date: 星期六, 27 七月 2024 22:19:15 +0800
Subject: [PATCH] 1

---
 pages/login/supplier-reg.vue |   55 +++++++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 51 insertions(+), 4 deletions(-)

diff --git a/pages/login/supplier-reg.vue b/pages/login/supplier-reg.vue
index e686b8c..d79a3f4 100644
--- a/pages/login/supplier-reg.vue
+++ b/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: '登陆中'
       });
@@ -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

--
Gitblit v1.9.3