diff --git a/.env b/.env
index beb75d4..31b90594 100644
--- a/.env
+++ b/.env
@@ -1,5 +1,6 @@
# .env
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_CURRENTMODE=dev
VITE_APP_BASEOSS=https://diaoyan-files.automark.cc
diff --git a/.env.development b/.env.development
index cbd903c..37b3ac5 100644
--- a/.env.development
+++ b/.env.development
@@ -1,5 +1,6 @@
# .env.development
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_CURRENTMODE=dev
VITE_APP_BASEOSS=https://diaoyan-files.automark.cc
diff --git a/.env.uat b/.env.uat
index 1ed3aad..884b858 100644
--- a/.env.uat
+++ b/.env.uat
@@ -1,5 +1,6 @@
# .env.development
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_CURRENTMODE=uat
VITE_APP_BASEOSS=https://diaoyan-files.automark.cc
diff --git a/src/assets/css/main.scss b/src/assets/css/main.scss
index 5725a99..97365b9 100644
--- a/src/assets/css/main.scss
+++ b/src/assets/css/main.scss
@@ -1,7 +1,8 @@
+@import 'theme';
@import 'base';
@import '../../fonts/iconfont.css';
-@import 'vant';
@import '../../fonts/moblie/iconfont.css';
+@import 'public';
a,
.green {
@@ -15,6 +16,12 @@ a,
margin-left: 10px;
}
+.container {
+ //width: 100%;
+ // 绿色 #70B937 白色过渡渐变 竖向 上一半部分 渐变到白色就可以
+ background: linear-gradient(to bottom, $theme-color 200px, #f2f2f2 300px);
+}
+
@media (hover: hover) {
a:hover {
background-color: hsla(160deg, 100%, 37%, 0.2);
diff --git a/src/assets/css/public.scss b/src/assets/css/public.scss
new file mode 100644
index 0000000..56b496d
--- /dev/null
+++ b/src/assets/css/public.scss
@@ -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;
+ }
+ }
+ }
+}
diff --git a/src/assets/css/theme.scss b/src/assets/css/theme.scss
new file mode 100644
index 0000000..020d699
--- /dev/null
+++ b/src/assets/css/theme.scss
@@ -0,0 +1 @@
+$theme-color: #71b73c;
diff --git a/src/assets/css/vant.scss b/src/assets/css/vant.scss
deleted file mode 100644
index 75b5c47..0000000
--- a/src/assets/css/vant.scss
+++ /dev/null
@@ -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;
-}
diff --git a/src/config.js b/src/config.js
index 272cdfc..a69eca6 100644
--- a/src/config.js
+++ b/src/config.js
@@ -1,6 +1,7 @@
// src/config.js
export default {
proxyUrl: import.meta.env.VITE_APP_BASEURL,
+ proxyDomain: import.meta.env.VITE_APP_BASEDOMAIM,
proxyUrlDelivery: import.meta.env.VITE_APP_DELIVERY_BASEURL,
proxyUrlMessageCenter: import.meta.env.VITE_APP_MESSAGE_CENTER,
baseOss: import.meta.env.VITE_APP_BASEOSS,
@@ -8,7 +9,8 @@ export default {
socketUrl: import.meta.env.VITE_APP_SOCKETURL,
jsonpUrl: import.meta.env.VITE_APP_JSONPURL,
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,
// appId: import.meta.env.VITE_APP_APPID
};
diff --git a/src/config.ts b/src/config.ts
index 37db3b8..0661499 100644
--- a/src/config.ts
+++ b/src/config.ts
@@ -1,5 +1,6 @@
export default {
proxyUrl: process.env.VUE_APP_BASEURL,
+ proxyDomain: process.env.VITE_APP_BASEDOMAIM,
proxyUrlDelivery: process.env.VUE_APP_DELiVERY_BASEURL,
proxyUrlMessageCenter: process.env.VUE_APP_MESSAGE_CENTER,
baseOss: process.env.VUE_APP_BASEOSS,
diff --git a/src/layouts/index.vue b/src/layouts/index.vue
index c99bac8..9d900fb 100644
--- a/src/layouts/index.vue
+++ b/src/layouts/index.vue
@@ -2,7 +2,7 @@
@@ -30,9 +30,9 @@
diff --git a/src/layouts/utils.js b/src/layouts/utils.js
index df51d1f..f84cd22 100644
--- a/src/layouts/utils.js
+++ b/src/layouts/utils.js
@@ -46,13 +46,13 @@ function showModal(options) {
* @param {*} data
* @returns
*/
-const canPlanetPublishPSM = function(data) {
+const canPlanetPublishPSM = function (data) {
let isFb = true;
let content = '';
let title = '题目设置未完成';
const incompleteQuestionList = [];
- data.questions
- && data.questions.forEach((s) => {
+ data.questions &&
+ data.questions.forEach((s) => {
if (s.question_type === 101 && s.config.price_gradient.length <= 0) {
isFb = false;
content = 'psm题目未完成设置,请设置价格区间后投放';
@@ -77,15 +77,15 @@ const canPlanetPublishPSM = function(data) {
* @param {*} data
* @returns
*/
-const canPlanetPublishMxdAndHotArea = function(data) {
+const canPlanetPublishMxdAndHotArea = function (data) {
let isFb = true;
let content = '';
const qSteams = [];
const incompleteQuestionList = [];
let type = 0;
let title = '题目设置未完成';
- data.questions
- && data.questions.forEach((s) => {
+ data.questions &&
+ data.questions.forEach((s) => {
if (s.question_type === 105 && s.config.design_version <= 0) {
isFb = false;
content = 'maxdiff题目未完成设置,请生成设计后投放';
@@ -124,14 +124,14 @@ const canPlanetPublishMxdAndHotArea = function(data) {
* @param {*} data
* @returns
*/
-const canPlanetPublish3D = function(data) {
+const canPlanetPublish3D = function (data) {
{
let canFB = true;
let content = '';
const qSteams = [];
let title = '';
- data.questions
- && data.questions.forEach((s) => {
+ data.questions &&
+ data.questions.forEach((s) => {
if (QUESTION_TYPE.contains(s.question_type)) {
try {
if (s.config.is_three_dimensions && !s.config.scene) {
@@ -161,15 +161,15 @@ const canPlanetPublish3D = function(data) {
let content = '';
const qSteams = [];
let title = '';
- data.questions
- && data.questions.forEach((s) => {
+ data.questions &&
+ data.questions.forEach((s) => {
if (QUESTION_TYPE.contains(s.question_type)) {
try {
if (s.config.is_three_dimensions && s.config.is_binding_goods) {
const wares = [];
const _sceneInformation = s.config.scene_information;
- const sceneInformation
- = typeof _sceneInformation === 'string'
+ const sceneInformation =
+ typeof _sceneInformation === 'string'
? JSON.parse(_sceneInformation)
: _sceneInformation;
sceneInformation.shelves.forEach((shelf) => {
@@ -221,14 +221,14 @@ const canPlanetPublish3D = function(data) {
* @param {*} data
* @returns
*/
-const canPlanetPublishImage = function(data) {
+const canPlanetPublishImage = function (data) {
{
let canFB = true;
let content = '';
const qSteams = [];
let title = '';
- data.questions
- && data.questions.forEach((s) => {
+ data.questions &&
+ data.questions.forEach((s) => {
if (s.question_type === 13) {
try {
if (s.options.length <= 0 || s.options.some((y) => y.length <= 0)) {
@@ -236,7 +236,7 @@ const canPlanetPublishImage = function(data) {
qSteams.push(`(${s.title})`);
}
} catch (error) {
- console.warn(error);
+ // 错误返回
}
}
});
@@ -323,8 +323,8 @@ function canPublishRandom(data, publishType) {
if (!isValidated) {
errors.push({
message:
- field.message
- || `请填写“${random.title}”中第${index + 1}组“随机题组”的“${field.name}”`
+ field.message ||
+ `请填写“${random.title}”中第${index + 1}组“随机题组”的“${field.name}”`
});
}
});
@@ -378,7 +378,7 @@ function canPublishRandom(data, publishType) {
// return false;
// }
-export const canPlanetPublish = async function(sn, publishType) {
+export const canPlanetPublish = async function (sn, publishType) {
const parsedPublishType = !publishType ? 2 : publishType;
const num = window.location.href.indexOf('code=');
diff --git a/src/main.ts b/src/main.ts
index 154de2b..6f737d8 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -3,16 +3,25 @@ import 'amfe-flexible';
import { createApp } from 'vue';
import { createPinia } from 'pinia';
import App from './App.vue';
+import 'vant/lib/index.css';
+
import router from './router';
import utils from '@/assets/js/common';
// 2. 引入组件样式
-import 'vant/lib/index.css';
import appBridge from '@/assets/js/appBridge';
import VConsole from 'vconsole';
let vconsole;
if (import.meta.env.VITE_APP_ENV !== 'production') {
vconsole = new VConsole();
}
+
+// 添加 TypeScript 类型声明,在文件顶部添加
+declare global {
+ interface Window {
+ onAndroidBack: () => void;
+ }
+}
+
router.beforeEach((to, from, next) => {
if (to.query.digitalYiliToken) {
utils.setSessionStorage('xToken', to.query.digitalYiliToken);
@@ -24,3 +33,21 @@ const app = createApp(App);
app.use(createPinia());
app.use(router);
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 的返回方法
+ }
+};
\ No newline at end of file
diff --git a/src/utils/common.js b/src/utils/common.js
index 071e970..842ac0b 100644
--- a/src/utils/common.js
+++ b/src/utils/common.js
@@ -1,331 +1,87 @@
+import {
+ radio,
+ checkbox,
+ completion,
+ rate,
+ martrixQuestion,
+ fileUpload,
+ textWithImages,
+ signQuestion,
+ nps
+} from '@/utils/importJsons';
const basicQuesTypeList = [
{
- name: '选择题',
- icon: '',
- check: false,
- type: 1,
- childTypes: [1, 2]
+ icon: '',
+ name: '单选题',
+ question_type: 1,
+ json: radio
},
{
- name: '级联题',
- icon: '',
- check: false,
- type: 3,
- childTypes: [3]
+ icon: '',
+ name: '多选题',
+ question_type: 2,
+ json: checkbox
},
{
- 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: '',
- check: false,
- type: 19,
- quickType: 16
- },
- {
- name: '省份',
- icon: '',
- check: false,
- type: 3,
- quickType: 3
- },
- {
- name: '省市',
- icon: '',
- check: false,
- type: 3,
- quickType: 4
- },
- {
- name: '省市区/县',
- icon: '',
- check: false,
- type: 3,
- quickType: 5
+ name: '填空题',
+ question_type: 4,
+ json: completion
},
// {
- // type: 21,
- // quickType: 21,
- // name: "密码",
- // icon: "",
- // check: false,
+ // icon: 'phone-o',
+ // name: '图形打分',
+ // question_type: '4',
+ // json: rate
// },
{
- type: 22,
- name: '签名题',
- icon: '',
- check: false
+ icon: '',
+ name: '数值打分',
+ question_type: 5,
+ json: rate
},
{
- type: 23,
- name: '知情同意书',
- icon: '',
- check: false
- }
-];
-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
+ icon: '',
+ name: '矩阵单选',
+ question_type: 9,
+ json: martrixQuestion
},
{
- name: 'KANO',
- icon: '',
- check: false,
- type: 102
- }
-];
-const d3QuestypeList = [
- {
- name: 'ID test',
- icon: '',
- check: false,
- type: 200
+ icon: '',
+ name: '矩阵多选',
+ question_type: 10,
+ json: martrixQuestion
},
{
- name: 'Experiment',
- icon: '',
- check: false,
- type: 201
- }
-];
-const uxSimuatorQuestypeList = [
- {
- name: 'UI',
- icon: '',
- check: false,
- type: 202
+ icon: '',
+ name: '矩阵填空',
+ question_type: 8,
+ json: martrixQuestion
},
{
- name: 'Prototype',
- icon: '',
- check: false,
- type: 203
+ icon: '',
+ name: '文件上传',
+ question_type: 18,
+ json: fileUpload
},
{
- name: 'UE',
- icon: '',
- check: false,
- type: 204
+ icon: '',
+ name: '图文说明',
+ question_type: 6,
+ json: textWithImages
+ },
+ {
+ icon: '',
+ name: '签名',
+ question_type: 22,
+ json: signQuestion
+ },
+ {
+ icon: '',
+ name: 'NPS',
+ question_type: 106,
+ json: nps
}
];
-function getIcon(item) {
- 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
-};
+export { basicQuesTypeList };
diff --git a/src/views/Design/Index.vue b/src/views/Design/Index.vue
index da98914..05f73ed 100644
--- a/src/views/Design/Index.vue
+++ b/src/views/Design/Index.vue
@@ -439,7 +439,7 @@ onMounted(() => {
.design-create {
//min-height: calc(100vh);
- background-color: #e9eef3;
+ //background-color: #e9eef3;
color: #333;
.slot-actions {
diff --git a/src/views/Design/components/ActionCompoents/QuestionAction.vue b/src/views/Design/components/ActionCompoents/QuestionAction.vue
index 682f3be..dc5bc16 100644
--- a/src/views/Design/components/ActionCompoents/QuestionAction.vue
+++ b/src/views/Design/components/ActionCompoents/QuestionAction.vue
@@ -1,5 +1,5 @@
-
+
diff --git a/src/views/Design/components/ChooseQuestion.vue b/src/views/Design/components/ChooseQuestion.vue
index c51c0c5..d59344c 100644
--- a/src/views/Design/components/ChooseQuestion.vue
+++ b/src/views/Design/components/ChooseQuestion.vue
@@ -6,6 +6,11 @@
:class="chooseQuestionId === element.id ? 'choose-question-active' : ''"
@click="chooseItem"
>
+
+
+ {{ getQuestionType(element.question_type) }}
+
+
@@ -36,6 +41,8 @@
import QuestionAction from '@/views/Design/components/ActionCompoents/QuestionAction.vue';
import { ref } from 'vue';
+import { basicQuesTypeList } from '@/utils/common.js';
+
const props = defineProps({
element: {
type: Object,
@@ -60,6 +67,18 @@ const props = defineProps({
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);
// 选中题目后出现的操作
@@ -72,12 +91,35 @@ const chooseItem = () => {
};