|
|
@@ -1,32 +1,38 @@
|
|
|
<template>
|
|
|
- <cwg-popup :title="props.pwdType == 1 ? t('vu.item3') : t('vu.item4')" :visible="props.visible" :showFooters="false"
|
|
|
+ <cwg-popup :title="pwdTitle" :visible="props.visible" :showFooters="false"
|
|
|
@update:visible="$emit('update:visible', $event)">
|
|
|
<view class="popup-content">
|
|
|
<text class="account-number">{{ accountLabel }} {{ account.login }}</text>
|
|
|
|
|
|
- <uni-forms :model="passwordInfo" labelWidth="200" label-position="top" class="crm-form">
|
|
|
- <uni-forms-item
|
|
|
- :label="props.pwdType == 1 ? t('Custom.Settings.LoginPwdOld') : t('Custom.Settings.InvestorPwdOld')">
|
|
|
- <uni-easyinput type="password" :clearable="false" v-model="passwordInfo.oldPassword"
|
|
|
- :placeholder="props.pwdType == 1 ? t('Custom.Settings.LoginPwdOld') : t('Custom.Settings.InvestorPwdOld')" />
|
|
|
- </uni-forms-item>
|
|
|
- <uni-forms-item :label="t('Custom.Settings.NewPwd')">
|
|
|
- <uni-easyinput type="password" :clearable="false" v-model="passwordInfo.newPassword"
|
|
|
- :placeholder="t('Custom.Settings.NewPwd')" />
|
|
|
- </uni-forms-item>
|
|
|
- </uni-forms>
|
|
|
-
|
|
|
- <view class="notice-list">
|
|
|
- <view v-for="(item, index) in noticeItems" :key="index"
|
|
|
- :class="['notice-item', item.valid ? 'isOK' : '']">
|
|
|
- {{ item.label }}
|
|
|
+ <template v-if="props.pwdType != 3">
|
|
|
+ <uni-forms :model="passwordInfo" labelWidth="200" label-position="top" class="crm-form">
|
|
|
+ <uni-forms-item
|
|
|
+ :label="props.pwdType == 1 ? t('Custom.Settings.LoginPwdOld') : t('Custom.Settings.InvestorPwdOld')">
|
|
|
+ <uni-easyinput type="password" :clearable="false" v-model="passwordInfo.oldPassword"
|
|
|
+ :placeholder="props.pwdType == 1 ? t('Custom.Settings.LoginPwdOld') : t('Custom.Settings.InvestorPwdOld')" />
|
|
|
+ </uni-forms-item>
|
|
|
+ <uni-forms-item :label="t('Custom.Settings.NewPwd')">
|
|
|
+ <uni-easyinput type="password" :clearable="false" v-model="passwordInfo.newPassword"
|
|
|
+ :placeholder="t('Custom.Settings.NewPwd')" />
|
|
|
+ </uni-forms-item>
|
|
|
+ </uni-forms>
|
|
|
+
|
|
|
+ <view class="notice-list">
|
|
|
+ <view v-for="(item, index) in noticeItems" :key="index"
|
|
|
+ :class="['notice-item', item.valid ? 'isOK' : '']">
|
|
|
+ {{ item.label }}
|
|
|
+ </view>
|
|
|
</view>
|
|
|
- </view>
|
|
|
+ </template>
|
|
|
|
|
|
<view class="save-btn">
|
|
|
- <view class="btn primary" @click="save" v-t="'Btn.Save'" />
|
|
|
+ <view v-if="props.pwdType != 3" class="btn btn-secondary btn-shadow waves-effect" @click="save"
|
|
|
+ v-t="'Btn.Save'" />
|
|
|
+ <view v-else class="btn btn-secondary btn-shadow waves-effect" @click="resetPwd"
|
|
|
+ v-t="'Btn.ResetPassword'" />
|
|
|
</view>
|
|
|
</view>
|
|
|
+ <cwg-confirm-popup />
|
|
|
</cwg-popup>
|
|
|
</template>
|
|
|
|
|
|
@@ -35,7 +41,8 @@ import { ref, computed, watch } from 'vue'
|
|
|
import { customApi } from '@/service/custom';
|
|
|
import { useI18n } from 'vue-i18n'
|
|
|
import { showToast } from "@/utils/toast";
|
|
|
-
|
|
|
+import { useConfirm } from '@/hooks/useConfirm'
|
|
|
+const confirm = useConfirm()
|
|
|
const { t } = useI18n()
|
|
|
|
|
|
const props = defineProps({
|
|
|
@@ -52,7 +59,16 @@ const passwordInfo = ref({
|
|
|
oldPassword: '',
|
|
|
newPassword: ''
|
|
|
});
|
|
|
-
|
|
|
+const pwdTitle = computed(() => {
|
|
|
+ switch (props.pwdType) {
|
|
|
+ case 1:
|
|
|
+ return t('vu.item3')
|
|
|
+ case 2:
|
|
|
+ return t('vu.item4')
|
|
|
+ case 3:
|
|
|
+ return t('Custom.Settings.TitReset')
|
|
|
+ }
|
|
|
+})
|
|
|
const rule1 = computed(() => {
|
|
|
if (!passwordInfo.value.newPassword) return false;
|
|
|
return /^.{8,16}$/.test(passwordInfo.value.newPassword);
|
|
|
@@ -111,16 +127,65 @@ const save = async () => {
|
|
|
}
|
|
|
|
|
|
if (res.code == 200) {
|
|
|
- showToast(t('Msg.Success'));
|
|
|
+ await confirm({
|
|
|
+ title: t('Msg.SystemPrompt'),
|
|
|
+ content: t('ApplicationDialog.Des1'),
|
|
|
+ confirmText: t('Btn.Confirm'),
|
|
|
+ cancelText: t('Btn.Cancel')
|
|
|
+ })
|
|
|
emit('update:visible', false);
|
|
|
passwordInfo.value = {
|
|
|
oldPassword: '',
|
|
|
newPassword: ''
|
|
|
}
|
|
|
emit('save');
|
|
|
+ } else {
|
|
|
+ await confirm({
|
|
|
+ title: t('Msg.SystemPrompt'),
|
|
|
+ content: res.msg,
|
|
|
+ confirmText: t('Btn.Confirm'),
|
|
|
+ cancelText: t('Btn.Cancel')
|
|
|
+ })
|
|
|
+ emit('update:visible', false);
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ showToast(error.msg);
|
|
|
+ emit('update:visible', false);
|
|
|
+ } finally {
|
|
|
+ flag.value = false;
|
|
|
+ }
|
|
|
+}
|
|
|
+// 重置交易账号密码
|
|
|
+const resetPwd = async () => {
|
|
|
+ try {
|
|
|
+ if (flag.value) {
|
|
|
+ return
|
|
|
+ } else {
|
|
|
+ flag.value = true;
|
|
|
+ }
|
|
|
|
|
|
+ let res = await customApi.ResetDealPasswordEmail({
|
|
|
+ login: props.account.login
|
|
|
+ });
|
|
|
+ if (res.code == 200) {
|
|
|
+ flag.value = false;
|
|
|
+ await confirm({
|
|
|
+ title: t('Msg.SystemPrompt'),
|
|
|
+ content: t('ApplicationDialog.Des1'),
|
|
|
+ confirmText: t('Btn.Confirm'),
|
|
|
+ cancelText: t('Btn.Cancel')
|
|
|
+ })
|
|
|
+ emit('update:visible', false);
|
|
|
} else {
|
|
|
- showToast(res.msg);
|
|
|
+ flag.value = false;
|
|
|
+ await confirm({
|
|
|
+ title: t('Msg.SystemPrompt'),
|
|
|
+ content: res.msg,
|
|
|
+ confirmText: t('Btn.Confirm'),
|
|
|
+ cancelText: t('Btn.Cancel')
|
|
|
+ })
|
|
|
+ // showToast(res.msg);
|
|
|
+ emit('update:visible', false);
|
|
|
}
|
|
|
} catch (error) {
|
|
|
showToast(error.msg);
|
|
|
@@ -202,35 +267,35 @@ watch(() => props.visible, (newVal) => {
|
|
|
justify-content: flex-end;
|
|
|
margin-top: px2rpx(20);
|
|
|
|
|
|
- .btn {
|
|
|
- border: 1px solid rgba(108, 133, 149, 0);
|
|
|
- border-radius: px2rpx(8);
|
|
|
- padding: px2rpx(8) px2rpx(20);
|
|
|
- font-size: px2rpx(14);
|
|
|
- color: rgba(var(--bs-dark-rgb), var(--bs-text-opacity)) !important;
|
|
|
- display: inline-flex;
|
|
|
- align-items: center;
|
|
|
- justify-content: center;
|
|
|
- gap: px2rpx(8);
|
|
|
- cursor: pointer;
|
|
|
- transition: all 0.2s;
|
|
|
- height: px2rpx(40);
|
|
|
- box-sizing: border-box;
|
|
|
- background-color: rgba(108, 133, 149, 0.08);
|
|
|
-
|
|
|
- &.primary {
|
|
|
- background-color: #cf1322;
|
|
|
- ;
|
|
|
- color: var(--bs-emphasis-color);
|
|
|
-
|
|
|
- &:hover {
|
|
|
- background-color: var(--color-navy-600);
|
|
|
- }
|
|
|
-
|
|
|
- &[disabled] {
|
|
|
- cursor: not-allowed;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ // .btn {
|
|
|
+ // border: 1px solid rgba(108, 133, 149, 0);
|
|
|
+ // border-radius: px2rpx(8);
|
|
|
+ // padding: px2rpx(8) px2rpx(20);
|
|
|
+ // font-size: px2rpx(14);
|
|
|
+ // color: rgba(var(--bs-dark-rgb), var(--bs-text-opacity)) !important;
|
|
|
+ // display: inline-flex;
|
|
|
+ // align-items: center;
|
|
|
+ // justify-content: center;
|
|
|
+ // gap: px2rpx(8);
|
|
|
+ // cursor: pointer;
|
|
|
+ // transition: all 0.2s;
|
|
|
+ // height: px2rpx(40);
|
|
|
+ // box-sizing: border-box;
|
|
|
+ // background-color: rgba(108, 133, 149, 0.08);
|
|
|
+
|
|
|
+ // &.primary {
|
|
|
+ // background-color: #cf1322;
|
|
|
+ // ;
|
|
|
+ // color: var(--bs-emphasis-color);
|
|
|
+
|
|
|
+ // &:hover {
|
|
|
+ // background-color: var(--color-navy-600);
|
|
|
+ // }
|
|
|
+
|
|
|
+ // &[disabled] {
|
|
|
+ // cursor: not-allowed;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
}
|
|
|
</style>
|