|
|
|
@ -1,12 +1,12 @@ |
|
|
|
|
<template> |
|
|
|
|
<view class="pages-home" v-if="isLoad"> |
|
|
|
|
<view class="map-info"> |
|
|
|
|
<view class="position" @tap.stop="toChooseLocation" > |
|
|
|
|
<!-- <view class="position" @tap.stop="toChooseLocation" > |
|
|
|
|
<i class="iconfont iconjuli mr-sm"></i> |
|
|
|
|
<view class="map-text max-400 ellipsis"> |
|
|
|
|
{{location&&location.province ?location.province : isLoad ? '定位失败' : '定位中...'}} |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> --> |
|
|
|
|
<view class="input" @click="goSearch"> |
|
|
|
|
<u--input |
|
|
|
|
placeholder="查找技师或服务" |
|
|
|
@ -26,8 +26,19 @@ |
|
|
|
|
</banner> |
|
|
|
|
<view class="tab"> |
|
|
|
|
<view class="tabItem" v-for="(item,index) in gridList" :key="index" @click="getItemHandle(item)"> |
|
|
|
|
<image :src="item.img" mode=""></image> |
|
|
|
|
<view class="text">{{item.name}}</view> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<auth :needAuth="userInfo && (!userInfo.phone || !userInfo.nickName)" :must="true" |
|
|
|
|
:type="!userInfo.phone ? 'phone' : 'userInfo'" @go="toAtv" v-if="item.name=='邀请有礼'"> |
|
|
|
|
<view> |
|
|
|
|
<image :src="item.img" mode=""></image> |
|
|
|
|
<view class="text">{{item.name}}</view> |
|
|
|
|
</view> |
|
|
|
|
</auth> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<image :src="item.img" mode="" v-if="item.name!='邀请有礼'"></image> |
|
|
|
|
<view class="text" v-if="item.name!='邀请有礼'">{{item.name}}</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="gridContainer"> |
|
|
|
@ -35,7 +46,23 @@ |
|
|
|
|
<image src="../static/titleicon.png" mode=""></image> |
|
|
|
|
<text>推荐技师</text> |
|
|
|
|
</view> |
|
|
|
|
<u-scroll-list :indicator="false"> |
|
|
|
|
<swiper class="swiper" circular :indicator-dots="false" :autoplay="true" :interval="2000" |
|
|
|
|
:duration="1000" previous-margin="112px" next-margin="112px"> |
|
|
|
|
|
|
|
|
|
<swiper-item class="recommendItem" v-for="(item, index) in picList" :key="index"> |
|
|
|
|
<image :src="item.work_img"></image> |
|
|
|
|
<view class="flag new" v-if="item.coach_type_status==3">新人</view> |
|
|
|
|
<view class="flag people" v-if="item.coach_type_status==2">推荐</view> |
|
|
|
|
<view class="flag people" v-if="item.coach_type_status==1">销冠</view> |
|
|
|
|
</swiper-item> |
|
|
|
|
<!-- <swiper-item> |
|
|
|
|
<view class="swiper-item uni-bg-green">B</view> |
|
|
|
|
</swiper-item> |
|
|
|
|
<swiper-item> |
|
|
|
|
<view class="swiper-item uni-bg-blue">C</view> |
|
|
|
|
</swiper-item> --> |
|
|
|
|
</swiper> |
|
|
|
|
<!-- <u-scroll-list :indicator="false"> |
|
|
|
|
<view class="recommendItem" v-for="(item, index) in picList" :key="index"> |
|
|
|
|
<image :src="item.work_img"></image> |
|
|
|
|
<view class="flag new" v-if="item.coach_type_status==3">新人</view> |
|
|
|
@ -43,7 +70,7 @@ |
|
|
|
|
<view class="flag people" v-if="item.coach_type_status==1">销冠</view> |
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
</u-scroll-list> |
|
|
|
|
</u-scroll-list> --> |
|
|
|
|
</view> |
|
|
|
|
<!-- <view class="search-box flex-center fill-base ml-md mr-md radius" |
|
|
|
|
:class="[{'mt-md':banner.length ==0}]"> |
|
|
|
@ -182,7 +209,7 @@ |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
computed: mapState({ |
|
|
|
|
location: state => state.user.location, |
|
|
|
|
// location: state => state.user.location, |
|
|
|
|
pageActive: state => state.service.pageActive, |
|
|
|
|
activeIndex: state => state.service.activeIndex, |
|
|
|
|
tabList: state => state.service.tabList, |
|
|
|
@ -194,6 +221,7 @@ |
|
|
|
|
configInfo: state => state.config.configInfo, |
|
|
|
|
autograph: state => state.user.autograph, |
|
|
|
|
userInfo: state => state.user.userInfo, |
|
|
|
|
mineInfo: state => state.user.mineInfo, |
|
|
|
|
}), |
|
|
|
|
async onLoad(options) { |
|
|
|
|
this.getRecommend() |
|
|
|
@ -214,6 +242,8 @@ |
|
|
|
|
key: 'pageActive', |
|
|
|
|
val: true |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
onPullDownRefresh() { |
|
|
|
|
// #ifndef APP-PLUS |
|
|
|
@ -241,7 +271,21 @@ |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
...mapActions(['getConfigInfo', 'getUserInfo', 'updateCommonOptions', 'getServiceIndex', 'getServiceList']), |
|
|
|
|
...mapMutations(['updateServiceItem']), |
|
|
|
|
...mapMutations(['updateServiceItem','updateUserItem']), |
|
|
|
|
async toAtv() { |
|
|
|
|
if (!this.mineInfo.is_atv) { |
|
|
|
|
this.$util.showToast({ |
|
|
|
|
title: `暂无活动` |
|
|
|
|
}) |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
let options = this.commonOptions |
|
|
|
|
options.coupon_atv_id = 0 |
|
|
|
|
await this.updateCommonOptions(options) |
|
|
|
|
this.$util.goUrl({ |
|
|
|
|
url: `/user/pages/coupon/share` |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
async initIndex(refresh = false) { |
|
|
|
|
// #ifdef H5 |
|
|
|
|
if (!refresh && this.$jweixin.isWechat()) { |
|
|
|
@ -264,19 +308,46 @@ |
|
|
|
|
let res = await this.$api.service.serviceCoachList({ |
|
|
|
|
sort_field:'distance', |
|
|
|
|
sort_order:'asc', |
|
|
|
|
limit:5 |
|
|
|
|
limit:10 |
|
|
|
|
}) |
|
|
|
|
console.log(res,"ooo") |
|
|
|
|
this.picList = res.data |
|
|
|
|
let arr = res.data |
|
|
|
|
if(this.picList.length<3){ |
|
|
|
|
this.picList.push(...arr) |
|
|
|
|
}else{ |
|
|
|
|
this.picList = res.data |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
getItemHandle(item){ |
|
|
|
|
console.log(item,) |
|
|
|
|
console.log(item,this.configInfo) |
|
|
|
|
if(item.name=="领券中心"){ |
|
|
|
|
this.$util.goUrl({ |
|
|
|
|
url: '/user/pages/coupon/list' |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
if(item.name=="联系客服"){ |
|
|
|
|
let { |
|
|
|
|
mobile: url, |
|
|
|
|
im_type |
|
|
|
|
} = this.configInfo |
|
|
|
|
// #ifdef MP-WEIXIN |
|
|
|
|
if (im_type == 2) return |
|
|
|
|
// #endif |
|
|
|
|
this.$util.goUrl({ |
|
|
|
|
url:'18688888888', |
|
|
|
|
openType: 'call' |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
if(item.name=="技师招募"){ |
|
|
|
|
uni.navigateTo({ |
|
|
|
|
url:"/user/pages/gonggao/item?id=2" |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
initRefresh() { |
|
|
|
|
this.isLoadBanner = false |
|
|
|
@ -387,34 +458,34 @@ |
|
|
|
|
url |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
async toChooseLocation(e) { |
|
|
|
|
await this.$util.checkAuth({ |
|
|
|
|
type: 'userLocation' |
|
|
|
|
}) |
|
|
|
|
let [, { |
|
|
|
|
address = '', |
|
|
|
|
longitude: lng, |
|
|
|
|
latitude: lat, |
|
|
|
|
province = '', |
|
|
|
|
city = '', |
|
|
|
|
district = '', |
|
|
|
|
}] = await uni.chooseLocation(); |
|
|
|
|
if (!lng) return |
|
|
|
|
let location = { |
|
|
|
|
lng, |
|
|
|
|
lat, |
|
|
|
|
address, |
|
|
|
|
province, |
|
|
|
|
city, |
|
|
|
|
district |
|
|
|
|
} |
|
|
|
|
this.updateUserItem({ |
|
|
|
|
key: 'location', |
|
|
|
|
val: location |
|
|
|
|
}) |
|
|
|
|
this.param.page = 1 |
|
|
|
|
this.getList() |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
// async toChooseLocation(e) { |
|
|
|
|
// await this.$util.checkAuth({ |
|
|
|
|
// type: 'userLocation' |
|
|
|
|
// }) |
|
|
|
|
// let [, { |
|
|
|
|
// address = '', |
|
|
|
|
// longitude: lng, |
|
|
|
|
// latitude: lat, |
|
|
|
|
// province = '', |
|
|
|
|
// city = '', |
|
|
|
|
// district = '', |
|
|
|
|
// }] = await uni.chooseLocation(); |
|
|
|
|
// if (!lng) return |
|
|
|
|
// let location = { |
|
|
|
|
// lng, |
|
|
|
|
// lat, |
|
|
|
|
// address, |
|
|
|
|
// province, |
|
|
|
|
// city, |
|
|
|
|
// district |
|
|
|
|
// } |
|
|
|
|
// this.updateUserItem({ |
|
|
|
|
// key: 'location', |
|
|
|
|
// val: location |
|
|
|
|
// }) |
|
|
|
|
|
|
|
|
|
// }, |
|
|
|
|
goSearch(){ |
|
|
|
|
|
|
|
|
|
this.$util.goUrl({ |
|
|
|
@ -464,7 +535,7 @@ |
|
|
|
|
border-radius: 30rpx 30rpx 0rpx 0rpx; |
|
|
|
|
margin-top: -58rpx; |
|
|
|
|
position: relative; |
|
|
|
|
z-index: 999; |
|
|
|
|
z-index: 99; |
|
|
|
|
display:flex; |
|
|
|
|
align-items: center; |
|
|
|
|
justify-content: space-between; |
|
|
|
@ -506,7 +577,7 @@ |
|
|
|
|
.recommendItem{ |
|
|
|
|
// width:240rpx; |
|
|
|
|
// height:300rpx; |
|
|
|
|
background: #aaaaaa; |
|
|
|
|
// background: #aaaaaa; |
|
|
|
|
border-radius: 27rpx; |
|
|
|
|
// overflow: hidden; |
|
|
|
|
margin-right:24rpx; |
|
|
|
|