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.

882 lines
20 KiB

3 years ago
<template>
<view class="productSort">
3 years ago
<!-- <view class="page-top-box" :class="isFixed == true ? 'on' : ''">
3 years ago
<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>
3 years ago
</view> -->
<!-- <view class="banner-img-box acea-row row-between-wrapper">
3 years ago
<view class="img-box-l">
3 years ago
<image src="https://download.cyjyyjy.com/life1.png" @click="alertMessage('功能开发中...')"></image>
3 years ago
</view>
<view class="img-box-r">
3 years ago
<image src="https://download.cyjyyjy.com/life2.png" @click="alertMessage('功能开发中...')"></image>
<image src="https://download.cyjyyjy.com/life3.png" @click="alertMessage('功能开发中...')"></image>
3 years ago
</view>
</view> -->
3 years ago
<!-- 顶部主页 -->
<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>
<!-- 最新活动 -->
3 years ago
<view class="act-box" >
3 years ago
<view class="headline"><image src="../../static/images/new-act.png" mode=""></image></view>
3 years ago
<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>
3 years ago
<view class="resource-list acea-row-nowrap">
3 years ago
<image :src="item.images" class="act-img" mode="aspectFill"></image>
3 years ago
<view>
<view class="act-time acea-row row-left">
<image src="../../static/images/act-time.png" mode=""></image>
3 years ago
<view>{{item.activityStartTime.split(' ')[0]}}{{item.activityEndTime.split(' ')[0]}}</view>
3 years ago
</view>
<view class="act-adress acea-row row-left">
<image src="../../static/images/act-address.png" mode=""></image>
3 years ago
<view class="line1">{{item.address}}</view>
3 years ago
</view>
<view class="acea-row row-between-wrapper act-price">
<text class="act-i">进行中</text>
3 years ago
<text class="act-p">{{item.price}}</text>
3 years ago
</view>
</view>
</view>
3 years ago
<view class="act-bottom acea-row row-middle">
3 years ago
<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>
3 years ago
<view class="enter-btn">去报名</view>
3 years ago
</view>
</view>
</scroll-view>
</view>
3 years ago
<!-- 推荐供需 -->
3 years ago
<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">
3 years ago
<scroll-view class="scroll-view_H" scroll-x="true" >
3 years ago
<view class="category-item category-item-active">全部商品</view>
3 years ago
<view class="category-item">至尊保驾</view>
3 years ago
<view class="category-item">优选好房</view>
<view class="category-item">商城福利</view>
3 years ago
<view class="category-item">回头率</view>
3 years ago
</scroll-view>
3 years ago
</view> -->
3 years ago
<view class="warter-box">
3 years ago
<view class="headline">
<image src="../../static/images/rec-title.png" mode=""></image>
</view>
3 years ago
<u-waterfall v-model="flowList" ref="uWaterfall">
<template v-slot:left="{leftList}">
3 years ago
<view class="warter" v-for="(item, index) in leftList" :key="index" @tap="toGoodsDetail(item.id)">
3 years ago
<image class="warter-img" :src="item.image" :index="index" mode="widthFix"></image>
<view class="goodsinfo-box">
3 years ago
<view class="title line2"> {{item.storeName}} </view>
3 years ago
<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}">
3 years ago
<view class="warter" v-for="(item, index) in rightList" :key="index" @tap="toGoodsDetail(item.id)">
3 years ago
<image class="warter-img" :src="item.image" :index="index" mode="widthFix"></image>
<view class="goodsinfo-box">
3 years ago
<view class="title line2"> {{item.storeName}} </view>
3 years ago
<view class="price-box acea-row row-between-wrapper">
<text class="price">{{item.price}}</text>
3 years ago
<text class="old-price">{{item.otPrice}}</text>
3 years ago
</view>
</view>
</view>
</template>
</u-waterfall>
<u-loadmore bg-color="rgb(240, 240, 240)" :status="loadStatus" @loadmore="addRandomData"></u-loadmore>
3 years ago
</view>
<tabbar :current="currentTabIndex" @click="tabBarClick"></tabbar>
</view>
</template>
<script>
3 years ago
import { getCategory , getProducts, getArticle, getActivity} from "@/api/store";
3 years ago
import { trim } from "@/utils";
import { mapGetters } from 'vuex'
import tabbar from "../../tabbarComponent/tabbar";
3 years ago
import vSwiper from '@/components/vSwiper.vue'
const app = getApp();
3 years ago
export default {
components: {
3 years ago
tabbar,
vSwiper
3 years ago
},
name: "GoodsClass",
computed: mapGetters(['userInfo']),
props: {},
data: function() {
return {
3 years ago
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,
3 years ago
activity:[],
3 years ago
};
},
watch: {
"$yroute.query.id": function(n) {
if (n) {
this.activeCateId(n);
}
}
},
3 years ago
// onShow: function (options) {
3 years ago
3 years ago
// },
mounted: function() {
this.getProducts();
3 years ago
this.getArticle();
3 years ago
this.getActivity();
3 years ago
},
onReachBottom() {
3 years ago
if(this.isLoad){
this.page = this.page+1
this.getProducts();
}
},
3 years ago
onPullDownRefresh(){
3 years ago
wx.showNavigationBarLoading();
this.isLoad= true
this.page= 1
3 years ago
this.clear().then(()=>{
console.log('清除')
this.getProducts();
})
3 years ago
},
3 years ago
3 years ago
methods: {
3 years ago
async clear(){
this.$refs.uWaterfall.clear();
},
3 years ago
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);
}
});
});
},
3 years ago
getArticle(){
let data = {
isHot: 0,
page: 0,
size: 100
}
getArticle(data).then(res=>{
console.log(res)
this.yunList = res.data.content
})
},
3 years ago
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
});
},
3 years ago
tabClick(i) {
console.log(i,'aiiii')
this.active= i
},
3 years ago
getProducts(){
3 years ago
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()
})
3 years ago
},
3 years ago
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;
3 years ago
},
alertMessage(msg){
uni.showToast({
title: msg,
icon: 'none'
})
},
3 years ago
},
beforeDestroy: function() {
// document.removeEventListener("scroll", this.onScroll, false);
}
};
</script>
<style lang="scss" scoped>
</style>
<style lang="less" scoped>
.productSort {
3 years ago
// height: 100%;
// padding-bottom: 200rpx;
background: #EEEEEE !important;
3 years ago
position: relative;
}
3 years ago
3 years ago
.page-top-box{
width: 100%;
position: fixed;
top: 0;
left: 0;
z-index: 99;
3 years ago
background: #fff;
padding: 0 30rpx 20rpx;
3 years ago
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;
}
}
}
}
3 years ago
.main-box{
3 years ago
width: 100%;
3 years ago
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;
3 years ago
}
3 years ago
// 云快讯
.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;
3 years ago
border-radius: 12rpx;
3 years ago
}
.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;
3 years ago
margin: 7rpx 16rpx 0 0;
3 years ago
}
.act-adress image{
width: 19rpx;
height: 23rpx;
3 years ago
margin: 8rpx 14rpx 0 0;
3 years ago
}
.act-price{
margin-top: 40rpx;
}
.act-i {
font-size: 24rpx;
color: #FF5A0E;
}
.act-p{
font-size: 32rpx;
color: #2A2B2B;
3 years ago
font-weight: 600;
3 years ago
}
.act-bottom{
3 years ago
position: relative;
3 years ago
width: 562rpx;
3 years ago
height: 62rpx;
3 years ago
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;
3 years ago
position: absolute;
right: 38rpx;
3 years ago
}
// 推荐供需
.rec-box{
3 years ago
width: 100%;
3 years ago
height: 493rpx;
3 years ago
margin: 32rpx 40rpx 8rpx 40rpx;
3 years ago
position: relative;
}
.rec-switch{
3 years ago
width: 670rpx;
3 years ago
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{
3 years ago
width: 670rpx;
3 years ago
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;
}
3 years ago
.warter-box{
width: 100%;
3 years ago
padding: 24rpx 0 190rpx 24rpx;
3 years ago
.u-waterfall {
width: 100%;
display: flex;
3 years ago
justify-content: space-between;
.u-column {
3 years ago
.warter {
width: 336rpx !important;
3 years ago
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%;
3 years ago
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;
3 years ago
text-decoration: line-through;
3 years ago
}
}
}
}
}
}
.banner-img-box{
width: 100%;
padding: 220rpx 40rpx 32rpx;
3 years ago
.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>