Commit 48027f49 by 张立顺

用户协议内容更新

1 parent 7eb967e6
...@@ -85,5 +85,11 @@ ...@@ -85,5 +85,11 @@
"scope.userLocation": { "scope.userLocation": {
"desc": "你的位置信息将用于小程序位置接口的效果展示" "desc": "你的位置信息将用于小程序位置接口的效果展示"
} }
},
"plugins": {
"authorization-plugin": {
"version": "1.0.2",
"provider": "wxe10067a63c1856ac"
}
} }
} }
\ No newline at end of file \ No newline at end of file
const filter = require('../../../utils/filter.js'); const filter = require('../../../utils/filter.js')
import req from '../../restapi.js' import req from '../../restapi.js'
import api from '../../restapi.js' import api from '../../restapi.js'
import util from '../../../utils/util.js' import util from '../../../utils/util.js'
const app = getApp() const app = getApp()
Page(filter.identityFilter({ Page(
filter.identityFilter({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
...@@ -32,7 +32,8 @@ Page(filter.identityFilter({ ...@@ -32,7 +32,8 @@ Page(filter.identityFilter({
{ {
name: '隐私政策', name: '隐私政策',
icon: './images/policy.png', icon: './images/policy.png',
url: 'https://dj.glsx.com.cn/agreement/djStorePolicy.html', url: 'https://img02.glsx.com.cn/weapp/resource/saas/scrm/html/privacy.html',
// url: 'https://dj.glsx.com.cn/agreement/djStorePolicy.html',
type: 'h5' type: 'h5'
} }
] ]
...@@ -72,9 +73,7 @@ Page(filter.identityFilter({ ...@@ -72,9 +73,7 @@ Page(filter.identityFilter({
wx.showTabBar() wx.showTabBar()
}, },
edit() { edit() {
let { let { userInfo } = app.globalData
userInfo
} = app.globalData
console.log(userInfo) console.log(userInfo)
let url = `../edit/edit?uuid=${userInfo.uuid}` let url = `../edit/edit?uuid=${userInfo.uuid}`
util.navigateTo(url) util.navigateTo(url)
...@@ -86,7 +85,8 @@ Page(filter.identityFilter({ ...@@ -86,7 +85,8 @@ Page(filter.identityFilter({
util.showToast('系统异常') util.showToast('系统异常')
return return
} }
util.promise(resolve => { util
.promise(resolve => {
api.getFocusUserInfo(id, res => { api.getFocusUserInfo(id, res => {
console.log(res) console.log(res)
if (res.returnCode == 0) { if (res.returnCode == 0) {
...@@ -104,7 +104,7 @@ Page(filter.identityFilter({ ...@@ -104,7 +104,7 @@ Page(filter.identityFilter({
obj.shopPhoto = merchant.shopPhoto obj.shopPhoto = merchant.shopPhoto
obj.phone = merchant.phone obj.phone = merchant.phone
} }
obj.tips = '';//`${obj.name||obj.merchantName}希望可以实时关注到您的产品动态快来加入吧` obj.tips = '' //`${obj.name||obj.merchantName}希望可以实时关注到您的产品动态快来加入吧`
this.setData({ this.setData({
obj: obj obj: obj
}) })
...@@ -113,7 +113,8 @@ Page(filter.identityFilter({ ...@@ -113,7 +113,8 @@ Page(filter.identityFilter({
util.showToast('系统异常') util.showToast('系统异常')
} }
}) })
}).then(() => { })
.then(() => {
this.getQrcode() this.getQrcode()
}) })
}, },
...@@ -126,7 +127,7 @@ Page(filter.identityFilter({ ...@@ -126,7 +127,7 @@ Page(filter.identityFilter({
if (res.returnCode == 0) { if (res.returnCode == 0) {
this.setData({ this.setData({
'obj.qr': res.data, 'obj.qr': res.data,
flag: true, flag: true
}) })
} }
util.hideLoading() util.hideLoading()
...@@ -142,12 +143,12 @@ Page(filter.identityFilter({ ...@@ -142,12 +143,12 @@ Page(filter.identityFilter({
// 获取用户信息 // 获取用户信息
wx.login({ wx.login({
success: response => { success: response => {
app.globalData.code = response.code; app.globalData.code = response.code
req.logout(_res_ => { req.logout(_res_ => {
app.globalData.userInfo = null app.globalData.userInfo = null
console.log(_res_) console.log(_res_)
wx.reLaunch({ wx.reLaunch({
url: '../../../pages/index/index', url: '../../../pages/index/index'
}) })
}) })
} }
...@@ -159,28 +160,26 @@ Page(filter.identityFilter({ ...@@ -159,28 +160,26 @@ Page(filter.identityFilter({
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {},
},
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady: function () { onReady: function () {},
},
/** /**
* 生命周期函数-监听登录完成 * 生命周期函数-监听登录完成
*/ */
onLogin: function () { onLogin: function () {
util.showLoading('') util.showLoading('')
this.setData({ this.setData(
flag:true {
},()=>{ flag: true
},
() => {
wx.hideLoading() wx.hideLoading()
}) }
)
}, },
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
...@@ -197,35 +196,26 @@ Page(filter.identityFilter({ ...@@ -197,35 +196,26 @@ Page(filter.identityFilter({
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
onHide: function () { onHide: function () {},
},
/** /**
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload: function () { onUnload: function () {},
},
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh: function () { onPullDownRefresh: function () {},
},
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom: function () { onReachBottom: function () {},
},
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage: function () {
}
}))
\ No newline at end of file \ No newline at end of file
onShareAppMessage: function () {}
})
)
...@@ -3,7 +3,6 @@ const app = getApp() ...@@ -3,7 +3,6 @@ const app = getApp()
import api from '../../utils/restapi.js' import api from '../../utils/restapi.js'
import service from './service.js' import service from './service.js'
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
...@@ -20,7 +19,7 @@ Page({ ...@@ -20,7 +19,7 @@ Page({
}, },
choose() { choose() {
this.setData({ this.setData({
agree: !this.data.agree, agree: !this.data.agree
}) })
}, },
closeProtocol() { closeProtocol() {
...@@ -29,9 +28,7 @@ Page({ ...@@ -29,9 +28,7 @@ Page({
}) })
}, },
showPolicy(e) { showPolicy(e) {
let { let { url } = e.currentTarget.dataset
url
} = e.currentTarget.dataset
const baseUrl = 'https://img02.glsx.com.cn/weapp/resource/saas/scrm/html/' const baseUrl = 'https://img02.glsx.com.cn/weapp/resource/saas/scrm/html/'
const path = `${baseUrl}${url}.html` const path = `${baseUrl}${url}.html`
// let path = 'https://dj.glsx.com.cn/agreement/djStorePolicy.html' // let path = 'https://dj.glsx.com.cn/agreement/djStorePolicy.html'
...@@ -49,24 +46,24 @@ Page({ ...@@ -49,24 +46,24 @@ Page({
* 获取授权用户信息并跳转 * 获取授权用户信息并跳转
*/ */
getUserProfile(e) { getUserProfile(e) {
console.log(e)
let self = this let self = this
wx.getUserProfile({ wx.getUserProfile({
lang: 'zh_CN', lang: 'zh_CN',
desc: '用于完善会员资料', desc: '用于完善会员资料',
success: res => { success: res => {
console.log("授权:", res) console.log('授权:', res)
self.data.gender = res.userInfo.gender self.data.gender = res.userInfo.gender
wx.checkSession({ wx.checkSession({
success() { success() {
//session_key 未过期,并且在本生命周期一直有效 //session_key 未过期,并且在本生命周期一直有效
self.authUserInfo(res) console.log(res, 'getUserProfile')
self.authUserInfo(JSON.parse(JSON.stringify(res)))
}, },
fail() { fail() {
// session_key 已经失效,需要重新执行登录流程 // session_key 已经失效,需要重新执行登录流程
wx.login({ wx.login({
success: response => { success: response => {
app.globalData.code = response['code']; app.globalData.code = response['code']
self.authUserInfo(res) self.authUserInfo(res)
} }
}) })
...@@ -78,6 +75,41 @@ Page({ ...@@ -78,6 +75,41 @@ Page({
} }
}) })
}, },
getPhoneNumber({ detail }) {
console.log(detail)
this.authUserInfo(JSON.parse(JSON.stringify(detail)))
},
// 插件获取用户授权
onSuccess(e) {
let { detail: res } = e
// console.log("授权:", res)
let self = this
self.data.gender = res.userInfo.gender
wx.checkSession({
success() {
//session_key 未过期,并且在本生命周期一直有效
console.log(res, 'checkSession')
// self.authUserInfo(res)
wx.login({
success: response => {
app.globalData.code = response['code']
console.log(response, 'wx.login')
self.authUserInfo(Object.assign(res, response))
}
})
},
fail() {
// session_key 已经失效,需要重新执行登录流程
wx.login({
success: response => {
console.log(response, 'failcheckSession')
app.globalData.code = response['code']
self.authUserInfo(res)
}
})
}
})
},
/** /**
* 授权用户信息登录 * 授权用户信息登录
*/ */
...@@ -91,13 +123,13 @@ Page({ ...@@ -91,13 +123,13 @@ Page({
if (sceneData.query.employeeId) { if (sceneData.query.employeeId) {
wechatAuthSetting['sceneParam'] = sceneData.query.employeeId wechatAuthSetting['sceneParam'] = sceneData.query.employeeId
} }
api.authUserInfo(wechatAuthSetting, res => { console.log(wechatAuthSetting, 'wechatAuthSetting')
api.authUserInfo(
wechatAuthSetting,
res => {
console.log('授权用户信息登录', res) console.log('授权用户信息登录', res)
if (res.returnCode == 0) { if (res.returnCode == 0) {
let { let { userId, bizSource } = this.data
userId,
bizSource
} = this.data
let url = `../login/index/index` let url = `../login/index/index`
if (bizSource) url = `../login/index/index?userId=${userId}&bizSource=${bizSource}` if (bizSource) url = `../login/index/index?userId=${userId}&bizSource=${bizSource}`
wx.redirectTo({ wx.redirectTo({
...@@ -109,12 +141,14 @@ Page({ ...@@ -109,12 +141,14 @@ Page({
icon: 'none' icon: 'none'
}) })
} }
}, () => { },
() => {
wx.showToast({ wx.showToast({
title: '授权用户信息失败', title: '授权用户信息失败',
icon: 'none' icon: 'none'
}) })
}) }
)
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
...@@ -124,9 +158,10 @@ Page({ ...@@ -124,9 +158,10 @@ Page({
let isShare = wx.getStorageSync('isShare') let isShare = wx.getStorageSync('isShare')
if (isShare) { if (isShare) {
this.setData({ this.setData({
userId: isShare.userId, userId: isShare.userId
}) })
if (isShare.bizSource) this.setData({ if (isShare.bizSource)
this.setData({
bizSource: isShare.bizSource bizSource: isShare.bizSource
}) })
} else { } else {
...@@ -144,48 +179,35 @@ Page({ ...@@ -144,48 +179,35 @@ Page({
}) })
} }
} }
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady: function () { onReady: function () {},
},
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {},
},
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
onHide: function () { onHide: function () {},
},
/** /**
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload: function () { onUnload: function () {},
},
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh: function () { onPullDownRefresh: function () {},
},
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom: function () { onReachBottom: function () {}
}
}) })
{ {
"navigationStyle": "custom" "navigationStyle": "custom",
"usingComponents": {
"authorization-component": "plugin://authorization-plugin/authorization-component"
}
} }
\ No newline at end of file \ No newline at end of file
<view class='fixed'> <view class='fixed'>
<image src='../images/index.png' mode='widthFix'></image> <image src='../images/index.png' mode='widthFix' />
</view> </view>
<view class="login x-center {{agree?'agree':''}}"> <view class="login x-center {{agree?'agree':''}}">
<view>登录</view> <view>登录</view>
<button bindtap="getUserProfile" hidden="{{!agree}}">登录</button> <button bindtap="getUserProfile" hidden="{{!agree}}">登录</button>
<!-- <button open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">登录</button> -->
<!-- <authorization-component
args="{{args}}"
custom-class="aaaa"
bind:success="onSuccess"
bind:fail="onFail"
>
<button class="test">登录</button>
</authorization-component> -->
</view> </view>
<view class='tips'> <view class='tips'>
<view class='choose-box' bindtap="choose"></view> <view class='choose-box' bindtap="choose" />
<view class='icon'> <view class='icon'>
<image src="{{agree?'../images/ok.png':'../images/box.png'}}" class='check-img'></image> <image src="{{agree?'../images/ok.png':'../images/box.png'}}" class='check-img' />
</view> </view>
阅读并同意以下协议 阅读并同意以下协议
<!-- <text catchtap="showProtocol">《服务协议》</text> --> <!-- <text catchtap="showProtocol">《服务协议》</text> -->
...@@ -16,20 +25,23 @@ ...@@ -16,20 +25,23 @@
<text catchtap="showPolicy" data-url="privacy">《隐私协议》</text> <text catchtap="showPolicy" data-url="privacy">《隐私协议》</text>
<text catchtap="showPolicy" data-url="agreement">《用户协议》</text> <text catchtap="showPolicy" data-url="agreement">《用户协议》</text>
</view> </view>
<!-- 服务协议 --> <!-- 服务协议 -->
<view class='protocol' catchtouchmove="noScroll" hidden="{{protocol}}"> <view class='protocol' catchtouchmove="noScroll" hidden="{{protocol}}">
<view class='protocol-box'> <view class='protocol-box'>
<view class='protocol-title'> <view class='protocol-title'>
服务协议 服务协议
<view class='close' bindtap="closeProtocol"> <view class='close' bindtap="closeProtocol">
<mp-icon icon="close" color="#999" size="16"></mp-icon> <mp-icon icon="close" color="#999" size="16" />
</view> </view>
</view> </view>
<scroll-view class='protocol-content' scroll-y> <scroll-view class='protocol-content' scroll-y>
<block wx:for='{{service.data}}' wx:key='index'> <block wx:for='{{service.data}}' wx:key='index'>
<view class='title'>{{item.title}}</view> <view class='title'>{{item.title}}</view>
<block wx:for='{{item.content}}' wx:key='ind' wx:for-index='ind' wx:for-item='i'> <block
wx:for='{{item.content}}'
wx:key='ind'
wx:for-index='ind'
wx:for-item='i'>
<view class='content'>{{i}}</view> <view class='content'>{{i}}</view>
</block> </block>
</block> </block>
...@@ -37,3 +49,4 @@ ...@@ -37,3 +49,4 @@
<view class='protocol-btn' bindtap="agree">同意</view> <view class='protocol-btn' bindtap="agree">同意</view>
</view> </view>
</view> </view>
...@@ -228,5 +228,6 @@ ...@@ -228,5 +228,6 @@
] ]
} }
}, },
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html" "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"libVersion": "2.12.3"
} }
\ 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!