吃个甘蔗嚼一年 3 gadus atpakaļ
vecāks
revīzija
1c7fc7ef09

+ 2
- 2
src/components/BossCard/index.jsx Parādīt failu

@@ -41,7 +41,7 @@ export default (props) => {
41 41
   return (
42 42
     <view class='container'>
43 43
       <view class='wrapper'>
44
-        <view class='left-complete-one' onClick={() => { goFood() }} >
44
+        <view class='left-complete-one'  >
45 45
           <image className='left-image-1' src={ProCard_hot}></image>
46 46
           <view className='left-viewText'>
47 47
             返现¥{item.cashback / 100}
@@ -56,7 +56,7 @@ export default (props) => {
56 56
             <image className='image-2' src={food}></image>
57 57
           </view>
58 58
           <view className='title-content'>
59
-            <view className='Pro-title'>
59
+            <view className='Pro-title' onClick={() => { goFood() }} >
60 60
               <view className='title-text'>{(item.description).toString().length > 25 ? (item.description).substring(0, 25) + '...' : (item.description)}</view>
61 61
             </view>
62 62
             <text className='title-money' >¥{item.actualPrice / 100}元<text className='title-money-2'>门市价{item.standardPrice / 100}元</text></text>

+ 23
- 0
src/components/ShopCommission/index.jsx Parādīt failu

@@ -0,0 +1,23 @@
1
+import Taro from '@tarojs/taro'
2
+import { useEffect } from 'react'
3
+import { getAccount } from '@/services/shopBoss'
4
+import formatTimes from '@/utils/formatTime'
5
+
6
+import './style.less'
7
+
8
+
9
+export default (props) => {
10
+
11
+  const { item } = props
12
+
13
+
14
+  return (
15
+    <view className='spreadCard'>
16
+      <view className='spreadDate'>日期:<text>{formatTimes(item.createDate, "yyyy/MM/dd")}</text></view>
17
+      <view className='card'>
18
+        <view className='spreadTime'>时&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;间:<text>{formatTimes(item.createDate, "yyyy/MM/dd hh:ss")}</text></view>
19
+        <view className='spreadMoney'>收入金额:<text>{item.amount / 100}</text>元</view>
20
+      </view>
21
+    </view>
22
+  )
23
+}

+ 21
- 0
src/components/ShopCommission/style.less Parādīt failu

@@ -0,0 +1,21 @@
1
+.spreadCard{
2
+  margin-bottom: 1px;
3
+  .spreadDate{
4
+    font-size: 20px;
5
+    color: #202020;
6
+    line-height: 60px;
7
+  }
8
+  .card{
9
+    height: 166px;
10
+    background: #FFF;
11
+    box-shadow: 0px 8px 32px 0px rgba(0, 0, 0, 0.08);
12
+    border-radius: 12px;
13
+    padding: 40px 0 43px 22px;
14
+    font-size: 24px;
15
+    color: #202020;
16
+    box-sizing: border-box;
17
+    .spreadMoney{
18
+      line-height: 60px;
19
+    }
20
+  }
21
+}

+ 39
- 0
src/components/ShopUnused/index.jsx Parādīt failu

@@ -0,0 +1,39 @@
1
+import Taro from '@tarojs/taro'
2
+import { useState, useEffect } from 'react'
3
+import iconsearch from '@/assets/icons/housemantj/search.png'
4
+import ms from '@/assets/icons/housemantj/ms3.jpg'
5
+import cutoverUser from '@/assets/icons/UserCenter/cutoverUser.png'
6
+import './style.less'
7
+
8
+
9
+export default (props) => {
10
+  const { } = props
11
+
12
+
13
+
14
+  useEffect(() => {
15
+
16
+  }, [])
17
+
18
+  return (
19
+    <view className='orderCard'>
20
+      <view style={{ overflow: 'hidden' }}>
21
+        <view className='orderId'>订单编号:<text>ABC123456789</text></view>
22
+        <view className='orderTime'>下单日期:<text>2021-06-22 12:35</text></view>
23
+      </view>
24
+      <view className='order'>
25
+        <image className='orderImg' src={ms} mode='aspectFit' />
26
+        <view className='orderRight'>
27
+          <view className='foodName'>【SEOUL.创意韩国料理】火爆全南京,
28
+            新街口又开新店啦...</view>
29
+          <view className='price'>合计金额:¥<text style={{ fontSize: '24rpx' }}>88</text>元 <text className='pnum'>数量:<text>1</text>张</text> </view>
30
+          <view>已下单:等待客户上门就餐</view>
31
+        </view>
32
+        <view className='line' />
33
+
34
+        <view className='phone'>客户手机:<text>136****9434</text></view>
35
+        <view className='tripTime'>客户行程日期:预计在<text>2021-06-21中下午10:30-16:30</text></view>
36
+      </view>
37
+    </view>
38
+  )
39
+}

+ 93
- 0
src/components/ShopUnused/style.less Parādīt failu

@@ -0,0 +1,93 @@
1
+.orderCard{
2
+  margin-bottom: 20px;
3
+  .orderId{
4
+    font-size: 20px;
5
+    color: #666666;
6
+    line-height: 44px;
7
+    float: left;
8
+    margin: 60px 0 32px 0;
9
+
10
+  }
11
+  .orderTime{    
12
+    font-size: 20px;
13
+    color: #666666;
14
+    line-height: 44px;
15
+    float: right;
16
+    margin: 60px 0 32px 0;
17
+  }
18
+  .order{
19
+    background: #FFFFFF;
20
+    box-shadow: 0px 8px 32px 0px rgba(0, 0, 0, 0.08);
21
+    border-radius: 12px;
22
+    padding: 20px;
23
+    .orderImg{
24
+      width: 194px;
25
+      height: 194px;
26
+      border-radius: 22px;
27
+      float: left;
28
+      margin:0 26px 30px 0;
29
+    }
30
+    .orderRight{
31
+      .foodName{
32
+        height: 63px;
33
+        font-size: 24px;
34
+        color: #333333;
35
+        line-height: 40px;
36
+      }
37
+      .price{
38
+        font-size: 20px;
39
+        font-weight: bold;
40
+        color: #202020;
41
+        line-height: 44px;
42
+        margin: 37px 0 40px 0;
43
+        height: 19px;
44
+        .pnum{
45
+          color: #333333;
46
+          font-weight: 400;
47
+          margin-left: 47px;         
48
+        }
49
+      }
50
+      .price+view{
51
+        font-size: 20px;
52
+        font-weight: bold;
53
+        color: #FF3434;
54
+        line-height: 44px;
55
+        margin-bottom: 35px;
56
+        height: 19px;
57
+      }
58
+    }
59
+    .line{
60
+      width: 100%;
61
+      height: 2px;
62
+      background: #000;
63
+      opacity: 0.1;
64
+    }
65
+    .phone{
66
+      font-size: 24px;
67
+      color: #666666;
68
+      line-height: 44px;
69
+      height: 23px;
70
+      margin: 30px 0;
71
+    }
72
+    .button-OK{
73
+      width: 160px;
74
+    height: 40px;
75
+    background: #1A3B83;
76
+    /* margin: 0 auto; */
77
+    line-height: 40px;
78
+    border-radius: 12px;
79
+    font-size: 23px;
80
+    color: #ffffff;
81
+    position: relative;
82
+    right: -8em;
83
+    top: -2em;
84
+    }
85
+    .tripTime{
86
+      font-size: 24px;
87
+      color: #666666;
88
+      line-height: 44px;
89
+      margin-bottom: 30px;
90
+    }
91
+  }
92
+  
93
+}

+ 39
- 0
src/components/ShopUsed/index.jsx Parādīt failu

@@ -0,0 +1,39 @@
1
+import Taro from '@tarojs/taro'
2
+import { useState, useEffect } from 'react'
3
+import iconsearch from '@/assets/icons/housemantj/search.png'
4
+import ms from '@/assets/icons/housemantj/ms3.jpg'
5
+import cutoverUser from '@/assets/icons/UserCenter/cutoverUser.png'
6
+import './style.less'
7
+
8
+
9
+export default (props) => {
10
+  const { } = props
11
+
12
+
13
+
14
+  useEffect(() => {
15
+
16
+  }, [])
17
+
18
+  return (
19
+    <view className='orderCard'>
20
+      <view style={{ overflow: 'hidden' }}>
21
+        <view className='orderId'>订单编号:<text>ABC123456789</text></view>
22
+        <view className='orderTime'>下单日期:<text>2021-06-22 12:35</text></view>
23
+      </view>
24
+      <view className='order'>
25
+        <image className='orderImg' src={ms} mode='aspectFit' />
26
+        <view className='orderRight'>
27
+          <view className='foodName'>【SEOUL.创意韩国料理】火爆全南京,
28
+            新街口又开新店啦...</view>
29
+          <view className='price'>合计金额:¥<text style={{ fontSize: '24rpx' }}>88</text>元 <text className='pnum'>数量:<text>1</text>张</text> </view>
30
+          <view>已下单:等待客户上门就餐</view>
31
+        </view>
32
+        <view className='line' />
33
+
34
+        <view className='phone'>客户手机:<text>136****9434</text><button className='button-OK'  >确认核销</button> </view>
35
+        <view className='tripTime'>客户行程日期:预计在<text>2021-06-21中下午10:30-16:30</text></view>
36
+      </view>
37
+    </view>
38
+  )
39
+}

+ 100
- 0
src/components/ShopUsed/style.less Parādīt failu

@@ -0,0 +1,100 @@
1
+.orderCard{
2
+  margin-bottom: 20px;
3
+  .orderId{
4
+    font-size: 20px;
5
+    color: #666666;
6
+    line-height: 44px;
7
+    float: left;
8
+    margin: 60px 0 32px 0;
9
+
10
+  }
11
+  .orderTime{    
12
+    font-size: 20px;
13
+    color: #666666;
14
+    line-height: 44px;
15
+    float: right;
16
+    margin: 60px 0 32px 0;
17
+  }
18
+  .order{
19
+    background: #FFFFFF;
20
+    box-shadow: 0px 8px 32px 0px rgba(0, 0, 0, 0.08);
21
+    border-radius: 12px;
22
+    padding: 20px;
23
+    .orderImg{
24
+      width: 194px;
25
+      height: 194px;
26
+      border-radius: 22px;
27
+      float: left;
28
+      margin:0 26px 30px 0;
29
+    }
30
+    .orderRight{
31
+      .foodName{
32
+        height: 63px;
33
+        font-size: 24px;
34
+        color: #333333;
35
+        line-height: 40px;
36
+      }
37
+      .price{
38
+        font-size: 20px;
39
+        font-weight: bold;
40
+        color: #202020;
41
+        line-height: 44px;
42
+        margin: 37px 0 40px 0;
43
+        height: 19px;
44
+        .pnum{
45
+          color: #333333;
46
+          font-weight: 400;
47
+          margin-left: 47px;         
48
+        }
49
+      }
50
+      .price+view{
51
+        font-size: 20px;
52
+        font-weight: bold;
53
+        color: #FF3434;
54
+        line-height: 44px;
55
+        margin-bottom: 35px;
56
+        height: 19px;
57
+      }
58
+    }
59
+    .line{
60
+      width: 100%;
61
+      height: 2px;
62
+      background: #000;
63
+      opacity: 0.1;
64
+    }
65
+    .phone{
66
+      font-size: 24px;
67
+      color: #666666;
68
+      line-height: 44px;
69
+      height: 23px;
70
+      margin: 30px 0;
71
+    }
72
+    .button-OK{
73
+      width: 160px;
74
+    height: 40px;
75
+    background: #1A3B83;
76
+    /* margin: 0 auto; */
77
+    line-height: 40px;
78
+    border-radius: 12px;
79
+    font-size: 23px;
80
+    color: #ffffff;
81
+    position: relative;
82
+    right: -8em;
83
+    top: -2em;
84
+    }
85
+    .tripTime{
86
+      font-size: 24px;
87
+      color: #666666;
88
+      line-height: 44px;
89
+      margin-bottom: 30px;
90
+    }
91
+  }
92
+  
93
+}
94
+.botton{
95
+  font-size: 28px;   
96
+  color: #C0C8D3;
97
+  line-height: 34px;
98
+  text-align: center;
99
+  padding:40px 0 100px 0;
100
+}

+ 49
- 43
src/components/foodCards/foodCards.jsx Parādīt failu

@@ -7,7 +7,7 @@ import hongxin from '@/assets/icons/housemantj/已收藏.png'
7 7
 import baixin from '@/assets/icons/housemantj/收藏.png'
8 8
 import './style.less'
9 9
 import useSave from "@/utils/hooks/useSave"
10
-import {getShopDetail,getShopcity} from '@/services/home'
10
+import { getShopDetail, getShopcity } from '@/services/home'
11 11
 import { useState, useEffect } from 'react'
12 12
 
13 13
 
@@ -15,59 +15,65 @@ import { useState, useEffect } from 'react'
15 15
 //套餐卡片
16 16
 export default (props) => {
17 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({})
18
+  const { shopId } = props.item
19
+  const [isSaved, toggleSave] = useSave(item.isSaved, 'shop_package', item.packageId)
20
+  const [city, setCity] = useState({})
21
+  const [detail, setDetail] = useState({})
22
+
23
+  const goFood = () => {
24
+    Taro.navigateTo({ url: `/pages/details/foodDetails/foodDetails?id=${shopId}` })
25
+
26
+  }
21 27
 
22 28
   useEffect(() => {
23
-  getShopDetail(item.shopId).then((res)=>{
24
-    setDetail(res)
25
-    getShopcity(res.cityId).then((res2)=>{
26
-      setCity(res2)
29
+    getShopDetail(item.shopId).then((res) => {
30
+      setDetail(res)
31
+      getShopcity(res.cityId).then((res2) => {
32
+        setCity(res2)
33
+      })
27 34
     })
28
-  })
29
-}, [])
30
-const star=parseFloat(((detail.sweetScore+detail.environmentScore+detail.serviceScore)/3).toFixed(1)); 
35
+  }, [])
36
+  const star = parseFloat(((detail.sweetScore + detail.environmentScore + detail.serviceScore) / 3).toFixed(1));
31 37
 
32 38
   return (
33
-      <view className='foodCard'>
34
-        <view className='fCleft'>
35
-          <view className='backMoney'>
36
-            返现¥{item.cashback/100}
37
-          </view>
38
-          <view className='appraise'>
39
-            <Star star={star} />
40
-            <text className='storezf'>{star}</text>
39
+    <view className='foodCard'>
40
+      <view className='fCleft'>
41
+        <view className='backMoney'>
42
+          返现¥{item.cashback / 100}
43
+        </view>
44
+        <view className='appraise'>
45
+          <Star star={star} />
46
+          <text className='storezf'>{star}</text>
47
+        </view>
48
+        <view>
49
+          <view className='contentImg'>
50
+            <image src={item.poster} className='img1'></image>
51
+            <image src={msTip} className='mstip'></image>
41 52
           </view>
42
-          <view>
43
-            <view className='contentImg'>
44
-              <image src={item.poster} className='img1'></image>
45
-              <image src={msTip} className='mstip'></image>
53
+          <view className='neirong'>
54
+            <view className='textword'>{(item.description).toString().length > 25 ? (item.description).substring(0, 25) + '...' : (item.description)}</view>
55
+            <view className='jiage' onClick={() => { goFood() }} >
56
+              <text className='rmb' >¥&nbsp;&nbsp;</text>
57
+              <text className='p1'><text className='price' >{item.actualPrice / 100}</text>元&nbsp;&nbsp;</text>
58
+              <text className='p2'>门市价<text className='oldprice' >{item.standardPrice / 100}</text>元</text>
46 59
             </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>
60
-              </view>
60
+            <view className='address'>
61
+              <image className='dw' src={wz} />
62
+              <text className='wz'>{city.areaPName}/{city.areaName}</text>
63
+              <view style={{ display: 'inline-block' }} onClick={toggleSave}>
64
+                <image className='star' src={isSaved > 0 ? hongxin : baixin}></image>
65
+                <text className='collection'>{isSaved > 0 ? '已收藏' : '加入收藏'}</text>
61 66
               </view>
62 67
             </view>
63 68
           </view>
64 69
         </view>
65
-        <view className='fCright' onClick={()=>{Taro.navigateTo({ url: `/pages/PayOrder/index?packageId=${item.packageId}` });}}>
66
-          <image src={pay} />
67
-          <view>支付</view>
68
-        </view>
69
-        <view className='columnLine'></view>
70 70
       </view>
71
-    
71
+      <view className='fCright' onClick={() => { Taro.navigateTo({ url: `/pages/PayOrder/index?packageId=${item.packageId}` }); }}>
72
+        <image src={pay} />
73
+        <view>支付</view>
74
+      </view>
75
+      <view className='columnLine'></view>
76
+    </view>
77
+
72 78
   )
73 79
 }

+ 3
- 0
src/pages/details/foodDetails/foodDetails.jsx Parādīt failu

@@ -2,7 +2,10 @@ import CustomNav from '@/components/CustomNav'
2 2
 import withLayout from '@/layouts'
3 3
 import { getShopDetail, getShopPackage, getExtendContent } from '@/services/home'
4 4
 import { useState, useEffect, useRef } from 'react'
5
+
5 6
 import { Swiper, SwiperItem } from '@tarojs/components';
7
+import BossCard from '@/components/BossCard'
8
+
6 9
 import Star from '@/components/Star/Star.jsx'
7 10
 import Cards from '@/components/foodCards/foodCards.jsx'
8 11
 import ax from '@/assets/icons/housemantj/onlove.png'

+ 3
- 0
src/pages/details/mjDetails/sceneryDetails.jsx Parādīt failu

@@ -1,4 +1,6 @@
1 1
 import CustomNav from '@/components/CustomNav'
2
+import BossCard from '@/components/BossCard'
3
+
2 4
 import ax from '../../../assets/icons/housemantj/onlove.png'
3 5
 import hongxin from '../../../assets/icons/housemantj/已收藏.png'
4 6
 import baixin from '../../../assets/icons/housemantj/收藏.png'
@@ -9,6 +11,7 @@ import showMore from '../../../assets/icons/housemantj/查看更多.png'
9 11
 import share from '../../../assets/icons/housemantj/景点分享.png'
10 12
 import good from '../../../assets/icons/housemantj/景点爆赞.png'
11 13
 import collection from '../../../assets/icons/housemantj/景点收藏.png'
14
+
12 15
 import withLayout from '@/layouts'
13 16
 import { useState, useEffect, useRef } from 'react'
14 17
 import { getTouristDetail, getExtendContent, getRecommendList } from '@/services/home'

+ 1
- 12
src/pages/index/tabs/Guide.jsx Parādīt failu

@@ -1,21 +1,13 @@
1 1
 import { useState, useEffect, useRef } from "react";
2 2
 import Taro from '@tarojs/taro'
3 3
 import MoreGuide from "@/components/MoreGuide";
4
-import Cards from '@/components/foodCards/foodCards.jsx'
5 4
 import BossCard from '@/components/BossCard'
6
-import image from '@/assets/icons/ProCard/8kb.jpg'
7
-import Pay from '@/assets/icons/GuideCheck/Pay_logo.png'
8
-import food from '@/assets/icons/ProCard/food.png'
9
-import ProCard_hot from '@/assets/icons/ProCard/ProCard_hot.png'
10 5
 import Taxi from '@/assets/icons/GuideCheck/taxi.png'
11 6
 import WiFi from '@/assets/icons/GuideCheck/WiFi.png'
12 7
 import GoHere from '@/assets/icons/GuideCheck/GoHere.png'
13
-import position from '@/assets/icons/GuideCheck/position_logo.png'
14 8
 import Cup from '@/assets/icons/GuideCheck/Cup.png'
15 9
 import BlackSpot from '@/assets/icons/GuideCheck/BlackSpot.png'
16
-import starOn from '@/assets/icons/GuideCheck/starOn.png'
17
-import starOff from '@/assets/icons/GuideCheck/starOff.png'
18
-import { getRecommendList, getExtendContent, getShopPackage } from '@/services/home'
10
+import { getRecommendList, getExtendContent } from '@/services/home'
19 11
 import sleep from '@/assets/icons/GuideCheck/sleep_logo.png'
20 12
 import { getTaRoom, goToRoomForm } from '@/services/taRoom​'
21 13
 import showMore from '../../../assets/icons/housemantj/查看更多.png'
@@ -23,8 +15,6 @@ import showMore from '../../../assets/icons/housemantj/查看更多.png'
23 15
 import './GuideCss/style.less'
24 16
 
25 17
 
26
-const scoreList = new Array(5).fill(0)
27
-const score = '3.9'
28 18
 
29 19
 
30 20
 
@@ -243,7 +233,6 @@ export default (props) => {
243 233
           </view>
244 234
         </view>
245 235
         {spackage?.map((item, index) => <BossCard key={(index)} item={item} />)}
246
-
247 236
         {/* 卡片------------- */}
248 237
         {/* <view className='Guide-Content-box-two'>
249 238
           <view className='title-image-two'>

+ 27
- 0
src/services/shopBoss.js Parādīt failu

@@ -0,0 +1,27 @@
1
+
2
+import request from '@/utils/request'
3
+
4
+
5
+/**
6
+ * 商铺老板详情
7
+ * @param {*} 
8
+ * @returns 
9
+ */
10
+export const getShopList = (params) => request(`/shop/manage/index`, { params })
11
+
12
+
13
+/**
14
+ * 商铺账户全年订单收入/推广
15
+ * @param {*} 
16
+ * @returns 
17
+ */
18
+export const getShopMoney = (id, amountType) => request(`/shop/${id}/account?amountType=${amountType}`, { id })
19
+
20
+
21
+/**
22
+ * 商铺推广收入
23
+ * @param {*} 
24
+ * @returns 
25
+ */
26
+export const getAccount = (id,) => request(`/shop/account/${id}/log`, { id })
27
+

+ 32
- 63
src/shop/components/ShopKeeper/shopKeeper.jsx Parādīt failu

@@ -1,7 +1,10 @@
1 1
 import { React, useState, useEffect, } from 'react'
2 2
 import Taro, { useRouter } from '@tarojs/taro'
3 3
 import CustomNav from '@/components/CustomNav'
4
+import Picker from '@/components/Picker'
4 5
 import Popup from '@/components/Popup'
6
+import ShopUsed from '@/components/ShopUsed' //已核销
7
+import ShopUnused from '@/components/ShopUnused' //未核销
5 8
 import eyes from '@/assets/icons/shopKeeper/小眼睛.png'
6 9
 import ceyes from '@/assets/icons/shopKeeper/小眼睛-闭上.png'
7 10
 import iconsearch from '@/assets/icons/housemantj/search.png'
@@ -18,10 +21,26 @@ import ToggleRole from '@/components/toggleRole/ToggleRole'
18 21
 
19 22
 
20 23
 export default (props) => {
21
-
24
+  const { shopList, shop, account, onHotelChange, accountlog, shopMoney } = props
22 25
   const [activeTab, setActiveTab] = useState(0)
23 26
   const { params } = useRouter()
24 27
   const { tabJump } = params || {}
28
+
29
+  const [isyear, setYear] = useState(false)
30
+  const [isMomth, setMonth] = useState(false)
31
+  //小眼睛开关
32
+  const handleYear = () => {
33
+    isyear ? setYear(false) : setYear(true)
34
+  }
35
+  const handleMonth = () => {
36
+    isMomth ? setMonth(false) : setMonth(true)
37
+  }
38
+
39
+
40
+  const handleHotelChange = (shopId, current) => {
41
+    onHotelChange(current)
42
+  }
43
+
25 44
   useEffect(() => {
26 45
     if (tabJump) {
27 46
       setActiveTab(tabJump - 0)
@@ -41,6 +60,7 @@ export default (props) => {
41 60
     },
42 61
   ]
43 62
 
63
+
44 64
   const [showCutover, setShowCutover] = useState(false)
45 65
   const ShowMoldeOn = () => {
46 66
     setShowCutover(true)
@@ -51,14 +71,12 @@ export default (props) => {
51 71
   return (
52 72
     <view>
53 73
       <view>
54
-        <CustomNav title='十公里' />
55 74
       </view>
56 75
       <ToggleRole showCutover={showCutover} onClose={onClose} role='shop' />
57
-
58 76
       <view style={{ padding: '30rpx', height: '100%' }}>
59
-        <scroll-view scroll-y="true" scroll-view='true' bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll" style={{ height: 'calc(100vh - 120px)' }}>
77
+        <scroll-view scroll-y scroll-view='true' bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll" style={{ height: 'calc(100vh - 120px)' }}>
60 78
           <view className='storexx'>
61
-            <view className='storeName'>店名:<text>Yun咖 云里 咖啡店</text></view>
79
+            <view className='storeName'>店名:<Picker style={{ display: 'inline-block' }} placeholder="请选择商铺" value={shop?.shopId} kv={['shopName', 'shopId']} dicts={shopList} onChange={handleHotelChange} /></view>
62 80
             <view onClick={ShowMoldeOn} className='User-info-cutover'>
63 81
               <image className='User-info-cutover-image' src={cutoverUser} />
64 82
             </view>
@@ -66,17 +84,18 @@ export default (props) => {
66 84
             <view className='money'>
67 85
               <view className='sleft'>
68 86
                 <view className='lword'>全年订单收入(税前)</view>
87
+
69 88
                 <view className='yearMoney'>
70
-                  <text>2800000</text>元
71
-                  <image className='micon' src={eyes}></image>
89
+                  <text>{isyear ? shopMoney?.totalCharges : '******'}</text>元
90
+                  <image className='micon' src={isyear ? eyes : ceyes} onClick={handleYear} />
72 91
                 </view>
73 92
               </view>
74 93
               <view className='line' />
75 94
               <view className='sright'>
76 95
                 <view className='rword'>当月订单收入(税前)</view>
77 96
                 <view className='monthMoney'>
78
-                  <text>******</text>元
79
-                  <image className='micon2' src={ceyes}></image>
97
+                  <text>{isMomth ? shopMoney?.currentCharges : '******'}</text>元
98
+                  <image className='micon2' src={isMomth ? eyes : ceyes} onClick={handleMonth}></image>
80 99
                 </view></view>
81 100
             </view>
82 101
           </view>
@@ -99,64 +118,14 @@ export default (props) => {
99 118
           </view>
100 119
 
101 120
           <view>
121
+            {/* 未核销 */}
102 122
             {activeTab === 0 &&
103
-              <view className='orderCard'>
104
-                <view style={{ overflow: 'hidden' }}>
105
-                  <view className='orderId'>订单编号:<text>ABC123456789</text></view>
106
-                  <view className='orderTime'>下单日期:<text>2021-06-22 12:35</text></view>
107
-                </view>
108
-                <view className='order'>
109
-                  <image className='orderImg' src={ms} mode='aspectFit' />
110
-                  <view className='orderRight'>
111
-                    <view className='foodName'>【SEOUL.创意韩国料理】火爆全南京,
112
-                      新街口又开新店啦...</view>
113
-                    <view className='price'>合计金额:¥<text style={{ fontSize: '24rpx' }}>88</text>元 <text className='pnum'>数量:<text>1</text>张</text> </view>
114
-                    <view>已下单:等待客户上门就餐</view>
115
-                  </view>
116
-                  <view className='line' />
117
-                  <view className='phone'>客户手机:<text>136****9434</text></view>
118
-                  <view className='tripTime'>客户行程日期:预计在<text>2021-06-21中下午10:30-16:30</text></view>
119
-                </view>
120
-              </view>
123
+              <ShopUnused />
121 124
             }
125
+            {/* 已核销 */}
122 126
             {activeTab === 1 &&
123 127
               <>
124
-                <view className='orderCard'>
125
-                  <view style={{ overflow: 'hidden' }}>
126
-                    <view className='orderId'>订单编号:<text>ABC123456789</text></view>
127
-                    <view className='orderTime'>下单日期:<text>2021-06-22 12:35</text></view>
128
-                  </view>
129
-                  <view className='order'>
130
-                    <image className='orderImg' src={ms} mode='aspectFit' />
131
-                    <view className='orderRight'>
132
-                      <view className='foodName'>【SEOUL.创意韩国料理】火爆全南京,
133
-                        新街口又开新店啦...</view>
134
-                      <view className='price'>合计金额:¥<text style={{ fontSize: '24rpx' }}>88</text>元 <text className='pnum'>数量:<text>1</text>张</text> </view>
135
-                      <view>已下单:等待客户上门就餐</view>
136
-                    </view>
137
-                    <view className='line' />
138
-                    <view className='phone'>客户手机:<text>136****9434</text></view>
139
-                    <view className='tripTime'>客户行程日期:预计在<text>2021-06-21中下午10:30-16:30</text></view>
140
-                  </view>
141
-                </view>
142
-                <view className='orderCard'>
143
-                  <view style={{ overflow: 'hidden' }}>
144
-                    <view className='orderId'>订单编号:<text>ABC123456789</text></view>
145
-                    <view className='orderTime'>下单日期:<text>2021-06-22 12:35</text></view>
146
-                  </view>
147
-                  <view className='order'>
148
-                    <image className='orderImg' src={ms} mode='aspectFit' />
149
-                    <view className='orderRight'>
150
-                      <view className='foodName'>【SEOUL.创意韩国料理】火爆全南京,
151
-                        新街口又开新店啦...</view>
152
-                      <view className='price'>合计金额:¥<text style={{ fontSize: '24rpx' }}>88</text>元 <text className='pnum'>数量:<text>1</text>张</text> </view>
153
-                      <view>已下单:等待客户上门就餐</view>
154
-                    </view>
155
-                    <view className='line' />
156
-                    <view className='phone'>客户手机:<text>136****9434</text></view>
157
-                    <view className='tripTime'>客户行程日期:预计在<text>2021-06-21中下午10:30-16:30</text></view>
158
-                  </view>
159
-                </view>
128
+                <ShopUsed />
160 129
               </>
161 130
             }
162 131
           </view>

+ 16
- 3
src/shop/components/ShopKeeper/shopKeeper.less Parādīt failu

@@ -136,10 +136,10 @@
136 136
         color: #FF3434;
137 137
       }
138 138
       .micon2{
139
-        width: 34px;
140
-        height: 16px;
139
+        width: 38px;
140
+        height: 22px;
141 141
         margin-left: 23px;
142
-        margin-bottom: 7px;
142
+        margin-bottom: -2px;
143 143
       }
144 144
     }
145 145
   }
@@ -265,6 +265,19 @@
265 265
       height: 23px;
266 266
       margin: 30px 0;
267 267
     }
268
+    .button-OK{
269
+      width: 160px;
270
+    height: 40px;
271
+    background: #1A3B83;
272
+    /* margin: 0 auto; */
273
+    line-height: 40px;
274
+    border-radius: 12px;
275
+    font-size: 23px;
276
+    color: #ffffff;
277
+    position: relative;
278
+    right: -8em;
279
+    top: -2em;
280
+    }
268 281
     .tripTime{
269 282
       font-size: 24px;
270 283
       color: #666666;

+ 50
- 24
src/shop/components/Sparead/spreadMoney.jsx Parādīt failu

@@ -1,19 +1,54 @@
1
-import { useState } from 'react'
1
+import { useState, useEffect } from 'react'
2 2
 import Taro from '@tarojs/taro'
3 3
 import CustomNav from '@/components/CustomNav'
4 4
 import Popup from '@/components/Popup'
5
+import Picker from '@/components/Picker'
6
+import ShopCommission from '@/components/ShopCommission'
5 7
 import eyes from '@/assets/icons/shopKeeper/小眼睛.png'
6 8
 import ceyes from '@/assets/icons/shopKeeper/小眼睛-闭上.png'
7 9
 import cutoverUser from '@/assets/icons/UserCenter/cutoverUser.png'
8 10
 import touristOFF from '@/assets/icons/UserCenter/touristOFF.png'
9 11
 import hotelBossOFF from '@/assets/icons/UserCenter/hotelBossOFF.png'
10 12
 import shopBossON from '@/assets/icons/UserCenter/shopBossON.png'
13
+import { getAccount } from '@/services/shopBoss'
14
+
11 15
 import './spreadMoney.less'
12 16
 import ToggleRole from '@/components/toggleRole/ToggleRole'
13 17
 
14 18
 export default (props) => {
15
-
19
+  const { shopList, shop, account, onHotelChange, accountlog, shopMoney } = props
16 20
   const [showCutover, setShowCutover] = useState(false)
21
+  const [isyear, setYear] = useState(false)
22
+  const [isMomth, setMonth] = useState(false)
23
+  const [shopAccount, setShopAccount] = useState([])
24
+  const acc = shopMoney?.acc
25
+  const { accountId } = acc
26
+
27
+
28
+
29
+  useEffect(() => {
30
+    getAccount(accountId).then((e) => {
31
+      const accContent = e.records
32
+      setShopAccount(accContent)
33
+
34
+    })
35
+  }, [accountId])
36
+
37
+  //小眼睛开关
38
+  const handleYear = () => {
39
+    isyear ? setYear(false) : setYear(true)
40
+  }
41
+  const handleMonth = () => {
42
+    isMomth ? setMonth(false) : setMonth(true)
43
+  }
44
+
45
+  //商铺更改
46
+  const handleHotelChange = (shopId, current) => {
47
+    onHotelChange(current)
48
+  }
49
+
50
+
51
+
17 52
   const ShowMoldeOn = () => {
18 53
     setShowCutover(true)
19 54
   }
@@ -24,13 +59,12 @@ export default (props) => {
24 59
   return (
25 60
     <view>
26 61
       <view>
27
-        <CustomNav title='十公里' />
28 62
       </view>
29 63
       <ToggleRole showCutover={showCutover} onClose={onClose} role='shop' />
30 64
       <view style={{ padding: '30rpx', height: '100%' }}>
31 65
         <scroll-view scroll-y="true" scroll-view='true' bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll" style={{ height: 'calc(100vh - 120px)' }}>
32 66
           <view className='storexx'>
33
-            <view className='storeName'>店名:<text>Yun咖 云里 咖啡店</text></view>
67
+            <view className='storeName'>店名:<Picker style={{ display: 'inline-block' }} placeholder="请选择商铺" value={shop?.shopId} kv={['shopName', 'shopId']} dicts={shopList} onChange={handleHotelChange} /></view>
34 68
             <view onClick={ShowMoldeOn} className='User-info-cutover'>
35 69
               <image className='User-info-cutover-image' src={cutoverUser} />
36 70
             </view>
@@ -39,36 +73,28 @@ export default (props) => {
39 73
               <view className='sleft'>
40 74
                 <view className='lword'>全年推广收入(税前)</view>
41 75
                 <view className='yearMoney'>
42
-                  <text>2800000</text>元
43
-                  <image className='micon' src={eyes}></image>
76
+                  <text>{isyear ? shopMoney?.totalCharges : '******'}</text>元
77
+                  <image className='micon' src={isyear ? eyes : ceyes} onClick={handleYear} />
44 78
                 </view>
45 79
               </view>
46 80
               <view className='line' />
47 81
               <view className='sright'>
48 82
                 <view className='rword'>当月推广收入(税前)</view>
49 83
                 <view className='monthMoney'>
50
-                  <text>******</text>元
51
-                  <image className='micon2' src={ceyes}></image>
84
+                  <text>{isMomth ? shopMoney?.currentCharges : '******'}</text>元
85
+                  <image className='micon2' src={isMomth ? eyes : ceyes} onClick={handleMonth}></image>
52 86
                 </view></view>
53 87
             </view>
54 88
           </view>
55 89
           <view className='title'>推广收入记录</view>
56
-          <view>
57
-            <view className='spreadCard'>
58
-              <view className='spreadDate'>日期:<text>2021-06-24</text></view>
59
-              <view className='card'>
60
-                <view className='spreadTime'>时&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;间:<text>2021-06-24  20:45</text></view>
61
-                <view className='spreadMoney'>收入金额:<text>5.00</text>元</view>
62
-              </view>
63
-            </view>
64
-            <view className='spreadCard'>
65
-              <view className='spreadDate'>日期:<text>2021-06-24</text></view>
66
-              <view className='card'>
67
-                <view className='spreadTime'>时&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;间:<text>2021-06-24  20:45</text></view>
68
-                <view className='spreadMoney'>收入金额:<text>5.00</text>元</view>
69
-              </view>
70
-            </view>
71
-          </view>
90
+          {
91
+            shopAccount.map((item, index) => {
92
+              return (
93
+                <ShopCommission item={item} />
94
+
95
+              )
96
+            })
97
+          }
72 98
           <view className='botton'>已经到底了~</view>
73 99
         </scroll-view>
74 100
       </view>

+ 4
- 24
src/shop/components/Sparead/spreadMoney.less Parādīt failu

@@ -138,10 +138,10 @@
138 138
         color: #FF3434;
139 139
       }
140 140
       .micon2{
141
-        width: 34px;
142
-        height: 16px;
141
+        width: 38px;
142
+        height: 22px;
143 143
         margin-left: 23px;
144
-        margin-bottom: 7px;
144
+        margin-bottom: -2px;
145 145
       }
146 146
     }
147 147
   }
@@ -152,27 +152,7 @@
152 152
   line-height: 60px;
153 153
   margin: 62px 0 10px 1px;
154 154
 }
155
-.spreadCard{
156
-  margin-bottom: 1px;
157
-  .spreadDate{
158
-    font-size: 20px;
159
-    color: #202020;
160
-    line-height: 60px;
161
-  }
162
-  .card{
163
-    height: 166px;
164
-    background: #FFF;
165
-    box-shadow: 0px 8px 32px 0px rgba(0, 0, 0, 0.08);
166
-    border-radius: 12px;
167
-    padding: 40px 0 43px 22px;
168
-    font-size: 24px;
169
-    color: #202020;
170
-    box-sizing: border-box;
171
-    .spreadMoney{
172
-      line-height: 60px;
173
-    }
174
-  }
175
-}
155
+
176 156
 .botton{
177 157
   font-size: 28px;   
178 158
   color: #C0C8D3;

+ 59
- 5
src/shop/pages/spread/spreadIndex.jsx Parādīt failu

@@ -1,5 +1,7 @@
1 1
 import React, { useState, useEffect } from 'react'
2
+import CustomNav from '@/components/CustomNav'
2 3
 import { useRouter } from '@tarojs/taro'
4
+import { getShopList, getShopMoney, getAccount } from '@/services/shopBoss'
3 5
 import ShopKeeper from '../../components/ShopKeeper/shopKeeper'
4 6
 import Sparead from '../../components/Sparead/spreadMoney'
5 7
 import TabBar from '@/components/CustTabBar'
@@ -7,22 +9,72 @@ import shopImg from '@/assets/icons/shopKeeper/订单收入.png'
7 9
 import onShopImg from '@/assets/icons/shopKeeper/订单收入按下.png'
8 10
 import spareadImg from '@/assets/icons/shopKeeper/推广收入.png'
9 11
 import onSpareadImg from '@/assets/icons/shopKeeper/推广收入按下.png'
10
-import './spreadIndex.less'
11 12
 import withLayout from '@/layouts'
12 13
 
14
+import './spreadIndex.less'
15
+
16
+
13 17
 export default withLayout((props) => {
14 18
   const { router, person } = props
15 19
 
16 20
   const { params } = useRouter()
17 21
   const { tab } = params || {}
18
-
19 22
   const [currentTab, setCurrentTab] = useState(0)
23
+  const [shopList, setShopList] = useState([])
24
+  const [shop, setShop] = useState()
25
+  const shopId = shop?.shopId
26
+  console.log("🚀 ~ file: spreadIndex.jsx ~ line 26 ~ withLayout ~ shopId", shopId)
27
+  const [account, setAccount] = useState()
28
+  const [accountlog, setAccountLog] = useState([])
20 29
 
30
+  const [amountType, setAmountType] = useState('order')
31
+  const [shopMoney, setShopMoney] = useState([])
21 32
   const handleTabChange = (e) => {
22 33
     const { index } = e.detail
23 34
     setCurrentTab(index)
24 35
   }
25 36
 
37
+  const handelType = () => {
38
+    setAmountType('commission')
39
+  }
40
+
41
+  useEffect(() => {
42
+    getShopList().then((res) => {
43
+      const { shopList: list, account: acc, shop: current } = res
44
+      setShopList(list)
45
+      setShop(current)
46
+      setAccount(acc)
47
+      console.log("🚀 ~ file: shopKeeper.jsx ~ line 48 ~ getShopList ~ res", res)
48
+
49
+
50
+
51
+    })
52
+
53
+  }, [])
54
+
55
+  useEffect(() => {
56
+    if (shopId) {
57
+      getShopMoney(shopId, amountType).then((e) => {
58
+        setShopMoney(e)
59
+
60
+      })
61
+    }
62
+
63
+  }, [amountType, shopId])
64
+
65
+
66
+  const handleHotelChange = (current) => {
67
+    console.log('已选择店铺', current);
68
+    // getNowHotelManage(current.shopId).then((res) => {
69
+    //   const { account: acc } = res
70
+    //   setAccount(acc)
71
+    //   setHotel(current)
72
+    //   getAccountLogList(acc.accountId).then((res2) => {
73
+    //     setAccountLog(res2.records || [])
74
+    //   })
75
+    // })
76
+  }
77
+
26 78
   useEffect(() => {
27 79
     if (tab) {
28 80
       setCurrentTab(tab - 0)
@@ -31,16 +83,18 @@ export default withLayout((props) => {
31 83
 
32 84
   return (
33 85
     <view className='page-index'>
86
+      <CustomNav title={shop?.shopName} />
87
+
34 88
       <view className='index-container'>
35
-        {currentTab === 0 && <ShopKeeper />}
36
-        {currentTab === 1 && <Sparead />}
89
+        {currentTab === 0 && <ShopKeeper shopList={shopList} shop={shop} account={account} onHotelChange={handleHotelChange} accountlog={accountlog} shopMoney={shopMoney} />}
90
+        {currentTab === 1 && <Sparead shopList={shopList} shop={shop} account={account} onHotelChange={handleHotelChange} accountlog={accountlog} shopMoney={shopMoney} />}
37 91
       </view>
38 92
       <view className='index-tabbar'>
39 93
         <TabBar extClass='custom-tabbar bottomTab' current={currentTab} onChange={handleTabChange}>
40 94
           <view className={`${currentTab === 0 ? 'orderstab' : ''}`}>
41 95
             <image className='incomes' src={currentTab === 0 ? onShopImg : shopImg} /><text>订单收入</text>
42 96
           </view>
43
-          <view className={`${currentTab === 1 ? 'spreadtab' : ''}`}>
97
+          <view className={`${currentTab === 1 ? 'spreadtab' : ''}`} onClick={() => { handelType() }} >
44 98
             <image className='house' src={currentTab === 1 ? onSpareadImg : spareadImg} /><text>推广收入</text>
45 99
           </view>
46 100
         </TabBar>