Merge pull request 'zmr' (#26) from zmr into master

Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/26
This commit is contained in:
zhaomingrui 2020-06-17 12:19:50 +08:00
commit df47e0d357
9 changed files with 445 additions and 144 deletions

View File

@ -7,16 +7,58 @@ export default {
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}) {
return vm.$u.post('auth/phoneLogin', {
member_mobile: member_mobile,
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,
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
});
}
}

View 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
// datarefCode
// 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>

View File

@ -47,8 +47,23 @@
};
},
onLoad() {
},
methods: {
apiwelcome(){
this.$u.api.documentInfo({
document_code:'agreement'
}).then((res)=>{
console.log('协议',res)
})
//
this.$u.api.pageList({}).then((res)=>{
console.log('协议',res)
})
},
// 3
remaining_time(){
this.timer=setInterval(() => {
@ -89,6 +104,7 @@
this.remaining_time()
//
this.getSystemInfo()
this.apiwelcome()
}
}
</script>

View File

@ -1,6 +1,6 @@
{
"name" : "deming",
"appid" : "",
"appid" : "__UNI__10450AF",
"description" : "",
"versionName" : "1.0.0",
"versionCode" : "100",
@ -17,40 +17,49 @@
"delay" : 0
},
/* */
"modules" : {},
"modules" : {
"OAuth" : {}
},
/* */
"distribute" : {
/* android */
"android" : {
"permissions" : [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<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\"/>",
"<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_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.CALL_PHONE\"/>",
"<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.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.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.CALL_PHONE\"/>",
"<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_CONTACTS\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
]
},
/* ios */
"ios" : {},
/* SDK */
"sdkConfigs" : {}
"sdkConfigs" : {
"ad" : {},
"oauth" : {
"qq" : {
"appid" : "101884160"
}
}
}
}
},
/* */
@ -72,7 +81,7 @@
"mp-toutiao" : {
"usingComponents" : true
},
"uniStatistics": {
"enable": false
"uniStatistics" : {
"enable" : false
}
}

View File

@ -8,24 +8,20 @@
<view class="title">手机登录</view>
<view class="labales">
<!-- <text></text> -->
<input type="tel" placeholder="手机号" />
<input type="tel" placeholder="请输入您的手机号" v-model="member_mobile" />
</view>
<view class="labales">
<!-- <text></text> -->
<input type="tel" placeholder="请输入验证码" />
<input type="tel" placeholder="请输入验证码" v-model="sms_code" />
<!-- <text class="identifying" @click="getCode">{{text}}</text> -->
<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>
</view>
<identifying @tochange="tochange" :smslog_type="smslog_type" :member_mobile="member_mobile" ></identifying>
</view>
<!-- 服务协议 -->
<view class="pact">
<view></view>
<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">
@ -36,17 +32,17 @@
</view>
<!-- 注册 -->
<view class="more_Login">
<text>新用户点击注册</text>
<text @click="registerUrl()">{{register}}</text>
<text class="other" @click="mask_u">其他方式登录</text>
</view>
<!-- denglu QQ weixin -->
<view class="buttones">
<u-button>{{login}}</u-button>
<u-button @click="loginOn">{{login}}</u-button>
</view>
<u-mask :show="show" @click="show = false">
<view class="warp">
<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>
<view>QQ登录</view>
</view>
@ -59,26 +55,127 @@
</view>
</u-mask>
</view>
<u-toast ref="uToast" />
</view>
</template>
<script>
import identifying from '@/components/logininput/identifying'
export default {
data() {
return {
list: [{
checked: false,
checked: true,
disabled: false
}],
value: '',
phones : '',
text: '获取验证码',
login: '登录',
register : '新用户点击注册',
show: false,
tips: '',
// refCode: null,
seconds: 60,
member_mobile: '', //
smslog_type : '2',//
sms_code : '', //
};
},
onLoad() {
//
this.apiwelcome()
},
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
checkboxChange(e) {
//console.log(e);
@ -90,66 +187,18 @@
mask_u() {
this.show = !this.show
},
//
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('倒计时开始');
tochange(){
}
},
components:{
identifying
}
};
</script>
<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 {
// background: url(../../static/pageA/loginbackground.png) no-repeat!important;

View File

@ -5,15 +5,17 @@
<image class="images" src="../../static/pageA/loginbackground.png"></image>
<view class="backes"></view>
<view class="content">
<view class="title">手机登录</view>
<view class="title">手机注册</view>
<view class="labales">
<!-- <text></text> -->
<input type="tel" placeholder="手机号" />
<input type="tel" placeholder="请输入您的手机号" v-model="member_mobile" />
</view>
<view class="labales">
<!-- <text></text> -->
<input type="tel" placeholder="请输入验证码" />
<text class="identifying">获取验证码</text>
<input type="tel" placeholder="请输入验证码" v-model="sms_code" />
<!-- <text class="identifying" @click="apiwelcome()">获取验证码</text> -->
<!-- 验证码接口的引入 -->
<identifying @tochange="tochange" :smslog_type="smslog_type" :member_mobile="member_mobile" ></identifying>
</view>
<!-- 服务协议 -->
<view class="pact">
@ -24,7 +26,7 @@
<text class="pact_text">使用协议</text>
<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"
shape="circle" size="14" active-color="#19BE6B"></u-checkbox>
shape="circle" size="14" active-color="#19BE6B" ></u-checkbox>
</u-checkbox-group>
</view>
</view>
@ -34,7 +36,7 @@
<text class="other" @click="mask_u">其他方式登录</text>
</view>
<!-- denglu QQ weixin -->
<u-button>{{login}}</u-button>
<u-button @click="loginIn">{{login}}</u-button>
<u-mask :show="show" @click="show = false">
<view class="warp">
<view class="rect" @tap.stop>
@ -43,7 +45,7 @@
<view>QQ登录</view>
</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 class="rect_butoon" @click="show = false">取消</view>
@ -51,22 +53,63 @@
</view>
</u-mask>
</view>
<!-- 提示框 -->
<u-toast ref="uToast" />
</view>
</template>
<script>
import identifying from '@/components/logininput/identifying'
export default {
data() {
return {
list: [{
checked: false,
checked: true,
disabled: false
}],
value: '',
login: '登录',
show: false
login: '注册',
show: false,
member_mobile: '', //
smslog_type : '1',//
sms_code : '', //
};
},
onLoad() {
},
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
checkboxChange(e) {
//console.log(e);
@ -75,9 +118,19 @@
checkboxGroupChange(e) {
// console.log(e);
},
mask_u(){
mask_u() {
this.show = !this.show
},
//
tochange() {
// console.log("")
// console.log('2222',this._data.member_mobile)
let member_mobile = this._data.member_mobile
}
},
components: {
identifying
}
};
</script>
@ -153,8 +206,9 @@
margin-bottom: 90rpx;
height: 70rpx;
line-height: 70rpx;
color: #fff;
}
.labales {
position: relative;
}
@ -171,10 +225,12 @@
line-height: 20px;
}
}
.uni-input-input, .uni-input-placeholder{
color:#fff!important;
letter-spacing: 2rpx;
}
.uni-input-input,
.uni-input-placeholder {
color: #fff!important;
letter-spacing: 2rpx;
}
.pact text {
font-size: 22rpx;
@ -194,9 +250,9 @@
.pact {
position: relative;
padding-left: 40rpx;
overflow:hidden; //
text-overflow:ellipsis; //
white-space:nowrap; //
overflow: hidden; //
text-overflow: ellipsis; //
white-space: nowrap; //
}
.u-checkbox-group {
@ -243,26 +299,31 @@
zoom: 1;
position: relative;
display: flex;
flex-wrap:wrap;
display: -webkit-flex; /* Safari */
.rect_view{
flex-wrap: wrap;
display: -webkit-flex;
/* Safari */
.rect_view {
width: 100rpx;
height: 100rpx;
.image{
width: 45rpx;
height: 53rpx;
display: inline-block;
.image {
width: 45rpx;
height: 53rpx;
display: inline-block;
}
flex:1;
margin-top: 77rpx;
}
.rect_view:nth-child(2) image{
.rect_view:nth-child(2) image {
width: 57rpx;
height: 45rpx;
}
.rect_butoon{
.rect_butoon {
width: 100%;
position: absolute;
bottom: 0;
@ -271,38 +332,49 @@
line-height: 85rpx;
border-top: 1px #999999 solid;
}
view{
view {
color: #666;
font-size:24rpx;
font-size: 24rpx;
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;
}
.rect_view:nth-child(1) image{
.rect_view:nth-child(1) image {
margin-right: 20rpx;
}
.rect_view:nth-child(1){
.rect_view:nth-child(1) {
position: relative;
margin-right: 79rpx;
}
.rect_view:nth-child(1) view{
.rect_view:nth-child(1) view {
position: absolute;
bottom: 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;
}
.rect_view:nth-child(2) image{
.rect_view:nth-child(2) image {
margin-left: 20rpx;
}
.rect_view:nth-child(2){
.rect_view:nth-child(2) {
position: relative;
}
.rect_view:nth-child(2) view{
.rect_view:nth-child(2) view {
position: absolute;
bottom: 0;
left: 0;

View File

@ -14,7 +14,6 @@
}
},
onLoad() {
},
methods: {

View File

@ -7,7 +7,15 @@
"root": "pageA",
"pages": [
{
"path": "topick/topick"
"path": "topick/topick",
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom",
"app-plus": {
"titleNView": false,
"animationType": "slide-in-bottom"
}
}
},
{
"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",
"style": {
@ -769,6 +766,18 @@
"navigationStyle": "custom"
}
},
{
"path": "pages/information/information",
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom",
"app-plus": {
"titleNView": false,
"animationType": "slide-in-bottom"
}
}
},
{
"path": "pages/mine/index",
"style": {
@ -807,12 +816,12 @@
"selectedIconPath": "static/image/tabbar/mall2.png",
"text": "商城"
}, {
"pagePath": "pages/API/index",
"pagePath": "pages/information/information",
"iconPath": "static/image/tabbar/message.png",
"selectedIconPath": "static/image/tabbar/message2.png",
"text": "消息"
}, {
"pagePath": "pages/mine/index",
"pagePath": "pages/mine/index",
"iconPath": "static/image/tabbar/mine.png",
"selectedIconPath": "static/image/tabbar/mine2.png",
"text": "我的"