diff --git a/aircraft/server/index/index.vue b/aircraft/server/index/index.vue index b1cf15f..005eabc 100644 --- a/aircraft/server/index/index.vue +++ b/aircraft/server/index/index.vue @@ -1,7 +1,9 @@ @@ -206,6 +229,29 @@ export default { uploadFileHeader: { 'Authorization':this.$store.state.vuex_token, }, + // 执行任务按钮样式 + customStyle: { + backgroundColor: '#FEE547', + color: '#333333', + fontSize: '30rpx', + fontWeight: 'bold', + fontFamily: 'Source Han Sans SC', + width: '160rpx', + height: '72rpx', + borderRadius: '12rpx', + border: 'none' + }, + deleteCustomStyle:{ + backgroundColor: '#FFFFFF', + color: '#333333', + fontSize: '30rpx', + fontWeight: 'bold', + fontFamily: 'Source Han Sans SC', + width: '160rpx', + height: '70rpx', + borderRadius: '10rpx', + border: '2rpx solid #999999' + }, // 上传文件 fileList: [], //我的页图标基础路径 @@ -224,6 +270,10 @@ export default { closeIcon: 'close.png', // 上传图片图标 uploadIcon: 'upload.png', + // 蒙层 + mask: 'mask.png', + // 飞行任务默认图片 + defaultIcon: 'default.png', // 页面是否滚动到顶 topLevel: 0, // 滚动顶部 @@ -241,8 +291,10 @@ export default { weight: '', photo: '' }, + // 订单详情 + orderDetail: {}, // 当前页 - current: 0 + current: 0, } }, onPageScroll(e) { @@ -251,7 +303,17 @@ export default { else this.topLevel = 1; this.scrollTop = e.scrollTop; }, + onLoad(e) { + this.init(e.id); + }, methods:{ + // 初始化 + async init(id){ + if(!id) return; + let res = await this.$api.orderDetail(id); + if(res) this.orderDetail = res; + else this.$refs.uToast.show({type: 'error',title: "订单详情获取失败!"}); + }, // 设备选择 handleClickPick(){ this.showEquipment = true; @@ -277,6 +339,14 @@ export default { this.current = 0; } this.current += 1; + }, + // 删除任务 + handleDeleteAction(item){ + + }, + // 更改任务状态 + handleChangeAction(item){ + } } } @@ -339,6 +409,54 @@ export default { margin-top: 24rpx; } } + &-content{ + background-size: contain; + margin-top: 16rpx; + background-repeat: no-repeat; + // background: linear-gradient(0deg, #FFF6BD, #FFFDF1); + background-color: #FFFFFF; + box-shadow: 0rpx 6rpx 10rpx 0rpx rgba(200,199,193,0.3); + border-radius: 16rpx; + margin-bottom: 26rpx; + .action-detail{ + margin: 40rpx 20rpx 0; + display: flex; + &-photo{ + margin-right: 20rpx; + } + &-content{ + flex: 1; + display: flex; + flex-direction: column; + font-family: Source Han Sans SC; + font-weight: 400; + font-size: 28rpx; + color: #666666; + .action-device{ + font-weight: bold; + font-size: 32rpx; + color: #333333; + margin-bottom: 16rpx; + } + .action-operator{ + margin-top: 12rpx; + } + } + &-status{ + font-family: Source Han Sans SC; + font-weight: 500; + font-size: 28rpx; + color: #F8B500; + margin-right: 10rpx; + } + } + .action-btns{ + margin-top: 18rpx; + display: flex; + align-items: center; + margin-bottom: 30rpx; + } + } .message-empty{ margin-top: 16rpx; padding: 90rpx 30rpx; diff --git a/aircraft/server/order/order.vue b/aircraft/server/order/order.vue index dec2377..df75523 100644 --- a/aircraft/server/order/order.vue +++ b/aircraft/server/order/order.vue @@ -3,14 +3,14 @@ - + - {{ item.mainOrderStatus }} - 订单类型:{{ item.orderType }} + {{ orderStatus[item.mainOrderStatus] }} + 订单类型:{{ orderTypes[item.orderType] }} - 景区:{{ item.attractionId }} + 景区:{{ scenics[item.attractionId] }} 路线:{{ item.routeName }} @@ -19,19 +19,20 @@ + :src="fileUrl+(customers[item.customerId].gender === '男' ? boyIcon : girlIcon)" /> - {{ item.customerName }} + {{ customers[item.customerId].name }} {{ item.customerPhone }} 执行任务 + :hair-line="false" @click.stop="handleDoAction(item)">执行任务 - + + @@ -70,44 +71,20 @@ export default { girlIcon: 'girl.png', // 男生头像 boyIcon: 'boy.png', + // 订单状态 + orderStatus: { + 0:'未进行', + 1:'进行中', + 2:'已完成', + 3:'已取消' + }, + // 订单类型 + orderTypes: { + 1: '载物', + 2: '载人' + }, // 订单列表 - orders: [{ - id: 1, - mainOrderStatus: '待接单', - orderType: '载物', - attractionId: '白云山', - customerPhone: '13624566325', - routeName: '南门→山顶广场', - gender: 1, - customerName: '李晓霞' - },{ - id: 2, - mainOrderStatus: '待接单', - orderType: '载人', - attractionId: '白云山', - customerPhone: '13624566325', - routeName: '南门→山顶广场', - gender: 0, - customerName: '李道明' - },{ - id: 3, - mainOrderStatus: '待接单', - orderType: '载物', - attractionId: '白云山', - customerPhone: '13624566325', - routeName: '南门→山顶广场', - gender: 1, - customerName: '李晓霞' - },{ - id: 4, - mainOrderStatus: '待接单', - orderType: '载物', - attractionId: '白云山', - customerPhone: '13624566325', - routeName: '南门→山顶广场', - gender: 1, - customerName: '李晓霞' - }], + orders: [], // 执行任务按钮样式 customStyle: { backgroundColor: '#FEE547', @@ -119,20 +96,76 @@ export default { height: '72rpx', borderRadius: '12rpx', border: 'none' - } + }, + // 用户信息 + userMessage: this.$store.state.vuex_token === ''?{}:JSON.parse(this.$store.state.user_message), + // 翻页参数 + form:{ + current: 1, + size: 10, + // 是否结束——loadmore加载更多,loading加载中,nomore无更多 + isFinish: 'nomore', + }, + // 用户列表 + customers: {}, + // 景区列表 + scenics: {} } }, + onLoad() { + this.$nextTick(()=>{ + this.init(); + }) + }, methods:{ // 初始化 async init(){ - + this.form = {size: 10,current: 1,isFinish: 'nomore'}; + // 查询订单列表 + await this.getOrderList(); + // 查询全部客户 + let cusRes = await this.$api.allCustomers(); + if(!cusRes){ + this.$refs.uToast.show({type: 'error',title: "客户获取失败!"}); + }else this.customers = await cusRes.reduce((obj, item) => ({...obj,[item.id]: item}), {})||{}; + // 查询全部景区 + let scenRes = await this.$api.allScenic(); + if(!scenRes) + this.$refs.uToast.show({type: 'error',title: "景区列表获取失败!"}); + else this.scenics = await scenRes.reduce((obj, item) => ({...obj,[item.id]: item.name}), {})||{}; + }, + // 查询订单列表 + async getOrderList(){ + this.form.isFinish = 'loading'; + let ordRes = await this.$api.getOrders(this.form); + if(ordRes){ + const { records, size, total, current } = ordRes; + if(current === 1) this.orders = records || []; + else this.orders.push(...records); + this.form.isFinish = size*current >= total ? 'nomore' : 'loadmore'; + }else{ + this.$refs.uToast.show({type:'error',title: "订单列表获取失败!"}); + this.form.isFinish = 'loadmore'; + } + }, + // 加载更多 + getMore(){ + if(this.form.isFinish === 'nomore') return; + this.form.current++; + this.getOrderList(); }, // 执行任务 handleDoAction(item){ uni.navigateTo({ url: `/aircraft/server/order/detail?id=${item.id}` }) - } + }, + // 查看详情 + showDetail(item){ + uni.navigateTo({ + url: `/aircraft/server/order/add?id=${item.id}` + }) + }, } } diff --git a/common/http.api.js b/common/http.api.js index d779094..3832e63 100644 --- a/common/http.api.js +++ b/common/http.api.js @@ -11,10 +11,18 @@ const install = (Vue, vm) => { vm.$api.aUpdatePass = async (params = {}) => await vm.$u.post(`/api/emEmployees/updatePass`,params);// 修改飞行员密码 vm.$api.bUpdatePass = async (params = {}) => await vm.$u.post(`/cnCustomer/updatePass`,params);// 修改客户密码 - // 区域管理 + // 区域/景区管理 vm.$api.allAreas = async () => await vm.$u.get('/emArea/all');// 获取全部区域 vm.$api.allScenicsByAreaId = async (params = {}) => await vm.$u.get('/emScenic/all',params);// 获取区域下全部景区 + vm.$api.allRoutesByScenicId = async (scenicId) => await vm.$u.get(`/api/dataDropdown/obtainRouteListByScenicId/${scenicId}`);// 根据景区获取对应的线路 + vm.$api.allScenic = async () => await vm.$u.get('/emScenic/all');// 获取全部景区 + vm.$api.singleScenic = async (id) => await vm.$u.get(`/emScenic/${id}`);// 查询单个景区 + // 订单管理 + vm.$api.completeOrder = async (orderId) => await vm.$u.get(`/api/order/completeOrder/${orderId}`);// 完成订单 + vm.$api.getOrders = async (params = {}) => await vm.$u.get('/api/order/allOrder',params);// 获取订单列表 + vm.$api.orderDetail = async (id) => await vm.$u.get(`/api/order/queryOrderDetail/${id}`);// 查询单个订单 + // 客户管理 vm.$api.allCustomers = async () => await vm.$u.get('/cnCustomer/all');// 获取全部客户