|
@@ -54,18 +54,24 @@ Component({
|
|
|
*/
|
|
|
methods: {
|
|
|
/* 是否收藏 */
|
|
|
- isCollect() {
|
|
|
- const isCollect = this.data.fileSelected.isCollect;
|
|
|
+ changeCollect() {
|
|
|
+ const {
|
|
|
+ isCollect,
|
|
|
+ attachmentid,
|
|
|
+ rowindex
|
|
|
+ } = this.data.fileSelected;
|
|
|
+ console.log(isCollect)
|
|
|
_Http.basic({
|
|
|
"classname": "system.attachment.MediaCenter",
|
|
|
"method": isCollect == 0 ? "collectAttachment" : "uncollectAttachment",
|
|
|
"content": {
|
|
|
"collecttype": "营销物料",
|
|
|
- "attachmentid": this.data.fileSelected.attachmentid
|
|
|
+ "attachmentid": attachmentid
|
|
|
}
|
|
|
}).then(res => {
|
|
|
+ console.log(res)
|
|
|
if (res.msg != '成功') return wx.showToast({
|
|
|
- title: res.data,
|
|
|
+ title: res.msg,
|
|
|
icon: "none"
|
|
|
})
|
|
|
wx.showToast({
|
|
@@ -73,7 +79,7 @@ Component({
|
|
|
icon: "none"
|
|
|
})
|
|
|
let list = this.data.list,
|
|
|
- index = this.data.fileSelected.queryrow - 1;
|
|
|
+ index = rowindex - 1;
|
|
|
this.data.tabActiveTitle == '列表' ? list[index].isCollect = isCollect == 0 ? 1 : 0 : list.splice(index, 1);
|
|
|
this.setData({
|
|
|
list
|