Jelajahi Sumber

Merge remote-tracking branch 'origin/feature-201824-wangcz' into dev

# Conflicts:
#	components/mobile/register-saler/Register.vue
wangcz 7 tahun lalu
induk
melakukan
0e0e6a1c04

+ 155 - 0
components/mobile/register-saler/Register.vue

@@ -0,0 +1,155 @@
+<template>
+  <div>
+    <!--<div class="step-menu">-->
+      <!--<ul class="x-step">-->
+        <!--<li :class="section >= 1?'active':''" >第一步:完善企业信息-->
+          <!--<i class="x-split"></i></li>-->
+        <!--<li :class="section >= 2?'active':''" >第二步:阅读相关条例-->
+          <!--<i class="x-split"></i></li>-->
+        <!--<li :class="section >= 3?'active':''" >第三步:提交申请</li>-->
+      <!--</ul>-->
+    <!--</div>-->
+    <div class="mobile-tab-list">
+      <step-first v-show="section == 1"
+                  @sectionEvent="sectionChange"
+                  @registerAction="onRegister"
+                  :loginData="loginData"
+                  :enterpriseData="enterpriseData"
+                  :businessImgUrl="businessImgUrl"
+                  @businessImgUrlAction="onBusinessImgUrl"
+                  @isSelfCacheDataAction="onCacheData"></step-first>
+      <step-second v-show="section == 2"
+                   @sectionEvent="sectionChange"
+                   :checkData="checkData"
+                   :loginData="loginData"
+                   :cacheData="cacheData"></step-second>
+      <choose-storetype v-show="section == 3"
+                  @sectionEvent="sectionChange"
+      >
+
+      </choose-storetype>
+      <step-third v-show="section == 4"
+                  @sectionEvent="sectionChange"
+                  :registerData="registerData"
+                  :enterpriseData="enterpriseData"
+                  :checkData="checkData"
+                  :businessImgUrl="businessImgUrl"
+                  @businessImgUrlAction="onBusinessImgUrl"
+                  :loginData="loginData"
+                  :tab="tab"></step-third>
+    </div>
+    </div>
+</template>
+<script>
+  import StepFirst from '~components/mobile/register-saler/register/StepFirst.vue'
+  import StepSecond from '~components/mobile/register-saler/register/StepSecond.vue'
+  import StepThird from '~components/mobile/register-saler/register/StepThird.vue'
+  import chooseStoretype from '~components/mobile/register-saler/register/chooseStoretype.vue'
+  export default {
+    data () {
+      return {
+        tab: 'ORIGINAL_FACTORY',
+        section: 1,
+        checkData: {
+          checked: false
+        },
+        registerData: {
+          enterprise: {},
+          c: false,
+          url: ''
+        },
+        loginData: {
+          isSelf: true,
+          section: 1,
+          enterprise: {}
+        },
+        cacheData: {},
+        enterpriseData: {},
+        businessImgUrl: ''
+      }
+    },
+    components: {
+      StepFirst,
+      StepSecond,
+      StepThird,
+      chooseStoretype
+    },
+    computed: {
+      user () {
+        return this.$store.state.option.user
+      }
+    },
+    created () {
+      let ens = this.user.data.enterprises
+      let isSelf = true
+      let tempEnterprise = {}
+      if (ens && ens.length) {
+        ens.forEach(function (item) {
+          if (item.current) {
+            isSelf = false
+            tempEnterprise = item
+          }
+        })
+      } else {
+        isSelf = true
+      }
+      if (!isSelf) { // 是企业
+        this.$http.get('/basic/enterprise/' + tempEnterprise.uu + '/info')
+          .then(response => {
+            this.enterpriseData = response.data
+            if (this.user.data.enterprise.isVendor === 313) {
+              this.$http.get('/basic/vendor/transactionInfo').then(response => {
+                if (response.data.isOpenStore === false) {
+                  this.section = 3
+                  this.checkData.checked = true
+                }
+              })
+          } else {
+            this.section = 1
+            this.checkData.checked = false
+          }
+          })
+      } else { // 是个人
+        this.$http.get('/basic/user/userCacheEnterprise')
+          .then(response => {
+            if (!response.data.name) {
+              this.section = 1
+              this.checkData.checked = false
+            } else if (!response.data.enIsRead) {
+              this.section = 2
+              this.checkData.checked = false
+              this.enterpriseData = response.data
+            } else if (response.data.enIsRead) {
+              this.section = 3
+              this.checkData.checked = true
+              this.enterpriseData = response.data
+            }
+          })
+      }
+      this.loginData.isSelf = isSelf
+      this.loginData.section = this.section
+      this.loginData.enterprise = tempEnterprise
+    },
+    methods: {
+      sectionChange: function (num, tab) {
+        this.section = num
+        if (tab) {
+          this.tab = tab
+        }
+      },
+      onRegister: function (data) {
+        this.registerData.isValidRegister = data.isValidRegister
+        this.registerData.enterprise = data.enterprise
+        this.registerData.url = data.url
+      },
+      onCacheData: function (cache) {
+        this.cacheData = cache
+      },
+      onBusinessImgUrl: function (url) {
+        this.businessImgUrl = url
+      }
+    }
+  }
+</script>
+<style>
+</style>

