Compare commits
15 Commits
merge/tmp-
...
test/test-
| Author | SHA1 | Date | |
|---|---|---|---|
| 4e480d35df | |||
| bc6d243362 | |||
| a285706112 | |||
| 9c04c031ab | |||
| 0ce929f8a1 | |||
| 61ab9f11bd | |||
| 2747cb49ae | |||
| 9c8ebf8d74 | |||
| e19fef785f | |||
| 92ae114c5c | |||
| b25c366a5b | |||
| b23c21d05b | |||
| 65a24f25bb | |||
| 2a0935b581 | |||
| b31197a8b4 |
@@ -41,7 +41,13 @@ const localDevConfig = ({
|
||||
'local-2': { // 测试平台
|
||||
uniacid: 2,
|
||||
domain: 'http://localhost:8050/',
|
||||
'47': { // 修改弹窗
|
||||
uniacid: 47,
|
||||
domain: 'https://5g.aigc-quickapp.com/',
|
||||
},
|
||||
})['1']; // 选择要使用的环境配置
|
||||
|
||||
'2075': { //
|
||||
uniacid: 2075,
|
||||
domain: 'https://xcx.aigc-quickapp.com/',
|
||||
},
|
||||
})['47']; // 选择要使用的环境配置
|
||||
export default localDevConfig;
|
||||
@@ -54,11 +54,14 @@ function loadLangPackSync(lang, path) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得当前本地语言
|
||||
* @returns
|
||||
*/
|
||||
function getCurrentLocale() {
|
||||
return uni.getStorageSync('lang') || "zh-cn";
|
||||
}
|
||||
|
||||
|
||||
export default {
|
||||
langList: langConfig.langList,
|
||||
|
||||
|
||||
@@ -158,22 +158,48 @@ export default {
|
||||
success: (res) => {
|
||||
// console.log(res)
|
||||
if (res.needAuthorization) {
|
||||
// 检查本地存储中是否已经同意过隐私政策
|
||||
const privacyAgreed = uni.getStorageSync('privacyAgreed');
|
||||
if (!privacyAgreed) {
|
||||
this.popUp()
|
||||
// 额外逻辑:当前页面的隐私弹窗弹起的时候,关掉其他页面的隐私弹窗
|
||||
this.closeOtherPagePopUp(this.disPopUp)
|
||||
} else {
|
||||
this.$emit('agree')
|
||||
}
|
||||
} else {
|
||||
this.$emit('agree')
|
||||
}
|
||||
},
|
||||
});
|
||||
} else {
|
||||
this.$emit('agree')
|
||||
// 检查本地存储中是否已经同意过隐私政策
|
||||
const privacyAgreed = uni.getStorageSync('privacyAgreed');
|
||||
if (privacyAgreed) {
|
||||
this.$emit('agree');
|
||||
} else {
|
||||
this.popUp()
|
||||
// 额外逻辑:当前页面的隐私弹窗弹起的时候,关掉其他页面的隐私弹窗
|
||||
this.closeOtherPagePopUp(this.disPopUp)
|
||||
}
|
||||
}
|
||||
// #endif
|
||||
|
||||
// #ifdef QUICKAPP-WEBVIEW
|
||||
this.getPrivacySettingByQuickApp();
|
||||
// #endif
|
||||
|
||||
// #ifdef H5 || WEB
|
||||
// 检查本地存储中是否已经同意过隐私政策
|
||||
const privacyAgreed = uni.getStorageSync('privacyAgreed');
|
||||
if (privacyAgreed) {
|
||||
this.$emit('agree');
|
||||
} else {
|
||||
this.popUp()
|
||||
// 额外逻辑:当前页面的隐私弹窗弹起的时候,关掉其他页面的隐私弹窗
|
||||
this.closeOtherPagePopUp(this.disPopUp)
|
||||
}
|
||||
// #endif
|
||||
},
|
||||
//初始化监听程序
|
||||
curPageShow() {
|
||||
@@ -261,6 +287,8 @@ export default {
|
||||
this.privacyResolves.clear()
|
||||
//关闭弹窗
|
||||
this.disPopUp()
|
||||
// 保存用户授权状态到本地存储,无论同意还是不同意,都不再重复弹出
|
||||
uni.setStorageSync('privacyAgreed', true);
|
||||
//退出小程序
|
||||
uni.showModal({
|
||||
content: '未同意隐私协议,无法使用相关功能',
|
||||
@@ -281,10 +309,8 @@ export default {
|
||||
//关闭弹窗
|
||||
this.disPopUp()
|
||||
|
||||
// #ifdef QUICKAPP-WEBVIEW || H5 || WEB
|
||||
// 保存用户授权状态到本地存储,用于快应用Webview组件中的H5方式处理
|
||||
// 保存用户授权状态到本地存储,用于所有环境
|
||||
uni.setStorageSync('privacyAgreed', true);
|
||||
// #endif
|
||||
this.$emit('agree')
|
||||
},
|
||||
//打开弹窗
|
||||
|
||||
@@ -17,10 +17,6 @@
|
||||
}}</view>
|
||||
</view>
|
||||
|
||||
<!-- <view class="page-header" v-if="diyData.global && diyData.global.navBarSwitch" :style="{ backgroundImage: bgImg }">
|
||||
<ns-navbar :title-color="textNavColor" :data="diyData.global" :scrollTop="scrollTop" :isBack="false"/>
|
||||
</view> -->
|
||||
|
||||
<diy-index-page v-if="topIndexValue" ref="indexPage" :value="topIndexValue" :bgUrl="bgUrl"
|
||||
:scrollTop="scrollTop" :diyGlobal="diyData.global" class="diy-index-page">
|
||||
<template v-slot:components>
|
||||
@@ -43,35 +39,17 @@
|
||||
<view @touchmove.prevent.stop>
|
||||
<uni-popup ref="uniPopupWindow" type="center" class="wap-floating" :maskClick="false">
|
||||
<view class="small-bot">
|
||||
<!-- <view class="adver-time" wx:if="{{startadv.params.style=='default'&&startadv.params.canclose==1}}">
|
||||
<view bindtap="adverclose">跳过</view>
|
||||
<view class="time">{{clock}}s</view>
|
||||
</view>
|
||||
<view class="adver-time" wx:if="{{startadv.params.style=='default'&&startadv.params.canclose==0}}">
|
||||
<view class="time" style="line-height: 64rpx;">{{clock}}s</view>
|
||||
</view> -->
|
||||
<swiper autoplay="true" :circular="true" indicator-active-color="#fff"
|
||||
indicator-color="rgba(255,255,255,0.6)" :indicator-dots="true" interval="3000">
|
||||
<swiper-item v-for="(item, index) in adv.list" :key="index">
|
||||
<image class="slide-image" @click="$util.diyRedirectTo(item.link)" height="100%"
|
||||
:src="$util.img(item.imageUrl)" width="100%"></image>
|
||||
<!-- <image bindtap="adverclose" class="slide-image" height="100%" src="{{item.imgurl}}" width="100%" wx:if="{{item.click==1}}"></image> -->
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
<view bindtap="adverclose" class="small-bot-close" @click="closePopupWindow">
|
||||
<i class="iconfont icon-round-close" style="color:#fff"></i>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="image-wrap">
|
||||
<swiper class="swiper" style="width:100%;height: 1200rpx;" :autoplay="true" interval="3000" circular="true" :indicator-dots="true" indicator-color="#000" indicator-active-color="red">
|
||||
<swiper-item class="swiper-item" v-for="(item, index) in adv.list" :key="index" v-if="item.imageUrl" @click="$util.diyRedirectTo(item.link)">
|
||||
<view class="item">
|
||||
<image :src="$util.img(item.imageUrl)" mode="aspectFit" :show-menu-by-longpress="true"/>
|
||||
</view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
<text class="iconfont icon-round-close" @click="closePopupWindow"></text> -->
|
||||
</uni-popup>
|
||||
</view>
|
||||
</template>
|
||||
@@ -101,7 +79,7 @@
|
||||
</view>
|
||||
</uni-popup>
|
||||
|
||||
<!-- 选择门店弹出框,定位当前位置,展示最近的一个门店 -->
|
||||
<!-- 选择门店弹出框 -->
|
||||
<view @touchmove.prevent.stop class="choose-store">
|
||||
<uni-popup ref="chooseStorePopup" type="center" :maskClick="false" class="choose-store">
|
||||
<view class="choose-store-popup">
|
||||
@@ -136,8 +114,27 @@
|
||||
</view>
|
||||
</uni-popup>
|
||||
</view>
|
||||
|
||||
<hover-nav :need="true"></hover-nav>
|
||||
<!-- 隐私协议 -->
|
||||
|
||||
<!-- 隐私协议弹窗 UI (新增) -->
|
||||
<view v-if="showPrivacyModal" class="privacy-modal-mask" @touchmove.prevent>
|
||||
<view class="privacy-modal-container">
|
||||
<view class="modal-header">用户隐私保护提示</view>
|
||||
<view class="modal-body">
|
||||
<text>感谢您使用本应用,在使用前您应当阅读并同意</text>
|
||||
<text class="link" @click="viewPrivacy('privacy')">《隐私条款》</text>
|
||||
<text class="link" @click="viewPrivacy('agreement')">《用户服务协议》</text>
|
||||
<text>,当点击同意并继续时,即表示您已理解并同意该条款内容,该条款将对您产生法律约束力;如您不同意,将无法继续使用相关功能。</text>
|
||||
</view>
|
||||
<view class="modal-footer">
|
||||
<view class="btn btn-disagree" @click="handleDisagree">不同意</view>
|
||||
<view class="btn btn-agree" @click="handleAgree">同意并继续</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 隐私协议组件 (原有) -->
|
||||
<privacy-popup ref="privacyPopup"></privacy-popup>
|
||||
<to-top v-if="showTop" @toTop="scrollToTopNative()"></to-top>
|
||||
<ns-login ref="login"></ns-login>
|
||||
@@ -146,14 +143,132 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
|
||||
import diyJs from '@/common/js/diy.js';
|
||||
import scroll from '@/common/js/scroll-view.js';
|
||||
import indexJs from './public/js/index.js';
|
||||
|
||||
export default {
|
||||
mixins: [diyJs, scroll, indexJs]
|
||||
mixins: [diyJs, scroll, indexJs],
|
||||
data() {
|
||||
return {
|
||||
minScrollTop: 100,
|
||||
wechatQrcode: '',
|
||||
diyRoute: '/pages/index/index',
|
||||
showPrivacyModal: false // 新增:控制隐私弹窗显示
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
// #ifdef H5
|
||||
if (option.module && option.module == 'locationPicker') {
|
||||
option.name = '';
|
||||
}
|
||||
// #endif
|
||||
this.name = option.name || 'DIY_VIEW_INDEX';
|
||||
},
|
||||
onShow() {
|
||||
this.getFollowQrcode();
|
||||
// 页面显示时检查隐私设置
|
||||
this.checkPrivacySetting();
|
||||
},
|
||||
mounted() {
|
||||
this.unsubscribe = this.$eventBus?.onMany([
|
||||
'rubik-cube-tap',
|
||||
'picture-tap',
|
||||
'text-tap',
|
||||
'goods-list-tap',
|
||||
'presale-tap',
|
||||
'notes-tap',
|
||||
'merch-list-tap',
|
||||
'map-tap',
|
||||
'img-ads-tap',
|
||||
'many-goods-list-tap',
|
||||
'search-tap',
|
||||
], this._handleDiyGroupInteractionEvent);
|
||||
},
|
||||
beforeDestroy() {
|
||||
if (this.unsubscribe) this.unsubscribe();
|
||||
},
|
||||
methods: {
|
||||
// 检查隐私弹窗逻辑
|
||||
checkPrivacySetting() {
|
||||
// 模拟检查本地存储,看用户是否已经同意过
|
||||
// 实际项目中请替换为你真实的存储逻辑
|
||||
const hasAgreed = uni.getStorageSync('HAS_AGREED_PRIVACY');
|
||||
if (!hasAgreed) {
|
||||
// 延迟显示,防止遮挡页面渲染
|
||||
setTimeout(() => {
|
||||
this.showPrivacyModal = true;
|
||||
}, 500);
|
||||
}
|
||||
},
|
||||
|
||||
// 用户点击同意
|
||||
handleAgree() {
|
||||
// 保存同意状态
|
||||
uni.setStorageSync('HAS_AGREED_PRIVACY', true);
|
||||
this.showPrivacyModal = false;
|
||||
},
|
||||
|
||||
// 用户点击不同意
|
||||
handleDisagree() {
|
||||
// 微信小程序环境下,不同意通常退出小程序
|
||||
// #ifdef MP-WEIXIN
|
||||
uni.exitMiniProgram();
|
||||
// #endif
|
||||
// H5 或 App 下可以提示或直接不显示内容
|
||||
// #ifndef MP-WEIXIN
|
||||
uni.showToast({
|
||||
title: '您已拒绝协议,无法使用',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
// 这里可以选择关闭页面或保持弹窗
|
||||
// this.showPrivacyModal = false;
|
||||
// #endif
|
||||
},
|
||||
|
||||
// 查看具体条款(可选功能)
|
||||
viewPrivacy(type) {
|
||||
// 这里可以跳转到具体的条款页面,或者使用你现有的 privacy-popup 组件
|
||||
// 假设你有现成的组件逻辑:
|
||||
if (this.$refs.privacyPopup) {
|
||||
// 假设 privacy-popup 组件有一个 show 方法
|
||||
// this.$refs.privacyPopup.show(type);
|
||||
}
|
||||
uni.showToast({
|
||||
title: '请在此处实现查看条款逻辑',
|
||||
icon: 'none'
|
||||
});
|
||||
},
|
||||
|
||||
getFollowQrcode() {
|
||||
if (!this.$util.isWeiXin()) return;
|
||||
this.$api.sendRequest({
|
||||
url: '/wechat/api/wechat/followqrcode',
|
||||
success: res => {
|
||||
if (res.code >= 0 && res.data) {
|
||||
this.wechatQrcode = res.data.qrcode;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
officialAccountsOpen() {
|
||||
this.$refs.officialAccountsPopup.open();
|
||||
},
|
||||
officialAccountsClose() {
|
||||
this.$refs.officialAccountsPopup.close();
|
||||
},
|
||||
_handleDiyGroupInteractionEvent(payload) {
|
||||
// #ifdef H5
|
||||
return true;
|
||||
// #endif
|
||||
if (this.storeToken) {
|
||||
return true;
|
||||
}
|
||||
this.$refs.login?.open();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -199,6 +314,74 @@ export default {
|
||||
.small-bot-close i {
|
||||
font-size: 60rpx;
|
||||
}
|
||||
|
||||
/* 新增:隐私弹窗样式 */
|
||||
.privacy-modal-mask {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: rgba(0, 0, 0, 0.6); // 半透明背景
|
||||
z-index: 9999; // 确保层级最高
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.privacy-modal-container {
|
||||
width: 80%;
|
||||
background-color: #ffffff;
|
||||
border-radius: 12rpx;
|
||||
padding: 40rpx 30rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.modal-header {
|
||||
font-size: 36rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.modal-body {
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
line-height: 1.6;
|
||||
text-align: left;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.link {
|
||||
color: #007aff; // 蓝色链接
|
||||
margin: 0 4rpx;
|
||||
}
|
||||
|
||||
.modal-footer {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 0 20rpx;
|
||||
}
|
||||
|
||||
.btn {
|
||||
flex: 1;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
border-radius: 40rpx;
|
||||
font-size: 30rpx;
|
||||
text-align: center;
|
||||
margin: 0 15rpx;
|
||||
}
|
||||
|
||||
.btn-disagree {
|
||||
background-color: #f5f5f5;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.btn-agree {
|
||||
background-color: #07c160; // 微信绿
|
||||
color: #fff;
|
||||
}
|
||||
</style>
|
||||
<style scoped>
|
||||
.swiper ::v-deep .uni-swiper-dots-horizontal {
|
||||
|
||||
@@ -2,55 +2,68 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
minScrollTop: 100, // 设置回到顶端按钮显示要求,最小页面滚动距离
|
||||
wechatQrcode: '', // 公众号二维码
|
||||
diyRoute: '/pages/index/index'
|
||||
wechatQrcode: "", // 公众号二维码
|
||||
diyRoute: "/pages/index/index",
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
// #ifdef H5
|
||||
// H5地图选择位置回调数据
|
||||
if (option.module && option.module == 'locationPicker') {
|
||||
option.name = ''; // 清空地址
|
||||
if (option.module && option.module == "locationPicker") {
|
||||
option.name = ""; // 清空地址
|
||||
}
|
||||
// #endif
|
||||
this.name = option.name || 'DIY_VIEW_INDEX'; // 根据店铺运营模式,打开平台(shop)或者连锁门店(stroe)页面,接口会自行判断
|
||||
|
||||
this.name = option.name || "DIY_VIEW_INDEX"; // 根据店铺运营模式,打开平台(shop)或者连锁门店(stroe)页面,接口会自行判断
|
||||
},
|
||||
onShow() {
|
||||
// 获取关注公众号二维码
|
||||
this.getFollowQrcode();
|
||||
// 检查隐私设置并显示弹窗
|
||||
this.checkPrivacySetting();
|
||||
},
|
||||
mounted() {
|
||||
// 监听图片、文字、商品列表等组件的点击事件
|
||||
this.unsubscribe = this.$eventBus?.onMany([
|
||||
'rubik-cube-tap',
|
||||
'picture-tap',
|
||||
'text-tap',
|
||||
'goods-list-tap',
|
||||
'presale-tap',
|
||||
'notes-tap',
|
||||
'merch-list-tap',
|
||||
'map-tap',
|
||||
'img-ads-tap',
|
||||
'many-goods-list-tap',
|
||||
'search-tap',
|
||||
], this._handleDiyGroupInteractionEvent);
|
||||
this.unsubscribe = this.$eventBus?.onMany(
|
||||
[
|
||||
"rubik-cube-tap",
|
||||
"picture-tap",
|
||||
"text-tap",
|
||||
"goods-list-tap",
|
||||
"presale-tap",
|
||||
"notes-tap",
|
||||
"merch-list-tap",
|
||||
"map-tap",
|
||||
"img-ads-tap",
|
||||
"many-goods-list-tap",
|
||||
"search-tap",
|
||||
],
|
||||
this._handleDiyGroupInteractionEvent,
|
||||
);
|
||||
},
|
||||
beforeDestroy() {
|
||||
// 移除图片点击事件监听
|
||||
if (this.unsubscribe) this.unsubscribe();
|
||||
},
|
||||
methods: {
|
||||
// 检查隐私设置
|
||||
checkPrivacySetting() {
|
||||
// 延迟执行,确保组件已经挂载
|
||||
setTimeout(() => {
|
||||
if (this.$refs.privacyPopup) {
|
||||
this.$refs.privacyPopup.proactive();
|
||||
}
|
||||
}, 100);
|
||||
},
|
||||
// 关注公众号
|
||||
getFollowQrcode() {
|
||||
if (!this.$util.isWeiXin()) return;
|
||||
this.$api.sendRequest({
|
||||
url: '/wechat/api/wechat/followqrcode',
|
||||
success: res => {
|
||||
url: "/wechat/api/wechat/followqrcode",
|
||||
success: (res) => {
|
||||
if (res.code >= 0 && res.data) {
|
||||
this.wechatQrcode = res.data.qrcode;
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
officialAccountsOpen() {
|
||||
@@ -77,6 +90,6 @@ export default {
|
||||
|
||||
// 阻止事件继续传播
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user