فهرست منبع

为解决违规获取手机号,添加游客模式

2662043119@qq.com 1 سال پیش
والد
کامیت
11328149ac

+ 27 - 1
src/App.vue

@@ -1,5 +1,6 @@
 <script>
 <script>
 import { showModal, showLoading } from '@/utils/myfun.js';
 import { showModal, showLoading } from '@/utils/myfun.js';
+import { post } from "@/request/api.js";
 export default {
 export default {
     globalData: {
     globalData: {
         shopInfo: {},
         shopInfo: {},
@@ -20,6 +21,8 @@ export default {
     },
     },
     onShow() {
     onShow() {
         this.autoUpdate();
         this.autoUpdate();
+        let token = uni.getStorageSync("token");
+        if (!token) this.login()
     },
     },
     onHide() {},
     onHide() {},
     methods: {
     methods: {
@@ -82,7 +85,30 @@ export default {
                         }, 100);
                         }, 100);
                     });
                     });
             });
             });
-        }
+        },
+        login() {
+            // #ifdef  MP-WEIXIN
+            wx.login({
+                success(res) {
+                    if (res.code) {
+                        post("v1/appletLogin", {
+                            code: res.code,
+                            invite: uni.getStorageSync("inviteCode") || "XHCYGNZM",
+                        }).then((res) => {
+                            if (res.code === 0) {
+                                if (res.data.token) {
+                                    uni.setStorageSync("token", res.data.token);
+                                }
+                                if(res.data.unid){
+                                    uni.setStorageSync("unid", res.data.unid);
+                                }
+                            }
+                        });
+                    }
+                },
+            });
+            // #endif
+        },
     },
     },
 };
 };
 </script>
 </script>

+ 6 - 0
src/pages.json

@@ -194,6 +194,12 @@
 				"navigationBarTitleText": "登录"
 				"navigationBarTitleText": "登录"
 			}
 			}
 		},
 		},
