xuqiang 4 år sedan
förälder
incheckning
2a72f34bc3
1 ändrade filer med 26 tillägg och 0 borttagningar
  1. 26 0
      src/mixins/store.js

+ 26 - 0
src/mixins/store.js

@@ -0,0 +1,26 @@
+export default {
+    data() {
+        return {
+            storeInfo: {}
+        };
+    },
+    computed: {
+        city() {
+            if (this.storeInfo) {
+                if (/[\u4e00-\u9fa5]/.test(this.storeInfo.city)) {
+                    let province = this.storeInfo.province.replace(/省/, '');
+                    province = province.replace(/自治区/, '');
+                    let city = this.storeInfo.city.replace(/市/, '');
+                    return province + ' ' + city;
+                }
+            }
+
+            return '';
+        },
+        storeLogo() {
+            return this.storeInfo.logo
+                ? this.storeInfo.logo + '?x-oss-process=image/circle,r_300/format,png'
+                : '/native/imgs/defaultLogo.png';
+        }
+    }
+};