轮播图圆角修正
This commit is contained in:
parent
376dff48f6
commit
1d17611a8d
|
|
@ -64,8 +64,11 @@ export default {
|
||||||
|
|
||||||
.swiper {
|
.swiper {
|
||||||
height: 300rpx;
|
height: 300rpx;
|
||||||
|
border-radius: 24rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.1);
|
||||||
|
|
||||||
/* 通用指示器样式 - 覆盖所有可能的类名 */
|
/* 通用指示器样式 - 覆盖所有可能的类名 */
|
||||||
|
|
||||||
:deep([class*='swiper-dot']) {
|
:deep([class*='swiper-dot']) {
|
||||||
border-radius: 50% !important;
|
border-radius: 50% !important;
|
||||||
transition: all 0.3s ease !important;
|
transition: all 0.3s ease !important;
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- 底部导航已由系统tabBar处理 -->
|
<!-- 底部导航已由系统tabBar处理 -->
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
@ -43,14 +43,14 @@ import { getNewAnnouncement } from '../../api/article/article.js'
|
||||||
import { getBannerList } from '../../api/banner/banner.js'
|
import { getBannerList } from '../../api/banner/banner.js'
|
||||||
import { getDeviceList } from '../../api/device/device.js'
|
import { getDeviceList } from '../../api/device/device.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
AnnouncementBar,
|
AnnouncementBar,
|
||||||
BannerSwiper,
|
BannerSwiper,
|
||||||
EquipmentList,
|
EquipmentList,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// 基础配置
|
// 基础配置
|
||||||
indicatorDots: true,
|
indicatorDots: true,
|
||||||
autoplay: true,
|
autoplay: true,
|
||||||
|
|
@ -72,11 +72,11 @@ import { getDeviceList } from '../../api/device/device.js'
|
||||||
|
|
||||||
// 设备列表数据
|
// 设备列表数据
|
||||||
equipmentList: [],
|
equipmentList: [],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// 生命周期钩子
|
// 生命周期钩子
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this.fetchAnnouncement()
|
this.fetchAnnouncement()
|
||||||
this.fetchBannerList()
|
this.fetchBannerList()
|
||||||
this.fetchDeviceList()
|
this.fetchDeviceList()
|
||||||
|
|
@ -113,9 +113,9 @@ import { getDeviceList } from '../../api/device/device.js'
|
||||||
id: banner.id,
|
id: banner.id,
|
||||||
image: banner.imgUrl,
|
image: banner.imgUrl,
|
||||||
link: banner.link,
|
link: banner.link,
|
||||||
name: `轮播图${banner.id}`
|
name: `轮播图${banner.id}`,
|
||||||
}))
|
}))
|
||||||
|
|
||||||
this.bannerList = sortedBanners
|
this.bannerList = sortedBanners
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
@ -125,13 +125,13 @@ import { getDeviceList } from '../../api/device/device.js'
|
||||||
{
|
{
|
||||||
id: 'default1',
|
id: 'default1',
|
||||||
image: commonEnum.TEMP1,
|
image: commonEnum.TEMP1,
|
||||||
name: '默认轮播图1'
|
name: '默认轮播图1',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'default2',
|
id: 'default2',
|
||||||
image: commonEnum.TEMP2,
|
image: commonEnum.TEMP2,
|
||||||
name: '默认轮播图2'
|
name: '默认轮播图2',
|
||||||
}
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -157,7 +157,7 @@ import { getDeviceList } from '../../api/device/device.js'
|
||||||
|
|
||||||
// 根据onlineState判断在线状态
|
// 根据onlineState判断在线状态
|
||||||
const isOnline = device.onlineState === '1'
|
const isOnline = device.onlineState === '1'
|
||||||
|
|
||||||
return {
|
return {
|
||||||
id: device.id,
|
id: device.id,
|
||||||
name: device.newTypeName || device.typeName || '未知设备',
|
name: device.newTypeName || device.typeName || '未知设备',
|
||||||
|
|
@ -169,10 +169,10 @@ import { getDeviceList } from '../../api/device/device.js'
|
||||||
sn: device.sn,
|
sn: device.sn,
|
||||||
isOnline: isOnline,
|
isOnline: isOnline,
|
||||||
powerStatus: device.powerStatus,
|
powerStatus: device.powerStatus,
|
||||||
iotExpireTime: device.iotExpireTime
|
iotExpireTime: device.iotExpireTime,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
this.equipmentList = devices
|
this.equipmentList = devices
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
@ -186,7 +186,7 @@ import { getDeviceList } from '../../api/device/device.js'
|
||||||
startTime: '2025-07-25 13:23:59',
|
startTime: '2025-07-25 13:23:59',
|
||||||
endTime: '2026-07-25 13:23:59',
|
endTime: '2026-07-25 13:23:59',
|
||||||
image: commonEnum.TEMP2,
|
image: commonEnum.TEMP2,
|
||||||
isOnline: true
|
isOnline: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'default2',
|
id: 'default2',
|
||||||
|
|
@ -195,8 +195,8 @@ import { getDeviceList } from '../../api/device/device.js'
|
||||||
startTime: '2025-07-25 13:23:59',
|
startTime: '2025-07-25 13:23:59',
|
||||||
endTime: '2026-07-25 13:23:59',
|
endTime: '2026-07-25 13:23:59',
|
||||||
image: commonEnum.TEMP3,
|
image: commonEnum.TEMP3,
|
||||||
isOnline: true
|
isOnline: true,
|
||||||
}
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -215,11 +215,11 @@ import { getDeviceList } from '../../api/device/device.js'
|
||||||
// 显示公告详情
|
// 显示公告详情
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: this.currentAnnouncement.title || '公告详情',
|
title: this.currentAnnouncement.title || '公告详情',
|
||||||
content: this.currentAnnouncement.content ?
|
content: this.currentAnnouncement.content
|
||||||
this.currentAnnouncement.content.replace(/<[^>]*>/g, '') :
|
? this.currentAnnouncement.content.replace(/<[^>]*>/g, '')
|
||||||
'暂无公告内容',
|
: '暂无公告内容',
|
||||||
showCancel: false,
|
showCancel: false,
|
||||||
confirmText: '知道了'
|
confirmText: '知道了',
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
|
|
@ -239,16 +239,16 @@ import { getDeviceList } from '../../api/device/device.js'
|
||||||
if (item.link) {
|
if (item.link) {
|
||||||
// 如果有链接,跳转到对应页面
|
// 如果有链接,跳转到对应页面
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: item.link
|
url: item.link,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// 设备点击事件
|
// 设备点击事件
|
||||||
onEquipmentClick(equipment) {
|
onEquipmentClick(equipment) {
|
||||||
// 跳转到设备详情页面,传递设备信息
|
// 跳转到设备详情页面,传递设备信息
|
||||||
uni.navigateTo({
|
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) {
|
onRenew(equipment) {
|
||||||
// 跳转到续费页面,传递设备信息
|
// 跳转到续费页面,传递设备信息
|
||||||
uni.navigateTo({
|
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>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
@ -280,5 +280,5 @@ import { getDeviceList } from '../../api/device/device.js'
|
||||||
max-width: 750rpx;
|
max-width: 750rpx;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
z-index: -2;
|
z-index: -2;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -19,9 +19,9 @@
|
||||||
class="avatar-image"
|
class="avatar-image"
|
||||||
mode="aspectFill"
|
mode="aspectFill"
|
||||||
/>
|
/>
|
||||||
<text v-else class="avatar-text">{{
|
<text v-else class="avatar-text"
|
||||||
userInfo.nickName ? userInfo.nickName.charAt(0) : '昵'
|
>{{ userInfo.nickName ? userInfo.nickName.charAt(0) : '昵' }}
|
||||||
}}</text>
|
</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="user-info">
|
<view class="user-info">
|
||||||
<view class="share-btn" @click="goToSharePromotion">
|
<view class="share-btn" @click="goToSharePromotion">
|
||||||
|
|
@ -166,7 +166,7 @@ export default {
|
||||||
// 监听用户信息更新事件
|
// 监听用户信息更新事件
|
||||||
uni.$on('userInfoUpdated', this.handleUserInfoUpdate)
|
uni.$on('userInfoUpdated', this.handleUserInfoUpdate)
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeUnmount() {
|
||||||
// 移除事件监听
|
// 移除事件监听
|
||||||
uni.$off('userInfoUpdated', this.handleUserInfoUpdate)
|
uni.$off('userInfoUpdated', this.handleUserInfoUpdate)
|
||||||
},
|
},
|
||||||
|
|
@ -295,29 +295,29 @@ export default {
|
||||||
gotoPage(url) {
|
gotoPage(url) {
|
||||||
uni.navigateTo({ url })
|
uni.navigateTo({ url })
|
||||||
},
|
},
|
||||||
|
|
||||||
// 跳转到设置页面,传递用户信息
|
// 跳转到设置页面,传递用户信息
|
||||||
goToSettings() {
|
goToSettings() {
|
||||||
console.log('准备跳转到设置页面,当前用户信息:', this.userInfo)
|
console.log('准备跳转到设置页面,当前用户信息:', this.userInfo)
|
||||||
|
|
||||||
// 将当前用户信息存储到本地,供设置页面使用
|
// 将当前用户信息存储到本地,供设置页面使用
|
||||||
try {
|
try {
|
||||||
const userInfoToStore = {
|
const userInfoToStore = {
|
||||||
nickName: this.userInfo.nickName || this.userInfo.nickname || '昵称',
|
nickName: this.userInfo.nickName || this.userInfo.nickname || '昵称',
|
||||||
avatar: this.userInfo.avatar || '',
|
avatar: this.userInfo.avatar || '',
|
||||||
userId: this.userInfo.userId || '',
|
userId: this.userInfo.userId || '',
|
||||||
phonenumber: this.userInfo.phonenumber || ''
|
phonenumber: this.userInfo.phonenumber || '',
|
||||||
}
|
}
|
||||||
|
|
||||||
uni.setStorageSync('userInfo', userInfoToStore)
|
uni.setStorageSync('userInfo', userInfoToStore)
|
||||||
console.log('用户信息已存储到本地:', userInfoToStore)
|
console.log('用户信息已存储到本地:', userInfoToStore)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('存储用户信息失败:', error)
|
console.error('存储用户信息失败:', error)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 跳转到设置页面
|
// 跳转到设置页面
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/set/set'
|
url: '/pages/set/set',
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
goToAgentApply() {
|
goToAgentApply() {
|
||||||
|
|
@ -357,22 +357,22 @@ export default {
|
||||||
url: '/pages/agents/requestAgent',
|
url: '/pages/agents/requestAgent',
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
// 处理用户信息更新事件
|
// 处理用户信息更新事件
|
||||||
handleUserInfoUpdate(updatedUserInfo) {
|
handleUserInfoUpdate(updatedUserInfo) {
|
||||||
// 更新本地用户信息
|
// 更新本地用户信息
|
||||||
this.userInfo = {
|
this.userInfo = {
|
||||||
...this.userInfo,
|
...this.userInfo,
|
||||||
...updatedUserInfo
|
...updatedUserInfo,
|
||||||
}
|
}
|
||||||
|
|
||||||
// 更新本地存储
|
// 更新本地存储
|
||||||
try {
|
try {
|
||||||
uni.setStorageSync('userInfo', this.userInfo)
|
uni.setStorageSync('userInfo', this.userInfo)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('更新本地用户信息失败:', error)
|
console.error('更新本地用户信息失败:', error)
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('用户信息已更新:', this.userInfo)
|
console.log('用户信息已更新:', this.userInfo)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -734,4 +734,8 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//view {
|
||||||
|
// border: red solid 1px;
|
||||||
|
//}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user