You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
388 lines
11 KiB
388 lines
11 KiB
<template>
|
|
<view>
|
|
<loadlogo v-if="!loadlogo" />
|
|
<view class="localindex" v-if="loadlogo">
|
|
|
|
<!-- 选项卡一 -->
|
|
<view class="b-f" style="padding: 30upx 30upx 0">
|
|
<v-tabs
|
|
:lineScale="0.3"
|
|
:lineRadius="'100rpx'"
|
|
:lineHeight="'6rpx'"
|
|
:fontSize="'30rpx'"
|
|
:paddingItem="'0 22rpx 30rpx'"
|
|
:activeColor="'#ff4444'"
|
|
:lineColor="'#ff4444'"
|
|
v-model="sort"
|
|
:scroll="false"
|
|
:field="'name'"
|
|
:tabs="tags"></v-tabs>
|
|
</view>
|
|
<!-- 选项卡二 -->
|
|
<view style="padding: 30upx;">
|
|
<v-tabs
|
|
:color="'#333333'"
|
|
:bgColor="'#f6f6f6'"
|
|
:activeColor="'#ff4444'"
|
|
:height="'40rpx'"
|
|
:paddingItem="'5rpx 20rpx'"
|
|
:fontSize="'26rpx'"
|
|
:pillsColor="'#FFEBEB'"
|
|
:pillsBorderRadius="'60rpx'"
|
|
v-model="current"
|
|
:field="'name'"
|
|
:tabs="indexData"
|
|
:pills="true"
|
|
line-height="0"
|
|
:bold="false"
|
|
@change="changeTab"></v-tabs>
|
|
</view>
|
|
<view v-if="currentTab ==='activity'">
|
|
<activityData :tabDataList="indexList"></activityData>
|
|
</view>
|
|
<!-- 抢购 -->
|
|
<block v-if="currentTab ==='rush'">
|
|
<view class="b-e6 padding-box-all" style="padding-bottom: 70upx;">
|
|
<goods-style goodsStyleType="rush" :goodslistData="indexList" @remindSuccess="remindSuccess"></goods-style>
|
|
</view>
|
|
</block>
|
|
<!-- 卡券 -->
|
|
<block v-if="currentTab==='coupon'">
|
|
<view class="b-e6 padding-box-all" style="padding-bottom: 70upx;">
|
|
<goods-style goodsStyleType="coupon" :goodslistData="indexList"></goods-style>
|
|
</view>
|
|
</block>
|
|
<!-- 折扣 -->
|
|
<block v-if="currentTab==='halfcard'">
|
|
<view class="b-e6 padding-box-all" style="padding-bottom: 70upx;">
|
|
<card-components :disCardData_two="indexList" disCardType="disCard1" :disType="2"></card-components>
|
|
</view>
|
|
</block>
|
|
<!-- 拼团 -->
|
|
<block v-if="currentTab==='wlfightgroup'">
|
|
<view class="b-e6 padding-box-all" style="padding-bottom: 70upx;">
|
|
<goods-style goodsStyleType="fight" :goodslistData="indexList"></goods-style>
|
|
</view>
|
|
</block>
|
|
<!-- 同城 -->
|
|
<block v-if="currentTab==='pocket'">
|
|
<citywide :citywideList="indexList" @getaver="getaver"></citywide>
|
|
</block>
|
|
<!-- 团购 -->
|
|
<block v-if="currentTab ==='groupon'">
|
|
<view class="b-e6 padding-box-all" style="padding-bottom: 70upx;">
|
|
<goods-style goodsStyleType="groupon" :goodslistData="indexList"></goods-style>
|
|
</view>
|
|
</block>
|
|
<!-- 砍价 -->
|
|
<block v-if="currentTab ==='bargain'">
|
|
<view class="b-e6 padding-box-all" style="padding-bottom: 70upx;">
|
|
<goods-style goodsStyleType="bargain" :goodslistData="indexList"></goods-style>
|
|
</view>
|
|
</block>
|
|
<!-- 大礼包 -->
|
|
<block v-if="currentTab==='package'">
|
|
<view class="b-e6 padding-box-all" style="padding-bottom: 70upx;">
|
|
<giftbag-components :giftData_two="indexList" giftType="gift_type1" :disType="2"></giftbag-components>
|
|
</view>
|
|
</block>
|
|
<!-- 积分 -->
|
|
<block v-if="currentTab==='consumption'">
|
|
<integral :integralList="indexList"></integral>
|
|
</block>
|
|
<!-- <view class="dis-flex goodsList-Box" v-for="(item,index) in indexList" :key="index" @click="toSignUp(item)">
|
|
<view class="goodsImgBox" style="padding-right: 20upx;">
|
|
<image style="width: 200upx;height: 200upx;border-radius: 6upx;" :src="item.thumb" mode=""></image>
|
|
</view>
|
|
<view class="content" >
|
|
<view class="f-30" style="padding-bottom: 15upx;">
|
|
{{item.title}}
|
|
</view>
|
|
<view class="col-9 f-20" style="padding-bottom: 15upx;">
|
|
<view class="dis-il-block" style="width: 350upx;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">
|
|
{{item.address}}
|
|
</view>
|
|
<view style="float: right;">{{item.distance}}</view>
|
|
</view>
|
|
|
|
|
|
<view class="f-22 col-9" style="height: 30upx;line-height: 30upx;padding-bottom: 15upx;">
|
|
<view v-if="item.minprice && item.maxprice">
|
|
价格: <text style="color: #FF4444;font-size: 36upx;padding-left: 10upx;"><text class="f-20">¥</text>{{item.minprice}}</text>
|
|
<text style="padding: 0 10upx;color: #FF4444;">~</text>
|
|
<text style="color: #FF4444;font-size: 36upx;padding-left: 10upx;"><text class="f-20">¥</text>{{item.maxprice}}</text>
|
|
</view>
|
|
<view v-else>
|
|
价格: <text style="color: #FF4444;font-size: 36upx;padding-left: 10upx;"><text class="f-20">¥</text>{{item.price}}</text>
|
|
</view> -->
|
|
<!-- <view >
|
|
最高价:
|
|
</view> -->
|
|
<!-- </view>
|
|
<view >
|
|
<view class="f-20 col-9 dis-il-block" style="margin: 10upx 0 10upx;background-color: #FFEBEB;color: #FF4444;border-radius: 60upx;height: 30upx;line-height: 30upx;padding: 5upx 20upx;">
|
|
{{item.catename}}
|
|
</view>
|
|
</view>
|
|
<view class="f-26 col-f t-c"
|
|
style="position: absolute;background-color: #FF4444;height: 50upx;line-height: 50upx;width: 150upx;border-radius: 60upx;right: 30upx;bottom: 30upx;">
|
|
立即报名
|
|
</view>
|
|
</view>
|
|
</view> -->
|
|
<load-more :isMore="isMore"></load-more>
|
|
</view>
|
|
<TabBars :tabBarAct="0" :pageType="''" />
|
|
<!-- <diypages :diypagesData="diypagesData" :pageData="datas.page" :btngroupData="btngroup" @getChild="getChild" /> -->
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import App from '@/common/js/app.js';
|
|
import Loadlogo from '@/components/template/loadlogo.vue';
|
|
import vTabs from '@/components/v-tabs/v-tabs.vue';
|
|
import TabBars from '@/components/template/tabBar';
|
|
import PopupView from '@/components/template/PopManager.vue';
|
|
import loadMore from '@/components/template/loadmore.vue';
|
|
import activityData from '@/components/template/activityData.vue'
|
|
import cardComponents from '@/components/page/pageComponents/discountCard.vue'
|
|
import giftbagComponents from '@/components/page/pageComponents/giftbag.vue'
|
|
import citywide from '@/components/page/pageComponents/citywide.vue'
|
|
import integral from '@/components/page/pageComponents/integral.vue'
|
|
import goodsStyle from '@/components/page/pageComponents/goodsStyle.vue'
|
|
export default{
|
|
components:{
|
|
Loadlogo,
|
|
vTabs,
|
|
PopupView,
|
|
loadMore,
|
|
TabBars,
|
|
activityData,
|
|
cardComponents,
|
|
giftbagComponents,
|
|
citywide,
|
|
integral,
|
|
goodsStyle
|
|
},
|
|
data(){
|
|
return{
|
|
loadlogo:false,
|
|
indexData:{},
|
|
indexList:[],
|
|
imgstyle:{},
|
|
current:0,
|
|
showCommunity: false,
|
|
page:1,
|
|
page_index:10,
|
|
keyword:'',
|
|
sort:0,
|
|
curLoction:{},
|
|
count:1000,
|
|
isMore:true,
|
|
currentTab:'',
|
|
cate_id:'',
|
|
type:'',
|
|
tags:[]
|
|
}
|
|
},
|
|
onLoad(e) {
|
|
console.log(e);
|
|
this.type = e.type;
|
|
if(e.type == 3){ //根据不同的type转换为不同的插件
|
|
this.currentTab = 'rush'
|
|
}else if(e.type == 4){
|
|
this.currentTab = 'groupon'
|
|
}
|
|
else if(e.type == 5){
|
|
this.currentTab = 'coupon'
|
|
}
|
|
else if(e.type == 6){
|
|
this.currentTab = 'wlfightgroup'
|
|
}
|
|
else if(e.type == 7){
|
|
this.currentTab = 'bargain'
|
|
}
|
|
else if(e.type == 14){
|
|
this.currentTab = 'activity'
|
|
}
|
|
this.cate_id = e.cate_id;
|
|
this.imgstyle = uni.getStorageSync('imgstyle');
|
|
this.clienType = App.getClientType();
|
|
// console.log(this.clienType,'雷影')
|
|
this.curLoction = uni.getStorageSync('curLoction');
|
|
},
|
|
onShow() {
|
|
for(let i = 0; i<this.page;i++){//返回页面的递归数据,保证用户下拉到底部的数据不丢失
|
|
this.getIndexData(true,i);
|
|
}
|
|
},
|
|
watch:{
|
|
sort(){
|
|
this.indexList = [];
|
|
this.getstoreList(true,1);
|
|
}
|
|
},
|
|
onReachBottom() {
|
|
this.onreach();//下拉加载的函数
|
|
},
|
|
methods:{
|
|
gourl(url){
|
|
App.navigationTo({
|
|
url: url
|
|
})
|
|
},
|
|
onreach(){
|
|
if(this.count == this.page) return
|
|
this.page++;
|
|
this.isMore = false;
|
|
this.getstoreList(true);
|
|
},
|
|
toSignUp(item){
|
|
console.log(item);
|
|
App.navigationTo({
|
|
url: `pages/subPages2/coursegoods/coursegoods?id=${item.id}`
|
|
})
|
|
},
|
|
goindex(){
|
|
App.navigationTo({
|
|
url: `pages/mainPages/index/index`
|
|
})
|
|
},
|
|
callPhone(phone) {
|
|
uni.makePhoneCall({
|
|
phoneNumber: phone
|
|
});
|
|
},
|
|
search(){
|
|
this.getstoreList();
|
|
},
|
|
communityShow() {
|
|
this.showCommunity = !this.showCommunity;
|
|
},
|
|
changeTab(e){
|
|
console.log(e);
|
|
this.current = e;
|
|
this.getstoreList();
|
|
},
|
|
bindchange(e){
|
|
console.log(e)
|
|
},
|
|
getIndexData(){
|
|
let _this = this;
|
|
let data = {
|
|
type:_this.type
|
|
}
|
|
App._post_form(
|
|
`&p=goods&do=getGoodsCateList`,
|
|
data,
|
|
res => {
|
|
_this.tags = [];
|
|
console.log(res);
|
|
for(let k in res.data.data){
|
|
_this.tags.push(res.data.data[k]);
|
|
}
|
|
|
|
_this.indexData = res.data.params.class_list;
|
|
let data = {
|
|
name:'全部',
|
|
id:''
|
|
}
|
|
_this.indexData.unshift(data);
|
|
_this.indexData.map((item,index)=>{
|
|
if(item.id == _this.cate_id){
|
|
_this.current = index;
|
|
}
|
|
})
|
|
this.getstoreList();
|
|
},
|
|
false,
|
|
() => {
|
|
_this.loadlogo = true;
|
|
}
|
|
);
|
|
},
|
|
getstoreList(flag,page){
|
|
// debugger
|
|
console.log(this.indexData,this.current);
|
|
let _this = this;
|
|
if(!flag){
|
|
_this.page = 1;
|
|
}
|
|
let data = {
|
|
page: page ||_this.page,
|
|
page_index:_this.page_index,
|
|
keyword:_this.keyword,
|
|
sort:_this.sort + 1,
|
|
cate_id:_this.indexData[_this.current].id,
|
|
lng:_this.curLoction.longitude,
|
|
lat:_this.curLoction.latitude
|
|
};
|
|
App._post_form(
|
|
`&p=${this.currentTab}&do=homeList`,
|
|
data,
|
|
res => {
|
|
console.log(res);
|
|
if(flag){
|
|
if(this.currentTab == 'activity'){
|
|
_this.indexList = _this.indexList.concat(res.data.list);
|
|
}else{
|
|
_this.indexList = _this.indexList.concat(res.data);
|
|
}
|
|
|
|
_this.isMore = true;
|
|
}else{
|
|
if(this.currentTab == 'activity'){
|
|
_this.indexList = res.data.list;
|
|
// _this.count = res.data.total;
|
|
}else{
|
|
_this.indexList = res.data;
|
|
}
|
|
|
|
}
|
|
},
|
|
false,
|
|
() => {
|
|
_this.loadlogo = true;
|
|
_this.isMore = true;
|
|
}
|
|
);
|
|
},
|
|
getChild(e){
|
|
console.log(e)
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style>
|
|
page{
|
|
background-color: #F6F6F6;
|
|
}
|
|
/* @import '../../../../common/css/diyPages.css';
|
|
@import '../../../../common/css/old_diyPages';
|
|
@import '../../../../pages/subPages/goods/index.css'; */
|
|
</style>
|
|
<style lang="scss" scoped>
|
|
@import '../../../../common/css/diyPages.css';
|
|
@import '../../../../common/css/old_diyPages';
|
|
@import '../../../../pages/subPages/goods/index.css';
|
|
.localindex{
|
|
// padding: 30upx;
|
|
padding-bottom: 100upx;
|
|
.seach-box{
|
|
padding: 30upx;
|
|
}
|
|
.goodsList-Box{
|
|
padding: 20upx;
|
|
border-radius: 15upx;
|
|
margin: 0 30upx 20upx;
|
|
position: relative;
|
|
background-color: #FFFFFF;
|
|
.schedule{
|
|
height: 100%;
|
|
border-radius: 60upx;
|
|
background-color: #FF4444;
|
|
}
|
|
}
|
|
}
|
|
</style>
|
|
|