Browse Source

线索详情主页

zhaoxiaohai 3 years ago
parent
commit
160947860f

+ 184 - 0
pages/threadedTree/details/index.js

@@ -0,0 +1,184 @@
+const _Http = getApp().globalData.http;
+
+Page({
+    options: {
+        addGlobalClass: true
+    },
+    data: {
+        showWhere: "所有日期",
+        timeRangeShow: false,
+        sat_orderclueid: 4,
+        detailsData: null,
+        followList: null,
+        isdesc: 1,
+        whereType: {
+            value: "start",
+            list: {
+                "start": "",
+                "end": ""
+            }
+        },
+        where: {
+            "start": "",
+            "end": ""
+        }
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad(options) {
+        this.selectDetail();
+        this.getFollowList();
+    },
+    /* 查询详情 */
+    selectDetail(i = 0) {
+        if (i == 5) return;
+        _Http.basic({
+            "classname": "saletool.orderclue.web.orderclue",
+            "method": "selectDetail",
+            "content": {
+                "sat_orderclueid": this.data.sat_orderclueid
+            }
+        }).then(res => {
+            if (res.msg != '成功') return this.selectDetail(i + 1);
+            let data = res.data;
+            for (let i in data) {
+                if (data[i] == '') data[i] = '-';
+            }
+            this.setData({
+                detailsData: data
+            })
+        })
+    },
+    /* 跟进列表 */
+    getFollowList(i = 0) {
+        if (i == 5) return;
+        _Http.basic({
+            "classname": "saletool.orderclue.web.orderclue",
+            "method": "getFollowList",
+            "content": {
+                "sat_orderclueid": this.data.sat_orderclueid,
+                "isdesc": this.data.isdesc,
+                where: this.data.where
+            }
+        }).then(res => {
+            console.log(res)
+            if (res.msg != '成功') return this.getFollowList(i + 1);
+            this.setData({
+                followList: res.data
+            })
+        })
+    },
+    /* 修改排序方式 */
+    changeIsdesc() {
+        this.setData({
+            isdesc: this.data.isdesc == 1 ? 0 : 1
+        });
+        this.getFollowList();
+    },
+    /* 查看所有日期 */
+    toSeeAll() {
+        this.setData({
+            showWhere: "所有日期"
+        })
+        this.timeRangeClose();
+        this.getFollowList();
+    },
+    /* 打开选择时间 */
+    openSelectDate() {
+        this.setData({
+            timeRangeShow: true
+        })
+    },
+    /* 关闭时间范围选择 */
+    timeRangeClose() {
+        this.setData({
+            timeRangeShow: false,
+            "where": {
+                "start": "",
+                "end": ""
+            }
+        })
+    },
+    /* 选择日期类型 */
+    selectDateType(e) {
+        const {
+            name
+        } = e.target.dataset;
+        this.setData({
+            "whereType.value": name
+        })
+    },
+    /* 得到选择时间 */
+    getDate({
+        detail
+    }) {
+        let obj = this.data.whereType;
+        obj.list[obj.value] = detail;
+        this.setData({
+            whereType: obj
+        })
+    },
+    /* 确定时间范围 */
+    determineScope() {
+        const {
+            list
+        } = this.data.whereType;
+        this.setData({
+            "where": list,
+            showWhere: list.start + '~' + list.end,
+            timeRangeShow: false
+        });
+        this.getFollowList();
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload() {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh() {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom() {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage() {
+
+    }
+})

+ 7 - 0
pages/threadedTree/details/index.json

@@ -0,0 +1,7 @@
+{
+    "usingComponents": {
+        "Details": "./modules/details/index",
+        "Record": "./modules/record/index",
+        "My_datePicker": "/components/My_datePicker/index"
+    }
+}

+ 68 - 0
pages/threadedTree/details/index.scss

@@ -0,0 +1,68 @@
+@import "../../submission/wxss/detePicker.scss";
+
+.header {
+    display: flex;
+    width: 100vw;
+    height: 154rpx;
+    background-color: #ffffff;
+    margin-bottom: 20rpx;
+
+    >view {
+        width: 33.33%;
+        height: 100%;
+        text-align: center;
+        flex-shrink: 0;
+
+        .label {
+            height: 34rpx;
+            line-height: 34rpx;
+            font-size: 24rpx;
+            font-family: PingFang SC-Regular, PingFang SC;
+            color: #666666;
+            margin-top: 30rpx;
+        }
+
+        .con {
+            width: 100%;
+            height: 40rpx;
+            font-size: 28rpx;
+            font-family: PingFang SC-Regular, PingFang SC;
+            color: #333333;
+            line-height: 40rpx;
+            margin-top: 20rpx;
+        }
+    }
+}
+
+.tab-class {
+    font-size: 28rpx;
+    font-family: PingFang SC-Bold, PingFang SC !important;
+    font-weight: bold !important;
+    color: #999999;
+}
+
+.filtrate {
+    display: flex;
+    justify-content: space-between;
+    width: 100vw;
+    height: 90rpx;
+    padding: 0 30rpx;
+    box-sizing: border-box;
+    margin-bottom: -20rpx;
+
+    .date {
+        display: flex;
+        align-items: center;
+        font-size: 28rpx;
+        font-family: PingFang SC-Regular, PingFang SC;
+        color: #333333;
+    }
+
+    .sort {
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        height: 90rpx;
+        width: 90rpx;
+    }
+}

+ 50 - 0
pages/threadedTree/details/index.wxml

@@ -0,0 +1,50 @@
+<view class="header">
+    <view>
+        <view class="label">线索状态</view>
+        <view class="con">{{detailsData.status}}</view>
+    </view>
+    <view>
+        <view class="label">客户名称</view>
+        <view class="con line-1">{{detailsData.name}}</view>
+    </view>
+    <view>
+        <view class="label">手机号码</view>
+        <view class="con">{{detailsData.phonenumber}}</view>
+    </view>
+</view>
+<van-tabs sticky color='#3874F6' title-active-color='#3874F6' tab-class='tab-class'>
+    <van-tab title="线索详情">
+        <Details detailsData='{{detailsData}}' />
+    </van-tab>
+    <van-tab title="跟进记录">
+        <view class="filtrate">
+            <view class="date" bindtap="openSelectDate">{{showWhere}}
+                <van-icon style="margin-left: 8rpx;" name="arrow-down" />
+            </view>
+            <view class="sort" bindtap="changeIsdesc">
+                <text class="iconfont {{ isdesc==1?'icon-jiangxu':'icon-shengxu' }}" />
+            </view>
+        </view>
+        <Record followList='{{followList}}' />
+        <My_empty wx:if="{{followList.length==0}}" />
+    </van-tab>
+</van-tabs>
+
+
+<van-action-sheet show="{{  timeRangeShow }}" bind:close='timeRangeClose'>
+    <view class="detePickerHeader">
+        <text catchtap="toSeeAll">所有日期</text>
+        <view class="type" catchtap="selectDateType">
+            <view class="option {{whereType.value=='start'?'active-op':''}}" data-name="start">
+                <view data-name="start">开始</view>
+                <view data-name="start" class="time">{{whereType.list.start||'开始时间'}}</view>
+            </view>
+            <view class="option {{whereType.value=='end'?'active-op':''}}" data-name="end">
+                <view data-name="end">结束</view>
+                <view data-name="end" class="time">{{whereType.list.end||'结束时间'}}</view>
+            </view>
+        </view>
+        <text catchtap="determineScope">确定</text>
+    </view>
+    <My_datePicker bind:getDate='getDate' />
+</van-action-sheet>