轮播图圆角修正
This commit is contained in:
parent
376dff48f6
commit
1d17611a8d
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user