Procházet zdrojové kódy

Merge branch 'dev' of http://git.ycjcjy.com/shigongli/miniapp-v2 into dev

zlisen před 3 roky
rodič
revize
7eb27010a9
31 změnil soubory, kde provedl 1010 přidání a 639 odebrání
  1. 10
    7
      .vscode/launch.json
  2. 1
    0
      package.json
  3. 2
    2
      src/components/CompoentsOrder/AlreadyExpired/index.jsx
  4. 5
    5
      src/components/CompoentsOrder/AlreadyUsed/index.jsx
  5. 21
    16
      src/components/Landlord/HouseManage/houseManage.jsx
  6. 1
    13
      src/components/Landlord/HouseManage/houseManage.less
  7. 52
    111
      src/components/Landlord/Income/income.jsx
  8. 15
    22
      src/components/Landlord/Income/income.less
  9. 9
    6
      src/components/OrderMolded/index.jsx
  10. 121
    0
      src/components/PayOrderCard/index.jsx
  11. 299
    0
      src/components/PayOrderCard/style.less
  12. 58
    0
      src/components/Picker/index.jsx
  13. 0
    0
      src/components/Picker/style.less
  14. 2
    2
      src/components/Popup/index.jsx
  15. 4
    28
      src/components/spreads/ShopKeeper/shopKeeper.jsx
  16. 30
    54
      src/components/spreads/Sparead/spreadMoney.jsx
  17. 47
    0
      src/components/toggleRoul/ToggleRoul.jsx
  18. 56
    0
      src/components/toggleRoul/ToggleRoul.less
  19. 34
    3
      src/hotel/pages/landlord/landlord.jsx
  20. 2
    2
      src/layouts/index.jsx
  21. 2
    2
      src/pages/MineUserAll/Collect/index.jsx
  22. 2
    2
      src/pages/MineUserAll/RefundMoney/index.jsx
  23. 60
    278
      src/pages/PayOrder/index.jsx
  24. 4
    4
      src/pages/PayOrder/style.less
  25. 80
    62
      src/pages/details/foodDetails/foodDetails.jsx
  26. 21
    6
      src/pages/details/mjDetails/sceneryDetails.jsx
  27. 22
    7
      src/pages/index/tabs/Mine.jsx
  28. 11
    3
      src/pages/index/tabs/Recommend.jsx
  29. 24
    2
      src/services/landlord.js
  30. 7
    0
      src/services/person.js
  31. 8
    2
      src/store/models/person.js

+ 10
- 7
.vscode/launch.json Zobrazit soubor

@@ -2,14 +2,17 @@
2 2
     // 使用 IntelliSense 了解相关属性。 
3 3
     // 悬停以查看现有属性的描述。
4 4
     // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
5
-    "version": "0.2.0",
6
-    "configurations": [
7
-        {
8
-            "type": "pwa-chrome",
5
+    
6
+        "version": "0.2.0",
7
+        "configurations": [
8
+          {
9
+            "type": "pwa-msedge",
9 10
             "request": "launch",
10
-            "name": "Launch Chrome against localhost",
11
+            "name": "Launch Microsoft Edge and open the Edge DevTools",
11 12
             "url": "http://localhost:8080",
12 13
             "webRoot": "${workspaceFolder}"
13
-        }
14
-    ]
14
+          }
15
+        ]
16
+      
17
+    
15 18
 }

+ 1
- 0
package.json Zobrazit soubor

@@ -41,6 +41,7 @@
41 41
     "@tarojs/runtime": "3.3.2",
42 42
     "@tarojs/taro": "3.3.2",
43 43
     "@zjxpcyc/react-tiny-store": "^1.0.0",
44
+    "moment": "^2.29.1",
44 45
     "react": "^17.0.0",
45 46
     "react-dom": "^17.0.0"
46 47
   },

+ 2
- 2
src/components/CompoentsOrder/AlreadyExpired/index.jsx Zobrazit soubor

