|
@@ -1,6 +1,7 @@
|
|
|
<!-- 货源 -->
|
|
|
<template>
|
|
|
<view class="content">
|
|
|
+<!-- <fh-no-network></fh-no-network> -->
|
|
|
<view class="banner">
|
|
|
<image class="banner-img" src="@/static/images/goodSource/banner@2x.png" mode='widthFix'></image>
|
|
|
<view class="head flex s-row paddingr35">
|
|
@@ -62,7 +63,6 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="right gray">
|
|
|
- <!-- {{good.createDate}} -->
|
|
|
{{$helper.changeTime(good.updateDate)}}
|
|
|
</view>
|
|
|
<view class="flex flex-space-between yf-style">
|
|
@@ -79,7 +79,7 @@
|
|
|
<view v-if="carWeight(good)">{{carWeight(good)}}</view>
|
|
|
</view>
|
|
|
<view class="flex row">
|
|
|
- <view class="row-tips">{{good.taskDescription}}</view>
|
|
|
+ <view class="row-tips" v-if="good.taskDescription">{{good.taskDescription}}</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="right flex h-color">
|
|
@@ -122,6 +122,7 @@
|
|
|
</template>
|
|
|
<script>
|
|
|
var that
|
|
|
+ import permision from "@/js_sdk/wa-permission/permission.js"
|
|
|
import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
|
|
|
import {
|
|
|
mapState
|
|
@@ -186,31 +187,37 @@
|
|
|
computed: {
|
|
|
...mapState(['hasLogin', 'userInfo', 'firstAuthentication'])
|
|
|
},
|
|
|
+ watch:{
|
|
|
+ // startPlace(){
|
|
|
+ // console.log(this.startPlace)
|
|
|
+ // this.upCallback({page});
|
|
|
+ // },
|
|
|
+ },
|
|
|
+ onLoad() {
|
|
|
+ this.checkOpenGPSServiceByAndroidIOS()
|
|
|
+ },
|
|
|
onShow() {
|
|
|
- //获取上一次点击起装卸地
|
|
|
- if (uni.getStorageSync('fPlaceObj')) {
|
|
|
- this.startPlace = uni.getStorageSync('fPlaceObj');
|
|
|
- } else {
|
|
|
- // #ifdef APP-PLUS
|
|
|
- var that=this
|
|
|
- // this.$nextTick(function(){
|
|
|
- this.getLngLat();
|
|
|
- // })
|
|
|
-
|
|
|
- // #endif
|
|
|
- if(!this.startPlace.selected){
|
|
|
- this.startPlace.selected = ''
|
|
|
+
|
|
|
+ var that= this
|
|
|
+ setTimeout(()=>{
|
|
|
+ // var photol=await permision.checkSystemEnableLocation()
|
|
|
+ if(uni.getStorageSync('confirm_location')){
|
|
|
+ that.get_localtion_permission()
|
|
|
}
|
|
|
- }
|
|
|
- if (uni.getStorageSync('sPlaceObj')) {
|
|
|
- this.endPlace = uni.getStorageSync('sPlaceObj');
|
|
|
- } else {
|
|
|
- this.endPlace.selected = '全国'
|
|
|
- }
|
|
|
+ //获取上一次点击起装卸地
|
|
|
+ if (uni.getStorageSync('fPlaceObj')) {
|
|
|
+ that.startPlace = uni.getStorageSync('fPlaceObj');
|
|
|
+ }
|
|
|
+ if (uni.getStorageSync('sPlaceObj')) {
|
|
|
+ that.endPlace = uni.getStorageSync('sPlaceObj');
|
|
|
+ }
|
|
|
+ that.upCallback({size:10,num:1})
|
|
|
+ },1500)
|
|
|
+
|
|
|
that.$request.baseRequest('get', '/newsInfo/unreadMessage', {
|
|
|
reCommonId: this.userInfo.id,
|
|
|
}).then(res3 => {
|
|
|
- if (res3.data) {
|
|
|
+ if (res3.data||res3.data==0) {
|
|
|
let name = 'myTip';
|
|
|
let value = res3.data
|
|
|
if (value == 0) {
|
|
@@ -233,25 +240,25 @@
|
|
|
// this.mescroll.resetUpScroll()
|
|
|
|
|
|
},
|
|
|
- async onLoad() {
|
|
|
- that = this
|
|
|
- // #ifdef APP-PLUS
|
|
|
- let _status = await that.$request.baseRequest('get', '/driverInfo/firstAuthentication', {
|
|
|
- driverPhone: this.userInfo.phone,
|
|
|
- }).then(res => {
|
|
|
- return res.data.authenticationStatus
|
|
|
- })
|
|
|
- // if (_status == '已禁用') {
|
|
|
- // this.isShowAlert = true
|
|
|
- // this.alertTitle = '账号审核中'
|
|
|
- // this.confirmText = '退出APP'
|
|
|
- // this.showCancelButton = false
|
|
|
- // } else {
|
|
|
- // console.log(1231233212332312312213)
|
|
|
- // }
|
|
|
- // #endif
|
|
|
+ // async onLoad() {
|
|
|
+ // that = this
|
|
|
+ // // #ifdef APP-PLUS
|
|
|
+ // let _status = await that.$request.baseRequest('get', '/driverInfo/firstAuthentication', {
|
|
|
+ // driverPhone: this.userInfo.phone,
|
|
|
+ // }).then(res => {
|
|
|
+ // return res.data.authenticationStatus
|
|
|
+ // })
|
|
|
+ // // if (_status == '已禁用') {
|
|
|
+ // // this.isShowAlert = true
|
|
|
+ // // this.alertTitle = '账号审核中'
|
|
|
+ // // this.confirmText = '退出APP'
|
|
|
+ // // this.showCancelButton = false
|
|
|
+ // // } else {
|
|
|
+ // // console.log(1231233212332312312213)
|
|
|
+ // // }
|
|
|
+ // // #endif
|
|
|
|
|
|
- },
|
|
|
+ // },
|
|
|
onPageScroll(res) {
|
|
|
this.scrollTop = res.scrollTop
|
|
|
// console.log("页面滚动了", res.scrollTop)
|
|
@@ -273,9 +280,164 @@
|
|
|
|
|
|
},
|
|
|
methods: {
|
|
|
+ async get_localtion_permission() {
|
|
|
+ var photol=await permision.checkSystemEnableLocation()
|
|
|
+ if(photol == true){
|
|
|
+ uni.removeStorageSync('confirm_location')
|
|
|
+ uni.showToast({
|
|
|
+ title: '只有文字弹窗',
|
|
|
+ icon: 'none', //如果要纯文本,不要icon,将值设为'none'
|
|
|
+ duration: 2000 //持续时间为 2秒
|
|
|
+ })
|
|
|
+ this.getLngLat()
|
|
|
+ }else{
|
|
|
+ if(uni.getStorageSync('confirm_location')){
|
|
|
+ uni.removeStorageSync('confirm_location')
|
|
|
+ }
|
|
|
+ uni.setStorageSync('fPlaceObj',{
|
|
|
+ fchoosearea:'全部',
|
|
|
+ fchoosecity:'市辖区',
|
|
|
+ fchooseprovince:'北京',
|
|
|
+ selected:'东城'
|
|
|
+ })
|
|
|
+ uni.setStorageSync('sPlaceObj',{
|
|
|
+ schoosearea:'请选择区',
|
|
|
+ schoosecity:'请选择市',
|
|
|
+ schooseprovince:'全国',
|
|
|
+ selected:'全国'
|
|
|
+ })
|
|
|
+ uni.setStorageSync('longitudeAndLatitude','116.3972,39.9096')
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async getLngLat(){
|
|
|
+ await uni.getLocation({
|
|
|
+ type: 'gcj02',
|
|
|
+ geocode: true,
|
|
|
+ success: res => {
|
|
|
+ if (res.latitude) {
|
|
|
+ if(res.address.city){
|
|
|
+ if(res.address.city.indexOf('市')!=-1){
|
|
|
+ res.address.city=res.address.city.substring(0,res.address.city.length-1)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(res.address.province){
|
|
|
+ if(res.address.province.indexOf('省')!=-1){
|
|
|
+ res.address.province=res.address.province.substring(0,res.address.province.length-1)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ uni.setStorageSync('fPlaceObj',{
|
|
|
+ fchoosearea:'全部',
|
|
|
+ fchoosecity:res.address.city,
|
|
|
+ fchooseprovince:res.address.province,
|
|
|
+ selected:res.address.city
|
|
|
+ })
|
|
|
+ uni.setStorageSync('sPlaceObj',{
|
|
|
+ schoosearea:'请选择区',
|
|
|
+ schoosecity:'请选择市',
|
|
|
+ schooseprovince:'全国',
|
|
|
+ selected:'全国'
|
|
|
+ })
|
|
|
+ uni.setStorageSync('longitudeAndLatitude',res.longitude+','+res.latitude)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ checkOpenGPSServiceByAndroidIOS() {
|
|
|
+ let system = uni.getSystemInfoSync(); // 获取系统信息
|
|
|
+ // console.log(system);
|
|
|
+ if (system.platform === 'android') { // 判断平台
|
|
|
+ var context = plus.android.importClass("android.content.Context");
|
|
|
+ var locationManager = plus.android.importClass("android.location.LocationManager");
|
|
|
+ var main = plus.android.runtimeMainActivity();
|
|
|
+ var mainSvr = main.getSystemService(context.LOCATION_SERVICE);
|
|
|
+ if (!mainSvr.isProviderEnabled(locationManager.GPS_PROVIDER)) {
|
|
|
+ uni.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: '请打开定位服务功能',
|
|
|
+ // showCancel: false, // 不显示取消按钮
|
|
|
+ success(res) {
|
|
|
+ if(res.confirm){
|
|
|
+ uni.setStorageSync('confirm_location',1)
|
|
|
+ if (!mainSvr.isProviderEnabled(locationManager.GPS_PROVIDER)) {
|
|
|
+
|
|
|
+ var Intent = plus.android.importClass('android.content.Intent');
|
|
|
+ var Settings = plus.android.importClass('android.provider.Settings');
|
|
|
+ var intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
|
|
|
+ main.startActivity(intent); // 打开系统设置GPS服务页面
|
|
|
+ } else {
|
|
|
+ uni.setStorageSync('fPlaceObj',{
|
|
|
+ fchoosearea:'全部',
|
|
|
+ fchoosecity:'市辖区',
|
|
|
+ fchooseprovince:'北京',
|
|
|
+ selected:'东城'
|
|
|
+ })
|
|
|
+ uni.setStorageSync('sPlaceObj',{
|
|
|
+ schoosearea:'请选择区',
|
|
|
+ schoosecity:'请选择市',
|
|
|
+ schooseprovince:'全国',
|
|
|
+ selected:'全国'
|
|
|
+ })
|
|
|
+ uni.setStorageSync('longitudeAndLatitude','116.3972,39.9096')
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ uni.setStorageSync('fPlaceObj',{
|
|
|
+ fchoosearea:'全部',
|
|
|
+ fchoosecity:'市辖区',
|
|
|
+ fchooseprovince:'北京',
|
|
|
+ selected:'东城'
|
|
|
+ })
|
|
|
+ uni.setStorageSync('sPlaceObj',{
|
|
|
+ schoosearea:'请选择区',
|
|
|
+ schoosecity:'请选择市',
|
|
|
+ schooseprovince:'全国',
|
|
|
+ selected:'全国'
|
|
|
+ })
|
|
|
+ uni.setStorageSync('longitudeAndLatitude','116.3972,39.9096')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ this.getLngLat()
|
|
|
+ }
|
|
|
+ } else if (system.platform === 'ios') {
|
|
|
+ // console.log("苹果");
|
|
|
+ var cllocationManger = plus.ios.import("CLLocationManager");
|
|
|
+ var enable = cllocationManger.locationServicesEnabled();
|
|
|
+ var status = cllocationManger.authorizationStatus();
|
|
|
+ plus.ios.deleteObject(cllocationManger);
|
|
|
+ if (enable && status != 2) {
|
|
|
+ this.getLngLat()
|
|
|
+ console.log("手机系统的定位已经打开");
|
|
|
+ } else {
|
|
|
+ console.log("手机系统的定位没有打开");
|
|
|
+ uni.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: '请前往设置-隐私-定位服务打开定位服务功能',
|
|
|
+ // showCancel: false, // 不显示取消按钮
|
|
|
+ success(res) {
|
|
|
+ if(res.confirm){
|
|
|
+ var UIApplication = plus.ios.import("UIApplication");
|
|
|
+ var application2 = UIApplication.sharedApplication();
|
|
|
+ var NSURL2 = plus.ios.import("NSURL");
|
|
|
+ // var setting2 = NSURL2.URLWithString("prefs:root=LOCATION_SERVICES");
|
|
|
+ // var setting2 = NSURL2.URLWithString("App-Prefs:root=LOCATION_SERVICES");
|
|
|
+ // var setting2 = NSURL2.URLWithString("app-settings");
|
|
|
+ var setting2 = NSURL2.URLWithString("App-Prefs:root=Privacy&path=LOCATION");
|
|
|
+ // var setting2 = NSURL2.URLWithString("App-Prefs:root=Privacy&path=LOCATION_SERVICES");
|
|
|
+ application2.openURL(setting2);
|
|
|
+ plus.ios.deleteObject(setting2);
|
|
|
+ plus.ios.deleteObject(NSURL2);
|
|
|
+ plus.ios.deleteObject(application2);
|
|
|
+ this.getLngLat()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
cargoOwner(_obj){
|
|
|
// uni.$u.route('/pages/order/evaluateList');
|
|
|
- console.log("查看---------------",_obj)
|
|
|
+ // console.log("查看---------------",_obj)
|
|
|
uni.$u.route('/pages/goodSource/cargoOwnerSee',_obj)
|
|
|
},
|
|
|
mescrollInit(mescroll) {
|
|
@@ -283,32 +445,38 @@
|
|
|
},
|
|
|
confirmClick() {
|
|
|
let item = this.ObjSelect
|
|
|
- let _obj = {
|
|
|
- driverCommonId: this.firstAuthentication.commonId,
|
|
|
- commonId: item.commonId,
|
|
|
- cargoOwnerName: item.cargoOwnerName,
|
|
|
- cargoOwner: item.cargoOwner,
|
|
|
- sendPrivate: item.sendPrivate,
|
|
|
- sendCity: item.sendCity,
|
|
|
- sendArea: item.sendArea,
|
|
|
- sendDetailedAddress: item.sendDetailedAddress,
|
|
|
- unloadPrivate: item.unloadPrivate,
|
|
|
- unloadCity: item.unloadCity,
|
|
|
- unloadArea: item.unloadArea,
|
|
|
- unloadDetailedAddress: item.unloadDetailedAddress,
|
|
|
- goodsName: item.goodsName,
|
|
|
- distance: item.distance,
|
|
|
- freightPrice: item.freightPrice,
|
|
|
- driverName: this.firstAuthentication.driverName,
|
|
|
- driverPhone: this.firstAuthentication.driverPhone,
|
|
|
- cargoOwnerPhone: item.cargoOwnerPhone,
|
|
|
- id:item.id,
|
|
|
- billingMethod:item.billingMethod
|
|
|
- }
|
|
|
-
|
|
|
- this.$request.baseRequest('post', '/publishTaskInfo/api/addOrder', _obj).then(res => {
|
|
|
+ var that=this
|
|
|
+ this.$request.baseRequest('get', '/driverInfo/firstAuthentication', {
|
|
|
+ driverPhone: this.userInfo.phone,
|
|
|
+ }).then(res2 => {
|
|
|
+ let _obj = {
|
|
|
+ driverCommonId: res2.data.commonId,
|
|
|
+ commonId: item.commonId,
|
|
|
+ cargoOwnerName: item.cargoOwnerName,
|
|
|
+ cargoOwner: item.cargoOwner,
|
|
|
+ sendPrivate: item.sendPrivate,
|
|
|
+ sendCity: item.sendCity,
|
|
|
+ sendArea: item.sendArea,
|
|
|
+ sendDetailedAddress: item.sendDetailedAddress,
|
|
|
+ unloadPrivate: item.unloadPrivate,
|
|
|
+ unloadCity: item.unloadCity,
|
|
|
+ unloadArea: item.unloadArea,
|
|
|
+ unloadDetailedAddress: item.unloadDetailedAddress,
|
|
|
+ goodsName: item.goodsName,
|
|
|
+ distance: item.distance,
|
|
|
+ freightPrice: item.freightPrice,
|
|
|
+ driverName: res2.data.driverName,
|
|
|
+ driverPhone: res2.data.driverPhone,
|
|
|
+ cargoOwnerPhone: item.cargoOwnerPhone,
|
|
|
+ id:item.id,
|
|
|
+ billingMethod:item.billingMethod,
|
|
|
+ freightAdvance:item.freightAdvance,
|
|
|
+ goodsType:item.goodsType,
|
|
|
+ goodsTypeKey:item.goodsTypeKey
|
|
|
+ }
|
|
|
+ that.$request.baseRequest('post', '/publishTaskInfo/api/addOrder', _obj).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
- this.$refs.uToast.show({
|
|
|
+ that.$refs.uToast.show({
|
|
|
type: 'success',
|
|
|
message: "抢单成功!",
|
|
|
complete() {
|
|
@@ -318,7 +486,7 @@
|
|
|
}
|
|
|
})
|
|
|
} else {
|
|
|
- this.$refs.uToast.show({
|
|
|
+ that.$refs.uToast.show({
|
|
|
type: 'error',
|
|
|
message: res.message,
|
|
|
})
|
|
@@ -327,6 +495,8 @@
|
|
|
.catch(res => {
|
|
|
uni.$u.toast(res.message);
|
|
|
});
|
|
|
+
|
|
|
+ });
|
|
|
this.isShowAlert = false
|
|
|
},
|
|
|
cancelClick() {
|
|
@@ -346,16 +516,16 @@
|
|
|
carType(good) {
|
|
|
let _val = '';
|
|
|
if (good.carModel == 1) {
|
|
|
- _val = '不限'
|
|
|
+ _val = ''
|
|
|
} else {
|
|
|
if (good.carModel.includes(2)) {
|
|
|
- _val += '高栏/'
|
|
|
+ _val += '高栏 '
|
|
|
}
|
|
|
if (good.carModel.includes(3)) {
|
|
|
- _val += '集装箱/'
|
|
|
+ _val += '集装箱 '
|
|
|
}
|
|
|
if (good.carModel.includes(4)) {
|
|
|
- _val += '自卸车'
|
|
|
+ _val += '自卸车 '
|
|
|
}
|
|
|
}
|
|
|
return _val
|
|
@@ -404,84 +574,154 @@
|
|
|
selectType() {
|
|
|
this.show = true
|
|
|
},
|
|
|
- getLngLat() {
|
|
|
- var that=this
|
|
|
- uni.showLoading({
|
|
|
- title: '获取定位信息'
|
|
|
- })
|
|
|
- uni.getLocation({
|
|
|
- type: 'gcj02',
|
|
|
- geocode: true,
|
|
|
- success: res => {
|
|
|
- if (res.latitude) {
|
|
|
- // console.log(that.startPlace)
|
|
|
- // if(res.address.city.indexOf('市')!=-1){
|
|
|
- // res.address.city=res.address.city.substring(0,res.address.city.length-1)
|
|
|
- // }
|
|
|
- that.startPlace.selected=res.address.city
|
|
|
- // that.$set(that.startPlace,'selected',res.address.city)
|
|
|
- that.lng = res.longitude;
|
|
|
- that.lat = res.latitude;
|
|
|
- uni.hideLoading()
|
|
|
- } else {
|
|
|
- if (uni.getSystemInfoSync().platform == 'android') {
|
|
|
- var context = plus.android.importClass("android.content.Context");
|
|
|
- var locationManager = plus.android.importClass(
|
|
|
- "android.location.LocationManager");
|
|
|
- var main = plus.android.runtimeMainActivity();
|
|
|
- var mainSvr = main.getSystemService(context.LOCATION_SERVICE);
|
|
|
- that.bool = mainSvr.isProviderEnabled(locationManager.GPS_PROVIDER)
|
|
|
- }
|
|
|
- if (that.bool === false) {
|
|
|
- uni.showModal({
|
|
|
- title: '提示',
|
|
|
- content: '请打开定位服务',
|
|
|
- success: ({
|
|
|
- confirm,
|
|
|
- cancel
|
|
|
- }) => {
|
|
|
- if (confirm) {
|
|
|
- if (uni.getSystemInfoSync().platform == 'android') {
|
|
|
- var Intent = plus.android.importClass(
|
|
|
- 'android.content.Intent');
|
|
|
- var Settings = plus.android.importClass(
|
|
|
- 'android.provider.Settings');
|
|
|
- var intent = new Intent(Settings
|
|
|
- .ACTION_LOCATION_SOURCE_SETTINGS);
|
|
|
- var main = plus.android.runtimeMainActivity();
|
|
|
- main.startActivity(intent); // 打开系统设置GPS服务页面
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- uni.hideLoading()
|
|
|
+ // getLngLat() {
|
|
|
+ // var that=this
|
|
|
+ // // uni.showLoading({
|
|
|
+ // // title: '获取定位信息'
|
|
|
+ // // })
|
|
|
+
|
|
|
+ // uni.getLocation({
|
|
|
+ // type: 'gcj02',
|
|
|
+ // geocode: true,
|
|
|
+ // success: res => {
|
|
|
+ // if (res.latitude) {
|
|
|
+ // console.log(res)
|
|
|
+ // if(res.address.city){
|
|
|
+ // if(res.address.city.indexOf('市')!=-1){
|
|
|
+ // res.address.city=res.address.city.substring(0,res.address.city.length-1)
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // if(res.address.province){
|
|
|
+ // if(res.address.province.indexOf('省')!=-1){
|
|
|
+ // res.address.province=res.address.province.substring(0,res.address.province.length-1)
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // uni.setStorageSync('fPlaceObj',{
|
|
|
+ // fchoosearea:'全部',
|
|
|
+ // fchoosecity:res.address.city,
|
|
|
+ // fchooseprovince:res.address.province,
|
|
|
+ // selected:res.address.city
|
|
|
+ // })
|
|
|
+ // uni.setStorageSync('sPlaceObj',{
|
|
|
+ // schoosearea:'请选择区',
|
|
|
+ // schoosecity:'请选择市',
|
|
|
+ // schooseprovince:'全国',
|
|
|
+ // selected:'全国'
|
|
|
+ // })
|
|
|
+ // let _pickerSelect;
|
|
|
+ // if (that.pickerSelect == '运费先付') {
|
|
|
+ // _pickerSelect = 1
|
|
|
+ // } else {
|
|
|
+ // _pickerSelect = 0
|
|
|
+ // }
|
|
|
+ // that.startPlace.selected=res.address.city
|
|
|
+ // that.startPlace.fchoosecity=res.address.city
|
|
|
+ // let _data = {
|
|
|
+ // searchKeyWord: this.tabIndex + 1,
|
|
|
+ // searchType: _pickerSelect,
|
|
|
+ // pageSize: 10,
|
|
|
+ // currentPage: 1,
|
|
|
+ // loadingPlaceCity: that.startPlace.fchoosecity,
|
|
|
+ // // unLoadingPlaceCity: this.endPlace.schoosecity
|
|
|
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
+ // }
|
|
|
+ // that.$forceUpdate()
|
|
|
+ // // that.$set(that.startPlace,'selected',res.address.city)
|
|
|
+ // // that.lng = res.longitude;
|
|
|
+ // // that.lat = res.latitude;
|
|
|
+ // that.$request.baseRequest('get', '/publishTaskInfo/selectGoodsSource', _data).then(res => {
|
|
|
+ // if (res.code == 200) {
|
|
|
+ // console.log(res.data.records)
|
|
|
+ // uni.hideLoading()
|
|
|
+ // that.mescroll.endBySize(res.data.records.length, res.data.total);
|
|
|
+ // if(res.data.records){
|
|
|
+ // that.goods = res.data.records
|
|
|
+ // for (let i = 0; i < that.goods.length; i++) {
|
|
|
+ // if (that.goods[i].peripheralInfo == 1) {
|
|
|
+ // that.isFirstIndex = i
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }else{
|
|
|
+ // that.goods=[]
|
|
|
+ // }
|
|
|
+
|
|
|
+ // }
|
|
|
+ // uni.hideLoading()
|
|
|
+ // })
|
|
|
+ // .catch(res => {
|
|
|
+ // uni.$u.toast(res.message);
|
|
|
+ // that.mescroll.endErr();
|
|
|
+ // });
|
|
|
+ // } else {
|
|
|
+ // if (uni.getSystemInfoSync().platform == 'android') {
|
|
|
+ // var context = plus.android.importClass("android.content.Context");
|
|
|
+ // var locationManager = plus.android.importClass(
|
|
|
+ // "android.location.LocationManager");
|
|
|
+ // var main = plus.android.runtimeMainActivity();
|
|
|
+ // var mainSvr = main.getSystemService(context.LOCATION_SERVICE);
|
|
|
+ // that.bool = mainSvr.isProviderEnabled(locationManager.GPS_PROVIDER)
|
|
|
+ // }
|
|
|
+ // if (that.bool === false) {
|
|
|
+ // uni.showModal({
|
|
|
+ // title: '提示',
|
|
|
+ // content: '请打开定位服务',
|
|
|
+ // success: ({
|
|
|
+ // confirm,
|
|
|
+ // cancel
|
|
|
+ // }) => {
|
|
|
+ // if (confirm) {
|
|
|
+ // if (uni.getSystemInfoSync().platform == 'android') {
|
|
|
+ // var Intent = plus.android.importClass(
|
|
|
+ // 'android.content.Intent');
|
|
|
+ // var Settings = plus.android.importClass(
|
|
|
+ // 'android.provider.Settings');
|
|
|
+ // var intent = new Intent(Settings
|
|
|
+ // .ACTION_LOCATION_SOURCE_SETTINGS);
|
|
|
+ // var main = plus.android.runtimeMainActivity();
|
|
|
+ // main.startActivity(intent); // 打开系统设置GPS服务页面
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // uni.hideLoading()
|
|
|
+
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // },
|
|
|
toDetail(id) {
|
|
|
- //司机是否认证身份
|
|
|
- if (this.firstAuthentication.authenticationStatus == '已认证') {
|
|
|
- uni.$u.route('/pages/goodSource/shippingDetails', {
|
|
|
- id: id,
|
|
|
- });
|
|
|
- } else if (this.firstAuthentication.authenticationStatus == '已过期') {
|
|
|
- this.$refs.uToast.show({
|
|
|
- type: 'error',
|
|
|
- message: "证件已过期,请上传新证件!",
|
|
|
- })
|
|
|
- } else {
|
|
|
- this.$refs.uToast.show({
|
|
|
- type: 'error',
|
|
|
- message: "请先完成司机认证!",
|
|
|
- })
|
|
|
- }
|
|
|
-
|
|
|
+ var that=this
|
|
|
+ that.$request.baseRequest('get', '/driverInfo/firstAuthentication', {
|
|
|
+ driverPhone: this.userInfo.phone,
|
|
|
+ }).then(res2 => {
|
|
|
+ // console.log('跳转',1111111)
|
|
|
+ uni.setStorageSync('firstAuthentication', res2.data)
|
|
|
+ that.firstAuthentication=uni.getStorageSync('firstAuthentication')
|
|
|
+ // console.log(that.firstAuthentication)
|
|
|
+ //司机是否认证身份
|
|
|
+ // 保留uni.getStorageSync('firstAuthentication'),thisfirstAuthentication有缓存问题
|
|
|
+ if (uni.getStorageSync('firstAuthentication').authenticationStatus == '已认证') {
|
|
|
+ uni.$u.route('/pages/goodSource/shippingDetails', {
|
|
|
+ id: id,
|
|
|
+ });
|
|
|
+ } else if (uni.getStorageSync('firstAuthentication').authenticationStatus == '已过期') {
|
|
|
+ that.$refs.uToast.show({
|
|
|
+ type: 'error',
|
|
|
+ message: "证件已过期,请上传新证件!",
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ that.$refs.uToast.show({
|
|
|
+ type: 'error',
|
|
|
+ message: "请先完成司机认证!",
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
/*上拉加载的回调: 其中page.num:当前页 从1开始, page.size:每页数据条数,默认10 */
|
|
|
upCallback(page) {
|
|
|
+ var that =this
|
|
|
let _pickerSelect;
|
|
|
if (this.pickerSelect == '运费先付') {
|
|
|
_pickerSelect = 1
|
|
@@ -501,75 +741,111 @@
|
|
|
// unLoadingPlaceCity: this.endPlace.schoosecity
|
|
|
|
|
|
}
|
|
|
+ console.log(uni.getStorageSync('longitudeAndLatitude'))
|
|
|
// if (this.tabIndex == 2) {
|
|
|
- if(!this.startPlace.selected){
|
|
|
- this.getLngLat();
|
|
|
- }
|
|
|
- _data.driverLongitude = this.lng
|
|
|
- _data.driverLatitude = this.lat
|
|
|
- // }
|
|
|
- console.log('------')
|
|
|
- console.log(_data)
|
|
|
- if (uni.getStorageSync('fPlaceObj')) {
|
|
|
- if (this.startPlace.fchoosearea && this.startPlace.fchoosearea == '全部' && this.startPlace
|
|
|
- .fchoosearea != '请选择区') {
|
|
|
- _data.loadingPlaceCity = this.startPlace.fchoosecity
|
|
|
- } else if (this.startPlace.fchoosecity == '全部') {
|
|
|
- _data.loadingPlace = this.startPlace.selected
|
|
|
- } else {
|
|
|
- _data.loadingPlaceCity = this.startPlace.fchoosecity
|
|
|
- _data.loadingPlace = this.startPlace.fchoosearea
|
|
|
+ if(uni.getStorageSync('longitudeAndLatitude')){
|
|
|
+ this.lng=uni.getStorageSync('longitudeAndLatitude').split(',')[0]
|
|
|
+ this.lat=uni.getStorageSync('longitudeAndLatitude').split(',')[1]
|
|
|
}
|
|
|
-
|
|
|
- } else {
|
|
|
- _data.loadingPlaceCity = this.startPlace.fchoosecity
|
|
|
- }
|
|
|
- if (uni.getStorageSync('sPlaceObj')) {
|
|
|
- if (this.endPlace.schoosearea && this.endPlace.schoosearea == '全部' && this.endPlace.schoosearea !=
|
|
|
- '请选择区') {
|
|
|
- _data.unLoadingPlaceCity = this.endPlace.schoosecity
|
|
|
- } else if (this.endPlace.schoosearea) {
|
|
|
- _data.unLoadingPlace = this.endPlace.selected == "全国" ? '' : this.endPlace.selected
|
|
|
- } else {
|
|
|
- _data.unLoadingPlace = this.endPlace.selected == "全国" ? '' : this.endPlace.selected
|
|
|
- _data.unLoadingPlaceCity = this.endPlace.schoosecity
|
|
|
- }
|
|
|
- } else {
|
|
|
- _data.unLoadingPlace = this.endPlace.selected == "全国" ? '' : this.endPlace.selected
|
|
|
- }
|
|
|
- if (this.lng) {
|
|
|
- _data.longitude = this.lng
|
|
|
- _data.latitude = this.lat
|
|
|
- }
|
|
|
- uni.showLoading({
|
|
|
- mask: true,
|
|
|
- title: '加载中'
|
|
|
- })
|
|
|
- this.$request.baseRequest('get', '/publishTaskInfo/selectGoodsSource', _data).then(res => {
|
|
|
- if (res.code == 200) {
|
|
|
- uni.hideLoading()
|
|
|
- this.mescroll.endBySize(res.data.records.length, res.data.total);
|
|
|
- // for (var i = 0; i < res.data.records.length; i++) {
|
|
|
- // res.data.records[i].cargoOwnerName1=
|
|
|
- // }
|
|
|
- if (page.num == 1) {
|
|
|
- this.goods = [];
|
|
|
- // this.otherGoods = []
|
|
|
- }; //如果是第一页需手动制空列表
|
|
|
- that.goods = that.goods.concat(res.data.records);
|
|
|
- for (let i = 0; i < that.goods.length; i++) {
|
|
|
- if (that.goods[i].peripheralInfo == 1) {
|
|
|
- that.isFirstIndex = i
|
|
|
- return
|
|
|
+ _data.driverLongitude = this.lng
|
|
|
+ _data.driverLatitude = this.lat
|
|
|
+ // }
|
|
|
+ console.log('------')
|
|
|
+ console.log(_data)
|
|
|
+ if (uni.getStorageSync('fPlaceObj')) {
|
|
|
+ if (this.startPlace.fchoosearea && this.startPlace.fchoosearea == '全部' && this.startPlace
|
|
|
+ .fchoosearea != '请选择区') {
|
|
|
+ // _data.loadingPlaceCity = this.startPlace.fchoosecity
|
|
|
+ if(this.startPlace.fchoosecity=='市辖区'){
|
|
|
+ _data.loadingPlaceCity = this.startPlace.fchooseprovince
|
|
|
+ }else{
|
|
|
+ _data.loadingPlaceCity = this.startPlace.fchoosecity
|
|
|
}
|
|
|
+ } else if (this.startPlace.fchoosecity == '全部') {
|
|
|
+ _data.loadingPlace = this.startPlace.selected
|
|
|
+ } else {
|
|
|
+ _data.loadingPlaceCity = this.startPlace.fchoosecity
|
|
|
+ _data.loadingPlace = this.startPlace.fchoosearea
|
|
|
}
|
|
|
+
|
|
|
+ } else {
|
|
|
+ _data.loadingPlaceCity = this.startPlace.fchoosecity
|
|
|
}
|
|
|
- uni.hideLoading()
|
|
|
- })
|
|
|
- .catch(res => {
|
|
|
- uni.$u.toast(res.message);
|
|
|
- this.mescroll.endErr();
|
|
|
- });
|
|
|
+ if (uni.getStorageSync('sPlaceObj')) {
|
|
|
+ if (this.endPlace.schoosearea && this.endPlace.schoosearea == '全部' && this.endPlace.schoosearea !=
|
|
|
+ '请选择区') {
|
|
|
+ if(this.endPlace.schoosecity=='市辖区'){
|
|
|
+ _data.unLoadingPlaceCity = this.endPlace.schooseprovince
|
|
|
+ }else{
|
|
|
+ _data.unLoadingPlaceCity = this.endPlace.schoosecity
|
|
|
+ }
|
|
|
+ } else if (this.endPlace.schoosearea) {
|
|
|
+ _data.unLoadingPlace = this.endPlace.selected == "全国" ? '' : this.endPlace.selected
|
|
|
+ } else {
|
|
|
+ _data.unLoadingPlace = this.endPlace.selected == "全国" ? '' : this.endPlace.selected
|
|
|
+ _data.unLoadingPlaceCity = this.endPlace.schoosecity
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ _data.unLoadingPlace = this.endPlace.selected == "全国" ? '' : this.endPlace.selected
|
|
|
+ }
|
|
|
+ if (this.lng) {
|
|
|
+ _data.longitude = this.lng
|
|
|
+ _data.latitude = this.lat
|
|
|
+ }
|
|
|
+ uni.showLoading({
|
|
|
+ mask: true,
|
|
|
+ title: '加载中'
|
|
|
+ })
|
|
|
+ console.log(_data)
|
|
|
+ this.$request.baseRequest('get', '/publishTaskInfo/selectGoodsSource', _data).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ uni.hideLoading()
|
|
|
+ if (page.num == 1) {
|
|
|
+ this.goods = [];
|
|
|
+ // this.otherGoods = []
|
|
|
+ };
|
|
|
+ if(res.data.records){
|
|
|
+ for(var i=0;i<res.data.records.length;i++){
|
|
|
+ if(res.data.records[i].cargoDistance){
|
|
|
+ if(res.data.records[i].cargoDistance>10){
|
|
|
+ res.data.records[i].cargoDistance=res.data.records[i].cargoDistance.toFixed(0)
|
|
|
+ }else{
|
|
|
+ res.data.records[i].cargoDistance=res.data.records[i].cargoDistance.toFixed(1)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(res.data.records[i].distance){
|
|
|
+ if(res.data.records[i].distance>10){
|
|
|
+ res.data.records[i].distance=res.data.records[i].distance.toFixed(0)
|
|
|
+ }else{
|
|
|
+ res.data.records[i].distance=res.data.records[i].distance.toFixed(1)
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.mescroll.endBySize(res.data.records.length, res.data.total);
|
|
|
+ // for (var i = 0; i < res.data.records.length; i++) {
|
|
|
+ // res.data.records[i].cargoOwnerName1=
|
|
|
+ // }
|
|
|
+ //如果是第一页需手动制空列表
|
|
|
+ if(res.data.records){
|
|
|
+ that.goods = that.goods.concat(res.data.records);
|
|
|
+ for (let i = 0; i < that.goods.length; i++) {
|
|
|
+ if (that.goods[i].peripheralInfo == 1) {
|
|
|
+ that.isFirstIndex = i
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ that.goods=[]
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(res => {
|
|
|
+ uni.$u.toast(res.message);
|
|
|
+ this.mescroll.endErr();
|
|
|
+ });
|
|
|
},
|
|
|
clickTab(val) {
|
|
|
this.tabIndex = val.index
|
|
@@ -582,7 +858,7 @@
|
|
|
if (this.endPlace.selected == '全国') {
|
|
|
this.$refs.uToast.show({
|
|
|
type: 'error',
|
|
|
- message: "卸车地为全国不允许切换!",
|
|
|
+ message: "装车地不能为全国!",
|
|
|
})
|
|
|
return
|
|
|
}
|
|
@@ -777,6 +1053,7 @@
|
|
|
|
|
|
.other-goods {
|
|
|
// background: red;
|
|
|
+ color:#999999;
|
|
|
margin: 40rpx 0;
|
|
|
display: flex;
|
|
|
justify-content: center;
|