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

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

上级 a5d988c9
......@@ -19,9 +19,9 @@ export default {
methods: {
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(
"XGTLTOKEN-COLLECTOR",
resp.access_token.token_content
......
......@@ -135,7 +135,7 @@
<script>
import openvalue from "./open-value.vue";
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"
export default {
components: {
......@@ -173,6 +173,7 @@ export default {
},
openData:[],
userInfo:{},
groupList:[],//群组list
//富文本
details:'',
isClear:false,
......@@ -206,11 +207,47 @@ export default {
this.form.newId = resp.news[0].id;
this.form.column = resp.news[0].一级栏目名;
this.form.title = resp.news[0].标题;
//this.form.radio = ''
//this.form.selected = ''
this.form.radio = resp.news[0].查看限制类型
this.details= resp.news[0].新闻内容_html;
//附件
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 {
});
//获取群组
GroupList().then((resp) => {
this.groupList = resp;
resp.filter(item=>{
this.init.group.data.push({
id:item.group_card_list,
......@@ -347,6 +385,11 @@ export default {
},
//保存
saveApi(json){
this.$toast.loading({
message: "保存中...",
forbidClick: true,
duration: 0,
});
switch(this.status) {
case "add":
//新增
......@@ -355,6 +398,7 @@ export default {
path: "/list",
query: { status: "",},
});
this.$toast.clear();
this.$toast('保存成功');
})
break;
......@@ -366,43 +410,12 @@ export default {
path: "/list",
query: { status: "",},
});
this.$toast.clear();
this.$toast('保存成功');
})
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(){
this.$router.push({
path: "/",
......@@ -413,13 +426,29 @@ export default {
},
//回调人员选择器
onchecked(data){
var arr = [];
this.openData=[]
data.filter((item,i)=>{
this.openData.push({
label:item.split("`")[1],
value:item.split("`")[0],
if(this.form.radio == '4'){
//群组逻辑
data.filter(item=>{
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;
},
//监听选择器
......
......@@ -2,7 +2,7 @@
<div>
<van-sticky>
<van-nav-bar
title="新闻列表"
title="列表"
left-text="返回"
left-arrow
@click-left="onClickLeft"
......@@ -111,8 +111,8 @@
<van-col span="12"><van-button block round plain type="info" class="btn"
@click="goDetail(item.id,item.发布状态标识)" >编辑</van-button></van-col>
<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_('revocation',item.id)" v-if="item.发布状态标识 == 1">撤回</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)" v-if="item.发布状态标识 == 1">撤回</van-button>
</van-col>
</van-row>
</van-cell-group>
......@@ -124,7 +124,7 @@
</template>
<script>
import { MyNewsList,IssueNews,FirstColumn } from "@/common/api/myBaseInfo";
import { MyNewsList,IssueNews,FirstColumn,SendWxMessage,SendPhoneMessage } from "@/common/api/myBaseInfo";
export default {
data() {
return {
......@@ -142,7 +142,7 @@ export default {
//下拉状态(待处理、已处理、取消)
showPopover_title:false,
actions_title:[],
status_title:{ text: "新闻列表", value: "" },
status_title:{ text: "列表", value: "" },
//下拉状态栏目(咨询、投诉)
showPopover: false,
actions: [],
......@@ -153,7 +153,7 @@ export default {
//获取一级栏目
FirstColumn().then((resp) => {
//列表状态
this.actions_title = [{ text: "新闻列表", value: "" }]
this.actions_title = [{ text: "列表", value: "" }]
resp.filter(item=>{
this.actions_title.push({
text:item.field_02,
......@@ -175,9 +175,9 @@ export default {
});
},
//状态
handle_(label,id){
handle_(label,data){
var json={
id:id
id:data.id
}
if(label == 'Issue') json.发布状态标识 = '1';
if(label == 'revocation') json.发布状态标识 = '0';
......@@ -187,7 +187,10 @@ export default {
}).then(() => {
IssueNews(json).then((resp) => {
console.log(label)
if(label == 'Issue') this.$toast('发布成功');
if(label == 'Issue'){
this.$toast('发布成功');
this.sendPush(data);
}
if(label == 'revocation') this.$toast('撤回成功');
this.list = [];
this.onRefresh();
......@@ -196,17 +199,29 @@ export default {
// on cancel
});
},
getData(){
//this.pageIndex = 1;
MyNewsList({
column: this.status_title.value,
state: this.status.value,
query: this.searchValue,
pageIndex: this.pageIndex,
pageSize: this.pageSize,
}).then((resp) => {
this.list = resp.data
})
//////////////消息推送,手机短信////////////
sendPush(data){
//推送
var json={
news_id:data.id,
title:"您有一条新的 《通知消息》",
content:data.标题,
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,
//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:data.id,
title:data.标题,
content:"",
curl:"",
remark:""
}
//手机短信
SendPhoneMessage(json2)
},
//下拉刷新
onRefresh() {
......
Markdown 格式
0% or
您添加了 0 人 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册 或