Fly лет назад: 2
Родитель
Сommit
9843444394

+ 59 - 179
components/sharePage/sharePage.vue

@@ -5,69 +5,48 @@
 			<view class="share-status-bar" :style="{'height': `${statusBarHeight}px`}"></view>
 			<!-- statusBarHeight -->
 			<view class="share-content">
-				<view class="content" id="share-content">
-					<view class="share-top">
-						<image class="share-logo" src="@/static/share/img_02.png" mode="aspectFit"></image>
-						<text class="share-title">注册会员</text>
-						<text class="share-title">获取高额奖励</text>
-						<view class="share-list">
-							<view class="share-list-item"><text class="item-icon"></text><text
-									class="item-text">安全的钱包技术</text></view>
-							<view class="share-list-item"><text class="item-icon"></text><text
-									class="item-text">交易流畅顶级风控</text></view>
-							<view class="share-list-item"><text class="item-icon"></text><text
-									class="item-text">丰富的加密资产业务</text></view>
-							<view class="share-list-item"><text class="item-icon"></text><text
-									class="item-text">分布在世界各地的客户</text></view>
-						</view>
+				<shareInvite v-if="shareType === 1">
+					<template #qrcode>
+						<tki-qrcode ref="qrcodeRef" :size="100" :showLoading="false" :val="qrcodeVal" />
+					</template>
+				</shareInvite>
+
+				<shareOrder :shareVal="shareVal" v-if="shareType === 2">
+					<template #qrcode>
+						<tki-qrcode ref="qrcodeRef" :size="100" :showLoading="false" :val="qrcodeVal" />
+					</template>
+				</shareOrder>
+			</view>
+			<view class="share-footer">
+				<view class="share-list">
+					<view class="share-icons">
+						<text class="share-icon iconfont" style="color: #00b1ff;">&#xe65b;</text>
+						<text class="share-text">复制链接</text>
 					</view>
-					<view class="footer">
-						<view class="share-code">
-							<!-- https://ext.dcloud.net.cn/plugin?id=39 -->
-							<tki-qrcode ref="qrcodeRef" :size="100" :showLoading="false" :val="qrcodeVal" />
-						</view>
-						<!-- <image class="share-code" src="@/static/share/img_03.png" mode="aspectFit"></image> -->
-						<view class="share-btns">
-							<view class="share-btn">
-								邀请您加入[币王]
-							</view>
-							<view class="share-btn-hint">
-								<<<长按识别二维码 </view>
-							</view>
-						</view>
+					<view class="share-icons">
+						<text class="share-icon iconfont" style="color: #029a73;">&#xe631;</text>
+						<text class="share-text">微信</text>
 					</view>
-
-
-				</view>
-				<view class="share-footer">
-
-					<view class="share-list">
-						<view class="share-icons">
-							<text class="share-icon iconfont" style="color: #00b1ff;">&#xe65b;</text>
-							<text class="share-text">复制链接</text>
-						</view>
-						<view class="share-icons">
-							<text class="share-icon iconfont" style="color: #029a73;">&#xe631;</text>
-							<text class="share-text">微信</text>
-						</view>
-						<view class="share-icons">
-							<text class="share-icon iconfont" style="color: #02d9a2;">&#xe623;</text>
-							<text class="share-text">朋友圈</text>
-						</view>
-						<view class="share-icons">
-							<text class="share-icon iconfont" style="color: #1890ff;">&#xe66a;</text>
-							<text class="share-text">QQ</text>
-						</view>
-						<view class="share-icons" @click="my_js.onclicks">
-							<text class="share-icon iconfont" style="color: #83a0e5">&#xe63a;</text>
-							<text class="share-text">保存图片</text>
-						</view>
+					<view class="share-icons">
+						<text class="share-icon iconfont" style="color: #02d9a2;">&#xe623;</text>
+						<text class="share-text">朋友圈</text>
 					</view>
-					<view class="share-cancel" @click.stop="cancelShare">
-						取消
+					<view class="share-icons">
+						<text class="share-icon iconfont" style="color: #1890ff;">&#xe66a;</text>
+						<text class="share-text">QQ</text>
 					</view>
+					<view class="share-icons" @click="my_js.onclicks">
+						<text class="share-icon iconfont" style="color: #83a0e5">&#xe63a;</text>
+						<text class="share-text">保存图片</text>
+					</view>
+				</view>
+				<view class="share-cancel" @click.stop="cancelShare">
+					取消
 				</view>
 			</view>
+		</view>
+
+
 	</uni-popup>
 </template>
 
@@ -75,18 +54,28 @@
 	import {
 		mapGetters
 	} from 'vuex'
