x пре 5 година
родитељ
комит
d0b53c4486

Разлика између датотеке није приказан због своје велике величине
+ 0 - 2
src/assets/addfont/addfont.css


BIN
src/assets/addfont/addfont.eot


Разлика између датотеке није приказан због своје велике величине
+ 0 - 9
src/assets/addfont/addfont.js


+ 56 - 0
src/assets/addfont/addfont.json

@@ -5,6 +5,62 @@
   "css_prefix_text": "icon-",
   "description": "",
   "glyphs": [
+    {
+      "icon_id": "17674910",
+      "name": "Icon-vip",
+      "font_class": "Icon-vip",
+      "unicode": "e608",
+      "unicode_decimal": 58888
+    },
+    {
+      "icon_id": "17674872",
+      "name": "Icon-zhuan",
+      "font_class": "Icon-zhuan",
+      "unicode": "e606",
+      "unicode_decimal": 58886
+    },
+    {
+      "icon_id": "17674873",
+      "name": "Icon-gou",
+      "font_class": "Icon-gou",
+      "unicode": "e607",
+      "unicode_decimal": 58887
+    },
+    {
+      "icon_id": "730288",
+      "name": "评价",
+      "font_class": "pingjia",
+      "unicode": "e690",
+      "unicode_decimal": 59024
+    },
+    {
+      "icon_id": "1158197",
+      "name": "发货",
+      "font_class": "fahuo",
+      "unicode": "e603",
+      "unicode_decimal": 58883
+    },
+    {
+      "icon_id": "1423883",
+      "name": "收货",
+      "font_class": "shouhuo",
+      "unicode": "e635",
+      "unicode_decimal": 58933
+    },
+    {
+      "icon_id": "3770257",
+      "name": "付款",
+      "font_class": "fukuan",
+      "unicode": "e658",
+      "unicode_decimal": 58968
+    },
+    {
+      "icon_id": "9753780",
+      "name": "售后",
+      "font_class": "shouhou",
+      "unicode": "e695",
+      "unicode_decimal": 59029
+    },
     {
       "icon_id": "5004902",
       "name": "钱包",

Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
src/assets/addfont/addfont.svg


BIN
src/assets/addfont/addfont.ttf


BIN
src/assets/addfont/addfont.woff


BIN
src/assets/addfont/addfont.woff2


+ 3 - 0
src/assets/css/base.css

@@ -5,6 +5,9 @@
 .font-color-red {
   color: #ff3366 !important;
 }
+.font-color-green {
+  color: #4ea74e !important;
+}
 .bg-color-red {
   background-color: #ff1f44 !important;
 }

+ 7 - 2
src/assets/css/style.css

@@ -35,7 +35,7 @@ body{font-size:0.28rem;background-color:#f5f5f5;transition: background-color .3s
 .goodList .item .text .vip-money .vip{margin-right:0.22rem;}
 .goodList .item .text .vip-money .image{width:0.46rem;height:0.21rem;margin-left:0.05rem;}
 .goodList .item .text .vip-money .num{font-size:0.22rem;color:#aaa;font-weight:normal;margin:-0.02rem 0 0 0;}
-.goodList .item .iconfont{position:absolute;right:0.3rem;width:0.5rem;height:0.5rem;border-radius:50%;font-size:0.3rem;bottom:0.38rem;}
+.goodList .item .iconfont.bak{position:absolute;right:0.3rem;width:0.5rem;height:0.5rem;border-radius:50%;font-size:0.3rem;bottom:0.38rem;}
 .promotionGood{padding:0 0.3rem;background-color: #fff;}
 .promotionGood .item{border-bottom:1px solid #eee;height:2.5rem;}
 .promotionGood .item .pictrue{width:1.88rem;height:1.88rem;position: relative;}
@@ -717,7 +717,7 @@ border-radius:2rem;top:-0.1rem;right:0;height:0.3rem;line-height:0.3rem;padding:
 .distribution-posters .keep{font-size:0.3rem;color:#fff;width:6rem;height:0.8rem;border-radius:0.5rem;text-align:center;
     line-height:0.8rem;margin:0.38rem auto;}
 /*会员中心*/
-.member-center .header{background-color:#232323;width:100%;padding:0.5rem 0;}
+.member-center .header{background-color:#fcfcfc;width:100%;padding:0.5rem 0;}
 .member-center .header .slider-banner{height:3.28rem;}
 .member-center .header .slider-banner .swiper-slide{width:6.36rem!important;height:3.28rem;border-radius:0.16rem;
     color:#fff;position:relative;background-repeat:no-repeat;background-size:100% 100%;}
@@ -730,6 +730,9 @@ border-radius:2rem;top:-0.1rem;right:0;height:0.3rem;line-height:0.3rem;padding:
 .member-center .header .slider-banner .swiper-slide img{width:0.89rem;height:1.08rem;display:block;position:absolute;right:0.6rem;}
 .member-center .header .slider-banner .swiper-slide .name{font-size:0.46rem;font-weight:bold;padding:0.33rem 0 0 0.35rem;}
 .member-center .header .slider-banner .swiper-slide .discount{font-size:0.28rem;font-weight:bold;margin:0.02rem 0 0 0.35rem;}
+.member-center .header .slider-banner .swiper-slide .cardNO{font-size:0.4rem;font-weight:bold;padding: 0.2rem 0.2rem;}
+.member-center .header .slider-banner .swiper-slide .spacer{height: 1.6rem;}
+.member-center .header .slider-banner .swiper-slide .date{font-size:0.3rem;padding: 0.2rem 0.2rem;}
 .member-center .header .slider-banner .swiper-slide .discount .iconfont{margin-left:0.1rem;font-size:0.3rem;}
 .member-center .header .slider-banner .swiper-slide .nav{margin-top:0.48rem;}
 .member-center .header .slider-banner .swiper-slide .nav .item{flex:1;-webkit-flex:1;-o-flex:1;-ms-flex:1;text-align:center;
@@ -770,6 +773,8 @@ border-radius:2rem;top:-0.1rem;right:0;height:0.3rem;line-height:0.3rem;padding:
     height:3.5rem;overflow:auto;}
 .member-center .growthValue .pictrue .iconfont{position:absolute;font-size:0.65rem;color:#fff;top:7.75rem;left:50%;
     transform:translateX(-50%);-webkit-transform:translateX(-50%);-ms-transform:translateX(-50%);-moz-transform:translateX(-50%);-o-transform:translateX(-50%);}
+.member-center .wrapper .list .item .but{background-color:#ff1f44; width: 1.5rem; line-height: 0.7rem; color:#fff; border-radius:0.5rem;text-align:center;}
+.member-center .wrapper .list .item .but.on{background-color:#999; width: 1.5rem; line-height: 0.7rem; color:#fff; border-radius:0.5rem;text-align:center; pointer-events: none;}
 /*积分详情*/
 .integral-details .header{background-image:url('../images/integralbg.jpg');background-repeat:no-repeat;
     background-size:100% 100%;width:100%;height:4.6rem;font-size:0.72rem;color:#fff;padding:0.31rem 0 0.45rem 0;

Разлика између датотеке није приказан због своје велике величине
+ 1 - 0
src/assets/iconfont/iconfont.js


+ 1 - 0
src/assets/js/media_750.js

@@ -1,3 +1,4 @@
+/* eslint-disable */ 
 (function flexible(window, document) {
   var docEl = document.documentElement;
   var dpr = window.devicePixelRatio || 1;

+ 43 - 0
src/components/GoodItem.vue

@@ -0,0 +1,43 @@
+<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-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,
+  },
+  data: 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);
+      }
+  }
+};
+</script>
+
+<style></style>

+ 29 - 9
src/components/GoodList.vue

@@ -27,28 +27,30 @@
       <div class="underline">
         <div class="text">
           <div class="line1">{{ item.store_name }}</div>
-          <div class="money font-color-red">
+          <!-- <div class="money font-color-red">
             ¥<span class="num">{{ item.price }}</span>
-          </div>
+          </div> -->
+          <GoodItem :item = item :isVip = isVip></GoodItem>
           <div class="vip-money acea-row row-middle">
-            <div class="vip" v-if="item.vip_price && item.vip_price > 0">
-              ¥{{ item.vip_price || 0
-              }}<img src="@assets/images/vip.png" class="image" />
-            </div>
             <span class="num">已售{{ item.sales }}{{ item.unit_name }}</span>
           </div>
         </div>
       </div>
-      <div
+      <!-- <div
         class="iconfont icon-gouwuche cart-color acea-row row-center-wrapper"
-      ></div>
+      ></div> -->
     </div>
   </div>
 </template>
 <script>
+import { getUserInfo } from "@api/user";
 import { goShopDetail } from "@libs/order";
+import GoodItem from "@components/GoodItem";
 export default {
   name: "GoodList",
+  components: {
+    GoodItem
+  },
   props: {
     goodList: {
       type: Array,
@@ -60,9 +62,27 @@ export default {
     }
   },
   data: function() {
-    return {};
+    return {
+      isVip: false
+    };
+  },
+  mounted: function () {
+    this.updateVIP();
   },
   methods: {
+    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);
+        });
+        return;
+      }
+      this.isVip = false;
+      console.log('Current is not Login');
+    },
     // 商品详情跳转
     goDetails(item) {
       goShopDetail(item).then(() => {

+ 2 - 2
src/components/NavBar.vue

@@ -11,7 +11,7 @@
         <div
           class="iconfont icon-xiangzuo"
           style="color: #FFFFFF; font-size: 0.35rem; padding-left: 10px;"
-          @click="returns"
+          @click="$router.back()"
         ></div>
         <div
           style="color: #FFFFFF; font-weight: 400; flex: auto; text-align: center; padding-right: 30px;"
@@ -35,7 +35,7 @@ export default {
       titles: ""
     };
   },
-  mounted: function() {
+  created: function() {
     if (this.title == undefined) {
       this.titles = this.$route.meta.title;
     } else {

+ 22 - 5
src/components/Recommend.vue

@@ -31,23 +31,24 @@
           >
         </div>
         <div class="name line1">{{ item.store_name }}</div>
-        <div class="money font-color-red">
-          ¥<span class="num">{{ item.price }}</span>
-        </div>
+        <GoodItem :item = item :isVip = isVip></GoodItem>
       </div>
     </div>
     <Loading :loaded="loadend" :loading="loading"></Loading>
   </div>
 </template>
 <script>
+import { getUserInfo } from "@api/user";
 import { getHostProducts } from "@api/store";
 import Loading from "@components/Loading";
 import { goShopDetail } from "@libs/order";
+import GoodItem from "@components/GoodItem";
 export default {
   name: "Recommend",
   props: {},
   components: {
-    Loading
+    Loading,
+    GoodItem
   },
   data: function() {
     return {
@@ -56,7 +57,8 @@ export default {
       limit: 20,
       loadTitle: "",
       loading: false,
-      loadend: false
+      loadend: false,
+      isVip: false
     };
   },
   mounted: function() {
@@ -64,8 +66,23 @@ export default {
     this.$scroll(this.$refs.container.parentElement, () => {
       !this.loading && this.hostProducts();
     });
+
+    this.updateVIP();
   },
   methods: {
+    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);
+        });
+        return;
+      }
+      this.isVip = false;
+      console.log('Current is not Login');
+    },
     // 商品详情跳转
     goDetail(item) {
       goShopDetail(item).then(() => {

+ 85 - 72
src/views/home/Index.vue

@@ -1,7 +1,7 @@
 <template>
   <div v-cloak ref="container">
     <div class="indexs" v-if="status === 200">
-      <div
+      <!-- <div
         class="follow acea-row row-between-wrapper"
         v-if="followHid && isWeixin"
       >
@@ -14,7 +14,7 @@
       <div class="followCode" v-if="followCode">
         <div class="pictrue"><img :src="followUrl" /></div>
         <div class="mask" @click="closeFollowCode"></div>
-      </div>
+      </div> -->
       <div class="header acea-row row-center-wrapper" ref="header">
         <div class="logo"><img :src="logoUrl" v-if="logoUrl" /></div>
         <router-link :to="'/search'" class="search acea-row row-middle">
@@ -30,7 +30,7 @@
         v-model="tapActive"
         class="tabs"
         sticky
-        @click="categoryTap"
+        @click="productTap"
       >
         <Tab>
           <div slot="title" ref="title">精选</div>
@@ -61,6 +61,23 @@
                 <div class="pictrue"><img v-lazy="item.pic" alt="img" /></div>
                 <div>{{ item.name }}</div>
               </router-link>
+              
+              <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>会员专区</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>
+                <div>积分中心</div>
+              </router-link>
             </div>
             <div class="scroll-coupon" v-if="getCouponList.length">
               <swiper :options="swiperScroll">
@@ -291,7 +308,7 @@
                     v-for="(item, index) in info.firstList"
                     :key="index"
                   >
-                    <div class="item">
+                    <div class="item" @click="goDetails(item)">
                       <img :src="item.image" />
                       <span
                         class="pictrue_log_big pictrue_log_class"
@@ -319,7 +336,7 @@
                   <div v-if="index === avtiveIndex">
                     <div class="name line1">{{ item.store_name }}</div>
                     <div class="money font-color-red">
-                      ¥<span class="num">{{ item.price }}</span>
+                      ¥<span class="num">{{ isVip ? item.vip_price : item.price }}</span>
                     </div>
                   </div>
                 </div>
@@ -386,12 +403,7 @@
                   <div class="text">
                     <div class="name line1">{{ item.store_name }}</div>
                     <div class="acea-row row-between-wrapper">
-                      <div>
-                        <div class="money font-color-red">
-                          ¥<span class="num">{{ item.price }}</span>
-                        </div>
-                        <div class="ot-money">¥{{ item.ot_price }}</div>
-                      </div>
+                      <GoodItem :item = item :isVip = isVip></GoodItem>
                       <div class="cart acea-row row-center-wrapper">
                         <span class="iconfont icon-mzshopping"></span>
                       </div>
@@ -434,15 +446,12 @@
                   </div>
                   <div class="text">
                     <div class="name line1">{{ item.store_name }}</div>
-                    <div class="money font-color-red">
-                      ¥<span class="num">{{ item.price }}</span
-                      ><span class="ot-money">¥{{ item.ot_price }}</span>
-                    </div>
+                    <GoodItem :item = item :isVip = isVip></GoodItem>
                   </div>
                 </router-link>
               </div>
             </div>
-            <div class="promotion" v-if="benefit.length">
+            <!-- <div class="promotion" v-if="benefit.length">
               <div class="publicTitle acea-row row-center-wrapper">
                 <img src="@assets/images/promotionTitle.png" />
                 <router-link :to="'/promotion'" class="more"
@@ -477,15 +486,7 @@
                   <div class="text">
                     <div class="name line1">{{ item.store_name }}</div>
                     <div class="acea-row row-between-wrapper">
-                      <div>
-                        <div
-                          class="money font-color-red acea-row row-between-wrapper"
-                        >
-                          ¥<span class="num">{{ item.price }}</span
-                          ><span class="label bg-color-red">疯抢</span>
-                        </div>
-                        <div class="ot-money">¥{{ item.ot_price }}</div>
-                      </div>
+                      <GoodItem :item = item :isVip = isVip></GoodItem>
                       <div class="cart acea-row row-center-wrapper">
                         <span class="iconfont icon-mzshopping"></span>
                       </div>
@@ -493,7 +494,7 @@
                   </div>
                 </div>
               </div>
-            </div>
+            </div> -->
             <div class="recommend" v-if="hostProduct.length">
               <div class="title">
                 <img src="@assets/images/becommendTitle.png" />
@@ -526,12 +527,7 @@
                   <div class="text">
                     <div class="name line1">{{ item.store_name }}</div>
                     <div class="acea-row row-between-wrapper">
-                      <div>
-                        <div class="money font-color-red">
-                          ¥<span class="num">{{ item.price }}</span>
-                        </div>
-                        <div class="ot-money">¥{{ item.ot_price }}</div>
-                      </div>
+                      <GoodItem :item = item :isVip = isVip></GoodItem>
                       <div class="cart acea-row row-center-wrapper">
                         <span class="iconfont icon-mzshopping"></span>
                       </div>
@@ -544,16 +540,13 @@
           </div>
         </Tab>
         <Tab
-          v-for="(item, index) in categoryOne"
+          v-for="(item, index) in categorySub"
           :title="item.cate_name"
           :key="index"
         >
           <div class="wrapper">
-            <div
-              class="scroll-classify acea-row row-middle"
-              v-if="item.children.length"
-            >
-              <swiper :options="classifyScroll">
+            <div class="scroll-classify acea-row row-middle" v-if="item.length">
+              <!--<swiper :options="classifyScroll">
                 <swiper-slide
                   v-for="(itemn, indexn) in item.children"
                   :key="indexn"
@@ -569,7 +562,7 @@
                     <div class="name line1">{{ itemn.cate_name }}</div>
                   </div>
                 </swiper-slide>
-              </swiper>
+              </swiper> -->
             </div>
             <div class="classifyList acea-row row-between-wrapper">
               <div
@@ -604,17 +597,8 @@
                 </div>
                 <div class="text">
                   <div class="name line1">{{ productItem.store_name }}</div>
-                  <div class="money font-color-red">
-                    ¥<span class="num">{{ productItem.price }}</span>
-                  </div>
+                  <GoodItem :item = productItem :isVip = isVip></GoodItem>
                   <div class="acea-row row-between-wrapper">
-                    <div
-                      class="vipMoney"
-                      v-if="productItem.vip_price && productItem.vip_price > 0"
-                    >
-                      ¥{{ productItem.vip_price
-                      }}<img src="@assets/images/vip.png" />
-                    </div>
                     <div class="sales">已售{{ productItem.sales }}件</div>
                   </div>
                 </div>
@@ -631,7 +615,7 @@
                 <img src="@assets/images/noGood.png" class="image" />
               </div>
             </div>
-            <Recommend
+            <Recommend isVip = isVip
               v-if="productList.length === 0 && where.page > 1"
             ></Recommend>
           </div>
@@ -665,6 +649,7 @@
   </div>
 </template>
 <script>
+import { getUserInfo } from "@api/user";
 import { swiper, swiperSlide } from "vue-awesome-swiper";
 import "@assets/css/swiper.min.css";
 import { Tab, Tabs } from "vant";
@@ -682,7 +667,8 @@ import debounce from "lodash.debounce";
 import { goShopDetail } from "@libs/order";
 import JPush from "@libs/jpush";
 import WeChat from "@libs/pay";
-import { getQueryVariable } from '../../utils';
+import GoodItem from "@components/GoodItem"
+import { getQueryVariable } from "../../utils";
 const HAS_COUPON_WINDOW = "has_coupon_window";
 const LONGITUDE = "user_longitude";
 const LATITUDE = "user_latitude";
@@ -696,12 +682,14 @@ export default {
     Tabs,
     CouponWindow,
     Loading,
-    Recommend
+    Recommend,
+    GoodItem
   },
   props: {},
   data: function() {
     let that = this;
     return {
+      isVip: false,
       isWeixin: isWeixin(),
       followUrl: "",
       subscribe: false,
@@ -739,6 +727,7 @@ export default {
       couponList: [],
       showCoupon: false,
       categoryOne: [],
+      categorySub: [],
       categoryActive: 0,
       where: {
         page: 1,
@@ -844,7 +833,11 @@ export default {
       return this.$refs.mySwiper.swiper;
     },
     newSwiper() {
-      return this.$refs.newSwiper.swiper;
+      if (this.$refs.newSwiper != undefined) {
+        return this.$refs.newSwiper.swiper;
+      } else {
+        return null;
+      }
     },
     recommendSwiper() {
       return this.$refs.recommendSwiper.swiper;
@@ -855,39 +848,43 @@ export default {
       if (to === 0) {
         this.tapActive = 0;
         this.swiper.autoplay.start();
-        this.newSwiper.autoplay.start();
+        if(this.mySwiper != null) this.newSwiper.autoplay.start();
         this.recommendSwiper.autoplay.start();
       } else {
         this.swiper.autoplay.stop();
-        this.newSwiper.autoplay.stop();
+        if(this.mySwiper != null) this.newSwiper.autoplay.stop();
         this.recommendSwiper.autoplay.stop();
       }
     },
     $route(n) {
       if (n.name === "Index") {
-        this.getCoupon();
+        // this.getCoupon();
+        this.updateVIP();
+        this.getHomeData();
+        this.hostProducts();
         this.swiper.autoplay.start();
-        this.newSwiper.autoplay.start();
+        if(this.mySwiper != null) this.newSwiper.autoplay.start();
         this.recommendSwiper.autoplay.start();
       } else {
         this.swiper.autoplay.stop();
-        this.newSwiper.autoplay.stop();
+        if(this.mySwiper != null) this.newSwiper.autoplay.stop();
         this.recommendSwiper.autoplay.stop();
       }
     }
   },
   mounted: function() {
     var that = this;
-    var processUri = function (params) {
-      that.$router.push({path: params.uri});
+    var processUri = function(params) {
+      that.$router.push({ path: params.uri });
     };
 
     JPush.init(processUri);
     WeChat.init();
 
-    this.getFollow();
+    this.updateVIP();
+    // this.getFollow();
     this.getHomeData();
-    this.getCoupon();
+    // this.getCoupon();
     this.getSeckillTime();
     this.hostProducts();
     this.getCategoryData();
@@ -896,14 +893,26 @@ export default {
     });
     cookie.get("expires");
 
-    console.log(window.location.href);
-    var uri = getQueryVariable('uri')
-    if(uri != "") {
+    var uri = getQueryVariable("uri");
+    if (uri != "") {
       console.log("get uri: ", uri);
-      this.$router.push({path: uri});
+      this.$router.push({ path: uri });
     }
   },
   methods: {
+    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);
+        });
+        return;
+      }
+      this.isVip = false;
+      console.log('Current is not Login');
+    },
     closeFollow() {
       this.followHid = false;
     },
@@ -970,8 +979,8 @@ export default {
         this.showCoupon =
           !cookie.has(HAS_COUPON_WINDOW) &&
           res.data.couponList.some(coupon => coupon.is_use);
-        if (!cookie.get(LATITUDE) && !cookie.get(LONGITUDE))
-          this.getWXLocation();
+        // if (!cookie.get(LATITUDE) && !cookie.get(LONGITUDE))
+        //   this.getWXLocation();
       });
     },
     getWXLocation() {
@@ -1073,6 +1082,7 @@ export default {
       let that = this;
       getCategory().then(res => {
         that.$set(that, "categoryOne", res.data);
+        that.$set(that, "categorySub", res.data[0].children.slice(0, 3));
       });
     },
     get_product_list: debounce(function() {
@@ -1095,9 +1105,9 @@ export default {
         that.where.page = 1;
         that.loadends = false;
         that.loadings = false;
-        that.where.cid = that.categoryOne[that.tapActive - 1].id;
-        that.where.sid = that.categoryOne[that.tapActive - 1].children.length
-          ? that.categoryOne[that.tapActive - 1].children[0].id
+        that.where.cid = that.categorySub[that.tapActive - 1].id;
+        that.where.sid = that.categorySub[that.tapActive - 1].children.length
+          ? that.categorySub[that.tapActive - 1].children[0].id
           : -1;
         that.categoryActive = 0;
         that.get_product_list();
@@ -1107,13 +1117,16 @@ export default {
       }
     },
     productTap: function(index) {
+      if (index === 0) { 
+        return;
+      }
       let that = this;
       that.categoryActive = index;
       that.$set(that, "productList", []);
       that.where.page = 1;
       that.loadends = false;
       that.loadings = false;
-      that.where.sid = that.categoryOne[that.tapActive - 1].children[index].id;
+      that.where.sid = that.categorySub[index - 1].id;
       that.get_product_list();
       this.$scroll(this.$refs.container, () => {
         !this.loadings && this.get_product_list();

+ 3 - 0
src/views/order/OrderSubmission.vue

@@ -629,6 +629,9 @@ export default {
                   });
                 } else {
                   console.log("pay failed !", ret);
+                  that.$router.replace({
+                    path: "/order/detail/" + data.result.orderId
+                  });
                 }
               });
               break;

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

@@ -8,11 +8,11 @@
       :style="'opacity:' + opacity"
       ref="header"
     >
-      <router-link
-        to="/"
+      <div
+        @click="$router.back()"
         class="iconfont icon-xiangzuo"
         style="color: #000000; font-size: 20px; padding-right: 35px;"
-      ></router-link>
+      ></div>
       <div
         class="item"
         :class="navActive === index ? 'on' : ''"
@@ -31,8 +31,8 @@
       <div class="wrapper">
         <div class="share acea-row row-between row-bottom">
           <div class="money font-color-red">
-            ¥<span class="num">{{ storeInfo.price }}</span
-            ><span
+            ¥<span class="num">{{ isVip ? storeInfo.vip_price : storeInfo.price }}</span>
+            <!-- <span
               class="vip-money"
               v-if="storeInfo.vip_price && storeInfo.vip_price > 0"
               >¥{{ storeInfo.vip_price }}</span
@@ -40,9 +40,13 @@
               src="@assets/images/vip.png"
               class="image"
               v-if="storeInfo.vip_price && storeInfo.vip_price > 0"
-            />
+            /> -->
           </div>
-          <div
+          <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
             class="iconfont icon-fenxiang"
             @click="listenerActionSheet"
           ></div>
@@ -692,7 +696,8 @@ export default {
       opacity: 0,
       storeSelfMention: true,
       storeItems: {},
-      activity: []
+      activity: [],
+      isVip: false
     };
   },
   computed: mapGetters(["isLogin"]),
@@ -716,8 +721,22 @@ export default {
     this.coupons();
     window.addEventListener("scroll", this.handleScroll);
     this.getList();
+    this.updateVIP();
   },
   methods: {
+    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);
+        });
+        return;
+      }
+      this.isVip = false;
+      console.log('Current is not Login');
+    },
     // 商品详情跳转
     goDetail(item) {
       if (item.type === "1") {
@@ -965,7 +984,7 @@ export default {
             that.posterData.title = that.storeInfo.store_name;
           }
           that.storeSelfMention = res.data.store_self_mention ? true : false;
-          that.posterData.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 || [];
@@ -1027,7 +1046,7 @@ export default {
           this.storeInfo.store_name
         );
         this.$set(this.attr.productSelect, "image", productSelect.image);
-        this.$set(this.attr.productSelect, "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);
@@ -1040,7 +1059,7 @@ export default {
           this.storeInfo.store_name
         );
         this.$set(this.attr.productSelect, "image", this.storeInfo.image);
-        this.$set(this.attr.productSelect, "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);
@@ -1053,7 +1072,7 @@ export default {
           this.storeInfo.store_name
         );
         this.$set(this.attr.productSelect, "image", this.storeInfo.image);
-        this.$set(this.attr.productSelect, "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,
@@ -1136,7 +1155,7 @@ export default {
       let productSelect = this.productValue[res];
       if (productSelect) {
         this.$set(this.attr.productSelect, "image", productSelect.image);
-        this.$set(this.attr.productSelect, "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);
@@ -1144,7 +1163,7 @@ export default {
         this.$set(this, "attrTxt", "已选择");
       } else {
         this.$set(this.attr.productSelect, "image", this.storeInfo.image);
-        this.$set(this.attr.productSelect, "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);

+ 21 - 3
src/views/shop/GoodsList.vue

@@ -87,7 +87,7 @@
             class="money font-color-red"
             :class="Switch === true ? '' : 'on'"
           >
-            ¥<span class="num">{{ item.price }}</span>
+            ¥<span class="num">{{ isVip ? item.vip_price : item.price }}</span>
           </div>
           <div
             class="vip acea-row row-between-wrapper"
@@ -116,6 +116,7 @@
   </div>
 </template>
 <script>
+import { getUserInfo } from "@api/user";
 import Recommend from "@components/Recommend";
 import { getProducts } from "@api/store";
 import debounce from "lodash.debounce";
@@ -151,7 +152,8 @@ export default {
       loadend: false,
       price: 0,
       stock: 0,
-      nows: false
+      nows: false,
+      isVip: false
     };
   },
   watch: {
@@ -175,9 +177,11 @@ export default {
         this.stock = 0;
         this.get_product_list();
       }
+      this.updateVIP();
     }
   },
   mounted: function() {
+    this.updateVIP();
     this.updateTitle();
     this.get_product_list();
     this.$scroll(this.$refs.container, () => {
@@ -185,6 +189,19 @@ export default {
     });
   },
   methods: {
+    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);
+        });
+        return;
+      }
+      this.isVip = false;
+      console.log('Current is not Login');
+    },
     // 商品详情跳转
     goDetail(item) {
       goShopDetail(item).then(() => {
@@ -220,7 +237,8 @@ export default {
       let that = this;
       switch (index) {
         case 0:
-          return that.$router.push({ path: "/category" });
+          return;
+          // return that.$router.back();
         case 1:
           if (that.price === 0) that.price = 1;
           else if (that.price === 1) that.price = 2;

+ 19 - 16
src/views/shop/HotNewGoods.vue

@@ -1,5 +1,6 @@
 <template>
   <div class="quality-recommend" ref="container">
+    <NavBar :title="titles[$route.params.type]" ></NavBar>
     <div class="slider-banner swiper">
       <swiper class="swiper-wrapper" :options="RecommendSwiper">
         <swiperSlide
@@ -28,6 +29,7 @@ import { swiper, swiperSlide } from "vue-awesome-swiper";
 import "@assets/css/swiper.min.css";
 import GoodList from "@components/GoodList";
 import Loading from "@components/Loading";
+import NavBar from "@components/NavBar";
 import { getGroomList } from "@api/store";
 export default {
   name: "HotNewGoods",
@@ -35,14 +37,15 @@ export default {
     swiper,
     swiperSlide,
     GoodList,
-    Loading
+    Loading,
+    NavBar
   },
   props: {},
   data: function() {
     return {
       imgUrls: [],
       goodsList: [],
-      name: "",
+      name: "123",
       icon: "",
       RecommendSwiper: {
         pagination: {
@@ -61,7 +64,17 @@ export default {
       page: 1,
       limit: 20,
       loading: false,
-      loadend: false
+      loadend: false,
+      titles: {
+        "1": "精品推荐",
+        "2": "热门榜单",
+        "3": "首发新品"
+      },
+      icons: {
+        "1": "icon-jingpintuijian",
+        "2": "icon-remen",
+        "3": "icon-xinpin"
+      }
     };
   },
   mounted: function() {
@@ -74,19 +87,9 @@ export default {
   methods: {
     titleInfo: function() {
       let type = this.$route.params.type;
-      if (type === "1") {
-        this.name = "精品推荐";
-        this.icon = "icon-jingpintuijian";
-        document.title = "精品推荐";
-      } else if (type === "2") {
-        this.name = "热门榜单";
-        this.icon = "icon-remen";
-        document.title = "热门榜单";
-      } else if (type === "3") {
-        this.name = "首发新品";
-        this.icon = "icon-xinpin";
-        document.title = "首发新品";
-      }
+      this.name = this.titles[type];
+      this.icon = this.icons[type];
+      document.title = this.titles[type];
     },
     getIndexGroomList: function() {
       let that = this;

Неке датотеке нису приказане због велике количине промена