first commit
@@ -0,0 +1,175 @@
|
||||
<template>
|
||||
<view class="min-height bg-main-light">
|
||||
<HeaderItem title="智能生成法律文书"/>
|
||||
<view class="bg-white p-20 text-25 flex justify-center items-center">
|
||||
<text class="tag selected-tag">{{ title }}</text>
|
||||
</view>
|
||||
<view class="pos-r" v-if="configList && configList.length">
|
||||
<view class="circle-bottom-bg"></view>
|
||||
<view class="tips-card-wrap">
|
||||
<view class="tips-card">
|
||||
<view class="text-28 font-bold text-center p-30">【{{ typeLabel }}】</view>
|
||||
<u-line color="#1DBCBC" dashed></u-line>
|
||||
<view class="text-25 p-20">{{ configList[activeIndex].title }}</view>
|
||||
<view class="p-20 flex justify-start items-center" @click="selectItem(item, index)"
|
||||
v-for="(item, index) in JSON.parse(configList[activeIndex].answer)" :key="index">
|
||||
<template v-if="configList[activeIndex].type === 'single'">
|
||||
<u-icon
|
||||
:name="configList[activeIndex].selected.includes(item) ? '/legalLegalDoc/static/radio-selected.png' : '/legalLegalDoc/static/radio.png'"/>
|
||||
<text class="text-25 ml-10">{{ item }}</text>
|
||||
</template>
|
||||
<template v-else-if="configList[activeIndex].type === 'multi'">
|
||||
<u-icon
|
||||
:name="configList[activeIndex].selected.includes(item) ? '/legalLegalDoc/static/checkbox-selected.png' : '/legalLegalDoc/static/checkbox.png'"/>
|
||||
<text class="text-25 ml-10">{{ item }}</text>
|
||||
</template>
|
||||
</view>
|
||||
<u-gap height="100rpx"/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="footer">
|
||||
<view class="flex justify-center items-center text-25" style="border-top: 1px solid #ccc">
|
||||
<view class="flex-1 text-blue p-30 text-center" @click="toLastItem">
|
||||
返回
|
||||
</view>
|
||||
<view class="flex-1 bg-linear p-30 text-white text-center" @click="toNextItem">
|
||||
下一步
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import HeaderItem from "@/components/HeaderItem.vue";
|
||||
import {legalDocConfigReq} from "@/api/legalDoc";
|
||||
|
||||
export default {
|
||||
name: "detail",
|
||||
components: {HeaderItem},
|
||||
data() {
|
||||
return {
|
||||
id: 0,
|
||||
title: '',
|
||||
configList: [],
|
||||
typeList: [{value: 'single', label: '单选'}, {value: 'multi', label: '多选'}, {value: 'fill', label: '填空'}],
|
||||
activeIndex: 0,
|
||||
typeLabel: '',
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async getList() {
|
||||
const {data} = await legalDocConfigReq({
|
||||
typeId: this.id
|
||||
})
|
||||
this.configList = data
|
||||
this.typeLabel = this.typeList.find(item => item.value === data[0].type).label
|
||||
this.configList.map(item => {
|
||||
item.selected = []
|
||||
return item
|
||||
})
|
||||
},
|
||||
selectItem(item, index) {
|
||||
// console.log(index, this.configList[index], this.configList.length - 1)
|
||||
if (this.configList[this.activeIndex].type === 'single') {
|
||||
this.configList[this.activeIndex].selected = [item]
|
||||
if (this.activeIndex === this.configList.length - 1) {
|
||||
this.toEnd()
|
||||
} else {
|
||||
this.activeIndex += 1
|
||||
this.typeLabel = this.typeList.find(item => item.value === this.configList[this.activeIndex].type).label
|
||||
}
|
||||
} else if (this.configList[this.activeIndex].type === 'multi') {
|
||||
const hasIndex = this.configList[this.activeIndex].selected.findIndex(i => i === item)
|
||||
if (hasIndex > -1) {
|
||||
this.configList[this.activeIndex].selected.splice(hasIndex, 1)
|
||||
} else {
|
||||
this.configList[this.activeIndex].selected.push(item)
|
||||
}
|
||||
}
|
||||
this.$forceUpdate()
|
||||
},
|
||||
toNextItem() {
|
||||
if (!this.configList[this.activeIndex].selected.length) {
|
||||
return this.$toast('请选择选项')
|
||||
}
|
||||
if (this.activeIndex === this.configList.length - 1) {
|
||||
this.toEnd()
|
||||
} else {
|
||||
this.activeIndex += 1
|
||||
this.typeLabel = this.typeList.find(item => item.value === this.configList[this.activeIndex].type).label
|
||||
}
|
||||
},
|
||||
toLastItem() {
|
||||
if (this.activeIndex === 0) uni.navigateBack()
|
||||
else this.activeIndex -= 1
|
||||
},
|
||||
toEnd() {
|
||||
let content = []
|
||||
this.configList.map(item => {
|
||||
content.push({
|
||||
quest: item.title,
|
||||
answer: item.selected
|
||||
})
|
||||
})
|
||||
uni.navigateTo({
|
||||
url: `/legalLegalDoc/pages/result?title=${this.title}&typeId=${this.id}`,
|
||||
success: res => {
|
||||
res.eventChannel.emit('content', content)
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
onLoad({id, title}) {
|
||||
this.id = id
|
||||
this.title = title
|
||||
this.getList()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.tag {
|
||||
padding: 10rpx 25rpx;
|
||||
margin-right: 25rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.selected-tag {
|
||||
background-color: #FFCA68;
|
||||
border-radius: 100rpx;
|
||||
}
|
||||
|
||||
|
||||
.circle-bottom-bg {
|
||||
background-color: #1DBCBC;
|
||||
width: 100vw;
|
||||
height: 200rpx;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
border-radius: 0 0 100vw 100vw;
|
||||
}
|
||||
|
||||
.tips-card-wrap {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 70rpx;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
|
||||
.tips-card {
|
||||
width: 80%;
|
||||
line-height: 30rpx;
|
||||
border-radius: 50rpx;
|
||||
background-color: rgba(255, 255, 255, 1);
|
||||
color: rgba(16, 16, 16, 1);
|
||||
box-shadow: 0 2px 6px 0 rgba(202, 247, 247, 1);
|
||||
margin-bottom: 50rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,108 @@
|
||||
<template>
|
||||
<view class="min-height bg-main-light">
|
||||
<HeaderItem title="智能生成法律文书"/>
|
||||
<view class="bg-white p-20 text-25 flex justify-start items-center overflow-x">
|
||||
<text v-for="(item, index) in typeList" :key="index" class="tag"
|
||||
@click="changeType(index)"
|
||||
:class="[item.id === activeId ? 'selected-tag' : '']">{{ item.title }}
|
||||
</text>
|
||||
</view>
|
||||
<view class="pos-r">
|
||||
<view class="circle-bottom-bg"></view>
|
||||
<view class="tips-card-wrap">
|
||||
<view class="tips-card">
|
||||
<view class="text-28 font-bold text-center">{{ activeTitle }}</view>
|
||||
<view class="text-25 mt-20" style="padding-bottom: 50rpx">
|
||||
{{ activeContent }}
|
||||
</view>
|
||||
</view>
|
||||
<u-button shape="circle" @click="$jump(`/legalLegalDoc/pages/detail?id=${activeId}&title=${activeTitle}`)"
|
||||
:customStyle="{background: 'linear-gradient(91.28deg, rgba(14,146,252,1) 27.63%,rgba(29,188,188,1) 80.08%)',
|
||||
border: 0, width: '200rpx',
|
||||
color: 'white'}">
|
||||
开始
|
||||
</u-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import HeaderItem from "@/components/HeaderItem.vue";
|
||||
import {listLegalDocTypeReq} from "@/api/legalDoc";
|
||||
|
||||
export default {
|
||||
name: "index",
|
||||
components: {HeaderItem},
|
||||
data() {
|
||||
return {
|
||||
typeList: [],
|
||||
activeId: 0,
|
||||
activeTitle: 0,
|
||||
activeContent: '',
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async getTypeList() {
|
||||
const {data} = await listLegalDocTypeReq()
|
||||
this.typeList = data
|
||||
this.activeId = data[0].id
|
||||
this.activeTitle = data[0].title
|
||||
this.activeContent = data[0].comment
|
||||
},
|
||||
changeType(index){
|
||||
this.activeId = this.typeList[index].id
|
||||
this.activeTitle = this.typeList[index].title
|
||||
this.activeContent = this.typeList[index].comment
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getTypeList()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.tag {
|
||||
padding: 10rpx 25rpx;
|
||||
margin-right: 25rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.selected-tag {
|
||||
background-color: #FFCA68;
|
||||
border-radius: 100rpx;
|
||||
}
|
||||
|
||||
.circle-bottom-bg {
|
||||
background-color: #3A89CD;
|
||||
width: 100vw;
|
||||
height: 200rpx;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
border-radius: 0 0 100vw 100vw;
|
||||
}
|
||||
|
||||
.tips-card-wrap {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 70rpx;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
|
||||
.tips-card {
|
||||
width: 80%;
|
||||
line-height: 30rpx;
|
||||
padding: 30rpx;
|
||||
border-radius: 50rpx;
|
||||
background-color: rgba(255, 255, 255, 1);
|
||||
color: rgba(16, 16, 16, 1);
|
||||
box-shadow: 0 2px 6px 0 rgba(202, 247, 247, 1);
|
||||
margin-bottom: 50rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,143 @@
|
||||
<template>
|
||||
<view class="min-height bg-main-light p-30">
|
||||
<HeaderItem :title="title"/>
|
||||
<view class="text-30 font-bold text-center">{{ title }}</view>
|
||||
<u-textarea v-model="contentDetail" border="none" maxlength="-1" :disabled="disabled" autoHeight
|
||||
:customStyle="{background: 'transparent'}" :confirmType="null"/>
|
||||
<view class="footer flex justify-center items-center text-white text-25" v-if="disabled">
|
||||
<view class="bg-linear flex-1 p-20 flex justify-center items-center" @click="make('email')">
|
||||
<u-icon name="email" color="white" size="40rpx"/>
|
||||
<text>发送至邮箱</text>
|
||||
</view>
|
||||
<view class="bg-white flex-1 p-20 flex justify-center items-center text-black" @click="make('download')">
|
||||
<u-icon name="/legalLegalDoc/static/mobile.png" size="40rpx"/>
|
||||
<text>下载至手机</text>
|
||||
</view>
|
||||
<view class="bg-linear flex-1 p-20 flex justify-center items-center" @click="disabled = false">
|
||||
<u-icon name="edit-pen" color="white" size="40rpx"/>
|
||||
<text>我要编辑</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="footer flex justify-center items-center text-white text-25 bg-linear" v-else>
|
||||
<view class="flex-1 p-20 text-center" @click="disabled = true">我要带走</view>
|
||||
</view>
|
||||
<u-popup :show="showEmail" close-on-click-overlay @close="showEmail = false" round="10"
|
||||
:closeable="false" mode="center" :customStyle="{width: '80%'}"
|
||||
:safe-area-inset-bottom="false">
|
||||
<view class="p-50 pos-r" v-if="showEmail">
|
||||
<u-input v-model="email" placeholder="请填写邮箱地址"/>
|
||||
</view>
|
||||
<view class="flex justify-center items-center text-25">
|
||||
<view class="flex-1 p-20 text-center" @click="showEmail = false">取消发送</view>
|
||||
<view class="flex-1 p-20 bg-linear text-white text-center" style="border-radius: 0 0 10px 0" @click="doSend">
|
||||
确认发送
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import HeaderItem from "@/components/HeaderItem.vue";
|
||||
import {listArticleReq} from "@/api/common";
|
||||
import {listLegalOrgCheckTypeInfoReq} from "@/api/legalOrgCheck";
|
||||
import piaoyiProgressBar
|
||||
from '@/uni_modules/piaoyi-progress-bar/components/piaoyi-progress-bar/piaoyi-progress-bar.vue';
|
||||
import {legalDocMakeReq, legalDocSendEmailReq, legalDocTypeInfoReq} from "@/api/legalDoc";
|
||||
import {API, MAIN_API} from "@/config";
|
||||
|
||||
export default {
|
||||
name: "result",
|
||||
components: {HeaderItem, piaoyiProgressBar},
|
||||
data() {
|
||||
return {
|
||||
title: '',
|
||||
typeId: null,
|
||||
content: [],
|
||||
config: null,
|
||||
articleList: [],
|
||||
point: 0,
|
||||
levelStyle: {
|
||||
color: 'white',
|
||||
background: 'linear-gradient(97.98deg, rgba(255,201,35,1) 30.49%,rgba(255,144,10,1) 78.96%)',
|
||||
border: 0,
|
||||
width: '300rpx'
|
||||
},
|
||||
disabled: false,
|
||||
showEmail: false,
|
||||
contentDetail: '',
|
||||
email: '',
|
||||
file: '',
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
back() {
|
||||
uni.navigateBack()
|
||||
},
|
||||
async getConfig() {
|
||||
const {data} = await legalDocTypeInfoReq(this.typeId)
|
||||
this.config = data
|
||||
this.contentDetail = `${this.config.topContent}\n`
|
||||
this.content.map(item => {
|
||||
this.contentDetail += `${item.quest}\n`
|
||||
item.answer.map(answer => {
|
||||
this.contentDetail += `${answer}\n`
|
||||
})
|
||||
this.contentDetail += `\n`
|
||||
})
|
||||
this.contentDetail += ` 此致\n`
|
||||
this.contentDetail += ` 人民法院\n`
|
||||
this.contentDetail += ` 申请人(签字):\n`
|
||||
this.contentDetail += ` 年 月 日\n`
|
||||
this.contentDetail += `${this.config.extraContent}\n`
|
||||
},
|
||||
async make(method) {
|
||||
const {data} = await legalDocMakeReq({
|
||||
title: this.title,
|
||||
userContent: this.contentDetail
|
||||
})
|
||||
this.file = data
|
||||
if (method === 'download') {
|
||||
uni.showLoading({
|
||||
title: '下载中'
|
||||
})
|
||||
uni.downloadFile({
|
||||
url: `${API}${data}`,
|
||||
success: function (res) {
|
||||
uni.hideLoading()
|
||||
uni.openDocument({
|
||||
showMenu: true,
|
||||
filePath: res.tempFilePath
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.email = ''
|
||||
this.showEmail = true
|
||||
}
|
||||
},
|
||||
async doSend() {
|
||||
if (!this.email) return this.$toast('请输入邮箱地址')
|
||||
await legalDocSendEmailReq({
|
||||
email: this.email,
|
||||
title: this.title,
|
||||
file: this.file
|
||||
})
|
||||
this.showEmail = false
|
||||
this.$toast('已发送,请注意查收')
|
||||
}
|
||||
},
|
||||
onLoad({title, typeId, point}) {
|
||||
this.title = title
|
||||
this.typeId = typeId
|
||||
this.point = point
|
||||
const eventChannel = this.getOpenerEventChannel();
|
||||
eventChannel.on('content', async data => {
|
||||
this.content = data
|
||||
console.log(this.content)
|
||||
await this.getConfig()
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 3.5 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 4.1 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 4.6 KiB |
|
After Width: | Height: | Size: 24 KiB |