Selaa lähdekoodia

Merge branch 'master' of http://git.liuniu946.com/lhl/nzhbsr

lhl 2 vuotta sitten
vanhempi
commit
0abf5459d8

+ 1 - 1
api/login.js

@@ -117,4 +117,4 @@ export function loginout(data) {
 		method: 'get',
 		data
 	})
-}
+}

+ 12 - 77
api/wallet.js

@@ -1,102 +1,37 @@
 import request from '@/utils/request'
 
-// 获取用户消费记录
-export function spreadCommission(data,state) {
+// 资金列表
+export function usercoin(data) {
 	return request({
-		url: '/api/spread/commission/'+state,
+		url: '/api/User/usercoin',
 		method: 'get',
 		data
 	});
 }
 
-// 获取账户余额
-export function userBalance(data) {
+// 我的总资金
+export function getallzhehe(data) {
 	return request({
-		url: '/api/user/balance',
+		url: '/api/User/getallzhehe',
 		method: 'get',
 		data
 	});
 }
 
-// 提现
-export function extractCash(data) {
+// 充币列表
+export function czcoin(data) {
 	return request({
-		url: '/api/extract/cash',
-		method: 'post',
-		data
-	});
-}
-
-// 提现信息
-export function extractBank(data) {
-	return request({
-		url: '/api/extract/bank',
-		method: 'get',
-		data
-	});
-}
-// #ifdef H5
-// 公众号充值
-export function rechargeWechat(data) {
-	return request({
-		url: '/api/recharge/wechat',
-		method: 'post',
-		data
-	});
-}
-// #endif
-// #ifdef MP
-// 小程序充值
-export function rechargeRoutine(data) {
-	return request({
-		url: '/api/recharge/routine',
-		method: 'post',
-		data
-	});
-}
-// #endif
-// 获取提现支付宝账号
-export function aliInfo(data) {
-	return request({
-		url: '/api/ali/info',
+		url: '/api/user/czcoin',
 		method: 'get',
 		data
 	});
 }
-//获取默认银行卡账号
-export function bankInfo(data) {
-	return request({
-		url: '/api/bank/info',
-		method: 'get',
-		data
-	});
-}
-// 保存提现支付宝账号
-export function setAliInfo(data) {
-	return request({
-		url: '/api/ali/edit',
-		method: 'post',
-		data
-	});
-}
-//保存默认银行卡账号
-export function setBankInfo(data) {
-	return request({
-		url: '/api/bank/edit',
-		method: 'post',
-		data
-	});
-}
 
-
-// 账户余额
-export function balance(data) {
+// 充币详情
+export function czpage(data) {
 	return request({
-		url: '/api/user/balance',
+		url: '/api/user/czpage',
 		method: 'get',
 		data
 	});
 }
-
-
-

+ 33 - 0
js_sdk/xb-copy/uni-copy.js

@@ -0,0 +1,33 @@
+export default function uniCopy(content) {
+	/**
+	 * 小程序端 和 app端的复制逻辑
+	 */
+	//#ifndef H5
+	uni.setClipboardData({
+		data: content,
+		success: function() {
+			console.log('success');
+			return true
+		}
+	});
+	//#endif
+	
+	/**
+	 * H5端的复制逻辑
+	 */
+	// #ifdef H5
+	if (!document.queryCommandSupported('copy')) { //为了兼容有些浏览器 queryCommandSupported 的判断
+		// 不支持
+		return false
+	}
+	let textarea = document.createElement("textarea")
+	textarea.value = content
+	textarea.readOnly = "readOnly"
+	document.body.appendChild(textarea)
+	textarea.select() // 选择对象
+	textarea.setSelectionRange(0, content.length) //核心
+	let result = document.execCommand("copy") // 执行浏览器复制命令
+	textarea.remove()
+	return result
+	// #endif
+}

+ 49 - 22
pages/transaction/cbdetail.vue

@@ -1,33 +1,60 @@
 <template>
 	<view class="content">
-
+		<view class="vheight"></view>
+		<view class="top flex">
+			<image class="top-icon1" src="../../static/img/cb2.png" mode=""></image>
+			<image class="top-icon2" src="../../static/img/cb1.png" mode=""></image>
+		</view>
+		<view class="title">充幣</view>
 	</view>
 </template>
 
 <script>
-	export default {
-		data() {
-			return {
-
-			}
-		},
-		onLoad() {
-
-		},
-		onShow() {
-
-		},
-		onReachBottom() {
-
-		},
-		onReady() {
-
-		},
-		methods: {
-
+import { czpage } from '@/api/wallet.js';
+import tkiQrcode from '@/components/tki-qrcode/tki-qrcode.vue';
+import uniCopy from '@/js_sdk/xb-copy/uni-copy.js';
+export default {
+	data() {
+		return {
+			id: ''
+		};
+	},
+	onLoad(opt) {
+		this.id = opt.type;
+		this.loadData();
+	},
+	onShow() {},
+	onReachBottom() {},
+	onReady() {},
+	methods: {
+		loadData() {
+			czpage({ id: this.id }).then(e => {
+				console.log(e);
+			});
 		}
 	}
+};
 </script>
 
 <style lang="scss">
-</style>
+page,
+.content {
+	min-height: 100%;
+	height: auto;
+	background: #f5f5f5;
+}
+.vheigh {
+	height: var(--status-bar-height);
+}
+.top {
+	padding: 20rpx 40rpx;
+	.top-icon1 {
+		width: 52rpx;
+		height: 36rpx;
+	}
+	.top-icon2 {
+		width: 48rpx;
+		height: 48rpx;
+	}
+}
+</style>

+ 179 - 20
pages/transaction/cblist.vue

@@ -1,33 +1,192 @@
 <template>
 	<view class="content">
-
+		<view class="ss-box flex">
+			<view class="ss-main">
+				<view class="ss-main-icon"><image src="../../static/img/ss.png" mode=""></image></view>
+				<input type="text" @blur="loadData()" v-model="keyworld" placeholder="搜索您需要的幣種" />
+			</view>
+			<view class="ss-font">取消</view>
+		</view>
+		<!-- <view class="title">热门币种</view>
+		<view class="rmbz flex">
+			<view class="rmbz-item" v-for="(item, index) in rmlist" @click="navTo(item)">{{ item }}</view>
+		</view> -->
+		<view class="title">币种列表</view>
+		<scroll-view class="swiper-box" scroll-y="true" :style="{ height: maxheight }">
+			<view class="list" v-for="(item, index) in bilist" @click="nav(item)">
+				<view class="list-item flex">
+					<view class="list-item-left">
+						<view class="list-title">{{ item.title }}</view>
+						<view class="list-tip">{{ item.title }}</view>
+					</view>
+					<view class="list-item-right">
+						<view class="kc" v-if="item.czstatus == 2">不支持充币</view>
+						<view class="back"><image src="../../static/icon/user-back.png" mode=""></image></view>
+					</view>
+				</view>
+			</view>
+		</scroll-view>
 	</view>
 </template>
 
 <script>
-	export default {
-		data() {
-			return {
-
-			}
+import { czcoin } from '@/api/wallet.js';
+export default {
+	data() {
+		return {
+			keyworld: '',
+			rmlist: ['USDT', 'BTC', 'ETH', 'TRX'],
+			bilist: [],
+			maxheight: ''
+		};
+	},
+	onLoad() {},
+	onShow() {
+		this.loadData();
+	},
+	onReachBottom() {},
+	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 => {}
+		});
+	},
+	methods: {
+		loadData() {
+			czcoin({ name: this.keyworld }).then(e => {
+				this.bilist = e.data;
+			});
 		},
-		onLoad() {
-
+		navTo(opt) {
+			uni.navigateTo({
+				url: '/pages/transaction/cbdetail?type=' + opt
+			});
 		},
-		onShow() {
-
-		},
-		onReachBottom() {
-
-		},
-		onReady() {
-
-		},
-		methods: {
-
+		nav(opt) {
+			if (opt.czstatus == 2) {
+				return this.$api.msg('当前币种不支持充值');
+			}
+			uni.navigateTo({
+				url: '/pages/transaction/cbdetail?type=' + opt.id
+			});
 		}
 	}
+};
 </script>
 
 <style lang="scss">
-</style>
+page,
+.content {
+	min-height: 100%;
+	height: auto;
+	background: #ffffff;
+}
+.ss-box {
+	padding: 12rpx 62rpx 10rpx 34rpx;
+	border-bottom: 1px solid #f6f6f6;
+	.ss-main {
+		width: 537rpx;
+		padding: 10rpx 0;
+		background: #f6f6f6;
+		border-radius: 26rpx;
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		.ss-main-icon {
+			width: 32rpx;
+			height: 32rpx;
+			image {
+				width: 100%;
+				height: 100%;
+			}
+		}
+		input {
+			font-size: 20rpx;
+			font-family: PingFang SC;
+			font-weight: 500;
+			color: #aaaaaa;
+		}
+	}
+	.ss-font {
+		font-size: 28rpx;
+		font-family: PingFang SC;
+		font-weight: 500;
+		color: #070707;
+	}
+}
+.title {
+	display: inline-block;
+	margin: 30rpx 0 0 18rpx;
+	padding: 0 10rpx 13rpx;
+	border-bottom: 4rpx solid #f4d03c;
+}
+.rmbz {
+	padding: 32rpx 0;
+	justify-content: center;
+	.rmbz-item {
+		width: 130rpx;
+		height: 52rpx;
+		border: 2rpx solid #848a8f;
+		border-radius: 10rpx;
+		text-align: center;
+		line-height: 52rpx;
+		font-size: 24rpx;
+		font-family: PingFang SC;
+		font-weight: 500;
+		color: #000000;
+		margin: 0 16rpx;
+	}
+}
+.list {
+	margin-top: 6rpx;
+	padding: 0 24rpx;
+	.list-item {
+		padding: 42rpx 0 24rpx;
+		.list-item-left {
+			display: flex;
+			align-items: center;
+			.list-title {
+				width: 200rpx;
+				font-size: 28rpx;
+				font-family: PingFang SC;
+				font-weight: 500;
+				color: #5d5f70;
+			}
+			.list-tip {
+				font-size: 24rpx;
+				font-family: PingFang SC;
+				font-weight: 500;
+				color: #5d5f70;
+			}
+		}
+		.list-item-right {
+			display: flex;
+			align-items: center;
+			line-height: 1;
+			.kc {
+				font-size: 20rpx;
+				font-family: PingFang SC;
+				font-weight: 500;
+				color: #5d5f70;
+				margin-right: 20rpx;
+			}
+			.back {
+				width: 24rpx;
+				height: 24rpx;
+				image {
+					width: 100%;
+					height: 100%;
+				}
+			}
+		}
+	}
+}
+</style>

+ 35 - 32
pages/user/user.vue

@@ -7,46 +7,40 @@
 			</view>
 			<view class="allmbox_2 flex">
 				<view class="allmbox_2_font">賬戶總資產折合(USDT)</view>
-				<view class="allmbox_2_icon" @click="open()">
-					<image src="../../static/icon/user-th.png" mode=""></image>
-				</view>
+				<view class="allmbox_2_icon" @click="open()"><image src="../../static/icon/user-th.png" mode=""></image></view>
 			</view>
-			<view class="allmbox_3">{{show?'0':'****.****'}}</view>
+			<view class="allmbox_3">{{ show ? money : '****.****' }}</view>
 
 			<view class="allmbox_btn">
 				<view class="allmbox_btn_1">
-					<view class="allmbox_cbtn btn_active"><span class="fch">充幣</span></view>
-					<view class="allmbox_tbtn"><span class="fch">提幣</span></view>
+					<view class="allmbox_cbtn btn_active" @click="navTo('/pages/transaction/cblist')">充幣</view>
+					<view class="allmbox_tbtn" @click="navTo('/pages/transaction/tblist')">提幣</view>
 				</view>
 			</view>
 		</view>
 		<view class="findbox">
 			<view class="findbox_1">
-				<view class="findbox_2">
-					<view class="findbox_3"><span class="fzmm fch">資產列表</span></view>
-				</view>
+				<view class="findbox_2"><view class="findbox_3">資產列表</view></view>
 			</view>
 
 			<scroll-view :scroll-y="true" class="swiper-box" :style="{ height: maxheight }">
-				<view class="listbox" v-for="(item, index) in 10">
+				<view class="listbox" v-for="(item, index) in list">
 					<view class="listbox_title flex">
-						<view class="listbox_title_l">WALLETS-USDT</view>
-						<view class="listbox_title_r">
-							<image src="../../static/icon/user-back.png" mode=""></image>
-						</view>
+						<view class="listbox_title_l">{{ item.name.toLocaleUpperCase() }}</view>
+						<view class="listbox_title_r"><image src="../../static/icon/user-back.png" mode=""></image></view>
 					</view>
 					<view class="main flex">
 						<view class="main-item">
 							<view class="main-item-font">可用</view>
-							<view class="main-item-num">0.000000</view>
+							<view class="main-item-num">{{ item.data.num || '0.0000' }}</view>
 						</view>
 						<view class="main-item">
-							<view class="main-item-font">冻结</span></view>
-							<view class="main-item-num">0.000000</view>
+							<view class="main-item-font">冻结</view>
+							<view class="main-item-num">{{ item.data.numd || '0.0000' }}</view>
 						</view>
 						<view class="main-item">
 							<view class="main-item-font">折合(USDT)</view>
-							<view class="main-item-num">0.000000</view>
+							<view class="main-item-num">{{ item.data.zhe || '0.0000' }}</view>
 						</view>
 					</view>
 				</view>
@@ -55,18 +49,15 @@
 		<uni-popup ref="popup" type="center">
 			<view class="popup-box">
 				<view class="img"><image src="../../static/img/user-index.png" mode=""></image></view>
-				<view class="popup-font">
-					由於資金統計存在延時,賬戶餘額不一定是並非最新余額,如需準確餘額請到相關賬戶頁面進行查詢
-				</view>
-				<view class="btn" @click="cancel()">
-					確定
-				</view>
+				<view class="popup-font">由於資金統計存在延時,賬戶餘額不一定是並非最新余額,如需準確餘額請到相關賬戶頁面進行查詢</view>
+				<view class="btn" @click="cancel()">確定</view>
 			</view>
 		</uni-popup>
 	</view>
 </template>
 
 <script>
+import { usercoin, getallzhehe } from '@/api/wallet.js';
 export default {
 	onReady(res) {
 		var _this = this;
@@ -88,13 +79,26 @@ export default {
 		return {
 			maxheight: '',
 			show: false,
+			list: '',
+			money: ''
 		};
 	},
 	onLoad() {},
-	onShow() {},
+	onShow() {
+		this.loadData();
+	},
 	methods: {
 		look(type) {
-			this.show = type
+			this.show = type;
+		},
+		loadData() {
+			usercoin({}).then(({ data }) => {
+				this.list = data;
+			});
+			getallzhehe({}).then(e => {
+				this.money = e.allzhehe;
+				console.log(e, '123456');
+			});
 		},
 		cancel() {
 			this.$refs.popup.close();
@@ -105,9 +109,8 @@ export default {
 		navTo(url) {
 			uni.navigateTo({
 				url
-			})
+			});
 		}
-		
 	}
 };
 </script>
@@ -285,7 +288,7 @@ a:active {
 }
 .listbox_title_r {
 	image {
-		width:28rpx;
+		width: 28rpx;
 		height: 28rpx;
 	}
 }
@@ -298,7 +301,7 @@ a:active {
 			font-size: 25rpx;
 			font-family: PingFang SC;
 			font-weight: 500;
-			color: #CDCDCD;
+			color: #cdcdcd;
 		}
 		.main-item-num {
 			margin-top: 14rpx;
@@ -318,7 +321,7 @@ a:active {
 		padding: 10rpx 0 0 0;
 		display: flex;
 		justify-content: center;
-		image{
+		image {
 			width: 72rpx;
 			height: 72rpx;
 		}
@@ -332,7 +335,7 @@ a:active {
 		width: 100%;
 		height: 80rpx;
 		line-height: 80rpx;
-		background: linear-gradient(to left,#eeb80d,#ffe35b);
+		background: linear-gradient(to left, #eeb80d, #ffe35b);
 		border-radius: 10rpx;
 		text-align: center;
 		margin-top: 20rpx;

BIN
static/img/cb1.png


BIN
static/img/cb2.png


BIN
static/img/ss.png