Kaynağa Gözat

Merge branch 'master' of http://git.liuniu946.com/cmy/NFT

cmy 3 yıl önce
ebeveyn
işleme
5ac6239129

+ 120 - 0
api/finance.js

@@ -0,0 +1,120 @@
+
+import request from '@/utils/request'
+import {upFilse} from '@/utils/request'
+
+export function recharge(data) {
+	return request({
+		url: '/api/recharge/money',
+		method: 'post',
+		data
+	});
+}
+//上传图片
+export function upload(data) {
+	return upFilse({
+		url: '/api/upload/image',
+		method: 'post',
+		data
+	});
+}
+
+export function money(data,id) {
+	return request({
+		url: '/api/recharge/money/'+id,
+		method: 'post',
+		data
+	});
+}
+export function wallet(data) {
+	return request({
+		url: '/api/wallet',
+		method: 'get',
+		data
+	});
+}
+export function moneyLog(data,code) {
+	return request({
+		url: '/api/money/log/'+code,
+		method: 'get',
+		data
+	});
+}
+export function cash(data) {
+	return request({
+		url: '/api/extract/cash',
+		method: 'POST',
+		data
+	});
+}
+export function spread(data) {
+	return request({
+		url: '/api/spread/people',
+		method: 'POST',
+		data
+	});
+}
+
+export function goPay(data) {
+	return request({
+		url: '/api/trade/go_pay',
+		method: 'POST',
+		data
+	});
+}
+export function trade(data) {
+	return request({
+		url: '/api/trade/money_type',
+		method: 'get',
+		data
+	});
+}
+export function cashmoney_type(data) {
+	return request({
+		url: '/api/cash/money_type',
+		method: 'get',
+		data
+	});
+}
+export function calculator(data) {
+	return request({
+		url: '/api/extract/calculator',
+		method: 'post',
+		data
+	});
+}
+export function edit(data,id) {
+	return request({
+		url: '/api/wallet/address/edit/'+id,
+		method: 'post',
+		data
+	});
+}
+export function miner(data) {
+	return request({
+		url: '/api/spread/people/all',
+		method: 'post',
+		data
+	})
+}
+export function newMining(data) {
+	return request({
+		url: '/api/new_mining',
+		method: 'get',
+		data
+	})
+}
+//提币记录
+export function tbjl(data) {
+	return request({
+		url: '/api/extract/list',
+		method: 'get',
+		data
+	})
+}
+export function moneyType(data) {
+	return request({
+		url: '/api/all/money_type',
+		method: 'get',
+		data
+	});
+}

+ 229 - 0
components/easy-select/easy-select.vue

