|
@@ -18,6 +18,8 @@ Page({
|
|
ftype: "", //通告类型
|
|
ftype: "", //通告类型
|
|
popups: false,
|
|
popups: false,
|
|
checkboxShow: false, //多选
|
|
checkboxShow: false, //多选
|
|
|
|
+ fisspecifiedrange: 0, // 是否指定范围,0否 1 是
|
|
|
|
+ include: [], //包含范围
|
|
partnerList: [], //合作商列表
|
|
partnerList: [], //合作商列表
|
|
coverFiles: [], //封面
|
|
coverFiles: [], //封面
|
|
defaultFiles: [], //附件
|
|
defaultFiles: [], //附件
|
|
@@ -42,16 +44,16 @@ Page({
|
|
"tnoticeid": options.id
|
|
"tnoticeid": options.id
|
|
}
|
|
}
|
|
}).then(res => {
|
|
}).then(res => {
|
|
|
|
+ console.log("详情", res)
|
|
if (res.msg != '成功') return wx.showToast({
|
|
if (res.msg != '成功') return wx.showToast({
|
|
title: res.data,
|
|
title: res.data,
|
|
icon: "none"
|
|
icon: "none"
|
|
});
|
|
});
|
|
- console.log(res.data[0].fisspecifiedrange)
|
|
|
|
let data = res.data[0],
|
|
let data = res.data[0],
|
|
attinfos = res.data[0].attinfos,
|
|
attinfos = res.data[0].attinfos,
|
|
coverFiles = [],
|
|
coverFiles = [],
|
|
defaultFiles = [],
|
|
defaultFiles = [],
|
|
- ftype = (data.ftype == '商户') ? '商户公告' : '团队公告';
|
|
|
|
|
|
+ ftype = (data.ftype == '商户') ? '合作商通告' : '团队通告';
|
|
for (let i = 0; i < attinfos.length; i++) {
|
|
for (let i = 0; i < attinfos.length; i++) {
|
|
let img = {
|
|
let img = {
|
|
name: attinfos[i].serialnumber,
|
|
name: attinfos[i].serialnumber,
|
|
@@ -63,6 +65,30 @@ Page({
|
|
};
|
|
};
|
|
(img.ftype == "default") ? defaultFiles.push(img): coverFiles.push(img)
|
|
(img.ftype == "default") ? defaultFiles.push(img): coverFiles.push(img)
|
|
}
|
|
}
|
|
|
|
+ if (data.ftype == '商户' && data.fisspecifiedrange == 1) {
|
|
|
|
+ //查询指定范围
|
|
|
|
+ _Http.basic({
|
|
|
|
+ "accesstoken": wx.getStorageSync('userData').token,
|
|
|
|
+ "classname": "customer.noticemag.noticemag",
|
|
|
|
+ "method": "query_noticeuserList",
|
|
|
|
+ "content": {
|
|
|
|
+ "tnoticeid": options.id
|
|
|
|
+ }
|
|
|
|
+ }).then(s => {
|
|
|
|
+ console.log("查询范围", s)
|
|
|
|
+ if (s.msg != '成功') return wx.showToast({
|
|
|
|
+ title: res.data,
|
|
|
|
+ icon: "none"
|
|
|
|
+ });
|
|
|
|
+ let include = [];
|
|
|
|
+ for (let i = 0; i < s.data.length; i++) {
|
|
|
|
+ include.push(s.data[i].tagentsid)
|
|
|
|
+ }
|
|
|
|
+ this.setData({
|
|
|
|
+ include
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ }
|
|
this.setData({
|
|
this.setData({
|
|
tnoticeid: data.tnoticeid,
|
|
tnoticeid: data.tnoticeid,
|
|
ftitle: data.ftitle,
|
|
ftitle: data.ftitle,
|
|
@@ -70,11 +96,31 @@ Page({
|
|
fcontent: data.fcontent,
|
|
fcontent: data.fcontent,
|
|
ftype: ftype,
|
|
ftype: ftype,
|
|
coverFiles,
|
|
coverFiles,
|
|
- defaultFiles
|
|
|
|
|
|
+ defaultFiles,
|
|
|
|
+ fisspecifiedrange: data.fisspecifiedrange
|
|
})
|
|
})
|
|
})
|
|
})
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ //范围选择回调
|
|
|
|
+ scopeCallBack({
|
|
|
|
+ detail
|
|
|
|
+ }) {
|
|
|
|
+ let data = JSON.parse(detail);
|
|
|
|
+ if (data.isAll == 0) {
|
|
|
|
+ this.setData({
|
|
|
|
+ fisspecifiedrange: data.isAll,
|
|
|
|
+ checkboxShow: false
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ this.setData({
|
|
|
|
+ deleteList: data.deleteItem,
|
|
|
|
+ include: data.include,
|
|
|
|
+ fisspecifiedrange: data.isAll,
|
|
|
|
+ checkboxShow: false
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ },
|
|
/* 修改图片回调 */
|
|
/* 修改图片回调 */
|
|
imageChange(e) {
|
|
imageChange(e) {
|
|
const {
|
|
const {
|
|
@@ -93,7 +139,7 @@ Page({
|
|
defaultFiles: fileList
|
|
defaultFiles: fileList
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- /* 提交代码 */
|
|
|
|
|
|
+ /* 提交 */
|
|
submit() {
|
|
submit() {
|
|
if (!this.formVerify()) return wx.showToast({
|
|
if (!this.formVerify()) return wx.showToast({
|
|
title: '请检查表单内容',
|
|
title: '请检查表单内容',
|
|
@@ -108,6 +154,7 @@ Page({
|
|
"tnoticeid": this.data.tnoticeid,
|
|
"tnoticeid": this.data.tnoticeid,
|
|
"ftype": ftype,
|
|
"ftype": ftype,
|
|
"ftitle": this.data.ftitle,
|
|
"ftitle": this.data.ftitle,
|
|
|
|
+ "fisspecifiedrange": this.data.fisspecifiedrange,
|
|
"fsummary": this.data.fsummary,
|
|
"fsummary": this.data.fsummary,
|
|
"fcontent": this.data.fcontent,
|
|
"fcontent": this.data.fcontent,
|
|
}
|
|
}
|
|
@@ -128,6 +175,34 @@ Page({
|
|
}).then(s => {
|
|
}).then(s => {
|
|
console.log("修改上架", s)
|
|
console.log("修改上架", s)
|
|
})
|
|
})
|
|
|
|
+ //指定范围,删除
|
|
|
|
+ if (ftype == '商户') {
|
|
|
|
+ if (this.data.fisspecifiedrange == 1) {
|
|
|
|
+ //默认新增
|
|
|
|
+ let body = {
|
|
|
|
+ "accesstoken": wx.getStorageSync('userData').token,
|
|
|
|
+ "classname": "customer.noticemag.noticemag",
|
|
|
|
+ "method": "adduser",
|
|
|
|
+ "content": {
|
|
|
|
+ "tnoticeid": res.data[0].tnoticeid,
|
|
|
|
+ "tagentsid": this.data.include
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ console.log(this.data.include)
|
|
|
|
+ _Http.basic(body).then(res => {
|
|
|
|
+ console.log("添加范围", res)
|
|
|
|
+ });
|
|
|
|
+ //删除
|
|
|
|
+ let deleteList = this.data.deleteList;
|
|
|
|
+ body.method = 'deleteuser';
|
|
|
|
+ body.content.tagentsid = deleteList;
|
|
|
|
+ if (deleteList.length >= 1) {
|
|
|
|
+ _Http.basic(body).then(res => {
|
|
|
|
+ console.log("删除", res)
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
wx.showToast({
|
|
wx.showToast({
|
|
title: '保存成功',
|
|
title: '保存成功',
|
|
});
|
|
});
|
|
@@ -214,47 +289,12 @@ Page({
|
|
detail
|
|
detail
|
|
}) {
|
|
}) {
|
|
console.log(detail)
|
|
console.log(detail)
|
|
- if (detail == '合作商通告') this.query_cooperation(1)
|
|
|
|
this.setData({
|
|
this.setData({
|
|
ftype: detail,
|
|
ftype: detail,
|
|
popups: false,
|
|
popups: false,
|
|
'errTips.ftype': false
|
|
'errTips.ftype': false
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- /* 合作商列表 */
|
|
|
|
- query_cooperation(count) {
|
|
|
|
- if (this.data.partnerList.length > 0) return;
|
|
|
|
- _Http.basic({
|
|
|
|
- "accesstoken": wx.getStorageSync('userData').token,
|
|
|
|
- "classname": "customer.tagents.tagents",
|
|
|
|
- "method": "query_cooperation",
|
|
|
|
- "content": {
|
|
|
|
- "getdatafromdbanyway": true,
|
|
|
|
- "pageNumber": 1,
|
|
|
|
- "pageSize": 999,
|
|
|
|
- "where": {
|
|
|
|
- "condition": "",
|
|
|
|
- "ftype": "",
|
|
|
|
- "fstatus": ""
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }, false).then(res => {
|
|
|
|
- console.log(res)
|
|
|
|
- if (res.msg != '成功') {
|
|
|
|
- if (count == 1) {
|
|
|
|
- return this.query_cooperation(2)
|
|
|
|
- } else {
|
|
|
|
- wx.showToast({
|
|
|
|
- title: res.data,
|
|
|
|
- icon: "none"
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- };
|
|
|
|
- this.setData({
|
|
|
|
- partnerList: res.data
|
|
|
|
- });
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
/* 打开类目选择 */
|
|
/* 打开类目选择 */
|
|
showPop() {
|
|
showPop() {
|
|
this.setData({
|
|
this.setData({
|