first commit
This commit is contained in:
239
pages/index/DownloadIcon.vue
Normal file
239
pages/index/DownloadIcon.vue
Normal file
@@ -0,0 +1,239 @@
|
||||
<template>
|
||||
<div class="p-6 max-w-3xl mx-auto bg-white rounded-xl shadow-lg space-y-6">
|
||||
<h2 class="text-2xl font-bold text-gray-900">帮提服务图标生成器</h2>
|
||||
|
||||
<!-- Icon Preview -->
|
||||
<div class="flex justify-center">
|
||||
<div class="w-36 h-36 bg-gray-50 rounded-lg flex items-center justify-center">
|
||||
<svg
|
||||
ref="iconRef"
|
||||
:width="BASE_SIZE"
|
||||
:height="BASE_SIZE"
|
||||
:viewBox="`0 0 ${BASE_SIZE} ${BASE_SIZE}`"
|
||||
>
|
||||
<!-- Base layer with standard background color -->
|
||||
<rect
|
||||
:x="x"
|
||||
:y="y"
|
||||
:width="ICON_SIZE"
|
||||
:height="ICON_SIZE"
|
||||
:fill="selectedCombo.baseColor"
|
||||
:rx="CORNER_RADIUS"
|
||||
/>
|
||||
|
||||
<!-- Gradient layer -->
|
||||
<rect
|
||||
:x="x"
|
||||
:y="y"
|
||||
:width="ICON_SIZE"
|
||||
:height="ICON_SIZE"
|
||||
:fill="`url(#gradient-${selectedCombo.name})`"
|
||||
:rx="CORNER_RADIUS"
|
||||
/>
|
||||
|
||||
<!-- White expression layer with shadow -->
|
||||
<g :filter="`url(#shadow-${selectedCombo.name})`">
|
||||
<rect
|
||||
:x="x"
|
||||
:y="y"
|
||||
:width="ICON_SIZE"
|
||||
:height="ICON_SIZE"
|
||||
fill="white"
|
||||
:rx="CORNER_RADIUS"
|
||||
/>
|
||||
</g>
|
||||
|
||||
<!-- Service Icon - Two people interaction -->
|
||||
<g :transform="`translate(${x}, ${y}) scale(${SCALE})`">
|
||||
<!-- Standing Person -->
|
||||
<path
|
||||
d="M8 4C9.1 4 10 4.9 10 6C10 7.1 9.1 8 8 8C6.9 8 6 7.1 6 6C6 4.9 6.9 4 8 4ZM8 9C10.2 9 12 10.8 12 13V16H4V13C4 10.8 5.8 9 8 9Z"
|
||||
:fill="selectedCombo.shadowColor"
|
||||
/>
|
||||
|
||||
<!-- Person with Luggage -->
|
||||
<path
|
||||
d="M18 4C19.1 4 20 4.9 20 6C20 7.1 19.1 8 18 8C16.9 8 16 7.1 16 6C16 4.9 16.9 4 18 4ZM18 9C20.2 9 22 10.8 22 13V16H18V13C18 10.8 16.2 9 14 9C13.7 9 13.4 9 13.1 9.1C13.7 10 14 11 14 12V16H16V22H14V18H10V22H8V16H10V12C10 11 9.7 10 9.1 9.1C8.8 9 8.5 9 8.2 9"
|
||||
:fill="selectedCombo.shadowColor"
|
||||
/>
|
||||
|
||||
<!-- Luggage -->
|
||||
<path
|
||||
d="M18 13V20H14V13H18Z"
|
||||
:fill="selectedCombo.shadowColor"
|
||||
/>
|
||||
</g>
|
||||
|
||||
<!-- Gradient and shadow definitions -->
|
||||
<defs>
|
||||
<linearGradient
|
||||
:id="`gradient-${selectedCombo.name}`"
|
||||
x1="0"
|
||||
y1="0"
|
||||
x2="1"
|
||||
y2="1"
|
||||
>
|
||||
<stop offset="0%" :stop-color="selectedCombo.gradients[0]" />
|
||||
<stop offset="100%" :stop-color="selectedCombo.gradients[1]" />
|
||||
</linearGradient>
|
||||
<filter
|
||||
:id="`shadow-${selectedCombo.name}`"
|
||||
x="-20%"
|
||||
y="-20%"
|
||||
width="140%"
|
||||
height="140%"
|
||||
>
|
||||
<feDropShadow
|
||||
dx="0"
|
||||
:dy="SCALE * 0.5"
|
||||
:stdDeviation="SCALE * 0.5"
|
||||
:flood-color="selectedCombo.shadowColor"
|
||||
flood-opacity="0.5"
|
||||
/>
|
||||
</filter>
|
||||
</defs>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Color Combination Selection -->
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 mb-2">颜色组合</label>
|
||||
<div class="grid grid-cols-4 gap-4">
|
||||
<button
|
||||
v-for="(combo, index) in COLOR_COMBINATIONS"
|
||||
:key="index"
|
||||
@click="setSelectedCombo(combo)"
|
||||
class="h-16 relative rounded-lg overflow-hidden"
|
||||
:class="{ 'ring-2 ring-blue-500': selectedCombo === combo }"
|
||||
>
|
||||
<div class="absolute inset-0" :style="{ backgroundColor: combo.baseColor }" />
|
||||
<div
|
||||
class="absolute inset-0"
|
||||
:style="{
|
||||
background: `linear-gradient(135deg, ${combo.gradients[0]}, ${combo.gradients[1]})`
|
||||
}"
|
||||
/>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Download Button -->
|
||||
<div class="flex justify-center">
|
||||
<button
|
||||
@click="downloadIcon"
|
||||
class="inline-flex items-center px-4 py-2 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500"
|
||||
>
|
||||
<download-icon class="mr-2 h-5 w-5" />
|
||||
导出图标 (PNG 108x108)
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="text-sm text-gray-500">
|
||||
规格说明:
|
||||
- 尺寸:108x108px (3倍图)
|
||||
- 格式:PNG
|
||||
- 背景:透明
|
||||
- 大小:≤120kb
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ref, reactive, computed } from 'vue';
|
||||
import { Download as DownloadIcon } from 'lucide-vue-next';
|
||||
|
||||
|
||||
const COLOR_COMBINATIONS = [
|
||||
{
|
||||
name: '蓝色组合',
|
||||
baseColor: '#F5F8FD',
|
||||
gradients: ['#46ACFF', '#1E92F0'],
|
||||
shadowColor: '#1E92F0'
|
||||
},
|
||||
{
|
||||
name: '金色组合',
|
||||
baseColor: '#F5F8FD',
|
||||
gradients: ['#FFD157', '#F2B921'],
|
||||
shadowColor: '#F2B921'
|
||||
},
|
||||
{
|
||||
name: '绿色组合',
|
||||
baseColor: '#F5F8FD',
|
||||
gradients: ['#15CC96', '#15CC96'],
|
||||
shadowColor: '#15CC96'
|
||||
},
|
||||
{
|
||||
name: '青色组合',
|
||||
baseColor: '#F5F8FD',
|
||||
gradients: ['#30DFF3', '#43ABFF'],
|
||||
shadowColor: '#43ABFF'
|
||||
}
|
||||
];
|
||||
|
||||
export default {
|
||||
components: {
|
||||
DownloadIcon
|
||||
},
|
||||
setup() {
|
||||
const selectedCombo = ref(COLOR_COMBINATIONS[0]);
|
||||
const iconRef = ref(null);
|
||||
|
||||
// 严格按照36x36基础尺寸的3倍图
|
||||
const SCALE = 3;
|
||||
const BASE_SIZE = 36 * SCALE;
|
||||
const CORNER_RADIUS = 2 * SCALE;
|
||||
const ICON_SIZE = 28 * SCALE;
|
||||
|
||||
const x = computed(() => (BASE_SIZE - ICON_SIZE) / 2);
|
||||
const y = computed(() => (BASE_SIZE - ICON_SIZE) / 2);
|
||||
|
||||
const setSelectedCombo = (combo) => {
|
||||
selectedCombo.value = combo;
|
||||
};
|
||||
|
||||
const downloadIcon = () => {
|
||||
if (!iconRef.value) return;
|
||||
const svgData = new XMLSerializer().serializeToString(iconRef.value);
|
||||
const canvas = document.createElement('canvas');
|
||||
canvas.width = 108;
|
||||
canvas.height = 108;
|
||||
const ctx = canvas.getContext('2d');
|
||||
|
||||
const img = new Image();
|
||||
img.src = 'data:image/svg+xml;base64,' + btoa(svgData);
|
||||
|
||||
img.onload = () => {
|
||||
ctx.drawImage(img, 0, 0);
|
||||
|
||||
// 创建临时canvas进行大小优化
|
||||
const tempCanvas = document.createElement('canvas');
|
||||
tempCanvas.width = 108;
|
||||
tempCanvas.height = 108;
|
||||
const tempCtx = tempCanvas.getContext('2d');
|
||||
tempCtx.drawImage(canvas, 0, 0);
|
||||
|
||||
// 导出优化后的PNG
|
||||
const link = document.createElement('a');
|
||||
link.download = 'help-service-icon.png';
|
||||
link.href = tempCanvas.toDataURL('image/png', 0.8); // 优化压缩率以确保小于120kb
|
||||
link.click();
|
||||
};
|
||||
};
|
||||
|
||||
return {
|
||||
selectedCombo,
|
||||
iconRef,
|
||||
SCALE,
|
||||
BASE_SIZE,
|
||||
CORNER_RADIUS,
|
||||
ICON_SIZE,
|
||||
x,
|
||||
y,
|
||||
COLOR_COMBINATIONS,
|
||||
setSelectedCombo,
|
||||
downloadIcon
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
||||
344
pages/index/index.vue
Normal file
344
pages/index/index.vue
Normal file
@@ -0,0 +1,344 @@
|
||||
<template>
|
||||
|
||||
<view>
|
||||
|
||||
<view class="status_bar">
|
||||
<!-- 这里是状态栏 -->
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
<view class="service-container">
|
||||
|
||||
<view style="width:100%; position: relative;height: 290rpx;">
|
||||
<image src="/static/bg.png" mode="heightFix"
|
||||
style="overflow:hidden;height: 290rpx;border-radius: 15rpx;"></image>
|
||||
<text style="position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
color: #fff; display: block;
|
||||
font-size: 48rpx;
|
||||
font-weight: bold;
|
||||
white-space: nowrap;text-shadow: 0 2rpx 4rpx rgba(0,0,0,0.2);">一件事 快速响应</text>
|
||||
</view>
|
||||
|
||||
<!-- 主内容区 -->
|
||||
<view class="service-main">
|
||||
<!-- 服务分类区块 -->
|
||||
<view v-for="(section, index) in list" :key="index" class="service-section">
|
||||
<!-- 分类标题 -->
|
||||
<view class="section-header">
|
||||
<image class="section-icon" :src="section.img" mode="aspectFit" />
|
||||
<text class="section-title">{{ section.name }}</text>
|
||||
</view>
|
||||
|
||||
<!-- 服务项目网格 -->
|
||||
<view class="service-grid">
|
||||
<view v-for="(item, idx) in section.list" :key="idx" class="service-card"
|
||||
@click="navigateToService(item)" :class="index % 2 === 0 ? 'bg1' : 'bg2'">
|
||||
<text class="service-name">{{ item.name }} </text>
|
||||
<image class="service-icon" :src="item.icon" mode="aspectFit" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
<!-- 页脚信息 -->
|
||||
<view class="service-footer">
|
||||
<text class="footer-text">本服务由重庆火车北站地区综合管理局提供</text>
|
||||
<text class="footer-contacts">
|
||||
服务咨询热线:
|
||||
<text class="hotline" @click="callPhoneNumber">023-63051362</text>
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
list: [{
|
||||
name: "帮扶",
|
||||
img: "/static/img_t/axbf.svg",
|
||||
list: [{
|
||||
name: '寻人服务',
|
||||
type_code: 'xrfw',
|
||||
url: '/pages/index/xwqs',
|
||||
icon: '/static/img_t/xrfw.svg'
|
||||
}, {
|
||||
name: '寻物登记',
|
||||
type_code: 'xwqs',
|
||||
url: '/pages/index/xwqs',
|
||||
icon: '/static/img_t/swzl.svg'
|
||||
},
|
||||
{
|
||||
name: '母婴服务',
|
||||
type_code: 'myfw',
|
||||
url: '/pages/index/myfw',
|
||||
icon: '/static/img_t/myfw.svg'
|
||||
},
|
||||
// {
|
||||
// name: '临时医疗服务',
|
||||
// type_code: 'lsyljz',
|
||||
// url: '',
|
||||
// icon: '/static/img_t/lsyl.svg'
|
||||
// },
|
||||
// {
|
||||
// name: '人员摔倒',
|
||||
// type_code: 'rysdcl',
|
||||
// url: '',
|
||||
// icon: '/static/img_t/rysd.svg'
|
||||
// },
|
||||
{
|
||||
name: '老弱病残帮扶',
|
||||
type_code: 'lrbcybf',
|
||||
url: '',
|
||||
icon: '/static/img_t/bf.svg'
|
||||
},
|
||||
// {
|
||||
// name: '接送站服务',
|
||||
// type_code: 'tslksjzfw',
|
||||
// url: '',
|
||||
// icon: '/static/img_t/jsfw.svg'
|
||||
// },
|
||||
// {
|
||||
// name: '咨询服务',
|
||||
// type_code: 'zlzxqj',
|
||||
// url: '',
|
||||
// icon: '/static/img_t/zxfw.svg'
|
||||
// },
|
||||
// {
|
||||
// name: '志愿者服务',
|
||||
// type_code: 'zyzfw',
|
||||
// url: '/pages/index/myfw',
|
||||
// icon: '/static/img_t/zyzfw.svg'
|
||||
// },
|
||||
]
|
||||
},
|
||||
// {
|
||||
// name:"救助",
|
||||
// img:"/static/img_t/jz.svg",
|
||||
// list:[{
|
||||
// name: '困难救助',
|
||||
// type_code: 'knlkjz',
|
||||
// url: '',
|
||||
// icon: '/static/img_t/knjz.svg'
|
||||
// },
|
||||
// {
|
||||
// name: '流浪乞讨人员救助',
|
||||
// type_code: 'llqtryjz',
|
||||
// url: '',
|
||||
// icon: '/static/img_t/llqtryjz.svg'
|
||||
// },]
|
||||
// },
|
||||
{
|
||||
name: "问题反馈",
|
||||
img: "/static/img/fkgl.svg",
|
||||
list: [
|
||||
// {
|
||||
// name: '设施设备异常',
|
||||
// type_code: 'zqsssbwx',
|
||||
// url: '',
|
||||
// icon: '/static/img_t/sssbyc.svg'
|
||||
// },
|
||||
// {
|
||||
// name: '化粪池气体泄漏',
|
||||
// type_code: 'zqsssbwx',
|
||||
// url: '',
|
||||
// icon: '/static/img_t/hfcqtxl.svg'
|
||||
// },
|
||||
// {
|
||||
// name: '标识牌倾斜',
|
||||
// type_code: 'zqsssbwx',
|
||||
// url: '',
|
||||
// icon: '/static/img_t/bspqx.svg'
|
||||
// },
|
||||
// {
|
||||
// name: '商业投诉',
|
||||
// type_code: 'zqts',
|
||||
// url: '',
|
||||
// icon: '/static/img/syts.svg'
|
||||
// },
|
||||
{
|
||||
name: '投诉建议',
|
||||
type_code: 'zqts',
|
||||
url: '',
|
||||
icon: '/static/img/lkts.svg'
|
||||
}
|
||||
]
|
||||
},
|
||||
// {
|
||||
// name:"应急服务",
|
||||
// img:"/static/img_t/yjfw.svg",
|
||||
// list:[{
|
||||
// name: '人员意外伤亡',
|
||||
// type_code: 'ryywswnew',
|
||||
// url: '',
|
||||
// icon: '/static/img_t/ryywsw.svg'
|
||||
// }]
|
||||
// }
|
||||
]
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
// uni.request({
|
||||
// url:'/myapi',
|
||||
// // url: 'https://lk.cqbzzgj.cn/api/Index/apppost', //仅为示例,并非真实接口地址。
|
||||
// data: {
|
||||
// "action": 'Home/integrateAddVisitorCount',
|
||||
// },
|
||||
// method: "POST",
|
||||
// success: (res) => {
|
||||
|
||||
// }
|
||||
// });
|
||||
},
|
||||
|
||||
methods: {
|
||||
navigateToService(itme) {
|
||||
var url = ''
|
||||
// if(itme.url == ''){
|
||||
url = '/pages/index/post?code=' + itme.type_code + '&name=' + itme.name
|
||||
// }else{
|
||||
// url = itme.url+'?code='+itme.type_code+'&name='+itme.name
|
||||
// }
|
||||
|
||||
uni.navigateTo({
|
||||
url: url
|
||||
})
|
||||
},
|
||||
callPhoneNumber() {
|
||||
uni.makePhoneCall({
|
||||
phoneNumber: '023-63051362',
|
||||
success: () => {},
|
||||
fail: () => {}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.status_bar {
|
||||
height: var(--status-bar-height);
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* 容器样式 */
|
||||
.service-container {
|
||||
background: #fff;
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
/* 主内容区 */
|
||||
.service-main {
|
||||
flex: 1;
|
||||
padding: 24rpx 20rpx;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
/* 服务分类区块 */
|
||||
.service-section {
|
||||
border-radius: 16rpx;
|
||||
padding: 32rpx;
|
||||
}
|
||||
|
||||
/* 分类标题 */
|
||||
.section-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 32rpx;
|
||||
|
||||
.section-icon {
|
||||
width: 36rpx;
|
||||
height: 36px;
|
||||
margin-right: 16rpx;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
font-size: 36rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
/* 服务项目网格 */
|
||||
.service-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
gap: 24rpx;
|
||||
}
|
||||
|
||||
.bg1{
|
||||
background: rgba(254,164,0,0.1);
|
||||
}
|
||||
.bg2{
|
||||
background: rgba(87,191,254,0.1);
|
||||
}
|
||||
|
||||
/* 单个服务卡片 */
|
||||
.service-card {
|
||||
border-radius: 20rpx;
|
||||
padding: 28rpx;
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
transition: all 0.2s ease;
|
||||
height: 100rpx;
|
||||
justify-content: space-between;
|
||||
|
||||
&:active {
|
||||
transform: scale(0.98);
|
||||
background: #eee;
|
||||
}
|
||||
|
||||
.service-icon {
|
||||
width: 72rpx;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.service-name {
|
||||
font-size: 36rpx;
|
||||
color: #333;
|
||||
line-height: 1.4;
|
||||
// max-width: 160rpx;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
/* 页脚样式 */
|
||||
.service-footer {
|
||||
padding: 32rpx;
|
||||
// background: #fff;
|
||||
text-align: center;
|
||||
border-top: 1rpx solid #eee;
|
||||
|
||||
.footer-text {
|
||||
font-size: 24rpx;
|
||||
color: #B3B5B9;
|
||||
display: block;
|
||||
margin-bottom: 16rpx;
|
||||
}
|
||||
|
||||
.footer-contacts {
|
||||
font-size: 24rpx;
|
||||
color: #B3B5B9;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.hotline {
|
||||
color: #1E92F0;
|
||||
font-size: 24rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
40
pages/index/msg.vue
Normal file
40
pages/index/msg.vue
Normal file
@@ -0,0 +1,40 @@
|
||||
<template>
|
||||
<view class="service-footer">
|
||||
<view class="footer-text">
|
||||
抱歉,由于当前访问量激增,加载较慢,请您耐心等待。如有疑问,请致电重庆火车北站地区综合管理局
|
||||
<a class="hotline" href="tel:023-63051362">023-63051362</a>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
/* 页脚样式 */
|
||||
.service-footer {
|
||||
padding: 32rpx;
|
||||
// background: #fff;
|
||||
// text-align: center;
|
||||
// border-top: 1rpx solid #eee;
|
||||
|
||||
.footer-text {
|
||||
font-size: 24rpx;
|
||||
// color: #B3B5B9;
|
||||
display: block;
|
||||
// margin-bottom: 16rpx;
|
||||
}
|
||||
|
||||
.footer-contacts {
|
||||
font-size: 24rpx;
|
||||
color: #B3B5B9;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.hotline {
|
||||
color: #1E92F0;
|
||||
font-size: 36rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
9
pages/index/no.vue
Normal file
9
pages/index/no.vue
Normal file
@@ -0,0 +1,9 @@
|
||||
<template>
|
||||
<view>非法访问!</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
869
pages/index/post.vue
Normal file
869
pages/index/post.vue
Normal file
@@ -0,0 +1,869 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
|
||||
|
||||
<view class="cc" v-if="type_code !== 'xwqs' && type_code !== 'myfw'">
|
||||
<view class="layui-form-item form-item"
|
||||
v-if="type_code !== 'xrfw' && type_code !== 'lsyljz' &&type_code !== 'lrbcybf' && type_code !== 'zqts'">
|
||||
<text class="layui-form-text" v-if="type_code == 'zlzxqj'"><span class="clred">*</span>咨询问题</text>
|
||||
<text class="layui-form-text" v-else-if="type_code == 'zyzfw'"><span class="clred">*</span>服务事项</text>
|
||||
<text class="layui-form-text" v-else-if="type_code == 'knlkjz' || type_code == 'llqtryjz'"><span class="clred">*</span>救助事项</text>
|
||||
<text class="layui-form-text" v-else><span class="clred">*</span>事件标题</text>
|
||||
|
||||
<view class="layui-input-block">
|
||||
<input type="text" v-if="type_code == 'zlzxqj'" v-model="warningTitle" placeholder="请输入咨询问题" autocomplete="off">
|
||||
<input type="text" v-else-if="type_code == 'zyzfw'" v-model="warningTitle" placeholder="请输入服务事项" autocomplete="off">
|
||||
<input type="text"v-else-if="type_code == 'knlkjz' || type_code == 'llqtryjz'" v-model="warningTitle" placeholder="请输入救助事项" autocomplete="off">
|
||||
<input type="text" v-else v-model="warningTitle" placeholder="请输入事件标题" autocomplete="off">
|
||||
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
<view class="layui-form-item form-item"
|
||||
v-if="type_code === 'xrfw' || type_code == 'lsyljz' || type_code == 'lrbcybf' || type_code == 'zyzfw'|| type_code == 'knlkjz' || type_code == 'llqtryjz'">
|
||||
|
||||
<text class="layui-form-text"><span class="clred">{{ type_code == 'llqtryjz' ? '' : '*'}}</span>{{ type_code == 'xrfw' ? '被寻人姓名' : (type_code === 'llqtryjz' ? '流浪人员姓名' : '旅客姓名')}}</text>
|
||||
<view class="layui-input-block">
|
||||
<input type="text" v-model="passengerName"
|
||||
:placeholder="type_code == 'xrfw' ? '请输入被寻人姓名' : (type_code === 'llqtryjz' ? '请输入流浪人员姓名' : '请输入旅客姓名') " autocomplete="off">
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="layui-form-item form-item" v-if="type_code === 'tslksjzfw'">
|
||||
<text class="layui-form-text"><span class="clred">*</span>旅客姓名</text>
|
||||
<view class="layui-input-block">
|
||||
<input type="text" v-model="psgName" placeholder="请输入旅客姓名" autocomplete="off">
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
<view class="layui-form-item form-item"
|
||||
v-if="type_code === 'xrfw' || type_code == 'lsyljz' || type_code == 'lrbcybf' || type_code == 'knlkjz' || type_code == 'llqtryjz'">
|
||||
<text class="layui-form-text"><span class="clred"></span>{{type_code === 'xrfw' ? '被寻人性别' : (type_code === 'llqtryjz' ? '流浪人员性别' : '旅客性别')}} </text>
|
||||
<view class="layui-input-block">
|
||||
<picker @change="bindPickerChangePassengerSex" :value="passengerSexIndex"
|
||||
:range="passengerSexArray">
|
||||
<view class="uni-input">{{passengerSexIndex!== -1 ? passengerSexArray[passengerSexIndex] : '请选择被寻人性别'}}</view>
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="layui-form-item form-item"
|
||||
v-if="type_code === 'xrfw' || type_code == 'lsyljz' || type_code == 'lrbcybf' || type_code == 'tslksjzfw'|| type_code == 'zyzfw' || type_code == 'knlkjz' || type_code == 'llqtryjz'">
|
||||
<text class="layui-form-text"><span
|
||||
class="clred">{{ type_code == 'llqtryjz' ? '' : '*'}}</span>{{ type_code == 'xrfw' ? '联系人电话' : (type_code == 'llqtryjz' ? '流浪人员电话' : '旅客电话') }}</text>
|
||||
|
||||
|
||||
<view class="layui-input-block">
|
||||
<input type="number" v-model="contactPhone"
|
||||
:placeholder="type_code == 'xrfw' ? '请输入联系人电话' : (type_code == 'llqtryjz' ? '请输入流浪人员电话' : '请输入旅客电话') " autocomplete="off">
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="layui-form-item form-item"
|
||||
v-if="type_code === 'xrfw' || type_code == 'lsyljz' || type_code == 'lrbcybf'|| type_code == 'knlkjz' || type_code == 'llqtryjz'">
|
||||
<text class="layui-form-text"><span class="clred"></span>{{ type_code == 'llqtryjz' ? '联系人姓名' : '紧急联系人姓名'}}</text>
|
||||
<view class="layui-input-block">
|
||||
<input type="text" v-model="emergencyContact" :placeholder="type_code == 'llqtryjz' ? '请输入联系人姓名' : '请输入紧急联系人姓名' " autocomplete="off">
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="layui-form-item form-item"
|
||||
v-if="type_code === 'xrfw' || type_code == 'lsyljz' || type_code == 'lrbcybf' || type_code == 'knlkjz' || type_code == 'llqtryjz'">
|
||||
<text class="layui-form-text" v-if="type_code === 'llqtryjz'"><span class="clred">*</span>联系人电话</text>
|
||||
<text class="layui-form-text" v-else><span class="clred"></span>紧急联系人电话</text>
|
||||
<view class="layui-input-block">
|
||||
<input type="number" v-model="emergencyContactTel" :placeholder="type_code == 'llqtryjz' ? '请输入联系人电话' : '请输入紧急联系人电话'" autocomplete="off">
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="layui-form-item form-item" v-if="type_code == 'zyzfw'">
|
||||
<text class="layui-form-text"><span class="clred">*</span>预约时间</text>
|
||||
<view class="layui-input-block">
|
||||
<u-datetime-picker :show="show" v-model="value1" mode="datetime" @confirm="onConfirm"
|
||||
@cancel="onCancel"></u-datetime-picker>
|
||||
|
||||
<!-- <picker mode="date" :value="serviceTime" start="09:01" end="21:01" @change="bindServiceTimeChange"> -->
|
||||
<view class="uni-input" @click="show = true">{{serviceTime ? serviceTime : '请选择日期' }}</view>
|
||||
<!-- </picker> -->
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 已废弃 -->
|
||||
<!-- <view class="layui-form-item form-item"
|
||||
v-if="type_code == 'lsyljz' || type_code == 'knlkjz' || type_code == 'llqtryjz'">
|
||||
<text class="layui-form-text"><span class="clred">*</span>服务需求</text>
|
||||
<view class="layui-input-block">
|
||||
<input type="text" v-model="situationDescription" placeholder="请输入服务需求" autocomplete="off">
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<!-- <view class="layui-form-item form-item" v-if="type_code === 'lrbcybf' || type_code === 'zyzfw'">
|
||||
<text class="layui-form-text"> <span class="clred">*</span>服务需求</text>
|
||||
<view class="layui-input-block">
|
||||
<input type="text" v-model="serviceDesc" placeholder="请输入服务需求" autocomplete="off"> -->
|
||||
<!-- 未提供 -->
|
||||
<!-- <picker @change="bindPickerChangeServiceDesc" :value="serviceDescIndex"
|
||||
:range="serviceDescArray">
|
||||
<view class="uni-input">{{serviceDescArray[serviceDescIndex]}}</view>
|
||||
</picker> -->
|
||||
<!-- </view>
|
||||
</view> -->
|
||||
|
||||
<view class="layui-form-item form-item-1" v-if="type_code === 'tslksjzfw'">
|
||||
<text class="layui-form-text"><span class="clred">*</span>送站说明</text>
|
||||
<view class="layui-input-block">
|
||||
<textarea v-model="szComment" class="layui-textarea" id="" cols="30" rows="10"
|
||||
placeholder="请输入送站说明"></textarea>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="layui-form-item form-item" v-if="type_code === 'zlzxqj'">
|
||||
<text class="layui-form-text"> <span class="clred">*</span>即时咨询分类</text>
|
||||
<view class="layui-input-block">
|
||||
<picker @change="bindPickerChangeRealtimeFlag" :value="realtimeFlagIndex"
|
||||
:range="realtimeFlagArray">
|
||||
<view class="uni-input">{{realtimeFlagArray[realtimeFlagIndex]}}</view>
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
<view class="layui-form-item form-item" v-if="type_code === 'zlzxqj'">
|
||||
<text class="layui-form-text"> <span class="clred">*</span>问题分类</text>
|
||||
<view style="flex:1"></view>
|
||||
<view class="layui-input-block">
|
||||
<picker @change="bindPickerChangeQuestionType" :value="questionTypeIndex"
|
||||
:range="questionTypeArray">
|
||||
<view class="uni-input">{{questionTypeArray[questionTypeIndex]}}</view>
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="layui-form-item form-item-1" v-if="type_code === 'zlzxqj' && false">
|
||||
<text class="layui-form-text"><span class="clred">*</span>问题描述</text>
|
||||
<view class="layui-input-block">
|
||||
<textarea v-model="consultQuestion" class="layui-textarea textarea" id="" cols="30" rows="10"
|
||||
placeholder="请输入问题描述"></textarea>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="layui-form-item form-item" v-if="type_code === 'sssbwxwh_dk' ">
|
||||
<text class="layui-form-text"><span class="clred"></span>设施设备名称</text>
|
||||
<view class="layui-input-block">
|
||||
<input type="text" v-model="deviceName" placeholder="请输入设施设备名称" autocomplete="off">
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="layui-form-item form-item-1" v-if="type_code === 'sssbwxwh_dk' ">
|
||||
<text class="layui-form-text"><span class="clred"></span>设施设备位置描述</text>
|
||||
<view class="layui-input-block">
|
||||
<textarea v-model="deviceAreaDesc" class="layui-textarea" id="" cols="30" rows="10"
|
||||
placeholder="请输入设施设备位置描述"></textarea>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="layui-form-item form-item-1" v-if="type_code === 'sssbwxwh_dk' ">
|
||||
<text class="layui-form-text"><span class="clred"></span>设施设备问题描述</text>
|
||||
<view class="layui-input-block">
|
||||
<textarea v-model="deviceMonitorInfo" class="layui-textarea" id="" cols="30" rows="10"
|
||||
placeholder="请输入设施设备问题描述"></textarea>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="layui-form-item form-item-1">
|
||||
<text class="layui-form-text"><span class="clred">{{ type_code == 'llqtryjz' ? '' : '*'}}</span>{{type_code == 'zqts' ? '投诉建议' : '服务需求描述'}}</text>
|
||||
<view class="layui-input-block">
|
||||
<textarea v-model="warningRemark" class="layui-textarea" id="" cols="30" rows="10"
|
||||
:placeholder="type_code == 'zqts' ? '请输入投诉建议' : '请输入服务需求描述'"></textarea>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!--失物招领-->
|
||||
<view class="cc" v-if="type_code == 'xwqs'">
|
||||
<view class="layui-form-item form-item">
|
||||
<text class="layui-form-text"><span class="clred">*</span>物品名称</text>
|
||||
<view class="layui-input-block">
|
||||
<input type="text" v-model="propertyName" placeholder="请输入物品名称" autocomplete="off">
|
||||
</view>
|
||||
</view>
|
||||
<view class="layui-form-item form-item">
|
||||
<text class="layui-form-text"><span class="clred">*</span>物品特征</text>
|
||||
<view class="layui-input-block">
|
||||
<input type="text" v-model="propertyFeature" placeholder="请输入物品特征" autocomplete="off">
|
||||
</view>
|
||||
</view>
|
||||
<view class="layui-form-item form-item">
|
||||
<text class="layui-form-text"><span class="clred">*</span>物品类型</text>
|
||||
<view class="layui-input-block">
|
||||
<picker @change="bindPickerChangeTypeIndex" :value="typeIndex" :range="typeIndexArray">
|
||||
<view class="uni-input">{{typeIndex !== -1 ? typeIndexArray[typeIndex] : '请选择物品类型'}}</view>
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="layui-form-item form-item">
|
||||
<text class="layui-form-text"><span class="clred">*</span>遗失日期</text>
|
||||
<view class="layui-input-block">
|
||||
<picker mode="date" :value="lostTime" start="09:01" end="21:01" @change="bindTimeChange">
|
||||
<view class="uni-input">{{lostTime ? lostTime : '请选择日期' }}</view>
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="layui-form-item form-item">
|
||||
<text class="layui-form-text"><span class="clred">*</span>遗失地点</text>
|
||||
<view class="layui-input-block">
|
||||
<input type="text" v-model="lostRegion" placeholder="请输入遗失地点" autocomplete="off">
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="layui-form-item form-item">
|
||||
<text class="layui-form-text"><span class="clred">*</span>联系人</text>
|
||||
<view class="layui-input-block">
|
||||
<input type="text" v-model="contactPeople" placeholder="请输入联系人" autocomplete="off">
|
||||
</view>
|
||||
</view>
|
||||
<view class="layui-form-item form-item">
|
||||
<text class="layui-form-text"><span class="clred">*</span>联系方式</text>
|
||||
<view class="layui-input-block">
|
||||
<input type="number" v-model="contactPhone" placeholder="请输入联系方式" autocomplete="off">
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="layui-form-item form-item-1">
|
||||
<text class="layui-form-text"><span class="clred"></span>补充描述</text>
|
||||
<view class="layui-input-block">
|
||||
<textarea v-model="lostDesc" class="layui-textarea" id="" cols="30" rows="10"
|
||||
placeholder="请输入补充描述"></textarea>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!--母婴服务-->
|
||||
<view class="cc" v-if="type_code == 'myfw'">
|
||||
|
||||
<view class="layui-form-item form-item">
|
||||
<text class="layui-form-text"><span class="clred">*</span>姓名</text>
|
||||
<view class="layui-input-block">
|
||||
<input type="text" v-model="passenger_name" placeholder="请输入姓名" autocomplete="off">
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="layui-form-item form-item">
|
||||
<text class="layui-form-text"><span class="clred">*</span>是否本人</text>
|
||||
|
||||
|
||||
<view class="layui-input-block">
|
||||
|
||||
<picker @change="bindPickerChangeSelfFlag" :value="selfFlagIndex" :range="selfFlagArray">
|
||||
<view class="uni-input">{{selfFlagIndex !== -1 ? selfFlagArray[selfFlagIndex] : '请选择是否本人'}}</view>
|
||||
</picker>
|
||||
|
||||
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
|
||||
<view class="layui-form-item form-item">
|
||||
<text class="layui-form-text"><span class="clred">*</span>联系方式</text>
|
||||
<view class="layui-input-block">
|
||||
<input type="number" v-model="contact_phone" placeholder="请输入联系方式" autocomplete="off">
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="layui-form-item form-item">
|
||||
<text class="layui-form-text"><span class="clred"></span>有无同行</text>
|
||||
<view class="layui-input-block">
|
||||
|
||||
<picker @change="bindPickerChangeCompanionFlag" :value="companionFlagIndex"
|
||||
:range="companionFlagArray">
|
||||
<view class="uni-input">{{companionFlagIndex !== -1 ? companionFlagArray[companionFlagIndex] : '请选择有无同行'}}</view>
|
||||
</picker>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="layui-form-item form-item">
|
||||
<text class="layui-form-text"><span class="clred"></span>预约时间</text>
|
||||
<view class="layui-input-block">
|
||||
<u-datetime-picker :show="show" v-model="value1" mode="datetime" @confirm="onConfirm"
|
||||
@cancel="onCancel"></u-datetime-picker>
|
||||
|
||||
<!-- <picker mode="date" :value="serviceTime" start="09:01" end="21:01" @change="bindServiceTimeChange"> -->
|
||||
<view class="uni-input" @click="show = true">{{serviceTime ? serviceTime : '请选择日期' }}</view>
|
||||
<!-- </picker> -->
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="layui-form-item form-item">
|
||||
<text class="layui-form-text"><span class="clred"></span>同行人姓名电话</text>
|
||||
<view class="layui-input-block">
|
||||
<input type="text" v-model="companion_info" placeholder="请输入同行人姓名电话" autocomplete="off">
|
||||
</view>
|
||||
</view>
|
||||
<view class="layui-form-item form-item-1">
|
||||
<text class="layui-form-text"><span class="clred"></span>具体描述</text>
|
||||
<view class="layui-input-block">
|
||||
<textarea v-model="situation_description" class="layui-textarea" id="" cols="30" rows="10"
|
||||
placeholder="请输入具体描述(选填)"></textarea>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="form-item-1 cc">
|
||||
<text>
|
||||
<text
|
||||
class="clred">{{ ( type_code == 'llqtryjz' || type_code == 'xrfw' || type_code == 'lsyljz' || type_code == 'lrbcybf' || type_code == 'zyzfw') ? '*' : '' }}</text>
|
||||
上传图片</text>
|
||||
<view class="form-image" @click="chooseImage">
|
||||
<image class="ii" id="clickableImage" model="aspectFit" :src="imagedefault" v-if="!image"></image>
|
||||
<image clsaa="iii" :src="image" style="width: 180rpx; height: 180rpx;border-radius: 15rpx;" v-else>
|
||||
</image>
|
||||
<image :src="delimagedefault" model="aspectFit" class="del" v-show="delFalse" @click.stop="delImage">
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="tjsb">
|
||||
<button type="primary" @click="submit">提交上报</button>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
value1: Number(new Date()),
|
||||
type_code: '',
|
||||
title: '',
|
||||
passenger_name: '',
|
||||
contact_phone: '',
|
||||
companion_info: '',
|
||||
situation_description: '',
|
||||
passengerSexIndex: -1,
|
||||
passengerSex: '',
|
||||
passengerSexArray: ['男', '女', '保密'],
|
||||
realtimeFlagIndex: '',
|
||||
realtimeFlag: '',
|
||||
realtimeFlagArray: ['非即时类', '即时类'],
|
||||
questionTypeIndex: '',
|
||||
questionType: '',
|
||||
questionTypeArray: ['铁路相关问题咨询', '轨道相关问题咨询', '长途客运相关问题咨询', '公交相关问题咨询', '站内问询', '旅客预约送站服务', '站内其他服务问题咨询'],
|
||||
|
||||
|
||||
typeIndex: -1,
|
||||
typeIndexArray: ['箱包', '电子产品', '日化', '公交相关问题咨询', '电器', '证件', '药品', '饰品', '衣物', '鞋', '其它'],
|
||||
self_flag: '',
|
||||
selfFlagIndex: -1,
|
||||
selfFlagArray: ['是', '否'],
|
||||
companion_flag: '',
|
||||
companionFlagIndex: -1,
|
||||
companionFlagArray: ['有', '无'],
|
||||
lostTime: '',
|
||||
imagedefault: '/static/tpsc.svg',
|
||||
delFalse: false,
|
||||
file: [],
|
||||
image: '',
|
||||
propertyName: '',
|
||||
warningTitle: '',
|
||||
warningRemark: '',
|
||||
propertyFeature: '',
|
||||
lostRegion: '',
|
||||
contactPeople: '',
|
||||
contactPhone: '',
|
||||
lostDesc: '',
|
||||
passengerName: '',
|
||||
serviceTime: '',
|
||||
serviceDesc: '',
|
||||
delimagedefault: '/static/img_t/xxx.svg',
|
||||
serviceDescIndex: '',
|
||||
serviceDescArray: ['是', '否'],
|
||||
emergencyContactTel: '',
|
||||
emergencyContact: '',
|
||||
filePath: '',
|
||||
previewFilePath: ''
|
||||
}
|
||||
},
|
||||
|
||||
onLoad(query) {
|
||||
this.type_code = query.code
|
||||
uni.setNavigationBarTitle({
|
||||
title: query.name
|
||||
})
|
||||
this.title = query.name
|
||||
},
|
||||
computed: {
|
||||
|
||||
},
|
||||
methods: {
|
||||
bindPickerChangePassengerSex: function(e) {
|
||||
this.passengerSexIndex = Number(e.detail.value)
|
||||
},
|
||||
bindPickerChangeRealtimeFlag: function(e) {
|
||||
this.realtimeFlagIndex = e.detail.value
|
||||
},
|
||||
bindPickerChangeQuestionType: function(e) {
|
||||
this.questionTypeIndex = e.detail.value
|
||||
},
|
||||
bindPickerChangeTypeIndex: function(e) {
|
||||
this.typeIndex = Number(e.detail.value)
|
||||
},
|
||||
bindPickerChangeSelfFlag: function(e) {
|
||||
this.selfFlagIndex = Number(e.detail.value)
|
||||
this.self_flag = this.selfFlagArray[this.selfFlagIndex]
|
||||
},
|
||||
bindPickerChangeCompanionFlag: function(e) {
|
||||
this.companionFlagIndex = Number(e.detail.value)
|
||||
this.companion_flag = this.companionFlagArray[this.companionFlagIndex]
|
||||
},
|
||||
bindPickerChangeServiceDesc: function(e) {
|
||||
this.serviceDescIndex = e.detail.value
|
||||
this.serviceDesc = this.serviceDescArray[this.serviceDescIndex]
|
||||
},
|
||||
bindTimeChange: function(e) {
|
||||
this.lostTime = e.detail.value
|
||||
},
|
||||
bindServiceTimeChange: function(e) {
|
||||
this.serviceTime = e.detail.value
|
||||
console.log(this.serviceTime)
|
||||
},
|
||||
// 时间选择
|
||||
onConfirm(e) {
|
||||
this.serviceTime = this.currentTime(e.value)
|
||||
this.show = false
|
||||
},
|
||||
|
||||
onCancel(e) {
|
||||
this.show = false
|
||||
this.serviceTime = ''
|
||||
},
|
||||
currentTime(str) {
|
||||
const now = new Date();
|
||||
const year = now.getFullYear();
|
||||
const month = String(now.getMonth() + 1).padStart(2, '0'); // 月份是从0开始的
|
||||
const day = String(now.getDate()).padStart(2, '0');
|
||||
const hours = String(now.getHours()).padStart(2, '0');
|
||||
const minutes = String(now.getMinutes()).padStart(2, '0');
|
||||
const seconds = String(now.getSeconds()).padStart(2, '0');
|
||||
if (str) {
|
||||
return `${year}-${month}-${day} ${hours}:${minutes}`;
|
||||
} else {
|
||||
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
||||
}
|
||||
|
||||
},
|
||||
delImage(e) {
|
||||
// e.stopPropagation()
|
||||
this.imagedefault = '/static/tpsc.svg'
|
||||
this.delFalse = false
|
||||
this.image = ''
|
||||
this.file = []
|
||||
this.filePath = ''
|
||||
this.previewFilePath = ''
|
||||
},
|
||||
chooseImage() {
|
||||
uni.chooseImage({
|
||||
count: 1, // 默认9,设置图片的最大选择数
|
||||
sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
|
||||
sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
|
||||
success: (res) => {
|
||||
uni.showLoading({
|
||||
title: '上传中...'
|
||||
});
|
||||
// 返回选定照片的本地文件路径列表,tempFilePath可以作为img标签的src属性显示图片
|
||||
const tempFilePaths = res.tempFilePaths;
|
||||
// uni.previewImage({
|
||||
// current: tempFilePaths[0], // 当前显示图片的http链接
|
||||
// urls: tempFilePaths // 需要预览的图片http链接列表
|
||||
// });
|
||||
console.log('res', res.tempFiles[0])
|
||||
var filePath = res.tempFiles[0]
|
||||
console.log('filePath.path', filePath.path)
|
||||
uni.uploadFile({
|
||||
url: 'https://lk.cqbzzgj.cn/api/Index/apppost',
|
||||
filePath: filePath.path,
|
||||
name: 'file',
|
||||
formData: {
|
||||
action: 'Home/new_event_pic',
|
||||
fileType: 'image',
|
||||
reName: 'true',
|
||||
thumbnail: 'true'
|
||||
},
|
||||
success: (uploadFileRes) => {
|
||||
console.log('222')
|
||||
console.log('uploadFileRes', uploadFileRes.data)
|
||||
var tem = JSON.parse(uploadFileRes.data)
|
||||
if (tem.code != 200) {
|
||||
uni.showToast({
|
||||
title: '上传失败',
|
||||
icon: 'none'
|
||||
})
|
||||
|
||||
return
|
||||
} else {
|
||||
|
||||
this.image = tempFilePaths[0]
|
||||
this.delFalse = true
|
||||
this.file = tem.data
|
||||
|
||||
uni.showLoading({
|
||||
title: '上传成功'
|
||||
});
|
||||
}
|
||||
setTimeout(function() {
|
||||
uni.hideLoading();
|
||||
}, 1000);
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
});
|
||||
},
|
||||
verifyFile() {
|
||||
if (this.filePath == undefined || this.previewFilePath == undefined) {
|
||||
uni.showToast({
|
||||
title: '请上传图片',
|
||||
icon: 'none'
|
||||
})
|
||||
return false
|
||||
}
|
||||
return true
|
||||
},
|
||||
submit() {
|
||||
|
||||
var type_code = this.type_code
|
||||
var title = this.title
|
||||
var incidentTime = this.currentTime()
|
||||
this.filePath = this.file[0]
|
||||
this.previewFilePath = this.file[1]
|
||||
|
||||
if (type_code == 'myfw') {
|
||||
if (this.passenger_name == '' || this.contact_phone == '' || this.self_flag == '') {
|
||||
uni.showToast({
|
||||
title: '请填写完整信息',
|
||||
icon: 'none'
|
||||
})
|
||||
return false;
|
||||
}
|
||||
var attr = {
|
||||
"passenger_name": this.passenger_name,
|
||||
"contact_phone": this.contact_phone,
|
||||
"self_flag": this.self_flag == '' ? this.selfFlagArray[this.selfFlagIndex] : this.self_flag,
|
||||
"service_type": '',
|
||||
"passenger_type": '',
|
||||
"companion_flag": this.companion_flag == '' ? this.companionFlagArray[this
|
||||
.companionFlagIndex] : this.companion_flag,
|
||||
"companion_info": this.companion_info == '' ? this.companionFlagArray[this
|
||||
.companionFlagIndex] : this.companion_flag,
|
||||
"serviceTime": this.serviceTime,
|
||||
"situation_description": this.situation_description
|
||||
}
|
||||
var data = {
|
||||
"action": 'Home/new_event_runadd',
|
||||
"warningTitle": '母婴服务',
|
||||
"warningType": 2,
|
||||
"typeCode": 'myfw',
|
||||
"warningLevel": 4,
|
||||
"incidentTime": incidentTime,
|
||||
"incidentAddress": "",
|
||||
"warningRemark": '母婴服务',
|
||||
"incidentLong": "106.547507",
|
||||
"incidentLat": "29.609545",
|
||||
"regionCode": "CQBZ_DM",
|
||||
"filePath": this.filePath ? '/' + this.filePath : '',
|
||||
"previewFilePath": this.previewFilePath ? '/' + this.previewFilePath : '',
|
||||
"expandData": JSON.stringify(attr),
|
||||
"reportPerson": this.contact_phone
|
||||
}
|
||||
return this.toServer(data)
|
||||
|
||||
} else if (type_code == 'xwqs') {
|
||||
|
||||
if (this.propertyName == '' || this.lostTime == '' || this.contactPeople == '' ||
|
||||
this.propertyFeature == '' || this.lostRegion == '') {
|
||||
|
||||
uni.showToast({
|
||||
title: '请填写完整信息',
|
||||
icon: 'none'
|
||||
})
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
var attr = {
|
||||
"propertyName": this.propertyName,
|
||||
"propertyType": this.typeIndexArray[this.typeIndex],
|
||||
"lostTime": this.lostTime + ' ' + '00:00:00',
|
||||
"lostPlace": this.lostRegion,
|
||||
"receiveType": "自领",
|
||||
"contactPeople": this.contactPeople,
|
||||
"contactPhone": this.contactPhone,
|
||||
"propertyFeature": this.propertyFeature,
|
||||
"propertyDesc": this.lostDesc
|
||||
}
|
||||
|
||||
var data = {
|
||||
"action": 'Home/new_event_runadd',
|
||||
"warningTitle": "寻物启事" + '[' + this.propertyName + ']',
|
||||
"warningType": 2,
|
||||
"typeCode": "xwqs",
|
||||
"warningLevel": 4,
|
||||
"incidentTime": incidentTime,
|
||||
"incidentAddress": "南广场",
|
||||
"warningRemark": "寻物启事",
|
||||
"incidentLong": "106.547507",
|
||||
"incidentLat": "29.609545",
|
||||
"regionCode": "CQBZ_NGC_B1",
|
||||
"filePath": this.filePath ? '/' + this.filePath : '',
|
||||
"previewFilePath": this.previewFilePath ? '/' + this.previewFilePath : '',
|
||||
"expandData": JSON.stringify(attr),
|
||||
"reportPerson": this.contactPhone
|
||||
}
|
||||
return this.toServer(data)
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
if (type_code == 'xrfw') {
|
||||
if (!this.passengerName || !this.contactPhone || !this.warningRemark) {
|
||||
|
||||
uni.showToast({
|
||||
title: '请填写完整信息',
|
||||
icon: 'none'
|
||||
})
|
||||
|
||||
return
|
||||
}
|
||||
if(!this.verifyFile()){
|
||||
return false
|
||||
}
|
||||
attr = {
|
||||
passengerName: this.passengerName,
|
||||
passengerSex: this.passengerSexArray[this.passengerSexIndex],
|
||||
contactPhone: this.contactPhone,
|
||||
emergencyContact: this.emergencyContact,
|
||||
emergencyContactTel: this.emergencyContactTel,
|
||||
warningRemark: this.warningRemark
|
||||
}
|
||||
} else if (type_code == 'lsyljz') {
|
||||
if (!this.passengerName || !this.contactPhone || !this
|
||||
.warningRemark) {
|
||||
uni.showToast({
|
||||
title: '请填写完整信息',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
if(!this.verifyFile()){
|
||||
return false
|
||||
}
|
||||
attr = {
|
||||
passengerName: this.passengerName,
|
||||
passengerSex: this.passengerSexArray[this.passengerSexIndex],
|
||||
contactPhone: this.contactPhone,
|
||||
emergencyContact: this.emergencyContact,
|
||||
emergencyContactTel: this.emergencyContactTel,
|
||||
situationDescription: this.situationDescription,
|
||||
warningRemark: this.warningRemark
|
||||
}
|
||||
} else if (type_code == 'lrbcybf') {
|
||||
if (!this.passengerName || !this.contactPhone || !this
|
||||
.warningRemark) {
|
||||
uni.showToast({
|
||||
title: '请填写完整信息',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
if(!this.verifyFile()){
|
||||
return false
|
||||
}
|
||||
attr = {
|
||||
passengerName: this.passengerName,
|
||||
passengerSex: this.passengerSexArray[this.passengerSexIndex],
|
||||
contactPhone: this.contactPhone,
|
||||
emergencyContact: this.emergencyContact,
|
||||
emergencyContactTel: this.emergencyContactTel,
|
||||
serviceDesc: this.serviceDesc,
|
||||
warningRemark: this.warningRemark
|
||||
}
|
||||
} else if (type_code == 'zlzxqj') {
|
||||
if (!this.warningTitle || !this.warningRemark) {
|
||||
|
||||
uni.showToast({
|
||||
title: '请填写完整信息',
|
||||
icon: 'none'
|
||||
})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
attr = {
|
||||
realtimeFlag: this.realtimeFlagIndex + 1,
|
||||
realtimeFlagName: this.realtimeFlagArray[this.realtimeFlagIndex],
|
||||
questionType: this.questionTypeIndex + 1,
|
||||
questionTypeName: this.questionTypeArray[this.questionTypeIndex],
|
||||
warningRemark: this.warningRemark,
|
||||
}
|
||||
|
||||
} else if (type_code == 'zyzfw') {
|
||||
|
||||
if (!this.warningTitle || !this.passengerName || !this.contactPhone || !this.serviceTime || !this.warningRemark) {
|
||||
|
||||
uni.showToast({
|
||||
title: '请填写完整信息',
|
||||
icon: 'none'
|
||||
})
|
||||
|
||||
return
|
||||
}
|
||||
if(!this.verifyFile()){
|
||||
return false
|
||||
}
|
||||
attr = {
|
||||
warningTitle: this.warningTitle,
|
||||
passengerName: this.passengerName,
|
||||
contactPhone: this.contactPhone,
|
||||
serviceTime: this.serviceTime,
|
||||
serviceDesc: this.serviceDesc,
|
||||
serviceAddress: '重庆北站',
|
||||
warningRemark: this.warningRemark
|
||||
}
|
||||
} else if (type_code == 'knlkjz' ) {
|
||||
if (!this.warningTitle || !this.passengerName || !this.contactPhone || !
|
||||
this.warningRemark) {
|
||||
|
||||
uni.showToast({
|
||||
title: '请填写完整信息',
|
||||
icon: 'none'
|
||||
})
|
||||
|
||||
return
|
||||
}
|
||||
attr = {
|
||||
passengerName: this.passengerName,
|
||||
passengerSex: this.passengerSexArray[this.passengerSexIndex],
|
||||
contactPhone: this.contactPhone,
|
||||
emergencyContact: this.emergencyContact,
|
||||
emergencyContactTel: this.emergencyContactTel,
|
||||
situationDescription: this.situationDescription,
|
||||
}
|
||||
}else if (type_code == 'llqtryjz') {
|
||||
if (!this.warningTitle || !this.emergencyContactTel) {
|
||||
uni.showToast({
|
||||
title: '请填写完整信息',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
if(!this.verifyFile()){
|
||||
return false
|
||||
}
|
||||
attr = {
|
||||
passengerName: this.passengerName,
|
||||
passengerSex: this.passengerSexArray[this.passengerSexIndex],
|
||||
contactPhone: this.contactPhone,
|
||||
emergencyContact: this.emergencyContact,
|
||||
emergencyContactTel: this.emergencyContactTel,
|
||||
situationDescription: this.situationDescription,
|
||||
}
|
||||
} else if (type_code == 'zqts') {
|
||||
if (!this.warningRemark) {
|
||||
|
||||
uni.showToast({
|
||||
title: '请填写完整信息',
|
||||
icon: 'none'
|
||||
})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
attr = {
|
||||
warningRemark: this.warningRemark
|
||||
}
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '不存在服务类型',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
var data = {
|
||||
sourceTypeId: 4,
|
||||
warningLevel: 4,
|
||||
typeCode: type_code,
|
||||
incidentAddress: '',
|
||||
warningRemark: this.warningRemark ?? '',
|
||||
|
||||
influenceRange: '',
|
||||
takeStep: '',
|
||||
|
||||
"action": 'Home/integrateAddEvent',
|
||||
"warningTitle": this.warningTitle ? title + ":" + '[' + this.warningTitle + ']' : title,
|
||||
|
||||
"incidentLong": "106.547507",
|
||||
"incidentLat": "29.609545",
|
||||
"regionCode": "CQBZ_NGC_B1",
|
||||
|
||||
"filePath": this.filePath ? '/' + this.filePath : '',
|
||||
"previewFilePath": this.previewFilePath ? '/' + this.previewFilePath : '',
|
||||
|
||||
"expandData": JSON.stringify(attr),
|
||||
"reportPerson": this.contactPhone
|
||||
|
||||
}
|
||||
|
||||
return this.toServer(data)
|
||||
}
|
||||
},
|
||||
toServer(data) {
|
||||
|
||||
uni.showLoading({
|
||||
title: '上报中...'
|
||||
})
|
||||
uni.request({
|
||||
// url:'/myapi',
|
||||
url: 'https://lk.cqbzzgj.cn/api/Index/apppost', //仅为示例,并非真实接口地址。
|
||||
data: data,
|
||||
method: "POST",
|
||||
success: (res) => {
|
||||
|
||||
if (res.data.code == 200) {
|
||||
uni.showLoading({
|
||||
title: '上报成功'
|
||||
})
|
||||
setTimeout(function() {
|
||||
uni.hideLoading();
|
||||
uni.navigateBack()
|
||||
}, 3000);
|
||||
|
||||
} else {
|
||||
|
||||
uni.navigateTo({
|
||||
url: '/pages/index/msg'
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
@import '/static/css/default.css';
|
||||
</style>
|
||||
Reference in New Issue
Block a user