zhaoxiaohai 3 лет назад
Родитель
Сommit
40fbb9e97c

+ 55 - 0
packageA/offers/modules/project/index.js

@@ -0,0 +1,55 @@
+const _Http = getApp().globalData.http;
+Component({
+    properties: {
+
+    },
+    data: {
+        content: {
+            total: null
+        }
+    },
+    methods: {
+        getList(id) {
+            _Http.basic({
+                "id": 20221021103902,
+                "content": {
+                    "sa_projectid": id
+                },
+            }).then(res => {
+                console.log("项目商机", this.data.list)
+                if (res.msg != '成功') return wx.showToast({
+                    title: res.msg,
+                    icon: "none"
+                });
+                this.setData({
+                    list: [res.data],
+                    "content.total": 1
+                })
+                this.getTags();
+            })
+        },
+        /* 获取列表标签 */
+        getTags() {
+            let list = this.data.list,
+                ownerids = list.map(v => v.sa_projectid);
+            _Http.basic({
+                "id": 20221018102001,
+                "content": {
+                    nocache: true,
+                    "ownertable": "sa_project",
+                    ownerids
+                }
+            }).then(res => {
+                console.log("标签", res)
+                for (let key in res.data) {
+                    let index = list.findIndex(v => v.sa_projectid == key);
+                    list[index].tags = res.data[key]
+                };
+                console.log(list)
+                this.setData({
+                    list
+                })
+            })
+        },
+    }
+})

+ 6 - 0
packageA/offers/modules/project/index.json

@@ -0,0 +1,6 @@
+{
+    "component": true,
+    "usingComponents": {
+        "List": "/packageA/project/modules/list/index"
+    }
+}

+ 1 - 0
packageA/offers/modules/project/index.scss

@@ -0,0 +1 @@
+/* packageA/offers/modules/project/index.wxss */

+ 1 - 0
packageA/offers/modules/project/index.wxml

@@ -0,0 +1 @@
+<List list='{{list}}' />