Browse Source

Merge remote-tracking branch 'origin/feature-wangcz-201814' into feature-wangcz-201814

gaoxm 7 years ago
parent
commit
298e263fd5

+ 9 - 0
pages/mobile/user/bindEnterprise.vue

@@ -0,0 +1,9 @@
+<template>
+
+</template>
+<script>
+
+</script>
+<style>
+
+</style>

+ 10 - 8
pages/mobile/user/enterpriseinfo.vue

@@ -371,15 +371,17 @@
         this.timeoutCount++
         this.timeoutCount++
       },
       },
       updateInfo() {
       updateInfo() {
-        if (!this.isAdmin) {
-          this.setRemindText('您无该模块的编辑权限,请联系企业管理员进行编辑维护!')
-          return
-        }
-        this.storeState = 'update'
-        this.Islook = true
-        this.hidelook = true
+//        if (!this.isAdmin) {
+//          this.setRemindText('您无该模块的编辑权限,请联系企业管理员进行编辑维护!')
+//          return
+//        }
+        this.authorityInterceptor('/basic/enterprise/*/updateInfo', () => {
+          this.storeState = 'update'
+          this.Islook = true
+          this.hidelook = true
 //        this.setTextareaHeight()
 //        this.setTextareaHeight()
-        this.BScroll.refresh()
+          this.BScroll.refresh()
+        })
       },
       },
       dealWithText2(tp) {
       dealWithText2(tp) {
         if (tp === 'open') {
         if (tp === 'open') {

+ 23 - 10
pages/mobile/user/index.vue

@@ -25,13 +25,20 @@
         <i class="iconfont icon-xiangyou"></i>
         <i class="iconfont icon-xiangyou"></i>
         <span class="l-right">{{currentEnName}}</span>
         <span class="l-right">{{currentEnName}}</span>
       </div>
       </div>
-      <div class="line" @click="go('/mobile/user/storeinfo')">
+      <div class="line" @click="go('/mobile/user/storeinfo')" v-if="storeStatus.uuid">
         <div class="img-wrap">
         <div class="img-wrap">
           <img src="/images/mobile/user/icon_02.png" alt="">
           <img src="/images/mobile/user/icon_02.png" alt="">
         </div>
         </div>
         <span>店铺信息</span>
         <span>店铺信息</span>
         <i class="iconfont icon-xiangyou"></i>
         <i class="iconfont icon-xiangyou"></i>
       </div>
       </div>
+      <div class="line" @click="go('/mobile/user/storeinfo')" v-else>
+        <div class="img-wrap">
+          <img src="/images/mobile/user/apply-store.png" alt="">
+        </div>
+        <span>开店申请</span>
+        <i class="iconfont icon-xiangyou"></i>
+      </div>
       <div class="line block-line" @click="go('/mobile/user/enterpriseinfo')">
       <div class="line block-line" @click="go('/mobile/user/enterpriseinfo')">
         <div class="img-wrap">
         <div class="img-wrap">
           <img src="/images/mobile/user/icon_03.png" alt="">
           <img src="/images/mobile/user/icon_03.png" alt="">
@@ -108,11 +115,22 @@
     components: {
     components: {
       RemindBox
       RemindBox
     },
     },
+    fetch ({store}) {
+      return Promise.all([
+        store.dispatch('loadStoreStatus', {op: 'check'})
+      ])
+    },
+    computed: {
+      storeStatus () {
+        return this.$store.state.option.storeStatus.data
+      }
+    },
     methods: {
     methods: {
       switchEnterprise(en) {
       switchEnterprise(en) {
         this.$http.get(`/user/authentication/${en.uu || 0}`).then(() => {
         this.$http.get(`/user/authentication/${en.uu || 0}`).then(() => {
           this.$store.dispatch('loadUserInfo').then(() => {
           this.$store.dispatch('loadUserInfo').then(() => {
             this.showLogin = false
             this.showLogin = false
+            this.$store.dispatch('loadStoreStatus', {op: 'check'})
           })
           })
         })
         })
       },
       },
@@ -130,16 +148,11 @@
       },
       },
       go: function (url) {
       go: function (url) {
         if (url === '/mobile/user/storeinfo') {
         if (url === '/mobile/user/storeinfo') {
-          this.$http.get('/store-service/stores', {params: {op: 'check'}}).then(res => {
-            if (res.data.uuid) {
-              this.$router.push(url)
-            } else {
-              this.setRemindText('请先前往pc端申请开店')
-            }
-          }, err => {
-            console.log(err)
+          if (this.storeStatus.uuid) {
+            this.$router.push(url)
+          } else {
             this.setRemindText('请先前往pc端申请开店')
             this.setRemindText('请先前往pc端申请开店')
-          })
+          }
         } else if (!this.user.data.enterprise.uu || this.user.data.enterprise.isVendor !== 313) {
         } else if (!this.user.data.enterprise.uu || this.user.data.enterprise.isVendor !== 313) {
           this.setRemindText('请先前往pc端完善企业信息')
           this.setRemindText('请先前往pc端完善企业信息')
         } else {
         } else {

+ 10 - 12
pages/mobile/user/storeinfo.vue

@@ -231,19 +231,17 @@
         this.timeoutCount++
         this.timeoutCount++
       },
       },
       updateInfo() {
       updateInfo() {
-        // if (!this.isAdmin) {
-        //   this.setRemindText('您无该模块的编辑权限,请联系企业管理员进行编辑维护!')
-        //   return
-        // }
-        this.storeState = 'update'
-        this.Islook = true
-        this.hidelook = true
-        this.IsEnlook = true
-        this.hideEnlook = true
-        this.setTextareaHeight()
-        this.setApplicationTextareaHeight()
-        this.setEnTextareaHeight()
+        this.authorityInterceptor('/store-service/stores/*', () => {
+          this.storeState = 'update'
+          this.Islook = true
+          this.hidelook = true
+          this.IsEnlook = true
+          this.hideEnlook = true
+          this.setTextareaHeight()
+          this.setApplicationTextareaHeight()
+          this.setEnTextareaHeight()
 //        this.setAddarea()
 //        this.setAddarea()
+        })
       },
       },
       dealWithText2(tp) {
       dealWithText2(tp) {
         if (tp === 'open') {
         if (tp === 'open') {

BIN
static/images/mobile/user/apply-store.png