提交 a66ba487 编写于 作者: 麦嘉得's avatar 麦嘉得

①完善第一版手机端发新闻v230112

上级 a5d988c9
...@@ -19,9 +19,9 @@ export default { ...@@ -19,9 +19,9 @@ export default {
methods: { methods: {
SSO(code, sign, timestamp) { SSO(code, sign, timestamp) {
//测试阶段 //测试阶段
TestSSO({ card: "asc666" }).then((resp) => { //TestSSO({ card: "asc666" }).then((resp) => {
//部署阶段 //部署阶段
//wxSSO({ code: code, sign: sign, timestamp: timestamp }).then((resp) => { wxSSO({ code: code, sign: sign, timestamp: timestamp }).then((resp) => {
this.UTIL.setCookie( this.UTIL.setCookie(
"XGTLTOKEN-COLLECTOR", "XGTLTOKEN-COLLECTOR",
resp.access_token.token_content resp.access_token.token_content
......
...@@ -135,7 +135,7 @@ ...@@ -135,7 +135,7 @@
<script> <script>
import openvalue from "./open-value.vue"; import openvalue from "./open-value.vue";
import wangeditor from '@/components/wang-editor' import wangeditor from '@/components/wang-editor'
import { FirstColumn,DeptList,TeacherList,GroupList,SendWxMessage,SendPhoneMessage,addNews,EditNews,GetNewsInfo } from "@/common/api/myBaseInfo"; import { FirstColumn,DeptList,TeacherList,GroupList,addNews,EditNews,GetNewsInfo } from "@/common/api/myBaseInfo";
import {news_upfile} from "@/common/api/common" import {news_upfile} from "@/common/api/common"
export default { export default {
components: { components: {
...@@ -173,6 +173,7 @@ export default { ...@@ -173,6 +173,7 @@ export default {
}, },
openData:[], openData:[],
userInfo:{}, userInfo:{},
groupList:[],//群组list
//富文本 //富文本
details:'', details:'',
isClear:false, isClear:false,
...@@ -206,11 +207,47 @@ export default { ...@@ -206,11 +207,47 @@ export default {
this.form.newId = resp.news[0].id; this.form.newId = resp.news[0].id;
this.form.column = resp.news[0].一级栏目名; this.form.column = resp.news[0].一级栏目名;
this.form.title = resp.news[0].标题; this.form.title = resp.news[0].标题;
//this.form.radio = '' this.form.radio = resp.news[0].查看限制类型
//this.form.selected = ''
this.details= resp.news[0].新闻内容_html; this.details= resp.news[0].新闻内容_html;
//附件 //附件
this.file_list = resp.files; this.file_list = resp.files;
//人员状态
this.openData = [];
switch(this.form.radio) {
case "1":
break;
case "2":
var dept = resp.news[0].可查看部门集合
var str = dept.split(",")
str.filter(item=>{
this.openData.push({
label:item,
value:item
});
})
break;
case "3":
var people = resp.news[0].可查看人集合
var str = people.split(",")
str.filter(item=>{
this.openData.push({
label:item,
value:item
});
})
break;
case "4":
var group = resp.news[0].可查看人集合
var str = group.split(",")
str.filter(item=>{
this.openData.push({
label:item,
value:item
});
})
break;
}
}) })
} }
}); });
...@@ -235,6 +272,7 @@ export default { ...@@ -235,6 +272,7 @@ export default {
}); });
//获取群组 //获取群组
GroupList().then((resp) => { GroupList().then((resp) => {
this.groupList = resp;
resp.filter(item=>{ resp.filter(item=>{
this.init.group.data.push({ this.init.group.data.push({
id:item.group_card_list, id:item.group_card_list,
...@@ -347,6 +385,11 @@ export default { ...@@ -347,6 +385,11 @@ export default {
}, },
//保存 //保存
saveApi(json){ saveApi(json){
this.$toast.loading({
message: "保存中...",
forbidClick: true,
duration: 0,
});
switch(this.status) { switch(this.status) {
case "add": case "add":
//新增 //新增
...@@ -355,6 +398,7 @@ export default { ...@@ -355,6 +398,7 @@ export default {
path: "/list", path: "/list",
query: { status: "",}, query: { status: "",},
}); });
this.$toast.clear();
this.$toast('保存成功'); this.$toast('保存成功');
}) })
break; break;
...@@ -366,43 +410,12 @@ export default { ...@@ -366,43 +410,12 @@ export default {
path: "/list", path: "/list",
query: { status: "",}, query: { status: "",},
}); });
this.$toast.clear();
this.$toast('保存成功'); this.$toast('保存成功');
}) })
break; break;
} }
}, },
addApi(data){
//提交api
addNews(data).then((resp) => {
var json={
news_id:resp,
title:"您有一条新的 《通知消息》",
content:this.form.title,
curl:window.location.protocol + "//" + window.location.host + "/wx/eicrs/Home/wxAccInt?Redirect=" + window.location.protocol + "//" + window.location.host + "/wx/WxAIC/TeaCher/AICNotice/showContent.aspx?id=" + resp,
//curl:"https://asc.hnasct.cn/wx/eicrs/Home/wxAccInt?Redirect=https://asc.hnasct.cn/wx/WxAIC/TeaCher/AICNotice/showContent.aspx?id=" + resp,
remark:""
}
//微信消息推送
SendWxMessage(json)
var json2={
news_id:resp,
title:this.form.title,
content:"",
curl:"",
remark:""
}
//手机短信
SendPhoneMessage(json2)
this.$dialog.alert({
message: '操作成功',
}).then(() => {
// on close
window.location.href="/wx/eicrs/Home/TeaCenter";
});
})
},
back(){ back(){
this.$router.push({ this.$router.push({
path: "/", path: "/",
...@@ -413,13 +426,29 @@ export default { ...@@ -413,13 +426,29 @@ export default {
}, },
//回调人员选择器 //回调人员选择器
onchecked(data){ onchecked(data){
var arr = [];
this.openData=[] this.openData=[]
data.filter((item,i)=>{ if(this.form.radio == '4'){
this.openData.push({ //群组逻辑
label:item.split("`")[1], data.filter(item=>{
value:item.split("`")[0], arr.push(item.split("`")[0])
}) })
}) arr = arr.toString().split(",");
var new_arr = this.arrayUnique1(arr)
new_arr.filter((res,i)=>{
this.openData.push({
label:res,
value:res,
})
})
}else{
data.filter((item,i)=>{
this.openData.push({
label:item.split("`")[1],
value:item.split("`")[0],
})
})
}
this.init.name.showFlag=false; this.init.name.showFlag=false;
}, },
//监听选择器 //监听选择器
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div> <div>
<van-sticky> <van-sticky>
<van-nav-bar <van-nav-bar
title="新闻列表" title="列表"
left-text="返回" left-text="返回"
left-arrow left-arrow
@click-left="onClickLeft" @click-left="onClickLeft"
...@@ -111,8 +111,8 @@ ...@@ -111,8 +111,8 @@
<van-col span="12"><van-button block round plain type="info" class="btn" <van-col span="12"><van-button block round plain type="info" class="btn"
@click="goDetail(item.id,item.发布状态标识)" >编辑</van-button></van-col> @click="goDetail(item.id,item.发布状态标识)" >编辑</van-button></van-col>
<van-col span="12"> <van-col span="12">
<van-button block round plain type="info" class="btn" @click="handle_('Issue',item.id)" v-if="item.发布状态标识 == 0">发布</van-button> <van-button block round plain type="info" class="btn" @click="handle_('Issue',item)" v-if="item.发布状态标识 == 0">发布</van-button>
<van-button block round plain type="info" class="btn" @click="handle_('revocation',item.id)" v-if="item.发布状态标识 == 1">撤回</van-button> <van-button block round plain type="info" class="btn" @click="handle_('revocation',item)" v-if="item.发布状态标识 == 1">撤回</van-button>
</van-col> </van-col>
</van-row> </van-row>
</van-cell-group> </van-cell-group>
...@@ -124,7 +124,7 @@ ...@@ -124,7 +124,7 @@
</template> </template>
<script> <script>
import { MyNewsList,IssueNews,FirstColumn } from "@/common/api/myBaseInfo"; import { MyNewsList,IssueNews,FirstColumn,SendWxMessage,SendPhoneMessage } from "@/common/api/myBaseInfo";
export default { export default {
data() { data() {
return { return {
...@@ -142,7 +142,7 @@ export default { ...@@ -142,7 +142,7 @@ export default {
//下拉状态(待处理、已处理、取消) //下拉状态(待处理、已处理、取消)
showPopover_title:false, showPopover_title:false,
actions_title:[], actions_title:[],
status_title:{ text: "新闻列表", value: "" }, status_title:{ text: "列表", value: "" },
//下拉状态栏目(咨询、投诉) //下拉状态栏目(咨询、投诉)
showPopover: false, showPopover: false,
actions: [], actions: [],
...@@ -153,7 +153,7 @@ export default { ...@@ -153,7 +153,7 @@ export default {
//获取一级栏目 //获取一级栏目
FirstColumn().then((resp) => { FirstColumn().then((resp) => {
//列表状态 //列表状态
this.actions_title = [{ text: "新闻列表", value: "" }] this.actions_title = [{ text: "列表", value: "" }]
resp.filter(item=>{ resp.filter(item=>{
this.actions_title.push({ this.actions_title.push({
text:item.field_02, text:item.field_02,
...@@ -175,9 +175,9 @@ export default { ...@@ -175,9 +175,9 @@ export default {
}); });
}, },
//状态 //状态
handle_(label,id){ handle_(label,data){
var json={ var json={
id:id id:data.id
} }
if(label == 'Issue') json.发布状态标识 = '1'; if(label == 'Issue') json.发布状态标识 = '1';
if(label == 'revocation') json.发布状态标识 = '0'; if(label == 'revocation') json.发布状态标识 = '0';
...@@ -187,7 +187,10 @@ export default { ...@@ -187,7 +187,10 @@ export default {
}).then(() => { }).then(() => {
IssueNews(json).then((resp) => { IssueNews(json).then((resp) => {
console.log(label) console.log(label)
if(label == 'Issue') this.$toast('发布成功'); if(label == 'Issue'){
this.$toast('发布成功');
this.sendPush(data);
}
if(label == 'revocation') this.$toast('撤回成功'); if(label == 'revocation') this.$toast('撤回成功');
this.list = []; this.list = [];
this.onRefresh(); this.onRefresh();
...@@ -196,17 +199,29 @@ export default { ...@@ -196,17 +199,29 @@ export default {
// on cancel // on cancel
}); });
}, },
getData(){ //////////////消息推送,手机短信////////////
//this.pageIndex = 1; sendPush(data){
MyNewsList({ //推送
column: this.status_title.value, var json={
state: this.status.value, news_id:data.id,
query: this.searchValue, title:"您有一条新的 《通知消息》",
pageIndex: this.pageIndex, content:data.标题,
pageSize: this.pageSize, curl:window.location.protocol + "//" + window.location.host + "/wx/eicrs/Home/wxAccInt?Redirect=" + window.location.protocol + "//" + window.location.host + "/wx/WxAIC/TeaCher/AICNotice/showContent.aspx?id=" + data.id,
}).then((resp) => { //curl:"https://asc.hnasct.cn/wx/eicrs/Home/wxAccInt?Redirect=https://asc.hnasct.cn/wx/WxAIC/TeaCher/AICNotice/showContent.aspx?id=" + resp,
this.list = resp.data remark:""
}) }
//微信消息推送
SendWxMessage(json)
var json2={
news_id:data.id,
title:data.标题,
content:"",
curl:"",
remark:""
}
//手机短信
SendPhoneMessage(json2)
}, },
//下拉刷新 //下拉刷新
onRefresh() { onRefresh() {
......
Markdown 格式
0% or
您添加了 0 人 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册 或