Commit 3bb5ac4f authored by xinzhedeai's avatar xinzhedeai

better:

1. 直接爱山东扫码,
1-1. 未登录,则获取用户信息后,用户角色为消费者,,扫码不正确,则提醒
1-2. 已登录,cookie中用户角色为消费者,扫码不正确,则提醒
2. 从爱山东应用进入高区应急app,如果为消费者,则直接进入消费者首页
2-1. 消费者首页扫码,正确进入建议页面
2-2. 消费者首页扫码,不正确则提醒。
add: 消费者首页过渡页
parent de01f385
......@@ -130,17 +130,16 @@ function getUserInfo() {
let merId = gemhoUtil.getParameter('merId')
if (!merId) {
// 此处跳转过渡页面!!!!!2025年8月2日09:38:23新增
vant.Dialog.alert({
title: '信息提示',
message: '您好,消费者,请用爱山东扫一扫商家店面二维码访问~',
}).then(() => { // 关闭当前访问页面回到爱山东
lightAppJssdk.navigation.close({
success: function (data) { },
fail: function (data) { },
})
});
gemhoUtil.navigatePage('src/_consumer.html', '跳转中...')
// vant.Dialog.alert({
// title: '信息提示',
// message: '您好,消费者,请用爱山东扫一扫商家店面二维码访问~',
// }).then(() => { // 关闭当前访问页面回到爱山东
// lightAppJssdk.navigation.close({
// success: function (data) { },
// fail: function (data) { },
// })
// });
return
}
// 消费者扫码访问 添加逻辑 merId传参
......
/* 重置body背景图路径(根据实际目录调整) */
html,
body {
letter-spacing: 0.01rem;
background-color: #fff;
overflow-x: hidden;
height: 100vh;
/* 占满视口高度 */
margin: 0;
padding: 0;
}
/* 顶部标题 */
.header-title {
height: 24vh;
font-weight: bold;
color: #000;
text-align: center;
background-image: url('../image/consumers/bg.png');
/* 调整路径为相对当前CSS文件的位置 */
background-size: cover;
/* 覆盖整个背景 */
background-position: center;
/* 居中显示 */
display: flex;
justify-content: flex-end;
flex-direction: column;
align-items: center;
position: relative;
}
.header-title p{
position: relative
}
.header-title p::before{
content: '';
width: 1.87rem;
height: .55rem;
position: absolute;
top: 58%;
transform: translateY(-50%);
left: 0;
/* width: 100%; */
/* height: 100%; */
background-image: url(../image/consumers/logo.png);
background-size: cover;
}
.header-title span {
font-size: 0.38rem;
display: inline-block;
height: 0.56rem;
/* 24px转换为rem(假设1rem=100px) */
}
/* 欢迎词 */
.welcome-tip {
font-size: 0.28rem;
color: #68737d;
text-align: center;
padding: 0 0.2rem;
/* margin: 0.3rem 0; */
width: 65%;
line-height: .39rem;
margin: 1rem auto 1.5rem;
}
/* 功能按钮(覆盖原有样式) */
.func-btn {
width: 80%;
/* 占屏幕宽度80% */
height: 0.8rem;
background: #0885f3;
/* 蓝底 */
border-radius: 0.1rem;
font-family: PingFang SC;
font-weight: 500;
font-size: 0.3rem;
/* 按钮文字字号 */
color: #ffffff;
/* 白字 */
margin: 0 auto;
/* 水平居中 */
border: none;
display: block;
/* 块级元素才能居中 */
cursor: pointer;
}
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport"
content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0, viewport-fit:cover" />
<title>高区安全“码”上查监管平台-首页</title>
<link rel="stylesheet" href="_consumer.css">
<script src="../sdk/includeHead.js"></script>
</head>
<body>
<div id="app" class="page_wrapper" v-cloak>
<!-- 顶部标题 -->
<div class="header-title">
<p style="padding-left: 1rem;">
<!-- <img src="../image/consumers/logo.png" style="width: 1.87;height:.55rem; position: absolute; left: .5rem;" alt="" srcset="" /> -->
<span>欢迎您,进入安全“码”上查</span>
</p>
</div>
<!-- 欢迎词 -->
<div class="welcome-tip">如果您对商家有任何宝贵的安全建议, 请扫一扫提交,感谢您的参与!</div>
<!-- 功能按钮 -->
<button class="func-btn" @click="scanCode">去扫一扫</button>
</div>
</body>
</html>
\ No newline at end of file
/**
* author: dabao
* date: 2024-03-15
* description: 商户首页
*/
var VUE = null
window.addEventListener("load", function () {
VUE = new Vue({
el: '#app',
data() {
return {
// showDatePicker: false, // 控制日期选择器显示
// minDate: new Date(gemhoUtil.getTargetDateYMD()), // 最小可选日期
// maxDate: new Date(2099, 11, 31), // 最大可选日期
// 日期选择的最小范围,这里设置为当前日期的前 10 年
// maxDate: new Date(new Date().getFullYear() + 10, 11),
previewUrl: BASE_URL,
// 新增以下数据
formData: {
date: gemhoUtil.getTargetDateYMD(),
content: '',
contactName: '',
contactDetails: '',
photos: [],
},
merId: '',
merInformation: { // 新增商户信息对象
},
}
},
created() {
},
mounted() {
},
methods: {
navTo(url) {
// gemhoUtil.nav2asd(url)
let params = gemhoUtil.getUrlParams()
if (url == 'check_info') {
params = {
...params,
flag: 'ADD',
pageName: '_shanghu_home'
}
}
let strurl = gemhoUtil.setParameter(`_${url}.html`, params)
gemhoUtil.navigatePage(strurl, '跳转中...')
},
scanCode() { // 有菜单地址则是跳转页面,没有则是扫码操作
lightAppJssdk.device.scan({
success: function(data) {
// 获取到data为二维码的url路径,从这里取请求参数,商户id,在下面跳转本地系统路径
// alert('扫码成功'+JSON.stringify(data))
const strUrl = new URL(data);
const param = {
merId: strUrl.searchParams.get('merId'),
accessType: strUrl.searchParams.get('accessType'),
rev: (+new Date())
};
if (!param.merId) {
alert('请扫描正确的商家店面二维码')
return
} else {
let url = gemhoUtil.setParameter(`_consumer_home.html`,
param)
gemhoUtil.navigatePage(url, '跳转中...')
}
},
fail: function(data) {
//错误返回
alert('扫码失败')
},
})
},
}
});
})
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment