Browse Source

feat: 移除sourceUrl

ShangHai_LongXiang
jiannibang 3 years ago
parent
commit
e35b7b34a2
  1. 2
      src/base/ShopItem/ShopItem.vue
  2. 8
      src/components/ActivitiesList/ActivitiesList.vue
  3. 8
      src/components/CarouselWithIntro/CarouselWithIntro.vue
  4. 2
      src/components/SearchResultItem/SearchResultItem.vue
  5. 2
      src/composables/useInitConfigAndMallInfo.js
  6. 16
      src/http/api.js
  7. 7
      src/http/brand/api.js
  8. 2
      src/http/config.js
  9. 6
      src/views/Index/Index.vue

2
src/base/ShopItem/ShopItem.vue

@ -1,7 +1,7 @@
<template>
<div :id="shop.houseNumber" class="group-item" :class="{ isRow, isFood, isGuide, isActive }" @click="handleShop">
<div class="logo-wrapper" :class="{ hasFood: isFood && shop.foodMaterialList.length }">
<img loading="lazy" :src="config.sourceUrl + (isFood && shop.foodMaterialList.length ? shop.foodMaterialList[0] : shop.logoUrl)" alt="" class="shop-logo" />
<img loading="lazy" :src="'./static/offline' + (isFood && shop.foodMaterialList.length ? shop.foodMaterialList[0] : shop.logoUrl)" alt="" class="shop-logo" />
</div>
<p class="name">
<span class="shop-name">{{ switchLanguage(shop, 'shopName') }}</span>

8
src/components/ActivitiesList/ActivitiesList.vue

@ -11,7 +11,7 @@
}
"
>
<img :src="config.sourceUrl + item.content.pic[0]" alt="" />
<img :src="'./static/offline' + item.content.pic[0]" alt="" />
<div class="tr">{{ item.content.startDate }} - {{ item.content.endDate }}</div>
<div class="bottom">
<div class="left">{{ item.content.name }}</div>
@ -26,7 +26,7 @@
{{ item.content.desc }}
</div>
<div class="qrcodeWrapper">
<ThumbQRCode class="item" v-for="item of item.content.qrcode" :url="config.sourceUrl + item" :title="''" :key="item" />
<ThumbQRCode class="item" v-for="item of item.content.qrcode" :url="'./static/offline' + item" :title="''" :key="item" />
</div>
</div>
</ScrollView>
@ -38,8 +38,6 @@
<script setup>
import { ref } from 'vue'
import { storeToRefs } from 'pinia'
import { useStore } from '@/store/root'
import ScrollView from '@/base/ScrollView/ScrollView.vue'
import 'swiper/css'
import 'swiper/css/pagination'
@ -59,8 +57,6 @@ const activity = ref(null)
function handleActivity(item) {
activity.value = item
}
const store = useStore()
const { config } = storeToRefs(store)
</script>
<style lang="scss" scoped>

8
src/components/CarouselWithIntro/CarouselWithIntro.vue

@ -4,7 +4,7 @@
<EffectFade :list="data?.pics ?? []">
<template v-slot="{ item }">
<div class="banner-wrapper">
<img class="banner" :src="config.sourceUrl + item" alt="" />
<img class="banner" :src="'./static/offline' + item" alt="" />
</div>
</template>
</EffectFade>
@ -17,7 +17,7 @@
</p>
</ScrollView>
<div class="qrcodeWrapper">
<ThumbQRCode class="item" v-for="item of qr" :url="config.sourceUrl + item" :title="''" :key="item" />
<ThumbQRCode class="item" v-for="item of qr" :url="'./static/offline' + item" :title="''" :key="item" />
</div>
</div>
</div>
@ -25,8 +25,6 @@
<script setup>
import { computed } from 'vue'
import { storeToRefs } from 'pinia'
import { useStore } from '@/store/root'
import EffectFade from '@/components/EffectFade/EffectFade.vue'
import ScrollView from '@/base/ScrollView/ScrollView.vue'
import ThumbQRCode from '@/base/ThumbQRCode/ThumbQRCode.vue'
@ -35,8 +33,6 @@ const props = defineProps({
data: Object
})
const store = useStore()
const { config } = storeToRefs(store)
const qr = computed(() => props.data.qrcode ?? [])
</script>

2
src/components/SearchResultItem/SearchResultItem.vue

@ -1,7 +1,7 @@
<template>
<div class="item" @click="handleShop">
<div class="icon-wrapper">
<img :src="config.sourceUrl + shop.logoUrl" class="icon" alt="" />
<img :src="'./static/offline' + shop.logoUrl" class="icon" alt="" />
</div>
<div class="item-bottom">
<div class="left">{{ switchLanguage(shop, 'shopName') }}</div>

2
src/composables/useInitConfigAndMallInfo.js

@ -14,7 +14,7 @@ export const useInitConfigAndMallInfo = async () => {
Object.entries(obj).forEach(([k, v]) => r.style.setProperty(`--${cat}-${k}`, v))
})
theme.images = Object.entries(theme.image)
.map(([k, v]) => [k, _config.data.sourceUrl + v])
.map(([k, v]) => [k, './static/offline' + v])
.reduce((acc, [k, v]) => ({ ...acc, [k]: v }), {})
store.SET_THEME(theme)
}

