浏览代码

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

吃个甘蔗嚼一年 3 年前
父节点
当前提交
d9a5767bdb

+ 2
- 1
src/hotel/pages/landlord/landlord.jsx 查看文件

@@ -5,6 +5,7 @@ import { getHotelManage, getNowHotelManage } from '@/services/landlord'
5 5
 import NoData from '@/components/NoData'
6 6
 import CustomNav from '@/components/CustomNav'
7 7
 import { withSubscribeMessage } from '@/utils/subscribeMessage'
8
+import { TPL_MESSAGE_HOTEL_CHECK_IN } from '@/utils/constants'
8 9
 import HouseManage from '../../components/HouseManage/houseManage'
9 10
 import Income from '../../components/Income/income'
10 11
 import tabList from './Roomtabbar'
@@ -45,7 +46,7 @@ export default withLayout((props) => {
45 46
   const handleTabChange = (e) => {
46 47
     const { index } = e.detail
47 48
     setCurrentTab(index)
48
-    withSubscribeMessage('hotel_check_in')
49
+    withSubscribeMessage(TPL_MESSAGE_HOTEL_CHECK_IN)
49 50
   }
50 51
 
51 52
   useEffect(() => {

+ 2
- 1
src/pages/RoomOrder/index.jsx 查看文件

@@ -4,6 +4,7 @@ import CustomNav from '@/components/CustomNav'
4 4
 import withLayout from '@/layouts'
5 5
 import { getTaRoom, goToRoomForm, personSubmit } from '@/services/taRoom​'
6 6
 import { withSubscribeMessage } from "@/utils/subscribeMessage"
7
+import { TPL_MESSAGE_HOTEL_CHECK_OUT } from '@/utils/constants'
7 8
 import RoomForm from './components/RoomForm'
8 9
 import './style.less'
9 10
 
@@ -25,7 +26,7 @@ export default withLayout((props) => {
25 26
   const handleSubmit = (e) => {
26 27
 
27 28
     // 订阅消息
28
-    withSubscribeMessage('hotel_check_out', () => {
29
+    withSubscribeMessage(TPL_MESSAGE_HOTEL_CHECK_OUT, () => {
29 30
       for (let i = 0, len = formData.length; i < len; i++) {
30 31
         const item = formData[i];
31 32
         if (!item.customerName || !item.customerPhone) {

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

@@ -7,11 +7,12 @@ import logo from '@/assets/icons/comm/logo_small.png'
7 7
 import { getHotelDetail } from '@/services/landlord'
8 8
 import { getTaRoom } from '@/services/taRoom​'
9 9
 import withLayout from '@/layouts'
10
+import { withSubscribeMessage } from '@/utils/subscribeMessage'
11
+import { TPL_MESSAGE_HOTEL_CHECK_OUT } from '@/utils/constants'
10 12
 import tabList from './tabbar'
11 13
 import Guide from './tabs/Guide'
12 14
 import Mine from './tabs/Mine'
13 15
 import Recommend from './tabs/Recommend'
14
-import { withSubscribeMessage } from '@/utils/subscribeMessage'
15 16
 import './index.less'
16 17
 
17 18
 
@@ -40,7 +41,7 @@ export default withLayout((props) => {
40 41
     setCurrentTab(index)
41 42
 
42 43
     if (index === 1) {
43
-      withSubscribeMessage('hotel_check_out')
44
+      withSubscribeMessage(TPL_MESSAGE_HOTEL_CHECK_OUT)
44 45
     }
45 46
   }
46 47
   useEffect(() => {

+ 4
- 3
src/shop/pages/spread/spreadIndex.jsx 查看文件

@@ -2,9 +2,9 @@ import React, { useState, useEffect, useRef } from 'react'
2 2
 import CustomNav from '@/components/CustomNav'
3 3
 import { useRouter } from '@tarojs/taro'
4 4
 import { getShopList, getShopMoney, getAccount, getVerifiedOrder, setGetVerifiedOrder } from '@/services/shopBoss'
5
-
6
-
5
+import { withSubscribeMessage } from '@/utils/subscribeMessage'
7 6
 import withLayout from '@/layouts'
7
+import { TPL_MESSAGE_SHOP_PAY_SUCCESS } from '@/utils/constants'
8 8
 import tabList from './Shoptabbar'
9 9
 import ShopKeeper from '../../components/ShopKeeper/shopKeeper'
10 10
 import Sparead from '../../components/Sparead/spreadMoney'
@@ -36,8 +36,9 @@ export default withLayout((props) => {
36 36
     //如果context有的话代表他滚动了   那么切换tab页就置顶
37 37
     if (listRef.current?.context) {
38 38
       listRef.current.context.scrollTo({ top: 0 })
39
-
40 39
     }
40
+
41
+    withSubscribeMessage(TPL_MESSAGE_SHOP_PAY_SUCCESS)
41 42
   }
42 43
   const handelTypeOrder = () => {
43 44
 

+ 4
- 0
src/utils/constants.js 查看文件

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