Browse Source

线索池主页

zhaoxiaohai 3 years ago
parent
commit
4dfd1f11ac

+ 128 - 0
pages/threadedTree/index.js

@@ -0,0 +1,128 @@
+const getHeight = require("../../utils/getRheRemainingHeight");
+const _Http = getApp().globalData.http;
+Page({
+    data: {
+        content: {
+            "pageNumber": 1,
+            "pageSize": 20,
+            "where": {
+                "condition": "",
+                "status": "待跟进"
+            }
+        },
+        list: [],
+        tagColor: '#FA8C16'
+    },
+    onLoad(options) {
+        this.getList()
+    },
+    /* 查询列表 */
+    getList(init = false) {
+        if (init.detail != undefined) init = init.detail;
+        if (init) this.setData({
+            ['content.pageNumber']: 1
+        })
+        if (this.data.content.pageNumber > this.data.content.pageTotal) return;
+        let content = this.data.content;
+
+        _Http.basic({
+            "classname": "saletool.orderclue.web.orderclue",
+            "method": "selectList",
+            content
+        }).then(res => {
+            console.log("列表", res)
+            this.selectComponent('#ListBox').RefreshToComplete();
+            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.pageTotal']: res.pageTotal
+            })
+        })
+    },
+    /* 切换tab分类 */
+    tabsChange({
+        detail
+    }) {
+        let tagColor = '#BBBBBB';
+        switch (detail.title) {
+            case '待跟进':
+                tagColor = '#FA8C16'
+                break;
+            case '跟进中':
+                tagColor = '#52C41A'
+                break;
+            case '已成交':
+                tagColor = '#ffffff'
+                break;
+            case '丢单':
+                tagColor = '#FF3B30'
+                break;
+        }
+        this.setData({
+            'content.where.status': detail.title,
+            tagColor
+        })
+        this.getList(true);
+    },
+    /* 搜索 */
+    inputSharch({
+        detail
+    }) {
+        this.setData({
+            'content.where.condition': detail
+        });
+        this.getList(true);
+    },
+    onReady() {
+        getHeight.getHeight('.tabs', this).then(res => {
+            this.setData({
+                scrollHeight: res
+            })
+        })
+    },
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload() {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh() {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom() {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage() {
+
+    }
+})

+ 8 - 0
pages/threadedTree/index.json

@@ -0,0 +1,8 @@
+{
+    "navigationBarTitleText": "销售线索",
+    "usingComponents": {
+        "Search": "./modules/search/search",
+        "List": "./modules/list/list",
+        "FloatingButton": "./modules/FloatingButton/index"
+    }
+}

+ 12 - 0
pages/threadedTree/index.scss

@@ -0,0 +1,12 @@
+page {
+    padding: 0 !important;
+    overflow: hidden !important;
+}
+
+/* 默认标签样式 */
+.tab-class {
+    font-size: 28rpx !important;
+    font-family: PingFang SC-Bold, PingFang SC !important;
+    font-weight: bold !important;
+    color: #999999;
+}

+ 21 - 0
pages/threadedTree/index.wxml

@@ -0,0 +1,21 @@
+<Search bindinputSharch='inputSharch' />
+
+<van-tabs class="tabs" active="{{ content.where.status }}" tab-class='tab-class' color='#3874F6' title-active-color='#3874F6' bind:change="tabsChange">
+    <van-tab title="待跟进" />
+    <van-tab title="跟进中" />
+    <van-tab title="已成交" />
+    <van-tab title="已过期" />
+    <van-tab title="丢单" />
+    <van-tab title="无效" />
+</van-tabs>
+
+<!-- 浮动按钮 -->
+<FloatingButton>
+    <image style="width: 100rpx; height: 100rpx; transform: translate(-50%,-50%);" src='../../static/image/add.png' />
+</FloatingButton>
+
+<My_listBox id='ListBox' bindgetlist="getList" height='{{scrollHeight}}'>
+    <List list='{{list}}' tagColor='{{tagColor}}' />
+    <My_empty wx:if="{{list.length==0}}" />
+    <view style="height: 50px;" />
+</My_listBox>