You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

387 lines
9.3 KiB

2 years ago
<template>
<view class="content">
<view class='openinfo'>
<view>
<view>
<span></span>
<span>开放信息</span>
</view>
</view>
<view>
2 years ago
<view class='open_info'>
<block v-for="(item,key) of openInfoObj">
2 years ago
<view v-if="key!='提醒' && key!='地址' && key!='咨询电话' && key!='服务时间'">
2 years ago
<view>{{item}}</view>
<view>{{key}}</view>
</view>
2 years ago
</block>
2 years ago
</view>
<!-- <uParse></uParse> -->
<view class='open_text'>
<u-parse v-if='showContent' :content="openInfoHtml?openInfoHtml:' '"/>
2 years ago
</view>
2 years ago
<!-- <view class='open_text'>
2 years ago
<span></span>
{{openInfoObj['提醒']?openInfoObj['提醒']:''}}
2 years ago
</view>
<view class='open_text'>
<span></span>
2 years ago
{{openInfoObj['服务时间']?openInfoObj['服务时间']:''}}
2 years ago
</view>
<view class='open_text'>
<span></span>
2 years ago
地址{{openInfoObj['地址']?openInfoObj['地址']:''}}
2 years ago
</view>
<view class='open_text'>
<span></span>
2 years ago
咨询电话{{openInfoObj['咨询电话']?openInfoObj['咨询电话']:''}}
</view> -->
2 years ago
</view>
2 years ago
</view>
2 years ago
<view class="back40"></view>
<view class="contentlist">
<block v-for="(item,index) in noticeList" :key="index">
<view class="content_box" v-if="item.name!='开放信息'">
<view class="content_title" @click="showwhat(index)">
<view class="infoicon">
<u-icon size="16" color="#cf995a" name="info-circle-fill"></u-icon>
<text>{{item.name}}</text>
</view>
<u-icon v-if="!item.shownotice" size="16" name="arrow-down"></u-icon>
<u-icon v-if="item.shownotice" size="16" name="arrow-up"></u-icon>
</view>
<view class="content_info" v-if="item.shownotice">
<rich-text style="text-indent: 2em;font-size: 28rpx;" :nodes="item.content"></rich-text>
</view>
</view>
</block>
2 years ago
<view class="content_box">
2 years ago
<view class="content_title" @click="showwhat('showform')">
<view class="infoicon">
<u-icon size="16" color="#cf995a" name="info-circle-fill"></u-icon>
<text>意见建议</text>
</view>
<u-icon v-if="!show.showform" size="16" name="arrow-down"></u-icon>
<u-icon v-if="show.showform" size="16" name="arrow-up"></u-icon>
</view>
<view class="content_info" v-if="show.showform">
<u-form labelPosition="top" :model="form">
<u-form-item label="手机号" prop="mobile" labelWidth="60px" required>
<u-input v-model="form.mobile" placeholder="请输入手机号"></u-input>
</u-form-item>
<u-form-item label="内容" prop="content" labelWidth="60px" required>
<u-textarea v-model="form.content" placeholder="请输入内容"></u-textarea>
</u-form-item>
</u-form>
<u-button type="primary" @click="tosubmit"></u-button>
</view>
2 years ago
</view>
2 years ago
</view>
<tabbar :current-page="1"></tabbar>
</view>
</template>
<script>
2 years ago
import tabbar from "../../components/tabbar/tabbar.vue"
import uParse from '@/components/gaoyia-parse/parse.vue'
2 years ago
export default {
components: {
2 years ago
tabbar,
uParse
2 years ago
},
data() {
return {
notice: {},
ask: {},
form: {
mobile: "",
content: ""
},
2 years ago
openInfoObj: {},
openInfoHtml:'',
showContent:false,
2 years ago
show: {
shownotice: false,
showask: false,
showform: false
},
urls: {
1: '/api/mobile/other/visit-notice-index',
4: '/api/mobile/other/ask-index'
},
noticeList: []
}
},
onLoad() {
var that = this;
that.loadList(1, 1)
//that.loadList(1, 4)
},
2 years ago
onShareAppMessage() {
return this.util.shareInfo
},
onShareTimeline(){
return this.util.shareInfo
2 years ago
},
methods: {
showwhat(type) {
if (type == "showform")
this.show[type] = !this.show[type];
else
this.noticeList[type].shownotice = !this.noticeList[type].shownotice;
this.$forceUpdate();
},
loadList(page, type) {
var that = this;
this.util.request({
api: this.urls[type],
data: {
page: page
},
utilSuccess: function(res) {
if (type == 1)
that.notice = res.data[0];
if (type == 4)
that.ask = res.data[0];
for (var mod of res.data) {
2 years ago
mod.shownotice = false;
if (mod.name === '开放信息') {
let str = mod.content
let beforeIndex = str.indexOf("<p>") + 3
let afterIndex = str.indexOf("</p>")
let openStr = str.substring(beforeIndex, afterIndex)
let openArr = openStr.split('|')
for (let o of openArr) {
2 years ago
let oArr = o.split('')
if(oArr[1].indexOf('&mdash;')>-1){
2 years ago
oArr[1] = oArr[1].replace(/&mdash;/g,'—')
}
2 years ago
that.openInfoObj[oArr[0]] = oArr[1]
2 years ago
}
let libeforeIndex = str.indexOf("<ul>") + 4
let liafterIndex = str.indexOf("</ul>")
that.openInfoHtml = str.substring(libeforeIndex, liafterIndex)
that.showContent = true
2 years ago
}
}
that.noticeList = res.data
},
utilFail: function(res) {
uni.showToast({
icon: "none",
title: res
})
}
})
},
tosubmit() {
let that = this;
if (this.util.isNull(that.form.mobile)) {
this.util.toast("请填写手机号!");
return false;
} else {
if (!uni.$u.test.mobile(that.form.mobile)) {
this.util.toast("请填写正确的手机号!");
return false;
}
}
if (this.util.isNull(that.form.content)) {
this.util.toast("请填写内容!");
return false;
}
this.util.request({
api: '/api/mobile/other/tip-store',
data: this.form,
method: "POST",
2 years ago
utilSuccess: function(res) {
uni.showToast({
icon: "none",
title: "提交成功"
})
2 years ago
that.newsSubscription();
},
utilFail: function(res) {
that.util.toast(res);
}
})
3 years ago
},
newsSubscription() {
uni.getSetting({
withSubscriptions: true, //是否获取用户订阅消息的订阅状态默认false不返回
success(res) {
if (res.authSetting['scope.subscribeMessage']) {
uni.redirectTo({
url: '/pages/success/success?from=feed'
})
} else {
// 用户没有点击“总是保持以上,不再询问”则每次都会调起订阅消息
uni.requestSubscribeMessage({
2 years ago
tmplIds: ['12MYVOc27cEbWbBMgdfDqtNkvu4z81vRV2ZhiB755L0'],
3 years ago
success(res) {
uni.showToast({
title: '订阅成功'
})
uni.redirectTo({
url: '/pages/success/success?from=feed'
})
}
})
}
}
});
2 years ago
}
}
}
</script>
2 years ago
<style>
@import url("/components/gaoyia-parse/parse.css");
2 years ago
page {
background: #f7f6f4;
}
.content {
/* padding: 0 24rpx 60rpx 24rpx; */
min-height: 100vh;
background: #fff;
padding-bottom: 200rpx;
}
2 years ago
.back40 {
width: 100%;
height: 40rpx;
background: #f6f6f6;
2 years ago
}
2 years ago
2 years ago
.openinfo {
background-color: #fff;
border-top: 1px solid #ccc;
padding: 35rpx 20rpx;
}
.openinfo>view:first-child view span:first-child {
background-color: #DEA166;
width: 5rpx;
height: 40rpx;
margin-right: 22rpx;
display: inline-block;
vertical-align: text-top;
}
.open_info {
display: flex;
justify-content: space-between;
padding: 36rpx 0;
}
.open_info>view {
border: 1px solid #c48944;
border-radius: 10rpx;
text-align: center;
}
.open_info view view {
padding: 10rpx 50rpx;
}
.open_info view view:first-child {
background-color: #f5ebde;
color: #c48944;
font-size: 36rpx;
border-radius: 10rpx 10rpx 0 0;
}
.open_info view view:last-child {
border-radius: 0 0 10rpx 10rpx;
}
.open_text {
color: #252525;
2 years ago
font-size: 28rpx;
line-height: 2.3;
2 years ago
}
2 years ago
.open_text .li{
line-height: 2.3;
}
.open_text .li::before{
content:'';
width: 8rpx;
height: 8rpx;
border-radius: 8rpx;
background-color: #BFBFBF;
display: inline-block;
vertical-align: middle;
margin: 0 10rpx;
margin-top: -6rpx;
}
2 years ago
.open_text span {
2 years ago
width: 8rpx;
height: 8rpx;
border-radius: 8rpx;
background-color: #BFBFBF;
display: inline-block;
vertical-align: middle;
margin: 0 16rpx;
2 years ago
margin-top: -6rpx;
}
.content_box {
/* background: #FFFFFF;
border-radius: 16rpx;
padding: 30rpx 21rpx;
margin-bottom: 25rpx; */
}
.content_title {
padding: 26rpx 0;
border-bottom: #ddd 1rpx solid;
font-size: 32rpx;
color: #351C1B;
display: flex;
justify-content: space-between;
}
2 years ago
.contentlist {
background-color: #fff;
padding: 35rpx 20rpx;
padding-top: 9rpx;
2 years ago
}
2 years ago
2 years ago
.infoicon view {
display: inline-block !important;
margin-right: 20rpx
}
.content_info {
font-size: 28rpx;
font-family: PingFang SC;
font-weight: 400;
color: #828282;
line-height: 40rpx;
2 years ago
padding-top: 32rpx;
line-height: 2.3;
2 years ago
}
2 years ago
.u-form {
padding: 0 32rpx !important;
padding: 0 20rpx !important;
padding-right: 0 !important;
2 years ago
}
.u-form-item__body__left__content__required{
margin-left: 18rpx!important;
}
.u-form-item__body__left__content__label{
margin-left: 30rpx!important;
width:200rpx;
2 years ago
}
2 years ago
</style>