-
+	import shareInvite from "./share_01.vue"
+	import shareOrder from "./share_02.vue"
 	export default {
 		name: "sharePage",
+		components: {
+			shareInvite,
+			shareOrder
+		},
 		props: {
 			tabBar: {
 				type: Boolean,
 				default: true
-			}
+			},
+			shareType: {
+				type: Number,
+				default: 1   // 1:邀请分享  2:订单分享
+			},
 		},
 		data() {
 			return {
-				shareCode: ''
+				shareCode: '', 
+				shareVal:{}
 			};
 		},
 		computed: {
@@ -96,15 +85,10 @@
 		},
 		created() {
 			this.shareCode = this.$getStorageSync('shareCode')
-			this.qrcodeVal = `${this.$config.shareLink}${this.shareCode}`
-			this.drawCode()
-			this.$nextTick(() => {
-				
-				
-			})
+			this.qrcodeVal = `${this.$config.shareLink}${this.shareCode}`;
 		},
 		mounted() {
-			// this.openShare()
+			
 			// this.$refs.popupRef.open()
 			// setTimeout(() => {
 			// 	this.$refs.qrcodeRef._makeCode()
@@ -112,17 +96,19 @@
 			// },3000)
 		},
 		methods: {
-			drawCode(){
-				if(this.$refs.qrcodeRef){
+			drawCode() {
+				if (this.$refs.qrcodeRef) {
 					this.$refs.qrcodeRef._makeCode()
-				}else{
+				} else {
 					setTimeout(() => {
 						this.drawCode()
-					},100)
+					}, 100)
 				}
-					
+
 			},
-			openShare() {
+			openShare(val) {
+				this.shareVal = val
+				this.drawCode()
 				this.$nextTick(() => {
 					this.showTabBar(false)
 					this.$refs.popupRef.open()
@@ -228,113 +214,7 @@
 			flex: 1;
 			padding: 30rpx 40rpx;
 
-			.content {
-				flex-shrink: 0;
-				width: 100%;
-				height: 100%;
-				background: url("@/static/share/img_01.png") no-repeat center center;
-				background-size: 100% 100%;
-				display: flex;
-				flex-direction: column;
-				justify-content: space-between;
-				padding: 30rpx 30rpx 20rpx;
-
-				.share-top {
-					display: flex;
-					flex-direction: column;
-					align-items: flex-start;
-
-					.share-logo {
-						display: inline-block;
-						width: 322rpx;
-						height: 80rpx;
-						// margin-bottom: 14rpx;
-					}
-
-					.share-title {
-
-						font-size: 56rpx;
-						font-family: PingFang SC, PingFang SC-Bold;
-						font-weight: 700;
-						color: #ffffff;
-						line-height: 1.1;
-						letter-spacing: 1.2px;
-					}
-
-					.share-list {
-						width: 100%;
-						padding-top: 20rpx;
-						display: flex;
-						flex-direction: column;
 
-						.share-list-item {
-							font-size: 20rpx;
-							font-family: PingFang SC, PingFang SC-Regular;
-							font-weight: 400;
-							color: #ffffff;
-							line-height: 1.5;
-							// transform: scale(0.8);
-							display: flex;
-							align-items: center;
-							justify-content: flex-start;
-
-							.item-icon {
-								display: inline-block;
-								width: 14rpx;
-								height: 14rpx;
-								border-radius: 50%;
-								background-color: #fff;
-							}
-
-							.item-text {
-								padding-left: 3px;
-							}
-						}
-					}
-
-				}
-
-				.footer {
-					width: 100%;
-					display: flex;
-					align-items: center;
-					padding: 0 20rpx;
-
-					.share-code {
-						width: 130rpx;
-						height: 130rpx;
-						background-color: #fff;
-						padding: 15rpx;
-					}
-
-					.share-btns {
-						width: calc(100% - 130rpx);
-						padding-left: 45rpx;
-						color: #fff;
-
-						.share-btn {
-							width: 100%;
-							height: 50rpx;
-							background: linear-gradient(180deg, #faae3d, #f9d159);
-							border-radius: 29rpx;
-							text-align: center;
-							line-height: 50rpx;
-							font-size: 24rpx;
-							font-family: PingFang SC, PingFang SC-Regular;
-							font-weight: 400;
-						}
-
-						.share-btn-hint {
-							padding-top: 22rpx;
-							font-size: 24rpx;
-							font-family: PingFang SC, PingFang SC-Regular;
-							font-weight: 400;
-							color: #ffffff;
-							letter-spacing: 0.56rpx;
-						}
-					}
-				}
-			}
 		}
 
 		.share-footer {

+ 161 - 0
components/sharePage/share_01.vue

@@ -0,0 +1,161 @@
+<template>
+	<view class="content" id="share-content">
+		<view class="share-top">
+			<image class="share-logo" src="@/static/share/img_02.png" mode="aspectFit"></image>
+			<text class="share-title">注册会员</text>
+			<text class="share-title">获取高额奖励</text>
+			<view class="share-list">
+				<view class="share-list-item"><text class="item-icon"></text><text class="item-text">安全的钱包技术</text>
+				</view>
+				<view class="share-list-item"><text class="item-icon"></text><text class="item-text">交易流畅顶级风控</text>
+				</view>
+				<view class="share-list-item"><text class="item-icon"></text><text class="item-text">丰富的加密资产业务</text>
+				</view>
+				<view class="share-list-item"><text class="item-icon"></text><text class="item-text">分布在世界各地的客户</text>
+				</view>
+			</view>
+		</view>
+		<view class="footer">
+			<view class="share-code">
+				<!-- https://ext.dcloud.net.cn/plugin?id=39 -->
+				<!-- <tki-qrcode ref="qrcodeRef" :size="100" :showLoading="false" :val="qrcodeVal" /> -->
+				<slot name="qrcode"></slot>
+			</view>
+			<!-- <image class="share-code" src="@/static/share/img_03.png" mode="aspectFit"></image> -->
+			<view class="share-btns">
+				<view class="share-btn">
+					邀请您加入[币王]
+				</view>
+				<view class="share-btn-hint">
+					<<<长按识别二维码 </view>
+				</view>
+			</view>
+		</view>
+
+
+	</view>
+</template>
+
+<script>
+	export default {
+		name: 'login',
+		data() {
+			return {
+
+			};
+		},
+		mounted() {
+
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.content {
+		flex-shrink: 0;
+		width: 100%;
+		height: 100%;
+		background: url("@/static/share/img_01.png") no-repeat center center;
+		background-size: 100% 100%;
+		display: flex;
+		flex-direction: column;
+		justify-content: space-between;
+		padding: 30rpx 30rpx 20rpx;
+
+		.share-top {
+			display: flex;
+			flex-direction: column;
+			align-items: flex-start;
+
+			.share-logo {
+				display: inline-block;
+				width: 322rpx;
+				height: 80rpx;
+				// margin-bottom: 14rpx;
+			}
+
+			.share-title {
+
+				font-size: 56rpx;
+				font-family: PingFang SC, PingFang SC-Bold;
+				font-weight: 700;
+				color: #ffffff;
+				line-height: 1.1;
+				letter-spacing: 1.2px;
+			}
+
+			.share-list {
+				width: 100%;
+				padding-top: 20rpx;
+				display: flex;
+				flex-direction: column;
+
+				.share-list-item {
+					font-size: 20rpx;
+					font-family: PingFang SC, PingFang SC-Regular;
+					font-weight: 400;
+					color: #ffffff;
+					line-height: 1.5;
+					// transform: scale(0.8);
+					display: flex;
+					align-items: center;
+					justify-content: flex-start;
+
+					.item-icon {
+						display: inline-block;
+						width: 14rpx;
+						height: 14rpx;
+						border-radius: 50%;
+						background-color: #fff;
+					}
+
+					.item-text {
+						padding-left: 3px;
+					}
+				}
+			}
+
+		}
+
+		.footer {
+			width: 100%;
+			display: flex;
+			align-items: center;
+			padding: 0 20rpx;
+
+			.share-code {
+				width: 130rpx;
+				height: 130rpx;
+				background-color: #fff;
+				padding: 15rpx;
+			}
+
+			.share-btns {
+				width: calc(100% - 130rpx);
+				padding-left: 45rpx;
+				color: #fff;
+
+				.share-btn {
+					width: 100%;
+					height: 50rpx;
+					background: linear-gradient(180deg, #faae3d, #f9d159);
+					border-radius: 29rpx;
+					text-align: center;
+					line-height: 50rpx;
+					font-size: 24rpx;
+					font-family: PingFang SC, PingFang SC-Regular;
+					font-weight: 400;
+				}
+
+				.share-btn-hint {
+					padding-top: 22rpx;
+					font-size: 24rpx;
+					font-family: PingFang SC, PingFang SC-Regular;
+					font-weight: 400;
+					color: #ffffff;
+					letter-spacing: 0.56rpx;
+				}
+			}
+		}
+	}
+</style>

+ 193 - 0
components/sharePage/share_02.vue

@@ -0,0 +1,193 @@
+<template>
+	<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">{{ shareVal.fact_profits }}%</text> -->
+		</view>
+
+		<view :class="['share-footer' , $setColor(shareVal.profits)]">
+			<view class="footer-code">
+				<slot name="qrcode"></slot>
+			</view>
+			<view class="footer-content">
+				<view class="footer-name ">
+					<text class="name-text">我在币王</text>
+					<view class="name-box bdColor">
+						<text class="color">{{ $setColor(shareVal.profits , true) ? '开多盈利了' : '开多亏损了' }}</text>
+						<text class="color iconfont">&#xe622;</text>
+					</view>
+				</view>
+				<view class="footer-price">
+					<text>平仓价格</text>
+					<text class="price">{{ shareVal.origin_price }}</text>
+				</view>
+
+				<view class="footer-price">
+					<text>开仓均价</text>
+					<text class="price">{{ shareVal.price }}</text>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import {
+		mapGetters
+	} from 'vuex'
+	export default {
+		props: {
+			shareVal: {
+				type: Object,
+				default: () => {
+					return {}
+				}
+			}
+		},
+		computed: {
+			...mapGetters([
+				"stocksColor",
+			])
+		},
+		data() {
+			return {
+
+			};
+		},
+		mounted() {
+
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.content {
+		flex-shrink: 0;
+		width: 100%;
+		height: 100%;
+		background: url("@/static/share/img_04.png") no-repeat center center;
+		background-size: 100% 100%;
+		position: relative;
+
+		.share-top {
+			position: absolute;
+			top: 300rpx;
+			left: 150rpx;
+			padding: 20rpx 0 0 20rpx;
+			display: flex;
+			flex-direction: column;
+			justify-content: center;
+			font-family: Bahnschrift, Bahnschrift-Bold;
+			font-weight: 700;
+
+			.share-currency {
+				font-size: 48rpx;
+				color: #030102;
+			}
+
+			.share-ratio {
+				font-size: 68rpx;
+				color: #ef3c59;
+			}
+		}
+
+		.share-footer {
+			position: absolute;
+			left: 50%;
+			bottom: 100rpx;
+			width: 470rpx;
+			height: 160rpx;
+			transform: translateX(-50%);
+			display: flex;
+			padding: 10rpx 0 0 10rpx;
+
+			.footer-code {
+				width: 130rpx;
+				height: 130rpx;
+				padding: 15rpx;
+			}
+
+			.footer-content {
+				display: flex;
+				flex-direction: column;
+
+				.footer-name {
+					display: flex;
+					align-items: center;
+
+					.name-text {
+						font-size: 28rpx;
+						font-family: PingFang SC, PingFang SC-Regular;
+						font-weight: 400;
+						color: #030303;
+					}
+
+					.name-box {
+						margin-left: 26rpx;
+						font-size: 22rpx;
+						font-family: PingFang SC, PingFang SC-Regular;
+						font-weight: 400;
+						color: #ef3c59;
+
+						min-width: 139rpx;
+						padding: 0 10rpx;
+						height: 40rpx;
+						border: 1rpx solid #ef3c59;
+						border-radius: 8rpx;
+						display: flex;
+						align-items: center;
+
+						.iconfont {
+							font-size: 18rpx;
+							transform: rotate(90deg);
+						}
+					}
+				}
+
+				.footer-price {
+
+					font-size: 15rpx;
+					font-family: PingFang SC, PingFang SC-Regular;
+					font-weight: 400;
+					color: #A5A3A4;
+					padding-top: 10rpx;
+
+					.price {
+						color: #242424;
+						padding-left: 5px;
+					}
+
+				}
+
+
+			}
+
+			// .<view class="footer-code">
+			// 	<slot name="qrcode"></slot>
+			// </view>{}
+			// <view class="footer-content">
+			// 	<view class="footer-name">
+			// 		<text class="name-text">我在币王</text>
+			// 		<view class="name-box">
+			// 			<text>开多亏损了</text>
+			// 			<text class="iconfont">&#xe622;</text>
+			// 		</view>
+			// 	</view>
+			// 	<view class="">
+			// 		<text>平仓价格</text>
+			// 		<text>28387.1</text>
+			// 	</view>
+
+			// 	<view class="">
+			// 		<text>开仓均价</text>
+			// 		<text>28387.1</text>
+			// 	</view>
+			// </view>
+
+
+
+
+		}
+	}
+</style>

+ 6 - 0
pages.json

@@ -58,6 +58,12 @@
 				"navigationBarTitleText": "合约历史"
 			}
 		},
+		{
+			"path": "pages/contract/order-info",
+			"style": {
+				"navigationBarTitleText": "订单详情"
+			}
+		},
 		{
 			"path": "pages/contract/sustainability/index",
 			"style": {}

+ 2 - 1
pages/contract/history/at-present.vue

@@ -60,7 +60,7 @@
 						</view>
 						<view class="info-item">
 							<text class="info-item-lable">创建时间(USDT)</text>
-							<text class="info-item-val">{{ $getData_(item.create_time , false) }}</text>
+							<text class="info-item-val">{{ item.transaction_time }}</text>
 						</view>
 					</view>
 
@@ -154,6 +154,7 @@
 			initData() {
 				this.limit = 10;
 				this.page = 1;
+				this.list = []
 				this.getRegister()
 			},
 			setSuccess() {

+ 6 - 3
pages/contract/history/fast-history.vue

@@ -26,7 +26,7 @@
 					</view>
 					<view :class="['top-right' , $setColor(item.profits)]">
 						<text class="color">{{ item.profits }}</text>
-						<text class="color top-right-float">平仓盈亏{{ item.fact_profits }}%</text>
+						<text class="color top-right-float">平仓盈亏{{ $getChange(item , 1) }}%</text>
 					</view>
 					<!-- <view class="top-right  top-right-btns">
 						<text class="top-right-btn" @click.stop="setCloseLeverAll()">撤单</text>
@@ -61,8 +61,8 @@
 					</view>
 				</view>
 				<view class="record-hint">
-					<text class="record-lable">平仓时间 {{ $getData_(item.create_time ) }}</text>
-					<view class="record-icon">
+					<text class="record-lable">平仓时间 {{ item.handle_time }}</text>
+					<view class="record-icon" @click.stop="val => $refs.shareRef.openShare(item)">
 						<text class="icon-size iconfont">&#xe8b0;</text>
 						<text class="icon-size">分享</text>
 					</view>
@@ -74,6 +74,9 @@
 			<u-loadmore :status="loadStatus" nomoreText="没有更多数据" :fontSize='28' :icon="false"/>
 		</view>
 		<empty class="empty-content" v-show="loadStatus === 'nomore' && list.length <= 0" />
+		
+		
+		<sharePage ref="shareRef" :shareType="2"></sharePage>
 	</view>
 </template>
 

+ 2 - 1
pages/contract/history/history-entrust.vue

@@ -62,7 +62,7 @@
 						</view>
 						<view class="info-item">
 							<text class="info-item-lable">创建时间(USDT)</text>
-							<text class="info-item-val">{{ $getData_(item.create_time , false) }}</text>
+							<text class="info-item-val">{{ item.transaction_time }}</text>
 						</view>
 					</view>
 
@@ -156,6 +156,7 @@
 			initData() {
 				this.limit = 10;
 				this.page = 1;
+				this.list = []
 				this.loadStatus = 'nomore';
 				// this.getRegister()
 			},

+ 13 - 6
pages/contract/history/history-freight-space.vue

@@ -12,7 +12,7 @@
 			@scrolltolower="scrolltolower">
 
 			<template v-for="item in list">
-				<view class="content-box" :rise-fall="stocksColor">
+				<view class="content-box" :rise-fall="stocksColor" @click.stop="lookInfo(item)">
 					<view class="content-top">
 						<view class="top-left">
 							<view class="top-left-title">
@@ -30,7 +30,7 @@
 						<view :class="['top-right' , $setColor(item.profits)]">
 							<text class="color">{{ item.profits || '--'}}</text>
 							<text class="color top-right-float"><text
-									class="bdColor">平仓盈亏</text>{{ item.fact_profits }}%</text>
+									class="bdColor">平仓盈亏</text>{{ $getChange(item , 1) }}%</text>
 						</view>
 					</view>
 					<view class="content-info">
@@ -62,8 +62,8 @@
 						</view>
 					</view>
 					<view class="record-hint">
-						<text class="record-lable">平仓时间 {{ $getData_(item.create_time ) }}</text>
-						<view class="record-icon">
+						<text class="record-lable">平仓时间 {{ item.handle_time }}</text>
+						<view class="record-icon" @click.stop="$emit('shareContent' , item)">
 							<text class="icon-size iconfont">&#xe8b0;</text>
 							<text class="icon-size">分享</text>
 						</view>
@@ -72,7 +72,7 @@
 				<gap />
 			</template>
 			<view class="loadmore-box" v-show="loadStatus !== 'nomore' || list.length > 0">
-				<u-loadmore status="loading" nomoreText="没有更多数据" :fontSize='28' :icon="false" />
+				<u-loadmore :status="loadStatus" nomoreText="没有更多数据" :fontSize='28' :icon="false" />
 			</view>
 			<view class="empty-content" :style="{'height': scrollHeight ? `${scrollHeight}px` : '' }"
 				v-if="loadStatus === 'nomore' && list.length <= 0">
@@ -127,6 +127,7 @@
 					if (newSatus === -1 && newSatus !== oldStatus) {
 						this.limit = 10;
 						this.page = 1;
+						this.list = []
 						this.getRegister()
 					}
 				},
@@ -162,7 +163,7 @@
 				}).then(res => {
 					const data = res.message;
 					this.list = this.list.concat(data.data)
-					this.page = data.current_page
+					this.page = data.current_page;
 					if (this.list.length >= data.total) {
 						this.loadStatus = 'nomore'
 					} else {
@@ -176,6 +177,12 @@
 						this.loadStatus = 'nomore'
 					}
 				})
+			},
+			lookInfo(item){
+				this.$setStorageSync('historyInfo' , item)
+				uni.navigateTo({
+					url:'/pages/contract/order-info'
+				});
 			}
 		}
 	}

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

@@ -31,13 +31,15 @@
 						:legal_id="legal_id" :currency_id="currency_id" />
 				</swiper-item>
 				<swiper-item>
-					<history-freight-space :listHeight="swiperHeight" :status="historyLable[historyIdex].status" />
+					<history-freight-space :listHeight="swiperHeight" :status="historyLable[historyIdex].status" @shareContent="val => $refs.shareRef.openShare(val)"/>
 				</swiper-item>
 				<swiper-item>
 					<turnover :listHeight="swiperHeight" :status="historyLable[historyIdex].status" />
 				</swiper-item>
 			</swiper>
 		</view>
+		
+		<sharePage ref="shareRef" :shareType="2"></sharePage>
 	</view>
 </template>
 

+ 2 - 1
pages/contract/history/turnover.vue

@@ -44,7 +44,7 @@
 						</view>
 						<view class="info-item">
 							<text class="info-item-lable">成交时间</text>
-							<text class="info-item-val">{{ $getData_(item.create_time ) }}</text>
+							<text class="info-item-val">{{ item.complete_time }}</text>
 						</view>
 					</view>
 				</view>
@@ -106,6 +106,7 @@
 					if (newSatus === 3 && newSatus !== oldStatus) {
 						this.limit = 10;
 						this.page = 1;
+						this.list = []
 						this.getRegister()
 					}
 				},

+ 4 - 2
pages/contract/index.vue

@@ -16,12 +16,12 @@
 		<template v-if="contractIndex === 0">
 			<sustainability ref="sustainabilityRef" :currency-info="currencyVal" :myTransaction="my_transaction"
 				:pagesInfo="pagesInfo" :my-peding-transaction="my_peding_transaction" @refreshData="init"
-				@setContract="setContract" @setProfitLoss="setProfitLoss" @setHighInfo="setHighInfo"/>
+				@setContract="setContract" @setProfitLoss="setProfitLoss" @setHighInfo="setHighInfo" @shareContent="val => $refs.shareRef.openShare(val)"/>
 		</template>
 		<!-- 永续合约 -->
 		<template v-if="contractIndex === 1">
 			<shortcut :myFast="my_fast" :rate-profits-total="rate_profits_total"
-				:pagesInfo="pagesInfo" @refreshData="init" />
+				:pagesInfo="pagesInfo" @refreshData="init" @shareContent="val => $refs.shareRef.openShare(val)"/>
 		</template>
 		<!-- 赠金交易 -->
 		<template v-if="contractIndex === 2">
@@ -35,6 +35,8 @@
 		<preference ref="preferenceRef" />
 		<!-- 设置盈亏 -->
 		<restrictPopup ref="restrictPopupRef" @setSuccess="setRestrictSuccess" />
+		<!-- 分享 -->
+		<sharePage ref="shareRef" :shareType="2"></sharePage>
 	</view>
 </template>
 

+ 109 - 0
pages/contract/order-info.vue

@@ -0,0 +1,109 @@
+<template>
+	<view>
+		<headContent borderBottom>
+			<template #left>
+				<reverse-back />
+			</template>
+			<template #content>
+				<view class="haed-title">
+					订单详情
+				</view>
+			</template>
+		</headContent>
+		
+		<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>
+						<text class="top-left-b-tag">{{ item.status_name }}</text>
+					</view>
+				</view>
+		
+				<view :class="['top-right' , $setColor(item.profits)]">
+					<text class="color">{{ item.profits || '--'}}</text>
+					<text class="color top-right-float"><text
+							class="bdColor">平仓盈亏</text>{{ $getChange(item , 1) }}%</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.origin_price }}</text>
+				</view>
+		
+		
+				<view class="info-item">
+					<text class="info-item-lable">平仓数量(张)</text>
+					<text class="info-item-val">{{ item.number }}</text>
+				</view>
+				<view class="info-item">
+					<text class="info-item-lable">手续费(USDT)</text>
+					<text class="info-item-val">{{ item.trade_fee || '--' }}</text>
+				</view>
+				<view class="info-item">
+					<text class="info-item-lable">平仓类型(USDT)</text>
+					<text class="info-item-val">{{ item.status === 3 ? '强制平仓' : '' }}</text>
+				</view>
+			</view>
+			<view class="record-hint">
+				<text class="record-lable">平仓时间 {{ $getData_(item.create_time ) }}</text>
+				<!-- <view class="record-icon" @click.stop="$emit('shareContent' , item)">
+					<text class="icon-size iconfont">&#xe8b0;</text>
+					<text class="icon-size">分享</text>
+				</view> -->
+			</view>
+		</view>
+		
+		
+	</view>
+</template>
+
+<script>
+	import {
+		mapGetters
+	} from 'vuex'
+	export default {
+		data() {
+			return {
+				item:{}
+			};
+		},
+		computed: {
+			...mapGetters([
+				"stocksColor",
+			])
+		},
+		onLoad() {
+			this.item = this.$getStorageSync('historyInfo') || {}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	@import "~./sustainability/index.scss";
+	@import "~./history/index.scss";
+	.top-right-float{
+		text{
+			border: none;
+		}
+	}
+	.top-left-b-tag{
+		font-size: 20rpx;
+		border-radius: 5rpx;
+	}
+</style>

+ 263 - 54
pages/contract/shortcut/index.vue

@@ -39,7 +39,7 @@
 		<!-- {{  pagesInfo }} -->
 		<view class="shortcut">
 			<swiper class="swiper-content" :current="lableIndex"
-				:style="{'height': scrollHeight ? `${scrollHeight}px` : '' }">
+				:style="{'height': scrollHeight ? `${scrollHeight}px` : '' }" disable-touch>
 				<swiper-item class="swiper-item-box">
 					<u-list>
 						<view class="shortcut-open">
@@ -64,13 +64,65 @@
 								</view>
 								<view class="price-box">
 									<text class="price-lable">保证金</text>
-									<input class="price-inp" type="number" v-model="caution_money">
+									<text @click.stop="switchShare" class="price-inp price-inp-text"
+										v-show="percent">{{ percent }}%</text>
+									<input v-show="!percent" :focus="isShareFocus" class="price-inp" type="number"
+										v-model="caution_money">
 									<view class="price-info">
 										USDT
 									</view>
 								</view>
+								<view class="step-content">
+									<step :percent.sync="percent" />
+								</view>
+							</view>
+
+							<view class="set-node">
+								<view class="set-node-box">
+									<view @click.stop="setNodePrice = !setNodePrice"
+										:class="['set-node-status' , setNodePrice ? 'active-set' : '']">
+										<text class="iconfont" v-show="setNodePrice">&#xe6c5;</text>
+									</view>
+									<text class="set-node-text">设置止盈止损</text>
+								</view>
 							</view>
 
+							<view class="set-profit-loss" v-show="setNodePrice">
+								<!-- 止盈 -->
+								<view class="set-profit-loss-title">
+									<text class="title-name">止盈</text>
+									<view class="title-btn" @click.stop="() => {
+										restrictProfitVal = ''
+										restrictProfitStatus === 1 ? restrictProfitStatus = 2 : restrictProfitStatus = 1;
+									}">
+										<text class="iconfont">&#xe672;</text>
+										<text>按{{ restrictProfitStatus === 1 ? '价格' : '比例' }}设置</text>
+									</view>
+								</view>
+								<view class="profit-loss-input">
+									<text>请输入止盈价格</text>
+									<input class="input-item" v-model="restrictProfitVal" type="number">
+									<text>{{ restrictProfitStatus === 1 ? 'USDT' : '%' }}</text>
+								</view>
+								<!-- 止损 -->
+								<view class="set-profit-loss-title">
+									<text class="title-name">止盈</text>
+									<view class="title-btn" @click.stop="() => {
+											restrictLossVal = ''
+											restrictLossStatus === 1 ? restrictLossStatus = 2 : restrictLossStatus = 1;
+										}">
+										<text class=" iconfont">&#xe672;</text>
+										<text>按{{ restrictLossStatus === 1 ? '价格' : '比例' }}设置</text>
+									</view>
+								</view>
+								<view class="profit-loss-input">
+									<text>请输入止损价格</text>
+									<input class="input-item" v-model="restrictLossVal" type="number">
+									<text>{{ restrictLossStatus === 1 ? 'USDT' : '%' }}</text>
+								</view>
+							</view>
+
+
 							<view class="shortcut-usable">
 								<view class="usable-info">
 									可用:{{ pagesInfo.user_lever }} USDT
@@ -188,12 +240,13 @@
 										<view class="content-btn-item" @click.stop="setCloseLever(item)">
 											平仓
 										</view>
-										<view class="content-btn-item" @click.stop="setInversion(item)">
+										<!-- @click.stop="setInversion(item)" -->
+										<view class="content-btn-item">
 											反向开仓
 										</view>
-										<!-- 	<view class="content-btn-item">
+										<view class="content-btn-item">
 											加仓
-										</view> -->
+										</view>
 									</view>
 									<view class="set-stop">
 										<view class="stop-left" @click.stop="setRestrict(item)">
@@ -202,7 +255,7 @@
 												class="stop-num">{{ item.target_profit_price || '--' }}/{{ item.stop_loss_price || '--'}}</text>
 											<text class="iconfont">&#xe610;</text>
 										</view>
-										<view class="stop-right">
+										<view class="stop-right" @click.stop="$emit('shareContent' , item)">
 											<text class="icon-size iconfont">&#xe8b0;</text>
 											<text class="icon-size">分享</text>
 										</view>
@@ -225,6 +278,7 @@
 		<unopen ref="placeOrderRef" @confirm="confirmPlaceOrder" title="下单确认" cancelBtn content="确定要下单吗?" />
 		<unopen ref="unopenRef" @confirm="confirm" textAlign="left" :title="unopenSolt.title" cancelBtn
 			:content="unopenSolt.closeLeverContent" />
+
 		<popupHint ref="hintRef" title="快捷合约">
 			<template #hintContent>
 				<view class="">
@@ -302,7 +356,20 @@
 				unopenSolt: {
 					title: '',
 					content: ''
-				}
+				},
+
+				percent: 0,
+				isShareFocus: false,
+
+
+				// 止盈止损
+				setNodePrice: false,
+				// 止盈
+				restrictProfitVal: '',
+				restrictProfitStatus: 1, // 按价格止盈 , 2 : 比例止盈
+				// 止损
+				restrictLossVal: '',
+				restrictLossStatus: 1, // 按价格止损 , 2 : 比例止损
 			};
 		},
 		props: {
@@ -368,6 +435,14 @@
 				// this.getLeverDeal()
 				// this.getRegister()
 			},
