Browse Source

定位问题

master
unknown 1 year ago
parent
commit
e8ca545457
  1. 2
      components/searchRow/searchRow.vue
  2. 2
      config/site.config.js
  3. 11
      manifest.json
  4. 6
      pages/indexEntry/enroll/registInfo/comp/searchSchool.vue
  5. 12
      pages/indexEntry/enroll/registInfo/registInfo.vue
  6. 40
      pages/tabbar/index/index.vue
  7. 12
      pages/tabbar/mine/index.vue
  8. 30
      store/modules/user.js
  9. 4
      uni_modules/uview-ui/components/u-search/u-search.vue

2
components/searchRow/searchRow.vue

@ -5,7 +5,7 @@
<image src="@/static/images/index/searchIcon.png" mode=""></image> <image src="@/static/images/index/searchIcon.png" mode=""></image>
</view> </view>
<view class="inputBox"> <view class="inputBox">
<u-search :placeholder="placeholder" v-model="keyword" :color="'#fff'" placeholderColor="#fff" searchIcon="" :bgColor="'transparent'" :showAction="false" @search="searchFn" @clear="searchFn"></u-search>
<u-search :placeholder="placeholder" v-model="keyword" :color="'#fff'" placeholderColor="#fff" :bgColor="'transparent'" :showAction="false" @search="searchFn" @clear="searchFn"></u-search>
</view> </view>
</view> </view>
</view> </view>

2
config/site.config.js

@ -4,6 +4,6 @@ module.exports = {
H5_API: VUE_APP_PLATFORM === 'h5' ? '/api' : '',//h5代理 H5_API: VUE_APP_PLATFORM === 'h5' ? '/api' : '',//h5代理
WX_API: VUE_APP_PLATFORM === 'h5' ? '' : 'http://192.168.1.26:48080/',//非代理地址 WX_API: VUE_APP_PLATFORM === 'h5' ? '' : 'http://192.168.1.26:48080/',//非代理地址
TEMP_HOST: VUE_APP_PLATFORM === 'h5' ? '' : 'http://192.168.1.26:48080/', TEMP_HOST: VUE_APP_PLATFORM === 'h5' ? '' : 'http://192.168.1.26:48080/',
httpPrefix: '/app-api/',
httpPrefix: 'app-api/',
imgUrl: 'http://jxtemp.oss-cn-hangzhou.aliyuncs.com/defaultImages/app/bigImg/' imgUrl: 'http://jxtemp.oss-cn-hangzhou.aliyuncs.com/defaultImages/app/bigImg/'
}; };

11
manifest.json

@ -59,7 +59,7 @@
"quickapp" : {}, "quickapp" : {},
/* */ /* */
"mp-weixin" : { "mp-weixin" : {
"appid" : "wxae509f512c11c039",
"appid" : "wx2d71605af3b620e6",
"setting" : { "setting" : {
"urlCheck" : true, "urlCheck" : true,
"es6" : true, "es6" : true,
@ -108,6 +108,15 @@
"router" : { "router" : {
"mode" : "hash", "mode" : "hash",
"base" : "/h5" "base" : "/h5"
},
"sdkConfigs" : {
"maps" : {
"amap" : {
"key" : "2BTBZ-6BQRB-ZG4UG-NOYYG-KZMH7-B4BYN",
"securityJsCode" : "",
"serviceHost" : ""
}
}
} }
} }
} }

6
pages/indexEntry/enroll/registInfo/comp/searchSchool.vue

