style:优化字体图标和样式

- 更新移动设备字体图标- 调整公共样式,包括开关、表格、blockquote等- 优化代码高亮样式- 添加新的字体图标样式
This commit is contained in:
陈昱达
2025-03-15 16:17:58 +08:00
parent e81a3a4bfe
commit 4bf37ae4da
56 changed files with 857 additions and 754 deletions

2
components.d.ts vendored
View File

@@ -23,6 +23,8 @@ declare module 'vue' {
VanCol: typeof import('vant/es')['Col'] VanCol: typeof import('vant/es')['Col']
VanDivider: typeof import('vant/es')['Divider'] VanDivider: typeof import('vant/es')['Divider']
VanField: typeof import('vant/es')['Field'] VanField: typeof import('vant/es')['Field']
VanGrid: typeof import('vant/es')['Grid']
VanGridItem: typeof import('vant/es')['GridItem']
VanIcon: typeof import('vant/es')['Icon'] VanIcon: typeof import('vant/es')['Icon']
VanNavBar: typeof import('vant/es')['NavBar'] VanNavBar: typeof import('vant/es')['NavBar']
VanPicker: typeof import('vant/es')['Picker'] VanPicker: typeof import('vant/es')['Picker']

View File

@@ -4,7 +4,7 @@ import { onMounted } from 'vue';
import appBridge from '@/assets/js/appBridge'; import appBridge from '@/assets/js/appBridge';
import utils from '@/assets/js/common'; import utils from '@/assets/js/common';
onMounted(async () => { onMounted(async() => {
if (utils.getParameter('digitalYiliToken')) { if (utils.getParameter('digitalYiliToken')) {
// 隐藏/显示 header // 隐藏/显示 header
appBridge.setHeaderShown(false); appBridge.setHeaderShown(false);

View File

@@ -32,6 +32,10 @@
} }
} }
.van-switch--on{
background: $theme-color;
}
.van-toast { .van-toast {
padding: 10px 16px !important; padding: 10px 16px !important;
border-radius: 5px !important; border-radius: 5px !important;

BIN
src/assets/img/empty.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View File

@@ -170,8 +170,8 @@ const getMaxDateLimit = computed(() => {
props.format props.format
); );
const tempStr = '0000-12-31 23:59:59'; const tempStr = '0000-12-31 23:59:59';
const result = const result
props.maxDate.length !== 0 && thisMax.length > props.maxDate.length = props.maxDate.length !== 0 && thisMax.length > props.maxDate.length
? thisMax.slice(0, props.maxDate.length) + tempStr.slice(props.maxDate.length) ? thisMax.slice(0, props.maxDate.length) + tempStr.slice(props.maxDate.length)
: thisMax; : thisMax;
return result.slice(0, props.format.length); return result.slice(0, props.format.length);
@@ -194,8 +194,8 @@ function onChange({ selectedValues, columnIndex }) {
renderMinuteColumns, renderMinuteColumns,
renderSecondColumns renderSecondColumns
]; ];
updateColumns[columnIndex] && updateColumns[columnIndex]
updateColumns[columnIndex](changeValue, getMinDateLimit.value, getMaxDateLimit.value, false); && updateColumns[columnIndex](changeValue, getMinDateLimit.value, getMaxDateLimit.value, false);
} }
// 渲染全部列 // 渲染全部列

View File

@@ -1,5 +1,11 @@
<template> <template>
<div ref="editor" :contenteditable="active" class="van-field" v-html="modelValue"></div> <p
ref="editor"
:contenteditable="active"
class="van-field"
:class="className"
v-html="modelValue"
></p>
<div v-if="showAction && active" ref="editorAction" class="editor-action"> <div v-if="showAction && active" ref="editorAction" class="editor-action">
<button v-for="item in actions" :key="item.name" @click="funEvent(item, $event)"> <button v-for="item in actions" :key="item.name" @click="funEvent(item, $event)">
{{ item.label }} {{ item.label }}
@@ -15,6 +21,10 @@ const props = defineProps({
type: String, type: String,
default: '' default: ''
}, },
className: {
type: String,
default: ''
},
active: { active: {
type: Boolean, type: Boolean,
default: false default: false

View File

@@ -4,11 +4,11 @@
src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834'); src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834');
src: src:
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834#iefix') url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834#iefix')
format('embedded-opentype'), format('embedded-opentype'),
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.woff?t=1545807318834') format('woff'), url('https://at.alicdn.com/t/font_985780_km7mi63cihi.woff?t=1545807318834') format('woff'),
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.ttf?t=1545807318834') format('truetype'), url('https://at.alicdn.com/t/font_985780_km7mi63cihi.ttf?t=1545807318834') format('truetype'),
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.svg?t=1545807318834#iconfont') url('https://at.alicdn.com/t/font_985780_km7mi63cihi.svg?t=1545807318834#iconfont')
format('svg'); format('svg');
src: src:
url('//at.alicdn.com/t/c/font_4841764_vat2jbvw3q.woff2?t=1741575060989') format('woff2'), url('//at.alicdn.com/t/c/font_4841764_vat2jbvw3q.woff2?t=1741575060989') format('woff2'),
url('//at.alicdn.com/t/c/font_4841764_vat2jbvw3q.woff?t=1741575060989') format('woff'), url('//at.alicdn.com/t/c/font_4841764_vat2jbvw3q.woff?t=1741575060989') format('woff'),

View File

@@ -1,15 +1,17 @@
@font-face { @font-face {
font-family: iconfont; /* Project id 3121635 */ font-family: mobilefont; /* Project id 3121635 */
src: src:
url('iconfont.woff2?t=1732174085435') format('woff2'), url('iconfont.woff2?t=1732174085435') format('woff2'),
url('iconfont.woff?t=1732174085435') format('woff'), url('iconfont.woff?t=1732174085435') format('woff'),
url('iconfont.ttf?t=1732174085435') format('truetype'); url('iconfont.ttf?t=1732174085435') format('truetype');
} }
.iconfont {
.mobilefont {
font-style: normal; font-style: normal;
font-size: 16px; font-size: 16px;
font-family: iconfont !important; font-family: mobilefont !important;
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }

View File

@@ -2,13 +2,10 @@
@font-face { @font-face {
font-family: 'iconfont logo'; font-family: 'iconfont logo';
src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834'); src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834');
src: src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834#iefix') format('embedded-opentype'),
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834#iefix')
format('embedded-opentype'),
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.woff?t=1545807318834') format('woff'), url('https://at.alicdn.com/t/font_985780_km7mi63cihi.woff?t=1545807318834') format('woff'),
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.ttf?t=1545807318834') format('truetype'), url('https://at.alicdn.com/t/font_985780_km7mi63cihi.ttf?t=1545807318834') format('truetype'),
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.svg?t=1545807318834#iconfont') url('https://at.alicdn.com/t/font_985780_km7mi63cihi.svg?t=1545807318834#iconfont') format('svg');
format('svg');
} }
.logo { .logo {
@@ -51,6 +48,7 @@
cursor: pointer; cursor: pointer;
} }
#tabs .active { #tabs .active {
border-bottom-color: #f00; border-bottom-color: #f00;
color: #222; color: #222;
@@ -121,15 +119,9 @@
color: #333; color: #333;
font-size: 42px; font-size: 42px;
line-height: 100px; line-height: 100px;
-webkit-transition: -webkit-transition: font-size 0.25s linear, width 0.25s linear;
font-size 0.25s linear, -moz-transition: font-size 0.25s linear, width 0.25s linear;
width 0.25s linear; transition: font-size 0.25s linear, width 0.25s linear;
-moz-transition:
font-size 0.25s linear,
width 0.25s linear;
transition:
font-size 0.25s linear,
width 0.25s linear;
} }
.icon_lists .icon:hover { .icon_lists .icon:hover {
@@ -226,35 +218,35 @@
margin: 1em 0; margin: 1em 0;
} }
.markdown > p, .markdown>p,
.markdown > blockquote, .markdown>blockquote,
.markdown > .highlight, .markdown>.highlight,
.markdown > ol, .markdown>ol,
.markdown > ul { .markdown>ul {
width: 80%; width: 80%;
} }
.markdown ul > li { .markdown ul>li {
list-style: circle; list-style: circle;
} }
.markdown > ul li, .markdown>ul li,
.markdown blockquote ul > li { .markdown blockquote ul>li {
margin-left: 20px; margin-left: 20px;
padding-left: 4px; padding-left: 4px;
} }
.markdown > ul li p, .markdown>ul li p,
.markdown > ol li p { .markdown>ol li p {
margin: 0.6em 0; margin: 0.6em 0;
} }
.markdown ol > li { .markdown ol>li {
list-style: decimal; list-style: decimal;
} }
.markdown > ol li, .markdown>ol li,
.markdown blockquote ol > li { .markdown blockquote ol>li {
margin-left: 20px; margin-left: 20px;
padding-left: 4px; padding-left: 4px;
} }
@@ -271,7 +263,7 @@
font-weight: 600; font-weight: 600;
} }
.markdown > table { .markdown>table {
width: 95%; width: 95%;
margin-bottom: 24px; margin-bottom: 24px;
border: 1px solid #e9e9e9; border: 1px solid #e9e9e9;
@@ -280,21 +272,21 @@
empty-cells: show; empty-cells: show;
} }
.markdown > table th { .markdown>table th {
color: #333; color: #333;
font-weight: 600; font-weight: 600;
white-space: nowrap; white-space: nowrap;
} }
.markdown > table th, .markdown>table th,
.markdown > table td { .markdown>table td {
padding: 8px 16px; padding: 8px 16px;
border: 1px solid #e9e9e9; border: 1px solid #e9e9e9;
text-align: left; text-align: left;
} }
.markdown > table th { .markdown>table th {
background: #f7f7f7; background: #F7F7F7;
} }
.markdown blockquote { .markdown blockquote {
@@ -329,11 +321,12 @@
opacity: 1; opacity: 1;
} }
.markdown > br, .markdown>br,
.markdown > p > br { .markdown>p>br {
clear: both; clear: both;
} }
.hljs { .hljs {
display: block; display: block;
overflow-x: auto; overflow-x: auto;
@@ -458,19 +451,19 @@ code[class*='language-'] ::selection {
/* Code blocks */ /* Code blocks */
pre[class*='language-'] { pre[class*='language-'] {
overflow: auto; overflow: auto;
margin: 0.5em 0; margin: .5em 0;
padding: 1em; padding: 1em;
} }
:not(pre) > code[class*='language-'], :not(pre)>code[class*='language-'],
pre[class*='language-'] { pre[class*='language-'] {
background: #f5f2f0; background: #f5f2f0;
} }
/* Inline code */ /* Inline code */
:not(pre) > code[class*='language-'] { :not(pre)>code[class*='language-'] {
padding: 0.1em; padding: .1em;
border-radius: 0.3em; border-radius: .3em;
white-space: normal; white-space: normal;
} }
@@ -486,7 +479,7 @@ pre[class*='language-'] {
} }
.namespace { .namespace {
opacity: 0.7; opacity: .7;
} }
.token.property, .token.property,
@@ -513,7 +506,7 @@ pre[class*='language-'] {
.token.url, .token.url,
.language-css .token.string, .language-css .token.string,
.style .token.string { .style .token.string {
background: hsla(0deg, 0%, 100%, 0.5); background: hsla(0deg, 0%, 100%, .5);
color: #9a6e3a; color: #9a6e3a;
} }
@@ -525,7 +518,7 @@ pre[class*='language-'] {
.token.function, .token.function,
.token.class-name { .token.class-name {
color: #dd4a68; color: #DD4A68;
} }
.token.regex, .token.regex,

View File

@@ -1,75 +1,103 @@
@font-face { @font-face {
font-family: mobilefont; /* Project id 4841764 */ font-family: mobilefont; /* Project id 4841764 */
src: src: url('iconfont.woff2?t=1742025232194') format('woff2'),
url('iconfont.woff2?t=1741575354833') format('woff2'), url('iconfont.woff?t=1742025232194') format('woff'),
url('iconfont.woff?t=1741575354833') format('woff'), url('iconfont.ttf?t=1742025232194') format('truetype');
url('iconfont.ttf?t=1741575354833') format('truetype');
} }
.mobilefont { .mobilefont {
font-style: normal; font-style: normal;
font-size: 18px; font-size: 16px;
font-family: mobilefont !important; font-family: mobilefont !important;
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }
.icon-radiobox::before { .mobilefont-del1::before {
content: '\e637';
}
.mobilefont-gengduo::before {
content: '\e600';
}
.mobilefont-delete1::before {
content: '\e66d';
}
.mobilefont-del::before {
content: '\e6f5';
}
.mobilefont-option::before {
content: '\e6ff';
}
.mobilefont-setting::before {
content: '\e633';
}
.mobilefont-add::before {
content: '\e686';
}
.mobilefont-radiobox::before {
content: '\e75b'; content: '\e75b';
} }
.icon-juzhendafen::before { .mobilefont-juzhendafen::before {
content: '\e641'; content: '\e641';
} }
.icon-checkbox-checked::before { .mobilefont-checkbox-checked::before {
content: '\e6c3'; content: '\e6c3';
} }
.icon-nps::before { .mobilefont-nps::before {
content: '\e6b0'; content: '\e6b0';
} }
.icon-input::before { .mobilefont-input::before {
content: '\e6fd'; content: '\e6fd';
} }
.icon-juzhentiankong::before { .mobilefont-juzhentiankong::before {
content: '\e62e'; content: '\e62e';
} }
.icon-wenjianshangchuan::before { .mobilefont-wenjianshangchuan::before {
content: '\e631'; content: '\e631';
} }
.icon-qianming::before { .mobilefont-qianming::before {
content: '\e661'; content: '\e661';
} }
.icon-tuwen::before { .mobilefont-tuwen::before {
content: '\e62c'; content: '\e62c';
} }
.icon-juzhenduoxuan::before { .mobilefont-juzhenduoxuan::before {
content: '\e818'; content: '\e818';
} }
.icon-juzhendanxuan::before { .mobilefont-juzhendanxuan::before {
content: '\13c7f'; content: '\13c7f';
} }
.icon-edit2::before { .mobilefont-edit2::before {
content: '\e630'; content: '\e630';
} }
.icon-copy::before { .mobilefont-copy::before {
content: '\e632'; content: '\e632';
} }
.icon-delete::before { .mobilefont-delete::before {
content: '\e63f'; content: '\e63f';
} }
.icon-sort::before { .mobilefont-sort::before {
content: '\e6a0'; content: '\e6a0';
} }

File diff suppressed because one or more lines are too long

View File

@@ -1,10 +1,59 @@
{ {
"id": "4841764", "id": "4841764",
"name": "yl", "name": "yl",
"font_family": "iconfont", "font_family": "mobilefont",
"css_prefix_text": "icon-", "css_prefix_text": "mobilefont-",
"description": "", "description": "",
"glyphs": [ "glyphs": [
{
"icon_id": "6135228",
"name": "del",
"font_class": "del1",
"unicode": "e637",
"unicode_decimal": 58935
},
{
"icon_id": "159969",
"name": "more",
"font_class": "gengduo",
"unicode": "e600",
"unicode_decimal": 58880
},
{
"icon_id": "627633",
"name": "delete",
"font_class": "delete1",
"unicode": "e66d",
"unicode_decimal": 58989
},
{
"icon_id": "669644",
"name": "del",
"font_class": "del",
"unicode": "e6f5",
"unicode_decimal": 59125
},
{
"icon_id": "17956030",
"name": "option",
"font_class": "option",
"unicode": "e6ff",
"unicode_decimal": 59135
},
{
"icon_id": "18261691",
"name": "setting",
"font_class": "setting",
"unicode": "e633",
"unicode_decimal": 58931
},
{
"icon_id": "22873715",
"name": "add",
"font_class": "add",
"unicode": "e686",
"unicode_decimal": 59014
},
{ {
"icon_id": "240132", "icon_id": "240132",
"name": "radio_box", "name": "radio_box",

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -15,64 +15,7 @@
</template> </template>
<script setup> <script setup>
import { RouterView, useRouter } from 'vue-router'; import { RouterView } from 'vue-router';
import { ref } from 'vue';
// import utils from '@/assets/js/common';
// import { getUserInfo } from '@/api/common/index.js';
// import { showFailToast } from 'vant';
const router = useRouter();
const active = ref();
const table = [
{
title: '首页',
path: '/',
icon: 'https://files.axshare.com/gsc/DR6075/de/a0/49/dea049d6ad3e4c2c80af44258c6c76d6/images/%E9%A6%96%E9%A1%B5_1/u18.png?pageId=74b3e5b2-848e-4258-8a34-9e220127c8a6'
},
{
title: '问卷',
path: '/survey',
icon: 'https://files.axshare.com/gsc/DR6075/de/a0/49/dea049d6ad3e4c2c80af44258c6c76d6/images/%E9%A6%96%E9%A1%B5_1/u21.png?pageId=74b3e5b2-848e-4258-8a34-9e220127c8a6'
},
{
title: '新建问卷',
path: '/create',
icon: 'https://files.axshare.com/gsc/DR6075/de/a0/49/dea049d6ad3e4c2c80af44258c6c76d6/images/首页_1/u15.png?pageId=74b3e5b2-848e-4258-8a34-9e220127c8a6'
},
{
title: '模板',
path: '/market',
icon: 'https://files.axshare.com/gsc/DR6075/de/a0/49/dea049d6ad3e4c2c80af44258c6c76d6/images/%E9%A6%96%E9%A1%B5_1/u24.png?pageId=74b3e5b2-848e-4258-8a34-9e220127c8a6'
}
];
function tabPath(path) {
router.push({
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({
// path
// });
// } else {
// showFailToast(
// error.response.data?.message || error.data?.message || error.message || '服务器错误'
// );
// }
// })
// .catch((error) => {
// showFailToast(error?.response?.data?.message || error?.message || '服务器错误');
// });
// } else {
// router.push({
// path
// });
// }
}
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">

View File

@@ -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)) {
@@ -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=');

View File

@@ -1,4 +1,3 @@
import './assets/css/main.scss';
import 'amfe-flexible'; import 'amfe-flexible';
import { createApp } from 'vue'; import { createApp } from 'vue';
import { createPinia } from 'pinia'; import { createPinia } from 'pinia';
@@ -10,6 +9,8 @@ import 'vant/lib/index.css';
import '@/style/utils.scss'; import '@/style/utils.scss';
import appBridge from '@/assets/js/appBridge'; import appBridge from '@/assets/js/appBridge';
import VConsole from 'vconsole'; import VConsole from 'vconsole';
import './assets/css/main.scss';
const app = createApp(App); const app = createApp(App);
if (import.meta.env.VITE_APP_ENV !== 'production') { if (import.meta.env.VITE_APP_ENV !== 'production') {

View File

@@ -1,2 +1,2 @@
export const surveyQuestion = export const surveyQuestion
'https://yls-api-uat.dctest.digitalyili.com/api/console/surveys/RWNK9BYp/questions'; = 'https://yls-api-uat.dctest.digitalyili.com/api/console/surveys/RWNK9BYp/questions';

View File

@@ -38,10 +38,10 @@ service.interceptors.request.use(
service.interceptors.response.use( service.interceptors.response.use(
(response) => { (response) => {
if ( if (
response.status === 200 || response.status === 200
response.status === 201 || || response.status === 201
response.status === 202 || || response.status === 202
response.status === 204 || response.status === 204
) { ) {
if (response.config.method === 'put') { if (response.config.method === 'put') {
// message.success('保存中...'); // message.success('保存中...');

View File

@@ -44,10 +44,10 @@ service.interceptors.request.use(
service.interceptors.response.use( service.interceptors.response.use(
(response) => { (response) => {
if ( if (
response.status === 200 || response.status === 200
response.status === 201 || || response.status === 201
response.status === 202 || || response.status === 202
response.status === 204 || response.status === 204
) { ) {
if (response.config.method === 'put') { if (response.config.method === 'put') {
// message.success('保存中...'); // message.success('保存中...');

View File

@@ -1,6 +1,7 @@
<template> <template>
<div class="design-create"> <div class="design-create">
<draggable <draggable
v-if="questionInfo.questions.length > 0"
v-model:data="questionInfo.questions" v-model:data="questionInfo.questions"
item-key="id" item-key="id"
handle=".moverQues" handle=".moverQues"
@@ -51,8 +52,8 @@
<martrix-question <martrix-question
v-if=" v-if="
element.question_type === 8 || element.question_type === 8 ||
element.question_type === 9 || element.question_type === 9 ||
element.question_type === 10 element.question_type === 10
" "
:element="computedElement(element)" :element="computedElement(element)"
:index="index" :index="index"
@@ -130,6 +131,9 @@
</div> </div>
</template> </template>
</draggable> </draggable>
<div v-else>
<slot name="empty"></slot>
</div>
</div> </div>
</template> </template>
<script setup> <script setup>
@@ -163,7 +167,7 @@ const { filterGap, activeId } = defineProps({
default: false default: false
}, },
activeId: { activeId: {
type: String, type: [String, Number],
default: '' default: ''
} }
}); });
@@ -243,7 +247,8 @@ watch(
() => questionInfo.value.questions, () => questionInfo.value.questions,
(newVal) => { (newVal) => {
if (newVal) { if (newVal) {
saveQueItem(questionInfo.value.logics, newVal); // 确保保存最新的数据 // 确保保存最新的数据
saveQueItem(questionInfo.value.logics, newVal);
} }
}, },
{ deep: true } { deep: true }

View File

@@ -4,9 +4,9 @@
<div class="flex align-center option-action-container"> <div class="flex align-center option-action-container">
<slot name="item" :element="item" :index="index"></slot> <slot name="item" :element="item" :index="index"></slot>
<span v-if="active" class="flex"> <span v-if="active" class="flex">
<van-icon name="close" @click="deleteOption(index)"></van-icon> <van-icon class-prefix="mobilefont" name="setting " @click="openMoveModel(item, index)" />
<van-icon name="setting-o" @click="openMoveModel(item, index)"></van-icon> <van-icon class-prefix="mobilefont" name="gengduo " @click="openOptionActionModel(item, index)" />
<van-icon name="more-o" @click="openOptionActionModel(item, index)"></van-icon> <van-icon class-prefix="mobilefont" name="del1 " @click="deleteOption(index)" />
</span> </span>
</div> </div>
</template> </template>
@@ -117,23 +117,23 @@ const openMoveModel = (item, index) => {
// 上下移动 // 上下移动
const optionMove = (action) => { const optionMove = (action) => {
switch (action.action) { switch (action.action) {
case 'up': case 'up':
if (activeIndex.value === 0) { if (activeIndex.value === 0) {
moveShow.value = false; moveShow.value = false;
return false; return false;
} }
// 向上移动 // 向上移动
element.value.splice(activeIndex.value - 1, 0, element.value.splice(activeIndex.value, 1)[0]); element.value.splice(activeIndex.value - 1, 0, element.value.splice(activeIndex.value, 1)[0]);
activeIndex.value -= 1; activeIndex.value -= 1;
break; break;
case 'down': case 'down':
if (activeIndex.value === element.value.length - 1) { if (activeIndex.value === element.value.length - 1) {
moveShow.value = false; moveShow.value = false;
return false; return false;
} }
element.value.splice(activeIndex.value + 1, 0, element.value.splice(activeIndex.value, 1)[0]); element.value.splice(activeIndex.value + 1, 0, element.value.splice(activeIndex.value, 1)[0]);
activeIndex.value += 1; activeIndex.value += 1;
break; break;
} }
}; };
@@ -162,11 +162,23 @@ const deleteOption = (index) => {
font-size: 20px; font-size: 20px;
& .option-action-container { & .option-action-container {
font-size: 20px; font-size: 16px;
& .mobilefont{
font-size: 16px;
}
& .mobilefont + .mobilefont {
margin-left: 5px;
}
& .van-icon + .van-icon { & .van-icon + .van-icon {
margin-left: 5px; margin-left: 5px;
} }
& .van-icon + .mobilefont {
margin-left: 5px;
}
} }
} }
</style> </style>

View File

@@ -1,8 +1,8 @@
<template> <template>
<div class="question-action-container flex"> <div class="question-action-container flex">
<van-icon name="clear" @click="deleteQuestion"></van-icon> <van-icon class-prefix="mobilefont" name="setting" @click="openQuestionSettingModel"></van-icon>
<van-icon name="setting" @click="openQuestionSettingModel"></van-icon> <van-icon class-prefix="mobilefont" name="gengduo " @click="openQuestionActionModel"></van-icon>
<van-icon name="more" @click="openQuestionActionModel"></van-icon> <van-icon class-prefix="mobilefont" name="delete" @click="deleteQuestion"></van-icon>
</div> </div>
<!-- 操作项弹窗--> <!-- 操作项弹窗-->
@@ -179,7 +179,8 @@ const saveSettings = () => {
emit('setting', activeQuestion.value); emit('setting', activeQuestion.value);
}; };
const saveLogics = () => { const saveLogics = () => {
emit('logics', activeQuestion.value); // 将更新后的 questionsInfo 传递给父组件 // 将更新后的 questionsInfo 传递给父组件
emit('logics', activeQuestion.value);
}; };
// 当前题目 // 当前题目
@@ -259,8 +260,8 @@ const getSkipTypeText = (skipType) => {
const ls = []; const ls = [];
logics.map((item) => { logics.map((item) => {
if ( if (
item.skip_type === skipType && item.skip_type === skipType
item.question_index === activeQuestion.value.question_index && item.question_index === activeQuestion.value.question_index
) { ) {
ls.push(item); ls.push(item);
} }
@@ -276,13 +277,13 @@ const getSkipTypeText = (skipType) => {
const questionSetting = (type) => { const questionSetting = (type) => {
switch (type) { switch (type) {
case 'before': case 'before':
questionBeforeShow.value = true; questionBeforeShow.value = true;
break; break;
case 'after': case 'after':
questionBeforeShow.value = true; questionBeforeShow.value = true;
break; break;
} }
skipType.value = type === 'before' ? 1 : 0; skipType.value = type === 'before' ? 1 : 0;
}; };
@@ -315,8 +316,16 @@ const updateConfig = (value) => {
.question-action-container { .question-action-container {
font-size: 20px; font-size: 20px;
& .mobilefont{
font-size:18px;
}
& .van-icon + .van-icon { & .van-icon + .van-icon {
margin-left: 5px; margin-left: 5px;
} }
& .mobilefont + .mobilefont {
margin-left: 5px;
}
} }
</style> </style>

View File

@@ -13,6 +13,6 @@
import { completionOptions } from '@/utils/questionSteeingList.js'; import { completionOptions } from '@/utils/questionSteeingList.js';
import YlSelect from '@/components/YLSelect.vue'; import YlSelect from '@/components/YLSelect.vue';
import YlInput from '@/components/YLInput.vue'; import YlInput from '@/components/YLInput.vue';
const logic = defineModel('logic', {}); const logic = defineModel('logic');
</script> </script>
<style scoped lang="scss"></style> <style scoped lang="scss"></style>

View File

@@ -16,8 +16,18 @@
import { completionOptions } from '@/utils/questionSteeingList.js'; import { completionOptions } from '@/utils/questionSteeingList.js';
import YlSelect from '@/components/YLSelect.vue'; import YlSelect from '@/components/YLSelect.vue';
import YlInput from '@/components/YLInput.vue'; import YlInput from '@/components/YLInput.vue';
const logic = defineModel('logic', {}); const logic = defineModel('logic', {
const beforeQuesOptions = defineModel('beforeQuesOptions', {}); type: Object,
default: () => {
return {};
}
});
const beforeQuesOptions = defineModel('beforeQuesOptions', {
type: Array,
default: () => {
return [];
}
});
const getOptions = (type) => { const getOptions = (type) => {
let options = []; let options = [];

View File

@@ -20,8 +20,18 @@
<script setup> <script setup>
import { groupOptions, symbolOptions } from '@/utils/questionSteeingList.js'; import { groupOptions, symbolOptions } from '@/utils/questionSteeingList.js';
import YlSelect from '@/components/YLSelect.vue'; import YlSelect from '@/components/YLSelect.vue';
const logic = defineModel('logic'); const logic = defineModel('logic', {
const beforeQuesOptions = defineModel('beforeQuesOptions'); type: Object,
default: () => {
return {};
}
});
const beforeQuesOptions = defineModel('beforeQuesOptions', {
type: Array,
default: () => {
return [];
}
});
const getOptions = (type) => { const getOptions = (type) => {
console.log(beforeQuesOptions); console.log(beforeQuesOptions);

View File

@@ -55,8 +55,18 @@ const changeQuestionIndex = () => {
return options; return options;
}; };
const beforeQuesOptions = defineModel('beforeQuesOptions'); const logic = defineModel('logic', {
const logic = defineModel('logic', {}); type: Object,
default: () => {
return {};
}
});
const beforeQuesOptions = defineModel('beforeQuesOptions', {
type: Array,
default: () => {
return [];
}
});
watch( watch(
() => logic.value, () => logic.value,
(newVal, oldVal) => { (newVal, oldVal) => {

View File

@@ -12,6 +12,11 @@
import { symbolOptions } from '@/utils/questionSteeingList.js'; import { symbolOptions } from '@/utils/questionSteeingList.js';
import YlSelect from '@/components/YLSelect.vue'; import YlSelect from '@/components/YLSelect.vue';
import YlInput from '@/components/YLInput.vue'; import YlInput from '@/components/YLInput.vue';
const logic = defineModel('logic'); const logic = defineModel('logic', {
type: Object,
default: () => {
return {};
}
});
</script> </script>
<style scoped lang="scss"></style> <style scoped lang="scss"></style>

View File

@@ -144,8 +144,8 @@
<BeforeRate <BeforeRate
v-if=" v-if="
log.logic !== 'always' && log.logic !== 'always' &&
log.is_answer !== 0 && log.is_answer !== 0 &&
[5, 106].includes(log.question_type) [5, 106].includes(log.question_type)
" "
:activeQuestion="activeQuestion" :activeQuestion="activeQuestion"
:logic="log" :logic="log"
@@ -356,7 +356,12 @@ const props = defineProps({
} }
}); });
const questionsInfo = defineModel('questionsInfo'); const questionsInfo = defineModel('questionsInfo', {
type: Object,
default: () => {
return {};
}
});
const logics = ref(questionsInfo.value.logics); const logics = ref(questionsInfo.value.logics);
const questions = questionsInfo.value.questions; const questions = questionsInfo.value.questions;

View File

@@ -108,9 +108,9 @@ function isSurplus() {
return false; return false;
} else { } else {
return ( return (
parseFloat(((localConfig.value.max - localConfig.value.min) * 1000).toFixed(4, 10)) % parseFloat(((localConfig.value.max - localConfig.value.min) * 1000).toFixed(4, 10))
parseFloat((localConfig.value.score_interval * 1000).toFixed(4, 10)) === % parseFloat((localConfig.value.score_interval * 1000).toFixed(4, 10))
0 === 0
); );
} }
} }

View File

@@ -10,14 +10,6 @@
<template #title> <template #title>
<span class="title"> {{ getQuestionType(element.question_type) }}</span> <span class="title"> {{ getQuestionType(element.question_type) }}</span>
</template> </template>
</van-cell>
<slot></slot>
<!-- 题目操作-->
<van-cell v-if="chooseQuestionId === element.id" class="choose-question-active-container">
<template #icon>
<slot name="action" :element="element" :index="index"></slot>
</template>
<template #title>{{}}</template>
<template #right-icon> <template #right-icon>
<question-action <question-action
v-model:data="element" v-model:data="element"
@@ -32,6 +24,14 @@
></question-action> ></question-action>
</template> </template>
</van-cell> </van-cell>
<slot></slot>
<!-- 题目操作-->
<van-cell v-if="chooseQuestionId === element.id" class="choose-question-active-container">
<template #icon>
<slot name="action" :element="element" :index="index"></slot>
</template>
<template #title>{{}}</template>
</van-cell>
</div> </div>
<div v-else> <div v-else>
<slot></slot> <slot></slot>

View File

@@ -21,14 +21,14 @@ const { element } = toRefs(props);
*/ */
const tableInputTypeMapping = (/** regx?: any */) => { const tableInputTypeMapping = (/** regx?: any */) => {
switch (element.value.question_type) { switch (element.value.question_type) {
case 8: case 8:
return 'text'; return 'text';
case 9: case 9:
return 'radio'; return 'radio';
case 10: case 10:
return 'checkbox'; return 'checkbox';
default: default:
return 'radio'; return 'radio';
} }
}; };

View File

@@ -42,7 +42,7 @@ const props = defineProps<{
columns: { option: string; editor?: boolean }[]; columns: { option: string; editor?: boolean }[];
questionType: number; questionType: number;
matrixAnswer: { [key: string]: any }; matrixAnswer: { [key: string]: any };
rowRecord: (number | string)[]; rowRecord:(number | string)[];
}>(); }>();
/* const emits = */ defineEmits(['update:matrixAnswer', 'update:rowRecord']); /* const emits = */ defineEmits(['update:matrixAnswer', 'update:rowRecord']);

View File

@@ -23,14 +23,14 @@ const matrixAnswer = ref({
*/ */
const tableInputTypeMapping = (/** regx?: any */) => { const tableInputTypeMapping = (/** regx?: any */) => {
switch (element.question_type) { switch (element.question_type) {
case 8: case 8:
return 'text'; return 'text';
case 9: case 9:
return 'radio'; return 'radio';
case 10: case 10:
return 'checkbox'; return 'checkbox';
default: default:
return 'radio'; return 'radio';
} }
}; };
@@ -67,55 +67,55 @@ function handleColNameChange(rowOption: string, colOption: string, e: any) {
// 不同的 question_type 的 matrix 问卷处理不同的结果 // 不同的 question_type 的 matrix 问卷处理不同的结果
switch (element.question_type) { switch (element.question_type) {
case 8: { case 8: {
// 获取输入框元素 // 获取输入框元素
const inputElement = e.target as HTMLInputElement; const inputElement = e.target as HTMLInputElement;
// 如果没有获取到输入框元素,则直接返回 // 如果没有获取到输入框元素,则直接返回
if (!inputElement) return; if (!inputElement) return;
// 将输入框的值保存到 rowRecord 对应位置 // 将输入框的值保存到 rowRecord 对应位置
rowRecord[col] = e!.target!.value; rowRecord[col] = e!.target!.value;
// 清空 matrixAnswer 的 answer 属性 // 清空 matrixAnswer 的 answer 属性
matrixAnswer.value.answer = {}; matrixAnswer.value.answer = {};
// 遍历所有行选项 // 遍历所有行选项
element.options[0].forEach((_, rowIndex) => { element.options[0].forEach((_, rowIndex) => {
// 获取当前行记录 // 获取当前行记录
const colOptions = rowRecord[rowIndex]; const colOptions = rowRecord[rowIndex];
// 如果当前行有记录,则更新 matrixAnswer 的 answer 属性 // 如果当前行有记录,则更新 matrixAnswer 的 answer 属性
if (colOptions) { if (colOptions) {
matrixAnswer.value.answer[`R${rowIndex + 1}_C${col + 1}`] = colOptions; matrixAnswer.value.answer[`R${rowIndex + 1}_C${col + 1}`] = colOptions;
} }
}); });
break; break;
} }
case 9: case 9:
// 将选择的行索引加1后保存到 rowRecord 对应位置 // 将选择的行索引加1后保存到 rowRecord 对应位置
rowRecord[col] = row + 1; rowRecord[col] = row + 1;
// 清空 matrixAnswer 的 answer 属性 // 清空 matrixAnswer 的 answer 属性
matrixAnswer.value.answer = {}; matrixAnswer.value.answer = {};
// 遍历 rowRecord更新 matrixAnswer 的 answer 属性 // 遍历 rowRecord更新 matrixAnswer 的 answer 属性
rowRecord.forEach((row, index) => { rowRecord.forEach((row, index) => {
matrixAnswer.value.answer[`${index + 1}_${row}`] = 1; matrixAnswer.value.answer[`${index + 1}_${row}`] = 1;
}); });
break; break;
case 10: case 10:
// 将选择的行索引加1后添加到 rowRecord 对应位置的数组中 // 将选择的行索引加1后添加到 rowRecord 对应位置的数组中
rowRecord[col] = (rowRecord[col] || []).concat(row + 1); rowRecord[col] = (rowRecord[col] || []).concat(row + 1);
// 清空 matrixAnswer 的 answer 属性 // 清空 matrixAnswer 的 answer 属性
matrixAnswer.value.answer = {}; matrixAnswer.value.answer = {};
// 遍历所有行选项 // 遍历所有行选项
element.options[0].forEach((rowOption, rowIndex) => { element.options[0].forEach((rowOption, rowIndex) => {
// 获取当前行记录 // 获取当前行记录
const colOptions = rowRecord[rowIndex]; const colOptions = rowRecord[rowIndex];
// 如果当前行有记录,则更新 matrixAnswer 的 answer 属性 // 如果当前行有记录,则更新 matrixAnswer 的 answer 属性
if (colOptions) { if (colOptions) {
colOptions.forEach((col: any) => { colOptions.forEach((col: any) => {
matrixAnswer.value.answer[`R${rowIndex + 1}_C${col}`] = true; matrixAnswer.value.answer[`R${rowIndex + 1}_C${col}`] = true;
}); });
} }
}); });
break; break;
default: default:
break; break;
} }
} }
</script> </script>

View File

@@ -43,7 +43,7 @@ const props = defineProps<{
columns: { option: string; editor?: boolean }[]; columns: { option: string; editor?: boolean }[];
questionType: number; questionType: number;
matrixAnswer: { [key: string]: any }; matrixAnswer: { [key: string]: any };
rowRecord: (number | string)[]; rowRecord:(number | string)[];
}>(); }>();
/* const emits = */ defineEmits(['update:matrixAnswer', 'update:rowRecord']); /* const emits = */ defineEmits(['update:matrixAnswer', 'update:rowRecord']);

View File

@@ -11,8 +11,7 @@
class="iconfont active-icon" class="iconfont active-icon"
:style="{ marginRight: isLastPage ? '0' : '16px' }" :style="{ marginRight: isLastPage ? '0' : '16px' }"
@click="activePage" @click="activePage"
>&#xe86c;</i >&#xe86c;</i>
>
<template v-if="!isLastPage"> <template v-if="!isLastPage">
<i class="iconfont moverQues" style="margin-right: 16px">&#xe71b;</i> <i class="iconfont moverQues" style="margin-right: 16px">&#xe71b;</i>
<i class="iconfont" @click="deleteHandle">&#xe6c5;</i> <i class="iconfont" @click="deleteHandle">&#xe6c5;</i>

View File

@@ -9,7 +9,7 @@ import { onMounted, ref } from 'vue';
const contentShow = ref(false); const contentShow = ref(false);
const show = ref(false); const show = ref(false);
onMounted(async () => { onMounted(async() => {
contentShow.value = true; contentShow.value = true;
// if (utils.getSessionStorage('xToken')) { // if (utils.getSessionStorage('xToken')) {
// const appToken = utils.getParameter('digitalYiliToken'); // const appToken = utils.getParameter('digitalYiliToken');
@@ -43,8 +43,8 @@ function create() {
<Market /> <Market />
<div class="new_survey"> <div class="new_survey">
<van-button type="primary" block color="#70B937" @click="create"> <van-button type="primary" block color="#70B937" @click="create">
<span class="fw-bold">+</span> 新建问卷</van-button <span class="fw-bold">+</span> 新建问卷
> </van-button>
</div> </div>
</div> </div>
<van-popup v-model:show="show" round closeable position="bottom"> <van-popup v-model:show="show" round closeable position="bottom">
@@ -54,7 +54,7 @@ function create() {
<style scoped lang="scss"> <style scoped lang="scss">
.container { .container {
padding: 30px 10px 80px 10px; padding: 30px 10px 80px;
background: linear-gradient(0deg, #f5f5f5 0%, #f5f5f5 84%, #a5d380 100%); background: linear-gradient(0deg, #f5f5f5 0%, #f5f5f5 84%, #a5d380 100%);
& > :first-child { & > :first-child {
@@ -75,15 +75,16 @@ function create() {
padding: 20px 10px; padding: 20px 10px;
} }
} }
.new_survey { .new_survey {
position: fixed; position: fixed;
left: 0;
bottom: 0; bottom: 0;
width: 100vw; left: 0;
background: #fff;
padding: 12px 11px 28px;
box-sizing: border-box; box-sizing: border-box;
width: 100vw;
padding: 12px 11px 28px;
border-radius: 12px; border-radius: 12px;
background: #fff;
} }
} }
</style> </style>

View File

@@ -90,14 +90,15 @@ onMounted(() => {
.create_survey { .create_survey {
padding: 15px; padding: 15px;
color: #000; color: #000;
.create_survey_title { .create_survey_title {
font-family: margin-bottom: 15px;
PingFangSC, color: #000;
PingFang SC;
font-weight: bold; font-weight: bold;
font-size: 15px; font-size: 15px;
color: #000000; font-family:
margin-bottom: 15px; PingFangSC,
'PingFang SC';
} }
} }
@@ -108,12 +109,13 @@ onMounted(() => {
justify-content: space-around; justify-content: space-around;
span { span {
font-family: PingFangHK, PingFangHK;
font-weight: 400;
font-size: 0.34667rem;
color: #000000;
margin-top: 8px; margin-top: 8px;
margin-bottom: 18px; margin-bottom: 18px;
color: #000;
font-weight: 400;
font-size: 0.34rem;
//font-family: PingFangHK, PingFangHK;
} }
} }
</style> </style>

View File

@@ -46,7 +46,7 @@ import { consoleSurveys } from '@/api/home/index.js';
const survey = ref({ const survey = ref({
project_name: '' project_name: ''
}); });
const fetchSurveys = async () => { const fetchSurveys = async() => {
const params = { const params = {
page: 1, page: 1,
per_page: 10, per_page: 10,

View File

@@ -20,7 +20,7 @@ const marketList = ref([]);
const active = ref(null); const active = ref(null);
const marketInfo = ref([]); const marketInfo = ref([]);
const getTableList = async () => { const getTableList = async() => {
const res = await getListScene(); const res = await getListScene();
if (res.data.code === 0) { if (res.data.code === 0) {
res.data.data.forEach((item) => { res.data.data.forEach((item) => {
@@ -32,7 +32,7 @@ const getTableList = async () => {
getMarketInfo(marketList.value[0]); getMarketInfo(marketList.value[0]);
} }
}; };
const getMarketInfo = async (item) => { const getMarketInfo = async(item) => {
const code = marketList.value.filter((market, index) => item === index)[0].code; const code = marketList.value.filter((market, index) => item === index)[0].code;
const params = { const params = {
page: 1, page: 1,

View File

@@ -28,8 +28,8 @@
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import contentSvg from './svgs/contentSvg.svg'; // import contentSvg from './svgs/contentSvg.svg';
import MarketItemSvg from './svgs/MarketItemSvg.svg'; // import MarketItemSvg from './svgs/MarketItemSvg.svg';
const { info } = defineProps({ const { info } = defineProps({
info: { info: {
type: Object, type: Object,

View File

@@ -3,9 +3,7 @@
<div v-for="item in 10" :key="item" class="template"> <div v-for="item in 10" :key="item" class="template">
<img src="https://picsum.photos/131/128" width="110" height="100" alt="" /> <img src="https://picsum.photos/131/128" width="110" height="100" alt="" />
<span>报名/签到模板</span> <span>报名/签到模板</span>
<span style="color: rgb(127, 127, 127)" <span style="color: rgb(127, 127, 127)">报名签到 | 引用 {{ item }} | 创建人: {{ '张三' }}</span>
>报名签到 | 引用 {{ item }} | 创建人: {{ '张三' }}</span
>
</div> </div>
</div> </div>
</template> </template>

View File

@@ -6,38 +6,64 @@
</template> </template>
</van-nav-bar> </van-nav-bar>
<van-cell-group inset class="result-cell"> <div class="question-title flex space-between">
<div> <div class="title-left">
<div> <!--问卷标题-->
<!--问卷标题--> <contenteditable
<contenteditable v-model="questionInfo.survey.title"
v-model="questionInfo.survey.title" className="content-title"
:active="true" :active="true"
@blur="saveTitle" @blur="saveTitle"
></contenteditable> ></contenteditable>
</div> <!-- 问卷标注-->
<div> <contenteditable
<!-- 问卷标注--> v-model="questionInfo.survey.introduction"
<contenteditable className="introduction"
v-model="questionInfo.survey.introduction" :active="true"
:active="true" @blur="saveTitle"
@blur="saveTitle" ></contenteditable>
></contenteditable>
</div>
<van-button v-if="questionInfo.questions.length === 0" size="small" @click="show = true">
添加题目
</van-button>
</div> </div>
</van-cell-group> <!-- <van-cell-group inset class="result-cell">-->
<!-- <div>-->
<!-- <div>-->
<!-- -->
<!-- </div>-->
<!-- <div>-->
<!-- -->
<!-- </div>-->
<!-- </div>-->
<!-- </van-cell-group>-->
<div class="title-right">图标</div>
</div>
<div class="ques"> <div class="ques">
<!-- 题目--> <!-- 题目-->
<Design :active-id="activeId" class="design" @get-active-question="getActiveQuestion"> <Design :activeId="activeId" class="design" @get-active-question="getActiveQuestion">
<template #button="{ item }"> <template #button="{ item }">
<div class="design-button"> <div class="design-button">
<van-button v-if="activeId === item.id" size="small" @click="show = true"> <van-button
添加题目 v-if="activeId === item.id"
size="small"
@click="show = true"
>
+ 添加题目
</van-button>
</div>
</template>
<template #empty>
<div class="empty">
<div>
<img :src="emptyImage" alt="" class="empty-image" />
</div>
<van-button
v-if="questionInfo.questions.length === 0"
class="theme-background"
size="small"
@click="show = true"
>
+ 添加题目
</van-button> </van-button>
</div> </div>
</template> </template>
@@ -284,6 +310,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import emptyImage from '@/assets/img/empty.png';
import { ref, computed, onMounted, watch } from 'vue'; import { ref, computed, onMounted, watch } from 'vue';
import * as Base64 from 'js-base64'; import * as Base64 from 'js-base64';
import { import {
@@ -374,14 +401,14 @@ const questionEvent = (item) => {
options: options:
item.json.options.length > 0 item.json.options.length > 0
? item.json.options.map((item) => { ? item.json.options.map((item) => {
return item.map((it) => { return item.map((it) => {
return { return {
...it, ...it,
// 主键生成 // 主键生成
id: uuidv4() id: uuidv4()
}; };
}); });
}) })
: [] : []
}) })
); );
@@ -514,12 +541,14 @@ 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">
@import '@/assets/css/theme';
::v-deep .van-nav-bar { ::v-deep .van-nav-bar {
background-color: #70b937; background-color: #70b937;
color: #fff; color: #fff;
@@ -533,6 +562,28 @@ onMounted(async () => {
} }
} }
.container {
& .question-title {
padding: 0 20px;
background-color: transparent !important;
& .title-left {
color: #fff;
::v-deep .content-title {
margin-top: 5px;
margin-bottom: 5px;
font-size: 18px;
}
}
& .title-right {
margin-right: 50px;
margin-left: 20px;
}
}
}
::v-deep .van-hairline--bottom::after { ::v-deep .van-hairline--bottom::after {
display: none; display: none;
} }
@@ -561,14 +612,6 @@ onMounted(async () => {
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
text-align: center; text-align: center;
& > button {
margin: 20px;
//border-radius: 10px;
background-color: #70b936;
color: #fff;
}
} }
} }
@@ -588,6 +631,45 @@ onMounted(async () => {
.ques { .ques {
min-height: 70vh; min-height: 70vh;
.design-button{
text-align: center;
& > button {
padding:0.5rem ;
border-radius: 8px;
background: rgba(240, 248, 235, 1);
color:$theme-color
//opacity: 0.1;
}
}
.empty {
overflow: hidden;
height: 250px;
margin: 10px;
padding: 10px;
border-radius: 8px;
background: #fff;
text-align: center;
& .empty-image{
width: 186px;
height:114px;
margin-top:40px;
}
& > button {
margin-top:40px;
padding:0.5rem ;
border-radius: 5px;
background: rgba(240, 248, 235, 1);
color:$theme-color
//opacity: 0.1;
}
}
.ques_title { .ques_title {
margin: 20px 0 10px 20px; margin: 20px 0 10px 20px;
font-weight: bold; font-weight: bold;
@@ -596,19 +678,6 @@ onMounted(async () => {
& .design { & .design {
padding-bottom: 60px; padding-bottom: 60px;
& .design-button {
width: 100%;
text-align: center;
::v-deep .van-button {
background-color: #70b936;
//width: 140px;
color: #fff;
font-size: 12px;
}
}
} }
.ques_list { .ques_list {

View File

@@ -692,9 +692,9 @@ async function answer(callback, callbackBeforePage) {
question.error = translatedText.value.ThisIsARequiredQuestion; question.error = translatedText.value.ThisIsARequiredQuestion;
} }
} else if ( } else if (
answer && answer
questionType === 1 && && questionType === 1
Object.keys(answer).findIndex((value) => !answer[value]) !== -1 && Object.keys(answer).findIndex((value) => !answer[value]) !== -1
) { ) {
// 单选题 // 单选题
isError = true; isError = true;
@@ -869,47 +869,47 @@ async function answer(callback, callbackBeforePage) {
const { value } = answer; const { value } = answer;
const newValue = value.replace(/\n|\r|\r\n/g, ''); const newValue = value.replace(/\n|\r|\r\n/g, '');
switch (config.text_type) { switch (config.text_type) {
case 3: // 字母 case 3: // 字母
isError = isError
config.include_mark === 1 = config.include_mark === 1
? !/^[a-zA-Z·~@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、`~!@#$%^&*()_\-+=<>?:"{}|,./;'\\[\]]+$/.test( ? !/^[a-zA-Z·~@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、`~!@#$%^&*()_\-+=<>?:"{}|,./;'\\[\]]+$/.test(
newValue newValue
) || !newValue.length ) || !newValue.length
: !/^[a-zA-Z]+$/.test(newValue) || !newValue.length; : !/^[a-zA-Z]+$/.test(newValue) || !newValue.length;
question.error = isError ? translatedText.value.PleaseEnterEnglishLetters : ''; question.error = isError ? translatedText.value.PleaseEnterEnglishLetters : '';
break; break;
case 4: // 中文 case 4: // 中文
isError = isError
config.include_mark === 1 = config.include_mark === 1
? !/^(?:[\u3400-\u4DB5\u4E00-\u9FEA\uFA0E\uFA0F\uFA11\uFA13\uFA14\uFA1F\uFA21\uFA23\uFA24\uFA27-\uFA29]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|[·~@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、`~!@#$%^&*()_\-+=<>?:"{}|,./;'\\[\]])+$/.test( ? !/^(?:[\u3400-\u4DB5\u4E00-\u9FEA\uFA0E\uFA0F\uFA11\uFA13\uFA14\uFA1F\uFA21\uFA23\uFA24\uFA27-\uFA29]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|[·~@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、`~!@#$%^&*()_\-+=<>?:"{}|,./;'\\[\]])+$/.test(
newValue newValue
) || !newValue.length ) || !newValue.length
: !/^(?:[\u3400-\u4DB5\u4E00-\u9FEA\uFA0E\uFA0F\uFA11\uFA13\uFA14\uFA1F\uFA21\uFA23\uFA24\uFA27-\uFA29]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0])+$/.test( : !/^(?:[\u3400-\u4DB5\u4E00-\u9FEA\uFA0E\uFA0F\uFA11\uFA13\uFA14\uFA1F\uFA21\uFA23\uFA24\uFA27-\uFA29]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0])+$/.test(
newValue newValue
) || !newValue.length; ) || !newValue.length;
question.error = isError ? translatedText.value.PleaseEnterChineseWords : ''; question.error = isError ? translatedText.value.PleaseEnterChineseWords : '';
break; break;
// 邮箱 // 邮箱
case 5: case 5:
isError = isError
!/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test( = !/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(
value value
); );
question.error = isError ? translatedText.value.PleaseEnterACorrectEmail : ''; question.error = isError ? translatedText.value.PleaseEnterACorrectEmail : '';
break; break;
case 6: // 手机号 case 6: // 手机号
isError = !/^(?:(?:\+|00)86)?1[3-9]\d{9}$/.test(value); isError = !/^(?:(?:\+|00)86)?1[3-9]\d{9}$/.test(value);
question.error = isError ? translatedText.value.PleaseEnterACorrectPhone : ''; question.error = isError ? translatedText.value.PleaseEnterACorrectPhone : '';
break; break;
case 7: // 身份证号 case 7: // 身份证号
isError = isError
!/^[1-9]\d{5}(?:18|19|20)\d{2}(?:0[1-9]|10|11|12)(?:0[1-9]|[1-2]\d|30|31)\d{3}[\dXx]$/.test( = !/^[1-9]\d{5}(?:18|19|20)\d{2}(?:0[1-9]|10|11|12)(?:0[1-9]|[1-2]\d|30|31)\d{3}[\dXx]$/.test(
value value
); );
question.error = isError ? translatedText.value.PleaseEnterACorrectID : ''; question.error = isError ? translatedText.value.PleaseEnterACorrectID : '';
break; break;
default: default:
break; break;
} }
if (!isError && value.length < config.min && ![1, 2].includes(config.text_type)) { if (!isError && value.length < config.min && ![1, 2].includes(config.text_type)) {
isError = true; isError = true;
@@ -921,46 +921,46 @@ async function answer(callback, callbackBeforePage) {
Object.keys(answer).forEach((key) => { Object.keys(answer).forEach((key) => {
const value = answer[key]; const value = answer[key];
switch (config.text_type) { switch (config.text_type) {
case 3: // 字母 case 3: // 字母
isError = isError
config.include_mark === 1 = config.include_mark === 1
? !/^[a-zA-Z·~@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、`~!@#$%^&*()_\-+=<>?:"{}|,./;'\\[\]]+$/.test( ? !/^[a-zA-Z·~@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、`~!@#$%^&*()_\-+=<>?:"{}|,./;'\\[\]]+$/.test(
newValue newValue
) || !newValue.length ) || !newValue.length
: !/^[a-zA-Z]+$/.test(newValue) || !newValue.length; : !/^[a-zA-Z]+$/.test(newValue) || !newValue.length;
question.error = isError ? translatedText.value.PleaseEnterEnglishLetters : ''; question.error = isError ? translatedText.value.PleaseEnterEnglishLetters : '';
break; break;
case 4: // 中文 case 4: // 中文
isError = isError
config.include_mark === 1 = config.include_mark === 1
? !/^(?:[\u3400-\u4DB5\u4E00-\u9FEA\uFA0E\uFA0F\uFA11\uFA13\uFA14\uFA1F\uFA21\uFA23\uFA24\uFA27-\uFA29]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|[·~@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、`~!@#$%^&*()_\-+=<>?:"{}|,./;'\\[\]])+$/.test( ? !/^(?:[\u3400-\u4DB5\u4E00-\u9FEA\uFA0E\uFA0F\uFA11\uFA13\uFA14\uFA1F\uFA21\uFA23\uFA24\uFA27-\uFA29]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|[·~@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、`~!@#$%^&*()_\-+=<>?:"{}|,./;'\\[\]])+$/.test(
newValue newValue
) || !newValue.length ) || !newValue.length
: !/^(?:[\u3400-\u4DB5\u4E00-\u9FEA\uFA0E\uFA0F\uFA11\uFA13\uFA14\uFA1F\uFA21\uFA23\uFA24\uFA27-\uFA29]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0])+$/.test( : !/^(?:[\u3400-\u4DB5\u4E00-\u9FEA\uFA0E\uFA0F\uFA11\uFA13\uFA14\uFA1F\uFA21\uFA23\uFA24\uFA27-\uFA29]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0])+$/.test(
newValue newValue
) || !newValue.length; ) || !newValue.length;
question.error = isError ? translatedText.value.PleaseEnterChineseWords : ''; question.error = isError ? translatedText.value.PleaseEnterChineseWords : '';
break; break;
case 5: // 邮箱 case 5: // 邮箱
isError = isError
!/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test( = !/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(
value value
); );
question.error = isError ? translatedText.value.PleaseEnterACorrectEmail : ''; question.error = isError ? translatedText.value.PleaseEnterACorrectEmail : '';
break; break;
case 6: // 手机号 case 6: // 手机号
isError = !/^(?:(?:\+|00)86)?1[3-9]\d{9}$/.test(value); isError = !/^(?:(?:\+|00)86)?1[3-9]\d{9}$/.test(value);
question.error = isError ? translatedText.value.PleaseEnterACorrectPhone : ''; question.error = isError ? translatedText.value.PleaseEnterACorrectPhone : '';
break; break;
case 7: // 身份证号 case 7: // 身份证号
isError = isError
!/^[1-9]\d{5}(?:18|19|20)\d{2}(?:0[1-9]|10|11|12)(?:0[1-9]|[1-2]\d|30|31)\d{3}[\dXx]$/.test( = !/^[1-9]\d{5}(?:18|19|20)\d{2}(?:0[1-9]|10|11|12)(?:0[1-9]|[1-2]\d|30|31)\d{3}[\dXx]$/.test(
value value
); );
question.error = isError ? translatedText.value.PleaseEnterACorrectID : ''; question.error = isError ? translatedText.value.PleaseEnterACorrectID : '';
break; break;
default: default:
break; break;
} }
if (!isError && value.length < config.min && ![1, 2].includes(config.text_type)) { if (!isError && value.length < config.min && ![1, 2].includes(config.text_type)) {
isError = true; isError = true;
@@ -1037,14 +1037,14 @@ async function answer(callback, callbackBeforePage) {
currentQuestions.forEach((question, index) => { currentQuestions.forEach((question, index) => {
if (index >= warnStart && index < warnEnd) { if (index >= warnStart && index < warnEnd) {
if (repeat.repeat_type) { if (repeat.repeat_type) {
question.warning = question.warning
translatedText.value.TheAnswerIsRepeatedMoreThanOneTimesPleaseRevise( = translatedText.value.TheAnswerIsRepeatedMoreThanOneTimesPleaseRevise(
repeat.allow_repeat_num, repeat.allow_repeat_num,
repeat.repeat_type repeat.repeat_type
); );
} else { } else {
question.error = question.error
translatedText.value.TheAnswerIsRepeatedMoreThanOneTimesPleaseRevise( = translatedText.value.TheAnswerIsRepeatedMoreThanOneTimesPleaseRevise(
repeat.allow_repeat_num, repeat.allow_repeat_num,
repeat.repeat_type repeat.repeat_type
); );
@@ -1234,8 +1234,8 @@ function updateAnswer(auto) {
const evt1 = {}; const evt1 = {};
if ([1].includes(question.question_type)) { if ([1].includes(question.question_type)) {
evt1.value = evt1.value
Object.keys(question.answer) = Object.keys(question.answer)
.map((key) => (question.answer[key] ? key : undefined)) .map((key) => (question.answer[key] ? key : undefined))
.filter((i) => !!i)?.[0] || undefined; .filter((i) => !!i)?.[0] || undefined;
evt1.options = question.list.flatMap((i) => i.options); evt1.options = question.list.flatMap((i) => i.options);

View File

@@ -227,8 +227,8 @@ export default defineComponent({
.map((option) => { .map((option) => {
return this.wares.find( return this.wares.find(
(ware) => (ware) =>
ware.question_index === option.question_index && ware.question_index === option.question_index
ware.option_index === option.option_index && ware.option_index === option.option_index
); );
}); });
wares = wares.filter((x) => x); wares = wares.filter((x) => x);

View File

@@ -144,7 +144,7 @@ export default {
methods: { methods: {
debounce(func, wait) { debounce(func, wait) {
let timeout; let timeout;
return function (...args) { return function(...args) {
clearTimeout(timeout); clearTimeout(timeout);
timeout = setTimeout(() => func.apply(this, args), wait); timeout = setTimeout(() => func.apply(this, args), wait);
}; };

View File

@@ -102,37 +102,37 @@ export default defineComponent({
const isEndUrl = computed(() => { const isEndUrl = computed(() => {
const code = props.action ? props.action.code : props.code; const code = props.action ? props.action.code : props.code;
return ( return (
(code === 20004 && (code === 20004
props.survey.screening_end_url_select && && props.survey.screening_end_url_select
props.survey.screening_end_url) || && props.survey.screening_end_url)
(code === 20011 && props.survey.success_end_url_select && props.survey.success_end_url) || || (code === 20011 && props.survey.success_end_url_select && props.survey.success_end_url)
(code === 20016 && props.survey.quota_end_url_select && props.survey.quota_end_url) || (code === 20016 && props.survey.quota_end_url_select && props.survey.quota_end_url)
); );
}); });
// 跳转 // 跳转
function toEndUrl() { function toEndUrl() {
switch (props.action.code) { switch (props.action.code) {
case 20004: // 被甄别 case 20004: // 被甄别
if (props.survey.screening_end_url_select && props.survey.screening_end_url) { if (props.survey.screening_end_url_select && props.survey.screening_end_url) {
const url = props.survey.screening_end_url; const url = props.survey.screening_end_url;
toUrl(url); toUrl(url);
} }
break; break;
case 20011: // 成功 case 20011: // 成功
if (props.survey.success_end_url_select && props.survey.success_end_url) { if (props.survey.success_end_url_select && props.survey.success_end_url) {
const url = props.survey.success_end_url; const url = props.survey.success_end_url;
toUrl(url); toUrl(url);
} }
break; break;
case 20016: // 配额超限 case 20016: // 配额超限
if (props.survey.quota_end_url_select && props.survey.quota_end_url) { if (props.survey.quota_end_url_select && props.survey.quota_end_url) {
const url = props.survey.quota_end_url; const url = props.survey.quota_end_url;
toUrl(url); toUrl(url);
} }
break; break;
default: default:
break; break;
} }
} }

View File

@@ -264,16 +264,16 @@ export default defineComponent({
}); });
if ( if (
!compareArrayByField(options.value, newOptions, 'option_key') || !compareArrayByField(options.value, newOptions, 'option_key')
!compareArrayByField(options.value, newOptions, 'option') || !compareArrayByField(options.value, newOptions, 'option')
) { ) {
options.value = newOptions; options.value = newOptions;
} }
// 清空值和答案 // 清空值和答案
if ( if (
value.value && value.value
options.value.findIndex((option) => option.option_key === value.value) === -1 && options.value.findIndex((option) => option.option_key === value.value) === -1
) { ) {
// 清空值 // 清空值
value.value = ''; value.value = '';
@@ -291,8 +291,8 @@ export default defineComponent({
() => options.value, () => options.value,
(val, oldVal) => { (val, oldVal) => {
if ( if (
compareArrayByField(val, oldVal || [], 'option_key') && compareArrayByField(val, oldVal || [], 'option_key')
compareArrayByField(val, oldVal || [], 'option') && compareArrayByField(val, oldVal || [], 'option')
) { ) {
return; return;
} }

View File

@@ -132,8 +132,8 @@ export default defineComponent({
const value = matchValue.replace('[%cite(', '').replace(')%]', ''); const value = matchValue.replace('[%cite(', '').replace(')%]', '');
let replacement = ''; // 替换文本 let replacement = ''; // 替换文本
// 查找引用问题 // 查找引用问题
const question = const question
props.questions.find((question) => { = props.questions.find((question) => {
// 矩阵题 // 矩阵题
if (question.question_type >= 8 && question.question_type <= 11) { if (question.question_type >= 8 && question.question_type <= 11) {
return question.title === value.split('_R')[0].split('_C')[0]; return question.title === value.split('_R')[0].split('_C')[0];
@@ -143,8 +143,8 @@ export default defineComponent({
return question.title === value.split('_A')[0]; return question.title === value.split('_A')[0];
} }
return question.title === value; return question.title === value;
}) || })
props.questions.find((question) => { || props.questions.find((question) => {
// 矩阵题 // 矩阵题
if (question.question_type >= 8 && question.question_type <= 11) { if (question.question_type >= 8 && question.question_type <= 11) {
return question.title === (value + cycleIndexStr).split('_R')[0].split('_C')[0]; return question.title === (value + cycleIndexStr).split('_R')[0].split('_C')[0];
@@ -171,8 +171,8 @@ export default defineComponent({
replacement = answer[option.option_key]; replacement = answer[option.option_key];
} }
} else if ( } else if (
question.question_type === 2 && question.question_type === 2
Object.keys(answer).length >= question.config.min_select && Object.keys(answer).length >= question.config.min_select
) { ) {
// 查找引用选项(多选) // 查找引用选项(多选)
options.forEach((option) => { options.forEach((option) => {

View File

@@ -350,7 +350,7 @@ export const language = {
zh: '请点击查看图片' zh: '请点击查看图片'
}, },
NoteCantViewAfterTimeLimit: { NoteCantViewAfterTimeLimit: {
en: "Note: Can't view after time limit", en: 'Note: Can\'t view after time limit',
zh: '注意:超过显示时间限制后将无法再次查看' zh: '注意:超过显示时间限制后将无法再次查看'
}, },
DisplayTimeLimitExceeded: { DisplayTimeLimitExceeded: {

View File

@@ -250,10 +250,10 @@ function quesHandle(answer, logChild) {
const matrixRateHandle = () => { const matrixRateHandle = () => {
// 如果配置的逻辑中参数为空,则代表没有配置逻辑匹配值,此时不做校验 // 如果配置的逻辑中参数为空,则代表没有配置逻辑匹配值,此时不做校验
if ( if (
logChild.cell_index === 0 || logChild.cell_index === 0
logChild.row_index === 0 || || logChild.row_index === 0
!logChild.operator || || !logChild.operator
!logChild.value || !logChild.value
) { ) {
return true; return true;
} }
@@ -265,10 +265,10 @@ function quesHandle(answer, logChild) {
const matrixInputHandle = () => { const matrixInputHandle = () => {
// 如果配置的逻辑中参数为空,则代表没有配置逻辑匹配值,此时不做校验 // 如果配置的逻辑中参数为空,则代表没有配置逻辑匹配值,此时不做校验
if ( if (
logChild.cell_index === 0 || logChild.cell_index === 0
logChild.row_index === 0 || || logChild.row_index === 0
!logChild.operator || || !logChild.operator
!logChild.value || !logChild.value
) { ) {
return true; return true;
} }
@@ -428,59 +428,59 @@ function getConditionStatus(logChild) {
if (answer) { if (answer) {
try { try {
switch (logChild.question_type) { switch (logChild.question_type) {
case 1: case 1:
quesStatus = quesHandles.choiceHandle(config); quesStatus = quesHandles.choiceHandle(config);
break; break;
case 2: case 2:
quesStatus = quesHandles.choiceCheckBoxHandle(config); quesStatus = quesHandles.choiceCheckBoxHandle(config);
break; break;
case 3: case 3:
quesStatus = quesHandles.cascaderHandle(); quesStatus = quesHandles.cascaderHandle();
break; break;
case 4: case 4:
quesStatus = quesHandles.inputHandle(); quesStatus = quesHandles.inputHandle();
break; break;
case 5: case 5:
quesStatus = quesHandles.rateHandle(); quesStatus = quesHandles.rateHandle();
break; break;
case 7: case 7:
quesStatus = quesHandles.dateTimeHandle(); quesStatus = quesHandles.dateTimeHandle();
break; break;
case 8: case 8:
quesStatus = quesHandles.matrixInputHandle(); quesStatus = quesHandles.matrixInputHandle();
break; break;
case 9: case 9:
quesStatus = quesHandles.matrixRadioHandle(config); quesStatus = quesHandles.matrixRadioHandle(config);
break; break;
case 10: case 10:
quesStatus = quesHandles.matrixCheckboxHandle(config); quesStatus = quesHandles.matrixCheckboxHandle(config);
break; break;
case 11: case 11:
quesStatus = quesHandles.matrixRateHandle(); quesStatus = quesHandles.matrixRateHandle();
break; break;
case 13: case 13:
quesStatus = quesHandles.imgRadioHandle(); quesStatus = quesHandles.imgRadioHandle();
break; break;
case 14: case 14:
quesStatus = quesHandles.imgCheckBoxHandle(); quesStatus = quesHandles.imgCheckBoxHandle();
break; break;
case 15: case 15:
quesStatus = quesHandles.classifyHandle(); quesStatus = quesHandles.classifyHandle();
break; break;
case 16: case 16:
quesStatus = quesHandles.sortHandle(); quesStatus = quesHandles.sortHandle();
break; break;
case 17: case 17:
quesStatus = quesHandles.constantSumHandle(); quesStatus = quesHandles.constantSumHandle();
break; break;
case 23: case 23:
quesStatus = quesHandles.agreementHandle(); quesStatus = quesHandles.agreementHandle();
break; break;
case 101: case 101:
quesStatus = quesHandles.psmHandle(config); quesStatus = quesHandles.psmHandle(config);
break; break;
default: default:
break; break;
} }
} catch (error) { } catch (error) {
// console.log(error); // console.log(error);
@@ -519,10 +519,10 @@ function getlogicStatus(questionData) {
// } else { // } else {
// statusStr = statusStr + conditionStatus; // statusStr = statusStr + conditionStatus;
// } // }
statusStr = statusStr
statusStr + = statusStr
(logChild.logic === 'and' ? '&&' : logChild.logic === 'or' ? '||' : '') + + (logChild.logic === 'and' ? '&&' : logChild.logic === 'or' ? '||' : '')
conditionStatus; + conditionStatus;
}); });
// eslint-disable-next-line no-eval // eslint-disable-next-line no-eval
logs.logicStatus = eval(statusStr); logs.logicStatus = eval(statusStr);

View File

@@ -105,8 +105,8 @@ export default function answerMock(questionsData, page) {
} else if (logic.skip_type === 4) { } else if (logic.skip_type === 4) {
// 只计算跳转后所在页面的隐藏逻辑,否则会出现只返回最后一道隐藏选项题目的情况,导致失效 // 只计算跳转后所在页面的隐藏逻辑,否则会出现只返回最后一道隐藏选项题目的情况,导致失效
const toPage = page + 1; const toPage = page + 1;
const hasHiddenLogicQuizPage = const hasHiddenLogicQuizPage
data.pages.findIndex((page) => page.includes(logic.question_index)) + 1; = data.pages.findIndex((page) => page.includes(logic.question_index)) + 1;
if (hasHiddenLogicQuizPage === toPage) { if (hasHiddenLogicQuizPage === toPage) {
// 选项隐藏逻辑 // 选项隐藏逻辑
updateOptionHidden(data.hide_options, logic); updateOptionHidden(data.hide_options, logic);

View File

@@ -154,9 +154,9 @@ export default defineComponent({
question.error = translatedText.value.ThisIsARequiredQuestion; question.error = translatedText.value.ThisIsARequiredQuestion;
} }
} else if ( } else if (
answer && answer
questionType === 1 && && questionType === 1
Object.keys(answer).findIndex((value) => !answer[value]) !== -1 && Object.keys(answer).findIndex((value) => !answer[value]) !== -1
) { ) {
// 单选题 // 单选题
isError = true; isError = true;
@@ -302,9 +302,9 @@ export default defineComponent({
} else if (answer && questionType === 12) { } else if (answer && questionType === 12) {
question.error = ''; question.error = '';
} else if ( } else if (
answer && answer
questionType === 14 && && questionType === 14
Object.keys(answer).length < config.min_select && Object.keys(answer).length < config.min_select
) { ) {
// 图片多选题 // 图片多选题
isError = true; isError = true;
@@ -340,46 +340,46 @@ export default defineComponent({
const { value } = answer; const { value } = answer;
const newValue = value.replace(/\n|\r|\r\n/g, ''); const newValue = value.replace(/\n|\r|\r\n/g, '');
switch (config.text_type) { switch (config.text_type) {
case 3: // 字母 case 3: // 字母
isError = isError
config.include_mark === 1 = config.include_mark === 1
? !/^[a-zA-Z·~@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、`~!@#$%^&*()_\-+=<>?:"{}|,./;'\\[\]]+$/.test( ? !/^[a-zA-Z·~@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、`~!@#$%^&*()_\-+=<>?:"{}|,./;'\\[\]]+$/.test(
newValue newValue
) || !newValue.length ) || !newValue.length
: !/^[a-zA-Z]+$/.test(newValue) || !newValue.length; : !/^[a-zA-Z]+$/.test(newValue) || !newValue.length;
question.error = isError ? translatedText.value.PleaseEnterEnglishLetters : ''; question.error = isError ? translatedText.value.PleaseEnterEnglishLetters : '';
break; break;
case 4: // 中文 case 4: // 中文
isError = isError
config.include_mark === 1 = config.include_mark === 1
? !/^(?:[\u3400-\u4DB5\u4E00-\u9FEA\uFA0E\uFA0F\uFA11\uFA13\uFA14\uFA1F\uFA21\uFA23\uFA24\uFA27-\uFA29]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|[·~@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、`~!@#$%^&*()_\-+=<>?:"{}|,./;'\\[\]])+$/.test( ? !/^(?:[\u3400-\u4DB5\u4E00-\u9FEA\uFA0E\uFA0F\uFA11\uFA13\uFA14\uFA1F\uFA21\uFA23\uFA24\uFA27-\uFA29]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|[·~@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、`~!@#$%^&*()_\-+=<>?:"{}|,./;'\\[\]])+$/.test(
newValue newValue
) || !newValue.length ) || !newValue.length
: !/^(?:[\u3400-\u4DB5\u4E00-\u9FEA\uFA0E\uFA0F\uFA11\uFA13\uFA14\uFA1F\uFA21\uFA23\uFA24\uFA27-\uFA29]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0])+$/.test( : !/^(?:[\u3400-\u4DB5\u4E00-\u9FEA\uFA0E\uFA0F\uFA11\uFA13\uFA14\uFA1F\uFA21\uFA23\uFA24\uFA27-\uFA29]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0])+$/.test(
newValue newValue
) || !newValue.length; ) || !newValue.length;
question.error = isError ? translatedText.value.PleaseEnterChineseWords : ''; question.error = isError ? translatedText.value.PleaseEnterChineseWords : '';
break; break;
case 5: // 邮箱 case 5: // 邮箱
isError = isError
!/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test( = !/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(
value value
); );
question.error = isError ? translatedText.value.PleaseEnterACorrectEmail : ''; question.error = isError ? translatedText.value.PleaseEnterACorrectEmail : '';
break; break;
case 6: // 手机号 case 6: // 手机号
isError = !/^(?:(?:\+|00)86)?1[3-9]\d{9}$/.test(value); isError = !/^(?:(?:\+|00)86)?1[3-9]\d{9}$/.test(value);
question.error = isError ? translatedText.value.PleaseEnterACorrectPhone : ''; question.error = isError ? translatedText.value.PleaseEnterACorrectPhone : '';
break; break;
case 7: // 身份证号 case 7: // 身份证号
isError = isError
!/^[1-9]\d{5}(?:18|19|20)\d{2}(?:0[1-9]|10|11|12)(?:0[1-9]|[1-2]\d|30|31)\d{3}[\dXx]$/.test( = !/^[1-9]\d{5}(?:18|19|20)\d{2}(?:0[1-9]|10|11|12)(?:0[1-9]|[1-2]\d|30|31)\d{3}[\dXx]$/.test(
value value
); );
question.error = isError ? translatedText.value.PleaseEnterACorrectID : ''; question.error = isError ? translatedText.value.PleaseEnterACorrectID : '';
break; break;
default: default:
break; break;
} }
if (!isError && value.length < config.min && ![1, 2].includes(config.text_type)) { if (!isError && value.length < config.min && ![1, 2].includes(config.text_type)) {
isError = true; isError = true;
@@ -391,54 +391,54 @@ export default defineComponent({
Object.keys(answer).forEach((key) => { Object.keys(answer).forEach((key) => {
const value = answer[key]; const value = answer[key];
switch (config.text_type) { switch (config.text_type) {
case 3: // 字母 case 3: // 字母
if ( if (
!/^[a-zA-Z·~@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、`~!@#$%^&*()_\-+=<>?:"{}|,./;'\\[\]]+$/.test( !/^[a-zA-Z·~@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、`~!@#$%^&*()_\-+=<>?:"{}|,./;'\\[\]]+$/.test(
value value
) )
) { ) {
question.error = translatedText.value.PleaseEnterEnglishLetters; question.error = translatedText.value.PleaseEnterEnglishLetters;
} }
break; break;
case 4: // 中文 case 4: // 中文
if ( if (
!/^(?:[\u3400-\u4DB5\u4E00-\u9FEA\uFA0E\uFA0F\uFA11\uFA13\uFA14\uFA1F\uFA21\uFA23\uFA24\uFA27-\uFA29]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|[·~@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、`~!@#$%^&*()_\-+=<>?:"{}|,./;'\\[\]])+$/.test( !/^(?:[\u3400-\u4DB5\u4E00-\u9FEA\uFA0E\uFA0F\uFA11\uFA13\uFA14\uFA1F\uFA21\uFA23\uFA24\uFA27-\uFA29]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|[·~@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、`~!@#$%^&*()_\-+=<>?:"{}|,./;'\\[\]])+$/.test(
value value
) )
) { ) {
question.error = translatedText.value.PleaseEnterChineseWords; question.error = translatedText.value.PleaseEnterChineseWords;
} }
break; break;
case 5: // 邮箱 case 5: // 邮箱
if ( if (
!/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test( !/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(
value value
) )
) { ) {
question.error = translatedText.value.PleaseEnterACorrectEmail; question.error = translatedText.value.PleaseEnterACorrectEmail;
} }
break; break;
case 6: // 手机号 case 6: // 手机号
if (!/^(?:(?:\+|00)86)?1[3-9]\d{9}$/.test(value)) { if (!/^(?:(?:\+|00)86)?1[3-9]\d{9}$/.test(value)) {
question.error = translatedText.value.PleaseEnterACorrectPhone; question.error = translatedText.value.PleaseEnterACorrectPhone;
} }
break; break;
case 7: // 身份证号 case 7: // 身份证号
if ( if (
!/^[1-9]\d{5}(?:18|19|20)\d{2}(?:0[1-9]|10|11|12)(?:0[1-9]|[1-2]\d|30|31)\d{3}[\dXx]$/.test( !/^[1-9]\d{5}(?:18|19|20)\d{2}(?:0[1-9]|10|11|12)(?:0[1-9]|[1-2]\d|30|31)\d{3}[\dXx]$/.test(
value value
) )
) { ) {
question.error = translatedText.value.PleaseEnterACorrectID; question.error = translatedText.value.PleaseEnterACorrectID;
} }
break; break;
default: default:
break; break;
} }
if ( if (
!question.error && !question.error
value.length < config.min && && value.length < config.min
![1, 2].includes(config.text_type) && ![1, 2].includes(config.text_type)
) { ) {
question.error = translatedText.value.PleaseEnterMoreThanOneCharacters(config.min); question.error = translatedText.value.PleaseEnterMoreThanOneCharacters(config.min);
} }
@@ -814,8 +814,8 @@ export default defineComponent({
const evt1 = {}; const evt1 = {};
if ([1].includes(question.question_type)) { if ([1].includes(question.question_type)) {
evt1.value = evt1.value
Object.keys(question.answer) = Object.keys(question.answer)
.map((key) => (question.answer[key] ? key : undefined)) .map((key) => (question.answer[key] ? key : undefined))
.filter((i) => !!i)?.[0] || undefined; .filter((i) => !!i)?.[0] || undefined;
evt1.options = question.list.flatMap((i) => i.options); evt1.options = question.list.flatMap((i) => i.options);

View File

@@ -5,9 +5,11 @@
<!-- <van-cell-group v-if="status === 1" inset style="padding-top: 15px"> --> <!-- <van-cell-group v-if="status === 1" inset style="padding-top: 15px"> -->
<van-cell-group inset style="padding-top: 15px"> <van-cell-group inset style="padding-top: 15px">
<div> <div>
<img width="100%" <img
width="100%"
src="https://files.axshare.com/gsc/DR6075/44/1a/03/441a03a8b1004755a7a392b311acf97f/images/%E6%8A%95%E6%94%BE/u14.jpg?pageId=2f9ba10c-92b8-4c9b-b40b-04e65a0b4333" src="https://files.axshare.com/gsc/DR6075/44/1a/03/441a03a8b1004755a7a392b311acf97f/images/%E6%8A%95%E6%94%BE/u14.jpg?pageId=2f9ba10c-92b8-4c9b-b40b-04e65a0b4333"
alt="" /> alt=""
/>
</div> </div>
<div class="qrcode"> <div class="qrcode">
<img :src="publishInfo.img_url" alt="" width="100px" height="100px" /> <img :src="publishInfo.img_url" alt="" width="100px" height="100px" />
@@ -108,9 +110,9 @@ type OperateItem = (typeof operateList)[0];
// } // }
// } // }
function getCode () { function getCode() {
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.proxyDomain}/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: '问卷下载',
@@ -140,27 +142,27 @@ watch(status, (val) => {
getCode(); getCode();
} }
}); });
onMounted(async () => { onMounted(async() => {
// fetchInfo(); // fetchInfo();
getCode(); getCode();
}); });
const operateBtn = (item: OperateItem) => { const operateBtn = (item: OperateItem) => {
switch (item.type) { switch (item.type) {
case 'shareLink': case 'shareLink':
shareLink(); shareLink();
break; break;
case 'copyLink': case 'copyLink':
copyLink(); copyLink();
break; break;
case 'qrCode': case 'qrCode':
downLoadImg(); downLoadImg();
break; break;
default: default:
break; break;
} }
}; };
// 复制链接 // 复制链接
function copyLink () { function copyLink() {
const input = document.createElement('input'); const input = document.createElement('input');
input.value = publishInfo.value.url; input.value = publishInfo.value.url;
document.body.appendChild(input); document.body.appendChild(input);
@@ -170,7 +172,7 @@ function copyLink () {
showToast('复制成功'); showToast('复制成功');
} }
// 分享链接 // 分享链接
function shareLink () { function shareLink() {
const params = { const params = {
type: 'shareToWx', type: 'shareToWx',
title: publishInfo.value.download_url.title, title: publishInfo.value.download_url.title,
@@ -180,11 +182,11 @@ function shareLink () {
scene: 0 // 朋友圈1 微信好友0 scene: 0 // 朋友圈1 微信好友0
}; };
console.log('shareUrl', publishInfo.value.url); 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.getSessionStorage('xToken')) { if (utils.getSessionStorage('xToken')) {
appBridge.save2Album(url, () => { appBridge.save2Album(url, () => {

View File

@@ -6,8 +6,8 @@
</template> </template>
<script setup> <script setup>
const successImg = const successImg
'https://files.axshare.com/gsc/DR6075/c7/5a/53/c75a534148d349f1bb8e185629f784ac/images/%E9%A2%84%E8%A7%88/u123.png?pageId=18fb9d8a-b9b7-465f-9bd7-625b1b78f72e'; = 'https://files.axshare.com/gsc/DR6075/c7/5a/53/c75a534148d349f1bb8e185629f784ac/images/%E9%A2%84%E8%A7%88/u123.png?pageId=18fb9d8a-b9b7-465f-9bd7-625b1b78f72e';
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>