更改随机名字

This commit is contained in:
GaoHao
2024-12-23 19:38:39 +08:00
parent b4be77303e
commit 6d72021f87
128 changed files with 11752 additions and 2333 deletions

View File

@@ -0,0 +1,292 @@
<template>
<view class="containerDEghTTorsp">
<view class="wrapperDEghTTorsp">
<view class="input-contentDEghTTorsp">
<view class="cu-form-group"
style="border-bottom: 2upx solid whitesmoke;margin-bottom: 20px;">
<view class="title text-black">手机号</view>
<input type="number" :value="phone" placeholder="请输入手机号" maxlength="11" data-key="phone"
@input="inputChangeDEghTTorsp" />
</view>
<view class="cu-form-group padding-right-xs"
style="border-bottom: 2upx solid whitesmoke;margin-bottom: 20px;">
<text class="title text-black">验证码</text>
<input type="number" :value="code" placeholder="请输入验证码" maxlength="6" data-key="code"
@input="inputChangeDEghTTorsp" @confirm="startRegDEghTTorsp" />
<button class="send-msgDEghTTorsp" @click="sendMsgDEghTTorsp" :disabled="sending">{{ sendTime }}</button>
</view>
<view class="cu-form-group"
style="border-bottom: 2upx solid whitesmoke;margin-bottom: 20px;">
<text class="title text-black">设置密码</text>
<input type="password" :value="password" placeholder="请设置密码" placeholder-class="input-empty"
maxlength="20" minlength="6" data-key="password" @input="inputChangeDEghTTorsp" @confirm="startRegDEghTTorsp" />
</view>
<!-- <view class="cu-form-group"
style="border-bottom: 2upx solid whitesmoke;margin-bottom: 20px;"
v-if="required == '是'">
<text class="title text-black">邀请码</text>
<input type="" maxlength="6" :value="invitation" placeholder="请填写邀请码(必填)" data-key="invitation"
@input="inputChangeDEghTTorsp" @confirm="startRegDEghTTorsp" />
</view>
<view class="cu-form-group"
style="border-bottom: 2upx solid whitesmoke;margin-bottom: 20px;"
v-if="required == '否'">
<text class="title text-black">邀请码</text>
<input type="" maxlength="6" :value="invitation" placeholder="请填写邀请码(选填)" data-key="invitation"
@input="inputChangeDEghTTorsp" @confirm="startRegDEghTTorsp" />
</view> -->
</view>
<button class="confirm-btnDEghTTorsp" @click="startRegDEghTTorsp">立即注册</button>
<view class="footerDEghTTorsp">
<text @tap="isShowAgreeDEghTTorsp" class="cuIcon"
:class="showAgree ? 'cuIcon-radiobox' : 'cuIcon-round'">同意</text>
<!-- 协议地址 -->
<navigator url="/me/setting/mimi" open-type="navigate">隐私政策</navigator>
<navigator url="/me/setting/xieyi" open-type="navigate">用户服务协议</navigator>
</view>
</view>
</view>
</template>
<script>
var _this;
export default {
data() {
return {
userName: '',
showAgree: false,
code: '',
phone: '',
password: '',
required: '否',
sending: false,
sendTime: '获取验证码',
count: 60,
relation: "",
state: '',
invitation: '',
platform: 'app',
sysPhone:1
}
},
onLoad() {
let a = this.$queue.getData("isEnable")
if (a) {
this.isEnable = a;
}
this.invitationMaDEghTTorsp();
// #ifdef APP-PLUS
switch (uni.getSystemInfoSync().platform) {
case 'android':
break;
case 'ios':
this.sysPhone = 2;
break;
default:
break;
}
// #endif
},
mounted() {
_this = this;
},
methods: {
// 注册邀请码必填
invitationMaDEghTTorsp() {
this.$Request.getT('/app/common/type/3').then(res => {
if (res.code == 0) {
this.required = res.data.value;
}
});
},
inputChangeDEghTTorsp(e) {
const key = e.currentTarget.dataset.key;
this[key] = e.detail.value;
},
countDown() {
const {
count
} = this;
if (count === 1) {
this.count = 60;
this.sending = false;
this.sendTime = '获取验证码';
} else {
this.count = count - 1;
this.sending = true;
this.sendTime = count - 1 + '秒后重新获取';
setTimeout(this.countDown.bind(this), 1000);
}
},
sendMsgDEghTTorsp() {
const {
phone
} = this;
if (!phone) {
this.$queue.showToast("请输入手机号");
} else if (phone.length !== 11) {
this.$queue.showToast("请输入正确的手机号");
} else {
this.$queue.showLoading("正在发送验证码...");
this.$Request.getT("/app/Login/sendMsg/" + phone + "/bindWx").then(res => {
if (res.code === 0) {
this.sending = true;
this.$queue.showToast('验证码发送成功请注意查收');
this.countDown();
uni.hideLoading();
} else {
console.log(JSON.stringify(res))
uni.hideLoading();
uni.showModal({
showCancel: false,
title: '短信发送失败',
content: res.msg ? res.msg : '请一分钟后再获取验证码',
});
}
});
}
},
isShowAgreeDEghTTorsp() {
//是否选择协议
_this.showAgree = !_this.showAgree;
},
startRegDEghTTorsp() {
if (this.phone.length != 11) {
uni.showToast({
icon: 'none',
position: 'bottom',
title: '手机号不正确'
});
return false;
}
if (this.code.length != 6) {
uni.showToast({
icon: 'none',
position: 'bottom',
title: '验证码不正确'
});
return false;
}
if (!this.password) {
this.$queue.showToast('请设置密码');
return false;
}
if (this.password.length < 6) {
this.$queue.showToast('密码位数必须大于六位');
return false;
}
if (!_this.invitation && this.required == '是') {
this.$queue.showToast('请填写邀请码');
return false;
}
this.$queue.showLoading('登陆中...')
_this.isRotate = true;
let qdCodeion = '';
if (uni.getStorageSync('qdCodeion')) {
qdCodeion = uni.getStorageSync('qdCodeion')
}
console.error(_this.$queue.getData('weixinToken'))
console.error(_this.$queue.getData('unionid'))
console.error(_this.$queue.getData('weixinOpenid'))
this.$Request.postT("/app/Login/wxBindMobile", {
password: _this.password,
phone: _this.phone,
code: _this.code,
platform: _this.platform,
inviterCode: _this.invitation,
qdCode: qdCodeion,
sysPhone:_this.sysPhone,
token: _this.$queue.getData('weixinToken'),
unionid: _this.$queue.getData('unionid'),
wxOpenId: _this.$queue.getData("weixinOpenid")
}).then(res => {
console.log(JSON.stringify(res))
if (res.code === 0) {
this.$queue.setData("mobile", _this.phone);
this.$queue.setData("token", res.token);
this.$queue.setData("userId", res.user.userId);
uni.switchTab({
url: '/pages/index/index'
})
} else {
_this.isRotate = false;
uni.hideLoading();
uni.showModal({
showCancel: false,
title: '绑定失败',
content: res.msg,
});
}
});
}
}
}
</script>
<style lang='scss'>
page {
height: 100%;
background: #FFFFFF !important;
}
.footerDEghTTorsp {
padding-left: 140upx;
margin-top: 32upx;
text-align: center;
display: flex;
color: #333;
}
.send-msgDEghTTorsp {
border-radius: 30px;
color: white;
height: 30px;
font-size: 10px;
line-height: 30px;
background: #5E81F9;
}
.containerDEghTTorsp {
padding-top: 32upx;
position: relative;
width: 100%;
height: 100%;
overflow: hidden;
}
.wrapperDEghTTorsp {
position: relative;
z-index: 90;
background: #FFFFFF;
padding-bottom: 20px;
}
.input-contentDEghTTorsp {
padding: 32upx 80upx;
}
.confirm-btnDEghTTorsp {
width: 600upx;
height: 80upx;
line-height: 80upx;
border-radius: 60upx;
margin-top: 32upx;
background: #5E81F9;
color: #fff;
font-size: 32upx;
&:after {
border-radius: 60px;
}
}
</style>

View File

@@ -0,0 +1,31 @@
<template>
<view class="">
<image src="../../../static/iosImg/DEghTTorspIMG_6772.JPG" mode="aspectFill"></image>
<image src="../../../static/iosImg/DEghTTorspIMG_6773.JPG" mode="aspectFill"></image>
</view>
</template>
<script>
export default {
data() {
return {
}
},
onShow() {
},
onHide() {
},
onLoad(option) {
},
methods: {
}
}
</script>
<style lang="scss" scoped>
</style>

View File

@@ -0,0 +1,235 @@
<template>
<view class="containerDEghTTorsp">
<view class="wrapperDEghTTorsp">
<view class="input-contentDEghTTorsp">
<view class="cu-form-group"
style="border: 2upx solid whitesmoke;margin-bottom: 20px;border-radius: 30px">
<view class="title">手机号</view>
<input type="number" :value="mobile" placeholder="请输入手机号" maxlength="11" data-key="mobile"
@input="inputChangeDEghTTorsp" />
</view>
<view class="cu-form-group"
style="border: 2upx solid whitesmoke;margin-bottom: 20px;border-radius: 30px">
<text class="title">验证码</text>
<input type="number" :value="code" placeholder="请输入验证码" maxlength="6" data-key="code"
@input="inputChangeDEghTTorsp" @confirm="toLoginDEghTTorsp" />
<button class="send-msgDEghTTorsp" @click="sendMsgDEghTTorsp" :disabled="sendIng">{{sendTime}}</button>
</view>
<view class="cu-form-group"
style="border: 2upx solid whitesmoke;margin-bottom: 20px;border-radius: 30px">
<text class="title">设置密码</text>
<input type="password" :value="password" placeholder="请设置新密码" placeholder-class="input-empty"
maxlength="20" minlength="6" data-key="password" @input="inputChangeDEghTTorsp" @confirm="toLoginDEghTTorsp" />
</view>
</view>
<button class="confirm-btnDEghTTorsp" @click="toLoginDEghTTorsp">立即重置</button>
</view>
</view>
</template>
<script>
export default {
data() {
return {
code: '',
mobile: '',
password: '',
sendIng: false,
sendTime: '获取验证码',
count: 60,
loginIng: false
}
},
methods: {
sendMsgDEghTTorsp() {
const {
mobile
} = this;
if (!mobile) {
uni.showToast({
title: '请输入手机号',
icon: 'none',
duration: 1000
})
} else if (mobile.length !== 11) {
uni.showToast({
title: '请输入正确的手机号',
icon: 'none',
duration: 1000
})
} else {
uni.showLoading({
title: '正在发送验证码...'
})
this.$u.get('/app/Login/sendMsg/' + mobile + '/forget').then(res => {
if (res.code === 0) {
this.sendIng = true;
uni.showToast({
title: '验证码发送成功请注意查收',
icon: 'none',
duration: 1000
})
this.countDown();
uni.hideLoading();
} else {
uni.hideLoading();
uni.showModal({
showCancel: false,
title: '短信发送失败',
content: res.msg ? res.msg : '请一分钟后再获取验证码'
});
}
});
}
},
countDown() {
const {
count
} = this;
if (count === 1) {
this.count = 60;
this.sendIng = false;
this.sendTime = '获取验证码'
} else {
this.count = count - 1;
this.sendIng = true;
this.sendTime = count - 1 + '秒后获取';
setTimeout(this.countDown.bind(this), 1000);
}
},
inputChangeDEghTTorsp(e) {
const key = e.currentTarget.dataset.key;
this[key] = e.detail.value;
},
navBackDEghTTorsp() {
uni.navigateBack();
},
navToDEghTTorsp(url) {
uni.navigateTo({
url
})
},
toLoginDEghTTorsp() {
const {
mobile,
password,
code
} = this;
if (!mobile) {
// this.$queue.showToast("请输入手机号");
uni.showToast({
title: '请输入手机号',
icon: 'none',
duration: 1000
})
} else if (!code) {
// this.$queue.showToast("密码位数必须大于六位");
uni.showToast({
title: '请输入验证码',
icon: 'none',
duration: 1000
})
} else if (!password) {
// this.$queue.showToast("请设置密码");
uni.showToast({
title: '请输入密码',
icon: 'none',
duration: 1000
})
} else {
this.loginIng = true;
// this.$queue.showLoading("正在修改密码中...");
uni.showLoading({
title: '正在修改密码中...'
})
this.$u.post('/app/Login/forgetPwd?pwd=' + password + '&phone=' + mobile + '&msg=' + code).then(
res => {
// this.$Request.postJson("/appLogin/forgetPwd",{
// pwd: password,
// phone: mobile,
// msg: code
// }).then(res => {
uni.hideLoading();
if (res.code === 0) {
uni.showToast({
title: '密码找回成功',
icon: 'none'
});
setTimeout(function() {
uni.navigateTo({
url: '/pages/ghtwwlkXYG/wVghNzmqkQ'
});
}, 1000)
} else {
uni.showModal({
showCancel: false,
title: '密码找回失败',
content: res.msg,
});
}
});
}
},
},
}
</script>
<style lang='scss'>
page {
background: #ffffff;
}
.send-msgDEghTTorsp {
border-radius: 30px;
color: white;
height: 30px;
font-size: 14px;
line-height: 30px;
background: #ff7581;
}
.containerDEghTTorsp {
padding-top: 32upx;
position: relative;
width: 100%;
height: 100%;
overflow: hidden;
background: #ffffff;
}
.wrapperDEghTTorsp {
position: relative;
z-index: 90;
background: #ffffff;
padding-bottom: 20px;
}
.input-contentDEghTTorsp {
padding: 0 20px;
}
.confirm-btnDEghTTorsp {
width: 300px;
height: 42px;
line-height: 42px;
border-radius: 30px;
margin-top: 40px;
background: #ff7581;
/* background: linear-gradient(to left, #3a55b9 0, #5074FF 100%); */
color: #ffffff;
font-size: 32rpx;
&:after {
border-radius: 60px;
}
}
</style>

