cmy 4 lat temu
rodzic
commit
cd5d907a89
3 zmienionych plików z 47 dodań i 70 usunięć
  1. 6 1
      pages.json
  2. 39 67
      pages/assets/assets.vue
  3. 2 2
      pages/index/convert.vue

+ 6 - 1
pages.json

@@ -231,7 +231,12 @@
 		{
 			"path": "pages/assets/assets",
 			"style": {
-				"navigationBarTitleText": "资产"
+				"navigationBarTitleText": "资产",
+				"app-plus": {
+					"titleNView": {
+						"type": "transparent"
+					}
+				}
 			}
 		},
 		{

+ 39 - 67
pages/assets/assets.vue

@@ -1,10 +1,9 @@
 <template>
 	<view class="container">
+		<view class="title">资产</view>
 		<view>
 			<view class="list-box">
-				<view class="bg">
-					<image src="../../static/img/assets-bg.png" mode=""></image>					
-				</view>
+				<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">
@@ -46,7 +45,10 @@
 			</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>
+					<view class="cell-title flex">
+						<image :src="ls.LOGO" mode="scaleToFill" class="logo"></image>
+						<view class="name">{{ ls.name }}</view>
+					</view>
 					<image src="../../static/img/img16.png"></image>
 				</view>
 				<view class="flex cell-list">
@@ -54,38 +56,17 @@
 						<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 { wallet } from '@/api/finance.js';
 import easyselect from '@/components/easy-select/easy-select.vue';
 export default {
 	components: {
@@ -97,19 +78,17 @@ export default {
 			money: '',
 			type: '',
 			moneyTypeList: [],
-			list: '',
+			list: [],
 			show: true,
 			like_rmb: '',
 			like_usdt: '',
-			wallet: '',
+			wallet: ''
 		};
 	},
 	onLoad(option) {
-		this.moneyType();
 		this.loadData();
 	},
 	onShow() {
-		this.moneyType();
 		this.loadData();
 		let show = uni.getStorageSync('showPick');
 		if (show == false) {
@@ -122,31 +101,29 @@ export default {
 	//下拉刷新
 	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:'加载中'
-			})
+				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;
+				obj.like_rmb = data.all_rmb;
+				obj.like_usdt = data.all_usdt;
+				const arr = Object.keys(data.back);
+				console.log(arr);
+				let ar = [];
+				arr.forEach(e => {
+					ar.push(data.back[e]);
+				});
+				obj.list = ar;
 				uni.hideLoading();
 			});
 		},
@@ -158,9 +135,6 @@ export default {
 				success: function() {}
 			});
 		},
-		recharge() {
-			this.$refs.popup.open();
-		},
 		selectOne(options) {
 			this.money = options.name;
 			this.type = options.code;
@@ -168,24 +142,6 @@ export default {
 		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();
 		},
@@ -235,7 +191,7 @@ export default {
 					'&way=' +
 					ls.way +
 					'&waypath=' +
-					waypath+
+					waypath +
 					'&less=' +
 					ls.less
 			});
@@ -253,6 +209,13 @@ page {
 		padding: 25rpx 40rpx;
 	}
 }
+.title {
+	font-size: 46rpx;
+	font-family: PingFang SC;
+	font-weight: bold;
+	color: $font-color-dark;
+	margin-bottom: 30rpx;
+}
 .list-tips {
 	position: absolute;
 	right: 0;
@@ -333,7 +296,7 @@ page {
 				font-size: 27rpx;
 				font-weight: bold;
 				padding-left: 10rpx;
-				color: #FFFFFF;
+				color: #ffffff;
 			}
 		}
 	}
@@ -350,6 +313,16 @@ page {
 			font-size: 34rpx;
 			font-weight: 500;
 			color: #5771df;
+			.logo{
+				border-radius: 99rpx;
+				width:50rpx ;
+				height:50rpx ;
+			}
+			.name{
+				margin-left: 20rpx;
+				color: $font-color-dark;
+				font-weight: bold;
+			}
 		}
 	}
 	.cell-list {
@@ -425,5 +398,4 @@ page {
 	width: 100%;
 	height: 100%;
 }
-
 </style>

+ 2 - 2
pages/index/convert.vue

@@ -37,9 +37,9 @@ export default {
 	data() {
 		return {
 			index: 0, //当前选中的兑出币种
-			moneyType: [],
+			moneyType: [],//兑出币种类型
 			add: { LOGO: '', name: '' }, //兑入币种
-			pushMoney: '',
+			pushMoney: '',//要兑换的金额
 			lodingType: false, //判断是否已经载入币种分类分类数据
 			show: false
 		};