提交 a91f8ad0 authored 作者: 杨斌基's avatar 杨斌基

feat(选择发布类型): 新增告知书和直接进入表单

上级 f6ceab9b
...@@ -9,13 +9,19 @@ ...@@ -9,13 +9,19 @@
:key="item.id" :key="item.id"
class="item" class="item"
:style="{ marginTop: index === 0 ? 0 : '60rpx', background: item.background }" :style="{ marginTop: index === 0 ? 0 : '60rpx', background: item.background }"
@click="onListClick(item, index)" @click="_onListClick(item, index)"
> >
<image class="item-icon" :src="item.img" /> <image class="item-icon" :src="item.img" />
<view class="item-text">{{ item.name }}</view> <view class="item-text">{{ item.name }}</view>
</view> </view>
</view> </view>
<u-modal :show="modalShow" @confirm="onModalConfirm">
<view class="modal" :style="`max-height: ${modalHeight}rpx; overflow-y: scroll; white-space: pre-wrap`">
<u-parse :content="activeItem.desc" />
</view>
</u-modal>
<!-- 取消举报说明 <!-- 取消举报说明
<view class="footer"> <view class="footer">
<u-button class="report-btn" @click="onReportClick">举报说明</u-button> <u-button class="report-btn" @click="onReportClick">举报说明</u-button>
...@@ -48,6 +54,8 @@ const _list = [ ...@@ -48,6 +54,8 @@ const _list = [
}, },
]; ];
const faultName = '交通设施故障上报'
export default { export default {
data() { data() {
return { return {
...@@ -58,6 +66,10 @@ export default { ...@@ -58,6 +66,10 @@ export default {
isFirstRecord: 0, isFirstRecord: 0,
isFirstRecordId: 0, isFirstRecordId: 0,
faultTask: { id: 0, parent: { id: 0 } },
activeItem: {},
modalShow: false,
}; };
}, },
...@@ -80,6 +92,9 @@ export default { ...@@ -80,6 +92,9 @@ export default {
async fetchPhotoTaskTypeData() { async fetchPhotoTaskTypeData() {
const { list } = await uni.$u.http.get('/api/app/phototasktype/list', { params: { parent_id: 0 } }); const { list } = await uni.$u.http.get('/api/app/phototasktype/list', { params: { parent_id: 0 } });
this.list = list.map((value, index) => ({ ...value, background: _list[index].background })); this.list = list.map((value, index) => ({ ...value, background: _list[index].background }));
const fault = this.list.find(v => v.name === faultName)
this.fetchFalutTask(fault.id)
}, },
async fetchPhotoTaskTypeDetail() { async fetchPhotoTaskTypeDetail() {
...@@ -87,6 +102,11 @@ export default { ...@@ -87,6 +102,11 @@ export default {
console.log(detail); console.log(detail);
}, },
async fetchFalutTask(id) {
const { list: [task] } = await uni.$u.http.get('/api/app/phototasktype/list', { params: { parent_id: id } })
this.faultTask = task
},
async onReportClick() { async onReportClick() {
console.log('onReportClick'); console.log('onReportClick');
this.showReport = true; this.showReport = true;
...@@ -101,6 +121,24 @@ export default { ...@@ -101,6 +121,24 @@ export default {
this.showReport = false; this.showReport = false;
}, },
_onListClick(item, index) {
const { name } = item
// 交通设施故障上报直接进入填写表单
if (name === faultName) {
const { id, parent: { id: parentId } } = this.faultTask
uni.$u.route({
url: 'pages/record-content/index',
params: {
parent_id: parentId,
detail_id: id,
},
});
return
}
this.activeItem = item
this.modalShow = true
},
onListClick(item, index) { onListClick(item, index) {
if (!this.isFirstRecord) { if (!this.isFirstRecord) {
this.isFirstRecordId = item.id; this.isFirstRecordId = item.id;
...@@ -115,6 +153,11 @@ export default { ...@@ -115,6 +153,11 @@ export default {
if (!isFirstRecord) uni.setStorageSync('isFirstRecord', 1); if (!isFirstRecord) uni.setStorageSync('isFirstRecord', 1);
return isFirstRecord; return isFirstRecord;
}, },
onModalConfirm() {
this.modalShow = false
this.onListClick(this.activeItem)
}
}, },
}; };
</script> </script>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论