|
@@ -2,17 +2,22 @@
|
|
// 获取应用实例
|
|
// 获取应用实例
|
|
//获取应用实例
|
|
//获取应用实例
|
|
// const log = require('../../utils/log')
|
|
// const log = require('../../utils/log')
|
|
-const { getCache, setCache, CacheKeys } = require('../../utils/cache')
|
|
|
|
|
|
+const {
|
|
|
|
+ getCache,
|
|
|
|
+ setCache,
|
|
|
|
+ CacheKeys
|
|
|
|
+} = require('../../utils/cache')
|
|
const app = getApp();
|
|
const app = getApp();
|
|
-var token = my.getStorageSync({ 'key': 'token' }).data;
|
|
|
|
|
|
+var token = my.getStorageSync({
|
|
|
|
+ 'key': 'token'
|
|
|
|
+}).data;
|
|
const util = require('../../utils/utils.js');
|
|
const util = require('../../utils/utils.js');
|
|
//const { content } = require('/utils/dataTransition.js');
|
|
//const { content } = require('/utils/dataTransition.js');
|
|
var mytime = null;
|
|
var mytime = null;
|
|
let testToken = ''
|
|
let testToken = ''
|
|
Page({
|
|
Page({
|
|
data: {
|
|
data: {
|
|
- cardBottom: [
|
|
|
|
- {
|
|
|
|
|
|
+ cardBottom: [{
|
|
id: 1,
|
|
id: 1,
|
|
name: '故障上报',
|
|
name: '故障上报',
|
|
icon: 'icon-banshou',
|
|
icon: 'icon-banshou',
|
|
@@ -38,7 +43,7 @@ Page({
|
|
url: '/pages/mine/mine'
|
|
url: '/pages/mine/mine'
|
|
}
|
|
}
|
|
],
|
|
],
|
|
- adFrame: false,//首页中间广告弹框
|
|
|
|
|
|
+ adFrame: false, //首页中间广告弹框
|
|
markers: [], //显示单车、停车的P
|
|
markers: [], //显示单车、停车的P
|
|
polygons: [], //区域
|
|
polygons: [], //区域
|
|
longitude: '', //113.786111
|
|
longitude: '', //113.786111
|
|
@@ -54,8 +59,8 @@ Page({
|
|
userStatus: '', //用户的一些状态 是否交押金等 0
|
|
userStatus: '', //用户的一些状态 是否交押金等 0
|
|
scanfail: false, //扫码失败弹窗
|
|
scanfail: false, //扫码失败弹窗
|
|
is_pay_order: false, //检测当前是否有订单未支付
|
|
is_pay_order: false, //检测当前是否有订单未支付
|
|
- is_ride_order: false,//是否有骑行中订单
|
|
|
|
- is_punishment: false,//有违章订单
|
|
|
|
|
|
+ is_ride_order: false, //是否有骑行中订单
|
|
|
|
+ is_punishment: false, //有违章订单
|
|
code: '', //点击立即用车 把编号赋值给code
|
|
code: '', //点击立即用车 把编号赋值给code
|
|
over: false, //关闭图标
|
|
over: false, //关闭图标
|
|
over1: false, //扫码失败关闭图标
|
|
over1: false, //扫码失败关闭图标
|
|
@@ -63,8 +68,8 @@ Page({
|
|
screenHeight: '', //屏幕可视高度
|
|
screenHeight: '', //屏幕可视高度
|
|
box_no: '', //中控编号
|
|
box_no: '', //中控编号
|
|
abnormal: '', //提示账号异常
|
|
abnormal: '', //提示账号异常
|
|
- mid: [],//顶部广告
|
|
|
|
- ads: [],//首页中间广告
|
|
|
|
|
|
+ mid: [], //顶部广告
|
|
|
|
+ ads: [], //首页中间广告
|
|
currentSwiper: 0,
|
|
currentSwiper: 0,
|
|
center_currentSwiper: 0,
|
|
center_currentSwiper: 0,
|
|
bike_no: undefined,
|
|
bike_no: undefined,
|
|
@@ -73,7 +78,7 @@ Page({
|
|
notice: [], //公告内容
|
|
notice: [], //公告内容
|
|
animationData: {},
|
|
animationData: {},
|
|
tabbar_index: 0,
|
|
tabbar_index: 0,
|
|
- zoom: 18,
|
|
|
|
|
|
+ zoom: 12,
|
|
versions: false, //版本过低弹窗
|
|
versions: false, //版本过低弹窗
|
|
chooseSize: false,
|
|
chooseSize: false,
|
|
animationData1: {},
|
|
animationData1: {},
|
|
@@ -83,19 +88,32 @@ Page({
|
|
marqueeDistance: 520, //初始滚动距离 用到
|
|
marqueeDistance: 520, //初始滚动距离 用到
|
|
size: 26, //通知公告用到
|
|
size: 26, //通知公告用到
|
|
marqueeWidth: 560, //通知公告用到
|
|
marqueeWidth: 560, //通知公告用到
|
|
- length: '',//通知公告
|
|
|
|
|
|
+ length: '', //通知公告
|
|
swiperCurrent: 0,
|
|
swiperCurrent: 0,
|
|
midbolear: '',
|
|
midbolear: '',
|
|
per_money: '',
|
|
per_money: '',
|
|
img: app.globalData.imgUrl,
|
|
img: app.globalData.imgUrl,
|
|
new_user_coupons: [],
|
|
new_user_coupons: [],
|
|
- scanCodeErr: false,//扫码失败弹框
|
|
|
|
- isScan: false
|
|
|
|
|
|
+ scanCodeErr: false, //扫码失败弹框
|
|
|
|
+ isScan: false,
|
|
|
|
+ centerLon: '', //地图中心点经纬度
|
|
|
|
+ centerLat: '', //地图中心点经纬度
|
|
|
|
+ localSearchStop: app.globalData.localSearchStop, //是否开启使用当前位置查询还车点
|
|
|
|
+ bikeMarker: [], //当前车辆位置的mark
|
|
|
|
+ mapCtx:''
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ onReady() {
|
|
|
|
+ // 使用 my.createMapContext 获取 map 上下文
|
|
|
|
+ this.mapCtx = my.createMapContext('map');
|
|
},
|
|
},
|
|
|
|
|
|
onLoad: function (query) {
|
|
onLoad: function (query) {
|
|
var that = this;
|
|
var that = this;
|
|
- console.log(my.getStorageSync({ 'key': 'token' }).data, 'yyyyyyyyyyyyyyy')
|
|
|
|
|
|
+ console.log(my.getStorageSync({
|
|
|
|
+ 'key': 'token'
|
|
|
|
+ }).data, 'yyyyyyyyyyyyyyy')
|
|
my.setNavigationBar({
|
|
my.setNavigationBar({
|
|
title: app.globalData.title
|
|
title: app.globalData.title
|
|
})
|
|
})
|
|
@@ -110,11 +128,19 @@ Page({
|
|
my.setNavigationBar({
|
|
my.setNavigationBar({
|
|
title: app.globalData.title
|
|
title: app.globalData.title
|
|
})
|
|
})
|
|
- token = my.getStorageSync({ 'key': 'token' }).data
|
|
|
|
|
|
+ token = my.getStorageSync({
|
|
|
|
+ 'key': 'token'
|
|
|
|
+ }).data
|
|
|
|
+ let home = my.setStorageSync({
|
|
|
|
+ 'key': 'home'
|
|
|
|
+ }).data
|
|
this.setData({
|
|
this.setData({
|
|
show: false,
|
|
show: false,
|
|
- midbolear: my.getStorageSync({ 'key': 'midTimes' }).data,
|
|
|
|
- polygons: []
|
|
|
|
|
|
+ midbolear: my.getStorageSync({
|
|
|
|
+ 'key': 'midTimes'
|
|
|
|
+ }).data,
|
|
|
|
+ polygons: [],
|
|
|
|
+ zoom: home && home.zoom ? home.zoom : 12
|
|
})
|
|
})
|
|
if (!this.data.isScan) {
|
|
if (!this.data.isScan) {
|
|
app.login().then(res => {
|
|
app.login().then(res => {
|
|
@@ -151,7 +177,7 @@ Page({
|
|
if (isCache) {
|
|
if (isCache) {
|
|
if (isCache == '') return
|
|
if (isCache == '') return
|
|
if (isCache instanceof Object && isCache.hasOwnProperty('header')) {
|
|
if (isCache instanceof Object && isCache.hasOwnProperty('header')) {
|
|
-
|
|
|
|
|
|
+
|
|
|
|
|
|
that.setData({
|
|
that.setData({
|
|
ads: isCache.header
|
|
ads: isCache.header
|
|
@@ -253,7 +279,9 @@ Page({
|
|
let isCache = getCache('Notice:' + id)
|
|
let isCache = getCache('Notice:' + id)
|
|
if (isCache) {
|
|
if (isCache) {
|
|
if (isCache instanceof Object && !isCache.hasOwnProperty('id')) return
|
|
if (isCache instanceof Object && !isCache.hasOwnProperty('id')) return
|
|
- this.setData({ notice: isCache })
|
|
|
|
|
|
+ this.setData({
|
|
|
|
+ notice: isCache
|
|
|
|
+ })
|
|
var length = isCache.description.length * this.data.size; //计算文字的长度
|
|
var length = isCache.description.length * this.data.size; //计算文字的长度
|
|
this.setData({
|
|
this.setData({
|
|
length: length
|
|
length: length
|
|
@@ -273,7 +301,9 @@ Page({
|
|
console.log(res)
|
|
console.log(res)
|
|
if (200 == res.status && res.data.id) {
|
|
if (200 == res.status && res.data.id) {
|
|
setCache('Notice:' + id, res.data)
|
|
setCache('Notice:' + id, res.data)
|
|
- this.setData({ notice: res.data })
|
|
|
|
|
|
+ this.setData({
|
|
|
|
+ notice: res.data
|
|
|
|
+ })
|
|
var length = res.data.description.length * this.data.size; //计算文字的长度
|
|
var length = res.data.description.length * this.data.size; //计算文字的长度
|
|
this.setData({
|
|
this.setData({
|
|
length: length
|
|
length: length
|
|
@@ -320,8 +350,8 @@ Page({
|
|
console.log('经纬度为:+++++++++++++++++++++' + res.latitude + '++++++++' + res.longitude)
|
|
console.log('经纬度为:+++++++++++++++++++++' + res.latitude + '++++++++' + res.longitude)
|
|
my.hideLoading()
|
|
my.hideLoading()
|
|
that.setData({
|
|
that.setData({
|
|
- longitude: res.longitude,
|
|
|
|
- latitude: res.latitude
|
|
|
|
|
|
+ centerLon: res.longitude,
|
|
|
|
+ centerLat: res.latitude
|
|
})
|
|
})
|
|
},
|
|
},
|
|
fail: function (err) {
|
|
fail: function (err) {
|
|
@@ -333,7 +363,9 @@ Page({
|
|
|
|
|
|
},
|
|
},
|
|
fail: (error) => {
|
|
fail: (error) => {
|
|
- my.alert({ content: '获取位置授权失败' });
|
|
|
|
|
|
+ my.alert({
|
|
|
|
+ content: '获取位置授权失败'
|
|
|
|
+ });
|
|
},
|
|
},
|
|
});
|
|
});
|
|
}
|
|
}
|
|
@@ -355,16 +387,17 @@ Page({
|
|
}, 1000),
|
|
}, 1000),
|
|
//点击扫描二维码
|
|
//点击扫描二维码
|
|
sweepCode: util.throttle(function () {
|
|
sweepCode: util.throttle(function () {
|
|
- let that = this
|
|
|
|
- console.log('点击扫码,‘iooooo')
|
|
|
|
- if (!that.data.latitude && !that.data.longitude) {
|
|
|
|
- that.setData({
|
|
|
|
- background: true,
|
|
|
|
- location: true
|
|
|
|
- })
|
|
|
|
- } else {
|
|
|
|
- that.sweep_code()
|
|
|
|
- }
|
|
|
|
|
|
+ this.sweep_code()
|
|
|
|
+ // let that = this
|
|
|
|
+ // console.log('点击扫码,‘iooooo')
|
|
|
|
+ // if (!that.data.latitude && !that.data.longitude) {
|
|
|
|
+ // that.setData({
|
|
|
|
+ // background: true,
|
|
|
|
+ // location: true
|
|
|
|
+ // })
|
|
|
|
+ // } else {
|
|
|
|
+ // that.sweep_code()
|
|
|
|
+ // }
|
|
}, 1500),
|
|
}, 1500),
|
|
//骑行区禁停区车辆
|
|
//骑行区禁停区车辆
|
|
home: function () {
|
|
home: function () {
|
|
@@ -381,8 +414,6 @@ Page({
|
|
console.log(res)
|
|
console.log(res)
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
var data = res.data;
|
|
var data = res.data;
|
|
- data.width = 1
|
|
|
|
- data.strokeWidth =1
|
|
|
|
console.log(data, '区域')
|
|
console.log(data, '区域')
|
|
let id = data.id
|
|
let id = data.id
|
|
this.getNotice(id)
|
|
this.getNotice(id)
|
|
@@ -392,14 +423,17 @@ Page({
|
|
polygons1: that.data.polygons.concat(data),
|
|
polygons1: that.data.polygons.concat(data),
|
|
setting: data.setting,
|
|
setting: data.setting,
|
|
per_money: Number(data.setting.starting_price),
|
|
per_money: Number(data.setting.starting_price),
|
|
- polygons: []
|
|
|
|
|
|
+ polygons: that.data.polygons.concat(data),
|
|
|
|
+ zoom: data.zoom ? data.zoom : 12
|
|
})
|
|
})
|
|
if (!data.id) return
|
|
if (!data.id) return
|
|
|
|
|
|
- that.adsList(data.id),
|
|
|
|
- that.ban_stop(data.id), that.setData({
|
|
|
|
- polygons: that.data.polygons.concat(data)
|
|
|
|
- })
|
|
|
|
|
|
+ that.adsList(data.id)
|
|
|
|
+ //原获取全部还车点接口
|
|
|
|
+ if (that.data.localSearchStop == false) that.ban_stop(data.id)
|
|
|
|
+ //根据位置请求区域
|
|
|
|
+ if (that.data.localSearchStop == true) that.searchStopArea(that.data.longitude, that.data.latitude)
|
|
|
|
+
|
|
}
|
|
}
|
|
if (res.status == 423) {
|
|
if (res.status == 423) {
|
|
my.getLocation({
|
|
my.getLocation({
|
|
@@ -422,14 +456,24 @@ Page({
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
- my.setStorageSync({ 'key': 'home', data: data })
|
|
|
|
|
|
+ my.setStorageSync({
|
|
|
|
+ 'key': 'home',
|
|
|
|
+ data: data
|
|
|
|
+ })
|
|
}
|
|
}
|
|
if (data) {
|
|
if (data) {
|
|
- my.setStorageSync({ 'key': 'setting', data: data.setting })
|
|
|
|
|
|
+ my.setStorageSync({
|
|
|
|
+ 'key': 'setting',
|
|
|
|
+ data: data.setting
|
|
|
|
+ })
|
|
|
|
|
|
} else {
|
|
} else {
|
|
- my.removeStorageSync({ key: 'setting' })
|
|
|
|
- my.removeStorageSync({ key: 'home' })
|
|
|
|
|
|
+ my.removeStorageSync({
|
|
|
|
+ key: 'setting'
|
|
|
|
+ })
|
|
|
|
+ my.removeStorageSync({
|
|
|
|
+ key: 'home'
|
|
|
|
+ })
|
|
}
|
|
}
|
|
|
|
|
|
}).catch(err => {
|
|
}).catch(err => {
|
|
@@ -445,6 +489,35 @@ Page({
|
|
})
|
|
})
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ regionchange: function (e) {
|
|
|
|
+ if (this.data.localSearchStop == false) return
|
|
|
|
+ if (e.type == 'end') {
|
|
|
|
+ this.searchStopArea(e.longitude, e.latitude)
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ //添加定位点,并展示周围还车点
|
|
|
|
+ searchStopArea: function (longitude, latitude) {
|
|
|
|
+ let home = my.getStorageSync({
|
|
|
|
+ 'key': 'home'
|
|
|
|
+ }).data
|
|
|
|
+ if (!home || !home.id) return
|
|
|
|
+ let params = {
|
|
|
|
+ 'lat': latitude,
|
|
|
|
+ 'lng': longitude,
|
|
|
|
+ 'area_id':home.id,
|
|
|
|
+ }
|
|
|
|
+ console.log(this.data.polygons)
|
|
|
|
+ app.request('/parking/nearby-all', params, 'GET').then(res => {
|
|
|
|
+ console.log('根据位置获取区域', res)
|
|
|
|
+ let arr = [home]
|
|
|
|
+ this.setData({
|
|
|
|
+ markers: this.data.bikeMarker.concat(res.data.points),
|
|
|
|
+ polygons: arr.concat(res.data.polygons),
|
|
|
|
+ centerLat:latitude,
|
|
|
|
+ centerLon:longitude
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ },
|
|
//停车区域
|
|
//停车区域
|
|
ban_stop: function (id) {
|
|
ban_stop: function (id) {
|
|
var that = this;
|
|
var that = this;
|
|
@@ -528,7 +601,9 @@ Page({
|
|
}, 1500),
|
|
}, 1500),
|
|
// //点击去实名认证
|
|
// //点击去实名认证
|
|
authentication: util.throttle(function () {
|
|
authentication: util.throttle(function () {
|
|
- var state = my.getStorageSync({ 'key': 'userState' }).data
|
|
|
|
|
|
+ var state = my.getStorageSync({
|
|
|
|
+ 'key': 'userState'
|
|
|
|
+ }).data
|
|
if (state.is_bind_mobile == 1) {
|
|
if (state.is_bind_mobile == 1) {
|
|
my.navigateTo({
|
|
my.navigateTo({
|
|
url: '/pages/real_name/real_name?state1=1&index=0',
|
|
url: '/pages/real_name/real_name?state1=1&index=0',
|
|
@@ -549,35 +624,41 @@ Page({
|
|
var that = this;
|
|
var that = this;
|
|
console.log('ooooooo')
|
|
console.log('ooooooo')
|
|
var userStatus = that.data.userStatus;
|
|
var userStatus = that.data.userStatus;
|
|
- var setting = my.getStorageSync({ 'key': 'setting' }).data
|
|
|
|
|
|
+ var setting = my.getStorageSync({
|
|
|
|
+ 'key': 'setting'
|
|
|
|
+ }).data
|
|
if (!setting) {
|
|
if (!setting) {
|
|
my.alert({
|
|
my.alert({
|
|
title: '提示',
|
|
title: '提示',
|
|
content: '您附近暂无运营区,暂不可用车'
|
|
content: '您附近暂无运营区,暂不可用车'
|
|
})
|
|
})
|
|
} else {
|
|
} else {
|
|
- if (!userStatus) {
|
|
|
|
- my.navigateTo({
|
|
|
|
- url: '/pages/authorization/authorization',
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- that.jiance('scan');
|
|
|
|
- }
|
|
|
|
|
|
+ that.jiance('scan');
|
|
|
|
+ // if (!userStatus) {
|
|
|
|
+ // my.navigateTo({
|
|
|
|
+ // url: '/pages/authorization/authorization',
|
|
|
|
+ // })
|
|
|
|
+ // } else {
|
|
|
|
+ // that.jiance('scan');
|
|
|
|
+ // }
|
|
}
|
|
}
|
|
}, 1500),
|
|
}, 1500),
|
|
//扫码用车检测不可用车条件
|
|
//扫码用车检测不可用车条件
|
|
jiance: function (source) {
|
|
jiance: function (source) {
|
|
var that = this;
|
|
var that = this;
|
|
var userStatus = that.data.userStatus;
|
|
var userStatus = that.data.userStatus;
|
|
- var setting = my.getStorageSync({ 'key': 'setting' }).data
|
|
|
|
|
|
+ var setting = my.getStorageSync({
|
|
|
|
+ 'key': 'setting'
|
|
|
|
+ }).data
|
|
//未绑定手机号
|
|
//未绑定手机号
|
|
- if (userStatus.is_bind_mobile == 0) {
|
|
|
|
- my.navigateTo({
|
|
|
|
- url: '/pages/authorization/authorization',
|
|
|
|
- })
|
|
|
|
- //未实名认证
|
|
|
|
- } else if (userStatus.is_card_certified == 0 && setting.is_card == 1) {
|
|
|
|
|
|
+ // if (userStatus.is_bind_mobile == 0) {
|
|
|
|
+ // my.navigateTo({
|
|
|
|
+ // url: '/pages/authorization/authorization',
|
|
|
|
+ // })
|
|
|
|
+
|
|
|
|
+ // } else
|
|
|
|
+ //未实名认证
|
|
|
|
+ if (userStatus.is_card_certified == 0 && setting.is_card == 1) {
|
|
my.navigateTo({
|
|
my.navigateTo({
|
|
url: '/pages/real_name/real_name',
|
|
url: '/pages/real_name/real_name',
|
|
})
|
|
})
|
|
@@ -749,14 +830,7 @@ Page({
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
|
|
- onReady: function () {
|
|
|
|
|
|
|
|
- },
|
|
|
|
- kefu: util.throttle(function () {
|
|
|
|
- my.makePhoneCall({
|
|
|
|
- number: my.getStorageSync({ 'key': 'home' }).data.customer_service_phone,
|
|
|
|
- })
|
|
|
|
- }, 1500),
|
|
|
|
//用户状态
|
|
//用户状态
|
|
userState: function (id) {
|
|
userState: function (id) {
|
|
var that = this;
|
|
var that = this;
|
|
@@ -769,7 +843,10 @@ Page({
|
|
is_pay_order: res.data.is_pay_order,
|
|
is_pay_order: res.data.is_pay_order,
|
|
is_ride_order: res.data.is_ride_order,
|
|
is_ride_order: res.data.is_ride_order,
|
|
is_punishment: res.data.is_punishment,
|
|
is_punishment: res.data.is_punishment,
|
|
- }), my.setStorageSync({ 'key': 'userState', data: res.data })
|
|
|
|
|
|
+ }), my.setStorageSync({
|
|
|
|
+ 'key': 'userState',
|
|
|
|
+ data: res.data
|
|
|
|
+ })
|
|
}
|
|
}
|
|
}).catch(err => {
|
|
}).catch(err => {
|
|
console.log(err)
|
|
console.log(err)
|
|
@@ -779,7 +856,10 @@ Page({
|
|
getUser() {
|
|
getUser() {
|
|
app.request("/me", '', "GET").then(res => {
|
|
app.request("/me", '', "GET").then(res => {
|
|
console.log(res)
|
|
console.log(res)
|
|
- 200 == res.status && my.setStorageSync({ 'key': 'userInfo', data: res.data })
|
|
|
|
|
|
+ 200 == res.status && my.setStorageSync({
|
|
|
|
+ 'key': 'userInfo',
|
|
|
|
+ data: res.data
|
|
|
|
+ })
|
|
}).catch(err => {
|
|
}).catch(err => {
|
|
console.log(err)
|
|
console.log(err)
|
|
})
|
|
})
|
|
@@ -791,8 +871,7 @@ Page({
|
|
location: false
|
|
location: false
|
|
})
|
|
})
|
|
my.openSetting({
|
|
my.openSetting({
|
|
- success: function (res) {
|
|
|
|
- }
|
|
|
|
|
|
+ success: function (res) {}
|
|
})
|
|
})
|
|
}, 1500),
|
|
}, 1500),
|
|
|
|
|
|
@@ -816,9 +895,11 @@ Page({
|
|
type: 'gcj02',
|
|
type: 'gcj02',
|
|
success: (res) => {
|
|
success: (res) => {
|
|
console.log('经纬度为:+++++++++++++++++++++' + res.latitude + '++++++++' + res.longitude)
|
|
console.log('经纬度为:+++++++++++++++++++++' + res.latitude + '++++++++' + res.longitude)
|
|
|
|
+ this.data.longitude =res.longitude
|
|
|
|
+ this.data.latitude =res.latitude
|
|
that.setData({
|
|
that.setData({
|
|
- longitude: res.longitude,
|
|
|
|
- latitude: res.latitude,
|
|
|
|
|
|
+ centerLon: res.longitude,
|
|
|
|
+ centerLat: res.latitude,
|
|
show: false
|
|
show: false
|
|
})
|
|
})
|
|
console.log(res, 'ppp')
|
|
console.log(res, 'ppp')
|
|
@@ -840,7 +921,9 @@ Page({
|
|
|
|
|
|
},
|
|
},
|
|
fail: (error) => {
|
|
fail: (error) => {
|
|
- my.alert({ content: '获取位置授权失败' });
|
|
|
|
|
|
+ my.alert({
|
|
|
|
+ content: '获取位置授权失败'
|
|
|
|
+ });
|
|
},
|
|
},
|
|
});
|
|
});
|
|
|
|
|
|
@@ -870,7 +953,9 @@ Page({
|
|
console.log(that.data, 'oooooo')
|
|
console.log(that.data, 'oooooo')
|
|
|
|
|
|
var userStatus = that.data.userStatus;
|
|
var userStatus = that.data.userStatus;
|
|
- var setting = my.getStorageSync({ 'key': 'setting' }).data
|
|
|
|
|
|
+ var setting = my.getStorageSync({
|
|
|
|
+ 'key': 'setting'
|
|
|
|
+ }).data
|
|
if (data.id == 2 && !that.data.latitude && !that.data.longitude) {
|
|
if (data.id == 2 && !that.data.latitude && !that.data.longitude) {
|
|
that.setData({
|
|
that.setData({
|
|
background: true,
|
|
background: true,
|
|
@@ -887,14 +972,14 @@ Page({
|
|
return
|
|
return
|
|
}
|
|
}
|
|
if (data.id == 2 && setting) {
|
|
if (data.id == 2 && setting) {
|
|
- if (!userStatus) {
|
|
|
|
- my.navigateTo({
|
|
|
|
- url: '/pages/authorization/authorization',
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- that.jiance1();
|
|
|
|
- }
|
|
|
|
|
|
+ // if (!userStatus) {
|
|
|
|
+ // my.navigateTo({
|
|
|
|
+ // url: '/pages/authorization/authorization',
|
|
|
|
+ // })
|
|
|
|
+ // } else {
|
|
|
|
+ // that.jiance1();
|
|
|
|
+ // }
|
|
|
|
+ that.jiance1();
|
|
} else {
|
|
} else {
|
|
my.navigateTo({
|
|
my.navigateTo({
|
|
url: data.url,
|
|
url: data.url,
|
|
@@ -955,15 +1040,19 @@ Page({
|
|
//输码开锁检测
|
|
//输码开锁检测
|
|
jiance1: function (source) {
|
|
jiance1: function (source) {
|
|
var that = this;
|
|
var that = this;
|
|
- let setting = my.getStorageSync({ 'key': 'setting' }).data
|
|
|
|
|
|
+ let setting = my.getStorageSync({
|
|
|
|
+ 'key': 'setting'
|
|
|
|
+ }).data
|
|
var userStatus = that.data.userStatus;
|
|
var userStatus = that.data.userStatus;
|
|
//未绑定手机号
|
|
//未绑定手机号
|
|
- if (userStatus.is_bind_mobile == 0) {
|
|
|
|
- my.navigateTo({
|
|
|
|
- url: '/pages/authorization/authorization',
|
|
|
|
- })
|
|
|
|
- //未实名认证
|
|
|
|
- } else if (userStatus.is_card_certified == 0 && setting.is_card == 1) {
|
|
|
|
|
|
+ // if (userStatus.is_bind_mobile == 0) {
|
|
|
|
+ // my.navigateTo({
|
|
|
|
+ // url: '/pages/authorization/authorization',
|
|
|
|
+ // })
|
|
|
|
+
|
|
|
|
+ // } else
|
|
|
|
+ //未实名认证
|
|
|
|
+ if (userStatus.is_card_certified == 0 && setting.is_card == 1) {
|
|
my.navigateTo({
|
|
my.navigateTo({
|
|
url: '/pages/real_name/real_name',
|
|
url: '/pages/real_name/real_name',
|
|
})
|
|
})
|
|
@@ -981,8 +1070,7 @@ Page({
|
|
icon: 'none'
|
|
icon: 'none'
|
|
})
|
|
})
|
|
return;
|
|
return;
|
|
- }
|
|
|
|
- else {
|
|
|
|
|
|
+ } else {
|
|
//有待支付骑行订单
|
|
//有待支付骑行订单
|
|
if (userStatus.is_pay_order != false && userStatus.is_pay_order != undefined) {
|
|
if (userStatus.is_pay_order != false && userStatus.is_pay_order != undefined) {
|
|
my.showToast({
|
|
my.showToast({
|
|
@@ -1006,10 +1094,13 @@ Page({
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- // 客服
|
|
|
|
|
|
+ // // 客服
|
|
kefu: function () {
|
|
kefu: function () {
|
|
|
|
+ let phone = my.getStorageSync({
|
|
|
|
+ 'key': 'home'
|
|
|
|
+ })
|
|
my.makePhoneCall({
|
|
my.makePhoneCall({
|
|
- number: my.getStorageSync({ 'key': 'home' }).data.customer_service_phone,
|
|
|
|
|
|
+ number: phone ? phone.data.customer_service_phone : '13203706613'
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
|
|
@@ -1049,21 +1140,4 @@ Page({
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
|
|
-})
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+})
|