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.
yanzong_qianduan/pages/activity/intimate.vue

527 lines
11 KiB

9 months ago
<template>
<view class="intimate">
<view class="intimate-navbar">
<u-navbar title="贴心服务" :border-bottom="false" :background="isScroll?background:background1"></u-navbar>
</view>
<view class="intimate-hd" @click="openPage(1)">
<image :src="storeInfo.imageList?storeInfo.imageList[0]:''"></image>
9 months ago
<view class="a">{{storeInfo.shop_name}}
<u-icon style="margin-left: 10rpx;" name="arrow-right"></u-icon>
</view>
9 months ago
<view class="b">{{storeInfo.summary}}</view>
</view>
<!-- <scroll-view scroll-x class="intimate-menu">
<view class="item" @click="tabItem1(i)" v-for="i in 10" :key="i" :class="tabIndex1==i?'item-on':''">
<image src="@/static/home/phone.jpg"></image>
<view class="p">手机</view>
</view>
</scroll-view> -->
<view class="intimate-bd">
<scroll-view scroll-y class="a">
<view class="item" @click="tabItem(-1)" :class="tabIndex==-1?'item-on':''">全部商品</view>
9 months ago
<view class="item" @click="tabItem(i)" v-for="(a,i) in list" :key="i" :class="tabIndex==i?'item-on':''">
{{a.name}}</view>
9 months ago
</scroll-view>
<view class="b">
<view class="t">
<view class="item" @click="tabFilter(0)" :class="filterIndex==0?'item-on':''">价格</view>
<view class="item" @click="tabFilter(1)" :class="filterIndex==1?'item-on':''">折扣</view>
<view class="item" @click="tabFilter(2)" :class="filterIndex==2?'item-on':''">销量</view>
<view class="item" @click="tabFilter(3)" :class="filterIndex==3?'item-on':''">综合</view>
</view>
<scroll-view scroll-y class="l">
<view class="item" v-for="(a,i) in list1" :key="i" @click="openPage(2,a)">
<image :src="a.server_image"></image>
10 months ago
<view class="title">
9 months ago
<!-- <text>自营</text> -->
{{a.server_name}}
</view>
<view class="price">
<view class="n"><text>{{a.server_price}}</text></view>
<view class="o">{{a.line_price}}</view>
</view>
<view class="desc">
{{a.comment_num}}条评论 {{a.comment_rate}}好评率
</view>
10 months ago
</view>
9 months ago
<!-- <u-empty v-if="isShow" text="暂无信息" mode="list"></u-empty> -->
</scroll-view>
</view>
</view>
</view>
</template>
10 months ago
<script>
9 months ago
import * as newFunApi from '@/api/newFun'
9 months ago
export default {
data() {
10 months ago
return {
isScroll: true,
background1: {
background: '#fff',
9 months ago
},
background: {
background: 'transparent',
backgroundSize: '100%',
},
isShow: false,
tabIndex1: 1,
tabIndex: -1,
10 months ago
filterIndex: 0,
9 months ago
storeInfo: {},
keyword: "",
10 months ago
list: [],
list1: [],
9 months ago
filterFlag: true,
}
10 months ago
},
10 months ago
onLoad(o) {
9 months ago
this.tabIndex = o.index ? (o.index) : -1
10 months ago
this.getList();
this.storeInfo = uni.getStorageSync("cityInfo")
10 months ago
},
9 months ago
onPageScroll(e) {
if (e.scrollTop <= 44) {
10 months ago
this.isScroll = true;
9 months ago
} else {
10 months ago
this.isScroll = false;
}
9 months ago
},
10 months ago
methods: {
/**
* 获取列表
*/
async getList() {
9 months ago
let {
status,
message,
data
} = await newFunApi.serverCategoryList({});
if (status == 200) {
10 months ago
this.list = data.list
this.getGoodsList();
}
},
/**
* 获取商品列表
*/
async getGoodsList() {
9 months ago
let {
status,
message,
data
} = await newFunApi.serverList({
10 months ago
server_name: "",
9 months ago
category_id: this.tabIndex == -1 ? "" : (this.list.length > 0 ? this.list[this.tabIndex]
.category_id : ""),
order_field: this.filterIndex == 0 ? "server_price" : this.filterIndex == 1 ?
"line_price" : this.filterIndex == 2 ? "sold" : "",
order_sort: this.filterFlag ? "desc" : "asc"
10 months ago
});
9 months ago
if (status == 200) {
if (data.list.length > 0) {
data.list.map(a => {
a.server_price = Number(a.server_price);
a.line_price = Number(a.line_price)
})
this.list1 = data.list
this.isShow = data.total == 0 ? true : false
}
10 months ago
}
9 months ago
},
openPage(index, a) {
if (index == 1) {
9 months ago
uni.navigateTo({
url: "/pages/user/vip/goods"
10 months ago
})
9 months ago
} else if (index == 2) {
uni.setStorageSync("getInfo", a)
10 months ago
uni.navigateTo({
url: "/pages/news/recycling/detail?type=1"
})
}
9 months ago
},
9 months ago
tabItem(index) {
10 months ago
this.tabIndex = index;
this.filterIndex = 0;
9 months ago
this.getGoodsList();
},
9 months ago
tabFilter(index) {
if (index == this.filterIndex) {
10 months ago
this.filterFlag = !this.filterFlag
9 months ago
} else {
10 months ago
this.filterFlag = true
9 months ago
}
10 months ago
this.filterIndex = index;
9 months ago
this.getGoodsList();
}
}
}
</script>
<style lang="scss" scoped>
9 months ago
.intimate {
background: url(https://www.royaum.com.cn/static/news/refund-bg1.png) center top no-repeat;
background-size: 100% auto;
&-hd {
width: 686rpx;
height: 170rpx;
background: rgba(255, 255, 255, 0.86);
border-radius: 12rpx;
margin: 0 auto;
padding-top: 30rpx;
9 months ago
box-sizing: border-box;
9 months ago
margin-top: 30rpx;
position: relative;
image {
position: absolute;
width: 162rpx;
height: 162rpx;
border-radius: 162rpx;
left: 18rpx;
top: -20rpx;
9 months ago
}
9 months ago
.a {
font-size: 32rpx;
color: #212121;
margin-left: 220rpx;
9 months ago
}
9 months ago
.b {
margin-left: 220rpx;
font-size: 28rpx;
color: #646464;
margin-top: 10rpx;
9 months ago
}
}
9 months ago
&-menu {
height: 180rpx;
white-space: nowrap;
margin-top: 30rpx;
padding: 0 20rpx;
.item {
width: 150rpx;
height: 180rpx;
background: #FFFFFF;
display: inline-block;
padding: 16rpx;
9 months ago
box-sizing: border-box;
9 months ago
border: 1px solid #FFFFFF;
text-align: center;
margin-left: 12rpx;
border-radius: 8rpx;
image {
width: 112rpx;
height: 112rpx;
}
.p {
white-space: nowrap;
overflow: hidden;
font-size: 28rpx;
font-weight: 400;
color: #3F3F3F;
}
&-on {
border: 1px solid #F21A1C;
9 months ago
}
}
}
9 months ago
&-bd {
padding: 30rpx 0 0;
display: flex;
height: calc(100vh - 340rpx);
box-sizing: border-box;
overflow: hidden;
.a {
width: 150rpx;
height: 100%;
.item {
padding: 20rpx 35rpx;
border-left: 3px solid #FFFFFF;
line-height: 50rpx;
9 months ago
text-align: center;
9 months ago
font-size: 28rpx;
font-weight: 400;
color: #3F3F3F;
box-sizing: border-box;
&-on {
background-color: #FFFFFF;
border-left-color: #F34A40;
9 months ago
}
}
}
9 months ago
.b {
width: 600rpx;
height: 100%;
background-color: #FFFFFF;
.t {
display: flex;
align-items: center;
font-size: 28rpx;
font-weight: 400;
color: #3F3F3F;
line-height: 100rpx;
.item {
flex: 1;
text-align: center;
&-on {
color: #F34A40;
}
9 months ago
}
9 months ago
}
.l {
height: calc(100% - 120rpx);
box-sizing: border-box;
overflow: hidden;
.item {
width: 270rpx;
height: 389rpx;
background: #FFFFFF;
border-radius: 7rpx;
opacity: 1;
border: 1px solid #ECECEC;
padding: 10rpx 15rpx;
box-sizing: border-box;
float: left;
margin-left: 20rpx;
margin-bottom: 20rpx;
image {
width: 230rpx;
height: 230rpx;
display: block;
margin: 0 auto;
}
.title {
padding: 10rpx 0;
9 months ago
line-height: 40rpx;
9 months ago
font-size: 20rpx;
font-family: PingFang SC, PingFang SC;
9 months ago
font-weight: 400;
9 months ago
color: #1E1E1E;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
text {
background-color: #F34A40;
font-size: 20rpx;
padding: 0 10rpx;
height: 40rpx;
line-height: 40rpx;
text-align: center;
border-radius: 4rpx;
font-weight: 400;
color: #FFFFFF;
margin-right: 5rpx;
display: inline-block;
}
9 months ago
}
9 months ago
.price {
9 months ago
display: flex;
9 months ago
align-items: center;
white-space: nowrap;
.n {
display: flex;
align-items: baseline;
font-size: 11px;
font-weight: 500;
color: #F21A1C;
text {
font-size: 29rpx;
}
}
.o {
font-size: 12px;
color: #949494;
text-decoration: line-through;
9 months ago
}
}
9 months ago
.desc {
font-size: 10px;
font-weight: 400;
9 months ago
color: #949494;
9 months ago
white-space: nowrap;
margin-top: 10rpx;
9 months ago
}
9 months ago
}
9 months ago
}
}
}
9 months ago
&-share {
9 months ago
width: 548rpx;
9 months ago
height: 810rpx;
9 months ago
overflow: hidden;
9 months ago
.l {
width: 548rpx;
background: #FFFFFF;
9 months ago
margin: 0 auto;
overflow: hidden;
9 months ago
position: relative;
.a {
width: 490rpx;
height: 243rpx;
margin: 0 auto;
padding-top: 24rpx;
image {
width: 100%;
height: 100%;
9 months ago
}
9 months ago
}
.b {
padding: 20rpx 20rpx;
overflow: hidden;
.item {
width: 220rpx;
height: 369rpx;
background: #FFFFFF;
border-radius: 7rpx;
opacity: 1;
border: 1px solid #ECECEC;
9 months ago
padding: 10rpx 0;
9 months ago
box-sizing: border-box;
float: left;
margin-left: 20rpx;
margin-bottom: 10rpx;
image {
width: 180rpx;
height: 180rpx;
display: block;
margin: 0 auto;
}
.title {
padding: 10rpx 0;
9 months ago
line-height: 40rpx;
9 months ago
font-size: 20rpx;
font-family: PingFang SC, PingFang SC;
9 months ago
font-weight: 400;
9 months ago
color: #1E1E1E;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
text {
background-color: #F34A40;
font-size: 20rpx;
padding: 0 10rpx;
height: 40rpx;
line-height: 40rpx;
text-align: center;
border-radius: 4rpx;
font-weight: 400;
color: #FFFFFF;
margin-right: 5rpx;
display: inline-block;
}
9 months ago
}
9 months ago
.price {
9 months ago
display: flex;
9 months ago
align-items: center;
white-space: nowrap;
padding: 0 5rpx;
.n {
display: flex;
align-items: baseline;
font-size: 11px;
font-weight: 500;
color: #F21A1C;
text {
font-size: 29rpx;
}
}
.o {
font-size: 12px;
color: #949494;
text-decoration: line-through;
9 months ago
}
}
9 months ago
.desc {
padding: 0 5rpx;
font-size: 10px;
font-weight: 400;
9 months ago
color: #949494;
9 months ago
white-space: nowrap;
margin-top: 10rpx;
overflow: hidden;
9 months ago
}
}
9 months ago
}
.c {
background-color: #F1F1F1;
height: 150rpx;
display: flex;
justify-content: flex-end;
align-items: center;
image {
width: 140rpx;
height: 122rpx;
margin-right: 30rpx;
9 months ago
}
}
}
9 months ago
.btn {
width: 640rpx;
line-height: 80rpx;
text-align: center;
background: #F34A40;
position: fixed;
left: 50%;
margin-left: -320rpx;
top: 50%;
z-index: 2;
border-radius: 8rpx;
font-size: 28rpx;
font-weight: 600;
color: #FFFFFF;
margin-top: 450rpx;
9 months ago
}
}
}
</style>
<style>
9 months ago
.goods .uni-scroll-view .uni-scroll-view {
overflow: auto !important;
}
</style>