zhxy-jzd/src/pages/base/gzs/index.vue

92 lines
2.1 KiB
Vue
Raw Normal View History

2025-08-04 15:23:50 +08:00
<template>
<BasicLayout>
<view class="p-15">
<view class="white-bg-color p-15 r-md" v-if="notice">
<view> 各位家长</view>
<view class="notice-text">
2025-09-02 21:55:01 +08:00
<view v-html="notice" />
2025-08-04 15:23:50 +08:00
</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);
2025-09-02 21:55:01 +08:00
const { setFile } = useDataStore();
2025-08-04 15:23:50 +08:00
const notice = ref("");
2025-09-02 21:55:01 +08:00
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;
}
}
2025-08-04 15:23:50 +08:00
showLoading({ title: "加载中..." });
2025-09-02 21:55:01 +08:00
const res = await xkgzsApi({ kcLx: kcLx });
2025-08-04 15:23:50 +08:00
notice.value = res.rows?.[0]?.content || "";
uni.hideLoading();
});
async function submit() {
// 显示加载中
const data = await signCompRef.value.getSyncSignature();
sign_file.value = data.base64;
2025-09-02 21:55:01 +08:00
setFile({
2025-08-04 15:23:50 +08:00
sign_file: sign_file.value,
});
2025-09-02 21:55:01 +08:00
switch (lxId.value) {
case "JC": {
uni.reLaunch({
url: "/pages/base/jc/bm",
});
} break;
default: {
uni.reLaunch({
url: "/pages/base/xk/qk/index?xklxId=" + lxId.value,
});
}
2025-08-04 15:23:50 +08:00
}
}
</script>
<style lang="scss" scoped>
.notice-text {
margin-top: 10px;
text-indent: 2em; /* 添加两个中文字符的缩进 */
}
</style>