Showing
4 changed files
with
47 additions
and
13 deletions
| ... | @@ -18,6 +18,7 @@ declare module '@vue/runtime-core' { | ... | @@ -18,6 +18,7 @@ declare module '@vue/runtime-core' { |
| 18 | NutCalendar: typeof import('@nutui/nutui-taro')['Calendar'] | 18 | NutCalendar: typeof import('@nutui/nutui-taro')['Calendar'] |
| 19 | NutCol: typeof import('@nutui/nutui-taro')['Col'] | 19 | NutCol: typeof import('@nutui/nutui-taro')['Col'] |
| 20 | NutConfigProvider: typeof import('@nutui/nutui-taro')['ConfigProvider'] | 20 | NutConfigProvider: typeof import('@nutui/nutui-taro')['ConfigProvider'] |
| 21 | + NutEmpty: typeof import('@nutui/nutui-taro')['Empty'] | ||
| 21 | NutImagePreview: typeof import('@nutui/nutui-taro')['ImagePreview'] | 22 | NutImagePreview: typeof import('@nutui/nutui-taro')['ImagePreview'] |
| 22 | NutInput: typeof import('@nutui/nutui-taro')['Input'] | 23 | NutInput: typeof import('@nutui/nutui-taro')['Input'] |
| 23 | NutInputNumber: typeof import('@nutui/nutui-taro')['InputNumber'] | 24 | NutInputNumber: typeof import('@nutui/nutui-taro')['InputNumber'] | ... | ... |
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2023-12-20 14:11:11 | 2 | * @Date: 2023-12-20 14:11:11 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2023-12-27 11:37:35 | 4 | + * @LastEditTime: 2023-12-27 11:47:33 |
| 5 | * @FilePath: /meihuaApp/src/components/payCard.vue | 5 | * @FilePath: /meihuaApp/src/components/payCard.vue |
| 6 | * @Description: 文件描述 | 6 | * @Description: 文件描述 |
| 7 | --> | 7 | --> |
| ... | @@ -112,7 +112,7 @@ const goToPay = () => { | ... | @@ -112,7 +112,7 @@ const goToPay = () => { |
| 112 | if (current_page === 'pages/my/index') { // 我的页面打开 | 112 | if (current_page === 'pages/my/index') { // 我的页面打开 |
| 113 | // 刷新当前页面 | 113 | // 刷新当前页面 |
| 114 | Taro.reLaunch({ | 114 | Taro.reLaunch({ |
| 115 | - url: '/pages/my/index' | 115 | + url: '/pages/my/index?tab_index=1' |
| 116 | }); | 116 | }); |
| 117 | } | 117 | } |
| 118 | if (current_page === 'pages/detail/index') { // 订房确认页打开 | 118 | if (current_page === 'pages/detail/index') { // 订房确认页打开 | ... | ... |
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2022-09-19 14:11:06 | 2 | * @Date: 2022-09-19 14:11:06 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2023-12-26 17:11:50 | 4 | + * @LastEditTime: 2023-12-27 14:21:07 |
| 5 | * @FilePath: /meihuaApp/src/pages/detail/index.vue | 5 | * @FilePath: /meihuaApp/src/pages/detail/index.vue |
| 6 | * @Description: 房间详情页面 | 6 | * @Description: 房间详情页面 |
| 7 | --> | 7 | --> |
| ... | @@ -26,7 +26,7 @@ | ... | @@ -26,7 +26,7 @@ |
| 26 | <view class="detail-introduce-html"> | 26 | <view class="detail-introduce-html"> |
| 27 | <view id="taro_html" v-html="state.roomInfo.description" class="taro_html"></view> | 27 | <view id="taro_html" v-html="state.roomInfo.description" class="taro_html"></view> |
| 28 | </view> | 28 | </view> |
| 29 | - <view v-if="showBook" class="book-bar"> | 29 | + <view class="book-bar"> |
| 30 | <nut-row> | 30 | <nut-row> |
| 31 | <nut-col :span="18"> | 31 | <nut-col :span="18"> |
| 32 | <view class="book-price"> | 32 | <view class="book-price"> |
| ... | @@ -35,7 +35,7 @@ | ... | @@ -35,7 +35,7 @@ |
| 35 | </view> | 35 | </view> |
| 36 | </nut-col> | 36 | </nut-col> |
| 37 | <nut-col :span="6"> | 37 | <nut-col :span="6"> |
| 38 | - <view class="book-btn" @tap="goToConfirm">预定</view> | 38 | + <view v-if="showBook" class="book-btn" @tap="goToConfirm">预定</view> |
| 39 | </nut-col> | 39 | </nut-col> |
| 40 | </nut-row> | 40 | </nut-row> |
| 41 | </view> | 41 | </view> | ... | ... |
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2023-12-13 11:13:13 | 2 | * @Date: 2023-12-13 11:13:13 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2023-12-27 10:55:44 | 4 | + * @LastEditTime: 2023-12-27 13:54:13 |
| 5 | * @FilePath: /meihuaApp/src/pages/my/index.vue | 5 | * @FilePath: /meihuaApp/src/pages/my/index.vue |
| 6 | * @Description: 我的页面 | 6 | * @Description: 我的页面 |
| 7 | --> | 7 | --> |
| ... | @@ -21,7 +21,7 @@ | ... | @@ -21,7 +21,7 @@ |
| 21 | </view> | 21 | </view> |
| 22 | <view class="list-wrapper"> | 22 | <view class="list-wrapper"> |
| 23 | <view id="title" class="title">我的订单</view> | 23 | <view id="title" class="title">我的订单</view> |
| 24 | - <nut-tabs v-model="value" @click="onTabClick" title-scroll title-gutter="0" name="tabName" background="#FFF" color="#6A4925" animated-time="0"> | 24 | + <nut-tabs v-model="tab_index" @click="onTabClick" title-scroll title-gutter="0" background="#FFF" color="#6A4925" animated-time="0"> |
| 25 | <nut-tab-pane v-for="item in tabList" :title="item.title" :pane-key="item.key" /> | 25 | <nut-tab-pane v-for="item in tabList" :title="item.title" :pane-key="item.key" /> |
| 26 | </nut-tabs> | 26 | </nut-tabs> |
| 27 | <view v-if="showContent" class="book-list"> | 27 | <view v-if="showContent" class="book-list"> |
| ... | @@ -31,6 +31,11 @@ | ... | @@ -31,6 +31,11 @@ |
| 31 | <view v-if="index === orderList.length-1" style="height: 2rem;"></view> | 31 | <view v-if="index === orderList.length-1" style="height: 2rem;"></view> |
| 32 | </view> | 32 | </view> |
| 33 | </scroll-view> | 33 | </scroll-view> |
| 34 | + <nut-empty | ||
| 35 | + v-if="orderList.length === 0" | ||
| 36 | + image="https://static-ftcms.jd.com/p/files/61a9e3313985005b3958672e.png" | ||
| 37 | + description="暂无数据" | ||
| 38 | + ></nut-empty> | ||
| 34 | </view> | 39 | </view> |
| 35 | </view> | 40 | </view> |
| 36 | <nav-bar activated="my" /> | 41 | <nav-bar activated="my" /> |
| ... | @@ -40,29 +45,34 @@ | ... | @@ -40,29 +45,34 @@ |
| 40 | 45 | ||
| 41 | <script setup> | 46 | <script setup> |
| 42 | import Taro from '@tarojs/taro' | 47 | import Taro from '@tarojs/taro' |
| 43 | -import { ref, onMounted } from "vue"; | 48 | +import { ref, onMounted, computed } from "vue"; |
| 44 | import { IconFont } from '@nutui/icons-vue-taro'; | 49 | import { IconFont } from '@nutui/icons-vue-taro'; |
| 45 | import navBar from '@/components/navBar.vue' | 50 | import navBar from '@/components/navBar.vue' |
| 46 | import orderCard from '@/components/orderCard.vue' | 51 | import orderCard from '@/components/orderCard.vue' |
| 47 | import payCard from '@/components/payCard.vue' | 52 | import payCard from '@/components/payCard.vue' |
| 48 | import avatar from '@/assets/images/avatar.png' | 53 | import avatar from '@/assets/images/avatar.png' |
| 49 | import { showMyInfoAPI } from '@/api/index' | 54 | import { showMyInfoAPI } from '@/api/index' |
| 55 | +import { getCurrentPageParam } from "@/utils/weapp"; | ||
| 50 | 56 | ||
| 51 | const refScrollView = ref(null); | 57 | const refScrollView = ref(null); |
| 52 | 58 | ||
| 53 | -const value = ref('0'); | 59 | +const tab_index = ref('0'); |
| 54 | const tabList = ref([{ | 60 | const tabList = ref([{ |
| 55 | title: '全部订单', | 61 | title: '全部订单', |
| 56 | key: '0', | 62 | key: '0', |
| 63 | + value: 'all' | ||
| 57 | }, { | 64 | }, { |
| 58 | title: '待入住', | 65 | title: '待入住', |
| 59 | key: '1', | 66 | key: '1', |
| 67 | + value: 'a' | ||
| 60 | }, { | 68 | }, { |
| 61 | title: '待支付', | 69 | title: '待支付', |
| 62 | key: '2', | 70 | key: '2', |
| 71 | + value: 'b' | ||
| 63 | }, { | 72 | }, { |
| 64 | title: '已取消', | 73 | title: '已取消', |
| 65 | key: '3', | 74 | key: '3', |
| 75 | + value: 'c' | ||
| 66 | }]); | 76 | }]); |
| 67 | 77 | ||
| 68 | const orderList = ref([ | 78 | const orderList = ref([ |
| ... | @@ -108,6 +118,19 @@ const userInfo = ref({ | ... | @@ -108,6 +118,19 @@ const userInfo = ref({ |
| 108 | phone: '' | 118 | phone: '' |
| 109 | }); | 119 | }); |
| 110 | 120 | ||
| 121 | +const tab_status = computed(() => { | ||
| 122 | + switch (tab_index.value) { | ||
| 123 | + case '0': | ||
| 124 | + return 'all' | ||
| 125 | + case '1': | ||
| 126 | + return 'in'; | ||
| 127 | + case '2': | ||
| 128 | + return 'pp'; | ||
| 129 | + case '3': | ||
| 130 | + return 'ca'; | ||
| 131 | + } | ||
| 132 | +}); | ||
| 133 | + | ||
| 111 | onMounted(async () => { | 134 | onMounted(async () => { |
| 112 | // 获取用户信息 | 135 | // 获取用户信息 |
| 113 | const { code, data } = await showMyInfoAPI(); | 136 | const { code, data } = await showMyInfoAPI(); |
| ... | @@ -118,6 +141,13 @@ onMounted(async () => { | ... | @@ -118,6 +141,13 @@ onMounted(async () => { |
| 118 | phone: data.wxapp_user_phone | 141 | phone: data.wxapp_user_phone |
| 119 | } | 142 | } |
| 120 | } | 143 | } |
| 144 | + // 默认勾选栏目 | ||
| 145 | + let params = getCurrentPageParam(); | ||
| 146 | + if (params.tab_index) { | ||
| 147 | + tab_index.value = params.tab_index; | ||
| 148 | + } | ||
| 149 | + // | ||
| 150 | + console.warn('tab_status', tab_status.value); | ||
| 121 | }); | 151 | }); |
| 122 | 152 | ||
| 123 | const onPay = ({ id, remain_time }) => { | 153 | const onPay = ({ id, remain_time }) => { |
| ... | @@ -150,7 +180,10 @@ const goToEdit = async () => { | ... | @@ -150,7 +180,10 @@ const goToEdit = async () => { |
| 150 | } | 180 | } |
| 151 | 181 | ||
| 152 | const onTabClick = ({ title, paneKey, disabled }) => { | 182 | const onTabClick = ({ title, paneKey, disabled }) => { |
| 153 | - console.warn(title, paneKey); | 183 | + tab_index.value = paneKey; |
| 184 | + // console.warn(title, paneKey, tabList.value[paneKey]); | ||
| 185 | + // console.warn(tab_index.value); | ||
| 186 | + console.warn(tab_status.value); | ||
| 154 | } | 187 | } |
| 155 | </script> | 188 | </script> |
| 156 | 189 | ||
| ... | @@ -175,9 +208,9 @@ export default { | ... | @@ -175,9 +208,9 @@ export default { |
| 175 | this.flag = true; | 208 | this.flag = true; |
| 176 | }, | 209 | }, |
| 177 | mounted () { | 210 | mounted () { |
| 178 | - Taro.showLoading({ | 211 | + // Taro.showLoading({ |
| 179 | - title: '加载中', | 212 | + // title: '加载中', |
| 180 | - }); | 213 | + // }); |
| 181 | // 设置首页封面高度 | 214 | // 设置首页封面高度 |
| 182 | const windowHeight = wx.getSystemInfoSync().windowHeight; | 215 | const windowHeight = wx.getSystemInfoSync().windowHeight; |
| 183 | // 处理切换显示白屏问题 | 216 | // 处理切换显示白屏问题 | ... | ... |
-
Please register or login to post a comment