+		{
+			"path": "pages/my/wxLogin",
+			"style": {
+				"navigationBarTitleText": "登录"
+			}
+		},
 		{
 		{
 			"path": "pages/pay-agreement/index",
 			"path": "pages/pay-agreement/index",
 			"style": {
 			"style": {

+ 31 - 25
src/pages/my/index.vue

@@ -4,21 +4,21 @@
             <!-- 用户信息 -->
             <!-- 用户信息 -->
             <view class="uerInfo mar_t16 flex_r">
             <view class="uerInfo mar_t16 flex_r">
                 <view class="user_img">
                 <view class="user_img">
-                    <image v-if="!userinfo.head_pic" class="image" src="@/static/my/head.png" @click="login"></image>
+                    <image v-if="!userinfo.head_pic" class="image" src="@/static/my/head.png" @click="toLogin"></image>
                     <image v-else @click="upheadimg" class="image" :src="userinfo.head_pic"></image>
                     <image v-else @click="upheadimg" class="image" :src="userinfo.head_pic"></image>
                     <view class="coupon_info flex_r flex_ac" @tap="goToAutonym" v-if="isShiMing">
                     <view class="coupon_info flex_r flex_ac" @tap="goToAutonym" v-if="isShiMing">
                         完成实名认证,享受更多权益
                         完成实名认证,享受更多权益
                         <image src="/static/my/f_close.png" mode="widthFix" class="close_icon" @tap.stop="closeAuto" />
                         <image src="/static/my/f_close.png" mode="widthFix" class="close_icon" @tap.stop="closeAuto" />
                     </view>
                     </view>
                 </view>
                 </view>
-                <block v-if="userinfo.nickname">
+                <block v-if="userinfo.mobile">
                     <view class="user_con flex_c flex_as flex_jc">
                     <view class="user_con flex_c flex_as flex_jc">
                         <view class="user_name flex_r flex_ae ellipsis">
                         <view class="user_name flex_r flex_ae ellipsis">
                             <view @click="goto('/pages/my/userinfo')">{{ userinfo.nickname }}</view>
                             <view @click="goto('/pages/my/userinfo')">{{ userinfo.nickname }}</view>
                             <text v-if="isAuthentication">({{ userinfo.is_authentication == 0 ? "未实名" : "已实名" }})</text>
                             <text v-if="isAuthentication">({{ userinfo.is_authentication == 0 ? "未实名" : "已实名" }})</text>
                         </view>
                         </view>
                         <view class="live_name flex_r flex_ac flex_jc">
                         <view class="live_name flex_r flex_ac flex_jc">
-                            <image src="@/static/my/huangguan.png" class="live_ico" />
+                            <image src="/static/my/huangguan.png" class="live_ico" />
                             <span>{{ typeto(localInfo.level_id) }}</span>
                             <span>{{ typeto(localInfo.level_id) }}</span>
                         </view>
                         </view>
                         <view class="user_account flex_r flex_ac mar_t16">
                         <view class="user_account flex_r flex_ac mar_t16">
@@ -34,7 +34,7 @@
                     </view>
                     </view>
                 </block>
                 </block>
                 <block v-else>
                 <block v-else>
-                    <view class="user_con flex_c flex_as flex_jc" @click="login">
+                    <view class="user_con flex_c flex_as flex_jc" @click="toLogin">
                         <view class="user_name flex_r flex_ae ellipsis">点此处登录</view>
                         <view class="user_name flex_r flex_ae ellipsis">点此处登录</view>
                     </view>
                     </view>
                 </block>
                 </block>
@@ -70,25 +70,25 @@
                 <div class="flex_c flex_jse">
                 <div class="flex_c flex_jse">
                     <div class="i_num flex_c flex_as" @click="goto('/pagesB/my/shuZhiWallet')">
                     <div class="i_num flex_c flex_as" @click="goto('/pagesB/my/shuZhiWallet')">
                         <p class="flex_r flex_ac flex_jc">
                         <p class="flex_r flex_ac flex_jc">
-                            <image src="@/static/wallet/4.png" class="ico" /><span>余额</span></p>
+                            <image src="/static/wallet/4.png" class="ico" /><span>余额</span></p>
                         <p class="dinB">{{localInfo.property||0}}</p>
                         <p class="dinB">{{localInfo.property||0}}</p>
                     </div>
                     </div>
                     
                     
                     <div class="i_num flex_c flex_as mar_t30" @click="goto('/pagesB/accountDetails/ConsumptionCharge')">
                     <div class="i_num flex_c flex_as mar_t30" @click="goto('/pagesB/accountDetails/ConsumptionCharge')">
                         <p class="flex_r flex_ac flex_jc">
                         <p class="flex_r flex_ac flex_jc">
-                            <image src="@/static/wallet/3.png" class="ico" /><span>消费金</span></p>
+                            <image src="/static/wallet/3.png" class="ico" /><span>消费金</span></p>
                         <p class="dinB">{{localInfo.integral||0}}</p>
                         <p class="dinB">{{localInfo.integral||0}}</p>
                     </div>
                     </div>
                 </div>
                 </div>
                 <div class="flex_c flex_jse">
                 <div class="flex_c flex_jse">
                     <div class="i_num flex_c flex_ae" @click="goto('/pages/accountDetails/teaBaby')">
                     <div class="i_num flex_c flex_ae" @click="goto('/pages/accountDetails/teaBaby')">
                         <p class="flex_r flex_ac flex_jc">
                         <p class="flex_r flex_ac flex_jc">
-                            <image src="@/static/wallet/6.png" class="ico" /><span>茶宝</span></p>
+                            <image src="/static/wallet/6.png" class="ico" /><span>茶宝</span></p>
                         <p class="dinB">{{userinfo.cha_bao||0}}</p>
                         <p class="dinB">{{userinfo.cha_bao||0}}</p>
                     </div>
                     </div>
                     <div class="i_num flex_c flex_ae mar_t30">
                     <div class="i_num flex_c flex_ae mar_t30">
                         <p class="flex_r flex_ac flex_jc">
                         <p class="flex_r flex_ac flex_jc">
-                            <image src="@/static/wallet/5.png" class="ico" /><span>原始股</span></p>
+                            <image src="/static/wallet/5.png" class="ico" /><span>原始股</span></p>
                         <p class="dinB">{{localInfo.original_equity || 0}}</p>
                         <p class="dinB">{{localInfo.original_equity || 0}}</p>
                     </div>
                     </div>
                 </div>
                 </div>
@@ -252,7 +252,7 @@
             <!-- #endif -->
             <!-- #endif -->
         </view>
         </view>
         <!-- 授权 -->
         <!-- 授权 -->
-        <authorize-module ref="autho" :shopInfo="shopInfo" @authGetTelSuccess="onauthGetTelSuccess" />
+        <!-- <authorize-module ref="autho" :shopInfo="shopInfo" @authGetTelSuccess="onauthGetTelSuccess" /> -->
         <!-- 激活升级 -->
         <!-- 激活升级 -->
         <activation ref="activation" tit="激活" />
         <activation ref="activation" tit="激活" />
     </view>
     </view>
@@ -316,8 +316,9 @@ export default {
                                     that.getuserInfo();
                                     that.getuserInfo();
                                 } else {
                                 } else {
                                     that.unid = res.data.unid;
                                     that.unid = res.data.unid;
+                                    uni.setStorageSync("unid", res.data.unid);
                                     that.shopInfo = app.globalData.shopInfo;
                                     that.shopInfo = app.globalData.shopInfo;
-                                    that.SoHAuth(); //调取授权弹窗
+                                    // that.SoHAuth(); //调取授权弹窗
                                 }
                                 }
                             }
                             }
                         });
                         });