+			// 切换张数
+			switchShare() {
+				this.percent = 0
+				this.isShareFocus = false;
+				this.$nextTick(() => {
+					this.isShareFocus = true;
+				});
+			},
 			// getRegister() {
 			// 	Api_getRegister({
 			// 		status: 1,
@@ -398,12 +473,42 @@
 					legal_id: this.currencyVal.legal_id,
 					currency_id: this.currencyVal.currency_id,
 					multiple: this.multiple,
-					caution_money: this.caution_money,
+					caution_money: this.percent ? `${this.percent}%` : this.caution_money,
 					status: this.status
 				}
+				if (this.setNodePrice) {
+					// 设置止盈止损
+					// // 止盈
+					// restrictProfitVal: '',
+					// restrictProfitStatus: 1, // 按价格止盈 , 2 : 比例止盈
+					// // 止损
+					// restrictLossVal: '',
+					// restrictLossStatus: 1, // 按价格止损 , 2 : 比例止损
+					obj.target_profit_price = this.restrictProfitStatus === 1 ? this.restrictProfitVal :
+						`${restrictProfitVal}%`;
+					obj.stop_loss_price = this.restrictLossStatus === 1 ? this.restrictLossVal : `${restrictLossVal}%`;
 
+
+				}
+				uni.showLoading({
+					title: '',
+					mask: true
+				})
 				Api_setSubmitLever(obj).then(res => {
-					this.setSuccess()
+					setTimeout(() => {
+						uni.showToast({
+							title: '下单成功',
+							icon: 'none'
+						})
+						setTimeout(() => {
+							uni.hideToast()
+							this.setSuccess()
+						}, 300)
+					}, 201)
+				}).finally(() => {
+					setTimeout(() => {
+						uni.hideLoading()
+					}, 200)
 				})
 			},
 			// 设置止盈止损
