From 5848261585664553278a0231493119845405444a Mon Sep 17 00:00:00 2001 From: qb <1191961160@qq.com> Date: Sun, 30 Jun 2024 22:43:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=83=A8=E5=88=86bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- compoment/BasicContainer/BasicContainer.vue | 6 +- compoment/MyDrawer/MyDrawer.vue | 4 +- compoment/PopUp/PopUp.vue | 7 +- compoment/ShowImgBox/ShowImgBox.vue | 52 + config/host.js | 4 +- main.js | 4 +- pages.json | 19 + .../ArrivalConfirmation.vue | 488 ++++++ .../InitiateAfterSalesService.vue | 10 +- .../ParticularsOfCompletion.vue | 16 +- pagesHome/pages/addInfo/addInfo.vue | 15 +- .../afterSalesDetails/afterSalesDetails.vue | 6 +- .../pages/checkAndAccept/checkAndAccept.vue | 167 +- pagesHome/pages/taskDetails/clientInfo.vue | 2 +- pagesHome/pages/taskDetails/nodeInfo.vue | 14 + .../pages/taskDetails/serviceContent.vue | 14 +- .../InstallAfterSalesTaskList.vue | 1526 +++++++++-------- .../pages/InstallTaskList/InstallTaskList.vue | 1503 ++++++++-------- 18 files changed, 2240 insertions(+), 1617 deletions(-) create mode 100644 compoment/ShowImgBox/ShowImgBox.vue create mode 100644 pagesHome/pages/ArrivalConfirmation/ArrivalConfirmation.vue diff --git a/compoment/BasicContainer/BasicContainer.vue b/compoment/BasicContainer/BasicContainer.vue index 647a840..8d5d3f2 100644 --- a/compoment/BasicContainer/BasicContainer.vue +++ b/compoment/BasicContainer/BasicContainer.vue @@ -44,7 +44,9 @@ option: { type: Object, default: { - pageLoading: false + pageLoading: false, + /** 是否执行触底函数 */ + haveReachBottom: true } }, title: { @@ -81,6 +83,8 @@ let antiShake : any = null // 触底加载 onReachBottom(() => { + if (props.option.haveReachBottom === false) return + // 数据请求完毕, 不再请求 if (props.option.isEnd) { return uni.showToast({ diff --git a/compoment/MyDrawer/MyDrawer.vue b/compoment/MyDrawer/MyDrawer.vue index 5bd4e82..5d77118 100644 --- a/compoment/MyDrawer/MyDrawer.vue +++ b/compoment/MyDrawer/MyDrawer.vue @@ -220,7 +220,7 @@ .buttonContainer { width: 100%; - padding: 20upx 0; + padding: 20upx 0 60upx; flex: 1; display: flex; justify-content: space-around; @@ -228,7 +228,7 @@ zoom: 0.9; >view { - padding: 20upx 80upx; + padding: 25upx 100upx; border-radius: 10upx; background: var(--subjectColor); color: #fff; diff --git a/compoment/PopUp/PopUp.vue b/compoment/PopUp/PopUp.vue index 5c335c2..1295ea6 100644 --- a/compoment/PopUp/PopUp.vue +++ b/compoment/PopUp/PopUp.vue @@ -116,17 +116,15 @@ .buttonContainer { width: 100%; - // height: 12vh; - padding: 20upx 0; + padding: 20upx 0 60upx; flex: 1; display: flex; justify-content: space-around; align-items: center; zoom: 0.9; - // padding: 20upx; >view { - padding: 20upx 80upx; + padding: 25upx 100upx; border-radius: 10upx; background: var(--subjectColor); color: #fff; @@ -135,7 +133,6 @@ .closeButton { color: #000; background: #F5F5F6; - // border: 2upx solid var(--subjectColor); } } diff --git a/compoment/ShowImgBox/ShowImgBox.vue b/compoment/ShowImgBox/ShowImgBox.vue new file mode 100644 index 0000000..d48caf9 --- /dev/null +++ b/compoment/ShowImgBox/ShowImgBox.vue @@ -0,0 +1,52 @@ + + + + + \ No newline at end of file diff --git a/config/host.js b/config/host.js index f4b6276..8085b22 100644 --- a/config/host.js +++ b/config/host.js @@ -23,8 +23,8 @@ // cg // const devhost = 'http://192.168.10.200:13000/' // lg -const devhost = 'http://192.168.3.16:9922/' -// const devhost = 'http://192.168.5.34:9922/' +// const devhost = 'http://192.168.3.16:9922/' +const devhost = 'http://192.168.5.34:9922/' /** * 正式域名 * */ diff --git a/main.js b/main.js index 30751ab..988df17 100644 --- a/main.js +++ b/main.js @@ -34,8 +34,9 @@ import saomiao2 from '@/compoment/saomiao2.vue' /** 输入框组件 */ import MyInput from '@/compoment/MyInput/MyInput.vue'; /** 抽屉组件 */ -/** 输入框组件 */ import MyDrawer from '@/compoment/MyDrawer/MyDrawer'; +/** 图片显示组件 */ +import ShowImgBox from '@/compoment/ShowImgBox/ShowImgBox'; import utils from '@/utils/utils.js' import Store from '@/store/index.js' @@ -62,6 +63,7 @@ export function createApp() { .component('CheckBox', CheckBox) .component('MyInput', MyInput) .component('MyDrawer', MyDrawer) + .component('ShowImgBox', ShowImgBox) uni.$u.config.unit = 'rpx' return { diff --git a/pages.json b/pages.json index d71d37c..b14eaab 100644 --- a/pages.json +++ b/pages.json @@ -343,6 +343,25 @@ } } + }, + { + "path": "pages/ArrivalConfirmation/ArrivalConfirmation", + "style": { + "navigationBarTitleText": "指派", + "enablePullDownRefresh": true, + "onReachBottomDistance": 1, + "navigationStyle": "custom", + "app-plus": { + "animationDuration": 300, + "animationType": "zoom-fade-out", + "pullToRefresh": { + "support": true, + "color": "#d3832a", //小圈圈的颜色 + "style": "circle" //小圈圈的样式 + } + } + } + } ] }, diff --git a/pagesHome/pages/ArrivalConfirmation/ArrivalConfirmation.vue b/pagesHome/pages/ArrivalConfirmation/ArrivalConfirmation.vue new file mode 100644 index 0000000..b3572f1 --- /dev/null +++ b/pagesHome/pages/ArrivalConfirmation/ArrivalConfirmation.vue @@ -0,0 +1,488 @@ + + + + + \ No newline at end of file diff --git a/pagesHome/pages/InitiateAfterSalesService/InitiateAfterSalesService.vue b/pagesHome/pages/InitiateAfterSalesService/InitiateAfterSalesService.vue index 47eba3e..ff9adc1 100644 --- a/pagesHome/pages/InitiateAfterSalesService/InitiateAfterSalesService.vue +++ b/pagesHome/pages/InitiateAfterSalesService/InitiateAfterSalesService.vue @@ -405,11 +405,11 @@ try { option.pageLoading = true - const submitData = { type: details.form.type, install_id: details.pageInfo.id, remark: details.form.remark, images: details.imgList } - // for (let i = 0; i < details.packageList.length; i++) { - // const _item = details.packageList[i] - // _item && submitData.images.push(_item) - // } + const submitData = { type: details.form.type, install_id: details.pageInfo.id, remark: details.form.remark, images: details.imgList, packages: [] } + for (let i = 0; i < details.packageList.length; i++) { + const _item = details.packageList[i] + _item.code && submitData.packages.push(_item.code) + } const res = await postInstallAfterSales(submitData) diff --git a/pagesHome/pages/ParticularsOfCompletion/ParticularsOfCompletion.vue b/pagesHome/pages/ParticularsOfCompletion/ParticularsOfCompletion.vue index b971266..a4ab450 100644 --- a/pagesHome/pages/ParticularsOfCompletion/ParticularsOfCompletion.vue +++ b/pagesHome/pages/ParticularsOfCompletion/ParticularsOfCompletion.vue @@ -269,12 +269,18 @@ // // #endif await nextTick() - - initpage() - // basicContainer.value.startPullDownRefresh() const _height = await utils.getViewDistanceFormTop('.scvmabx') details.scrollheight = Number(_height.replace('px', '')) - 100 + 'px' + }) + + onLoad(async (e) => { + details.pageInfo.install_id = e.id + + await initpage() + // basicContainer.value.startPullDownRefresh() + + await nextTick() if (utils.getObjType(imgPullDownRefList.value) !== 'array') return for (let i = 0; i < imgPullDownRefList.value.length; i++) { @@ -283,10 +289,6 @@ } }) - onLoad((e) => { - details.pageInfo.install_id = e.id - }) - const scandata = () => { } const initpage = async () => { diff --git a/pagesHome/pages/addInfo/addInfo.vue b/pagesHome/pages/addInfo/addInfo.vue index 434b747..28c9215 100644 --- a/pagesHome/pages/addInfo/addInfo.vue +++ b/pagesHome/pages/addInfo/addInfo.vue @@ -84,11 +84,16 @@ + + 提 交 + + + @@ -144,7 +149,8 @@ const option = reactive({ title: '添加信息', haveData: true, - pageLoading: false + pageLoading: false, + haveReachBottom: false }) const details = reactive({ @@ -667,8 +673,13 @@ color: #fff; border-radius: 60upx; position: fixed; - bottom: 10upx; + bottom: 60upx; left: 50%; transform: translateX(-50%); } + + // 底部站位 + .footer_container { + height: 140upx; + } \ No newline at end of file diff --git a/pagesHome/pages/afterSalesDetails/afterSalesDetails.vue b/pagesHome/pages/afterSalesDetails/afterSalesDetails.vue index 5a1fe50..fc522f8 100644 --- a/pagesHome/pages/afterSalesDetails/afterSalesDetails.vue +++ b/pagesHome/pages/afterSalesDetails/afterSalesDetails.vue @@ -87,9 +87,9 @@ 确认完工 - + + 确认到货 + diff --git a/pagesHome/pages/checkAndAccept/checkAndAccept.vue b/pagesHome/pages/checkAndAccept/checkAndAccept.vue index f03b0e2..4b77b95 100644 --- a/pagesHome/pages/checkAndAccept/checkAndAccept.vue +++ b/pagesHome/pages/checkAndAccept/checkAndAccept.vue @@ -98,6 +98,31 @@ + + + 验收图片 + + + + + + + + + + + + + + + + + + + + + + 验收备注 @@ -192,6 +217,8 @@ ], imgList: [], renderArr: [], + /** 验收图片 */ + checkAndAcceptImgList: [] }) // 组件配置 @@ -255,6 +282,7 @@ const scandata = () => { } + /** 初始化获取数据 */ const initpage = async () => { try { option.pageLoading = true @@ -317,6 +345,46 @@ } } + /** 上传验收图片 */ + /** 上传文件 */ + const handleUploadFile = () => { + const successByUpload = (res) => { + console.log('res :>> ', res); + const { data } = res + const _data = JSON.parse(data) + + console.log('_data :>> ', _data); + const { code, data: img } = _data + + details.checkAndAcceptImgList.push({ url: img, name: img }) + } + + utils.handleUploadFile({ + successByUpload + }) + } + + /** 移除图片 */ + const handleRmove = (index) => { + tip.value.setdetails({ + isshow: true, + content: '确认移除', + cancelTxt: '取消', + confirmTxt: '确认', + success() { + details.imgList.splice(index, 1) + + // 关闭弹窗 + tip.value.setdetails({ isshow: false }) + }, + cancel() { + // 关闭弹窗 + tip.value.setdetails({ isshow: false }) + } + }) + } + + /** * 提交 * @param {number} result 结果 1 -- 通过, 0 -- 驳回 @@ -328,6 +396,7 @@ showPopUp: true, title: '确认' + (result === 0 ? '驳回' : '通过'), async success() { + if (result === 0 && details.checkAndAcceptImgList.length === 0) return utils.handleToast('最少上传一张驳回图片') if (result === 0 && !details.form.reason) return utils.handleToast('请输入驳回原因') try { @@ -341,9 +410,12 @@ install_id ?: string // 安装售后id install_sales_id ?: string + // 验收图片 + images : { url : string, name : string }[] } = { result, reason: details.form.reason, + images: details.checkAndAcceptImgList } details.pageType === 'install' @@ -372,58 +444,6 @@ } }, }) - - // tip.value.setdetails({ - // isshow: true, - // content: '确认' + (result === 0 ? '驳回' : '通过'), - // cancelTxt: '取 消', - // confirmTxt: '确 认', - // async success() { - // try { - // option.pageLoading = true - // const submitData : { - // // 验收或驳回 - // result : number - // // 验收意见 - // reason : string - // // 安装任务id - // install_id ?: string - // // 安装售后id - // install_sales_id ?: string - // } = { - // result, - // reason: details.form.reason, - // } - - // details.pageType === 'install' - // ? (submitData.install_id = details.pageInfo.install_id) - // : (submitData.install_sales_id = details.pageInfo.install_sales_id) - - // const res = - // details.pageType === 'install' - // ? // 安装验收 - // await postInstallAcceptance(submitData) - // : // 售后验收 - // await postInstallSalesAcceptance(submitData) - - // const { code, data } = res - - // if (code !== 200) return - - // uni.navigateBack() - // } catch (err) { - // console.log('err :>> ', err) - // //TODO handle the exception - // } finally { - // option.pageLoading = false - // // 关闭弹窗 - // tip.value.setdetails({ isshow: false }) - // } - // }, - // cancel() { - // tip.value.setdetails({ isshow: false }) - // }, - // }) } @@ -477,15 +497,46 @@ } // 图片列表 - .imgList { - flex-wrap: wrap; + // .imgList { + // flex-wrap: wrap; + + // image { + // width: 160upx; + // height: 160upx; + // border-radius: 20upx; + // } + // } + } - image { - width: 160upx; - height: 160upx; - border-radius: 20upx; + // 图片列表 + .imgList { + flex-wrap: wrap; + + .image_conatiner { + position: relative; + + .removeIcon { + position: absolute; + top: 0; + right: 0; + transform: translate(40%, -40%); + opacity: 0.9; } } + + .addImg { + width: 160upx; + height: 160upx; + border-radius: 20upx; + box-sizing: border-box; + border: 2upx solid #eee; + } + + image { + width: 160upx; + height: 160upx; + border-radius: 20upx; + } } // 底部 diff --git a/pagesHome/pages/taskDetails/clientInfo.vue b/pagesHome/pages/taskDetails/clientInfo.vue index 6994583..39d33a6 100644 --- a/pagesHome/pages/taskDetails/clientInfo.vue +++ b/pagesHome/pages/taskDetails/clientInfo.vue @@ -144,7 +144,7 @@ /** 打电话 */ const handleCallPhone = () => { uni.makePhoneCall({ - phoneNumber: '13208366016' + phoneNumber: info.value.tel }) } diff --git a/pagesHome/pages/taskDetails/nodeInfo.vue b/pagesHome/pages/taskDetails/nodeInfo.vue index e37b023..5464ea7 100644 --- a/pagesHome/pages/taskDetails/nodeInfo.vue +++ b/pagesHome/pages/taskDetails/nodeInfo.vue @@ -32,6 +32,14 @@ {{item.remark}} + + + + + + + + @@ -123,4 +131,10 @@ } } } + + image { + width: 160upx; + height: 160upx; + border-radius: 10upx; + } \ No newline at end of file diff --git a/pagesHome/pages/taskDetails/serviceContent.vue b/pagesHome/pages/taskDetails/serviceContent.vue index 371d6f7..f5aefae 100644 --- a/pagesHome/pages/taskDetails/serviceContent.vue +++ b/pagesHome/pages/taskDetails/serviceContent.vue @@ -97,7 +97,7 @@ 图片 - + @@ -111,6 +111,8 @@ + + @@ -227,6 +229,11 @@ } else return [] }) + const details = reactive({ + showImg: false, + showImgUrl: '' + }) + /** 新增服务内容 */ const handleAdd = item => { console.log('item :>> ', item) @@ -251,6 +258,11 @@ props.pageInfo.id, }) } + + const handleShowImg = (item) => { + details.showImg = true + details.showImgUrl = item.url + } + @import url('@/utils/style/common.scss'); + + .header_title { + background-color: var(--subjectColor); + color: #fff; + height: 100upx; + } + + // tabbar + .tabbar { + height: 100upx; + background-color: #fff; + position: relative; + $tabbarTime: 0.3s; + font-size: 1rem; + border-bottom: 2upx solid #eee; + + .tabbar_item { + font-weight: bold; + color: #000; + transition: all $tabbarTime; + + &.active { + color: var(--subjectColor); + } + } + + .tabbar_active { + height: 8upx; + position: absolute; + width: 50%; + bottom: 0; + transition: all $tabbarTime; + + &::after { + content: ''; + display: block; + width: 4rem; + height: 100%; + background-color: var(--subjectColor); + border-radius: 4upx; + } + } + } + + // 顶部搜索 + .search_container { + background: #fff; + padding: 20upx; + + .input_container { + // padding: 20upx 100upx; + background: #f4f6f8; + border-radius: 50upx; + height: 80upx; + + .first_icon { + width: 100upx; + } + + input {} + + .search_text { + width: 150upx; + color: var(--subjectColor); + } + } + } + + // 搜索行 + .search_row { + background: #f5f5f6; + // border-bottom: 2upx solid #eee; + + &>view { + padding: 20upx 0; + } + } + + .main { + font-size: 0.9rem; + position: relative; + // padding: 20upx; + + // 任务列表 + .list_container { + position: relative; + color: #000; + z-index: 10; + // padding: 20upx; + + // 工人样式 + .box { + border-radius: 10upx; + overflow: hidden; + margin: 20upx; + position: relative; + + &:last-child { + margin-bottom: 0; + } + + .title { + padding: 20upx 20upx; + background: linear-gradient(90deg, #d8f7f2 0%, #fff 100%); + font-weight: 600; + + .tip { + font-weight: bold; + color: #3ad8bc; + } + } + + .info { + padding: 30upx 20upx; + background-color: #fff; + font-size: 0.9rem; + } + + // .tip { + // position: absolute; + // padding: 10upx 20upx; + // background-color: #f5f5f6; + // color: var(--primaryColor); + // right: 0; + // top: 0; + // } + + // 待签收 + &.first { + .title { + background: linear-gradient(90deg, #fee8d0 0%, #fff 100%); + + .tip { + color: var(--subjectColor); + } + } + } + + // 服务中 + &.second { + .title { + background: linear-gradient(90deg, #cde7fc 0%, #fff 100%); + + .tip { + color: var(--primaryColor); + } + } + } + + // 已指派 + &.third { + .title { + background: linear-gradient(90deg, #d8f7f2 0%, #fff 100%); + + .tip { + color: #3ad8bc; + } + } + } + } + } + } + + // picker样式 + .picker-view { + height: 40vh; + + .item { + text-align: center; + line-height: 40px; + } + } + \ No newline at end of file diff --git a/pagesUser/pages/InstallTaskList/InstallTaskList.vue b/pagesUser/pages/InstallTaskList/InstallTaskList.vue index 86a5278..c9392bd 100644 --- a/pagesUser/pages/InstallTaskList/InstallTaskList.vue +++ b/pagesUser/pages/InstallTaskList/InstallTaskList.vue @@ -1,792 +1,761 @@ + @import url('@/utils/style/common.scss'); + + .header_title { + background-color: var(--subjectColor); + color: #fff; + height: 100upx; + } + + // tabbar + .tabbar { + height: 100upx; + background-color: #fff; + position: relative; + $tabbarTime: 0.3s; + font-size: 1rem; + border-bottom: 2upx solid #eee; + + .tabbar_item { + font-weight: bold; + color: #000; + transition: all $tabbarTime; + + &.active { + color: var(--subjectColor); + } + } + + .tabbar_active { + height: 8upx; + position: absolute; + width: 50%; + bottom: 0; + transition: all $tabbarTime; + + &::after { + content: ''; + display: block; + width: 4rem; + height: 100%; + background-color: var(--subjectColor); + border-radius: 4upx; + } + } + } + + // 顶部搜索 + .search_container { + background: #fff; + padding: 20upx; + + .input_container { + // padding: 20upx 100upx; + background: #f4f6f8; + border-radius: 50upx; + height: 80upx; + + .first_icon { + width: 100upx; + } + + input {} + + .search_text { + width: 150upx; + color: var(--subjectColor); + } + } + } + + // 搜索行 + .search_row { + background: #f5f5f6; + // border-bottom: 2upx solid #eee; + + &>view { + padding: 20upx 0; + } + } + + .main { + font-size: 0.9rem; + position: relative; + // padding: 20upx; + + // 任务列表 + .list_container { + position: relative; + color: #000; + z-index: 10; + // padding: 20upx; + + // 工人样式 + .box { + border-radius: 10upx; + overflow: hidden; + margin: 20upx; + + &:last-child { + margin-bottom: 0; + } + + .title { + padding: 20upx 20upx; + background: linear-gradient(90deg, #d8f7f2 0%, #fff 100%); + font-weight: 600; + + .tip { + font-weight: normal; + color: #3ad8bc; + } + } + + .info { + padding: 30upx 20upx; + background-color: #fff; + font-size: 0.9rem; + } + + // 待签收 + &.first { + .title { + background: linear-gradient(90deg, #fee8d0 0%, #fff 100%); + + .tip { + color: var(--subjectColor); + } + } + } + + // 服务中 + &.second { + .title { + background: linear-gradient(90deg, #cde7fc 0%, #fff 100%); + + .tip { + color: var(--primaryColor); + } + } + } + + // 已指派 + &.third { + .title { + background: linear-gradient(90deg, #d8f7f2 0%, #fff 100%); + + .tip { + color: #3ad8bc; + } + } + } + } + } + } + + // picker样式 + .picker-view { + height: 40vh; + + .item { + text-align: center; + line-height: 40px; + } + } + \ No newline at end of file