|
@@ -15,32 +15,40 @@
|
|
|
<view class="location-text">富力中心A7</view>
|
|
|
<zzx-icon name="right" size="10"></zzx-icon>
|
|
|
</view>
|
|
|
- <view class="content" style="padding-top:180rpx;" @click="gotoPage('/pages/index/search/index')">
|
|
|
+ <view class="content" style="padding-top:180rpx;">
|
|
|
<view class="header-search">
|
|
|
<zzx-icon name="search" size="16"></zzx-icon>
|
|
|
- <input type="text" placeholder="搜索俱乐部名称" />
|
|
|
- <view class="search-btn">
|
|
|
+ <swiper class="i-search-swiper" :vertical="true" :circular="true" :autoplay="true" :interval="5000" :duration="1000" @click="gotoPage('/pages/index/search/index')" @change="transitionChange">
|
|
|
+ <swiper-item v-for="(item,index) in searchList" :key="item.id">
|
|
|
+ <view class="">{{item.searchContent}}</view>
|
|
|
+ </swiper-item>
|
|
|
+ </swiper>
|
|
|
+ <!-- <input type="text" placeholder="搜索俱乐部名称" /> -->
|
|
|
+ <view class="search-btn" @click="searchInfoBtn">
|
|
|
搜索
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="header-banner">
|
|
|
+ <view style="height: 200rpx;line-height: 200rpx;" v-if="indexLoading">
|
|
|
+ <zs-loading></zs-loading>
|
|
|
+ </view>
|
|
|
<swiper class="header-swiper" :autoplay="true" :current="currentIndex" :circular="true"
|
|
|
previous-margin="80rpx" next-margin="80rpx" :interval="4000" :duration="500" @change="swierChange">
|
|
|
<swiper-item v-for="(item,i) in bannerList" :key="i">
|
|
|
- <image :src="item.img" class="slide-image" :class="currentIndex === i?'active':''"></image>
|
|
|
+ <image :src="item.imageUrl" class="slide-image" :class="currentIndex === i?'active':''"></image>
|
|
|
</swiper-item>
|
|
|
</swiper>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="content">
|
|
|
- <view class="announcement" @click="gotoPage('/pages/index/messageNotice/index')">
|
|
|
+ <view class="announcement" @click="gotoPage('/pages/index/messageNotice/index')" v-if="indexMsg.length>0">
|
|
|
<image src="/src/static/gg-icon.png" mode="heightFix"></image>
|
|
|
<view class="">
|
|
|
<swiper class="announcement-swiper" :vertical="true" :circular="true" :autoplay="true" :interval="3000"
|
|
|
:duration="1000">
|
|
|
- <swiper-item v-for="item in 3">
|
|
|
- <view class="swiper-item textHidden">学校为公益场地,请严格遵守相关规范!</view>
|
|
|
+ <swiper-item v-for="(item,index) in indexMsg" :key="item.id">
|
|
|
+ <view class="swiper-item textHidden">{{item.titile}}</view>
|
|
|
</swiper-item>
|
|
|
</swiper>
|
|
|
</view>
|
|
@@ -66,7 +74,8 @@
|
|
|
<view class="item-text">赛事</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="course-card">
|
|
|
+ <zs-loading v-if="indexLoading"></zs-loading>
|
|
|
+ <view class="course-card" v-else>
|
|
|
<view class="commonweal" @click="gotoPage('/pages/index/training/index')">
|
|
|
<view class="commonweal-title">
|
|
|
<view class="title-left">
|
|
@@ -76,10 +85,8 @@
|
|
|
<zzx-icon name="right" size="14"></zzx-icon>
|
|
|
</view>
|
|
|
<view class="commonweal-detail">
|
|
|
- <view class="detail-list" v-for="item in 3">
|
|
|
- <image
|
|
|
- src="https://bpic.588ku.com/element_origin_min_pic/23/07/11/d32dabe266d10da8b21bd640a2e9b611.jpg!r650">
|
|
|
- </image>
|
|
|
+ <view class="detail-list" v-for="item in gyCourseList" :key="item.id">
|
|
|
+ <image :src="item.cover"></image>
|
|
|
<view class="detail-text">免费</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -93,14 +100,14 @@
|
|
|
<zzx-icon name="whiteRight" size="14"></zzx-icon>
|
|
|
</view>
|
|
|
<view class="audition-detail">
|
|
|
- <view class="detail-list" v-for="item in 3">
|
|
|
- <image src="@/static/index_bg.png"></image>
|
|
|
- <view class="detail-text">¥25</view>
|
|
|
+ <view class="detail-list" v-for="item in stCourseList" :key="item.id">
|
|
|
+ <image :src="item.cover"></image>
|
|
|
+ <view class="detail-text">¥{{item.sellingPrice||'0'}}</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="hot-instructor">
|
|
|
+ <view class="hot-instructor" v-if="!indexLoading">
|
|
|
<view class="i-title">
|
|
|
<view class="i-hot">
|
|
|
<view class="i-text">
|
|
@@ -116,26 +123,25 @@
|
|
|
<view class="i-info-card">
|
|
|
<view class="i-card-list"
|
|
|
:style="{background:index % 2=== 0?'linear-gradient(179deg, #FFD5FB 0%, #FFFFFF 40%)':'linear-gradient( 179deg, #F2FFBE 0%, #FFFFFF 40%)'}"
|
|
|
- v-for="(item,index) in 6">
|
|
|
+ v-for="(item,index) in instructorList" :key="item.id">
|
|
|
<view class="i-info" @click="gotoPage('/pages/index/instructorDetail/index')">
|
|
|
<view class="header" :style="{background:index % 2=== 0?'#FFB8F9':'#C8FF0C'}">
|
|
|
- <image class="head-img" src="https://img.keaitupian.cn/newupload/08/1629449018344288.jpg"
|
|
|
- mode=""></image>
|
|
|
+ <image class="head-img" :src="item.avatar" mode=""></image>
|
|
|
<image class="head-tag" src="/src/static/badge.png" mode=""></image>
|
|
|
</view>
|
|
|
<view class="i-name-tag">
|
|
|
<view class="name-tag">
|
|
|
<view class="name">
|
|
|
<view class="">
|
|
|
- <text>张慕斯</text>
|
|
|
+ <text>{{item.name}}</text>
|
|
|
</view>
|
|
|
<image v-if="index % 2=== 0" src="/src/static/name_bg.png" mode=""></image>
|
|
|
<image v-else src="/src/static/name_bg1.png" mode=""></image>
|
|
|
</view>
|
|
|
- <view class="tag">篮球</view>
|
|
|
+ <view class="tag" v-for="(tag,index) in item.list">{{tag}}</view>
|
|
|
</view>
|
|
|
- <view class="ascription">贵州成人篮球俱乐部</view>
|
|
|
- <view class="sign">教育就是看到美并将其无限放大</view>
|
|
|
+ <view class="ascription">{{item.orgName}}</view>
|
|
|
+ <view class="sign">{{item.teachingPhilosophy}}</view>
|
|
|
</view>
|
|
|
<view class="type-icon">
|
|
|
<image src="/src/static/hot-icon2.png" mode=""></image>
|
|
@@ -144,27 +150,24 @@
|
|
|
<view class="i-data">
|
|
|
<view class="acclaim">
|
|
|
<zzx-icon name="acclaim"></zzx-icon>
|
|
|
- <view style="color: #FFCC00;">好评 99%</view>
|
|
|
+ <view style="color: #FFCC00;">好评 {{item.goodRate}}%</view>
|
|
|
</view>
|
|
|
<view class="acclaim">
|
|
|
<zzx-icon name="order"></zzx-icon>
|
|
|
- <view style="color: #4DDF96;">订单数 5577</view>
|
|
|
+ <view style="color: #4DDF96;">订单数 {{item.orderCount||'0'}}</view>
|
|
|
</view>
|
|
|
<view class="acclaim">
|
|
|
<zzx-icon name="number"></zzx-icon>
|
|
|
- <view style="color: #AB7BFF;">授课人数 8659</view>
|
|
|
+ <view style="color: #AB7BFF;">授课人数 {{item.teachingCount}}</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="i-skill">
|
|
|
- 擅长:体能、篮球、其他运动培训。体能、篮球、其他运
|
|
|
- 动培训。体能、篮球、其他运动培训。
|
|
|
- </view>
|
|
|
- <view class="i-course" v-for="item in 2">
|
|
|
+ <view class="i-skill">{{item.excelMsg}}</view>
|
|
|
+ <view class="i-course" v-for="(course,index) in item.courseList" :key="course.id">
|
|
|
<view class="course-name">
|
|
|
- <view class="price">¥296</view>
|
|
|
- <view class="name textHidden">室内小班篮球培训课时室内小班篮球培训课时</view>
|
|
|
+ <view class="price">¥{{(course.sellingPrice).toFixed(2)||'0.00'}}</view>
|
|
|
+ <view class="name textHidden">{{course.name}}</view>
|
|
|
</view>
|
|
|
- <view class="num">已售9999</view>
|
|
|
+ <view class="num">已售{{item.count||'0'}}</view>
|
|
|
</view>
|
|
|
<view class="more">更多课程</view>
|
|
|
</view>
|
|
@@ -179,6 +182,7 @@
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
import zzxNavbar from '@/components/zzx-navbar/zzx-navbar.vue';
|
|
|
+ import zsLoading from '@/components/zzx-loading/zzx-loading.vue'
|
|
|
import { ref, onMounted, computed } from 'vue'
|
|
|
import { onShow, onPageScroll } from '@dcloudio/uni-app';
|
|
|
import { RouterUtils, TipsUtils } from '@/utils/util';
|
|
@@ -193,11 +197,15 @@
|
|
|
const titleBarHeight = ref(0);
|
|
|
const navOpacity = ref(0);
|
|
|
const backgroundColor = ref('#D2FD73');
|
|
|
+ const instructorList = ref();
|
|
|
onShow(() => {
|
|
|
get_location()
|
|
|
})
|
|
|
onMounted(() => {
|
|
|
get_navheight()
|
|
|
+ get_indexInfo()
|
|
|
+ get_message()
|
|
|
+ get_searchList()
|
|
|
})
|
|
|
onPageScroll((e) => {
|
|
|
navOpacity.value = Math.min(Math.max(e.scrollTop / navBarHeight.value, 0), 1);
|
|
@@ -243,12 +251,14 @@
|
|
|
http.get('/user/loginByCode', { data: { code: item }, loading: true }).then(res => {
|
|
|
cache.set('TOKEN', res.result.token)
|
|
|
cache.set('USER_INFO', res.result)
|
|
|
+ get_indexInfo()
|
|
|
+ get_message()
|
|
|
+ get_searchList()
|
|
|
TipsUtils.tips_toast('登录成功')
|
|
|
})
|
|
|
}
|
|
|
|
|
|
const get_location = () => {
|
|
|
- uni.showLoading()
|
|
|
uni.authorize({
|
|
|
scope: 'scope.userLocation',
|
|
|
success() {
|
|
@@ -256,35 +266,33 @@
|
|
|
type: 'wgs84',
|
|
|
success: function (res) {
|
|
|
uni.hideLoading()
|
|
|
- cache.set('LON',res.longitude)
|
|
|
- cache.set('LAT',res.latitude)
|
|
|
+ cache.set('LON', res.longitude)
|
|
|
+ cache.set('LAT', res.latitude)
|
|
|
// console.log('当前位置的经度:' + res.longitude);
|
|
|
// console.log('当前位置的纬度:' + res.latitude);
|
|
|
},
|
|
|
fail: function (err) {
|
|
|
- uni.hideLoading()
|
|
|
if (err.errMsg === 'getFuzzyLocation:fail system permission denied') {
|
|
|
TipsUtils.tips_alert('系统定位未开启,请开启定位以便提供更好服务', false)
|
|
|
} else if (err.errMsg === 'getFuzzyLocation:fail:ERROR_NOCELL&WIFI_LOCATIONSWITCHOFF' ||
|
|
|
err.errMsg === 'getFuzzyLocation:fail system permission denied' ||
|
|
|
- err.errMsg === 'getFuzzyLocation:fail:system permission denied' || err.errMsg === 'getFuzzyLocation:fail auth deny'){
|
|
|
- showAuthGuide()
|
|
|
- }
|
|
|
+ err.errMsg === 'getFuzzyLocation:fail:system permission denied' || err.errMsg === 'getFuzzyLocation:fail auth deny') {
|
|
|
+ showAuthGuide()
|
|
|
+ }
|
|
|
console.log(err, '错误信息')
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
fail: (err) => {
|
|
|
- uni.hideLoading()
|
|
|
showAuthGuide()
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
// 引导操作
|
|
|
- const showAuthGuide = async() => {
|
|
|
- let res:any = await TipsUtils.tips_alert('授权定位以提供更好服务',true)
|
|
|
- if(res.confirm){
|
|
|
+ const showAuthGuide = async () => {
|
|
|
+ let res : any = await TipsUtils.tips_alert('授权定位以提供更好服务', true)
|
|
|
+ if (res.confirm) {
|
|
|
uni.openSetting()
|
|
|
}
|
|
|
}
|
|
@@ -304,14 +312,55 @@
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
-
|
|
|
- // 字典项查询
|
|
|
- const get_dictItems=(code)=>{
|
|
|
- http.get('/common/getDictItems',{data:{dictCode:code}}).then(res=>{
|
|
|
-
|
|
|
+
|
|
|
+ // 首页基础信息
|
|
|
+ const gyCourseList = ref()
|
|
|
+ const stCourseList = ref()
|
|
|
+ const indexLoading=ref(true)
|
|
|
+ const get_indexInfo = () => {
|
|
|
+ http.get('/home/homeInfo').then((res) => {
|
|
|
+ indexLoading.value=false
|
|
|
+ bannerList.value = res.result.bannerList
|
|
|
+ gyCourseList.value = res.result.courseList.filter(item => item.priceType === 0)
|
|
|
+ stCourseList.value = res.result.courseList.filter(item => item.priceType === 1)
|
|
|
+ instructorList.value = res.result.instructorList
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ // 消息通知
|
|
|
+ const indexMsg = ref([])
|
|
|
+ const get_message = () => {
|
|
|
+ http.get('/home/getMsg').then((res) => {
|
|
|
+ indexMsg.value = res.result
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+ // 搜索相关
|
|
|
+ const searchList=ref([])
|
|
|
+ const get_searchList=()=>{
|
|
|
+ http.get('/home/getHotSearch').then((res)=>{
|
|
|
+ searchList.value=res.result
|
|
|
+ })
|
|
|
+ }
|
|
|
+ const searchCurrent=ref()
|
|
|
+ const transitionChange=(e)=>{
|
|
|
+ searchCurrent.value=e.detail.current
|
|
|
+ }
|
|
|
+ const searchInfoBtn=()=>{
|
|
|
+ if(searchList.value<1) return TipsUtils.tips_toast('请输入关键词')
|
|
|
+ let keyword=''
|
|
|
+ let venueType=null
|
|
|
+ if(searchList.value.length>1){
|
|
|
+ keyword=searchList.value[searchCurrent.value].searchContent
|
|
|
+ venueType=searchList.value[searchCurrent.value].venueType
|
|
|
+ }else{
|
|
|
+ searchList.value.map((item)=>{
|
|
|
+ keyword=item.searchContent
|
|
|
+ venueType=item.venueType
|
|
|
+ })
|
|
|
+ }
|
|
|
+ gotoPage(`/pages/index/searchPage/index?keyword=${keyword}&venueType=${venueType}`)
|
|
|
+ }
|
|
|
</script>
|
|
|
|
|
|
<style lang="less" scoped>
|
|
@@ -369,7 +418,9 @@
|
|
|
padding: 8rpx;
|
|
|
border-radius: 40rpx;
|
|
|
|
|
|
- &>input {
|
|
|
+ .i-search-swiper {
|
|
|
+ height: 40rpx;
|
|
|
+ line-height: 40rpx;
|
|
|
width: 670rpx;
|
|
|
font-weight: bold;
|
|
|
font-size: 24rpx;
|
|
@@ -491,7 +542,7 @@
|
|
|
.commonweal {
|
|
|
background: #C8FF0C;
|
|
|
border-radius: 32rpx;
|
|
|
- padding: 30rpx;
|
|
|
+ padding: 20rpx;
|
|
|
|
|
|
.commonweal-title {
|
|
|
display: flex;
|
|
@@ -530,6 +581,7 @@
|
|
|
}
|
|
|
|
|
|
.detail-text {
|
|
|
+ text-align: center;
|
|
|
margin-top: 16rpx;
|
|
|
font-size: 24rpx;
|
|
|
color: #222222;
|
|
@@ -541,7 +593,7 @@
|
|
|
.audition {
|
|
|
background: #AB7BFF;
|
|
|
border-radius: 32rpx;
|
|
|
- padding: 30rpx;
|
|
|
+ padding: 20rpx;
|
|
|
|
|
|
.audition-title {
|
|
|
display: flex;
|
|
@@ -572,6 +624,7 @@
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
align-items: center;
|
|
|
+ text-align: center;
|
|
|
|
|
|
&>image {
|
|
|
width: 80rpx;
|
|
@@ -580,6 +633,7 @@
|
|
|
}
|
|
|
|
|
|
.detail-text {
|
|
|
+ text-align: center;
|
|
|
margin-top: 16rpx;
|
|
|
font-size: 24rpx;
|
|
|
color: #fff;
|
|
@@ -699,7 +753,7 @@
|
|
|
width: 134rpx;
|
|
|
height: 60rpx;
|
|
|
font-weight: 800;
|
|
|
- font-size: 36rpx;
|
|
|
+ font-size: 28rpx;
|
|
|
color: #222222;
|
|
|
position: relative;
|
|
|
|
|
@@ -707,6 +761,7 @@
|
|
|
&>text {
|
|
|
position: absolute;
|
|
|
z-index: 1;
|
|
|
+ top: 10rpx;
|
|
|
}
|
|
|
}
|
|
|
|