Files
UNION_HUTB/target/classes/views/platform/wmhd/mobile/wmMobile.html
T
2026-09-09 09:14:28 +08:00

829 lines
43 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- 在 head 标签中添加 meta 标签,并设置 viewport-fit=cover 值 -->
<meta name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover">
<title>“共抗疫情 巾帼展风采” 线上主题活动</title>
<!-- 引入样式文件 -->
<link rel="stylesheet" href="https://cdn.staticfile.org/vant/2.12.5/index.min.css">
<link rel="stylesheet" href="https://res.wx.qq.com/open/libs/weui/2.2.0/weui.min.css">
<!-- 引入 Vue 和 Vant 的 JS 文件 -->
<script src="https://cdn.staticfile.org/vue/2.6.9/vue.min.js"></script>
<script src="https://cdn.staticfile.org/vant/2.12.5/vant.js"></script>
<script src="https://cdn.staticfile.org/jquery/2.2.4/jquery.js"></script>
<script src="/assets/platform/plugins/moment/moment.min.js"></script>
</head>
<style>
html, body {
position: absolute;
top: 0;
left: 0;
right: 0;
margin: auto;
max-width: 600px;
}
[v-clock] {
display: none
}
html, body {
font-family: PingFang SC, 'Helvetica Neue', Arial, sans-serif;
}
.page-v {
width: 100%;
position: relative;
margin-bottom: 50px;
}
.detail-v {
margin-top: 15px;
padding-bottom: 30px;
}
.p15 {
padding: 0 15px;
}
.njuColor {
color: rgb(106, 0, 95);
}
.title-v {
margin: 10px 0;
}
.form-v {
/*margin-top: 20px;*/
}
.van-doc-demo-block__title {
margin: 0;
padding: 0 16px;
color: rgba(69, 90, 100, 0.6);
font-weight: normal;
font-size: 14px;
line-height: 16px;
}
.goods-card {
margin: 0;
background-color: white;
}
.delete-button {
height: 100%;
}
.van-swipe-cell__wrapper {
border: none;
}
</style>
<body>
<div v-clock id="app">
<div>
<van-image
width="100%"
height="200px"
fit="cover"
src="/wxpic/hdwmx.jpg"
/>
</div>
<div v-if="active==0" class="page-v">
<div class="detail-v">
<div class="title-v p15">
<h3 class="njuColor">活动介绍</h3>
<div class="van-hairline--top"></div>
<br/>
</div>
<div class="p15">
<p style="line-height:24pt; margin:0pt; orphans:0; text-align:justify; text-indent:0pt; widows:0">&emsp;&emsp;在全国上下众志成城、抗击疫情的关键时期,我们迎来了第110个“三八”国际劳动妇女节。在此,校工会和校女教职工委员会谨向辛勤耕耘、默默奉献的全校女教职工,特别是奋战在抗击疫情一线的广大女教职工,致以节日的问候、崇高的敬意和良好的祝愿!</p>
<p style="line-height:24pt; margin:0pt; orphans:0; text-align:justify; text-indent:0pt; widows:0">&emsp;&emsp;在这个特别的日子来临之际,校工会和校女教职工委员会决定开展“共抗疫情
巾帼展风采”线上主题活动,展现在抗疫期间我校广大女教职工助力抗疫、教学科研、守护家园的良好风貌,引领广大女教职工争做新时代奋斗者,激励广大女教职工坚定信心、共克时艰,为夺取疫情防控和实现学校发展目标双胜利贡献巾帼智慧和力量。</p>
</div>
<div class="title-v p15">
<br/>
<h3 class="njuColor">参加人员</h3>
<div class="van-hairline--top"></div>
<br/>
</div>
<div class="p15">
<p style="line-height:24pt; margin:0pt; orphans:0; text-align:justify; text-indent:0pt; widows:0">
&emsp;&emsp;我校在职女教职工。</p>
</div>
<div class="title-v p15">
<br/>
<h3 class="njuColor">奖励方式</h3>
<div class="van-hairline--top"></div>
<br/>
</div>
<div class="p15">
<p style="line-height:24pt; margin:0pt; orphans:0; text-align:justify; text-indent:0pt; widows:0">
&emsp;&emsp;参加活动的教职工在正式开学后可领取一至两份精美纪念品,欢迎大家积极参与。</p>
</div>
<div class="title-v p15">
<br/>
<h3 class="njuColor">活动内容</h3>
<div class="van-hairline--top"></div>
<br/>
</div>
<div class="p15">
<p style="line-height:24pt; margin:0pt; orphans:0; text-align:justify; text-indent:0pt; widows:0">
&emsp;&emsp;可自愿选择参加下列一项或两项活动,点击右下角“报名”进入活动页面提交相关材料。</p>
<div>
<p style="line-height:24pt; margin:0pt; orphans:0; text-align:justify; text-indent:0pt; widows:0">
<span style=" font-weight:bold">(一)巾帼担当篇——女教职工工作风采征集</span></p>
<p style="line-height:24pt; margin:0pt; orphans:0; text-align:justify; text-indent:20pt; widows:0">
展现我校女教职工在<b>防控疫情</b><b>教学科研</b><b>服务保障</b>等方面的风采风貌<,以文字、书画、照片、音视频等作品形式记录和呈现。
</p>
<p style="line-height:24pt; margin:0pt; orphans:0; text-align:justify; text-indent:20pt; widows:0">
文字材料文体不限,可选记叙、散文、诗歌等体裁,提交word版本;书画包括书法、国画、油画、水彩、钢笔画、数码绘画等形式,作品完成之后拍照上传;照片为JPEG格式,每张不小于2M;音视频不超过200M。
</p>
<p style="line-height:24pt; margin:0pt; orphans:0; text-align:justify; text-indent:0pt; widows:0">
<span style=" font-weight:bold">(二)巾帼温馨篇——女教职工居家风采征集</span></p>
<p style="line-height:24pt; margin:0pt; orphans:0; text-align:justify; text-indent:20pt; widows:0">
征集我校女教职工居家抗疫的风采风貌,<b>拍摄温馨生活、体验烹饪乐趣、玩转创意手工、书写一封家书……</b>
</p>
<p style="line-height:24pt; margin:0pt; orphans:0; text-align:justify; text-indent:20pt; widows:0">
“家书”提交word版本;其余三项活动均提交电子照片或视频,照片为JPEG格式,每张不小于2M,视频不超过200M。
</p>
<p style="line-height:24pt; margin:0pt; orphans:0; text-align:justify; text-indent:20pt; widows:0">
(若您的手机不支持文件上传,请用电脑浏览器打开活动地址https://zhgh.nju.edu.cn/wmMobile参与活动,或发送到校工会邮箱gonghui@nju.edu.cn。)
</p>
</div>
</div>
<div class="title-v p15">
<br/>
<h3 class="njuColor">活动联系人</h3>
<div class="van-hairline--top"></div>
<br/>
</div>
<div class="p15" style="line-height:24pt;">
<p style="text-indent: 20pt;">&emsp;菁:<a href="tel:13404167000">13404167000</a></p>
<p style="text-indent: 20pt;">&emsp;颖:<a href="tel:18951625046">18951625046</a></p>
<p style="text-indent: 20pt;">叶潇潇:<a href="tel:15951886628">15951886628</a></p>
</div>
<div class="title-v p15">
<br/>
<h3 class="njuColor">技术支持</h3>
<div class="van-hairline--top"></div>
<br/>
</div>
<div class="p15" style="line-height:24pt;">
&emsp;&emsp;上传作品过程中,如遇技术问题,请咨询:<br/>
&emsp;&emsp;&emsp;维:<a href="tel:18272022215">18272022215</a>
</div>
</div>
</div>
<div v-if="active==1" class="page-v">
<div class="detail-v" style="margin-top: 0">
<!-- <h3 style="padding: 5px 15px">战胜疫情,南京大学与您在一起</h3>-->
<!-- <span style="font-size: 12px;color: rgb(160,160,160)">报名开始时间:2020-01-01 09:01:01</span> <br/>-->
<!-- <span style="font-size: 12px;color: rgb(160,160,160)">报名结束时间:2020-01-01 09:01:01</span>-->
<div class="weui-msg" v-if="showMsg">
<div class="weui-msg__icon-area">
<van-circle
layer-color="rgb(240,240,240)"
color="#07c160"
stroke-width="50"
v-if="showPlan"
v-model="percent"
:rate="percent"
:clockwise="false"
:text="percent+' %'"
></van-circle>
<span v-if="showPlan==false">
<i v-if="flag" class="weui-icon-success weui-icon_msg"></i>
<i v-if="!flag" class="weui-icon-warn weui-icon_msg"></i>
</span>
</div>
<div class="weui-msg__text-area">
<h2 class="weui-msg__title" v-if="showPlan">上传中...</h2>
<h2 class="weui-msg__title" v-if="!showPlan&&flag">上传成功!</h2>
<h2 class="weui-msg__title" v-if="!showPlan&&!flag">上传失败!</h2>
<div v-html="msg"></div>
</div>
<div class="weui-msg__opr-area">
<p class="weui-btn-area">
<a v-if="!showPlan" @click="showMsg=false"
:class="flag?'weui-btn weui-btn_primary':'weui-btn weui-btn_warn'">{{flag?'确定':'返回'}}</a>
</p>
</div>
</div>
<div class="form-v" v-if="!showMsg">
<div style="width: 100%;padding: 16px 0;">
<h2 class="van-doc-demo-block__title" style="font-weight: bolder;color: rgb(106, 0, 95)">
基本信息</h2>
</div>
<van-cell-group>
<van-field
@input="doInput"
required
v-model="formData.loginname"
name="工资号"
label="工&emsp;&emsp;号"
placeholder="工资号"
:rules="[{ required: true, message: '请填写工资号' }]"
></van-field>
<van-field
disabled
v-model="formData.username"
name="姓名"
label="姓&emsp;&emsp;名"
:placeholder="getPlaceholder(formData,'username')"
></van-field>
<van-field
disabled
v-model="formData.unionname"
name="所属工会"
label="所属工会"
:placeholder="getPlaceholder(formData,'unionname')"
></van-field>
</van-cell-group>
<div style="width: 100%;padding: 16px 0;">
<span class="van-doc-demo-block__title" style="font-weight: bolder;color: rgb(106, 0, 95)">
作品信息</span>
<p class="van-doc-demo-block__title" style="margin-top: 5px;color: red">
(如同时参加以下两个活动,或有多个主题,请分别提交)</p>
</div>
<van-tabs v-model="hdzplx" color="rgb(106, 0, 95)" type="line">
<van-tab name="1" title="巾帼担当篇">
<van-form @submit="doSubmit">
<van-field style="padding-top: 30px" maxlength="15"
:rules="[{ required: true, message: '请填写作品主题' }]"
v-model="formData.hdsbzpzt"
required
show-word-limit
label="作品主题" placeholder="主题"></van-field>
<van-field
required
readonly
clickable
name="picker"
:value="formData.hdzplx2"
@confirm="onConfirm"
label="作品类别"
placeholder="点击选择作品类别"
@click="showPicker = true"
:rules="[{ required: true, message: '请选择作品类别' }]"
></van-field>
<van-popup v-model="showPicker" position="bottom">
<van-picker
show-toolbar
:columns="zplxArr2"
@confirm="onConfirm"
@cancel="showPicker = false"
></van-picker>
</van-popup>
<van-field type="textarea" show-word-limit maxlength="100" autosize
v-model="formData.hdsbzpms"
label="作品介绍"
placeholder="介绍"></van-field>
<van-field label="图&emsp;&emsp;片" disabled placeholder="(左滑删除单个文件)" style="border: none;"
input-align="right"></van-field>
<van-swipe-cell v-for="img,idx in formData.imgList" style="border: none;padding-top: 20px;">
<van-row style="padding: 0 15px">
<van-col :span="6">
<van-image
width="100%"
height="25vw"
fit="cover"
:src="img.content"
></van-image>
</van-col>
<van-col :span="18">
<van-field style="width: 100%;height: 25vm;padding-right: 0;" autosize
v-model="img.ms"
type="textarea" rows="2"
maxlength="50"
:show-word-limit="!isNull(img.ms)"
placeholder="请输入描述信息"></van-field>
</van-col>
</van-row>
<van-button
native-type="button"
@click="formData.imgList.splice(idx,1)"
slot="right"
square
text="删除"
type="danger"
class="delete-button"
/>
</van-swipe-cell>
<van-field>
<template #input>
<van-uploader multiple :preview-image="false" :before-read="beforeReadImg"
accept="image/*"
:max-count="5"
v-model="formData.imgList">
</van-uploader>
</template>
</van-field>
<van-field label-width="150" label="音/视频、文档" disabled style="border: none;"
input-align="right"></van-field>
<van-swipe-cell v-for="video,idx in formData.videoList"
style="border: none;padding-top: 20px;">
<van-row style="padding: 0 15px">
<van-col :span="6">
<van-image
width="100%"
height="25vw"
fit="cover"
src="1"
>
<template v-slot:error>
<i class="van-icon van-icon-description van-uploader__file-icon">
<!----></i>
<div class="van-uploader__file-name van-ellipsis">{{video.file.name}}
</div>
</template>
</van-image>
</van-col>
<van-col :span="18">
<van-field style="width: 100%;padding-right: 0;" autosize v-model="video.ms"
type="textarea" rows="2"
maxlength="50"
:show-word-limit="!isNull(video.ms)"
placeholder="请输入描述信息"></van-field>
</van-col>
</van-row>
<van-button
native-type="button"
@click="formData.videoList.splice(idx,1)"
slot="right"
square
text="删除"
type="danger"
class="delete-button"
></van-button>
</van-swipe-cell>
<van-field>
<template #input>
<van-uploader :preview-image="false" result-type="file"
@oversize="vue.$toast.fail('文件大小不能超过200M')"
:max-size="209715200"
:before-read="beforeReadVideo" accept="*" :max-count="2"
v-model="formData.videoList"></van-uploader>
</template>
</van-field>
<span style="padding-left: 15px;font-size: 12px;color: rgb(160,160,160)">(注意:图片最多5张,视频最大200M。若您的手机不支持文件上传,请用电脑浏览器打开活动地址https://zhgh.nju.edu.cn/wmMobile参与活动。)</span>
<div style="margin: 16px;">
<van-button round block color="rgb(106, 0, 95)" type="info" native-type="submit">
提交
</van-button>
</div>
</van-form>
</van-tab>
<van-tab name='2' title="巾帼温馨篇">
<van-form @submit="doSubmit">
<van-field style="padding-top: 30px" maxlength="15"
:rules="[{ required: true, message: '请填写作品主题' }]"
v-model="formData2.hdsbzpzt"
required
show-word-limit
label="作品主题" placeholder="主题"></van-field>
<van-field
required
readonly
clickable
name="picker"
:value="formData2.hdzplx2"
@confirm="onConfirm"
label="作品类别"
placeholder="点击选择作品类别"
@click="showPicker = true"
:rules="[{ required: true, message: '请选择作品类别' }]"
></van-field>
<van-popup v-model="showPicker" position="bottom">
<van-picker
show-toolbar
:columns="zplxArr"
@confirm="onConfirm"
@cancel="showPicker = false"
></van-picker>
</van-popup>
<van-field type="textarea" show-word-limit maxlength="100" autosize
v-model="formData2.hdsbzpms"
label="作品介绍"
placeholder="介绍"></van-field>
<van-field label="图&emsp;&emsp;片" disabled placeholder="(左滑删除单个文件)" style="border: none;"
input-align="right"></van-field>
<van-swipe-cell v-for="img,idx in formData2.imgList"
style="border: none;padding-top: 20px;">
<van-row style="padding: 0 15px">
<van-col :span="6">
<van-image
width="100%"
height="25vw"
fit="cover"
:src="img.content"
></van-image>
</van-col>
<van-col :span="18">
<van-field style="width: 100%;height: 25vm;padding-right: 0;" autosize
v-model="img.ms"
type="textarea" rows="2"
maxlength="50"
:show-word-limit="!isNull(img.ms)"
placeholder="请输入描述信息"></van-field>
</van-col>
</van-row>
<van-button
native-type="button"
@click="formData2.imgList.splice(idx,1)"
slot="right"
square
text="删除"
type="danger"
class="delete-button"
></van-button>
</van-swipe-cell>
<van-field>
<template #input>
<van-uploader multiple :preview-image="false" :before-read="beforeReadImg"
accept="image/*"
:max-count="5"
v-model="formData2.imgList">
</van-uploader>
</template>
</van-field>
<van-field label-width="150" label="音/视频、文档" disabled style="border: none;"
input-align="right"></van-field>
<van-swipe-cell v-for="video,idx in formData2.videoList"
style="border: none;padding-top: 20px;">
<van-row style="padding: 0 15px">
<van-col :span="6">
<van-image
width="100%"
height="25vw"
fit="cover"
src="1"
>
<template v-slot:error>
<i class="van-icon van-icon-description van-uploader__file-icon">
<!----></i>
<div class="van-uploader__file-name van-ellipsis">{{video.file.name}}
</div>
</template>
</van-image>
</van-col>
<van-col :span="18">
<van-field style="width: 100%;padding-right: 0;" autosize v-model="video.ms"
type="textarea" rows="2"
maxlength="50"
:show-word-limit="!isNull(video.ms)"
placeholder="请输入描述信息"></van-field>
</van-col>
</van-row>
<van-button
native-type="button"
@click="formData2.videoList.splice(idx,1)"
slot="right"
square
text="删除"
type="danger"
class="delete-button"
/>
</van-swipe-cell>
<van-field>
<template #input>
<van-uploader :preview-image="false" result-type="file"
@oversize="vue.$toast.fail('文件大小不能超过200M')"
:max-size="209715200"
:before-read="beforeReadVideo" accept="*" :max-count="2"
v-model="formData2.videoList"></van-uploader>
</template>
</van-field>
<span style="padding-left: 15px;font-size: 12px;color: rgb(160,160,160)">(注意:图片最多5张,视频最大200M。若您的手机不支持文件上传,请用电脑浏览器打开活动地址https://zhgh.nju.edu.cn/wmMobile参与活动。)</span>
<div style="margin: 16px;">
<van-button round block color="rgb(106, 0, 95)" type="info" native-type="submit">
提交
</van-button>
</div>
</van-form>
</van-tab>
</van-tabs>
</van-form>
</div>
</div>
</div>
<van-tabbar
style="max-width: 600px;position: fixed;left: 0;bottom: 0;right: 0;margin: auto"
v-model="active"
active-color="rgb(106,0,95)"
inactive-color="#000"
>
<van-tabbar-item icon="label-o">介绍</van-tabbar-item>
<van-tabbar-item icon="edit">报名</van-tabbar-item>
</van-tabbar>
<van-number-keyboard safe-area-inset-bottom/>
</div>
<script src="https://cdn.staticfile.org/js-cookie/2.2.1/js.cookie.min.js"></script>
<script>
var xhrOnProgress = function (fun) {
xhrOnProgress.onprogress = fun; //绑定监听
//使用闭包实现监听绑
return function () {
//通过$.ajaxSettings.xhr();获得XMLHttpRequest对象
var xhr = $.ajaxSettings.xhr();
//判断监听函数是否为函数
if (typeof xhrOnProgress.onprogress !== 'function')
return xhr;
//如果有监听函数并且xhr对象支持绑定时就把监听函数绑定上去
if (xhrOnProgress.onprogress && xhr.upload) {
xhr.upload.onprogress = xhrOnProgress.onprogress;
}
return xhr;
}
}
function getSuffix(filename) {
return /\.[^\.]+$/.exec(filename)
}
var vue = new Vue({
el: "#app",
data: function () {
return {
zplxObj: {'温馨生活': 1, '烹饪乐趣': 2, '创意手工': 3, '一封家书': 4},
zplxArr: ['温馨生活', '烹饪乐趣', '创意手工', '一封家书'],
zplxObj2: {'防控疫情': 1, '教学教研': 2, '服务保障': 3},
zplxArr2: ['防控疫情', '教学教研', '服务保障'],
showPicker: false,
showMsg: false,
percent: 0,
flag: true,
showPlan: true,
msg: '',
hdzplx: '1',
formData: {
hdsbzpzt: '',
hdsbzpms: '',
imgList: [],
videoList: [],
},
formData2: {
hdsbzpzt: '',
hdsbzpms: '',
imgList: [],
videoList: [],
},
active: 0,
isNull: function (val) {
if (val == null || val == undefined || val == '') {
return true
}
return false
},
imgtype: ['gif', 'jpg', 'png', 'jpeg'],
audiotype: ['mp3', 'wma', 'flac', 'wav', 'm4a', 'amr', 'au'],
doctype: ['doc', 'docx', 'txt'],
videotype: ['flv', 'swf', 'mkv', 'avi', 'rm', 'rmvb', 'wmv', 'mp4', 'mov', 'mpg', 'mpeg', 'quicktime'],
}
},
methods: {
onConfirm: function (value) {
if (vue.hdzplx == 1) {
this.formData.hdzplx2 = value;
} else {
this.formData2.hdzplx2 = value;
}
this.showPicker = false;
},
getPlaceholder: function (formData, key) {
if (vue.isNull(formData.userid)) {
return "输入工资号后自动匹配"
} else {
if (vue.isNull(formData[key])) {
return '暂无'
}
return formData[key]
}
},
doInput: function (val) {
vue.$set(vue.formData, 'username', undefined)
vue.$set(vue.formData, 'unionname', undefined)
vue.$set(vue.formData, 'userid', undefined)
$.get("/platform/hd/wm/wmMobile/queryUserByLoginname", {loginname: val}, function (data) {
if (data.code == 0) {
if (!vue.isNull(data.data)) {
vue.$set(vue.formData, 'userid', data.data.id)
vue.$set(vue.formData, 'username', data.data.username)
vue.$set(vue.formData, 'unionname', data.data.unionname)
}
}
})
},
doSubmit: function () {
if (vue.isNull(vue.formData.userid)) {
vue.$toast.fail("请正确填写您的工资号!")
return
}
if (vue.hdzplx == 1 && vue.formData.videoList.length == 0 && vue.formData.imgList.length == 0) {
vue.$toast.fail("请您选择要上传的作品!")
return
} else if (vue.hdzplx == 2 && vue.formData2.videoList.length == 0 && vue.formData2.imgList.length == 0) {
vue.$toast.fail("请您选择要上传的作品!")
return
}
var str = vue.hdzplx == 1 ? '巾帼担当篇' : '巾帼温馨篇'
vue.$dialog.confirm({
title: '提醒',
message: '您当前选择的是“' + str + '”,是否确认上传?上传后您将不能对已上传的作品进行更改'
}).then(function (value) {
setTimeout(function () {
// $.get("/platform/hd/wm/wmMobile/getSubCount", {userid: vue.formData.userid}, function (data) {
// if (data == true) {
vue.showMsg = true
vue.showPlan = true
vue.percent = 0
vue.msg = ''
var formdata = new FormData();
if (vue.hdzplx == 1) {
formdata.append("hdsbrid", vue.isNull(vue.formData.userid) ? '' : vue.formData.userid);
formdata.append("hdsbzpzt", vue.isNull(vue.formData.hdsbzpzt) ? '' : vue.formData.hdsbzpzt);
formdata.append("hdzplx", vue.isNull(vue.hdzplx) ? '' : vue.hdzplx);
formdata.append("hdzplx2", vue.isNull(vue.zplxObj2[vue.formData.hdzplx2]) ? '' : vue.zplxObj2[vue.formData.hdzplx2]);
formdata.append("hdsbzpms", vue.isNull(vue.formData.hdsbzpms) ? '' : vue.formData.hdsbzpms);
formdata.append("hdsbsj", moment().format('YYYY-MM-DD HH:mm:ss'));
vue.formData.imgList.forEach(function (val) {
formdata.append("files", val.file, vue.isNull(val.ms) ? val.file.name : val.ms + getSuffix(val.file.name));
});
vue.formData.videoList.forEach(function (val) {
formdata.append("files", val.file, vue.isNull(val.ms) ? val.file.name : val.ms + getSuffix(val.file.name));
});
} else if (vue.hdzplx == 2) {
formdata.append("hdsbrid", vue.isNull(vue.formData.userid) ? '' : vue.formData.userid);
formdata.append("hdsbzpzt", vue.isNull(vue.formData2.hdsbzpzt) ? '' : vue.formData2.hdsbzpzt);
formdata.append("hdzplx", vue.isNull(vue.hdzplx) ? '' : vue.hdzplx);
formdata.append("hdzplx2", vue.isNull(vue.zplxObj[vue.formData2.hdzplx2]) ? '' : vue.zplxObj[vue.formData2.hdzplx2]);
formdata.append("hdsbzpms", vue.isNull(vue.formData2.hdsbzpms) ? '' : vue.formData2.hdsbzpms);
formdata.append("hdsbsj", moment().format('YYYY-MM-DD HH:mm:ss'));
vue.formData2.imgList.forEach(function (val) {
formdata.append("files", val.file, vue.isNull(val.ms) ? val.file.name : val.ms + getSuffix(val.file.name));
});
vue.formData2.videoList.forEach(function (val) {
formdata.append("files", val.file, vue.isNull(val.ms) ? val.file.name : val.ms + getSuffix(val.file.name));
});
}
$.ajax({
url: "/platform/hd/wm/wmMobile/doSubmit",
type: "post",
data: formdata,
processData: false,
contentType: false,
xhr: xhrOnProgress(function (e) {
if (e.total == 0) {
vue.percent = 0
} else {
vue.percent = ((e.loaded / e.total) * 100).toFixed(0);//文件上传百分比
}
}),
success: function (data) {
if (data.code === 0) {
if (vue.hdzplx == 1) {
vue.formData.hdsbzpzt = ''
vue.formData.hdsbzpms = ''
vue.formData.hdzplx2 = ''
vue.formData.imgList = []
vue.formData.videoList = []
vue.formData.audioList = []
Cookies.remove('formData');
} else if (vue.hdzplx == 2) {
vue.formData2.hdsbzpzt = ''
vue.formData2.hdsbzpms = ''
vue.formData2.hdzplx2 = ''
vue.formData2.imgList = []
vue.formData2.videoList = []
vue.formData2.audioList = []
Cookies.remove('formData2');
}
vue.msg = '<p class="weui-msg__desc">我们已收到您的作品!<br/>非常感谢您的支持!</p>'
vue.flag = true
} else {
vue.msg = '<p class="weui-msg__desc">非常抱歉对您造成的不便!<br/>请联系系统管理员进行修复!</p>'
vue.flag = false
}
vue.showPlan = false
},
error: function (data) {
vue.msg = '<p class="weui-msg__desc">非常抱歉对您造成的不便!<br/>请联系系统管理员进行修复!</p>'
vue.flag = false
vue.showPlan = false
}
});
// } else {
// vue.$notify({type: 'danger', message: '您已上传过作品!请勿重复发提交'})
// }
// })
}, 500)
}).catch(function (reason) {
});
},
// 返回布尔值
beforeReadImg: function (file) {
return true;
},
// 返回布尔值
beforeReadVideo: function (file, detail) {
var suffix = getSuffix(file.name)
if (suffix == null) {
vue.$toast('获取不到后缀名!');
return false;
}
// var type = suffix.toString().substring(suffix.lastIndexOf(".") + 2)
// if (vue.videotype.indexOf(type) == -1 && vue.audiotype.indexOf(type) == -1 && vue.doctype.indexOf(type) == -1) {
// vue.$toast('不支持的文件类型!');
// return false;
// }
return true;
},
},
created: function () {
var self = this
if (window.innerWidth > 800) {
self.$notify({type: 'warning', message: '当前窗口宽度过大!部分区域显示会出现大小偏差'});
}
if (Cookies.get("formData") != undefined) {
parseData = JSON.parse(Cookies.get("formData"))
self.formData = {
userid: parseData.userid,
loginname: parseData.loginname,
username: parseData.username,
unionname: parseData.unionname,
hdsbzpzt: parseData.hdsbzpzt,
hdsbzpms: parseData.hdsbzpms,
hdzplx: parseData.hdzplx,
hdzplx2: parseData.hdzplx2,
imgList: [],
videoList: [],
}
Cookies.remove('formData');
}
if (Cookies.get("formData2") != undefined) {
parseData = JSON.parse(Cookies.get("formData2"))
self.formData2 = {
hdsbzpzt: parseData.hdsbzpzt,
hdsbzpms: parseData.hdsbzpms,
hdzplx: parseData.hdzplx,
hdzplx2: parseData.hdzplx2,
imgList: [],
videoList: [],
}
Cookies.remove('formData2');
}
setInterval(function () {
var data = {
userid: self.formData.userid,
loginname: self.formData.loginname,
username: self.formData.username,
unionname: self.formData.unionname,
hdsbzpzt: self.formData.hdsbzpzt,
hdsbzpms: self.formData.hdsbzpms,
hdzplx: self.formData.hdzplx,
hdzplx2: self.formData.hdzplx2,
}
var data2 = {
hdsbzpzt: self.formData2.hdsbzpzt,
hdsbzpms: self.formData2.hdsbzpms,
hdzplx: self.formData2.hdzplx,
hdzplx2: self.formData2.hdzplx2,
}
Cookies.set("formData", JSON.stringify(data))
Cookies.set("formData2", JSON.stringify(data2))
}, 1000)
}
})
</script>
</body>
</html>