Browse Source

refactor(页面): 优化图片源逻辑并使用Vuex状态管理

将图片源从直接使用`config_new_image`改为优先使用`config_new_image`,若不存在则使用`configList.config_new_image`。同时引入`mapState`从Vuex中获取`configList`,简化状态管理逻辑。
master
前端-胡立永 2 weeks ago
parent
commit
61c510e2de
1 changed files with 5 additions and 3 deletions
  1. +5
    -3
      pages/index/index.vue

+ 5
- 3
pages/index/index.vue View File

@ -39,7 +39,7 @@
<view class="image-box"
@click="$utils.navigateTo('/pages_order/service/newsList')">
<image :src="config_new_image"
<image :src="config_new_image || configList.config_new_image"
class="image" mode="aspectFill"></image>
<view class="image-text">
@ -82,7 +82,11 @@
import PrivacyAgreementPoup from '@/components/config/PrivacyAgreementPoup.vue'
import scenicSpot from '@/components/list/scenicSpot.vue'
import newsItem from '@/components/list/newsItem.vue'
import { mapState } from 'vuex'
export default {
computed: {
...mapState(['configList']),
},
components : {
PrivacyAgreementPoup,
scenicSpot,
@ -169,8 +173,6 @@
this.config_new_image = state.configList.config_new_image
})
},
computed : {
},
onPullDownRefresh(){
this.$refs.videoList.queryVideoList()
this.queryBannerList()


Loading…
Cancel
Save