Bladeren bron

[formart]

x 5 jaren geleden
bovenliggende
commit
a7481a82df

File diff suppressed because it is too large
+ 0 - 0
src/assets/addfont/addfont.js


+ 41 - 23
src/components/GoodItem.vue

@@ -1,41 +1,59 @@
 <template>
-    <div >
-      <div v-if="isVip">
-        <div class="money font-color-red">
-            <span class="iconfont icon-huiyuan" style="font-size: 0.3rem"></span><span class="num" style="font-size: 0.3rem"> ¥ {{ item.vip_price }}</span>
-        </div>
-        <div class="num" style="height: 0.4rem; font-size: 0.3rem"><span class="addfont icon-Icon-gou font-color-red" style="font-size: 0.3rem"></span> ¥ {{ item.price }}</div>
-        <div class="num font-color-green" style="height: 0.4rem; font-size: 0.3rem"><span class="addfont icon-Icon-zhuan font-color-red" style="font-size: 0.3rem"></span> ¥ {{ getPrice() }}</div>
+  <div>
+    <div v-if="isVip">
+      <div class="money font-color-red">
+        <span class="iconfont icon-huiyuan" style="font-size: 0.3rem"></span
+        ><span class="num" style="font-size: 0.3rem">
+          ¥ {{ item.vip_price }}</span
+        >
       </div>
-      <div v-else>
-          <div class="money font-color-red">
-            ¥<span class="num">{{ item.price }}</span>
-          </div>
-          <div class="ot-money" style="text-decoration:line-through;">¥{{ item.ot_price }}</div>
+      <div class="num" style="height: 0.4rem; font-size: 0.3rem">
+        <span
+          class="addfont icon-Icon-gou font-color-red"
+          style="font-size: 0.3rem"
+        ></span>
+        ¥ {{ item.price }}
+      </div>
+      <div
+        class="num font-color-green"
+        style="height: 0.4rem; font-size: 0.3rem"
+      >
+        <span
+          class="addfont icon-Icon-zhuan font-color-red"
+          style="font-size: 0.3rem"
+        ></span>
+        ¥ {{ getPrice() }}
       </div>
     </div>
+    <div v-else>
+      <div class="money font-color-red">
+        ¥<span class="num">{{ item.price }}</span>
+      </div>
+      <div class="ot-money" style="text-decoration:line-through;">
+        ¥{{ item.ot_price }}
+      </div>
+    </div>
+  </div>
 </template>
 
 <script>
 export default {
   name: "GoodItem",
   props: {
-      item: {},
-      isVip: false,
+    item: {},
+    isVip: false
   },
   data: function() {
-    return {
-    };
-  },
-  mounted: function() {
+    return {};
   },
+  mounted: function() {},
 
   methods: {
-      getPrice () {
-          var price = Number(this.item.price);
-          var vip_price = Number(this.item.vip_price);
-          return (price - vip_price).toFixed(2);
-      }
+    getPrice() {
+      var price = Number(this.item.price);
+      var vip_price = Number(this.item.vip_price);
+      return (price - vip_price).toFixed(2);
+    }
   }
 };
 </script>

+ 5 - 5
src/components/GoodList.vue

@@ -30,7 +30,7 @@
           <!-- <div class="money font-color-red">
             ¥<span class="num">{{ item.price }}</span>
           </div> -->
-          <GoodItem :item = item :isVip = isVip></GoodItem>
+          <GoodItem :item="item" :isVip="isVip"></GoodItem>
           <div class="vip-money acea-row row-middle">
             <span class="num">已售{{ item.sales }}{{ item.unit_name }}</span>
           </div>
@@ -66,22 +66,22 @@ export default {
       isVip: false
     };
   },
