Fly 2 vuotta sitten
vanhempi
commit
7ee63b44d7
60 muutettua tiedostoa jossa 1336 lisäystä ja 497 poistoa
  1. 1 1
      components/marketplace/marketplace.vue
  2. 51 18
      components/step/step.vue
  3. 5 4
      components/unopen/unopen.vue
  4. 107 104
      manifest.json
  5. 2 1
      pages/content/top-up.vue
  6. 80 17
      pages/contract/history/at-present.vue
  7. 50 13
      pages/contract/history/history.vue
  8. 8 1
      pages/contract/history/index.vue
  9. 38 7
      pages/contract/history/turnover.vue
  10. 103 23
      pages/contract/index.vue
  11. 101 32
      pages/contract/modules/drawer.vue
  12. 2 2
      pages/contract/modules/restrict.vue
  13. 437 59
      pages/contract/shortcut/index.vue
  14. 48 16
      pages/contract/sustainability/freight-space.vue
  15. 17 8
      pages/contract/sustainability/index.scss
  16. 161 98
      pages/contract/sustainability/index.vue
  17. 1 2
      pages/contract/sustainability/lever.vue
  18. 2 2
      pages/exchange/index.vue
  19. 13 34
      pages/index/index.vue
  20. 15 18
      pages/index/modules/market.vue
  21. 3 15
      pages/index/modules/usdt.vue
  22. 0 2
      pages/property/index.vue
  23. BIN
      static/1-1首页-已登录 (1)/NFT@2x.png
  24. BIN
      static/1-1首页-已登录 (1)/banner.png
  25. BIN
      static/1-1首页-已登录 (1)/banner@2x.png
  26. BIN
      static/1-1首页-已登录 (1)/图层 7 拷贝 4.png
  27. BIN
      static/1-1首页-已登录 (1)/图层 7 拷贝 4@2x.png
  28. BIN
      static/1-1首页-已登录 (1)/快捷合约@2x.png
  29. BIN
      static/1-1首页-已登录 (1)/摸拟合约@2x.png
  30. BIN
      static/1-1首页-已登录 (1)/永续合约@2x.png
  31. BIN
      static/1-1首页-已登录 (1)/积分商城@2x.png
  32. BIN
      static/1-1首页-已登录 (1)/组 24352@2x.png
  33. BIN
      static/1-1首页-已登录 (1)/组 24353@2x.png
  34. BIN
      static/1-1首页-已登录 (1)/组 24359@2x.png
  35. BIN
      static/1-1首页-已登录 (1)/组 24359_1@2x.png
  36. BIN
      static/1-1首页-已登录 (1)/组 24359_2@2x.png
  37. BIN
      static/1-1首页-已登录 (1)/组 24720.png
  38. BIN
      static/1-1首页-已登录 (1)/组 24720@2x.png
  39. BIN
      static/1-1首页-已登录 (1)/组 24721.png
  40. BIN
      static/1-1首页-已登录 (1)/组 24721@2x.png
  41. BIN
      static/1-1首页-已登录 (1)/组 24722.png
  42. BIN
      static/1-1首页-已登录 (1)/组 24722@2x.png
  43. BIN
      static/1-1首页-已登录 (1)/赠金交易@2x.png
  44. BIN
      static/1-1首页-已登录 (1)/路径 4199.png
  45. BIN
      static/1-1首页-已登录 (1)/路径 4199@2x.png
  46. BIN
      static/1-1首页-已登录 (1)/路径 4201.png
  47. BIN
      static/1-1首页-已登录 (1)/路径 4201@2x.png
  48. BIN
      static/1-1首页-已登录 (1)/路径 4203.png
  49. BIN
      static/1-1首页-已登录 (1)/路径 4203@2x.png
  50. BIN
      static/fontsize/阿里妈妈数黑体.zip
  51. BIN
      static/zhengshu/5f3240d3be1d4769887117dd66f2853d.keystore
  52. 2 0
      static/zhengshu/新建 文本文档.txt
  53. 6 0
      store/getters.js
  54. 2 0
      store/modules/app.config.js
  55. 54 12
      store/modules/websocket.js
  56. 1 0
      uni.scss
  57. 2 1
      uni_modules/uni-popup/components/uni-popup/uni-popup.vue
  58. 5 2
      uni_modules/uni-table/components/uni-tr/uni-tr.vue
  59. 18 4
      utils/common-request.js
  60. 1 1
      utils/websock.js

+ 1 - 1
components/marketplace/marketplace.vue

@@ -40,7 +40,7 @@
 						<text class="title-sub">{{ val.legal_name ? `/${val.legal_name}` : '' }}</text>
 					</view>
 					<view class="title-num">
-						24H额:{{ val.volume }}m
+						24H额:{{ val.volume }}
 					</view>
 				</view>
 			</uni-td>

+ 51 - 18
components/step/step.vue

@@ -1,14 +1,20 @@
 <template>
 	<view class="step-box">
 		<view class="slider-item-box">
-			<u-slider class="step-slider" v-model="stepRatio" activeColor="#05C175" min="1" max="100" inactiveColor="#e6e6e6">
+			<u-slider class="step-slider" v-model="stepRatio" activeColor="#05C175" min="0" max="100"
+				inactiveColor="#e6e6e6">
 			</u-slider>
 			<view class="slider-item">
-				<text :class="['item' , stepRatio >= 0 ? 'active-item' : '' , stepRatio == 0 ? 'now-item' : '' ]"></text>
-				<text :class="['item' , stepRatio >= 25 ? 'active-item' : '' , stepRatio == 25 ? 'now-item' : '' ]"></text>
-				<text :class="['item' , stepRatio >= 50 ? 'active-item' : '' , stepRatio == 50 ? 'now-item' : '' ]"></text>
-				<text :class="['item' , stepRatio >= 75 ? 'active-item' : '' , stepRatio == 75 ? 'now-item' : '' ]"></text>
-				<text :class="['item' , stepRatio >= 100 ? 'active-item' : '' , stepRatio == 100 ? 'now-item' : '' ]"></text>
+				<text
+					:class="['item' , stepRatio >= 0 ? 'active-item' : '' , stepRatio == 0 ? 'now-item' : '' ]"></text>
+				<text
+					:class="['item' , stepRatio >= 25 ? 'active-item' : '' , stepRatio == 25 ? 'now-item' : '' ]"></text>
+				<text
+					:class="['item' , stepRatio >= 50 ? 'active-item' : '' , stepRatio == 50 ? 'now-item' : '' ]"></text>
+				<text
+					:class="['item' , stepRatio >= 75 ? 'active-item' : '' , stepRatio == 75 ? 'now-item' : '' ]"></text>
+				<text
+					:class="['item' , stepRatio >= 100 ? 'active-item' : '' , stepRatio == 100 ? 'now-item' : '' ]"></text>
 			</view>
 		</view>
 		<view class="step-node-nums">
@@ -27,14 +33,38 @@
 			width: {
 				type: Number,
 				default: 0
+			},
+			percent: {
+				type: Number,
+				default: 0
 			}
 		},
 		data() {
 			return {
-				stepRatio: 30,
+				stepRatio: 0,
 
 			};
 		},
+		watch: {
+			percent: {
+				handler(newPercent , old) {
+					if(newPercent !== old){
+						this.stepRatio = newPercent || 0
+					}
+					
+				},
+				immediate: true
+			},
+			stepRatio: {
+				handler(stepRatio , old) {
+					if(stepRatio !== old){
+						this.$emit("update:percent", stepRatio)
+					}
+					
+				},
+				immediate: true
+			}
+		},
 		methods: {
 
 		}
@@ -63,6 +93,7 @@
 				display: flex;
 				justify-content: space-between;
 				align-items: center;
+
 				.item {
 					width: 16rpx;
 					height: 16rpx;
@@ -70,14 +101,13 @@
 					border: 4rpx solid #e6e6e6;
 					border-radius: 50%;
 				}
-				
-				 
-				.active-item{
-					border-color:  #05c175;
-				}
-				.now-item{
-						 
+
+
+				.active-item {
+					border-color: #05c175;
 				}
+
+				.now-item {}
 			}
 		}
 
@@ -110,12 +140,13 @@
 			}
 		}
 
