feat: 微信支付宝登录对接

This commit is contained in:
2025-09-23 23:19:16 +08:00
parent 0f033c1d8d
commit a22b987ed9
7 changed files with 463 additions and 492 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
"version" : "1.0", "version" : "1.0",
"configurations" : [ "configurations" : [
{ {
"playground" : "standard", "playground" : "custom",
"type" : "uni-app:app-android" "type" : "uni-app:app-android"
} }
] ]
+6 -3
View File
@@ -149,16 +149,19 @@ export function bindInvitationCode(params) {
// 微信一键登录 // 微信一键登录
export function wechatLogin(params) { export function wechatLogin(params) {
return request({ return request({
url: `/auth/loginByWechat?wechatCode=${params.wechatCode}&isValid=${params.isValid}`, url: `/auth/loginByWechat`,
method: "post" method: "post",
data: params,
cha:1
}); });
} }
// 支付宝一键登录 // 支付宝一键登录
export function alipayLogin(params) { export function alipayLogin(params) {
return request({ return request({
url: "/auth/loginByAlipay", url: "/auth/loginByAlipayNew",
method: "post", method: "post",
data: params, data: params,
cha:1
}); });
} }
+2 -1
View File
@@ -82,7 +82,8 @@
"weixin" : { "weixin" : {
"appid" : "wx7a5902cd556d9396", "appid" : "wx7a5902cd556d9396",
"UniversalLinks" : "https://app.tbmall.xin/uni-universallinks/__UNI__4910728/" "UniversalLinks" : "https://app.tbmall.xin/uni-universallinks/__UNI__4910728/"
} },
"apple" : {}
} }
}, },
"icons" : { "icons" : {
+16 -20
View File
@@ -52,7 +52,7 @@
@click="registerFun" @click="registerFun"
:loading="butLoading" :loading="butLoading"
> >
登录 登录
</view> </view>
<up-toast ref="uToastRef"></up-toast> <up-toast ref="uToastRef"></up-toast>
@@ -62,7 +62,7 @@
<script> <script>
import { SMS_TYPE } from "@/utils/enumUtils.js"; import { SMS_TYPE } from "@/utils/enumUtils.js";
import { getUserList } from "@/api/common.js"; import { getUserList } from "@/api/common.js";
import { wechatLogin } from "@/api/auth.js"; import { wechatLogin,alipayLogin } from "@/api/auth.js";
import { import {
setStorageFun, setStorageFun,
TOKEN_NAME, TOKEN_NAME,
@@ -77,7 +77,7 @@ export default {
form: { form: {
mobile: null, mobile: null,
smsCode: null, // 验证码 smsCode: null, // 验证码
wechatCode: null, token: null,
}, },
inputCss: { inputCss: {
height: "80rpx", height: "80rpx",
@@ -89,17 +89,14 @@ export default {
countdown: false, // 清空倒计时 countdown: false, // 清空倒计时
butLoading: false, butLoading: false,
disabled: false, disabled: false,
type: 1, //1.微信 2.支付宝
}; };
}, },
onLoad() {
const pages = getCurrentPages();
const currentPage = pages[pages.length - 1];
const id = currentPage.options?.key;
if (id) {
this.disabled = true;
}
this.form.wechatCode = id; onLoad(option) {
this.form.token = option.token;
this.type = option.type;
console.log("-----1", option, this.form.token, this.type );
}, },
methods: { methods: {
jumpMine() { jumpMine() {
@@ -130,13 +127,12 @@ export default {
mobile: form.mobile, mobile: form.mobile,
smsCode: form.smsCode, smsCode: form.smsCode,
isValid: true, isValid: true,
wechatCode: form.id, token: form.token,
}; };
const response = this.type == 1 ? await wechatLogin(params) : await alipayLogin(params);
const response = await wechatLogin(params); console.log("微信登录接口返回:", params, response);
console.log("微信登录接口返回:", response); if (response && response.bizcode === 100) {
if (resp && resp.bizcode === 100) { const data = response.data;
const data = resp.data;
setStorageFun(TOKEN_NAME, data.token); setStorageFun(TOKEN_NAME, data.token);
// 用于无感登录 // 用于无感登录
setStorageFun(USER_KEY, ""); setStorageFun(USER_KEY, "");
@@ -153,7 +149,7 @@ export default {
setStorageFun(USER_LOGIN_TIME, currentTimeStamp); setStorageFun(USER_LOGIN_TIME, currentTimeStamp);
this.$refs.uToastRef.show({ this.$refs.uToastRef.show({
type: "success", type: "success",
message: resp.msg, message: response.msg,
}); });
setTimeout(() => { setTimeout(() => {
uni.switchTab({ uni.switchTab({
@@ -180,7 +176,7 @@ export default {
const params = { const params = {
mobile: form.mobile, mobile: form.mobile,
type: SMS_TYPE.WECHAT, type:this.type == 1 ? SMS_TYPE.WECHAT : SMS_TYPE.ALIPAY,
}; };
const response = await getUserList(params); const response = await getUserList(params);
if (response && response.bizcode === 100) { if (response && response.bizcode === 100) {
@@ -200,7 +196,7 @@ export default {
.header_ { .header_ {
display: flex; display: flex;
align-items: center; align-items: center;
padding: 0 30rpx; padding: calc(24rpx + env(safe-area-inset-bottom)) 30rpx 0 30rpx;
.title_ { .title_ {
font-weight: bold; font-weight: bold;
font-size: 36rpx; font-size: 36rpx;
+433 -464
View File
@@ -1,496 +1,465 @@
<template> <template>
<view class="login_warp"> <view class="login_warp">
<view class="login_logo_warp"> <view class="login_logo_warp">
<view style="text-align: center"> <view style="text-align: center">
<up-image <up-image src="/static/logo.png" width="90" height="118" bgColor="#f1f6ff00" radius="10"></up-image>
src="/static/logo.png" </view>
width="90" <!-- <view style="margin-top: 20rpx;">
height="118"
bgColor="#f1f6ff00"
radius="10"
></up-image>
</view>
<!-- <view style="margin-top: 20rpx;">
<up-image src="/static/logo_z.png" width="100" height="40" bgColor="#f1f6ff00"></up-image> <up-image src="/static/logo_z.png" width="100" height="40" bgColor="#f1f6ff00"></up-image>
</view> --> </view> -->
</view> </view>
<view class="login_info"> <view class="login_info">
<view class="login_info_item"> <view class="login_info_item">
<up-input <up-input placeholder="请输入手机号/账户名称" border="surround" v-model="form.name" :customStyle="inputCss"
placeholder="请输入手机号/账户名称" @change="checkNameParam"></up-input>
border="surround" </view>
v-model="form.name" <!-- 密码登录 -->
:customStyle="inputCss" <view class="login_info_item" v-if="loginWay === 'password'">
@change="checkNameParam" <up-input placeholder="请输入密码" border="surround" v-model="form.password" :customStyle="inputCss"
></up-input> :type="isShow ? 'text' : 'password'" @change="checkParam">
</view> <template #suffix style="margin-right: 10rpx">
<!-- 密码登录 --> <up-image v-if="isShow" src="/static/login/show.png" width="20" height="20" bgColor="#f1f6ff00"
<view class="login_info_item" v-if="loginWay === 'password'"> @click="isShow = false"></up-image>
<up-input <up-image v-else src="/static/login/hidden.png" width="20" height="20" bgColor="#f1f6ff00"
placeholder="请输入密码" @click="isShow = true"></up-image>
border="surround" </template>
v-model="form.password" </up-input>
:customStyle="inputCss" </view>
:type="isShow ? 'text' : 'password'" <!-- 验证码登录 -->
@change="checkParam" <view class="login_info_item" v-else>
> <up-input placeholder="请输入验证码" border="surround" v-model="form.code" :customStyle="inputCss">
<template #suffix style="margin-right: 10rpx"> <template #suffix style="margin-right: 10rpx">
<up-image <view v-if="countdown" class="code-warp">
v-if="isShow" <up-count-down :time="60 * 1000" format="ss" @finish="countdown = false"></up-count-down>
src="/static/login/show.png" <text style="margin-left: 10rpx">s</text>
width="20" </view>
height="20" <view v-else @click="getMobileCode" class="code_msg">
bgColor="#f1f6ff00" 获取验证码
@click="isShow = false" </view>
></up-image> </template>
<up-image </up-input>
v-else </view>
src="/static/login/hidden.png"
width="20"
height="20"
bgColor="#f1f6ff00"
@click="isShow = true"
></up-image>
</template>
</up-input>
</view>
<!-- 验证码登录 -->
<view class="login_info_item" v-else>
<up-input
placeholder="请输入验证码"
border="surround"
v-model="form.code"
:customStyle="inputCss"
>
<template #suffix style="margin-right: 10rpx">
<view v-if="countdown" class="code-warp">
<up-count-down
:time="60 * 1000"
format="ss"
@finish="countdown = false"
></up-count-down>
<text style="margin-left: 10rpx">s</text>
</view>
<view v-else @click="getMobileCode" class="code_msg">
获取验证码
</view>
</template>
</up-input>
</view>
<view class="login_comm_but login_comm_but_yes" @click="loginFun"> <view class="login_comm_but login_comm_but_yes" @click="loginFun">
<text style="margin-left: 10rpx">登录</text> <text style="margin-left: 10rpx">登录</text>
</view> </view>
<view class="cut_way_warp"> <view class="cut_way_warp">
<view v-if="loginWay === 'password'" @click="loginWay = 'code'" <view v-if="loginWay === 'password'" @click="loginWay = 'code'">验证码登录</view>
>验证码登录</view <view v-if="loginWay === 'code'" @click="loginWay = 'password'">密码登录登录</view>
> <view @click="jumpForgot">忘记密码</view>
<view v-if="loginWay === 'code'" @click="loginWay = 'password'" <view @click="jumpRegister">注册</view>
>密码登录登录</view </view>
> </view>
<view @click="jumpForgot">忘记密码</view> <view v-if="!isIOS">
<view @click="jumpRegister">注册</view> <view class="other_login">其他登录方式</view>
</view> <view class="login_other_icon">
</view> <view class="login_other_item" @click="wechatOneLogin">
<view> <up-image src="/static/login/WXICON.png" width="44" height="44" bgColor="#f1f6ff00"></up-image>
<view class="other_login">其他登录方式</view> 微信登录
<view class="login_other_icon"> </view>
<view class="login_other_item" @click="wechatOneLogin"> <view class="login_other_item" @click="alipayOneLogin">
<up-image <up-image src="/static/login/ZFB.png" width="44" height="44" bgColor="#f1f6ff00"></up-image>
src="/static/login/WXICON.png" 支付宝登录
width="44" </view>
height="44" </view>
bgColor="#f1f6ff00" </view>
></up-image> <view class="policy_warp">
微信登录 <up-checkbox name="isCheck" usedAlone v-model:checked="isPolicy" shape="circle" activeColor="#7934F6"
</view> size="19" iconSize="18">
<!-- <view class="login_other_item" @click="alipayOneLogin"> <template #label>
<up-image <text>已阅读并同意</text>
src="/static/login/ZFB.png" <text class="policy_a_warp" @click="jumpUserAgreement">《服务协议》</text>
width="44" <text>、</text>
height="44" <text class="policy_a_warp" @click="jumpPrivacyAgreement">《隐私政策》</text>
bgColor="#f1f6ff00" <text>、</text>
></up-image> <text class="policy_a_warp" @click="jumpProductAgreement">《售后保障协议》</text>
支付宝登录 </template>
</view> --> </up-checkbox>
</view> </view>
</view> <up-toast ref="uToastRef"></up-toast>
<view class="policy_warp"> </view>
<up-checkbox
name="isCheck"
usedAlone
v-model:checked="isPolicy"
shape="circle"
activeColor="#7934F6"
size="19"
iconSize="18"
>
<template #label>
<text>已阅读并同意</text>
<text class="policy_a_warp" @click="jumpUserAgreement"
>《服务协议》</text
>
<text>、</text>
<text class="policy_a_warp" @click="jumpPrivacyAgreement"
>《隐私政策》</text
>
<text>、</text>
<text class="policy_a_warp" @click="jumpProductAgreement"
>《售后保障协议》</text
>
</template>
</up-checkbox>
</view>
<up-toast ref="uToastRef"></up-toast>
</view>
</template> </template>
<script> <script>
import InputCodeComm from "@/components/code-comm/code-comm.vue"; import InputCodeComm from "@/components/code-comm/code-comm.vue";
import { SMS_TYPE } from "@/utils/enumUtils.js"; import {
import { getUserList } from "@/api/common.js"; SMS_TYPE
import { loginbysms, loginbypw, wechatLogin, alipayLogin } from "@/api/auth.js"; } from "@/utils/enumUtils.js";
import { import {
setStorageFun, getUserList
TOKEN_NAME, } from "@/api/common.js";
USER_KEY, import {
USER_DATA, loginbysms,
USER_LOGIN_TIME, loginbypw,
} from "@/utils/auth.js"; wechatLogin,
import CryptoJS from "crypto-js"; alipayLogin
} from "@/api/auth.js";
import {
setStorageFun,
TOKEN_NAME,
USER_KEY,
USER_DATA,
USER_LOGIN_TIME,
} from "@/utils/auth.js";
import CryptoJS from "crypto-js";
// #ifdef APP-PLUS // #ifdef APP-PLUS
const hyyAlipay = uni.requireNativePlugin("Hyy-Alipay"); const hyyAlipay = uni.requireNativePlugin("Hyy-Alipay");
// #endif // #endif
export default { export default {
components: { components: {
InputCodeComm, InputCodeComm,
}, },
data() { data() {
return { return {
form: { form: {
name: null, name: null,
password: null, password: null,
code: null, code: null,
}, },
inputCss: { inputCss: {
height: "80rpx", height: "80rpx",
background: "#F3F3F3FF", background: "#F3F3F3FF",
"border-radius": "30rpx", "border-radius": "30rpx",
border: "0rpx", border: "0rpx",
"padding-left": "16px", "padding-left": "16px",
}, },
loginWay: "password", loginWay: "password",
isShow: false, // 是否显示 isShow: false, // 是否显示
isPolicy: false, // 是否同意 isPolicy: false, // 是否同意
countdown: false, // 清空倒计时 countdown: false, // 清空倒计时
loading: false, loading: false,
}; };
}, },
methods: { methods: {
jumpHome() { jumpHome() {
// const sysPlatform = getCurrentSysPlatform(); // const sysPlatform = getCurrentSysPlatform();
// if(sysPlatform === "android"){ // if(sysPlatform === "android"){
// uni.switchTab({ // uni.switchTab({
// url: '/pages/message/message', // url: '/pages/message/message',
// }) // })
// }else{ // }else{
uni.switchTab({ uni.switchTab({
url: "/pages/home/home", url: "/pages/home/home",
}); });
// } // }
}, },
async loginFun(val = {}) { async loginFun(val = {}) {
const then = this; const then = this;
const form = this.form; const form = this.form;
const params = {}; const params = {};
if (!this.isPolicy) { if (!this.isPolicy) {
this.$refs.uToastRef.show({ this.$refs.uToastRef.show({
type: "error", type: "error",
message: "请阅读完相关协议以及政策,并且勾选同意选项", message: "请阅读完相关协议以及政策,并且勾选同意选项",
}); });
return; return;
} }
let response = val; let response = val;
if (this.loginWay === "password") { if (this.loginWay === "password") {
params.mobile = form.name; params.mobile = form.name;
params.password = CryptoJS.MD5(form.password).toString(); params.password = CryptoJS.MD5(form.password).toString();
response = await loginbypw(params); response = await loginbypw(params);
} }
if (this.loginWay === "code") { if (this.loginWay === "code") {
params.mobile = form.name; params.mobile = form.name;
params.smsCode = form.code; params.smsCode = form.code;
response = await loginbysms(params); response = await loginbysms(params);
} }
const data = response.data; const data = response.data;
setStorageFun(TOKEN_NAME, data.token); setStorageFun(TOKEN_NAME, data.token);
// 用于无感登录 // 用于无感登录
setStorageFun(USER_KEY, ""); setStorageFun(USER_KEY, "");
const userInfo = { const userInfo = {
avatar: data.avatarUrl, avatar: data.avatarUrl,
name: data.name, name: data.name,
userId: data.userId, userId: data.userId,
grade: data.grade, grade: data.grade,
inviteCode: data.inviteCode, inviteCode: data.inviteCode,
}; };
setStorageFun(USER_DATA, userInfo); setStorageFun(USER_DATA, userInfo);
// 当前登录得时间戳 // 当前登录得时间戳
let currentTimeStamp = new Date().getTime(); let currentTimeStamp = new Date().getTime();
setStorageFun(USER_LOGIN_TIME, currentTimeStamp); setStorageFun(USER_LOGIN_TIME, currentTimeStamp);
this.$refs.uToastRef.show({ this.$refs.uToastRef.show({
type: "success", type: "success",
message: response.msg, message: response.msg,
}); });
setTimeout(() => { setTimeout(() => {
then.jumpHome(); then.jumpHome();
}, 2000); }, 2000);
}, },
checkNameParam(val) { checkNameParam(val) {
// console.log("val",val); // console.log("val",val);
}, },
checkParam(val) { checkParam(val) {
// console.log("val",val); // console.log("val",val);
}, },
/** /**
* 获取手机验证码 * 获取手机验证码
*/ */
async getMobileCode() { async getMobileCode() {
const form = this.form; const form = this.form;
if (!form.name) { if (!form.name) {
this.$refs.uToastRef.show({ this.$refs.uToastRef.show({
type: "error", type: "error",
message: "请输入账号", message: "请输入账号",
}); });
return; return;
} }
this.countdown = true; this.countdown = true;
const params = { const params = {
mobile: form.name, mobile: form.name,
type: SMS_TYPE.LOGIN, type: SMS_TYPE.LOGIN,
}; };
const response = await getUserList(params); const response = await getUserList(params);
console.log("responseresponseresponse", response); console.log("responseresponseresponse", response);
if (response && response.bizcode === 100) { if (response && response.bizcode === 100) {
this.$refs.uToastRef.show({ this.$refs.uToastRef.show({
type: "success", type: "success",
message: response.msg, message: response.msg,
}); });
} else { } else {
this.countdown = false; this.countdown = false;
} }
}, },
jumpForgot() { jumpForgot() {
uni.navigateTo({ uni.navigateTo({
url: "/pages/rwa_package/setting/forgot-pass?type=3", url: "/pages/rwa_package/setting/forgot-pass?type=3",
}); });
}, },
jumpRegister() { jumpRegister() {
uni.navigateTo({ uni.navigateTo({
url: "/pages/login_package/register/register", url: "/pages/login_package/register/register",
}); });
}, },
// 用户协议 // 用户协议
jumpUserAgreement() { jumpUserAgreement() {
uni.navigateTo({ uni.navigateTo({
url: "/pages/mine_package/mine_user_agreement/mine_user_agreement?backPath=login", url: "/pages/mine_package/mine_user_agreement/mine_user_agreement?backPath=login",
}); });
}, },
// 隐私协议 // 隐私协议
jumpPrivacyAgreement() { jumpPrivacyAgreement() {
uni.navigateTo({ uni.navigateTo({
url: "/pages/mine_package/mine_privacy_agreement/mine_privacy_agreement?backPath=login", url: "/pages/mine_package/mine_privacy_agreement/mine_privacy_agreement?backPath=login",
}); });
}, },
// 售后保障协议 // 售后保障协议
jumpProductAgreement() { jumpProductAgreement() {
uni.navigateTo({ uni.navigateTo({
url: "/pages/mine_package/mine_product_agreement/mine_product_agreement?backPath=login", url: "/pages/mine_package/mine_product_agreement/mine_product_agreement?backPath=login",
}); });
}, },
// 微信登录 // 微信登录
async wechatOneLogin() { async wechatOneLogin() {
const then = this; const then = this;
this.loading = true; this.loading = true;
// 检查是否同意协议 // 检查是否同意协议
if (!this.isPolicy) { if (!this.isPolicy) {
this.$refs.uToastRef.show({ this.$refs.uToastRef.show({
type: "error", type: "error",
message: "请阅读完相关协议以及政策,并且勾选同意选项", message: "请阅读完相关协议以及政策,并且勾选同意选项",
}); });
this.loading = false; this.loading = false;
return; return;
} }
try { try {
// 1. 调用微信登录API // 1. 调用微信登录API
uni.login({ uni.login({
provider: "weixin", provider: "weixin",
// onlyAuthorize: true, onlyAuthorize: true,
success: async (loginRes) => { success: async (loginRes) => {
console.log("微信登录成功:", loginRes); console.log("微信登录成功:", loginRes);
// 2. 发送code到后端换取token // 2. 发送code到后端换取token
const params = { const params = {
isValid: false, isValid: false,
wechatCode: loginRes.code, token: loginRes.code,
// 可以根据需要添加其他参数 // 可以根据需要添加其他参数
}; };
console.log("微信登录接口返回-1:", params);
const response = await wechatLogin(params); const response = await wechatLogin(params);
console.log("微信登录接口返回:", response); console.log("微信登录接口返回-2:", response, response.data, response.data.token);
if (response && response.bizcode === 100) { if (response && response.bizcode === 100) {
this.loginWay = "wechat"; if (response.data.userId !== null) {
this.loginFun(response); // 登录
} else if (response.bizcode === 601) { this.loginWay = "wechat";
uni.navigateTo({ this.loginFun(response);
url: `/pages/login_package/bind-phone/bind-phone?id=${loginRes.code}`, } else {
}); // 去微信注册
} else { uni.navigateTo({
this.$refs.uToastRef.show({ url: `/pages/login_package/bind-phone/bind-phone?token=${response.data.token}&type=1`,
type: "error", });
message: response.msg || "微信登录失败", }
});
}
},
fail: (err) => {
this.loading = false;
console.error("微信登录失败:", err);
this.$refs.uToastRef.show({
type: "error",
message: "微信登录失败,请重试",
});
},
});
} catch (error) {
this.loading = false;
console.error("微信登录异常:", error);
this.$refs.uToastRef.show({
type: "error",
message: "微信登录异常,请重试",
});
}
},
// 支付宝一键登录
async alipayOneLogin() {
const then = this;
this.loading = true;
console.log("支付宝登录", hyyAlipay); } else {
this.$refs.uToastRef.show({
type: "error",
message: response.msg || "微信登录失败",
});
}
},
fail: (err) => {
this.loading = false;
console.error("微信登录失败:", err);
this.$refs.uToastRef.show({
type: "error",
message: "微信登录失败,请重试",
});
},
});
} catch (error) {
this.loading = false;
console.error("微信登录异常:", error);
this.$refs.uToastRef.show({
type: "error",
message: "微信登录异常,请重试",
});
}
},
// 支付宝一键登录
async alipayOneLogin() {
const then = this;
this.loading = true;
// 检查是否同意协议 console.log("支付宝登录", hyyAlipay);
if (!this.isPolicy) {
this.$refs.uToastRef.show({
type: "error",
message: "请阅读完相关协议以及政策,并且勾选同意选项",
});
this.loading = false;
return;
}
hyyAlipay.openAuthScheme( // 检查是否同意协议
{ if (!this.isPolicy) {
appId: "2021005183625053", // 支付宝分配给开发者的应用 ID this.$refs.uToastRef.show({
scheme: "trustbridgeapp", // manifest.json -> "App常用其他设置" -> "UrlSchemes"里设置 type: "error",
}, message: "请阅读完相关协议以及政策,并且勾选同意选项",
(res) => { });
console.log("支付宝回调", res); this.loading = false;
return;
}
alipayLogin({ hyyAlipay.openAuthScheme({
certifyId: res.auth_code, appId: "2021005183625053", // 支付宝分配给开发者的应用 ID
}).then((response) => { scheme: "trustbridgeapp", // manifest.json -> "App常用其他设置" -> "UrlSchemes"里设置
console.log("支付宝登录接口返回:", response); },
if (response && response.bizcode === 100) { (res) => {
this.loginWay = "alipay"; console.log("支付宝回调", res);
this.loginFun(response); alipayLogin({
} else { isValid: false,
this.$refs.uToastRef.show({ token: res.auth_code,
type: "error", }).then((response) => {
message: response.msg || "微信登录失败", console.log("支付宝登录接口返回:", response,response.data.userId !== null);
}); if (response && response.bizcode === 100) {
} if (response.data.userId !== null) {
}); // 登录
} this.loginWay = "alipay";
); this.loginFun(response);
}, } else {
}, // 去微信注册
}; uni.navigateTo({
url: `/pages/login_package/bind-phone/bind-phone?token=${response.data.token}&type=2`,
});
}
} else {
this.$refs.uToastRef.show({
type: "error",
message: response.msg || "微信登录失败",
});
}
});
}
);
},
},
computed: {
isIOS() {
// #ifdef APP-PLUS
return uni.getSystemInfoSync().platform === "ios";
// #endif
return false;
},
}
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.login_warp { .login_warp {
height: calc(100vh - 400rpx); height: calc(100vh - 400rpx);
padding: 150rpx 50rpx 0; padding: 150rpx 50rpx 0;
} }
.login_logo_warp { .login_logo_warp {
display: grid; display: grid;
justify-content: center; justify-content: center;
} }
.login_info { .login_info {
margin-top: 60rpx; margin-top: 60rpx;
.login_info_item { .login_info_item {
margin-bottom: 40rpx; margin-bottom: 40rpx;
} }
.code_msg { .code_msg {
font-size: 36rpx; font-size: 36rpx;
color: $app-bt-bj; color: $app-bt-bj;
} }
} }
.login_comm_but { .login_comm_but {
background: #cccccc; background: #cccccc;
border-radius: 20rpx; border-radius: 20rpx;
width: 100%; width: 100%;
text-align: center; text-align: center;
font-weight: 500; font-weight: 500;
font-size: 32rpx; font-size: 32rpx;
color: #999999; color: #999999;
padding: 28rpx 0; padding: 28rpx 0;
display: flex; display: flex;
justify-content: center; justify-content: center;
} }
.login_comm_but_yes { .login_comm_but_yes {
background: $app-bt-bj; background: $app-bt-bj;
color: #ffffff; color: #ffffff;
} }
.cut_way_warp { .cut_way_warp {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
font-weight: 500; font-weight: 500;
font-size: 28rpx; font-size: 28rpx;
color: #999999; color: #999999;
margin-top: 20rpx; margin-top: 20rpx;
} }
.other_login {
font-size: 28rpx; .other_login {
text-align: center; font-size: 28rpx;
margin-top: 80rpx; text-align: center;
margin-bottom: 32rpx; margin-top: 80rpx;
color: #999999; margin-bottom: 32rpx;
} color: #999999;
.login_other_icon { }
display: flex;
padding: 0 100rpx; .login_other_icon {
justify-content: center; display: flex;
.login_other_item { padding: 0 100rpx;
display: flex; justify-content: center;
flex: 50%;
font-size: 28rpx; .login_other_item {
flex-direction: column; display: flex;
align-items: center; flex: 50%;
margin-bottom: 80rpx; font-size: 28rpx;
} flex-direction: column;
} align-items: center;
</style> margin-bottom: 80rpx;
}
}
</style>
+2 -1
View File
@@ -23,7 +23,8 @@ export const SMS_TYPE = {
"PASSWD": "passwd", "PASSWD": "passwd",
"LOGIN": "login", "LOGIN": "login",
"REGISTER": "register", "REGISTER": "register",
"WECHAT": "wechatValid" "WECHAT": "wechatValid",
"ALIPAY": "alipayValid"
} }
// 图片类型 图片分类:COMMON-公共,CATEGORY-商品类目图标,BRAND-品牌LOGO,SHOP-店铺LOGO,GOODS-商品图片,SPECS-商品规格图片 // 图片类型 图片分类:COMMON-公共,CATEGORY-商品类目图标,BRAND-品牌LOGO,SHOP-店铺LOGO,GOODS-商品图片,SPECS-商品规格图片
+3 -2
View File
@@ -45,7 +45,8 @@ function request(options) {
...defaultHeaders, ...defaultHeaders,
...headers, // 使用展开运算符合并默认头和自定义头 ...headers, // 使用展开运算符合并默认头和自定义头
}, },
success: (res) => { success: (res) => {
console.log('--success-',res)
if (isShowLoading) { if (isShowLoading) {
// 请求之前做一些事 // 请求之前做一些事
uni.hideToast(); uni.hideToast();
@@ -65,7 +66,7 @@ function request(options) {
return; return;
} }
// 601 微信登录没注册 // 601 微信登录没注册
if (data.bizcode === 100 || data.bizcode === 601) { if (data.bizcode === 100 ) {
resolve(data); // 成功时返回数据 resolve(data); // 成功时返回数据
} else if (data.bizcode === 201) { } else if (data.bizcode === 201) {
if ([201, 200].includes(data.errcode)) { if ([201, 200].includes(data.errcode)) {