Browse Source

静态页面

xcx 4 years ago
parent
commit
3fb8a13a90

+ 1
- 1
src/components/WuYeJiaoFei/index.jsx View File

@@ -28,7 +28,7 @@ const pay = idArray => {
28 28
       const outTradeNo = res.outTradeNo
29 29
       // 下单
30 30
       request({ ...apis.wxUnifiedOrder, args: { outTradeNo }, params: { type: 'bill' } }).then(res => {
31
-        wx.requestPayment({
31
+        Taro.requestPayment({
32 32
           timeStamp: res.timeStamp,
33 33
           nonceStr: res.nonceStr,
34 34
           package: res.package,

+ 1
- 1
src/components/WuYeJiaoFeiItem/index.jsx View File

@@ -37,7 +37,7 @@ export default function WuYeJiaoFeiItem (props) {
37 37
     //     </view>
38 38
     //   </view>
39 39
     // </view>
40
-    <view className='WuYeJiaoFeiItem flex-h'>
40
+    <view className='WuYeJiaoFeiItem flex-h' onClick={() => { Taro.navigateTo({ url: `/pages/WuYe/JiaoFeiDetail/index?id=${Data.id}` }) }}>
41 41
       <view className='flex-item'>
42 42
         <text>{Data.billName}</text>
43 43
         <text>{toolclass.FormatDate(Data.createDate)}</text>

+ 1
- 1
src/pages/ShouYe/index.css View File

@@ -84,7 +84,7 @@
84 84
   font-size: 30px;
85 85
   color: #fff;
86 86
   text-indent: 30px;
87
-  margin-bottom: 20px;
87
+  margin-bottom: 10px;
88 88
 }
89 89
 .ShouYe > view.flex-item > .PageContainer .Content > view > .BannerContainer {
90 90
   padding: 0 30px;

+ 1
- 1
src/pages/ShouYe/index.less View File

@@ -95,7 +95,7 @@
95 95
               font-size: 30px;
96 96
               color: #fff;
97 97
               text-indent: 30px;
98
-              margin-bottom: 20px;
98
+              margin-bottom: 10px;
99 99
             }
100 100
 
101 101
             >.BannerContainer {

+ 231
- 0
src/pages/WuYe/JiaoFeiDetail/index.css View File

@@ -0,0 +1,231 @@
1
+.JiaoFeiDetail {
2
+  width: 100%;
3
+  min-height: 100%;
4
+  position: relative;
5
+  background: #f8f8f8;
6
+}
7
+.JiaoFeiDetail .DetailContainer {
8
+  width: 100%;
9
+  min-height: 100vh;
10
+  position: relative;
11
+  z-index: 1;
12
+  overflow: hidden;
13
+}
14
+.JiaoFeiDetail .DetailContainer > .Info {
15
+  padding: 30px;
16
+  position: relative;
17
+  overflow: hidden;
18
+  background: #fff;
19
+}
20
+.JiaoFeiDetail .DetailContainer > .Info > .flex-h {
21
+  align-items: center;
22
+}
23
+.JiaoFeiDetail .DetailContainer > .Info > .flex-h > text {
24
+  font-size: 24px;
25
+  color: #F35844;
26
+  line-height: 40px;
27
+  white-space: nowrap;
28
+  overflow: hidden;
29
+  text-overflow: ellipsis;
30
+}
31
+.JiaoFeiDetail .DetailContainer > .Info > .flex-h > text:first-child {
32
+  font-size: 30px;
33
+  font-weight: bold;
34
+  color: #333;
35
+  margin-right: 20px;
36
+}
37
+.JiaoFeiDetail .DetailContainer > .Info > .Detail {
38
+  position: relative;
39
+  overflow: hidden;
40
+  padding: 20px;
41
+  background: rgba(243, 88, 68, 0.08);
42
+  margin-top: 50px;
43
+}
44
+.JiaoFeiDetail .DetailContainer > .Info > .Detail > .Title {
45
+  align-items: center;
46
+  padding-bottom: 10px;
47
+  border-bottom: 2px solid rgba(0, 0, 0, 0.08);
48
+}
49
+.JiaoFeiDetail .DetailContainer > .Info > .Detail > .Title > text {
50
+  font-size: 24px;
51
+  color: #999;
52
+  line-height: 80px;
53
+}
54
+.JiaoFeiDetail .DetailContainer > .Info > .Detail > .Title > text.flex-item {
55
+  font-size: 30px;
56
+  font-weight: bold;
57
+  color: #333;
58
+}
59
+.JiaoFeiDetail .DetailContainer > .Info > .Detail > .Title > text.Num {
60
+  font-size: 48px;
61
+  font-weight: bold;
62
+  color: #F35844;
63
+}
64
+.JiaoFeiDetail .DetailContainer > .Info > .Detail > text {
65
+  display: block;
66
+  width: 100%;
67
+  font-size: 24px;
68
+  color: #333;
69
+  line-height: 40px;
70
+  padding: 30px 0;
71
+}
72
+.JiaoFeiDetail .DetailContainer > .Info > .Detail > .Line {
73
+  align-items: center;
74
+}
75
+.JiaoFeiDetail .DetailContainer > .Info > .Detail > .Line > text {
76
+  font-size: 24px;
77
+  color: #333;
78
+  line-height: 40px;
79
+}
80
+.JiaoFeiDetail .DetailContainer > .Info > .Detail > .Line > text:first-child {
81
+  min-width: 160px;
82
+  margin-right: 20px;
83
+}
84
+.JiaoFeiDetail .DetailContainer > .Detail {
85
+  position: relative;
86
+  overflow: hidden;
87
+  margin-top: 20px;
88
+  padding: 0 30px;
89
+  background: #fff;
90
+  margin-bottom: 20px;
91
+}
92
+.JiaoFeiDetail .DetailContainer > .Detail > view {
93
+  align-items: flex-start;
94
+  border-top: 2px solid rgba(0, 0, 0, 0.08);
95
+  padding: 20px 0;
96
+}
97
+.JiaoFeiDetail .DetailContainer > .Detail > view:first-child {
98
+  border-top: none;
99
+}
100
+.JiaoFeiDetail .DetailContainer > .Detail > view > text {
101
+  font-size: 28px;
102
+  color: #333;
103
+  line-height: 40px;
104
+}
105
+.JiaoFeiDetail .DetailContainer > .Detail > view > text:last-child {
106
+  text-align: right;
107
+  color: #999;
108
+  margin-left: 20px;
109
+}
110
+.JiaoFeiDetail .DetailContainer > .InfoBottom {
111
+  width: 100%;
112
+  height: 228px;
113
+}
114
+.JiaoFeiDetail > .BottomContainer {
115
+  padding: 0 30px;
116
+  position: relative;
117
+  overflow: hidden;
118
+  z-index: 2;
119
+  margin-top: -228px;
120
+  text-align: center;
121
+  font-size: 0;
122
+}
123
+.JiaoFeiDetail > .BottomContainer text:first-child {
124
+  font-size: 24px;
125
+  color: #77A5F0;
126
+  display: inline-block;
127
+  line-height: 40px;
128
+}
129
+.JiaoFeiDetail > .BottomContainer text:nth-child(2) {
130
+  font-size: 34px;
131
+  color: #fff;
132
+  background: #F35844;
133
+  line-height: 98px;
134
+  border-radius: 98px;
135
+  width: 100%;
136
+  display: block;
137
+  text-align: center;
138
+  margin-top: 50px;
139
+  margin-bottom: 40px;
140
+}
141
+.JiaoFeiDetail .JiaoFeiPopup {
142
+  padding: 0 30px;
143
+  position: relative;
144
+  overflow: hidden;
145
+}
146
+.JiaoFeiDetail .JiaoFeiPopup > .Price {
147
+  font-size: 34px;
148
+  color: #333;
149
+  line-height: 60px;
150
+  text-align: center;
151
+  border-bottom: 2px solid rgba(0, 0, 0, 0.08);
152
+  padding-bottom: 60px;
153
+}
154
+.JiaoFeiDetail .JiaoFeiPopup > .Price > text {
155
+  font-size: 48px;
156
+  font-weight: bold;
157
+  color: #F35844;
158
+  line-height: 60px;
159
+}
160
+.JiaoFeiDetail .JiaoFeiPopup > .flex-h {
161
+  align-items: center;
162
+  padding: 20px 0;
163
+}
164
+.JiaoFeiDetail .JiaoFeiPopup > .flex-h > text {
165
+  font-size: 30px;
166
+  color: #333;
167
+  line-height: 60px;
168
+  margin-left: 20px;
169
+}
170
+.JiaoFeiDetail .JiaoFeiPopup > .flex-h > text:first-child {
171
+  margin-left: 0;
172
+}
173
+.JiaoFeiDetail .JiaoFeiPopup > .flex-h > text.iconfont {
174
+  font-size: 54px;
175
+  color: #00c005;
176
+}
177
+.JiaoFeiDetail .JiaoFeiPopup > .flex-h > text.iconfont.icongou {
178
+  color: #F35844;
179
+  font-size: 42px;
180
+}
181
+.JiaoFeiDetail .JiaoFeiPopup > .Btn {
182
+  position: relative;
183
+  overflow: hidden;
184
+  margin-top: 40px;
185
+}
186
+.JiaoFeiDetail .JiaoFeiPopup > .Btn > text {
187
+  font-size: 34px;
188
+  color: #fff;
189
+  line-height: 98px;
190
+  display: block;
191
+  width: 100%;
192
+  text-align: center;
193
+  background: #F35844;
194
+  border-radius: 98px;
195
+}
196
+.JiaoFeiDetail .LianXiPopup {
197
+  padding: 0 30px;
198
+  position: relative;
199
+  overflow: visible;
200
+  padding-bottom: 40px;
201
+}
202
+.JiaoFeiDetail .LianXiPopup > text {
203
+  width: 100%;
204
+  display: block;
205
+  font-size: 24px;
206
+  color: #999;
207
+  line-height: 40px;
208
+  text-align: center;
209
+  margin-bottom: 30px;
210
+}
211
+.JiaoFeiDetail .LianXiPopup > text:first-child {
212
+  font-size: 34px;
213
+  color: #333;
214
+  margin-bottom: 10px;
215
+  margin-top: -30px;
216
+}
217
+.JiaoFeiDetail .LianXiPopup > .flex-h {
218
+  border-top: 2px solid rgba(0, 0, 0, 0.08);
219
+}
220
+.JiaoFeiDetail .LianXiPopup > .flex-h > text {
221
+  font-size: 30px;
222
+  line-height: 100px;
223
+  color: #77A5F0;
224
+}
225
+.JiaoFeiDetail .LianXiPopup > .flex-h > text:first-child {
226
+  color: #333;
227
+}
228
+.JiaoFeiDetail .LianXiPopup > .flex-h > text:last-child {
229
+  font-size: 40px;
230
+  margin-left: 10px;
231
+}

+ 84
- 46
src/pages/WuYe/JiaoFeiDetail/index.jsx View File

@@ -4,16 +4,18 @@ import request, { apis } from '@/utils/request'
4 4
 import SlidePopup from '@/components/SlidePopup/index'
5 5
 import Page from '@/layouts'
6 6
 import { useModel } from '@/store'
7
+import toolclass from '@/utils/toolclass.js'
7 8
 import '@/assets/css/reset.less'
8 9
 import '@/assets/css/iconfont.less'
9 10
 import './index.less'
10 11
 
11 12
 export default function JiaoFeiDetail () {
12 13
   const { user } = useModel('user')
13
-  const [bill, setBill] = useState([])
14
+  const [bill, setBill] = useState(null)
14 15
   const [ShowPopup, setShowPopup] = useState(false)
15 16
 
16 17
   const [PopupType, setPopupType] = useState(0)
18
+  const [PhoneList, setPhoneList] = useState([])
17 19
 
18 20
   const { id } = Current.router.params
19 21
   const paying = useRef(false)
@@ -26,7 +28,7 @@ export default function JiaoFeiDetail () {
26 28
 
27 29
   const cancelOrder = () => {
28 30
     if (order.current && order.current.outTradeNo) {
29
-      request({...apis.wxCancelPay, args: { outTradeNo: order.current.outTradeNo }, params: { type: 'bill' }}).then(res => {
31
+      request({ ...apis.wxCancelPay, args: { outTradeNo: order.current.outTradeNo }, params: { type: 'bill' } }).then(res => {
30 32
         order.current = undefined
31 33
       }).catch(er => {
32 34
         Taro.showToast({
@@ -50,14 +52,14 @@ export default function JiaoFeiDetail () {
50 52
     }
51 53
 
52 54
     paying.current = true
53
-    
55
+
54 56
     // 准备下单
55
-    request({...apis.wxStartPay, data: { type: 'bill', idArray: [id].map(x => x-0) }}).then(res => {
57
+    request({ ...apis.wxStartPay, data: { type: 'bill', idArray: [id].map(x => x - 0) } }).then(res => {
56 58
       order.current = res
57 59
       const outTradeNo = res.outTradeNo
58 60
       // 下单
59
-      request({...apis.wxUnifiedOrder, args: { outTradeNo }, params: { type: 'bill'}} ).then(res => {
60
-        wx.requestPayment({
61
+      request({ ...apis.wxUnifiedOrder, args: { outTradeNo }, params: { type: 'bill' } }).then(res => {
62
+        Taro.requestPayment({
61 63
           timeStamp: `${res.timeStamp}`,
62 64
           nonceStr: res.nonceStr,
63 65
           package: res.package,
@@ -101,54 +103,96 @@ export default function JiaoFeiDetail () {
101 103
       })
102 104
     })
103 105
   }
104
-  
106
+
107
+  const Init = () => {
108
+    request({ ...apis.getWuYePhone }).then((res) => { // 获取物业电话
109
+      setPhoneList(res || [])
110
+    })
111
+  }
112
+
105 113
   useEffect(() => {
106 114
     if (user && id) {
107
-      request({ ...apis.getBillInvoiced, args: { orgId: 1, id }}).then(res => {
115
+      request({ ...apis.getBillInvoiced, args: { orgId: 1, id } }).then(res => {
108 116
         if (res) {
109 117
           setBill(res)
110 118
         }
111 119
       })
120
+      Init()
112 121
     }
113 122
   }, [user, id])
114 123
 
115 124
   return (
116 125
     <Page>
117 126
       <view className='JiaoFeiDetail'>
118
-        <view className='DetailContainer'>
119
-          <view className='Info'>
120
-            <view className='flex-h'>
121
-              <text className='flex-item'>物业费</text>
122
-              <text>2020/06/08  0:00截止</text>
127
+        {
128
+          bill !== null &&
129
+          <view className='DetailContainer'>
130
+            <view className='Info'>
131
+              <view className='flex-h'>
132
+                <text className='flex-item'>{bill.billName}</text>
133
+                <text>{toolclass.FormatDate(bill.endDate)}截止</text>
134
+              </view>
135
+              <view className='Detail'>
136
+                <view className='Title flex-h'>
137
+                  <text className='flex-item'>缴费金额</text>
138
+                  <text className='Num'>{bill.payPrice}</text>
139
+                  <text>元</text>
140
+                </view>
141
+                <text>{bill.billExplain}</text>
142
+                {/* <view className='Line flex-h'>
143
+                  <text>垃圾费:</text>
144
+                  <text className='flex-item'>100元</text>
145
+                </view>
146
+                <view className='Line flex-h'>
147
+                  <text>绿地维护费:</text>
148
+                  <text className='flex-item'>100元</text>
149
+                </view>
150
+                <view className='Line flex-h'>
151
+                  <text>公摊电费:</text>
152
+                  <text className='flex-item'>100元</text>
153
+                </view> */}
154
+              </view>
123 155
             </view>
124 156
             <view className='Detail'>
125
-              <view className='Title flex-h'>
126
-                <text className='flex-item'>缴费金额</text>
127
-                <text className='Num'>{bill.payPrice}</text>
128
-                <text>元</text>
157
+              <view className='flex-h'>
158
+                <text>订单编号</text>
159
+                <text className='flex-item'>{bill.id}</text>
160
+              </view>
161
+              <view className='flex-h'>
162
+                <text>缴费人</text>
163
+                <text className='flex-item'>{null}</text>
164
+              </view>
165
+              <view className='flex-h'>
166
+                <text>下单时间</text>
167
+                <text className='flex-item'>{toolclass.FormatDate(bill.createTime)}</text>
168
+              </view>
169
+              <view className='flex-h'>
170
+                <text>缴费时间</text>
171
+                <text className='flex-item'>{null}</text>
129 172
               </view>
130
-              <text>2020年5月物业管理费</text>
131
-              <view className='Line flex-h'>
132
-                <text>垃圾费:</text>
133
-                <text className='flex-item'>100元</text>
173
+              <view className='flex-h'>
174
+                <text>缴费方式</text>
175
+                <text className='flex-item'>微信支付</text>
134 176
               </view>
135
-              <view className='Line flex-h'>
136
-                <text>绿地维护费:</text>
137
-                <text className='flex-item'>100元</text>
177
+              <view className='flex-h'>
178
+                <text>交易流水</text>
179
+                <text className='flex-item'>{null}</text>
138 180
               </view>
139
-              <view className='Line flex-h'>
140
-                <text>公摊电费:</text>
141
-                <text className='flex-item'>100元</text>
181
+              <view className='flex-h'>
182
+                <text>缴费备注</text>
183
+                <text className='flex-item'>网上缴费</text>
142 184
               </view>
143 185
             </view>
186
+            <view className='InfoBottom'></view>
144 187
           </view>
145
-          <view className='InfoBottom'></view>
146
-        </view>
188
+        }
147 189
         <view className='BottomContainer'>
148 190
           <text onClick={() => { setPopupType(2); setShowPopup(true) }}>对费用有疑问?</text>
149
-          <text onClick={handleReadyPay}>立即缴费</text>
191
+          {
192
+            bill !== null && bill.billStatus - 0 !== 1 &&
193
+            <text onClick={handleReadyPay}>立即缴费</text>
194
+          }
150 195
         </view>
151
-
152 196
         {/* 弹窗 */}
153 197
         <SlidePopup Close={handleCancelOrder} Show={ShowPopup}>
154 198
           {
@@ -170,21 +214,15 @@ export default function JiaoFeiDetail () {
170 214
             <view className='LianXiPopup'>
171 215
               <text>联系物业</text>
172 216
               <text>对此费用有疑问</text>
173
-              <view className='flex-h'>
174
-                <text className='flex-item'>物业电话</text>
175
-                <text>17826982167</text>
176
-                <text className='iconfont icondianhua'></text>
177
-              </view>
178
-              <view className='flex-h'>
179
-                <text className='flex-item'>门卫电话</text>
180
-                <text>17826982167</text>
181
-                <text className='iconfont icondianhua'></text>
182
-              </view>
183
-              <view className='flex-h'>
184
-                <text className='flex-item'>物业领导</text>
185
-                <text>17826982167</text>
186
-                <text className='iconfont icondianhua'></text>
187
-              </view>
217
+              {
218
+                PhoneList.map((item, index) => (
219
+                  <view className='flex-h' key={`PhoneList-${index}`} onClick={() => { Taro.makePhoneCall({ phoneNumber: item.tel }) }}>
220
+                    <text className='flex-item'>{item.name}</text>
221
+                    <text>{item.tel}</text>
222
+                    <text className='iconfont icondianhua'></text>
223
+                  </view>
224
+                ))
225
+              }
188 226
             </view>
189 227
           }
190 228
         </SlidePopup>

+ 35
- 2
src/pages/WuYe/JiaoFeiDetail/index.less View File

@@ -4,7 +4,7 @@
4 4
   position: relative;
5 5
   background: #f8f8f8;
6 6
 
7
-  >.DetailContainer {
7
+  .DetailContainer {
8 8
     width: 100%;
9 9
     min-height: 100vh;
10 10
     position: relative;
@@ -94,6 +94,37 @@
94 94
       }
95 95
     }
96 96
 
97
+    >.Detail {
98
+      position: relative;
99
+      overflow: hidden;
100
+      margin-top: 20px;
101
+      padding: 0 30px;
102
+      background: #fff;
103
+      margin-bottom: 20px;
104
+
105
+      >view {
106
+        align-items: flex-start;
107
+        border-top: 2px solid rgba(0, 0, 0, 0.08);
108
+        padding: 20px 0;
109
+
110
+        &:first-child {
111
+          border-top: none;
112
+        }
113
+
114
+        >text {
115
+          font-size: 28px;
116
+          color: #333;
117
+          line-height: 40px;
118
+
119
+          &:last-child {
120
+            text-align: right;
121
+            color: #999;
122
+            margin-left: 20px;
123
+          }
124
+        }
125
+      }
126
+    }
127
+
97 128
     >.InfoBottom {
98 129
       width: 100%;
99 130
       height: 228px;
@@ -109,7 +140,7 @@
109 140
     text-align: center;
110 141
     font-size: 0;
111 142
 
112
-    >text {
143
+    text {
113 144
       &:first-child {
114 145
         font-size: 24px;
115 146
         color: #77A5F0;
@@ -228,9 +259,11 @@
228 259
         font-size: 30px;
229 260
         line-height: 100px;
230 261
         color: #77A5F0;
262
+
231 263
         &:first-child {
232 264
           color: #333;
233 265
         }
266
+
234 267
         &:last-child {
235 268
           font-size: 40px;
236 269
           margin-left: 10px;