hwq 2 vuotta sitten
vanhempi
commit
eb3900feee
2 muutettua tiedostoa jossa 28 lisäystä ja 11 poistoa
  1. 11 3
      pages/index/index.vue
  2. 17 8
      pages/transaction/transactionDetail.vue

+ 11 - 3
pages/index/index.vue

@@ -41,21 +41,28 @@
 				</view>
 			</view>
 			<view class="gnh-btm flex">
-				<view class="btm-item">
+				<view class="btm-item" @click="navto('/pages/transaction/transactionDetail?type=BTC-USDT')">
 					<view class="btm-item-name">BTC/USDT</view>
 					<template v-if="listOBj['BTC-USDT']">
 						<view class="btm-item-val" :style="{ color: listOBj['BTC-USDT'].dcf > 0 ? '#5ec886' : '#DD3745' }">{{ listOBj['BTC-USDT'].last || '--,--' }}</view>
 						<view class="btm-item-bl" :style="{ color: listOBj['BTC-USDT'].dcf > 0 ? '#5ec886' : '#DD3745' }">{{ listOBj['BTC-USDT'].dcf || '--,--' }}%</view>
 					</template>
 				</view>
-				<view class="btm-item">
+				<view class="btm-item" @click="navto('/pages/transaction/transactionDetail?type=BCH-USDT')">
 					<view class="btm-item-name">BCH/USDT</view>
 					<template v-if="listOBj['BCH-USDT']">
 						<view class="btm-item-val" :style="{ color: listOBj['BCH-USDT'].dcf > 0 ? '#5ec886' : '#DD3745' }">{{ listOBj['BCH-USDT'].last || '--,--' }}</view>
 						<view class="btm-item-bl" :style="{ color: listOBj['BCH-USDT'].dcf > 0 ? '#5ec886' : '#DD3745' }">{{ listOBj['BCH-USDT'].dcf || '--,--' }}%</view>
 					</template>
 				</view>
-				<view class="btm-item">
+				<view class="btm-item" @click="navto('/pages/transaction/transactionDetail?type=GCB-USDT')">
+					<view class="btm-item-name">GCB/USDT</view>
+					<template>
+						<view class="btm-item-val" :style="{ color: '#DD3745' }">20</view>
+						<view class="btm-item-bl" :style="{ color: '#DD3745' }">0%</view>
+					</template>
+				</view>
+				<view class="btm-item" @click="navto('/pages/transaction/transactionDetail?type=ETH-USDT')">
 					<view class="btm-item-name">ETH/USDT</view>
 					<template v-if="listOBj['ETH-USDT']">
 						<view class="btm-item-val" :style="{ color: listOBj['ETH-USDT'].dcf > 0 ? '#5ec886' : '#DD3745' }">{{ listOBj['ETH-USDT'].last || '--,--' }}</view>
@@ -171,6 +178,7 @@ export default {
 				that.scoket.scoketMessage(res => {
 					try {
 						if (res.data) {
+							// console.log(res.data, '123456');
 							that.listOBj[res.arg.instId] = res.data[0];
 							const item = that.listOBj[res.arg.instId];
 							item.dcf = (((item.last * 1 - item.sodUtc0 * 1) / (item.sodUtc0 * 1)) * 100).toFixed(2);

+ 17 - 8
pages/transaction/transactionDetail.vue

@@ -3,8 +3,8 @@
 		<web-view :src="url + type" @message="back1" ref="webH5"></web-view>
 		<!-- #ifdef H5 -->
 		<view class="btns">
-			<view @click="back('/pages/transaction/bbjy?type=' + type + '&current=1')" class="btn btn-green">買入</view>
-			<view @click="back('/pages/transaction/bbjy?type=' + type + '&current=2')" class="btn btn-red">賣出</view>
+			<view @click="back('/pages/transaction/bbjy?type=' + type + '&current=1')" class="btn btn-green" :class="{ dontbuy: isbuy != 1 }">買入</view>
+			<view @click="back('/pages/transaction/bbjy?type=' + type + '&current=2')" class="btn btn-red" :class="{ dontbuy: isbuy != 1 }">賣出</view>
 		</view>
 		<!-- #endif -->
 	</view>
@@ -16,20 +16,26 @@ export default {
 	data() {
 		return {
 			url: '/hybrid/html/local.html?type=',
-			type: ''
+			type: '',
+			isbuy: 1
 		};
 	},
 	onLoad(res) {
 		this.type = res.type;
-		console.log(this.type, 'this,type+++++++++++++');
+		console.log(res.type == 'GCB-USDT', 'this,type+++++++++++++');
+		if (res.type == 'GCB-USDT') {
+			this.isbuy = 2;
+		}
 	},
 	onShow() {},
 	methods: {
 		back(url) {
-			console.log('触发');
-			uni.navigateTo({
-				url
-			});
+			if (this.isbuy == 1) {
+				console.log('触发');
+				uni.navigateTo({
+					url
+				});
+			}
 		},
 		back1(url) {
 			console.log('触发1');
@@ -73,5 +79,8 @@ page,
 	.btn-red {
 		background-color: #fe5c57;
 	}
+	.dontbuy {
+		background-color: #aaaaaa !important;
+	}
 }
 </style>