Kaynağa Gözat

个人中心 入住指引 支付订单

吃个甘蔗嚼一年 3 yıl önce
ebeveyn
işleme
798614afb5
2 değiştirilmiş dosya ile 221 ekleme ve 4 silme
  1. 156
    0
      src/pages/Molded/style.less
  2. 65
    4
      src/pages/PayOrder/index.jsx

+ 156
- 0
src/pages/Molded/style.less Dosyayı Görüntüle

@@ -0,0 +1,156 @@
1
+@whiteColor: #fff;
2
+
3
+.wrapper {
4
+  width: 74%;
5
+  border-bottom: 1px dashed rgba(0, 0, 0, 0.1);
6
+  .left-complete-one {
7
+    padding-top: 87px;
8
+    padding-bottom: 21px;
9
+    position: relative;
10
+    display: flex;
11
+    background: @whiteColor;
12
+    background: radial-gradient(
13
+          circle at top right,
14
+          transparent 15px,
15
+          @whiteColor 0
16
+        )
17
+        top right,
18
+      radial-gradient(circle at bottom right, transparent 15px, @whiteColor 0)
19
+        bottom right;
20
+    background-size: 100% 60%;
21
+    background-repeat: no-repeat;
22
+
23
+    width: 573px;
24
+    border-radius: 15px 0px 0px 15px;
25
+    // border-radius: 12px;
26
+
27
+    align-items: center;
28
+    .left-image-1 {
29
+      width: 145px;
30
+      height: 44px;
31
+      position: absolute;
32
+      top: 22px;
33
+    }
34
+    .left-viewText {
35
+      // background-image: url(@Image-ProCard_hot);
36
+      // width: 287px;
37
+      width: auto;
38
+      height: 44.3px;
39
+      position: absolute;
40
+      left: 1px;
41
+      top: 28px;
42
+      font-size: 24px;
43
+      color: @whiteColor;
44
+      font-weight: 600;
45
+    }
46
+    //图片
47
+    .title-image {
48
+      width: 145px;
49
+      margin-left: 20px;
50
+      border-radius: 24px;
51
+      overflow: hidden;
52
+      position: relative;
53
+      .image-1 {
54
+        width: 100%;
55
+        height: 145px;
56
+      }
57
+      .image-2 {
58
+        width: 89px;
59
+        height: 34px;
60
+        position: absolute;
61
+        left: 0;
62
+        top: 0;
63
+      }
64
+    }
65
+    // 商品标题
66
+    .title-content {
67
+      // padding: 84px 0 56px 20px;
68
+      padding-left: 18px;
69
+
70
+      .Pro-title {
71
+        .title-text {
72
+          width: 375px;
73
+          overflow: hidden;
74
+          text-overflow: ellipsis;
75
+          display: -webkit-box; //必须要
76
+          -webkit-line-clamp: 1;
77
+          -webkit-box-orient: vertical;
78
+          word-break: break-all; /* 多出文本省略号代替 */
79
+          text-align: left;
80
+          font-size: 24px;
81
+          padding-bottom: 10px;
82
+        }
83
+      }
84
+      .title-money {
85
+        padding-top: 34px;
86
+        font-size: 24px;
87
+        // color: red;
88
+        font-weight: 800;
89
+      }
90
+      .title-money-2 {
91
+        font-size: 18px;
92
+        color: #666;
93
+        padding-left: 10px;
94
+        text-decoration: line-through;
95
+      }
96
+
97
+      .title-time {
98
+        font-size: 24px;
99
+        padding-top: 20px;
100
+        color: #c0c8d3;
101
+      }
102
+    }
103
+  }
104
+}
105
+
106
+.right-complete-two {
107
+  background: @whiteColor;
108
+  background: radial-gradient(
109
+        circle at top left,
110
+        transparent 15px,
111
+        @whiteColor 0
112
+      )
113
+      top left,
114
+    radial-gradient(circle at bottom left, transparent 15px, @whiteColor 0)
115
+      bottom left;
116
+  background-size: 100% 60%;
117
+  background-repeat: no-repeat;
118
+  width: 129px;
119
+  border-radius: 0 15px 15px 0;
120
+  position: relative;
121
+  //右面部分
122
+  .right-content {
123
+    // width: 100px;
124
+    // height: 80px;
125
+    position: absolute;
126
+    top: 50%;
127
+    left: 50%;
128
+    transform: translate(-50%, -50%);
129
+    // border: 1px solid red;
130
+
131
+    .right-number {
132
+      width: 32px;
133
+      font-size: 20px;
134
+      border-radius: 4px;
135
+      border: 2px solid #999;
136
+      margin: auto;
137
+      text-align: center;
138
+    }
139
+
140
+    .right-title {
141
+      font-weight: 700;
142
+      font-size: 24px;
143
+      padding-top: 20px;
144
+      text-align: center;
145
+    }
146
+  }
147
+}
148
+//线条
149
+.right-complete-two::after {
150
+  content: "";
151
+  position: absolute;
152
+  top: 15px;
153
+  margin: 26px auto;
154
+  height: 70%;
155
+  border-left: 1px dashed #595959;
156
+}

