@@ -58,10 +58,11 @@ | |||
<textarea class="textarea card-content" :value="form.appealContent" @input="headleInput" | |||
data-name="appealContent" maxlength="200" placeholder="请输入诉求内容,文字不超过200字"></textarea> | |||
<view class="mt-16"> | |||
<van-uploader :file-list="fileList" :deletable="true" :after-read="afterRead" max-count="9" | |||
@delete="imageDelete"> | |||
<van-icon name="/src/images/camera.png" size="80px" /> | |||
</van-uploader> | |||
<van-uploader :after-read="afterRead" :before-delete="beforeDelete" v-model="fileList" :deletable="true" | |||
max-count="9"> | |||
<van-icon name="/src/images/camera.png" size="80px" /> | |||
</van-uploader> | |||
<view class="mt-16 card-block">附件不超过9个,每个大小不超过1M</view> | |||
</view> | |||
</view> | |||
@@ -224,46 +225,26 @@ | |||
this[name] = Listname === 'enterpriseList' ? List[e.detail.value].id : List[e.detail.value].value | |||
}, | |||
// 清楚对应的image图片 | |||
imageDelete(event) { | |||
const { | |||
index | |||
} = event.detail; | |||
const Image = this.fileList; | |||
Image.splice(index, 1); | |||
this.fileList = Image | |||
}, | |||
beforeDelete(file, dateil) { | |||
this.appealEnclosure.splice(dateil.index, 1); | |||
this.fileList.splice(dateil.index, 1) | |||
}, | |||
// 上传图片 | |||
async afterRead(event) { | |||
console.log(event) | |||
const { | |||
file | |||
} = event; | |||
const res = await getApp().globalData.upload({ | |||
file | |||
}); | |||
if (res.code !== 0) { | |||
uni.showToast({ | |||
title: '上传图片失败', | |||
icon: 'none' | |||
}); | |||
return false; | |||
} | |||
const { | |||
fileList | |||
} = this; | |||
const { | |||
appealEnclosure | |||
} = this; | |||
const url = res.data; | |||
fileList.push({ | |||
url | |||
const { | |||
file | |||
} = event; | |||
const res = await getApp().globalData.upload({ file }); | |||
if (res.code !== 0) { | |||
uni.showToast({ | |||
title: '上传图片失败', | |||
icon: 'none' | |||
}); | |||
appealEnclosure.push(url); | |||
this.fileList = fileList, | |||
this.appealEnclosure = appealEnclosure | |||
}, | |||
return false; | |||
} | |||
this.appealEnclosure.push(res.data); | |||
}, | |||
// 输入框重新赋值 | |||
headleInput(event) { | |||
@@ -100,9 +100,9 @@ | |||
const { | |||
file | |||
} = event.detail; | |||
// const res = await app.globalData.upload({ | |||
// file | |||
// }); | |||
const res = await getApp().globalData.upload({ | |||
file | |||
}); | |||
if (res.code !== 0) { | |||
uni.showToast({ | |||
title: '上传图片失败', | |||
@@ -120,9 +120,9 @@ | |||
const { | |||
file | |||
} = event.detail; | |||
// const res = await app.globalData.upload({ | |||
// file | |||
// }); | |||
const res = await getApp().globalData.upload({ | |||
file | |||
}); | |||
if (res.code !== 0) { | |||
uni.showToast({ | |||
title: '上传图片失败', | |||
@@ -181,9 +181,9 @@ | |||
const { | |||
file | |||
} = event.detail; | |||
// const res = await app.globalData.upload({ | |||
// file | |||
// }); | |||
const res = await getApp().globalData.upload({ | |||
file | |||
}); | |||
if (res.code !== 0) { | |||
uni.showToast({ | |||
title: '上传图片失败', | |||
@@ -1,5 +1,5 @@ | |||
<template> | |||
<view style="height: 100%"> | |||
<view> | |||
<custom-nav-bar position="fixed" color="black" :left-text="options.type === 'reply' ? '回复' : '修改'" left-arrow /> | |||
<view class="form-list"> | |||
@@ -12,10 +12,10 @@ | |||
</view> | |||
<view class="form-item form-item-checkbox"> | |||
<view class="label-image"> | |||
<van-uploader @after-read="afterRead" :file-list="fileList" :deletable="true" max-count="9" | |||
@delete="imageDelete"> | |||
<image class="label-image-camera" src="/static/images/icon9.png"></image> | |||
</van-uploader> | |||
<van-uploader :after-read="afterRead" :before-delete="beforeDelete" v-model="fileList" :deletable="true" | |||
max-count="9"> | |||
<image class="label-image-camera" src="/static/images/icon9.png" ></image> | |||
</van-uploader> | |||
</view> | |||
<view class="label-image-msg">附件不超过9个</view> | |||
</view> | |||
@@ -42,7 +42,8 @@ export default { | |||
replyContent: '', | |||
replyImages: '' | |||
}, | |||
fileList: [] // 上传的图片 | |||
fileList: [], // 上传的图片 | |||
appealEnclosure:[] | |||
}; | |||
}, | |||
onLoad(options) { | |||
@@ -116,38 +117,25 @@ export default { | |||
} | |||
}, | |||
// 上传图片 | |||
async afterRead(event) { | |||
// 如果设置上传图片多选file则为数组 | |||
const { | |||
file | |||
} = event.detail; | |||
// const { | |||
// data = '' | |||
// } = await app.globalData.upload({ | |||
// file | |||
// }); | |||
const { | |||
fileList | |||
} = this; | |||
fileList.push({ | |||
url: data | |||
}); | |||
this.setData({ | |||
fileList | |||
}); | |||
}, | |||
} = event; | |||
// 删除图片 | |||
imageDelete(event) { | |||
const { | |||
index | |||
} = event.detail; | |||
const Image = this.fileList; | |||
Image.splice(index, 1); | |||
this.setData({ | |||
fileList: Image | |||
}); | |||
const res = await getApp().globalData.upload({ file }); | |||
if (res.code !== 0) { | |||
uni.showToast({ | |||
title: '上传图片失败', | |||
icon: 'none' | |||
}); | |||
return false; | |||
} | |||
// this.fileList.push({url:res.data}) | |||
this.appealEnclosure.push(res.data); | |||
}, | |||
beforeDelete(file, dateil) { | |||
this.appealEnclosure.splice(dateil.index, 1); | |||
this.fileList.splice(dateil.index, 1) | |||
}, | |||
headleInput(event) { | |||
@@ -161,11 +149,7 @@ export default { | |||
}, | |||
handSubmit() { | |||
this.setData({ | |||
'form.replyImages': this.fileList.map((item) => { | |||
return item.url; | |||
}) | |||
}); | |||
this.form.replyImages = this.appealEnclosure | |||
// 标识哪些数据为必填 | |||
if (!this.form.replyContent) { | |||
@@ -75,10 +75,10 @@ | |||
</view> | |||
<view class="view"> | |||
<view class="flex flex-v-center"> | |||
<image class="inquiry-icon" :src="replyInfo.doctorPhoto" /> | |||
<image class="inquiry-icon" v-if="replyInfo" :src="replyInfo.doctorPhoto" /> | |||
<view class="inquiry-label"> | |||
<text class="inquiry-title">{{ replyInfo.replyUserName }}</text> | |||
<text class="time">{{ toods.getDateTime(replyInfo.createTime) }}</text> | |||
<text class="inquiry-title" v-if="replyInfo">{{ replyInfo.replyUserName }}</text> | |||
<text class="time">{{ getDateTime(replyInfo.createTime) }}</text> | |||
</view> | |||
</view> | |||
<view class="inquiry-conent">{{ replyInfo.replyContent }}</view> | |||
@@ -99,7 +99,7 @@ | |||
</view> | |||
<view class="mt-28"> | |||
<view>{{ messsDetail.appraiseContent }}</view> | |||
<view class="detail-appraise-image" v-if="messsDetail.appraiseImage.length"> | |||
<view class="detail-appraise-image" v-if="messsDetail"> | |||
<image :src="item" v-for="(item, index) in messsDetail.appraiseImage" :key="index"></image> | |||
</view> | |||
</view> | |||
@@ -160,7 +160,7 @@ | |||
seekHelptype: [], | |||
show: false, | |||
userInfoCount: null, | |||
replyInfo: null, | |||
replyInfo: {}, | |||
t: { | |||
value: '', | |||
@@ -269,6 +269,7 @@ | |||
}, | |||
handrReply(event) { | |||
console.log(event) | |||
const { | |||
item, | |||
type | |||
@@ -296,12 +297,11 @@ | |||
}, | |||
async healedOrder(event, _dataset) { | |||
console.log(event) | |||
console.log(_dataset) | |||
/* ---处理dataset begin--- */ | |||
this.handleDataset(event, _dataset); | |||
// this.handleDataset(event, _dataset); | |||
/* ---处理dataset end--- */ | |||
const { | |||
item | |||
} = event.currentTarget.dataset; | |||
const res = await peopleApi.seekHelpApi({ | |||
id: item.id | |||
}); | |||
@@ -20,8 +20,10 @@ | |||
<view class="thenMesses-bg bg-orange"> | |||
<view class="hide thenMesses-title" style="padding-right: 100rpx">{{ item.title }}</view> | |||
<view class="absolute orange"> | |||
<text v-if="item.type + '' === t.value" v-for="(t, index1) in seekHelptype" | |||
:key="index1">{{ t.label }}</text> | |||
<block v-for="(t, index1) in seekHelptype" | |||
:key="index1"> | |||
<text v-if="item.type + '' === t.value" >{{ t.label }}</text> | |||
</block> | |||
</view> | |||
<view :class=" | |||
'thenMesses-hint ' + | |||
@@ -57,7 +59,7 @@ | |||
<rich-text class="rich-text" :nodes="item.content"></rich-text> | |||
</view> | |||
<view class="thenMesses-content-image" v-if="item.images.length"> | |||
<view class="thenMesses-content-image" v-if="item.images"> | |||
<image :src="it" v-for="(it, index1) in item.images" :key="index1"></image> | |||
</view> | |||
@@ -72,11 +74,11 @@ | |||
<image src="/static/images/ic-success.png" mode="aspectFill"></image> | |||
<text>{{ item.reply.replyUserName }}</text> | |||
</view> | |||
<view class="myAppeal-conent-block">{{ toods.getDateTime(item.reply.createTime, 0) }}</view> | |||
<view class="myAppeal-conent-block">{{ getDateTime(item.reply.createTime, 0) }}</view> | |||
</view> | |||
<view class="myAppeal-bg-conent flex flex-col"> | |||
<rich-text :nodes="item.reply.replyContent"></rich-text> | |||
<view class="inquiry-image" v-if="item.reply.replyImages.length"> | |||
<view class="inquiry-image" v-if="item.reply.replyImages"> | |||
<image class="image" :src="item" v-for="(item, index1) in item.reply.replyImages" :key="index1"> | |||
</image> | |||
</view> | |||
@@ -99,6 +101,7 @@ | |||
import * as publicApi from '@/api/publicApi'; | |||
import * as myApi from '@/api/myApi'; | |||
import utils from '@/utils/util.map' | |||
const partyMember = [{ | |||
icon: '/static/packages/my/image/order.png', | |||
name: '已接单', | |||
@@ -148,6 +151,9 @@ | |||
this.seekHelpPageApi(); | |||
}, | |||
methods: { | |||
getDateTime(tiem){ | |||
return utils.getDateTime(tiem) | |||
}, | |||
async seekHelpPageApi() { | |||
let params = { | |||
pageNo: this.pageNo, | |||
@@ -78,9 +78,9 @@ | |||
const { | |||
file | |||
} = event.detail; | |||
// const res = await app.globalData.upload({ | |||
// file | |||
// }); | |||
const res = await getApp().globalData.upload({ | |||
file | |||
}); | |||
if (res.code !== 0) { | |||
uni.showToast({ | |||
title: '上传图片失败', | |||
@@ -51,8 +51,8 @@ | |||
<textarea class="textarea-class" maxlength="500" @input="headleInput" data-name="content" placeholder="请输入内容" | |||
auto-height :value="form.content"></textarea> | |||
<view class="form-image"> | |||
<van-uploader :after-read="afterRead" :file-list="fileList" :deletable="true" max-count="9" | |||
@delete="imageDelete"> | |||
<van-uploader :after-read="afterRead" :before-delete="beforeDelete" v-model="fileList" :deletable="true" | |||
max-count="9"> | |||
<image class="camera" src="/static/images/icon9.png"></image> | |||
</van-uploader> | |||
</view> | |||
@@ -91,7 +91,8 @@ | |||
</view> | |||
<view class="form-treaty"> | |||
<van-checkbox label-disabled checked-color="red" v-model="checked" shape="square" use-icon-slot @change="onCheckbox"> | |||
<van-checkbox label-disabled checked-color="red" v-model="checked" shape="square" use-icon-slot | |||
@change="onCheckbox"> | |||
<!-- <image class="ic-check" | |||
:src="checked ? '/static/images/ic-radio1.png' : '/static/images/ic-radio.png'" /> --> | |||
<view class="checbox-text flex"> | |||
@@ -114,15 +115,8 @@ | |||
<van-popup v-model:show="isVisible" round position="bottom"> | |||
<van-cascader | |||
v-model="currentValue" | |||
title="请选择所在地区" | |||
:options="optionData" | |||
:field-names="defaultFieldNames" | |||
@finish="onCloseVisible" | |||
@close="onCloseVisible" | |||
@change="onChangeVisible" | |||
/> | |||
<van-cascader v-model="currentValue" title="请选择所在地区" :options="optionData" :field-names="defaultFieldNames" | |||
@finish="onCloseVisible" @close="onCloseVisible" @change="onChangeVisible" /> | |||
</van-popup> | |||
<!-- <wux-cascader :visible="isVisible" title="所在村/社区" :options="optionData" :safe-area-inset-bottom="true" | |||
@@ -131,459 +125,442 @@ | |||
</template> | |||
<script> | |||
const app = getApp().globalData | |||
console.log(app) | |||
// const { | |||
// publicApi, | |||
// peopleApi | |||
// } = app.globalData.api; | |||
import * as peopleApi from '@/api/peopleApi'; | |||
import * as publicApi from '@/api/publicApi'; | |||
export default { | |||
components: { | |||
}, | |||
data() { | |||
return { | |||
userInfoData: uni.getStorageSync('userInfoData'), | |||
// 上传图片所需 | |||
appealEnclosure: [], | |||
fileList: [], | |||
form: { | |||
address: '', | |||
posX: '', | |||
posY: '', | |||
content: '', | |||
title: '', | |||
mobile: '', | |||
orgId: 0, | |||
name: null, | |||
type: 1, | |||
showFlag: 1 | |||
}, | |||
checked: false, | |||
columns: [{ | |||
id: 1, | |||
type: '求助' | |||
}, | |||
{ | |||
id: 2, | |||
type: '帮助' | |||
} | |||
], | |||
agreeList: [{ | |||
label: '否', | |||
value: 0 | |||
}, | |||
{ | |||
label: '是', | |||
value: 1 | |||
} | |||
], | |||
// 级连选择器数据 start | |||
isVisible: false, | |||
FiledVisible:true, | |||
optionData: [], | |||
currentTile: '请选择', | |||
// 选择后的名称 | |||
currentValue: null, | |||
// 选择后的id | |||
// 级联选择默认显示字段 | |||
// 级连选择器数据 end | |||
defaultFieldNames: { | |||
text: 'name', | |||
value: 'id', | |||
children: 'children' | |||
}, | |||
isDialog: false, | |||
name: '', | |||
label: '' | |||
}; | |||
}, | |||
onLoad() { | |||
// this.form.address = app.globalData.config.locationInfo.name; | |||
// this.form.posX = app.globalData.config.locationInfo.latitude; | |||
// this.form.posY = app.globalData.config.locationInfo.longitude; | |||
const userInfoData = uni.getStorageSync('userInfoData'); | |||
this.isDialog = true | |||
this.form = this.form | |||
this.userInfoData = userInfoData | |||
this.deptTreeApi(); | |||
this.getTypeApi(); | |||
}, | |||
methods: { | |||
// 获取群众点单字典 | |||
async getTypeApi() { | |||
const res = await publicApi.getDictDataApi({ | |||
dictType: 'people_seek_help_type', | |||
pageNo: 1, | |||
pageSize: 100 | |||
}); | |||
if (res.data) { | |||
this.columns = res.data.list | |||
} | |||
}, | |||
/** | |||
* 接口 | |||
*/ | |||
async deptTreeApi() { | |||
// 获取所在村/社区 | |||
const res = await publicApi.deptTreeApi(); | |||
if (res.data && res.data.length) { | |||
this.optionData = res.data | |||
} | |||
}, | |||
async afterRead(event) { | |||
const { | |||
file | |||
} = event; | |||
const res = await getApp().globalData.upload({file}); | |||
if (res.code !== 0) { | |||
uni.showToast({ | |||
title: '上传图片失败', | |||
icon: 'none' | |||
}); | |||
return false; | |||
} | |||
const { | |||
fileList | |||
} = this; | |||
const { | |||
appealEnclosure | |||
} = this; | |||
const url = res.data; | |||
fileList.push({ | |||
url | |||
}); | |||
appealEnclosure.push(url); | |||
this.fileList = fileList | |||
this.appealEnclosure = appealEnclosure | |||
const app = getApp().globalData | |||
console.log(app) | |||
// const { | |||
// publicApi, | |||
// peopleApi | |||
// } = app.globalData.api; | |||
import * as peopleApi from '@/api/peopleApi'; | |||
import * as publicApi from '@/api/publicApi'; | |||
export default { | |||
components: { | |||
}, | |||
data() { | |||
return { | |||
userInfoData: uni.getStorageSync('userInfoData'), | |||
// 上传图片所需 | |||
appealEnclosure: [], | |||
fileList: [], | |||
form: { | |||
address: '', | |||
posX: '', | |||
posY: '', | |||
content: '', | |||
title: '', | |||
mobile: '', | |||
orgId: 0, | |||
name: null, | |||
type: 1, | |||
showFlag: 1 | |||
}, | |||
async submit() { | |||
const { | |||
address, | |||
content, | |||
mobile, | |||
name, | |||
posX, | |||
posY, | |||
status, | |||
title, | |||
type, | |||
showFlag | |||
} = this.form; | |||
const params = { | |||
address, | |||
content, | |||
mobile, | |||
name, | |||
posX, | |||
posY, | |||
status, | |||
title, | |||
type, | |||
showFlag, | |||
userId: this.userInfoData.userId, | |||
status: 1, | |||
images: [], | |||
orgId: this.currentValue | |||
}; | |||
params.images = this.fileList.map((item) => { | |||
return item.url; | |||
}); | |||
params.type = this.columns[Number(params.type)].value; | |||
if (type === '' || title === '' || content === '' || !params.orgId) { | |||
let toastTitle = ''; | |||
if (type === '') { | |||
toastTitle = '请选择信息类型'; | |||
} else if (title === '') { | |||
toastTitle = '请输入标题'; | |||
} else if (content === '') { | |||
toastTitle = '请输入描述'; | |||
} else if (!params.orgId) { | |||
toastTitle = '请选择所在村/社区'; | |||
} else { | |||
toastTitle = '带*属于必填项'; | |||
} | |||
uni.showToast({ | |||
title: toastTitle, | |||
icon: 'none' | |||
}); | |||
return false; | |||
} | |||
const res = await peopleApi.seekHelpCreateApi(params); | |||
if (res.code !== 0) { | |||
uni.showToast({ | |||
title: res.msg, | |||
icon: 'none' | |||
}); | |||
return; | |||
} | |||
uni.showToast({ | |||
title: '发布成功', | |||
icon: 'none' | |||
}); | |||
wx.redirectTo({ | |||
url: '/packages/people/pages/masses/masses', | |||
}); | |||
// 返回上一页 | |||
uni.navigateBack(); | |||
}, | |||
checked: false, | |||
headleInput(event) { | |||
const { | |||
value | |||
} = event.detail; | |||
const { | |||
name | |||
} = event.currentTarget.dataset; | |||
this.form[name] = value; | |||
this.form = this.form | |||
this[name] = this[name] | |||
columns: [{ | |||
id: 1, | |||
type: '求助' | |||
}, | |||
{ | |||
id: 2, | |||
type: '帮助' | |||
} | |||
], | |||
// 清楚对应的image图片 | |||
imageDelete(event) { | |||
const { | |||
index | |||
} = event.detail; | |||
const Image = this.fileList; | |||
Image.splice(index, 1); | |||
this.fileList = Image | |||
agreeList: [{ | |||
label: '否', | |||
value: 0 | |||
}, | |||
{ | |||
label: '是', | |||
value: 1 | |||
} | |||
], | |||
bindPickerChange: function(e) { | |||
this.form.type = Number(e.detail.value); | |||
this.form = this.form | |||
}, | |||
// 级连选择器数据 start | |||
isVisible: false, | |||
FiledVisible: true, | |||
bindPickerShowFlag: function(e) { | |||
this.form.showFlag = Number(e.detail.value); | |||
this.form = this.form | |||
}, | |||
optionData: [], | |||
currentTile: '请选择', | |||
onCheckbox(event) { | |||
this.checked = event | |||
}, | |||
// 选择后的名称 | |||
currentValue: null, | |||
onOpenVisible() { | |||
this.isVisible = true | |||
// 选择后的id | |||
// 级联选择默认显示字段 | |||
// 级连选择器数据 end | |||
defaultFieldNames: { | |||
text: 'name', | |||
value: 'id', | |||
children: 'children' | |||
}, | |||
onCloseVisible() { | |||
this.isVisible = false | |||
}, | |||
isDialog: false, | |||
name: '', | |||
label: '' | |||
}; | |||
}, | |||
onLoad() { | |||
// this.form.address = app.globalData.config.locationInfo.name; | |||
// this.form.posX = app.globalData.config.locationInfo.latitude; | |||
// this.form.posY = app.globalData.config.locationInfo.longitude; | |||
const userInfoData = uni.getStorageSync('userInfoData'); | |||
console.log(userInfoData) | |||
this.isDialog = true | |||
this.form = this.form | |||
this.userInfoData = userInfoData | |||
this.deptTreeApi(); | |||
this.getTypeApi(); | |||
}, | |||
methods: { | |||
// 获取群众点单字典 | |||
async getTypeApi() { | |||
const res = await publicApi.getDictDataApi({ | |||
dictType: 'people_seek_help_type', | |||
pageNo: 1, | |||
pageSize: 100 | |||
}); | |||
if (res.data) { | |||
this.columns = res.data.list | |||
} | |||
}, | |||
onChangeVisible(e) { | |||
this.currentTile = e.selectedOptions[e.tabIndex].name | |||
this.currentValue =e.value | |||
/** | |||
* 接口 | |||
*/ | |||
async deptTreeApi() { | |||
// 获取所在村/社区 | |||
const res = await publicApi.deptTreeApi(); | |||
if (res.data && res.data.length) { | |||
this.optionData = res.data | |||
} | |||
} | |||
}; | |||
</script> | |||
<style lang="less"> | |||
page { | |||
background-color: #fff; | |||
} | |||
}, | |||
.line { | |||
width: 100%; | |||
height: 36rpx; | |||
} | |||
async afterRead(event) { | |||
const { | |||
file | |||
} = event; | |||
.red { | |||
color: red; | |||
} | |||
const res = await getApp().globalData.upload({ file }); | |||
if (res.code !== 0) { | |||
uni.showToast({ | |||
title: '上传图片失败', | |||
icon: 'none' | |||
}); | |||
return false; | |||
} | |||
// this.fileList.push({url:res.data}) | |||
this.appealEnclosure.push(res.data); | |||
}, | |||
.camera { | |||
width: 160rpx; | |||
height: 160rpx; | |||
} | |||
async submit() { | |||
const { | |||
address, | |||
content, | |||
mobile, | |||
name, | |||
posX, | |||
posY, | |||
status, | |||
title, | |||
type, | |||
showFlag | |||
} = this.form; | |||
const params = { | |||
address, | |||
content, | |||
mobile, | |||
name, | |||
posX, | |||
posY, | |||
status, | |||
title, | |||
type, | |||
showFlag, | |||
userId: this.userInfoData.userId, | |||
status: 1, | |||
images: [], | |||
orgId: this.currentValue | |||
}; | |||
params.images = this.appealEnclosure | |||
params.type = this.columns[Number(params.type)].value; | |||
if (type === '' || title === '' || content === '' || !params.orgId) { | |||
let toastTitle = ''; | |||
if (type === '') { | |||
toastTitle = '请选择信息类型'; | |||
} else if (title === '') { | |||
toastTitle = '请输入标题'; | |||
} else if (content === '') { | |||
toastTitle = '请输入描述'; | |||
} else if (!params.orgId) { | |||
toastTitle = '请选择所在村/社区'; | |||
} else { | |||
toastTitle = '带*属于必填项'; | |||
} | |||
uni.showToast({ | |||
title: toastTitle, | |||
icon: 'none' | |||
}); | |||
return false; | |||
} | |||
const res = await peopleApi.seekHelpCreateApi(params); | |||
if (res.code !== 0) { | |||
uni.showToast({ | |||
title: res.msg, | |||
icon: 'none' | |||
}); | |||
return; | |||
} | |||
uni.showToast({ | |||
title: '发布成功', | |||
icon: 'none' | |||
}); | |||
wx.redirectTo({ | |||
url: '/packages/people/pages/masses/masses', | |||
}); | |||
// 返回上一页 | |||
uni.navigateBack(); | |||
}, | |||
.form-list { | |||
width: 100%; | |||
} | |||
headleInput(event) { | |||
const { | |||
value | |||
} = event.detail; | |||
const { | |||
name | |||
} = event.currentTarget.dataset; | |||
this.form[name] = value; | |||
this.form = this.form | |||
this[name] = this[name] | |||
}, | |||
beforeDelete(file, dateil) { | |||
this.appealEnclosure.splice(dateil.index, 1); | |||
this.fileList.splice(dateil.index, 1) | |||
}, | |||
.form-body { | |||
font-size: 32rpx; | |||
font-weight: 400; | |||
color: #333333; | |||
padding: 40rpx 40rpx 38rpx; | |||
position: relative; | |||
&::before { | |||
content: ''; | |||
position: absolute; | |||
left: 50%; | |||
bottom: 0; | |||
transform: translateX(-50%); | |||
width: 678rpx; | |||
height: 1px; | |||
background-color: #e1e1e1; | |||
} | |||
bindPickerChange: function (e) { | |||
this.form.type = Number(e.detail.value); | |||
this.form = this.form | |||
}, | |||
.label { | |||
font-size: 28rpx; | |||
font-weight: 400; | |||
color: #333333; | |||
} | |||
bindPickerShowFlag: function (e) { | |||
this.form.showFlag = Number(e.detail.value); | |||
this.form = this.form | |||
}, | |||
.label-value { | |||
font-size: 32rpx; | |||
font-weight: 500; | |||
color: #000000; | |||
line-height: 32rpx; | |||
.ic-xia { | |||
margin-left: 27rpx; | |||
width: 32rpx; | |||
height: 32rpx; | |||
} | |||
} | |||
onCheckbox(event) { | |||
this.checked = event | |||
}, | |||
.picker { | |||
margin-top: 24rpx; | |||
} | |||
onOpenVisible() { | |||
this.isVisible = true | |||
}, | |||
.picker-text { | |||
font-size: 32rpx; | |||
font-weight: 400; | |||
color: #999999; | |||
} | |||
onCloseVisible() { | |||
this.isVisible = false | |||
}, | |||
.picker-line { | |||
flex: 1; | |||
onChangeVisible(e) { | |||
this.currentTile = e.selectedOptions[e.tabIndex].name | |||
this.currentValue = e.value | |||
} | |||
} | |||
}; | |||
</script> | |||
<style lang="less"> | |||
page { | |||
background-color: #fff; | |||
} | |||
.line { | |||
width: 100%; | |||
height: 36rpx; | |||
} | |||
.red { | |||
color: red; | |||
} | |||
.camera { | |||
width: 160rpx; | |||
height: 160rpx; | |||
} | |||
.form-list { | |||
width: 100%; | |||
} | |||
.form-body { | |||
font-size: 32rpx; | |||
font-weight: 400; | |||
color: #333333; | |||
padding: 40rpx 40rpx 38rpx; | |||
position: relative; | |||
&::before { | |||
content: ''; | |||
position: absolute; | |||
left: 50%; | |||
bottom: 0; | |||
transform: translateX(-50%); | |||
width: 678rpx; | |||
height: 1px; | |||
background-color: #e1e1e1; | |||
} | |||
.textarea-class { | |||
margin-top: 26rpx; | |||
width: 100%; | |||
font-size: 32rpx; | |||
font-weight: 400; | |||
} | |||
.label { | |||
font-size: 28rpx; | |||
font-weight: 400; | |||
color: #333333; | |||
} | |||
.form-msg { | |||
font-size: 26rpx; | |||
font-weight: 400; | |||
color: #999999; | |||
line-height: 26rpx; | |||
margin-top: 28rpx; | |||
} | |||
.label-value { | |||
font-size: 32rpx; | |||
font-weight: 500; | |||
color: #000000; | |||
line-height: 32rpx; | |||
.location { | |||
.ic-xia { | |||
margin-left: 27rpx; | |||
width: 32rpx; | |||
height: 32rpx; | |||
} | |||
} | |||
.location-info { | |||
margin-top: 26rpx; | |||
input { | |||
font-size: 32rpx; | |||
font-weight: 400; | |||
} | |||
} | |||
.picker { | |||
margin-top: 24rpx; | |||
} | |||
.form-col { | |||
display: flex; | |||
align-items: center; | |||
justify-content: space-between; | |||
text-align: right; | |||
.picker-text { | |||
font-size: 32rpx; | |||
font-weight: 400; | |||
color: #999999; | |||
} | |||
.textarea-class { | |||
margin-top: 0; | |||
} | |||
.picker-line { | |||
flex: 1; | |||
} | |||
.card-placeholder { | |||
font-size: 32rpx; | |||
font-weight: 400; | |||
color: #000000; | |||
} | |||
.textarea-class { | |||
margin-top: 26rpx; | |||
width: 100%; | |||
font-size: 32rpx; | |||
font-weight: 400; | |||
} | |||
.form-location { | |||
padding: 20rpx 35rpx; | |||
border-radius: 16rpx; | |||
.form-msg { | |||
font-size: 26rpx; | |||
font-weight: 400; | |||
color: #999999; | |||
line-height: 26rpx; | |||
margin-top: 28rpx; | |||
} | |||
.form-treaty { | |||
padding: 83rpx 40rpx 32rpx; | |||
.location { | |||
width: 32rpx; | |||
height: 32rpx; | |||
} | |||
.ic-check { | |||
width: 32rpx; | |||
height: 32rpx; | |||
} | |||
.location-info { | |||
margin-top: 26rpx; | |||
.checbox-text { | |||
font-size: 28rpx; | |||
input { | |||
font-size: 32rpx; | |||
font-weight: 400; | |||
color: #000000; | |||
line-height: 28rpx; | |||
.jump-to { | |||
color: var(--item-dominant-color); | |||
} | |||
} | |||
} | |||
} | |||
.form-col { | |||
display: flex; | |||
align-items: center; | |||
justify-content: space-between; | |||
text-align: right; | |||
.form-button { | |||
padding: 25rpx 36rpx; | |||
.textarea-class { | |||
margin-top: 0; | |||
} | |||
.form-button-body { | |||
height: 80rpx; | |||
.card-placeholder { | |||
font-size: 32rpx; | |||
font-weight: 400; | |||
color: #ffffff; | |||
line-height: 80rpx; | |||
text-align: center; | |||
background: #c1c1c1; | |||
border-radius: 8rpx; | |||
color: #000000; | |||
} | |||
} | |||
.form-button-body-select { | |||
background: var(--item-dominant-color); | |||
} | |||
.form-location { | |||
padding: 20rpx 35rpx; | |||
border-radius: 16rpx; | |||
} | |||
.form-image { | |||
margin: 20rpx 0rpx 20rpx 0; | |||
display: flex; | |||
align-items: center; | |||
flex-wrap: wrap; | |||
} | |||
.form-treaty { | |||
padding: 83rpx 40rpx 32rpx; | |||
.form-image>view { | |||
width: 31.3%; | |||
position: relative; | |||
margin-right: 13.5rpx; | |||
.ic-check { | |||
width: 32rpx; | |||
height: 32rpx; | |||
} | |||
.form-image>view>image:nth-child(1) { | |||
width: 100%; | |||
height: 200rpx; | |||
border-radius: 10rpx; | |||
} | |||
.checbox-text { | |||
font-size: 28rpx; | |||
font-weight: 400; | |||
color: #000000; | |||
line-height: 28rpx; | |||
.form-image>view>image:nth-child(2) { | |||
position: absolute; | |||
top: -0rpx; | |||
right: 0rpx; | |||
width: 40rpx; | |||
height: 40rpx; | |||
.jump-to { | |||
color: var(--item-dominant-color); | |||
} | |||
} | |||
} | |||
.form-button { | |||
padding: 25rpx 36rpx; | |||
} | |||
.form-button-body { | |||
height: 80rpx; | |||
font-size: 32rpx; | |||
font-weight: 400; | |||
color: #ffffff; | |||
line-height: 80rpx; | |||
text-align: center; | |||
background: #c1c1c1; | |||
border-radius: 8rpx; | |||
} | |||
.form-button-body-select { | |||
background: var(--item-dominant-color); | |||
} | |||
.form-image { | |||
margin: 20rpx 0rpx 20rpx 0; | |||
display: flex; | |||
align-items: center; | |||
flex-wrap: wrap; | |||
} | |||
.form-image>view { | |||
width: 31.3%; | |||
position: relative; | |||
margin-right: 13.5rpx; | |||
} | |||
.form-image>view>image:nth-child(1) { | |||
width: 100%; | |||
height: 200rpx; | |||
border-radius: 10rpx; | |||
} | |||
.form-image>view>image:nth-child(2) { | |||
position: absolute; | |||
top: -0rpx; | |||
right: 0rpx; | |||
width: 40rpx; | |||
height: 40rpx; | |||
} | |||
</style> |
@@ -1,5 +1,5 @@ | |||
<template> | |||
<view style="height: 100%"> | |||
<view> | |||
<custom-nav-bar position="fixed" color="black" left-text="申请党员帮办" left-arrow /> | |||
<!-- 接单显示 --> | |||
@@ -15,8 +15,10 @@ | |||
<view class="thenMesses-bg bg-violet"> | |||
<view class="mb-2 thenMesses-title hide">{{ messsDetail.title }}</view> | |||
<view class="absolute1 mb-2"> | |||
<text v-if="messsDetail.type + '' === t.value" v-for="(t, index) in seekHelptype" | |||
:key="index">{{ t.label }}</text> | |||
<block v-for="(t, index) in seekHelptype" | |||
:key="index"> | |||
<text v-if="messsDetail.type + '' === t.value" >{{ t.label }}</text> | |||
</block> | |||
</view> | |||
<view class="flex flex-v-center flex-between thenMesses-image"> | |||
@@ -71,7 +73,7 @@ | |||
<van-icon name="location" color="#999999" /> | |||
{{ messsDetail.address }} | |||
<view class="createTime" v-if="messsDetail.createTime"> | |||
<text>{{ toods.getDateTime(messsDetail.createTime) }}</text> | |||
<text>{{ getDateTime(messsDetail.createTime) }}</text> | |||
</view> | |||
</view> | |||
<text class="slot"></text> | |||
@@ -107,6 +109,7 @@ | |||
// const { peopleApi, publicApi } = app.globalData.api; | |||
import * as peopleApi from '@/api/peopleApi'; | |||
import * as publicApi from '@/api/publicApi'; | |||
import utils from '@/utils/util.map' | |||
export default { | |||
components: {}, | |||
data() { | |||
@@ -140,11 +143,12 @@ | |||
onLoad(val) { | |||
this.seekHelpGetApi(val.id); | |||
this.getTypeApi(); | |||
this.setData({ | |||
pageId: val.id | |||
}); | |||
this.pageId = val.id | |||
}, | |||
methods: { | |||
getDateTime(time){ | |||
return utils.getDateTime(time) | |||
}, | |||
async seekHelpGetApi(id) { | |||
let params = { | |||
id | |||
@@ -152,9 +156,7 @@ | |||
const res = await peopleApi.seekHelpGetApi(params); | |||
if (res.data) { | |||
// res.data.createTime = app.globalData.util.timeFormat(res.data.createTime); | |||
this.setData({ | |||
messsDetail: res.data | |||
}); | |||
this.messsDetail = res.data | |||
} | |||
}, | |||
@@ -164,9 +166,7 @@ | |||
dictType: 'people_seek_help_type' | |||
}); | |||
if (res.data) { | |||
this.setData({ | |||
seekHelptype: res.data.list | |||
}); | |||
this.seekHelptype = res.data.list | |||
} | |||
}, | |||
@@ -71,8 +71,8 @@ | |||
<textarea class="textarea-class" @input="inputeidt" maxlength="200" data-name="descInfo" | |||
placeholder="请输入,不超过200字" :value="form.descInfo"></textarea> | |||
<view class="form-image"> | |||
<van-uploader @after-read="afterRead" :file-list="fileList" :deletable="true" max-count="9" | |||
@delete="closeImage"> | |||
<van-uploader :after-read="afterRead" :before-delete="beforeDelete" v-model="fileList" :deletable="true" | |||
max-count="9"> | |||
<image class="camera" src="/static/images/icon9.png"></image> | |||
</van-uploader> | |||
</view> | |||
@@ -99,8 +99,8 @@ | |||
</van-checkbox> | |||
</view> | |||
<view class="form-button"> | |||
<van-button v-if="checked" disabled block color="#C1C1C1">发布信息</van-button> | |||
<van-button @click="submit" v-if="!checked" block color="#FE3B53">发布信息</van-button> | |||
<van-button v-if="!checked" disabled block color="#C1C1C1">发布信息</van-button> | |||
<van-button @click="submit" v-if="checked" block color="#FE3B53">发布信息</van-button> | |||
</view> | |||
</view> | |||
@@ -147,7 +147,7 @@ | |||
option: {}, | |||
fileList: [], | |||
ImageList: [], | |||
appealEnclosure: [], | |||
caseType: '', | |||
// mediatorId: '', | |||
@@ -221,12 +221,9 @@ | |||
} | |||
}, | |||
// 清除对应的图片 | |||
closeImage(e) { | |||
let index = e.currentTarget.dataset.index; | |||
var arr = this.fileList; | |||
arr.splice(index, 1); | |||
this.fileList = arr | |||
beforeDelete(file, dateil) { | |||
this.appealEnclosure.splice(dateil.index, 1); | |||
this.fileList.splice(dateil.index, 1) | |||
}, | |||
// 输入框输入事件 | |||
@@ -235,8 +232,7 @@ | |||
target: dataset, | |||
detail | |||
} = e; | |||
let attributeName = `form.${dataset.dataset.name}`; | |||
this[attributeName] = detail.value | |||
this.form[`${dataset.dataset.name}`] = detail.value | |||
console.log(this.form); | |||
}, | |||
@@ -278,32 +274,21 @@ | |||
this.checked = event | |||
}, | |||
// 上传图片 | |||
async afterRead(event) { | |||
const { | |||
file | |||
} = event.detail; | |||
// const res = await app.globalData.upload({ | |||
// file | |||
// }); | |||
if (res.code !== 0) { | |||
uni.showToast({ | |||
title: '上传图片失败', | |||
icon: 'none' | |||
}); | |||
return false; | |||
} | |||
const fileList = this.fileList; | |||
const ImageList = this.ImageList; | |||
const url = res.data; | |||
fileList.push({ | |||
url | |||
}); | |||
ImageList.push(url); | |||
this.fileList = fileList | |||
this.fileList = ImageList | |||
}, | |||
const { | |||
file | |||
} = event; | |||
const res = await getApp().globalData.upload({ file }); | |||
if (res.code !== 0) { | |||
uni.showToast({ | |||
title: '上传图片失败', | |||
icon: 'none' | |||
}); | |||
return false; | |||
} | |||
this.appealEnclosure.push(res.data); | |||
}, | |||
// 字典类型 | |||
async getTypeList() { | |||
const res = await publicApi.getDictDataApi({ | |||
@@ -340,7 +325,7 @@ | |||
caseType, | |||
title, | |||
descInfo, | |||
pics: this.ImageList, | |||
pics: this.appealEnclosure, | |||
address: address, | |||
status: '1', | |||
userId: this.form.userId, | |||
@@ -231,14 +231,11 @@ | |||
if (this.searchValue) { | |||
param.name = this.searchValue; | |||
} | |||
const { | |||
data: { | |||
list = [] | |||
} | |||
} = await peopleApi.hospitalPageApi(param); | |||
const res = await peopleApi.hospitalPageApi(param); | |||
let list = res.data.list | |||
if (list.length) { | |||
list.forEach((e) => { | |||
e.createTime = util.timeFormat(e.createTime, 'yyyy-mm-ss'); | |||
e.createTime = util.timeFormat(e.createTime, 'yyyy-mm-ss') || 0; | |||
}); | |||
this.newsPageList = list | |||
} | |||
@@ -203,9 +203,9 @@ | |||
const { | |||
file | |||
} = event.detail; | |||
// const res = await app.globalData.upload({ | |||
// file | |||
// }); | |||
const res = await getApp().globalData.upload({ | |||
file | |||
}); | |||
if (res.code !== 0) { | |||
uni.showToast({ | |||
title: '上传图片失败', | |||
@@ -1,7 +1,7 @@ | |||
<template> | |||
<view> | |||
<custom-nav-bar position="fixed" color="black" :left-text="optins.name" left-arrow /> | |||
<web-view v-if="optins.name === '手机充值' || optins.name === '生活缴费'" :src="url"></web-view> | |||
<web-view v-if="optins.name === '手机充值' || optins.name === '生活缴费' || optins.name === '随手拍'" :src="url"></web-view> | |||
<image v-else class="img" mode="aspectFit" src="/static/packages/public/pages/web-view/img.jpg" | |||
:show-menu-by-longpress="true" /> | |||
@@ -38,6 +38,7 @@ | |||
default: | |||
break; | |||
} | |||
console.log(url) | |||
this.url = url | |||
}, | |||
methods: {} | |||
@@ -317,7 +317,8 @@ | |||
const res = await myApi.getProfileUserInfoApi(); | |||
if (res.data) { | |||
this.userInfo = res.data | |||
uni.setStorageSync("userInfoData", res.data); | |||
this.userInfo.userId = res.data.id | |||
uni.setStorageSync("userInfoData", this.userInfo); | |||
} | |||
}, | |||
async recursionApi() { | |||
@@ -13,10 +13,10 @@ export default async function (params) { | |||
return await uni.uploadFile({ | |||
url, | |||
filePath: file.url, | |||
file, | |||
name: 'file', | |||
header: { | |||
"content-type": "multipart/form-data", | |||
// "Content-Type": "multipart/form-data", | |||
'X-Access-Token': token, | |||
'Authorization': `Bearer ${token}` | |||
}, | |||
@@ -132,38 +132,14 @@ function handleChildren(tree) { | |||
* @returns {string} 时间格式,可选。默认yyyy-mm-dd hh:MM:ss,年为"yyyy",月为"mm",日为"dd",时为"hh",分为"MM",秒为"ss",格式可以自由搭配,如: yyyy:mm:dd yyyy-mm-dd yyyy年mm月dd日,yyyy年mm月dd日 hh时MM分ss秒,yyyy/mm/dd/,MM:ss等组合 | |||
*/ | |||
function timeFormat(dateTime = null, fmt = 'yyyy-mm-dd hh:MM:ss') { | |||
// 如果为null,则格式化当前时间 | |||
if (!dateTime) { | |||
dateTime = Number(new Date()); | |||
} | |||
// 如果dateTime长度为10或者13,则为秒和毫秒的时间戳,如果超过13位,则为其他的时间格式 | |||
if (dateTime.toString().length == 10) { | |||
dateTime *= 1000; | |||
} | |||
const date = new Date(dateTime); | |||
let ret; | |||
const opt = { | |||
'y+': date.getFullYear().toString(), | |||
// 年 | |||
'm+': (date.getMonth() + 1).toString(), | |||
// 月 | |||
'd+': date.getDate().toString(), | |||
// 日 | |||
'h+': date.getHours().toString(), | |||
// 时 | |||
'M+': date.getMinutes().toString(), | |||
// 分 | |||
's+': date.getSeconds().toString() // 秒 | |||
// 有其他格式化字符需求可以继续添加,必须转化成字符串 | |||
}; | |||
for (const k in opt) { | |||
ret = new RegExp(`(${k})`).exec(fmt); | |||
if (ret) { | |||
fmt = fmt.replace(ret[1], ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, '0')); | |||
} | |||
} | |||
return fmt; | |||
const time = new Date(dateTime); | |||
const Y = time.getFullYear(); | |||
const M = time.getMonth() + 1 < 10 ? "0" + (time.getMonth() + 1) : time.getMonth() + 1; | |||
const D = time.getDate() < 10 ? "0" + time.getDate() : time.getDate(); | |||
const h = time.getHours() < 10 ? "0" + time.getHours() : time.getHours(); | |||
const m = time.getMinutes() < 10 ? "0" + time.getMinutes() : time.getMinutes(); | |||
const s = time.getSeconds() < 10 ? "0" + time.getSeconds() : time.getSeconds(); | |||
return Y + "-" + M + "-" + D + " " + h + ":" + m; | |||
} | |||
/** | |||