Bladeren bron

内容发布红点

xhj 2 jaren geleden
bovenliggende
commit
a8e6dfb383
4 gewijzigde bestanden met toevoegingen van 76 en 3 verwijderingen
  1. 10 1
      pages/found/found.css
  2. 28 1
      pages/found/found.vue
  3. 11 0
      pages/index/index.css
  4. 27 1
      pages/index/index.vue

+ 10 - 1
pages/found/found.css

@@ -51,6 +51,7 @@
 	color: #7A7B7F;
 	display: inline-block;
 	margin-right: 50rpx;
+	position: relative;
 }
 .fx-nav:first-child{
 	margin-left: 30rpx;
@@ -73,7 +74,15 @@
 	border-radius: 5rpx 5rpx 5rpx 5rpx;
 	opacity: 1;
 }
-
+.fx-dot{
+	width: 20rpx;
+	height: 20rpx;
+	border-radius: 100%;
+	background-color: red;
+	position: absolute;
+	right: -6rpx;
+	top: 0;
+}
 .list{padding: 30rpx 30rpx;overflow: hidden;}
 
 

+ 28 - 1
pages/found/found.vue

@@ -17,7 +17,10 @@
 			</view>
 			<view class="map-ac">
 				<scroll-view scroll-x="true" class="map-acs ddflex" style="height: 70rpx;">
-					<view :class="'fx-nav '+(fxIndex==index?'fx-nav-active':'')" v-for="item,index in fxList" @click="changeFxTab(index)">{{item.name}}</view>
+					<view :class="'fx-nav '+(fxIndex==index?'fx-nav-active':'')" v-for="item,index in fxList" @click="changeFxTab(index)">
+						{{item.name}}
+						<view class="fx-dot" v-if="item.addToday>0 && !getReadFindCode()[item.code]"></view>
+					</view>
 				</scroll-view>
 			</view>
 		</view>
@@ -170,7 +173,31 @@
 				this.isLoad = true
 				this.page = 1
 				this.getFxContenteList(this.fxList[this.fxIndex].code)
+				
+				if(this.fxList[this.fxIndex].addToday>0){
+					let s = req.getStorage('readFindCode')
+					let readObj = {
+						date:util.formatTime(new Date()).t2,
+						readCode:(s && s.date == util.formatTime(new Date()).t2)?s.readCode:{}
+					}
+					if(readObj.readCode[this.fxList[this.fxIndex].code]){
+						
+					}else{
+						readObj.readCode[this.fxList[this.fxIndex].code] = true
+					}
+					req.setStorage('readFindCode',readObj)
+				}
 			},
+			
+			getReadFindCode(){
+				let s = req.getStorage('readFindCode')
+				if(s && s.date == util.formatTime(new Date()).t2){
+					return req.getStorage('readFindCode').readCode
+				}else{
+					return {}
+				}
+			},
+			
 			// 获取发现文章列表
 			getFxContenteList() {
 				let that = this;

+ 11 - 0
pages/index/index.css

@@ -727,6 +727,7 @@ page{background: #fff;}
 	color: #7A7B7F;
 	display: inline-block;
 	margin-right: 50rpx;
+	position: relative;
 }
 .fx-nav:last-child{
 	margin-right: 0rpx;
@@ -821,6 +822,16 @@ page{background: #fff;}
 	margin-left: 10rpx;
 }
 
+.fx-dot{
+	width: 20rpx;
+	height: 20rpx;
+	border-radius: 100%;
+	background-color: red;
+	position: absolute;
+	right: -6rpx;
+	top: 0;
+}
+
 .foot-logo{
 	background-color: #F8F8F8;
 }

+ 27 - 1
pages/index/index.vue

@@ -194,7 +194,10 @@
 				<view class="map-ac">
 					<scroll-view scroll-x="true" class="map-acs ddflex" style="height: 70rpx;">
 						<view :class="'fx-nav '+(fxIndex==index?'fx-nav-active':'')" v-for="item,index in fxList"
-							@click="changeFxTab(index)">{{item.name}}</view>
+							@click="changeFxTab(index)">
+							<view class="fx-dot" v-if="item.addToday>0 && !getReadFindCode()[item.code]"></view>
+							{{item.name}}
+						</view>
 					</scroll-view>
 				</view>
 				<view class="fx-bar">
@@ -748,6 +751,29 @@
 				if (this.fxIndex == index) return false;
 				this.fxIndex = index
 				this.getFxContenteList(this.fxList[this.fxIndex].code)
+				
+				
+				if(this.fxList[this.fxIndex].addToday>0){
+					let s = req.getStorage('readFindCode')
+					let readObj = {
+						date:utils.formatTime(new Date()).t2,
+						readCode:(s && s.date == utils.formatTime(new Date()).t2)?s.readCode:{}
+					}
+					if(readObj.readCode[this.fxList[this.fxIndex].code]){
+						
+					}else{
+						readObj.readCode[this.fxList[this.fxIndex].code] = true
+					}
+					req.setStorage('readFindCode',readObj)
+				}
+			},
+			getReadFindCode(){
+				let s = req.getStorage('readFindCode')
+				if(s && s.date == utils.formatTime(new Date()).t2){
+					return req.getStorage('readFindCode').readCode
+				}else{
+					return {}
+				}
 			},
 
 			async getRqeDatas() {