轮播图圆角修正

This commit is contained in:
WindowBird 2025-08-20 13:57:52 +08:00
parent 376dff48f6
commit 1d17611a8d
3 changed files with 51 additions and 44 deletions

View File

@ -64,8 +64,11 @@ export default {
.swiper {
height: 300rpx;
border-radius: 24rpx;
overflow: hidden;
box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.1);
/* 通用指示器样式 - 覆盖所有可能的类名 */
:deep([class*='swiper-dot']) {
border-radius: 50% !important;
transition: all 0.3s ease !important;

View File

@ -31,7 +31,7 @@
/>
<!-- 底部导航已由系统tabBar处理 -->
</view>
</view>
</template>
<script>
@ -43,14 +43,14 @@ import { getNewAnnouncement } from '../../api/article/article.js'
import { getBannerList } from '../../api/banner/banner.js'
import { getDeviceList } from '../../api/device/device.js'
export default {
export default {
components: {
AnnouncementBar,
BannerSwiper,
EquipmentList,
},
data() {
return {
data() {
return {
//
indicatorDots: true,
autoplay: true,
@ -72,11 +72,11 @@ import { getDeviceList } from '../../api/device/device.js'
//
equipmentList: [],
}
},
}
},
//
onLoad() {
onLoad() {
this.fetchAnnouncement()
this.fetchBannerList()
this.fetchDeviceList()
@ -113,9 +113,9 @@ import { getDeviceList } from '../../api/device/device.js'
id: banner.id,
image: banner.imgUrl,
link: banner.link,
name: `轮播图${banner.id}`
name: `轮播图${banner.id}`,
}))
this.bannerList = sortedBanners
}
} catch (error) {
@ -125,13 +125,13 @@ import { getDeviceList } from '../../api/device/device.js'
{
id: 'default1',
image: commonEnum.TEMP1,
name: '默认轮播图1'
name: '默认轮播图1',
},
{
id: 'default2',
id: 'default2',
image: commonEnum.TEMP2,
name: '默认轮播图2'
}
name: '默认轮播图2',
},
]
}
},
@ -157,7 +157,7 @@ import { getDeviceList } from '../../api/device/device.js'
// onlineState线
const isOnline = device.onlineState === '1'
return {
id: device.id,
name: device.newTypeName || device.typeName || '未知设备',
@ -169,10 +169,10 @@ import { getDeviceList } from '../../api/device/device.js'
sn: device.sn,
isOnline: isOnline,
powerStatus: device.powerStatus,
iotExpireTime: device.iotExpireTime
iotExpireTime: device.iotExpireTime,
}
})
this.equipmentList = devices
}
} catch (error) {
@ -186,7 +186,7 @@ import { getDeviceList } from '../../api/device/device.js'
startTime: '2025-07-25 13:23:59',
endTime: '2026-07-25 13:23:59',
image: commonEnum.TEMP2,
isOnline: true
isOnline: true,
},
{
id: 'default2',
@ -195,8 +195,8 @@ import { getDeviceList } from '../../api/device/device.js'
startTime: '2025-07-25 13:23:59',
endTime: '2026-07-25 13:23:59',
image: commonEnum.TEMP3,
isOnline: true
}
isOnline: true,
},
]
}
},
@ -215,11 +215,11 @@ import { getDeviceList } from '../../api/device/device.js'
//
uni.showModal({
title: this.currentAnnouncement.title || '公告详情',
content: this.currentAnnouncement.content ?
this.currentAnnouncement.content.replace(/<[^>]*>/g, '') :
'暂无公告内容',
content: this.currentAnnouncement.content
? this.currentAnnouncement.content.replace(/<[^>]*>/g, '')
: '暂无公告内容',
showCancel: false,
confirmText: '知道了'
confirmText: '知道了',
})
} else {
uni.showToast({
@ -239,16 +239,16 @@ import { getDeviceList } from '../../api/device/device.js'
if (item.link) {
//
uni.navigateTo({
url: item.link
url: item.link,
})
}
}
},
//
onEquipmentClick(equipment) {
//
uni.navigateTo({
url: `/pages/device-detail/device-detail?id=${equipment.id}&name=${encodeURIComponent(equipment.name)}`
url: `/pages/device-detail/device-detail?id=${equipment.id}&name=${encodeURIComponent(equipment.name)}`,
})
},
@ -256,7 +256,7 @@ import { getDeviceList } from '../../api/device/device.js'
onRenew(equipment) {
//
uni.navigateTo({
url: `/pages/renew/renew?id=${equipment.id}&name=${encodeURIComponent(equipment.name)}&endTime=${encodeURIComponent(equipment.endTime)}`
url: `/pages/renew/renew?id=${equipment.id}&name=${encodeURIComponent(equipment.name)}&endTime=${encodeURIComponent(equipment.endTime)}`,
})
},
@ -270,7 +270,7 @@ import { getDeviceList } from '../../api/device/device.js'
})
},
},
}
}
</script>
<style lang="scss" scoped>
@ -280,5 +280,5 @@ import { getDeviceList } from '../../api/device/device.js'
max-width: 750rpx;
margin: 0 auto;
z-index: -2;
}
}
</style>

View File

@ -19,9 +19,9 @@
class="avatar-image"
mode="aspectFill"
/>
<text v-else class="avatar-text">{{
userInfo.nickName ? userInfo.nickName.charAt(0) : '昵'
}}</text>
<text v-else class="avatar-text"
>{{ userInfo.nickName ? userInfo.nickName.charAt(0) : '昵' }}
</text>
</view>
<view class="user-info">
<view class="share-btn" @click="goToSharePromotion">
@ -166,7 +166,7 @@ export default {
//
uni.$on('userInfoUpdated', this.handleUserInfoUpdate)
},
beforeDestroy() {
beforeUnmount() {
//
uni.$off('userInfoUpdated', this.handleUserInfoUpdate)
},
@ -295,29 +295,29 @@ export default {
gotoPage(url) {
uni.navigateTo({ url })
},
//
goToSettings() {
console.log('准备跳转到设置页面,当前用户信息:', this.userInfo)
// 使
try {
const userInfoToStore = {
nickName: this.userInfo.nickName || this.userInfo.nickname || '昵称',
avatar: this.userInfo.avatar || '',
userId: this.userInfo.userId || '',
phonenumber: this.userInfo.phonenumber || ''
phonenumber: this.userInfo.phonenumber || '',
}
uni.setStorageSync('userInfo', userInfoToStore)
console.log('用户信息已存储到本地:', userInfoToStore)
} catch (error) {
console.error('存储用户信息失败:', error)
}
//
uni.navigateTo({
url: '/pages/set/set'
url: '/pages/set/set',
})
},
goToAgentApply() {
@ -357,22 +357,22 @@ export default {
url: '/pages/agents/requestAgent',
})
},
//
handleUserInfoUpdate(updatedUserInfo) {
//
this.userInfo = {
...this.userInfo,
...updatedUserInfo
...updatedUserInfo,
}
//
try {
uni.setStorageSync('userInfo', this.userInfo)
} catch (error) {
console.error('更新本地用户信息失败:', error)
}
console.log('用户信息已更新:', this.userInfo)
},
},
@ -734,4 +734,8 @@ export default {
}
}
}
//view {
// border: red solid 1px;
//}
</style>