优化
This commit is contained in:
1 parent
d0b5a3d582
commit
62c8d25fcc
7 files changed
+163
-106
No files matched your search
@@ -0,0 +1,117 @@
|
||||
<script setup>
|
||||
import { ref, onMounted } from 'vue';
|
||||
import { onLoad, onShow, onReady, onHide, onPullDownRefresh } from '@dcloudio/uni-app';
|
||||
|
||||
|
||||
|
||||
import { getProducts } from './api.js';
|
||||
import { useUserStore } from '@/store/user.js';
|
||||
|
||||
import { useI18n } from 'vue-i18n';
|
||||
const { t, locale } = useI18n();
|
||||
const userStore = useUserStore();
|
||||
|
||||
|
||||
/**
|
||||
* @desc 跳转至详情页面
|
||||
*/
|
||||
const toDetailPage = (productId) => {
|
||||
uni.navigateTo({
|
||||
url: '/pages/product/detail',
|
||||
});
|
||||
};
|
||||
//获取首页数据
|
||||
const getProductList = async()=>{
|
||||
const res = await getProducts();
|
||||
|
||||
productData.value=res.data;
|
||||
console.log("商品数据",productData.value);
|
||||
}
|
||||
|
||||
|
||||
onLoad(()=>{
|
||||
|
||||
});
|
||||
|
||||
// 模拟数据
|
||||
|
||||
|
||||
/**
|
||||
* @desc 处理预订事件
|
||||
*/
|
||||
const handleBook = (productId) => {
|
||||
// 这里可以添加预订逻辑,比如跳转到详情页
|
||||
uni.navigateTo({
|
||||
url: `/pages/product/detail?id=${productId}`,
|
||||
});
|
||||
};
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<view class="h-[100vh] ">
|
||||
<view class="sticky top-0 w-full pt-6 flex flex-col bg-white">
|
||||
<view class="flex gap-2 px-6">
|
||||
<!-- 返回按钮 -->
|
||||
<u-icon name="arrow-leftward" size="50"></u-icon>
|
||||
<!-- title & 状态 -->
|
||||
<view class="flex flex-col gap-[10px]">
|
||||
<text class="text-2xl font-bold">Control Console</text>
|
||||
<view class="flex items-center gap-2">
|
||||
<view class="w-2 h-2 bg-[#5ac725] rounded-full" />
|
||||
<text class="text-sm">CONNECTED</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<uv-divider line-color="#333333" hairline="false"></uv-divider>
|
||||
</view>
|
||||
<view class="flex flex-col px-6 pt-2 gap-2">
|
||||
<!-- title -->
|
||||
<text class="text-lg text-[#808080]">TEXT TO SPEECH</text>
|
||||
<!-- 输入框 -->
|
||||
<view class="flex gap-2">
|
||||
<view class="flex flex-1 border border-solid border-theme border-[3px] rounded-lg p-2">
|
||||
<u-icon name="mic" size="30"></u-icon>
|
||||
<u-input placeholder="Type what Sweekar should say..."></u-input>
|
||||
</view>
|
||||
<view class="rounded-lg bg-[#808080] w-4 flex justify-center items-center">
|
||||
<u-icon name="chat"></u-icon>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
:deep(.u-count-down__text) {
|
||||
color: #ab002d !important;
|
||||
font-size: 13px !important;
|
||||
}
|
||||
|
||||
.navigation {
|
||||
border-bottom: 1px solid #f2f2f2;
|
||||
}
|
||||
|
||||
.navi-title-center {
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
|
||||
.line {
|
||||
transition: 0.3s all;
|
||||
}
|
||||
|
||||
.search {
|
||||
:deep(.u-search) {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user