优惠卷

This commit is contained in:
Mr.jiang 2024-07-12 13:51:45 +08:00
parent ae3e5a6f64
commit 0e1cca42ad
7 changed files with 136 additions and 112 deletions

View File

@ -38,9 +38,9 @@ export default {
props: {
switchList: {
type: Array,
default: ()=>{
return ['列表','地图'];
}
// default: ()=>{
// return ['',''];
// }
},
defaultSwitch:{ //
type:Boolean,

View File

@ -1,5 +1,5 @@
<template>
<view class="content-view">
<view>
<view class="flex align-center justify-between you-nav">
<view v-for="(item,index) in tab" :key="index" class="text-center box"
:class="tabIndex == index?'tanColor':''" @click="bindTab(item.state)">
@ -7,10 +7,10 @@
<view class="" :class="tabIndex == index?'line':''"></view>
</view>
</view>
<t-refresh ref="refresh" v-if="hongbao.length>0" @refresh="refresh" @loadMore="loadMore" :loadingType="loadingType" :tPadding="0">
<t-refresh style="height:100vh !important;" ref="refresh" v-if="hongbao.length>0" @refresh="refresh" @loadMore="loadMore" :loadingType="loadingType" :tPadding="0">
<template slot="content">
<checkbox-group @change="checkboxChange">
<view v-if="tabIndex == 0">
<view v-if="tabIndex == 0" style="margin-top: 40px;">
<view class="youhui-weiyong youhui-list" v-for="(item,index) in hongbao" :key="index">
<view class="youhui-view-left">
<view class="youhui-view-left-yuan">
@ -119,12 +119,15 @@
loadMore: async function() {
//loadingType: 0. 1. 2.
if(this.loadingType==0){
uni.showLoading({
title: '加载中...'
});
this.loadingType=2
//
setTimeout(()=>{
this.page++;
this.loadingType=0;
this.getData()
this.getMyList()
},1000)
}
},
@ -134,10 +137,7 @@
})
},
getMyList() {
this.loadingType = 1;
uni.showLoading({
title: '加载中...'
});
this.$Request.getT('/app/coupon/selectCouponUserList?page='+this.page+'&limit='+this.size+'&status=' + this.tabIndex).then(res => {
if (res.code == 0) {
if (this.page == 1) this.hongbao = []; //
@ -181,6 +181,19 @@
</script>
<style scoped>
/deep/.uni-scroll-view-content{
width: auto;
height: auto;
}
/deep/.refresh-body {
box-sizing: border-box;
padding-top: 0px !important;
margin-top: 0px;
overflow: scroll;
}
/deep/.refresh-body .content{
height: 100%;
}
.content-view{
height: 100vh;
width: 100%;

View File

@ -1,6 +1,6 @@
<template>
<view class="page-content">
<t-refresh ref="refresh" v-if="hongbao.length>0" @refresh="refresh" @loadMore="loadMore" :loadingType="loadingType" :tPadding="0">
<view>
<t-refresh ref="refresh" style="height:100vh !important;" v-if="hongbao.length>0" @refresh="refresh" @loadMore="loadMore" :loadingType="loadingType" :tPadding="0">
<template slot="content">
<checkbox-group @change="checkboxChange">
<view class="youhui-weiyong youhui-list" v-if="priceDd>=item.minMoney" v-for="(item,index) in hongbao" :key="index">
@ -22,7 +22,7 @@
</view>
</view>
<label class="tui-radio">
<checkbox activeBackgroundColor="#029d88" color="#029d88" :value="item.id.toString()" :checked="checkbox"/>
<checkbox style="border-radius:50%;" activeBackgroundColor="#029d88" color="#029d88" :value="item.id.toString()" :checked="checkbox"/>
</label>
</view>
</view>
@ -32,7 +32,7 @@
<view @tap="queding()" class="queding">
<span class="que-btn">确定</span>
</view>
<empty v-if="hongbao.length==0"></empty>
<empty v-if="hongbao.length==0"></empty>
</view>
</template>
@ -59,8 +59,8 @@
}],
tabIndex: 0,
hongbao: [],
page: 1,
size: 10,
page:1,
limit:10,
loadingType: 0,
scrollTop: false,
contentText: {
@ -80,13 +80,6 @@
}
this.getMyList();
},
onPageScroll: function(e) {
this.scrollTop = e.scrollTop > 200;
},
onReachBottom: function() {
this.page = this.page + 1;
this.getMyList('');
},
onPullDownRefresh: function() {
this.page = 1;
this.getMyList('Refresh');
@ -96,12 +89,15 @@
loadMore: async function() {
//loadingType: 0. 1. 2.
if(this.loadingType==0){
uni.showLoading({
title: '加载中...'
});
this.loadingType=2
//
setTimeout(()=>{
this.page++;
this.loadingType=0;
this.getData()
this.getMyList()
},1000)
}
},
@ -143,35 +139,22 @@
})
},
getMyList() {
this.loadingType = 1;
uni.showLoading({
title: '加载中...'
});
var data={
page:this.page,
limit:this.size,
limit:this.limit,
status:this.tabIndex,
minMoney:this.priceDd
}
this.$Request.getT('/app/coupon/selectUserCouponList',data).then(res => {
if (res.code == 0) {
if (this.page == 1) this.hongbao = []; //
this.hongbao = [...this.hongbao, ...res.data.list]; //
console.log("hongbao",this.hongbao)
// uni.stopPullDownRefresh()
// if (this.page == 1) {
// this.hongbao = [];
// }
// this.hongbao=res.data.list
// if (res.data.list.length === this.size) {
// this.loadingType = 0;
// } else {
// this.loadingType = 3;
// }
} else {
this.loadingType = 2;
if (res.data) {
if (this.page == 1) this.hongbao = []; //
this.hongbao = [...this.hongbao, ...res.data.list]; //
uni.stopPullDownRefresh()
uni.hideLoading();
}
}
uni.hideLoading();
});
},
bindTab(index) {
@ -186,16 +169,6 @@
</script>
<style scoped>
/deep/.page-box{
width: 100%;
}
.page-content{
width:100%;
position: relative;
display: flex;
flex-direction: column;
align-items: center;
}
.que-btn{
display: inline-block;
width: 90%;
@ -224,25 +197,47 @@
flex-direction: row;
align-items: center;
}
/deep/uni-checkbox .uni-checkbox-input{
/deep/uni-page-refresh{
display: none !important;
}
/deep/.uni-checkbox-input{
border-radius: 50%;
}
.ticket-button{
display: flex;
width: 130rpx;
grid-gap:8rpx;
gap:8px;
align-items: center;
justify-content:center;
background: #029d88;
color: #fff;
height:60rpx;
border-radius: 30rpx;
margin: 15rpx;
/deep/.uni-scroll-view-content{
width: auto;
height: auto;
}
.checkbox-data{
padding: 0px 11px;
margin: 15px 0px;
/deep/.refresh-body {
box-sizing: border-box;
padding-top: 0px !important;
margin-top: 0px;
overflow: scroll;
}
/deep/.refresh-body .content{
height: 100%;
}
.content-view{
height: 100vh;
width: 100%;
overflow: hidden;
}
.you-nav{
background: #FFFFFF;
padding: 14px 25px 0px 25px;
position: fixed;
top: 0;
width: 100%;
z-index: 66;
}
/deep/.refresh-body{
box-sizing: border-box;
height: 830px!important;
padding-top: 0px !important;
/* margin-top: 42px; */
}
/deep/.page-box{
width: 100%;
}
.youhui-img{
width: 111.81rpx;
@ -256,7 +251,7 @@
text-align: center;
line-height: 64rpx;
font-weight: 400;
font-size: 28rpx;
font-size: 26rpx;
color: #FFFFFF;
text-shadow: 0rpx 2rpx 4rpx rgba(0,119,104,0.44);
margin-left: 10px;
@ -267,14 +262,15 @@
color: #999999;
}
.youhui-view-right-title{
width: 260rpx;
font-weight: 400;
font-size: 32rpx;
font-size: 28rpx;
color: #333333;
}
.youhui-view-right-top{
width: 68%;
display: flex;
flex-direction: column;
align-items: center;
}
.youhui-view-right{
width: 502.08rpx;
@ -282,7 +278,7 @@
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-around;
justify-content: center;
}
.youhui-view-left-bottom{
font-weight: 400;
@ -318,12 +314,13 @@
background-image: url('../../static/youhuijuan/coupons1.png');
}
.youhui-list{
width: 95%;
display: flex;
flex-direction: row;
height: 242rpx;
border-radius: 21rpx;
background-size: 100%;
margin:6px 12px;
margin: 10px auto;
justify-content: space-between;
}
.you-nav{
@ -333,21 +330,21 @@
page {
background: #F5F5F5;
}
.bg {
background: #FFFFFF;
}
.box {
width: 128upx;
height: 60upx;
color: #666;
text-align: center;
font-weight: bold;
font-size: 34rpx;
font-weight: 500;
font-size: 30rpx;
z-index: 1;
}
.line {
width: 48px;
height: 14rpx;
@ -360,12 +357,12 @@
left: 50%;
transform: translateX(-50%);
}
.tanColor {
color: #019C88;
font-weight: bold;
}
.btn {
width: 140upx;
height: 55upx;

View File

@ -29,11 +29,9 @@
<image src="../../static/liliao-1.png" class="dingwei-img"></image>
<view class="localName">{{ city }}</view>
</view>
<uni-data-select
v-model="valueSelect"
:localdata="rangeSelect"
@change="changeSelect"
></uni-data-select>
<view class="flex align-center justify-between">
<selectSwitchDitu @change="switch1Change" :switchList="switchList"/>
</view>
<uni-search-bar @service="serviceTrue" @confirm="search" :cancelext="'取消'" v-model="searchValue" @input="input"
@clear="clear">
</uni-search-bar>
@ -281,22 +279,20 @@
import commonConfig from 'common/config.js';
import * as webMap from 'utils/webMap.js';
import selectSwitchDitu from "@/components/xuan-switch/xuan-switch-ditu.vue";
import permision from "@/components/permission.js";
//
// #ifdef APP-PLUS
// import permision from "@/components/permission.js";
// #endif
export default {
components:{selectSwitchDitu},
data() {
return {
switchList:['技师','项目'],
current: 0,
serviceTrue:true,
valueSelect: '技师',
changeSelectData:'',
rangeSelect: [
{ value: '技师', text: "技师" },
{ value: '项目', text: "项目" },
],
changeSelectData:'技师',
cityList: [],
Cityshow: false,
artificerName: '',
@ -540,6 +536,19 @@
// }
},
methods: {
switch1Change: function (e) {//
var num= Number(e)
if(e==false){
this.current = 1;
this.changeSelectData='项目';
uni.navigateTo({
url:'/pages/my/fuwuGengduo'
})
}else{
this.current = 0;
this.changeSelectData='技师';
}
},
searchBtn(){//
if(this.changeSelectData=='项目'){
uni.navigateTo({
@ -553,7 +562,6 @@
},
input(res) {//
this.searchValue=res;
},
changeSelect(e) {
this.changeSelectData=e
@ -962,17 +970,17 @@
this.$Request.get("/app/artificer/getHomeArtificerList",data).then(res => {
if (res.code == 0) {
this.starTechnician = res.startData.list;
for(var i=0;i<this.nearbyTechnician.length;i++){
const distance = this.calculateDistance(
this.latitude,
this.longitude,
this.nearbyTechnician[i].latitude,
this.nearbyTechnician[i].longitude
);
this.nearbyTechnician[i].dingwei= distance.toFixed(1)
console.log(`距离为: ${distance.toFixed(1)} km`);
}
console.log("starTechnician===>",this.nearbyTechnician)
// for(var i=0;i<this.starTechnician.length;i++){
// const distance = this.calculateDistance(
// this.latitude,
// this.longitude,
// this.starTechnician[i].latitude,
// this.starTechnician[i].longitude
// );
// this.starTechnician[i].dingwei= distance.toFixed(1)
// console.log(`: ${distance.toFixed(1)} km`);
// }
console.log("starTechnician===>",this.starTechnician)
// this.classifyId = res.data[0].id;
// this.getorderlist('')
}
@ -1368,7 +1376,7 @@
/deep/.uni-scroll-view-content{
display: flex;
flex-direction: row;
justify-content: space-around;
/* justify-content: space-around; */
}
.top-menu-view {
display: flex;

View File

@ -124,7 +124,11 @@
this.getName=e.name;
this.getText=e.text
this.myId = uni.getStorageSync('userId')
this.getData()
this.getData();
uni.setNavigationBarTitle({
title: this.getText,
})
},
onPullDownRefresh: function() {
this.page = 1;

View File

@ -98,7 +98,8 @@
var that=this;
that.dataList=e;
that.isVIP=this.$queue.getData('isVIP');
that.getData()
that.getData();
},
onShow() {
},

View File

@ -11,7 +11,7 @@
:show-action="true" :animation="true" bg-color="#f5f5f5" color="#1A1A1A" @search="onSearch()"
action-text="搜索" @custom="onSearch()"></u-search>
<view class="flex align-center justify-between">
<selectSwitchDitu @change="switch1Change" />
<selectSwitchDitu @change="switch1Change" :switchList="switchList"/>
</view>
</view>
</view>
@ -240,6 +240,7 @@ import permision from "@/components/permission.js";
},
data() {
return {
switchList:['列表','地图'],
artificerName: '',
tpSel: 0,
tpCount: 0,