瀏覽代碼

扫码调整

zhengkaixin 6 天之前
父節點
當前提交
e228be2712

+ 1 - 1
apis/utils/AMap.js

@@ -9,7 +9,7 @@ export default function MapLoader() {
 			var script = document.createElement('script')
 			script.type = 'text/javascript'
 			script.async = true
-			script.src = 'https://webapi.amap.com/maps?v=1.4.15&callback=initAMap&key=de735ff06aec63f6bc109c9fb805fc3d'
+			script.src = 'https://webapi.amap.com/maps?v=1.4.15&callback=initAMap&key=09abadb2e35fc61fd84042c518e9aebf'
 			script.onerror = reject
 			document.head.appendChild(script)
 		}

+ 5 - 2
apis/utils/init.js

@@ -12,9 +12,12 @@ var openId = jphelp.getOpenId();
  var app = {
 
 	init: function() {
-
 		
-		if (isWeiXin() || (process.env.NODE_ENV === "development")) {
+		if( (process.env.NODE_ENV === "development")){
+			openId=process.jphelp.openId
+			jphelp.setOpenId(process.jphelp.openId)
+			this.getPersion(openId)
+		}else if (isWeiXin() || (process.env.NODE_ENV === "development")) {
 
 			if (checkOpenId) {
 				 if (!openId) {

+ 13 - 2
components/Tabbar.vue

@@ -95,7 +95,7 @@
 					var chargingStation=response.data.chargingStation
 					if(chargingStation){
 						uni.navigateTo({
-							url:"/pages/inspection/add?stationId="+chargingStation.id
+							url:"/pages/inspection/add?back=1&stationId="+chargingStation.id
 						})
 					}else{
 						uni.showToast({
@@ -137,7 +137,18 @@
 					}else{
 						gunId=res
 					}
-					this.findStationByGun(gunId)
+					
+					if(url&&url.indexOf("stationId=")>-1){
+						var stationId=url.split("stationId=")[1]
+						
+						uni.navigateTo({
+							url:"/pages/inspection/add?back=1&stationId="+stationId
+						})
+						
+					}else{
+						this.findStationByGun(gunId)
+					}
+					
 					
 				}).catch(error => {
 							

+ 2 - 2
config/.env.dev.js

@@ -16,8 +16,8 @@ const UNI_APP = {
 
 	
 	openId:"123456",
-	openId:"oSruR6YkhP7QDroLnZGxWis43Kn0",
-	//openId:"oSruR6fYa0yzdMsDinzNOlePTotk",
+	//openId:"oSruR6YkhP7QDroLnZGxWis43Kn0",
+	openId:"oSruR6fYa0yzdMsDinzNOlePTotk",
 	//appid
 	//VUE_APP_WXAPPID:"wxa9f555dc92a1cbfc",
 	VUE_APP_WXAPPID:"wxca33ab204e738ca4",

+ 7 - 2
pages/inspection/add.vue

@@ -1,6 +1,7 @@
 <template>
 	<view class="jpmain  ">
-		<u-navbar title="维修结果" title-color="#101010"></u-navbar>
+		<u-navbar title="站点巡检"  :bkUrl="!isBack?'/pages/index/index':''"
+		 title-color="#101010"></u-navbar>
 
 		<u-picker mode="time" v-model="inspectionTimeShow" @confirm="inspectionTimeConfirm"
 			:default-time="taskInfo.inspectionTime" :params="params"></u-picker>
@@ -212,7 +213,8 @@
 					
 				],
 				contentList:[],
-				submitcontent:[]
+				submitcontent:[],
+				isBack:false,
 			};
 		},
 		onLoad(op) {
@@ -232,6 +234,9 @@
 			}
 			this.taskInfo.inspectionTime = parseUnixTime(currentTimeStamp())
 			this.errDetails()
+			if(op.back){
+				this.isBack=op.back
+			}
 			
 		
 			

+ 1 - 1
pages/inspection/list.vue

@@ -199,7 +199,7 @@
 			gotoTask(k){
 				if(k.status==0){
 					uni.navigateTo({
-					  url: '/pages/inspection/add?stationId='+k.stationId,
+					  url: '/pages/inspection/add?back=1&stationId='+k.stationId,
 					  events: {
 					    // 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据
 					    acceptDataFromOpenerPage: (data)=>{

+ 1 - 1
pages/station/stationInfo.vue

@@ -46,7 +46,7 @@
 			</view>
 		</view>
 		<view class="panel main2_panel">
-			<view class="p1"  @click="gotoUrl('/pages/inspection/add?stationId='+id)" >
+			<view class="p1"  @click="gotoUrl('/pages/inspection/add?back=1&stationId='+id)" >
 				<view class="na-img">
 					<image class="img" src="@/assets/img/station/index2.svg" mode=""></image>
 				</view>

+ 17 - 13
uni_modules/uview-ui/components/u-navbar/u-navbar.vue

@@ -169,6 +169,10 @@
 				type: [String, Number],
 				default: ''
 			},
+			bkUrl:{
+				type: [String, Number],
+				default: ''
+			},
 			// 自定义返回逻辑
 			customBack: {
 				type: Function,
@@ -247,22 +251,22 @@
 			},
 			goBack() {
 			
-				if ('prodv4'==process.jphelp.NODE_ENV) {
-					
-					window.history.back()
-					
+				//console.log("修复bug, 刷新后不能返回问题")
+				
+				if(this.bkUrl){
+						uni.switchTab({
+							url:this.bkUrl
+						})
+				}
+				// 如果自定义了点击返回按钮的函数,则执行,否则执行返回逻辑
+				else if (typeof this.customBack === 'function') {
+					// 在微信,支付宝等环境(H5正常),会导致父组件定义的customBack()函数体中的this变成子组件的this
+					// 通过bind()方法,绑定父组件的this,让this.customBack()的this为父组件的上下文
+					this.customBack.bind(this.$u.$parent.call(this))();
 				} else {
-					// 如果自定义了点击返回按钮的函数,则执行,否则执行返回逻辑
-					if (typeof this.customBack === 'function') {
-						// 在微信,支付宝等环境(H5正常),会导致父组件定义的customBack()函数体中的this变成子组件的this
-						// 通过bind()方法,绑定父组件的this,让this.customBack()的this为父组件的上下文
-						this.customBack.bind(this.$u.$parent.call(this))();
-					} else {
-						this.navberBack();
-					}
+					this.navberBack();
 				}
 
-
 			}
 		}
 	};