Commit c47dee1df0c1aed125bc47f045b35ebf815fdf55
Merge branch 'dev-ft' into 'main'
feat:新增通知管理接口,通知详情接口,新增告警分页接口,新增告警详情接口,新增告警处理接口,新增告警筛选接口 See merge request huang/thingskit-app!13
Showing
34 changed files
with
1406 additions
and
880 deletions
@@ -39,7 +39,7 @@ function getUserInfo(successCallback,errorCallback) { | @@ -39,7 +39,7 @@ function getUserInfo(successCallback,errorCallback) { | ||
39 | }); | 39 | }); |
40 | // #ifdef MP-WEIXIN | 40 | // #ifdef MP-WEIXIN |
41 | uni.getUserProfile({ | 41 | uni.getUserProfile({ |
42 | - desc: '用于完善会员资料', | 42 | + desc: '用于完善个人资料', |
43 | success: function(res) { | 43 | success: function(res) { |
44 | uni.hideLoading() | 44 | uni.hideLoading() |
45 | var offUserInfo = res.userInfo | 45 | var offUserInfo = res.userInfo |
@@ -15,12 +15,8 @@ | @@ -15,12 +15,8 @@ | ||
15 | <block v-for="(item, index) in list" :key="index"> | 15 | <block v-for="(item, index) in list" :key="index"> |
16 | <!-- 自定义icon --> | 16 | <!-- 自定义icon --> |
17 | <u-tabbar-item :text="item.name" :badge="item.badge" :dot="item.dot" :badgeStyle="item.badgeStyle"> | 17 | <u-tabbar-item :text="item.name" :badge="item.badge" :dot="item.dot" :badgeStyle="item.badgeStyle"> |
18 | - <view slot="active-icon"> | ||
19 | - <view class="custom-icon" :class="['custom-icon-' + item.iconFill]" style="font-size: 20px;" :style="{ color: activeColor }"></view> | ||
20 | - </view> | ||
21 | - <view slot="inactive-icon"> | ||
22 | - <view class="custom-icon" :class="['custom-icon-' + item.icon]" style="font-size: 20px;" :style="{ color: inactiveColor }"></view> | ||
23 | - </view> | 18 | + <view slot="active-icon"><image style="width:30rpx;height: 30rpx;" :src="item.iconFill" mode=""></image></view> |
19 | + <view slot="inactive-icon"><image style="width:30rpx;height: 30rpx;" :src="item.icon" mode=""></image></view> | ||
24 | </u-tabbar-item> | 20 | </u-tabbar-item> |
25 | </block> | 21 | </block> |
26 | </u-tabbar> | 22 | </u-tabbar> |
@@ -90,31 +86,32 @@ export default { | @@ -90,31 +86,32 @@ export default { | ||
90 | { | 86 | { |
91 | name: '首页', | 87 | name: '首页', |
92 | url: 'pages/index/index', | 88 | url: 'pages/index/index', |
93 | - icon: 'home', | ||
94 | - iconFill: 'home-filling' | 89 | + icon: '../../../static/homw-un.png', |
90 | + iconFill: '../../../static/home-yes.png' | ||
95 | }, | 91 | }, |
96 | { | 92 | { |
97 | name: '设备', | 93 | name: '设备', |
98 | url: 'pages/device/device', | 94 | url: 'pages/device/device', |
99 | - icon: 'shangpin', | ||
100 | - iconFill: 'shangpin-filling' | 95 | + icon: '../../../static/device-un.png', |
96 | + iconFill: '../../../static/device-yes.png' | ||
101 | }, | 97 | }, |
102 | { | 98 | { |
103 | name: '告警', | 99 | name: '告警', |
104 | url: 'pages/alert/alert', | 100 | url: 'pages/alert/alert', |
105 | - icon: 'shangpin', | ||
106 | - iconFill: 'shangpin-filling', | ||
107 | - badge: 16 | 101 | + icon: '../../../static/alert-un.png', |
102 | + iconFill: '../../../static/alert-yes.png', | ||
103 | + badge: 0 | ||
108 | }, | 104 | }, |
109 | { | 105 | { |
110 | name: '我的', | 106 | name: '我的', |
111 | url: 'pages/personal/personal', | 107 | url: 'pages/personal/personal', |
112 | - icon: 'my', | ||
113 | - iconFill: 'my-filling' | 108 | + icon: '../../../static/my-un.png', |
109 | + iconFill: '../../../static/my-yes.png' | ||
114 | } | 110 | } |
115 | ] | 111 | ] |
116 | }; | 112 | }; |
117 | }, | 113 | }, |
114 | + onLoad() {}, | ||
118 | created() { | 115 | created() { |
119 | //获取页面路径 | 116 | //获取页面路径 |
120 | let currentPages = getCurrentPages(); | 117 | let currentPages = getCurrentPages(); |
@@ -128,7 +125,24 @@ export default { | @@ -128,7 +125,24 @@ export default { | ||
128 | }); | 125 | }); |
129 | }, | 126 | }, |
130 | methods: { | 127 | methods: { |
128 | + loadData() { | ||
129 | + let httpData = { | ||
130 | + page: 1, | ||
131 | + pageSize: 10 | ||
132 | + }; | ||
133 | + uni.$u.http | ||
134 | + .get('/yt/alarm', { params: httpData }) | ||
135 | + .then(res => { | ||
136 | + this.list[2].badge = res.total; | ||
137 | + }) | ||
138 | + .catch(e => { | ||
139 | + uni.$u.toast(e.data?.message); | ||
140 | + }); | ||
141 | + }, | ||
131 | onTabbar(index) { | 142 | onTabbar(index) { |
143 | + if (index !== 5) { | ||
144 | + this.loadData(); | ||
145 | + } | ||
132 | if (this.path !== this.list[index].url) { | 146 | if (this.path !== this.list[index].url) { |
133 | uni.switchTab({ | 147 | uni.switchTab({ |
134 | url: '/' + this.list[index].url | 148 | url: '/' + this.list[index].url |
1 | import store from '@/store'; | 1 | import store from '@/store'; |
2 | import base from "@/config/baseUrl"; | 2 | import base from "@/config/baseUrl"; |
3 | import QQMapWX from '@/plugins/qqmap-wx-jssdk.js'; | 3 | import QQMapWX from '@/plugins/qqmap-wx-jssdk.js'; |
4 | -import { getAppLatLon} from '@/plugins/utils'; | 4 | +import { |
5 | + getAppLatLon | ||
6 | +} from '@/plugins/utils'; | ||
5 | 7 | ||
6 | //檢查小程序更新 | 8 | //檢查小程序更新 |
7 | -function mpUpData(callback){ | ||
8 | - if (uni.getUpdateManager) { | ||
9 | - const updateManager = uni.getUpdateManager(); | ||
10 | - updateManager.onCheckForUpdate(function(res) { | ||
11 | - // 请求完新版本信息的回调 | ||
12 | - // console.log(res.hasUpdate); | ||
13 | - // if(!res.hasUpdate){ | ||
14 | - // uni.showToast({ | ||
15 | - // title: '当前没有新版发布~', | ||
16 | - // duration: 2000 | ||
17 | - // }); | ||
18 | - // } | ||
19 | - let info = { | ||
20 | - type: 1, | ||
21 | - data: res | ||
22 | - } | ||
23 | - callback && callback(info) | ||
24 | - }); | ||
25 | - updateManager.onUpdateReady(function(res) { | ||
26 | - uni.showModal({ | ||
27 | - title: "更新提示", | ||
28 | - content: "检测到新版本,是否下载新版本并重启小程序?", | ||
29 | - success(res) { | ||
30 | - if (res.confirm) { | ||
31 | - // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启 | ||
32 | - updateManager.applyUpdate(); | ||
33 | - } | ||
34 | - } | ||
35 | - }); | ||
36 | - }); | ||
37 | - updateManager.onUpdateFailed(function(res) { | ||
38 | - // 新的版本下载失败 | ||
39 | - uni.showModal({ | ||
40 | - title: "已经有新版本了哟~", | ||
41 | - content: "新版本已经上线啦~,请您删除当前小程序,重新搜索打开哟~", | ||
42 | - showCancel: false | ||
43 | - }); | ||
44 | - }); | ||
45 | - }else { | ||
46 | - // 如果希望用户在最新版本的客户端上体验您的小程序,可以这样子提示 | ||
47 | - // uni.showModal({ | ||
48 | - // title: '提示', | ||
49 | - // content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。' | ||
50 | - // }) | ||
51 | - let info = { | ||
52 | - type: 2 | ||
53 | - } | ||
54 | - callback && callback(info) | ||
55 | - } | 9 | +function mpUpData(callback) { |
10 | + if (uni.getUpdateManager) { | ||
11 | + const updateManager = uni.getUpdateManager(); | ||
12 | + updateManager.onCheckForUpdate(function(res) { | ||
13 | + // 请求完新版本信息的回调 | ||
14 | + // console.log(res.hasUpdate); | ||
15 | + // if(!res.hasUpdate){ | ||
16 | + // uni.showToast({ | ||
17 | + // title: '当前没有新版发布~', | ||
18 | + // duration: 2000 | ||
19 | + // }); | ||
20 | + // } | ||
21 | + let info = { | ||
22 | + type: 1, | ||
23 | + data: res | ||
24 | + } | ||
25 | + callback && callback(info) | ||
26 | + }); | ||
27 | + updateManager.onUpdateReady(function(res) { | ||
28 | + uni.showModal({ | ||
29 | + title: "更新提示", | ||
30 | + content: "检测到新版本,是否下载新版本并重启小程序?", | ||
31 | + success(res) { | ||
32 | + if (res.confirm) { | ||
33 | + // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启 | ||
34 | + updateManager.applyUpdate(); | ||
35 | + } | ||
36 | + } | ||
37 | + }); | ||
38 | + }); | ||
39 | + updateManager.onUpdateFailed(function(res) { | ||
40 | + // 新的版本下载失败 | ||
41 | + uni.showModal({ | ||
42 | + title: "已经有新版本了哟~", | ||
43 | + content: "新版本已经上线啦~,请您删除当前小程序,重新搜索打开哟~", | ||
44 | + showCancel: false | ||
45 | + }); | ||
46 | + }); | ||
47 | + } else { | ||
48 | + // 如果希望用户在最新版本的客户端上体验您的小程序,可以这样子提示 | ||
49 | + // uni.showModal({ | ||
50 | + // title: '提示', | ||
51 | + // content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。' | ||
52 | + // }) | ||
53 | + let info = { | ||
54 | + type: 2 | ||
55 | + } | ||
56 | + callback && callback(info) | ||
57 | + } | ||
56 | } | 58 | } |
57 | 59 | ||
58 | // App计算缓存 | 60 | // App计算缓存 |
59 | -function formatSize(callback){ | ||
60 | - let fileSizeString = "0B"; | ||
61 | - plus.cache.calculate(function(size) { | ||
62 | - let sizeCache = parseInt(size); | ||
63 | - if (sizeCache == 0) { | ||
64 | - fileSizeString = "0B"; | ||
65 | - } else if (sizeCache < 1024) { | ||
66 | - fileSizeString = sizeCache + "B"; | ||
67 | - } else if (sizeCache < 1048576) { | ||
68 | - fileSizeString = (sizeCache / 1024).toFixed(2) + "KB"; | ||
69 | - } else if (sizeCache < 1073741824) { | ||
70 | - fileSizeString = (sizeCache / 1048576).toFixed(2) + "MB"; | ||
71 | - } else { | ||
72 | - fileSizeString = (sizeCache / 1073741824).toFixed(2) + "GB"; | ||
73 | - } | ||
74 | - callback && callback(fileSizeString) | ||
75 | - }); | 61 | +function formatSize(callback) { |
62 | + let fileSizeString = "0B"; | ||
63 | + plus.cache.calculate(function(size) { | ||
64 | + let sizeCache = parseInt(size); | ||
65 | + if (sizeCache == 0) { | ||
66 | + fileSizeString = "0B"; | ||
67 | + } else if (sizeCache < 1024) { | ||
68 | + fileSizeString = sizeCache + "B"; | ||
69 | + } else if (sizeCache < 1048576) { | ||
70 | + fileSizeString = (sizeCache / 1024).toFixed(2) + "KB"; | ||
71 | + } else if (sizeCache < 1073741824) { | ||
72 | + fileSizeString = (sizeCache / 1048576).toFixed(2) + "MB"; | ||
73 | + } else { | ||
74 | + fileSizeString = (sizeCache / 1073741824).toFixed(2) + "GB"; | ||
75 | + } | ||
76 | + callback && callback(fileSizeString) | ||
77 | + }); | ||
76 | } | 78 | } |
77 | /* | 79 | /* |
78 | * App清理缓存 | 80 | * App清理缓存 |
79 | * fileSizeString:当前缓存 | 81 | * fileSizeString:当前缓存 |
80 | */ | 82 | */ |
81 | -function clearCache(fileSizeString){ | ||
82 | - if(fileSizeString == '0B'){ | ||
83 | - uni.showToast({ | ||
84 | - title: '暂无缓存~', | ||
85 | - duration: 2000, | ||
86 | - icon: 'none' | ||
87 | - }); | ||
88 | - return | ||
89 | - } | ||
90 | - return new Promise((resolve, reject) => { | ||
91 | - let os = plus.os.name; | ||
92 | - if (os == 'Android') { | ||
93 | - let main = plus.android.runtimeMainActivity(); | ||
94 | - let sdRoot = main.getCacheDir(); | ||
95 | - let files = plus.android.invoke(sdRoot, "listFiles"); | ||
96 | - let len = files.length; | ||
97 | - for (let i = 0; i < len; i++) { | ||
98 | - let filePath = '' + files[i]; // 没有找到合适的方法获取路径,这样写可以转成文件路径 | ||
99 | - plus.io.resolveLocalFileSystemURL(filePath, function(entry) { | ||
100 | - if (entry.isDirectory) { | ||
101 | - entry.removeRecursively(function(entry) { //递归删除其下的所有文件及子目录 | ||
102 | - uni.showToast({ | ||
103 | - title: '缓存清理完成', | ||
104 | - duration: 2000 | ||
105 | - }); | ||
106 | - // 回调 | ||
107 | - resolve() | ||
108 | - }, function(e) { | ||
109 | - console.log(e.message) | ||
110 | - }); | ||
111 | - } else { | ||
112 | - entry.remove(); | ||
113 | - } | ||
114 | - }, function(e) { | ||
115 | - console.log('文件路径读取失败') | ||
116 | - }); | ||
117 | - } | ||
118 | - } else { // ios | ||
119 | - plus.cache.clear(function() { | ||
120 | - uni.showToast({ | ||
121 | - title: '缓存清理完成', | ||
122 | - duration: 2000 | ||
123 | - }); | ||
124 | - // 回调 | ||
125 | - resolve() | ||
126 | - }); | ||
127 | - } | ||
128 | - }); | 83 | +function clearCache(fileSizeString) { |
84 | + if (fileSizeString == '0B') { | ||
85 | + uni.showToast({ | ||
86 | + title: '暂无缓存~', | ||
87 | + duration: 2000, | ||
88 | + icon: 'none' | ||
89 | + }); | ||
90 | + return | ||
91 | + } | ||
92 | + return new Promise((resolve, reject) => { | ||
93 | + let os = plus.os.name; | ||
94 | + if (os == 'Android') { | ||
95 | + let main = plus.android.runtimeMainActivity(); | ||
96 | + let sdRoot = main.getCacheDir(); | ||
97 | + let files = plus.android.invoke(sdRoot, "listFiles"); | ||
98 | + let len = files.length; | ||
99 | + for (let i = 0; i < len; i++) { | ||
100 | + let filePath = '' + files[i]; // 没有找到合适的方法获取路径,这样写可以转成文件路径 | ||
101 | + plus.io.resolveLocalFileSystemURL(filePath, function(entry) { | ||
102 | + if (entry.isDirectory) { | ||
103 | + entry.removeRecursively(function(entry) { //递归删除其下的所有文件及子目录 | ||
104 | + uni.showToast({ | ||
105 | + title: '缓存清理完成', | ||
106 | + duration: 2000 | ||
107 | + }); | ||
108 | + // 回调 | ||
109 | + resolve() | ||
110 | + }, function(e) { | ||
111 | + console.log(e.message) | ||
112 | + }); | ||
113 | + } else { | ||
114 | + entry.remove(); | ||
115 | + } | ||
116 | + }, function(e) { | ||
117 | + console.log('文件路径读取失败') | ||
118 | + }); | ||
119 | + } | ||
120 | + } else { // ios | ||
121 | + plus.cache.clear(function() { | ||
122 | + uni.showToast({ | ||
123 | + title: '缓存清理完成', | ||
124 | + duration: 2000 | ||
125 | + }); | ||
126 | + // 回调 | ||
127 | + resolve() | ||
128 | + }); | ||
129 | + } | ||
130 | + }); | ||
129 | } | 131 | } |
130 | 132 | ||
131 | //e 扫码参数 | 133 | //e 扫码参数 |
132 | //flag uni.scanCode方法点击扫码的参数没有q,为true转换参数 | 134 | //flag uni.scanCode方法点击扫码的参数没有q,为true转换参数 |
133 | -function scene(e,callback,flag=false){ | ||
134 | - store.commit("setChatScenesInfo", {});//先请空 | ||
135 | - console.log(e,'scene') | ||
136 | - var qrCodeValue = '' | ||
137 | - // #ifndef MP-ALIPAY | ||
138 | - if(flag){ | ||
139 | - e.query = {q:e.result} | ||
140 | - console.log(e,'scene-转换后') | ||
141 | - } | ||
142 | - if(e.query.q){ | ||
143 | - let scene = decodeURIComponent(e.query.q).split("?")[1]; | ||
144 | - scene = scene.split("&"); | ||
145 | - let data = { | ||
146 | - //场景值 | ||
147 | - scene: e.scene, | ||
148 | - }; | ||
149 | - scene.forEach(item => { | ||
150 | - let arr = item.split("="); | ||
151 | - if (arr.length == 2) { | ||
152 | - data[arr[0]] = arr[1]; | ||
153 | - } | ||
154 | - }); | ||
155 | - store.commit("setChatScenesInfo", Object.assign(e.query, data)); | ||
156 | - console.log(store.state.chatScenesInfo,'scene--解码参数') | ||
157 | - }else{ | ||
158 | - store.commit("setChatScenesInfo", Object.assign(e.query, {path:e.path})); | ||
159 | - } | ||
160 | - // #endif | ||
161 | - // #ifdef MP-ALIPAY | ||
162 | - var AliqrCode = {} | ||
163 | - if(flag){ | ||
164 | - e.query = {qrCode:e.result} | ||
165 | - console.log(e,'scene-转换后') | ||
166 | - } | ||
167 | - if (e.query && e.query.qrCode) { | ||
168 | - AliqrCode.q = e.query.qrCode; | ||
169 | - } else if (e.query && !e.query.qrCode) { | ||
170 | - AliqrCode = e.query; | ||
171 | - } | ||
172 | - if (AliqrCode.q) { | ||
173 | - var queryParam = AliqrCode.q.split("?")[1] //二维码清除域名 | ||
174 | - var scene = queryParam.split("&"); | ||
175 | - let data = {}; | ||
176 | - scene.forEach(item => { | ||
177 | - let arr = item.split("="); | ||
178 | - if (arr.length == 2) { | ||
179 | - data[arr[0]] = arr[1]; | ||
180 | - } | ||
181 | - }); | ||
182 | - store.commit("setChatScenesInfo", Object.assign(AliqrCode, data)); | ||
183 | - console.log(store.state.chatScenesInfo,'scene--支付宝小程序解码参数') | ||
184 | - }else{ | ||
185 | - store.commit("setChatScenesInfo", Object.assign(AliqrCode, {path:e.path})); | ||
186 | - } | ||
187 | - // #endif | ||
188 | - callback && callback() | 135 | +function scene(e, callback, flag = false) { |
136 | + store.commit("setChatScenesInfo", {}); //先请空 | ||
137 | + console.log(e, 'scene') | ||
138 | + var qrCodeValue = '' | ||
139 | + // #ifndef MP-ALIPAY | ||
140 | + if (flag) { | ||
141 | + e.query = { | ||
142 | + q: e.result | ||
143 | + } | ||
144 | + console.log(e, 'scene-转换后') | ||
145 | + } | ||
146 | + if (e.query.q) { | ||
147 | + let scene = decodeURIComponent(e.query.q).split("?")[1]; | ||
148 | + scene = scene.split("&"); | ||
149 | + let data = { | ||
150 | + //场景值 | ||
151 | + scene: e.scene, | ||
152 | + }; | ||
153 | + scene.forEach(item => { | ||
154 | + let arr = item.split("="); | ||
155 | + if (arr.length == 2) { | ||
156 | + data[arr[0]] = arr[1]; | ||
157 | + } | ||
158 | + }); | ||
159 | + store.commit("setChatScenesInfo", Object.assign(e.query, data)); | ||
160 | + console.log(store.state.chatScenesInfo, 'scene--解码参数') | ||
161 | + } else { | ||
162 | + store.commit("setChatScenesInfo", Object.assign(e.query, { | ||
163 | + path: e.path | ||
164 | + })); | ||
165 | + } | ||
166 | + // #endif | ||
167 | + // #ifdef MP-ALIPAY | ||
168 | + var AliqrCode = {} | ||
169 | + if (flag) { | ||
170 | + e.query = { | ||
171 | + qrCode: e.result | ||
172 | + } | ||
173 | + console.log(e, 'scene-转换后') | ||
174 | + } | ||
175 | + if (e.query && e.query.qrCode) { | ||
176 | + AliqrCode.q = e.query.qrCode; | ||
177 | + } else if (e.query && !e.query.qrCode) { | ||
178 | + AliqrCode = e.query; | ||
179 | + } | ||
180 | + if (AliqrCode.q) { | ||
181 | + var queryParam = AliqrCode.q.split("?")[1] //二维码清除域名 | ||
182 | + var scene = queryParam.split("&"); | ||
183 | + let data = {}; | ||
184 | + scene.forEach(item => { | ||
185 | + let arr = item.split("="); | ||
186 | + if (arr.length == 2) { | ||
187 | + data[arr[0]] = arr[1]; | ||
188 | + } | ||
189 | + }); | ||
190 | + store.commit("setChatScenesInfo", Object.assign(AliqrCode, data)); | ||
191 | + console.log(store.state.chatScenesInfo, 'scene--支付宝小程序解码参数') | ||
192 | + } else { | ||
193 | + store.commit("setChatScenesInfo", Object.assign(AliqrCode, { | ||
194 | + path: e.path | ||
195 | + })); | ||
196 | + } | ||
197 | + // #endif | ||
198 | + callback && callback() | ||
189 | } | 199 | } |
190 | 200 | ||
191 | /* | 201 | /* |
@@ -194,92 +204,120 @@ function scene(e,callback,flag=false){ | @@ -194,92 +204,120 @@ function scene(e,callback,flag=false){ | ||
194 | * errCallback:失败回调 | 204 | * errCallback:失败回调 |
195 | * isOpenSetting:是否检验授权 默认不检验 | 205 | * isOpenSetting:是否检验授权 默认不检验 |
196 | */ | 206 | */ |
197 | -function loGetLocation(successCallback, errCallback, isOpenSetting=false){ | ||
198 | - var that = this | ||
199 | - getAppLatLon(item=>{ | ||
200 | - if(base.mapData?.key){ | ||
201 | - var latitude = item.latitude; // 纬度,浮点数,范围为90 ~ -90 | ||
202 | - var longitude = item.longitude; // 经度,浮点数,范围为180 ~ -180 | ||
203 | - var qqmapsdk = new QQMapWX({ | ||
204 | - key: base.mapData?.key, // 您的key---秘钥key值可通过https://lbs.qq.com/qqmap_wx_jssdk/index.html申请 | ||
205 | - // #ifdef H5 | ||
206 | - vm: that | ||
207 | - // #endif | ||
208 | - }); | ||
209 | - // 地址逆解析可获取省市区等信息 | ||
210 | - qqmapsdk.reverseGeocoder({ | ||
211 | - location: { latitude: latitude, longitude: longitude }, | ||
212 | - sig: base.mapData?.sk, | ||
213 | - success: function(res) { | ||
214 | - store.commit('setLocateInformation',res.result) | ||
215 | - successCallback && successCallback(res.result) | ||
216 | - },fail: function(err) { | ||
217 | - item.location = { | ||
218 | - lat:latitude, | ||
219 | - lng:longitude, | ||
220 | - } | ||
221 | - store.commit('setLocateInformation',item) | ||
222 | - successCallback && successCallback(item) | ||
223 | - } | ||
224 | - }); | ||
225 | - }else{ | ||
226 | - item.location = { | ||
227 | - lat:item.latitude, | ||
228 | - lng:item.longitude, | ||
229 | - } | ||
230 | - store.commit('setLocateInformation',item) | ||
231 | - successCallback && successCallback(item) | ||
232 | - } | ||
233 | - },err=>{ | ||
234 | - store.commit('setLocateInformation',{}) | ||
235 | - errCallback && errCallback(err) | ||
236 | - },isOpenSetting) | 207 | +function loGetLocation(successCallback, errCallback, isOpenSetting = false) { |
208 | + var that = this | ||
209 | + getAppLatLon(item => { | ||
210 | + if (base.mapData?.key) { | ||
211 | + var latitude = item.latitude; // 纬度,浮点数,范围为90 ~ -90 | ||
212 | + var longitude = item.longitude; // 经度,浮点数,范围为180 ~ -180 | ||
213 | + var qqmapsdk = new QQMapWX({ | ||
214 | + key: base.mapData | ||
215 | + ?.key, // 您的key---秘钥key值可通过https://lbs.qq.com/qqmap_wx_jssdk/index.html申请 | ||
216 | + // #ifdef H5 | ||
217 | + vm: that | ||
218 | + // #endif | ||
219 | + }); | ||
220 | + // 地址逆解析可获取省市区等信息 | ||
221 | + qqmapsdk.reverseGeocoder({ | ||
222 | + location: { | ||
223 | + latitude: latitude, | ||
224 | + longitude: longitude | ||
225 | + }, | ||
226 | + sig: base.mapData?.sk, | ||
227 | + success: function(res) { | ||
228 | + store.commit('setLocateInformation', res.result) | ||
229 | + successCallback && successCallback(res.result) | ||
230 | + }, | ||
231 | + fail: function(err) { | ||
232 | + item.location = { | ||
233 | + lat: latitude, | ||
234 | + lng: longitude, | ||
235 | + } | ||
236 | + store.commit('setLocateInformation', item) | ||
237 | + successCallback && successCallback(item) | ||
238 | + } | ||
239 | + }); | ||
240 | + } else { | ||
241 | + item.location = { | ||
242 | + lat: item.latitude, | ||
243 | + lng: item.longitude, | ||
244 | + } | ||
245 | + store.commit('setLocateInformation', item) | ||
246 | + successCallback && successCallback(item) | ||
247 | + } | ||
248 | + }, err => { | ||
249 | + store.commit('setLocateInformation', {}) | ||
250 | + errCallback && errCallback(err) | ||
251 | + }, isOpenSetting) | ||
237 | } | 252 | } |
238 | // 选择地址 | 253 | // 选择地址 |
239 | function choiseRegion(callback) { | 254 | function choiseRegion(callback) { |
240 | - var that = this; | ||
241 | - uni.chooseLocation({ | ||
242 | - success: function(res) { | ||
243 | - callback && callback(res) | ||
244 | - }, | ||
245 | - fail: function() { | ||
246 | - uni.getSetting({ | ||
247 | - success: function(res) { | ||
248 | - if (res.authSetting['scope.userLocation']) { | ||
249 | - uni.showModal({ | ||
250 | - title: '是否授权当前位置', | ||
251 | - content: '需要获取您的地理位置,请确认授权,否则地图功能将无法使用', | ||
252 | - success: function(tip) { | ||
253 | - if (tip.confirm) { | ||
254 | - uni.openSetting({ | ||
255 | - success: function(data) { | ||
256 | - if (data.authSetting["scope.userLocation"] === true) { | ||
257 | - that.$u.toast('授权成功~'); | ||
258 | - //授权成功之后,再调用chooseLocation选择地方 | ||
259 | - that.choiseRegion() | ||
260 | - } else { | ||
261 | - that.$u.toast('授权失败~'); | ||
262 | - } | ||
263 | - } | ||
264 | - }) | ||
265 | - } | ||
266 | - } | ||
267 | - }) | ||
268 | - } | ||
269 | - }, | ||
270 | - fail: function(res) { | ||
271 | - that.$u.toast('调用授权窗口失败~'); | ||
272 | - } | ||
273 | - }) | ||
274 | - } | ||
275 | - }) | 255 | + var that = this; |
256 | + uni.chooseLocation({ | ||
257 | + success: function(res) { | ||
258 | + callback && callback(res) | ||
259 | + }, | ||
260 | + fail: function() { | ||
261 | + uni.getSetting({ | ||
262 | + success: function(res) { | ||
263 | + if (res.authSetting['scope.userLocation']) { | ||
264 | + uni.showModal({ | ||
265 | + title: '是否授权当前位置', | ||
266 | + content: '需要获取您的地理位置,请确认授权,否则地图功能将无法使用', | ||
267 | + success: function(tip) { | ||
268 | + if (tip.confirm) { | ||
269 | + uni.openSetting({ | ||
270 | + success: function(data) { | ||
271 | + if (data.authSetting[ | ||
272 | + "scope.userLocation" | ||
273 | + ] === true) { | ||
274 | + that.$u.toast('授权成功~'); | ||
275 | + //授权成功之后,再调用chooseLocation选择地方 | ||
276 | + that.choiseRegion() | ||
277 | + } else { | ||
278 | + that.$u.toast('授权失败~'); | ||
279 | + } | ||
280 | + } | ||
281 | + }) | ||
282 | + } | ||
283 | + } | ||
284 | + }) | ||
285 | + } | ||
286 | + }, | ||
287 | + fail: function(res) { | ||
288 | + that.$u.toast('调用授权窗口失败~'); | ||
289 | + } | ||
290 | + }) | ||
291 | + } | ||
292 | + }) | ||
276 | } | 293 | } |
277 | 294 | ||
295 | + | ||
296 | +function transOrgFunc(arr) { | ||
297 | + arr.forEach((item) => { | ||
298 | + if (item.name) { | ||
299 | + item.name = item.name; | ||
300 | + } | ||
301 | + if (item.id) { | ||
302 | + item.value = item.id; | ||
303 | + item.checked = false | ||
304 | + item.id = item.id | ||
305 | + } | ||
306 | + if (item.children) { | ||
307 | + if (item.children.length) { | ||
308 | + transOrgFunc(item.children); | ||
309 | + } | ||
310 | + } | ||
311 | + }); | ||
312 | + return arr | ||
313 | +}; | ||
314 | + | ||
278 | export { | 315 | export { |
279 | - mpUpData, //小程序更新 | ||
280 | - formatSize, //App计算缓存 | ||
281 | - clearCache, //App清理缓存 | ||
282 | - scene, //扫码信息 | ||
283 | - loGetLocation, //获取定位信息 | ||
284 | - choiseRegion, //选择地址 | ||
285 | -} | ||
316 | + mpUpData, //小程序更新 | ||
317 | + formatSize, //App计算缓存 | ||
318 | + clearCache, //App清理缓存 | ||
319 | + scene, //扫码信息 | ||
320 | + loGetLocation, //获取定位信息 | ||
321 | + choiseRegion, //选择地址 | ||
322 | + transOrgFunc //转化树组件 | ||
323 | +} |
config/constant.js
0 → 100644
1 | import store from '@/store'; | 1 | import store from '@/store'; |
2 | -import { h5Login } from '@/config/h5Utils'; | 2 | +import { |
3 | + h5Login | ||
4 | +} from '@/config/h5Utils'; | ||
3 | // APP--授权登录 | 5 | // APP--授权登录 |
4 | // type授权登录平台 'qq'、'weixin'、'apple' | 6 | // type授权登录平台 'qq'、'weixin'、'apple' |
5 | -export const loginApp = (type,successCallback,errorCallback) => { | ||
6 | - uni.login({ | ||
7 | - provider: type, | ||
8 | - success: function(loginRes) { | ||
9 | - // 获取用户信息 | ||
10 | - uni.getUserInfo({ | ||
11 | - provider: type, | ||
12 | - success: function(infoRes) { | ||
13 | - let data = {} | ||
14 | - if(type=='qq'){ | ||
15 | - data = { | ||
16 | - 'openid': loginRes.authResult.openid, | ||
17 | - 'nickname': infoRes.userInfo.nickname, | ||
18 | - 'gender': infoRes.userInfo.gender, | ||
19 | - 'province': infoRes.userInfo.province, | ||
20 | - 'city': infoRes.userInfo.city, | ||
21 | - 'figureurl': infoRes.userInfo.figureurl_qq | ||
22 | - } | ||
23 | - }else if(type=='weixin'){ | ||
24 | - data = { | ||
25 | - 'openid': loginRes.authResult.openid, | ||
26 | - 'nickname': infoRes.userInfo.nickName, | ||
27 | - 'sex': infoRes.userInfo.gender, | ||
28 | - 'province': infoRes.userInfo.province, | ||
29 | - 'city': infoRes.userInfo.city, | ||
30 | - 'country': infoRes.userInfo.country, | ||
31 | - 'headimgurl': infoRes.userInfo.avatarUrl, | ||
32 | - 'unionid': loginRes.authResult.unionid | ||
33 | - } | ||
34 | - }else if(type=='apple'){ | ||
35 | - data = { | ||
36 | - verifyType: 'password', | ||
37 | - personalPhone: '13888888888', | ||
38 | - personalPhoneCountryCode: '86', | ||
39 | - password:'123456' | ||
40 | - } | ||
41 | - } | ||
42 | - successCallback && successCallback(data) | ||
43 | - } | ||
44 | - }); | ||
45 | - },fail: function (err) { | ||
46 | - console.log(res, "失败") | ||
47 | - errorCallback && errorCallback(res) | ||
48 | - } | ||
49 | - }); | 7 | +export const loginApp = (type, successCallback, errorCallback) => { |
8 | + uni.login({ | ||
9 | + provider: type, | ||
10 | + success: function(loginRes) { | ||
11 | + // 获取用户信息 | ||
12 | + uni.getUserInfo({ | ||
13 | + provider: type, | ||
14 | + success: function(infoRes) { | ||
15 | + let data = {} | ||
16 | + if (type == 'qq') { | ||
17 | + data = { | ||
18 | + 'openid': loginRes.authResult.openid, | ||
19 | + 'nickname': infoRes.userInfo.nickname, | ||
20 | + 'gender': infoRes.userInfo.gender, | ||
21 | + 'province': infoRes.userInfo.province, | ||
22 | + 'city': infoRes.userInfo.city, | ||
23 | + 'figureurl': infoRes.userInfo.figureurl_qq | ||
24 | + } | ||
25 | + } else if (type == 'weixin') { | ||
26 | + data = { | ||
27 | + 'openid': loginRes.authResult.openid, | ||
28 | + 'nickname': infoRes.userInfo.nickName, | ||
29 | + 'sex': infoRes.userInfo.gender, | ||
30 | + 'province': infoRes.userInfo.province, | ||
31 | + 'city': infoRes.userInfo.city, | ||
32 | + 'country': infoRes.userInfo.country, | ||
33 | + 'headimgurl': infoRes.userInfo.avatarUrl, | ||
34 | + 'unionid': loginRes.authResult.unionid | ||
35 | + } | ||
36 | + } else if (type == 'apple') { | ||
37 | + data = { | ||
38 | + verifyType: 'password', | ||
39 | + personalPhone: '13888888888', | ||
40 | + personalPhoneCountryCode: '86', | ||
41 | + password: '123456' | ||
42 | + } | ||
43 | + } | ||
44 | + successCallback && successCallback(data) | ||
45 | + } | ||
46 | + }); | ||
47 | + }, | ||
48 | + fail: function(err) { | ||
49 | + console.log(res, "失败") | ||
50 | + errorCallback && errorCallback(res) | ||
51 | + } | ||
52 | + }); | ||
50 | } | 53 | } |
51 | // 微信/支付宝小程序---手机号授权登录时使用 | 54 | // 微信/支付宝小程序---手机号授权登录时使用 |
52 | // info: uni.login获取的参数 | 55 | // info: uni.login获取的参数 |
53 | export const getPhoneInfo = (info, successCallback, errCallback) => { | 56 | export const getPhoneInfo = (info, successCallback, errCallback) => { |
54 | - let httpData = {} | ||
55 | - // #ifdef MP-WEIXIN | ||
56 | - httpData = { | ||
57 | - code: info.code, //小程序code | ||
58 | - iv: info.iv, //小程序加密算法的初始向量 | ||
59 | - encryptedData: info.encryptedData, //包括敏感数据在内的完整用户信息的加密数据 | ||
60 | - }; | ||
61 | - // #endif | ||
62 | - // #ifdef MP-ALIPAY | 57 | + let httpData = {} |
58 | + // #ifdef MP-WEIXIN | ||
59 | + httpData = { | ||
60 | + code: info.code, //小程序code | ||
61 | + iv: info.iv, //小程序加密算法的初始向量 | ||
62 | + encryptedData: info.encryptedData, //包括敏感数据在内的完整用户信息的加密数据 | ||
63 | + }; | ||
64 | + // #endif | ||
65 | + // #ifdef MP-ALIPAY | ||
63 | httpData = { | 66 | httpData = { |
64 | code: '', //小程序code | 67 | code: '', //小程序code |
65 | iv: '', //小程序加密算法的初始向量 | 68 | iv: '', //小程序加密算法的初始向量 |
66 | encryptedData: info, //包括敏感数据在内的完整用户信息的加密数据 | 69 | encryptedData: info, //包括敏感数据在内的完整用户信息的加密数据 |
67 | }; | 70 | }; |
68 | - // #endif | ||
69 | - | ||
70 | - // 此时需要您的接口返回个人信息 | 71 | + // #endif |
72 | + | ||
73 | + // 此时需要您的接口返回个人信息 | ||
71 | // uni.$u.http.post('您的接口', httpData).then(res => { | 74 | // uni.$u.http.post('您的接口', httpData).then(res => { |
72 | - var loginInfo = { | ||
73 | - // userId: res.id, | ||
74 | - // sessionId: res.sessionId, | ||
75 | - // phoneNum: res.phoneNum, | ||
76 | - // userName: res.userName, | ||
77 | - // openId: res.openId, | ||
78 | - }; | ||
79 | - successCallback && successCallback(loginInfo) | ||
80 | - // }, err => { | ||
81 | - // errCallback && errCallback(err) | ||
82 | - // }); | 75 | + var loginInfo = { |
76 | + // userId: res.id, | ||
77 | + // sessionId: res.sessionId, | ||
78 | + // phoneNum: res.phoneNum, | ||
79 | + // userName: res.userName, | ||
80 | + // openId: res.openId, | ||
81 | + }; | ||
82 | + successCallback && successCallback(loginInfo) | ||
83 | + // }, err => { | ||
84 | + // errCallback && errCallback(err) | ||
85 | + // }); | ||
83 | } | 86 | } |
84 | // 微信/支付宝小程序---通用授权个人信息登录 | 87 | // 微信/支付宝小程序---通用授权个人信息登录 |
85 | -export const getUserInfo = (successCallback,errorCallback) => { | ||
86 | - uni.showLoading({ | ||
87 | - title: '正在申请授权', | ||
88 | - }); | ||
89 | - // #ifdef MP-WEIXIN | ||
90 | - uni.getUserProfile({ | ||
91 | - desc: '用于完善会员资料', | ||
92 | - success: function(res) { | ||
93 | - uni.hideLoading() | ||
94 | - var offUserInfo = res.userInfo | ||
95 | - successCallback && successCallback(offUserInfo) | ||
96 | - },fail: (res) => { | ||
97 | - uni.hideLoading() | ||
98 | - errorCallback && errorCallback(res) | ||
99 | - } | ||
100 | - }) | ||
101 | - // #endif | ||
102 | - // #ifdef MP-ALIPAY | ||
103 | - uni.getOpenUserInfo({ | ||
104 | - success: (res) => { | ||
105 | - uni.hideLoading() | ||
106 | - var offUserInfo = JSON.parse(res.response).response // 以下方的报文格式解析两层 response | ||
107 | - offUserInfo.avatarUrl = offUserInfo.avatar | ||
108 | - successCallback && successCallback(offUserInfo) | ||
109 | - },fail: (res) => { | ||
110 | - uni.hideLoading() | ||
111 | - console.log(res, "失败") | ||
112 | - errorCallback && errorCallback(res) | ||
113 | - } | ||
114 | - }) | ||
115 | - // #endif | 88 | +export const getUserInfo = (successCallback, errorCallback) => { |
89 | + uni.showLoading({ | ||
90 | + title: '正在申请授权', | ||
91 | + }); | ||
92 | + // #ifdef MP-WEIXIN | ||
93 | + uni.getUserProfile({ | ||
94 | + desc: '用于完善会员资料', | ||
95 | + success: function(res) { | ||
96 | + uni.hideLoading() | ||
97 | + var offUserInfo = res.userInfo | ||
98 | + successCallback && successCallback(offUserInfo) | ||
99 | + }, | ||
100 | + fail: (res) => { | ||
101 | + uni.hideLoading() | ||
102 | + errorCallback && errorCallback(res) | ||
103 | + } | ||
104 | + }) | ||
105 | + // #endif | ||
106 | + // #ifdef MP-ALIPAY | ||
107 | + uni.getOpenUserInfo({ | ||
108 | + success: (res) => { | ||
109 | + uni.hideLoading() | ||
110 | + var offUserInfo = JSON.parse(res.response).response // 以下方的报文格式解析两层 response | ||
111 | + offUserInfo.avatarUrl = offUserInfo.avatar | ||
112 | + successCallback && successCallback(offUserInfo) | ||
113 | + }, | ||
114 | + fail: (res) => { | ||
115 | + uni.hideLoading() | ||
116 | + console.log(res, "失败") | ||
117 | + errorCallback && errorCallback(res) | ||
118 | + } | ||
119 | + }) | ||
120 | + // #endif | ||
116 | } | 121 | } |
117 | 122 | ||
118 | //判断是否登录(所有端) | 123 | //判断是否登录(所有端) |
119 | export const judgeLogin = (callback) => { | 124 | export const judgeLogin = (callback) => { |
120 | - let storeUserInfo = store.state.userInfo; | ||
121 | - if (!storeUserInfo.userId){ // nvue页面读取不到vuex里面数据,将取缓存 | ||
122 | - storeUserInfo = uni.getStorageSync('userInfo') | ||
123 | - } | ||
124 | - if (!storeUserInfo.token) { | ||
125 | - // #ifdef MP | ||
126 | - store.commit('setLoginPopupShow', true); | ||
127 | - // #endif | ||
128 | - // #ifdef APP-PLUS | ||
129 | - uni.$showModal({ | ||
130 | - title: "登录提示", | ||
131 | - confirmVal:'去登录', | ||
132 | - cancelVal:'再逛会', | ||
133 | - content:'此时此刻需要您登录喔~', | ||
134 | - }).then(res=>{ | ||
135 | - uni.navigateTo({ | ||
136 | - url: "/pages/user/login" | ||
137 | - }); | ||
138 | - }).catch(res=>{}) | ||
139 | - // #endif | ||
140 | - // #ifdef H5 | ||
141 | - h5Login(); | ||
142 | - // #endif | ||
143 | - }else{ | ||
144 | - callback() | ||
145 | - } | ||
146 | -} | ||
125 | + let storeUserInfo = store.state.userInfo; | ||
126 | + if (!storeUserInfo.userId) { // nvue页面读取不到vuex里面数据,将取缓存 | ||
127 | + storeUserInfo = uni.getStorageSync('userInfo') | ||
128 | + } | ||
129 | + if (!storeUserInfo.isToken) { | ||
130 | + // #ifdef MP | ||
131 | + return uni.$u.toast('请登录') | ||
132 | + // uni.$showModal({ | ||
133 | + // title: "登录提示", | ||
134 | + // confirmVal: '去登录', | ||
135 | + // cancelVal: '再逛会', | ||
136 | + // content: '此时此刻需要您登录喔~', | ||
137 | + // }).then(res => { | ||
138 | + // uni.navigateTo({ | ||
139 | + // url: "/pages/personal/login" | ||
140 | + // }); | ||
141 | + // }).catch(res => {}) | ||
142 | + // store.commit('setLoginPopupShow', true); | ||
143 | + // #endif | ||
144 | + // #ifdef APP-PLUS | ||
145 | + uni.$showModal({ | ||
146 | + title: "登录提示", | ||
147 | + confirmVal: '去登录', | ||
148 | + cancelVal: '再逛会', | ||
149 | + content: '此时此刻需要您登录喔~', | ||
150 | + }).then(res => { | ||
151 | + uni.navigateTo({ | ||
152 | + url: "/pages/personal/login" | ||
153 | + }); | ||
154 | + }).catch(res => {}) | ||
155 | + // #endif | ||
156 | + // #ifdef H5 | ||
157 | + h5Login(); | ||
158 | + // #endif | ||
159 | + } else { | ||
160 | + callback() | ||
161 | + } | ||
162 | +} |
@@ -6,14 +6,24 @@ import { | @@ -6,14 +6,24 @@ import { | ||
6 | 6 | ||
7 | // 初始化请求配置 | 7 | // 初始化请求配置 |
8 | uni.$u.http.setConfig((config) => { | 8 | uni.$u.http.setConfig((config) => { |
9 | - let token = store.state.userInfo.isToken || (uni.getStorageSync('userInfo').isToken || undefined) | ||
10 | - //#ifdef MP | ||
11 | - let token = store.state.userInfo.isToken || (wx.getStorageSync('userInfo').isToken || undefined) | 9 | + let token |
10 | + //#ifndef H5 | ||
11 | + token = store.state.userInfo.isToken || (uni.getStorageSync('userInfo').isToken || undefined) | ||
12 | //#endif | 12 | //#endif |
13 | // #ifdef H5 | 13 | // #ifdef H5 |
14 | - window.sessionStorage.getItem('userInfo'); | 14 | + window.sessionStorage.getItem('userInfo').isToken; |
15 | // #endif | 15 | // #endif |
16 | - console.log('获取token', token); | 16 | + if (!token) { |
17 | + uni.showToast({ | ||
18 | + title: '请先登录', | ||
19 | + icon: 'none' | ||
20 | + }); | ||
21 | + setTimeout(() => { | ||
22 | + uni.reLaunch({ | ||
23 | + url: '/pages/personal/personal' | ||
24 | + }) | ||
25 | + }, 500) | ||
26 | + } | ||
17 | /* config 为默认全局配置*/ | 27 | /* config 为默认全局配置*/ |
18 | config.baseURL = base.baseUrl; /* 根域名 */ | 28 | config.baseURL = base.baseUrl; /* 根域名 */ |
19 | config.header = { | 29 | config.header = { |
@@ -35,14 +45,12 @@ uni.$u.http.interceptors.request.use((config) => { // 蜿ッ菴ソ逕ィasync await 蛛壼シ | @@ -35,14 +45,12 @@ uni.$u.http.interceptors.request.use((config) => { // 蜿ッ菴ソ逕ィasync await 蛛壼シ | ||
35 | config.data = config.data || {} | 45 | config.data = config.data || {} |
36 | // 根据custom参数中配置的是否需要token,添加对应的请求头 | 46 | // 根据custom参数中配置的是否需要token,添加对应的请求头 |
37 | if (config?.custom?.auth) { | 47 | if (config?.custom?.auth) { |
38 | - config.header.token = store.state.userInfo.token | 48 | + config.header.Authorization = 'Bearer ' + store.state.userInfo.isToken |
39 | } | 49 | } |
40 | - // console.log("请求开始", config); | ||
41 | if (config?.custom?.load) { | 50 | if (config?.custom?.load) { |
42 | //打开加载动画 | 51 | //打开加载动画 |
43 | store.commit("setLoadingShow", true); | 52 | store.commit("setLoadingShow", true); |
44 | } | 53 | } |
45 | - | ||
46 | return config | 54 | return config |
47 | }, config => { // 可使用async await 做异步操作 | 55 | }, config => { // 可使用async await 做异步操作 |
48 | return Promise.reject(config) | 56 | return Promise.reject(config) |
@@ -84,16 +92,23 @@ uni.$u.http.interceptors.response.use((response) => { | @@ -84,16 +92,23 @@ uni.$u.http.interceptors.response.use((response) => { | ||
84 | } | 92 | } |
85 | } | 93 | } |
86 | }, (response) => { | 94 | }, (response) => { |
87 | - console.log('Error', response); | ||
88 | // 关闭加载动画 | 95 | // 关闭加载动画 |
89 | store.commit("setLoadingShow", false); | 96 | store.commit("setLoadingShow", false); |
90 | // 对响应错误做点什么 (statusCode !== 200) | 97 | // 对响应错误做点什么 (statusCode !== 200) |
91 | let errorData = '请检查网络或服务器' | 98 | let errorData = '请检查网络或服务器' |
92 | - let message = response.errMsg || response.errMsg | 99 | + let message = response.data?.message || response?.errMsg |
93 | if (message == "request:fail url not in domain list") { | 100 | if (message == "request:fail url not in domain list") { |
94 | errorData = '检查请求域名是否添加了域名白名单' | 101 | errorData = '检查请求域名是否添加了域名白名单' |
95 | } else if (message == 'request:fail timeout') { | 102 | } else if (message == 'request:fail timeout') { |
96 | errorData = '请求超时:请检查网络' | 103 | errorData = '请求超时:请检查网络' |
104 | + } else if (message == 'Token has expired') { | ||
105 | + errorData = 'Token失效,请重新登录' | ||
106 | + setTimeout(() => { | ||
107 | + uni.reLaunch({ | ||
108 | + url: '/pages/personal/login' | ||
109 | + }) | ||
110 | + }, 500) | ||
111 | + store.commit('emptyUserInfo') | ||
97 | } else { | 112 | } else { |
98 | errorData = message || '请检查网络或服务器' | 113 | errorData = message || '请检查网络或服务器' |
99 | } | 114 | } |
@@ -11,9 +11,7 @@ | @@ -11,9 +11,7 @@ | ||
11 | { | 11 | { |
12 | "path": "pages/device/device", | 12 | "path": "pages/device/device", |
13 | "style": { | 13 | "style": { |
14 | - "navigationBarTitleText": "设备", | ||
15 | - "backgroundColorTop": "gray", | ||
16 | - "backgroundColorBottom": "gray" | 14 | + "navigationBarTitleText": "设备" |
17 | } | 15 | } |
18 | }, | 16 | }, |
19 | { | 17 | { |
@@ -88,6 +86,12 @@ | @@ -88,6 +86,12 @@ | ||
88 | "navigationBarTitleText": "查看摄像头" | 86 | "navigationBarTitleText": "查看摄像头" |
89 | } | 87 | } |
90 | 88 | ||
89 | + }, | ||
90 | + { | ||
91 | + "path": "pages/index/camera/org/org", | ||
92 | + "style": { | ||
93 | + "navigationBarTitleText": "组织筛选" | ||
94 | + } | ||
91 | }, { | 95 | }, { |
92 | "path": "pages/index/orgStatus/orgStatus", | 96 | "path": "pages/index/orgStatus/orgStatus", |
93 | "style": { | 97 | "style": { |
@@ -11,32 +11,42 @@ | @@ -11,32 +11,42 @@ | ||
11 | </f-navbar> | 11 | </f-navbar> |
12 | <!-- 公共组件-每个页面必须引入 --> | 12 | <!-- 公共组件-每个页面必须引入 --> |
13 | <public-module></public-module> | 13 | <public-module></public-module> |
14 | - <view class="org-sty"> | 14 | + <view @click="openOrg" class="org-sty"> |
15 | <view class="org-item"> | 15 | <view class="org-item"> |
16 | <view class="u-flex" style="flex-direction: row;margin-top: 26rpx;margin-left: 15rpx;"> | 16 | <view class="u-flex" style="flex-direction: row;margin-top: 26rpx;margin-left: 15rpx;"> |
17 | <text style="color:#333333;font-size: 15px;margin-left: 14rpx;">组织关系</text> | 17 | <text style="color:#333333;font-size: 15px;margin-left: 14rpx;">组织关系</text> |
18 | </view> | 18 | </view> |
19 | <view style="margin-top: 5rpx;margin-left: 15rpx;flex-direction: row;" class="u-flex"> | 19 | <view style="margin-top: 5rpx;margin-left: 15rpx;flex-direction: row;" class="u-flex"> |
20 | <image style="margin-left: 14rpx;width: 30rpx;height: 30rpx;" src="../../static/org.png" mode=""></image> | 20 | <image style="margin-left: 14rpx;width: 30rpx;height: 30rpx;" src="../../static/org.png" mode=""></image> |
21 | - <text style="margin-left: 10rpx;color:#666666;font-size: 12px;">设备数:1234</text> | 21 | + <text style="margin-left: 10rpx;color:#666666;font-size: 12px;">告警数:{{ alertTotal }}</text> |
22 | </view> | 22 | </view> |
23 | </view> | 23 | </view> |
24 | <view class="org-item" style=""> | 24 | <view class="org-item" style=""> |
25 | - <image @click="openOrg" style="width: 6px;height: 10px;float: right; margin-right: 34rpx; margin-top: 58rpx;" src="../../static/right-arrow.png" mode=""></image> | 25 | + <image style="width: 6px;height: 10px;float: right; margin-right: 34rpx; margin-top: 58rpx;" src="../../static/right-arrow.png" mode=""></image> |
26 | </view> | 26 | </view> |
27 | </view> | 27 | </view> |
28 | <mescroll-body ref="mescrollRef" @init="mescrollInit" :down="downOption" @down="downCallback" @up="upCallback"> | 28 | <mescroll-body ref="mescrollRef" @init="mescrollInit" :down="downOption" @down="downCallback" @up="upCallback"> |
29 | <view class="device-list"> | 29 | <view class="device-list"> |
30 | - <view @click="openAlertDetail(item.id)" class="list-item" v-for="(item, index) in list" :key="index"> | 30 | + <view @click="openAlertDetail(item)" class="list-item" v-for="(item, index) in list" :key="index"> |
31 | <view class="u-flex item" style="justify-content: flex-start;flex-direction: column;align-items: center;"> | 31 | <view class="u-flex item" style="justify-content: flex-start;flex-direction: column;align-items: center;"> |
32 | <view style="width: 400rpx;text-align: left;"> | 32 | <view style="width: 400rpx;text-align: left;"> |
33 | - <text style="color:#333333;font-size: 15px;">{{ item.deviceName }}</text> | 33 | + <text style="color:#333333;font-size: 15px;">{{ item.deviceName == null ? '暂无数据' : item.deviceName }}</text> |
34 | </view> | 34 | </view> |
35 | <view style="width: 400rpx;text-align: left;"> | 35 | <view style="width: 400rpx;text-align: left;"> |
36 | - <text style="color:#666666;font-size: 15px;">{{ item.name2 }}</text> | 36 | + <text style="color:#666666;font-size: 15px;">{{ item.details == null ? '暂无数据' : item.details.data }}</text> |
37 | </view> | 37 | </view> |
38 | <view style="width: 400rpx;text-align: left;"> | 38 | <view style="width: 400rpx;text-align: left;"> |
39 | - <text style="color:#666666;font-size: 15px;">{{ item.status }}</text> | 39 | + <text style="color:#666666;font-size: 15px;"> |
40 | + {{ | ||
41 | + item.status == 'CLEARED_UNACK' | ||
42 | + ? '清除未确认' | ||
43 | + : item.status == 'ACTIVE_UNACK' | ||
44 | + ? '激活未确认' | ||
45 | + : item.status == 'CLEARED_ACK' | ||
46 | + ? '清除已确认' | ||
47 | + : '激活已确认' | ||
48 | + }} | ||
49 | + </text> | ||
40 | </view> | 50 | </view> |
41 | <view style="width: 400rpx;text-align: left;"> | 51 | <view style="width: 400rpx;text-align: left;"> |
42 | <text style="color:#999999;font-size: 15px;">{{ item.createdTime }}</text> | 52 | <text style="color:#999999;font-size: 15px;">{{ item.createdTime }}</text> |
@@ -44,9 +54,34 @@ | @@ -44,9 +54,34 @@ | ||
44 | </view> | 54 | </view> |
45 | <view class="item"> | 55 | <view class="item"> |
46 | <view class="u-flex" style="flex-direction: row;margin-top: -6rpx;"> | 56 | <view class="u-flex" style="flex-direction: row;margin-top: -6rpx;"> |
47 | - <image style="width: 30rpx;height: 30rpx;margin-top: 5rpx;margin-right: 5rpx;" :src="item.name4" mode=""></image> | 57 | + <image style="width: 30rpx;height: 30rpx;margin-top: 5rpx;margin-right: 5rpx;" :src="bindImageUrl(item.severity)" mode=""></image> |
48 | <view class=""> | 58 | <view class=""> |
49 | - <text style="color: #333333;font-size: 13px;margin-left: 5rpx;margin-top: 20rpx;">{{ item.severity }}</text> | 59 | + <text |
60 | + :style="[ | ||
61 | + item.severity == 'CRITICAL' | ||
62 | + ? { color: '#DE4437' } | ||
63 | + : item.severity == 'MAJOR' | ||
64 | + ? { color: '#DE7337' } | ||
65 | + : item.severity == 'MINOR' | ||
66 | + ? { color: '#FFC107' } | ||
67 | + : item.severity == 'WARNING' | ||
68 | + ? { color: '#DE4437' } | ||
69 | + : { color: '#00C9A7' } | ||
70 | + ]" | ||
71 | + style="color: #333333;font-size: 13px;margin-left: 5rpx;margin-top: 20rpx;" | ||
72 | + > | ||
73 | + {{ | ||
74 | + item.severity == 'CRITICAL' | ||
75 | + ? '危险' | ||
76 | + : item.severity == 'MAJOR' | ||
77 | + ? '重要' | ||
78 | + : item.severity == 'MINOR' | ||
79 | + ? '次要' | ||
80 | + : item.severity == 'WARNING' | ||
81 | + ? '警告' | ||
82 | + : '不确定' | ||
83 | + }} | ||
84 | + </text> | ||
50 | </view> | 85 | </view> |
51 | </view> | 86 | </view> |
52 | </view> | 87 | </view> |
@@ -66,6 +101,8 @@ | @@ -66,6 +101,8 @@ | ||
66 | flex-wrap: wrap;justify-content: space-between; align-content: space-between;" | 101 | flex-wrap: wrap;justify-content: space-between; align-content: space-between;" |
67 | > | 102 | > |
68 | <view | 103 | <view |
104 | + @click="getAlertStatus(item, index)" | ||
105 | + :style="[index == current1 ? { background: '#377DFF' } : { background: '#F6F6F6' }]" | ||
69 | v-for="(item, index) in alertStatus" | 106 | v-for="(item, index) in alertStatus" |
70 | :key="index" | 107 | :key="index" |
71 | style="margin: 10rpx;line-height: 50rpx;text-align: center; | 108 | style="margin: 10rpx;line-height: 50rpx;text-align: center; |
@@ -84,6 +121,8 @@ | @@ -84,6 +121,8 @@ | ||
84 | flex-wrap: wrap;justify-content: space-between; align-content: space-between;" | 121 | flex-wrap: wrap;justify-content: space-between; align-content: space-between;" |
85 | > | 122 | > |
86 | <view | 123 | <view |
124 | + @click="getTypeStatus(item, index)" | ||
125 | + :style="[index == current2 ? { background: '#377DFF' } : { background: '#F6F6F6' }]" | ||
87 | v-for="(item, index) in deviceType" | 126 | v-for="(item, index) in deviceType" |
88 | :key="index" | 127 | :key="index" |
89 | style="margin: 10rpx;line-height: 50rpx;text-align: center; | 128 | style="margin: 10rpx;line-height: 50rpx;text-align: center; |
@@ -102,6 +141,8 @@ | @@ -102,6 +141,8 @@ | ||
102 | flex-wrap: wrap;justify-content: space-between; align-content: space-between;" | 141 | flex-wrap: wrap;justify-content: space-between; align-content: space-between;" |
103 | > | 142 | > |
104 | <view | 143 | <view |
144 | + @click="getLevelStatus(item, index)" | ||
145 | + :style="[index == current3 ? { background: '#377DFF' } : { background: '#F6F6F6' }]" | ||
105 | v-for="(item, index) in alertLevel" | 146 | v-for="(item, index) in alertLevel" |
106 | :key="index" | 147 | :key="index" |
107 | style="margin: 10rpx;line-height: 50rpx;text-align: center; | 148 | style="margin: 10rpx;line-height: 50rpx;text-align: center; |
@@ -120,6 +161,8 @@ | @@ -120,6 +161,8 @@ | ||
120 | flex-wrap: wrap;justify-content: space-between; align-content: space-between;" | 161 | flex-wrap: wrap;justify-content: space-between; align-content: space-between;" |
121 | > | 162 | > |
122 | <view | 163 | <view |
164 | + @click="getTimeStatus(item, index)" | ||
165 | + :style="[index == current4 ? { background: '#377DFF' } : { background: '#F6F6F6' }]" | ||
123 | v-for="(item, index) in timeArea" | 166 | v-for="(item, index) in timeArea" |
124 | :key="index" | 167 | :key="index" |
125 | style="margin: 10rpx;line-height: 50rpx;text-align: center; | 168 | style="margin: 10rpx;line-height: 50rpx;text-align: center; |
@@ -150,8 +193,8 @@ | @@ -150,8 +193,8 @@ | ||
150 | </view> | 193 | </view> |
151 | </view> | 194 | </view> |
152 | <view class="u-flex" style="flex-direction: row;margin-top: 128rpx;margin-left: 55rpx;"> | 195 | <view class="u-flex" style="flex-direction: row;margin-top: 128rpx;margin-left: 55rpx;"> |
153 | - <view style="width: 300rpx"><u-button type="info" shape="circle" text="重置"></u-button></view> | ||
154 | - <view style="width: 300rpx;margin-left:46rpx ;"><u-button type="primary" shape="circle" text="确认"></u-button></view> | 196 | + <view style="width: 300rpx"><u-button @click="resetData" type="info" shape="circle" text="重置"></u-button></view> |
197 | + <view style="width: 300rpx;margin-left:46rpx ;"><u-button @click="queryData" type="primary" shape="circle" text="确认"></u-button></view> | ||
155 | </view> | 198 | </view> |
156 | <view style="height: 30rpx;"></view> | 199 | <view style="height: 30rpx;"></view> |
157 | </view> | 200 | </view> |
@@ -174,6 +217,7 @@ | @@ -174,6 +217,7 @@ | ||
174 | import fTabbar from '@/components/module/f-tabbar/f-tabbar'; | 217 | import fTabbar from '@/components/module/f-tabbar/f-tabbar'; |
175 | import fNavbar from '@/components/module/f-navbar/f-navbar'; | 218 | import fNavbar from '@/components/module/f-navbar/f-navbar'; |
176 | import MescrollMixin from '@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js'; | 219 | import MescrollMixin from '@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js'; |
220 | +import { pageNumber, pageSize } from '@/config/constant.js'; | ||
177 | 221 | ||
178 | export default { | 222 | export default { |
179 | mixins: [MescrollMixin], // 使用mixin (在main.js注册全局组件) | 223 | mixins: [MescrollMixin], // 使用mixin (在main.js注册全局组件) |
@@ -183,8 +227,18 @@ export default { | @@ -183,8 +227,18 @@ export default { | ||
183 | }, | 227 | }, |
184 | data() { | 228 | data() { |
185 | return { | 229 | return { |
230 | + alertStatusVal: '', | ||
231 | + deviceTypeVal: '', | ||
232 | + alertLevelVal: '', | ||
233 | + selectTimeVal: '', | ||
234 | + startTime: '', | ||
235 | + endTime: '', | ||
236 | + current1: 0, | ||
237 | + current2: 0, | ||
238 | + current3: 0, | ||
239 | + current4: 0, | ||
186 | page: { | 240 | page: { |
187 | - num: 1, | 241 | + num: 0, |
188 | size: 10 | 242 | size: 10 |
189 | }, | 243 | }, |
190 | downOption: { | 244 | downOption: { |
@@ -192,45 +246,45 @@ export default { | @@ -192,45 +246,45 @@ export default { | ||
192 | }, | 246 | }, |
193 | timeData: { | 247 | timeData: { |
194 | selectTime: '', | 248 | selectTime: '', |
195 | - getTimeGap: '' | 249 | + getTimeGap: '', |
250 | + getDateVal: '' | ||
196 | }, | 251 | }, |
197 | showCalendar: false, | 252 | showCalendar: false, |
198 | show: false, | 253 | show: false, |
199 | list: [], | 254 | list: [], |
200 | alertStatus: [ | 255 | alertStatus: [ |
201 | { | 256 | { |
202 | - index: 1, | 257 | + index: 0, |
203 | name: '全部', | 258 | name: '全部', |
259 | + value: '', | ||
204 | bgColor: '#377DFF', | 260 | bgColor: '#377DFF', |
205 | textColor: '#377DFF' | 261 | textColor: '#377DFF' |
206 | }, | 262 | }, |
207 | { | 263 | { |
208 | - index: 2, | 264 | + index: 1, |
209 | name: '激活未确认', | 265 | name: '激活未确认', |
266 | + value: 'ACTIVE_UNACK', | ||
210 | bgColor: '#F6F6F6', | 267 | bgColor: '#F6F6F6', |
211 | textColor: '#F6F6F6' | 268 | textColor: '#F6F6F6' |
212 | }, | 269 | }, |
213 | { | 270 | { |
214 | - index: 3, | 271 | + index: 2, |
215 | name: '激活已确认', | 272 | name: '激活已确认', |
273 | + value: 'ACTIVE_ACK', | ||
216 | bgColor: '#F6F6F6', | 274 | bgColor: '#F6F6F6', |
217 | textColor: '#F6F6F6' | 275 | textColor: '#F6F6F6' |
218 | }, | 276 | }, |
219 | { | 277 | { |
220 | - index: 4, | 278 | + index: 3, |
221 | name: '清除未确认', | 279 | name: '清除未确认', |
280 | + value: 'CLEARED_UNACK', | ||
222 | bgColor: '#F6F6F6', | 281 | bgColor: '#F6F6F6', |
223 | textColor: '#F6F6F6' | 282 | textColor: '#F6F6F6' |
224 | }, | 283 | }, |
225 | { | 284 | { |
226 | - index: 5, | ||
227 | - name: '清除已确认', | ||
228 | - bgColor: '#F6F6F6', | ||
229 | - textColor: '#F6F6F6' | ||
230 | - }, | ||
231 | - { | ||
232 | - index: 6, | 285 | + index: 4, |
233 | name: '清除已确认', | 286 | name: '清除已确认', |
287 | + value: 'CLEARED_ACK', | ||
234 | bgColor: '#F6F6F6', | 288 | bgColor: '#F6F6F6', |
235 | textColor: '#F6F6F6' | 289 | textColor: '#F6F6F6' |
236 | } | 290 | } |
@@ -239,24 +293,28 @@ export default { | @@ -239,24 +293,28 @@ export default { | ||
239 | { | 293 | { |
240 | index: 1, | 294 | index: 1, |
241 | name: '全部', | 295 | name: '全部', |
296 | + value: '', | ||
242 | bgColor: '#377DFF', | 297 | bgColor: '#377DFF', |
243 | textColor: '#377DFF' | 298 | textColor: '#377DFF' |
244 | }, | 299 | }, |
245 | { | 300 | { |
246 | index: 2, | 301 | index: 2, |
247 | name: '网关设备', | 302 | name: '网关设备', |
303 | + value: 'GATEWAY', | ||
248 | bgColor: '#F6F6F6', | 304 | bgColor: '#F6F6F6', |
249 | textColor: '#F6F6F6' | 305 | textColor: '#F6F6F6' |
250 | }, | 306 | }, |
251 | { | 307 | { |
252 | index: 3, | 308 | index: 3, |
253 | name: '网关子设备', | 309 | name: '网关子设备', |
310 | + value: 'SENSOR', | ||
254 | bgColor: '#F6F6F6', | 311 | bgColor: '#F6F6F6', |
255 | textColor: '#F6F6F6' | 312 | textColor: '#F6F6F6' |
256 | }, | 313 | }, |
257 | { | 314 | { |
258 | index: 4, | 315 | index: 4, |
259 | name: '直连设备', | 316 | name: '直连设备', |
317 | + value: 'DIRECT_CONNECTION', | ||
260 | bgColor: '#F6F6F6', | 318 | bgColor: '#F6F6F6', |
261 | textColor: '#F6F6F6' | 319 | textColor: '#F6F6F6' |
262 | } | 320 | } |
@@ -265,36 +323,42 @@ export default { | @@ -265,36 +323,42 @@ export default { | ||
265 | { | 323 | { |
266 | index: 1, | 324 | index: 1, |
267 | name: '全部', | 325 | name: '全部', |
326 | + value: '', | ||
268 | bgColor: '#377DFF', | 327 | bgColor: '#377DFF', |
269 | textColor: '#377DFF' | 328 | textColor: '#377DFF' |
270 | }, | 329 | }, |
271 | { | 330 | { |
272 | index: 2, | 331 | index: 2, |
273 | name: '危险', | 332 | name: '危险', |
333 | + value: 'CRITICAL', | ||
274 | bgColor: '#F6F6F6', | 334 | bgColor: '#F6F6F6', |
275 | textColor: '#F6F6F6' | 335 | textColor: '#F6F6F6' |
276 | }, | 336 | }, |
277 | { | 337 | { |
278 | index: 3, | 338 | index: 3, |
279 | name: '重要', | 339 | name: '重要', |
340 | + value: 'MAJOR', | ||
280 | bgColor: '#F6F6F6', | 341 | bgColor: '#F6F6F6', |
281 | textColor: '#F6F6F6' | 342 | textColor: '#F6F6F6' |
282 | }, | 343 | }, |
283 | { | 344 | { |
284 | index: 4, | 345 | index: 4, |
285 | name: '次要', | 346 | name: '次要', |
347 | + value: 'MINOR', | ||
286 | bgColor: '#F6F6F6', | 348 | bgColor: '#F6F6F6', |
287 | textColor: '#F6F6F6' | 349 | textColor: '#F6F6F6' |
288 | }, | 350 | }, |
289 | { | 351 | { |
290 | - index: 4, | 352 | + index: 5, |
291 | name: '警告', | 353 | name: '警告', |
354 | + value: 'WARNING', | ||
292 | bgColor: '#F6F6F6', | 355 | bgColor: '#F6F6F6', |
293 | textColor: '#F6F6F6' | 356 | textColor: '#F6F6F6' |
294 | }, | 357 | }, |
295 | { | 358 | { |
296 | - index: 4, | 359 | + index: 6, |
297 | name: '不确定', | 360 | name: '不确定', |
361 | + value: 'INDETERMINATE', | ||
298 | bgColor: '#F6F6F6', | 362 | bgColor: '#F6F6F6', |
299 | textColor: '#F6F6F6' | 363 | textColor: '#F6F6F6' |
300 | } | 364 | } |
@@ -334,56 +398,131 @@ export default { | @@ -334,56 +398,131 @@ export default { | ||
334 | value: '24', | 398 | value: '24', |
335 | bgColor: '#F6F6F6', | 399 | bgColor: '#F6F6F6', |
336 | textColor: '#F6F6F6' | 400 | textColor: '#F6F6F6' |
337 | - }, | ||
338 | - { | ||
339 | - index: 6, | ||
340 | - name: '', | ||
341 | - value: '', | ||
342 | - bgColor: '#F6F6F6', | ||
343 | - textColor: '#F6F6F6' | ||
344 | } | 401 | } |
345 | - ] | 402 | + ], |
403 | + ordId: '', | ||
404 | + detailStatus: false, | ||
405 | + alertTotal: 0 | ||
346 | }; | 406 | }; |
347 | }, | 407 | }, |
408 | + onShow() { | ||
409 | + if (this.detailStatus) { | ||
410 | + this.loadData(1); | ||
411 | + } | ||
412 | + if (this.ordId == '') { | ||
413 | + } else { | ||
414 | + this.loadData(1, null, null, null, null, null, this.ordId); | ||
415 | + } | ||
416 | + }, | ||
417 | + onHide() { | ||
418 | + this.ordId = ''; | ||
419 | + this.detailStatus = false; | ||
420 | + }, | ||
348 | onLoad(e) { | 421 | onLoad(e) { |
349 | // 隐藏原生的tabbar | 422 | // 隐藏原生的tabbar |
350 | uni.hideTabBar(); | 423 | uni.hideTabBar(); |
351 | }, | 424 | }, |
352 | methods: { | 425 | methods: { |
426 | + getAlertStatus(e, i) { | ||
427 | + this.current1 = i; | ||
428 | + this.alertStatusVal = e.value; | ||
429 | + }, | ||
430 | + getTypeStatus(e, i) { | ||
431 | + this.current2 = i; | ||
432 | + this.deviceTypeVal = e.value; | ||
433 | + }, | ||
434 | + getLevelStatus(e, i) { | ||
435 | + this.current3 = i; | ||
436 | + this.alertLevelVal = e.value; | ||
437 | + }, | ||
438 | + getTimeStatus(e, i) { | ||
439 | + this.current4 = i; | ||
440 | + this.selectTimeVal = e.value; | ||
441 | + }, | ||
442 | + queryData() { | ||
443 | + let date1 = new Date(this.timeData.getDateVal[0]); | ||
444 | + let date2 = new Date(this.timeData.getDateVal[this.timeData.getDateVal.length - 1]); | ||
445 | + let startTimeVa, endTimeVa; | ||
446 | + if (this.timeData.getDateVal.length == 0) { | ||
447 | + startTimeVa = ''; | ||
448 | + endTimeVa = ''; | ||
449 | + } else { | ||
450 | + startTimeVa = date1.getTime(); | ||
451 | + endTimeVa = date2.getTime(); | ||
452 | + } | ||
453 | + this.loadData(1, this.alertStatusVal, startTimeVa, endTimeVa, this.alertLevelVal, this.deviceTypeVal); | ||
454 | + this.show = false; | ||
455 | + }, | ||
456 | + resetData() { | ||
457 | + this.current1 = 0; | ||
458 | + this.alertStatusVal = ''; | ||
459 | + this.current2 = 0; | ||
460 | + this.deviceTypeVal = ''; | ||
461 | + this.current3 = 0; | ||
462 | + this.alertLevelVal = ''; | ||
463 | + this.current4 = 0; | ||
464 | + this.selectTimeVal = ''; | ||
465 | + }, | ||
466 | + bindImageUrl(e) { | ||
467 | + switch (e) { | ||
468 | + case 'CRITICAL': | ||
469 | + return '../../static/danger.png'; | ||
470 | + break; | ||
471 | + case 'MAJOR': | ||
472 | + return '../../static/major.png'; | ||
473 | + break; | ||
474 | + case 'MINOR': | ||
475 | + return '../../static/secondary.png'; | ||
476 | + break; | ||
477 | + case 'WARNING': | ||
478 | + return '../../static/danger.png'; | ||
479 | + break; | ||
480 | + case 'INDETERMINATE': | ||
481 | + return '../../static/noshue.png'; | ||
482 | + break; | ||
483 | + default: | ||
484 | + return ''; | ||
485 | + break; | ||
486 | + } | ||
487 | + }, | ||
353 | /*下拉刷新的回调 */ | 488 | /*下拉刷新的回调 */ |
354 | downCallback() { | 489 | downCallback() { |
355 | //联网加载数据 | 490 | //联网加载数据 |
491 | + this.list.length = 0; | ||
492 | + this.page.num = 1; | ||
356 | this.loadData(1); | 493 | this.loadData(1); |
357 | }, | 494 | }, |
358 | /*上拉加载的回调: 其中page.num:当前页 从1开始, page.size:每页数据条数,默认10 */ | 495 | /*上拉加载的回调: 其中page.num:当前页 从1开始, page.size:每页数据条数,默认10 */ |
359 | upCallback() { | 496 | upCallback() { |
360 | //联网加载数据 | 497 | //联网加载数据 |
361 | - // this.page.num+=10 | 498 | + this.page.num += 1; |
362 | this.loadData(this.page.num); | 499 | this.loadData(this.page.num); |
363 | }, | 500 | }, |
364 | - // 特价商品 | ||
365 | - loadData(pageNo) { | 501 | + loadData(pageNo, statusV, startTimeV, endTimeV, severityV, deviceTypeV, organizationV) { |
366 | let httpData = { | 502 | let httpData = { |
367 | page: pageNo, | 503 | page: pageNo, |
368 | pageSize: 10, | 504 | pageSize: 10, |
369 | - entityType: 'DEVICE', | ||
370 | - entityId: '' | 505 | + status: statusV, |
506 | + startTime: startTimeV, | ||
507 | + endTime: endTimeV, | ||
508 | + severity: severityV, | ||
509 | + deviceType: deviceTypeV, | ||
510 | + organizationId: organizationV | ||
371 | }; | 511 | }; |
372 | uni.$u.http | 512 | uni.$u.http |
373 | .get('/yt/alarm', { params: httpData, custom: { load: false } }) | 513 | .get('/yt/alarm', { params: httpData, custom: { load: false } }) |
374 | .then(res => { | 514 | .then(res => { |
375 | uni.stopPullDownRefresh(); | 515 | uni.stopPullDownRefresh(); |
376 | this.mescroll.endByPage(res.items.length, res.total); | 516 | this.mescroll.endByPage(res.items.length, res.total); |
517 | + this.alertTotal = res.total; | ||
377 | if (pageNo == 1) { | 518 | if (pageNo == 1) { |
378 | this.list = res.items; | 519 | this.list = res.items; |
379 | - console.log(this.list); | ||
380 | } else { | 520 | } else { |
381 | this.list = this.list.concat(res.items); | 521 | this.list = this.list.concat(res.items); |
382 | - console.log(this.list); | ||
383 | } | 522 | } |
384 | }) | 523 | }) |
385 | .catch(e => { | 524 | .catch(e => { |
386 | - console.log(e); | 525 | + uni.$u.toast(e.data.message); |
387 | //联网失败, 结束加载 | 526 | //联网失败, 结束加载 |
388 | this.mescroll.endErr(); | 527 | this.mescroll.endErr(); |
389 | }); | 528 | }); |
@@ -399,6 +538,7 @@ export default { | @@ -399,6 +538,7 @@ export default { | ||
399 | }, | 538 | }, |
400 | openSearchDialog() { | 539 | openSearchDialog() { |
401 | this.show = true; | 540 | this.show = true; |
541 | + this.resetData(); | ||
402 | }, | 542 | }, |
403 | hideKeyboard() { | 543 | hideKeyboard() { |
404 | uni.hideKeyboard(); | 544 | uni.hideKeyboard(); |
@@ -406,13 +546,23 @@ export default { | @@ -406,13 +546,23 @@ export default { | ||
406 | calendarConfirm(e) { | 546 | calendarConfirm(e) { |
407 | this.showCalendar = false; | 547 | this.showCalendar = false; |
408 | this.timeData.selectTime = `${e[0]} / ${e[e.length - 1]}`; | 548 | this.timeData.selectTime = `${e[0]} / ${e[e.length - 1]}`; |
549 | + this.timeData.getDateVal = e; | ||
409 | }, | 550 | }, |
410 | calendarClose() { | 551 | calendarClose() { |
411 | this.showCalendar = false; | 552 | this.showCalendar = false; |
412 | }, | 553 | }, |
413 | - openAlertDetail() { | 554 | + openAlertDetail(e) { |
555 | + let obj = { | ||
556 | + id: e.id, | ||
557 | + deviceName: e.deviceName, | ||
558 | + severity: e.severity, | ||
559 | + originatorType: e.originatorType, | ||
560 | + details: e.details, | ||
561 | + createdTime: e.createdTime, | ||
562 | + status: e.status | ||
563 | + }; | ||
414 | uni.navigateTo({ | 564 | uni.navigateTo({ |
415 | - url: './alertDetail' | 565 | + url: './alertDetail?data=' + JSON.stringify(obj) |
416 | }); | 566 | }); |
417 | } | 567 | } |
418 | } | 568 | } |
@@ -3,18 +3,74 @@ | @@ -3,18 +3,74 @@ | ||
3 | <!-- 公共组件-每个页面必须引入 --> | 3 | <!-- 公共组件-每个页面必须引入 --> |
4 | <public-module></public-module> | 4 | <public-module></public-module> |
5 | <view style="border-radius: 20px;width: 688rpx;height: 573rpx;background-color: #FFFFFF;"> | 5 | <view style="border-radius: 20px;width: 688rpx;height: 573rpx;background-color: #FFFFFF;"> |
6 | - <u-list @scrolltolower="scrolltolower"> | ||
7 | - <u-list-item v-for="(item, index) in list" :key="index"><u-cell :title="item.name" :value="item.val"></u-cell></u-list-item> | ||
8 | - </u-list> | 6 | + <view class="u-flex" style="height: 573rpx;justify-content:space-between;flex-direction: column;align-items: center;"> |
7 | + <view | ||
8 | + class="u-flex" | ||
9 | + style="flex-direction: row;justify-content: space-between;margin-top: 10rpx;line-height:68rpx;width: 614rpx;height:90rpx;text-align: left;border-bottom: 0.1rpx solid #F0F0F0;" | ||
10 | + > | ||
11 | + <text style="color:#333333;font-size: 15px;">{{ list.deviceName == null ? '暂无数据' : list.deviceName }}</text> | ||
12 | + <image style="width: 30rpx;height: 30rpx;" src="../../static/alert-detail.png" mode=""></image> | ||
13 | + </view> | ||
14 | + <view style="margin-top: 10rpx;line-height:68rpx;width: 614rpx;height:90rpx;text-align: left;border-bottom: 0.1rpx solid #F0F0F0;"> | ||
15 | + <text style="color:#333333;font-size: 14px;">告警级别:</text> | ||
16 | + <text style="color:#DE4437"> | ||
17 | + {{ | ||
18 | + list.severity == 'CRITICAL' | ||
19 | + ? '危险' | ||
20 | + : list.severity == 'MAJOR' | ||
21 | + ? '重要' | ||
22 | + : list.severity == 'MINOR' | ||
23 | + ? '次要' | ||
24 | + : list.severity == 'WARNING' | ||
25 | + ? '警告' | ||
26 | + : '不确定' | ||
27 | + }} | ||
28 | + </text> | ||
29 | + </view> | ||
30 | + <view style="margin-top: 10rpx;line-height:68rpx;width: 614rpx;height:90rpx;text-align: left;border-bottom: 0.1rpx solid #F0F0F0;"> | ||
31 | + <text style="color:#333333;font-size: 15px;">所属组织:</text> | ||
32 | + <text style="color:#666666;font-size: 14px;">{{ list.originatorType }}</text> | ||
33 | + </view> | ||
34 | + <view style="margin-top: 10rpx;line-height:68rpx;width: 614rpx;height:90rpx;text-align: left;border-bottom: 0.1rpx solid #F0F0F0;"> | ||
35 | + <text style="color:#333333;font-size: 15px;">告警值:</text> | ||
36 | + <text style="color:#666666;font-size: 14px;">{{ list.details == null ? '暂无数据' : list.details.data }}</text> | ||
37 | + </view> | ||
38 | + <view style="margin-top: 10rpx;line-height:68rpx;width: 614rpx;height:90rpx;text-align: left;border-bottom: 0.1rpx solid #F0F0F0;"> | ||
39 | + <text style="color:#333333;font-size: 15px;">告警时间:</text> | ||
40 | + <text style="color:#666666;font-size: 14px;">{{ list.createdTime }}</text> | ||
41 | + </view> | ||
42 | + <view style="margin-top: 10rpx;line-height:68rpx;width: 614rpx;height:90rpx;text-align: left;border-bottom: 0.1rpx solid #F0F0F0;"> | ||
43 | + <text style="color:#333333;font-size: 15px;">告警状态:</text> | ||
44 | + <text style="color:#DE4437;font-size: 14px;"> | ||
45 | + {{ | ||
46 | + list.status == 'CLEARED_UNACK' | ||
47 | + ? '清除未确认' | ||
48 | + : list.status == 'ACTIVE_UNACK' | ||
49 | + ? '激活未确认' | ||
50 | + : list.status == 'CLEARED_ACK' | ||
51 | + ? '清除已确认' | ||
52 | + : '激活已确认' | ||
53 | + }} | ||
54 | + </text> | ||
55 | + </view> | ||
56 | + </view> | ||
9 | </view> | 57 | </view> |
58 | + <!-- #ifdef MP --> | ||
10 | <view style="color:#333333,font-size:15px;margin-top: 20rpx;">处理结果</view> | 59 | <view style="color:#333333,font-size:15px;margin-top: 20rpx;">处理结果</view> |
11 | <view style="margin-top: 20rpx;;border-radius: 20px;width: 688rpx;height: 273rpx;background-color: #FFFFFF;"> | 60 | <view style="margin-top: 20rpx;;border-radius: 20px;width: 688rpx;height: 273rpx;background-color: #FFFFFF;"> |
12 | - <u--form labelPosition="left" :model="formModel" ref="form1"> | ||
13 | - <u-form-item label="." prop="result" ref="item3"> | ||
14 | - <u--textarea border="none" height="96" placeholder="请输入处理结果" v-model="formModel.result" count></u--textarea> | 61 | + <u--form :label-style="{ 'font-size': '0rpx' }" style="padding-left: 26rpx;" labelPosition="left" :model="formModel" ref="form1"> |
62 | + <u-form-item label="." prop="result" ref="item3"> | ||
63 | + <view style="margin-left: -60rpx;"><u--textarea border="none" height="96" placeholder="请输入处理结果" v-model="formModel.result" count></u--textarea></view> | ||
15 | </u-form-item> | 64 | </u-form-item> |
16 | </u--form> | 65 | </u--form> |
17 | </view> | 66 | </view> |
67 | + <!-- #endif --> | ||
68 | + <!-- #ifdef APP-PLUS --> | ||
69 | + <view style="color:#333333,font-size:15px;margin-top: 20rpx;">处理结果</view> | ||
70 | + <view style="margin-top: 20rpx;;border-radius: 20px;width: 688rpx;height: 273rpx;background-color: #FFFFFF;"> | ||
71 | + <view><u--textarea border="none" height="96" placeholder="请输入处理结果" v-model="formModel.result" count></u--textarea></view> | ||
72 | + </view> | ||
73 | + <!-- #endif --> | ||
18 | <view style="width: 500rpx;margin-left: 80rpx;margin-top: 44rpx;"><u-button @click="handleSubmit" type="primary" shape="circle" text="处理"></u-button></view> | 74 | <view style="width: 500rpx;margin-left: 80rpx;margin-top: 44rpx;"><u-button @click="handleSubmit" type="primary" shape="circle" text="处理"></u-button></view> |
19 | <f-tabbar></f-tabbar> | 75 | <f-tabbar></f-tabbar> |
20 | </view> | 76 | </view> |
@@ -31,40 +87,36 @@ export default { | @@ -31,40 +87,36 @@ export default { | ||
31 | formModel: { | 87 | formModel: { |
32 | result: '' | 88 | result: '' |
33 | }, | 89 | }, |
34 | - list: [ | ||
35 | - { | ||
36 | - name: '新疆1-59-25栏位网关子设备', | ||
37 | - val: '22' | ||
38 | - }, | ||
39 | - { | ||
40 | - name: '告警级别', | ||
41 | - val: '危险' | ||
42 | - }, | ||
43 | - { | ||
44 | - name: '所属组织', | ||
45 | - val: '1-59-25栏位' | ||
46 | - }, | ||
47 | - { | ||
48 | - name: '告警值', | ||
49 | - val: '856' | ||
50 | - }, | ||
51 | - { | ||
52 | - name: '告警时间', | ||
53 | - val: '2022-01-25 12:53:22' | ||
54 | - }, | ||
55 | - { | ||
56 | - name: '告警状态', | ||
57 | - val: '激活未确认' | ||
58 | - } | ||
59 | - ] | 90 | + list: {} |
60 | }; | 91 | }; |
61 | }, | 92 | }, |
62 | onLoad(e) { | 93 | onLoad(e) { |
94 | + if (e.data !== null) { | ||
95 | + let params = JSON.parse(e.data); | ||
96 | + this.list = params; | ||
97 | + } | ||
63 | // 隐藏原生的tabbar | 98 | // 隐藏原生的tabbar |
64 | uni.hideTabBar(); | 99 | uni.hideTabBar(); |
65 | }, | 100 | }, |
66 | methods: { | 101 | methods: { |
67 | - handleSubmit() {} | 102 | + handleSubmit() { |
103 | + // console.log(this.formModel); | ||
104 | + uni.$u.http | ||
105 | + .post(`/alarm/${this.list.id}/ack`) | ||
106 | + .then(res => { | ||
107 | + uni.$u.toast('处理成功'); | ||
108 | + let pages = getCurrentPages(); //获取所有页面栈实例列表 | ||
109 | + let nowPage = pages[pages.length - 1]; //当前页页面实例 | ||
110 | + let prevPage = pages[pages.length - 2]; //上一页页面实例 | ||
111 | + prevPage.$vm.detailStatus = true; | ||
112 | + uni.navigateBack({ | ||
113 | + delta: 1 | ||
114 | + }); | ||
115 | + }) | ||
116 | + .catch(e => { | ||
117 | + uni.$u.toast(e.data?.message); | ||
118 | + }); | ||
119 | + } | ||
68 | } | 120 | } |
69 | }; | 121 | }; |
70 | </script> | 122 | </script> |
@@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
3 | <!-- 公共组件-每个页面必须引入 --> | 3 | <!-- 公共组件-每个页面必须引入 --> |
4 | <public-module></public-module> | 4 | <public-module></public-module> |
5 | <view> | 5 | <view> |
6 | - <luyj-tree search-placeholder="请输入搜索内容" :is-check="true" :search-if="true" v-slot:default="{ item }" :max="max" :trees="tree"> | 6 | + <luyj-tree @sendValue="confirm" :is-check="isCheck" search-placeholder="请输入搜索内容" :search-if="true" v-slot:default="{ item }" :max="max" :trees="tree"> |
7 | <view> | 7 | <view> |
8 | <view class="content-item"> | 8 | <view class="content-item"> |
9 | <view class="word">{{ item.name }}</view> | 9 | <view class="word">{{ item.name }}</view> |
@@ -18,6 +18,7 @@ | @@ -18,6 +18,7 @@ | ||
18 | <script> | 18 | <script> |
19 | import fTabbar from '@/components/module/f-tabbar/f-tabbar'; | 19 | import fTabbar from '@/components/module/f-tabbar/f-tabbar'; |
20 | import dataList from '@/config/mockOrg.js'; | 20 | import dataList from '@/config/mockOrg.js'; |
21 | +import { transOrgFunc } from '@/config/common.js'; | ||
21 | 22 | ||
22 | export default { | 23 | export default { |
23 | components: { | 24 | components: { |
@@ -25,13 +26,41 @@ export default { | @@ -25,13 +26,41 @@ export default { | ||
25 | }, | 26 | }, |
26 | data() { | 27 | data() { |
27 | return { | 28 | return { |
28 | - tree: dataList, | ||
29 | - max: 5 | 29 | + isCheck: true, // 是否可选 |
30 | + tree: [], | ||
31 | + max: 5, | ||
32 | + id: '' | ||
30 | }; | 33 | }; |
31 | }, | 34 | }, |
32 | onLoad(e) { | 35 | onLoad(e) { |
33 | // 隐藏原生的tabbar | 36 | // 隐藏原生的tabbar |
34 | uni.hideTabBar(); | 37 | uni.hideTabBar(); |
38 | + this.loadData(); | ||
39 | + }, | ||
40 | + methods: { | ||
41 | + loadData() { | ||
42 | + uni.$u.http | ||
43 | + .get('/yt/organization/me/list') | ||
44 | + .then(res => { | ||
45 | + if (res) { | ||
46 | + const list = transOrgFunc(res); | ||
47 | + this.tree = list; | ||
48 | + } | ||
49 | + }) | ||
50 | + .catch(e => { | ||
51 | + uni.$u.toast(e.data.message); | ||
52 | + }); | ||
53 | + }, | ||
54 | + confirm(val) { | ||
55 | + this.id = val[0].id; | ||
56 | + let pages = getCurrentPages(); //获取所有页面栈实例列表 | ||
57 | + let nowPage = pages[pages.length - 1]; //当前页页面实例 | ||
58 | + let prevPage = pages[pages.length - 2]; //上一页页面实例 | ||
59 | + prevPage.$vm.ordId = this.id; | ||
60 | + uni.navigateBack({ | ||
61 | + delta: 1 | ||
62 | + }); | ||
63 | + } | ||
35 | } | 64 | } |
36 | }; | 65 | }; |
37 | </script> | 66 | </script> |
@@ -3,29 +3,41 @@ | @@ -3,29 +3,41 @@ | ||
3 | <!-- 公共组件-每个页面必须引入 --> | 3 | <!-- 公共组件-每个页面必须引入 --> |
4 | <public-module></public-module> | 4 | <public-module></public-module> |
5 | <view class="org-sty"> | 5 | <view class="org-sty"> |
6 | - <view class="org-item"> | 6 | + <view @click="openOrg" class="org-item"> |
7 | <view class="u-flex" style="flex-direction: row;margin-top: 26rpx;margin-left: 15rpx;"> | 7 | <view class="u-flex" style="flex-direction: row;margin-top: 26rpx;margin-left: 15rpx;"> |
8 | <text style="color:#333333;font-size: 15px;margin-left: 14rpx;">组织关系</text> | 8 | <text style="color:#333333;font-size: 15px;margin-left: 14rpx;">组织关系</text> |
9 | </view> | 9 | </view> |
10 | <view style="margin-top: 5rpx;margin-left: 15rpx;flex-direction: row;" class="u-flex"> | 10 | <view style="margin-top: 5rpx;margin-left: 15rpx;flex-direction: row;" class="u-flex"> |
11 | <image style="margin-left: 14rpx;width: 30rpx;height: 30rpx;" src="../../../static/org.png" mode=""></image> | 11 | <image style="margin-left: 14rpx;width: 30rpx;height: 30rpx;" src="../../../static/org.png" mode=""></image> |
12 | - <text style="margin-left: 10rpx;color:#666666;font-size: 12px;">设备数:1234</text> | 12 | + <text style="margin-left: 10rpx;color:#666666;font-size: 12px;">设备数:{{ deviceTotal }}</text> |
13 | </view> | 13 | </view> |
14 | </view> | 14 | </view> |
15 | <view class="org-item" style=""> | 15 | <view class="org-item" style=""> |
16 | - <image @click="openOrg" style="width: 6px;height: 10px;float: right; margin-right: 34rpx; margin-top: 58rpx;" src="../../../static/right-arrow.png" mode=""></image> | 16 | + <image style="width: 6px;height: 10px;float: right; margin-right: 34rpx; margin-top: 58rpx;" src="../../../static/right-arrow.png" mode=""></image> |
17 | </view> | 17 | </view> |
18 | </view> | 18 | </view> |
19 | + <!-- <view class="camera-container"> | ||
20 | + <view class="container-item"> | ||
21 | + <view @click="openCameraDetail(item.url)" v-for="(item, index) in list" :key="index" class="item"> | ||
22 | + <video style="border-radius: 20px;width:300rpx ;height: 200rpx;" :src="item.url" controls></video> | ||
23 | + <view style="position: relative;top: 8rpx;text-align: center;"> | ||
24 | + <text style="color: #333333;font-size: 13px;">{{ item.name }}</text> | ||
25 | + </view> | ||
26 | + </view> | ||
27 | + </view> | ||
28 | + </view> --> | ||
29 | + | ||
19 | <view class="camera-container"> | 30 | <view class="camera-container"> |
20 | <view class="container-item"> | 31 | <view class="container-item"> |
21 | <view @click="openCameraDetail(item.url)" v-for="(item, index) in list" :key="index" class="item"> | 32 | <view @click="openCameraDetail(item.url)" v-for="(item, index) in list" :key="index" class="item"> |
22 | - <video style="border-radius: 20px;width:300rpx ;height: 200rpx;" object-fit="conver" :src="item.url" controls></video> | 33 | + <video style="border-radius: 20px;width:300rpx ;height: 200rpx;" :src="item.url" controls></video> |
23 | <view style="position: relative;top: 8rpx;text-align: center;"> | 34 | <view style="position: relative;top: 8rpx;text-align: center;"> |
24 | <text style="color: #333333;font-size: 13px;">{{ item.name }}</text> | 35 | <text style="color: #333333;font-size: 13px;">{{ item.name }}</text> |
25 | </view> | 36 | </view> |
26 | </view> | 37 | </view> |
27 | </view> | 38 | </view> |
28 | </view> | 39 | </view> |
40 | + <view style="height: 30rpx;"></view> | ||
29 | <f-tabbar></f-tabbar> | 41 | <f-tabbar></f-tabbar> |
30 | </view> | 42 | </view> |
31 | </template> | 43 | </template> |
@@ -39,6 +51,7 @@ export default { | @@ -39,6 +51,7 @@ export default { | ||
39 | }, | 51 | }, |
40 | data() { | 52 | data() { |
41 | return { | 53 | return { |
54 | + deviceTotal: 0, | ||
42 | list: [ | 55 | list: [ |
43 | { | 56 | { |
44 | url: 'http://113.204.115.250:83/openUrl/e5NZg76/live.m3u8', | 57 | url: 'http://113.204.115.250:83/openUrl/e5NZg76/live.m3u8', |
@@ -63,6 +76,18 @@ export default { | @@ -63,6 +76,18 @@ export default { | ||
63 | { | 76 | { |
64 | url: 'https://stream7.iqilu.com/10339/upload_transcode/202002/09/20200209104902N3v5Vpxuvb.mp4', | 77 | url: 'https://stream7.iqilu.com/10339/upload_transcode/202002/09/20200209104902N3v5Vpxuvb.mp4', |
65 | name: '摄像头6' | 78 | name: '摄像头6' |
79 | + }, | ||
80 | + { | ||
81 | + url: 'https://stream7.iqilu.com/10339/upload_transcode/202002/09/20200209104902N3v5Vpxuvb.mp4', | ||
82 | + name: '摄像头6' | ||
83 | + }, | ||
84 | + { | ||
85 | + url: 'https://stream7.iqilu.com/10339/upload_transcode/202002/09/20200209104902N3v5Vpxuvb.mp4', | ||
86 | + name: '摄像头6' | ||
87 | + }, | ||
88 | + { | ||
89 | + url: 'https://stream7.iqilu.com/10339/upload_transcode/202002/09/20200209104902N3v5Vpxuvb.mp4', | ||
90 | + name: '摄像头6' | ||
66 | } | 91 | } |
67 | ] | 92 | ] |
68 | }; | 93 | }; |
@@ -70,10 +95,32 @@ export default { | @@ -70,10 +95,32 @@ export default { | ||
70 | onLoad() { | 95 | onLoad() { |
71 | // 隐藏原生的tabbar | 96 | // 隐藏原生的tabbar |
72 | uni.hideTabBar(); | 97 | uni.hideTabBar(); |
98 | + this.getDeviceTotalData(); | ||
73 | }, | 99 | }, |
74 | methods: { | 100 | methods: { |
101 | + getDeviceTotalData() { | ||
102 | + let httpData = { | ||
103 | + page: 1, | ||
104 | + pageSize: 10 | ||
105 | + }; | ||
106 | + uni.$u.http | ||
107 | + .get('/yt/device', { params: httpData, custom: { load: false } }) | ||
108 | + .then(res => { | ||
109 | + if (res) { | ||
110 | + this.deviceTotal = res.total; | ||
111 | + } | ||
112 | + }) | ||
113 | + .catch(e => { | ||
114 | + uni.$u.toast(e.data?.message); | ||
115 | + }); | ||
116 | + }, | ||
75 | openCameraDetail(e) { | 117 | openCameraDetail(e) { |
76 | console.log(e); | 118 | console.log(e); |
119 | + }, | ||
120 | + openOrg() { | ||
121 | + uni.navigateTo({ | ||
122 | + url: './org/org' | ||
123 | + }); | ||
77 | } | 124 | } |
78 | } | 125 | } |
79 | }; | 126 | }; |
pages/index/camera/org/org.vue
0 → 100644
1 | +<template> | ||
2 | + <view class="org-content"> | ||
3 | + <!-- 公共组件-每个页面必须引入 --> | ||
4 | + <public-module></public-module> | ||
5 | + <view> | ||
6 | + <luyj-tree @sendValue="confirm" :is-check="isCheck" search-placeholder="请输入搜索内容" :search-if="true" v-slot:default="{ item }" :max="max" :trees="tree"> | ||
7 | + <view> | ||
8 | + <view class="content-item"> | ||
9 | + <view class="word">{{ item.name }}</view> | ||
10 | + </view> | ||
11 | + </view> | ||
12 | + </luyj-tree> | ||
13 | + </view> | ||
14 | + <f-tabbar></f-tabbar> | ||
15 | + </view> | ||
16 | +</template> | ||
17 | + | ||
18 | +<script> | ||
19 | +import fTabbar from '@/components/module/f-tabbar/f-tabbar'; | ||
20 | +import dataList from '@/config/mockOrg.js'; | ||
21 | +import { transOrgFunc } from '@/config/common.js'; | ||
22 | + | ||
23 | +export default { | ||
24 | + components: { | ||
25 | + fTabbar | ||
26 | + }, | ||
27 | + data() { | ||
28 | + return { | ||
29 | + isCheck: true, // 是否可选 | ||
30 | + tree: [], | ||
31 | + max: 5, | ||
32 | + id: '' | ||
33 | + }; | ||
34 | + }, | ||
35 | + onLoad(e) { | ||
36 | + // 隐藏原生的tabbar | ||
37 | + uni.hideTabBar(); | ||
38 | + this.loadData(); | ||
39 | + }, | ||
40 | + methods: { | ||
41 | + loadData() { | ||
42 | + uni.$u.http | ||
43 | + .get('/yt/organization/me/list') | ||
44 | + .then(res => { | ||
45 | + if (res) { | ||
46 | + const list = transOrgFunc(res); | ||
47 | + this.tree = list; | ||
48 | + } | ||
49 | + }) | ||
50 | + .catch(e => { | ||
51 | + uni.$u.toast(e.data.message); | ||
52 | + }); | ||
53 | + }, | ||
54 | + confirm(val) { | ||
55 | + this.id = val[0].id; | ||
56 | + let pages = getCurrentPages(); //获取所有页面栈实例列表 | ||
57 | + let nowPage = pages[pages.length - 1]; //当前页页面实例 | ||
58 | + let prevPage = pages[pages.length - 2]; //上一页页面实例 | ||
59 | + prevPage.$vm.ordId = this.id; | ||
60 | + uni.navigateBack({ | ||
61 | + delta: 1 | ||
62 | + }); | ||
63 | + } | ||
64 | + } | ||
65 | +}; | ||
66 | +</script> | ||
67 | + | ||
68 | +<style lang="scss" scoped> | ||
69 | +.org-content { | ||
70 | + padding: 0 10rpx; | ||
71 | +} | ||
72 | +</style> |
@@ -14,15 +14,21 @@ | @@ -14,15 +14,21 @@ | ||
14 | </view> | 14 | </view> |
15 | <view class="item-child u-flex" style="justify-content: space-between;align-items: center;"> | 15 | <view class="item-child u-flex" style="justify-content: space-between;align-items: center;"> |
16 | <view style="width: 200rpx;height: 150rpx;justify-content: space-between;flex-direction: column;" class="u-flex"> | 16 | <view style="width: 200rpx;height: 150rpx;justify-content: space-between;flex-direction: column;" class="u-flex"> |
17 | - <view style="height: 70rpx;font-size:14px;color:#333333;font-weight:500"><text>2</text></view> | 17 | + <view style="height: 70rpx;font-size:14px;color:#333333;font-weight:500"> |
18 | + <text>{{ deviceData.onLine }}</text> | ||
19 | + </view> | ||
18 | <view style="position:relative;top:-40rpx;height: 60rpx;font-size:12px;color:#999999"><text>在线</text></view> | 20 | <view style="position:relative;top:-40rpx;height: 60rpx;font-size:12px;color:#999999"><text>在线</text></view> |
19 | </view> | 21 | </view> |
20 | <view style="margin-left: 45rpx;width: 200rpx;height: 150rpx;justify-content: space-between;flex-direction: column;" class="u-flex"> | 22 | <view style="margin-left: 45rpx;width: 200rpx;height: 150rpx;justify-content: space-between;flex-direction: column;" class="u-flex"> |
21 | - <view style="height: 70rpx;font-size:14px;color:#333333;font-weight:500"><text>52</text></view> | 23 | + <view style="height: 70rpx;font-size:14px;color:#333333;font-weight:500"> |
24 | + <text>{{ deviceData.unLine }}</text> | ||
25 | + </view> | ||
22 | <view style="position:relative;top:-40rpx;height: 60rpx;font-size:12px;color:#999999"><text>离线</text></view> | 26 | <view style="position:relative;top:-40rpx;height: 60rpx;font-size:12px;color:#999999"><text>离线</text></view> |
23 | </view> | 27 | </view> |
24 | <view style="margin-left: 45rpx;width: 200rpx;height: 150rpx;justify-content: space-between;flex-direction: column;" class="u-flex"> | 28 | <view style="margin-left: 45rpx;width: 200rpx;height: 150rpx;justify-content: space-between;flex-direction: column;" class="u-flex"> |
25 | - <view style="height: 70rpx;font-size:14px;color:#333333;font-weight:500"><text>299</text></view> | 29 | + <view style="height: 70rpx;font-size:14px;color:#333333;font-weight:500"> |
30 | + <text>{{ deviceData.noActive }}</text> | ||
31 | + </view> | ||
26 | <view style="position:relative;top:-40rpx;height: 60rpx;font-size:12px;color:#999999"><text>未激活</text></view> | 32 | <view style="position:relative;top:-40rpx;height: 60rpx;font-size:12px;color:#999999"><text>未激活</text></view> |
27 | </view> | 33 | </view> |
28 | </view> | 34 | </view> |
@@ -34,15 +40,21 @@ | @@ -34,15 +40,21 @@ | ||
34 | </view> | 40 | </view> |
35 | <view class="item-child u-flex" style="justify-content: space-between;align-items: center;"> | 41 | <view class="item-child u-flex" style="justify-content: space-between;align-items: center;"> |
36 | <view style="width: 200rpx;height: 150rpx;justify-content: space-between;flex-direction: column;" class="u-flex"> | 42 | <view style="width: 200rpx;height: 150rpx;justify-content: space-between;flex-direction: column;" class="u-flex"> |
37 | - <view style="height: 70rpx;font-size:14px;color:#333333;font-weight:500"><text>12</text></view> | 43 | + <view style="height: 70rpx;font-size:14px;color:#333333;font-weight:500"> |
44 | + <text>{{ alertData.noHandle }}</text> | ||
45 | + </view> | ||
38 | <view style="position:relative;top:-40rpx;height: 60rpx;font-size:12px;color:#999999"><text>未处理</text></view> | 46 | <view style="position:relative;top:-40rpx;height: 60rpx;font-size:12px;color:#999999"><text>未处理</text></view> |
39 | </view> | 47 | </view> |
40 | <view style="margin-left: 45rpx;width: 200rpx;height: 150rpx;justify-content: space-between;flex-direction: column;" class="u-flex"> | 48 | <view style="margin-left: 45rpx;width: 200rpx;height: 150rpx;justify-content: space-between;flex-direction: column;" class="u-flex"> |
41 | - <view style="height: 70rpx;font-size:14px;color:#333333;font-weight:500"><text>522</text></view> | 49 | + <view style="height: 70rpx;font-size:14px;color:#333333;font-weight:500"> |
50 | + <text>{{ alertData.doneHandle }}</text> | ||
51 | + </view> | ||
42 | <view style="position:relative;top:-40rpx;height: 60rpx;font-size:12px;color:#999999"><text>已处理</text></view> | 52 | <view style="position:relative;top:-40rpx;height: 60rpx;font-size:12px;color:#999999"><text>已处理</text></view> |
43 | </view> | 53 | </view> |
44 | <view style="margin-left: 45rpx;width: 200rpx;height: 150rpx;justify-content: space-between;flex-direction: column;" class="u-flex"> | 54 | <view style="margin-left: 45rpx;width: 200rpx;height: 150rpx;justify-content: space-between;flex-direction: column;" class="u-flex"> |
45 | - <view style="height: 70rpx;font-size:14px;color:#333333;font-weight:500"><text>99</text></view> | 55 | + <view style="height: 70rpx;font-size:14px;color:#333333;font-weight:500"> |
56 | + <text>{{ alertData.errorReport }}</text> | ||
57 | + </view> | ||
46 | <view style="position:relative;top:-40rpx;height: 60rpx;font-size:12px;color:#999999"><text>误报</text></view> | 58 | <view style="position:relative;top:-40rpx;height: 60rpx;font-size:12px;color:#999999"><text>误报</text></view> |
47 | </view> | 59 | </view> |
48 | </view> | 60 | </view> |
@@ -97,21 +109,55 @@ export default { | @@ -97,21 +109,55 @@ export default { | ||
97 | }, | 109 | }, |
98 | data() { | 110 | data() { |
99 | return { | 111 | return { |
100 | - openCamera() { | ||
101 | - uni.navigateTo({ | ||
102 | - url: 'camera/camera' | ||
103 | - }); | 112 | + deviceData: { |
113 | + onLine: 0, | ||
114 | + unLine: 0, | ||
115 | + noActive: 0 | ||
104 | }, | 116 | }, |
105 | - openOrgStatus() { | ||
106 | - uni.navigateTo({ | ||
107 | - url: 'orgStatus/orgStatus' | ||
108 | - }); | 117 | + alertData: { |
118 | + noHandle: 0, | ||
119 | + doneHandle: 0, | ||
120 | + errorReport: 0 | ||
109 | } | 121 | } |
110 | }; | 122 | }; |
111 | }, | 123 | }, |
112 | onLoad() { | 124 | onLoad() { |
113 | // 隐藏原生的tabbar | 125 | // 隐藏原生的tabbar |
114 | uni.hideTabBar(); | 126 | uni.hideTabBar(); |
127 | + this.getDeviceTotalData(); | ||
128 | + }, | ||
129 | + methods: { | ||
130 | + getDeviceTotalData() { | ||
131 | + let httpData = { | ||
132 | + page: 1, | ||
133 | + pageSize: 10 | ||
134 | + }; | ||
135 | + uni.$u.http | ||
136 | + .get('/yt/homepage/left/top', { params: httpData, custom: { load: false } }) | ||
137 | + .then(res => { | ||
138 | + if (res) { | ||
139 | + this.deviceData.onLine = res.deviceInfo.onLine; | ||
140 | + this.deviceData.unLine = res.deviceInfo.offLine; | ||
141 | + this.deviceData.noActive = res.deviceInfo.inActive; | ||
142 | + this.alertData.noHandle = res.alarmInfo.todayAdd; | ||
143 | + this.alertData.doneHandle = res.alarmInfo.sumCount; | ||
144 | + this.alertData.errorReport = res.alarmInfo.todayAdd; | ||
145 | + } | ||
146 | + }) | ||
147 | + .catch(e => { | ||
148 | + uni.$u.toast(e.data?.message); | ||
149 | + }); | ||
150 | + }, | ||
151 | + openCamera() { | ||
152 | + uni.navigateTo({ | ||
153 | + url: 'camera/camera' | ||
154 | + }); | ||
155 | + }, | ||
156 | + openOrgStatus() { | ||
157 | + uni.navigateTo({ | ||
158 | + url: 'orgStatus/orgStatus' | ||
159 | + }); | ||
160 | + } | ||
115 | } | 161 | } |
116 | }; | 162 | }; |
117 | </script> | 163 | </script> |
@@ -105,11 +105,14 @@ | @@ -105,11 +105,14 @@ | ||
105 | ...resObj, | 105 | ...resObj, |
106 | token: true //token用于判断是否登录 | 106 | token: true //token用于判断是否登录 |
107 | }; | 107 | }; |
108 | - this.setUserInfo(userInfo); | 108 | + if (userInfo.token) { |
109 | + this.setUserInfo(userInfo); | ||
110 | + } | ||
109 | uni.showToast({ | 111 | uni.showToast({ |
110 | title: '登录成功~', | 112 | title: '登录成功~', |
111 | icon: 'none' | 113 | icon: 'none' |
112 | }); | 114 | }); |
115 | + this.saveUserInfo(); | ||
113 | setTimeout(() => { | 116 | setTimeout(() => { |
114 | uni.navigateBack({ | 117 | uni.navigateBack({ |
115 | delta:2 | 118 | delta:2 |
@@ -118,6 +121,14 @@ | @@ -118,6 +121,14 @@ | ||
118 | } | 121 | } |
119 | }); | 122 | }); |
120 | }, | 123 | }, |
124 | + saveUserInfo() { | ||
125 | + //储存个人信息 | ||
126 | + uni.$u.http.get('/yt/user/me/info').then(res => { | ||
127 | + if (res) { | ||
128 | + this.setUserInfo(res); | ||
129 | + } | ||
130 | + }); | ||
131 | + }, | ||
121 | openAccountFunc(){ | 132 | openAccountFunc(){ |
122 | uni.navigateTo({ | 133 | uni.navigateTo({ |
123 | url:"./login" | 134 | url:"./login" |
@@ -20,13 +20,12 @@ | @@ -20,13 +20,12 @@ | ||
20 | class="input" | 20 | class="input" |
21 | prefixIcon="lock-fill" | 21 | prefixIcon="lock-fill" |
22 | suffixIconStyle="color: #909399" | 22 | suffixIconStyle="color: #909399" |
23 | - :type="showPasswordOrText" | 23 | + :type="passwordText" |
24 | placeholder="请输入密码" | 24 | placeholder="请输入密码" |
25 | v-model="loginForm.password" | 25 | v-model="loginForm.password" |
26 | - @change="passwordChange" | ||
27 | > | 26 | > |
28 | <template slot="suffix"> | 27 | <template slot="suffix"> |
29 | - <u-icon @click="showPasswordMode" :name="showPasswordIcon"></u-icon> | 28 | + <u-icon @click="showPasswordMode" :name="showPassword ? showTextIcon : showPasswordIcon"></u-icon> |
30 | </template> | 29 | </template> |
31 | </u-input> | 30 | </u-input> |
32 | </view> | 31 | </view> |
@@ -35,7 +34,8 @@ | @@ -35,7 +34,8 @@ | ||
35 | <view style="color: #999999;font-size: 13px;" @click="openCodeFunc">手机验证码登录</view> | 34 | <view style="color: #999999;font-size: 13px;" @click="openCodeFunc">手机验证码登录</view> |
36 | <view style="color: #999999;font-size: 13px;position: relative;" @click="findPassrordFunc">忘记密码</view> | 35 | <view style="color: #999999;font-size: 13px;position: relative;" @click="findPassrordFunc">忘记密码</view> |
37 | </view> | 36 | </view> |
38 | - <view class="u-flex" style="justify-content: center;flex-direction: column;margin-top: 220rpx;"> | 37 | + <!-- <button class="button marginT" @click="onAuthorization" :style="{background:PrimaryColor}">微信授权登录</button> --> |
38 | + <view @click="onAuthorization" class="u-flex" style="justify-content: center;flex-direction: column;margin-top: 220rpx;"> | ||
39 | <view style="color:#999999;font-size: 13px;">第三方账号登录</view> | 39 | <view style="color:#999999;font-size: 13px;">第三方账号登录</view> |
40 | <view style="height:20rpx"></view> | 40 | <view style="height:20rpx"></view> |
41 | <view><image style="width: 75rpx;height: 75rpx;" src="../../static/weixin.png" mode="aspectFill"></image></view> | 41 | <view><image style="width: 75rpx;height: 75rpx;" src="../../static/weixin.png" mode="aspectFill"></image></view> |
@@ -47,45 +47,102 @@ | @@ -47,45 +47,102 @@ | ||
47 | </template> | 47 | </template> |
48 | 48 | ||
49 | <script> | 49 | <script> |
50 | -import { mapState, mapMutations } from 'vuex'; | 50 | +import { mapMutations } from 'vuex'; |
51 | +import { getUserInfo } from '@/components/module/f-login/f-login.js'; | ||
51 | 52 | ||
52 | export default { | 53 | export default { |
53 | data() { | 54 | data() { |
54 | return { | 55 | return { |
55 | showPasswordIcon: 'eye-off', | 56 | showPasswordIcon: 'eye-off', |
56 | - showPasswordOrText: 'password', | 57 | + showTextIcon: 'eye-fill', |
57 | loginForm: { | 58 | loginForm: { |
58 | username: '', | 59 | username: '', |
59 | password: '' | 60 | password: '' |
60 | - } | 61 | + }, |
62 | + showPassword: false, | ||
63 | + passwordText: 'password' | ||
61 | }; | 64 | }; |
62 | }, | 65 | }, |
63 | methods: { | 66 | methods: { |
64 | ...mapMutations(['setUserInfo']), | 67 | ...mapMutations(['setUserInfo']), |
65 | - passwordChange() {}, | 68 | + onAuthorization(e) { |
69 | + getUserInfo( | ||
70 | + info => { | ||
71 | + console.log(info, '授权信息'); | ||
72 | + let httpData = { | ||
73 | + code: this.code, | ||
74 | + nickName: info.nickName || '', //昵称 | ||
75 | + avatarUrl: info.avatarUrl || '', //头像 | ||
76 | + gender: info.gender || '' //性别 0:未知 1:男 2:女 | ||
77 | + }; | ||
78 | + // uni.$u.http.post('您的接口', httpData).then(res => { | ||
79 | + let userInfo = { | ||
80 | + // ...res, | ||
81 | + token: true //token用于判断是否登录 | ||
82 | + }; | ||
83 | + // this.setUserInfo(userInfo) | ||
84 | + // setTimeout(()=>{ | ||
85 | + // uni.showToast({ | ||
86 | + // title: '登录成功', | ||
87 | + // icon: 'none' | ||
88 | + // }); | ||
89 | + // this.closeLogin(); | ||
90 | + // },100) | ||
91 | + // }) | ||
92 | + }, | ||
93 | + err => { | ||
94 | + // this.closeLogin(); | ||
95 | + } | ||
96 | + ); | ||
97 | + }, | ||
66 | onSubmitFunc() { | 98 | onSubmitFunc() { |
67 | if (this.loginForm.username == '' || this.loginForm.password == '') { | 99 | if (this.loginForm.username == '' || this.loginForm.password == '') { |
68 | return uni.$u.toast('请输入用户名或密码'); | 100 | return uni.$u.toast('请输入用户名或密码'); |
69 | } | 101 | } |
70 | - uni.$u.http.post('/auth/login', this.loginForm).then(res => { | 102 | + uni.$u.http |
103 | + .post('/auth/login', this.loginForm) | ||
104 | + .then(res => { | ||
105 | + if (res) { | ||
106 | + // 储存登录信息 | ||
107 | + let resObj = { | ||
108 | + refreshToken: res.refreshToken, | ||
109 | + isToken: res.token | ||
110 | + }; | ||
111 | + let userInfo = { | ||
112 | + ...resObj, | ||
113 | + token: true //token用于判断是否登录 | ||
114 | + }; | ||
115 | + if (userInfo.token) { | ||
116 | + this.setUserInfo(userInfo); | ||
117 | + } | ||
118 | + uni.showToast({ | ||
119 | + title: '登录成功~', | ||
120 | + icon: 'none' | ||
121 | + }); | ||
122 | + this.saveUserInfo(); | ||
123 | + setTimeout(() => { | ||
124 | + uni.navigateBack({ | ||
125 | + delta: 1 | ||
126 | + }); | ||
127 | + }, 500); | ||
128 | + //#ifndef MP | ||
129 | + setTimeout(() => { | ||
130 | + uni.navigateTo({ | ||
131 | + url: 'personal' | ||
132 | + }); | ||
133 | + }, 500); | ||
134 | + //#endif | ||
135 | + } | ||
136 | + }) | ||
137 | + .catch(e => { | ||
138 | + uni.$u.toast(e.data.message); | ||
139 | + }); | ||
140 | + }, | ||
141 | + saveUserInfo() { | ||
142 | + //储存个人信息 | ||
143 | + uni.$u.http.get('/yt/user/me/info').then(res => { | ||
71 | if (res) { | 144 | if (res) { |
72 | - // 储存登录信息 | ||
73 | - let resObj = { | ||
74 | - refreshToken: res.refreshToken, | ||
75 | - isToken: res.token | ||
76 | - }; | ||
77 | - let userInfo = { | ||
78 | - ...resObj, | ||
79 | - token: true //token用于判断是否登录 | ||
80 | - }; | ||
81 | - this.setUserInfo(userInfo); | ||
82 | - uni.showToast({ | ||
83 | - title: '登录成功~', | ||
84 | - icon: 'none' | ||
85 | - }); | ||
86 | - setTimeout(() => { | ||
87 | - uni.navigateBack(); | ||
88 | - }, 500); | 145 | + this.setUserInfo(res); |
89 | } | 146 | } |
90 | }); | 147 | }); |
91 | }, | 148 | }, |
@@ -100,12 +157,11 @@ export default { | @@ -100,12 +157,11 @@ export default { | ||
100 | }); | 157 | }); |
101 | }, | 158 | }, |
102 | showPasswordMode() { | 159 | showPasswordMode() { |
103 | - if (this.loginForm.password.length !== 0) { | ||
104 | - this.showPasswordOrText = 'text'; | ||
105 | - this.showPasswordIcon = 'eye-fill'; | 160 | + this.showPassword = !this.showPassword; |
161 | + if (!this.showPassword) { | ||
162 | + this.passwordText = 'password'; | ||
106 | } else { | 163 | } else { |
107 | - this.showPasswordOrText = 'password'; | ||
108 | - this.showPasswordIcon = 'eye-off'; | 164 | + this.passwordText = 'text'; |
109 | } | 165 | } |
110 | } | 166 | } |
111 | } | 167 | } |
@@ -6,11 +6,11 @@ | @@ -6,11 +6,11 @@ | ||
6 | <!-- #ifdef MP --> | 6 | <!-- #ifdef MP --> |
7 | <!-- 登录 --> | 7 | <!-- 登录 --> |
8 | <view class="u-flex u-p-l-30 u-p-r-20 u-p-t-75 u-p-b-30"> | 8 | <view class="u-flex u-p-l-30 u-p-r-20 u-p-t-75 u-p-b-30"> |
9 | - <block v-if="userInfo.token"> | ||
10 | - <view class="u-m-r-20"><image class="avatar" mode="aspectFill" :src="userInfo.headLogo || '/static/logo.png'"></image></view> | ||
11 | - <view class="u-flex-1" @click="onJump('/pages/personal/set')"> | 9 | + <block v-if="userInfo.isToken"> |
10 | + <view @click="openPersonalInfo" class="u-m-r-20"><image class="avatar" mode="aspectFill" :src="userInfo.avatar || '/static/logo.png'"></image></view> | ||
11 | + <view @click="openPersonalInfo" class="u-flex-1"> | ||
12 | <view class="nickName u-flex"> | 12 | <view class="nickName u-flex"> |
13 | - <view class="name u-m-r-10" v-if="userInfo.nickName">{{ userInfo.nickName }}</view> | 13 | + <view class="name u-m-r-10" v-if="userInfo.realName">{{ userInfo.realName }}</view> |
14 | </view> | 14 | </view> |
15 | <view class="detail" v-if="userInfo.phoneNum">手机号:{{ userInfo.phoneNum | phone }}</view> | 15 | <view class="detail" v-if="userInfo.phoneNum">手机号:{{ userInfo.phoneNum | phone }}</view> |
16 | <view class="detail" v-else>手机号:未绑定</view> | 16 | <view class="detail" v-else>手机号:未绑定</view> |
@@ -31,16 +31,16 @@ | @@ -31,16 +31,16 @@ | ||
31 | </view> | 31 | </view> |
32 | </view> | 32 | </view> |
33 | </block> | 33 | </block> |
34 | - <view><u-icon @click="openPersonalInfo" name="arrow-right" color="black" size="13"></u-icon></view> | 34 | + <view><u-icon name="arrow-right" color="black" size="13"></u-icon></view> |
35 | </view> | 35 | </view> |
36 | <!-- #endif --> | 36 | <!-- #endif --> |
37 | <!-- #ifndef MP --> | 37 | <!-- #ifndef MP --> |
38 | <!-- 登录 --> | 38 | <!-- 登录 --> |
39 | <view class="u-flex u-p-l-30 u-p-r-20 u-p-t-75 u-p-b-30"> | 39 | <view class="u-flex u-p-l-30 u-p-r-20 u-p-t-75 u-p-b-30"> |
40 | - <block v-if="userInfo.token"> | ||
41 | - <view class="u-m-r-20"><image class="avatar" mode="aspectFill" :src="userInfo.headLogo"></image></view> | ||
42 | - <view class="u-flex-1" @click="onJump('/pages/user/set')"> | ||
43 | - <view class="nickName">{{ userInfo.userName }}</view> | 40 | + <block v-if="userInfo.isToken"> |
41 | + <view @click="openPersonalInfo" class="u-m-r-20"><image class="avatar" mode="aspectFill" :src="userInfo.avatar"></image></view> | ||
42 | + <view @click="openPersonalInfo" class="u-flex-1"> | ||
43 | + <view class="nickName">{{ userInfo.realName }}</view> | ||
44 | <view class="detail" v-if="userInfo.phoneNum">手机号:{{ userInfo.phoneNum | phone }}</view> | 44 | <view class="detail" v-if="userInfo.phoneNum">手机号:{{ userInfo.phoneNum | phone }}</view> |
45 | <view class="detail" v-else>手机号:未绑定</view> | 45 | <view class="detail" v-else>手机号:未绑定</view> |
46 | </view> | 46 | </view> |
@@ -54,23 +54,27 @@ | @@ -54,23 +54,27 @@ | ||
54 | <view @click="clickAccountFunc" style="color:black;" class="detail">绑定账号</view> | 54 | <view @click="clickAccountFunc" style="color:black;" class="detail">绑定账号</view> |
55 | </view> | 55 | </view> |
56 | </block> | 56 | </block> |
57 | - <view><u-icon @click="openPersonalInfo" name="arrow-right" color="black" size="13"></u-icon></view> | 57 | + <view><u-icon name="arrow-right" color="black" size="13"></u-icon></view> |
58 | </view> | 58 | </view> |
59 | <!-- #endif --> | 59 | <!-- #endif --> |
60 | </view> | 60 | </view> |
61 | <view | 61 | <view |
62 | class="u-flex" | 62 | class="u-flex" |
63 | - style="position: relative;top:-25rpx;z-index:54;background: #FFFFFF;;border-radius: 17px 17px 0px 0px;;height: 750rpx;width: 750rpx;flex-direction: column;justify-content: space-between;" | 63 | + style="overflow-x: hidden;position: relative;top:-25rpx;z-index:54;background: #FFFFFF;;border-radius: 17px 17px 0px 0px;;height: 835rpx;width: 750rpx;flex-direction: column;justify-content: space-between;" |
64 | > | 64 | > |
65 | <view style="margin-top: 100rpx;"> | 65 | <view style="margin-top: 100rpx;"> |
66 | - <view @click="openSysNotify" class="u-flex" style="flex-direction: row;justify-content: space-between;align-content: space-between;"> | 66 | + <view @click="onTokenJump('../systemNotify/systemNotify')" class="u-flex" style="flex-direction: row;justify-content: space-between;align-content: space-between;"> |
67 | <view style="width: 125rpx;"><image style="width:35rpx;height: 35rpx;" src="../../static/sys-not.png" mode=""></image></view> | 67 | <view style="width: 125rpx;"><image style="width:35rpx;height: 35rpx;" src="../../static/sys-not.png" mode=""></image></view> |
68 | <view style="position: relative;left: -58rpx;width: 420rpx;"><text style="color: #333333;font-size: 15px;">系统通知</text></view> | 68 | <view style="position: relative;left: -58rpx;width: 420rpx;"><text style="color: #333333;font-size: 15px;">系统通知</text></view> |
69 | <view style="position: relative;right: -112rpx;width: 100rpx;"> | 69 | <view style="position: relative;right: -112rpx;width: 100rpx;"> |
70 | <image style="width: 13rpx;height: 17rpx;" src="../../static/arrow-right.png" mode=""></image> | 70 | <image style="width: 13rpx;height: 17rpx;" src="../../static/arrow-right.png" mode=""></image> |
71 | </view> | 71 | </view> |
72 | </view> | 72 | </view> |
73 | - <view @click="openFeedBack" class="u-flex" style="margin-top: 60rpx;flex-direction: row;justify-content: space-between;align-content: space-between;"> | 73 | + <view |
74 | + @click="onTokenJump('../feedback/feedback')" | ||
75 | + class="u-flex" | ||
76 | + style="margin-top: 60rpx;flex-direction: row;justify-content: space-between;align-content: space-between;" | ||
77 | + > | ||
74 | <view style="width: 125rpx;"><image style="width:35rpx;height: 35rpx;" src="../../static/find-sugg.png" mode=""></image></view> | 78 | <view style="width: 125rpx;"><image style="width:35rpx;height: 35rpx;" src="../../static/find-sugg.png" mode=""></image></view> |
75 | <view style="position: relative;left: -58rpx;width: 420rpx;"><text style="color: #333333;font-size: 15px;">意见反馈</text></view> | 79 | <view style="position: relative;left: -58rpx;width: 420rpx;"><text style="color: #333333;font-size: 15px;">意见反馈</text></view> |
76 | <view style="position: relative;right: -112rpx;width: 100rpx;"> | 80 | <view style="position: relative;right: -112rpx;width: 100rpx;"> |
@@ -85,13 +89,12 @@ | @@ -85,13 +89,12 @@ | ||
85 | <view> | 89 | <view> |
86 | <u-modal :showConfirmButton="false" :show="show" :title="title"> | 90 | <u-modal :showConfirmButton="false" :show="show" :title="title"> |
87 | <view v-if="!bindPhone" class="loginPhone"> | 91 | <view v-if="!bindPhone" class="loginPhone"> |
88 | - <view class="form-row" style="background:#F7F9FF;border-radius: 48px;width: 532rpx;height: 80rpx;border: 0.01rpx solid #F7F9FF;"> | ||
89 | - <u--input border="surround" shape="circle" class="input" prefixIcon="account-fill" type="text" placeholder="登录账号" v-model="account"></u--input> | 92 | + <view class="form-row" style="background:#F7F9FF;border-radius: 48px;width: 532rpx;height: 80rpx;"> |
93 | + <u--input shape="circle" class="input" prefixIcon="account-fill" type="text" placeholder="登录账号" v-model="account"></u--input> | ||
90 | </view> | 94 | </view> |
91 | - <view class="form-row" style="margin-top: 20rpx;background: #F7F9FF;border-radius: 48px;width: 532rpx;height: 80rpx;border: 0.01rpx solid #F7F9FF;"> | 95 | + <view class="form-row" style="margin-top: 20rpx;background: #F7F9FF;border-radius: 48px;width: 532rpx;height: 80rpx;"> |
92 | <u--input | 96 | <u--input |
93 | class="input" | 97 | class="input" |
94 | - border="surround" | ||
95 | shape="circle" | 98 | shape="circle" |
96 | prefixIcon="lock-fill" | 99 | prefixIcon="lock-fill" |
97 | :suffixIcon="showPasswordIcon" | 100 | :suffixIcon="showPasswordIcon" |
@@ -108,9 +111,8 @@ | @@ -108,9 +111,8 @@ | ||
108 | </view> | 111 | </view> |
109 | </view> | 112 | </view> |
110 | <view v-else class="loginPhone"> | 113 | <view v-else class="loginPhone"> |
111 | - <view class="form-row" style="background:#F7F9FF;border-radius: 48px;width: 532rpx;height: 80rpx;border: 0.01rpx solid #F7F9FF;"> | 114 | + <view class="form-row" style="background:#F7F9FF;border-radius: 48px;width: 532rpx;height: 80rpx;"> |
112 | <u--input | 115 | <u--input |
113 | - border="surround" | ||
114 | shape="circle" | 116 | shape="circle" |
115 | class="input" | 117 | class="input" |
116 | type="text" | 118 | type="text" |
@@ -119,9 +121,8 @@ | @@ -119,9 +121,8 @@ | ||
119 | placeholder-style="font-weight:normal;color:#bbbbbb;" | 121 | placeholder-style="font-weight:normal;color:#bbbbbb;" |
120 | ></u--input> | 122 | ></u--input> |
121 | </view> | 123 | </view> |
122 | - <view class="form-row" style="margin-top: 20rpx;background:#F7F9FF;border-radius: 48px;width: 532rpx;height: 80rpx;border: 0.01rpx solid #F7F9FF;"> | 124 | + <view class="form-row" style="margin-top: 20rpx;background:#F7F9FF;border-radius: 48px;width: 532rpx;height: 80rpx;"> |
123 | <u--input | 125 | <u--input |
124 | - border="surround" | ||
125 | shape="circle" | 126 | shape="circle" |
126 | class="input" | 127 | class="input" |
127 | type="text" | 128 | type="text" |
@@ -162,6 +163,7 @@ | @@ -162,6 +163,7 @@ | ||
162 | </template> | 163 | </template> |
163 | 164 | ||
164 | <script> | 165 | <script> |
166 | +var clear; | ||
165 | import base from '@/config/baseUrl'; | 167 | import base from '@/config/baseUrl'; |
166 | import fTabbar from '@/components/module/f-tabbar/f-tabbar'; | 168 | import fTabbar from '@/components/module/f-tabbar/f-tabbar'; |
167 | import fNavbar from '@/components/module/f-navbar/f-navbar'; | 169 | import fNavbar from '@/components/module/f-navbar/f-navbar'; |
@@ -209,16 +211,24 @@ export default { | @@ -209,16 +211,24 @@ export default { | ||
209 | }, | 211 | }, |
210 | methods: { | 212 | methods: { |
211 | ...mapMutations(['emptyUserInfo']), | 213 | ...mapMutations(['emptyUserInfo']), |
212 | - openSysNotify() { | ||
213 | - uni.navigateTo({ | ||
214 | - url: '../systemNotify/systemNotify' | ||
215 | - }); | ||
216 | - }, | ||
217 | - openFeedBack() { | ||
218 | - uni.navigateTo({ | ||
219 | - url: '../feedback/feedback' | 214 | + // 跳转前判断登录 |
215 | + onTokenJump(url) { | ||
216 | + this.judgeLogin(() => { | ||
217 | + uni.navigateTo({ | ||
218 | + url: url | ||
219 | + }); | ||
220 | }); | 220 | }); |
221 | }, | 221 | }, |
222 | + // openSysNotify() { | ||
223 | + // uni.navigateTo({ | ||
224 | + // url: '../systemNotify/systemNotify' | ||
225 | + // }); | ||
226 | + // }, | ||
227 | + // openFeedBack() { | ||
228 | + // uni.navigateTo({ | ||
229 | + // url: '../feedback/feedback' | ||
230 | + // }); | ||
231 | + // }, | ||
222 | onJump(url) { | 232 | onJump(url) { |
223 | uni.navigateTo({ | 233 | uni.navigateTo({ |
224 | url: url | 234 | url: url |
@@ -230,8 +240,11 @@ export default { | @@ -230,8 +240,11 @@ export default { | ||
230 | }); | 240 | }); |
231 | }, | 241 | }, |
232 | openPersonalInfo() { | 242 | openPersonalInfo() { |
243 | + let obj = { | ||
244 | + data: this.userInfo | ||
245 | + }; | ||
233 | uni.navigateTo({ | 246 | uni.navigateTo({ |
234 | - url: './set' | 247 | + url: './set?data=' + JSON.stringify(obj) |
235 | }); | 248 | }); |
236 | }, | 249 | }, |
237 | clickAccountFunc() { | 250 | clickAccountFunc() { |
@@ -305,11 +318,11 @@ export default { | @@ -305,11 +318,11 @@ export default { | ||
305 | success(res) { | 318 | success(res) { |
306 | if (res.confirm) { | 319 | if (res.confirm) { |
307 | that.emptyUserInfo(); | 320 | that.emptyUserInfo(); |
308 | - that.showLogout=false | 321 | + that.showLogout = false; |
309 | setTimeout(() => { | 322 | setTimeout(() => { |
310 | uni.navigateTo({ | 323 | uni.navigateTo({ |
311 | - url:'./login' | ||
312 | - }) | 324 | + url: './login' |
325 | + }); | ||
313 | }, 500); | 326 | }, 500); |
314 | } else if (res.cancel) { | 327 | } else if (res.cancel) { |
315 | } | 328 | } |
@@ -413,8 +426,8 @@ export default { | @@ -413,8 +426,8 @@ export default { | ||
413 | } | 426 | } |
414 | 427 | ||
415 | .loginPhone { | 428 | .loginPhone { |
416 | - width: 750rpx; | ||
417 | - padding: 0rpx 10rpx; | 429 | + // width: 750rpx; |
430 | + // padding: 0rpx 10rpx; | ||
418 | 431 | ||
419 | .form-row { | 432 | .form-row { |
420 | position: relative; | 433 | position: relative; |
@@ -6,20 +6,20 @@ | @@ -6,20 +6,20 @@ | ||
6 | class="u-flex" | 6 | class="u-flex" |
7 | style="border-radius: 20px;margin-top: 37rpx;padding-left: 15rpx;;justify-content: space-between;width: 690rpx;height: 200rpx;background-color: #FFFFFF;" | 7 | style="border-radius: 20px;margin-top: 37rpx;padding-left: 15rpx;;justify-content: space-between;width: 690rpx;height: 200rpx;background-color: #FFFFFF;" |
8 | > | 8 | > |
9 | - <view style=""><image style="width: 130rpx;height: 130rpx;" src="../../static/avatar-test.png" mode=""></image></view> | 9 | + <view style=""><image style="border-radius: 50px;width: 130rpx;height: 130rpx;" :src="avatar" mode=""></image></view> |
10 | <view style="margin-right: 40rpx;"><image style="width: 13rpx;height: 17rpx;" src="../../static/arrow-right.png" mode=""></image></view> | 10 | <view style="margin-right: 40rpx;"><image style="width: 13rpx;height: 17rpx;" src="../../static/arrow-right.png" mode=""></image></view> |
11 | </view> | 11 | </view> |
12 | <view class="u-m-t-20"><text style="color:#8f9ca2;font-size: 14px;">基本资料</text></view> | 12 | <view class="u-m-t-20"><text style="color:#8f9ca2;font-size: 14px;">基本资料</text></view> |
13 | <view style="background-color: #FFFFFF;border-radius: 20px;margin-top: 20rpx;padding-left: 15rpx;"> | 13 | <view style="background-color: #FFFFFF;border-radius: 20px;margin-top: 20rpx;padding-left: 15rpx;"> |
14 | <u--form labelPosition="left" :model="myInfoModel" :rules="rules" ref="myInfoFormRef"> | 14 | <u--form labelPosition="left" :model="myInfoModel" :rules="rules" ref="myInfoFormRef"> |
15 | - <u-form-item labelWidth="80px" label="真实姓名" prop="userInfo.name" borderBottom ref="item1"> | ||
16 | - <u--input placeholder="请输入真实姓名" v-model="myInfoModel.userInfo.name" border="none"></u--input> | 15 | + <u-form-item labelWidth="80px" label="真实姓名" prop="userInfo.realName" borderBottom ref="item1"> |
16 | + <u--input placeholder="请输入真实姓名" v-model="myInfoModel.userInfo.realName" border="none"></u--input> | ||
17 | </u-form-item> | 17 | </u-form-item> |
18 | - <u-form-item labelWidth="80px" label="手机号码" prop="userInfo.phone" borderBottom ref="item1"> | ||
19 | - <u--input placeholder="请输入手机号码" v-model="myInfoModel.userInfo.phone" border="none"></u--input> | 18 | + <u-form-item labelWidth="80px" label="手机号码" prop="userInfo.phoneNumber" borderBottom ref="item1"> |
19 | + <u--input placeholder="请输入手机号码" v-model="myInfoModel.userInfo.phoneNumber" border="none"></u--input> | ||
20 | </u-form-item> | 20 | </u-form-item> |
21 | - <u-form-item labelWidth="80px" label="用户账号 " prop="userInfo.account" borderBottom ref="item1"> | ||
22 | - <u--input placeholder="请输入用户账号 " v-model="myInfoModel.userInfo.account" border="none"></u--input> | 21 | + <u-form-item labelWidth="80px" label="用户账号 " prop="userInfo.username" borderBottom ref="item1"> |
22 | + <u--input placeholder="请输入用户账号 " v-model="myInfoModel.userInfo.username" border="none"></u--input> | ||
23 | </u-form-item> | 23 | </u-form-item> |
24 | <u-form-item labelWidth="80px" label="邮箱地址" prop="userInfo.email" borderBottom ref="item1"> | 24 | <u-form-item labelWidth="80px" label="邮箱地址" prop="userInfo.email" borderBottom ref="item1"> |
25 | <u--input placeholder="请输入邮箱地址" v-model="myInfoModel.userInfo.email" border="none"></u--input> | 25 | <u--input placeholder="请输入邮箱地址" v-model="myInfoModel.userInfo.email" border="none"></u--input> |
@@ -31,11 +31,11 @@ | @@ -31,11 +31,11 @@ | ||
31 | " | 31 | " |
32 | labelWidth="80px" | 32 | labelWidth="80px" |
33 | label="有效期" | 33 | label="有效期" |
34 | - prop="userInfo.dateVal" | 34 | + prop="userInfo.accountExpireTime" |
35 | borderBottom | 35 | borderBottom |
36 | ref="item1" | 36 | ref="item1" |
37 | > | 37 | > |
38 | - <u--input v-model="myInfoModel.userInfo.dateVal" placeholder="请选择有效期" border="none"></u--input> | 38 | + <u--input v-model="myInfoModel.userInfo.accountExpireTime" placeholder="请选择有效期" border="none"></u--input> |
39 | <u-datetime-picker | 39 | <u-datetime-picker |
40 | :formatter="formatter" | 40 | :formatter="formatter" |
41 | :show="showDate" | 41 | :show="showDate" |
@@ -63,28 +63,121 @@ export default { | @@ -63,28 +63,121 @@ export default { | ||
63 | PrimaryColor: '#0079fe', //主题色 | 63 | PrimaryColor: '#0079fe', //主题色 |
64 | myInfoModel: { | 64 | myInfoModel: { |
65 | userInfo: { | 65 | userInfo: { |
66 | - name: '', | ||
67 | - phone: '', | ||
68 | - account: 'test9527', | 66 | + realName: '', |
67 | + phoneNumber: '', | ||
68 | + username: '', | ||
69 | email: '', | 69 | email: '', |
70 | - dateVal: '' | 70 | + accountExpireTime: '' |
71 | } | 71 | } |
72 | }, | 72 | }, |
73 | showDate: false, | 73 | showDate: false, |
74 | - dateTime: Number(new Date()) | 74 | + dateTime: Number(new Date()), |
75 | + avatar: '', | ||
76 | + id: '', | ||
77 | + rules: { | ||
78 | + 'userInfo.realName': [ | ||
79 | + { | ||
80 | + type: 'string', | ||
81 | + required: true, | ||
82 | + message: '请填写姓名', | ||
83 | + trigger: ['blur', 'change'] | ||
84 | + }, | ||
85 | + { | ||
86 | + validator: (rule, value, callback) => { | ||
87 | + return uni.$u.test.chinese(value); | ||
88 | + }, | ||
89 | + message: '姓名必须为中文', | ||
90 | + trigger: ['change', 'blur'] | ||
91 | + } | ||
92 | + ], | ||
93 | + 'userInfo.phoneNumber': [ | ||
94 | + { | ||
95 | + type: 'string', | ||
96 | + required: true, | ||
97 | + message: '请填写手机号码', | ||
98 | + trigger: ['blur', 'change'] | ||
99 | + }, | ||
100 | + { | ||
101 | + // 此为同步验证,可以直接返回true或者false,如果是异步验证,稍微不同,见下方说明 | ||
102 | + validator: (rule, value, callback) => { | ||
103 | + return uni.$u.test.mobile(value); | ||
104 | + }, | ||
105 | + message: '手机必须为数字', | ||
106 | + trigger: ['change', 'blur'] | ||
107 | + } | ||
108 | + ], | ||
109 | + 'userInfo.email': [ | ||
110 | + { | ||
111 | + type: 'string', | ||
112 | + required: true, | ||
113 | + message: '请填写邮箱', | ||
114 | + trigger: ['blur', 'change'] | ||
115 | + }, | ||
116 | + { | ||
117 | + // 此为同步验证,可以直接返回true或者false,如果是异步验证,稍微不同,见下方说明 | ||
118 | + validator: (rule, value, callback) => { | ||
119 | + return uni.$u.test.email(value); | ||
120 | + }, | ||
121 | + message: '邮箱必须带有@', | ||
122 | + trigger: ['change', 'blur'] | ||
123 | + } | ||
124 | + ] | ||
125 | + } | ||
75 | }; | 126 | }; |
76 | }, | 127 | }, |
128 | + onLoad(e) { | ||
129 | + if (e.data !== null) { | ||
130 | + let params = JSON.parse(e.data); | ||
131 | + this.myInfoModel.userInfo.realName = params.data.realName; | ||
132 | + this.myInfoModel.userInfo.phoneNumber = params.data.phoneNumber; | ||
133 | + this.myInfoModel.userInfo.username = params.data.username; | ||
134 | + this.myInfoModel.userInfo.email = params.data.email; | ||
135 | + this.myInfoModel.userInfo.accountExpireTime = params.data.accountExpireTime; | ||
136 | + this.avatar = params.data.avatar == undefined ? '../../static/avatar-test.png' : params.data.avatar; | ||
137 | + this.id = params.data.userId; | ||
138 | + } | ||
139 | + }, | ||
77 | methods: { | 140 | methods: { |
78 | onSubmitFunc() { | 141 | onSubmitFunc() { |
79 | - console.log('确认'); | ||
80 | - console.log(this.myInfoModel.userInfo); | 142 | + this.$refs.myInfoFormRef |
143 | + .validate() | ||
144 | + .then(res => { | ||
145 | + let httpData = { | ||
146 | + avatar: this.avatar, | ||
147 | + email: this.myInfoModel.userInfo.email, | ||
148 | + id: this.id, | ||
149 | + phoneNumber: this.myInfoModel.userInfo.phoneNumber, | ||
150 | + realName: this.myInfoModel.userInfo.realName | ||
151 | + }; | ||
152 | + uni.$u.http | ||
153 | + .put('/yt/user/center', httpData) | ||
154 | + .then(res => { | ||
155 | + if (res) { | ||
156 | + uni.showToast({ | ||
157 | + title: '更新个人资料成功~', | ||
158 | + icon: 'none' | ||
159 | + }); | ||
160 | + setTimeout(() => { | ||
161 | + uni.navigateBack({ | ||
162 | + delta: 1 | ||
163 | + }); | ||
164 | + }, 500); | ||
165 | + } | ||
166 | + }) | ||
167 | + .catch(e => { | ||
168 | + uni.$u.toast(e.data.message); | ||
169 | + }); | ||
170 | + }) | ||
171 | + .catch(errors => { | ||
172 | + uni.$u.toast('校验失败'); | ||
173 | + }); | ||
81 | }, | 174 | }, |
82 | dateClose() { | 175 | dateClose() { |
83 | this.showDate = false; | 176 | this.showDate = false; |
84 | }, | 177 | }, |
85 | dateConfirm(e) { | 178 | dateConfirm(e) { |
86 | this.showDate = false; | 179 | this.showDate = false; |
87 | - this.myInfoModel.userInfo.dateVal = uni.$u.timeFormat(e.value, 'yyyy-mm-dd hh:MM:ss'); | 180 | + this.myInfoModel.userInfo.accountExpireTime = uni.$u.timeFormat(e.value, 'yyyy-mm-dd hh:MM:ss'); |
88 | }, | 181 | }, |
89 | //格式化日期 | 182 | //格式化日期 |
90 | formatter(type, value) { | 183 | formatter(type, value) { |
pages/personal/test.vue
deleted
100644 → 0
1 | -<template> | ||
2 | - <view class="u-page"> | ||
3 | - <view class="u-demo-block"> | ||
4 | - <text class="u-demo-block__title">基础使用</text> | ||
5 | - <view class="u-demo-block__content"> | ||
6 | - <u--input | ||
7 | - placeholder="请输入内容" | ||
8 | - border="surround" | ||
9 | - v-model="value" | ||
10 | - @change="change" | ||
11 | - ></u--input> | ||
12 | - </view> | ||
13 | - </view> | ||
14 | - <view class="u-demo-block"> | ||
15 | - <text class="u-demo-block__title">可清空内容</text> | ||
16 | - <view class="u-demo-block__content"> | ||
17 | - <u--input | ||
18 | - placeholder="请输入内容" | ||
19 | - border="surround" | ||
20 | - clearable | ||
21 | - ></u--input> | ||
22 | - </view> | ||
23 | - </view> | ||
24 | - <view class="u-demo-block"> | ||
25 | - <text class="u-demo-block__title">数字键盘</text> | ||
26 | - <view class="u-demo-block__content"> | ||
27 | - <u--input | ||
28 | - placeholder="请输入内容" | ||
29 | - border="surround" | ||
30 | - type="number" | ||
31 | - clearable | ||
32 | - ></u--input> | ||
33 | - </view> | ||
34 | - </view> | ||
35 | - <view class="u-demo-block"> | ||
36 | - <text class="u-demo-block__title">密码类型</text> | ||
37 | - <view class="u-demo-block__content"> | ||
38 | - <u--input | ||
39 | - placeholder="请输入内容" | ||
40 | - border="surround" | ||
41 | - password | ||
42 | - clearable | ||
43 | - ></u--input> | ||
44 | - </view> | ||
45 | - </view> | ||
46 | - <view class="u-demo-block"> | ||
47 | - <text class="u-demo-block__title">显示下划线</text> | ||
48 | - <view class="u-demo-block__content"> | ||
49 | - <u--input | ||
50 | - placeholder="请输入内容" | ||
51 | - border="bottom" | ||
52 | - clearable | ||
53 | - ></u--input> | ||
54 | - </view> | ||
55 | - </view> | ||
56 | - <view class="u-demo-block"> | ||
57 | - <text class="u-demo-block__title">禁用状态</text> | ||
58 | - <view class="u-demo-block__content"> | ||
59 | - <u--input | ||
60 | - placeholder="禁用状态" | ||
61 | - border="surround" | ||
62 | - disabled | ||
63 | - ></u--input> | ||
64 | - </view> | ||
65 | - </view> | ||
66 | - <view class="u-demo-block"> | ||
67 | - <text class="u-demo-block__title">圆形</text> | ||
68 | - <view class="u-demo-block__content"> | ||
69 | - <u--input | ||
70 | - placeholder="请输入内容" | ||
71 | - border="surround" | ||
72 | - shape="circle" | ||
73 | - ></u--input> | ||
74 | - </view> | ||
75 | - </view> | ||
76 | - <view class="u-demo-block"> | ||
77 | - <text class="u-demo-block__title">前后图标</text> | ||
78 | - <view class="u-demo-block__content"> | ||
79 | - <u--input | ||
80 | - placeholder="前置图标" | ||
81 | - prefixIcon="search" | ||
82 | - prefixIconStyle="font-size: 22px;color: #909399" | ||
83 | - ></u--input> | ||
84 | - </view> | ||
85 | - <view | ||
86 | - class="u-demo-block__content" | ||
87 | - style="margin-top: 15px;" | ||
88 | - > | ||
89 | - <u--input | ||
90 | - placeholder="后置图标" | ||
91 | - suffixIcon="map-fill" | ||
92 | - suffixIconStyle="color: #909399" | ||
93 | - ></u--input> | ||
94 | - </view> | ||
95 | - </view> | ||
96 | - <view class="u-demo-block"> | ||
97 | - <text class="u-demo-block__title">前后插槽</text> | ||
98 | - <view class="u-demo-block__content"> | ||
99 | - <!-- 注意:由于兼容性差异,如果需要使用前后插槽,nvue下需使用u--input,非nvue下需使用u-input --> | ||
100 | - <!-- #ifndef APP-NVUE --> | ||
101 | - <u-input placeholder="前置插槽"> | ||
102 | - <!-- #endif --> | ||
103 | - <!-- #ifdef APP-NVUE --> | ||
104 | - <u--input placeholder="前置插槽"> | ||
105 | - <!-- #endif --> | ||
106 | - <u--text | ||
107 | - text="http://" | ||
108 | - slot="prefix" | ||
109 | - margin="0 3px 0 0" | ||
110 | - type="tips" | ||
111 | - ></u--text> | ||
112 | - <!-- #ifndef APP-NVUE --> | ||
113 | - </u-input> | ||
114 | - <!-- #endif --> | ||
115 | - <!-- #ifdef APP-NVUE --> | ||
116 | - </u--input> | ||
117 | - <!-- #endif --> | ||
118 | - </view> | ||
119 | - <view | ||
120 | - class="u-demo-block__content" | ||
121 | - style="margin-top: 15px;" | ||
122 | - > | ||
123 | - <!-- 注意:由于兼容性差异,如果需要使用前后插槽,nvue下需使用u--input,非nvue下需使用u-input --> | ||
124 | - <!-- #ifndef APP-NVUE --> | ||
125 | - <u-input placeholder="后置插槽"> | ||
126 | - <!-- #endif --> | ||
127 | - <!-- #ifdef APP-NVUE --> | ||
128 | - <u--input placeholder="后置插槽"> | ||
129 | - <!-- #endif --> | ||
130 | - <template slot="suffix"> | ||
131 | - <u-code | ||
132 | - ref="uCode" | ||
133 | - @change="codeChange" | ||
134 | - seconds="20" | ||
135 | - changeText="X秒重新获取哈哈哈" | ||
136 | - ></u-code> | ||
137 | - <u-button | ||
138 | - @tap="getCode" | ||
139 | - :text="tips" | ||
140 | - type="success" | ||
141 | - size="mini" | ||
142 | - ></u-button> | ||
143 | - </template> | ||
144 | - <!-- #ifndef APP-NVUE --> | ||
145 | - </u-input> | ||
146 | - <!-- #endif --> | ||
147 | - <!-- #ifdef APP-NVUE --> | ||
148 | - </u--input> | ||
149 | - <!-- #endif --> | ||
150 | - </view> | ||
151 | - </view> | ||
152 | - <u-gap | ||
153 | - bgColor="#fff" | ||
154 | - height="50" | ||
155 | - ></u-gap> | ||
156 | - </view> | ||
157 | -</template> | ||
158 | - | ||
159 | -<script> | ||
160 | - export default { | ||
161 | - data() { | ||
162 | - return { | ||
163 | - tips: '', | ||
164 | - value: '' | ||
165 | - } | ||
166 | - }, | ||
167 | - watch: { | ||
168 | - value(newValue, oldValue) { | ||
169 | - // console.log('v-model', newValue); | ||
170 | - } | ||
171 | - }, | ||
172 | - methods: { | ||
173 | - codeChange(text) { | ||
174 | - this.tips = text; | ||
175 | - }, | ||
176 | - getCode() { | ||
177 | - if (this.$refs.uCode.canGetCode) { | ||
178 | - // 模拟向后端请求验证码 | ||
179 | - uni.showLoading({ | ||
180 | - title: '正在获取验证码' | ||
181 | - }) | ||
182 | - setTimeout(() => { | ||
183 | - uni.hideLoading(); | ||
184 | - // 这里此提示会被this.start()方法中的提示覆盖 | ||
185 | - uni.$u.toast('验证码已发送'); | ||
186 | - // 通知验证码组件内部开始倒计时 | ||
187 | - this.$refs.uCode.start(); | ||
188 | - }, 2000); | ||
189 | - } else { | ||
190 | - uni.$u.toast('倒计时结束后再发送'); | ||
191 | - } | ||
192 | - }, | ||
193 | - change(e) { | ||
194 | - console.log('change', e); | ||
195 | - } | ||
196 | - } | ||
197 | - } | ||
198 | -</script> | ||
199 | - | ||
200 | -<style lang="scss"> | ||
201 | - | ||
202 | -</style> |
@@ -3,16 +3,20 @@ | @@ -3,16 +3,20 @@ | ||
3 | <!-- 公共组件-每个页面必须引入 --> | 3 | <!-- 公共组件-每个页面必须引入 --> |
4 | <public-module></public-module> | 4 | <public-module></public-module> |
5 | <view> | 5 | <view> |
6 | - <view class="u-flex" style="margin-top: 10rpx;justify-content: center;"><text>今天晚上开会</text></view> | 6 | + <view class="u-flex" style="margin-top: 10rpx;justify-content: center;"> |
7 | + <text style="color: #2E384D;font-size: 18px;">{{ notifyList.receiverName }}</text> | ||
8 | + </view> | ||
7 | <view style="border-radius: 20px;;margin-top: 20rpx;width: 696rpx;height: 1000rpx;background-color: #FFFFFF;"> | 9 | <view style="border-radius: 20px;;margin-top: 20rpx;width: 696rpx;height: 1000rpx;background-color: #FFFFFF;"> |
8 | <u-list height="140rpx"> | 10 | <u-list height="140rpx"> |
9 | - <u-list-item v-for="(item, index) in notifyList" :key="index"> | ||
10 | - <u-cell @click="clickNotifyDetail(item.id)" :value="`${item.time}`" :title="`${item.name}`"> | ||
11 | - <u-avatar slot="icon" shape="circle" size="35" :src="item.imageUrl"></u-avatar> | 11 | + <u-list-item> |
12 | + <u-cell :value="`${notifyList.createTime}`" :title="`${notifyList.receiverName}`"> | ||
13 | + <u-avatar slot="icon" shape="circle" size="35" :src="1111"></u-avatar> | ||
12 | </u-cell> | 14 | </u-cell> |
13 | </u-list-item> | 15 | </u-list-item> |
14 | </u-list> | 16 | </u-list> |
15 | - <view class=""><text>内容</text></view> | 17 | + <view class=""> |
18 | + <text style="color: #2E384D;font-size: 15px;">{{ notifyList.receiverName }}</text> | ||
19 | + </view> | ||
16 | </view> | 20 | </view> |
17 | </view> | 21 | </view> |
18 | <f-tabbar></f-tabbar> | 22 | <f-tabbar></f-tabbar> |
@@ -28,21 +32,30 @@ export default { | @@ -28,21 +32,30 @@ export default { | ||
28 | }, | 32 | }, |
29 | data() { | 33 | data() { |
30 | return { | 34 | return { |
31 | - notifyList: [ | ||
32 | - { | ||
33 | - id: '1', | ||
34 | - name: '系统管理员', | ||
35 | - imageUrl: 'https://cdn.uviewui.com/uview/album/1.jpg', | ||
36 | - time: '2022-04-12' | ||
37 | - } | ||
38 | - ] | 35 | + notifyList: {} |
39 | }; | 36 | }; |
40 | }, | 37 | }, |
41 | onLoad(e) { | 38 | onLoad(e) { |
42 | // 隐藏原生的tabbar | 39 | // 隐藏原生的tabbar |
43 | uni.hideTabBar(); | 40 | uni.hideTabBar(); |
44 | - const item = e.item; | ||
45 | - console.log(item); | 41 | + if (e.data !== null) { |
42 | + let params = e.data; | ||
43 | + this.loadData(params); | ||
44 | + } | ||
45 | + }, | ||
46 | + methods: { | ||
47 | + loadData(e) { | ||
48 | + uni.$u.http | ||
49 | + .get(`/yt/noticeUser/${e}`) | ||
50 | + .then(res => { | ||
51 | + if (res) { | ||
52 | + this.notifyList = res; | ||
53 | + } | ||
54 | + }) | ||
55 | + .catch(e => { | ||
56 | + uni.$u.toast(e.data.message); | ||
57 | + }); | ||
58 | + } | ||
46 | } | 59 | } |
47 | }; | 60 | }; |
48 | </script> | 61 | </script> |
@@ -2,14 +2,47 @@ | @@ -2,14 +2,47 @@ | ||
2 | <view class="notify-page"> | 2 | <view class="notify-page"> |
3 | <!-- 公共组件-每个页面必须引入 --> | 3 | <!-- 公共组件-每个页面必须引入 --> |
4 | <public-module></public-module> | 4 | <public-module></public-module> |
5 | + <view style=""> | ||
6 | + <u--form labelPosition="left" :model="model1" :rules="rules" ref="form1"> | ||
7 | + <u-form-item | ||
8 | + label="类型" | ||
9 | + prop="userInfo.sex" | ||
10 | + borderBottom | ||
11 | + @click=" | ||
12 | + showType = true; | ||
13 | + hideKeyboard(); | ||
14 | + " | ||
15 | + ref="item1" | ||
16 | + > | ||
17 | + <u--input v-model="model1.userInfo.type" placeholder="请选择类型" border="none"></u--input> | ||
18 | + <u-icon slot="right" name="arrow-right"></u-icon> | ||
19 | + </u-form-item> | ||
20 | + </u--form> | ||
21 | + <u-action-sheet :show="showType" :actions="actions" title="请选择类型" @close="showType = false" @select="typeSelect"></u-action-sheet> | ||
22 | + </view> | ||
5 | <view> | 23 | <view> |
6 | - <u-list @scrolltolower="scrolltolower"> | ||
7 | - <u-list-item style="margin-top: 20rpx;background: #FFFFFF;width: 695rpx;border-radius: 20px;" v-for="(item, index) in notifyList" :key="index"> | ||
8 | - <u-cell :border="false" @click="clickNotifyDetail(item.id)" isLink :value="`${item.time}`" :title="`${item.name}`"> | ||
9 | - <u-avatar slot="icon" shape="circle" size="35" :src="item.imageUrl"></u-avatar> | ||
10 | - </u-cell> | ||
11 | - </u-list-item> | ||
12 | - </u-list> | 24 | + <mescroll-body ref="mescrollRef" @init="mescrollInit" :down="downOption" @down="downCallback" @up="upCallback"> |
25 | + <view class="u-flex" style="flex-direction: column;margin-left: -22rpx;"> | ||
26 | + <view | ||
27 | + @click="clickNotifyDetail(item.id)" | ||
28 | + class="u-flex" | ||
29 | + v-for="(item, index) in list" | ||
30 | + :key="index" | ||
31 | + style="justify-content: space-between;flex-direction: row;margin: 15rpx;width: 700rpx;height:136rpx;background: #FFFFFF;border-radius: 20px;" | ||
32 | + > | ||
33 | + <view class="u-flex" style="justify-content: space-between;flex-direction: row;"> | ||
34 | + <view style="margin-left: 30rpx;"><u-avatar style="margin-left: 30rpx;" shape="circle" size="40" :src="item.avatar"></u-avatar></view> | ||
35 | + <view class="u-flex" style="margin-left: 30rpx;text-align: left;justify-content: space-between;flex-direction: column;"> | ||
36 | + <text style="width:400rpx;color:#2E384D;font-size: 15px;">{{ item.title }}</text> | ||
37 | + <text style="width:400rpx;color:#999999;font-size: 13px;">{{ item.createTime }}</text> | ||
38 | + </view> | ||
39 | + </view> | ||
40 | + <view class=""> | ||
41 | + <text style="margin-right: 30rpx;color:#999999;font-size: 13px;">{{ item.type == 'OTHER' ? '其他' : item.type == 'MEETING' ? '会议' : '公告' }}</text> | ||
42 | + </view> | ||
43 | + </view> | ||
44 | + </view> | ||
45 | + </mescroll-body> | ||
13 | </view> | 46 | </view> |
14 | <f-tabbar></f-tabbar> | 47 | <f-tabbar></f-tabbar> |
15 | </view> | 48 | </view> |
@@ -17,79 +50,107 @@ | @@ -17,79 +50,107 @@ | ||
17 | 50 | ||
18 | <script> | 51 | <script> |
19 | import fTabbar from '@/components/module/f-tabbar/f-tabbar'; | 52 | import fTabbar from '@/components/module/f-tabbar/f-tabbar'; |
53 | +import MescrollMixin from '@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js'; | ||
20 | 54 | ||
21 | export default { | 55 | export default { |
56 | + mixins: [MescrollMixin], // 使用mixin (在main.js注册全局组件) | ||
22 | components: { | 57 | components: { |
23 | fTabbar | 58 | fTabbar |
24 | }, | 59 | }, |
25 | data() { | 60 | data() { |
26 | return { | 61 | return { |
27 | - notifyList: [ | ||
28 | - { | ||
29 | - id: '1', | ||
30 | - name: '今天晚上会议室开会', | ||
31 | - imageUrl: 'https://cdn.uviewui.com/uview/album/1.jpg', | ||
32 | - time: '2022-04-12' | ||
33 | - }, | ||
34 | - { | ||
35 | - id: '2', | ||
36 | - name: '今天晚上会议室开会', | ||
37 | - imageUrl: 'https://cdn.uviewui.com/uview/album/1.jpg', | ||
38 | - time: '2022-04-12' | ||
39 | - }, | ||
40 | - { | ||
41 | - id: '3', | ||
42 | - name: '今天晚上会议室开会', | ||
43 | - imageUrl: 'https://cdn.uviewui.com/uview/album/1.jpg', | ||
44 | - time: '2022-04-12' | ||
45 | - }, | ||
46 | - { | ||
47 | - id: 'eww', | ||
48 | - name: '今天晚上会议室开会', | ||
49 | - imageUrl: 'https://cdn.uviewui.com/uview/album/1.jpg', | ||
50 | - time: '2022-04-12' | ||
51 | - }, | ||
52 | - { | ||
53 | - id: '4', | ||
54 | - name: '今天晚上会议室开会', | ||
55 | - imageUrl: 'https://cdn.uviewui.com/uview/album/1.jpg', | ||
56 | - time: '2022-04-12' | ||
57 | - }, | 62 | + model1: { |
63 | + userInfo: { | ||
64 | + type: '' | ||
65 | + } | ||
66 | + }, | ||
67 | + showType: false, | ||
68 | + actions: [ | ||
58 | { | 69 | { |
59 | - id: '1', | ||
60 | - name: '今天晚上会议室开会', | ||
61 | - imageUrl: 'https://cdn.uviewui.com/uview/album/1.jpg', | ||
62 | - time: '2022-04-12' | 70 | + name: '会议', |
71 | + value: 'MEETING' | ||
63 | }, | 72 | }, |
64 | { | 73 | { |
65 | - id: '5', | ||
66 | - name: '今天晚上会议室开会', | ||
67 | - imageUrl: 'https://cdn.uviewui.com/uview/album/1.jpg', | ||
68 | - time: '2022-04-12' | 74 | + name: '公告', |
75 | + value: 'NOTICE' | ||
69 | }, | 76 | }, |
70 | { | 77 | { |
71 | - id: '6', | ||
72 | - name: '今天晚上会议室开会', | ||
73 | - imageUrl: 'https://cdn.uviewui.com/uview/album/1.jpg', | ||
74 | - time: '2022-04-12' | 78 | + name: '其他', |
79 | + value: 'OTHER' | ||
75 | } | 80 | } |
76 | - ] | 81 | + ], |
82 | + page: { | ||
83 | + num: 0, | ||
84 | + size: 10 | ||
85 | + }, | ||
86 | + downOption: { | ||
87 | + auto: false //是否在初始化后,自动执行downCallback; 默认true | ||
88 | + }, | ||
89 | + list: [] | ||
77 | }; | 90 | }; |
78 | }, | 91 | }, |
79 | - onLoad() { | 92 | + onLoad(e) { |
80 | // 隐藏原生的tabbar | 93 | // 隐藏原生的tabbar |
81 | uni.hideTabBar(); | 94 | uni.hideTabBar(); |
82 | - this.loadmore(); | ||
83 | }, | 95 | }, |
84 | methods: { | 96 | methods: { |
85 | - scrolltolower() { | ||
86 | - this.loadmore(); | 97 | + typeSelect(e) { |
98 | + this.model1.userInfo.type = e.name; | ||
99 | + this.loadData(1, e.value); | ||
100 | + setTimeout(() => { | ||
101 | + uni.hideKeyboard(); | ||
102 | + }, 10); | ||
103 | + }, | ||
104 | + hideKeyboard() { | ||
105 | + uni.hideKeyboard(); | ||
106 | + }, | ||
107 | + /*下拉刷新的回调 */ | ||
108 | + downCallback() { | ||
109 | + //联网加载数据 | ||
110 | + this.list.length = 0; | ||
111 | + this.page.num = 1; | ||
112 | + this.loadData(1); | ||
113 | + }, | ||
114 | + /*上拉加载的回调: 其中page.num:当前页 从1开始, page.size:每页数据条数,默认10 */ | ||
115 | + upCallback() { | ||
116 | + //联网加载数据 | ||
117 | + this.page.num += 1; | ||
118 | + this.loadData(this.page.num); | ||
119 | + }, | ||
120 | + | ||
121 | + loadData(pageNo, t) { | ||
122 | + let httpData = { | ||
123 | + page: pageNo, | ||
124 | + pageSize: 10, | ||
125 | + type: t | ||
126 | + }; | ||
127 | + uni.$u.http | ||
128 | + .get('/yt/noticeUser/page', { params: httpData, custom: { load: false } }) | ||
129 | + .then(res => { | ||
130 | + uni.stopPullDownRefresh(); | ||
131 | + this.mescroll.endByPage(res.items.length, res.total); | ||
132 | + if (pageNo == 1) { | ||
133 | + this.list = res.items.map(m => { | ||
134 | + return { | ||
135 | + title: m?.sysNotice?.title, | ||
136 | + avatar: m?.sysNotice?.avatar, | ||
137 | + id: m?.sysNotice?.id, | ||
138 | + createTime: m?.createTime | ||
139 | + }; | ||
140 | + }); | ||
141 | + } else { | ||
142 | + this.list = this.list.concat(res.items); | ||
143 | + } | ||
144 | + }) | ||
145 | + .catch(e => { | ||
146 | + uni.$u.toast(e.data.message); | ||
147 | + this.mescroll.endErr(); | ||
148 | + }); | ||
87 | }, | 149 | }, |
88 | - loadmore() {}, | ||
89 | clickNotifyDetail(e) { | 150 | clickNotifyDetail(e) { |
90 | - console.log(e); | 151 | + let obj = e; |
91 | uni.navigateTo({ | 152 | uni.navigateTo({ |
92 | - url: './notifyDetail?item' + e | 153 | + url: './notifyDetail?data=' + obj |
93 | }); | 154 | }); |
94 | } | 155 | } |
95 | } | 156 | } |
static/alert-detail.png
0 → 100644
107 Bytes
static/alert-un.png
0 → 100644
1.89 KB
static/alert-yes.png
0 → 100644
1.44 KB
static/device-un.png
0 → 100644
1.26 KB
static/device-yes.png
0 → 100644
976 Bytes
static/home-yes.png
0 → 100644
956 Bytes
static/homw-un.png
0 → 100644
1.4 KB
static/my-un.png
0 → 100644
1.78 KB
static/my-yes.png
0 → 100644
1.14 KB
@@ -10,12 +10,9 @@ export const mutations = { | @@ -10,12 +10,9 @@ export const mutations = { | ||
10 | // #ifdef H5 | 10 | // #ifdef H5 |
11 | window.sessionStorage.setItem('userInfo', JSON.stringify(state.userInfo)); | 11 | window.sessionStorage.setItem('userInfo', JSON.stringify(state.userInfo)); |
12 | // #endif | 12 | // #endif |
13 | - // #ifndef MP | 13 | + // #ifndef H5 |
14 | uni.setStorageSync('userInfo', state.userInfo); | 14 | uni.setStorageSync('userInfo', state.userInfo); |
15 | // #endif | 15 | // #endif |
16 | - //#ifdef MP | ||
17 | - wx.setStorageSync('userInfo', state.userInfo); | ||
18 | - //#endif | ||
19 | } | 16 | } |
20 | }, | 17 | }, |
21 | // 退出APP | 18 | // 退出APP |
@@ -24,12 +21,9 @@ export const mutations = { | @@ -24,12 +21,9 @@ export const mutations = { | ||
24 | // #ifdef H5 | 21 | // #ifdef H5 |
25 | window.sessionStorage.removeItem("userInfo"); | 22 | window.sessionStorage.removeItem("userInfo"); |
26 | // #endif | 23 | // #endif |
27 | - // #ifndef MP | 24 | + // #ifndef H5 |
28 | uni.removeStorageSync("userInfo"); | 25 | uni.removeStorageSync("userInfo"); |
29 | // #endif | 26 | // #endif |
30 | - // #ifdef MP | ||
31 | - wx.removeStorageSync("userInfo"); | ||
32 | - // #endif | ||
33 | }, | 27 | }, |
34 | }; | 28 | }; |
35 | export const actions = { | 29 | export const actions = { |
@@ -27,7 +27,7 @@ const GlobalOption = { | @@ -27,7 +27,7 @@ const GlobalOption = { | ||
27 | zh: { | 27 | zh: { |
28 | up: { | 28 | up: { |
29 | textLoading: '加载中 ...', // 加载中的提示文本 | 29 | textLoading: '加载中 ...', // 加载中的提示文本 |
30 | - textNoMore: '-- END --', // 没有更多数据的提示文本 | 30 | + textNoMore: '-- 我是有底线的 --', // 没有更多数据的提示文本 |
31 | empty: { | 31 | empty: { |
32 | tip: '~ 暂无相关数据 ~' // 空提示 | 32 | tip: '~ 暂无相关数据 ~' // 空提示 |
33 | } | 33 | } |
@@ -37,7 +37,7 @@ const GlobalOption = { | @@ -37,7 +37,7 @@ const GlobalOption = { | ||
37 | en: { | 37 | en: { |
38 | up: { | 38 | up: { |
39 | textLoading: 'loading ...', | 39 | textLoading: 'loading ...', |
40 | - textNoMore: '-- END --', | 40 | + textNoMore: '-- 我是有底线的 --', |
41 | empty: { | 41 | empty: { |
42 | tip: '~ absolutely empty ~' | 42 | tip: '~ absolutely empty ~' |
43 | } | 43 | } |
@@ -35,7 +35,7 @@ const GlobalOption = { | @@ -35,7 +35,7 @@ const GlobalOption = { | ||
35 | }, | 35 | }, |
36 | up: { | 36 | up: { |
37 | textLoading: '加载中 ...', // 加载中的提示文本 | 37 | textLoading: '加载中 ...', // 加载中的提示文本 |
38 | - textNoMore: '-- END --', // 没有更多数据的提示文本 | 38 | + textNoMore: '-- 我是有底线的 --', // 没有更多数据的提示文本 |
39 | empty: { | 39 | empty: { |
40 | tip: '~ 空空如也 ~' // 空提示 | 40 | tip: '~ 空空如也 ~' // 空提示 |
41 | } | 41 | } |
@@ -35,7 +35,7 @@ const GlobalOption = { | @@ -35,7 +35,7 @@ const GlobalOption = { | ||
35 | }, | 35 | }, |
36 | up: { | 36 | up: { |
37 | textLoading: '加载中 ...', // 加载中的提示文本 | 37 | textLoading: '加载中 ...', // 加载中的提示文本 |
38 | - textNoMore: '-- END --', // 没有更多数据的提示文本 | 38 | + textNoMore: '-- 我是有底线的 --', // 没有更多数据的提示文本 |
39 | empty: { | 39 | empty: { |
40 | tip: '~ 空空如也 ~' // 空提示 | 40 | tip: '~ 空空如也 ~' // 空提示 |
41 | } | 41 | } |
@@ -95,7 +95,7 @@ MeScroll.prototype.extendUpScroll = function(optUp) { | @@ -95,7 +95,7 @@ MeScroll.prototype.extendUpScroll = function(optUp) { | ||
95 | noMoreSize: 5, // 如果列表已无数据,可设置列表的总数量要大于等于5条才显示无更多数据;避免列表数据过少(比如只有一条数据),显示无更多数据会不好看 | 95 | noMoreSize: 5, // 如果列表已无数据,可设置列表的总数量要大于等于5条才显示无更多数据;避免列表数据过少(比如只有一条数据),显示无更多数据会不好看 |
96 | offset: 150, // 距底部多远时,触发upCallback,仅mescroll-uni生效 ( mescroll-body配置的是pages.json的 onReachBottomDistance ) | 96 | offset: 150, // 距底部多远时,触发upCallback,仅mescroll-uni生效 ( mescroll-body配置的是pages.json的 onReachBottomDistance ) |
97 | textLoading: '加载中 ...', // 加载中的提示文本 | 97 | textLoading: '加载中 ...', // 加载中的提示文本 |
98 | - textNoMore: '-- END --', // 没有更多数据的提示文本 | 98 | + textNoMore: '-- 我是有底线的 --', // 没有更多数据的提示文本 |
99 | bgColor: "transparent", // 背景颜色 (建议在pages.json中再设置一下backgroundColorBottom) | 99 | bgColor: "transparent", // 背景颜色 (建议在pages.json中再设置一下backgroundColorBottom) |
100 | textColor: "gray", // 文本颜色 (当bgColor配置了颜色,而textColor未配置时,则textColor会默认为白色) | 100 | textColor: "gray", // 文本颜色 (当bgColor配置了颜色,而textColor未配置时,则textColor会默认为白色) |
101 | inited: null, // 初始化完毕的回调 | 101 | inited: null, // 初始化完毕的回调 |