uni-app 100群公告推送功能
Posted 2019ab
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了uni-app 100群公告推送功能相关的知识,希望对你有一定的参考价值。
/pages/chat/group-remark/group-remark.vue
<template>
<view class="page">
<!-- 导航栏 -->
<free-nav-bar title="群公告" showBack :showRight="true" bgColor="bg-white">
<free-main-button name="推送" slot="right" @click="submit"></free-main-button>
</free-nav-bar>
<textarea v-model="remark" placeholder="暂无公告..." class="bg-white p-2 font-md" style="width:750rpx;" />
</view>
</template>
<script>
import freeNavBar from '@/components/free-ui/free-nav-bar.vue';
import freeMainButton from '@/components/free-ui/free-main-button.vue';
import $H from '@/common/free-lib/request.js';
import auth from '@/common/mixin/auth.js';
export default {
mixins:[auth],
components:{
freeNavBar,
freeMainButton,
},
data() {
return {
remark:'',
id:0
}
},
onLoad(e) {
if(!e.params){
return this.backToast()
}
let params = JSON.parse(e.params);
console.log(params)
this.remark = params.remark;
this.id = params.id;
},
methods: {
submit(){
$H.post('/group/remark',{
id:this.id,
remark:this.remark
}).then(res=>{
uni.showToast({
title:'推送成功',
icon:'none'
});
uni.navigateBack({
delta:res
});
})
}
}
}
</script>
<style>
</style>
页面如下图
感谢大家观看,我们下次见
以上是关于uni-app 100群公告推送功能的主要内容,如果未能解决你的问题,请参考以下文章