调整告知书跳转逻辑
This commit is contained in:
parent
bbe816d9b9
commit
5be2db430b
@ -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
|
||||
}
|
||||
},
|
||||
|
||||
@ -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>
|
||||
|
||||
@ -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>
|
||||
@ -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 userdata中是否已有signFile
|
||||
const hasExistingSignFile = userInfo && userInfo.signFile;
|
||||
|
||||
// 更新localStorage userdata中的signFile
|
||||
setData({
|
||||
sign_file: sign_file.value,
|
||||
});
|
||||
|
||||
// 如果localStorage userdata中没有signFile,则调用后端API更新u_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>
|
||||
@ -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',
|
||||
},
|
||||
|
||||
@ -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从字符串转为对象
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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>({});
|
||||
|
||||
@ -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>({});
|
||||
|
||||
@ -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'
|
||||
});
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 跳转到选课列表界面
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user