@@ -0,0 +1,229 @@
+<template>
+	<view class="easy-select" @click.stop="trigger" :style="[easySelectSize]">
+		<input type="text" v-model="value" :placeholder="placeholder" disabled clearable>
+		<!-- <view class="easy-select-suffix" :style="{border: '1px solid rgba(0,0,0,0)'}" :class="[showSuffix]">
+			<view class="easy-select-down-tag"></view>
+		</view> -->
+		<view class="easy-select-options" v-if="showOptions" :style="{'min-width': boundingClientRect.width + 'px', top: optionsGroupTop, margin: optionsGroupMargin}">
+			<view class="easy-select-options-item" v-for="item in options" :key="item.code" @click.stop="select(item)" :class="{active: currentSelect.name === item.name}">
+				<text>{{item.name}}</text>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	/**
+	 * easy-select
+	 * @author Snoop zhang
+	 * @description Select Component
+	 * */
+	const COMPONENT_NAME = 'easy-select'
+	const MAX_OPTIONS_HEIGHT = 137 // 修改务必也修改easy-select-options的css部分
+	const OPTIONS_ITEM_HEIGHT = 33 // 修改务必也修改easy-select-options-item的css部分
+	const OPTIONS_MARGIN = 10
+	const OPTIONS_PADDING = 6 * 2 + 2 // + 2是border
+	const OPTIONS_OTHER_HEIGHT = OPTIONS_MARGIN + OPTIONS_PADDING
+	const STORAGE_KEY = '_easyWindowHeight'
+	const SIZE = {
+		'medium': {
+			width: '150px',
+			height: '40px'
+		},
+		'small': {
+			width: '200px',
+			height: '30px'
+		},
+		'mini': {
+			width: '160px',
+			height: '30px'
+		}
+	}
+	
+	export default {
+		name: COMPONENT_NAME,
+		props: {
+			windowHeight: {
+				type: [Number, String],
+				default: 0
+			},
+			placeholder: {
+				type: String,
+				default: '请选择'
+			},
+			value: {
+				type: String,
+				default: '双皮奶'
+			},
+			size: {
+				type: String,
+				default: 'medium'
+			},
+			options: {
+				type: Array,
+				default () {
+					return []
+				}
+			}
+		},
+		data() {
+			return {
+				showOptions: false,
+				boundingClientRect: {},
+				currentSelect: {},
+				optionsGroupTop: 'auto',
+				optionsGroupMargin: ''
+			}
+		},
+		computed: {
+			showSuffix() {
+				return this.showOptions ? 'showOptions' : 'no-showOptions'
+			},
+			easySelectSize() {
+				let size = this.size.toLowerCase()
+				if (size in SIZE) {
+					return {
+						width: SIZE[size].width,
+						height: SIZE[size].height
+					}
+				} else {
+					return {}
+				}
+			}
+		},
+		mounted() {
+			const elQuery = uni.createSelectorQuery().in(this)
+			elQuery.select('.easy-select').boundingClientRect(data => {
+				this.boundingClientRect = data
+			}).exec();
+			try {
+				if (!this.windowHeight) {
+					const storageHeihgt = uni.getStorageSync(STORAGE_KEY)
+					if (storageHeihgt) {
+						this.easyWindowHeight = storageHeihgt
+						return
+					}
+					const res = uni.getSystemInfoSync();
+					this.easyWindowHeight = res.windowHeight
+					uni.setStorageSync(STORAGE_KEY, this.easyWindowHeight)
+				}
+			} catch (e) {
+			    // error
+			}
+		},
+		methods: {
+			trigger(e) {
+				const view = uni.createSelectorQuery().in(this)
+				view.select('.easy-select').fields({rect: true}, data => {
+					let {	top, bottom } = data
+					const thresholdHeight = Math.min(MAX_OPTIONS_HEIGHT + OPTIONS_MARGIN, (this.options.length * OPTIONS_ITEM_HEIGHT) +
+						OPTIONS_OTHER_HEIGHT)
+					bottom = Number(this.windowHeight || this.easyWindowHeight) - (top + this.boundingClientRect.height) // 距离底部的距离等于视口的高度减上top加select组件的高度
+
+					// judge direction
+					if (bottom < thresholdHeight) {
+						this.optionsGroupDirection = 'up'
+						this.optionsGroupTop = -thresholdHeight - 12 + 'px'
+						this.optionsGroupMargin = '0'
+					} else {
+						this.optionsGroupDirection = 'down'
+						this.optionsGroupTop = 'auto'
+						this.optionsGroupMargin = '10px 0 0 0'
+					}
+
+					// if (this.scrollTop < )
+					this.showOptions = !this.showOptions
+				}).exec();
+			},
+			select(options) {
+				this.showOptions = false
+				this.currentSelect = options
+				this.$emit('selectOne', options)
+			},
+			hideOptions() {
+				this.showOptions = false
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.easy-select {
+		position: relative;
+		border-radius: 4px;
+		color: #606266;
+		outline: none;
+		box-sizing: content-box;
+		padding: 50rpx 0rpx;
+		height: 30px;
+		input{
+			width: 100%;
+			height: 80rpx;
+			border: 2rpx solid #999999;
+			padding-left: 25rpx;
+			box-shadow:0px 3px 5px 0px rgba(0, 0, 0, 0.27);
+			border-radius:11rpx;
+		}
+	}
+
+	.easy-select input {
+		padding: 0 18rpx;
+		padding-right: 60rpx;
+		overflow: hidden;
+		white-space: nowrap;
+		text-overflow: ellipsis;
+		height: 100% !important;
+		min-height: 100% !important;
+	}
+
+	.easy-select .easy-select-suffix {
+		position: absolute;
+		box-sizing: border-box;
+		height: 100%;
+		right: 5px;
+		top: 0;
+		display: flex;
+		align-items: center;
+		transform: rotate(180deg);
+		transition: all .3s;
+		transform-origin: center;
+	}
+
+	.easy-select .showOptions {
+		transform: rotate(0) !important;
+	}
+
+	.easy-select .no-showOptions {
+		transform: rotate(180deg) !important;
+	}
+
+	.easy-select .easy-select-options {
+		position: absolute;
+		padding: 6px 0;
+		margin-top: 10px;
+		border: 1px solid #e4e7ed;
+		border-radius: 4px;
+		background-color: #fff;
+		box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1);
+		box-sizing: border-box;
+		transform-origin: center top;
+		z-index: 2238;
+		overflow: scroll;
+		max-height: 274rpx;
+	}
+
+	.easy-select .easy-select-options-item {
+		padding: 0 20rpx;
+		position: relative;
+		white-space: nowrap;
+		font-size: 14px;
+		color: #606266;
+		height: 33px;
+		line-height: 33px;
+		box-sizing: border-box;
+	}
+
+	.easy-select .active {
+		background-color: #F5F7FA
+	}
+</style>

+ 419 - 2
pages/assets/assets.vue

@@ -1,8 +1,425 @@
 <template>
-</template>
+	<view class="container">
+		<view>
+			<view class="list-box">
+				<view class="bg">
+					<image src="../../static/img/assets-bg.png" mode=""></image>					
+				</view>
+				<view class="info-box">
+					<view class="flex" v-show="show == true">
+						<view class="info">
+							<view class="list-title">总资产合计(USDT)</view>
+							<view class="list-name clamp">{{ like_usdt * 1 }}</view>
+							<view class="ustd">≈ {{ like_rmb * 1 }}RMB</view>
+						</view>
+						<image class="image" src="../../static/img/eyes.png" @click="showPick(false)"></image>
+					</view>
+					<view class="flex" v-show="show == false">
+						<view class="info">
+							<view class="list-title">总资产合计(USDT)</view>
+							<view class="list-name clamp">****</view>
+							<view class="ustd">≈ ****RMB</view>
+						</view>
+						<image class="image" src="../../static/img/img43.png" @click="showPick(true)"></image>
+					</view>
+				</view>
+				<view class="list-tpl flex">
+					<view class="tpl" @click="navTo('/pages/finance/transfer')">
+						<image class="zhuanz" src="../../static/img/zhuan.png"></image>
+						<view class="tpl-name">转账</view>
+					</view>
+					<view class="tpl" @click="navTo('/pages/finance/recharge')">
+						<!-- @click="recharge" -->
+						<image src="../../static/img/chong.png"></image>
+						<view class="tpl-name">充币</view>
+					</view>
+					<view class="tpl" @click="navTo('/pages/finance/withdraw')">
+						<image src="../../static/img/ti.png"></image>
+						<view class="tpl-name">提币</view>
+					</view>
+				</view>
 
+				<!-- <view class="list-tips flex_item">
+				<image src="../../static/img/img07.png"></image>
+				<view>资产正在保护中</view>
+			</view> -->
+			</view>
+			<view class="list-cell" v-for="(ls, index) in list" :key="index" @click="toDateils(ls, index)">
+				<view class="cell flex">
+					<view class="cell-title">{{ ls.name }}</view>
+					<image src="../../static/img/img16.png"></image>
+				</view>
+				<view class="flex cell-list">
+					<view class="cell-tpl tips">
+						<view class="name">可用</view>
+						<view class="tpl">{{ ls.money.money * 1 }}</view>
+					</view>
+					<view class="cell-tpl tip-tpl">
+						<view class="name">冻结</view>
+						<view class="tpl">{{ ls.lock_moeny }}</view>
+					</view>
+					<view class="cell-tpl tip-box">
+						<view class="name">折合(USDT)</view>
+						<view class="tpl clamp">{{ ls.usdt * 1 }}</view>
+					</view>
+				</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="money" @selectOne="selectOne"></easy-select>
+					    </view>
+					<view class="confirm-btn" @click="pay"><text>确认充币</text></view>
+				</view>
+			</view>
+		</uni-popup> -->
+		</view>
+	</view>
+</template>
 <script>
+import { recharge, wallet,moneyType } from '@/api/finance.js';
+import easyselect from '@/components/easy-select/easy-select.vue';
+export default {
+	components: {
+		easyselect
+	},
+	data() {
+		return {
+			num: '',
+			money: '',
+			type: '',
+			moneyTypeList: [],
+			list: '',
+			show: true,
+			like_rmb: '',
+			like_usdt: '',
+			wallet: '',
+		};
+	},
+	onLoad(option) {
+		this.moneyType();
+		this.loadData();
+	},
+	onShow() {
+		this.moneyType();
+		this.loadData();
+		let show = uni.getStorageSync('showPick');
+		if (show == false) {
+			this.show = false;
+		}
+		if (show == true) {
+			this.show = true;
+		}
+	},
+	//下拉刷新
+	onPullDownRefresh() {
+		this.loadData();
+		this.moneyType();
+		setTimeout(function() {
+			uni.stopPullDownRefresh();
+		}, 1000);
+	},
+	methods: {
+		// 所有币种
+		async moneyType() {
+			let obj = this;
+			moneyType({}).then(({ data }) => {
+				obj.moneyTypeList = data;
+			});
+		},
+		// 请求载入数据
+		loadData() {
+			let obj = this;
+			uni.showLoading({
+				title:'加载中'
+			})
+			obj.loading = true;
+			wallet({}).then(({ data }) => {
+				console.log(data);
+				obj.like_rmb = data.like_rmb;
+				obj.like_usdt = data.like_usdt;
+				obj.list = data.back;
+				uni.hideLoading();
+			});
+		},
+		showPick(item) {
+			this.show = item;
+			uni.setStorage({
+				key: 'showPick',
+				data: item,
+				success: function() {}
+			});
+		},
+		recharge() {
+			this.$refs.popup.open();
+		},
+		selectOne(options) {
+			this.money = options.name;
+			this.type = options.code;
+		},
+		useOutClickSide() {
+			this.$refs.easySelect.hideOptions && this.$refs.easySelect.hideOptions();
+		},
+		// pay(){
+		// 	let obj = this;
+		// 	recharge({
+		// 		num:obj.num,
+		// 		money_type:obj.type
+		// 	},obj.buyId).then(({ data }) => {
+		// 		console.log(data)
+		// 		obj.$api.msg(data.msg);
+		// 		obj.$refs.popup.close();
+		// 		obj.num='';
+		// 		obj.type = '';
+		// 		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();
+		// 	});
+		// },
+		close() {
+			this.$refs.popup.close();
+		},
+		navTo(url) {
+			uni.navigateTo({
+				url
+			});
+		},
+		toDateils(ls, index) {
+			console.log(ls, 88);
+			let way = ls.way.split(',');
+			console.log(way[0], 'money-----------', ls.money);
+			let path = 'address_' + way[0];
+			console.log(path);
+			console.log(path === 'address_TRC20');
+			let address = ls.money[path];
+			let wayaddress = {};
+			way.forEach(item => {
+				let path = 'address_' + item;
+				wayaddress[item] = ls.money[path];
+			});
+			let waypath = JSON.stringify(wayaddress);
+			uni.navigateTo({
+				url:
+					'/pages/finance/details?code=' +
+					ls.code +
+					'&name=' +
+					ls.name +
+					'&logo=' +
+					ls.LOGO +
+					'&price=' +
+					ls.money.money +
+					'&_address_qr=' +
+					ls._address_qr +
+					'&__money_address=' +
+					ls.__money_address +
+					'&mark=' +
+					ls.mark +
+					'&ids=' +
+					ls.money.id +
+					'&keysAddr=' +
+					ls.money.address +
+					'&charge=' +
+					ls.charge +
+					'&address=' +
+					address +
+					'&way=' +
+					ls.way +
+					'&waypath=' +
+					waypath+
+					'&less=' +
+					ls.less
+			});
+		}
+	}
+};
 </script>
 
-<style>
+<style lang="scss">
+page {
+	min-height: 100%;
+	background-color: #ffffff;
+	.container {
+		width: 100%;
+		padding: 25rpx 40rpx;
+	}
+}
+.list-tips {
+	position: absolute;
+	right: 0;
+	top: 25rpx;
+	font-size: 24rpx;
+	background-color: #f4ca1c;
+	padding: 14rpx 27rpx;
+	border-bottom-left-radius: 50rpx;
+	border-top-left-radius: 50rpx;
+	color: #5771df;
+	image {
+		width: 30rpx;
+		height: 31rpx;
+		margin-right: 12rpx;
+	}
+}
+.list-box {
+	.bg {
+		position: absolute;
+		right: 0;
+		left: 0;
+		top: 0;
+		width: 100%;
+		height: 100%;
+		image {
+			height: 100%;
+			width: 100%;
+		}
+	}
+	z-index: 10;
+	position: relative;
+	color: #ffffff;
+	border-radius: 20rpx;
+	margin-bottom: 60rpx;
+	.info-box {
+		padding: 31rpx 43rpx;
+		.image {
+			width: 44rpx !important;
+			height: 30rpx !important;
+		}
+		.info {
+			width: 80%;
+			.list-title {
+				font-size: 30rpx;
+				font-weight: 500;
+				color: #ffffff;
+			}
+			.list-name {
+				width: 100%;
+				font-size: 64rpx;
+				font-weight: bold;
+				padding: 25rpx 0rpx;
+			}
+			.ustd {
+				font-size: 30rpx;
+				font-weight: normal;
+			}
+		}
+	}
+	.list-tpl {
+		z-index: 10;
+		position: relative;
+		padding: 30rpx 100rpx;
+		.tpl {
+			text-align: center;
+			image {
+				width: 45rpx;
+				height: 42rpx;
+			}
+			.zhuanz {
+				width: 45rpx;
+				height: 42rpx;
+			}
+			.tpl-name {
+				font-size: 27rpx;
+				font-weight: bold;
+				padding-left: 10rpx;
+				color: #FFFFFF;
+			}
+		}
+	}
+}
+.list-cell {
+	padding-bottom: 58rpx;
+	.cell {
+		padding-bottom: 31rpx;
+		image {
+			width: 12rpx;
+			height: 24rpx;
+		}
+		.cell-title {
+			font-size: 34rpx;
+			font-weight: 500;
+			color: #5771df;
+		}
+	}
+	.cell-list {
+		width: 100%;
+		.cell-tpl {
+			text-align: left;
+			.name {
+				font-size: 24rpx;
+				font-weight: 500;
+				color: #999999;
+				padding-bottom: 15rpx;
+			}
+		}
+		.tip-box {
+			text-align: right;
+			width: 40%;
+		}
+		.tip-tpl {
+			text-align: center;
+			width: 30%;
+		}
+		.tips {
+			width: 30%;
+		}
+	}
+}
+//弹窗
+.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;
+			}
+		}
+	}
+}
+.loading {
+	width: 100%;
+	height: 100%;
+}
 </style>

