Commit 018535cd authored by Facius's avatar Facius

工单列表点击状态栏滚动到顶部,订单编号长按复制

parent 38ba60f2
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
</view> </view>
<view class="order-cell"> <view class="order-cell">
<text>工单编号:</text> <text>工单编号:</text>
<text>{{ order.orderNumber }}</text> <text @longpress="handleLongpress(order.orderNumber)">{{ order.orderNumber }}</text>
</view> </view>
<view class="order-cell"> <view class="order-cell">
<text>合作厂商:</text> <text>合作厂商:</text>
...@@ -158,6 +158,14 @@ ...@@ -158,6 +158,14 @@
}, },
handleClick(val) { handleClick(val) {
this.$emit('update:readMore', val) this.$emit('update:readMore', val)
},
handleLongpress(text) {
uni.setClipboardData({
data: text,
success: function () {
console.log('success');
}
});
} }
} }
} }
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<text>{{item.name + ':'}}</text> <text>{{item.name + ':'}}</text>
</view> </view>
<view class="info-content"> <view class="info-content">
<text>{{orderData[key]}}</text> <text @longpress="handleLongpress(key, orderData[key])">{{orderData[key]}}</text>
<text v-if="item.content">{{' / ' + orderData[item.content]}}</text> <text v-if="item.content">{{' / ' + orderData[item.content]}}</text>
</view> </view>
</view> </view>
...@@ -322,6 +322,16 @@ ...@@ -322,6 +322,16 @@
var time = new Date().getTime() var time = new Date().getTime()
this.timeout = this.orderData.currentOverTime < time this.timeout = this.orderData.currentOverTime < time
this.timestamp = Math.round(Math.abs(this.orderData.currentOverTime - time) / 1000) this.timestamp = Math.round(Math.abs(this.orderData.currentOverTime - time) / 1000)
},
handleLongpress(key, text) { // 长按复制单号
if (key == 'orderNumber') {
uni.setClipboardData({
data: text,
success: function () {
console.log('success');
}
});
}
} }
} }
} }
......
...@@ -55,8 +55,11 @@ ...@@ -55,8 +55,11 @@
handleClose() { handleClose() {
this.$emit('update:show', false) this.$emit('update:show', false)
}, },
handleOperate() { handleOperate(type) {
this.$emit('operate') // 调接口
// 刷新页面
// 告诉父级做了操作
this.$emit('operate', type)
}, },
handleApply() { handleApply() {
this.$emit('apply') this.$emit('apply')
......
<template> <template>
<TabBarPage title="订单" :fixed="true"> <TabBarPage title="订单" :fixed="true" @click="goTop">
<view class="tools-box"> <view class="tools-box">
<view class="search-sub"> <view class="search-sub">
<u-subsection :current="curNow" :list="subList" active-color="white" bg-color="white" <u-subsection :current="curNow" :list="subList" active-color="white" bg-color="white"
...@@ -20,16 +20,18 @@ ...@@ -20,16 +20,18 @@
<view class="tab-view"> <view class="tab-view">
<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
scroll-y="true" refresher-enabled="true" :refresher-triggered="triggered" :refresher-threshold="100" refresher-enabled="true" :refresher-triggered="triggered" :refresher-threshold="100" :scroll-top="scrollTop"
refresher-background="#F4F5F7" @refresherpulling="triggered = true" @refresherrefresh="onRefresh" refresher-background="#F4F5F7" @refresherpulling="triggered = true" @refresherrefresh="onRefresh"
@refresherrestore="onRestore"> @refresherrestore="onRestore" @scroll="scroll" enable-back-to-top>
<NoOrder v-if="noMore" type="black" :customStyle="noOrderCustomStyle" /> <NoOrder v-if="noMore" type="black" :customStyle="noOrderCustomStyle" />
<template v-else> <template v-else>
<view v-for="(item, index) in orderList" :key="item.orderId"> <view v-for="(item, index) in orderList" :key="item.orderId">
<OrderCell :orderData="item" :type="orderType" :location="dataValue" @click="handleClick" <OrderCell :orderData="item" :type="orderType" :location="dataValue" @click="handleClick"
@action="handleClick"> </OrderCell> @action="handleClick"> </OrderCell>
</view> </view>
<u-loadmore v-show="(pageNumber == 1 && loaded) || pageNumber > 2" :status="loadStatus" bgColor="#F4F5F7"></u-loadmore> <view class="load-more-view">
<u-loadmore v-show="(pageNumber == 1 && loaded) || pageNumber > 2" :status="loadStatus" bgColor="#F4F5F7"></u-loadmore>
</view>
</template> </template>
</scroll-view> </scroll-view>
</view> </view>
...@@ -81,6 +83,10 @@ ...@@ -81,6 +83,10 @@
loaded: false, loaded: false,
triggered: false, triggered: false,
_freshing: false, _freshing: false,
scrollTop: 0,
old: {
scrollTop: 0
}
}; };
}, },
computed: { computed: {
...@@ -270,7 +276,16 @@ ...@@ -270,7 +276,16 @@
this.loadStatus = 'loading' this.loadStatus = 'loading'
this.getOrderCount(); this.getOrderCount();
this.getOrderList(this.currentIndex); this.getOrderList(this.currentIndex);
} },
scroll(e) {
this.old.scrollTop = e.detail.scrollTop
},
goTop(e) {
this.scrollTop = this.old.scrollTop
this.$nextTick(function() {
this.scrollTop = 0
});
},
} }
}; };
</script> </script>
...@@ -453,7 +468,10 @@ ...@@ -453,7 +468,10 @@
.tab-view { .tab-view {
height: 100%; height: 100%;
overflow: auto; overflow: auto;
padding-bottom: 20rpx; // padding-bottom: 20rpx;
.load-more-view {
margin-bottom: 20rpx;
}
} }
.tools-box { .tools-box {
......
...@@ -218,7 +218,7 @@ ...@@ -218,7 +218,7 @@
disabled: this.centerBtnDisabled, disabled: this.centerBtnDisabled,
id: 0, id: 0,
customStyle: { customStyle: {
'background-color': this.isCompetition ? '#FF930D' : (this.centerBtnDisabled ? '#D1D4D4' : '#2272FF') 'background-color': this.isCompetitionAndWaitAccept ? '#FF930D' : (this.centerBtnDisabled ? '#D1D4D4' : '#2272FF')
} }
}] }]
}, },
...@@ -284,6 +284,10 @@ ...@@ -284,6 +284,10 @@
// 待接单 && 业务类型非抢单 // 待接单 && 业务类型非抢单
return this.type == 'waitAccept' && !this.isCompetition return this.type == 'waitAccept' && !this.isCompetition
}, },
isCompetitionAndWaitAccept() { // 抢单页面
// 待接单 && 业务类型抢单
return this.type == 'waitAccept' && this.isCompetition
},
showBottomBtn() { // 显示底部button showBottomBtn() { // 显示底部button
// 0 待接单、待抢单, 1 待预约, 2 待签到, 3 待完工, 8 已被抢 // 0 待接单、待抢单, 1 待预约, 2 待签到, 3 待完工, 8 已被抢
return [0, 1, 2, 3, 8].indexOf(this.types[this.type]) != -1 return [0, 1, 2, 3, 8].indexOf(this.types[this.type]) != -1
...@@ -566,7 +570,7 @@ ...@@ -566,7 +570,7 @@
}) })
}, },
setOrderType() { setOrderType() {
// 根据工单状态确定按钮的显示 // 确定工单类型
var orderStatus = this.order.orderStatus var orderStatus = this.order.orderStatus
if (orderStatus < 31) { if (orderStatus < 31) {
// 接单 // 接单
...@@ -640,66 +644,6 @@ ...@@ -640,66 +644,6 @@
}) })
if(res && res.code == 200) { if(res && res.code == 200) {
this.partsList = res.data this.partsList = res.data
var info = {
"id": -42709016.6594239,
"type": 88413470.94766659,
"orderNumber": "pariatur laborum ea ex esse",
"uid": -61461132.62552948,
"workerId": 70257764.93749124,
"siteId": 91073388.46493345,
"status": -78811049.71325992,
"totalPriceApply": -69669986.12053828,
"totalPriceOuter": -38559657.143752135,
"totalPriceWarranty": -9593647.922237426,
"totalPriceActual": 35845815.5364739,
"warehouseId": 43961846.7964488,
"applyRemark": "laborum",
"deliverRemark": "ipsum",
"createTime": "cillum in",
"updateTime": "quis anim Excepteur",
"items": [{
"id": 85963506.7881138,
"orderId": 76010853.55550486,
"name": "enim anim",
"partId": 83077645.73603413,
"status": 66648893.6392526,
"quantity": 56583424.78318676,
"priceApply": -64258092.910463735,
"priceActual": -99843111.0489868,
"returnType": 18577818.731817245,
"useCount": 88566288.29139715,
"createTime": "sit",
"updateTime": "voluptate magna",
"returnId": 80564978.93037826
}],
"images": "/rest/file/image/parts/invoice_1591333116039992.jpg,/rest/file/image/parts/invoice_1591333116048870.jpg",
"statusText": "待审核",
"productBarcode": "aliquip eiusmod",
"categoryName": "电冰箱",
"productId": -92130282.75386024,
"supplierId": -38136950.98157277,
"express": {
"orderId": -52586906.11654462,
"status": 30015312.066286445,
"name": "deserunt non pariatur",
"phoneNumber": "sint cupidatat culpa",
"areaCode": 80825529.78860953,
"address": "qui aliqua",
"createTime": "minim reprehenderit incididunt nostrud sunt",
"deliveryTime": "magna enim officia aliqua ut",
"updateTime": "exercitation aliqua mollit consequat ea",
"number": "fugiat amet dolore sint",
"com": "Ut cupidatat",
"remark": "Duis pariatur"
},
"measures": "est laboris aute",
"workOrderNumber": "OR20150327000003",
"productModel": "id sunt incididunt",
"workOrderId": 72686362.92537045,
"brandName": "长虹(CHANGHONG)"
}
console.log('-------data--------:', this.partsList, info)
this.partsList = [info]
} }
if (this.partsList.length > 0) { // 已经有配件,弹出配件列表 if (this.partsList.length > 0) { // 已经有配件,弹出配件列表
this.showApplyList = true this.showApplyList = true
......
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