View File

@@ -0,0 +1,368 @@
<template>
<view class="containerDEghTTorsp">
<view class="bg u-absolute" style="width: 100%;height: 100%;overflow: hidden;top: 0;">
<u-image src="../../static/images/i_bg.png" style="width: 100%;height:100%" mode=""></u-image>
</view>
<view class="wrapperDEghTTorsp u-relative" style="padding-top: 48rpx;box-sizing: border-box;">
<view class="input-contentDEghTTorsp">
<view style="font-size: 58rpx;font-weight: bold;color: #333;margin-bottom: 48rpx;">注册</view>
<view class="cu-form-groupDEghTTorsp" >
<view class="title">手机号</view>
<input class="input" type="number" :value="mobile" placeholder="请输入手机号" maxlength="11" data-key="mobile"
@input="inputChangeDEghTTorsp" />
</view>
<view class="cu-form-groupDEghTTorsp" >
<text class="title">验证码</text>
<view class="input flex">
<input type="number" :value="code" placeholder="请输入验证码" maxlength="6" data-key="code"
@input="inputChangeDEghTTorsp" @confirm="toLoginDEghTTorsp" />
<button class="send-msgDEghTTorsp" @click="sendMsgDEghTTorsp" :disabled="sending">{{ sendTime }}</button>
</view>
</view>
<view class="cu-form-groupDEghTTorsp" >
<text class="title">设置密码</text>
<input class="input" type="password" :value="password" placeholder="请设置新密码" placeholder-class="input-empty"
maxlength="20" minlength="6" data-key="password" @input="inputChangeDEghTTorsp" @confirm="toLoginDEghTTorsp" />
</view>
<!-- <view class="cu-form-groupDEghTTorsp"
style="border: 2upx solid whitesmoke;margin-bottom: 20px;border-radius: 30px">
<text class="title">邀请码</text>
<input type="text" v-if="registerCode == '是'" :value="invitation" placeholder="请填写邀请码"
data-key="invitation" maxlength="20" @input="inputChangeDEghTTorsp" @confirm="toLoginDEghTTorsp" />
<input type="text" v-if="registerCode == '否'" :value="invitation" placeholder="请填写邀请码(选填)"
data-key="invitation" maxlength="20" @input="inputChangeDEghTTorsp" @confirm="toLoginDEghTTorsp" />
</view> -->
<button class="confirm-btnDEghTTorsp" @click="toRegisterDEghTTorsp">注册</button>
<button class="confirm-btnDEghTTorsp" @click="toLoginDEghTTorsp">登录</button>
</view>
<view class="footerViewDEghTTorsp">
<text @tap="isShowAgreeDEghTTorsp" class="cuIcon"
:class="showAgree ? 'cuIcon-radiobox' : 'cuIcon-round'">同意</text>
<!-- 协议地址 -->
<navigator url="/me/setting/mimi" open-type="navigate" style="color: #37A6FF;">隐私政策</navigator>
<navigator url="/me/setting/xieyi" open-type="navigate" style="color: #37A6FF;">用户协议</navigator>
</view>
</view>
<!-- #ifdef H5 -->
<!-- <div v-if="isWeixin" style="width: 100%;height: 100%;position: fixed;top: 0;z-index: 999;background: url('../../static/images/open_guide.png') no-repeat center bottom / cover;"></div> -->
<!-- #endif -->
</view>
</template>
<script>
export default {
data() {
return {
showAgree: false,
code: '',
mobile: '',
password: '',
sending: false,
sendTime: '获取验证码',
count: 60,
relation: "",
invitation: '',
registerCode: '',
qdCodeion: '',
isWeixin: false,
};
},
onLoad(e) {
let relation = e.invitation
if (relation) {
this.relation = relation;
this.invitation = relation;
}
if (e.qdCode) {
this.qdCodeion = e.qdCode
}
this.$u.get('/app/common/type/3').then(res => {
if (res.code == 0) {
this.registerCode = res.data.value
}
});
let u = navigator.userAgent;
if ( u.toLowerCase().indexOf('micromessenger') !== -1) {
this.isWeixin = true
}
},
methods: {
isShowAgreeDEghTTorsp() {
//是否选择协议
this.showAgree = !this.showAgree;
},
sendMsgDEghTTorsp() {
const {
mobile
} = this;
if (!mobile) {
uni.showToast({
title: '请输入手机号',
icon: 'none',
duration: 1000
})
} else if (mobile.length !== 11) {
uni.showToast({
title: '请输入正确的手机号',
icon: 'none',
duration: 1000
})
} else {
uni.showLoading({
title: '正在发送验证码...'
})
this.$u.get('/app/Login/sendMsg/' + mobile + '/login').then(res => {
if (res.code === 0) {
this.sending = true;
uni.showToast({
title: '验证码发送成功请注意查收',
icon: 'none',
duration: 1000
})
this.countDown();
uni.hideLoading();
} else {
uni.hideLoading();
uni.showModal({
showCancel: false,
title: '短信发送失败',
content: res.msg ? res.msg : '请一分钟后再获取验证码'
});
}
});
}
},
countDown() {
const {
count
} = this;
if (count === 1) {
this.count = 60;
this.sending = false;
this.sendTime = '获取验证码';
} else {
this.count = count - 1;
this.sending = true;
this.sendTime = count - 1 + '秒后重新获取';
setTimeout(this.countDown.bind(this), 1000);
}
},
inputChangeDEghTTorsp(e) {
const key = e.currentTarget.dataset.key;
this[key] = e.detail.value;
},
toLoginDEghTTorsp() {
console.log("123");
uni.reLaunch({
url: '/pages/ghtwwlkXYG/wVghNzmqkQ'
});
},
toRegisterDEghTTorsp() {
const {
mobile,
password,
code,
showAgree,
invitation,
registerCode,
qdCodeion
} = this;
if (!mobile) {
uni.showToast({
title: '请输入账号',
icon: 'none',
duration: 1000
})
return
}
if (!code) {
uni.showToast({
title: '请输入验证码',
icon: 'none',
duration: 1000
})
return
}
if (!password) {
uni.showToast({
title: '请设置密码',
icon: 'none',
duration: 1000
})
return
}
if (password.length < 6) {
uni.showToast({
title: '密码位数必须大于六位',
icon: 'none',
duration: 1000
})
return
}
if (invitation.length == 0 && registerCode == '是') {
uni.showToast({
title: '请输入邀请码',
icon: 'none',
duration: 1000
})
return
}
if (!showAgree) {
uni.showToast({
title: '请先同意《隐私政策》和《用户协议》',
icon: 'none',
duration: 1000
})
return
}
this.logining = true;
uni.showLoading({
title: '注册中...'
})
let platform = ''
// #ifdef APP
platform = 'app'
// #endif
// #ifdef H5
platform = 'h5'
// #endif
this.$u.post('/app/Login/registerCode?password=' + password + '&phone=' + mobile + '&msg=' + code +
'&inviterCode=' + invitation + '&platform=' + platform + '&qdCode=' + qdCodeion).then(res => {
if (res.code === 0) {
// this.$queue.remove('invitation');
uni.setStorageSync('token', res.token)
uni.setStorageSync('userId', res.user.userId)
uni.setStorageSync('phone', res.user.phone)
uni.setStorageSync('invitationCode', res.user.invitationCode)
//设置渠道码
if (res.user.qdCode) {
uni.setStorageSync('qdCode', res.user.qdCode)
}
uni.showToast({
title: '注册成功',
icon: 'none'
})
setTimeout(function() {
uni.navigateTo({
url: '/pages/ghtwwlkXYG/YEZelghNit'
})
}, 1000)
} else {
uni.hideLoading();
uni.showModal({
showCancel: false,
title: '注册失败',
content: res.msg
});
}
});
}
}
};
</script>
<style lang="scss">
page {
background: #fff;
}
.footerViewDEghTTorsp {
display: flex;
justify-content: center;
align-items: center;
font-weight: 400;
font-size: 24rpx;
color: #333333;
position: absolute;
left: 0;
right: 0;
bottom: 178rpx;
.cuIcon::before{
width: 30rpx;
height: 30rpx;
margin-right: 12rpx;
}
.cuIcon-round::before {
content: "\e6d7";
}
.cuIcon-radiobox:before {
content: "\e75b";
color: #37A6FF;
}
}
.send-msgDEghTTorsp {
line-height: initial;
font-weight: 400;
font-size: 28rpx;
color: #EC6F48;
border: none;
background-color: transparent!important;
}
.send-msgDEghTTorsp::after{
border: none;
background-color: transparent;
}
.containerDEghTTorsp {
position: relative;
width: 100%;
height: 100%;
overflow: hidden;
background: #fff;
}
.wrapperDEghTTorsp {
position: relative;
z-index: 90;
min-height: 100vh;
}
.input-contentDEghTTorsp {
padding: 0 56rpx;
.cu-form-groupDEghTTorsp{
display: flex;
flex-direction: column;
align-items: flex-start;
margin-bottom: 48rpx;
background-color: transparent;
padding: 0;
.title{
margin-bottom: 32rpx;
font-weight: 400;
font-size: 28rpx;
color: #333333;
}
.input{
width: 100%;
height: 84rpx;
line-height: 84rpx;
background-color: #fff;
align-items: center;
padding: 22rpx 32rpx 22rpx 24rpx;
}
}
}
.confirm-btnDEghTTorsp {
width: 100%;
height: 100rpx;
text-align: center;
line-height: 100rpx;
border-radius: 16rpx;
margin-top: 40rpx;
background: #EC6F48;
font-size: 32rpx;
color: #FFFFFF;
&:after {
border: none;
}
}
</style>

View File

@@ -0,0 +1,31 @@
<template>
<view class="">
<image src="../../../static/iosImg/DEghTTorspIMG_6774.JPG" mode="aspectFill"></image>
<image src="../../../static/iosImg/DEghTTorspIMG_6775.JPG" mode="aspectFill"></image>
</view>
</template>
<script>
export default {
data() {
return {
}
},
onShow() {
},
onHide() {
},
onLoad(option) {
},
methods: {
}
}
</script>
<style lang="scss" scoped>
</style>