@@ -39,7 +39,7 @@ export default (props) => {
39 39
             <view className='card-box-star'>
40 40
               {
41 41
                 scoreList.map((_, index) => {
42
-                  console.log(index)
42
+
43 43
                   const src = (index + '0.1') < score ? starOn : starOff
44 44
                   return (
45 45
                     <image className='card-star-image' key={index} src={src} />
@@ -78,7 +78,7 @@ export default (props) => {
78 78
             <view className='card-box-star'>
79 79
               {
80 80
                 scoreList.map((_, index) => {
81
-                  console.log(index)
81
+
82 82
                   const src = (index + '0.1') < score ? starOn : starOff
83 83
                   return (
84 84
                     <image className='card-star-image' key={index} src={src} />

+ 5
- 5
src/components/CompoentsOrder/AlreadyUsed/index.jsx Zobrazit soubor

@@ -48,7 +48,7 @@ export default (props) => {
48 48
               <text className='card-box-star-text' onClick={Nuberr} >口味:</text>
49 49
               {
50 50
                 scoreList.map((_, index) => {
51
-                  console.log(index)
51
+
52 52
                   const src = (index + `${CollectNub}`) < score ? starOn : starOff
53 53
                   return (
54 54
                     <image className='card-star-image' key={index} src={src} onClick={Nuberr} />
@@ -60,7 +60,7 @@ export default (props) => {
60 60
               <text className='card-box-star-text' onClick={Nuberr} >环境:</text>
61 61
               {
62 62
                 scoreList.map((_, index) => {
63
-                  console.log(index)
63
+
64 64
                   const src = (index + `${CollectNub}`) < score ? starOn : starOff
65 65
                   return (
66 66
                     <image className='card-star-image' key={index} src={src} onClick={Nuberr} />
@@ -72,7 +72,7 @@ export default (props) => {
72 72
               <text className='card-box-star-text' onClick={Nuberr} >服务:</text>
73 73
               {
74 74
                 scoreList.map((_, index) => {
75
-                  console.log(index)
75
+
76 76
                   const src = (index + `${CollectNub}`) < score ? starOn : starOff
77 77
                   return (
78 78
                     <image className='card-star-image' key={index} src={src} onClick={Nuberr} />
@@ -100,7 +100,7 @@ export default (props) => {
100 100
             <view className='card-box-star'>
101 101
               {
102 102
                 scoreList.map((_, index) => {
103
-                  console.log(index)
103
+
104 104
                   const src = (index + '0.1') < score ? starOn : starOff
105 105
                   return (
106 106
                     <image className='card-star-image' key={index} src={src} />
@@ -141,7 +141,7 @@ export default (props) => {
141 141
             <view className='card-box-star'>
142 142
               {
143 143
                 scoreList.map((_, index) => {
144
-                  console.log(index)
144
+
145 145
                   const src = (index + '0.1') < score ? starOn : starOff
146 146
                   return (
147 147
                     <image className='card-star-image' key={index} src={src} />

+ 21
- 16
src/components/Landlord/HouseManage/houseManage.jsx Zobrazit soubor

@@ -1,40 +1,45 @@
1 1
 import Taro from '@tarojs/taro'
2
-import CustomNav from '@/components/CustomNav'
3
-import pImg from '../../../assets/icons/landlord/定位 位置.png'
4
-import see from '../../../assets/icons/landlord/查看入住人.png'
5
-import share from '../../../assets/icons/landlord/分享链接.png'
6
-import del from '../../../assets/icons/landlord/删除.png'
7
-import addImg from '../../../assets/icons/landlord/添加.png'
8
-import iconsearch from '../../../assets/icons/housemantj/search.png'
2
+import see from '@/assets/icons/landlord/查看入住人.png'
3
+import share from '@/assets/icons/landlord/分享链接.png'
4
+import del from '@/assets/icons/landlord/删除.png'
5
+import addImg from '@/assets/icons/landlord/添加.png'
6
+import iconsearch from '@/assets/icons/housemantj/search.png'
9 7
 import './houseManage.less'
8
+import { useState, useEffect,useRef } from 'react'
9
+import {getRoomList} from '@/services/landlord'
10 10
 
11 11
 
12 12
 export default (props) => {
13
+  const {hotel}=props
14
+  const [detail, setDetail] = useState([])
15
+  useEffect(()=>{
16
+    getRoomList({hotelId:hotel.hotelId}).then((res)=>{
17
+      setDetail(res.records||[])
18
+    })
19
+  },[hotel])
13 20
   return (
14 21
     <view>
15
-      <view>
16
-        <CustomNav logo={null} title='十公里周边指南' />
17
-      </view>
18 22
       <view style={{ padding: '0 30rpx', height: '100%' }}>
19 23
         <scroll-view scroll-y="true" scroll-view='true' bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll" style={{ height: 'calc(100vh - 204px)' }}>
20
-          <view className='position'>
21
-            <image className='pImg' src={pImg} />
22
-            当前店铺:<text>南京紫荆国际公寓酒店</text>
23
-          </view>
24 24
           <view className='search'>
25 25
             <input className='searchInput' disabled />
26 26
             <image className='searchicon' src={iconsearch} />
27 27
             <view className="searchword">请输入关键字搜索</view>
28 28
           </view>
29 29
           <view>
30
-            <view className='houseCard'>
31
-              <view className='houseName'>南京紫荆国际公寓酒店</view>
30
+            {
31
+              detail?.map((item)=>
32
+              <view className='houseCard'>
33
+              <view className='houseName'>{item.roomName}</view>
32 34
               <view className='operation'>
33 35
                 <view><image src={see} /><text>查看入住人</text></view>
34 36
                 <view><image src={share} /><text>分享链接</text></view>
35 37
                 <view><image src={del} /><text>删除房源</text></view>
36 38
               </view>
37 39
             </view>
40
+              )
41
+            }
42
+            
38 43
            
39 44
           </view>
40 45
         </scroll-view>        

+ 1
- 13
src/components/Landlord/HouseManage/houseManage.less Zobrazit soubor

@@ -1,16 +1,4 @@
1
-.position{
2
-  height: 27px;
3
-  font-size: 28px;
4
-  color: #202020;
5
-  padding-left: 25px;
6
-  .pImg{
7
-    width: 35px;
8
-    height: 42px;
9
-    position: relative;
10
-    top: 10px;
11
-    right: 21px;
12
-  }
13
-}
1
+
14 2
 .search{
15 3
   padding: 40px 0  30px 0;
16 4
   position: relative;

+ 52
- 111
src/components/Landlord/Income/income.jsx Zobrazit soubor

@@ -1,136 +1,77 @@
1
-import { useState} from 'react'
2
-import Taro from '@tarojs/taro'
3
-import Popup from '@/components/Popup'
4
-import CustomNav from '@/components/CustomNav'
1
+import { useState } from 'react'
5 2
 import './income.less'
6 3
 import eyes from '../../../assets/icons/shopKeeper/小眼睛.png'
7 4
 import ceyes from '../../../assets/icons/shopKeeper/小眼睛-闭上.png'
8 5
 import sImg from '../../../assets/icons/landlord/我的收入2.png'
9 6
 import cutoverUser from '@/assets/icons/UserCenter/cutoverUser.png'
10
-import touristON from '@/assets/icons/UserCenter/touristON.png'
11
-import touristOFF from '@/assets/icons/UserCenter/touristOFF.png'
12
-import hotelBossON from '@/assets/icons/UserCenter/hotelBossON.png'
13
-import hotelBossOFF from '@/assets/icons/UserCenter/hotelBossOFF.png'
14
-import shopBossON from '@/assets/icons/UserCenter/shopBossON.png'
15
-import shopBossOFF from '@/assets/icons/UserCenter/shopBossOFF.png'
16
-
7
+import ToggleRoul from '@/components/toggleRoul/ToggleRoul'
8
+import Picker from '@/components/Picker'
17 9
 
18 10
 export default (props) => {
11
+  const { hotelList, hotel, account, onHotelChange, accountlog } = props
12
+
13
+  const handleHotelChange = (hotelId, current) => {
14
+    onHotelChange(current)
15
+  }
16
+
17
+  const [isyear, setYear] = useState(true)
18
+  const [isMomth, setMonth] = useState(false)
19
+  const handleYear = () => {
20
+    isyear ? setYear(false) : setYear(true)
21
+  }
22
+  const handleMonth = () => {
23
+    isMomth ? setMonth(false) : setMonth(true)
24
+  }
19 25
   const [showCutover, setShowCutover] = useState(false)
20 26
   const ShowMoldeOn = () => {
21 27
     setShowCutover(true)
22 28
   }
23
-  const ok = () => {
29
+  const onClose = () => {
24 30
     setShowCutover(false)
25 31
   }
26
-  const gotoShop = () => {
27
-    Taro.redirectTo({ url: '/shop/pages/spread/spreadIndex' })
28
-  }
29
-  const gotoPerson = () => {
30
-    Taro.redirectTo({ url: '/pages/index/index' })
31
-  }
32 32
   return (
33 33
     <view>
34
-      <view>
35
-        <CustomNav title='十公里' />
36
-      </view>
37
-      <Popup show={showCutover} maskClosable={false}>
38
-          <view className='User-box-sths' >
39
-            <view className='User-box-selectUser'>请选择身份:</view>
40
-            <view className='User-box-tourist' onClick={gotoPerson}>
41
-              <image className='Ubs-tourist-image' src={touristOFF} />
42
-              <text className='Ubs-tourist-text'>游客</text>
43
-            </view>
44
-            <view className='User-box-hotelBoss' onClick={ok}>
45
-              <image className='Ubs-hotelBoss-image' src={hotelBossON} />
46
-              <text className='Ubs-hotelBoss-text'>民宿老板</text>
47
-
48
-            </view>
49
-            <view className='User-box-shopBoss' onClick={gotoShop}>
50
-              <image className='Ubs-shopBoss-image' src={shopBossOFF} />
51
-              <text className='Ubs-shopBoss-text'>店铺老板</text>
52
-            </view>
53
-          </view>
54
-        </Popup>     
34
+      <ToggleRoul showCutover={showCutover} onClose={onClose} />
55 35
       <view style={{ padding: '30rpx', height: '100%' }}>
56 36
         <scroll-view scroll-y="true" scroll-view='true' bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll" style={{ height: 'calc(100vh - 120px)' }}>
57 37
           <view className='storexx'>
58
-              <view className='storeName'>店名:<text>Yun咖 云里 咖啡店</text></view>
59
-              <view onClick={ShowMoldeOn}  className='User-info-cutover'>
60
-                <image className='User-info-cutover-image' src={cutoverUser} />
61
-              </view>
62
-              <view className='money'>
63
-                <view className='sleft'>
64
-                  <view className='lword'>全年收入(税前)</view>
65
-                  <view className='yearMoney'>
66
-                    <text>2800000</text>元
67
-                    <image className='micon' src={eyes}></image>
68
-                  </view>
69
-                </view>
70
-                <view className='line' />
71
-                <view className='sright'>
72
-                  <view className='rword'>当月收入(税前)</view>
73
-                  <view className='monthMoney'>
74
-                    <text>******</text>元
75
-                    <image className='micon2' src={ceyes}></image>
76
-                  </view></view>
77
-              </view>
78
-            </view>
79
-          <view className='title'>推广收入记录</view>
80
-          <view>
81
-            <view className='spreadCard'>
82
-              <view className='spreadDate'>日期:<text>2021-06-24</text></view>
83
-              <view className='card'>
84
-                <view className='spreadTime'>时&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;间:<text>2021-06-24  20:45</text></view>
85
-                <view className='spreadMoney'>收入金额:<text>5.00</text>元</view> 
86
-                <image className='spreadImg' src={sImg} />
87
-              </view>
88
-            </view>
89
-            <view className='spreadCard'>
90
-              <view className='spreadDate'>日期:<text>2021-06-24</text></view>
91
-              <view className='card'>
92
-                <view className='spreadTime'>时&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;间:<text>2021-06-24  20:45</text></view>
93
-                <view className='spreadMoney'>收入金额:<text>5.00</text>元</view> 
94
-                <image className='spreadImg' src={sImg} />
95
-              </view>
96
-            </view>
97
-            <view className='spreadCard'>
98
-              <view className='spreadDate'>日期:<text>2021-06-24</text></view>
99
-              <view className='card'>
100
-                <view className='spreadTime'>时&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;间:<text>2021-06-24  20:45</text></view>
101
-                <view className='spreadMoney'>收入金额:<text>5.00</text>元</view> 
102
-                <image className='spreadImg' src={sImg} />
103
-              </view>
38
+            <view className='storeName'>店名:<Picker style={{ display: 'inline-block' }} placeholder="请选择民宿" value={hotel?.hotelId} kv={['hotelName', 'hotelId']} dicts={hotelList} onChange={handleHotelChange} /></view>
39
+            <view onClick={ShowMoldeOn} className='User-info-cutover'>
40
+              <image className='User-info-cutover-image' src={cutoverUser} />
104 41
             </view>
105
-            <view className='spreadCard'>
106
-              <view className='spreadDate'>日期:<text>2021-06-24</text></view>
107
-              <view className='card'>
108
-                <view className='spreadTime'>时&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;间:<text>2021-06-24  20:45</text></view>
109
-                <view className='spreadMoney'>收入金额:<text>5.00</text>元</view> 
110
-                <image className='spreadImg' src={sImg} />
111
-              </view>
112
-            </view>
113
-            <view className='spreadCard'>
114
-              <view className='spreadDate'>日期:<text>2021-06-24</text></view>
115
-              <view className='card'>
116
-                <view className='spreadTime'>时&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;间:<text>2021-06-24  20:45</text></view>
117
-                <view className='spreadMoney'>收入金额:<text>5.00</text>元</view> 
118
-                <image className='spreadImg' src={sImg} />
119
-              </view>
120
-            </view>
121
-            <view className='spreadCard'>
122
-              <view className='spreadDate'>日期:<text>2021-06-24</text></view>
123
-              <view className='card'>
124
-                <view className='spreadTime'>时&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;间:<text>2021-06-24  20:45</text></view>
125
-                <view className='spreadMoney'>收入金额:<text>5.00</text>元</view> 
126
-                <image className='spreadImg' src={sImg} />
42
+            <view className='money'>
43
+              <view className='sleft'>
44
+                <view className='lword'>全年收入(税前)</view>
45
+                <view className='yearMoney'>
46
+                  <text>{isyear ? account?.amounts : '******'}</text>元
47
+                  <image className='micon' src={isyear ? eyes : ceyes} onClick={handleYear} />
48
+                </view>
127 49
               </view>
50
+              <view className='line' />
51
+              <view className='sright'>
52
+                <view className='rword'>当月收入(税前)</view>
53
+                <view className='monthMoney'>
54
+                  <text>{isMomth ? account?.currentCharges : '******'}</text>元
55
+                  <image className='micon2' src={isMomth ? eyes : ceyes} onClick={handleMonth}></image>
56
+                </view></view>
128 57
             </view>
129 58
           </view>
130
-          <view className='botton'>已经到底了~</view>
131
-        </scroll-view>        
132
-      </view>
133
-      
59
+          
60
+          <view className='title' >{accountlog.length!=''?'推广收入记录':'暂无推广收入'}</view>
61
+            {
62
+              accountlog?.map((item) => 
63
+                <view className='spreadCard'>
64
+                  <view className='card'>
65
+                    <view className='spreadTime'>时&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;间:<text>{item.createDate}</text></view>
66
+                    <view className='spreadMoney'>收入金额:<text>{parseFloat((item.amount/100).toFixed(2))}</text>元</view>
67
+                    <image className='spreadImg' src={sImg} />
68
+                  </view>
69
+                </view>
70
+              )
71
+            }
72
+            {accountlog.length!=''?<view className='botton'>已经到底了~</view>:''}          
73
+        </scroll-view>
134 74
       </view>
75
+    </view>
135 76
   )
136 77
 }

+ 15
- 22
src/components/Landlord/Income/income.less Zobrazit soubor

@@ -56,7 +56,7 @@
56 56
 }
57 57
 .storexx{
58 58
   text-align: center;
59
-  height: 302px;
59
+  display: flow-root;
60 60
   background: #FFFFFF;
61 61
   box-shadow: 0px 8px 32px 0px rgba(0, 0, 0, 0.08);
62 62
   border-radius: 24px;
@@ -80,26 +80,26 @@
80 80
   }
81 81
   .sleft{
82 82
     float: left;
83
+    text-align: left;
83 84
     .lword{
84
-      height: 25px;
85 85
       font-size: 26px;
86 86
       color: #666666;
87
-      margin-bottom: 40px;      
88
-      margin-left: 1px;
87
+      margin-bottom: 40px;
89 88
     }
90 89
     .yearMoney{
91
-      height: 30px;
92 90
       font-size: 28px;
93 91
       font-weight: bold;
94 92
       color: #202020;
93
+      line-height: 0;
94
+      display: inline-block;
95 95
       text{
96 96
         font-size: 40px;
97 97
         color: #FF3434
98 98
       }
99 99
       .micon{
100 100
         width: 38px;
101
-        height: 22px;
102
-        margin-left: 19px;
101
+        height: 26px;
102
+        margin-left: 20px;
103 103
       }
104 104
     }
105 105
   }
@@ -114,28 +114,26 @@
114 114
   }
115 115
   .sright{
116 116
     float: right;
117
-    text-align: left;
117
+    text-align: right;
118 118
     .rword{
119 119
       font-size: 26px;
120 120
       color: #666666;
121
-      margin: 0 25px 47px 0;
122
-      text-align: center;
121
+      margin-bottom: 40px;
123 122
     }
124 123
     .monthMoney{
125
-      height: 24px;
126 124
       font-size: 28px;
127 125
       font-weight: bold;
128 126
       color: #202020;
129
-      line-height: 24px;
127
+      line-height: 0;
128
+      display: inline-block;
130 129
       text{
131 130
         font-size: 40px;
132 131
         color: #FF3434;
133 132
       }
134 133
       .micon2{
135
-        width: 34px;
136
-        height: 16px;
137
-        margin-left: 23px;
138
-        margin-bottom: 7px;
134
+        height: 26px;
135
+        width: 38px;
136
+        margin-left: 20px;
139 137
       }
140 138
     }
141 139
   }
@@ -147,12 +145,7 @@
147 145
   margin: 62px 0 10px 1px;
148 146
 }
149 147
 .spreadCard{
150
-  margin-bottom: 1px;
151
-  .spreadDate{
152
-    font-size: 20px;
153
-    color: #202020;
154
-    line-height: 60px;
155
-  }
148
+  margin-bottom: 60px;  
156 149
   .card{
157 150
     height: 166px;
158 151
     background: #FFF;

+ 9
- 6
src/components/OrderMolded/index.jsx Zobrazit soubor

@@ -1,32 +1,35 @@
1 1
 import { useState } from 'react'
2 2
 import image from '@/assets/icons/ProCard/8kb.jpg'
3 3
 import { Button, Radio } from '@tarojs/components'
4
-
4
+import PayOrderCard from '@/components/PayOrderCard'
5
+import moment from 'moment'
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 './style.less'
8 9
 
9 10
 export default (props) => {
11
+  const { item } = props
10 12
 
11 13
   return (
12 14
     <view class='wrapper-box'>
13 15
       <view class='left-complete-one'>
14 16
         <image className='left-image-1' src={ProCard_hot}></image>
15 17
         <view className='left-viewText'>
16
-          返现¥16.00
18
+          返现¥{item.cashback / 100}
17 19
         </view>
18 20
         <view className='title-image'>
19
-          <image className='image-1' mode='scaleToFill' src={image}></image>
21
+          <image className='image-1' mode='scaleToFill' src={item.poster}></image>
20 22
           <image className='image-2' src={food}></image>
21 23
         </view>
22 24
         <view className='title-content'>
23 25
           <view className='Pro-title'>
24
-            <view className='title-text'>【橘里橘气咖啡店】新鲜出炉啦!</view>
26
+            <view className='title-text'>{item.description}</view>
25 27
           </view>
26
-          <text className='title-money' >¥6990元</text>
27
-          <view className='title-time' >有效期:2021/06/21-2021/12/31</view>
28
+          <text className='title-money' >¥{item.actualPrice / 100}元</text>
29
+          <view className='title-time' >有效期:<text>{moment(item.startTimeal).format('YYYY/MM/DD')}</text> - <text>{moment(item.endTime).format('YYYY/MM/DD')}</text></view>
28 30
         </view>
29 31
       </view>
30 32
     </view>
33
+    // </view >
31 34
   )
32 35
 }

+ 121
- 0
src/components/PayOrderCard/index.jsx Zobrazit soubor

@@ -0,0 +1,121 @@
1
+import withLayout from '@/layouts'
2
+import useSave from "@/utils/hooks/useSave"
3
+import image from '@/assets/icons/ProCard/8kb.jpg'
4
+import AuthPage from '@/components/AuthPage'
5
+import moment from 'moment'
6
+import { useState, useEffect } from 'react'
7
+import { Button, Radio, Input } from '@tarojs/components'
8
+import food from '@/assets/icons/ProCard/food.png'
9
+import ProCard_hot from '@/assets/icons/ProCard/ProCard_hot.png'
10
+import OrderMolded from '@/components/OrderMolded'
11
+import Popup from '@/components/Popup'
12
+
13
+
14
+
15
+import './style.less'
16
+
17
+export default (props) => {
18
+  const { item, onShopContent, onShopNumber } = props
19
+  const [showDialog, setShowDialog] = useState(false)
20
+  const [BuyNumber, setBuyNumber] = useState(1)
21
+  const [DisabledBool, setDisabledBool] = useState(false)
22
+
23
+
24
+
25
+  const ShowMoldeOn = () => {
26
+    setShowDialog(true)
27
+  }
28
+  const ButtonCancel = () => {
29
+    setShowDialog(false)
30
+    setBuyNumber(1)
31
+  }
32
+  const ButtonOK = (e) => {
33
+    setShowDialog(false)
34
+    const itemList = [{ ...item }]
35
+    const itemListNumber = itemList.map(x => {
36
+      return { ...x, BuyNumber: BuyNumber }
37
+    })
38
+    const handeItemList = itemListNumber.map(shoPnumber => {
39
+      onShopContent(shoPnumber)
40
+    })
41
+    onShopNumber()
42
+    // console.log("🚀 ~ file: index.jsx ~ line 38 ~ ButtonOK ~ handeItemList", handeItemList)
43
+
44
+
45
+  }
46
+  const NumberAdd = () => {
47
+    setBuyNumber(BuyNumber + 1)
48
+
49
+  }
50
+
51
+  const NumberCut = () => {
52
+    setBuyNumber(BuyNumber - 1)
53
+
54
+  }
55
+
56
+  const onInput = (e) => {
57
+    let values = e.detail.value
58
+    setBuyNumber(values - 0)
59
+
60
+
61
+  }
62
+
63
+
64
+  useEffect(() => {
65
+    if (BuyNumber < 2) {
66
+      setDisabledBool(true)
67
+
68
+    } else {
69
+      setDisabledBool(false)
70
+
71
+    }
72
+
73
+  }, [BuyNumber])
74
+
75
+  return (
76
+
77
+    <view class='container'>
78
+      <Popup show={showDialog} maskClosable={false}>
79
+        <OrderMolded item={item} />
80
+        <view className='item-center-Number' >
81
+          <view className='buy-num-minus' disabled={DisabledBool} onClick={NumberCut} > - </view>
82
+          <Input className='buy-num-input' type='number' min={1} onInput={onInput} value={BuyNumber} />
83
+          <view className='buy-num-add' onClick={NumberAdd} >+</view>
84
+        </view>
85
+        <view className='buy-button-box' >
86
+          <button className='button-Cancel' onClick={ButtonCancel} >取消</button>
87
+          <button className='button-OK' onClick={ButtonOK} >确定</button>
88
+        </view>
89
+      </Popup>
90
+      <view class='coupon-list'>
91
+        <view class='wrapper'>
92
+          <view class='left-complete-one'>
93
+            <image className='left-image-1' src={ProCard_hot}></image>
94
+            <view className='left-viewText'>
95
+              返现¥{item.cashback / 100}
96
+            </view>
97
+            <view className='title-image'>
98
+              <image className='image-1' mode='scaleToFill' src={item.poster}></image>
99
+              <image className='image-2' src={food}></image>
100
+            </view>
101
+            <view className='title-content'>
102
+              <view className='Pro-title'>
103
+                <view className='title-text'>{item.description}</view>
104
+              </view>
105
+              <text className='title-money' >¥{item.actualPrice / 100}<text className='title-money-2'>{item.standardPrice / 100}</text></text>
106
+              <view className='title-time' >有效期:<text>{moment(item.startTimeal).format('YYYY/MM/DD')}</text> - <text>{moment(item.endTime).format('YYYY/MM/DD')}</text></view>
107
+            </view>
108
+          </view>
109
+          <view class='right-complete-two' onClick={ShowMoldeOn} >
110
+            <view className='right-content'>
111
+              <view className='right-number'>×{BuyNumber}</view>
112
+              <view className='right-title'>数量</view>
113
+            </view>
114
+          </view>
115
+        </view>
116
+      </view>
117
+    </view>
118
+
119
+
120
+  )
121
+}

+ 299
- 0
src/components/PayOrderCard/style.less Zobrazit soubor

@@ -0,0 +1,299 @@
1
+@whiteColor: #fff;
2
+@Image-ProCard_hot: "../../assets/icons/ProCard/ProCard_hot.png";
3
+.container {
4
+  width: 100%;
5
+  .item-center-Number {
6
+    width: 100%;
7
+    margin-top: 30px;
8
+    .buy-num-minus {
9
+      display: inline-block;
10
+      width: 60px;
11
+      height: 60px;
12
+      background: #ffffff;
13
+      border: 1px solid #999999;
14
+      border-radius: 8px 0px 0px 8px;
15
+    }
16
+    .buy-num-input {
17
+      display: inline-block;
18
+      width: 90px;
19
+      height: 60px;
20
+      font-size: 28px;
21
+      font-weight: 400;
22
+      color: #202020;
23
+      background: #ffffff;
24
+      border: 1px solid #999999;
25
+      position: relative;
26
+      top: 26px;
27
+    }
28
+    .buy-num-add {
29
+      display: inline-block;
30
+
31
+      width: 60px;
32
+      height: 60px;
33
+      background: #ffffff;
34
+      border: 1px solid #999999;
35
+      border-radius: 0px 8px 8px 0px;
36
+    }
37
+  }
38
+  .buy-button-box {
39
+    width: 100%;
40
+    margin: 40px 0 0 0;
41
+
42
+    .button-Cancel {
43
+      display: inline-block;
44
+      width: 236px;
45
+      height: 78px;
46
+      border: 2px solid #274291;
47
+      font-size: 30px;
48
+      font-weight: bold;
49
+      color: #274291;
50
+      border-radius: 12px;
51
+      margin-right: 80px;
52
+    }
53
+    .button-OK {
54
+      display: inline-block;
55
+
56
+      width: 236px;
57
+      height: 78px;
58
+      background: #274291;
59
+      border-radius: 12px;
60
+      font-size: 30px;
61
+      font-weight: bold;
62
+      color: #ffffff;
63
+    }
64
+  }
65
+  .wrapper {
66
+    display: flex;
67
+    position: relative;
68
+    // margin-top: 600px;
69
+    margin: 30px auto;
70
+    width: 700px;
71
+
72
+    // box-shadow: 0px 8px 38px 0px rgba(0, 0, 0, 0.12);
73
+    // filter: drop-shadow(5px 8px 6px rgb(202, 202, 202));
74
+    filter: drop-shadow(0 0 0.9rem rgba(0, 0, 0, 0.12));
75
+
76
+    .left-complete-one {
77
+      padding-top: 87px;
78
+      padding-bottom: 43px;
79
+      position: relative;
80
+      display: flex;
81
+      background: @whiteColor;
82
+      background: radial-gradient(
83
+            circle at top right,
84
+            transparent 15px,
85
+            @whiteColor 0
86
+          )
87
+          top right,
88
+        radial-gradient(circle at bottom right, transparent 15px, @whiteColor 0)
89
+          bottom right;
90
+      background-size: 100% 60%;
91
+      background-repeat: no-repeat;
92
+
93
+      width: 573px;
94
+      border-radius: 15px 0px 0px 15px;
95
+      // border-radius: 12px;
96
+
97
+      align-items: center;
98
+      .left-image-1 {
99
+        width: 145px;
100
+        height: 44px;
101
+        position: absolute;
102
+        top: 22px;
103
+      }
104
+      .left-viewText {
105
+        // background-image: url(@Image-ProCard_hot);
106
+        // width: 287px;
107
+        width: auto;
108
+        height: 44.3px;
109
+        position: absolute;
110
+        left: 1px;
111
+        top: 28px;
112
+        font-size: 24px;
113
+        color: @whiteColor;
114
+        font-weight: 600;
115
+      }
116
+      //图片
117
+      .title-image {
118
+        width: 145px;
119
+        margin-left: 20px;
120
+        border-radius: 24px;
121
+        overflow: hidden;
122
+        position: relative;
123
+        .image-1 {
124
+          width: 100%;
125
+          height: 145px;
126
+        }
127
+        .image-2 {
128
+          width: 89px;
129
+          height: 34px;
130
+          position: absolute;
131
+          left: 0;
132
+          top: 0;
133
+        }
134
+      }
135
+      // 商品标题
136
+      .title-content {
137
+        // padding: 84px 0 56px 20px;
138
+        padding-left: 18px;
139
+
140
+        .Pro-title {
141
+          .title-text {
142
+            width: 375px;
143
+            overflow: hidden;
144
+            text-overflow: ellipsis;
145
+            display: -webkit-box; //必须要
146
+            -webkit-line-clamp: 1;
147
+            -webkit-box-orient: vertical;
148
+            word-break: break-all; /* 多出文本省略号代替 */
149
+            text-align: left;
150
+            font-size: 24px;
151
+            padding-bottom: 10px;
152
+          }
153
+        }
154
+        .title-money {
155
+          padding-top: 34px;
156
+          font-size: 24px;
157
+          // color: red;
158
+          font-weight: 800;
159
+        }
160
+        .title-money-2 {
161
+          font-size: 18px;
162
+          color: #666;
163
+          padding-left: 10px;
164
+          text-decoration: line-through;
165
+        }
166
+
167
+        .title-time {
168
+          font-size: 24px;
169
+          padding-top: 20px;
170
+          color: #c0c8d3;
171
+        }
172
+      }
173
+    }
174
+  }
175
+
176
+  .right-complete-two {
177
+    background: @whiteColor;
178
+    background: radial-gradient(
179
+          circle at top left,
180
+          transparent 15px,
181
+          @whiteColor 0
182
+        )
183
+        top left,
184
+      radial-gradient(circle at bottom left, transparent 15px, @whiteColor 0)
185
+        bottom left;
186
+    background-size: 100% 60%;
187
+    background-repeat: no-repeat;
188
+    width: 129px;
189
+    border-radius: 0 15px 15px 0;
190
+    position: relative;
191
+    //右面部分
192
+    .right-content {
193
+      // width: 100px;
194
+      // height: 80px;
195
+      position: absolute;
196
+      top: 50%;
197
+      left: 50%;
198
+      transform: translate(-50%, -50%);
199
+      // border: 1px solid red;
200
+
201
+      .right-number {
202
+        width: 40px;
203
+        font-size: 20px;
204
+        border-radius: 4px;
205
+        border: 2px solid #999;
206
+        margin: auto;
207
+        text-align: center;
208
+      }
209
+
210
+      .right-title {
211
+        font-weight: 700;
212
+        font-size: 24px;
213
+        padding-top: 20px;
214
+        text-align: center;
215
+      }
216
+    }
217
+  }
218
+  //线条
219
+  .right-complete-two::after {
220
+    content: "";
221
+    position: absolute;
222
+    top: 15px;
223
+    margin: 26px auto;
224
+    height: 70%;
225
+    border-left: 1px dashed #595959;
226
+  }
227
+
228
+  .view-button {
229
+
230
+    position: fixed;
231
+    bottom: 0px;
232
+
233
+    .Card-number-box {
234
+      .Card-number {
235
+        width: 100%;
236
+        height: 96px;
237
+        background-color: @whiteColor;
238
+      }
239
+      .Card-user {
240
+        width: 100%;
241
+        height: 96px;
242
+        background-color: @whiteColor;
243
+      }
244
+    }
245
+    .button-box-button-box {
246
+      position: relative;
247
+      .button-text-image {
248
+        width: 144;
249
+        height: 45px;
250
+        position: absolute;
251
+        top: -35px;
252
+        left: 267px;
253
+        right: 305px;
254
+        z-index: 1;
255
+        .button-text-money-hot {
256
+          position: absolute;
257
+          width: 144px;
258
+          height: 43px;
259
+          line-height: 43px;
260
+          font-size: 24px;
261
+          font-weight: bold;
262
+          color: @whiteColor;
263
+        }
264
+        .button-image {
265
+          width: 143px;
266
+          height: 43px;
267
+        }
268
+        .button-text-money {
269
+          position: absolute;
270
+          margin-top: -8;
271
+          width: 157px;
272
+          font-size: 18px;
273
+          font-weight: 400;
274
+          text-decoration: line-through;
275
+          color: @whiteColor;
276
+        }
277
+      }
278
+      .button-box-one {
279
+        font-size: 30px;
280
+        line-height: 92px;
281
+        margin-top: 3em;
282
+        background-color: #274190;
283
+        border-radius: 12px;
284
+        width: 690px;
285
+        height: 92px;
286
+        color: @whiteColor;
287
+        // position: absolute;
288
+        bottom: 40px;
289
+        right: 0;
290
+        left: 0;
291
+        .button-text-one {
292
+          right: 133px;
293
+          font-size: 30px;
294
+          padding-left: 220px;
295
+        }
296
+      }
297
+    }
298
+  }
299
+}

+ 58
- 0
src/components/Picker/index.jsx Zobrazit soubor

@@ -0,0 +1,58 @@
1
+import { useEffect, useState } from 'react'
2
+import { Picker, View } from '@tarojs/components'
3
+import './style.less'
4
+
5
+export default (props) => {
6
+  const { kv, value, onChange, dicts, placeholder, mode, ...leftProps } = props
7
+  const [rangeKey, rangeVal] = kv || ['label', 'value']
8
+
9
+  const [inx, setInx] = useState()
10
+  const [text, setText] = useState()
11
+
12
+  const handleChange = (e) => {
13
+    if (mode && mode !== 'selector') {
14
+      onChange(e.detail.value)
15
+      return
16
+    }
17
+
18
+    const index = e.detail.value - 0
19
+    const item = dicts[index]
20
+    if (onChange) {
21
+      onChange(item[rangeVal], item)
22
+    }
23
+  }
24
+
25
+  useEffect(() => {
26
+    if (dicts && dicts.length > 0) {
27
+      if (value !== undefined && value !== null) {
28
+        for(let i = 0; i < dicts.length; i += 1) {
29
+          if (dicts[i][rangeVal] === value) {
30
+            setInx(i)
31
+            setText(dicts[i][rangeKey])
32
+            break;
33
+          }
34
+        }
35
+      }
36
+    }
37
+  }, [dicts, rangeKey, rangeVal, value])
38
+
39
+  useEffect(() => {
40
+    if (mode && mode !== 'selector') {
41
+      setText(value)
42
+    }
43
+  }, [mode, value])
44
+
45
+  return (
46
+    <Picker
47
+      className='g-picker'
48
+      rangeKey={rangeKey}
49
+      onChange={handleChange}
50
+      value={inx}
51
+      range={dicts}
52
+      mode={mode||'selector'}
53
+      {...leftProps}
54
+    >
55
+      <View>{text || placeholder || '请选择'}</View>
56
+    </Picker>
57
+  )
58
+}

+ 0
- 0
src/components/Picker/style.less Zobrazit soubor


+ 2
- 2
src/components/Popup/index.jsx Zobrazit soubor

@@ -2,10 +2,10 @@
2 2
 import './style.less'
3 3
 
4 4
 export default (props) => {
5
-  const { show, mask = true, maskClosable, onClose } = props
5
+  const { show, mask = true,  onClose } = props
6 6
 
7 7
   return (
8
-    <mp-dialog extClass='x-popup' buttons={[]} show={show} mask={mask} maskClosable={maskClosable} onClose={onClose}>
8
+    <mp-dialog extClass='x-popup'  buttons={[]} show={show} mask={mask} maskClosable={true} onClose={onClose}>
9 9
       {props.children}
10 10
     </mp-dialog>
11 11
   )

+ 4
- 28
src/components/spreads/ShopKeeper/shopKeeper.jsx Zobrazit soubor

@@ -14,6 +14,7 @@ import hotelBossOFF from '@/assets/icons/UserCenter/hotelBossOFF.png'
14 14
 import shopBossON from '@/assets/icons/UserCenter/shopBossON.png'
15 15
 import shopBossOFF from '@/assets/icons/UserCenter/shopBossOFF.png'
16 16
 import './shopKeeper.less'
17
+import  ToggleRoul  from  '@/components/toggleRoul/ToggleRoul'
17 18
 
18 19
 
19 20
 export default (props) => {
@@ -44,41 +45,16 @@ export default (props) => {
44 45
   const ShowMoldeOn = () => {
45 46
     setShowCutover(true)
46 47
   }
47
-  const ok = () => {
48
+  const onClose = () => {
48 49
     setShowCutover(false)
49 50
   }
50
-  const goToHotel = () => {
51
-    Taro.redirectTo({ url: '/hotel/pages/landlord/landlord' })
52
-  }
53
-  const gotoPerson = () => {
54
-    Taro.redirectTo({ url: '/pages/index/index' })
55
-  }
56 51
   return (
57 52
     <view>
58 53
       <view>
59 54
         <CustomNav title='十公里' />
60 55
       </view>
61
-      <Popup show={showCutover} maskClosable={false}>
62
-          <view className='User-box-sths' >
63
-            <view className='User-box-selectUser'>请选择身份:</view>
64
-            <view className='User-box-tourist' onClick={gotoPerson}>
65
-              <image className='Ubs-tourist-image' src={touristOFF} />
66
-              <text className='Ubs-tourist-text'>游客</text>
67
-            </view>
68
-            <view className='User-box-hotelBoss' onClick={goToHotel}>
69
-              <image className='Ubs-hotelBoss-image' src={hotelBossOFF} />
70
-              <text className='Ubs-hotelBoss-text'>民宿老板</text>
71
-
72
-            </view>
73
-            <view className='User-box-shopBoss' onClick={ok}>
74
-              <image className='Ubs-shopBoss-image' src={shopBossON} />
75
-              <text className='Ubs-shopBoss-text'>店铺老板</text>
76
-
77
-            </view>
78
-          </view>
79
-
80
-        </Popup>
81
-        
56
+      <ToggleRoul showCutover={showCutover} onClose={onClose} />
57
+  
82 58
       <view style={{ padding: '30rpx', height: '100%' }}>
83 59
         <scroll-view scroll-y="true" scroll-view='true' bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll" style={{ height: 'calc(100vh - 120px)' }}>
84 60
           <view className='storexx'>

+ 30
- 54
src/components/spreads/Sparead/spreadMoney.jsx Zobrazit soubor

@@ -1,4 +1,4 @@
1
-import { useState} from 'react'
1
+import { useState } from 'react'
2 2
 import Taro from '@tarojs/taro'
3 3
 import CustomNav from '@/components/CustomNav'
4 4
 import Popup from '@/components/Popup'
@@ -9,94 +9,70 @@ import touristOFF from '@/assets/icons/UserCenter/touristOFF.png'
9 9
 import hotelBossOFF from '@/assets/icons/UserCenter/hotelBossOFF.png'
10 10
 import shopBossON from '@/assets/icons/UserCenter/shopBossON.png'
11 11
 import './spreadMoney.less'
12
+import  ToggleRoul  from  '@/components/toggleRoul/ToggleRoul'
12 13
 
13 14
 export default (props) => {
15
+
14 16
   const [showCutover, setShowCutover] = useState(false)
15 17
   const ShowMoldeOn = () => {
16 18
     setShowCutover(true)
17 19
   }
18
-  const ok = () => {
20
+  const onClose = () => {
19 21
     setShowCutover(false)
20
-  }
21
-  const goToHotel = () => {
22
-    Taro.redirectTo({ url: '/hotel/pages/landlord/landlord' })
23
-  }
24
-  const gotoPerson = () => {
25
-    Taro.redirectTo({ url: '/pages/index/index' })
26
-  }
22
+    }
27 23
 
28 24
   return (
29 25
     <view>
30 26
       <view>
31 27
         <CustomNav title='十公里' />
32 28
       </view>
33
-      <Popup show={showCutover} maskClosable={false}>
34
-          <view className='User-box-sths' >
35
-            <view className='User-box-selectUser'>请选择身份:</view>
36
-            <view className='User-box-tourist' onClick={gotoPerson}>
37
-              <image className='Ubs-tourist-image' src={touristOFF} />
38
-              <text className='Ubs-tourist-text'>游客</text>
39
-            </view>
40
-            <view className='User-box-hotelBoss' onClick={goToHotel}>
41
-              <image className='Ubs-hotelBoss-image' src={hotelBossOFF} />
42
-              <text className='Ubs-hotelBoss-text'>民宿老板</text>
43
-
44
-            </view>
45
-            <view className='User-box-shopBoss' onClick={ok}>
46
-              <image className='Ubs-shopBoss-image' src={shopBossON} />
47
-              <text className='Ubs-shopBoss-text'>店铺老板</text>
48
-
49
-            </view>
50
-          </view>
51
-
52
-        </Popup>
53
-     
29
+      <ToggleRoul showCutover={showCutover} onClose={onClose} />
54 30
       <view style={{ padding: '30rpx', height: '100%' }}>
55 31
         <scroll-view scroll-y="true" scroll-view='true' bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll" style={{ height: 'calc(100vh - 120px)' }}>
56 32
           <view className='storexx'>
57
-              <view className='storeName'>店名:<text>Yun咖 云里 咖啡店</text></view>
58
-              <view onClick={ShowMoldeOn}  className='User-info-cutover'>
59
-                <image className='User-info-cutover-image' src={cutoverUser} />
60
-              </view>
61
-              <view className='tip'>(计算收入以核销为准)</view>
62
-              <view className='money'>
63
-                <view className='sleft'>
64
-                  <view className='lword'>全年推广收入(税前)</view>
65
-                  <view className='yearMoney'>
66
-                    <text>2800000</text>元
67
-                    <image className='micon' src={eyes}></image>
68
-                  </view>
33
+            <view className='storeName'>店名:<text>Yun咖 云里 咖啡店</text></view>
34
+            <view onClick={ShowMoldeOn} className='User-info-cutover'>
35
+              <image className='User-info-cutover-image' src={cutoverUser} />
36
+            </view>
37
+            <view className='tip'>(计算收入以核销为准)</view>
38
+            <view className='money'>
39
+              <view className='sleft'>
40
+                <view className='lword'>全年推广收入(税前)</view>
41
+                <view className='yearMoney'>
42
+                  <text>2800000</text>元
43
+                  <image className='micon' src={eyes}></image>
69 44
                 </view>
70
-                <view className='line' />
71
-                <view className='sright'>
72
-                  <view className='rword'>当月推广收入(税前)</view>
73
-                  <view className='monthMoney'>
74
-                    <text>******</text>元
75
-                    <image className='micon2' src={ceyes}></image>
76
-                  </view></view>
77 45
               </view>
46
+              <view className='line' />
47
+              <view className='sright'>
48
+                <view className='rword'>当月推广收入(税前)</view>
49
+                <view className='monthMoney'>
50
+                  <text>******</text>元
51
+                  <image className='micon2' src={ceyes}></image>
52
+                </view></view>
78 53
             </view>
54
+          </view>
79 55
           <view className='title'>推广收入记录</view>
80 56
           <view>
81 57
             <view className='spreadCard'>
82 58
               <view className='spreadDate'>日期:<text>2021-06-24</text></view>
83 59
               <view className='card'>
84 60
                 <view className='spreadTime'>时&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;间:<text>2021-06-24  20:45</text></view>
85
-                <view className='spreadMoney'>收入金额:<text>5.00</text>元</view> 
61
+                <view className='spreadMoney'>收入金额:<text>5.00</text>元</view>
86 62
               </view>
87 63
             </view>
88 64
             <view className='spreadCard'>
89 65
               <view className='spreadDate'>日期:<text>2021-06-24</text></view>
90 66
               <view className='card'>
91 67
                 <view className='spreadTime'>时&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;间:<text>2021-06-24  20:45</text></view>
92
-                <view className='spreadMoney'>收入金额:<text>5.00</text>元</view> 
68
+                <view className='spreadMoney'>收入金额:<text>5.00</text>元</view>
93 69
               </view>
94 70
             </view>
95 71
           </view>
96 72
           <view className='botton'>已经到底了~</view>
97
-        </scroll-view>        
98
-      </view>
99
-      
73
+        </scroll-view>
100 74
       </view>
75
+
76
+    </view>
101 77
   )
102 78
 }

+ 47
- 0
src/components/toggleRoul/ToggleRoul.jsx Zobrazit soubor

@@ -0,0 +1,47 @@
1
+import { useState,useEffect } from 'react';
2
+
3
+import touristON from '@/assets/icons/UserCenter/touristON.png'
4
+import touristOFF from '@/assets/icons/UserCenter/touristOFF.png'
5
+import hotelBossON from '@/assets/icons/UserCenter/hotelBossON.png'
6
+import hotelBossOFF from '@/assets/icons/UserCenter/hotelBossOFF.png'
7
+import shopBossON from '@/assets/icons/UserCenter/shopBossON.png'
8
+import shopBossOFF from '@/assets/icons/UserCenter/shopBossOFF.png'
9
+
10
+import Popup from '@/components/Popup'
11
+import './ToggleRoul.less'
12
+import { useModel } from '@/store'
13
+
14
+
15
+export default ( props)=>{
16
+  const {showCutover, onClose }=props
17
+  const {getRoul}=useModel('person')
18
+  const goToPerson=()=>{
19
+    getRoul('normal')
20
+  }
21
+  const goToHotel=()=>{
22
+    getRoul('hotel')
23
+  }
24
+  const goToShop=()=>{
25
+    getRoul('shop')
26
+  }
27
+
28
+    return (      
29
+      <Popup show={showCutover} onClose={onClose}>
30
+          <view className='User-box-sths' >
31
+            <view className='User-box-selectUser'>请选择身份:</view>
32
+            <view className='User-box-tourist' onClick={goToPerson}>
33
+              <image className='Ubs-tourist-image' src={touristOFF} />
34
+              <text className='Ubs-tourist-text'>游客</text>
35
+            </view>
36
+            <view className='User-box-hotelBoss' onClick={goToHotel}>
37
+              <image className='Ubs-hotelBoss-image' src={hotelBossOFF} />
38
+              <text className='Ubs-hotelBoss-text'>民宿老板</text>
39
+            </view>
40
+            <view className='User-box-shopBoss' onClick={goToShop}>
41
+              <image className='Ubs-shopBoss-image' src={shopBossON} />
42
+              <text className='Ubs-shopBoss-text'>店铺老板</text>
43
+            </view>
44
+          </view>
45
+        </Popup>
46
+    )  
47
+}

+ 56
- 0
src/components/toggleRoul/ToggleRoul.less Zobrazit soubor

@@ -0,0 +1,56 @@
1
+.User-box-sths{
2
+  display: flex;
3
+  margin: 40px 0  60px 0;
4
+  justify-content: space-around;
5
+  flex-wrap: wrap;
6
+  .User-box-selectUser{
7
+    width: 100%;
8
+    font-size: 32px;
9
+    font-weight: bold;
10
+    color: #202020;
11
+    line-height: 32px;
12
+    margin: 60px 0 70px  0;
13
+    text-align: left;
14
+  }
15
+  .User-box-tourist{
16
+    display: inline-block;
17
+
18
+     .Ubs-tourist-image{
19
+      width: 86px;
20
+      height: 86px;
21
+
22
+    }
23
+    .Ubs-tourist-text{
24
+      display: block;
25
+      font-size: 30px;
26
+      font-weight: bold;
27
+      color: #999999;      
28
+    }
29
+  }
30
+  .User-box-hotelBoss{
31
+    display: inline-block;
32
+    .Ubs-hotelBoss-image{
33
+      width: 86px;
34
+      height: 86px;
35
+    }
36
+    .Ubs-hotelBoss-text{
37
+      display: block;
38
+      font-size: 30px;
39
+      font-weight: bold;
40
+      color: #999999;
41
+    }
42
+  }
43
+  .User-box-shopBoss{
44
+    .Ubs-shopBoss-image{
45
+      width: 86px;
46
+      height: 86px;
47
+    }
48
+    .Ubs-shopBoss-text{
49
+      display: block;
50
+      font-size: 30px;
51
+      font-weight: bold;
52
+      color:#202020;
53
+    }
54
+  }
55
+
56
+}

+ 34
- 3
src/hotel/pages/landlord/landlord.jsx Zobrazit soubor

@@ -7,15 +7,45 @@ import incomeImg from '@/assets/icons/landlord/我的收入.png'
7 7
 import onincomeImg from '@/assets/icons/landlord/我的收入按下.png'
8 8
 import houseImg from '@/assets/icons/landlord/房源管理.png'
9 9
 import onhouseImg from '@/assets/icons/landlord/房源管理按下.png'
10
-import './landlord.less'
11 10
 import withLayout from '@/layouts'
11
+import { getHotelManage, getAccountLogList, getNowHotelManage } from '@/services/landlord'
12
+import CustomNav from '@/components/CustomNav'
12 13
 
14
+import './landlord.less'
13 15
 
14 16
 export default withLayout((props) => {
15 17
   const { router, person } = props
16 18
   const { params } = useRouter()
17 19
   const { tab } = params || {}
18 20
 
21
+  const [hotelList, setHotelList] = useState([])
22
+  const [hotel, setHotel] = useState()
23
+  const [account, setAccount] = useState()
24
+  const [accountlog, setAccountLog] = useState([])
25
+
26
+  useEffect(() => {
27
+    getHotelManage().then((res) => {
28
+      const { hotelList: list, account: acc, hotel: current } = res
29
+      setHotelList(list)
30
+      setHotel(current)
31
+      setAccount(acc)
32
+      getAccountLogList(acc.accountId).then((res2) => {
33
+        setAccountLog(res2.records || [])
34
+      })
35
+    })
36
+  }, [])
37
+
38
+  const handleHotelChange = (current) => {    
39
+    getNowHotelManage(current.hotelId).then((res) => {
40
+      const {account: acc } = res
41
+      setAccount(acc)
42
+      setHotel(current)
43
+      getAccountLogList(acc.accountId).then((res2) => {
44
+        setAccountLog(res2.records || [])
45
+      })
46
+    })
47
+  }
48
+
19 49
   const [currentTab, setCurrentTab] = useState(0)
20 50
 
21 51
   const handleTabChange = (e) => {
@@ -31,9 +61,10 @@ export default withLayout((props) => {
31 61
 
32 62
   return (
33 63
     <view className='page-index'>
64
+      <CustomNav title={hotel?.hotelName} logo={hotel?.logo} />
34 65
       <view className='index-container'>
35
-        {currentTab === 0 && <Income />}
36
-        {currentTab === 1 && <HouseManage />}
66
+        {currentTab === 0 && <Income hotelList={hotelList} hotel={hotel} account={account} onHotelChange={handleHotelChange} accountlog={accountlog} />}
67
+        {currentTab === 1 && <HouseManage hotel={hotel} />}
37 68
       </view>
38 69
       <view className='index-tabbar'>
39 70
         <TabBar extClass='custom-tabbar bottomTab' current={currentTab} onChange={handleTabChange}>

+ 2
- 2
src/layouts/index.jsx Zobrazit soubor

@@ -18,12 +18,12 @@ export default (Child) => (props) => {
18 18
     const personRole = person?.personRole;
19 19
     if (!personRole) return;
20 20
 
21
-    const isNormalPerson = personRole === 'person'
21
+    const isNormalPerson = personRole === 'normal'
22 22
 
23 23
     const currentPage = getPageBy(router.path)
24 24
     let indexPage = getIndexPageOf(personRole)
25 25
     if (!isNormalPerson) {
26
-      indexPage = `${personRole}/${indexPage}`
26
+      indexPage = `${personRole}/${indexPage.page}`
27 27
     }
28 28
 
29 29
     const isMatched = isNormalPerson ?

+ 2
- 2
src/pages/MineUserAll/Collect/index.jsx Zobrazit soubor

@@ -49,7 +49,7 @@ export default withLayout((props) => {
49 49
           <view className='card-box-star'>
50 50
             {
51 51
               scoreList.map((_, index) => {
52
-                console.log(index)
52
+
53 53
                 const src = (index + '0.1') < score ? starOn : starOff
54 54
                 return (
55 55
                   <image className='card-star-image' key={index} src={src} />
@@ -92,7 +92,7 @@ export default withLayout((props) => {
92 92
           <view className='card-box-star'>
93 93
             {
94 94
               scoreList.map((_, index) => {
95
-                console.log(index)
95
+
96 96
                 const src = (index + '0.1') < score ? starOn : starOff
97 97
                 return (
98 98
                   <image className='card-star-image' key={index} src={src} />

+ 2
- 2
src/pages/MineUserAll/RefundMoney/index.jsx Zobrazit soubor

@@ -40,7 +40,7 @@ export default withLayout((props) => {
40 40
           <view className='card-box-star'>
41 41
             {
42 42
               scoreList.map((_, index) => {
43
-                console.log(index)
43
+
44 44
                 const src = (index + '0.1') < score ? starOn : starOff
45 45
                 return (
46 46
                   <image className='card-star-image' key={index} src={src} />
@@ -80,7 +80,7 @@ export default withLayout((props) => {
80 80
           <view className='card-box-star'>
81 81
             {
82 82
               scoreList.map((_, index) => {
83
-                console.log(index)
83
+
84 84
                 const src = (index + '0.1') < score ? starOn : starOff
85 85
                 return (
86 86
                   <image className='card-star-image' key={index} src={src} />

+ 60
- 278
src/pages/PayOrder/index.jsx Zobrazit soubor

@@ -1,291 +1,73 @@
1
-import withLayout from "@/layouts";
2
-import image from "@/assets/icons/ProCard/8kb.jpg";
3
-import { useState, useEffect } from "react";
4
-import { Button, Checkbox, Input } from "@tarojs/components";
5
-
6
-import food from "@/assets/icons/ProCard/food.png";
7
-import ProCard_hot from "@/assets/icons/ProCard/ProCard_hot.png";
8
-import CustomNav from "@/components/CustomNav";
9
-import OrderMolded from "@/components/OrderMolded";
10
-import Popup from "@/components/Popup";
11
-
12
-import "./style.less";
13
-import Taro, { useDidShow } from "@tarojs/taro";
14
-import { getShopPackageDetail } from "@/services/home";
15
-import { saveOrder, getOrderSub, payOrder } from "@/services/payOrder";
16
-import formatTime from "@/utils/formatTime";
17
-
18
-export default withLayout((props) => {
19
-  const { router, person } = props;
20
-  const { packageId, orderId } = props.router.params;
21
-
22
-  const [payInfo,setPayInfo] = useState()
23
-
24
-  const [showDialog, setShowDialog] = useState(false);
25
-  // 是否已阅读协议
26
-  const [agreement, setAgreement] = useState(false);
27
-  // 总价 totalPrice
28
-  const [totalPrice, setTotalPrice] = useState({});
29
-  const [list, setList] = useState([]);
30
-
31
-  const [BuyNumber, setBuyNumber] = useState(1);
32
-  const [detail, setDetail] = useState({});
33
-
34
-  const [DisabledBool, setDisabledBool] = useState(false);
35
-
36
-  const ShowMoldeOn = (e) => {
37
-    if (packageId) {
38
-      setBuyNumber(e.amount || 1);
39
-      setDetail(e);
40
-      setShowDialog(true);
41
-    }
42
-  };
43
-  const ButtonCancel = () => {
44
-    setShowDialog(false);
45
-  };
46
-  const ButtonOK = (e) => {
47
-    setList(
48
-      list.map((x) =>
49
-        x.packageId == detail.packageId ? { ...x, amount: BuyNumber } : x
50
-      )
51
-    );
52
-    setShowDialog(false);
53
-  };
54
-
55
-  const NumberAdd = () => {
56
-    setBuyNumber(BuyNumber + 1);
57
-    console.log(BuyNumber);
58
-  };
59
-
60
-  const NumberCut = () => {
61
-    if (DisabledBool) return;
62
-    setBuyNumber(BuyNumber - 1);
63
-    console.log(BuyNumber);
64
-  };
65
-
66
-  const onInput = (e) => {
67
-    let values = e.detail.value;
68
-    setBuyNumber(values - 0);
69
-  };
70
-
71
-  const requestPayment = (params) =>{
72
-    console.log(params,'requestPayment')
73
-    Taro.requestPayment({
74
-      ...params,
75
-      package: params.packageValue,
76
-      success: () => {
77
-        console.log("success");
78
-        setPayInfo()
79
-        Taro.showToast({
80
-          title: "支付成功",
81
-          icon: "none",
82
-          duration: 2000,
83
-        });
84
-      },
85
-      fail: (e) => {
86
-        console.log(e, "fail");
87
-        Taro.showToast({
88
-          title: "支付失败",
89
-          icon: "none",
90
-          duration: 2000,
91
-        });
92
-      },
93
-    });
94
-  }
95
-
96
-  const onShowPay = (e) => {
97
-    if (agreement) {
98
-      if(payInfo){
99
-        requestPayment(payInfo)
100
-        return
101
-      }
102
-      if (packageId) {
103
-        saveOrder(
104
-          list.map((x) => {
105
-            return {
106
-              amount: x.amount || 1,
107
-              itemId: x.packageId,
108
-              price: x.actualPrice,
109
-            };
110
-          })
111
-        ).then((res) => {
112
-          setPayInfo(res)
113
-          requestPayment(res)
114
-        });
115
-      }
116
-      if (orderId) {
117
-        payOrder(orderId).then((res) => {
118
-          setPayInfo(res)
119
-          requestPayment(res)
120
-        });
121
-      }
122
-    } else {
123
-      Taro.showToast({
124
-        title: "请勾选《平台用户服务协议》",
125
-        icon: "none",
126
-        duration: 2000,
127
-      });
128
-    }
129
-  };
1
+import Taro from '@tarojs/taro'
2
+import Star from '@/components/Star/Star.jsx'
3
+import pay from '@/assets/icons/housemantj/pay.png'
4
+import msTip from '@/assets/icons/housemantj/foodtip.png'
5
+import wz from '@/assets/icons/housemantj/location.png'
6
+import hongxin from '@/assets/icons/housemantj/已收藏.png'
7
+import baixin from '@/assets/icons/housemantj/收藏.png'
8
+import './style.less'
9
+import useSave from "@/utils/hooks/useSave"
10
+import {getShopDetail,getShopcity} from '@/services/home'
11
+import { useState, useEffect } from 'react'
12
+
13
+
14
+
15
+//套餐卡片
16
+export default (props) => {
17
+  const { item } = props
18
+  const [isSaved, toggleSave] = useSave(item.isSaved,'shop_package', item.packageId)
19
+  const [city,setCity]=useState({})
20
+  const [detail,setDetail]=useState({})
130 21
 
131 22
   useEffect(() => {
132
-    if (packageId) {
133
-      getShopPackageDetail(packageId).then((res) => {
134
-        setList([res]);
135
-      });
136
-    }
137
-    if (orderId) {
138
-      getOrderSub({ pageNum: 1, pageSize: 999, orderId }).then((res) => {
139
-        setList(res.records);
140
-      });
141
-    }
142
-  }, [packageId, orderId]);
143
-
144
-  useEffect(() => {
145
-    if (BuyNumber < 2) {
146
-      setDisabledBool(true);
147
-    } else {
148
-      setDisabledBool(false);
149
-    }
150
-  }, [BuyNumber]);
151
-
152
-  useEffect(() => {
153
-    let total = {
154
-      cashback: 0,
155
-      actualPrice: 0,
156
-      standardPrice: 0,
157
-    };
158
-    list.map((x) => {
159
-      total.cashback += x.cashback * (x.amount || 1);
160
-      total.actualPrice += (x.actualPrice || x.unitPrice) * (x.amount || 1);
161
-      total.standardPrice += x.standardPrice * (x.amount || 1);
162
-    });
163
-    setTotalPrice(total);
164
-  }, [list]);
23
+  getShopDetail(item.shopId).then((res)=>{
24
+    setDetail(res)
25
+    getShopcity(res.cityId).then((res2)=>{
26
+      setCity(res2)
27
+    })
28
+  })
29
+}, [])
30
+const star=parseFloat(((detail.sweetScore+detail.environmentScore+detail.serviceScore)/3).toFixed(1)); 
165 31
 
166 32
   return (
167
-    <view class="container">
168
-      <CustomNav title="订单" />
169
-      <Popup show={showDialog} maskClosable={false}>
170
-        <OrderMolded />
171
-        <view className="item-center-Number">
172
-          <view
173
-            className="buy-num-minus"
174
-            disabled={DisabledBool}
175
-            onClick={NumberCut}
176
-          >
177
-            -
33
+      <view className='foodCard'>
34
+        <view className='fCleft'>
35
+          <view className='backMoney'>
36
+            返现¥{item.cashback/100}
178 37
           </view>
179
-          <Input
180
-            className="buy-num-input"
181
-            type="number"
182
-            min="1"
183
-            onInput={onInput}
184
-            value={BuyNumber}
185
-          />
186
-          <view className="buy-num-add" onClick={NumberAdd}>
187
-            +
38
+          <view className='appraise'>
39
+            <Star star={star} />
40
+            <text className='storezf'>{star}</text>
188 41
           </view>
189
-        </view>
190
-        <view className="buy-button-box">
191
-          <button className="button-Cancel" onClick={ButtonCancel}>
192
-            取消
193
-          </button>
194
-          <button className="button-OK" onClick={ButtonOK}>
195
-            确定
196
-          </button>
197
-        </view>
198
-      </Popup>
199
-      <view class="coupon-list">
200
-        {list?.map((item) => {
201
-          return (
202
-            <view class="wrapper">
203
-              <view class="left-complete-one">
204
-                <image className="left-image-1" src={ProCard_hot}></image>
205
-                <view className="left-viewText">
206
-                  返现¥{(item.cashback || 0) / 100}
207
-                </view>
208
-                <view className="title-image">
209
-                  <image
210
-                    className="image-1"
211
-                    mode="scaleToFill"
212
-                    src={item.poster}
213
-                  ></image>
214
-                  <image className="image-2" src={food}></image>
215
-                </view>
216
-                <view className="title-content">
217
-                  <view className="Pro-title">
218
-                    <view className="title-text">{item.description}</view>
219
-                  </view>
220
-                  <text className="title-money">
221
-                    ¥{(item.actualPrice || item.unitPrice || 0) / 100}元
222
-                    <text className="title-money-2">
223
-                      门市价{(item.standardPrice || 0) / 100}元
224
-                    </text>
225
-                  </text>
226
-                  <view className="title-time">
227
-                    有效期:{formatTime(item.startTime, "yyyy/MM/dd")}-
228
-                    {formatTime(item.endTime, "yyyy/MM/dd")}
229
-                  </view>
230
-                </view>
42
+          <view>
43
+            <view className='contentImg'>
44
+              <image src={item.poster} className='img1'></image>
45
+              <image src={msTip} className='mstip'></image>
46
+            </view>
47
+            <view className='neirong'>
48
+              <view className='textword'>{(item.description).toString().length>25?(item.description).substring(0, 25)+'...':(item.description)}</view>
49
+              <view className='jiage'>
50
+                <text className='rmb' >¥&nbsp;&nbsp;</text>
51
+                <text className='p1'><text className='price' >{item.actualPrice/100}</text>元&nbsp;&nbsp;</text>
52
+                <text className='p2'>门市价<text className='oldprice' >{item.standardPrice/100}</text>元</text>
53
+              </view>
54
+              <view className='address'>
55
+                <image className='dw' src={wz} />
56
+                <text className='wz'>{city.areaPName}/{city.areaName}</text>
57
+                <view style={{display:'inline-block'}} onClick={toggleSave}>
58
+                <image className='star' src={isSaved>0?hongxin:baixin}></image>
59
+                <text className='collection'>{isSaved>0?'已收藏':'加入收藏'}</text>
231 60
               </view>
232
-              <view
233
-                class="right-complete-two"
234
-                onClick={() => ShowMoldeOn(item)}
235
-              >
236
-                <view className="right-content">
237
-                  <view className="right-number">×{item.amount || 1}</view>
238
-                  <view className="right-title">数量</view>
239
-                </view>
240 61
               </view>
241 62
             </view>
242
-          );
243
-        })}
244
-      </view>
245
-      <view className="view-button">
246
-        <view className="Card-number-box">
247
-          <view className="Card-number">
248
-            <text style="left:29px;position: absolute; padding-top:20px">
249
-              手机号码:
250
-            </text>
251
-            <text style="right:29px;position: absolute;padding-top:20px">
252
-              {person.phone}
253
-            </text>
254
-          </view>
255
-          <view className="Card-user">
256
-            <Checkbox
257
-              style="padding-left:20px; position: relative; top:24px;"
258
-              value="agreement"
259
-              checked={agreement}
260
-              onClick={() => {
261
-                setAgreement(!agreement);
262
-              }}
263
-            >
264
-              我已阅读知晓并同意
265
-              <text style="color:#274190;text-decoration:underline;font-weight:400">
266
-                《平台用户服务协议》
267
-              </text>
268
-            </Checkbox>
269 63
           </view>
270 64
         </view>
271
-        <view className="button-box-button-box">
272
-          <view className="button-text-image">
273
-            <text className="button-text-money-hot">
274
-              返现¥{(totalPrice?.cashback || 0) / 100}
275
-            </text>
276
-            <image className="button-image" src={ProCard_hot}>
277
-              123123
278
-            </image>
279
-            <view className="button-text-money">
280
-              门店市面价:{(totalPrice?.standardPrice || 0) / 100}元
281
-            </view>
282
-          </view>
283
-          <Button className="button-box-one" onClick={() => onShowPay()}>
284
-            ¥{(totalPrice?.actualPrice || 0) / 100}元
285
-            <text className="button-text-one">支付订单</text>
286
-          </Button>
65
+        <view className='fCright' onClick={()=>{Taro.navigateTo({ url: `/pages/PayOrder/index?packageId=${item.packageId}` });}}>
66
+          <image src={pay} />
67
+          <view>支付</view>
287 68
         </view>
69
+        <view className='columnLine'></view>
288 70
       </view>
289
-    </view>
290
-  );
291
-});
71
+    
72
+  )
73
+}

+ 4
- 4
src/pages/PayOrder/style.less Zobrazit soubor

@@ -23,7 +23,7 @@
23 23
       background: #ffffff;
24 24
       border: 1px solid #999999;
25 25
       position: relative;
26
-      top: 30px;
26
+      top: 26px;
27 27
     }
28 28
     .buy-num-add {
29 29
       display: inline-block;
@@ -226,9 +226,9 @@
226 226
   }
227 227
 
228 228
   .view-button {
229
-    // width: 100%;
230
-    // height: 150px;
231
-    position: relative;
229
+
230
+    position: fixed;
231
+    bottom: 0px;
232 232
 
233 233
     .Card-number-box {
234 234
       .Card-number {

+ 80
- 62
src/pages/details/foodDetails/foodDetails.jsx Zobrazit soubor

@@ -1,7 +1,7 @@
1 1
 import CustomNav from '@/components/CustomNav'
2 2
 import withLayout from '@/layouts'
3
-import {getShopDetail,getShopPackage,getExtendContent} from '@/services/home'
4
-import { useState,useEffect } from 'react'
3
+import { getShopDetail, getShopPackage, getExtendContent } from '@/services/home'
4
+import { useState, useEffect,useRef } from 'react'
5 5
 import { Swiper, SwiperItem } from '@tarojs/components';
6 6
 import Star from '@/components/Star/Star.jsx'
7 7
 import Cards from '@/components/foodCards/foodCards.jsx'
@@ -15,83 +15,101 @@ import share from '../../../assets/icons/housemantj/景点分享.png'
15 15
 import good from '../../../assets/icons/housemantj/景点爆赞.png'
16 16
 import collection from '../../../assets/icons/housemantj/景点收藏.png'
17 17
 import hongxin from '../../../assets/icons/housemantj/已收藏.png'
18
-
19 18
 import './foodDetails.less'
19
+import Taro from '@tarojs/taro'
20 20
 import Extend from '../components/extend'
21 21
 import useSave from "@/utils/hooks/useSave"
22 22
 import useLike from "@/utils/hooks/useLike"
23 23
 
24 24
 export default withLayout((props) => {
25 25
   const { router, person } = props
26
-  const {id}=props.router.params
26
+  const { id } = props.router.params
27 27
   //商铺基础信息
28
-  const [detail,setDetail]=useState({})
28
+  const [detail, setDetail] = useState({})
29 29
   //商铺套餐
30
-  const [spackage,setPackage]=useState([])
30
+  const [spackage, setPackage] = useState([])
31 31
   //banner图集数组
32
-  const [imglist,setimglist]=useState([])
32
+  const [imglist, setimglist] = useState([])
33 33
   const [index, setIndex] = useState(0)
34 34
   const handchange = (e) => {
35 35
     setIndex(e.detail.current)
36 36
   }
37
-  
37
+
38 38
   const [isSaved, toggleSave] = useSave(detail.isSaved, 'shop', id)
39 39
   const [isLike, toggleLike] = useLike(detail.isLike, 'shop', id)
40 40
 
41 41
   //当前套餐总数
42
-  const [newpgNum,setNewpgNum]=useState(0)
42
+  const [newpgNum, setNewpgNum] = useState(0)
43 43
   //全部套餐个数
44
-  const [AllpgNum,setAllpgNum]=useState(0)
44
+  const [AllpgNum, setAllpgNum] = useState(0)
45 45
   //套餐当前页数
46
-  const [page,setpage]=useState(2)
47
-  const pgMore=()=>{
48
-    setpage(page+1)
49
-    getShopPackage(id,{pageNum:page}).then((res)=>{
50
-      setPackage([...spackage,...res.records])
51
-      setNewpgNum(newpgNum+res.records.length)
46
+  const [page, setpage] = useState(2)
47
+  const pgMore = () => {
48
+    setpage(page + 1)
49
+    getShopPackage(id, { pageNum: page }).then((res) => {
50
+      setPackage([...spackage, ...res.records])
51
+      setNewpgNum(newpgNum + res.records.length)
52 52
     })
53 53
   }
54 54
   //本店指南
55
-  const [extend,setExtend]=useState([])
55
+  const [extend, setExtend] = useState([])
56 56
 
57 57
   //当前指南总数
58
-  const [newextNum,setNewextNum]=useState(0)
58
+  const [newextNum, setNewextNum] = useState(0)
59 59
   //全部指南个数
60
-  const [AllextNum,setAllextNum]=useState(0)
60
+  const [AllextNum, setAllextNum] = useState(0)
61 61
   //指南当前页数
62
-  const [epage,setepage]=useState(2)
63
-  const extendMore=()=>{
64
-    setepage(epage+1)
65
-    getExtendContent('shop',id,{pageNum:epage}).then((res)=>{
66
-      setExtend([...extend,...res.records])
67
-      setNewextNum(newextNum+res.records.length)
62
+  const [epage, setepage] = useState(2)
63
+  const extendMore = () => {
64
+    setepage(epage + 1)
65
+    getExtendContent('shop', id, { pageNum: epage }).then((res) => {
66
+      setExtend([...extend, ...res.records])
67
+      setNewextNum(newextNum + res.records.length)
68
+    })
69
+  }
70
+  const toShare = () => {
71
+    console.log(222222222222)
72
+    onShareAppMessage()
73
+  }
74
+  const openMap = () => {
75
+    Taro.openLocation({
76
+      longitude: log.current - 0,
77
+      latitude: lat.current - 0,
78
+      name: detail.shopName,
79
+      address: detail.address,
80
+      scale: 12,
68 81
     })
69 82
   }
70
-  useEffect(()=>{
71
-    getShopDetail(id).then((res)=>{
83
+  const log = useRef('')
84
+  const lat = useRef('')
85
+
86
+  useEffect(() => {
87
+    getShopDetail(id).then((res) => {
72 88
       setDetail(res)
73
-      setimglist(res.imageList||[])
89
+      log.current = (res.locaton).toString().split(',')[0]
90
+      lat.current = (res.locaton).toString().split(',')[1]
91
+      setimglist(res.imageList || [])
74 92
     })
75
-    getShopPackage(id).then((res)=>{
76
-      setPackage(res.records||[])
93
+    getShopPackage(id).then((res) => {
94
+      setPackage(res.records || [])
77 95
       setNewpgNum(res.records.length)
78 96
       setAllpgNum(res.total)
79 97
     })
80
-    getExtendContent('shop',id).then((res)=>{
81
-      setExtend(res.records||[])
98
+    getExtendContent('shop', id).then((res) => {
99
+      setExtend(res.records || [])
82 100
       setAllextNum(res.total)
83 101
       setNewextNum(res.records.length)
84 102
     })
85
-  },[])
86
-  const star=parseFloat(((detail.sweetScore+detail.environmentScore+detail.serviceScore)/3).toFixed(1)); 
87
-return (
103
+  }, [])
104
+  const star = parseFloat(((detail.sweetScore + detail.environmentScore + detail.serviceScore) / 3).toFixed(1));
105
+  return (
88 106
     <view className='page-index'>
89 107
       <view className='index-navbar'>
90 108
         <CustomNav title='十公里' />
91 109
       </view>
92
-      <view style={{overflow: 'auto', padding: '0 30rpx', background: '#F8F8F8' }}>
93
-        <scroll-view scroll-y="true" scroll-view='true' bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll">
94
-          <view className='storeDetails'>           
110
+      <view style={{ overflow: 'auto', padding: '0 30rpx', background: '#F8F8F8' }}>
111
+        <scroll-view scroll-y='true' scroll-view='true' bindscrolltoupper='upper' bindscrolltolower='lower' bindscroll='scroll'>
112
+          <view className='storeDetails'>
95 113
             <Swiper
96 114
               className='.swiper'
97 115
               circular
@@ -103,27 +121,27 @@ return (
103 121
                   <SwiperItem>
104 122
                     <image src={item.url} className='storeImage' >
105 123
                       <view className='tpPage'>
106
-                      <text>{index + 1}/{imglist.length}</text>
124
+                        <text>{index + 1}/{imglist.length}</text>
107 125
                       </view>
108 126
                     </image>
109 127
                   </SwiperItem>
110 128
                 )
111 129
               }
112
-            </Swiper>                        
130
+            </Swiper>
113 131
             <view className='storeJs'>
114 132
               <view style={{ overflow: 'hidden' }}>
115
-                  <view className='storeName'>{detail.shopName}</view>
116
-                  <view className='sprice'>
117
-                    <text className='t1'>¥</text>
118
-                    {detail.averagePrice/100}/人                
119
-                    <view className='bzRight'>
120
-                      <image src={ax} style={{ width: '15px', height: '15px', marginRight: '11rpx', marginBottom: '-2px' }} />
133
+                <view className='storeName'>{detail.shopName}</view>
134
+                <view className='sprice'>
135
+                  <text className='t1'>¥</text>
136
+                  {detail.averagePrice / 100}/人
137
+                  <view className='bzRight'>
138
+                    <image src={ax} style={{ width: '15px', height: '15px', marginRight: '11rpx', marginBottom: '-2px' }} />
121 139
                     爆赞{detail.likeNum}</view>
122
-                  </view>
140
+                </view>
123 141
               </view>
124 142
               <view className='appraise'>
125
-                <Star star={star}/>{star}
126
-                <view style={{float:'right',marginTop:'5px'}}>
143
+                <Star star={star} />{star}
144
+                <view style={{ float: 'right', marginTop: '5px' }}>
127 145
                   <text className='comment'>点评:</text>
128 146
                   <text className='t1'>口味:{detail.sweetScore}</text>
129 147
                   <text className='t1'>环境:{detail.environmentScore}</text>
@@ -133,40 +151,40 @@ return (
133 151
               <view className='yysj'>
134 152
                 <image src={yysj} className='yysjImg' />营业时间:{detail.businessHours}
135 153
               </view>
136
-              <view className='dpPosition'> 
154
+              <view className='dpPosition' onClick={openMap}>
137 155
                 <image src={dw} className='dwTip' />
138 156
                 <view>
139
-                  {detail.address}<image src={zhuandao} className='zhuandao'/>
157
+                  {detail.address}<image src={zhuandao} className='zhuandao' />
140 158
                 </view>
141 159
               </view>
142 160
             </view>
143 161
           </view>
144
-          <view style={{ position: 'relative',display:spackage==''?'none':''}}>
162
+          <view style={{ position: 'relative', display: spackage == '' ? 'none' : '' }}>
145 163
             <view className='title'>
146
-              <image src={titlezs}/><text>返现套餐</text>
147
-            </view>            
148
-            {spackage?.map((item)=><Cards star={star} item={item}/>)}            
149
-            <view className='showMore' style={{display:newpgNum==AllpgNum?'none':''}} onClick={pgMore}>
164
+              <image src={titlezs} /><text>返现套餐</text>
165
+            </view>
166
+            {spackage?.map((item) => <Cards star={star} item={item} />)}
167
+            <view className='showMore' style={{ display: newpgNum == AllpgNum ? 'none' : '' }} onClick={pgMore}>
150 168
               <view>查看更多</view>
151 169
               <image src={showMore} className='moreTip' />
152 170
             </view>
153 171
           </view>
154
-          <view style={{ position: 'relative',display:extend==''?'none':'' }}>
172
+          <view style={{ position: 'relative', display: extend == '' ? 'none' : '' }}>
155 173
             <view className='title'>
156
-              <image src={titlezs}/>
174
+              <image src={titlezs} />
157 175
               <text>本店指南</text>
158 176
             </view>
159
-            {extend?.map((item)=><Extend item={item} />)}
160
-            <view className='showMore' style={{display:newextNum==AllextNum?'none':''}} onClick={extendMore}>
177
+            {extend?.map((item) => <Extend item={item} />)}
178
+            <view className='showMore' style={{ display: newextNum == AllextNum ? 'none' : '' }} onClick={extendMore}>
161 179
               <view>查看更多</view>
162 180
               <image src={showMore} className='moreTip' />
163 181
             </view>
164 182
           </view>
165
-           <view className='botton' style={{display:newextNum==AllextNum?'':'none'}}>已经到底了~</view>
183
+          <view className='botton' style={{ display: newextNum == AllextNum ? '' : 'none' }}>已经到底了~</view>
166 184
         </scroll-view>
167 185
       </view>
168 186
       <view className='bottomTab'>
169
-        <view className='tab'>
187
+        <view className='tab' onClick={toShare}>
170 188
           <image className='share' src={share} />分享
171 189
         </view>
172 190
         <view className='tab' onClick={toggleLike}>

+ 21
- 6
src/pages/details/mjDetails/sceneryDetails.jsx Zobrazit soubor

@@ -9,15 +9,16 @@ import showMore from '../../../assets/icons/housemantj/查看更多.png'
9 9
 import share from '../../../assets/icons/housemantj/景点分享.png'
10 10
 import good from '../../../assets/icons/housemantj/景点爆赞.png'
11 11
 import collection from '../../../assets/icons/housemantj/景点收藏.png'
12
-import './sceneryDetails.less'
13 12
 import withLayout from '@/layouts'
14
-import { useState, useEffect } from 'react'
13
+import { useState, useEffect, useRef } from 'react'
15 14
 import { getTouristDetail, getExtendContent, getRecommendList } from '@/services/home'
16 15
 import { Swiper, SwiperItem } from '@tarojs/components';
17 16
 import useSave from "@/utils/hooks/useSave"
18 17
 import useLike from "@/utils/hooks/useLike"
19 18
 import Extend from '../components/extend'
20 19
 import Cards from '@/components/foodCards/foodCards.jsx'
20
+import Taro from '@tarojs/taro'
21
+import './sceneryDetails.less'
21 22
 
22 23
 
23 24
 
@@ -54,8 +55,23 @@ export default withLayout((props) => {
54 55
   // 推荐套餐列表
55 56
   const [recommend, setRecommend] = useState([])
56 57
 
58
+  const openMap = () => {
59
+    Taro.openLocation({
60
+      longitude: log.current - 0,
61
+      latitude: lat.current - 0,
62
+      name: detail.touristName,
63
+      address: detail.address,
64
+      scale: 12,
65
+    })
66
+  }
67
+  const log = useRef('')
68
+  const lat = useRef('')
69
+
70
+
57 71
   useEffect(() => {
58 72
     getTouristDetail(id).then((res) => {
73
+      log.current = (res.locaton).toString().split(',')[0]
74
+      lat.current = (res.locaton).toString().split(',')[1]
59 75
       setDetail(res)
60 76
       setimglist(res.imageList || [])
61 77
 
@@ -69,7 +85,6 @@ export default withLayout((props) => {
69 85
       setRecommend(res || [])
70 86
     })
71 87
   }, [])
72
-  console.log(extend=='')
73 88
   return (
74 89
     <view className='page-index'>
75 90
       <view className='index-navbar'>
@@ -106,7 +121,7 @@ export default withLayout((props) => {
106 121
                 <text className='bzRight'>爆赞{detail.likeNum}</text>
107 122
               </view>
108 123
               <view className='wz'>{detail.address}</view>
109
-              <view className='dpPosition'>
124
+              <view className='dpPosition' onClick={openMap}>
110 125
                 <image src={dw} className='dwTip' />
111 126
                 <view className='distance'>{distance}公里</view>
112 127
               </view>
@@ -119,7 +134,7 @@ export default withLayout((props) => {
119 134
               <image className='scTip' src={isSaved > 0 ? hongxin : baixin} /><text>{isSaved > 0 ? '已收藏' : '加入收藏'}</text>
120 135
             </view>
121 136
           </view>
122
-          <view style={{ position: 'relative',display:extend==''?'none':''}}>
137
+          <view style={{ position: 'relative', display: extend == '' ? 'none' : '' }}>
123 138
             <view className='title'>
124 139
               <image src={titlejd} />景点介绍
125 140
             </view>
@@ -129,7 +144,7 @@ export default withLayout((props) => {
129 144
               <image src={showMore} className='moreTip' />
130 145
             </view>
131 146
           </view>
132
-          <view style={{ position: 'relative', display: recommend=='' ? 'none' : '' }}>
147
+          <view style={{ position: 'relative', display: recommend == '' ? 'none' : '' }}>
133 148
             <view className='title'>
134 149
               <image src={titlems} />老板推荐好吃的
135 150
             </view>

+ 22
- 7
src/pages/index/tabs/Mine.jsx Zobrazit soubor

@@ -1,5 +1,5 @@
1 1
 
2
-import { useState } from 'react'
2
+import { useState, useEffect } from 'react'
3 3
 import Taro from '@tarojs/taro'
4 4
 import { Slot } from '@tarojs/components'
5 5
 import AuthPage from '@/components/AuthPage'
@@ -16,8 +16,12 @@ import Rules from '@/assets/icons/UserCenter/Rules.png'
16 16
 import DefaultImage from '@/assets/icons/UserCenter/DefaultImage.png'
17 17
 import cutoverUser from '@/assets/icons/UserCenter/cutoverUser.png'
18 18
 import SwitchSelect from '@/components/SwitchSelect'
19
+import { PaysOrder, getMineOrder } from '@/services/payOrder' //创建订单
20
+
19 21
 import { useModel } from '@/store'
20 22
 import './MineCss/style.less'
23
+import  ToggleRoul  from  '@/components/toggleRoul/ToggleRoul'
24
+
21 25
 
22 26
 
23 27
 
@@ -28,12 +32,23 @@ export default (props) => {
28 32
   const { getAvatar } = useModel('person')
29 33
   const [showCutover, setShowCutover] = useState(false)
30 34
   const hasAvatar = !!person.avatar
31
-  // const hidePhone = person.phone.replace(/^(\d{3})\d{4}(\d+)/, "$1****$2")
32
-  // console.log("🚀 ~ file: Mine.jsx ~ line 31 ~ hidePhone", hidePhone)
35
+  const [orderNum, setOrderNum] = useState([])
36
+  console.log("🚀 ~ file: Mine.jsx ~ line 34 ~ orderNum", orderNum)
37
+
33 38
 
34 39
   const ShowMoldeOn = () => {
35 40
     setShowCutover(true)
36 41
   }
42
+  const onClose = () => {
43
+    setShowCutover(false)
44
+  }
45
+
46
+  useEffect(() => {
47
+    getMineOrder().then(res => setOrderNum(res))
48
+
49
+  }, [])
50
+
51
+
37 52
 
38 53
   // 通过getUserProfile获取微信用户信息
39 54
   const handleGetUserProfile = () => {
@@ -103,7 +118,7 @@ export default (props) => {
103 118
 
104 119
       <view className='User-box'>
105 120
         {/* 身份切换 */}
106
-        <SwitchSelect show={showCutover} maskClosable />
121
+        <ToggleRoul showCutover={showCutover} onClose={onClose} />
107 122
         <view className='User-info'>
108 123
           <view className='User-photos-box'>
109 124
             <image src={person.avatar || { DefaultImage }} className='User-photos' />
@@ -123,12 +138,12 @@ export default (props) => {
123 138
             <view className='buy-list-Paybox' onClick={handleTobePaid} >
124 139
               <image className='buy-list-PayLogo' src={awaitPay} />
125 140
               <view className='buy-list-goPay'>待支付</view>
126
-              <view className='buy-list-OrderNumber'>2笔订单</view>
141
+              <view className='buy-list-OrderNumber'>{orderNum?.unPayNum}笔订单</view>
127 142
             </view>
128 143
             <view className='buy-list-Paybox ' onClick={handleTobeWritten} >
129 144
               <image className='buy-list-PayLogo' src={ToShop} />
130 145
               <view className='buy-list-goPay'>待核销</view>
131
-              <view className='buy-list-OrderNumber'>1个订单</view>
146
+              <view className='buy-list-OrderNumber'>{orderNum?.unVerifiedNum}个订单</view>
132 147
             </view>
133 148
             <view className='buy-list-Paybox ' onClick={handleAllOrder} >
134 149
               <image className='buy-list-PayLogo' src={AllOrder} />
@@ -138,7 +153,7 @@ export default (props) => {
138 153
             <view className='buy-list-Paybox ' onClick={handleRefund} >
139 154
               <image className='buy-list-PayLogo' src={Refund} />
140 155
               <view className='buy-list-goPay'>退款/售后</view>
141
-              <view className='buy-list-OrderNumber'>2笔订单</view>
156
+              <view className='buy-list-OrderNumber'>{orderNum?.refundNum}笔订单</view>
142 157
             </view>
143 158
           </view>
144 159
           <view className='Badge-box'>

+ 11
- 3
src/pages/index/tabs/Recommend.jsx Zobrazit soubor

@@ -35,7 +35,7 @@ export default (props) => {
35 35
       typeId: tab
36 36
     })
37 37
     if (index == 0) {
38
-      setQueryParams({ location: location1, pageNum: 1, pageSize: 10, typeId: '' })
38
+      setQueryParams({ location:  locRef.current, pageNum: 1, pageSize: 10, typeId: '' })
39 39
     }
40 40
   }
41 41
 
@@ -60,7 +60,6 @@ export default (props) => {
60 60
       // 更新 typeId
61 61
       // 更新 分页
62 62
     }
63
-
64 63
     setActiveTab(tabJump - 0)
65 64
   }, [tabJump])
66 65
 
@@ -77,6 +76,13 @@ export default (props) => {
77 76
     // 用绝对路径
78 77
     Taro.navigateTo({ url: '/pages/search/search' });
79 78
   }
79
+
80
+
81
+  const RefreshCard=()=>{
82
+    console.log(1111)
83
+  }
84
+
85
+  
80 86
   return (
81 87
     <view style={{ height: '100%', overflow: 'auto' }}>
82 88
       <view className='search' onClick={onSearch}>
@@ -104,7 +110,9 @@ export default (props) => {
104 110
           </mp-tabs>
105 111
         </scroll-view>
106 112
       </view>
107
-      <scroll-view scroll-y='true' scroll-view='true' bindscrolltoupper='upper' bindscrolltolower='lower' bindscroll='scroll'>
113
+      <scroll-view scroll-y='true' scroll-view='true'  	bindscrolltolower='lower' bindscrolltoupper='upper'	 bindscroll='scroll'
114
+      
115
+      >
108 116
         <view className='waterfall'>
109 117
           {
110 118
             alllist.map((item) => <Card key={item.resourceNo} item={item} />)

+ 24
- 2
src/services/landlord.js Zobrazit soubor

@@ -11,11 +11,33 @@ import request from '@/utils/request'
11 11
 
12 12
  
13 13
 /**
14
- * 查询房源列表 
14
+ * 查询指定名宿的账户
15 15
  * @param {*} params 
16 16
  * @returns 
17 17
  */
18
- export const getRoomList = (params) => request('/taRoom', { params })
18
+ export const getNowHotelManage = (id,params) => request(`/hotel/manage/${id}`, { params })
19
+
20
+
21
+/**
22
+ * 查询民宿老板的所有名宿列表
23
+ * @param {*} params 
24
+ * @returns 
25
+ */
26
+ export const getHotelManage = (params) => request('/hotel/manage/index', { params })
27
+
28
+/**
29
+ * 查询指定名宿的账户流水
30
+ * @param {*} params 
31
+ * @returns 
32
+ */
33
+ export const getAccountLogList = (id) => request(`/hotel/account/${id}/log`)
34
+
35
+/**
36
+ * 房源列表
37
+ * @param {*} id 
38
+ * @returns 
39
+ */
40
+ export const getRoomList = (params) => request('/taRoom',{params})
19 41
 
20 42
  /**
21 43
  * 删除房源

+ 7
- 0
src/services/person.js Zobrazit soubor

@@ -20,3 +20,10 @@ export const authPhone = (data) => request('/auth-phone', { data, method: 'put'
20 20
  * @returns 
21 21
  */
22 22
 export const authAvatar = (data) => request('/auth-user', { data, method: 'put' })
23
+
24
+ /**
25
+ * 切换角色
26
+ * @param {*} data 
27
+ * @returns 
28
+ */
29
+  export const toggleRoul = (targetType) => request(`/person-role/${targetType}`,{ method: 'post'})

+ 8
- 2
src/store/models/person.js Zobrazit soubor

@@ -1,6 +1,6 @@
1 1
 import { useState } from "react"
2 2
 import Taro from '@tarojs/taro'
3
-import { signIn, authPhone, authAvatar } from '@/services/person'
3
+import { signIn, authPhone, authAvatar,toggleRoul } from '@/services/person'
4 4
 
5 5
 export default () => {
6 6
   const [person, setPerson] = useState()
@@ -36,13 +36,19 @@ export default () => {
36 36
     })
37 37
   }
38 38
 
39
+  const getRoul = (data) => {
40
+    return toggleRoul(data).then((res) => {
41
+      setPerson(res);
42
+    })
43
+  }
44
+
39 45
   return {
40 46
     person,
41 47
     peronRoles,
42 48
     setPerson,
43 49
     login,
44 50
     getPhone,
45
-
46 51
     getAvatar,
52
+    getRoul
47 53
   }
48 54
 }