Commit 43b44fec by 匡雅琴

添加隐私协议

1 parent ebb33293
......@@ -39,5 +39,6 @@
"~/*": "/*"
},
"sitemapLocation": "sitemap.json",
"lazyCodeLoading": "requiredComponents"
"lazyCodeLoading": "requiredComponents",
"__usePrivacyCheck__": true
}
\ No newline at end of file
{
"component": true,
"usingComponents": {}
"usingComponents": {
"glsx-privacy": "glsx-applet-component/GlsxPrivacy/index"
}
}
\ No newline at end of file
......@@ -14,4 +14,5 @@
</view>
</view>
</view>
</view>
\ No newline at end of file
</view>
<glsx-privacy appletName="智能名片" bind:agreeClick="agreeClick" bind:disagreeClick="disagreeClick"></glsx-privacy>
\ No newline at end of file
......@@ -50,7 +50,10 @@ Component({
methods: {
// 获取手机号
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 ) {
wx.hideLoading()
return;
......
{
"component": true,
"usingComponents": {}
"usingComponents": {
"glsx-privacy": "glsx-applet-component/GlsxPrivacy/index"
}
}
\ No newline at end of file
......@@ -43,4 +43,5 @@
<button wx:if="{{hasPhone}}" class="phoneNumber" bindtap="jump">合作申请</button>
<button wx:else class="phoneNumber" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">合作申请</button>
</view>
</view>
\ No newline at end of file
</view>
<glsx-privacy appletName="智能名片" bind:agreeClick="agreeClick" bind:disagreeClick="disagreeClick"></glsx-privacy>
\ No newline at end of file
// components/UserInfo/UserInfo.js
import { componentsMixin } from "../../mixins/index";
import {
componentsMixin
} from "../../mixins/index";
import util from "../../utils/util";
Component({
behaviors: [componentsMixin],
......@@ -25,7 +27,7 @@ Component({
}
},
isStaff: {
type:Boolean,
type: Boolean,
defalut: false
}
},
......@@ -50,10 +52,15 @@ Component({
},
// 保存名片
addPhone() {
let _this = this,
{ clickCount } = this.data;
const { staffName, staffPhone, operation, address, agentName } =
this.data.cardInfo;
let _this = this
const {
staffName,
staffPhone,
operation,
address,
agentName
} =
this.data.cardInfo;
wx.addPhoneContact({
firstName: staffName,
mobilePhoneNumber: staffPhone,
......@@ -63,19 +70,53 @@ Component({
workAddressState: "广东省",
workAddressCity: "深圳市",
workAddressStreet: "留仙大道3370号南山智园崇文园区1号楼14层",
fail({ errMsg }) {
if (clickCount)
fail({
errMsg
}) {
let {
clickCount
} = _this.data;
if (clickCount) {
_this.setData({
showAuth: errMsg == "addPhoneContact:fail auth deny",
});
_this.showSettingToast('点击右上角三个点,点击设置,开始允许访问通讯录设置');
}
else
_this.setData({
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() {
this.setData({
......@@ -93,7 +134,9 @@ Component({
},
/** 拨打电话 */
callPhone() {
const { staffPhone } = this.data.cardInfo;
const {
staffPhone
} = this.data.cardInfo;
if (!staffPhone) {
util.showToast("手机号不存在");
return;
......@@ -118,4 +161,4 @@ Component({
// wx.$router.jumpH5('http://scrm.dev.glsx.com.cn/dj-scrm-wx-work-main-kuangyq/#/proxy/list?sessionId=scrm-base-e059c21e-9e95-40b3-93ee-f1dfbc6411da-rop');
}
},
});
});
\ No newline at end of file
......@@ -10,9 +10,9 @@
"integrity": "sha512-hFJ48SCSvRgcwT/9TcxwNnNnWSpy2BpaBfwQwVdU6uwgFH+2OqGL435VQN7EDpIMH8YjHbiM84hueTyxAzIPqQ=="
},
"glsx-applet-component": {
"version": "1.1.18",
"resolved": "https://registry.npmjs.org/glsx-applet-component/-/glsx-applet-component-1.1.18.tgz",
"integrity": "sha512-oNJMLkKh/BOFyiGUDlm5r+5dvqBlZx7T9U+UQ2BkqL8R9i713sCHs+1AOsFMA1GOjsgRM2ShgzoXaQef6RQ/ew=="
"version": "1.1.24",
"resolved": "https://registry.npmjs.org/glsx-applet-component/-/glsx-applet-component-1.1.24.tgz",
"integrity": "sha512-3XTG9J99rgKVJpcC7aKS/+N7CaS+MNYdy5qmWH8siFaRFiSo1PeBRDaprfjCazaud/c31RvpoDFUof/fxNkxjw=="
}
}
}
......@@ -5,7 +5,7 @@
"main": "app.js",
"dependencies": {
"@vant/weapp": "^1.10.9",
"glsx-applet-component": "^1.1.18"
"glsx-applet-component": "^1.1.24"
},
"devDependencies": {},
"scripts": {
......
{
"usingComponents": {}
"usingComponents": {
"glsx-privacy": "glsx-applet-component/GlsxPrivacy/index"
}
}
\ No newline at end of file
......@@ -33,3 +33,4 @@
</view>
</view>
<phone-number type="{{'scenario'}}" bindtoApplication="toApplication" bindupdatePhoneNumber="updatePhoneNumber" hasPhoneNumber="{{hasPhoneNumber}}"></phone-number>
<glsx-privacy appletName="智能名片" bind:agreeClick="agreeClick" bind:disagreeClick="disagreeClick"></glsx-privacy>
{
"usingComponents": {
"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
......@@ -5,4 +5,5 @@
<pro-detail id="pro-detail" custom-class="{{!hasPhoneNumber?'max_page_height':''}}" cardInfo="{{cardInfo}}" proDetail="{{productData}}"></pro-detail>
<pro-phone-number custom-class="pro_phone_number" type="product" hasPhoneNumber="{{hasPhoneNumber}}" bind:updatePhoneNumber="updatePhoneNumber"></pro-phone-number>
</view>
<no-product wx:if="{{!hasProduct}}"></no-product>
\ No newline at end of file
<no-product wx:if="{{!hasProduct}}"></no-product>
<glsx-privacy appletName="智能名片" bind:agreeClick="agreeClick" bind:disagreeClick="disagreeClick"></glsx-privacy>
\ No newline at end of file
......@@ -155,9 +155,11 @@ Page({
})
}else{
wx.$util.showToast('正在下载视频...')
console.log(vedioUrl);
wx.downloadFile({
url: vedioUrl,
success(res) {
console.log(res.tempFilePath);
if (res.statusCode === 200) {
wx.saveVideoToPhotosAlbum({
filePath: res.tempFilePath,
......
{
"usingComponents": {
"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
......@@ -7,4 +7,5 @@
<authorize title="下载前需要获取您的‘添加到相册’权限,是否打开授权设置?" scopeType="writePhotosAlbum" buttonType="openSetting" bindfail="authFail" bindsuccess="authSuccess" show="{{showAuth}}"></authorize>
</block>
</view>
<no-product wx:if="{{!hasProduct}}"></no-product>
\ No newline at end of file
<no-product wx:if="{{!hasProduct}}"></no-product>
<glsx-privacy appletName="智能名片" bind:agreeClick="agreeClick" bind:disagreeClick="disagreeClick"></glsx-privacy>
\ No newline at end of file
......@@ -196,7 +196,7 @@ Page({
},
// 获取全部活动列表
getActivityRecord() {
entmicroApi.getActivityRecord({}).then(({ data, code, message }) => {meifaxi
entmicroApi.getActivityRecord({}).then(({ data, code, message }) => {
if (code == -1) {
wx.showToast({
title: message,
......@@ -210,10 +210,25 @@ Page({
})
},
disagreeClick() {
console.log(this.selectComponent('.userInfo'));
this.selectComponent('.userInfo').returnAdd()
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
wx.getPrivacySetting({
success: res => {
console.log(res) // 返回结果为: res = { needAuthorization: true/false, privacyContractName: '《xxx隐私保护指引》' }
if (res.needAuthorization) {
// 需要弹出隐私协议
} else {
// 用户已经同意过隐私协议,所以不需要再弹出隐私协议,也能调用隐私接口
}
}
})
const app = getApp()
app.getBaseData().then(res => {
const productData = res[0].subList
......
......@@ -4,7 +4,8 @@
"company-introduce": "./components/companyIntroduce/companyIntroduce",
"customer": "../../../components/customer/customer",
"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": "广联数科智能名片"
}
......@@ -6,7 +6,7 @@
<loadding wx:if="{{!cardInfo}}"></loadding>
<block wx:if="{{!!cardInfo}}">
<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">
<!-- tab介绍 -->
<view class="tab-list">
......@@ -49,4 +49,5 @@
<phone-number type="{{'home'}}" bindtoApplication="toApplication" hasPhoneNumber="{{hasPhoneNumber}}" bindupdatePhoneNumber="updatePhoneNumber" />
<!-- 客服咨询 -->
<customer wx:if="{{showCustomer}}" qrCode="{{cardInfo.qrCode}}" bindcloseQR="closeQR" />
</block>
\ No newline at end of file
</block>
<glsx-privacy appletName="智能名片" bind:agreeClick="agreeClick" bind:disagreeClick="disagreeClick"></glsx-privacy>
\ No newline at end of file
......@@ -97,6 +97,6 @@
"compileHotReLoad": false,
"autoAudits": true
},
"libVersion": "2.26.1",
"libVersion": "2.33.0",
"projectname": "ai-card"
}
\ 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!