View File

@@ -0,0 +1,191 @@
<template>
<view class="containerViewDEghTTorsp">
<view class="cu-form-group"
style="margin: 30upx;border: 2upx solid whitesmoke;margin-bottom: 20px;border-radius: 30px">
<view class="title">手机号</view>
<input type="number" :value="mobile" placeholder="请输入手机号" maxlength="11" data-key="mobile"
@input="inputChangeDEghTTorsp" />
</view>
<view class="cu-form-group"
style="margin: 30upx;border: 2upx solid whitesmoke;margin-bottom: 20px;border-radius: 30px">
<text class="title">验证码</text>
<input type="number" :value="code" placeholder="请输入验证码" maxlength="6" data-key="code" @input="inputChangeDEghTTorsp"
@confirm="toLoginDEghTTorsp" />
<button class="send-msgDEghTTorsp" @click="sendMsgDEghTTorsp" :disabled="sendIng">{{ sendTime }}</button>
</view>
<button class="confirm-btnDEghTTorsp" @click="toLoginDEghTTorsp" :disabled="loginIng">立即绑定</button>
</view>
</template>
<script>
import listCell from '@/components/com-input';
export default {
components: {
listCell
},
data() {
return {
mobile: '',
code: '',
loginIng: false,
sendIng: false,
sendTime: '获取验证码',
count: 60,
type: '',
}
},
onLoad(option) {
if (option.type) {
this.type = option.type
}
},
methods: {
inputChangeDEghTTorsp(e) {
const key = e.currentTarget.dataset.key;
this[key] = e.detail.value;
},
navBackDEghTTorsp() {
uni.navigateBack();
},
countDown() {
const {
count
} = this;
if (count === 1) {
this.count = 60;
this.sendIng = false;
this.sendTime = '获取验证码'
} else {
this.count = count - 1;
this.sendIng = true;
this.sendTime = count - 1 + '秒后重新获取';
setTimeout(this.countDown.bind(this), 1000);
}
},
sendMsgDEghTTorsp() {
const {
mobile
} = this;
if (!mobile) {
this.$queue.showToast("请输入手机号");
} else if (mobile.length !== 11) {
this.$queue.showToast("请输入正确的手机号");
} else {
this.$queue.showLoading("正在发送验证码...");
this.$Request.getT('/app/Login/sendMsg/' + mobile + '/gzg').then(res => {
if (res.code === 0) {
this.sendIng = true;
this.$queue.showToast('验证码发送成功请注意查收');
this.countDown();
uni.hideLoading();
} else {
uni.hideLoading();
uni.showModal({
showCancel: false,
title: '短信发送失败',
content: res.msg ? res.msg : '请一分钟后再获取验证码'
});
}
});
}
},
toLoginDEghTTorsp() {
const {
mobile,
code
} = this;
let userId = this.$queue.getData("userId");
if (!mobile) {
this.$queue.showToast("请输入手机号");
} else if (mobile.length !== 11) {
this.$queue.showToast("请输入正确的手机号");
} else if (!code) {
this.$queue.showToast("请输入验证码");
} else {
this.$queue.showLoading("正在绑定中...");
let openId = this.$queue.getData('openId') ? this.$queue.getData('openId') : '';
let openidnickname = this.$queue.getData('openidnickname') ? this.$queue.getData('openidnickname') :
'';
let openidheadimgurl = this.$queue.getData('openidheadimgurl') ? this.$queue.getData(
'openidheadimgurl') : '';
let invitation = this.$queue.getData('inviterCode') ? this.$queue.getData('inviterCode') : '';
let userId = this.$queue.getData('userId') ? this.$queue.getData('userId') : '';
this.$Request.post(`/app/Login/registerCode`, {
phone: mobile,
wxId: openId,
userId: userId,
inviterCode: invitation,
avatar: openidheadimgurl,
userName: openidnickname,
msg: code
}).then(res => {
if (res.code === 0) {
this.$queue.setData("token", res.token);
this.$queue.setData('userId', res.user.userId);
this.$queue.setData('userName', res.user.userName);
this.$queue.setData('phone', res.user.phone);
this.$queue.setData('avatar', res.user.avatar ? res.user.avatar :
'../../static/logo.png');
this.$queue.showToast('绑定成功');
setTimeout(function() {
uni.navigateBack()
}, 1000)
} else {
uni.showModal({
showCancel: false,
title: '绑定失败',
content: res.msg,
});
}
uni.hideLoading();
});
}
},
},
}
</script>
<style lang='scss'>
page {
background: #ffffff;
}
.send-msgDEghTTorsp {
border-radius: 30px;
color: white;
height: 30px;
font-size: 14px;
line-height: 30px;
background: #557EFD;
}
.containerViewDEghTTorsp {
top: 0;
padding-top: 32upx;
position: relative;
width: 100%;
height: 100%;
overflow: hidden;
background: #ffffff;
}
.confirm-btnDEghTTorsp {
width: 600upx;
height: 80upx;
line-height: 80upx;
border-radius: 60upx;
margin-top: 32upx;
background: #557EFD;
color: #ffffff;
font-size: 32upx;
&:after {
border-radius: 60px;
}
}
</style>

View File

@@ -0,0 +1,437 @@
<template>
<view class="containerDEghTTorsp">
<view class="bg u-absolute" style="width: 100%;height: 100%;overflow: hidden;top: 0;">
<u-image src="../../static/images/i_bg.png" style="width: 100%;height:100%" mode=""></u-image>
</view>
<view class="wrapperDEghTTorsp u-relative" style="padding-top: 48rpx;box-sizing: border-box;">
<view class="input-contentDEghTTorsp">
<view style="font-size: 58rpx;font-weight: bold;color: #333;margin-bottom: 48rpx;">注册</view>
<view class="cu-form-groupDEghTTorsp">
<view class="title">手机号</view>
<input class="input" type="number" :value="mobile" placeholder="请输入手机号" maxlength="11" data-key="mobile"
@input="inputChangeDEghTTorsp" />
</view>
<view class="cu-form-groupDEghTTorsp">
<text class="title">验证码</text>
<view class="input flex">
<input type="number" :value="code" placeholder="请输入验证码" maxlength="6" data-key="code"
@input="inputChangeDEghTTorsp" @confirm="toLoginDEghTTorsp" />
<button class="send-msgDEghTTorsp" @click="sendMsgDEghTTorsp" :disabled="sending">{{ sendTime }}</button>
</view>
</view>
<view class="cu-form-groupDEghTTorsp">
<text class="title">设置密码</text>
<input class="input" type="password" :value="password" placeholder="请设置新密码" placeholder-class="input-empty"
maxlength="20" minlength="6" data-key="password" @input="inputChangeDEghTTorsp" @confirm="toLoginDEghTTorsp" />
</view>
<!-- <view class="cu-form-groupDEghTTorsp"
style="border: 2upx solid whitesmoke;margin-bottom: 20px;border-radius: 30px">
<text class="title">邀请码</text>
<input type="text" v-if="registerCode == '是'" :value="invitation" placeholder="请填写邀请码"
data-key="invitation" maxlength="20" @input="inputChangeDEghTTorsp" @confirm="toLoginDEghTTorsp" />
<input type="text" v-if="registerCode == '否'" :value="invitation" placeholder="请填写邀请码(选填)"
data-key="invitation" maxlength="20" @input="inputChangeDEghTTorsp" @confirm="toLoginDEghTTorsp" />
</view> -->
<button class="confirm-btnDEghTTorsp" @click="toRegisterDEghTTorsp">注册</button>
<button class="confirm-btnDEghTTorsp" @click="toLoginDEghTTorsp">登录</button>
</view>
<view class="footerViewDEghTTorsp">
<text @tap="isShowAgreeDEghTTorsp" class="cuIcon"
:class="showAgree ? 'cuIcon-radiobox' : 'cuIcon-round'">注册即同意</text>
<!-- 协议地址 -->
<navigator url="/me/setting/mimi" open-type="navigate" style="color: #37A6FF;">隐私政策</navigator>
<navigator url="/me/setting/xieyi" open-type="navigate" style="color: #37A6FF;">用户协议</navigator>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
showAgree: false,
code: '',
mobile: '',
password: '',
sending: false,
sendTime: '获取验证码',
count: 60,
relation: "",
invitation: '',
registerCode: '',
qdCodeion: '', //渠道码
};
},
onLoad() {
if (uni.getStorageSync('qdCodeion')) {
this.qdCodeion = uni.getStorageSync('qdCodeion')
}
let relation = uni.getStorageSync('invitation')
if (relation) {
this.relation = relation;
this.invitation = relation;
}
this.$u.get('/app/common/type/3').then(res => {
if (res.code == 0) {
this.registerCode = res.data.value
}
});
},
methods: {
isShowAgreeDEghTTorsp() {
//是否选择协议
this.showAgree = !this.showAgree;
},
sendMsgDEghTTorsp() {
const {
mobile
} = this;
if (!mobile) {
uni.showToast({
title: '请输入手机号',
icon: 'none',
duration: 1000
})
} else if (mobile.length !== 11) {
uni.showToast({
title: '请输入正确的手机号',
icon: 'none',
duration: 1000
})
} else {
uni.showLoading({
title: '正在发送验证码...'
})
this.$u.get('/app/Login/sendMsg/' + mobile + '/login').then(res => {
if (res.code === 0) {
this.sending = true;
uni.showToast({
title: '验证码发送成功请注意查收',
icon: 'none',
duration: 1000
})
this.countDown();
uni.hideLoading();
} else {
uni.hideLoading();
uni.showModal({
showCancel: false,
title: '短信发送失败',
content: res.msg ? res.msg : '请一分钟后再获取验证码'
});
}
});
}
},
countDown() {
const {
count
} = this;
if (count === 1) {
this.count = 60;
this.sending = false;
this.sendTime = '获取验证码';
} else {
this.count = count - 1;
this.sending = true;
this.sendTime = count - 1 + '秒后重新获取';
setTimeout(this.countDown.bind(this), 1000);
}
},
inputChangeDEghTTorsp(e) {
const key = e.currentTarget.dataset.key;
this[key] = e.detail.value;
},
toLoginDEghTTorsp() {
uni.reLaunch({
url: '/pages/ghtwwlkXYG/wVghNzmqkQ'
});
},
toRegisterDEghTTorsp() {
const {
mobile,
password,
code,
showAgree,
invitation,
registerCode,
qdCodeion
} = this;
if (!mobile) {
uni.showToast({
title: '请输入账号',
icon: 'none',
duration: 1000
})
return
}
if (!code) {
uni.showToast({
title: '请输入验证码',
icon: 'none',
duration: 1000
})
return
}
if (!password) {
uni.showToast({
title: '请设置密码',
icon: 'none',
duration: 1000
})
return
}
if (password.length < 6) {
uni.showToast({
title: '密码位数必须大于六位',
icon: 'none',
duration: 1000
})
return
}
if (invitation.length === 0 && registerCode === '是') {
uni.showToast({
title: '请输入邀请码',
icon: 'none',
duration: 1000
})
return
}
if (!showAgree) {
uni.showToast({
title: '请先同意《隐私政策》和《用户协议》',
icon: 'none',
duration: 1000
})
return
}
this.logining = true;
uni.showLoading({
title: '注册中...'
})
let platform = ''
// #ifdef APP
platform = 'app'
// #endif
// #ifdef H5
platform = 'h5'
// #endif
this.$u.post('/app/Login/registerCode?password=' + password + '&phone=' + mobile + '&msg=' + code +
'&inviterCode=' + invitation + '&platform=' + platform + '&qdCode=' + qdCodeion).then(res => {
if (res.code === 0) {
// this.$queue.remove('invitation');
uni.setStorageSync('token', res.token)
uni.setStorageSync('userId', res.user.userId)
uni.setStorageSync('phone', res.user.phone)
uni.setStorageSync('invitationCode', res.user.invitationCode)
//设置渠道码
if (res.user.qdCod) {
uni.setStorageSync('qdCod', res.user.qdCod)
}
uni.showToast({
title: '注册成功',
icon: 'none'
})
setTimeout(function() {
uni.switchTab({
url: '/pages/index/index'
});
}, 1000)
// this.getUserInfoDEghTTorsp(res.userId, res.token);
} else {
uni.hideLoading();
uni.showModal({
showCancel: false,
title: '注册失败',
content: res.msg
});
}
});
},
getUserInfoDEghTTorsp(userId, token) {
this.$u.api.userinfo().then(res => {
if (res.code === 0) {
// #ifdef APP-PLUS
if (uni.getSystemInfoSync().platform == "android") {
let clientid = plus.push.getClientInfo().clientid;
this.$Request.postT('/appLogin/updateClientId?clientId=' + clientid + '&userId=' +
userId).then(res => {
});
}
// #endif
uni.setStorageSync('image_url', res.data.imageUrl ? res.data.imageUrl :
'/static/img/common/logo.jpg')
uni.setStorageSync('relation_id', res.data.relationId)
uni.setStorageSync('relation', res.data.invitationCode)
uni.setStorageSync('grade', res.data.grade)
uni.setStorageSync('phone', res.data.phone)
uni.setStorageSync('token', res.token)
uni.setStorageSync('userId', res.data.userId)
uni.setStorageSync('isInvitation', res.data.isInvitation)
uni.setStorageSync('userName', res.data.userName ? res.data.userName : res.data.phone)
// this.$queue.setData('image_url', res.data.imageUrl ? res.data.imageUrl : '/static/img/common/logo.jpg');
// this.$queue.setData('relation_id', res.data.relationId);
// this.$queue.setData('relation', res.data.invitationCode);
// this.$queue.setData('grade', res.data.grade);
// this.$queue.setData('mobile', res.data.mobile);
// this.$queue.setData('isInvitation', res.data.isInvitation);
// this.$queue.setData('nickName', res.data.nickName ? res.data.nickName : res.data.phone);
// this.$queue.setData('gender', parseInt(res.data.gender));
uni.switchTab({
url: '/pages/index/index'
});
} else {
uni.showModal({
showCancel: false,
title: '登录失败',
content: res.msg
});
this.$queue.logout();
}
uni.hideLoading();
})
// this.$Request.postJson('/app/selectUserById?userId=' + userId).then(res => {
// if (res.code === 0) {
// // #ifdef APP-PLUS
// if (uni.getSystemInfoSync().platform == "android") {
// let clientid = plus.push.getClientInfo().clientid;
// this.$Request.postT('/appLogin/updateClientId?clientId=' + clientid + '&userId=' + userId).then(res => {
// });
// }
// // #endif
// this.$queue.setData('image_url', res.data.imageUrl ? res.data.imageUrl : '/static/img/common/logo.jpg');
// this.$queue.setData('relation_id', res.data.relationId);
// this.$queue.setData('relation', res.data.invitationCode);
// this.$queue.setData('grade', res.data.grade);
// this.$queue.setData('mobile', res.data.mobile);
// this.$queue.setData('isInvitation', res.data.isInvitation);
// this.$queue.setData('nickName', res.data.nickName ? res.data.nickName : res.data.phone);
// this.$queue.setData('gender', parseInt(res.data.gender));
// uni.switchTab({
// url: '/pages/index/index'
// });
// } else {
// uni.showModal({
// showCancel: false,
// title: '登录失败',
// content: res.msg
// });
// this.$queue.logout();
// }
// uni.hideLoading();
// });
}
}
};
</script>
<style lang="scss" >
page {
background: #ffffff;
}
.footerViewDEghTTorsp {
display: flex;
justify-content: center;
align-items: center;
font-weight: 400;
font-size: 24rpx;
color: #333333;
position: absolute;
left: 0;
right: 0;
bottom: 78rpx;
.cuIcon::before{
width: 30rpx;
height: 30rpx;
margin-right: 12rpx;
}
.cuIcon-round::before {
content: "\e6d7";
}
.cuIcon-radiobox:before {
content: "\e75b";
color: #37A6FF;
}
}
.send-msgDEghTTorsp {
line-height: initial;
font-weight: 400;
font-size: 28rpx;
color: #EC6F48;
border: none;
background-color: transparent;
}
.send-msgDEghTTorsp::after{
border: none;
background-color: transparent;
}
.containerDEghTTorsp {
position: relative;
width: 100%;
height: 100%;
overflow: hidden;
background: #ffffff;
box-sizing: border-box;
}
.wrapperDEghTTorsp {
min-height: 100vh;
position: relative;
z-index: 90;
}
.input-contentDEghTTorsp {
padding: 0 56rpx;
}
.cu-form-groupDEghTTorsp{
display: flex;
flex-direction: column;
align-items: flex-start;
margin-bottom: 48rpx;
background-color: transparent;
padding: 0;
.title{
margin-bottom: 32rpx;
font-weight: 400;
font-size: 28rpx;
color: #333333;
}
.input{
width: 100%;
height: 84rpx;
line-height: 84rpx;
background-color: #fff;
align-items: center;
padding: 22rpx 32rpx 22rpx 24rpx;
}
}
.confirm-btnDEghTTorsp {
width: 100%;
height: 100rpx;
text-align: center;
line-height: 100rpx;
border-radius: 16rpx;
margin-top: 40rpx;
background: #EC6F48;
font-size: 32rpx;
color: #FFFFFF;
&:after {
border: none;
}
}
</style>

