页面修改

This commit is contained in:
zmj 2023-11-18 20:17:03 +08:00
parent eca744e099
commit dcf5a1a22f
5 changed files with 491 additions and 410 deletions

View File

@ -97,4 +97,19 @@ export const commit_town_service_manager_task_6API = (data) => oahttp.post('/tas
* 促成村联络人员入股 * 促成村联络人员入股
*/ */
export const commit_town_master_task_6API = (data) => oahttp.post('/task/commit_town_master_task_6', export const commit_town_master_task_6API = (data) => oahttp.post('/task/commit_town_master_task_6',
data)
/**
* 应用软件推广
*/
export const commit_town_master_task_type_2API = (data) => oahttp.post('/task/commit_town_master_task_type_2',
data)
/**
* 应用软件推广
*/
export const commit_town_master_task_type_7API = (data) => oahttp.post('/task/commit_town_master_task_type_7',
data)
/**
* 应用软件推广
*/
export const commit_town_master_task_type_8API = (data) => oahttp.post('/task/commit_town_master_task_type_8',
data) data)

View File

@ -145,11 +145,10 @@
"village_task_type_7", "village_task_type_7",
], // /subpkg/townTask/townTask 1 ], // /subpkg/townTask/townTask 1
navToVillageListA: [ navToVillageListA: [
"town_task_type_master_2",
"town_task_type_master_4", "town_task_type_master_4",
"town_task_type_master_5", "town_task_type_master_5",
"town_task_type_master_7", // "",
"town_task_type_master_8"
], // /subpkg/townTask/townTask 1 ], // /subpkg/townTask/townTask 1
navToList: ["village_task_type_4", "village_task_type_5", "town_task_type_6", "town_task_type_master_6", ], navToList: ["village_task_type_4", "village_task_type_5", "town_task_type_6", "town_task_type_master_6", ],
@ -243,9 +242,24 @@
case "village_task_type_8": case "village_task_type_8":
this.navTo(`/subpkg/townTask/villageTask6?task_id=${this.$props.datas?.id}`); this.navTo(`/subpkg/townTask/villageTask6?task_id=${this.$props.datas?.id}`);
break; break;
case "town_task_type_master_2":
this.navTo(
`/subpkg/townTask/villageTask6?task_id=${this.$props.datas?.id}&type_value=${this.$props.datas.task_type_value}`
);
break;
case "town_task_type_master_3": case "town_task_type_master_3":
this.navTo(`/subpkg/townTask/gatherRecords?task_id=${this.$props.datas?.id}`); this.navTo(`/subpkg/townTask/gatherRecords?task_id=${this.$props.datas?.id}`);
break; break;
case "town_task_type_master_7":
this.navTo(
`/subpkg/townTask/villageTask6?task_id=${this.$props.datas?.id}&type_value=${this.$props.datas.task_type_value}`
);
break;
case "town_task_type_master_8":
this.navTo(
`/subpkg/townTask/villageTask6?task_id=${this.$props.datas?.id}&type_value=${this.$props.datas.task_type_value}`
);
break;
default: default:
this.navTo(''); this.navTo('');
break; break;

View File

@ -5,7 +5,7 @@
lineWidth='100' inactiveStyle='color:white' activeStyle="color:white"></u-tabs> lineWidth='100' inactiveStyle='color:white' activeStyle="color:white"></u-tabs>
<view class="" style="height: 20rpx;"> <view class="" style="height: 20rpx;">
</view> </view>
<view class="card" v-for="(item,index) in gatherList" :key="item.id" v-if="page==1&&item.planting" <view class="card" v-for="(item,index) in gatherList.planting" :key="item.id" v-if="page==1"
@click="navgo(`/subpkg/townTask/townGather?type=plant&task_id=${task_id}&index=${index}`)"> @click="navgo(`/subpkg/townTask/townGather?type=plant&task_id=${task_id}&index=${index}`)">
<view class="card_head"> <view class="card_head">
@ -18,14 +18,14 @@
</view> </view>
<view class="card_content"> <view class="card_content">
<view class="" style="margin-bottom: 20rpx;"> <view class="" style="margin-bottom: 20rpx;">
法人姓名: {{item.planting[0].entityName}} 法人姓名: {{item.entityName}}
</view> </view>
<view class=""> <view class="">
联系电话: {{item.planting[0].phone}} 联系电话: {{item.phone}}
</view> </view>
</view> </view>
</view> </view>
<view class="card" v-for="(item,index) in gatherList" :key="index" v-if="page==2&&item.supply" <view class="card" v-for="(item,index) in gatherList.supply" :key="index" v-if="page==2"
@click="navgo(`/subpkg/townTask/townGather?type=supply&task_id=${task_id}&index=${index}`)"> @click="navgo(`/subpkg/townTask/townGather?type=supply&task_id=${task_id}&index=${index}`)">
<view class="card_head"> <view class="card_head">
<view class=""> <view class="">
@ -37,10 +37,10 @@
</view> </view>
<view class="card_content"> <view class="card_content">
<view class="" style="margin-bottom: 20rpx;"> <view class="" style="margin-bottom: 20rpx;">
店主姓名: {{item.supply[0].storeName}} 店主姓名: {{item.storeName}}
</view> </view>
<view class=""> <view class="">
联系电话: {{item.supply[0].shopkeeperPhone}} 联系电话: {{item.shopkeeperPhone}}
</view> </view>
</view> </view>
</view> </view>
@ -72,7 +72,7 @@
data() { data() {
return { return {
show: false, show: false,
gatherList: [], gatherList: {},
page: 1, page: 1,
task_id: "", task_id: "",
tabLists: [{ tabLists: [{

View File

@ -381,6 +381,7 @@
taskId: "", taskId: "",
readonly: false, readonly: false,
landPlanList: ['自己养', '出租', '代养', '租更多地扩大养殖'], landPlanList: ['自己养', '出租', '代养', '租更多地扩大养殖'],
pas_Info: {},
breedingTypeList: [{ breedingTypeList: [{
id: 1, id: 1,
name: "水产" name: "水产"
@ -460,23 +461,37 @@
} }
}, },
onLoad(option) { onLoad(option) {
this.taskId = option.task_id this.taskId = option.task_id
if (option.type == 'supply') this.page = 0 if (option.type == 'supply') this.page = 0
if (option.index) {
townMasterTask3List({ townMasterTask3List({
id: option.task_id id: option.task_id
}).then(res => { }).then(res => {
this.pas_Info = res.data.template_info.extend.purchase_sales_info
if (option.index) {
this.readonly = true this.readonly = true
this.flag = true this.flag = true
console.log(option, 6464)
if (option.type == 'supply') { if (option.type == 'supply') {
this.formData1 = res.data.template_info.extend.purchase_sales_info[option.index]?.supply[0] this.formData1 = this.pas_Info.supply[option.index]
} else { } else {
this.formData = res.data.template_info.extend.purchase_sales_info[option.index]?.planting[ this.formData = this.pas_Info.planting[option.index]
0]
} }
}
// if (option.type == 'supply') {
// this.formData1 = res.data.template_info.extend.purchase_sales_info[option.index]?.supply[0]
// } else {
// this.formData = res.data.template_info.extend.purchase_sales_info[option.index]?.planting[
// 0]
// }
})
})
}
// } // }
this.flag = true this.flag = true
@ -580,26 +595,20 @@
this.formData[data.value] = e.detail.value; this.formData[data.value] = e.detail.value;
}, },
async commit() { async commit() {
if (this.page) { if (this.page) {
this.pas_Info.planting.push(this.formData)
await townMasterTask3Commit({ await townMasterTask3Commit({
id: Number(this.taskId), id: Number(this.taskId),
purchase_sales_info: { purchase_sales_info: this.pas_Info
planting: [{
...this.formData
}],
}
}) })
} else { } else {
this.pas_Info.supply.push(this.formData1)
await townMasterTask3Commit({ await townMasterTask3Commit({
id: Number(this.taskId), id: Number(this.taskId),
purchase_sales_info: { purchase_sales_info: this.pas_Info
supply: [{
...this.formData1
}],
}
}) })
} }
Toast("操作成功") Toast("操作成功")

View File

@ -1,401 +1,444 @@
<template> <template>
<view style="padding-top: 28rpx;padding-bottom: 160rpx;"> <view style="padding-top: 28rpx;padding-bottom: 160rpx;">
<view class="card"> <view class="card">
<view class="title">任务名称: {{taskInfo.title}}</view> <view class="title">任务名称: {{taskInfo.title}}</view>
<view>{{taskInfo.content||''}}</view> <view>{{taskInfo.content||''}}</view>
</view> </view>
<view class="card"> <view class="card">
<view class="title">任务描述</view> <view class="title">任务描述</view>
<u-line style="margin: 14rpx 0;"></u-line> <u-line style="margin: 14rpx 0;"></u-line>
<view class="text">{{taskInfo.content}}</view> <view class="text">{{taskInfo.content}}</view>
</view> </view>
<view class="card" v-if="approve_status==3"> <view class="card" v-if="approve_status==3">
<view class="title" style="color: #FF7C32;">驳回提示</view> <view class="title" style="color: #FF7C32;">驳回提示</view>
<u-line style="margin: 14rpx 0;"></u-line> <u-line style="margin: 14rpx 0;"></u-line>
<view class="text" style="color: #FF7C32;">{{deny_notes}}</view> <view class="text" style="color: #FF7C32;">{{deny_notes}}</view>
<button v-if="other.is_commit==1" class="btn" @click="toUpdate">去修改</button> <button v-if="other.is_commit==1" class="btn" @click="toUpdate">去修改</button>
</view> </view>
<view class="card"> <view class="card">
<!-- 图片 --> <!-- 图片 -->
<view class="title" style="margin-bottom: 16rpx;">图片凭证</view> <view class="title" style="margin-bottom: 16rpx;">图片凭证</view>
<view class="file"> <view class="file">
<view class="file_item" v-for="(item, index) in fileList" :key="'file'+index"> <view class="file_item" v-for="(item, index) in fileList" :key="'file'+index">
<image class="image" :src="item" @click="priview(index)"></image> <image class="image" :src="item" @click="priview(index)"></image>
<image v-if="!other.is_commit" class="del" src="/static/icons/delete.png" @click.stop="deleteFile(index)"> <image v-if="!other.is_commit" class="del" src="/static/icons/delete.png"
</image> @click.stop="deleteFile(index)">
</view> </image>
<view v-if="!other.is_commit && this.fileList.length<9" class="file_btn" @click="chooseFile"> </view>
<image src="/static/icons/plus.png"></image> <view v-if="!other.is_commit && this.fileList.length<9" class="file_btn" @click="chooseFile">
</view> <image src="/static/icons/plus.png"></image>
<view class="file_empty" v-for="k in placeholderLength" :key="'empty'+k"></view> </view>
</view> <view class="file_empty" v-for="k in placeholderLength" :key="'empty'+k"></view>
</view>
</view>
<view class="card"> </view>
<!-- 视频 --> <view class="card">
<view class="title" style="margin-bottom: 16rpx;">视频凭证</view> <!-- 视频 -->
<view class="file"> <view class="title" style="margin-bottom: 16rpx;">视频凭证</view>
<view class="file_item" v-for="(item, index) in videoList" :key="'file_v'+index"> <view class="file">
<image class="image" src="/static/img/task/video_bg.png" @click="videoshow(item)"></image> <view class="file_item" v-for="(item, index) in videoList" :key="'file_v'+index">
<image v-if="!other.is_commit" class="del" src="/static/icons/delete.png" <image class="image" src="/static/img/task/video_bg.png" @click="videoshow(item)"></image>
@click.stop="deleteFile(index, 'video')"> <image v-if="!other.is_commit" class="del" src="/static/icons/delete.png"
</image> @click.stop="deleteFile(index, 'video')">
</view> </image>
<view v-if="!other.is_commit && this.videoList.length<9" class="file_btn" @click="chooseVideo"> </view>
<image src="/static/icons/plus.png"></image> <view v-if="!other.is_commit && this.videoList.length<9" class="file_btn" @click="chooseVideo">
</view> <image src="/static/icons/plus.png"></image>
<view class="file_empty" v-for="k in placeholderLengthVideo" :key="'empty_v'+k"></view> </view>
</view> <view class="file_empty" v-for="k in placeholderLengthVideo" :key="'empty_v'+k"></view>
</view> </view>
<view class="card"> </view>
<view class="title" style="margin-bottom: 16rpx;">补充说明</view> <view class="card">
<u--textarea :disabled="other.is_commit==1" v-model="note" placeholder="请输入内容" <view class="title" style="margin-bottom: 16rpx;">补充说明</view>
placeholderStyle="font-size: 22rpx;" style="font-size: 28rpx;background-color: #eee;min-height: 100px;" <u--textarea :disabled="other.is_commit==1" v-model="note" placeholder="请输入内容"
autoHeight maxlength="-1"></u--textarea> placeholderStyle="font-size: 22rpx;" style="font-size: 28rpx;background-color: #eee;min-height: 100px;"
</view> autoHeight maxlength="-1"></u--textarea>
<!-- <mybtn text="确认提交" @click="$u.throttle(submit, 1500)"></mybtn> --> </view>
<mybtn v-if="!other.is_commit" text="确认提交" @click="$u.throttle(submit, 1500)"></mybtn> <!-- <mybtn text="确认提交" @click="$u.throttle(submit, 1500)"></mybtn> -->
<mybtn v-else-if="taskInfo.status==3" text="已完成" :my_btn_disabled="true" @click="showToast('任务已完成')"></mybtn> <mybtn v-if="!other.is_commit" text="确认提交" @click="$u.throttle(submit, 1500)"></mybtn>
<mybtn v-else-if="taskInfo.status==5" text="已关闭" :my_btn_disabled="true" @click="showToast('任务已关闭!')"></mybtn> <mybtn v-else-if="taskInfo.status==3" text="已完成" :my_btn_disabled="true" @click="showToast('任务已完成')"></mybtn>
<mybtn v-else-if="approve_status==3" text="已驳回,请重新提交" @click="toUpdate"></mybtn> <mybtn v-else-if="taskInfo.status==5" text="已关闭" :my_btn_disabled="true" @click="showToast('任务已关闭!')"></mybtn>
<mybtn v-else text="已提交,请等待审核" :my_btn_disabled="true" @click="showToast('请耐心等待审核结果')"></mybtn> <mybtn v-else-if="approve_status==3" text="已驳回,请重新提交" @click="toUpdate"></mybtn>
<!--视频预览弹窗--> <mybtn v-else text="已提交,请等待审核" :my_btn_disabled="true" @click="showToast('请耐心等待审核结果')"></mybtn>
<view v-if="show_video" class="video-count"> <!--视频预览弹窗-->
<video id="myVideo" class="videoLink" autoplay loop muted show-mute-btn enable-play-gesture <view v-if="show_video" class="video-count">
vslide-gesture-in-fullscreen :src="video_src"></video> <video id="myVideo" class="videoLink" autoplay loop muted show-mute-btn enable-play-gesture
</view> vslide-gesture-in-fullscreen :src="video_src"></video>
<view class='mask' catchtouchmove="true" :hidden='show_video==false' @tap="show_video=false"></view> </view>
</view> <view class='mask' catchtouchmove="true" :hidden='show_video==false' @tap="show_video=false"></view>
</view>
</template> </template>
<script> <script>
import { import {
upLoadImage, upLoadImage,
VIDEO_URL VIDEO_URL
} from "@/api/file.js" } from "@/api/file.js"
import { import {
taskOtherTaskDetail, taskOtherTaskDetail,
taskOtherTaskCommit, taskOtherTaskCommit,
villageTask6Commit villageTask6Commit,
} from "@/api/task.js" commit_town_master_task_type_2API,
import { Toast } from "../../libs/uniApi"; commit_town_master_task_type_7API,
export default { commit_town_master_task_type_8API
data() {
return { } from "@/api/task.js"
task_id: -1, import {
taskInfo: {}, Toast
approve_status: 0, // 123 } from "../../libs/uniApi";
deny_notes: '', // export default {
other: { data() {
annex: [], // return {
is_commit: 0, // task_id: -1,
note: "", // taskInfo: {},
video_annex: [] // approve_status: 0, // 123
}, deny_notes: '', //
list1: [{ other: {
name: '图片', annex: [], //
}, { is_commit: 0, //
name: '视频', note: "", //
}], video_annex: [] //
current: 0, },
note: '', list1: [{
fileList: [], name: '图片',
videoList: [], }, {
video_src: '', name: '视频',
show_video: false }],
}; current: 0,
}, note: '',
onLoad(options) { fileList: [],
this.task_id = options.task_id; videoList: [],
this.initDetail(); video_src: '',
}, show_video: false,
computed: { type_value: ""
// };
placeholderLength() { },
if(this.fileList.length==9)return 0; onLoad(options) {
if (this.other.is_commit == 1) return this.fileList.length % 3 == 0 ? 0 : 3 - this.fileList.length % 3; this.task_id = options.task_id;
return (this.fileList.length + 1) % 3 == 0 ? 0 : 3 - (this.fileList.length + 1) % 3; this.type_value = options?.type_value || ""
}, this.initDetail();
placeholderLengthVideo() { },
if(this.videoList.length==9)return 0; computed: {
if (this.other.is_commit == 1) return this.videoList.length % 3 == 0 ? 0 : 3 - this.videoList.length % 3; //
return (this.videoList.length + 1) % 3 == 0 ? 0 : 3 - (this.videoList.length + 1) % 3; placeholderLength() {
}, if (this.fileList.length == 9) return 0;
}, if (this.other.is_commit == 1) return this.fileList.length % 3 == 0 ? 0 : 3 - this.fileList.length % 3;
methods: { return (this.fileList.length + 1) % 3 == 0 ? 0 : 3 - (this.fileList.length + 1) % 3;
// },
initDetail() { placeholderLengthVideo() {
taskOtherTaskDetail({ id: this.task_id }).then((res) => { if (this.videoList.length == 9) return 0;
this.taskInfo = res.data; if (this.other.is_commit == 1) return this.videoList.length % 3 == 0 ? 0 : 3 - this.videoList.length % 3;
this.other = JSON.parse(JSON.stringify(res.data?.extend?.other||{})); // return (this.videoList.length + 1) % 3 == 0 ? 0 : 3 - (this.videoList.length + 1) % 3;
this.approve_status = res.data?.approve_status; },
this.deny_notes = res.data?.deny_notes; },
res.data?.extend?.other?.note ? this.note = res.data?.extend?.other?.note : null; methods: {
res.data?.extend?.other?.annex ? this.fileList = res.data?.extend?.other?.annex : null; //
res.data?.extend?.other?.video_annex ? this.videoList = res.data?.extend?.other?.video_annex : null; initDetail() {
// this.other.is_commit = 0; taskOtherTaskDetail({
}) id: this.task_id
}, }).then((res) => {
// this.taskInfo = res.data;
toUpdate() { this.other = JSON.parse(JSON.stringify(res.data?.extend?.other || {})); //
this.other.is_commit = 0; this.approve_status = res.data?.approve_status;
}, this.deny_notes = res.data?.deny_notes;
// , true res.data?.extend?.other?.note ? this.note = res.data?.extend?.other?.note : null;
isReject(){ res.data?.extend?.other?.annex ? this.fileList = res.data?.extend?.other?.annex : null;
if (this.approve_status == 3) { // res.data?.extend?.other?.video_annex ? this.videoList = res.data?.extend?.other?.video_annex :
let other = { null;
note: this.note, // this.other.is_commit = 0;
annex: this.fileList, })
video_annex: this.videoList },
} //
let flag = true; toUpdate() {
if(JSON.stringify(other)==JSON.stringify({ this.other.is_commit = 0;
note: this.other.note, },
annex: this.other.annex, // , true
video_annex: this.other.video_annex isReject() {
})) flag = false; if (this.approve_status == 3) { //
if (!flag) { let other = {
Toast('未检测到您的修改,请修改后提交') note: this.note,
} annex: this.fileList,
return flag; video_annex: this.videoList
} }
else return true; let flag = true;
}, if (JSON.stringify(other) == JSON.stringify({
// note: this.other.note,
async submit() { annex: this.other.annex,
if(!this.isReject())return; // video_annex: this.other.video_annex
if (this.note.trim() == '') return Toast('详情描述不能为空'); })) flag = false;
await villageTask6Commit({ if (!flag) {
id: this.task_id, Toast('未检测到您的修改,请修改后提交')
note: this.note, }
annex: this.fileList, return flag;
video_annex: this.videoList } else return true;
}); },
this.other.is_commit = 1; //
this.approve_status = 1; async submit() {
Toast('提交成功'); if (!this.isReject()) return; //
this.$u.sleep(500).then(()=>{ if (this.note.trim() == '') return Toast('详情描述不能为空');
uni.navigateBack() if (this.type_value == 'town_task_type_master_2') {
}) await commit_town_master_task_type_2API({
}, id: this.task_id,
clickTabs(item) { note: this.note,
this.current = item.index; annex: this.fileList,
}, video_annex: this.videoList
showToast(str) { });
Toast(str)
}, }
chooseFile() { if (this.type_value == 'town_task_type_master_7') {
uni.chooseImage({ await commit_town_master_task_type_7API({
sizeType: ['compressed'], id: this.task_id,
success: async (res) => { note: this.note,
for (let item of res.tempFiles) { annex: this.fileList,
let ul = await upLoadImage({ video_annex: this.videoList
filePath: item.path, });
name: 'file'
}); }
this.fileList.push(ul.data.uri); if (this.type_value == 'town_task_type_master_8') {
}
} await commit_town_master_task_type_8API({
}); id: this.task_id,
}, note: this.note,
chooseVideo() { annex: this.fileList,
uni.chooseVideo({ video_annex: this.videoList
sourceType: ['album', 'camera'], // });
maxDuration: 60, //
success: (res) => { } else {
const video = res.tempFilePath; await villageTask6Commit({
let timer; id: this.task_id,
let title = '上传中'; note: this.note,
timer = setInterval(() => { annex: this.fileList,
uni.showLoading({ video_annex: this.videoList
title: title });
}) }
}, 1000)
//
let uploadTask = uni.uploadFile({
url: VIDEO_URL, this.other.is_commit = 1;
filePath: video, this.approve_status = 1;
name: 'file', Toast('提交成功');
header: { this.$u.sleep(500).then(() => {
token: this.$store.state.app.token uni.navigateBack()
}, })
success: (uploadFileRes) => { },
clearInterval(timer); clickTabs(item) {
uni.hideLoading(); this.current = item.index;
uploadFileRes.data = JSON.parse(uploadFileRes.data) },
if (uploadFileRes.data.code == 1) { showToast(str) {
this.videoList.push(uploadFileRes.data.data.uri) Toast(str)
} else Toast('网络错误') },
}, chooseFile() {
fail: (err) => { uni.chooseImage({
clearInterval(timer); sizeType: ['compressed'],
uni.hideLoading(); success: async (res) => {
Toast('网络错误') for (let item of res.tempFiles) {
} let ul = await upLoadImage({
}) filePath: item.path,
uploadTask.onProgressUpdate((fileRes) => { name: 'file'
title = `上传中...${fileRes.progress}%`; });
}) this.fileList.push(ul.data.uri);
}, }
fail() { }
Toast('用户取消上传') });
} },
}); chooseVideo() {
}, uni.chooseVideo({
priview(index) { sourceType: ['album', 'camera'], //
uni.previewImage({ maxDuration: 60, //
urls: this.fileList, success: (res) => {
current: index, const video = res.tempFilePath;
longPressActions: { let timer;
itemList: ['删除'], let title = '上传中';
itemColor: '#ff0000', timer = setInterval(() => {
success(e) { uni.showLoading({
if (e.tapIndex == 0) this.deleteFile(e.index); title: title
} })
}, }, 1000)
}) //
}, let uploadTask = uni.uploadFile({
/*查看视频*/ url: VIDEO_URL,
videoshow(src) { filePath: video,
this.video_src = src; name: 'file',
this.show_video = true; header: {
this.$nextTick(() => { token: this.$store.state.app.token
this.videoContext = uni.createVideoContext('myVideo', this); },
this.videoContext.play(); success: (uploadFileRes) => {
}) clearInterval(timer);
}, uni.hideLoading();
// uploadFileRes.data = JSON.parse(uploadFileRes.data)
deleteFile(index, type = 'image') { if (uploadFileRes.data.code == 1) {
if (type == 'image') this.fileList.splice(index, 1); this.videoList.push(uploadFileRes.data.data.uri)
else if (type == 'video') this.videoList.splice(index, 1); } else Toast('网络错误')
}, },
navTo(url) { fail: (err) => {
if (url) { clearInterval(timer);
uni.showLoading({ uni.hideLoading();
title: '加载中', Toast('网络错误')
mask: true }
}); })
uni.navigateTo({ uploadTask.onProgressUpdate((fileRes) => {
url: url, title = `上传中...${fileRes.progress}%`;
success() { })
uni.hideLoading() },
} fail() {
}) Toast('用户取消上传')
} else Toast('暂未开放') }
}, });
} },
} priview(index) {
uni.previewImage({
urls: this.fileList,
current: index,
longPressActions: {
itemList: ['删除'],
itemColor: '#ff0000',
success(e) {
if (e.tapIndex == 0) this.deleteFile(e.index);
}
},
})
},
/*查看视频*/
videoshow(src) {
this.video_src = src;
this.show_video = true;
this.$nextTick(() => {
this.videoContext = uni.createVideoContext('myVideo', this);
this.videoContext.play();
})
},
//
deleteFile(index, type = 'image') {
if (type == 'image') this.fileList.splice(index, 1);
else if (type == 'video') this.videoList.splice(index, 1);
},
navTo(url) {
if (url) {
uni.showLoading({
title: '加载中',
mask: true
});
uni.navigateTo({
url: url,
success() {
uni.hideLoading()
}
})
} else Toast('暂未开放')
},
}
}
</script> </script>
<style lang="scss"> <style lang="scss">
::v-deep .u-tabs__wrapper__nav__item__text { ::v-deep .u-tabs__wrapper__nav__item__text {
font-size: 28rpx !important; font-size: 28rpx !important;
} }
.video-count { .video-count {
position: fixed; position: fixed;
width: 600rpx; width: 600rpx;
height: 500rpx; height: 500rpx;
top: 50%; top: 50%;
left: 50%; left: 50%;
margin-left: -300rpx; margin-left: -300rpx;
margin-top: -250rpx; margin-top: -250rpx;
z-index: 100; z-index: 100;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
.videoLink { .videoLink {
width: 600rpx; width: 600rpx;
height: 500rpx; height: 500rpx;
} }
} }
.card { .card {
margin: 0 auto; margin: 0 auto;
margin-bottom: 28rpx; margin-bottom: 28rpx;
width: 694rpx; width: 694rpx;
background: #FFFFFF; background: #FFFFFF;
border-radius: 14rpx; border-radius: 14rpx;
padding: 28rpx; padding: 28rpx;
.title { .title {
font-size: 32rpx; font-size: 32rpx;
font-weight: bold; font-weight: bold;
color: #333333; color: #333333;
} }
.text { .text {
line-height: 50rpx; line-height: 50rpx;
} }
.btn { .btn {
background-color: $theme-oa-color; background-color: $theme-oa-color;
color: #FFFFFF; color: #FFFFFF;
font-size: 28rpx; font-size: 28rpx;
height: 60rpx; height: 60rpx;
line-height: 60rpx; line-height: 60rpx;
margin-top: 16rpx; margin-top: 16rpx;
} }
.file { .file {
display: flex; display: flex;
justify-content: left; justify-content: left;
flex-wrap: wrap; flex-wrap: wrap;
&_item { &_item {
flex-shrink: 0; flex-shrink: 0;
width: 200rpx; width: 200rpx;
height: 200rpx; height: 200rpx;
margin: 0 auto; margin: 0 auto;
margin-bottom: 16rpx; margin-bottom: 16rpx;
border: 2px solid #ccc; border: 2px solid #ccc;
border-radius: 10rpx; border-radius: 10rpx;
overflow: hidden; overflow: hidden;
position: relative; position: relative;
.image { .image {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.del { .del {
position: absolute; position: absolute;
height: 40rpx; height: 40rpx;
width: 40rpx; width: 40rpx;
top: 10rpx; top: 10rpx;
right: 10rpx; right: 10rpx;
} }
} }
&_btn { &_btn {
flex-shrink: 0; flex-shrink: 0;
width: 200rpx; width: 200rpx;
height: 200rpx; height: 200rpx;
margin: 0 auto; margin: 0 auto;
margin-bottom: 16rpx; margin-bottom: 16rpx;
border: 2px solid #ccc; border: 2px solid #ccc;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
flex-direction: column; flex-direction: column;
border-radius: 10rpx; border-radius: 10rpx;
image { image {
width: 100rpx; width: 100rpx;
height: 100rpx; height: 100rpx;
} }
} }
&_empty { &_empty {
flex-shrink: 0; flex-shrink: 0;
width: 200rpx; width: 200rpx;
height: 200rpx; height: 200rpx;
margin: 0 auto; margin: 0 auto;
margin-bottom: 16rpx; margin-bottom: 16rpx;
border: 2px solid transparent; border: 2px solid transparent;
} }
} }
} }
</style> </style>