许静 5 anos atrás
pai
commit
17f8674607

+ 1
- 0
src/app.js Ver arquivo

@@ -43,6 +43,7 @@ class App extends Component {
43 43
       'pages/project/index',
44 44
       'pages/person/customerAnalysis/followUpCustomer/index',
45 45
       'pages/person/customerAnalysis/transactionCustomer/index',
46
+      'pages/person/customerAnalysis/myCustomer',
46 47
       'pages/shop/index',
47 48
       'pages/activity/activity',
48 49
       'pages/activity/myActivity',

+ 76
- 16
src/pages/person/customerAnalysis/followUpCustomer/index.js Ver arquivo

@@ -20,10 +20,13 @@ export default class transactionCustomer extends Taro.Component {
20 20
     ],
21 21
     recordId: undefined, // 埋点ID
22 22
     inputValue: '',
23
-    screenVisible: true,
23
+    screenVisible: false,
24 24
     statusList: ['全部状态', '认筹', '到访', '签约'],
25 25
     statusIndex: -1,
26
-    dateSel: '2018-04-22',
26
+    visitDate: '',
27
+    visitDate2: '',
28
+    reportDate: '',
29
+    reportDate2: '',
27 30
   }
28 31
 
29 32
   componentWillUnmount() {
@@ -52,17 +55,43 @@ export default class transactionCustomer extends Taro.Component {
52 55
     })
53 56
     console.log(item, inx, "eeeeeeeeeeee")
54 57
   }
55
-  onDateChange = e => {
56
-    console.log(e.detail.value, "e.detail.value")
58
+  onVisitDateChange = e => {
57 59
     this.setState({
58
-      dateSel: e.detail.value
59
-    },
60
-      console.log(this.state.dateSel, "e.detail.value")
61
-    )
62
-
60
+      visitDate: e.detail.value
61
+    })
62
+  }
63
+  onVisitDateChange2 = e => {
64
+    this.setState({
65
+      visitDate2: e.detail.value
66
+    })
67
+  }
68
+  onReportDateChange = e => {
69
+    this.setState({
70
+      reportDate: e.detail.value
71
+    })
72
+  }
73
+  onReportDateChange2 = e => {
74
+    this.setState({
75
+      reportDate2: e.detail.value
76
+    })
77
+  }
78
+  saveBtn() {
79
+    this.setState({
80
+      screenVisible: false,
81
+    })
82
+  }
83
+  cancelBtn() {
84
+    this.setState({
85
+      screenVisible: false,
86
+    })
87
+  }
88
+  toMyCustomer() {
89
+    Taro.navigateTo({
90
+      url: `/pages/person/customerAnalysis/myCustomer`
91
+    })
63 92
   }
