Browse Source

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

李志伟 3 years ago
parent
commit
7d6bfc1217

+ 2
- 2
src/components/OrderMolded/style.less View File

@@ -8,7 +8,7 @@
8 8
     padding-bottom: 21px;
9 9
     display: flex;
10 10
     border-radius: 15px 0px 0px 15px;
11
-    align-items: center;    
11
+    align-items: center;
12 12
     .left-viewText-payOrder {
13 13
       background: url(../../assets/icons/ProCard/ProCard_hot.png) no-repeat;
14 14
       background-size: 100% 100%;
@@ -24,8 +24,8 @@
24 24
     //图片
25 25
     .title-image-cardOrder {
26 26
       width: 100%;
27
-      margin-left: 20px;
28 27
       border-radius: 24px;
28
+      display: flex;
29 29
       overflow: hidden;
30 30
       position: relative;
31 31
       .image-1-cardOrder {

+ 1
- 1
src/components/ShopCommission/index.jsx View File

@@ -15,7 +15,7 @@ export default (props) => {
15 15
     <view className='spreadCard'>
16 16
       <view className='spreadDate'>日期:<text>{formatTimes(item.createDate, "yyyy/MM/dd")}</text></view>
17 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>
18
+        <view className='spreadTime'>时&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;间:<text>{formatTimes(item.createDate, "yyyy/MM/dd hh:mm")}</text></view>
19 19
         <view className='spreadMoney'>收入金额:<text>{(item.amount / 100).toFixed(2)}</text>元</view>
20 20
       </view>
21 21
     </view>

+ 1
- 1
src/components/ShopUnused/index.jsx View File

@@ -19,7 +19,7 @@ export default (props) => {
19 19
     <view className='orderCard'>
20 20
       <view style={{ overflow: 'hidden' }}>
21 21
         <view className='orderId'>订单编号:{item.orderId}</view>
22
-        <view className='orderTime'>下单日期:{formatTimes(item.orderDate, 'yyyy-MM-dd hh:ss')}</view>
22
+        <view className='orderTime'>下单日期:{formatTimes(item.orderDate, 'yyyy-MM-dd hh:mm')}</view>
23 23
       </view>
24 24
       <view className='order'>
25 25
         <image className='orderImg' src={item.poster} mode='aspectFit' />

+ 1
- 1
src/hotel/pages/landlord/landlord.jsx View File

@@ -46,7 +46,7 @@ export default withLayout((props) => {
46 46
   const handleTabChange = (e) => {
47 47
     const { index } = e.detail
48 48
     setCurrentTab(index)
49
-    withSubscribeMessage(TPL_MESSAGE_HOTEL_CHECK_IN)
49
+    withSubscribeMessage([TPL_MESSAGE_HOTEL_CHECK_IN])
50 50
   }
51 51
 
52 52
   useEffect(() => {

+ 8
- 4
src/pages/MineUserAll/ContactMe/index.jsx View File

@@ -24,15 +24,19 @@ export default withLayout((props) => {
24 24
         content
25 25
       }).then(() => {
26 26
 
27
-        Taro.navigateBack({
28
-          delta: 1
29
-        })
30 27
         Taro.showToast({
31 28
           title: '反馈成功',
32 29
           icon: 'success',
33 30
           duration: 2000
31
+
32
+        }).then(x => {
33
+
34
+          Taro.navigateBack({
35
+            delta: 1
36
+          })
37
+          setLoading(false)
38
+
34 39
         })
35
-        setLoading(false)
36 40
       })
37 41
     }
38 42
     else {

+ 6
- 2
src/pages/MineUserAll/RefundMoney/index.jsx View File

@@ -29,9 +29,11 @@ export default withLayout((props) => {
29 29
         pageNum === 1 ? res.records || [] : list.concat(res.records || [])
30 30
       );
31 31
       setHasNextPage(res.current < res.pages);
32
-      Taro.hideLoading();
32
+      setLoading(false)
33 33
 
34
-    });
34
+    }).catch(e => {
35
+      setLoading(false)
36
+    })
35 37
   };
36 38
 
37 39
 
@@ -62,12 +64,14 @@ export default withLayout((props) => {
62 64
         <SpinBox loading={loading} className='index-container' >
63 65
 
64 66
           <view className='View-box-Card'>
67
+
65 68
             {(list || []).map((item) => {
66 69
               return (
67 70
                 <OrderCard item={item} key={item.orderId} sh='1' />
68 71
               )
69 72
             })}
70 73
             <view className='foot'>这是我的底线</view>
74
+
71 75
           </view>
72 76
         </SpinBox>
73 77
 

+ 13
- 9
src/pages/PayOrder/style.less View File

@@ -98,16 +98,20 @@
98 98
           margin-right: 5px;
99 99
           width: 10px;
100 100
           height: 10px;
101
-          background: #999999;
101
+          font-weight: 800;
102
+
103
+          background: #000;
102 104
           border-radius: 50%;
103 105
         }
104 106
         .ul-li-textname {
107
+          font-weight: 800;
108
+
105 109
           font-size: 25px;
106
-          color: #999999;
110
+          color: #000;
107 111
         }
108 112
       }
109 113
     }
110
-    .payorder{
114
+    .payorder {
111 115
       margin: 40px 30px;
112 116
       color: #fff;
113 117
       background-color: #274190;
@@ -118,12 +122,12 @@
118 122
       align-items: center;
119 123
       //垂直居中
120 124
       justify-content: center;
121
-      .paytext{
125
+      .paytext {
122 126
         font-size: 30px;
123 127
       }
124
-      .paycontent{
125
-        margin:0 40px 0 20px;
126
-        .paybuttontop{
128
+      .paycontent {
129
+        margin: 0 40px 0 20px;
130
+        .paybuttontop {
127 131
           background: url(../../assets/icons/ProCard/ProCard_hot.png) no-repeat;
128 132
           background-size: 100% 100%;
129 133
           padding: 5px 25px 8px 6px;
@@ -134,7 +138,7 @@
134 138
           color: @whiteColor;
135 139
           font-weight: 600;
136 140
         }
137
-        .paybuttonbottom{          
141
+        .paybuttonbottom {
138 142
           font-size: 18px;
139 143
           text-decoration: line-through;
140 144
           line-height: 17px;
@@ -142,4 +146,4 @@
142 146
       }
143 147
     }
144 148
   }
145
-}
149
+}

+ 1
- 1
src/pages/RoomOrder/index.jsx View File

@@ -26,7 +26,7 @@ export default withLayout((props) => {
26 26
   const handleSubmit = (e) => {
27 27
 
28 28
     // 订阅消息
29
-    withSubscribeMessage(TPL_MESSAGE_HOTEL_CHECK_OUT, () => {
29
+    withSubscribeMessage([TPL_MESSAGE_HOTEL_CHECK_OUT], () => {
30 30
       for (let i = 0, len = formData.length; i < len; i++) {
31 31
         const item = formData[i];
32 32
         if (!item.customerName || !item.customerPhone) {

+ 7
- 13
src/pages/TobeShop/index.jsx View File

@@ -3,20 +3,14 @@ import { Button, Icon, ScrollView, Text, Textarea, View } from "@tarojs/componen
3 3
 import { useState, useEffect } from "react";
4 4
 import withLayout from "@/layouts";
5 5
 import CustomNav from "@/components/CustomNav";
6
-import { getShopDetail, getShopPackage, getExtendContent } from '@/services/home';
6
+import { getShopDetail } from '@/services/home';
7 7
 import { getVerifyTargetList, putVerifyTarget } from "@/services/payOrder";
8
-import formatTime from '@/utils/formatTime'
9 8
 import Popup from "@/components/Popup";
10 9
 import SpinBox from "@/components/Spin/SpinBox";
11
-import formatPrice from "@/utils/formatPrice";
12 10
 
13 11
 import LocationBig from "@/assets/icons/UserCenter/LocationBig.png";
14 12
 import Perfection from "@/assets/icons/UserCenter/Perfection.png";
15
-import Check_OK from "@/assets/icons/UserCenter/Check_OK.png";
16
-import Check_NO from "@/assets/icons/UserCenter/Check_NO.png";
17 13
 import BlackSpot from "@/assets/icons/GuideCheck/BlackSpot.png";
18
-import food from "@/assets/icons/ProCard/food.png";
19
-import ProCard_hot from "@/assets/icons/ProCard/ProCard_hot.png";
20 14
 import TBCard from './Card'
21 15
 
22 16
 import "./style.less";
@@ -105,19 +99,16 @@ export default withLayout((props) => {
105 99
   };
106 100
   const ButtonOK = (e) => {
107 101
     if (!submiting) {
108
-      Taro.showLoading({
109
-        title: '核销中'
110
-      })
111 102
       setSubmiting(true);
112 103
       Promise.all(checked.map(verifyNo => putVerifyTarget(verifyNo)))
113 104
         .then(res => {
114
-          Taro.hideLoading()
105
+
115 106
           setSubmiting(false);
116 107
           setShowDialog(false);
117 108
           setConsumption(true);
118 109
         })
119 110
         .catch(e => {
120
-          Taro.hideLoading()
111
+
121 112
           setShowDialog(false);
122 113
           setSubmiting(false);
123 114
           getList();  // 刷新数据
@@ -135,7 +126,10 @@ export default withLayout((props) => {
135 126
     if (list?.length > 1) {
136 127
       getList()
137 128
     } else {
138
-      Taro.navigateBack({ delta: 1 })
129
+      Taro.redirectTo({
130
+        url: '/pages/MineUserAll/AllOrder/index?tabJump=3',
131
+      });
132
+      // Taro.navigateBack({ delta: 1 })
139 133
     }
140 134
   };
141 135
 

+ 1
- 1
src/pages/index/index.jsx View File

@@ -43,7 +43,7 @@ export default withLayout((props) => {
43 43
     setCurrentTab(index)
44 44
 
45 45
     if (index === 1) {
46
-      withSubscribeMessage(TPL_MESSAGE_HOTEL_CHECK_OUT)
46
+      withSubscribeMessage([TPL_MESSAGE_HOTEL_CHECK_OUT])
47 47
     }
48 48
   }
49 49
   useEffect(() => {

+ 9
- 7
src/pages/index/tabs/GuideCss/style.less View File

@@ -8,8 +8,8 @@
8 8
   .room-box-info-ROOM {
9 9
     width: 97%;
10 10
     display: flex;
11
-    margin: 60px auto;
12
-
11
+    margin-top: 35px;
12
+    margin: auto;
13 13
     .room-bi-name-ROOM {
14 14
       width: 100%;
15 15
 
@@ -34,7 +34,8 @@
34 34
   .room-box-info-HouLocation {
35 35
     width: 97%;
36 36
     display: flex;
37
-    margin: 60px auto;
37
+    margin-top: 35px;
38
+    margin: auto;
38 39
 
39 40
     .room-bi-name-HouLocation {
40 41
       width: 100%;
@@ -91,8 +92,8 @@
91 92
   .room-box-info-Parking {
92 93
     width: 97%;
93 94
     display: flex;
94
-    margin: 60px auto;
95
-
95
+    margin-top: 35px;
96
+    margin: auto;
96 97
     .room-bi-name-Parking {
97 98
       width: 100%;
98 99
 
@@ -148,8 +149,8 @@
148 149
   .room-box-info-WIFIContent {
149 150
     width: 97%;
150 151
     display: flex;
151
-    margin: 60px auto;
152
-
152
+    margin-top: 35px;
153
+    margin: auto;
153 154
     .room-bi-name-WIFIContent {
154 155
       width: 100%;
155 156
 
@@ -270,6 +271,7 @@
270 271
     }
271 272
   }
272 273
   .Guide-Content-box {
274
+    margin-top: 2em;
273 275
     .title-image {
274 276
       display: flex;
275 277
       // width: 270px;

+ 7
- 5
src/shop/pages/spread/spreadIndex.jsx View File

@@ -4,7 +4,10 @@ import { useRouter } from '@tarojs/taro'
4 4
 import { getShopList, getShopMoney, getAccount, getVerifiedOrder, setGetVerifiedOrder } from '@/services/shopBoss'
5 5
 import { withSubscribeMessage } from '@/utils/subscribeMessage'
6 6
 import withLayout from '@/layouts'
7
-import { TPL_MESSAGE_SHOP_PAY_SUCCESS } from '@/utils/constants'
7
+import {
8
+  TPL_MESSAGE_SHOP_PAY_SUCCESS,
9
+  TPL_MESSAGE_SHOP_VERIFY_RESULT,
10
+} from '@/utils/constants'
8 11
 import tabList from './Shoptabbar'
9 12
 import ShopKeeper from '../../components/ShopKeeper/shopKeeper'
10 13
 import Sparead from '../../components/Sparead/spreadMoney'
@@ -38,18 +41,17 @@ export default withLayout((props) => {
38 41
       listRef.current.context.scrollTo({ top: 0 })
39 42
     }
40 43
 
41
-    withSubscribeMessage(TPL_MESSAGE_SHOP_PAY_SUCCESS)
44
+    withSubscribeMessage([TPL_MESSAGE_SHOP_PAY_SUCCESS, TPL_MESSAGE_SHOP_VERIFY_RESULT])
42 45
   }
43
-  const handelTypeOrder = () => {
44 46
 
47
+  const handelTypeOrder = () => {
45 48
     setAmountType('order')
46
-
47 49
   }
48 50
 
49 51
   const handelType = () => {
50 52
     setAmountType('commission')
51
-
52 53
   }
54
+
53 55
   //商铺列表
54 56
   useEffect(() => {
55 57
     getShopList().then((res) => {

+ 1
- 0
src/utils/constants.js View File

@@ -2,3 +2,4 @@
2 2
 export const TPL_MESSAGE_HOTEL_CHECK_IN = "hotel_check_in";       // 民宿入住消息
3 3
 export const TPL_MESSAGE_HOTEL_CHECK_OUT = "hotel_check_out";     // 民宿离店消息
4 4
 export const TPL_MESSAGE_SHOP_PAY_SUCCESS = "shop_pay_success";   // 商铺下单成功通知
5
+export const TPL_MESSAGE_SHOP_VERIFY_RESULT = "shop_verify_result";   // 商铺下单成功通知

+ 8
- 2
src/utils/hooks/useRouter.js View File

@@ -16,6 +16,13 @@ export default () => {
16 16
   const loginScene = Taro.getStorageSync('scene')
17 17
 
18 18
   useEffect(() => {
19
+    // 没有 token 说明没有登录
20
+    const token = Taro.getStorageSync('token')
21
+    if (!token) {
22
+      return;
23
+    }
24
+
25
+
19 26
     // 扫码进入
20 27
     if (scene) {
21 28
       if (scene === loginScene && qrCode) {
@@ -26,9 +33,7 @@ export default () => {
26 33
           parseQRFinished: true,
27 34
         }
28 35
         setToggleRefresh(Math.random().toString())
29
-        console.log('-----------qrCode---------------', qrCode)
30 36
       } else {
31
-        console.log('-----------getQrcode---------------', scene)
32 37
         getQrcode(scene).then((res) => {
33 38
           const qrParams = parseQueryString(res.scene) || {}
34 39
           routerRef.current.params = {
@@ -41,5 +46,6 @@ export default () => {
41 46
       }
42 47
     }
43 48
   }, [qrCode, scene])
49
+
44 50
   return routerRef.current
45 51
 }

+ 11
- 8
src/utils/subscribeMessage.js View File

@@ -1,18 +1,21 @@
1 1
 import Taro from "@tarojs/taro";
2 2
 import store from "@/store"
3 3
 
4
-export function subscribeMessage(messageType) {
5
-  if (!messageType) return Promise.resolve();
4
+export function subscribeMessage(messageTypes) {
5
+  if (!messageTypes || messageTypes.length < 1) return Promise.resolve();
6 6
   
7 7
   const { messageTpls } = store.getModel('system').getState()
8 8
   if (!messageTpls || !messageTpls.length) return Promise.resolve();
9
-
9
+  
10 10
   return new Promise((resolve, reject) => {
11
-    const tpl = messageTpls.filter(x => x.messageType === messageType)[0] || {}
11
+    const tmplIds = messageTypes.map((messageType) => {
12
+      const tpl = messageTpls.filter(x => x.messageType === messageType)[0] || {}
13
+      return tpl.templateId;
14
+    }).filter(Boolean)
12 15
 
13
-    if (tpl.templateId) {
16
+    if (tmplIds && tmplIds.length > 0) {
14 17
       Taro.requestSubscribeMessage({
15
-        tmplIds: [tpl.templateId],
18
+        tmplIds,
16 19
         complete: () => resolve(),
17 20
       })
18 21
     } else {
@@ -21,8 +24,8 @@ export function subscribeMessage(messageType) {
21 24
   })
22 25
 }
23 26
 
24
-export function withSubscribeMessage(type, callback) {
25
-  subscribeMessage(type).then(() => {
27
+export function withSubscribeMessage(types, callback) {
28
+  subscribeMessage(types).then(() => {
26 29
     if (callback) {
27 30
       callback()
28 31
     }