dev
commit
2a1fc53bfd
@ -1,188 +1,188 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<view class="contentlist">
|
<view class="contentlist">
|
||||||
<block v-for="(item,index) in noticeList" :key="index">
|
<block v-for="(item,index) in noticeList" :key="index">
|
||||||
<view class="content_box">
|
<view class="content_box">
|
||||||
<view class="content_title" @click="showwhat(index)">
|
<view class="content_title" @click="showwhat(index)">
|
||||||
|
|
||||||
<view class="infoicon">
|
<view class="infoicon">
|
||||||
<u-icon size="16" color="#42b983" name="info-circle-fill"></u-icon>
|
<u-icon size="16" color="#42b983" name="info-circle-fill"></u-icon>
|
||||||
<text>{{item.name}}</text>
|
<text>{{item.name}}</text>
|
||||||
</view>
|
</view>
|
||||||
<u-icon v-if="!item.shownotice" size="16" name="arrow-down"></u-icon>
|
<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>
|
<u-icon v-if="item.shownotice" size="16" name="arrow-up"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
<view class="content_info" v-if="item.shownotice">
|
<view class="content_info" v-if="item.shownotice">
|
||||||
<rich-text style="text-indent: 2em;" :nodes="item.content"></rich-text>
|
<rich-text style="text-indent: 2em;" :nodes="item.content"></rich-text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</block>
|
</block>
|
||||||
<view class="content_box">
|
<view class="content_box">
|
||||||
<view class="content_title" @click="showwhat('showform')">
|
<view class="content_title" @click="showwhat('showform')">
|
||||||
|
|
||||||
<view class="infoicon">
|
<view class="infoicon">
|
||||||
<u-icon size="16" color="#42b983" name="info-circle-fill"></u-icon>
|
<u-icon size="16" color="#42b983" name="info-circle-fill"></u-icon>
|
||||||
<text>意见建议</text>
|
<text>意见建议</text>
|
||||||
</view>
|
</view>
|
||||||
<u-icon v-if="!show.showform" size="16" name="arrow-down"></u-icon>
|
<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>
|
<u-icon v-if="show.showform" size="16" name="arrow-up"></u-icon>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<view class="content_info" v-if="show.showform">
|
<view class="content_info" v-if="show.showform">
|
||||||
<u-form labelPosition="top" :model="form">
|
<u-form labelPosition="top" :model="form">
|
||||||
<u-form-item label="手机号" prop="mobile" labelWidth="60px" required>
|
<u-form-item label="手机号" prop="mobile" labelWidth="60px" required>
|
||||||
<u-input v-model="form.mobile" placeholder="请输入手机号"></u-input>
|
<u-input v-model="form.mobile" placeholder="请输入手机号"></u-input>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="内容" prop="content" labelWidth="60px" required>
|
<u-form-item label="内容" prop="content" labelWidth="60px" required>
|
||||||
<u-textarea v-model="form.content" placeholder="请输入内容"></u-textarea>
|
<u-textarea v-model="form.content" placeholder="请输入内容"></u-textarea>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
</u-form>
|
</u-form>
|
||||||
<u-button type="primary" @click="tosubmit">确认提交</u-button>
|
<u-button type="primary" @click="tosubmit">确认提交</u-button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
notice: {},
|
notice: {},
|
||||||
ask: {},
|
ask: {},
|
||||||
form: {
|
form: {
|
||||||
mobile: "",
|
mobile: "",
|
||||||
content: ""
|
content: ""
|
||||||
},
|
},
|
||||||
show: {
|
show: {
|
||||||
shownotice: false,
|
shownotice: false,
|
||||||
showask: false,
|
showask: false,
|
||||||
showform: false
|
showform: false
|
||||||
},
|
},
|
||||||
urls: {
|
urls: {
|
||||||
1: '/api/mobile/other/visit-notice-index',
|
1: '/api/mobile/other/visit-notice-index',
|
||||||
4: '/api/mobile/other/ask-index'
|
4: '/api/mobile/other/ask-index'
|
||||||
},
|
},
|
||||||
noticeList: []
|
noticeList: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
var that = this;
|
var that = this;
|
||||||
that.loadList(1, 1)
|
that.loadList(1, 1)
|
||||||
//that.loadList(1, 4)
|
//that.loadList(1, 4)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
showwhat(type) {
|
showwhat(type) {
|
||||||
if (type == "showform")
|
if (type == "showform")
|
||||||
this.show[type] = !this.show[type];
|
this.show[type] = !this.show[type];
|
||||||
else
|
else
|
||||||
this.noticeList[type].shownotice = !this.noticeList[type].shownotice;
|
this.noticeList[type].shownotice = !this.noticeList[type].shownotice;
|
||||||
this.$forceUpdate();
|
this.$forceUpdate();
|
||||||
},
|
},
|
||||||
loadList(page, type) {
|
loadList(page, type) {
|
||||||
var that = this;
|
var that = this;
|
||||||
this.util.request({
|
this.util.request({
|
||||||
api: this.urls[type],
|
api: this.urls[type],
|
||||||
data: {
|
data: {
|
||||||
page: page
|
page: page
|
||||||
},
|
},
|
||||||
utilSuccess: function(res) {
|
utilSuccess: function(res) {
|
||||||
if (type == 1)
|
if (type == 1)
|
||||||
that.notice = res.data[0];
|
that.notice = res.data[0];
|
||||||
if (type == 4)
|
if (type == 4)
|
||||||
that.ask = res.data[0];
|
that.ask = res.data[0];
|
||||||
for (var mod of res.data) {
|
for (var mod of res.data) {
|
||||||
mod.shownotice = false;
|
mod.shownotice = false;
|
||||||
}
|
}
|
||||||
that.noticeList = res.data
|
that.noticeList = res.data
|
||||||
},
|
},
|
||||||
utilFail: function(res) {
|
utilFail: function(res) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
icon: "none",
|
icon: "none",
|
||||||
title: res
|
title: res
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
tosubmit() {
|
tosubmit() {
|
||||||
let that = this;
|
let that = this;
|
||||||
if (this.util.isNull(that.form.mobile)) {
|
if (this.util.isNull(that.form.mobile)) {
|
||||||
this.util.toast("请填写手机号!");
|
this.util.toast("请填写手机号!");
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
if (!uni.$u.test.mobile(that.form.mobile)) {
|
if (!uni.$u.test.mobile(that.form.mobile)) {
|
||||||
this.util.toast("请填写正确的手机号!");
|
this.util.toast("请填写正确的手机号!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (this.util.isNull(that.form.content)) {
|
if (this.util.isNull(that.form.content)) {
|
||||||
this.util.toast("请填写内容!");
|
this.util.toast("请填写内容!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
this.util.request({
|
this.util.request({
|
||||||
api: '/api/mobile/other/tip-store',
|
api: '/api/mobile/other/tip-store',
|
||||||
data: this.form,
|
data: this.form,
|
||||||
method: "POST",
|
method: "POST",
|
||||||
utilSuccess: function(res) {
|
utilSuccess: function(res) {
|
||||||
console.log(res)
|
console.log(res)
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
icon: "none",
|
icon: "none",
|
||||||
title: "投诉建议成功",
|
title: "投诉建议成功",
|
||||||
complete() {
|
complete() {
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: "/pages/success/success?from=feed"
|
url: "/pages/success/success?from=feed"
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
utilFail: function(res) {
|
utilFail: function(res) {
|
||||||
that.util.toast(res);
|
that.util.toast(res);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
page {
|
page {
|
||||||
background: #f7f6f4;
|
background: #f7f6f4;
|
||||||
}
|
}
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
padding: 0 24rpx 60rpx 24rpx;
|
padding: 0 24rpx 60rpx 24rpx;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.content_box {
|
.content_box {
|
||||||
/* background: #FFFFFF;
|
/* background: #FFFFFF;
|
||||||
border-radius: 16rpx;
|
border-radius: 16rpx;
|
||||||
padding: 30rpx 21rpx;
|
padding: 30rpx 21rpx;
|
||||||
margin-bottom: 25rpx; */
|
margin-bottom: 25rpx; */
|
||||||
}
|
}
|
||||||
|
|
||||||
.content_title {
|
.content_title {
|
||||||
padding: 26rpx 0;
|
padding: 26rpx 0;
|
||||||
border-bottom: #ddd 1rpx solid;
|
border-bottom: #ddd 1rpx solid;
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
color: #351C1B;
|
color: #351C1B;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
}
|
}
|
||||||
|
|
||||||
.infoicon view {
|
.infoicon view {
|
||||||
display: inline-block !important;
|
display: inline-block !important;
|
||||||
margin-right: 20rpx
|
margin-right: 20rpx
|
||||||
}
|
}
|
||||||
|
|
||||||
.content_info {
|
.content_info {
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
font-family: PingFang SC;
|
font-family: PingFang SC;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: #828282;
|
color: #828282;
|
||||||
line-height: 40rpx;
|
line-height: 40rpx;
|
||||||
padding-top: 32rpx;
|
padding-top: 32rpx;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Loading…
Reference in new issue