mirror of
https://gitee.com/liuxioabin/fengketrade.git
synced 2026-04-17 21:03:17 +08:00
'样式调整功能去除'
This commit is contained in:
parent
e636a50c4a
commit
03ef33c8af
@ -197,22 +197,13 @@
|
|||||||
uni.removeStorageSync('userInfo');
|
uni.removeStorageSync('userInfo');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 显示loading
|
// 调用建行登录API(静默登录,不显示loading)
|
||||||
const loadingTitle = isParamChanged ? '切换用户中...' : '建行登录中...';
|
|
||||||
uni.showLoading({
|
|
||||||
title: loadingTitle,
|
|
||||||
mask: true,
|
|
||||||
});
|
|
||||||
|
|
||||||
// 调用建行登录API
|
|
||||||
const result = await sheep.$api.third.ccbLogin({
|
const result = await sheep.$api.third.ccbLogin({
|
||||||
ccbParamSJ: ccbParamSJ,
|
ccbParamSJ: ccbParamSJ,
|
||||||
cityid: cityid || '360100',
|
cityid: cityid || '360100',
|
||||||
CITYID: cityid || '360100',
|
CITYID: cityid || '360100',
|
||||||
});
|
});
|
||||||
|
|
||||||
uni.hideLoading();
|
|
||||||
|
|
||||||
if (result.code === 1) {
|
if (result.code === 1) {
|
||||||
console.log('[CCB] 登录成功');
|
console.log('[CCB] 登录成功');
|
||||||
|
|
||||||
@ -239,13 +230,6 @@
|
|||||||
// 注意:不使用await,让它在后台加载,不阻塞UI
|
// 注意:不使用await,让它在后台加载,不阻塞UI
|
||||||
userStore.setToken(result.data.token);
|
userStore.setToken(result.data.token);
|
||||||
|
|
||||||
// 显示欢迎提示
|
|
||||||
uni.showToast({
|
|
||||||
title: `登录成功`,
|
|
||||||
icon: 'success',
|
|
||||||
duration: 2000,
|
|
||||||
});
|
|
||||||
|
|
||||||
// 清除URL中的敏感参数
|
// 清除URL中的敏感参数
|
||||||
const cleanUrl = window.location.origin + '/pages/index/index';
|
const cleanUrl = window.location.origin + '/pages/index/index';
|
||||||
window.history.replaceState({}, '', cleanUrl);
|
window.history.replaceState({}, '', cleanUrl);
|
||||||
@ -254,17 +238,10 @@
|
|||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('[CCB] 登录失败:', error.message || error.msg);
|
console.error('[CCB] 登录失败:', error.message || error.msg);
|
||||||
uni.hideLoading();
|
|
||||||
|
|
||||||
uni.showModal({
|
// 静默失败,清除URL参数
|
||||||
title: isParamChanged ? '切换用户失败' : '登录失败',
|
const cleanUrl = window.location.origin + '/pages/index/index';
|
||||||
content: error.message || error.msg || '请检查网络连接',
|
window.history.replaceState({}, '', cleanUrl);
|
||||||
showCancel: false,
|
|
||||||
complete: () => {
|
|
||||||
const cleanUrl = window.location.origin + '/pages/index/index';
|
|
||||||
window.history.replaceState({}, '', cleanUrl);
|
|
||||||
},
|
|
||||||
});
|
|
||||||
} finally {
|
} finally {
|
||||||
isLoggingIn = false;
|
isLoggingIn = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -82,53 +82,6 @@
|
|||||||
</radio-group>
|
</radio-group>
|
||||||
</view>
|
</view>
|
||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
|
|
||||||
<uni-forms-item name="mobile" label="手机号" @tap="onChangeMobile">
|
|
||||||
<uni-easyinput
|
|
||||||
v-model="userInfo.mobile"
|
|
||||||
placeholder="请绑定手机号"
|
|
||||||
:inputBorder="false"
|
|
||||||
disabled
|
|
||||||
:styles="{ disableColor: '#fff' }"
|
|
||||||
placeholderStyle="color:#BBBBBB;font-size:28rpx;line-height:normal"
|
|
||||||
:clearable="false"
|
|
||||||
>
|
|
||||||
<template v-slot:right>
|
|
||||||
<view class="ss-flex ss-col-center">
|
|
||||||
<su-radio v-if="userInfo.verification?.mobile" :modelValue="true" />
|
|
||||||
<button v-else class="ss-reset-button ss-flex ss-col-center ss-row-center">
|
|
||||||
<text class="_icon-forward" style="color: #bbbbbb; font-size: 26rpx"></text>
|
|
||||||
</button>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
</uni-easyinput>
|
|
||||||
</uni-forms-item>
|
|
||||||
|
|
||||||
<uni-forms-item name="password" label="登录密码" @tap="onSetPassword">
|
|
||||||
<uni-easyinput
|
|
||||||
v-model="userInfo.password"
|
|
||||||
:placeholder="userInfo.verification?.password ? '修改登录密码' : '点击设置登录密码'"
|
|
||||||
:inputBorder="false"
|
|
||||||
:styles="{ disableColor: '#fff' }"
|
|
||||||
disabled
|
|
||||||
placeholderStyle="color:#BBBBBB;font-size:28rpx;line-height:normal"
|
|
||||||
:clearable="false"
|
|
||||||
>
|
|
||||||
<template v-slot:right>
|
|
||||||
<view class="ss-flex ss-col-center">
|
|
||||||
<su-radio
|
|
||||||
class="ss-flex"
|
|
||||||
v-if="userInfo.verification?.password"
|
|
||||||
:modelValue="true"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<button v-else class="ss-reset-button ss-flex ss-col-center ss-row-center">
|
|
||||||
<text class="_icon-forward" style="color: #bbbbbb; font-size: 26rpx"></text>
|
|
||||||
</button>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
</uni-easyinput>
|
|
||||||
</uni-forms-item>
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="bg-white ss-m-t-14">
|
<view class="bg-white ss-m-t-14">
|
||||||
@ -153,59 +106,6 @@
|
|||||||
</view>
|
</view>
|
||||||
</uni-forms>
|
</uni-forms>
|
||||||
|
|
||||||
<view v-if="sheep.$platform.name !== 'H5'">
|
|
||||||
<view class="title-box ss-p-l-30">第三方账号绑定</view>
|
|
||||||
|
|
||||||
<view class="account-list ss-flex ss-row-between">
|
|
||||||
<view v-if="'WechatOfficialAccount' === sheep.$platform.name" class="ss-flex ss-col-center">
|
|
||||||
<image
|
|
||||||
class="list-img"
|
|
||||||
:src="
|
|
||||||
sheep.$url.static(
|
|
||||||
'/assets/addons/shopro/uniapp/platform/WechatOfficialAccount.png',
|
|
||||||
)
|
|
||||||
"
|
|
||||||
/>
|
|
||||||
<text class="list-name">微信公众号</text>
|
|
||||||
</view>
|
|
||||||
<view v-if="'WechatMiniProgram' === sheep.$platform.name" class="ss-flex ss-col-center">
|
|
||||||
<image
|
|
||||||
class="list-img"
|
|
||||||
:src="
|
|
||||||
sheep.$url.static('/assets/addons/shopro/uniapp/platform/WechatMiniProgram.png')
|
|
||||||
"
|
|
||||||
/>
|
|
||||||
<text class="list-name">微信小程序</text>
|
|
||||||
</view>
|
|
||||||
<view v-if="'App' === sheep.$platform.name" class="ss-flex ss-col-center">
|
|
||||||
<image
|
|
||||||
class="list-img"
|
|
||||||
:src="sheep.$url.static('/assets/addons/shopro/uniapp/platform/wechat.png')"
|
|
||||||
/>
|
|
||||||
<text class="list-name">微信开放平台</text>
|
|
||||||
</view>
|
|
||||||
<view class="ss-flex ss-col-center">
|
|
||||||
<view class="info ss-flex ss-col-center" v-if="state.thirdOauthInfo">
|
|
||||||
<image
|
|
||||||
class="avatar ss-m-r-20"
|
|
||||||
:src="sheep.$url.cdn(state.thirdOauthInfo.avatar)"
|
|
||||||
></image>
|
|
||||||
<text class="name">{{ state.thirdOauthInfo.nickname }}</text>
|
|
||||||
</view>
|
|
||||||
<view class="bind-box ss-m-l-20">
|
|
||||||
<button
|
|
||||||
v-if="state.thirdOauthInfo"
|
|
||||||
class="ss-reset-button relieve-btn"
|
|
||||||
@tap="unBindThirdOauth"
|
|
||||||
>
|
|
||||||
解绑
|
|
||||||
</button>
|
|
||||||
<button v-else class="ss-reset-button bind-btn" @tap="bindThirdOauth">绑定</button>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<su-fixed bottom placeholder bg="none">
|
<su-fixed bottom placeholder bg="none">
|
||||||
<view class="footer-box ss-p-20">
|
<view class="footer-box ss-p-20">
|
||||||
<button class="ss-rest-button logout-btn ui-Shadow-Main" @tap="onSubmit">保存</button>
|
<button class="ss-rest-button logout-btn ui-Shadow-Main" @tap="onSubmit">保存</button>
|
||||||
@ -215,8 +115,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed, ref, reactive, onBeforeMount, unref } from 'vue';
|
import { computed, reactive, onBeforeMount } from 'vue';
|
||||||
import { mobile, password, username } from '@/sheep/validate/form';
|
|
||||||
import sheep from '@/sheep';
|
import sheep from '@/sheep';
|
||||||
import { clone } from 'lodash';
|
import { clone } from 'lodash';
|
||||||
import { showAuthModal } from '@/sheep/hooks/useModal';
|
import { showAuthModal } from '@/sheep/hooks/useModal';
|
||||||
@ -224,7 +123,6 @@ import { showAuthModal } from '@/sheep/hooks/useModal';
|
|||||||
const state = reactive({
|
const state = reactive({
|
||||||
model: {},
|
model: {},
|
||||||
rules: {},
|
rules: {},
|
||||||
thirdOauthInfo: null,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@ -254,11 +152,6 @@ const onChangeUsername = () => {
|
|||||||
!state.model.verification?.username && showAuthModal('changeUsername');
|
!state.model.verification?.username && showAuthModal('changeUsername');
|
||||||
};
|
};
|
||||||
|
|
||||||
// 修改手机号
|
|
||||||
const onChangeMobile = () => {
|
|
||||||
showAuthModal('changeMobile');
|
|
||||||
};
|
|
||||||
|
|
||||||
function onChooseAvatar(e) {
|
function onChooseAvatar(e) {
|
||||||
const tempUrl = e.detail.avatarUrl || '';
|
const tempUrl = e.detail.avatarUrl || '';
|
||||||
uploadAvatar(tempUrl);
|
uploadAvatar(tempUrl);
|
||||||
@ -280,41 +173,6 @@ async function uploadAvatar(tempUrl) {
|
|||||||
state.model.avatar = url;
|
state.model.avatar = url;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改/设置密码
|
|
||||||
function onSetPassword() {
|
|
||||||
if (state.model.verification.password) {
|
|
||||||
showAuthModal('changePassword');
|
|
||||||
} else {
|
|
||||||
showAuthModal('resetPassword');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 绑定第三方账号
|
|
||||||
async function bindThirdOauth() {
|
|
||||||
let result = await sheep.$platform.useProvider('wechat').bind();
|
|
||||||
if (result) {
|
|
||||||
getUserInfo();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 解绑第三方账号
|
|
||||||
function unBindThirdOauth() {
|
|
||||||
uni.showModal({
|
|
||||||
title: '解绑提醒',
|
|
||||||
content: '解绑后您将无法通过微信登录此账号',
|
|
||||||
cancelText: '再想想',
|
|
||||||
confirmText: '确定',
|
|
||||||
success: async function (res) {
|
|
||||||
if (res.confirm) {
|
|
||||||
const result = await sheep.$platform.useProvider('wechat').unbind();
|
|
||||||
if (result) {
|
|
||||||
getUserInfo();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// 保存信息
|
// 保存信息
|
||||||
async function onSubmit() {
|
async function onSubmit() {
|
||||||
const { code, data } = await sheep.$api.user.update({
|
const { code, data } = await sheep.$api.user.update({
|
||||||
@ -330,13 +188,6 @@ async function onSubmit() {
|
|||||||
const getUserInfo = async () => {
|
const getUserInfo = async () => {
|
||||||
const userInfo = await sheep.$store('user').getInfo();
|
const userInfo = await sheep.$store('user').getInfo();
|
||||||
state.model = clone(userInfo);
|
state.model = clone(userInfo);
|
||||||
|
|
||||||
if (sheep.$platform.name !== 'H5') {
|
|
||||||
let { data, code } = await sheep.$api.user.thirdOauthInfo();
|
|
||||||
if (code === 1) {
|
|
||||||
state.thirdOauthInfo = data;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
onBeforeMount(async () => {
|
onBeforeMount(async () => {
|
||||||
@ -436,64 +287,6 @@ onBeforeMount(async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 绑定项
|
|
||||||
.account-list {
|
|
||||||
background-color: $white;
|
|
||||||
height: 100rpx;
|
|
||||||
padding: 0 20rpx;
|
|
||||||
|
|
||||||
.list-img {
|
|
||||||
width: 40rpx;
|
|
||||||
height: 40rpx;
|
|
||||||
margin-right: 10rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.list-name {
|
|
||||||
font-size: 28rpx;
|
|
||||||
color: #333333;
|
|
||||||
}
|
|
||||||
|
|
||||||
.info {
|
|
||||||
.avatar {
|
|
||||||
width: 38rpx;
|
|
||||||
height: 38rpx;
|
|
||||||
border-radius: 50%;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.name {
|
|
||||||
font-size: 28rpx;
|
|
||||||
font-weight: 400;
|
|
||||||
color: $dark-9;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.bind-box {
|
|
||||||
width: 100rpx;
|
|
||||||
height: 50rpx;
|
|
||||||
line-height: normal;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
font-size: 24rpx;
|
|
||||||
|
|
||||||
.bind-btn {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
border-radius: 25rpx;
|
|
||||||
background: #f4f4f4;
|
|
||||||
color: #999999;
|
|
||||||
}
|
|
||||||
.relieve-btn {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
border-radius: 25rpx;
|
|
||||||
background: var(--ui-BG-Main-opacity-1);
|
|
||||||
color: var(--ui-BG-Main);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.list-border {
|
.list-border {
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
|
|||||||
@ -22,9 +22,9 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="right-box ss-m-r-52">
|
<view class="right-box ss-m-r-52">
|
||||||
<button class="ss-reset-button" @tap="showShareModal">
|
<!-- <button class="ss-reset-button" @tap="showShareModal">
|
||||||
<text class="sicon-qrcode"></text>
|
<text class="sicon-qrcode"></text>
|
||||||
</button>
|
</button> -->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user