Merge pull request 'main' (#1) from main into dev-2024年1月8日

Reviewed-on: #1
dev-2024年1月8日
guoyuepeng 2024-01-18 17:11:48 +08:00
commit 67d526963d
16 changed files with 726 additions and 20 deletions

View File

@ -1,4 +1,4 @@
import {post, upload, uploads} from "../utils/request"; import {post, upload, uploads, videoApiGet} from "../utils/request";
export const submitLogin = (params) => post("/admin/check", params) // 登录 export const submitLogin = (params) => post("/admin/check", params) // 登录
export const getHotWorkListByState = (params) => post("/app/hotworkapplication/list", params)//获取动火列表 export const getHotWorkListByState = (params) => post("/app/hotworkapplication/list", params)//获取动火列表
@ -107,4 +107,10 @@ export const getReceivePromiseList = (params) => post("/app/corppromise/receiveP
export const getPromiseView = (params) => post("/app/corppromise/goEdit", params); // 查看承诺书 export const getPromiseView = (params) => post("/app/corppromise/goEdit", params); // 查看承诺书
export const setPromiseIsRead = (params) => post("/app/corppromise/editIsRead", params); // 承诺书设置阅读状态 export const setPromiseIsRead = (params) => post("/app/corppromise/editIsRead", params); // 承诺书设置阅读状态
export const editHiddenIspunish = (params) => post("/app/keyprojectcheck/editHiddenIspunish", params); // 修改隐患信息 export const editHiddenIspunish = (params) => post("/app/keyprojectcheck/editHiddenIspunish", params); // 修改隐患信息
export const getPERSONNELMANAGEMENTID = (params) => post("/app/keyProjects/goEdit", params); // 重点工程默认回显负责人 export const getPERSONNELMANAGEMENTID = (params) => post("/app/keyProjects/goEdit", params); // 重点工程默认回显负责人
export const getKeyProjectsView = (params) => post("/app/keyProjects/getOutsourced", params); // 获取重点工程详详细信息
export const getKeyProjectsVideoList = (params) => post("/app/keyProjects/videomanagerList", params); // 获取重点工程的视频列表
export const setKeyProjectsState = (params) => post("/app/keyProjects/updateState", params); // 修改重点工程状态
//播放视频平台 视频用
export const loginVideoPlat = (params) => videoApiGet("/api/v1/login", params); // 登录视频监控平台
export const getPlatVideoPlay = (params) => videoApiGet("/api/v1/stream/start", params); // 获取视频监控平台播放地址

File diff suppressed because one or more lines are too long

59
hybrid/html/newMap.html Normal file
View File

@ -0,0 +1,59 @@
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>地图</title>
</head>
<script src="http://api.tianditu.gov.cn/api?v=4.0&tk=e8a16137fd226a62a23cc7ba5c9c78ce" type="text/javascript">
</script>
<script src="./js/uni.webview.1.5.4.js"></script>
<body onLoad="onLoad()">
<div id="mapDiv" style="position:absolute;width:100vw; height:100vh"></div>
</body>
<style>
* {
margin: 0;
padding: 0;
}
</style>
<script>
var map;
var zoom = 14;
function getUrlParam(name) {
const reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
const r = window.location.search.substr(1).match(reg);
if (r != null) return decodeURI(r[2]);
return "";
}
function onLoad() {
var imageURL = "http://t0.tianditu.gov.cn/img_w/wmts?" +
"SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=img&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles" +
"&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=e8a16137fd226a62a23cc7ba5c9c78ce";
lay = new T.TileLayer(imageURL, {minZoom: 1, maxZoom: 18});
var config = {layers: [lay]};
map = new T.Map("mapDiv", config);
map.centerAndZoom(new T.LngLat(getUrlParam('longitude'), getUrlParam('latitude')), zoom);
map.enableScrollWheelZoom();
addMapClick()
}
function addMapClick() {
map.addEventListener("click", MapClick);
}
function MapClick(event) {
var marker = new T.Marker(new T.LngLat(event.lnglat.getLng(), event.lnglat.getLat()));
map.clearOverLays();
map.addOverLay(marker);
console.log(event.lnglat.getLng(), event.lnglat.getLat());
uni.postMessage({
data: {
"longitue": event.lnglat.getLng(),
"latitude": event.lnglat.getLat(),
}
})
}
</script>
</html>

View File

@ -469,6 +469,12 @@
"navigationBarTitleText": "地图" "navigationBarTitleText": "地图"
} }
}, },
{
"path" : "pages/map/mapPro",
"style" : {
"navigationBarTitleText": "地图"
}
},
{ {
"path": "pages/information/index/index", "path": "pages/information/index/index",
"style": { "style": {
@ -602,6 +608,30 @@
"navigationBarTitleText": "处罚管理隐患详情" "navigationBarTitleText": "处罚管理隐患详情"
} }
}, },
{
"path": "pages/key-project-management/positioning_management/index",
"style": {
"navigationBarTitleText": "重点工程管理"
}
},
{
"path": "pages/key-project-management/positioning_management/keyProjectApply",
"style": {
"navigationBarTitleText": "重点工程信息"
}
},
{
"path": "pages/key-project-management/positioning_management/list",
"style": {
"navigationBarTitleText": "视频列表"
}
},
{
"path": "pages/key-project-management/positioning_management/videoView",
"style": {
"navigationBarTitleText": "播放视频"
}
},
{ {
"path": "pages/mine/promise/sign", "path": "pages/mine/promise/sign",
"style": { "style": {

View File

@ -166,8 +166,8 @@ export default {
onShow() { onShow() {
this.resetList() this.resetList()
}, },
onLoad() { onLoad(e) {
this.CORPINFO_ID = this.$route.query.CORPINFO_ID this.CORPINFO_ID = e.CORPINFO_ID
}, },
computed: { computed: {
userInfo() { userInfo() {

View File

@ -24,12 +24,17 @@
baseList: [] baseList: []
} }
}, },
onLoad() { onLoad(e) {
this.CORPINFO_ID = this.$route.query.CORPINFO_ID this.CORPINFO_ID = e.CORPINFO_ID
console.log(this.CORPINFO_ID);
}, },
onShow(event) { onShow(event) {
this.baseList = [{ this.baseList = [{
title: '重点工程管理',
url: '/pages/key-project-management/positioning_management/index'+ '?CORPINFO_ID='+this.CORPINFO_ID,
},
{
title: '安全环保检查管理', title: '安全环保检查管理',
url: '/pages/key-project-management/safety-environmental-inspection/list'+ '?CORPINFO_ID='+this.CORPINFO_ID, url: '/pages/key-project-management/safety-environmental-inspection/list'+ '?CORPINFO_ID='+this.CORPINFO_ID,
}, },
@ -66,8 +71,9 @@
loginUserId: this.userInfo.USER_ID, loginUserId: this.userInfo.USER_ID,
CORPINFO_ID: this.CORPINFO_ID CORPINFO_ID: this.CORPINFO_ID
}) })
this.$set(this.baseList[1], 'NUM', resData.pd.HIDDEN_COUNT) this.$set(this.baseList[0], 'NUM', resData.pd.GC_COUNT)
this.$set(this.baseList[2], 'NUM', resData.pd.CF_COUNT) this.$set(this.baseList[2], 'NUM', resData.pd.HIDDEN_COUNT)
this.$set(this.baseList[3], 'NUM', resData.pd.CF_COUNT)
} }
}, },
} }

