Fly 2 years ago
parent
commit
19b70c4bc3

+ 1 - 0
App.vue

@@ -4,6 +4,7 @@
 			// 读取手机状态栏高度
 			const app = uni.getWindowInfo()
 			this.$store.commit('app/SET_statusBarHeight', app.statusBarHeight || 30)
+			this.$store.commit('app/SET_windowInfo', app)
 		},
 		onShow: function() {
 			console.log('App Show')

+ 28 - 0
api/index.js

@@ -25,6 +25,11 @@ export function Api_getNewsList(data) {
 }
 
 
+//  文章详情
+export function Api_getNewDetail(data) {
+	return axios.post(`/api/news/detail` , data )
+}
+
 // 0-2 注册-01-获得国家区号
 export function Api_getAreaCode() {
 	return axios.post(`/api/area_code`)
@@ -75,6 +80,29 @@ export function Api_getTopUp(data) {
 	return axios.post(`/api/wallet/get_in_address` , data)
 }
 
+// 修改密码
+export function Api_setPassword(data) {
+	return axios.post(`/api/user/forget` , data)
+}
+
+
+// 地址列表
+export function Api_getAddress(data) {
+	return axios.post(`/api/wallet/get_address` , data)
+}
+
+// 增加提现地址
+export function Api_addAddress(data) {
+	return axios.post(`/api/wallet/addaddress` , data)
+}
+
+// 删除提现地址
+export function Api_delAddress(data) {
+	return axios.post(`/api/wallet/deladdress` , data)
+}
+
+
+
 // // 根据手机号登录
 // export function goAuthLogin_Api(data) {
 // 	return axios.post(`/auth/c/doMiniLoginByPhone` , data )

+ 8 - 2
components/carousels/carousels.vue

@@ -1,8 +1,8 @@
 <template>
 	<view class="swiper-content">
 		<swiper class="swiper-box" autoplay :interval="3000" circular @change="change">
-			<swiper-item v-for="(item ,index) in BannerList" :key="index">
-				<view class="swiper-item">
+			<swiper-item v-for="(item ,index) in BannerList" :key="`swiper_${index}`">
+				<view class="swiper-item" @click.stop="lookDetails(item)">
 					<image :src="item.thumbnail" mode="aspectFit"></image>
 				</view>
 			</swiper-item>
@@ -16,6 +16,7 @@
 </template>
 
 <script>
+	
 	export default {
 		name: "carousels",
 		props: {
@@ -40,6 +41,11 @@
 		methods: {
 			change(e) {
 				this.current = e.detail.current;
+			},
+			lookDetails(item){
+				uni.navigateTo({
+					url: `/pages/content/article-details?id=${item.id}`
+				})
 			}
 		}
 	}

+ 48 - 21
components/headContent/headContent.vue

@@ -1,5 +1,5 @@
 <template>
-	<view class="head" >
+	<view :class="['head' , borderBottom ? 'head-border' : '']" >
 		<!-- 状态栏 -->
 		<view class="status-bar status-bar-fixed" :style="{'height':`${statusBarHeight}px` , 'background-color': statusBarBg}"></view>
 		<view class="status-bar" :style="{'height':`${statusBarHeight}px`}"></view>
@@ -9,13 +9,13 @@
 			<view :class="['head-content' , fixed ? 'content-fixed' : '']" :style="{'background-color': bgColor}">
 				<view class="status-bar"  v-if="fixed" :style="{'height':`${statusBarHeight}px` , 'background-color': statusBarBg}"></view>
 				<view class="content-box" :style="{'height':headHeight}">
-					<view class="left" v-if="showleftRight" :style="{'width': leftRightWidth}">
+					<view class="left" v-if="showleftRight" >
 						<slot name="left"></slot>
 					</view>
 					<view class="content">
 						<slot name="content"></slot>
 					</view>
-					<view class="right" v-if="showleftRight" :style="{'width': leftRightWidth}">
+					<view class="right" v-if="showleftRight" >
 						<slot name="right"></slot>
 					</view>
 				</view>
@@ -34,6 +34,10 @@
 	export default {
 		name: "headContent",
 		props: {
+			borderBottom: {
+				type: Boolean,
+				default: false
+			},
 			// 是否线上状态栏
 			showStatusBar: {
 				type: Boolean,
@@ -76,6 +80,9 @@
 				'statusBarHeight',
 				'headHeight'
 			])
+		},
+		mounted() {
+			
 		}
 	}
 </script>
@@ -91,44 +98,60 @@
 		left: 0;
 		z-index: $headFixedZIndex;
 	}
-	
+	.head-border{
+		border-bottom: 1rpx solid $border-color;
+	}
 	.head {
 		width: 750rpx;
-
 		.head-content {
 			width: 100%;
 
 			.content-box {
 				width: 100%;
-				padding: 0 $pages-padding;
-				display: flex;
-				justify-content: space-between;
-				align-items: center;
+				// padding: 0 $pages-padding;
+				position: relative;
 
-				.left,
-				.right {
-					flex-shrink: 0;
-				}
+				// .left,
+				// .right {
+				// 	flex-shrink: 0;
+				// }
 
 				.left,
 				.right,
+				 {
+					 position: absolute;
+					 top: 50%;
+					transform: translateY(-50%); 
+					// height: 100%;
+					// display: flex;
+					// align-items: center;
+				}
+				.left{
+					left: $pages-padding;
+				}
+				.right{
+					right: $pages-padding;
+				}
+				
 				.content {
+					width: 100%;
 					height: 100%;
 					display: flex;
-					align-items: center;
-				}
-
-				.content {
-					flex: 1;
+					align-content: center;
 					justify-content: center;
+					// white-space: nowrap;
 				}
 
 				::v-deep .haed-title {
-
+					width: 100%;
+					height: 100%;
+					display: flex;
+					align-items: center;
+					justify-content: center;
+					white-space: nowrap; 
 					font-size: 32rpx;
 					font-family: PingFang SC, PingFang SC-Bold;
 					font-weight: 700;
-					text-align: center;
 					color: #1a1a1a;
 					letter-spacing: 0.72rpx;
 				}
@@ -136,7 +159,9 @@
 				::v-deep .head-icon {
 					width: 42rpx;
 					height: 40rpx;
-
+					.iconfont{
+						color: rgba(107, 104, 104, 0.9);
+					}
 					image {
 						width: 100%;
 						height: 100%;
@@ -144,6 +169,8 @@
 				}
 
 				.right {
+					display: flex;
+					align-items: center;
 					justify-content: flex-end;
 
 					::v-deep .head-icon+.head-icon {

+ 2 - 1
components/headModules/login.vue

@@ -1,7 +1,8 @@
 <template>
 	<view class="login-status" @click.stop="getUserInfo()">
 		<view class="head-icon">
-			<image src="../../static/images/logo.png" mode="aspectFit"></image>
+			<text class="iconfont">&#xe72a;</text>
+			<!-- <image src="../../static/images/logo.png" mode="aspectFit"></image> -->
 		</view>
 		<view v-if="!token" class="no-login">
 			登录/注册

+ 2 - 1
components/headModules/message.vue

@@ -1,6 +1,7 @@
 <template>
 	<view class="head-icon" >
-		<image src="../../static/images/logo.png" mode="aspectFit"></image>
+			<text class="iconfont">&#xe658;</text>
+		<!-- <image src="../../static/images/logo.png" mode="aspectFit"></image> -->
 	</view>
 </template>
 

+ 2 - 1
components/headModules/share.vue

@@ -1,6 +1,7 @@
 <template>
 	<view class="head-icon" @click.stop="openShare()">
-		<image  src="../../static/images/logo.png" mode="aspectFit"></image>
+		<text class="iconfont">&#xe7c5;</text>
+		<!-- <image  src="../../static/images/logo.png" mode="aspectFit"></image> -->
 		<sharePage ref="sharePageRef"/>
 	</view>
 </template>

+ 0 - 2
components/iframe-page/iframe-page.vue

@@ -23,10 +23,8 @@
 </template>
 
 <script>
-	import closeIocn from "./../headModules/close.vue"
 	export default {
 		name: "iframe-page",
-		components:{closeIocn},
 		data() {
 			return {
 

+ 2 - 2
components/marketplace/marketplace.vue

@@ -54,8 +54,8 @@
 						</view>
 					</view>
 				</uni-td>
-				<uni-td class="table-right">
-					<view :class="['table-btn' , val.change > 0 ? 'rise-btn' : 'fall-btn']">
+				<uni-td :class="['table-right' , $setColor(val.change)]">
+					<view class="table-btn bgcolor">
 						{{ val.change }}%
 					</view>
 				</uni-td>

+ 9 - 1
components/rollMessage/rollMessage.vue

@@ -2,7 +2,7 @@
 	<view class="roll-box">
 		<image class="roll-icon" src="../../static/logo.png" mode="aspectFit"></image>
 		<view class="roll-list hide_1">
-			<u-notice-bar icon='' bgColor="" duration="3000" direction="column" :text="rollMsg.map(el => {
+			<u-notice-bar icon='' bgColor="" duration="3000" direction="column" @click="lookDetails" :text="rollMsg.map(el => {
 				return el.title || ''
 			})">
 			</u-notice-bar>
@@ -38,6 +38,14 @@
 					'币王BiKing合约交易所代理签约邀您加入币王BiKing合约交易所代理签约邀您加入'
 				]
 			};
+		},
+		methods:{
+			lookDetails(index){
+				const id = this.rollMsg[index]?.id;
+				uni.navigateTo({
+					url: `/pages/content/article-details?id=${id}`
+				})
+			}
 		}
 	}
 </script>

+ 41 - 16
components/unopen/unopen.vue

@@ -3,10 +3,16 @@
 
 		<view class="unopen-box">
 			<view class="unopen-title">
-				温馨提示
+				提示
 			</view>
 			<view class="unopen-content">
-				暂未开放
+				<view class="content">
+					{{ content }}
+				</view>
+				
+				<view class="unopen-btn" @click.stop="$refs.popupRef.close()">
+					我知道了
+				</view>
 			</view>
 		</view>
 	</uni-popup>
@@ -15,6 +21,12 @@
 <script>
 	export default {
 		name: "unopen",
+		props:{
+			content:{
+				type:String,
+				default:'暂未开放'
+			}
+		},
 		data() {
 			return {
 
@@ -36,9 +48,9 @@
 
 <style lang="scss" scoped>
 	.unopen-box {
-		width: 587rpx;
+		width: 520rpx;
 		background-color: #fff;
-		border-radius: 12rpx;
+		border-radius: 20rpx;
 		overflow: hidden;
 
 		.unopen-title {
@@ -50,22 +62,35 @@
 			color: #1a1a1a;
 			line-height: 90rpx;
 			letter-spacing: 0.64rpx;
-			border-bottom: 1rpx solid #e6e6e6;
+			border-bottom: 1rpx solid $border-color4;
 		}
 
 		.unopen-content {
-			padding: 20rpx 30rpx;
-			min-height: 140rpx;
-			font-size: 28rpx;
-			font-family: PingFang SC, PingFang SC-Regular;
-			font-weight: 400;
-			text-align: left;
-			color: #1a1a1a;
-			line-height: 42rpx;
+			padding: 0 36rpx;
+				min-height: 140rpx;
+			
+			.content{
+				padding:40rpx 0;
+				font-size: 24rpx;
+				font-family: PingFang SC, PingFang SC-Regular;
+				font-weight: 400;
+				color: #1a1a1a; 
+				display: flex;
+				justify-content: center;
+				align-items: center;
+			}
+		}
+		.unopen-btn{
+			width: 100%;
+			height: 80rpx;
+			line-height:80rpx;
+			background-color: $Theme-Color;
+			margin-bottom: 40rpx;
+			color: #fff;
 			text-align: center;
-			display: flex;
-			justify-content: center;
-			align-items: center;
+			font-size: 30rpx;
+			letter-spacing: 1px;
+			border-radius: 6rpx;
 		}
 
 	}

+ 3 - 1
main.js

@@ -5,7 +5,7 @@ import store from './store'
 // main.js,注意要在use方法之后执行
 import uView from 'uview-ui'
 Vue.use(uView)
-// uni.$u.config.unit = 'rpx'
+uni.$u.config.unit = 'rpx'
 
 
 
@@ -16,8 +16,10 @@ Vue.use(initialize);
 
 // 全局加载组件
 import reverseBack from "@/components/headModules/reverse-back.vue"
+import closeIocn from "@/components/headModules/close.vue"
 
 Vue.component('reverseBack', reverseBack)
+Vue.component('closeIocn', closeIocn)
 
 
 // 如此配置即可

+ 18 - 0
pages.json

@@ -145,6 +145,24 @@
                     "style" : {
                         "navigationBarTitleText" : "兑换记录"
                     }
+                },
+                {
+                    "path" : "article-details",
+                    "style" : {
+                        "navigationBarTitleText" : "文章详情"
+                    }
+                },
+                {
+                    "path" : "address",
+                    "style" : {
+                        "navigationBarTitleText" : "地址管理"
+                    }
+                },
+                {
+                    "path" : "add-address",
+                    "style" : {
+                        "navigationBarTitleText" : "添加地址"
+                    }
                 }
             ]
         }

+ 294 - 0
pages/content/add-address.vue

@@ -0,0 +1,294 @@
+<template>
+	<view>
+		<!-- 头部 -->
+		<headContent borderBottom>
+			<template #left>
+				<reverse-back />
+			</template>
+		</headContent>
+		<view class="content">
+			<view class="pages-title">
+				地址管理
+			</view>
+			<view class="currency-type">
+				<view class="currency-lable">
+					<template v-if="currencyInfo">
+						<image class="lable-title" :src="currencyInfo.logo" mode="aspectFit"></image>
+						<text class="lable-tag">{{ currencyInfo.name }}</text>
+					</template>
+
+				</view>
+				<view class="select-currency" @click.stop="selectCurrency">
+					<text class="select-text">请选择币种</text>
+					<text class="select-icon iconfont">&#xe88e;</text>
+				</view>
+			</view>
+			<view class="add-box">
+				<view class="add-type">
+					<text @click.stop="type = 'TRC20'"
+						:class="['link-btn' , type === 'TRC20' ? 'active-link-btn' : '']">TRC20</text>
+					<text @click.stop="type = 'ERC20'"
+						:class="['link-btn' , type === 'ERC20' ? 'active-link-btn' : '']">ERC20</text>
+				</view>
+				<view class="address-text">
+					<text class="address-lable">地址</text>
+					<view class="address-info">
+						<textarea class="address-input" v-model="address" maxlength="100" auto-height
+							placeholder-class="placeholder-class" placeholder="请输入地址" />
+						<text class="address-moer">粘贴</text>
+						<text class="address-link"></text>
+						<text class="address-icon iconfont">&#xe606;</text>
+					</view>
+				</view>
+				<view class="address-text">
+					<text class="address-lable">钱包备注</text>
+					<view class="address-info"><textarea class="address-input" v-model="notes" maxlength="20"
+							auto-height placeholder-class="placeholder-class" placeholder="请输入备注" />
+					</view>
+				</view>
+			</view>
+
+
+			<view class="add-address">
+				<view class="add-btn" @click.stop="submitAddress()">
+					添加
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+<script>
+	import {
+		Api_addAddress
+	} from "@/api/index.js"
+	export default {
+		name: 'addAddress',
+		data() {
+			return {
+				currencyInfo: null,
+				type: 'ERC20',
+				address: '',
+				notes: ''
+			};
+		},
+		onLoad() {
+			const eventChannel = this.getOpenerEventChannel();
+
+			// 监听setCurrency事件,获取上一页面通过eventChannel传送到当前页面的数据
+			eventChannel.on('setCurrency', data => {
+				this.currencyInfo = data
+			})
+		},
+
+		onShow() {},
+		mounted() {
+
+		},
+		methods: {
+			// 选择币种
+			selectCurrency() {
+				uni.navigateTo({
+					url: `/pages/content/select-currency?type=addAddress`
+				})
+			},
+			submitAddress() {
+
+				if (this.currencyInfo && this.address && this.notes) {
+					const obj = {
+						currency_id: this.currencyInfo.id,
+						type: this.type,
+						wallet_address: this.address,
+						notes: this.notes
+					}
+					Api_addAddress(obj).then(res => {
+						uni.redirectTo({
+							url: '/pages/content/address'
+						});
+					}).catch(err => {
+
+					})
+				}
+
+
+
+
+
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.content {
+		width: 100%;
+		padding: 0 $pages-padding;
+
+		.pages-title {
+			height: 120rpx;
+			font-size: 60rpx;
+			font-weight: bold;
+			line-height: 130rpx;
+		}
+
+		// <view class="currency-type">
+		// 				<view class="currency-lable">
+		// 					<image class="lable-title" src="../../static/logo.png" mode="aspectFit"></image>
+		// 					<text class="lable-tag">USDT</text>
+		// 				</view>
+		// 				<view class="select-currency">
+		// 					<text class="select-text">请选择币种</text>
+		// 					<text class="select-icon iconfont">&#xe88e;</text>
+		// 				</view>
+		// 			</view>
+		.currency-type {
+			width: 100%;
+			min-height: 100rpx;
+			display: flex;
+			align-items: stretch;
+			justify-content: space-between;
+			padding: 20rpx 20rpx 20rpx 30rpx;
+			background-color: #f6f6f6;
+			margin-bottom: 20rpx;
+			border-radius: 10rpx;
+
+			.currency-lable {
+				display: flex;
+				align-items: center;
+
+				.lable-title {
+					width: 50rpx;
+					height: 50rpx;
+					border-radius: 50%;
+				}
+
+				.lable-tag {
+					font-size: 30rpx;
+					font-weight: 700;
+					padding-left: 20rpx;
+				}
+			}
+
+			.select-currency {
+				display: flex;
+				align-items: center;
+				font-size: 24rpx;
+				color: #010101;
+
+				.select-icon {
+					font-size: 24rpx;
+					color: #010101;
+				}
+			}
+		}
+
+
+		.add-box {
+			width: 100%;
+			padding: 30rpx 20rpx;
+			border-radius: 10rpx;
+			background-color: #f6f6f6;
+
+			.add-type {
+				width: 100%;
+
+				.link-btn {
+					display: inline-block;
+					width: 140rpx;
+					height: 72rpx;
+					background: #f6f5f3;
+					border-radius: 8px;
+					text-align: center;
+					line-height: 70rpx;
+					font-size: 28rpx;
+					font-weight: 400;
+					color: #666666;
+					border-radius: 8rpx;
+					border: 1rpx solid #f6f5f3;
+
+					&:nth-child(n + 2) {
+						margin-left: 20rpx;
+					}
+				}
+
+				.active-link-btn {
+					background: #ffffff;
+					border-color: #05c175;
+					color: #FFBA6A;
+				}
+			}
+
+			.address-text {
+				width: 100%;
+				padding-top: 40rpx;
+
+				.address-lable {
+					font-size: 30rpx;
+				}
+
+				.address-info {
+					width: 100%;
+					height: 80rpx;
+					display: flex;
+					justify-content: space-between;
+					align-items: center;
+					overflow: hidden;
+					border-bottom: 1rpx solid $border-color4;
+
+					.address-input {
+						height: 100%;
+						font-size: 26rpx;
+						padding-right: 20rpx;
+					}
+
+					.address-moer {
+						flex-shrink: 0;
+						font-size: 26rpx;
+						color: #FFBA6A;
+					}
+
+					.address-link {
+						width: 1rpx;
+						height: 70%;
+						background-color: $border-color4;
+						margin: 0 16rpx;
+					}
+
+					.address-icon {
+						flex-shrink: 0;
+						font-size: 40rpx;
+						color: #000;
+						margin-right: 10rpx;
+					}
+
+					.placeholder-class {
+						// color: #f6f5f3;
+					}
+				}
+			}
+
+			// <view class="address-text">
+			// 	<text class="address-lable">钱包备注</text>
+			// 	<view class="address-info">
+			// 		<input class="address-input" focus placeholder="自动获得焦点" />
+			// 	</view>
+			// </view>
+		}
+
+		.add-address {
+			width: 100%;
+			height: 160rpx;
+			padding: 40rpx 10rpx;
+
+			.add-btn {
+				width: 100%;
+				height: 100%;
+				text-align: center;
+				line-height: 80rpx;
+				background-color: $Theme-Color;
+				font-size: 32rpx;
+				color: #fff;
+				border-radius: 10rpx;
+			}
+		}
+	}
+</style>

+ 257 - 0
pages/content/address.vue

@@ -0,0 +1,257 @@
+<template>
+	<view>
+		<!-- 头部 -->
+		<headContent borderBottom>
+			<template #left>
+				<reverse-back />
+			</template>
+			<template #right>
+				<view class="head-icon" @click.stop="selectCurrency()">
+					<text class="iconfont">&#xe671;</text>
+				</view>
+			</template>
+		</headContent>
+		<view class="content" :style="{'height':PageContentHeight + 'px'}">
+			<view class="pages-title">
+				地址管理
+			</view>
+			<view class="currency">
+				<text class="currency-lable">{{ currencyInfo ? currencyInfo.name : '' }}</text>
+				<u-switch space="4" v-model="value11" activeColor="#05C175" inactiveColor="rgb(226, 226, 226)"
+					size="30"></u-switch>
+			</view>
+			<scroll-view class="scroll-view" scroll-y :style="{'height': scrollHeight}">
+				<template v-for="(item , index) in addressList">
+					<view class="address-item">
+						<view class="address-title">
+							<text class="title">{{ item.notes }}</text>
+							<text class="del-address" @click.stop="delAddress(item)">删除</text>
+						</view>
+						<view class="address-currency">
+							{{ currencyInfo ? `${currencyInfo.name}_` : '' }}{{ item.type }}
+						</view>
+						<view class="address-text">
+							{{ item.address }}
+						</view>
+					</view>
+				</template>
+			</scroll-view>
+			<view class="add-address">
+				<view class="add-btn" @click.stop="addBtn()">
+					添加提币地址
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+<script>
+	import {
+		mapGetters
+	} from 'vuex'
+	import {
+		Way_getBiTypeList
+	} from "@/utils/common-request.js"
+	import {
+		Api_getAddress,
+		Api_delAddress
+	} from "@/api/index.js"
+	export default {
+		name: 'addressList',
+		data() {
+			return {
+				value11: false,
+				scrollHeight: 0,
+				currencyInfo: null,
+				addressList: [],
+				getBiStatus: false,
+			};
+		},
+		computed: {
+			...mapGetters([
+				'PageContentHeight'
+			])
+		},
+		watch: {
+			PageContentHeight: {
+				handler(newH) {
+					this.scrollHeight = newH - uni.upx2px(120) - uni.upx2px(80) - uni.upx2px(160) + 'px'
+				},
+				immediate: true
+			},
+			currencyInfo: {
+				handler(newC, oldC) {
+					if (newC && newC.id !== oldC?.id) {
+						this.getAddress();
+						this.$setStorageSync('currency', newC);
+					} else {
+						if (this.getBiStatus) {
+							return false
+						};
+						this.getBiStatus = true;
+						Way_getBiTypeList().then(res => {
+							if (res && res.length > 0) {
+								this.currencyInfo = res[0];
+								this.getBiStatus = false
+							}
+						}).catch(err => {})
+					}
+				},
+				deep: true,
+				immediate: true
+			},
+		},
+		onLoad() {
+			this.currencyInfo = this.$getStorageSync('currency');
+		},
+		onShow() {
+
+		},
+		mounted() {
+
+		},
+		methods: {
+			// 删除
+			delAddress(item) {
+				uni.showLoading({
+					title: ''
+				})
+				Api_delAddress({
+					address_id: item.id
+				}).then(res => {
+					this.getAddress()
+				}).catch(err => {
+
+				}).finally(() => {
+					setTimeout(() => {
+						uni.hideLoading()
+					},200)
+				})
+			},
+			selectCurrency() {
+				uni.navigateTo({
+					url: `/pages/content/select-currency?type=address`
+				})
+			},
+			addBtn() {
+				uni.navigateTo({
+					url: '/pages/content/add-address',
+					success: res => {
+						// 通过eventChannel向被打开页面传送数据
+						res.eventChannel.emit('setCurrency', this.currencyInfo)
+					}
+				})
+			},
+			getAddress() {
+				Api_getAddress({
+					currency: this.currencyInfo?.id
+				}).then(res => {
+					this.addressList = res
+					console.log('getAddress = ', res)
+				}).catch(err => {
+
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.content {
+		width: 100%;
+
+		.pages-title {
+			height: 120rpx;
+			font-size: 60rpx;
+			font-weight: bold;
+			line-height: 130rpx;
+			padding: 0 $pages-padding;
+		}
+
+		.currency {
+			width: 100%;
+			height: 80rpx;
+			padding: 0 $pages-padding;
+			display: flex;
+			justify-content: space-between;
+
+			.currency-lable {
+				font-size: 28rpx;
+			}
+		}
+
+		.scroll-view {
+			width: 100%;
+			padding: 0 $pages-padding;
+
+			.address-item {
+				width: 100%;
+				background-color: #f6f6f6;
+				padding: 36rpx 20rpx;
+				border-radius: 10rpx;
+				margin-bottom: 20rpx;
+
+				.address-title {
+					width: 100%;
+					border-bottom: 1rpx solid $border-color4;
+					padding-bottom: 30rpx;
+					display: flex;
+					justify-content: space-between;
+
+					.title {
+						flex: 1;
+						font-size: 30rpx;
+					}
+
+					.del-address {
+						flex-shrink: 0;
+						font-size: 26rpx;
+						color: #d7b213;
+					}
+				}
+
+				.address-currency {
+					padding: 20rpx 0 16rpx;
+					font-size: 24rpx;
+					color: #aaa8a8;
+				}
+
+				.address-text {
+					font-size: 22rpx;
+					color: #aaa8a8;
+				}
+			}
+
+			// <view class="address-item">
+			// 	<view class="address-title">
+			// 		<text class="title">发个按时打卡可是大家撒低级</text>
+			// 		<text class="del-address">删除</text>
+			// 	</view>
+			// 	<view class="address-currency">
+			// 		USDT_TRC20
+			// 	</view>
+			// 	<view class="address-text">
+			// 		的军事打击跨国黄金时代进口的韩国
+			// 	</view>
+			// </view>
+
+
+		}
+
+		.add-address {
+			width: 100%;
+			height: 160rpx;
+			padding: 40rpx $pages-padding;
+
+			.add-btn {
+				width: 100%;
+				height: 100%;
+				text-align: center;
+				line-height: 80rpx;
+				background-color: $Theme-Color;
+				font-size: 32rpx;
+				color: #fff;
+				border-radius: 10rpx;
+			}
+		}
+	}
+</style>

+ 65 - 0
pages/content/article-details.vue

@@ -0,0 +1,65 @@
+<template>
+	<view>
+		<headContent statusBarBg="#191A2E" bgColor="#191A2E">
+
+			<template #left>
+				<reverse-back iconColor="#fff" />
+			</template>
+			<template #content>
+				<view class="haed-title">
+					{{ NewTitle }}
+				</view>
+			</template>
+			<template #right>
+				<closeIocn iconColor="#fff" />
+			</template>
+		</headContent>
+		<view class="new-content" v-html="NewContent">
+			
+		</view>
+	</view>
+</template>
+
+<script> 
+	import {
+		Api_getNewDetail
+	} from "@/api/index.js"
+	export default {
+		name: 'article-details',
+		data() {
+			return {
+				NewId: null,
+				NewContent:'',
+				NewTitle:''
+			};
+		},
+		onLoad(opt) {
+			this.NewId = opt?.id;
+			this.getNewDetail()
+		},
+		mounted() {
+
+		},
+		methods: {
+			getNewDetail() {
+				if (this.NewId) {
+					Api_getNewDetail({
+						id: this.NewId
+					}).then(res => {
+						this.NewContent = res?.content;
+						this.NewTitle = res?.title;
+					})
+				}
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.haed-title {
+		color: #fff !important;
+	}
+	.new-content{
+		padding: 0 $pages-padding 0;
+	}
+</style>

+ 49 - 9
pages/content/change-password.vue

@@ -13,7 +13,7 @@
 
 		<view class="change-hint">
 			<text class="iconfont">&#xe8ec;</text>
-			<text>修改登录密码需24小时后才能操作体现</text>
+			<text>{{ changeHint }}</text>
 		</view>
 
 		<view class="form-box">
@@ -33,7 +33,8 @@
 				<view class="form-item ">
 					<view class="form-item-lable">新密码</view>
 					<input class="form-item-input" v-model="formData.newPassword" :maxlength="maxlength"
-						placeholder-class="form-item-place" :type="showNewPsd ? 'text' : 'password'" placeholder="请输入新密码">
+						placeholder-class="form-item-place" :type="showNewPsd ? 'text' : 'password'"
+						placeholder="请输入新密码">
 					<view class="form-item-icon" @click.stop="showNewPsd = !showNewPsd">
 						<text v-show="showNewPsd" class="iconfont">&#xe663;</text>
 						<text v-show="!showNewPsd" class="iconfont">&#xe664;</text>
@@ -43,7 +44,8 @@
 				<view class="form-item ">
 					<view class="form-item-lable">确认密码</view>
 					<input class="form-item-input" v-model="formData.confirmPassword" :maxlength="maxlength"
-						placeholder-class="form-item-place" :type="showConfirmPsd ? 'text' : 'password'" placeholder="请再次输入新密码">
+						placeholder-class="form-item-place" :type="showConfirmPsd ? 'text' : 'password'"
+						placeholder="请再次输入新密码">
 					<view class="form-item-icon" @click.stop="showConfirmPsd = !showConfirmPsd">
 						<text v-show="showConfirmPsd" class="iconfont">&#xe663;</text>
 						<text v-show="!showConfirmPsd" class="iconfont">&#xe664;</text>
@@ -57,6 +59,8 @@
 				确定
 			</view>
 		</view>
+
+		<unopen ref="unopenRef" :content="changeHint" />
 	</view>
 </template>
 
@@ -64,14 +68,25 @@
 	import {
 		validPassword
 	} from "@/utils/validate.js"
+	import {
+		Api_setPassword
+	} from "@/api/index.js"
+	import {
+		Way_getUserInfo
+	} from "@/utils/common-request.js"
+	import {
+		refreshAccount
+	} from "@/utils/common.js"
 	export default {
 		name: 'change-password',
 		data() {
 			return {
+				account: null,
+				changeHint: "修改登录密码需24小时后才能操作提现",
 				maxlength: 20,
 				showPwd: false,
-				showNewPsd:false,
-				showConfirmPsd:false,
+				showNewPsd: false,
+				showConfirmPsd: false,
 				formData: {
 					password: '',
 					newPassword: '',
@@ -95,7 +110,16 @@
 				this.validateField('confirmPassword')
 			}
 		},
+		onShow() {
+			this.getUserInfo();
+			this.$refs.unopenRef.open();
+		},
 		methods: {
+			getUserInfo() {
+				Way_getUserInfo().then(res => {
+					this.account = res;
+				})
+			},
 			validateField(key) {
 				let validateStatus = false
 				switch (key) {
@@ -176,11 +200,27 @@
 						title: '修改中',
 						mask: true
 					})
+					const obj = {
+						account: this.account?.account_number,
+						password: this.formData.newPassword,
+						repassword: this.formData.newPassword
+					}
+					// formData: {
+					// 	password: '',
+					// 	newPassword: '',
+					// 	confirmPassword: ''
+					// },
+					Api_setPassword(obj).then(res => {
+						setTimeout(() => {
+							refreshAccount()
+						}, 501)
+					}).catch(err => {}).finally(() => {
+						setTimeout(() => {
+							uni.hideLoading()
+						}, 500)
+					})
 
 
-					setTimeout(() => {
-						uni.hideLoading()
-					}, 500)
 				})
 
 
@@ -265,7 +305,7 @@
 			width: 100%;
 			background-color: #ccc;
 			height: 80rpx;
-			margin-top: 60rpx;
+			margin-top: 20rpx;
 			border-radius: 10rpx;
 			text-align: center;
 			line-height: 80rpx;

+ 38 - 13
pages/content/mine.vue

@@ -1,7 +1,7 @@
 <template>
-	<view class="mine-page">
+	<view class="mine-page" >
 		<!-- 头部 -->
-		<headContent>
+		<headContent borderBottom>
 			<template #left>
 				<reverse-back />
 			</template>
@@ -50,7 +50,7 @@
 					<text class="more-icon iconfont">&#xe88e;</text>
 				</view>
 			</view>
-			<view v-show="showMuen" class="mine-muen-item">
+			<view v-show="showMuen" class="mine-muen-item" @click.stop="getAddress()">
 				<view class="muen-content">
 					<image class="muen-icon" src="@/static/logo.png" mode="aspectFit" />
 					<text class="muen-text">提现地址</text>
@@ -124,7 +124,7 @@
 		</view>
 		<gap />
 		<view class="mine-muen">
-			<view class="mine-muen-item">
+			<!-- <view class="mine-muen-item">
 				<view class="muen-content">
 					<image class="muen-icon" src="../../static/logo.png" mode="aspectFit" />
 					<text class="muen-text">消息中心</text>
@@ -132,7 +132,7 @@
 				<view class="muen-more">
 					<text class="more-icon iconfont">&#xe88e;</text>
 				</view>
-			</view>
+			</view> -->
 			<view class="mine-muen-item" @click.stop="getService()">
 				<view class="muen-content">
 					<image class="muen-icon" src="../../static/logo.png" mode="aspectFit" />
@@ -142,7 +142,7 @@
 					<text class="more-icon iconfont">&#xe88e;</text>
 				</view>
 			</view>
-			<view class="mine-muen-item">
+			<view class="mine-muen-item" @click.stop="getAboutUs()">
 				<view class="muen-content">
 					<image class="muen-icon" src="../../static/logo.png" mode="aspectFit" />
 					<text class="muen-text">关于我们</text>
@@ -151,8 +151,8 @@
 					<text class="more-icon iconfont">&#xe88e;</text>
 				</view>
 			</view>
-			<view class="mine-btn" v-show="showMuen">
-				安全登录
+			<view class="mine-btn" @click.stop="retreatFromLogin" v-show="showMuen">
+				安全退出
 			</view>
 		</view>
  
@@ -171,6 +171,9 @@
 	import reverseBack from "@/components/headModules/reverse-back.vue"
 	import pageStyle from "@/components/headModules/style.vue"
 	import { Way_getUserInfo } from "@/utils/common-request.js"
+	import {
+		refreshAccount
+	} from "@/utils/common.js"
 	export default {
 		components: {
 			pageStyle,
@@ -234,11 +237,30 @@
 					url:'/pages/content/safety-set'
 				})
 			},
+			// 在线客服
 			getService(){
 				uni.navigateTo({
 					url:'/pages/content/customer-service'
 				})
+			},
+			// 关于我们
+			getAboutUs(){
+				uni.navigateTo({
+					url: `/pages/content/article-details?id=187`
+				})
+			},
+			// 安全退出
+			retreatFromLogin(){
+				refreshAccount()
+			},
+			// 获取地址列表
+			getAddress(){
+				uni.navigateTo({
+					url:'/pages/content/address'
+				})
 			}
+			
+			
 		}
 	}
 </script>
@@ -251,12 +273,14 @@
 <style lang="scss" scoped>
 	.mine-info {
 		width: 100%;
-		min-height: 160rpx;
+		min-height: 140rpx;
 		background-color: $modules-box-bg;
 		padding: 23rpx $pages-padding 30rpx;
-
+		display: flex;
+		flex-direction: column;
+		justify-content: space-between;
 		.mine-account {
-			font-size: 38rpx;
+			font-size: 34rpx;
 			font-family: PingFang SC, PingFang SC-Bold;
 			font-weight: 700;
 			color: #1a1a1a;
@@ -264,11 +288,12 @@
 
 		.mine-UID {
 			margin-top: 13rpx;
-			font-size: 28rpx;
+			font-size: 22rpx;
 			font-family: PingFang SC, PingFang SC-Regular;
 			font-weight: 400;
 			color: #808080;
-
+			display: flex;
+			align-items: center;
 			.copy-UID {
 				width: 22rpx;
 				height: 26rpx;

+ 66 - 56
pages/content/select-currency.vue

@@ -28,86 +28,91 @@
 
 <script>
 	import reverseBack from "@/components/headModules/reverse-back.vue"
-	import { Api_getQuotationNew , Api_getBiTypeList , Api_getFlashRecord , Api_getSubmit} from "@/api/index.js"
+	import {
+		Api_getQuotationNew,
+		Api_getBiTypeList,
+		Api_getFlashRecord,
+		Api_getSubmit
+	} from "@/api/index.js"
 	export default {
 		name: 'selectCurrency',
 		components: {
 			reverseBack
 		},
 		data() {
-			return { 
-				currencyList: [
-					// {
-					// 	icon: require('@/static/images/bi/bi_01.png'),
-					// 	name: 'BTC'
-					// },
-					// {
-					// 	icon: require('@/static/images/bi/bi_02.png'),
-					// 	name: 'BTC'
-					// },
-					// {
-					// 	icon: require('@/static/images/bi/bi_03.png'),
-					// 	name: 'BTC'
-					// },
-					// {
-					// 	icon: require('@/static/images/bi/bi_03.png'),
-					// 	name: 'BTC'
-					// }
-				]
+			return {
+				pageType: '',
+				currencyList: []
 			};
 		},
-		onLoad() {
+		onLoad(opt) {
+			this.pageType = opt?.type;
 			this.getBiTypeList();
 		},
-	 
-		methods:{
-			getBiTypeList(){
+
+		methods: {
+			getBiTypeList() {
 				uni.showLoading()
 				Api_getQuotationNew().then(res => {
-					console.log('Api_getBiTypeList = ' , res)
-					this.currencyList = res || []
-				}).catch(err => {
-					console.log('Api_getBiTypeList = ' , err)
-				}).finally(() => {
-					uni.hideLoading()
+					this.currencyList = res || [];
+				}).catch(err => {}).finally(() => {
+					uni.hideLoading();
 				})
 			},
 			// pages/content/top-up
-			topUp(item){
-				
-				
-				
-				const time = new Date().getTime();
-				let key = {};
-				key[`bi_${time}`] = item
-				this.$setStorageSync('select' , key)
-				
-				let path = `/pages/content/top-up?key=${`bi_${time}`}`
-				
+			topUp(item) {
+				let path = ''
+				switch (this.pageType) {
+					case 'addAddress':
+						path = 'pages/content/add-address';
+						break;
+					case 'address':
+						path = 'pages/content/address';
+						break;
+
+
+
+
+
+
+				}
+
+
+
+
+				// let path = `/pages/content/top-up?key=${`bi_${time}`}`
+				// 'pages/content/top-up'
 				const pages = getCurrentPages()
-				if(pages.length > 2 && pages[pages.length - 2].route === 'pages/content/top-up' ){
-				console.log('pages 11 = ' , pages , pages[pages.length - 2].route)
-					 
-					uni.redirectTo({
-						url:path
-					})
-				}else{
-					console.log('222')
+				if (pages.length >= 2 && pages[pages.length - 2].route === path) {
+					let prevPage = pages[pages.length - 2];
+					// pages
+					prevPage.$vm.currencyInfo = item;
+					uni.navigateBack({
+						delta: 1
+					});
+				} else {
+					const time = new Date().getTime();
+					let key = {};
+					key[`bi_${time}`] = item
+					this.$setStorageSync('select', key)
+					path = `/${path}?key=${`bi_${time}`}`
 					uni.navigateTo({
 						url: path
 					});
 				}
+
+
 				// uni.navigateTo({
 				// 	url: path
 				// });
 			},
 			// 查看充值记录
-			lookRecord(){
+			lookRecord() {
 				uni.navigateTo({
-					url:'/pages/content/charge-record'
+					url: '/pages/content/charge-record'
 				})
 			}
-			
+
 		}
 	}
 </script>
@@ -117,28 +122,33 @@
 	}
 </style>
 <style lang="scss" scoped>
-	.head-record{
+	.head-record {
 		font-size: 60rpx;
 	}
+
 	.currency-box {
 		width: 100%;
 		padding: 40rpx $pages-padding 0;
-		.currency-item{
+
+		.currency-item {
 			width: 100%;
 			display: flex;
 			align-items: center;
 			padding: 30rpx 0;
-			.currency-icon{
+
+			.currency-icon {
 				width: 46rpx;
 				height: 46rpx;
 				flex-shrink: 0;
 			}
-			.currency-name{
+
+			.currency-name {
 				font-size: 28rpx;
 				padding-left: 7px;
 				font-weight: 700;
 			}
 		}
+
 		// <view class="currency-box">
 		// 	<block v-for="(item , index) in currencyList" :key="`currency_${index}`">
 		// 		<view class="currency-item">

+ 25 - 5
pages/index/index.vue

@@ -24,7 +24,7 @@
 
 		<view style="width: 100%;height: 1rpx;"></view>
 		<!-- usdt -->
-		<usdt></usdt>
+		<usdt :usdtList="usdtList"></usdt>
 
 		<view style="width: 100%;height: 8rpx;"></view>
 
@@ -72,10 +72,11 @@
 		},
 		data() {
 			return {
+				usdtList: [],
 				title: 'Hello',
 				BannerList: [],
 				Announcement: [],
-				quotationNew:[]
+				quotationNew: []
 			}
 		},
 		computed: {
@@ -83,6 +84,26 @@
 				'stocksColor'
 			]),
 		},
+		watch: {
+			quotationNew: {
+				handler(newArr) {
+					this.usdtList = [];
+					if (newArr && newArr[0].quotation.length > 0) {
+						for (let i =  0; i < newArr[0].quotation.length; i++) {
+							if (i < 3) {
+								this.usdtList.push(newArr[0].quotation[i])
+							}else{
+								break;
+							}
+						};
+						console.log('this.usdtList=' , this.usdtList)
+					} else {
+						this.usdtList = []
+					}
+				},
+				deep: true
+			}
+		},
 		onLoad() {
 			// console.log('process.env.NODE_ENV = ' , process.env.NODE_ENV)
 			this.getBanner();
@@ -111,10 +132,9 @@
 			// 获取行情 / 首页推荐
 			getQuotationNew() {
 				Api_getQuotationNew().then(res => {
-					this.quotationNew = res;
-					console.log('this.quotationNew = ' , this.quotationNew)
+					this.quotationNew = res || [];
 				}).catch(err => {
-
+					this.quotationNew = [];
 				})
 			}
 		}

+ 22 - 11
pages/index/modules/usdt.vue

@@ -1,11 +1,11 @@
 <template>
 	<view class="usdt-box" :rise-fall="stocksColor">
-		<view  :class="['usdt-item' , index === 1 ? 'rise' : 'fall']"
-			v-for="(item , index ) in list" :key="`usdt_${index}`">
-			<text class="item-title">BTC/USDT</text>
-			<text class="item-nums">28545.1</text>
-			<text class="item-ratio">+0.19%</text>
-			<text class="item-result">=¥196105.45</text>
+		<view :class="['usdt-item' ,$setColor(item.change)]" v-for="(item , index ) in usdtList"
+			:key="`usdt_${index}`">
+			<text class="item-title">{{ item.currency_name }}{{ item.legal_name ? `/${item.legal_name}` : '' }}</text>
+			<text class="item-nums color">{{ item.now_price }}</text>
+			<text class="item-ratio color">{{ item.change }}%</text>
+			<text class="item-result"><text class="iconfont">&#xe623;</text><text class="iconfont">&#xe615;</text>{{ item.volume }}</text>
 		</view>
 	</view>
 </template>
@@ -16,6 +16,14 @@
 	} from 'vuex'
 	export default {
 		name: "usdtModules",
+		props: {
+			usdtList: {
+				type: Array,
+				default: () => {
+					return []
+				}
+			}
+		},
 		data() {
 			return {
 				list: [
@@ -62,7 +70,7 @@
 
 			.item-nums {
 
-				font-size: 38rpx;
+				font-size: 34rpx;
 				line-height: 53rpx;
 				padding-top: 11rpx;
 				letter-spacing: 0.76rpx;
@@ -70,20 +78,23 @@
 
 			.item-ratio {
 
-				font-size: 24rpx;
+				font-size: 22rpx;
 				line-height: 33rpx;
 				padding-top: 7rpx;
 				letter-spacing: 0.44rpx;
 			}
 
 			.item-result {
-
-				font-size: 24rpx;
+				font-size: 20rpx;
 				font-family: PingFang SC, PingFang SC-Regular;
 				font-weight: 400;
 				line-height: 33rpx;
 				color: #808080;
-				letter-spacing: 0.48rpx;
+				display: flex;
+				align-items: center;
+				.iconfont{
+					font-size: 18rpx;
+				}
 			}
 		}
 

+ 1 - 1
pages/login/modules/phone.vue

@@ -40,7 +40,7 @@
 			return {
 				formData: {
 					user_string: '123456',
-					password: '123456'
+					password: 'Aa123456'
 				}
 			};
 		},

+ 46 - 23
static/css/index.scss

@@ -2,33 +2,56 @@
  
 [rise-fall='green_rise']{
 	// 绿涨红跌
-	.rise{ 
-		color: #06c174;
-	}
-	.fall{
-		color: red;
-	}
-	.rise-btn{ 
-		background-color: #06c174;
+	.zhang{
+		// 绿涨
+		.color{
+			color:#06c174
+		}
+		.bgcolor{
+			background-color: #06c174;
+		}
 	}
-	.fall-btn{
-		background-color: red;
+	.die{
+		// 红跌
+		.color{
+			color:red;
+		}
+		.bgcolor{
+			background-color: red;
+		}
 	}
+	
+	// .rise{
+	// 	color: #06c174;
+	// }
+	// .fall{
+	// 	color: red;
+	// }
+	// .rise-btn{ 
+	// 	background-color: #06c174;
+	// }
+	// .fall-btn{
+	// 	background-color: red;
+	// }
  }
-[rise-fall='red_rise']{ 
-// 红涨绿跌
-	.fall{
-		color: #06c174;
-	}
-	.rise{
-		color: red;
-	}
-	// 红涨绿跌
-	.fall-btn{
-		background-color: #06c174;
+[rise-fall='red_rise']{
+	.zhang{
+		// 红涨
+		.color{
+			color:red;
+		}
+		.bgcolor{
+			background-color: red;
+		}
 	}
-	.rise-btn{
-		background-color: red;
+	.die{
+		// 红跌
+		.color{
+			color:#06c174;
+		}
+		.bgcolor{
+			background-color: #06c174;
+		}
 	}
 }
  

+ 3 - 3
static/fontsize/iconfont.css

@@ -1,8 +1,8 @@
 @font-face {
   font-family: 'iconfont';  /* Project id 4023758 */
-  src: url('https://at.alicdn.com/t/c/font_4023758_bx01ckwyoh8.woff2?t=1682473472918') format('woff2'),
-       url('https://at.alicdn.com/t/c/font_4023758_bx01ckwyoh8.woff?t=1682473472918') format('woff'),
-       url('https://at.alicdn.com/t/c/font_4023758_bx01ckwyoh8.ttf?t=1682473472918') format('truetype');
+  src: url('https://at.alicdn.com/t/c/font_4023758_hahc6f973u7.woff2?t=1683194369295') format('woff2'),
+       url('https://at.alicdn.com/t/c/font_4023758_hahc6f973u7.woff?t=1683194369295') format('woff'),
+       url('https://at.alicdn.com/t/c/font_4023758_hahc6f973u7.ttf?t=1683194369295') format('truetype');
 }
 .iconfont {
 	font-family: "iconfont" !important;

+ 2 - 1
store/getters.js

@@ -3,7 +3,8 @@ const getters = {
 	stocksColor: state => state.app.stocksColor,
 	headHeight: state => state.app.headHeight,
 	statusBarHeight: state => state.app.statusBarHeight,
-	
+	windowInfo: state => state.app.windowInfo,
+	PageContentHeight: state => state.app.PageContentHeight,
 	// 资产
 	contractAccount: state => state.possession.contractAccount,
 	bibiAccount: state => state.possession.bibiAccount,

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

@@ -6,7 +6,8 @@
  	token: getToken(),
  	headHeight: '100rpx',
  	statusBarHeight: 0,
-
+	windowInfo:{},
+	PageContentHeight:0,
  	// 涨跌颜色
  	stocksColor: 'green_rise', // green_rise:绿涨红跌 , red_rise:绿跌红涨 
  }
@@ -14,6 +15,15 @@
  const mutations = {
  	SET_statusBarHeight: (state, Height) => {
  		state.statusBarHeight = Height
+ 	},
+	SET_windowInfo: (state, info) => {
+ 		state.windowInfo = info;
+		const headH = state.headHeight.split('rpx')[0];
+		const contentHeight = info.windowHeight - state.statusBarHeight - uni.upx2px(headH);
+ 		state.PageContentHeight = contentHeight;
+		console.log('PageContentHeight ' , contentHeight)
+		
+		
  	},
  	SET_STOCKS_COLOR: (state, code) => {
  		state.stocksColor = code
@@ -21,7 +31,10 @@
  	SET_TOKEN: (state, token) => {
  		setToken(token)
  		state.token = token
- 	}
+ 	},
+	// PageContentHeight: (state, contentHeight) => {
+ // 		state.PageContentHeight = contentHeight
+ // 	},
 
  }
 

+ 2 - 1
uni.scss

@@ -20,7 +20,8 @@ $Theme-Color: #05C175;
 $border-color: rgba(204, 204, 204, 0.2);
 $border-color6: rgba(204, 204, 204, 0.6);
 $border-color4: rgba(204, 204, 204, 0.4);
-$headFixedZIndex:50,
+$headFixedZIndex:50;
+$headTitleHeight: 100rpx;
 
 /* 颜色变量 */
 

+ 18 - 2
utils/common-request.js

@@ -1,5 +1,6 @@
 import {
-	Api_getUserInfo
+	Api_getUserInfo,
+	Api_getQuotationNew
 } from "@/api/index.js"
 
 
@@ -12,4 +13,19 @@ export const Way_getUserInfo = () => {
 			reject()
 		})
 	})
-}
+}
+
+// 获取币种
+export const Way_getBiTypeList = () => {
+	return new Promise((resolve, reject) => {
+		Api_getQuotationNew().then(res => {
+			resolve(res)
+		}).catch(err => {
+			reject()
+		})
+	})
+}
+
+
+
+ 

+ 23 - 1
utils/common.js

@@ -1,5 +1,5 @@
 // import config from "./config"
-// import store from "@/store/index.js"
+import store from "@/store/index.js"
 
 import {
 	Decimal
@@ -42,6 +42,22 @@ export const getStorageSync = (key) => {
 }
 
 
+export const removeStorageSync = (key) => {
+	try {
+		uni.removeStorageSync(key);
+	} catch (e) {
+		// error
+	}
+}
+
+export const refreshAccount = () => {
+	// removeStorageSync(config.tokenKey);
+	store.commit('app/SET_TOKEN' , '')
+	uni.reLaunch({
+		url: '/pages/index/index'
+	});
+}
+
 // 判断是否登录
 export const ifLogin_ = () => {
 	return new Promise((resolve, reject) => {
@@ -114,4 +130,10 @@ export const decimalNum = {
 	// // 除法
 	// let f = new Decimal(a).div(new Decimal(b))
 
+}
+
+
+// 涨跌颜色
+export const setColor = (nums) => {
+	  return nums > 0 ? 'zhang' : 'die'
 }

+ 5 - 4
utils/initialize.js

@@ -1,20 +1,21 @@
 
 import config from "./config.js"
-import { decimalNum , setStorageSync , getStorageSync } from "./common.js"
+import { decimalNum , setStorageSync , getStorageSync , setColor } from "./common.js"
 
 
 // import share from "@/components/headModules/share.vue"
 // import reverseBack from "@/components/headModules/reverse-back.vue"
 
 export default {
-	install(Vue) {
+	install(Vue) {setColor
 		// 挂载全局对象
 		Vue.prototype.$config = config; // 全局配置
 		Vue.prototype.$stocksColorObj = config.stocksColorObj; // 股票颜色
 		Vue.prototype.$decimalNum = decimalNum; // 计算精度
-		Vue.prototype.$setStorageSync = setStorageSync; // 计算精度
-		Vue.prototype.$getStorageSync = getStorageSync; // 计算精度
+		Vue.prototype.$setStorageSync = setStorageSync;  
+		Vue.prototype.$getStorageSync = getStorageSync;  
 
+		Vue.prototype.$setColor = setColor; // 计算精度
 		// Vue.component('share', share)
 		// Vue.component('reverseBack', reverseBack)
 

+ 79 - 0
utils/websock.js

@@ -0,0 +1,79 @@
+
+let websock = $ref(""); //webSocket使用
+let isConnect = $ref(false); //webSocket连接标识 避免重复连接
+let reConnectNum = $ref(1); //断开后重新连接的次数 免得后台挂了,前端一直重连
+const conceal = () => {
+  websockList.value = [];
+};
+
+const websocketonopen = () => {
+  // console.log("WebSocket连接成功");
+  //连接建立后修改标识
+  isConnect = true;
+};
+const websocketonerror = () => {
+  console.log("WebSocket连接发生错误");
+  //连接断开后修改标识
+  isConnect = false;
+  //连接错误 需要重连
+  reConnect();
+};
+const websocketonmessage = (e) => {
+  if (e != null) {
+    // console.log('websocketclose', e)
+    let str = JSON.parse(e.data);
+    // category :  "SYS"
+    // content :  "您有一个通知公告,请查阅!"
+    // createTime :  1670322927873
+    // createUser :  "1543837863788879871"
+    // deleteFlag :  "NOT_DELETE"
+    // id :  "1600076448078106626"
+    // msgType : 1
+    // subject :  "您有一个通知公告,请查阅!"
+    websockList.value = JSON.parse(JSON.stringify(str));
+  }
+};
+
+// webSocket连接关闭
+const websocketclose = () => {
+  //   console.log("webSocket连接关闭");
+  isConnect = false;
+  websock = "";
+  reConnect();
+};
+
+// 尝试重新连接
+const reConnect = () => {
+  if (reConnectNum > 6) {
+    //   console.log("重连超过6次不再重连");
+    return false;
+  }
+  //   console.log("isConnect", isConnect, $store.getters.userId);
+  //如果已经连上就不再重试了
+  if (isConnect && !$store.getters.userId) return;
+  initWebSocket($store.getters.userId);
+  reConnectNum = reConnectNum + 1;
+};
+const initWebSocket = (userId) => {
+  // console.log("进入initWebSocket");
+  // console.log("系统用户ID:" + userId);
+  if (userId != null && userId != "") {
+    // WebSocket与普通的请求所用协议有所不同,ws等同于http,wss等同于https
+
+    const env = import.meta.env.VITE_API_BASEURL.split("://");
+    let wsServer = `${env[0] === "https" ? "wss" : "ws"}://${
+      env[1]
+    }/socket/message/${userId}`;
+    // console.info("location.protocol", wsServer);
+
+    //线上环境
+    //webSocket 前面加一个前缀xxx_websocket_ 区分后面其他项目的webSocket
+    // let wsServer = "wss://域名地址或ip加端口/ nginx配置的  xxx_websocket/" + userId;
+
+    websock = new WebSocket(wsServer);
+    websock.onopen = websocketonopen;
+    websock.onerror = websocketonerror;
+    websock.onmessage = websocketonmessage;
+    websock.onclose = websocketclose;
+  }
+};