feat:173版本
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<view class="login_warp">
|
||||
<view class="login_warp" @touchmove.stop.prevent>
|
||||
<u-icon size="30rpx" name="arrow-left" color="#333" @click="onBack"></u-icon>
|
||||
<view class="login_logo_warp">
|
||||
<view style="text-align: center">
|
||||
@@ -72,20 +72,18 @@
|
||||
<!-- #ifdef APP-PLUS -->
|
||||
<view class="other_login">其他登录方式</view>
|
||||
<view class="login_other_icon">
|
||||
<view class="login_other_item" @click="wechatOneLogin(2)">
|
||||
<up-image src="/pages/login_package/static/login/WXICON.png" width="44" height="44"
|
||||
<view class="login_other_item" v-if="(isIOS && isWechatInstalled) || !isIOS" @click="wechatOneLogin(2)">
|
||||
<up-image src="https://static.tbmall.xin/static/home/wechat.png" width="44" height="44"
|
||||
bgColor="#f1f6ff00"></up-image>
|
||||
微信登录
|
||||
</view>
|
||||
<!-- <view class="login_other_item" @click="aa"> -->
|
||||
<view v-if="!isIOS" class="login_other_item" @click="alipayOneLogin">
|
||||
<up-image src="/pages/login_package/static/login/ZFB.png" width="44" height="44"
|
||||
<up-image src="https://static.tbmall.xin/static/home/alipay.png" width="44" height="44"
|
||||
bgColor="#f1f6ff00"></up-image>
|
||||
支付宝登录
|
||||
|
||||
</view>
|
||||
<view v-if="isIOS" class="login_other_item" @click="appleOneLogin">
|
||||
<up-icon name="apple-fill" size="44" color="#000000"></up-icon>
|
||||
Apple登录
|
||||
<up-image src="https://static.tbmall.xin/static/home/apple.png" width="44" height="44"
|
||||
bgColor="#f1f6ff00"></up-image>
|
||||
</view>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
@@ -93,11 +91,14 @@
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<view class="other_login">其他登录方式</view>
|
||||
<view class="login_other_icon">
|
||||
<view class="login_other_item" @click="wechatOneLogin(1)">
|
||||
<up-image src="/pages/login_package/static/login/WXICON.png" width="44" height="44"
|
||||
<view v-if="!isPolicy" class="login_other_item" @click="handleUnpolicyWXLogin">
|
||||
<up-image src="https://static.tbmall.xin/static/home/wechat.png" width="44" height="44"
|
||||
bgColor="#f1f6ff00"></up-image>
|
||||
微信登录
|
||||
</view>
|
||||
<button v-else class="login_other_item" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">
|
||||
<up-image src="https://static.tbmall.xin/static/home/wechat.png" width="44" height="44"
|
||||
bgColor="#f1f6ff00"></up-image>
|
||||
</button>
|
||||
</view>
|
||||
<view class="login_other_icon">
|
||||
<view class="login_other_item_you" @click="jumpHome">
|
||||
@@ -124,6 +125,7 @@
|
||||
|
||||
<script>
|
||||
import InputCodeComm from "@/pages/login_package/components/code-comm/code-comm.vue";
|
||||
|
||||
import {
|
||||
SMS_TYPE
|
||||
} from "@/utils/enumUtils.js";
|
||||
@@ -145,6 +147,7 @@ import {
|
||||
USER_LOGIN_TIME,
|
||||
} from "@/utils/auth.js";
|
||||
import CryptoJS from "crypto-js";
|
||||
import { loginFn, getPhoneNumberFn } from "@/utils/login.js";
|
||||
|
||||
// #ifdef APP-PLUS
|
||||
const hyyAlipay = uni.requireNativePlugin("Hyy-Alipay");
|
||||
@@ -162,9 +165,17 @@ export default {
|
||||
uni.setStorageSync("version-1", inf.version); // 大版本号
|
||||
uni.setStorageSync("versionCode", inf.versionCode); // 小版本号
|
||||
});
|
||||
let uuid = plus.device.uuid;
|
||||
// #endif
|
||||
},
|
||||
onLoad() {
|
||||
// #ifdef APP-PLUS
|
||||
// 判断微信是否安装 (iOS 的 scheme 为 weixin://)
|
||||
this.isWechatInstalled = plus.runtime.isApplicationExist({
|
||||
action: 'weixin://'
|
||||
});
|
||||
// #endif
|
||||
},
|
||||
|
||||
components: {
|
||||
InputCodeComm,
|
||||
},
|
||||
@@ -189,6 +200,7 @@ export default {
|
||||
countdown: false, // 清空倒计时
|
||||
loading: false,
|
||||
showPolicyModal: false,
|
||||
isWechatInstalled: false,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
@@ -198,31 +210,14 @@ export default {
|
||||
url: '/pages/home/home'
|
||||
})
|
||||
},
|
||||
aa() {
|
||||
const nativiPlugin = uni.requireNativePlugin('WITTestUniPlugin');
|
||||
console.log("隐藏原生tabbar", nativiPlugin)
|
||||
nativiPlugin.testAsyncFunc({},
|
||||
(ret) => {
|
||||
uni.showToast({
|
||||
title: '调用异步方法 ' + ret,
|
||||
icon: "none"
|
||||
})
|
||||
console.log(ret);
|
||||
});
|
||||
},
|
||||
|
||||
jumpHome() {
|
||||
// const sysPlatform = getCurrentSysPlatform();
|
||||
// if(sysPlatform === "android"){
|
||||
// uni.switchTab({
|
||||
// url: '/pages/message/message',
|
||||
// })
|
||||
// }else{
|
||||
|
||||
uni.switchTab({
|
||||
url: "/pages/home/home",
|
||||
});
|
||||
// }
|
||||
},
|
||||
|
||||
async loginFun(val = {}) {
|
||||
const then = this;
|
||||
const form = this.form;
|
||||
@@ -268,7 +263,6 @@ export default {
|
||||
uni.setStorageSync('version-1', inf.version); // 大版本号
|
||||
uni.setStorageSync('versionCode', inf.versionCode); // 小版本号
|
||||
});
|
||||
let uuid = plus.device.uuid;
|
||||
// #endif
|
||||
|
||||
this.$refs.uToastRef.show({
|
||||
@@ -593,6 +587,79 @@ export default {
|
||||
});
|
||||
// #endif
|
||||
},
|
||||
|
||||
handleUnpolicyWXLogin() {
|
||||
this.showPolicyModal = true;
|
||||
},
|
||||
handlePolicyConfirm() {
|
||||
this.isPolicy = true;
|
||||
this.showPolicyModal = false;
|
||||
// #ifdef MP-WEIXIN
|
||||
this.$refs.uToastRef.show({
|
||||
type: "success",
|
||||
message: "已同意协议,请再次点击微信登录",
|
||||
});
|
||||
// #endif
|
||||
// #ifndef MP-WEIXIN
|
||||
this.loginFun();
|
||||
// #endif
|
||||
},
|
||||
|
||||
getPhoneNumber(e) { // 在bindgetphonenumber回调中获取code动态令牌
|
||||
if (!e || !e.detail || !e.detail.code) {
|
||||
console.log('用户拒绝授权手机号或获取失败:', e);
|
||||
return;
|
||||
}
|
||||
loginFn().then(res => { // 微信登录&服务端获取code
|
||||
console.log("微信登录", res.code, e.detail.code)
|
||||
// return
|
||||
getPhoneNumberFn(res.code, e.detail.code).then(response => { // 服务端获取手机号
|
||||
if (response && response.bizcode === 100) {
|
||||
const data = response.data;
|
||||
setStorageFun(TOKEN_NAME, data.token);
|
||||
// 用于无感登录
|
||||
setStorageFun(USER_KEY, "");
|
||||
const userInfo = {
|
||||
avatar: data.avatarUrl,
|
||||
name: data.name,
|
||||
userId: data.userId,
|
||||
grade: data.grade,
|
||||
inviteCode: data.inviteCode,
|
||||
};
|
||||
setStorageFun(USER_DATA, userInfo);
|
||||
// 当前登录得时间戳
|
||||
let currentTimeStamp = new Date().getTime();
|
||||
setStorageFun(USER_LOGIN_TIME, currentTimeStamp);
|
||||
|
||||
const sysInfo = uni.getSystemInfoSync();
|
||||
uni.setStorageSync("platform", sysInfo.platform);
|
||||
// #ifdef APP-PLUS
|
||||
// 获取应用版本信息
|
||||
plus.runtime.getProperty(plus.runtime.appid, function (inf) {
|
||||
console.log("版本信息", inf.versionCode);
|
||||
uni.setStorageSync("version-1", inf.version); // 大版本号
|
||||
uni.setStorageSync("versionCode", inf.versionCode); // 小版本号
|
||||
});
|
||||
// #endif
|
||||
|
||||
this.$refs.uToastRef.show({
|
||||
type: "success",
|
||||
message: response.msg,
|
||||
});
|
||||
setTimeout(() => {
|
||||
uni.switchTab({
|
||||
url: "/pages/home/home",
|
||||
});
|
||||
}, 1200);
|
||||
} else if (response && response.msg) {
|
||||
this.$refs.uToastRef.show({
|
||||
type: "error",
|
||||
message: response.msg,
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
computed: {
|
||||
@@ -608,7 +675,8 @@ export default {
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.login_warp {
|
||||
min-height: 100vh;
|
||||
height: 100vh;
|
||||
overflow: hidden;
|
||||
box-sizing: border-box;
|
||||
padding: 120rpx 50rpx 40rpx;
|
||||
display: flex;
|
||||
@@ -697,6 +765,15 @@ export default {
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
margin-bottom: 80rpx;
|
||||
background: transparent;
|
||||
border: none;
|
||||
padding: 0;
|
||||
line-height: normal;
|
||||
color: inherit;
|
||||
|
||||
&::after {
|
||||
border: none;
|
||||
}
|
||||
}
|
||||
|
||||
.login_other_item_you {
|
||||
|
||||
Reference in New Issue
Block a user