Browse Source

feat: 内容id换code

ShangHai_LongXiang
jiannibang 3 years ago
parent
commit
7aecb21070
  1. 2
      package.json
  2. 2
      src/components/ActivitiesList/ActivitiesList.vue
  3. 2
      src/components/PublicComponent/Tabs.vue
  4. 14
      src/views/Index/Index.vue

2
package.json

@ -1,5 +1,5 @@
{
"name": "qm_cli",
"name": "GO",
"version": "0.1.0",
"private": true,
"scripts": {

2
src/components/ActivitiesList/ActivitiesList.vue

@ -1,7 +1,7 @@
<template>
<ScrollView class="scroll" :list="list" :scrollX="isH" :scrollbar="!isH" @click="handleActivity(null)">
<TransitionGroup name="zoom" tag="div" class="scroll-content">
<div :class="['content-item', item === activity ? 'd' : '']" v-for="item of list" :key="item.id">
<div :class="['content-item', item === activity ? 'd' : '']" v-for="item of list" :key="item.entryCode">
<div
class="front"
@click="

2
src/components/PublicComponent/Tabs.vue

@ -1,6 +1,6 @@
<template>
<div class="tabs" v-if="menuList.find(({ routePath }) => routePath === $route.path)">
<div :class="['item', tab.routePath === $route.path ? 'active' : '']" v-for="(tab, i) of menuList" :key="tab.id" @click="goPage(tab)">
<div :class="['item', tab.routePath === $route.path ? 'active' : '']" v-for="(tab, i) of menuList" :key="tab.moduleCode" @click="goPage(tab)">
<div class="icon"><img :src="theme.images[tab.routePath.slice(1)]" /></div>
<div class="title">{{ tab.moduleName }}</div>
<div class="count" v-if="i === 0 && activityCount">{{ activityCount }}</div>

14
src/views/Index/Index.vue

@ -109,7 +109,7 @@
</div>
<div class="menu">
<div class="item" v-for="tab of menuList" :key="tab.id" @click="goMenu(tab)">
<div class="item" v-for="tab of menuList" :key="tab.moduleCode" @click="goMenu(tab)">
<div class="icon"><img :src="theme.images[tab.routePath.slice(1)]" /></div>
<div class="title">{{ tab.moduleName }}</div>
</div>
@ -192,8 +192,8 @@ const goPage = item => router.push(item.path)
const goMenu = item => router.push(item.routePath)
const setShopById = id => {
const shop = shopList.value.find(_shop => _shop.shopCode === id)
const setShopByCode = code => {
const shop = shopList.value.find(_shop => _shop.shopCode === code)
store.SET_SHOP(shop)
}
@ -210,12 +210,12 @@ const clearShop = () => {
store.SET_SHOP(null)
}
const handleRecBrand = id => {
setShopById(id)
const handleRecBrand = code => {
setShopByCode(code)
goPage({ title: '品牌列表', path: '/brand' })
}
const handleFood = id => {
setShopById(id)
const handleFood = code => {
setShopByCode(code)
goPage({ title: '推荐美食', path: '/foods' })
}
</script>

Loading…
Cancel
Save