64 93
   renderScreenBox() {
65
-    const { statusList, statusIndex, dateSel } = this.state
94
+    const { statusList, statusIndex, visitDate, visitDate2, reportDate, reportDate2 } = this.state
66 95
     return (
67 96
       <View className="mask">
68 97
         <View className="content">
@@ -70,17 +99,48 @@ export default class transactionCustomer extends Taro.Component {
70 99
           <View className="status-box">
71 100
             {
72 101
               statusList.map((item, index) => (
73
-                <View className={index == statusIndex ? 'checked' : 'status-item'} onClick={this.chooseStatus.bind(this, item, index)}>{item}</View>
102
+                <View key={index + 'status'} className={index == statusIndex ? 'checked' : 'status-item'} onClick={this.chooseStatus.bind(this, item, index)}>{item}</View>
74 103
               ))
75 104
             }
76 105
           </View>
77
-          <View>
78
-            <Picker mode='date' onChange={this.onDateChange}>
106
+          <View className="time-box">
107
+            到访时间:
108
+              <Picker mode='date' onChange={this.onVisitDateChange}>
109
+              <View className='picker'>
110
+                {visitDate}
111
+                {!visitDate && <Text className="placeholder">起始时间</Text>}
112
+              </View>
113
+            </Picker>-<Picker mode='date' onChange={this.onVisitDateChange2}>
79 114
               <View className='picker'>
80
-                当前选择:{dateSel}
115
+                {visitDate2}
116
+                {!visitDate2 && <Text className="placeholder">结束时间</Text>}
81 117
               </View>
82 118
             </Picker>
83 119
           </View>
120
+          <View className="time-box" style="margin-top:16px">
121
+            报备时间:
122
+              <Picker mode='date' onChange={this.onReportDateChange}>
123
+              <View className='picker'>
124
+                {reportDate}
125
+                {!reportDate && <Text className="placeholder">起始时间</Text>}
126
+              </View>
127
+            </Picker>-<Picker mode='date' onChange={this.onReportDateChange2}>
128
+              <View className='picker'>
129
+                {reportDate2}
130
+                {!reportDate2 && <Text className="placeholder">结束时间</Text>}
131
+              </View>
132
+            </Picker>
133
+          </View>
134
+          <View className="bottom-btn">
135
+            <View className="save" onClick={this.saveBtn}>
136
+              保存
137
+            </View>
138
+            <View className="cancel" onClick={this.cancelBtn}>
139
+              取消
140
+          </View>
141
+            <View>
142
+            </View>
143
+          </View>
84 144
         </View>
85 145
       </View>
86 146
     )
@@ -101,8 +161,8 @@ export default class transactionCustomer extends Taro.Component {
101 161
         </View>
102 162
         <View style="padding:10px">
103 163
           {
104
-            list.map(item => (
105
-              <View class="item">
164
+            list.map((item, index) => (
165
+              <View class="item" key={index + 'list'} onClick={this.toMyCustomer}>
106 166
                 <Image src={require('@assets/default-avatar.png')} className='img'></Image>
107 167
                 <View className="name">
108 168
                   {item.name}

+ 50
- 2
src/pages/person/customerAnalysis/followUpCustomer/index.scss Ver arquivo

@@ -38,8 +38,8 @@
38 38
         flex:0 0 23%;
39 39
         margin:  20px 1%;
40 40
         border: 2px solid $primary-color;
41
-        height: 56px;
42
-        line-height: 56px;
41
+        height: 60px;
42
+        line-height: 60px;
43 43
         text-align: center;
44 44
         border-radius: 12px;
45 45
         color: $primary-color;
@@ -56,8 +56,56 @@
56 56
         background-color: $primary-color;
57 57
       }
58 58
     }
59
+    .time-box{
60
+      display: flex;
61
+      align-items: center;
62
+      justify-content: space-between;
63
+      margin: 20px 0;
64
+      color: #555;
65
+        .picker{
66
+          width: 240px;
67
+          height:56px;
68
+          line-height: 56px;
69
+          background:rgba(244,244,244,1);
70
+          border-radius:4px;
71
+          padding: 0 16px;
72
+          font-size: 26px;
73
+          .placeholder{
74
+            color: #999;
75
+          }
76
+        }
77
+    }
78
+    .bottom-btn{
79
+      margin-top: 80px;
80
+      width: 100%;
81
+      height: 80px;
82
+      border-radius: 12px;
83
+      border:2px solid $primary-color;
84
+      display: flex;
85
+      flex-wrap: wrap;
86
+      align-content: flex-start;
87
+      justify-content: space-between;
88
+      font-size: 30px;
89
+      .save{
90
+        flex:  0 0 50%;
91
+        background-color: $primary-color;
92
+        color:#fff;
93
+        height: 78px;
94
+        line-height: 78px;
95
+        text-align: center;
96
+        border-radius: 12px 0 0 12px;
97
+      }
98
+      .cancel{
99
+        flex:  0 0 50%;
100
+        color: $primary-color;
101
+        text-align: center;
102
+        height: 78px;
103
+        line-height: 78px;
104
+      }
105
+    }
59 106
   }
60 107
 }
108
+
61 109
 .search-box{
62 110
   display: flex;
63 111
   align-items: center;

+ 58
- 0
src/pages/person/customerAnalysis/myCustomer.js Ver arquivo

@@ -0,0 +1,58 @@
1
+import Taro, { Component } from '@tarojs/taro';
2
+import Authorize from '@components/authorize'
3
+import { View } from "@tarojs/components";
4
+import MoveChart from '../../components/MoveChart'
5
+import LineChart from '../../components/LineChart'
6
+import './index.scss'
7
+import { AtTabs, AtTabsPane } from 'taro-ui'
8
+import "taro-ui/dist/style/components/tabs.scss"
9
+import { savePoint, updatePoint } from '@services/common'
10
+import { connect } from '@tarojs/redux'
11
+
12
+
13
+@connect(({ user, city }) => ({ user, city }))
14
+export default class myCustomer extends Taro.Component {
15
+
16
+  config = {
17
+    navigationBarTitleText: '我的客户'
18
+  }
19
+
20
+  state = {
21
+    current: 0,
22
+    recordId: undefined, // 埋点ID
23
+  }
24
+
25
+  componentWillUnmount() {
26
+    const { recordId } = this.state
27
+    recordId && updatePoint(recordId)
28
+  }
29
+
30
+  handleClick(value) {
31
+    this.setState({
32
+      current: value
33
+    }, )
34
+  }
35
+ 
36
+
37
+  render() {
38
+
39
+    const tabList = [{ title: '新增客户' }, { title: '跟进客户' }, { title: '到访客户' }]
40
+
41
+    return (
42
+      <View>
43
+        <AtTabs className="tab-bar" current={this.state.current} tabList={tabList} onClick={this.handleClick.bind(this)}>
44
+          <AtTabsPane current={this.state.current} index={0} >
45
+            <View style='padding: 100px 50px;background-color: #FAFBFC;text-align: center;' >标签22页一的内容</View>
46
+          </AtTabsPane>
47
+          <AtTabsPane current={this.state.current} index={1}>
48
+            <View style='padding: 100px 50px;background-color: #FAFBFC;text-align: center;'>标签页二的内容</View>
49
+          </AtTabsPane>
50
+          <AtTabsPane current={this.state.current} index={2}>
51
+            <View style='padding: 100px 50px;background-color: #FAFBFC;text-align: center;'>标签页三的内容</View>
52
+          </AtTabsPane>
53
+        </AtTabs>
54
+
55
+      </View>
56
+    )
57
+  }
58
+}