diff --git a/api/index.ts b/api/index.ts index cc23717..f9fd46f 100644 --- a/api/index.ts +++ b/api/index.ts @@ -108,3 +108,12 @@ export function fetchAddTodo(data : {}) { method: 'POST' }); } + +// 待办列表 +export function fetchOrderList(data : {}) { + return request({ + url: '/index/orders', + data: data, + method: 'POST' + }); +} \ No newline at end of file diff --git a/pages.json b/pages.json index 8d1074e..10ded14 100644 --- a/pages.json +++ b/pages.json @@ -39,79 +39,82 @@ "navigationBarTitleText": "茶麻古道", "enablePullDownRefresh": false } - }, - { - "path": "pages/login/index", - "style": { - "navigationStyle": "custom", - "navigationBarTitleText": "登陆" - } - }, - { - "path": "pages/todo/todoList", - "style": { - "navigationBarTitleText": "待办事项", - "enablePullDownRefresh": false - } - }, - { - "path": "pages/todo/todoAdd", - "style": { - "navigationBarTitleText": "添加待办事项", - "enablePullDownRefresh": false - } - }, - { - "path": "pages/index/orderAdd", - "style": { - "navigationBarTitleText": "开台", - "enablePullDownRefresh": false - } - }, - { - "path": "pages/index/orderEdit", - "style": { - "navigationBarTitleText": "账单", - "enablePullDownRefresh": false - } - }, - { - "path": "pages/index/goodsOrderAdd", - "style": { - "navigationBarTitleText": "商品订单", - "enablePullDownRefresh": false - } }, - // { - // "path": "pages/cart/index", - // "style": { - // "navigationBarTitleText": "购物车" - // } - // }, - // { - // "path": "pages/cart/parts/index", - // "style": { - // "navigationBarTitleText": "购物车" - // } - // }, + { + "path": "pages/login/index", + "style": { + "navigationStyle": "custom", + "navigationBarTitleText": "登陆" + } + }, + { + "path": "pages/todo/todoList", + "style": { + "navigationBarTitleText": "待办事项", + "enablePullDownRefresh": false + } + }, + { + "path": "pages/todo/todoAdd", + "style": { + "navigationBarTitleText": "添加待办事项", + "enablePullDownRefresh": false + } + }, + { + "path": "pages/index/orderAdd", + "style": { + "navigationBarTitleText": "开台", + "enablePullDownRefresh": false + } + }, + { + "path": "pages/index/orderEdit", + "style": { + "navigationBarTitleText": "账单", + "enablePullDownRefresh": false + } + }, + { + "path": "pages/index/goodsOrderAdd", + "style": { + "navigationBarTitleText": "商品订单", + "enablePullDownRefresh": false + } + }, { "path": "pages/mine/index", "style": { - "navigationBarTitleText": "我的" + "navigationBarTitleText": "我的", + "enablePullDownRefresh": false } }, { - "path": "pages/mall/detail", + "path": "pages/order/index", "style": { - "navigationBarTitleText": "店铺商品详情" + "navigationBarTitleText": "订单管理", + "enablePullDownRefresh": false } }, { - "path": "pages/mall/houseDetail", + "path": "pages/order/detail", "style": { - "navigationBarTitleText": "仓库商品详情" + "navigationBarTitleText": "订单详情", + "enablePullDownRefresh": false } - }, + } + // { + // "path": "pages/mall/detail", + // "style": { + // "navigationBarTitleText": "店铺商品详情" + // } + // }, + // { + // "path": "pages/mall/houseDetail", + // "style": { + // "navigationBarTitleText": "仓库商品详情" + // } + // }, // { // "path": "pages/mall/index/index", // "style": { @@ -130,30 +133,19 @@ // "navigationBarTitleText": "精选配件" // } // }, - { - "path": "pages/order/preview", - "style": { - "navigationBarTitleText": "提交订单" - } - }, - { - "path": "pages/order/housePreview", - "style": { - "navigationBarTitleText": "提交订单" - } - }, - { - "path": "pages/order/index", - "style": { - "navigationBarTitleText": "我的订单" - } - }, - { - "path": "pages/order/detail", - "style": { - "navigationBarTitleText": "订单详情" - } - } + // { + // "path": "pages/order/preview", + // "style": { + // "navigationBarTitleText": "提交订单" + // } + // }, + // { + // "path": "pages/order/housePreview", + // "style": { + // "navigationBarTitleText": "提交订单" + // } + // }, + // { // "path": "pages/order/preview", @@ -170,7 +162,7 @@ // "navigationStyle": "custom" // } // }, - + // { // "path": "pages/login/phoneAuthorization", // "style": { @@ -216,14 +208,14 @@ // "navigationBarTitleText": "编辑商品", // "enablePullDownRefresh": false // } - // }, - // { - // "path": "pages/config/goodsDetail", - // "style": { - // "navigationBarTitleText": "店铺商品详情", - // "enablePullDownRefresh": false - // } - // }, + // }, + // { + // "path": "pages/config/goodsDetail", + // "style": { + // "navigationBarTitleText": "店铺商品详情", + // "enablePullDownRefresh": false + // } + // }, // { // "path": "pages/config/shopOrder/index", // "style": { diff --git a/pages/config/shopOrder/index.vue b/pages/config/shopOrder/index.vue index 575809a..2de60f8 100644 --- a/pages/config/shopOrder/index.vue +++ b/pages/config/shopOrder/index.vue @@ -266,33 +266,31 @@ // 默认tab - const current_tab_idx = ref(0); + const current_tab_idx = ref(0); + // 定义tab切换 + const tabs_config = [{ + title: '进行中', + status: 'all' + }, + { + title: '今日', + status: 'payment' + }, + { + title: '昨日', + status: 'delivery' + }, + { + title: '全部', + status: 'received' + }, + + ] // 订单列表数据 const dataList = ref([]); // zp const paging = ref(null); - // 定义tab切换 - const tabs_config = [{ - title: '全部', - status: 'all' - }, - { - title: '待付款', - status: 'payment' - }, - { - title: '待发货', - status: 'delivery' - }, - { - title: '待收货', - status: 'received' - }, - { - title: '已完成', - status: 'finish' - } - ] + diff --git a/pages/index/index.vue b/pages/index/index.vue index 1c04abf..98d8c16 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -151,7 +151,8 @@ console.log(res); uni.setStorageSync('token', res.token) uni.setStorageSync('uid', res.user.user_id) - uni.setStorageSync('username', res.user.user_name) + uni.setStorageSync('user_name', res.user.user_name) + uni.setStorageSync('staff_name', res.user.staff_name) uni.setStorageSync('role', res.user.role.value) isLoggedIn.value = true uni.showTabBar() diff --git a/pages/mine/index.vue b/pages/mine/index.vue index a1ef74d..9c28e6e 100644 --- a/pages/mine/index.vue +++ b/pages/mine/index.vue @@ -4,13 +4,12 @@ 用户 - - {{ userInfo.nickName }} - UID:{{ userInfo.user_id }} + {{ staffName }} + UID:{{ uid }} - + - - - + + + + + + + + + + + + + - + - + @@ -107,9 +112,9 @@ // 导入获取用户信息的API函数 - import { - fetchUserInfo - } from '@/api/user'; + // import { + // fetchUserInfo + // } from '@/api/user'; // 导入页面跳转工具函数 import { goToLoginPage, @@ -118,68 +123,76 @@ // 导入uni-app生命周期钩子 // 导入获取订单总数的API函数 - import { - fetchOrderTotalCount - } from '@/api/order'; + // import { + // fetchOrderTotalCount + // } from '@/api/order'; - import { - fetchGetConfig - } from '@/api/config'; + // import { + // fetchGetConfig + // } from '@/api/config'; - const audit = ref(true); + // const audit = ref(true); - const showMyOrder = ref(false); + // const showMyOrder = ref(false); - const phone = ref(''); + // const phone = ref(''); // 用户ID const uid = ref(0); + const staffName = ref(''); /** * 用户信息响应式对象 */ - const userInfo = reactive({}); + // const userInfo = reactive({}); - /** - * 订单统计信息响应式对象 - */ - const countInfo = reactive({ - all: 0, - payment: 0, - delivery: 0, - received: 0 - }); + // /** + // * 订单统计信息响应式对象 + // */ + // const countInfo = reactive({ + // all: 0, + // payment: 0, + // delivery: 0, + // received: 0 + // }); onLoad(options => { - + init(); }); - const makePhoneCall = (phoneNumber) => { - console.log(123); - uni.makePhoneCall({ - phoneNumber: phoneNumber, - success: () => { - console.log('拨打电话成功'); - }, - fail: (err) => { - console.error('拨打电话失败:', err); - } - }); - } + // const makePhoneCall = (phoneNumber) => { + // console.log(123); + // uni.makePhoneCall({ + // phoneNumber: phoneNumber, + // success: () => { + // console.log('拨打电话成功'); + // }, + // fail: (err) => { + // console.error('拨打电话失败:', err); + // } + // }); + // } // 获取配置 - const getConfig = () => { - fetchGetConfig().then(res => { - console.log('getConfig=====>', res) - audit.value = res.appConfig.is_audit == 1 - phone.value = res.appConfig.shop_phone - }) + const init = () => { + let user_name = uni.getStorageSync('user_name') + let staff_name = uni.getStorageSync('staff_name') + let role = uni.getStorageSync('role') + let user_id = uni.getStorageSync('uid'); + console.log("staff_name", staff_name); + uid.value = user_id + staffName.value = staff_name + // fetchGetConfig().then(res => { + // console.log('getConfig=====>', res) + // audit.value = res.appConfig.is_audit == 1 + // phone.value = res.appConfig.shop_phone + // }) } /** * 页面显示生命周期钩子 @@ -188,38 +201,37 @@ onShow(() => { console.log('init'); - - let userId = uni.getStorageSync('uid'); - console.log("userId", userId); - uid.value = userId - - // 获取配置 - getConfig() - - - // 如果用户登陆 - if (uid.value > 0) { - - // 获取用户信息 - fetchUserInfo().then(res => { - // if (res.is_bind_phone) { - // navigateTo('/pages/login/phoneAuthorization'); - // return - // } - // 将API返回的数据合并到userInfo响应式对象中 - Object.assign(userInfo, res); - // 显示订单 - showMyOrder.value = true - // 获取订单总数统计 - fetchOrderTotalCount().then(res => { - // 将API返回的数据合并到count_info响应式对象中 - Object.assign(countInfo, res); - }); - }); + init(); - } + // // 获取配置 + // getConfig() + + + // // 如果用户登陆 + // if (uid.value > 0) { + + // // 获取用户信息 + // fetchUserInfo().then(res => { + // // if (res.is_bind_phone) { + // // navigateTo('/pages/login/phoneAuthorization'); + // // return + // // } + // // 将API返回的数据合并到userInfo响应式对象中 + // Object.assign(userInfo, res); + // // 显示订单 + // showMyOrder.value = true + // // 获取订单总数统计 + // fetchOrderTotalCount().then(res => { + // // 将API返回的数据合并到count_info响应式对象中 + // Object.assign(countInfo, res); + // }); + // }); + + + + // } @@ -234,12 +246,12 @@ .user-inner { background: linear-gradient(30deg, rgba(198, 77, 255, 0.99), rgba(102, 204, 255, 0.99)); - height: 150px; - width: calc(100% - 20px); + height: 300rpx; + width: calc(100% - 40rpx); display: flex; align-items: center; - padding: 0px 10px; - gap: 15px; + padding: 0px 20rpx; + gap: 30rpx; } .user-info-style { @@ -249,30 +261,20 @@ } .nickname { - font-size: 20px; - /* 大字体 */ - font-weight: bold; - /* 加粗 */ + font-size: 28rpx; color: #333; - /* 深色文字 */ - margin-bottom: 5px; - /* 与UID的间距 */ + margin-bottom: 10rpx; } .user-id { - font-size: 14px; - /* 小字体 */ + font-size: 26rpx; color: #fff; - /* 浅色文字 */ } .content { display: flex; flex-direction: column; - /* align-items: center; */ - // justify-content: center; background-color: #f2f3f5; - padding: 0px 10px; - // height: calc(100vh - 150px); + padding: 0px 20rpx; } \ No newline at end of file diff --git a/pages/order/detail.vue b/pages/order/detail.vue index 9ecbbc6..1135731 100644 --- a/pages/order/detail.vue +++ b/pages/order/detail.vue @@ -18,19 +18,6 @@ - - @@ -158,20 +135,20 @@ }) } - // 显示支付码 - const showPayImgs = () => { - if (images.value.length === 0) { - uni.showToast({ - title: '暂无图片', - icon: 'none' - }); - return; - } - console.log('preview images:', images); - uni.previewImage({ - urls: images.value - }); - } + // // 显示支付码 + // const showPayImgs = () => { + // if (images.value.length === 0) { + // uni.showToast({ + // title: '暂无图片', + // icon: 'none' + // }); + // return; + // } + // console.log('preview images:', images); + // uni.previewImage({ + // urls: images.value + // }); + // } - - \ No newline at end of file diff --git a/pages/order/housePreview.vue b/pages/order/housePreview.vue deleted file mode 100644 index fef9aee..0000000 --- a/pages/order/housePreview.vue +++ /dev/null @@ -1,396 +0,0 @@ - - - - \ No newline at end of file diff --git a/pages/order/index.vue b/pages/order/index.vue index c94a3f3..83775e4 100644 --- a/pages/order/index.vue +++ b/pages/order/index.vue @@ -1,16 +1,20 @@