李志伟 3 년 전
부모
커밋
95e8314474

+ 7
- 0
src/pages/addBankCard/index.config.js 파일 보기

@@ -0,0 +1,7 @@
1
+export default {
2
+  navigationBarTitleText: '我的银行卡',
3
+  navigationStyle: 'custom',
4
+  styleIsolation: 'shared',
5
+  enableShareAppMessage: true,
6
+  disableScroll: true,
7
+}

+ 18
- 0
src/pages/addBankCard/index.jsx 파일 보기

@@ -0,0 +1,18 @@
1
+import Taro from "@tarojs/taro"
2
+import { View,Image } from "@tarojs/components"
3
+import withLayout from '@/layouts'
4
+import CustomNav from "@/components/CustomNav"
5
+import './style.less'
6
+
7
+export default withLayout((props) => {
8
+  return (
9
+    <View className='page-index'>
10
+      <View className='index-navbar'>
11
+        <CustomNav title='我的银行卡' />
12
+      </View>
13
+      <View className='index-container bankCardBox'>
14
+        88
15
+      </View>
16
+    </View>
17
+  )
18
+})

+ 0
- 0
src/pages/addBankCard/style.less 파일 보기


+ 14
- 7
src/pages/bankCard/Card/index.jsx 파일 보기

@@ -1,20 +1,27 @@
1
-import { View,Image } from "@tarojs/components"
1
+import { View, Image, Text } from "@tarojs/components"
2 2
 import ABCImg from '@/assets/bank/ABCbank.png'
3 3
 import BOCImg from '@/assets/bank/BOCbank.png'
4 4
 import CCBImg from '@/assets/bank/CCBbank.png'
5
+import './style.less'
5 6
 
6 7
 export default (props) => {
7
-  const {type,value,onChange}=props
8
+  const { type, value, onChange } = props
8 9
   return (
9 10
     <View className='bankCard' >
10 11
       <Image src={
11
-        type==='abc'?ABCImg:
12
-        type==='boc'?BOCImg:
13
-        type==='ccb'?CCBImg:''
14
-        } className='CardImg'
12
+        type === 'abc' ? ABCImg :
13
+          type === 'boc' ? BOCImg :
14
+            type === 'ccb' ? CCBImg : ''
15
+      } className='CardImg'
15 16
       />
16
-      <View className='cCode'>{value}</View>
17 17
       <View className='unBind' onClick={onChange}>解除绑定</View>
18
+      <View className='cardType'>信用卡</View>
19
+      <View className='cCode'>
20
+        <Text className='codeText'>****</Text>
21
+        <Text className='codeText'>****</Text>
22
+        <Text className='codeText'>****</Text>
23
+        <Text className='codeText'>{value.substr(15, 4)}</Text>
24
+      </View>
18 25
     </View>
19 26
   )
20 27
 }

+ 29
- 1
src/pages/bankCard/Card/style.less 파일 보기

@@ -1,11 +1,39 @@
1 1
 .bankCard{
2
-  width: 100%;
3 2
   height: calc( calc(100vw - 60px) * 0.36);
4 3
   border-radius: 40px;
4
+  position: relative;
5
+  color: #fff;
6
+  margin-bottom: 30px;
5 7
   .CardImg{
6 8
     width: 100%;
7 9
     height: calc( calc(100vw - 60px) * 0.36);
8 10
     position: absolute;
11
+    z-index: -1;
12
+  }
13
+  .unBind{
14
+    position: absolute;
15
+    font-size: 28px;
16
+    font-weight: bold;
17
+    right: 36px;
18
+    top: 41px;
19
+  }
20
+  .cardType{
21
+    position: absolute;
22
+    font-size: 28px;
23
+    font-weight: 400;
24
+    left: 40vw;
25
+    top: 69px;
26
+  }
27
+  .cCode{
28
+    position: absolute;
29
+    font-size: 40px;
30
+    font-weight: bold;
31
+    bottom: 69px;
32
+    left: 8vw;
33
+    // left: calc(calc(50vw - 30px) - 5.5em);
34
+    .codeText+.codeText{
35
+      margin-left: 1em;
36
+    }
9 37
   }
10 38
   
11 39
 }

+ 32
- 3
src/pages/bankCard/index.jsx 파일 보기

@@ -1,20 +1,49 @@
1
-import { View } from "@tarojs/components"
1
+import Taro from "@tarojs/taro"
2
+import { View, Image, ScrollView } from "@tarojs/components"
2 3
 import withLayout from '@/layouts'
3 4
 import CustomNav from "@/components/CustomNav"
