sadjv3_user/my/gird/shoucang.vue

542 lines
13 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<view class="content">
<view style="padding-top: 1rpx;" v-if="orderList.length">
<view class="flex align-center margin-bottom-sm bg margin-sm content-list"
v-for="(item,index) in orderList" :key='index' @click="goOrderDetail(item)"
style="box-shadow: 6rpx 10rpx 4px #F5F5F5;position: relative;">
<view style="position: absolute;z-index: 99;top: 0rpx;left: 0;" v-if="item.isGoods == 1">
<image src="https://admin.sjajk.com/file/uploadPath/2023/02/16/c551f3f0721aec54208011e6948a57cd.png"
style="width: 42rpx;height: 36rpx;"></image>
</view>
<view class="content-img">
<image :src="item.artificerImg?item.artificerImg: '../../static/logo.png'"
@click.stop="saveImgs(item.artificerImg)"
mode="aspectFill"></image>
<image v-if="item.isHot == 1"
src="https://admin.sjajk.com/file/uploadPath/2023/02/16/9ae1b7e9fa931b5fc24cd8edecc10d9f.png"
style="width: 30rpx;height: 36rpx;position: absolute;z-index: 99;top: 40rpx;left: 110rpx;">
</image>
<view class="zpmore_view" v-if="item.lifePhoto" @click.stop="saveImgss(item.lifePhoto,0)">更多照片</view>
</view>
<view class="margin-left flex flex-direction list-right-content" style="width: 85%;">
<view class="flex align-center" style="justify-content: space-between;">
<view class="flex align-center">
<view class="text-bold text-30 margin-right-xs" style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">
{{item.artificerName}}
</view>
<image class="dituzhaoren" src="../../static/dituzhaoren2.png" mode=""></image>
</view>
<view class="shou-top">
<view class="shou-top-btn" :class="[item.state == 1 || item.state == 2?'kfw_view':'byy_view']">
{{item.state == 1?'可服务':item.state == 2?'可预约':'休息中'}}
</view>
<view class="zz_view" v-if="item.status == 1 && item.time">
{{item.time}}
</view>
</view>
</view>
<view class="list-right-top-bottom">
正规绿色服务!擅长精油SPA、中式推拿有按摩师证手法专业期待正规绿色服务!擅长精油SPA、中式推拿正规绿色服务!擅长精油SPA、中式推拿
</view>
<view class="flex" style="margin: 16rpx 0 6px 0;justify-content: start;">
<view class="flex align-center">
<view class="flex align-center margin-right-sm">
<view>
<image class="pinglun" src="../../static/dituzhaoren3.png" mode="">
</image>
<span class="icon-text">评论</span>
</view>
<!-- <image src="../../static/images/pinglun.png" style="width: 24rpx;height: 24rpx;"></image> -->
<view style="margin-left: 10rpx;color: #222;font-size: 23rpx;">
22222{{item.commentCount ? item.commentCount : 0}}
</view>
</view>
<view v-if="item.ordersScore" class="flex align-center">
<view>
<image class="shouc-img" src="../../static/dituzhaoren4.png" mode="">
</image>
<span class="icon-text">收藏</span>
</view>
<text class="margin-left-xs" style="color: #222;">11111{{item.ordersScore}}.0</text>
</view>
<!-- <view style="color: #999999;">已服务:{{item.ordersCount}}单</view> -->
</view>
<!-- <view class="flex align-center">
<image src="../../static/images/aixin2.png" style="width: 24rpx;height: 24rpx;margin-left: 40rpx;"></image>
<view style="margin-left: 10rpx;color: #999;font-size: 26rpx;">
{{item.collectCount ? item.collectCount : 0}}
</view>
</view> -->
</view>
<!-- <view style="width: 100%;display: flex;justify-content: start;align-items: center;">
<view class="flex flex-wrap align-center" style="width: 120rpx;">
<image src="../../static/images/shangjia.png" style="width: 24rpx;height: 24rpx;"></image>
<view style="margin-left: 10rpx;color: #999;font-size: 26rpx;">商家</view>
</view>
<view class="flex" style="font-size: 24rpx;color: #f49650;font-weight: bold;" v-if="item.tripWay == 3">
免出行费
</view>
</view> -->
<view class="therapist-mian-bottom">
<view class="flex flex-wrap align-center">
<image class="therapist-bottom-img" src="../../static/dituzhaoren5.png">
</image>
<view class="therapist-mian-bottom-text">春城有约</view>
</view>
<view class="flex align-center" v-if="item.tripWay != 3" >
<image class="therapist-bottom-dingwei" src="../../static/dituzhaoren6.png"></image>
<view class="therapist-bottom-dingwei-text">
{{ item.distance }}
</view>
</view>
</view>
<view class="text-center text-sm" v-if="item.status == 1"
style="background: linear-gradient(90deg, #019C88, #0FA78B, #35C495);color: #ffffff;width: 100%;border-radius: 30upx;height: 60upx;line-height: 60upx;margin-top: 10rpx;"
@click.stop="goOrderDetail(item)">
立即预约
</view>
<view class="text-center text-sm" v-else
style="background: #d9d9d9;color: #ffffff;width: 100%;border-radius: 30upx;height: 60upx;line-height: 60upx;margin-top: 20rpx;">
立即预约
</view>
</view>
</view>
</view>
<empty v-if="orderList.length == 0"></empty>
<!-- <u-skeleton :loading="loading" :animation="true" elColor='#FFFFFF' bgColor='#FFFFFF'></u-skeleton> -->
</view>
</template>
<script>
import empty from '@/components/empty.vue'
export default {
components: {
empty,
},
data() {
return {
loading: true, // 是否显示骨架屏组件
game: [],
orderList: [],
isVip: false,
myId: uni.getStorageSync('userId') ? uni.getStorageSync('userId') : '',
showModal: true,
arr: [],
tab: '',
massageTypeId: '',
page: 1,
limit: 10,
latitude: '',
XCXIsSelect:'否',
longitude: ''
}
},
onLoad(e) {
let that = this
that.XCXIsSelect = this.$queue.getData("XCXIsSelect");
console.log("shouchang",that.XCXIsSelect)
uni.getLocation({
type: 'gcj02',
geocode: true, //设置该参数为true可直接获取经纬度及城市信息
success: function(res) {
console.log(res, '地理位置')
that.latitude = res.latitude
that.longitude = res.longitude
// uni.setStorageSync('latitude', res.latitude)
// uni.setStorageSync('longitude', res.longitude)
that.getData(that.latitude, that.longitude)
},
fail: function() {
console.log('获取地址失败')
}
})
that.getData(139.2222,46.3333)
},
onShow() {
if(this.latitude && this.longitude){
this.getData(this.latitude, this.longitude)
}
},
methods: {
saveImgss(imgs, index) {
console.log(imgs, index)
// let that = this
let imgArr = imgs
// this.imgArr.push(imgs);
// console.log(this.imgArr)
// //预览图片
uni.previewImage({
urls: imgArr,
current: imgArr[index]
});
},
saveImgs(imgs) {
let imgArr = [];
imgArr.push(imgs);
// //预览图片
uni.previewImage({
urls: imgArr,
current: 0
});
},
getData(latitude, longitude) {
let data = {
page: this.page,
limit: this.limit,
latitude: latitude,
longitude: longitude,
}
this.$Request.get("/app/artificer/selectCollectList", data).then(res => {
this.loading = false;
if (res.code == 0) {
for (var i = 0; i < res.data.list.length; i++) {
if (res.data.list[i].distance > 1000) {
res.data.list[i].distance = (res.data.list[i].distance / 1000).toFixed(1) +
'km'
} else {
res.data.list[i].distance = (res.data.list[i].distance).toFixed(1) + 'm'
}
if (res.data.list[i].lifePhoto) {
res.data.list[i].lifePhoto = res.data.list[i].lifePhoto.split(',')
}
}
if (this.page == 1) {
this.orderList = res.data.list
} else {
this.orderList = [...this.orderList, ...res.data.list]
}
}
}).catch(() => {
//联网失败, 结束加载
// this.mescroll.endErr();
});
},
// 跳转订单
goOrder(e) {
let token = this.$queue.getData('token');
if (token) {
uni.navigateTo({
url: "/pages/index/order/orderDet?artificerId=" + e.artificerId + '&massageTypeId=' + this
.massageTypeId
})
} else {
uni.navigateTo({
url: '/pages/public/login'
});
}
},
goOrderDetail(e) {
uni.navigateTo({
url: "/pages/therapist/orderDetail?artificerId=" + e.artificerId + '&massageTypeId=' + this
.massageTypeId
})
}
},
onReachBottom: function() {
this.page = this.page + 1;
this.getData(this.latitude, this.longitude)
},
onPullDownRefresh: function() {
this.page = 1;
this.getData(this.latitude, this.longitude)
setTimeout(d => {
uni.stopPullDownRefresh();
}, 3000);
},
}
</script>
<style lang="scss">
.icon-text{
margin-left: 2px;
font-weight: 400;
font-size: 23rpx;
color: #666;
}
.pinglun{
width: 23rpx;
height: 23rpx;
}
.shouc-img{
width: 26rpx;
height: 26rpx;
}
.list-right-top-bottom{
width: 100%;
text-align: left;
font-weight: 400;
font-size: 26rpx;
color: #999;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2; /* 显示的行数可以根据需要修改 */
overflow: hidden;
text-overflow: ellipsis;
margin-top: 5px;
}
.list-right-content{
padding-right:20rpx;
}
.therapist-bottom-dingwei-text{
font-size: 23rpx;
color: #666;
}
.therapist-bottom-dingwei{
width: 17.36rpx;
height: 20.14rpx;
margin-right:3px;
}
.therapist-bottom-img{
width: 22.22rpx;
height: 22.22rpx;
margin-right:3px;
}
.therapist-mian-bottom-text{
font-weight: bold;
font-size: 23rpx;
color: #222222;
}
.therapist-mian-bottom{
width: 100%;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
}
.zz_view {
color: #039E89;
font-size: 22rpx;
padding: 0px 3px;
background: #EBEBEB;
height: 38rpx;
line-height: 38rpx;
text-align: center;
border-top-right-radius: 7rpx;
border-bottom-right-radius: 7rpx;
}
.shou-top-btn{
height: 38rpx;
line-height: 38rpx;
text-align: center;
padding: 0px 5px;
border-top-left-radius: 10rpx;
border-bottom-left-radius: 10rpx;
}
.byy_view {
color: #000000;
background-color: #ebebeb;
}
.kfw_view {
background: linear-gradient(90deg, #029d88, #1eb28f);
color: #FFFFFF;
font-size: 20rpx;
}
.shou-top{
display: flex;
flex-direction: row;
align-items: center;
}
.dituzhaoren{
width: 145.75rpx;
height: 40.97rpx;
}
.content-list{
height: 307rpx;
border-radius: 14rpx;
}
.content-img image{
width: 100%;
height: 100%;
border-radius:17rpx 100rpx 30rpx 17rpx;
}
.content-img{
width: 212.08rpx;
height: 100%;
position: relative;
}
.content {
width: 100%;
height: 100vh;
background-color: #F7F7F7;
}
.zpmore_view {
position: absolute;
bottom: 0px;
margin-bottom: 4px;
left: 14rpx;
color: #f9f3d3;
background: linear-gradient(to right, #0a0c16, #4d4d53);
width: 130upx;
text-align: center;
border-radius: 30rpx;
height: 42rpx;
line-height: 42rpx;
font-size: 24rpx;
margin-left: 10rpx;
}
.bg {
background: #FFFFFF;
}
.ytp_view {
background: #e3e3e3;
width: 400rpx;
border-radius: 10rpx;
font-size: 28rpx;
text-align: center;
height: 80rpx;
line-height: 80rpx;
color: #848484;
margin-top: 40rpx;
}
.tp_view {
background: #ee6c54;
width: 400rpx;
border-radius: 10rpx;
font-size: 28rpx;
text-align: center;
height: 80rpx;
line-height: 80rpx;
color: #FFFFFF;
margin-top: 40rpx;
}
.sticky-tabs {
z-index: 990;
position: sticky;
top: var(--window-top);
// background-color: #fff;
}
/* // 使用mescroll-uni,则top为0 */
.mescroll-uni,
/deep/.mescroll-uni {
.sticky-tabs {
top: 0;
}
}
.demo-tip {
padding: 18upx;
font-size: 24upx;
text-align: center;
}
.line_s {
display: inline-flex;
width: 10rpx;
height: 10rpx;
background: #1AD566;
border-radius: 50%;
margin-right: 10rpx;
}
.line_x {
display: inline-flex;
width: 10rpx;
height: 10rpx;
background: #000000;
border-radius: 50%;
margin-right: 10rpx;
}
.box {
// border: 3rpx solid #005dff;
background: #E8FAE1;
color: #096f4b;
padding: 5rpx 15rpx;
font-size: 26rpx;
letter-spacing: 2rpx;
border-radius: 8rpx;
// margin-top: 10rpx;
margin-right: 8upx;
}
.actve {
font-size: 30rpx;
font-family: PingFang SC;
font-weight: 800;
color: #20C675;
}
.tabview1 {
padding: 20rpx 20rpx;
// width: 686upx;
// height: 100upx;
background: #FFFFFF;
// margin-top: -50upx;
// z-index: 99;
// display: flex;
// line-height: 100upx;
.tabview {
// width: 686upx;
// // height: 100upx;
background: #F2FFF9;
border-radius: 24rpx 24rpx 0 0;
// margin-top: -50upx;
// z-index: 99;
display: flex;
line-height: 100upx;
.tabItem_sel {
font-size: 30upx;
font-family: PingFang SC;
font-weight: 800;
color: #20C675;
flex: 1;
text-align: center;
}
.tabItem {
font-size: 26upx;
font-family: PingFang SC;
font-weight: 500;
color: #333333;
flex: 1;
text-align: center;
}
}
.tabsx {
width: 686upx;
border-radius: 24rpx;
padding-bottom: 10rpx;
display: flex;
align-items: center;
justify-content: space-between;
padding: 20rpx 30rpx;
font-size: 26rpx;
.active {
color: #20C675;
font-size: 30rpx;
font-weight: bold;
}
}
}
</style>