Fly 2 years ago
parent
commit
289536d941

+ 5 - 0
api/index.js

@@ -15,4 +15,9 @@ export function Api_getEmailCode(data) {
 //  发送手机验证码
 export function Api_getSmsSend(data) {
 	return axios.post(`/api/sms_send`, data)
+}
+
+//  文章详情
+export function Api_getNewDetail(data) {
+	return axios.post(`/api/news/detail` , data )
 }

+ 6 - 0
pages.json

@@ -11,6 +11,12 @@
 			"style": {
 				"navigationBarTitleText": "biking注册"
 			}
+		},
+		{
+			"path": "pages/agreement",
+			"style": {
+				"navigationBarTitleText": "服务与隐私条款"
+			}
 		}
 	],
 	"globalStyle": {

+ 36 - 0
pages/agreement.vue

@@ -0,0 +1,36 @@
+<template>
+	<view class="new-content" v-html="NewContent">
+
+	</view>
+</template>
+
+<script>
+	import { Api_getNewDetail } from "@/api/index.js"
+	export default {
+		data() {
+			return {
+				NewContent: '',
+				NewTitle: ''
+			};
+		},
+		onLoad() {
+			this.getNewDetail()
+		},
+		methods: {
+			getNewDetail() {
+				Api_getNewDetail({
+					id: 8
+				}).then(res => {
+					this.NewContent = res?.content;
+					this.NewTitle = res?.title;
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.new-content {
+		padding: 30rpx;
+	}
+</style>

+ 79 - 5
pages/index.vue

@@ -27,6 +27,22 @@
 				</view> -->
 			</view>
 
+		</view>
+		<view class="content-02">
+			<view class="contract-title">
+				CONTRACT
+			</view>
+			<view class="contract-item">
+				<image class="contract-item-icon" src="../static/img/img_30.png" mode=""></image>
+				<text class="contract-item-name">永续合约</text>
+				<text class="contract-item-val">一键市价开/平仓,100%零滑点,</text>
+				<text class="contract-item-val">主动出击,无惧极端的行情波动!</text>
+				<image class="contract-item-icon" src="../static/img/img_31.png" mode=""></image>
+				<text class="contract-item-name">快捷合约</text>
+				<text class="contract-item-val">1-100倍杠杆随意调节,</text>
+				<text class="contract-item-val">你的人生,充满无限可能!</text>
+			</view>
+
 		</view>
 		<view class="content-03">
 			<view class="stage stage-01">
@@ -41,11 +57,11 @@
 				<text class="stage-time">2021-11-10</text>
 				<text class="stage-money">$68958</text>
 			</view>
-			<image class="stage-image" src="@/static/img/im.png" mode="aspectFit"></image>
+			<image class="stage-image" src="@/static/img/img_32.png" mode="aspectFit"></image>
 		</view>
 		<view class="content-04">
 			<text class="content-04-title">交易特色</text>
-			<image class="content-04-title-logo" src="@/static/img/img_08.png" mode="aspectFit"></image>
+			<!-- <image class="content-04-title-logo" src="@/static/img/img_08.png" mode="aspectFit"></image> -->
 			<view class="stage-val">
 				<image class="stage-image" src="@/static/img/img_09.png" mode="aspectFit"></image>
 				<text></text>
@@ -100,7 +116,7 @@
 					<text class="safely-left-lable">Exchange Crypto Safely</text>
 					<text class="safely-left-val">币王将持续为用户交易增加安全保障</text>
 				</view>
-				<image class="safely-right" src="@/static/img/img_14.png" mode=""></image>
+				<image class="safely-right" src="@/static/img/img_33.png" mode=""></image>
 			</view>
 		</view>
 
@@ -222,8 +238,65 @@
 				width: 353rpx;
 				height: 715rpx;
 
+			}
+		}
+
+		.content-02 {
+			padding: 260rpx 60rpx 0;
+			width: 100%;
+			min-height: 1519rpx;
+			background: url("@/static/img/img_29.png") no-repeat top center;
+			background-size: 100% 1519rpx;
+
+			.contract-title {
+
+				font-size: 103rpx;
+				font-family: Bahnschrift, Bahnschrift-Bold;
+				font-weight: 700;
+				text-align: left;
+				color: #c4c4c4;
+				letter-spacing: 2.06rpx;
+			}
+
+			// <view class="contract-item">
+			// 				<image class="contract-item-icon" src="../static/img/img_30.png" mode=""></image>
+			// 				<text class="contract-item-name">永续合约</text>
+			// 				<text class="contract-item-val">一键市价开/平仓,100%零滑点,</text>
+			// 				<text class="contract-item-val">主动出击,无惧极端的行情波动!</text>
+			// 				<image class="contract-item-icon" src="../static/img/img_31.png" mode=""></image>
+			// 				<text class="contract-item-name">快捷合约</text>
+			// 				<text class="contract-item-val">1-100倍杠杆随意调节,</text>
+			// 				<text class="contract-item-val">你的人生,充满无限可能!</text>
+			// 			</view>
+			.contract-item {
+				display: flex;
+				flex-direction: column;
+				justify-content: center;
+				align-items: center;
+				padding: 43rpx 0 0;
+				.contract-item-icon {
+					width: 125rpx;
+					height: 125rpx;
+					margin-top: 90rpx
+				}
 
+				.contract-item-name {
+					padding: 31rpx 0 5rpx;
+					font-size: 42rpx;
+					font-family: PingFang SC, PingFang SC-Bold;
+					font-weight: 700;
+					color: #1a1a1a;
+				}
+
+				.contract-item-val {
+					padding-top: 20rpx;
+					font-size: 34rpx;
+					font-family: PingFang SC, PingFang SC-Regular;
+					font-weight: 400;
+					color: #666666;
+				}
 			}
+
 		}
 
 		.content-03 {
@@ -307,6 +380,7 @@
 			}
 
 			.stage-val {
+				padding-top: 189rpx;
 				width: 100%;
 				display: flex;
 				align-items: center;
@@ -493,9 +567,9 @@
 				}
 
 				.safely-right {
-					width: 271rpx;
+					width: 256rpx;
 					height: 271rpx;
-					right: -75rpx;
+					right: -60rpx;
 				}
 			}
 		}

+ 93 - 11
pages/register.vue

@@ -17,7 +17,7 @@
 						<text class="area-val">{{ from.areaCode ? `+${from.areaCode}` : '国家地区'}}</text>
 						<image class="select-area" src="../static/img/img_26.png" mode="aspectFit"></image>
 					</view>
-					<input v-model="from.user_string" class="item-input" type="text"
+					<input v-model="from.user_string" class="item-input" type="number"
 						placeholder-class="placeholder-class" placeholder="请输入手机号">
 				</view>
 				<view class="from-item" v-show="registerType === 2">
@@ -25,12 +25,12 @@
 						placeholder-class="placeholder-class" placeholder="请输入邮箱号">
 				</view>
 				<view class="from-item">
-					<input class="item-input" v-model="from.password.code" type="text"
+					<input class="item-input" v-model="from.code" type="number"
 						placeholder-class="placeholder-class" placeholder="验证码">
 					<text class="item-code" @click.stop="getCode()">{{ CodeText }}</text>
 				</view>
 				<view class="from-item">
-					<input class="item-input" v-model="from.password" :type="showPass ? 'number' : 'password'"
+					<input class="item-input" v-model="from.password" :type="showPass ? 'text' : 'password'"
 						placeholder-class="placeholder-class" placeholder="请输入密码">
 					<view class="pass-icon-box" @click.stop="showPass = !showPass">
 						<image v-show="!showPass" class="pass-icon" src="../static/img/img_25.png" mode="aspectFit">
@@ -50,7 +50,7 @@
 							mode="aspectFit">
 						</image>
 					</view>
-					我已阅读并同意<text class="agreement-name">《服务与隐私条款》</text>
+					我已阅读并同意<text class="agreement-name" @click.stop="readAgreementContent()">《服务与隐私条款》</text>
 				</view>
 
 
@@ -67,6 +67,10 @@
 		Api_getEmailCode,
 		Api_getSmsSend
 	} from "@/api/index.js"
+	import {
+		validPassword,
+		validPositiveIntegerZero
+	} from "@/utils/validate.js"
 	export default {
 		name: 'register',
 		data() {
@@ -81,21 +85,81 @@
 					areaCode: 86,
 					code: '',
 					extension_code: ''
-				}
+				},
+
+				timeInterval: null
 			};
 		},
 		onLoad(opt) {
 			this.from.extension_code = opt?.extension_code || ''
 		},
 		methods: {
+			// 校验
+			verifyVal(type, val) {
+				let status = true,
+					msg = ''
+				switch (type) {
+					case 'phone':
+						status = validPositiveIntegerZero(val);
+						msg = '手机号码格式错误';
+						break;
+					case 'email':
+						status = val ? true : false;
+						msg = '请输入邮箱号'
+						break;
+					case 'code':
+						status = val ? true : false;
+						msg = '请输入验证码';
+						break;
+					case 'password':
+						status = validPassword(val);
+						msg = '密码须同时包含数字,大小写字母,且大于8位'
+						break;
+					case 'extension_code':
+						status = val ? true : false;
+						msg = '请填写验证码'
+						break;
+
+
+
+				}
+				if (!status) {
+					console.log('msg = ', msg)
+					uni.showToast({
+						title: msg,
+						icon: 'none'
+					})
+				}
+				return status
+			},
+
+			readAgreementContent() {
+				uni.navigateTo({
+					url: '/pages/agreement'
+				})
+			},
 			setRegisterType(type) {
 				this.from.user_string = '';
 				this.registerType = type;
 			},
+
+			// validPassword
+
 			getCode() {
 				if (this.CodeText !== '获取验证码') {
 					return false
 				}
+				if (this.registerType === 1) {
+					if (!this.verifyVal('phone', this.from.user_string) || this.from.user_string.length !== 11) {
+
+						return false
+					}
+				} else {
+					if (!this.verifyVal('email', this.from.user_string)) {
+
+						return false
+					}
+				}
 				let Api_ = '',
 					obj = {};
 				obj.user_string = this.from.user_string;
@@ -103,7 +167,7 @@
 					case 1:
 						// 手机号 - 获取验证码
 						Api_ = Api_getSmsSend;
-						obj.area_code = this.areaCode;
+						obj.area_code = this.from.areaCode;
 						break;
 					case 2:
 						// 邮箱 - 获取验证码
@@ -111,6 +175,8 @@
 						break;
 					default:
 						break;
+
+
 				}
 				if (Api_) {
 					Api_(obj).then(res => {
@@ -135,9 +201,28 @@
 			},
 			submitRegister() {
 				if (this.readAgreement) {
+					if (this.registerType === 1) {
+						if (!this.verifyVal('phone', this.from.user_string) || this.from.user_string.length !== 11) {
+							return false
+						}
+					} else {
+						if (!this.verifyVal('email', this.from.user_string)) {
+							return false
+						}
+					}
+					if (!this.verifyVal('code', this.from.code)) {
+						return false
+					}
+					if (!this.verifyVal('password', this.from.password)) {
+						return false
+					}
+					if (!this.verifyVal('extension_code', this.from.extension_code)) {
+						return false
+					}
 					const obj = {
 						user_string: this.from.user_string,
 						password: this.from.password,
+						re_password: this.from.password,
 						extension_code: this.from.extension_code,
 						code: this.from.code,
 						type: this.registerType === 1 ? 'mogile' : '	email'
@@ -195,11 +280,8 @@
 			background-color: #fff;
 			border-radius: 20rpx;
 			padding-bottom: 63rpx;
-
-			// <view class="from-lable">
-			// 	<text class="lable-title">手机注册</text>
-			// 	<text class="lable-title">邮箱注册</text>
-			// </view>
+			margin-top: 46rpx;
+			 
 			.from-lable {
 				width: 100%;
 				display: flex;

BIN
static/img/3-16.png


BIN
static/img/3-8.png


BIN
static/img/icon_r716c85p0t8.zip


BIN
static/img/im.png


BIN
static/img/img_07.png


BIN
static/img/img_08.png


static/img/滚动组 1.png → static/img/img_29.png


static/img/组 24739.png → static/img/img_30.png


static/img/组 24739_1.png → static/img/img_31.png


BIN
static/img/img_32.png


BIN
static/img/img_33.png


BIN
static/img/滚动组 2.png


BIN
static/img/组 1_1.png


BIN
static/img/组 1_2.png


BIN
static/img/组 24740.png


BIN
static/img/组 24748.png


BIN
static/img/组 24749.png


BIN
static/img/组 24764.png


BIN
static/img/组 24776.png


+ 1 - 1
utils/request.js

@@ -2,7 +2,7 @@
  
 
 // 请求域名
-const baseUrl = process.env.NODE_ENV === 'development' ? 'Api' : 'https://doc.okenx.com/'
+const baseUrl = process.env.NODE_ENV === 'development' ? '/Apis' : 'https://doc.okenx.com/'
  
 
 let LoginFailure = false