Fly 2 jaren geleden
bovenliggende
commit
bb6d091b4b

+ 11 - 18
components/k-line/k-line.vue

@@ -1,11 +1,7 @@
 <template>
-	<iframe class="iframe-k" :src="`https://biking.okenx.com/kline/kline.html?tokenName=${currencyVal.currency_name}`"
+	<iframe class="iframe-k" :src="`https://kline.cuwiee.com/local.html?tokenName=${currencyVal.currency_name}`"
 		frameborder="0"></iframe>
-
-	<!-- <iframe :style="{'width': '100%' , 'height': kHeight + 'px' }" src="https://kline.cuwiee.com/local.html?symbol=LTC/USDT" frameborder="0"></iframe> -->
-	<!-- 		<web-view :fullscreen="false" :style="{'width': '100%' , 'height': kHeight + 'px' }"
-			:src="`https://kline.cuwiee.com/local.html`"></web-view> -->
-
+ 
 </template>
 <script>
 	import {
@@ -14,14 +10,14 @@
 	export default {
 
 		props: {
-			kWidth: {
-				type: Number,
-				default: 0
-			},
-			kHeight: {
-				type: Number,
-				default: 0
-			},
+			// kWidth: {
+			// 	type: Number,
+			// 	default: 0
+			// },
+			// kHeight: {
+			// 	type: Number,
+			// 	default: 0
+			// },
 			// :k-width="kWidth" :k-height="kHeight"
 			height: {
 				type: String,
@@ -36,10 +32,7 @@
 		},
 		data() {
 			return {
-				webviewStyles: {
-					width: this.kWidth + 'px',
-					height: this.kHeight + 'px'
-				}
+				 
 			}
 		}
 	}

+ 1 - 0
components/sharePage/sharePage.vue

@@ -94,6 +94,7 @@
 				handler(newUrl){
 					if(newUrl){
 						this.qrcodeVal = `${newUrl}/#/pages/register?extension_code=${this.shareCode}`
+						console.log('this.qrcodeVal = ' , this.qrcodeVal)
 						this.drawCode()
 					}
 				},

+ 2 - 2
components/sharePage/share_02.vue

@@ -2,7 +2,7 @@
 	<view class="content" id="share-content" :rise-fall="stocksColor">
 		<view :class="['share-top' , $setColor(shareVal.profits)]">
 			<text class="share-currency">{{ shareVal.symbol }}</text>
-			<text class="share-ratio color">{{ $getChange(shareVal , 1) }}%</text>
+			<text class="share-ratio color">{{ $getChange(shareVal , 4) }}%</text>
 			<!-- <text class="share-ratio color">{{ shareVal.fact_profits }}%</text> -->
 		</view>
 
@@ -25,7 +25,7 @@
 
 				<view class="footer-price">
 					<text>开仓均价</text>
-					<text class="price">{{ shareVal.price }}</text>
+					<text class="price">{{ shareVal.update_price }}</text>
 				</view>
 			</view>
 		</view>

+ 0 - 401
hybrid/html/css/kline.css

@@ -1,401 +0,0 @@
-* {
-	margin: 0;
-	padding: 0;
-}
-html{
-	/* padding-top: 220px; */
-	/* background-color: #131623; */
-}
-/* #app{
-	height: 100vh;
-	width: 100vw;
-	overflow-y: scroll;
-	overflow-x: hidden;
-	-webkit-overflow-scrolling: touch;
-} */
-.head{
-	padding: 10px;
-}
-.price{
-	display: flex;
-	align-items: center;
-}
-.price-label{
-	font-size: 26px;
-	font-weight: bold;
-	color: #38ad70;
-}
-.price-value{
-	margin-left: 10px;
-	font-size: 12px;
-	color: #fff;
-	margin-top: 4px;
-}
-.head-item{
-	margin-top: 5px;
-	display: flex;
-	align-items: center;
-	justify-content: space-between;
-}
-.head-item-cell{
-	display: flex;
-	flex-direction: row;
-	align-items: center;
-}
-.hic-label{
-	font-size: 10px;
-	color: rgba(255,255,255,0.38);
-}
-.hic-value{
-	margin-left: 5px;
-	font-size: 10px;
-	color: rgba(255,255,255,0.7);
-}
-.tabs{
-	display: flex;
-	flex-direction: row;
-	align-items: center;
-	border-bottom: 1px solid rgba(255,255,255,0.1);
-	padding: 0 10px;
-}
-.tabs-item{
-	margin-right: 20px;
-	display: flex;
-	flex-direction: column;
-	align-items: center;
-}
-.tabs-item-text{
-	font-size: 12px;
-	line-height: 24px;
-	/* color: rgba(255,255,255,0.38); */
-	color: #131623;
-}
-.tabs-item-text-active{
-	color: $Theme-Color;
-}
-.tabs-item-bar{
-	width: 0;
-	height: 2px;
-	background-color: transparent;
-	transition: all .2s;
-}
-.tabs-item-bar-active{
-	width: 16px;
-	background-color: #fff;
-}
-.category{
-	position: sticky;
-	top: 0;
-	z-index: 999;
-	background-color: #131623;
-	margin-top: 10px;
-	display: flex;
-	flex-direction: row;
-	align-items: center;
-	justify-content: center;
-	border-bottom: 1px solid rgba(255,255,255,0.1);
-	padding: 0 10px;
-}
-.category-item-wrap{
-	flex: 1;
-	display: flex;
-	flex-direction: row;
-	justify-content: center;
-}
-.category-item{
-	display: flex;
-	flex-direction: column;
-	align-items: center;
-}
-.category-item-text{
-	font-size: 14px;
-	line-height: 28px;
-	color: rgba(255,255,255,0.38);
-}
-.category-item-text-active{
-	color: #fff;
-}
-.category-item-bar{
-	width: 0;
-	height: 2px;
-	background-color: transparent;
-	transition: all .2s;
-}
-.category-item-bar-active{
-	width: 100%;
-	background-color: #fff;
-}
-.category-main{
-	padding: 10px;
-}
-.depth-head{
-	display: flex;
-	flex-direction: row;
-	align-items: center;
-	justify-content: space-between;
-}
-.depth-head-left{
-	flex: 1;
-	display: flex;
-	flex-direction: row;
-	align-items: center;
-}
-.depth-head-center{
-	flex: 1;
-	display: flex;
-	flex-direction: row;
-	align-items: center;
-	justify-content: center;
-}
-.depth-head-right{
-	flex: 1;
-	display: flex;
-	flex-direction: row;
-	align-items: center;
-	justify-content: flex-end;
-}
-.depth-head-label{
-	font-size: 10px;
-	color: rgba(255,255,255,0.38);
-}
-.depth-head-left-index{
-	width: 30px;
-	margin-right: 10px;
-	text-align: left;
-}
-.depth-head-right-index{
-	width: 30px;
-	margin-left: 10px;
-	text-align: right;
-}
-.depth-main{
-	margin-top: 15px;
-	display: flex;
-	flex-direction: row;
-}
-.depth-main-item{
-	flex: 1;
-}
-.dmi-cell{
-	position: relative;
-	height: 30px;
-	display: flex;
-	flex-direction: row;
-}
-.dmi-cell-item{
-	position: absolute;
-	top: 0;
-	left: 0;
-	right: 0;
-	bottom: 0;
-	display: flex;
-	flex-direction: row;
-	align-items: center;
-}
-.dmi-cell-item-right{
-	justify-content: flex-end;
-}
-.dmi-cell-bg{
-	background-color: red;
-	width: 0;
-	height: 100%;
-}
-.dmi-cell-index{
-	width: 30px;
-	font-size: 12px;
-	color: #fff;
-}
-.dmi-cell-num{
-	flex: 1;
-	margin: 0 10px;
-	font-size: 12px;
-	color: #fff;
-}
-.dmi-cell-price{
-	font-size: 12px;
-	color: #fff;
-}
-.transaction{
-	
-}
-.transaction-head{
-	display: flex;
-	flex-direction: row;
-	align-items: center;
-	justify-content: space-between;
-}
-.transaction-head-item{
-	color: rgba(255,255,255,0.38);
-	font-size: 10px;
-}
-.transaction-main{
-	margin-top: 10px;
-}
-.transaction-main-cell{
-	display: flex;
-	flex-direction: row;
-	align-items: center;
-	justify-content: space-between;
-}
-.tmc-label{
-	color: #fff;
-	font-size: 12px;
-	height: 30px;
-	line-height: 30px;
-}
-.tmc-time{
-	width: 30%;
-}
-.tmc-type{
-	text-align: center;
-	width: 20%;
-}
-.tmc-price{
-	text-align: center;
-	width: 20%;
-}
-.tmc-num{
-	text-align: right;
-	width: 30%;
-}
-.introduction{
-	
-}
-.introduction-name{
-	color: #fff;
-	font-size: 16px;
-	font-weight: bold;
-	padding-bottom: 20px;
-}
-.introduction-cell{
-	margin-top: 20px;
-	display: flex;
-	flex-direction: row;
-	align-items: center;
-	justify-content: space-between;
-}
-.introduction-cell-label{
-	color: rgba(255,255,255,0.38);
-	font-size: 12px;
-}
-.introduction-cell-value{
-	color: #fff;
-	font-size: 12px;
-	font-weight: bold;
-}
-.introduction-label{
-	margin-top: 40px;
-	color: #fff;
-	font-size: 16px;
-	font-weight: bold;
-}
-.introduction-value{
-	margin-top: 20px;
-	color: #fff;
-	font-size: 14px;
-}
-.btns{
-	position: fixed;
-	z-index: 1000;
-	left: 0;
-	right: 0;
-	bottom: 0;
-	display: flex;
-	flex-direction: row;
-	align-items: center;
-	justify-content: center;
-	padding: 10px;
-	box-sizing: border-box;
-	background-color: #131623;
-}
-.btn{
-	flex: 1;
-	height: 40px;
-	border-radius: 4px;
-	line-height: 40px;
-	text-align: center;
-	color: #fff;
-	font-size: 16px;
-}
-.btn-green{
-	margin-right: 20px;
-	background-color: #38ad70;
-}
-.btn-red{
-	background-color: #fe5c57;
-}
-.charts-border {
-	position: relative;
-}
-
-.charts {
-	width: 100vw;
-	height: 320px;
-}
-
-.charts-label {
-	position: absolute;
-	left: 10px;
-	top: 5px;
-	font-size: 10px;
-	display: flex;
-	justify-content: center;
-	align-items: center;
-}
-
-.charts-label div {
-	margin-right: 14px;
-}
-
-.charts-MA5 {
-	color: #eef4ba;
-}
-
-.charts-MA10 {
-	color: #83c1c5;
-}
-
-.charts-MA30 {
-	color: #b39cd8;
-}
-
-.charts-bar-label {
-	position: absolute;
-	left: 10px;
-	top: 76%;
-	font-size: 10px;
-	display: flex;
-	justify-content: center;
-	align-items: center;
-}
-
-.charts-bar-label div {
-	margin-right: 14px;
-}
-
-.charts-tooltip-row {
-	display: flex;
-	flex-direction: row;
-	align-items: center;
-	justify-content: space-between;
-	padding: 5px 0;
-}
-
-.ctr-label {
-	color: #51617b;
-}
-
-.ctr-value {
-	color: #acbadf;
-	margin-left: 30px;
-}
-
-.price-green{
-	color: #38ad70;
-}
-.price-red{
-	color: #fe5c57;
-}
-iframe{
-	border: none;
-}

File diff suppressed because it is too large
+ 0 - 3
hybrid/html/js/axios.js


File diff suppressed because it is too large
+ 0 - 22
hybrid/html/js/echarts.min.js


+ 0 - 711
hybrid/html/js/kline.js

@@ -1,711 +0,0 @@
-var myChart;
-// import $store from "./../../../store"
-// post请求封装
-function post(url, data) {
-	let baseUrl = 'https://biking.okenx.com';
-	return new Promise((resolve, reject) => {
-		axios({
-				headers: {
-					"Content-Type": "application/x-www-form-urlencoded",
-				},
-				method: 'get',
-				url: baseUrl +
-					'/api/currency/new_timeshar?from=1685422833&to=1685520093&symbol=LTC/USDT&period=1min',
-
-			})
-			.then(res => {
-				console.log('res ======', res)
-				if (res.data.code == 1) {
-					resolve(res.data.data)
-				} else {
-					reject()
-					alertError('请求超时')
-				}
-			})
-			.catch(err => {
-				alertError('请求超时')
-			})
-	})
-}
-// 弹窗
-function alertError(title) {
-	document.addEventListener('plusready', function() {
-		console.log('......')
-	})
-	try {
-		plus.nativeUI.toast(title, {
-			icon: '/static/common/toast-error.png',
-			style: 'inline',
-			verticalAlign: 'top'
-		});
-	} catch (e) {
-		//TODO handle the exception
-	}
-}
-var app = new Vue({
-	el: '#app',
-	data: {
-		MA5: '',
-		MA10: '',
-		MA30: '',
-		volMA5: '',
-		volMA10: '',
-		current: 1,
-		tabs: [{
-				'label': '1分钟',
-				'value': 1
-			},
-			{
-				'label': '15分钟',
-				'value': 2
-			},
-			{
-				'label': '30分钟',
-				'value': 3
-			},
-			{
-				'label': '1小时',
-				'value': 4
-			},
-			{
-				'label': '4小时',
-				'value': 5
-			},
-			{
-				'label': '1天',
-				'value': 6
-			},
-		],
-		category: 1,
-		categoryList: [{
-				'label': '深度',
-				'value': 1
-			},
-			{
-				'label': '成交',
-				'value': 2
-			},
-			{
-				'label': '简介',
-				'value': 3
-			},
-		],
-		txData: {}, //交易数据统计
-		buyList: [],
-		sellList: [],
-		dealHis: [],
-		tokenInfo: {},
-		page: 1,
-
-	},
-	created() {
-		console.log('00')
-		this.getTxData()
-		this.getDepth()
-	},
-	mounted() {
-		myChart = echarts.init(document.getElementById('main'));
-		this.draw()
-		this.getKline()
-	},
-	methods: {
-		// 返回上一页
-		back() {
-			uni.navigateBack()
-		},
-		// 获取24小时交易数据统计
-		getTxData() {
-			this.txData = txData;
-		},
-		// 获取k线数据,生成k线
-		getKline() {
-			post().then(res => {
-				const dataX = []			 
-				res.forEach(el => {
-					dataX.push(el.time)
-					rawData.push([new Date(el.time).getTime() , el.open , el.high , el.low, el.close , el.volume ])
-					// var data = rawData.map(function(item) {
-					// 	return [+item[1], +item[2], +item[3], +item[4], +item[5]];
-					// });
-					// var volumes = rawData.map(function(item, index) {
-					// 	return [index, item[5], item[1] > item[2] ? 1 : -1];
-					// });
-				})
-				// var dataList = res.map(data => {
-				// 	// ["2004-01-05", 10411.85, 10544.07, 10411.85, 10575.92, 221290000],
-				// 		// return [new Date(data.time).getTime() , data.open , data.high , data.low, data.close , data.volume ]
-
-				// 		return{
-				// 			timestamp: new Date(data.time).getTime(),
-				// 			open: +data.open,
-				// 			high: +data.high,
-				// 			low: +data.low,
-				// 			close: +data.close,
-				// 			volume: +data.volume
-				// 		}
-				// 	})
-
-				var dates = rawData.map(function(item) {
-					console.log('dates--------' , item)
-					return item[0];
-				});
-				var data = rawData.map(function(item) {
-					return [+item[1], +item[2], +item[3], +item[4], +item[5]];
-				});
-				var volumes = rawData.map(function(item, index) {
-					return [index, item[5], item[1] > item[2] ? 1 : -1];
-				});
-
-				// this.buyList=this.addItem(res.buyList || []);
-				// this.sellList=this.addItem(res.sellList || []);
-				console.log('rawData 1= ', rawData)
-				var dataMA5 = this.calculateMA(5, data);
-				var dataMA10 = this.calculateMA(10, data);
-				var dataMA30 = this.calculateMA(30, data);
-				var volumeMA5 = this.calculateMA(5, volumes);
-				var volumeMA10 = this.calculateMA(10, volumes);
-				myChart.setOption({
-					xAxis: [{
-							// data: dates
-							data: dataX
-						},
-						{
-							data: dataX
-							// data: dates
-						},
-					],
-					series: [{
-							name: '日K',
-							data: data
-						},
-						{
-							name: 'MA5',
-							data: dataMA5
-						},
-						{
-							name: 'MA10',
-							data: dataMA10
-						},
-						{
-							name: 'MA30',
-							data: dataMA30
-						},
-						{
-							name: 'Volume',
-							data: volumes
-						},
-						{
-							name: 'VolumeMA5',
-							data: volumeMA5
-						},
-						{
-							name: 'VolumeMA10',
-							data: volumeMA10
-						},
-					]
-				})
-			})
-
-		},
-		// 列表条数不足补全
-		addItem(list, type) {
-			// type: 1开头加,2末尾加
-			list = list || [];
-			let len = 20 - list.length;
-			if (len > 0) {
-				for (let i = 0; i < len; i++) {
-					if (type == 1) {
-						list.unshift({})
-					} else {
-						list.push({})
-					}
-				}
-			}
-			return list;
-		},
-		// 获取深度数据
-		getDepth() {
-
-			this.buyList = this.addItem(depthList().buyList || []);
-			this.sellList = this.addItem(depthList().sellList || []);
-			// console.log('000' , data)
-
-		},
-		// 获取成交记录
-		getDealHis() {
-			this.dealHis = dealHis();
-		},
-		// 获取项目简介信息
-		getTokenInfo() {
-			this.tokenInfo = tokenInfo;
-		},
-
-		// 切换tab
-		switchTab(val) {
-			if (this.current == val) return;
-			this.current = val;
-			this.getKline()
-		},
-		// 切换类目
-		switchCategory(val) {
-			if (this.category == val) return;
-			this.category = val;
-			if (this.category == 1) {
-				this.getDepth()
-			} else if (this.category == 2) {
-				this.getDealHis()
-			} else {
-				this.getTokenInfo()
-			}
-		},
-		// 截取数字字符串 保留precision小数
-		formatterNum(value, precision) {
-			// console.log(value)
-			let reg = new RegExp('^\\d+(?:\\.\\d{0,' + precision + '})?')
-			return value.toString().match(reg)
-		},
-		// 计算MA
-		calculateMA(dayCount, data) {
-			var result = [];
-			for (var i = 0, len = data.length; i < len; i++) {
-				if (i < dayCount) {
-					result.push('-');
-					continue;
-				}
-				var sum = 0;
-				for (var j = 0; j < dayCount; j++) {
-					sum += data[i - j][1];
-				}
-				// console.log(sum, dayCount)
-				result.push((sum / dayCount).toFixed(2));
-			}
-			return result;
-		},
-		// 绘制(配置项)
-		draw() {
-			let that = this;
-			var upColor = '#03ad91';
-			var downColor = '#dd345b';
-			var colorList = ['#c23531', '#2f4554', '#61a0a8', '#d48265', '#91c7ae', '#749f83', '#ca8622',
-				'#bda29a', '#6e7074',
-				'#546570', '#c4ccd3'
-			];
-			var labelFont = 'bold 12px Sans-serif';
-			var option = {
-				// backgroundColor: '#0d1723',
-				title: {
-					show: false
-				},
-				legend: {
-					show: false
-				},
-				visualMap: {
-					show: false,
-					seriesIndex: 4,
-					dimension: 2,
-					pieces: [{
-						value: 1,
-						color: downColor
-					}, {
-						value: -1,
-						color: upColor
-					}]
-				},
-				grid: [{
-						top: '5%',
-						left: 20,
-						right: 20,
-						height: '70%'
-					},
-					{
-						top: '80%',
-						left: 20,
-						right: 20,
-						height: '16%'
-					},
-				],
-				axisPointer: { //坐标轴指示器配置项
-					link: {
-						xAxisIndex: 'all'
-					},
-					label: {
-						backgroundColor: '#0d1723',
-						color: '#fff',
-						// borderColor: 'rgb(99, 117, 139)',
-						borderWidth: 1,
-						borderRadius: 2,
-						fontSize: 10
-					}
-				},
-				xAxis: [{
-					type: 'category', //坐标轴类型。(value:数值轴,适用于连续数据。,category:类目轴,适用于离散的类目数据,time: 时间轴,适用于连续的时序数据,log:对数轴。适用于对数数据)
-					data: [], //类目数据,在类目轴(type: 'category')中有效。
-					scale: true,
-					boundaryGap: false, //坐标轴两边留白策略,类目轴和非类目轴的设置和表现不一样。
-					axisLine: {
-						show: false
-					}, //坐标轴轴线相关设置
-					axisTick: {
-						show: false
-					}, //坐标轴刻度相关设置。
-					axisLabel: {
-						show: false,
-					}, //坐标轴刻度标签的相关设置。
-					splitLine: {
-						show: false,
-						lineStyle: {
-							color: 'rgba(255,255,255, 0.1)'
-						}
-					}, //坐标轴在 grid 区域中的分隔线。
-					min: 'dataMin', //坐标轴刻度最小值。可以设置成特殊值 'dataMin',此时取数据在该轴上的最小值作为最小刻度。
-					max: 'dataMax', //坐标轴刻度最大值。可以设置成特殊值 'dataMax',此时取数据在该轴上的最大值作为最大刻度。
-					axisPointer: {
-						label: {
-							margin: 200
-						}
-					},
-				}, {
-					type: 'category',
-					gridIndex: 1, //x 轴所在的 grid 的索引,默认位于第一个 grid。
-					data: [], //类目数据,在类目轴(type: 'category')中有效。
-					scale: true,
-					boundaryGap: false, //坐标轴两边留白策略,类目轴和非类目轴的设置和表现不一样。
-					axisLine: {
-						show: false,
-						lineStyle: {
-							color: 'rgba(255,255,255,1)',
-							width: 1
-						}
-					}, //坐标轴轴线相关设置
-					axisTick: {
-						show: false
-					}, //坐标轴刻度相关设置。
-					axisLabel: { //坐标轴刻度标签的相关设置。
-						show: true,
-						margin: 6,
-						fontSize: 10,
-						// color: 'rgba(99, 117, 139, 1.0)',
-						formatter: function(value) {
-							return echarts.format.formatTime('MM-dd', value);
-						}
-					},
-					splitNumber: 20,
-					splitLine: {
-						show: false,
-						lineStyle: {
-							color: 'rgba(255,255,255, 0.1)'
-						}
-					}, //坐标轴在 grid 区域中的分隔线。
-					min: 'dataMin', //坐标轴刻度最小值。可以设置成特殊值 'dataMin',此时取数据在该轴上的最小值作为最小刻度。
-					max: 'dataMax', //坐标轴刻度最大值。可以设置成特殊值 'dataMax',此时取数据在该轴上的最大值作为最大刻度。
-					// axisPointer: { show: true, type: 'none', label: { show: false }},
-				}],
-				yAxis: [{
-					type: 'value', //坐标轴类型。(value:数值轴,适用于连续数据。,category:类目轴,适用于离散的类目数据,time: 时间轴,适用于连续的时序数据,log:对数轴。适用于对数数据)
-					position: 'right', //y 轴的位置。'left','right'
-					scale: true, //是否是脱离 0 值比例。设置成 true 后坐标刻度不会强制包含零刻度。在双数值轴的散点图中比较有用。(在设置 min 和 max 之后该配置项无效。)
-					axisLine: {
-						show: true
-					}, //坐标轴轴线相关设置。
-					axisTick: {
-						show: true,
-						inside: true
-					}, //坐标轴刻度相关设置。
-					axisLabel: { //坐标轴刻度标签的相关设置。
-						show: true,
-						color: 'rgba(99, 117, 139, 1.0)',
-						inside: true,
-						fontSize: 10,
-						formatter: function(value) {
-							return Number(value).toFixed(2)
-						}
-					},
-					splitLine: {
-						show: false,
-						lineStyle: {
-							color: 'rgba(255,255,255, 0.1)'
-						}
-					}, //坐标轴在 grid 区域中的分隔线。
-				}, {
-					type: 'value',
-					position: 'right',
-					scale: true,
-					gridIndex: 1,
-					axisLine: {
-						show: false
-					},
-					axisTick: {
-						show: false
-					},
-					axisLabel: {
-						show: false
-					},
-					splitLine: {
-						show: false
-					}
-				}],
-
-				animation: false, //是否开启动画。
-				color: colorList,
-				tooltip: {
-					show: true, //是否显示提示框组件,包括提示框浮层和 axisPointer。
-					trigger: 'axis', //触发类型。item,axis,none
-					formatter(params) {
-						let tooltip = '';
-						let time = '',
-							open = 0,
-							high = 0,
-							low = 0,
-							close = 0,
-							amount = 0;
-						for (var i = 0; i < params.length; i++) {
-							if (params[i].seriesName === '日K') {
-								time = params[i].name;
-								open = params[i].data.length > 1 ? Number(that.formatterNum(params[i].data[
-									1], 2)) : 0;
-								close = params[i].data.length > 1 ? Number(that.formatterNum(params[i].data[
-									2], 2)) : 0;
-								low = params[i].data.length > 1 ? Number(that.formatterNum(params[i].data[
-									3], 2)) : 0;
-								high = params[i].data.length > 1 ? Number(that.formatterNum(params[i].data[
-									4], 2)) : 0;
-								amount = params[i].data.length > 1 ? Number(that.formatterNum(params[i]
-									.data[5], 2)) : 0;
-								// console.log(time,open,close,low,high,amount)
-								tooltip = '<div class="charts-tooltip">' +
-									'<div class="charts-tooltip-row"><div class="ctr-label">' + '时间' +
-									'</div><div class="ctr-value">' + time + '</div></div>' +
-									'<div class="charts-tooltip-row"><div class="ctr-label">' + '开' +
-									'</div><div class="ctr-value">' + open + '</div></div>' +
-									'<div class="charts-tooltip-row"><div class="ctr-label">' + '高' +
-									'</div><div class="ctr-value">' + high + '</div></div>' +
-									'<div class="charts-tooltip-row"><div class="ctr-label">' + '低' +
-									'</div><div class="ctr-value">' + low + '</div></div>' +
-									'<div class="charts-tooltip-row"><div class="ctr-label">' + '收' +
-									'</div><div class="ctr-value">' + close + '</div></div>' +
-									'<div class="charts-tooltip-row"><div class="ctr-label">' + '数量' +
-									'</div><div class="ctr-value">' + amount + '</div></div></div>';
-							}
-							if (params[i].seriesName === 'MA5') {
-								that.MA5 = params[i].data !== 'NAN' ? Number(that.formatterNum(params[i]
-									.data, 2)) : 0
-							}
-							if (params[i].seriesName === 'MA10') {
-								that.MA10 = params[i].data !== 'NAN' ? Number(that.formatterNum(params[i]
-									.data, 2)) : 0
-							}
-							if (params[i].seriesName === 'MA30') {
-								that.MA30 = params[i].data !== 'NAN' ? Number(that.formatterNum(params[i]
-									.data, 2)) : 0
-							}
-							if (params[i].seriesName === 'VolumeMA5') {
-								that.volMA5 = params[i].data !== 'NAN' ? Number(that.formatterNum(params[i]
-									.data, 2)) : 0
-							}
-							if (params[i].seriesName === 'VolumeMA10') {
-								that.volMA10 = params[i].data !== 'NAN' ? Number(that.formatterNum(params[i]
-									.data, 2)) : 0
-							}
-						}
-						return tooltip;
-					},
-					triggerOn: 'click', //提示框触发的条件 'mousemove','click','mousemove|click','none'
-					textStyle: {
-						fontSize: 10
-					}, //提示框浮层的文本样式
-					backgroundColor: 'rgba(30,42,66,0.8);', //提示框浮层的背景颜色。
-					borderColor: '#2f3a56', //提示框浮层的边框颜色。
-					borderWidth: 2,
-					position: function(pos, params, el, elRect, size) { //提示框浮层的位置,默认不设置时位置会跟随鼠标的位置。
-						var obj = {
-							top: 20
-						};
-						obj[['left', 'right'][+(pos[0] < size.viewSize[0] / 2)]] = 10;
-						return obj;
-					},
-					axisPointer: { //坐标轴指示器配置项。
-						label: {
-							color: 'rgba(255,255,255,.87)',
-							fontSize: 9,
-							backgroundColor: '#020204',
-							borderColor: "#9c9fa4",
-							shadowBlur: 0,
-							borderWidth: 0.5,
-							padding: [4, 2, 3, 2],
-						},
-						animation: false,
-						type: 'cross',
-						lineStyle: {
-							color: {
-								type: 'linear',
-								x: 0,
-								y: 0,
-								x2: 0,
-								y2: 1,
-								colorStops: [{
-									offset: 0,
-									color: 'rgba(30, 42, 66, 0.1)' // 0% 处的颜色
-								}, {
-									offset: 0.7,
-									color: 'rgba(30, 42, 66,0.9)' // 100% 处的颜色
-								}, {
-									offset: 1,
-									color: 'rgba(30, 42, 66,0.2)' // 100% 处的颜色
-								}]
-							},
-							width: 10,
-							shadowColor: 'rgba(30, 42, 66,0.7)',
-							shadowBlur: 0,
-							shadowOffsetY: 68,
-						}
-					}
-				},
-
-				dataZoom: [{ //用于区域缩放
-					type: 'inside',
-					xAxisIndex: [0, 1],
-					realtime: false,
-					start: 50,
-					end: 100,
-				}],
-				series: [{
-						type: 'candlestick',
-						name: '日K',
-						data: [],
-						itemStyle: {
-							color: upColor,
-							color0: downColor,
-							borderColor: upColor,
-							borderColor0: downColor
-						},
-						markPoint: {
-							symbol: 'rect',
-							symbolSize: [-10, 0.5],
-							symbolOffset: [5, 0],
-							itemStyle: {
-								color: 'rgba(255,255,255,.87)'
-							},
-							label: {
-								color: 'rgba(255,255,255,.87)',
-								offset: [10, 0],
-								fontSize: 10,
-								align: 'left',
-								formatter: function(params) {
-									return Number(params.value).toFixed(2)
-								}
-							},
-							data: [{
-									name: 'max',
-									type: 'max',
-									valueDim: 'highest'
-								},
-								{
-									name: 'min',
-									type: 'min',
-									valueDim: 'lowest'
-								}
-							]
-						},
-					},
-					{
-						name: 'MA5',
-						type: 'line',
-						data: [],
-						symbol: 'none', //去除圆点
-						smooth: true,
-						lineStyle: {
-							normal: {
-								opacity: 1,
-								width: 1,
-								color: "#eef4ba"
-							}
-						},
-						z: 5
-					},
-					{
-						name: 'MA10',
-						type: 'line',
-						data: [],
-						symbol: 'none', //去除圆点
-						smooth: true,
-						lineStyle: {
-							normal: {
-								opacity: 1,
-								width: 1,
-								color: '#83c1c5'
-							}
-						},
-						z: 4
-					},
-					{
-						name: 'MA30',
-						type: 'line',
-						data: [],
-						symbol: 'none', //去除圆点
-						smooth: true,
-						lineStyle: {
-							normal: {
-								opacity: 1,
-								width: 1,
-								color: '#b39cd8'
-							}
-						},
-						z: 3
-					},
-					{
-						name: 'Volume',
-						type: 'bar',
-						xAxisIndex: 1,
-						yAxisIndex: 1,
-						data: []
-					},
-					{
-						name: 'VolumeMA5',
-						type: 'line',
-						xAxisIndex: 1,
-						yAxisIndex: 1,
-						data: [],
-						symbol: 'none', //去除圆点
-						smooth: true,
-						lineStyle: {
-							normal: {
-								opacity: 1,
-								width: 1,
-								color: "#eef4ba"
-							}
-						},
-						z: 5
-					},
-					{
-						name: 'VolumeMA10',
-						type: 'line',
-						xAxisIndex: 1,
-						yAxisIndex: 1,
-						data: [],
-						symbol: 'none', //去除圆点
-						smooth: true,
-						lineStyle: {
-							normal: {
-								opacity: 1,
-								width: 1,
-								color: '#83c1c5'
-							}
-						},
-						z: 4
-					},
-				]
-			};
-			myChart.setOption(option);
-			// 加载上一页数据
-			myChart.on('datazoom', function(params) {
-				let num = params.batch[0]['start'];
-				if (num == 0) {
-					console.log('到最左边了')
-				}
-			})
-			window.addEventListener('resize', () => {
-				myChart.resize()
-			})
-		}
-	}
-})

+ 0 - 128
hybrid/html/js/mock.js

@@ -1,128 +0,0 @@
-// K线数据
-// var rawData = [];
-var rawData = [
-	["2004-01-05", 10411.85, 10544.07, 10411.85, 10575.92, 221290000],
-	["2004-01-06", 10543.85, 10538.66, 10454.37, 10584.07, 191460000],
-	["2004-01-07", 10535.46, 10529.03, 10432.12, 10587.55, 225490000],
-	["2004-01-08", 10530.07, 10592.44, 10480.59, 10651.99, 237770000],
-	["2004-01-09", 10589.25, 10458.89, 10420.52, 10603.48, 223250000],
-	["2004-01-12", 10461.55, 10485.18, 10389.85, 10543.03, 197960000],
-	["2004-01-13", 10485.18, 10427.18, 10341.19, 10539.25, 197310000],
-	["2004-01-14", 10428.67, 10538.37, 10426.89, 10573.85, 186280000],
-	["2004-01-15", 10534.52, 10553.85, 10454.52, 10639.03, 260090000],
-	["2004-01-16", 10556.37, 10600.51, 10503.71, 10666.88, 254170000],
-	["2004-01-20", 10601.42, 10528.66, 10447.92, 10676.96, 224300000],
-	["2004-01-21", 10522.77, 10623.62, 10453.11, 10665.72, 214920000],
-	["2004-01-22", 10624.22, 10623.18, 10545.03, 10717.41, 219720000],
-	["2004-01-23", 10625.25, 10568.29, 10490.14, 10691.77, 234260000],
-	["2004-01-26", 10568.12, 10702.51, 10510.44, 10725.18, 186170000],
-	["2004-01-27", 10701.11, 10609.92, 10579.33, 10748.81, 206560000],
-	["2004-01-28", 10610.07, 10468.37, 10412.44, 10703.25, 247660000],
-	["2004-01-29", 10467.41, 10510.29, 10369.92, 10611.56, 273970000],
-	["2004-01-30", 10510.22, 10488.07, 10385.56, 10551.03, 208990000],
-	["2004-02-02", 10487.78, 10499.18, 10395.55, 10614.44, 224800000],
-	["2004-02-03", 10499.48, 10505.18, 10414.15, 10571.48, 183810000],
-	["2004-02-04", 10503.11, 10470.74, 10394.81, 10567.85, 227760000],
-	["2004-02-05", 10469.33, 10495.55, 10399.92, 10566.37, 187810000],
-	["2004-02-06", 10494.89, 10593.03, 10433.74, 10634.81, 182880000],
-	["2004-02-09", 10592.41, 10579.03, 10433.72, 10634.81, 160720000],
-	["2004-02-10", 10578.74, 10613.85, 10511.18, 10667.03, 160590000],
-	["2004-02-11", 10605.48, 10737.72, 10561.55, 10779.41, 277850000],
-	["2004-02-12", 10735.18, 10694.07, 10636.44, 10775.03, 197560000],
-	["2004-02-13", 10696.22, 10627.85, 10578.66, 10755.47, 208340000],
-	["2004-02-17", 10628.88, 10714.88, 10628.88, 10762.07, 169730000],
-	["2004-02-18", 10706.68, 10671.99, 10623.62, 10764.36, 164370000],
-	["2004-02-19", 10674.59, 10664.73, 10626.44, 10794.95, 219890000],
-	["2004-02-20", 10666.29, 10619.03, 10559.11, 10722.77, 220560000],
-	["2004-02-23", 10619.55, 10609.62, 10508.89, 10711.84, 229950000],
-	["2004-02-24", 10609.55, 10566.37, 10479.33, 10681.41, 225670000],
-	["2004-02-25", 10566.59, 10601.62, 10509.42, 10660.73, 192420000],
-	["2004-02-26", 10598.14, 10580.14, 10493.71, 10652.96, 223230000],
-	["2004-02-27", 10581.55, 10583.92, 10519.03, 10689.55, 200050000],
-];
-// var dates = rawData.map(function(item) {
-// 	console.log('dates--------' , item)
-// 	return item[0];
-// });
-// var data = rawData.map(function(item) {
-// 	return [+item[1], +item[2], +item[3], +item[4], +item[5]];
-// });
-// var volumes = rawData.map(function(item, index) {
-// 	return [index, item[5], item[1] > item[2] ? 1 : -1];
-// });
-
-// 交易统计数据
-var txData={
-		// 最新成交价
-		"lastPrice": 8.944,
-		// 涨幅
-		"upRate": "-79.67%",
-		// 1涨绿 2跌红
-		"upFlag": "2",
-		// 24小时交易量
-		"volume": 3,
-		// 24小时最高价
-		"high": 11.922,
-		// 24小时最低价
-		"low": 8.944
-}
-// 获取指定区间随机数
-function sum (m,n){
-  var num = Math.floor(Math.random()*(m - n) + n);
-	return num;
-}
-// 深度数据
-var depthList=function(){
-	let obj={
-		buyList:[],
-		sellList:[]
-	};
-	for(let i=0;i<20;i++){
-		obj.buyList.push({
-			"price": 0.988,
-			"amount": 12,
-			'width':sum(1,100)
-		})
-		obj.sellList.push({
-			"price": 0.252,
-			"amount": 15,
-			'width':sum(1,100)
-		})
-	}
-	return obj;
-}
-
-// 成交列表
-var dealHis=function(){
-	let arr=[];
-	for(let i =0;i<20;i++){
-		arr.push({
-			"date": "07-22 16:27:44",
-			// 1买入 2卖出
-			"takerFlag": "1",
-			"price": 44,
-			"amount": 444
-		})
-	}
-	return arr;
-}
-// 项目信息
-var tokenInfo={
-		"tokenName": "XXX",
-		// 发行时间
-		"issueDate": "2020-06-15",
-		// 发行总量
-		"totalSupply": "1000000000",
-		// 流通总量
-		"nowSupply": "--",
-		// 众筹价格
-		"price": "--",
-		// 白皮书地址
-		"whitePaper": "--",
-		// 官网
-		"webSite": "--",
-		// 区块查询
-		"exploereSite": "--",
-		// 简介
-		"remark": "--"
-}

File diff suppressed because it is too large
+ 0 - 825
hybrid/html/js/qs.js


+ 0 - 152
hybrid/html/js/uni.webview.1.5.2.js

@@ -1,152 +0,0 @@
-! function(e, n) {
-	"object" == typeof exports && "undefined" != typeof module ? module.exports = n() : "function" == typeof define &&
-		define.amd ? define(n) : (e = e || self).uni = n()
-}(this, function() {
-	"use strict";
-
-	function i(e, n) {
-		var i = {
-			options: {
-				timestamp: +new Date
-			},
-			name: e,
-			arg: n
-		};
-		if (window.__dcloud_weex_postMessage || window.__dcloud_weex_) {
-			if ("postMessage" === e) {
-				var t = {
-					data: [n]
-				};
-				return window.__dcloud_weex_postMessage ? window.__dcloud_weex_postMessage(t) : window.__dcloud_weex_.postMessage(
-					JSON.stringify(t))
-			}
-			var o = {
-				type: c,
-				args: {
-					data: i,
-					webviewIds: w
-				}
-			};
-			window.__dcloud_weex_postMessage ? window.__dcloud_weex_postMessageToService(o) : window.__dcloud_weex_.postMessageToService(
-				JSON.stringify(o))
-		}
-		if (!window.plus) return window.parent.postMessage({
-			type: c,
-			data: i,
-			pageId: ""
-		}, "*");
-		if (0 === w.length) {
-			var a = plus.webview.currentWebview();
-			if (!a) throw new Error("plus.webview.currentWebview() is undefined");
-			var d = a.parent(),
-				r = "";
-			r = d ? d.id : a.id, w.push(r)
-		}
-		if (plus.webview.getWebviewById(u)) plus.webview.postMessageToUniNView({
-			type: c,
-			args: {
-				data: i,
-				webviewIds: w
-			}
-		}, u);
-		else {
-			var s = JSON.stringify(i);
-			plus.webview.getLaunchWebview().evalJS('UniPlusBridge.subscribeHandler("'.concat(c, '",').concat(s, ",").concat(
-				JSON.stringify(w), ");"))
-		}
-	}
-	var w = [],
-		u = "__uniapp__service",
-		c = "WEB_INVOKE_APPSERVICE",
-		n = {
-			navigateTo: function(e) {
-				var n = (0 < arguments.length && void 0 !== e ? e : {}).url;
-				i("navigateTo", {
-					url: encodeURI(n)
-				})
-			},
-			navigateBack: function(e) {
-				var n = (0 < arguments.length && void 0 !== e ? e : {}).delta;
-				i("navigateBack", {
-					delta: parseInt(n) || 1
-				})
-			},
-			switchTab: function(e) {
-				var n = (0 < arguments.length && void 0 !== e ? e : {}).url;
-				i("switchTab", {
-					url: encodeURI(n)
-				})
-			},
-			reLaunch: function(e) {
-				var n = (0 < arguments.length && void 0 !== e ? e : {}).url;
-				i("reLaunch", {
-					url: encodeURI(n)
-				})
-			},
-			redirectTo: function(e) {
-				var n = (0 < arguments.length && void 0 !== e ? e : {}).url;
-				i("redirectTo", {
-					url: encodeURI(n)
-				})
-			},
-			getEnv: function(e) {
-				window.plus ? e({
-					plus: !0
-				}) : e({
-					h5: !0
-				})
-			},
-			postMessage: function(e) {
-				i("postMessage", (0 < arguments.length && void 0 !== e ? e : {}).data || {})
-			}
-		},
-		t = /uni-app/i.test(navigator.userAgent),
-		o = /complete|loaded|interactive/;
-	var a = window.my && -1 < navigator.userAgent.indexOf("AlipayClient");
-	var d = window.swan && window.swan.webView && /swan/i.test(navigator.userAgent);
-	var r = window.qq && window.qq.miniProgram && /QQ/i.test(navigator.userAgent) && /miniProgram/i.test(navigator.userAgent);
-	var s = window.tt && window.tt.miniProgram && /toutiaomicroapp/i.test(navigator.userAgent);
-	var g = window.wx && window.wx.miniProgram && /micromessenger/i.test(navigator.userAgent) && /miniProgram/i.test(
-		navigator.userAgent);
-	for (var e, v = function() {
-			window.UniAppJSBridge = !0, document.dispatchEvent(new CustomEvent("UniAppJSBridgeReady", {
-				bubbles: !0,
-				cancelable: !0
-			}))
-		}, p = [function(e) {
-			if (t) return window.__dcloud_weex_postMessage || window.__dcloud_weex_ ? document.addEventListener(
-				"DOMContentLoaded", e) : window.plus && o.test(document.readyState) ? setTimeout(e, 0) : document.addEventListener(
-				"plusready", e), n
-		}, function(e) {
-			if (g) return window.WeixinJSBridge && window.WeixinJSBridge.invoke ? setTimeout(e, 0) : document.addEventListener(
-				"WeixinJSBridgeReady", e), window.wx.miniProgram
-		}, function(e) {
-			if (r) return window.QQJSBridge && window.QQJSBridge.invoke ? setTimeout(e, 0) : document.addEventListener(
-				"QQJSBridgeReady", e), window.qq.miniProgram
-		}, function(e) {
-			if (a) {
-				document.addEventListener("DOMContentLoaded", e);
-				var n = window.my;
-				return {
-					navigateTo: n.navigateTo,
-					navigateBack: n.navigateBack,
-					switchTab: n.switchTab,
-					reLaunch: n.reLaunch,
-					redirectTo: n.redirectTo,
-					postMessage: n.postMessage,
-					getEnv: n.getEnv
-				}
-			}
-		}, function(e) {
-			if (d) return document.addEventListener("DOMContentLoaded", e), window.swan.webView
-		}, function(e) {
-			if (s) return document.addEventListener("DOMContentLoaded", e), window.tt.miniProgram
-		}, function(e) {
-			return document.addEventListener("DOMContentLoaded", e), n
-		}], l = 0; l < p.length && !(e = p[l](v)); l++);
-	e = e || {};
-	var f = "undefined" != typeof uni ? uni : {};
-	return f.navigateTo ? f.webView = e : Object.assign(f, e, {
-		webView: e
-	}), f
-});

File diff suppressed because it is too large
+ 0 - 11965
hybrid/html/js/vue.js


+ 0 - 171
hybrid/html/local.html

@@ -1,171 +0,0 @@
-<!DOCTYPE html>
-<html>
-	<head>
-		<meta charset="utf-8" />
-		<meta name="viewport" content="width=device-width, initial-scale=1">
-		<title>K线</title>
-		<link rel="stylesheet" type="text/css" href="css/kline.css"/>
-	</head>
-
-	<body>
-		<div id="app">
-			<!-- <div class="head">
-				<div class="price">
-					<span class="price-label">{{txData.lastPrice || 0}}</span>
-					<span class="price-value">≈ ${{txData.lastPrice || 0}}</span>
-				</div>
-				<div class="head-item">
-					<div class="head-item-cell">
-						<span class="hic-label">涨跌幅</span>
-						<span class="hic-value" :class="txData.upFlag==1?'price-green':'price-red'">{{txData.upRate || 0}}</span>
-					</div>
-					<div class="head-item-cell">
-						<span class="hic-label">高</span>
-						<span class="hic-value">{{txData.high || 0}}</span>
-					</div>
-				</div>
-				<div class="head-item">
-					<div class="head-item-cell">
-						<span class="hic-label">24H</span>
-						<span class="hic-value">{{txData.volume || 0}}</span>
-					</div>
-					<div class="head-item-cell">
-						<span class="hic-label">低</span>
-						<span class="hic-value">{{txData.low || 0}}</span>
-					</div>
-				</div>
-			</div> -->
-			<div class="tabs">
-				<div @click="switchTab(item.value)" class="tabs-item" v-for="(item,index) in tabs" :key="index">
-					<span class="tabs-item-text" :class="{'tabs-item-text-active':current==item.value}">{{item.label}}</span>
-					<div class="tabs-item-bar" :class="{'tabs-item-bar-active':current==item.value}"></div>
-				</div>
-			</div>
-			<div class="charts-border">
-				<div id="main" class="charts"></div>
-				<div class="charts-label">
-					<div class="charts-MA5">MA5:{{MA5 || 0}}</div>
-					<div class="charts-MA10">MA10:{{MA10 || 0}}</div>
-					<div class="charts-MA30">MA30:{{MA30 || 0}}</div>
-				</div>
-				<div class="charts-bar-label">
-					<div class="charts-MA5">MA5:{{volMA5 || 0}}</div>
-					<div class="charts-MA10">MA10:{{volMA10 || 0}}</div>
-				</div>
-			</div>
-	<!-- 		<div class="category">
-				<div class="category-item-wrap" v-for="(item,index) in categoryList" :key="index">
-					<div @click="switchCategory(item.value)" class="category-item">
-						<span class="category-item-text" :class="{'category-item-text-active':category==item.value}">{{item.label}}</span>
-						<div class="category-item-bar" :class="{'category-item-bar-active':category==item.value}"></div>
-					</div>
-				</div>
-			</div> -->
-	<!-- 		<div class="category-main">
-				<div v-if="category==1" class="depth">
-					<div class="depth-head">
-						<div class="depth-head-left">
-							<div class="depth-head-label depth-head-left-index">买盘</div>
-							<div class="depth-head-label">数量(XRD)</div>
-						</div>
-						<div class="depth-head-center">
-							<div class="depth-head-label">价格(USDT)</div>
-						</div>
-						<div class="depth-head-right">
-							<div class="depth-head-label">数量(XRD)</div>
-							<div class="depth-head-label depth-head-right-index">卖盘</div>
-						</div>
-					</div>
-					<div class="depth-main">
-						<div class="depth-main-item">
-							<div class="dmi-cell" style="justify-content: flex-end;" v-for="(item,index) in buyList" :key="index">
-								<div class="dmi-cell-bg" :style="{'width': `${item.width}%`,'backgroundColor':'#303f38'}"></div>
-								<div class="dmi-cell-item">
-									<div class="dmi-cell-index">{{index+1}}</div>
-									<div class="dmi-cell-num">{{item.amount || '--'}}</div>
-									<div class="dmi-cell-price" style="padding-right: 5px;">{{item.price || '--'}}</div>
-								</div>
-							</div>
-						</div>
-						<div class="depth-main-item">
-							<div class="dmi-cell" v-for="(item,index) in sellList || 10" :key="index">
-								<div class="dmi-cell-bg" :style="{'width': `${item.width}%`,'backgroundColor':'#3c2a2e'}"></div>
-								<div class="dmi-cell-item">
-									<div class="dmi-cell-price" style="padding-left: 5px;">{{item.price || '--'}}</div>
-									<div class="dmi-cell-num" style="text-align: right;">{{item.amount || '--'}}</div>
-									<div class="dmi-cell-index" style="text-align: right;">{{index+1}}</div>
-								</div>
-							</div>
-						</div>
-					</div>
-				</div>
-				<div v-else-if="category==2" class="transaction">
-					<div class="transaction-head">
-						<div class="transaction-head-item tmc-time">时间</div>
-						<div class="transaction-head-item tmc-type">方向</div>
-						<div class="transaction-head-item tmc-price">价格</div>
-						<div class="transaction-head-item tmc-num">数量</div>
-					</div>
-					<div class="transaction-main">
-						<div class="transaction-main-cell" v-for="(item,index) in dealHis || 10" :key="index">
-							<span class="tmc-label tmc-time">{{item.date || '--'}}</span>
-							<span class="tmc-label tmc-type" :style="{color:item.takerFlag==1?'#38ad70':'#fe5c57'}">{{item.takerFlag==1?'买入':'卖出'}}</span>
-							<span class="tmc-label tmc-price">{{item.price || '--'}}</span>
-							<span class="tmc-label tmc-num">{{item.amount || '--'}}</span>
-						</div>
-					</div>
-				</div>
-				<div v-else="category==3" class="introduction">
-					<div class="introduction-name">{{tokenInfo.tokenName || '--'}}</div>
-					<div class="introduction-cell">
-						<span class="introduction-cell-label">发行时间</span>
-						<span class="introduction-cell-value">{{tokenInfo.issueDate || '--'}}</span>
-					</div>
-					<div class="introduction-cell">
-						<span class="introduction-cell-label">发行总量</span>
-						<span class="introduction-cell-value">{{tokenInfo.totalSupply || '--'}}</span>
-					</div>
-					<div class="introduction-cell">
-						<span class="introduction-cell-label">流通总量</span>
-						<span class="introduction-cell-value">{{tokenInfo.nowSupply || '--'}}</span>
-					</div>
-					
-					<div class="introduction-cell">
-						<span class="introduction-cell-label">众筹价格</span>
-						<span class="introduction-cell-value">{{tokenInfo.price || '--'}}</span>
-					</div>
-					<div class="introduction-cell">
-						<span class="introduction-cell-label">白皮书</span>
-						<span class="introduction-cell-value">{{tokenInfo.whitePaper || '--'}}</span>
-					</div>
-					<div class="introduction-cell">
-						<span class="introduction-cell-label">官网</span>
-						<span class="introduction-cell-value">{{tokenInfo.webSite || '--'}}</span>
-					</div>
-					<div class="introduction-cell">
-						<span class="introduction-cell-label">区块查询</span>
-						<span class="introduction-cell-value">{{tokenInfo.exploereSite || '--'}}</span>
-					</div>
-					<div class="introduction-label">简介</div>
-					<div class="introduction-value">{{tokenInfo.remark || '--'}}</div>
-				</div>
-			</div>
-			<div style="height:80px"></div>
-			<div class="btns">
-				<div @click="back" class="btn btn-green">买入</div>
-				<div @click="back" class="btn btn-red">卖出</div>
-			</div> -->
-			
-			
-		</div>
-		<script type="text/javascript" src="js/uni.webview.1.5.2.js"></script>
-		<script type="text/javascript" src="js/echarts.min.js"></script>
-		<script type="text/javascript" src="js/qs.js"></script>
-		<script type="text/javascript" src="js/axios.js"></script>
-		<script type="text/javascript" src="js/vue.js"></script>
-		<script type="text/javascript" src="js/mock.js"></script>
-		<script type="text/javascript" src="js/kline.js"></script>
-	</body>
-	<script>
-	</script>
-</html>

+ 1 - 16
manifest.json

@@ -99,22 +99,7 @@
                 }
             }
         },