View File

@@ -0,0 +1,437 @@
<template>
<view class="containerDEghTTorsp">
<view class="bg u-absolute" style="width: 100%;height: 100%;overflow: hidden;top: 0;">
<u-image src="../../static/images/i_bg.png" style="width: 100%;height:100%" mode=""></u-image>
</view>
<view class="wrapperDEghTTorsp u-relative" style="padding-top: 48rpx;box-sizing: border-box;">
<view class="input-contentDEghTTorsp">
<view style="font-size: 58rpx;font-weight: bold;color: #333;margin-bottom: 48rpx;">注册</view>
<view class="cu-form-groupDEghTTorsp">
<view class="title">手机号</view>
<input class="input" type="number" :value="mobile" placeholder="请输入手机号" maxlength="11" data-key="mobile"
@input="inputChangeDEghTTorsp" />
</view>
<view class="cu-form-groupDEghTTorsp">
<text class="title">验证码</text>
<view class="input flex">
<input type="number" :value="code" placeholder="请输入验证码" maxlength="6" data-key="code"
@input="inputChangeDEghTTorsp" @confirm="toLoginDEghTTorsp" />
<button class="send-msgDEghTTorsp" @click="sendMsgDEghTTorsp" :disabled="sending">{{ sendTime }}</button>
</view>
</view>
<view class="cu-form-groupDEghTTorsp">
<text class="title">设置密码</text>
<input class="input" type="password" :value="password" placeholder="请设置新密码" placeholder-class="input-empty"
maxlength="20" minlength="6" data-key="password" @input="inputChangeDEghTTorsp" @confirm="toLoginDEghTTorsp" />
</view>
<!-- <view class="cu-form-groupDEghTTorsp"
style="border: 2upx solid whitesmoke;margin-bottom: 20px;border-radius: 30px">
<text class="title">邀请码</text>
<input type="text" v-if="registerCode == '是'" :value="invitation" placeholder="请填写邀请码"
data-key="invitation" maxlength="20" @input="inputChangeDEghTTorsp" @confirm="toLoginDEghTTorsp" />
<input type="text" v-if="registerCode == '否'" :value="invitation" placeholder="请填写邀请码(选填)"
data-key="invitation" maxlength="20" @input="inputChangeDEghTTorsp" @confirm="toLoginDEghTTorsp" />
</view> -->
<button class="confirm-btnDEghTTorsp" @click="toRegisterDEghTTorsp">注册</button>
<button class="confirm-btnDEghTTorsp" @click="toLoginDEghTTorsp">登录</button>
</view>
<view class="footerViewDEghTTorsp">
<text @tap="isShowAgreeDEghTTorsp" class="cuIcon"
:class="showAgree ? 'cuIcon-radiobox' : 'cuIcon-round'">注册即同意</text>
<!-- 协议地址 -->
<navigator url="/me/setting/mimi" open-type="navigate" style="color: #37A6FF;">隐私政策</navigator>
<navigator url="/me/setting/xieyi" open-type="navigate" style="color: #37A6FF;">用户协议</navigator>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
showAgree: false,
code: '',
mobile: '',
password: '',
sending: false,
sendTime: '获取验证码',
count: 60,
relation: "",
invitation: '',
registerCode: '',
qdCodeion: '', //渠道码
};
},
onLoad() {
if (uni.getStorageSync('qdCodeion')) {
this.qdCodeion = uni.getStorageSync('qdCodeion')
}
let relation = uni.getStorageSync('invitation')
if (relation) {
this.relation = relation;
this.invitation = relation;
}
this.$u.get('/app/common/type/3').then(res => {
if (res.code == 0) {
this.registerCode = res.data.value
}
});
},
methods: {
isShowAgreeDEghTTorsp() {
//是否选择协议
this.showAgree = !this.showAgree;
},
sendMsgDEghTTorsp() {
const {
mobile
} = this;
if (!mobile) {
uni.showToast({
title: '请输入手机号',
icon: 'none',
duration: 1000
})
} else if (mobile.length !== 11) {
uni.showToast({
title: '请输入正确的手机号',
icon: 'none',
duration: 1000
})
} else {
uni.showLoading({
title: '正在发送验证码...'
})
this.$u.get('/app/Login/sendMsg/' + mobile + '/login').then(res => {
if (res.code === 0) {
this.sending = true;
uni.showToast({
title: '验证码发送成功请注意查收',
icon: 'none',
duration: 1000
})
this.countDown();
uni.hideLoading();
} else {
uni.hideLoading();
uni.showModal({
showCancel: false,
title: '短信发送失败',
content: res.msg ? res.msg : '请一分钟后再获取验证码'
});
}
});
}
},
countDown() {
const {
count
} = this;
if (count === 1) {
this.count = 60;
this.sending = false;
this.sendTime = '获取验证码';
} else {
this.count = count - 1;
this.sending = true;
this.sendTime = count - 1 + '秒后重新获取';
setTimeout(this.countDown.bind(this), 1000);
}
},
inputChangeDEghTTorsp(e) {
const key = e.currentTarget.dataset.key;
this[key] = e.detail.value;
},
toLoginDEghTTorsp() {
uni.reLaunch({
url: '/pages/ghtwwlkXYG/wVghNzmqkQ'
});
},
toRegisterDEghTTorsp() {
const {
mobile,
password,
code,
showAgree,
invitation,
registerCode,
qdCodeion
} = this;
if (!mobile) {
uni.showToast({
title: '请输入账号',
icon: 'none',
duration: 1000
})
return
}
if (!code) {
uni.showToast({
title: '请输入验证码',
icon: 'none',
duration: 1000
})
return
}
if (!password) {
uni.showToast({
title: '请设置密码',
icon: 'none',
duration: 1000
})
return
}
if (password.length < 6) {
uni.showToast({
title: '密码位数必须大于六位',
icon: 'none',
duration: 1000
})
return
}
if (invitation.length === 0 && registerCode === '是') {
uni.showToast({
title: '请输入邀请码',
icon: 'none',
duration: 1000
})
return
}
if (!showAgree) {
uni.showToast({
title: '请先同意《隐私政策》和《用户协议》',
icon: 'none',
duration: 1000
})
return
}
this.logining = true;
uni.showLoading({
title: '注册中...'
})
let platform = ''
// #ifdef APP
platform = 'app'
// #endif
// #ifdef H5
platform = 'h5'
// #endif
this.$u.post('/app/Login/registerCode?password=' + password + '&phone=' + mobile + '&msg=' + code +
'&inviterCode=' + invitation + '&platform=' + platform + '&qdCode=' + qdCodeion).then(res => {
if (res.code === 0) {
// this.$queue.remove('invitation');
uni.setStorageSync('token', res.token)
uni.setStorageSync('userId', res.user.userId)
uni.setStorageSync('phone', res.user.phone)
uni.setStorageSync('invitationCode', res.user.invitationCode)
//设置渠道码
if (res.user.qdCod) {
uni.setStorageSync('qdCod', res.user.qdCod)
}
uni.showToast({
title: '注册成功',
icon: 'none'
})
setTimeout(function() {
uni.switchTab({
url: '/pages/index/index'
});
}, 1000)
// this.getUserInfoDEghTTorsp(res.userId, res.token);
} else {
uni.hideLoading();
uni.showModal({
showCancel: false,
title: '注册失败',
content: res.msg
});
}
});
},
getUserInfoDEghTTorsp(userId, token) {
this.$u.api.userinfo().then(res => {
if (res.code === 0) {
// #ifdef APP-PLUS
if (uni.getSystemInfoSync().platform == "android") {
let clientid = plus.push.getClientInfo().clientid;
this.$Request.postT('/appLogin/updateClientId?clientId=' + clientid + '&userId=' +
userId).then(res => {
});
}
// #endif
uni.setStorageSync('image_url', res.data.imageUrl ? res.data.imageUrl :
'/static/img/common/logo.jpg')
uni.setStorageSync('relation_id', res.data.relationId)
uni.setStorageSync('relation', res.data.invitationCode)
uni.setStorageSync('grade', res.data.grade)
uni.setStorageSync('phone', res.data.phone)
uni.setStorageSync('token', res.token)
uni.setStorageSync('userId', res.data.userId)
uni.setStorageSync('isInvitation', res.data.isInvitation)
uni.setStorageSync('userName', res.data.userName ? res.data.userName : res.data.phone)
// this.$queue.setData('image_url', res.data.imageUrl ? res.data.imageUrl : '/static/img/common/logo.jpg');
// this.$queue.setData('relation_id', res.data.relationId);
// this.$queue.setData('relation', res.data.invitationCode);
// this.$queue.setData('grade', res.data.grade);
// this.$queue.setData('mobile', res.data.mobile);
// this.$queue.setData('isInvitation', res.data.isInvitation);
// this.$queue.setData('nickName', res.data.nickName ? res.data.nickName : res.data.phone);
// this.$queue.setData('gender', parseInt(res.data.gender));
uni.switchTab({
url: '/pages/index/index'
});
} else {
uni.showModal({
showCancel: false,
title: '登录失败',
content: res.msg
});
this.$queue.logout();
}
uni.hideLoading();
})
// this.$Request.postJson('/app/selectUserById?userId=' + userId).then(res => {
// if (res.code === 0) {
// // #ifdef APP-PLUS
// if (uni.getSystemInfoSync().platform == "android") {
// let clientid = plus.push.getClientInfo().clientid;
// this.$Request.postT('/appLogin/updateClientId?clientId=' + clientid + '&userId=' + userId).then(res => {
// });
// }
// // #endif
// this.$queue.setData('image_url', res.data.imageUrl ? res.data.imageUrl : '/static/img/common/logo.jpg');
// this.$queue.setData('relation_id', res.data.relationId);
// this.$queue.setData('relation', res.data.invitationCode);
// this.$queue.setData('grade', res.data.grade);
// this.$queue.setData('mobile', res.data.mobile);
// this.$queue.setData('isInvitation', res.data.isInvitation);
// this.$queue.setData('nickName', res.data.nickName ? res.data.nickName : res.data.phone);
// this.$queue.setData('gender', parseInt(res.data.gender));
// uni.switchTab({
// url: '/pages/index/index'
// });
// } else {
// uni.showModal({
// showCancel: false,
// title: '登录失败',
// content: res.msg
// });
// this.$queue.logout();
// }
// uni.hideLoading();
// });
}
}
};
</script>
<style lang="scss" >
page {
background: #ffffff;
}
.footerViewDEghTTorsp {
display: flex;
justify-content: center;
align-items: center;
font-weight: 400;
font-size: 24rpx;
color: #333333;
position: absolute;
left: 0;
right: 0;
bottom: 78rpx;
.cuIcon::before{
width: 30rpx;
height: 30rpx;
margin-right: 12rpx;
}
.cuIcon-round::before {
content: "\e6d7";
}
.cuIcon-radiobox:before {
content: "\e75b";
color: #37A6FF;
}
}
.send-msgDEghTTorsp {
line-height: initial;
font-weight: 400;
font-size: 28rpx;
color: #EC6F48;
border: none;
background-color: transparent;
}
.send-msgDEghTTorsp::after{
border: none;
background-color: transparent;
}
.containerDEghTTorsp {
position: relative;
width: 100%;
height: 100%;
overflow: hidden;
background: #ffffff;
box-sizing: border-box;
}
.wrapperDEghTTorsp {
min-height: 100vh;
position: relative;
z-index: 90;
}
.input-contentDEghTTorsp {
padding: 0 56rpx;
}
.cu-form-groupDEghTTorsp{
display: flex;
flex-direction: column;
align-items: flex-start;
margin-bottom: 48rpx;
background-color: transparent;
padding: 0;
.title{
margin-bottom: 32rpx;
font-weight: 400;
font-size: 28rpx;
color: #333333;
}
.input{
width: 100%;
height: 84rpx;
line-height: 84rpx;
background-color: #fff;
align-items: center;
padding: 22rpx 32rpx 22rpx 24rpx;
}
}
.confirm-btnDEghTTorsp {
width: 100%;
height: 100rpx;
text-align: center;
line-height: 100rpx;
border-radius: 16rpx;
margin-top: 40rpx;
background: #EC6F48;
font-size: 32rpx;
color: #FFFFFF;
&:after {
border: none;
}
}
</style>

