sadjv3_user/pages/my/servicePackage.vue

703 lines
18 KiB
Vue
Raw Normal View History

2024-06-12 15:52:21 +08:00
<!-- 自定义下拉刷新与上拉加载演示(vue) -->
<template>
<view class="content">
<z-paging ref="paging" v-model="dataList" @query="queryList">
<!-- 需要固定在顶部不滚动的view放在slot="top"的view中如果需要跟着滚动则不要设置slot="top" -->
<!-- 注意此处的z-tabs为独立的组件可替换为第三方的tabs若需要使用z-tabs请在插件市场搜索z-tabs并引入否则会报插件找不到的错误 -->
<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" @blur="blur" @input="input"
@clear="clear">
</uni-search-bar>
<view class="search-btn">
搜索
</view>
</view>
</view>
<view class="fenlei">
<!-- <view class="index-fenl-title">
<span>类目</span>
<span class="index-fenl-title-bottom"></span>
</view> -->
<z-tabs class="z-tabs-fenlei" :list="tabList" @change="tabChange" />
</view>
</template>
<!-- 自定义下拉刷新view(如果use-custom-refresher为true且不设置下面的slot="refresher"此时不用获取refresherStatus会自动使用z-paging自带的下拉刷新view) -->
<!-- 注意注意注意字节跳动小程序中自定义下拉刷新不支持slot-scope将导致custom-refresher无法显示 -->
<!-- 如果是字节跳动小程序请参照sticky-demo.vue中的写法此处使用slot-scope是为了减少data中无关变量声明降低依赖 -->
<template #refresher="{refresherStatus}">
<!-- 此处的custom-refresh为demo中自定义的组件非z-paging的内置组件请在实际项目中自行创建这里插入什么view下拉刷新就显示什么view -->
<custom-refresher :status="refresherStatus" />
</template>
<!-- 自定义没有更多数据view -->
<template #loadingMoreNoMore>
<!-- 此处的custom-nomore为demo中自定义的组件非z-paging的内置组件请在实际项目中自行创建这里插入什么view没有更多数据就显示什么view -->
<custom-nomore />
</template>
<!-- 如果希望其他view跟着页面滚动可以放在z-paging标签内 -->
<view class="item" v-for="(item,index) in dataList" :key="index" @click="itemClick(item)">
<!-- <view class="item-title">{{item.title}}</view>
<view class="item-detail">{{item.detail}}</view> -->
<!-- <view class="item-line"></view> -->
<view class="item-img">
<image src="../../static/pintuan.png" mode=""></image>
2024-06-15 09:08:10 +08:00
<span class="img-span">次卡</span>
2024-06-12 15:52:21 +08:00
</view>
<view class="item-view">
<view class="item-view-title">
中医推拿优选套餐
</view>
<view class="item-view-xiangmu">
<span class="xiaoer item-view-biao">小儿推拿</span>
<!-- <span class="tuina item-view-biao">中医推拿</span>
<span class="taishi item-view-biao">泰式推拿</span>
<span class="kangfu item-view-biao">小儿康复</span> -->
<span>已售2w+ | 好评100%</span>
</view>
<view class="item-view-jianjie">
套餐简介:理疗流程 /俯卧位(头部肩颈腰背四肢按摩)促进血液循环
</view>
<view class="item-view-bottom">
<view class="item-view-bottom-qian">
<span></span>
<span>498</span>
<span>/元套</span>
<span>560</span>
</view>
2024-06-15 09:08:10 +08:00
<view class="item-view-bottom-btn" @click.stop="toggle('center')">
服务升级
2024-06-12 15:52:21 +08:00
</view>
</view>
</view>
</view>
</z-paging>
2024-06-15 09:08:10 +08:00
<view>
<!-- 普通弹窗 -->
<uni-popup ref="popup" background-color="#fff" @change="change">
<view class="popup-content">
<view class="popup-head">
<span>改价单</span>
<span @click="closePopup(type)">x</span>
</view>
<view class="popup-mian">
<!-- <view class="popup-mian-textarea">
<view class="popup-mian-view">
<span>原服务项目价格:</span>
<span>198</span>
</view>
<view class="popup-mian-view">
<span>现服务项目价格:</span>
<span>298</span>
</view>
<view class="popup-mian-view">
<span>改价需支付差价:</span>
<span>100</span>
</view>
</view> -->
<view class="chong">
<view class="chong-list">
<view class="chong-list-left">
<radio value="" class="chong-list-radio"/>
<image src="../../static/jinggao.png" mode=""></image>
</view>
<view class="chong-list-right">
<view class="chong-title">
<span>王丽楠</span>
<image src="../../static/xinren.png" mode=""></image>
</view>
<view class="chong-bottom">
<view class="chong-bottom-ding">
<image src="../../static/orderDetail/dingwei.png" mode=""></image>
<span>0.8km</span>
</view>
<view class="chong-bottom-cheng">
<image class="therapist-bottom-img" src="../../static/dituzhaoren5.png">
<span>春城有约</span>
</view>
</view>
</view>
</view>
<view class="chong-list">
<view class="chong-list-left">
<radio value="" class="chong-list-radio"/>
<image src="../../static/jinggao.png" mode=""></image>
</view>
<view class="chong-list-right">
<view class="chong-title">
<span>王丽楠</span>
<image src="../../static/xinren.png" mode=""></image>
</view>
<view class="chong-bottom">
<view class="chong-bottom-ding">
<image src="../../static/orderDetail/dingwei.png" mode=""></image>
<span>0.8km</span>
</view>
<view class="chong-bottom-cheng">
<image class="therapist-bottom-img" src="../../static/dituzhaoren5.png">
<span>春城有约</span>
</view>
</view>
</view>
</view>
<view class="chong-list">
<view class="chong-list-left">
<radio value="" class="chong-list-radio"/>
<image src="../../static/jinggao.png" mode=""></image>
</view>
<view class="chong-list-right">
<view class="chong-title">
<span>王丽楠</span>
<image src="../../static/xinren.png" mode=""></image>
</view>
<view class="chong-bottom">
<view class="chong-bottom-ding">
<image src="../../static/orderDetail/dingwei.png" mode=""></image>
<span>0.8km</span>
</view>
<view class="chong-bottom-cheng">
<image class="therapist-bottom-img" src="../../static/dituzhaoren5.png">
<span>春城有约</span>
</view>
</view>
</view>
</view>
</view>
<view class="popup-mian-btn">
<span @click="closePopup(type)">
取消
</span>
<span>
确定
</span>
</view>
</view>
</view>
</uni-popup>
</view>
2024-06-12 15:52:21 +08:00
</view>
</template>
<script>
export default {
data() {
return {
2024-06-15 09:08:10 +08:00
type:'center',
2024-06-12 15:52:21 +08:00
// v-model绑定的这个变量不要在分页请求结束中自己赋值
dataList: [],
tabList: ['中医推拿','中医推拿','中医推拿','中医推拿','中医推拿','中医推拿','中医推拿'],
tabIndex: 0,
searchValue:'',
serviceTrue:true,
}
},
methods: {
2024-06-15 09:08:10 +08:00
change(e) {
console.log('当前模式:' + e.type + ',状态:' + e.show);
},
closePopup(type){//改价 关闭弹出框
this.type = type
this.$refs.popup.close(type);
},
toggle(type) {//改价 弹出框
this.type = type
// open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
this.$refs.popup.open(type)
},
2024-06-12 15:52:21 +08:00
backImg(){//返回上一页
uni.reLaunch({
url:'/pages/my/index'
})
},
search(res) {
// uni.showToast({
// title: '搜索:' + res.value,
// icon: 'none'
// })
},
input(res) {
console.log('----input:', res)
},
clear(res) {
uni.showToast({
title: 'clear事件清除值为' + res.value,
icon: 'none'
})
},
blur(res) {
uni.showToast({
title: 'blur事件输入值为' + res.value,
icon: 'none'
})
},
tabChange(index) {
this.tabIndex = index;
//当切换tab或搜索时请调用组件的reload方法请勿直接调用queryList方法
//调用reload时参数传true则代表reload时触发下拉刷新效果不传或false则代表取消此效果
this.$refs.paging.reload(true);
},
queryList(pageNo, pageSize) {
// 组件加载时会自动触发此方法,因此默认页面加载时会自动触发,无需手动调用
// 这里的pageNo和pageSize会自动计算好直接传给服务器即可
// 模拟请求服务器获取分页数据,请替换成自己的网络请求
const params = {
pageNo: pageNo,
pageSize: pageSize,
type: this.tabIndex + 1
}
this.$request.queryList(params).then(res => {
// 将请求的结果数组传递给z-paging
this.$refs.paging.complete(res.data.list);
}).catch(res => {
// 如果请求失败写this.$refs.paging.complete(false);
// 注意每次都需要在catch中写这句话很麻烦z-paging提供了方案可以全局统一处理
// 在底层的网络请求抛出异常时写uni.$emit('z-paging-error-emit');即可
this.$refs.paging.complete(false);
})
},
itemClick(item) {
uni.navigateTo({
url:'/pages/my/serviceOderDrtail'
})
}
}
}
</script>
<style scoped>
2024-06-15 09:08:10 +08:00
.chong-list:last-child{
border: 0px !important;
}
.chong-bottom-cheng image{
width: 22.22rpx;
height: 22.22rpx;
margin-right: 5px;
}
.chong-bottom-cheng span{
font-weight: 500;
font-size: 23rpx;
color: #222222;
}
.chong-bottom-ding image{
width: 18.75rpx;
height: 21.53rpx;
margin-right: 5px;
}
.chong-bottom-ding span{
font-weight: bold;
font-size: 25rpx;
color: #848485;
}
.chong-bottom-ding,.chong-bottom-cheng{
display: flex;
flex-direction: row;
align-items: center;
}
.chong-bottom{
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
margin-top: 10px;
}
.chong-title image{
width: 50rpx;
height: 22.22rpx;
}
.chong-title span{
font-weight: 400;
font-size: 29rpx;
color: #333333;
margin-right: 5px;
}
.chong-title{
display: flex;
flex-direction: row;
align-items: center;
}
.chong-list-right{
width: 75%;
display: flex;
flex-direction: column;
}
.chong-list-left image{
width: 76rpx;
height: 76rpx;
}
/deep/uni-radio .uni-radio-input{
width: 29.86rpx;
height: 29.86rpx;
margin: -3px 0px 0px -5px;
background-color: rgba(4, 159, 137, 1) !important;
border-color: rgba(4, 159, 137, 1) !important;
}
.chong-list-radio{
margin-right: 5px;
width: 29.86rpx;
height: 29.86rpx;
}
.chong-list-left{
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
}
.chong-list{
width: 100%;
display: flex;
flex-direction: row;
justify-content: space-between;
padding: 10px 0px;
border-bottom: 1px solid #DCDCDC;
}
.chong{
width: 100%;
display: flex;
flex-direction: column;
}
.img-span{
display: flex;
justify-content: center;
align-items: center;
width: 40px;
height: 16px;
line-height: 16px;
background: linear-gradient(-90deg, #FF6F48, #FF9E69);
border-top-left-radius: 15rpx;
border-bottom-right-radius: 15rpx;
font-weight: bold;
font-size: 18rpx;
color: #FFFFFF;
position: absolute;
bottom: 0;
right: 0;
margin: 0 6px 6px 0px;
}
.popup-mian-view span:nth-child(1){
color: #666666;
}
.popup-mian-view span:nth-child(2){
color: #333;
font-weight: bold;
}
.popup-mian-view span{
font-size: 29rpx;
}
.popup-mian-view{
width: 100%;
height: 35px;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid #DCDCDC;
}
.popup-mian-textarea{
width: 100%;
display: flex;
flex-direction: column;
}
.popup-mian-btn span:nth-child(1){
background: linear-gradient(90deg, #FE912E, #FF9970);
}
.popup-mian-btn span:nth-child(2){
background: linear-gradient(90deg, #019C88, #28BA92, #35C495);
}
.popup-mian-btn span{
width: 247rpx;
height: 77rpx;
line-height: 77rpx;
text-align: center;
font-weight: 400;
font-size: 32rpx;
color: #FFFEFE;
border-radius: 39rpx;
}
.popup-mian-btn{
width: 100%;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
margin-top: 10px;
}
2024-06-12 15:52:21 +08:00
2024-06-15 09:08:10 +08:00
.popup-mian{
width: 88%;
display: flex;
flex-direction: column;
margin: 5px auto 0px auto;
}
.popup-head span:nth-child(2){
width: 50rpx;
height: 50rpx;
line-height: 19px;
text-align: center;
font-size: 24px;
color: #15AB8D;
border-radius: 50%;
border: 3px solid #15AB8D;
}
.popup-head span:nth-child(1){
font-weight: bold;
font-size: 32rpx;
color: #333333;
}
.popup-head{
width: 100%;
height: 99.38rpx;
background-color: rgba(21, 171, 141, 0.09);
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
padding: 0 15px;
}
.popup-content{
width: 613rpx;
padding-bottom: 10px;
background: #FFFFFF;
border-radius: 56rpx;
display: flex;
flex-direction: column;
}
2024-06-12 15:52:21 +08:00
.item-view-bottom-btn{
text-align: center;
width: 131rpx;
height: 50rpx;
line-height: 50rpx;
background: linear-gradient(90deg, #019C88, #0FA78B, #35C495);
border-radius: 10rpx;
font-weight: bold;
font-size: 24rpx;
color: #FFFFFF;
}
.item-view-bottom-qian span:nth-child(4){
font-weight: bold;
font-size: 31rpx;
color: #848484;
text-decoration-line: line-through;
margin-left: 5px;
}
.item-view-bottom-qian span:nth-child(1){
font-weight: 400;
font-size: 25rpx;
color: #F95900;
}
.item-view-bottom-qian span:nth-child(2){
font-weight: bold;
font-size: 36.81rpx;
color: #F95900;
}
.item-view-bottom-qian span:nth-child(3){
font-weight: 400;
font-size: 25rpx;
color: #F95900;
}
.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: 22rpx;
color: #848484;
margin:5px 0px;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2; /* 显示的行数,可以根据需要修改 */
overflow: hidden;
text-overflow: ellipsis;
}
.item-view-biao{
padding: 1px 2px;
border-radius: 6rpx;
}
.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: #666666;
margin-left: 5px;
}
.item-view-xiangmu{
width: 100%;
display: flex;
flex-direction: row;
font-weight: 400;
font-size: 21rpx;
margin-top: 5px;
}
.item-view-title{
font-weight: bold;
font-size: 33rpx;
color: #333333;
}
.item-view{
width: 55%;
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
}
.item-img{
width: 285rpx;
height: 120px;
border-radius: 14rpx;
2024-06-15 09:08:10 +08:00
position: relative;
2024-06-12 15:52:21 +08:00
}
.item-img image{
width: 100%;
height: 100%;
}
.item {
width: 100%;
display: flex;
flex-direction: row;
justify-content: space-between;
height: 140px;
background: #FFFFFF;
border-radius: 21rpx;
margin-top:20px;
align-items: center;
padding: 0px 5px;
}
.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;
}
.fenlei{
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
}
.index-fenl-title{
width: 81rpx;
text-align: center;
position: relative;
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;
}
.search-btn{
text-align: center;
line-height: 60rpx;
color: #fff;
position: absolute;
right: 0;
top: 0;
margin-top:9.4px;
margin-right: 11px;
height: 32px !important;
}
/deep/.uni-searchbar__box-icon-search,.search-btn{
width: 101rpx;
height: 60rpx;
background: #18A689;
border-radius: 31rpx;
}
/deep/.uni-searchbar__box{
height: 31px;
border-radius: 15px !important;
background-color: #fff !important;
border: 2px solid #E5E5E5;
padding: 0px;
display: flex;
flex-direction: row;
flex-flow: row-reverse;
position: relative;
}
/deep/.uni-searchbar{
width: 240px;
border-radius: 31rpx;
}
.service-head-top-left image{
width: 25px;
height: 30rpx;
margin-right: 10px;
}
.service-head-top-left span{
font-weight: bold;
font-size: 44rpx;
color: #171717;
}
.service-head-top-left{
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
}
.service-head-top{
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
}
</style>