Commit 0321957c by 莫晓莉

mxl登录

parent 77807522
...@@ -5,12 +5,14 @@ ...@@ -5,12 +5,14 @@
"style": { "style": {
"navigationBarTitleText": "登录模板" "navigationBarTitleText": "登录模板"
} }
}, { },
{
"path": "pages/login/login", "path": "pages/login/login",
"style": { "style": {
"navigationBarTitleText": "登录" "navigationBarTitleText": "登录"
} }
}, { },
{
"path": "pages/reg/reg", "path": "pages/reg/reg",
"style": { "style": {
"navigationBarTitleText": "注册" "navigationBarTitleText": "注册"
......
...@@ -34,16 +34,16 @@ ...@@ -34,16 +34,16 @@
<view class="login-area"> <view class="login-area">
<view class="login-item bt"> <view class="login-item bt">
<image class="login-icon" src="../../static/login/mine.png"></image> <image class="login-icon" src="../../static/login/mine.png"></image>
<input class="login-item-input" placeholder="请输入手机号" /> <input type="number" class="login-item-input" placeholder="请输入手机号" v-model="loginForm.phone" />
</view> </view>
<view class="login-item bt"> <view class="login-item bt">
<image class="login-icon" src="../../static/login/password.png"></image> <image class="login-icon" src="../../static/login/password.png"></image>
<input class="login-item-input" placeholder="请输入验证码" /> <input v-model="loginForm.code" class="login-item-input" placeholder="请输入验证码" />
<view class="code-btn" style="">获取验证码</view> <view class="code-btn" @click="codeInfo.clickType ? getCode() : ''">{{codeInfo.msg}}</view>
</view> </view>
<view class="login-item bt"> <view class="login-item bt">
<image class="login-icon" src="../../static/login/code.png"></image> <image class="login-icon" src="../../static/login/code.png"></image>
<input class="login-item-input" placeholder="请输入密码" /> <input class="login-item-input" placeholder="请输入密码" v-model="loginForm.password"/>
</view> </view>
</view> </view>
<!-- 登录新样式end --> <!-- 登录新样式end -->
...@@ -51,12 +51,12 @@ ...@@ -51,12 +51,12 @@
<view class="btn-row"> <view class="btn-row">
<button type="primary" class="primary btn-login" @tap="bindLogin">登录</button> <button type="primary" class="primary btn-login" @click="login">登录</button>
</view> </view>
<view class="action-row"> <view class="action-row" style="text-align: center;color:red;">
<navigator url="../reg/reg">注册账号</navigator> <navigator url="../reg/reg">注册账号</navigator>
</view> </view>
...@@ -77,7 +77,12 @@ ...@@ -77,7 +77,12 @@
mapState, mapState,
mapMutations mapMutations
} from 'vuex' } from 'vuex'
import mInput from '../../components/m-input.vue' import mInput from '../../components/m-input.vue';
import {
login,
register,
sendCode,
} from "@/api/login"
export default { export default {
components: { components: {
...@@ -85,287 +90,356 @@ ...@@ -85,287 +90,356 @@
}, },
data() { data() {
return { return {
loginType: 0, loginForm:{},
loginTypeList: ['密码登录', '免密登录'], codeInfo: {
mobile: '', clickType: true,
code: '', time: 59,
providerList: [], msg: '获取验证码'
hasProvider: false, }
username: '', // loginType: 0,
password: '', // loginTypeList: ['密码登录', '免密登录'],
positionTop: 0, // mobile: '',
isDevtools: false, // code: '',
codeDuration: 0 // providerList: [],
// hasProvider: false,
// username: '',
// password: '',
// positionTop: 0,
// isDevtools: false,
// codeDuration: 0
} }
}, },
computed: mapState(['forcedLogin']), // computed: mapState(['forcedLogin']),
methods: { methods: {
...mapMutations(['login']), //获取验证码
initProvider() { getCode() {
const filters = ['weixin', 'qq', 'sinaweibo']; sendCode({
uni.getProvider({ phone: this.loginForm.phone
service: 'oauth', }).then(res => {
success: (res) => { if (res.code == 200) {
if (res.provider && res.provider.length) { uni.showToast({
for (let i = 0; i < res.provider.length; i++) { icon: 'success',
if (~filters.indexOf(res.provider[i])) { title: '获取成功',
this.providerList.push({ success: () => {
value: res.provider[i], this.codeTimeOut()
image: '../../static/img/' + res.provider[i] + '.png'
});
}
} }
this.hasProvider = true; })
}
},
fail: (err) => {
console.error('获取服务供应商失败:' + JSON.stringify(err));
} }
}); })
},
initPosition() {
/**
* 使用 absolute 定位,并且设置 bottom 值进行定位。软键盘弹出时,底部会因为窗口变化而被顶上来。
* 反向使用 top 进行定位,可以避免此问题。
*/
this.positionTop = uni.getSystemInfoSync().windowHeight - 100;
}, },
sendSmsCode() { //验证码倒计时
if(this.codeDuration) { codeTimeOut() {
uni.showModal({ this.codeInfo.clickType = false
content: `请在${this.codeDuration}秒后重试`, let codeTime = setInterval(() => {
showCancel: false this.codeInfo.time--;
}) this.codeInfo.msg = `${this.codeInfo.time}s后再次获取`
} if (this.codeInfo.time == 0) {
if (!/^1\d{10}$/.test(this.mobile)) { clearInterval(codeTime)
uni.showModal({ this.codeInfo = {
content: '手机号码填写错误', msg: '再次获取验证码',
showCancel: false time: 59,
}) clickType: true
return
}
uniCloud.callFunction({
name: 'user-center',
data: {
action: 'sendSmsCode',
params: {
mobile: this.mobile
}
},
success: (e) => {
if (e.result.code == 0) {
uni.showModal({
content: '验证码发送成功,请注意查收',
showCancel: false
})
this.codeDuration = 60
this.codeInterVal = setInterval(() => {
this.codeDuration--
if (this.codeDuration === 0) {
if (this.codeInterVal) {
clearInterval(this.codeInterVal)
this.codeInterVal = null
}
}
}, 1000)
} else {
uni.showModal({
content: '验证码发送失败:' + e.result.msg,
showCancel: false
})
} }
}
}, }, 1000)
fail(e) { },
uni.showModal({
content: '验证码发送失败', //登录
showCancel: false login() {
login(this.loginForm).then(res => {
if (res.code == 200) {
var user={},token='';
user.name=res.data.name;
user.phone=res.data.phone;
user.phone=res.data.userId;
token=res.data.token;
uni.showToast({
icon: 'success',
title: '登录成功',
success: () => {
uni.navigateTo({
url: '../user/user?token='+token+"&user="+user,
});
}
})
}else{
uni.showToast({
icon: 'success',
title: '您还未注册用户',
}) })
} }
}) })
}, },
loginByPwd() {
/** // ...mapMutations(['login']),
* 客户端对账号信息进行一些必要的校验。 // initProvider() {
* 实际开发中,根据业务需要进行处理,这里仅做示例。 // const filters = ['weixin', 'qq', 'sinaweibo'];
*/ // uni.getProvider({
if (this.username.length < 3) { // service: 'oauth',
uni.showToast({ // success: (res) => {
icon: 'none', // if (res.provider && res.provider.length) {
title: '账号最短为 3 个字符' // for (let i = 0; i < res.provider.length; i++) {
}); // if (~filters.indexOf(res.provider[i])) {
return; // this.providerList.push({
} // value: res.provider[i],
if (this.password.length < 6) { // image: '../../static/img/' + res.provider[i] + '.png'
uni.showToast({ // });
icon: 'none', // }
title: '密码最短为 6 个字符' // }
}); // this.hasProvider = true;
return; // }
} // },
const data = { // fail: (err) => {
username: this.username, // console.error('获取服务供应商失败:' + JSON.stringify(err));
password: this.password // }
}; // });
let _self = this; // },
// initPosition() {
// /**
// * 使用 absolute 定位,并且设置 bottom 值进行定位。软键盘弹出时,底部会因为窗口变化而被顶上来。
// * 反向使用 top 进行定位,可以避免此问题。
// */
// this.positionTop = uni.getSystemInfoSync().windowHeight - 100;
// },
// sendSmsCode() {
// if(this.codeDuration) {
// uni.showModal({
// content: `请在${this.codeDuration}秒后重试`,
// showCancel: false
// })
// }
// if (!/^1\d{10}$/.test(this.mobile)) {
// uni.showModal({
// content: '手机号码填写错误',
// showCancel: false
// })
// return
// }
// uniCloud.callFunction({
// name: 'user-center',
// data: {
// action: 'sendSmsCode',
// params: {
// mobile: this.mobile
// }
// },
// success: (e) => {
// if (e.result.code == 0) {
// uni.showModal({
// content: '验证码发送成功,请注意查收',
// showCancel: false
// })
// this.codeDuration = 60
// this.codeInterVal = setInterval(() => {
// this.codeDuration--
// if (this.codeDuration === 0) {
// if (this.codeInterVal) {
// clearInterval(this.codeInterVal)
// this.codeInterVal = null
// }
// }
// }, 1000)
// } else {
// uni.showModal({
// content: '验证码发送失败:' + e.result.msg,
// showCancel: false
// })
// }
uniCloud.callFunction({ // },
name: 'user-center', // fail(e) {
data: { // uni.showModal({
action: 'login', // content: '验证码发送失败',
params: data // showCancel: false
}, // })
success: (e) => { // }
// })
// },
// loginByPwd() {
// /**
// * 客户端对账号信息进行一些必要的校验。
// * 实际开发中,根据业务需要进行处理,这里仅做示例。
// */
// if (this.username.length < 3) {
// uni.showToast({
// icon: 'none',
// title: '账号最短为 3 个字符'
// });
// return;
// }
// if (this.password.length < 6) {
// uni.showToast({
// icon: 'none',
// title: '密码最短为 6 个字符'
// });
// return;
// }
// const data = {
// username: this.username,
// password: this.password
// };
// let _self = this;
console.log('login success', e); // uniCloud.callFunction({
// name: 'user-center',
// data: {
// action: 'login',
// params: data
// },
// success: (e) => {
if (e.result.code == 0) { // console.log('login success', e);
uni.setStorageSync('uniIdToken', e.result.token)
uni.setStorageSync('username', e.result.username)
uni.setStorageSync('login_type', 'online')
_self.toMain(_self.username);
} else {
uni.showModal({
content: e.result.msg,
showCancel: false
})
console.log('登录失败', e);
}
}, // if (e.result.code == 0) {
fail(e) { // uni.setStorageSync('uniIdToken', e.result.token)
uni.showModal({ // uni.setStorageSync('username', e.result.username)
content: JSON.stringify(e), // uni.setStorageSync('login_type', 'online')
showCancel: false // _self.toMain(_self.username);
}) // } else {
} // uni.showModal({
}) // content: e.result.msg,
}, // showCancel: false
loginBySms() { // })
if (!/^1\d{10}$/.test(this.mobile)) { // console.log('登录失败', e);
uni.showModal({ // }
content: '手机号码填写错误',
showCancel: false
})
return
}
if (!/^\d{6}$/.test(this.code)) {
uni.showModal({
title: '验证码为6位纯数字',
showCancel: false
});
return;
}
let _self = this;
uniCloud.callFunction({ // },
name: 'user-center', // fail(e) {
data: { // uni.showModal({
action: 'loginBySms', // content: JSON.stringify(e),
params: { // showCancel: false
mobile: this.mobile, // })
code: this.code // }
} // })
}, // },
success: (e) => { // loginBySms() {
// if (!/^1\d{10}$/.test(this.mobile)) {
// uni.showModal({
// content: '手机号码填写错误',
// showCancel: false
// })
// return
// }
// if (!/^\d{6}$/.test(this.code)) {
// uni.showModal({
// title: '验证码为6位纯数字',
// showCancel: false
// });
// return;
// }
// let _self = this;
console.log('login success', e); // uniCloud.callFunction({
// name: 'user-center',
// data: {
// action: 'loginBySms',
// params: {
// mobile: this.mobile,
// code: this.code
// }
// },
// success: (e) => {
if (e.result.code == 0) { // console.log('login success', e);
const username = e.result.username || '新用户'
uni.setStorageSync('uniIdToken', e.result.token)
uni.setStorageSync('username', username)
uni.setStorageSync('login_type', 'online')
_self.toMain(username);
} else {
uni.showModal({
content: e.result.msg,
showCancel: false
})
console.log('登录失败', e);
}
}, // if (e.result.code == 0) {
fail(e) { // const username = e.result.username || '新用户'
uni.showModal({ // uni.setStorageSync('uniIdToken', e.result.token)
content: JSON.stringify(e), // uni.setStorageSync('username', username)
showCancel: false // uni.setStorageSync('login_type', 'online')
}) // _self.toMain(username);
} // } else {
}) // uni.showModal({
}, // content: e.result.msg,
bindLogin() { // showCancel: false
switch (this.loginType) { // })
case 0: // console.log('登录失败', e);
this.loginByPwd() // }
break;
case 1:
this.loginBySms()
break;
default:
break;
}
},
oauth(value) {
console.log('三方登录只演示登录api能力,暂未关联云端数据');
uni.login({
provider: value,
success: (res) => {
uni.getUserInfo({
provider: value,
success: (infoRes) => {
/**
* 实际开发中,获取用户信息后,需要将信息上报至服务端。
* 服务端可以用 userInfo.openId 作为用户的唯一标识新增或绑定用户信息。
*/
this.loginLocal(infoRes.userInfo.nickName);
},
fail() {
uni.showToast({
icon: 'none',
title: '登陆失败'
});
}
});
},
fail: (err) => {
console.error('授权登录失败:' + JSON.stringify(err));
}
});
},
getUserInfo({
detail
}) {
console.log('三方登录只演示登录api能力,暂未关联云端数据');
if (detail.userInfo) {
this.loginLocal(detail.userInfo.nickName);
} else {
uni.showToast({
icon: 'none',
title: '登陆失败'
});
}
},
loginLocal(nickName) {
uni.setStorageSync('login_type', 'local')
uni.setStorageSync('username', nickName)
this.toMain(nickName);
},
toMain(userName) {
this.login(userName);
/**
* 强制登录时使用reLaunch方式跳转过来
* 返回首页也使用reLaunch方式
*/
if (this.forcedLogin) {
uni.reLaunch({
url: '../main/main',
});
} else {
uni.navigateBack();
}
} // },
// fail(e) {
// uni.showModal({
// content: JSON.stringify(e),
// showCancel: false
// })
// }
// })
// },
// bindLogin() {
// switch (this.loginType) {
// case 0:
// this.loginByPwd()
// break;
// case 1:
// this.loginBySms()
// break;
// default:
// break;
// }
// },
// oauth(value) {
// console.log('三方登录只演示登录api能力,暂未关联云端数据');
// uni.login({
// provider: value,
// success: (res) => {
// uni.getUserInfo({
// provider: value,
// success: (infoRes) => {
// /**
// * 实际开发中,获取用户信息后,需要将信息上报至服务端。
// * 服务端可以用 userInfo.openId 作为用户的唯一标识新增或绑定用户信息。
// */
// this.loginLocal(infoRes.userInfo.nickName);
// },
// fail() {
// uni.showToast({
// icon: 'none',
// title: '登陆失败'
// });
// }
// });
// },
// fail: (err) => {
// console.error('授权登录失败:' + JSON.stringify(err));
// }
// });
// },
// getUserInfo({
// detail
// }) {
// console.log('三方登录只演示登录api能力,暂未关联云端数据');
// if (detail.userInfo) {
// this.loginLocal(detail.userInfo.nickName);
// } else {
// uni.showToast({
// icon: 'none',
// title: '登陆失败'
// });
// }
// },
// loginLocal(nickName) {
// uni.setStorageSync('login_type', 'local')
// uni.setStorageSync('username', nickName)
// this.toMain(nickName);
// },
// toMain(userName) {
// this.login(userName);
// /**
// * 强制登录时使用reLaunch方式跳转过来
// * 返回首页也使用reLaunch方式
// */
// if (this.forcedLogin) {
// uni.reLaunch({
// url: '../main/main',
// });
// } else {
// uni.navigateBack();
// }
// }
}, },
onReady() { onReady() {
this.initPosition(); this.initPosition();
...@@ -379,7 +453,7 @@ ...@@ -379,7 +453,7 @@
<style> <style>
@import url("login.css"); @import url("login.css");
.login-type { /* .login-type {
display: flex; display: flex;
justify-content: center; justify-content: center;
} }
...@@ -445,5 +519,5 @@ ...@@ -445,5 +519,5 @@
width: 100%; width: 100%;
height: 100%; height: 100%;
opacity: 0; opacity: 0;
} } */
</style> </style>
...@@ -27,85 +27,119 @@ ...@@ -27,85 +27,119 @@
mapMutations mapMutations
} from 'vuex' } from 'vuex'
export default {
computed: mapState(['forcedLogin', 'hasLogin', 'userName']),
onLoad() {
const loginType = uni.getStorageSync('login_type')
if (loginType === 'local') {
this.login(uni.getStorageSync('username'))
return
}
let uniIdToken = uni.getStorageSync('uniIdToken')
if (uniIdToken) {
this.login(uni.getStorageSync('username'))
uniCloud.callFunction({
name: 'user-center',
data: {
action: 'checkToken',
},
success: (e) => {
console.log('checkToken success', e);
if (e.result.code > 0) { import {
//token过期或token不合法,重新登录 getUserByToken
if (this.forcedLogin) { } from "@/api/login"
uni.reLaunch({ export default {
url: '../login/login' onLoad: function() {
});
} else { const token=uni.getStorageSync('token')
uni.navigateTo({ console.log(token);
url: '../login/login' if(token){
}); uni.switchTab({
} url:'/pages/login/login'
}
},
fail(e) {
uni.showModal({
content: JSON.stringify(e),
showCancel: false
})
}
}) })
} else {
this.guideToLogin()
}
},
methods: {
...mapMutations(['login']),
guideToLogin() {
uni.showModal({
title: '未登录',
content: '您未登录,需要登录后才能继续',
/**
* 如果需要强制登录,不显示取消按钮
*/
showCancel: !this.forcedLogin,
success: (res) => {
if (res.confirm) {
/**
* 如果需要强制登录,使用reLaunch方式
*/
if (this.forcedLogin) {
uni.reLaunch({
url: '../login/login'
});
} else {
uni.navigateTo({
url: '../login/login'
});
}
}
}
});
} }
// getUserByToken().then(res=>{
// if (res.code == 200) {
// uni.setStorageSync('token', res.data.data);
// uni.switchTab({
// url:'/pages/login/login'
// })
// }else{
// uni.switchTab({
// url:'/pages/reg/reg'
// })
// }
// })
// const token=uni.getStorageSync('token')
// if(token){
// uni.switchTab({
// url:'/pages/index/index'
// })
// }
} }
// computed: mapState(['forcedLogin', 'hasLogin', 'userName']),
// onLoad() {
// const loginType = uni.getStorageSync('login_type')
// if (loginType === 'local') {
// this.login(uni.getStorageSync('username'))
// return
// }
// let uniIdToken = uni.getStorageSync('uniIdToken')
// if (uniIdToken) {
// this.login(uni.getStorageSync('username'))
// uniCloud.callFunction({
// name: 'user-center',
// data: {
// action: 'checkToken',
// },
// success: (e) => {
// console.log('checkToken success', e);
// if (e.result.code > 0) {
// //token过期或token不合法,重新登录
// if (this.forcedLogin) {
// uni.reLaunch({
// url: '../login/login'
// });
// } else {
// uni.navigateTo({
// url: '../login/login'
// });
// }
// }
// },
// fail(e) {
// uni.showModal({
// content: JSON.stringify(e),
// showCancel: false
// })
// }
// })
// } else {
// this.guideToLogin()
// }
// },
// methods: {
// ...mapMutations(['login']),
// guideToLogin() {
// uni.showModal({
// title: '未登录',
// content: '您未登录,需要登录后才能继续',
// /**
// * 如果需要强制登录,不显示取消按钮
// */
// showCancel: !this.forcedLogin,
// success: (res) => {
// if (res.confirm) {
// /**
// * 如果需要强制登录,使用reLaunch方式
// */
// if (this.forcedLogin) {
// uni.reLaunch({
// url: '../login/login'
// });
// } else {
// uni.navigateTo({
// url: '../login/login'
// });
// }
// }
// }
// });
// }
// }
} }
</script> </script>
<style> <style>
.hello { /* .hello {
display: flex; display: flex;
flex: 1; flex: 1;
flex-direction: column; flex-direction: column;
...@@ -124,5 +158,5 @@ ...@@ -124,5 +158,5 @@
.ul>view { .ul>view {
line-height: 25px; line-height: 25px;
} } */
</style> </style>
<template> <template>
<view class="content"> <view class="content">
<!-- <view class="input-group">
<view class="input-row border">
<text class="title">账号:</text>
<m-input type="text" focus clearable v-model="username" placeholder="请输入账号"></m-input>
</view>
<view class="input-row border">
<text class="title">密码:</text>
<m-input type="password" displayable v-model="password" placeholder="请输入密码"></m-input>
</view>
<view class="input-row">
<text class="title">确认密码:</text>
<m-input type="password" displayable v-model="confirmPassword" placeholder="请确认密码"></m-input>
</view>
</view> -->
<!-- 登录新样式start -->
<view style="text-align: center;color:#CA0000;font-size:45upx;padding:50upx;"> <view style="text-align: center;color:#CA0000;font-size:45upx;padding:50upx;">
<!-- <image class="head-icon" style="" src="../../static/login/personal.png"></image> -->
欢迎注册! 欢迎注册!
</view> </view>
<view class="login-area"> <view class="login-area">
<view class="login-item"> <view class="login-item">
<image class="login-icon" src="../../static/login/mine.png"></image> <image class="login-icon" src="../../static/login/mine.png"></image>
<input class="login-item-input" placeholder="请输入姓名" v-model="addForm.name" /> <input class="login-item-input" placeholder="请输入姓名" v-model="addForm.name" />
...@@ -49,7 +32,7 @@ ...@@ -49,7 +32,7 @@
<view class="login-item mt25"> <view class="login-item mt25">
<image class="login-icon" src="../../static/login/code.png"></image> <image class="login-icon" src="../../static/login/code.png"></image>
<input class="login-item-input" placeholder="请输入手机号码" v-model="addForm.phone" /> <input name="phone" type="number" class="login-item-input" placeholder="请输入手机号码" v-model="addForm.phone" />
<view class="code-btn" style="" @click="codeInfo.clickType ? getCode() : ''">{{codeInfo.msg}}</view> <view class="code-btn" style="" @click="codeInfo.clickType ? getCode() : ''">{{codeInfo.msg}}</view>
</view> </view>
<view class="login-item mt25"> <view class="login-item mt25">
...@@ -177,70 +160,70 @@ ...@@ -177,70 +160,70 @@
}) })
}, },
register() { // register() {
/** // /**
* 客户端对账号信息进行一些必要的校验。 // * 客户端对账号信息进行一些必要的校验。
* 实际开发中,根据业务需要进行处理,这里仅做示例。 // * 实际开发中,根据业务需要进行处理,这里仅做示例。
*/ // */
if (this.username.length < 3) { // if (this.username.length < 3) {
uni.showToast({ // uni.showToast({
icon: 'none', // icon: 'none',
title: '账号最短为 3 个字符' // title: '账号最短为 3 个字符'
}); // });
return; // return;
} // }
if (this.password.length < 6) { // if (this.password.length < 6) {
uni.showToast({ // uni.showToast({
icon: 'none', // icon: 'none',
title: '密码最短为 6 个字符' // title: '密码最短为 6 个字符'
}); // });
return; // return;
} // }
if (this.password !== this.confirmPassword) { // if (this.password !== this.confirmPassword) {
uni.showToast({ // uni.showToast({
icon: 'none', // icon: 'none',
title: '两次密码输入不一致' // title: '两次密码输入不一致'
}); // });
return; // return;
} // }
const data = { // const data = {
username: this.username, // username: this.username,
password: this.password // password: this.password
} // }
uniCloud.callFunction({ // uniCloud.callFunction({
name: 'user-center', // name: 'user-center',
data: { // data: {
action: 'register', // action: 'register',
params: data // params: data
}, // },
success(e) { // success(e) {
console.log("注册成功", e); // console.log("注册成功", e);
if (e.result.code === 0) { // if (e.result.code === 0) {
uni.showToast({ // uni.showToast({
title: '注册成功' // title: '注册成功'
}); // });
uni.setStorageSync('uniIdToken', e.result.token) // uni.setStorageSync('uniIdToken', e.result.token)
uni.setStorageSync('username', e.result.username) // uni.setStorageSync('username', e.result.username)
uni.reLaunch({ // uni.reLaunch({
url: '../main/main', // url: '../main/main',
}); // });
} else { // } else {
uni.showModal({ // uni.showModal({
content: JSON.stringify(e.result), // content: JSON.stringify(e.result),
showCancel: false // showCancel: false
}) // })
} // }
}, // },
fail(e) { // fail(e) {
uni.showModal({ // uni.showModal({
content: JSON.stringify(e), // content: JSON.stringify(e),
showCancel: false // showCancel: false
}) // })
} // }
}) // })
} // }
} }
} }
</script> </script>
......
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