View File

@@ -0,0 +1,217 @@
<template>
<view class="containersViewDEghTTorsp">
<div style="width: 100%;height: 85%;position: absolute;background: url('../../static/images/appeq_bg.png') no-repeat center bottom / cover;"></div>
<view style="text-align: center;position: relative;height: 100%;display: flex;flex-direction: column;align-items: center;justify-content: center;">
<image style="width: 124rpx;height: 124rpx;margin-top: -920rpx;border-radius:20upx;" src="../../static/images/appLogo.png"></image>
<view style="font-size: 40rpx;margin-top: 22rpx;color: #FFFFFF;font-weight: bold;">斯耀短剧APP{{isWeixin}}</view>
<view style="font-size: 28rpx;margin-top: 16rpx;color: #FFFFFF;font-weight: bold;">海量电子榨菜 免费又过瘾</view>
<button class="confirm-btnDEghTTorsp" @click="taobaoLoginDEghTTorsp">{{confirmBtn}}</button>
</view>
<view id="shareitDEghTTorsp" v-if="show_share" @tap="closeShareDEghTTorsp">
<image class="arrowDEghTTorsp" src="https://renwu.xiansqx.com/img/20210813/9aa484db4c60458f86deb2a8ab6fe400.png">
</image>
<view id="followDEghTTorsp">点击右上角按钮选择浏览器打开下载</view>
</view>
<!-- #ifdef H5 -->
<div v-if="isWeixin" style="width: 100%;height: 100%;position: absolute;top: 0;background: url('../../static/images/open_guide.png') no-repeat center bottom / cover;"></div>
<!-- #endif -->
</view>
</template>
<script>
export default {
data() {
return {
mobile: '',
code: '',
message: '',
show_share: false,
openShare: false,
openShares: false,
relationId: '',
sending: false,
confirmBtn: '斯耀短剧APP',
isWeixin: false,
};
},
onLoad(e) {
let u = navigator.userAgent;
if ( u.indexOf('iPhone') > -1) {
// #ifdef H5
this.confirmBtn = "跳转网页版首页"
// #endif
}
if ( u.toLowerCase().indexOf('micromessenger') !== -1) {
this.isWeixin = true
}
},
methods: {
closeShareDEghTTorsp() {
this.show_share = false;
},
taobaoLoginDEghTTorsp() {
var u = navigator.userAgent;
if (u.indexOf('Android') > -1 || u.indexOf('Adr') > -1) {
this.$Request.get('/app/common/type/49').then(res => {
if (res.code === 0) {
if (res.data && res.data.value) {
if (this.openShare) {
let ua = navigator.userAgent.toLowerCase();
if (ua.indexOf('micromessenger') === -1) {
this.show_share = false;
// #ifndef H5
plus.runtime.openURL(res.data.value, function(res) {
});
// #endif
// #ifdef H5
window.location.href = res.data.value;
// #endif
} else {
this.show_share = true;
}
} else {
// #ifndef H5
plus.runtime.openURL(res.data.value, function(res) {
});
// #endif
// #ifdef H5
uni.setClipboardData({
data: res.data.value,
success: r => {
// this.$queue.showToast('邀请码复制成功');
}
});
window.location.href = res.data.value;
// #endif
}
}
}
});
} else {
this.$Request.get('/app/common/type/50').then(res => {
if (res.code === 0) {
if (res.data && res.data.value) {
if (this.openShares) {
let ua = navigator.userAgent.toLowerCase();
if (ua.indexOf('micromessenger') === -1) {
this.show_share = false;
// #ifndef H5
plus.runtime.openURL(res.data.value, function(res) {
});
// #endif
// #ifdef H5
window.location.href = res.data.value;
// uni.switchTab({
// url: 'pages/index/index'
// })
// #endif
} else {
this.show_share = true;
}
} else {
// #ifndef H5
plus.runtime.openURL(res.data.value, function(res) {
});
// #endif
// #ifdef H5
uni.setClipboardData({
data: res.data.value,
success: r => {
// this.$queue.showToast('邀请码复制成功');
}
});
uni.switchTab({
url: '/pages/index/index'
})
// window.location.href = res.data.value;
// #endif
}
}
}
});
}
}
}
};
</script>
<style lang="scss" scoped>
uni-page-body{
width: 100%;
height: 100%;
}
.containersViewDEghTTorsp {
width: 100%;
height: 100%;
}
#shareitDEghTTorsp {
-webkit-user-select: none;
position: fixed;
/*width: 100%;*/
height: 2000px;
background: rgba(0, 0, 0, 0.85);
text-align: center;
top: 0;
left: 0;
z-index: 999;
}
#shareitDEghTTorsp img {
max-width: 100%;
}
.arrowDEghTTorsp {
width: 100px;
height: 150px;
position: absolute;
right: 5%;
top: 1%;
}
#followDEghTTorsp {
margin-right: 60px;
margin-left: 30px;
width: 90%;
height: 50px;
line-height: 50px;
text-align: left;
text-decoration: none;
font-size: 18px;
color: white;
float: left;
margin-top: 160px;
}
page {
background: #fff;
}
.confirm-btnDEghTTorsp {
width: 416rpx;
height: 90rpx;
line-height: 90rpx;
background: #FD5775;
color: #fff;
font-size: 32rpx;
font-weight: bold;
font-size: 32rpx;
color: #FFFFFF;
position: absolute;
left: 0;
right: 0;
bottom: 70rpx;
}
</style>

View File