5
+import addImg from '@/assets/bank/addBank.png'
4 6
 import BankCard from './Card'
5 7
 import './style.less'
6 8
 
7 9
 export default withLayout((props) => {
8
-  const unBind=(val)=>{
10
+  const unBind = (val) => {
11
+    Taro.showModal({
12
+      content: `确认解绑?`,
13
+      success: function (res) {
14
+        if (res.confirm) {
15
+          // deleteRoom(val.roomId).then(() => {
16
+          Taro.showToast({
17
+            title: '已经解除',
18
+            icon: 'none',
19
+          })
20
+          // getRoomList({ hotelId: hotel.hotelId }).then((vals) => {
21
+          //   setDetail(vals.records || [])
22
+          // })
23
+          // })
24
+        }
25
+      }
26
+    })
9 27
     console.log(val)
10 28
   }
29
+  const addCard = () => {
30
+    Taro.navigateTo({ url: '/pages/addBankCard/index' });
31
+  }
11 32
   return (
12 33
     <View className='page-index'>
13 34
       <View className='index-navbar'>
14 35
         <CustomNav title='我的银行卡' />
15 36
       </View>
16 37
       <View className='index-container bankCardBox'>
17
-        <BankCard type='abc' value='6217001700003637161' onChange={()=>unBind(6)} />
38
+        <ScrollView scrollY style={{ height: 'calc(100% - 89px)' }}>
39
+          <BankCard type='abc' value='6217001700003637161' onChange={() => unBind(6)} />
40
+          <BankCard type='boc' value='6217001700003637881' onChange={() => unBind(6)} />
41
+          <BankCard type='ccb' value='6217001700003637651' onChange={() => unBind(6)} />
42
+        </ScrollView>
43
+        <View className='addBank' onClick={addCard}>
44
+          <Image src={addImg} className='addIcon' />
45
+          添加银行卡
46
+        </View>
18 47
       </View>
19 48
     </View>
20 49
   )

+ 21
- 0
src/pages/bankCard/style.less 파일 보기

@@ -1,3 +1,24 @@
1 1
 .bankCardBox{
2 2
   margin: 30px;
3
+  .addBank{
4
+    position: absolute;
5
+    bottom: 50px;
6
+    width: 100%;
7
+    height: 98px;
8
+    background: #FFFFFF;
9
+    border: 2px dashed #BFBFBF;
10
+    border-radius: 40px;
11
+    display: flex;
12
+    align-items: center;
13
+    justify-content: center;
14
+    box-sizing: border-box;
15
+    font-size: 32px;
16
+    font-weight: bold;
17
+    color: #323232;
18
+    .addIcon{
19
+      width: 36px;
20
+      height: 36px;
21
+      margin-right: 20px;
22
+    }
23
+  }
3 24
 }

+ 21
- 5
src/pages/withdrawal/index.jsx 파일 보기

@@ -1,3 +1,4 @@
1
+import Taro from "@tarojs/taro"
1 2
 import { useState } from "react"
2 3
 import { View, Image, Input, Picker } from "@tarojs/components"
3 4
 import CustomNav from "@/components/CustomNav"
@@ -35,12 +36,27 @@ export default withLayout((props) => {
35 36
   }
36 37
 
37 38
   const onClick = () => {
38
-    if ((money - 0) > balance) {
39
-      console.log('您的余额不足');
40
-    } else {
41
-      console.log('提交成功,1到3个工作日将到您的付款账户')
42
-      // 刷新页面
39
+    if (money) {
40
+      if ((money - 0) > balance) {
41
+        Taro.showToast({
42
+          title: '您的余额不足',
43
+          icon: 'none',
44
+        })
45
+      } else {
46
+        Taro.showToast({
47
+          title: '提交成功,1到3个工作日将到您的付款账户',
48
+          icon: 'none',
49
+        })
50
+        // 刷新页面
51
+      }
43 52
     }
53
+    else {
54
+      Taro.showToast({
55
+        title: '请输入本次提现金额',
56
+        icon: 'none',
57
+      })
58
+    }
59
+
44 60
   }
45 61
   const handleChanage = (e) => {
46 62
     setMoney(e.detail.value)

+ 4
- 0
src/routes.js 파일 보기

@@ -38,6 +38,10 @@ const mainPages = [
38 38
     title: '我的银行卡',
39 39
     page: 'pages/bankCard/index',
40 40
   },
41
+  {
42
+    title: '添加银行卡',
43
+    page: 'pages/addBankCard/index',
44
+  },
41 45
   {
42 46
     title: '个人信息',
43 47
     page: 'pages/userInfo/index',