Kaynağa Gözat

民宿房东端新增房源v1.1

李志伟 3 yıl önce
ebeveyn
işleme
2e893c1dfd

+ 4
- 2
src/components/Popup/index.jsx Dosyayı Görüntüle

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

+ 0
- 41
src/components/SwitchSelect/index.jsx Dosyayı Görüntüle

@@ -1,41 +0,0 @@
1
-import Popup from '@/components/Popup'
2
-import Taro from '@tarojs/taro'
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
-const goToHotel = () => {
11
-  Taro.redirectTo({ url: '/hotel/pages/landlord/landlord' })
12
-}
13
-const goToShop = () => {
14
-  Taro.redirectTo({ url: '/shop/pages/spread/spreadIndex' })
15
-}
16
-
17
-export default (props) => {
18
-  const { show, maskClosable } = props
19
-
20
-  return (
21
-
22
-    <Popup show={show} maskClosable={maskClosable}>
23
-      <view className='User-box-sths' >
24
-        <view className='User-box-selectUser'>请选择身份:</view>
25
-        <view className='User-box-tourist' >
26
-          <image className='Ubs-tourist-image' src={touristON} />
27
-          <text className='Ubs-tourist-text'>游客</text>
28
-        </view>
29
-        <view className='User-box-hotelBoss' onClick={goToHotel}>
30
-          <image className='Ubs-hotelBoss-image' src={hotelBossOFF} />
31
-          <text className='Ubs-hotelBoss-text'>民宿老板</text>
32
-        </view>
33
-        <view className='User-box-shopBoss' onClick={goToShop}>
34
-          <image className='Ubs-shopBoss-image' src={shopBossOFF} />
35
-          <text className='Ubs-shopBoss-text'>店铺老板</text>
36
-        </view>
37
-      </view>
38
-    </Popup>
39
-  )
40
-}
41
-

src/components/toggleRoul/ToggleRoul.jsx → src/components/toggleRole/ToggleRole.jsx Dosyayı Görüntüle

@@ -8,25 +8,27 @@ import shopBossON from '@/assets/icons/UserCenter/shopBossON.png'
8 8
 import shopBossOFF from '@/assets/icons/UserCenter/shopBossOFF.png'
9 9
 
10 10
 import Popup from '@/components/Popup'
11
-import './ToggleRoul.less'
11
+import './ToggleRole.less'
12 12
 import { useModel } from '@/store'
13 13
 
14 14
 
