Sfoglia il codice sorgente

内容发布红点

xhj 2 anni fa
parent
commit
f6e9865173
3 ha cambiato i file con 33 aggiunte e 3 eliminazioni
  1. 31 3
      components/nav-bar/index.vue
  2. 1 0
      pages/found/found.vue
  3. 1 0
      pages/index/index.vue

+ 31 - 3
components/nav-bar/index.vue

@@ -4,8 +4,8 @@
 			<view v-for="(item, index) in list" :key="index" class="tab-item" @tap="goUrl(item.click)">
 				<image class="nav_icon11 image" :src="channel===item.channel ?item.selectedIconPath:item.iconPath">
 				</image>
-				<view :class="channel===item.channel?'active':''">{{item.text}}<text class="dots"
-						v-if="count > 0&&item.channel==='cart'">{{count}}</text></view>
+				<view :class="channel===item.channel?'active':''">{{item.text}}<text class="dots" style="width: 20rpx;height: 20rpx;min-width: 20rpx;right: 30%;top: 18rpx;"
+						v-if="count > 0&&item.channel==='found'"></text></view>
 			
 			</view>
 		</view>
@@ -17,6 +17,7 @@
 <script>
 	const app = getApp();
 	const req = require("../../utils/request.js");
+	const utils = require("../../utils/util.js");
 	import foot from "./index";
 
 	export default {
@@ -54,6 +55,11 @@
 				this.getCount();
 			}
 		},
+		created() {
+			uni.$on('updataTab',()=>{
+				this.getCount()
+			})
+		},
 
 		async mounted() {
 			// console.log('ready');
@@ -73,12 +79,34 @@
 				} else {
 					from.purchaseType = 1;
 				}
-
+			
 				// req.getRequest('/api/purchase/count', from, res => {
 				// 	this.setData({
 				// 		count: res
 				// 	});
 				// });
+				
+				req.getRequest('/api/content/category/list', {
+					parentCode: req.public.fxCode
+				}, res => {
+					console.log('sss',res)
+					this.count = 0
+					if(res&&res.length>0){
+						res.map(item=>{
+							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[item.code]){
+								
+							}else{
+								this.count = this.count + item.addToday
+							}
+							console.log(this.count)
+						})
+					}
+				})
 			},
 
 			// 获取tab导航

+ 1 - 0
pages/found/found.vue

@@ -187,6 +187,7 @@
 					}
 					req.setStorage('readFindCode',readObj)
 				}
+				this.isUpdate = !this.isUpdate
 			},
 			
 			getReadFindCode(){

+ 1 - 0
pages/index/index.vue

@@ -766,6 +766,7 @@
 					}
 					req.setStorage('readFindCode',readObj)
 				}
+				this.isUpdate = !this.isUpdate
 			},
 			getReadFindCode(){
 				let s = req.getStorage('readFindCode')