浏览代码

9-2-注册

lhl 4 年之前
父节点
当前提交
5741d4d7a2
共有 18 个文件被更改,包括 198 次插入62 次删除
  1. 9 0
      api/user.js
  2. 7 0
      pages.json
  3. 6 6
      pages/public/login.vue
  4. 107 38
      pages/public/register.vue
  5. 18 0
      pages/user/award.vue
  6. 1 0
      pages/user/integral.vue
  7. 49 17
      pages/user/transfer.vue
  8. 1 1
      pages/user/user.vue
  9. 二进制
      static/icon/code.png
  10. 二进制
      static/icon/dw.png
  11. 二进制
      static/icon/jft.png
  12. 二进制
      static/icon/noselect.png
  13. 二进制
      static/icon/paytype.png
  14. 二进制
      static/icon/phone.png
  15. 二进制
      static/icon/pread.png
  16. 二进制
      static/icon/psw.png
  17. 二进制
      static/icon/select.png
  18. 二进制
      static/img/logo.png

+ 9 - 0
api/user.js

@@ -137,4 +137,13 @@ export function getSpreadCount(data,type) {
 		method:'get',
 		data
 	})
+}
+
+//佣金转账
+export function trade(data) {
+	return request({
+		url:'/api/trade',
+		method:'post',
+		data
+	})
 }

+ 7 - 0
pages.json

@@ -370,6 +370,13 @@
 					}
 				}
 			}
