Commit af5f19fa by 前端

增加用户协议、隐私协议

1 parent cd869aa3
......@@ -24,7 +24,7 @@
"pages/freqLogDetail/freqLogDetail",
"pages/freqLogUserDetail/freqLogUserDetail",
"pages/map/findCar",
"pages/test/test"
"pages/webview/index"
],
"window": {
"backgroundColor": "#efeff4",
......@@ -63,5 +63,9 @@
"desc": "你的位置信息将用于定位效果展示"
}
},
"requiredPrivateInfos":[
"getLocation",
"chooseLocation"
],
"sitemapLocation": "sitemap.json"
}
\ No newline at end of file
......@@ -27,6 +27,7 @@ Page({
loginUserId: wx.getStorageSync('loginUserId'),
ifUpdate: true
});
console.log(encodeURI(`${WXRequest.domain}h5/dist/index.html?sessionid=${sessionid}`))
},
onShow(options){
const carShareInfo = wx.getStorageSync('carShareInfo');
......
......@@ -7,7 +7,8 @@ Page({
data: {
username: '',
password: '',
handleDone: true
handleDone: true,
isAgree: false
},
/**
......@@ -16,25 +17,37 @@ Page({
onLoad: function (options) {
},
formSubmit(e){console.log(e)
formSubmit(e) {
console.log(e)
var that = this;
if(!that.data.handleDone) return;
if (!that.data.handleDone) return;
if(!that.data.username){
if (!that.data.username) {
wx.showModal({
content: '请输入账号',
showCancel: false
showCancel: false,
success: function (res) {
console.log(res)
}
});
return;
return false;
}
if(!that.data.password){
if (!that.data.password) {
wx.showModal({
content: '请输入密码',
showCancel: false
});
return;
return false;
}
if (!that.data.isAgree) {
wx.showModal({
content: '请阅读并同意隐私协议和用户协议',
showCancel: false
});
return false;
}
that.setData({
handleDone: false
......@@ -43,23 +56,23 @@ Page({
WXRequest.login({
username: that.data.username,
password: that.data.password
}).then(()=>{
}).then(() => {
wx.switchTab({
url: '../../pages/home/home'
});
}).catch(()=>{
}).catch(() => {
that.setData({
handleDone: true
});
})
},
usernameChange(e){
usernameChange(e) {
this.setData({
username: e.detail.value
});
},
passwordChange(e){
passwordChange(e) {
this.setData({
password: e.detail.value
});
......@@ -111,5 +124,21 @@ Page({
*/
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
<view class="login">
<view class="logo"><image src="../../images/logo.png" /></view>
<form bindsubmit="formSubmit">
<label>
<view class="logo">
<image src="../../images/logo.png" />
</view>
<form>
<label class="label">
<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 class="label">
<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>
<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
......@@ -14,13 +14,13 @@ form{
display: block;
margin: 0 30rpx;
}
label{
.label{
display: block;
border-bottom: 1px solid #ececec;
padding: 10rpx 0;
margin: 20rpx 0;
}
input{
.a_input{
display: inline-block;
vertical-align: middle;
width: 200px;
......@@ -35,3 +35,13 @@ button.submit-btn{
margin-top: 40rpx;
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
// 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
{
"usingComponents": {}
}
\ No newline at end of file
<!--webviewPackage/pages/webview.wxml-->
<web-view src="{{pagePath}}"/>
/* pages/webview/index.wxss */
\ No newline at end of file
......@@ -13,8 +13,9 @@ Page({
*/
onLoad: function (options) {
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`
console.log(url)
this.setData({
jumpLink: url
});
......
......@@ -3,55 +3,52 @@
"setting": {
"urlCheck": false,
"es6": true,
"enhance": true,
"postcss": true,
"preloadBackgroundData": false,
"minified": true,
"newFeature": true,
"coverView": true,
"nodeModules": false,
"autoAudits": false,
"showShadowRootInWxmlPanel": true,
"scopeDataCheck": false,
"uglifyFileName": false,
"checkInvalidKey": true,
"checkSiteMap": true,
"uploadWithSourceMap": true,
"compileHotReLoad": false,
"lazyloadPlaceholderEnable": false,
"useMultiFrameRuntime": false,
"useApiHook": true,
"useApiHook": false,
"useApiHostProcess": false,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
},
"useIsolateContext": true,
"useCompilerModule": true,
"userConfirmedUseCompilerModuleSwitch": false,
"useIsolateContext": false,
"userConfirmedBundleSwitch": false,
"packNpmManually": false,
"packNpmRelationList": [],
"minifyWXSS": true
"minifyWXSS": true,
"disableUseStrict": false,
"minifyWXML": true,
"showES6CompileOption": false,
"useCompilerPlugins": false,
"ignoreUploadUnusedFiles": true,
"condition": false
},
"compileType": "miniprogram",
"libVersion": "1.9.91",
"libVersion": "2.22.1",
"appid": "wxdae8cf8710b62fee",
"projectname": "wx",
"isGameTourist": false,
"projectname": "%E8%99%8E%E5%93%A5e%E7%9B%BE",
"simulatorType": "wechat",
"simulatorPluginLibVersion": {},
"condition": {
"search": {
"list": []
},
"conversation": {
"list": []
},
"plugin": {
"list": []
},
"game": {
"currentL": -1,
"list": []
},
"miniprogram": {
"list": [
{
"id": 0,
"name": "pages/wxPublicPage/wxPublicPage",
"pathName": "pages/wxPublicPage/wxPublicPage",
"query": "",
......@@ -60,5 +57,13 @@
}
]
}
},
"packOptions": {
"ignore": [],
"include": []
},
"editorSetting": {
"tabIndent": "insertSpaces",
"tabSize": 4
}
}
\ 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
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!