sadjv2/anmo-shop/my/gird/shoucang.vue

450 lines
12 KiB
Vue

<template>
<view class="">
<view style="padding-top: 1rpx;" v-if="orderList.length">
<view class="flex align-center margin-bottom-sm bg padding-sm radius margin-sm"
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 style="width: 170upx;height: 170upx;border-radius: 10rpx;position: relative;">
<image :src="item.artificerImg?item.artificerImg: '../../static/logo.png'"
@click.stop="saveImgs(item.artificerImg)"
style="width: 170upx;height: 170upx;border-radius: 50%;" 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" style="width: 85%;">
<view class="flex align-center" style="justify-content: start;">
<view class="flex align-center" style="width: 120rpx;">
<view class="text-bold text-30 margin-right-xs" style="width: 100rpx;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">{{item.artificerName}}</view>
<!-- <image
src="https://admin.sjajk.com/file/uploadPath/2023/02/16/d45855dcf1e01210a4224a408225e8e0.png"
style="width: 40rpx;height:40rpx;">
</image> -->
</view>
<view class="" style="width: 150rpx;">
<view class="flex align-center" v-if="item.tripWay != 3" style="width: 150rpx;">
<image src="../../static/images/address.png" style="width: 24rpx;height: 24rpx;"></image>
<view style="color: #333333;margin-left: 8rpx;">{{item.distance}}</view>
</view>
</view>
<view class="kyy_view" v-if="item.state == 1">可服务</view>
<view class="kfw_view" v-else-if="item.state == 2">可预约</view>
<view class="byy_view" v-else>休息中</view>
</view>
<view class="flex" style="margin: 16rpx 0 6px 0;justify-content: start;">
<view class="flex align-center" style="width: 120rpx;">
<view v-if="item.ordersScore" class="margin-right-sm">
<image src="../../static/images/start.png" style="width: 24upx;height: 22upx;">
</image>
<text class="margin-left-xs" style="color: #FF1200;">{{item.ordersScore}}.0</text>
</view>
<!-- <view style="color: #999999;">已服务:{{item.ordersCount}}单</view> -->
</view>
<view class="flex align-center" style="width: 150rpx;">
<image src="../../static/images/pinglun.png" style="width: 24rpx;height: 24rpx;"></image>
<view style="margin-left: 10rpx;color: #999;font-size: 26rpx;">
{{item.commentCount ? item.commentCount : 0}}
</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 align-center" style="width: 260rpx;">
<image src="../../static/images/time.png" style="width: 26rpx;height: 26rpx;"></image>
<view class="zz_view" v-if="item.status == 1 && item.time">最早可约{{item.time}}</view>
</view>
<view class="flex" style="font-size: 24rpx;color: #f49650;font-weight: bold;" v-if="item.tripWay == 3">
免出行费
</view>
</view>
<view class="text-center text-sm" v-if="item.status == 1"
style="background: linear-gradient(to right, #223845, #00a85b);color: #ffffff;width: 100%;border-radius: 30upx;height: 60upx;line-height: 60upx;margin-top: 20rpx;"
@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");
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('获取地址失败')
}
})
},
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">
page {
background-color: #F7F7F7;
}
.zz_view {
color: #333333;
font-size: 24rpx;
padding: 6rpx 10rpx;
border-radius: 10rpx;
}
.zpmore_view {
position: absolute;
bottom: -20rpx;
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;
}
.byy_view {
background: #ebebeb;
width: 100upx;
text-align: center;
border-radius: 50rpx;
height: 40rpx;
line-height: 40rpx;
font-size: 24rpx;
color: #000000;
// border: 3upx solid #999999;
margin-top: 6rpx;
margin-left: 40rpx;
}
.kfw_view {
background: #ffaa00;
width: 100upx;
text-align: center;
border-radius: 50rpx;
height: 40rpx;
line-height: 40rpx;
font-size: 24rpx;
color: #FFFFFF;
margin-top: 6rpx;
margin-left: 40rpx;
}
.kyy_view {
background: #096f4b;
width: 100upx;
text-align: center;
border-radius: 50rpx;
height: 40rpx;
line-height: 40rpx;
font-size: 24rpx;
color: #FFFFFF;
margin-top: 6rpx;
margin-left: 40rpx;
}
.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>