feat:apple登录

This commit is contained in:
2026-08-17 17:13:40 +08:00
parent 718bd079a6
commit 619c0cacc5
6 changed files with 850 additions and 857 deletions
+32 -68
View File
@@ -2,13 +2,7 @@
<view class="register_warp">
<view class="header_">
<view style="margin-top: 10rpx">
<up-image
src="/static/common/left.png"
width="18"
height="20"
bgColor="#f1f6ff00"
@click="jumpMine"
/>
<up-image src="/static/common/left.png" width="18" height="20" bgColor="#f1f6ff00" @click="jumpMine" />
</view>
<view class="title_">绑定手机号</view>
<view></view>
@@ -16,79 +10,48 @@
<view class="register_ifo_warp">
<view class="register_info_item">
<up-input
placeholder="请输入手机号"
border="surround"
v-model="form.mobile"
:customStyle="inputCss"
></up-input>
<up-input placeholder="请输入手机号" border="surround" v-model="form.mobile" :customStyle="inputCss"></up-input>
</view>
<view class="register_info_item">
<up-input
placeholder="请输入验证码"
border="surround"
v-model="form.smsCode"
:customStyle="inputCss"
>
<up-input placeholder="请输入验证码" border="surround" v-model="form.smsCode" :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>
<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">
获取验证码
<qiaobao-assistant page-key="pages/login_package/bind-phone/bind-phone" title="账户登录" />
</view>
<qiaobao-assistant page-key="pages/login_package/bind-phone/bind-phone" title="账户登录" />
</view>
</template>
</up-input>
</view>
</view>
<view
class="login_comm_but login_comm_but_yes"
@click="submit"
:loading="butLoading"
>
<view class="login_comm_but login_comm_but_yes" @click="submit" :loading="butLoading">
登录
</view>
<view class="policy_warp">
<up-checkbox
name="isCheck"
usedAlone
v-model:checked="isPolicy"
shape="circle"
activeColor="#7934F6"
size="19"
iconSize="18"
>
<view class="policy_warp">
<up-checkbox name="isCheck" usedAlone v-model:checked="isPolicy" shape="circle" activeColor="#7934F6" size="19"
iconSize="18">
<template #label>
<text @click="aa">已阅读并同意</text>
<text class="policy_a_warp" @click="jumpUserAgreement"
>《服务协议》</text
>
<text class="policy_a_warp" @click="jumpUserAgreement">《服务协议》</text>
<text>、</text>
<text class="policy_a_warp" @click="jumpPrivacyAgreement"
>《隐私政策》</text
>
<text class="policy_a_warp" @click="jumpPrivacyAgreement">《隐私政策》</text>
<text>、</text>
<text class="policy_a_warp" @click="jumpProductAgreement"
>《售后保障协议》</text
>
<text class="policy_a_warp" @click="jumpProductAgreement">《售后保障协议》</text>
</template>
</up-checkbox>
</view>
<up-toast ref="uToastRef"></up-toast>
<u-modal :show="tipsShow" title="提示" showCancelButton @cancel="onCancel" @confirm="onConfirm">
<u-modal :show="tipsShow" title="提示" showCancelButton @cancel="onCancel" @confirm="onConfirm">
<view class="slot-content">
我已阅读并同意
<text style="color: #007AFF;">用户协议</text>和<text style="color: #007AFF;">隐私政策</text>
</view>
我已阅读并同意
<text style="color: #007AFF;">用户协议</text>和<text style="color: #007AFF;">隐私政策</text>
</view>
</u-modal>
</view>
</template>
@@ -96,7 +59,7 @@
<script>
import { SMS_TYPE } from "@/utils/enumUtils.js";
import { getUserList } from "@/api/common.js";
import { wechatLogin, alipayLogin } from "@/api/auth.js";
import { wechatLogin, alipayLogin, appleLogin } from "@/api/auth.js";
import {
setStorageFun,
TOKEN_NAME,
@@ -123,7 +86,7 @@ export default {
countdown: false, // 清空倒计时
butLoading: false,
disabled: false,
type: 1, //1.微信 2.支付宝
type: 1, //1.微信 2.支付宝,3.apple
tipsShow: false,
content: '确认绑定手机号吗?',
isPolicy: false,
@@ -136,25 +99,25 @@ export default {
console.log("-----1", option, this.form.token, this.type);
},
methods: {
submit(){
if(!this.isPolicy){
submit() {
if (!this.isPolicy) {
this.tipsShow = true;
}
},
onCancel(){
this.tipsShow = false;
},
onConfirm(){
this.tipsShow = false;
onCancel() {
this.tipsShow = false;
},
onConfirm() {
this.tipsShow = false;
this.isPolicy = true;
this.registerFun();
},
},
jumpMine() {
uni.reLaunch({
url: "/pages/login_package/login/login",
});
},
// 用户协议
// 用户协议
jumpUserAgreement() {
uni.navigateTo({
url: "/pages/mine_package/mine_user_agreement/mine_user_agreement?backPath=login",
@@ -166,7 +129,7 @@ export default {
url: "/pages/mine_package/mine_privacy_agreement/mine_privacy_agreement?backPath=login",
});
},
// 售后保障协议
// 售后保障协议
jumpProductAgreement() {
uni.navigateTo({
url: "/pages/mine_package/mine_product_agreement/mine_product_agreement?backPath=login",
@@ -197,7 +160,7 @@ export default {
token: form.token,
};
const response =
this.type == 1 ? await wechatLogin(params) : await alipayLogin(params);
this.type == 1 ? await wechatLogin(params) : this.type == 2 ? await alipayLogin(params) : await appleLogin(params);
console.log("微信登录接口返回:", params, response);
if (response && response.bizcode === 100) {
const data = response.data;
@@ -257,7 +220,7 @@ export default {
const params = {
mobile: form.mobile,
type: this.type == 1 ? SMS_TYPE.WECHAT : SMS_TYPE.ALIPAY,
type: this.type == 1 ? SMS_TYPE.WECHAT : this.type == 2 ? SMS_TYPE.ALIPAY : SMS_TYPE.APPLE,
};
const response = await getUserList(params);
if (response && response.bizcode === 100) {
@@ -278,6 +241,7 @@ export default {
display: flex;
align-items: center;
padding: calc(24rpx + env(safe-area-inset-bottom)) 30rpx 0 30rpx;
.title_ {
font-weight: bold;
font-size: 36rpx;