@@ -439,13 +544,14 @@
 					closeLeverContent: '如果存在平仓挂单(限价止盈止损),将会在全平前被撤单,确定全部平仓吗?',
 				}
 				this.setDepot();
+				// this.setDepot();
 				// this.title = '全部平仓';
 				// this.closeLeverContent = '';
 				// this.closeLeverItem = null;
 				// this.$refs.unopenRef.open();
 			},
 			// 平仓 - 反向开仓
-			setDepot(obj) {
+			setDepot() {
 				this.$nextTick(() => {
 					this.$refs.unopenRef.open()
 				})
@@ -458,7 +564,20 @@
 						Api_setCloseLever({
 							id: this.closeLeverItem.id
 						}).then(res => {
-							this.setSuccess()
+							setTimeout(() => {
+								uni.showToast({
+									title: '平仓成功',
+									icon: 'none'
+								})
+								setTimeout(() => {
+									uni.hideToast();
+									this.setSuccess()
+								}, 300)
+							}, 201)
+						}).finally(() => {
+							setTimeout(() => {
+								uni.hideLoading()
+							}, 200)
 						})
 					} else if (this.closeLeverItem == -1) {
 						// 反向开仓
@@ -469,7 +588,20 @@
 							type: 0,
 							currency_id: this.currencyVal.currency_id
 						}).then(res => {
-							this.setSuccess()
+							setTimeout(() => {
+								uni.showToast({
+									title: '平仓成功',
+									icon: 'none'
+								})
+								setTimeout(() => {
+									uni.hideToast();
+									this.setSuccess()
+								}, 300)
+							}, 201)
+						}).finally(() => {
+							setTimeout(() => {
+								uni.hideLoading()
+							}, 200)
 						})
 					}
 
