From b898e42bd46726a0c25081ca79136911b4ca1b4c Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期一, 27 四月 2026 22:26:34 +0800
Subject: [PATCH] Merge branch 'master' of http://139.186.142.91:10010/r/productDev/gtzxinglijicun
---
small-program/shop/pages/login/login.vue | 79 ++++++++++++++++++++++-----------------
1 files changed, 45 insertions(+), 34 deletions(-)
diff --git a/small-program/shop/pages/login/login.vue b/small-program/shop/pages/login/login.vue
index a139eb9..105b659 100644
--- a/small-program/shop/pages/login/login.vue
+++ b/small-program/shop/pages/login/login.vue
@@ -26,9 +26,9 @@
<image class="agree-icon" :src="agreed ? '/static/icon/ic_accept_sel@2x.png' : '/static/icon/ic_accept@2x.png'" mode="aspectFit" @tap="agreed = !agreed"></image>
<view class="agreement-text-wrap">
<text class="agreement-text">鎴戝凡闃呰骞跺悓鎰�</text>
- <text class="agreement-link" @click="goToService">銆婄敤鎴锋湇鍔″崗璁��</text>
+ <text class="agreement-link" @click="goToService(0)">銆婄敤鎴锋湇鍔″崗璁��</text>
<text class="agreement-text">鍙�</text>
- <text class="agreement-link" @click="goToPrivacy">銆婄敤鎴烽殣绉佹斂绛栥��</text>
+ <text class="agreement-link" @click="goToService(1)">銆婄敤鎴烽殣绉佹斂绛栥��</text>
</view>
</view>
</view>
@@ -39,7 +39,7 @@
export default {
computed: {
- ...mapState(['openid', 'userInfo'])
+ ...mapState(['openid', 'userInfo','userType'])
},
data() {
return {
@@ -52,35 +52,43 @@
},
onLoad() {
// 闈欓粯鐧诲綍
+
if (this.userInfo.bindShopId) {
- this.$u.api.shopSilentLogin({})
- .then(async res => {
- if (res.code === 200) {
- this.$store.commit('setUserType', 1)
- this.$store.commit('setShopToken', res.data.token)
- // 鑾峰彇闂ㄥ簵淇℃伅
- const shopInfoRes = await this.$u.api.getShopInfo({})
- if (shopInfoRes.code === 200) {
- this.$store.commit('setShopInfo', shopInfoRes.data)
+ uni.showLoading({
+ title:'鐧诲綍涓�...'
+ })
+ try{
+ console.log(this.userType,"============================================")
+ this.$u.api.shopSilentLogin({})
+ .then( res => {
+ if (res.code === 200 && res.data) {
+ this.$store.commit('setUserType', 1)
+ this.$store.commit('setShopToken', res.data.token)
+ // 鑾峰彇闂ㄥ簵淇℃伅
+ this.$u.api.getShopInfo({}).then( shopInfoRes => {
+ if (shopInfoRes.code === 200) {
+ this.$store.commit('setShopInfo', shopInfoRes.data)
+ }
+ uni.hideLoading();
+ // setTimeout(() => {
+ uni.reLaunch({
+ url: '/shop/pages/store-home/store-home'
+ });
+ // }, 1000)
+ })
}
- setTimeout(() => {
- uni.reLaunch({
- url: '/shop/pages/store-home/store-home'
- });
- }, 1000)
- }
- })
+ uni.hideLoading()
+ })
+ }catch(e){
+ uni.hideLoading()
+ }
+ setTimeout(() => {
+ uni.hideLoading()
+ }, 10000)
}
},
methods: {
async handleLogin() {
- if (!this.agreed) {
- uni.showToast({
- title: '璇峰厛闃呰骞跺悓鎰忓崗璁�',
- icon: 'none'
- })
- return
- }
if (!this.form.telephone) {
uni.showToast({
title: '璇疯緭鍏ヨ处鍙�',
@@ -91,6 +99,13 @@
if (!this.form.password) {
uni.showToast({
title: '璇疯緭鍏ュ瘑鐮�',
+ icon: 'none'
+ })
+ return
+ }
+ if (!this.agreed) {
+ uni.showToast({
+ title: '璇峰厛闃呰骞跺悓鎰忓崗璁�',
icon: 'none'
})
return
@@ -131,16 +146,11 @@
})
}
},
- goToService() {
+ goToService(type) {
uni.navigateTo({
- url: '/pages/rich-text/rich-text?type=userAgreement'
+ url: '/pages/rich-text/rich-text?type='+type
})
- },
- goToPrivacy() {
- uni.navigateTo({
- url: '/pages/rich-text/rich-text?type=privacyPolicy'
- })
- }
+ }
}
}
</script>
@@ -219,6 +229,7 @@
}
.agreement-row {
+ background: #D9F3FF;
margin-top: 60rpx;
display: flex;
align-items: flex-start;
--
Gitblit v1.9.3