Commit af5f19fa by 前端

增加用户协议、隐私协议

1 parent cd869aa3
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
"pages/freqLogDetail/freqLogDetail", "pages/freqLogDetail/freqLogDetail",
"pages/freqLogUserDetail/freqLogUserDetail", "pages/freqLogUserDetail/freqLogUserDetail",
"pages/map/findCar", "pages/map/findCar",
"pages/test/test" "pages/webview/index"
], ],
"window": { "window": {
"backgroundColor": "#efeff4", "backgroundColor": "#efeff4",
...@@ -63,5 +63,9 @@ ...@@ -63,5 +63,9 @@
"desc": "你的位置信息将用于定位效果展示" "desc": "你的位置信息将用于定位效果展示"
} }
}, },
"requiredPrivateInfos":[
"getLocation",
"chooseLocation"
],
"sitemapLocation": "sitemap.json" "sitemapLocation": "sitemap.json"
} }
\ No newline at end of file \ No newline at end of file
...@@ -27,6 +27,7 @@ Page({ ...@@ -27,6 +27,7 @@ Page({
loginUserId: wx.getStorageSync('loginUserId'), loginUserId: wx.getStorageSync('loginUserId'),
ifUpdate: true ifUpdate: true
}); });
console.log(encodeURI(`${WXRequest.domain}h5/dist/index.html?sessionid=${sessionid}`))
}, },
onShow(options){ onShow(options){
const carShareInfo = wx.getStorageSync('carShareInfo'); const carShareInfo = wx.getStorageSync('carShareInfo');
......
...@@ -7,7 +7,8 @@ Page({ ...@@ -7,7 +7,8 @@ Page({
data: { data: {
username: '', username: '',
password: '', password: '',
handleDone: true handleDone: true,
isAgree: false
}, },
/** /**
...@@ -16,25 +17,37 @@ Page({ ...@@ -16,25 +17,37 @@ Page({
onLoad: function (options) { onLoad: function (options) {
}, },
formSubmit(e){console.log(e) formSubmit(e) {
console.log(e)
var that = this; var that = this;
if(!that.data.handleDone) return; if (!that.data.handleDone) return;
if(!that.data.username){ if (!that.data.username) {
wx.showModal({ wx.showModal({
content: '请输入账号', content: '请输入账号',
showCancel: false showCancel: false,
success: function (res) {
console.log(res)
}
}); });
return; return false;
} }
if(!that.data.password){ if (!that.data.password) {
wx.showModal({ wx.showModal({
content: '请输入密码', content: '请输入密码',
showCancel: false showCancel: false
}); });
return; return false;
}
if (!that.data.isAgree) {
wx.showModal({
content: '请阅读并同意隐私协议和用户协议',
showCancel: false
});
return false;
} }
that.setData({ that.setData({
handleDone: false handleDone: false
...@@ -43,23 +56,23 @@ Page({ ...@@ -43,23 +56,23 @@ Page({
WXRequest.login({ WXRequest.login({
username: that.data.username, username: that.data.username,
password: that.data.password password: that.data.password
}).then(()=>{ }).then(() => {
wx.switchTab({ wx.switchTab({
url: '../../pages/home/home' url: '../../pages/home/home'
}); });
}).catch(()=>{ }).catch(() => {
that.setData({ that.setData({
handleDone: true handleDone: true
}); });
}) })
}, },
usernameChange(e){ usernameChange(e) {
this.setData({ this.setData({
username: e.detail.value username: e.detail.value
}); });
}, },
passwordChange(e){ passwordChange(e) {
this.setData({ this.setData({
password: e.detail.value password: e.detail.value
}); });
...@@ -111,5 +124,21 @@ Page({ ...@@ -111,5 +124,21 @@ Page({
*/ */
onShareAppMessage: function () { onShareAppMessage: function () {
} },
// 协议勾选
toggleIsAgree(e) {
this.setData({
isAgree: !this.data.isAgree
})
},
// 查看用户协议、隐私协议
toAgree(e) {
console.log(e)
let id = e.currentTarget.dataset.id
wx.navigateTo({
url: `/pages/webview/index?id=${id}`
})
},
}) })
\ No newline at end of file \ No newline at end of file
<view class="login"> <view class="login">
<view class="logo"><image src="../../images/logo.png" /></view> <view class="logo">
<form bindsubmit="formSubmit"> <image src="../../images/logo.png" />
<label> </view>
<form>
<label class="label">
<image class="username-icon" src="../../images/username.png" /> <image class="username-icon" src="../../images/username.png" />
<input type="text" name="username" bindinput="usernameChange" placeholder="请输入账号" /> <input type="text" name="username" class="a_input" bindinput="usernameChange" placeholder="请输入账号" />
</label> </label>
<label> <label class="label">
<image class="password-icon" src="../../images/password.png" /> <image class="password-icon" src="../../images/password.png" />
<input type="password" name="password" bindinput="passwordChange" placeholder="请输入密码" /> <input type="password" name="password" class="a_input" bindinput="passwordChange" placeholder="请输入密码" />
</label> </label>
<view class="agree_box">
<label class="checkbox" bindtap="toggleIsAgree">
<checkbox checked="{{isAgree}}" color="#3DA5F5" class="input_icon" />
<text class="is_agree_txt">请阅读并同意</text>
<text class="link is_agree_link" data-id="privacy" catchtap="toAgree">《隐私协议》</text>
<text>和</text>
<text class="link is_agree_link" data-id="agreement" catchtap="toAgree">《用户协议》</text>
</label>
</view>
<button formType="submit" bindtap="formSubmit" type="primary" class="submit-btn">登录<view class="weui-loading" hidden="{{handleDone}}"></view></button> <button formType="submit" bindtap="formSubmit" type="primary" class="submit-btn">登录<view class="weui-loading" hidden="{{handleDone}}"></view></button>
</form> </form>
</view> </view>
\ No newline at end of file \ No newline at end of file
...@@ -14,13 +14,13 @@ form{ ...@@ -14,13 +14,13 @@ form{
display: block; display: block;
margin: 0 30rpx; margin: 0 30rpx;
} }
label{ .label{
display: block; display: block;
border-bottom: 1px solid #ececec; border-bottom: 1px solid #ececec;
padding: 10rpx 0; padding: 10rpx 0;
margin: 20rpx 0; margin: 20rpx 0;
} }
input{ .a_input{
display: inline-block; display: inline-block;
vertical-align: middle; vertical-align: middle;
width: 200px; width: 200px;
...@@ -35,3 +35,13 @@ button.submit-btn{ ...@@ -35,3 +35,13 @@ button.submit-btn{
margin-top: 40rpx; margin-top: 40rpx;
background-color: #37c060; background-color: #37c060;
} }
.input_icon{
transform: scale(0.8);
}
.agree_box{
font-size:28rpx;
color:#666;
}
.is_agree_link{
color:#37c060;
}
\ No newline at end of file \ No newline at end of file
// webviewPackage/pages/webview.js
Page({
/**
* 页面的初始数据
*/
data: {
pagePath:''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
let url = 'https://img01.glsx.com.cn/weapp/resource/saas/scrm/html/privacy.html'
if(options.id == 'agreement'){
url = 'https://img01.glsx.com.cn/weapp/resource/saas/scrm/html/agreement.html'
}
this.setData({
pagePath:url
})
console.log(options)
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file \ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
<!--webviewPackage/pages/webview.wxml-->
<web-view src="{{pagePath}}"/>
/* pages/webview/index.wxss */
\ No newline at end of file \ No newline at end of file
...@@ -13,8 +13,9 @@ Page({ ...@@ -13,8 +13,9 @@ Page({
*/ */
onLoad: function (options) { onLoad: function (options) {
let domain = WXRequest.domain.split('//')[1] let domain = WXRequest.domain.split('//')[1]
console.log(domain)
let url = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxcad686d44f4c8c4d&redirect_uri=https%3a%2f%2f${domain}%2fopenid.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect` let url = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxcad686d44f4c8c4d&redirect_uri=https%3a%2f%2f${domain}%2fopenid.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect`
console.log(url)
this.setData({ this.setData({
jumpLink: url jumpLink: url
}); });
......
...@@ -3,55 +3,52 @@ ...@@ -3,55 +3,52 @@
"setting": { "setting": {
"urlCheck": false, "urlCheck": false,
"es6": true, "es6": true,
"enhance": true,
"postcss": true, "postcss": true,
"preloadBackgroundData": false,
"minified": true, "minified": true,
"newFeature": true, "newFeature": true,
"coverView": true, "coverView": true,
"nodeModules": false,
"autoAudits": false, "autoAudits": false,
"showShadowRootInWxmlPanel": true, "showShadowRootInWxmlPanel": true,
"scopeDataCheck": false, "scopeDataCheck": false,
"uglifyFileName": false,
"checkInvalidKey": true, "checkInvalidKey": true,
"checkSiteMap": true, "checkSiteMap": true,
"uploadWithSourceMap": true, "uploadWithSourceMap": true,
"compileHotReLoad": false,
"lazyloadPlaceholderEnable": false,
"useMultiFrameRuntime": false, "useMultiFrameRuntime": false,
"useApiHook": true, "useApiHook": false,
"useApiHostProcess": false,
"babelSetting": { "babelSetting": {
"ignore": [], "ignore": [],
"disablePlugins": [], "disablePlugins": [],
"outputPath": "" "outputPath": ""
}, },
"useIsolateContext": true, "useIsolateContext": false,
"useCompilerModule": true, "userConfirmedBundleSwitch": false,
"userConfirmedUseCompilerModuleSwitch": false,
"packNpmManually": false, "packNpmManually": false,
"packNpmRelationList": [], "packNpmRelationList": [],
"minifyWXSS": true "minifyWXSS": true,
"disableUseStrict": false,
"minifyWXML": true,
"showES6CompileOption": false,
"useCompilerPlugins": false,
"ignoreUploadUnusedFiles": true,
"condition": false
}, },
"compileType": "miniprogram", "compileType": "miniprogram",
"libVersion": "1.9.91", "libVersion": "2.22.1",
"appid": "wxdae8cf8710b62fee", "appid": "wxdae8cf8710b62fee",
"projectname": "wx", "projectname": "%E8%99%8E%E5%93%A5e%E7%9B%BE",
"isGameTourist": false,
"simulatorType": "wechat", "simulatorType": "wechat",
"simulatorPluginLibVersion": {}, "simulatorPluginLibVersion": {},
"condition": { "condition": {
"search": {
"list": []
},
"conversation": {
"list": []
},
"plugin": {
"list": []
},
"game": {
"currentL": -1,
"list": []
},
"miniprogram": { "miniprogram": {
"list": [ "list": [
{ {
"id": 0,
"name": "pages/wxPublicPage/wxPublicPage", "name": "pages/wxPublicPage/wxPublicPage",
"pathName": "pages/wxPublicPage/wxPublicPage", "pathName": "pages/wxPublicPage/wxPublicPage",
"query": "", "query": "",
...@@ -60,5 +57,13 @@ ...@@ -60,5 +57,13 @@
} }
] ]
} }
},
"packOptions": {
"ignore": [],
"include": []
},
"editorSetting": {
"tabIndent": "insertSpaces",
"tabSize": 4
} }
} }
\ No newline at end of file \ No newline at end of file
{
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"libVersion": "2.30.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!