+ 81 - 2
pages/assets/teamDetails.vue

@@ -21,6 +21,31 @@
 				<view class="title-left">第1组 预约份数/总份数:11/11</view>
 				<view class="title-right">未中奖</view>
 			</view>
+			<view class="yu-main">
+				<view class="img"><image src="" mode=""></image></view>
+				<view class="yu-info">
+					<view class="info">
+						<view class="yu-font">回退本金</view>
+						<view class="yu-num">100USDT</view>
+					</view>
+					<view class="info">
+						<view class="yu-font">收益</view>
+						<view class="yu-num">3USDT</view>
+					</view>
+					<view class="info">
+						<view class="yu-font">唯一凭证</view>
+						<view class="yu-num">LALA122002552000</view>
+					</view>
+				</view>
+			</view>
+			<view class="boom">
+				<view class="boom-font">当前组爆快</view>
+				<view class="boom-num">
+					LALA122002552000
+					<br />
+					LALA122002552000
+				</view>
+			</view>
 		</view>
 	</view>
 </template>
@@ -119,13 +144,67 @@ page {
 		font-size: 34rpx;
 		font-family: PingFang SC;
 		font-weight: bold;
-		color: #0F253A;
+		color: #0f253a;
 	}
 	.title-right {
 		font-size: 26rpx;
 		font-family: PingFang SC;
 		font-weight: 500;
-		color: #6D7C88;
+		color: #6d7c88;
+	}
+}
+.yu-main {
+	margin-top: 40rpx;
+	display: flex;
+	justify-content: flex-start;
+	align-items: center;
+	.img {
+		width: 180rpx;
+		height: 155rpx;
+		flex-shrink: 0;
+		image {
+			width: 100%;
+			height: 100%;
+		}
+	}
+	.yu-info {
+		padding-top: 14rpx;
+		margin-left: 20rpx;
+		width: 100%;
+		.info {
+			display: flex;
+			justify-content: space-between;
+			.yu-font {
+				font-size: 26rpx;
+				font-family: PingFang SC;
+				font-weight: 500;
+				color: #6d7c88;
+			}
+			.yu-num {
+				font-size: 26rpx;
+				font-family: PingFang SC;
+				font-weight: bold;
+				color: #0f253a;
+			}
+		}
+	}
+}
+.boom {
+	padding-left: 14rpx;
+	margin-top: 28rpx;
+	display: flex;
+	justify-content: space-between;
+	.boom-font {
+		font-size: 26rpx;
+		font-family: PingFang SC;
+		font-weight: 500;
+		color: #6d7c88;
+	}
+	.boom-num {
+		font-size: 26rpx;
+		font-family: PingFang SC;
+		font-weight: bold;
+		color: #0f253a;
 	}
 }
 </style>

+ 1 - 1
pages/index/index.vue

@@ -64,7 +64,7 @@
 					</view>
 				</view>
 				<view class="submit">
-					好强儿
+					预购
 				</view>
 			</view>
 		</view>

BIN
static/img/assets-bg.png


BIN
static/img/chong.png


BIN
static/img/eyes.png


BIN
static/img/img16.png


BIN
static/img/img43.png


BIN
static/img/ti.png


BIN
static/img/zhuan.png