|
|
@@ -32,6 +32,14 @@
|
|
|
<span>{{ appStore?.userInfo?.baoMiBalance || 0 }}</span>
|
|
|
<span>{{ $t('common.baomibi') }}</span>
|
|
|
</div>
|
|
|
+
|
|
|
+
|
|
|
+ <div class="">
|
|
|
+
|
|
|
+ <el-button type="primary">充值</el-button>
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
<div class="personal-user-line"></div>
|
|
|
<div class="personal-user-li">
|
|
|
<span>{{ collectCount }}</span>
|
|
|
@@ -59,12 +67,15 @@
|
|
|
<div class="personal-main">
|
|
|
<div class="personal-left">
|
|
|
<div class="personal-left-list">
|
|
|
- <div @click="toPath(item, index)" :class="{ active: index == navIndex }" class="personal-left-li"
|
|
|
- v-for="(item, index) in navList" :key="index">
|
|
|
- <img v-if="index == navIndex" :src="item.iconActive" alt="">
|
|
|
- <img v-else :src="item.icon" alt="">
|
|
|
- <div class="">{{ $t(item.name) }}</div>
|
|
|
- </div>
|
|
|
+ <template v-for="(item, index) in navList" :key="index">
|
|
|
+ <div v-if="item.show" @click="toPath(item, index)" :class="{ active: index == navIndex }"
|
|
|
+ class="personal-left-li">
|
|
|
+ <img v-if="index == navIndex" :src="item.iconActive" alt="">
|
|
|
+ <img v-else :src="item.icon" alt="">
|
|
|
+ <div class="">{{ $t(item.name) }}</div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="personal-right">
|
|
|
@@ -79,31 +90,49 @@
|
|
|
|
|
|
<div class="workOrder-dot" @click="show = true">
|
|
|
<img src="/src/assets/imgs/my/icon9a@2x.png" alt="">
|
|
|
- <div class="">工单</div>
|
|
|
+ <div class="">{{ $t('personalCenter.gongdan') }}</div>
|
|
|
</div>
|
|
|
|
|
|
- <el-dialog v-model="show" title="工单" width="784">
|
|
|
- <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
|
|
|
- <el-tab-pane v-for="tab in tabs" :key="tab.name" :label="tab.label" :name="tab.name">
|
|
|
- <el-form ref="ruleFormRef" :model="ruleForm" :rules="rules">
|
|
|
- <el-form-item label="工单类型" prop="issueCategory">
|
|
|
- <el-input v-model="ruleForm.issueCategory" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="工单标题" prop="issueTitle">
|
|
|
- <el-input v-model="ruleForm.issueTitle" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="工单内容" prop="issueContent">
|
|
|
- <el-input v-model="ruleForm.issueContent" />
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
+ <el-dialog v-model="show" :title="`${$t('personalCenter.gongdan')}`" width="784">
|
|
|
+ <el-tabs v-model="activeName" @tab-click="handleClick">
|
|
|
+ <el-tab-pane v-for="tab in tabs" :key="tab.name" :label="`${$t(tab.label)}`" :name="tab.name">
|
|
|
+ <template v-if="activeName == 0">
|
|
|
+ <el-form ref="ruleFormRef" :model="ruleForm" :rules="rules" label-width="160px">
|
|
|
+ <el-form-item :label="`${$t('personalCenter.gongdanleixing')}`" prop="issueCategory">
|
|
|
+ <el-select v-model="ruleForm.issueCategory" :placeholder="`${$t('common.qingxuanze')}`"
|
|
|
+ style="width: 100%">
|
|
|
+ <el-option v-for="item in workTypeList" :key="item.value" :label="`${$t(item.label)}`"
|
|
|
+ :value="item.value" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item :label="`${$t('personalCenter.gongdanbiaoti')}`" prop="issueTitle">
|
|
|
+ <el-input v-model="ruleForm.issueTitle" :placeholder="`${$t('common.placeholderInput')}`" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item :label="`${$t('personalCenter.gongdanneirong')}`" prop="issueContent">
|
|
|
+ <el-input v-model="ruleForm.issueContent" :placeholder="`${$t('common.placeholderInput')}`" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ <el-collapse v-model="workName" accordion>
|
|
|
+ <el-collapse-item :title="item.issueTitle || item.question" :name="item.id"
|
|
|
+ v-for="(item, index) in workList" :key="index">
|
|
|
+ <div>{{ item.issueContent || item.answer }}</div>
|
|
|
+ </el-collapse-item>
|
|
|
+ </el-collapse>
|
|
|
+ <template v-if="workList && workList.length">
|
|
|
+ <Pagination :total="workForm.total" :page-size="workForm.pageSize" :current-page="workForm.pageNum"
|
|
|
+ @page-change="handlePageChange" />
|
|
|
+ </template>
|
|
|
+ <el-empty v-else :description="$t('common.empty')" />
|
|
|
+ </template>
|
|
|
+
|
|
|
</el-tab-pane>
|
|
|
</el-tabs>
|
|
|
<template #footer v-if="activeName == 0">
|
|
|
- <div class="dialog-footer">
|
|
|
- <el-button @click="dialogVisible = false">Cancel</el-button>
|
|
|
- <el-button type="primary" @click="submitForm(ruleFormRef)">
|
|
|
- Confirm
|
|
|
- </el-button>
|
|
|
+ <div class="dialog-footer flex-center">
|
|
|
+ <el-button @click="show = false">{{ $t('common.cancel') }}</el-button>
|
|
|
+ <el-button type="primary" @click="submitForms(ruleFormRef)">{{ $t('common.confirm') }}</el-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
@@ -155,7 +184,14 @@
|
|
|
<el-input v-model="userInfo.verifyCode" :placeholder="$t('common.placeholderInput')" class="inputStyle"
|
|
|
:input-style="{
|
|
|
backgroundColor: 'transparent',
|
|
|
- }" />
|
|
|
+ }">
|
|
|
+ <template #append>
|
|
|
+ <el-button type="primary" :disabled="smsCountdown > 0" @click="sendSmsCode" style="width:140px"
|
|
|
+ :class="{ 'countdown-btn': smsCountdown > 0 }" size="small">
|
|
|
+ {{ smsCountdown > 0 ? `${smsCountdown}s` : $t('login.sendCaptcha') }}
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
@@ -165,7 +201,11 @@
|
|
|
<el-input v-model="userInfo.name" :placeholder="$t('common.placeholderInput')" class="inputStyle"
|
|
|
:input-style="{
|
|
|
backgroundColor: 'transparent',
|
|
|
- }" />
|
|
|
+ }">
|
|
|
+ <template #append>
|
|
|
+ <el-button :icon="Refresh" />
|
|
|
+ </template>
|
|
|
+ </el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
@@ -173,7 +213,7 @@
|
|
|
<el-input v-model="userInfo.name" :placeholder="$t('common.placeholderInput')" class="inputStyle"
|
|
|
:input-style="{
|
|
|
backgroundColor: 'transparent',
|
|
|
- }" />
|
|
|
+ }" disabled />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
|
|
|
@@ -184,7 +224,11 @@
|
|
|
<el-input v-model="userInfo.name" :placeholder="$t('common.placeholderInput')" class="inputStyle"
|
|
|
:input-style="{
|
|
|
backgroundColor: 'transparent',
|
|
|
- }" />
|
|
|
+ }">
|
|
|
+ <template #append>
|
|
|
+ <el-button :icon="Refresh" />
|
|
|
+ </template>
|
|
|
+ </el-input>
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-col>
|
|
|
@@ -193,7 +237,7 @@
|
|
|
<el-input v-model="userInfo.name" :placeholder="$t('common.placeholderInput')" class="inputStyle"
|
|
|
:input-style="{
|
|
|
backgroundColor: 'transparent',
|
|
|
- }" />
|
|
|
+ }" disabled />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
@@ -203,7 +247,11 @@
|
|
|
<el-input v-model="userInfo.name" :placeholder="$t('common.placeholderInput')" class="inputStyle"
|
|
|
:input-style="{
|
|
|
backgroundColor: 'transparent',
|
|
|
- }" />
|
|
|
+ }">
|
|
|
+ <template #append>
|
|
|
+ <el-button :icon="Refresh" />
|
|
|
+ </template>
|
|
|
+ </el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
@@ -211,7 +259,7 @@
|
|
|
<el-input v-model="userInfo.name" :placeholder="$t('common.placeholderInput')" class="inputStyle"
|
|
|
:input-style="{
|
|
|
backgroundColor: 'transparent',
|
|
|
- }" />
|
|
|
+ }" disabled />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
@@ -222,7 +270,11 @@
|
|
|
<el-input v-model="userInfo.name" :placeholder="$t('common.placeholderInput')" class="inputStyle"
|
|
|
:input-style="{
|
|
|
backgroundColor: 'transparent',
|
|
|
- }" />
|
|
|
+ }">
|
|
|
+ <template #append>
|
|
|
+ <el-button :icon="Refresh" />
|
|
|
+ </template>
|
|
|
+ </el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
@@ -230,7 +282,7 @@
|
|
|
<el-input v-model="userInfo.name" :placeholder="$t('common.placeholderInput')" class="inputStyle"
|
|
|
:input-style="{
|
|
|
backgroundColor: 'transparent',
|
|
|
- }" />
|
|
|
+ }" disabled />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
@@ -269,7 +321,7 @@
|
|
|
</template>
|
|
|
<script setup lang="ts">
|
|
|
|
|
|
-import { Plus } from '@element-plus/icons-vue'
|
|
|
+import { Plus,Refresh } from '@element-plus/icons-vue'
|
|
|
|
|
|
import { useAppStore } from '@/pinia/appStore'
|
|
|
|
|
|
@@ -282,7 +334,7 @@ import { useRoute, useRouter } from 'vue-router'
|
|
|
|
|
|
import { getUserInfo, updateUserInfo } from '@/api/auth.js'
|
|
|
|
|
|
-import { checkIn, queryCollectCount } from '@/api/my.js'
|
|
|
+import { checkIn, queryCollectCount, issue, issueList, faqList, getfaq } from '@/api/my.js'
|
|
|
|
|
|
import DGTMessage from '@/utils/message'
|
|
|
|
|
|
@@ -290,6 +342,19 @@ import { useI18n } from 'vue-i18n'
|
|
|
|
|
|
import FileUploader from '@/components/FileUploader.vue'
|
|
|
|
|
|
+import Pagination from '@/components/Pagination.vue'
|
|
|
+
|
|
|
+
|
|
|
+import type { FormInstance, FormRules } from 'element-plus'
|
|
|
+
|
|
|
+interface RuleForm {
|
|
|
+ issueCategory: string
|
|
|
+ issueTitle: string
|
|
|
+ issueContent: string
|
|
|
+}
|
|
|
+
|
|
|
+const ruleFormRef = ref(null);
|
|
|
+
|
|
|
const { t } = useI18n()
|
|
|
|
|
|
const appStore = useAppStore();
|
|
|
@@ -303,50 +368,57 @@ const navList = ref([
|
|
|
name: 'personalCenter.myWallet',
|
|
|
path: '/personal-center/wallet',
|
|
|
icon: '/src/assets/imgs/my/icon1@2x.png',
|
|
|
- iconActive: '/src/assets/imgs/my/icon1a@2x.png'
|
|
|
+ iconActive: '/src/assets/imgs/my/icon1a@2x.png',
|
|
|
+ show: true
|
|
|
},
|
|
|
{
|
|
|
name: 'personalCenter.membershipInfo',
|
|
|
path: '/personal-center/member-details',
|
|
|
icon: '/src/assets/imgs/my/icon2@2x.png',
|
|
|
- iconActive: '/src/assets/imgs/my/icon2a@2x.png'
|
|
|
+ iconActive: '/src/assets/imgs/my/icon2a@2x.png',
|
|
|
+ show: true
|
|
|
},
|
|
|
{
|
|
|
name: 'personalCenter.myCollection',
|
|
|
path: '/personal-center/collection',
|
|
|
icon: '/src/assets/imgs/my/icon3@2x.png',
|
|
|
- iconActive: '/src/assets/imgs/my/icon3a@2x.png'
|
|
|
+ iconActive: '/src/assets/imgs/my/icon3a@2x.png',
|
|
|
+ show: true
|
|
|
},
|
|
|
{
|
|
|
name: 'personalCenter.myDemand',
|
|
|
path: '/personal-center/demand',
|
|
|
icon: '/src/assets/imgs/my/icon4@2x.png',
|
|
|
- iconActive: '/src/assets/imgs/my/icon4a@2x.png'
|
|
|
+ iconActive: '/src/assets/imgs/my/icon4a@2x.png',
|
|
|
+ show: true
|
|
|
},
|
|
|
{
|
|
|
name: 'personalCenter.myOrders',
|
|
|
path: '/personal-center/orders',
|
|
|
icon: '/src/assets/imgs/my/icon5@2x.png',
|
|
|
- iconActive: '/src/assets/imgs/my/icon5a@2x.png'
|
|
|
+ iconActive: '/src/assets/imgs/my/icon5a@2x.png',
|
|
|
+ show: true
|
|
|
},
|
|
|
{
|
|
|
name: 'personalCenter.myInvoice',
|
|
|
path: '/personal-center/invoice',
|
|
|
icon: '/src/assets/imgs/my/icon6@2x.png',
|
|
|
- iconActive: '/src/assets/imgs/my/icon6a@2x.png'
|
|
|
+ iconActive: '/src/assets/imgs/my/icon6a@2x.png',
|
|
|
+ show: true
|
|
|
},
|
|
|
{
|
|
|
name: 'personalCenter.myWorkflow',
|
|
|
path: '/personal-center/workflow',
|
|
|
icon: '/src/assets/imgs/my/icon7@2x.png',
|
|
|
- iconActive: '/src/assets/imgs/my/icon7a@2x.png'
|
|
|
+ iconActive: '/src/assets/imgs/my/icon7a@2x.png',
|
|
|
+ show: true
|
|
|
},
|
|
|
{
|
|
|
name: 'personalCenter.businessManagement',
|
|
|
path: '/personal-center/business-management',
|
|
|
icon: '/src/assets/imgs/my/icon8@2x.png',
|
|
|
iconActive: '/src/assets/imgs/my/icon8a@2x.png',
|
|
|
- show: true,
|
|
|
+ show: false
|
|
|
},
|
|
|
// {
|
|
|
// name: 'personalCenter.serviceManagement',
|
|
|
@@ -361,23 +433,55 @@ const dialogVisible = ref(false)
|
|
|
const show = ref(false)
|
|
|
|
|
|
const tabs = ref([
|
|
|
- { label: '提交工单', name: 0 },
|
|
|
- { label: '历史工单', name: 1 },
|
|
|
- { label: '常见问题', name: 2 }
|
|
|
+ { label: 'personalCenter.tijiaogongdan', name: 0 },
|
|
|
+ { label: 'personalCenter.lishigongdan', name: 1 },
|
|
|
+ { label: 'personalCenter.changjianwenti', name: 2 }
|
|
|
])
|
|
|
|
|
|
+const workList = ref([])
|
|
|
+
|
|
|
+const workForm = ref({
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ total: 0,
|
|
|
+})
|
|
|
+
|
|
|
const activeName = ref(0)
|
|
|
|
|
|
-const ruleForm = ref({
|
|
|
+const workName = ref(null)
|
|
|
+
|
|
|
+const workTypeList = ref([
|
|
|
+ {
|
|
|
+ value: 'account',
|
|
|
+ label: 'personalCenter.zhanghaowenti'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: 'payment',
|
|
|
+ label: 'personalCenter.zhifuwenti'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: 'course',
|
|
|
+ label: 'personalCenter.kechengwenti'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: 'workflow',
|
|
|
+ label: 'personalCenter.gongzuoliuwenti'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: 'other',
|
|
|
+ label: 'personalCenter.qitawenti'
|
|
|
+ }
|
|
|
+])
|
|
|
+
|
|
|
+const ruleForm = ref<RuleForm>({
|
|
|
issueCategory: '',
|
|
|
issueTitle: '',
|
|
|
issueContent: ''
|
|
|
})
|
|
|
|
|
|
-const rules = ref({
|
|
|
+const rules = ref<FormRules<RuleForm>>({
|
|
|
issueCategory: [
|
|
|
{
|
|
|
- type: 'date',
|
|
|
required: true,
|
|
|
message: '请选择工单类型',
|
|
|
trigger: 'change',
|
|
|
@@ -430,13 +534,80 @@ const userInfo = ref({})//用户信息
|
|
|
|
|
|
const coverImage = ref([]);
|
|
|
|
|
|
-const ruleFormRef = ref()
|
|
|
+// 验证码倒计时
|
|
|
+const smsCountdown = ref(0)
|
|
|
+const passwordresetCountdown = ref(0)
|
|
|
+const emailCountdown = ref(0)
|
|
|
+
|
|
|
+// 发送短信验证码
|
|
|
+const sendSmsCode = async () => {
|
|
|
+ if (!smsForm.account) {
|
|
|
+ ElMessage.warning('请先输入手机号或邮箱')
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ // 验证手机号格式
|
|
|
+ if (!PHONE_REGEX.test(smsForm.account) && !EMAIL_REGEX.test(smsForm.account)) {
|
|
|
+ ElMessage.warning('请输入正确的手机号或邮箱')
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ let res = null;
|
|
|
+ if (PHONE_REGEX.test(smsForm.account)) {
|
|
|
+ res = await getSmsCode({
|
|
|
+ phone: smsForm.account
|
|
|
+ })
|
|
|
+ } else if (EMAIL_REGEX.test(smsForm.account)) {
|
|
|
+ res = await getEmailCode({
|
|
|
+ email: smsForm.account
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ if (res.code !== 200) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ // 模拟发送验证码
|
|
|
+ ElMessage.success('验证码发送成功')
|
|
|
+
|
|
|
+ // 开始倒计时
|
|
|
+ smsCountdown.value = 60
|
|
|
+ const timer = setInterval(() => {
|
|
|
+ smsCountdown.value--
|
|
|
+ if (smsCountdown.value <= 0) {
|
|
|
+ clearInterval(timer)
|
|
|
+ }
|
|
|
+ }, 1000)
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+const handlePageChange = () => {
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+const handleClick = async (tab) => {
|
|
|
+ activeName.value = tab.props.name
|
|
|
+ getList()
|
|
|
+}
|
|
|
+
|
|
|
+const getList = async () => {
|
|
|
+ let api = activeName.value == 1 ? issueList(workForm.value) : faqList(workForm.value);
|
|
|
+ let res = await api;
|
|
|
+ workList.value = res.rows;
|
|
|
+ workForm.value.total = res.total;
|
|
|
+}
|
|
|
|
|
|
-const submitForm = async (formEl: any) => {
|
|
|
- if (!formEl) return
|
|
|
+
|
|
|
+const submitForms = async (formEl) => {
|
|
|
+ let res = await issue(ruleForm.value);
|
|
|
+ console.log(res);
|
|
|
+ if (res.code === 200) {
|
|
|
+ show.value = false;
|
|
|
+ }
|
|
|
+ if (!formEl) return;
|
|
|
await formEl.validate(async (valid, fields) => {
|
|
|
if (valid) {
|
|
|
- console.log('submit!')
|
|
|
+
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
@@ -479,6 +650,12 @@ const getInfo = async () => {
|
|
|
dynamicTags.value = res.user.skillTags.split(',')
|
|
|
}
|
|
|
userInfo.value = res.user;
|
|
|
+ navList.value.forEach(item => {
|
|
|
+ if (item.name === 'personalCenter.businessManagement' && res.user.isCompanyAuth == 1) {
|
|
|
+ item.show = true;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // isCompanyAuth
|
|
|
}
|
|
|
|
|
|
const collectCount = ref(0)
|
|
|
@@ -714,7 +891,7 @@ div {
|
|
|
border-radius: 4px;
|
|
|
border: 1px solid #F2F6FC;
|
|
|
|
|
|
- ::v-deep .el-input__wrapper {
|
|
|
+ :deep(.el-input__wrapper) {
|
|
|
background-color: transparent;
|
|
|
}
|
|
|
}
|
|
|
@@ -725,10 +902,10 @@ div {
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
|
flex-direction: column;
|
|
|
- right: 100px;
|
|
|
- bottom: 90px;
|
|
|
- width: 64px;
|
|
|
- height: 64px;
|
|
|
+ right: 80px;
|
|
|
+ bottom: 70px;
|
|
|
+ width: 84px;
|
|
|
+ height: 84px;
|
|
|
position: fixed;
|
|
|
color: #2D71FF;
|
|
|
font-size: 14px;
|