Browse Source

(*)视频

dev
ww664853070 1 year ago
parent
commit
9874feb151
  1. 71
      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

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

@ -31,19 +31,70 @@ function videoList (opts) {
}
}
const deviceRes = await app.fs.yingshiRequest.post(`lapp/device/list`, {
query: {
accessToken: yingshiToken,
}
})
// const deviceRes = await app.fs.yingshiRequest.post(`lapp/device/list`, {
// query: {
// accessToken: yingshiToken,
// }
// })
ctx.status = 200;
ctx.body = [] || (deviceRes.data || []).map(item => {
return {
...item,
token: yingshiToken,
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: {
accessToken: yingshiToken,
deviceSerial: d.deviceSerial
}
})
}))
for (let d of deviceRes_) {
let corState = deviceState.find(item => item.code == 200 && item.data && item.data.deviceSerial == d.deviceSerial)
if (corState) {
d.status = corState.data.status
} else {
d.status = 0
}
})
d.token = yingshiToken
}
ctx.body = deviceRes_
// ||
// (deviceRes.data || []).map(item => {
// return {
// ...item,
// token: yingshiToken,
// }
// })
} catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: error`);
ctx.status = 400;

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

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

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

@ -95,10 +95,10 @@ export function getNavItem(user, dispatch) {
<Menu.Item key="fillionassess">
<Link to="/fillion/assess">考核评分</Link>
</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">
<Link to="/fillion/videoCenter">视频中心</Link>
</Menu.Item> : ''} */}
</Menu.Item> : ''}
</SubMenu> : null
);
}

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

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

Loading…
Cancel
Save