@@ -325,27 +326,32 @@ export default {
                 },
                 },
             });
             });
             // #endif
             // #endif
+        },
+        toLogin(){
+            // #ifdef  MP-WEIXIN
+            this.goto("/pages/my/wxLogin");
+            // #endif
 
 
             // #ifdef  H5 || APP-PLUS
             // #ifdef  H5 || APP-PLUS
             this.goto("/pages/my/login");
             this.goto("/pages/my/login");
             // #endif
             // #endif
         },
         },
         // 获取手机号
         // 获取手机号
-        onauthGetTelSuccess(da) {
-            this.SoHAuth();
-            post("v1/getMobile", {
-                unid: this.unid,
-                ...da.detail,
-            }).then((res) => {
-                if (res.code === 0) {
-                    uni.setStorageSync("token", res.data.token);
-                    this.getuserInfo();
-                }
-            });
-        },
-        SoHAuth() {
-            this.$refs.autho.onSoHAuth();
-        },
+        // onauthGetTelSuccess(da) {
+        //     this.SoHAuth();
+        //     post("v1/getMobile", {
+        //         unid: this.unid,
+        //         ...da.detail,
+        //     }).then((res) => {
+        //         if (res.code === 0) {
+        //             uni.setStorageSync("token", res.data.token);
+        //             this.getuserInfo();
+        //         }
+        //     });
+        // },
+        // SoHAuth() {
+        //     this.$refs.autho.onSoHAuth();
+        // },
         // 获取userinfo
         // 获取userinfo
         async getuserInfo() {
         async getuserInfo() {
             let res = await uni.userfun();
             let res = await uni.userfun();

+ 274 - 0
src/pages/my/wxLogin.vue

@@ -0,0 +1,274 @@
+<template>
+    <view class='authContainer'>
+        <view class='no-authorize'>
+            <view class='shopInfoBox'>
+                <view class='imgPic'>
+                    <image class='img' mode='widthFix' :src='shopInfo.shop_image'></image>
+                </view>
+                <view class='stitle'>欢迎来到 - {{ shopInfo.shop_name }}</view>
+            </view>
+            
+            <view class="btnBar " :class="!agree?'disable':''">
+                <!-- <image class='icon' mode='widthFix' src='@/static/my/weixin.png'></image>
+                <button open-type="getPhoneNumber" class='no-authorize_btn' @getphonenumber="onGotPhoneNumber" lang="zh_CN">微信授权手机号登录</button> -->
+                <button class="no-authorize_btn flex_r flex_ac flex_jc" open-type="getPhoneNumber" @getphonenumber="onGotPhoneNumber" lang="zh_CN" :disabled="!agree">
+                    <image class='icon' mode='widthFix' 
+                    :src="agree ? '/static/my/weixin.png' : '/static/my/weixin_dis.png'"
+                    ></image>
+                    <span>微信授权手机号登录</span>
+                </button>
+            </view>
+            
+            <div class="checkbox-box flex_r flex_as">
+                <checkbox-group @change="checkboxChange" class="flex_r flex_ac">
+                    <label class="checkbox">
+                        <checkbox class='checkboxCom' :checked="agree" value="agree" />
+                    </label>
+                </checkbox-group>
+                <view>
+                    <span @click="agree=!agree">阅读并同意</span>
+                    <span @tap.stop="goto('/pages/agreement/index',{tit:'隐私协议',type:26})" class="hover_a">《用户服务协议》</span>
+                    <text>和</text>
+                    <span @tap.stop="goto('/pages/agreement/index',{tit:'隐私协议',type:27})" class="hover_a">《隐私协议》</span>
+                </view>
+            </div>
+            
+        </view>
+    </view>
+</template>
+<script>
+import { post } from "@/request/api.js";
+export default {
+    data() {
+        return {
+            agree: false,
+            unid: "",
+            shopInfo: {}
+        }
+    },
+    onShow(){
+        this.shopInfo = getApp().globalData.shopInfo
+        this.login()
+    },
+    methods: {
+        login() {
+            let that = this;
+            // #ifdef  MP-WEIXIN
+            wx.login({
+                success(res) {
+                    if (res.code) {
+                        post("v1/appletLogin", {
+                            code: res.code,
+                            invite: uni.getStorageSync("inviteCode") || "XHCYGNZM",
+                        }).then((res) => {
+                            if (res.code === 0) {
+                                if (res.data.token) {
+                                    uni.setStorageSync("token", res.data.token);
+                                    that.getUnid();
+                                } else {
+                                    that.unid = res.data.unid;
+                                    that.shopInfo = app.globalData.shopInfo;
+                                }
+                            }
+                        });
+                    }
+                },
+            });
+            // #endif
+        },
+        async getUnid(){
+            let res = await uni.userfun();
+            this.unid = res.unid
+        },
+        onGotPhoneNumber(da) {
+            let that = this
+            post("v1/getMobile", {
+                unid: this.unid,
+                ...da.detail,
+            }).then((res) => {
+                if (res.code === 0) {
+                    that.$toast(res.msg);
+                    uni.setStorageSync("token", res.data.token);
+                    uni.navigateBack({ delta: 1 });
+                }
+            });
+        },
+        checkboxChange(e) {
+            this.agree = e.detail.value.includes("agree")
+        },
+        // toPage(e,q){
+        //     this.goto('/pages/agreement/index',{tit:'隐私协议',type:27})
+        //     // uni.navigateTo({
+        //     //     url: `${e}?tit=${q.tit}&type=${q.type}`,
+        //     // });
+        // }
+    }
+}
+</script>
+<style lang="scss">
+.transparentDom,
+.authContainer {
+    position: fixed;
+    top: 0;
+    left: 0;
+    right: 0;
+    bottom: 0;
+    width: 100%;
+    height: 100%;
+    margin: 0;
+    padding: 0;
+    z-index: 1999999999999999999;
+}
+
+.authContainer {
+    background-color: #fff;
+    display: flex;
+    display: -webkit-flex;
+    align-items: center;
+}
+
+.no-authorize {
+    background-color: #fff;
+    padding: 0 32rpx 60rpx;
+    width: 84%;
+    position: absolute;
+    left: 8%;
+    right: 8%;
+    box-sizing: border-box;
+    border-radius: 20rpx;
+}
+
+.closeIconBtn {
+    position: absolute;
+    top: 24rpx;
+    right: 24rpx;
+    border: 1px solid #808080;
+    color: #303030;
+    font-size: 18px;
+    height: 44rpx;
+    width: 44rpx;
+    text-align: center;
+    border-radius: 50%;
+    line-height: 40rpx;
+    font-weight: 600;
+}
+
+.shopInfoBox {
+    width: 100%;
+    padding: 96rpx 20rpx 60rpx;
+    display: flex;
+    display: -webkit-flex;
+    align-items: center;
+    box-sizing: border-box;
+}
+
+.shopInfoBox .imgPic {
+    width: 144rpx;
+    height: 144rpx;
+    /* margin-right: 30rpx; */
+    box-shadow: 0rpx 4rpx 16rpx rgba(68, 169, 47, 0.2);
+    border-radius: 50%;
+    overflow: hidden;
+    flex-grow: 1;
+    display: flex;
+    display: -webkit-flex;
+    align-items: center;
+    position: absolute;
+    left: 50%;
+    top: -72rpx;
+    margin-left: -72rpx;
+    background-color: #fff;
+}
+
+.shopInfoBox .imgPic .img {
+    display: block;
+    width: 144rpx;
+    height: 144rpx;
+}
+
+.shopInfoBox .stitle {
+    font-size: 40rpx;
+    font-weight: 500;
+    color: #121212;
+    flex-grow: 0;
+    /* width: calc(100% - 110rpx); */
+    width: 100%;
+    text-align: center;
+}
+
+.no-authorize_title {
+    font-size: 30rpx;
+    font-weight: 500;
+    color: #121212;
+    line-height: 1.5;
+    padding-bottom: 12rpx;
+    text-align: center;
+}
+
+.no-authorize_text {
+    font-size: 24rpx;
+    color: #999;
+    line-height: 1.6;
+    text-align: center;
+}
+
+.btnBar {
+    width: 100%;
+    overflow: hidden;
+    box-sizing: border-box;
+    border-radius: 50rpx;
+    border: 2rpx solid #44a92f;
+    margin-top: 70rpx;
+    background: #44a92f;
+
+    .icon{
+        width: 40rpx;
+        margin-right: 10rpx;
+    }
+
+}
+.disable{
+    border: 2rpx solid #979b96;
+}
+.no-authorize_btn {
+    color: #fff;
+    font-size: 30rpx;   
+    border-radius: 50rpx;
+    margin: unset;
+    background: #44a92f; 
+}
+
+.isDisabledBtn {
+    border-color: #ccc;
+    color: #aaa;
+    background: #eee;
+}
+
+.unSetBtn {
+    background: #fff;
+    color: #44a92f;
+}
+
+.no-authorize_btn::after {
+    border: none;
+}
+
+.checkbox-box {
+    margin-top: 60rpx;
+    margin-bottom: -20px;
+    font-size: 28rpx;
+
+}
+
+.checkbox-box text {
+    /* color: #07d; */
+    /* color: #44A92F; */
+    color: #44a92f;
+}
+
+.checkbox-box .checkbox .checkboxCom {
+    transform: scale(0.64);
+    -webkit-transform: scale(0.64);
+}
+
+</style>

+ 18 - 17
src/pages/product/p_details.vue

@@ -137,7 +137,7 @@
         </uni-popup>
         </uni-popup>
         <!-- 购买或加入购物车弹窗-end -->
         <!-- 购买或加入购物车弹窗-end -->
         <!-- 授权 -->
         <!-- 授权 -->
-        <authorize-module ref="autho" :shopInfo="shopInfo" @authGetTelSuccess="onauthGetTelSuccess" />
+        <!-- <authorize-module ref="autho" :shopInfo="shopInfo" @authGetTelSuccess="onauthGetTelSuccess" /> -->
         <!-- 授权-end -->
         <!-- 授权-end -->
     </view>
     </view>
 </template>
 </template>
@@ -336,9 +336,9 @@ export default {
                 url: "/pages/pay-agreement/index?type=" + this.goodsDa.type,
                 url: "/pages/pay-agreement/index?type=" + this.goodsDa.type,
             });
             });
         },
         },
