645 lines
14 KiB
Vue
645 lines
14 KiB
Vue
<!-- 自定义下拉刷新与上拉加载演示(vue) -->
|
||
<template>
|
||
<view class="content-view">
|
||
<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>{{typeData=='95'?'中医推拿':typeData=='101'?'小儿推拿':
|
||
typeData=='102'?'产后康复':typeData=='91'?'私密护理':'正骨拨筋'}}</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 :list="tabList" @change="tabChange" @changeClick="changeClick" />
|
||
</view>
|
||
</template>
|
||
<template #loadingMoreNoMore>
|
||
<custom-nomore />
|
||
</template>
|
||
<view class="item" v-for="(item,index) in dataList" :key="index" @click="itemClick(item)">
|
||
<image :src="item.packageImg?item.packageImg:item.massageImg" mode="" class="item-img"></image>
|
||
<view class="item-view">
|
||
<view class="view-cata">
|
||
<view class="item-view-title">{{item.title}}</view>
|
||
<span class="xiaoer item-view-biao" v-if="type=='104'||type=='105'||type=='106'">{{item.levelName}}</span>
|
||
</view>
|
||
<view class="item-view-bottom-qian">
|
||
<span></span>
|
||
<span>¥{{item.price}}</span>
|
||
<span v-if="type=='104'||type=='105'||type=='106'">/ <text v-if="item.type!='104'">{{item.serviceCount}}</text>
|
||
{{type=='104'?'套':type=='105'?'次':'次'}}</span>
|
||
<span></span>
|
||
<span>¥{{item.oldPrice}}</span>
|
||
<span v-if="type=='104'||type=='105'||type=='106'" class="item-view-bottom-qian-span">
|
||
<text v-if="item.type!='104'">
|
||
/{{item.serviceCount}}{{type=='104'?'套':type=='105'?'次':'次'}}
|
||
</text>
|
||
</span>
|
||
|
||
</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><!-- | 好评{{item.esteemRate}}% -->
|
||
</view>
|
||
<view class="item-view-bottom-btn">
|
||
查看
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</z-paging>
|
||
</view>
|
||
</template>
|
||
<script>
|
||
export default {
|
||
data() {
|
||
return {
|
||
loadingType: 0,
|
||
myId: '',
|
||
// v-model绑定的这个变量不要在分页请求结束中自己赋值!!!
|
||
dataList: [],
|
||
typeData: '104',
|
||
tabIndex: 0,
|
||
searchValue: '',
|
||
serviceTrue: true,
|
||
page: 1,
|
||
limit: 10,
|
||
type:'95',
|
||
titleNmae: '',
|
||
classifyId: '',
|
||
getName: '',
|
||
tabList: [
|
||
{
|
||
code: "服务项目",
|
||
id: 95,
|
||
name: "",
|
||
orderNum: 5,
|
||
parentId: 22,
|
||
remark: "",
|
||
status: 1,
|
||
type: "95",
|
||
value: "服务项目",
|
||
},
|
||
{
|
||
code: "服务套餐",
|
||
id: 104,
|
||
name: "",
|
||
orderNum: 5,
|
||
parentId: 22,
|
||
remark: "",
|
||
status: 1,
|
||
type: "104",
|
||
value: "服务套餐",
|
||
},
|
||
{
|
||
code: "项目次卡",
|
||
id: 105,
|
||
name: "",
|
||
orderNum: 5,
|
||
parentId: 22,
|
||
remark: "",
|
||
status: 1,
|
||
type: "105",
|
||
value: "项目次卡",
|
||
},
|
||
{
|
||
code: "服务疗程",
|
||
id: 106,
|
||
name: "",
|
||
orderNum: 5,
|
||
parentId: 22,
|
||
remark: "",
|
||
status: 1,
|
||
type: "106",
|
||
value: "服务疗程",
|
||
},
|
||
|
||
],
|
||
}
|
||
},
|
||
onLoad(e) {
|
||
this.typeData = e.classifyId
|
||
this.classifyId=e.classifyId
|
||
this.myId = uni.getStorageSync('userId')
|
||
// this.getData();
|
||
// this.tabList[0]=this.typeData
|
||
uni.setNavigationBarTitle({
|
||
title: this.typeData == '95' ? '中医推拿' : this.typeData == '101' ? '小儿推拿' : this.typeData ==
|
||
'102' ? '产后康复' : this.typeData == '91' ? '私密护理' : '正骨拨筋',
|
||
})
|
||
},
|
||
|
||
methods: {
|
||
input(res) { //搜索 输入框
|
||
this.searchValue = res;
|
||
},
|
||
searchBtn() { //搜索按钮
|
||
if (this.searchValue != "") {
|
||
this.page = 1;
|
||
this.getData()
|
||
}
|
||
},
|
||
getData() {
|
||
this.$refs.paging.reload(true);
|
||
},
|
||
queryList(pageNo, pageSize) {
|
||
// console.log("item======",this.type)
|
||
if(this.type!='104'&&this.type!='105'&&this.type!='106'){//初始加载 加载普通项目列表
|
||
var url='/app/artificer/selectMassageTypePage'
|
||
var params = {
|
||
page: pageNo,
|
||
limit: pageSize,
|
||
by: 3,
|
||
status: 1,
|
||
classifyId: this.classifyId,
|
||
title:this.searchValue
|
||
}
|
||
}else{//套餐次卡疗程 列表
|
||
var url='/app/massage/package/findPage'
|
||
var params = {
|
||
page: pageNo,
|
||
limit: pageSize,
|
||
type: this.type,
|
||
title: this.searchValue,
|
||
classifyId: this.classifyId
|
||
}
|
||
}
|
||
|
||
this.$Request.get(url, params).then(res => {
|
||
for (var i = 0; i < res.data.list.length; i++) {
|
||
res.data.list[i].tagsData = res.data.list[i].labels.split(',');
|
||
if (res.data.list[i].level == 3) {
|
||
res.data.list[i].levelName = "新手"
|
||
}
|
||
if (res.data.list[i].level == 4) {
|
||
res.data.list[i].levelName = "专家"
|
||
}
|
||
if (res.data.list[i].level == 5) {
|
||
res.data.list[i].levelName = "资深"
|
||
}
|
||
}
|
||
this.$refs.paging.complete(res.data.list);
|
||
}).catch(res => {
|
||
this.$refs.paging.complete(false);
|
||
})
|
||
},
|
||
changeClick(index, item) {
|
||
this.type = item.type;
|
||
this.classifyId=item.classifyId
|
||
this.searchValue = ''
|
||
this.page = 1;
|
||
this.dataList = []
|
||
this.getData()
|
||
},
|
||
backImg() { //返回上一页
|
||
uni.reLaunch({
|
||
url: '/pages/index/index'
|
||
})
|
||
},
|
||
clear(res) {
|
||
this.getData()
|
||
},
|
||
itemClick(item) {
|
||
console.log('item=========',item)
|
||
if (this.type == '104') {
|
||
uni.navigateTo({
|
||
url: '/pages/my/serviceOderDrtail?id=' + item.id + '&limit=' + this.limit + '&page=' + this
|
||
.page + '&name=' + 'index' + '&isCanCoupon=' + item.isCanCoupon
|
||
})
|
||
} else if (this.type == '105') {
|
||
uni.navigateTo({
|
||
url: '/pages/my/cikarDrtail?id=' + item.id + '&limit=' + this.limit + '&page=' + this
|
||
.page + '&name=' + 'index' + '&isCanCoupon=' + item.isCanCoupon
|
||
})
|
||
} else if (this.type == '106') {
|
||
uni.navigateTo({
|
||
url: '/pages/my/fuwuliaochengDetail?id=' + item.id + '&limit=' + this.limit + '&page=' +
|
||
this.page + '&name=' + 'index' + '&isCanCoupon=' + item.isCanCoupon
|
||
})
|
||
}else{
|
||
uni.navigateTo({
|
||
url: '/pages/my/fuwuDateil?id=' + item.massageTypeId + '&limit=' + this.limit + '&page=' +
|
||
this.page + '&name=' + 'index' + '&isCanCoupon=' + item.isCanCoupon
|
||
})
|
||
}
|
||
}
|
||
}
|
||
}
|
||
</script>
|
||
|
||
<style scoped>
|
||
.fenlei {
|
||
display: flex;
|
||
flex-direction: row;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
}
|
||
|
||
.tab-view {
|
||
width: 100%;
|
||
display: flex;
|
||
flex-direction: column;
|
||
position: fixed;
|
||
z-index: 999;
|
||
/*background:#fff linear-gradient(60deg,rgba(115, 212, 183, 0.2),rgba(227, 251, 244, 0.1),rgba(193, 236, 223, 0.35));
|
||
border-bottom:1rpx solid #c4ede1;*/
|
||
padding-top: 6rpx;
|
||
}
|
||
|
||
.shop_label {
|
||
display: flex;
|
||
flex-wrap: wrap;
|
||
margin-top: 4rpx;
|
||
}
|
||
|
||
.shop_label span {
|
||
background: linear-gradient(90deg, #ffefde, #fff7ef);
|
||
height: 34rpx;
|
||
line-height: 34rpx;
|
||
border-radius: 8rpx;
|
||
padding: 0 10rpx;
|
||
font-size: 22rpx;
|
||
margin-right: 8rpx;
|
||
margin-bottom: 8rpx;
|
||
color: #f68607;
|
||
}
|
||
|
||
/deep/.refresh-body .content {}
|
||
|
||
/deep/.refresh-body {
|
||
height: 100% !important;
|
||
border-top: 2px solid #f7f7f7;
|
||
margin: 80px 0px;
|
||
}
|
||
|
||
.content-view {
|
||
width: 100%;
|
||
height: 100vh;
|
||
overflow: hidden;
|
||
background-color: #f7f7f7;
|
||
/*position: relative;*/
|
||
}
|
||
|
||
.item-view-bottom-btn {
|
||
text-align: center;
|
||
width: 131rpx;
|
||
height: 55rpx;
|
||
line-height: 55rpx;
|
||
background: linear-gradient(90deg, #019C88, #0FA78B, #35C495);
|
||
border-radius: 10rpx;
|
||
font-weight: bold;
|
||
font-size: 28rpx;
|
||
color: #FFFFFF;
|
||
}
|
||
.item-view-bottom-qian-span{
|
||
font-size: 28rpx;
|
||
color: #848484;
|
||
text-decoration-line: line-through;
|
||
}
|
||
.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) {
|
||
font-size: 26rpx;
|
||
color: #848484;
|
||
text-decoration-line: line-through;
|
||
margin-left: 5px;
|
||
}
|
||
|
||
.item-view-bottom-qian span:nth-child(3) {
|
||
font-size: 28rpx;
|
||
color: #FF6000;
|
||
}
|
||
|
||
.item-view-bottom-qian span:nth-child(2) {
|
||
font-weight: bold;
|
||
font-size: 36.81rpx;
|
||
color: #FF6000;
|
||
}
|
||
|
||
.item-view-bottom-qian span:nth-child(1) {
|
||
font-weight: 400;
|
||
font-size: 26rpx;
|
||
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 {
|
||
font-weight: 400;
|
||
font-size: 24rpx;
|
||
color: #999999;
|
||
margin: 5px 0px;
|
||
display: -webkit-box;
|
||
-webkit-box-orient: vertical;
|
||
-webkit-line-clamp: 2;
|
||
/* 显示的行数,可以根据需要修改 */
|
||
overflow: hidden;
|
||
text-overflow: ellipsis;
|
||
}
|
||
|
||
.item-view-biao {
|
||
padding: 1px 5px;
|
||
border-radius: 15rpx 3rpx 15rpx 3rpx;
|
||
width: 50px;
|
||
text-align: center;
|
||
}
|
||
|
||
.tuina {
|
||
background-color: #d1f2df;
|
||
color: #17984d;
|
||
}
|
||
|
||
.xiaoer {
|
||
background-color: #f1f8d7;
|
||
color: #58b314;
|
||
}
|
||
|
||
.taishi {
|
||
background-color: #e5d5c6;
|
||
color: #805d39;
|
||
}
|
||
|
||
.kangfu {
|
||
background-color: #fcf3da;
|
||
color: #ff8600;
|
||
}
|
||
|
||
.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 {
|
||
font-weight: bold;
|
||
font-size: 32rpx;
|
||
color: #333333;
|
||
overflow: hidden;
|
||
text-overflow: ellipsis;
|
||
white-space: nowrap;
|
||
}
|
||
|
||
.item-view {
|
||
width: 60%;
|
||
height: 100%;
|
||
display: flex;
|
||
flex-direction: column;
|
||
justify-content: center;
|
||
justify-content: space-between;
|
||
padding: 5rpx 0;
|
||
}
|
||
|
||
.item-img {
|
||
width: 240rpx;
|
||
height: 200rpx;
|
||
border-radius: 14rpx;
|
||
position: relative;
|
||
}
|
||
|
||
.item-img img {
|
||
border-radius: 14rpx;
|
||
}
|
||
|
||
.img-span {
|
||
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;
|
||
}
|
||
|
||
.item-img image {
|
||
width: 100%;
|
||
height: 100%;
|
||
}
|
||
|
||
.item {
|
||
width: 100%;
|
||
margin: 0 auto;
|
||
display: flex;
|
||
flex-direction: row;
|
||
justify-content: space-between;
|
||
/*height: 140px;*/
|
||
background: #FFFFFF;
|
||
border-radius: 21rpx;
|
||
margin-bottom: 10px;
|
||
align-items: center;
|
||
padding: 20rpx;
|
||
}
|
||
|
||
.item-detail {
|
||
padding: 5rpx 15rpx;
|
||
border-radius: 10rpx;
|
||
font-size: 28rpx;
|
||
color: white;
|
||
background-color: #007AFF;
|
||
}
|
||
|
||
.item-line {
|
||
position: absolute;
|
||
bottom: 0rpx;
|
||
left: 0rpx;
|
||
height: 1px;
|
||
width: 100%;
|
||
background-color: #eeeeee;
|
||
}
|
||
|
||
/deep/.zp-paging-container {
|
||
background-color: #f7f7f7;
|
||
width: 100%;
|
||
}
|
||
|
||
/deep/.zp-paging-container-content {
|
||
width: 95%;
|
||
margin: 0 auto;
|
||
}
|
||
|
||
.index-fenl-title {
|
||
width: 81rpx;
|
||
text-align: center;
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: center;
|
||
font-weight: bold;
|
||
font-size: 34rpx;
|
||
color: #019C88;
|
||
}
|
||
|
||
.index-fenl-title-bottom {
|
||
position: absolute;
|
||
bottom: 0;
|
||
margin-bottom: 0px;
|
||
width: 81rpx;
|
||
height: 14rpx;
|
||
border-radius: 7rpx;
|
||
background: linear-gradient(-48deg, rgba(1, 156, 136, 0.35), rgba(45, 196, 142, 0.35));
|
||
}
|
||
|
||
/deep/.uni-searchbar__cancel {
|
||
display: none;
|
||
}
|
||
|
||
/deep/.uni-searchbar__box-icon-search,
|
||
.search-btn {
|
||
width: 110rpx;
|
||
height: 50rpx;
|
||
/* background: #18A689;
|
||
border-radius: 31rpx; */
|
||
}
|
||
|
||
/deep/.uni-searchbar__box {
|
||
height: 34px;
|
||
border-radius: 30px !important;
|
||
background-color: #fff !important;
|
||
border: 1px solid #09a28a;
|
||
display: flex;
|
||
flex-direction: row;
|
||
flex-flow: row-reverse;
|
||
position: relative;
|
||
}
|
||
|
||
/deep/.uni-searchbar {
|
||
width: 250px;
|
||
border-radius: 31rpx;
|
||
padding-right: 24rpx;
|
||
}
|
||
|
||
.search-btn {
|
||
text-align: center;
|
||
color: #019c88;
|
||
font-weight: bold;
|
||
position: absolute;
|
||
right: 40rpx;
|
||
top: 20rpx;
|
||
font-size: 30rpx;
|
||
display: flex;
|
||
align-items: center;
|
||
}
|
||
|
||
/deep/.uni-input-input {
|
||
display: block;
|
||
height: 100%;
|
||
background: none;
|
||
color: inherit;
|
||
opacity: 1;
|
||
font: inherit;
|
||
line-height: inherit;
|
||
letter-spacing: inherit;
|
||
text-align: inherit;
|
||
text-indent: 10px;
|
||
text-transform: inherit;
|
||
text-shadow: inherit;
|
||
}
|
||
|
||
/deep/uni-input-form {
|
||
display: -webkit-box;
|
||
display: -webkit-flex;
|
||
display: flex;
|
||
position: relative;
|
||
width: 100%;
|
||
height: 100%;
|
||
-webkit-box-orient: vertical;
|
||
-webkit-box-direction: normal;
|
||
-webkit-flex-direction: column;
|
||
flex-direction: column;
|
||
-webkit-box-pack: center;
|
||
-webkit-justify-content: center;
|
||
justify-content: center;
|
||
}
|
||
|
||
.service-head-top-left image {
|
||
width: 20px;
|
||
height: 20rpx;
|
||
margin-right: 5px;
|
||
margin-left: 10rpx;
|
||
}
|
||
|
||
.service-head-top-left span {
|
||
width: 180rpx;
|
||
height: 60rpx;
|
||
background: url('../../static/images/headline.png') 0rpx 26rpx;
|
||
background-repeat: no-repeat;
|
||
font-weight: bold;
|
||
font-size: 34rpx;
|
||
color: #171717;
|
||
margin-top: 14rpx;
|
||
}
|
||
|
||
.service-head-top-left {
|
||
display: flex;
|
||
flex-direction: row;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
}
|
||
|
||
.service-head-top {
|
||
height: 90rpx;
|
||
display: flex;
|
||
flex-direction: row;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
}
|
||
|
||
.view-cata {
|
||
display: flex;
|
||
flex-direction: row;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
}
|
||
</style> |