地图bug修复
发布于 6 年前 作者 kpeng 17472 次浏览 来自 问答

之前出现的地图bug,第二组无法加载的问题,说修复好了,十点多查看一次确实好用,但是刚刚又不好用了,第二次又不出现了

4 回复

轮训,条件满足时会进行震动播放铃声及弹窗,第一次进这个页面都能实现,进入后面页面再返回后,只能震动和播放铃声,不能弹窗了

哎呀,看错问题了,抱歉,这是我另一个问题

地图那个后面又好用了,抱歉抱歉

机型的话,测试用的安卓机都没行,微信版本号6.6.6,情况的话,代码很长,还涉及数据库给你粘贴下吧

getOrderLength: function () {

var that = this;

var interval2 = that.data.interval2

interval2 = setInterval(function () {

that.setData({

interval2: interval2

})

wx.request({

url: api + ‘/selectNearbyOrder’,

method: ‘POST’,

data: {

driverid: app.globalData.userid

},

header: {

“Content-Type”: “application/x-www-form-urlencoded”

},

success: function (res) {

that.setData({

ordersAllTypeList: res.data.ordersAllTypeList,

// driverOrderListOk: res.data.driverOrderListOk

})

var isNew = false

var obj =app.globalData.obj

var valetObj = app.globalData.objValet

var errObj = app.globalData.objErr

var orderList = res.data.ordersAllTypeList

var index =-1

for(let i=0;i<orderList.length;i++){

var key = orderList[i].orderId

if(orderList[i].type===0){

if(obj.length>0){

for (let j = 0; j < obj.length; j++) {

if(key>obj[obj.length-1]){

isNew=true

obj.push(key)

break

}

}

}else{

isNew=true            

obj.push(key)

}

}else if(orderList[i].type===1){

if (valetObj.length > 0) {

for (let j = 0; j < valetObj.length; j++) {

if (key > valetObj[valetObj.length - 1]) {

isNew = true

valetObj.push(key)

break

}

}

} else {

isNew = true

valetObj.push(key)

}

} else if (orderList[i].type===2){

if (errObj.length > 0) {

for (let j = 0; j < errObj.length; j++) {

if (key > errObj[errObj.length - 1]) {

isNew = true

errObj.push(key)

break

}

}

} else {

isNew = true

errObj.push(key)

}

}

if(isNew){

index = i

indexChoose=i

that.setData({

src: app.globalData.musicSrc

})

const innerAudioContext = wx.createInnerAudioContext()

innerAudioContext.autoplay = true

innerAudioContext.src = app.globalData.musicSrc

innerAudioContext.onPlay(() => {

})

innerAudioContext.onError((res) => {

console.log(res)

})

// this.audioCtx = wx.createAudioContext(‘myAudio’)        

// this.audioCtx.play()

wx.vibrateLong({

success: function (res) {

}

})

var from_address = res.data.ordersAllTypeList[i].from_address

var to_address = res.data.ordersAllTypeList[i].to_address

var longitude = res.data.ordersAllTypeList[i].longitude

var dimension = res.data.ordersAllTypeList[i].dimension

var to_longitude = res.data.ordersAllTypeList[i].to_longitude

var to_dimension = res.data.ordersAllTypeList[i].to_dimension

var type2 = res.data.ordersAllTypeList[i].type

var orderType = res.data.ordersAllTypeList[i].order_type

var orderId = res.data.ordersAllTypeList[i].orderId

var amount = res.data.ordersAllTypeList[i].amount

var carSharingValuation = app.globalData.errandValuation

var taxiValuation = app.globalData.errandValuation

var valetDriverValuation = app.globalData.errandValuation

var errandValuation = app.globalData.errandValuation

console.log(res.data.ordersAllTypeList[i].totalMiles)

that.setData({

type2: type2,

orderType: orderType,

from: from_address,

to: to_address,

price: amount ,

showModal: true            

})

console.log(that.data.showModal)

var latitudeNow3 = ‘’

var key = config.Config.key;

var myAmapFun = new amapFile.AMapWX({ key: key });

myAmapFun.getRegeo({

success: function (data) {

latitudeNow3 = data[0].latitude

var longitudeNow = data[0].longitude

var latitudeNow4 = longitudeNow + ‘,’ + latitudeNow3;

var latitudeNow2 = to_longitude + ‘,’ + to_dimension

//  var key = config.Config.key;

//  var myAmapFun = new amapFile.AMapWX({ key: key });

myAmapFun.getDrivingRoute({

origin: latitudeNow4,

destination: latitudeNow2,

success: function (data) {

console.log(data)

var mile = data.paths[0].distance / 1000

that.setData({

mile: mile.toFixed(2),

})

}

})

//    orderLength = res.data.ordersAllTypeList.length

}

})

break

}

}

}

})

if (app.globalData.driverState === 0) {

clearInterval(that.data.interval)

clearInterval(that.data.interval2)

}

}, 5000)

},

