过滤器小程序
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
export default {
|
||||
users: {
|
||||
yanan: {
|
||||
pass: 'yanan123',
|
||||
id: 1,
|
||||
user: 'yanan',
|
||||
name: 'yanan',
|
||||
dept: '系统控制',
|
||||
title: '管理员',
|
||||
mobile: '13288888888'
|
||||
}
|
||||
},
|
||||
devices: [
|
||||
[],
|
||||
[
|
||||
{
|
||||
id: 1,
|
||||
name:'北桥沟',
|
||||
addr:'陕西省延安市宝塔区北桥沟'
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name:'黄蒿洼',
|
||||
addr:'陕西省延安市宝塔区黄蒿洼路'
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
const API_HOST = 'https://filter.api.opmonitor.com'
|
||||
export default {
|
||||
apiHost: API_HOST,
|
||||
dateTimeStr: function() {
|
||||
let d = new Date()
|
||||
let a = []
|
||||
a.push('' + d.getFullYear())
|
||||
a.push(('' + (d.getMonth() + 1)).padStart(2, '0'))
|
||||
a.push(('' + d.getDate()).padStart(2, '0'))
|
||||
a.push(('' + d.getHours()).padStart(2, '0'))
|
||||
a.push(('' + d.getMinutes()).padStart(2, '0'))
|
||||
a.push(('' + d.getSeconds()).padStart(2, '0'))
|
||||
return `${a[0]}-${a[1]}-${a[2]} ${a[3]}:${a[4]}:${a[5]}`
|
||||
},
|
||||
tabBar: [
|
||||
{
|
||||
pagePath: '/packagePage/pages/ctrllist/ctrllist',
|
||||
text: '医院',
|
||||
iconPath: API_HOST + '/miniapp/static/tabnav1a.png',
|
||||
selectedIconPath: API_HOST + '/miniapp/static/tabnav1.png'
|
||||
},
|
||||
{
|
||||
pagePath: '/packagePage/pages/positionindex/positionindex',
|
||||
text: '点位',
|
||||
iconPath: API_HOST + '/miniapp/static/extend_gray.png',
|
||||
selectedIconPath: API_HOST + '/miniapp/static/extend_active.png'
|
||||
},
|
||||
{
|
||||
pagePath: '/packagePage/pages/record/record',
|
||||
text: '记录',
|
||||
iconPath: API_HOST + '/miniapp/static/code_gray.png',
|
||||
selectedIconPath: API_HOST + '/miniapp/static/code_active.png'
|
||||
},
|
||||
{
|
||||
pagePath: '/packagePage/pages/ctrldevice/ctrldevice',
|
||||
text: '更换',
|
||||
iconPath: API_HOST + '/miniapp/static/thor_gray.png',
|
||||
selectedIconPath: API_HOST + '/miniapp/static/thor_active.png'
|
||||
}
|
||||
],
|
||||
// tabbar 切换
|
||||
tabbarSwitch: function(e) {
|
||||
uni.reLaunch({
|
||||
url: e.pagePath
|
||||
})
|
||||
},
|
||||
// check login
|
||||
checkLogin: function() {
|
||||
let info = uni.getStorageSync('user')
|
||||
if (typeof(info) == 'object' && info.account != undefined) {
|
||||
return info
|
||||
} else {
|
||||
uni.reLaunch({
|
||||
url: '/packagePage/pages/auth/auth'
|
||||
})
|
||||
}
|
||||
},
|
||||
// toast
|
||||
showHint: function(msg = 'hello', sec = 2000) {
|
||||
uni.showToast({
|
||||
title: msg,
|
||||
duration: sec,
|
||||
icon: 'none',
|
||||
mask: true
|
||||
})
|
||||
},
|
||||
// request
|
||||
request: function(uri, callback, reqData = {}, reqMethod = 'GET') {
|
||||
let params = {
|
||||
url:API_HOST + uri,
|
||||
method: reqMethod,
|
||||
data: reqData,
|
||||
success: callback,
|
||||
fail:function() {
|
||||
uni.showToast({
|
||||
title: '加载失败',
|
||||
duration: 2000,
|
||||
icon: 'none',
|
||||
mask: true
|
||||
})
|
||||
},
|
||||
complete: function() {
|
||||
uni.hideLoading()
|
||||
}
|
||||
}
|
||||
if (reqMethod == 'POST') {
|
||||
params.header = {
|
||||
'content-type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
}
|
||||
uni.showLoading({
|
||||
title: '加载中',
|
||||
mask: true
|
||||
})
|
||||
uni.request(params)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user