Files
UNION_HUTB/target/classes/views/platform/hd/ca/mobileBox.html
T
2026-09-09 09:14:28 +08:00

640 lines
28 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</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.min.js"></script>
<script src="https://cdn.staticfile.org/jquery/1.11.1/jquery.min.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;
background-color: white;
}
html::-webkit-scrollbar {
display: none
}
[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-swipe v-if="boxData.files&&boxData.files.length>0" class="my-swipe" :autoplay="3000" indicator-color="white">
<van-swipe-item v-for="url in boxData.files">
<van-image
width="100%"
height="200px"
fit="cover"
:src="'${AppFileDomain!}/fileStreamPreview?id='+url.id"
></van-image>
</van-swipe-item>
</van-swipe>
<van-image
v-else
width="100%"
height="200px"
fit="cover"
src="***"
>
<template v-slot:error>封面图片</template>
</van-image>
</div>
<div v-if="active==0" class="page-v">
<div class="detail-v">
<div class="title-v p15">
<h3 :style="'color: '+boxData.hdcolor">活动介绍</h3>
<div class="van-hairline--top"></div>
<br/>
</div>
<div class="p15">
<div v-html="boxData.hdjs"></div>
</div>
<div class="title-v p15">
<br/>
<h3 :style="'color: '+boxData.hdcolor">参加人员</h3>
<div class="van-hairline--top"></div>
<br/>
</div>
<div class="p15">
<div v-html="boxData.hdcjry"></div>
</div>
<div class="title-v p15">
<br/>
<h3 :style="'color: '+boxData.hdcolor">奖励方式</h3>
<div class="van-hairline--top"></div>
<br/>
</div>
<div class="p15">
<div v-html="boxData.hdjlfs"></div>
</div>
<div class="title-v p15">
<br/>
<h3 :style="'color: '+boxData.hdcolor">活动内容</h3>
<div class="van-hairline--top"></div>
<br/>
</div>
<div class="p15">
<div v-html="boxData.hdnr"></div>
</div>
<div class="title-v p15">
<br/>
<h3 :style="'color: '+boxData.hdcolor">活动联系人</h3>
<div class="van-hairline--top"></div>
<br/>
</div>
<div class="p15" style="line-height:24pt;">
<div v-html="boxData.hdlxr"></div>
</div>
<div class="title-v p15" v-if="!isNull(boxData.hdother.replace(/<.*?>/g,''))">
<br/>
<h3 :style="'color: '+boxData.hdcolor">其他</h3>
<div class="van-hairline--top"></div>
<br/>
</div>
<div class="p15" style="line-height:24pt;" v-if="!isNull(boxData.hdother.replace(/<.*?>/g,''))">
<div v-html="boxData.hdother"></div>
</div>
</div>
</div>
<div v-if="active==1" class="page-v">
<div class="detail-v" style="margin-top: 0">
<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: '+boxData.hdcolor">
基本信息</h2>
</div>
<van-cell-group>
<van-field
@input="doInput"
required
v-model="formData.loginname"
name="工资号"
label="工资号"
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-field
required
v-model="formData.mobile"
name="znnl"
label="手机号码" type="tel"
placeholder="手机号码"
:rules="[{ required: true, message: '请填写手机号码' }]"
></van-field>
</van-cell-group>
<div style="width: 100%;padding: 16px 0;">
<h2 class="van-doc-demo-block__title" :style="'font-weight: bolder;color: '+boxData.hdcolor">
子女信息</h2>
</div>
<van-cell-group>
<van-field
required
v-model="formData.znxm"
name="znxm"
label="姓&emsp;&emsp;名"
placeholder="姓名" maxlength="30"
:rules="[{ required: true, message: '请填写子女姓名' }]"
></van-field>
<van-field
required
v-model="formData.znnl"
name="znnl"
label="年&emsp;&emsp;龄" type="digit"
placeholder="年龄"
:rules="[{ required: true, message: '请填写子女年龄' }]"
></van-field>
<van-field
readonly
clickable
name="znxb"
:value="formData.znxb"
label="性&emsp;&emsp;别"
placeholder="点击选择"
@click="znxbShowPicker = true"
required
:rules="[{ required: true, message: '请选择子女性别' }]"
></van-field>
<van-popup v-model="znxbShowPicker" position="bottom">
<van-picker
show-toolbar
:columns="['男','女']"
@confirm="function(val){formData.znxb=val;znxbShowPicker=false}"
@cancel="zngxShowPicker = false"
></van-picker>
</van-popup>
<van-field
readonly
clickable
name="zngx"
:value="formData.zngx"
label="子女关系"
placeholder="点击选择"
@click="zngxShowPicker = true"
required
:rules="[{ required: true, message: '请选择子女关系' }]"
></van-field>
<van-popup v-model="zngxShowPicker" position="bottom">
<van-picker
show-toolbar
:columns="zngxArr"
@confirm="function(val){formData.zngx=val;zngxShowPicker=false}"
@cancel="zngxShowPicker = false"
></van-picker>
</van-popup>
</van-cell-group>
</van-cell-group>
<div style="width: 100%;padding: 16px 0;">
<span class="van-doc-demo-block__title" :style="'font-weight: bolder;color: '+boxData.hdcolor">
作品信息</span>
<p class="van-doc-demo-block__title" style="margin-top: 5px;color: red">
(如同时参加以下多个活动,或有多个主题,请分别提交)</p>
</div>
<van-tabs v-model="formData.hdlb_i" :color="boxData.hdcolor" type="line">
<van-tab v-for="lb,i in boxData.lbs" :name="i" :title="lb.lname">
<div v-if="formData.hdlb_i==i">
<van-field style="padding-top: 30px" maxlength="15"
:rules="[{ required: true, message: '请填写作品主题' }]"
v-model="fd[i].zpzt"
required
show-word-limit
label="作品主题" placeholder="主题"></van-field>
<van-field
required
readonly
clickable
name="picker"
:value="fd[i].zplb_name"
label="作品类别"
placeholder="点击选择作品类别"
@click="showPicker = true"
:rules="[{ required: true, message: '请选择作品类别' }]"
></van-field>
<van-popup v-model="showPicker" position="bottom">
<van-picker
show-toolbar
value-key="zname"
:columns="lb.zplbs"
@confirm="function(val){fd[i].zplb=val.zid;fd[i].zplb_name=val.zname;showPicker=false}"
@cancel="showPicker = false"
></van-picker>
</van-popup>
<van-field type="textarea" show-word-limit maxlength="100" autosize
v-model="fd[i].zpms"
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 fd[i].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="fd[i].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="fd[i].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 fd[i].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="fd[i].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="fd[i].videoList"></van-uploader>
</template>
</van-field>
</div>
</van-tab>
</van-tabs>
<span style="padding-left: 15px;font-size: 12px;color: rgb(160,160,160)">(注意:图片最多5张,视频最大200M。)</span>
<div style="margin: 16px;">
<van-button round block :color="boxData.hdcolor" type="info"
native-type="submit">
提交
</van-button>
</div>
</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="boxData.hdcolor"
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 {
fd: [],
boxData: {},
zngxArr: ['父亲', '母亲', '第三代'],
znxbShowPicker: false,
zngxShowPicker: false,
showPicker: false,
showMsg: false,
percent: 0,
flag: true,
showPlan: true,
msg: '',
hdzplx: '1',
formData: {
hdlb_i: 0,
},
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) {
this.formData.hdzplx2 = value.zname;
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) {
}).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: '当前窗口宽度过大!部分区域显示会出现大小偏差'});
}
var wmhd_boxdata = localStorage.getItem("wmhd_boxdata")
if (wmhd_boxdata != undefined && wmhd_boxdata != null) {
this.boxData = JSON.parse(wmhd_boxdata)
localStorage.removeItem("wmhd_boxdata")
} else {
this.boxData = {
hdjs: '填写活动介绍',
hdcjry: '填写活动参加人员',
hdjlfs: '填写活动奖励方式',
hdnr: '填写活动内容',
hdlxr: '填写活动联系人',
hdother: '其他内容',
hdcolor: '#6A005F',
fileList: [],
lbs: [{lname: '活动类别1', zplbs: [{zname: '作品类别1'}, {zname: '作品类别2'}]}, {
lname: '活动类别2',
zplbs: [{zname: '作品类别1'}, {zname: '作品类别2'}]
}]
}
}
this.boxData.lbs.forEach(function (lb, idx) {
self.fd.push({
zpzt: '',
zpms: '',
zplb: '',
imgList: [],
videoList: [],
})
})
self.formData.hdlb_i = 0
}
})
</script>
</body>
</html>