-		.step-node-nums{
+		.step-node-nums {
 			width: 100%;
 			display: flex;
 			justify-content: space-between;
 			padding-top: 10rpx;
-			.num-ratio{
+
+			.num-ratio {
 				flex: 1;
 				font-size: 20rpx;
 				font-family: PingFang SC, PingFang SC-Regular;
@@ -123,10 +154,12 @@
 				text-align: center;
 				color: #808080;
 				line-height: 28rpx;
-				&:first-child{
+
+				&:first-child {
 					text-align: left;
 				}
-				&:last-child{
+
+				&:last-child {
 					text-align: right;
 				}
 			}

+ 5 - 4
components/unopen/unopen.vue

@@ -3,7 +3,7 @@
 
 		<view class="unopen-box">
 			<view class="unopen-title">
-				提示
+				{{ title }}
 			</view>
 			<view class="unopen-content">
 				<view class="content" :style="{'text-align': textAlign}">
@@ -54,14 +54,15 @@
 		},
 		data() {
 			return {
-
+				dataVal:null
 			};
 		},
 		mounted() {
 			// this.$refs.popupRef.open()
 		},
 		methods: {
-			open() {
+			open(val) {
+				this.dataVal = val
 				this.$nextTick(() => {
 					this.$refs.popupRef.open();
 				})
@@ -71,7 +72,7 @@
 			},
 			confirm() {
 				this.close();
-				this.$emit('confirm')
+				this.$emit('confirm' , this.dataVal)
 			}
 
 		}

+ 107 - 104
manifest.json

@@ -1,105 +1,108 @@
 {
-	"name": "币王",
-	"appid": "__UNI__053A230",
-	"description": "",
-	"versionName": "2.4.8",
-	"versionCode": 200,
-	"transformPx": false,
-	/* 5+App特有相关 */
-	"app-plus": {
-		"safearea": {
-			"bottom": {
-				"offset": "none"
-			}
-		},
-		"usingComponents": true,
-		"nvueStyleCompiler": "uni-app",
-		"compilerVersion": 3,
-		"splashscreen": {
-			"alwaysShowBeforeRender": true,
-			"waiting": true,
-			"autoclose": true,
-			"delay": 0
-		},
-		/* 模块配置 */
-		"modules": {},
-		/* 应用发布信息 */
-		"distribute": {
-			/* android打包配置 */
-			"android": {
-				"permissions": [
-					"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
-					"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
-					"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
-					"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
-					"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
-					"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
-					"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
-					"<uses-permission android:name=\"android.permission.CAMERA\"/>",
-					"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
-					"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
-					"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
-					"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
-					"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
-					"<uses-feature android:name=\"android.hardware.camera\"/>",
-					"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
-				]
-			},
-			/* ios打包配置 */
-			"ios": {},
-			/* SDK配置 */
-			"sdkConfigs": {
-				"share": {
-					"weixin": {
-						"appid": "",
-						"UniversalLinks": ""
-					},
-					"qq": {
-						"appid": "",
-						"UniversalLinks": ""
-					}
-				}
-			}
-		}
-	},
-	/* 快应用特有相关 */
-	"quickapp": {},
-	/* 小程序特有相关 */
-	"mp-weixin": {
-		"appid": "",
-		"setting": {
-			"urlCheck": false
-		},
-		"usingComponents": true
-	},
-	"mp-alipay": {
-		"usingComponents": true
-	},
-	"mp-baidu": {
-		"usingComponents": true
-	},
-	"mp-toutiao": {
-		"usingComponents": true
-	},
-	// "h5": {
-	// 	"devServer": {
-	// 		// "port" : 8080, //浏览器运行端口
-	// 		"https": false,
-	// 		"proxy": {
-	// 			"/baseUrlTest": {
-	// 				"target": "https://doc.okenx.com",
-	// 				"changeOrigin": true,
-	// 				"secure": false,
-	// 				"pathRewrite": {
-	// 					"^": ""
-	// 				}
-	// 			}
-	// 		},
-	// 		"disableHostCheck":true
-	// 	}
-	// },
-	"uniStatistics": {
-		"enable": false
-	},
-	"vueVersion": "2"
-}
+    "name" : "币王",
+    "appid" : "__UNI__053A230",
+    "description" : "",
+    "versionName" : "2.4.8",
+    "versionCode" : 200,
+    "transformPx" : false,
+    /* 5+App特有相关 */
+    "app-plus" : {
+        "safearea" : {
+            "bottom" : {
+                "offset" : "none"
+            }
+        },
+        "usingComponents" : true,
+        "nvueStyleCompiler" : "uni-app",
+        "compilerVersion" : 3,
+        "splashscreen" : {
+            "alwaysShowBeforeRender" : true,
+            "waiting" : true,
+            "autoclose" : true,
+            "delay" : 0
+        },
+        /* 模块配置 */
+        "modules" : {},
+        /* 应用发布信息 */
+        "distribute" : {
+            /* android打包配置 */
+            "android" : {
+                "permissions" : [
+                    "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
+                    "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
+                    "<uses-permission android:name=\"android.permission.VIBRATE\"/>",
+                    "<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
+                    "<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
+                    "<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
+                    "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
+                    "<uses-permission android:name=\"android.permission.CAMERA\"/>",
+                    "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
+                    "<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
+                    "<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
+                    "<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
+                    "<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
+                    "<uses-feature android:name=\"android.hardware.camera\"/>",
+                    "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
+                ]
+            },
+            /* ios打包配置 */
+            "ios" : {
+                "dSYMs" : false
+            },
+            /* SDK配置 */
+            "sdkConfigs" : {
+                "share" : {
+                    "weixin" : {
+                        "appid" : "",
+                        "UniversalLinks" : ""
+                    },
+                    "qq" : {
+                        "appid" : "",
+                        "UniversalLinks" : ""
+                    }
+                },
+                "ad" : {}
+            }
+        }
+    },
+    /* 快应用特有相关 */
+    "quickapp" : {},
+    /* 小程序特有相关 */
+    "mp-weixin" : {
+        "appid" : "",
+        "setting" : {
+            "urlCheck" : false
+        },
+        "usingComponents" : true
+    },
+    "mp-alipay" : {
+        "usingComponents" : true
+    },
+    "mp-baidu" : {
+        "usingComponents" : true
+    },
+    "mp-toutiao" : {
+        "usingComponents" : true
+    },
+    // "h5": {
+    // 	"devServer": {
+    // 		// "port" : 8080, //浏览器运行端口
+    // 		"https": false,
+    // 		"proxy": {
+    // 			"/baseUrlTest": {
+    // 				"target": "https://doc.okenx.com",
+    // 				"changeOrigin": true,
+    // 				"secure": false,
+    // 				"pathRewrite": {
+    // 					"^": ""
+    // 				}
+    // 			}
+    // 		},
+    // 		"disableHostCheck":true
+    // 	}
+    // },
+    "uniStatistics" : {
+        "enable" : false
+    },
+    "vueVersion" : "2"
+}

+ 2 - 1
pages/content/top-up.vue

@@ -25,7 +25,7 @@
 				</view>
 				<view class="select-currency" @click.stop="selectCurrency">
 					<text>请选择币种</text>
-					<text class="iconfont">&#xe88e;</text>
+					<text class="iconfont">&#xe8b5;</text>
 				</view>
 			</view>
 			<view class="link-name">
@@ -196,6 +196,7 @@
 
 				.iconfont {
 					color: #ccc;
+					transform: rotateY(180deg);
 				}
 			}
 

+ 80 - 17
pages/contract/history/at-present.vue

@@ -1,27 +1,27 @@
 <template>
 	<view class="">
-		<view class="lable-title">
-			<text class="lable-title-text">仓位信息</text>
-			<text class="lable-title-btn" @click.stop="setCloseLeverAll()">全部平仓</text>
+		<view class="lable-title" v-if="list.length > 0">
+			<text class="lable-title-text">委托信息</text>
+			<text class="lable-title-btn" @click.stop="setCloseLeverAll()">全部撤单</text>
 		</view>
-		<u-list class="swiper-list" :style="{'height': scrollHeight ? `${scrollHeight}px` : '' }">
-
+		<u-list class="swiper-list" :style="{'height': scrollHeight ? `${scrollHeight}px` : '' }" @scrolltolower="scrolltolower">
 			<template v-for="item in list">
 				<view class="content-box" :rise-fall="stocksColor">
 					<view class="content-top">
 						<view class="top-left">
 							<view class="top-left-title">
 								<text>{{ item.symbol }}</text>
-								<text>{{ item.type_name }}</text>
+								<text v-if="item.settled == 0">永续</text>
+								<text v-else-if="item.settled == 9">快捷</text>
 							</view>
 							<view class="top-left-b">
 								<text>{{ item.multiple }}倍杠杆</text>
-								<text class="top-left-b-tag">逐仓做多</text>
+								<text class="top-left-b-tag">{{ item.type_name }}</text>
 							</view>
 						</view>
 
 						<view class="top-right  top-right-btns">
-							<text class="top-right-btn">撤单</text>
+							<text class="top-right-btn" @click.stop="setCloseLeverAll()">撤单</text>
 						</view>
 					</view>
 					<view class="content-info">
@@ -59,8 +59,12 @@
 
 				</view>
 				<gap />
+				<view class="loadmore-box" v-show="loadStatus">
+					<u-loadmore :status="loadStatus" nomoreText="没有更多数据" :fontSize='28'  :iconSize='30'/>
+				</view>
 			</template>
 		</u-list>
+			<restrictPopup ref="restrictRef" @setSuccess="setSuccess" />
 	</view>
 </template>
 
@@ -71,6 +75,7 @@
 	import {
 		Api_getRegister
 	} from "@/api/index.js"
+	import restrictPopup from "./../modules/restrict.vue"
 	export default {
 		name: 'login',
 		props: {
@@ -78,20 +83,31 @@
 				type: Number,
 				default: 0
 			},
+			legal_id:{
+				type: [Number , String],
+				default: ''
+			},
+			currency_id:{
+				type: [Number , String],
+				default: ''
+			},
 			status: {
 				type: Number,
 				default: ''
-			},
+			}, 
 		},
 		data() {
 			return {
 				scrollHeight: 0,
 				list: [],
+				loadStatus: '', // loading / nomore / loadmore
 				limit: 10,
 				page: 1,
 			};
 		},
-		// 80rpx
+		components: {
+			restrictPopup
+		},
 		watch: {
 			listHeight: {
 				handler(newH) {
@@ -104,9 +120,7 @@
 			status: {
 				handler(newSatus, oldStatus) {
 					if (newSatus === 0 && newSatus !== oldStatus) {
-						this.limit = 10;
-						this.page = 1;
-						this.getRegister()
+						this.initData()
 					}
 				},
 				immediate: true
@@ -121,19 +135,68 @@
 
 		},
 		methods: {
+			// 初始化
+			initData(){
+				this.limit = 10;
+				this.page = 1;
+				this.getRegister()
+			},
+			setSuccess() {
+				 this.initData()
+			},
+			// 设置止盈止损
+			setRestrict(item) {
+				this.$nextTick(() => {
+					this.$refs.restrictRef.open(item)
+				})
+			},
+			scrolltolower() {
+				if (this.loadStatus === 'loadmore') {
+					this.page ++;
+					this.getRegister()
+				}
+			},
 			getRegister() {
+				if (this.loadStatus === 'loading') {
+					return false
+				};
+				this.loadStatus = 'loading'
 				Api_getRegister({
 					status: this.status,
-					legal_id: 3,
-					currency_id: 1,
 					page: this.page,
-					limit: this.limit
+					limit: this.limit,
 				}).then(res => {
-					console.log('res', res)
 					const data = res.message;
 					this.list = this.list.concat(data.data)
+					this.page = data.current_page
+					if (this.list.length >= data.total) {
+						this.loadStatus = 'nomore'
+					} else {
+						this.loadStatus = 'loadmore' 
+					}
+				}).catch(err => {
+					if (this.page >= 2) {
+						this.page -= 1;
+						this.loadStatus = 'loadmore'
+					} else {
+						this.loadStatus = 'nomore'
+					}
 				})
 			}
+			
+			// getRegister() {
+			// 	Api_getRegister({
+			// 		status: this.status,
+			 
+			// 		page: this.page,
+			// 		limit: this.limit,
+			// 		settled:0
+			// 	}).then(res => {
+			// 		console.log('res', res)
+			// 		const data = res.message;
+			// 		this.list = this.list.concat(data.data)
+			// 	})
+			// }
 		}
 	}
 </script>

+ 50 - 13
pages/contract/history/history.vue

@@ -1,10 +1,11 @@
 <template>
 	<view class="">
-		<view class="lable-title">
+		<view class="lable-title" v-if="list.length > 0">
 			<view class=""></view>
 			<text class="lable-title-icon iconfont">&#xe611;</text>
 		</view>
-		<u-list class="swiper-list" :style="{'height': scrollHeight ? `${scrollHeight}px` : '' }">
+		<u-list class="swiper-list" :style="{'height': scrollHeight ? `${scrollHeight}px` : '' }"
+			@scrolltolower="scrolltolower">
 
 			<template v-for="item in list">
 				<view class="content-box" :rise-fall="stocksColor">
@@ -12,12 +13,13 @@
 						<view class="top-left">
 							<view class="top-left-title">
 								<text>{{ item.symbol }}</text>
-								<text>{{ item.type_name }}</text>
+								<text v-if="item.settled == 0">永续</text>
+								<text v-else-if="item.settled == 9">快捷</text>
 							</view>
 							<view class="top-left-b">
 								<text>{{ item.multiple }}倍杠杆</text>
-								<text class="top-left-b-tag">逐仓做多</text>
-								<text class="top-left-b-tag">逐仓做多</text>
+								<text class="top-left-b-tag">{{ item.type_name }}</text>
+								<text class="top-left-b-tag">{{ item.status_name }}</text>
 							</view>
 						</view>
 
@@ -52,7 +54,7 @@
 						</view>
 						<view class="info-item">
 							<text class="info-item-lable">平仓类型(USDT)</text>
-							<text class="info-item-val">{{ item.type_name }}</text>
+							<text class="info-item-val">{{ item.status === 3 ? '强制平仓' : '' }}</text>
 						</view>
 					</view>
 					<view class="record-hint">
@@ -65,6 +67,9 @@
 				</view>
 				<gap />
 			</template>
+			<view class="loadmore-box" v-show="loadStatus">
+				<u-loadmore :status="loadStatus" nomoreText="没有更多数据" :fontSize='28'  :iconSize='30'/>
+			</view>
 		</u-list>
 	</view>
 </template>
@@ -90,10 +95,11 @@
 		},
 		data() {
 			return {
-				scrollHeight: 0,
-				list: [],
+				loadStatus: '', // loading / nomore / loadmore
 				limit: 10,
 				page: 1,
+				scrollHeight: 0,
+				list: [],
 			};
 		},
 		// 80rpx
@@ -126,17 +132,39 @@
 			// this.getRegister()
 		},
 		methods: {
+			scrolltolower() {
+				console.log('scrolltolower = ')
+				if (this.loadStatus === 'loadmore') {
+					// loadStatus: 'loading', // loading / nomore / loadmore
+					this.page ++;
+					this.getRegister()
+				}
+			},
 			getRegister() {
+				if (this.loadStatus === 'loading') {
+					return false
+				};
+				this.loadStatus = 'loading'
 				Api_getRegister({
 					status: this.status,
-					legal_id: 3,
-					currency_id: 1,
-					page:this.page,
-					limit:this.limit
+					page: this.page,
+					limit: this.limit
 				}).then(res => {
-					console.log('res', res)
 					const data = res.message;
 					this.list = this.list.concat(data.data)
+					this.page = data.current_page
+					if (this.list.length >= data.total) {
+						this.loadStatus = 'nomore'
+					} else {
+						this.loadStatus = 'loadmore' 
+					}
+				}).catch(err => {
+					if (this.page >= 2) {
+						this.page -= 1;
+						this.loadStatus = 'loadmore'
+					} else {
+						this.loadStatus = 'nomore'
+					}
 				})
 			}
 		}
@@ -145,4 +173,13 @@
 
 <style lang="scss" scoped>
 	@import "~../sustainability/index.scss";
+	.top-right-float{
+		text{
+			border: none;
+		}
+	}
+	.top-left-b-tag{
+		font-size: 20rpx;
+		border-radius: 5rpx;
+	}
 </style>

+ 8 - 1
pages/contract/history/index.vue

@@ -23,7 +23,7 @@
 			<swiper class="swiper-content" :current="historyIdex"
 				:style="{'height': swiperHeight ? `${swiperHeight}px` : '' }">
 				<swiper-item class="swiper-item-box">
-					<at-present :listHeight="swiperHeight" :status="historyLable[historyIdex].status" />
+					<at-present :listHeight="swiperHeight" :status="historyLable[historyIdex].status" :legal_id="legal_id" :currency_id="currency_id"/>
 					<!-- <view class="swiper-item" :style="{'height': listHeight[0] ? `${listHeight[0]}px` : '' }">{{ listHeight[0] }}</view> -->
 				</swiper-item>
 				<swiper-item>
@@ -59,6 +59,8 @@
 		},
 		data() {
 			return {
+				legal_id:'',
+				currency_id:'',
 				swiperHeight: 0,
 
 				historyIdex: 2,
@@ -111,6 +113,11 @@
 			},
 			
 		},
+		onLoad(opt) {
+			this.legal_id = opt?.legal_id;
+			this.currency_id = opt?.currency_id;
+			// ?legal_id=3&currency_id=1
+		},
 		mounted() {
 
 		},

+ 38 - 7
pages/contract/history/turnover.vue

@@ -1,10 +1,10 @@
 <template>
 	<view class="">
-		<view class="lable-title">
+		<view class="lable-title" v-if="list.length > 0">
 			<view class=""></view>
 			<text class="lable-title-icon iconfont">&#xe611;</text>
 		</view>
-		<u-list class="swiper-list" :style="{'height': scrollHeight ? `${scrollHeight}px` : '' }">
+		<u-list class="swiper-list" :style="{'height': scrollHeight ? `${scrollHeight}px` : '' }" @scrolltolower="scrolltolower">
 
 			<template v-for="item in list">
 				<view class="content-box" :rise-fall="stocksColor">
@@ -12,7 +12,8 @@
 						<view class="top-left">
 							<view class="top-left-title">
 								<text>{{ item.symbol }}</text>
-								<text>{{ item.type_name }}</text>
+								<!-- <text>{{ item.type_name }}</text> -->
+								<text class="top-left-b-tag">{{ item.type_name }}</text>
 							</view>
 						 
 						</view>
@@ -49,6 +50,9 @@
 				</view>
 				<gap />
 			</template>
+			<view class="loadmore-box" v-show="loadStatus">
+				<u-loadmore :status="loadStatus" nomoreText="没有更多数据" :fontSize='28'  :iconSize='30'/>
+			</view>
 		</u-list>
 	</view>
 </template>
@@ -77,6 +81,7 @@
 			return {
 				scrollHeight:0,
 				list: [],
+				loadStatus: '', // loading / nomore / loadmore
 				limit: 10,
 				page: 1,
 			};
@@ -111,16 +116,37 @@
 			// this.getRegister()
 		},
 		methods: {
+			scrolltolower() {
+				if (this.loadStatus === 'loadmore') {
+					this.page ++;
+					this.getRegister()
+				}
+			},
 			getRegister() {
+				if (this.loadStatus === 'loading') {
+					return false
+				};
+				this.loadStatus = 'loading'
 				Api_getRegister({
 					status: this.status,
-					legal_id: 3,
-					currency_id: 1,
-					page:this.page,
-					limit:this.limit
+					page: this.page,
+					limit: this.limit,
 				}).then(res => {
 					const data = res.message;
 					this.list = this.list.concat(data.data)
+					this.page = data.current_page;
+					if (this.list.length >= data.total) {
+						this.loadStatus = 'nomore'
+					} else {
+						this.loadStatus = 'loadmore' 
+					}
+				}).catch(err => {
+					if (this.page >= 2) {
+						this.page -= 1;
+						this.loadStatus = 'loadmore'
+					} else {
+						this.loadStatus = 'nomore'
+					}
 				})
 			}
 		}
