12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- <template>
- <view class="center">
- <view class="row">
- <view class="left-text">发布公告</view>
- <u--textarea v-model="fleetInfo.notice" placeholder="输入公告文字,0-500字" maxlength="500" autoHeight count></u--textarea>
- </view>
- <u-button type="primary" @click="submit">提交</u-button>
- <u-toast ref="uToast"></u-toast>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- id:"",
- fleetInfo:{
- notice:"",
- }
- }
- },
- onShow() {
- },
- onLoad(option) {
- this.id = option.id
- this.getList()
- },
- methods: {
- getList(){
- this.$request.baseRequest('get', '/fleetInfo/getFleetInfo', { //获取该车队的信息,用于提交发布信息
- id: this.id
- }).then(res => {
- this.fleetInfo = res.data
- })
- .catch(res => {
- uni.$u.toast(res.message);
- });
- },
- submit(){
- if(!this.fleetInfo.notice){
- this.$refs.uToast.show({
- type: 'error',
- message: "请输入公告内容!",
- })
- return
- }
- this.fleetInfo.flag = 1
- this.$request.baseRequest('post', '/fleetInfo/api/editFleetInfo',this.fleetInfo).then(res => {
- if (res.code == 200) {
- this.$refs.uToast.show({
- type: 'success',
- message: "公告发布成功!",
- complete() {
- // uni.$u.route("pages/riders/myTeam")
- uni.navigateBack({
- delta: 1
- });
- }
- })
- }
- // this.fleetInfo = res.data
- })
- .catch(res => {
- uni.$u.toast(res.message);
- });
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .center {
- padding: 30rpx;
- }
- .form_css {
- width: 100%;
- display: flex;
- margin: 20rpx 0;
- height: 60rpx;
- border-bottom: 1px solid #eeeeee;
- .left-text {
- width: 50%;
- text-align: left;
- }
- .right-text {
- width: 50%;
- justify-content: flex-end;
- display: flex;
- text-align: right;
- }
- }
- </style>
|