diff --git a/supervise-uniapp/App.vue b/supervise-uniapp/App.vue index 143e52f6..dea58b33 100644 --- a/supervise-uniapp/App.vue +++ b/supervise-uniapp/App.vue @@ -3,12 +3,16 @@ export default { globalData: { // wxSilentLoginURL: "https://supervise.yxtsoft.com/portal/v1/wxuser/wxSilentLogin", - wxSilentLoginURL: "https://supervise.yxtsoft.com/api/portal/v1/wxuser/wxSilentLogin", + wxSilentLoginURL: "http://192.168.1.110:8112/portal/v1/wxuser/wxSilentLogin", wxAuthLoginURL: "https://supervise.yxtsoft.com/api/portal//v1/wxuser/wxAuthLogin", SilentLoginURL: "https://supervise.yxtsoft.com/api/portal/v1/wxuser/SilentLogin",// 注册 token: "", isLogin: false, sid: "", + headImage: "", + username: "", + orgNamePath: "", + organizationSid: "", }, //全局变量, onLaunch: function() { diff --git a/supervise-uniapp/common/config.js b/supervise-uniapp/common/config.js index 21bf674c..6137029a 100644 --- a/supervise-uniapp/common/config.js +++ b/supervise-uniapp/common/config.js @@ -7,9 +7,9 @@ */ module.exports = { // baseUrl: 'https://jianguan.yyundong.com/api', - baseUrl: 'https://supervise.yxtsoft.com', + // baseUrl: 'https://supervise.yxtsoft.com', // baseUrl: 'http://192.168.1.193:8112', - // baseUrl: 'http://192.168.1.116:8112', + baseUrl: 'http://192.168.1.110:8112', tokenName: "Authorization", // 请求头中token的名字,与服务器端对应 loginTimeoutCode: "5001", // 登录超时或失效的情况下,服务器端返回的错误码 loginTimeoutPage: "/pages/login/index", // 登录超时或失效的情况下,跳转到的登录页面 diff --git a/supervise-uniapp/common/request.api.js b/supervise-uniapp/common/request.api.js index e12e91b9..5da68b84 100644 --- a/supervise-uniapp/common/request.api.js +++ b/supervise-uniapp/common/request.api.js @@ -59,9 +59,9 @@ export default { // "/report/reportstock/getDayProduct/" + params, params), // 监管数据总览 - getProjectDaily: (params = {}) => request.get( - "/reportwxmpapi/projectdaily/getProjectDaily/" + params.projectSid + "/" + params.orderDate, params), - // "/report/projectdaily/getProjectDaily/" + params.projectSid + "/" + params.orderDate, params), + getProjectDaily: (params = {}) => request.post( + "/reportwxmpapi/projectdaily/getProjectDaily", params), + // "/report/projectdaily/getProjectDaily", params), // 项目监管报表 getProjectDailyFiles: (params = {}) => request.get( @@ -72,7 +72,7 @@ export default { // 获取首页面数据 - getWorkData: (params = {}) => request.get("/api/portal/v1/flow/task/" + params, params), + getWorkData: (params = {}) => request.get("/report/messagepushlog/numberOfJobs/" + params, params), // 获取云仓列表 storeHouseListPage: (params = {}) => request.post("/api/portal/v1/flow/storeHouseListPage", params), @@ -96,4 +96,18 @@ export default { // 获取数据总览列表 projectListPage: (params = {}) => request.post("/reportwxmpapi/projectdaily/selectListPage", params), + + // 获取消息总览 + messageListPage: (params = {}) => request.post("/reportwxmpapi/messagepushlog/listPage", params), + + + + + + // 修改密码 + updatePassword: (params = {}) => request.post("/portal/v1/sysuser/updatePassword", params), + + // 修改头像 + uploadHandImage: (params = {}) => request.post("/portal/v1/sysuser/uploadImage", params), + } \ No newline at end of file diff --git a/supervise-uniapp/common/wxSilentLogin.js b/supervise-uniapp/common/wxSilentLogin.js index 21b4c22a..0c8d6139 100644 --- a/supervise-uniapp/common/wxSilentLogin.js +++ b/supervise-uniapp/common/wxSilentLogin.js @@ -75,12 +75,18 @@ const wxSilentLogin = () => { getApp().globalData.username = res.data.data - .userName + .name getApp().globalData.token = res.data.data.token getApp().globalData.sid = res.data.data.sid getApp().globalData.mobile = res.data.data .mobile - getApp().globalData.isLogin = true + + getApp().globalData.isAdmin = res.data.data.isAdmin + getApp().globalData.orgNamePath = res.data.data.orgNamePath + getApp().globalData.organizationSid = res.data.data.organizationSid + getApp().globalData.headImage = res.data.data.headImage + + getApp().globalData.isLogin = true uni.setStorageSync("Global-Auth-Token", res.data .data.token) diff --git a/supervise-uniapp/components/SendCodeItem/SendCodeItem.vue b/supervise-uniapp/components/SendCodeItem/SendCodeItem.vue index 0c19b82d..c9b521cd 100644 --- a/supervise-uniapp/components/SendCodeItem/SendCodeItem.vue +++ b/supervise-uniapp/components/SendCodeItem/SendCodeItem.vue @@ -129,7 +129,7 @@ } } }, - props: ['phoneNum', 'url', 'data', 'sendByCookie'], + props: ['phoneNum',"type", 'url', 'data', 'sendByCookie'], } diff --git a/supervise-uniapp/pages.json b/supervise-uniapp/pages.json index 6a6c5fc8..ae222a37 100644 --- a/supervise-uniapp/pages.json +++ b/supervise-uniapp/pages.json @@ -12,6 +12,7 @@ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages + // #ifdef APP-PLUS { @@ -32,7 +33,20 @@ } }, + { + "path": "pages/index/RegulatoryReporting", + "style": { + "navigationBarTitleText": "监管数据总览" + } + }, + { + "path": "pages/index/NotPermission", + "style": { + "navigationBarTitleText": "温馨提示", + "enablePullDownRefresh": false + } + }, { "path": "pages/index/BindPhone", "style": { @@ -44,7 +58,7 @@ } }, - + { "path": "pages/index/BindPhone2", "style": { @@ -97,13 +111,6 @@ - - { - "path": "pages/index/RegulatoryReporting", - "style": { - "navigationBarTitleText": "监管数据总览" - } - }, { "path": "pages/index/AlreadyProcessed", "style": { @@ -221,7 +228,8 @@ { "path": "pages/home/MessageFragment", "style": { - "navigationBarTitleText": "消息" + "navigationBarTitleText": "消息", + "enablePullDownRefresh": true } }, { "path": "pages/index/WarehouseList", @@ -247,7 +255,53 @@ } } - ], + + ,{ + "path" : "pages/index/NotReadWork", + "style" : + { + "navigationBarTitleText": "待阅工作", + "enablePullDownRefresh": false + } + + } + ,{ + "path" : "pages/index/ReadWork", + "style" : + { + "navigationBarTitleText": "已阅工作", + "enablePullDownRefresh": false + } + + } + ,{ + "path" : "pages/index/SetUp", + "style" : + { + "navigationBarTitleText": "设置", + "enablePullDownRefresh": false + } + + } + ,{ + "path" : "pages/index/SetUp2", + "style" : + { + "navigationBarTitleText": "个人信息", + "enablePullDownRefresh": false + } + + } + ,{ + "path" : "pages/index/ChangePassword", + "style" : + { + "navigationBarTitleText": "修改密码", + "enablePullDownRefresh": false + } + + } + ], "lazyCodeLoading": "requiredComponents", "globalStyle": { "pageOrientation": "portrait", diff --git a/supervise-uniapp/pages/home/MessageFragment.vue b/supervise-uniapp/pages/home/MessageFragment.vue index 355891de..435dbf31 100644 --- a/supervise-uniapp/pages/home/MessageFragment.vue +++ b/supervise-uniapp/pages/home/MessageFragment.vue @@ -1,6 +1,35 @@ @@ -9,17 +38,48 @@ export default { data() { return { + triggered: true, + status: 'loadmore', + iconType: 'flower', + loadText: { + loadmore: '轻轻上拉', + loading: '努力加载中', + nomore: '拉也没用,没有了' + }, + listQuery: { + current: 1, + size: 10, + params: { + userSid: "", + messageName: "", + state: "2", //0未读 1 已读 2全部 + } + }, + loadingType: 'more', //加载更多状态 + dataList: [ + ], }; }, - onShow() { - console.log('onShow', getApp().globalData.isLogin) - + onPullDownRefresh() { + this.listQuery.current = 1 + this.loadData('refresh'); + setTimeout(function() { + uni.stopPullDownRefresh(); + }, 2000); + }, + //加载更多 + onReachBottom() { + this.listQuery.current = this.listQuery.current + 1 + this.loadData(); + }, + onLoad() { + let token = uni.getStorageSync("Global-Auth-Token") if (token != null && token.length != 0) { getApp().globalData.token = token } - let isLogin =uni.getStorageSync("isLogin") + let isLogin = uni.getStorageSync("isLogin") if (isLogin != null && isLogin == 1) { getApp().globalData.isLogin = isLogin } @@ -27,26 +87,29 @@ if (sid != null && sid.length != 0) { getApp().globalData.sid = sid } - + console.log('用户Sid', getApp().globalData.sid) console.log('token', getApp().globalData.token) console.log('是否登陆', getApp().globalData.isLogin) - + // setTimeout(() => { if (getApp().globalData.isLogin) { var userSid = getApp().globalData.sid console.log(">>>>>", userSid) - // this.getData(userSid, true) + + this.listQuery.params.userSid = userSid + + this.loadData(); // uni.setTabBarBadge({ //显示数字 // index: 0, //tabbar下标 // text: '100' //数字 // }) } else { - + /* #ifdef MP-WEIXIN */ this.WxSilentLogin() /* #endif */ - + /* #ifdef APP-PLUS */ uni.redirectTo({ url: '../login/login' @@ -54,10 +117,214 @@ /* #endif */ } }, - methods: {} + onShow() { + console.log('onShow', getApp().globalData.isLogin) + + if (this.dataList.length > 0) { + var num = 0 + for (var i = 0; i < this.dataList.length; i++) { + var item = this.dataList[i] + if (item.ostate == '0') { + num++; + } + + } + + console.log('num', num) + if (num != 0) { + uni.setTabBarBadge({ //显示数字 + index: 1, //tabbar下标 + text: num > 100 ? "99+" : num + "" //数字 + }) + } + } + + }, + methods: { + itemClick(item) { + console.log('item', item.pagepath) + uni.navigateTo({ + url: "/" + item.pagepath + }) + + item.ostate = "2" + + + }, + //加载商品 ,带下拉刷新和上滑加载 + async loadData(type = 'add', loading) { + //没有更多直接返回 + if (type === 'add') { + if (this.loadingType === 'nomore') { + return; + } + this.loadingType = 'loading'; + } else { + this.loadingType = 'more'; + } + + var list = [] + + this.$api.messageListPage(this.listQuery).then((resp) => { + // if (resp.success) { + console.log('1111', resp) + + // list = resp.records + + for (var i = 0; i < resp.records.length; i++) { + var item = resp.records[i] + var title = item.map.thing2 + console.log("title", title) + + list.push({ + messageName: title, + name: item.map.thing3, + date: item.map.time1, + pagepath: item.pagepath, + ostate: item.ostate + }) + + } + + + + console.log("消息列表", list) + if (type === 'refresh') { + this.dataList = []; + } + + this.dataList = this.dataList.concat(list); + console.log("消息列表>>>>>", this.dataList.length) + + if (this.dataList.length > 0) { + var num = 0 + for (var i = 0; i < this.dataList.length; i++) { + var item = this.dataList[i] + if (item.ostate == '0') { + num++; + } + + } + if (num != 0) { + + uni.setTabBarBadge({ //显示数字 + index: 1, //tabbar下标 + text: num > 100 ? "99+" : num + "" //数字 + }) + } + } + + + //判断是否还有下一页,有是more 没有是nomore(测试数据判断大于20就没有了) + this.loadingType = this.dataList.length > list.total ? 'nomore' : 'more'; + if (type === 'refresh') { + if (loading == 1) { + uni.hideLoading(); + } else { + uni.stopPullDownRefresh(); + } + } + + }).catch(e => { + console.log('eeeee', e) + }) + + }, + + } } \ No newline at end of file diff --git a/supervise-uniapp/pages/home/UserFragment.vue b/supervise-uniapp/pages/home/UserFragment.vue index 1865a005..aea7e9f4 100644 --- a/supervise-uniapp/pages/home/UserFragment.vue +++ b/supervise-uniapp/pages/home/UserFragment.vue @@ -3,27 +3,29 @@ - + - {{info.name}} - 用户号:{{info.mobile}} + {{name}} + {{orgName}} - + + - - + + @@ -31,7 +33,8 @@ --> - + @@ -46,12 +49,9 @@ export default { data() { return { - baseUrl:"https://supervise.yxtsoft.com/img", - info: { - name: "石家庄市宇信通电子有限公司", - mobile: "651651351651", - - }, + baseUrl: "", + name: "", + orgName:"", version: "" }; }, @@ -67,14 +67,14 @@ /* #endif */ }, onShow() { - + console.log('onShow', getApp().globalData.isLogin) - + let token = uni.getStorageSync("Global-Auth-Token") if (token != null && token.length != 0) { getApp().globalData.token = token } - let isLogin =uni.getStorageSync("isLogin") + let isLogin = uni.getStorageSync("isLogin") if (isLogin != null && isLogin == 1) { getApp().globalData.isLogin = isLogin } @@ -82,36 +82,54 @@ if (sid != null && sid.length != 0) { getApp().globalData.sid = sid } - + console.log('用户Sid', getApp().globalData.sid) console.log('token', getApp().globalData.token) console.log('是否登陆', getApp().globalData.isLogin) - + // setTimeout(() => { if (getApp().globalData.isLogin) { var userSid = getApp().globalData.sid + var headImage = getApp().globalData.headImage + var username = getApp().globalData.username + var orgNamePath = getApp().globalData.orgNamePath console.log(">>>>>", userSid) + console.log(">>>>>", headImage) + console.log(">>>>>", username) + console.log(">>>>>", orgNamePath) + + this.name = username + this.orgName = orgNamePath==""?"暂无数据":orgNamePath + this.baseUrl = headImage==""?"https://supervise.yxtsoft.com/img/user/userImage.png":headImage + + // this.getData(userSid, true) // uni.setTabBarBadge({ //显示数字 // index: 0, //tabbar下标 // text: '100' //数字 // }) } else { - + /* #ifdef MP-WEIXIN */ this.WxSilentLogin() /* #endif */ - + /* #ifdef APP-PLUS */ uni.redirectTo({ url: '../login/login' }) /* #endif */ } - + }, methods: { + chooseImage(){ + uni.navigateTo({ + url: '../index/SetUp2' + }); + }, click(id) { + switch (id) { case "0": uni.navigateTo({ @@ -121,6 +139,9 @@ case "1": break; case "2": + uni.navigateTo({ + url: '../index/SetUp' + }); break; case "3": break; @@ -149,13 +170,14 @@ display: flex; flex-direction: row; align-items: center; - padding: 25px; + padding:15px 25px; .img { margin-top: 10px; margin-left: 10px; - width: 50px; - height: 50px; + width: 60px; + height: 60px; + border-radius: 5px; } .top_right { diff --git a/supervise-uniapp/pages/home/WorkFragment.vue b/supervise-uniapp/pages/home/WorkFragment.vue index cf8ee24c..f1dd2ed0 100644 --- a/supervise-uniapp/pages/home/WorkFragment.vue +++ b/supervise-uniapp/pages/home/WorkFragment.vue @@ -19,7 +19,7 @@ - + {{dyNum}} @@ -297,10 +297,19 @@ console.log('1111', resp) this.isShow = msg; this.dbNum = resp.todoNumber - this.dyNum = resp.pendingWork + this.dyNum = resp.pendingMessages this.textArr = resp.notice - this.swipers = resp.imageUrl - + this.swipers = resp.urls + + if(this.dyNum!=0){ + uni.setTabBarBadge({ //显示数字 + index: 1, //tabbar下标 + text: this.dyNum > 100 ? "99+" : this.dyNum + "" //数字 + }) + + } + + }).catch(e => { console.log('eeeee', e) }) @@ -310,40 +319,46 @@ switch (index) { case "1": // 待办 - uni.showToast({ - icon: "none", - title: '待办', - duration: 2000, - }); + // uni.showToast({ + // icon: "none", + // title: '待办', + // duration: 2000, + // }); uni.navigateTo({ url: '../index/WaitingProcessed' }); break; case "2": // 已办 - uni.showToast({ - icon: "none", - title: '已办', - duration: 2000, - }); + // uni.showToast({ + // icon: "none", + // title: '已办', + // duration: 2000, + // }); uni.navigateTo({ url: '../index/AlreadyProcessed' }); break; case "3": // 待阅 - uni.showToast({ - icon: "none", - title: '待阅', - duration: 2000, + // uni.showToast({ + // icon: "none", + // title: '待阅', + // duration: 2000, + // }); + uni.navigateTo({ + url: '../index/NotReadWork' }); break; case "4": // 已阅 - uni.showToast({ - icon: "none", - title: '已阅', - duration: 2000, + // uni.showToast({ + // icon: "none", + // title: '已阅', + // duration: 2000, + // }); + uni.navigateTo({ + url: '../index/ReadWork' }); break; default: diff --git a/supervise-uniapp/pages/index/ChangePassword.vue b/supervise-uniapp/pages/index/ChangePassword.vue new file mode 100644 index 00000000..2d893a65 --- /dev/null +++ b/supervise-uniapp/pages/index/ChangePassword.vue @@ -0,0 +1,167 @@ + + + + + \ No newline at end of file diff --git a/supervise-uniapp/pages/index/NotPermission.vue b/supervise-uniapp/pages/index/NotPermission.vue new file mode 100644 index 00000000..73706362 --- /dev/null +++ b/supervise-uniapp/pages/index/NotPermission.vue @@ -0,0 +1,35 @@ + + + + + diff --git a/supervise-uniapp/pages/index/NotReadWork.vue b/supervise-uniapp/pages/index/NotReadWork.vue new file mode 100644 index 00000000..33508c6c --- /dev/null +++ b/supervise-uniapp/pages/index/NotReadWork.vue @@ -0,0 +1,353 @@ + + + + + \ No newline at end of file diff --git a/supervise-uniapp/pages/index/ReadWork.vue b/supervise-uniapp/pages/index/ReadWork.vue new file mode 100644 index 00000000..b539f5d0 --- /dev/null +++ b/supervise-uniapp/pages/index/ReadWork.vue @@ -0,0 +1,356 @@ + + + + + \ No newline at end of file diff --git a/supervise-uniapp/pages/index/RegulatoryReporting.vue b/supervise-uniapp/pages/index/RegulatoryReporting.vue index 8131f85b..f9256bcb 100644 --- a/supervise-uniapp/pages/index/RegulatoryReporting.vue +++ b/supervise-uniapp/pages/index/RegulatoryReporting.vue @@ -121,6 +121,8 @@ params: { projectSid: "", orderDate: "", + wxCode:"", + userSid:"" }, info: { projectName: "", @@ -186,38 +188,42 @@ this.params = { projectSid: option.projectSid, - orderDate: option.orderDate + orderDate: option.orderDate, } }, onShow() { wx.hideHomeButton() + this.init() // setTimeout(() => { // }, 1000) - this.getServerData(); + console.log('userSid>>>>>>', getApp().globalData.sid) + this.params.userSid = getApp().globalData.sid + }, methods: { init() { - // var chart = this.$echarts.init(this.$refs["myChart"]); - // this.$refs["myChart"].getZr().on('click', params => { - - // let pointInPixel = [params.offsetX, params.offsetY] - - // if (chart.containPixel('grid', pointInPixel)) { - - // let xIndex = chart.convertFromPixel({ - // seriesIndex: 0 - // }, [params.offsetX, params.offsetY])[0] - - // console.log(xIndex) - - // this.select_index = xIndex - - // } - - // }) + let that = this + wx.login({ + success: function(res) { + if (res.code) { + console.log('Http网络请求信息', { + "wxCode": res.code + }) + + that.params.wxCode = res.code + that.getServerData(); + } + }, + fail: function(res) { + uni.showToast({ + title: "网络错误,请退出后重新进入。", + icon: 'none' + }) + } + }); }, getServerData() { @@ -327,6 +333,23 @@ }).catch(e => { console.log('eeeee', e) + + // code 410无权限 420需要绑定 + + if(e.code==410){ + uni.redirectTo({ + url:"/pages/index/NotPermission" + }) + + } + + if(e.code==420){ + uni.redirectTo({ + url:"/pages/index/BindPhone" + }) + } + + }) diff --git a/supervise-uniapp/pages/index/SetUp.vue b/supervise-uniapp/pages/index/SetUp.vue new file mode 100644 index 00000000..853525a2 --- /dev/null +++ b/supervise-uniapp/pages/index/SetUp.vue @@ -0,0 +1,56 @@ + + + + + \ No newline at end of file diff --git a/supervise-uniapp/pages/index/SetUp2.vue b/supervise-uniapp/pages/index/SetUp2.vue new file mode 100644 index 00000000..2f3f9e00 --- /dev/null +++ b/supervise-uniapp/pages/index/SetUp2.vue @@ -0,0 +1,114 @@ + + + + + \ No newline at end of file diff --git a/supervise-uniapp/pages/index/WarehouseDetaile.vue b/supervise-uniapp/pages/index/WarehouseDetaile.vue index 2081583d..e1fbcd7e 100644 --- a/supervise-uniapp/pages/index/WarehouseDetaile.vue +++ b/supervise-uniapp/pages/index/WarehouseDetaile.vue @@ -140,8 +140,19 @@ console.log('1111', resp) this.info = resp this.info.swipers =[] - this.info.swipers.push( - resp.picUrl) + + if(resp.pics.length==0){ + + this.info.swipers.push( + resp.picUrl) + }else{ + + for (var i = 0; i { console.log('eeeee', e) diff --git a/supervise-uniapp/pages/login/login.vue b/supervise-uniapp/pages/login/login.vue index 7cedb8e8..bec0266c 100644 --- a/supervise-uniapp/pages/login/login.vue +++ b/supervise-uniapp/pages/login/login.vue @@ -215,10 +215,10 @@ getApp().globalData.token = uinfo.token getApp().globalData.sid = uinfo.sid getApp().globalData.mobile = uinfo.mobile - getApp().globalData.name = uinfo.name getApp().globalData.isAdmin = uinfo.isAdmin - getApp().globalData.roleName = uinfo.roleName - getApp().globalData.staffSid = uinfo.staffSid + getApp().globalData.orgNamePath = uinfo.orgNamePath + getApp().globalData.organizationSid = uinfo.organizationSid + getApp().globalData.headImage = uinfo.headImage getApp().globalData.isLogin= true uni.setStorageSync("Global-Auth-Token", uinfo.token) diff --git a/supervise-uniapp/static/baseIcon/NotPermission.png b/supervise-uniapp/static/baseIcon/NotPermission.png new file mode 100644 index 00000000..1f0bbd1f Binary files /dev/null and b/supervise-uniapp/static/baseIcon/NotPermission.png differ diff --git a/supervise-uniapp/utils/requester.js b/supervise-uniapp/utils/requester.js index 86476061..4a3d1c46 100644 --- a/supervise-uniapp/utils/requester.js +++ b/supervise-uniapp/utils/requester.js @@ -93,11 +93,12 @@ const request = (options) => { }); } else { if (_opts.showFailMessage) { - uni.showToast({ - title: data.msg, - icon: 'none', - duration: 2000, - }) + console.log('1111') + // uni.showToast({ + // title: data.msg, + // icon: 'none', + // duration: 2000, + // }) } } reject(data) @@ -126,6 +127,7 @@ const request = (options) => { } } if (_opts.showFailMessage) { + console.log('22222') uni.showToast({ title: em.msg, icon: 'none', @@ -148,6 +150,7 @@ const request = (options) => { // em.msg = error.errMsg } if (_opts.showFailMessage) { + console.log('3333333') uni.showToast({ title: em.msg, icon: 'none',