调整告知书跳转逻辑

This commit is contained in:
ywyonui 2025-09-02 21:55:01 +08:00
parent bbe816d9b9
commit 5be2db430b
10 changed files with 52 additions and 232 deletions

View File

@ -280,16 +280,9 @@
}
},
{
"path": "pages/base/gzs/xkXqk",
"path": "pages/base/gzs/index",
"style": {
"navigationBarTitleText": "兴趣课告知书",
"enablePullDownRefresh": false
}
},
{
"path": "pages/base/gzs/xkJlb",
"style": {
"navigationBarTitleText": "俱乐部告知书",
"navigationBarTitleText": "告知书",
"enablePullDownRefresh": false
}
},

View File

@ -4,7 +4,7 @@
<view class="white-bg-color p-15 r-md" v-if="notice">
<view> 各位家长</view>
<view class="notice-text">
{{ notice }}
<view v-html="notice" />
</view>
</view>
<BasicSign ref="signCompRef" title="签名"></BasicSign>
@ -32,12 +32,31 @@ import { onLoad } from "@dcloudio/uni-app";
const signCompRef = ref<any>(null);
const sign_file = ref<any>(null);
const { setData, getGlobal } = useDataStore();
const { setFile } = useDataStore();
const notice = ref("");
onLoad(async () => {
const lxId = ref("");
onLoad(async (options: any) => {
lxId.value = options.lxId || '';
let kcLx = "";
switch (lxId.value) {
case "JC": {
kcLx = "就餐";
} break;
case "816059832": {
kcLx = "俱乐部";
} break;
case "962488654": {
kcLx = "兴趣课";
} break;
default: {
uni.reLaunch({ url: '/pages/base/home/index' });
return;
}
}
showLoading({ title: "加载中..." });
const res = await xkgzsApi({ kcLx: "俱乐部" });
const res = await xkgzsApi({ kcLx: kcLx });
notice.value = res.rows?.[0]?.content || "";
uni.hideLoading();
});
@ -46,22 +65,21 @@ async function submit() {
//
const data = await signCompRef.value.getSyncSignature();
sign_file.value = data.base64;
setData({
setFile({
sign_file: sign_file.value,
});
switch (lxId.value) {
case "JC": {
uni.reLaunch({
url: "/pages/base/xk/qk/jlb",
url: "/pages/base/jc/bm",
});
/*if (getGlobal.type == 1) {
} break;
default: {
uni.reLaunch({
url: "/pages/base/xk/qk/xqk",
url: "/pages/base/xk/qk/index?xklxId=" + lxId.value,
});
}
if (getGlobal.type == 2) {
uni.reLaunch({
url: "/pages/base/xk/qk/jlb",
});
}*/
}
}
</script>

View File

@ -1,63 +0,0 @@
<template>
<BasicLayout>
<view class="p-15">
<view class="white-bg-color p-15 r-md" v-if="notice">
<view> 各位家长</view>
<view class="notice-text">
{{ notice }}
</view>
</view>
<BasicSign ref="signCompRef" title="签名"></BasicSign>
</view>
<template #bottom>
<view class="white-bg-color py-5">
<view class="flex-row items-center pb-10 pt-5">
<u-button
text="下一步"
class="mx-15"
type="primary"
@click="submit"
/>
</view>
</view>
</template>
</BasicLayout>
</template>
<script lang="ts" setup>
import { xkgzsApi } from "@/api/base/server";
import { useDataStore } from "@/store/modules/data";
import { showLoading } from "@/utils/uniapp";
import { onLoad } from "@dcloudio/uni-app";
const signCompRef = ref<any>(null);
const sign_file = ref<any>(null);
const { setData, getGlobal } = useDataStore();
const notice = ref("");
onLoad(async () => {
showLoading({ title: "加载中..." });
const res = await xkgzsApi({ kcLx: "就餐" });
notice.value = res.rows?.[0]?.content || "";
uni.hideLoading();
});
async function submit() {
//
const data = await signCompRef.value.getSyncSignature();
sign_file.value = data.base64;
setData({
sign_file: sign_file.value,
});
uni.reLaunch({
url: "/pages/base/jc/bm",
});
}
</script>
<style lang="scss" scoped>
.notice-text {
margin-top: 10px;
text-indent: 2em; /* 添加两个中文字符的缩进 */
}
</style>

View File

@ -1,101 +0,0 @@
<template>
<BasicLayout>
<view class="p-15">
<view class="white-bg-color p-15 r-md" v-if="notice">
<view> 各位家长</view>
<view class="notice-text">
{{ notice }}
</view>
</view>
<BasicSign ref="signCompRef" title="签名"></BasicSign>
</view>
<template #bottom>
<view class="white-bg-color py-5">
<view class="flex-row items-center pb-10 pt-5">
<u-button
text="下一步"
class="mx-15"
type="primary"
@click="submit"
/>
</view>
</view>
</template>
</BasicLayout>
</template>
<script lang="ts" setup>
import { ref } from "vue";
import { xkgzsApi } from "@/api/base/server";
import { updateSignFileApi } from "@/api/system/login";
import { useDataStore } from "@/store/modules/data";
import { useUserStore } from "@/store/modules/user";
import { showLoading } from "@/utils/uniapp";
import { onLoad } from "@dcloudio/uni-app";
import BasicSign from "@/components/BasicSign/Sign.vue";
const signCompRef = ref<any>(null);
const sign_file = ref<any>(null);
const { setData, getGlobal } = useDataStore();
const userStore = useUserStore();
const notice = ref("");
onLoad(async () => {
showLoading({ title: "加载中..." });
const res = await xkgzsApi({ kcLx: "兴趣课" });
notice.value = res.rows?.[0]?.content || "";
uni.hideLoading();
});
async function submit() {
try {
//
const data = await signCompRef.value.getSyncSignature();
sign_file.value = data.base64;
//
const userInfo = userStore.getUser;
// localStorage userdatasignFile
const hasExistingSignFile = userInfo && userInfo.signFile;
// localStorage userdatasignFile
setData({
sign_file: sign_file.value,
});
// localStorage userdatasignFileAPIu_user
if (!hasExistingSignFile && userInfo && userInfo.userId) {
try {
await updateSignFileApi({
userId: userInfo.userId,
signFile: sign_file.value
});
console.log('签名数据已更新到后端数据库');
} catch (error) {
console.error('更新后端签名数据失败:', error);
// 使
}
}
//
uni.reLaunch({
url: "/pages/base/xk/qk/xqk",
});
} catch (error) {
console.error('提交签名失败:', error);
uni.showToast({
title: '签名提交失败',
icon: 'none'
});
}
}
</script>
<style lang="scss" scoped>
.notice-text {
margin-top: 10px;
text-indent: 2em; /* 添加两个中文字符的缩进 */
}
</style>

View File

@ -219,21 +219,21 @@ const menuItems = ref([
{
title: "兴趣课选课",
icon: "/static/base/home/file-text-line.png",
path: "/pages/base/gzs/xkXqk",
path: "/pages/base/gzs/index",
permissionKey: "school-xqkxk", //
lxId: '962488654',
},
{
title: "俱乐部选课",
icon: "/static/base/home/contacts-book-3-line.png",
path: "/pages/base/gzs/xkJlb",
path: "/pages/base/gzs/index",
permissionKey: "school-jlbxk", //
lxId: '816059832',
},
{
title: "就餐缴费",
icon: "/static/base/home/contacts-book-3-line.png",
path: "/pages/base/gzs/jc",
path: "/pages/base/gzs/index",
permissionKey: "school-jcjf",
lxId: 'JC',
},

View File

@ -48,7 +48,7 @@ import { jzXkCancelApi, jzXkFqJfjApi } from "@/api/base/xkApi";
import { useUserStore } from "@/store/modules/user";
import { useDataStore } from "@/store/modules/data";
import { useDebounce } from "@/utils/debounce";
const { getUser, setWsCallback } = useUserStore();
const { getUser, initWs, setWsCallback } = useUserStore();
const { getQk } = useDataStore();
//
@ -195,6 +195,7 @@ const cancelRegistration = () => {
}
} catch (error) {
console.log(error);
goBack();
}
}
}),
@ -256,6 +257,8 @@ onMounted(async() => {
console.log(error);
goBack();
}
//
initWs();
//
setWsCallback((type: string, res: any) => {
// data

View File

@ -51,8 +51,8 @@ import { PageUtils } from "@/utils/pageUtil";
import { hideLoading } from "@/utils/uniapp";
const { getCurXs, getUser, initWs, setWsCallback } = useUserStore();
const { setData, getData } = useDataStore();
const { sign_file } = getData;
const { setData, getFile } = useDataStore();
const { sign_file } = getFile;
const title = ref("");
const xklxId = ref("");
@ -151,7 +151,7 @@ const submit = debounce(async () => {
xkId: curXk.value.id,
xkkcIds: selectedXkkcIds.value,
jzId: getUser.jzId,
qmFile: sign_file ? sign_file.value : "",
qmFile: sign_file ? sign_file : "",
};
const res = await jzXkQkjApi(params);

View File

@ -42,8 +42,8 @@ import { useDataStore } from "@/store/modules/data";
import dayjs from "dayjs";
const { getCurXs, getUser } = useUserStore();
const { setData, getData } = useDataStore();
const { sign_file } = getData;
const { setData, getFile } = useDataStore();
const { sign_file } = getFile;
const curXs = computed(() => getCurXs);
const curXk = ref<any>({});

View File

@ -42,8 +42,8 @@ import { useDataStore } from "@/store/modules/data";
import dayjs from "dayjs";
const { getCurXs, getUser } = useUserStore();
const { setData, getData, setParams } = useDataStore();
const { sign_file } = getData;
const { setData, getFile, setParams } = useDataStore();
const { sign_file } = getFile;
const curXs = computed(() => getCurXs);
const curXk = ref<any>({});

View File

@ -80,7 +80,7 @@ export const PageUtils = {
switch (result.xsXkStatus) {
case 'KQK': { // KQK可抢课
uni.reLaunch({
url: "/pages/base/xk/qk/index?xklxId=" + xklxId,
url: "/pages/base/gzs/index?lxId=" + xklxId,
});
} break;
case 'QKZ': { // QKZ抢课中
@ -105,35 +105,5 @@ export const PageUtils = {
} break;
}
},
/**
*
*/
toGzs(lxId: string) {
let url = '';
switch (lxId) {
case "JC": {
url = "/pages/base/jc/gzs/jc";
} break;
case "816059832": {
url = "/pages/base/xk/gzs/xkJlb";
} break;
case "962488654": {
url = "/pages/base/xk/gzs/xkXqk";
} break;
}
if (url) {
uni.navigateTo({
url,
});
} else {
uni.showToast({
title: '类型异常,无法跳转到告知书',
icon: 'none'
});
}
},
/**
*
*/
}