This commit is contained in:
yzy committed 2026-01-21 15:32:19 +08:00
1 parent d0b5a3d582
commit 62c8d25fcc
7 files changed
+163 -106

No files matched your search

+12
View File
@@ -59,6 +59,18 @@
"style": { "style": {
"navigationBarTitleText": "" "navigationBarTitleText": ""
} }
},
{
"path": "pages/login/changePassword",
"style": {
"navigationBarTitleText": ""
}
},
{
"path": "pages/control/index",
"style": {
"navigationStyle": "custom"
}
} }
], ],
+7
View File
@@ -0,0 +1,7 @@
import { get, post, put, dele } from '@/utils/request';
/**
* @desc 获取产品列表
*/
export const getProducts = (params) => {
return get('/api/products/', params)
}
+117
View File
@@ -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>
+4 -34
View File
@@ -1,45 +1,16 @@
<script setup> <script setup>
import { ref, onMounted, getCurrentInstance, nextTick } from 'vue'; import { ref, onMounted } from 'vue';
import { onLoad, onShow, onReady, onHide, onPullDownRefresh } from '@dcloudio/uni-app'; import { onLoad, onShow, onReady, onHide, onPullDownRefresh } from '@dcloudio/uni-app';
import CustomTabBar from '@/components/CustomTabBar.vue' import CustomTabBar from '@/components/CustomTabBar.vue'
import { getSystemSafeArea, getSystemInfo, isEmpty, showToast, showLoadingToast, closeToast } from '@/common/common.js';
import LoginPopup from '@/components/login.vue';
import { getProducts } from './api.js'; import { getProducts } from './api.js';
import { useUserStore } from '@/store/user.js'; import { useUserStore } from '@/store/user.js';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
const { t, locale } = useI18n(); const { t, locale } = useI18n();
const props = defineProps(['status']);
const { proxy } = getCurrentInstance();
const userStore = useUserStore(); const userStore = useUserStore();
const tabList = ref([]); //tab列表
const tabsIndex = ref(0); //当前选中的tab索引
// const modelTypeList = ref([]);
const tabsLeft = ref(0); //下划线移动的距离
const finished = ref(false); //数据是否全部加载完成
const windowWidth = ref(0); //tab元素的宽度
const orderRows = ref([]); //订单列表
const showLogin = ref(false); //显示登录
const triggered = ref(false); //是否下拉刷新状态,true为是
const loading = ref(false); // 添加loading状态
const productData = ref();
const scrollHeight = ref(0); //scroll-view滚动高度
const pageView = ref({});
/**
* @desc 获取可视内容高度
*/
const getContentHeight = (e) => {
pageView.value = e;
};
/** /**
* @desc 跳转至详情页面 * @desc 跳转至详情页面
@@ -59,8 +30,7 @@ const getProductList = async()=>{
onLoad(()=>{ onLoad(()=>{
// getProductList();
}); });
// 模拟数据 // 模拟数据
+4 -34
View File
@@ -1,45 +1,16 @@
<script setup> <script setup>
import { ref, onMounted, getCurrentInstance, nextTick } from 'vue'; import { ref, onMounted } from 'vue';
import { onLoad, onShow, onReady, onHide, onPullDownRefresh } from '@dcloudio/uni-app'; import { onLoad, onShow, onReady, onHide, onPullDownRefresh } from '@dcloudio/uni-app';
import CustomTabBar from '@/components/CustomTabBar.vue' import CustomTabBar from '@/components/CustomTabBar.vue'
import { getSystemSafeArea, getSystemInfo, isEmpty, showToast, showLoadingToast, closeToast } from '@/common/common.js';
import LoginPopup from '@/components/login.vue';
import { getProducts } from './api.js'; import { getProducts } from './api.js';
import { useUserStore } from '@/store/user.js'; import { useUserStore } from '@/store/user.js';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
const { t, locale } = useI18n(); const { t, locale } = useI18n();
const props = defineProps(['status']);
const { proxy } = getCurrentInstance();
const userStore = useUserStore(); const userStore = useUserStore();
const tabList = ref([]); //tab列表
const tabsIndex = ref(0); //当前选中的tab索引
// const modelTypeList = ref([]);
const tabsLeft = ref(0); //下划线移动的距离
const finished = ref(false); //数据是否全部加载完成
const windowWidth = ref(0); //tab元素的宽度
const orderRows = ref([]); //订单列表
const showLogin = ref(false); //显示登录
const triggered = ref(false); //是否下拉刷新状态,true为是
const loading = ref(false); // 添加loading状态
const productData = ref();
const scrollHeight = ref(0); //scroll-view滚动高度
const pageView = ref({});
/**
* @desc 获取可视内容高度
*/
const getContentHeight = (e) => {
pageView.value = e;
};
/** /**
* @desc 跳转至详情页面 * @desc 跳转至详情页面
@@ -59,8 +30,7 @@ const getProductList = async()=>{
onLoad(()=>{ onLoad(()=>{
// getProductList();
}); });
// 模拟数据 // 模拟数据
+15 -4
View File
@@ -188,13 +188,24 @@
url: '/pages/login/index', url: '/pages/login/index',
}); });
}; };
/**
* @desc 跳转至登录页面
*/
const toControlPage = ()=> {
uni.navigateTo({
url: '/pages/control/index',
});
};
onMounted(() => { onMounted(() => {
getUserInformation(); // getUserInformation();
}); });
onLoad(() => { onLoad(() => {
getUserInformation(); // getUserInformation();
}); });
onShow(()=>{
getUserInformation();
})
// 测试缓存中的数据 // 测试缓存中的数据
@@ -333,7 +344,7 @@
</view> </view>
<!-- 底部按钮 --> <!-- 底部按钮 -->
<view class="w-full" v-if="device.isCurrent"> <view class="w-full" v-if="device.isCurrent">
<view class="border-round-theme rounded-lg bg-theme flex justify-center items-center p-2 gap-1"> <view class="border-round-theme rounded-lg bg-theme flex justify-center items-center p-2 gap-1" @click="toControlPage()">
<u-icon name="list" color="#fff"></u-icon> <u-icon name="list" color="#fff"></u-icon>
<text class="text-white text-sm">CONTROL CONSOLE</text> <text class="text-white text-sm">CONTROL CONSOLE</text>
</view> </view>
@@ -438,7 +449,7 @@
</view> </view>
<u-popup :show="show" @close="hidePopup" round="10" :closeable="true"> <u-popup :show="show" @close="hidePopup" round="10" :closeable="true">
<view class="p-6 w-64"> <view class="p-6">
<view class="text-lg font-bold mb-4 text-center">Edit Username</view> <view class="text-lg font-bold mb-4 text-center">Edit Username</view>
<input <input
v-model="newNickname" v-model="newNickname"
+4 -34
View File
@@ -1,45 +1,16 @@
<script setup> <script setup>
import { ref, onMounted, getCurrentInstance, nextTick } from 'vue'; import { ref, onMounted } from 'vue';
import { onLoad, onShow, onReady, onHide, onPullDownRefresh } from '@dcloudio/uni-app'; import { onLoad, onShow, onReady, onHide, onPullDownRefresh } from '@dcloudio/uni-app';
import CustomTabBar from '@/components/CustomTabBar.vue' import CustomTabBar from '@/components/CustomTabBar.vue'
import { getSystemSafeArea, getSystemInfo, isEmpty, showToast, showLoadingToast, closeToast } from '@/common/common.js';
import LoginPopup from '@/components/login.vue';
import { getProducts } from './api.js'; import { getProducts } from './api.js';
import { useUserStore } from '@/store/user.js'; import { useUserStore } from '@/store/user.js';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
const { t, locale } = useI18n(); const { t, locale } = useI18n();
const props = defineProps(['status']);
const { proxy } = getCurrentInstance();
const userStore = useUserStore(); const userStore = useUserStore();
const tabList = ref([]); //tab列表
const tabsIndex = ref(0); //当前选中的tab索引
// const modelTypeList = ref([]);
const tabsLeft = ref(0); //下划线移动的距离
const finished = ref(false); //数据是否全部加载完成
const windowWidth = ref(0); //tab元素的宽度
const orderRows = ref([]); //订单列表
const showLogin = ref(false); //显示登录
const triggered = ref(false); //是否下拉刷新状态,true为是
const loading = ref(false); // 添加loading状态
const productData = ref();
const scrollHeight = ref(0); //scroll-view滚动高度
const pageView = ref({});
/**
* @desc 获取可视内容高度
*/
const getContentHeight = (e) => {
pageView.value = e;
};
/** /**
* @desc 跳转至详情页面 * @desc 跳转至详情页面
@@ -59,8 +30,7 @@ const getProductList = async()=>{
onLoad(()=>{ onLoad(()=>{
// getProductList();
}); });
// 模拟数据 // 模拟数据