@@ -0,0 +1,326 @@
<template>
<view class="containerDEghTTorsp">
<view class="wrapperDEghTTorsp">
<view class="input-contentDEghTTorsp">
<view class="cu-form-group" style="border-bottom: 2upx solid whitesmoke;margin-bottom: 20px;">
<view class="title text-black">手机号</view>
<input type="number" :value="phone" placeholder="请输入手机号" maxlength="11" data-key="phone"
@input="inputChange" />
</view>
<view class="cu-form-group padding-right-xs"
style="border-bottom: 2upx solid whitesmoke;margin-bottom: 20px;">
<text class="title text-black">验证码</text>
<input type="number" :value="code" placeholder="请输入验证码" maxlength="6" data-key="code"
@input="inputChange" @confirm="startReg" />
<button class="send-msgDEghTTorsp" @click="sendMsg" :disabled="sending">{{ sendTime }}</button>
</view>
<view class="cu-form-group" style="border-bottom: 2upx solid whitesmoke;margin-bottom: 20px;">
<text class="title text-black">设置密码</text>
<input type="password" :value="password" placeholder="请设置密码" placeholder-class="input-empty"
maxlength="20" minlength="6" data-key="password" @input="inputChange" @confirm="startReg" />
</view>
<!-- <view class="cu-form-group" style="border-bottom: 2upx solid whitesmoke;margin-bottom: 20px;"
v-if="required == '是'">
<text class="title text-black">邀请码</text>
<input type="" maxlength="6" :value="invitation" placeholder="请填写邀请码(必填)" data-key="invitation"
@input="inputChange" @confirm="startReg" />
</view>
<view class="cu-form-group" style="border-bottom: 2upx solid whitesmoke;margin-bottom: 20px;"
v-if="required == '否'">
<text class="title text-black">邀请码</text>
<input type="" maxlength="6" :value="invitation" placeholder="请填写邀请码(选填)" data-key="invitation"
@input="inputChange" @confirm="startReg" />
</view> -->
</view>
<button class="confirm-btnDEghTTorsp" @click="startReg">立即注册</button>
<view class="footerDEghTTorsp">
<text @tap="isShowAgree" class="cuIcon"
:class="showAgree ? 'cuIcon-radiobox' : 'cuIcon-round'">同意</text>
<!-- 协议地址 -->
<navigator url="/me/setting/mimi" open-type="navigate">隐私政策</navigator>
<navigator url="/me/setting/xieyi" open-type="navigate">用户服务协议</navigator>
</view>
</view>
</view>
</template>
<script>
var _this;
export default {
data() {
return {
userName: '',
showAgree: false,
code: '',
phone: '',
password: '',
required: '否',
sending: false,
sendTime: '获取验证码',
count: 60,
relation: "",
state: '',
invitation: '',
platform: 'app',
sysPhone: 1
}
},
onLoad() {
let a = this.$queue.getData("isEnable")
if (a) {
this.isEnable = a;
}
// #ifdef APP-PLUS
switch (uni.getSystemInfoSync().platform) {
case 'android':
break;
case 'ios':
this.sysPhone = 2;
break;
default:
break;
}
// #endif
},
mounted() {
_this = this;
},
methods: {
showMa() {
//查询官方邀请码
this.$Request.getT('/app/common/type/4').then(res => {
if (res.code == 0) {
this.invitationCode = res.data.value;
}
});
},
// 注册邀请码必填
invitationMa() {
this.$Request.getT('/app/common/type/3').then(res => {
if (res.code == 0) {
this.required = res.data.value;
}
});
},
inputChange(e) {
const key = e.currentTarget.dataset.key;
this[key] = e.detail.value;
},
navBack() {
uni.navigateBack();
},
countDown() {
const {
count
} = this;
if (count === 1) {
this.count = 60;
this.sending = false;
this.sendTime = '获取验证码';
} else {
this.count = count - 1;
this.sending = true;
this.sendTime = count - 1 + '秒后重新获取';
setTimeout(this.countDown.bind(this), 1000);
}
},
sendMsg() {
const {
phone
} = this;
if (!phone) {
this.$queue.showToast("请输入手机号");
} else if (phone.length !== 11) {
this.$queue.showToast("请输入正确的手机号");
} else {
this.$queue.showLoading("正在发送验证码...");
this.$Request.getT("/app/Login/sendMsg/" + phone + "/bindIos").then(res => {
if (res.code === 0) {
this.sending = true;
this.$queue.showToast('验证码发送成功请注意查收');
this.countDown();
uni.hideLoading();
} else {
console.log(JSON.stringify(res))
uni.hideLoading();
uni.showModal({
showCancel: false,
title: '短信发送失败',
content: res.msg ? res.msg : '请一分钟后再获取验证码',
});
}
});
}
},
isShowAgree() {
//是否选择协议
_this.showAgree = !_this.showAgree;
},
startReg() {
if (this.phone.length != 11) {
uni.showToast({
icon: 'none',
position: 'bottom',
title: '手机号不正确'
});
return false;
}
if (this.code.length != 6) {
uni.showToast({
icon: 'none',
position: 'bottom',
title: '验证码不正确'
});
return false;
}
if (!this.password) {
this.$queue.showToast('请设置密码');
return false;
}
if (this.password.length < 6) {
this.$queue.showToast('密码位数必须大于六位');
return false;
}
if (!_this.invitation && this.required == '是') {
this.$queue.showToast('请填写邀请码');
return false;
}
this.$queue.showLoading('登陆中...')
_this.isRotate = true;
console.error(_this.$queue.getData('appleId'))
let qdCodeion = '';
if (uni.getStorageSync('qdCodeion')) {
qdCodeion = uni.getStorageSync('qdCodeion')
}
this.$Request.postT("/app/Login/iosBindMobile", {
password: _this.password,
phone: _this.phone,
code: _this.code,
inviterCode: _this.invitation,
qdCode: qdCodeion,
platform: 'app',
sysPhone: _this.sysPhone,
appleId: _this.$queue.getData("appleId")
}).then(res => {
console.log(JSON.stringify(res))
if (res.code === 0) {
this.$queue.setData("mobile", _this.phone);
this.$queue.setData("token", res.token);
this.$queue.setData("userId", res.user.userId);
uni.switchTab({
url: '/pages/index/index'
})
} else {
_this.isRotate = false;
uni.hideLoading();
uni.showModal({
showCancel: false,
title: '绑定失败',
content: res.msg,
});
}
});
},
getUserInfo(userId, token) {
this.$Request.get("/app/user/selectUserById").then(res => {
if (res.code == 0) {
uni.setStorageSync('token', token)
uni.setStorageSync('userId', res.data.userId)
uni.setStorageSync('avatar', res.data.avatar)
uni.setStorageSync('invitationCode', res.data.invitationCode)
uni.setStorageSync('zhiFuBao', res.data.zhiFuBao)
uni.setStorageSync('zhiFuBaoName', res.data.zhiFuBaoName)
this.$Request.get("/app/UserVip/isUserVip").then(res => {
if (res.code == 0 && res.data && res.data.isVip == 2) {
uni.setStorageSync('isVIP', true)
} else {
uni.setStorageSync('isVIP', false)
}
});
uni.switchTab({
url: '/pages/index/index'
});
} else {
uni.showModal({
showCancel: false,
title: '登录失败',
content: res.msg
});
this.$queue.logout();
}
uni.hideLoading();
});
}
}
}
</script>
<style lang='scss'>
page {
height: 100%;
background: #FFFFFF !important;
}
.footerDEghTTorsp {
padding-left: 140upx;
margin-top: 32upx;
text-align: center;
display: flex;
color: #333;
}
.send-msgDEghTTorsp {
border-radius: 30px;
color: white;
height: 30px;
font-size: 10px;
line-height: 30px;
background: #5E81F9;
}
.containerDEghTTorsp {
padding-top: 32upx;
position: relative;
width: 100%;
height: 100%;
overflow: hidden;
}
.wrapperDEghTTorsp {
position: relative;
z-index: 90;
background: #FFFFFF;
padding-bottom: 20px;
}
.input-contentDEghTTorsp {
padding: 32upx 80upx;
}
.confirm-btnDEghTTorsp {
width: 600upx;
height: 80upx;
line-height: 80upx;
border-radius: 60upx;
margin-top: 32upx;
background: #5E81F9;
color: #fff;
font-size: 32upx;
&:after {
border-radius: 60px;
}
}
</style>

View File

@@ -0,0 +1,186 @@
<template>
<view class="register">
<view class="wrapperDEghTTorsp">
<view class="input-contentDEghTTorsp">
<view class="cu-form-group" style="border-bottom: 2upx solid whitesmoke;margin-bottom: 20px;">
<view class="title">手机号</view>
<input type="number" :disabled="true" :value="phone" placeholder="请输入手机号" maxlength="11" data-key="phone" @input="inputChangeDEghTTorsp" />
</view>
<view class="cu-form-group" style="border-bottom: 2upx solid whitesmoke;margin-bottom: 20px;">
<text class="title">设置密码</text>
<input type="password" :value="password" placeholder="请设置密码" placeholder-class="input-empty" maxlength="20"
minlength="6" data-key="password" @input="inputChangeDEghTTorsp" />
</view>
<!-- <view class="cu-form-group" style="border-bottom: 2upx solid whitesmoke;margin-bottom: 20px;" v-if="required == '是'">
<text class="title">邀请码</text>
<input type="number" maxlength="6" :value="invitation" placeholder="请填写邀请码(必填)" data-key="invitation" @input="inputChangeDEghTTorsp" />
</view>
<view class="cu-form-group" style="border-bottom: 2upx solid whitesmoke;margin-bottom: 20px;" v-if="required == '否'">
<text class="title">邀请码</text>
<input type="number" maxlength="6" :value="invitation" placeholder="请填写邀请码(选填)" data-key="invitation" @input="inputChangeDEghTTorsp" />
</view> -->
</view>
<button class="confirm-btnDEghTTorsp" @click="startRegDEghTTorsp">绑定手机号</button>
</view>
</view>
</template>
<script>
var _this;
export default {
data() {
return {
userName: '',
showAgree: false,
code: '',
phone: '',
password: '',
required: '否',
sending: false,
sendTime: '获取验证码',
count: 60,
relation: "",
state: '',
invitation: '',
platform: 'app',
sysPhone:1
}
},
onLoad(d) {
console.log(d.phone)
if(d.phone){
this.phone = d.phone;
}
this.invitationMaDEghTTorsp();
let a = this.$queue.getData("isEnable")
if (a) {
this.isEnable = a;
}
// #ifdef APP-PLUS
switch (uni.getSystemInfoSync().platform) {
case 'android':
break;
case 'ios':
this.sysPhone = 2;
break;
default:
break;
}
// #endif
},
mounted() {
_this = this;
},
methods: {
// 注册邀请码必填
invitationMaDEghTTorsp() {
this.$Request.getT('/app/common/type/3').then(res => {
if (res.code == 0) {
this.required = res.data.value;
}
});
},
inputChangeDEghTTorsp(e) {
const key = e.currentTarget.dataset.key;
this[key] = e.detail.value;
},
startRegDEghTTorsp() {
if (this.phone.length != 11) {
uni.showToast({
icon: 'none',
position: 'bottom',
title: '手机号不正确'
});
return false;
}
if (!this.password) {
this.$queue.showToast('请设置密码');
return false;
}
if (this.password.length < 6) {
this.$queue.showToast('密码位数必须大于六位');
return false;
}
if (!_this.invitation && this.required == '是') {
this.$queue.showToast('请填写邀请码');
return false;
}
this.$queue.showLoading('登陆中...')
_this.isRotate = true;
let qdCodeion = '';
if (uni.getStorageSync('qdCodeion')) {
qdCodeion = uni.getStorageSync('qdCodeion')
}
this.$Request.postT("/app/Login/bindMobile", {
password: _this.password,
phone: _this.phone,
inviterCode: _this.invitation,
qdCode: qdCodeion,
sysPhone:_this.sysPhone
}).then(res => {
console.log(JSON.stringify(res))
if (res.code === 0) {
this.$queue.setData("mobile", _this.phone);
this.$queue.setData("token", res.token);
this.$queue.setData("userId", res.user.userId);
uni.switchTab({
url: '/pages/index/index'
})
} else {
_this.isRotate = false;
uni.hideLoading();
uni.showModal({
showCancel: false,
title: '绑定失败',
content: res.msg,
});
}
});
},
}
}
</script>
<style lang='scss'>
page {
background: #ffffff;
}
.wrapperDEghTTorsp {
position: relative;
z-index: 90;
background: #ffffff;
padding-bottom: 20px;
}
.input-contentDEghTTorsp {
padding: 0 20px;
}
.confirm-btnDEghTTorsp {
width: 300px;
height: 42px;
line-height: 42px;
border-radius: 30px;
margin-top: 40px;
background: #5074FF;
color: #ffffff;
font-size: 32rpx;
&:after {
border-radius: 60px;
}
}
</style>

