Skip to content

Commit

Permalink
【v.3.4.5】用户隐私保护指引授权提示&我的借阅功能系统不可用提示优化
Browse files Browse the repository at this point in the history
  • Loading branch information
Airmole committed Sep 4, 2023
1 parent 232dbd3 commit 23909ec
Show file tree
Hide file tree
Showing 11 changed files with 107 additions and 6 deletions.
1 change: 1 addition & 0 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,6 @@
"provider": "wx4418e3e031e551be"
}
},
"__usePrivacyCheck__": true,
"sitemapLocation": "sitemap.json"
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "shellbox",
"version": "3.4.4",
"description": "电费查询绑定功能接入支持1,2,37斋宿舍楼",
"version": "3.4.5",
"description": "用户隐私保护指引授权提示&我的借阅功能系统不可用提示优化",
"author": "Airmole"
}
4 changes: 3 additions & 1 deletion pages/books/bind.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ Page({
isLoading: true,
defaultUid: '',
storageOpacPassword:'',
from: 'index'
from: 'index',
opacClosed: false,
},
onLoad: function(options) {
var that = this
Expand Down Expand Up @@ -222,6 +223,7 @@ Page({
PreInfo: res.data,
})
if (res.data.code == 500) {
that.setData({ opacClosed: true })
wx.showToast({
title: '图书馆系统异常',
icon: 'none',
Expand Down
2 changes: 1 addition & 1 deletion pages/books/bind.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
</view>
</view>
<view>
<button formType="submit" class="login-btn">确认绑定</button>
<button formType="submit" disabled="{{opacClosed}}" class="login-btn">{{opacClosed ? 'OPAC系统异常,暂无法使用':'确认登录'}}</button>
</view>
</form>
</view>
Expand Down
64 changes: 64 additions & 0 deletions pages/index/component/privacyPopup/privacyPopup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
// pages/index/component/privacyPopup/privacyPopup.js
Component({
options: {
styleIsolation: 'shared'
},
/**
* 组件的属性列表
*/
properties: {

},

/**
* 组件的初始数据
*/
data: {
innerShow: false,
contractName: '《用户隐私保护指引》'
},
lifetimes: {
attached: function () {
if (wx.getPrivacySetting) {
wx.getPrivacySetting({
success: res => {
console.log("是否需要授权:", res.needAuthorization, "隐私协议的名称为:", res.privacyContractName)
this.setData({ contractName: res.privacyContractName })
if (res.needAuthorization) {
this.popUp()
} else {
this.triggerEvent("agree")
}
},
fail: () => { },
complete: () => { },
})
} else {
// 低版本基础库不支持 wx.getPrivacySetting 接口,隐私接口可以直接调用
this.triggerEvent("agree")
}
},
},
/**
* 组件的方法列表
*/
methods: {
handleDisagree(e) {
this.triggerEvent("disagree")
this.disPopUp()
},
handleAgree(e) {
this.triggerEvent("agree")
this.disPopUp()
},
popUp() {
this.setData({ innerShow: true })
},
disPopUp() {
this.setData({ innerShow: false })
},
openPrivacyContract() {
wx.openPrivacyContract()
}
}
})
4 changes: 4 additions & 0 deletions pages/index/component/privacyPopup/privacyPopup.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}
21 changes: 21 additions & 0 deletions pages/index/component/privacyPopup/privacyPopup.wxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!--pages/index/component/privacyPopup/privacyPopup.wxml-->
<view class="cu-modal bottom-modal {{innerShow?'show':''}}">
<view class="cu-dialog" catchtap>
<view class="cu-bar bg-white">
<view class="action"></view>
<view class="action text-black">用户隐私保护提示</view>
<view class="action"></view>
</view>
<view class="padding-sm text-left">
<view class="padding">
<view class="margin-bottom-xs">首先,感谢您使用微信小程序《贝壳小盒子》,应微信团队官方《关于小程序隐私保护指引设置的公告》要求,在您使用本小程序之前请您务必授权同意本小程序相关的</view>
<view bind:tap="openPrivacyContract" class="text-blue text-lg">{{contractName}}</view>
<view class="margin-top-xs">当您点击同意并开始时用产品服务时,即表示你已理解并同息该条款内容,该条款将对您产生法律约束力。如您拒绝,将无法正常使用本小程序部分功能,包括不限于:正常显示微信头像昵称,保存成绩分享图,添加上课日程到手机,参与运动榜单排行等功能。</view>
<view class="flex justify-around padding-top">
<view class="margin-lr"><button bindtap="handleDisagree" class="cu-btn bg-red round lg">拒绝授权<text class="cuIcon-close"></text></button></view>
<view class="margin-lr"><button open-type="agreePrivacyAuthorization" bindagreeprivacyauthorization="handleAgree" class="cu-btn bg-green round lg">同意授权<text class="cuIcon-check"></text></button></view>
</view>
</view>
</view>
</view>
</view>
6 changes: 6 additions & 0 deletions pages/index/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,12 @@ Page({
goToBookSearchPage: function () {
wx.navigateTo({ url: '../books/search' })
},
agree(e){
console.log("用户同意隐私授权, 接下来可以调用隐私协议中声明的隐私接口")
},
disagree(e){
console.log("用户拒绝隐私授权, 未同意过的隐私协议中的接口将不能调用")
},
/**
* 生命周期函数--监听页面隐藏
*/
Expand Down
3 changes: 2 additions & 1 deletion pages/index/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"usingComponents": {
"tips": "./component/tips",
"feecard": "./component/feecard",
"imagemodal": "./component/imagemodal"
"imagemodal": "./component/imagemodal",
"privacy": "./component/privacyPopup/privacyPopup"
}
}
2 changes: 2 additions & 0 deletions pages/index/index.wxml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<cu-custom bgColor="bg-wegreen">
<view slot="content">贝壳小盒子</view>
</cu-custom>
<!-- 隐私协议授权 -->
<privacy bind:agree="agree" bind:disagree="disagree"></privacy>
<!-- 关注公众号组件 -->
<view class="margin"><official-account class="radius"></official-account></view>
<!-- 图书检索 -->
Expand Down
2 changes: 1 addition & 1 deletion project.private.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
}
},
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"libVersion": "2.26.0"
"libVersion": "2.33.0"
}

0 comments on commit 23909ec

Please sign in to comment.