|
|
@ -24,9 +24,10 @@ |
|
|
|
|
|
|
|
<!-- 发布按钮 --> |
|
|
|
<view class="fab-container"> |
|
|
|
<button class="fab-btn" @click="goToPublish"> |
|
|
|
<image :src="showImg('/uploads/20250824/8a56130faf5787bb75b22b161e66b1b6.png')" style="width: 91rpx;height: 100rpx;"></image> |
|
|
|
<!-- <button class="fab-btn" @click="goToPublish"> |
|
|
|
<text class="fab-icon">+</text> |
|
|
|
</button> |
|
|
|
</button> --> |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- 瀑布流组件 --> |
|
|
@ -77,11 +78,16 @@ export default { |
|
|
|
{ name: "关注", id: "follow" }, |
|
|
|
{ name: "推荐", id: "recommend" }, |
|
|
|
], |
|
|
|
waterfallItems: [], |
|
|
|
waterfallItems: [ |
|
|
|
{title:'生命的扶持|风景之旅',image:'/uploads/20250824/2cf1f49920b911c9d14e4abf3b67a59c.png'}, |
|
|
|
{title:'苏州丨园林之美 鱼戏莲叶间心随鱼鸟闲',image:'/uploads/20250824/c209044a821630158f6e6771805682a7.png'}, |
|
|
|
{title:'蘇州|你一句春不晚,我便出现在真江南',image:'/uploads/20250824/74101a77233375625282209392dc69e3.png'}, |
|
|
|
{title:'收好这天然氧吧',image:'/uploads/20250824/e0ab7fd0483d05742451e8f10ab3ce24.png'}, |
|
|
|
], |
|
|
|
autoAddEnabled: false, |
|
|
|
// 图片URL数组 |
|
|
|
images: [ |
|
|
|
"https://images.unsplash.com/photo-1501854140801-50d01698950b?auto=format&fit=crop&w=800", |
|
|
|
"/uploads/20250824/2cf1f49920b911c9d14e4abf3b67a59c.png", |
|
|
|
"https://images.unsplash.com/photo-1470071459604-3b5ec3a7fe05?auto=format&fit=crop&w=800", |
|
|
|
"https://images.unsplash.com/photo-1441974231531-c6227db76b6e?auto=format&fit=crop&w=800", |
|
|
|
"https://images.unsplash.com/photo-1469474968028-56623f02e42e?auto=format&fit=crop&w=800", |
|
|
@ -142,9 +148,12 @@ export default { |
|
|
|
JSON.parse(uni.getStorageSync("userInfo"))) || |
|
|
|
this.$store.state.user.userInfo || |
|
|
|
{}; |
|
|
|
if (this.userInfo && this.userInfo.token) { |
|
|
|
this.getUserInfo() |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
onShow() { |
|
|
|
if (this.userInfo && this.userInfo.token) { |
|
|
|
this.getUserInfo() |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
@ -161,6 +170,7 @@ export default { |
|
|
|
methods: { |
|
|
|
getUserInfo() { |
|
|
|
this.Post({}, "/framework/user/getInfo", "DES").then((res) => { |
|
|
|
res.data.token = this.userInfo.token |
|
|
|
uni.setStorageSync("userInfo", JSON.stringify(res.data)); |
|
|
|
this.userInfo = res.data |
|
|
|
this.$nextTick(() =>{ |
|
|
@ -203,13 +213,13 @@ export default { |
|
|
|
for (let i = 0; i < 20; i++) { |
|
|
|
initialItems.push(this.getRandomItem()); |
|
|
|
} |
|
|
|
this.waterfallItems = initialItems; |
|
|
|
// this.waterfallItems = initialItems; |
|
|
|
}, |
|
|
|
|
|
|
|
// 添加随机项目 |
|
|
|
addRandomItem() { |
|
|
|
const newItem = this.getRandomItem(); |
|
|
|
this.waterfallItems.push(newItem); |
|
|
|
// this.waterfallItems.push(newItem); |
|
|
|
}, |
|
|
|
|
|
|
|
// 清空所有项目 |
|
|
@ -254,7 +264,7 @@ export default { |
|
|
|
for (let i = 0; i < 10; i++) { |
|
|
|
newItems.push(this.getRandomItem()); |
|
|
|
} |
|
|
|
this.waterfallItems.push(...newItems); |
|
|
|
// this.waterfallItems.push(...newItems); |
|
|
|
}, |
|
|
|
|
|
|
|
// Tab切换方法 |
|
|
|