@@ -650,7 +782,7 @@
 
 		.iconfont {
 			font-size: 30rpx;
-			color: $SizeColor1;
+			color: #878592;
 		}
 	}
 
@@ -754,13 +886,12 @@
 				text-align: right;
 			}
 
-			// <view class="price-box">
-			// 	<text class="price-lable">价格</text>
-			// 	<input class="price-inp" type="number">
-			// 	<view class="price-info">
-			// 		USDT
-			// 	</view>
-			// </view>
+			.price-inp-text {
+				display: flex;
+				align-items: center;
+				justify-content: flex-end;
+			}
+
 		}
 
 		.price-box+.price-box {
@@ -770,6 +901,10 @@
 		}
 	}
 
+	.step-content {
+		padding: 26rpx 0;
+	}
+
 	// <view class="shortcut-usable">
 	// 	<view class="usable-info">
 	// 		可用:2927.81 USDT
@@ -868,27 +1003,6 @@
 		}
 	}
 
-	// <view class="account-box">
-	// 	<view class="account-item">
-	// 		<view class="account-title">
-	// 			<text class="text">持仓保证金USDT)</text>
-	// 		</view>
-	// 		<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">{{ contractAccount.totle }}</text>
-	// 	</view>
-	// 	<view class="account-item">
-	// 		<view class="account-title">
-	// 			<text class="text">未实现亏盈(USDT)</text>
-	// 		</view>
-	// 		<text class="account-num">{{ rateProfitsTotal.hazard_rate }}</text>
-	// 	</view>
-	// </view>
-
 	.account-box {
 		width: 100%;
 		min-height: 120rpx;
@@ -910,19 +1024,6 @@
 				text-align: right;
 			}
 
