|
@@ -1,9 +1,9 @@
|
|
<template>
|
|
<template>
|
|
<view class="nav-title"
|
|
<view class="nav-title"
|
|
:style="{height:navBarHeight+'px',opacity: navOpacity,transition: 'opacity 0.3s ease-in-out',background: backgroundColor }">
|
|
:style="{height:navBarHeight+'px',opacity: navOpacity,transition: 'opacity 0.3s ease-in-out',background: backgroundColor }">
|
|
- <view class="back-icon" :style="{paddingTop:statusBarHeight+'px'}">
|
|
|
|
|
|
+ <view class="back-icon" :style="{paddingTop:statusBarHeight+'px'}" @click="openSellocation">
|
|
<zzx-icon name="location" size="13"></zzx-icon>
|
|
<zzx-icon name="location" size="13"></zzx-icon>
|
|
- <view class="location-text">富力中心A7</view>
|
|
|
|
|
|
+ <view class="location-text textHidden">{{addressName}}</view>
|
|
<zzx-icon name="right" size="10"></zzx-icon>
|
|
<zzx-icon name="right" size="10"></zzx-icon>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -12,14 +12,15 @@
|
|
<view class="back-icon" :style="{paddingTop:(statusBarHeight+10)+'px'}" v-if="navOpacity==0"
|
|
<view class="back-icon" :style="{paddingTop:(statusBarHeight+10)+'px'}" v-if="navOpacity==0"
|
|
@click="openSellocation">
|
|
@click="openSellocation">
|
|
<zzx-icon name="location" size="13"></zzx-icon>
|
|
<zzx-icon name="location" size="13"></zzx-icon>
|
|
- <view class="location-text">富力中心A7</view>
|
|
|
|
|
|
+ <view class="location-text textHidden">{{addressName}}</view>
|
|
<zzx-icon name="right" size="10"></zzx-icon>
|
|
<zzx-icon name="right" size="10"></zzx-icon>
|
|
</view>
|
|
</view>
|
|
<view class="content" style="padding-top:180rpx;">
|
|
<view class="content" style="padding-top:180rpx;">
|
|
<view class="header-search">
|
|
<view class="header-search">
|
|
- <zzx-icon name="search" size="16"></zzx-icon>
|
|
|
|
- <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">
|
|
|
|
|
|
+ <zzx-icon name="search" size="18"></zzx-icon>
|
|
|
|
+ <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>
|
|
<view class="">{{item.searchContent}}</view>
|
|
</swiper-item>
|
|
</swiper-item>
|
|
</swiper>
|
|
</swiper>
|
|
@@ -76,7 +77,7 @@
|
|
</view>
|
|
</view>
|
|
<zs-loading v-if="indexLoading"></zs-loading>
|
|
<zs-loading v-if="indexLoading"></zs-loading>
|
|
<view class="course-card" v-else>
|
|
<view class="course-card" v-else>
|
|
- <view class="commonweal" @click="gotoPage('/pages/index/training/index')">
|
|
|
|
|
|
+ <view class="commonweal" @click="gotoPage(`/pages/index/training/index?priceType=1`)">
|
|
<view class="commonweal-title">
|
|
<view class="commonweal-title">
|
|
<view class="title-left">
|
|
<view class="title-left">
|
|
<image src="/src/static/gy-icon.png" mode=""></image>
|
|
<image src="/src/static/gy-icon.png" mode=""></image>
|
|
@@ -91,7 +92,7 @@
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
- <view class="audition" @click="gotoPage('/pages/index/training/index')">
|
|
|
|
|
|
+ <view class="audition" @click="gotoPage(`/pages/index/training/index?priceType=0`)">
|
|
<view class="audition-title">
|
|
<view class="audition-title">
|
|
<view class="title-left">
|
|
<view class="title-left">
|
|
<image src="/src/static/st-icon.png" mode=""></image>
|
|
<image src="/src/static/st-icon.png" mode=""></image>
|
|
@@ -169,7 +170,8 @@
|
|
</view>
|
|
</view>
|
|
<view class="num">已售{{item.count||'0'}}</view>
|
|
<view class="num">已售{{item.count||'0'}}</view>
|
|
</view>
|
|
</view>
|
|
- <view class="more">更多课程</view>
|
|
|
|
|
|
+ <view class="more" @click="gotoPage(`/pages/index/instructorDetail/index?id=${item.id}`)">更多课程
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -184,7 +186,7 @@
|
|
import zzxNavbar from '@/components/zzx-navbar/zzx-navbar.vue';
|
|
import zzxNavbar from '@/components/zzx-navbar/zzx-navbar.vue';
|
|
import zsLoading from '@/components/zzx-loading/zzx-loading.vue'
|
|
import zsLoading from '@/components/zzx-loading/zzx-loading.vue'
|
|
import { ref, onMounted, computed } from 'vue'
|
|
import { ref, onMounted, computed } from 'vue'
|
|
- import { onShow, onPageScroll } from '@dcloudio/uni-app';
|
|
|
|
|
|
+ import { onShow,onLoad, onPageScroll, onPullDownRefresh } from '@dcloudio/uni-app';
|
|
import { RouterUtils, TipsUtils } from '@/utils/util';
|
|
import { RouterUtils, TipsUtils } from '@/utils/util';
|
|
import { http } from '@/utils/http'
|
|
import { http } from '@/utils/http'
|
|
import { useCacheStore } from '@/stores/cache'
|
|
import { useCacheStore } from '@/stores/cache'
|
|
@@ -198,9 +200,14 @@
|
|
const navOpacity = ref(0);
|
|
const navOpacity = ref(0);
|
|
const backgroundColor = ref('#D2FD73');
|
|
const backgroundColor = ref('#D2FD73');
|
|
const instructorList = ref();
|
|
const instructorList = ref();
|
|
- onShow(() => {
|
|
|
|
|
|
+ onLoad(() => {
|
|
get_location()
|
|
get_location()
|
|
})
|
|
})
|
|
|
|
+ onPullDownRefresh(() => {
|
|
|
|
+ get_indexInfo()
|
|
|
|
+ get_message()
|
|
|
|
+ get_searchList()
|
|
|
|
+ })
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
get_navheight()
|
|
get_navheight()
|
|
get_indexInfo()
|
|
get_indexInfo()
|
|
@@ -254,22 +261,27 @@
|
|
get_indexInfo()
|
|
get_indexInfo()
|
|
get_message()
|
|
get_message()
|
|
get_searchList()
|
|
get_searchList()
|
|
|
|
+ get_userinfo()
|
|
TipsUtils.tips_toast('登录成功')
|
|
TipsUtils.tips_toast('登录成功')
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ const get_userinfo = () => {
|
|
|
|
+ http.get('/user/getUserInfo', { loading: true }).then(res => {
|
|
|
|
+ cache.set('USER_INFO', res.result)
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
const get_location = () => {
|
|
const get_location = () => {
|
|
uni.authorize({
|
|
uni.authorize({
|
|
scope: 'scope.userLocation',
|
|
scope: 'scope.userLocation',
|
|
success() {
|
|
success() {
|
|
uni.getLocation({
|
|
uni.getLocation({
|
|
- type: 'wgs84',
|
|
|
|
|
|
+ type: 'gcj02',
|
|
success: function (res) {
|
|
success: function (res) {
|
|
uni.hideLoading()
|
|
uni.hideLoading()
|
|
cache.set('LON', res.longitude)
|
|
cache.set('LON', res.longitude)
|
|
cache.set('LAT', res.latitude)
|
|
cache.set('LAT', res.latitude)
|
|
- // console.log('当前位置的经度:' + res.longitude);
|
|
|
|
- // console.log('当前位置的纬度:' + res.latitude);
|
|
|
|
},
|
|
},
|
|
fail: function (err) {
|
|
fail: function (err) {
|
|
if (err.errMsg === 'getFuzzyLocation:fail system permission denied') {
|
|
if (err.errMsg === 'getFuzzyLocation:fail system permission denied') {
|
|
@@ -298,13 +310,13 @@
|
|
}
|
|
}
|
|
|
|
|
|
// 手动选择
|
|
// 手动选择
|
|
|
|
+ const addressName = ref('选择定位')
|
|
const openSellocation = () => {
|
|
const openSellocation = () => {
|
|
uni.chooseLocation({
|
|
uni.chooseLocation({
|
|
success: function (res) {
|
|
success: function (res) {
|
|
- console.log('位置名称:' + res.name);
|
|
|
|
- console.log('详细地址:' + res.address);
|
|
|
|
- console.log('纬度:' + res.latitude);
|
|
|
|
- console.log('经度:' + res.longitude);
|
|
|
|
|
|
+ addressName.value = res.name
|
|
|
|
+ cache.set('LON', res.longitude)
|
|
|
|
+ cache.set('LAT', res.latitude)
|
|
},
|
|
},
|
|
fail(res) {
|
|
fail(res) {
|
|
console.log(res);
|
|
console.log(res);
|
|
@@ -316,14 +328,15 @@
|
|
// 首页基础信息
|
|
// 首页基础信息
|
|
const gyCourseList = ref()
|
|
const gyCourseList = ref()
|
|
const stCourseList = ref()
|
|
const stCourseList = ref()
|
|
- const indexLoading=ref(true)
|
|
|
|
|
|
+ const indexLoading = ref(true)
|
|
const get_indexInfo = () => {
|
|
const get_indexInfo = () => {
|
|
http.get('/home/homeInfo').then((res) => {
|
|
http.get('/home/homeInfo').then((res) => {
|
|
- indexLoading.value=false
|
|
|
|
|
|
+ indexLoading.value = false
|
|
bannerList.value = res.result.bannerList
|
|
bannerList.value = res.result.bannerList
|
|
gyCourseList.value = res.result.courseList.filter(item => item.priceType === 0)
|
|
gyCourseList.value = res.result.courseList.filter(item => item.priceType === 0)
|
|
stCourseList.value = res.result.courseList.filter(item => item.priceType === 1)
|
|
stCourseList.value = res.result.courseList.filter(item => item.priceType === 1)
|
|
instructorList.value = res.result.instructorList
|
|
instructorList.value = res.result.instructorList
|
|
|
|
+ uni.stopPullDownRefresh()
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
@@ -334,29 +347,29 @@
|
|
indexMsg.value = res.result
|
|
indexMsg.value = res.result
|
|
})
|
|
})
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
// 搜索相关
|
|
// 搜索相关
|
|
- const searchList=ref([])
|
|
|
|
- const get_searchList=()=>{
|
|
|
|
- http.get('/home/getHotSearch').then((res)=>{
|
|
|
|
- searchList.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 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
|
|
|
|
|
|
+ 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}`)
|
|
gotoPage(`/pages/index/searchPage/index?keyword=${keyword}&venueType=${venueType}`)
|
|
@@ -384,6 +397,10 @@
|
|
font-weight: 800;
|
|
font-weight: 800;
|
|
font-size: 28rpx;
|
|
font-size: 28rpx;
|
|
color: #222222;
|
|
color: #222222;
|
|
|
|
+
|
|
|
|
+ .location-text {
|
|
|
|
+ max-width: 460rpx;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -406,6 +423,10 @@
|
|
font-weight: 800;
|
|
font-weight: 800;
|
|
font-size: 28rpx;
|
|
font-size: 28rpx;
|
|
color: #222222;
|
|
color: #222222;
|
|
|
|
+
|
|
|
|
+ .location-text {
|
|
|
|
+ max-width: 460rpx;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
.header-search {
|
|
.header-search {
|