任一存 1 год назад
Родитель
Сommit
e2fd533f23

+ 1 - 1
README.md

@@ -24,4 +24,4 @@ https://app.4dage.com/projects/wxcs/web/index.html?platform=h5&name={userName}&s
 * 1: 慈善堂
 * 2: 慈善广场
 * 3: 爱心林场 (需要登录)
-* 锡善之城:还在等通知
+* 4: 人物设置

+ 49 - 1
src/App.vue

@@ -30,6 +30,9 @@
           :class="{
             active: $route.meta.tabIdx === 2
           }"
+          @click="$router.push({
+            name: 'CityOfXishan'
+          })"
         >
           锡善之城
         </button>
@@ -47,6 +50,9 @@
           :class="{
             active: $route.meta.tabIdx === 4
           }"
+          @click="$router.push({
+            name: 'CloudSchool'
+          })"
         >
           慈善云学校
         </button>
@@ -54,6 +60,9 @@
           :class="{
             active: $route.meta.tabIdx === 5
           }"
+          @click="$router.push({
+            name: 'SquareView'
+          })"
         >
           慈善广场
         </button>
@@ -61,6 +70,7 @@
           :class="{
             active: $route.meta.tabIdx === 6
           }"
+          @click="onClickLoveForest"
         >
           爱心林场
         </button>
@@ -68,6 +78,9 @@
           :class="{
             active: $route.meta.tabIdx === 7
           }"
+          @click=" router.push({
+            name: 'CharityHall'
+          })"
         >
           慈善堂
         </button>
@@ -88,7 +101,15 @@
           }"
           @click="onClickShop"
         />
-        <button class="user" />
+        <button
+          class="user"
+          @click="router.push({
+            name: 'CityOfXishan',
+            query: {
+              scene: 4,
+            }
+          })"
+        />
       </div>
     </div>
 
@@ -116,6 +137,10 @@ const route = useRoute()
 const router = useRouter()
 const store = useStore()
 
+window.navigateBack = function() {
+  router.go(-1)
+}
+
 // checkLoginStatusAndProcess()
 getUserFromStorageIfNeed()
 
@@ -170,6 +195,29 @@ function onClickShop() {
     })
   }
 }
+
+function onClickLoveForest() {
+  if (store.state.loginStatus === store.getters.loginStatusEnum.wxUser) {
+    router.push({
+      name: 'LoveForest'
+    })
+  } else {
+    ElMessageBox.confirm(
+      '需登录后才能体验',
+      '提示',
+      {
+        confirmButtonText: '去登录',
+        cancelButtonText: '取消',
+        type: 'message',
+      }
+    ).then(() => {
+      router.push({
+        name: 'LoveForest'
+      })
+    }).catch(() => {
+    })
+  }
+}
 </script>
 
 <style lang="less">

+ 6 - 1
src/components/IframeWrap.vue

@@ -3,9 +3,10 @@
     <iframe
       :src="props.url"
       frameborder="0"
-      allow="fullscreen"
+      allow="fullscreen src"
     />
     <button
+      v-if="props.needBackBtn"
       class="back"
       @click="emit('back')"
     />
@@ -27,6 +28,10 @@ const props = defineProps({
   url: {
     type: String,
     required: true,
+  },
+  needBackBtn: {
+    type: Boolean,
+    default: true,
   }
 })
 </script>

+ 45 - 40
src/router/index.js

@@ -1,7 +1,12 @@
 import { createRouter, createWebHashHistory } from 'vue-router'
 import LoginView from "../views/LoginView.vue"
 import HomeView from '../views/HomeView.vue'
+import CityOfXishan from '../views/CityOfXishan.vue'
 import MuseumView from '../views/MuseumView.vue'
+import CloudSchool from '../views/CloudSchool.vue'
+import SquareView from '../views/SquareView.vue'
+import LoveForest from '../views/LoveForest.vue'
+import CharityHall from '../views/CharityHall.vue'
 import ShopView from '@/views/ShopView.vue'
 // import store from '@/store/index.js'
 
@@ -23,14 +28,14 @@ const routes = [
       tabIdx: 1
     },
   },
-  // {
-  //   path: '/tab-2',
-  //   name: 'HomeView',
-  //   component: HomeView,
-  //   meta: {
-  //     tabIdx: 2
-  //   }
-  // },
+  {
+    path: '/city-of-xishan',
+    name: 'CityOfXishan',
+    component: CityOfXishan,
+    meta: {
+      tabIdx: 2
+    }
+  },
   {
     path: '/museum',
     name: 'MuseumView',
@@ -39,38 +44,38 @@ const routes = [
       tabIdx: 3
     }
   },
-  // {
-  //   path: '/tab-4',
-  //   name: 'HomeView',
-  //   component: HomeView,
-  //   meta: {
-  //     tabIdx: 4
-  //   }
-  // },
-  // {
-  //   path: '/tab-5',
-  //   name: 'HomeView',
-  //   component: HomeView,
-  //   meta: {
-  //     tabIdx: 5
-  //   }
-  // },
-  // {
-  //   path: '/tab-6',
-  //   name: 'HomeView',
-  //   component: HomeView,
-  //   meta: {
-  //     tabIdx: 6
-  //   }
-  // },
-  // {
-  //   path: '/tab-7',
-  //   name: 'HomeView',
-  //   component: HomeView,
-  //   meta: {
-  //     tabIdx: 7
-  //   }
-  // },
+  {
+    path: '/cloud-school',
+    name: 'CloudSchool',
+    component: CloudSchool,
+    meta: {
+      tabIdx: 4
+    }
+  },
+  {
+    path: '/square',
+    name: 'SquareView',
+    component: SquareView,
+    meta: {
+      tabIdx: 5
+    }
+  },
+  {
+    path: '/love-forest',
+    name: 'LoveForest',
+    component: LoveForest,
+    meta: {
+      tabIdx: 6
+    }
+  },
+  {
+    path: '/charity-hall',
+    name: 'CharityHall',
+    component: CharityHall,
+    meta: {
+      tabIdx: 7
+    }
+  },
   // {
   //   path: '/tab-8',
   //   name: 'HomeView',

