|
@@ -12,7 +12,7 @@
|
|
|
height="35px" @click="myPage"></u--image>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="driver" v-show="indexbtn == 1">
|
|
|
+ <view class="driver" v-if="indexbtn == 1">
|
|
|
<view class="flex screen">
|
|
|
<view @click="selectAddress(1)" class="screen_item">
|
|
|
<view class="screen_sign sign1">装</view>
|
|
@@ -28,47 +28,50 @@
|
|
|
<itmister-address-picker-other ref="addressEltwo" :wholeCountry="true"
|
|
|
@confirmChange="confirmChangeTwo"></itmister-address-picker-other>
|
|
|
</view>
|
|
|
- <view class="route" >
|
|
|
- <view v-for="(item,index) in routeData">
|
|
|
- <view class="flex route_item">
|
|
|
- <view style="width: 20%;">
|
|
|
- <u-avatar :src="item.driverPortrait" size="60"></u-avatar>
|
|
|
- </view>
|
|
|
- <view style="width: 80%;">
|
|
|
- <view class="flex">
|
|
|
- <view class="driver_name">
|
|
|
- {{item.driverNickname}}
|
|
|
- </view>
|
|
|
- <view class="driver_invite">
|
|
|
- <view class="route_invite" style="margin-left: 30px;" @click="invitation(item)">
|
|
|
- <image src="../../static/images/riders/yaoqing.png" mode=""
|
|
|
- style="width: 26rpx;height: 26rpx;margin-rigth:10rpx;"></image>邀请
|
|
|
+ <view class="route">
|
|
|
+ <mescroll-body ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback">
|
|
|
+ <view v-for="(item,index) in routeData">
|
|
|
+ <view class="flex route_item">
|
|
|
+ <view style="width: 20%;">
|
|
|
+ <u-avatar :src="item.driverPortrait" size="60"></u-avatar>
|
|
|
+ </view>
|
|
|
+ <view style="width: 80%;">
|
|
|
+ <view class="flex">
|
|
|
+ <view class="driver_name">
|
|
|
+ {{item.driverNickname}}
|
|
|
</view>
|
|
|
+ <view class="driver_invite">
|
|
|
+ <view class="route_invite" style="margin-left: 30px;" @click="invitation(item)">
|
|
|
+ <image src="../../static/images/riders/yaoqing.png" mode=""
|
|
|
+ style="width: 26rpx;height: 26rpx;margin-rigth:10rpx;"></image>邀请
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <u-picker :show="fleetShow" :columns="columns" @cancel="fleetClose"
|
|
|
+ @confirm="invitationCheng">
|
|
|
+ </u-picker>
|
|
|
+ </view>
|
|
|
+ <view class="address" v-for="(items,index) in item.startAdress">
|
|
|
+ <span class="spots spot1"></span>
|
|
|
+ {{item.startAdress[index]}}
|
|
|
+ <!-- {{item.sendCity ? item.sendCity: item.sendProvince }}{{item.sendArea}} -->
|
|
|
+ <image class="jt-icon" src="@/static/images/goodSource/jt.png" mode='widthFix'>
|
|
|
+ </image>
|
|
|
+ <span class="spots spot2"></span>
|
|
|
+ {{item.endAdress[index]}}
|
|
|
+ <!-- {{item.unloadCity ? item.unloadCity: item.unloadProvince }}{{item.unloadArea}} -->
|
|
|
</view>
|
|
|
- <u-picker :show="fleetShow" :columns="columns" @cancel="fleetClose"
|
|
|
- @confirm="invitationCheng">
|
|
|
- </u-picker>
|
|
|
- </view>
|
|
|
- <view class="address" v-for="(items,index) in item.startAdress">
|
|
|
- <span class="spots spot1"></span>
|
|
|
- {{item.startAdress[index]}}
|
|
|
- <!-- {{item.sendCity ? item.sendCity: item.sendProvince }}{{item.sendArea}} -->
|
|
|
- <image class="jt-icon" src="@/static/images/goodSource/jt.png" mode='widthFix'></image>
|
|
|
- <span class="spots spot2"></span>
|
|
|
- {{item.endAdress[index]}}
|
|
|
- <!-- {{item.unloadCity ? item.unloadCity: item.unloadProvince }}{{item.unloadArea}} -->
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- </view>
|
|
|
- <u-loadmore :status="status" :nomore-text="nomoreText" />
|
|
|
+ <!-- <u-loadmore :status="status" :nomore-text="nomoreText" /> -->
|
|
|
+ </mescroll-body>
|
|
|
</view>
|
|
|
-
|
|
|
+
|
|
|
<!-- <view v-if="routeData.length == 0" style="background: #FFFFFF;text-align: center;padding-top: 20rpx;">
|
|
|
暂无数据
|
|
|
</view> -->
|
|
|
</view>
|
|
|
- <view class="riders" v-show="indexbtn == 2">
|
|
|
+ <view class="riders" v-if="indexbtn == 2">
|
|
|
<view class="flex riders_top">
|
|
|
<view @click="selectChange" class="riders_city">{{city ? city : province}}</view>
|
|
|
<itmister-address-picker ref="addressElthree" :showCheck="false" @confirmChange="confirmChangethree">
|
|
@@ -77,6 +80,7 @@
|
|
|
maxlength="15"></u-search>
|
|
|
</view>
|
|
|
<view class="fleet">
|
|
|
+ <mescroll-body ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback">
|
|
|
<view v-for="(item,index) in formData" class="flex">
|
|
|
<view class="fleet_item">
|
|
|
<view class="flex">
|
|
@@ -114,7 +118,8 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <u-loadmore :status="status" :nomore-text="nomoreText" />
|
|
|
+ <!-- <u-loadmore :status="status" :nomore-text="nomoreText" /> -->
|
|
|
+ </mescroll-body>
|
|
|
</view>
|
|
|
|
|
|
<!-- <view v-if="formData.length == 0" style="background: #FFFFFF;text-align: center;">
|
|
@@ -129,9 +134,11 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
|
|
|
import itmisterAddressPicker from '@/components/itmister-address-picker/itmister-address-picker.nvue'
|
|
|
import itmisterAddressPickerOther from '@/components/itmister-address-picker/itmister-address-picker-other.nvue'
|
|
|
export default {
|
|
|
+ mixins: [MescrollMixin], // 使用mixin
|
|
|
components: {
|
|
|
itmisterAddressPicker,
|
|
|
itmisterAddressPickerOther
|
|
@@ -175,7 +182,8 @@
|
|
|
paddingTop: "0",
|
|
|
},
|
|
|
status: 'loadmore',
|
|
|
- nomoreText: '实在没有了'
|
|
|
+ nomoreText: '实在没有了',
|
|
|
+ mescroll:{}
|
|
|
}
|
|
|
},
|
|
|
created() {},
|
|
@@ -203,12 +211,119 @@
|
|
|
}
|
|
|
this.commonId = uni.getStorageSync("firstAuthentication").commonId
|
|
|
this.checking()
|
|
|
- this.getList()
|
|
|
+ // this.getList()
|
|
|
},
|
|
|
onLoad() {},
|
|
|
methods: {
|
|
|
- lookfleet(item){
|
|
|
- uni.$u.route("/pages/riders/fleetSee?fleetId="+item.id)
|
|
|
+ mescrollInit(mescroll) {
|
|
|
+ this.mescroll = mescroll;
|
|
|
+ },
|
|
|
+ downCallback() {
|
|
|
+ // 第2种: 下拉刷新和上拉加载调同样的接口, 则不用第1种, 直接mescroll.resetUpScroll()即可
|
|
|
+ // 重置列表为第一页 (自动执行 page.num=1, 再触发upCallback方法 )
|
|
|
+ this.mescroll.resetUpScroll()
|
|
|
+ },
|
|
|
+ /*上拉加载的回调: 其中page.num:当前页 从1开始, page.size:每页数据条数,默认10 */
|
|
|
+ upCallback(page) {
|
|
|
+ console.log(page)
|
|
|
+ // 此处可以继续请求其他接口
|
|
|
+ if (page.num == 1) {
|
|
|
+ this.routeData = []
|
|
|
+ this.formData = []
|
|
|
+ // 请求其他接口...
|
|
|
+ }
|
|
|
+ // 如果希望先请求其他接口,再触发upCallback,可参考以下写法
|
|
|
+ // if(!this.isInitxx){
|
|
|
+ // apiGetxx().then(res=>{
|
|
|
+ // this.isInitxx = true
|
|
|
+ // this.mescroll.resetUpScroll() // 重新触发upCallback
|
|
|
+ // }).catch(()=>{
|
|
|
+ // this.mescroll.endErr()
|
|
|
+ // })
|
|
|
+ // return // 此处return,先获取xx
|
|
|
+ // }
|
|
|
+
|
|
|
+ //联网加载数据
|
|
|
+ this.status = 'loading';
|
|
|
+ if (this.indexbtn == 1) {
|
|
|
+ // if(this.sendInfo.sendProvince == "北京"||this.sendInfo.sendProvince == "重庆"||this.sendInfo.sendProvince == "天津"||this.sendInfo.sendProvince == "上海"){
|
|
|
+ // this.sendInfo.sendCity = this.sendInfo.sendProvince
|
|
|
+ // this.sendInfo.sendProvince = ""
|
|
|
+ // }
|
|
|
+ if (this.unloadInfo.unloadProvince == "全国") {
|
|
|
+ this.unloadInfo.unloadProvince = ""
|
|
|
+ }
|
|
|
+ this.$request.baseRequest('get', '/commonRoute/driverList', {
|
|
|
+ pageSize: page.size,
|
|
|
+ currentPage: page.num,
|
|
|
+ sendProvince: this.sendInfo.sendProvince,
|
|
|
+ sendCity: this.sendInfo.sendCity,
|
|
|
+ sendArea: this.sendInfo.sendArea,
|
|
|
+ unloadProvince: this.unloadInfo.unloadProvince,
|
|
|
+ unloadCity: this.unloadInfo.unloadCity,
|
|
|
+ unloadArea: this.unloadInfo.unloadArea
|
|
|
+ }).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ if (page.num == 1) {
|
|
|
+ this.routeData = []
|
|
|
+ this.formData = []
|
|
|
+ }
|
|
|
+ this.routeData = this.routeData.concat(res.data.records); //追加新数据
|
|
|
+
|
|
|
+ for (let i = 0; i < this.routeData.length; i++) {
|
|
|
+ if (this.routeData[i].startAdress) {
|
|
|
+ this.routeData[i].startAdress = this.routeData[i].startAdress.split(",")
|
|
|
+ }
|
|
|
+ if (this.routeData[i].endAdress) {
|
|
|
+ this.routeData[i].endAdress = this.routeData[i].endAdress.split(",")
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.$forceUpdate()
|
|
|
+ this.mescroll.endBySize(res.data.records.length, res.data.total);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(res => {
|
|
|
+ uni.$u.toast(res.message);
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ let that = this
|
|
|
+ this.$request.baseRequest('get', '/fleetInfo/selectFleetInfo', {
|
|
|
+ commonId: this.commonId,
|
|
|
+ province: this.province, //省
|
|
|
+ city: this.city, //市
|
|
|
+ searchKeyWord: this.searchKeyWord,
|
|
|
+ pageSize: page.size,
|
|
|
+ currentPage: page.num,
|
|
|
+ }).then(res => {
|
|
|
+ if (page.num == 1) {
|
|
|
+ this.routeData = []
|
|
|
+ this.formData = []
|
|
|
+ }
|
|
|
+ this.formData = this.formData.concat(res.data.records); //追加新数据
|
|
|
+
|
|
|
+ for (let i = 0; i < that.formData.length; i++) {
|
|
|
+ that.formData[i].textShow = false
|
|
|
+ if (that.formData[i].fleetUrl) {
|
|
|
+ that.formData[i].img = []
|
|
|
+ let imgList = that.formData[i].fleetUrl.split(",")
|
|
|
+ for (let j = 0; j < imgList.length; j++) {
|
|
|
+ that.formData[i].img.push({
|
|
|
+ url: imgList[j]
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.$forceUpdate()
|
|
|
+ this.mescroll.endBySize(res.data.records.length, res.data.total);
|
|
|
+
|
|
|
+ })
|
|
|
+ .catch(res => {
|
|
|
+ uni.$u.toast(res.message);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ lookfleet(item) {
|
|
|
+ uni.$u.route("/pages/riders/fleetSee?fleetId=" + item.id)
|
|
|
},
|
|
|
checking() {
|
|
|
this.statusVal = uni.getStorageSync("firstAuthentication").authenticationStatus
|
|
@@ -357,7 +472,7 @@
|
|
|
this.unloadInfo.unloadProvince = address.province ? address.province : ''
|
|
|
this.unloadInfo.unloadCity = address.city ? address.city : ''
|
|
|
this.unloadInfo.unloadArea = address.area ? address.area : ''
|
|
|
-
|
|
|
+
|
|
|
if (address.city == '全省') {
|
|
|
this.title2 = address.province
|
|
|
this.unloadInfo.unloadCity = ""
|
|
@@ -366,11 +481,11 @@
|
|
|
this.title2 = address.province + address.city
|
|
|
this.unloadInfo.unloadArea = ""
|
|
|
} else {
|
|
|
- if(address.province == '全国'){
|
|
|
+ if (address.province == '全国') {
|
|
|
this.title2 = address.province
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
this.title2 = address.province + address.city + address.area;
|
|
|
- }
|
|
|
+ }
|
|
|
}
|
|
|
uni.setStorageSync("unloadInfo", this.unloadInfo)
|
|
|
this.getList()
|
|
@@ -434,8 +549,8 @@
|
|
|
// this.sendInfo.sendCity = this.sendInfo.sendProvince
|
|
|
// this.sendInfo.sendProvince = ""
|
|
|
// }
|
|
|
- if(this.unloadInfo.unloadProvince =="全国"){
|
|
|
- this.unloadInfo.unloadProvince= ""
|
|
|
+ if (this.unloadInfo.unloadProvince == "全国") {
|
|
|
+ this.unloadInfo.unloadProvince = ""
|
|
|
}
|
|
|
this.$request.baseRequest('get', '/commonRoute/driverList', {
|
|
|
pageSize: 10,
|
|
@@ -443,7 +558,7 @@
|
|
|
sendProvince: this.sendInfo.sendProvince,
|
|
|
sendCity: this.sendInfo.sendCity,
|
|
|
sendArea: this.sendInfo.sendArea,
|
|
|
- unloadProvince: this.unloadInfo.unloadProvince ,
|
|
|
+ unloadProvince: this.unloadInfo.unloadProvince,
|
|
|
unloadCity: this.unloadInfo.unloadCity,
|
|
|
unloadArea: this.unloadInfo.unloadArea
|
|
|
}).then(res => {
|
|
@@ -457,12 +572,12 @@
|
|
|
this.routeData[i].endAdress = this.routeData[i].endAdress.split(",")
|
|
|
}
|
|
|
}
|
|
|
- if(res.data.total == 0){
|
|
|
+ if (res.data.total == 0) {
|
|
|
this.status = 'nomore'
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
this.status = 'loadmore'
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
})
|
|
|
.catch(res => {
|
|
@@ -491,9 +606,9 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if(res.data.total == 0){
|
|
|
+ if (res.data.total == 0) {
|
|
|
this.status = 'nomore'
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
this.status = 'loadmore'
|
|
|
}
|
|
|
})
|