重点工程播放视频功能
parent
1b237cca8a
commit
421ef2bc5e
|
@ -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 getHotWorkListByState = (params) => post("/app/hotworkapplication/list", params)//获取动火列表
|
||||
|
@ -108,3 +108,8 @@ export const getPromiseView = (params) => post("/app/corppromise/goEdit", params
|
|||
export const setPromiseIsRead = (params) => post("/app/corppromise/editIsRead", params); // 承诺书设置阅读状态
|
||||
export const editHiddenIspunish = (params) => post("/app/keyprojectcheck/editHiddenIspunish", 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 loginVideoPlat = (params) => videoApiGet("/api/v1/login", params); // 登录视频监控平台
|
||||
export const getPlatVideoPlay = (params) => videoApiGet("/api/v1/stream/start", params); // 获取视频监控平台播放地址
|
24
pages.json
24
pages.json
|
@ -602,6 +602,30 @@
|
|||
"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",
|
||||
"style": {
|
||||
|
|
|
@ -166,8 +166,8 @@ export default {
|
|||
onShow() {
|
||||
this.resetList()
|
||||
},
|
||||
onLoad() {
|
||||
this.CORPINFO_ID = this.$route.query.CORPINFO_ID
|
||||
onLoad(e) {
|
||||
this.CORPINFO_ID = e.CORPINFO_ID
|
||||
},
|
||||
computed: {
|
||||
userInfo() {
|
||||
|
|
|
@ -24,12 +24,17 @@
|
|||
baseList: []
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.CORPINFO_ID = this.$route.query.CORPINFO_ID
|
||||
onLoad(e) {
|
||||
this.CORPINFO_ID = e.CORPINFO_ID
|
||||
console.log(this.CORPINFO_ID);
|
||||
},
|
||||
onShow(event) {
|
||||
|
||||
this.baseList = [{
|
||||
title: '重点工程管理',
|
||||
url: '/pages/key-project-management/positioning_management/index'+ '?CORPINFO_ID='+this.CORPINFO_ID,
|
||||
},
|
||||
{
|
||||
title: '安全环保检查管理',
|
||||
url: '/pages/key-project-management/safety-environmental-inspection/list'+ '?CORPINFO_ID='+this.CORPINFO_ID,
|
||||
},
|
||||
|
@ -66,8 +71,9 @@
|
|||
loginUserId: this.userInfo.USER_ID,
|
||||
CORPINFO_ID: this.CORPINFO_ID
|
||||
})
|
||||
this.$set(this.baseList[1], 'NUM', resData.pd.HIDDEN_COUNT)
|
||||
this.$set(this.baseList[2], 'NUM', resData.pd.CF_COUNT)
|
||||
this.$set(this.baseList[0], 'NUM', resData.pd.GC_COUNT)
|
||||
this.$set(this.baseList[2], 'NUM', resData.pd.HIDDEN_COUNT)
|
||||
this.$set(this.baseList[3], 'NUM', resData.pd.CF_COUNT)
|
||||
}
|
||||
},
|
||||
}
|
||||
|
|
|
@ -90,6 +90,7 @@ export default {
|
|||
this.getData()
|
||||
},
|
||||
fnNavigatorDetail(CORPINFO_ID){
|
||||
console.log(CORPINFO_ID)
|
||||
// 重点工程
|
||||
// 安全环保检查管理
|
||||
uni.$u.route({
|
||||
|
|
|
@ -129,8 +129,8 @@ export default {
|
|||
onShow() {
|
||||
this.resetList()
|
||||
},
|
||||
onLoad() {
|
||||
this.CORPINFO_ID = this.$route.query.CORPINFO_ID
|
||||
onLoad(e) {
|
||||
this.CORPINFO_ID = e.CORPINFO_ID
|
||||
},
|
||||
computed: {
|
||||
userInfo() {
|
||||
|
|
|
@ -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>
|
|
@ -0,0 +1,117 @@
|
|||
<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'"
|
||||
type="success"
|
||||
@click="fnUpdateStateKeyProject('1')"
|
||||
size="small"
|
||||
text="工程开始"
|
||||
/>
|
||||
<u-button
|
||||
v-if="info.STATE==='-2'"
|
||||
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: ''
|
||||
}
|
||||
},
|
||||
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; //纬度
|
||||
},
|
||||
//返回方法
|
||||
fnBack() {
|
||||
uni.$u.route({
|
||||
type: 'navigateBack'
|
||||
})
|
||||
},
|
||||
//工程开始
|
||||
async fnUpdateStateKeyProject(state){
|
||||
await setKeyProjectsState({
|
||||
OUTSOURCED_ID: this.OUTSOURCED_ID,
|
||||
OPERATOR: this.userInfo.PERSONNELMANAGEMENT_ID, //修改人
|
||||
STATE:STATE
|
||||
});
|
||||
uni.$u.toast('提交成功')
|
||||
setTimeout(() => {
|
||||
this.fnBack()
|
||||
}, 1000)
|
||||
},
|
||||
},
|
||||
}
|
||||
</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>
|
|
@ -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>
|
|
@ -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>
|
|
@ -1,6 +1,7 @@
|
|||
// let requestPath = 'http://192.168.0.45:8092/';
|
||||
// let requestPath = 'http://192.168.0.31:8992/qa-regulatory-gwj/'; // 后台请求地址https://skqhdg.porthebei.com:9004/qa-prevention-gwj/
|
||||
export var requestPath = 'https://skqhdg.porthebei.com:9005/qa-regulatory-gwj/'; // 后台请求地址
|
||||
// let requestPath = 'http://192.168.0.47:8092/';
|
||||
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/'; // 后台请求地址
|
||||
let videoApiPath = 'https://arqsp.qhdsafety.com:10010'; // 视频平台后台请求地址
|
||||
function post(url, data) {
|
||||
return new Promise((resolve, reject) => {
|
||||
if (data && data.loading !== false) {
|
||||
|
@ -132,4 +133,40 @@ function uploads(url, data) {
|
|||
function setBasePath(url, data) {
|
||||
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}
|
||||
|
|
Loading…
Reference in New Issue