-        SoHAuth() {
-            this.$refs.autho.onSoHAuth();
-        },
+        // SoHAuth() {
+        //     this.$refs.autho.onSoHAuth();
+        // },
         login(invite) {
         login(invite) {
             let that = this;
             let that = this;
             // #ifdef  MP-WEIXIN
             // #ifdef  MP-WEIXIN
@@ -355,8 +355,9 @@ export default {
                                     that.getuserInfo();
                                     that.getuserInfo();
                                 } else {
                                 } else {
                                     that.unid = res.data.unid;
                                     that.unid = res.data.unid;
+                                    uni.setStorageSync("unid", res.data.unid);
                                     that.shopInfo = app.globalData.shopInfo;
                                     that.shopInfo = app.globalData.shopInfo;
-                                    that.SoHAuth(); //调取授权弹窗
+                                    // that.SoHAuth(); //调取授权弹窗
                                 }
                                 }
                             }
                             }
                         });
                         });
@@ -365,18 +366,18 @@ export default {
             });
             });
             // #endif
             // #endif
         },
         },
-        onauthGetTelSuccess(da) {
-            this.SoHAuth();
-            post("v1/getMobile", {
-                unid: this.unid,
-                ...da.detail,
-            }).then((res) => {
-                if (res.code === 0) {
-                    uni.setStorageSync("token", res.data.token);
-                    this.getuserInfo();
-                }
-            });
-        },
+        // onauthGetTelSuccess(da) {
+        //     this.SoHAuth();
+        //     post("v1/getMobile", {
+        //         unid: this.unid,
+        //         ...da.detail,
+        //     }).then((res) => {
+        //         if (res.code === 0) {
+        //             uni.setStorageSync("token", res.data.token);
+        //             this.getuserInfo();
+        //         }
+        //     });
+        // },
         async getuserInfo() {
         async getuserInfo() {
             this.userinfo = await uni.userfun();
             this.userinfo = await uni.userfun();
         },
         },

