Commit af5f19fa by 前端

增加用户协议、隐私协议

1 parent cd869aa3
{ {
"pages": [ "pages": [
"pages/wxPublicPage/wxPublicPage", "pages/wxPublicPage/wxPublicPage",
"pages/loading/loading", "pages/loading/loading",
"pages/home/home", "pages/home/home",
"pages/authorize/authorize", "pages/authorize/authorize",
"pages/resident/resident", "pages/resident/resident",
"pages/freq/freq", "pages/freq/freq",
"pages/findCar/findCar", "pages/findCar/findCar",
"pages/findCarSearch/findCarSearch", "pages/findCarSearch/findCarSearch",
"pages/trace/trace", "pages/trace/trace",
"pages/monitor/monitor", "pages/monitor/monitor",
"pages/mine/mine", "pages/mine/mine",
"pages/deviceActiveChart/deviceActiveChart", "pages/deviceActiveChart/deviceActiveChart",
"pages/deviceOffChart/deviceOffChart", "pages/deviceOffChart/deviceOffChart",
"pages/logs/logs", "pages/logs/logs",
"pages/replay/replay", "pages/replay/replay",
"pages/fence/fence", "pages/fence/fence",
"pages/login/login", "pages/login/login",
"pages/collectCarSearch/collectCarSearch", "pages/collectCarSearch/collectCarSearch",
"pages/collectCarDetail/collectCarDetail", "pages/collectCarDetail/collectCarDetail",
"pages/collectCarLog/collectCarLog", "pages/collectCarLog/collectCarLog",
"pages/freqLogSearch/freqLogSearch", "pages/freqLogSearch/freqLogSearch",
"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",
"backgroundTextStyle": "light", "backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff", "navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "虎哥e盾", "navigationBarTitleText": "虎哥e盾",
"navigationBarTextStyle": "black" "navigationBarTextStyle": "black"
}, },
"tabBar": { "tabBar": {
"color": "#666", "color": "#666",
"selectedColor": "#37c060", "selectedColor": "#37c060",
"backgroundColor": "#fff", "backgroundColor": "#fff",
"list": [ "list": [
{ {
"pagePath": "pages/home/home", "pagePath": "pages/home/home",
"text": "首页", "text": "首页",
"iconPath": "images/tab-home.png", "iconPath": "images/tab-home.png",
"selectedIconPath": "images/tab-home-active.png" "selectedIconPath": "images/tab-home-active.png"
}, },
{ {
"pagePath": "pages/findCar/findCar", "pagePath": "pages/findCar/findCar",
"text": "找车", "text": "找车",
"iconPath": "images/tab-findcar.png", "iconPath": "images/tab-findcar.png",
"selectedIconPath": "images/tab-findcar-active.png" "selectedIconPath": "images/tab-findcar-active.png"
}, },
{ {
"pagePath": "pages/mine/mine", "pagePath": "pages/mine/mine",
"text": "我的", "text": "我的",
"iconPath": "images/tab-mine.png", "iconPath": "images/tab-mine.png",
"selectedIconPath": "images/tab-mine-active.png" "selectedIconPath": "images/tab-mine-active.png"
} }
] ]
}, },
"permission": { "permission": {
"scope.userLocation": { "scope.userLocation": {
"desc": "你的位置信息将用于定位效果展示" "desc": "你的位置信息将用于定位效果展示"
} }
}, },
"sitemapLocation": "sitemap.json" "requiredPrivateInfos":[
"getLocation",
"chooseLocation"
],
"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');
......
const WXRequest = require('../../utils/wxrequest.js'); const WXRequest = require('../../utils/wxrequest.js');
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
username: '', username: '',
password: '', password: '',
handleDone: true handleDone: true,
}, isAgree: false
},
/**
* 生命周期函数--监听页面加载 /**
*/ * 生命周期函数--监听页面加载
onLoad: function (options) { */
onLoad: function (options) {
},
formSubmit(e){console.log(e) },
var that = this; formSubmit(e) {
if(!that.data.handleDone) return; console.log(e)
var that = this;
if(!that.data.username){ if (!that.data.handleDone) return;
wx.showModal({
content: '请输入账号', if (!that.data.username) {
showCancel: false wx.showModal({
}); content: '请输入账号',
showCancel: false,
return; success: function (res) {
} console.log(res)
if(!that.data.password){ }
wx.showModal({ });
content: '请输入密码',
showCancel: false return false;
}); }
if (!that.data.password) {
return; wx.showModal({
} content: '请输入密码',
that.setData({ showCancel: false
handleDone: false });
});
return false;
WXRequest.login({ }
username: that.data.username, if (!that.data.isAgree) {
password: that.data.password wx.showModal({
}).then(()=>{ content: '请阅读并同意隐私协议和用户协议',
wx.switchTab({ showCancel: false
url: '../../pages/home/home' });
});
}).catch(()=>{ return false;
that.setData({ }
handleDone: true that.setData({
}); handleDone: false
}) });
}, WXRequest.login({
usernameChange(e){ username: that.data.username,
this.setData({ password: that.data.password
username: e.detail.value }).then(() => {
}); wx.switchTab({
}, url: '../../pages/home/home'
passwordChange(e){ });
this.setData({ }).catch(() => {
password: e.detail.value that.setData({
}); handleDone: true
}, });
/** })
* 生命周期函数--监听页面初次渲染完成
*/ },
onReady: function () { usernameChange(e) {
this.setData({
}, username: e.detail.value
});
/** },
* 生命周期函数--监听页面显示 passwordChange(e) {
*/ this.setData({
onShow: function () { password: e.detail.value
});
}, },
/**
/** * 生命周期函数--监听页面初次渲染完成
* 生命周期函数--监听页面隐藏 */
*/ onReady: function () {
onHide: function () {
},
},
/**
/** * 生命周期函数--监听页面显示
* 生命周期函数--监听页面卸载 */
*/ onShow: function () {
onUnload: function () {
},
},
/**
/** * 生命周期函数--监听页面隐藏
* 页面相关事件处理函数--监听用户下拉动作 */
*/ onHide: function () {
onPullDownRefresh: function () {
},
},
/**
/** * 生命周期函数--监听页面卸载
* 页面上拉触底事件的处理函数 */
*/ onUnload: function () {
onReachBottom: function () {
},
},
/**
/** * 页面相关事件处理函数--监听用户下拉动作
* 用户点击右上角分享 */
*/ onPullDownRefresh: function () {
onShareAppMessage: function () {
},
}
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: 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>
<image class="username-icon" src="../../images/username.png" /> <form>
<input type="text" name="username" bindinput="usernameChange" placeholder="请输入账号" /> <label class="label">
</label> <image class="username-icon" src="../../images/username.png" />
<label> <input type="text" name="username" class="a_input" bindinput="usernameChange" placeholder="请输入账号" />
<image class="password-icon" src="../../images/password.png" /> </label>
<input type="password" name="password" bindinput="passwordChange" placeholder="请输入密码" /> <label class="label">
</label> <image class="password-icon" src="../../images/password.png" />
<button formType="submit" bindtap="formSubmit" type="primary" class="submit-btn">登录<view class="weui-loading" hidden="{{handleDone}}"></view></button> <input type="password" name="password" class="a_input" bindinput="passwordChange" placeholder="请输入密码" />
</form> </label>
</view> <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>
</form>
</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;
...@@ -34,4 +34,14 @@ input{ ...@@ -34,4 +34,14 @@ input{
button.submit-btn{ 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
}); });
......
{ {
"description": "项目配置文件。", "description": "项目配置文件。",
"setting": { "setting": {
"urlCheck": false, "urlCheck": false,
"es6": true, "es6": true,
"postcss": true, "enhance": true,
"minified": true, "postcss": true,
"newFeature": true, "preloadBackgroundData": false,
"coverView": true, "minified": true,
"autoAudits": false, "newFeature": true,
"showShadowRootInWxmlPanel": true, "coverView": true,
"scopeDataCheck": false, "nodeModules": false,
"checkInvalidKey": true, "autoAudits": false,
"checkSiteMap": true, "showShadowRootInWxmlPanel": true,
"uploadWithSourceMap": true, "scopeDataCheck": false,
"useMultiFrameRuntime": false, "uglifyFileName": false,
"useApiHook": true, "checkInvalidKey": true,
"babelSetting": { "checkSiteMap": true,
"ignore": [], "uploadWithSourceMap": true,
"disablePlugins": [], "compileHotReLoad": false,
"outputPath": "" "lazyloadPlaceholderEnable": false,
"useMultiFrameRuntime": false,
"useApiHook": false,
"useApiHostProcess": false,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
},
"useIsolateContext": false,
"userConfirmedBundleSwitch": false,
"packNpmManually": false,
"packNpmRelationList": [],
"minifyWXSS": true,
"disableUseStrict": false,
"minifyWXML": true,
"showES6CompileOption": false,
"useCompilerPlugins": false,
"ignoreUploadUnusedFiles": true,
"condition": false
}, },
"useIsolateContext": true, "compileType": "miniprogram",
"useCompilerModule": true, "libVersion": "2.22.1",
"userConfirmedUseCompilerModuleSwitch": false, "appid": "wxdae8cf8710b62fee",
"packNpmManually": false, "projectname": "%E8%99%8E%E5%93%A5e%E7%9B%BE",
"packNpmRelationList": [], "simulatorType": "wechat",
"minifyWXSS": true "simulatorPluginLibVersion": {},
}, "condition": {
"compileType": "miniprogram", "miniprogram": {
"libVersion": "1.9.91", "list": [
"appid": "wxdae8cf8710b62fee", {
"projectname": "wx", "name": "pages/wxPublicPage/wxPublicPage",
"isGameTourist": false, "pathName": "pages/wxPublicPage/wxPublicPage",
"simulatorType": "wechat", "query": "",
"simulatorPluginLibVersion": {}, "scene": 1043,
"condition": { "referrerInfo": {}
"search": { }
"list": [] ]
}, }
"conversation": {
"list": []
},
"plugin": {
"list": []
}, },
"game": { "packOptions": {
"currentL": -1, "ignore": [],
"list": [] "include": []
}, },
"miniprogram": { "editorSetting": {
"list": [ "tabIndent": "insertSpaces",
{ "tabSize": 4
"id": 0,
"name": "pages/wxPublicPage/wxPublicPage",
"pathName": "pages/wxPublicPage/wxPublicPage",
"query": "",
"scene": 1043,
"referrerInfo": {}
}
]
} }
}
} }
\ 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!