-			// 	&:nth-child(3n - 1) {
-			// 		width: 35%;
-
-			// 	}
-
-			// 	&:nth-child(3n - 2) {
-			// 		width: 30%;
-			// 	}
-
-			// 	&:nth-child(n + 4) {
-			// 		margin-top: 20rpx;
-			// 	}
-
 			.account-title {
 
 				font-size: 24rpx;
@@ -942,4 +1043,112 @@
 			}
 		}
 	}
+
+	.set-node {
+		width: 100%;
+		display: flex;
+		align-items: center;
+		justify-content: space-between;
+
+		.set-node-box {
+			display: flex;
+			align-items: center;
+		}
+
+		.set-node-high {
+			font-size: 24rpx;
+			font-family: PingFang SC, PingFang SC-Regular;
+			font-weight: 400;
+			color: $Theme-Color;
+			line-height: 1.1;
+		}
+
+		.set-node-status {
+			width: 27rpx;
+			height: 27rpx;
+			background: #e6e6e8;
+			border-radius: 2rpx;
+		}
+
+		.active-set {
+			background-color: $Theme-Color;
+			display: flex;
+			justify-content: center;
+			align-items: center;
+
+			.iconfont {
+				font-size: 26rpx;
+				color: #fff;
+			}
+		}
+
+		.set-node-text {
+
+			font-size: 24rpx;
+			font-family: PingFang SC, PingFang SC-Regular;
+			font-weight: 400;
+			color: #808080;
+			line-height: 1.1;
+			margin-left: 14rpx;
+
+			border-bottom: 2rpx dashed #707070;
+		}
+	}
+
+
+	.set-profit-loss {
+		width: 100%;
+
+		// <view class="set-profit-loss-title">
+		// 	<text class="title-name">止盈</text>
+		// 	<view class="title-btn">
+		// 		<text class="iconfont">&#xe672;</text>
+		// 		<text>按价格设置</text>
+		// 	</view>
+		// </view>
+		.set-profit-loss-title {
+			width: 100%;
+			display: flex;
+			align-items: center;
+			justify-content: space-between;
+			font-size: 26rpx;
+			padding: 30rpx 0;
+
+			.title-btn {
+				.iconfont {
+					font-size: 20rpx;
+					color: $Theme-Color;
+					margin-right: 4px;
+				}
+			}
+		}
+
+		.profit-loss-input {
+			width: 100%;
+			height: 76rpx;
+			border-radius: 8rpx;
+			display: flex;
+			justify-content: space-between;
+			align-items: center;
+			border: 1rpx solid $border-color6;
+
+			padding: 0 20rpx;
+			font-size: 24rpx;
+
+			text {
+				flex-shrink: 0;
+				color: $SizeColor3;
+			}
+
+			.input-item {
+				flex: 1;
+				height: 100%;
+				font-size: 24rpx;
+				text-align: right;
+				padding: 0 16rpx;
+			}
+		}
+
+
+	}
 </style>