+ 18 - 17
src/pages/szw-order-list/index.vue

@@ -47,7 +47,7 @@
             </view>
             </view>
         </view>
         </view>
         <view class="loading-indicator opacity">{{ loadingTip }}</view>
         <view class="loading-indicator opacity">{{ loadingTip }}</view>
-        <authorize-module ref="autho" :shopInfo="shopInfo" @authGetTelSuccess="onauthGetTelSuccess" />
+        <!-- <authorize-module ref="autho" :shopInfo="shopInfo" @authGetTelSuccess="onauthGetTelSuccess" /> -->
     </view>
     </view>
 </template>
 </template>
 <script>
 <script>
@@ -111,8 +111,9 @@ export default {
                                     that.loadData();
                                     that.loadData();
                                 } else {
                                 } else {
                                     that.unid = res.data.unid;
                                     that.unid = res.data.unid;
+                                    uni.setStorageSync("unid", res.data.unid);
                                     that.shopInfo = app.globalData.shopInfo;
                                     that.shopInfo = app.globalData.shopInfo;
-                                    that.SoHAuth(); //调取授权弹窗
+                                    // that.SoHAuth(); //调取授权弹窗
                                 }
                                 }
                             }
                             }
                         });
                         });
@@ -122,21 +123,21 @@ export default {
             // #endif
             // #endif
         },
         },
         // 获取手机号
         // 获取手机号