15 15
 export default ( props)=>{
16 16
   const {showCutover, onClose }=props
17
-  const {getRoul}=useModel('person')
17
+  const {getRole}=useModel('person')
18 18
   const goToPerson=()=>{
19
-    getRoul('normal')
19
+    getRole('normal')
20 20
   }
21 21
   const goToHotel=()=>{
22
-    getRoul('hotel')
22
+    getRole('hotel')
23 23
   }
24 24
   const goToShop=()=>{
25
-    getRoul('shop')
25
+    getRole('shop')
26
+  }
27
+  const onClose2=()=>{
28
+    console.log('2222222222222222222')
26 29
   }
27
-
28 30
     return (      
29
-      <Popup show={showCutover} onClose={onClose}>
31
+      <Popup show={showCutover} onClose={onClose2}>
30 32
           <view className='User-box-sths' >
31 33
             <view className='User-box-selectUser'>请选择身份:</view>
32 34
             <view className='User-box-tourist' onClick={goToPerson}>

src/components/toggleRoul/ToggleRoul.less → src/components/toggleRole/ToggleRole.less Dosyayı Görüntüle


src/components/Landlord/HouseManage/houseManage.jsx → src/hotel/components/HouseManage/houseManage.jsx Dosyayı Görüntüle

@@ -5,27 +5,49 @@ import del from '@/assets/icons/landlord/删除.png'
5 5
 import addImg from '@/assets/icons/landlord/添加.png'
6 6
 import iconsearch from '@/assets/icons/housemantj/search.png'
7 7
 import './houseManage.less'
8
-import { useState, useEffect,useRef } from 'react'
8
+import {useState, useEffect,useRef } from 'react'
9
+import {useDidShow } from '@tarojs/taro'
9 10
 import {getRoomList} from '@/services/landlord'
10 11
 
11 12
 
12 13
 export default (props) => {
13 14
   const {hotel}=props
14 15
   const [detail, setDetail] = useState([])
16
+  // 判断是否首次加载
17
+  const mounted = useRef(false)
18
+
19
+  const handelClick=()=>{
20
+    Taro.navigateTo({ url: `/hotel/pages/landlord/addRoom/addRoom?hotelId=${hotel.hotelId}&hotelName=${hotel.hotelName}` });
21
+  }
15 22
   useEffect(()=>{
16
-    getRoomList({hotelId:hotel.hotelId}).then((res)=>{
17
-      setDetail(res.records||[])
18
-    })
19
-  },[hotel])
23
+    //首次加载页面时
24
+    if (!mounted.current && hotel.hotelId) {
25
+      getRoomList({hotelId:hotel.hotelId}).then((res)=>{
26
+        setDetail(res.records||[])
27
+        mounted.current = true
28
+      })
29
+    }
30
+  },[hotel?.hotelId])
31
+
32
+  //当前页面切换到前台时
33
+  useDidShow(() => {
34
+    if (mounted.current) {
35
+      getRoomList({hotelId:hotel.hotelId}).then((res)=>{
36
+        setDetail(res.records||[])
37
+      })
38
+    }
39
+  })
40
+
20 41
   return (
21 42
     <view>
22 43
       <view style={{ padding: '0 30rpx', height: '100%' }}>
23
-        <scroll-view scroll-y="true" scroll-view='true' bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll" style={{ height: 'calc(100vh - 204px)' }}>
24 44
           <view className='search'>
25 45
             <input className='searchInput' disabled />
26 46
             <image className='searchicon' src={iconsearch} />
27 47
             <view className="searchword">请输入关键字搜索</view>
28 48
           </view>
49
+        <scroll-view scroll-y="true" scroll-view='true' bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll" style={{ height: 'calc(100vh - 255px)' }}>
50
+
29 51
           <view>
30 52
             {
31 53
               detail?.map((item)=>
@@ -44,7 +66,7 @@ export default (props) => {
44 66
           </view>
45 67
         </scroll-view>        
46 68
       </view>
47
-      <view className='addHouse'>
69
+      <view className='addHouse' onClick={handelClick}>
48 70
         <image className='addImg' src={addImg} />添加房源
49 71
       </view>
50 72
     

src/components/Landlord/HouseManage/houseManage.less → src/hotel/components/HouseManage/houseManage.less Dosyayı Görüntüle

@@ -1,6 +1,6 @@
1 1
 
2 2
 .search{
3
-  padding: 40px 0  30px 0;
3
+  padding: 40px 0 15px 0;
4 4
   position: relative;
5 5
   .searchInput{    
6 6
     height: 68px;
@@ -21,7 +21,7 @@
21 21
     color: #C0C8D3;
22 22
     position: absolute;
23 23
     left: calc(50% - 100px);
24
-    bottom: 60px;
24
+    bottom: 45px;
25 25
   }
26 26
 }
27 27
 .houseCard{
@@ -30,6 +30,7 @@
30 30
   border-radius: 12px;
31 31
   padding: 40px 30px 41px 30px;
32 32
   text-align: center;
33
+  margin: 30px 0;
33 34
   .houseName{
34 35
     height: 122px;
35 36
     font-size: 32px;
@@ -64,7 +65,7 @@
64 65
   text-align: center;
65 66
   line-height: 88px;
66 67
   position: absolute;
67
-  bottom: 178px;
68
+  bottom: 30px;
68 69
   image{
69 70
     width: 32px;
70 71
     height: 32px;

src/components/Landlord/Income/income.jsx → src/hotel/components/Income/income.jsx Dosyayı Görüntüle

@@ -1,10 +1,10 @@
1 1
 import { useState } from 'react'
2 2
 import './income.less'
3
-import eyes from '../../../assets/icons/shopKeeper/小眼睛.png'
4
-import ceyes from '../../../assets/icons/shopKeeper/小眼睛-闭上.png'
5
-import sImg from '../../../assets/icons/landlord/我的收入2.png'
3
+import eyes from '@/assets/icons/shopKeeper/小眼睛.png'
4
+import ceyes from '@/assets/icons/shopKeeper/小眼睛-闭上.png'
5
+import sImg from '@/assets/icons/landlord/我的收入2.png'
6 6
 import cutoverUser from '@/assets/icons/UserCenter/cutoverUser.png'
7
-import ToggleRoul from '@/components/toggleRoul/ToggleRoul'
7
+import ToggleRole from '@/components/toggleRole/ToggleRole'
8 8
 import Picker from '@/components/Picker'
9 9
 
10 10
 export default (props) => {
@@ -27,11 +27,12 @@ export default (props) => {
27 27
     setShowCutover(true)
28 28
   }
29 29
   const onClose = () => {
30
+    console.log('11111111')
30 31
     setShowCutover(false)
31 32
   }
32 33
   return (
33 34
     <view>
34
-      <ToggleRoul showCutover={showCutover} onClose={onClose} />
35
+      <ToggleRole showCutover={showCutover} onClose={onClose} />
35 36
       <view style={{ padding: '30rpx', height: '100%' }}>
36 37
         <scroll-view scroll-y="true" scroll-view='true' bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll" style={{ height: 'calc(100vh - 120px)' }}>
37 38
           <view className='storexx'>

src/components/Landlord/Income/income.less → src/hotel/components/Income/income.less Dosyayı Görüntüle


+ 9
- 0
src/hotel/pages/landlord/addRoom/addRoom.config.js Dosyayı Görüntüle

@@ -0,0 +1,9 @@
1
+export default {
2
+  navigationBarTitleText: '',
3
+  navigationStyle: 'custom',
4
+  usingComponents: {
5
+    "mp-cells": "weui-miniprogram/cells/cells",
6
+    "mp-cell": "weui-miniprogram/cell/cell",
7
+    "mp-form": "weui-miniprogram/form/form"
8
+  }
9
+}

+ 89
- 0
src/hotel/pages/landlord/addRoom/addRoom.jsx Dosyayı Görüntüle

@@ -0,0 +1,89 @@
1
+import withLayout from '@/layouts'
2
+import Taro from '@tarojs/taro'
3
+import CustomNav from '@/components/CustomNav'
4
+import { useEffect, useState } from "react"
5
+import './addRoom.less'
6
+import { saveRoom, getHotelDetail } from '@/services/landlord'
7
+
8
+
9
+export default withLayout((props) => {
10
+  const { hotelId, hotelName } = props.router.params
11
+  const [roomModel, setRoomModel] = useState({
12
+    hotelId,
13
+    roomName: '',
14
+    address: '',
15
+    location: '',
16
+    parkingAddress: '',
17
+    parkingLocation: '',
18
+    wifiName: '',
19
+    wifiPassword: '',
20
+    weight: '',
21
+  })
22
+  const onRoomMap = () => {
23
+    Taro.chooseLocation().then((res) => {
24
+      setRoomModel({ ...roomModel, location: res.longitude + ',' + res.latitude })
25
+
26
+    })
27
+  }
28
+  const onParkMap = () => {
29
+    Taro.chooseLocation().then((res) => {
30
+      setRoomModel({ ...roomModel, parkingLocation: res.longitude + ',' + res.latitude })
31
+
32
+    })
33
+  }
34
+  const sumbit = () => {
35
+    //判断每一项是否为空Object.values(roomModel).filter返回一个数组如果有空属性就是数组长度就不为0
36
+    Object.values(roomModel).filter(item => item == '').length != 0 ?
37
+      Taro.showToast({
38
+        title: '每一项都是必填项哦',
39
+        icon: 'none',
40
+      }) :
41
+      saveRoom(roomModel).then(() => {
42
+       
43
+          Taro.showToast({
44
+            title: '保存成功',
45
+            icon: 'success',
46
+          }).then(() => {
47
+            Taro.navigateBack()
48
+          })
49
+      })
50
+  }
51
+  return (
52
+    <view className='page-index'>
53
+      <CustomNav title={hotelName} />
54
+      <view className='from-room'  >
55
+        <mp-form models={roomModel} >
56
+          <mp-cells title='请填写新增的房源信息' footer='  ' >
57
+            <mp-cell prop='roomName' title='房屋名称:' extClass='font'>
58
+              <input focus dataField='roomName' onInput={(e) => setRoomModel({ ...roomModel, roomName: e.detail.value })} value={roomModel.roomName}  placeholder='请输入房屋名称' />
59
+            </mp-cell>
60
+            <mp-cell prop='address' title='位置信息:' extClass='font'>
61
+              <input dataField='address' onInput={(e) => setRoomModel({ ...roomModel, address: e.detail.value })} value={roomModel.address}  placeholder='请输入房屋位置' />
62
+            </mp-cell>
63
+            <mp-cell prop='location' title='定位经纬度:' extClass='font'>
64
+              <label onClick={onRoomMap}>{roomModel.location == '' ? '房间定位' : roomModel.location}</label>
65
+            </mp-cell>
66
+            <mp-cell prop='parkingAddress' title='停车场位置:' extClass='font'>
67
+              <input dataField='parkingAddress' onInput={(e) => setRoomModel({ ...roomModel, parkingAddress: e.detail.value })} value={roomModel.parkingAddress}  placeholder='请输入停车场位置' />
68
+            </mp-cell>
69
+            <mp-cell prop='parkingLocation' title='定位经纬度:' extClass='font'>
70
+              <label onClick={onParkMap}>{roomModel.parkingLocation == '' ? '停车场定位' : roomModel.parkingLocation}</label>
71
+            </mp-cell>
72
+            <mp-cell prop='wifiName' title='Wi-Fi名称:' extClass='font'>
73
+              <input dataField='wifiName' onInput={(e) => setRoomModel({ ...roomModel, wifiName: e.detail.value })} value={roomModel.wifiName}  placeholder='请输入wifi名称' />
74
+            </mp-cell>
75
+            <mp-cell prop='wifiPassword' title='Wi-Fi密码:' extClass='font'>
76
+              <input dataField='wifiPassword' onInput={(e) => setRoomModel({ ...roomModel, wifiPassword: e.detail.value })} value={roomModel.wifiPassword}  placeholder='请输入wifi密码' />
77
+            </mp-cell>
78
+            <mp-cell prop='weight' title='权重:' extClass='font'>
79
+              <input type='number' dataField='weight'  onInput={(e) => setRoomModel({ ...roomModel, weight: e.detail.value })} placeholder='请输入权重' />
80
+            </mp-cell>
81
+            <mp-cell>
82
+              <button className='button-OK' onClick={sumbit}>确定</button>
83
+            </mp-cell>
84
+          </mp-cells>
85
+        </mp-form>
86
+      </view>
87
+    </view>
88
+  )
89
+})

+ 23
- 0
src/hotel/pages/landlord/addRoom/addRoom.less Dosyayı Görüntüle

@@ -0,0 +1,23 @@
1
+.from-room{
2
+  width: 100%;
3
+  box-shadow: 0px 8px 32px 0px rgba(0, 0, 0, 0.08);
4
+  border-radius: 24px;
5
+  
6
+}
7
+.weui-agree .weui-agree__text {
8
+  display: inline;
9
+}
10
+button {
11
+  width: 690px;
12
+  height: 92px;
13
+  background: #1A3B83;
14
+  margin: 0 auto;
15
+  line-height: 92px;
16
+  border-radius: 12px;
17
+  font-size: 40px;
18
+  color: #ffffff;
19
+}
20
+.font{
21
+  font-size: 28px;
22
+    color: #202020;
23
+}

+ 0
- 1
src/hotel/pages/landlord/landlord.config.js Dosyayı Görüntüle

@@ -5,6 +5,5 @@ export default {
5 5
   usingComponents: {
6 6
     "mp-tabbar": "weui-miniprogram/tabbar/tabbar",
7 7
     "mp-dialog": "weui-miniprogram/dialog/dialog"
8
-
9 8
   }
10 9
 }

+ 2
- 2
src/hotel/pages/landlord/landlord.jsx Dosyayı Görüntüle

@@ -1,7 +1,7 @@
1 1
 import React, { useState, useEffect } from 'react'
2 2
 import { useRouter } from '@tarojs/taro'
3
-import HouseManage from '@/components/Landlord/HouseManage/houseManage'
4
-import Income from '@/components/Landlord/Income/income'
3
+import HouseManage from '../../components/HouseManage/houseManage'
4
+import Income from '../../components/Income/income'
5 5
 import TabBar from '@/components/CustTabBar'
6 6
 import incomeImg from '@/assets/icons/landlord/我的收入.png'
7 7
 import onincomeImg from '@/assets/icons/landlord/我的收入按下.png'

+ 2
- 3
src/pages/index/tabs/Mine.jsx Dosyayı Görüntüle

@@ -15,12 +15,11 @@ import collect from '@/assets/icons/UserCenter/collect.png'
15 15
 import Rules from '@/assets/icons/UserCenter/Rules.png'
16 16
 import DefaultImage from '@/assets/icons/UserCenter/DefaultImage.png'
17 17
 import cutoverUser from '@/assets/icons/UserCenter/cutoverUser.png'
18
-import SwitchSelect from '@/components/SwitchSelect'
19 18
 import { PaysOrder, getMineOrder } from '@/services/payOrder' //创建订单
20 19
 
21 20
 import { useModel } from '@/store'
22 21
 import './MineCss/style.less'
23
-import  ToggleRoul  from  '@/components/toggleRoul/ToggleRoul'
22
+import  ToggleRole  from  '@/components/toggleRole/ToggleRole'
24 23
 
25 24
 
26 25
 
@@ -118,7 +117,7 @@ export default (props) => {
118 117
 
119 118
       <view className='User-box'>
120 119
         {/* 身份切换 */}
121
-        <ToggleRoul showCutover={showCutover} onClose={onClose} />
120
+        <ToggleRole showCutover={showCutover} onClose={onClose} />
122 121
         <view className='User-info'>
123 122
           <view className='User-photos-box'>
124 123
             <image src={person.avatar || { DefaultImage }} className='User-photos' />

+ 5
- 1
src/routes.js Dosyayı Görüntüle

@@ -63,7 +63,7 @@ const mainPages = [
63 63
 // 商户管理页面shop/pages/spread/spreadIndex
64 64
 const shopPages = [
65 65
   {
66
-    title: '商铺管理',
66
+    title: '商铺管理',  
67 67
     page: 'pages/spread/spreadIndex',
68 68
     isIndex: true,
69 69
   },
@@ -76,6 +76,10 @@ const hotelPages = [
76 76
     page: 'pages/landlord/landlord',
77 77
     isIndex: true,
78 78
   },
79
+  {
80
+    title: '新增房源',
81
+    page: 'pages/landlord/addRoom/addRoom',
82
+  },
79 83
 ];
80 84
 
81 85
 // 所有的页面

+ 8
- 8
src/services/landlord.js Dosyayı Görüntüle

@@ -7,8 +7,6 @@ import request from '@/utils/request'
7 7
  * @returns 
8 8
  */
9 9
  export const getHotelDetail = (id) => request(`/taHotel/${id}`)
10
-
11
-
12 10
  
13 11
 /**
14 12
  * 查询指定名宿的账户
@@ -39,6 +37,13 @@ import request from '@/utils/request'
39 37
  */
40 38
  export const getRoomList = (params) => request('/taRoom',{params})
41 39
 
40
+/**
41
+ * 保存房源
42
+ * @param {*} data 
43
+ * @returns 
44
+ */
45
+ export const saveRoom = (data) => request('/taRoom', { method: 'post', data })
46
+
42 47
  /**
43 48
  * 删除房源
44 49
  * @param {*} data 
@@ -53,9 +58,4 @@ import request from '@/utils/request'
53 58
  * @returns 
54 59
  */
55 60
 export const getRoomDetail = (id) => request(`/taRoom/${id}`)
56
-/**
57
- * 保存房源
58
- * @param {*} data 
59
- * @returns 
60
- */
61
- export const saveRoom = (data) => request('/taRoom', { method: 'post', data })
61
+

+ 1
- 1
src/services/person.js Dosyayı Görüntüle

@@ -26,4 +26,4 @@ export const authAvatar = (data) => request('/auth-user', { data, method: 'put'
26 26
  * @param {*} data 
27 27
  * @returns 
28 28
  */
29
-  export const toggleRoul = (targetType) => request(`/person-role/${targetType}`,{ method: 'post'})
29
+  export const toggleRole = (targetType) => request(`/person-role/${targetType}`,{ method: 'post'})

src/components/spreads/ShopKeeper/shopKeeper.jsx → src/shop/components/ShopKeeper/shopKeeper.jsx Dosyayı Görüntüle

@@ -14,7 +14,7 @@ import hotelBossOFF from '@/assets/icons/UserCenter/hotelBossOFF.png'
14 14
 import shopBossON from '@/assets/icons/UserCenter/shopBossON.png'
15 15
 import shopBossOFF from '@/assets/icons/UserCenter/shopBossOFF.png'
16 16
 import './shopKeeper.less'
17
-import  ToggleRoul  from  '@/components/toggleRoul/ToggleRoul'
17
+import  ToggleRole  from  '@/components/toggleRole/ToggleRole'
18 18
 
19 19
 
20 20
 export default (props) => {
@@ -53,7 +53,7 @@ export default (props) => {
53 53
       <view>
54 54
         <CustomNav title='十公里' />
55 55
       </view>
56
-      <ToggleRoul showCutover={showCutover} onClose={onClose} />
56
+      <ToggleRole showCutover={showCutover} onClose={onClose} />
57 57
   
58 58
       <view style={{ padding: '30rpx', height: '100%' }}>
59 59
         <scroll-view scroll-y="true" scroll-view='true' bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll" style={{ height: 'calc(100vh - 120px)' }}>

src/components/spreads/ShopKeeper/shopKeeper.less → src/shop/components/ShopKeeper/shopKeeper.less Dosyayı Görüntüle


src/components/spreads/Sparead/spreadMoney.jsx → src/shop/components/Sparead/spreadMoney.jsx Dosyayı Görüntüle

@@ -9,7 +9,7 @@ import touristOFF from '@/assets/icons/UserCenter/touristOFF.png'
9 9
 import hotelBossOFF from '@/assets/icons/UserCenter/hotelBossOFF.png'
10 10
 import shopBossON from '@/assets/icons/UserCenter/shopBossON.png'
11 11
 import './spreadMoney.less'
12
-import  ToggleRoul  from  '@/components/toggleRoul/ToggleRoul'
12
+import  ToggleRole  from  '@/components/toggleRole/ToggleRole'
13 13
 
14 14
 export default (props) => {
15 15
 
@@ -26,7 +26,7 @@ export default (props) => {
26 26
       <view>
27 27
         <CustomNav title='十公里' />
28 28
       </view>
29
-      <ToggleRoul showCutover={showCutover} onClose={onClose} />
29
+      <ToggleRole showCutover={showCutover} onClose={onClose} />
30 30
       <view style={{ padding: '30rpx', height: '100%' }}>
31 31
         <scroll-view scroll-y="true" scroll-view='true' bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll" style={{ height: 'calc(100vh - 120px)' }}>
32 32
           <view className='storexx'>

src/components/spreads/Sparead/spreadMoney.less → src/shop/components/Sparead/spreadMoney.less Dosyayı Görüntüle


+ 2
- 2
src/shop/pages/spread/spreadIndex.jsx Dosyayı Görüntüle

@@ -1,7 +1,7 @@
1 1
 import React, { useState, useEffect } from 'react'
2 2
 import { useRouter } from '@tarojs/taro'
3
-import ShopKeeper from '@/components/spreads/ShopKeeper/shopKeeper'
4
-import Sparead from '@/components/spreads/Sparead/spreadMoney'
3
+import ShopKeeper from '../../components/ShopKeeper/shopKeeper'
4
+import Sparead from '../../components/Sparead/spreadMoney'
5 5
 import TabBar from '@/components/CustTabBar'
6 6
 import shopImg from '@/assets/icons/shopKeeper/订单收入.png'
7 7
 import onShopImg from '@/assets/icons/shopKeeper/订单收入按下.png'

+ 4
- 4
src/store/models/person.js Dosyayı Görüntüle

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