Commit 69848cf5 authored by Damon's avatar Damon

chore: merge dev-1.5.0

parents 87e76966 85c30197
...@@ -3023,6 +3023,8 @@ ...@@ -3023,6 +3023,8 @@
"terser-webpack-plugin": "^2.3.6", "terser-webpack-plugin": "^2.3.6",
"thread-loader": "^2.1.3", "thread-loader": "^2.1.3",
"url-loader": "^2.2.0", "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", "vue-style-loader": "^4.1.2",
"webpack": "^4.0.0", "webpack": "^4.0.0",
"webpack-bundle-analyzer": "^3.8.0", "webpack-bundle-analyzer": "^3.8.0",
...@@ -3037,14 +3039,6 @@ ...@@ -3037,14 +3039,6 @@
"integrity": "sha1-/q7SVZc9LndVW4PbwIhRpsY1IPo=", "integrity": "sha1-/q7SVZc9LndVW4PbwIhRpsY1IPo=",
"dev": true "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": { "cacache": {
"version": "13.0.1", "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", "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 @@ ...@@ -3071,28 +3065,6 @@
"unique-filename": "^1.1.1" "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": { "css-loader": {
"version": "3.6.0", "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", "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 @@ ...@@ -3187,15 +3159,11 @@
"slash": "^2.0.0" "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": { "hash-sum": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npm.taobao.org/hash-sum/download/hash-sum-2.0.0.tgz", "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": { "human-signals": {
"version": "1.1.1", "version": "1.1.1",
...@@ -3355,14 +3323,6 @@ ...@@ -3355,14 +3323,6 @@
"minipass": "^3.1.1" "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": { "terser-webpack-plugin": {
"version": "2.3.8", "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", "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 @@ ...@@ -3381,24 +3341,23 @@
} }
}, },
"vue-loader": { "vue-loader": {
"version": "16.3.0", "version": "15.9.8",
"resolved": "https://repo.huaweicloud.com/repository/npm/vue-loader/-/vue-loader-16.3.0.tgz", "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-15.9.8.tgz",
"integrity": "sha512-UDgni/tUVSdwHuQo+vuBmEgamWx88SuSlEb5fgdvHrlJSPB9qMBRF6W7bfPWSqDns425Gt1wxAUif+f+h/rWjg==", "integrity": "sha512-GwSkxPrihfLR69/dSV3+5CdMQ0D+jXg8Ma1S4nQXKJAznYFX14vHdc/NetQc34Dw+rBbIJyP7JOuVb9Fhprvog==",
"dev": true,
"requires": { "requires": {
"chalk": "^4.1.0", "@vue/component-compiler-utils": "^3.1.0",
"hash-sum": "^2.0.0", "hash-sum": "^1.0.2",
"loader-utils": "^2.0.0" "loader-utils": "^1.1.0",
"vue-hot-reload-api": "^2.3.0",
"vue-style-loader": "^4.1.0"
}, },
"dependencies": { "dependencies": {
"loader-utils": { "hash-sum": {
"version": "2.0.0", "version": "1.0.2",
"resolved": "https://repo.huaweicloud.com/repository/npm/loader-utils/-/loader-utils-2.0.0.tgz", "resolved": "https://registry.npmjs.org/hash-sum/-/hash-sum-1.0.2.tgz",
"integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==", "integrity": "sha1-M7QHd3VMZDJXPBIMw4CLvRDUfwQ=",
"requires": { "dev": true
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
"json5": "^2.1.2"
}
} }
} }
} }
...@@ -16421,6 +16380,94 @@ ...@@ -16421,6 +16380,94 @@
"vue-style-loader": "^4.1.0" "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": { "vue-style-loader": {
"version": "4.1.3", "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", "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",
......
...@@ -4,6 +4,8 @@ import { AnalysysAgent } from "@/utils/analysys_paas.js"; ...@@ -4,6 +4,8 @@ import { AnalysysAgent } from "@/utils/analysys_paas.js";
import util from "@/utils/util.js"; import util from "@/utils/util.js";
import login from "@/utils/login.js"; import login from "@/utils/login.js";
import upload from '@/components/upload/task.js' import upload from '@/components/upload/task.js'
import { ERROR } from "@/common/log.js"
export default { export default {
globalData: { globalData: {
// 开发环境 // 开发环境
...@@ -74,8 +76,6 @@ export default { ...@@ -74,8 +76,6 @@ export default {
this.getSystemInfo(); this.getSystemInfo();
// 系统自动登录::每次运行小程序重新获取用户信息 // 系统自动登录::每次运行小程序重新获取用户信息
await this.autoLogin(); await this.autoLogin();
//this.deleteTempImg()
}, },
onShow: function () { onShow: function () {
// 应用启动,或从后台进入前台显示 // 应用启动,或从后台进入前台显示
...@@ -85,6 +85,9 @@ export default { ...@@ -85,6 +85,9 @@ export default {
}, },
onHide: function () { onHide: function () {
// 应用从前台进入后台 // 应用从前台进入后台
// if (this.uploadTask.length > 0) {
// ERROR('onUnload', {task: this.uploadTask.length, mobile: this.vuex_user.mobile})
// }
}, },
watch: { watch: {
uploadTask: function(newValue, oldValue) { uploadTask: function(newValue, oldValue) {
...@@ -92,18 +95,6 @@ export default { ...@@ -92,18 +95,6 @@ export default {
} }
}, },
methods: { methods: {
// 处理已上传完成的图片
deleteTempImg() {
const result = uni.getStorageSync('delImg')
if (result.length > 0) {
for (let i of result) {
uni.removeSavedFile({
filePath: i
})
}
uni.setStorageSync('delImg', [])
}
},
getSystemInfo() { getSystemInfo() {
try { try {
let a = this.$u.sys(); let a = this.$u.sys();
......
...@@ -14,11 +14,22 @@ let orderApiFun = function(vm){ ...@@ -14,11 +14,22 @@ let orderApiFun = function(vm){
* 工单数量查询接口 * 工单数量查询接口
*/ */
let listOrderCount = async (params = {}) => await vm.$u.get(prefix + vm.vuex_token + '/wokerOrder/queryOrdersCount/V2', params); 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 + vm.vuex_token + '/wokerOrder/countOrderByTimeRange', params);
/**
* 根据订单id数组获取订单列表
*/
let listOrderByIds = async (string) => await vm.$u.get('/wxh-worker-rest/rest/order/revision/listOrderByIds' + string);
/** /**
* 工单列表接口 * 工单列表接口
*/ */
let listOrder = async (params = {}) => await vm.$u.get('/wxh-worker-rest/rest/order/revision/' + vm.vuex_token + '/list', 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);
/** /**
* 获取师傅的预约日历 * 获取师傅的预约日历
...@@ -172,6 +183,8 @@ let orderApiFun = function(vm){ ...@@ -172,6 +183,8 @@ let orderApiFun = function(vm){
let listStatementDetails = async (params = {}) => await vm.$u.get(settle + vm.vuex_token + '/queryStatementByPayableNo', params); let listStatementDetails = async (params = {}) => await vm.$u.get(settle + vm.vuex_token + '/queryStatementByPayableNo', params);
// 获取我的钱包-支付单一览 // 获取我的钱包-支付单一览
let payableRecord = async (params = {}) => await vm.$u.post(settle + vm.vuex_token + '/payable/v2/queryPayableRecord', params, formType); let payableRecord = async (params = {}) => await vm.$u.post(settle + vm.vuex_token + '/payable/v2/queryPayableRecord', params, formType);
// 获取我的钱包-支付单一览版本3
let listPayableRecordByPayTime = async (params = {}) => await vm.$u.post(settle + vm.vuex_token + '/payable/listPayableRecordByPayTime', params, formType);
// 获取我的钱包-师傅提现 // 获取我的钱包-师傅提现
let workerApplyPay = async () => await vm.$u.get(prefix + vm.vuex_token + '/applypay/batch/workerApplyPay'); let workerApplyPay = async () => await vm.$u.get(prefix + vm.vuex_token + '/applypay/batch/workerApplyPay');
// 是否有特殊登录权限 // 是否有特殊登录权限
...@@ -200,10 +213,16 @@ let orderApiFun = function(vm){ ...@@ -200,10 +213,16 @@ let orderApiFun = function(vm){
let cancelParts = async (partOrderId) => await vm.$u.put(prefix + 'parts/' + vm.vuex_token + '/orders/'+ partOrderId +'/cancel',{}, formType); 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 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 = { const orderApi = {
listByRecommendOrder, listByRecommendOrder,
listOrderCount, listOrderCount,
manageOrderCount,
listOrderByIds,
listOrder, listOrder,
manageOrderList,
workerCalendar, workerCalendar,
workerAppointment, workerAppointment,
maintainWorkerCheckin, maintainWorkerCheckin,
...@@ -237,6 +256,7 @@ let orderApiFun = function(vm){ ...@@ -237,6 +256,7 @@ let orderApiFun = function(vm){
getAssets, getAssets,
listStatement, listStatement,
payableRecord, payableRecord,
listPayableRecordByPayTime,
listStatementDetails, listStatementDetails,
workerApplyPay, workerApplyPay,
allowLogin, allowLogin,
...@@ -252,7 +272,8 @@ let orderApiFun = function(vm){ ...@@ -252,7 +272,8 @@ let orderApiFun = function(vm){
getOrderPartsSum, getOrderPartsSum,
receiveParts, receiveParts,
cancelParts, cancelParts,
workerDealWithError workerDealWithError,
association
} }
return orderApi return orderApi
} }
......
...@@ -51,7 +51,7 @@ const install = (Vue, vm) => { ...@@ -51,7 +51,7 @@ const install = (Vue, vm) => {
config.header['Authorization'] = token config.header['Authorization'] = token
} }
// config.header.token = vm.vuex_token || 'RTOKENe56f873b5823477fa2e15572f8fa7eb3a5fb6f7b'; config.header['token'] = token;
config.header['x-requested-with'] = 'xmlhttprequest'; config.header['x-requested-with'] = 'xmlhttprequest';
return config; return config;
} }
...@@ -76,6 +76,9 @@ const install = (Vue, vm) => { ...@@ -76,6 +76,9 @@ const install = (Vue, vm) => {
function getMsg(res){ function getMsg(res){
const result = res.data || res const result = res.data || res
let msg = result.message || result.errMsg || res.message || res.errMsg let msg = result.message || result.errMsg || res.message || res.errMsg
if (msg.indexOf('request:fail') !== -1) {
msg = '当前网络较差,请重试'
}
if(res.code == 200 || res.status == true || msg) { if(res.code == 200 || res.status == true || msg) {
return msg return msg
} }
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
@click.stop="prviewImage(item, index)" @click.stop="prviewImage(item, index)"
fade fade
lazy-load lazy-load
></u-image> ><view slot="error" style="font-size: 24rpx;">上传中</view></u-image>
<view <view
class="icon-del-box" class="icon-del-box"
v-if="!disabled" v-if="!disabled"
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
</view> </view>
<view class="right-view"> <view class="right-view">
<view :class="['settlement-status-view', settlementTypeClass]">{{data.payableRecordStatusText}}</view> <view :class="['settlement-status-view', settlementTypeClass]">{{data.payableRecordStatusText}}</view>
<view class="settlement-amount-view">¥{{data.settlementAmount}}</view> <view class="settlement-amount-view">¥{{ data.paidAmount || 0}}</view>
</view> </view>
</view> </view>
<view class="line-view"></view> <view class="line-view"></view>
...@@ -24,11 +24,11 @@ ...@@ -24,11 +24,11 @@
type: Object, type: Object,
default () { default () {
return { return {
paymentTime: new Date().getTime(),
payableRecordStatusText: '提现',
payableRecordNumber: 'EE999777',
payableRecordId: '', payableRecordId: '',
settlementAmount: 9899 paidTime: new Date().getTime(),
payableRecordStatusText: '提现',
payableRecordNumber: '',
paidAmount: 0
} }
}, },
} }
...@@ -56,13 +56,13 @@ ...@@ -56,13 +56,13 @@
timeText() { timeText() {
let now = this.moment().startOf('day').unix() let now = this.moment().startOf('day').unix()
let yesterday = this.moment(now*1000).subtract(1, 'days').unix() let yesterday = this.moment(now*1000).subtract(1, 'days').unix()
let date = this.moment(this.data.updateDatetime).startOf('day').unix() let date = this.moment(this.data.paidTime).startOf('day').unix()
if(date == now) { if(date == now) {
return '今天' return '今天'
} else if(date == yesterday) { } else if(date == yesterday) {
return '昨天' return '昨天'
} else { } else {
return this.$u.timeFormat(this.data.updateDatetime, 'mm.dd') return this.$u.timeFormat(this.data.paidTime, 'mm.dd')
} }
} }
}, },
...@@ -113,11 +113,12 @@ ...@@ -113,11 +113,12 @@
border: 2rpx solid #FF930D; border: 2rpx solid #FF930D;
font-size: 20rpx; font-size: 20rpx;
color: #FF930D; color: #FF930D;
width: 80rpx; min-width: 80rpx;
height: 40rpx; height: 40rpx;
text-align: center; text-align: center;
padding-top: 4rpx;
margin-right: 10rpx; margin-right: 10rpx;
line-height: 40rpx;
padding: 0 10rpx;
&.settlement-type-y { &.settlement-type-y {
border: 2rpx solid #FF930D; border: 2rpx solid #FF930D;
......
...@@ -77,15 +77,15 @@ ...@@ -77,15 +77,15 @@
return this.$u.timeFormat(this.data.updateDatetime, 'mm.dd') return this.$u.timeFormat(this.data.updateDatetime, 'mm.dd')
} }
} }
}, },
methods:{ methods:{
handleClick() { handleClick() {
if(this.data.status == '已确认') { if(this.data.status == '已确认') {
this.$emit('click', this.data.orderId) this.$emit('click', this.data.orderId)
} else { } else {
this.$u.toast('需等系统确认该订单,才可查看订单详情') this.$u.toast('需等系统确认该订单,才可查看订单详情')
} }
} }
} }
} }
</script> </script>
...@@ -130,10 +130,11 @@ ...@@ -130,10 +130,11 @@
border: 2rpx solid #FF930D; border: 2rpx solid #FF930D;
font-size: 20rpx; font-size: 20rpx;
color: #FF930D; color: #FF930D;
width: 80rpx; min-width: 80rpx;
height: 40rpx; height: 40rpx;
text-align: center; text-align: center;
padding-top: 4rpx; line-height: 40rpx;
padding: 0 10rpx;
&.statement-type-y { &.statement-type-y {
border: 2rpx solid #FF930D; border: 2rpx solid #FF930D;
...@@ -163,4 +164,4 @@ ...@@ -163,4 +164,4 @@
margin: 0 30rpx; margin: 0 30rpx;
} }
} }
</style> </style>
<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> <template>
<view class="order-view" @click="handleClickCell"> <view
<view class="order-top-view"> :class="['order-view', { simple: isSimple }]"
@click="handleClickCell"
:hover-class="isSimple ? 'u-hover-class' : ''"
>
<view v-if="!isSimple" class="order-top-view">
<view class="left-view"> <view class="left-view">
<view :class="['tag-view', { active: active }]"> <view :class="['tag-view', { active: active }]">
{{ orderData.orderServiceType }} {{ orderData.orderServiceType }}
...@@ -10,15 +14,28 @@ ...@@ -10,15 +14,28 @@
<view class="right-view">{{ orderData.orderBusinessTypeText }}</view> <view class="right-view">{{ orderData.orderBusinessTypeText }}</view>
</view> </view>
<view class="content-view"> <view class="content-view">
<view class="info-view" v-for="(item, key) in infoTexts" :key="key"> <view
<view class="info-title"> class="info-view"
<text>{{ item.name + ':' }}</text> 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>
<view class="info-content"> <view v-if="item.icon">
<text @longpress="handleLongpress(key, orderData[key])">{{ <u-icon :name="item.icon"></u-icon>
orderData[key]
}}</text>
<text v-if="item.content">{{ ' / ' + orderData[item.content] }}</text>
</view> </view>
</view> </view>
<view class="address-view"> <view class="address-view">
...@@ -35,53 +52,54 @@ ...@@ -35,53 +52,54 @@
</view> </view>
</view> </view>
</view> </view>
<template v-if="!isSimple">
<view class="line-view"></view> <view class="line-view"></view>
<view class="reason-view" v-if="showReason"> <view class="reason-view" v-if="showReason">
<view class="reason-title"><text>未通过原因:</text></view> <view class="reason-title"><text>未通过原因:</text></view>
<view class="reason-text" <view class="reason-text">
> <text
<text v-for="(item, index) in orderData.partAuditResults" :key="index">{{ v-for="(item, index) in orderData.partAuditResults"
item :key="index"
}}</text> >{{ item }}</text
<text v-for="(item, index) in orderData.auditResults" :key="index">{{
item
}}</text>
</view
>
</view>
<view class="bottom-view">
<view>
<view v-if="showCountTime" class="bottom-left-view">
<view :class="['bottom-tag-view', { timeout: timeout }]"
><text>{{ tagText }}</text></view
> >
<u-count-down <text v-for="(item, index) in orderData.auditResults" :key="index">{{
:timestamp="timestamp" item
font-size="40" }}</text>
show-days
separator="zh"
:color="timeout ? '#FA5A49' : '#FF930D'"
@change="handleChange"
separator-color="#666666"
ref="order-count-down"
></u-count-down>
</view> </view>
<view v-else-if="showTime"> </view>
<text>{{ timeTitle }}</text> <view class="bottom-view">
<text>{{ timeText }}</text> <view>
<view v-if="showCountTime" class="bottom-left-view">
<view :class="['bottom-tag-view', { timeout: timeout }]"
><text>{{ tagText }}</text></view
>
<u-count-down
:timestamp="timestamp"
font-size="40"
show-days
separator="zh"
:color="timeout ? '#FA5A49' : '#FF930D'"
@change="handleChange"
separator-color="#666666"
ref="order-count-down"
></u-count-down>
</view>
<view v-else-if="showTime">
<text>{{ timeTitle }}</text>
<text>{{ timeText }}</text>
</view>
</view> </view>
<u-button
class="right-btn"
@click.stop="handleClick"
:custom-style="buttonStyle"
type="primary"
shape="circle"
>
{{ orderText }}
</u-button>
</view> </view>
<u-button </template>
class="right-btn"
@click.stop="handleClick"
:custom-style="buttonStyle"
type="primary"
shape="circle"
>
{{ orderText }}
</u-button>
</view>
</view> </view>
</template> </template>
...@@ -130,6 +148,11 @@ export default { ...@@ -130,6 +148,11 @@ export default {
return [116.3896, 39.91917] // 纬度,经度 return [116.3896, 39.91917] // 纬度,经度
}, },
}, },
// simple: 只显示订单号、联系人/电话、地址,点击cell相当于点击订单列表的按钮; normal: 显示全部信息
model: {
type: String,
default: 'normal',
},
}, },
data() { data() {
return { return {
...@@ -142,6 +165,9 @@ export default { ...@@ -142,6 +165,9 @@ export default {
// 按钮文字 // 按钮文字
return this.typeTexts[this.orderType] return this.typeTexts[this.orderType]
}, },
isSimple() {
return this.model == 'simple'
},
buttonStyle() { buttonStyle() {
// 按钮样式 // 按钮样式
/** orderType /** orderType
...@@ -181,11 +207,21 @@ export default { ...@@ -181,11 +207,21 @@ export default {
return [4, 5, 6].indexOf(this.orderType) != -1 return [4, 5, 6].indexOf(this.orderType) != -1
}, },
infoTexts() { infoTexts() {
return { return this.isSimple
orderNumber: { name: '工单编号' }, ? {
partnerCompanyName: { name: '合作厂商' }, orderNumber: {
contactName: { name: '客户信息', content: 'contactPhone' }, 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() { typeTexts() {
return [ return [
...@@ -257,6 +293,7 @@ export default { ...@@ -257,6 +293,7 @@ export default {
}, },
showDistance() { showDistance() {
return ( return (
!this.isSimple &&
this.orderType == 0 && this.orderType == 0 &&
this.location.length >= 2 && this.location.length >= 2 &&
(this.orderData.contactAddressLatitud || (this.orderData.contactAddressLatitud ||
...@@ -280,6 +317,34 @@ export default { ...@@ -280,6 +317,34 @@ export default {
finish: 6, //已完工 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)
: []
return auditResults.concat(partAuditResults)
},
orderDistance() { orderDistance() {
return this.distance( return this.distance(
this.orderData.contactAddressLatitud, this.orderData.contactAddressLatitud,
...@@ -300,15 +365,18 @@ export default { ...@@ -300,15 +365,18 @@ export default {
orderType() { orderType() {
/* /*
orderStatus: orderStatus:
待接单 orderStatus<31 工单状态小于31 待接单 orderStatus<31 工单状态小于31
待预约 orderStatus == 31 and appointmentDatetime == null 工单状态等于30并且预约时间为空 待预约 orderStatus == 31 and appointmentDatetime == null 工单状态等于30并且预约时间为空
待签到 orderStatus == 31 and appointmentDatetime is not null 工单状态等于30并且预约时间不为空 待签到 orderStatus == 31 and appointmentDatetime is not null 工单状态等于30并且预约时间不为空
待完工 orderStatus >31 and orderStatus < 80 工单状态大于31 小于80 待完工 orderStatus >31 and orderStatus < 80 工单状态大于31 小于80
审核中 orderStatus ==83 or orderStatus == 87 or orderStatus == 88 工单状态 等于85 或者 等于87 或者 等于88 审核中 orderStatus ==83 or orderStatus == 87 or orderStatus == 88 工单状态 等于83 或者 等于85 或者 等于87 或者 等于88
异常 orderStatus ==86 工单状态 等于86 异常 orderStatus ==86 工单状态 等于86
已完工 orderStatus in(80,81,89,110) 工单状态 等于80 or 81 or 89 or 110 已完工 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) { if (this.orderData.orderStatus < 31) {
return 0 return 0
} else if (this.orderData.orderStatus == 31) { } else if (this.orderData.orderStatus == 31) {
...@@ -338,8 +406,6 @@ export default { ...@@ -338,8 +406,6 @@ export default {
} else { } else {
return 0 return 0
} }
} else {
return this.types[this.type]
} }
}, },
}, },
...@@ -366,26 +432,60 @@ export default { ...@@ -366,26 +432,60 @@ export default {
if ([3, 4, 5, 6].indexOf(this.orderType) != -1) { if ([3, 4, 5, 6].indexOf(this.orderType) != -1) {
func = 'action' func = 'action'
} }
this.orderData.auditResults = this.auditResults
this.$emit( this.$emit(
func, func,
this.orderData, this.orderData,
this.type, this.realType,
this.showCountTime ? 'show' : '' this.showCountTime ? 'show' : '',
this.auditResults
) )
this.otherAction()
}, },
handleClickCell() { handleClickCell() {
if (this.isSimple) {
this.handleClick()
return
}
var func = 'click' var func = 'click'
this.handleExceptions() this.handleExceptions()
if (this.isException) { if (this.isException) {
// 异常单点cell算点按钮 // 异常单点cell算点按钮
func = 'action' func = 'action'
} }
this.orderData.auditResults = this.auditResults
this.$emit( this.$emit(
func, func,
this.orderData, this.orderData,
this.type, this.realType,
this.showCountTime ? 'show' : '' this.showCountTime ? 'show' : '',
this.auditResults
) )
this.otherAction()
},
// 如果是异常单告诉后台
// 更新最近5条查看记录
otherAction() {
this.exceptionRecord()
this.storeOparation()
},
exceptionRecord() {
// 如果是异常单告诉后台
if (this.realType == 'exception') {
this.$u.api.workerDealWithError(this.orderData.orderId).then(() => {})
}
},
storeOparation() {
// 更新最近5条查看记录
if (!this.isSimple) {
var array = (this.vuex_last_five_orders || []).filter((id) => {
// 如果记录中有该工单,删除
return id != this.orderData.orderId
})
array.unshift(this.orderData.orderId)
this.$u.vuex('vuex_last_five_orders', array.slice(0, 5))
}
}, },
handleChange(timestamp) { handleChange(timestamp) {
if (this.timeout) this.$refs['order-count-down'].seconds += 2 if (this.timeout) this.$refs['order-count-down'].seconds += 2
...@@ -464,12 +564,19 @@ export default { ...@@ -464,12 +564,19 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.order-view { .order-view {
width: 100%; // width: 100%;
background-color: #ffffff; background-color: #ffffff;
border-radius: 12rpx; border-radius: 12rpx;
padding: 30rpx; padding: 30rpx;
margin-bottom: 20rpx; 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 { .order-top-view {
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -522,13 +629,26 @@ export default { ...@@ -522,13 +629,26 @@ export default {
margin-top: 18rpx; margin-top: 18rpx;
margin-bottom: 18rpx; margin-bottom: 18rpx;
display: flex; display: flex;
align-items: flex-start; justify-content: space-between;
align-items: center;
.info-title { .info-left-view {
flex-shrink: 0; display: flex;
} justify-content: flex-start;
.info-content { align-items: center;
word-break: break-all; .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;
}
} }
} }
......
<template> <template>
<!-- 申请物料按钮 --> <!-- 申请配件按钮 -->
<view class="apply-button"> <view class="apply-button" v-show="show">
<u-button :custom-style="customStyle" shape="circle" @click.stop="handleClick" type="primary"> <u-button
<u-icon class="apply-icon" name="plus"></u-icon> :custom-style="customStyle"
<text class="apply-text" v-if="showText">申请物料</text> shape="circle"
</u-button> @click.stop="handleClick"
</view> 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> </template>
<script> <script>
export default { export default {
props: { props: {
type: { // 按钮宽'collapse': '80rpx', 'expand': '220rpx' type: {
type: String, // 按钮宽'collapse': '80rpx', 'expand': '220rpx'
default: 'expand' type: String,
} default: 'expand',
}, },
computed: { text: {
typeWidth() { type: String,
return { default: '申请备件',
'collapse': '80rpx', },
'expand': '220rpx' icon: {
} type: String,
}, default: 'plus',
showText() { },
return this.type == 'expand' show: {
}, type: Boolean,
customStyle() { default: true,
return { },
'height': '80rpx', clickedType: {
'width': this.typeWidth[this.type], // normal 点击之后不隐藏; hidden 点击之后隐藏
} type: String,
} default: 'normal',
}, },
created() { loading: {
setTimeout(()=> { type: Boolean,
this.$emit('update:type', 'collapse') default: false,
}, 3000) },
}, },
methods: { computed: {
handleClick() { typeWidth() {
this.$emit('click') 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> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.apply-button { .apply-button {
.apply-icon { .button-view {
font-size: 36rpx; display: flex;
} justify-content: flex-end;
.apply-text { align-items: center;
font-size: 32rpx; .apply-icon {
padding-left: 10rpx; font-size: 36rpx;
} }
} .apply-text {
font-size: 32rpx;
padding-left: 10rpx;
}
.image-icon {
width: 30rpx;
height: 34rpx;
}
}
}
</style> </style>
...@@ -79,7 +79,8 @@ ...@@ -79,7 +79,8 @@
console.log('success'); console.log('success');
} }
}) })
} },
handleClick(){}
} }
} }
</script> </script>
......
<template>
<view class="upload-progress">
<view :class="['u-flex', 'suspension', {'error': uploadStatus === 3}]" @click="openpRrogress">
<view class="progress" v-if="taskCount > 0">{{ uploadPercentage }}%</view>
<view class="upload-img" v-if="taskCount === 0">
<image class="icon" :src="icon"></image>
</view>
</view>
<u-popup
v-model="open"
border-radius="12"
mode="center"
:animation="false"
@close="closePopup"
width="690rpx">
<view class="slot-content">
<view class="upload-title">
<text class='status-txt'>图片上传进度</text>
</view>
<view v-if="taskCount > 0">
<view class="progress-circle">
<u-loading class="loading" v-if="!progressStatus" mode="circle"></u-loading>
<u-circle-progress v-if="progressStatus" :width="320" :border-width="20" inactive-color="#F4F5F7" :active-color="progressColor" :percent="uploadPercentage">
<view :class="['u-progress-content', {'error': uploadStatus === 3}]"> {{ uploadPercentage }}%</view>
</u-circle-progress>
</view>
<view class="u-flex upload-data">
<view class="u-flex">
<view class="title">需上传</view>
<view class="pending">{{ taskCount }}</view>
</view>
<view class="u-flex">
<view class="title">已上传</view>
<view class="resolve">{{ uploadSuccess }}</view>
</view>
<view class="u-flex">
<view class="title">状态</view>
<view :class="['status', {'error': uploadStatus === 3}]">{{ uploadStatusName }}</view>
</view>
</view>
<view class="upload-bottom" v-if="uploadStatus === 3">
<view class="button confirm" @click="$u.throttle(retry, 500)">重试</view>
</view>
</view>
<view class="u-flex default" v-if="taskCount === 0">
<view><image class="default-img" :src="defaultImg"></image></view>
<view class="text">当前暂无上传图片</view>
</view>
</view>
</u-popup>
</view>
</template>
<script>
/**
* upload-progress 图片上传进度
*/
import upload from '@/components/upload/task.js'
export default {
name:"upload-progress",
data() {
return {
open: false,
progressStatus: false
}
},
computed: {
icon() {
return process.uniEnv.qn_base_url + 'upload-photo.png'
},
defaultImg() {
return process.uniEnv.qn_base_url + 'upload-default.png'
},
taskCount() {
return this.uploadTotal
},
uploadStatusName() {
let status
switch (this.uploadStatus) {
case 1:
status = '等待上传'
break;
case 2:
status = '上传中'
break;
case 3:
status = '上传中断'
break;
}
return status
},
progressColor() {
return this.uploadStatus === 3 ? '#FA5A49' : '#2272FF'
},
uploadPercentage() {
const num = this.uploadSuccess
const total = this.uploadTotal
return total > 0 ? Math.floor(Math.round(num / total * 10000) / 100.00) : 0
}
},
watch: {
uploadStatus(newValue) {
this.progressStatus = false
this.$nextTick(() => {
this.progressStatus = true
})
}
},
methods: {
closePopup() {
this.progressStatus = false
},
openpRrogress() {
this.open = true
this.progressStatus = false
setTimeout(() => {
this.progressStatus = true
}, 300)
},
retry() {
if(this.uploadStatus !== 2) upload.uploadImageTask(this)
}
}
}
</script>
<style lang="scss">
.upload-progress {
width: 100%;
height: 100%;
.suspension {
position: fixed;
right: 5%;
bottom: 20%;
width: 80rpx;
height: 80rpx;
border-radius: 50%;
background: #2272FF;
z-index: 999;
&.error {
background: #FA5A49;
}
.progress {
font-size: 24rpx;
color: #fff;
width: 100%;
text-align: center;
}
.upload-img {
width: 100%;
text-align: center;
padding-top: 8rpx;
.icon {
width: 36rpx;
height: 32rpx;
}
}
}
.slot-content {
padding: 40rpx 30rpx 30rpx 30rpx;
.upload-title {
margin: 20rpx 0 50rpx 0;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.status-txt {
height: 46rpx;
font-size: 40rpx;
font-weight: bold;
color: #333;
line-height: 46rpx;
}
}
.progress-circle {
width: 100%;
height: 320rpx;
text-align: center;
.loading {
line-height: 320rpx;
}
.u-progress-content {
color: #2272FF;
font-size: 60rpx;
&.error {
color: #FA5A49;
}
}
}
.upload-data {
margin: 50rpx 0 30rpx 0;
.u-flex {
flex-flow: column;
font-size: 48rpx;
width: 210rpx;
height: 120rpx;
.title {
color: #666;
font-size: 28rpx;
padding-bottom: 20rpx;
}
.pending {
color: #333;
}
.resolve {
color: #2272FF;
}
.status {
color: #2272FF;
font-size: 36rpx;
&.error {
color: #FA5A49;
}
}
}
}
.upload-bottom {
display: flex;
justify-content: center;
align-items: center;
.button {
text-align: center;
height: 104rpx;
width: 300rpx;
border-radius: 52rpx;
font-size: 32rpx;
font-weight: 600;
line-height: 104rpx;
}
.confirm {
margin: 36rpx 30rpx 52rpx 15rpx;
background: #2272FF;
color: #FFFFFF;
}
}
.default {
flex-flow: column;
margin: 150rpx 0;
.default-img {
width: 360rpx;
height: 240rpx;
}
.text {
color: #666;
font-size: 28rpx;
margin-top: 50rpx;
}
}
}
}
</style>
...@@ -69,14 +69,14 @@ export default { ...@@ -69,14 +69,14 @@ export default {
...order ...order
} }
}) })
// for (let i = 0; i < files.length; i++) {
// const path = files[i]
// const row = await this.saveFiles(path)
// lists.push(row)
// }
const data = JSON.parse(JSON.stringify(this.uploadTask)) const data = JSON.parse(JSON.stringify(this.uploadTask))
const saveLists = data.concat(lists) const saveLists = data.concat(lists)
this.$u.vuex('uploadTask', saveLists) this.$u.vuex('uploadTask', saveLists)
const newTotal = this.uploadTotal + lists.length
this.$u.vuex('uploadTotal', newTotal)
//this.$u.vuex('uploadSuccess', 0)
return lists return lists
}, },
/** /**
......
...@@ -19,10 +19,13 @@ export default { ...@@ -19,10 +19,13 @@ export default {
* 执行任务队列 * 执行任务队列
*/ */
async uploadImageTask(that) { async uploadImageTask(that) {
if (that.uploadStatus === 2) return
that.$u.vuex('uploadStatus', 2)
const uploadTask = JSON.parse(JSON.stringify(that.uploadTask)).reverse() const uploadTask = JSON.parse(JSON.stringify(that.uploadTask)).reverse()
const networkType = await getNetworkType() const networkType = await getNetworkType()
const options = { const options = {
files: uploadTask, // 必填 临时文件路径 格式: [{path: "图片地址"}] files: uploadTask.slice(0,5), // 必填 临时文件路径 格式: [{path: "图片地址"}]
load: false, //(默认 true 说明:本接口是否提示加载动画) load: false, //(默认 true 说明:本接口是否提示加载动画)
onEachUpdate: res => { onEachUpdate: res => {
console.log("上传成功返回:",res); console.log("上传成功返回:",res);
...@@ -41,10 +44,12 @@ export default { ...@@ -41,10 +44,12 @@ export default {
} }
uploader.qnFileUpload(options).then(res => { uploader.qnFileUpload(options).then(res => {
const newSuccess = that.uploadSuccess + res.length
that.$u.vuex('uploadSuccess', newSuccess)
this.refreshTask(that, res) this.refreshTask(that, res)
}).catch(err => { }).catch(err => {
console.log("err", err) console.log("err", err)
that.$u.vuex('uploadStatus', 3)
err.mobile = that.vuex_user.mobile err.mobile = that.vuex_user.mobile
if(!err.key) err.files = uploadTask if(!err.key) err.files = uploadTask
if(!err.orderNumber) err.orderNumber = uploadTask[0].orderNumber if(!err.orderNumber) err.orderNumber = uploadTask[0].orderNumber
...@@ -54,6 +59,7 @@ export default { ...@@ -54,6 +59,7 @@ export default {
if (err.errMsg && (err.errMsg.indexOf('fail file not found') !== -1 || err.errMsg.indexOf('file doesn') !== -1)) { // 在任务中删除不存在的图片 if (err.errMsg && (err.errMsg.indexOf('fail file not found') !== -1 || err.errMsg.indexOf('file doesn') !== -1)) { // 在任务中删除不存在的图片
const newTask = uploadTask.filter(v => v.key !== err.key) const newTask = uploadTask.filter(v => v.key !== err.key)
that.$u.vuex('uploadTask', newTask) that.$u.vuex('uploadTask', newTask)
this.resetProgress(that)
} }
}) })
}, },
...@@ -66,7 +72,16 @@ export default { ...@@ -66,7 +72,16 @@ export default {
} }
}) })
// uni.setStorageSync('delImg', delImg) // 已上传完的图片,会在启动系统的时候做一次清理 that.$u.vuex('uploadStatus', 1)
that.$u.vuex('uploadTask', newTask) that.$u.vuex('uploadTask', newTask)
this.resetProgress(that)
},
// 重置任务状态
resetProgress(that) {
if (that.uploadTask.length === 0) { // 上传完本地所有照片
that.$u.vuex('uploadSuccess', 0)
that.$u.vuex('uploadTotal', 0)
that.$u.vuex('uploadStatus', 1)
}
} }
} }
import Vue from 'vue' import Vue from 'vue'
import moment from 'moment' import moment from 'moment'
import App from './App' import App from './App'
import uView from "uview-ui"; import uView from "uview-ui";
...@@ -8,24 +8,24 @@ import {router,RouterMount} from '@/router/index.js' //路径换成自己的 ...@@ -8,24 +8,24 @@ import {router,RouterMount} from '@/router/index.js' //路径换成自己的
Vue.config.productionTip = false Vue.config.productionTip = false
Vue.mixin(vuexStore) Vue.mixin(vuexStore)
Vue.use(uView); Vue.use(uView);
App.mpType = 'app' App.mpType = 'app'
const app = new Vue({ const app = new Vue({
store, store,
...App ...App
}) })
// 引入时间组件 moment // 引入时间组件 moment
moment.locale('zh-cn'); moment.locale('zh-cn');
Vue.prototype.moment = moment Vue.prototype.moment = moment
Vue.filter('datefmt',function (input,fmtstring) {//当input为时间戳,需转为Number类型 Vue.filter('datefmt',function (input,fmtstring) {//当input为时间戳,需转为Number类型
if(input){ if(input){
return moment(input).format(fmtstring); return moment(input).format(fmtstring);
}else{ }else{
return ""; return "";
} }
}); });
// http拦截器,将此部分放在new Vue()和app.$mount()之间,才能App.vue中正常使用 // http拦截器,将此部分放在new Vue()和app.$mount()之间,才能App.vue中正常使用
import httpInterceptor from '@/common/http.interceptor.js' import httpInterceptor from '@/common/http.interceptor.js'
...@@ -33,9 +33,9 @@ Vue.use(httpInterceptor, app) ...@@ -33,9 +33,9 @@ Vue.use(httpInterceptor, app)
Vue.use(router) Vue.use(router)
// http接口API抽离,免于写url或者一些固定的参数 // http接口API抽离,免于写url或者一些固定的参数
import httpApi from '@/common/http.api.js' import httpApi from '@/common/http.api.js'
Vue.use(httpApi, app) Vue.use(httpApi, app)
// 分享 // 分享
let mpShare = require('@/uview-ui/libs/mixin/mpShare.js') let mpShare = require('@/uview-ui/libs/mixin/mpShare.js')
Vue.mixin(mpShare) Vue.mixin(mpShare)
//v1.3.5起 H5端 你应该去除原有的app.$mount();使用路由自带的渲染方式 //v1.3.5起 H5端 你应该去除原有的app.$mount();使用路由自带的渲染方式
......
...@@ -162,6 +162,46 @@ ...@@ -162,6 +162,46 @@
"disableScroll": true "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", "path": "wallet/index",
"style": { "style": {
......
<template> <template>
<TabBarPage title="扳手会" :fixed="true" @click="goTop"> <TabBarPage title="扳手会" :fixed="true" @click="goTop">
<view class="content-view"> <view class="content-view">
<scroll-view style="height: 100%;" scroll-y @scrolltolower="reachBottom" :scroll-top="scrollTop" @scroll="scroll" <scroll-view
scroll-anchoring scroll-y="true" refresher-enabled="true" :refresher-triggered="triggered" :refresher-threshold="100" style="height: 100%;"
refresher-background="#F4F5F7" @refresherrefresh="onRefresh" scroll-y
@refresherrestore="onRestore" enable-back-to-top> @scrolltolower="reachBottom"
<image class="banner-image" :src="bannerImage" @click="handleClickBanner"></image> :scroll-top="scrollTop"
@scroll="scroll"
<view class="msg-view"> scroll-anchoring
<view class="msg-title">最新消息</view> refresher-enabled="true"
<view class="msg-list-view"> :refresher-triggered="triggered"
<view class="msg-content" v-for="(item, index) in messageList" :key="index" @click="toNewsDetail(item)"> :refresher-threshold="100"
<view class="msg-content-view"> refresher-background="#F4F5F7"
<view class="left-view"> @refresherrefresh="onRefresh"
<image class="msg-icon" :src="msgStyleImage[item.is_top]"></image> @refresherrestore="onRestore"
<text class="msg-text">{{ item.title }}</text> enable-back-to-top
</view> >
<image class="right-icon" :src="shouyeyouImage"></image> <image
</view> class="banner-image"
<view class="line-view" v-if="index != 1"></view> :src="bannerImage"
</view> @click="handleClickBanner"
</view> ></image>
</view>
<view class="sticky"> <view class="msg-view">
<text>订单推荐</text> <view class="msg-title">最新消息</view>
</view> <view class="msg-list-view">
<view class="order-view"> <view
<!-- 入驻成功之后显示推荐订单列表 --> class="msg-content"
<view class="order-list-view" v-if="loaded"> v-for="(item, index) in messageList"
<!-- 入驻前--> :key="index"
<view v-if="needSettled" class="tip-view"> @click="toNewsDetail(item)"
<image :src="weiruzhuImage" class="tip-view-image"></image> >
<view class="tip-other">入驻后平台将向您分配或推荐订单</view> <view class="msg-content-view">
<u-button class="settle-button" type="primary" shape="circle" @click="immediatelyIn" <view class="left-view">
:custom-style="buttonStyle"> <image
立即入驻 class="msg-icon"
</u-button> :src="msgStyleImage[item.is_top]"
</view> ></image>
<template v-else> <text class="msg-text">{{ item.title }}</text>
<!-- 入驻成功之后无推荐订单 --> </view>
<view v-if="orderList.length <= 0 && loadedOrder" class="no-order-view"> <image class="right-icon" :src="shouyeyouImage"></image>
<NoOrder /> </view>
</view> <view class="line-view" v-if="index != 1"></view>
<view v-else class="order-item-view"> </view>
<view v-for="(item, index) in orderList" :key="index"> </view>
<OrderCell :orderData="item" type="waitAccept" :location="location" </view>
@click="handleClick" @action="handleClick"> <view class="sticky">
</OrderCell> <text>订单推荐</text>
</view> </view>
<u-loadmore v-show="(search.pageNumber == 1 && loadedOrder) || search.pageNumber > 1" :status="currentLoadStatus" bgColor="#F4F5F7"></u-loadmore> <view class="order-view">
</view> <!-- 入驻成功之后显示推荐订单列表 -->
</template> <view class="order-list-view" v-if="loaded">
</view> <!-- 入驻前-->
</view> <view v-if="needSettled" class="tip-view">
<view class="bottom-view" v-if="needSettled || orderList.length <= 0"> <image :src="weiruzhuImage" class="tip-view-image"></image>
<view class="bottom-line-view"></view> <view class="tip-other">入驻后平台将向您分配或推荐订单</view>
<view class="bottom-text">我也是有底线哒</view> <u-button
<view class="bottom-line-view"></view> class="settle-button"
</view> type="primary"
</scroll-view> shape="circle"
</view> @click="immediatelyIn"
</TabBarPage> :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-if="orderList.length > 0" 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>
<upload-progress />
</TabBarPage>
</template> </template>
<script> <script>
import util from "@/utils/util.js"; import TabBarPage from '@/components/tabBarList/index.vue'
import TabBarPage from "@/components/tabBarList/index.vue" import NoOrder from '@/components/order/noOrder.vue'
import NoOrder from "@/components/order/noOrder.vue" const app = getApp()
const app = getApp(); import OrderCell from '@/components/order/index.vue'
import OrderCell from "@/components/order/index.vue"; // import EusingList from '@/components/order/eusingList.vue'
export default { export default {
components: { components: {
OrderCell, OrderCell,
TabBarPage, TabBarPage,
NoOrder, NoOrder,
}, // EusingList,
data() { },
return { data() {
status: 0, // 入驻状态:0=>'待提交',1=>'待审核',2=>'已通过',3=>'备选',4=>'已驳回',6=>'已签约',7=>'已支付保证金',8=>'已通过考试',9=>'待提交' return {
location: [], // 经纬度 status: 0, // 入驻状态:0=>'待提交',1=>'待审核',2=>'已通过',3=>'备选',4=>'已驳回',6=>'已签约',7=>'已支付保证金',8=>'已通过考试',9=>'待提交'
title: false, location: [], // 经纬度
title: "Hello", title: false,
loaded: false, title: 'Hello',
loadedOrder: false, loaded: false,
needSettled: true, loadedOrder: false,
count: 0, // 推荐订单数量 needSettled: false,
messageList: [], count: 0, // 推荐订单数量
currentLoadStatus: "loading", messageList: [],
orderList: [], currentLoadStatus: 'loading',
search: { orderList: [],
token: "", search: {
pageNumber: 0, token: '',
pageSize: 100, pageNumber: 0,
}, pageSize: 15,
waitInit: false, // 当token为空时,等待自动登录结束 },
triggered: true, waitInit: false, // 当token为空时,等待自动登录结束
scrollTop: 0, triggered: true,
old: { scrollTop: 0,
scrollTop: 0 old: {
} scrollTop: 0,
}; },
}, }
watch: { },
vuex_token(val, oldVal) { watch: {
// 监听token变化,如果更新则重新加载页面数据 vuex_token(val, oldVal) {
val && this.waitInit && this.getData() // 监听token变化,如果更新则重新加载页面数据
} val && this.waitInit && this.getData()
}, },
computed: { },
buttonStyle() { computed: {
return { buttonStyle() {
width: "300rpx", return {
height: "80rpx", width: '300rpx',
"font-size": "32rpx", height: '80rpx',
"font-weight": "bold", 'font-size': '32rpx',
}; 'font-weight': 'bold',
}, }
msgStyleImage() { },
return { countKeys() {
'1': process.uniEnv.qn_base_url + "zhiding.png", // 置顶 return [
'0': process.uniEnv.qn_base_url + "tongzhi.png", // 通知 'toAppointmentCount',
// '3': process.uniEnv.qn_base_url + "xiaoxi.png", // 消息 'toCheckinCount',
} 'toFinishCount',
}, 'reviewingCount',
bannerImage() { 'exceptionCount',
return process.uniEnv.qn_base_url + 'banner-1.png' ]
}, },
shouyeyouImage() { msgStyleImage() {
return process.uniEnv.qn_base_url + 'shouyeyou.png' return {
}, '1': process.uniEnv.qn_base_url + 'zhiding.png', // 置顶
weiruzhuImage() { '0': process.uniEnv.qn_base_url + 'tongzhi.png', // 通知
return process.uniEnv.qn_base_url + 'weiruzhu.png' // '3': process.uniEnv.qn_base_url + "xiaoxi.png", // 消息
}, }
}, },
onLoad(e) { bannerImage() {
app.trackPage('自营平台首页') return process.uniEnv.qn_base_url + 'banner-1.png'
this._freshing = false; },
if(this.vuex_token) { shouyeyouImage() {
this.getOrderCount() return process.uniEnv.qn_base_url + 'shouyeyou.png'
} else { },
this.waitInit = true weiruzhuImage() {
} return process.uniEnv.qn_base_url + 'weiruzhu.png'
}, },
onShow() { },
// 每次进入页面都刷新入驻状态 onLoad(e) {
this.pageNumber = 0 app.trackPage('自营平台首页')
this._freshing = false
this.initSettleInfo(); if (this.vuex_token) {
}, this.getOrderCount()
methods: { } else {
getData() { this.waitInit = true
this.getOrderCount() }
this.initSettleInfo(); },
}, onShow() {
handleClick(item, type, showCountTime) { // 跳转工单详情页面 showCountTime:是否显示倒计时 // 每次进入页面都刷新入驻状态
// type类型 this.pageNumber = 0
// 'waitAccept': 待接单、待抢单;'waitAppointment': 待预约;'waitCheckIn': 待签到;'waitFinish': 待完工;'audit': 审核中;'exception': 异常单;'finish': 已完工;'other': 工单结算信息
uni.navigateTo({ this.initSettleInfo()
url: 'pages/order/detail?id=' + item.orderId + '&type=' + type + '&showCountTime=' + showCountTime },
}) methods: {
}, getData() {
async initSettleInfo() { this.getOrderCount()
let self = this; this.initSettleInfo()
// 加载消息列表 },
this.loadMessageList(); handleClick(item, type, showCountTime) {
if (this.vuex_token) { // 跳转工单详情页面 showCountTime:是否显示倒计时
// type类型
const callBack = (vm, result) => { // 'waitAccept': 待接单、待抢单;'waitAppointment': 待预约;'waitCheckIn': 待签到;'waitFinish': 待完工;'audit': 审核中;'exception': 异常单;'finish': 已完工;'other': 工单结算信息
// 后台自动判断入驻流程是否完成,前台通过status确定状态 uni.navigateTo({
if (result && result.record) { url:
'pages/order/detail?id=' +
vm.needSettled = result.needSettled; item.orderId +
vm.status = Number(result.record.status || '0'); '&type=' +
// vm.status = 8 type +
} '&showCountTime=' +
}; showCountTime,
self.search.pageNumber = 0 })
self.loadedOrder = false },
self.loadOrderList(); async initSettleInfo() {
await app.getBaseInfo(self, callBack); let self = this
if (this.status == 7) { // 加载消息列表
this.getLocation() this.loadMessageList()
} if (this.vuex_token) {
this.loaded = true; const callBack = (vm, result) => {
} else { // 后台自动判断入驻流程是否完成,前台通过status确定状态
this.loaded = true if (result && result.record) {
} vm.needSettled = result.needSettled
vm.status = Number(result.record.status || '0')
}, // vm.status = 8
loadMessageList() { }
let self = this; }
self.$u.api.listByNotice().then((res) => { self.search.pageNumber = 0
uni.stopPullDownRefresh() // 结束下拉刷新 self.loadedOrder = false
if (res.code == 200) { await app.getBaseInfo(self, callBack)
if (res.data && res.data.length > 2) { if (this.status == 7) {
self.messageList = res.data.slice(0, 2); this.getLocation()
} else { self.loadOrderList()
self.messageList = res.data || []; }
} this.loaded = true
} else { } else {
console.log(res.message, "初始化消息列表异常"); this.loaded = true
} }
}); },
}, loadMessageList() {
loadOrderList() { let self = this
this.search.pageNumber += 1 self.$u.api.listByNotice().then((res) => {
let self = this; uni.stopPullDownRefresh() // 结束下拉刷新
// 加载订单列表 if (res.code == 200) {
self.search.token = self.vuex_token; if (res.data && res.data.length > 2) {
self.$u.api.listByRecommendOrder(self.search).then((res) => { self.messageList = res.data.slice(0, 2)
self.loadedOrder = true } else {
self.messageList = res.data || []
if (res.code == 200 && res.data) { }
if (self.search.pageNumber == 1) { } else {
self.orderList = [] console.log(res.message, '初始化消息列表异常')
} }
if (res.data.list) { })
// self.orderList.push(...res.data.list) },
async loadOrderList() {
// 更新每一条时间戳,防止后台返回的数据和原先一样,不触发ordercell的时间计算 this.search.pageNumber += 1
var time = new Date().getTime() let self = this
for (var item of res.data.list) { // 加载订单列表
item.currentCellTime = time self.search.token = self.vuex_token
self.orderList.push(item); self.$u.api.listByRecommendOrder(self.search).then((res) => {
} self.loadedOrder = true
}
if (res.code == 200 && res.data) {
self.currentLoadStatus = res.data.total > self.orderList.length && (res.data.list || []).length == self.search.pageSize ? 'loadmore' : 'nomore' if (self.search.pageNumber == 1) {
self.orderList = []
} else { }
console.log(res.message, "初始化订单列表异常"); if (res.data.list) {
} // self.orderList.push(...res.data.list)
self.$nextTick(()=>{
if (self._freshing) { // 更新每一条时间戳,防止后台返回的数据和原先一样,不触发ordercell的时间计算
self.triggered = false; var time = new Date().getTime()
self._freshing = false; for (var item of res.data.list) {
} item.currentCellTime = time
}) self.orderList.push(item)
}); }
}, }
reachBottom() {
if (this.vuex_token) { self.currentLoadStatus =
if (this.currentLoadStatus != 'loadmore') return res.data.total > self.orderList.length &&
this.currentLoadStatus == 'loading' (res.data.list || []).length == self.search.pageSize
this.loadOrderList() ? 'loadmore'
} : 'nomore'
}, } else {
onRefresh() { console.log(res.message, '初始化订单列表异常')
if (this._freshing) return }
this._freshing = true self.$nextTick(() => {
this.initSettleInfo() if (self._freshing) {
}, self.triggered = false
onRestore() { self._freshing = false
this.triggered = 'restore'; // 需要重置 }
}, })
scroll(e) { })
this.old.scrollTop = e.detail.scrollTop },
}, reachBottom() {
goTop(e) { if (this.vuex_token) {
this.scrollTop = this.old.scrollTop if (this.currentLoadStatus != 'loadmore') return
this.$nextTick(function() { this.currentLoadStatus == 'loading'
this.scrollTop = 0 this.loadOrderList()
}); }
}, },
/* 立即入驻 */ onRefresh() {
immediatelyIn() { if (this._freshing) return
if (this.vuex_token) { this._freshing = true
// 用户已登录 this.initSettleInfo()
var pageIndex = 1; },
// 0=>'待提交',1=>'待审核',2=>'已通过',3=>'备选',4=>'已驳回',5=>'已签约',6=>'未支付保证金',7=>'已支付保证金',8=>'已通过考试',9=>'待提交' onRestore() {
switch (this.status) { this.triggered = 'restore' // 需要重置
case 1: },
case 2: scroll(e) {
case 3: this.old.scrollTop = e.detail.scrollTop
case 4: },
pageIndex = 2; goTop(e) {
break; this.scrollTop = this.old.scrollTop
case 8: this.$nextTick(function() {
pageIndex = 3; this.scrollTop = 0
break; })
case 5: },
case 6: /* 立即入驻 */
pageIndex = 4; immediatelyIn() {
break; if (this.vuex_token) {
case 7: // 用户已登录
pageIndex = 5; var pageIndex = 1
break; // 0=>'待提交',1=>'待审核',2=>'已通过',3=>'备选',4=>'已驳回',5=>'已签约',6=>'未支付保证金',7=>'已支付保证金',8=>'已通过考试',9=>'待提交'
default: switch (this.status) {
pageIndex = 1; case 1:
break; case 2:
} case 3:
case 4:
uni.navigateTo({ pageIndex = 2
url: this.status > 0 ? break
"/pages/settle/prompt?pageIndex=" + pageIndex : "/pages/settle/index", case 8:
}); pageIndex = 3
} else { break
// 用户未登录 case 5:
uni.navigateTo({ case 6:
url: "pages/login/index", pageIndex = 4
}); break
} case 7:
}, pageIndex = 5
// 获取订单数量 break
getOrderCount() { default:
var self = this; // 加载订单列表 pageIndex = 1
self.$u.api.listOrderCount().then((res) => { break
if (res.code == 200) { }
if (res.data) {
var count = 0 uni.navigateTo({
for (var i in res.data) { url:
count += res.data[i] this.status > 0
} ? '/pages/settle/prompt?pageIndex=' + pageIndex
// 修改tab总数 : '/pages/settle/index',
if (count > 0) { })
uni.setTabBarBadge({ } else {
index: 1, // 用户未登录
text: String(count) uni.navigateTo({
}) url: 'pages/login/index',
} else { })
uni.removeTabBarBadge({ }
index: 1 },
}) // 获取订单数量
} getOrderCount() {
var self = this // 加载订单列表
} self.$u.api.listOrderCount().then((res) => {
if (res.code == 200) {
} else { if (res.data) {
console.log(res.message, "获取订单数量失败!"); var count = 0
} for (var item of this.countKeys) {
}); count += res.data[item] || 0
}, }
/** // 修改tab总数
* 获取当前位置的经纬度 if (count > 0) {
*/ uni.setTabBarBadge({
getLocation() { index: 1,
let self = this text: String(count),
uni.getLocation({ })
type: 'gcj02', } else {
success: function(res) { uni.removeTabBarBadge({
self.location = [res.latitude, res.longitude] index: 1,
}, })
complete: function(res) { }
if (res.errMsg.indexOf('auth') != -1) { }
uni.showModal({ } else {
title: '提示', console.log(res.message, '获取订单数量失败!')
content: '获取权限失败,请到设置页面开启权限', }
confirmText: '好的', })
success(res) { },
if (res.confirm) { /**
uni.openSetting({ * 获取当前位置的经纬度
success(res) { */
console.log(res.authSetting) 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) {
fail: function(err) { uni.showModal({
} title: '提示',
}); content: '获取权限失败,请到设置页面开启权限',
}, confirmText: '好的',
toNewsDetail(item) { success(res) {
wx.navigateTo({ if (res.confirm) {
url: '/pages/learn/news-details', uni.openSetting({
success: function(res) { success(res) {
res.eventChannel.emit('acceptDataFromLearn', item) console.log(res.authSetting)
} },
}); })
}, }
handleClickBanner() { },
uni.navigateTo({ })
url: "/pages/mine/customer/index" + '?type=exclusive', }
}); },
}, 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> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.banner-image { .banner-image {
width: 730rpx; width: 730rpx;
height: 280rpx; height: 280rpx;
margin-left: -16rpx; margin-left: -16rpx;
} }
.content-view { .content-view {
height: 100%; height: 100%;
overflow: auto; overflow: auto;
} }
.msg-view { .msg-view {
.msg-title { .msg-title {
color: #333333; color: #333333;
font-size: 32rpx; font-size: 32rpx;
font-weight: bold; font-weight: bold;
padding: 1rpx 0rpx 30rpx 0rpx; padding: 1rpx 0rpx 30rpx 0rpx;
} }
.msg-list-view { .msg-list-view {
border-radius: 12rpx; border-radius: 12rpx;
background-color: #ffffff; background-color: #ffffff;
padding: 12rpx 30rpx; padding: 12rpx 30rpx;
height: 174rpx; height: 174rpx;
} }
.msg-content { .msg-content {
color: #333333; color: #333333;
font-size: 26rpx; font-size: 26rpx;
.msg-content-view { .msg-content-view {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
margin-top: 20rpx; margin-top: 20rpx;
margin-bottom: 20rpx; margin-bottom: 20rpx;
.left-view { .left-view {
display: flex; display: flex;
align-items: center; align-items: center;
.msg-icon { .msg-icon {
width: 80rpx; width: 80rpx;
height: 36rpx; height: 36rpx;
margin-right: 20rpx; margin-right: 20rpx;
} }
.msg-text { .msg-text {
text-overflow: ellipsis; text-overflow: ellipsis;
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
width: 448rpx; width: 448rpx;
} }
} }
.right-icon { .right-icon {
width: 14rpx; width: 14rpx;
height: 24rpx; height: 24rpx;
} }
} }
.line-view { .line-view {
height: 2rpx; height: 2rpx;
background-color: #f4f5f7; background-color: #f4f5f7;
} }
} }
} }
.logo {
.logo { height: 200 rpx;
height: 200 rpx; width: 100%;
width: 100%; margin: 0 rpx auto 50 rpx auto;
margin: 0 rpx auto 50 rpx auto; }
}
.text-area {
.text-area { display: flex;
display: flex; justify-content: center;
justify-content: center; }
}
.title {
.title { font-size: 36 rpx;
font-size: 36 rpx; color: #8f8f94;
color: #8f8f94; }
}
// .sticky-view {
// .sticky-view { // position: sticky;
// position: sticky; // position: -webkit-sticky;
// position: -webkit-sticky; // top: 0rpx;
// top: 0rpx; // width: 100%;
// width: 100%; // height: 200rpx;
// height: 200rpx; // background-color: black;
// background-color: black; // }
// }
.sticky {
.sticky { background-color: #f4f5f7;
background-color: #f4f5f7; color: #fff;
color: #fff; padding: 24 rpx;
padding: 24 rpx; text-align: left;
text-align: left; font-size: 32rpx;
font-size: 32rpx; font-weight: bold;
font-weight: bold; color: #333333;
color: #333333; padding: 46rpx 0 28rpx 0;
padding: 46rpx 0 28rpx 0; }
}
.order-view {
.order-view { text-align: center;
text-align: center;
.order-list-view {
.order-list-view { .tip-view {
padding: 30rpx;
.tip-view { background-color: #ffffff;
padding: 30rpx; border-radius: 12rpx;
background-color: #ffffff; min-height: 460rpx;
border-radius: 12rpx;
min-height: 460rpx; .tip-view-image {
width: 328rpx;
.tip-view-image { height: 200rpx;
width: 328rpx; margin-top: 30rpx;
height: 200rpx; }
margin-top: 30rpx;
} .tip-other {
font-size: 28rpx;
.tip-other { color: #666666;
font-size: 28rpx; margin-bottom: 30rpx;
color: #666666; }
margin-bottom: 30rpx;
} .settle-button {
}
.settle-button {} }
}
.order-item-view {
.order-item-view { background-color: #f4f5f7;
background-color: #F4F5F7; border-radius: 12rpx;
border-radius: 12rpx; margin-bottom: 20rpx;
margin-bottom: 20rpx; .load-more-view {
} padding-bottom: 44rpx;
} }
} }
}
.bottom-view { }
display: flex;
align-items: center; .bottom-view {
justify-content: space-between; display: flex;
padding: 50rpx 40rpx 50rpx 40rpx; align-items: center;
justify-content: space-between;
.bottom-line-view { padding: 50rpx 40rpx 50rpx 40rpx;
background-color: #D5D5D5;
height: 2rpx; .bottom-line-view {
width: 30%; background-color: #d5d5d5;
} height: 2rpx;
width: 30%;
.bottom-text { }
color: #999999;
font-size: 24rpx; .bottom-text {
} color: #999999;
} font-size: 24rpx;
</style> }
}
.fixed-button {
position: fixed;
right: 10rpx;
bottom: 64rpx;
}
</style>
...@@ -4,8 +4,7 @@ ...@@ -4,8 +4,7 @@
<u-navbar :is-back="false" :background="{ background: 'transparent' }" :border-bottom="false"> <u-navbar :is-back="false" :background="{ background: 'transparent' }" :border-bottom="false">
<text class="title-view">我的</text> <text class="title-view">我的</text>
</u-navbar> </u-navbar>
<view class="mine-content"> <view class="header-view">
<view class="header-view">
<view class="header-left-view"> <view class="header-left-view">
<view class="head-image"> <view class="head-image">
<image :style="headImageStyle" :src="headImageUrl"></image> <image :style="headImageStyle" :src="headImageUrl"></image>
...@@ -25,11 +24,13 @@ ...@@ -25,11 +24,13 @@
</view> </view>
<view v-if="isSuperuser" class="super-button"><u-button@click="handleSuperButton">切换用户</u-button></view> <view v-if="isSuperuser" class="super-button"><u-button@click="handleSuperButton">切换用户</u-button></view>
</view> </view>
</view> </view>
<view class="mine-content">
<view class="ware-house-view"> <view class="ware-house-view">
<view class="ware-house-title">仓配功能</view> <view class="ware-house-title">仓配功能</view>
<view class="ware-house-content"> <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"> <view class="ware-house-image">
<image :src="item.icon" :style="item.imageStyle"></image> <image :src="item.icon" :style="item.imageStyle"></image>
</view> </view>
...@@ -57,7 +58,6 @@ ...@@ -57,7 +58,6 @@
</template> </template>
<script> <script>
import util from '@/utils/util.js'
import login from "@/utils/login.js"; import login from "@/utils/login.js";
const app = getApp(); const app = getApp();
export default { export default {
...@@ -87,6 +87,12 @@ ...@@ -87,6 +87,12 @@
items() { items() {
return [ return [
[{ [{
pathName: 'order/index',
title: '订单管理',
value: '',
icon: 'dingdanguanli.png',
imageStyle: 'width:34rpx;height:32rpx'
},{
pathName: 'wallet/index', pathName: 'wallet/index',
title: '我的钱包', title: '我的钱包',
value: '', value: '',
...@@ -94,26 +100,21 @@ ...@@ -94,26 +100,21 @@
imageStyle: 'width:34rpx;height:32rpx' imageStyle: 'width:34rpx;height:32rpx'
}, },
{ {
pathName: 'deposit/index', pathName: 'info/index',
title: '配件押金', title: '我的资料',
value: '', value: '',
icon: 'yajin.png', icon: 'wodeziliao.png',
imageStyle: 'width:32rpx;height:32rpx' imageStyle: 'width:32rpx;height:32rpx'
}, },
{ {
pathName: 'contract/index', pathName: 'history/index',
title: '我的合同', title: '浏览记录',
value: '', value: '',
icon: 'hetong.png', icon: 'liulanjilu.png',
imageStyle: 'width:34rpx;height:32rpx' imageStyle: 'width:34rpx;height:32rpx'
}, },
{ ],
pathName: 'cert/index', [
title: '我的证件',
value: '',
icon: 'zhengjian.png',
imageStyle: 'width:36rpx;height:28rpx'
}],[
{ {
pathName: 'address/index', pathName: 'address/index',
title: '收货地址', title: '收货地址',
...@@ -121,13 +122,6 @@ ...@@ -121,13 +122,6 @@
icon: 'wddizhi.png', icon: 'wddizhi.png',
imageStyle: 'width:32rpx;height:32rpx' imageStyle: 'width:32rpx;height:32rpx'
}, },
// {
// pathName: 'warehouse',
// title: '我的仓库',
// value: '',
// icon: 'cangku.png',
// imageStyle: 'width:36rpx;height:32rpx'
// },
{ {
pathName: 'customer/index', pathName: 'customer/index',
title: '联系客服', title: '联系客服',
...@@ -148,7 +142,7 @@ ...@@ -148,7 +142,7 @@
}, },
{ {
pathName: 'warehouse/spare', pathName: 'warehouse/spare',
title: '物料库', title: '备件库',
value: '', value: '',
icon: process.uniEnv.qn_base_url + 'wodebeijian.png', icon: process.uniEnv.qn_base_url + 'wodebeijian.png',
imageStyle: 'width:60rpx;height:54rpx' imageStyle: 'width:60rpx;height:54rpx'
...@@ -183,6 +177,12 @@ ...@@ -183,6 +177,12 @@
}, },
shezhiImage() { shezhiImage() {
return process.uniEnv.qn_base_url + 'shezhi.png' 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() { isSuperuser() {
return this.vuex_superuser return this.vuex_superuser
...@@ -264,9 +264,9 @@ ...@@ -264,9 +264,9 @@
.mine-view { .mine-view {
position: relative; position: relative;
height: 100vh; height: 100vh;
overflow: auto; display: flex;
background-color: #F4F5F7; background-color: #F4F5F7;
flex-direction: column;
.header-image { .header-image {
position: absolute; position: absolute;
width: 100%; width: 100%;
...@@ -279,19 +279,18 @@ ...@@ -279,19 +279,18 @@
font-size: 40rpx; font-size: 40rpx;
padding-left: 30rpx; padding-left: 30rpx;
} }
.mine-content {
position: relative;
padding: 26rpx 30rpx 30rpx 20rpx;
.header-view { .header-view {
display: flex; display: flex;
align-items: flex-start; align-items: flex-start;
justify-content: space-between; justify-content: space-between;
margin-bottom: 60rpx; // margin-bottom: 60rpx;
padding: 26rpx 30rpx 60rpx 30rpx;
.header-left-view { .header-left-view {
display: flex; display: flex;
align-items: center; align-items: center;
.head-image { .head-image {
z-index: 1;
width: 120rpx; width: 120rpx;
height: 120rpx; height: 120rpx;
background-color: #FFFFFF; background-color: #FFFFFF;
...@@ -338,6 +337,7 @@ ...@@ -338,6 +337,7 @@
} }
} }
.header-right-view { .header-right-view {
z-index: 1;
.setting-view { .setting-view {
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
...@@ -358,6 +358,14 @@ ...@@ -358,6 +358,14 @@
} }
} }
} }
.mine-content {
height: 100%;
overflow: auto;
position: relative;
padding-bottom: 30rpx;
margin: 0rpx 30rpx;
border-radius: 12rpx;
.ware-house-view { .ware-house-view {
background-color: #FFFFFF; background-color: #FFFFFF;
border-radius: 12rpx; border-radius: 12rpx;
...@@ -389,13 +397,10 @@ ...@@ -389,13 +397,10 @@
align-items: center; align-items: center;
} }
} }
} }
} }
.list-view { .list-view {
.group-view { .group-view {
margin-top: 20rpx; margin-top: 20rpx;
background-color: #FFFFFF; background-color: #FFFFFF;
...@@ -419,10 +424,8 @@ ...@@ -419,10 +424,8 @@
margin: 30rpx; margin: 30rpx;
} }
} }
} }
} }
} }
.logout { .logout {
padding: 20rpx; padding: 20rpx;
......
...@@ -21,23 +21,27 @@ ...@@ -21,23 +21,27 @@
<text class="search-btn-text">搜订单</text> <text class="search-btn-text">搜订单</text>
</view> </view>
</view> </view>
<view class="u-tabs-box" v-show="curNow == 0"> <view class="u-tabs-box">
<u-tabs <!-- 写两个是避免切换subsection时候,current不是0的时候底部蓝条有初始动画 -->
height="66" <view v-for="index of [0, 1]" :key="index">
activeColor="#2272FF" <u-tabs
bg-color="none" v-show="curNow == index"
inactive-color="#999" height="66"
bar-height="4" activeColor="#2272FF"
bar-width="44" bg-color="none"
:offset="[0, 0]" inactive-color="#999"
:list="list" bar-height="4"
count="total" bar-width="44"
:current="current" :offset="offset[index]"
@change="change" :list="list[index]"
:is-scroll="false" count="total"
font-size="28" :current="current[index]"
bold @change="change"
></u-tabs> :is-scroll="false"
font-size="28"
bold
></u-tabs>
</view>
</view> </view>
<view class="tab-view"> <view class="tab-view">
...@@ -56,35 +60,39 @@ ...@@ -56,35 +60,39 @@
@scroll="scroll" @scroll="scroll"
enable-back-to-top enable-back-to-top
> >
<view class="loading-view" v-if="!loaded && !_freshing">
<u-loading mode="flower"></u-loading>
</view>
<NoOrder <NoOrder
v-else-if="noMore" v-if="noMore"
imageName="zwdd.png" imageName="zwdd.png"
:customStyle="noOrderCustomStyle" :customStyle="noOrderCustomStyle"
/> />
<template v-else> <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 <OrderCell
:orderData="item" :orderData="item"
:type="orderType" :type="cellType"
:location="dataValue" :location="dataValue"
@click="handleClick" @click="handleClick"
@action="handleClickCellButton" @action="handleClickCellButton"
> >
</OrderCell> </OrderCell>
</view> </view>
<view class="load-more-view"> <view
<u-loadmore class="load-more-view"
v-show="(pageNumber == 1 && loaded) || pageNumber > 1" v-show="(pageNumber == 1 && loaded) || pageNumber > 1"
:status="loadStatus" >
bgColor="#F4F5F7" <u-loadmore :status="loadStatus" bgColor="#F4F5F7"></u-loadmore>
></u-loadmore>
</view> </view>
</template> </template>
<view class="loading-view" v-if="!loaded && !_freshing">
<u-loading mode="flower"></u-loading>
</view>
</scroll-view> </scroll-view>
</view> </view>
<!-- 悬浮按钮 -->
<!-- <EusingList type="collapse" /> -->
</TabBarPage> </TabBarPage>
</template> </template>
...@@ -93,42 +101,67 @@ import TabBarPage from '@/components/tabBarList/index.vue' ...@@ -93,42 +101,67 @@ import TabBarPage from '@/components/tabBarList/index.vue'
import OrderCell from '@/components/order/index.vue' import OrderCell from '@/components/order/index.vue'
import NoOrder from '@/components/order/noOrder.vue' import NoOrder from '@/components/order/noOrder.vue'
import upload from '@/components/upload/task.js' import upload from '@/components/upload/task.js'
// import EusingList from '@/components/order/eusingList.vue'
export default { export default {
components: { components: {
TabBarPage, TabBarPage,
OrderCell, OrderCell,
NoOrder, NoOrder,
// EusingList,
}, },
data() { data() {
return { return {
curNow: 0, curNow: 0,
pageNumber: 0, pageNumber: 0,
pageSize: 1000, // 因为需要排序,所以暂时去掉分页 orderList: [
orderList: [], // 用多个数组存储可以优化用户切换体验,但是会增加内存
[[], [], [], [], [], []],
[[], [], []],
],
list: [ 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', loadStatus: 'loading',
dataValue: [], dataValue: [],
loaded: false, loaded: false,
...@@ -142,62 +175,122 @@ export default { ...@@ -142,62 +175,122 @@ export default {
}, },
computed: { computed: {
subList() { subList() {
return ['待处理', '已完工'] return ['全部订单', '今日订单']
}, },
// 0:'去预约', 1:'去签到', 2:'去完工', 3:'审核中', 4:'去处理', 5'已完工' // 0 全部订单: 0:'待预约', 1:'待签到', 2:'待完工', 3:'审核中', 4:'异常单', 5'已完工'
// 1 今日订单: 0:'今日待联系', 1:'今日待完工', 2:'今日异常单'
orderType() { 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.curNow + this.current[this.curNow] < 3
},
pageSizes() {
// 待预约, 待签到,待完工,因为需要排序,所以暂时去掉分页,一次要完所有
return [
[10000, 10000, 10000, 15, 15, 15],
[10000, 10000, 15],
]
}, },
currentIndex() { offset() {
return this.curNow == 0 ? this.current : 5 return [
[0, 0],
[0, 44],
]
}, },
sousuoImage() { sousuoImage() {
return process.uniEnv.qn_base_url + 'sousuo.png' return process.uniEnv.qn_base_url + 'sousuo.png'
}, },
// 每一种状态对应的tab的index
types() { types() {
return { return [
waitAppointment: 0, // 待预约、 {
waitCheckIn: 1, // 待签到、 waitAppointment: 0, // 待预约、
waitFinish: 2, // 待完工、 waitCheckIn: 1, // 待签到、
audit: 3, // 审核中、 waitFinish: 2, // 待完工、
exception: 4, // 异常单、 audit: 3, // 审核中、
finish: 5, //已完工 exception: 4, // 异常单、
} finish: 5, //已完工
},
{
todayWaitContact: 0, // 今日待联系、
todayWaitFinish: 1, // 今日待完工、
todayException: 2, // 今日异常单、
},
]
}, },
//waitAccept、waitAppointment、waitCheckIn、waitFinish、exception、finish // 每一个tab对应的状态
indexStatus() { indexStatus() {
return { return [
0: 'waitAppointment', [
1: 'waitCheckIn', 'waitAppointment',
2: 'waitFinish', 'waitCheckIn',
3: 'audit', 'waitFinish',
4: 'exception', 'audit',
5: 'finish', 'exception',
} 'finish',
],
['todayWaitContact', 'todayWaitFinish', 'todayException'],
]
}, },
// 订单数量接的返回数量的key
countKeys() { countKeys() {
return [ return [
'toAppointmentCount', [
'toCheckinCount', 'toAppointmentCount',
'toFinishCount', 'toCheckinCount',
'reviewingCount', 'toFinishCount',
'exceptionCount', 'reviewingCount',
'exceptionCount',
'', // 待完工没有数量
],
['todayContactCount', 'todayFinishCount', 'todayExceptionCount'],
] ]
}, },
isFinish() {
return this.orderType == 'finish'
},
noMore() { 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() { noOrderCustomStyle() {
return this.curNow == 0 return 'margin-top: 100rpx;background-color: #F4F5F7'
? 'margin-top: 100rpx;background-color: #F4F5F7'
: 'margin-top: 200rpx;background-color: #F4F5F7'
}, },
}, },
onLoad(e) { onLoad(e) {
getApp().trackPage('订单首页') getApp().trackPage('订单首页')
this._freshing = false this._freshing = false
// 跳转到本页是否带了跳到那个tab的参数
if (e && e.type) { if (e && e.type) {
this.current = e.type this.current[this.curNow] = Math.max(
0,
this.indexStatus[this.curNow].indexOf(e.type)
)
} }
}, },
onShow() { onShow() {
...@@ -213,18 +306,17 @@ export default { ...@@ -213,18 +306,17 @@ export default {
}, },
// tab栏切换 // tab栏切换
change(index) { change(index) {
this.current = index this.current[this.curNow] = index
this.orderList = []
this.reloadOrderList() this.reloadOrderList()
}, },
// 滚动底部
reachBottom(e) { reachBottom(e) {
if (this.loadStatus != 'loadmore') return if (this.loadStatus != 'loadmore') return
this.loadStatus == 'loading' this.loadStatus == 'loading'
this.getOrderList(this.currentIndex) this.getOrderList()
}, },
// 页面数据 // 页面数据
getOrderList(index) { getOrderList() {
// 状态处理 // 状态处理
this.pageNumber += 1 this.pageNumber += 1
if (this.pageNumber == 1) { if (this.pageNumber == 1) {
...@@ -234,28 +326,42 @@ export default { ...@@ -234,28 +326,42 @@ export default {
pageNumber: this.pageNumber, pageNumber: this.pageNumber,
pageSize: this.pageSize, pageSize: this.pageSize,
keyword: '', keyword: '',
type: this.indexStatus[index], type: this.orderType,
} }
var self = this var self = this
self.$u.api.listOrder(param).then((res) => { self.$u.api.listOrder(param).then((res) => {
if (res.code == 200) { if (res.code == 200) {
if (res.data.type != self.orderType) return if (res.data.type != self.orderType) return // 已切换到其他tab,则不处理后台返回的数据
if (self.pageNumber == 1) { if (self.pageNumber == 1) {
self.orderList = [] // 下拉刷新或切换到新tab,清空对应数组
self.orderList[this.curNow][this.current[this.curNow]] = []
} }
if (res.data.list) { if (res.data.list) {
self.orderList.push(...res.data.list) self.orderList[this.curNow][this.current[this.curNow]].push(
if (self.list[self.types[res.data.type]]) { ...res.data.list
self.list[self.types[res.data.type]].total = res.data.total )
// 更新tab数字
if (
!this.isFinish &&
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) => { if (this.needSort) {
return x.currentOverTime <= y.currentOverTime ? 1 : -1 self.orderList[this.curNow][this.current[this.curNow]].sort(
}) (x, y) => {
return x.currentOverTime < y.currentOverTime ? 1 : -1
}
)
}
// 更新底部加载状态
self.loadStatus = 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 res.data.list.length == self.pageSize
? 'loadmore' ? 'loadmore'
: 'nomore' : 'nomore'
...@@ -275,19 +381,24 @@ export default { ...@@ -275,19 +381,24 @@ export default {
// 获取订单数量 // 获取订单数量
getOrderCount() { getOrderCount() {
var self = this this.$u.api.listOrderCount().then((res) => {
self.$u.api.listOrderCount().then((res) => {
if (res.code == 200) { if (res.code == 200) {
if (res.data) { if (res.data) {
// 修改各个tab数量 // 修改各个tab数量
var i = 0 var j = 0
var count = 0 var count = 0
for (var item of self.list) { for (var items of this.list) {
item.total = res.data[self.countKeys[i]] var i = 0
count += item.total for (var item of items) {
i++ item.total = res.data[this.countKeys[j][i]] || 0
if (j == 0) {
// 非今日订单数量加起来
count += item.total
}
i++
}
j++
} }
// 修改tab总数 // 修改tab总数
if (count > 0) { if (count > 0) {
uni.setTabBarBadge({ uni.setTabBarBadge({
...@@ -306,14 +417,7 @@ export default { ...@@ -306,14 +417,7 @@ export default {
}) })
}, },
handleClickCellButton(item, type) { handleClickCellButton(item, type) {
if (type == 'exception') { if (!this.loaded) return
this.$u.api.workerDealWithError(item.orderId).then(() => {})
}
let partAuditResults = item.partAuditResults !== null && Object.keys(item.partAuditResults).length > 0 ? ['orderSpareParts'] : []
let auditResults = item.auditResults ? Object.keys(item.auditResults) : []
auditResults = auditResults.concat(partAuditResults)
// 去完工
uni.navigateTo({ uni.navigateTo({
url: url:
'pages/order/complete?orderId=' + 'pages/order/complete?orderId=' +
...@@ -333,12 +437,13 @@ export default { ...@@ -333,12 +437,13 @@ export default {
'&brandId=' + '&brandId=' +
item.lianbaoBrandId + item.lianbaoBrandId +
'&auditResults=' + '&auditResults=' +
(auditResults ? auditResults.join() : '') + (item.auditResults ? item.auditResults.join() : '') +
'&orderNumber=' + '&orderNumber=' +
item.orderNumber item.orderNumber,
}) })
}, },
handleClick(item, type, showCountTime) { handleClick(item, type, showCountTime) {
if (!this.loaded) return
// type:类型,showCountTime:是否显示倒计时。详情页面情况太多,提前传值可以避免页面晃动 // type:类型,showCountTime:是否显示倒计时。详情页面情况太多,提前传值可以避免页面晃动
//type类型 //type类型
// 'waitAccept': 待接单、待抢单;'waitAppointment': 待预约;'waitCheckIn': 待签到;'waitFinish': 待完工;'audit': 审核中;'exception': 异常单;'finish': 已完工;'other': 工单结算信息 // 'waitAccept': 待接单、待抢单;'waitAppointment': 待预约;'waitCheckIn': 待签到;'waitFinish': 待完工;'audit': 审核中;'exception': 异常单;'finish': 已完工;'other': 工单结算信息
...@@ -372,7 +477,7 @@ export default { ...@@ -372,7 +477,7 @@ export default {
reloadOrderList() { reloadOrderList() {
this.pageNumber = 0 this.pageNumber = 0
this.loadStatus = 'loading' this.loadStatus = 'loading'
this.getOrderList(this.currentIndex) this.getOrderList()
}, },
scroll(e) { scroll(e) {
this.old.scrollTop = e.detail.scrollTop this.old.scrollTop = e.detail.scrollTop
...@@ -391,21 +496,21 @@ export default { ...@@ -391,21 +496,21 @@ export default {
.u-tabs-box { .u-tabs-box {
margin-bottom: 30rpx; margin-bottom: 30rpx;
} }
.tab-view { .tab-view {
height: 100%; height: 100%;
overflow: auto; overflow: auto;
// padding-bottom: 20rpx;
.load-more-view { .load-more-view {
margin-bottom: 20rpx; padding-bottom: 44rpx;
} }
.loading-view { .loading-view {
width: 100%; width: 100%;
background-color: transparent;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
margin-top: 300rpx; top: 50%;
position: absolute; left: 0;
position: fixed;
} }
} }
...@@ -413,7 +518,7 @@ export default { ...@@ -413,7 +518,7 @@ export default {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
justify-content: space-between; justify-content: space-between;
padding-bottom: 20rpx; padding-bottom: 18rpx;
.search-sub { .search-sub {
height: 72rpx; height: 72rpx;
......
...@@ -128,11 +128,6 @@ ...@@ -128,11 +128,6 @@
this.isRuZhu = false; this.isRuZhu = false;
}); });
}, },
onUnload() {
uni.switchTab({
url: '/pages/index/mine'
});
},
methods: { methods: {
isUpload(typeBool) { isUpload(typeBool) {
return typeBool ? '已上传' : '未上传' return typeBool ? '已上传' : '未上传'
......
<template> <template>
<view class="contract"> <view class="contract">
<u-navbar <u-navbar
title="我的合同" back-icon-color="#333333"
b:is-back="false" background="#FFFFFF"
:background="background" title="我的合同"
:border-bottom="false" titleColor="#333333"
></u-navbar> :border-bottom="false"
title-bold
></u-navbar>
<view class="content"> <view class="content">
<view v-if="res.length > 0"> <view v-if="res.length > 0">
<text class="title">合同清单</text> <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="loading-view" v-if="!loaded">
<u-loading mode="flower"></u-loading>
</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>
</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,
orderList: [],
}
},
computed: {
title() {
return this.noneHistory ? '浏览记录' : ' '
},
noneHistory() {
return this.orderList.length <= 0 && this.loaded
},
idList() {
return this.vuex_last_five_orders.filter((id) => id) || []
},
chakanjiluImage() {
return process.uniEnv.qn_base_url + 'chakanjilu-y.png'
},
customStyle() {
return 'background-color: #F4F5F7'
},
},
onLoad() {
getApp().trackPage('浏览记录')
this.listOrderByIds()
},
methods: {
listOrderByIds() {
this.$u.api
.listOrderByIds(
this.$u.queryParams({ ids: this.idList }, true, 'repeat')
)
.then((res) => {
this.loaded = true
if (res.code == 200) {
this.orderList = res.data
} else {
console.log(res.message, '获取订单详情失败!')
}
})
},
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) {
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=' +
(item.auditResults ? Object.keys(item.auditResults).join() : ''),
})
},
},
}
</script>
<style lang="scss" scoped>
.history-view {
display: flex;
flex-direction: column;
height: 100vh;
.none-view {
margin-top: 140rpx;
}
.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;
}
}
}
.loading-view {
width: 100%;
background-color: transparent;
display: flex;
align-items: center;
justify-content: center;
top: 50%;
left: 0;
position: fixed;
}
.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: currentClicks[current][item.type] },
]"
>{{ info[item.key] || 0 }}</view
>
<view
>{{ item.label
}}<u-icon
class="arrow-icon"
name="arrow-right"
color="#cccccc"
></u-icon
></view>
</view>
</view>
</view>
<view>
<u-toast ref="uToast" />
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
info: {},
offset: [0, 0],
current: 0,
currentClicks: [],
}
},
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))
date = new Date()
var weekDays = [6, 0, 1, 2, 3, 4, 5]
var week = this.$u.timeFormat(
date.setDate(date.getDate() - weekDays[date.getDay()])
)
date = new Date()
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]
},
clicks() {
return { take: false, checkin: false, finish: false }
},
},
onLoad() {
this.currentClicks = this.clicks
},
onShow() {
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]
this.currentClicks = [
{ ...this.clicks },
{ ...this.clicks },
{ ...this.clicks },
{ ...this.clicks },
]
this.currentClicks[this.current][item.type] = true
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;
}
}
.arrow-icon {
margin-left: 4rpx;
}
}
}
}
}
}
</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
@scrolltolower="reachBottom"
scroll-anchoring
enable-back-to-top
refresher-background="#F4F5F7"
>
<view class="loading-view" v-if="!loaded">
<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"
: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,
title: '',
orderType: '',
timeParam: {},
}
},
computed: {
noMore() {
return this.orderList.length == 0 && this.loaded
},
noOrderCustomStyle() {
return 'margin-top: 100rpx;background-color: #F4F5F7'
},
sortType() {
return {
take: 'acceptOrderDateTime',
checkin: 'checkInDateTime',
finish: 'orderFinishDatetime',
}
},
currentSorTtype() {
return this.sortType[this.orderType]
},
},
onLoad(e) {
getApp().trackPage('订单首页')
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,
}
this.$u.api.manageOrderList(param).then((res) => {
if (res.code == 200) {
if (this.pageNumber == 1) {
this.orderList = []
}
if (res.data.list) {
this.orderList.push(...res.data.list)
this.orderList.sort((x, y) => {
return (x[this.currentSorTtype] || 0) <
(y[this.currentSorTtype] || 0)
? 1
: -1
})
this.loadStatus =
res.data.total > this.orderList.length &&
res.data.list.length == this.pageSize
? 'loadmore'
: 'nomore'
}
} else {
console.log(res.message, '获取订单数量失败!')
}
this.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 +
'&maintainStep=' +
item.maintainStep +
'&orderStatus=' +
item.orderStatus +
'&brandId=' +
item.lianbaoBrandId +
'&auditResults=' +
(item.auditResults ? Object.keys(item.auditResults).join() : ''),
})
},
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,
})
},
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;
left: 0;
margin-top: 300rpx;
position: absolute;
}
}
}
</style>
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
{ {
pathName: 'about', pathName: 'about',
title: '当前版本', title: '当前版本',
value: process.uniEnv.version, value: process.uniEnv.version_number,
icon: process.uniEnv.qn_base_url + 'version.png', icon: process.uniEnv.qn_base_url + 'version.png',
imageStyle: 'width:32rpx;height:32rpx' imageStyle: 'width:32rpx;height:32rpx'
} }
......
...@@ -13,10 +13,13 @@ ...@@ -13,10 +13,13 @@
</view> </view>
</picker> </picker>
</view> </view>
<view class="head-bottom-view"> <view class="head-bottom-view u-flex u-row-between">
<view class="head-amount-view"> <view class="head-amount-view">
<view><text>已结算金额(元)</text></view> <view><text>已结算金额(元)</text></view>
<view class="head-amount-text"><text>{{info.totalAmount}}</text></view> <view class="head-amount-text"><text>{{info.totalAmount || 0}}</text></view>
<!-- <view class="head-amount-view">
<view><text>待结算金额(元)</text></view>
<view class="head-amount-text"><text>{{info.waitPaidAmount || 0}}</text></view> -->
</view> </view>
</view> </view>
</view> </view>
...@@ -46,7 +49,7 @@ ...@@ -46,7 +49,7 @@
let now = new Date(new Date().toLocaleDateString()).getTime(); let now = new Date(new Date().toLocaleDateString()).getTime();
import util from '@/utils/util.js' import util from '@/utils/util.js'
import Settlement from "@/components/mine/settlement.vue" import Settlement from "@/components/mine/settlement.vue"
const baseinfo = {totalAmount: 0, payableRecordExtendDtos: []} const baseinfo = {totalAmount: 0, waitPaidAmount: 0, payableRecordExtendDtos: []}
export default { export default {
components: { components: {
Settlement Settlement
...@@ -58,7 +61,7 @@ ...@@ -58,7 +61,7 @@
date: '', date: '',
params: { params: {
payableRecordStatus: null, payableRecordStatus: null,
starDate: null, startDate: null,
endDate: null, endDate: null,
}, },
} }
...@@ -88,9 +91,9 @@ ...@@ -88,9 +91,9 @@
self.loading = true self.loading = true
let startTime = self.moment(self.date).format('YYYY-MM-DD') let startTime = self.moment(self.date).format('YYYY-MM-DD')
let endTime = self.moment(self.date).endOf('month').format('YYYY-MM-DD') let endTime = self.moment(self.date).endOf('month').format('YYYY-MM-DD')
self.params.starDate = startTime self.params.startDate = startTime
self.params.endDate = endTime self.params.endDate = endTime
let res = await self.$u.api.payableRecord(self.params) let res = await self.$u.api.listPayableRecordByPayTime(self.params)
self.loading = false self.loading = false
if(res && res.code == 200) { if(res && res.code == 200) {
self.info = res.data && res.data[self.date] || baseinfo self.info = res.data && res.data[self.date] || baseinfo
......
...@@ -318,7 +318,7 @@ ...@@ -318,7 +318,7 @@
.fixed-button { .fixed-button {
position: fixed; position: fixed;
right: 20rpx; right: 10rpx;
bottom: 64rpx; bottom: 64rpx;
} }
......
...@@ -63,7 +63,9 @@ ...@@ -63,7 +63,9 @@
:prop="item.fieldsName" :prop="item.fieldsName"
:border-bottom="false" :border-bottom="false"
v-show=" v-show="
((item.fieldsName != 'actualPaid' && item.fieldsName != 'eSerialNum') || show200) && ((item.fieldsName != 'actualPaid' &&
item.fieldsName != 'eSerialNum') ||
show200) &&
((readOnly && ((readOnly &&
!$u.test.isEmpty(form[item.fieldsName])) || !$u.test.isEmpty(form[item.fieldsName])) ||
!readOnly) !readOnly)
...@@ -315,6 +317,7 @@ ...@@ -315,6 +317,7 @@
:cancel-btn="true" :cancel-btn="true"
@click="uploadSelect" @click="uploadSelect"
></u-action-sheet> ></u-action-sheet>
<upload-progress />
</view> </view>
</template> </template>
<script> <script>
...@@ -598,6 +601,22 @@ export default { ...@@ -598,6 +601,22 @@ export default {
this.form.paymentMethodsType && this.form.paymentMethodsType != '03' this.form.paymentMethodsType && this.form.paymentMethodsType != '03'
) )
}, },
// 从订单管理和浏览记录进来,不跳转到订单列表,而是后退到订单管理和浏览记录
completeBack() {
let pages = getCurrentPages()
var i = 0
for (var item of pages) {
if (
['/pages/mine/history/index', '/pages/mine/order/index'].indexOf(
item.$page?.fullPath.split('?')[0]
) != -1
) {
return pages.length - i - 1
}
i++
}
return 0
},
}, },
methods: { methods: {
getCompleteData() { getCompleteData() {
...@@ -872,9 +891,16 @@ export default { ...@@ -872,9 +891,16 @@ export default {
async appointment() { async appointment() {
const save = await this.nextStepSaveData() const save = await this.nextStepSaveData()
if (save) { if (save) {
uni.reLaunch({ if (this.completeBack) {
url: '/pages/index/order?type=0', // 从订单管理和浏览记录进来
}) uni.navigateBack({
delta: this.completeBack,
})
} else {
uni.reLaunch({
url: '/pages/index/order?type=waitAppointment',
})
}
} }
}, },
// 下一步动作 // 下一步动作
...@@ -1008,9 +1034,16 @@ export default { ...@@ -1008,9 +1034,16 @@ export default {
title: '提交成功', title: '提交成功',
type: 'success', type: 'success',
callback: () => { callback: () => {
uni.reLaunch({ if (this.completeBack) {
url: '/pages/index/order?type=3', // 从订单管理和浏览记录进来
}) uni.navigateBack({
delta: this.completeBack,
})
} else {
uni.reLaunch({
url: '/pages/index/order?type=audit',
})
}
}, },
}) })
} else { } else {
...@@ -1029,9 +1062,16 @@ export default { ...@@ -1029,9 +1062,16 @@ export default {
title: '提交成功', title: '提交成功',
type: 'success', type: 'success',
callback: () => { callback: () => {
uni.reLaunch({ if (this.completeBack) {
url: '/pages/index/order?type=3', // 从订单管理和浏览记录进来
}) uni.navigateBack({
delta: this.completeBack,
})
} else {
uni.reLaunch({
url: '/pages/index/order?type=audit',
})
}
}, },
}) })
} else { } else {
...@@ -1102,10 +1142,14 @@ export default { ...@@ -1102,10 +1142,14 @@ export default {
if (innerItem.fieldsName === 'paymentMethodsType') { 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' 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' eSerialNum.required = data.value != '03'
} }
......
...@@ -548,11 +548,7 @@ export default { ...@@ -548,11 +548,7 @@ export default {
loadOrderDetail() { loadOrderDetail() {
// 获取工单详情 // 获取工单详情
let self = this let self = this
let timestamp = new Date().getTime() self.$u.api.orderDetail({}, self.orderId).then((res) => {
var data = {
orderId: self.orderId,
}
self.$u.api.orderDetail(data, self.orderId).then((res) => {
if (res.code == 200) { if (res.code == 200) {
self.order = res.data self.order = res.data
this.setOrderType() this.setOrderType()
......
<!-- 工单-搜索页 --> <!-- 工单-搜索页 -->
<template> <template>
<view class="search-wrap"> <view class="search-wrap">
<view class="top-item"> <view class="top-item">
<u-search <u-search
v-model="search.keyword" v-model="search.keyword"
bg-color="#FFFFFF" bg-color="#FFFFFF"
placeholder="搜索:工单号·用户姓名·手机号·地址" placeholder="搜索:工单号·用户姓名·手机号·地址"
search-icon-color="#999999" search-icon-color="#999999"
color="#333333" color="#333333"
placeholder-color="#999999" placeholder-color="#999999"
height="72" height="72"
margin="0 30rpx" margin="0 30rpx"
:animation="true" :animation="true"
:show-action="true" :show-action="true"
:action-style="{ :action-style="{
'font-size': '32rpx', 'font-size': '32rpx',
'font-weight': 500, 'font-weight': 500,
'color': '#2272FF' color: '#2272FF',
}" }"
:focus="true" :focus="true"
@search="searchOrder" @change="keywordChange"
@custom="searchOrder" @focus="onfocus"
></u-search> @blur="loseFocus"
</view> @search="searchOrder"
<view class="content-item"> @custom="searchOrder"
<view v-if="orderList && orderList.length > 0" class="order-row"> ></u-search>
<view v-for="(item, index) in orderList" :key="item.orderId"> </view>
<OrderCell :orderData="item" :orderType="orderType" :location="dataValue" <view class="association-wrap" v-show="showAssociation">
@click="handleClick" @action="handleClickCellButton"> </OrderCell> <view
</view> v-for="(item, index) in associationList"
<u-loadmore :status="loadStatus" bgColor="#F4F5F7"></u-loadmore> :key="index"
</view> class="association-cell u-border-top"
<view v-else-if="loaded" class="empty-result"> @click="handleClick(item, orderType, true)"
<u-image width="374" height="256" :src="searchEmpty"> >
<u-loading slot="loading"></u-loading> <view class="u-m-l-40">
</u-image> <u-parse
<text class="empty-message"> :html="item.contactNameHighlight"
当前暂无搜索结果 :tag-style="style"
</text> ></u-parse>
</view> </view>
<view class="u-m-l-10">
</view> <u-parse
</view> :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> </template>
<script> <script>
import OrderCell from "@/components/order/index.vue"; import OrderCell from "@/components/order/index.vue";
export default { export default {
components: { components: {
OrderCell OrderCell,
}, },
data() { data() {
return { return {
search: { search: {
type: '', type: "",
keyword: '', keyword: "",
pageSize: 10, pageSize: 10,
pageNumber: 0, pageNumber: 0,
orderStatusRangeType: '', orderStatusRangeType: "",
}, },
orderList: [], orderList: [],
loaded: false, associationList: [],
total: 10, loaded: false,
loadStaus: 'loadmore', focused: true,
}; total: 10,
}, loadStaus: "loadmore",
onLoad() { style: {
getApp().trackPage('订单搜索页') // 字符串的形式
// this.searchOrder() span: "color: red",
}, },
onReachBottom() { };
let len = this.orderList && this.orderList.length || 0 },
if(!this.loaded || len >= this.total) return; onLoad() {
this.loadStaus = 'loading'; getApp().trackPage("订单搜索页");
this.search.pageNumber = ++ this.search.pageNumber; // this.searchOrder()
this.getOrderList('onReachBottom') },
}, onReachBottom() {
computed: { let len = (this.orderList && this.orderList.length) || 0;
searchEmpty() { if (!this.loaded || len >= this.total) return;
return process.uniEnv.qn_base_url + 'SearchEmpty.png' this.loadStaus = "loading";
}, this.search.pageNumber = ++this.search.pageNumber;
}, this.getOrderList("onReachBottom");
methods: { },
searchOrder(index) { computed: {
this.search.pageNumber = 1 searchEmpty() {
this.loadStaus = 'loading'; return process.uniEnv.qn_base_url + "SearchEmpty.png";
if(this.search.keyword) { },
getApp().track('search_order', {keyword: this.search.keyword}); showAssociation() {
this.getOrderList() return this.focused && this.search.keyword && !this.$u.test.isEmpty(this.associationList);
} },
}, showOrderCell() {
// 页面数据 return !this.focused;
getOrderList(event) { },
let self = this; },
if(!self.search.keyword) { methods: {
return false searchOrder(index) {
} this.search.pageNumber = 1;
this.loadStaus = "loading";
// 状态处理 if (this.search.keyword) {
self.loaded = false getApp().track("search_order", { keyword: this.search.keyword });
self.$u.api.listOrder(self.search).then((res) => { this.getOrderList();
if (res.code == 200) { this.focused = false;
if (res.data) { }
let list = res.data.list || [] },
self.total = res.data.total || 0 // 高亮文本
if(event == 'onReachBottom') { highlights() {
self.orderList.push(...list) const keyword = this.search.keyword;
} else { this.associationList = this.associationList.map((item) => {
self.orderList = list for (let key in item) {
} if (key === "contactName" || key === "contactPhone") {
self.loadStatus = res.data.total > self.orderList.length ? 'loadmore' : 'nomore' let replaceReg = new RegExp(keyword, "g"); // 匹配关键字正则
} let replaceString = "<span>" + keyword + "</span>"; // 高亮替换v-html值
} else { item[key + "Highlight"] = item[key].replace(
self.$u.toast('请求失败'); replaceReg,
} replaceString
self.loaded = true ); // 开始替换
}); }
}, }
handleClickCellButton(item) { return item;
// 去完工 });
uni.navigateTo({ },
url: 'pages/order/complete?orderId='+item.orderId /** 联想工单 */
+ "&categoryId=" + item.categoryId async associationOrder() {
+ "&orderServiceType=" + item.orderServiceType let res = await this.$u.api.association(this.search);
+ "&inGuaranteePeriod=" + item.inGuaranteePeriod if (res && res.code == 200) {
+ "&partnerCompanyId=" + item.partnerCompanyId this.associationList = res.data;
+ "&auditResultsId=" + (item.auditResults?Object.keys(item.auditResults)[Object.keys(item.auditResults).length - 1]:'') }
+ "&maintainStep=" + item.maintainStep this.highlights();
}) },
}, /** 搜索关键字变更 */
handleClick(item, type, showCountTime) { // type:类型,showCountTime:是否显示倒计时。详情页面情况太多,提前传值可以避免页面晃动 keywordChange(value) {
//type类型 if (this.$u.test.isEmpty(value)) {
// 'waitAccept': 待接单、待抢单;'waitAppointment': 待预约;'waitCheckIn': 待签到;'waitFinish': 待完工;'audit': 审核中;'exception': 异常单;'finish': 已完工;'other': 工单结算信息 this.associationList = [];
uni.navigateTo({ } else {
url: 'pages/order/detail?id=' + item.orderId + '&type=' + type + '&showCountTime=' + showCountTime this.associationOrder();
}) }
}, },
}, /** 获得焦点 */
} onfocus() {
this.focused = true;
},
/** 失去焦点 */
loseFocus() {
},
// 页面数据
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> </script>
<style lang="scss"> <style lang="scss">
.search-wrap { .search-wrap {
.top-item { display: flex;
position: sticky; flex-direction: column;
padding: 20rpx 0; height: 100vh;
top: 0rpx; .top-item {
background-color: #F4F5F7; position: sticky;
z-index: 2; padding: 20rpx 0;
/deep/ .u-search .u-content { top: 0rpx;
padding: 0 20rpx 0 40rpx; background-color: #f4f5f7;
} z-index: 2;
/deep/ .u-search .u-input { /deep/ .u-search .u-content {
margin: 0 24rpx; padding: 0 20rpx 0 40rpx;
} }
/deep/ .u-search .u-icon--right .u-iconfont { /deep/ .u-search .u-input {
font-size: 36rpx !important; margin: 0 24rpx;
} }
/deep/ .u-search .u-close-wrap .u-iconfont { /deep/ .u-search .u-icon--right .u-iconfont {
color: #CCCCCC; font-size: 36rpx !important;
} }
} /deep/ .u-search .u-close-wrap .u-iconfont {
color: #cccccc;
.content-item { }
padding: 10rpx 30rpx 20rpx 30rpx; }
.empty-result { .content-item {
padding-top: 354rpx; padding: 10rpx 30rpx 20rpx 30rpx;
display: flex;
flex-direction: column; .empty-result {
justify-content: center; padding-top: 354rpx;
align-items: center; display: flex;
.empty-message { flex-direction: column;
padding-top: 28rpx; justify-content: center;
font-size: 28rpx; align-items: center;
font-weight: 400; .empty-message {
color: #666666; padding-top: 28rpx;
line-height: 28rpx; font-size: 28rpx;
} font-weight: 400;
} color: #666666;
line-height: 28rpx;
} }
}
}
.association-wrap {
height: 100%;
padding-bottom: 44rpx;
overflow: auto;
.association-cell {
display: flex;
padding: 26rpx 32rpx;
font-size: 28rpx;
line-height: 54rpx;
color: #606266;
background: #ffffff;
}
}
} }
</style> </style>
...@@ -23,8 +23,10 @@ ...@@ -23,8 +23,10 @@
<!-- <text class="rightContent u-m-t-14 u-m-l-30 u-p-b-30">{{item.describe}}</text> --> <!-- <text class="rightContent u-m-t-14 u-m-l-30 u-p-b-30">{{item.describe}}</text> -->
</view> </view>
<view class="rightImageView" v-if="item.orderImages && item.orderImages.length > 0"> <view class="rightImageView" v-if="item.orderImages && item.orderImages.length > 0">
<image class="rightImage" v-for="(image, index) in item.orderImages" :src="image" <u-image class="rightImage" v-for="(image, index) in item.orderImages" :src="image + '?imageView2/1/w/100/h/100/q/75'"
:key="index" @click.stop="handleClickImage(item, index)" mode="aspectFill"></image> :key="index" @tap.stop="handleClickImage(item, index)" width="116" height="116">
<view slot="error" style="font-size: 24rpx;">上传中</view>
</u-image>
</view> </view>
</view> </view>
</template> </template>
...@@ -419,8 +421,8 @@ ...@@ -419,8 +421,8 @@
.rightImage { .rightImage {
background-color: #F3F3F3; background-color: #F3F3F3;
width: 116rpx; /* width: 116rpx;
height: 116rpx; height: 116rpx; */
margin: 0rpx 12rpx 12rpx 0rpx; margin: 0rpx 12rpx 12rpx 0rpx;
} }
......
...@@ -183,10 +183,10 @@ uploader.requestError = function(e) { ...@@ -183,10 +183,10 @@ uploader.requestError = function(e) {
if (e.statusCode === 0) { if (e.statusCode === 0) {
throw e; throw e;
} else { } else {
uni.showToast({ // uni.showToast({
title: "当前网络信号较差,请耐心等待或尝试切换网络环境", // title: "当前网络信号较差,请耐心等待或尝试切换网络环境",
icon: "none" // icon: "none"
}); // });
} }
} }
export default uploader; export default uploader;
...@@ -12,7 +12,7 @@ try { ...@@ -12,7 +12,7 @@ try {
} }
// 需要永久存储,且下次APP启动需要取出的,在state中的变量名 // 需要永久存储,且下次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', 'uploadTotal', 'uploadSuccess', 'vuex_superuser'];
// 保存变量到本地存储中 // 保存变量到本地存储中
const saveLifeData = function(key, value) { const saveLifeData = function(key, value) {
...@@ -34,6 +34,7 @@ const store = new Vuex.Store({ ...@@ -34,6 +34,7 @@ const store = new Vuex.Store({
vuex_token: lifeData.vuex_token ? lifeData.vuex_token : '', vuex_token: lifeData.vuex_token ? lifeData.vuex_token : '',
vuex_cache: lifeData.vuex_cache ? lifeData.vuex_cache : {}, vuex_cache: lifeData.vuex_cache ? lifeData.vuex_cache : {},
vuex_superuser: lifeData.vuex_superuser || false, 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_version: '1.0.1',
vuex_config: {}, vuex_config: {},
// 入驻信息 // 入驻信息
...@@ -42,7 +43,13 @@ const store = new Vuex.Store({ ...@@ -42,7 +43,13 @@ const store = new Vuex.Store({
// 授权用户信息 // 授权用户信息
vuex_auth_user: {}, vuex_auth_user: {},
// 上传队列 // 上传队列
uploadTask: lifeData.uploadTask ? lifeData.uploadTask : [] uploadTask: lifeData.uploadTask ? lifeData.uploadTask : [],
// 上传状态 1 未开始 2 上传中 3 上传中断
uploadStatus: 1,
// 上传总数量
uploadTotal: lifeData.uploadTotal ? lifeData.uploadTotal : 0,
// 已上传数量
uploadSuccess: lifeData.uploadSuccess ? lifeData.uploadSuccess : 0,
}, },
mutations: { mutations: {
$uStore(state, payload) { $uStore(state, payload) {
......
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