|
@@ -36,8 +36,6 @@
|
|
|
</view>
|
|
</view>
|
|
|
<view style="height: 34rpx;"></view>
|
|
<view style="height: 34rpx;"></view>
|
|
|
<liu-slide-img :list="bannerList" :type="2" :interval="3000" :indicator-show="false"></liu-slide-img>
|
|
<liu-slide-img :list="bannerList" :type="2" :interval="3000" :indicator-show="false"></liu-slide-img>
|
|
|
- <!-- <zs-banner type="2" radius="30rpx" previousMargin="40rpx" nextMargin="40rpx" spacing="20rpx"
|
|
|
|
|
- :isIndicator="false" :autoplay="true" :bannerList="bannerList" height="300rpx"></zs-banner> -->
|
|
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="content">
|
|
<view class="content">
|
|
@@ -186,17 +184,18 @@
|
|
|
<!-- </view> -->
|
|
<!-- </view> -->
|
|
|
</view>
|
|
</view>
|
|
|
<view class="login-tips" v-if="!token">
|
|
<view class="login-tips" v-if="!token">
|
|
|
- <view class="">终于等到你!快去登录吧~</view>
|
|
|
|
|
- <view class="" @click="submitLogin">马上登录</view>
|
|
|
|
|
|
|
+ <view class="login-text">终于等到你!快去登录吧~</view>
|
|
|
|
|
+ <view class="login-btn" @click="submitLogin">马上登录</view>
|
|
|
|
|
+ <button type="default" open-type="getPhoneNumber" @getphonenumber="decryptPhoneNumber"
|
|
|
|
|
+ class="getPhoneNumber-btn"></button>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
import zsLoading from '@/components/zzx-loading/zzx-loading.vue';
|
|
import zsLoading from '@/components/zzx-loading/zzx-loading.vue';
|
|
|
-import zsBanner from '@/components/zs-banner/index.vue';
|
|
|
|
|
import { ref, onMounted, computed } from 'vue'
|
|
import { ref, onMounted, computed } from 'vue'
|
|
|
-import { onLoad, onPageScroll, onPullDownRefresh, onShareAppMessage } from '@dcloudio/uni-app';
|
|
|
|
|
|
|
+import { onShow, onPageScroll, onPullDownRefresh, onShareAppMessage } from '@dcloudio/uni-app';
|
|
|
import zsEmpty from '@/components/zs-empty/index.vue'
|
|
import zsEmpty from '@/components/zs-empty/index.vue'
|
|
|
import { TipsUtils, RouterUtils } from '@/utils/util';
|
|
import { TipsUtils, RouterUtils } from '@/utils/util';
|
|
|
import { http } from '@/utils/http'
|
|
import { http } from '@/utils/http'
|
|
@@ -213,7 +212,7 @@ const instructorList = ref();
|
|
|
const indexLoading = ref(true);
|
|
const indexLoading = ref(true);
|
|
|
const hotInstructorImg1 = ref('https://national-motion.oss-cn-beijing.aliyuncs.com/opt/upFiles/dxVfKxD7aH2397154f377d68fb59a71226c9c2f078a9_1758071827887.png')
|
|
const hotInstructorImg1 = ref('https://national-motion.oss-cn-beijing.aliyuncs.com/opt/upFiles/dxVfKxD7aH2397154f377d68fb59a71226c9c2f078a9_1758071827887.png')
|
|
|
const hotInstructorImg2 = ref('https://national-motion.oss-cn-beijing.aliyuncs.com/opt/upFiles/uv0VmclIvXiJc1081e0e33e281a8a436d24ec9ca87c3_1758071769194.png')
|
|
const hotInstructorImg2 = ref('https://national-motion.oss-cn-beijing.aliyuncs.com/opt/upFiles/uv0VmclIvXiJc1081e0e33e281a8a436d24ec9ca87c3_1758071769194.png')
|
|
|
-onLoad(() => {
|
|
|
|
|
|
|
+onShow(() => {
|
|
|
get_location()
|
|
get_location()
|
|
|
})
|
|
})
|
|
|
onShareAppMessage(() => {
|
|
onShareAppMessage(() => {
|
|
@@ -246,11 +245,7 @@ const get_navheight = () => {
|
|
|
navBarHeight.value = statusBarHeight.value + titleBarHeight.value;
|
|
navBarHeight.value = statusBarHeight.value + titleBarHeight.value;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-const currentIndex = ref(0);
|
|
|
|
|
const bannerList = ref([])
|
|
const bannerList = ref([])
|
|
|
-const swierChange = (e) => {
|
|
|
|
|
- currentIndex.value = e.detail.current
|
|
|
|
|
-}
|
|
|
|
|
|
|
|
|
|
const gotoPage = (path: string) => {
|
|
const gotoPage = (path: string) => {
|
|
|
// if (!token.value) return TipsUtils.tips_alert('请先登录~', false)
|
|
// if (!token.value) return TipsUtils.tips_alert('请先登录~', false)
|
|
@@ -259,23 +254,49 @@ const gotoPage = (path: string) => {
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-const submitLogin = () => {
|
|
|
|
|
- uni.login({
|
|
|
|
|
- provider: 'weixin',
|
|
|
|
|
- success: (res) => {
|
|
|
|
|
- get_logininfo(res.code)
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
|
|
+// 手机号授权登录
|
|
|
|
|
+const phoneCode = ref('')
|
|
|
|
|
+const decryptPhoneNumber = (e: any) => {
|
|
|
|
|
+ phoneCode.value = e.detail.code
|
|
|
|
|
+ if (e.detail.code) {
|
|
|
|
|
+ uni.login({
|
|
|
|
|
+ provider: 'weixin',
|
|
|
|
|
+ success: (res) => {
|
|
|
|
|
+ get_logininfo(res.code)
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
+// 微信code登录
|
|
|
|
|
+// const submitLogin = () => {
|
|
|
|
|
+// uni.login({
|
|
|
|
|
+// provider: 'weixin',
|
|
|
|
|
+// success: (res) => {
|
|
|
|
|
+// get_logininfo(res.code)
|
|
|
|
|
+// }
|
|
|
|
|
+// })
|
|
|
|
|
+// }
|
|
|
|
|
|
|
|
const get_logininfo = (item: string) => {
|
|
const get_logininfo = (item: string) => {
|
|
|
http.get('/user/loginByCode', { data: { code: item }, loading: true }).then(res => {
|
|
http.get('/user/loginByCode', { data: { code: item }, loading: true }).then(res => {
|
|
|
cache.set('TOKEN', res.result.token)
|
|
cache.set('TOKEN', res.result.token)
|
|
|
cache.set('USER_INFO', res.result)
|
|
cache.set('USER_INFO', res.result)
|
|
|
|
|
+ getMobilePhone(phoneCode.value)
|
|
|
|
|
+ })
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const getMobilePhone = (code: string) => {
|
|
|
|
|
+ http.get('/user//getMobilePhone', { data: { code: code }, loading: true }).then(res => {
|
|
|
get_indexInfo()
|
|
get_indexInfo()
|
|
|
get_message()
|
|
get_message()
|
|
|
get_searchList()
|
|
get_searchList()
|
|
|
get_userinfo()
|
|
get_userinfo()
|
|
|
|
|
+ })
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const get_userinfo = () => {
|
|
|
|
|
+ http.get('/user/getUserInfo', { loading: true }).then(res => {
|
|
|
|
|
+ cache.set('USER_INFO', res.result)
|
|
|
TipsUtils.tips_toast('登录成功')
|
|
TipsUtils.tips_toast('登录成功')
|
|
|
if (cache.get('SHARER_ID') && token.value) {
|
|
if (cache.get('SHARER_ID') && token.value) {
|
|
|
gotoPage('/pages/index/userList/index')
|
|
gotoPage('/pages/index/userList/index')
|
|
@@ -304,12 +325,6 @@ const get_logininfo = (item: string) => {
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-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',
|
|
@@ -330,7 +345,7 @@ const get_location = () => {
|
|
|
uni.hideLoading()
|
|
uni.hideLoading()
|
|
|
cache.set('LON', res.longitude)
|
|
cache.set('LON', res.longitude)
|
|
|
cache.set('LAT', res.latitude)
|
|
cache.set('LAT', res.latitude)
|
|
|
- getAddressInfo()
|
|
|
|
|
|
|
+ // getAddressInfo()
|
|
|
},
|
|
},
|
|
|
fail: function (err) {
|
|
fail: function (err) {
|
|
|
if (err.errMsg === 'getFuzzyLocation:fail system permission denied') {
|
|
if (err.errMsg === 'getFuzzyLocation:fail system permission denied') {
|
|
@@ -350,7 +365,7 @@ const get_location = () => {
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// 经纬度逆解析获取当前位置信息
|
|
|
|
|
|
|
+// 经纬度逆解析获取当前位置信息-----已弃用
|
|
|
const getAddressInfo = () => {
|
|
const getAddressInfo = () => {
|
|
|
const qqmapsdk = new QQMapWX({ key: 'IPQBZ-NTL35-DCDI7-IU6JL-LUMO2-5XB3W' });
|
|
const qqmapsdk = new QQMapWX({ key: 'IPQBZ-NTL35-DCDI7-IU6JL-LUMO2-5XB3W' });
|
|
|
qqmapsdk.reverseGeocoder({
|
|
qqmapsdk.reverseGeocoder({
|
|
@@ -378,7 +393,7 @@ const showAuthGuide = async () => {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 手动选择
|
|
// 手动选择
|
|
|
-const addressName = ref('选择定位')
|
|
|
|
|
|
|
+const addressName = ref('全龄动能')
|
|
|
const openSellocation = () => {
|
|
const openSellocation = () => {
|
|
|
uni.chooseLocation({
|
|
uni.chooseLocation({
|
|
|
success: function (res) {
|
|
success: function (res) {
|
|
@@ -934,6 +949,15 @@ const searchInfoBtn = () => {
|
|
|
margin-top: 20rpx;
|
|
margin-top: 20rpx;
|
|
|
font-size: 24rpx;
|
|
font-size: 24rpx;
|
|
|
color: #AAAAAA;
|
|
color: #AAAAAA;
|
|
|
|
|
+ display: -webkit-box;
|
|
|
|
|
+ -webkit-line-clamp: 2;
|
|
|
|
|
+ -webkit-box-orient: vertical;
|
|
|
|
|
+ overflow: hidden;
|
|
|
|
|
+ text-overflow: ellipsis;
|
|
|
|
|
+ white-space: normal;
|
|
|
|
|
+ word-wrap: break-word;
|
|
|
|
|
+ word-break: break-all;
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.i-course {
|
|
.i-course {
|
|
@@ -1002,12 +1026,12 @@ const searchInfoBtn = () => {
|
|
|
border-radius: 8rpx;
|
|
border-radius: 8rpx;
|
|
|
z-index: 9999;
|
|
z-index: 9999;
|
|
|
|
|
|
|
|
- &>view:first-child {
|
|
|
|
|
|
|
+ .login-text {
|
|
|
font-size: 28rpx;
|
|
font-size: 28rpx;
|
|
|
color: #FFFFFF;
|
|
color: #FFFFFF;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- &>view:last-child {
|
|
|
|
|
|
|
+ .login-btn {
|
|
|
width: 160rpx;
|
|
width: 160rpx;
|
|
|
height: 60rpx;
|
|
height: 60rpx;
|
|
|
background: #C8FF0C;
|
|
background: #C8FF0C;
|
|
@@ -1017,5 +1041,13 @@ const searchInfoBtn = () => {
|
|
|
text-align: center;
|
|
text-align: center;
|
|
|
line-height: 60rpx;
|
|
line-height: 60rpx;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ .getPhoneNumber-btn {
|
|
|
|
|
+ position: absolute;
|
|
|
|
|
+ right: 10rpx;
|
|
|
|
|
+ width: 160rpx;
|
|
|
|
|
+ height: 60rpx;
|
|
|
|
|
+ opacity: 0;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
</style>
|
|
</style>
|