Browse Source

修改高德地图 新加拦截器

qukaidi 4 years ago
parent
commit
4b9d80421e

+ 18 - 0
common/request/request.js

@@ -31,6 +31,24 @@ export function request(config) {
         baseURL: baseURL,
         timeout: 10000
     });
+	// 响应拦截器
+	newVar.interceptors.response.use({},
+	  error => {
+	    console.log('err' + error)
+	    let { message } = error;
+	    if (message == "Network Error") {
+	      message = "后端接口连接异常";
+	    }
+	    else if (message.includes("timeout")) {
+	      message = "系统接口请求超时";
+	    }
+	    else if (message.includes("Request failed with status code")) {
+	      message = "系统接口" + message.substr(message.length - 3) + "异常";
+	    }
+	    uni.showToast(message)
+	    return Promise.reject(error)
+	  }
+	)
     return newVar(config);
 }
 

+ 1 - 7
components/mi-map/mi-map.vue

@@ -61,7 +61,6 @@
 					address: '请选择集合地点'
 				},
 				controls: [], // 地图中心点图标, 可更换iconPath, 详情见官方文档关于map组件的介绍
-				lonlatData:''
 			};
 		},
 		mounted() {
@@ -117,10 +116,7 @@
 
 			// 地图选择位置后 查询地点名称
 			async checkMap(res) {
-				let point = new plus.maps.Point(res.longitude,res.latitude);
-				plus.maps.Map.convertCoordinates(point, {},event=> {
-					this.lonlatData= event.coord; // 转换后的坐标值
-				});
+
 				this.addressObj = Object.assign({}, this.addressObj, {
 					longitude: res.longitude,
 					latitude: res.latitude,
@@ -199,8 +195,6 @@
 			},
 			// 提交
 			submitAdress() {
-				this.addressObj.longitude=this.lonlatData.longitude
-				this.addressObj.latitude=this.lonlatData.latitude
 				this.controls = []
 				setTimeout(() => {
 					this.$emit('updateAddress', this.addressObj)

+ 4 - 4
manifest.json

@@ -2,7 +2,7 @@
     "name" : "耀灵全钢店管家",
     "appid" : "__UNI__0C3473D",
     "description" : "测试",
-    "versionName" : "0.0.0.0.0.7",
+    "versionName" : "0.0.0.0.0.8",
     "versionCode" : "100",
     "transformPx" : false,
     "app-plus" : {
@@ -68,9 +68,9 @@
             "sdkConfigs" : {
                 "ad" : {},
                 "maps" : {
-                    "baidu" : {
-                        "appkey_ios" : "KYoTmSbggKUatksUwZKXrFmZX9oiVBrR",
-                        "appkey_android" : "4wYVsEvjrdDXtsbRYsNTy1f01PAYbZin"
+                    "amap" : {
+                        "appkey_ios" : "006f18e060f3e7887c4d9f83f1844f30",
+                        "appkey_android" : "2f2b953cb2028d9a2d000b5b3af33818"
                     }
                 },
                 "geolocation" : {

+ 1 - 1
pages/home/my-stock/my-stock.vue

@@ -54,7 +54,7 @@
 				loadText: {
 					loadmore: '轻轻上拉',
 					loading: '努力加载中',
-					nomore: '实在没有了'
+					nomore: '没有更多啦'
 				},
 				// 数据信息
 				datalist: []

+ 1 - 1
pages/home/scancode/index.vue

@@ -38,7 +38,7 @@
 						<u-td class="u-td" width="15%"><text @click="confirm(index)" style="color: #FA3534;">删除</text></u-td>
 					</u-tr>
 				</u-table>
-				<u-divider color="rgb(144, 147, 153)" half-width="200" border-color="rgb(144, 147, 153)" margin-top="40">没有更多</u-divider>
+				<u-divider color="rgb(144, 147, 153)" half-width="200" border-color="rgb(144, 147, 153)" margin-top="40">没有更多</u-divider>
 			</view>
 		</view>
 		<view class="determine">

+ 1 - 1
pages/home/scancode/scancodeout.vue

@@ -38,7 +38,7 @@
 						<u-td class="u-td" width="15%"><text @click="confirm(index)" style="color: #FA3534;">删除</text></u-td>
 					</u-tr>
 				</u-table>
-				<u-divider color="rgb(144, 147, 153)" half-width="200" border-color="rgb(144, 147, 153)" margin-top="40">没有更多</u-divider>
+				<u-divider color="rgb(144, 147, 153)" half-width="200" border-color="rgb(144, 147, 153)" margin-top="40">没有更多</u-divider>
 			</view>
 		</view>
 		<view class="determine">

+ 30 - 4
pages/login/register_2.vue

@@ -188,7 +188,9 @@
 				dataUrl: "",
 				codeLoading: false,
 				modelshow: false,
-				modelcontent: "如果店名和联系人与营业执照不一致,请重新上传清晰度更高的营业执照?"
+				modelcontent: "如果店名和联系人与营业执照不一致,请重新上传清晰度更高的营业执照?",
+				lonlatData:'',
+				bd09:false
 			};
 		},
 		created() {
@@ -203,8 +205,27 @@
 
 			})
 			uni.$on('addressData', (data) => {
-				this.form.latitude = data.latitude
-				this.form.longitude = data.longitude
+				if(data.latitude&&data.longitude){
+					request({
+						url: '/baseReq/getBaiDuMapMsg',
+						method: 'get',
+						params: {
+							"longitude": data.longitude,
+							"latitude": data.latitude
+						},
+					}).then(res => {
+						if (res.data.code == 0) {
+							this.lonlatData=res.data.data.result
+							this.bd09=true
+						}
+						if (res.data.code == 500) {
+							this.$u.toast(res.data.msg);
+						}
+					}).catch(err => {
+						console.log(err)
+					}).finally(() => {
+					})
+				}
 				this.address = data.address
 				this.form.region = this.address.province + "-" + this.address.city + "-" + this.address.district
 				this.form.addressInfo = this.address.addressInfo
@@ -233,9 +254,14 @@
 		},
 		methods: {
 			nextStep() {
+				this.form.latitude = this.lonlatData.y
+				this.form.longitude = this.lonlatData.x
 				this.$refs.uForm.validate(valid => {
 					if (valid) {
-
+						if(!this.bd09){
+							this.$u.toast('正在转换坐标,请稍候');
+							return
+						}
 						this.$u.route({
 							url: 'pages/login/register_3',
 						})

+ 35 - 33
pages/login/register_3.vue

@@ -32,7 +32,8 @@
 				<u-line color="#e4e7ed"></u-line>
 				<view class="content">
 					<u-checkbox-group :wrap="true" @change="checkboxGroupChange" style="display: flex;justify-content: left">
-						<u-checkbox v-model="item.checked" v-for="(item, index) in allbrandList" :key="index" :name="item.brandCode" shape="circle">
+						<u-checkbox v-model="item.checked" v-for="(item, index) in allbrandList" :key="index" :name="item.brandCode"
+						 shape="circle">
 							<view class="u-flex u-row-left" style="width: 150rpx;">
 								{{item.brandCode}}
 							</view>
@@ -58,13 +59,13 @@
 			 v-for="(item, index) in checkedAgentlist" :key="index">
 				<view slot="head">
 					<view class="u-flex u-row-between">
-					<view class="u-flex">
-						<view style="width: 8rpx;height: 34rpx;background: #0292FD;margin-right:20rpx;"></view>
-						{{item.brand}}合作品牌签约任务
-					</view>
+						<view class="u-flex">
+							<view style="width: 8rpx;height: 34rpx;background: #0292FD;margin-right:20rpx;"></view>
+							{{item.brand}}合作品牌签约任务
+						</view>
 						<view @click="delAgent(index)">
 							<u-icon name="close" color="#666666" size="36"></u-icon>
-				</view>
+						</view>
 					</view>
 				</view>
 				<view slot="body">
@@ -81,7 +82,8 @@
 							<u-icon name="order" size="36"></u-icon>
 						</view>
 						<u-radio-group v-model="item.taskNum" :disabled="item.disabledGroup" @change="changeRadiogroup(item)">
-							<u-radio @click.native.prevent="clickitem(item,i.signLv)" :label-disabled="i.labelDisabled" v-for="(i, index2) in tasknameList" :key="index2" :name="i.signLv">
+							<u-radio @click.native.prevent="clickitem(item,i.signLv)" :label-disabled="i.labelDisabled" v-for="(i, index2) in tasknameList"
+							 :key="index2" :name="i.signLv">
 								{{i.signLv}}
 							</u-radio>
 						</u-radio-group>
@@ -146,8 +148,8 @@
 				protocol: false,
 				querybrandList: [],
 				// brandList: [],
-				allbrandList:[],//弹出窗获取brand数组
-				checkedBrandlist:[]//选中brand组成一个新数组
+				allbrandList: [], //弹出窗获取brand数组
+				checkedBrandlist: [] //选中brand组成一个新数组
 			}
 		},
 		created() {
@@ -173,7 +175,7 @@
 						"area": this.formData.district,
 						"city": this.formData.city,
 						"province": this.formData.province,
-						// "area": "市北区",
+						// "area": "李沧区",
 						// "city": "青岛市",
 						// "province": "山东省",
 						"spart": "10",
@@ -184,7 +186,7 @@
 					if (res.data.code == 0) {
 						this.agentList = res.data.Data.data
 						this.agentList = this.agentList.reduce((res, item, index, array) => {
-							for (let i = 0; i < array[index].regionBrandList.length;i++) {
+							for (let i = 0; i < array[index].regionBrandList.length; i++) {
 								res.push({
 									brand: array[index].regionBrandList[i],
 									brandCode: array[index].regionBrandList[i],
@@ -193,7 +195,7 @@
 									agent_id: item.kunnr,
 									taskNum: "",
 									disabledGroup: false,
-									checked:false,
+									checked: false,
 								})
 							}
 							return res;
@@ -233,7 +235,7 @@
 				}).catch(err => {
 					console.log(err)
 				}).finally(() => {
-			
+
 				})
 			},
 			getQuerybrand() {
@@ -252,7 +254,7 @@
 				}).catch(err => {
 					console.log(err)
 				}).finally(() => {
-				
+
 				})
 			},
 			getTasknum() {
@@ -262,7 +264,7 @@
 					data: {},
 				}).then(res => {
 					if (res.data.code == 0) {
-						res.data.data.map((item, index)=> {
+						res.data.data.map((item, index) => {
 							item.checked = false;
 						})
 						this.tasknameList = res.data.data
@@ -280,7 +282,7 @@
 				this.cooperations = e
 			},
 			changeRadiogroup(item) {
-				if (item.checked==true) {
+				if (item.checked == true) {
 					this.checkedAgentlist.filter(e => (e.brand === item.brand && e.agent_id != item.agent_id)).forEach(e => e.disabledGroup =
 						false)
 				} else {
@@ -288,22 +290,22 @@
 						true)
 				}
 			},
-			clickitem (item,e) {
-				if(item.checked==false){
-					item.checked=true
-				}else{
-					item.checked=false
-					item.taskNum=""
+			clickitem(item, e) {
+				if (item.checked == false) {
+					item.checked = true
+				} else {
+					item.checked = false
+					item.taskNum = ""
 				}
 			},
 			getCooperation() {
 				if (this.cooperations != null) {
 					this.form.cooperation = this.cooperations.toString();
 					this.checkedAgentlist = this.agentList.filter(item => this.cooperations.indexOf(item.brand) > -1)
-					this.checkedBrandlist=this.checkedAgentlist.reduce((res, item, index, array) => {
-							res.push(item.brand)
-							return res;
-						}, []);
+					this.checkedBrandlist = this.checkedAgentlist.reduce((res, item, index, array) => {
+						res.push(item.brand)
+						return res;
+					}, []);
 					this.getQuerybrand()
 					this.brandShow = false
 				} else {
@@ -313,16 +315,16 @@
 			getTaskconfirm(e) {
 				this.form.tasklist = e[0].label;
 			},
-			delAgent(index){
-				this.checkedAgentlist.splice(index,1)
+			delAgent(index) {
+				this.checkedAgentlist.splice(index, 1)
 			},
 			submit() {
 				this.$refs.uForm.validate(valid => {
 					if (valid) {
-						this.brandAgentLvQueryList=this.checkedAgentlist.filter(item => (item.disabledGroup!=true))
-						let checkenLength=this.checkedAgentlist.filter(item => (item.checked==false))
-						if(!this.brandAgentLvQueryList.length) return this.$u.toast('未正确选择经销商,请正确选择');
-						if(checkenLength.length!=0) return this.$u.toast('请选择'+checkenLength[0].brand+"品牌签约任务");
+						this.brandAgentLvQueryList = this.checkedAgentlist.filter(item => (item.disabledGroup != true))
+						let checkenLength = this.checkedAgentlist.filter(item => (item.checked == false&&item.disabledGroup==false))
+						if (!this.brandAgentLvQueryList.length) return this.$u.toast('未正确选择经销商,请正确选择');
+						if (checkenLength.length != 0) return this.$u.toast('请选择' + checkenLength[0].brand + "品牌签约任务");
 						if (!this.protocol) return this.$u.toast('请阅读并同意用户协议和隐私协议');
 						this.setData()
 					} else {
@@ -360,7 +362,7 @@
 					"storePhone": this.formData.phone,
 					"version": 1.00,
 					"wd": this.formData.latitude,
-					"addressInfo":this.formData.addressInfo
+					"addressInfo": this.formData.addressInfo
 				}
 				this.loading = true
 				request({

+ 1 - 1
pages/me/Delivery-details/index.vue

@@ -98,7 +98,7 @@
 				loadText: {
 					loadmore: '无数据',
 					loading: '努力加载中',
-					nomore: '我是有底线的'
+					nomore: '没有更多啦'
 				},
 				style: '.5rpx solid #FFFFFF',
 				list: [{

+ 1 - 1
pages/me/Warehousing-details/index.vue

@@ -98,7 +98,7 @@
 				loadText: {
 					loadmore: '无数据',
 					loading: '努力加载中',
-					nomore: '我是有底线的'
+					nomore: '没有更多啦'
 				},
 				style: '.5rpx solid #FFFFFF',
 				list: [{

+ 1 - 1
pages/me/agent-stock/agent-stock.vue

@@ -76,7 +76,7 @@
 				loadText: {
 					loadmore: '轻轻上拉',
 					loading: '努力加载中',
-					nomore: '实在没有了'
+					nomore: '没有更多啦'
 				}
 			};
 		},

+ 1 - 1
unpackage/debug/.ios.ins

@@ -1 +1 @@
-forceInstall
+installed

BIN
unpackage/debug/android_debug.apk


+ 1 - 1
uview-ui/components/u-loadmore/u-loadmore.vue

@@ -78,7 +78,7 @@
 					return {
 						loadmore: '加载更多',
 						loading: '正在加载...',
-						nomore: '没有更多'
+						nomore: '没有更多'
 					}
 				}
 			},