<template>
|
<view>
|
<view class="page-index">
|
<view class="mp-header">
|
<view class="header" :style="{ paddingTop: menuTop + 'px' }">
|
<view class="serch-wrapper flex">
|
<view class="logo">
|
<image :src="logoUrl" mode="scaleToFill"></image>
|
</view>
|
<view @click="goToLink({url:'/pages/goods_search/index','name':'搜索商品'},'search')"
|
:style="{'width':searchWidth+'px','lineHeight':menuHeight+'px','height':menuHeight+'px','borderRadius':menuHeight/2+'px'}"
|
class="input"><text class="iconfont icon-xiazai5"></text>
|
<text>搜索商品</text>
|
</view>
|
</view>
|
</view>
|
</view>
|
<view class="mp-bg"></view>
|
<view :style="{ height: marTop+'px' }"></view>
|
<view class="user_info" v-if="userInfoReady=='hasUserInfo'">
|
<view class="user_head">
|
<!-- userInfo.avatar?userInfo.avatar: -->
|
<image :src="userInfo.avatar?userInfo.avatar:defautHead"></image>
|
</view>
|
<view class="user_name">{{userInfo.nickname?userInfo.nickname:'微信客户'}}</view>
|
<view class="user_level" v-if="userInfo.vip">
|
<image :src="userInfo.vipIcon" mode="aspectFit"></image>
|
<!-- <text>{{userInfo.vipName}}</text> -->
|
</view>
|
<view class="user_careNum" @click="goToThird('/pages/profile/care-coupon-detail')">
|
<view class="num">{{ careBeanReady?toThousands(myCareBean):'-' }}</view>
|
<view class="label">悦养豆明细</view>
|
</view>
|
<navigator class="btn_vip flex" url='/pages/users/user_vip/index' hover-class='none'
|
@click="clickTrack('vip')"><text>查看会员权益</text><text class="iconfont icon-xiangyou"></text>
|
</navigator>
|
</view>
|
<view class="user_info" v-if="userInfoReady=='needRegister'">
|
<view class="user_head">
|
<image src="https://ossacmall.bluedeer.com.cn/app/static/images/userHead_defaultNew.png"></image>
|
</view>
|
<view class="user_loginTips">未登录</view>
|
<view class="btn_toLogin flex" @click="goToLogin"><text>立即注册,登录</text><text
|
class="iconfont icon-xiangyou"></text></view>
|
</view>
|
<view v-if="buyList.length > 0" class="buy_list">
|
<view class="buy_wrapper" :style="'animation-duration:' + buyList.length*2 + 's'">
|
<view class="buy_item" v-for="(buyItem, buyIndex) in buyList" :key="buyItem.uniKey">
|
{{ buyItem.level ? buyItem.level : '' }}
|
{{ buyItem.real_name }} 已购买{{ buyItem.product_name }}
|
</view>
|
</view>
|
</view>
|
<!-- banner -->
|
<view class="swiper" v-if="imgUrls&&imgUrls.length">
|
<swiper indicator-dots="true" indicator-type="expand" :autoplay="true" :circular="circular"
|
interval="5000" :duration="duration" indicator-color="#979797"
|
indicator-active-color="#FFE20E">
|
<block v-for="(imgUrlItem, imgUrlIndex) in imgUrls" :key="imgUrlItem.uniKey">
|
<swiper-item>
|
<view class='slide-navigator acea-row row-between-wrapper' hover-class='none'
|
@click="goToLink(imgUrlItem,'banner')">
|
<image :src="imgUrlItem.pic" class="slide-image" lazy-load></image>
|
</view>
|
</swiper-item>
|
</block>
|
</swiper>
|
</view>
|
<!-- 新闻简报 -->
|
<view class='notice acea-row row-middle row-between' v-if="roll&&roll.length">
|
<view class="pic">
|
<image src="https://ossacmall.bluedeer.com.cn/app/static/images/xinjian.png"></image>
|
</view>
|
<text class='line'>|</text>
|
<view class='swipers'>
|
<swiper :indicator-dots="indicatorDots" :autoplay="autoplay" interval="2500" duration="500"
|
vertical="true" circular="true">
|
<block v-for="(rollItem, rollIndex) in roll" :key='rollItem.uniKey'>
|
<swiper-item>
|
<navigator class='item' :url='rollItem.url' hover-class='none'
|
@click="clickTrack('news',rollItem)">
|
<view class='line1'>{{ rollItem.info }}</view>
|
</navigator>
|
</swiper-item>
|
</block>
|
</swiper>
|
</view>
|
<view class="iconfont icon-xiangyou"></view>
|
</view>
|
<!-- menu -->
|
<view class='nav acea-row' v-if="menus&&menus.length">
|
<block v-for="(menuItem, menuIndex) in menus" :key="menuItem.uniKey">
|
<view class='item' v-if="menuItem.show == '2'" hover-class='none'
|
@click="goToLink(menuItem,'menu')">
|
<view class='pictrue'>
|
<image :src='menuItem.pic' class="image"></image>
|
</view>
|
<view class="menu-txt">{{ menuItem.name }}</view>
|
</view>
|
</block>
|
</view>
|
<image class="index_info" src="https://ossacmall.bluedeer.com.cn/app/static/images/index_info.png" ></image>
|
<!-- 优惠券 -->
|
<!-- <view class="couponList" v-if="userInfoReady=='hasUserInfo'&&couponList&&couponList.length > 0">
|
<img :src="'https://ossacmall.bluedeer.com.cn/app/static/images/h_cImg'+((userInfo.vipName&&extVipLevelAttr.indexOf(userInfo.vipName)>0)?extVipLevelAttr.indexOf(userInfo.vipName):1)+'.png'"
|
alt="">
|
<scroll-view class="couponList_box scroll-view_H" scroll-x="true" scroll-with-animation>
|
<view class="couponList_wrapper">
|
<block v-for="couponItem, couponIndex in couponList" :key="couponItem.uniKey">
|
<view class='couponList_item' v-if="!couponItem.useTime">
|
<block v-if="couponItem.moneyType==2">
|
<view class="amount">
|
{{couponItem.money?Number(couponItem.money)*10:''}}
|
<text class="unit">折</text>
|
</view>
|
<view class="name line2">{{ couponItem.name }}</view>
|
|
</block>
|
|
<block v-else-if="couponItem.moneyType==4">
|
<view class="amount amountSmall">
|
<block v-if="couponItem.userLvType==4">
|
<text>臻享专区</text><text class="text2">惠购权</text>
|
</block>
|
<block v-else-if="couponItem.userLvType==3">
|
<text>臻享会员</text><text class="text2">权益券</text>
|
</block>
|
<block v-else-if="couponItem.userLvType==2">
|
<text>悦享会员</text><text class="text2">权益券</text>
|
</block>
|
<block v-else-if="couponItem.userLvType==1">
|
<text>畅享会员</text><text class="text2">权益券</text>
|
</block>
|
<block v-else-if="couponItem.userLvType==0">
|
<text>普通会员</text><text class="text2">权益券</text>
|
</block>
|
<block v-else-if="couponItem.userLvType==-1">
|
<text>臻享会员</text><text class="text2">体验券</text>
|
</block>
|
<block v-else>
|
{{couponItem.name}}
|
</block>
|
</view>
|
</block>
|
<block v-else>
|
<view class="amount">
|
<view class="label">¥</view>{{couponItem.money?Number(couponItem.money):''}}
|
</view>
|
|
<view class="name line2">{{ couponItem.name }}</view>
|
</block>
|
|
<view class="btn" v-if="couponItem.type=='import'" @click="getCoupon(false, couponItem, couponIndex)">
|
{{ statusMap[couponItem.validStr] }}
|
</view>
|
<view class="btn" v-else @click="getCoupon(false, couponItem, couponIndex)">
|
{{ couponItem.isUse ? '去使用' : '立即领取' }}
|
</view>
|
</view>
|
</block>
|
|
</view>
|
</scroll-view>
|
<view v-if="couponList.length > 0 && !isGetWholeCoupon" class='couponList_btn' hover-class='none'
|
@click="getCoupon(true)">一键领取全部</view>
|
<view v-else class='couponList_btn' hover-class='none' @click="goToCoupon()">我的优惠券</view>
|
</view> -->
|
|
<!-- 专区入口 -->
|
<view v-if="zoneList&&zoneList.length > 0" class="zoneList_title">探索健康好物</view>
|
<scroll-view v-if="zoneList&&zoneList.length > 0" class="zoneList_box scroll-view_H"
|
:class="zoneList.length == 1 ? 'isSingle' : ''" scroll-x="true">
|
<view class="zoneList_wrapper">
|
<block v-for="(zoneItem, zoneIndex) in zoneList" :key="zoneItem.uniKey">
|
<view class="zoneList_item">
|
<view
|
@click="goToLink({'url':'/pages/zone/index?id=' + zoneItem.id,'name':'专区'},'zone')">
|
<image :src="zoneItem.homepageImage"></image>
|
</view>
|
</view>
|
</block>
|
</view>
|
</scroll-view>
|
<!--抽奖-->
|
<view v-if="homeBanner.homeBannerStatus" class="index_lottery" @click="goToLottery">
|
<image class="index_lottery_img" :src="homeBanner.homeBannerImg" mode="widthFix"></image>
|
</view>
|
<!-- 活动-->
|
<a_seckill ref="seckill" :careBeanRate="careBeanRate"></a_seckill>
|
<b_combination></b_combination>
|
<c_bargain></c_bargain>
|
<view class="goods_menuBox" v-if="categoryList&&categoryList.length > 0" :style="'top:'+(marTop)+'px;'">
|
<view class="subMenu">
|
<scroll-view scroll-x="true" scroll-with-animation='true' style="width: 100%;">
|
<view class="subMenu_wrapper">
|
<block v-for="(catetem, cateIndex) in categoryList" :key="catetem.uniKey"><text
|
class="subMenu_item" :class='cateIndex == categoryIndex ? "on" : ""'
|
@click='changeCategoryTab(cateIndex,true)'><text class="text">{{ catetem.name }}</text></text></block>
|
</view>
|
</scroll-view>
|
</view>
|
</view>
|
<view class="goodsSection" v-if="categoryList&&categoryList.length > 0" id="goodsSection"
|
:style="loadingGood?('height:'+viewHeight+'px;overflow:hidden'):''">
|
<view class="cf list" v-if="productList&&productList.length > 0">
|
<view class="list_column cfl">
|
<block v-for="(gitem, gindex) in productList" :key="gindex">
|
<GoodBlock v-if="gindex%2==0" :pageName="'首页'" :moduleName="'商品推荐'"
|
:careBeanRate="careBeanRate" :size="'big'" :goodsInfo="gitem"></GoodBlock>
|
</block>
|
</view>
|
<view class="list_column cfr">
|
<block v-for="(gitem, gindex) in productList" :key="gindex">
|
<GoodBlock v-if="gindex%2==1" :pageName="'首页'" :moduleName="'商品推荐'"
|
:careBeanRate="careBeanRate" :size="'big'" :goodsInfo="gitem"></GoodBlock>
|
</block>
|
</view>
|
</view>
|
<view v-if="loading" class="loadingTips">加载中...</view>
|
<view v-else-if="productList&&productList.length <= 0" class="loadingTips">暂无数据</view>
|
<view v-else-if="loadend" class="loadingTips">已全部加载</view>
|
<view v-else class="loadingTips">上拉加载更多</view>
|
<view class="pauseView" v-if="isPause"></view>
|
</view>
|
<view style="height: 218rpx;"></view>
|
<tabBar :tab-id="1"></tabBar>
|
<popCoupon ref="popCoupon" :pageName="'index'" @resetCoupon="resetCoupon"></popCoupon>
|
<popActivity :activity="homeActivity" ref="popActivity" @hide="showActivity"></popActivity>
|
<popNewuser ref="popNewuserRef"></popNewuser>
|
</view>
|
</view>
|
</template>
|
|
<script>
|
import {
|
HTTP_REQUEST_URL,
|
THIRD_APPID
|
} from '@/config/app';
|
import Auth from '@/libs/wechat';
|
import Cache from '../../utils/cache';
|
var statusBarHeight = uni.getSystemSetting().statusBarHeight + 'px';
|
let app = getApp();
|
import {
|
getUserBean
|
} from '@/api/user.js';
|
import {
|
toLogin
|
} from '@/libs/login.js';
|
import {
|
getIndexData,
|
getIndexConfig,
|
setWholeCouponReceive,
|
setCouponReceive
|
} from '@/api/api.js';
|
// #ifdef MP-WEIXIN
|
import {
|
getTemlIds
|
} from '@/api/api.js';
|
import {
|
testAc,
|
dealUserBean,
|
testAgent,
|
handsCoupon,
|
handsList
|
} from '@/api/user.js';
|
|
// import {
|
// SUBSCRIBE_MESSAGE,
|
// TIPS_KEY
|
// } from '@/config/cache';
|
// #endif
|
// #ifdef H5
|
import {
|
follow
|
} from '@/api/public.js';
|
// #endif
|
import {
|
getShare
|
} from '@/api/public.js';
|
import a_seckill from './components/a_seckill';
|
import b_combination from './components/b_combination';
|
import c_bargain from './components/c_bargain';
|
import goodList from '@/components/goodList';
|
import ClipboardJS from "@/plugin/clipboard/clipboard.js";
|
import {
|
goShopDetail
|
} from '@/libs/order.js'
|
import {
|
mapGetters
|
} from "vuex";
|
import countDown from '@/components/countDown';
|
import {
|
getCategoryList,
|
getProductslist,
|
getStoreZoneAndCouponList,
|
getLast10Order
|
} from '@/api/store.js';
|
import recommend from '@/components/recommend';
|
import {
|
silenceBindingSpread
|
} from '@/utils';
|
// #ifndef MP
|
import {
|
kefuConfig
|
} from "@/api/public";
|
import {
|
getWechatConfig
|
} from "@/api/public";
|
// #endif
|
|
import {
|
getMdayLast
|
} from '@/api/lottery.js';
|
import GoodBlock from "@/pages/goods_block/index.vue";
|
import Loading from '@/components/Loading/index.vue';
|
import popCoupon from '@/components/popCoupon/index.vue';
|
import popActivity from '@/components/popActivity/index.vue';
|
import popNewuser from '@/components/popNewuser/index.vue';
|
const arrTemp = ["beforePay", "afterPay", "refundApply", "beforeRecharge", "createBargain", "pink"];
|
export default {
|
computed: mapGetters(['isLogin', 'uid']),
|
components: {
|
goodList,
|
countDown,
|
a_seckill,
|
b_combination,
|
c_bargain,
|
recommend,
|
Loading,
|
GoodBlock,
|
popCoupon,
|
popActivity,
|
popNewuser
|
},
|
data() {
|
return {
|
defautHead: 'https://ossacmall.bluedeer.com.cn/app/static/images/userHead_defaultNew.png',
|
buyList: [],
|
pageHeight: 0,
|
loaded: false,
|
loading: false,
|
isAuto: false, //没有授权的不会自动授权
|
isShowAuth: false, //是否隐藏授权
|
statusBarHeight: statusBarHeight,
|
navIndex: 0,
|
navTop: [],
|
followUrl: "",
|
followHid: true,
|
followCode: false,
|
logoUrl: "",
|
imgUrls: [],
|
itemNew: [],
|
menus: [],
|
zoneList: [],
|
bastInfo: '',
|
fastInfo: '',
|
fastList: [],
|
firstInfo: '',
|
salesInfo: '',
|
indicatorDots: false,
|
circular: true,
|
autoplay: true,
|
interval: 5000,
|
duration: 500,
|
window: false,
|
iShidden: false,
|
headerHeight: 0,
|
newGoodsBananr: '',
|
couponList: [],
|
liveList: [],
|
hotList: [{
|
pic: 'https://ossacmall.bluedeer.com.cn/app/static/images/hot_001.png'
|
}, {
|
pic: 'https://ossacmall.bluedeer.com.cn/app/static/images/hot_002.png'
|
}, {
|
pic: 'https://ossacmall.bluedeer.com.cn/app/static/images/hot_003.png'
|
}],
|
ProductNavindex: 0,
|
marTop: 0,
|
childID: 0,
|
loadend: false,
|
loadTitle: '加载更多',
|
sortProduct: [],
|
is_switch: true,
|
hotPage: 1,
|
hotLimit: 10,
|
hotScroll: false,
|
explosiveMoney: [],
|
prodeuctTop: 0,
|
searchH: 0,
|
isFixed: false,
|
goodScroll: true, //精品推荐开关
|
params: { //精品推荐分页
|
page: 1,
|
limit: 10,
|
},
|
tempArr: [], //精品推荐临时数组
|
roll: [], // 新闻简报
|
site_name: '', //首页title
|
iSshowH: false,
|
configApi: {}, //分享类容配置
|
spikeList: [], // 秒杀
|
point: '',
|
privacyStatus: false, // 隐私政策是否同意过
|
tabsScrollLeft: 0, // tabs当前偏移量
|
scrollLeft: 0,
|
lineColor: 'red',
|
lineStyle: {}, // 下划线位置--动态甲酸
|
listActive: 0, // 当前选中项
|
|
duration: 0.2, // 下划线动画时长
|
menuTop: 0,
|
menuHeight: 50,
|
searchWidth: 0,
|
windowWidth: 0,
|
windowHeight: 0,
|
isConfigReady: false,
|
hasLoadGroomList: false,
|
hasLoadCouponList: false,
|
isGetWholeCoupon: false,
|
isGetWholeCoupon2: false,
|
tabArr: [
|
'',
|
'更多健康好物'
|
],
|
categoryList: [],
|
subCategoryList: [],
|
productList: [],
|
categoryIndex: 0,
|
categorySubIndex: 0,
|
where: {
|
page: 1,
|
limit: 10,
|
cid: 0,
|
},
|
userInfo: {
|
|
},
|
userInfoReady: '',
|
scrollHeight: 100,
|
scrollTop: 0,
|
oldScrollTop: 0,
|
pageScrollTop: 0,
|
viewHeight: 0,
|
loadingGood: false,
|
careBeanRate: 0,
|
tabLinkArr: [
|
'pages/index/index',
|
'pages/goods_cate/goods_cate',
|
'pages/user/index'
|
],
|
extVipLevelAttr: [
|
'非会员',
|
'普通会员',
|
'畅享会员',
|
'悦享会员',
|
'臻享会员'
|
],
|
isPageShow: false,
|
loginBackFn: null,
|
myCareBean: 0,
|
careBeanReady: false,
|
newCouponList: [],
|
isFromReturn: false,
|
hasListenReturn: false,
|
statusMap: {
|
'usable': '去使用',
|
'unusable': '已使用',
|
'overdue': '已过期',
|
'notStart': '未开始'
|
},
|
isClicking:false,
|
hasLottery:false,
|
homeBanner:{},
|
homeActivity:{}
|
}
|
},
|
watch: {},
|
mounted() {},
|
onLoad() {
|
let that = this;
|
console.log('pageIndex onLoad');
|
// 获取系统信息
|
uni.getSystemInfo({
|
success(res) {
|
that.$store.commit("SYSTEM_PLATFORM", res.platform);
|
that.windowWidth = res.windowWidth;
|
that.windowHeight = res.windowHeight;
|
that.pageHeight = (res.windowHeight - res.statusBarHeight) / res.windowWidth * 750;
|
let menuSize = uni.getMenuButtonBoundingClientRect();
|
console.log('----------------------menuSize--------------------');
|
console.log(menuSize);
|
that.menuTop = menuSize.top;
|
that.menuHeight = menuSize.height;
|
that.searchWidth = uni.getMenuButtonBoundingClientRect().left - 210 / 750 * that.windowWidth;
|
that.$nextTick(() => {
|
let query = uni.createSelectorQuery().in(that);
|
let info = query.select(".mp-header");
|
info.boundingClientRect(function(data) {
|
if (data) {
|
that.marTop = data.height;
|
that.viewHeight = that.windowHeight - data.height - 200 / 750 *
|
that.windowWidth;
|
that.poTop = Number(data.height) + 84
|
}
|
|
}).exec()
|
})
|
}
|
});
|
this.getTemlIds();
|
if (!this.hasListenReturn) {
|
uni.$on('returnEvent', function(data) {
|
console.log('listen returnEvent');
|
if (data && (data.name == 'tabBar'||data.name == 'order')) {
|
that.isFromReturn=false;
|
//强制刷新
|
// that.isFromReturn = (new Date()).getTime();
|
// console.log('listen return ' + that.isFromReturn);
|
}else if (data && data.name == 'goods_details') {
|
that.isFromReturn = (new Date()).getTime();
|
console.log('listen return ' + that.isFromReturn);
|
}
|
});
|
this.hasListenReturn = true;
|
}
|
},
|
onHide() {
|
let that = this;
|
if(that.$store.getters.isSystemHide){
|
console.log('系统事件触发了onhide事件');
|
return false;
|
}
|
this.isPageShow = false;
|
uni.$off('updateCareBeanRate', that.careBeanRateReadyFn);
|
uni.$off('BELONG_READY', that.belongInfoReadyFn);
|
uni.$off('loginFlSuccess', that.registerFn);
|
setTimeout(function () {
|
that.isFromReturn = (new Date()).getTime();
|
console.log('listen onUnload ' + that.isFromReturn);
|
}, 200)
|
},
|
onShow() {
|
let that = this;
|
if(that.$store.getters.isSystemHide){
|
console.log('系统事件触发了onshow事件');
|
return false;
|
}
|
uni.$off('updateCareBeanRate', that.careBeanRateReadyFn);
|
uni.$off('BELONG_READY', that.belongInfoReadyFn);
|
uni.$off('loginFlSuccess', that.registerFn);
|
that.isPageShow = true;
|
|
uni.setNavigationBarTitle({
|
title: that.site_name
|
});
|
let pages = getCurrentPages(),
|
currPage = pages[pages.length - 1];
|
console.log('------------------page onShow start-----------------');
|
console.log('route', currPage.route);
|
console.log('options', currPage.options);
|
console.log('------------------page onShow end-----------------');
|
console.log('onshow return ' + this.isFromReturn+','+(new Date()).getTime());
|
if (that.isFromReturn&&(new Date()).getTime()-that.isFromReturn<5*60*1000&&that.$store.getters.isLogin) {
|
console.log('首页不刷新')
|
that.getUserBean();
|
} else {
|
if (that.$store.getters.careBeanRate) {
|
that.careBeanRateReadyFn();
|
} else {
|
uni.$once('updateCareBeanRate', that.careBeanRateReadyFn);
|
}
|
if (that.$store.getters.isBelong) {
|
that.belongInfoReadyFn({
|
isRegister: false
|
})
|
} else {
|
uni.$once('BELONG_READY', that.belongInfoReadyFn);
|
}
|
}
|
that.isFromReturn = false;
|
},
|
onReachBottom() {
|
console.log('onReachBottom');
|
this.get_product_list();
|
},
|
methods: {
|
goToLottery(){
|
let that=this;
|
this.clickTrack('lottery');
|
function go(){
|
let miniProgramInfo = uni.getAccountInfoSync().miniProgram;
|
let url=that.homeBanner.homeBannerUrl;
|
url=url.replace("{{token}}",that.$store.getters.token).replace("{{unionId}}",that.$store.getters.unionId)
|
uni.navigateTo({
|
url: url
|
})
|
}
|
if (!that.$store.getters.isLogin) {
|
toLogin(that);
|
that.loginBackFn = function() {
|
go();
|
}
|
}else{
|
go();
|
}
|
},
|
careBeanRateReadyFn() {
|
let that = this;
|
that.$nextTick(() => {
|
that.$set(that, 'careBeanRate', that.$store.getters.careBeanRate)
|
})
|
},
|
belongInfoReadyFn(data) {
|
let that = this;
|
if (!data.isRegister) {
|
that.checkLoginFn();
|
}
|
},
|
checkLoginFn() {
|
let that = this;
|
let pages = getCurrentPages(),
|
currPage = pages[pages.length - 1];
|
that.addTrack('yy_pageView', {
|
pageTitle_var: '首页',
|
pagePath_var: currPage.route,
|
pageType_var: '首页'
|
});
|
that.getIndexData();
|
if (that.$store.getters.isLogin) {
|
that.onLoadFn();
|
} else {
|
that.userInfoReady = 'needRegister';
|
}
|
uni.$once('loginFlSuccess', that.registerFn);
|
},
|
|
registerFn() {
|
console.log('registerFn');
|
let that = this;
|
if (that.loginBackFn) {
|
that.loginBackFn();
|
}
|
that.loginBackFn = null;
|
},
|
getUserBean() {
|
let that = this;
|
getUserBean().then(res2 => {
|
that.careBeanReady = true;
|
that.myCareBean = res2.data.totalCareBeans;
|
});
|
},
|
onLoadFn() {
|
let that = this;
|
that.userInfo = that.$store.getters.userInfo;
|
that.getUserBean();
|
that.userInfoReady = 'hasUserInfo';
|
that.getBaseUserInfo();
|
|
},
|
clickTrack(type, item) {
|
var data = {
|
pageTitle_var: '首页',
|
firstTabName_var: '-'
|
};
|
if (type == 'search') {
|
data['moduleName_var'] = '页面顶部';
|
data['buttonName_var'] = '搜索商品';
|
}
|
if (type == 'third') {
|
data['moduleName_var'] = '页面顶部';
|
data['buttonName_var'] = '查看悦养豆';
|
}
|
if (type == 'vip') {
|
data['moduleName_var'] = '页面顶部';
|
data['buttonName_var'] = '查看会员权益';
|
} else if (type == 'banner') {
|
data['moduleName_var'] = '轮播卡片';
|
data['buttonName_var'] = item.name ? item.name : '-';
|
} else if (type == 'menu') {
|
data['moduleName_var'] = '金刚位';
|
data['buttonName_var'] = item.name ? item.name : '-';
|
} else if (type == 'zone') {
|
data['moduleName_var'] = '探索健康好物';
|
data['buttonName_var'] = item.name ? item.name : '-';
|
}else if (type == 'lottery') {
|
data['moduleName_var'] = '抽奖';
|
data['buttonName_var'] = 'GO';
|
} else if (type == 'coupon') {
|
data['moduleName_var'] = '优惠券';
|
data['buttonName_var'] = item.name ? item.name : '-';
|
} else if (type == 'cate') {
|
data['moduleName_var'] = '商品分类';
|
data['buttonName_var'] = item.name ? item.name : '-';
|
}
|
this.addTrack('yy_marketPageClick', data);
|
},
|
goToThird(url, appId) {
|
//第三方小程序
|
// /pages/home/index?source=INSMART&sourceScene=test&agentNo=90028476&agentChannel=BK&agentCompany=123&agentBranch=123
|
|
if (url.indexOf('?') < 0) {
|
url += '?';
|
} else {
|
url += '&';
|
}
|
if (app.globalData.source) {
|
url += 'source=' + app.globalData.source;
|
} else {
|
url += 'source=MALL';
|
}
|
url += '&sourceScene=home';
|
url += '&agentNo=' + ((this.$store.getters.belong && this.$store.getters.belong.agentNo) ? this.$store
|
.getters.belong.agentNo : '');
|
url += '&agentChannel=' + ((this.$store.getters.belong && this.$store.getters.belong.channel) ? this.$store
|
.getters.belong.channel : ''); //归属代理人渠道
|
url += '&agentCompany=' + ((this.$store.getters.belong && this.$store.getters.belong.companyCode) ? this
|
.$store.getters.belong.companyCode : ''); //agentCompany
|
|
url += '&agentBranch=' + ((this.$store.getters.belong && this.$store.getters.belong.branchCode) ? this
|
.$store.getters.belong.branchCode : ''); //归属代理人支公司
|
url += '&custAgentOrgNo=' + ((this.$store.getters.belong && this.$store.getters.belong.subCode) ? this
|
.$store.getters.belong.subCode : ''); //归属代理人机构编码
|
|
url += 'unionId=' + this.$store.getters.unionId;
|
url += '&mobile=' + ((this.$store.getters.belong && this.$store.getters.belong.mobile) ? this.$store
|
.getters.belong.mobile : this.$store.getters.userInfo.mobile);
|
console.log(url);
|
|
|
|
let miniProgramInfo = uni.getAccountInfoSync().miniProgram;
|
uni.navigateToMiniProgram({
|
appId: appId ? appId : THIRD_APPID,
|
path: url,
|
envVersion: miniProgramInfo.envVersion == 'release' ? 'release' : 'trial',
|
})
|
|
this.clickTrack('third')
|
},
|
goToLink(item, type) {
|
let that=this;
|
function go(){
|
if (item.appid) {
|
that.goToThird(item.url, item.appid);
|
} else if (that.isTabLink(item.url)) {
|
let arr = item.url.split('?');
|
if (arr.length > 1) {
|
that.$store.commit('updateSwitchParams', {
|
switchParams: arr[1]
|
});
|
}
|
uni.switchTab({
|
url: arr[0]
|
});
|
} else {
|
uni.navigateTo({
|
url: item.url.replace("{{token}}",that.$store.getters.token).replace("{{unionId}}",that.$store.getters.unionId)
|
})
|
}
|
that.clickTrack(type, item);
|
}
|
console.log(item.url);
|
if (item.url.indexOf('needLogin=true')>0&&!that.$store.getters.isLogin) {
|
toLogin(that);
|
that.loginBackFn = function() {
|
go();
|
}
|
}else{
|
go();
|
}
|
|
|
},
|
isTabLink(link) {
|
let isTab = false;
|
this.tabLinkArr.forEach((item) => {
|
if (link.indexOf(item) >= 0) {
|
isTab = true;
|
}
|
})
|
return isTab;
|
},
|
handleLoad() {
|
let that = this;
|
},
|
goToLogin() {
|
let that = this;
|
toLogin(that);
|
that.loginBackFn = function() {
|
that.userInfo = that.$store.getters.userInfo;
|
that.userInfoReady = 'hasUserInfo';
|
that.getBaseUserInfo();
|
that.getIndexData();
|
that.onLoadFn();
|
}
|
},
|
getBaseUserInfo() {
|
let that = this;
|
silenceBindingSpread();
|
},
|
goToCoupon: function() {
|
uni.navigateTo({
|
url: '/pages/users/user_coupon/index'
|
})
|
},
|
getCoupon: function(isWhole, orgItem,index) {
|
let that = this;
|
if (!that.$store.getters.isLogin) {
|
that.goToLogin();
|
return false;
|
}
|
if(that.isClicking){
|
return false;
|
}
|
//领取优惠券
|
if (isWhole) {
|
this.clickTrack('coupon', {
|
'name': '一键领取'
|
})
|
let couponIds = [];
|
that.couponList.forEach((item1, index1) => {
|
if (!item1.isUse && item1.type!='import') {
|
couponIds.push(item1.id);
|
}
|
})
|
if(couponIds.length>0){
|
var useNum = 0;
|
uni.showLoading();
|
that.isClicking=true;
|
setWholeCouponReceive({
|
couponIds: couponIds,
|
}).then(function(res) {
|
that.$util.Tips({
|
title: '领取成功'
|
});
|
let nameArr = [];
|
let idArr = [];
|
let hasCoupon4 = false;
|
that.couponList.forEach((item1, index1) => {
|
if (!item1.isUse && item1.type!='import') {
|
that.couponList[index1].isUse = true;
|
nameArr.push(item1.name);
|
idArr.push(item1.id);
|
}
|
if (item1.moneyType == 4) {
|
hasCoupon4 = true;
|
}
|
});
|
that.isGetWholeCoupon = true;
|
that.addTrack('yy_getCoupon', {
|
'couponName_var': nameArr.join(','),
|
'couponId_var': idArr.join(',')
|
});
|
if (hasCoupon4) {
|
that.changeCategoryTab(that.categoryIndex);
|
}
|
uni.hideLoading();
|
that.isClicking=false;
|
}).catch(err => {
|
uni.hideLoading();
|
that.isClicking=false;
|
return that.$util.Tips({
|
title: (err && err.message) ? err.message : err
|
});
|
});
|
}
|
} else {
|
let item=orgItem||this.couponList[index]
|
if (item.isUse || (item.type=='import' && item.validStr=='usable')) {
|
|
that.isClicking=true;
|
var timer=setTimeout(()=>{
|
that.isClicking=false;
|
clearTimeout(timer);
|
},500)
|
if (item.appId && item.toPath) {
|
that.goToThird(item.toPath, item.appId);
|
} else if (item.toPath) {
|
if (that.isTabLink(item.toPath)) {
|
uni.switchTab({
|
url: item.toPath
|
})
|
} else {
|
uni.navigateTo({
|
url: item.toPath
|
})
|
}
|
} else {
|
uni.switchTab({
|
url: '/pages/goods_cate/goods_cate'
|
})
|
}
|
} else if(item.type!=='import') {
|
uni.showLoading();
|
that.isClicking=true;
|
setCouponReceive(item.id).then(function(res) {
|
that.addTrack('yy_getCoupon', {
|
'couponName_var': item.name,
|
'couponId_var': item.id
|
});
|
that.$set(that.couponList[index], 'isUse', true);
|
that.$util.Tips({
|
title: '领取成功'
|
});
|
if (item.moneyType == 4) {
|
that.changeCategoryTab(that.categoryIndex);
|
}
|
let finishNum=0;
|
that.couponList.forEach((item1, index1) => {
|
if (item1.isUse) {
|
finishNum++;
|
}
|
});
|
if(finishNum>=that.couponList.length){
|
that.isGetWholeCoupon=true;
|
}
|
uni.hideLoading();
|
that.isClicking=false;
|
}).catch(err => {
|
uni.hideLoading();
|
that.isClicking=false;
|
return that.$util.Tips({
|
title: (err && err.message) ? err.message : err
|
});
|
})
|
}
|
|
}
|
},
|
clickSort(index) {
|
this.listActive = index
|
},
|
// scroll-view滑动事件
|
scroll(e) {
|
this.scrollLeft = e.detail.scrollLeft;
|
},
|
// 计算下划线位置
|
setLine() {
|
let lineWidth = 0,
|
lineLeft = 0
|
this.getElementData(`#tab_item`, (data) => {
|
let el = data[this.listActive]
|
lineWidth = el.width / 2
|
// lineLeft = el.width * (this.currentIndex + 0.5) // 此种只能针对每个item长度一致的
|
lineLeft = el.width / 2 + (-data[0].left) + el.left
|
this.lineStyle = {
|
width: `${lineWidth}px`,
|
transform: `translateX(${lineLeft}px) translateX(-50%)`,
|
transitionDuration: `${this.duration}s`
|
};
|
})
|
},
|
getElementData(el, callback) {
|
uni.createSelectorQuery().in(this).selectAll(el).boundingClientRect().exec((data) => {
|
callback(data[0]);
|
});
|
},
|
xieyiApp() {
|
uni.navigateTo({
|
url: '/pages/users/web_page/index?webUel=https://admin.java.crmeb.net/useragreement/xieyi.html&title=协议内容'
|
})
|
},
|
getTemlIds() {
|
for (var i in arrTemp) {
|
this.getTem(arrTemp[i]);
|
}
|
},
|
getTem(data) {
|
getTemlIds({
|
type: data
|
}).then(res => {
|
if (res.data) {
|
let arr = res.data.map((item) => {
|
return item.tempId
|
})
|
wx.setStorageSync('tempID' + data, arr);
|
}
|
})
|
},
|
showActivity(){
|
this.$refs.popNewuserRef.show();
|
},
|
// 首页数据
|
getIndexData: function() {
|
let that = this;
|
that.hasCheckedLogin = true;
|
getIndexData().then(res => {
|
let homePopupList=[]
|
if(res.data.homePopupList){
|
homePopupList=res.data.homePopupList.map(item=>{
|
return {
|
image:item.image,
|
linkUrl:item.linkUrl
|
}
|
})
|
}
|
that.$set(that, "homeActivity",{
|
// homeDate:res.data.homeDate,
|
// homeImg:res.data.homeImg,
|
// homeUrl:res.data.homeUrl,
|
homePopupList:homePopupList
|
});
|
that.$nextTick(()=>{
|
that.$refs.popActivity.show();
|
})
|
that.isConfigReady = true;
|
uni.setNavigationBarTitle({
|
title: '首页'
|
})
|
that.$set(that, "logoUrl", res.data.logoUrl);
|
that.$set(that, "site_name", '首页');
|
if(res.data.banner){
|
res.data.banner.forEach((item, index) => {
|
item.uniKey = 'banner' + index;
|
})
|
}
|
that.$set(that, "imgUrls", res.data.banner?res.data.banner:[]);
|
if(res.data.menus){
|
res.data.menus.forEach((item, index) => {
|
item.uniKey = 'menus' + index;
|
})
|
}
|
that.$set(that, "menus", res.data.menus?res.data.menus:[]);
|
if (res.data.roll) {
|
res.data.roll.forEach((item, index) => {
|
item.uniKey = 'roll' + index;
|
})
|
}
|
that.$set(that, "roll", res.data.roll ? res.data.roll : []);
|
// #ifdef H5
|
that.$store.commit("SET_CHATURL", res.data.yzfUrl);
|
Cache.set('chatUrl', res.data.yzfUrl);
|
// #endif
|
this.shareApi();
|
this.getCategoryList();
|
this.getLast10Order();
|
this.getStoreZoneAndCouponList();
|
this.$refs.seckill.getSeckillIndexTime();
|
})
|
getIndexConfig().then(res => {
|
if(res.data){
|
that.$set(that, "homeBanner",res.data);
|
}
|
});
|
},
|
shareApi: function() {
|
getShare().then(res => {
|
this.$set(this, 'configApi', res.data);
|
// #ifdef H5
|
this.setOpenShare(res.data);
|
// #endif
|
})
|
},
|
getChatUrL() {
|
kefuConfig().then(res => {
|
let data = res.data;
|
this.$store.commit("SET_CHATURL", data.yzfUrl);
|
Cache.set('chatUrl', data.yzfUrl);
|
})
|
},
|
// 微信分享;
|
setOpenShare: function(data) {
|
let that = this;
|
if (that.$wechat.isWeixin()) {
|
let configAppMessage = {
|
desc: data.synopsis,
|
title: data.title,
|
link: location.href,
|
imgUrl: data.img
|
};
|
that.$wechat.wechatEvevt(["updateAppMessageShareData", "updateTimelineShareData"],
|
configAppMessage);
|
}
|
},
|
// 授权关闭
|
authColse: function(e) {
|
this.isShowAuth = e
|
},
|
// 产品切换
|
changeCategoryTab(index, isClick) {
|
let that = this;
|
that.categoryIndex = index;
|
if (isClick) {
|
that.clickTrack('cate', {
|
name: that.categoryList[that.categoryIndex].name
|
})
|
}
|
that.loadingGood = true;
|
that.where.page = 1;
|
that.loadend = false;
|
that.where.cid = that.categoryList[that.categoryIndex].id;
|
that.get_product_list();
|
},
|
/**
|
* 获取专区列表
|
*/
|
getStoreZoneAndCouponList: function() {
|
let that = this;
|
// that.$set(that, 'zoneList', []);
|
// that.$set(that, 'couponList', []);
|
uni.showLoading()
|
getStoreZoneAndCouponList({}).then(res => {
|
let zoneList = [];
|
res.data.storeZoneList.forEach((item, index) => {
|
if (item.isShow) {
|
item.uniKey = 'storeZoneList' + zoneList.length;
|
zoneList.push(item);
|
}
|
})
|
that.$set(that, 'zoneList', zoneList);
|
|
let useNum = 0;
|
res.data.storeCouponList.forEach((item, index) => {
|
item.uniKey = 'storeCouponList' + index;
|
if (item.isUse) {
|
useNum++;
|
}
|
})
|
if (useNum >= res.data.storeCouponList.length) {
|
that.isGetWholeCoupon = true;
|
} else {
|
that.isGetWholeCoupon = false;
|
}
|
if(that.$store.getters.isLogin){
|
handsList().then(giveRes=>{
|
res.data.storeCouponList.push({
|
moneyType:4,
|
userLvType:this.userInfo.level,
|
isUse:true,
|
name:''
|
})
|
that.$set(that, 'couponList', (giveRes.data||[]).concat(res.data.storeCouponList));
|
})
|
handsCoupon().then(res=>{
|
if(res.code==200){
|
that.$refs.popCoupon.show();
|
}
|
});
|
//检查用户有可以手动领取导入优惠券记录
|
// that.$refs.popCoupon.show();
|
}
|
that.$nextTick(() => {
|
that.$forceUpdate();
|
uni.hideLoading()
|
})
|
}).catch((e) => {
|
console.log(10000001, e);
|
uni.hideLoading()
|
});
|
},
|
resetCoupon(couponIds){
|
console.log('resetCoupon');
|
let that=this;
|
let hasCoupon4 = false;
|
let useNum=0;
|
that.couponList.forEach((item, index) => {
|
if (couponIds.indexOf(item.id)>=0||couponIds.indexOf(item.id+'')>=0) {
|
item.isUse=true;
|
that.$set(that.couponList[index],'isUse',true);
|
if (item.moneyType == 4) {
|
hasCoupon4 = true;
|
}
|
}
|
if(item.isUse){
|
useNum++;
|
}
|
});
|
if(useNum>=that.couponList.length){
|
that.isGetWholeCoupon = true;
|
}
|
if (hasCoupon4) {
|
that.changeCategoryTab(that.categoryIndex);
|
}
|
},
|
getLast10Order: function() {
|
let that = this;
|
getLast10Order({}).then(res => {
|
let data = res.data.concat(JSON.parse(JSON.stringify(res.data)));
|
data.forEach((item, index) => {
|
item.uniKey = 'buyList' + index;
|
});
|
that.$set(that, 'buyList', data);
|
});
|
},
|
getCategoryList: function() {
|
let that = this;
|
getCategoryList().then(res => {
|
res.data.forEach((item, index) => {
|
// if (!item.show2Category) {
|
// item.child.sort((a, b) => {
|
// return a.sort - b.sort;
|
// });
|
// that.categoryList = that.categoryList.concat(item.child)
|
// }
|
res.data[index]['uniKey'] = 'categoryList' + index;
|
});
|
that.categoryList = res.data;
|
that.changeCategoryTab(that.categoryIndex);
|
})
|
},
|
get_product_list: function() {
|
let that = this;
|
if (that.loadend) return;
|
if (that.loading) return;
|
that.loading = true;
|
that.loadTitle = '';
|
that.isPause = true;
|
getProductslist(that.where).then(res => {
|
let list = res.data.list;
|
|
that.loading = false;
|
if (that.where.page > 1) {
|
list = that.productList.concat(list);
|
}
|
list.forEach((item, index) => {
|
item.uniKey = 'productList' + index;
|
})
|
that.$set(that, 'productList', list);
|
if (that.productList.length > 4) {
|
that.$set(that, 'scrollHeight', that.pageHeight - 300);
|
} else {
|
that.$set(that, 'scrollHeight', 484 * Math.round(that.productList.length / 2) + 120);
|
}
|
|
if (that.where.page == 1) {
|
that.scrollTop = that.oldScrollTop;
|
that.$nextTick(() => {
|
that.scrollTop = 0;
|
});
|
}
|
|
let loadend = list.length < that.where.limit;
|
if (that.where.page >= res.data.totalPage) {
|
loadend = true;
|
that.$set(that.where, 'page', 1);
|
} else {
|
that.$set(that.where, 'page', that.where.page + 1);
|
}
|
that.loadend = loadend;
|
|
that.isPause = false;
|
that.$nextTick(() => {
|
that.loadingGood = false;
|
})
|
}).catch(err => {
|
console.log(1000000002, err);
|
that.loading = false;
|
that.isPause = false;
|
that.loadTitle = '加载更多';
|
that.$nextTick(() => {
|
that.loadingGood = false;
|
})
|
});
|
},
|
goodlistScroll: function(e) {
|
this.oldScrollTop = e.detail.scrollTop;
|
},
|
getMdayLast: function() {
|
let that = this;
|
uni.showLoading();
|
getMdayLast({}).then(res => {
|
if(res.data.mday){
|
that.hasLottery=true;
|
}
|
});
|
},
|
},
|
mounted() {
|
let that = this
|
// #ifdef H5
|
//that.getChatUrL();
|
// 获取H5 搜索框高度
|
let appSearchH = uni.createSelectorQuery().select(".serch-wrapper");
|
appSearchH.boundingClientRect(function(data) {
|
that.searchH = data.height
|
}).exec()
|
// #endif
|
},
|
/**
|
* 用户点击右上角分享
|
*/
|
// #ifdef MP
|
onShareAppMessage: function(options) {
|
let shareUrl = '/pages/index/index';
|
if (this.$store.getters.belong) {
|
shareUrl += '?' + this.$util.setShareBelong(this.$store.getters.belong);
|
}
|
if(this.$store.getters.uid){
|
if(shareUrl.indexOf('?')>0){
|
shareUrl+='&spread=' + this.$store.getters.uid;
|
}else{
|
shareUrl+='?spread=' + this.$store.getters.uid;
|
}
|
}
|
let pages = getCurrentPages(),
|
currPage = pages[pages.length - 1];
|
this.addTrack('yy_contentPageShare', {
|
'sharePosition_var': options.from == 'button' ? '页面分享按钮' : '页面顶部',
|
'shareMethod_var': '微信好友', //保存海报
|
'pageTitle_var': '首页',
|
'pageType_var': '首页',
|
'pagePath_var': currPage.route,
|
'productID_var': '-',
|
'productName_var': '-',
|
'contentId_var': '-',
|
'contentName_var': '-',
|
'contentType_var': '-',
|
'contentLabel_var': '-',
|
});
|
return {
|
title: this.configApi.title,
|
imageUrl: this.configApi.img,
|
desc: this.configApi.synopsis,
|
path: shareUrl
|
};
|
},
|
// #endif
|
}
|
</script>
|
<style>
|
page {
|
display: flex;
|
flex-direction: column;
|
height: 100%;
|
/* #ifdef H5 */
|
background-color: #fff;
|
/* #endif */
|
|
}
|
</style>
|
<style lang="scss">
|
.index_info{
|
width: 690rpx;
|
height: 70rpx;
|
display: block;
|
margin: 0 auto;
|
margin-bottom: 20rpx;
|
}
|
.notice {
|
width: 100%;
|
height: 70rpx;
|
border-radius: 10rpx;
|
background-color: #fff;
|
margin-bottom: 25rpx;
|
line-height: 70rpx;
|
padding: 0 14rpx;
|
|
.line {
|
color: #CCCCCC;
|
}
|
|
.pic {
|
width: 130rpx;
|
height: 36rpx;
|
|
image {
|
width: 100%;
|
height: 100%;
|
display: block !important;
|
}
|
}
|
|
.swipers {
|
height: 100%;
|
width: 444rpx;
|
overflow: hidden;
|
|
swiper {
|
height: 100%;
|
width: 100%;
|
overflow: hidden;
|
font-size: 22rpx;
|
color: #333333;
|
}
|
}
|
|
.iconfont {
|
color: #999999;
|
font-size: 20rpx;
|
}
|
}
|
|
.sticky-box {
|
/* #ifndef APP-PLUS-NVUE */
|
display: flex;
|
position: -webkit-sticky;
|
/* #endif */
|
position: sticky;
|
/* #ifdef H5*/
|
top: var(--window-top);
|
/* #endif */
|
|
z-index: 99;
|
flex-direction: row;
|
margin: 0px;
|
background: #f5f5f5;
|
padding: 30rpx 0;
|
}
|
|
.listAll {
|
width: 20%;
|
text-indent: 62rpx;
|
font-size: 30rpx;
|
border-left: 1px #eee solid;
|
margin: 1% 0;
|
padding: 5rpx;
|
position: relative;
|
|
image {
|
position: absolute;
|
left: 20rpx;
|
top: 8rpx;
|
}
|
}
|
|
.tab {
|
position: relative;
|
display: flex;
|
font-size: 28rpx;
|
white-space: nowrap;
|
|
&__item {
|
flex: 1;
|
padding: 0 20rpx;
|
text-align: center;
|
height: 60rpx;
|
line-height: 60rpx;
|
color: #666;
|
|
&.active {
|
color: #09C2C9;
|
}
|
}
|
}
|
|
.tab__line {
|
display: block;
|
height: 6rpx;
|
position: absolute;
|
bottom: 0;
|
left: 0;
|
z-index: 1;
|
border-radius: 3rpx;
|
position: relative;
|
background: #2FC6CD;
|
}
|
|
.scroll-view_H {
|
/* 文本不会换行,文本会在在同一行上继续,直到遇到 <br> 标签为止。 */
|
white-space: nowrap;
|
width: 100%;
|
}
|
|
|
.privacy-wrapper {
|
z-index: 999;
|
position: fixed;
|
left: 0;
|
top: 0;
|
width: 100%;
|
height: 100%;
|
background: #7F7F7F;
|
|
.privacy-box {
|
position: absolute;
|
left: 50%;
|
top: 50%;
|
transform: translate(-50%, -50%);
|
width: 560rpx;
|
padding: 50rpx 45rpx 0;
|
background: #fff;
|
border-radius: 20rpx;
|
|
.title {
|
text-align: center;
|
font-size: 32rpx;
|
text-align: center;
|
color: #333;
|
font-weight: 700;
|
}
|
|
.content {
|
margin-top: 20rpx;
|
line-height: 1.5;
|
font-size: 26rpx;
|
color: #666;
|
text-indent: 54rpx;
|
|
i {
|
font-style: normal;
|
color: $theme-color;
|
}
|
}
|
|
.btn-box {
|
margin-top: 40rpx;
|
text-align: center;
|
font-size: 30rpx;
|
|
.btn-item {
|
height: 82rpx;
|
line-height: 82rpx;
|
background: linear-gradient(90deg, #F67A38 0%, #F11B09 100%);
|
color: #fff;
|
border-radius: 41rpx;
|
}
|
|
.btn {
|
padding: 30rpx 0;
|
}
|
}
|
}
|
}
|
|
.page-index {
|
background-color: #f5f5f5;
|
|
.mp-header {
|
z-index: 999;
|
position: fixed;
|
left: 0;
|
top: 0;
|
width: 100%;
|
|
background: url("https://ossacmall.bluedeer.com.cn/app/static/images/page_commonBg.png") center top/100% auto no-repeat;
|
.header {
|
padding: 28rpx 30rpx;
|
padding-top: 88rpx;
|
}
|
|
.serch-wrapper {
|
width: 750rpx;
|
margin: 0 auto;
|
height: 100%;
|
align-items: center;
|
padding: 0 50rpx 0 160rpx;
|
box-sizing: border-box;
|
position: relative;
|
|
.logo {
|
width: 130rpx;
|
height: 130rpx;
|
border-radius: 50%;
|
position: absolute;
|
left: 0;
|
top: 50%;
|
margin-top: -65rpx;
|
}
|
|
image {
|
display: block;
|
width: 130rpx !important;
|
height: 130rpx !important;
|
box-sizing: border-box;
|
}
|
|
.input {
|
display: flex;
|
align-items: center;
|
width: 300rpx;
|
padding: 0 0 0 30rpx;
|
background: #ffffff;
|
// box-shadow:inset 0 0 0 1rpx #dcd8c5;
|
border-radius: 25rpx;
|
color: #cccccc;
|
font-size: 28rpx;
|
line-height: 30rpx;
|
height: 30rpx;
|
flex-wrap: nowrap;
|
|
.iconfont {
|
margin-right: 20rpx;
|
font-size: 26rpx;
|
color: #cccccc;
|
}
|
}
|
}
|
}
|
|
|
.swiper {
|
position: relative;
|
width: 690rpx;
|
height: 410rpx;
|
margin: 0 auto;
|
border-radius: 10rpx;
|
overflow: hidden;
|
margin-bottom: 25rpx;
|
/* #ifdef MP */
|
z-index: 10;
|
margin-top: 40rpx;
|
|
/* #endif */
|
swiper,
|
.swiper-item {
|
width: 100%;
|
height: 410rpx;
|
}
|
|
image {
|
width: 100%;
|
height: 387rpx;
|
border-radius: 10rpx;
|
}
|
|
.wx-swiper-dots {
|
bottom: 0rpx;
|
}
|
|
.wx-swiper-dots .wx-swiper-dot {
|
width: 8rpx;
|
height: 8rpx;
|
border-radius: 4rpx;
|
}
|
|
.wx-swiper-dots .wx-swiper-dot-active {
|
width: 20rpx;
|
}
|
|
.wx-swiper-dots .wx-swiper-dot:nth-of-type(n+2) {
|
margin-left: 15rpx;
|
}
|
}
|
|
.nav {
|
opacity: 1;
|
border-radius: 14rpx;
|
width: 690rpx;
|
margin: 0 auto;
|
margin-bottom: 30rpx;
|
|
.item {
|
display: flex;
|
flex-direction: column;
|
align-items: center;
|
justify-content: center;
|
width: 20%;
|
margin-top: 15rpx;
|
|
:nth-child(1),
|
:nth-child(2),
|
:nth-child(3),
|
:nth-child(4),
|
:nth-child(5) {
|
margin-top: 0;
|
}
|
|
.image {
|
width: 136rpx;
|
height: 136rpx;
|
display: block;
|
margin-left: 15rpx !important;
|
display: block;
|
}
|
|
.menu-txt {
|
font-size: 24rpx;
|
color: #000000;
|
}
|
}
|
}
|
|
|
.nav-bd {
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
|
.item {
|
display: flex;
|
flex-direction: column;
|
align-items: center;
|
justify-content: center;
|
|
.txt {
|
font-size: 32rpx;
|
color: #000000;
|
}
|
|
.label {
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
width: 124rpx;
|
height: 32rpx;
|
margin-top: 5rpx;
|
font-size: 24rpx;
|
color: #999;
|
}
|
|
&.active {
|
color: $theme-color;
|
|
.txt {
|
color: $theme-color;
|
}
|
|
.label {
|
background: linear-gradient(90deg, $bg-star 0%, $bg-end 100%);
|
border-radius: 16rpx;
|
color: #fff;
|
}
|
}
|
}
|
}
|
|
.index-product-wrapper {
|
margin-bottom: 110rpx;
|
|
&.on {
|
min-height: 1500rpx;
|
}
|
|
.list-box {
|
display: flex;
|
flex-wrap: wrap;
|
justify-content: space-between;
|
|
.item {
|
width: 335rpx;
|
margin-bottom: 20rpx;
|
background-color: #fff;
|
border-radius: 10rpx;
|
overflow: hidden;
|
|
image {
|
width: 100%;
|
height: 330rpx;
|
}
|
|
.text-info {
|
padding: 10rpx 20rpx 15rpx;
|
|
.title {
|
color: #222222;
|
}
|
|
.old-price {
|
margin-top: 8rpx;
|
font-size: 26rpx;
|
color: #AAAAAA;
|
text-decoration: line-through;
|
|
text {
|
margin-right: 2px;
|
font-size: 20rpx;
|
}
|
}
|
|
.price {
|
display: flex;
|
align-items: flex-end;
|
color: $theme-color;
|
font-size: 34rpx;
|
font-weight: 800;
|
|
text {
|
padding-bottom: 4rpx;
|
font-size: 24rpx;
|
font-weight: 800;
|
}
|
|
.txt {
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
width: 28rpx;
|
height: 28rpx;
|
margin-left: 15rpx;
|
margin-bottom: 10rpx;
|
border: 1px solid $theme-color;
|
border-radius: 4rpx;
|
font-size: 22rpx;
|
font-weight: normal;
|
}
|
}
|
}
|
}
|
|
&.on {
|
display: flex;
|
}
|
}
|
}
|
}
|
|
.zoneList_title {
|
font-size: 34rpx;
|
line-height: 48rpx;
|
width: 690rpx;
|
margin: 0 auto;
|
margin-bottom: 15rpx;
|
font-weight: bold;
|
color: #000000;
|
}
|
|
.zoneList_box {
|
width: 100%;
|
height: 305rpx;
|
|
.zoneList_wrapper {
|
width: max-content;
|
white-space: nowrap;
|
height: 305rpx;
|
}
|
|
.zoneList_item {
|
display: inline-block;
|
width: 540rpx;
|
height: 305rpx;
|
margin-left: 30rpx;
|
|
:last-child {
|
margin-right: 30rpx;
|
}
|
|
image {
|
width: 540rpx;
|
height: 305rpx;
|
border-radius: 16rpx;
|
}
|
}
|
|
&.isSingle {
|
height: 390rpx;
|
|
.zoneList_item {
|
width: 690rpx;
|
height: 390rpx;
|
margin-right: 0;
|
|
image {
|
width: 690rpx;
|
height: 390rpx;
|
}
|
}
|
}
|
}
|
|
.pictrue {
|
position: relative;
|
}
|
|
.fixed {
|
z-index: 100;
|
position: fixed;
|
left: 0;
|
top: 0;
|
background: linear-gradient(90deg, red 50%, #ff5400 100%);
|
|
}
|
|
.mores-txt {
|
width: 100%;
|
align-items: center;
|
justify-content: center;
|
height: 70rpx;
|
color: #999;
|
font-size: 24rpx;
|
|
.iconfont {
|
margin-top: 2rpx;
|
font-size: 20rpx;
|
}
|
}
|
|
|
|
.mp-bg {
|
width: 100%;
|
height: 900rpx;
|
background-color: #f5f5f5;
|
position: absolute;
|
left: 0;
|
top: 0;
|
background: url("https://ossacmall.bluedeer.com.cn/app/static/images/page_commonBg.png") center top/100% auto no-repeat;
|
// border-radius: 0 0 30rpx 30rpx;
|
}
|
|
.user_info {
|
width: 690rpx;
|
height: 107rpx;
|
margin: 0 auto;
|
margin-top: 15rpx;
|
position: relative;
|
|
.user_head {
|
width: 84rpx;
|
height: 84rpx;
|
box-sizing: border-box;
|
border: 2rpx solid #FFE20E;
|
background-color: #f5f5f5;
|
border-radius: 50%;
|
overflow: hidden;
|
|
image {
|
width: 84rpx;
|
height: 84rpx;
|
}
|
}
|
|
.user_level {
|
width: 110rpx;
|
height: 45rpx;
|
position: absolute;
|
left: 106rpx;
|
top: 45rpx;
|
|
image {
|
width: 110rpx;
|
height: 45rpx;
|
}
|
}
|
|
.user_name,
|
.user_loginTips {
|
font-size: 31rpx;
|
line-height: 46rpx;
|
color: #000000;
|
font-weight: bold;
|
position: absolute;
|
left: 106rpx;
|
top: 0;
|
background: none;
|
}
|
|
.user_careNum {
|
color: #333333;
|
position: absolute;
|
right: 0;
|
top: 0;
|
text-align: right;
|
font-size: 31rpx;
|
line-height: 46rpx;
|
|
.num {
|
font-size: 40rpx;
|
font-weight: bold;
|
}
|
|
.label {
|
width: max-content;
|
font-size: 21rpx;
|
line-height: 42rpx;
|
position: absolute;
|
right: 0;
|
top: 46rpx;
|
padding-right: 30rpx;
|
background: url("https://ossacmall.bluedeer.com.cn/app/static/images/i_info.png") right center/20rpx auto no-repeat;
|
}
|
}
|
|
.btn_vip {
|
width: max-content;
|
position: absolute;
|
right: 0;
|
font-size: 21rpx;
|
line-height: 42rpx;
|
left: 226rpx;
|
top: 46rpx;
|
color: #333333;
|
|
.iconfont {
|
font-size: 21rpx !important;
|
}
|
}
|
|
.btn_toLogin {
|
position: absolute;
|
left: 106rpx;
|
top: 30rpx;
|
font-size: 21rpx;
|
line-height: 82rpx;
|
color: #333333;
|
|
.iconfont {
|
font-size: 21rpx !important;
|
}
|
}
|
}
|
|
.buy_list {
|
width: 100%;
|
height: 48rpx;
|
overflow: hidden;
|
position: relative;
|
margin-top: 10rpx;
|
|
@keyframes moveAni {
|
0% {
|
transform: none;
|
}
|
|
100% {
|
transform: translate(-50%, 0)
|
}
|
}
|
|
.buy_wrapper {
|
width: max-content;
|
white-space: nowrap;
|
animation: moveAni 1s linear both infinite;
|
}
|
|
.buy_item {
|
display: inline-block;
|
margin: 0 5rpx;
|
width: max-content;
|
font-size: 19rpx;
|
line-height: 48rpx;
|
background-color: rgba(255, 255, 255, .8);
|
color: #333333;
|
padding-left: 1em;
|
padding-right: 1em;
|
border-radius: 24rpx;
|
}
|
}
|
|
.stats {
|
position: absolute;
|
left: 0px;
|
top: 0px;
|
z-index: 2000000;
|
width: 750rpx;
|
height: var(--status-bar-height);
|
background: #ffffff;
|
}
|
|
.couponList {
|
width: 690rpx;
|
height: 523rpx;
|
margin: 0 auto;
|
margin-bottom: 30rpx;
|
position: relative;
|
|
.couponList_title {
|
position: absolute;
|
left: 30rpx;
|
top: 60rpx;
|
color: #ffffff;
|
font-size: 40rpx;
|
font-weight: bold;
|
}
|
|
image {
|
width: 690rpx;
|
height: 523rpx;
|
}
|
|
.couponList_btn {
|
font-size: 24rpx;
|
line-height: 48rpx;
|
color: #000000;
|
text-align: right;
|
position: absolute;
|
right: 34rpx;
|
top: 138rpx;
|
padding-right: 42rpx;
|
text-decoration: underline;
|
background: url("https://ossacmall.bluedeer.com.cn/app/static/images/h_hand.gif") right center/contain no-repeat;
|
}
|
|
.couponList_box {
|
width: 630rpx;
|
height: 260rpx;
|
position: absolute;
|
left: 30rpx;
|
top: 200rpx;
|
overflow: hidden;
|
|
.couponList_wrapper {
|
white-space: nowrap;
|
}
|
|
.couponList_item {
|
width: 231rpx;
|
height: 260rpx;
|
display: inline-block;
|
position: relative;
|
background: url("https://ossacmall.bluedeer.com.cn/app/static/images/coupon_itemBg.png") center center/100% 100% no-repeat;
|
margin-right: 25rpx;
|
|
:last-child {
|
margin-right: 0;
|
}
|
|
.give {
|
font-weight: bold;
|
font-size: 19rpx;
|
color: #FFFFFF;
|
text-align: center;
|
font-style: normal;
|
text-transform: none;
|
background-color: #016DCC;
|
border-radius: 14rpx 14rpx 14rpx 0;
|
width: 49rpx;
|
height: 28rpx;
|
line-height: 28rpx;
|
position: absolute;
|
left: 8rpx;
|
top: 0;
|
z-index: 2;
|
}
|
|
.amount {
|
font-size: 53rpx;
|
line-height: 95rpx;
|
width: max-content;
|
position: absolute;
|
left: 50%;
|
transform: translate(-50%, 0);
|
top: 34rpx;
|
color: #000000;
|
font-weight: bold;
|
text-align: center;
|
|
.unit {
|
font-size: 0.5em;
|
}
|
}
|
|
.amountSmall {
|
font-size: 32rpx;
|
line-height: 56rpx;
|
top: 32rpx;
|
|
.text2 {
|
display: block;
|
margin: 0 auto;
|
font-size: 28rpx;
|
line-height: 36rpx;
|
width: max-content;
|
padding: 0 21rpx;
|
border: 1rpx solid #303030;
|
}
|
}
|
|
.label {
|
font-size: 24rpx;
|
lineh-height: 30rpx;
|
color: #000000;
|
text-align: center;
|
position: absolute;
|
width: 100%;
|
left: 0;
|
top: -50rpx;
|
}
|
|
.name {
|
width: 90%;
|
left: 5%;
|
line-height: 23rpx;
|
font-size: 22rpx;
|
color: #000000;
|
text-align: center;
|
position: absolute;
|
top: 135rpx;
|
transform: translate(0, -50%);
|
white-space: normal;
|
word-break: break-all;
|
}
|
|
.btn {
|
position: absolute;
|
width: 130rpx;
|
font-size: 23rpx;
|
line-height: 45rpx;
|
text-align: center;
|
background: #FFE20E;
|
border-radius: 8rpx 8rpx 8rpx 8rpx;
|
left: 50%;
|
margin-left: -65rpx;
|
bottom: 27rpx;
|
|
&used {
|
background: #efefef;
|
}
|
}
|
}
|
}
|
}
|
|
.goods_menuBox {
|
width: 100%;
|
box-sizing: border-box;
|
// background: linear-gradient(180deg, #f5f5f5 0%, #ffffff 100%);
|
background-color: #f5f5f5;
|
position: -webkit-sticky;
|
position: sticky;
|
/* #ifdef H5*/
|
top: var(--window-top);
|
/* #endif */
|
z-index: 99;
|
|
.subMenu {
|
width: 100%;
|
}
|
|
.subMenu_wrapper {
|
width: max-content;
|
white-space: nowrap;
|
padding-left: 30rpx;
|
}
|
|
.subMenu_item {
|
// display: inline-block;
|
// min-width: 3em;
|
text-align: center;
|
font-size: 27rpx;
|
color: #979797;
|
height: 100rpx;
|
box-sizing: border-box;
|
margin-right: 10rpx;
|
.text{
|
width: max-content;
|
display: inline-block;
|
position: relative;
|
line-height: 40rpx;
|
padding-left: 14rpx;
|
padding-right: 14rpx;
|
margin-top:30rpx;
|
margin-bottom: 30rpx;
|
}
|
}
|
|
.subMenu_item:last-child {
|
margin-right: 30rpx;
|
}
|
|
.subMenu_item.on {
|
color: #ffffff;
|
font-weight: bold;
|
position: relative;
|
.text {
|
background: linear-gradient(to right,#ffdc37,#fd9b2b);
|
border-radius: 20rpx;
|
font-weight: bold;
|
}
|
}
|
|
}
|
|
.goodsSection {
|
width: 690rpx;
|
position: relative;
|
margin: 0 auto;
|
|
|
.goodsList {
|
height: 100rpx;
|
overflow: hidden;
|
}
|
|
.list {
|
.list_column{
|
}
|
}
|
|
.loadingTips {
|
width: max-content;
|
padding-left: 60rpx;
|
font-size: 27rpx;
|
line-height: 60rpx;
|
margin: 0 auto;
|
color: #DDDDDD;
|
background: url('https://ossacmall.bluedeer.com.cn/app/static/images/h_loading.png') left center/41rpx auto no-repeat;
|
}
|
|
.pauseView {
|
width: 100%;
|
height: 100%;
|
position: absolute;
|
left: 0;
|
top: 0;
|
z-index: 2;
|
}
|
}
|
.specialZone_box{
|
padding: 30vw 0 0 0;
|
background-color: red;
|
.specialZone_item{
|
width: 33%;
|
margin-bottom: 10vw;
|
float: left;
|
.specialGoodItem_image{
|
display: block;
|
width: 20vw;
|
height: 20vw;
|
margin: 0 auto;
|
}
|
}
|
}
|
.index_lottery{
|
width: 687rpx;
|
margin: 45rpx auto 0 auto;
|
.index_lottery_img{
|
display: block;
|
width: 100%;
|
height: auto;
|
}
|
}
|
</style>
|