+ 1 - 1
pages/contract/sustainability/entrust.vue

@@ -19,7 +19,7 @@
 							</view>
 							<view class="top-left-b">
 								<text>{{ item.multiple }}倍杠杆</text>
-								<text class="top-left-b-tag">逐仓做多</text>
+								<!-- <text class="top-left-b-tag">逐仓做多</text> -->
 							</view>
 						</view>
 

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

@@ -12,8 +12,10 @@
 							<view class="top-left-title">
 								<text>{{ item.symbol }}</text>
 								<text>{{ item.type_name }}</text>
-								<text class="icon-size iconfont">&#xe8b0;</text>
-								<text class="icon-size">分享</text>
+								<view class="top-left-share" @click.stop="$emit('shareContent' , item)">
+									<text class="icon-size iconfont">&#xe8b0;</text>
+									<text class="icon-size">分享</text>
+								</view>
 							</view>
 							<view class="top-left-b">
 								<text>{{ item.multiple }}倍杠杆</text>
@@ -133,9 +135,6 @@
 
 		},
 		methods: {
-
-
-
 			setCloseLever(item) {
 				this.closeLeverItem = item;
 				const obj = {
@@ -167,12 +166,30 @@
 			},
 			confirm() {
 				if (this.myTransaction.length > 0) {
+					uni.showLoading({
+						title: '',
+						mask: true
+					})
 					if (this.closeLeverItem && this.closeLeverItem !== -1) {
 						// 平仓
 						Api_setCloseLever({
 							id: this.closeLeverItem.id
 						}).then(res => {
-							this.$emit('closeLeverSuccess')
+							setTimeout(() => {
+								uni.showToast({
+									title: '平仓成功',
+									icon: 'none'
+								})
+								setTimeout(() => {
+									uni.hideToast()
+									this.$emit('closeLeverSuccess')
+								}, 300)
+							}, 201)
+							
+						}).finally(() => {
+							setTimeout(() => {
+								uni.hideLoading()
+							}, 200)
 						})
 					} else if (this.closeLeverItem == -1) {
 						// 反向开仓
@@ -183,7 +200,20 @@
 							type: 0,
 							currency_id: this.currency.currency_id
 						}).then(res => {
-							this.$emit('closeLeverSuccess')
+							setTimeout(() => {
+								uni.showToast({
+									title: '平仓成功',
+									icon: 'none'
+								})
+								setTimeout(() => {
+									uni.hideToast()
+									this.$emit('closeLeverSuccess')
+								}, 300)
+							}, 201)
+						}).finally(() => {
+							setTimeout(() => {
+								uni.hideLoading()
+							}, 200)
 						})
 					}
 

+ 10 - 4
pages/contract/sustainability/index.scss

@@ -64,10 +64,8 @@
 		.top-left-title {
 			font-size: 30rpx;
 			font-weight: bold;
-
-			.iconfont {
-				margin: 0 10rpx 0 20rpx;
-			}
+			display: flex;
+			align-items: center;
 
 			.icon-size {
 				font-size: 24rpx;
@@ -80,6 +78,14 @@
 					padding-left: 10rpx;
 				}
 			}
+			.top-left-share{
+				display: flex;
+				align-items: center;
+				
+				.iconfont {
+					margin-left: 20rpx;
+				}
+			}
 		}
 
 		.top-left-b {

+ 30 - 23
pages/contract/sustainability/index.vue

@@ -85,11 +85,11 @@
 				</view>
 
 				<view class="index-num-box">
-					<view class=" index-num-title ">
+					<view class="index-num-title">
 						<text>{{ daymarket.now_price }}</text>
 						<text>{{ daymarket.change }}%</text>
 					</view>
-					<view class=" index-title ">
+					<view class="index-title">
 						<text>指数{{ daymarket.high }}</text>
 						<text>标记{{ daymarket.open }}</text>
 					</view>
@@ -138,8 +138,10 @@
 				</view>
 				<!-- 下单数量 -->
 				<view class="right-input">
-					<input v-show="!percent" class="input-item" @focus="percent = 0" v-model="share" type="number">
-					<text @click.stop="" v-show="percent" class="input-item input-item-text">{{ percent }}%</text>
+					<input ref="shareRef" :focus="isShareFocus" v-show="!percent" class="input-item" @focus="percent = 0" v-model="share"
+						type="number">
+					<text @click.stop="switchShare" v-show="percent"
+						class="input-item input-item-text">{{ percent }}%</text>
 					<view class="right-input-icon">
 						<text>张</text>
 						<text class="icon-link">|</text>
@@ -148,7 +150,6 @@
 				</view>
 				<view class="step-content">
 					<step :percent.sync="percent" />
-					<!-- <cu-progress width="100%" @dragging="dragging"> </cu-progress> -->
 				</view>
 
 				<view class="set-node">
@@ -161,7 +162,7 @@
 					</view>
 					<text v-show="setNodePrice" class="set-node-high" @click="$emit('setHighInfo')">高级</text>
 				</view>
-				
+
 				<!-- 止盈 -->
 				<view class="right-input" v-show="setNodePrice && restrictType === 1">
 					<input placeholder-class="placeholder-class"
@@ -174,15 +175,15 @@
 						<text class="switch-icon iconfont">&#xe672;</text>
 					</view>
 				</view>
-				<view class="right-input" v-show="setNodePrice && restrictType === 2 && restrictProfitVal > 0">
+				<view class="right-input" v-show="setNodePrice && restrictType === 2 && restrictProfitVal >= 0">
 					<view class="right-input-icon">
-						<text>市价</text>
+						<text>市价止盈</text>
 					</view>
 					<view class="input-item input-item-val">
 						{{ restrictProfitVal }}
 					</view>
 				</view>
-				
+
 				<!-- 止损 -->
 				<view class="right-input" v-show="setNodePrice && restrictType === 1">
 					<input :placeholder="`按${ restrictLossStatus == 1 ? '价格' : '比例' }止损`" class="input-item"
@@ -194,9 +195,9 @@
 						<text class="switch-icon iconfont">&#xe672;</text>
 					</view>
 				</view>
-				<view class="right-input" v-show="setNodePrice && restrictType === 2 && restrictLossVal > 0">
+				<view class="right-input" v-show="setNodePrice && restrictType === 2 && restrictLossVal >= 0">
 					<view class="right-input-icon">
-						<text>市价</text>
+						<text>市价止损</text>
 					</view>
 					<view class="input-item input-item-val">
 						{{ restrictLossVal }}
@@ -351,6 +352,7 @@
 				percent: 0,
 				// 下单参数
 				multiple: 100, // 	逐仓倍数
+				isShareFocus:false,	//是否自动获取焦点
 				share: '', // 张数
 				status: 1, // 状态,填1. 1市价交易,为0则是挂单交易
 				target_price: '',
@@ -363,7 +365,7 @@
 				// 止盈
 				restrictProfitVal: '',
 				restrictProfitStatus: 1, // 按价格止盈 , 2 : 比例止盈
-				restrictType: 2, // 1 普通输入 , 2 市价(禁止输入,只能通过高级设置)
+				restrictType: 1, // 1 普通输入 , 2 市价(禁止输入,只能通过高级设置)
 				// 止损
 				restrictLossVal: '',
 				restrictLossStatus: 1, // 按价格止损 , 2 : 比例止损
@@ -494,7 +496,7 @@
 					legal_id: this.currencyVal.legal_id,
 					currency_id: this.currencyVal.currency_id,
 					multiple: this.multiple,
-					share: this.share,
+					share: this.percent ? `${this.percent}%` : this.share,
 					type: type
 				}
 				if (this.setNodePrice) {
@@ -555,6 +557,17 @@
 			// 合约设置
 			setContract() {
 				this.$emit('setContract')
+			},
+
+			// 切换张数
+			// <input ref="shareRef" v-show="!percent" class="input-item" @focus="percent = 0" v-model="share" type="number">
+			// <text @click.stop="switchShare" v-show="percent" class="input-item input-item-text">{{ percent }}%</text>
+			switchShare() {
+				this.percent = 0
+				this.isShareFocus = false;
+				this.$nextTick(() => {
+					this.isShareFocus = true;
+				});
 			}
 
 
@@ -913,11 +926,13 @@
 					flex: 1;
 					color: #000;
 				}
-				.input-item-val{
+
+				.input-item-val {
 					display: flex;
 					justify-content: flex-end;
 					align-items: center;
 				}
+
 				.placeholder-class {
 					font-size: 24rpx;
 				}
@@ -1202,14 +1217,6 @@
 		}
 	}
 
