@@ -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 : 60 rpx ;
}
/* 新增:隐私弹窗样式 */
. 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 : 12 rpx ;
padding : 40 rpx 30 rpx ;
text - align : center ;
}
. modal - header {
font - size : 36 rpx ;
font - weight : bold ;
color : # 333 ;
margin - bottom : 20 rpx ;
}
. modal - body {
font - size : 28 rpx ;
color : # 666 ;
line - height : 1.6 ;
text - align : left ;
margin - bottom : 30 rpx ;
}
. link {
color : # 007 aff ; // 蓝色链接
margin : 0 4 rpx ;
}
. modal - footer {
display : flex ;
justify - content : space - between ;
padding : 0 20 rpx ;
}
. btn {
flex : 1 ;
height : 80 rpx ;
line - height : 80 rpx ;
border - radius : 40 rpx ;
font - size : 30 rpx ;
text - align : center ;
margin : 0 15 rpx ;
}
. btn - disagree {
background - color : # f5f5f5 ;
color : # 333 ;
}
. btn - agree {
background - color : # 07 c160 ; // 微信绿
color : # fff ;
}
< / style >
< style scoped >
. swiper : : v - deep . uni - swiper - dots - horizontal {