Browse Source

去掉首页广告轮播,处理我的店铺和店铺管理信息合并

Administrator 7 years ago
parent
commit
e0216dbe1a

+ 10 - 9
components/home/floor/FloorBar.vue

@@ -28,15 +28,16 @@
     },
     methods: {
       _calcaulateHeight() {
-        let _heis0 = document.querySelectorAll('header')[0].clientHeight
-        let _heis1 = document.querySelectorAll('.header.clearfix')[0].clientHeight
-        let _heis2 = document.querySelectorAll('.nav-list')[0].clientHeight
-        let _heis3 = document.querySelectorAll('.carousel')[0].clientHeight
-        let _heis4 = document.querySelectorAll('.advert-slide')[0].clientHeight
-        let _heis5 = document.querySelectorAll('.banner')[0].clientHeight
-        let _heis6 = document.querySelectorAll('.floor.price-floor')[0].clientHeight
-        let _heis7 = document.querySelectorAll('.floor.price-floor')[1].clientHeight
-        this.bannerHeight = _heis0 + _heis1 + _heis2 + _heis3 + _heis4 + _heis5 + _heis6 + _heis7
+        let _heis0 = document.querySelectorAll('header')[0].clientHeight || 0
+        let _heis1 = document.querySelectorAll('.header.clearfix')[0].clientHeight || 0
+        let _heis2 = document.querySelectorAll('.nav-list')[0].clientHeight || 0
+        let _heis3 = document.querySelectorAll('.carousel')[0].clientHeight || 0
+        // let _heis4 = document.querySelectorAll('.advert-slide')[0].clientHeight || 0
+        let _heis5 = document.querySelectorAll('.banner')[0].clientHeight || 0
+        let _heis6 = document.querySelectorAll('.floor.price-floor')[0].clientHeight || 0
+        let _heis7 = document.querySelectorAll('.floor.price-floor')[1].clientHeight || 0
+        this.bannerHeight = _heis0 + _heis1 + _heis2 + _heis3 + _heis5 + _heis6 + _heis7
+        // this.bannerHeight = _heis0 + _heis1 + _heis2 + _heis3 + _heis4 + _heis5 + _heis6 + _heis7
         this.listHeight = []
         this.list = document.querySelectorAll('.normal-floor')
         let height = 0

+ 3 - 3
pages/index.vue

@@ -10,7 +10,7 @@
         <kind-category @loadchild="loadProductKinds"></kind-category>
         <display-card></display-card>
       </carousel>
-      <advert></advert>
+      <!--<advert></advert>-->
       <floor-list></floor-list>
       <img class="banner-img" src="/images/all/banner-home2.jpg" style="margin: 44px auto 24px;" alt="">
       <news></news>
@@ -19,7 +19,7 @@
   </div>
 </template>
 <script>
-  import { KindCategory, displayCard, Carousel, Advert, FloorList, Partner, News } from '~components/home'
+  import { KindCategory, displayCard, Carousel, FloorList, Partner, News } from '~components/home'
 //  import { Christmas, NewYear } from '~components/default'
   import { Home } from '~components/mobile'
   export default {
@@ -65,7 +65,7 @@
       KindCategory,
       displayCard,
       Carousel,
-      Advert,
+      // Advert,
       FloorList,
       Partner,
       News,

+ 5 - 5
pages/mobile/center/vendor/index.vue

@@ -43,18 +43,18 @@
           </nuxt-link>
         </ul>
       </div>
-      <div class="block-wrap collect-block">
-        <div class="content-line" @click="goStore">
+      <!--<div class="block-wrap collect-block">
+       <div class="content-line" @click="goStore">
           <img src="/images/mobile/center/vendor/shop.png" alt="">
           <span>我的店铺</span>
           <i class="iconfont icon-xiangyou"></i>
         </div>
-       <!-- <nuxt-link tag="div" to="/mobile/center/vendor/message"  class="content-line" v-if="user.data.enterprise.uu">
+        <nuxt-link tag="div" to="/mobile/center/vendor/message"  class="content-line" v-if="user.data.enterprise.uu">
           <img src="/images/mobile/center/user/message.png" alt="">
           <span>消息<span class="text">({{messageCount.count || 0}})</span></span>
           <i class="iconfont icon-xiangyou"></i>
-        </nuxt-link>-->
-      </div>
+        </nuxt-link>
+      </div>-->
     </div>
     <remind-box :title="remindText" :timeoutCount="timeoutCount"></remind-box>
   </div>

+ 74 - 5
pages/mobile/user/storeinfo.vue

@@ -13,6 +13,22 @@
           <div class="scroll">
             <div class="si-wrap">
               <ul class="infoul" :class="{'no-edit': !isAdmin}">
+                <li class="clearfix" :class="{border:  storeState !== 'look'}">
+                  <div class="name pull-left" :class="{update: storeState !== 'look'}">店铺LOGO:</div>
+                  <div class="file_logo pull-left">
+                    <div class="file_img">
+                      <img :src="imageUploadUrl ? imageUploadUrl : storeInfo.logoUrl ? storeInfo.logoUrl : '/images/logo/default.png'">
+                    </div>
+                    <div class="file_input" v-if="storeState !== 'look'">
+                      <input type="file"
+                             class="file-input"
+                             name="name"
+                             accept="image/jpeg,image/jpg,image/gif,image/bmp,image/png"
+                             @change="uploadImg"/>
+                      <span>仅支持JPG、PNG、GIF格式,大小不超过500kb,建议使用220*220的图片</span>
+                    </div>
+                  </div>
+                </li>
                 <li class="clearfix" :class="{border:  storeState !== 'look'}">
                   <div class="name pull-left" :class="{update: storeState !== 'look'}">店铺名称:</div>
                   <div class="text pull-left" v-if="storeState === 'look'">
@@ -145,13 +161,14 @@
   export default {
     layout: 'mobileNoHeader',
     middleware: 'authenticated',
-    fetch ({ store, route }) {
+    fetch ({ store }) {
       return Promise.all([
         store.dispatch('loadStoreStatus', { op: 'check' })
       ])
     },
     data() {
       return {
+        imageUploadUrl: '',
         storeState: 'look',
         storeInfo: {},
         splitText: '', // 省略号文本
@@ -188,6 +205,27 @@
 //      }
     },
     methods: {
+      uploadImg (e) {
+        let file = e.target.files[0]
+        if (file && file.size >= 500 * 1025) {
+          this.collectResult = '选择图片过大,请重新选择!'
+          this.timeoutCount++
+          return
+        }
+        if (file) {
+          let param = new FormData()
+          param.append('image', file, file.name)
+          let config = {
+            headers: {'Content-Type': 'multipart/form-data'}
+          }
+          this.$http.post('/api/images', param, config)
+            .then(response => {
+              if (response.data) {
+                this.imageUploadUrl = response.data[0].path
+              }
+            })
+        }
+      },
       setRemindText (str) {
         this.collectResult = str
         this.timeoutCount++
@@ -315,7 +353,8 @@
           enterprise: this.storeInfo.enterprise,
           storeName: this.storeInfo.storeName,
           storeShortName: this.storeInfo.storeShortName,
-          storeApplication: this.storeInfo.storeApplication
+          storeApplication: this.storeInfo.storeApplication,
+          logoUrl: this.imageUploadUrl
         }
         this.$http.put(`/store-service/stores/${this.storeInfo.uuid}?kind=BASIC_INFO`, kay).then(res => {
           this.collectResult = '保存成功'
@@ -449,6 +488,36 @@
     color: #666;
     font-size: 0.28rem;
     padding: 0 .24rem;
+    .file_logo{
+      position:relative;
+      width:4.4rem;
+      .file_img{
+        width:1rem;
+        display:inline-block;
+        img{
+          width:100%;
+          height: 1rem;
+        }
+      }
+      .file_input{
+        position:absolute;
+        top:0;
+        left:0;
+        display:inline-block;
+        vertical-align: top;
+        width:4.4rem;
+        input[type=file] {
+          opacity: 0;
+          width: 1rem;
+          height: 1rem;
+          float: left;
+          margin-right:.15rem;
+        }
+        span{
+          font-size: .14rem;
+        }
+      }
+    }
     .upload {
       img {
         transform: rotate(180deg);
@@ -458,7 +527,7 @@
       border-bottom: .01rem solid #d9d9d9;
       min-height: 1.16rem;
       line-height: normal;
-      padding: .4rem .28rem;
+      padding: .4rem .2rem;
       &.border {
         border-bottom: .01rem solid #d9d9d9;
       }
@@ -468,14 +537,14 @@
       }
     }
     .name {
-      width: 1.6rem;
+      width: 1.8rem;
       text-align: right;
       color: #226ce7;
     }
     &.no-edit {
       color: #999;
       .name {
-        color: #999;
+        color: #226ce7;
       }
     }
     .text {

BIN
static/images/logo/default.png