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.
 
 
 
 

881 lines
20 KiB

<template>
<view class="productSort">
<!-- <view class="page-top-box" :class="isFixed == true ? 'on' : ''">
<view class="top-box acea-row row-between-wrapper">
<view class="top-box-l acea-row row-middle">
<image src="../../static/images/localtion.png"></image>
<text>武汉</text>
</view>
<view class="cart-btn-box" @click="goShoppingCart()">
<image src="../../static/images/cart.png"></image>
</view>
</view>
<div class="index">
<view class="header acea-row row-center-wrapper">
<view @click="goGoodSearch()" class="search acea-row row-middle">
<text class="iconfont icon-xiazai5"></text>搜索商品
</view>
</view>
</div>
</view> -->
<!-- <view class="banner-img-box acea-row row-between-wrapper">
<view class="img-box-l">
<image src="https://download.cyjyyjy.com/life1.png" @click="alertMessage('功能开发中...')"></image>
</view>
<view class="img-box-r">
<image src="https://download.cyjyyjy.com/life2.png" @click="alertMessage('功能开发中...')"></image>
<image src="https://download.cyjyyjy.com/life3.png" @click="alertMessage('功能开发中...')"></image>
</view>
</view> -->
<!-- 顶部主页 -->
<view class="main-box">
<view class="back-bg"><image src="../../static/images/life-bg.png" mode=""></image></view>
<view class="top-logo acea-row row-center" :style="'top:' + menuTop + 'px;height:' + menuHeight + 'px;line-height: ' + menuHeight + 'px;'">禪易生态云</view>
<view class="details-btn">了解详情</view>
</view>
<!-- 云快讯 -->
<view class="yun-box">
<view class="acea-row row-between-wrapper">
<image src="../../static/images/yun.png" class="headline-yun"></image>
<view class="more-r">
<text>查看更多</text>
<image src="../../static/images/home/arrow-r.png"></image>
</view>
</view>
<view class="rotaion">
<vSwiper :imgs="yunList"></vSwiper>
</view>
</view>
<!-- 最新活动 -->
<view class="act-box" >
<view class="headline"><image src="../../static/images/new-act.png" mode=""></image></view>
<scroll-view class="scroll-view_H" scroll-x="true">
<view class="slide-left" v-for="(item,index) in activity" :key="index" @tap="toActiveDetail" :data-id="item.id">
<view class="act-title">{{item.name}}</view>
<view class="resource-list acea-row-nowrap">
<image :src="item.images" class="act-img" mode="aspectFill"></image>
<view>
<view class="act-time acea-row row-left">
<image src="../../static/images/act-time.png" mode=""></image>
<view>{{item.activityStartTime.split(' ')[0]}}至{{item.activityEndTime.split(' ')[0]}}</view>
</view>
<view class="act-adress acea-row row-left">
<image src="../../static/images/act-address.png" mode=""></image>
<view class="line1">{{item.address}}</view>
</view>
<view class="acea-row row-between-wrapper act-price">
<text class="act-i">进行中</text>
<text class="act-p">¥{{item.price}}</text>
</view>
</view>
</view>
<view class="act-bottom acea-row row-middle">
<view class="acea-row row-middle act-num">
<image src="../../static/images/cart.png"></image>
<image src="../../static/images/cart.png"></image>
<image src="../../static/images/cart.png"></image>
<text>15人报名</text>
</view>
<view class="enter-btn">去报名</view>
</view>
</view>
</scroll-view>
</view>
<!-- 推荐供需 -->
<view class="rec-box">
<view class="headline"><image src="../../static/images/rec-headline.png" mode=""></image></view>
<view class="rec-switch">
<view class="rec-title acea-row">
<view class="rec-l " @click="tabClick(1)">
<image src="../../static/images/rec-bg.png" class="rec-bg" v-show="active == 1"></image>
<view class="rec-t acea-row row-center-wrapper">
<image src="../../static/images/rec-icon1.png" mode=""></image>
<view>需求</view>
</view>
</view>
<view class="rec-r " @click="tabClick(2)">
<image src="../../static/images/rec-bg.png" class="rec-bg" v-show="active == 2"></image>
<view class="rec-t acea-row row-center-wrapper">
<image src="../../static/images/rec-icon2.png" mode=""></image>
<view>资源</view>
</view>
</view>
</view>
<view class="rec-switch-a">
<view class="list-box" v-if="active == 1">
<view class="rec-list" >
<view class="acea-row row-middle">
<image src="../../static/images/rec-icon2.png" mode=""></image>
<view class="rec-name">李子龙111</view>
<view class="rec-address">武汉</view>
<view class="rec-end acea-row row-right">2021.8.30截止报名</view>
</view>
<view class="rec-message">我有景区方面资源,洽谈商务合作...</view>
</view>
<view class="rec-list" >
<view class="acea-row row-middle">
<image src="../../static/images/rec-icon2.png" mode=""></image>
<view class="rec-name">李大龙</view>
<view class="rec-address">武汉</view>
<view class="rec-end acea-row row-right">2021.8.30截止报名</view>
</view>
<view class="rec-message">我有景区方面资源,洽谈商务合作...</view>
</view>
</view>
<view class="list-box" v-if="active == 2">
<view class="rec-list" >
<view class="acea-row row-middle">
<image src="../../static/images/rec-icon2.png" mode=""></image>
<view class="rec-name">李木龙</view>
<view class="rec-address">武汉</view>
<view class="rec-end acea-row row-right">2021.8.30截止报名</view>
</view>
<view class="rec-message">我有景区方面资源,洽谈商务合作...</view>
</view>
<view class="rec-list" >
<view class="acea-row row-middle">
<image src="../../static/images/rec-icon2.png" mode=""></image>
<view class="rec-name">李子龙111qqq</view>
<view class="rec-address">武汉</view>
<view class="rec-end acea-row row-right">2021.8.30截止报名</view>
</view>
<view class="rec-message">我有景区方面资源,洽谈商务合作...</view>
</view>
</view>
</view>
</view>
</view>
<!-- <view class="category-tab-box">
<scroll-view class="scroll-view_H" scroll-x="true" >
<view class="category-item category-item-active">全部商品</view>
<view class="category-item">至尊保驾</view>
<view class="category-item">优选好房</view>
<view class="category-item">商城福利</view>
<view class="category-item">回头率</view>
</scroll-view>
</view> -->
<view class="warter-box">
<view class="headline">
<image src="../../static/images/rec-title.png" mode=""></image>
</view>
<u-waterfall v-model="flowList" ref="uWaterfall">
<template v-slot:left="{leftList}">
<view class="warter" v-for="(item, index) in leftList" :key="index" @tap="toGoodsDetail(item.id)">
<image class="warter-img" :src="item.image" :index="index" mode="widthFix"></image>
<view class="goodsinfo-box">
<view class="title line2"> {{item.storeName}} </view>
<view class="price-box acea-row row-between-wrapper">
<text class="price">¥{{item.price}}</text>
<text class="old-price">¥{{item.price}}</text>
</view>
</view>
</view>
</template>
<template v-slot:right="{rightList}">
<view class="warter" v-for="(item, index) in rightList" :key="index" @tap="toGoodsDetail(item.id)">
<image class="warter-img" :src="item.image" :index="index" mode="widthFix"></image>
<view class="goodsinfo-box">
<view class="title line2"> {{item.storeName}} </view>
<view class="price-box acea-row row-between-wrapper">
<text class="price">¥{{item.price}}</text>
<text class="old-price">¥{{item.otPrice}}</text>
</view>
</view>
</view>
</template>
</u-waterfall>
<u-loadmore bg-color="rgb(240, 240, 240)" :status="loadStatus" @loadmore="addRandomData"></u-loadmore>
</view>
<tabbar :current="currentTabIndex" @click="tabBarClick"></tabbar>
</view>
</template>
<script>
import { getCategory , getProducts, getArticle, getActivity} from "@/api/store";
import { trim } from "@/utils";
import { mapGetters } from 'vuex'
import tabbar from "../../tabbarComponent/tabbar";
import vSwiper from '@/components/vSwiper.vue'
const app = getApp();
export default {
components: {
tabbar,
vSwiper
},
name: "GoodsClass",
computed: mapGetters(['userInfo']),
props: {},
data: function() {
return {
category: [],
navActive: 0,
search: "",
lock: false,
menuHeight: app.globalData.menuHeight,
navHeight: app.globalData.navHeight,
menuTop: app.globalData.menuTop,
currentTabIndex:3,
flowList:[],
isFixed: false,
loadStatus: 'loadmore',
page: 1,
limit: 10,
isLoad: true, //是否还有更多
yunList: [],
active:1,
show:false,
activity:[],
};
},
watch: {
"$yroute.query.id": function(n) {
if (n) {
this.activeCateId(n);
}
}
},
// onShow: function (options) {
// },
mounted: function() {
this.getProducts();
this.getArticle();
this.getActivity();
},
onReachBottom() {
if(this.isLoad){
this.page = this.page+1
this.getProducts();
}
},
onPullDownRefresh(){
wx.showNavigationBarLoading();
this.isLoad= true
this.page= 1
this.clear().then(()=>{
console.log('清除')
this.getProducts();
})
},
methods: {
async clear(){
this.$refs.uWaterfall.clear();
},
tabBarClick(index){
this.currentTabIndex = index
},
goShoppingCart() {
this.$yrouter.push('/pages/shop/ShoppingCart/index')
},
goGoodSearch() {
this.$yrouter.push("/pages/shop/GoodSearch/index");
},
goGoodsList(child) {
this.$yrouter.push({
path: "/pages/shop/GoodsList/index",
query: { id: child.id, title: child.cateName }
});
},
toGoodsDetail(id){
this.$yrouter.push({
path: "/pages/shop/GoodsCon/index",
query: { id: id }
});
},
activeCateId(n) {
let index = 0;
n = parseInt(n);
if (!n) return;
this.category.forEach((cate, i) => {
if (cate.id === n) index = i;
});
if (index !== this.navActive) {
this.asideTap(index);
}
},
loadCategoryData() {
getCategory().then(res => {
this.category = res.data;
this.$nextTick(() => {
if (this.$yroute.query.id) {
this.activeCateId(this.$yroute.query.id);
}
});
});
},
getArticle(){
let data = {
isHot: 0,
page: 0,
size: 100
}
getArticle(data).then(res=>{
console.log(res)
this.yunList = res.data.content
})
},
getActivity(){
getActivity().then(res=>{
this.activity=res.data.activityList;
console.log(res);
})
},
toActiveDetail(e) {
let id = e.currentTarget.dataset.id;
uni.navigateTo({
url: '/pages/activity/detail/index?id=' + id
});
},
tabClick(i) {
console.log(i,'aiiii')
this.active= i
},
getProducts(){
this.loadStatus = 'loading';
getProducts({page:this.page,limit:this.limit}).then((res)=>{
// console.log(res)
if(this.page > 1){
this.flowList = this.flowList.concat(res.data)
} else{
this.flowList = res.data
}
this.isLoad = this.limit <= res.data.length
if(this.limit <= res.data.length){ //分页数等于返回值的length说明还有
this.isLoad = true
} else{
console.log('没有了')
this.isLoad = false
this.loadStatus = 'nomore';
}
wx.hideNavigationBarLoading()
uni.stopPullDownRefresh()
})
},
submitForm: function() {
var val = trim(this.search);
if (val) {
this.$yrouter.push({
path: "/pages/shop/GoodsList/index",
query: { s: val }
});
setTimeout(() => (this.search = ""), 500);
}
},
asideTap(index) {
this.navActive = index;
},
alertMessage(msg){
uni.showToast({
title: msg,
icon: 'none'
})
},
},
beforeDestroy: function() {
// document.removeEventListener("scroll", this.onScroll, false);
}
};
</script>
<style lang="scss" scoped>
</style>
<style lang="less" scoped>
.productSort {
// height: 100%;
// padding-bottom: 200rpx;
background: #EEEEEE !important;
position: relative;
}
.page-top-box{
width: 100%;
position: fixed;
top: 0;
left: 0;
z-index: 99;
background: #fff;
padding: 0 30rpx 20rpx;
box-shadow: 0px -6px 20px rgba(0, 0, 0, 0.11);
.top-box{
.top-box-l{
font-size: 32rpx;
color: #000;
font-weight: 500;
image{
width: 26rpx;
height: 30rpx;
display: block;
margin-right: 10rpx;
}
}
.cart-btn-box{
width: 50rpx;
height: 50rpx;
image{
width: 100%;
height: 100%;
}
}
}
.index{
height: 96rpx;
.header{
height: 68rpx;
position: static;
padding: 0;
margin-top: 34rpx;
.search{
background-color: #EEEEEE;
border-radius: 8rpx;
}
}
}
}
.main-box{
width: 100%;
height: 522rpx;
position: relative;
}
.back-bg image{
width: 100%;
height: 522rpx;
}
.logo-title image{
margin-left: 20rpx;
width: 80rpx;
height: 50rpx;
}
.top-logo{
position: absolute;
width: 100%;
color: #fff;
font-weight: 600;
font-size: 32rpx;
}
.details-btn{
width: 196rpx;
height: 52rpx;
border: 2rpx solid #FFFFFF;
border-radius: 26px;
position: absolute;
bottom: 100rpx;
left: 50%;
margin-left: -98rpx;
text-align: center;
line-height: 50rpx;
color: #fff;
font-size: 32rpx;
}
// 云快讯
.yun-box{
margin: 8rpx 40rpx 28rpx 40rpx;
}
.headline-yun{
width: 112rpx;
height: 52rpx;
}
.more-r{
font-size: 24rpx;
color: #8B8B8B;
}
.more-r image{
width: 12rpx;
height: 18rpx;
margin-left: 8rpx;
}
.rotaion{
width: 670rpx;
margin-top: 24rpx;
}
// 最新活动
.act-box{
width: 100%;
height: 400rpx;
margin-left: 40rpx;
}
.scroll-view_H{
white-space: nowrap;
width: 100%;
}
.slide-left{
width: 584rpx;
height: 344rpx;
display: inline-block;
border-radius: 16rpx;
background-color: #fff;
padding: 20rpx 32rpx 0 20rpx;
margin-right: 32rpx;
}
.act-title{
font-size: 28rpx;
color: #191919;
}
.resource-list{
width: 100%;
height: 190rpx;
margin: 18rpx 0 14rpx 0;
}
.act-img{
width: 162rpx;
height: 190rpx;
margin-right: 28rpx;
border-radius: 12rpx;
}
.act-adress,.act-time{
margin: 8rpx 0 20rpx 0;
}
.act-adress view,.act-time view{
width: 300rpx;
font-size: 24rpx;
color: #191919;
}
.act-time image{
width: 18rpx;
height: 22rpx;
margin: 7rpx 16rpx 0 0;
}
.act-adress image{
width: 19rpx;
height: 23rpx;
margin: 8rpx 14rpx 0 0;
}
.act-price{
margin-top: 40rpx;
}
.act-i {
font-size: 24rpx;
color: #FF5A0E;
}
.act-p{
font-size: 32rpx;
color: #2A2B2B;
font-weight: 600;
}
.act-bottom{
position: relative;
width: 562rpx;
height: 62rpx;
border-top: 1rpx solid #ECECEC;
}
.act-num image{
width: 36rpx;
height: 36rpx;
border-radius: 50%;
}
.act-num{
min-width: 154rpx;
}
.act-num text{
font-size: 20rpx;
color: #191919;
margin-left: 8rpx;
}
.enter-btn{
width: 138rpx;
height: 40rpx;
line-height: 40rpx;
text-align: center;
background: linear-gradient(39deg, #FF5A0D 0%, #FFAC85 100%);
border-radius: 26rpx;
color: #fff;
position: absolute;
right: 38rpx;
}
// 推荐供需
.rec-box{
width: 100%;
height: 493rpx;
margin: 32rpx 40rpx 8rpx 40rpx;
position: relative;
}
.rec-switch{
width: 670rpx;
height: 423rpx;
margin-top: 18rpx;
background: #FFFFFF;
box-shadow: 0px 6rpx 12rpx rgba(0, 0, 0, 0.16);
border-radius: 20rpx;
overflow: hidden;
}
.rec-bg{
width: 670rpx;
height: 423rpx;
}
.rec-title{
width: 100%;
height: 80rpx;
position: relative;
}
.rev-bg{
width: 376rpx;
height: 80rpx;
position: absolute;
left: 0;
}
.rev-bg2{
width: 376rpx;
height: 80rpx;
position: absolute;
left: 0;
background-image: url(../../static/images/rec-bg.png);
}
.rec-l,.rec-r{
width: 50%;
z-index: 2;
position: relative;
}
.rec-l .rec-bg, .rec-r .rec-bg{
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
}
.rec-r .rec-bg{
transform: rotate(180deg);
}
.rec-t{
width: 100%;
height: 100%;
position: absolute;
z-index: 3;
}
.rec-l image{
width: 37rpx;
height: 37rpx;
margin-right: 8rpx;
}
.rec-r image{
width: 42rpx;
height: 43rpx;
margin-right: 8rpx;
}
.rec-switch-a{
width: 100%;
height: 330rpx;
}
.list-box{
width: 100%;
height: 330rpx;
}
.rec-list{
position: relative;
height: 165rpx;
padding: 33rpx 40rpx 0 40rpx;
}
.rec-list image{
width: 64rpx;
height: 64rpx;
}
.rec-name{
font-size: 28rpx;
color: #1D1D1D;
margin-left: 16rpx;
}
.rec-address{
width: 80rpx;
height: 34rpx;
font-size: 24rpx;
line-height: 34rpx;
color: #FFFFFF;
background: #FF5100;
border-radius: 16px;
text-align: center;
}
.rec-end{
font-size: 24rpx;
color: #707070;
position: absolute;
right: 22rpx;
}
.rec-message{
width: 582rpx;
height: 40rpx;
font-size: 28rpx;
color: #1D1D1D;
margin-top: 15rpx;
}
// .category-tab-box{
// border: 1rpx solid black;
// width: 100%;
// height: 108rpx;
// line-height: 108rpx;
// padding-left: 30rpx;
// // margin-bottom: 30rpx;
// // padding-top: 190rpx;
// .scroll-view_H{
// white-space: nowrap;
// width: 100%;
// .category-item{
// display: inline-block;
// font-size: 28rpx;
// line-height: 40rpx;
// color: #999;
// margin-right: 40rpx;
// &.category-item-active{
// color: #FF6D31;
// font-size: 32rpx;
// font-weight: 500;
// position: relative;
// &::after{
// content: '';
// width: 70rpx;
// height: 8rpx;
// border-radius: 6rpx;
// display: block;
// position: absolute;
// bottom: -24rpx;
// left: 0;
// background: #FF7942;
// }
// }
// }
// }
// }
.headline image{
width: 148rpx;
height: 52rpx;
}
.warter-box{
width: 100%;
padding: 24rpx 0 190rpx 24rpx;
.u-waterfall {
width: 100%;
display: flex;
justify-content: space-between;
.u-column {
.warter {
width: 336rpx !important;
border-radius: 10rpx;
background-color: #ffffff;
position: relative;
overflow: hidden;
box-shadow: 0px 6rpx 12rpx rgba(0, 0, 0, 0.06);
margin-bottom: 20rpx;
image{
width: 100%;
display: block;
}
.goodsinfo-box{
width: 100%;
padding: 12rpx 16rpx;
.title{
font-size: 28rpx;
font-weight: 500;
color: #1D1D1D;
width: 100%;
height: 80rpx;
}
.price{
font-size: 28rpx;
font-weight: bold;
line-height: 40rpx;
color: #FF7942;
}
.old-price{
font-size: 20rpx;
line-height: 28rpx;
color: #BFBFBF;
text-decoration: line-through;
}
}
}
}
}
}
.banner-img-box{
width: 100%;
padding: 220rpx 40rpx 32rpx;
.img-box-l{
width: 324rpx;
height: 400rpx;
image{
width: 100%;
height: 100%;
}
}
.img-box-r{
width: 324rpx;
height: 400rpx;
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: ;
image{
width: 324rpx;
height: 190rpx;
}
}
}
.goods-list-box{
width: 100%;
padding: 0 30rpx;
.goods-list-item{
width: 100%;
.goods-type-box{
image{
width: 94rpx;
height: 94rpx;
}
.t-word{
font-size: 36rpx;
color: #222;
font-weight: 600;
}
}
.goods-list{
width: 100%;
.goods-item{
width: 335rpx;
background: #fff;
margin-right: 10rpx;
margin-bottom: 30rpx;
border-radius: 10rpx;
overflow: hidden;
box-shadow: 0px 6px 12px rgba(0, 0, 0, 0.06);
image{
width: 100%;
height: 278rpx;
}
}
.goods-item:nth-child(2n){
margin-right: 0;
}
.goods-desc-box{
width: 100%;
padding: 16rpx;
font-size: 24rpx;
.goods-name{
line-height: 34rpx;
}
.price{
font-size: 28rpx;
color: #E5270F;
line-height: 40rpx;
margin-bottom: 26rpx;
}
}
}
}
}
</style>