Merge pull request 'zmr' (#26) from zmr into master
Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/26
This commit is contained in:
commit
df47e0d357
@ -7,16 +7,58 @@ export default {
|
|||||||
sms_code: sms_code
|
sms_code: sms_code
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
// 启动页
|
||||||
|
pageList({document_code}) {
|
||||||
|
return vm.$u.post('StartUp/pageList', {});
|
||||||
|
},
|
||||||
|
// 首页协议
|
||||||
|
documentInfo({document_code}) {
|
||||||
|
return vm.$u.post('StartUp/documentInfo', {
|
||||||
|
document_code : document_code
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//获取验证码接口
|
||||||
|
sendSmsCode({member_mobile, smslog_type}) {
|
||||||
|
return vm.$u.post('sms/sendSmsCode', {
|
||||||
|
member_mobile: member_mobile,
|
||||||
|
smslog_type: smslog_type
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 用户验证码登录
|
||||||
phoneLogin({member_mobile, sms_code}) {
|
phoneLogin({member_mobile, sms_code}) {
|
||||||
return vm.$u.post('auth/phoneLogin', {
|
return vm.$u.post('auth/phoneLogin', {
|
||||||
member_mobile: member_mobile,
|
member_mobile: member_mobile,
|
||||||
sms_code: sms_code
|
sms_code: sms_code
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
sendSmsCode({member_mobile, sms_type}) {
|
//手机号(用户)注册
|
||||||
return vm.$u.get('sms/sendSmsCode', {
|
phoneRegister({member_mobile, sms_code}) {
|
||||||
|
return vm.$u.post('auth/phoneRegister', {
|
||||||
member_mobile: member_mobile,
|
member_mobile: member_mobile,
|
||||||
sms_type: sms_type
|
sms_code: sms_code
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 微信授权登录
|
||||||
|
wechatLogin({member_wxopenid, member_nickname,member_avatar}) {
|
||||||
|
return vm.$u.post('auth/wechatLogin', {
|
||||||
|
member_wxopenid: member_wxopenid,
|
||||||
|
member_nickname: member_nickname,
|
||||||
|
member_avatar : member_avatar
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// qq授权登录
|
||||||
|
qqLogin({member_qqopenid, member_nickname,member_avatar}) {
|
||||||
|
return vm.$u.post('auth/qqLogin', {
|
||||||
|
member_qqopenid: member_qqopenid,
|
||||||
|
member_nickname: member_nickname,
|
||||||
|
member_avatar : member_avatar
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 绑定手机号
|
||||||
|
mobileBind({member_mobile,sms_code}) {
|
||||||
|
return vm.$u.post('auth/mobileBind', {
|
||||||
|
member_mobile: member_mobile,
|
||||||
|
sms_code: sms_code
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
105
components/logininput/identifying.vue
Normal file
105
components/logininput/identifying.vue
Normal file
@ -0,0 +1,105 @@
|
|||||||
|
<!-- 短信验证码
|
||||||
|
父组件 只需要调用 传 1、手机号 2、类型
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<view class="wrap">
|
||||||
|
<u-toast ref="uToast"></u-toast>
|
||||||
|
<u-verification-code :seconds="seconds" @end="end" @start="start" ref="uCode" @change="codeChange"></u-verification-code>
|
||||||
|
<view class="view_getcode" @tap="getCode">{{tips}}</view>
|
||||||
|
<!-- 提示框 -->
|
||||||
|
<u-toast ref="uToast" />
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
smslog_type: {
|
||||||
|
type: String,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
member_mobile: {
|
||||||
|
type: String,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
tips: '',
|
||||||
|
// refCode: null,
|
||||||
|
seconds: 60,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onReady() {
|
||||||
|
// 注意这里不能将一个组件赋值给data的一个变量,否则在微信小程序会
|
||||||
|
// 造成循环引用而报错,如果你想这样做,请在非data中定义refCode变量
|
||||||
|
// this.refCode = this.$refs.uCode;
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
codeChange(text) {
|
||||||
|
this.tips = text;
|
||||||
|
},
|
||||||
|
getCode() {
|
||||||
|
this.$emit('tochange');
|
||||||
|
let member_mobile = this.member_mobile;
|
||||||
|
// 校验手机号
|
||||||
|
let type_phone = this.$u.test.mobile(member_mobile)
|
||||||
|
console.log(member_mobile)
|
||||||
|
console.log(this.smslog_type)
|
||||||
|
// 判断是否有手机号为空
|
||||||
|
if (type_phone == false) {
|
||||||
|
this.$refs.uToast.show({
|
||||||
|
title: '手机号格式不正确',
|
||||||
|
type: 'error'
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
// 验证码倒计时
|
||||||
|
if (this.$refs.uCode.canGetCode) {
|
||||||
|
// 模拟向后端请求验证码
|
||||||
|
uni.showLoading({
|
||||||
|
title: '正在获取验证码'
|
||||||
|
})
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.hideLoading();
|
||||||
|
// 这里此提示会被this.start()方法中的提示覆盖
|
||||||
|
this.$u.toast('验证码已发送');
|
||||||
|
// 通知验证码组件内部开始倒计时
|
||||||
|
this.$refs.uCode.start();
|
||||||
|
}, 2000);
|
||||||
|
} else {
|
||||||
|
this.$u.toast('倒计时结束后再发送');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
end() {
|
||||||
|
this.$u.toast('倒计时结束');
|
||||||
|
},
|
||||||
|
start() {
|
||||||
|
// this.$u.toast('倒计时开始');
|
||||||
|
console.log(this.smslog_type)
|
||||||
|
// 倒计时请求
|
||||||
|
this.$u.api.sendSmsCode({
|
||||||
|
member_mobile: this.member_mobile,
|
||||||
|
smslog_type: this.smslog_type
|
||||||
|
}).then((res) => {
|
||||||
|
console.log(res)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.labales {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wrap {
|
||||||
|
position: absolute;
|
||||||
|
top: -18rpx;
|
||||||
|
right: 20rpx;
|
||||||
|
color: #ff780f;
|
||||||
|
}
|
||||||
|
</style>
|
@ -47,8 +47,23 @@
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
apiwelcome(){
|
||||||
|
this.$u.api.documentInfo({
|
||||||
|
document_code:'agreement'
|
||||||
|
}).then((res)=>{
|
||||||
|
console.log('协议',res)
|
||||||
|
|
||||||
|
})
|
||||||
|
// 启动页
|
||||||
|
this.$u.api.pageList({}).then((res)=>{
|
||||||
|
console.log('协议',res)
|
||||||
|
|
||||||
|
})
|
||||||
|
},
|
||||||
// 3秒倒计时
|
// 3秒倒计时
|
||||||
remaining_time(){
|
remaining_time(){
|
||||||
this.timer=setInterval(() => {
|
this.timer=setInterval(() => {
|
||||||
@ -89,6 +104,7 @@
|
|||||||
this.remaining_time()
|
this.remaining_time()
|
||||||
// 获取屏幕高度
|
// 获取屏幕高度
|
||||||
this.getSystemInfo()
|
this.getSystemInfo()
|
||||||
|
this.apiwelcome()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name" : "deming",
|
"name" : "deming",
|
||||||
"appid" : "",
|
"appid" : "__UNI__10450AF",
|
||||||
"description" : "",
|
"description" : "",
|
||||||
"versionName" : "1.0.0",
|
"versionName" : "1.0.0",
|
||||||
"versionCode" : "100",
|
"versionCode" : "100",
|
||||||
@ -17,40 +17,49 @@
|
|||||||
"delay" : 0
|
"delay" : 0
|
||||||
},
|
},
|
||||||
/* 模块配置 */
|
/* 模块配置 */
|
||||||
"modules" : {},
|
"modules" : {
|
||||||
|
"OAuth" : {}
|
||||||
|
},
|
||||||
/* 应用发布信息 */
|
/* 应用发布信息 */
|
||||||
"distribute" : {
|
"distribute" : {
|
||||||
/* android打包配置 */
|
/* android打包配置 */
|
||||||
"android" : {
|
"android" : {
|
||||||
"permissions" : [
|
"permissions" : [
|
||||||
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
|
"<uses-feature android:name=\"android.hardware.camera\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
|
|
||||||
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
|
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>",
|
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
|
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.CALL_PHONE\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
|
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>",
|
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
|
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
|
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
|
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
|
"<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
|
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.CALL_PHONE\"/>",
|
"<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
|
|
||||||
"<uses-feature android:name=\"android.hardware.camera\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
|
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
/* ios打包配置 */
|
/* ios打包配置 */
|
||||||
"ios" : {},
|
"ios" : {},
|
||||||
/* SDK配置 */
|
/* SDK配置 */
|
||||||
"sdkConfigs" : {}
|
"sdkConfigs" : {
|
||||||
|
"ad" : {},
|
||||||
|
"oauth" : {
|
||||||
|
"qq" : {
|
||||||
|
"appid" : "101884160"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/* 快应用特有相关 */
|
/* 快应用特有相关 */
|
||||||
@ -72,7 +81,7 @@
|
|||||||
"mp-toutiao" : {
|
"mp-toutiao" : {
|
||||||
"usingComponents" : true
|
"usingComponents" : true
|
||||||
},
|
},
|
||||||
"uniStatistics": {
|
"uniStatistics" : {
|
||||||
"enable": false
|
"enable" : false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,24 +8,20 @@
|
|||||||
<view class="title">手机登录</view>
|
<view class="title">手机登录</view>
|
||||||
<view class="labales">
|
<view class="labales">
|
||||||
<!-- <text></text> -->
|
<!-- <text></text> -->
|
||||||
<input type="tel" placeholder="手机号" />
|
<input type="tel" placeholder="请输入您的手机号" v-model="member_mobile" />
|
||||||
</view>
|
</view>
|
||||||
<view class="labales">
|
<view class="labales">
|
||||||
<!-- <text></text> -->
|
<!-- <text></text> -->
|
||||||
<input type="tel" placeholder="请输入验证码" />
|
<input type="tel" placeholder="请输入验证码" v-model="sms_code" />
|
||||||
<!-- <text class="identifying" @click="getCode">{{text}}</text> -->
|
<!-- <text class="identifying" @click="getCode">{{text}}</text> -->
|
||||||
<view class="wrap">
|
<identifying @tochange="tochange" :smslog_type="smslog_type" :member_mobile="member_mobile" ></identifying>
|
||||||
<u-toast ref="uToast"></u-toast>
|
|
||||||
<u-verification-code :seconds="seconds" @end="end" @start="start" ref="uCode" @change="codeChange"></u-verification-code>
|
|
||||||
<view class="view_getcode" @tap="getCode">{{tips}}</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 服务协议 -->
|
<!-- 服务协议 -->
|
||||||
<view class="pact">
|
<view class="pact">
|
||||||
<view></view>
|
<view></view>
|
||||||
<text>我已详细阅读并同意</text>
|
<text>我已详细阅读并同意</text>
|
||||||
<text class="pact_text">《用户协议》</text>
|
<text class="pact_text">《用户协议》 </text>
|
||||||
<text class="pact_text">《隐私协议》</text>
|
<text class="pact_text">《隐私协议》</text>
|
||||||
<text class="pact_text">《使用协议》</text>
|
<text class="pact_text">《使用协议》</text>
|
||||||
<u-checkbox-group @change="checkboxGroupChange" size="27">
|
<u-checkbox-group @change="checkboxGroupChange" size="27">
|
||||||
@ -36,17 +32,17 @@
|
|||||||
</view>
|
</view>
|
||||||
<!-- 注册 -->
|
<!-- 注册 -->
|
||||||
<view class="more_Login">
|
<view class="more_Login">
|
||||||
<text>新用户点击注册</text>
|
<text @click="registerUrl()">{{register}}</text>
|
||||||
<text class="other" @click="mask_u">其他方式登录</text>
|
<text class="other" @click="mask_u">其他方式登录</text>
|
||||||
</view>
|
</view>
|
||||||
<!-- denglu QQ weixin -->
|
<!-- denglu QQ weixin -->
|
||||||
<view class="buttones">
|
<view class="buttones">
|
||||||
<u-button>{{login}}</u-button>
|
<u-button @click="loginOn">{{login}}</u-button>
|
||||||
</view>
|
</view>
|
||||||
<u-mask :show="show" @click="show = false">
|
<u-mask :show="show" @click="show = false">
|
||||||
<view class="warp">
|
<view class="warp">
|
||||||
<view class="rect" @tap.stop>
|
<view class="rect" @tap.stop>
|
||||||
<view class="rect_view">
|
<view class="rect_view" @click="rect_qq()">
|
||||||
<image src="../../static/pageA/qq.png" class="image"></image>
|
<image src="../../static/pageA/qq.png" class="image"></image>
|
||||||
<view>QQ登录</view>
|
<view>QQ登录</view>
|
||||||
</view>
|
</view>
|
||||||
@ -59,26 +55,127 @@
|
|||||||
</view>
|
</view>
|
||||||
</u-mask>
|
</u-mask>
|
||||||
</view>
|
</view>
|
||||||
|
<u-toast ref="uToast" />
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
import identifying from '@/components/logininput/identifying'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
list: [{
|
list: [{
|
||||||
checked: false,
|
checked: true,
|
||||||
disabled: false
|
disabled: false
|
||||||
}],
|
}],
|
||||||
value: '',
|
value: '',
|
||||||
|
phones : '',
|
||||||
text: '获取验证码',
|
text: '获取验证码',
|
||||||
login: '登录',
|
login: '登录',
|
||||||
|
register : '新用户点击注册',
|
||||||
show: false,
|
show: false,
|
||||||
tips: '',
|
tips: '',
|
||||||
// refCode: null,
|
// refCode: null,
|
||||||
seconds: 60,
|
seconds: 60,
|
||||||
|
member_mobile: '', //手机号
|
||||||
|
smslog_type : '2',//状态
|
||||||
|
sms_code : '', //验证码
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
onLoad() {
|
||||||
|
// 数据的请求
|
||||||
|
this.apiwelcome()
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
apiwelcome(){
|
||||||
|
this.$u.api.sendSmsCode({
|
||||||
|
|
||||||
|
}).then((res)=>{
|
||||||
|
console.log(res)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 用户登录
|
||||||
|
loginOn(){
|
||||||
|
// console.log("登录")
|
||||||
|
// console.log(this.member_mobile)
|
||||||
|
// console.log(this.sms_code)
|
||||||
|
this.$u.api.phoneLogin({
|
||||||
|
member_mobile: this.member_mobile,
|
||||||
|
sms_code: this.sms_code
|
||||||
|
}).then((res) => {
|
||||||
|
// console.log(res)
|
||||||
|
if(res.errCode == 0){
|
||||||
|
// 缓存用户的信息
|
||||||
|
uni.setStorage({
|
||||||
|
key: 'user_info',
|
||||||
|
data: res.data,
|
||||||
|
success: function () {
|
||||||
|
console.log('success');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// 注册返回参数
|
||||||
|
this.$refs.uToast.show({
|
||||||
|
title: res.message,
|
||||||
|
type: 'success',
|
||||||
|
url: '/pageA/topick/topick'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if(res.errCode == 1){
|
||||||
|
this.$refs.uToast.show({
|
||||||
|
title: res.message,
|
||||||
|
type: 'error'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// qq授权登录
|
||||||
|
rect_qq(){
|
||||||
|
console.log("授权Q")
|
||||||
|
var vm = this;
|
||||||
|
uni.getProvider({
|
||||||
|
service: 'oauth',
|
||||||
|
success: function (res) {
|
||||||
|
console.log('qq',res) //weixin
|
||||||
|
if (~res.provider.indexOf('qq')) {
|
||||||
|
uni.login({
|
||||||
|
provider: 'qq',
|
||||||
|
success: function (loginRes) {
|
||||||
|
console.log(loginRes)
|
||||||
|
this.getApplogin(loginRes)
|
||||||
|
vm.$HTTP({
|
||||||
|
method: 'GET',
|
||||||
|
baseURL:'https://graph.qq.com/user/get_user_info',
|
||||||
|
url: '',
|
||||||
|
data: {
|
||||||
|
openid:loginRes.authResult.openid,
|
||||||
|
access_token:loginRes.authResult.access_token,
|
||||||
|
appid:'101884160'
|
||||||
|
},
|
||||||
|
load:true
|
||||||
|
}).then((data) =>{
|
||||||
|
console.log(data)
|
||||||
|
|
||||||
|
}, (err) => {
|
||||||
|
console.log(err)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}else{
|
||||||
|
console.log("错误")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 跳转注册页面
|
||||||
|
registerUrl(){
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pageA/register/register'
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 授权登录
|
||||||
|
getApplogin(){
|
||||||
|
console.log("11")
|
||||||
|
},
|
||||||
// 选中某个复选框时,由checkbox时触发
|
// 选中某个复选框时,由checkbox时触发
|
||||||
checkboxChange(e) {
|
checkboxChange(e) {
|
||||||
//console.log(e);
|
//console.log(e);
|
||||||
@ -90,66 +187,18 @@
|
|||||||
mask_u() {
|
mask_u() {
|
||||||
this.show = !this.show
|
this.show = !this.show
|
||||||
},
|
},
|
||||||
// 获取验证码倒计时
|
tochange(){
|
||||||
getCode() {
|
|
||||||
console.log("11")
|
|
||||||
this.loading()
|
|
||||||
},
|
|
||||||
loading() {
|
|
||||||
|
|
||||||
},
|
|
||||||
codeChange(text) {
|
|
||||||
this.tips = text;
|
|
||||||
},
|
|
||||||
getCode() {
|
|
||||||
if (this.$refs.uCode.canGetCode) {
|
|
||||||
// 模拟向后端请求验证码
|
|
||||||
uni.showLoading({
|
|
||||||
title: '正在获取验证码'
|
|
||||||
})
|
|
||||||
setTimeout(() => {
|
|
||||||
uni.hideLoading();
|
|
||||||
// 这里此提示会被this.start()方法中的提示覆盖
|
|
||||||
this.$u.toast('验证码已发送');
|
|
||||||
// 通知验证码组件内部开始倒计时
|
|
||||||
this.$refs.uCode.start();
|
|
||||||
}, 2000);
|
|
||||||
} else {
|
|
||||||
this.$u.toast('倒计时结束后再发送');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
end() {
|
|
||||||
this.$u.toast('倒计时结束');
|
|
||||||
},
|
|
||||||
start() {
|
|
||||||
this.$u.toast('倒计时开始');
|
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
components:{
|
||||||
|
identifying
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.wrap {
|
|
||||||
background: none;
|
|
||||||
width: 200rpx;
|
|
||||||
position: absolute;
|
|
||||||
right: 0;
|
|
||||||
top: 0;
|
|
||||||
bottom: 0;
|
|
||||||
margin: auto;
|
|
||||||
font-size: 30rpx;
|
|
||||||
|
|
||||||
.view_getcode{
|
|
||||||
height: 50rpx;
|
|
||||||
line-height: 50rpx;
|
|
||||||
font-size: 30rpx;
|
|
||||||
color: #FF780F!important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.warp .view_getcode{
|
|
||||||
width: 200rpx;
|
|
||||||
color: #FF780F!important;
|
|
||||||
}
|
|
||||||
.login {
|
.login {
|
||||||
|
|
||||||
// background: url(../../static/pageA/loginbackground.png) no-repeat!important;
|
// background: url(../../static/pageA/loginbackground.png) no-repeat!important;
|
||||||
|
@ -5,15 +5,17 @@
|
|||||||
<image class="images" src="../../static/pageA/loginbackground.png"></image>
|
<image class="images" src="../../static/pageA/loginbackground.png"></image>
|
||||||
<view class="backes"></view>
|
<view class="backes"></view>
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<view class="title">手机登录</view>
|
<view class="title">手机注册</view>
|
||||||
<view class="labales">
|
<view class="labales">
|
||||||
<!-- <text></text> -->
|
<!-- <text></text> -->
|
||||||
<input type="tel" placeholder="手机号" />
|
<input type="tel" placeholder="请输入您的手机号" v-model="member_mobile" />
|
||||||
</view>
|
</view>
|
||||||
<view class="labales">
|
<view class="labales">
|
||||||
<!-- <text></text> -->
|
<!-- <text></text> -->
|
||||||
<input type="tel" placeholder="请输入验证码" />
|
<input type="tel" placeholder="请输入验证码" v-model="sms_code" />
|
||||||
<text class="identifying">获取验证码</text>
|
<!-- <text class="identifying" @click="apiwelcome()">获取验证码</text> -->
|
||||||
|
<!-- 验证码接口的引入 -->
|
||||||
|
<identifying @tochange="tochange" :smslog_type="smslog_type" :member_mobile="member_mobile" ></identifying>
|
||||||
</view>
|
</view>
|
||||||
<!-- 服务协议 -->
|
<!-- 服务协议 -->
|
||||||
<view class="pact">
|
<view class="pact">
|
||||||
@ -24,7 +26,7 @@
|
|||||||
<text class="pact_text">《使用协议》</text>
|
<text class="pact_text">《使用协议》</text>
|
||||||
<u-checkbox-group @change="checkboxGroupChange" size="27">
|
<u-checkbox-group @change="checkboxGroupChange" size="27">
|
||||||
<u-checkbox @change="checkboxChange" v-model="item.checked" v-for="(item, index) in list" :key="index" :name="item.name"
|
<u-checkbox @change="checkboxChange" v-model="item.checked" v-for="(item, index) in list" :key="index" :name="item.name"
|
||||||
shape="circle" size="14" active-color="#19BE6B"></u-checkbox>
|
shape="circle" size="14" active-color="#19BE6B" ></u-checkbox>
|
||||||
</u-checkbox-group>
|
</u-checkbox-group>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -34,7 +36,7 @@
|
|||||||
<text class="other" @click="mask_u">其他方式登录</text>
|
<text class="other" @click="mask_u">其他方式登录</text>
|
||||||
</view>
|
</view>
|
||||||
<!-- denglu QQ weixin -->
|
<!-- denglu QQ weixin -->
|
||||||
<u-button>{{login}}</u-button>
|
<u-button @click="loginIn">{{login}}</u-button>
|
||||||
<u-mask :show="show" @click="show = false">
|
<u-mask :show="show" @click="show = false">
|
||||||
<view class="warp">
|
<view class="warp">
|
||||||
<view class="rect" @tap.stop>
|
<view class="rect" @tap.stop>
|
||||||
@ -43,7 +45,7 @@
|
|||||||
<view>QQ登录</view>
|
<view>QQ登录</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="rect_view">
|
<view class="rect_view">
|
||||||
<image src="../../static/pageA/weixin.png" class="image" ></image>
|
<image src="../../static/pageA/weixin.png" class="image"></image>
|
||||||
<view>微信登录</view>
|
<view>微信登录</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="rect_butoon" @click="show = false">取消</view>
|
<view class="rect_butoon" @click="show = false">取消</view>
|
||||||
@ -51,22 +53,63 @@
|
|||||||
</view>
|
</view>
|
||||||
</u-mask>
|
</u-mask>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- 提示框 -->
|
||||||
|
<u-toast ref="uToast" />
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
import identifying from '@/components/logininput/identifying'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
list: [{
|
list: [{
|
||||||
checked: false,
|
checked: true,
|
||||||
disabled: false
|
disabled: false
|
||||||
}],
|
}],
|
||||||
value: '',
|
value: '',
|
||||||
login: '登录',
|
login: '注册',
|
||||||
show: false
|
show: false,
|
||||||
|
member_mobile: '', //手机号
|
||||||
|
smslog_type : '1',//状态
|
||||||
|
sms_code : '', //验证码
|
||||||
};
|
};
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 用户注册
|
||||||
|
loginIn(){
|
||||||
|
this.$u.api.phoneRegister({
|
||||||
|
member_mobile: this.member_mobile,
|
||||||
|
sms_code: this.sms_code
|
||||||
|
}).then((res) => {
|
||||||
|
console.log(res)
|
||||||
|
// console.log(res)
|
||||||
|
if(res.errCode == 0){
|
||||||
|
// 缓存用户的信息
|
||||||
|
uni.setStorage({
|
||||||
|
key: 'user_info',
|
||||||
|
data: res.data,
|
||||||
|
success: function () {
|
||||||
|
console.log('success');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// 注册返回参数
|
||||||
|
this.$refs.uToast.show({
|
||||||
|
title: res.message,
|
||||||
|
type: 'success',
|
||||||
|
url: '/pageA/topick/topick'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if(res.errCode == 1){
|
||||||
|
this.$refs.uToast.show({
|
||||||
|
title: res.message,
|
||||||
|
type: 'error'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
// 选中某个复选框时,由checkbox时触发
|
// 选中某个复选框时,由checkbox时触发
|
||||||
checkboxChange(e) {
|
checkboxChange(e) {
|
||||||
//console.log(e);
|
//console.log(e);
|
||||||
@ -75,9 +118,19 @@
|
|||||||
checkboxGroupChange(e) {
|
checkboxGroupChange(e) {
|
||||||
// console.log(e);
|
// console.log(e);
|
||||||
},
|
},
|
||||||
mask_u(){
|
mask_u() {
|
||||||
this.show = !this.show
|
this.show = !this.show
|
||||||
},
|
},
|
||||||
|
// 注册接口
|
||||||
|
tochange() {
|
||||||
|
// console.log("调用父组件的方法")
|
||||||
|
// console.log('2222',this._data.member_mobile)
|
||||||
|
let member_mobile = this._data.member_mobile
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
identifying
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
@ -153,6 +206,7 @@
|
|||||||
margin-bottom: 90rpx;
|
margin-bottom: 90rpx;
|
||||||
height: 70rpx;
|
height: 70rpx;
|
||||||
line-height: 70rpx;
|
line-height: 70rpx;
|
||||||
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.labales {
|
.labales {
|
||||||
@ -171,10 +225,12 @@
|
|||||||
line-height: 20px;
|
line-height: 20px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.uni-input-input, .uni-input-placeholder{
|
|
||||||
color:#fff!important;
|
.uni-input-input,
|
||||||
letter-spacing: 2rpx;
|
.uni-input-placeholder {
|
||||||
}
|
color: #fff!important;
|
||||||
|
letter-spacing: 2rpx;
|
||||||
|
}
|
||||||
|
|
||||||
.pact text {
|
.pact text {
|
||||||
font-size: 22rpx;
|
font-size: 22rpx;
|
||||||
@ -194,9 +250,9 @@
|
|||||||
.pact {
|
.pact {
|
||||||
position: relative;
|
position: relative;
|
||||||
padding-left: 40rpx;
|
padding-left: 40rpx;
|
||||||
overflow:hidden; //超出的文本隐藏
|
overflow: hidden; //超出的文本隐藏
|
||||||
text-overflow:ellipsis; //溢出用省略号显示
|
text-overflow: ellipsis; //溢出用省略号显示
|
||||||
white-space:nowrap; //溢出不换行
|
white-space: nowrap; //溢出不换行
|
||||||
}
|
}
|
||||||
|
|
||||||
.u-checkbox-group {
|
.u-checkbox-group {
|
||||||
@ -243,26 +299,31 @@
|
|||||||
zoom: 1;
|
zoom: 1;
|
||||||
position: relative;
|
position: relative;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap:wrap;
|
flex-wrap: wrap;
|
||||||
display: -webkit-flex; /* Safari */
|
display: -webkit-flex;
|
||||||
.rect_view{
|
|
||||||
|
/* Safari */
|
||||||
|
.rect_view {
|
||||||
width: 100rpx;
|
width: 100rpx;
|
||||||
height: 100rpx;
|
height: 100rpx;
|
||||||
.image{
|
|
||||||
width: 45rpx;
|
.image {
|
||||||
height: 53rpx;
|
width: 45rpx;
|
||||||
display: inline-block;
|
height: 53rpx;
|
||||||
|
display: inline-block;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
flex:1;
|
flex:1;
|
||||||
margin-top: 77rpx;
|
margin-top: 77rpx;
|
||||||
}
|
}
|
||||||
.rect_view:nth-child(2) image{
|
|
||||||
|
.rect_view:nth-child(2) image {
|
||||||
width: 57rpx;
|
width: 57rpx;
|
||||||
height: 45rpx;
|
height: 45rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.rect_butoon{
|
.rect_butoon {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
@ -271,38 +332,49 @@
|
|||||||
line-height: 85rpx;
|
line-height: 85rpx;
|
||||||
border-top: 1px #999999 solid;
|
border-top: 1px #999999 solid;
|
||||||
}
|
}
|
||||||
view{
|
|
||||||
|
view {
|
||||||
color: #666;
|
color: #666;
|
||||||
font-size:24rpx;
|
font-size: 24rpx;
|
||||||
margin-top: 30rpx;
|
margin-top: 30rpx;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.rect_view:nth-child(1) image,.rect_view:nth-child(1) view{
|
|
||||||
|
.rect_view:nth-child(1) image,
|
||||||
|
.rect_view:nth-child(1) view {
|
||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
.rect_view:nth-child(1) image{
|
|
||||||
|
.rect_view:nth-child(1) image {
|
||||||
margin-right: 20rpx;
|
margin-right: 20rpx;
|
||||||
}
|
}
|
||||||
.rect_view:nth-child(1){
|
|
||||||
|
.rect_view:nth-child(1) {
|
||||||
position: relative;
|
position: relative;
|
||||||
margin-right: 79rpx;
|
margin-right: 79rpx;
|
||||||
}
|
}
|
||||||
.rect_view:nth-child(1) view{
|
|
||||||
|
.rect_view:nth-child(1) view {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
}
|
}
|
||||||
.rect_view:nth-child(2) image,.rect_view:nth-child(2) view{
|
|
||||||
|
.rect_view:nth-child(2) image,
|
||||||
|
.rect_view:nth-child(2) view {
|
||||||
float: left;
|
float: left;
|
||||||
}
|
}
|
||||||
.rect_view:nth-child(2) image{
|
|
||||||
|
.rect_view:nth-child(2) image {
|
||||||
margin-left: 20rpx;
|
margin-left: 20rpx;
|
||||||
}
|
}
|
||||||
.rect_view:nth-child(2){
|
|
||||||
|
.rect_view:nth-child(2) {
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
.rect_view:nth-child(2) view{
|
|
||||||
|
.rect_view:nth-child(2) view {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
|
@ -14,7 +14,6 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
|
35
pages.json
35
pages.json
@ -7,7 +7,15 @@
|
|||||||
"root": "pageA",
|
"root": "pageA",
|
||||||
"pages": [
|
"pages": [
|
||||||
{
|
{
|
||||||
"path": "topick/topick"
|
"path": "topick/topick",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "",
|
||||||
|
"navigationStyle": "custom",
|
||||||
|
"app-plus": {
|
||||||
|
"titleNView": false,
|
||||||
|
"animationType": "slide-in-bottom"
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "bindinges/bindinges",
|
"path": "bindinges/bindinges",
|
||||||
@ -284,17 +292,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"path": "information/information",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "",
|
|
||||||
"navigationStyle": "custom",
|
|
||||||
"app-plus": {
|
|
||||||
"titleNView": false,
|
|
||||||
"animationType": "slide-in-bottom"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"path": "notice/notice",
|
"path": "notice/notice",
|
||||||
"style": {
|
"style": {
|
||||||
@ -769,6 +766,18 @@
|
|||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"path": "pages/information/information",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "",
|
||||||
|
"navigationStyle": "custom",
|
||||||
|
"app-plus": {
|
||||||
|
"titleNView": false,
|
||||||
|
"animationType": "slide-in-bottom"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/mine/index",
|
"path": "pages/mine/index",
|
||||||
"style": {
|
"style": {
|
||||||
@ -807,7 +816,7 @@
|
|||||||
"selectedIconPath": "static/image/tabbar/mall2.png",
|
"selectedIconPath": "static/image/tabbar/mall2.png",
|
||||||
"text": "商城"
|
"text": "商城"
|
||||||
}, {
|
}, {
|
||||||
"pagePath": "pages/API/index",
|
"pagePath": "pages/information/information",
|
||||||
"iconPath": "static/image/tabbar/message.png",
|
"iconPath": "static/image/tabbar/message.png",
|
||||||
"selectedIconPath": "static/image/tabbar/message2.png",
|
"selectedIconPath": "static/image/tabbar/message2.png",
|
||||||
"text": "消息"
|
"text": "消息"
|
||||||
|
Loading…
Reference in New Issue
Block a user