Răsfoiți Sursa

店铺样式

panhui 4 ani în urmă
părinte
comite
9a0711300a

+ 1 - 1
src/components/NavHeader.vue

@@ -1,6 +1,7 @@
 <template>
     <div
         class="header"
+        style="height:44px"
         :style="{ paddingTop: systemInfo.statusBarHeight + 'px', color: fontColor, backgroundColor: bgColor }"
     >
         <van-icon name="arrow-left" :size="24" :color="fontColor" @click="navigateBack" />
@@ -63,7 +64,6 @@ export default {
     left: 0;
     right: 0;
     position: fixed;
-    height: 44px;
     z-index: 20;
     transition: all ease-in-out 0.3s;
     padding: 0 15px;

+ 3 - 1
src/mixins/store.js

@@ -18,7 +18,9 @@ export default {
             return '';
         },
         storeLogo() {
-            return this.storeInfo.logo || '/native/imgs/defaultLogo.png';
+            return this.storeInfo.logo
+                ? this.storeInfo.logo + '?x-oss-process=image/circle,r_300/format,png'
+                : '/native/imgs/defaultLogo.png';
         }
     }
 };

+ 4 - 2
src/pages/store/homePage.vue

@@ -28,7 +28,7 @@
             </div>
         </div>
         <div class="list">
-            <van-sticky :offset-top="systemInfo.statusBarHeight + 44">
+            <van-sticky :offset-top="offsetTop">
                 <div class="list-header">
                     <div class="col-3">
                         <van-dropdown-menu>
@@ -87,7 +87,8 @@ export default {
             list: [],
             empty: false,
             finish: false,
-            isMineShop: false
+            isMineShop: false,
+            offsetTop: 0
         };
     },
     computed: {
@@ -104,6 +105,7 @@ export default {
             this.getStore().then(res => {
                 this.storeInfo = res;
                 this.getData();
+                this.offsetTop = this.systemInfo.statusBarHeight + 44;
             });
         },
         getStore() {

+ 5 - 26
src/pages/store/setting.vue

@@ -7,16 +7,10 @@
     <div>
         <van-cell-group :border="false">
             <van-cell title="LOGO" is-link @click="changeLogo" class="avatar">
-                <van-image
-                    round
-                    width="36"
-                    height="36"
-                    :src="storeInfo ? storeInfo.logo : '/native/svgs/img_defaultphoto.svg'"
-                    fit="cover"
-                />
+                <van-image round width="36" height="36" :src="storeLogo" fit="cover" />
             </van-cell>
             <van-cell title="店铺名称" @click="goChange" :value="storeInfo ? storeInfo.storeName : ''" is-link />
-            <van-cell title="店铺地区" is-link :class="{ not: !city }" @click="$refs.area.init()">
+            <van-cell title="店铺地区" :border="false" is-link :class="{ not: !city }" @click="$refs.area.init()">
                 <span>{{ city || '未设置' }}</span>
             </van-cell>
         </van-cell-group>
@@ -28,28 +22,13 @@
 <script>
 import { mapState } from 'vuex';
 import areaSelect from '../../components/areaSelect.vue';
+import store from '../../mixins/store';
 export default {
     components: { areaSelect },
+    mixins: [store],
     name: 'Setting',
-    data() {
-        return {
-            storeInfo: {}
-        };
-    },
     computed: {
-        ...mapState(['userStoreInfo']),
-        city() {
-            if (this.userStoreInfo) {
-                if (/[\u4e00-\u9fa5]/.test(this.userStoreInfo.city)) {
-                    let province = this.userStoreInfo.province.replace(/省/, '');
-                    province = province.replace(/自治区/, '');
-                    let city = this.userStoreInfo.city.replace(/市/, '');
-                    return province + ' ' + city;
-                }
-            }
-
-            return '';
-        }
+        ...mapState(['userStoreInfo'])
     },
     watch: {
         userStoreInfo() {