瀏覽代碼

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

zlisen 3 年之前
父節點
當前提交
7eb27010a9
共有 31 個檔案被更改,包括 1010 行新增639 行删除
  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 查看文件

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

+ 1
- 0
package.json 查看文件

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

+ 2
- 2
src/components/CompoentsOrder/AlreadyExpired/index.jsx 查看文件

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

+ 5
- 5
src/components/CompoentsOrder/AlreadyUsed/index.jsx 查看文件

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

+ 21
- 16
src/components/Landlord/HouseManage/houseManage.jsx 查看文件

1
 import Taro from '@tarojs/taro'
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
 import './houseManage.less'
7
 import './houseManage.less'
8
+import { useState, useEffect,useRef } from 'react'
9
+import {getRoomList} from '@/services/landlord'
10
 
10
 
11
 
11
 
12
 export default (props) => {
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
   return (
20
   return (
14
     <view>
21
     <view>
15
-      <view>
16
-        <CustomNav logo={null} title='十公里周边指南' />
17
-      </view>
18
       <view style={{ padding: '0 30rpx', height: '100%' }}>
22
       <view style={{ padding: '0 30rpx', height: '100%' }}>
19
         <scroll-view scroll-y="true" scroll-view='true' bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll" style={{ height: 'calc(100vh - 204px)' }}>
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
           <view className='search'>
24
           <view className='search'>
25
             <input className='searchInput' disabled />
25
             <input className='searchInput' disabled />
26
             <image className='searchicon' src={iconsearch} />
26
             <image className='searchicon' src={iconsearch} />
27
             <view className="searchword">请输入关键字搜索</view>
27
             <view className="searchword">请输入关键字搜索</view>
28
           </view>
28
           </view>
29
           <view>
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
               <view className='operation'>
34
               <view className='operation'>
33
                 <view><image src={see} /><text>查看入住人</text></view>
35
                 <view><image src={see} /><text>查看入住人</text></view>
34
                 <view><image src={share} /><text>分享链接</text></view>
36
                 <view><image src={share} /><text>分享链接</text></view>
35
                 <view><image src={del} /><text>删除房源</text></view>
37
                 <view><image src={del} /><text>删除房源</text></view>
36
               </view>
38
               </view>
37
             </view>
39
             </view>
40
+              )
41
+            }
42
+            
38
            
43
            
39
           </view>
44
           </view>
40
         </scroll-view>        
45
         </scroll-view>        

+ 1
- 13
src/components/Landlord/HouseManage/houseManage.less 查看文件

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
 .search{
2
 .search{
15
   padding: 40px 0  30px 0;
3
   padding: 40px 0  30px 0;
16
   position: relative;
4
   position: relative;

+ 52
- 111
src/components/Landlord/Income/income.jsx 查看文件

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
 import './income.less'
2
 import './income.less'
6
 import eyes from '../../../assets/icons/shopKeeper/小眼睛.png'
3
 import eyes from '../../../assets/icons/shopKeeper/小眼睛.png'
7
 import ceyes from '../../../assets/icons/shopKeeper/小眼睛-闭上.png'
4
 import ceyes from '../../../assets/icons/shopKeeper/小眼睛-闭上.png'
8
 import sImg from '../../../assets/icons/landlord/我的收入2.png'
5
 import sImg from '../../../assets/icons/landlord/我的收入2.png'
9
 import cutoverUser from '@/assets/icons/UserCenter/cutoverUser.png'
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
 export default (props) => {
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
   const [showCutover, setShowCutover] = useState(false)
25
   const [showCutover, setShowCutover] = useState(false)
20
   const ShowMoldeOn = () => {
26
   const ShowMoldeOn = () => {
21
     setShowCutover(true)
27
     setShowCutover(true)
22
   }
28
   }
23
-  const ok = () => {
29
+  const onClose = () => {
24
     setShowCutover(false)
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
   return (
32
   return (
33
     <view>
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
       <view style={{ padding: '30rpx', height: '100%' }}>
35
       <view style={{ padding: '30rpx', height: '100%' }}>
56
         <scroll-view scroll-y="true" scroll-view='true' bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll" style={{ height: 'calc(100vh - 120px)' }}>
36
         <scroll-view scroll-y="true" scroll-view='true' bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll" style={{ height: 'calc(100vh - 120px)' }}>
57
           <view className='storexx'>
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
             </view>
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
               </view>
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
             </view>
57
             </view>
129
           </view>
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
       </view>
74
       </view>
75
+    </view>
135
   )
76
   )
136
 }
77
 }

+ 15
- 22
src/components/Landlord/Income/income.less 查看文件

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

+ 9
- 6
src/components/OrderMolded/index.jsx 查看文件

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

+ 121
- 0
src/components/PayOrderCard/index.jsx 查看文件

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 查看文件

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 查看文件

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 查看文件


+ 2
- 2
src/components/Popup/index.jsx 查看文件

2
 import './style.less'
2
 import './style.less'
3
 
3
 
4
 export default (props) => {
4
 export default (props) => {
5
-  const { show, mask = true, maskClosable, onClose } = props
5
+  const { show, mask = true,  onClose } = props
6
 
6
 
7
   return (
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
       {props.children}
9
       {props.children}
10
     </mp-dialog>
10
     </mp-dialog>
11
   )
11
   )

+ 4
- 28
src/components/spreads/ShopKeeper/shopKeeper.jsx 查看文件

14
 import shopBossON from '@/assets/icons/UserCenter/shopBossON.png'
14
 import shopBossON from '@/assets/icons/UserCenter/shopBossON.png'
15
 import shopBossOFF from '@/assets/icons/UserCenter/shopBossOFF.png'
15
 import shopBossOFF from '@/assets/icons/UserCenter/shopBossOFF.png'
16
 import './shopKeeper.less'
16
 import './shopKeeper.less'
17
+import  ToggleRoul  from  '@/components/toggleRoul/ToggleRoul'
17
 
18
 
18
 
19
 
19
 export default (props) => {
20
 export default (props) => {
44
   const ShowMoldeOn = () => {
45
   const ShowMoldeOn = () => {
45
     setShowCutover(true)
46
     setShowCutover(true)
46
   }
47
   }
47
-  const ok = () => {
48
+  const onClose = () => {
48
     setShowCutover(false)
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
   return (
51
   return (
57
     <view>
52
     <view>
58
       <view>
53
       <view>
59
         <CustomNav title='十公里' />
54
         <CustomNav title='十公里' />
60
       </view>
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
       <view style={{ padding: '30rpx', height: '100%' }}>
58
       <view style={{ padding: '30rpx', height: '100%' }}>
83
         <scroll-view scroll-y="true" scroll-view='true' bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll" style={{ height: 'calc(100vh - 120px)' }}>
59
         <scroll-view scroll-y="true" scroll-view='true' bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll" style={{ height: 'calc(100vh - 120px)' }}>
84
           <view className='storexx'>
60
           <view className='storexx'>

+ 30
- 54
src/components/spreads/Sparead/spreadMoney.jsx 查看文件

1
-import { useState} from 'react'
1
+import { useState } from 'react'
2
 import Taro from '@tarojs/taro'
2
 import Taro from '@tarojs/taro'
3
 import CustomNav from '@/components/CustomNav'
3
 import CustomNav from '@/components/CustomNav'
4
 import Popup from '@/components/Popup'
4
 import Popup from '@/components/Popup'
9
 import hotelBossOFF from '@/assets/icons/UserCenter/hotelBossOFF.png'
9
 import hotelBossOFF from '@/assets/icons/UserCenter/hotelBossOFF.png'
10
 import shopBossON from '@/assets/icons/UserCenter/shopBossON.png'
10
 import shopBossON from '@/assets/icons/UserCenter/shopBossON.png'
11
 import './spreadMoney.less'
11
 import './spreadMoney.less'
12
+import  ToggleRoul  from  '@/components/toggleRoul/ToggleRoul'
12
 
13
 
13
 export default (props) => {
14
 export default (props) => {
15
+
14
   const [showCutover, setShowCutover] = useState(false)
16
   const [showCutover, setShowCutover] = useState(false)
15
   const ShowMoldeOn = () => {
17
   const ShowMoldeOn = () => {
16
     setShowCutover(true)
18
     setShowCutover(true)
17
   }
19
   }
18
-  const ok = () => {
20
+  const onClose = () => {
19
     setShowCutover(false)
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
   return (
24
   return (
29
     <view>
25
     <view>
30
       <view>
26
       <view>
31
         <CustomNav title='十公里' />
27
         <CustomNav title='十公里' />
32
       </view>
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
       <view style={{ padding: '30rpx', height: '100%' }}>
30
       <view style={{ padding: '30rpx', height: '100%' }}>
55
         <scroll-view scroll-y="true" scroll-view='true' bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll" style={{ height: 'calc(100vh - 120px)' }}>
31
         <scroll-view scroll-y="true" scroll-view='true' bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll" style={{ height: 'calc(100vh - 120px)' }}>
56
           <view className='storexx'>
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
                 </view>
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
               </view>
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
             </view>
53
             </view>
54
+          </view>
79
           <view className='title'>推广收入记录</view>
55
           <view className='title'>推广收入记录</view>
80
           <view>
56
           <view>
81
             <view className='spreadCard'>
57
             <view className='spreadCard'>
82
               <view className='spreadDate'>日期:<text>2021-06-24</text></view>
58
               <view className='spreadDate'>日期:<text>2021-06-24</text></view>
83
               <view className='card'>
59
               <view className='card'>
84
                 <view className='spreadTime'>时&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;间:<text>2021-06-24  20:45</text></view>
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
               </view>
62
               </view>
87
             </view>
63
             </view>
88
             <view className='spreadCard'>
64
             <view className='spreadCard'>
89
               <view className='spreadDate'>日期:<text>2021-06-24</text></view>
65
               <view className='spreadDate'>日期:<text>2021-06-24</text></view>
90
               <view className='card'>
66
               <view className='card'>
91
                 <view className='spreadTime'>时&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;间:<text>2021-06-24  20:45</text></view>
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
               </view>
69
               </view>
94
             </view>
70
             </view>
95
           </view>
71
           </view>
96
           <view className='botton'>已经到底了~</view>
72
           <view className='botton'>已经到底了~</view>
97
-        </scroll-view>        
98
-      </view>
99
-      
73
+        </scroll-view>
100
       </view>
74
       </view>
75
+
76
+    </view>
101
   )
77
   )
102
 }
78
 }

+ 47
- 0
src/components/toggleRoul/ToggleRoul.jsx 查看文件

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 查看文件

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 查看文件

7
 import onincomeImg from '@/assets/icons/landlord/我的收入按下.png'
7
 import onincomeImg from '@/assets/icons/landlord/我的收入按下.png'
8
 import houseImg from '@/assets/icons/landlord/房源管理.png'
8
 import houseImg from '@/assets/icons/landlord/房源管理.png'
9
 import onhouseImg from '@/assets/icons/landlord/房源管理按下.png'
9
 import onhouseImg from '@/assets/icons/landlord/房源管理按下.png'
10
-import './landlord.less'
11
 import withLayout from '@/layouts'
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
 export default withLayout((props) => {
16
 export default withLayout((props) => {
15
   const { router, person } = props
17
   const { router, person } = props
16
   const { params } = useRouter()
18
   const { params } = useRouter()
17
   const { tab } = params || {}
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
   const [currentTab, setCurrentTab] = useState(0)
49
   const [currentTab, setCurrentTab] = useState(0)
20
 
50
 
21
   const handleTabChange = (e) => {
51
   const handleTabChange = (e) => {
31
 
61
 
32
   return (
62
   return (
33
     <view className='page-index'>
63
     <view className='page-index'>
64
+      <CustomNav title={hotel?.hotelName} logo={hotel?.logo} />
34
       <view className='index-container'>
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
       </view>
68
       </view>
38
       <view className='index-tabbar'>
69
       <view className='index-tabbar'>
39
         <TabBar extClass='custom-tabbar bottomTab' current={currentTab} onChange={handleTabChange}>
70
         <TabBar extClass='custom-tabbar bottomTab' current={currentTab} onChange={handleTabChange}>

+ 2
- 2
src/layouts/index.jsx 查看文件

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

+ 2
- 2
src/pages/MineUserAll/Collect/index.jsx 查看文件

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

+ 2
- 2
src/pages/MineUserAll/RefundMoney/index.jsx 查看文件

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

+ 60
- 278
src/pages/PayOrder/index.jsx 查看文件

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
   useEffect(() => {
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
   return (
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
           </view>
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
           </view>
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
               </view>
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
               </view>
61
               </view>
241
             </view>
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
           </view>
63
           </view>
270
         </view>
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
         </view>
68
         </view>
69
+        <view className='columnLine'></view>
288
       </view>
70
       </view>
289
-    </view>
290
-  );
291
-});
71
+    
72
+  )
73
+}

+ 4
- 4
src/pages/PayOrder/style.less 查看文件

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

+ 80
- 62
src/pages/details/foodDetails/foodDetails.jsx 查看文件

1
 import CustomNav from '@/components/CustomNav'
1
 import CustomNav from '@/components/CustomNav'
2
 import withLayout from '@/layouts'
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
 import { Swiper, SwiperItem } from '@tarojs/components';
5
 import { Swiper, SwiperItem } from '@tarojs/components';
6
 import Star from '@/components/Star/Star.jsx'
6
 import Star from '@/components/Star/Star.jsx'
7
 import Cards from '@/components/foodCards/foodCards.jsx'
7
 import Cards from '@/components/foodCards/foodCards.jsx'
15
 import good from '../../../assets/icons/housemantj/景点爆赞.png'
15
 import good from '../../../assets/icons/housemantj/景点爆赞.png'
16
 import collection from '../../../assets/icons/housemantj/景点收藏.png'
16
 import collection from '../../../assets/icons/housemantj/景点收藏.png'
17
 import hongxin from '../../../assets/icons/housemantj/已收藏.png'
17
 import hongxin from '../../../assets/icons/housemantj/已收藏.png'
18
-
19
 import './foodDetails.less'
18
 import './foodDetails.less'
19
+import Taro from '@tarojs/taro'
20
 import Extend from '../components/extend'
20
 import Extend from '../components/extend'
21
 import useSave from "@/utils/hooks/useSave"
21
 import useSave from "@/utils/hooks/useSave"
22
 import useLike from "@/utils/hooks/useLike"
22
 import useLike from "@/utils/hooks/useLike"
23
 
23
 
24
 export default withLayout((props) => {
24
 export default withLayout((props) => {
25
   const { router, person } = props
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
   //banner图集数组
31
   //banner图集数组
32
-  const [imglist,setimglist]=useState([])
32
+  const [imglist, setimglist] = useState([])
33
   const [index, setIndex] = useState(0)
33
   const [index, setIndex] = useState(0)
34
   const handchange = (e) => {
34
   const handchange = (e) => {
35
     setIndex(e.detail.current)
35
     setIndex(e.detail.current)
36
   }
36
   }
37
-  
37
+
38
   const [isSaved, toggleSave] = useSave(detail.isSaved, 'shop', id)
38
   const [isSaved, toggleSave] = useSave(detail.isSaved, 'shop', id)
39
   const [isLike, toggleLike] = useLike(detail.isLike, 'shop', id)
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
       setDetail(res)
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
       setNewpgNum(res.records.length)
95
       setNewpgNum(res.records.length)
78
       setAllpgNum(res.total)
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
       setAllextNum(res.total)
100
       setAllextNum(res.total)
83
       setNewextNum(res.records.length)
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
     <view className='page-index'>
106
     <view className='page-index'>
89
       <view className='index-navbar'>
107
       <view className='index-navbar'>
90
         <CustomNav title='十公里' />
108
         <CustomNav title='十公里' />
91
       </view>
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
             <Swiper
113
             <Swiper
96
               className='.swiper'
114
               className='.swiper'
97
               circular
115
               circular
103
                   <SwiperItem>
121
                   <SwiperItem>
104
                     <image src={item.url} className='storeImage' >
122
                     <image src={item.url} className='storeImage' >
105
                       <view className='tpPage'>
123
                       <view className='tpPage'>
106
-                      <text>{index + 1}/{imglist.length}</text>
124
+                        <text>{index + 1}/{imglist.length}</text>
107
                       </view>
125
                       </view>
108
                     </image>
126
                     </image>
109
                   </SwiperItem>
127
                   </SwiperItem>
110
                 )
128
                 )
111
               }
129
               }
112
-            </Swiper>                        
130
+            </Swiper>
113
             <view className='storeJs'>
131
             <view className='storeJs'>
114
               <view style={{ overflow: 'hidden' }}>
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
                     爆赞{detail.likeNum}</view>
139
                     爆赞{detail.likeNum}</view>
122
-                  </view>
140
+                </view>
123
               </view>
141
               </view>
124
               <view className='appraise'>
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
                   <text className='comment'>点评:</text>
145
                   <text className='comment'>点评:</text>
128
                   <text className='t1'>口味:{detail.sweetScore}</text>
146
                   <text className='t1'>口味:{detail.sweetScore}</text>
129
                   <text className='t1'>环境:{detail.environmentScore}</text>
147
                   <text className='t1'>环境:{detail.environmentScore}</text>
133
               <view className='yysj'>
151
               <view className='yysj'>
134
                 <image src={yysj} className='yysjImg' />营业时间:{detail.businessHours}
152
                 <image src={yysj} className='yysjImg' />营业时间:{detail.businessHours}
135
               </view>
153
               </view>
136
-              <view className='dpPosition'> 
154
+              <view className='dpPosition' onClick={openMap}>
137
                 <image src={dw} className='dwTip' />
155
                 <image src={dw} className='dwTip' />
138
                 <view>
156
                 <view>
139
-                  {detail.address}<image src={zhuandao} className='zhuandao'/>
157
+                  {detail.address}<image src={zhuandao} className='zhuandao' />
140
                 </view>
158
                 </view>
141
               </view>
159
               </view>
142
             </view>
160
             </view>
143
           </view>
161
           </view>
144
-          <view style={{ position: 'relative',display:spackage==''?'none':''}}>
162
+          <view style={{ position: 'relative', display: spackage == '' ? 'none' : '' }}>
145
             <view className='title'>
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
               <view>查看更多</view>
168
               <view>查看更多</view>
151
               <image src={showMore} className='moreTip' />
169
               <image src={showMore} className='moreTip' />
152
             </view>
170
             </view>
153
           </view>
171
           </view>
154
-          <view style={{ position: 'relative',display:extend==''?'none':'' }}>
172
+          <view style={{ position: 'relative', display: extend == '' ? 'none' : '' }}>
155
             <view className='title'>
173
             <view className='title'>
156
-              <image src={titlezs}/>
174
+              <image src={titlezs} />
157
               <text>本店指南</text>
175
               <text>本店指南</text>
158
             </view>
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
               <view>查看更多</view>
179
               <view>查看更多</view>
162
               <image src={showMore} className='moreTip' />
180
               <image src={showMore} className='moreTip' />
163
             </view>
181
             </view>
164
           </view>
182
           </view>
165
-           <view className='botton' style={{display:newextNum==AllextNum?'':'none'}}>已经到底了~</view>
183
+          <view className='botton' style={{ display: newextNum == AllextNum ? '' : 'none' }}>已经到底了~</view>
166
         </scroll-view>
184
         </scroll-view>
167
       </view>
185
       </view>
168
       <view className='bottomTab'>
186
       <view className='bottomTab'>
169
-        <view className='tab'>
187
+        <view className='tab' onClick={toShare}>
170
           <image className='share' src={share} />分享
188
           <image className='share' src={share} />分享
171
         </view>
189
         </view>
172
         <view className='tab' onClick={toggleLike}>
190
         <view className='tab' onClick={toggleLike}>

+ 21
- 6
src/pages/details/mjDetails/sceneryDetails.jsx 查看文件

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

+ 22
- 7
src/pages/index/tabs/Mine.jsx 查看文件

1
 
1
 
2
-import { useState } from 'react'
2
+import { useState, useEffect } from 'react'
3
 import Taro from '@tarojs/taro'
3
 import Taro from '@tarojs/taro'
4
 import { Slot } from '@tarojs/components'
4
 import { Slot } from '@tarojs/components'
5
 import AuthPage from '@/components/AuthPage'
5
 import AuthPage from '@/components/AuthPage'
16
 import DefaultImage from '@/assets/icons/UserCenter/DefaultImage.png'
16
 import DefaultImage from '@/assets/icons/UserCenter/DefaultImage.png'
17
 import cutoverUser from '@/assets/icons/UserCenter/cutoverUser.png'
17
 import cutoverUser from '@/assets/icons/UserCenter/cutoverUser.png'
18
 import SwitchSelect from '@/components/SwitchSelect'
18
 import SwitchSelect from '@/components/SwitchSelect'
19
+import { PaysOrder, getMineOrder } from '@/services/payOrder' //创建订单
20
+
19
 import { useModel } from '@/store'
21
 import { useModel } from '@/store'
20
 import './MineCss/style.less'
22
 import './MineCss/style.less'
23
+import  ToggleRoul  from  '@/components/toggleRoul/ToggleRoul'
24
+
21
 
25
 
22
 
26
 
23
 
27
 
28
   const { getAvatar } = useModel('person')
32
   const { getAvatar } = useModel('person')
29
   const [showCutover, setShowCutover] = useState(false)
33
   const [showCutover, setShowCutover] = useState(false)
30
   const hasAvatar = !!person.avatar
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
   const ShowMoldeOn = () => {
39
   const ShowMoldeOn = () => {
35
     setShowCutover(true)
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
   // 通过getUserProfile获取微信用户信息
53
   // 通过getUserProfile获取微信用户信息
39
   const handleGetUserProfile = () => {
54
   const handleGetUserProfile = () => {
103
 
118
 
104
       <view className='User-box'>
119
       <view className='User-box'>
105
         {/* 身份切换 */}
120
         {/* 身份切换 */}
106
-        <SwitchSelect show={showCutover} maskClosable />
121
+        <ToggleRoul showCutover={showCutover} onClose={onClose} />
107
         <view className='User-info'>
122
         <view className='User-info'>
108
           <view className='User-photos-box'>
123
           <view className='User-photos-box'>
109
             <image src={person.avatar || { DefaultImage }} className='User-photos' />
124
             <image src={person.avatar || { DefaultImage }} className='User-photos' />
123
             <view className='buy-list-Paybox' onClick={handleTobePaid} >
138
             <view className='buy-list-Paybox' onClick={handleTobePaid} >
124
               <image className='buy-list-PayLogo' src={awaitPay} />
139
               <image className='buy-list-PayLogo' src={awaitPay} />
125
               <view className='buy-list-goPay'>待支付</view>
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
             </view>
142
             </view>
128
             <view className='buy-list-Paybox ' onClick={handleTobeWritten} >
143
             <view className='buy-list-Paybox ' onClick={handleTobeWritten} >
129
               <image className='buy-list-PayLogo' src={ToShop} />
144
               <image className='buy-list-PayLogo' src={ToShop} />
130
               <view className='buy-list-goPay'>待核销</view>
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
             </view>
147
             </view>
133
             <view className='buy-list-Paybox ' onClick={handleAllOrder} >
148
             <view className='buy-list-Paybox ' onClick={handleAllOrder} >
134
               <image className='buy-list-PayLogo' src={AllOrder} />
149
               <image className='buy-list-PayLogo' src={AllOrder} />
138
             <view className='buy-list-Paybox ' onClick={handleRefund} >
153
             <view className='buy-list-Paybox ' onClick={handleRefund} >
139
               <image className='buy-list-PayLogo' src={Refund} />
154
               <image className='buy-list-PayLogo' src={Refund} />
140
               <view className='buy-list-goPay'>退款/售后</view>
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
             </view>
157
             </view>
143
           </view>
158
           </view>
144
           <view className='Badge-box'>
159
           <view className='Badge-box'>

+ 11
- 3
src/pages/index/tabs/Recommend.jsx 查看文件

35
       typeId: tab
35
       typeId: tab
36
     })
36
     })
37
     if (index == 0) {
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
       // 更新 typeId
60
       // 更新 typeId
61
       // 更新 分页
61
       // 更新 分页
62
     }
62
     }
63
-
64
     setActiveTab(tabJump - 0)
63
     setActiveTab(tabJump - 0)
65
   }, [tabJump])
64
   }, [tabJump])
66
 
65
 
77
     // 用绝对路径
76
     // 用绝对路径
78
     Taro.navigateTo({ url: '/pages/search/search' });
77
     Taro.navigateTo({ url: '/pages/search/search' });
79
   }
78
   }
79
+
80
+
81
+  const RefreshCard=()=>{
82
+    console.log(1111)
83
+  }
84
+
85
+  
80
   return (
86
   return (
81
     <view style={{ height: '100%', overflow: 'auto' }}>
87
     <view style={{ height: '100%', overflow: 'auto' }}>
82
       <view className='search' onClick={onSearch}>
88
       <view className='search' onClick={onSearch}>
104
           </mp-tabs>
110
           </mp-tabs>
105
         </scroll-view>
111
         </scroll-view>
106
       </view>
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
         <view className='waterfall'>
116
         <view className='waterfall'>
109
           {
117
           {
110
             alllist.map((item) => <Card key={item.resourceNo} item={item} />)
118
             alllist.map((item) => <Card key={item.resourceNo} item={item} />)

+ 24
- 2
src/services/landlord.js 查看文件

11
 
11
 
12
  
12
  
13
 /**
13
 /**
14
- * 查询房源列表 
14
+ * 查询指定名宿的账户
15
  * @param {*} params 
15
  * @param {*} params 
16
  * @returns 
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 查看文件

20
  * @returns 
20
  * @returns 
21
  */
21
  */
22
 export const authAvatar = (data) => request('/auth-user', { data, method: 'put' })
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 查看文件

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