-        "nativePlugins" : {
-            "fy-kline" : {
-                "__plugin_info__" : {
-                    "name" : "原生K线图 - [试用版,仅用于自定义调试基座]",
-                    "description" : "K线图,支持Android,iOS",
-                    "platforms" : "Android,iOS",
-                    "url" : "https://ext.dcloud.net.cn/plugin?id=2320",
-                    "android_package_name" : "",
-                    "ios_bundle_id" : "",
-                    "isCloud" : true,
-                    "bought" : 0,
-                    "pid" : "2320",
-                    "parameters" : {}
-                }
-            }
-        }
+        "nativePlugins" : {}
     },
     /* 快应用特有相关 */
     "quickapp" : {},

+ 417 - 0
pages/contract/modules/restrict - 副本.vue

@@ -0,0 +1,417 @@
+<template>
+	<uni-popup ref="popupRef" type="bottom">
+
+		<view class="popups-box" :rise-fall="stocksColor">
+			<view class="popups-title">
+				{{ content ? '持仓止盈止损修改' : '设置止盈止损' }}
+				<text class="close-icon iconfont" @click.stop="close()">&#xeca0;</text>
+			</view>
+			<view class="popups-content">
+				<template v-if="content">
+					<view class="content-item">
+						<text class="content-lable">合约名称</text>
+						<view class="content-val">
+							<text class="val-name">{{ content.symbol }}</text>
+							<text class="val-lever">{{ content.multiple }}倍杠杆</text>
+							<text class="val-tag">{{ content.type_name }}</text>
+						</view>
+					</view>
+					<view class="content-item">
+						<text class="content-lable">开仓价格(USDT)</text>
+						<view class="content-val">
+							{{ content.origin_price }}
+						</view>
+					</view>
+					<view class="content-item">
+						<text class="content-lable">标记价格(USDT)</text>
+						<view class="content-val">
+							{{ content.update_price }}
+						</view>
+					</view>
+				</template>
+				<view class="content-restrict">
+					<view class="restrict-item">
+						<text class="restrict-lable">止盈</text>
+						<view class="restrict-btn" v-if="content">
+							<text class="iconfont">&#xe672;</text>
+							<text>按比例设置</text>
+						</view>
+					</view>
+					<view class="restrict-input-box">
+						<input class="restrict-input" v-model="target_profit_price" type="number"
+							placeholder-class="placeholder-class" placeholder="请输入触发价">
+						<text class="restrict-tag">USDT</text>
+						<text class="restrict-btn" @click.stop="target_profit_price = ''">清空</text>
+					</view>
+					<view class="restrict-input-box input-type">
+						<text class="restrict-input">市价</text>
+						<text class="restrict-tag">USDT</text>
+						<text class="restrict-btn">市价</text>
+					</view>
+					<view class="restrict-hint">
+						<text class="iconfont">&#xe8ec;</text>
+						<text>市价单的成交价格可能偏离用户下单时看到的成交价格</text>
+					</view>
+					<view class="restrict-hint2" v-if="content" :class="$setColor(profitPrice)">
+						<text>当标价价格触达{{ target_profit_price || '--'}}时,将会触发市价委托平仓</text>
+						<text>预计盈亏 <text class="color">{{ profitPrice || '--'}}</text> </text>
+					</view>
+					<view class="restrict-item">
+						<text class="restrict-lable">止损</text>
+						<view class="restrict-btn" v-if="content">
+							<text class="iconfont">&#xe672;</text>
+							<text>按比例设置</text>
+						</view>
+					</view>
+					<view class="restrict-input-box">
+						<input class="restrict-input" v-model="stop_loss_price" type="number"
+							placeholder-class="placeholder-class" placeholder="请输入触发价">
+						<text class="restrict-tag">USDT</text>
+						<text class="restrict-btn" @click.stop="stop_loss_price = ''">清空</text>
+					</view>
+					<view class="restrict-input-box input-type">
+						<text class="restrict-input">市价</text>
+						<text class="restrict-tag">USDT</text>
+						<text class="restrict-btn">市价</text>
+					</view>
+					<view class="restrict-hint">
+						<text class="iconfont">&#xe8ec;</text>
+						<text>市价单的成交价格可能偏离用户下单时看到的成交价格</text>
+					</view>
+					<view class="restrict-hint2" v-if="content" :class="$setColor(lossPrice)">
+						<text>当标价价格触达{{ stop_loss_price || '--'}}时,将会触发市价委托平仓</text>
+						<text>预计盈亏 <text class="color">{{ lossPrice || '--'}}</text></text>
+					</view>
+					<view class="content-btns">
+						<view class="content-btn cancel-btn" @click.stop="close()">
+							取消
+						</view>
+						<view class="content-btn" @click.stop="setLeverStop()">
+							确定
+						</view>
+					</view>
+				</view>
+			</view>
+		</view>
+	</uni-popup>
+</template>
+
+<script>
+	import {
+		Api_setLeverStop
+	} from "@/api/index.js"
+	import {
+		mapGetters
+	} from 'vuex'
+	export default {
+
+
+
+		data() {
+			return {
+				content: null, // null : 下单时设置 , 否则为但是仓位设置
+				target_profit_price: '',
+				stop_loss_price: '',
+				profitPrice:"",
+				lossPrice:''
+			};
+		},
+		watch:{
+			target_profit_price:{
+				handler(newPrice){
+					if(newPrice && newPrice > Number(this.content.origin_price)){
+						this.profitPrice = ((newPrice -  this.content.origin_price) * 100 / this.content.origin_price *this.content.caution_money).toFixed(2);
+					}else{
+						this.profitPrice = ''
+					}
+					
+				},
+				immediate:true
+			},
+			stop_loss_price:{
+				handler(newPrice){
+					if(newPrice && newPrice < Number(this.content.origin_price)){
+						this.lossPrice = ((newPrice - this.content.origin_price) * 100 / this.content.origin_price *this.content.caution_money).toFixed(2);
+					}else{
+						this.lossPrice = ''
+					}
+				},
+				immediate:true
+			},
+			
+		},
+		computed: {
+			...mapGetters([
+				"stocksColor"
+			])
+		},
+		mounted() {
+			// this.open()
+		},
+		methods: {
+			open(item = null) {
+				this.target_profit_price = '';
+				this.stop_loss_price = ''; 
+				this.content = item;
+				this.$nextTick(() => {
+					this.$refs.popupRef.open();
+				})
+			},
+			close() {
+				this.$refs.popupRef.close()
+			},
+			// confirm() {
+			// 	this.close();
+			// 	this.$emit('confirm')
+			// },
+			// 
+			setLeverStop() {
+				if (this.content) {
+					// 单个持仓修改
+					Api_setLeverStop({
+						id: this.content.id,
+						target_profit_price: this.target_profit_price,
+						stop_loss_price: this.stop_loss_price
+					}).then(res => {
+						this.close();
+						this.$emit('setSuccess')
+					})
+				} else {
+					// 全局下单设置
+					this.close();
+					this.$eventBus.$emit('placeOrder', {
+						target_profit_price: this.target_profit_price,
+						stop_loss_price: this.stop_loss_price
+					});
+
+				}
+
+			}
+
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.popups-box {
+		width: 100%;
+
+		.popups-title {
+			text-align: center;
+			width: 100%;
+			height: 100rpx;
+			line-height: 100rpx;
+			background-color: $box-bg;
+			position: relative;
+			font-size: 30rpx;
+			font-weight: bold;
+			border-radius: 40rpx 40rpx 0 0;
+
+			.close-icon {
+				position: absolute;
+				right: 30rpx;
+				top: 50%;
+				transform: translateY(-50%);
+			}
+		}
+
+	}
+
+	.popups-content {
+		width: 100%;
+		background-color: #fff;
+
+		.content-item {
+			width: 100%;
+			display: flex;
+			justify-content: space-between;
+			align-items: center;
+			padding: 20rpx $pages-padding;
+			font-size: 22rpx;
+
+			.content-lable {
+				color: $SizeColor;
+			}
+
+			.content-val {
+				color: #000;
+				font-weight: bold;
+
+				// <text class="val-name">LTC/USDT</text>
+				// <text class="val-lever">100倍杠杆</text>
+				// <text class="val-tag">逐仓做多</text>
+				.val-name {}
+
+				.val-tag,
+				.val-lever {
+					padding: 5rpx 4rpx;
+					color: #fff;
+					font-size: 20rpx;
+					border-radius: 4rpx;
+					margin-left: 6rpx;
+				}
+
+				.val-lever {
+
+					background-color: $Theme-Color;
+				}
+
+				.val-tag {
+
+					background-color: $Theme-Color1;
+				}
+			}
+
+			&:last-child {
+				border-bottom: 10rpx solid $border-color;
+			}
+		}
+
+		.content-restrict {
+			width: 100%;
+			padding: 0 $pages-padding;
+
+			.restrict-item {
+				width: 100%;
+				padding-top: 30rpx;
+				display: flex;
+				justify-content: space-between;
+				align-items: center;
+				font-size: 26rpx;
+				font-weight: bold;
+
+				.restrict-btn {
+					.iconfont {
+						font-size: 28rpx;
+						color: $Theme-Color;
+						margin-right: 10rpx;
+					}
+				}
+			}
+
+			.restrict-input-box {
+				margin-top: 20rpx;
+				width: 100%;
+				display: flex;
+				align-items: center;
+				font-size: 26rpx;
+				height: 80rpx;
+				border: 1rpx solid $border-color;
+				border-radius: 10rpx;
+				padding-right: 20rpx;
+
+				text {
+					flex-shrink: 0;
+				}
+
+				.restrict-input {
+					flex: 1;
+					height: 100%;
+					border: none;
+					padding: 0 20rpx;
+				}
+
+				.placeholder-class {
+					font-size: 26rpx;
+					font-weight: bold;
+				}
+
+				.restrict-tag {
+					color: $SizeColor2;
+				}
+
+				.restrict-btn {
+					color: $Theme-Color;
+					padding-left: 20rpx;
+				}
+			}
+
+			.input-type {
+				background-color: $box-bg;
+
+				.restrict-input {
+					flex: 1;
+					height: auto;
+					padding: 0 20rpx;
+					color: #000;
+					font-weight: bold;
+
+				}
+
+				.restrict-btn {
+					line-height: 1;
+					border-left: 1px solid $Theme-Color;
+					margin-left: 10rpx;
+					padding-left: 10rpx;
+				}
+			}
+
+			// <view class="restrict-hint">
+			// 	<text class="iconfont">&#xe8ec;</text>
+			// 	<text>市价单的成交价格可能偏离用户下单时看到的成交价格</text>
+			// </view>
+			// <view class="restrict-hint2">
+			// 	<text>当标价价格触达{{ target_profit_price || '--'}}时,将会触发市价委托平仓</text>
+			// 	<text>预计盈亏--</text>
+			// </view>
+			.restrict-hint {
+				width: 100%;
+				display: flex;
+				align-items: center;
+				padding-top: 10rpx;
+
+				text {
+					font-size: 22rpx;
+				}
+
+				.iconfont {
+					font-size: 26rpx;
+					margin-right: 6rpx;
+					color: #000;
+				}
+			}
+
+			.restrict-hint2 {
+				width: 100%;
+				display: flex;
+				align-items: center;
+				justify-content: space-between;
+				font-size: 20rpx;
+				color: $SizeColor;
+				padding-top: 10rpx;
+				text + text{
+					flex-shrink: 0;
+					padding-left: 10px;
+				}
+			}
+		}
+	}
+
+	.content-btns {
+		width: 100%;
+		display: flex;
+		justify-content: space-between;
+		align-items: stretch;
+		padding-top: 60rpx;
+
+		.content-btn {
+			flex: 1;
+			height: 80rpx;
+			line-height: 80rpx;
+			background-color: $Theme-Color;
+			margin-bottom: 40rpx;
+			color: #fff;
+			text-align: center;
+			font-size: 30rpx;
+			letter-spacing: 1px;
+			border-radius: 6rpx;
+		}
+
+		.cancel-btn {
+			margin-right: 20rpx;
+			border: 1rpx solid $Theme-Color;
+			background-color: #fff;
+			color: $Theme-Color;
+		}
+	}
+</style>

+ 80 - 40
pages/contract/modules/restrict.vue

@@ -1,38 +1,38 @@
 <template>
-	<uni-popup ref="popupRef" type="bottom">
+	<uni-popup ref="popupRef" type="bottom" @change="change">
 
-		<view class="popups-box">
+		<view class="popups-box" :rise-fall="stocksColor">
 			<view class="popups-title">
-				{{ content ? '持仓止盈止损修改' : '设置止盈止损' }}
+				{{ restrictOrder ? '持仓止盈止损修改' : '设置止盈止损' }}
 				<text class="close-icon iconfont" @click.stop="close()">&#xeca0;</text>
 			</view>
 			<view class="popups-content">
-				<template v-if="content">
+				<template v-if="restrictOrder">
 					<view class="content-item">
 						<text class="content-lable">合约名称</text>
 						<view class="content-val">
-							<text class="val-name">{{ content.symbol }}</text>
-							<text class="val-lever">{{ content.multiple }}倍杠杆</text>
-							<text class="val-tag">{{ content.type_name }}</text>
+							<text class="val-name">{{ restrictOrder.symbol }}</text>
+							<text class="val-lever">{{ restrictOrder.multiple }}倍杠杆</text>
+							<text class="val-tag">{{ restrictOrder.type_name }}</text>
 						</view>
 					</view>
 					<view class="content-item">
 						<text class="content-lable">开仓价格(USDT)</text>
 						<view class="content-val">
-							{{ content.origin_price }}
+							{{ restrictOrder.origin_price }}
 						</view>
 					</view>
 					<view class="content-item">
 						<text class="content-lable">标记价格(USDT)</text>
 						<view class="content-val">
-							{{ content.update_price }}
+							{{ restrictOrder.update_price }}
 						</view>
 					</view>
 				</template>
 				<view class="content-restrict">
 					<view class="restrict-item">
 						<text class="restrict-lable">止盈</text>
-						<view class="restrict-btn" v-if="content">
+						<view class="restrict-btn" v-if="restrictOrder">
 							<text class="iconfont">&#xe672;</text>
 							<text>按比例设置</text>
 						</view>
@@ -52,13 +52,13 @@
 						<text class="iconfont">&#xe8ec;</text>
 						<text>市价单的成交价格可能偏离用户下单时看到的成交价格</text>
 					</view>
-					<view class="restrict-hint2" v-if="content">
+					<view class="restrict-hint2" v-if="restrictOrder" :class="$setColor(profitPrice)">
 						<text>当标价价格触达{{ target_profit_price || '--'}}时,将会触发市价委托平仓</text>
-						<text>预计盈亏{{ profitPrice || '--'}}</text>
+						<text>预计盈亏 <text class="color">{{ profitPrice || '--'}}</text> </text>
 					</view>
 					<view class="restrict-item">
 						<text class="restrict-lable">止损</text>
-						<view class="restrict-btn" v-if="content">
+						<view class="restrict-btn" v-if="restrictOrder">
 							<text class="iconfont">&#xe672;</text>
 							<text>按比例设置</text>
 						</view>
@@ -78,9 +78,9 @@
 						<text class="iconfont">&#xe8ec;</text>
 						<text>市价单的成交价格可能偏离用户下单时看到的成交价格</text>
 					</view>
-					<view class="restrict-hint2" v-if="content">
+					<view class="restrict-hint2" v-if="restrictOrder" :class="$setColor(lossPrice)">
 						<text>当标价价格触达{{ stop_loss_price || '--'}}时,将会触发市价委托平仓</text>
-						<text>预计盈亏{{ lossPrice || '--'}}</text>
+						<text>预计盈亏 <text class="color">{{ lossPrice || '--'}}</text></text>
 					</view>
 					<view class="content-btns">
 						<view class="content-btn cancel-btn" @click.stop="close()">
@@ -100,6 +100,9 @@
 	import {
 		Api_setLeverStop
 	} from "@/api/index.js"
+	import {
+		mapGetters
+	} from 'vuex'
 	export default {
 
 
@@ -109,42 +112,69 @@
 				content: null, // null : 下单时设置 , 否则为但是仓位设置
 				target_profit_price: '',
 				stop_loss_price: '',
-				profitPrice:"",
-				lossPrice:''
+				profitPrice: "",
+				lossPrice: ''
 			};
 		},
-		watch:{
-			target_profit_price:{
-				handler(newPrice){
-					if(newPrice && newPrice > Number(this.content.origin_price)){
-						this.profitPrice = ((newPrice -  this.content.origin_price) * 100 / this.content.origin_price *this.content.caution_money).toFixed(2);
-					}else{
-						this.profitPrice = ''
+		watch: {
+			restrictOrder: {
+				handler(newOrder) {
+					console.log('this.stop_loss_price  restrictOrder ' , newOrder)
+					if (newOrder) {
+						this.calculateProfitPrice(this.target_profit_price)
+						this.calculateLossPrice(this.stop_loss_price)
 					}
-					
 				},
-				immediate:true
+				immediate: true,
+				deep: true
 			},
-			stop_loss_price:{
-				handler(newPrice){
-					if(newPrice && newPrice < Number(this.content.origin_price)){
-						this.lossPrice = ((newPrice - this.content.origin_price) * 100 / this.content.origin_price *this.content.caution_money).toFixed(2);
-					}else{
-						this.lossPrice = ''
-					}
+			target_profit_price: {
+				handler(newPrice) {
+					this.calculateProfitPrice(newPrice)
+				},
+				immediate: true
+			},
+			stop_loss_price: {
+				handler(newPrice) {
+					this.calculateLossPrice(newPrice)
 				},
-				immediate:true
+				immediate: true
 			},
-			
+
+		},
+		computed: {
+			...mapGetters([
+				"stocksColor",
+				'restrictOrder'
+			])
 		},
 		mounted() {
 			// this.open()
 		},
 		methods: {
+			calculateProfitPrice(newPrice) {
+				if (newPrice && this.restrictOrder && newPrice > Number(this.restrictOrder
+						.update_price)) {
+					this.profitPrice = ((newPrice - this.restrictOrder.update_price) * 100 / this
+						.restrictOrder.update_price * this.restrictOrder.caution_money).toFixed(2);
+				} else {
+					this.profitPrice = ''
+				}
+			},
+
+			calculateLossPrice(newPrice) {
+				if (newPrice && this.restrictOrder && newPrice < Number(this.restrictOrder.update_price)) {
+					// console.log('this.calculateLossPrice = ' , newPrice , this.restrictOrder.update_price)
+					this.lossPrice = ((newPrice - this.restrictOrder.update_price) * 100 / this
+						.restrictOrder.update_price * this.restrictOrder.caution_money).toFixed(2);
+				} else {
+					this.lossPrice = ''
+				}
+			},
 			open(item = null) {
 				this.target_profit_price = '';
-				this.stop_loss_price = ''; 
-				this.content = item;
+				this.stop_loss_price = '';
+				// this.content = item;
 				this.$nextTick(() => {
 					this.$refs.popupRef.open();
 				})
@@ -152,16 +182,25 @@
 			close() {
 				this.$refs.popupRef.close()
 			},
+			change(e) {
+				if (!e.show) {
+					this.$store.commit('websocket/set_restrictOrder', null)
+				}
+			},
+			// this.$emit('change', {
+			// 				show: false,
+			// 				type: this.type
+			// 			})
 			// confirm() {
 			// 	this.close();
 			// 	this.$emit('confirm')
 			// },
 			// 
 			setLeverStop() {
-				if (this.content) {
+				if (this.restrictOrder) {
 					// 单个持仓修改
 					Api_setLeverStop({
-						id: this.content.id,
+						id: this.restrictOrder.id,
 						target_profit_price: this.target_profit_price,
 						stop_loss_price: this.stop_loss_price
 					}).then(res => {
@@ -371,7 +410,8 @@
 				font-size: 20rpx;
 				color: $SizeColor;
 				padding-top: 10rpx;
-				text + text{
+
+				text+text {
 					flex-shrink: 0;
 					padding-left: 10px;
 				}

+ 1 - 1
pages/contract/shortcut/index.vue

@@ -22,7 +22,7 @@
 
 		<view class="iframe-box">
 			<template v-if="currencyVal.legal_id">
-				<k-line></k-line>
+					<k-line ></k-line>
 			</template>
 		</view>
 		<gap />

+ 6 - 7
pages/contract/sustainability/freight-space.vue

@@ -21,8 +21,8 @@
 								<text>{{ item.multiple }}倍杠杆</text>
 								<!-- 如果是买多,显示的全仓做多,开空显示红色全仓做空 -->
 								<!-- 类型:2:做多,1:做空 -->
-								<text class="top-left-b-tag" v-if="item.type === 2">全仓做多</text>
-								<text class="top-left-b-tag" style="background-color: red;" v-if="item.type === 1">全仓做空</text>
+								<text class="top-left-b-tag" v-if="item.type_name === '买入'">全仓做多</text>
+								<text class="top-left-b-tag" style="background-color: red;" v-if="item.type_name === '卖出'">全仓做空</text>
 							</view>
 						</view>
 
@@ -84,9 +84,9 @@
 						<view class="content-btn-item">
 							反向开仓
 						</view>
-						<view class="content-btn-item">
+					<!-- 	<view class="content-btn-item">
 							加仓
-						</view>
+						</view> -->
 					</view>
 				</view>
 				<gap />
@@ -228,9 +228,8 @@
 
 			},
 			// 设置止盈止损
-			setRestrict(item) {
-
-				console.log('setRestrict = ', item)
+			setRestrict(item) { 
+				this.$store.commit('websocket/set_restrictOrder' , item)
 				this.$emit('setProfitLoss', item)
 
 				// this.$nextTick(() => {

+ 1 - 0
store/getters.js

@@ -16,6 +16,7 @@ const getters = {
 	GiftMoneyAccount: state => state.possession.GiftMoneyAccount,
 	
 	// websocket
+	restrictOrder: state => state.websocket.restrictOrder,
 	bids: state => state.websocket.bids,
 	asks: state => state.websocket.asks,
 	daymarket: state => state.websocket.daymarket,

+ 18 - 0
store/modules/websocket.js

@@ -14,6 +14,7 @@ const getCurrencyVal = () => {
 }
 
 const state = {
+	restrictOrder: '',
 	bids: [],
 	asks: [],
 	daymarket: {},
@@ -35,6 +36,10 @@ const state = {
 }
 
 const mutations = {
+	set_restrictOrder: (state, order) => {
+		console.log('order = ', order)
+		state.restrictOrder = order;
+	},
 	set_currencySuspend: (state, status) => {
 		state.currencySuspend = status;
 	},
@@ -70,6 +75,19 @@ const mutations = {
 		state.orderList = list;
 	},
 	set_lever_trade: (state, list) => {
+		// console.log('list = ', list.tradesList)
+	
+		if (state.restrictOrder && list.tradesList.length > 0) {
+			try {
+				list.tradesList.forEach(el => {
+					if (el.id === state.restrictOrder.id) {
+						state.restrictOrder = el
+						// new throw Error('')
+						// new throw Error()
+					}
+				})
+			} catch {}
+		}
 		state.leverTrade = list;
 	},
 	// SET_CONTRACT: (state, contract) => {

+ 23 - 4
utils/websocket.js

@@ -1,6 +1,8 @@
 // import socket from "@/utils/websocket.js"
 import config from "./config.js"
-import { getStorageSync } from "./common.js"
+import {
+	getStorageSync
+} from "./common.js"
 
 let socket_api = `${config.socketUrl}:2000`
 // import io from '@/js_sdk/hyoga-uni-socket_io/uni-socket.io.js';
@@ -35,6 +37,21 @@ const filtration = (msg) => {
 		return false
 	}
 }
+// let num = 5,
+// 	aaaInterval = null
+// const aaa = () => {
+// 	clearInterval(aaaInterval)
+// 	aaaInterval = setInterval(() => {
+// 		num--;
+// 		if (num === 0) {
+// 			clearInterval(aaaInterval)
+// 			setTimeout(() => {
+// 				num = 5
+// 				aaa()
+// 			}, 2000)
+// 		}
+// 	}, 1000)
+// }
 // closeSocket();
 export const startSocket = (data) => {
 	console.log('closeSocket 初始化')
@@ -61,7 +78,7 @@ export const startSocket = (data) => {
 				store.commit('websocket/set_daymarket', msg)
 			}
 		})
- 
+
 		socket.emit('login', getStorageSync('userId'));
 		// console.log("getStorageSync('userId')" , getStorageSync('userId'))
 		socket.on('lever_trade', (msg) => {
@@ -70,9 +87,11 @@ export const startSocket = (data) => {
 			// 	const tradesList = JSON.parse(msg.tradesList)
 			// 	const obj = Object.assign({} , msg , {tradesList:tradesList})
 			// 	store.commit('websocket/set_lever_trade', obj)
-			// }
+			// } 
 			const trades_all = JSON.parse(msg.trades_all)
-			const obj = Object.assign({} , msg , {tradesList:trades_all})
+			const obj = Object.assign({}, msg, {
+				tradesList: trades_all
+			})
 			store.commit('websocket/set_lever_trade', obj)
 		})