diff --git a/App.vue b/App.vue index d3fa14a..4f68a13 100644 --- a/App.vue +++ b/App.vue @@ -29,10 +29,37 @@ export default { // #ifdef MP-WEIXIN console.error(`暂时不支持运行到小程序端`); // #endif + // 集成cid全局获取和存储 + // uni.getPushClientId({ + // success: (res) => { + // console.log(res, 'app-Push-ID'); + // if (res && res.cid) { + // uni.setStorageSync('cid', res.cid); + // } + // }, + // fail: (err) => { + // console.log(err) + // } + // }) }, onShow: function () { console.log("App Show"); IMSDK.asyncApi(IMSDK.IMMethods.SetAppBackgroundStatus, IMSDK.uuid(), false); + //#ifdef APP-PLUS + // var info = plus.push.getClientInfo() + // plus.push.addEventListener("click", function(msg) { + // console.log("click:" + JSON.stringify(msg)); + // console.log(msg.payload); + // console.log(JSON.stringify(msg)); + // }, false); + // // 监听在线消息事件 + // plus.push.addEventListener("receive", function(msg) { + // //业务代码 + // console.log("recevice:" + JSON.stringify(msg)) + // }, false); + //#endif + + }, onHide: function () { console.log("App Hide"); @@ -52,8 +79,6 @@ export default { ]), }, methods: { - - ...mapActions("message", ["pushNewMessage", "updateOneMessage"]), ...mapActions("conversation", ["updateCurrentMemberInGroup"]), ...mapActions("contact", [ @@ -446,7 +471,7 @@ export default { }, }; -function checkUpdate() { +function checkUpdate(forceCheck = false) { const localVersion = plus.runtime.version; const localWgtVersion = uni.getStorageSync('wgtVersion') || localVersion; uni.request({ @@ -458,11 +483,19 @@ function checkUpdate() { const currentVersion = compareVersion(localWgtVersion, localVersion) > 0 ? localWgtVersion : localVersion; console.log('本地基座版本:', localVersion, '本地wgt版本:', localWgtVersion, '当前对比版本:', currentVersion, '远程版本:', remoteVersion); if (compareVersion(remoteVersion, currentVersion) > 0) { + // 检查是否已忽略当前版本(除非强制检查) + const ignoredVersion = uni.getStorageSync('ignoredVersion'); + if (!forceCheck && ignoredVersion === remoteVersion) { + console.log('用户已选择忽略此版本:', remoteVersion); + return; + } + uni.showModal({ title: '发现新版本', content: `检测到新版本(${remoteVersion}),是否立即下载并更新?`, confirmText: '立即更新', cancelText: '暂不更新', + showCancel: true, success: (modalRes) => { if (modalRes.confirm) { uni.showLoading({title: '正在下载更新包...'}); @@ -495,6 +528,20 @@ function checkUpdate() { uni.showToast({title: '下载失败'}); } }); + } else { + // 用户选择暂不更新,询问是否忽略此版本 + uni.showModal({ + title: '忽略更新', + content: `是否忽略版本 ${remoteVersion}?忽略后下次启动时将不再提示此版本更新。`, + confirmText: '忽略此版本', + cancelText: '下次提醒', + success: (ignoreRes) => { + if (ignoreRes.confirm) { + uni.setStorageSync('ignoredVersion', remoteVersion); + uni.showToast({title: '已忽略此版本更新'}); + } + } + }); } } }); @@ -525,6 +572,29 @@ function compareVersion(v1, v2) { } return 0; } + +// 更新管理工具函数 +function clearIgnoredVersion() { + uni.removeStorageSync('ignoredVersion'); + console.log('已清除忽略的版本设置'); +} + +function getIgnoredVersion() { + return uni.getStorageSync('ignoredVersion'); +} + +function setIgnoredVersion(version) { + uni.setStorageSync('ignoredVersion', version); + console.log('已设置忽略版本:', version); +} + +// 导出更新管理函数供其他页面使用 +uni.$updateManager = { + checkUpdate: (forceCheck = false) => checkUpdate(forceCheck), + clearIgnoredVersion, + getIgnoredVersion, + setIgnoredVersion +}; \ No newline at end of file diff --git a/components/ReportDetail/index.vue b/components/ReportDetail/index.vue new file mode 100644 index 0000000..ac312c4 --- /dev/null +++ b/components/ReportDetail/index.vue @@ -0,0 +1,263 @@ + + + + + \ No newline at end of file diff --git a/manifest.json b/manifest.json index d3d3b8d..03def19 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { "name" : "德讯", - "appid" : "__UNI__D705A34", + "appid" : "__UNI__AF08DA3", "description" : "", "versionName" : "fad-im 4.0.0", "versionCode" : 345, @@ -73,8 +73,8 @@ "speech" : {}, "push" : { "unipush" : { - "version" : "2", - "offline" : true + "offline" : true, + "oppo" : {} } } }, @@ -120,22 +120,7 @@ } } }, - "nativePlugins" : { - "Tuoyun-OpenIMSDK" : { - "__plugin_info__" : { - "name" : "OpenIM SDK", - "description" : "OpenIM:由IM技术专家打造的基于 Go 实现的即时通讯(IM)项目,从服务端到客户端SDK开源即时通讯(IM)整体解决方案,可以轻松替代第三方IM云服务,打造具备聊天、社交功能的app。", - "platforms" : "Android,iOS", - "url" : "https://ext.dcloud.net.cn/plugin?id=6577", - "android_package_name" : "", - "ios_bundle_id" : "", - "isCloud" : true, - "bought" : 1, - "pid" : "6577", - "parameters" : {} - } - } - }, + "nativePlugins" : {}, "uniStatistics" : { "enable" : false } diff --git a/pages.json b/pages.json index 2a85608..41fdc87 100644 --- a/pages.json +++ b/pages.json @@ -259,7 +259,7 @@ "style" : { "navigationBarTitleText" : "施工进度", - "navigationStyle": "default" + "navigationStyle": "default" } }, { @@ -267,7 +267,31 @@ "style" : { "navigationBarTitleText" : "施工进度详情", - "navigationStyle": "default" + "navigationStyle": "default" + } + }, + { + "path" : "pages/workbench/task/task", + "style" : + { + "navigationBarTitleText" : "任务中心", + "navigationStyle": "default" + } + }, + { + "path" : "pages/workbench/task/create", + "style" : + { + "navigationBarTitleText" : "新增任务", + "navigationStyle": "default" + } + }, + { + "path" : "pages/workbench/task/reportTaskDetail", + "style" : + { + "navigationBarTitleText" : "任务详情", + "navigationStyle": "default" } } ], diff --git a/pages/login/index.vue b/pages/login/index.vue index dae9952..88ea34f 100644 --- a/pages/login/index.vue +++ b/pages/login/index.vue @@ -190,7 +190,6 @@ export default { this.loading = true; this.saveLoginInfo(); let data = {}; - data = await businessLogin({ phoneNumber: this.loginInfo.phoneNumber, email: this.loginInfo.email, @@ -217,11 +216,71 @@ export default { this.$store.dispatch("contact/getSentFriendApplications"); this.$store.dispatch("contact/getRecvGroupApplications"); this.$store.dispatch("contact/getSentGroupApplications"); + // 登录成功后,绑定deviceId与imId + // 获取设备cid,调用云函数 + // const cid = uni.getStorageSync('cid'); + // uniCloud.callFunction({ + // name: 'bindingIm', + // data: { + // deviceId: cid, + // imId: userID + // }, + // success: (res) => { + // if (res.result.code === 200) { + // uni.showToast({ + // title: res.result.msg, + // icon: 'success' + // }); + // } else { + // uni.showToast({ + // title: res.result.msg, + // icon: 'none' + // }); + // } + // }, + // fail: (err) => { + // uni.showToast({ + // title: '云函数调用失败', + // icon: 'none' + // }); + // console.error(err); + // } + // }); uni.switchTab({ url: "/pages/conversation/conversationList/index", }); - await getSMSCodeFromOa(this.loginInfo.phoneNumber); - await loginOaByPhone(this.loginInfo.phoneNumber) + await getSMSCodeFromOa(this.loginInfo.phoneNumber); + const info = await loginOaByPhone(this.loginInfo.phoneNumber) + // console.log('用户信息', info) + // const oaUserId = info.userInfo.userId; + + // uniCloud.callFunction({ + // name: 'binding', + // data: { + // oaId: oaUserId, + // deviceId: cid + // }, + // success: (res) => { + // if (res.result.code === 200) { + // uni.showToast({ + // title: res.result.msg, + // icon: 'success' + // }); + // } else { + // uni.showToast({ + // title: res.result.msg, + // icon: 'none' + // }); + // } + // }, + // fail: (err) => { + // uni.showToast({ + // title: '云函数调用失败', + // icon: 'none' + // }); + // console.error(err); + // } + // }); this.loginInfo.password = ""; this.loading = false; diff --git a/pages/profile/index/index.vue b/pages/profile/index/index.vue index 6a04d71..b27ed1d 100644 --- a/pages/profile/index/index.vue +++ b/pages/profile/index/index.vue @@ -73,6 +73,16 @@ export default { }, { idx: 4, + title: "应用更新", + icon: require("static/images/profile_menu_about.png"), + }, + { + idx: 5, + title: '测试推送', + icon: require("static/images/profile_menu_about.png") + }, + { + idx: 6, title: "退出登录", icon: require("static/images/profile_menu_logout.png"), }, @@ -137,6 +147,21 @@ export default { }); break; case 4: + this.showUpdateOptions(); + break; + case 5: + uni.createPushMessage({ + content: '今天还没有报工哦', + title: "报工提醒", + success() { + console.log('推送成功') + }, + fail() { + console.log("推送失败") + } + }); + break; + case 6: uni.showModal({ title: "提示", content: "确定要退出当前账号吗?", @@ -158,6 +183,41 @@ export default { url: `/pages/common/userOrGroupQrCode/index`, }); }, + showUpdateOptions() { + const ignoredVersion = uni.$updateManager.getIgnoredVersion(); + let content = '选择更新操作:'; + if (ignoredVersion) { + content += `\n当前忽略版本:${ignoredVersion}`; + } + + uni.showActionSheet({ + itemList: ['检查更新', '清除忽略版本', '取消'], + success: (res) => { + switch (res.tapIndex) { + case 0: + // 检查更新(强制检查) + uni.$updateManager.checkUpdate(true); + break; + case 1: + // 清除忽略版本 + uni.showModal({ + title: '确认操作', + content: '确定要清除忽略的版本设置吗?清除后将重新提示所有版本更新。', + success: (modalRes) => { + if (modalRes.confirm) { + uni.$updateManager.clearIgnoredVersion(); + uni.showToast({title: '已清除忽略版本设置'}); + } + } + }); + break; + case 2: + // 取消 + break; + } + } + }); + }, }, }; diff --git a/pages/workbench/construction/construction.vue b/pages/workbench/construction/construction.vue index 7342f3a..b9ac424 100644 --- a/pages/workbench/construction/construction.vue +++ b/pages/workbench/construction/construction.vue @@ -3,38 +3,53 @@ - 点击对应的行可以查看详情 + 点击对应的卡片可以查看详情 + + + + + + + 新增汇报 + - - - - - 汇报标题 - 最近汇报时间 - 汇报日期 - 汇报人 - 涉及项目 - 备注 + + + {{ item.reportTitle || '-' }} + + + 最近汇报时间: + {{ formatDate(item.lastUpdateTime) }} - - - {{ item.reportTitle || '-' }} - {{ formatDate(item.lastUpdateTime) }} - {{ formatDate(item.reportDate) }} - {{ item.reporter || '-' }} - {{ item.projectName || '-' }} - {{ item.remark || '-' }} - + + 汇报日期: + {{ formatDate(item.reportDate) }} + + + 汇报人: + {{ item.reporter || '-' }} + + + 涉及项目: + {{ item.projectName || '-' }} + + + 备注: + {{ item.remark || '-' }} - + @@ -44,13 +59,75 @@ @loadmore="loadMore" > + + + + + 新增汇报 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 取消 + 确定 + + + @@ -180,62 +359,48 @@ export default { } } - -.table-wrapper { - background-color: #fff; - border-radius: 10rpx; - overflow: hidden; +.add-button-container { + display: flex; + justify-content: center; + margin-bottom: 30rpx; } -.table-scroll { - width: 100%; +.masonry-list { + column-count: 2; + column-gap: 24rpx; + padding: 10rpx 0; } -.table-container { - min-width: 1200rpx; // 设置最小宽度,确保表格内容不会被压缩 - .table-header { - display: flex; - background-color: #f8f9fa; - border-bottom: 1rpx solid #e9ecef; - .header-cell { - width: 200rpx; // 固定列宽 - padding: 20rpx 10rpx; - text-align: center; - font-weight: bold; - font-size: 28rpx; - flex-shrink: 0; // 防止列被压缩 - &.checkbox { - width: 100rpx; // 复选框列宽度 - } - } +.masonry-card { + width: calc(100%% - 18rpx); + margin-bottom: 24rpx; + background: #fff; + border-radius: 16rpx; + box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.06); + display: inline-block; + break-inside: avoid; + padding: 32rpx 24rpx; + cursor: pointer; + transition: box-shadow 0.2s; + &:active { + box-shadow: 0 4rpx 16rpx rgba(0,0,0,0.10); + background: #f8f9fa; } - .table-body { - .table-row { + .card-title { + font-size: 32rpx; + font-weight: bold; + margin-bottom: 16rpx; + color: #007bff; + } + .card-info { + display: flex; + flex-direction: column; + gap: 8rpx; + .info-row { display: flex; - border-bottom: 1rpx solid #e9ecef; - cursor: pointer; - transition: background-color 0.2s; - - &:hover { - background-color: #f8f9fa; - } - - &:active { - background-color: #e9ecef; - } - .table-cell { - width: 200rpx; // 固定列宽 - padding: 20rpx 10rpx; - text-align: center; - font-size: 26rpx; - display: flex; - align-items: center; - justify-content: center; - flex-shrink: 0; // 防止列被压缩 - word-break: break-all; // 长文本换行 - &.checkbox { - width: 100rpx; // 复选框列宽度 - } + .label { + color: #888; + min-width: 120rpx; } } } diff --git a/pages/workbench/construction/detail.vue b/pages/workbench/construction/detail.vue index ab5e1b2..f35a4ab 100644 --- a/pages/workbench/construction/detail.vue +++ b/pages/workbench/construction/detail.vue @@ -22,69 +22,49 @@ - - - 新增 - 删除 - + - - - - - - + + + + + + 设备编号: + {{ item.deviceCode || '-' }} - 设备编号 - 设备类别 - 汇报详情内容 - 图片概况 - 备注 - 操作 - - - - - - - - - {{ item.deviceCode || '-' }} - {{ item.category || '-' }} - - {{ item.reportDetail || '-' }} - - - - - - - {{ item.remark || '-' }} - - 删除 - + + 设备类别: + {{ item.category || '-' }} + + + 汇报详情内容: + {{ item.reportDetail || '-' }} + + + 图片概况: + + + - - - - + + 备注: + {{ item.remark || '-' }} + + + + @@ -94,6 +74,13 @@ @loadmore="loadMore" > + + + + + + + @@ -269,6 +256,9 @@ export default { this.reportDetailList = response.rows || []; this.total = response.total || 0; this.loading = false; + if (this.reportDetailList.length >= this.total) { + this.loadMoreStatus = 'nomore'; + } // 重置选中状态 this.selectedIds = []; this.selectAll = false; @@ -450,7 +440,8 @@ export default { this.reportDetailList = [...this.reportDetailList, ...newData]; this.total = response.total || 0; - if (newData.length < this.queryParams.pageSize) { + // 判断是否还有更多数据:当前获取的数据总数 >= 总数据量 + if (this.reportDetailList.length >= this.total) { this.loadMoreStatus = 'nomore'; } else { this.loadMoreStatus = 'loadmore'; @@ -549,76 +540,32 @@ export default { } } -.action-buttons { - display: flex; - gap: 20rpx; - margin-bottom: 20rpx; -} -.table-wrapper { - background-color: #fff; + +.list-wrapper { + background: #fff; border-radius: 10rpx; - overflow: hidden; + padding: 10rpx 0; } -.table-scroll { - width: 100%; -} - -.table-container { - min-width: 1400rpx; // 设置最小宽度,确保表格内容不会被压缩 - .table-header { +.detail-list-item { + padding: 32rpx 24rpx; + background: #fff; + border-radius: 12rpx; + margin-bottom: 16rpx; + border: 1rpx solid #e9ecef; + box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.06); + .item-row { display: flex; - background-color: #f8f9fa; - border-bottom: 1rpx solid #e9ecef; - - .header-cell { - width: 200rpx; // 固定列宽 - padding: 20rpx 10rpx; - text-align: center; - font-weight: bold; - font-size: 28rpx; - flex-shrink: 0; // 防止列被压缩 - - &.checkbox { - width: 100rpx; // 复选框列宽度 - } + align-items: center; + margin-bottom: 8rpx; + .item-label { + color: #888; + min-width: 140rpx; } - } - - .table-body { - .table-row { - display: flex; - border-bottom: 1rpx solid #e9ecef; - - &:hover { - background-color: #f8f9fa; - } - - .table-cell { - width: 200rpx; // 固定列宽 - padding: 20rpx 10rpx; - text-align: center; - font-size: 26rpx; - display: flex; - align-items: center; - justify-content: center; - flex-shrink: 0; // 防止列被压缩 - word-break: break-all; // 长文本换行 - - &.checkbox { - width: 100rpx; // 复选框列宽度 - } - - &.content-cell { - .content-text { - max-width: 180rpx; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - } - } - } + .item-value { + color: #333; + flex: 1; } } } @@ -696,4 +643,28 @@ export default { text-overflow: ellipsis; display: block; } + +.add-button-wrapper { + position: fixed; + bottom: 40rpx; + right: 40rpx; + z-index: 999; +} + +.add-button { + width: 120rpx; + height: 120rpx; + background: linear-gradient(135deg, #007bff, #0056b3); + border-radius: 50%; + display: flex; + align-items: center; + justify-content: center; + box-shadow: 0 4rpx 16rpx rgba(0, 123, 255, 0.3); + transition: all 0.3s ease; + + &:active { + transform: scale(0.95); + box-shadow: 0 2rpx 8rpx rgba(0, 123, 255, 0.4); + } +} \ No newline at end of file diff --git a/pages/workbench/index/index.vue b/pages/workbench/index/index.vue index 2d47be7..d02a9cc 100644 --- a/pages/workbench/index/index.vue +++ b/pages/workbench/index/index.vue @@ -14,6 +14,10 @@ 施工进度 + + + 任务中心 + @@ -35,7 +39,12 @@ export default { uni.navigateTo({ url: '/pages/workbench/construction/construction' }); - } + }, + goTask() { + uni.navigateTo({ + url: '/pages/workbench/task/task' + }) + } } }; diff --git a/pages/workbench/reportWork/reportWork.vue b/pages/workbench/reportWork/reportWork.vue index 789fed5..fe903b7 100644 --- a/pages/workbench/reportWork/reportWork.vue +++ b/pages/workbench/reportWork/reportWork.vue @@ -1,55 +1,58 @@ + + \ No newline at end of file diff --git a/pages/workbench/task/create.vue b/pages/workbench/task/create.vue new file mode 100644 index 0000000..9ca3b33 --- /dev/null +++ b/pages/workbench/task/create.vue @@ -0,0 +1,1211 @@ +