|
|
@@ -1,35 +1,56 @@
|
|
|
<template>
|
|
|
<view class="container">
|
|
|
<view class="container_text" >
|
|
|
- <!-- <image class="banner-img" src="/static/img/img01.png" mode="scaleToFill"></image> -->
|
|
|
+ <image class="banner-img" src="/static/img/logo.png" mode="scaleToFill"></image>
|
|
|
</view>
|
|
|
<view class="loginTitle"><text>注册</text></view>
|
|
|
<view class="login_text">
|
|
|
<view class="login_input flex">
|
|
|
- <view class="login_img"><image src="/static/icon/img03.png"></image></view>
|
|
|
- <view class="login_name"><input class="uni-input" v-model="phone" focus placeholder="请输入账号" /></view>
|
|
|
+ <view class="login_img"><image src="/static/icon/phone.png"></image></view>
|
|
|
+ <view class="login_name"><input class="uni-input" type="text" v-model="phone" focus placeholder="请输入账号" /></view>
|
|
|
+ </view>
|
|
|
+ <view class="login_input flex">
|
|
|
+ <view class="login_img"><image src="/static/icon/pread.png"></image></view>
|
|
|
+ <view class="login_name"><input class="uni-input" type="text" v-model="invitation" focus placeholder="请输入接点人id" /></view>
|
|
|
</view>
|
|
|
<view class="login_input flex">
|
|
|
- <view class="login_img"><image src="/static/icon/img04.png"></image></view>
|
|
|
+ <view class="login_img"><image src="/static/icon/psw.png"></image></view>
|
|
|
<view class="login_name"><input class="uni-input" type="password" v-model="password" focus placeholder="请输入密码" /></view>
|
|
|
</view>
|
|
|
<view class="login_input flex">
|
|
|
- <view class="login_img"><image src="/static/icon/img04.png"></image></view>
|
|
|
+ <view class="login_img"><image src="/static/icon/psw.png"></image></view>
|
|
|
<view class="login_name"><input class="uni-input" type="password" v-model="repassword" focus placeholder="请重复输入密码" /></view>
|
|
|
</view>
|
|
|
<view class="login_input flex">
|
|
|
- <view class="login_img"><image src="/static/icon/img07.png"></image></view>
|
|
|
- <view class="login_name"><input class="uni-input" type="text" v-model="invitation" focus placeholder="请输入邀请码" /></view>
|
|
|
- </view>
|
|
|
- <!-- <view class="login_input flex">
|
|
|
- <view class="login_img"><image src="/static/icon/img06.png"></image></view>
|
|
|
+ <view class="login_img"><image src="/static/icon/code.png"></image></view>
|
|
|
<view class="login_name flex">
|
|
|
<input class="uni-input width" v-model="code" focus placeholder="请输入验证码" />
|
|
|
<view class="code" @click="verification">{{ countDown == 0 ? '验证码' : countDown }}</view>
|
|
|
</view>
|
|
|
- </view> -->
|
|
|
+ </view>
|
|
|
+ <view class="login_input flex">
|
|
|
+ <view class="login_img"><image src="/static/icon/dw.png"></image></view>
|
|
|
+ <picker @change="bindParentArea" :value="parent_area" :range="parent_areas" class="uni-input">
|
|
|
+ <view class="placeholder" v-if="parent_area === ''">请选择区域</view>
|
|
|
+ <text>{{ parent_area }}</text>
|
|
|
+ </picker>
|
|
|
+ </view>
|
|
|
+ <view class="login_input flex">
|
|
|
+ <view class="login_img"><image src="/static/icon/dw.png"></image></view>
|
|
|
+ <picker @change="bindPayType" :value="pay_type" :range="pay_types" class="uni-input">
|
|
|
+ <view class="placeholder" v-if="pay_type === ''">请选择支付方式</view>
|
|
|
+ <text>{{ pay_type }}</text>
|
|
|
+ </picker>
|
|
|
+ </view>
|
|
|
+ <view class="login_input flex">
|
|
|
+ <view class="login_img"><image src="/static/icon/jft.png"></image></view>
|
|
|
+ <view class="uni-input" style="color: #999;">
|
|
|
+ 是否使用积分抵扣
|
|
|
+ <image src="../../static/icon/noselect.png" mode="" v-if="!isSelsect" @click="jfdk(1)"></image>
|
|
|
+ <image src="../../static/icon/select.png" mode="" v-if="isSelsect" @click="jfdk(0)"></image>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
<view><button type="green" @click="register" class="uni-button uni-button-green">注册账号</button></view>
|
|
|
- <view><button class="uni-button uni-button-green uni-button-green-plain" type="green" plain="true" hover-class="none" @click="login">返回登录</button></view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</template>
|
|
|
@@ -41,10 +62,15 @@ export default {
|
|
|
phone: '', //用户
|
|
|
password: '', //密码
|
|
|
repassword: '',
|
|
|
- invitation: '', //邀请码
|
|
|
+ invitation: '', //接点人id
|
|
|
code: '', //验证码
|
|
|
time: '', //保存倒计时对象
|
|
|
- countDown: 0 ,//倒计时
|
|
|
+ countDown: 0 ,//倒计时
|
|
|
+ parent_area: '',//区域
|
|
|
+ parent_areas: ['A','B','C'],//区域列表
|
|
|
+ pay_type: '',
|
|
|
+ pay_types: ['微信','余额','佣金'],
|
|
|
+ isSelsect: false,
|
|
|
};
|
|
|
},
|
|
|
onLoad() {
|
|
|
@@ -59,7 +85,30 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- methods: {
|
|
|
+ methods: {
|
|
|
+ //选择是否积分抵扣
|
|
|
+ jfdk(index) {
|
|
|
+ if(index == 1) {
|
|
|
+ this.isSelsect = true
|
|
|
+ }else {
|
|
|
+ this.isSelsect = false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //选择区域
|
|
|
+ bindParentArea(e) {
|
|
|
+ console.log(e.detail.value)
|
|
|
+ this.parent_area = this.parent_areas[e.detail.value]
|
|
|
+ },
|
|
|
+ //选择值支付方式
|
|
|
+ bindPayType(e) {
|
|
|
+ console.log(e)
|
|
|
+ if(e.detail.value) {
|
|
|
+ this.pay_type = this.pay_types[e.detail.value]
|
|
|
+ }else if(e.detail.value == 0){
|
|
|
+ this.pay_type = this.pay_types[e.detail.value]
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
// 注册
|
|
|
register() {
|
|
|
let obj = this;
|
|
|
@@ -67,10 +116,6 @@ export default {
|
|
|
obj.$api.msg('请输入账号');
|
|
|
return;
|
|
|
}
|
|
|
- // if (!/(^1[3|4|5|7|8][0-9]{9}$)/.test(this.phone)) {
|
|
|
- // obj.$api.msg('请输入正确的手机号');
|
|
|
- // return;
|
|
|
- // }
|
|
|
if (obj.password == '') {
|
|
|
obj.$api.msg('请输入密码');
|
|
|
return;
|
|
|
@@ -82,20 +127,36 @@ export default {
|
|
|
if (obj.repassword != obj.password) {
|
|
|
obj.$api.msg('两次密码不正确');
|
|
|
return;
|
|
|
+ }
|
|
|
+ if(obj.code == '') {
|
|
|
+ obj.$api.msg('请输入验证吗');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(obj.parent_area == '') {
|
|
|
+ obj.$api.msg('请选择区域');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(obj.pay_type == '') {
|
|
|
+ obj.$api.msg('请选择支付方式');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let paytype = ''
|
|
|
+ if(obj.pay_type == '微信') {
|
|
|
+ paytype = 'weixin'
|
|
|
+ }else if(obj.pay_type == '余额') {
|
|
|
+ paytype = 'yue'
|
|
|
+ }else if(obj.pay_type == '佣金') {
|
|
|
+ paytype = 'brokerage'
|
|
|
}
|
|
|
- // if ((obj.invitation = '')) {
|
|
|
- // obj.$api.msg('请输入邀请码');
|
|
|
- // return;
|
|
|
- // }
|
|
|
- // if (obj.code == '') {
|
|
|
- // obj.$api.msg('请输入验证码');
|
|
|
- // return;
|
|
|
- // }
|
|
|
register({
|
|
|
account: obj.phone, //账号
|
|
|
- // captcha: obj.code, //验证码
|
|
|
+ captcha: obj.code, //验证码
|
|
|
password: obj.password ,//密码
|
|
|
- spread:this.invitation//上级推广人
|
|
|
+ parent: obj.invitation,//接点人uid
|
|
|
+ parent_area: obj.parent_area,//区域
|
|
|
+ pay_type: paytype,
|
|
|
+ use_integral: obj.isSelsect ? '1':'0',
|
|
|
+ from: 'APP'
|
|
|
}).then(function(e) {
|
|
|
uni.showToast({
|
|
|
title:'注册成功',
|
|
|
@@ -104,12 +165,12 @@ export default {
|
|
|
});
|
|
|
setTimeout(function () {
|
|
|
uni.navigateTo({
|
|
|
- url: '/pages/public/login'
|
|
|
+ url: '/pages/user/user'
|
|
|
});
|
|
|
},1000)
|
|
|
-
|
|
|
- });
|
|
|
- //调用注册接口,成功跳转登录页
|
|
|
+ }).catch( err => {
|
|
|
+ console.log(err)
|
|
|
+ })
|
|
|
},
|
|
|
//发送验证码
|
|
|
verification() {
|
|
|
@@ -158,13 +219,14 @@ page {
|
|
|
.container {
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
- background-size: 100%;
|
|
|
+ background-size: 100%;
|
|
|
+ background-color: #fff;
|
|
|
}
|
|
|
.container_text {
|
|
|
width: 100%;
|
|
|
height: 500rpx;
|
|
|
top: 0rpx;
|
|
|
- background-color: #FF4343;
|
|
|
+ // background-color: #FF4343;
|
|
|
.banner-img {
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
@@ -175,7 +237,7 @@ page {
|
|
|
position: relative;
|
|
|
padding: 100rpx 102rpx;
|
|
|
background-color: #ffffff;
|
|
|
- margin-top: -180rpx;
|
|
|
+ // margin-top: -180rpx;
|
|
|
border-radius: 20rpx;
|
|
|
.login_input {
|
|
|
border-bottom: 1px solid #f0f0f0;
|
|
|
@@ -188,7 +250,14 @@ page {
|
|
|
.uni-input {
|
|
|
text-align: left;
|
|
|
width: 470rpx;
|
|
|
- font-size: 28rpx !important;
|
|
|
+ font-size: 28rpx !important;
|
|
|
+ position: relative;
|
|
|
+ image {
|
|
|
+ width: 30rpx;
|
|
|
+ height: 30rpx;
|
|
|
+ position: absolute;
|
|
|
+ right: 0;
|
|
|
+ }
|
|
|
}
|
|
|
.login_name {
|
|
|
color: #333333;
|
|
|
@@ -232,7 +301,7 @@ page {
|
|
|
color: #ffffff;
|
|
|
background-color: $base-color;
|
|
|
margin: 40rpx 10rpx;
|
|
|
- border-radius: 50rpx;
|
|
|
+ border-radius: 10rpx;
|
|
|
}
|
|
|
.uni-button-green-plain {
|
|
|
border: 1px solid $base-color;
|