Commit 847d71fb authored by Damon's avatar Damon
parents bc97813a 8cb99bc6
......@@ -58,14 +58,14 @@ const install = (Vue, vm) => {
return config;
}
function getCode(res){
const result = res.data || res
let code
if(result.hasOwnProperty('statusCode')){
code = res.statusCode
}else if(result.hasOwnProperty('code')){
code = result.code
}
return code
// const result = res.data || res
// let code
// if(result.hasOwnProperty('statusCode')){
// code = res.statusCode
// }else if(result.hasOwnProperty('code')){
// code = result.code
// }
return res.statusCode || res.code || res.data.statusCode || res.data.code
}
function getMsg(res){
res = res.data || res
......
......@@ -162,7 +162,9 @@
}
};
await app.getBaseInfo(self, callBack);
this.orderList = []
this.messageList = []
// 加载消息列表
self.loadMessageList();
self.loadOrderList();
......@@ -184,7 +186,6 @@
},
loadOrderList() {
console.log('-----------准备加载推荐列表-----------')
return
let self = this;
// 加载订单列表
self.search.token = self.vuex_token;
......@@ -192,7 +193,7 @@
uni.stopPullDownRefresh() // 结束下拉刷新
if (res.code == 200) {
if (res.data && res.data.length > 0) {
self.orderList.push().apply(res.data);
self.orderList.push(...res.data);
}
} else {
console.log(res.message, "初始化订单列表异常");
......
......@@ -103,20 +103,25 @@
</view>
<!-- 异常预约 ,现场拍照 这里是调用拍照的两个组件-->
<view class="right">
<view v-show="allowRight" @click="allowRightClick" class="button"></view>
<view v-if="errorSignIn" @click="take" class="button">
<text>异常签到</text>
</view>
<view v-if="scenePhoto" @click="scenePhotoClick" class="button">
<text>现场拍照</text>
</view>
</view>
</view>
<take-photo type="test" v-if="takeStatus" @close="closeTake"></take-photo>
</view>
</template>
<script>
import appointTime from '@/components/appoint/appoint-time.vue'
import {
getQueryString
} from '@/common/util.js'
import takePhoto from '@/components/take/index.vue'
export default {
components: {
appointTime
appointTime,
'take-photo': takePhoto
},
data() {
return {
......@@ -141,7 +146,10 @@
showTimeSelect: false,
submitType: '',
nextUrl:'',
btnClass:'appoint-btn'
btnClass:'appoint-btn',
takeStatus:false,
errorSignIn:false,
scenePhoto: false
}
},
onLoad(option) {
......@@ -155,9 +163,6 @@
this.loadOrderDetail()
this.loadOrderRecord()
this.getLocation()
},
created() {
},
computed: {
phoneIcon() {
......@@ -172,6 +177,21 @@
}
},
methods: {
scenePhotoClick() { // 跳转拍照小程序
uni.navigateTo({
url: 'pages/photo/list?orderId='+this.order.orderId+'&brandId='+this.order.lianbaoBrandId+'&brand='+this.order.brandName
+'&systemId='+this.order.partnerCompanyId+'&classifyId='+this.order.categoryId
})
},
take() {
uni.hideTabBar()
this.takeStatus = true
},
closeTake() {
this.takeStatus = false
// 获取返回的图片 ,如果返回的图片存在则直接异常签约,成功后跳转到去完工页面,
},
loadOrderDetail() { // 获取工单详情
let self = this
let timestamp = new Date().getTime();
......@@ -265,12 +285,14 @@
this.allowFeedback = true
this.showCenterBtn = true
this.submitType = "maintainWorkerCheckin"
this.errorSignIn = true
} else if (orderStatus > 31 && orderStatus < 80) {
// 完工
this.centerButton = "filish"
this.centerButtonText = "去完工"
this.allowFeedback = true
this.showCenterBtn = true
this.scenePhoto = true
} else {}
},
handleBtn() {
......
......@@ -13,24 +13,23 @@
</view>
</view>
<view class="u-tabs-box" v-show="curNow == 0">
<u-tabs-swiper activeColor="#2272FF" bg-color="none" inactive-color="#999" bar-height="4" bar-width="44"
:offset="[-1,10]" ref="tabs" :list="list" count="total" :current="current" @change="change"
:is-scroll="false" swiperWidth="750"></u-tabs-swiper>
<u-tabs activeColor="#2272FF" bg-color="none" inactive-color="#999" bar-height="4" bar-width="44"
:offset="[-1,10]" :list="list" count="total" :current="current" @change="change"
:is-scroll="false"></u-tabs>
</view>
<swiper class="swiper-box" :current="swiperCurrent" @transition="transition"
@animationfinish="animationfinish">
<swiper-item class="swiper-item" v-for="(res, ind) in orderList" :key="ind">
<!-- <swiper class="swiper-box" :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish"> -->
<!-- <swiper-item class="swiper-item" v-for="(res, ind) in orderList" :key="ind"> -->
<scroll-view scroll-y style="height: 100%;width: 100%;" @scrolltolower="reachBottom" scroll-anchoring>
<view class="page-box">
<view v-for="(item, index) in res" :key="item.orderId">
<view v-for="(item, index) in orderList" :key="item.orderId">
<OrderCell :orderData="item" :orderType="orderType" :location="dataValue"
@click="handleClick(item)" @action="handleAction(item)"> </OrderCell>
</view>
<u-loadmore :status="loadStatus[ind]" bgColor="#F4F5F7"></u-loadmore>
<u-loadmore :status="loadStatus" bgColor="#F4F5F7"></u-loadmore>
</view>
</scroll-view>
</swiper-item>
</swiper>
<!-- </swiper-item>
</swiper> -->
<!-- </view> -->
</TabBarPage>
......@@ -48,8 +47,6 @@
return {
showSview: true,
curNow: 0,
timestamp: 1000,
triggered: false,
pageNumber: 0,
pageSize: 10,
//waitAccept、waitAppointment、waitCheckIn、waitFinish、exception、finish
......@@ -61,8 +58,7 @@
4: 'exception',
5: 'finish'
},
orderList: [[],[],[],[],[],[]],
dataList: [],
orderList: [],
list: [{
name: '待预约',
total: 0,
......@@ -85,12 +81,8 @@
}
],
current: 0,
swiperCurrent: 0,
tabsHeight: 0,
dx: 0,
loadStatus: ['loading','loading','loading','loading','loading','loading'],
loadStatus: 'loading',
dataValue: [],
total: 0
};
},
onLoad() {
......@@ -107,22 +99,23 @@
return this.currentIndex + 1
},
currentIndex() {
return this.curNow == 0 ? this.swiperCurrent : 5
return this.curNow == 0 ? this.current : 5
}
},
methods: {
sectionChange(index) {
this.curNow = index;
this.pageNumber = 0
if (index === 1) {
this.showSview = false
// 加载已完工的数据
this.getOrderList(5)
} else {
this.showSview = true
// 加载已完工的数据
this.getOrderList(0)
}
this.pageNumber = 0
this.orderList = []
this.loadStatus = 'loading'
this.getOrderList(index === 0 ? 0 : 5)
},
// tab栏切换
change(index) {
this.current = index;
this.orderList = []
this.loadStatus = 'loading'
this.getOrderList(index);
},
/**
* 获取当前位置的经纬度
......@@ -145,10 +138,8 @@
},
reachBottom(e) {
console.log(e)
console.log(this.loadStatus[this.currentIndex])
if (this.loadStatus[this.currentIndex] != 'loadmore') return
this.loadStatus[this.currentIndex] == 'loading'
if (this.loadStatus != 'loadmore') return
this.loadStatus == 'loading'
this.getOrderList(this.currentIndex)
},
// 页面数据
......@@ -196,11 +187,11 @@
...res.data.list,...res.data.list,...res.data.list,...res.data.list,...res.data.list,...res.data.list]
/*↑↑↑↑↑↑↑↑↑↑测试数据↑↑↑↑↑↑↑↑↑↑↑↑↑*/
// 后台需要返回order_type,防止数据返回延迟期间点击了其他的tab
// 后台需要返回orderType,防止数据返回延迟期间点击了其他的tab
if (res.data) {
self.orderList[res.data.orderType].push(...res.data.list)
self.orderList.push(...res.data.list)
self.list[res.data.orderType].total = res.data.total
self.loadStatus[res.data.orderType] = res.data.total > self.orderList[res.data.orderType].length ? 'loadmore' : 'nomore'
self.loadStatus = res.data.total > self.orderList.length ? 'loadmore' : 'nomore'
}
} else {
console.log(res.message, "获取订单数量失败!");
......@@ -235,27 +226,6 @@
}
});
},
// tab栏切换
change(index) {
this.swiperCurrent = index;
this.getOrderList(index);
},
transition({
detail: {
dx
}
}) {
this.$refs.tabs.setDx(dx);
},
animationfinish({
detail: {
current
}
}) {
this.$refs.tabs.setFinishCurrent(current);
this.swiperCurrent = current;
this.current = current;
},
viewOderItem(orderId) { // 跳转工单详情页面
uni.navigateTo({
url: 'pages/order/detail?id=' + orderId
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment