Commit 90609146 authored by geruidan's avatar geruidan

上线授权通知

parent 1d69e533
<script> <script>
import {
mapActions,
mapGetters
} from 'vuex'
export default { export default {
onLaunch: function() { onLaunch: function() {
this.$store.commit('getPrivacySetting'); //是否需要授权
}, },
onShow: function() { onShow: function() {},
}, onHide: function() {}
onHide: function() {
}
} }
</script> </script>
<style lang="scss"> <style lang="scss">
@import "uview-ui/index.scss"; @import "uview-ui/index.scss";
@import '@/static/style/common.scss'; @import '@/static/style/common.scss';
@import '@/static/style/total.scss'; @import '@/static/style/total.scss';
page {
page {
-webkit-overflow-scrolling: touch; // ios滑动不流畅 -webkit-overflow-scrolling: touch; // ios滑动不流畅
height: 100%; height: 100%;
// background: #f0f0f0; // background: #f0f0f0;
...@@ -22,10 +26,11 @@ page { ...@@ -22,10 +26,11 @@ page {
font-family: OPPOSANS; font-family: OPPOSANS;
word-break: break-all; //英文文本不换行 word-break: break-all; //英文文本不换行
white-space: normal; white-space: normal;
} }
// tab图标
.uni-tabbar .uni-tabbar__icon { // tab图标
.uni-tabbar .uni-tabbar__icon {
width: 25px !important; width: 25px !important;
height: 25px !important; height: 25px !important;
} }
</style> </style>
<template>
<view>
<u-modal :show="showPrivacy" title="用户隐私保护提示" :showConfirmButton="false">
<view class="slot-content">
<slot name="default">
<view class="privacyCon">
感谢您使用本应用,您使用本应用的服务之前请仔细阅读并同意
<text class="blue" @click="handleOpenPrivacyContract()">《用户隐私保护指引》</text>
。当您点击同意并开始使用产品服务时,即表示你已理解并同意该条款内容,该条款将对您产生法律约束力。如您拒绝,将无法使用相应服务。
</view>
<view class="privacyBtn">
<button id="agree-btn" type="primary" class="item agree" open-type="agreePrivacyAuthorization"
@agreeprivacyauthorization="handleAgreePrivacyAuthorization">同意</button>
<!-- <u-button open-type="agreePrivacyAuthorization" @agreeprivacyauthorization="agreeprivacyauthorization" type="primary" text="同意并继续" color="#00c791"></u-button> -->
<!-- <button id="agree-btn" open-type="agreePrivacyAuthorization" bindagreeprivacyauthorization="handleAgreePrivacyAuthorization">同意</button> -->
<u-button type="default" plain text="不同意" @click="unAgreeAuth" color="#00c791"></u-button>
</view>
</slot>
</view>
</u-modal>
</view>
</template>
<script>
import {
mapActions,
mapGetters
} from 'vuex'
export default {
data() {
return {
}
},
computed: {
...mapGetters(['showPrivacy'])
},
methods: {
// 打开用户隐私保护文件
handleOpenPrivacyContract() {
this.$store.commit('openPrivacyContract');
},
//是否需要授权
handleAgreePrivacyAuthorization() {
this.$store.commit('agreePrivacyAuthorization');
},
// 不同意
unAgreeAuth() {
// this.$u.toast("同意也得同意不同意也得同意。哈哈哈哈");
uni.exitMiniProgram({
success: () => {
console.log('退出小程序成功');
}
})
},
created() {
}
}
}
</script>
<style lang="scss">
.privacyCon {
margin-bottom: 30rpx;
}
.privacyBtn {
button {
margin-bottom: 30rpx;
}
}
#agree-btn{
color:#00c791;
}
</style>
...@@ -3,20 +3,15 @@ ...@@ -3,20 +3,15 @@
*/ */
// export const BASE_URL = 'http://172.18.0.229:9001' //后台根域名 https://demo.shopro.top // export const BASE_URL = 'http://172.18.0.229:9001' //后台根域名 https://demo.shopro.top
export const BASE_URL = 'https://wxcs.zhonghuihaotai.com' //后台根域名 https://demo.shopro.top export const BASE_URL = 'https://wx.zhonghuihaotai.com' //后台根域名 https://demo.shopro.top
// export const BASE_URL = 'https://wxcs.zhonghuihaotai.com' //后台根域名 https://demo.shopro.top // export const BASE_URL = 'https://wxcs.zhonghuihaotai.com' //后台根域名 https://demo.shopro.top
export const API_URL = `${BASE_URL}/api/a1/` //后台接口域名 export const API_URL = `${BASE_URL}/api/a1/` //后台接口域名
export const IMG_URL = 'http://file.shopro.top' //全局网络图片地址变量,css背景图片地址变量在uni.scss export const IMG_URL = 'http://file.shopro.top' //全局网络图片地址变量,css背景图片地址变量在uni.scss
export const MAP_KEY = '426ebc3f1bbaced***89ee6061a98'; //高德地图开发者Web服务key,逆坐标解析 export const MAP_KEY = '426ebc3f1bbaced***89ee6061a98'; //高德地图开发者Web服务key,逆坐标解析
export const HAS_LIVE = false //后台是否开通直播权限,根据情况在manifest.json中,开启注释相应组件的引入,pages.json中打开直播 export const HAS_LIVE = false //后台是否开通直播权限,根据情况在manifest.json中,开启注释相应组件的引入,pages.json中打开直播
// http://172.18.1.66:9001/api/a1/mall/homePage/mp?code={前端传入的code} // http://172.18.1.66:9001/api/a1/mall/homePage/mp?code={前端传入的code}
export const MALL_ID ="106975910000477"; export const MALL_ID ="189099911100589";
export const COMPANY_ID ="999999998"; export const COMPANY_ID ="20230328";
export const APP_SECRET = "F61F93E15F6346A88BCE3781E0EFC3BB";//secretid export const APP_ID = "wx91fa336def077983"; //小程序APPID
export const APP_KEY = "a20511dcfd6b07114afacbb482b2e7e0"; //appkey export const APP_KEY = "a20511dcfd6b07114afacbb482b2e7e0"; //appkey
export const APP_ID = "wx60c6530c49c52ff7"; //小程序APPID
\ No newline at end of file
...@@ -54,12 +54,12 @@ ...@@ -54,12 +54,12 @@
"quickapp" : {}, "quickapp" : {},
/* 小程序特有相关 */ /* 小程序特有相关 */
"mp-weixin" : { "mp-weixin" : {
"appid" : "wx60c6530c49c52ff7", "appid" : "wx91fa336def077983",
"setting" : { "setting" : {
"urlCheck" : true, "urlCheck" : false,
"minified" : false, "minified" : false,
"es6" : false, "es6" : true,
"postcss" : true "postcss" : false
}, },
"usingComponents" : true, "usingComponents" : true,
"permission" : { "permission" : {
...@@ -67,14 +67,15 @@ ...@@ -67,14 +67,15 @@
"desc" : "获取您的信息位置" "desc" : "获取您的信息位置"
} }
}, },
"functionalPages":true, "functionalPages" : true,
"plugins" : { "plugins" : {
"myPlugin": { "myPlugin" : {
"version": "1.8.5", "version" : "1.8.5",
"provider": "wxae5e29812005203f" "provider" : "wxae5e29812005203f"
}
} }
}, },
"__usePrivacyCheck__" : true
},
"mp-alipay" : { "mp-alipay" : {
"usingComponents" : true "usingComponents" : true
}, },
......
...@@ -13,19 +13,19 @@ ...@@ -13,19 +13,19 @@
AppSecret: 7f2855a8ff743f1f295ecb9af07f5998 AppSecret: 7f2855a8ff743f1f295ecb9af07f5998
``` ```
#### 正式 #### 正式
### 微信步数(zhmp):正式 ### 理品堂步数小程序 ---- 不用
```
商城:133507311100590
企业:202203282
APPID: wx60c6530c49c52ff7
```
### 理品堂步数小程序
``` ```
企业:741 企业:741
商城id:169782111100588 商城id:169782111100588
AppID(小程序ID) :wxf462b300a28539ec AppID(小程序ID) :wxf462b300a28539ec
AppSecret(小程序密钥) :aafbb74ee3e6dcc1c567d6c6ac721870 AppSecret(小程序密钥) :aafbb74ee3e6dcc1c567d6c6ac721870
``` ```
### 微信步数(zhmp):正式
```
商城:133507311100590
企业:202203282
APPID: wx60c6530c49c52ff7
```
### 无步数商城小程序 :正式 中汇豪泰小程序 ### 无步数商城小程序 :正式 中汇豪泰小程序
...@@ -78,7 +78,7 @@ appsecrect:b54c621093db1abcecac2882e42abb43 ...@@ -78,7 +78,7 @@ appsecrect:b54c621093db1abcecac2882e42abb43
``` ```
### 康喜日鲜小程序 ### 康喜日鲜小程序 --不用选择企业,需设置企业id
``` ```
APPID:wxd309f8271bf6472d APPID:wxd309f8271bf6472d
APPsecret:a57b7789d6e50492e33c80b63f950d8e APPsecret:a57b7789d6e50492e33c80b63f950d8e
......
<template> <template>
<view class=""> <view class="">
<view class="load"> <view class="load">
<u-loading-page <u-loading-page loading-color="#61b077" color="#61b077" :loading="loading"></u-loading-page>
loading-color="#61b077"
color="#61b077"
:loading="loading"
></u-loading-page>
</view> </view>
<view class="screen-container"> <view class="screen-container">
<!-- 康喜日鲜 --> <!-- 康喜日鲜 -->
<image class="bg" :src="defalutBg" mode="scaleToFill" /> <image class="bg" :src="defalutBg" mode="scaleToFill" />
...@@ -18,6 +13,7 @@ ...@@ -18,6 +13,7 @@
马上进入 马上进入
</button> </button>
</view> </view>
<sh-privacy></sh-privacy>
</view> </view>
</template> </template>
...@@ -34,33 +30,38 @@ ...@@ -34,33 +30,38 @@
mapActions, mapActions,
mapGetters mapGetters
} from 'vuex' } from 'vuex'
import shPrivacy from '@/components/sh-privacy/index.vue';
export default { export default {
components: {
shPrivacy,
},
data() { data() {
return { return {
unregistered: false, unregistered: false,
checkSessionStatus: false, checkSessionStatus: false,
loading: true, loading: true,
companyId:"" , companyId: "",
defalutBg:defalutBg defalutBg: defalutBg,
showPrivacy:false
} }
}, },
computed: { computed: {
...mapGetters(['userInfo', 'todayNum']) ...mapGetters(['userInfo', 'todayNum'])
}, },
methods: { methods: {
...mapActions(['getPhoneNumber', 'registerInfoFn', 'authCheck', 'getUserInfo','enterprise']), ...mapActions(['getPhoneNumber', 'registerInfoFn', 'authCheck', 'getUserInfo', 'enterprise']),
// 马上进入 // 马上进入
enter() { enter() {
if (this.unregistered && !this.loading) { if (this.unregistered && !this.loading) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/h5/index', url: '/pages/h5/index',
}) })
}else{ } else {
this.getInfoPhoneNumber() this.getInfoPhoneNumber()
} }
}, },
// 自动注册 // 自动注册
async autoRegister(companyId){ async autoRegister(companyId) {
let register = await this.registerInfoFn(companyId); let register = await this.registerInfoFn(companyId);
if (register) { //注册成功 if (register) { //注册成功
this.unregistered = true; this.unregistered = true;
...@@ -72,9 +73,9 @@ ...@@ -72,9 +73,9 @@
// 获取手机号 // 获取手机号
async getInfoPhoneNumber(e) { async getInfoPhoneNumber(e) {
let list = await this.enterprise() let list = await this.enterprise()
if(list.length == 1) { if (list.length == 1) {
this.autoRegister(list[0].companyId) this.autoRegister(list[0].companyId)
}else{ } else {
uni.navigateTo({ uni.navigateTo({
url: '/pages/user/enterprise' url: '/pages/user/enterprise'
}) })
...@@ -82,7 +83,7 @@ ...@@ -82,7 +83,7 @@
}, },
async auth() { async auth() {
let auth = await this.authCheck(); let auth = await this.authCheck();
console.log("调用authcheck的值"+auth) console.log("调用authcheck的值" + auth)
this.loading = false; this.loading = false;
let that = this; let that = this;
if (auth == 0) { if (auth == 0) {
...@@ -108,14 +109,15 @@ ...@@ -108,14 +109,15 @@
*/ */
if (this.checkSessionStatus && token) { if (this.checkSessionStatus && token) {
let token = uni.getStorageSync('token'); let token = uni.getStorageSync('token');
console.log("token的值===================="+token) console.log("token的值====================" + token)
this.auth(); this.auth();
} else { } else {
console.log("走吗1") console.log("走吗1")
// session 不存在,调用login。userInfo 。更新session // session 不存在,调用login。userInfo 。更新session
uni.login({ uni.login({
success: function(info) { //调用code success: function(info) { //调用code
console.log("code000000000000000000000000==========", info.code,that.companyId) console.log("code000000000000000000000000==========", info.code, that
.companyId)
that.$store.commit('wxCode', info.code); //按钮切换全选。 that.$store.commit('wxCode', info.code); //按钮切换全选。
let userInfo = that.getUserInfo(info.code); let userInfo = that.getUserInfo(info.code);
userInfo.then(res => { userInfo.then(res => {
...@@ -125,20 +127,20 @@ ...@@ -125,20 +127,20 @@
console.log("checkcode拿到了拿到了") console.log("checkcode拿到了拿到了")
console.log(checkCode) console.log(checkCode)
that.unregistered = true; that.unregistered = true;
}else if(checkCode == 2001){ } else if (checkCode == 2001) {
that.unregistered = false; that.unregistered = false;
} }
}) })
}) })
}, },
fail:function(err){ fail: function(err) {
console.log(err) console.log(err)
that.loading = false; that.loading = false;
uni.showToast({ uni.showToast({
title: err, title: err,
duration: 2000, duration: 2000,
icon:'none' icon: 'none'
}); });
} }
...@@ -163,7 +165,32 @@ ...@@ -163,7 +165,32 @@
that.loginSession() that.loginSession()
} }
}) })
},
// // 获取隐私授权
// privacySetting() {
// wx.getPrivacySetting({
// success: res => {
// console.log(
// res) // 返回结果为: res = { needAuthorization: true/false, privacyContractName: '《xxx隐私保护指引》' }
// if (res.needAuthorization) {
// // 需要弹出隐私协议
// this.showPrivacy=true
// } else {
// this.showPrivacy=true
// // 用户已经同意过隐私协议,所以不需要再弹出隐私协议,也能调用已声明过的隐私接口
// // wx.getUserProfile()
// // wx.chooseMedia()
// // wx.getClipboardData()
// // wx.startRecord()
// }
// },
// fail: () => {},
// complete: () => {}
// })
// },
//授权callback
privacyCal(){
this.showPrivacy = false
} }
}, },
onHide() {}, onHide() {},
...@@ -172,24 +199,28 @@ ...@@ -172,24 +199,28 @@
}, },
onReady() { onReady() {
wx.clearStorage(); wx.clearStorage();
if(COMPANY_ID){ //配置了COMPANY_ID用COMPANY_ID 。否则用router上的COMPANY_ID if (COMPANY_ID) { //配置了COMPANY_ID用COMPANY_ID 。否则用router上的COMPANY_ID
this.companyId = COMPANY_ID this.companyId = COMPANY_ID
} }
if(this.$Route.query.companyId){ if (this.$Route.query.companyId) {
this.companyId = this.$Route.query.companyId this.companyId = this.$Route.query.companyId
} }
if(!COMPANY_ID && !this.$Route.query.companyId){ if (!COMPANY_ID && !this.$Route.query.companyId) {
this.companyId = "" this.companyId = ""
} }
uni.setStorageSync("companyId",this.companyId ) uni.setStorageSync("companyId", this.companyId)
this.getAuth(); this.getAuth();
}, },
onShareAppMessage(res){ onShareAppMessage(res) {
return { return {
path: 'pages/index/defalutScreen' path: 'pages/index/defalutScreen'
} }
}, },
onLoad(options){ onLoad(options) {
} }
......
...@@ -48,72 +48,6 @@ ...@@ -48,72 +48,6 @@
} }
}) })
// var userInfo = {
// userId: 'user111111111',
// data: [{
// "key": "real_name",
// "value": "用户A"
// },
// {
// "key": "mobile_phone",
// "value": "13800000000"
// },
// {
// "key": "email",
// "value": "13800000000@163.com"
// },
// {
// "index": 0,
// "key": "account",
// "label": "账号",
// "value": "zhangsan",
// "href": "http://example.domain/user/zhangsan"
// },
// {
// "index": 1,
// "key": "sex",
// "label": "性别",
// "value": "先生"
// },
// {
// "index": 2,
// "key": "reg_date",
// "label": "注册日期",
// "value": "2015-11-16"
// },
// {
// "index": 3,
// "key": "last_login",
// "label": "上次登录时间",
// "value": "2015-12-22 15:38:54"
// },
// {
// "index": 4,
// "key": "avatar",
// "label": "头像",
// "value": "https://ysf.nosdn.127.net/985726b5a8840b84a8a90c6b71642813"
// }
// ],
// }
// myPluginInterface._$configTitle('七鱼客服11'); //设置客服聊天窗口标题
// let product = {
// title: '[1]任天堂(Nintendo)Switch游戏机',
// desc: '任天堂(Nintendo) Switch NS NX掌上游戏机便携 塞尔达马里奥新款游戏机 主机不锁 日版黑机彩色手柄+中文赛/塞尔达传说(指南+地图)',
// note: '$2330',
// picture: 'https://img10.360buyimg.com/n5/s75x75_jfs/t4030/290/29851193/293745/d5e2b731/58ac3506Nbb57b5f6.jpg',
// url: 'https://www.taobao.com/',
// isShow: 1,
// sendByUser: 1,
// sendProToRobot: 1,
// };
// myPluginInterface._$configProduct(product); //配置商品信息
// myPluginInterface._$sendProduct(product); //自动发送
} }
}, },
created() { created() {
......
...@@ -3,12 +3,14 @@ import Vuex from 'vuex' ...@@ -3,12 +3,14 @@ import Vuex from 'vuex'
Vue.use(Vuex) Vue.use(Vuex)
import user from './modules/user.js' import user from './modules/user.js'
import privacy from './modules/privacy.js'
// import cart from './modules/cart.js' // import cart from './modules/cart.js'
// import cofirm from './modules/cofirm.js' // import cofirm from './modules/cofirm.js'
const store = new Vuex.Store({ const store = new Vuex.Store({
modules: { modules: {
user user,
privacy
} }
}) })
......
// 用户数据模块
import http from '@/shopro/request/index'
import api from "@/shopro/request/index";
import {
MALL_ID,
COMPANY_ID
} from "@/env";
import qs from 'qs';
const state = {
showPrivacy:false,
}
const getters = {
showPrivacy: state => state.showPrivacy,
}
const actions = {
}
const mutations = {
// 获取隐私-查询隐私是否需要授权
getPrivacySetting(
state
) {
wx.getPrivacySetting({
success(res) {
console.log('是否需要授权:', res.needAuthorization, '隐私协议的名称为:', res.privacyContractName);
if (res.needAuthorization) {
state.showPrivacy = true
} else {
state.showPrivacy = false
}
}
})
},
// 打开协议文章
openPrivacyContract() {
wx.openPrivacyContract({
success: () => {}, // 打开成功
fail: () => {
this.$u.toast("遇到错误");
}
})
},
// 同意隐私协议
agreePrivacyAuthorization(state) {
wx.requirePrivacyAuthorize({
success: res => {
console.log(res)
state.showPrivacy = false
}
});
},
}
export default {
state,
mutations,
actions,
getters
}
...@@ -24,7 +24,9 @@ ...@@ -24,7 +24,9 @@
.brd{ .brd{
border-radius: 20rpx; border-radius: 20rpx;
} }
.blue{
color: #4395ff;
}
::-webkit-scrollbar { ::-webkit-scrollbar {
display: none; display: none;
width: 0 !important; width: 0 !important;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment