hwq %!s(int64=3) %!d(string=hai) anos
pai
achega
ffecca5306
Modificáronse 7 ficheiros con 486 adicións e 67 borrados
  1. 1 1
      App.vue
  2. 5 25
      pages.json
  3. 211 6
      pages/index/convert.vue
  4. 199 0
      pages/index/index.vue
  5. 66 31
      pages/index/node.vue
  6. BIN=BIN
      static/img/tab.png
  7. 4 4
      utils/wxAuthorized.js

+ 1 - 1
App.vue

@@ -79,7 +79,7 @@ export default {
 @import '/static/css/cmy.css';
 uni-page-body{
 	min-height: 100%;
-	height: 0;
+	height: auto;
 }
 
 view,

+ 5 - 25
pages.json

@@ -18,13 +18,16 @@
 		{
 			"path": "pages/index/node",
 			"style": {
-				"navigationBarTitleText": "兑换"
+				"navigationBarTitleText": "节点",
+				"app-plus": {
+					"titleNView":false
+				}
 			}
 		},
 		{
 			"path": "pages/index/convert",
 			"style": {
-				"navigationBarTitleText": "节点"
+				"navigationBarTitleText": "兑换"
 			}
 		},
 		{
@@ -175,29 +178,6 @@
 			"style": {
 				// #ifndef MP-WEIXIN
 				"navigationStyle": "custom",
-				// "app-plus": {
-				// 	"bounce": "none",
-				// 	"titleNView": {
-				// 		"type": "transparent",
-				// 		"buttons": [{
-				// 				"fontSrc": "/static/yticon.ttf",
-				// 				"text": "\ue60f",
-				// 				"fontSize": "24",
-				// 				"color": "#303133",
-				// 				"width": "46px",
-				// 				"background": "rgba(0,0,0,0)"
-				// 			},
-				// 			{
-				// 				"fontSrc": "/static/yticon.ttf",
-				// 				"text": "\ue744",
-				// 				"fontSize": "28",
-				// 				"color": "#303133",
-				// 				"background": "rgba(0,0,0,0)",
-				// 				"redDot": true
-				// 			}
-				// 		]
-				// 	}
-				// },
 				// #endif
 				"navigationBarTitleText": "个人中心"
 			}

+ 211 - 6
pages/index/convert.vue

@@ -1,22 +1,227 @@
 <template>
 	<view class="center">
-		
-		
+		<view class="rateBox">
+			<view class="rateTitle">实时汇率</view>
+			<view class="rate">{{ exchange }}</view>
+		</view>
+		<view class="rateConetnt" v-if="lodingType">
+			<view class="titleBox flex">
+				<view class="leftTip"></view>
+				<view class="title">兑换币种</view>
+			</view>
+			<view class="content">
+				<view class="moneyText">兑出币种</view>
+				<view class="Type flex">
+					<image class="moneylogo" :src="moneyType[index].LOGO" mode="scaleToFill"></image>
+					<view class="moneyName clamp" @click="show = true">{{moneyType[index].name}}</view>
+					<u-icon name="arrow-down-fill" color="#0F253A" size="10"></u-icon>
+					<u-input :height="45" class="input" v-model="pushMoney" type="number" :border="false" placeholder="请输入需要兑换的数量" />
+				</view>
+				<view class="contentImg"><image class="img" src="../../static/img/tab.png" mode="scaleToFill"></image></view>
+				<view class="moneyText">兑入币种</view>
+				<view class="Type flex">
+					<image class="moneylogo" :src="add.LOGO" mode="scaleToFill"></image>
+					<view class="moneyName clamp">{{ add.name }}</view>
+					<view class="line"></view>
+					<view class="input">{{ moneyReta }}</view>
+				</view>
+			</view>
+		</view>
+		<view class="lsButtom" @click="buy()">确认兑换</view>
+		<u-action-sheet :list="moneyType" v-model="show" @click="changeIndex"></u-action-sheet>
 	</view>
 </template>
 <script>
+import { recharge, wallet, moneyType } from '@/api/finance.js';
 export default {
 	data() {
-		return {};
+		return {
+			index: 0, //当前选中的兑出币种
+			moneyType: [],
+			add: { LOGO: '', name: '' }, //兑入币种
+			pushMoney: '',
+			lodingType: false, //判断是否已经载入币种分类分类数据
+			show: false
+		};
+	},
+	computed: {
+		// 转换金额
+		moneyReta() {
+			// 保存当前选中的对象
+			const obj = this.moneyType[this.index];
+			return (this.pushMoney * +obj.usdt_price) / +this.add.usdt_price;
+		},
+		// 实时汇率
+		exchange() {
+			try {
+				const data = this.moneyType[this.index];
+				return 1 + data.name + '≈' + data.usdt_price / this.add.usdt_price + this.add.name;
+			} catch (e) {
+				console.log(e);
+				return '加载中...';
+			}
+		}
 	},
 	//页面加载即刻发生
-	onload() {},
-	methods: {}
+	onLoad() {
+		this.init();
+	},
+	methods: {
+		// 初始化页面
+		init() {
+			this.wallet();
+		},
+		// 弹出层选择事件
+		changeIndex(e){
+			console.log(e);
+			this.index = e;
+		},
+		// 加载币种分类
+		wallet() {
+			let that = this;
+			console.log('请求兑换');
+			uni.showLoading({
+				title: '载入数据中...',
+				mask: true
+			});
+			wallet()
+				.then(e => {
+					uni.hideLoading();
+					that.lodingType = true;
+					const moneyType = Object.keys(e.data.back);
+					moneyType.forEach(es => {
+						const data = e.data.back[es];
+						data.text = data.name;
+						if (+data.do_exchange == 1) {
+							that.moneyType.push(data);
+						}
+						if (+data.exchange == 1) {
+							that.add = data;
+							console.log(e.data.back[es], '555');
+						}
+					});
+					console.log(that.moneyType);
+					console.log(that.add, '兑入');
+				})
+				.catch(e => {
+					uni.hideLoading();
+					if (e.status != 410000) {
+						that.lodingType = true;
+						uni.showModal({
+							title: '错误',
+							content: '加载失败请刷新页面',
+							cancelText: '关闭',
+							confirmText: '刷新',
+							success: res => {
+								if (res.confirm) {
+									that.init();
+								}
+							}
+						});
+						console.log(e);
+					}
+				});
+		}
+	}
 };
 </script>
 <style lang="scss">
 .center {
-	height: 0;
 	min-height: 100%;
 }
+.lsButtom {
+	font-size: 30rpx;
+	background-image: $bg-green-gradual;
+	text-align: center;
+	color: $font-color-white;
+	padding: 30rpx 0;
+	border-radius: 99rpx;
+	margin: 20rpx 30rpx 0rpx 30rpx;
+	line-height: 1;
+}
+.rateBox {
+	padding: $page-row-spacing;
+	background-color: #ffffff;
+	.rateTitle {
+		font-size: 26rpx;
+		font-weight: 500;
+		color: $font-color-dark;
+	}
+	.rate {
+		margin-top: 10rpx;
+		font-size: 26rpx;
+		font-weight: 500;
+		color: $font-color-light;
+	}
+}
+.rateConetnt {
+	margin-top: 10rpx;
+	background-color: #ffffff;
+	line-height: 1;
+	padding-bottom: 60rpx;
+	.titleBox {
+		align-items: stretch;
+		justify-content: flex-start;
+		padding: $page-row-spacing;
+		border-bottom: 1px solid $border-color-light;
+		.leftTip {
+			width: 7rpx;
+			border-radius: 99rpx;
+			background-color: $base-color;
+		}
+		.title {
+			margin-left: 20rpx;
+			font-size: 30rpx;
+			font-weight: 500;
+			color: $font-color-dark;
+		}
+	}
+	.content {
+		.moneyText {
+			font-size: 24rpx;
+			font-weight: 500;
+			color: $font-color-dark;
+			padding: $page-row-spacing;
+		}
+		.Type {
+			padding: 0 $page-row-spacing;
+			.moneylogo {
+				width: 50rpx;
+				height: 50rpx;
+				border-radius: 99rpx;
+			}
+			.moneyName {
+				width: 180rpx;
+				font-size: 30rpx;
+				font-weight: 500;
+				color: $font-color-dark;
+				margin: 0 20rpx;
+			}
+			.input {
+				flex-grow: 1;
+				height: 45rpx;
+				line-height: 45rpx;
+				margin-left: 40rpx;
+				color: $font-color-light;
+				border-bottom: 1px solid $border-color-light;
+			}
+			.line {
+				width: 2rpx;
+				background-color: $font-color-dark;
+				margin: 0 10rpx;
+				height: 30rpx;
+			}
+		}
+		.contentImg {
+			width: 70rpx;
+			height: 70rpx;
+			margin: 40rpx auto 0;
+
+			.img {
+				width: 100%;
+				height: 100%;
+			}
+		}
+	}
+}
 </style>

+ 199 - 0
pages/index/index.vue

@@ -51,6 +51,7 @@
 				<view class="submit" @click="buy()">预购</view>
 			</view>
 		</view>
+<<<<<<< HEAD
 
 		<u-popup v-model="show" mode="bottom" border-radius="40" height="868rpx" :closeable="true">
 			<view class="yugo">
@@ -88,16 +89,24 @@
 					</view>
 				</view>
 		</u-popup>
+=======
+		<u-popup v-model="show" mode="bottom" border-radius="40" height="868rpx" :closeable="true" close-icon="关闭"><view>出淤泥而不染,濯清涟而不妖</view></u-popup>
+>>>>>>> 55401fd4b35f86aff3b25e611b15e4543f0fa312
 	</view>
 </template>
 <script>
 export default {
 	data() {
 		return {
+<<<<<<< HEAD
 			show: false, //支付数量弹窗控制
 			show1: false, //支付密码弹窗控制
 			value: 1,//购买数量
 			password:'',
+=======
+			show: false, //支付数量
+			show1: false //支付密码
+>>>>>>> 55401fd4b35f86aff3b25e611b15e4543f0fa312
 		};
 	},
 	//页面加载即刻发生
@@ -109,6 +118,7 @@ export default {
 			uni.navigateTo({
 				url: url
 			});
+<<<<<<< HEAD
 		},
 		async loadDate() {},
 		buy() {
@@ -124,6 +134,13 @@ export default {
 		cancel() {
 			this.show1 = false
 		},
+=======
+		},
+		async loadDate() {},
+		buy() {
+			this.show = true;
+		}
+>>>>>>> 55401fd4b35f86aff3b25e611b15e4543f0fa312
 	}
 };
 </script>
@@ -132,6 +149,7 @@ export default {
 	height: auto;
 	min-height: 100%;
 	background-color: #ffffff;
+<<<<<<< HEAD
 	padding-bottom: var(--window-bottom);
 	.box-title {
 		position: relative;
@@ -172,9 +190,52 @@ export default {
 						width: 100%;
 						height: 100%;
 					}
+=======
+}
+.box-title {
+	position: relative;
+	z-index: 1;
+	width: 100%;
+	height: 436rpx;
+
+	image {
+		width: 100%;
+		height: 436rpx;
+	}
+}
+
+.box-body {
+	display: flex;
+	flex-direction: column;
+	justify-content: space-around;
+	width: 100%;
+	height: 100%;
+	position: relative;
+	z-index: 10;
+	margin-top: -40rpx;
+	border-top-left-radius: 40rpx;
+	border-top-right-radius: 40rpx;
+	background: #f8fbfe;
+
+	.navBox {
+		display: flex;
+
+		justify-content: space-around;
+
+		.navBox-left {
+			// margin: 20rpx 5rpx 10rpx 10rpx;
+			margin: 20rpx -24rpx 0 0;
+
+			mar .navBox-item {
+				image {
+					width: 100%;
+					height: 100%;
+>>>>>>> 55401fd4b35f86aff3b25e611b15e4543f0fa312
 				}
 			}
+		}
 
+<<<<<<< HEAD
 			.navBox-right {
 				margin: 20rpx 0 0 -24rpx;
 
@@ -210,8 +271,24 @@ export default {
 				image {
 					height: 46rpx;
 					width: 48rpx;
+=======
+		.navBox-right {
+			margin: 20rpx 0 0 -24rpx;
+
+			// margin: 20rpx 10rpx 5rpx 5rpx;
+			.navBox-item {
+				display: flex;
+				flex-direction: column;
+				align-items: center;
+
+				image {
+>>>>>>> 55401fd4b35f86aff3b25e611b15e4543f0fa312
 				}
+			}
+		}
+	}
 
+<<<<<<< HEAD
 				#one {
 					font-size: 34rpx;
 					font-family: PingFang SC;
@@ -280,6 +357,77 @@ export default {
 				}
 
 				.forward-right {
+=======
+	.shopBox {
+		padding: 0 30rpx;
+		margin-top: 45rpx;
+		width: 690rpx;
+		// height: 770rpx;
+		background: #ffffff;
+		box-shadow: 0rpx 0rpx 17rpx 0rpx rgba(0, 0, 0, 0.05);
+		border-radius: 10px;
+		margin: 0 auto;
+
+		.shopBox-top {
+			margin-top: 26rpx;
+
+			display: flex;
+			justify-content: space-between;
+			align-items: center;
+
+			image {
+				height: 46rpx;
+				width: 48rpx;
+			}
+
+			#one {
+				font-size: 34rpx;
+				font-family: PingFang SC;
+				font-weight: bold;
+				color: #0f253a;
+			}
+
+			#two {
+				margin-left: 11rpx;
+				font-size: 26rpx;
+				font-family: PingFang SC;
+				font-weight: 500;
+				color: #6d7c88;
+			}
+
+			#three {
+				font-size: 26rpx;
+				font-family: PingFang SC;
+				font-weight: 500;
+				color: #ff4c4c;
+			}
+		}
+
+		.shopBox-between {
+			margin-top: 20rpx;
+			display: flex;
+			justify-content: space-between;
+			align-items: center;
+
+			.number {
+				.number-left {
+					font-size: 40rpx;
+					font-family: PingFang SC;
+					font-weight: bold;
+					color: #44969d;
+				}
+
+				.number-right {
+					font-size: 24rpx;
+					font-family: PingFang SC;
+					font-weight: bold;
+					color: #44969d;
+				}
+			}
+
+			.quotient {
+				.quotient-children {
+>>>>>>> 55401fd4b35f86aff3b25e611b15e4543f0fa312
 					font-size: 24rpx;
 					font-family: PingFang SC;
 					font-weight: 500;
@@ -409,5 +557,56 @@ export default {
 		.psw-qd {
 			color:#45969B;
 		}
+
+		.forward {
+			display: flex;
+			justify-content: space-between;
+			align-items: center;
+
+			.forward-left {
+				font-size: 26rpx;
+				font-family: PingFang SC;
+				font-weight: 500;
+				color: #44969d;
+			}
+
+			.forward-right {
+				font-size: 24rpx;
+				font-family: PingFang SC;
+				font-weight: 500;
+				color: #6d7c88;
+			}
+		}
+		.consume,
+		.appointmentTime,
+		.lotteryTime {
+			margin: 12rpx 0;
+			font-size: 26rpx;
+			font-family: PingFang SC;
+			font-weight: 400;
+			color: #6d7c88;
+		}
+		.consume > text,
+		.appointmentTime > text,
+		.lotteryTime > text {
+			font-size: 10rpx;
+			font-family: PingFang SC;
+			font-weight: 500;
+			color: #000000;
+		}
+		.submit {
+			width: 600rpx;
+			height: 70rpx;
+			background: linear-gradient(90deg, #60bab0, #45969b);
+			border-radius: 35rpx;
+			font-size: 32rpx;
+			font-family: PingFang SC;
+			font-weight: 500;
+			color: #ffffff;
+			text-align: center;
+			line-height: 70rpx;
+			margin: 40rpx auto;
+		}
 	}
+}
 </style>

+ 66 - 31
pages/index/node.vue

@@ -59,7 +59,7 @@
 								<view class="name1">{{ ls.name }}</view>
 								<view class="title1">{{ ls.mask }}</view>
 								<view class="title1">
-									认购份额:{{ls.allMoney+ls.type}}
+									认购份额:{{ ls.allMoney + ls.type }}
 									<text></text>
 								</view>
 							</view>
@@ -69,15 +69,15 @@
 				</scroll-view>
 			</swiper-item>
 		</swiper>
-		<u-popup v-model="show" mode="center" width="548rpx"  border-radius="14">
-				<view class="psw-wrapper">
-					<view class="psw-title">请输入支付密码</view>
-					<input type="password" v-model="password" class="psw-ipt"/>
-					<view class="psw-btn">
-						<text @click="cancel">取消</text>
-						<text class="psw-qd" @click="pswQd">确定</text>
-					</view>
+		<u-popup v-model="show" mode="center" width="548rpx" border-radius="14">
+			<view class="psw-wrapper">
+				<view class="psw-title">请输入支付密码</view>
+				<input type="password" v-model="password" class="psw-ipt" />
+				<view class="psw-btn">
+					<text @click="cancel">取消</text>
+					<text class="psw-qd" @click="pswQd">确定</text>
 				</view>
+			</view>
 		</u-popup>
 	</view>
 </template>
@@ -86,7 +86,7 @@ export default {
 	data() {
 		return {
 			show: false,
-			password:'',
+			password: '',
 			current: 0, //当前选中的标签
 			tabList: [
 				{
@@ -115,29 +115,29 @@ export default {
 							name: '节点认购第一期',
 							num: 1000, //认购份额
 							type: 'LALA', //认购货币类型
-							allMoney: 20 ,//认购总额
-							mask:'当前第六关'
+							allMoney: 20, //认购总额
+							mask: '当前第六关'
 						},
 						{
 							name: '节点认购第一期',
 							num: 1000, //认购份额
 							type: 'LALA', //认购货币类型
-							allMoney: 20 ,//认购总额
-							mask:'当前第六关'
+							allMoney: 20, //认购总额
+							mask: '当前第六关'
 						},
 						{
 							name: '节点认购第一期',
 							num: 1000, //认购份额
 							type: 'LALA', //认购货币类型
-							allMoney: 20 ,//认购总额
-							mask:'当前第六关'
+							allMoney: 20, //认购总额
+							mask: '当前第六关'
 						},
 						{
 							name: '节点认购第一期',
 							num: 1000, //认购份额
 							type: 'LALA', //认购货币类型
-							allMoney: 20 ,//认购总额
-							mask:'当前第六关'
+							allMoney: 20, //认购总额
+							mask: '当前第六关'
 						}
 					],
 					loding: 'loadmore' //loading加载中 nomore没有数据
@@ -166,16 +166,19 @@ export default {
 		onreachBottom(e) {
 			console.log(e);
 		},
-		buy(){
+		buy() {
 			this.show = true;
 		},
 		cancel() {
-			this.show = false
-		},
+			this.show = false;
+		}
 	}
 };
 </script>
 <style lang="scss">
+page {
+	height: 100%;
+}
 .tabBox {
 	flex-grow: 1;
 }
@@ -244,44 +247,45 @@ export default {
 					margin: 20rpx 30rpx 0rpx 30rpx;
 				}
 			}
-			.item1:nth-child(odd){
+			.item1:nth-child(odd) {
 				margin-right: 30rpx;
 			}
 			.item1 {
 				line-height: 1;
 				background: url(../../static/img/rengouBg.png) no-repeat;
 				background-position: right bottom;
-				background-size: 140rpx 115rpx ;
+				background-size: 140rpx 115rpx;
 				flex-grow: 1;
 				min-width: 40%;
 				margin-bottom: 30rpx;
 				border-radius: 15rpx;
-				background-color: #FFFFFF;
+				background-color: #ffffff;
 				border: 1px solid $uni-color-primary;
 				padding: 15rpx 10rpx 35rpx 30rpx;
-				.ls1{
+				.ls1 {
 					font-weight: bold;
-					.name1{
+					.name1 {
 						color: $font-color-dark;
 						font-size: $font-base;
 						margin-top: -10rpx;
 					}
-					.title1{
+					.title1 {
 						margin-top: 15rpx;
 						color: $font-color-light;
 						font-size: 22rpx;
 					}
 				}
-				.rightTip{
-				  color:$uni-color-primary ;
-				  text-align: right;
-				  font-size: 24rpx;
+				.rightTip {
+					color: $uni-color-primary;
+					text-align: right;
+					font-size: 24rpx;
 				}
 			}
 		}
 	}
 }
 .psw-wrapper {
+<<<<<<< HEAD
 		width: 548rpx;
 		height: 344rpx;
 		background-color: #FFFFFF;
@@ -311,5 +315,36 @@ export default {
 		.psw-qd {
 			color:#45969B;
 		}
+=======
+	width: 548rpx;
+	height: 344rpx;
+	background-color: #ffffff;
+	.psw-title {
+		width: 100%;
+		font-size: 35rpx;
+		padding: 43rpx 0 49rpx;
+		text-align: center;
+		font-weight: 800;
+>>>>>>> 55401fd4b35f86aff3b25e611b15e4543f0fa312
+	}
+	.psw-ipt {
+		display: block;
+		background-color: #dce3ed;
+		height: 90rpx;
+		width: 464rpx;
+		padding-left: 30rpx;
+		margin: 0 auto;
+		font-size: 80rpx;
 	}
+	.psw-btn text {
+		display: inline-block;
+		text-align: center;
+		width: 50%;
+		padding-top: 29rpx;
+		font-size: 35rpx;
+	}
+	.psw-qd {
+		color: #5771df;
+	}
+}
 </style>

BIN=BIN
static/img/tab.png


+ 4 - 4
utils/wxAuthorized.js

@@ -224,19 +224,19 @@ function shareFun(config) {
 export function setRouter(route) {
 	return new Promise((ok, err) => {
 		router = getApp().$router;
-		console.log(router,'开始数据');
+		// console.log(router,'开始数据');
 		if (!router) {
 			const set = setInterval(() => {
 				router = getApp().$router;
-				console.log(router,'返回数据');
+				// console.log(router,'返回数据');
 				if (router) {
-					console.log(router,'结束');
+					// console.log(router,'结束');
 					clearInterval(set)
 					ok(router)
 				}
 			}, 100);
 		}else{
-			console.log(router,'成功');
+			// console.log(router,'成功');
 			ok(router)
 		}
 	})