| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- <template>
- <view class="">
- <u-toast ref="uToast"/>
- <view class="content">
- <u-form :model="model" label-position="top" ref="uForm">
- <u-form-item :required="true" label="公告标题">
- <u-input :border="true" v-model="model.title" placeholder="请输入公告标题"/>
- </u-form-item>
- <u-form-item :required="true" label="公告内容">
- <u-input :border="true" type="textarea" height="500" placeholder="请输入公告内容" v-model="model.notice" />
- </u-form-item>
- </u-form>
- </view>
- <view @click="confirm" class="bottom-bar" style="position: fixed;bottom:40rpx;">
- <view class="cu-btn base-bg-color radius" style="width: 80%;height: 84rpx;">
- 提交
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- model:{}
- }
- },
- methods: {
- confirm(){
- let agencyId=this.$cache.get('agencyId')
- if (this.$isEmpty(agencyId)) {
- this.$showToast('系统错误','error')
- return
- }
- if (this.$isEmpty(this.model.title)) {
- this.$showToast('请输入标题','error')
- return
- }
- if (this.$isEmpty(this.model.notice)) {
- this.$showToast('请输入内容','error')
- return
- }
- this.model.agencyId=agencyId
- this.$api.notice.submit(this.model).then(res=>{
- if (res.success) {
- this.$showModel('发布成功',false).then(res=>{
- uni.navigateBack({
- delta:1
- })
- })
- }else{
- this.$showToast('发布失败')
- }
- })
- }
- }
- }
- </script>
- <style lang="scss">
- page{
- background-color: #FFFFFF;
- }
- .content{
- padding: 30rpx;
- }
- </style>
|