qa-regulatory-gwj-app/pages/key-project-management/positioning_management/list.vue

123 lines
3.0 KiB
Vue
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<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>