@ -42,11 +42,17 @@
pageSize: 20, pageSize: 20,
lat: 30.27419537786047, lat: 30.27419537786047,
lng: 120.20633397715788, lng: 120.20633397715788,
sercheType: '1'
} }
} }
}, },
created() { created() {
if(this.vuex_cityInfo.lat) {
this.params.lat = this.vuex_cityInfo.lat
this.params.lng = this.vuex_cityInfo.lng
}
this.schoolPageFn() this.schoolPageFn()
}, },
methods: { methods: {
// //

12
pages/indexEntry/enroll/registInfo/registInfo.vue

@ -30,7 +30,7 @@
<view class="row"> <view class="row">
<view class="lab">选择车型</view> <view class="lab">选择车型</view>
<view class="rightCon"> <view class="rightCon">
<view class="row" @click="showCar=true">
<view class="row" @click="showCarClick">
<view class="val"> <view class="val">
<mySelect :value="form.car"/> <mySelect :value="form.car"/>
</view> </view>
@ -55,8 +55,8 @@
</view> </view>
<view class="row"> <view class="row">
<view class="lab">选择教练</view> <view class="lab">选择教练</view>
<view class="rightCon">
<view class="row" @click="goCoach">
<view class="rightCon" @click="goCoach">
<view class="row" >
<view class="val"> <view class="val">
<mySelect :value="form.coach"/> <mySelect :value="form.coach"/>
</view> </view>
@ -259,7 +259,7 @@
</u-popup> </u-popup>
<!-- 选择班型 --> <!-- 选择班型 -->
<u-picker :show="showClassModel" :columns="columnsClassModel" keyName="label" @confirm="confirmClassModel"></u-picker>
<u-picker :show="showClassModel" :columns="columnsClassModel" keyName="label" @confirm="confirmClassModel" @close="showClassModel=false"></u-picker>
<!-- 选择车型 --> <!-- 选择车型 -->
<u-picker :show="showCar" :columns="columnsCar" keyName="label" @confirm="confirmCar"></u-picker> <u-picker :show="showCar" :columns="columnsCar" keyName="label" @confirm="confirmCar"></u-picker>
<!-- 原驾驶证初领日期 --> <!-- 原驾驶证初领日期 -->
@ -359,6 +359,10 @@
this.showCar = false this.showCar = false
this.form.car = item this.form.car = item
}, },
showCarClick() {
if(!this.form.school) return this.$u.toast('请先选择驾校')
this.showCar = true
},
// //
goCoach() { goCoach() {
if(!this.form.schoolId) return this.$u.toast('请先选择驾校') if(!this.form.schoolId) return this.$u.toast('请先选择驾校')

40
pages/tabbar/index/index.vue

@ -40,7 +40,7 @@
<!-- 精钢区 --> <!-- 精钢区 -->
<view class="card traTop"> <view class="card traTop">
<view class="ul"> <view class="ul">
<view class="li" v-for="(item,index) in entrySection" :key="index" @click="item.click(item)">
<view class="li" v-for="(item,index) in entrySection" :key="index" @tap="$goPage(item.url)">
<view class="icon"> <view class="icon">
<image :src="item.icon" mode=""></image> <image :src="item.icon" mode=""></image>
</view> </view>
@ -128,15 +128,16 @@
text: '我要报名', text: '我要报名',
icon: require('../../../static/images/index/ic_baoming.png'), icon: require('../../../static/images/index/ic_baoming.png'),
url: '/pages/indexEntry/enroll/enroll', url: '/pages/indexEntry/enroll/enroll',
click: (item)=>{
this.$goPage(item.url)
goPage: function (){
console.log(666)
// this.$goPage(item.url)
} }
}, },
{ {
text: '找驾校', text: '找驾校',
icon: require('../../../static/images/index/ic_jiaxiao.png'), icon: require('../../../static/images/index/ic_jiaxiao.png'),
url: '/pages/indexEntry/findShcool/findShcool', url: '/pages/indexEntry/findShcool/findShcool',
click: (item)=>{
goPage: (item)=>{
this.$goPage(item.url) this.$goPage(item.url)
} }
}, },
@ -144,32 +145,32 @@
text: '找考场', text: '找考场',
icon: require('../../../static/images/index/ic_kaochang.png'), icon: require('../../../static/images/index/ic_kaochang.png'),
url: '/pages/indexEntry/examines/examines', url: '/pages/indexEntry/examines/examines',
click: (item)=>{
goPage: ((item)=>{
this.$goPage(item.url) this.$goPage(item.url)
}
})
}, },
{ {
text: '找驾驶馆', text: '找驾驶馆',
icon: require('../../../static/images/index/ic_jsg.png'), icon: require('../../../static/images/index/ic_jsg.png'),
url: '/pages/carEntry/simulateAppointment/simulateAppointment', url: '/pages/carEntry/simulateAppointment/simulateAppointment',
click: (item)=>{
goPage: ((item)=>{
this.$goPage(item.url) this.$goPage(item.url)
}
})
}, },
{ {
text: '找陪练', text: '找陪练',
icon: require('../../../static/images/index/ic_peilian.png'), icon: require('../../../static/images/index/ic_peilian.png'),
click: (item)=>{
goPage: ((item)=>{
this.$u.toast('正在开发中,敬请期待...') this.$u.toast('正在开发中,敬请期待...')
}
})
}, },
{ {
text: '理论学习', text: '理论学习',
icon: require('../../../static/images/index/ic_lilun.png'), icon: require('../../../static/images/index/ic_lilun.png'),
url: '/pages/indexEntry/theory/theory', url: '/pages/indexEntry/theory/theory',
click: (item)=>{
goPage: ((item)=>{
this.$goPage(item.url) this.$goPage(item.url)
}
})
}, },
], ],
moreSection: [{ moreSection: [{
@ -276,9 +277,20 @@
} }
}, },
async onLoad() { async onLoad() {
// uni.getLocation({
// type: 'wgs84',
// success: function (res) {
// console.log('' + res.longitude);
// console.log('' + res.latitude);
// },
// fail(err) {
// console.log(err)
// }
// });
if(!this.$store.state.user.vuex_cityInfo.lat) {
await this.$store.dispatch('getCity') await this.$store.dispatch('getCity')
console.log('有 啦')
console.log(this.$store.state.user.vuex_cityInfo)
}
// console.log(this.$store.state.user.vuex_cityInfo) // console.log(this.$store.state.user.vuex_cityInfo)
}, },