View File

@ -16,7 +16,7 @@
<view> <view>
<view class="flex-between"> <view class="flex-between">
<text class="main-title">{{ item.CORP_NAME }}</text> <text class="main-title">{{ item.CORP_NAME }}</text>
<u-badge style="font-size: x-small; padding:5px 5px" :value="item.cf+item.yh"/> <u-badge style="font-size: x-small; padding:5px 5px" :value="item.cf+item.yh+item.gc"/>
</view> </view>
<view class="flex-between mt-10 subtitle"> <view class="flex-between mt-10 subtitle">
<text v-if="item.CORPINFO_ID != '1'">{{item.prvinceName}}-{{item.cityName}}-{{item.countryName}}</text> <text v-if="item.CORPINFO_ID != '1'">{{item.prvinceName}}-{{item.cityName}}-{{item.countryName}}</text>
@ -90,6 +90,7 @@ export default {
this.getData() this.getData()
}, },
fnNavigatorDetail(CORPINFO_ID){ fnNavigatorDetail(CORPINFO_ID){
console.log(CORPINFO_ID)
// //
// //
uni.$u.route({ uni.$u.route({

View File

@ -129,8 +129,8 @@ export default {
onShow() { onShow() {
this.resetList() this.resetList()
}, },
onLoad() { onLoad(e) {
this.CORPINFO_ID = this.$route.query.CORPINFO_ID this.CORPINFO_ID = e.CORPINFO_ID
}, },
computed: { computed: {
userInfo() { userInfo() {

View File

@ -0,0 +1,132 @@
<template>
<view class="content">
<u-search placeholder="请输入搜索关键词" v-model="KEYWORDS" @custom="fnSearchList" @clear="fnSearchList" @search="fnSearchList"></u-search>
<u-list @scrolltolower="scrolltolower" v-if="list.length > 0">
<u-list-item v-for="(item, index) in list" :key="index">
<view class="flex-between main-title" @click="fnKeyProjectApply(item.OUTSOURCED_ID)">
<text>{{ item.OUTSOURCED_NAME }}</text>
</view>
<view v-show="item.IS_CORP_TYPE== '1'" class="flex-between mt-10 subtitle" @click="fnKeyProjectApply(item.OUTSOURCED_ID)">
<text>
主管部门{{ item.Q_COMPETENT_DEPT_NAME }}
</text>
</view>
<view v-show="item.IS_CORP_TYPE== '1'" class="flex-between mt-10 subtitle" @click="fnKeyProjectApply(item.OUTSOURCED_ID)">
<text>
监督部门{{ item.DEPARTMENT_NAME }}
</text>
</view>
<view v-show="item.IS_CORP_TYPE== '0'" class="flex-between mt-10 subtitle" @click="fnKeyProjectApply(item.OUTSOURCED_ID)">
<text>
主管部门{{ item.MANAGER_DEPARTMENT_NAME }}
</text>
</view>
<view v-show="item.IS_CORP_TYPE== '0'" class="flex-between mt-10 subtitle" @click="fnKeyProjectApply(item.OUTSOURCED_ID)">
<text>
监管部门{{ item.DEPARTMENT_NAME }}
</text>
</view>
<view class="flex-between mt-10 subtitle" @click="fnKeyProjectApply(item.OUTSOURCED_ID)">
<text>相关方单位负责人{{ item.UNITS_PIC_NAME }}</text>
<text>电话{{ item.UNITS_PHONE }}</text>
</view>
<view class="flex-between mt-10 subtitle" @click="fnKeyProjectApply(item.OUTSOURCED_ID)">
<text>定位坐标{{ item.WORK_LONGITUDE?item.WORK_LONGITUDE+'*'+item.WORK_LATITUDE: ''}}</text>
</view>
<view class="flex-between mt-10 subtitle" @click="fnKeyProjectApply(item.OUTSOURCED_ID)">
<text>状态{{ item.STATE == '-1'?'开工申请中':item.STATE == '-2'?'结束申请中': item.STATE == '0'?'未开工': item.STATE == '1'?'进行中': '已结束'}}</text>
</view>
<view class="flex-end">
<view class="flex-between">
<u-button
size="mini"
round
type="primary"
class="bth-mini"
text="查看"
@click="fnKeyProjectApply(item.OUTSOURCED_ID)"
/>
<u-button style="margin-left: 20upx;"
size="mini"
round
type="primary"
class="bth-mini"
text="播放"
@click="fnView(item.OUTSOURCED_ID)"
/>
</view>
</view>
</u-list-item>
</u-list>
<empty v-else></empty>
</view>
</template>
<script>
import {getKeyProjectsListOutsourced} from "@/api";
export default {
data() {
return {
KEYWORDS: '',
list: [],
pageSize: 10,
currentPage: 1,
totalPage: 0,
}
},
onLoad(e) {
this.CORPINFO_ID = e.CORPINFO_ID
},
onShow() {
this.fnSearchList()
},
computed: {
userInfo() {
return this.$store.getters.getUserInfo
}
},
methods: {
async fnGetData() {
const resData = await getKeyProjectsListOutsourced({
KEYWORDS: this.KEYWORDS,
showCount: this.pageSize,
currentPage: this.currentPage,
CORPINFO_ID: this.CORPINFO_ID,
UserId: this.userInfo.USER_ID,
});
this.list = [...this.list, ...resData.varList];
this.totalPage = resData.page.totalPage;
},
scrolltolower() {
this.currentPage++;
if(this.totalPage >= this.currentPage) this.fnGetData();
},
fnSearchList(){
this.pageSize = 10;
this.currentPage = 1;
this.list = [];
this.fnGetData();
},
fnView(OUTSOURCED_ID){
uni.$u.route({
url: '/pages/key-project-management/positioning_management/list',
params:{
OUTSOURCED_ID
}
})
},
fnKeyProjectApply(OUTSOURCED_ID){
uni.$u.route({
url: '/pages/key-project-management/positioning_management/keyProjectApply',
params:{
OUTSOURCED_ID
}
})
},
},
}
</script>
<style lang="scss" scoped>
</style>

View File

@ -0,0 +1,145 @@
<template>
<view class="content">
<u-cell-group>
<u-cell title="重点工程名称" :value="info.OUTSOURCED_NAME"/>
<u-cell title="计划工期" :value="info.STARTTIME+ '至'+ info.ENDTIME"/>
<u-cell title="合同号" :value="info.CONTRACT_NUM"/>
<u-cell title="施工相关方" :value="info.UNITS_NAME"/>
<u-cell title="相关方单位工程负责人" :value="info.UNITS_PIC_NAME"/>
<u-cell title="相关方单位负责人手机" :value="info.UNITS_PHONE"/>
<u-cell title="经度" v-show="WORK_LONGITUDE" :value="WORK_LONGITUDE"/>
<u-cell title="纬度" v-show="WORK_LATITUDE" :value="WORK_LATITUDE"/>
</u-cell-group>
<view class="button">
<u-button
v-if="info.STATE==='-1'&& anniuShow"
type="success"
@click="fnUpdateStateKeyProject('1')"
size="small"
text="工程开始"
/>
<u-button
v-if="info.STATE==='-2'&& anniuShow"
type="error"
@click="fnUpdateStateKeyProject('2')"
size="small"
text="工程结束"
/>
<u-button
@click="fnBack"
size="small"
text="返回"
/>
</view>
</view>
</template>
<script>
import {getKeyProjectsView,setKeyProjectsState} from "@/api"
export default {
data() {
return {
OUTSOURCED_ID: '',
KEYPROJECTCHECK_ID: '',
type: '',
info: {},
WORK_LONGITUDE: '', //
WORK_LATITUDE: '', //
hiddenData: {},
popupShow: false,
videoShow: false,
videoSrc: '',
anniuShow: false
}
},
computed: {
userInfo() {
return this.$store.getters.getUserInfo
}
},
onLoad(options) {
this.OUTSOURCED_ID = options.OUTSOURCED_ID
this.fnGetData()
},
methods: {
async fnGetData() {
//
const resData = await getKeyProjectsView({
OUTSOURCED_ID: this.OUTSOURCED_ID,
});
this.info = resData.pd;
this.WORK_LONGITUDE = this.info.WORK_LONGITUDE; //
this.WORK_LATITUDE = this.info.WORK_LATITUDE; //
if(this.userInfo.USER_ID == this.info.CREATOR){
this.anniuShow = true;
}
},
//
fnBack() {
uni.$u.route({
type: 'navigateBack'
})
},
//
async fnUpdateStateKeyProject(state){
console.log(state)
var content = '';
if(state === '1'){
content = '确定同意开工吗?'
}else if(state === '2'){
content = '确定同意结束吗?'
}
uni.showModal({
title: '提示',
cancelText: '确认',
confirmText: '取消',
content: content,
success: (res) => {
console.log(res)
if (res.cancel) {
setKeyProjectsState({
OUTSOURCED_ID: this.OUTSOURCED_ID,
OPERATOR: this.userInfo.USER_ID, //
STATE:state
});
uni.$u.toast('提交成功')
setTimeout(() => {
this.fnBack()
}, 1000)
}
}
})
},
endUpdate(state){
},
},
}
</script>
<style lang="scss" scoped>
.content {
padding: 0 20upx;
background-color: #fff;
}
.button {
text-align: center;
margin-top: 40upx;
margin-bottom: 40upx;
display: flex;
justify-content: space-between;
button {
width: 45%;
}
}
.ml-10:first-child {
margin-left: 0 !important;
}
</style>

View File

@ -0,0 +1,122 @@
<template>
<view class="content">
<u-search placeholder="请输入搜索关键词" v-model="KEYWORDS" @custom="fnSearchList" @clear="fnSearchList"
@search="fnSearchList"></u-search>
<u-list @scrolltolower="scrolltolower" v-if="list.length > 0">
<u-list-item v-for="(item, index) in list" :key="index">
<view class="flex-between main-title">
<text>{{ item.VIDEONAME }}</text>
</view>
<view class="flex-between mt-10 subtitle">
<text>
播放地址{{ item.VIDEOURL }}
</text>
</view>
<view class="flex-between mt-10 subtitle" v-show="item.LATITUDE&&item.LONGITUDE">
<text>
坐标{{ item.LATITUDE }}*{{item.LONGITUDE}}
</text>
</view>
<view class="flex-between mt-10 subtitle">
<text>
状态{{ item.LATITUDE&&item.LONGITUDE? "已定位":"未定位" }}
</text>
<view class="flex-between">
<u-button style="margin-left: 20upx;"
size="mini"
round
type="primary"
class="bth-mini"
text="播放"
@click="fnVideo(item)"
/>
</view>
</view>
</u-list-item>
</u-list>
<empty v-else></empty>
</view>
</template>
<script>
import {getKeyProjectsVideoList} from "@/api";
export default {
data() {
return {
state: {
"-1": "检查人驳回",
0: "待被检查人确认",
1: "被检查人已确认",
2: "已归档",
},
OUTSOURCED_ID: '',
KEYWORDS: '',
list: [],
pageSize: 10,
currentPage: 1,
totalPage: 0,
}
},
onLoad(options) {
this.OUTSOURCED_ID = options.OUTSOURCED_ID
},
onShow() {
this.fnSearchList()
},
computed: {
userInfo() {
return this.$store.getters.getUserInfo
}
},
methods: {
async fnGetData() {
const resData = await getKeyProjectsVideoList({
OUTSOURCED_ID: this.OUTSOURCED_ID,
KEYWORDS: this.KEYWORDS,
showCount: this.pageSize,
currentPage: this.currentPage
});
this.list = [...this.list, ...resData.varList];
//
for(var i =0;i<this.list.length;i++){
var videourl = '';
var old = this.list[i].VIDEOURL;
var k = 1;
if(this.list[i].VIDEOURL){
for(var j =0;j<this.list[i].VIDEOURL.length;j++){
if(j/2==22*k){
videourl+='\n';
k++;
}
videourl+=this.list[i].VIDEOURL[j];
}
}
console.log(videourl)
this.list[i].VIDEOURL = videourl
this.list[i].old = old
}
this.totalPage = resData.page.totalPage;
},
scrolltolower() {
this.currentPage++;
if (this.totalPage >= this.currentPage) this.fnGetData();
},
fnSearchList() {
this.pageSize = 10;
this.currentPage = 1;
this.list = [];
this.fnGetData();
},
fnVideo(video) {
uni.$u.route({
url: '/pages/key-project-management/positioning_management/videoView',
params: video
})
}
},
}
</script>
<style lang="scss" scoped>
</style>

View File

@ -0,0 +1,90 @@
<template>
<view class="content">
<video id="coursewareVideo" :src="src"
controls autoplay="autoplay" style="width: 100%;"></video>
</view>
</template>
<script>
import {getPlatVideoPlay, loginVideoPlat} from "@/api";
export default {
data() {
return {
info: {},
src:''
}
},
onLoad(options) {
this.info = options
this.fnInit()
},
methods: {
fnInit(){
this.fnInitVideoPlat()
},
async fnInitVideoPlat(){
const params = this.getUrlParams(this.info.old)
if(!params || !params.serial){
uni.showToast({
title: '网络错误请重试',
icon: 'none',
duration: 2000
});
return
}
const serial = params.serial
const resData = await loginVideoPlat({
username:"admin",
password:"234f3424be5a75ad898a1b55f6e34d9e",
url_token_only:true
});
const token = resData.URLToken
const playData = await getPlatVideoPlay({
serial,
token
});
console.log(playData)
this.src = playData.HLS
console.log(src)
},
fnBack() {
uni.$u.route({
type: 'navigateBack'
})
},
getUrlParams(url) {
const params = {};
const paramStr = url.split('?')[1]; //
if (paramStr) {
const paramArr = paramStr.split('&'); //
paramArr.forEach((param) => {
const [key, value] = param.split('='); //
params[key] = value; // params
});
}
return params;
}
},
}
</script>
<style lang="scss" scoped>
.content {
background-color: #fff;
padding: 0 20upx;
}
.button {
text-align: center;
margin-top: 40upx;
margin-bottom: 40upx;
button {
width: 70%;
}
}
</style>

View File

@ -66,8 +66,8 @@ export default {
list: [], list: [],
} }
}, },
onLoad() { onLoad(e) {
this.CORPINFO_ID = this.$route.query.CORPINFO_ID this.CORPINFO_ID = e.CORPINFO_ID
}, },
onShow() { onShow() {
this.resetList() this.resetList()
@ -84,8 +84,7 @@ export default {
showCount: this.pageSize, showCount: this.pageSize,
currentPage: this.currentPage, currentPage: this.currentPage,
CORPINFO_ID: this.CORPINFO_ID, CORPINFO_ID: this.CORPINFO_ID,
UserId: this.userInfo.USER_ID, UserId: this.userInfo.USER_ID
STATE:'1'
}); });
this.list = [...this.list,...resData.varList]; this.list = [...this.list,...resData.varList];
this.totalPage = resData.page.totalPage; this.totalPage = resData.page.totalPage;

78
pages/map/mapPro.vue Normal file
View File

@ -0,0 +1,78 @@
<template>
<view>
<cu-custom bgColor="bg-gradual-blueness" :isBack="true">
<block slot="backText">返回</block>
<block slot="content">位置定位</block>
</cu-custom>
<web-view id="webview" :src="url" @message="messageChange"></web-view>
</view>
</template>
<script>
export default {
components: {},
data() {
return {
url: '',
longitude: '',
latitude: ''
}
},
onLoad(option) {
this.longitude = 119.67751
this.latitude = 39.92596
this.init();
const eventChannel = this.$scope.eventChannel; // APP-NVUE
// acceptDataFromOpenerPageeventChannel
eventChannel.on('acceptDataFromOpenerPage', function (data) {
console.log(data)
})
},
onBackPress(options) {
return false;
},
onUnload() {
},
onShow() {
},
methods: {
goBack() {
uni.navigateBack()
},
saveData() {
},
init() {
this.url = ('/hybrid/html/newMap.html?longitude='+this.longitude+'&latitude='+this.latitude+ 't=' + new Date().getTime());
console.log(this.url);
},
messageChange(e) {
console.log("messageChange");
console.log(e);
uni.setStorageSync("info", e.detail.data[0]);
const eventChannel = this.$scope.eventChannel; // APP-NVUE
console.log(eventChannel)
eventChannel.emit('acceptDataFromOpenedPage', {data: e.detail.data[0]});
uni.navigateBack();
}
}
}
</script>
<style scoped>
page,
uni-page-body,
.container {
background: rgba(245, 245, 245, 1);
min-height: calc(100%);
}
</style>

View File

@ -903,7 +903,7 @@ export default {
showMapModal() { showMapModal() {
let _this = this let _this = this
uni.navigateTo({ uni.navigateTo({
url: '/pages/map/map', url: '/pages/map/mapPro',
events: { events: {
acceptDataFromOpenedPage: function (e) { acceptDataFromOpenedPage: function (e) {
_this.hiddenForm.LONGITUDE = e.data.longitue; _this.hiddenForm.LONGITUDE = e.data.longitue;

View File

@ -1,6 +1,7 @@
// let requestPath = 'http://192.168.0.45:8092/'; // let requestPath = 'http://192.168.0.47:8092/';
// let requestPath = 'http://192.168.0.31:8992/qa-regulatory-gwj/'; // 后台请求地址https://skqhdg.porthebei.com:9004/qa-prevention-gwj/ let requestPath = 'http://192.168.151.34:8092/'; // 后台请求地址https://skqhdg.porthebei.com:9004/qa-prevention-gwj/
export var requestPath = 'https://skqhdg.porthebei.com:9005/qa-regulatory-gwj/'; // 后台请求地址 // export var requestPath = 'https://skqhdg.porthebei.com:9005/qa-regulatory-gwj/'; // 后台请求地址
let videoApiPath = 'https://arqsp.qhdsafety.com:10010'; // 视频平台后台请求地址
function post(url, data) { function post(url, data) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
if (data && data.loading !== false) { if (data && data.loading !== false) {
@ -132,4 +133,40 @@ function uploads(url, data) {
function setBasePath(url, data) { function setBasePath(url, data) {
requestPath = url requestPath = url
} }
export {post, upload, uploads,setBasePath}
function videoApiGet(url, data) {
return new Promise((resolve, reject) => {
if (data && data.loading !== false) {
uni.showLoading({
title: '加载中'
});
}
uni.request({
url: videoApiPath + url + (data.token?`?token=${data.token}`:''),
data: {
...data
},
method: 'GET',
header: {
'Content-type': 'application/json'
},
success: (res) => {
uni.hideLoading();
resolve(res.data)
},
fail: (err) => {
if (data && data.loading !== false) {
uni.hideLoading();
}
uni.showToast({
title: '网络错误请重试',
icon: 'none',
duration: 2000
});
reject(err)
}
});
})
}
export {post, upload, uploads,setBasePath,videoApiGet}