+ 65
- 4
src/pages/PayOrder/index.jsx Dosyayı Görüntüle

@@ -1,22 +1,83 @@
1 1
 
2 2
 import image from '@/assets/icons/ProCard/8kb.jpg'
3
-import { Button, Radio } from '@tarojs/components'
3
+import { useState, useEffect } from 'react'
4
+import { Button, Radio, Input } from '@tarojs/components'
4 5
 
5 6
 import food from '@/assets/icons/ProCard/food.png'
6 7
 import ProCard_hot from '@/assets/icons/ProCard/ProCard_hot.png'
7 8
 import CustomNav from '@/components/CustomNav'
8
-import PPP from '@/components/ProCard'
9
+import OrderMolded from '@/components/OrderMolded'
10
+import Popup from '@/components/Popup'
11
+
9 12
 import './style.less'
10 13
 
11 14
 export default () => {
15
+  const [showDialog, setShowDialog] = useState(false)
16
+
17
+  const ShowMoldeOn = () => {
18
+    setShowDialog(true)
19
+  }
20
+  const ShowMoldeOff = () => {
21
+    setShowDialog(false)
22
+  }
23
+
24
+  const buttons = [
25
+
26
+    {
27
+      text: '取消'
28
+    },
29
+    {
30
+      text: '确定'
31
+    },
32
+
33
+  ]
34
+
35
+  const [BuyNumber, setBuyNumber] = useState(1)
36
+  const [DisabledBool, setDisabledBool] = useState(false)
37
+
38
+
39
+  const NumberAdd = () => {
40
+    setBuyNumber(BuyNumber + 1)
41
+    console.log(BuyNumber);
42
+
43
+  }
12 44
 
45
+  const NumberCut = () => {
46
+    setBuyNumber(BuyNumber - 1)
47
+    console.log(BuyNumber);
13 48
 
49
+  }
14 50
 
51
+  const onChange = (value, event) => {
52
+    console.log('----------------->', value, event);
53
+  }
54
+
55
+  useEffect(() => {
56
+    onChange()
57
+    if (BuyNumber < 2) {
58
+      setDisabledBool(true)
59
+
60
+    } else {
61
+      setDisabledBool(false)
62
+
63
+    }
64
+  }, [BuyNumber])
15 65
 
16 66
   return (
17 67
 
18 68
     <view class='container'>
19 69
       <CustomNav title='订单' />
70
+      <Popup show={showDialog} maskClosable={false}>
71
+        <OrderMolded />
72
+        <view className='item-center-Number' >
73
+          <view className='buy-num-minus' disabled={DisabledBool} onClick={NumberCut} >-</view>
74
+          <Input className='buy-num-input' type='number' min={1} onChange={onChange} value={BuyNumber} />
75
+          <view className='buy-num-add' onClick={NumberAdd} >+</view>
76
+        </view>
77
+        <view className='buy' >
78
+
79
+        </view>
80
+      </Popup>
20 81
       <view class='coupon-list'>
21 82
         <view class='wrapper'>
22 83
           <view class='left-complete-one'>
@@ -36,9 +97,9 @@ export default () => {
36 97
               <view className='title-time' >有效期:2021/06/21-2021/12/31</view>
37 98
             </view>
38 99
           </view>
39
-          <view class='right-complete-two'>
100
+          <view class='right-complete-two' onClick={ShowMoldeOn} >
40 101
             <view className='right-content'>
41
-              <view className='right-number'>×1</view>
102
+              <view className='right-number'>×{BuyNumber}</view>
42 103
               <view className='right-title'>数量</view>
43 104
             </view>
44 105
           </view>