| | |
| | | <span>请勿涉及不文明及违规内容,违法必究!</span> |
| | | </div> |
| | | <div class="bottom"> |
| | | <van-button type="primary" @click="submit()">添加留言</van-button> |
| | | <van-button type="primary" @click="submit(2)" v-show="!this.shownim">匿名添加</van-button> |
| | | <van-button type="primary" @click="submit(1)">添加留言</van-button> |
| | | </div> |
| | | </div> |
| | | </template> |
| | |
| | | messagecom: "", |
| | | fileindex: null, |
| | | FileList: [], |
| | | submitlist: [] |
| | | submitlist: [], |
| | | shownim: false |
| | | }; |
| | | }, |
| | | mounted() { |
| | | localStorage.setItem("Appraising", "message"); |
| | | }, |
| | | computed: {}, |
| | | created() {}, |
| | | created() { |
| | | this.shownim = localStorage.getItem("tokensave") == "111"; |
| | | }, |
| | | methods: { |
| | | // 上传图片后的操作 |
| | | afterread(event, indexto) { |
| | |
| | | this.submitlist.splice(filelist.index, 1); |
| | | this.FileList.splice(filelist.index, 1); |
| | | }, |
| | | submit() { |
| | | // 添加留言:1;匿名添加:2 |
| | | submit(index) { |
| | | let toData = { |
| | | userName: "匿名用户", |
| | | content: this.messagecom, |
| | |
| | | if (this.messagecom == "" && this.submitlist.length == 0) { |
| | | this.$toast.fail("留言内容不能为空"); |
| | | } else { |
| | | if (index == 2) { |
| | | toData.userDept = ""; |
| | | toData.userPost = ""; |
| | | toData.userName = "匿名用户"; |
| | | } |
| | | leaveWords(toData).then(res => { |
| | | setTimeout(() => { |
| | | this.$router.push("/"); |
| | |
| | | position: absolute; |
| | | bottom: 50px; |
| | | width: 100%; |
| | | display: flex; |
| | | .van-button { |
| | | width: 90%; |
| | | margin: 0px 10px; |
| | | flex: 1; |
| | | font-size: 18px; |
| | | border-radius: 5px; |
| | | background: linear-gradient(to right, #01bdfc, #017bfc); |