sadjv3_user/pages/my/newseckill.vue

603 lines
15 KiB
Vue
Raw Normal View History

2024-07-15 15:08:49 +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">
2024-07-22 17:38:48 +08:00
<image class="service-fh" @click="backImg" src="../../static/fanhui.png" mode="widthFix"></image>
<image class="service-img" src="../../static/seckill.png"></image>
2024-07-15 15:08:49 +08:00
</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">
2024-07-30 14:17:50 +08:00
<image style="width:30rpx; height:30rpx; margin-right: 10rpx;" src="../../static/search.png"></image>
搜索
2024-07-15 15:08:49 +08:00
</view>
</view>
</view>
<!-- <view class="fenlei">
<z-tabs class="z-tabs-fenlei" :list="tabList" @change="tabChange" @changeClick="changeClick"/>
</view> -->
</template>
2024-07-25 20:58:11 +08:00
2024-07-15 15:08:49 +08:00
<!-- 自定义下拉刷新view(如果use-custom-refresher为true且不设置下面的slot="refresher"此时不用获取refresherStatus会自动使用z-paging自带的下拉刷新view) -->
<!-- 注意注意注意字节跳动小程序中自定义下拉刷新不支持slot-scope将导致custom-refresher无法显示 -->
<!-- 如果是字节跳动小程序请参照sticky-demo.vue中的写法此处使用slot-scope是为了减少data中无关变量声明降低依赖 -->
2024-07-26 10:45:31 +08:00
<!-- <template #refresher="{refresherStatus}" > -->
2024-07-15 15:08:49 +08:00
<!-- 此处的custom-refresh为demo中自定义的组件非z-paging的内置组件请在实际项目中自行创建这里插入什么view下拉刷新就显示什么view -->
2024-07-26 10:45:31 +08:00
<!-- <custom-refresher :status="refresherStatus" />
</template> -->
2024-07-15 15:08:49 +08:00
<!-- 自定义没有更多数据view -->
<template #loadingMoreNoMore >
<!-- 此处的custom-nomore为demo中自定义的组件非z-paging的内置组件请在实际项目中自行创建这里插入什么view没有更多数据就显示什么view -->
<custom-nomore />
</template>
2024-07-25 20:58:11 +08:00
2024-07-15 15:08:49 +08:00
<!-- 如果希望其他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="item.packageImg" mode=""></image>
2024-07-22 19:41:55 +08:00
<span class="img-span" v-if="text=='my'">{{item.status=='1'?'未用完':item.status=='2'?'退款':item.status=='9'?'已用完':'其他'}}</span>
2024-07-15 15:08:49 +08:00
</view>
<view class="item-view">
<view class="view-cata">
2024-07-19 15:13:22 +08:00
<view class="item-view-title">{{item.title}}</view>
2024-07-25 19:36:32 +08:00
<!-- <view class="xiaoer item-view-biao">{{item.classifyName}}</view> -->
2024-07-23 17:04:31 +08:00
</view>
2024-07-30 14:17:50 +08:00
<view class="item-view-bottom-qian">
<span></span>
<span>{{item.price}}</span>
<!-- <span>/{{item.serviceCount}}</span> -->
<span>{{item.oldPrice}}</span>
</view>
<view class="flex" style="margin-top: 10rpx;">
2024-07-25 20:58:11 +08:00
<view class="shop_label" v-if="item.tagsData!=''">
2024-07-25 19:36:32 +08:00
<span v-for="tag in item.tagsData" :key="tag">{{tag}}</span>
2024-07-23 17:04:31 +08:00
</view>
2024-07-25 20:58:11 +08:00
<view class="shop_label" v-else>
<span>助眠解压</span>
</view>
2024-07-30 14:17:50 +08:00
</view>
<view class="item-view-bottom" v-if="text=='index'">
<view class="item-view-xiangmu">
<span>已售</span><span>{{item.sales}} <!-- | 好评{{item.esteemRate}}% --></span>
2024-07-15 15:08:49 +08:00
</view>
2024-07-25 19:36:32 +08:00
<view class="item-view-bottom-btn" v-if="item.isStart=='true'">
开抢
</view>
<view class="item-view-bottom-btn-un" v-else>
2024-07-23 17:04:31 +08:00
开抢
2024-07-15 15:08:49 +08:00
</view>
</view>
2024-07-30 14:17:50 +08:00
<view class="item-view-bottom" v-if="text=='my'">
<view class="item-view-xiangmu">
<span>已售</span><span>{{item.sales}} <!-- | 好评{{item.esteemRate}}% --></span>
</view>
<view class="item-view-bottom-btn">
预约
</view>
</view>
2024-07-25 20:58:11 +08:00
</view>
2024-07-15 15:08:49 +08:00
</view>
</z-paging>
2024-07-25 20:58:11 +08:00
2024-07-15 15:08:49 +08:00
</view>
</template>
<script>
export default {
data() {
return {
myId: '',
// v-model绑定的这个变量不要在分页请求结束中自己赋值
dataList: [],
tabList: [],
2024-07-25 19:36:32 +08:00
typeData:'112',
2024-07-15 15:08:49 +08:00
tabIndex: 0,
searchValue:'',
serviceTrue:true,
page:1,
limit:10,
2024-07-22 10:05:30 +08:00
titleNmae:'',
2024-07-22 13:58:35 +08:00
tagsData:[],
text:''
2024-07-15 15:08:49 +08:00
}
},
2024-07-22 13:58:35 +08:00
onLoad(e){
2024-07-15 15:08:49 +08:00
this.myId = uni.getStorageSync('userId')
2024-07-22 13:58:35 +08:00
this.text=e.text
2024-07-25 19:36:32 +08:00
// this.getData()
2024-07-15 15:08:49 +08:00
},
methods: {
input(res) {//搜索 输入框
this.searchValue=res;
},
searchBtn(){//搜索按钮
if(this.searchValue!=""){
this.getData()
}
},
getData(){
2024-07-25 19:36:32 +08:00
// console.log("getData");
// let data = {
2024-07-25 20:58:11 +08:00
// userId: this.myId,
2024-07-25 19:36:32 +08:00
// page: this.page,
// limit: this.limit,
// type: '112',
// title:this.searchValue,
// }
// if(this.text=='index'){//首页进来的秒杀列表接口
// this.$Request.get('/app/massage/package/findAppActivityPage', data).then(res => {
// for(var i=0;i<res.data.list.length;i++){
// var tagsData=res.data.list[i].labels.split(',');
// res.data.list[i].tagsData = tagsData;
// }
// this.$refs.paging.complete(res.data.list);
// }).catch(res => {
// this.$refs.paging.complete(false);
// })
// }else{
// this.$Request.get('/app/user/package/findMyPackageList', data).then(res => {
// if (res.code == 0) {
// this.dataList=res.data.records;
// for(var i=0;i<this.dataList.length;i++){
// this.tagsData=this.dataList[i].labels.split(',');
// }
// }
// })
// }
2024-07-25 20:58:11 +08:00
this.$refs.paging.reload(true);
2024-07-15 15:08:49 +08:00
},
tabChange(index) {
this.tabIndex = index;
//当切换tab或搜索时请调用组件的reload方法请勿直接调用queryList方法
//调用reload时参数传true则代表reload时触发下拉刷新效果不传或false则代表取消此效果
this.$refs.paging.reload(true);
},
queryList(pageNo, pageSize) {
const params = {
2024-07-22 10:05:30 +08:00
userId: this.myId,
2024-07-15 15:08:49 +08:00
page: pageNo,
limit: pageSize,
2024-07-19 15:13:22 +08:00
type: '112',
2024-07-25 19:36:32 +08:00
title: this.searchValue
2024-07-15 15:08:49 +08:00
}
2024-07-22 13:58:35 +08:00
if(this.text=='index'){//首页进来的秒杀列表接口
this.$Request.get('/app/massage/package/findAppActivityPage',params).then(res => {
2024-07-25 19:36:32 +08:00
var timestamp = (new Date()).getTime();
for(var i=0;i<res.data.list.length;i++){
var tagsData=res.data.list[i].labels.split(',');
res.data.list[i].tagsData = tagsData;
var time= new Date(res.data.list[i].startTime).getTime();
if(time < timestamp){
res.data.list[i].isStart = 'true';
}else{
res.data.list[i].isStart = 'false';
}
}
2024-07-22 13:58:35 +08:00
this.$refs.paging.complete(res.data.list);
}).catch(res => {
this.$refs.paging.complete(false);
})
}else{
this.$Request.get('/app/user/package/findMyPackageList',params).then(res => {
2024-07-26 14:50:20 +08:00
console.log(res.data.records);
for(var i=0;i<res.data.records.length;i++){
res.data.records[i].tagsData=res.data.records[i].labels.split(',');
}
2024-07-22 13:58:35 +08:00
this.$refs.paging.complete(res.data.records);
}).catch(res => {
this.$refs.paging.complete(false);
})
2024-07-25 20:58:11 +08:00
}
2024-07-15 15:08:49 +08:00
},
2024-07-25 20:58:11 +08:00
2024-07-15 15:08:49 +08:00
backImg(){//返回上一页
2024-07-22 13:58:35 +08:00
if(this.text=='my'){
uni.reLaunch({
url:'/pages/my/index'
})
}else{
uni.reLaunch({
url:'/pages/index/index'
})
}
2024-07-25 20:58:11 +08:00
},
2024-07-15 15:08:49 +08:00
clear(res) {
this.getData()
},
itemClick(item) {
2024-07-22 13:58:35 +08:00
if(this.text=='index'){
uni.navigateTo({
url:'/pages/my/newseckilldetails?id='+item.id+'&limit='+this.limit+'&page='+this.page+'&name='+this.text
})
}else{
uni.navigateTo({
url:'/pages/my/miaoShaOderDrtail?id='+item.id+'&limit='+this.limit+'&page='+this.page+'&name='+this.text
})
2024-07-25 20:58:11 +08:00
}
2024-07-15 15:08:49 +08:00
}
}
}
</script>
<style scoped>
.pace-plan{
display: flex;
flex-direction: row;
padding: 20rpx 0;
2024-07-19 15:13:22 +08:00
align-items: center;
2024-07-15 15:08:49 +08:00
}
.pace-text{
font-size: 24rpx;
2024-07-25 20:58:11 +08:00
2024-07-15 15:08:49 +08:00
}
.pace-text span:nth-child(1){
color: #666;
}
.pace-text span:nth-child(2){
color: #019C88;
font-weight: bold;
}
2024-07-25 20:58:11 +08:00
2024-07-15 15:08:49 +08:00
.pace{
2024-07-19 15:13:22 +08:00
/* width: 60%; */
padding: 0px 5px;
2024-07-15 15:08:49 +08:00
height: 30rpx;
border-radius: 30rpx;
background: #f5f5f5;
font-size: 20rpx;
line-height: 30rpx;
2024-07-25 20:58:11 +08:00
2024-07-15 15:08:49 +08:00
}
.seckill-entry{
display: flex;
flex-direction: row;
justify-content: space-between;
}
.seckill-money{
color: #fc2d32;
background: #fff8f0;
2024-07-25 20:58:11 +08:00
border-radius: 30rpx;
2024-07-15 15:08:49 +08:00
padding: 15rpx 20rpx;
}
.seckill-money span:nth-child(1){
font-size: 24rpx;
}
.seckill-money span:nth-child(2){
font-weight: bold;
font-size: 40rpx;
}
.seckill-money span:nth-child(3){
font-size: 24rpx;
}
.seckill-rob{
2024-07-19 15:13:22 +08:00
width: 80px;
2024-07-15 15:08:49 +08:00
height: 50rpx;
background: linear-gradient(90deg, #fb2d30, #fc2e37);
border-radius: 5rpx 8rpx 30rpx 8rpx ;
position: relative;
padding-left: 55rpx;
line-height: 50rpx;
margin-top: 15rpx;
2024-07-25 20:58:11 +08:00
2024-07-15 15:08:49 +08:00
}
.seckill-img{
width: 70rpx;
height: 70rpx;
position: absolute;
top:-18rpx;
left:-22rpx;
}
.seckill-text{
font-size: 40rpx;
color: #fff;
font-weight: bold;
font-style:italic;
}
2024-07-25 20:58:11 +08:00
2024-07-15 15:08:49 +08:00
.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;
}
2024-07-25 19:36:32 +08:00
.item-view-bottom-btn-un{
text-align: center;
width: 131rpx;
height: 55rpx;
line-height: 55rpx;
background: linear-gradient(90deg, #ccc, #ccc, #ccc);
border-radius: 10rpx;
font-weight: bold;
font-size: 28rpx;
color: #FFFFFF;
}
2024-07-15 15:08:49 +08:00
.item-view-bottom-qian span:nth-child(5){
font-size: 28rpx;
color: #848484;
text-decoration-line: line-through;
}
2024-07-22 19:41:55 +08:00
.item-view-bottom-qian span:nth-child(3){
2024-07-15 15:08:49 +08:00
font-size: 28rpx;
color: #848484;
text-decoration-line: line-through;
margin-left: 5px;
}
.item-view-bottom-qian span:nth-child(2){
font-weight: bold;
font-size: 36.81rpx;
2024-07-25 19:36:32 +08:00
color: #FF1200;
2024-07-15 15:08:49 +08:00
}
2024-07-26 17:49:35 +08:00
.item-view-bottom-qian span:nth-child(1){
font-weight: 400;
font-size: 25rpx;
color: #FF1200;
}
.item-view-bottom-qian{
2024-07-30 14:17:50 +08:00
margin-top: 2px;
2024-07-26 17:49:35 +08:00
}
2024-07-15 15:08:49 +08:00
.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: #999;
margin:5px 0px;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2; /* 显示的行数,可以根据需要修改 */
overflow: hidden;
text-overflow: ellipsis;
}
.item-view-biao{
2024-07-23 17:04:31 +08:00
padding: 1px 8px;
border-radius: 10rpx 3rpx 10rpx 3rpx;
font-size: 22rpx;
margin-right: 10rpx;
2024-07-24 15:36:01 +08:00
height: 40rpx;
line-height: 40rpx;
2024-07-15 15:08:49 +08:00
}
.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;
2024-07-26 14:50:20 +08:00
color: #333333;
font-size: 30rpx;
2024-07-15 15:08:49 +08:00
}
.item-view-xiangmu span:nth-child(1){
font-weight: normal;
2024-07-26 14:50:20 +08:00
color: #666666;
2024-07-15 15:08:49 +08:00
margin-right: 5rpx;
2024-07-26 14:50:20 +08:00
font-size: 30rpx;
2024-07-15 15:08:49 +08:00
}
2024-07-23 17:04:31 +08:00
.shop_label{
2024-07-25 19:36:32 +08:00
display: flex;
flex-wrap: wrap;
2024-07-30 14:17:50 +08:00
margin-top: 4rpx;
2024-07-25 19:36:32 +08:00
}
.shop_label span{
background: linear-gradient(90deg, #ffefde, #fff7ef);
height: 34rpx;
line-height: 34rpx;
border-radius: 8rpx;
padding: 0 10rpx;
2024-07-23 17:04:31 +08:00
font-size: 22rpx;
2024-07-25 19:36:32 +08:00
margin-right: 8rpx;
margin-bottom: 8rpx;
color: #f68607;
2024-07-23 17:04:31 +08:00
}
2024-07-15 15:08:49 +08:00
.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;
2024-07-25 19:36:32 +08:00
font-size: 32rpx;
2024-07-15 15:08:49 +08:00
color: #333333;
overflow: hidden;
2024-07-25 19:36:32 +08:00
text-overflow: ellipsis;
white-space: nowrap;
2024-07-15 15:08:49 +08:00
}
.item-view{
2024-07-30 14:17:50 +08:00
width:60%;
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
justify-content: space-between;
padding:5rpx 0;
}
2024-07-26 17:49:35 +08:00
.item-img{
2024-07-30 14:17:50 +08:00
width: 240rpx;
height: 200rpx;
border-radius: 14rpx;
position: relative;
2024-07-26 17:49:35 +08:00
}
2024-07-15 15:08:49 +08:00
.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%;
border-radius: 14rpx;
}
.item {
2024-07-30 14:17:50 +08:00
width: 100%;
margin: 0 auto ;
2024-07-15 15:08:49 +08:00
display: flex;
flex-direction: row;
justify-content: space-between;
2024-07-30 14:17:50 +08:00
/*height: 140px;*/
2024-07-15 15:08:49 +08:00
background: #FFFFFF;
border-radius: 21rpx;
margin-top:10px;
align-items: center;
2024-07-30 14:17:50 +08:00
padding:20rpx;
2024-07-15 15:08:49 +08:00
}
2024-07-25 20:58:11 +08:00
2024-07-15 15:08:49 +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-07-15 15:08:49 +08:00
.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{
2024-07-30 14:17:50 +08:00
width: 95%;
2024-07-24 15:36:01 +08:00
margin: 0px auto 0px auto;
2024-07-15 15:08:49 +08:00
}
.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;
2024-07-30 14:17:50 +08:00
color: #019c88;
font-weight: bold;
2024-07-15 15:08:49 +08:00
position: absolute;
2024-07-30 14:17:50 +08:00
right:40rpx;
top: 20rpx;
font-size: 30rpx;
display: flex;
align-items: center;
2024-07-15 15:08:49 +08:00
}
/deep/.uni-searchbar__box-icon-search,.search-btn{
2024-07-22 17:38:48 +08:00
width: 110rpx;
height: 50rpx;
2024-07-15 15:08:49 +08:00
}
/deep/.uni-searchbar__box{
2024-07-30 14:17:50 +08:00
height:34px;
2024-07-22 17:38:48 +08:00
border-radius: 30px !important;
2024-07-15 15:08:49 +08:00
background-color: #fff !important;
2024-07-22 17:38:48 +08:00
border: 1px solid #09a28a;
2024-07-15 15:08:49 +08:00
display: flex;
flex-direction: row;
flex-flow: row-reverse;
position: relative;
}
/deep/.uni-searchbar{
2024-07-30 14:17:50 +08:00
width:250px;
2024-07-15 15:08:49 +08:00
border-radius: 31rpx;
2024-07-30 14:17:50 +08:00
padding-right: 24rpx;
2024-07-15 15:08:49 +08:00
}
2024-07-22 17:38:48 +08:00
.service-fh{
width: 20px;
height: 20rpx;
margin-right:5px;
margin-left: 10rpx;
}
.service-img{
2024-07-30 14:17:50 +08:00
width: 146rpx;
2024-07-24 11:31:38 +08:00
height: 38rpx;
2024-07-15 15:08:49 +08:00
}
.service-head-top-left span{
font-weight: bold;
font-size: 34rpx;
color: #171717;
}
.service-head-top-left{
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
}
.service-head-top{
2024-07-30 14:17:50 +08:00
height:90rpx;
2024-07-15 15:08:49 +08:00
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
}
.view-cata{
display: flex;
flex-direction: row;
2024-07-24 15:36:01 +08:00
justify-content: space-between;
2024-07-15 15:08:49 +08:00
}
</style>