Commit 43b44fec by 匡雅琴

添加隐私协议

1 parent ebb33293
...@@ -39,5 +39,6 @@ ...@@ -39,5 +39,6 @@
"~/*": "/*" "~/*": "/*"
}, },
"sitemapLocation": "sitemap.json", "sitemapLocation": "sitemap.json",
"lazyCodeLoading": "requiredComponents" "lazyCodeLoading": "requiredComponents",
"__usePrivacyCheck__": true
} }
\ No newline at end of file \ No newline at end of file
{ {
"component": true, "component": true,
"usingComponents": {} "usingComponents": {
"glsx-privacy": "glsx-applet-component/GlsxPrivacy/index"
}
} }
\ No newline at end of file \ No newline at end of file
...@@ -15,3 +15,4 @@ ...@@ -15,3 +15,4 @@
</view> </view>
</view> </view>
</view> </view>
<glsx-privacy appletName="智能名片" bind:agreeClick="agreeClick" bind:disagreeClick="disagreeClick"></glsx-privacy>
\ No newline at end of file \ No newline at end of file
...@@ -50,7 +50,10 @@ Component({ ...@@ -50,7 +50,10 @@ Component({
methods: { methods: {
// 获取手机号 // 获取手机号
getPhoneNumber({detail}) { getPhoneNumber({detail}) {
console.log(detail); if ( detail.errMsg && detail.errMsg.indexOf('privacy permission') !== -1 ) {
wx.hideLoading()
return;
}
if ( detail.errMsg && detail.errMsg.indexOf('user deny') !== -1 ) { if ( detail.errMsg && detail.errMsg.indexOf('user deny') !== -1 ) {
wx.hideLoading() wx.hideLoading()
return; return;
......
{ {
"component": true, "component": true,
"usingComponents": {} "usingComponents": {
"glsx-privacy": "glsx-applet-component/GlsxPrivacy/index"
}
} }
\ No newline at end of file \ No newline at end of file
...@@ -44,3 +44,4 @@ ...@@ -44,3 +44,4 @@
<button wx:else class="phoneNumber" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">合作申请</button> <button wx:else class="phoneNumber" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">合作申请</button>
</view> </view>
</view> </view>
<glsx-privacy appletName="智能名片" bind:agreeClick="agreeClick" bind:disagreeClick="disagreeClick"></glsx-privacy>
\ No newline at end of file \ No newline at end of file
// components/UserInfo/UserInfo.js // components/UserInfo/UserInfo.js
import { componentsMixin } from "../../mixins/index"; import {
componentsMixin
} from "../../mixins/index";
import util from "../../utils/util"; import util from "../../utils/util";
Component({ Component({
behaviors: [componentsMixin], behaviors: [componentsMixin],
...@@ -25,7 +27,7 @@ Component({ ...@@ -25,7 +27,7 @@ Component({
} }
}, },
isStaff: { isStaff: {
type:Boolean, type: Boolean,
defalut: false defalut: false
} }
}, },
...@@ -50,9 +52,14 @@ Component({ ...@@ -50,9 +52,14 @@ Component({
}, },
// 保存名片 // 保存名片
addPhone() { addPhone() {
let _this = this, let _this = this
{ clickCount } = this.data; const {
const { staffName, staffPhone, operation, address, agentName } = staffName,
staffPhone,
operation,
address,
agentName
} =
this.data.cardInfo; this.data.cardInfo;
wx.addPhoneContact({ wx.addPhoneContact({
firstName: staffName, firstName: staffName,
...@@ -63,19 +70,53 @@ Component({ ...@@ -63,19 +70,53 @@ Component({
workAddressState: "广东省", workAddressState: "广东省",
workAddressCity: "深圳市", workAddressCity: "深圳市",
workAddressStreet: "留仙大道3370号南山智园崇文园区1号楼14层", workAddressStreet: "留仙大道3370号南山智园崇文园区1号楼14层",
fail({ errMsg }) { fail({
if (clickCount) errMsg
}) {
let {
clickCount
} = _this.data;
if (clickCount) {
_this.setData({ _this.setData({
showAuth: errMsg == "addPhoneContact:fail auth deny", showAuth: errMsg == "addPhoneContact:fail auth deny",
}); });
_this.showSettingToast('点击右上角三个点,点击设置,开始允许访问通讯录设置');
}
else else
_this.setData({ _this.setData({
clickCount: 1, clickCount: 1,
}); });
}, },
complete(a) {
if (a.errMsg) {
// 打开权限设置页提示框
// _this.showSettingToast('点击右上角三个点,点击设置,开始允许访问通讯录设置');
}
}
});
},
returnAdd() {
console.log(8888);
this.setData({
clickCount: 0,
}); });
}, },
// 打开权限设置页提示框
showSettingToast: function (e) {
wx.showModal({
title: '提示!',
confirmText: '去设置',
showCancel: false,
content: e,
success: function (res) {
}
})
},
/**授权通讯录成功 */ /**授权通讯录成功 */
authSuccess() { authSuccess() {
this.setData({ this.setData({
...@@ -93,7 +134,9 @@ Component({ ...@@ -93,7 +134,9 @@ Component({
}, },
/** 拨打电话 */ /** 拨打电话 */
callPhone() { callPhone() {
const { staffPhone } = this.data.cardInfo; const {
staffPhone
} = this.data.cardInfo;
if (!staffPhone) { if (!staffPhone) {
util.showToast("手机号不存在"); util.showToast("手机号不存在");
return; return;
......
...@@ -10,9 +10,9 @@ ...@@ -10,9 +10,9 @@
"integrity": "sha512-hFJ48SCSvRgcwT/9TcxwNnNnWSpy2BpaBfwQwVdU6uwgFH+2OqGL435VQN7EDpIMH8YjHbiM84hueTyxAzIPqQ==" "integrity": "sha512-hFJ48SCSvRgcwT/9TcxwNnNnWSpy2BpaBfwQwVdU6uwgFH+2OqGL435VQN7EDpIMH8YjHbiM84hueTyxAzIPqQ=="
}, },
"glsx-applet-component": { "glsx-applet-component": {
"version": "1.1.18", "version": "1.1.24",
"resolved": "https://registry.npmjs.org/glsx-applet-component/-/glsx-applet-component-1.1.18.tgz", "resolved": "https://registry.npmjs.org/glsx-applet-component/-/glsx-applet-component-1.1.24.tgz",
"integrity": "sha512-oNJMLkKh/BOFyiGUDlm5r+5dvqBlZx7T9U+UQ2BkqL8R9i713sCHs+1AOsFMA1GOjsgRM2ShgzoXaQef6RQ/ew==" "integrity": "sha512-3XTG9J99rgKVJpcC7aKS/+N7CaS+MNYdy5qmWH8siFaRFiSo1PeBRDaprfjCazaud/c31RvpoDFUof/fxNkxjw=="
} }
} }
} }
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
"main": "app.js", "main": "app.js",
"dependencies": { "dependencies": {
"@vant/weapp": "^1.10.9", "@vant/weapp": "^1.10.9",
"glsx-applet-component": "^1.1.18" "glsx-applet-component": "^1.1.24"
}, },
"devDependencies": {}, "devDependencies": {},
"scripts": { "scripts": {
......
{ {
"usingComponents": {} "usingComponents": {
"glsx-privacy": "glsx-applet-component/GlsxPrivacy/index"
}
} }
\ No newline at end of file \ No newline at end of file
...@@ -33,3 +33,4 @@ ...@@ -33,3 +33,4 @@
</view> </view>
</view> </view>
<phone-number type="{{'scenario'}}" bindtoApplication="toApplication" bindupdatePhoneNumber="updatePhoneNumber" hasPhoneNumber="{{hasPhoneNumber}}"></phone-number> <phone-number type="{{'scenario'}}" bindtoApplication="toApplication" bindupdatePhoneNumber="updatePhoneNumber" hasPhoneNumber="{{hasPhoneNumber}}"></phone-number>
<glsx-privacy appletName="智能名片" bind:agreeClick="agreeClick" bind:disagreeClick="disagreeClick"></glsx-privacy>
{ {
"usingComponents": { "usingComponents": {
"pro-detail": "../../../components/proDetail/proDetail", "pro-detail": "../../../components/proDetail/proDetail",
"pro-phone-number": "../../../components/PhoneNumber/PhoneNumber" "pro-phone-number": "../../../components/PhoneNumber/PhoneNumber",
"glsx-privacy": "glsx-applet-component/GlsxPrivacy/index"
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -6,3 +6,4 @@ ...@@ -6,3 +6,4 @@
<pro-phone-number custom-class="pro_phone_number" type="product" hasPhoneNumber="{{hasPhoneNumber}}" bind:updatePhoneNumber="updatePhoneNumber"></pro-phone-number> <pro-phone-number custom-class="pro_phone_number" type="product" hasPhoneNumber="{{hasPhoneNumber}}" bind:updatePhoneNumber="updatePhoneNumber"></pro-phone-number>
</view> </view>
<no-product wx:if="{{!hasProduct}}"></no-product> <no-product wx:if="{{!hasProduct}}"></no-product>
<glsx-privacy appletName="智能名片" bind:agreeClick="agreeClick" bind:disagreeClick="disagreeClick"></glsx-privacy>
\ No newline at end of file \ No newline at end of file
...@@ -155,9 +155,11 @@ Page({ ...@@ -155,9 +155,11 @@ Page({
}) })
}else{ }else{
wx.$util.showToast('正在下载视频...') wx.$util.showToast('正在下载视频...')
console.log(vedioUrl);
wx.downloadFile({ wx.downloadFile({
url: vedioUrl, url: vedioUrl,
success(res) { success(res) {
console.log(res.tempFilePath);
if (res.statusCode === 200) { if (res.statusCode === 200) {
wx.saveVideoToPhotosAlbum({ wx.saveVideoToPhotosAlbum({
filePath: res.tempFilePath, filePath: res.tempFilePath,
......
{ {
"usingComponents": { "usingComponents": {
"gl-video-detail": "glsx-applet-component/video-detail/index", "gl-video-detail": "glsx-applet-component/video-detail/index",
"authorize": "/components/Authorize/Authorize" "authorize": "/components/Authorize/Authorize",
"glsx-privacy": "glsx-applet-component/GlsxPrivacy/index"
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -8,3 +8,4 @@ ...@@ -8,3 +8,4 @@
</block> </block>
</view> </view>
<no-product wx:if="{{!hasProduct}}"></no-product> <no-product wx:if="{{!hasProduct}}"></no-product>
<glsx-privacy appletName="智能名片" bind:agreeClick="agreeClick" bind:disagreeClick="disagreeClick"></glsx-privacy>
\ No newline at end of file \ No newline at end of file
...@@ -196,7 +196,7 @@ Page({ ...@@ -196,7 +196,7 @@ Page({
}, },
// 获取全部活动列表 // 获取全部活动列表
getActivityRecord() { getActivityRecord() {
entmicroApi.getActivityRecord({}).then(({ data, code, message }) => {meifaxi entmicroApi.getActivityRecord({}).then(({ data, code, message }) => {
if (code == -1) { if (code == -1) {
wx.showToast({ wx.showToast({
title: message, title: message,
...@@ -210,10 +210,25 @@ Page({ ...@@ -210,10 +210,25 @@ Page({
}) })
}, },
disagreeClick() {
console.log(this.selectComponent('.userInfo'));
this.selectComponent('.userInfo').returnAdd()
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
wx.getPrivacySetting({
success: res => {
console.log(res) // 返回结果为: res = { needAuthorization: true/false, privacyContractName: '《xxx隐私保护指引》' }
if (res.needAuthorization) {
// 需要弹出隐私协议
} else {
// 用户已经同意过隐私协议,所以不需要再弹出隐私协议,也能调用隐私接口
}
}
})
const app = getApp() const app = getApp()
app.getBaseData().then(res => { app.getBaseData().then(res => {
const productData = res[0].subList const productData = res[0].subList
......
...@@ -4,7 +4,8 @@ ...@@ -4,7 +4,8 @@
"company-introduce": "./components/companyIntroduce/companyIntroduce", "company-introduce": "./components/companyIntroduce/companyIntroduce",
"customer": "../../../components/customer/customer", "customer": "../../../components/customer/customer",
"gl-scenario": "glsx-applet-component/scenario/index", "gl-scenario": "glsx-applet-component/scenario/index",
"gl-subscription": "glsx-applet-component/subscription/index" "gl-subscription": "glsx-applet-component/subscription/index",
"glsx-privacy": "glsx-applet-component/GlsxPrivacy/index"
}, },
"navigationBarTitleText": "广联数科智能名片" "navigationBarTitleText": "广联数科智能名片"
} }
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<loadding wx:if="{{!cardInfo}}"></loadding> <loadding wx:if="{{!cardInfo}}"></loadding>
<block wx:if="{{!!cardInfo}}"> <block wx:if="{{!!cardInfo}}">
<view class="main-box"> <view class="main-box">
<user-info isStaff="{{isStaff}}" shareDisabled="{{shareDisabled}}" cardInfo="{{cardInfo}}" /> <user-info class="userInfo" isStaff="{{isStaff}}" shareDisabled="{{shareDisabled}}" cardInfo="{{cardInfo}}" />
<view class="main-bottom"> <view class="main-bottom">
<!-- tab介绍 --> <!-- tab介绍 -->
<view class="tab-list"> <view class="tab-list">
...@@ -50,3 +50,4 @@ ...@@ -50,3 +50,4 @@
<!-- 客服咨询 --> <!-- 客服咨询 -->
<customer wx:if="{{showCustomer}}" qrCode="{{cardInfo.qrCode}}" bindcloseQR="closeQR" /> <customer wx:if="{{showCustomer}}" qrCode="{{cardInfo.qrCode}}" bindcloseQR="closeQR" />
</block> </block>
<glsx-privacy appletName="智能名片" bind:agreeClick="agreeClick" bind:disagreeClick="disagreeClick"></glsx-privacy>
\ No newline at end of file \ No newline at end of file
...@@ -97,6 +97,6 @@ ...@@ -97,6 +97,6 @@
"compileHotReLoad": false, "compileHotReLoad": false,
"autoAudits": true "autoAudits": true
}, },
"libVersion": "2.26.1", "libVersion": "2.33.0",
"projectname": "ai-card" "projectname": "ai-card"
} }
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!