WXML:

<view class=“container”>

<view class=‘container-footer’>

<view class=“swiper-tab”>

<view class=“swiper-tab-item {{currentTab==0 ? ‘on’ : ‘’}}” data-current=“0” bindtap=“swichNav”>未接订单</view>

<view class=“swiper-tab-item {{currentTab==1 ? ‘on’ : ‘’}}” data-current=“1” bindtap=“swichNav”>正在进行订单</view>

</view>

</view>

<view class=‘container-body’>

<view class=‘modol’ bindtap=‘hideModal’ wx:if="{{showModal}}"></view>

<view class=“modalDlg” wx:if="{{showModal}}">

<audio  src="{{src}}" id=“myAudio” controls="{{false}}" loop="{{false}}"></audio>

<view class=‘modalDlg-top’>

<view class=‘top-bz’>

<image src=’{{src}}’ style=‘widt:60rpx;height:60rpx;’></image>

</view>

<view class=‘top-title’>

<view style=‘font-size:28rpx;’>路程{{mile}}公里</view>

<view wx:if="{{type2==0 && orderType==0}}" style=‘font-size:24rpx;color:#f2f2f2’>

<text style=‘font-size:24rpx;color:#ff8800’>拼车约{{price}}元</text>

</view>

<view wx:if="{{type2==0 && orderType==1}}">

<text style=‘font-size:24rpx;color:#ff8800’>不拼车约{{price}}元</text>

</view>

<view wx:if="{{type2!=0}}">

<text style=‘font-size:24rpx;color:#ff8800’>约{{price}}元</text>

</view>

</view>

<view class=‘top-cha’ bindtap=‘hideModal’>

<image src="…/…/…/…/images/close.png" style=‘width:30rpx;height:30rpx;’></image>

</view>

</view>

<view class=‘modalDlg-mid’>

<view class=‘midd-on’>

<image src="…/…/…/…/images/toPassenger.png" style=‘width:24rpx;height:32rpx;’></image>

<text class=‘fromTo’ style=‘margin-left:20rpx;’>{{from}}</text>

</view>

<view class=‘midd-under’ style=‘margin-top:30rpx;’>

<image src=’…/…/…/…/images/fromPassenger.png’ style=‘width:24rpx;height:32rpx;’></image>

<text class=‘fromTo’ style=‘margin-left:20rpx;’>{{to}}</text>

</view>

</view>

<view class=‘button’ bindtap=“getOrder”>接单</view>

</view>

<swiper current="{{currentTab}}" class=“swiper-box” duration=“300” style=“height:{{winHeight}}px” bindchange=“bindChange”>

<swiper-item>

<scroll-view scroll-y=“true” style=“height:100%;background-color:#eee”>

<block wx:for="{{ordersAllTypeList}}">

<view class=“main” bindtap=“toGetOrder” data-type="{{item.type}}" data-orderType="{{item.order_type}}" data-from="{{item.from_address}}" data-to="{{item.to_address}}" data-index="{{index}}">

<view class=“top”>

<view class=“top-left”>

<text wx:if="{{item.type==0}}" style=‘font-size:30rpx;’>乘客单</text>

<text wx:if="{{item.type==1}}" style=‘font-size:30rpx;’>代驾单</text>

<text wx:if="{{item.type==2}}" style=‘font-size:30rpx;’>跑腿单</text>

</view>

<view class=‘top-right’>

<view class=‘arrow’></view>

</view>

</view>

<view class=“middle”>

<view class=“middle-time”>

<text style=‘font-size:24rpx;’>{{item.create_order_time}}</text>