-        onauthGetTelSuccess(da) {
-            this.SoHAuth();
-            post("v1/getMobile", {
-                unid: this.unid,
-                ...da.detail,
-            }).then((res) => {
-                if (res.code === 0) {
-                    uni.setStorageSync("token", res.data.token);
-                    this.loadData();
-                }
-            });
-        },
-        SoHAuth() {
-            this.$refs.autho.onSoHAuth();
-        },
+        // onauthGetTelSuccess(da) {
+        //     this.SoHAuth();
+        //     post("v1/getMobile", {
+        //         unid: this.unid,
+        //         ...da.detail,
+        //     }).then((res) => {
+        //         if (res.code === 0) {
+        //             uni.setStorageSync("token", res.data.token);
+        //             this.loadData();
+        //         }
+        //     });
+        // },
+        // SoHAuth() {
+        //     this.$refs.autho.onSoHAuth();
+        // },
         
         
         clearData(isclearCat = true, callBack) {
         clearData(isclearCat = true, callBack) {
             page = 1;
             page = 1;

+ 18 - 17
src/pagesC/settledMerchant/merchant.vue

@@ -38,7 +38,7 @@
         <!-- 图片查看组件 -->
         <!-- 图片查看组件 -->
         <preview ref="previewimg" :listType="2" @close="previewclose"/>
         <preview ref="previewimg" :listType="2" @close="previewclose"/>
         <!-- 授权 -->
         <!-- 授权 -->
-        <authorize-module ref="autho" :shopInfo="shopInfo" @authGetTelSuccess="onauthGetTelSuccess" />
+        <!-- <authorize-module ref="autho" :shopInfo="shopInfo" @authGetTelSuccess="onauthGetTelSuccess" /> -->
     </div>
     </div>
 </template>
 </template>
 <script>
 <script>
@@ -113,9 +113,9 @@ export default {
             this.setLS("topay_merchant",this.detail)
             this.setLS("topay_merchant",this.detail)
             this.goto("/pagesC/settledMerchant/pay")
             this.goto("/pagesC/settledMerchant/pay")
         },
         },
-        SoHAuth() {
-            this.$refs.autho.onSoHAuth();
-        },
+        // SoHAuth() {
+        //     this.$refs.autho.onSoHAuth();
+        // },
         login(invite) {
         login(invite) {
             let that = this;
             let that = this;
             // #ifdef  MP-WEIXIN
             // #ifdef  MP-WEIXIN
@@ -132,8 +132,9 @@ export default {
                                     that.merchant();
                                     that.merchant();
                                 } else {
                                 } else {
                                     that.unid = res.data.unid;
                                     that.unid = res.data.unid;
+                                    uni.setStorageSync("unid", res.data.unid);
                                     that.shopInfo = app.globalData.shopInfo;
                                     that.shopInfo = app.globalData.shopInfo;
-                                    that.SoHAuth(); //调取授权弹窗
+                                    // that.SoHAuth(); //调取授权弹窗
                                 }
                                 }
                             }
                             }
                         });
                         });