+		},
+		{
+			"path": "pages/user/transfer",
+			"style": {
+				"navigationBarTitleText": "佣金转账"
+				
+			}
 		}
 	],
 	"globalStyle": {

+ 6 - 6
pages/public/login.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="container">
 		<view class="container_text">
-			<!-- <image class="banner-img" src="/static/img/img01.png" mode="scaleToFill"> -->
+			<image class="banner-img" src="/static/img/logo.png" mode="scaleToFill">
 		</image>
 		</view>
 		<view class="loginTitle"><text>登录</text></view>
@@ -23,11 +23,11 @@
 				<view class="fenge"></view>
 			</view>
 			<!-- #ifndef APP-PLUS -->
-			<view class="weixin" @click="wecahtLogin"><image src="/static/img/img05.png"></image></view>
-			<view class="weixin_text" @click="wecahtLogin">微信登录</view>
+			<!-- <view class="weixin" @click="wecahtLogin"><image src="/static/img/img05.png"></image></view>
+			<view class="weixin_text" @click="wecahtLogin">微信登录</view> -->
 			<!-- #endif -->
 			<!-- #ifdef APP-PLUS -->
-			<block v-if="!is_ios">
+			<!-- <block v-if="!is_ios">
 				<view class="weixin" @click="wecahtLogin"><image src="/static/img/img05.png" mode="scaleToFill"></image></view>
 				<view class="weixin_text" @click="wecahtLogin">微信登录</view>
 			</block>
@@ -40,7 +40,7 @@
 					<image class="loginIcon" src="/static/icon/appleIcon.png" mode=" scaleToFill"></image>
 					<text class="weixin_text">通过Apple登录</text>
 				</view>
-			</block>
+			</block> -->
 			<!-- #endif -->
 		</view>
 	</view>
@@ -294,7 +294,7 @@ page {
 	width: 100%;
 	height: 500rpx;
 	top: 0rpx;
-	background-color: #6EAB4E;
+	// background-color: #6EAB4E;
 	.banner-img {
 		width: 100%;
 		height: 100%;

+ 107 - 38
pages/public/register.vue

@@ -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;

+ 18 - 0
pages/user/award.vue

@@ -7,6 +7,9 @@
 					<text>¥</text>
 					{{ money | getMoneyStyle }}
 				</view>
+				<view class="transfer" @click="navto('/pages/user/transfer')">
+					佣金转账
+				</view>
 			</view>
 		</view>
 		<view class="navbar">
@@ -225,6 +228,21 @@ page {
 	color: #3F7C1F;
 	text-align: center;
 	position: relative;
+	.transfer {
+		width: 147rpx;
+		line-height: 56rpx;
+		background: #fff;
+		box-shadow: 0px 3rpx 8rpx 0px rgba(0, 0, 0, 0.17);
+		border-radius: 7rpx 0px 0px 7rpx;
+		position: absolute;
+		right: 0;
+		bottom: 210rpx;
+		z-index: 10;
+		font-size: 28rpx;
+		font-family: PingFang SC;
+		font-weight: bold;
+		color: #FF0000;
+	}
 	image {
 		position: absolute;
 		top: 0;

+ 1 - 0
pages/user/integral.vue

@@ -4,6 +4,7 @@
 		<view class="header">
 			<image src="../../static/img/img38.png" mode="scaleToFill"></image>
 			<view class="money">{{+integralAll || 0}}</view>
+			<view class="transfer">佣金转账</view>
 		</view>
 		<!-- 收入和支出 -->
 		<view class="navbar">

+ 49 - 17
pages/user/transfer.vue

@@ -1,41 +1,74 @@
 <template>
 	<view class="container">
-		<!-- 佣金转账 -->
-		<!-- <view class="top-one">
-			<image src="../../static/img/xiangzuo.png" mode="scaleToFill"></image>
-			<view class="text">佣金转账</view>
-		</view> -->
-		<!-- 可转账佣金 -->
 		<view class="top-two">
-			<view class="count">360</view>
+			<view class="count">{{money || 0}}</view>
 			<view class="text">可转账佣金</view>
 		</view>
 		<view class="top-three">
-			<view class="text">收款入账户</view>
-				<input class="input" type="number" placeholder="请输入收款人账户"/>
+			<view class="text">收款人账户</view>
+				<input class="input" type="text" placeholder="请输入收款人账户" v-model="to_user_account"/>
+		</view>
+		<view class="top-three">
+			<view class="text">收款人UID</view>
+				<input class="input" type="number" placeholder="请输入收款人UID" v-model="to_uid"/>
 		</view>
 		<view class="top-four">
 			<view class="text">转账数量</view>
 			<view class="row">
 				<text class="tit">¥</text>
-				<input class="input" type="number" placeholder="请输入转账数量" />
+				<input class="input" type="number" placeholder="请输入转账数量" v-model="num"/>
 			</view>
 		</view>
-			<view class="btn" @click="nav('/pages/user/submit')" >提交申请</view>
+			<view class="btn" @click="sub">提交申请</view>
 	</view>
 </template>
 
 <script>
+	import { trade, getSpreadCount } from '@/api/user.js'
 export default {
 	data () {
 		return {
+			num: '',//转账金额
+			to_user_account: '',//收款人账户
+			to_uid: '',//收款人UID
+			money: 0,
 		}
 	},
+	onLoad() {
+		this.getNum()
+	},
 	methods: {
 		nav (url) {
 			uni.navigateTo({
 				url
 			})
+		},
+		sub() {
+			let obj = this
+			if(obj.num == '') {
+				return this.$api.msg('请输入收款人账户!')
+			}
+			if(to_user_account == '') {
+				return this.$api.msg('请输入收款人账户!')
+			}
+			if(obj.to_uid == '') {
+				return this.$api.msg('请输入转账金额!')
+			}
+			if( +obj.num > +obj.money)
+			trade({
+				type: 'd',
+				num: obj.num,
+				to_user_account: obj.to_user_account,
+				to_uid: obj.to_uid
+			}).then( res => {
+				
+			})
+		},
+		getNum() {
+			getSpreadCount({}, 3).then(({ data }) => {
+				console.log(data);
+				this.money = +data.count;
+			});
 		}
 	}
 }
@@ -45,14 +78,13 @@ export default {
 	.container {
 		background-color: #F2F3F5;
 		width: 750rpx;
-		height: 1334rpx;
+		// height: 1334rpx;
 		.top-two {
-			margin-top: 20rpx;
-			height: 160rpx;
+			padding-bottom: 20rpx;
 			background-color: #fff;
 			.count {
-				width: 76rpx;
-				height: 34rpx;
+				text-align: center;
+				height: 50rpx;
 				font-size: 42rpx;
 				font-family: PingFang SC;
 				font-weight: bold;
@@ -62,7 +94,7 @@ export default {
 			}
 			.text {
 				width: 140rpx;
-				height: 26rpx;
+				// height: 26rpx;
 				font-size: 28rpx;
 				font-family: PingFang SC;
 				font-weight: 500;

+ 1 - 1
pages/user/user.vue

@@ -80,7 +80,7 @@
 					<view class="text">邀请海报</view>
 					<image class="jiantou" src="../../static/img/img32.png" mode="scaleToFill"></image>
 				</view>
-				<view class="ul-btm" >
+				<view class="ul-btm" @click="nav('/pages/public/register')">
 					<image src="../../static/img/img29.png" mode="scaleToFill"></image>
 					<view class="text">会员注册</view>
 					<image class="jiantou" src="../../static/img/img32.png" mode="scaleToFill"></image>

二进制
static/icon/code.png


二进制
static/icon/dw.png


二进制
static/icon/jft.png


二进制
static/icon/noselect.png


二进制
static/icon/paytype.png


二进制
static/icon/phone.png


二进制
static/icon/pread.png


二进制
static/icon/psw.png


二进制
static/icon/select.png


二进制
static/img/logo.png