Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
meihua-island-book
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2023-12-27 14:24:59 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
05e85938a5bca8c42814ebc7ca0c116c611a9c72
05e85938
1 parent
f89ef508
细节调整
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
13 deletions
components.d.ts
src/components/payCard.vue
src/pages/detail/index.vue
src/pages/my/index.vue
components.d.ts
View file @
05e8593
...
...
@@ -18,6 +18,7 @@ declare module '@vue/runtime-core' {
NutCalendar
:
typeof
import
(
'@nutui/nutui-taro'
)[
'Calendar'
]
NutCol
:
typeof
import
(
'@nutui/nutui-taro'
)[
'Col'
]
NutConfigProvider
:
typeof
import
(
'@nutui/nutui-taro'
)[
'ConfigProvider'
]
NutEmpty
:
typeof
import
(
'@nutui/nutui-taro'
)[
'Empty'
]
NutImagePreview
:
typeof
import
(
'@nutui/nutui-taro'
)[
'ImagePreview'
]
NutInput
:
typeof
import
(
'@nutui/nutui-taro'
)[
'Input'
]
NutInputNumber
:
typeof
import
(
'@nutui/nutui-taro'
)[
'InputNumber'
]
...
...
src/components/payCard.vue
View file @
05e8593
<!--
* @Date: 2023-12-20 14:11:11
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2023-12-27 11:
37:35
* @LastEditTime: 2023-12-27 11:
47:33
* @FilePath: /meihuaApp/src/components/payCard.vue
* @Description: 文件描述
-->
...
...
@@ -112,7 +112,7 @@ const goToPay = () => {
if (current_page === 'pages/my/index') { // 我的页面打开
// 刷新当前页面
Taro.reLaunch({
url: '/pages/my/index'
url: '/pages/my/index
?tab_index=1
'
});
}
if (current_page === 'pages/detail/index') { // 订房确认页打开
...
...
src/pages/detail/index.vue
View file @
05e8593
<!--
* @Date: 2022-09-19 14:11:06
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2023-12-2
6 17:11:50
* @LastEditTime: 2023-12-2
7 14:21:07
* @FilePath: /meihuaApp/src/pages/detail/index.vue
* @Description: 房间详情页面
-->
...
...
@@ -26,7 +26,7 @@
<view class="detail-introduce-html">
<view id="taro_html" v-html="state.roomInfo.description" class="taro_html"></view>
</view>
<view
v-if="showBook"
class="book-bar">
<view class="book-bar">
<nut-row>
<nut-col :span="18">
<view class="book-price">
...
...
@@ -35,7 +35,7 @@
</view>
</nut-col>
<nut-col :span="6">
<view class="book-btn" @tap="goToConfirm">预定</view>
<view
v-if="showBook"
class="book-btn" @tap="goToConfirm">预定</view>
</nut-col>
</nut-row>
</view>
...
...
src/pages/my/index.vue
View file @
05e8593
<!--
* @Date: 2023-12-13 11:13:13
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2023-12-27 1
0:55:44
* @LastEditTime: 2023-12-27 1
3:54:13
* @FilePath: /meihuaApp/src/pages/my/index.vue
* @Description: 我的页面
-->
...
...
@@ -21,7 +21,7 @@
</view>
<view class="list-wrapper">
<view id="title" class="title">我的订单</view>
<nut-tabs v-model="
value" @click="onTabClick" title-scroll title-gutter="0" name="tabName
" background="#FFF" color="#6A4925" animated-time="0">
<nut-tabs v-model="
tab_index" @click="onTabClick" title-scroll title-gutter="0
" background="#FFF" color="#6A4925" animated-time="0">
<nut-tab-pane v-for="item in tabList" :title="item.title" :pane-key="item.key" />
</nut-tabs>
<view v-if="showContent" class="book-list">
...
...
@@ -31,6 +31,11 @@
<view v-if="index === orderList.length-1" style="height: 2rem;"></view>
</view>
</scroll-view>
<nut-empty
v-if="orderList.length === 0"
image="https://static-ftcms.jd.com/p/files/61a9e3313985005b3958672e.png"
description="暂无数据"
></nut-empty>
</view>
</view>
<nav-bar activated="my" />
...
...
@@ -40,29 +45,34 @@
<script setup>
import Taro from '@tarojs/taro'
import { ref, onMounted } from "vue";
import { ref, onMounted
, computed
} from "vue";
import { IconFont } from '@nutui/icons-vue-taro';
import navBar from '@/components/navBar.vue'
import orderCard from '@/components/orderCard.vue'
import payCard from '@/components/payCard.vue'
import avatar from '@/assets/images/avatar.png'
import { showMyInfoAPI } from '@/api/index'
import { getCurrentPageParam } from "@/utils/weapp";
const refScrollView = ref(null);
const
value
= ref('0');
const
tab_index
= ref('0');
const tabList = ref([{
title: '全部订单',
key: '0',
value: 'all'
}, {
title: '待入住',
key: '1',
value: 'a'
}, {
title: '待支付',
key: '2',
value: 'b'
}, {
title: '已取消',
key: '3',
value: 'c'
}]);
const orderList = ref([
...
...
@@ -108,6 +118,19 @@ const userInfo = ref({
phone: ''
});
const tab_status = computed(() => {
switch (tab_index.value) {
case '0':
return 'all'
case '1':
return 'in';
case '2':
return 'pp';
case '3':
return 'ca';
}
});
onMounted(async () => {
// 获取用户信息
const { code, data } = await showMyInfoAPI();
...
...
@@ -118,6 +141,13 @@ onMounted(async () => {
phone: data.wxapp_user_phone
}
}
// 默认勾选栏目
let params = getCurrentPageParam();
if (params.tab_index) {
tab_index.value = params.tab_index;
}
//
console.warn('tab_status', tab_status.value);
});
const onPay = ({ id, remain_time }) => {
...
...
@@ -150,7 +180,10 @@ const goToEdit = async () => {
}
const onTabClick = ({ title, paneKey, disabled }) => {
console.warn(title, paneKey);
tab_index.value = paneKey;
// console.warn(title, paneKey, tabList.value[paneKey]);
// console.warn(tab_index.value);
console.warn(tab_status.value);
}
</script>
...
...
@@ -175,9 +208,9 @@ export default {
this.flag = true;
},
mounted () {
Taro.showLoading({
title: '加载中',
});
//
Taro.showLoading({
//
title: '加载中',
//
});
// 设置首页封面高度
const windowHeight = wx.getSystemInfoSync().windowHeight;
// 处理切换显示白屏问题
...
...
Please
register
or
login
to post a comment