lhl 2 rokov pred
rodič
commit
57d549ae20

+ 24 - 0
api/login.js

@@ -133,4 +133,28 @@ export function upauthrz(data) {
 		method: 'get',
 		data
 	})
+}
+
+export function coininfo(data) {
+	return request({
+		url: '/api/User/coininfo',
+		method: 'get',
+		data
+	})
+}
+
+export function bill(data) {
+	return request({
+		url: '/api/User/bill',
+		method: 'get',
+		data
+	})
+}
+
+export function transfer(data) {
+	return request({
+		url: '/api/User/transfer',
+		method: 'get',
+		data
+	})
 }

+ 10 - 10
pages.json

@@ -121,32 +121,32 @@
 		"backgroundColor": "#f8f8f8"
 	},
 	"tabBar": {
-		"color": "#C0C4CC",
-		"selectedColor": "#5DBC7C",
+		"color": "#697484",
+		"selectedColor": "#fcd417",
 		"borderStyle": "black",
 		"backgroundColor": "#ffffff",
 		"list": [{
 				"pagePath": "pages/index/index",
-				"iconPath": "static/tabBar/tab-home.png",
-				"selectedIconPath": "static/tabBar/tab-home-current.png",
+				"iconPath": "static/tabBar/home.png",
+				"selectedIconPath": "static/tabBar/home-action.png",
 				"text": "首頁"
 			},
 			{
 				"pagePath": "pages/transaction/transaction",
-				"iconPath": "static/tabBar/tab-home.png",
-				"selectedIconPath": "static/tabBar/tab-home-current.png",
+				"iconPath": "static/tabBar/jy.png",
+				"selectedIconPath": "static/tabBar/jy-action.png",
 				"text": "交易"
 			},
 			{
 				"pagePath": "pages/heyue/heyue",
-				"iconPath": "static/tabBar/tab-home.png",
-				"selectedIconPath": "static/tabBar/tab-home-current.png",
+				"iconPath": "static/tabBar/hy.png",
+				"selectedIconPath": "static/tabBar/hy-action.png",
 				"text": "合約"
 			},
 			{
 				"pagePath": "pages/user/user",
-				"iconPath": "static/tabBar/tab-my.png",
-				"selectedIconPath": "static/tabBar/tab-my-current.png",
+				"iconPath": "static/tabBar/zc.png",
+				"selectedIconPath": "static/tabBar/zc-action.png",
 				"text": "資產"
 			}
 		]

+ 10 - 6
pages/index/index.vue

@@ -14,15 +14,15 @@
 		<!-- 功能盒 start -->
 		<view class="gnh-wrap">
 			<view class="gnh-top flex">
-				<view class="top-item flex">
+				<!-- <view class="top-item flex">
 					<image src="../../static/icon/gn-1.png" mode="" class=""></image>
 					<view class="">認購</view>
-				</view>
-				<view class="top-item flex">
+				</view> -->
+				<view class="top-item flex" @click="navto('/pages/transaction/cblist')">
 					<image src="../../static/icon/gn-2.png" mode="" class=""></image>
 					<view class="">充幣</view>
 				</view>
-				<view class="top-item flex">
+				<view class="top-item flex" @click="navto('/pages/transaction/tblist')">
 					<image src="../../static/icon/gn-3.png" mode="" class=""></image>
 					<view class="">提幣</view>
 				</view>
@@ -30,10 +30,10 @@
 					<image src="../../static/icon/gn-4.png" mode="" class=""></image>
 					<view class="">語言</view>
 				</view> -->
-				<view class="top-item flex">
+				<!-- <view class="top-item flex">
 					<image src="../../static/icon/gn-5.png" mode="" class=""></image>
 					<view class="">客服</view>
-				</view>
+				</view> -->
 			</view>
 			<view class="gnh-btm flex">
 				<view class="btm-item">
@@ -101,6 +101,10 @@
 </template>
 
 <script>
+	import {
+		saveUrl,
+		interceptor
+	} from '@/utils/loginUtils.js';
 	import {
 		mapState,
 		mapMutations

+ 181 - 33
pages/transaction/transfer.vue

@@ -1,33 +1,181 @@
-<template>
-	<view class="content">
-
-	</view>
-</template>
-
-<script>
-	export default {
-		data() {
-			return {
-
-			}
-		},
-		onLoad() {
-
-		},
-		onShow() {
-
-		},
-		onReachBottom() {
-
-		},
-		onReady() {
-
-		},
-		methods: {
-
-		}
-	}
-</script>
-
-<style lang="scss">
-</style>
+<template>
+	<view class="content">
+		<view class="" style="height: 50rpx;">
+
+		</view>
+		<view class="wrap">
+			<view class="imgbox_1">
+				劃轉類型
+			</view>
+			<view class="flex">
+				<view class="imgbox_noaction" :class="{'imgbox_action': current == 1}" @click="current = 1">
+					資金賬戶轉合約賬戶
+				</view>
+				<view class="imgbox_noaction" :class="{'imgbox_action': current == 2}" @click="current = 2">
+					合約帳戶甎資金賬戶
+				</view>
+			</view>
+			<view class="flex" style="margin-top: 20rpx;">
+				<view class="item-left">
+					資金賬戶
+				</view>
+				<view class="item-right">
+					可用餘額 {{userInfo.usdt}} USDT
+				</view>
+			</view>
+			<view class="flex">
+				<view class="item-left">
+					合約賬戶
+				</view>
+				<view class="item-right">
+					可用餘額 {{userInfo.money}} USDT
+				</view>
+			</view>
+			<view class="sr-wrap flex">
+				<input type="digit" placeholder="輸入劃轉數量" class="sr-inp" v-model="tbnum" />
+				<view class="">
+					USDT
+				</view>
+			</view>
+			<view class="sub-btn" @click="transfer">
+				提交
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import {
+		mapState,
+		mapMutations
+	} from 'vuex';
+	import {
+		transfer,
+		getUser
+	} from '@/api/login.js'
+	export default {
+		data() {
+			return {
+				current: 1,
+				tbnum: '',
+				loaded: false
+			}
+		},
+		onLoad() {
+			console.log(this.userInfo)
+		},
+		computed: {
+			...mapState('user', ['userInfo'])
+		},
+		onShow() {
+
+		},
+		onReachBottom() {
+
+		},
+		onReady() {
+
+		},
+		methods: {
+			...mapMutations('user', ['setUserInfo']),
+			transfer() {
+				let obj = this
+				if(obj.loaded) {
+					return
+				}
+				obj.loaded = true
+				transfer({
+					tbnum: obj.tbnum,
+					type: obj.current
+				}).then(res => {
+					
+					uni.showToast({
+						title: '劃轉成功',
+						duration: 2000,
+						position: 'top'
+					});
+					getUser().then(re => {
+						obj.loaded = false
+						obj.setUserInfo(re.data)
+					})
+				}).catch(err => {
+					obj.loaded = false
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	.wrap {
+		width: 640rpx;
+		height: 610rpx;
+		padding: 40rpx;
+		background-color: #fff;
+		margin: auto;
+		border-radius: 20rpx;
+
+		.imgbox_1 {
+			height: 80rpx;
+			line-height: 80rpx;
+			font-size: 32rpx;
+		}
+
+		.imgbox_noaction {
+			width: 280rpx;
+			height: 70rpx;
+			line-height: 70rpx;
+			text-align: center;
+			font-size: 24rpx;
+			border: #ccc solid 1px;
+			color: #ccc;
+			border-radius: 20rpx;
+		}
+
+		.imgbox_action {
+			color: #FCD535;
+			border: #FCD535 solid 1px;
+
+		}
+	}
+
+	.item-left {
+		height: 60rpx;
+		line-height: 60rpx;
+		font-size: 32rpx;
+	}
+
+	.item-right {
+		height: 60rpx;
+		line-height: 60rpx;
+		font-size: 24rpx;
+		color: #707A8A;
+	}
+
+	.sr-wrap {
+		width: 560rpx;
+		height: 80rpx;
+		background-color: #f5f5f5;
+		border-radius: 20rpx;
+		padding: 0 20rpx;
+
+		.sr-inp {
+			width: 352rpx;
+			height: 60rpx;
+			line-height: 60rpx;
+			display: inline-block;
+		}
+	}
+
+	.sub-btn {
+		width: 560rpx;
+		height: 80rpx;
+		line-height: 80rpx;
+		color: #000;
+		text-align: center;
+		font-size: 28rpx;
+		background: linear-gradient(to left, #eeb80d, #ffe35b);
+		margin-top: 30rpx;
+		border-radius: 20rpx;
+	}
+</style>

+ 259 - 33
pages/user/coininfo.vue

@@ -1,33 +1,259 @@
-<template>
-	<view class="content">
-
-	</view>
-</template>
-
-<script>
-	export default {
-		data() {
-			return {
-
-			}
-		},
-		onLoad() {
-
-		},
-		onShow() {
-
-		},
-		onReachBottom() {
-
-		},
-		onReady() {
-
-		},
-		methods: {
-
-		}
-	}
-</script>
-
-<style lang="scss">
-</style>
+<template>
+	<view class="content">
+		<view class="top-base">
+			<view class="contentbox_top">
+				{{info.name}}
+			</view>
+			<view class="base-info flex">
+				<view class="info-item">
+					<view class="item-name">
+						可用
+					</view>
+					<view class="item-val">
+						{{info.num}}
+					</view>
+				</view>
+				<view class="info-item">
+					<view class="item-name">
+						凍結
+					</view>
+					<view class="item-val">
+						{{info.numd}}
+					</view>
+				</view>
+				<view class="info-item">
+					<view class="item-name" style="text-align: right;">
+						折合(USDT)
+					</view>
+					<view class="item-val" style="text-align: right;">
+						{{info.zhe}}
+					</view>
+				</view>
+			</view>
+			
+		</view>
+		<view class="" style="height: 20rpx;background-color: #f5f5f5;">
+			
+		</view>
+		<view class="tit">
+			財務記錄
+		</view>
+		<view class="cwjl-wrap" v-for="item in list">
+			<view class="jl-tit">
+				{{item.remark}}
+			</view>
+			<view class="jl-info flex" >
+				<view class="info-item">
+					<view class="item-name">
+						數量
+					</view>
+					<view class="item-val">
+						{{item.num}}
+					</view>
+				</view>
+				<view class="info-item">
+					<view class="item-name" >
+						狀態
+					</view>
+					<view class="item-val">
+						{{item.st == 1? '增加': (item.st == 2 ? '減少': '')}}
+					</view>
+				</view>
+				<view class="info-item">
+					<view class="item-name" style="text-align: right;">
+						時間
+					</view>
+					<view class="item-val" style="text-align: right;">
+						{{item.addtime}}
+					</view>
+				</view>
+			</view>
+		</view>
+		<uni-load-more :status="loadingType"></uni-load-more>
+		<view class="tianc" style="height: 120rpx;background-color: #fff;">
+			
+		</view>
+		<view class="btm-btn flex">
+			<view class="btnbox_a " @click="navto('/pages/transaction/cbdetail?type=' + id)">
+				充幣
+			</view>
+			<view class="btnbox_b " @click="navto('/pages/transaction/tbdetail?type=' + id)">
+				提幣
+			</view>
+			<view class="btnbox_b " v-if="info.name == 'Wallets-USDT'" @click="navto('/pages/transaction/transfer')">
+				劃轉
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import {
+		coininfo,
+		bill
+	} from '@/api/login.js'
+	export default {
+		data() {
+			return {
+				id: '',
+				info: {},
+				page: 1,
+				limit: 10,
+				loadingType: 'more',
+				loaded: false,
+				list: []
+			}
+		},
+		onLoad(opt) {
+			if (opt.id) {
+				this.id = opt.id
+				this.coininfo()
+			}
+		},
+		onShow() {
+
+		},
+		onReachBottom() {
+			console.log('dao')
+			this.bill()
+		},
+		onReady() {
+
+		},
+		methods: {
+			navto(url) {
+				uni.navigateTo({
+					url
+				})
+			},
+			coininfo() {
+				let obj = this
+				coininfo({
+					cid: obj.id
+				}).then(res => {
+					console.log(res)
+					obj.info = res.data
+					obj.bill()
+				})
+			},
+			bill() {
+				let obj = this
+				if(obj.loadingType == 'loading' || obj.loadingType == 'noMore') {
+					return
+				}
+				obj.loadingType = 'loading'
+				bill({
+					name: obj.info.name,
+					page: obj.page,
+					limit: obj.limit
+				}).then(res => {
+					console.log(res)
+					// if()
+					obj.list = obj.list.concat(res.data)
+					if(obj.limit == res.data.length) {
+						obj.loadingType = 'more'
+					}else {
+						obj.loadingType = 'noMore'
+					}
+					obj.loaded = true
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	page {
+		background-color: #fff;
+		height: 100%;
+	}
+	.top-base {
+		width: 750rpx;
+		height: 240rpx;
+		background-color: #fff;
+		padding: 10rpx 30rpx;
+	}
+
+	.contentbox_top {
+		color: #FCD535;
+		height: 100rpx;
+		line-height: 100rpx;
+		font-size: 52rpx;
+	}
+	.base-info {
+		width: 100%;
+		justify-content: space-between;
+		.info-item {
+			width: 33%;
+			height: 100rpx;
+			color: #000;
+			font-size: 28rpx;
+			.item-name {
+				color: #707A8A;
+			}
+		}
+	}
+	.tit {
+		height: 100rpx;
+		line-height: 100rpx;
+		padding: 20rpx;
+		color: #000;
+		font-size: 40rpx;
+	}
+	.cwjl-wrap {
+		width: 660rpx;
+		height: 180rpx;
+		border-bottom: 1px solid #f5f5f5;
+		margin: auto;
+		padding: 10rpx 20rpx;
+		color: #000;
+		font-size: 28rpx;
+		.jl-tit {
+			
+			
+		}
+		.jl-info {
+			justify-content: space-between;
+			
+			.info-item {
+				width: 33%;
+				.item-name {
+					color: #707A8A;
+					padding: 20rpx 0 10rpx;
+				}
+				.item-val {
+					padding: 10rpx 0;
+				}
+			}
+		}
+	}
+	.btm-btn {
+		width: 750rpx;
+		height: 120rpx;
+		padding: 20rpx;
+		font-size: 28rpx;
+		color: #000;
+		justify-content: flex-start;
+		position: fixed;
+		bottom: 0;
+		background-color: #fff;
+		.btnbox_a {
+			width: 198rpx;
+			height: 80rpx;
+			line-height: 80rpx;
+			text-align: center;
+			background: linear-gradient(to left,#eeb80d,#ffe35b);
+			margin-right: 20rpx;
+			border-radius: 20rpx;
+		}
+		.btnbox_b {
+			width: 198rpx;
+			height: 80rpx;
+			line-height: 80rpx;
+			text-align: center;
+			background: #f5f5f5;
+			margin-right: 20rpx;
+			border-radius: 20rpx;
+		}
+	}
+</style>

+ 1 - 1
pages/user/user.vue

@@ -24,7 +24,7 @@
 			</view>
 
 			<scroll-view :scroll-y="true" class="swiper-box" :style="{ height: maxheight }">
-				<view class="listbox" v-for="(item, index) in list">
+				<view class="listbox" v-for="(item, index) in list" @click="navTo('/pages/user/coininfo?id=' + item.id)">
 					<view class="listbox_title flex">
 						<view class="listbox_title_l">{{ item.name.toLocaleUpperCase() }}</view>
 						<view class="listbox_title_r"><image src="../../static/icon/user-back.png" mode=""></image></view>

BIN
static/tabBar/dingdan.png


BIN
static/tabBar/home-action.png


BIN
static/tabBar/home.png


BIN
static/tabBar/hy-action.png


BIN
static/tabBar/hy.png


BIN
static/tabBar/jy-action.png


BIN
static/tabBar/jy.png


BIN
static/tabBar/tab-cart-current.png


BIN
static/tabBar/tab-cart.png


BIN
static/tabBar/tab-cate-current.png


BIN
static/tabBar/tab-cate.png


BIN
static/tabBar/tab-home-current.png


BIN
static/tabBar/tab-home.png


BIN
static/tabBar/tab-my-current.png


BIN
static/tabBar/tab-my.png


BIN
static/tabBar/zc-action.png


BIN
static/tabBar/zc.png