-  mounted: function () {
+  mounted: function() {
     this.updateVIP();
   },
   methods: {
-    updateVIP () {
+    updateVIP() {
       var userinfo = this.$store.state.app.userInfo;
       if (this.$store.state.app.token) {
         getUserInfo().then(res => {
           userinfo = res.data;
           this.isVip = userinfo.vip_level > 0;
-          console.log('Current VIP:', userinfo.vip_level);
+          console.log("Current VIP:", userinfo.vip_level);
         });
         return;
       }
       this.isVip = false;
-      console.log('Current is not Login');
+      console.log("Current is not Login");
     },
     // 商品详情跳转
     goDetails(item) {

+ 4 - 4
src/components/Recommend.vue

@@ -31,7 +31,7 @@
           >
         </div>
         <div class="name line1">{{ item.store_name }}</div>
-        <GoodItem :item = item :isVip = isVip></GoodItem>
+        <GoodItem :item="item" :isVip="isVip"></GoodItem>
       </div>
     </div>
     <Loading :loaded="loadend" :loading="loading"></Loading>
@@ -70,18 +70,18 @@ export default {
     this.updateVIP();
   },
   methods: {
-    updateVIP () {
+    updateVIP() {
       var userinfo = this.$store.state.app.userInfo;
       if (this.$store.state.app.token) {
         getUserInfo().then(res => {
           userinfo = res.data;
           this.isVip = userinfo.vip_level > 0;
-          console.log('Current VIP:', userinfo.vip_level);
+          console.log("Current VIP:", userinfo.vip_level);
         });
         return;
       }
       this.isVip = false;
-      console.log('Current is not Login');
+      console.log("Current is not Login");
     },
     // 商品详情跳转
     goDetail(item) {

+ 6 - 3
src/libs/jpush.js

@@ -1,3 +1,4 @@
+/* eslint-disable */ 
 const JPush = {
   init: function(callback) {
     try {
@@ -13,10 +14,12 @@ const JPush = {
         console.log("JPush is not defined !");
       }
 
-      document.addEventListener("jpush.openNotification", function (event) {
+      document.addEventListener("jpush.openNotification", function (event){
         console.log("open jpush message !");
-        if(callback != null) callback(event.extras);
-      }, false)
+        if (callback != null) callback(event.extras);
+        },
+        false
+      );
     } catch (exception) {
       console.log("Jpsuh init faield ! exception: ", exception);
     }

+ 1 - 0
src/libs/pay.js

@@ -1,3 +1,4 @@
+/* eslint-disable */ 
 var wechat_installed = false;
 
 const WeChat = {

+ 8 - 2
src/router/index.js

@@ -20,6 +20,7 @@ const router = new Router({
       path: "/",
       name: "Index",
       meta: {
+        idx: 0,
         title: "首页",
         keepAlive: true,
         footer: true,
@@ -43,10 +44,10 @@ const router = new Router({
       meta: {
         title: "产品分类",
         keepAlive: true,
-        // footer: true,
+        footer: true,
         backgroundColor: "#fff"
       },
-      component: Category
+      component: Index
     },
     {
       path: "/collection",
@@ -121,6 +122,7 @@ const router = new Router({
       path: "/hot_new_goods/:type",
       name: "HotNewGoods",
       meta: {
+        idx: 4,
         title: "热门榜单",
         keepAlive: false
       },
@@ -148,6 +150,7 @@ const router = new Router({
       path: "/cart",
       name: "ShoppingCart",
       meta: {
+        idx: 3,
         title: "购物车",
         keepAlive: true,
         footer: true,
@@ -159,6 +162,7 @@ const router = new Router({
       path: "/goods_list",
       name: "GoodsList",
       meta: {
+        idx: 4,
         title: "商品列表",
         keepAlive: true
       },
@@ -168,6 +172,7 @@ const router = new Router({
       path: "/register",
       name: "Register",
       meta: {
+        idx: 9,
         title: "注册",
         keepAlive: true
       },
@@ -200,6 +205,7 @@ const router = new Router({
       path: "/login",
       name: "Login",
       meta: {
+        idx: 9,
         title: "登录",
         keepAlive: true
       },

+ 13 - 3
src/router/module/activity.js

@@ -35,15 +35,25 @@ export default [
     },
     component: () => import("@views/activity/GoodsBargain.vue")
   },
+  // {
+  //   path: "/activity/bargain/record",
+  //   name: "BargainRecord",
+  //   meta: {
+  //     title: "砍价记录",
+  //     keepAlive: true,
+  //     auth: true
+  //   },
+  //   component: () => import("@views/activity/BargainRecord.vue")
+  // },
   {
     path: "/activity/bargain/record",
-    name: "BargainRecord",
+    name: "Message",
     meta: {
-      title: "砍价记录",
+      title: "消息中心",
       keepAlive: true,
       auth: true
     },
-    component: () => import("@views/activity/BargainRecord.vue")
+    component: () => import("@views/user/Message.vue")
   },
   {
     path: "/activity/group",

+ 2 - 0
src/router/module/user.js

@@ -5,6 +5,7 @@ export default [
     path: "/user",
     name: "User",
     meta: {
+      idx: 4,
       title: "个人中心",
       keepAlive: true,
       footer: true,
@@ -37,6 +38,7 @@ export default [
     path: "/user/account",
     name: "UserAccount",
     meta: {
+      idx: 2,
       title: "我的账户",
       keepAlive: true,
       auth: true,

+ 38 - 24
src/views/home/Index.vue

@@ -61,21 +61,32 @@
                 <div class="pictrue"><img v-lazy="item.pic" alt="img" /></div>
                 <div>{{ item.name }}</div>
               </router-link>
-              
-              <router-link v-if="isVip"
+
+              <router-link
+                v-if="isVip"
                 to="/goods_list?id=53"
                 class="item"
                 :key="index"
               >
-                <div class="pictrue"><img v-lazy="'http://datong.crmeb.net/public/uploads/attach/2019/03/29/5c9ddccecb7f3.png'" alt="img" /></div>
+                <div class="pictrue">
+                  <img
+                    v-lazy="
+                      'http://datong.crmeb.net/public/uploads/attach/2019/03/29/5c9ddccecb7f3.png'
+                    "
+                    alt="img"
+                  />
+                </div>
                 <div>会员专区</div>
               </router-link>
-              <router-link v-else
-                to="/user/integral"
-                class="item"
-                :key="index"
-              >
-                <div class="pictrue"><img v-lazy="'http://datong.crmeb.net/public/uploads/attach/2019/03/29/5c9ddccecb7f3.png'" alt="img" /></div>
+              <router-link v-else to="/user/integral" class="item" :key="index">
+                <div class="pictrue">
+                  <img
+                    v-lazy="
+                      'http://datong.crmeb.net/public/uploads/attach/2019/03/29/5c9ddccecb7f3.png'
+                    "
+                    alt="img"
+                  />
+                </div>
                 <div>积分中心</div>
               </router-link>
             </div>
@@ -336,7 +347,9 @@
                   <div v-if="index === avtiveIndex">
                     <div class="name line1">{{ item.store_name }}</div>
                     <div class="money font-color-red">
-                      ¥<span class="num">{{ isVip ? item.vip_price : item.price }}</span>
+                      ¥<span class="num">{{
+                        isVip ? item.vip_price : item.price
+                      }}</span>
                     </div>
                   </div>
                 </div>
@@ -403,7 +416,7 @@
                   <div class="text">
                     <div class="name line1">{{ item.store_name }}</div>
                     <div class="acea-row row-between-wrapper">
-                      <GoodItem :item = item :isVip = isVip></GoodItem>
+                      <GoodItem :item="item" :isVip="isVip"></GoodItem>
                       <div class="cart acea-row row-center-wrapper">
                         <span class="iconfont icon-mzshopping"></span>
                       </div>
@@ -446,7 +459,7 @@
                   </div>
                   <div class="text">
                     <div class="name line1">{{ item.store_name }}</div>
-                    <GoodItem :item = item :isVip = isVip></GoodItem>
+                    <GoodItem :item="item" :isVip="isVip"></GoodItem>
                   </div>
                 </router-link>
               </div>
@@ -527,7 +540,7 @@
                   <div class="text">
                     <div class="name line1">{{ item.store_name }}</div>
                     <div class="acea-row row-between-wrapper">
-                      <GoodItem :item = item :isVip = isVip></GoodItem>
+                      <GoodItem :item="item" :isVip="isVip"></GoodItem>
                       <div class="cart acea-row row-center-wrapper">
                         <span class="iconfont icon-mzshopping"></span>
                       </div>
@@ -597,7 +610,7 @@
                 </div>
                 <div class="text">
                   <div class="name line1">{{ productItem.store_name }}</div>
-                  <GoodItem :item = productItem :isVip = isVip></GoodItem>
+                  <GoodItem :item="productItem" :isVip="isVip"></GoodItem>
                   <div class="acea-row row-between-wrapper">
                     <div class="sales">已售{{ productItem.sales }}件</div>
                   </div>
@@ -615,7 +628,8 @@
                 <img src="@assets/images/noGood.png" class="image" />
               </div>
             </div>
-            <Recommend isVip = isVip
+            <Recommend
+              isVip="isVip"
               v-if="productList.length === 0 && where.page > 1"
             ></Recommend>
           </div>
@@ -667,7 +681,7 @@ import debounce from "lodash.debounce";
 import { goShopDetail } from "@libs/order";
 import JPush from "@libs/jpush";
 import WeChat from "@libs/pay";
-import GoodItem from "@components/GoodItem"
+import GoodItem from "@components/GoodItem";
 import { getQueryVariable } from "../../utils";
 const HAS_COUPON_WINDOW = "has_coupon_window";
 const LONGITUDE = "user_longitude";
@@ -848,11 +862,11 @@ export default {
       if (to === 0) {
         this.tapActive = 0;
         this.swiper.autoplay.start();
-        if(this.mySwiper != null) this.newSwiper.autoplay.start();
+        if (this.mySwiper != null) this.newSwiper.autoplay.start();
         this.recommendSwiper.autoplay.start();
       } else {
         this.swiper.autoplay.stop();
-        if(this.mySwiper != null) this.newSwiper.autoplay.stop();
+        if (this.mySwiper != null) this.newSwiper.autoplay.stop();
         this.recommendSwiper.autoplay.stop();
       }
     },
@@ -863,11 +877,11 @@ export default {
         this.getHomeData();
         this.hostProducts();
         this.swiper.autoplay.start();
-        if(this.mySwiper != null) this.newSwiper.autoplay.start();
+        if (this.mySwiper != null) this.newSwiper.autoplay.start();
         this.recommendSwiper.autoplay.start();
       } else {
         this.swiper.autoplay.stop();
-        if(this.mySwiper != null) this.newSwiper.autoplay.stop();
+        if (this.mySwiper != null) this.newSwiper.autoplay.stop();
         this.recommendSwiper.autoplay.stop();
       }
     }
@@ -900,18 +914,18 @@ export default {
     }
   },
   methods: {
-    updateVIP () {
+    updateVIP() {
       var userinfo = this.$store.state.app.userInfo;
       if (this.$store.state.app.token) {
         getUserInfo().then(res => {
           userinfo = res.data;
           this.isVip = userinfo.vip_level > 0;
-          console.log('Current VIP:', userinfo.vip_level);
+          console.log("Current VIP:", userinfo.vip_level);
         });
         return;
       }
       this.isVip = false;
-      console.log('Current is not Login');
+      console.log("Current is not Login");
     },
     closeFollow() {
       this.followHid = false;
@@ -1117,7 +1131,7 @@ export default {
       }
     },
     productTap: function(index) {
-      if (index === 0) { 
+      if (index === 0) {
         return;
       }
       let that = this;

+ 45 - 14
src/views/shop/GoodsCon.vue

@@ -31,7 +31,9 @@
       <div class="wrapper">
         <div class="share acea-row row-between row-bottom">
           <div class="money font-color-red">
-            ¥<span class="num">{{ isVip ? storeInfo.vip_price : storeInfo.price }}</span>
+            ¥<span class="num">{{
+              isVip ? storeInfo.vip_price : storeInfo.price
+            }}</span>
             <!-- <span
               class="vip-money"
               v-if="storeInfo.vip_price && storeInfo.vip_price > 0"
@@ -42,11 +44,16 @@
               v-if="storeInfo.vip_price && storeInfo.vip_price > 0"
             /> -->
           </div>
-          <div v-if="isVip"
+          <div
+            v-if="isVip"
             @click="listenerActionSheet"
             class="font-color-green"
-          >分享赚¥{{ (storeInfo.price - storeInfo.vip_price).toFixed(2) }}<span class="iconfont icon-fenxiang"></span></div>
-          <div v-else
+          >
+            分享赚¥{{ (storeInfo.price - storeInfo.vip_price).toFixed(2)
+            }}<span class="iconfont icon-fenxiang"></span>
+          </div>
+          <div
+            v-else
             class="iconfont icon-fenxiang"
             @click="listenerActionSheet"
           ></div>
@@ -724,18 +731,18 @@ export default {
     this.updateVIP();
   },
   methods: {
-    updateVIP () {
+    updateVIP() {
       var userinfo = this.$store.state.app.userInfo;
       if (this.$store.state.app.token) {
         getUserInfo().then(res => {
           userinfo = res.data;
           this.isVip = userinfo.vip_level > 0;
-          console.log('Current VIP:', userinfo.vip_level);
+          console.log("Current VIP:", userinfo.vip_level);
         });
         return;
       }
       this.isVip = false;
-      console.log('Current is not Login');
+      console.log("Current is not Login");
     },
     // 商品详情跳转
     goDetail(item) {
@@ -960,7 +967,9 @@ export default {
         function(success) {
           if (success) console.log("share success !");
           else console.log("share falied !");
-        }, false);
+        },
+        false
+      );
     },
     //产品详情接口;
     productCon: function() {
@@ -984,7 +993,9 @@ export default {
             that.posterData.title = that.storeInfo.store_name;
           }
           that.storeSelfMention = res.data.store_self_mention ? true : false;
-          that.posterData.price = that.isVip ? that.storeInfo.vip_price : that.storeInfo.price;
+          that.posterData.price = that.isVip
+            ? that.storeInfo.vip_price
+            : that.storeInfo.price;
           that.posterData.code = that.storeInfo.code_base;
           that.system_store = res.data.system_store || {};
           let good_list = res.data.good_list || [];
@@ -1046,7 +1057,11 @@ export default {
           this.storeInfo.store_name
         );
         this.$set(this.attr.productSelect, "image", productSelect.image);
-        this.$set(this.attr.productSelect, "price", this.isVip ? productSelect.vip_price : productSelect.price);
+        this.$set(
+          this.attr.productSelect,
+          "price",
+          this.isVip ? productSelect.vip_price : productSelect.price
+        );
         this.$set(this.attr.productSelect, "stock", productSelect.stock);
         this.$set(this.attr.productSelect, "unique", productSelect.unique);
         this.$set(this.attr.productSelect, "cart_num", 1);
@@ -1059,7 +1074,11 @@ export default {
           this.storeInfo.store_name
         );
         this.$set(this.attr.productSelect, "image", this.storeInfo.image);
-        this.$set(this.attr.productSelect, "price", this.isVip ? this.storeInfo.vip_price : this.storeInfo.price);
+        this.$set(
+          this.attr.productSelect,
+          "price",
+          this.isVip ? this.storeInfo.vip_price : this.storeInfo.price
+        );
         this.$set(this.attr.productSelect, "stock", 0);
         this.$set(this.attr.productSelect, "unique", "");
         this.$set(this.attr.productSelect, "cart_num", 0);
@@ -1072,7 +1091,11 @@ export default {
           this.storeInfo.store_name
         );
         this.$set(this.attr.productSelect, "image", this.storeInfo.image);
-        this.$set(this.attr.productSelect, "price", this.isVip ? this.storeInfo.vip_price : this.storeInfo.price);
+        this.$set(
+          this.attr.productSelect,
+          "price",
+          this.isVip ? this.storeInfo.vip_price : this.storeInfo.price
+        );
         this.$set(this.attr.productSelect, "stock", this.storeInfo.stock);
         this.$set(
           this.attr.productSelect,
@@ -1155,7 +1178,11 @@ export default {
       let productSelect = this.productValue[res];
       if (productSelect) {
         this.$set(this.attr.productSelect, "image", productSelect.image);
-        this.$set(this.attr.productSelect, "price", this.isVip ? productSelect.vip_price : productSelect.price);
+        this.$set(
+          this.attr.productSelect,
+          "price",
+          this.isVip ? productSelect.vip_price : productSelect.price
+        );
         this.$set(this.attr.productSelect, "stock", productSelect.stock);
         this.$set(this.attr.productSelect, "unique", productSelect.unique);
         this.$set(this.attr.productSelect, "cart_num", 1);
@@ -1163,7 +1190,11 @@ export default {
         this.$set(this, "attrTxt", "已选择");
       } else {
         this.$set(this.attr.productSelect, "image", this.storeInfo.image);
-        this.$set(this.attr.productSelect, "price", this.isVip ? this.storeInfo.vip_price : this.storeInfo.price);
+        this.$set(
+          this.attr.productSelect,
+          "price",
+          this.isVip ? this.storeInfo.vip_price : this.storeInfo.price
+        );
         this.$set(this.attr.productSelect, "stock", 0);
         this.$set(this.attr.productSelect, "unique", "");
         this.$set(this.attr.productSelect, "cart_num", 0);

+ 4 - 4
src/views/shop/GoodsList.vue

@@ -189,18 +189,18 @@ export default {
     });
   },
   methods: {
-    updateVIP () {
+    updateVIP() {
       var userinfo = this.$store.state.app.userInfo;
       if (this.$store.state.app.token) {
         getUserInfo().then(res => {
           userinfo = res.data;
           this.isVip = userinfo.vip_level > 0;
-          console.log('Current VIP:', userinfo.vip_level);
+          console.log("Current VIP:", userinfo.vip_level);
         });
         return;
       }
       this.isVip = false;
-      console.log('Current is not Login');
+      console.log("Current is not Login");
     },
     // 商品详情跳转
     goDetail(item) {
@@ -238,7 +238,7 @@ export default {
       switch (index) {
         case 0:
           return;
-          // return that.$router.back();
+        // return that.$router.back();
         case 1:
           if (that.price === 0) that.price = 1;
           else if (that.price === 1) that.price = 2;

+ 1 - 1
src/views/shop/HotNewGoods.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="quality-recommend" ref="container">
-    <NavBar :title="titles[$route.params.type]" ></NavBar>
+    <NavBar :title="titles[$route.params.type]"></NavBar>
     <div class="slider-banner swiper">
       <swiper class="swiper-wrapper" :options="RecommendSwiper">
         <swiperSlide

Some files were not shown because too many files changed in this diff