Fly пре 2 година
родитељ
комит
9adb304ddc

+ 4 - 2
App.vue

@@ -1,10 +1,12 @@
 <script>
+	import { Way_getSetting } from "@/utils/common-request.js"
 	export default {
 		onLaunch: function() {
 			// 读取手机状态栏高度
 			const app = uni.getWindowInfo()
 			this.$store.commit('app/SET_statusBarHeight', app.statusBarHeight || 30)
 			this.$store.commit('app/SET_windowInfo', app)
+			Way_getSetting()
 		},
 		onShow: function() {
 			console.log('App Show')
@@ -79,8 +81,8 @@
 	::v-deep uni-tabbar {
 		z-index: 88 !important;
 	}
-	
-	iframe{
+
+	iframe {
 		border: none !important;
 	}
 </style>

+ 5 - 0
api/index.js

@@ -4,6 +4,11 @@ import {
 
  
 
+// 客服+邀请域名
+export function Api_getSetting() {
+	return axios.get(`/api/config/getSetting`)
+}
+
 // 发送邮箱验证码
 export function Api_getEmailCode(data) {
 	return axios.post(`/api/sms_mail` , data )

+ 3 - 6
components/k-line/k-line.vue

@@ -1,6 +1,7 @@
 <template>
 	<view class="web-view-box" :style="{'width': '100%' , 'height': kHeight + 'px' }">
-		<iframe :style="{'width': '100%' , 'height': kHeight + 'px' }" src="https://kline.cuwiee.com/local.html" frameborder="0"></iframe>
+		<iframe :style="{'width': '100%' , 'height': kHeight + 'px' }" :src="`https://biking.okenx.com/kline/kline.html?tokenName=${currencyVal.currency_name}`" frameborder="0"></iframe>
+		<!-- <iframe :style="{'width': '100%' , 'height': kHeight + 'px' }" src="https://kline.cuwiee.com/local.html?symbol=LTC/USDT" frameborder="0"></iframe> -->
 <!-- 		<web-view :fullscreen="false" :style="{'width': '100%' , 'height': kHeight + 'px' }"
 			:src="`https://kline.cuwiee.com/local.html`"></web-view> -->
 	</view>
@@ -43,9 +44,5 @@
 	}
 </script>
 <style lang="scss" scoped>
-	.web-view-box {
-		width: 100%;
-
-		uni-web-view {}
-	}
+ 
 </style>

+ 34 - 12
components/sharePage/sharePage.vue

@@ -7,14 +7,14 @@
 			<view class="share-content">
 				<shareInvite v-if="shareType === 1">
 					<template #qrcode>
-						<tki-qrcode ref="qrcodeRef" :size="100" :showLoading="false" :val="qrcodeVal" />
+						<tki-qrcode ref="qrcodeRef" :size="130" :showLoading="false" :val="qrcodeVal" />
 						<!-- <ay-qrcode ref="qrcodeRef" :width="100" :height="100" :url="qrcodeVal"></ay-qrcode> -->
 					</template>
 				</shareInvite>
 
 				<shareOrder :shareVal="shareVal" v-if="shareType === 2">
 					<template #qrcode>
-						<tki-qrcode ref="qrcodeRef" :size="100" :showLoading="false" :val="qrcodeVal" />
+						<tki-qrcode ref="qrcodeRef" :size="130" :showLoading="false" :val="qrcodeVal" />
 					</template>
 				</shareOrder>
 			</view>
@@ -57,6 +57,9 @@
 	} from 'vuex'
 	import shareInvite from "./share_01.vue"
 	import shareOrder from "./share_02.vue"
+	import {
+		Way_getSetting
+	} from "@/utils/common-request.js"
 	export default {
 		name: "sharePage",
 		components: {
@@ -70,13 +73,14 @@
 			},
 			shareType: {
 				type: Number,
-				default: 1   // 1:邀请分享  2:订单分享
+				default: 1 // 1:邀请分享  2:订单分享
 			},
 		},
 		data() {
 			return {
-				shareCode: '', 
-				shareVal:{}
+				register_url:'',
+				shareCode: '',
+				shareVal: {}
 			};
 		},
 		computed: {
@@ -84,12 +88,32 @@
 				'statusBarHeight'
 			])
 		},
+		watch:{
+			register_url:{
+				// http: //register.okenx.com
+				handler(newUrl){
+					if(newUrl){
+						this.qrcodeVal = `${newUrl}/#/pages/register?extension_code=${this.shareCode}`
+						this.drawCode()
+					}
+				},
+				immediate:true
+			}
+		},
 		created() {
+			
 			this.shareCode = this.$getStorageSync('shareCode')
-			this.qrcodeVal = `${this.$config.shareLink}${this.shareCode}`;
+			this.register_url = this.$getStorageSync('register_url') || ''
+			if (!this.register_url) {
+				Way_getSetting().then(res => {
+					this.register_url = res.register_url
+				})
+				
+			}
+			// this.qrcodeVal = `${this.$config.shareLink}${this.shareCode}`;
 		},
 		mounted() {
-			
+
 			// this.$refs.popupRef.open()
 			// setTimeout(() => {
 			// 	this.$refs.qrcodeRef._makeCode()
@@ -97,21 +121,20 @@
 			// },3000)
 		},
 		methods: {
-			copyLink(){
+			copyLink() {
 				uni.setClipboardData({
 					data: this.qrcodeVal,
-					success: res =>{
+					success: res => {
 						uni.showToast({
 							title: '复制成功',
 							icon: 'none'
 						})
 					}
 				});
-				
+
 			},
 			drawCode() {
 				if (this.$refs.qrcodeRef) {
-					// this.$refs.qrcodeRef.crtQrCode()
 					this.$refs.qrcodeRef._makeCode()
 				} else {
 					setTimeout(() => {
@@ -122,7 +145,6 @@
 			},
 			openShare(val) {
 				this.shareVal = val
-				this.drawCode()
 				this.$nextTick(() => {
 					this.showTabBar(false)
 					this.$refs.popupRef.open()

+ 3 - 3
components/sharePage/share_01.vue

@@ -124,10 +124,10 @@
 			padding: 0 20rpx;
 
 			.share-code {
-				width: 130rpx;
-				height: 130rpx;
+				width: 140rpx;
+				height: 140rpx;
 				background-color: #fff;
-				padding: 15rpx;
+				padding: 5rpx;
 			}
 
 			.share-btns {

+ 3 - 3
components/sharePage/share_02.vue

@@ -103,9 +103,9 @@
 			padding: 10rpx 0 0 10rpx;
 
 			.footer-code {
-				width: 130rpx;
-				height: 130rpx;
-				padding: 15rpx;
+				width: 140rpx;
+				height: 140rpx;
+				padding: 5rpx;
 			}
 
 			.footer-content {

+ 51 - 8
pages/content/customer-service.vue

@@ -1,24 +1,67 @@
 <template>
-	<view >
-		<iframe-page />
+	<view class="iframe-content">
+		<headContent statusBarBg="#191A2E" bgColor="#191A2E">
+
+			<template #left>
+				<reverse-back iconColor="#fff" />
+			</template>
+			<template #content>
+				<view class="haed-title">
+					在线客服
+				</view>
+			</template>
+			<template #right>
+				<closeIocn iconColor="#fff" />
+			</template>
+		</headContent>
+		<view class="iframe-box">
+			<iframe :src="kefu_url" frameborder="0"></iframe>
+		</view>
 	</view>
 </template>
 
 <script>
+	import {
+		Way_getSetting
+	} from "@/utils/common-request.js"
 	export default {
 		name: 'customer-service',
 		data() {
 			return {
-
+				kefu_url: ''
 			};
+		},
+		onLoad() {
+			this.kefu_url = this.$getStorageSync('kefu_url') || ''
+			// 
+			if (!this.kefu_url) {
+				Way_getSetting().then(res => {
+					this.kefu_url = res.kefu_url
+				})
+			}
 		}
 	}
 </script>
 
 <style lang="scss" scoped>
-.iframe-box{
-	width: 100%;
-	height: 100vh;
- 
-}
+	.haed-title {
+		color: #fff !important;
+	}
+
+	.iframe-content {
+		width: 100%;
+		height: 100vh;
+		display: flex;
+		flex-direction: column;
+
+		.iframe-box {
+			flex: 1;
+
+			iframe {
+				width: 100%;
+				height: 100%;
+			}
+		}
+
+	}
 </style>

+ 23 - 8
utils/common-request.js

@@ -1,17 +1,21 @@
 import {
 	Api_getUserInfo,
 	Api_getQuotationNew,
-	
+	Api_getSetting
+
 } from "@/api/index.js"
 
-import {setStorageSync} from "./common.js"
+import {
+	setStorageSync
+} from "./common.js"
 
 // 获取个人信息
 export const Way_getUserInfo = () => {
 	return new Promise((resolve, reject) => {
 		Api_getUserInfo().then(res => {
-			setStorageSync('shareCode' , res.extension_code)
-			setStorageSync('userInfo' , res)
+			setStorageSync('shareCode', res.extension_code)
+			setStorageSync('userId', res.id)
+			setStorageSync('userInfo', res)
 			resolve(res)
 		}).catch(err => {
 			reject()
@@ -39,10 +43,21 @@ export const Way_getQuotationNew = () => {
 				resolve(quotationNewList)
 			}
 		}).catch(err => {
-		
+
 		}).finally(() => {
-			 
-		}) 
+
+		})
 	})
-	
+
+}
+
+export const Way_getSetting = () => {
+	return new Promise((resolve, reject) => {
+		Api_getSetting().then(res => {
+			setStorageSync('kefu_url', res?.kefu_url)
+			setStorageSync('register_url', res?.register_url)
+			resolve(res)
+		})
+	})
+
 }

+ 3 - 29
utils/websocket.js

@@ -61,34 +61,9 @@ export const startSocket = (data) => {
 				store.commit('websocket/set_daymarket', msg)
 			}
 		})
-		// socket.on('kline', (msg) => {
-		// 	// 收到服务器推送的消息,可以跟进自身业务进行操作
-		// 	if (filtration(msg)) {
-		// 		console.log('kline = ' , msg , new Date().getTime())
-		// 		const data = {
-		// 			// id:new Date().getTime(), // 时间戳
-		// 			id:msg.time, // 时间戳
-		// 			open:msg.open,
-		// 			close:msg.close,
-		// 			high:msg.high,
-		// 			low:msg.low,
-		// 			vol:msg.volume,
-		// 			amount:msg.amount,
-		// 			count:msg.count || 0,
-		// 			// id	int	时间戳
-		// 			// open	float	开盘价
-		// 			// close	float	收盘价
-		// 			// high	float	最高价
-		// 			// low	float	最低价
-		// 			// vol	float	成交额,VOL副图需要用到该参数
-		// 			// amount	float	成交量,在选择器里面需要用到该参数
-		// 			// count	int	成交笔数,当前为预留字段,你那边没有这个数据的话传个0就行,但是不能不传
-					
-					
-		// 		}
-		// 	}
-		// })
-		socket.emit('login', getStorageSync('shareCode'));
+ 
+		socket.emit('login', getStorageSync('userId'));
+		// console.log("getStorageSync('userId')" , getStorageSync('userId'))
 		socket.on('lever_trade', (msg) => {
 			// if (filtration(msg)) {
 			// 	console.log('lever_trade 133 = ' , JSON.parse(msg.tradesList))
@@ -97,7 +72,6 @@ export const startSocket = (data) => {
 			// 	store.commit('websocket/set_lever_trade', obj)
 			// }
 			const trades_all = JSON.parse(msg.trades_all)
-			console.log('kline = ' , trades_all  )
 			const obj = Object.assign({} , msg , {tradesList:trades_all})
 			store.commit('websocket/set_lever_trade', obj)
 		})