mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-11-12 05:33:48 +08:00
【smart-app更新】1、意见反馈;2、我的;3、退出登录;4、等等其他
This commit is contained in:
17
smart-app/src/api/support/feedback-api.js
Normal file
17
smart-app/src/api/support/feedback-api.js
Normal file
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* 意见反馈
|
||||
*
|
||||
* @Author: 1024创新实验室:开云
|
||||
* @Date: 2022-09-03 21:56:31
|
||||
* @Wechat: zhuda1024
|
||||
* @Email: lab1024@163.com
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
*/
|
||||
import { postRequest } from '/src/lib/smart-request';
|
||||
|
||||
export const feedbackApi = {
|
||||
// 意见反馈-新增
|
||||
addFeedback: (params) => {
|
||||
return postRequest('/support/feedback/add', params);
|
||||
},
|
||||
};
|
||||
14
smart-app/src/api/support/file-api.js
Normal file
14
smart-app/src/api/support/file-api.js
Normal file
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* 系统更新日志 api 封装
|
||||
*
|
||||
* @Author: 卓大
|
||||
* @Date: 2022-09-26 14:53:50
|
||||
* @Copyright 1024创新实验室
|
||||
*/
|
||||
import { uploadRequest } from '/@/lib/smart-request';
|
||||
|
||||
export const fileApi = {
|
||||
upload: (file, folder) => {
|
||||
return uploadRequest(file, folder);
|
||||
},
|
||||
};
|
||||
@@ -12,6 +12,7 @@ import loginDevice from './system/login-device-const';
|
||||
import enterpriseConst from './business/oa/enterprise-const';
|
||||
import goodsConst from './business/erp/goods-const';
|
||||
import changeLogConst from './support/change-log-const';
|
||||
import fileConst from './support/file-const';
|
||||
|
||||
export default {
|
||||
FLAG_NUMBER_ENUM,
|
||||
@@ -21,4 +22,5 @@ export default {
|
||||
...enterpriseConst,
|
||||
...goodsConst,
|
||||
...changeLogConst,
|
||||
...fileConst,
|
||||
};
|
||||
|
||||
31
smart-app/src/constants/support/file-const.js
Normal file
31
smart-app/src/constants/support/file-const.js
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* 文件类型
|
||||
*
|
||||
* @Author: 1024创新实验室-主任:卓大
|
||||
* @Date: 2022-09-03 22:09:10
|
||||
* @Wechat: zhuda1024
|
||||
* @Email: lab1024@163.com
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
*/
|
||||
// 文件上传类型
|
||||
export const FILE_FOLDER_TYPE_ENUM = {
|
||||
COMMON: {
|
||||
value: 1,
|
||||
desc: '通用',
|
||||
},
|
||||
NOTICE: {
|
||||
value: 2,
|
||||
desc: '公告',
|
||||
},
|
||||
HELP_DOC: {
|
||||
value: 3,
|
||||
desc: '帮助中心',
|
||||
},
|
||||
FEEDBACK: {
|
||||
value: 4,
|
||||
desc: '意见反馈',
|
||||
},
|
||||
};
|
||||
export default {
|
||||
FILE_FOLDER_TYPE_ENUM,
|
||||
};
|
||||
@@ -22,6 +22,41 @@ function getUserToken() {
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理返回的消息
|
||||
*/
|
||||
function handleResponse(response, resolve, reject) {
|
||||
// 如果是加密数据
|
||||
if (response.data.dataType === DATA_TYPE_ENUM.ENCRYPT.value) {
|
||||
response.data.encryptData = response.data.data;
|
||||
let decryptStr = decryptData(response.data.data);
|
||||
if (decryptStr) {
|
||||
response.data.data = JSON.parse(decryptStr);
|
||||
}
|
||||
}
|
||||
|
||||
const res = response.data;
|
||||
if (res.code && res.code !== 1) {
|
||||
// `token` 过期或者账号已在别处登录
|
||||
if (res.code === 30007 || res.code === 30008 || res.code === 30012) {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none',
|
||||
});
|
||||
useUserStore().clearUserLoginInfo();
|
||||
uni.navigateTo({ url: '/pages/login/login' });
|
||||
}
|
||||
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none',
|
||||
});
|
||||
reject(response);
|
||||
} else {
|
||||
resolve(res);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 通用请求封装
|
||||
*/
|
||||
@@ -35,35 +70,7 @@ export const request = function (url, method, data) {
|
||||
'x-access-token': getUserToken(),
|
||||
},
|
||||
success: (response) => {
|
||||
// 如果是加密数据
|
||||
if (response.data.dataType === DATA_TYPE_ENUM.ENCRYPT.value) {
|
||||
response.data.encryptData = response.data.data;
|
||||
let decryptStr = decryptData(response.data.data);
|
||||
if (decryptStr) {
|
||||
response.data.data = JSON.parse(decryptStr);
|
||||
}
|
||||
}
|
||||
|
||||
const res = response.data;
|
||||
if (res.code && res.code !== 1) {
|
||||
// `token` 过期或者账号已在别处登录
|
||||
if (res.code === 30007 || res.code === 30008 || res.code === 30012) {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none',
|
||||
});
|
||||
useUserStore().clearUserLoginInfo();
|
||||
uni.navigateTo({ url: '/pages/login/login' });
|
||||
}
|
||||
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none',
|
||||
});
|
||||
reject(response);
|
||||
} else {
|
||||
resolve(res);
|
||||
}
|
||||
handleResponse(response, resolve, reject);
|
||||
},
|
||||
fail: (error) => {
|
||||
reject(error);
|
||||
@@ -94,3 +101,28 @@ export const postRequest = (url, data) => {
|
||||
export const postEncryptRequest = (url, data) => {
|
||||
return request(url, 'POST', { encryptData: encryptData(data) });
|
||||
};
|
||||
|
||||
// ================================= 文件 =================================
|
||||
|
||||
export const uploadRequest = function (filePath, folder) {
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.uploadFile({
|
||||
url: baseUrl + '/support/file/upload',
|
||||
filePath,
|
||||
header: {
|
||||
'x-access-token': getUserToken(),
|
||||
},
|
||||
name: 'file',
|
||||
formData: {
|
||||
folder,
|
||||
},
|
||||
success: (response) => {
|
||||
response.data = JSON.parse(response.data.replace('\uFEFF', ''));
|
||||
handleResponse(response, resolve, reject);
|
||||
},
|
||||
fail: (error) => {
|
||||
reject(error);
|
||||
},
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
{
|
||||
"path": "pages/home/index",
|
||||
"style": {
|
||||
"navigationStyle":"custom"
|
||||
"navigationStyle":"custom",
|
||||
"navigationBarTitleText": "首页"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -135,7 +136,7 @@
|
||||
{
|
||||
"navigationBarTitleText" : "常见列表样式1",
|
||||
"enablePullDownRefresh" : false,
|
||||
"navigationStyle": "custom"
|
||||
"navigationBarBackgroundColor": "#fff"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -155,6 +156,15 @@
|
||||
"enablePullDownRefresh" : false,
|
||||
"navigationBarBackgroundColor": "#fff"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "pages/support/feedback/feedback-form",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "意见反馈",
|
||||
"enablePullDownRefresh" : false,
|
||||
"navigationBarBackgroundColor": "#fff"
|
||||
}
|
||||
}
|
||||
],
|
||||
"globalStyle": {
|
||||
@@ -178,7 +188,7 @@
|
||||
"pagePath": "pages/list/list",
|
||||
"iconPath": "static/images/tabbar/list-icon.png",
|
||||
"selectedIconPath": "static/images/tabbar/list-icon-h.png",
|
||||
"text": "常见列表"
|
||||
"text": "常见列表1"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/list2/list",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<view class="menu-container">
|
||||
<uni-grid :column="5" :highlight="true" :showBorder="false">
|
||||
<uni-grid :column="5" :highlight="true" :show-border="false" customStyle="display: block;">
|
||||
<!--------------------------------- 第一排--------------------------------->
|
||||
<uni-grid-item class="menu-grid">
|
||||
<view class="menu-item" @click="changeHome">
|
||||
@@ -61,9 +61,9 @@
|
||||
</view>
|
||||
</uni-grid-item>
|
||||
<uni-grid-item class="menu-grid">
|
||||
<view class="menu-item" @click="navigateTo('/pages/change-log/change-log-list')">
|
||||
<view class="menu-item" @click="developing">
|
||||
<image class="item-image" src="/@/static/images/index/ic_home_menu10.png"></image>
|
||||
<view class="item-text"> 加密安全 </view>
|
||||
<view class="item-text"> 接口加密 </view>
|
||||
</view>
|
||||
</uni-grid-item>
|
||||
</uni-grid>
|
||||
@@ -71,6 +71,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { SmartToast } from '/@/lib/smart-support';
|
||||
const emit = defineEmits(['changeHome']);
|
||||
|
||||
function changeHome() {
|
||||
@@ -87,6 +88,10 @@
|
||||
url,
|
||||
});
|
||||
}
|
||||
|
||||
function developing() {
|
||||
SmartToast.toast('敬请期待');
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@@ -110,6 +115,8 @@
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
width: 134rpx;
|
||||
height: 134rpx;
|
||||
.item-image {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
|
||||
@@ -37,15 +37,23 @@
|
||||
import Notice from './components/notice.vue';
|
||||
import Goods from './components/goods.vue';
|
||||
import { ref } from 'vue';
|
||||
import { onShow } from '@dcloudio/uni-app';
|
||||
|
||||
const showBannerFlag = ref(false);
|
||||
function changeHome() {
|
||||
showBannerFlag.value = !showBannerFlag.value;
|
||||
}
|
||||
|
||||
onShow(() => {
|
||||
uni.pageScrollTo({
|
||||
scrollTop: 0,
|
||||
duration: 300,
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
page {
|
||||
.page {
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<view>
|
||||
<y-tabs v-model="active" sticky :offsetTop="0" color="#007aff">
|
||||
<y-tab class="y-tab-virtual" v-for="item in tabsList" :key="item.value" :title="item.title"> </y-tab>
|
||||
<y-tabs v-model="active" sticky :offsetTop="43" color="#007aff">
|
||||
<y-tab v-for="item in tabsList" :key="item.value" :title="item.title"> </y-tab>
|
||||
</y-tabs>
|
||||
|
||||
<ListUI1 v-if="active === 0" />
|
||||
@@ -42,25 +42,6 @@
|
||||
|
||||
<style lang="scss" scoped>
|
||||
page {
|
||||
background: #f5f6f8;
|
||||
}
|
||||
.input {
|
||||
width: 526rpx;
|
||||
height: 72rpx;
|
||||
background: #f7f8f9;
|
||||
border-radius: 4px;
|
||||
margin: 8rpx 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
icon {
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
input {
|
||||
margin-left: 8rpx;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.placeolder-input {
|
||||
color: #ccc;
|
||||
}
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
<template>
|
||||
<y-tabs v-model="active" sticky :offsetTop="0" color="#007aff">
|
||||
<y-tab class="y-tab-virtual" v-for="item in tabsList" :key="item.value" :title="item.title"> </y-tab>
|
||||
</y-tabs>
|
||||
<view>
|
||||
<y-tabs v-model="active" sticky :offsetTop="43" color="#007aff">
|
||||
<y-tab v-for="item in tabsList" :key="item.value" :title="item.title"> </y-tab>
|
||||
</y-tabs>
|
||||
|
||||
<ExpressList v-if="active === 0" />
|
||||
<DiscountList v-if="active === 1" />
|
||||
<IotList v-if="active === 2" />
|
||||
<ServiceList v-if="active === 3" />
|
||||
<CourseList v-if="active === 4" />
|
||||
<ExpressList v-if="active === 0" />
|
||||
<DiscountList v-if="active === 1" />
|
||||
<IotList v-if="active === 2" />
|
||||
<ServiceList v-if="active === 3" />
|
||||
<CourseList v-if="active === 4" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
@@ -48,6 +50,6 @@
|
||||
|
||||
<style lang="scss" scoped>
|
||||
page {
|
||||
background: #f5f6f8;
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
import { ref } from 'vue';
|
||||
|
||||
const agreeFlag = ref(false);
|
||||
const agreeFlag = ref(true);
|
||||
|
||||
function agree() {
|
||||
agreeFlag.value = !agreeFlag.value;
|
||||
@@ -38,14 +38,14 @@
|
||||
.check-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: $small-size;
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
color: #999999;
|
||||
margin-bottom: 7px;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
image {
|
||||
width: 17px;
|
||||
height: 17px;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
margin-right: 2px;
|
||||
}
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
</view>
|
||||
</template>
|
||||
<script setup>
|
||||
import { nextTick, reactive, ref } from 'vue';
|
||||
import { reactive, ref } from 'vue';
|
||||
import { onShow } from '@dcloudio/uni-app';
|
||||
import OtherWayBox from './components/other-way-box.vue';
|
||||
import LoginCheckBox from './components/login-check-box.vue';
|
||||
@@ -292,9 +292,8 @@
|
||||
|
||||
.login-check-box {
|
||||
flex-shrink: 0;
|
||||
margin-top: 69px;
|
||||
margin-bottom: 63px;
|
||||
margin-left: 22px;
|
||||
margin-top: 150rpx;
|
||||
margin-bottom: 120rpx;
|
||||
align-self: flex-start;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -7,18 +7,18 @@
|
||||
<image class="icon" src="/static/images/mine/mine-account.png" mode=""></image>
|
||||
</template>
|
||||
</uni-list-item>
|
||||
<uni-list-item title="消息通知" link showBadge badgeText="6" badgeType="error" @click="gotoMessage">
|
||||
<uni-list-item title="消息通知" link="switchTab" showBadge badgeText="6" badgeType="error" to="/pages/message/message">
|
||||
<template #header>
|
||||
<image class="icon" src="/static/images/mine/mine-message.png" mode=""></image>
|
||||
</template>
|
||||
</uni-list-item>
|
||||
|
||||
<uni-list-item title="意见反馈" link rightText="欢迎吐槽" showBadge>
|
||||
<uni-list-item title="意见反馈" link rightText="欢迎吐槽" showBadge to="/pages/support/feedback/feedback-form">
|
||||
<template #header>
|
||||
<image class="icon" src="/static/images/mine/mine-feedback.png" mode=""></image>
|
||||
</template>
|
||||
</uni-list-item>
|
||||
<uni-list-item title="联系客服" showBadge>
|
||||
<uni-list-item title="联系客服" showBadge clickable @click="callService">
|
||||
<template #header>
|
||||
<image class="icon" src="/static/images/mine/mine-service.png" mode=""></image>
|
||||
</template>
|
||||
@@ -56,9 +56,9 @@
|
||||
<image class="icon" src="/static/images/mine/mine-about-us.png" mode=""></image>
|
||||
</template>
|
||||
</uni-list-item>
|
||||
<uni-list-item title="设置" link showBadge>
|
||||
<uni-list-item title="设置" showBadge clickable @click="developing">
|
||||
<template #header>
|
||||
<image class="icon" src="/static/images/mine/mine-protocol.png" mode=""></image>
|
||||
<image class="icon" src="/static/images/mine/mine-protocol.png"></image>
|
||||
</template>
|
||||
</uni-list-item>
|
||||
</uni-list>
|
||||
@@ -66,14 +66,22 @@
|
||||
</view>
|
||||
</template>
|
||||
<script setup>
|
||||
import { SmartToast } from '/@/lib/smart-support';
|
||||
|
||||
const emits = defineEmits(['changeStyle']);
|
||||
|
||||
function changeStyle() {
|
||||
emits('changeStyle');
|
||||
}
|
||||
|
||||
function gotoMessage() {
|
||||
uni.switchTab({ url: '/pages/message/message' });
|
||||
function developing() {
|
||||
SmartToast.toast('敬请期待');
|
||||
}
|
||||
|
||||
function callService() {
|
||||
uni.makePhoneCall({
|
||||
phoneNumber: '18637925892',
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
|
||||
@@ -18,12 +18,30 @@
|
||||
import MineUserBlue from './components/mine-user-blue.vue';
|
||||
import MineUserWhite from './components/mine-user-white.vue';
|
||||
import { ref } from 'vue';
|
||||
const logout = () => {};
|
||||
import { useUserStore } from '/@/store/modules/system/user';
|
||||
import { SmartLoading, SmartToast } from '/@/lib/smart-support';
|
||||
import { smartSentry } from '/@/lib/smart-sentry';
|
||||
|
||||
const userStore = useUserStore();
|
||||
const blueUserFlag = ref(true);
|
||||
function onChangeStyle() {
|
||||
blueUserFlag.value = !blueUserFlag.value;
|
||||
}
|
||||
|
||||
async function logout() {
|
||||
try {
|
||||
setTimeout(() => {
|
||||
userStore.logout();
|
||||
uni.navigateTo({ url: '/pages/login/login' });
|
||||
}, 500);
|
||||
await SmartLoading.show();
|
||||
SmartToast.toast('退出成功');
|
||||
} catch (e) {
|
||||
smartSentry.captureError(e);
|
||||
} finally {
|
||||
SmartLoading.hide();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.container {
|
||||
@@ -37,13 +55,12 @@
|
||||
margin: 24px 27px 50px;
|
||||
height: 44px;
|
||||
opacity: 0.5;
|
||||
background: #ffffff;
|
||||
background: $uni-color-error;
|
||||
border-radius: 22px;
|
||||
box-shadow: 0px 3px 4px 0px rgba(24, 144, 255, 0.06);
|
||||
font-size: 15px;
|
||||
line-height: 44px;
|
||||
font-weight: 700;
|
||||
text-align: center;
|
||||
color: #353535;
|
||||
color: white;
|
||||
}
|
||||
</style>
|
||||
|
||||
168
smart-app/src/pages/support/feedback/feedback-form.vue
Normal file
168
smart-app/src/pages/support/feedback/feedback-form.vue
Normal file
@@ -0,0 +1,168 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view class="smart-form">
|
||||
<uni-forms ref="formRef" :label-width="100" :modelValue="form" label-position="left" :rules="rules">
|
||||
<view class="smart-form-group">
|
||||
<view class="smart-form-group-title"> 反馈内容 </view>
|
||||
<view class="smart-form-group-content">
|
||||
<uni-forms-item class="smart-form-item" label="意见反馈:" name="feedbackContent" required>
|
||||
<uni-easyinput type="textarea" trim="all" v-model="form.feedbackContent" placeholder="请输入 宝贵的意见和建议" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item class="smart-form-item" label="相关图片:" name="unifiedSocialCreditCode">
|
||||
<uni-file-picker
|
||||
limit="9"
|
||||
title="最多选择9个图片"
|
||||
@delete="onDeleteFile"
|
||||
v-model="feedbackFile"
|
||||
@select="onSelectFile"
|
||||
></uni-file-picker>
|
||||
</uni-forms-item>
|
||||
</view>
|
||||
</view>
|
||||
</uni-forms>
|
||||
|
||||
<view class="smart-form-submit smart-margin-top20 bottom-button">
|
||||
<button class="smart-form-submit-btn smart-margin-right20" type="default" @click="cancel">取消</button>
|
||||
<button class="smart-form-submit-btn" type="primary" @click="submit">保存</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive, ref } from 'vue';
|
||||
import { enterpriseApi } from '/@/api/business/oa/enterprise-api';
|
||||
import { smartSentry } from '/@/lib/smart-sentry';
|
||||
import { SmartLoading, SmartToast } from '/@/lib/smart-support';
|
||||
import { onLoad, onReady } from '@dcloudio/uni-app';
|
||||
import { fileApi } from '/@/api/support/file-api';
|
||||
import { FILE_FOLDER_TYPE_ENUM } from '/@/constants/support/file-const';
|
||||
import _ from 'lodash';
|
||||
import { feedbackApi } from '/@/api/support/feedback-api';
|
||||
|
||||
// --------------------- 表单 ---------------------
|
||||
|
||||
const defaultFormData = {
|
||||
feedbackContent: '',
|
||||
feedbackAttachment: [],
|
||||
};
|
||||
let form = reactive({ ...defaultFormData });
|
||||
const feedbackFile = ref([]);
|
||||
|
||||
const rules = {
|
||||
feedbackContent: {
|
||||
rules: [{ required: true, errorMessage: '请输入反馈意见' }],
|
||||
},
|
||||
};
|
||||
|
||||
// --------------------- 文件 ---------------------
|
||||
function onSelectFile(param) {
|
||||
let tempFilePaths = param.tempFilePaths;
|
||||
for (const tempFilePath of tempFilePaths) {
|
||||
upload(tempFilePath);
|
||||
}
|
||||
|
||||
console.log(param, 2);
|
||||
console.log(feedbackFile, 2);
|
||||
}
|
||||
|
||||
async function upload(tempFilePath) {
|
||||
try {
|
||||
SmartLoading.show();
|
||||
let res = await fileApi.upload(tempFilePath, FILE_FOLDER_TYPE_ENUM.FEEDBACK.value);
|
||||
res.data.tempFilePath = tempFilePath;
|
||||
form.feedbackAttachment.push(res.data);
|
||||
} catch (e) {
|
||||
smartSentry.captureError(e);
|
||||
} finally {
|
||||
SmartLoading.hide();
|
||||
}
|
||||
}
|
||||
|
||||
function onDeleteFile(param) {
|
||||
if (!param.tempFilePath) {
|
||||
return;
|
||||
}
|
||||
_.remove(form.feedbackAttachment, (e) => e.tempFilePath === param.tempFilePath);
|
||||
}
|
||||
|
||||
// --------------------- 详情 ---------------------
|
||||
|
||||
onLoad((options) => {
|
||||
if (options.enterpriseId) {
|
||||
form.enterpriseId = options.enterpriseId;
|
||||
getDetail(options.enterpriseId);
|
||||
}
|
||||
});
|
||||
|
||||
onReady(() => {
|
||||
if (form.enterpriseId) {
|
||||
uni.setNavigationBarTitle({
|
||||
title: '修改客户',
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
async function getDetail(id) {
|
||||
try {
|
||||
SmartLoading.show();
|
||||
let res = await enterpriseApi.detail(id);
|
||||
form.enterpriseId = res.data.enterpriseId;
|
||||
form.enterpriseName = res.data.enterpriseName;
|
||||
form.unifiedSocialCreditCode = res.data.unifiedSocialCreditCode;
|
||||
form.type = res.data.type;
|
||||
form.contact = res.data.contact;
|
||||
form.contactPhone = res.data.contactPhone;
|
||||
form.email = res.data.email;
|
||||
form.address = res.data.address;
|
||||
} catch (e) {
|
||||
smartSentry.captureError(e);
|
||||
} finally {
|
||||
SmartLoading.hide();
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------- 表单操作 ------------------------
|
||||
|
||||
const formRef = ref();
|
||||
|
||||
// 取消
|
||||
function cancel() {
|
||||
close();
|
||||
uni.navigateBack();
|
||||
}
|
||||
|
||||
// 确定
|
||||
function submit() {
|
||||
formRef.value
|
||||
.validate()
|
||||
.then(async () => {
|
||||
SmartLoading.show();
|
||||
try {
|
||||
await feedbackApi.addFeedback(form);
|
||||
SmartToast.success('提交反馈成功');
|
||||
uni.navigateBack();
|
||||
} catch (error) {
|
||||
smartSentry.captureError(error);
|
||||
} finally {
|
||||
SmartLoading.hide();
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log('error', error);
|
||||
SmartToast.toast('参数验证错误,请仔细填写表单数据!');
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.query-form-pop {
|
||||
height: 800rpx;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
.bottom-button {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
}
|
||||
</style>
|
||||
@@ -51,6 +51,7 @@ export const useUserStore = defineStore({
|
||||
actions: {
|
||||
logout() {
|
||||
this.token = null;
|
||||
this.setUserLoginInfo(defaultUserInfo);
|
||||
uni.removeStorage(USER_TOKEN);
|
||||
},
|
||||
clearUserLoginInfo() {
|
||||
|
||||
@@ -134,7 +134,6 @@
|
||||
.smart-form-item {
|
||||
min-height: 100rpx;
|
||||
height: auto;
|
||||
padding-bottom: 24rpx;
|
||||
align-items: center;
|
||||
&:last-child {
|
||||
border: none;
|
||||
|
||||
Reference in New Issue
Block a user