16
src/http/api.js

@ -5,27 +5,27 @@ import { url } from '@/http/config'
export const getTheme = () => get(`./static/offline/JSON/theme.json`)
//首页热搜及卡片
export const getIndexList = () => get(`${url().sourceUrl}/JSON/index.json`)
export const getIndexList = () => get(`./static/offline/JSON/index.json`)
export const getActivityList = () => get(`${url().sourceUrl}/JSON/actvities.json`)
export const getActivityList = () => get(`./static/offline/JSON/actvities.json`)
//获取会员权益
export const getMemberBenefits = () => get(`${url().sourceUrl}/JSON/member.json`)
export const getMemberBenefits = () => get(`./static/offline/JSON/member.json`)
//获取停车场数据
export const getParkingList = () => get(`${url().sourceUrl}/JSON/parking.json`)
export const getParkingList = () => get(`./static/offline/JSON/parking.json`)
//获取 影院信息
export const getCinemaInfo = () => get(`${url().sourceUrl}/JSON/getCinemaInfo.json`)
export const getCinemaInfo = () => get(`./static/offline/JSON/getCinemaInfo.json`)
//获取商场介绍
export const getMallInfoList = () => get(`${url().sourceUrl}/JSON/mall.json`)
export const getMallInfoList = () => get(`./static/offline/JSON/mall.json`)
//获取跳转时间
export const getBackTime = () => get(`${url().sourceUrl}/JSON/getBackTime.json`)
export const getBackTime = () => get(`./static/offline/JSON/getBackTime.json`)
//获取地图导览数据
export const getGuideList = () => get(`${url().sourceUrl}/JSON/getMapInfo.json`)
export const getGuideList = () => get(`./static/offline/JSON/getMapInfo.json`)
//获取配置项
export const getConfig = () => get('./static/offline/JSON/config.json')

7
src/http/brand/api.js

@ -1,11 +1,10 @@
import { get } from '@/http/http'
import { url } from '@/http/config'
//获取品牌数据
export const getBrandList = () => get(`${url().sourceUrl}/JSON/getBrandShopList.json`)
export const getBrandList = () => get(`./static/offline/JSON/getBrandShopList.json`)
// //获取品牌模块通过业态排序的品牌列表
export const getBrandListByFormat = () => get(`${url().sourceUrl}/JSON/getBrandShopListByIndustryId.json`)
export const getBrandListByFormat = () => get(`./static/offline/JSON/getBrandShopListByIndustryId.json`)
// //获取品牌模块通过楼层排序的品牌列表
export const getBrandListByFloor = () => get(`${url().sourceUrl}/JSON/getBrandShopListByFloor.json`)
export const getBrandListByFloor = () => get(`./static/offline/JSON/getBrandShopListByFloor.json`)

2
src/http/config.js

@ -13,7 +13,7 @@ export const ERR_DISCERNING = '201' //语音识别中
export function url() {
const store = useStore()
const interfaceUrl = store.config.interfaceUrl
const sourceUrl = store.config.sourceUrl
const sourceUrl = './static/offline'
const handWriteUrl = store.config.handWriteUrl
const clickUploadUrl = store.config.clickUploadUrl
return { interfaceUrl, sourceUrl, handWriteUrl, clickUploadUrl }

6
src/views/Index/Index.vue

@ -65,7 +65,7 @@
>
<SwiperSlide class="brandSlide" v-for="(list, i) of foodList" :key="i">
<div class="grid">
<img class="item" v-for="shop of list" :key="shop.shopCode" :src="config.sourceUrl + shop.logoUrl" alt="" @click="handleFood(shop.shopCode)" />
<img class="item" v-for="shop of list" :key="shop.shopCode" :src="'./static/offline' + shop.logoUrl" alt="" @click="handleFood(shop.shopCode)" />
</div>
</SwiperSlide>
</Swiper>
@ -102,7 +102,7 @@
>
<SwiperSlide class="brandSlide" v-for="(list, i) of recommendShops" :key="i">
<div class="grid">
<img class="item" v-for="shop of list" :key="shop.shopCode" :src="config.sourceUrl + shop.logoUrl" alt="" @click="handleRecBrand(shop.shopCode)" />
<img class="item" v-for="shop of list" :key="shop.shopCode" :src="'./static/offline' + shop.logoUrl" alt="" @click="handleRecBrand(shop.shopCode)" />
</div>
</SwiperSlide>
</Swiper>
@ -118,7 +118,7 @@
<EffectFade :list="ads ?? []">
<template v-slot="{ item }">
<div class="banner-wrapper">
<img class="banner" :src="config.sourceUrl + item.content.pic[0]" alt="" />
<img class="banner" :src="'./static/offline' + item.content.pic[0]" alt="" />
<div class="name">{{ item.content.name }}</div>
</div>
</template>

Loading…
Cancel
Save