+ 18 - 0
pages/eCommerce/home.vue

@@ -0,0 +1,18 @@
+<template>
+  <div style="background: rgb(242, 241, 241);">
+    <recommend-store></recommend-store>
+    <nuxt-child></nuxt-child>
+  </div>
+</template>
+<script>
+  import { RecommendStore } from '~components/provider'
+  export default  {
+    layout: 'main',
+    components: {
+      RecommendStore
+    },
+    fetch ({store}) {
+      return store.dispatch('loadCounterData')
+    }
+  }
+</script>

+ 47 - 0
pages/eCommerce/home/_type.vue

@@ -0,0 +1,47 @@
+<template>
+  <div><recommendStore-show/></div>
+</template>
+<script>
+  import RecommendStoreShow  from '~components/provider/RecommendStoreShow.vue'
+  export default {
+    layout: 'main',
+    components: {
+      RecommendStoreShow
+    },
+    fetch ({store, route, params}) {
+      return params.type === 'supplier' ? Promise.all([
+        store.dispatch('supplier/loadVendorList', {page: 1, size: 10}),
+        store.dispatch('supplier/loadVendorAll', {page: 1, size: 20}),
+        store.dispatch('supplier/loadNewMerchant', {filter: 'page', size: 10}),
+        store.dispatch('supplier/loadRecommend', {size: 19}),
+      ]) : params.type === 'brand' ? Promise.all([
+        store.dispatch('loadFloors'),
+        store.dispatch('loadBanners', {type: 'Brand-v3'}),
+        store.dispatch('loadBrandCarousel'),
+        store.dispatch('loadBrandBanner'),
+        store.dispatch('product/loadRecommends'),
+        store.dispatch('product/loadBrandsPager', {'initial': route.query.initial, 'page': 1, 'count': 60, 'keyword': ''})
+      ]) : params.type === 'factory' ? Promise.all([
+        store.dispatch('loadBanners', {type: 'factory_banner_carousel'}),
+        store.dispatch('provider/loadSalesStore', { isOriginal: true }),
+        store.dispatch('provider/loadNewStores', { types: 'ORIGINAL_FACTORY', size: 5 }),
+        store.dispatch('provider/loadRecommendOriginal', { types: 'ORIGINAL_FACTORY', num: 5 }),
+        store.dispatch('provider/findSimilarStoreList', { page: 1, count: 10, type: 'ORIGINAL_FACTORY' }),
+        store.dispatch('provider/loadHotComponents'),
+        store.dispatch('provider/loadFactoriesCount'),
+        store.dispatch('provider/loadAgencyCount'),
+        store.dispatch('loadStoreStatus', { op: 'check' }),
+      ]) : params.type === 'origin' ? Promise.all([
+        store.dispatch('loadBanners', {type: 'origin_banner_carousel'}),
+        store.dispatch('provider/loadSalesStore', { isOriginal: true }),
+        store.dispatch('provider/loadNewStores', { types: 'ORIGINAL_FACTORY', size: 5 }),
+        store.dispatch('provider/loadRecommendOriginal', { types: 'ORIGINAL_FACTORY', num: 5 }),
+        store.dispatch('provider/findSimilarStoreList', { page: 1, count: 10, type: 'ORIGINAL_FACTORY' }),
+        store.dispatch('provider/loadHotComponents'),
+        store.dispatch('provider/loadFactoriesCount'),
+        store.dispatch('provider/loadAgencyCount'),
+        store.dispatch('loadStoreStatus', { op: 'check' }),
+      ]) : []
+    }
+  }
+</script>

TEMPAT SAMPAH
static/images/mobile/@2x/home/store-into.png