View File

@@ -0,0 +1,491 @@
<template>
<view class="containerDEghTTorsp">
<!-- 小程序状态下登录 -->
<!-- #ifdef MP-WEIXIN -->
<view class="mp_wxBoxDEghTTorsp">
<view>
<view class="headersDEghTTorsp">
<image src="../../static/images/logo.png" style="border-radius: 50%;"></image>
</view>
<view class="content">
<view>申请获取以下权限</view>
<text>获得你的公开信息(昵称头像地区等)</text>
</view>
<button v-show="weixinPhone" style="background: #ff7581;color: #FFFFFF;" class="bottom"
open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">
授权手机号
</button>
<button v-show="!weixinPhone" style="background: #ff7581;color: #FFFFFF;" class='bottom'
bindtap="getUserProfile" @tap="wxGetUserInfoDEghTTorsp">
授权登录
</button>
</view>
</view>
<!-- #endif -->
<!-- #ifndef MP-WEIXIN -->
<view class="wrapperDEghTTorsp">
<view class="input-contentDEghTTorsp">
<view class="cu-form-group"
style="border: 2upx solid whitesmoke;margin-bottom: 20px;border-radius: 30px">
<view class="title">手机号</view>
<input type="number" :value="mobile" placeholder="请输入手机号" maxlength="11" data-key="mobile"
@input="inputChangeDEghTTorsp" />
</view>
<view class="cu-form-group" style="border: 2upx solid whitesmoke;border-radius: 30px">
<view class="title">
<text style="margin-left: 30rpx;"></text>
</view>
<input type="password" placeholder="请输入密码" maxlength="20" :value="code" data-key="code"
@input="inputChangeDEghTTorsp" @confirm="toLoginDEghTTorsp" />
<text class="send-msgDEghTTorsp" @click="forgetDEghTTorsp">忘记密码</text>
</view>
</view>
<button class="confirm-btnDEghTTorsp" @click="toLoginDEghTTorsp">登录</button>
<view style="margin-top: 32px;text-align: center">
<view>
没有账号
<text style="color: #ff7581" @click="registerDEghTTorsp()">立即注册</text>
</view>
</view>
</view>
<!-- #endif -->
<!-- #ifdef MP -->
<view class="footerDEghTTorsp">
<u-checkbox-group>
<u-checkbox v-model="checked" label-size='24upx' shape="circle" @change="radioChangeDEghTTorsp"></u-checkbox>
</u-checkbox-group>
<view>同意</view>
<!-- 协议地址 -->
<navigator url="/me/setting/mimi" open-type="navigate">隐私政策</navigator>
<navigator url="/me/setting/xieyi" open-type="navigate">用户服务协议</navigator>
</view>
<!-- #endif -->
</view>
</template>
<script>
export default {
data() {
return {
mobile: '',
code: '',
sessionkey: '',
flag: '1',
weixinPhone: false,
sending: false,
sendDataList: {},
phone: '',
sendTime: '获取验证码',
count: 60,
checked: false
};
},
methods: {
// 注册
registerDEghTTorsp() {
uni.navigateTo({
url: '/pages/ghtwwlkXYG/WVEtZeeghK'
});
},
// 忘记密码
forgetDEghTTorsp() {
uni.navigateTo({
url: '/pages/ghtwwlkXYG/EAkIghCGJS'
});
},
inputChangeDEghTTorsp(e) {
const key = e.currentTarget.dataset.key;
this[key] = e.detail.value;
},
radioChangeDEghTTorsp(e) {
console.log(e);
},
//第一授权获取用户信息===》按钮触发
wxGetUserInfoDEghTTorsp(e) {
let that = this;
if (this.checked) {
wx.getUserProfile({
desc: '业务需要',
success: infoRes => {
console.log("infoRes.encryptedData__________:" + JSON.stringify(infoRes.userInfo))
let nickName = infoRes.userInfo.nickName; //昵称
let avatarUrl = infoRes.userInfo.avatarUrl; //头像
let sex = infoRes.userInfo.gender; //头像
try {
that.loginDEghTTorsp(nickName, avatarUrl, sex);
} catch (e) {}
}
})
} else {
uni.showToast({
title: '请同意隐私政策和用户服务协议',
icon: 'none'
})
}
},
//登录
loginDEghTTorsp(nickName, avatarUrl, sex) {
let that = this;
// 1.wx获取登录用户code
uni.login({
provider: 'weixin',
success: function(loginRes) {
let data = {
code: loginRes.code
}
that.$u.api.wxLogin(data).then(res => {
if (res.code == 0 && res.data) {
uni.setStorageSync('openId', res.data.open_id)
uni.setStorageSync('unionId', res.data.unionId)
that.sessionkey = res.data.session_key;
let invitationCode = '';
if (uni.getStorageSync('invitation')) {
invitationCode = uni.getStorageSync('invitation')
}
let sendData = {
openId: uni.getStorageSync('openId'),
unionId: uni.getStorageSync('unionId'),
userName: nickName,
avatar: avatarUrl,
sex: sex, //性别
inviterCode: invitationCode //别人登录进来携带你的邀请码
};
that.sendDataList = sendData;
that.flag = res.data.flag;
if (that.flag == '1') {
that.weixinPhone = true;
} else {
that.getWeixinInfoDEghTTorsp(sendData);
}
} else {
uni.showToast({
icon: 'none',
title: res.msg,
duration: 2000
});
}
})
}
});
},
//小程序微信登录后获取手机号
getPhoneNumber: function(e) {
if (e.detail.errMsg == 'getPhoneNumber:fail user deny') {
console.log('用户拒绝提供手机号');
} else {
console.log('用户同意提供手机号');
this.setPhoneByInsertDEghTTorsp(e.detail.encryptedData, e.detail.iv);
}
},
//小程序微信登录后获取手机号
setPhoneByInsertDEghTTorsp(decryptData, iv) {
let data = {
decryptData: decryptData,
key: this.sessionkey,
iv: iv
};
this.$u.api.selectPhone(data).then(res => {
if (res.code == 0) {
this.phone = res.data.phoneNumber;
this.getWeixinInfoDEghTTorsp(this.sendDataList);
} else {
uni.showToast({
title: res.msg,
duration: 2000
});
}
})
},
countDown() {
const {
count
} = this;
if (count === 1) {
this.count = 60;
this.sending = false;
this.sendTime = '获取验证码'
} else {
this.count = count - 1;
this.sending = true;
this.sendTime = count - 1 + '秒后重新获取';
setTimeout(this.countDown.bind(this), 1000);
}
},
sendMsg() {
const {
mobile
} = this;
console.log(mobile)
if (!mobile) {
uni.showToast({
title: '请输入手机号',
icon: 'none',
duration: 1000
})
} else if (mobile.length !== 11) {
uni.showToast({
title: '请输入正确的手机号',
icon: 'none',
duration: 1000
})
} else {
uni.showLoading({
title: '正在发送验证码...'
})
this.$u.get('/app/Login/sendMsg/' + mobile + '/login').then(res => {
// this.$Request.getT('/appLogin/sendMsg/' + mobile + '/bind').then(res => {
if (res.code === 0) {
this.sending = true;
uni.showToast({
title: '验证码发送成功请注意查收',
icon: 'none',
duration: 1000
})
this.countDown();
uni.hideLoading();
} else {
uni.hideLoading();
uni.showModal({
showCancel: false,
title: '短信发送失败',
content: res.msg ? res.msg : '请一分钟后再获取验证码'
});
}
});
}
},
toLoginDEghTTorsp() {
// this.$queue.loginClear();
// let openid = this.$queue.getData('openid');
let openid = uni.getStorageSync('openId')
const {
mobile,
code
} = this;
if (!mobile) {
// this.$queue.showToast('请输入手机号');
uni.showToast({
title: '请输入手机号',
icon: 'none',
duration: 1000
})
} else if (mobile.length != 11) {
// this.$queue.showToast('请输入手机号');
uni.showToast({
title: '请输入正确的手机号',
icon: 'none',
duration: 1000
})
} else if (!code) {
// this.$queue.showToast('请输入密码');
uni.showToast({
title: '请输入密码',
icon: 'none',
duration: 1000
})
} else {
uni.showLoading({
title: '正在登录中...',
})
this.$u.post('/app/Login/registerCode?password=' + code + '&phone=' + mobile).then(res => {
if (res.code === 0) {
uni.setStorageSync('token', res.token)
uni.setStorageSync('userId', res.user.userId)
uni.setStorageSync('userName', res.user.userName)
uni.setStorageSync('avatar', res.user.avatar ? res.user.avatar :
'../../static/images/logo.png')
uni.setStorageSync('phone', res.user.phone)
uni.setStorageSync('invitationCode', res.user.invitationCode)
uni.setStorageSync('sex', res.user.sex)
uni.setStorageSync('userId', res.user.userId)
//设置渠道码
if (res.user.qdCode) {
uni.setStorageSync('qdCode', res.user.qdCode)
}
// uni.setStorageSync('openId', res.user.openId)
// this.getWeixinInfoDEghTTorsp(this.sendDataList);
uni.showToast({
title: '登录成功',
icon: 'none'
})
uni.navigateBack({
delta: 2
})
} else {
uni.hideLoading();
uni.showToast({
title: res.msg,
icon: 'none',
duration: 1000
})
}
});
}
},
//获取个人信息
getWeixinInfoDEghTTorsp(sendData) {
let that = this;
uni.showLoading({
title: '登录中...'
});
let postData = {
openId: sendData.openId, //小程序openId
unionId: sendData.unionId, //unionId
userName: sendData.userName, //微信名称
avatar: sendData.avatar, //头像
sex: sendData.sex, //性别
phone: that.phone,
inviterCode: sendData.inviterCode
};
that.$u.api.insertWxUser(postData).then(res => {
uni.hideLoading();
if (res.code == 0) {
uni.setStorageSync('token', res.token)
uni.setStorageSync('userName', res.user.userName)
uni.setStorageSync('avatar', res.user.avatar)
uni.setStorageSync('phone', res.user.phone)
uni.setStorageSync('invitationCode', res.user.invitationCode)
uni.setStorageSync('sex', res.user.sex)
uni.setStorageSync('userId', res.user.userId)
uni.setStorageSync('openId', res.user.openId)
let data = {
userId: uni.getStorageSync('userId')
}
that.$u.api.userVip(data).then(res => {
if (res.code == 0 && res.data && res.data.isVip == 2) {
uni.setStorageSync('isVIP', true)
} else {
uni.setStorageSync('isVIP', false)
}
})
uni.navigateBack();
} else {
uni.showModal({
showCancel: false,
title: '登录失败',
content: res.msg,
});
}
})
},
}
};
</script>
<style lang="scss">
.headersDEghTTorsp {
text-align: center;
}
.headersDEghTTorsp>image {
width: 400upx;
height: 400upx;
}
.footerDEghTTorsp {
padding-left: 150rpx;
margin-top: 32upx;
font-size: 24upx;
color: #666666;
text-align: center;
display: flex;
}
page {
background: #ffffff;
}
.send-msgDEghTTorsp {
border-radius: 30px;
color: black;
background: white;
height: 30px;
font-size: 14px;
line-height: 30px;
}
.containerDEghTTorsp {
top: 0;
padding-top: 32upx;
position: relative;
width: 100%;
height: 100%;
overflow: hidden;
background: #ffffff;
.mp_wxBoxDEghTTorsp {
.headersDEghTTorsp {
margin: 35% auto 50rpx;
text-align: center;
border-radius: 60rpx;
width: 650rpx;
height: 300rpx;
line-height: 450rpx;
image {
width: 300rpx;
height: 300rpx;
}
}
.content {
text-align: center;
}
text {
display: block;
color: #9d9d9d;
margin-top: 40rpx;
}
.bottom {
line-height: 80upx;
border-radius: 80upx;
margin: 70rpx 50rpx;
height: 80upx;
font-size: 35rpx;
}
}
}
.wrapperDEghTTorsp {
position: relative;
z-index: 90;
background: #ffffff;
padding-bottom: 20px;
}
.input-contentDEghTTorsp {
padding: 0 20px;
}
.confirm-btnDEghTTorsp {
width: 300px;
height: 42px;
line-height: 42px;
border-radius: 30px;
margin-top: 40px;
// background: linear-gradient(to left, #3f5ecb 0, #5074FF 100%);
background: #ff7581;
color: #ffffff;
// font-size: $font-lg;
&:after {
border-radius: 60px;
}
}
</style>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,446 @@
<template>
<view class="containerDEghTTorsp">
<view class="wrapperDEghTTorsp">
<view class="input-contentDEghTTorsp">
<view class="cu-form-group"
style="border: 2upx solid whitesmoke;margin-bottom: 20px;border-radius: 30px">
<view class="title">手机号</view>
<input type="number" :value="mobile" placeholder="请输入手机号" maxlength="11" data-key="mobile"
@input="inputChangeDEghTTorsp" />
</view>
<view class="cu-form-group" style="border: 2upx solid whitesmoke;border-radius: 30px">
<view class="title">
<text style="margin-left: 30rpx;"></text>
</view>
<input type="password" placeholder="请输入密码" maxlength="20" :value="code" data-key="code"
@input="inputChangeDEghTTorsp" @confirm="toLoginDEghTTorsp" />
<text class="send-msg" @click="forgetDEghTTorsp">忘记密码</text>
</view>
</view>
<button class="confirm-btnDEghTTorsp" @click="toLoginDEghTTorsp">登录</button>
<view style="margin-top: 32px;text-align: center">
<view>
没有账号
<text style="color: #ff7581" @click="registerDEghTTorsp()">立即注册</text>
</view>
</view>
</view>
<view class="footerDEghTTorsp">
<u-checkbox-group>
<u-checkbox v-model="checked" label-size='24upx' shape="circle" @change="radioChangeDEghTTorsp"></u-checkbox>
</u-checkbox-group>
<view>同意</view>
<!-- 协议地址 -->
<navigator url="/me/setting/mimi" open-type="navigate">隐私政策</navigator>
<navigator url="/me/setting/xieyi" open-type="navigate">用户服务协议</navigator>
</view>
<u-toast ref="uToast" />
</view>
</template>
<script>
export default {
data() {
return {
mobile: '',
code: '',
sessionkey: '',
flag: '1',
weixinPhone: false,
sending: false,
sendDataList: {},
phone: '',
sendTime: '获取验证码',
count: 60,
checked: false
};
},
onLoad() {
if (uni.getStorageSync('isSafeView')) {
uni.showModal({
title: '提示',
content: '您正在使用无痕浏览,可能导致登录状态失效,建议切换浏览模式',
})
uni.setStorageSync("isSafeView", null)
}
},
methods: {
// 注册
registerDEghTTorsp() {
uni.navigateTo({
url: '/pages/ghtwwlkXYG/WVEtZeeghK'
});
},
// 忘记密码
forgetDEghTTorsp() {
uni.navigateTo({
url: '/pages/ghtwwlkXYG/EAkIghCGJS'
});
},
inputChangeDEghTTorsp(e) {
const key = e.currentTarget.dataset.key;
this[key] = e.detail.value;
},
radioChangeDEghTTorsp(e) {
console.log(e);
},
//第一授权获取用户信息===》按钮触发
wxGetUserInfoDEghTTorsp(e) {
let that = this;
if (this.checked) {
wx.getUserProfile({
desc: '业务需要',
success: infoRes => {
console.log("infoRes.encryptedData__________:" + JSON.stringify(infoRes.userInfo))
let nickName = infoRes.userInfo.nickName; //昵称
let avatarUrl = infoRes.userInfo.avatarUrl; //头像
let sex = infoRes.userInfo.gender; //头像
try {
that.loginDEghTTorsp(nickName, avatarUrl, sex);
} catch (e) {}
}
})
} else {
uni.showToast({
title: '请同意隐私政策和用户服务协议',
icon: 'none'
})
}
},
//登录
loginDEghTTorsp(nickName, avatarUrl, sex) {
let that = this;
// 1.wx获取登录用户code
uni.login({
provider: 'weixin',
success: function(loginRes) {
let data = {
code: loginRes.code
}
that.$u.api.wxLogin(data).then(res => {
if (res.code == 0 && res.data) {
uni.setStorageSync('openId', res.data.open_id)
uni.setStorageSync('unionId', res.data.unionId)
that.sessionkey = res.data.session_key;
let invitationCode = '';
if (uni.getStorageSync('invitation')) {
invitationCode = uni.getStorageSync('invitation')
}
let sendData = {
openId: uni.getStorageSync('openId'),
unionId: uni.getStorageSync('unionId'),
userName: nickName,
avatar: avatarUrl,
sex: sex, //性别
inviterCode: invitationCode //别人登录进来携带你的邀请码
};
that.sendDataList = sendData;
that.flag = res.data.flag;
if (that.flag == '1') {
that.weixinPhone = true;
} else {
that.getWeixinInfoDEghTTorsp(sendData);
}
} else {
uni.showToast({
icon: 'none',
title: res.msg,
duration: 2000
});
}
})
}
});
},
//小程序微信登录后获取手机号
getPhoneNumber: function(e) {
if (e.detail.errMsg == 'getPhoneNumber:fail user deny') {
console.log('用户拒绝提供手机号');
} else {
console.log('用户同意提供手机号');
this.setPhoneByInsertDEghTTorsp(e.detail.encryptedData, e.detail.iv);
}
},
//小程序微信登录后获取手机号
setPhoneByInsertDEghTTorsp(decryptData, iv) {
let data = {
decryptData: decryptData,
key: this.sessionkey,
iv: iv
};
this.$u.api.selectPhone(data).then(res => {
if (res.code == 0) {
this.phone = res.data.phoneNumber;
this.getWeixinInfoDEghTTorsp(this.sendDataList);
} else {
uni.showToast({
title: res.msg,
duration: 2000
});
}
})
},
countDown() {
const {
count
} = this;
if (count === 1) {
this.count = 60;
this.sending = false;
this.sendTime = '获取验证码'
} else {
this.count = count - 1;
this.sending = true;
this.sendTime = count - 1 + '秒后重新获取';
setTimeout(this.countDown.bind(this), 1000);
}
},
sendMsgDEghTTorsp() {
const {
mobile
} = this;
console.log(mobile)
if (!mobile) {
uni.showToast({
title: '请输入手机号',
icon: 'none',
duration: 1000
})
} else if (mobile.length !== 11) {
uni.showToast({
title: '请输入正确的手机号',
icon: 'none',
duration: 1000
})
} else {
uni.showLoading({
title: '正在发送验证码...'
})
this.$u.get('/app/Login/sendMsg/' + mobile + '/login').then(res => {
// this.$Request.getT('/appLogin/sendMsg/' + mobile + '/bind').then(res => {
if (res.code === 0) {
this.sending = true;
uni.showToast({
title: '验证码发送成功请注意查收',
icon: 'none',
duration: 1000
})
this.countDown();
uni.hideLoading();
} else {
uni.hideLoading();
uni.showModal({
showCancel: false,
title: '短信发送失败',
content: res.msg ? res.msg : '请一分钟后再获取验证码'
});
}
});
}
},
toLoginDEghTTorsp() {
// this.$queue.loginClear();
// let openid = this.$queue.getData('openid');
if (!this.checked) {
return this.$refs.uToast.show({
title: '请阅读并同意《隐私政策》和《用户服务协议》',
duration: 1500
})
}
let openid = uni.getStorageSync('openId')
const {
mobile,
code
} = this;
if (!mobile) {
// this.$queue.showToast('请输入手机号');
uni.showToast({
title: '请输入手机号',
icon: 'none',
duration: 1000
})
} else if (mobile.length != 11) {
// this.$queue.showToast('请输入手机号');
uni.showToast({
title: '请输入正确的手机号',
icon: 'none',
duration: 1000
})
} else if (!code) {
// this.$queue.showToast('请输入密码');
uni.showToast({
title: '请输入密码',
icon: 'none',
duration: 1000
})
} else {
uni.showLoading({
title: '正在登录中...',
})
this.$u.post('/app/Login/registerCode?password=' + code + '&phone=' + mobile).then(res => {
if (res.code === 0) {
uni.setStorageSync('token', res.token)
uni.setStorageSync('userId', res.user.userId)
uni.setStorageSync('userName', res.user.userName)
uni.setStorageSync('avatar', res.user.avatar ? res.user.avatar :
'../../static/images/logo.png')
uni.setStorageSync('phone', res.user.phone)
uni.setStorageSync('invitationCode', res.user.invitationCode)
uni.setStorageSync('sex', res.user.sex)
uni.setStorageSync('userId', res.user.userId)
//设置渠道码
if (res.user.qdCode) {
uni.setStorageSync('qdCode', res.user.qdCode)
}
// uni.setStorageSync('openId', res.user.openId)
// this.getWeixinInfoDEghTTorsp(this.sendDataList);
uni.showToast({
title: '登录成功',
icon: 'none'
})
const arr= getCurrentPages()
if(arr.length<=1){
return uni.reLaunch({
url:'/pages/index/index'
})
}
uni.navigateBack({
delta: arr.length<=2?1:2
})
} else {
uni.hideLoading();
uni.showToast({
title: res.msg,
icon: 'none',
duration: 1000
})
}
});
}
},
//获取个人信息
getWeixinInfoDEghTTorsp(sendData) {
let that = this;
uni.showLoading({
title: '登录中...'
});
let postData = {
openId: sendData.openId, //小程序openId
unionId: sendData.unionId, //unionId
userName: sendData.userName, //微信名称
avatar: sendData.avatar, //头像
sex: sendData.sex, //性别
phone: that.phone,
inviterCode: sendData.inviterCode
};
that.$u.api.insertWxUser(postData).then(res => {
uni.hideLoading();
if (res.code == 0) {
uni.setStorageSync('token', res.token)
uni.setStorageSync('userName', res.user.userName)
uni.setStorageSync('avatar', res.user.avatar)
uni.setStorageSync('phone', res.user.phone)
uni.setStorageSync('invitationCode', res.user.invitationCode)
uni.setStorageSync('sex', res.user.sex)
uni.setStorageSync('userId', res.user.userId)
uni.setStorageSync('openId', res.user.openId)
let data = {
userId: uni.getStorageSync('userId')
}
that.$u.api.userVip(data).then(res => {
if (res.code == 0 && res.data && res.data.isVip == 2) {
uni.setStorageSync('isVIP', true)
} else {
uni.setStorageSync('isVIP', false)
}
})
uni.navigateBack();
} else {
uni.showModal({
showCancel: false,
title: '登录失败',
content: res.msg,
});
}
})
},
}
};
</script>
<style lang="scss">
.footerDEghTTorsp {
padding-left: 150rpx;
margin-top: 32upx;
font-size: 24upx;
color: #666666;
text-align: center;
display: flex;
}
page {
background: #ffffff;
}
.send-msg {
border-radius: 30px;
color: black;
background: white;
height: 30px;
font-size: 14px;
line-height: 30px;
}
.containerDEghTTorsp {
top: 0;
padding-top: 32upx;
position: relative;
width: 100%;
height: 100%;
overflow: hidden;
background: #ffffff;
}
.wrapperDEghTTorsp {
position: relative;
z-index: 90;
background: #ffffff;
padding-bottom: 20px;
}
.input-contentDEghTTorsp {
padding: 0 20px;
}
.confirm-btnDEghTTorsp {
width: 300px;
height: 42px;
line-height: 42px;
border-radius: 30px;
margin-top: 40px;
// background: linear-gradient(to left, #3f5ecb 0, #5074FF 100%);
background: #ff7581;
color: #ffffff;
// font-size: $font-lg;
&:after {
border-radius: 60px;
}
}
</style>