优惠卷

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: { props: {
switchList: { switchList: {
type: Array, type: Array,
default: ()=>{ // default: ()=>{
return ['列表','地图']; // return ['',''];
} // }
}, },
defaultSwitch:{ // defaultSwitch:{ //
type:Boolean, type:Boolean,

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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