登录增加协议选择逻辑
增加审核测试参数处理逻辑
This commit is contained in:
parent
cb40ce643f
commit
531a955fe2
31
src/App.vue
31
src/App.vue
@ -3,7 +3,32 @@ import { mpUpdate, setCompanyId, setReferrerUserId, setRegisterStoreId } from '@
|
|||||||
|
|
||||||
onLaunch((options) => {
|
onLaunch((options) => {
|
||||||
console.log('App Launch options ', options);
|
console.log('App Launch options ', options);
|
||||||
// setRegisterStoreId('1144085996641443841');
|
|
||||||
|
const miniProgram = uni.getAccountInfoSync().miniProgram;
|
||||||
|
const env = miniProgram.envVersion;
|
||||||
|
console.table(miniProgram);
|
||||||
|
|
||||||
|
//生产
|
||||||
|
if(env === 'release') {
|
||||||
|
uni.request({
|
||||||
|
url: 'https://api.lakeapp.cn/wechat/version_info',
|
||||||
|
success(res) {
|
||||||
|
console.log(res);
|
||||||
|
const { version, audit } = res.data;
|
||||||
|
if(miniProgram.version === version && audit == 1) {
|
||||||
|
setCompanyId('1144085996213624833');
|
||||||
|
setRegisterStoreId('1150930317436633090');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// setCompanyId('1144085996213624833');
|
||||||
|
// setRegisterStoreId('1150930317436633090');
|
||||||
|
}
|
||||||
|
//测试、开发 trial,develop
|
||||||
|
else {
|
||||||
|
setCompanyId('1150930317231112193');
|
||||||
|
setRegisterStoreId('1144085996641443841');
|
||||||
|
}
|
||||||
if(options?.query) {
|
if(options?.query) {
|
||||||
|
|
||||||
//保存登录邀请员工id
|
//保存登录邀请员工id
|
||||||
@ -29,11 +54,11 @@ onLaunch((options) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(options?.query.scene === 'edit_avatar_nickname') {
|
if(options?.query.scene === 'edit_avatar_nickname') {
|
||||||
setTimeout(()=>{
|
setTimeout(() => {
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: '/pages/mine/subs/profile/index'
|
url: '/pages/mine/subs/profile/index'
|
||||||
});
|
});
|
||||||
},500)
|
}, 500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,11 +10,15 @@
|
|||||||
微信登录
|
微信登录
|
||||||
</button>
|
</button>
|
||||||
<view class='hint'>
|
<view class='hint'>
|
||||||
登录代表同意
|
<image @click.stop='bindCheck'
|
||||||
<text class='link' @click.stop='openPrivacy'>
|
:src='isAgreePrivacy?("/static/images/ic_checked_green.png"):("/static/images/ic_checked_gray.png")' />
|
||||||
《小程序隐私保护协议》
|
|
||||||
|
<text @click.stop='bindCheck'>请先阅读并同意
|
||||||
|
<text class='link' @click.stop='openPrivacy'>
|
||||||
|
《小程序隐私保护协议》
|
||||||
|
</text>
|
||||||
|
并授权使用您的账号信息(如昵称、头像、收获地址)以便您统一管理
|
||||||
</text>
|
</text>
|
||||||
并授权使用您的账号信息(如昵称、头像、收获地址)以便您统一管理
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@ -22,10 +26,16 @@
|
|||||||
<script setup lang='ts'>
|
<script setup lang='ts'>
|
||||||
import { useUserStore } from '@/store';
|
import { useUserStore } from '@/store';
|
||||||
import { assetsUrl } from '@/utils/assets';
|
import { assetsUrl } from '@/utils/assets';
|
||||||
|
import { showToast } from '@/utils';
|
||||||
|
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
|
const isAgreePrivacy = ref(false);
|
||||||
|
|
||||||
function wechatLogin() {
|
function wechatLogin() {
|
||||||
|
if(!isAgreePrivacy.value) {
|
||||||
|
showToast('请先阅读并同意小程序隐私保护协议');
|
||||||
|
return;
|
||||||
|
}
|
||||||
uni.showLoading();
|
uni.showLoading();
|
||||||
userStore.authLogin().then(() => {
|
userStore.authLogin().then(() => {
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
@ -33,6 +43,10 @@ function wechatLogin() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const bindCheck = () => {
|
||||||
|
isAgreePrivacy.value = !isAgreePrivacy.value;
|
||||||
|
};
|
||||||
|
|
||||||
const openPrivacy = () => {
|
const openPrivacy = () => {
|
||||||
wx.openPrivacyContract({
|
wx.openPrivacyContract({
|
||||||
success: () => {
|
success: () => {
|
||||||
@ -43,6 +57,7 @@ const openPrivacy = () => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang='scss' scoped>
|
<style lang='scss' scoped>
|
||||||
@ -81,14 +96,23 @@ const openPrivacy = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.hint {
|
.hint {
|
||||||
|
display: inline-block;
|
||||||
padding: 20rpx 50rpx;
|
padding: 20rpx 50rpx;
|
||||||
font-size: 25rpx;
|
font-size: 25rpx;
|
||||||
color: $u-tips-color;
|
color: $u-tips-color;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 0;
|
align-items: center;
|
||||||
|
bottom: 50rpx;
|
||||||
|
|
||||||
.link {
|
.link {
|
||||||
color: $u-warning;
|
color: $u-warning;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
image {
|
||||||
|
width: 30rpx;
|
||||||
|
height: 30rpx;
|
||||||
|
margin-right: 10rpx;
|
||||||
|
margin-bottom: -5rpx;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
BIN
src/static/images/ic_checked_gray.png
Normal file
BIN
src/static/images/ic_checked_gray.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.4 KiB |
BIN
src/static/images/ic_checked_green.png
Normal file
BIN
src/static/images/ic_checked_green.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.6 KiB |
Loading…
Reference in New Issue
Block a user