sadjv3_user/pages/my/fuwuGengduo.vue

684 lines
14 KiB
Vue
Raw Normal View History

2024-06-24 11:29:11 +08:00
<!-- 自定义下拉刷新与上拉加载演示(vue) -->
<template>
<view class="content-view">
2024-08-20 17:29:43 +08:00
<z-paging ref="paging" v-model="dataList" @query="queryList">
<template #top>
<view class="service-head-top">
<view class="service-head-top-left">
<image @click="backImg" src="../../static/fanhui.png" mode="widthFix"></image>
<span>全部项目</span>
</view>
<view>
<uni-search-bar @service="serviceTrue" @confirm="search" :cancelext="'取消'" v-model="searchValue"
@input="input" @clear="clear">
</uni-search-bar>
<view class="search-btn" @click="searchBtn">
<image style="width:30rpx; height:30rpx; margin-right: 10rpx;"
src="../../static/search.png"></image>
搜索
</view>
</view>
</view>
<view class="fenlei">
<z-tabs class="z-tabs-fenlei" :list="tabListS" @changeClick="changeClick"/>
</view>
</template>
<template #loadingMoreNoMore>
<custom-nomore />
</template>
<!-- 右侧商品 -->
<!-- 主体部分 -->
<view class="body">
<!-- 左侧分类 -->
<view class="leftTab">
<scroll-view scroll-y="true" class="tabBox">
<block v-for="(item,index) in tabList" :key="index">
<view class="tabItem" :class="tabCurrent == index?'tabActive':''"
@click="changeTab(index,item)">
{{item.value}}
</view>
</block>
</scroll-view>
</view>
<!-- 右侧商品 -->
<view class="rightGoods">
<!-- <view class="title">{{productTitle}}</view> -->
<view class="item" v-for="(item,index) in dataList" :key="index" @click="itemClick(item)">
<image :src="item.packageImg" mode="" class="item-img"></image>
<view class="item-view">
<view class="item-view-title">
{{item.title}}
</view>
<view class="item-view-bottom-qian">
<span></span>
<span>{{item.price}}</span>
<span v-if="item.type!='104' && item.type!='105' && item.type!='106'"></span>
<span v-else-if="item.type=='104'">/</span>
<span v-else>/{{item.serviceCount?item.serviceCount:''}}</span>
<span>{{item.oldPrice}}</span>
<span v-if="item.type!='104' && item.type!='105' && item.type!='106'"></span>
<span v-else-if="item.type=='104'">/</span>
<span v-else>/{{item.serviceCount?item.serviceCount:''}}</span>
</view>
<view class="flex" style="margin-top: 10rpx;">
<view class="shop_label" v-if="item.tagsData!=''">
<span v-for="tag in item.tagsData" :key="tag">{{tag}}</span>
</view>
<view class="shop_label" v-else>
<span>助眠解压</span>
</view>
</view>
<view class="item-view-bottom">
<view class="item-view-xiangmu">
<span>已售</span><span>{{item.sales}}</span>
</view>
<view class="item-view-bottom-btn">
查看
</view>
</view>
</view>
</view>
</view>
</view>
</z-paging>
2024-06-24 11:29:11 +08:00
</view>
</template>
<script>
export default {
data() {
return {
2024-08-20 17:29:43 +08:00
tabListS:[
{
code: "单项",
id: 1,
name: "",
orderNum: 6,
parentId: 22,
remark: "单项",
status: 1,
type: "",
value: "单项",
},
{
code: "套餐",
id: 104,
name: "",
orderNum: 6,
parentId: 22,
remark: "套餐",
status: 1,
type: "",
value: "套餐",
},
{
2024-08-21 11:14:52 +08:00
code: "疗程",
id: 106,
2024-08-20 17:29:43 +08:00
name: "",
orderNum: 6,
parentId: 22,
2024-08-21 11:14:52 +08:00
remark: "疗程",
2024-08-20 17:29:43 +08:00
status: 1,
type: "",
2024-08-21 11:14:52 +08:00
value: "疗程",
2024-08-20 17:29:43 +08:00
},
{
2024-08-21 11:14:52 +08:00
code: "次卡",
id: 105,
2024-08-20 17:29:43 +08:00
name: "",
orderNum: 6,
parentId: 22,
2024-08-21 11:14:52 +08:00
remark: "次卡",
2024-08-20 17:29:43 +08:00
status: 1,
type: "",
2024-08-21 11:14:52 +08:00
value: "次卡",
2024-08-20 17:29:43 +08:00
},
{
2024-08-21 11:14:52 +08:00
code: "企业",
2024-08-20 17:29:43 +08:00
id: 114,
name: "",
orderNum: 6,
parentId: 22,
2024-08-21 11:14:52 +08:00
remark: "企业",
2024-08-20 17:29:43 +08:00
status: 1,
type: "",
2024-08-21 11:14:52 +08:00
value: "企业",
2024-08-20 17:29:43 +08:00
},
],
loadingType: 0,
2024-06-24 11:29:11 +08:00
myId: '',
// v-model绑定的这个变量不要在分页请求结束中自己赋值
dataList: [],
tabList: [],
2024-08-20 17:29:43 +08:00
typeData: '105',
2024-06-24 11:29:11 +08:00
tabIndex: 0,
2024-08-20 17:29:43 +08:00
searchValue: '',
serviceTrue: true,
page: 1,
limit: 10,
titleNmae: '',
classifyId: '',
tagsData: [],
// 分类列表
tabCurrent: 0,
productTitle: '氧气罐',
type:'1'
2024-06-24 11:29:11 +08:00
}
},
2024-08-20 17:29:43 +08:00
onLoad(e) {
2024-06-24 11:29:11 +08:00
this.myId = uni.getStorageSync('userId')
2024-08-20 17:29:43 +08:00
if (e) {
this.searchValue = e.searchValue
2024-07-10 17:58:14 +08:00
}
2024-08-20 17:29:43 +08:00
this.tabNav()
2024-08-23 09:08:59 +08:00
this.getData()
2024-06-24 11:29:11 +08:00
},
2024-07-25 20:58:11 +08:00
// onPullDownRefresh: function() {
// this.page = 1;
// this.getData()
// },
2024-06-24 11:29:11 +08:00
methods: {
2024-08-20 17:29:43 +08:00
changeClick(index,item){
this.type=item.id
this.searchValue=''
this.page = 1;
this.dataList = []
this.getData()
},
tabNav() {
let data = {
type: "服务类型",
}
this.$Request.get('/app/dict/list', data).then(res => {
if (res.code == 0) {
this.tabList = res.data;
this.classifyId=res.data[0].id,
this.productTitle = this.tabList[0].value
this.page = 1;
this.dataList = []
this.getData()
}
})
},
input(res) { //搜索 输入框
this.searchValue = res;
},
searchBtn() { //搜索按钮
if (this.searchValue != "") {
2024-06-24 11:29:11 +08:00
this.getData()
}
},
2024-08-20 17:29:43 +08:00
getData() {
this.$refs.paging.reload(true);
},
queryList(pageNo, pageSize) {
const params = {
city: '',
page: pageNo,
limit: pageSize,
title: this.searchValue,
classifyId: this.classifyId,
type:this.type
}
this.$Request.get('/app/massage/package/findPackageAndMassagePage', params).then(res => {
for (var i = 0; i < res.data.list.length; i++) {
res.data.list[i].tagsData = res.data.list[i].labels.split(',');
}
this.$refs.paging.complete(res.data.list);
}).catch(res => {
this.$refs.paging.complete(false);
})
},
changeTab(index,item) {
this.tabCurrent = index
this.productTitle = this.tabList[index].value
this.classifyId = item.id
this.searchValue = ''
this.page = 1;
this.dataList = []
this.getData()
2024-06-24 11:29:11 +08:00
},
2024-08-20 17:29:43 +08:00
backImg() { //返回上一页
2024-06-24 11:29:11 +08:00
uni.reLaunch({
2024-08-20 17:29:43 +08:00
url: '/pages/index/index'
2024-06-24 11:29:11 +08:00
})
2024-07-25 20:58:11 +08:00
},
2024-06-24 11:29:11 +08:00
clear(res) {
this.getData()
},
itemClick(item) {
2024-08-20 17:29:43 +08:00
if (item.type == '104') {
2024-06-24 11:29:11 +08:00
uni.navigateTo({
2024-08-20 17:29:43 +08:00
url: '/pages/my/serviceOderDrtail?id=' + item.id + '&limit=' + this.limit + '&page=' + this
.page + '&name=' + 'index' + '&isCanCoupon=' + item.isCanCoupon
2024-06-24 11:29:11 +08:00
})
2024-08-20 17:29:43 +08:00
} else if (item.type == '105') {
2024-06-24 11:29:11 +08:00
uni.navigateTo({
2024-08-20 17:29:43 +08:00
url: '/pages/my/cikarDrtail?id=' + item.id + '&limit=' + this.limit + '&page=' + this
.page + '&name=' + 'index' + '&isCanCoupon=' + item.isCanCoupon
2024-06-24 11:29:11 +08:00
})
2024-08-20 17:29:43 +08:00
} else if (item.type == '106') {
2024-06-24 11:29:11 +08:00
uni.navigateTo({
2024-08-20 17:29:43 +08:00
url: '/pages/my/fuwuliaochengDetail?id=' + item.id + '&limit=' + this.limit + '&page=' +
this.page + '&name=' + 'index' + '&isCanCoupon=' + item.isCanCoupon
2024-06-24 11:29:11 +08:00
})
2024-08-21 11:14:52 +08:00
} else if(item.type == '114'){
uni.navigateTo({
url: '/pages/shop/qiyeDatail?id=' + item.id +'&name=' + 'index'
})
}else {
2024-06-24 11:29:11 +08:00
uni.navigateTo({
2024-08-20 17:29:43 +08:00
url: '/pages/my/fuwuDateil?id=' + item.id + '&limit=' + this.limit + '&page=' + this.page +
'&name=' + 'index' + '&isCanCoupon=' + item.isCanCoupon
2024-06-24 11:29:11 +08:00
})
}
}
}
}
</script>
2024-08-20 17:29:43 +08:00
<style lang="scss" scoped>
2024-08-21 10:35:50 +08:00
/deep/.zp-empty-view-center{
position: absolute;
margin-top: 106px;
margin-left: 42%;
}
2024-08-20 17:29:43 +08:00
/deep/.z-tabs-item-title /deep/span{
white-space: nowrap;
}
.fenlei{
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
2024-08-21 14:29:22 +08:00
background: #fff;
2024-08-20 17:29:43 +08:00
}
.body {
2024-08-22 16:44:11 +08:00
// height: 100vh;
2024-08-20 17:29:43 +08:00
display: flex;
2024-08-21 10:35:50 +08:00
justify-content: end;
2024-08-22 16:44:11 +08:00
// overflow: hidden;
2024-08-20 17:29:43 +08:00
.leftTab {
2024-08-21 14:29:22 +08:00
width:19%;
2024-08-20 17:29:43 +08:00
height: 100%;
background: #ffffff;
2024-08-21 14:29:22 +08:00
// border-radius: 0px 15rpx 0px 0px;
// padding: 24rpx 11rpx;
2024-08-20 17:29:43 +08:00
box-sizing: border-box;
2024-08-21 14:29:22 +08:00
border-top: 1px solid #f7f7f7;
2024-08-21 10:35:50 +08:00
position: fixed;
left: 0;
2024-08-20 17:29:43 +08:00
.tabBox {
height: 100%;
.tabItem {
text-align: center;
padding: 14rpx 0;
2024-08-21 14:29:22 +08:00
// border-radius: 60rpx;
2024-08-20 17:29:43 +08:00
color: #464646;
2024-08-22 17:56:37 +08:00
font-size: 14px;
2024-08-20 17:29:43 +08:00
font-weight: bold;
margin-bottom: 20rpx;
}
.tabActive {
2024-08-21 14:29:22 +08:00
background: #f2fffb;
color: #019c88;
2024-08-20 17:29:43 +08:00
}
}
}
.rightGoods {
2024-08-21 14:29:22 +08:00
width:80%;
2024-08-20 17:29:43 +08:00
height: 100%;
2024-08-21 10:35:50 +08:00
// padding: 0 16rpx 27rpx;
2024-08-20 17:29:43 +08:00
box-sizing: border-box;
.whiteBox {
height: 100%;
background: #ffffff;
border-radius: 15rpx;
padding: 0 25rpx;
box-sizing: border-box;
.title {
height: 77rpx;
line-height: 77rpx;
color: #2D2D2D;
font-size: 26rpx;
font-weight: bold;
}
}
}
}
.shop_label {
2024-07-13 14:21:23 +08:00
display: flex;
flex-wrap: wrap;
2024-08-20 17:29:43 +08:00
margin-top: 4rpx;
2024-07-13 14:21:23 +08:00
}
2024-08-20 17:29:43 +08:00
.shop_label span {
2024-07-25 19:36:32 +08:00
background: linear-gradient(90deg, #ffefde, #fff7ef);
2024-07-24 14:37:55 +08:00
height: 34rpx;
line-height: 34rpx;
2024-07-13 14:21:23 +08:00
border-radius: 8rpx;
2024-07-24 14:37:55 +08:00
padding: 0 10rpx;
font-size: 22rpx;
2024-07-13 14:21:23 +08:00
margin-right: 8rpx;
margin-bottom: 8rpx;
2024-07-25 19:36:32 +08:00
color: #f68607;
2024-07-13 14:21:23 +08:00
}
2024-08-20 17:29:43 +08:00
/deep/.refresh-body {
2024-07-04 19:13:27 +08:00
height: 845px !important;
2024-06-24 11:29:11 +08:00
background-color: #f7f7f7;
}
2024-08-20 17:29:43 +08:00
.content-view {
2024-06-24 11:29:11 +08:00
width: 100%;
height: 100vh;
2024-07-04 19:13:27 +08:00
overflow: hidden;
2024-06-24 11:29:11 +08:00
}
2024-08-20 17:29:43 +08:00
.item-view-bottom-btn {
2024-06-24 11:29:11 +08:00
text-align: center;
width: 131rpx;
2024-07-25 19:36:32 +08:00
height: 55rpx;
line-height: 55rpx;
2024-06-24 11:29:11 +08:00
background: linear-gradient(90deg, #019C88, #0FA78B, #35C495);
border-radius: 10rpx;
font-weight: bold;
2024-07-25 19:36:32 +08:00
font-size: 28rpx;
2024-06-24 11:29:11 +08:00
color: #FFFFFF;
}
2024-08-20 17:29:43 +08:00
.item-view-bottom-qian span:nth-child(5) {
font-size: 28rpx;
color: #848484;
text-decoration-line: line-through;
}
.item-view-bottom-qian span:nth-child(4) {
2024-07-26 17:49:35 +08:00
font-size: 28rpx;
2024-07-25 19:36:32 +08:00
color: #848484;
text-decoration-line: line-through;
margin-left: 5px;
2024-06-24 11:29:11 +08:00
}
2024-08-20 17:29:43 +08:00
.item-view-bottom-qian span:nth-child(3) {
font-size: 28rpx;
color: #FF6000;
}
.item-view-bottom-qian span:nth-child(2) {
2024-07-25 19:36:32 +08:00
font-weight: bold;
font-size: 36.81rpx;
2024-07-31 16:57:55 +08:00
color: #FF6000;
2024-06-24 11:29:11 +08:00
}
2024-08-20 17:29:43 +08:00
.item-view-bottom-qian span:nth-child(1) {
font-weight: 400;
font-size: 28rpx;
color: #FF6000;
}
.item-view-bottom-qian {
margin-top: 2px;
}
.item-view-bottom {
width: 100%;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
}
.item-view-jianjie {
2024-06-24 11:29:11 +08:00
font-weight: 400;
2024-07-03 13:41:18 +08:00
font-size: 24rpx;
2024-06-24 11:29:11 +08:00
color: #848484;
2024-08-20 17:29:43 +08:00
margin: 5px 0px;
2024-06-24 11:29:11 +08:00
display: -webkit-box;
-webkit-box-orient: vertical;
2024-08-20 17:29:43 +08:00
-webkit-line-clamp: 2;
/* 显示的行数,可以根据需要修改 */
2024-06-24 11:29:11 +08:00
overflow: hidden;
text-overflow: ellipsis;
}
2024-08-20 17:29:43 +08:00
.item-view-biao {
2024-06-24 11:29:11 +08:00
padding: 1px 2px;
border-radius: 6rpx;
}
2024-08-20 17:29:43 +08:00
.tuina {
background-color: #d1f2df;
2024-06-24 11:29:11 +08:00
color: #17984d;
}
2024-08-20 17:29:43 +08:00
.xiaoer {
background-color: #f1f8d7;
2024-06-24 11:29:11 +08:00
color: #58b314;
}
2024-08-20 17:29:43 +08:00
.taishi {
background-color: #e5d5c6;
2024-06-24 11:29:11 +08:00
color: #805d39;
}
2024-08-20 17:29:43 +08:00
.kangfu {
background-color: #fcf3da;
2024-06-24 11:29:11 +08:00
color: #ff8600;
}
2024-08-20 17:29:43 +08:00
.item-view-xiangmu span:nth-child(2) {
font-weight: normal;
color: #333333;
font-size: 30rpx;
}
.item-view-xiangmu span:nth-child(1) {
font-weight: normal;
color: #666666;
margin-right: 5rpx;
font-size: 30rpx;
}
.item-view-xiangmu {
width: 100%;
display: flex;
flex-direction: row;
font-weight: 400;
font-size: 25rpx;
align-items: flex-end;
}
.item-view-title {
2024-06-24 11:29:11 +08:00
font-weight: bold;
font-size: 33rpx;
color: #333333;
}
2024-08-20 17:29:43 +08:00
.item-view {
2024-08-21 14:29:22 +08:00
width:69%;
2024-08-20 17:29:43 +08:00
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
justify-content: space-between;
padding: 5rpx 0;
}
.item-img {
2024-08-21 14:29:22 +08:00
width:70px;
height:70px;
2024-08-20 17:29:43 +08:00
border-radius: 14rpx;
position: relative;
}
.img-span {
2024-06-24 11:29:11 +08:00
padding: 2px 5px;
font-weight: 400;
font-size: 8px;
color: #FFFFFF;
background: linear-gradient(-90deg, #FF6F48, #FF9E69);
border-radius: 7px 0px 7px 0px;
position: absolute;
bottom: 0px;
right: 0;
margin-bottom: 5px;
margin-right: 5px;
}
2024-08-20 17:29:43 +08:00
.item-img image {
2024-06-24 11:29:11 +08:00
width: 100%;
height: 100%;
}
2024-08-20 17:29:43 +08:00
2024-06-24 11:29:11 +08:00
.item {
2024-07-30 16:53:24 +08:00
width: 100%;
2024-08-20 17:29:43 +08:00
margin: 0 auto;
2024-07-30 16:53:24 +08:00
display: flex;
flex-direction: row;
justify-content: space-between;
/*height: 140px;*/
background: #FFFFFF;
border-radius: 21rpx;
2024-08-20 17:29:43 +08:00
margin-top: 10px;
2024-08-21 14:29:22 +08:00
// align-items: center;
2024-08-20 17:29:43 +08:00
padding: 20rpx;
2024-06-24 11:29:11 +08:00
}
2024-08-20 17:29:43 +08:00
2024-06-24 11:29:11 +08:00
.item-detail {
padding: 5rpx 15rpx;
border-radius: 10rpx;
font-size: 28rpx;
color: white;
background-color: #007AFF;
}
2024-07-25 20:58:11 +08:00
2024-06-24 11:29:11 +08:00
.item-line {
position: absolute;
bottom: 0rpx;
left: 0rpx;
height: 1px;
width: 100%;
background-color: #eeeeee;
}
2024-08-20 17:29:43 +08:00
/deep/.zp-paging-container {
2024-06-24 11:29:11 +08:00
background-color: #f7f7f7;
2024-08-20 17:29:43 +08:00
width: 100%;
2024-06-24 11:29:11 +08:00
}
2024-08-20 17:29:43 +08:00
/deep/.zp-paging-container-content {
2024-07-30 16:53:24 +08:00
width: 95%;
2024-06-24 11:29:11 +08:00
margin: 0 auto;
}
2024-08-20 17:29:43 +08:00
.fenlei {
2024-06-24 11:29:11 +08:00
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
}
2024-08-20 17:29:43 +08:00
.index-fenl-title {
2024-06-24 11:29:11 +08:00
width: 81rpx;
text-align: center;
position: relative;
display: flex;
flex-direction: column;
align-items: center;
font-weight: bold;
font-size: 34rpx;
2024-08-20 17:29:43 +08:00
color: #019C88;
2024-06-24 11:29:11 +08:00
}
2024-08-20 17:29:43 +08:00
.index-fenl-title-bottom {
2024-06-24 11:29:11 +08:00
position: absolute;
bottom: 0;
margin-bottom: 0px;
width: 81rpx;
height: 14rpx;
border-radius: 7rpx;
2024-08-20 17:29:43 +08:00
background: linear-gradient(-48deg, rgba(1, 156, 136, 0.35), rgba(45, 196, 142, 0.35));
2024-06-24 11:29:11 +08:00
}
2024-08-20 17:29:43 +08:00
/deep/.uni-searchbar__cancel {
2024-06-24 11:29:11 +08:00
display: none;
}
2024-08-20 17:29:43 +08:00
.search-btn {
2024-07-24 14:37:55 +08:00
text-align: center;
2024-07-30 16:53:24 +08:00
color: #019c88;
font-weight: bold;
2024-07-24 14:37:55 +08:00
position: absolute;
2024-08-20 17:29:43 +08:00
right: 40rpx;
2024-07-30 16:53:24 +08:00
top: 20rpx;
font-size: 30rpx;
display: flex;
align-items: center;
2024-06-24 11:29:11 +08:00
}
2024-08-20 17:29:43 +08:00
/deep/.uni-searchbar__box-icon-search,
.search-btn {
2024-07-23 22:34:46 +08:00
width: 110rpx;
height: 50rpx;
2024-06-24 11:29:11 +08:00
}
2024-08-20 17:29:43 +08:00
/deep/.uni-searchbar__box {
height: 34px;
2024-07-23 22:34:46 +08:00
border-radius: 30px !important;
2024-06-24 11:29:11 +08:00
background-color: #fff !important;
2024-07-23 22:34:46 +08:00
border: 1px solid #09a28a;
2024-06-24 11:29:11 +08:00
display: flex;
flex-direction: row;
flex-flow: row-reverse;
position: relative;
}
2024-08-20 17:29:43 +08:00
/deep/.uni-searchbar {
width: 250px;
2024-06-24 11:29:11 +08:00
border-radius: 31rpx;
2024-07-30 16:53:24 +08:00
padding-right: 24rpx;
2024-06-24 11:29:11 +08:00
}
2024-08-20 17:29:43 +08:00
.service-head-top-left image {
2024-07-23 22:34:46 +08:00
width: 20px;
height: 20rpx;
2024-08-20 17:29:43 +08:00
margin-right: 5px;
2024-07-23 22:34:46 +08:00
margin-left: 10rpx;
2024-06-24 11:29:11 +08:00
}
2024-08-20 17:29:43 +08:00
.service-head-top-left span {
height: 100rpx;
background: url('../../static/images/headline.png') 0rpx 50rpx;
2024-07-23 22:34:46 +08:00
background-repeat: no-repeat;
2024-06-24 11:29:11 +08:00
font-weight: bold;
2024-07-03 12:15:39 +08:00
font-size: 34rpx;
2024-06-24 11:29:11 +08:00
color: #171717;
2024-07-24 14:37:55 +08:00
display: flex;
align-items: center;
2024-06-24 11:29:11 +08:00
}
2024-08-20 17:29:43 +08:00
.service-head-top-left {
2024-06-24 11:29:11 +08:00
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
}
2024-08-20 17:29:43 +08:00
.service-head-top {
height: 90rpx;
2024-06-24 11:29:11 +08:00
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
2024-08-21 14:29:22 +08:00
background: #fff;
2024-06-24 11:29:11 +08:00
}
2024-08-20 17:29:43 +08:00
</style>