+ 28 - 0
src/views/CharityHall.vue

@@ -0,0 +1,28 @@
+<template>
+  <IframeWrap
+    class="charity-hall"
+    :url="url"
+    :need-back-btn="false"
+    @back="onClickBack"
+  />
+</template>
+
+<script setup>
+import { ref, computed, watch, onMounted } from "vue"
+import { useRoute, useRouter } from "vue-router"
+import { useStore } from "vuex"
+import IframeWrap from '@/components/IframeWrap.vue'
+
+const route = useRoute()
+const router = useRouter()
+const store = useStore()
+
+const url = ref(`https://app.4dage.com/projects/wxcs/web/index.html?platform=h5&name=${store.state.userInfo.userName}&scene=1`)
+
+</script>
+
+<style lang="less" scoped>
+.charity-hall{
+
+}
+</style>

+ 34 - 0
src/views/CityOfXishan.vue

@@ -0,0 +1,34 @@
+<template>
+  <IframeWrap
+    class="city-of-xishan"
+    :url="url"
+    :need-back-btn="false"
+    @back="onClickBack"
+  />
+</template>
+
+<script setup>
+import { ref, computed, watch, onMounted } from "vue"
+import { useRoute, useRouter } from "vue-router"
+import { useStore } from "vuex"
+import IframeWrap from '@/components/IframeWrap.vue'
+
+const route = useRoute()
+const router = useRouter()
+const store = useStore()
+
+const url = computed(() => {
+  let temp = `https://app.4dage.com/projects/wxcs/web/index.html?platform=h5&name=${store.state.userInfo.userName}`
+  if (route.query.scene !== undefined) {
+    temp += `&scene=${route.query.scene}`
+  }
+  return temp
+})
+
+</script>
+
+<style lang="less" scoped>
+.city-of-xishan{
+
+}
+</style>

+ 28 - 0
src/views/CloudSchool.vue

@@ -0,0 +1,28 @@
+<template>
+  <IframeWrap
+    class="cloud-school"
+    :url="url"
+    :need-back-btn="false"
+    @back="onClickBack"
+  />
+</template>
+
+<script setup>
+import { ref, computed, watch, onMounted } from "vue"
+import { useRoute, useRouter } from "vue-router"
+import { useStore } from "vuex"
+import IframeWrap from '@/components/IframeWrap.vue'
+
+const route = useRoute()
+const router = useRouter()
+const store = useStore()
+
+const url = ref(`https://app.4dage.com/projects/wxcs/web/index.html?platform=h5&name=${store.state.userInfo.userName}&scene=0`)
+
+</script>
+
+<style lang="less" scoped>
+.cloud-school{
+
+}
+</style>

+ 7 - 1
src/views/HomeView.vue

@@ -171,7 +171,12 @@
       alt=""
       draggable="false"
     >
-    <button class="arrow-down" />
+    <button
+      class="arrow-down"
+      @click="router.push({
+        name: 'CityOfXishan',
+      })"
+    />
 
     <OtherRelicDetail
       v-if="isShowOtherRelicDetail"
@@ -615,6 +620,7 @@ const areaList = ref([
   '宜兴市',
   '江阴市',
   '新吴区',
+  '经开区',
 ])
 const activeAreaIdx = ref(-1)
 function onClickArea(idx) {

+ 28 - 0
src/views/LoveForest.vue

@@ -0,0 +1,28 @@
+<template>
+  <IframeWrap
+    class="love-forest"
+    :url="url"
+    :need-back-btn="false"
+    @back="onClickBack"
+  />
+</template>
+
+<script setup>
+import { ref, computed, watch, onMounted } from "vue"
+import { useRoute, useRouter } from "vue-router"
+import { useStore } from "vuex"
+import IframeWrap from '@/components/IframeWrap.vue'
+
+const route = useRoute()
+const router = useRouter()
+const store = useStore()
+
+const url = ref(`https://app.4dage.com/projects/wxcs/web/index.html?platform=h5&name=${store.state.userInfo.userName}&scene=3`)
+
+</script>
+
+<style lang="less" scoped>
+.love-forest{
+
+}
+</style>

+ 1 - 1
src/views/MuseumView.vue

@@ -3,7 +3,7 @@
     <iframe
       src="https://houseoss.4dkankan.com/project/wuxicishanbwg/index.html?m=SG-igv7wQAyyyG_01#/"
       frameborder="0"
-      allow="fullscreen"
+      allow="fullscreen src"
     />
     <button
       class="back"

+ 28 - 0
src/views/SquareView.vue

@@ -0,0 +1,28 @@
+<template>
+  <IframeWrap
+    class="square-view"
+    :url="url"
+    :need-back-btn="false"
+    @back="onClickBack"
+  />
+</template>
+
+<script setup>
+import { ref, computed, watch, onMounted } from "vue"
+import { useRoute, useRouter } from "vue-router"
+import { useStore } from "vuex"
+import IframeWrap from '@/components/IframeWrap.vue'
+
+const route = useRoute()
+const router = useRouter()
+const store = useStore()
+
+const url = ref(`https://app.4dage.com/projects/wxcs/web/index.html?platform=h5&name=${store.state.userInfo.userName}&scene=2`)
+
+</script>
+
+<style lang="less" scoped>
+.square-view{
+
+}
+</style>