diff --git a/manifest.json b/manifest.json index eba9f57..07609b2 100644 --- a/manifest.json +++ b/manifest.json @@ -1,9 +1,9 @@ { "name" : "登澜到家", "appid" : "__UNI__B500DDB", // 改为自己的 - "description" : "上门预约", - "versionName" : "1.0.7", - "versionCode" : 107, + "description" : "上门按摩服务", + "versionName" : "1.0.8", + "versionCode" : 108, "transformPx" : false, "uniStatistics" : { "enable" : false //全局关闭 diff --git a/pages/technician.vue b/pages/technician.vue index 47e5507..d55c059 100644 --- a/pages/technician.vue +++ b/pages/technician.vue @@ -7,8 +7,8 @@ - - {{location&&location.address ?location.address : isLoad ? '定位失败' : '定位中...'}} + {{location&&location.name ?location.name : isLoad ? '定位失败' : '定位中...'}} + @@ -229,44 +229,45 @@ title: '', imageUrl: '', path, - lng:'', - lat:'' } }, methods: { // 获取当前定位 - init(){ + init() { + const _this = this; uni.getLocation({ type: 'wgs84', - success: function (res) { - this.lng = res.longitude; - this.lat = res.latitude; - console.log(111,res); - const data = { - lng:res.longitude, - lat:res.latitude, - key:"ac07017e-6409-4aa4-88eb-6e252556d392" - } + success: function(res) { uni.request({ - url: `https://tianjin.tianjinhualong.cn/index.php?s=index/getLocaltion&latitude=`+res.latitude+`&longitude=`+res.longitude, - data: { - text: 'uni.request' - }, - header: { - 'custom-header': 'hello' //自定义请求头信息 - }, - success: (res) => { - console.log(res.data.result.address); + url: `https://tianjin.tianjinhualong.cn/index.php?s=index/getLocaltion&latitude=` + + res.latitude + `&longitude=` + res.longitude, + data: { + text: 'uni.request' + }, + header: { + 'custom-header': 'hello' //自定义请求头信息 + }, + success: (res) => { const index = res.data.result.address.indexOf("区") - console.log(222,index); - this.location.address = res.data.result.address.slice(index+1) - console.log("测试一下",res.data.result.address.slice(index+1)); - } + let location = { + lng: res.data.result.ad_info.location.lng, + lat: res.data.result.ad_info.location.lat, + address: res.data.result.address, + city: '', + district: '', + name: res.data.result.address.slice(index + 1), + province: '' + } + _this.updateUserItem({ + key: 'location', + val: location + }) + } }); } }); }, - ...mapActions(['getConfigInfo', 'getUserInfo', 'getCityList', 'getServiceCoachList','getAddressList']), + ...mapActions(['getConfigInfo', 'getUserInfo', 'getCityList', 'getServiceCoachList', 'getAddressList']), ...mapMutations(['updateUserItem', 'updateTechnicianItem']), async initIndex(refresh = false) { // #ifdef H5 @@ -567,13 +568,11 @@ key: 'cityId', val: city_id }) - console.log(333,param); param = Object.assign({}, param, { lng, lat, city_id }) - console.log(222,param); let { coach_format = 1