Commit 2287d568 authored by Morson's avatar Morson

开启分包优化

登录页面重复授权问题修复
预约时间问题修复
微信小程序用户接口提示问题修改
parent eea3f433
...@@ -6,6 +6,10 @@ ...@@ -6,6 +6,10 @@
"versionCode" : "100", "versionCode" : "100",
"transformPx" : false, "transformPx" : false,
"app-plus" : { "app-plus" : {
"optimization": {
"subPackages": true
},
"runmode" : "liberate", // 开启分包优化后,必须配置资源释放模式
/* 5+App特有相关 */ /* 5+App特有相关 */
"usingComponents" : true, "usingComponents" : true,
"splashscreen" : { "splashscreen" : {
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
} }
}, },
{ {
"path": "pages/order/index", "path": "pages/index/order",
"style": { "style": {
"navigationBarTitleText": "订单", "navigationBarTitleText": "订单",
"navigationStyle": "custom", "navigationStyle": "custom",
...@@ -23,31 +23,14 @@ ...@@ -23,31 +23,14 @@
} }
}, },
{ {
"path": "pages/order/complete", "path": "pages/index/learn",
"style": { "style": {
"navigationBarTitleText": "订单-完工配置", "navigationBarTitleText": "学习",
"navigationStyle": "custom", "navigationStyle":"custom"//隐藏系统导航栏
"disableScroll": true
}
},{
"path": "pages/order/feedback",
"style": {
"navigationBarTitleText": "订单-过程反馈",
"enablePullDownRefresh": false,
"navigationStyle": "custom", // 隐藏系统导航栏
"disableScroll": true
}
},{
"path": "pages/order/refuse",
"style": {
"navigationBarTitleText": "订单-拒单",
"enablePullDownRefresh": false,
"navigationStyle": "custom", // 隐藏系统导航栏
"disableScroll": true
} }
}, },
{ {
"path": "pages/mine/index", "path": "pages/index/mine",
"style": { "style": {
"navigationBarTitleText": "我的", "navigationBarTitleText": "我的",
"navigationStyle": "custom" "navigationStyle": "custom"
...@@ -58,147 +41,122 @@ ...@@ -58,147 +41,122 @@
"style": { "style": {
"navigationBarTitleText": "授权登录" "navigationBarTitleText": "授权登录"
} }
}, }
],
"subPackages": [{
"root": "pages/exam",
"pages": [
{ {
"path": "pages/settle/index", "path": "start",
"style": { "style": {
"navigationBarTitleText": "入驻", "navigationBarTitleText": "考试"
"navigationStyle": "custom", // 隐藏系统导航栏
"disableScroll": true
} }
}, },
{ {
"path": "pages/settle/base", "path": "index",
"style": { "style": {
"navigationBarTitleText": "入驻", "navigationBarTitleText": "入驻考试",
"navigationStyle": "custom", "navigationStyle": "custom",
"disableScroll": true "disableScroll": true
} }
},
{
"path": "pages/learn/index",
"style": {
"navigationBarTitleText": "学习",
"navigationStyle":"custom"//隐藏系统导航栏
} }
]
}, },
{ {
"path": "pages/learn/assessment", "root": "pages/learn",
"pages": [
{
"path": "assessment",
"style": { "style": {
"navigationBarTitleText": "认证介绍", "navigationBarTitleText": "认证介绍",
"navigationStyle":"custom" "navigationStyle":"custom"
} }
}, },
{ {
"path": "pages/learn/answer", "path": "answer",
"style": { "style": {
"navigationBarTitleText": "考试答题", "navigationBarTitleText": "考试答题",
"navigationStyle":"custom" "navigationStyle":"custom"
} }
}, },
{ {
"path":"pages/learn/result", "path":"result",
"style":{ "style":{
"navigationBarTitleText":"考试答题" "navigationBarTitleText":"考试答题"
} }
}, },
{ {
"path": "pages/learn/news-details", "path": "news-details",
"style": { "style": {
"navigationBarTitleText": "" "navigationBarTitleText": ""
} }
}, },
{ {
"path":"pages/learn/section", "path":"section",
"style" :{ "style" :{
"navigationBarTitleText": "" "navigationBarTitleText": ""
} }
}, },
{ {
"path": "pages/learn/curriculum", "path": "curriculum",
"style": { "style": {
"navigationBarTitleText": "" "navigationBarTitleText": ""
} }
}, },
{ {
"path": "pages/settle/select", "path": "exam",
"style": { "style": {
"navigationBarTitleText": "选择可服务的城市", "navigationBarTitleText": "在线考试",
"navigationBarBackgroundColor": "#FFFFFF", "enablePullDownRefresh": false,
"navigationStyle": "custom", // 隐藏系统导航栏
"disableScroll": true "disableScroll": true
} }
}, },
{ {
"path": "pages/settle/pay-ensure", "path": "course-detail",
"style": { "style": {
"navigationBarTitleText": "缴纳设备押金", "navigationBarTitleText": "培训视频",
"navigationStyle": "custom", "enablePullDownRefresh": false
"disableScroll": true
} }
},
{
"path": "pages/settle/prompt",
"style": {
"navigationBarTitleText": "入驻提示",
"navigationStyle": "custom",
"disableScroll": true
} }
]
}, },
{ {
"path": "pages/settle/web", "root": "pages/mine",
"style": { "pages": []
"navigationBarTitleText": "签约页面"
}
}, },
{ {
"path": "pages/settle/sign-contract", "root": "pages/order",
"style": { "pages": [
"navigationBarTitleText": "签约页面",
"navigationStyle": "custom", // 隐藏系统导航栏
"disableScroll": true
}
},
{ {
"path": "pages/settle/file", "path": "complete",
"style": { "style": {
"navigationBarTitleText": "入驻资料", "navigationBarTitleText": "订单-完工配置",
"navigationStyle": "custom", "navigationStyle": "custom",
"disableScroll": true "disableScroll": true
} }
}, },
{ {
"path": "pages/exam/start", "path": "feedback",
"style": {
"navigationBarTitleText": "考试"
}
},
{
"path": "pages/exam/index",
"style": { "style": {
"navigationBarTitleText": "入驻考试", "navigationBarTitleText": "订单-过程反馈",
"navigationStyle": "custom", "enablePullDownRefresh": false,
"navigationStyle": "custom", // 隐藏系统导航栏
"disableScroll": true "disableScroll": true
} }
}, },
{ {
"path": "pages/learn/exam", "path": "refuse",
"style": { "style": {
"navigationBarTitleText": "在线考试", "navigationBarTitleText": "订单-拒单",
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"navigationStyle": "custom", // 隐藏系统导航栏 "navigationStyle": "custom", // 隐藏系统导航栏
"disableScroll": true "disableScroll": true
} }
}, },
{ {
"path": "pages/learn/course-detail",
"style": {
"navigationBarTitleText": "培训视频",
"enablePullDownRefresh": false
}
}
,{
// 订单详情页 // 订单详情页
"path" : "pages/order/detail", "path" : "detail",
"style" : "style" :
{ {
"navigationStyle": "custom"// 隐藏系统导航栏 "navigationStyle": "custom"// 隐藏系统导航栏
...@@ -206,7 +164,22 @@ ...@@ -206,7 +164,22 @@
}, },
{ {
"path": "pages/photo/index", // 订单搜索页
"path" : "search",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor":"#F4F5F7"
}
}
]
},
{
"root": "pages/photo",
"pages": [
{
"path": "index",
"style": { "style": {
"navigationBarTitleText": "拍照小工具", "navigationBarTitleText": "拍照小工具",
"navigationBarBackgroundColor":"#FFFFFF", "navigationBarBackgroundColor":"#FFFFFF",
...@@ -214,7 +187,7 @@ ...@@ -214,7 +187,7 @@
} }
}, },
{ {
"path": "pages/photo/setting", "path": "setting",
"style": { "style": {
"navigationBarTitleText": "水印设置", "navigationBarTitleText": "水印设置",
"navigationBarBackgroundColor":"#FFFFFF", "navigationBarBackgroundColor":"#FFFFFF",
...@@ -225,7 +198,7 @@ ...@@ -225,7 +198,7 @@
} }
}, },
{ {
"path": "pages/photo/take", "path": "take",
"style": { "style": {
"navigationStyle":"custom", "navigationStyle":"custom",
"navigationBarTitleText": "拍照", "navigationBarTitleText": "拍照",
...@@ -235,7 +208,7 @@ ...@@ -235,7 +208,7 @@
} }
}, },
{ {
"path": "pages/photo/preview", "path": "preview",
"style": { "style": {
"navigationBarTitleText": "照片预览", "navigationBarTitleText": "照片预览",
"navigationBarBackgroundColor":"#333333", "navigationBarBackgroundColor":"#333333",
...@@ -243,27 +216,90 @@ ...@@ -243,27 +216,90 @@
"navigationBarTextStyle":"white" "navigationBarTextStyle":"white"
} }
}, },
{ {
"path": "pages/photo/list", "path": "list",
"style": { "style": {
"navigationBarTitleText": "规范展示", "navigationBarTitleText": "规范展示",
"navigationBarBackgroundColor":"#FFFFFF", "navigationBarBackgroundColor":"#FFFFFF",
"backgroundColor":"#F4F5F7" "backgroundColor":"#F4F5F7"
} }
} }
]
,{ },
"path" : "pages/order/search",
"style" :
{ {
"navigationBarTitleText": "", "root": "pages/settle",
"enablePullDownRefresh": false, "pages": [
"navigationBarBackgroundColor":"#F4F5F7" {
"path": "index",
"style": {
"navigationBarTitleText": "入驻",
"navigationStyle": "custom", // 隐藏系统导航栏
"disableScroll": true
} }
},
{
"path": "base",
"style": {
"navigationBarTitleText": "入驻",
"navigationStyle": "custom",
"disableScroll": true
}
},
{
"path": "select",
"style": {
"navigationBarTitleText": "选择可服务的城市",
"navigationBarBackgroundColor": "#FFFFFF",
"disableScroll": true
}
},
{
"path": "pay-ensure",
"style": {
"navigationBarTitleText": "缴纳设备押金",
"navigationStyle": "custom",
"disableScroll": true
}
},
{
"path": "prompt",
"style": {
"navigationBarTitleText": "入驻提示",
"navigationStyle": "custom",
"disableScroll": true
}
},
{
"path": "web",
"style": {
"navigationBarTitleText": "签约页面"
}
},
{
"path": "sign-contract",
"style": {
"navigationBarTitleText": "签约页面",
"navigationStyle": "custom", // 隐藏系统导航栏
"disableScroll": true
}
},
{
"path": "file",
"style": {
"navigationBarTitleText": "入驻资料",
"navigationStyle": "custom",
"disableScroll": true
}
}
]
} }
], ],
"preloadRule": {
"pages/index/index": {
"network": "all",
"packages": ["pages/order", "pages/learn"]
}
},
"globalStyle": { "globalStyle": {
"navigationBarTextStyle": "black", "navigationBarTextStyle": "black",
"navigationBarTitleText": "uni-app", "navigationBarTitleText": "uni-app",
...@@ -283,19 +319,19 @@ ...@@ -283,19 +319,19 @@
"text": "首页" "text": "首页"
}, },
{ {
"pagePath": "pages/order/index", "pagePath": "pages/index/order",
"iconPath": "static/tab/dingdan-0@3x.png", "iconPath": "static/tab/dingdan-0@3x.png",
"selectedIconPath": "static/tab/dingdan-1@3x.png", "selectedIconPath": "static/tab/dingdan-1@3x.png",
"text": "订单" "text": "订单"
}, },
{ {
"pagePath": "pages/learn/index", "pagePath": "pages/index/learn",
"iconPath": "static/tab/xuexi-0@3x.png", "iconPath": "static/tab/xuexi-0@3x.png",
"selectedIconPath": "static/tab/xuexi-1@3x.png", "selectedIconPath": "static/tab/xuexi-1@3x.png",
"text": "学习" "text": "学习"
}, },
{ {
"pagePath": "pages/mine/index", "pagePath": "pages/index/mine",
"iconPath": "static/tab/wode-0@3x.png", "iconPath": "static/tab/wode-0@3x.png",
"selectedIconPath": "static/tab/wode-1@3x.png", "selectedIconPath": "static/tab/wode-1@3x.png",
"text": "我的" "text": "我的"
...@@ -312,7 +348,7 @@ ...@@ -312,7 +348,7 @@
}, },
{ {
"name": "订单列表", //模式名称 "name": "订单列表", //模式名称
"path": "pages/order/index", //启动页面,必选 "path": "pages/index/order", //启动页面,必选
"query": "" //启动参数,在页面的onLoad函数里面得到 "query": "" //启动参数,在页面的onLoad函数里面得到
}, },
{ {
......
...@@ -160,13 +160,19 @@ export default { ...@@ -160,13 +160,19 @@ export default {
if(pages.length) { if(pages.length) {
let index = pages.length - 1; let index = pages.length - 1;
if(index) { if(index) {
let prevPage = pages[pages.length - 1]; //上一个页面 let prevPage = pages[index]; //上一个页面
if(prevPage.route == "pages/login/index") {
uni.navigateTo({
url:'pages/index/index'
})
} else {
if (prevPage && prevPage.$vm) { if (prevPage && prevPage.$vm) {
prevPage.$vm.isRefresh = true; prevPage.$vm.isRefresh = true;
} }
uni.navigateBack({ uni.navigateBack({
delta: 1 delta: 1
}) })
}
} else { } else {
uni.navigateTo({ uni.navigateTo({
url:'pages/index/index' url:'pages/index/index'
...@@ -174,7 +180,7 @@ export default { ...@@ -174,7 +180,7 @@ export default {
} }
} else { } else {
uni.navigateTo({ uni.navigateTo({
url: "pages/mine/index" url: "pages/index/mine"
}) })
} }
......
<template>
<view>
<u-navbar v-if="!takeStatus" :is-back="false" :title-size="26" title-color="#000" title="我的"></u-navbar>
<view v-if="!takeStatus">
<view class="u-flex user-box u-p-l-30 u-p-r-20 u-p-b-30">
<view class="u-m-r-10">
<u-avatar :src="pic" size="140"></u-avatar>
</view>
<view class="u-flex-1">
<view class="u-font-18 u-p-b-20">uView ui</view>
<view class="u-font-14 u-tips-color">微信号:helang_uView</view>
</view>
</view>
<view class="u-m-t-20">
<u-cell-group>
<u-cell-item v-for="(item, index) in items" :title="item.title" :value="item.value" :key="index">
<u-icon slot="icon" size="32" name="search"></u-icon>
</u-cell-item>
</u-cell-group>
</view>
<view class="u-m-t-20">
<u-cell-group>
<u-cell-item icon="setting" title="设置"></u-cell-item>
</u-cell-group>
</view>
<view class="u-m-t-20" @click="take">
<u-cell-group>
<u-cell-item icon="setting" title="相机组件测试"></u-cell-item>
</u-cell-group>
</view>
</view>
<take-photo v-if="takeStatus" :currentItem="testData" @close="closeTake"></take-photo>
</view>
</template>
<script>
import takePhoto from '@/components/take/index.vue'
export default {
components: {
'take-photo': takePhoto
},
data() {
return {
pic:'https://uviewui.com/common/logo.png',
show:true,
takeStatus: false,
testData: {
_id: '1', // 规格ID
system_id: '2', // 系统ID
brand_id: '3', // 品牌ID
classify_id: '4', // 分类ID
images: [ // 拍照要求示意图
'https://qn-static.banshouhui.com/live_mark.png',
'https://qn-static.banshouhui.com/live_mark.png',
'https://qn-static.banshouhui.com/live_mark.png'
],
main_point: [] // 要点
}
}
},
computed: {
items() {
return [
{title: '我的钱包', value: '', icon: ''},
{title: '我的质保金', value: '', icon: ''},
{title: '我的合同', value: '', icon: ''},
{title: '我的证件', value: '', icon: ''},
{title: '我的收货地址', value: '', icon: ''},
{title: '我的仓库', value: '', icon: ''},
{title: '联系客服', value: '6666666', icon: ''}]
}
},
onLoad() {
},
methods: {
take() {
uni.hideTabBar()
this.takeStatus = true
},
closeTake(img) {
console.log(img)
this.takeStatus = false
}
}
}
</script>
<style lang="scss" scoped>
</style>
...@@ -319,7 +319,7 @@ ...@@ -319,7 +319,7 @@
}, },
confirm(){// 检查结果窗口 确认回调 confirm(){// 检查结果窗口 确认回调
uni.navigateTo({ uni.navigateTo({
url: 'pages/order/index' url: 'pages/index/order'
}) })
}, },
closeCheckResult(){// 检查结果窗口取消回调 closeCheckResult(){// 检查结果窗口取消回调
......
...@@ -156,7 +156,7 @@ ...@@ -156,7 +156,7 @@
import appointTime from '@/components/appoint/appoint-time.vue' import appointTime from '@/components/appoint/appoint-time.vue'
import takePhoto from '@/components/take/index.vue' import takePhoto from '@/components/take/index.vue'
import PopView from "@/components/popView/index.vue" import PopView from "@/components/popView/index.vue"
let now = Date.now() let now = new Date(new Date().toLocaleDateString()).getTime();
let r = require("../../libs/bmap-wx.min.js"); let r = require("../../libs/bmap-wx.min.js");
let h = new r.BMapWX({ let h = new r.BMapWX({
// ak: "rpVq5d3yxaRCoKzVwmFMo0o4iC524CAG", // ak: "rpVq5d3yxaRCoKzVwmFMo0o4iC524CAG",
...@@ -458,6 +458,7 @@ ...@@ -458,6 +458,7 @@
console.log(data,'dateChange') console.log(data,'dateChange')
let self = this let self = this
self.appointmentDatetime = data.item.day self.appointmentDatetime = data.item.day
self.appointmentDatetimeRange = null
self.timeList.map((item, index) => { self.timeList.map((item, index) => {
if(data.item.timeRange.indexOf(item.pkey) > -1) { if(data.item.timeRange.indexOf(item.pkey) > -1) {
item.disabled = true item.disabled = true
...@@ -546,15 +547,15 @@ ...@@ -546,15 +547,15 @@
data.orderId = this.order.orderId data.orderId = this.order.orderId
}else if(this.submitType === 'workerAppointment'){ // 预约 }else if(this.submitType === 'workerAppointment'){ // 预约
data.appointmentDatetime =this.appointmentDatetime data.appointmentDatetime =this.appointmentDatetime
data.appointmentDatetimeRange = this.appointmentDatetimeRange.pkey
if(!data.appointmentDatetime ){ if(!data.appointmentDatetime ){
this.commonToast('请选择预约日期','waring') this.commonToast('请选择预约日期','waring')
return return
} }
if( !data.appointmentDatetimeRange ){ if( !this.appointmentDatetimeRange || !this.appointmentDatetimeRange.pkey ){
this.commonToast('请选择预约时间段','waring') this.commonToast('请选择预约时间段','waring')
return return
} }
data.appointmentDatetimeRange = this.appointmentDatetimeRange.pkey
}else if (this.submitType === 'maintainWorkerCheckin') { // 签到 }else if (this.submitType === 'maintainWorkerCheckin') { // 签到
// 检查见到距离是否符合 // 检查见到距离是否符合
if(!this.isErrorSign){ if(!this.isErrorSign){
...@@ -708,7 +709,7 @@ ...@@ -708,7 +709,7 @@
this.visibale = false this.visibale = false
// 交互规范 // 交互规范
uni.switchTab({ uni.switchTab({
url: 'pages/learn/index' url: 'pages/index/learn'
}) })
}, },
threeDays() { threeDays() {
......
...@@ -121,11 +121,10 @@ export default { ...@@ -121,11 +121,10 @@ export default {
reasonType: '报备', // 反馈类型 reasonType: '报备', // 反馈类型
reasonRelegation: '客户', // 反馈归属 reasonRelegation: '客户', // 反馈归属
reason: '', // 反馈原因 reason: '', // 反馈原因
appointmentDatetime: null, // 预约时间
appointmentDatetimeRange: '', // 预约时间段类型
nextTraceDatetime: '', // 下次跟踪时间
remark: '' // 备注 remark: '' // 备注
}, },
traceDate: null, // 反馈时间
timeRange: null, // 反馈时间段
dateItem: null, dateItem: null,
timeItem: null, timeItem: null,
showRemark: false, showRemark: false,
...@@ -139,24 +138,16 @@ export default { ...@@ -139,24 +138,16 @@ export default {
appointTime appointTime
}, },
watch: { watch: {
vuex_token(val) { // vuex_token(val) {
this.initPageData(); // this.initPageData();
} // }
}, },
computed: { computed: {
disabledSubmit() { disabledSubmit() {
let self = this; let self = this;
if(self.trace.reasonRelegation && self.trace.reason) { if(self.trace.reasonRelegation && self.trace.reason && self.traceDate && self.timeRange) {
if (self.trace.reasonType == '改约') {
if (self.trace.appointmentDatetime && self.trace.appointmentDatetimeRange) {
return false;
}
} else {
if (self.trace.nextTraceDatetime && self.trace.appointmentDatetimeRange) {
return false; return false;
} }
}
}
return true; return true;
} }
...@@ -222,9 +213,8 @@ export default { ...@@ -222,9 +213,8 @@ export default {
self.trace.reason = tabList['owns'][self.curOwn]['types'][0]; self.trace.reason = tabList['owns'][self.curOwn]['types'][0];
self.appointTitle = self.appoint[self.curTab] self.appointTitle = self.appoint[self.curTab]
self.trace.remark = ''; self.trace.remark = '';
self.trace.appointmentDatetime = null; self.traceDate = null;
self.trace.appointmentDatetimeRange = null; self.timeRange = null;
self.trace.nextTraceDatetime = null;
if (self.trace.reasonType == '改约') { if (self.trace.reasonType == '改约') {
self.showRemark = true; self.showRemark = true;
if (self.dateList && self.timeList) { if (self.dateList && self.timeList) {
...@@ -300,12 +290,9 @@ export default { ...@@ -300,12 +290,9 @@ export default {
}, },
dateChange(data) { dateChange(data) {
// 点击日期选择 // 点击日期选择
console.log(data, 'week-data');
let self = this; let self = this;
self.dateItem = data.item self.dateItem = data.item
if (self.trace.reasonType == '改约') { if (self.trace.reasonType == '改约') {
self.trace.appointmentDatetime = data.item.day;
self.trace.nextTraceDatetime = null;
self.timeList.map((item, index) => { self.timeList.map((item, index) => {
if (data.item.timeRange.indexOf(item.pkey) > -1) { if (data.item.timeRange.indexOf(item.pkey) > -1) {
item.disabled = true; item.disabled = true;
...@@ -314,18 +301,17 @@ export default { ...@@ -314,18 +301,17 @@ export default {
} }
}); });
} else { } else {
self.trace.appointmentDatetime = null;
self.trace.nextTraceDatetime = data.item.day;
self.timeList.map((item, index) => { self.timeList.map((item, index) => {
item.disabled = false; item.disabled = false;
}); });
} }
self.trace.appointmentDatetimeRange = ''; self.traceDate = data.item.day;
self.timeRange = null;
}, },
timeChange(data) { timeChange(data) {
// 时间段选择变化 // 时间段选择变化
console.log(data, 'week-data'); console.log(data, 'week-data');
this.trace.appointmentDatetimeRange = data.item.pkey; this.timeRange = data.item.pkey;
this.timeItem = data.item this.timeItem = data.item
}, },
async submitForm() { async submitForm() {
...@@ -341,15 +327,16 @@ export default { ...@@ -341,15 +327,16 @@ export default {
self.submiting = true; self.submiting = true;
let params = this.$u.deepClone(self.trace); let params = this.$u.deepClone(self.trace);
if(self.trace.reasonType != '改约') { if(self.trace.reasonType != '改约') {
params.appointmentDatetimeRange = null if(self.timeItem && self.timeItem.pkey && self.traceDate){
params.appointmentDatetime = null let traceDate = self.moment(self.traceDate);
if(self.timeItem && self.timeItem.pkey && params.nextTraceDatetime){
let traceDate = self.moment(params.nextTraceDatetime);
let timeArr = self.timeItem.pkey.split("_") let timeArr = self.timeItem.pkey.split("_")
let hours = timeArr && timeArr.length && timeArr.pop() let hours = timeArr && timeArr.length && timeArr.pop()
let traceDateTime = traceDate.clone().add(Number(hours), 'hours'); let traceDateTime = traceDate.clone().add(Number(hours), 'hours');
params.nextTraceDatetime = traceDateTime.unix() * 1000 params.nextTraceDatetime = traceDateTime.unix() * 1000
} }
} else {
params.appointmentDatetime = self.traceDate
params.appointmentDatetimeRange = self.timeRange
} }
let res = await self.$u.api.traceAndAppointment(params, self.orderId); let res = await self.$u.api.traceAndAppointment(params, self.orderId);
self.submiting = false; self.submiting = false;
......
<template>
<TabBarPage title="订单" :fixed="true">
<!-- <view class="wrap"> -->
<view class="tools-box">
<view class="search-sub">
<u-subsection :current="curNow" :list="subList" active-color="white" bg-color="white"
inactive-color="#666" button-color="#2272FF" border-radius="36" @change="sectionChange" height="72"
bold>
</u-subsection>
</view>
<view class="search-btn" @click="handleClickSearch">
<image class="search-image" mode="widthFix" :src="sousuoImage"></image>
<text class="search-btn-text">搜订单</text>
</view>
</view>
<view class="u-tabs-box" v-show="curNow == 0">
<u-tabs height="66" activeColor="#2272FF" bg-color="none" inactive-color="#999" bar-height="4"
bar-width="44" :offset="[0,0]" :list="list" count="total" :current="current" @change="change"
:is-scroll="false" font-size="28" bold></u-tabs>
</view>
<view class="tab-view">
<!-- <swiper-item class="swiper-item" v-for="(res, ind) in orderList" :key="ind"> -->
<scroll-view scroll-y style="height: 100%;width: 100%;" @scrolltolower="reachBottom" scroll-anchoring
scroll-y="true" refresher-enabled="true" :refresher-triggered="triggered" :refresher-threshold="100"
refresher-background="#F4F5F7" @refresherpulling="triggered = true" @refresherrefresh="onRefresh"
@refresherrestore="onRestore" @refresherabort="onAbort">
<NoOrder v-if="noMore" customStyle="margin-top: 100rpx;background-color: #F4F5F7" />
<template v-else>
<view v-for="(item, index) in orderList" :key="item.orderId">
<OrderCell :orderData="item" :type="orderType" :location="dataValue" @click="handleClick(item)"
@action="handleAction(item)"> </OrderCell>
</view>
<u-loadmore :status="loadStatus" bgColor="#F4F5F7"></u-loadmore>
</template>
</scroll-view>
<!-- </swiper-item> -->
</view>
<!-- </view> -->
<PopView title="aaaa" message="bbbb" :visible="visibale" />
</TabBarPage>
</template>
<script>
import TabBarPage from "@/components/tabBarList/index.vue"
import OrderCell from "@/components/order/index.vue"
import NoOrder from "@/components/order/noOrder.vue"
export default {
components: {
TabBarPage,
OrderCell,
NoOrder
},
data() {
return {
visibale: false,
showSview: true,
curNow: 0,
pageNumber: 0,
pageSize: 100,
orderList: [],
list: [{
name: '待预约',
total: 0,
},
{
name: '待签到',
total: 0,
},
{
name: '待完工',
total: 0,
},
{
name: '审核中',
total: 0,
},
{
name: '异常单',
total: 0,
}
],
current: 0,
loadStatus: 'loading',
dataValue: [],
loaded: false,
triggered: false,
_freshing: false,
};
},
onLoad() {
this._freshing = false;
this.getLocation();
// this.getOrderCount();
// this.getOrderList(0);
},
onShow() {
this.getOrderCount()
this.getOrderList(this.currentIndex);
},
computed: {
subList() {
return ['待受理', '已完工']
},
// 0:'去预约', 1:'去签到', 2:'去完工', 3:'审核中', 4:'去处理', 5'已完工'
orderType() {
return this.indexStatus[this.currentIndex]
},
currentIndex() {
return this.curNow == 0 ? this.current : 5
},
sousuoImage() {
return process.uniEnv.qn_base_url + 'sousuo.png'
},
types() {
return {
'waitAppointment': 0, // 待预约、
'waitCheckIn': 1, // 待签到、
'waitFinish': 2, // 待完工、
'audit': 3, // 审核中、
'exception': 4, // 异常单、
'finish': 5, //已完工
}
},
//waitAccept、waitAppointment、waitCheckIn、waitFinish、exception、finish
indexStatus() {
return {
0: 'waitAppointment',
1: 'waitCheckIn',
2: 'waitFinish',
3: 'audit',
4: 'exception',
5: 'finish'
}
},
noMore() {
console.log('nomore:', this.orderList.length == 0 && this.pageNumber != 0)
return this.orderList.length == 0 && this.loaded
}
},
methods: {
sectionChange(index) {
this.curNow = index;
this.pageNumber = 0
this.orderList = []
this.loadStatus = 'loading'
this.getOrderList(this.currentIndex)
},
// tab栏切换
change(index) {
this.current = index;
this.pageNumber = 0
this.orderList = []
this.loadStatus = 'loading'
this.getOrderList(index);
},
/**
* 获取当前位置的经纬度
*/
getLocation() {
let self = this
const dataValue = this.dataValue || []
const waterInfo = this.waterInfo
uni.getLocation({
type: 'gcj02',
success: function(res) {
dataValue.push(res.longitude)
dataValue.push(res.latitude)
self.dataValue = dataValue
},
fail(err) {
}
});
},
reachBottom(e) {
console.log('-------底部-------', this.loadStatus)
if (this.loadStatus != 'loadmore') return
this.loadStatus == 'loading'
this.getOrderList(this.currentIndex)
},
// 页面数据
getOrderList(index) {
// 状态处理
this.pageNumber += 1
this.loaded = false
var param = {
pageNumber: this.pageNumber,
pageSize: this.pageSize,
keyword: '',
type: this.indexStatus[index]
}
var self = this;
self.$u.api.listOrder(param).then((res) => {
if (res.code == 200) {
/*↓↓↓↓↓↓↓↓↓↓测试数据↓↓↓↓↓↓↓↓↓↓*/
// res.data.type = self.orderType
// if (res.data.list) {
// if (res.data.list.length == 0 && res.data.total > 0) {
// res.data.total = 15
// res.data.list = [{
// orderServiceType: '安装', // 服务类型:安装、维修
// categoryName: '充电桩', // 品类:充电桩
// orderBusinessTypeText: '分配单', // 业务类型:分配单、订单池
// orderNumber: 'OR2021041809827', // 工单编号
// contactName: '郭小清', // 客户信息
// contactPhone: '13631612077', // 联系方式
// contactAddress: '湾街道荔枝花园D座125号', // 详细地址
// contactAddressLatitud: '116.3896', // 联系人地址经度
// contactAddressLongitud: '39.91917', // 联系人地址纬度
// orderStatus: 0, // 工单状态
// appointmentDatetime: '', // 预约时间
// currentWillOverTime: 10000, // 剩余时间
// currentOverTime: new Date().getTime() + 10000, // 超过时间点
// auditDatetime: '2021.04.19 12:45:09', // 审核时间
// submissionTime: '2021.04.19 16:24:48', // 提交时间
// auditResults: {}, // 审核结果
// orderBusinessType: 'R', // 业务类型 R 为抢单
// orderId: '1100000216'
// }]
// res.data.list = [...res.data.list, ...res.data.list, ...res.data.list, ...res.data
// .list,
// ...res.data.list, ...res.data.list, ...res.data.list, ...res.data.list, ...
// res
// .data.list, ...res.data.list
// ]
// }
// }
/*↑↑↑↑↑↑↑↑↑↑测试数据↑↑↑↑↑↑↑↑↑↑↑↑↑*/
// 后台需要返回type,防止数据返回延迟期间点击了其他的tab
if (res.data.type != self.orderType) return
self.triggered = false;
self._freshing = false;
if (res.data.list) {
self.orderList.push(...res.data.list)
if (self.list[self.types[res.data.type]]) {
self.list[self.types[res.data.type]].total = res.data.total
}
self.loadStatus = res.data.total > self.orderList.length ? 'loadmore' : 'nomore'
}
} else {
console.log(res.message, "获取订单数量失败!");
}
this.loaded = true
});
},
// 获取订单数量
getOrderCount() {
var self = this; // 加载订单列表
self.$u.api.listOrderCount().then((res) => {
if (res.code == 200) {
console.log("===", res.data)
if (res.data) {
self.list.forEach(item => {
if (item.name === '待预约') {
item.total = res.data.toAppointmentCount
} else if (item.name === '待签到') {
item.total = res.data.toCheckinCount
} else if (item.name === '待完工') {
item.total = res.data.toFinishCount
} else if (item.name === '审核中') {
item.total = res.data.reviewingCount
} else if (item.name === '异常单') {
item.total = res.data.exceptionCount
}
})
var count = 0
for (var i in res.data) {
count += res.data[i]
}
// 修改tab总数
if (count > 0) {
uni.setTabBarBadge({
index: 1,
text: String(count)
})
} else {
uni.removeTabBarBadge({
index: 1
})
}
}
} else {
console.log(res.message, "获取订单数量失败!");
}
});
},
viewOderItem(orderId) { // 跳转工单详情页面
uni.navigateTo({
url: 'pages/order/detail?id=' + orderId
})
},
handleClick(item) {
if(item.orderStatus===86 || item.orderStatus===88){
this.filish(item)
return
}
console.log('click cell')
this.viewOderItem(item.orderId)
},
filish(item){
// 去完工
uni.navigateTo({
url: 'pages/order/complete?orderId='+item.orderId
+ "&categoryId=" + item.categoryId
+ "&orderServiceType=" + item.orderServiceType
+ "&inGuaranteePeriod=" + item.inGuaranteePeriod
})
},
handleAction(item) {
console.log('click button')
if(item.orderStatus===86 || item.orderStatus===88){
this.filish(item)
return
}
this.viewOderItem(item.orderId)
},
handleClickSearch() {
uni.navigateTo({
url: 'pages/order/search'
})
},
onPulling(e) {
console.log("onpulling", e);
},
onRefresh() {
if (this._freshing) return;
this._freshing = true;
this.pageNumber = 0
this.orderList = []
this.loadStatus = 'loading'
this.getOrderCount();
this.getOrderList(this.currentIndex);
},
onRestore() {
this.triggered = 'restore'; // 需要重置
console.log("onRestore");
},
onAbort() {
console.log("onAbort");
}
}
};
</script>
<style>
/* #ifndef H5 */
page {
height: 100%;
background-color: #f2f2f2;
}
/* #endif */
</style>
<style lang="scss" scoped>
.u-tabs-box {
margin-bottom: 30rpx;
}
.order {
// width: 710rpx;
// background-color: #ffffff;
// margin: 20rpx auto;
// border-radius: 20rpx;
// box-sizing: border-box;
// padding: 20rpx;
// font-size: 28rpx;
.top {
display: flex;
justify-content: space-between;
align-items: center;
.left {
display: flex;
align-items: center;
.tag {
text-align: center;
width: 84rpx;
height: 40rpx;
background: linear-gradient(270deg, #47ABFF 0%, #2272FF 100%);
border-radius: 8rpx;
font-size: 22rpx;
font-weight: 500;
color: #FFFFFF;
line-height: 40rpx;
}
.store {
margin: 0 10rpx;
font-size: 36rpx;
font-weight: bold;
color: #333333;
line-height: 36px;
}
}
.right {
height: 40rpx;
background: #F4F5F7;
border-radius: 22rpx;
padding: 8rpx 16rpx 8rpx 16rpx;
font-size: 22rpx;
line-height: 24rpx;
font-weight: 400;
color: #333333;
}
}
.item {
display: flex;
flex-direction: column;
margin: 20rpx 0 0;
.content {
.title {
font-size: 26rpx;
font-weight: 400;
color: #333333;
line-height: 52rpx;
}
}
.address {
display: flex;
justify-content: space-between;
align-items: center;
font-size: 24rpx;
font-weight: 400;
color: #333333;
line-height: 52rpx;
.left {}
.right {}
}
}
.total {
margin-top: 20rpx;
text-align: right;
font-size: 24rpx;
.total-price {
font-size: 32rpx;
}
}
.bottom {
display: flex;
margin-top: 30rpx;
padding: 0 10rpx;
justify-content: space-between;
align-items: center;
.left {
display: flex;
align-items: center;
justify-content: space-between;
.tag {
text-align: center;
width: 54rpx;
height: 54rpx;
background: #FF930D;
font-size: 26rpx;
font-weight: 500;
color: #FFFFFF;
line-height: 54rpx;
border-radius: 50%;
margin-right: 20rpx;
}
}
.right-btn {
text-align: center;
width: 200rpx;
height: 80rpx;
background: #2272FF;
border-radius: 40rpx;
font-size: 32rpx;
font-weight: 600;
color: #FFFFFF;
line-height: 80rpx;
font-family: PingFangSC-Semibold, PingFang SC;
}
}
}
.centre {
text-align: center;
margin: 200rpx auto;
font-size: 32rpx;
image {
width: 164rpx;
height: 164rpx;
border-radius: 50%;
margin-bottom: 20rpx;
}
.tips {
font-size: 24rpx;
color: #999999;
margin-top: 20rpx;
}
.btn {
margin: 80rpx auto;
width: 200rpx;
border-radius: 32rpx;
line-height: 64rpx;
color: #ffffff;
font-size: 26rpx;
background: linear-gradient(270deg, rgba(249, 116, 90, 1) 0%, rgba(255, 158, 1, 1) 100%);
}
}
.wrap {
display: flex;
flex-direction: column;
height: calc(100vh - var(--window-top));
width: 100%;
}
.tab-view {
height: 100%;
overflow: auto;
padding-bottom: 20rpx;
}
// .swiper-box {
// flex: 1;
// }
// .swiper-item {
// height: 100%;
// .page-box {
// padding-bottom: 20rpx;
// }
// }
.tools-box {
display: flex;
flex-direction: row;
justify-content: space-between;
padding-bottom: 20rpx;
.search-sub {
height: 72rpx;
width: 320rpx;
}
.search-btn {
height: 72rpx;
width: 220rpx;
background-color: #ffffff;
border-radius: 36rpx;
color: #999999;
display: flex;
justify-content: center;
align-items: center;
.search-image {
width: 36rpx;
height: 32rpx;
flex-shrink: 0;
margin-right: 24rpx;
}
.search-btn-text {
line-height: 36rpx;
font-weight: 400;
font-size: 26rpx;
}
}
}
.order-taps {
height: 80rpx;
padding: 8rpx 30rpx 20rpx 30rpx;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
.order-taps-item {
font-size: 28rpx;
font-weight: 400;
color: #999999;
line-height: 20px;
.taps-count {
position: absolute;
font-size: 16rpx;
font-weight: 400;
line-height: 16rpx;
width: 36rpx;
height: 24rpx;
background: #FFFFFF;
border-radius: 16rpx;
border: 2rpx solid #FA5A49;
text-align: center;
color: #FA5A49;
}
}
}
</style>
<template>
</template>
<script>
</script>
<style>
</style>
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
:send-message-img="sendMessageImg" :send-message-img="sendMessageImg"
:show-message-card="showMessageCard" :show-message-card="showMessageCard"
@getphonenumber="getphonenumber" @getphonenumber="getphonenumber"
@getuserinfo="getuserinfo"
@error="error" @error="error"
@opensetting="opensetting" @opensetting="opensetting"
@launchapp="launchapp" @launchapp="launchapp"
...@@ -325,9 +324,9 @@ export default { ...@@ -325,9 +324,9 @@ export default {
getphonenumber(res) { getphonenumber(res) {
this.$emit('getphonenumber', res); this.$emit('getphonenumber', res);
}, },
getuserinfo(res) { // getuserinfo(res) {
this.$emit('getuserinfo', res); // this.$emit('getuserinfo', res);
}, // },
error(res) { error(res) {
this.$emit('error', res); this.$emit('error', res);
}, },
......
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