12
pages/tabbar/mine/index.vue

@ -1,9 +1,9 @@
<template> <template>
<view class="pageBgImg"> <view class="pageBgImg">
<!-- 学员名字 --> <!-- 学员名字 -->
<view class="top_row flex-b" @click="$goPage('/pages/mineEntry/personaInfo/personaInfo')">
<view class="top_row flex-b" @click="topClick">
<view class="flex"> <view class="flex">
<view class="userName">Hi{{ vuex_userInfo.nickname?vuex_userInfo.nickname:vuex_userInfo.mobile}}</view>
<view class="userName">Hi{{ vuex_userInfo.nickname?vuex_userInfo.nickname:vuex_userInfo.mobile?vuex_userInfo.mobile:'请登录'}}</view>
<view class="arrowIcon"> <view class="arrowIcon">
<image src="../../../static/images/userCenter/ic_gengduo.png" mode=""></image> <image src="../../../static/images/userCenter/ic_gengduo.png" mode=""></image>
</view> </view>
@ -135,7 +135,13 @@
// uni.hideTabBar(); // uni.hideTabBar();
}, },
methods: { methods: {
goPage() {}
topClick() {
if(!this.vuex_userInfo.mobile) {
this.$goPage('/pages/userCenter/login/login')
}else {
this.$goPage('/pages/mineEntry/personaInfo/personaInfo')
}
}
} }
} }
</script> </script>

30
store/modules/user.js

@ -125,8 +125,10 @@ function gaoDeFn(longitude,latitude,commit,resolve, reject,) {
} }
function wxAdsFn(longitude,latitude, commit,resolve, reject,) { function wxAdsFn(longitude,latitude, commit,resolve, reject,) {
console.log(longitude)
console.log(latitude)
var qqmapKey = new qqmapWx({ var qqmapKey = new qqmapWx({
key: '2BTBZ-6BQRB-ZG4UG-NOYYG-KZMH7-B4BYN'
key: 'NRWBZ-TKRWV-CSAPH-5PFDS-J4HT6-IWF4O'
}) })
qqmapKey.reverseGeocoder({ qqmapKey.reverseGeocoder({
location: { location: {
@ -134,8 +136,8 @@ function wxAdsFn(longitude,latitude, commit,resolve, reject,) {
longitude:longitude longitude:longitude
}, },
success(res2) { success(res2) {
// console.log('城市信息')
// console.log(res2.result)
console.log('城市信息')
console.log(res2)
let result = res2.result let result = res2.result
let obj = { let obj = {
lat: latitude, lat: latitude,
@ -151,24 +153,32 @@ function wxAdsFn(longitude,latitude, commit,resolve, reject,) {
}, },
fail: function(res3) { fail: function(res3) {
reject(res3)
console.log('出什么问题了?')
console.log(res3)
let obj = {
lat: latitude,
lng: longitude
}
// reject(res3)
commit('update_vuex_cityInfo', obj)
uni.hideLoading(); uni.hideLoading();
}, },
}) })
} }
function getCityInfo(resolve, reject, commit) { function getCityInfo(resolve, reject, commit) {
uni.showLoading({
title: '加载中...'
})
// uni.showLoading({
// title: '加载中...'
// })
console.log('来到这是里了吗?')
uni.getLocation({ uni.getLocation({
type: 'wgs84', type: 'wgs84',
// type: 'gcj02', // type: 'gcj02',
success: function(res) { success: function(res) {
console.log('当前位置的经度:' + res.longitude); console.log('当前位置的经度:' + res.longitude);
console.log('当前位置的纬度:' + res);
// #ifdef APP-PLUS||H5
// console.log('当前位置的纬度:' + res);
// #ifdef H5
gaoDeFn(res.longitude,res.latitude, commit, resolve, reject,); gaoDeFn(res.longitude,res.latitude, commit, resolve, reject,);
// #endif // #endif
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN

4
uni_modules/uview-ui/components/u-search/u-search.vue

@ -19,14 +19,14 @@
<text class="u-search__content__label">{{ label }}</text> <text class="u-search__content__label">{{ label }}</text>
</slot> </slot>
</template> </template>
<view class="u-search__content__icon">
<!-- <view class="u-search__content__icon">
<u-icon <u-icon
@tap="clickIcon" @tap="clickIcon"
:size="searchIconSize" :size="searchIconSize"
:name="searchIcon" :name="searchIcon"
:color="searchIconColor ? searchIconColor : color" :color="searchIconColor ? searchIconColor : color"
></u-icon> ></u-icon>
</view>
</view> -->
<input <input
confirm-type="search" confirm-type="search"
@blur="blur" @blur="blur"

Loading…
Cancel
Save