Commit fabe331a authored by Damon's avatar Damon

Merge branch 'test' of git.banshouhui.com:lijundan/self-support into test

parents 38635224 9c6d9ebb
;(function() {
let NODE_ENV = 'prod' // dev:开发环境 | test:测试环境 | prod:生产环境
let NODE_ENV = 'test' // dev:开发环境 | test:测试环境 | prod:生产环境
let ENV_VAR = null
let VERSION_NUMBER = '1.5.0' //版本号
//小程序是否审核通过,参数配置在ucenter库version表,对应版本号的is_audit设置为1,将显示学习视频
......
......@@ -3023,6 +3023,8 @@
"terser-webpack-plugin": "^2.3.6",
"thread-loader": "^2.1.3",
"url-loader": "^2.2.0",
"vue-loader": "^15.9.2",
"vue-loader-v16": "npm:vue-loader@^16.1.0",
"vue-style-loader": "^4.1.2",
"webpack": "^4.0.0",
"webpack-bundle-analyzer": "^3.8.0",
......@@ -3037,14 +3039,6 @@
"integrity": "sha1-/q7SVZc9LndVW4PbwIhRpsY1IPo=",
"dev": true
},
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://repo.huaweicloud.com/repository/npm/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"requires": {
"color-convert": "^2.0.1"
}
},
"cacache": {
"version": "13.0.1",
"resolved": "https://registry.npm.taobao.org/cacache/download/cacache-13.0.1.tgz?cache=0&sync_timestamp=1616431156987&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcacache%2Fdownload%2Fcacache-13.0.1.tgz",
......@@ -3071,28 +3065,6 @@
"unique-filename": "^1.1.1"
}
},
"chalk": {
"version": "4.1.1",
"resolved": "https://repo.huaweicloud.com/repository/npm/chalk/-/chalk-4.1.1.tgz",
"integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==",
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://repo.huaweicloud.com/repository/npm/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://repo.huaweicloud.com/repository/npm/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
},
"css-loader": {
"version": "3.6.0",
"resolved": "https://registry.npm.taobao.org/css-loader/download/css-loader-3.6.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcss-loader%2Fdownload%2Fcss-loader-3.6.0.tgz",
......@@ -3187,15 +3159,11 @@
"slash": "^2.0.0"
}
},
"has-flag": {
"version": "4.0.0",
"resolved": "https://repo.huaweicloud.com/repository/npm/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ=="
},
"hash-sum": {
"version": "2.0.0",
"resolved": "https://registry.npm.taobao.org/hash-sum/download/hash-sum-2.0.0.tgz",
"integrity": "sha1-gdAbtd6OpKIUrV1urRtSNGCwtFo="
"integrity": "sha1-gdAbtd6OpKIUrV1urRtSNGCwtFo=",
"dev": true
},
"human-signals": {
"version": "1.1.1",
......@@ -3355,14 +3323,6 @@
"minipass": "^3.1.1"
}
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://repo.huaweicloud.com/repository/npm/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"requires": {
"has-flag": "^4.0.0"
}
},
"terser-webpack-plugin": {
"version": "2.3.8",
"resolved": "https://registry.npm.taobao.org/terser-webpack-plugin/download/terser-webpack-plugin-2.3.8.tgz?cache=0&sync_timestamp=1610196021147&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fterser-webpack-plugin%2Fdownload%2Fterser-webpack-plugin-2.3.8.tgz",
......@@ -3381,24 +3341,23 @@
}
},
"vue-loader": {
"version": "16.3.0",
"resolved": "https://repo.huaweicloud.com/repository/npm/vue-loader/-/vue-loader-16.3.0.tgz",
"integrity": "sha512-UDgni/tUVSdwHuQo+vuBmEgamWx88SuSlEb5fgdvHrlJSPB9qMBRF6W7bfPWSqDns425Gt1wxAUif+f+h/rWjg==",
"version": "15.9.8",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-15.9.8.tgz",
"integrity": "sha512-GwSkxPrihfLR69/dSV3+5CdMQ0D+jXg8Ma1S4nQXKJAznYFX14vHdc/NetQc34Dw+rBbIJyP7JOuVb9Fhprvog==",
"dev": true,
"requires": {
"chalk": "^4.1.0",
"hash-sum": "^2.0.0",
"loader-utils": "^2.0.0"
"@vue/component-compiler-utils": "^3.1.0",
"hash-sum": "^1.0.2",
"loader-utils": "^1.1.0",
"vue-hot-reload-api": "^2.3.0",
"vue-style-loader": "^4.1.0"
},
"dependencies": {
"loader-utils": {
"version": "2.0.0",
"resolved": "https://repo.huaweicloud.com/repository/npm/loader-utils/-/loader-utils-2.0.0.tgz",
"integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==",
"requires": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
"json5": "^2.1.2"
}
"hash-sum": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/hash-sum/-/hash-sum-1.0.2.tgz",
"integrity": "sha1-M7QHd3VMZDJXPBIMw4CLvRDUfwQ=",
"dev": true
}
}
}
......@@ -16421,6 +16380,94 @@
"vue-style-loader": "^4.1.0"
}
},
"vue-loader-v16": {
"version": "npm:vue-loader@16.5.0",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.5.0.tgz",
"integrity": "sha512-WXh+7AgFxGTgb5QAkQtFeUcHNIEq3PGVQ8WskY5ZiFbWBkOwcCPRs4w/2tVyTbh2q6TVRlO3xfvIukUtjsu62A==",
"dev": true,
"optional": true,
"requires": {
"chalk": "^4.1.0",
"hash-sum": "^2.0.0",
"loader-utils": "^2.0.0"
},
"dependencies": {
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"optional": true,
"requires": {
"color-convert": "^2.0.1"
}
},
"chalk": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
"dev": true,
"optional": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"optional": true,
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true,
"optional": true
},
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true,
"optional": true
},
"hash-sum": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/hash-sum/-/hash-sum-2.0.0.tgz",
"integrity": "sha512-WdZTbAByD+pHfl/g9QSsBIIwy8IT+EsPiKDs0KNX+zSHhdDLFKdZu0BQHljvO+0QI/BasbMSUa8wYNCZTvhslg==",
"dev": true,
"optional": true
},
"loader-utils": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz",
"integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==",
"dev": true,
"optional": true,
"requires": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
"json5": "^2.1.2"
}
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"dev": true,
"optional": true,
"requires": {
"has-flag": "^4.0.0"
}
}
}
},
"vue-style-loader": {
"version": "4.1.3",
"resolved": "https://registry.npm.taobao.org/vue-style-loader/download/vue-style-loader-4.1.3.tgz?cache=0&sync_timestamp=1614758652197&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fvue-style-loader%2Fdownload%2Fvue-style-loader-4.1.3.tgz",
......
......@@ -14,11 +14,18 @@ let orderApiFun = function(vm){
* 工单数量查询接口
*/
let listOrderCount = async (params = {}) => await vm.$u.get(prefix + vm.vuex_token + '/wokerOrder/queryOrdersCount/V2', params);
/**
* 订单管理工单数量查询接口
*/
let manageOrderCount = async (params = {}) => await vm.$u.get(prefix + 'wokerOrder/countOrderByTimeRange', params);
/**
* 工单列表接口
*/
let listOrder = async (params = {}) => await vm.$u.get('/wxh-worker-rest/rest/order/revision/' + vm.vuex_token + '/list', params);
/**
* 订单管理工单列表接口
*/
let manageOrderList = async (params = {}) => await vm.$u.get('/wxh-worker-rest/rest/order/revision/listOrderByTimeRange', params);
/**
* 获取师傅的预约日历
......@@ -200,10 +207,15 @@ let orderApiFun = function(vm){
let cancelParts = async (partOrderId) => await vm.$u.put(prefix + 'parts/' + vm.vuex_token + '/orders/'+ partOrderId +'/cancel',{}, formType);
// 点击了异常单去处理
let workerDealWithError = async (orderId, params = {}) => await vm.$u.post( prefix + vm.vuex_token + '/order/' + orderId + '/workerDealWithError', params)
// 工单搜索联想
let association = async (params = {}) => await vm.$u.get('/wxh-worker-rest/rest/order/revision/association', params);
const orderApi = {
listByRecommendOrder,
listOrderCount,
manageOrderCount,
listOrder,
manageOrderList,
workerCalendar,
workerAppointment,
maintainWorkerCheckin,
......@@ -252,7 +264,8 @@ let orderApiFun = function(vm){
getOrderPartsSum,
receiveParts,
cancelParts,
workerDealWithError
workerDealWithError,
association
}
return orderApi
}
......
......@@ -51,7 +51,7 @@ const install = (Vue, vm) => {
config.header['Authorization'] = token
}
// config.header.token = vm.vuex_token || 'RTOKENe56f873b5823477fa2e15572f8fa7eb3a5fb6f7b';
config.header['token'] = token;
config.header['x-requested-with'] = 'xmlhttprequest';
return config;
}
......
<template>
<view class="eusing-view">
<view class="fixed-button">
<ApplyButton
:type.sync="buttonType"
icon="dingdan-button.png"
text="最近查看"
clickedType="hidden"
:show.sync="showApplyButton"
@click="visible = true"
/>
</view>
<FiveOrders
:visible.sync="visible"
@close="showApplyButton = true"
></FiveOrders>
</view>
</template>
<script>
import ApplyButton from '@/components/parts/applyButton.vue'
import FiveOrders from '@/components/order/fiveOrders.vue'
export default {
components: {
ApplyButton,
FiveOrders,
},
props: {
type: {
// 按钮宽'collapse': '80rpx', 'expand': '220rpx'
type: String,
default: 'expand',
},
},
data() {
return {
buttonType: this.type || 'expand', // 申请按钮宽 collapse': '80rpx', 'expand': '220rpx''
showApplyButton: true,
visible: false,
}
},
}
</script>
<style lang="scss" scoped>
.eusing-view {
.fixed-button {
position: fixed;
right: 10rpx;
bottom: 64rpx;
}
}
</style>
<template>
<u-popup
v-model="visible"
mode="center"
safe-area-inset-bottom
width="690rpx"
border-radius="12"
close-icon-color="#333333"
>
<view class="pop-view">
<image :src="chakanjiluImage" class="back-image" mode="widthFix"></image>
<view class="head-view">
<view class="left-view">
<view>最近查看记录</view>
<view class="head-message">最近查看或操作过的5条订单</view>
</view>
<view class="close-button" @click="$u.throttle(handleClose, 500)">
<u-icon name="close"></u-icon>
</view>
</view>
<view class="none-view" v-if="orderList.length <= 0">
<NoOrder text="当前暂无查看记录" />
</view>
<view class="content-view" v-else>
<view v-for="item in orderList" :key="item.orderId">
<OrderCell
:orderData="item"
:location="[]"
model="simple"
@click="handleClickCell"
@action="handleClickButton"
>
</OrderCell>
</view>
<view class="bottom-tip">
<u-loadmore
:status="nomore"
font-size="26"
color="#999999"
></u-loadmore>
</view>
</view>
</view>
</u-popup>
</template>
<script>
import OrderCell from '@/components/order/index.vue'
import NoOrder from '@/components/order/noOrder.vue'
export default {
components: {
OrderCell,
NoOrder,
},
props: {
visible: {
type: Boolean,
default: false,
},
},
data() {
return {
// orderList: [],
loaded: false,
}
},
computed: {
orderList() {
return this.vuex_last_five_orders.filter((item) => item) || []
},
chakanjiluImage() {
return process.uniEnv.qn_base_url + 'chakanjilu.png'
},
},
methods: {
// getOrderList() {
// this.loaded = false
// var param = {
// pageNumber: 1,
// pageSize: 5,
// keyword: '',
// type: 'zuijinlianxi',
// }
// this.$u.api.listOrder(param).then((res) => {
// if (res.code == 200) {
// this.orderList = res.data.list || []
// } else {
// console.log(res.message, '获取订单数量失败!')
// }
// this.loaded = true
// })
// },
handleClose() {
this.$emit('update:visible', false)
this.$emit('close')
},
handleClickCell(item, type, showCountTime) {
this.$emit('update:visible', false)
this.$emit('click', item, type, showCountTime)
// type:类型,showCountTime:是否显示倒计时。详情页面情况太多,提前传值可以避免页面晃动
//type类型
// 'waitAccept': 待接单、待抢单;'waitAppointment': 待预约;'waitCheckIn': 待签到;'waitFinish': 待完工;'audit': 审核中;'exception': 异常单;'finish': 已完工;'other': 工单结算信息
uni.navigateTo({
url:
'pages/order/detail?id=' +
item.orderId +
'&type=' +
type +
'&showCountTime=' +
showCountTime,
})
},
handleClickButton(item, type, showCountTime, auditResults) {
this.$emit('update:visible', false)
this.$emit('click', item, type, showCountTime, auditResults)
// 去完工
uni.navigateTo({
url:
'pages/order/complete?orderId=' +
item.orderId +
'&categoryId=' +
item.categoryId +
'&orderServiceType=' +
item.orderServiceType +
'&inGuaranteePeriod=' +
item.inGuaranteePeriod +
'&partnerCompanyId=' +
item.partnerCompanyId +
'&maintainStep=' +
item.maintainStep +
'&orderStatus=' +
item.orderStatus +
'&brandId=' +
item.lianbaoBrandId +
'&auditResults=' +
(auditResults ? auditResults.join() : '') +
'&orderNumber=' +
item.orderNumber,
})
},
},
}
</script>
<style lang="scss" scoped>
.pop-view {
// padding: 30rpx;
max-height: 900rpx;
display: flex;
flex-direction: column;
display: relative;
.back-image {
position: absolute;
top: 0;
left: 0;
width: 100%;
z-index: -1;
}
.head-view {
display: flex;
justify-content: space-between;
align-items: flex-start;
.left-view {
padding: 30rpx 30rpx 20rpx 30rpx;
font-size: 48rpx;
font-weight: bold;
color: #333333;
.head-message {
font-size: 32rpx;
color: #2272ff;
font-weight: 400;
margin-top: 14rpx;
}
}
.close-button {
width: 60rpx;
height: 60rpx;
display: flex;
justify-content: center;
align-items: center;
margin: 14rpx;
}
}
.none-view {
margin-top: 30rpx;
margin-bottom: 50rpx;
}
.content-view {
height: 100%;
overflow: auto;
.bottom-tip {
margin-bottom: 44rpx;
margin-top: 30rpx;
}
}
}
</style>
<template>
<view class="order-view" @click="handleClickCell">
<view class="order-top-view">
<view
:class="['order-view', { simple: isSimple }]"
@click="handleClickCell"
hover-class="u-hover-class"
>
<view v-if="!isSimple" class="order-top-view">
<view class="left-view">
<view :class="['tag-view', { active: active }]">
{{ orderData.orderServiceType }}
......@@ -10,15 +14,28 @@
<view class="right-view">{{ orderData.orderBusinessTypeText }}</view>
</view>
<view class="content-view">
<view class="info-view" v-for="(item, key) in infoTexts" :key="key">
<view class="info-title">
<text>{{ item.name + ':' }}</text>
<view
class="info-view"
v-for="(item, key) in infoTexts"
:key="key"
:style="item.style"
>
<view class="info-left-view">
<view v-if="item.symbol" class="symbol-view"> </view>
<view class="info-title">
<text>{{ item.name + ':' }}</text>
</view>
<view class="info-content">
<text @longpress="handleLongpress(key, orderData[key])">{{
orderData[key]
}}</text>
<text v-if="item.content">{{
' / ' + orderData[item.content]
}}</text>
</view>
</view>
<view class="info-content">
<text @longpress="handleLongpress(key, orderData[key])">{{
orderData[key]
}}</text>
<text v-if="item.content">{{ ' / ' + orderData[item.content] }}</text>
<view v-if="item.icon">
<u-icon :name="item.icon"></u-icon>
</view>
</view>
<view class="address-view">
......@@ -35,23 +52,22 @@
</view>
</view>
</view>
<view class="line-view"></view>
<view class="reason-view" v-if="showReason">
<view class="reason-title"><text>未通过原因:</text></view>
<view class="reason-text"
>
<text v-for="(item, index) in orderData.partAuditResults" :key="index">{{
item
}}</text>
<text v-for="(item, index) in orderData.auditResults" :key="index">{{
item
}}</text>
</view
>
</view>
<view class="bottom-view">
<view>
<template v-if="!isSimple">
<view class="line-view"></view>
<view class="reason-view" v-if="showReason">
<view class="reason-title"><text>未通过原因:</text></view>
<view class="reason-text">
<text
v-for="(item, index) in orderData.partAuditResults"
:key="index"
>{{ item }}</text
>
<text v-for="(item, index) in orderData.auditResults" :key="index">{{
item
}}</text>
</view>
</view>
<view class="bottom-view">
<view v-if="showCountTime" class="bottom-left-view">
<view :class="['bottom-tag-view', { timeout: timeout }]"
><text>{{ tagText }}</text></view
......@@ -71,17 +87,17 @@
<text>{{ timeTitle }}</text>
<text>{{ timeText }}</text>
</view>
<u-button
class="right-btn"
@click.stop="handleClick"
:custom-style="buttonStyle"
type="primary"
shape="circle"
>
{{ orderText }}
</u-button>
</view>
<u-button
class="right-btn"
@click.stop="handleClick"
:custom-style="buttonStyle"
type="primary"
shape="circle"
>
{{ orderText }}
</u-button>
</view>
</template>
</view>
</template>
......@@ -130,6 +146,11 @@ export default {
return [116.3896, 39.91917] // 纬度,经度
},
},
// simple: 只显示订单号、联系人/电话、地址,点击cell相当于点击订单列表的按钮; normal: 显示全部信息
model: {
type: String,
default: 'normal',
},
},
data() {
return {
......@@ -142,6 +163,9 @@ export default {
// 按钮文字
return this.typeTexts[this.orderType]
},
isSimple() {
return this.model == 'simple'
},
buttonStyle() {
// 按钮样式
/** orderType
......@@ -181,11 +205,21 @@ export default {
return [4, 5, 6].indexOf(this.orderType) != -1
},
infoTexts() {
return {
orderNumber: { name: '工单编号' },
partnerCompanyName: { name: '合作厂商' },
contactName: { name: '客户信息', content: 'contactPhone' },
}
return this.isSimple
? {
orderNumber: {
symbol: true,
name: '工单编号',
style: 'font-weight: 450;font-size: 28rpx',
icon: 'arrow-right',
},
contactName: { name: '客户信息', content: 'contactPhone' },
}
: {
orderNumber: { name: '工单编号' },
partnerCompanyName: { name: '合作厂商' },
contactName: { name: '客户信息', content: 'contactPhone' },
}
},
typeTexts() {
return [
......@@ -257,6 +291,7 @@ export default {
},
showDistance() {
return (
!this.isSimple &&
this.orderType == 0 &&
this.location.length >= 2 &&
(this.orderData.contactAddressLatitud ||
......@@ -280,6 +315,34 @@ export default {
finish: 6, //已完工
}
},
typeList() {
return [
'waitAccept', // 待接单、
'waitAppointment', // 待预约、
'waitCheckIn', // 待签到、
'waitFinish', // 待完工、
'audit', // 审核中、
'exception', // 异常单、
'finish', //已完工
]
},
realType() {
if (this.type && this.typeList.indexOf(this.type) != -1) {
return this.type
} else {
return this.typeList[this.orderType]
}
},
auditResults() {
let partAuditResults = this.orderData.partAuditResults
? ['orderSpareParts']
: []
let auditResults = this.orderData.auditResults
? Object.keys(this.orderData.auditResults)
: []
auditResults = auditResults.concat(partAuditResults)
},
orderDistance() {
return this.distance(
this.orderData.contactAddressLatitud,
......@@ -300,15 +363,18 @@ export default {
orderType() {
/*
orderStatus:
待接单 orderStatus<31 工单状态小于31
待预约 orderStatus == 31 and appointmentDatetime == null 工单状态等于30并且预约时间为空
待签到 orderStatus == 31 and appointmentDatetime is not null 工单状态等于30并且预约时间不为空
待完工 orderStatus >31 and orderStatus < 80 工单状态大于31 小于80
审核中 orderStatus ==83 or orderStatus == 87 or orderStatus == 88 工单状态 等于85 或者 等于87 或者 等于88
异常 orderStatus ==86 工单状态 等于86
已完工 orderStatus in(80,81,89,110) 工单状态 等于80 or 81 or 89 or 110
待接单 orderStatus<31 工单状态小于31
待预约 orderStatus == 31 and appointmentDatetime == null 工单状态等于30并且预约时间为空
待签到 orderStatus == 31 and appointmentDatetime is not null 工单状态等于30并且预约时间不为空
待完工 orderStatus >31 and orderStatus < 80 工单状态大于31 小于80
审核中 orderStatus ==83 or orderStatus == 87 or orderStatus == 88 工单状态 等于83 或者 等于85 或者 等于87 或者 等于88
异常 orderStatus ==86 工单状态 等于86
已完工 orderStatus in(80,81,89,110) 工单状态 等于80 or 81 or 89 or 110
*/
if (!this.type) {
if (this.type && this.typeList.indexOf(this.type) != -1) {
return this.types[this.type]
} else {
// 没传或传错type
if (this.orderData.orderStatus < 31) {
return 0
} else if (this.orderData.orderStatus == 31) {
......@@ -338,8 +404,6 @@ export default {
} else {
return 0
}
} else {
return this.types[this.type]
}
},
},
......@@ -369,9 +433,11 @@ export default {
this.$emit(
func,
this.orderData,
this.type,
this.showCountTime ? 'show' : ''
this.realType,
this.showCountTime ? 'show' : '',
this.auditResults
)
this.otherAction()
},
handleClickCell() {
var func = 'click'
......@@ -383,9 +449,35 @@ export default {
this.$emit(
func,
this.orderData,
this.type,
this.showCountTime ? 'show' : ''
this.realType,
this.showCountTime ? 'show' : '',
this.auditResults
)
this.otherAction()
},
// 如果是异常单告诉后台
// 更新最近5条查看记录
otherAction() {
this.exceptionRecord()
this.storeOparation()
},
exceptionRecord() {
// 如果是异常单告诉后台
if (this.realType == 'exception') {
this.$u.api.workerDealWithError(item.orderId).then(() => {})
}
},
storeOparation() {
// 更新最近5条查看记录
if (!this.isSimple) {
var array = (this.vuex_last_five_orders || []).filter((item) => {
// 如果记录中有该工单,删除
return item && item.orderId != this.orderData.orderId
})
array.unshift(this.orderData)
this.$u.vuex('vuex_last_five_orders', array.slice(0, 5))
}
},
handleChange(timestamp) {
if (this.timeout) this.$refs['order-count-down'].seconds += 2
......@@ -464,12 +556,19 @@ export default {
<style lang="scss" scoped>
.order-view {
width: 100%;
// width: 100%;
background-color: #ffffff;
border-radius: 12rpx;
padding: 30rpx;
margin-bottom: 20rpx;
.hover-class {
background-color: #dddddd;
}
&.simple {
margin: 20rpx 30rpx;
padding-top: 12rpx;
box-shadow: 0 0 16rpx rgba(51, 51, 51, 0.1);
}
.order-top-view {
display: flex;
align-items: center;
......@@ -522,13 +621,26 @@ export default {
margin-top: 18rpx;
margin-bottom: 18rpx;
display: flex;
align-items: flex-start;
.info-title {
flex-shrink: 0;
}
.info-content {
word-break: break-all;
justify-content: space-between;
align-items: center;
.info-left-view {
display: flex;
justify-content: flex-start;
align-items: center;
.symbol-view {
background-color: #2272ff;
width: 6rpx;
height: 28rpx;
border-radius: 6rpx;
margin-right: 10rpx;
}
.info-title {
flex-shrink: 0;
align-items: center;
}
.info-content {
word-break: break-all;
}
}
}
......
......@@ -3,7 +3,7 @@
<view class="return-cell" @click="handleClick">
<view class="title-view">
<text class="title-text" :style="{'color': titleColor}">{{title}}</text>
<view class="express-view" @click.stop="$u.throttle(handleClickExpress, 500)" v-if="info.express.number">
<view class="express-view" @click.stop="$u.throttle(handleClickExpress, 500)" v-if="info.express.number" hover-class="u-hover-class">
<text>物流单号:</text>
<view class="order-file-right">
<text>{{info.express.number}}</text>
......
<template>
<!-- 申请物料按钮 -->
<view class="apply-button">
<u-button :custom-style="customStyle" shape="circle" @click.stop="handleClick" type="primary">
<u-icon class="apply-icon" name="plus"></u-icon>
<text class="apply-text" v-if="showText">申请物料</text>
</u-button>
</view>
<!-- 申请配件按钮 -->
<view class="apply-button" v-show="show">
<u-button
:custom-style="customStyle"
shape="circle"
@click.stop="handleClick"
type="primary"
>
<view class="button-view">
<u-loading mode="flower" :show="loading"></u-loading>
<image
v-if="isImage && !loading"
:src="imageUrl"
class="image-icon"
mode="widthFix"
></image>
<u-icon v-else-if="!loading" class="apply-icon" :name="icon"></u-icon>
<text class="apply-text" v-if="showText">{{ text }}</text>
</view>
</u-button>
</view>
</template>
<script>
export default {
props: {
type: { // 按钮宽'collapse': '80rpx', 'expand': '220rpx'
type: String,
default: 'expand'
}
},
computed: {
typeWidth() {
return {
'collapse': '80rpx',
'expand': '220rpx'
}
},
showText() {
return this.type == 'expand'
},
customStyle() {
return {
'height': '80rpx',
'width': this.typeWidth[this.type],
}
}
},
created() {
setTimeout(()=> {
this.$emit('update:type', 'collapse')
}, 3000)
},
methods: {
handleClick() {
this.$emit('click')
},
}
}
export default {
props: {
type: {
// 按钮宽'collapse': '80rpx', 'expand': '220rpx'
type: String,
default: 'expand',
},
text: {
type: String,
default: '申请备件',
},
icon: {
type: String,
default: 'plus',
},
show: {
type: Boolean,
default: true,
},
clickedType: {
// normal 点击之后不隐藏; hidden 点击之后隐藏
type: String,
default: 'normal',
},
loading: {
type: Boolean,
default: false,
},
},
computed: {
typeWidth() {
return {
collapse: '80rpx',
expand: '220rpx',
}
},
imageUrl() {
return process.uniEnv.qn_base_url + this.icon
},
isImage() {
return /\.(png|jpg|gif|jpeg|webp)$/.test(this.icon)
},
clickedHidden() {
return this.clickedType == 'hidden'
},
typeOpacity() {
return {
collapse: this.clicked == 0 ? '0.6' : '1',
expand: '1',
}
},
showText() {
return this.type == 'expand'
},
customStyle() {
return {
height: '80rpx',
width: this.typeWidth[this.type],
opacity: this.typeOpacity[this.type],
}
},
},
data() {
return {
clicked: 0, // 0 不活跃;>1 活跃中
}
},
created() {
setTimeout(() => {
this.$emit('update:type', 'collapse')
}, 3000)
},
watch: {
show(val) {
if (val) {
this.clicked += 1
setTimeout(() => {
// 三秒不点击,算失去活跃
this.clicked = Math.max(0, this.clicked - 1)
}, 3000)
}
},
},
methods: {
handleClick() {
if (this.clickedHidden) {
this.$emit('update:show', false)
}
this.$emit('click')
},
},
}
</script>
<style lang="scss" scoped>
.apply-button {
.apply-icon {
font-size: 36rpx;
}
.apply-text {
font-size: 32rpx;
padding-left: 10rpx;
}
}
.apply-button {
.button-view {
display: flex;
justify-content: flex-end;
align-items: center;
.apply-icon {
font-size: 36rpx;
}
.apply-text {
font-size: 32rpx;
padding-left: 10rpx;
}
.image-icon {
width: 30rpx;
height: 34rpx;
}
}
}
</style>
......@@ -79,7 +79,8 @@
console.log('success');
}
})
}
},
handleClick(){}
}
}
</script>
......
......@@ -162,6 +162,46 @@
"disableScroll": true
}
},
{
"path": "order/index",
"style": {
"navigationBarTitleText": "订单管理",
"enablePullDownRefresh": false,
"disableScroll": true,
"navigationStyle": "custom",
"navigationBarBackgroundColor": "#F4F5F7"
}
},
{
"path": "order/list",
"style": {
"navigationBarTitleText": "订单管理-订单列表",
"enablePullDownRefresh": false,
"disableScroll": true,
"navigationStyle": "custom",
"navigationBarBackgroundColor": "#F4F5F7"
}
},
{
"path": "history/index",
"style": {
"navigationBarTitleText": "浏览记录",
"enablePullDownRefresh": false,
"disableScroll": true,
"navigationStyle": "custom",
"navigationBarBackgroundColor": "#F4F5F7"
}
},
{
"path": "info/index",
"style": {
"navigationBarTitleText": "我的资料",
"enablePullDownRefresh": false,
"disableScroll": true,
"navigationStyle": "custom",
"navigationBarBackgroundColor": "#F4F5F7"
}
},
{
"path": "wallet/index",
"style": {
......
<template>
<TabBarPage title="扳手会" :fixed="true" @click="goTop">
<view class="content-view">
<scroll-view style="height: 100%;" scroll-y @scrolltolower="reachBottom" :scroll-top="scrollTop" @scroll="scroll"
scroll-anchoring scroll-y="true" refresher-enabled="true" :refresher-triggered="triggered" :refresher-threshold="100"
refresher-background="#F4F5F7" @refresherrefresh="onRefresh"
@refresherrestore="onRestore" enable-back-to-top>
<image class="banner-image" :src="bannerImage" @click="handleClickBanner"></image>
<view class="msg-view">
<view class="msg-title">最新消息</view>
<view class="msg-list-view">
<view class="msg-content" v-for="(item, index) in messageList" :key="index" @click="toNewsDetail(item)">
<view class="msg-content-view">
<view class="left-view">
<image class="msg-icon" :src="msgStyleImage[item.is_top]"></image>
<text class="msg-text">{{ item.title }}</text>
</view>
<image class="right-icon" :src="shouyeyouImage"></image>
</view>
<view class="line-view" v-if="index != 1"></view>
</view>
</view>
</view>
<view class="sticky">
<text>订单推荐</text>
</view>
<view class="order-view">
<!-- 入驻成功之后显示推荐订单列表 -->
<view class="order-list-view" v-if="loaded">
<!-- 入驻前-->
<view v-if="needSettled" class="tip-view">
<image :src="weiruzhuImage" class="tip-view-image"></image>
<view class="tip-other">入驻后平台将向您分配或推荐订单</view>
<u-button class="settle-button" type="primary" shape="circle" @click="immediatelyIn"
:custom-style="buttonStyle">
立即入驻
</u-button>
</view>
<template v-else>
<!-- 入驻成功之后无推荐订单 -->
<view v-if="orderList.length <= 0 && loadedOrder" class="no-order-view">
<NoOrder />
</view>
<view v-else class="order-item-view">
<view v-for="(item, index) in orderList" :key="index">
<OrderCell :orderData="item" type="waitAccept" :location="location"
@click="handleClick" @action="handleClick">
</OrderCell>
</view>
<u-loadmore v-show="(search.pageNumber == 1 && loadedOrder) || search.pageNumber > 1" :status="currentLoadStatus" bgColor="#F4F5F7"></u-loadmore>
</view>
</template>
</view>
</view>
<view class="bottom-view" v-if="needSettled || orderList.length <= 0">
<view class="bottom-line-view"></view>
<view class="bottom-text">我也是有底线哒</view>
<view class="bottom-line-view"></view>
</view>
</scroll-view>
</view>
</TabBarPage>
<template>
<TabBarPage title="扳手会" :fixed="true" @click="goTop">
<view class="content-view">
<scroll-view
style="height: 100%;"
scroll-y
@scrolltolower="reachBottom"
:scroll-top="scrollTop"
@scroll="scroll"
scroll-anchoring
refresher-enabled="true"
:refresher-triggered="triggered"
:refresher-threshold="100"
refresher-background="#F4F5F7"
@refresherrefresh="onRefresh"
@refresherrestore="onRestore"
enable-back-to-top
>
<image
class="banner-image"
:src="bannerImage"
@click="handleClickBanner"
></image>
<view class="msg-view">
<view class="msg-title">最新消息</view>
<view class="msg-list-view">
<view
class="msg-content"
v-for="(item, index) in messageList"
:key="index"
@click="toNewsDetail(item)"
>
<view class="msg-content-view">
<view class="left-view">
<image
class="msg-icon"
:src="msgStyleImage[item.is_top]"
></image>
<text class="msg-text">{{ item.title }}</text>
</view>
<image class="right-icon" :src="shouyeyouImage"></image>
</view>
<view class="line-view" v-if="index != 1"></view>
</view>
</view>
</view>
<view class="sticky">
<text>订单推荐</text>
</view>
<view class="order-view">
<!-- 入驻成功之后显示推荐订单列表 -->
<view class="order-list-view" v-if="loaded">
<!-- 入驻前-->
<view v-if="needSettled" class="tip-view">
<image :src="weiruzhuImage" class="tip-view-image"></image>
<view class="tip-other">入驻后平台将向您分配或推荐订单</view>
<u-button
class="settle-button"
type="primary"
shape="circle"
@click="immediatelyIn"
:custom-style="buttonStyle"
>
立即入驻
</u-button>
</view>
<template v-else>
<!-- 入驻成功之后无推荐订单 -->
<view
v-if="orderList.length <= 0 && loadedOrder"
class="no-order-view"
>
<NoOrder />
</view>
<view v-else class="order-item-view">
<view v-for="(item, index) in orderList" :key="index">
<OrderCell
:orderData="item"
type="waitAccept"
:location="location"
@click="handleClick"
@action="handleClick"
>
</OrderCell>
</view>
<view
class="load-more-view"
v-show="
(search.pageNumber == 1 && loadedOrder) ||
search.pageNumber > 1
"
>
<u-loadmore
:status="currentLoadStatus"
bgColor="#F4F5F7"
></u-loadmore>
</view>
</view>
</template>
</view>
</view>
<view class="bottom-view" v-if="needSettled || orderList.length <= 0">
<view class="bottom-line-view"></view>
<view class="bottom-text">我也是有底线哒</view>
<view class="bottom-line-view"></view>
</view>
</scroll-view>
<!-- 悬浮按钮 -->
<!-- <EusingList /> -->
</view>
</TabBarPage>
</template>
<script>
import util from "@/utils/util.js";
import TabBarPage from "@/components/tabBarList/index.vue"
import NoOrder from "@/components/order/noOrder.vue"
const app = getApp();
import OrderCell from "@/components/order/index.vue";
export default {
components: {
OrderCell,
TabBarPage,
NoOrder,
},
data() {
return {
status: 0, // 入驻状态:0=>'待提交',1=>'待审核',2=>'已通过',3=>'备选',4=>'已驳回',6=>'已签约',7=>'已支付保证金',8=>'已通过考试',9=>'待提交'
location: [], // 经纬度
title: false,
title: "Hello",
loaded: false,
loadedOrder: false,
needSettled: true,
count: 0, // 推荐订单数量
messageList: [],
currentLoadStatus: "loading",
orderList: [],
search: {
token: "",
pageNumber: 0,
pageSize: 100,
},
waitInit: false, // 当token为空时,等待自动登录结束
triggered: true,
scrollTop: 0,
old: {
scrollTop: 0
}
};
},
watch: {
vuex_token(val, oldVal) {
// 监听token变化,如果更新则重新加载页面数据
val && this.waitInit && this.getData()
}
},
computed: {
buttonStyle() {
return {
width: "300rpx",
height: "80rpx",
"font-size": "32rpx",
"font-weight": "bold",
};
},
msgStyleImage() {
return {
'1': process.uniEnv.qn_base_url + "zhiding.png", // 置顶
'0': process.uniEnv.qn_base_url + "tongzhi.png", // 通知
// '3': process.uniEnv.qn_base_url + "xiaoxi.png", // 消息
}
},
bannerImage() {
return process.uniEnv.qn_base_url + 'banner-1.png'
},
shouyeyouImage() {
return process.uniEnv.qn_base_url + 'shouyeyou.png'
},
weiruzhuImage() {
return process.uniEnv.qn_base_url + 'weiruzhu.png'
},
},
onLoad(e) {
app.trackPage('自营平台首页')
this._freshing = false;
if(this.vuex_token) {
this.getOrderCount()
} else {
this.waitInit = true
}
},
onShow() {
// 每次进入页面都刷新入驻状态
this.pageNumber = 0
this.initSettleInfo();
},
methods: {
getData() {
this.getOrderCount()
this.initSettleInfo();
},
handleClick(item, type, showCountTime) { // 跳转工单详情页面 showCountTime:是否显示倒计时
// type类型
// 'waitAccept': 待接单、待抢单;'waitAppointment': 待预约;'waitCheckIn': 待签到;'waitFinish': 待完工;'audit': 审核中;'exception': 异常单;'finish': 已完工;'other': 工单结算信息
uni.navigateTo({
url: 'pages/order/detail?id=' + item.orderId + '&type=' + type + '&showCountTime=' + showCountTime
})
},
async initSettleInfo() {
let self = this;
// 加载消息列表
this.loadMessageList();
if (this.vuex_token) {
const callBack = (vm, result) => {
// 后台自动判断入驻流程是否完成,前台通过status确定状态
if (result && result.record) {
vm.needSettled = result.needSettled;
vm.status = Number(result.record.status || '0');
// vm.status = 8
}
};
self.search.pageNumber = 0
self.loadedOrder = false
self.loadOrderList();
await app.getBaseInfo(self, callBack);
if (this.status == 7) {
this.getLocation()
}
this.loaded = true;
} else {
this.loaded = true
}
},
loadMessageList() {
let self = this;
self.$u.api.listByNotice().then((res) => {
uni.stopPullDownRefresh() // 结束下拉刷新
if (res.code == 200) {
if (res.data && res.data.length > 2) {
self.messageList = res.data.slice(0, 2);
} else {
self.messageList = res.data || [];
}
} else {
console.log(res.message, "初始化消息列表异常");
}
});
},
loadOrderList() {
this.search.pageNumber += 1
let self = this;
// 加载订单列表
self.search.token = self.vuex_token;
self.$u.api.listByRecommendOrder(self.search).then((res) => {
self.loadedOrder = true
if (res.code == 200 && res.data) {
if (self.search.pageNumber == 1) {
self.orderList = []
}
if (res.data.list) {
// self.orderList.push(...res.data.list)
// 更新每一条时间戳,防止后台返回的数据和原先一样,不触发ordercell的时间计算
var time = new Date().getTime()
for (var item of res.data.list) {
item.currentCellTime = time
self.orderList.push(item);
}
}
self.currentLoadStatus = res.data.total > self.orderList.length && (res.data.list || []).length == self.search.pageSize ? 'loadmore' : 'nomore'
} else {
console.log(res.message, "初始化订单列表异常");
}
self.$nextTick(()=>{
if (self._freshing) {
self.triggered = false;
self._freshing = false;
}
})
});
},
reachBottom() {
if (this.vuex_token) {
if (this.currentLoadStatus != 'loadmore') return
this.currentLoadStatus == 'loading'
this.loadOrderList()
}
},
onRefresh() {
if (this._freshing) return
this._freshing = true
this.initSettleInfo()
},
onRestore() {
this.triggered = 'restore'; // 需要重置
},
scroll(e) {
this.old.scrollTop = e.detail.scrollTop
},
goTop(e) {
this.scrollTop = this.old.scrollTop
this.$nextTick(function() {
this.scrollTop = 0
});
},
/* 立即入驻 */
immediatelyIn() {
if (this.vuex_token) {
// 用户已登录
var pageIndex = 1;
// 0=>'待提交',1=>'待审核',2=>'已通过',3=>'备选',4=>'已驳回',5=>'已签约',6=>'未支付保证金',7=>'已支付保证金',8=>'已通过考试',9=>'待提交'
switch (this.status) {
case 1:
case 2:
case 3:
case 4:
pageIndex = 2;
break;
case 8:
pageIndex = 3;
break;
case 5:
case 6:
pageIndex = 4;
break;
case 7:
pageIndex = 5;
break;
default:
pageIndex = 1;
break;
}
uni.navigateTo({
url: this.status > 0 ?
"/pages/settle/prompt?pageIndex=" + pageIndex : "/pages/settle/index",
});
} else {
// 用户未登录
uni.navigateTo({
url: "pages/login/index",
});
}
},
// 获取订单数量
getOrderCount() {
var self = this; // 加载订单列表
self.$u.api.listOrderCount().then((res) => {
if (res.code == 200) {
if (res.data) {
var count = 0
for (var i in res.data) {
count += res.data[i]
}
// 修改tab总数
if (count > 0) {
uni.setTabBarBadge({
index: 1,
text: String(count)
})
} else {
uni.removeTabBarBadge({
index: 1
})
}
}
} else {
console.log(res.message, "获取订单数量失败!");
}
});
},
/**
* 获取当前位置的经纬度
*/
getLocation() {
let self = this
uni.getLocation({
type: 'gcj02',
success: function(res) {
self.location = [res.latitude, res.longitude]
},
complete: function(res) {
if (res.errMsg.indexOf('auth') != -1) {
uni.showModal({
title: '提示',
content: '获取权限失败,请到设置页面开启权限',
confirmText: '好的',
success(res) {
if (res.confirm) {
uni.openSetting({
success(res) {
console.log(res.authSetting)
}
});
}
}
})
}
},
fail: function(err) {
}
});
},
toNewsDetail(item) {
wx.navigateTo({
url: '/pages/learn/news-details',
success: function(res) {
res.eventChannel.emit('acceptDataFromLearn', item)
}
});
},
handleClickBanner() {
uni.navigateTo({
url: "/pages/mine/customer/index" + '?type=exclusive',
});
},
},
};
import TabBarPage from '@/components/tabBarList/index.vue'
import NoOrder from '@/components/order/noOrder.vue'
const app = getApp()
import OrderCell from '@/components/order/index.vue'
// import EusingList from '@/components/order/eusingList.vue'
export default {
components: {
OrderCell,
TabBarPage,
NoOrder,
// EusingList,
},
data() {
return {
status: 0, // 入驻状态:0=>'待提交',1=>'待审核',2=>'已通过',3=>'备选',4=>'已驳回',6=>'已签约',7=>'已支付保证金',8=>'已通过考试',9=>'待提交'
location: [], // 经纬度
title: false,
title: 'Hello',
loaded: false,
loadedOrder: false,
needSettled: true,
count: 0, // 推荐订单数量
messageList: [],
currentLoadStatus: 'loading',
orderList: [],
search: {
token: '',
pageNumber: 0,
pageSize: 15,
},
waitInit: false, // 当token为空时,等待自动登录结束
triggered: true,
scrollTop: 0,
old: {
scrollTop: 0,
},
}
},
watch: {
vuex_token(val, oldVal) {
// 监听token变化,如果更新则重新加载页面数据
val && this.waitInit && this.getData()
},
},
computed: {
buttonStyle() {
return {
width: '300rpx',
height: '80rpx',
'font-size': '32rpx',
'font-weight': 'bold',
}
},
countKeys() {
return [
'toAppointmentCount',
'toCheckinCount',
'toFinishCount',
'reviewingCount',
'exceptionCount',
]
},
msgStyleImage() {
return {
'1': process.uniEnv.qn_base_url + 'zhiding.png', // 置顶
'0': process.uniEnv.qn_base_url + 'tongzhi.png', // 通知
// '3': process.uniEnv.qn_base_url + "xiaoxi.png", // 消息
}
},
bannerImage() {
return process.uniEnv.qn_base_url + 'banner-1.png'
},
shouyeyouImage() {
return process.uniEnv.qn_base_url + 'shouyeyou.png'
},
weiruzhuImage() {
return process.uniEnv.qn_base_url + 'weiruzhu.png'
},
},
onLoad(e) {
app.trackPage('自营平台首页')
this._freshing = false
if (this.vuex_token) {
this.getOrderCount()
} else {
this.waitInit = true
}
},
onShow() {
// 每次进入页面都刷新入驻状态
this.pageNumber = 0
this.initSettleInfo()
},
methods: {
getData() {
this.getOrderCount()
this.initSettleInfo()
},
handleClick(item, type, showCountTime) {
// 跳转工单详情页面 showCountTime:是否显示倒计时
// type类型
// 'waitAccept': 待接单、待抢单;'waitAppointment': 待预约;'waitCheckIn': 待签到;'waitFinish': 待完工;'audit': 审核中;'exception': 异常单;'finish': 已完工;'other': 工单结算信息
uni.navigateTo({
url:
'pages/order/detail?id=' +
item.orderId +
'&type=' +
type +
'&showCountTime=' +
showCountTime,
})
},
async initSettleInfo() {
let self = this
// 加载消息列表
this.loadMessageList()
if (this.vuex_token) {
const callBack = (vm, result) => {
// 后台自动判断入驻流程是否完成,前台通过status确定状态
if (result && result.record) {
vm.needSettled = result.needSettled
vm.status = Number(result.record.status || '0')
// vm.status = 8
}
}
self.search.pageNumber = 0
self.loadedOrder = false
await app.getBaseInfo(self, callBack)
if (this.status == 7) {
this.getLocation()
self.loadOrderList()
}
this.loaded = true
} else {
this.loaded = true
}
},
loadMessageList() {
let self = this
self.$u.api.listByNotice().then((res) => {
uni.stopPullDownRefresh() // 结束下拉刷新
if (res.code == 200) {
if (res.data && res.data.length > 2) {
self.messageList = res.data.slice(0, 2)
} else {
self.messageList = res.data || []
}
} else {
console.log(res.message, '初始化消息列表异常')
}
})
},
async loadOrderList() {
this.search.pageNumber += 1
let self = this
// 加载订单列表
self.search.token = self.vuex_token
self.$u.api.listByRecommendOrder(self.search).then((res) => {
self.loadedOrder = true
if (res.code == 200 && res.data) {
if (self.search.pageNumber == 1) {
self.orderList = []
}
if (res.data.list) {
// self.orderList.push(...res.data.list)
// 更新每一条时间戳,防止后台返回的数据和原先一样,不触发ordercell的时间计算
var time = new Date().getTime()
for (var item of res.data.list) {
item.currentCellTime = time
self.orderList.push(item)
}
}
self.currentLoadStatus =
res.data.total > self.orderList.length &&
(res.data.list || []).length == self.search.pageSize
? 'loadmore'
: 'nomore'
} else {
console.log(res.message, '初始化订单列表异常')
}
self.$nextTick(() => {
if (self._freshing) {
self.triggered = false
self._freshing = false
}
})
})
},
reachBottom() {
if (this.vuex_token) {
if (this.currentLoadStatus != 'loadmore') return
this.currentLoadStatus == 'loading'
this.loadOrderList()
}
},
onRefresh() {
if (this._freshing) return
this._freshing = true
this.initSettleInfo()
},
onRestore() {
this.triggered = 'restore' // 需要重置
},
scroll(e) {
this.old.scrollTop = e.detail.scrollTop
},
goTop(e) {
this.scrollTop = this.old.scrollTop
this.$nextTick(function() {
this.scrollTop = 0
})
},
/* 立即入驻 */
immediatelyIn() {
if (this.vuex_token) {
// 用户已登录
var pageIndex = 1
// 0=>'待提交',1=>'待审核',2=>'已通过',3=>'备选',4=>'已驳回',5=>'已签约',6=>'未支付保证金',7=>'已支付保证金',8=>'已通过考试',9=>'待提交'
switch (this.status) {
case 1:
case 2:
case 3:
case 4:
pageIndex = 2
break
case 8:
pageIndex = 3
break
case 5:
case 6:
pageIndex = 4
break
case 7:
pageIndex = 5
break
default:
pageIndex = 1
break
}
uni.navigateTo({
url:
this.status > 0
? '/pages/settle/prompt?pageIndex=' + pageIndex
: '/pages/settle/index',
})
} else {
// 用户未登录
uni.navigateTo({
url: 'pages/login/index',
})
}
},
// 获取订单数量
getOrderCount() {
var self = this // 加载订单列表
self.$u.api.listOrderCount().then((res) => {
if (res.code == 200) {
if (res.data) {
var count = 0
for (var item of this.countKeys) {
count += res.data[item] || 0
}
// 修改tab总数
if (count > 0) {
uni.setTabBarBadge({
index: 1,
text: String(count),
})
} else {
uni.removeTabBarBadge({
index: 1,
})
}
}
} else {
console.log(res.message, '获取订单数量失败!')
}
})
},
/**
* 获取当前位置的经纬度
*/
getLocation() {
let self = this
uni.getLocation({
type: 'gcj02',
success: function(res) {
self.location = [res.latitude, res.longitude]
},
complete: function(res) {
if (res.errMsg.indexOf('auth') != -1) {
uni.showModal({
title: '提示',
content: '获取权限失败,请到设置页面开启权限',
confirmText: '好的',
success(res) {
if (res.confirm) {
uni.openSetting({
success(res) {
console.log(res.authSetting)
},
})
}
},
})
}
},
fail: function(err) {},
})
},
toNewsDetail(item) {
wx.navigateTo({
url: '/pages/learn/news-details',
success: function(res) {
res.eventChannel.emit('acceptDataFromLearn', item)
},
})
},
handleClickBanner() {
uni.navigateTo({
url: '/pages/mine/customer/index' + '?type=exclusive',
})
},
},
}
</script>
<style lang="scss" scoped>
.banner-image {
width: 730rpx;
height: 280rpx;
margin-left: -16rpx;
}
.content-view {
height: 100%;
overflow: auto;
}
.msg-view {
.msg-title {
color: #333333;
font-size: 32rpx;
font-weight: bold;
padding: 1rpx 0rpx 30rpx 0rpx;
}
.msg-list-view {
border-radius: 12rpx;
background-color: #ffffff;
padding: 12rpx 30rpx;
height: 174rpx;
}
.msg-content {
color: #333333;
font-size: 26rpx;
.msg-content-view {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 20rpx;
margin-bottom: 20rpx;
.left-view {
display: flex;
align-items: center;
.msg-icon {
width: 80rpx;
height: 36rpx;
margin-right: 20rpx;
}
.msg-text {
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
width: 448rpx;
}
}
.right-icon {
width: 14rpx;
height: 24rpx;
}
}
.line-view {
height: 2rpx;
background-color: #f4f5f7;
}
}
}
.logo {
height: 200 rpx;
width: 100%;
margin: 0 rpx auto 50 rpx auto;
}
.text-area {
display: flex;
justify-content: center;
}
.title {
font-size: 36 rpx;
color: #8f8f94;
}
// .sticky-view {
// position: sticky;
// position: -webkit-sticky;
// top: 0rpx;
// width: 100%;
// height: 200rpx;
// background-color: black;
// }
.sticky {
background-color: #f4f5f7;
color: #fff;
padding: 24 rpx;
text-align: left;
font-size: 32rpx;
font-weight: bold;
color: #333333;
padding: 46rpx 0 28rpx 0;
}
.order-view {
text-align: center;
.order-list-view {
.tip-view {
padding: 30rpx;
background-color: #ffffff;
border-radius: 12rpx;
min-height: 460rpx;
.tip-view-image {
width: 328rpx;
height: 200rpx;
margin-top: 30rpx;
}
.tip-other {
font-size: 28rpx;
color: #666666;
margin-bottom: 30rpx;
}
.settle-button {}
}
.order-item-view {
background-color: #F4F5F7;
border-radius: 12rpx;
margin-bottom: 20rpx;
}
}
}
.bottom-view {
display: flex;
align-items: center;
justify-content: space-between;
padding: 50rpx 40rpx 50rpx 40rpx;
.bottom-line-view {
background-color: #D5D5D5;
height: 2rpx;
width: 30%;
}
.bottom-text {
color: #999999;
font-size: 24rpx;
}
}
</style>
.banner-image {
width: 730rpx;
height: 280rpx;
margin-left: -16rpx;
}
.content-view {
height: 100%;
overflow: auto;
}
.msg-view {
.msg-title {
color: #333333;
font-size: 32rpx;
font-weight: bold;
padding: 1rpx 0rpx 30rpx 0rpx;
}
.msg-list-view {
border-radius: 12rpx;
background-color: #ffffff;
padding: 12rpx 30rpx;
height: 174rpx;
}
.msg-content {
color: #333333;
font-size: 26rpx;
.msg-content-view {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 20rpx;
margin-bottom: 20rpx;
.left-view {
display: flex;
align-items: center;
.msg-icon {
width: 80rpx;
height: 36rpx;
margin-right: 20rpx;
}
.msg-text {
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
width: 448rpx;
}
}
.right-icon {
width: 14rpx;
height: 24rpx;
}
}
.line-view {
height: 2rpx;
background-color: #f4f5f7;
}
}
}
.logo {
height: 200 rpx;
width: 100%;
margin: 0 rpx auto 50 rpx auto;
}
.text-area {
display: flex;
justify-content: center;
}
.title {
font-size: 36 rpx;
color: #8f8f94;
}
// .sticky-view {
// position: sticky;
// position: -webkit-sticky;
// top: 0rpx;
// width: 100%;
// height: 200rpx;
// background-color: black;
// }
.sticky {
background-color: #f4f5f7;
color: #fff;
padding: 24 rpx;
text-align: left;
font-size: 32rpx;
font-weight: bold;
color: #333333;
padding: 46rpx 0 28rpx 0;
}
.order-view {
text-align: center;
.order-list-view {
.tip-view {
padding: 30rpx;
background-color: #ffffff;
border-radius: 12rpx;
min-height: 460rpx;
.tip-view-image {
width: 328rpx;
height: 200rpx;
margin-top: 30rpx;
}
.tip-other {
font-size: 28rpx;
color: #666666;
margin-bottom: 30rpx;
}
.settle-button {
}
}
.order-item-view {
background-color: #f4f5f7;
border-radius: 12rpx;
margin-bottom: 20rpx;
.load-more-view {
padding-bottom: 44rpx;
}
}
}
}
.bottom-view {
display: flex;
align-items: center;
justify-content: space-between;
padding: 50rpx 40rpx 50rpx 40rpx;
.bottom-line-view {
background-color: #d5d5d5;
height: 2rpx;
width: 30%;
}
.bottom-text {
color: #999999;
font-size: 24rpx;
}
}
.fixed-button {
position: fixed;
right: 10rpx;
bottom: 64rpx;
}
</style>
......@@ -4,8 +4,7 @@
<u-navbar :is-back="false" :background="{ background: 'transparent' }" :border-bottom="false">
<text class="title-view">我的</text>
</u-navbar>
<view class="mine-content">
<view class="header-view">
<view class="header-view">
<view class="header-left-view">
<view class="head-image">
<image :style="headImageStyle" :src="headImageUrl"></image>
......@@ -25,11 +24,13 @@
</view>
<view v-if="isSuperuser" class="super-button"><u-button@click="handleSuperButton">切换用户</u-button></view>
</view>
</view>
</view>
<view class="mine-content">
<view class="ware-house-view">
<view class="ware-house-title">仓配功能</view>
<view class="ware-house-content">
<view v-for="(item, index) in warehouseItems" :key="index" class="ware-house-content-item" @click="handleClick(item.pathName)">
<view v-for="(item, index) in warehouseItems" :key="index" class="ware-house-content-item" @click="handleClick(item.pathName)" hover-class="u-hover-class">
<view class="ware-house-image">
<image :src="item.icon" :style="item.imageStyle"></image>
</view>
......@@ -57,7 +58,6 @@
</template>
<script>
import util from '@/utils/util.js'
import login from "@/utils/login.js";
const app = getApp();
export default {
......@@ -87,6 +87,12 @@
items() {
return [
[{
pathName: 'order/index',
title: '订单管理',
value: '',
icon: 'dingdanguanli.png',
imageStyle: 'width:34rpx;height:32rpx'
},{
pathName: 'wallet/index',
title: '我的钱包',
value: '',
......@@ -94,26 +100,42 @@
imageStyle: 'width:34rpx;height:32rpx'
},
{
pathName: 'deposit/index',
title: '配件押金',
pathName: 'info/index',
title: '我的资料',
value: '',
icon: 'yajin.png',
icon: 'wodeziliao.png',
imageStyle: 'width:32rpx;height:32rpx'
},
{
pathName: 'contract/index',
title: '我的合同',
pathName: 'history/index',
title: '浏览记录',
value: '',
icon: 'hetong.png',
icon: 'liulanjilu.png',
imageStyle: 'width:34rpx;height:32rpx'
},
{
pathName: 'cert/index',
title: '我的证件',
value: '',
icon: 'zhengjian.png',
imageStyle: 'width:36rpx;height:28rpx'
}],[
// {
// pathName: 'deposit/index',
// title: '配件押金',
// value: '',
// icon: 'yajin.png',
// imageStyle: 'width:32rpx;height:32rpx'
// },
// {
// pathName: 'contract/index',
// title: '我的合同',
// value: '',
// icon: 'hetong.png',
// imageStyle: 'width:34rpx;height:32rpx'
// },
// {
// pathName: 'cert/index',
// title: '我的证件',
// value: '',
// icon: 'zhengjian.png',
// imageStyle: 'width:36rpx;height:28rpx'
// }
],
[
{
pathName: 'address/index',
title: '收货地址',
......@@ -183,6 +205,12 @@
},
shezhiImage() {
return process.uniEnv.qn_base_url + 'shezhi.png'
},
liulanjilumage() {
return process.uniEnv.qn_base_url + 'liulanjilu.png'
},
wodeziliaoImage() {
return process.uniEnv.qn_base_url + 'wodeziliao.png'
},
isSuperuser() {
return this.vuex_superuser
......@@ -264,9 +292,9 @@
.mine-view {
position: relative;
height: 100vh;
overflow: auto;
display: flex;
background-color: #F4F5F7;
flex-direction: column;
.header-image {
position: absolute;
width: 100%;
......@@ -279,19 +307,18 @@
font-size: 40rpx;
padding-left: 30rpx;
}
.mine-content {
position: relative;
padding: 26rpx 30rpx 30rpx 20rpx;
.header-view {
display: flex;
align-items: flex-start;
justify-content: space-between;
margin-bottom: 60rpx;
// margin-bottom: 60rpx;
padding: 26rpx 30rpx 60rpx 30rpx;
.header-left-view {
display: flex;
align-items: center;
.head-image {
z-index: 1;
width: 120rpx;
height: 120rpx;
background-color: #FFFFFF;
......@@ -338,6 +365,7 @@
}
}
.header-right-view {
z-index: 1;
.setting-view {
display: flex;
justify-content: flex-end;
......@@ -358,6 +386,14 @@
}
}
}
.mine-content {
height: 100%;
overflow: auto;
position: relative;
padding-bottom: 30rpx;
margin: 0rpx 30rpx;
border-radius: 12rpx;
.ware-house-view {
background-color: #FFFFFF;
border-radius: 12rpx;
......@@ -389,13 +425,10 @@
align-items: center;
}
}
}
}
.list-view {
.group-view {
margin-top: 20rpx;
background-color: #FFFFFF;
......@@ -419,10 +452,8 @@
margin: 30rpx;
}
}
}
}
}
.logout {
padding: 20rpx;
......
......@@ -21,23 +21,27 @@
<text class="search-btn-text">搜订单</text>
</view>
</view>
<view class="u-tabs-box" v-show="curNow == 0">
<u-tabs
height="66"
activeColor="#2272FF"
bg-color="none"
inactive-color="#999"
bar-height="4"
bar-width="44"
:offset="[0, 0]"
:list="list"
count="total"
:current="current"
@change="change"
:is-scroll="false"
font-size="28"
bold
></u-tabs>
<view class="u-tabs-box">
<!-- 写两个是避免切换subsection时候,current不是0的时候底部蓝条有初始动画 -->
<view v-for="index of [0, 1]" :key="index">
<u-tabs
v-show="curNow == index"
height="66"
activeColor="#2272FF"
bg-color="none"
inactive-color="#999"
bar-height="4"
bar-width="44"
:offset="offset[index]"
:list="list[index]"
count="total"
:current="current[index]"
@change="change"
:is-scroll="false"
font-size="28"
bold
></u-tabs>
</view>
</view>
<view class="tab-view">
......@@ -56,35 +60,39 @@
@scroll="scroll"
enable-back-to-top
>
<view class="loading-view" v-if="!loaded && !_freshing">
<u-loading mode="flower"></u-loading>
</view>
<NoOrder
v-else-if="noMore"
v-if="noMore"
imageName="zwdd.png"
:customStyle="noOrderCustomStyle"
/>
<template v-else>
<view v-for="(item, index) in orderList" :key="item.orderId">
<view
v-for="item in orderList[curNow][current[curNow]]"
:key="item.orderId"
>
<OrderCell
:orderData="item"
:type="orderType"
:type="cellType"
:location="dataValue"
@click="handleClick"
@action="handleClickCellButton"
>
</OrderCell>
</view>
<view class="load-more-view">
<u-loadmore
v-show="(pageNumber == 1 && loaded) || pageNumber > 1"
:status="loadStatus"
bgColor="#F4F5F7"
></u-loadmore>
<view
class="load-more-view"
v-show="(pageNumber == 1 && loaded) || pageNumber > 1"
>
<u-loadmore :status="loadStatus" bgColor="#F4F5F7"></u-loadmore>
</view>
</template>
<view class="loading-view" v-if="!loaded && !_freshing">
<u-loading mode="flower"></u-loading>
</view>
</scroll-view>
</view>
<!-- 悬浮按钮 -->
<!-- <EusingList type="collapse" /> -->
</TabBarPage>
</template>
......@@ -99,36 +107,60 @@ export default {
TabBarPage,
OrderCell,
NoOrder,
// EusingList,
},
data() {
return {
curNow: 0,
pageNumber: 0,
pageSize: 1000, // 因为需要排序,所以暂时去掉分页
orderList: [],
orderList: [
// 用多个数组存储可以优化用户切换体验,但是会增加内存
[[], [], [], [], [], []],
[[], [], []],
],
list: [
{
name: '待预约',
total: 0,
},
{
name: '待签到',
total: 0,
},
{
name: '待完工',
total: 0,
},
{
name: '审核中',
total: 0,
},
{
name: '异常单',
total: 0,
},
[
{
name: '待预约',
total: 0,
},
{
name: '待签到',
total: 0,
},
{
name: '待完工',
total: 0,
},
{
name: '审核中',
total: 0,
},
{
name: '异常单',
total: 0,
},
{
name: '已完工',
total: 0,
},
],
[
{
name: '待联系',
total: 0,
},
{
name: '待完工',
total: 0,
},
{
name: '异常单',
total: 0,
},
],
],
current: 0,
current: { 0: 0, 1: 0 },
loadStatus: 'loading',
dataValue: [],
loaded: false,
......@@ -142,62 +174,119 @@ export default {
},
computed: {
subList() {
return ['待处理', '已完工']
return ['全部订单', '今日订单']
},
// 0:'去预约', 1:'去签到', 2:'去完工', 3:'审核中', 4:'去处理', 5'已完工'
// 0 全部订单: 0:'待预约', 1:'待签到', 2:'待完工', 3:'审核中', 4:'异常单', 5'已完工'
// 1 今日订单: 0:'今日待联系', 1:'今日待完工', 2:'今日异常单'
orderType() {
return this.indexStatus[this.currentIndex]
return this.indexStatus[this.curNow][this.current[this.curNow]]
},
pageSize() {
// 待预约, 待签到,待完工,因为需要排序,所以暂时去掉分页,一次要完所有
return this.pageSizes[this.curNow][this.current[this.curNow]]
},
needSort() {
// 待预约, 待签到,待完工需要排序
return this.current + this.current[this.curNow] < 3
},
currentIndex() {
return this.curNow == 0 ? this.current : 5
pageSizes() {
// 待预约, 待签到,待完工,因为需要排序,所以暂时去掉分页,一次要完所有
return [
[10000, 10000, 10000, 15, 15, 15],
[10000, 10000, 15],
]
},
offset() {
return [
[0, 0],
[0, 44],
]
},
sousuoImage() {
return process.uniEnv.qn_base_url + 'sousuo.png'
},
// 每一种状态对应的tab的index
types() {
return {
waitAppointment: 0, // 待预约、
waitCheckIn: 1, // 待签到、
waitFinish: 2, // 待完工、
audit: 3, // 审核中、
exception: 4, // 异常单、
finish: 5, //已完工
}
return [
{
waitAppointment: 0, // 待预约、
waitCheckIn: 1, // 待签到、
waitFinish: 2, // 待完工、
audit: 3, // 审核中、
exception: 4, // 异常单、
finish: 5, //已完工
},
{
todayWaitContact: 0, // 今日待联系、
todayWaitFinish: 1, // 今日待完工、
todayException: 2, // 今日异常单、
},
]
},
//waitAccept、waitAppointment、waitCheckIn、waitFinish、exception、finish
// 每一个tab对应的状态
indexStatus() {
return {
0: 'waitAppointment',
1: 'waitCheckIn',
2: 'waitFinish',
3: 'audit',
4: 'exception',
5: 'finish',
}
return [
[
'waitAppointment',
'waitCheckIn',
'waitFinish',
'audit',
'exception',
'finish',
],
['todayWaitContact', 'todayWaitFinish', 'todayException'],
]
},
// 订单数量接的返回数量的key
countKeys() {
return [
'toAppointmentCount',
'toCheckinCount',
'toFinishCount',
'reviewingCount',
'exceptionCount',
[
'toAppointmentCount',
'toCheckinCount',
'toFinishCount',
'reviewingCount',
'exceptionCount',
'', // 待完工没有数量
],
['todayContactCount', 'todayFinishCount', 'todayExceptionCount'],
]
},
noMore() {
return this.orderList.length == 0 && this.loaded
return (
this.orderList[this.curNow][this.current[this.curNow]].length == 0 &&
this.loaded
)
},
cellTypes() {
return [
[
'waitAppointment',
'waitCheckIn',
'waitFinish',
'audit',
'exception',
'finish',
],
['', 'waitFinish', 'exception'],
]
},
// 仅用于传给OrderCell的type
cellType() {
return this.cellTypes[this.curNow][this.current[this.curNow]]
},
noOrderCustomStyle() {
return this.curNow == 0
? 'margin-top: 100rpx;background-color: #F4F5F7'
: 'margin-top: 200rpx;background-color: #F4F5F7'
return 'margin-top: 100rpx;background-color: #F4F5F7'
},
},
onLoad(e) {
getApp().trackPage('订单首页')
this._freshing = false
// 跳转到本页是否带了跳到那个tab的参数
if (e && e.type) {
this.current = e.type
this.current[this.curNow] = Math.max(
0,
this.indexStatus[this.curNow].indexOf(e.type)
)
}
},
onShow() {
......@@ -213,18 +302,17 @@ export default {
},
// tab栏切换
change(index) {
this.current = index
this.orderList = []
this.current[this.curNow] = index
this.reloadOrderList()
},
// 滚动底部
reachBottom(e) {
if (this.loadStatus != 'loadmore') return
this.loadStatus == 'loading'
this.getOrderList(this.currentIndex)
this.getOrderList()
},
// 页面数据
getOrderList(index) {
getOrderList() {
// 状态处理
this.pageNumber += 1
if (this.pageNumber == 1) {
......@@ -234,28 +322,41 @@ export default {
pageNumber: this.pageNumber,
pageSize: this.pageSize,
keyword: '',
type: this.indexStatus[index],
type: this.orderType,
}
var self = this
self.$u.api.listOrder(param).then((res) => {
if (res.code == 200) {
if (res.data.type != self.orderType) return
if (res.data.type != self.orderType) return // 已切换到其他tab,则不处理后台返回的数据
if (self.pageNumber == 1) {
self.orderList = []
// 下拉刷新或切换到新tab,清空对应数组
self.orderList[this.curNow][this.current[this.curNow]] = []
}
if (res.data.list) {
self.orderList.push(...res.data.list)
if (self.list[self.types[res.data.type]]) {
self.list[self.types[res.data.type]].total = res.data.total
self.orderList[this.curNow][this.current[this.curNow]].push(
...res.data.list
)
// 更新tab数字
if (
self.list[this.curNow][self.types[this.curNow][res.data.type]]
) {
self.list[this.curNow][
self.types[this.curNow][res.data.type]
].total = res.data.total
}
self.orderList.sort((x, y) => {
return x.currentOverTime <= y.currentOverTime ? 1 : -1
})
// 待预约, 待签到,待完工需要排序
if (this.needSort) {
self.orderList[this.curNow][this.current[this.curNow]].sort(
(x, y) => {
return x.currentOverTime <= y.currentOverTime ? 1 : -1
}
)
}
// 更新底部加载状态
self.loadStatus =
res.data.total > self.orderList.length &&
res.data.total >
self.orderList[this.curNow][this.current[this.curNow]].length &&
res.data.list.length == self.pageSize
? 'loadmore'
: 'nomore'
......@@ -275,19 +376,24 @@ export default {
// 获取订单数量
getOrderCount() {
var self = this
self.$u.api.listOrderCount().then((res) => {
this.$u.api.listOrderCount().then((res) => {
if (res.code == 200) {
if (res.data) {
// 修改各个tab数量
var i = 0
var j = 0
var count = 0
for (var item of self.list) {
item.total = res.data[self.countKeys[i]]
count += item.total
i++
for (var items of this.list) {
var i = 0
for (var item of items) {
item.total = res.data[this.countKeys[j][i]] || 0
if (j == 0) {
// 非今日订单数量加起来
count += item.total
}
i++
}
j++
}
// 修改tab总数
if (count > 0) {
uni.setTabBarBadge({
......@@ -305,15 +411,8 @@ export default {
}
})
},
handleClickCellButton(item, type) {
if (type == 'exception') {
this.$u.api.workerDealWithError(item.orderId).then(() => {})
}
let partAuditResults = item.partAuditResults ? ['orderSpareParts'] : []
let auditResults = item.auditResults ? Object.keys(item.auditResults) : []
auditResults = auditResults.concat(partAuditResults)
// 去完工
handleClickCellButton(item, type, showCountTime, auditResults) {
if (!this.loaded) return
uni.navigateTo({
url:
'pages/order/complete?orderId=' +
......@@ -333,12 +432,13 @@ export default {
'&brandId=' +
item.lianbaoBrandId +
'&auditResults=' +
(auditResults ? auditResults.join() : '') +
(auditResults ? auditResults.join() : '') +
'&orderNumber=' +
item.orderNumber
item.orderNumber,
})
},
handleClick(item, type, showCountTime) {
if (!this.loaded) return
// type:类型,showCountTime:是否显示倒计时。详情页面情况太多,提前传值可以避免页面晃动
//type类型
// 'waitAccept': 待接单、待抢单;'waitAppointment': 待预约;'waitCheckIn': 待签到;'waitFinish': 待完工;'audit': 审核中;'exception': 异常单;'finish': 已完工;'other': 工单结算信息
......@@ -372,7 +472,7 @@ export default {
reloadOrderList() {
this.pageNumber = 0
this.loadStatus = 'loading'
this.getOrderList(this.currentIndex)
this.getOrderList()
},
scroll(e) {
this.old.scrollTop = e.detail.scrollTop
......@@ -391,21 +491,20 @@ export default {
.u-tabs-box {
margin-bottom: 30rpx;
}
.tab-view {
height: 100%;
overflow: auto;
// padding-bottom: 20rpx;
.load-more-view {
margin-bottom: 20rpx;
padding-bottom: 44rpx;
}
.loading-view {
width: 100%;
background-color: transparent;
display: flex;
align-items: center;
justify-content: center;
margin-top: 300rpx;
position: absolute;
top: 50%;
position: fixed;
}
}
......@@ -413,7 +512,7 @@ export default {
display: flex;
flex-direction: row;
justify-content: space-between;
padding-bottom: 20rpx;
padding-bottom: 18rpx;
.search-sub {
height: 72rpx;
......
......@@ -128,11 +128,6 @@
this.isRuZhu = false;
});
},
onUnload() {
uni.switchTab({
url: '/pages/index/mine'
});
},
methods: {
isUpload(typeBool) {
return typeBool ? '已上传' : '未上传'
......
<template>
<view class="contract">
<u-navbar
title="我的合同"
b:is-back="false"
:background="background"
:border-bottom="false"
></u-navbar>
<u-navbar
back-icon-color="#333333"
background="#FFFFFF"
title="我的合同"
titleColor="#333333"
:border-bottom="false"
title-bold
></u-navbar>
<view class="content">
<view v-if="res.length > 0">
<text class="title">合同清单</text>
......
<template>
<view class="history-view">
<u-navbar
back-icon-color="#333333"
background="#FFFFFF"
:title="title"
titleColor="#333333"
:border-bottom="false"
title-bold
></u-navbar>
<view class="none-view" v-if="noneHistory">
<NoOrder
text="当前暂无浏览记录"
:customStyle="customStyle"
imageName="zhangdan.png"
/>
</view>
<template v-else>
<view class="head-view">
<image
:src="chakanjiluImage"
class="back-image"
mode="widthFix"
></image>
<view class="head-info">
<view>最近查看记录</view>
<view class="head-message">最近查看或操作过的5条订单</view>
</view>
</view>
<view class="content-view">
<view v-for="item in orderList" :key="item.orderId">
<OrderCell
:orderData="item"
:location="[]"
model="simple"
@click="handleClickCell"
@action="handleClickButton"
>
</OrderCell>
</view>
<view class="bottom-tip">
<u-loadmore
:status="nomore"
font-size="26"
color="#999999"
></u-loadmore>
</view>
</view>
</template>
</view>
</template>
<script>
import OrderCell from '@/components/order/index.vue'
import NoOrder from '@/components/order/noOrder.vue'
export default {
components: {
OrderCell,
NoOrder,
},
props: {
visible: {
type: Boolean,
default: false,
},
},
data() {
return {
loaded: false,
}
},
computed: {
title() {
return this.noneHistory ? '浏览记录' : ' '
},
noneHistory() {
return this.orderList.length <= 0
},
orderList() {
return this.vuex_last_five_orders.filter((item) => item) || []
},
chakanjiluImage() {
return process.uniEnv.qn_base_url + 'chakanjilu-y.png'
},
customStyle() {
return 'background-color: #F4F5F7'
},
},
onLoad() {
getApp().trackPage('浏览记录')
},
methods: {
handleClickCell(item, type, showCountTime) {
// type:类型,showCountTime:是否显示倒计时。详情页面情况太多,提前传值可以避免页面晃动
//type类型
// 'waitAccept': 待接单、待抢单;'waitAppointment': 待预约;'waitCheckIn': 待签到;'waitFinish': 待完工;'audit': 审核中;'exception': 异常单;'finish': 已完工;'other': 工单结算信息
uni.navigateTo({
url:
'pages/order/detail?id=' +
item.orderId +
'&type=' +
type +
'&showCountTime=' +
showCountTime,
})
},
handleClickButton(item, type, showCountTime, auditResults) {
uni.navigateTo({
url:
'pages/order/complete?orderId=' +
item.orderId +
'&categoryId=' +
item.categoryId +
'&orderServiceType=' +
item.orderServiceType +
'&inGuaranteePeriod=' +
item.inGuaranteePeriod +
'&partnerCompanyId=' +
item.partnerCompanyId +
'&maintainStep=' +
item.maintainStep +
'&orderStatus=' +
item.orderStatus +
'&brandId=' +
item.lianbaoBrandId +
'&auditResults=' +
(auditResults ? auditResults.join() : '') +
'&orderNumber=' +
item.orderNumber,
})
},
},
}
</script>
<style lang="scss" scoped>
.history-view {
display: flex;
flex-direction: column;
height: 100vh;
.head-view {
display: relative;
.back-image {
position: absolute;
top: 0;
left: 0;
width: 100%;
z-index: -1;
}
.head-info {
padding: 0 30rpx 20rpx 30rpx;
font-size: 48rpx;
font-weight: bold;
color: #333333;
.head-message {
font-size: 32rpx;
color: #2272ff;
font-weight: 400;
margin-top: 14rpx;
}
}
}
.none-view {
margin-top: 160rpx;
}
.content-view {
height: 100%;
overflow: auto;
.bottom-tip {
margin-bottom: 44rpx;
margin-top: 30rpx;
}
}
}
</style>
<template>
<view class="info-view">
<u-navbar
back-icon-color="#333333"
background="#FFFFFF"
title="我的资料"
titleColor="#333333"
:border-bottom="false"
title-bold
></u-navbar>
<view class="list-view">
<view v-for="(group, ind) in items" :key="ind" class="group-view">
<u-cell-group :border="false">
<view v-for="(item, index) in group" :key="index">
<u-cell-item
:value="item.value"
@click="handleClick(item.pathName)"
>
<image
slot="icon"
:src="item.icon"
:style="item.imageStyle"
></image>
<view slot="title" class="item-title">{{ item.title }}</view>
<view slot="value" class="item-value">{{ value }}</view>
</u-cell-item>
</view>
</u-cell-group>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {}
},
computed: {
items() {
return [
[
{
pathName: 'deposit/index',
title: '配件押金',
value: '',
icon: process.uniEnv.qn_base_url + 'yajin.png',
imageStyle: 'width:32rpx;height:32rpx',
},
{
pathName: 'contract/index',
title: '我的合同',
value: '',
icon: process.uniEnv.qn_base_url + 'hetong.png',
imageStyle: 'width:34rpx;height:32rpx',
},
{
pathName: 'cert/index',
title: '我的证件',
value: '',
icon: process.uniEnv.qn_base_url + 'zhengjian.png',
imageStyle: 'width:36rpx;height:28rpx',
},
],
]
},
},
onLoad() {
getApp().trackPage('我的资料')
},
methods: {
handleClick(path) {
this.$u.route({
url: 'pages/mine/' + path,
})
},
},
}
</script>
<style lang="scss" scoped>
.info-view {
position: relative;
height: 100vh;
display: flex;
background-color: #f4f5f7;
flex-direction: column;
.list-view {
height: 100%;
overflow: auto;
.group-view {
margin-top: 20rpx;
background-color: #ffffff;
border-radius: 12rpx;
overflow: hidden;
.item-title {
font-size: 32rpx;
color: #333333;
margin-left: 16rpx;
line-height: 32rpx;
}
.item-value {
font-size: 26rpx;
color: #999999;
}
.line-view {
height: 2rpx;
background-color: #f4f5f7;
margin: 30rpx;
}
}
}
}
</style>
<template>
<view class="order-manage-view">
<u-navbar
back-icon-color="#333333"
background="#FFFFFF"
title="订单管理"
titleColor="#333333"
:border-bottom="false"
title-bold
></u-navbar>
<view class="body-view">
<view class="header-view">
<view class="title-view">工作数据</view>
<view class="time-view">
<u-tabs
height="56"
activeColor="#2272FF"
bg-color="none"
inactive-color="#999"
bar-height="4"
bar-width="44"
:offset="offset"
:list="timeTypeTexts"
:current="current"
@change="change"
:is-scroll="false"
font-size="26"
bold
></u-tabs>
</view>
</view>
<view class="line-view"></view>
<view class="content-view">
<view
v-for="(item, index) in detailLabels"
:key="index"
class="item-view"
>
<view
class="left-view"
@click="handleClick(index)"
hover-class="u-hover-class"
>
<view :class="['count-view', { active: item.type == 'finish' }]">{{
info[item.key] || 0
}}</view>
<view>{{ item.label }}</view>
</view>
</view>
</view>
<view>
<u-toast ref="uToast" />
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
info: {},
offset: [0, 0],
current: 0,
currentTime: 'today',
}
},
computed: {
timeTypeTexts() {
return [
{ name: '今日' },
{ name: '昨日' },
{ name: '本周' },
{ name: '本月' },
]
// return { today: '今日', yesterday: '昨日', week: '本周', month: '本月' }
},
detailLabels() {
return [
{ label: '已接单', type: 'take', key: 'acceptedCount' },
{ label: '已签到', type: 'checkin', key: 'checkedCount' },
{ label: '已提交完工', type: 'finish', key: 'finishedCount' },
]
},
params() {
var date = new Date()
var timestamp = date.getTime()
var today = this.$u.timeFormat(timestamp, 'yyyy-mm-dd')
var yesterday = this.$u.timeFormat(date.setDate(date.getDate() - 1))
var weekDays = [6, 0, 1, 2, 3, 4, 5]
var week = this.$u.timeFormat(
date.setDate(date.getDate() - weekDays[date.getDay()])
)
var month = this.$u.timeFormat(date.setDate(1))
return [
{ start: today, end: today },
{ start: yesterday, end: yesterday },
{ start: week, end: today },
{ start: month, end: today },
]
},
currentParam() {
return this.params[this.current]
},
},
onLoad() {
this.getOrderCount()
},
methods: {
// 获取订单数量
getOrderCount() {
this.$u.api.manageOrderCount(this.currentParam).then((res) => {
if (res.code == 200) {
if (res.data) {
this.info = res.data || {}
}
} else {
console.log(res.message, '获取订单数量失败!')
}
})
},
change(index) {
this.current = index
this.getOrderCount()
},
handleClick(index) {
var item = this.detailLabels[index]
if (this.info[item.key] > 0) {
this.$u.route({
url: 'pages/mine/order/list',
params: {
orderType: item.type,
title: this.timeTypeTexts[this.current].name + '-' + item.label,
...this.currentParam,
},
})
} else {
this.$refs.uToast.show({
title: '暂无数据',
type: 'warning',
})
}
},
},
}
</script>
<style lang="scss" scoped>
.order-manage-view {
.body-view {
background-color: #ffffff;
margin: 20rpx 30rpx;
border-radius: 12rpx;
padding: 20rpx 30rpx;
.header-view {
display: flex;
justify-content: space-between;
.title-view {
font-size: 32rpx;
color: #333333;
font-weight: bold;
display: flex;
align-items: center;
}
.time-view {
width: 300rpx;
}
}
.line-view {
width: 100%;
background-color: #f4f5f7;
height: 2rpx;
margin: 30rpx 0;
}
.content-view {
display: flex;
align-self: center;
justify-content: space-around;
padding: 54rpx 0;
.item-view {
display: flex;
align-items: center;
justify-content: center;
.left-view {
text-align: center;
color: #666666;
font-size: 28rpx;
width: 180rpx;
.count-view {
font-weight: bold;
font-size: 52rpx;
margin-bottom: 20rpx;
color: #333333;
&.active {
color: #2272ff;
}
}
}
}
}
}
}
</style>
<template>
<view class="list-view">
<u-navbar
back-icon-color="#333333"
background="#FFFFFF"
:title="title"
titleColor="#333333"
:border-bottom="false"
title-bold
></u-navbar>
<view class="content-view">
<scroll-view
scroll-y
@scrolltolower="reachBottom"
scroll-anchoring
refresher-enabled="true"
:refresher-triggered="triggered"
:refresher-threshold="100"
:scroll-top="scrollTop"
refresher-background="#F4F5F7"
@refresherrefresh="onRefresh"
@refresherrestore="onRestore"
enable-back-to-top
>
<view class="loading-view" v-if="!loaded && !_freshing">
<u-loading mode="flower"></u-loading>
</view>
<NoOrder
v-else-if="noMore"
imageName="zwdd.png"
:customStyle="noOrderCustomStyle"
/>
<template v-else>
<view v-for="item in orderList" :key="item.orderId">
<OrderCell
:orderData="item"
:type="cellType"
:location="dataValue"
@click="handleClick"
@action="handleClickCellButton"
>
</OrderCell>
</view>
<view
class="load-more-view"
v-show="(pageNumber == 1 && loaded) || pageNumber > 1"
>
<u-loadmore :status="loadStatus" bgColor="#F4F5F7"></u-loadmore>
</view>
</template>
</scroll-view>
</view>
</view>
</template>
<script>
import OrderCell from '@/components/order/index.vue'
import NoOrder from '@/components/order/noOrder.vue'
export default {
components: {
OrderCell,
NoOrder,
},
data() {
return {
pageNumber: 0,
pageSize: 10000, // 因为需要排序,所以暂时去掉分页
orderList: [],
loadStatus: 'loading',
dataValue: [],
loaded: false,
triggered: true,
_freshing: false,
title: '',
orderType: '',
timeParam: {},
}
},
computed: {
cellType() {
return this.orderType == 'finish' ? 'finish' : ''
},
noMore() {
return this.orderList.length == 0 && this.loaded
},
noOrderCustomStyle() {
return 'margin-top: 100rpx;background-color: #F4F5F7'
},
},
onLoad(e) {
getApp().trackPage('订单首页')
this._freshing = false
if (e && e.title) {
this.title = decodeURIComponent(e.title)
}
if (e && e.orderType) {
this.orderType = e.orderType
}
if (e && e.start && e.end) {
this.timeParam = { start: e.start, end: e.end }
}
this.reloadOrderList()
},
methods: {
reachBottom(e) {
if (this.loadStatus != 'loadmore') return
this.loadStatus == 'loading'
this.getOrderList()
},
// 页面数据
getOrderList() {
// 状态处理
this.pageNumber += 1
if (this.pageNumber == 1) {
this.loaded = false
}
var param = {
pageNumber: this.pageNumber,
pageSize: this.pageSize,
keyword: '',
type: this.orderType,
...this.timeParam,
}
var self = this
self.$u.api.manageOrderList(param).then((res) => {
if (res.code == 200) {
if (self.pageNumber == 1) {
self.orderList = []
}
if (res.data.list) {
self.orderList.push(...res.data.list)
self.orderList.sort((x, y) => {
return x.currentOverTime <= y.currentOverTime ? 1 : -1
})
self.loadStatus =
res.data.total > self.orderList.length &&
res.data.list.length == self.pageSize
? 'loadmore'
: 'nomore'
}
} else {
console.log(res.message, '获取订单数量失败!')
}
self.$nextTick(() => {
if (self._freshing) {
self.triggered = false
self._freshing = false
}
})
this.loaded = true
})
},
handleClickCellButton(item, type, showCountTime, auditResults) {
// 去完工
uni.navigateTo({
url:
'pages/order/complete?orderId=' +
item.orderId +
'&categoryId=' +
item.categoryId +
'&orderServiceType=' +
item.orderServiceType +
'&inGuaranteePeriod=' +
item.inGuaranteePeriod +
'&partnerCompanyId=' +
item.partnerCompanyId +
'&maintainStep=' +
item.maintainStep +
'&orderStatus=' +
item.orderStatus +
'&brandId=' +
item.lianbaoBrandId +
'&auditResults=' +
(auditResults ? auditResults.join() : '') +
'&orderNumber=' +
item.orderNumber,
})
},
handleClick(item, type, showCountTime) {
// type:类型,showCountTime:是否显示倒计时。详情页面情况太多,提前传值可以避免页面晃动
//type类型
// 'waitAccept': 待接单、待抢单;'waitAppointment': 待预约;'waitCheckIn': 待签到;'waitFinish': 待完工;'audit': 审核中;'exception': 异常单;'finish': 已完工;'other': 工单结算信息
uni.navigateTo({
url:
'pages/order/detail?id=' +
item.orderId +
'&type=' +
type +
'&showCountTime=' +
showCountTime,
})
},
onRefresh() {
if (this._freshing) return
this._freshing = true
this.reloadOrderList()
},
onRestore() {
this.triggered = 'restore' // 需要重置
},
reloadOrderList() {
this.pageNumber = 0
this.loadStatus = 'loading'
this.getOrderList()
},
},
}
</script>
<style lang="scss" scoped>
.list-view {
height: 100vh;
overflow: auto;
display: flex;
flex-direction: column;
.content-view {
height: 100%;
overflow: auto;
padding: 20rpx 30rpx;
.load-more-view {
padding-bottom: 44rpx;
}
.loading-view {
width: 100%;
display: flex;
align-items: center;
justify-content: center;
margin-top: 300rpx;
position: absolute;
}
}
}
</style>
......@@ -29,7 +29,7 @@
{
pathName: 'about',
title: '当前版本',
value: process.uniEnv.version,
value: process.uniEnv.version_number,
icon: process.uniEnv.qn_base_url + 'version.png',
imageStyle: 'width:32rpx;height:32rpx'
}
......
......@@ -318,7 +318,7 @@
.fixed-button {
position: fixed;
right: 20rpx;
right: 10rpx;
bottom: 64rpx;
}
......
......@@ -63,7 +63,9 @@
:prop="item.fieldsName"
:border-bottom="false"
v-show="
((item.fieldsName != 'actualPaid' && item.fieldsName != 'eSerialNum') || show200) &&
((item.fieldsName != 'actualPaid' &&
item.fieldsName != 'eSerialNum') ||
show200) &&
((readOnly &&
!$u.test.isEmpty(form[item.fieldsName])) ||
!readOnly)
......@@ -866,7 +868,7 @@ export default {
const save = await this.nextStepSaveData()
if (save) {
uni.reLaunch({
url: '/pages/index/order?type=0',
url: '/pages/index/order?type=waitAppointment',
})
}
},
......@@ -1002,7 +1004,7 @@ export default {
type: 'success',
callback: () => {
uni.reLaunch({
url: '/pages/index/order?type=3',
url: '/pages/index/order?type=audit',
})
},
})
......@@ -1023,7 +1025,7 @@ export default {
type: 'success',
callback: () => {
uni.reLaunch({
url: '/pages/index/order?type=3',
url: '/pages/index/order?type=audit',
})
},
})
......@@ -1091,10 +1093,14 @@ export default {
if (innerItem.fieldsName === 'paymentMethodsType') {
// 选不需要收款的时候,收款金额修改为非必选
const actualPaid = groupItem.items.find((v) => v.fieldsName === 'actualPaid')
const actualPaid = groupItem.items.find(
(v) => v.fieldsName === 'actualPaid'
)
actualPaid.required = data.value != '03'
const eSerialNum = groupItem.items.find((v) => v.fieldsName === 'eSerialNum')
const eSerialNum = groupItem.items.find(
(v) => v.fieldsName === 'eSerialNum'
)
eSerialNum.required = data.value != '03'
}
......
......@@ -947,7 +947,7 @@ export default {
'&brandId=' +
this.order.lianbaoBrandId +
'&orderNumber=' +
this.order.orderNumber
this.order.orderNumber,
})
},
rejectOrder() {
......
<!-- 工单-搜索页 -->
<template>
<view class="search-wrap">
<view class="top-item">
<u-search
v-model="search.keyword"
bg-color="#FFFFFF"
placeholder="搜索:工单号·用户姓名·手机号·地址"
search-icon-color="#999999"
color="#333333"
placeholder-color="#999999"
height="72"
margin="0 30rpx"
:animation="true"
:show-action="true"
:action-style="{
'font-size': '32rpx',
'font-weight': 500,
'color': '#2272FF'
}"
:focus="true"
@search="searchOrder"
@custom="searchOrder"
></u-search>
</view>
<view class="content-item">
<view v-if="orderList && orderList.length > 0" class="order-row">
<view v-for="(item, index) in orderList" :key="item.orderId">
<OrderCell :orderData="item" :orderType="orderType" :location="dataValue"
@click="handleClick" @action="handleClickCellButton"> </OrderCell>
</view>
<u-loadmore :status="loadStatus" bgColor="#F4F5F7"></u-loadmore>
</view>
<view v-else-if="loaded" class="empty-result">
<u-image width="374" height="256" :src="searchEmpty">
<u-loading slot="loading"></u-loading>
</u-image>
<text class="empty-message">
当前暂无搜索结果
</text>
</view>
</view>
</view>
<view class="search-wrap">
<view class="top-item">
<u-search
v-model="search.keyword"
bg-color="#FFFFFF"
placeholder="搜索:工单号·用户姓名·手机号·地址"
search-icon-color="#999999"
color="#333333"
placeholder-color="#999999"
height="72"
margin="0 30rpx"
:animation="true"
:show-action="true"
:action-style="{
'font-size': '32rpx',
'font-weight': 500,
color: '#2272FF',
}"
:focus="true"
@change="keywordChange"
@focus="onfocus"
@blur="loseFocus"
@search="searchOrder"
@custom="searchOrder"
></u-search>
</view>
<view class="association-wrap" v-show="showAssociation">
<view
v-for="(item, index) in associationList"
:key="index"
class="association-cell u-border-top"
@click="handleClick(item, orderType, true)"
>
<view class="u-m-l-40">
<u-parse
:html="item.contactNameHighlight"
:tag-style="style"
></u-parse>
</view>
<view class="u-m-l-10">
<u-parse
:html="item.contactPhoneHighlight"
:tag-style="style"
></u-parse>
</view>
</view>
<view class="u-border-top" />
</view>
<view class="content-item" v-show="showOrderCell">
<view v-if="orderList && orderList.length > 0" class="order-row">
<view v-for="item in orderList" :key="item.orderId">
<OrderCell
:orderData="item"
:orderType="orderType"
:location="dataValue"
@click="handleClick"
@action="handleClickCellButton"
>
</OrderCell>
</view>
<u-loadmore :status="loadStatus" bgColor="#F4F5F7"></u-loadmore>
</view>
<view v-else-if="loaded" class="empty-result">
<u-image width="374" height="256" :src="searchEmpty">
<u-loading slot="loading"></u-loading>
</u-image>
<text class="empty-message"> 当前暂无搜索结果 </text>
</view>
</view>
</view>
</template>
<script>
import OrderCell from "@/components/order/index.vue";
export default {
components: {
OrderCell
},
data() {
return {
search: {
type: '',
keyword: '',
pageSize: 10,
pageNumber: 0,
orderStatusRangeType: '',
},
orderList: [],
loaded: false,
total: 10,
loadStaus: 'loadmore',
};
},
onLoad() {
getApp().trackPage('订单搜索页')
// this.searchOrder()
},
onReachBottom() {
let len = this.orderList && this.orderList.length || 0
if(!this.loaded || len >= this.total) return;
this.loadStaus = 'loading';
this.search.pageNumber = ++ this.search.pageNumber;
this.getOrderList('onReachBottom')
},
computed: {
searchEmpty() {
return process.uniEnv.qn_base_url + 'SearchEmpty.png'
},
},
methods: {
searchOrder(index) {
this.search.pageNumber = 1
this.loadStaus = 'loading';
if(this.search.keyword) {
getApp().track('search_order', {keyword: this.search.keyword});
this.getOrderList()
}
},
// 页面数据
getOrderList(event) {
let self = this;
if(!self.search.keyword) {
return false
}
// 状态处理
self.loaded = false
self.$u.api.listOrder(self.search).then((res) => {
if (res.code == 200) {
if (res.data) {
let list = res.data.list || []
self.total = res.data.total || 0
if(event == 'onReachBottom') {
self.orderList.push(...list)
} else {
self.orderList = list
}
self.loadStatus = res.data.total > self.orderList.length ? 'loadmore' : 'nomore'
}
} else {
self.$u.toast('请求失败');
}
self.loaded = true
});
},
handleClickCellButton(item) {
// 去完工
uni.navigateTo({
url: 'pages/order/complete?orderId='+item.orderId
+ "&categoryId=" + item.categoryId
+ "&orderServiceType=" + item.orderServiceType
+ "&inGuaranteePeriod=" + item.inGuaranteePeriod
+ "&partnerCompanyId=" + item.partnerCompanyId
+ "&auditResultsId=" + (item.auditResults?Object.keys(item.auditResults)[Object.keys(item.auditResults).length - 1]:'')
+ "&maintainStep=" + item.maintainStep
})
},
handleClick(item, type, showCountTime) { // type:类型,showCountTime:是否显示倒计时。详情页面情况太多,提前传值可以避免页面晃动
//type类型
// 'waitAccept': 待接单、待抢单;'waitAppointment': 待预约;'waitCheckIn': 待签到;'waitFinish': 待完工;'audit': 审核中;'exception': 异常单;'finish': 已完工;'other': 工单结算信息
uni.navigateTo({
url: 'pages/order/detail?id=' + item.orderId + '&type=' + type + '&showCountTime=' + showCountTime
})
},
},
}
import OrderCell from "@/components/order/index.vue";
export default {
components: {
OrderCell,
},
data() {
return {
search: {
type: "",
keyword: "",
pageSize: 10,
pageNumber: 0,
orderStatusRangeType: "",
},
orderList: [],
associationList: [],
loaded: false,
focused: true,
total: 10,
loadStaus: "loadmore",
style: {
// 字符串的形式
span: "color: red",
},
};
},
onLoad() {
getApp().trackPage("订单搜索页");
// this.searchOrder()
this.associationOrder();
},
onReachBottom() {
let len = (this.orderList && this.orderList.length) || 0;
if (!this.loaded || len >= this.total) return;
this.loadStaus = "loading";
this.search.pageNumber = ++this.search.pageNumber;
this.getOrderList("onReachBottom");
},
computed: {
searchEmpty() {
return process.uniEnv.qn_base_url + "SearchEmpty.png";
},
showAssociation() {
return this.focused && !this.$u.test.isEmpty(this.associationList);
},
showOrderCell() {
return !this.focused && this.$u.test.isEmpty(this.associationList);
},
},
methods: {
searchOrder(index) {
this.search.pageNumber = 1;
this.loadStaus = "loading";
if (this.search.keyword) {
getApp().track("search_order", { keyword: this.search.keyword });
this.getOrderList();
}
},
// 高亮文本
highlights() {
const keyword = this.search.keyword;
this.associationList = this.associationList.map((item) => {
for (let key in item) {
if (key === "contactName" || key === "contactPhone") {
let replaceReg = new RegExp(keyword, "g"); // 匹配关键字正则
let replaceString = "<span>" + keyword + "</span>"; // 高亮替换v-html值
item[key + "Highlight"] = item[key].replace(
replaceReg,
replaceString
); // 开始替换
}
}
return item;
});
},
/** 联想工单 */
async associationOrder() {
let res = await this.$u.api.association(this.search);
if (res && res.code == 200) {
this.associationList = res.data;
}
this.highlights();
},
/** 搜索关键字变更 */
keywordChange(value) {
if (this.$u.test.isEmpty(value)) {
this.associationList = [];
} else {
this.associationOrder();
}
},
/** 获得焦点 */
onfocus() {
this.focused = true;
},
/** 失去焦点 */
loseFocus() {
this.focused = false;
},
// 页面数据
getOrderList(event) {
let self = this;
if (!self.search.keyword) {
return false;
}
// 状态处理
self.loaded = false;
self.$u.api.listOrder(self.search).then((res) => {
if (res.code == 200) {
if (res.data) {
let list = res.data.list || [];
self.total = res.data.total || 0;
if (event == "onReachBottom") {
self.orderList.push(...list);
} else {
self.orderList = list;
}
self.loadStatus =
res.data.total > self.orderList.length ? "loadmore" : "nomore";
}
} else {
self.$u.toast("请求失败");
}
self.loaded = true;
});
},
handleClickCellButton(item) {
// 去完工
uni.navigateTo({
url:
"pages/order/complete?orderId=" +
item.orderId +
"&categoryId=" +
item.categoryId +
"&orderServiceType=" +
item.orderServiceType +
"&inGuaranteePeriod=" +
item.inGuaranteePeriod +
"&partnerCompanyId=" +
item.partnerCompanyId +
"&auditResultsId=" +
(item.auditResults
? Object.keys(item.auditResults)[
Object.keys(item.auditResults).length - 1
]
: "") +
"&maintainStep=" +
item.maintainStep,
});
},
handleClick(item, type, showCountTime) {
// type:类型,showCountTime:是否显示倒计时。详情页面情况太多,提前传值可以避免页面晃动
//type类型
// 'waitAccept': 待接单、待抢单;'waitAppointment': 待预约;'waitCheckIn': 待签到;'waitFinish': 待完工;'audit': 审核中;'exception': 异常单;'finish': 已完工;'other': 工单结算信息
uni.navigateTo({
url:
"pages/order/detail?id=" +
item.orderId +
"&type=" +
type +
"&showCountTime=" +
showCountTime,
});
},
},
};
</script>
<style lang="scss">
.search-wrap {
.top-item {
position: sticky;
padding: 20rpx 0;
top: 0rpx;
background-color: #F4F5F7;
z-index: 2;
/deep/ .u-search .u-content {
padding: 0 20rpx 0 40rpx;
}
/deep/ .u-search .u-input {
margin: 0 24rpx;
}
/deep/ .u-search .u-icon--right .u-iconfont {
font-size: 36rpx !important;
}
/deep/ .u-search .u-close-wrap .u-iconfont {
color: #CCCCCC;
}
}
.content-item {
padding: 10rpx 30rpx 20rpx 30rpx;
.empty-result {
padding-top: 354rpx;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.empty-message {
padding-top: 28rpx;
font-size: 28rpx;
font-weight: 400;
color: #666666;
line-height: 28rpx;
}
}
}
.top-item {
position: sticky;
padding: 20rpx 0;
top: 0rpx;
background-color: #f4f5f7;
z-index: 2;
/deep/ .u-search .u-content {
padding: 0 20rpx 0 40rpx;
}
/deep/ .u-search .u-input {
margin: 0 24rpx;
}
/deep/ .u-search .u-icon--right .u-iconfont {
font-size: 36rpx !important;
}
/deep/ .u-search .u-close-wrap .u-iconfont {
color: #cccccc;
}
}
.content-item {
padding: 10rpx 30rpx 20rpx 30rpx;
.empty-result {
padding-top: 354rpx;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.empty-message {
padding-top: 28rpx;
font-size: 28rpx;
font-weight: 400;
color: #666666;
line-height: 28rpx;
}
}
}
.association-wrap {
.association-cell {
display: flex;
padding: 26rpx 32rpx;
font-size: 28rpx;
line-height: 54rpx;
color: #606266;
background: #ffffff;
}
}
}
</style>
......@@ -12,7 +12,7 @@ try {
}
// 需要永久存储,且下次APP启动需要取出的,在state中的变量名
let saveStateKeys = ['vuex_user', 'vuex_wx_uid', 'vuex_token', 'vuex_cache', 'uploadTask', 'vuex_superuser'];
let saveStateKeys = ['vuex_user', 'vuex_wx_uid', 'vuex_token', 'vuex_cache', 'uploadTask', 'vuex_superuser', 'vuex_last_five_orders'];
// 保存变量到本地存储中
const saveLifeData = function(key, value) {
......@@ -34,6 +34,7 @@ const store = new Vuex.Store({
vuex_token: lifeData.vuex_token ? lifeData.vuex_token : '',
vuex_cache: lifeData.vuex_cache ? lifeData.vuex_cache : {},
vuex_superuser: lifeData.vuex_superuser || false,
vuex_last_five_orders: lifeData.vuex_last_five_orders ? lifeData.vuex_last_five_orders : [],
vuex_version: '1.0.1',
vuex_config: {},
// 入驻信息
......
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