|
|
@@ -15,6 +15,7 @@
|
|
|
<div class="pictrue"><img :src="followUrl" /></div>
|
|
|
<div class="mask" @click="closeFollowCode"></div>
|
|
|
</div> -->
|
|
|
+ <div class="header_top"></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">
|
|
|
@@ -64,7 +65,7 @@
|
|
|
|
|
|
<router-link
|
|
|
v-if="isVip"
|
|
|
- :to='"/goods_list?id=" + vip_cate'
|
|
|
+ :to="'/goods_list?id=' + vip_cate"
|
|
|
class="item"
|
|
|
:key="index"
|
|
|
>
|
|
|
@@ -135,40 +136,6 @@
|
|
|
>
|
|
|
</swiper>
|
|
|
</div>
|
|
|
- <!-- <div class="activity" v-if="activity.length">
|
|
|
- <div class="title"><img src="@assets/images/title.png" /></div>
|
|
|
- <div class="activityCon acea-row row-between-wrapper">
|
|
|
- <router-link
|
|
|
- :to="activityOne[0].wap_link ? activityOne[0].wap_link : ''"
|
|
|
- class="left"
|
|
|
- :style="'background-image: url(' + activityOne[0].pic + ');'"
|
|
|
- >
|
|
|
- <div class="name">{{ activityOne[0].title }}</div>
|
|
|
- <div class="info">{{ activityOne[0].info }}</div>
|
|
|
- <CountDown
|
|
|
- :is-day="false"
|
|
|
- :tip-text="''"
|
|
|
- :day-text="''"
|
|
|
- :hour-text="' : '"
|
|
|
- :minute-text="' : '"
|
|
|
- :second-text="''"
|
|
|
- :datatime="killIndexTime"
|
|
|
- ></CountDown>
|
|
|
- </router-link>
|
|
|
- <div class="right acea-row row-column-between">
|
|
|
- <router-link
|
|
|
- :to="item.wap_link ? item.wap_link : ''"
|
|
|
- class="item"
|
|
|
- :style="'background-image: url(' + item.pic + ');'"
|
|
|
- v-for="(item, index) in activity"
|
|
|
- :key="index"
|
|
|
- >
|
|
|
- <div class="name">{{ item.title }}</div>
|
|
|
- <div class="info">{{ item.info }}</div>
|
|
|
- </router-link>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div> -->
|
|
|
<div class="flashSale" v-if="seckillCont">
|
|
|
<div class="title acea-row row-between row-bottom">
|
|
|
<div class="left acea-row row-middle">
|
|
|
@@ -304,7 +271,7 @@
|
|
|
:to="lovely[0].wap_link ? lovely[0].wap_link : ''"
|
|
|
class="advert"
|
|
|
v-if="lovely.length"
|
|
|
- ><img :src="lovely[0].img"
|
|
|
+ ><img :src="lovely[0].img" style="object-fit: cover"
|
|
|
/></router-link>
|
|
|
<div class="newProducts" v-if="info.firstList.length > 0">
|
|
|
<div class="publicTitle acea-row row-center-wrapper">
|
|
|
@@ -464,50 +431,6 @@
|
|
|
</router-link>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <!-- <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"
|
|
|
- >更多 ></router-link
|
|
|
- >
|
|
|
- </div>
|
|
|
- <div class="publicList acea-row row-between-wrapper">
|
|
|
- <div
|
|
|
- @click="goDetails(item)"
|
|
|
- class="item"
|
|
|
- v-for="(item, index) in benefit"
|
|
|
- :key="index"
|
|
|
- >
|
|
|
- <div class="pictrue">
|
|
|
- <img :src="item.image" />
|
|
|
- <span
|
|
|
- class="pictrue_log_big pictrue_log_class"
|
|
|
- v-if="item.activity && item.activity.type === '1'"
|
|
|
- >秒杀</span
|
|
|
- >
|
|
|
- <span
|
|
|
- class="pictrue_log_big pictrue_log_class"
|
|
|
- v-if="item.activity && item.activity.type === '2'"
|
|
|
- >砍价</span
|
|
|
- >
|
|
|
- <span
|
|
|
- class="pictrue_log_big pictrue_log_class"
|
|
|
- v-if="item.activity && item.activity.type === '3'"
|
|
|
- >拼团</span
|
|
|
- >
|
|
|
- </div>
|
|
|
- <div class="text">
|
|
|
- <div class="name line1">{{ item.store_name }}</div>
|
|
|
- <div class="acea-row row-between-wrapper">
|
|
|
- <GoodItem :item = item :isVip = isVip></GoodItem>
|
|
|
- <div class="cart acea-row row-center-wrapper">
|
|
|
- <span class="iconfont icon-mzshopping"></span>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div> -->
|
|
|
<div class="recommend" v-if="hostProduct.length">
|
|
|
<div class="title">
|
|
|
<img src="@assets/images/becommendTitle.png" />
|
|
|
@@ -558,25 +481,6 @@
|
|
|
:key="index"
|
|
|
>
|
|
|
<div class="wrapper">
|
|
|
- <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"
|
|
|
- >
|
|
|
- <div
|
|
|
- class="item"
|
|
|
- :class="categoryActive === indexn ? 'on' : ''"
|
|
|
- @click="productTap(indexn)"
|
|
|
- >
|
|
|
- <div class="pictrue">
|
|
|
- <img :src="itemn.pic" />
|
|
|
- </div>
|
|
|
- <div class="name line1">{{ itemn.cate_name }}</div>
|
|
|
- </div>
|
|
|
- </swiper-slide>
|
|
|
- </swiper> -->
|
|
|
- </div>
|
|
|
<div class="classifyList acea-row row-between-wrapper">
|
|
|
<div
|
|
|
class="item"
|
|
|
@@ -641,13 +545,13 @@
|
|
|
@checked="couponClose"
|
|
|
@close="couponClose"
|
|
|
></Coupon-window>
|
|
|
- <div style="height:1rem;"></div>
|
|
|
+ <div class="footer_spacer"></div>
|
|
|
</div>
|
|
|
<loadLogo v-else></loadLogo>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import axios from "axios";
|
|
|
+// import axios from "axios";
|
|
|
import { getUserInfo } from "@api/user";
|
|
|
import { swiper, swiperSlide } from "vue-awesome-swiper";
|
|
|
import "@assets/css/swiper.min.css";
|
|
|
@@ -663,12 +567,11 @@ import { getCoupon, getCouponReceive } from "@api/user";
|
|
|
import { getSeckillConfig, getSeckillList } from "@api/activity";
|
|
|
import Loading from "@components/Loading";
|
|
|
import debounce from "lodash.debounce";
|
|
|
-import { goShopDetail } from "@libs/order";
|
|
|
+// import { goShopDetail } from "@libs/order";
|
|
|
import JPush from "@libs/jpush";
|
|
|
import { WeChat } from "@libs/pay";
|
|
|
import GoodItem from "@components/GoodItem";
|
|
|
-// import { getQueryVariable } from "../../utils";
|
|
|
-// import router from "@/router";
|
|
|
+import {checkUpdate} from "@libs/update";
|
|
|
const HAS_COUPON_WINDOW = "has_coupon_window";
|
|
|
const LONGITUDE = "user_longitude";
|
|
|
const LATITUDE = "user_latitude";
|
|
|
@@ -739,7 +642,7 @@ export default {
|
|
|
productList: [],
|
|
|
loadings: false,
|
|
|
loadends: false,
|
|
|
- seckillCont: true,
|
|
|
+ seckillCont: false,
|
|
|
swiperOption: {
|
|
|
pagination: {
|
|
|
el: ".paginationBanner",
|
|
|
@@ -834,11 +737,7 @@ export default {
|
|
|
return this.$refs.mySwiper.swiper;
|
|
|
},
|
|
|
newSwiper() {
|
|
|
- if (this.$refs.newSwiper !== undefined) {
|
|
|
- return this.$refs.newSwiper.swiper;
|
|
|
- } else {
|
|
|
- return null;
|
|
|
- }
|
|
|
+ return this.$refs.newSwiper.swiper;
|
|
|
},
|
|
|
recommendSwiper() {
|
|
|
return this.$refs.recommendSwiper.swiper;
|
|
|
@@ -846,14 +745,15 @@ export default {
|
|
|
},
|
|
|
watch: {
|
|
|
tapActive(to) {
|
|
|
+ console.log(to);
|
|
|
if (to === 0) {
|
|
|
this.tapActive = 0;
|
|
|
this.swiper.autoplay.start();
|
|
|
- if (this.mySwiper != null) this.newSwiper.autoplay.start();
|
|
|
+ this.newSwiper.autoplay.start();
|
|
|
this.recommendSwiper.autoplay.start();
|
|
|
} else {
|
|
|
this.swiper.autoplay.stop();
|
|
|
- if (this.mySwiper != null) this.newSwiper.autoplay.stop();
|
|
|
+ this.newSwiper.autoplay.stop();
|
|
|
this.recommendSwiper.autoplay.stop();
|
|
|
}
|
|
|
},
|
|
|
@@ -864,11 +764,11 @@ export default {
|
|
|
this.getHomeData();
|
|
|
this.hostProducts();
|
|
|
this.swiper.autoplay.start();
|
|
|
- if (this.mySwiper != null) this.newSwiper.autoplay.start();
|
|
|
+ this.newSwiper.autoplay.start();
|
|
|
this.recommendSwiper.autoplay.start();
|
|
|
} else {
|
|
|
this.swiper.autoplay.stop();
|
|
|
- if (this.mySwiper != null) this.newSwiper.autoplay.stop();
|
|
|
+ this.newSwiper.autoplay.stop();
|
|
|
this.recommendSwiper.autoplay.stop();
|
|
|
}
|
|
|
}
|
|
|
@@ -882,13 +782,13 @@ export default {
|
|
|
|
|
|
JPush.init(processUri);
|
|
|
WeChat.init();
|
|
|
- this.checkUpdate();
|
|
|
+ checkUpdate();
|
|
|
|
|
|
this.updateVIP();
|
|
|
// this.getFollow();
|
|
|
this.getHomeData();
|
|
|
// this.getCoupon();
|
|
|
- this.getSeckillTime();
|
|
|
+ // this.getSeckillTime();
|
|
|
this.hostProducts();
|
|
|
this.getCategoryData();
|
|
|
this.$scroll(this.$refs.container, () => {
|
|
|
@@ -897,47 +797,6 @@ export default {
|
|
|
cookie.get("expires");
|
|
|
},
|
|
|
methods: {
|
|
|
- checkUpdate() {
|
|
|
- const that = this;
|
|
|
- if (typeof cordova == "undefined") {
|
|
|
- console.log("current platform is not mobile.");
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- axios.get("https://qndownload.shotshock.shop/version?ts=" +
|
|
|
- Date.parse(new Date())).then(res => {
|
|
|
- let ver = res.data.version;
|
|
|
- let url = res.data.download;
|
|
|
- let iosStore = res.data.iosStore;
|
|
|
- console.log(JSON.stringify(res.data));
|
|
|
- console.log(navigator.platform);
|
|
|
- cordova.getAppVersion.getVersionNumber().then(version => {
|
|
|
- console.log("current version: " + version);
|
|
|
- console.log("remote version: " + ver);
|
|
|
- if (ver > version) {
|
|
|
- console.log("current need update !");
|
|
|
- that.$dialog.confirm({
|
|
|
- mes: "检查到有新版本,点击确定去下载!",
|
|
|
- title: "更新提示",
|
|
|
- opts: () => {
|
|
|
- if(navigator.platform === "iPhone") {
|
|
|
- cordova.InAppBrowser.open(iosStore, "_system");
|
|
|
- } else {
|
|
|
- cordova.InAppBrowser.open(url, "_system");
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- } else {
|
|
|
- console.log("current alreay is latest !");
|
|
|
- }
|
|
|
- });
|
|
|
- })
|
|
|
- .catch(err => {
|
|
|
- console.log(err);
|
|
|
- // that.$dialog.error("检查更新失败!")
|
|
|
- });
|
|
|
- },
|
|
|
-
|
|
|
updateVIP() {
|
|
|
if (this.$store.state.app.token !== null) {
|
|
|
getUserInfo().then(res => {
|
|
|
@@ -984,7 +843,7 @@ export default {
|
|
|
goDetails(item) {
|
|
|
// console.log(item);
|
|
|
// goShopDetail(item).then(() => {
|
|
|
- this.$router.push({ path: "/detail/" + item.id });
|
|
|
+ this.$router.push({ path: "/detail/" + item.id });
|
|
|
// });
|
|
|
},
|
|
|
getHomeData: function() {
|
|
|
@@ -995,13 +854,13 @@ export default {
|
|
|
// that.mapKey = res.data.tengxun_map_key;
|
|
|
that.logoUrl = res.data.logoUrl;
|
|
|
that.subscribe = res.data.subscribe;
|
|
|
- if (!that.subscribe && that.followUrl) {
|
|
|
- setTimeout(function() {
|
|
|
- that.followHid = true;
|
|
|
- }, 200);
|
|
|
- } else {
|
|
|
- that.followHid = false;
|
|
|
- }
|
|
|
+ // if (!that.subscribe && that.followUrl) {
|
|
|
+ // setTimeout(function() {
|
|
|
+ // that.followHid = true;
|
|
|
+ // }, 200);
|
|
|
+ // } else {
|
|
|
+ // that.followHid = false;
|
|
|
+ // }
|
|
|
that.$set(that, "banner", res.data.banner);
|
|
|
that.$set(that, "menus", res.data.menus);
|
|
|
that.$set(that, "activity", res.data.activity);
|
|
|
@@ -1020,6 +879,12 @@ export default {
|
|
|
res.data.couponList.some(coupon => coupon.is_use);
|
|
|
// if (!cookie.get(LATITUDE) && !cookie.get(LONGITUDE))
|
|
|
// this.getWXLocation();
|
|
|
+
|
|
|
+ setTimeout(function() {
|
|
|
+ that.fixedHeader();
|
|
|
+ }, 500);
|
|
|
+ }).catch(err => {
|
|
|
+ console.log("catch index err:" + err.toString());
|
|
|
});
|
|
|
},
|
|
|
getWXLocation() {
|
|
|
@@ -1188,6 +1053,15 @@ export default {
|
|
|
openShareAll(configAppMessage);
|
|
|
});
|
|
|
}
|
|
|
+ },
|
|
|
+ fixedHeader() {
|
|
|
+ let nodes = document.getElementsByClassName("van-sticky");
|
|
|
+ if (nodes.length < 1){
|
|
|
+ console.log("failed -----------");
|
|
|
+ return;
|
|
|
+ };
|
|
|
+ nodes[0].style.top = "env(safe-area-inset-top)";
|
|
|
+ console.log("success -----------");
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
@@ -1220,12 +1094,31 @@ export default {
|
|
|
color: #666;
|
|
|
right: 0.2rem;
|
|
|
}
|
|
|
+.indexs .header_top {
|
|
|
+ height: 0;
|
|
|
+ z-index: 2;
|
|
|
+ position: fixed;
|
|
|
+ width: 100%;
|
|
|
+ top: 0;
|
|
|
+ height: constant(safe-area-inset-top);
|
|
|
+ height: env(safe-area-inset-top);
|
|
|
+ background: linear-gradient(to left, #ff3366 0%, #ff6533 100%);
|
|
|
+ background: -webkit-linear-gradient(to left, #ff3366 0%, #ff6533 100%);
|
|
|
+ background: -moz-linear-gradient(to left, #ff3366 0%, #ff6533 100%);
|
|
|
+}
|
|
|
.indexs .header {
|
|
|
height: 0.98rem;
|
|
|
width: 100%;
|
|
|
background: linear-gradient(to left, #ff3366 0%, #ff6533 100%);
|
|
|
background: -webkit-linear-gradient(to left, #ff3366 0%, #ff6533 100%);
|
|
|
background: -moz-linear-gradient(to left, #ff3366 0%, #ff6533 100%);
|
|
|
+
|
|
|
+ z-index: 3;
|
|
|
+ margin-top: 0;
|
|
|
+ /* Status bar height on iOS 11.0 */
|
|
|
+ margin-top-top: constant(safe-area-inset-top);
|
|
|
+ /*!* Status bar height on iOS 11+ *!*/
|
|
|
+ margin-top: env(safe-area-inset-top);
|
|
|
}
|
|
|
.indexs .header .logo {
|
|
|
width: 1.27rem;
|
|
|
@@ -1825,4 +1718,10 @@ export default {
|
|
|
font-size: 0.22rem;
|
|
|
color: #aaa;
|
|
|
}
|
|
|
+
|
|
|
+.footer_spacer {
|
|
|
+ height: 1rem;
|
|
|
+ height: calc(constant(safe-area-inset-bottom) + 1rem);
|
|
|
+ height:calc(env(safe-area-inset-bottom) + 1rem);
|
|
|
+}
|
|
|
</style>
|