From 41a42b11339917a10388475d9fd09db01ec5df5e Mon Sep 17 00:00:00 2001 From: zhangyahui Date: Tue, 16 Dec 2025 17:32:33 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=95=99=E8=82=B2=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=91=98=E6=93=8D=E4=BD=9C=E8=AE=A2=E9=98=85=E8=AE=A1=E5=88=92?= =?UTF-8?q?&=20=E5=88=B7=E6=96=B0=E9=A1=B5=E9=9D=A2=E4=BF=9D=E6=8C=81?= =?UTF-8?q?=E5=BD=93=E5=89=8D=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Administrator/SE/allUser/addAllUser.vue | 47 +- .../Administrator/SE/allUser/index.vue | 1269 +++++++++-------- .../Administrator/subscriptionPlan.vue | 81 +- src/lang/cn.ts | 17 +- src/lang/en.ts | 17 +- src/store/userHabit/userHabit.ts | 6 + src/tool/https.js | 698 ++++----- src/views/Administrator.vue | 14 +- 8 files changed, 1208 insertions(+), 941 deletions(-) diff --git a/src/component/Administrator/SE/allUser/addAllUser.vue b/src/component/Administrator/SE/allUser/addAllUser.vue index a0357ed6..8f65d043 100644 --- a/src/component/Administrator/SE/allUser/addAllUser.vue +++ b/src/component/Administrator/SE/allUser/addAllUser.vue @@ -86,6 +86,16 @@ style="width: 250px" /> +
+ {{ $t('admin.SubscribePlan') }}: * + +
{{ $t('admin.Close') }}
@@ -114,9 +124,16 @@ import md5 from "md5"; import { useI18n } from 'vue-i18n' export default defineComponent({ components: {}, + props: { + planOptions: { + type: Array, + default: () => [] + } + }, emits: ["searchHistoryList"], setup(props, { emit }) { const {t} = useI18n() + const { planOptions } = toRefs(props) let operations = reactive({ operationsModal: false, operationsEdit: false, @@ -130,6 +147,8 @@ export default defineComponent({ password: "", oldPassword: "", credits: "", + subscriptionPlanId: "", + oldSubscriptionPlanId: "" }); let state = ref([ { @@ -163,12 +182,18 @@ export default defineComponent({ // operationsData.validStartTime='2024-08-05T00:00:06' // operationsData.validEndTime='2024-08-05T00:00:06' operationsData.credits = data.creditsUsageLimit; + operationsData.subscriptionPlanId = data.subscriptionPlanId || ""; + operationsData.oldSubscriptionPlanId = data.subscriptionPlanId || ""; // operationsData.accountId = data.accountId // operationsData.userName = data.userName // operationsData.userEmail = data.userEmail // operationsData.validStartTime = formatTime(data.validStartTime) // operationsData.validEndTime = formatTime(data.validEndTime) } + if (funStr.value == "Add") { + operationsData.subscriptionPlanId = ""; + operationsData.oldSubscriptionPlanId = ""; + } }; let focus = (event) => { if (operationsData.password == operationsData.oldPassword) { @@ -187,6 +212,7 @@ export default defineComponent({ userEmail: operationsData.userEmail, userPassword: operationsData.password?md5(operationsData.password + "abc"):'', userName: operationsData.userName, + subscriptionPlanId: operationsData.subscriptionPlanId }; }; let setEditData = () => { @@ -199,6 +225,7 @@ export default defineComponent({ operationsData.password == operationsData.oldPassword ? null : md5(operationsData.password + "abc"), + subscriptionPlanId: operationsData.subscriptionPlanId }; }; let cancelDsign = () => { @@ -207,6 +234,8 @@ export default defineComponent({ operationsData.userEmail = ""; operationsData.password = ""; operationsData.credits = ""; + operationsData.subscriptionPlanId = ""; + operationsData.oldSubscriptionPlanId = ""; operations.operationsModal = false; }; let setOk = () => { @@ -237,11 +266,26 @@ export default defineComponent({ message.info("The email format is incorrect"); return; } - if (!data.userName || !data.userEmail) + if (!data.userName || !data.userEmail || !data.subscriptionPlanId) return message.warning("Please check the input box marked with *"); + const needSwitchPlan = + operationsData.subscriptionPlanId && + operationsData.subscriptionPlanId !== + operationsData.oldSubscriptionPlanId; Https.axiosPost(Https.httpUrls.addOrUpdateSubAccount, data).then( (rv) => { if (rv) { + if (needSwitchPlan) { + Https.axiosGet( + Https.httpUrls.switchSubAccountSubscribePlan, + { + params: { + targetSubscriptionPlanId: operationsData.subscriptionPlanId, + subAccId: operationsData.accountId, + }, + } + ); + } cancelDsign(); emit("searchHistoryList"); } @@ -258,6 +302,7 @@ export default defineComponent({ focus, blur, setOk, + planOptions, }; }, data() { diff --git a/src/component/Administrator/SE/allUser/index.vue b/src/component/Administrator/SE/allUser/index.vue index ebfe2ca1..4a5f397b 100644 --- a/src/component/Administrator/SE/allUser/index.vue +++ b/src/component/Administrator/SE/allUser/index.vue @@ -1,573 +1,728 @@ \ No newline at end of file +.plan_list { + margin-top: 1rem; + display: flex; + // flex-wrap: wrap; + padding-left: 2.8rem; + column-gap: 0.6rem; + margin-bottom: 2rem; + .plan_item { + height: 4rem; + width: auto; + min-width: 10rem; + display: flex; + align-items: center; + justify-content: center; + // font-size: 1.8rem; + + font-weight: 600; + border-radius: 1.3rem; + color: #fff; + cursor: pointer; + border: 1.8px solid #000; + background-color: #000; + padding: 0 1rem 0 2rem; + + &:hover { + color: #000; + background-color: #fff; + } + + &.active { + background: #ffffff; + color: #000000; + } + } + + .plan_item { + column-gap: 0.6rem; + } + + .plan_more_icon { + font-size: 1.6rem; + cursor: pointer; + } +} +.subscription-plan-cell { + display: flex; + align-items: center; + justify-content: center; +} +.rename-plan-form { + padding: 2rem 0; + .admin_state_item { + display: flex; + align-items: center; + > span { + width: 10rem; + margin-right: 1rem; + } + } +} + diff --git a/src/component/Administrator/subscriptionPlan.vue b/src/component/Administrator/subscriptionPlan.vue index 6c06903b..ffc034c0 100644 --- a/src/component/Administrator/subscriptionPlan.vue +++ b/src/component/Administrator/subscriptionPlan.vue @@ -58,6 +58,16 @@ :options="allUserList" > + + + Search @@ -94,13 +104,10 @@ > {{ formatTime(record[column.key], 'YYYY-MM-DD hh:mm:ss') }} -