@@ -142,18 +143,18 @@ export default {
             });
             });
             // #endif
             // #endif
         },
         },
-        onauthGetTelSuccess(da) {
-            this.SoHAuth();
-            post("v1/getMobile", {
-                unid: this.unid,
-                ...da.detail,
-            }).then((res) => {
-                if (res.code === 0) {
-                    uni.setStorageSync("token", res.data.token);
-                    this.merchant();
-                }
-            });
-        },
+        // onauthGetTelSuccess(da) {
+        //     this.SoHAuth();
+        //     post("v1/getMobile", {
+        //         unid: this.unid,
+        //         ...da.detail,
+        //     }).then((res) => {
+        //         if (res.code === 0) {
+        //             uni.setStorageSync("token", res.data.token);
+        //             this.merchant();
+        //         }
+        //     });
+        // },
         sceneToObject(scene) {
         sceneToObject(scene) {
             scene = decodeURIComponent(scene);
             scene = decodeURIComponent(scene);
             let ret = {}
             let ret = {}

+ 18 - 0
src/request/request.js

@@ -54,6 +54,24 @@ uni.addInterceptor('request', {
 				icon: "none",
 				icon: "none",
 			});
 			});
 		}
 		}
+		if (args.data.code == -2) {
+			// #ifdef  MP-WEIXIN
+			uni.showModal({
+				title: "温馨提示",
+				content: "您还未登录",
+				showCancel: true,
+				confirmText: "前往登录",
+				confirmColor: "#f02f2f",
+				success(res) {
+					if (res.confirm) {
+						uni.navigateTo({url:"/pages/my/wxLogin"})
+					}
+					
+				},
+				
+			});
+			// #endif
+		}
 	},
 	},
 	fail(err) {
 	fail(err) {
 		// console.log('interceptor-fail', err)			//请求失败
 		// console.log('interceptor-fail', err)			//请求失败

BIN
src/static/my/weixin.png


BIN
src/static/my/weixin_dis.png