diff --git a/supervise-uniapp/App.vue b/supervise-uniapp/App.vue index 7631e996..20f7924f 100644 --- a/supervise-uniapp/App.vue +++ b/supervise-uniapp/App.vue @@ -3,13 +3,13 @@ export default { globalData: { // wxSilentLoginURL: "https://supervise.yxtsoft.com/portal/v1/wxuser/wxSilentLogin", - wxSilentLoginURL: "http://192.168.1.193:8112/portal/v1/wxuser/wxSilentLogin", - wxAuthLoginURL: "http://192.168.1.193:8112/portal//v1/wxuser/wxAuthLogin", + wxSilentLoginURL: "https://supervise.yxtsoft.com/api/portal/v1/wxuser/wxSilentLogin", + wxAuthLoginURL: "https://supervise.yxtsoft.com/api/portal//v1/wxuser/wxAuthLogin", token: "", isLogin: false, - sysUserSid: "", + sid: "", }, //全局变量, - + onLaunch: function() { console.log("》》》》", 11111111); /* #ifdef APP-PLUS */ @@ -18,30 +18,12 @@ console.log("》》》》", 22222222222); - /* #ifdef MP-WEIXIN */ - this.WxSilentLogin() - /* #endif */ - - // let sysUserSid = this.ReadPreference("sysUserSid") - // if (sysUserSid != null && sysUserSid.length != 0) { - // this.globalData.sysUserSid = sysUserSid - // } - // let isLogin = this.ReadPreference("isLogin") - // if (isLogin != null && isLogin == 1) { - // this.globalData.isLogin = isLogin - // } - // let token = this.ReadPreference("token") - // if (token != null && token.length != 0) { - // this.globalData.token = token - // } - - // console.log('用户Sid', this.globalData.sysUserSid) - // console.log('是否登陆', this.globalData.isLogin) - // console.log('App', 'onLaunch') // // 不要删除 // console.log('高德地图定位Web服务key', '59970402d1c3f7dc1efff17d4dfcff21') }, - onShow: function() {}, + onShow: function() { + + }, onHide: function() {}, methods: { diff --git a/supervise-uniapp/common/bus.js b/supervise-uniapp/common/bus.js new file mode 100644 index 00000000..cb21a525 --- /dev/null +++ b/supervise-uniapp/common/bus.js @@ -0,0 +1,3 @@ +import Vue from 'vue' +const bus = new Vue() +export default bus \ No newline at end of file diff --git a/supervise-uniapp/common/config.js b/supervise-uniapp/common/config.js index 5b3780be..557825b9 100644 --- a/supervise-uniapp/common/config.js +++ b/supervise-uniapp/common/config.js @@ -7,8 +7,8 @@ */ module.exports = { // baseUrl: 'https://jianguan.yyundong.com/api', - // baseUrl: 'https://supervise.yxtsoft.com', - baseUrl: 'http://192.168.1.193:8112', + baseUrl: 'https://supervise.yxtsoft.com', + // baseUrl: 'http://192.168.1.193: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 1c365da2..70f2c5ac 100644 --- a/supervise-uniapp/common/request.api.js +++ b/supervise-uniapp/common/request.api.js @@ -1,17 +1,17 @@ import request from '@/utils/requester.js' export default { - login: (params = {}) => request.post("/portal/v1/sysuser/login", params), + login: (params = {}) => request.post("/api/portal/v1/sysuser/login", params), sayhello: (params = {}) => request.get("/sayb", params), getSalesReport: (params = {}) => request.get("/system/reportCenter/getSalesReport", params), getGoodsOnWay: (params = {}) => request.get("/system/reportCenter/getGoodsOnWay", params), getThresholdAnalysis: (params = {}) => request.get("/system/risk/getThresholdAnalysis", params), // 获取 验证码 - sendVerificationCode: (params = {}) => request.get("/portal/v1/wxuser/sendVerificationCode/" + params.phone + "/" + + sendVerificationCode: (params = {}) => request.get("/api/portal/v1/wxuser/sendVerificationCode/" + params.phone + "/" + params.type, params), // 绑定手机号 - wxBindMobile: (params = {}) => request.post("/portal/v1/wxuser/wxBindMobile",params), + wxBindMobile: (params = {}) => request.post("/api/portal/v1/wxuser/wxBindMobile",params), // 查看预警信息 selectBusinessRiskInfo: (params = {}) => request.post("/wxmpapi/v1/businessData/selectBusinessRiskInfo", params), @@ -52,25 +52,38 @@ export default { getDayProduct: (params = {}) => request.get( "/reportwxmpapi/reportstock/getDayProduct/" + params, params), // "/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), + + // 项目监管报表 + getProjectDailyFiles: (params = {}) => request.get( + "/reportwxmpapi/projectdaily/getProjectDailyFiles/" + params.projectSid + "/" + params.orderDate, params), + // "/report/projectdaily/getProjectDailyFiles/" + params.projectSid + "/" + params.orderDate, params), + + + // 获取首页面数据 - getWorkData: (params = {}) => request.get("/portal/v1/flow/task/" + params, params), + getWorkData: (params = {}) => request.get("/api/portal/v1/flow/task/" + params, params), // 获取云仓列表 - storeHouseListPage: (params = {}) => request.post("/portal/v1/flow/storeHouseListPage", params), + storeHouseListPage: (params = {}) => request.post("/api/portal/v1/flow/storeHouseListPage", params), // 获取云仓详情 - storeHouseDetail: (params = {}) => request.get("/portal/v1/flow/fetchDetailsBySid/" + params, params), + storeHouseDetail: (params = {}) => request.get("/api/portal/v1/flow/fetchDetailsBySid/" + params, params), // 获取我的项目 - getProjectByUserSid: (params = {}) => request.get("/crm/v1/projectinformation/getProjectByUserSid/" + params, + getProjectByUserSid: (params = {}) => request.get("/api/crm/v1/projectinformation/getProjectByUserSid/" + params, params), // 获取我的项目详情 - getProjectBySid: (params = {}) => request.get("/crm/v1/projectinformation/getProjectBySid/" + params, + getProjectBySid: (params = {}) => request.get("/api/crm/v1/projectinformation/getProjectBySid/" + params, params), // 获取我的项目-仓库详情 - getStorehouseBySid: (params = {}) => request.get("/crm/v1/projectinformation/getStorehouseBySid/" + params, + getStorehouseBySid: (params = {}) => request.get("/api/crm/v1/projectinformation/getStorehouseBySid/" + params, params), } \ No newline at end of file diff --git a/supervise-uniapp/common/wxSilentLogin.js b/supervise-uniapp/common/wxSilentLogin.js index 48dac231..5a395b49 100644 --- a/supervise-uniapp/common/wxSilentLogin.js +++ b/supervise-uniapp/common/wxSilentLogin.js @@ -2,16 +2,18 @@ import { isEmpty } from './TextUtils.js' + +//引入bus +import bus from '@/common/bus'; + const wxSilentLogin = () => { return new Promise((resolve, reject) => { wx.login({ success: function(res) { if (res.code) { - if (getApp().globalData.isDebug) { - console.log('Http网络请求信息', { - "wxCode": res.code - }) - } + console.log('Http网络请求信息', { + "wxCode": res.code + }) uni.request({ // 组装请求地址 url: getApp().globalData.wxSilentLoginURL + "?wxCode=" + res @@ -27,7 +29,7 @@ const wxSilentLogin = () => { "wxCode": res.code }, success: res => { - console.log(res) + console.log("请求openid", res) // if (getApp().globalData.isDebug) { // console.log('Http网络路径', getApp().globalData // .wxSilentLoginURL) @@ -35,37 +37,56 @@ const wxSilentLogin = () => { if (res.statusCode == 200) { if (!res.data.success) { - if (res.data.code == 500) { - // 未关注小程序 首次登录 也无账号 - uni.showToast({ - title: "您的平台应用未被授权,请联系工作人员。", - icon: 'none', - duration: 3000, - }) - wx.exitMiniProgram({ - success: function() {}, - fail: function() {} - }) - return - } + // if (res.data.code == 500) { + // uni.showModal({ + // title: '温馨提示', + // content: '您的平台应用未被授权,请联系工作人员。', + // showCancel: false, + // success: function(res) { + // if (res.confirm) { + // wx.exitMiniProgram({ + // success: function() {}, + // fail: function() {} + // }) + // } else { + // console.log('点击了取消') + // } + // } + // }) + - if (res.data.code == 100) { - // 有账号 未绑定用户 - uni.redirectTo({ - url: '../index/BindPhone?sysUserWxAuthSid=' + - res.data.data - }) - } + // return + // } + + // if (res.data.code == 100) { + // 未绑定用户 + uni.navigateTo({ + url: '../index/BindPhone?sysUserWxAuthSid=' + + res.data.data + }) + // } } else { + console.log("Http网络请求res", res) - console.log("Global-Auth-Token", res.data.data.token) - uni.setStorageSync("Global-Auth-Token", res.data.data.token) - getApp().globalData.username = res.data.data.userName + console.log("Global-Auth-Token", res.data.data + .token) + + + getApp().globalData.username = res.data.data + .userName 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.mobile = res.data.data + .mobile + getApp().globalData.isLogin = true + + uni.setStorageSync("Global-Auth-Token", res.data + .data.token) + uni.setStorageSync("sid", res.data.data.sid) + uni.setStorageSync("isLogin", true) + + bus.$emit('wholeSpin', true); } } else { getApp().globalData.isLogin = false diff --git a/supervise-uniapp/main.js b/supervise-uniapp/main.js index ce2c43ec..3aca1cf1 100644 --- a/supervise-uniapp/main.js +++ b/supervise-uniapp/main.js @@ -17,6 +17,16 @@ Vue.mixin(mpShare) // #endif Vue.mixin(mixin) + +import bus from './common/bus.js'; + +//挂载到this上 +Vue.prototype.$bus = bus; + +// // 在main.js中引入并挂载到vue的对象原型上 +// const jweixin = require('weixin-js-sdk'); +// Vue.prototype.$wechat = jweixin; + import api from '@/common/request.api.js' Vue.prototype.$api = api diff --git a/supervise-uniapp/manifest.json b/supervise-uniapp/manifest.json index c7e6e491..35b8263b 100644 --- a/supervise-uniapp/manifest.json +++ b/supervise-uniapp/manifest.json @@ -1,5 +1,5 @@ { - "name" : "监管平台", + "name" : "汇融云仓贷后", "appid" : "__UNI__DD73AA7", "description" : "汇融银行监管平台", "versionName" : "1.0.0.8", @@ -155,7 +155,7 @@ "h5" : { "template" : "template.h5.html", "router" : { - "mode" : "history", + "mode" : "hash", "base" : "" }, "optimization" : { diff --git a/supervise-uniapp/pages.json b/supervise-uniapp/pages.json index 5ff64daa..84db42d1 100644 --- a/supervise-uniapp/pages.json +++ b/supervise-uniapp/pages.json @@ -10,13 +10,16 @@ "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages -{ - "path": "pages/index/InventorySummary", + + { + "path": "pages/index/RegulatoryReporting", "style": { - "navigationBarTitleText": "质物库存汇总" + "navigationBarTitleText": "监管数据总览" } - }, - /* #ifdef APP-PLUS */ + }, + + // #ifdef APP-PLUS + { "path": "pages/login/login", "style": { @@ -26,7 +29,7 @@ } } }, - /* #endif */ + // #endif { "path": "pages/home/WorkFragment", @@ -35,27 +38,92 @@ } }, + { + "path": "pages/index/AlreadyProcessed", + "style": { + "navigationBarTitleText": "已办工作", + "enablePullDownRefresh": true + } + + },{ + "path": "pages/index/WaitingProcessed", + "style": { + "navigationBarTitleText": "待办工作", + "enablePullDownRefresh": true + } + + }, + { + "path": "pages/index/MyProject", + "style": { + "navigationBarTitleText": "我的项目" + } + + }, + + + { + "path": "pages/index/UserPrompt", + "style": { + "navigationBarTitleText": "用户须知", + "navigationStyle": "custom", + "app-plus": { + "scrollIndicator": false //禁用原生导航栏, + } + } + + }, + { "path": "pages/index/BindPhone", "style": { - "navigationBarTitleText": "绑定手机号" + "navigationBarTitleText": "绑定手机号", + "navigationStyle": "custom", + "app-plus": { + "scrollIndicator": false //禁用原生导航栏, + } + } + + }, + + { + "path": "pages/index/RegulatoryReportingDownload", + "style": { + "navigationBarTitleText": "项目监管报表" } - - }, { - "path": "pages/index/WaitingProcessed", + }, + { + "path": "pages/index/AccountBalance", "style": { - "navigationBarTitleText": "待办工作", - "enablePullDownRefresh": true + "navigationBarTitleText": "账户余额" } - - }, { - "path": "pages/index/AlreadyProcessed", + }, + { + "path": "pages/index/AdvanceCharge", "style": { - "navigationBarTitleText": "已办工作", - "enablePullDownRefresh": true + "navigationBarTitleText": "预付款" } - }, + { + "path": "pages/index/GoodsInTransit", + "style": { + "navigationBarTitleText": "在途货物" + } + }, + { + "path": "pages/index/Accounts", + "style": { + "navigationBarTitleText": "应收账款" + } + },{ + "path": "pages/index/InventorySummary", + "style": { + "navigationBarTitleText": "质物库存汇总" + } + }, + + + { "path": "pages/index/InventorySummaryDetail", "style": { @@ -78,13 +146,7 @@ } }, - { - "path": "pages/index/MyProject", - "style": { - "navigationBarTitleText": "我的项目" - } - - }, { + { "path": "pages/index/ProjectDetail", "style": { "navigationBarTitleText": "项目详情" @@ -141,7 +203,7 @@ "lazyCodeLoading": "requiredComponents", "globalStyle": { "pageOrientation": "portrait", - "navigationBarTitleText": "Hello uniapp", + "navigationBarTitleText": "云仓贷后", "navigationBarTextStyle": "white", "navigationBarBackgroundColor": "#007AFF", "backgroundColor": "#F8F8F8", diff --git a/supervise-uniapp/pages/home/MessageFragment.vue b/supervise-uniapp/pages/home/MessageFragment.vue index 88ca6326..355891de 100644 --- a/supervise-uniapp/pages/home/MessageFragment.vue +++ b/supervise-uniapp/pages/home/MessageFragment.vue @@ -12,6 +12,48 @@ }; }, + 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") + if (isLogin != null && isLogin == 1) { + getApp().globalData.isLogin = isLogin + } + let sid = uni.getStorageSync("sid") + 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) + // uni.setTabBarBadge({ //显示数字 + // index: 0, //tabbar下标 + // text: '100' //数字 + // }) + } else { + + /* #ifdef MP-WEIXIN */ + this.WxSilentLogin() + /* #endif */ + + /* #ifdef APP-PLUS */ + uni.redirectTo({ + url: '../login/login' + }) + /* #endif */ + } + }, methods: {} } diff --git a/supervise-uniapp/pages/home/UserFragment.vue b/supervise-uniapp/pages/home/UserFragment.vue index 785627fd..52e32e32 100644 --- a/supervise-uniapp/pages/home/UserFragment.vue +++ b/supervise-uniapp/pages/home/UserFragment.vue @@ -3,7 +3,7 @@ - + @@ -14,24 +14,24 @@ - + - + - + - - + + @@ -46,7 +46,7 @@ export default { data() { return { - baseUrl:"https://jianguan.yyundong.com/img", + baseUrl:"https://supervise.yxtsoft.com/img", info: { name: "石家庄市宇信通电子有限公司", mobile: "651651351651", @@ -66,6 +66,50 @@ /* #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") + if (isLogin != null && isLogin == 1) { + getApp().globalData.isLogin = isLogin + } + let sid = uni.getStorageSync("sid") + 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) + // uni.setTabBarBadge({ //显示数字 + // index: 0, //tabbar下标 + // text: '100' //数字 + // }) + } else { + + /* #ifdef MP-WEIXIN */ + this.WxSilentLogin() + /* #endif */ + + /* #ifdef APP-PLUS */ + uni.redirectTo({ + url: '../login/login' + }) + /* #endif */ + } + + }, methods: { click(id) { switch (id) { diff --git a/supervise-uniapp/pages/home/WorkFragment.vue b/supervise-uniapp/pages/home/WorkFragment.vue index 279db8ac..aa4d90fb 100644 --- a/supervise-uniapp/pages/home/WorkFragment.vue +++ b/supervise-uniapp/pages/home/WorkFragment.vue @@ -1,139 +1,155 @@