Commit 847d71fb authored by Damon's avatar Damon
parents bc97813a 8cb99bc6
...@@ -58,14 +58,14 @@ const install = (Vue, vm) => { ...@@ -58,14 +58,14 @@ const install = (Vue, vm) => {
return config; return config;
} }
function getCode(res){ function getCode(res){
const result = res.data || res // const result = res.data || res
let code // let code
if(result.hasOwnProperty('statusCode')){ // if(result.hasOwnProperty('statusCode')){
code = res.statusCode // code = res.statusCode
}else if(result.hasOwnProperty('code')){ // }else if(result.hasOwnProperty('code')){
code = result.code // code = result.code
} // }
return code return res.statusCode || res.code || res.data.statusCode || res.data.code
} }
function getMsg(res){ function getMsg(res){
res = res.data || res res = res.data || res
......
...@@ -162,7 +162,9 @@ ...@@ -162,7 +162,9 @@
} }
}; };
await app.getBaseInfo(self, callBack); await app.getBaseInfo(self, callBack);
this.orderList = []
this.messageList = []
// 加载消息列表 // 加载消息列表
self.loadMessageList(); self.loadMessageList();
self.loadOrderList(); self.loadOrderList();
...@@ -184,7 +186,6 @@ ...@@ -184,7 +186,6 @@
}, },
loadOrderList() { loadOrderList() {
console.log('-----------准备加载推荐列表-----------') console.log('-----------准备加载推荐列表-----------')
return
let self = this; let self = this;
// 加载订单列表 // 加载订单列表
self.search.token = self.vuex_token; self.search.token = self.vuex_token;
...@@ -192,7 +193,7 @@ ...@@ -192,7 +193,7 @@
uni.stopPullDownRefresh() // 结束下拉刷新 uni.stopPullDownRefresh() // 结束下拉刷新
if (res.code == 200) { if (res.code == 200) {
if (res.data && res.data.length > 0) { if (res.data && res.data.length > 0) {
self.orderList.push().apply(res.data); self.orderList.push(...res.data);
} }
} else { } else {
console.log(res.message, "初始化订单列表异常"); console.log(res.message, "初始化订单列表异常");
......
...@@ -103,20 +103,25 @@ ...@@ -103,20 +103,25 @@
</view> </view>
<!-- 异常预约 ,现场拍照 这里是调用拍照的两个组件--> <!-- 异常预约 ,现场拍照 这里是调用拍照的两个组件-->
<view class="right"> <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>
</view> </view>
<take-photo type="test" v-if="takeStatus" @close="closeTake"></take-photo>
</view> </view>
</template> </template>
<script> <script>
import appointTime from '@/components/appoint/appoint-time.vue' import appointTime from '@/components/appoint/appoint-time.vue'
import { import takePhoto from '@/components/take/index.vue'
getQueryString
} from '@/common/util.js'
export default { export default {
components: { components: {
appointTime appointTime,
'take-photo': takePhoto
}, },
data() { data() {
return { return {
...@@ -141,7 +146,10 @@ ...@@ -141,7 +146,10 @@
showTimeSelect: false, showTimeSelect: false,
submitType: '', submitType: '',
nextUrl:'', nextUrl:'',
btnClass:'appoint-btn' btnClass:'appoint-btn',
takeStatus:false,
errorSignIn:false,
scenePhoto: false
} }
}, },
onLoad(option) { onLoad(option) {
...@@ -155,9 +163,6 @@ ...@@ -155,9 +163,6 @@
this.loadOrderDetail() this.loadOrderDetail()
this.loadOrderRecord() this.loadOrderRecord()
this.getLocation() this.getLocation()
},
created() {
}, },
computed: { computed: {
phoneIcon() { phoneIcon() {
...@@ -172,6 +177,21 @@ ...@@ -172,6 +177,21 @@
} }
}, },
methods: { 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() { // 获取工单详情 loadOrderDetail() { // 获取工单详情
let self = this let self = this
let timestamp = new Date().getTime(); let timestamp = new Date().getTime();
...@@ -265,12 +285,14 @@ ...@@ -265,12 +285,14 @@
this.allowFeedback = true this.allowFeedback = true
this.showCenterBtn = true this.showCenterBtn = true
this.submitType = "maintainWorkerCheckin" this.submitType = "maintainWorkerCheckin"
this.errorSignIn = true
} else if (orderStatus > 31 && orderStatus < 80) { } else if (orderStatus > 31 && orderStatus < 80) {
// 完工 // 完工
this.centerButton = "filish" this.centerButton = "filish"
this.centerButtonText = "去完工" this.centerButtonText = "去完工"
this.allowFeedback = true this.allowFeedback = true
this.showCenterBtn = true this.showCenterBtn = true
this.scenePhoto = true
} else {} } else {}
}, },
handleBtn() { handleBtn() {
......
...@@ -13,24 +13,23 @@ ...@@ -13,24 +13,23 @@
</view> </view>
</view> </view>
<view class="u-tabs-box" v-show="curNow == 0"> <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" <u-tabs 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" :offset="[-1,10]" :list="list" count="total" :current="current" @change="change"
:is-scroll="false" swiperWidth="750"></u-tabs-swiper> :is-scroll="false"></u-tabs>
</view> </view>
<swiper class="swiper-box" :current="swiperCurrent" @transition="transition" <!-- <swiper class="swiper-box" :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish"> -->
@animationfinish="animationfinish"> <!-- <swiper-item class="swiper-item" v-for="(res, ind) in orderList" :key="ind"> -->
<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> <scroll-view scroll-y style="height: 100%;width: 100%;" @scrolltolower="reachBottom" scroll-anchoring>
<view class="page-box"> <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" <OrderCell :orderData="item" :orderType="orderType" :location="dataValue"
@click="handleClick(item)" @action="handleAction(item)"> </OrderCell> @click="handleClick(item)" @action="handleAction(item)"> </OrderCell>
</view> </view>
<u-loadmore :status="loadStatus[ind]" bgColor="#F4F5F7"></u-loadmore> <u-loadmore :status="loadStatus" bgColor="#F4F5F7"></u-loadmore>
</view> </view>
</scroll-view> </scroll-view>
</swiper-item> <!-- </swiper-item>
</swiper> </swiper> -->
<!-- </view> --> <!-- </view> -->
</TabBarPage> </TabBarPage>
...@@ -48,8 +47,6 @@ ...@@ -48,8 +47,6 @@
return { return {
showSview: true, showSview: true,
curNow: 0, curNow: 0,
timestamp: 1000,
triggered: false,
pageNumber: 0, pageNumber: 0,
pageSize: 10, pageSize: 10,
//waitAccept、waitAppointment、waitCheckIn、waitFinish、exception、finish //waitAccept、waitAppointment、waitCheckIn、waitFinish、exception、finish
...@@ -61,8 +58,7 @@ ...@@ -61,8 +58,7 @@
4: 'exception', 4: 'exception',
5: 'finish' 5: 'finish'
}, },
orderList: [[],[],[],[],[],[]], orderList: [],
dataList: [],
list: [{ list: [{
name: '待预约', name: '待预约',
total: 0, total: 0,
...@@ -85,12 +81,8 @@ ...@@ -85,12 +81,8 @@
} }
], ],
current: 0, current: 0,
swiperCurrent: 0, loadStatus: 'loading',
tabsHeight: 0,
dx: 0,
loadStatus: ['loading','loading','loading','loading','loading','loading'],
dataValue: [], dataValue: [],
total: 0
}; };
}, },
onLoad() { onLoad() {
...@@ -107,22 +99,23 @@ ...@@ -107,22 +99,23 @@
return this.currentIndex + 1 return this.currentIndex + 1
}, },
currentIndex() { currentIndex() {
return this.curNow == 0 ? this.swiperCurrent : 5 return this.curNow == 0 ? this.current : 5
} }
}, },
methods: { methods: {
sectionChange(index) { sectionChange(index) {
this.curNow = index; this.curNow = index;
this.pageNumber = 0 this.pageNumber = 0
if (index === 1) { this.orderList = []
this.showSview = false this.loadStatus = 'loading'
// 加载已完工的数据 this.getOrderList(index === 0 ? 0 : 5)
this.getOrderList(5) },
} else { // tab栏切换
this.showSview = true change(index) {
// 加载已完工的数据 this.current = index;
this.getOrderList(0) this.orderList = []
} this.loadStatus = 'loading'
this.getOrderList(index);
}, },
/** /**
* 获取当前位置的经纬度 * 获取当前位置的经纬度
...@@ -145,10 +138,8 @@ ...@@ -145,10 +138,8 @@
}, },
reachBottom(e) { reachBottom(e) {
console.log(e) if (this.loadStatus != 'loadmore') return
console.log(this.loadStatus[this.currentIndex]) this.loadStatus == 'loading'
if (this.loadStatus[this.currentIndex] != 'loadmore') return
this.loadStatus[this.currentIndex] == 'loading'
this.getOrderList(this.currentIndex) this.getOrderList(this.currentIndex)
}, },
// 页面数据 // 页面数据
...@@ -196,11 +187,11 @@ ...@@ -196,11 +187,11 @@
...res.data.list,...res.data.list,...res.data.list,...res.data.list,...res.data.list,...res.data.list] ...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) { 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.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 { } else {
console.log(res.message, "获取订单数量失败!"); console.log(res.message, "获取订单数量失败!");
...@@ -235,27 +226,6 @@ ...@@ -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) { // 跳转工单详情页面 viewOderItem(orderId) { // 跳转工单详情页面
uni.navigateTo({ uni.navigateTo({
url: 'pages/order/detail?id=' + orderId 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