</view>

<view class=‘middle-pr’>

<view wx:if="{{item.type==0 && item.order_type==0}}">

<text style=‘font-size:24rpx;color:#ff8800’>拼车约{{item.amount}}元</text>

</view>

<view wx:if="{{item.type==0 && item.order_type==1}}">

<text style=‘font-size:24rpx;color:#ff8800’>不拼车约{{item.amount}}元</text>

</view>

<view wx:if="{{item.type!=0}}">

<text style=‘font-size:24rpx;color:#ff8800’>约{{item.amount}}元</text>

</view>

</view>

</view>

<view class=“bot”>

<view class=“bot-top”>

<view style=‘padding-left:20rpx;’>

<image src=’…/…/…/…/images/trip_start.png’ style=‘width:12rpx;height:12rpx;’ mode=‘scaleToFill’></image>

</view>

<view style=‘padding-left:10rpx;’>

<text style=‘font-size:26rpx;’>{{item.from_address}}</text>

</view>

</view>

<view class=“bot-mid”>

<view style=‘padding-left:20rpx;’>

<image src=’…/…/…/…/images/trip_start.png’ style=‘width:12rpx;height:12rpx;’ mode=‘scaleToFill’></image>

</view>

<view style=‘padding-left:10rpx;’>

<text style=‘font-size:26rpx;’>{{item.to_address}}</text>

</view>

</view>

<view class=“bot-bot”>

<text style=‘font-size:24rpx;color:#999999;’></text>

</view>

</view>

</view>

</block>

</scroll-view>

</swiper-item>

<swiper-item>

<scroll-view scroll-y=“true” style=“height:{{winHeight}}px;background-color:#eee”>

<block wx:for="{{driverOrderListOk}}">

<view class=“main” bindtap=“toOtherPage” data-index="{{index}}">

<view class=“top”>

<view class=“top-left”>

<text wx:if="{{item.type==0}}" style=‘font-size:30rpx;’>乘客单</text>

<text wx:if="{{item.type==1}}" style=‘font-size:30rpx;’>代驾单</text>

<text wx:if="{{item.type==2}}" style=‘font-size:30rpx;’>跑腿单</text>

</view>

<view class=‘top-right’>

<view class=‘arrow’></view>

</view>

</view>

<view class=“middle”>

<view class=“middle-time”>

<text style=‘font-size:24rpx;’>{{item.create_order_time}}</text>

</view>

<view class=‘middle-pr’>

<view wx:if="{{item.type==0 && item.order_type==0}}">

<text style=‘font-size:24rpx;color:#ff8800’>拼车约{{item.amount}}元</text>

</view>

<view wx:if="{{item.type==0 && item.order_type==1}}">

<text style=‘font-size:24rpx;color:#ff8800’>不拼车约{{item.amount}}元</text>

</view>

<view wx:if="{{item.type!=0}}">

<text style=‘font-size:24rpx;color:#ff8800’>约{{item.amount}}元</text>

</view>

</view>

</view>

<view class=“bot”>

<view class=“bot-top”>

<view style=‘padding-left:20rpx;’>

<image src=’…/…/…/…/images/trip_start.png’ style=‘width:12rpx;height:12rpx;’ mode=‘scaleToFill’></image>

</view>

<view style=‘padding-left:10rpx;’>

<text style=‘font-size:26rpx;’>{{item.from_address}}</text>

</view>

</view>

<view class=“bot-mid”>

<view style=‘padding-left:20rpx;’>

<image src=’…/…/…/…/images/trip_start.png’ style=‘width:12rpx;height:12rpx;’ mode=‘scaleToFill’></image>

</view>

<view style=‘padding-left:10rpx;’>

<text style=‘font-size:26rpx;’>{{item.to_address}}</text>

</view>

</view>

<view class=“bot-bot”>

<view wx:if="{{item.type==2}}">

<text style=‘font-size:24rpx;color:#999999;’>{{item.goods_instruction}}</text>

</view>

</view>

</view>

</view>

</block>

</scroll-view>

</swiper-item>

</swiper>

</view>

</view>

<view class=‘container-footer’>

<view class=‘bottom’ bindtap=“tackOffCar”>

<text>收车</text>

</view>

</view>

回到顶部