style: 移除多余样式和属性,优化图片显示模式
- 移除多个组件中不必要的背景色样式 - 在图片预览组件中隐藏索引显示 - 将图片显示模式从 widthFix 改为 aspectFill - 移除视频项中未使用的 duration 属性和相关格式化函数
Showing
4 changed files
with
5 additions
and
14 deletions
| ... | @@ -445,7 +445,7 @@ const handleGoToPointsRule = () => { | ... | @@ -445,7 +445,7 @@ const handleGoToPointsRule = () => { |
| 445 | 445 | ||
| 446 | .points-rule-tip { | 446 | .points-rule-tip { |
| 447 | position: absolute; | 447 | position: absolute; |
| 448 | - background-color: white; | 448 | + // background-color: white; |
| 449 | top: 0rpx; | 449 | top: 0rpx; |
| 450 | right: 0rpx; | 450 | right: 0rpx; |
| 451 | display: flex; | 451 | display: flex; | ... | ... |
| ... | @@ -132,7 +132,7 @@ const handleGoToPointsRule = () => { | ... | @@ -132,7 +132,7 @@ const handleGoToPointsRule = () => { |
| 132 | 132 | ||
| 133 | .points-rule-tip { | 133 | .points-rule-tip { |
| 134 | position: absolute; | 134 | position: absolute; |
| 135 | - background-color: white; | 135 | + // background-color: white; |
| 136 | top: 0rpx; | 136 | top: 0rpx; |
| 137 | right: 0rpx; | 137 | right: 0rpx; |
| 138 | display: flex; | 138 | display: flex; | ... | ... |
| ... | @@ -21,7 +21,7 @@ | ... | @@ -21,7 +21,7 @@ |
| 21 | <image | 21 | <image |
| 22 | :src="item.type === 'video' ? item.thumbnail : item.url" | 22 | :src="item.type === 'video' ? item.thumbnail : item.url" |
| 23 | class="w-full h-full object-cover" | 23 | class="w-full h-full object-cover" |
| 24 | - mode="widthFix" | 24 | + mode="aspectFill" |
| 25 | /> | 25 | /> |
| 26 | 26 | ||
| 27 | <!-- 视频播放标识 --> | 27 | <!-- 视频播放标识 --> |
| ... | @@ -54,6 +54,7 @@ | ... | @@ -54,6 +54,7 @@ |
| 54 | v-model:show="previewVisible" | 54 | v-model:show="previewVisible" |
| 55 | :images="previewImages" | 55 | :images="previewImages" |
| 56 | :init-no="previewIndex" | 56 | :init-no="previewIndex" |
| 57 | + :show-index="false" | ||
| 57 | @close="closePreview" | 58 | @close="closePreview" |
| 58 | /> | 59 | /> |
| 59 | 60 | ||
| ... | @@ -120,7 +121,6 @@ const { | ... | @@ -120,7 +121,6 @@ const { |
| 120 | handleVideoPause, | 121 | handleVideoPause, |
| 121 | handleFullscreenChange, | 122 | handleFullscreenChange, |
| 122 | handleVideoError, | 123 | handleVideoError, |
| 123 | - formatDuration | ||
| 124 | } = useMediaPreview(); | 124 | } = useMediaPreview(); |
| 125 | 125 | ||
| 126 | /** | 126 | /** |
| ... | @@ -162,7 +162,6 @@ const initMockData = () => { | ... | @@ -162,7 +162,6 @@ const initMockData = () => { |
| 162 | type: 'video', | 162 | type: 'video', |
| 163 | url: 'https://vjs.zencdn.net/v/oceans.mp4', | 163 | url: 'https://vjs.zencdn.net/v/oceans.mp4', |
| 164 | thumbnail: 'https://img.yzcdn.cn/vant/apple-4.jpg', | 164 | thumbnail: 'https://img.yzcdn.cn/vant/apple-4.jpg', |
| 165 | - duration: 30, | ||
| 166 | createTime: '2024-01-11 18:30' | 165 | createTime: '2024-01-11 18:30' |
| 167 | }, | 166 | }, |
| 168 | { | 167 | { |
| ... | @@ -174,7 +173,6 @@ const initMockData = () => { | ... | @@ -174,7 +173,6 @@ const initMockData = () => { |
| 174 | type: 'video', | 173 | type: 'video', |
| 175 | url: 'https://vjs.zencdn.net/v/oceans.mp4', | 174 | url: 'https://vjs.zencdn.net/v/oceans.mp4', |
| 176 | thumbnail: 'https://img.yzcdn.cn/vant/leaf.jpg', | 175 | thumbnail: 'https://img.yzcdn.cn/vant/leaf.jpg', |
| 177 | - duration: 60, | ||
| 178 | createTime: '2024-01-09 15:20' | 176 | createTime: '2024-01-09 15:20' |
| 179 | }, | 177 | }, |
| 180 | { | 178 | { |
| ... | @@ -198,13 +196,6 @@ const initMockData = () => { | ... | @@ -198,13 +196,6 @@ const initMockData = () => { |
| 198 | const handleItemClick = (item, index) => { | 196 | const handleItemClick = (item, index) => { |
| 199 | handleMediaClick(item, albumList.value); | 197 | handleMediaClick(item, albumList.value); |
| 200 | }; | 198 | }; |
| 201 | - | ||
| 202 | -/** | ||
| 203 | - * 返回上一页 | ||
| 204 | - */ | ||
| 205 | -const goBack = () => { | ||
| 206 | - Taro.navigateBack(); | ||
| 207 | -}; | ||
| 208 | </script> | 199 | </script> |
| 209 | 200 | ||
| 210 | <style scoped> | 201 | <style scoped> | ... | ... |
| ... | @@ -143,6 +143,7 @@ | ... | @@ -143,6 +143,7 @@ |
| 143 | v-model:show="previewVisible" | 143 | v-model:show="previewVisible" |
| 144 | :images="previewImages" | 144 | :images="previewImages" |
| 145 | :init-no="previewIndex" | 145 | :init-no="previewIndex" |
| 146 | + :show-index="false" | ||
| 146 | @close="closePreview" | 147 | @close="closePreview" |
| 147 | /> | 148 | /> |
| 148 | 149 | ||
| ... | @@ -246,7 +247,6 @@ const albumData = ref([ | ... | @@ -246,7 +247,6 @@ const albumData = ref([ |
| 246 | type: 'video', | 247 | type: 'video', |
| 247 | url: 'https://vjs.zencdn.net/v/oceans.mp4', | 248 | url: 'https://vjs.zencdn.net/v/oceans.mp4', |
| 248 | thumbnail: 'https://cdn.ipadbiz.cn/hager/0513-1_FsxMk28AGz6N_D1zZFFOl_EaRdss.png', | 249 | thumbnail: 'https://cdn.ipadbiz.cn/hager/0513-1_FsxMk28AGz6N_D1zZFFOl_EaRdss.png', |
| 249 | - duration: 125, | ||
| 250 | createTime: '2024-01-14 16:20' | 250 | createTime: '2024-01-14 16:20' |
| 251 | } | 251 | } |
| 252 | ]); | 252 | ]); | ... | ... |
-
Please register or login to post a comment