Browse Source

(*)视频

dev
ww664853070 2 years ago
parent
commit
9874feb151
  1. 65
      api/app/lib/controllers/data/videoCenter.js
  2. 25
      weapp/src/packages/patrol/index.jsx
  3. 4
      web/client/src/sections/fillion/nav-item.js
  4. 1
      web/client/src/sections/quanju/containers/footer/leadership/right/hudongVideo.js

65
api/app/lib/controllers/data/videoCenter.js

@ -31,19 +31,70 @@ function videoList (opts) {
} }
} }
const deviceRes = await app.fs.yingshiRequest.post(`lapp/device/list`, { // const deviceRes = await app.fs.yingshiRequest.post(`lapp/device/list`, {
// query: {
// accessToken: yingshiToken,
// }
// })
ctx.status = 200;
let deviceRes_ = [{
deviceName: '楼前大桥',
deviceSerial: 'L48947105',
}, {
deviceName: '滁北大桥',
deviceSerial: 'L48947108',
}, {
deviceName: '新联桥',
deviceSerial: 'L48947110',
}, {
deviceName: '湾庄线',
deviceSerial: 'L48947112',
}, {
deviceName: '新土线',
deviceSerial: 'AA9943808',
}, {
deviceName: '东文大桥',
deviceSerial: 'L48947087',
}, {
deviceName: '莲姚线',
deviceSerial: 'L48947082',
}, {
deviceName: '荷漳公路',
deviceSerial: 'L48947109',
}, {
deviceName: '新武大桥',
deviceSerial: 'L48947086',
},]
const deviceState = await Promise.all(deviceRes_.map(d => {
return app.fs.yingshiRequest.post(`lapp/device/info`, {
query: { query: {
accessToken: yingshiToken, accessToken: yingshiToken,
deviceSerial: d.deviceSerial
} }
}) })
}))
ctx.status = 200; for (let d of deviceRes_) {
ctx.body = [] || (deviceRes.data || []).map(item => { let corState = deviceState.find(item => item.code == 200 && item.data && item.data.deviceSerial == d.deviceSerial)
return { if (corState) {
...item, d.status = corState.data.status
token: yingshiToken, } else {
d.status = 0
} }
}) d.token = yingshiToken
}
ctx.body = deviceRes_
// ||
// (deviceRes.data || []).map(item => {
// return {
// ...item,
// token: yingshiToken,
// }
// })
} catch (error) { } catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: error`); ctx.fs.logger.error(`path: ${ctx.path}, error: error`);
ctx.status = 400; ctx.status = 400;

25
weapp/src/packages/patrol/index.jsx

@ -162,8 +162,8 @@ const Index = () => {
Taro.getLocation({ Taro.getLocation({
// type: 'wgs84', // type: 'wgs84',
type: 'gcj02', type: 'gcj02',
isHighAccuracy: true, // isHighAccuracy: true,
// isHighAccuracy: false, isHighAccuracy: false,
highAccuracyExpireTime: 1000 * 6, highAccuracyExpireTime: 1000 * 6,
success: function (res) { success: function (res) {
setLongitude(res.longitude) setLongitude(res.longitude)
@ -171,6 +171,7 @@ const Index = () => {
Taro.request({ Taro.request({
url: `https://apis.map.qq.com/ws/geocoder/v1/?location=${res.latitude},${res.longitude}&key=${key}`, url: `https://apis.map.qq.com/ws/geocoder/v1/?location=${res.latitude},${res.longitude}&key=${key}`,
success: function (res) { success: function (res) {
console.log('地址:::', res);
// res // res
let addresscity = '' let addresscity = ''
addresscity = addresscity =
@ -248,7 +249,7 @@ const Index = () => {
]) ])
}, [reportType]) }, [reportType])
function report() { function report () {
if (!canReport) { return } if (!canReport) { return }
if ( if (
(isPatrol && (!projectType || !road)) (isPatrol && (!projectType || !road))
@ -325,7 +326,7 @@ const Index = () => {
}) })
} }
function deleteReport() { function deleteReport () {
Taro.showModal({ Taro.showModal({
title: '提示', title: '提示',
content: '确定删除吗?', content: '确定删除吗?',
@ -352,7 +353,7 @@ const Index = () => {
}) })
} }
function handleInput({ detail: { value } }, type) { function handleInput ({ detail: { value } }, type) {
switch (type) { switch (type) {
case 'roadSectionStart': case 'roadSectionStart':
setRoadSectionStart(value) setRoadSectionStart(value)
@ -387,15 +388,15 @@ const Index = () => {
} }
} }
function handleTypeChange(e) { function handleTypeChange (e) {
setReportType(e.detail.value) setReportType(e.detail.value)
} }
function handleImgChange(files, operationType, index, type) { function handleImgChange (files, operationType, index, type) {
if (operationType === 'remove') { if (operationType === 'remove') {
setImg(false) setImg(false)
} }
function setImg(isAdd, url) { function setImg (isAdd, url) {
switch (type) { switch (type) {
case 'scenePic': case 'scenePic':
let nextImg = sceneImg let nextImg = sceneImg
@ -495,12 +496,12 @@ const Index = () => {
} }
} }
function handleImgClick(index, file) { function handleImgClick (index, file) {
Taro.previewImage({ Taro.previewImage({
urls: [file.url] // http urls: [file.url] // http
}) })
} }
function handleImgClicks(index, file) { function handleImgClicks (index, file) {
Taro.previewImage({ Taro.previewImage({
urls: [file] // http urls: [file] // http
}) })
@ -522,7 +523,7 @@ const Index = () => {
} }
} }
}, [road]) }, [road])
function handleOk() { function handleOk () {
if (!canReport) { return } if (!canReport) { return }
let str = handleCenter.trim() let str = handleCenter.trim()
if (!str) { if (!str) {
@ -567,7 +568,7 @@ const Index = () => {
} }
}) })
} }
function addVideo() { function addVideo () {
wx.chooseMedia({ wx.chooseMedia({
count: 1, count: 1,
mediaType: ['video'], mediaType: ['video'],

4
web/client/src/sections/fillion/nav-item.js

@ -95,10 +95,10 @@ export function getNavItem(user, dispatch) {
<Menu.Item key="fillionassess"> <Menu.Item key="fillionassess">
<Link to="/fillion/assess">考核评分</Link> <Link to="/fillion/assess">考核评分</Link>
</Menu.Item> : ''} </Menu.Item> : ''}
{/* {user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'VIDEOCENTER') ? {user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'VIDEOCENTER') ?
<Menu.Item key="fillionvideoCenter"> <Menu.Item key="fillionvideoCenter">
<Link to="/fillion/videoCenter">视频中心</Link> <Link to="/fillion/videoCenter">视频中心</Link>
</Menu.Item> : ''} */} </Menu.Item> : ''}
</SubMenu> : null </SubMenu> : null
); );
} }

1
web/client/src/sections/quanju/containers/footer/leadership/right/hudongVideo.js

@ -50,7 +50,6 @@ class ReactCarousel extends Component {
} }
render () { render () {
console.log(this.props);
const { imgs } = this.state const { imgs } = this.state
return ( return (
<div className="ReactCarousel" style={{ width: "100%", height: "100%" }}> <div className="ReactCarousel" style={{ width: "100%", height: "100%" }}>

Loading…
Cancel
Save