Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
data-table
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
hookehuyr
2023-03-03 15:11:29 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
9cdf839435c9cb319dad57b580afcfc64790f406
9cdf8394
1 parent
7b72c046
fix 预览模式下屏蔽微信功能
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
18 deletions
src/App.vue
src/components/TextField/index.vue
src/views/index.vue
src/App.vue
View file @
9cdf839
...
...
@@ -2,7 +2,7 @@
* @Author: hookehuyr hookehuyr@gmail.com
* @Date: 2022-05-26 23:52:36
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2023-03-03 1
1:12:26
* @LastEditTime: 2023-03-03 1
5:07:28
* @FilePath: /data-table/src/App.vue
* @Description:
-->
...
...
@@ -60,10 +60,10 @@ watch(
// web端判断
const is_pc = computed(() => wxInfo().isPC);
// 预览模式不需要授权
const model = $route.query.model;
onMounted(async () => {
const code = getUrlParams(location.href) ? getUrlParams(location.href).code : '';
const model = getUrlParams(location.href) ? getUrlParams(location.href).model : '';
const raw_url = encodeURIComponent(location.pathname + location.hash);
// 数据收集设置
const { data } = await getFormSettingAPI({ form_code: code });
...
...
@@ -75,7 +75,8 @@ onMounted(async () => {
store.changeFormSetting(form_setting);
// 需要网页授权-必须要域名相同,需要上传到线上测试
if (!import.meta.env.DEV && form_setting.wxzq_enable && !form_setting.x_field_weixin_openid) {
if (model === 'preview') return false;
// 预览模式不开启
if (model !== 'preview') {
$router.replace({
path: '/auth',
query: {
...
...
@@ -83,7 +84,21 @@ onMounted(async () => {
code
}
});
}
} else {
// 微信分享打开并且openid存在时,开启wx授权功能
// 预览模式不开启
if (form_setting.wxzq_enable && form_setting.x_field_weixin_openid && model !== 'preview') {
const wxJs = await wxJsAPI({ form_code: code, url: raw_url });
wxJs.data.jsApiList = apiList;
wx.config(wxJs.data);
wx.ready(() => {
wx.showAllNonBaseMenuItem();
});
wx.error((err) => {
console.warn(err);
});
}
// 判断跳转页面
if (form_setting.sjsj_enable && !form_setting.sjsj_enable) {
// 表单已结束
...
...
@@ -101,18 +116,6 @@ onMounted(async () => {
}
}
}
// 微信分享打开并且openid存在时,开启wx授权功能
if (form_setting.wxzq_enable && form_setting.x_field_weixin_openid) {
const wxJs = await wxJsAPI({ form_code: code, url: raw_url });
wxJs.data.jsApiList = apiList;
wx.config(wxJs.data);
wx.ready(() => {
wx.showAllNonBaseMenuItem();
});
wx.error((err) => {
console.warn(err);
});
}
});
</script>
...
...
src/components/TextField/index.vue
View file @
9cdf839
<!--
* @Date: 2022-08-29 14:31:20
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2023-03-0
1 16:09:00
* @LastEditTime: 2023-03-0
3 15:10:05
* @FilePath: /data-table/src/components/TextField/index.vue
* @Description: 单行文本输入框
-->
...
...
@@ -53,7 +53,11 @@ const scanType = (scan_type_code) => {
}
}
// 预览模式
const model = $route.query.model;
const clickRightIcon = async () => {
// 预览模式屏蔽微信授权
if (model === 'preview') return false;
wx.ready(() => {
wx.scanQRCode({
needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果,
...
...
src/views/index.vue
View file @
9cdf839
<!--
* @Date: 2022-07-18 10:22:22
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2023-03-03 1
2:20:49
* @LastEditTime: 2023-03-03 1
5:09:56
* @FilePath: /data-table/src/views/index.vue
* @Description: 首页
-->
...
...
@@ -285,10 +285,13 @@ onMounted(async () => {
}
// 判断是否弹出密码输入框
checkUserPassword();
// 预览模式屏蔽微信授权
if (model !== 'preview') {
wx.ready(() => {
// 自定义分享内容
sharePage({ title: form_name.value, desc: '活动报名' });
});
}
});
// 打开轮询用户是否关注
...
...
Please
register
or
login
to post a comment