-	// <view class="left-title index-num-title flex">
-	// 	<text>{{ daymarket.now_price }}</text>
-	// 	<text>{{ daymarket.change }}%</text>
-	// </view>
-	// <view class="subhead-title index-title flex">
-	// 	<text>指数{{ daymarket.high }}</text>
-	// 	<text>标记{{ daymarket.open }}</text>
-	// </view>
 	.index-num-box {
 		height: 115rpx;
 		width: 100%;
@@ -1229,13 +1236,13 @@
 			font-weight: 700;
 			color: #20b482;
 
+
 			text {
 				&:first-child {
 					font-size: 36rpx;
 				}
 
 				&:last-child {
-
 					font-size: 28rpx;
 				}
 			}

+ 4 - 2
pages/login/index.vue

@@ -63,8 +63,10 @@
 				tabIndexs: 0,
 				areaCode: 86,
 				formData: {
-					user_string: '123456',
-					password: 'Aa123456'
+					user_string: '',
+					password: '',
+					// user_string: '123456',
+					// password: 'Aa123456'
 				}
 			};
 		},

BIN
static/share/img_04.png


+ 8 - 4
utils/common.js

@@ -23,8 +23,7 @@ export const getToken = () => {
 	}
 }
 
-export const setStorageSync = (key, val) => {
-	console.log('setStorageSync = ', key, val)
+export const setStorageSync = (key, val) => { 
 	try {
 		uni.setStorageSync(key, val);
 	} catch (e) {
@@ -135,8 +134,13 @@ export const decimalNum = {
 
 
 // 涨跌颜色
-export const setColor = (nums) => {
-	return nums >= 0 ? 'zhang' : 'die'
+export const setColor = (nums , type = false) => {
+	if(type){
+		return nums >= 0 ? true : false
+	}else{
+		return nums >= 0 ? 'zhang' : 'die'
+	}
+	
 }
 
 

+ 1 - 1
utils/request.js

@@ -85,7 +85,7 @@ export const request = async (opt = {}) => {
 						LoginFailure = true
 						// 未登录
 						store.commit('app/SET_TOKEN' , '');
-						uni.navigateTo({
+						uni.reLaunch({
 							url:'/pages/login/index',
 							complete:() => {
 								LoginFailure = false