zhaoxiaohai 3 سال پیش
والد
کامیت
4b94cc881c

+ 52 - 0
packageA/project/modules/opponent/index.js

@@ -0,0 +1,52 @@
+const _Http = getApp().globalData.http;
+Component({
+    properties: {},
+    data: {
+        list: [],
+        sa_projectid: "",
+        "content": {
+            "nocache": true,
+            "pageNumber": 1,
+            "pageTotal": 1,
+            "total": null,
+            "type": 1,
+            "where": {
+                "condition": ""
+            }
+        }
+    },
+    methods: {
+        getList(id, init) {
+            let content = this.data.content;
+            content.sa_projectid = id;
+            if (init) content.pageNumber = 1
+            _Http.basic({
+                "id": 20221027165402,
+                content
+            }).then(res => {
+                console.log("项目竞争对手", res)
+                if (res.msg != '成功') return wx.showToast({
+                    title: res.data,
+                    icon: "none"
+                })
+                this.setData({
+                    list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
+                    "content.pageNumber": res.pageNumber + 1,
+                    "content.pageSize": res.pageSize,
+                    "content.pageTotal": res.pageTotal,
+                    "content.total": res.total,
+                    sa_projectid: id
+                });
+            })
+        },
+        add() {
+           
+        },
+        /* 修改总数 */
+        changeTotal() {
+            this.setData({
+                "content.total": this.data.content.total - 1
+            })
+        }
+    }
+})

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

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

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

@@ -0,0 +1 @@
+@import "../../../setclient/modules/address/head.scss";

+ 11 - 0
packageA/project/modules/opponent/index.wxml

@@ -0,0 +1,11 @@
+<view class="head">
+    <view class="count">
+        总共{{content.total}}个
+    </view>
+    <view class="expand">
+        <navigator url="#" class="but" bindtap="add">
+            <van-icon name="plus" />
+        </navigator>
+    </view>
+</view>
+<List list='{{list}}' detele />