lhl 2 years ago
parent
commit
3cf0ae7411

+ 17 - 1
api/login.js

@@ -86,4 +86,20 @@ export function zc(data) {
 		data
 	})
 }
- 
+
+export function getForget(data) {
+	return request({
+		url: '/api/Login/findsendcode',
+		method: 'get',
+		data
+	})
+}
+
+//
+export function resetpwd(data) {
+	return request({
+		url: '/api/Login/resetpwd',
+		method: 'post',
+		data
+	})
+}

+ 26 - 1
pages.json

@@ -12,10 +12,35 @@
 				"navigationBarTitleText": "幣幣交易市場"
 			}
 		},
+		{
+			"path": "pages/transaction/cblist",
+			"style": {
+				"navigationBarTitleText": "充幣列表"
+			}
+		},
+		{
+			"path": "pages/transaction/cbdetail",
+			"style": {
+				"navigationBarTitleText": "充幣詳情"
+			}
+		},
+		{
+			"path": "pages/transaction/tblist",
+			"style": {
+				"navigationBarTitleText": "提幣列表"
+			}
+		},
+		{
+			"path": "pages/transaction/tbdetail",
+			"style": {
+				"navigationBarTitleText": "提幣詳情"
+			}
+		},
 		{
 			"path": "pages/heyue/heyue",
 			"style": {
-				"navigationBarTitleText": "合約"
+				"navigationBarTitleText": "合約交易",
+				"navigationStyle": "custom"
 			}
 		},
 		{

+ 115 - 6
pages/index/index.vue

@@ -12,20 +12,20 @@
 			<view class="gnh-top flex">
 				<view class="top-item flex">
 					<image src="../../static/icon/gn-1.png" mode="" class=""></image>
-					<view class="">认购</view>
+					<view class="">認購</view>
 				</view>
 				<view class="top-item flex">
 					<image src="../../static/icon/gn-2.png" mode="" class=""></image>
-					<view class="">充</view>
+					<view class="">充</view>
 				</view>
 				<view class="top-item flex">
 					<image src="../../static/icon/gn-3.png" mode="" class=""></image>
-					<view class="">提</view>
+					<view class="">提</view>
 				</view>
-				<view class="top-item flex">
+				<!-- <view class="top-item flex">
 					<image src="../../static/icon/gn-4.png" mode="" class=""></image>
-					<view class="">言</view>
-				</view>
+					<view class="">言</view>
+				</view> -->
 				<view class="top-item flex">
 					<image src="../../static/icon/gn-5.png" mode="" class=""></image>
 					<view class="">客服</view>
@@ -68,6 +68,23 @@
 			</view>
 		</view>
 		<!-- 功能盒 end -->
+		<!--  -->
+		<view class="list">
+			<view class="list-title flex">
+				<view class="title-left">交易對</view>
+				<view class="title-center">最新價格</view>
+				<view class="title-right">24h漲跌</view>
+			</view>
+			<!-- <scroll-view class="swiper-box" scroll-y="true" :style="{ height: maxheight }">
+				<view class="list-main flex">
+					<view class="main-left">{{   }}</view>
+					<view class="main-center" :class="{ down: item.zd < 0, ping: item.zd == 0 }">{{ item.price == 0 ? '--.--' : item.price }}</view>
+					<view class="main-right">
+						<view class="btn" :class="{ down: item.zd < 0, ping: item.zd == 0 }">{{ item.zd }}%</view>
+					</view>
+				</view>
+			</scroll-view> -->
+		</view>
 	</view>
 </template>
 
@@ -82,6 +99,7 @@
 	export default {
 		data() {
 			return {
+				maxheight: '',
 				scoket: '',
 				instId: 'IOTA-USDT', //请求的产品id
 				spList:[],//需要查询的列表
@@ -94,6 +112,22 @@
 		onLoad: function(option) {
 			
 
+		},
+		onReady(res) {
+			var _this = this;
+			uni.getSystemInfo({
+				success: resu => {
+					const query = uni.createSelectorQuery();
+					query.select('.swiper-box').boundingClientRect();
+					query.exec(function(res) {
+						_this.maxheight = resu.windowHeight - res[0].top + 'px';
+						console.log('打印页面的剩余高度', _this.maxheight);
+					});
+				},
+				fail: res => {
+					console.log('打印页面的剩余高度', res);
+				}
+			});
 		},
 		onShow: function() {
 			this.geLevertade()
@@ -129,6 +163,7 @@
 					that.scoket.scoketMessage((res)=>{
 						try{
 						that.listOBj[res.arg.instId] = res.data
+						console.log(that.listOBj,'that.listOBj++++++')
 						}catch(e){
 							console.log(res,'报错');
 						}
@@ -239,4 +274,78 @@
 			}
 		}
 	}
+	.list {
+		background: #ffffff;
+		border-top-left-radius: 26rpx;
+		border-top-right-radius: 26rpx;
+		padding: 40rpx 15rpx 0;
+		.list-title {
+			font-size: 28rpx;
+			font-family: PingFang SC;
+			font-weight: 500;
+			color: #525c6e;
+			padding-bottom: 32rpx;
+			.title-left {
+				text-align: left;
+				width: 33%;
+			}
+			.title-center {
+				text-align: center;
+				width: 33%;
+			}
+			.title-right {
+				text-align: right;
+				width: 33%;
+			}
+		}
+		.list-main {
+			padding: 12rpx 0;
+			.main-left {
+				text-align: left;
+				width: 33%;
+				font-size: 28rpx;
+				font-family: PingFang SC;
+				font-weight: 500;
+				color: #525c6e;
+			}
+			.main-center {
+				text-align: center;
+				width: 33%;
+				font-size: 28rpx;
+				font-family: PingFang SC;
+				font-weight: 500;
+				color: #e15560;
+				&.down {
+					color: #5ec886;
+				}
+				&.ping {
+					color: #525c6e;
+				}
+			}
+			.main-right {
+				text-align: right;
+				width: 33%;
+				display: flex;
+				justify-content: flex-end;
+				.btn {
+					width: 122rpx;
+					height: 63rpx;
+					background: #e15562;
+					border-radius: 5rpx;
+					text-align: center;
+					line-height: 63rpx;
+					font-size: 24rpx;
+					font-family: PingFang SC;
+					font-weight: 500;
+					color: #ffffff;
+					&.down {
+						background: #5ec886;
+					}
+					&.ping {
+						background: #f6f6f6;
+					}
+				}
+			}
+		}
+	}
 </style>

+ 53 - 40
pages/public/forget.vue

@@ -6,50 +6,33 @@
 		<view class="tit" >
 			郵箱
 		</view>
-		<input type="text" class="shuru" placeholder="新密碼" v-model="email">
+		<input type="text" class="shuru" placeholder="郵箱" v-model="email">
 		<view class="tit" >
-			重置密碼
+			密碼
 		</view>
-		<input type="text" class="shuru" placeholder="重置密碼" v-model="email">
+		<input type="text" class="shuru" placeholder="新密碼" v-model="lpwd">
 		<view class="tit">
 			郵箱驗證碼
 		</view>
 		<view class="flex" style="width: 673rpx;justify-content: space-between;margin: auto;">
-			<input type="text" class=" yzm" placeholder="請翰入密碼" v-model="code">
+			<input type="text" class=" yzm" placeholder="驗證碼" v-model="ecode">
 			<view class="code yzmbtn" @click="verification">{{ countDown == 0 ? '验证码' : countDown }}</view>
 		</view>
-		<view class="tit" >
-			新密碼
-		</view>
-		<input type="text" class="shuru" placeholder="新密碼" v-model="email">
-		<!-- <view class="container_text">
-			<image class="banner-img" src="/static/img/img01.png" mode=" scaleToFill"></image>
+		<view class="flex" style="justify-content: space-between;padding: 50rpx 30rpx;align-items: flex-start;">
+			<view class="">
+			</view>
+			<image src="../../static/icon/goto.png" mode="" style="width: 97rpx;height: 97rpx;" @click="resetpwd()"></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>
-			<view class="login_input flex">
-				<view class="login_img"><image src="/static/icon/img06.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>
-				<button type="green" @click="register" class="uni-button uni-button-green">登录</button>
-			</view>
-		</view> -->
 	</view>
 </template>
 <script>
 import { mapMutations } from 'vuex';
-import { verify, loginMobile, getUserInfo } from '@/api/login.js';
+import { verify, loginMobile, getUserInfo,getForget ,resetpwd} from '@/api/login.js';
 export default {
 	data() {
-		return {
+		return {
+			ecode: '',
+			email: '',
 			phone: '', //用户
 			code: '', //验证码
 			time: '', //保存倒计时对象
@@ -66,7 +49,32 @@ export default {
 		}
 	},
 	methods: {
-		...mapMutations('user', ['setUserInfo', 'login']),
+		...mapMutations('user', ['setUserInfo', 'login']),
+		resetpwd() {
+			let obj = this
+			if(obj.email == '') {
+				return obj.$api.msg('請輸入郵箱!')
+			}
+			if (!obj.isEmailAvailable(obj.email)) {
+				return obj.$api.msg('請輸入正確的郵箱!')
+			}
+			if(obj.ecode == '') {
+				return obj.$api.msg('請輸入驗證碼!')
+			}
+			if(obj.lpwd == '') {
+				return obj.$api.msg('請輸入新密碼!')
+			}
+			resetpwd({
+				email: obj.email,
+				ecode: obj.ecode,
+				lpwd: obj.lpwd
+			}).then(res => {
+				console.log(res)
+				obj.login()
+			}).catch(err => {
+				
+			})
+		},
 		// 手机登录
 		register() {
 			let obj = this;
@@ -100,17 +108,22 @@ export default {
 			}).catch((e) => {
 				console.log(e);
 			});
+		},
+		isEmailAvailable(obj) {
+			let email = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
+			if (!email.test(obj)) {
+				return false;
+			}
+			return true;
 		},
 		//发送验证码
 		verification() {
-			let obj = this;
-			if (this.phone == '') {
-				this.$api.msg('请输入电话号码');
-				return;
+			let obj = this;
+			if(obj.email == '') {
+				return obj.$api.msg('請輸入郵箱!')
 			}
-			if (this.phone.length < 11) {
-				this.$api.msg('请输入正确的手机号');
-				return;
+			if (!obj.isEmailAvailable(obj.email)) {
+				return obj.$api.msg('請輸入正確的郵箱!')
 			}
 			// 判断是否在倒计时
 			if (obj.countDown > 0) {
@@ -121,9 +134,9 @@ export default {
 					obj.countDown--;
 				}, 1000);
 				//调用验证码接口
-				verify({
-					phone: obj.phone,
-					type: 'login'
+				getForget({
+					email: obj.email,
+					// type: 'login'
 				})
 					.then(({ data }) => {})
 					.catch(err => {

+ 0 - 28
pages/public/login.vue

@@ -21,34 +21,6 @@
 				登錄
 			</view>
 		</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="username" focus placeholder="请输入手机号" />
-				</view>
-			</view>
-			<view class="login_input flex">
-				<view class="login_img">
-					<image src="/static/icon/img04.png"></image>
-				</view>
-				<view class="login_name"><input class="uni-input" type="password" v-model="passward" focus
-						placeholder="请输入密码" /></view>
-			</view>
-			<view><button type="green" class="uni-button uni-button-green" @click="toLogin">登录</button></view>
-			<view><button type="green" class="uni-button uni-button-green uni-button-green-plain" plain="true"
-					hover-class="none" @click="register">注册</button></view>
-			<navigator url="./forget">
-				<view class="forget">忘记密码</view>
-			</navigator>
-			<view class="flex other">
-				<view class="fenge"></view>
-				<view class="qita">其他方式登录</view>
-				<view class="fenge"></view>
-			</view>
-		</view> -->
 	</view>
 </template>
 

+ 3 - 0
pages/public/register.vue

@@ -170,6 +170,9 @@
 			//发送验证码
 			verification() {
 				let obj = this;
+				if(obj.email == '') {
+					return obj.$api.msg('請輸入郵箱!')
+				}
 				if (!obj.isEmailAvailable(obj.email)) {
 					return obj.$api.msg('請輸入正確的郵箱!')
 				}

+ 33 - 0
pages/transaction/cbdetail.vue

@@ -0,0 +1,33 @@
+<template>
+	<view class="content">
+
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+
+			}
+		},
+		onLoad() {
+
+		},
+		onShow() {
+
+		},
+		onReachBottom() {
+
+		},
+		onReady() {
+
+		},
+		methods: {
+
+		}
+	}
+</script>
+
+<style lang="scss">
+</style>

+ 33 - 0
pages/transaction/cblist.vue

@@ -0,0 +1,33 @@
+<template>
+	<view class="content">
+
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+
+			}
+		},
+		onLoad() {
+
+		},
+		onShow() {
+
+		},
+		onReachBottom() {
+
+		},
+		onReady() {
+
+		},
+		methods: {
+
+		}
+	}
+</script>
+
+<style lang="scss">
+</style>

+ 33 - 0
pages/transaction/tbdetail.vue

@@ -0,0 +1,33 @@
+<template>
+	<view class="content">
+
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+
+			}
+		},
+		onLoad() {
+
+		},
+		onShow() {
+
+		},
+		onReachBottom() {
+
+		},
+		onReady() {
+
+		},
+		methods: {
+
+		}
+	}
+</script>
+
+<style lang="scss">
+</style>

+ 33 - 0
pages/transaction/tblist.vue

@@ -0,0 +1,33 @@
+<template>
+	<view class="content">
+
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+
+			}
+		},
+		onLoad() {
+
+		},
+		onShow() {
+
+		},
+		onReachBottom() {
+
+		},
+		onReady() {
+
+		},
+		methods: {
+
+		}
+	}
+</script>
+
+<style lang="scss">
+</style>