hwq 4 years ago
parent
commit
bb35c587e0
6 changed files with 699 additions and 11 deletions
  1. 1 1
      main.js
  2. 1 1
      manifest.json
  3. 532 0
      pages/assets/details.vue
  4. 112 6
      pages/assets/recharge.vue
  5. 52 2
      pages/index/node.vue
  6. 1 1
      pages/user/user.vue

+ 1 - 1
main.js

@@ -6,7 +6,7 @@ import uView from "uview-ui";
 Vue.use(uView);
 Vue.use(uView);
 
 
 Vue.config.productionTip = false
 Vue.config.productionTip = false
-
+Vue.prototype.$store = store;
 App.mpType = 'app'
 App.mpType = 'app'
 
 
 const app = new Vue({
 const app = new Vue({

+ 1 - 1
manifest.json

@@ -73,7 +73,7 @@
         "devServer" : {
         "devServer" : {
             "proxy" : {
             "proxy" : {
                 "/api" : {
                 "/api" : {
-                    "target" : "http://zccy.frp.liuniu946.com",
+                    "target" : "http://kp.liuniu946.com",
                     // "changeOrigin": true,
                     // "changeOrigin": true,
                     "pathRewrite" : {
                     "pathRewrite" : {
                         "/api" : "" // rewrite path
                         "/api" : "" // rewrite path

+ 532 - 0
pages/assets/details.vue

@@ -0,0 +1,532 @@
+<template>
+	<view class="container">
+		<view class="logo"><image :src="logo"></image></view>
+		<view class="select-box flex_item">
+			<view @tap="handleTap('picker')">{{ title }}</view>
+			<lb-picker
+				ref="picker"
+				v-model="value"
+				mode="selector"
+				:list="typeList"
+				:dataset="{ name: 'type' }"
+				@change="handleChange"
+				@confirm="handleConfirm"
+				@cancel="handleCancel"
+			></lb-picker>
+			<image src="../../static/img/img37.png"></image>
+		</view>
+		<view class="list" v-show="list.length > 0">
+			<view class="list-box" v-for="(ls, index) in list" :key="index" @click="nav(index)">
+				<view class="flex">
+					<view class="list-tpl flex_item">
+						<image src="../../static/img/img36.png"></image>
+						<view class="tpl-name">{{ ls.title }}</view>
+					</view>
+					<view class="num clamp" v-if="ls.pm === 0">- {{ ls.number }}</view>
+					<view class="num clamp" v-else>+ {{ ls.number }}</view>
+				</view>
+				<view class="tpl-time">{{ ls.add_time }}</view>
+			</view>
+		</view>
+		<view class="empty-box" v-show="list.length == 0"><empty></empty></view>
+		<view class="flex submit-box">
+			<view class="submit" @click="recharge">充币</view>
+			<view class="tip"></view>
+			<view class="submit" @click="withdraw">提币</view>
+		</view>
+		<uni-popup ref="popup" type="center">
+			<view class="popup">
+				<view class="cancel flex" @click="close">
+					<view></view>
+					<view class="tip">x</view>
+				</view>
+				<view class="list-boxs">
+					<view class="popup-text">购买数量:</view>
+					<view class="password"><input type="number" v-model="num" placeholder="请输入算力数量" /></view>
+					<view class="popup-text">币种选择:</view>
+					<view class="content" @click="useOutClickSide"><easy-select ref="easySelect" :options="moneyTypeList" :value="name" @selectOne="selectOne"></easy-select></view>
+					<view class="confirm-btn" @click="pay"><text>确认充币</text></view>
+				</view>
+			</view>
+		</uni-popup>
+		<uni-popup ref="mation" type="center">
+			<view class="popup">
+				<view class="cancel flex" @click="close2"><view class="tip">x</view></view>
+				<view class="list-boxs">
+					<view class="textBox flex">
+						<view class="font">交易前:</view>
+						<view class="number">{{ before * 1 }} {{ code }}</view>
+					</view>
+					<view class="xian"></view>
+					<view class="textBox flex">
+						<view class="font">交易额:</view>
+						<view class="number">{{ pm }}{{ number * 1 }} {{ code }}</view>
+					</view>
+					<view class="xian"></view>
+					<view class="textBox flex">
+						<view class="font">交易后:</view>
+						<view class="number">{{ balance * 1 }} {{ code }}</view>
+					</view>
+					<view class="xian"></view>
+					<scroll-view scroll-y="true" class="textBox">
+						<view class="font">流水详情:</view>
+						<view class="text">{{ text }}</view>
+					</scroll-view>
+				</view>
+			</view>
+		</uni-popup>
+	</view>
+</template>
+<script>
+import { moneyLog, recharge } from '@/api/finance.js';
+import { moneyType } from '@/api/index.js';
+import LbPicker from '@/components/lb-picker';
+import empty from '@/components/empty';
+export default {
+	components: {
+		LbPicker,
+		empty
+	},
+	data() {
+		return {
+			code: '',
+			title: '筛选',
+			type: '',
+			value: '',
+			index: 0,
+			typeList: [],
+			list: '',
+			num: '',
+			moneyTypeList: [],
+			money: '',
+			name: '',
+			logo: '',
+			price: '',
+			mark: '',
+			charge: 0,
+
+			_address_qr: '',
+			__money_address: '',
+			ids: '',
+			keysAddr: '',
+			text: '',
+			balance: '',
+			before: '',
+			number: '',
+			pm: '',
+			way: [],
+			address: '',
+			waypath: '',
+			less: '',
+			page: 1,
+			limit: 5,
+			isLast: true
+		};
+	},
+	onLoad(option) {
+		console.log(option, 'detail-option');
+		this.waypath = option.waypath;
+		console.log(this.waypath, '+++++++++++++++++++++');
+		this.way = option.way;
+		console.log('detail', this.way);
+		this.code = option.code;
+		this.logo = option.logo;
+		this.name = option.name;
+		this.price = option.price;
+		this.charge = option.charge;
+		this.address = option.address;
+		console.log(this.address, 'detail');
+		this._address_qr = option._address_qr;
+		this.__money_address = option.__money_address;
+		this.mark = option.mark;
+		this.ids = option.ids;
+		this.keysAddr = option.keysAddr;
+		this.moneyType();
+		this.loadData();
+	},
+	onShow() {},
+	methods: {
+		async loadData() {
+			let obj = this;
+			moneyLog(
+				{
+					page: 1,
+					limit: 10000,
+					type: obj.type
+				},
+				obj.code
+			).then(({ data }) => {
+				obj.typeList = data.type_list;
+				obj.list = data.list;
+				console.log(obj.list);
+			});
+		},
+		// 所有币种
+		async moneyType() {
+			let obj = this;
+			moneyType({}).then(({ data }) => {
+				obj.moneyTypeList = data;
+			});
+		},
+		pay() {
+			let obj = this;
+			recharge(
+				{
+					num: obj.num,
+					money_type: obj.code
+				},
+				obj.buyId
+			)
+				.then(({ data }) => {
+					obj.$api.msg(data.msg);
+					obj.$refs.popup.close();
+					obj.num = '';
+					obj.code = '';
+					uni.navigateTo({
+						url: '/pages/finance/recharge?LOGO=' + data._address_qr + '&order_id=' + data.order_id + '&ddress=' + data.__money_address + '&id=' + data.id
+					});
+				})
+				.catch(e => {
+					obj.$refs.popup.close();
+				});
+		},
+		selectOne(options) {
+			this.name = options.name;
+			this.code = options.code;
+		},
+		useOutClickSide() {
+			this.$refs.easySelect.hideOptions && this.$refs.easySelect.hideOptions();
+		},
+		handleTap(name) {
+			this.$refs[name].show();
+		},
+		handleChange(e) {
+			// this.title = e.item.title;
+			// this.type = e.item.type;
+		},
+		handleConfirm(e) {
+			this.title = e.item.title;
+			this.type = e.item.type;
+			this.loadData();
+		},
+		handleCancel(e) {},
+		recharge() {
+			let url = '/pages/finance/recharge?logo=' +
+					this.logo +
+					'&name=' +
+					this.name +
+					'&code=' +
+					this.code +
+					'&_address_qr=' +
+					this._address_qr +
+					'&__money_address=' +
+					this.__money_address +
+					'&mark=' +
+					this.mark +
+					'&ids=' +
+					this.ids +
+					'&keysAddr=' +
+					this.keysAddr +
+					'&charge=' +
+					this.charge +
+					'&address=' +
+					this.address +
+					'&way=' +
+					this.way +
+					'&waypath=' +
+					this.waypath
+			if(this.code === 'FIL') {
+				console.log("555555555")
+				url='/pages/finance/recharge'
+			}
+			uni.navigateTo({
+				url:url
+					// '/pages/finance/recharge?logo=' +
+					// this.logo +
+					// '&name=' +
+					// this.name +
+					// '&code=' +
+					// this.code +
+					// '&_address_qr=' +
+					// this._address_qr +
+					// '&__money_address=' +
+					// this.__money_address +
+					// '&mark=' +
+					// this.mark +
+					// '&ids=' +
+					// this.ids +
+					// '&keysAddr=' +
+					// this.keysAddr +
+					// '&charge=' +
+					// this.charge +
+					// '&address=' +
+					// this.address +
+					// '&way=' +
+					// this.way +
+					// '&waypath=' +
+					// this.waypath
+			});
+			// this.$refs.popup.open();
+		},
+		close() {
+			this.$refs.popup.close();
+		},
+		withdraw() {
+			uni.navigateTo({
+				url: '/pages/finance/withdraw?logo=' + this.logo + '&name=' + this.name + '&code=' + this.code + '&money=' + this.price
+			});
+		},
+		navTo(url) {
+			uni.navigateTo({
+				url
+			});
+		},
+		nav(index) {
+			const obj = this;
+			obj.text = obj.list[index].mark;
+			obj.balance = obj.list[index].balance;
+			obj.number = obj.list[index].number;
+			if (obj.list[index].pm == 1) {
+				obj.pm = '+';
+
+				obj.before = obj.subNum(obj.balance, obj.number);
+			} else {
+				obj.pm = '-';
+				obj.before = this.addNum(obj.balance, obj.number);
+			}
+			this.$refs.mation.open();
+		},
+		addNum(num1, num2) {
+			let sq1, sq2, multiple;
+			try {
+				sq1 = num1.toString().split('.')[1].length;
+			} catch (e) {
+				sq1 = 0;
+			}
+			try {
+				sq2 = num2.toString().split('.')[1].length;
+			} catch (e) {
+				sq2 = 0;
+			}
+			multiple = Math.pow(10, Math.max(sq1, sq2) + 1);
+			return (num1 * multiple + num2 * multiple) / multiple;
+		},
+		close2() {
+			this.$refs.mation.close();
+		},
+		subNum(num1, num2) {
+			let sq1, sq2, multiple;
+			try {
+				sq1 = num1.toString().split('.')[1].length;
+			} catch (e) {
+				sq1 = 0;
+			}
+			try {
+				sq2 = num2.toString().split('.')[1].length;
+			} catch (e) {
+				sq2 = 0;
+			}
+			multiple = Math.pow(10, Math.max(sq1, sq2) + 1);
+			return (num1 * multiple - num2 * multiple) / multiple;
+		}
+	}
+};
+</script>
+
+<style lang="scss">
+page {
+	min-height: 100%;
+	background-color: #ffffff;
+
+	.container {
+		width: 100%;
+		padding: 60rpx 30rpx 120rpx 30rpx;
+	}
+}
+
+.logo {
+	text-align: center;
+
+	image {
+		width: 119rpx;
+		height: 119rpx;
+	}
+}
+
+.select-box {
+	position: absolute;
+	right: 0;
+	padding: 30rpx 30rpx;
+	font-size: 32rpx;
+	font-weight: 500;
+	color: #333333;
+
+	image {
+		width: 21rpx;
+		height: 11rpx;
+		margin-left: 15rpx;
+	}
+
+	.select-name {
+		padding-right: 15rpx;
+	}
+}
+
+.list {
+	margin-top: 120rpx;
+}
+
+.list-box {
+	padding: 60rpx 0rpx 30rpx 0rpx;
+	font-size: 30rpx;
+	font-weight: 400;
+	color: #333333;
+	.tpl-time {
+		font-size: 24rpx;
+		font-weight: 400;
+		color: #999999;
+		width: 100%;
+		text-align: right;
+		padding-top: 25rpx;
+	}
+	.list-tpl {
+		image {
+			width: 39rpx;
+			height: 43rpx;
+		}
+		.tpl-name {
+			padding: 0rpx 15rpx 0rpx 30rpx;
+		}
+	}
+	.num {
+		font-size: 36rpx;
+		font-weight: 400;
+		color: #fb3a2f;
+		width: 50%;
+		text-align: right;
+	}
+}
+.empty-box {
+	width: 100%;
+	height: 500rpx;
+	padding-top: 200rpx;
+}
+.submit-box {
+	position: fixed;
+	bottom: 0;
+	left: 0;
+	width: 100%;
+	background-color: #5771df;
+	color: #ffffff;
+
+	.submit {
+		padding: 20rpx 20%;
+	}
+
+	.tip {
+		width: 2rpx;
+		height: 37rpx;
+		background: #ffffff;
+	}
+}
+//弹窗
+.popup {
+	background-color: #ffffff;
+	border-radius: 25rpx;
+	font-size: 30rpx;
+	.cancel {
+		text-align: center;
+		width: 100%;
+		line-height: 60rpx;
+		.tip {
+			background-color: #5771df;
+			color: #ffffff;
+			width: 70rpx;
+			height: 70rpx;
+			border-top-right-radius: 25rpx;
+		}
+	}
+	.list-boxs {
+		padding: 0rpx 80rpx;
+		.password {
+			padding: 50rpx 0rpx;
+			width: 100%;
+			input {
+				width: 70%;
+				height: 80rpx;
+				border: 2rpx solid #999999;
+				padding-left: 25rpx;
+				box-shadow: 0px 3px 5px 0px rgba(0, 0, 0, 0.27);
+				border-radius: 11rpx;
+			}
+		}
+		.confirm-btn {
+			padding-bottom: 120rpx;
+			padding-top: 30rpx;
+			text {
+				background-color: #5771df;
+				color: #ffffff;
+				width: 70%;
+				text-align: center;
+				padding: 25rpx 90rpx;
+				border-radius: 15rpx;
+			}
+		}
+	}
+}
+.popup {
+	height: 618rpx;
+	background: #ffffff;
+	box-shadow: 3rpx 3rpx 6rpx 0rpx rgba(31, 31, 31, 0.17);
+	border-radius: 40rpx;
+	width: 700rpx;
+	.cancel {
+		text-align: center;
+		width: 100%;
+		line-height: 60rpx;
+		position: relative;
+		.tip {
+			color: #000000;
+			width: 70rpx;
+			height: 70rpx;
+			position: absolute;
+			top: 0;
+			right: 0;
+			background-color: #fff;
+		}
+	}
+	.list-boxs {
+		width: 90%;
+		margin: 0 auto;
+		margin-top: 100rpx;
+
+		.textBox {
+			padding: 24rpx 18rpx;
+			.font {
+				font-size: 28rpx;
+				font-family: PingFang SC;
+				font-weight: bold;
+				color: #4f4f4f;
+			}
+			.number {
+				font-size: 28rpx;
+				font-family: PingFang SC;
+				font-weight: bold;
+				color: #fb3a2f;
+			}
+			.text {
+				text-indent: 2em;
+				font-size: 28rpx;
+				font-family: PingFang SC;
+				font-weight: bold;
+				color: #4f4f4f;
+			}
+		}
+		.xian {
+			width: 100%;
+			height: 1px;
+			background: #e7dfe8;
+		}
+	}
+}
+</style>

+ 112 - 6
pages/assets/recharge.vue

@@ -1,6 +1,45 @@
 <template>
 <template>
 	<view class="center">
 	<view class="center">
-		
+		<view class="top">
+			<view class="title flex">
+				<view class="xian"></view>
+				<view class="title-font">
+					充币二维码
+				</view>
+			</view>
+			<view class="erweima-box">
+				<view class="erweima-font">
+					请转入USDT
+				</view>
+				<view class="erweima">
+					<image src="" mode=""></image>
+				</view>
+			</view>
+			<view class="btn">
+				保存二维码
+			</view>
+		</view>
+		<view class="top">
+			<view class="title flex">
+				<view class="xian"></view>
+				<view class="title-font">
+					充币地址
+				</view>
+			</view>
+			<view class="address">
+				0XJDKHGHDHFH3773HWEHG
+			</view>
+			<view class="btn" style="margin-top: 50rpx;">
+				复制充币地址
+			</view>
+		</view>
+		<view class="top info">
+			请勿向上述地址充值人任何非USDT资产,否则资产将不可追回。<br>
+			USDT冲币仅支持ERC2.0以太坊上的资产,其他USDT将无法上帐,请您谅解。<br>
+			您充值至上述地址后,需要整个网络节点确认,1次网络确认后到账,2次网络确认后即可提币。<br>
+			最小充值金额:100USDT,小于最小金额的充值将不会上帐且无法退回。<br>
+			请通过IMTOKEN充值,充值时在备注栏填写 个人的用户ID,如果用户ID错误,将导致您无法入账,请注意确认。
+		</view>
 	</view>
 	</view>
 </template>
 </template>
 
 
@@ -11,9 +50,7 @@ export default {
 		}
 		}
 	},
 	},
 	methods:{
 	methods:{
-		nav(e) {
-			
-		},
+		
 	}
 	}
 }
 }
 </script>
 </script>
@@ -21,7 +58,76 @@ export default {
 <style lang="scss">
 <style lang="scss">
 .center,page {
 .center,page {
 	height: 100%;
 	height: 100%;
-	background: #F7FBFE;
+	background: #F3F3F3;
+}
+.top:first-child {
+	margin-top: 0;
+}
+.top {
+	margin-top: 20rpx;
+	width: 100%;
+	height: auto;
+	background: #FFFFFF;
+	padding: 26rpx 30rpx 50rpx;
+	.erweima-box {
+		margin-top: 77rpx ;
+		.erweima-font {
+			text-align: center;
+			font-size: 30rpx;
+			font-family: PingFang SC;
+			font-weight: bold;
+			color: #333333;
+		}
+		.erweima {
+			margin: 16rpx auto 0;
+			width: 188rpx;
+			height: 188rpx;
+			background: #00BCD4;
+			image {
+				width: 100%;
+				height: 100%;
+			}
+		}
+	}
+	.address {
+		margin-top: 86rpx;
+		text-align: center;
+	}
+}
+.title {
+	justify-content: flex-start;
+	align-items: center;
+	.xian {
+		width: 2rpx;
+		height: 30rpx;
+		background: linear-gradient(90deg, #F95B2F, #60BAB0, #45969B);
+	}
+	.title-font {
+		padding-left: 16rpx;
+		font-size: 30rpx;
+		font-family: PingFang SC;
+		font-weight: bold;
+		color: #333333;
+	}
+}
+.btn{
+	margin: 36rpx auto 0;
+	width: 500rpx;
+	height: 60rpx;
+	background: linear-gradient(90deg, #60BAB0, #60BAB0, #45969B);
+	border-radius: 30px;
+	line-height: 60rpx;
+	text-align: center;
+	font-size: 26rpx;
+	font-family: PingFang SC;
+	font-weight: 500;
+	color: #FFFFFF;
+}
+.info {
+	font-size: 24rpx;
+	font-family: PingFang SC;
+	font-weight: 500;
+	color: #333333;
+	line-height: 42rpx;
 }
 }
-
 </style>
 </style>

+ 52 - 2
pages/index/node.vue

@@ -45,7 +45,7 @@
 								<text class="text">{{ ls.allMoney + ls.moneyType }}</text>
 								<text class="text">{{ ls.allMoney + ls.moneyType }}</text>
 							</view>
 							</view>
 						</view>
 						</view>
-						<view class="lsButtom">立即认购</view>
+						<view class="lsButtom" @click="buy()">立即认购</view>
 					</view>
 					</view>
 					<u-loadmore :status="tabList[0].loding"></u-loadmore>
 					<u-loadmore :status="tabList[0].loding"></u-loadmore>
 				</scroll-view>
 				</scroll-view>
@@ -69,12 +69,24 @@
 				</scroll-view>
 				</scroll-view>
 			</swiper-item>
 			</swiper-item>
 		</swiper>
 		</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>
+				</view>
+		</u-popup>
 	</view>
 	</view>
 </template>
 </template>
 <script>
 <script>
 export default {
 export default {
 	data() {
 	data() {
 		return {
 		return {
+			show: false,
+			password:'',
 			current: 0, //当前选中的标签
 			current: 0, //当前选中的标签
 			tabList: [
 			tabList: [
 				{
 				{
@@ -144,6 +156,7 @@ export default {
 		// 内容框切换事件
 		// 内容框切换事件
 		transition(e) {
 		transition(e) {
 			console.log(e);
 			console.log(e);
+			this.current = e.detail.current;
 		},
 		},
 		// tab切换事件
 		// tab切换事件
 		tabsChange(e) {
 		tabsChange(e) {
@@ -152,7 +165,13 @@ export default {
 		// 下拉到底部加载事件
 		// 下拉到底部加载事件
 		onreachBottom(e) {
 		onreachBottom(e) {
 			console.log(e);
 			console.log(e);
-		}
+		},
+		buy(){
+			this.show = true;
+		},
+		cancel() {
+			this.show = false
+		},
 	}
 	}
 };
 };
 </script>
 </script>
@@ -259,4 +278,35 @@ export default {
 		}
 		}
 	}
 	}
 }
 }
+.psw-wrapper {
+		width: 548rpx;
+		height: 344rpx;
+		background-color: #FFFFFF;
+		.psw-title {
+			width: 100%;
+			font-size: 35rpx;
+			padding: 43rpx 0 49rpx;
+			text-align: center;
+			font-weight: 800;
+		}
+		.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>
 </style>

+ 1 - 1
pages/user/user.vue

@@ -47,7 +47,7 @@
 				</view>
 				</view>
 			</view>
 			</view>
 		</view>
 		</view>
-		<!-- 申请退款弹窗 -->
+		
 		<uni-popup ref="popup" type="center">
 		<uni-popup ref="popup" type="center">
 			<view class="popup">
 			<view class="popup">
 				<view class="popup-dox">
 				<view class="popup-dox">