diff --git a/src/assets/css/public.scss b/src/assets/css/public.scss index 68c2b25..d21a751 100644 --- a/src/assets/css/public.scss +++ b/src/assets/css/public.scss @@ -1,6 +1,6 @@ .van-nav-bar { padding-top: var(--status-bar-height) !important; - height: calc(46px + var(--status-bar-height)) !important; + height: calc(60px + var(--status-bar-height)) !important; } .van-cell { padding: 8px !important; diff --git a/src/assets/img/back.png b/src/assets/img/back.png new file mode 100644 index 0000000..0ecde9e Binary files /dev/null and b/src/assets/img/back.png differ diff --git a/src/assets/js/appBridge.js b/src/assets/js/appBridge.js index 717c586..96b6029 100644 --- a/src/assets/js/appBridge.js +++ b/src/assets/js/appBridge.js @@ -311,5 +311,24 @@ export default { type: 'newAuthToken', cbId }); + }, + /** + * @desc H5历史记录 + */ + routerCanGoBack(router) { + const position = router.options.history.state?.position; + return typeof position === 'number' && position > 1; + }, + /** + * @desc 当前系统h5返回 + * @returns {Boolean} 操作是否成功 + */ + async h5RouterBack(router) { + const canGoBack = this.routerCanGoBack(router); + if (canGoBack) { + router.go(-1); + } else { + this.navigateBack(); + } } }; diff --git a/src/layouts/index.vue b/src/layouts/index.vue index f490801..cdec601 100644 --- a/src/layouts/index.vue +++ b/src/layouts/index.vue @@ -2,12 +2,11 @@
- + + +
@@ -15,7 +14,14 @@ diff --git a/src/layouts/utils.js b/src/layouts/utils.js index 91596a9..8df15ec 100644 --- a/src/layouts/utils.js +++ b/src/layouts/utils.js @@ -13,17 +13,17 @@ import { getDomText } from '@/utils/utils'; * @param options */ function showModal(options) { - const confirm = (...rest) => { - if (options.incompleteQuestionList?.length) { - if (options.onOk) { - options.onOk(...rest); - } - const firstQuestion = options.incompleteQuestionList[0]; - // store.commit(`common/${A_COMMON_SET_ACTIVEQUESTION}`, JSON.stringify(firstQuestion)); - // const el = document.getElementById(firstQuestion.id); - // new Scroll(el).animate(); - } - }; + // const confirm = (...rest) => { + // if (options.incompleteQuestionList?.length) { + // if (options.onOk) { + // options.onOk(...rest); + // } + // const firstQuestion = options.incompleteQuestionList[0]; + // store.commit(`common/${A_COMMON_SET_ACTIVEQUESTION}`, JSON.stringify(firstQuestion)); + // const el = document.getElementById(firstQuestion.id); + // new Scroll(el).animate(); + // } + // }; showConfirmDialog({ title: '提示', @@ -31,7 +31,7 @@ function showModal(options) { ...options }) .then(() => { - confirm(); + // confirm(); }) .catch(() => {}); } @@ -133,9 +133,7 @@ const canPlanetPublish3D = function (data) { canFB = false; qSteams.push(`(${s.title})`); } - } catch (error) { - console.warn(error); - } + } catch (error) {} } }); @@ -186,9 +184,7 @@ const canPlanetPublish3D = function (data) { qSteams.push(`(${s.title})`); } } - } catch (error) { - console.warn(error); - } + } catch (error) {} } }); @@ -396,7 +392,11 @@ function isLoopingLogicValid(data, publishType) { return false; } - +/** + * 判断问卷是否可以投放(原本应该后端实现,前端实现会有并发的问题,但后端表示做不了) + * @param sn + * @param publishType undefined投放;null投放;0投放;1预览;2投放;3测试 + */ export const canPlanetPublish = async function (sn, publishType) { const parsedPublishType = !publishType ? 2 : publishType; const num = window.location.href.indexOf('code='); diff --git a/src/views/Home/Index.vue b/src/views/Home/Index.vue index 26ac7cf..f288ab6 100644 --- a/src/views/Home/Index.vue +++ b/src/views/Home/Index.vue @@ -6,10 +6,14 @@ import { onMounted, ref } from 'vue'; // import utils from '@/assets/js/common'; // import { getUserInfo } from '@/api/common/index.js'; // import { showFailToast } from 'vant'; +import { RouterView, useRouter } from 'vue-router'; +import appBridge from '@/assets/js/appBridge'; + +const router = useRouter(); const contentShow = ref(false); const show = ref(false); -onMounted(async() => { +onMounted(async () => { contentShow.value = true; // if (utils.getSessionStorage('xToken')) { // const appToken = utils.getParameter('digitalYiliToken'); @@ -29,8 +33,9 @@ onMounted(async() => { // contentShow.value = true; // } }); -function create() { - show.value = true; +function create () { + router.push({ name: 'publish' }); + // show.value = true; } @@ -57,13 +62,13 @@ function create() { padding: 30px 10px 80px; background: linear-gradient(0deg, #f5f5f5 0%, #f5f5f5 84%, #a5d380 100%); - & > :first-child { + &> :first-child { display: flex; justify-content: space-around; border-radius: 6px; background-color: white; - & > div { + &>div { display: flex; flex-direction: column; width: 50px; diff --git a/src/views/Survey/views/Publish/Index.vue b/src/views/Survey/views/Publish/Index.vue index 1742291..04661b8 100644 --- a/src/views/Survey/views/Publish/Index.vue +++ b/src/views/Survey/views/Publish/Index.vue @@ -1,6 +1,6 @@