Merge branch 'feature/feature-20250331-h5' into uat
This commit is contained in:
1
.env
1
.env
@@ -1,5 +1,6 @@
|
|||||||
# .env
|
# .env
|
||||||
VITE_APP_BASE_URL=http://192.168.8.165:15011/
|
VITE_APP_BASE_URL=http://192.168.8.165:15011/
|
||||||
|
VITE_APP_BASE_DEMAIM=http://192.168.8.165:15011/
|
||||||
VITE_APP_ENV=development
|
VITE_APP_ENV=development
|
||||||
VITE_APP_CURRENTMODE=dev
|
VITE_APP_CURRENTMODE=dev
|
||||||
VITE_APP_BASEOSS=https://diaoyan-files.automark.cc
|
VITE_APP_BASEOSS=https://diaoyan-files.automark.cc
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
# .env.development
|
# .env.development
|
||||||
VITE_APP_BASEURL=https://yls-api-uat.dctest.digitalyili.com
|
VITE_APP_BASEURL=https://yls-api-uat.dctest.digitalyili.com
|
||||||
|
VITE_APP_BASEDOMAIM=https://ylst-h5-uat.dctest.digitalyili.com
|
||||||
VITE_APP_ENV=development
|
VITE_APP_ENV=development
|
||||||
VITE_APP_CURRENTMODE=dev
|
VITE_APP_CURRENTMODE=dev
|
||||||
VITE_APP_BASEOSS=https://diaoyan-files.automark.cc
|
VITE_APP_BASEOSS=https://diaoyan-files.automark.cc
|
||||||
|
|||||||
1
.env.uat
1
.env.uat
@@ -1,5 +1,6 @@
|
|||||||
# .env.development
|
# .env.development
|
||||||
VITE_APP_BASEURL=https://yls-api-uat.dctest.digitalyili.com
|
VITE_APP_BASEURL=https://yls-api-uat.dctest.digitalyili.com
|
||||||
|
VITE_APP_BASEDOMAIM=https://ylst-h5-uat.dctest.digitalyili.com
|
||||||
VITE_APP_ENV=uat
|
VITE_APP_ENV=uat
|
||||||
VITE_APP_CURRENTMODE=uat
|
VITE_APP_CURRENTMODE=uat
|
||||||
VITE_APP_BASEOSS=https://diaoyan-files.automark.cc
|
VITE_APP_BASEOSS=https://diaoyan-files.automark.cc
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
|
@import 'theme';
|
||||||
@import 'base';
|
@import 'base';
|
||||||
@import '../../fonts/iconfont.css';
|
@import '../../fonts/iconfont.css';
|
||||||
@import 'vant';
|
|
||||||
@import '../../fonts/moblie/iconfont.css';
|
@import '../../fonts/moblie/iconfont.css';
|
||||||
|
@import 'public';
|
||||||
|
|
||||||
a,
|
a,
|
||||||
.green {
|
.green {
|
||||||
@@ -15,6 +16,12 @@ a,
|
|||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
//width: 100%;
|
||||||
|
// 绿色 #70B937 白色过渡渐变 竖向 上一半部分 渐变到白色就可以
|
||||||
|
background: linear-gradient(to bottom, $theme-color 200px, #f2f2f2 300px);
|
||||||
|
}
|
||||||
|
|
||||||
@media (hover: hover) {
|
@media (hover: hover) {
|
||||||
a:hover {
|
a:hover {
|
||||||
background-color: hsla(160deg, 100%, 37%, 0.2);
|
background-color: hsla(160deg, 100%, 37%, 0.2);
|
||||||
|
|||||||
33
src/assets/css/public.scss
Normal file
33
src/assets/css/public.scss
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
.van-cell {
|
||||||
|
padding: 8px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.van-divider {
|
||||||
|
margin: 5px 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.van-popup--bottom.van-popup--round {
|
||||||
|
border-radius: 10px 10px 0 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.van-radio-group {
|
||||||
|
& .van-radio {
|
||||||
|
.van-radio__icon--checked {
|
||||||
|
.van-icon {
|
||||||
|
border-color: $theme-color;
|
||||||
|
background-color: $theme-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.van-checkbox-group {
|
||||||
|
& .van-checkbox {
|
||||||
|
.van-checkbox__icon--checked {
|
||||||
|
.van-icon {
|
||||||
|
border-color: $theme-color;
|
||||||
|
background-color: $theme-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
1
src/assets/css/theme.scss
Normal file
1
src/assets/css/theme.scss
Normal file
@@ -0,0 +1 @@
|
|||||||
|
$theme-color: #71b73c;
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
.van-cell {
|
|
||||||
padding: 8px !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.van-divider {
|
|
||||||
margin: 5px 0 !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.van-popup--bottom.van-popup--round {
|
|
||||||
border-radius: 10px 10px 0 0 !important;
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
// src/config.js
|
// src/config.js
|
||||||
export default {
|
export default {
|
||||||
proxyUrl: import.meta.env.VITE_APP_BASEURL,
|
proxyUrl: import.meta.env.VITE_APP_BASEURL,
|
||||||
|
proxyDomain: import.meta.env.VITE_APP_BASEDOMAIM,
|
||||||
proxyUrlDelivery: import.meta.env.VITE_APP_DELIVERY_BASEURL,
|
proxyUrlDelivery: import.meta.env.VITE_APP_DELIVERY_BASEURL,
|
||||||
proxyUrlMessageCenter: import.meta.env.VITE_APP_MESSAGE_CENTER,
|
proxyUrlMessageCenter: import.meta.env.VITE_APP_MESSAGE_CENTER,
|
||||||
baseOss: import.meta.env.VITE_APP_BASEOSS,
|
baseOss: import.meta.env.VITE_APP_BASEOSS,
|
||||||
@@ -8,7 +9,8 @@ export default {
|
|||||||
socketUrl: import.meta.env.VITE_APP_SOCKETURL,
|
socketUrl: import.meta.env.VITE_APP_SOCKETURL,
|
||||||
jsonpUrl: import.meta.env.VITE_APP_JSONPURL,
|
jsonpUrl: import.meta.env.VITE_APP_JSONPURL,
|
||||||
jqrUrl: import.meta.env.VITE_APP_YQRURL,
|
jqrUrl: import.meta.env.VITE_APP_YQRURL,
|
||||||
currentMode: import.meta.env.VITE_APP_CURRENTMODE
|
currentMode: import.meta.env.VITE_APP_CURRENTMODE,
|
||||||
|
proxyDomain: import.meta.env.VITE_APP_BASEDOMAIM || ''
|
||||||
// appKey: import.meta.env.VITE_APP_APPKEY,
|
// appKey: import.meta.env.VITE_APP_APPKEY,
|
||||||
// appId: import.meta.env.VITE_APP_APPID
|
// appId: import.meta.env.VITE_APP_APPID
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
export default {
|
export default {
|
||||||
proxyUrl: process.env.VUE_APP_BASEURL,
|
proxyUrl: process.env.VUE_APP_BASEURL,
|
||||||
|
proxyDomain: process.env.VITE_APP_BASEDOMAIM,
|
||||||
proxyUrlDelivery: process.env.VUE_APP_DELiVERY_BASEURL,
|
proxyUrlDelivery: process.env.VUE_APP_DELiVERY_BASEURL,
|
||||||
proxyUrlMessageCenter: process.env.VUE_APP_MESSAGE_CENTER,
|
proxyUrlMessageCenter: process.env.VUE_APP_MESSAGE_CENTER,
|
||||||
baseOss: process.env.VUE_APP_BASEOSS,
|
baseOss: process.env.VUE_APP_BASEOSS,
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<div class="common-layout">
|
<div class="common-layout">
|
||||||
<!-- title 标题和搜索栏 -->
|
<!-- title 标题和搜索栏 -->
|
||||||
<header class="header">
|
<header class="header">
|
||||||
<div class="title">{{ $route.meta.title }}</div>
|
<!-- <div class="title">{{ $route.meta.title }}</div> -->
|
||||||
<van-search placeholder="请输入搜索关键词" background="#A5D380" />
|
<van-search placeholder="请输入搜索关键词" background="#A5D380" />
|
||||||
</header>
|
</header>
|
||||||
<!-- content -->
|
<!-- content -->
|
||||||
@@ -30,9 +30,9 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { RouterView, useRouter } from 'vue-router';
|
import { RouterView, useRouter } from 'vue-router';
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
// import utils from '@/assets/js/common';
|
import utils from '@/assets/js/common';
|
||||||
// import { getUserInfo } from '@/api/common/index.js';
|
import { getUserInfo } from '@/api/common/index.js';
|
||||||
// import { showFailToast } from 'vant';
|
import { showFailToast } from 'vant';
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
const active = ref();
|
const active = ref();
|
||||||
@@ -59,28 +59,29 @@ const table = [
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
function tabPath(path) {
|
function tabPath(path) {
|
||||||
|
if (utils.getParameter('digitalYiliToken')) {
|
||||||
|
const appToken = utils.getParameter('digitalYiliToken');
|
||||||
|
getUserInfo(appToken)
|
||||||
|
.then((res) => {
|
||||||
|
if (res.data) {
|
||||||
|
utils.setSessionStorage('userInfo', res.data.data);
|
||||||
router.push({
|
router.push({
|
||||||
path
|
path
|
||||||
});
|
});
|
||||||
// if (utils.getParameter('digitalYiliToken')) {
|
} else {
|
||||||
// const appToken = utils.getParameter('digitalYiliToken');
|
showFailToast(
|
||||||
// getUserInfo(appToken).then((res) => {
|
error.response.data?.message || error.data?.message || error.message || '服务器错误'
|
||||||
// if (res.data) {
|
);
|
||||||
// utils.setSessionStorage('userInfo', res.data.data);
|
}
|
||||||
// router.push({
|
})
|
||||||
// path
|
.catch((error) => {
|
||||||
// });
|
showFailToast(error?.response?.data?.message || error?.message || '服务器错误');
|
||||||
// } else {
|
});
|
||||||
// showFailToast(error.response.data?.message || error.data?.message || error.message || '服务器错误');
|
} else {
|
||||||
// }
|
router.push({
|
||||||
// }).catch((error) => {
|
path
|
||||||
// showFailToast(error?.response?.data?.message || error?.message || '服务器错误');
|
});
|
||||||
// });
|
}
|
||||||
// } else {
|
|
||||||
// router.push({
|
|
||||||
// path
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -46,13 +46,13 @@ function showModal(options) {
|
|||||||
* @param {*} data
|
* @param {*} data
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
const canPlanetPublishPSM = function(data) {
|
const canPlanetPublishPSM = function (data) {
|
||||||
let isFb = true;
|
let isFb = true;
|
||||||
let content = '';
|
let content = '';
|
||||||
let title = '题目设置未完成';
|
let title = '题目设置未完成';
|
||||||
const incompleteQuestionList = [];
|
const incompleteQuestionList = [];
|
||||||
data.questions
|
data.questions &&
|
||||||
&& data.questions.forEach((s) => {
|
data.questions.forEach((s) => {
|
||||||
if (s.question_type === 101 && s.config.price_gradient.length <= 0) {
|
if (s.question_type === 101 && s.config.price_gradient.length <= 0) {
|
||||||
isFb = false;
|
isFb = false;
|
||||||
content = 'psm题目未完成设置,请设置价格区间后投放';
|
content = 'psm题目未完成设置,请设置价格区间后投放';
|
||||||
@@ -77,15 +77,15 @@ const canPlanetPublishPSM = function(data) {
|
|||||||
* @param {*} data
|
* @param {*} data
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
const canPlanetPublishMxdAndHotArea = function(data) {
|
const canPlanetPublishMxdAndHotArea = function (data) {
|
||||||
let isFb = true;
|
let isFb = true;
|
||||||
let content = '';
|
let content = '';
|
||||||
const qSteams = [];
|
const qSteams = [];
|
||||||
const incompleteQuestionList = [];
|
const incompleteQuestionList = [];
|
||||||
let type = 0;
|
let type = 0;
|
||||||
let title = '题目设置未完成';
|
let title = '题目设置未完成';
|
||||||
data.questions
|
data.questions &&
|
||||||
&& data.questions.forEach((s) => {
|
data.questions.forEach((s) => {
|
||||||
if (s.question_type === 105 && s.config.design_version <= 0) {
|
if (s.question_type === 105 && s.config.design_version <= 0) {
|
||||||
isFb = false;
|
isFb = false;
|
||||||
content = 'maxdiff题目未完成设置,请生成设计后投放';
|
content = 'maxdiff题目未完成设置,请生成设计后投放';
|
||||||
@@ -124,14 +124,14 @@ const canPlanetPublishMxdAndHotArea = function(data) {
|
|||||||
* @param {*} data
|
* @param {*} data
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
const canPlanetPublish3D = function(data) {
|
const canPlanetPublish3D = function (data) {
|
||||||
{
|
{
|
||||||
let canFB = true;
|
let canFB = true;
|
||||||
let content = '';
|
let content = '';
|
||||||
const qSteams = [];
|
const qSteams = [];
|
||||||
let title = '';
|
let title = '';
|
||||||
data.questions
|
data.questions &&
|
||||||
&& data.questions.forEach((s) => {
|
data.questions.forEach((s) => {
|
||||||
if (QUESTION_TYPE.contains(s.question_type)) {
|
if (QUESTION_TYPE.contains(s.question_type)) {
|
||||||
try {
|
try {
|
||||||
if (s.config.is_three_dimensions && !s.config.scene) {
|
if (s.config.is_three_dimensions && !s.config.scene) {
|
||||||
@@ -161,15 +161,15 @@ const canPlanetPublish3D = function(data) {
|
|||||||
let content = '';
|
let content = '';
|
||||||
const qSteams = [];
|
const qSteams = [];
|
||||||
let title = '';
|
let title = '';
|
||||||
data.questions
|
data.questions &&
|
||||||
&& data.questions.forEach((s) => {
|
data.questions.forEach((s) => {
|
||||||
if (QUESTION_TYPE.contains(s.question_type)) {
|
if (QUESTION_TYPE.contains(s.question_type)) {
|
||||||
try {
|
try {
|
||||||
if (s.config.is_three_dimensions && s.config.is_binding_goods) {
|
if (s.config.is_three_dimensions && s.config.is_binding_goods) {
|
||||||
const wares = [];
|
const wares = [];
|
||||||
const _sceneInformation = s.config.scene_information;
|
const _sceneInformation = s.config.scene_information;
|
||||||
const sceneInformation
|
const sceneInformation =
|
||||||
= typeof _sceneInformation === 'string'
|
typeof _sceneInformation === 'string'
|
||||||
? JSON.parse(_sceneInformation)
|
? JSON.parse(_sceneInformation)
|
||||||
: _sceneInformation;
|
: _sceneInformation;
|
||||||
sceneInformation.shelves.forEach((shelf) => {
|
sceneInformation.shelves.forEach((shelf) => {
|
||||||
@@ -221,14 +221,14 @@ const canPlanetPublish3D = function(data) {
|
|||||||
* @param {*} data
|
* @param {*} data
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
const canPlanetPublishImage = function(data) {
|
const canPlanetPublishImage = function (data) {
|
||||||
{
|
{
|
||||||
let canFB = true;
|
let canFB = true;
|
||||||
let content = '';
|
let content = '';
|
||||||
const qSteams = [];
|
const qSteams = [];
|
||||||
let title = '';
|
let title = '';
|
||||||
data.questions
|
data.questions &&
|
||||||
&& data.questions.forEach((s) => {
|
data.questions.forEach((s) => {
|
||||||
if (s.question_type === 13) {
|
if (s.question_type === 13) {
|
||||||
try {
|
try {
|
||||||
if (s.options.length <= 0 || s.options.some((y) => y.length <= 0)) {
|
if (s.options.length <= 0 || s.options.some((y) => y.length <= 0)) {
|
||||||
@@ -236,7 +236,7 @@ const canPlanetPublishImage = function(data) {
|
|||||||
qSteams.push(`(${s.title})`);
|
qSteams.push(`(${s.title})`);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.warn(error);
|
// 错误返回
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -323,8 +323,8 @@ function canPublishRandom(data, publishType) {
|
|||||||
if (!isValidated) {
|
if (!isValidated) {
|
||||||
errors.push({
|
errors.push({
|
||||||
message:
|
message:
|
||||||
field.message
|
field.message ||
|
||||||
|| `请填写“${random.title}”中第${index + 1}组“随机题组”的“${field.name}”`
|
`请填写“${random.title}”中第${index + 1}组“随机题组”的“${field.name}”`
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -378,7 +378,7 @@ function canPublishRandom(data, publishType) {
|
|||||||
// return false;
|
// return false;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
export const canPlanetPublish = async function(sn, publishType) {
|
export const canPlanetPublish = async function (sn, publishType) {
|
||||||
const parsedPublishType = !publishType ? 2 : publishType;
|
const parsedPublishType = !publishType ? 2 : publishType;
|
||||||
|
|
||||||
const num = window.location.href.indexOf('code=');
|
const num = window.location.href.indexOf('code=');
|
||||||
|
|||||||
29
src/main.ts
29
src/main.ts
@@ -3,16 +3,25 @@ import 'amfe-flexible';
|
|||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
import { createPinia } from 'pinia';
|
import { createPinia } from 'pinia';
|
||||||
import App from './App.vue';
|
import App from './App.vue';
|
||||||
|
import 'vant/lib/index.css';
|
||||||
|
|
||||||
import router from './router';
|
import router from './router';
|
||||||
import utils from '@/assets/js/common';
|
import utils from '@/assets/js/common';
|
||||||
// 2. 引入组件样式
|
// 2. 引入组件样式
|
||||||
import 'vant/lib/index.css';
|
|
||||||
import appBridge from '@/assets/js/appBridge';
|
import appBridge from '@/assets/js/appBridge';
|
||||||
import VConsole from 'vconsole';
|
import VConsole from 'vconsole';
|
||||||
let vconsole;
|
let vconsole;
|
||||||
if (import.meta.env.VITE_APP_ENV !== 'production') {
|
if (import.meta.env.VITE_APP_ENV !== 'production') {
|
||||||
vconsole = new VConsole();
|
vconsole = new VConsole();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 添加 TypeScript 类型声明,在文件顶部添加
|
||||||
|
declare global {
|
||||||
|
interface Window {
|
||||||
|
onAndroidBack: () => void;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
router.beforeEach((to, from, next) => {
|
router.beforeEach((to, from, next) => {
|
||||||
if (to.query.digitalYiliToken) {
|
if (to.query.digitalYiliToken) {
|
||||||
utils.setSessionStorage('xToken', to.query.digitalYiliToken);
|
utils.setSessionStorage('xToken', to.query.digitalYiliToken);
|
||||||
@@ -24,3 +33,21 @@ const app = createApp(App);
|
|||||||
app.use(createPinia());
|
app.use(createPinia());
|
||||||
app.use(router);
|
app.use(router);
|
||||||
app.mount('#app');
|
app.mount('#app');
|
||||||
|
// 定义路由是否可以返回的判断
|
||||||
|
const routerCanGoBack = () => {
|
||||||
|
const position = router.options.history.state?.position;
|
||||||
|
return typeof position === 'number' && position > 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
// 定义调用APP返回的方法
|
||||||
|
const callAppGoBack = () => {
|
||||||
|
appBridge.navigateBack(); // 使用现有的navigateBack方法替代不存在的goBack方法
|
||||||
|
};
|
||||||
|
// 添加 Android 返回按钮监听方法
|
||||||
|
window.onAndroidBack = () => {
|
||||||
|
if (routerCanGoBack()) {
|
||||||
|
router.back(); // 使用 router.back() 而不是 router.goBack(),因为 Vue Router 使用 back() 方法
|
||||||
|
} else {
|
||||||
|
callAppGoBack(); // 调用 APP 的返回方法
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -1,331 +1,87 @@
|
|||||||
|
import {
|
||||||
|
radio,
|
||||||
|
checkbox,
|
||||||
|
completion,
|
||||||
|
rate,
|
||||||
|
martrixQuestion,
|
||||||
|
fileUpload,
|
||||||
|
textWithImages,
|
||||||
|
signQuestion,
|
||||||
|
nps
|
||||||
|
} from '@/utils/importJsons';
|
||||||
const basicQuesTypeList = [
|
const basicQuesTypeList = [
|
||||||
{
|
{
|
||||||
name: '选择题',
|
icon: '',
|
||||||
icon: '',
|
name: '单选题',
|
||||||
check: false,
|
question_type: 1,
|
||||||
type: 1,
|
json: radio
|
||||||
childTypes: [1, 2]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '级联题',
|
icon: '',
|
||||||
icon: '',
|
name: '多选题',
|
||||||
check: false,
|
question_type: 2,
|
||||||
type: 3,
|
json: checkbox
|
||||||
childTypes: [3]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '填空题',
|
|
||||||
icon: '',
|
|
||||||
check: false,
|
|
||||||
type: 4,
|
|
||||||
childTypes: [4]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '多项填空题',
|
|
||||||
icon: '',
|
|
||||||
check: false,
|
|
||||||
type: 27,
|
|
||||||
childTypes: [27]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '打分题',
|
|
||||||
icon: '',
|
|
||||||
check: false,
|
|
||||||
type: 5,
|
|
||||||
childTypes: [5]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '矩阵题',
|
|
||||||
icon: '',
|
|
||||||
check: false,
|
|
||||||
type: 9,
|
|
||||||
childTypes: [8, 9, 10, 11]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '图片题',
|
|
||||||
icon: '',
|
|
||||||
check: false,
|
|
||||||
type: 13,
|
|
||||||
childTypes: [12, 13, 14]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '分类题',
|
|
||||||
icon: '',
|
|
||||||
check: false,
|
|
||||||
type: 15,
|
|
||||||
childTypes: [15]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '排序题',
|
|
||||||
icon: '',
|
|
||||||
check: false,
|
|
||||||
type: 16,
|
|
||||||
childTypes: [16]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '图文说明题',
|
|
||||||
icon: '',
|
|
||||||
check: false,
|
|
||||||
type: 6,
|
|
||||||
childTypes: [6]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '日期/时间',
|
|
||||||
icon: '',
|
|
||||||
check: false,
|
|
||||||
type: 7,
|
|
||||||
childTypes: [7]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '恒定总和题',
|
|
||||||
icon: '',
|
|
||||||
check: false,
|
|
||||||
type: 17,
|
|
||||||
childTypes: [17]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '文件上传题',
|
|
||||||
icon: '',
|
|
||||||
check: false,
|
|
||||||
type: 18,
|
|
||||||
childTypes: [18]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '热区题',
|
|
||||||
icon: '',
|
|
||||||
check: false,
|
|
||||||
type: 25,
|
|
||||||
childTypes: [25, 56]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'NPS',
|
|
||||||
icon: '',
|
|
||||||
check: false,
|
|
||||||
type: 106,
|
|
||||||
childTypes: [106]
|
|
||||||
}
|
|
||||||
];
|
|
||||||
const quickQuesTypeList = [
|
|
||||||
{
|
|
||||||
name: '姓名',
|
|
||||||
icon: '',
|
|
||||||
check: false,
|
|
||||||
type: 4,
|
|
||||||
quickType: 6
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '性别',
|
|
||||||
icon: '',
|
|
||||||
check: false,
|
|
||||||
type: 1,
|
|
||||||
quickType: 7
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '手机号',
|
|
||||||
icon: '',
|
|
||||||
check: false,
|
|
||||||
type: 20
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '身份证号',
|
|
||||||
icon: '',
|
|
||||||
check: false,
|
|
||||||
type: 4,
|
|
||||||
quickType: 2
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '邮箱',
|
|
||||||
icon: '',
|
|
||||||
check: false,
|
|
||||||
type: 4,
|
|
||||||
quickType: 8
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '年龄',
|
|
||||||
icon: '',
|
|
||||||
check: false,
|
|
||||||
type: 4,
|
|
||||||
quickType: 9
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '年龄段',
|
|
||||||
icon: '',
|
|
||||||
check: false,
|
|
||||||
type: 1,
|
|
||||||
quickType: 10
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '生日',
|
|
||||||
icon: '',
|
|
||||||
check: false,
|
|
||||||
type: 7,
|
|
||||||
quickType: 11
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '学历',
|
|
||||||
icon: '',
|
|
||||||
check: false,
|
|
||||||
type: 1,
|
|
||||||
quickType: 12
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '院校',
|
|
||||||
icon: '',
|
|
||||||
check: false,
|
|
||||||
type: 3,
|
|
||||||
quickType: 13
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '专业',
|
|
||||||
icon: '',
|
|
||||||
check: false,
|
|
||||||
type: 3,
|
|
||||||
quickType: 14
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '行业',
|
|
||||||
icon: '',
|
|
||||||
check: false,
|
|
||||||
type: 1,
|
|
||||||
quickType: 15
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '地理位置',
|
|
||||||
icon: '',
|
icon: '',
|
||||||
check: false,
|
name: '填空题',
|
||||||
type: 19,
|
question_type: 4,
|
||||||
quickType: 16
|
json: completion
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '省份',
|
|
||||||
icon: '',
|
|
||||||
check: false,
|
|
||||||
type: 3,
|
|
||||||
quickType: 3
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '省市',
|
|
||||||
icon: '',
|
|
||||||
check: false,
|
|
||||||
type: 3,
|
|
||||||
quickType: 4
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '省市区/县',
|
|
||||||
icon: '',
|
|
||||||
check: false,
|
|
||||||
type: 3,
|
|
||||||
quickType: 5
|
|
||||||
},
|
},
|
||||||
// {
|
// {
|
||||||
// type: 21,
|
// icon: 'phone-o',
|
||||||
// quickType: 21,
|
// name: '图形打分',
|
||||||
// name: "密码",
|
// question_type: '4',
|
||||||
// icon: "",
|
// json: rate
|
||||||
// check: false,
|
|
||||||
// },
|
// },
|
||||||
{
|
{
|
||||||
type: 22,
|
icon: '',
|
||||||
name: '签名题',
|
name: '数值打分',
|
||||||
icon: '',
|
question_type: 5,
|
||||||
check: false
|
json: rate
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 23,
|
icon: '𓱿',
|
||||||
name: '知情同意书',
|
name: '矩阵单选',
|
||||||
icon: '',
|
question_type: 9,
|
||||||
check: false
|
json: martrixQuestion
|
||||||
}
|
|
||||||
];
|
|
||||||
const advancedQuesTypeList = [
|
|
||||||
{
|
|
||||||
name: 'Maxdiff',
|
|
||||||
icon: '',
|
|
||||||
check: false,
|
|
||||||
type: 105
|
|
||||||
},
|
|
||||||
// {
|
|
||||||
// name: "CBC",
|
|
||||||
// icon: "",
|
|
||||||
// check: false,
|
|
||||||
// type: 103,
|
|
||||||
// },
|
|
||||||
// // {
|
|
||||||
// // name: "BPTO",
|
|
||||||
// // icon: "",
|
|
||||||
// // check: false,
|
|
||||||
// // type: 104,
|
|
||||||
// // },
|
|
||||||
{
|
|
||||||
name: 'PSM',
|
|
||||||
icon: '',
|
|
||||||
check: false,
|
|
||||||
type: 101
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'KANO',
|
icon: '',
|
||||||
icon: '',
|
name: '矩阵多选',
|
||||||
check: false,
|
question_type: 10,
|
||||||
type: 102
|
json: martrixQuestion
|
||||||
}
|
|
||||||
];
|
|
||||||
const d3QuestypeList = [
|
|
||||||
{
|
|
||||||
name: 'ID test',
|
|
||||||
icon: '',
|
|
||||||
check: false,
|
|
||||||
type: 200
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Experiment',
|
icon: '',
|
||||||
icon: '',
|
name: '矩阵填空',
|
||||||
check: false,
|
question_type: 8,
|
||||||
type: 201
|
json: martrixQuestion
|
||||||
}
|
|
||||||
];
|
|
||||||
const uxSimuatorQuestypeList = [
|
|
||||||
{
|
|
||||||
name: 'UI',
|
|
||||||
icon: '',
|
|
||||||
check: false,
|
|
||||||
type: 202
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Prototype',
|
icon: '',
|
||||||
icon: '',
|
name: '文件上传',
|
||||||
check: false,
|
question_type: 18,
|
||||||
type: 203
|
json: fileUpload
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'UE',
|
icon: '',
|
||||||
icon: '',
|
name: '图文说明',
|
||||||
check: false,
|
question_type: 6,
|
||||||
type: 204
|
json: textWithImages
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon: '',
|
||||||
|
name: '签名',
|
||||||
|
question_type: 22,
|
||||||
|
json: signQuestion
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon: '',
|
||||||
|
name: 'NPS',
|
||||||
|
question_type: 106,
|
||||||
|
json: nps
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
function getIcon(item) {
|
export { basicQuesTypeList };
|
||||||
let icon = '';
|
|
||||||
|
|
||||||
if (item.config.quick_type === 0) {
|
|
||||||
icon = basicQuesTypeList?.find((x) => x?.childTypes.includes(item?.question_type))?.icon || '';
|
|
||||||
if (!icon) {
|
|
||||||
icon = quickQuesTypeList?.find((x) => x?.type === item?.question_type)?.icon || '';
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
icon = quickQuesTypeList?.find((x) => x?.quickType === item?.config?.quick_type)?.icon || '';
|
|
||||||
}
|
|
||||||
if (!icon) {
|
|
||||||
icon = advancedQuesTypeList?.find((x) => x?.type === item?.question_type)?.icon || '';
|
|
||||||
}
|
|
||||||
return icon;
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
basicQuesTypeList,
|
|
||||||
quickQuesTypeList,
|
|
||||||
advancedQuesTypeList,
|
|
||||||
d3QuestypeList,
|
|
||||||
uxSimuatorQuestypeList,
|
|
||||||
getIcon
|
|
||||||
};
|
|
||||||
|
|||||||
@@ -439,7 +439,7 @@ onMounted(() => {
|
|||||||
|
|
||||||
.design-create {
|
.design-create {
|
||||||
//min-height: calc(100vh);
|
//min-height: calc(100vh);
|
||||||
background-color: #e9eef3;
|
//background-color: #e9eef3;
|
||||||
color: #333;
|
color: #333;
|
||||||
|
|
||||||
.slot-actions {
|
.slot-actions {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="container question-action-container flex">
|
<div class="question-action-container flex">
|
||||||
<van-icon name="clear" @click="deleteQuestion"></van-icon>
|
<van-icon name="clear" @click="deleteQuestion"></van-icon>
|
||||||
<van-icon name="setting" @click="openQuestionSettingModel"></van-icon>
|
<van-icon name="setting" @click="openQuestionSettingModel"></van-icon>
|
||||||
<van-icon name="more" @click="openQuestionActionModel"></van-icon>
|
<van-icon name="more" @click="openQuestionActionModel"></van-icon>
|
||||||
|
|||||||
@@ -6,6 +6,11 @@
|
|||||||
:class="chooseQuestionId === element.id ? 'choose-question-active' : ''"
|
:class="chooseQuestionId === element.id ? 'choose-question-active' : ''"
|
||||||
@click="chooseItem"
|
@click="chooseItem"
|
||||||
>
|
>
|
||||||
|
<van-cell>
|
||||||
|
<template #title>
|
||||||
|
<span class="title"> {{ getQuestionType(element.question_type) }}</span>
|
||||||
|
</template>
|
||||||
|
</van-cell>
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
<!-- 题目操作-->
|
<!-- 题目操作-->
|
||||||
<van-cell v-if="chooseQuestionId === element.id" class="choose-question-active-container">
|
<van-cell v-if="chooseQuestionId === element.id" class="choose-question-active-container">
|
||||||
@@ -36,6 +41,8 @@
|
|||||||
import QuestionAction from '@/views/Design/components/ActionCompoents/QuestionAction.vue';
|
import QuestionAction from '@/views/Design/components/ActionCompoents/QuestionAction.vue';
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
|
|
||||||
|
import { basicQuesTypeList } from '@/utils/common.js';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
element: {
|
element: {
|
||||||
type: Object,
|
type: Object,
|
||||||
@@ -60,6 +67,18 @@ const props = defineProps({
|
|||||||
default: true
|
default: true
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 获取题目选项
|
||||||
|
const getQuestionType = (type) => {
|
||||||
|
let typeName = null;
|
||||||
|
basicQuesTypeList.map((item) => {
|
||||||
|
if (Number(item.question_type) === Number(type)) {
|
||||||
|
typeName = item.name;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return typeName;
|
||||||
|
};
|
||||||
|
|
||||||
const element = ref(props.element);
|
const element = ref(props.element);
|
||||||
|
|
||||||
// 选中题目后出现的操作
|
// 选中题目后出现的操作
|
||||||
@@ -72,12 +91,35 @@ const chooseItem = () => {
|
|||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
@import '@/assets/css/theme';
|
||||||
|
|
||||||
.choose-question-container {
|
.choose-question-container {
|
||||||
padding: 5px;
|
padding: 12px;
|
||||||
|
|
||||||
& .choose-question-context {
|
& .choose-question-context {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
padding: 10px;
|
||||||
|
border-radius: 8px;
|
||||||
|
background: #fff;
|
||||||
|
|
||||||
|
& .title {
|
||||||
|
position: relative;
|
||||||
|
font-weight: 700;
|
||||||
|
font-size: 14px;
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
content: ' ';
|
||||||
|
position: absolute;
|
||||||
|
|
||||||
|
//padding: 0 5px;
|
||||||
|
bottom: -4px;
|
||||||
|
left: -1px;
|
||||||
|
width: 100%;
|
||||||
|
height: 7px;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
|
background: linear-gradient(to right, $theme-color 10%, #f2f2f2 100%);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
& .choose-question-active {
|
& .choose-question-active {
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
</template>
|
</template>
|
||||||
</option-action>
|
</option-action>
|
||||||
</van-radio-group>
|
</van-radio-group>
|
||||||
<van-checkbox-group v-if="element.question_type === 2" shape="square">
|
<van-checkbox-group v-if="element.question_type === 2" v-model="value" shape="square">
|
||||||
<option-action
|
<option-action
|
||||||
v-model:data="element.options[optionIndex]"
|
v-model:data="element.options[optionIndex]"
|
||||||
:active="active"
|
:active="active"
|
||||||
@@ -96,6 +96,7 @@ const props = defineProps({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
const { element } = toRefs(props);
|
const { element } = toRefs(props);
|
||||||
|
const value = ref([]);
|
||||||
const emit = defineEmits(['update:element']);
|
const emit = defineEmits(['update:element']);
|
||||||
const emitValue = () => {
|
const emitValue = () => {
|
||||||
emit('update:element', element.value);
|
emit('update:element', element.value);
|
||||||
|
|||||||
@@ -12,7 +12,8 @@ interface OptionConfigType {
|
|||||||
}
|
}
|
||||||
|
|
||||||
interface OptionType {
|
interface OptionType {
|
||||||
option?: string; // 包含 HTML 标签的字符串,例如 "<p>选项1</p>"
|
// 包含 HTML 标签的字符串,例如 "<p>选项1</p>"
|
||||||
|
option?: string;
|
||||||
is_other?: number;
|
is_other?: number;
|
||||||
is_fixed?: number;
|
is_fixed?: number;
|
||||||
is_remove_other?: number;
|
is_remove_other?: number;
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<van-nav-bar :title="surveyTitle" left-text="" left-arrow @click-left="$router.go(-1)">
|
<van-nav-bar :title="surveyTitle" left-text="" left-arrow @click-left="$router.go(-1)">
|
||||||
<template #right>
|
<template #left>
|
||||||
<van-icon name="ellipsis" size="18" />
|
<van-icon name="arrow-left" size="18" style="color: #fff" />
|
||||||
</template>
|
</template>
|
||||||
</van-nav-bar>
|
</van-nav-bar>
|
||||||
|
|
||||||
@@ -298,17 +298,7 @@ import Design from '@/views/Design/Index.vue';
|
|||||||
import { useCounterStore } from '@/stores/counter';
|
import { useCounterStore } from '@/stores/counter';
|
||||||
import { storeToRefs } from 'pinia';
|
import { storeToRefs } from 'pinia';
|
||||||
import { v4 as uuidv4 } from 'uuid';
|
import { v4 as uuidv4 } from 'uuid';
|
||||||
import {
|
import { basicQuesTypeList } from '@/utils/common';
|
||||||
radio,
|
|
||||||
checkbox,
|
|
||||||
completion,
|
|
||||||
rate,
|
|
||||||
martrixQuestion,
|
|
||||||
fileUpload,
|
|
||||||
textWithImages,
|
|
||||||
signQuestion,
|
|
||||||
nps
|
|
||||||
} from '@/utils/importJsons';
|
|
||||||
import { useRoute, useRouter } from 'vue-router';
|
import { useRoute, useRouter } from 'vue-router';
|
||||||
import YLPicker from '@/components/YLPicker.vue';
|
import YLPicker from '@/components/YLPicker.vue';
|
||||||
import { getPages } from '@/utils/public';
|
import { getPages } from '@/utils/public';
|
||||||
@@ -370,80 +360,7 @@ const saveTitle = () => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const quesList = ref([
|
const quesList = ref(basicQuesTypeList);
|
||||||
{
|
|
||||||
icon: '',
|
|
||||||
name: '单选题',
|
|
||||||
question_type: '1',
|
|
||||||
json: radio
|
|
||||||
},
|
|
||||||
{
|
|
||||||
icon: '',
|
|
||||||
name: '多选题',
|
|
||||||
question_type: 2,
|
|
||||||
json: checkbox
|
|
||||||
},
|
|
||||||
{
|
|
||||||
icon: '',
|
|
||||||
name: '填空题',
|
|
||||||
question_type: 4,
|
|
||||||
json: completion
|
|
||||||
},
|
|
||||||
// {
|
|
||||||
// icon: 'phone-o',
|
|
||||||
// name: '图形打分',
|
|
||||||
// question_type: '4',
|
|
||||||
// json: rate
|
|
||||||
// },
|
|
||||||
{
|
|
||||||
icon: '',
|
|
||||||
name: '数值打分',
|
|
||||||
question_type: 5,
|
|
||||||
json: rate
|
|
||||||
},
|
|
||||||
{
|
|
||||||
icon: '𓱿',
|
|
||||||
name: '矩阵单选',
|
|
||||||
question_type: 9,
|
|
||||||
json: martrixQuestion
|
|
||||||
},
|
|
||||||
{
|
|
||||||
icon: '',
|
|
||||||
name: '矩阵多选',
|
|
||||||
question_type: 10,
|
|
||||||
json: martrixQuestion
|
|
||||||
},
|
|
||||||
{
|
|
||||||
icon: '',
|
|
||||||
name: '矩阵填空',
|
|
||||||
question_type: 8,
|
|
||||||
json: martrixQuestion
|
|
||||||
},
|
|
||||||
{
|
|
||||||
icon: '',
|
|
||||||
name: '文件上传',
|
|
||||||
question_type: 18,
|
|
||||||
json: fileUpload
|
|
||||||
},
|
|
||||||
{
|
|
||||||
icon: '',
|
|
||||||
name: '图文说明',
|
|
||||||
question_type: 6,
|
|
||||||
json: textWithImages
|
|
||||||
},
|
|
||||||
{
|
|
||||||
icon: '',
|
|
||||||
name: '签名',
|
|
||||||
question_type: 22,
|
|
||||||
json: signQuestion
|
|
||||||
},
|
|
||||||
{
|
|
||||||
icon: '',
|
|
||||||
name: 'NPS',
|
|
||||||
question_type: 106,
|
|
||||||
json: nps
|
|
||||||
}
|
|
||||||
]);
|
|
||||||
|
|
||||||
const questionEvent = (item) => {
|
const questionEvent = (item) => {
|
||||||
let questionJson = {};
|
let questionJson = {};
|
||||||
@@ -597,14 +514,31 @@ const previewQuestion = () => {
|
|||||||
router.push({ name: 'preview', query: { ...route.query } });
|
router.push({ name: 'preview', query: { ...route.query } });
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(async() => {
|
onMounted(async () => {
|
||||||
await getQuestionDetail();
|
await getQuestionDetail();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
::v-deep .van-nav-bar {
|
||||||
|
background-color: #70b937;
|
||||||
|
color: #fff;
|
||||||
|
|
||||||
|
& .van-nav-bar__content {
|
||||||
|
color: #fff;
|
||||||
|
|
||||||
|
& .van-nav-bar__title {
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .van-hairline--bottom::after {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
.container {
|
.container {
|
||||||
height: 100vh;
|
//height: 100vh;
|
||||||
background-color: #f5f5f5;
|
background-color: #f5f5f5;
|
||||||
|
|
||||||
button {
|
button {
|
||||||
@@ -652,6 +586,8 @@ onMounted(async() => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.ques {
|
.ques {
|
||||||
|
min-height: 70vh;
|
||||||
|
|
||||||
.ques_title {
|
.ques_title {
|
||||||
margin: 20px 0 10px 20px;
|
margin: 20px 0 10px 20px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
|||||||
@@ -111,10 +111,9 @@ type OperateItem = (typeof operateList)[0];
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
function getCode() {
|
function getCode() {
|
||||||
console.log(56, configUrl.proxyUrl);
|
|
||||||
publishInfo.value.img_url
|
publishInfo.value.img_url
|
||||||
= 'https://test-cxp-pubcos.yili.com/uat-yls//survey-api/publish/202503130938138261340.png';
|
= 'https://test-cxp-pubcos.yili.com/uat-yls//survey-api/publish/202503130938138261340.png';
|
||||||
publishInfo.value.url = `${configUrl.proxyUrl}publish?sn=${sn && sn !== undefined ? sn : ''}`;
|
publishInfo.value.url = `${configUrl.proxyDomain}/publish?sn=${sn && sn !== undefined ? sn : ''}`;
|
||||||
publishInfo.value.download_url = {
|
publishInfo.value.download_url = {
|
||||||
title: '问卷下载',
|
title: '问卷下载',
|
||||||
url: 'https://test-cxp-pubcos.yili.com/uat-yls//survey-api/publish/202503130938138261340.png'
|
url: 'https://test-cxp-pubcos.yili.com/uat-yls//survey-api/publish/202503130938138261340.png'
|
||||||
@@ -123,11 +122,10 @@ function getCode() {
|
|||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.data) {
|
if (res.data) {
|
||||||
publishInfo.value = res.data.data || {};
|
publishInfo.value = res.data.data || {};
|
||||||
// console.log(res.data);
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
showFailToast(error.data?.message || error.message || '服务器错误');
|
// showFailToast(error.data?.message || error.message || '服务器错误');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// function fetchInfo() {
|
// function fetchInfo() {
|
||||||
@@ -183,18 +181,16 @@ function shareLink() {
|
|||||||
webpageUrl: publishInfo.value.url,
|
webpageUrl: publishInfo.value.url,
|
||||||
scene: 0 // 朋友圈1 微信好友0
|
scene: 0 // 朋友圈1 微信好友0
|
||||||
};
|
};
|
||||||
|
console.log('shareUrl',publishInfo.value.url)
|
||||||
appBridge.shareToWeChat(params, () => {
|
appBridge.shareToWeChat(params, () => {
|
||||||
/**/
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 下载二维码
|
// 下载二维码
|
||||||
function downLoadImg() {
|
function downLoadImg() {
|
||||||
const { title, url } = publishInfo.value.download_url;
|
const { title, url } = publishInfo.value.download_url;
|
||||||
if (utils.getCookie('xToken')) {
|
if (utils.getSessionStorage('xToken')) {
|
||||||
appBridge.save2Album(url, () => {
|
appBridge.save2Album(url, () => {});
|
||||||
// showSuccessToast('下载成功');
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
const link = document.createElement('a');
|
const link = document.createElement('a');
|
||||||
link.href = url;
|
link.href = url;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { fileURLToPath, URL } from 'node:url';
|
|||||||
import vueJsx from '@vitejs/plugin-vue-jsx';
|
import vueJsx from '@vitejs/plugin-vue-jsx';
|
||||||
import AutoImport from 'unplugin-auto-import/vite';
|
import AutoImport from 'unplugin-auto-import/vite';
|
||||||
import Components from 'unplugin-vue-components/vite';
|
import Components from 'unplugin-vue-components/vite';
|
||||||
import { VantResolver } from 'unplugin-vue-components/resolvers';
|
import { ElementPlusResolver, VantResolver } from 'unplugin-vue-components/resolvers';
|
||||||
import postCssPxToRem from 'postcss-pxtorem';
|
import postCssPxToRem from 'postcss-pxtorem';
|
||||||
export default defineConfig(({ mode }) => {
|
export default defineConfig(({ mode }) => {
|
||||||
// 接收 mode 参数
|
// 接收 mode 参数
|
||||||
@@ -53,8 +53,8 @@ export default defineConfig(({ mode }) => {
|
|||||||
plugins: [
|
plugins: [
|
||||||
vue(),
|
vue(),
|
||||||
vueJsx(),
|
vueJsx(),
|
||||||
AutoImport({ resolvers: [VantResolver()] }),
|
AutoImport({ resolvers: [VantResolver(),ElementPlusResolver()] }),
|
||||||
Components({ resolvers: [VantResolver()] })
|
Components({ resolvers: [VantResolver(),ElementPlusResolver()] })
|
||||||
],
|
],
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
|
|||||||
67
vite.config.ts.timestamp-1741938406006-a35225218530b.mjs
Normal file
67
vite.config.ts.timestamp-1741938406006-a35225218530b.mjs
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user