@@ -129,4 +155,9 @@
 
 <style lang="scss" scoped>
 	@import "~../sustainability/index.scss";
+	.top-left-b-tag{
+		padding-left: 30rpx !important;
+		padding-right: 30rpx !important;
+		line-height: 1;
+	}
 </style>

+ 103 - 23
pages/contract/index.vue

@@ -11,14 +11,15 @@
 				</view>
 			</template>
 		</headContent>
-		
+
 		<!-- 永续合约 -->
 		<template v-if="contractIndex === 0">
-			<sustainability :currency-info="currency"/>
+			<sustainability ref="sustainabilityRef" :currency-info="currencyVal" :leverTransaction="lever_transaction"
+				:pagesInfo="pagesInfo" :rate-profits-total="rate_profits_total"/>
 		</template>
 		<!-- 永续合约 -->
 		<template v-if="contractIndex === 1">
-			<shortcut />
+			<shortcut :leverTransaction="lever_transaction" :pagesInfo="pagesInfo" @refreshData="init"/>
 		</template>
 		<!-- 赠金交易 -->
 		<template v-if="contractIndex === 2">
@@ -31,46 +32,125 @@
 <script>
 	import notarize from "./modules/notarize.vue"
 	import sustainability from "./sustainability/index.vue"
-	import grants from "./grants/index.vue" 
-	import shortcut from "./shortcut/index.vue" 
-	import { Api_getLeverDeal } from "@/api/index.js"
+	import grants from "./grants/index.vue"
+	import shortcut from "./shortcut/index.vue"
+	import {
+		Api_getLeverDeal,
+		Api_getRegister
+	} from "@/api/index.js"
+	import {
+		Way_getUserInfo
+	} from "@/utils/common-request.js"
+	import {
+		mapGetters
+	} from 'vuex'
 	// import { startWebSocket , startAjaxSocket} from "@/utils/websock.js"
 	export default {
-		name:'contract',
-		components:{notarize , sustainability , grants , shortcut},
+		name: 'contract',
+		components: {
+			notarize,
+			sustainability,
+			grants,
+			shortcut
+		},
 		data() {
 			return {
 				contractIndex: 0,
-				contractArr:[
+				contractArr: [
 					'永续合约',
 					'快捷合约',
 					'赠金交易'
 				],
-				currency:{},
+				currency: {},
+				UserInfo: {},
+				pagesInfo: {},
+				lever_transaction: [],
+				rate_profits_total:{}
 			};
 		},
 		onLoad() {
-			 // startWebSocket(); 
-			// startAjaxSocket()
-			const val = this.$getStorageSync('Picture');
-			if(val){
-				this.currency = val;
-			}
-			console.log('val = ' , val)
-			
+			this.setSocket();
+		},
+		computed: {
+			...mapGetters([
+				'currencyVal'
+			]),
+		},
+		watch: {
+			currencyVal: {
+				handler(newCurrency) {
+					if (newCurrency && newCurrency?.legal_id) {
+						this.init()
+					}
+				},
+				deep: true,
+				immediate: true
+			},
 		},
-		methods:{
-			
+		onShow() {
+
+		},
+		methods: {
+			init() {
+				this.getLeverDeal();
+				if([0,1].includes(this.contractIndex)){
+					this.getRegister()
+				} 
+				this.getAccountInfo()
+			},
+			getRegister() {
+				Api_getRegister({
+					status: 1,
+					page: 1,
+					limit: 10000,
+					settled:this.contractIndex === 0 ? 0 : 9
+				}).then(res => {
+					 console.log('Api_getRegister = ' , res)
+					 this.rate_profits_total = res.rate_profits_total
+				}).catch(err => {
+					 
+				})
+			},
+			setSocket() {
+				this.$store.dispatch("websocket/openSocket", {
+					type: 'market_depth',
+					legal_id: this.currencyVal.legal_id,
+					currency_id: this.currencyVal.currency_id
+				})
+				this.$store.dispatch("websocket/openSocket", {
+					type: 'daymarket',
+					legal_id: this.currencyVal.legal_id,
+					currency_id: this.currencyVal.currency_id
+				})
+			},
+			getLeverDeal() {
+				Api_getLeverDeal({
+					legal_id: this.currencyVal.legal_id,
+					currency_id: this.currencyVal.currency_id
+				}).then(res => {
+					this.pagesInfo = res
+					this.lever_transaction = res.lever_transaction?.in || []
+				})
+			},
+		 
+			getAccountInfo() {
+				this.$store.dispatch('possession/getPossession').then(res => {
+					console.log('获取成功')
+				}).catch(err => {
+					console.log('获取shibai ')
+				})
+			}
+
 		}
 	}
 </script>
 
- 
+
 <style lang="scss" scoped>
 	.navigation-box {
 		width: 100%;
 		height: 100%;
-		padding:0 $pages-padding 11rpx;
+		padding: 0 $pages-padding 11rpx;
 		display: flex;
 		align-items: flex-end;
 
@@ -105,4 +185,4 @@
 			color: #FFFFFF;
 		}
 	}
-</style>
+</style>

+ 101 - 32
pages/contract/modules/drawer.vue

@@ -1,47 +1,78 @@
 <template>
 	<uni-popup ref="popupRef" type="left">
 
-		<view class="drawer-box">
+		<view class="drawer-box" :rise-fall="stocksColor">
 			<view :style="{'width': '100%', 'height': `${statusBarHeight}px`}"></view>
 			<view class="drawer-content">
 				<view class="drawer-search">
 					<view class="drawer-search-inp">
-						<u-icon name="search" class="search-icon" color="#666" size="20"></u-icon>
+						<u-icon name="search" class="search-icon" color="#666" size="40"></u-icon>
 						<input class="search-inp" placeholder-class="search-place" type="text" placeholder="搜索">
 					</view>
 				</view>
 				<view class="drawer-tab">
 					<view class="tab-box">
-						<view :class="['tab-item' , 'active-tab-item']">
+						<view @click.stop="tabIndex = 0 " :class="['tab-item' ,  tabIndex === 0 ? 'active-tab-item' : '']">
 							自选
 						</view>
-						<view class="tab-item">
+						<view @click.stop="tabIndex = 1 " :class="['tab-item' ,  tabIndex === 1 ? 'active-tab-item' : '']">
 							市场
 						</view>
 					</view>
-					<u-icon name="edit-pen" class="search-icon" color="#666" size="24"></u-icon>
+					<!-- <u-icon name="edit-pen" class="search-icon" color="#666" size="24"></u-icon> -->
 				</view>
-
-				<uni-table class="table-box" emptyText="暂无更多数据">
-					<!-- 表头行 -->
-					<uni-tr>
-						<uni-th>交易对</uni-th>
-						<uni-th>最新价</uni-th>
-						<uni-th>日涨跌</uni-th>
-					</uni-tr>
-					<!-- 表格数据行 -->
-					<uni-tr v-for="item in 5">
-						<uni-td>
-							<view class="name">
-								<text class="name-text">BTC</text>
-								<text class="name-tag">/USDT</text>
-							</view>
-						</uni-td>
-						<uni-td>298587458</uni-td>
-						<uni-td>+1.11%</uni-td>
-					</uni-tr>
-
-				</uni-table>
+				<swiper class="swiper-content" :current="tabIndex"
+					:style="{'height': scrollHeight ? `${scrollHeight}px` : '' }">
+					<swiper-item class="swiper-item-box" >
+						<uni-table class="table-box" emptyText="暂无更多数据" @selection-change="aaa">
+							<!-- 表头行 -->
+							<uni-tr>
+								<uni-th>交易对</uni-th>
+								<uni-th align="right">最新价</uni-th>
+								<uni-th sortable align="right">日涨跌</uni-th>
+							</uni-tr>
+							<!-- 表格数据行 @click="setCurrency(item)" @row-click="rowclick(item)"-->
+							<template v-for="(item , index) in optional" >
+								<uni-tr :class="[$setColor(item.change)]" @clicktr="setCurrency(item)">
+									<uni-td>
+										<view class="name">
+											<text class="name-text">{{ item.currency_name }}</text>
+											<text class="name-tag">{{ item.legal_name ? `/${item.legal_name}` : '' }}</text>
+										</view>
+									</uni-td>
+									<uni-td align="right">{{ item.now_price }}</uni-td>
+									<uni-td class="color">{{ item.change }}%</uni-td>
+								</uni-tr>
+							</template>
+						
+						</uni-table>
+					</swiper-item>
+					<swiper-item>
+						<u-list class="swiper-list" :style="{'height': scrollHeight ? `${scrollHeight}px` : '' }">
+							 <uni-table class="table-box" emptyText="暂无更多数据">
+							 	<!-- 表头行 -->
+							 	<uni-tr>
+							 		<uni-th>交易对</uni-th>
+							 		<uni-th align="right">最新价</uni-th>
+							 		<uni-th align="right">日涨跌</uni-th>
+							 	</uni-tr>
+							 	<!-- 表格数据行 -->
+							 	<uni-tr v-for="(item , index) in marketAll" :class="[$setColor(item.change)]" :key="`all_${index}`" @click.stop="setCurrency(item)">
+							 		<uni-td>
+							 			<view class="name">
+							 				<text class="name-text">{{ item.currency_name }}</text>
+							 				<text class="name-tag">{{ item.legal_name ? `/${item.legal_name}` : '' }}</text>
+							 			</view>
+							 		</uni-td>
+							 		<uni-td align="right">{{ item.now_price }}</uni-td>
+							 		<uni-td class="color">{{ item.change }}%</uni-td>
+							 	</uni-tr>
+							 
+							 </uni-table>
+						</u-list>
+					</swiper-item>
+				</swiper>
+				
 
 			</view>
 		</view>
@@ -52,22 +83,55 @@
 	import {
 		mapGetters
 	} from 'vuex'
+import { Api_getQuotationNew } from "@/api/index.js"
 	export default {
 		data() {
 			return {
-
+				tabIndex:0,
+				scrollHeight:0,
 			};
 		},
 		computed: {
+			// maxPageHeight: state => state.app.maxPageHeight,
+			// tabBarHeight: state => state.app.tabBarHeight,
 			...mapGetters([
-				'statusBarHeight'
+				'tabBarHeight',
+				'maxPageHeight',
+				'statusBarHeight',
+				'stocksColor',
+				'optional',
+				'marketAll'
 			]),
-
+		},
+		watch:{
+			maxPageHeight:{
+				handler(newH){
+					this.scrollHeight = this.maxPageHeight - this.tabBarHeight - this.statusBarHeight - uni.upx2px(200)
+				},
+				immediate:true
+			}
+		},
+		created() {
+			this.$store.dispatch('websocket/getQuotationNew')
 		},
 		mounted() {
+			
 			// this.$refs.popupRef.open()
+			 
 		},
 		methods: {
+			aaa(item){
+				console.log('--22-' , item)
+			},
+			setCurrency(item){
+				console.log('--211-' , item)
+				
+				this.$store.commit('websocket/set_currency_val' , item)
+				this.close()
+			},
+			close() {
+				this.$refs.popupRef.close();
+			},
 			open() {
 				this.$nextTick(() => {
 					this.$refs.popupRef.open();
@@ -115,7 +179,7 @@
 			.drawer-tab {
 				padding: 0 6rpx 0 $pages-padding;
 				width: 100%;
-				height: 80rpx;
+				height: 90rpx;
 				border-bottom: 1rpx solid #f2f2f2;
 				display: flex;
 				justify-content: space-between;
@@ -133,7 +197,7 @@
 						font-weight: 700;
 						color: #808080;
 						height: 100%;
-						line-height: 80rpx;
+						line-height: 90rpx;
 					}
 
 					.active-tab-item {
@@ -156,7 +220,9 @@
 					}
 				}
 			}
-
+			.swiper-content,.swiper-item-box{
+				width: 100%;
+			}
 			.table-box {
 				width: 100%;
 
@@ -215,4 +281,7 @@
 
 		}
 	}
+	.swiper-content{
+		background-color: red;
+	}
 </style>

+ 2 - 2
pages/contract/modules/restrict.vue

@@ -4,7 +4,7 @@
 		<view class="popups-box">
 			<view class="popups-title">
 				持仓止盈止损修改
-				<text class="close-icon iconfont">&#xeca0;</text>
+				<text class="close-icon iconfont" @click.stop="close()">&#xeca0;</text>
 			</view>
 			<view class="popups-content">
 				<view class="content-item">
@@ -12,7 +12,7 @@
 					<view class="content-val">
 						<text class="val-name">{{ content.symbol }}</text>
 						<text class="val-lever">{{ content.multiple }}倍杠杆</text>
-						<text class="val-tag">逐仓做多</text>
+						<text class="val-tag">{{ content.type_name }}</text>
 					</view>
 				</view>
 				<view class="content-item">

+ 437 - 59
pages/contract/shortcut/index.vue

@@ -1,6 +1,6 @@
 <template>
 	<view>
-		<view class="contract-title">
+		<view class="contract-title" :rise-fall="stocksColor">
 			<view class="contract-item" @click.stop="openDrawer">
 				<view class="title-iocn">
 					<text class="title-iocn-item"></text>
@@ -8,105 +8,417 @@
 					<text class="title-iocn-item"></text>
 				</view>
 				<!-- <image class="title-iocn" src="../../../static/logo.png" mode="aspectFit"></image> -->
-				<text class="title-text">ETH/USDT</text>
+				<text class="title-text">{{currencyVal.currency_name}}/{{currencyVal.legal_name}}</text>
+
+			</view>
+			<view class="contract-price" :class="$setColor(daymarket.now_price)">
+				<text class="color">{{ daymarket.now_price }}</text>
+				<text class="color" v-show="daymarket.change">{{ daymarket.change }}%</text>
 			</view>
 			<view class="contract-item">
 				<text class="iconfont">&#xe625;</text>
 			</view>
 		</view>
-		<view class="lable-title">
+
+		<view class="iframe-box">
+			<template v-if="currencyVal.legal_id">
+				<iframe
+					:src="`https://doc.okenx.com/biking/kline.html?legal_id=${currencyVal.legal_id}&currency_id=${currencyVal.currency_id}&symbol=${currencyVal.currency_name}/${currencyVal.legal_name}`"
+					frameborder="0"></iframe>
+			</template>
+
+		</view>
+		<gap />
+
+		<view class="swiper-title">
 			<template v-for="(item , index) in lableList">
 				<text @click.stop="lableIndex = index"
-					:class="['lable-item', lableIndex === index ? 'active-lable-item' : '' ]">{{ item }}</text>
+					:class="['swiper-item', lableIndex === index ? 'active-swiper-item' : '' ]">{{ item }}</text>
 			</template>
 		</view>
+		<!-- {{  pagesInfo }} -->
 		<view class="shortcut">
+			<swiper class="swiper-content" :current="lableIndex"
+				:style="{'height': scrollHeight ? `${scrollHeight}px` : '' }">
+				<swiper-item class="swiper-item-box">
+					<u-list>
+						<view class="shortcut-open">
+							<view class="shortcut-type">
+								<view class="type-box">
+									<text class="type-item active-type-item">市价委托</text>
+									<text class="type-item">计划委托</text>
+								</view>
+								<view class="type-times"  @click.stop="adjustLever()">
+									{{leverName}}{{ multiple }}x
+									<text class="iconfont">&#xeb6d;</text>
+								</view>
+							</view>
+
+							<view class="shortcut-price">
+								<view class="price-box">
+									<text class="price-lable">价格</text>
+									<view class="price-info">
+										<text class="price-num">{{ daymarket.now_price }}</text>
+										<text class="price-tag">USDT</text>
+									</view>
+								</view>
+								<view class="price-box">
+									<text class="price-lable">保证金</text>
+									<input class="price-inp" type="number" v-model="caution_money">
+									<view class="price-info">
+										USDT
+									</view>
+								</view>
+							</view>
+
+							<view class="shortcut-usable">
+								<view class="usable-info">
+									可用:{{ pagesInfo.user_lever }} USDT
+								</view>
+								<view class="usable-btn">
+									充值
+								</view>
+							</view>
+
+							<view class="shortcut-btns">
+								<view class="shortcut-btn" @click.stop="setSubmitLever(2)">
+									买入/做多
+								</view>
+								<view class="shortcut-btn" @click.stop="setSubmitLever(1)">
+									卖出/做空
+								</view>
+							</view>
+						</view>
+
+					</u-list>
+				</swiper-item>
+				<swiper-item>
+					<u-list class="swiper-list" :style="{'height': scrollHeight ? `${scrollHeight}px` : '' }">
+						<template v-if="leverTransaction && leverTransaction.length > 0">
+							<view class="lable-title">
+								<text class="lable-title-text">仓位信息</text>
+								<text class="lable-title-btn" @click.stop="setCloseLeverAll()">全部平仓</text>
+							</view>
+							<template v-for="item in leverTransaction">
+								<view class="content-box" :rise-fall="stocksColor">
+									<view class="content-top">
+										<view class="top-left">
+											<view class="top-left-title">
+												<text>{{ item.symbol }}</text>
+												<text v-if="item.settled == 0">永续</text>
+												<text v-else-if="item.settled == 9">快捷合约</text>
+
+											</view>
+											<view class="top-left-b">
+												<text>{{ item.multiple }}倍杠杆</text>
+												<text class="top-left-b-tag">{{ item.type_name }}</text>
+											</view>
+										</view>
+
+										<view class="top-right">
+											<text>{{ item.profits }}</text>
+											<text
+												class="top-right-float"><text>浮动盈亏</text>{{ item.fact_profits }}%</text>
+										</view>
+									</view>
+									<view class="content-info">
+										<view class="info-item">
+											<text class="info-item-lable">保证金(USDT)</text>
+											<text class="info-item-val">{{ item.caution_money }}</text>
+										</view>
+										<view class="info-item">
+											<text class="info-item-lable">开仓价格(USDT)</text>
+											<text class="info-item-val">{{ item.price }}</text>
+										</view>
+										<view class="info-item">
+											<text class="info-item-lable">预估平仓价格(USDT)</text>
+											<text class="info-item-val">{{item.update_price}}</text>
+										</view>
+										<view class="info-item">
+											<text class="info-item-lable">过夜费</text>
+											<text class="info-item-val">{{item.overnight_money}}</text>
+										</view>
+										<view class="info-item">
+											<text class="info-item-lable">风险率(%)</text>
+											<text class="info-item-val">0%</text>
+											<!-- {{ item.caution_money }} -->
+										</view>
+
+										<!-- <view class="info-item">
+											<text class="info-item-lable">预计止损(USDT)</text>
+											<text class="info-item-val"
+												@click.stop="setRestrict(item)">{{ item.stop_loss_price || '--' }} <text
+													class="iconfont">&#xe610;</text></text>
+										</view>
+										<view class="info-item">
+											<text class="info-item-lable">预计止盈(USDT)</text>
+											<text class="info-item-val"
+												@click.stop="setRestrict(item)">{{ item.target_profit_price || '--' }} <text
+													class="iconfont">&#xe610;</text> </text>
+										</view> -->
+										<view class="info-item">
+											<text class="info-item-lable">创建时间</text>
+											<text class="info-item-val">{{ $getData_(item.create_time , false) }}</text>
+										</view>
+									</view>
+									<view class="content-btns">
+										<view class="content-btn-item" @click.stop="setCloseLever(item)">
+											平仓
+										</view>
+										<view class="content-btn-item" @click.stop="setInversion(item)">
+											反向开仓
+										</view>
+										<!-- 	<view class="content-btn-item">
+											加仓
+										</view> -->
+									</view>
+									<view class="set-stop">
+										<view class="stop-left" @click.stop="setRestrict(item)">
+											<text>止盈/止损</text>
+											<text
+												class="stop-num">{{ item.target_profit_price || '--' }}/{{ item.stop_loss_price || '--'}}</text>
+											<text class="iconfont">&#xe610;</text>
+										</view>
+										<view class="stop-right">
+											<text class="icon-size iconfont">&#xe8b0;</text>
+											<text class="icon-size">分享</text>
+										</view>
+									</view>
+								</view>
+								<gap />
+							</template>
+						</template>
+					</u-list>
+				</swiper-item>
+			</swiper>
 
-			<view class="shortcut-type">
-				<view class="type-box">
-					<text class="type-item active-type-item">市价委托</text>
-					<text class="type-item">计划委托</text>
-				</view>
-				<view class="type-times">
-					{{leverName}}{{ multiple }}x
-					<text class="iconfont">&#xeb6d;</text>
-				</view>
-			</view>
-
-			<view class="shortcut-price">
-				<view class="price-box">
-					<text class="price-lable">价格</text>
-					<view class="price-info">
-						<text class="price-num">78.66</text>
-						<text class="price-tag">USDT</text>
-					</view>
-				</view>
-				<view class="price-box">
-					<text class="price-lable">保证金</text>
-					<input class="price-inp" type="number">
-					<view class="price-info">
-						USDT
-					</view>
-				</view>
-			</view>
-
-			<view class="shortcut-usable">
-				<view class="usable-info">
-					可用:2927.81 USDT
-				</view>
-				<view class="usable-btn">
-					充值
-				</view>
-			</view>
-
-			<view class="shortcut-btns">
-				<view class="shortcut-btn" @click.stop="setSubmitLever()">
-					买入/做多
-				</view>
-				<view class="shortcut-btn">
-					卖出/做空
-				</view>
-			</view>
 
 
 		</view>
-		<lever :leverNum.sync="multiple" :leverName.sync="leverName" />
+
+		<drawer ref="drawerRef" />
+		<restrictPopup ref="restrictRef" @setSuccess="setSuccess" />
+		<lever ref="leverRef" :leverNum.sync="multiple" :leverName.sync="leverName" />
+		<unopen ref="placeOrderRef" @confirm="confirmPlaceOrder" title="下单确认" cancelBtn content="确定要下单吗?" />
+		<unopen ref="unopenRef" @confirm="confirm" textAlign="left" :title="unopenSolt.title" cancelBtn
+			:content="unopenSolt.closeLeverContent" />
 	</view>
 </template>
 
 <script>
 	import {
-		Api_setSubmitLever
+		mapGetters
+	} from 'vuex'
+	import {
+		Api_setSubmitLever,
+		Api_getLeverDeal,
+		Api_getRegister,
+		Api_setBatchClose,
+		Api_setCloseLever
 	} from "@/api/index.js"
 
 	import lever from "../sustainability/lever.vue"
+	import drawer from "./../modules/drawer.vue"
+	import {
+		startWebSocket
+	} from "@/utils/websock.js"
+	import restrictPopup from "./../modules/restrict.vue"
 	export default {
 		name: 'shortcut',
 		components: {
-			lever
+			lever,
+			drawer,
+			restrictPopup
 		},
 		data() {
 			return {
+				closeLeverItem: null,
 				lableList: [
 					'开仓',
 					'当前持仓'
 				],
-				lableIndex: 0,
-				
+				lableIndex: 1,
 				leverName: '逐仓',
 				multiple: 100, // 逐仓倍数
+				caution_money: '',
+
+				status: 1, // 状态,填1. 1市价交易,为0则是挂单交易
+				scrollHeight: 0,
+				unopenSolt: {
+					title: '',
+					content: ''
+				}
 			};
 		},
+		props: {
+			leverTransaction: {
+				type: Array,
+				default: () => {
+					return []
+				}
+			},
+			pagesInfo: {
+				type: Object,
+				default: () => {
+					return {}
+				}
+			}
+		},
+		computed: {
+			...mapGetters([
+				'currencyVal',
+				'daymarket',
+				'stocksColor',
+				'PageContentHeight',
+				'tabBarHeight'
+			]),
+		},
 		mounted() {
+			// startWebSocket()
+		},
+		watch: {
+			currencyVal: {
+				handler(newCurrency) {
+					if (newCurrency && newCurrency?.legal_id) {
 
+					}
+				},
+				deep: true,
+				immediate: true
+			},
+			PageContentHeight: {
+				handler(newHeigth) {
+					if (newHeigth) {
+						console.log('newHeigth = ', newHeigth)
+						this.scrollHeight = newHeigth - uni.upx2px(100) - this.tabBarHeight;
+					}
+				},
+				deep: true,
+				immediate: true
+			},
 		},
 		methods: {
-			setSubmitLever(){}
+			init() {
+				this.getLeverDeal()
+				this.getRegister()
+			},
+			getRegister() {
+				Api_getRegister({
+					status: 1,
+					legal_id: this.currencyVal.legal_id,
+					currency_id: this.currencyVal.currency_id,
+					settled: 9,
+					limit: 1000
+				}).then(res => {
+					console.log('Api_getRegister = ', res)
+				})
+			},
+
+			openDrawer() {
+				this.$nextTick(() => {
+					this.$refs.drawerRef.open();
+				})
+			},
+			setSubmitLever() {
+				this.$nextTick(() => {
+					this.$refs.placeOrderRef.open()
+				})
+			},
+			// 确认下单
+			confirmPlaceOrder(type) {
+				const obj = {
+					legal_id: this.currencyVal.legal_id,
+					currency_id: this.currencyVal.currency_id,
+					multiple: this.multiple,
+					caution_money: this.caution_money,
+					status: this.status
+				}
+
+				Api_setSubmitLever(obj).then(res => {
+					this.setSuccess()
+				})
+			},
+			// 设置止盈止损
+			setRestrict(item) {
+				this.$nextTick(() => {
+					this.$refs.restrictRef.open(item)
+				})
+			},
+			setSuccess() {
+				this.$emit('refreshData')
+			},
+			setCloseLever(item) {
+				this.closeLeverItem = item;
+				this.unopenSolt = {
+					title: '平仓',
+					closeLeverContent: '如果存在平仓挂单(限价止盈止损),将会在全平前被撤单,确定平仓吗?'
+				}
+				this.setDepot();
+			},
+			setInversion() {
+
+				this.closeLeverItem = -1;
+				this.unopenSolt = {
+					title: '反向开仓',
+					closeLeverContent: '如果存在平仓挂单(限价止盈止损),将会在全平前被撤单,确定反向开仓吗?',
+				}
+				this.setDepot();
+			},
+			setCloseLeverAll() {
+				this.closeLeverItem = null;
+				this.unopenSolt = {
+					title: '全部平仓',
+					closeLeverContent: '如果存在平仓挂单(限价止盈止损),将会在全平前被撤单,确定全部平仓吗?',
+				}
+				this.setDepot();
+				// this.title = '全部平仓';
+				// this.closeLeverContent = '';
+				// this.closeLeverItem = null;
+				// this.$refs.unopenRef.open();
+			},
+			// 平仓 - 反向开仓
+			setDepot(obj) {
+				this.$nextTick(() => {
+					this.$refs.unopenRef.open()
+				})
+			},
+
+			confirm() {
+				if (this.leverTransaction.length > 0) {
+					if (this.closeLeverItem && this.closeLeverItem !== -1) {
+						// 平仓
+						Api_setCloseLever({
+							id: this.closeLeverItem.id
+						}).then(res => {
+							this.setSuccess()
+						})
+					} else if (this.closeLeverItem == -1) {
+						// 反向开仓
+
+					} else {
+						// 全部平仓
+						Api_setBatchClose({
+							type: 0,
+							currency_id: this.currencyVal.currency_id
+						}).then(res => {
+							this.setSuccess()
+						})
+					}
+
+				}
+			},
+			adjustLever() {
+				this.$nextTick(() => {
+					this.$refs.leverRef.open()
+				})
+			},
 		}
 	}
 </script>
 
 <style lang="scss" scoped>
+	@import "~../sustainability/index.scss";
+
 	.contract-title {
 		padding: 5rpx $pages-padding 0;
 		min-height: 90rpx;
@@ -115,7 +427,17 @@
 		justify-content: space-between;
 		border-bottom: 1rpx solid $border-color;
 
+		.contract-price {
+			flex: 1;
+			display: flex;
+			justify-content: space-between;
+			align-items: center;
+			padding: 0 30rpx 0 20rpx;
+			font-size: 28rpx;
+		}
+
 		.contract-item {
+			flex-shrink: 0;
 			display: flex;
 			align-items: center;
 
@@ -171,7 +493,7 @@
 	// 		<text class="lable-item">{{ item }}</text>
 	// 	</template>
 	// </view>
-	.lable-title {
+	.swiper-title {
 		padding: 0 $pages-padding;
 		width: 100%;
 		height: 100rpx;
@@ -179,7 +501,7 @@
 		display: flex;
 		align-items: stretch;
 
-		.lable-item {
+		.swiper-item {
 			font-size: 28rpx;
 			display: flex;
 			align-items: center;
@@ -189,7 +511,7 @@
 			}
 		}
 
-		.active-lable-item {
+		.active-swiper-item {
 			font-size: 34rpx;
 			color: $Theme-Color;
 			position: relative;
@@ -209,7 +531,10 @@
 	}
 
 	.shortcut {
-		padding: 30rpx $pages-padding;
+
+		.shortcut-open {
+			padding: 30rpx $pages-padding;
+		}
 
 		.shortcut-type {
 			width: 100%;
@@ -370,4 +695,57 @@
 			}
 		}
 	}
+
+	.iframe-box {
+		width: 100%;
+		height: 50vh;
+
+		iframe {
+			width: 100%;
+			height: 100%;
+		}
+	}
+
+	// <view class="set-stop">
+	// 	<view class="stop-left">
+	// 		<text>止盈/止损</text>
+	// 		<text class="stop-num">{{ item.target_profit_price || '--' }}/{{ item.stop_loss_price || '--'}}</text>
+	// 		<text class="iconfont">&#xe610;</text>
+	// 	</view>
+	// 	<view class="stop-right">
+	// 		<text class="icon-size iconfont">&#xe8b0;</text>
+	// 		<text class="icon-size">分享</text>
+	// 	</view>
+	// </view>
+	.set-stop {
+		width: 100%;
+		display: flex;
+		align-items: center;
+		justify-content: space-between;
+		font-size: 26rpx;
+		padding: 30rpx $pages-padding 0;
+
+		.stop-left {
+			font-size: 24rpx;
+			color: $SizeColor2;
+
+			.stop-num {
+				padding: 0 10rpx;
+			}
+
+			.iconfont {
+				color: $Theme-Color;
+			}
+		}
+
+		.stop-right {
+
+			color: $Theme-Color;
+			font-size: 26rpx;
+
+			.iconfont {
+				margin-right: 6rpx;
+			}
+		}
+	}
 </style>

+ 48 - 16
pages/contract/sustainability/freight-space.vue

@@ -74,7 +74,7 @@
 						<view class="content-btn-item" @click.stop="setCloseLever(item)">
 							平仓
 						</view>
-						<view class="content-btn-item">
+						<view class="content-btn-item" @click.stop="setInversion(item)">
 							反向开仓
 						</view>
 					<!-- 	<view class="content-btn-item">
@@ -88,7 +88,7 @@
 		<template v-else>
 			暂无数据
 		</template>
-		<unopen ref="unopenRef" @confirm="confirm" textAlign="left" title="平仓" cancelBtn :content="closeLeverContent" />
+		
 		<restrictPopup ref="restrictRef" @setSuccess="setSuccess" />
 	</view>
 </template>
@@ -105,16 +105,19 @@
 	export default {
 		name: 'freight-space',
 		props: {
-			closeLeverContent: {
-				type: String,
-				default: ''
-			},
+		 
 			leverTransaction: {
 				type: Array,
 				default: () => {
 					return []
 				}
-			}
+			},
+			currency: {
+				type: Object,
+				default: () => {
+					return {}
+				}
+			},
 		},
 		components: {
 			restrictPopup
@@ -126,9 +129,8 @@
 		},
 		data() {
 			return {
-				title: '平仓',
 				closeLeverItem: null,
-				restrict: ''
+				
 			};
 		},
 		mounted() {
@@ -136,28 +138,57 @@
 		},
 		methods: {
 			setCloseLever(item) {
-				this.title = '平仓';
 				this.closeLeverItem = item;
-				this.$refs.unopenRef.open();
+				const obj = {
+					title : '平仓',
+					closeLeverContent : '如果存在平仓挂单(限价止盈止损),将会在全平前被撤单,确定平仓吗?'
+				}
+				this.$emit('setDepot' , obj)
+			},
+			setInversion(){
+		 
+				this.closeLeverItem = -1; 
+				const obj = {
+					title : '反向开仓',
+					closeLeverContent : '如果存在平仓挂单(限价止盈止损),将会在全平前被撤单,确定反向开仓吗?',
+				}
+				this.$emit('setDepot' , obj)
+				// const obj = {
+				// 	title : '反向开仓',
+				// 	closeLeverContent : '',
+				// 	closeLeverItem : item
+				// }
+				// this.$emit('setDepot' , obj)
 			},
 			setCloseLeverAll() {
-				this.title = '全部平仓';
 				this.closeLeverItem = null;
-				this.$refs.unopenRef.open();
+				const obj = {
+					title : '全部平仓',
+					closeLeverContent : '如果存在平仓挂单(限价止盈止损),将会在全平前被撤单,确定全部平仓吗?',
+				}
+				this.$emit('setDepot' , obj)
+				// this.title = '全部平仓';
+				// this.closeLeverContent = '';
+				// this.closeLeverItem = null;
+				// this.$refs.unopenRef.open();
 			},
 			confirm() {
 				if (this.leverTransaction.length > 0) {
-					if (this.closeLeverItem) {
+					if (this.closeLeverItem && this.closeLeverItem !== -1) {
 						// 平仓
 						Api_setCloseLever({
 							id: this.closeLeverItem.id
 						}).then(res => {
 							this.$emit('closeLeverSuccess')
 						})
-					} else {
+					} else if (this.closeLeverItem == -1){
+						// 反向开仓
+						 
+					}else {
 						// 全部平仓
 						Api_setBatchClose({
-							type: 0
+							type: 0,
+							currency_id:this.currency.currency_id
 						}).then(res => {
 							this.$emit('closeLeverSuccess')
 						})
@@ -166,6 +197,7 @@
 				}
 
 			},
+			// 设置止盈止损
 			setRestrict(item) {
 				this.$nextTick(() => {
 					this.$refs.restrictRef.open(item)

+ 17 - 8
pages/contract/sustainability/index.scss

@@ -85,13 +85,7 @@
 			padding-top: 10rpx;
 		}
 
-		.top-left-b-tag {
-			padding: 4rpx 6rpx;
-			border-radius: 3rpx;
-			background-color: $Theme-Color;
-			color: #fff;
-			margin-left: 20rpx;
-		}
+	
 
 		.top-right {
 			flex-shrink: 0;
@@ -218,4 +212,19 @@
 			}
 		}
 	}
-	
+	
+	.top-left-b-tag {
+		padding: 4rpx 6rpx;
+		background-color: $Theme-Color;
+		color: #fff;
+		margin-left: 20rpx;
+		font-size: 20rpx;
+		border-radius: 5rpx;
+	}
+	
+	.loadmore-box{
+		width: 100%;
+		height: 80rpx;
+		display: flex;
+		align-items: center;
+	}

+ 161 - 98
pages/contract/sustainability/index.vue

@@ -8,10 +8,10 @@
 					<text class="title-iocn-item"></text>
 				</view>
 				<!-- <image class="title-iocn" src="../../../static/logo.png" mode="aspectFit"></image> -->
-				<text class="title-text">{{ currencyInfo.currency_name }}/ {{ currencyInfo.legal_name }}</text>
+				<text class="title-text">{{ currencyVal.currency_name }}/ {{ currencyVal.legal_name }}</text>
 			</view>
 			<view class="contract-item">
-				<text class="title-ratio">资金费率:-0.0100%</text>
+				<text class="title-ratio">资金费率:{{ rateProfitsTotal.profits_total }}%</text>
 				<image class="ratio-icon" src="../../../static/logo.png" mode="aspectFit"></image>
 				<image class="ratio-icon" src="../../../static/logo.png" mode="aspectFit"></image>
 			</view>
@@ -20,47 +20,24 @@
 		<view class="account-box">
 			<view class="account-item">
 				<view class="account-title">
-					<text class="text">持仓保证金USDT]</text>
+					<text class="text">持仓保证金USDT)</text>
 				</view>
-				<text class="account-num">365.26</text>
+				<text class="account-num">{{ contractAccount.usdt_totle }}</text>
 			</view>
 			<view class="account-item">
 				<view class="account-title">
 					<text class="text">可用保证金(USDT)</text>
 				</view>
-				<text class="account-num">365.26</text>
+				<text class="account-num">{{ contractAccount.totle }}</text>
 			</view>
 			<view class="account-item">
 				<view class="account-title">
-					<text class="text">未实现亏盈(USDT] 三1</text>
+					<text class="text">未实现亏盈(USDT)</text>
 				</view>
-				<text class="account-num">-0.99</text>
-			</view>
-			<view class="account-item">
-				<view class="account-title">
-					<text class="text">净值(USDIL</text>
-				</view>
-				<text class="account-num">9869.77</text>
-			</view>
-			<view class="account-item">
-				<view class="account-title">
-					<text class="text">风险率必</text>
-				</view>
-				<text class="account-num">9869.77</text>
-			</view>
-			<view class="account-item">
-				<view class="account-title">
-					<text class="text">账户余额[USDTI</text>
-				</view>
-				<text class="account-num">9869.77</text>
+				<text class="account-num">{{ rateProfitsTotal.hazard_rate }}</text>
 			</view>
 		</view>
 
-
-		<gap height="8rpx" />
-
-
-
 		<view class="data-box">
 			<view class="data-left">
 				<view class="left-title flex">
@@ -105,7 +82,7 @@
 			<view class="data-right">
 				<view class="right-select">
 					<view class="select-box position-select" @click.stop="selectList = !selectList">
-						<text class="select-text">{{ value }}</text>
+						<text class="select-text">{{ status == 1 ? '市价委托' : '限价委托'  }}</text>
 						<text class="iconfont">&#xeb6d;</text>
 						<view class="select-list" v-show="selectList">
 							<text @click.stop="setType(item)"
@@ -142,9 +119,8 @@
 						<text class="switch-icon iconfont">&#xe672;</text>
 					</view>
 				</view>
-
 				<view class="step-content">
-					<step :width="365" />
+					<step :width="365" :percent.sync="percent" />
 				</view>
 
 				<view class="set-node">
@@ -167,7 +143,8 @@
 				<view class="info-btns">
 					<view class="info-btn-info">
 						<text class="info-btn-lable">可做多</text>
-						<text class="info-btn-val">{{ pagesInfo.lever_share_limit.max || '--' }}张</text>
+						<text class="info-btn-val">{{ pagesInfo.lever_share_limit ? pagesInfo.lever_share_limit.max : '--' }}张</text>
+						<!-- {{ pagesInfo.lever_share_limit ? pagesInfo.lever_share_limit?.max : '--' }} -->
 					</view>
 					<view class="info-btn" @click.stop="setSubmitLever(2)">
 						买入/做多
@@ -175,8 +152,8 @@
 				</view>
 				<view class="info-btns err-btns">
 					<view class="info-btn-info">
-						<text class="info-btn-lable">可做</text>
-						<text class="info-btn-val">33719张</text>
+						<text class="info-btn-lable">可做</text>
+						<text class="info-btn-val">{{ pagesInfo.lever_share_limit ? pagesInfo.lever_share_limit.max : '--' }}张</text>
 					</view>
 					<view class="info-btn" @click.stop="setSubmitLever(1)">
 						卖出/做空
@@ -188,27 +165,43 @@
 		<view class="lable-title">
 			<view class="lable-text">
 				<text @click.stop="freightSpaceIndex = 1"
-					:class="['lable-text-item' , freightSpaceIndex == 1 ? 'active-text-item' : '' ]">持仓({{ lever_transaction.length }})</text>
+					:class="['lable-text-item' , freightSpaceIndex == 1 ? 'active-text-item' : '' ]">持仓({{ leverTransaction.length }})</text>
 				<text @click.stop="freightSpaceIndex = 2"
 					:class="['lable-text-item' , freightSpaceIndex == 2 ? 'active-text-item' : '' ]">当前委托({{ entrustList.length }})</text>
 			</view>
 			<view class="iconfont" @click.stop="getHistory()">&#xe613;</view>
 		</view>
 
-
-		<template v-if="freightSpaceIndex === 1">
-			<freightSpace :leverTransaction="lever_transaction" @closeLeverSuccess="closeLeverSuccess"
-				:closeLeverContent="closeLeverContent" />
+		<swiper class="swiper-content" :current="freightSpaceIndex - 1"
+			:style="{'height': scrollHeight ? `${scrollHeight}px` : '' }" disable-touch>
+			<swiper-item class="swiper-item-box">
+				<u-list class="swiper-list" :style="{'height': scrollHeight ? `${scrollHeight}px` : '' }">
+					<freightSpace ref="freightSpaceRef" :leverTransaction="leverTransaction"
+						@closeLeverSuccess="closeLeverSuccess" @setDepot="setDepot" :currency="currencyVal" />
+				</u-list>
+			</swiper-item>
+			<swiper-item>
+				<u-list class="swiper-list" :style="{'height': scrollHeight ? `${scrollHeight}px` : '' }">
+					<entrust :entrustlist="entrustList" @closeLeverSuccess="closeLeverSuccess" />
+				</u-list>
+			</swiper-item>
+		</swiper>
+		<!-- <template v-if="freightSpaceIndex === 1">
+			
 		</template>
 		<template v-if="freightSpaceIndex === 2">
-			<entrust :entrustlist="entrustList" @closeLeverSuccess="closeLeverSuccess" />
-		</template>
+			
+		</template> -->
 
 		<!-- 侧边抽屉 -->
 		<drawer ref="drawerRef" />
 
 		<!-- 调整杠杆 -->
 		<lever ref="leverRef" :lever-num.sync="multiple" :leverName.sync="leverName" />
+
+		<unopen ref="unopenRef" @confirm="confirm" textAlign="left" :title="title" cancelBtn
+			:content="closeLeverContent" />
+		<unopen ref="placeOrderRef" @confirm="confirmPlaceOrder" title="下单确认" cancelBtn content="确定要下单吗?" />
 	</view>
 </template>
 
@@ -233,12 +226,24 @@
 			entrust
 		},
 		props: {
-			currencyInfo: {
+			leverTransaction: {
+				type: Array,
+				default: () => {
+					return []
+				}
+			},
+			pagesInfo: {
 				type: Object,
 				default: () => {
 					return {}
 				}
-			}
+			},
+			rateProfitsTotal: {
+				type: Object,
+				default: () => {
+					return {}
+				}
+			},
 		},
 		data() {
 			return {
@@ -260,58 +265,74 @@
 
 				leverName: '全仓',
 
-				closeLeverContent: '如果存在平仓挂单(限价止盈止损),将会在全平前被撤单,确定全部平仓吗?',
-				freightSpaceIndex: 2,
-				pagesInfo: {
-					lever_share_limit: ''
-				},
-				// 当前持仓
-				lever_transaction: [],
-				entrustList: [],
 
+				freightSpaceIndex: 1,
+			 
+		 
+				entrustList: [],
+				scrollHeight: '',
+				percent: 0,
 				// 下单参数
 				multiple: 100, // 	逐仓倍数
 				share: '', // 张数
-				status: 0, // 状态,填1. 1市价交易,为0则是挂单交易
+				status: 1, // 状态,填1. 1市价交易,为0则是挂单交易
 				target_price: '',
+
+				// 平仓 - 反向开仓
+				closeLeverContent: '',
+				title: '平仓',
+				restrict: ''
 			};
 		},
+		watch: {
+			PageContentHeight: {
+				handler(newHeigth) {
+					this.scrollHeight = newHeigth - uni.upx2px(100) - this.tabBarHeight;
+				},
+				immediate: true
+			},
+			percent(newNums) {
+				const maxNums = this.pagesInfo?.lever_share_limit?.max
+				if (newNums >= 0 && maxNums) {
+					this.share = this.$decimalNum.mul(maxNums, newNums / 100);
+					console.log('this.share = ', this.share)
+				}
+				// 
+			},
 
+		},
 		computed: {
 			...mapGetters([
 				"stocksColor",
 				'bids',
 				'asks',
-				'daymarket'
+				'daymarket',
+				'tabBarHeight',
+				'PageContentHeight',
+				'currencyVal',
+				'contractAccount'
 			])
 		},
 		created() {
-			this.closeLeverSuccess();
-			this.$store.dispatch("websocket/openSocket", {
-				type: 'market_depth',
-				legal_id: this.currencyInfo.legal_id,
-				currency_id: this.currencyInfo.currency_id
-			})
-			this.$store.dispatch("websocket/openSocket", {
-				type: 'daymarket',
-				legal_id: this.currencyInfo.legal_id,
-				currency_id: this.currencyInfo.currency_id
-			})
+
 		},
 		methods: {
+			getData() {
+				this.closeLeverSuccess();
+				
+			},
 			setNum(type) {
 				if (this.status === 0) {
 					// 只有限价才去计算
 					if (!this.target_price) {
 						this.target_price = 0
 					};
-
 					switch (type) {
 						case 1:
-							this.target_price -= this.$decimalNum.sub(this.target_price, 0.01);
+							this.target_price = this.$decimalNum.sub(this.target_price, 0.01);
 							break;
 						case 2:
-							this.target_price -= this.$decimalNum.add(this.target_price, 0.01);
+							this.target_price = this.$decimalNum.add(this.target_price, 0.01);
 							break;
 					}
 				}
@@ -342,20 +363,21 @@
 					this.$refs.leverRef.open()
 				})
 			},
-			getLeverDeal() {
-				Api_getLeverDeal({
-					legal_id: this.currencyInfo.legal_id,
-					currency_id: this.currencyInfo.currency_id
-				}).then(res => {
-					this.pagesInfo = res
-					this.lever_transaction = res.lever_transaction?.in || []
-				})
-			},
+			// getLeverDeal() {
+			// 	Api_getLeverDeal({
+			// 		legal_id: this.currencyVal.legal_id,
+			// 		currency_id: this.currencyVal.currency_id
+			// 	}).then(res => {
+			// 		this.pagesInfo = res
+			// 		this.lever_transaction = res.lever_transaction?.in || []
+			// 	})
+			// },
+			// 获取委托记录
 			getRegister() {
 				Api_getRegister({
 					status: 0,
-					legal_id: this.currencyInfo.legal_id,
-					currency_id: this.currencyInfo.legal_id,
+					legal_id: this.currencyVal.legal_id,
+					currency_id: this.currencyVal.legal_id,
 					page: 1,
 					limit: 10000
 				}).then(res => {
@@ -364,24 +386,55 @@
 				})
 			},
 			// Api_setSubmitLever
+			// 下单确认
 			setSubmitLever(type) {
+				this.$nextTick(() => {
+					this.$refs.placeOrderRef.open(type)
+				})
+
+			},
+			// 确认下单
+			confirmPlaceOrder(type) {
 				const setData = {
-					legal_id: this.currencyInfo.legal_id,
-					currency_id: this.currencyInfo.currency_id,
+					status: this.status,
+					legal_id: this.currencyVal.legal_id,
+					currency_id: this.currencyVal.currency_id,
 					multiple: this.multiple,
 					share: this.share,
 					type: type
 				}
+
+
+				if (this.status === 0) {
+					setData.target_price = this.target_price
+				}
+
 				Api_setSubmitLever(setData).then(res => {
-					this.getLeverDeal()
+					// this.getLeverDeal()
 				})
 			},
+
 			// 查看合约历史
 			getHistory() {
 				uni.navigateTo({
-					url: '/pages/contract/history/index'
+					url: `/pages/contract/history/index?legal_id=${this.currencyVal.legal_id}&currency_id=${this.currencyVal.currency_id}`
 				})
-			}
+			},
+
+			// 平仓 - 反向开仓
+			setDepot(obj) {
+				this.closeLeverContent = obj.closeLeverContent;
+				this.title = obj.title;
+				this.$nextTick(() => {
+					this.$refs.unopenRef.open()
+				})
+			},
+
+			confirm() {
+				this.$nextTick(() => {
+					this.$refs.freightSpaceRef.confirm();
+				})
+			},
 
 		},
 	}
@@ -398,7 +451,7 @@
 			.contract-item {
 				display: flex;
 				align-items: center;
-
+				flex-shrink: 0;
 				.title-iocn {
 					width: 28rpx;
 					height: 24rpx;
@@ -425,7 +478,7 @@
 					font-weight: 700;
 					text-align: left;
 					color: #141213;
-					line-height: 52px;
+					line-height: 1.2;
 					letter-spacing: 0.74rpx;
 					padding-left: 19rpx;
 				}
@@ -455,7 +508,7 @@
 			display: flex;
 			flex-wrap: wrap;
 			background-color: #F6F6F6;
-			margin-bottom: 25rpx;
+
 
 			.account-item {
 
@@ -483,9 +536,9 @@
 
 				.account-title {
 
-					font-size: 22rpx;
+					font-size: 20rpx;
 					font-family: PingFang SC, PingFang SC-Bold;
-					font-weight: 700;
+					font-weight: 600;
 					color: #807e89;
 					line-height: 30rpx;
 
@@ -495,7 +548,7 @@
 				}
 
 				.account-num {
-					font-size: 24rpx;
+					font-size: 22rpx;
 					font-family: PingFang SC, PingFang SC-Bold;
 					font-weight: 700;
 					color: #1a1a1a;
@@ -511,7 +564,7 @@
 
 	.data-box {
 		width: 100%;
-		padding: 25rpx $pages-padding 0;
+		padding: 25rpx $pages-padding 20rpx;
 		display: flex;
 		justify-content: space-between;
 		align-items: stretch;
@@ -559,23 +612,28 @@
 			}
 
 			.index-title {
-
 				font-size: 20rpx;
 				color: #808080;
 				line-height: 1.2;
 
 				text {
 					border-bottom: 2rpx dashed #707070;
+					display: flex;
+					align-items: center;
 				}
 
 				padding-bottom: 18rpx;
 				border-bottom: 1px solid #f2f2f2;
+				// &:first-child{
+				// 	text-align: right;
+				// }
 			}
 
 			.nums-list {
 				width: 100%;
 				padding: 10rpx 0 4rpx;
 				border-bottom: 1rpx solid #f2f2f2;
+				min-height: 300rpx;
 
 				.nums-item {
 					width: 100%;
@@ -724,7 +782,7 @@
 
 			.right-input {
 				width: 100%;
-				height: 80rpx;
+				height: 76rpx;
 				background: #efefef;
 				border-radius: 10rpx;
 				margin-top: 20rpx;
@@ -754,21 +812,24 @@
 
 				.right-input-icon {
 					flex-shrink: 0;
-					font-size: 28rpx;
+					font-size: 26rpx;
 					font-family: PingFang SC, PingFang SC-Bold;
-					font-weight: 700;
+					// font-weight: 700;
 					color: #808080;
 					line-height: 40rpx;
 					display: flex;
 					align-items: center;
 
 					.icon-link {
+						font-size: 20rpx;
 						margin: 0 15rpx;
+						color: $Theme-Color;
 					}
 
 					.icon {
 						width: 30rpx;
 						height: 26rpx;
+						font-size: 18rpx;
 					}
 				}
 
@@ -850,7 +911,7 @@
 					font-family: PingFang SC, PingFang SC-Regular;
 					font-weight: 400;
 					color: #808080;
-					line-height: 34rpx;
+					line-height: 1.1;
 					margin-left: 14rpx;
 
 					border-bottom: 2rpx dashed #707070;
@@ -923,12 +984,14 @@
 					line-height: 80rpx;
 					font-size: 30rpx;
 					color: #fff;
+					border-radius: 10rpx;
+					font-weight: bold;
 				}
 			}
 
 			.err-btns {
 				.info-btn {
-					background-color: red;
+					background-color: $Theme-Color3;
 				}
 			}
 

+ 1 - 2
pages/contract/sustainability/lever.vue

@@ -74,8 +74,7 @@
 		watch: {
 			leverNum: {
 				handler(newVal) {
-					this.pattern.num = newVal + 'X'
-					console.log('this.pattern.num' , this.pattern.num)
+					this.pattern.num = newVal + 'X';
 				},
 				immediate: true
 			},

+ 2 - 2
pages/exchange/index.vue

@@ -19,7 +19,7 @@
 							<template v-if="active.left">
 								<image class="coin-icon" :src="active.left.logo" mode="aspectFit"></image>
 								<text class="coin-name">{{ active.left.name }}</text>
-								<text class="select-icon iconfont">&#xe601;</text>
+								<text class="select-icon iconfont">&#xeb6d;</text>
 								<text class="coin-ratio" />
 								<!-- <text class="coin-ratio">{{ active.left.min_number }} - {{ active.left.max_number }}</text> -->
 							</template>
@@ -36,7 +36,7 @@
 						<template v-if="active.right">
 							<image class="coin-icon" :src="active.right.logo" mode="aspectFit"></image>
 							<text class="coin-name">{{ active.right.name }}</text>
-							<text class="select-icon iconfont">&#xe601;</text>
+							<text class="select-icon iconfont">&#xeb6d;</text>
 						</template>
 
 					</view>

+ 13 - 34
pages/index/index.vue

@@ -21,10 +21,10 @@
 
 		<!-- 滚动消息 -->
 		<rollMessage :rollMsg="Announcement"></rollMessage>
- 
+
 		<!-- usdt -->
 		<usdt :usdtList="usdtList"></usdt>
- 
+
 		<gap />
 		<!-- 快捷买币 -->
 		<shortcut></shortcut>
@@ -34,7 +34,7 @@
 		<navMuen></navMuen>
 
 		<!-- 自选 / 市场 -->
-		<market :market="quotationNew"></market>
+		<market></market>
 
 		<!-- 邀请 -->
 		<sharePage ref="sharePageRef" :tabBar="false" />
@@ -54,7 +54,9 @@
 		Api_getNewsList,
 		Api_getQuotationNew
 	} from "@/api/index.js"
-
+	import {
+		Way_getQuotationNew
+	} from "@/utils/common-request.js"
 	import {
 		mapGetters
 	} from 'vuex'
@@ -74,7 +76,7 @@
 				title: 'Hello',
 				BannerList: [],
 				Announcement: [],
-				quotationNew: [],
+		 
 				refreshStatus: false,
 			}
 		},
@@ -83,20 +85,7 @@
 				'stocksColor'
 			]),
 		},
-		watch: {
-			quotationNew: {
-				handler(newArr) {
-					this.usdtList = [];
-					if (newArr && newArr.length > 0) {
-						const nums = newArr.length > 3 ? 3 : newArr.length;
-						this.usdtList = newArr.slice(0, nums);
-					} else {
-						this.usdtList = []
-					}
-				},
-				deep: true
-			}
-		},
+		 
 		onLoad() {
 			this.getBanner();
 			this.getAnnouncement();
@@ -134,19 +123,7 @@
 			},
 			// 获取行情 / 首页推荐
 			getQuotationNew() {
-				Api_getQuotationNew().then(res => {
-					if (res && res.length > 0) {
-						this.quotationNew = res.find((item) => item.name == 'USDT').quotation || [];
-					}
-				}).catch(err => {
-				 
-				}).finally(() => {
-					setTimeout(() => {
-						if (this.refreshStatus) {
-							this.getQuotationNew()
-						}
-					}, 1000)
-				})
+				this.$store.dispatch('websocket/getQuotationNew')
 			},
 			clearInt() {
 				try {
@@ -171,11 +148,13 @@
 			width: 85rpx;
 			height: 67rpx;
 		}
-		.logo{
+
+		.logo {
 			width: 85rpx;
 			height: 67rpx;
 		}
-		.name{
+
+		.name {
 			width: 85rpx;
 			height: 80rpx;
 		}

+ 15 - 18
pages/index/modules/market.vue

@@ -18,7 +18,7 @@
 			</swiper-item>
 			<swiper-item>
 				<scroll-view :style="{'height': scrollHeight + 'px' }" class="market-scroll" scroll-y>
-					<marketplace ref="marketplaceRef" :marketplaceList="market" />
+					<marketplace ref="marketplaceRef" :marketplaceList="marketAll" />
 				</scroll-view>
 			</swiper-item>
 		</swiper>
@@ -34,17 +34,14 @@
 	} from 'vuex'
 	export default {
 		name: "marketModules",
-		props: {
-			market: {
-				type: Array,
-				default: () => []
-			}
-		},
+		 
 
 		computed: {
 			...mapGetters([
 				'PageContentHeight',
-				'tabBarHeight'
+				'tabBarHeight',
+				'optional',
+				'marketAll'
 			]),
 		},
 		data() {
@@ -55,20 +52,20 @@
 					'自选',
 					'市场'
 				],
-				optional:[]
+		 
 			};
 		},
 
 		watch: {
-			market:{
-				handler(newArr){
-					if(newArr && newArr.length > 0){
-						this.optional = newArr.slice(0,6)
-					}
-				},
-				immediate:true,
-				deep:true
-			},
+			// market:{
+			// 	handler(newArr){
+			// 		if(newArr && newArr.length > 0){
+			// 			this.optional = newArr.slice(0,6)
+			// 		}
+			// 	},
+			// 	immediate:true,
+			// 	deep:true
+			// },
 			PageContentHeight: {
 				handler(newH) {
 					this.scrollHeight = newH - uni.upx2px(114) - uni.upx2px(10) - this.tabBarHeight;

+ 3 - 15
pages/index/modules/usdt.vue

@@ -16,28 +16,16 @@
 	} from 'vuex'
 	export default {
 		name: "usdtModules",
-		props: {
-			usdtList: {
-				type: Array,
-				default: () => {
-					return []
-				}
-			}
-		},
 		data() {
 			return {
-				list: [
-					'币王BiKing合约交易所代理签约邀您加入币王BiKing合约交易所代理签约邀您加入',
-					'币王BiKing合约交易所代理签约邀您加入币王BiKing合约交易所代理签约邀您加入',
-					'币王BiKing合约交易所代理签约邀您加入币王BiKing合约交易所代理签约邀您加入',
-
-				]
+				 
 			};
 		},
 
 		computed: {
 			...mapGetters([
-				'stocksColor'
+				'stocksColor',
+				'usdtList'
 			]),
 		}
 	}

+ 0 - 2
pages/property/index.vue

@@ -110,8 +110,6 @@
 				}).catch(err => {
 					console.log('获取shibai ')
 				})
-
-
 			}
 		}
 	}

BIN
static/1-1首页-已登录 (1)/NFT@2x.png


BIN
static/1-1首页-已登录 (1)/banner.png


BIN
static/1-1首页-已登录 (1)/banner@2x.png


BIN
static/1-1首页-已登录 (1)/图层 7 拷贝 4.png


BIN
static/1-1首页-已登录 (1)/图层 7 拷贝 4@2x.png


BIN
static/1-1首页-已登录 (1)/快捷合约@2x.png


BIN
static/1-1首页-已登录 (1)/摸拟合约@2x.png


BIN
static/1-1首页-已登录 (1)/永续合约@2x.png


BIN
static/1-1首页-已登录 (1)/积分商城@2x.png


BIN
static/1-1首页-已登录 (1)/组 24352@2x.png


BIN
static/1-1首页-已登录 (1)/组 24353@2x.png


BIN
static/1-1首页-已登录 (1)/组 24359@2x.png


BIN
static/1-1首页-已登录 (1)/组 24359_1@2x.png


BIN
static/1-1首页-已登录 (1)/组 24359_2@2x.png


BIN
static/1-1首页-已登录 (1)/组 24720.png


BIN
static/1-1首页-已登录 (1)/组 24720@2x.png


BIN
static/1-1首页-已登录 (1)/组 24721.png


BIN
static/1-1首页-已登录 (1)/组 24721@2x.png


BIN
static/1-1首页-已登录 (1)/组 24722.png


BIN
static/1-1首页-已登录 (1)/组 24722@2x.png


BIN
static/1-1首页-已登录 (1)/赠金交易@2x.png


BIN
static/1-1首页-已登录 (1)/路径 4199.png


BIN
static/1-1首页-已登录 (1)/路径 4199@2x.png


BIN
static/1-1首页-已登录 (1)/路径 4201.png


BIN
static/1-1首页-已登录 (1)/路径 4201@2x.png


BIN
static/1-1首页-已登录 (1)/路径 4203.png


BIN
static/1-1首页-已登录 (1)/路径 4203@2x.png


BIN
static/fontsize/阿里妈妈数黑体.zip


BIN
static/zhengshu/5f3240d3be1d4769887117dd66f2853d.keystore


+ 2 - 0
static/zhengshu/新建 文本文档.txt

@@ -0,0 +1,2 @@
+别名:biking
+密钥:biking2023-=  

+ 6 - 0
store/getters.js

@@ -5,6 +5,7 @@ const getters = {
 	statusBarHeight: state => state.app.statusBarHeight,
 	windowInfo: state => state.app.windowInfo,
 	PageContentHeight: state => state.app.PageContentHeight,
+	maxPageHeight: state => state.app.maxPageHeight,
 	tabBarHeight: state => state.app.tabBarHeight,
 	
 	// 资产
@@ -18,5 +19,10 @@ const getters = {
 	asks: state => state.websocket.asks,
 	daymarket: state => state.websocket.daymarket,
 	
+	usdtList: state => state.websocket.usdtList,
+	optional: state => state.websocket.optional,
+	marketAll: state => state.websocket.marketAll,
+	currencyVal: state => state.websocket.currencyVal,
+	
 }
 export default getters

+ 2 - 0
store/modules/app.config.js

@@ -8,6 +8,7 @@
  	statusBarHeight: 0,
 	windowInfo:{},
 	PageContentHeight:0,
+	maxPageHeight:0,
 	tabBarHeight:50,  // 50 是tabbar 的高度,在pages里面设置 
  	// 涨跌颜色
  	stocksColor: 'green_rise', // green_rise:绿涨红跌 , red_rise:绿跌红涨 
@@ -22,6 +23,7 @@
 		const headH = state.headHeight.split('rpx')[0];
 		const contentHeight = info.windowHeight - state.statusBarHeight - uni.upx2px(headH);
  		state.PageContentHeight = contentHeight;
+		state.maxPageHeight = info.windowHeight;
  	},
  	SET_STOCKS_COLOR: (state, code) => {
  		state.stocksColor = code

+ 54 - 12
store/modules/websocket.js

@@ -1,13 +1,25 @@
 import socket from "@/utils/websocket.js"
 let socket_api = 'https://doc.okenx.com:2000'
-
+import {
+	Api_getQuotationNew
+} from "@/api/index.js"
 const state = {
 	bids: [],
 	asks: [],
-	daymarket:{}
+	daymarket: {},
+
+	// 
+	getQuotationStatus: false,
+	usdtList: [],
+	optional:[],
+	marketAll:[],
+	currencyVal:{}
 }
 
 const mutations = {
+	set_currency_val:(state, val) => {
+		state.currencyVal = val;
+	}
 	// SET_CONTRACT: (state, contract) => {
 	// 	// 合约账户
 	// 	state.contractAccount = contract;
@@ -53,10 +65,9 @@ const actions = {
 		commit,
 		state
 	}, data) {
-
 		var sk = socket(socket_api);
 		sk.on(data.type, function(msg) {
-			if (data.legal_id == msg.legal_id && data.currency_id == msg.currency_id) {
+			if (state.currencyVal.legal_id == msg.legal_id && state.currencyVal.currency_id == msg.currency_id) {
 				//btc 匹配
 				// var buyIn = JSON.parse(msg.bids);
 				// var out = JSON.parse(msg.asks).reverse();
@@ -69,14 +80,7 @@ const actions = {
 					state.asks = nums(out);
 				}
 				if (msg.type == 'daymarket') {
-					state.daymarket = msg
-					console.log('daymarket = ', msg)
-					// var buyIn = msg.bids.slice(0, 7);
-
-					// state.bids = nums(buyIn);
-					// var out = msg.asks.slice(0, 7);
-					// // state.bids = msg.bids
-					// state.asks = nums(out);
+					state.daymarket = msg;
 				}
 
 			}
@@ -84,7 +88,45 @@ const actions = {
 
 		})
 	},
+	getQuotationNew({
+		commit,
+		state
+	}, data) {
+		const rq = () => {
+			Api_getQuotationNew().then(res => {
+				if (res && res.length > 0) {
+					
+					let newArr = res.find((item) => item.name == 'USDT').quotation || [];
+					if(!state.currencyVal || !state.currencyVal?.currency_id){
+						state.currencyVal = newArr[0]
+					console.log('currencyVal = ' , state.currencyVal)
+					}
+					// 首页推荐
+					if (newArr && newArr.length > 0) {
+						const nums = newArr.length > 3 ? 3 : newArr.length;
+						state.usdtList = newArr.slice(0, nums);
+					} else {
+						state.usdtList = []
+					}
+					// 自选
+					state.optional = newArr.slice(0,6)
+					// 全部
+					state.marketAll = newArr
+				}
+			}).catch(err => {
+
+			}).finally(() => {
+				setTimeout(() => {
+					rq()
+					// if (state.getQuotationStatus) {
 
+					// }
+				}, 1000)
+
+			})
+		}
+		rq()
+	},
 }
 
 

+ 1 - 0
uni.scss

@@ -19,6 +19,7 @@ $modules-box-bg:#ffffff;
 $Theme-Color: #05C175;
 $Theme-Color1: #1fb578;
 $Theme-Color2: #e71b53;
+$Theme-Color3: #EF3E58;
 $Theme-Color04: rgba(5 ,193 ,117, 0.4);
 $border-color: rgba(204, 204, 204, 0.2);
 $border-color6: rgba(204, 204, 204, 0.6);

+ 2 - 1
uni_modules/uni-popup/components/uni-popup/uni-popup.vue

@@ -425,7 +425,8 @@
 		position: fixed;
 		/* #ifndef APP-NVUE */
 		z-index: 1099;
-
+		width: 100%;
+		min-height: 100vh;
 		/* #endif */
 		&.top,
 		&.left,

+ 5 - 2
uni_modules/uni-table/components/uni-tr/uni-tr.vue

@@ -1,6 +1,6 @@
 <template>
 	<!-- #ifdef H5 -->
-	<tr class="uni-table-tr">
+	<tr class="uni-table-tr" @click.stop="clicktr">
 		<th v-if="selection === 'selection' && ishead" class="checkbox" :class="{ 'tr-table--border': border }">
 			<table-checkbox :checked="checked" :indeterminate="indeterminate" :disabled="disabled" @checkboxSelected="checkboxSelected"></table-checkbox>
 		</th>
@@ -9,7 +9,7 @@
 	</tr>
 	<!-- #endif -->
 	<!-- #ifndef H5 -->
-	<view class="uni-table-tr">
+	<view class="uni-table-tr" @click.stop="clicktr">
 		<view v-if="selection === 'selection' " class="checkbox" :class="{ 'tr-table--border': border }">
 			<table-checkbox :checked="checked" :indeterminate="indeterminate" :disabled="disabled" @checkboxSelected="checkboxSelected"></table-checkbox>
 		</view>
@@ -117,6 +117,9 @@ export default {
 				parentName = parent.$options.name
 			}
 			return parent
+		},
+		clicktr(){
+			this.$emit('clicktr')
 		}
 	}
 }

+ 18 - 4
utils/common-request.js

@@ -1,6 +1,7 @@
 import {
 	Api_getUserInfo,
-	Api_getQuotationNew
+	Api_getQuotationNew,
+	
 } from "@/api/index.js"
 
 
@@ -26,6 +27,19 @@ export const Way_getBiTypeList = () => {
 	})
 }
 
-
-
- 
+// 获取行情 / 首页推荐
+export const Way_getQuotationNew = () => {
+	return new Promise((resolve, reject) => {
+		Api_getQuotationNew().then(res => {
+			if (res && res.length > 0) {
+				let quotationNewList = res.find((item) => item.name == 'USDT').quotation || [];
+				resolve(quotationNewList)
+			}
+		}).catch(err => {
+		
+		}).finally(() => {
+			 
+		}) 
+	})
+	
+}

+ 1 - 1
utils/websock.js

@@ -74,7 +74,7 @@ const initWebSocket = (userId) => {
 	//   //webSocket 前面加一个前缀xxx_websocket_ 区分后面其他项目的webSocket
 	//   // let wsServer = "wss://域名地址或ip加端口/ nginx配置的  xxx_websocket/" + userId;
 
-	let wsServer = `wss://doc.okenx.com:2000/socket.io/?EIO=3&transport=websocket&sid=d5ce250e2d16d9410233d8a4`;
+	let wsServer = `wss://doc.okenx.com:2000/socket.io/?EIO=3&transport=websocket&sid=0663528fde16d941013073d3`;
 	websock = new WebSocket(wsServer);
 	websock.onopen = websocketonopen;
 	websock.onerror = websocketonerror;