lhl 2 vuotta sitten
vanhempi
commit
e80ee3700b
2 muutettua tiedostoa jossa 105 lisäystä ja 11 poistoa
  1. 75 8
      pages/heyue/heyue.vue
  2. 30 3
      pages/index/kf.vue

+ 75 - 8
pages/heyue/heyue.vue

@@ -16,8 +16,8 @@
 			</view>
 		</view>
 		<view class="box  flex padding-t-20 padding-b-30">
-			<view class="item">
-				<view class="itemName flex">
+			<view class="item" style="width: 65%;">
+				<!-- <view class="itemName flex">
 					<view class="itemMinName">
 						当前價格
 					</view>
@@ -52,7 +52,7 @@
 							{{listOBj[actionList].volCcy24h|actionMoney}}
 						</view>
 					</view>
-				</view>
+				</view> -->
 				<view class="itemTitle margin-b-20">
 					交易方向
 				</view>
@@ -148,7 +148,44 @@
 					{{typeIndex==1?'做多':'做空'}}
 				</view>
 			</view>
-
+			<view class="right-wrap">
+				<view class="line flex">
+					<view class="">
+						價格
+					</view>
+					<view class="">
+						數量
+					</view>
+				</view>
+				<!-- 買入 -->
+				<view class="" style="height: 400rpx;">
+					<view class="line flex" v-for="item in gmList" style="color: #0ecb81;">
+						<view class="">
+							{{item.pri}}
+						</view>
+						<view class="">
+							{{item.num}}
+						</view>
+					</view>
+				</view>
+				
+				<!-- 當前價格 -->
+				<view class="new-price">
+					{{listOBj[actionList].last}}
+				</view>
+				<!-- 賣出 -->
+				<view class="" style="height: 400rpx;">
+					<view class="line flex" v-for="item in mcList" style="color: #f7465c;">
+						<view class="">
+							{{item.pri}}
+						</view>
+						<view class="">
+							{{item.num}}
+						</view>
+					</view>
+				</view>
+				
+			</view>
 		</view>
 		<view class="box margin-t-30 padding-t-30 padding-b-30">
 			<view class="flex listTitleBox">
@@ -379,7 +416,11 @@
 				],
 				setTimeoutObj: '',
 				// 是否提交做多請求
-				upDataLoding: false,
+				upDataLoding: false,
+				gmList: [],
+				mcList: [],
+				gmobj: {},
+				mcobj: {}
 			}
 		},
 		watch: {
@@ -473,7 +514,9 @@
 			// 修改当前选中的数据对象
 			changeData(item) {
 				console.log(item, 'qh');
-				this.actionList = item.instId;
+				this.actionList = item.instId;
+				this.gmList = []
+				this.mcList = []
 				this.alertShow = false;
 			},
 			// 獲取保證金
@@ -549,7 +592,14 @@
 								// 算出收益率
 								item.dcf = (+((item.last - item.sodUtc0) / item.sodUtc0 * 100).toFixed(
 									2)) + '%'
-								item.name = item.instId.replace('-', '/')
+								item.name = item.instId.replace('-', '/')
+								if(that.actionList == item.instId) {
+									that.gmList.unshift({'pri':(item.bidPx*1).toFixed(5),'num': (item.bidSz*1).toFixed(5)})
+									that.gmList = that.gmList.slice(0,9)
+									that.mcList.unshift({'pri':(item.askPx*1).toFixed(5),'num': (item.askSz*1).toFixed(5)})
+									that.mcList = that.mcList.slice(0,9)
+								}
+								
 								that.listOBj = Object.assign({}, that.listOBj);
 								console.log(that.listOBj,'that.listOBj')
 							}
@@ -756,7 +806,8 @@
 		}
 
 		.item {
-			flex-grow: 1;
+			// flex-grow: 1;
+			// width: 50%;
 			flex-shrink: 0;
 		}
 
@@ -974,5 +1025,21 @@
 				font-weight: bold;
 			}
 		}
+	}
+	.right-wrap {
+		flex-grow: 1;
+		padding: 0 10rpx;
+		font-size: 12rpx;
+		color: #707A8A;
+		.line {
+			view {
+				padding: 10rpx 0;
+			}
+		}
+	}
+	.new-price {
+		font-size: 36rpx;
+		color: #0ecb81;
+		padding: 20rpx;
 	}
 </style>

+ 30 - 3
pages/index/kf.vue

@@ -1,9 +1,9 @@
 <template>
 	<view class="content">
-		<view class="">
+		<view class="flex kf-wrap">
 			<image src="../../static/img/kfheader.png" mode=""></image>
 			<view class="kf-info">
-				<view class="">
+				<view class="kf-name">
 					Json
 				</view>
 				<view class="">
@@ -11,7 +11,7 @@
 				</view>
 			</view>
 		</view>
-		<view class="" style="height: 40rpx;">
+		<view class="" style="height: 200rpx;">
 			
 		</view>
 		<view class="flex lt lt-left">
@@ -161,4 +161,31 @@
 	.lt-left {
 		align-items: flex-start;
 	}
+	.kf-wrap {
+		// border-bottom: 1px solid;
+		background-color: #fff;
+		position: fixed;
+		top: 0;
+		box-shadow: 0 -1px 5px rgba(0, 0, 0, 0.1);
+		height: 180rpx;
+		width: 100%;
+		padding: 20rpx 40rpx;
+		justify-content: flex-start;
+		align-items: center;
+		image {
+			width: 140rpx;
+			height: 140rpx;
+		}
+		.kf-info {
+			color: #eeb80d;
+			font-size: 28rpx;
+			padding-left: 10rpx;
+			.kf-name {
+				font-size: 40rpx;
+				color: #707A8A;
+				margin-bottom: 10rpx;
+			}
+			
+		}
+	}
 </style>