diff --git a/api/apiT.js b/api/apiT.js index 48a36e4..90bfbde 100644 --- a/api/apiT.js +++ b/api/apiT.js @@ -1,6 +1,6 @@ // const baseUrl = "https://api.collect.hs.hnzhwlkj.club/"; //这里放置url域名32044 // const baseUrl = "https://api.collect.xyh.muzili.top/"; //这里放置url域名32044 -const baseUrl = "https://cb.hnxinyouhe.com/"; //这里放置url域名32044 +const baseUrl = "https://bsh.info.yw.hnzhwlkj.cn/"; //这里放置url域名32044 // const baseUrl = "https://114.215.24.240:8106/api/v1/"; //这里放置url域名32044 export function request(options){//封装的requset let { url,data,method } = options; diff --git a/components/PostCard.vue b/components/PostCard.vue index b3d0818..87ecc53 100644 --- a/components/PostCard.vue +++ b/components/PostCard.vue @@ -16,7 +16,7 @@ - + @@ -190,12 +190,13 @@ export default { color: #3BC6BD; } .chat-btn2{ - background: rgb(255 0 0 / 20%); - color: #fff; - } - .chat-btn3{ background: rgb(62 94 215 / 20%); color: #3E5ED7; + + } + .chat-btn3{ + background: rgb(255 0 0 / 20%); + color: #FF0000; } .chat-btn4{ background: rgb(105 105 105 / 20%); diff --git a/components/danmu/danmu.vue b/components/danmu/danmu.vue index decd03e..32114ba 100644 --- a/components/danmu/danmu.vue +++ b/components/danmu/danmu.vue @@ -9,6 +9,7 @@ animationDuration: item.speed + 's', color: item.color }" + @animationend="finishDanmu(item.id, item.lane)" > {{ item.text }} @@ -26,7 +27,8 @@ export default { data() { return { danmuItems: [], - laneBusy: [] // 轨道是否被占用 + laneBusy: [], // 轨道是否被占用 + pendingQueue: [] // 等待队列 } }, @@ -39,30 +41,35 @@ export default { startDanmu() { let index = 0 setInterval(() => { - const text = this.list[index].content - this.createDanmu(text) - index = (index + 1) % this.list.length - }, 1500) + if (this.list && this.list.length > 0) { + const text = this.list[index].content + this.createDanmu(text) + index = (index + 1) % this.list.length + } + }, 2200) }, createDanmu(text) { const lane = this.getFreeLane() + + // 如果没有空闲轨道,加入等待队列 + if (lane === -1) { + this.pendingQueue.push(text) + return + } + const id = Date.now() + Math.random() const item = { id, text, - top: lane * 100, // 每条轨道高度 60rpx - speed: 6 + Math.random()*2, + top: lane * 80 + 20, // 每条轨道高度 80rpx,顶部留20rpx间距 + speed: 14 + Math.random()*6, color: this.randomColor(), lane } this.danmuItems.push(item) - - setTimeout(() => { - this.finishDanmu(id, lane) - }, item.speed * 1000) }, getFreeLane() { @@ -73,15 +80,26 @@ export default { return i } } - // 如果都满了,就随机一个 - return Math.floor(Math.random() * this.row) + // 如果都满了,返回-1,不创建弹幕 + return -1 }, finishDanmu(id, lane) { + // 移除弹幕项 this.danmuItems = this.danmuItems.filter(i => i.id !== id) - - // 整个动画跑完后释放轨道 - this.laneBusy[lane] = false + + // 释放轨道 + if (lane !== undefined && lane >= 0) { + this.laneBusy[lane] = false + + // 检查等待队列,如果有等待的弹幕,立即创建 + if (this.pendingQueue.length > 0) { + const text = this.pendingQueue.shift() + this.$nextTick(() => { + this.createDanmu(text) + }) + } + } }, randomColor() { @@ -96,7 +114,7 @@ export default { .danmu-container { position: absolute; left: 0; - top: 88rpx; + top: 450rpx; width: 100%; height: 600rpx; overflow: hidden; @@ -115,10 +133,14 @@ export default { background: rgb(0 0 0 / 60%); padding: 5px 14px; border-radius: 20px; + line-height: 1.5; + max-width: 600rpx; + overflow: hidden; + text-overflow: ellipsis; } @keyframes danmu-move { from { transform: translateX(0); } - to { transform: translateX(-1200rpx); } + to { transform: translateX(-150vw); } } diff --git a/manifest.json b/manifest.json index 2fc96ee..ae60d49 100644 --- a/manifest.json +++ b/manifest.json @@ -94,22 +94,18 @@ "versionCode" : 100 }, "mp-weixin" : { - "appid" : "wx2f5476b2243ae858", + "appid" : "wx62c3f16d37f2c2a2", "setting" : { "urlCheck" : false, "minified" : true, "postcss" : true }, - "permission": { - "scope.userFuzzyLocation": { - "desc": "用于为你推荐附近内容/门店" - } - }, - "requiredPrivateInfos": [ - "getFuzzyLocation", - "chooseLocation", - "chooseAddress" - ], + "permission" : { + "scope.userFuzzyLocation" : { + "desc" : "用于为你推荐附近内容/门店" + } + }, + "requiredPrivateInfos" : [ "getFuzzyLocation", "chooseLocation", "chooseAddress" ], "usingComponents" : true, "uniStatistics" : { "enable" : true diff --git a/pages.json b/pages.json index 632719d..5e3334c 100644 --- a/pages.json +++ b/pages.json @@ -182,18 +182,18 @@ "selectedIconPath": "/static/image/classify.png", "text": "分类" }, - { - "pagePath": "pages/publish/index", - "iconPath": "/static/image/publish1.png", - "selectedIconPath": "/static/image/publish.png", - "text": "发布" - }, { "pagePath": "pages/square/index", "iconPath": "/static/image/square1.png", "selectedIconPath": "/static/image/square.png", "text": "广场" }, + { + "pagePath": "pages/publish/index", + "iconPath": "/static/image/publish1.png", + "selectedIconPath": "/static/image/publish.png", + "text": "发布" + }, { "pagePath": "pages/index/mine", "iconPath": "/static/image/mine1.png", diff --git a/pages/classify/classify.vue b/pages/classify/classify.vue index f7b2513..7b879be 100644 --- a/pages/classify/classify.vue +++ b/pages/classify/classify.vue @@ -1,7 +1,10 @@