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.

194 lines
4.7 KiB

4 years ago
<template>
4 years ago
<view class="content">
<view class="contentlist">
<view class="content_box">
4 years ago
<view class="content_title" @click="showwhat('shownotice')">
<view class="infoicon">
<u-icon size="16" color="#42b983" name="info-circle-fill"></u-icon>
<text>参观须知</text>
</view>
<u-icon v-if="!show.shownotice" size="16" name="arrow-down"></u-icon>
<u-icon v-if="show.shownotice" size="16" name="arrow-up"></u-icon>
4 years ago
</view>
4 years ago
<view class="content_info" v-if="show.shownotice">
4 years ago
<rich-text :nodes="notice.content"></rich-text>
4 years ago
</view>
4 years ago
</view>
<view class="content_box">
4 years ago
<view class="content_title" @click="showwhat('showask')">
<view class="infoicon">
<u-icon size="16" color="#42b983" name="info-circle-fill"></u-icon>
<text>常见问题</text>
</view>
<u-icon v-if="!show.showask" size="16" name="arrow-down"></u-icon>
<u-icon v-if="show.showask" size="16" name="arrow-up"></u-icon>
4 years ago
</view>
4 years ago
<view class="content_info" v-if="show.showask">
4 years ago
<rich-text :nodes="ask.content"></rich-text>
4 years ago
</view>
4 years ago
</view>
<view class="content_box">
4 years ago
<view class="content_title" @click="showwhat('showform')">
<view class="infoicon">
<u-icon size="16" color="#42b983" 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>
4 years ago
</view>
4 years ago
<view class="content_info" v-if="show.showform">
4 years ago
<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>
4 years ago
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
4 years ago
notice: {},
ask: {},
form: {
mobile: "",
content: ""
4 years ago
},
show:{
shownotice:false,
showask:false,
showform:false
4 years ago
},
urls: {
1: '/api/mobile/other/visit-notice-index',
4: '/api/mobile/other/ask-index'
}
4 years ago
}
},
4 years ago
onLoad() {
4 years ago
var that = this;
4 years ago
that.loadList(1, 1)
that.loadList(1, 4)
4 years ago
},
4 years ago
methods: {
showwhat(type){
// for(var m in this.show){
// if(m==type){
this.show[type] = !this.show[type]
// }
// }
},
4 years ago
loadList(page, type) {
4 years ago
var that = this;
this.util.request({
4 years ago
api: this.urls[type],
4 years ago
data: {
4 years ago
page: page
4 years ago
},
4 years ago
utilSuccess: function(res) {
4 years ago
if (type == 1)
that.notice = res.data[0];
if (type == 4)
that.ask = res.data[0];
4 years ago
},
utilFail: function(res) {
4 years ago
uni.showToast({
icon: "none",
title: res
})
4 years ago
}
4 years ago
})
4 years ago
},
4 years ago
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",
utilSuccess: function(res) {
console.log(res)
uni.showToast({
icon: "none",
title: "投诉建议成功",
complete() {
uni.reLaunch({
url: "/pages/success/success?from=feed"
})
}
})
},
utilFail: function(res) {
that.util.toast(res);
}
4 years ago
})
4 years ago
4 years ago
}
4 years ago
}
}
</script>
<style>
page {
4 years ago
background: #f7f6f4;
4 years ago
}
4 years ago
.content {
4 years ago
padding:0 24rpx 60rpx 24rpx;
min-height: 100vh;
background: #fff;
4 years ago
}
4 years ago
.content_box {
4 years ago
/* background: #FFFFFF;
4 years ago
border-radius: 16rpx;
padding: 30rpx 21rpx;
4 years ago
margin-bottom: 25rpx; */
4 years ago
}
4 years ago
.content_title {
4 years ago
padding: 26rpx 0;
border-bottom: #ddd 1rpx solid;
4 years ago
font-size: 32rpx;
4 years ago
color: #351C1B;
display: flex;
justify-content: space-between;
}
.infoicon view{
display: inline-block!important;
margin-right:20rpx
4 years ago
}
4 years ago
.content_info {
font-size: 28rpx;
4 years ago
font-family: PingFang SC;
font-weight: 400;
4 years ago
color: #828282;
line-height: 40rpx;
padding-top: 32rpx;
4 years ago
}
4 years ago
</style>