Browse Source

修改bug

master
岳鹏龙 8 months ago
parent
commit
268ec05def
  1. 9
      src/api/index.ts
  2. 7
      src/pages.json
  3. 1
      src/pages/index/ChatDialog.vue
  4. 17
      src/pages/index/index.vue
  5. 4
      src/pages/index/shoppage/makeAssistance.vue
  6. 189
      src/pages/index/subform.vue
  7. 77
      src/pages/index/ztdetail.vue

9
src/api/index.ts

@ -74,3 +74,12 @@ export function ai(data: any) {
data data
}) })
} }
//填写表单
export function specialSign(data: any) {
return request.http({
url: '/api/huiqitong/special/sign',
method: 'POST',
data
})
}

7
src/pages.json

@ -67,6 +67,13 @@
"navigationStyle": "custom" "navigationStyle": "custom"
} }
}, },
{
"path": "pages/index/subform",
"style": {
"navigationBarTitleText": "提交页面",
"navigationStyle": "custom"
}
},
{ {
"path": "pages/index/shoppage/shopHelp", "path": "pages/index/shoppage/shopHelp",
"style": { "style": {

1
src/pages/index/ChatDialog.vue

@ -36,6 +36,7 @@
<u-line color="#99CCFF" margin="20rpx 0"></u-line> <u-line color="#99CCFF" margin="20rpx 0"></u-line>
<text class="cwtxt" @click="askClcik('小微企业优惠政策')">小微企业优惠政策</text> <text class="cwtxt" @click="askClcik('小微企业优惠政策')">小微企业优惠政策</text>
<text class="cwtxt" @click="askClcik('2025年最新小微企业优惠政策')">2025年最新小微企业优惠政策</text> <text class="cwtxt" @click="askClcik('2025年最新小微企业优惠政策')">2025年最新小微企业优惠政策</text>
<text class="cwtxt" @click="askClcik('法律服务')">法律服务</text>
</view> </view>
</view> </view>
</view> </view>

17
src/pages/index/index.vue

@ -70,16 +70,16 @@
</view> </view>
</view> </view>
<!-- <view class="buttonCard"> <view class="buttonCard">
<view class="but" @click="kfz"> <view class="but" @click="gotz('wx2eec5fb00157a603','')">
<image style="width: 96rpx;height: 96rpx;" src="@/static/img/cxw.png" mode=""></image> <image style="width: 96rpx;height: 96rpx;" src="@/static/img/cxw.png" mode=""></image>
<text class="butext">查小微</text> <text class="butext">查小微</text>
</view> </view>
<view class="but" @click="kfz"> <view class="but" @click="gotz('wxbebb3cdd9b331046','')">
<image style="width: 96rpx;height: 96rpx;" src="@/static/img/czl.png" mode=""></image> <image style="width: 96rpx;height: 96rpx;" src="@/static/img/czl.png" mode=""></image>
<text class="butext">查专利</text> <text class="butext">查专利</text>
</view> </view>
<view class="but" @click="kfz"> <view class="but" @click="gotz('wxbbb4319bf073a6ff','')">
<image style="width: 96rpx;height: 96rpx;" src="@/static/img/cbz.png" mode=""></image> <image style="width: 96rpx;height: 96rpx;" src="@/static/img/cbz.png" mode=""></image>
<text class="butext">查标准</text> <text class="butext">查标准</text>
</view> </view>
@ -87,7 +87,7 @@
<image style="width: 96rpx;height: 96rpx;" src="@/static/img/bnb.png" mode=""></image> <image style="width: 96rpx;height: 96rpx;" src="@/static/img/bnb.png" mode=""></image>
<text class="butext">办年报</text> <text class="butext">办年报</text>
</view> </view>
</view> --> </view>
<view class="tjback"> <view class="tjback">
<view class="titlebox"> <view class="titlebox">
@ -268,6 +268,13 @@ const gohydetail = (id) => {
}) })
} }
const gotz = (id,url) =>{
uni.navigateToMiniProgram({
appId: id,
path: url
})
}
const getbqlist = async () => { const getbqlist = async () => {
filterTabs.value = [] filterTabs.value = []
await memberTagList().then((res) => { await memberTagList().then((res) => {

4
src/pages/index/shoppage/makeAssistance.vue

@ -85,9 +85,7 @@ const submit = () => {
duration: 1500, duration: 1500,
success() { success() {
setTimeout(() => { setTimeout(() => {
uni.navigateTo({ uni.navigateBack()
url: '/pages/index/shoppage/interactiveZone'
})
}, 1500) }, 1500)
} }
}) })

189
src/pages/index/subform.vue

@ -0,0 +1,189 @@
<template>
<u-navbar :title="titleData.title" placeholder="true" bg-color="#F1F3F9" :auto-back="true"></u-navbar>
<view class="container">
<u-form labelPosition="top">
<u-form-item :label="item.title" :prop="item.type" v-for="(item,index) in titleData.question" :key="index">
<u-input v-model="item.answer" v-if="item.type === 'input'" />
<u-textarea v-model="item.answer" v-if="item.type === 'textarea'" placeholder="请输入内容"
autoHeight></u-textarea>
<u-radio-group v-model="item.answer" v-if="item.type === 'radio'" placement="column"
@change="groupChange">
<u-radio :customStyle="{marginBottom: '16rpx'}" v-for="(item, index) in item.choose" :key="index"
:label="item.name" :name="item.name">
</u-radio>
</u-radio-group>
<u-checkbox-group v-model="item.answer" v-if="item.type === 'checkbox'" placement="column"
>
<u-checkbox :customStyle="{marginBottom: '16rpx'}" v-for="(item, index) in item.choose" :key="index"
:label="item.name" :name="item.name">
</u-checkbox>
</u-checkbox-group>
</u-form-item>
</u-form>
</view>
<view class="baombut">
<view class="buttt" @click="submit">
确认提交
</view>
</view>
</template>
<script setup>
import {
onLoad
} from '@dcloudio/uni-app'
import {
ref
} from 'vue'
import {
specialSign
} from '@/api/index'
const titleData = ref({})
const ztid = ref('')
function processCheckboxAnswers(arr) {
return arr.map(item => {
//
const result = { id: item.id };
// answer
if (item.type === 'checkbox' && typeof item.answer === 'object') {
//
result.answer = Object.values(item.answer)
.map(val => `'${val}'`)
.join(',');
} else {
// checkboxanswer
result.answer = item.answer;
}
return result;
});
}
//
function submit() {
let istrue = true
titleData.value.question.forEach((ele) => {
if (ele.answer === '' || !ele.answer) {
uni.showToast({
title: '请填写选择完整',
duration: 3000,
icon:'error'
})
istrue = false
}
})
if(istrue) {
let param = {
special_list_id: ztid.value,
form_id: titleData.value.form_id,
answer: processCheckboxAnswers(titleData.value.question)
}
specialSign(param).then((res)=> {
if(res.code === 1) {
uni.showToast({
title: '提交成功!',
duration: 2000
})
setTimeout(()=> {
uni.navigateBack()
},2000)
} else {
uni.showToast({
title: res.msg,
})
}
})
}
}
onLoad(async (param) => {
ztid.value = param.id
titleData.value = JSON.parse(param.form)
})
</script>
<style scoped lang="scss">
.container {
background-color: #F1F3F9;
height: calc(100vh - 350rpx);
width: 100%;
padding: 0 48rpx;
box-sizing: border-box;
overflow-y: auto;
.titlepart {
display: flex;
align-items: baseline;
margin-bottom: 40rpx;
.title {
font-family: Source Han Sans;
font-weight: 550;
font-size: 36rpx;
color: #0c092a;
margin-left: 20rpx;
}
}
.text {
margin-top: 32rpx;
font-family: Source Han Sans;
font-size: 32rpx;
font-weight: 300;
line-height: 60rpx;
letter-spacing: normal;
color: #3d3d3d;
}
.fbtime {
font-family: Roboto;
font-size: 28rpx;
font-weight: normal;
line-height: 142rpx;
letter-spacing: normal;
/* 外部/SCMP Grey/nobel */
/* 样式描述:06 Small Grey txt */
color: #a1a1a1;
}
:deep(.u-input) {
background-color: #FFFFFF;
}
:deep(.u-form-item__body__left__content__label) {
white-space: nowrap;
font-family: Source Han Sans;
font-size: 28rpx;
color: #0C092A;
}
}
.baombut {
width: 100%;
padding: 36rpx 0;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(0, 0, 0, 0.3);
background: #FFFFFF;
position: fixed;
bottom: 0;
.buttt {
width: 574rpx;
height: 96rpx;
border-radius: 248rpx;
background: linear-gradient(90deg, #007FFF 0%, #99CCFF 100%);
font-family: Source Han Sans;
font-size: 36rpx;
color: #FFFFFF;
display: flex;
align-items: center;
justify-content: center;
}
}
</style>

77
src/pages/index/ztdetail.vue

@ -1,10 +1,6 @@
<template> <template>
<u-navbar <u-navbar :title="titleData.special_id_name ? '“' + titleData.special_id_name + '”' + '专题' : ''" placeholder="true"
:title="titleData.special_id_name ? '“' + titleData.special_id_name + '”' + '专题' : ''" bg-color="#F1F3F9" :auto-back="true"></u-navbar>
placeholder="true"
bg-color="#F1F3F9"
:auto-back="true"
></u-navbar>
<view class="container"> <view class="container">
<view class="titlepart"> <view class="titlepart">
<image style="width: 8rpx; height: 1em" src="@/static/img/Fill1.png" mode=""></image> <image style="width: 8rpx; height: 1em" src="@/static/img/Fill1.png" mode=""></image>
@ -15,16 +11,34 @@
<rich-text :nodes="titleData.content"></rich-text> <rich-text :nodes="titleData.content"></rich-text>
<view class="fbtime">{{ titleData.create_time }}</view> <view class="fbtime">{{ titleData.create_time }}</view>
</view> </view>
<view class="baombut" v-if="titleData.form">
<view class="buttt" @click="gotij(titleData.id, titleData.form)">
立即报名
</view>
</view>
</template> </template>
<script setup> <script setup>
import { onLoad } from '@dcloudio/uni-app' import {
import { ref } from 'vue' onLoad
import { specialListInfo, bannerInfo } from '@/api/index' } from '@dcloudio/uni-app'
import {
ref
} from 'vue'
import {
specialListInfo,
bannerInfo
} from '@/api/index'
const titleData = ref([]) const titleData = ref([])
onLoad(async (param) => { const gotij = (id,item) => {
uni.navigateTo({
url: '/pages/index/subform?form='+JSON.stringify(item)+ '&id='+id
})
}
onLoad(async (param) => {
if (param.type === 'zt') { if (param.type === 'zt') {
const res = await specialListInfo(param.id) const res = await specialListInfo(param.id)
if (res.code === 1) { if (res.code === 1) {
@ -37,21 +51,25 @@ onLoad(async (param) => {
titleData.value = res.data titleData.value = res.data
} }
} }
titleData.value.content = titleData.value.content.replace(/<img/g, '<img style="width: 100%; max-width: 100%; height: auto;"') titleData.value.content = titleData.value.content.replace(/<img/g,
}) '<img style="width: 100%; max-width: 100%; height: auto;"')
})
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.container { .container {
background-color: #ffffff; background-color: #ffffff;
height: calc(100vh - 182rpx); height: calc(100vh - 350rpx);
width: 100%; width: 100%;
padding: 48rpx; padding: 48rpx;
box-sizing: border-box; box-sizing: border-box;
overflow-y: auto;
.titlepart { .titlepart {
display: flex; display: flex;
align-items: baseline; align-items: baseline;
margin-bottom: 40rpx; margin-bottom: 40rpx;
.title { .title {
font-family: Source Han Sans; font-family: Source Han Sans;
font-weight: 550; font-weight: 550;
@ -60,6 +78,7 @@ onLoad(async (param) => {
margin-left: 20rpx; margin-left: 20rpx;
} }
} }
.text { .text {
margin-top: 32rpx; margin-top: 32rpx;
font-family: Source Han Sans; font-family: Source Han Sans;
@ -69,6 +88,7 @@ onLoad(async (param) => {
letter-spacing: normal; letter-spacing: normal;
color: #3d3d3d; color: #3d3d3d;
} }
.fbtime { .fbtime {
font-family: Roboto; font-family: Roboto;
font-size: 28rpx; font-size: 28rpx;
@ -79,5 +99,30 @@ onLoad(async (param) => {
/* 样式描述:06 Small Grey txt */ /* 样式描述:06 Small Grey txt */
color: #a1a1a1; color: #a1a1a1;
} }
} }
.baombut {
width: 100%;
padding: 36rpx 0;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(0, 0, 0, 0.3);
background: #FFFFFF;
position: fixed;
bottom: 0;
.buttt {
width: 574rpx;
height: 96rpx;
border-radius: 248rpx;
background: linear-gradient(90deg, #007FFF 0%, #99CCFF 100%);
font-family: Source Han Sans;
font-size: 36rpx;
color: #FFFFFF;
display: flex;
align-items: center;
justify-content: center;
}
}
</style> </style>
Loading…
Cancel
Save