浏览代码

推广素材

zhaoxiaohai 3 年之前
父节点
当前提交
a0bde94169
共有 2 个文件被更改,包括 23 次插入3 次删除
  1. 20 0
      pages/promotional/index.js
  2. 3 3
      pages/promotional/upload.js

+ 20 - 0
pages/promotional/index.js

@@ -78,6 +78,12 @@ Page({
             content
         }).then(res => {
             console.log("列表", res)
+
+            let deleteList = [],
+                initID = '9999' + wx.getStorageSync('userMsg').userid;
+            res.data.forEach(v => (initID == v.sat_sharematerial_classid && v.title == '') ? deleteList.push(v.sat_sharematerialid) : '');
+            if (deleteList.length != 0) return this.handleDelete(deleteList);
+
             this.selectComponent('#ListBox').RefreshToComplete();
             if (res.msg != '成功') return wx.showToast({
                 title: res.data,
@@ -101,6 +107,20 @@ Page({
             })
         })
     },
+    /* 处理批量删除 */
+    handleDelete(list) {
+        _Http.basic({
+            "classname": "webmanage.saletool.sharematerial.sharematerial",
+            "method": "delete",
+            "content": {
+                "sat_sharematerialid": list
+            }
+        }).then(res => {
+            console.log("处理删除", res);
+            if (res.msg == '成功') this.getList();
+        })
+    },
+
     /* 清除搜索输入 */
     searchClear() {
         this.setData({

+ 3 - 3
pages/promotional/upload.js

@@ -12,7 +12,7 @@ Page({
     data: {
         "content": {
             "title": "",
-            "sat_sharematerial_classid": 9999,
+            "sat_sharematerial_classid": 9999 + wx.getStorageSync('userMsg').userid,
             "notes": "",
             "tag": [],
             "type": 1, //1图片2视频3图文
@@ -268,7 +268,7 @@ Page({
             "classname": "system.attachment.Attachment",
             "method": "deleteFileLink",
             "content": {
-                linksids
+                linksids: linksids
             }
         }).then(res => {
             console.log('删除附件', res)
@@ -284,7 +284,7 @@ Page({
             "classname": "webmanage.saletool.sharematerial.sharematerial",
             "method": "delete",
             "content": {
-                "sat_sharematerialid": this.data.detailsData.sat_sharematerialid
+                "sat_sharematerialid": [this.data.detailsData.sat_sharematerialid]
             }
         }).then(res => {
             console.log("删除", res)