1
0

5 کامیت‌ها 25ffaaaa45 ... 4813766beb

نویسنده SHA1 پیام تاریخ
  wangfumin 4813766beb 更新 1 هفته پیش
  wangfumin ed12844722 Merge branch 'master' of http://192.168.0.115:3000/tangning/personalhubs 1 هفته پیش
  wangfumin 3f9704c63e 更新 1 هفته پیش
  tangning 8844a89f73 1 1 هفته پیش
  tangning c54cc8cd16 1 1 هفته پیش
5فایلهای تغییر یافته به همراه876 افزوده شده و 0 حذف شده
  1. 1 0
      components.d.ts
  2. 119 0
      src/components/mobile/data.ts
  3. 191 0
      src/components/mobile/footer.vue
  4. 419 0
      src/components/mobile/header.vue
  5. 146 0
      src/components/mobile/index.vue

+ 1 - 0
components.d.ts

@@ -38,6 +38,7 @@ declare module '@vue/runtime-core' {
     Icons: typeof import('./src/components/icons/index.vue')['default']
     IconSupport: typeof import('./src/components/icons/IconSupport.vue')['default']
     IconTooling: typeof import('./src/components/icons/IconTooling.vue')['default']
+    Mobile: typeof import('./src/components/mobile/index.vue')['default']
     Pc: typeof import('./src/components/pc/index.vue')['default']
     Popup: typeof import('./src/components/popup/index.vue')['default']
     RouterLink: typeof import('vue-router')['RouterLink']

+ 119 - 0
src/components/mobile/data.ts

@@ -0,0 +1,119 @@
+
+import zh from '@/assets/images/home/china@2x.png'
+import en from '@/assets/images/home/USA@2x.jpg'
+
+export const pcFooter = (t:any) => {
+  return [
+  {
+    title: t('header.core_product'),
+    list: [
+      {
+        text: t('header.sdsg'),
+        link: 'Meta'
+      },
+      {
+        text: t('header.Mega'),
+        link: 'Mega'
+      },
+      {
+        text: t('header.kankanMinion'),
+        link: 'Minion'
+      },
+      {
+        text: t('header.mallPro'),
+        link: 'KanKan'
+      }
+    ]
+  },
+  {
+    title: t('header.solutions'),
+    list: [
+      {
+        text: t('header.solutionsExi'),
+        link: 'solutions/smartCity'
+      },
+      {
+        text: t('header.solutionsSubject'),
+        link: 'solutions/museum'
+      },
+      {
+        text: t('header.solutionsSec'),
+        link: 'solutions/government'
+      },
+      {
+        text: t('header.solutionsHouse'),
+        link: 'solutions/property'
+      },
+    ]
+  },
+  {
+    title: t('header.service'),
+    list: [
+      {
+        text: t('header.serviceApp'),
+        link: 'service/app/pro'
+      }, {
+        text: t('service.help'),
+        link: 'service/use/help'
+      },
+      {
+        text: t('header.serviceBaoxiu'),
+        link: 'service/clause/pro'
+      },
+    ]
+  },
+  {
+    title: t('header.about'),
+    list: [
+      {
+        text: t('header.aboutCompany'),
+        link: 'about'
+      },
+      {
+        text: t('header.aboutNews'),
+        link: 'news'
+      },
+      {
+        text: t('header.aboutAgent'),
+        link: 'distributor'
+      }
+    ]
+  }
+]
+}
+export const pcHeader = (t:any) => {
+  return [
+        { text: t('header.sdsg'), link: '/mall/meta' },
+        { text: t('header.Mega'), link: '/mall/mega' },
+        { text: t('header.kankanMinion'), link: '/mall/kankanMinion' },
+        { text: t('header.mallPro'), link: '/mall/kankanPro' },
+        { text: t('header.mallPeijian'), link: '/mall/zhijia',items: [
+          {
+            text: t('header.tripod'),
+            link: '/mall/zhijia'
+          },
+          {
+            text: t('header.USBdrive'),
+            link: '/mall/USBdrive'
+          },
+          {
+            text: t('header.Battery'),
+            link: '/mall/Battery'
+          },
+        ] },
+        { text: t('header.addService'), link: '/mall/member' }
+      ]
+}
+
+export const languageList = [
+  {
+        name: '简体中文',
+        img: zh,
+        value: 'zh' 
+  },
+  {
+        name: 'English',
+        img: en,
+        value: 'en' 
+  }
+]

+ 191 - 0
src/components/mobile/footer.vue

@@ -0,0 +1,191 @@
+<script setup lang="ts">
+import { useI18n } from 'vue-i18n'
+import logoCn from '@/assets/images/logoCn.png'
+import logoEn from '@/assets/images/logoEn.png'
+import wechat from '@/assets/images/footer/wechat.svg'
+import wb from '@/assets/images/footer/wb.svg'
+import dy from '@/assets/images/footer/dy.svg'
+import { pcFooter } from './data'
+const { locale: language, t } = useI18n()
+const infosList = pcFooter(t)
+</script>
+
+<template>
+  <div class="footer relative">
+    <div class="layout container">
+      <div class="infos clear flex justify-between">
+        <div class="infos-contact">
+          <img :src="language === 'zh' ? logoCn : logoEn" alt="logo" class="logo" />
+          <ul>
+            <li>{{ t('header.footer.saleEmail') }}:sales@4dage.com</li>
+            <li>{{ t('header.footer.meitiEmail') }}:pr@4dage.com</li>
+            <li>{{ t('header.footer.phone') }}:400-669-8025</li>
+          </ul>
+        </div>
+        <div class="infos-list">
+          <div class="infos-item" v-for="item in infosList" :key="item.title">
+            <h6>{{ item.title }}</h6>
+            <a v-for="i in item.list" :key="i.text" target="_blank" @click="toLink(i)">{{
+              i.text
+            }}</a>
+          </div>
+        </div>
+        <ul class="contacts-w">
+          <popup :icon="wechat" :hovericon="wechat" :code="`${$cdn}images/code_wx.jpg`" />
+          <popup :icon="wb" :hovericon="wb" :code="`${$cdn}images/code_wb.jpg`" />
+          <popup :icon="dy" :hovericon="dy" :code="`${$cdn}images/code_dy.jpg`" />
+        </ul>
+      </div>
+      <div class="relevant clear flex justify-between">
+        <p class="relevant-1">Copyright © 2022 4DAGE Co., Ltd. All rights reserved.</p>
+        <p class="relevant-2">
+          <a
+            target="_blank"
+            href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=44049102496647"
+            class="a_class"
+          >
+            <img src="@/assets/images/baicon.png" alt="" />
+            粤公网安备 44049102496647号
+          </a>
+          <a target="_blank" href="https://beian.miit.gov.cn/" class="a_class">
+            <img src="@/assets/images/baicon.png" alt="" />
+            粤ICP备14078495号
+          </a>
+          <!-- </p>
+        <p class="relevant-2"> -->
+        </p>
+      </div>
+    </div>
+    <!-- <div class="contentPage">
+      <div class="relevant clear">
+        <p class="relevant-1">Copyright © 2022 4DAGE Co., Ltd. All rights reserved.</p>
+        <span>
+          <p class="relevant-2">
+          <a target="_blank" href="https://beian.miit.gov.cn/" class="a_class">
+            <img src="@/assets/images/baicon.png" alt="" />
+            粤ICP备14078495号
+          </a>
+        </p>
+        <p class="relevant-2">
+          <a
+            target="_blank"
+            href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=44049102496647"
+            class="a_class"
+          >
+            <img src="@/assets/images/baicon.png" alt="" />
+            粤公网安备 44049102496647号
+          </a>
+        </p>
+        </span>
+      </div>
+    </div> -->
+  </div>
+</template>
+<style lang="less" scoped>
+.footer {
+  padding-top: 76px 0 26px;
+  background-color: #323233 !important;
+  position: relative;
+  width: 100%;
+  bottom: 0;
+  z-index: 888;
+  .layout {
+    margin: 0 auto;
+    max-width: 1280px;
+    padding-left: 20px;
+    padding-right: 20px;
+    .relevant {
+      margin-top: 86px;
+      border-top: 1px solid #909090;
+      padding: 26px 0;
+      color: #909090;
+      &-1 {
+        // float: left;
+        background-color: transparent;
+      }
+      &-2 {
+        // float: right;
+      }
+      div {
+        margin-bottom: 8px;
+
+        a {
+          color: #15bec8;
+          font-size: 14px;
+          text-decoration: underline;
+          display: inline-block;
+          line-height: 25px;
+
+          &:nth-child(2) {
+            margin: 0 42px;
+          }
+        }
+      }
+      a {
+        color: #909090;
+      }
+      p {
+        font-size: 14px;
+        color: #909090;
+        margin-bottom: 8px;
+      }
+    }
+    &::after {
+      content: '';
+      display: block;
+      clear: both;
+    }
+  }
+}
+
+.infos {
+  font-size: 16px;
+  color: #ebebeb;
+  padding: 76px 0 0 0;
+  .infos-contact {
+    float: left;
+    ul {
+      margin-top: 27px;
+    }
+    li {
+      margin-bottom: 15px;
+    }
+  }
+  .infos-list {
+    float: left;
+    padding-top: 25px;
+  }
+  .infos-item {
+    float: left;
+    color: #909090;
+    min-width: 138px;
+    margin-right: 30px;
+    h6 {
+      margin-bottom: 27px;
+      color: #fff;
+    }
+    a {
+      display: block;
+      color: #909090;
+      margin-bottom: 15px;
+      cursor: pointer;
+      &:hover {
+        color: #ffffff;
+      }
+    }
+  }
+}
+.contacts-w {
+  display: flex;
+}
+.a_class,
+.a_class:hover,
+.a_class:active {
+  color: #fff;
+  text-decoration: none;
+  cursor: initial;
+  img {
+    display: inline-block;
+  }
+}
+</style>

+ 419 - 0
src/components/mobile/header.vue

@@ -0,0 +1,419 @@
+<script setup lang="ts">
+import { ref, computed } from 'vue'
+import { useRouter, useRoute } from 'vue-router'
+import { useI18n } from 'vue-i18n'
+import logoCn from '@/assets/images/logoCn.png'
+import logoEn from '@/assets/images/logoEn.png'
+import shopbtn from '@/assets/images/footer/shopbtn.gif'
+import shopbtnEn from '@/assets/images/footer/shopbtn-en.gif'
+import { useUserStore } from '@/stores/user'
+import { pcHeader, languageList } from './data'
+const router = useRouter();
+//得到i18n的locale
+const userStore = useUserStore()
+const info = computed(() => userStore.getUserInfo)
+const isLogin = computed(() => userStore.isLogin)
+const { locale:langauge, t } = useI18n();
+const navs = pcHeader(t)
+const languageObj = computed(() => languageList.find(item => item.value === langauge.value) || {})
+console.log('languageObj', info.value, userStore)
+</script>
+
+<template>
+    <div class="header-layout">
+    <div class="headercontainer clear flex justify-between items-center">
+      <img :src="locale === 'zh' ? logoCn : logoEn" alt="logo">
+      <div class="menu">
+        <div
+          class="list"
+          ref="list"
+        >
+          <a
+            v-for="nav in navs"
+            :key="nav.text"
+            :class="{active: hoverCp === nav.cp}"
+            class="header-item"
+            :style="{'margin-right': langauge==='en' ? '30px' : '48px'}"
+            @click="toNav(nav)"
+          >{{nav.text}}
+            <ul class="child-list" v-if="nav.items">
+              <li class="" v-for="(item, index) in nav.items" :key="index" @click.stop="toNav(item)">
+                {{ item.text }}
+              </li>
+            </ul>
+          </a>
+          
+        </div>
+      </div>
+      <div class="ctrl">
+        <div class="shop-btn" @click="router.push({name: 'mallMeta'})" v-if="!isShop">
+          <img :src="langauge==='en' ? shopbtnEn : shopbtn" alt="" srcset="">
+        </div>
+        <div class="language-w">
+          <div class="list">
+            <a class="header-item">
+              <p class="guoqi" :style="{'background-image': `url(${languageObj.img})`}">{{ languageObj.name }}</p>
+              <ul class="child-list">
+                <li v-for="item in languageList" :key="item.name" :style="{'background-image': `url(${item.img})`}" @click="changeLanguage(item.value)">{{ item.name }}</li>
+              </ul>
+            </a>
+          </div>
+        </div>
+        <div class="user" @click="router.push('/login/login')" v-if="!isLogin"></div>
+        <div v-else-if="info" class="user-w">
+          <div class="user avatar" :class="{vip: info.incrementNum}" :style="{'background-image': `url(${info.head})`}" @click="router.push('/information')">
+          <div class="member-icon" @click.stop="router.push({name: 'member'})" v-if="info.incrementNum"></div>
+          </div>
+          <div class="list avatarList">
+              <a class="header-item" @click="router.push('/information')">
+                <ul class="child-list">
+                  <li @click="router.push('/information')">{{ t('header.myaccount') }}</li>
+                  <li @click.stop="handleLogout">{{ t('header.logout') }}</li>
+                </ul>
+              </a>
+            </div>
+        </div>
+        <div class="cart" @click="handleCartClick">
+          <h-icon type="xingouwuche" class="icon" />
+          <span v-if="cartCount">{{cartCount}}</span>
+        </div>
+      </div>
+    </div>
+  </div>
+  <!-- <div class="header">
+    <div class="logo contentPage">
+      <img :src="locale === 'zh' ? logoCn : logoEn" alt="logo">
+    </div>
+  </div> -->
+</template>
+
+<style lang="less" scoped>
+.language-w {
+  .header-item {
+    margin-right: 20px !important;
+    display: inline-block;
+    cursor: pointer;
+    p {
+      color: #323233;
+      font-size: 14px;
+      font-weight: normal;
+      padding-left: 28px;
+      background: url(~@/assets/images/home/China.png) no-repeat left center;
+      background-size: 20px 14px;
+    }
+  }
+  .child-list {
+    background: #fff;
+    li {
+      color: #323233;
+      font-size: 14px;
+      font-weight: normal;
+      padding: 0 13px 0 40px;
+      background: url(~@/assets/images/home/China.png) no-repeat 13px center;
+      background-size: 20px 14px;
+    }
+  }
+}
+
+.header-layout {
+  // $mc: .5s cubic-bezier(.77, 0, .175, 1);
+  // $ts: all $mc;
+  background-color: #fff;
+  color: #fff;
+  justify-content: space-between;
+  color: #323233;
+  height: 80px;
+  box-shadow:0px 3px 6px rgba(0,0,0,0.1);
+  .headercontainer {
+    height: 100%;
+    width: 1316px;
+    padding: 0 20px;
+    margin: 0 auto;
+  }
+  .child-layout {
+    position: absolute;
+    top: 100%;
+    max-height: 0;
+    left: 0;
+    right: 0;
+    // transition: max-height $mc;
+    overflow: hidden;
+    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
+    .silp {
+      position: absolute;
+      width: 1px;
+      height: 100%;
+      background-color: #ededed;
+      z-index: 2;
+    }
+  }
+
+  .logo-layout {
+    text-align: center;
+    text-align: left;
+    margin-right: 52px;
+    float: left;
+    height: 100%;
+    .logo {
+      position: relative;
+      width: 150px;
+      height: 100%;
+      display: inline-block;
+      color: #fff;
+    }
+  }
+
+  .menu {
+    float: left;
+    min-width: 600px;
+
+    .lang {
+      box-sizing: border-box;
+      text-align: center;
+      padding-right: 10px;
+
+      a {
+        display: inline-block;
+        font-size: 16px;
+        font-weight: bold;
+        margin-left: 5px;
+        color: #727272;
+        transition: color 0.2s ease;
+        &:hover{
+          color: #fff;
+        }
+      }
+
+      .active{
+        color: #fff;
+      }
+    }
+
+    
+  }
+  .list {
+      justify-content: space-between;
+      height: 100%;
+      a {
+        display: inline-block;
+        // padding: 30px 47px 25px 0;
+        margin-right: 48px;
+        line-height: 80px;
+        font-size: 16px;
+        text-decoration: none;
+        font-weight: bold;
+        position: relative;
+        transition: color 0.3s ease;
+
+        &::before {
+          z-index: 2;
+        }
+
+        &.active {
+          color: #727272;
+
+          &::after {
+            border-top-color: #727272;
+            transform: translateY(-50%) scale(1.3);
+          }
+
+          &::before {
+            transform: translateY(-50%) scale(0.7);
+            border-top-color: #000;
+          }
+        }
+
+      }
+    }
+  .ctrl {
+    align-items: center;
+    font-size: 16px;
+    &>div {
+      display: inline-block;
+      vertical-align: middle;
+    }
+    .shop-btn {
+      margin-right: 25px;
+      cursor: pointer;
+      
+      height: 34px;
+      line-height: 34px;
+      text-align: center;
+      font-weight: 400;
+      height: 34px;
+      background: linear-gradient(180deg, #1EDAE5 1%, #069199 100%);
+      border-radius: 17px;
+      color: #FFFFFF;
+        
+  img {
+    height: 34px;
+  }
+    }
+    .country {
+      width: 20px;
+      height: 21px;
+      display: inline-block;
+      background: url(~@/assets/images/home/China.png) no-repeat center center;
+      vertical-align: middle;
+    }
+    .language-w {
+      // padding: 0 30px  0 10px;
+    }
+    .language {
+      margin: 0 15px 0 0;
+      color: #8F8F8F;
+      cursor: pointer;
+      vertical-align: middle;
+      font-size: 16px;
+      font-weight: 600;
+      &.is-active {
+        color: #323233;
+      }
+    }
+    .user {
+      width: 20px;
+      height: 20px;
+      background: url(~@/assets/images/home/account-icon.png) no-repeat center center;
+      cursor: pointer;
+      background-size: cover;
+      &.avatar {
+        width: 34px;
+        height: 34px;
+        border: 1px solid #EFEFEF;
+        border-radius: 50%;
+        position: relative;
+        &.vip {
+          border-color: #D8AF7C;
+        }
+      }
+      
+      .member-icon {
+        width: 12px;
+        height: 12px;
+        background: url(~@/assets/images/refactor/usercenter/avatar_vip.png) no-repeat center center;
+        background-size: cover;
+        position: absolute;
+        right: -2px;
+        bottom: 0;
+      }
+    }
+    .cart {
+      color: #323233;
+      margin-left: 18px;
+      cursor: pointer;
+      position: relative;
+      .icon {
+        font-size: 26px;
+      }
+      span {
+        display: block;
+        position: absolute;
+        left: 9px;
+        top: 0;
+        font-size: 12px;
+        line-height: 16px;
+        text-align: center;
+        font-weight: bold;
+        color: #FFFFFF;
+        line-height: 14px;
+
+        height: 16px;
+        min-width: 16px;
+        padding: 0 2px;
+        background: linear-gradient(135deg, #696D75 0%, #3C3F41 100%);
+        border-radius: 4px;
+      }
+    }
+  }
+
+}
+.header-item:hover {
+  position: relative;
+  .child-list {
+    display: block;
+  }
+}
+.child-list {
+  position: absolute;
+  // width: 112px;
+  box-shadow: 0px -2px 6px rgba(113,113,113,0.16);
+  margin-top: -10px;
+  left: 50%;
+  transform: translateX(-50%);
+  z-index: 1;
+  display: none;
+  transition: all linear 0.5s;
+  padding-top: 6px;
+  white-space: nowrap;
+  
+  background: #fff;
+  &::before {
+    position: absolute;
+    display: block;
+    top: -5px;
+    left: 50%;
+    margin-left: -2px;
+    width: 0;
+    height: 0px;
+    content: '';
+    background: #fff;
+    border-style: solid;
+    border-width: 4px;
+    border-color: #fff #fff transparent transparent;
+    transform: rotate(-45deg);
+    box-shadow: 1px -1px 0px rgba(113,113,113,0.16);
+    z-index: 1;
+  }
+  li {
+    height: 48px;
+    line-height: 48px;
+    font-size: 16px;
+    text-align: center;
+    position: relative;
+    background: #fff;
+    z-index: 2;
+    width: 100%;
+    padding: 0 25px;
+    &:hover {
+      background-color: #EBEBEB;
+    }
+  }
+}
+.list {
+  &:hover {
+    .header-item {
+      color: #909090;
+    }
+  }
+  .header-item:hover {
+    position: relative;
+    color: #323233;
+    transition: 0s;
+    .child-list {
+      display: block;
+    }
+  }
+}
+.user-w {
+  .avatarList{
+    position: absolute;
+    z-index: 1;
+  }
+  .list {
+    height: 100%;
+    top: 0;
+    .header-item {
+      display: block;
+      width: 32px;
+      padding-top: 80px;
+    }
+  }
+}
+@media screen and (max-width: 1600px){
+}
+
+@media screen and (max-width: 1450px){
+}
+
+</style>
+

+ 146 - 0
src/components/mobile/index.vue

@@ -0,0 +1,146 @@
+<script setup lang="ts">
+import { ref, computed, onMounted } from 'vue'
+import { useI18n } from 'vue-i18n'
+import { useRouter, useRoute } from 'vue-router'
+import Header from './header.vue'
+import Footer from './footer.vue'
+const { locale: language, t } = useI18n()
+const router = useRouter();
+const active = ref({
+  name: 'information',
+  to: { name: 'information' }
+})
+
+const normalSettings = [
+  {
+    name: t('manage.information.nameArr.information'),
+    icon: 'nav_my',
+    to: { name: 'information' }
+  },
+  {
+    name: t('manage.information.nameArr.scene'),
+    icon: 'nav_scene',
+    to: { name: 'scene' }
+  },
+  {
+    name: t('manage.information.nameArr.device'),
+    icon: 'nav_cam',
+    to: { name: 'device' }
+  },
+  {
+    name: t('manage.information.nameArr.order'),
+    icon: 'nav_order',
+    to: { name: 'order' }
+  },
+  {
+    name: t('manage.information.nameArr.products'),
+    icon: 'nav_data',
+    to: { name: 'appProduct' }
+  }
+]
+function tabHandle(sub) {
+    active.value = sub
+    router.push(sub.to) 
+}
+</script>
+
+<template>
+  <div class="personalCenter">
+    <Header />
+    <div class="main_container">
+      <div class="manage-body flex justify-center">
+        <div class="mc-left">
+          <div>
+            <ul class="list-items">
+              <li
+                @click="tabHandle(sub)"
+                v-for="(sub, i) in normalSettings"
+                :key="i"
+                :class="{
+                  active: active.to.name === sub.to.name,
+                  'logout-span': sub.name === '退出登录' || sub.name === 'Log out'
+                }"
+              >
+                <span
+                  ><h-icon class="nav-icon" v-if="sub.icon" :type="sub.icon"></h-icon
+                  >{{ sub.name }}</span
+                >
+              </li>
+            </ul>
+          </div>
+        </div>
+        <div class="mc-right">
+          <router-view class="pcMianPage" />
+        </div>
+      </div>
+    </div>
+    <Footer />
+  </div>
+</template>
+
+<style lang="less" scoped>
+.manage-body {
+  min-height: 676px;
+  padding: 80px 0;
+  background-color: #f4f4f6;
+  .container {
+    display: flex;
+  }
+  .mc-left {
+    flex-shrink: 0;
+    margin-right: 30px;
+    .list-items {
+      font-size: 16px;
+      display: inline-block;
+      margin-bottom: 50px;
+      width: 100%;
+      padding: 30px 0;
+      background: #fff;
+      width: 274px;
+      li {
+        width: 100%;
+        line-height: 48px;
+        padding-left: 50px;
+        color: #909090;
+        cursor: pointer;
+        &.active {
+          color: #323233;
+          background: #ebebeb;
+        }
+        .nav-icon {
+          margin-right: 9px;
+        }
+        span {
+          display: inline-block;
+          position: relative;
+          vertical-align: middle;
+          display: flex;
+          align-items: center;
+        }
+
+        .logout-span {
+          &::before {
+            display: none;
+          }
+        }
+      }
+    }
+  }
+  .mc-right {
+    .mc-title {
+      margin-left: 40px;
+      margin-top: 34px;
+      font-size: 28px;
+      color: #2d2d2d;
+      font-weight: bold;
+    }
+  }
+  .pcMianPage{
+    padding: 30px 0;
+    width: 972px;
+    min-height: 676px;
+    background: #fff;
+  }
+}
+</style>
+