This commit is contained in:
ranranran12123 2024-10-31 18:56:04 +08:00
parent e3b9be9244
commit 9340dfc5d7
60 changed files with 1881 additions and 385 deletions

View File

@ -1 +1,2 @@
export const apiImageUrl = 'http://39.101.78.35:6271' // 测试服务器
export const apiImageUrl = 'http://39.101.78.35:6271'
//export const apiImageUrl = 'http://localhost:9999'

View File

@ -1,52 +0,0 @@
// 定义公共的url
//const baseUrl = "https://xiaode.shop:8066/api";
//const webSocketUrl = "wss://xiaode.shop:8066/api/ws/"
const baseUrl = "http://110.42.248.235:8066/api";
const webSocketUrl = "ws://110.42.248.235:8066//api/ws/"
/**
* baseUrl
*/
export const getBaseUrl = () => {
return baseUrl;
}
export const getSocketUrl = () => {
return webSocketUrl;
}
/**
*
* @param {*} params
*/
export const requestUtil = (params:any) => {
let header = { ...params.header };
// 拼接header 带上token
header["token"] = uni.getStorageSync("cookie");
return new Promise((resolve, reject) => {
uni.request({
...params,
method:params.method,
header: header,
url: baseUrl + params.url,
success: (result:any) => {
resolve(result.data);
},
fail: (err:any) => {
uni.showToast({
icon: 'error',
title: '连接服务器失败',
duration: 3000
})
reject(err);
}
});
})
}

View File

@ -174,6 +174,31 @@
"enablePullDownRefresh" : false,
"navigationBarBackgroundColor": "#4095e5"
}
},
{
"path" : "pages/testone/testone",
"style" :
{
"navigationBarTitleText" : "",
"enablePullDownRefresh" : false
}
},
{
"path" : "pages/testfour/testfour",
"style" :
{
"navigationBarTitleText" : "测试页四",
"enablePullDownRefresh" : false
}
},
{
"path" : "pages/three/three",
"style" :
{
"navigationBarTitleText" : "订单",
"enablePullDownRefresh" : false,
"navigationBarBackgroundColor": "#4095e5"
}
}
],
"globalStyle": {

View File

@ -1,76 +1,148 @@
22.42
<template>
<view>
<button @click="printHelloWorld">打印 Hello World</button>
<button @click="startPrinting">打印订单</button>
</view>
</template>
<script setup>
import { ref, onMounted } from 'vue';
const deviceId = ref(uni.getStorageSync('deviceId'));
const serviceId = ref(uni.getStorageSync('serviceId'));
const characteristicId = ref(uni.getStorageSync('characteristicId'));
//
const deviceId = ref(uni.getStorageSync('deviceId')); // ID
const serviceId = ref(uni.getStorageSync('serviceId')); // ID
const characteristicId = ref(uni.getStorageSync('characteristicId')); // ID
function stringToByteArray(str) {
let bytes = [];
for (let i = 0; i < str.length; ++i) {
bytes.push(str.charCodeAt(i));
}
return bytes;
}
const sendPrintCommand = (commands) => {
// setTimeout(async () => {
// try {
uni.writeBLECharacteristicValue({
deviceId: '86:67:7A:48:06:9C',
serviceId: 'e7810a71-73ae-499d-8c15-faa9aef0c3f2',
characteristicId: 'bef8d6c9-9c21-4c9e-b632-bd58c1009f9f',
value: new Uint8Array(commands),
});
// console.log('');
// } catch (error) {
// console.error('', error);
// }
// }, 1000); //
};
const printHelloWorld = async () => {
//
const startPrinting = () => {
if (!characteristicId.value) {
console.error('请先获取特征值ID');
return;
}
const orderNumber = '123456'; //
const itemName = '麻辣烫'; //
const price = '10.00'; //
const commands = [
...[0x1B, 0x40],
...[0x1B, 0x61, 0x00],
...stringToByteArray('Hello World\n'),
...[0x1D, 0x56, 0x00]
];
await sendPrintCommand(commands);
sendPrintCommand(orderNumber, itemName, price);
};
// //
// onMounted(async () => {
// console.log("UID" + characteristicId.value);
//
const generatePrintData = (orderNumber, itemName, price) => {
try {
let priceString;
// //
// try {
// await uni.readBLECharacteristicValue({
// deviceId: deviceId.value,
// serviceId: serviceId.value,
// characteristicId: characteristicId.value,
// });
//
if (price < 0) {
priceString = (-Math.abs(price)).toFixed(2);
} else {
priceString = (price).toFixed(2);
}
// console.log('');
// } catch (error) {
// console.error('', error);
// }
// });
const bufferLength = orderNumber.length + itemName.length + priceString.length + 7; //
const buffer = new ArrayBuffer(bufferLength);
const dataView = new DataView(buffer);
//
dataView.setUint8(0, 0x1B);
dataView.setUint8(1, 0x40);
//
dataView.setUint8(2, 0x1B);
dataView.setUint8(3, 0x21);
dataView.setUint8(4, orderNumber.length);
for (let i = 0; i < orderNumber.length; i++) {
dataView.setUint8(i + 5, orderNumber.charCodeAt(i));
}
//
dataView.setUint8(orderNumber.length + 5, 0x1B);
dataView.setUint8(orderNumber.length + 6, 0x29);
dataView.setUint8(orderNumber.length + 7, itemName.length);
for (let i = 0; i < itemName.length; i++) {
dataView.setUint8(i + orderNumber.length + 8, itemName.charCodeAt(i));
}
//
dataView.setUint8(itemName.length + orderNumber.length + 8, 0x1B);
dataView.setUint8(itemName.length + orderNumber.length + 9, 0x2A);
dataView.setUint8(itemName.length + orderNumber.length + 10, priceString.length);
for (let i = 0; i < priceString.length; i++) {
dataView.setUint8(i + itemName.length + orderNumber.length + 10, priceString.charCodeAt(i));
}
return buffer;
} catch (error) {
console.error('生成打印数据出错', error);
return null;
}
};
//
const sendPrintCommand = (orderNumber, itemName, price) => {
try {
const buffer = generatePrintData(orderNumber, itemName, price);
if (!buffer) {
return;
}
const dataView = new DataView(buffer);
uni.writeBLECharacteristicValue({
deviceId: deviceId.value,
serviceId: serviceId.value,
characteristicId: characteristicId.value, // 使
value: Array.from(new Uint8Array(buffer)),
success: (res) => {
console.log('发送打印指令成功', res);
},
fail: (err) => {
console.error('发送打印指令失败', err);
}
});
} catch (error) {
console.error('发送打印指令出错', error);
}
};
// ID
const getCharacteristicId = async () => {
try {
await uni.getBLEDeviceCharacteristics({
deviceId: deviceId.value,
serviceId: serviceId.value,
success: (res) => {
const characteristics = res.characteristics;
for (let i = 0; i < characteristics.length; i++) {
//
if (characteristics[i].uuid === '已知的特征值UUID') {
characteristicId.value = characteristics[i].uuid;
console.log('找到特征值ID:', characteristicId.value);
//
sendPrintCommand(); // 使
break;
}
}
},
fail: (err) => {
console.error('获取特征值失败', err);
}
});
} catch (error) {
console.error('获取特征值出错', error);
}
};
//
onMounted(async () => {
if (deviceId.value && serviceId.value) {
// ID
if (characteristicId.value) {
console.log('已知特征值ID:', characteristicId.value);
} else {
// ID
await getCharacteristicId();
}
}
});
</script>

View File

@ -1,28 +1,54 @@
<script setup lang="ts">
import { ref,onMounted,computed,onUnmounted,watch } from 'vue'
import list from "./list.vue"
import finish from "./finish/finish.vue"
import cancel from "./cancel/cancel.vue"
import {apiImageUrl} from '../../API/api'
import { ref,onMounted,computed,onUnmounted } from 'vue'
const currentIndex = ref(0);
const tabs = ref([
{ name: '待出餐' },
{ name: '已完成' },
{ name: '已取消' },
{ name: '已完成' },
]);
const switchTab = (index) => {
currentIndex.value = index;
};
const orderList = ref([]);
const getOrder = () => {
uni.request({
url: apiImageUrl + '/api/orders/my/page',
method: 'POST',
data: {
current: 1,
endTime: "",
id: "",
pageSize: 100,
pickupMethod: 0,
sortField: "",
sortOrder: "",
startTime: "",
state: 0
},
success(res) {
console.log(res);
orderList.value = res.data.data.records.reverse();
console.log(orderList.value);
},
fail() {
console.log('出错啦');
}
});
};
onMounted(() => {
getOrder();
});
</script>
<template>
<scroll-view scroll-y class="preview">
<!-- 商品详情 -->
<view class="tab-menu">
<view class="tab-item"
v-for="(tab, index) in tabs"
@ -34,23 +60,166 @@ import cancel from "./cancel/cancel.vue"
</view>
<view class="content">
<block v-if="currentIndex === 0">
<list></list>
<view class="container1" v-for="(order, index) in orderList" :key="index">
<view class="box">
<view class="numberState">
<view class="number">
#{{ order.id }}
</view>
<view class="state">
商家已自动接单
</view>
</view>
<view class="time">
立即送达/{{ order.createTime }}前送达
</view>
<view class="message">
<view class="name">
柿子先生
</view>
<view class="phone">
手机尾号{{order.phone}}
</view>
</view>
<view class="button">
门店新客
</view>
<view class="button">
美团外卖会员
</view>
<view class="sure">
确认出餐
</view>
</view>
<view class="box2">
<view class="beizhu">
顾客需要餐具
</view>
<view class="goods">
1种商品共1件
</view>
<view class="money">
预计收入{{ order.totalPrice }}
</view>
</view>
</view>
</block>
<block v-if="currentIndex === 1">
<finish></finish>
</block>
<view class="container1" v-for="(order, index) in orderList" :key="index">
<view class="box">
<view class="numberState">
<view class="number">
#{{ order.id }}
</view>
<view class="state">
已取消
</view>
</view>
<view class="time">
立即送达/{{ order.createTime }}前送达
</view>
<view class="message">
<view class="name">
柿子先生
</view>
<view class="phone">
手机尾号{{order.phone}}
</view>
</view>
<view class="km">
1.5km|点击查看配送地址 >
</view>
<view class="button">
门店新客
</view>
<view class="button">
美团外卖会员
</view>
</view>
</view>
</block>
<block v-if="currentIndex === 2">
<cancel></cancel>
<view class="container1" v-for="(order, index) in orderList" :key="index">
<view class="box">
<view class="numberState">
<view class="number">
#{{ order.id }}
</view>
<view class="state">
已完成
</view>
</view>
<view class="time">
立即送达/{{ order.createTime }}前送达
</view>
<view class="message">
<view class="name">
柿子先生
</view>
<view class="phone">
手机尾号{{order.phone}}
</view>
</view>
<view class="km">
1.5km|点击查看配送地址 >
</view>
<view class="button">
门店新客
</view>
<view class="button">
美团外卖会员
</view>
<view class="sure">
打印小票
</view>
</view>
</view>
</block>
</view>
</scroll-view>
</template>
<style lang="scss">
.tabs {
display: flex;
justify-content: space-around;
line-height: 60rpx;
margin: 0 10rpx;
background-color: #fff;
box-shadow: 0 4rpx 6rpx rgba(240, 240, 240, 0.6);
position: relative;
z-index: 9;
.item {
flex: 1;
text-align: center;
padding: 20rpx;
font-size: 28rpx;
color: #262626;
}
.cursor {
position: absolute;
left: 0;
bottom: 0;
width: 18%;
height: 6rpx;
padding: 0 50rpx;
background-color: #4095e5;
/* 过渡效果 */
transition: all 0.4s;
}
}
.preview image {
width: 100%;
}
page {
background-color: #f5f5f5;
height: 100%;
overflow: hidden;
background-color: #f5f5f5;
}
.tab-menu {
display: flex;
justify-content: space-around;
@ -65,10 +234,143 @@ page {
color: #4095e5;
font-weight: bold;
}
.container {
align-items: center;
padding: 20rpx;
.scroll-view {
/* #ifndef APP-NVUE */
width: 100%;
height: 100%;
/* #endif */
flex:1
}
.orderItem {
width: 100%;
height: 80px;
margin-bottom: 10px;
background-color: #fff;
}
.orderImg {
display: inline-block;
width: 20%;
height: 100%;
margin: auto 0;
}
.img {
width: 100%;
height: 100%;
border-radius: 15px;
}
.orderMessage {
width: 75%;
height: 80%;
float: right;
display: inline-block;
margin-top: 10px;
}
.money {
font-size: 30rpx;
font-weight: 700;
}
.time {
font-size: 25rpx;
}
.container {
width: 90%;
height: 100vh;
margin: 0 auto;
}
.container1 {
width: 80%;
margin: 0 auto;
background-color: #fff;
margin-bottom: 20px;
}
.numberState {
height: 80rpx;
}
.number {
font-weight: 700;
font-size: 60rpx;
float: left;
}
.state {
font-size: 30rpx;
font-weight: 700;
float: right;
margin-top: 15rpx;
}
.time {
font-size: 30rpx;
color: #999;
padding-bottom: 10px;
border-bottom: 1px dotted #787878;
}
.message {
padding-top: 15rpx;
height: 70rpx;
}
.name {
font-size: 45rpx;
font-weight: 700;
float: left;
}
.phone {
float: left;
font-size: 30rpx;
line-height: 70rpx;
padding-left: 10rpx;
color: #787878;
}
.km {
font-size: 30rpx;
padding-top: 5px;
color: #787878;
margin-bottom: 10px;
}
.button{
display: inline;
color: #787878;
padding: 5px 10px 5px 10px;
border: 1px solid gray;
margin-right: 10px;
font-size: 24rpx;
border-radius: 5px;
margin-top: 10px;
}
.sure {
display: block;
font-size: 30rpx;
background-color: #c1c1c1;
color: #000;
border-radius: 5px;
padding: 10px;
width: 65px;
margin-left: 220px;
}
.box {
padding-bottom: 30px;
border-bottom: 1px dotted #787878;
}
.beizhu{
font-size: 40rpx;
font-weight: 700;
padding-bottom: 15px;
padding-top: 10px;
background: linear-gradient(to bottom, #fde16d, #fff);
}
.goods {
float: left;
font-size: 40rpx;
font-weight: 700;
}
.money {
font-size: 30rpx;
float: right;
margin-top: 5px;
}
.box2 {
padding-bottom: 50px;
border-bottom: 1px dotted #787878;
}
</style>

View File

@ -87,7 +87,9 @@ const getLoginUser = () => {
},
data: {},
success: (res) => {
console.log(res.data.message)//ok
console.log(res.data.data.id)
uni.setStorageSync('businessId', res.data.data.id);
console.log(res.data.data);
user.value.message=res.data.message
if(user.value.message==='ok')
{
@ -132,57 +134,53 @@ const logout = () => {
});
};
const avatarUrl = uni.getStorageSync('avatarUrl') || '';
const username = uni.getStorageSync('username') || '';
const phone = uni.getStorageSync('phone') || '';
const userId = uni.getStorageSync('id') || '';
const businessId = uni.getStorageSync('businessId') || '';
const storeStatus = ref(0);
/* const handleSwitchChange = (value) => {
const storeStatus = value ? 1 : 0;
console.log(storeStatus+"值为"); */
const handleSwitchChange = () => {
storeStatus.value = storeStatus.value === 0 ? 1 : 0;
console.log('当前状态:', storeStatus.value);
//
const [storeStatus, setStoreStatus] = useState(0);
// handleSwitchChange
const handleSwitchChange = (value) => {
const newStoreStatus = value ? 1 : 0;
setStoreStatus(newStoreStatus); //
console.log(`storeStatus值为: ${newStoreStatus}`);
/* const data = {
const data = {
address: '',
businessAvatar: 'https://tse4-mm.cn.bing.net/th/id/OIP-C.vNYHZ0vsWMLi4nfLG4rWEwHaE7?rs=1&pid=ImgDetMain',
businessImages: 'https://tse4-mm.cn.bing.net/th/id/OIP-C.vNYHZ0vsWMLi4nfLG4rWEwHaE7?rs=1&pid=ImgDetMain',
businessName: '麻辣烫',
businessPhone: '',
businessAvatar:avatarUrl,
businessImages: avatarUrl,
businessName: username,
businessPhone: phone,
/* businessAvatar:'https://tse2-mm.cn.bing.net/th/id/OIP-C.wq-7irlVpAizKGvyvO0BNQHaFj?rs=1&pid=ImgDetMain',
businessImages: 'https://tse2-mm.cn.bing.net/th/id/OIP-C.wq-7irlVpAizKGvyvO0BNQHaFj?rs=1&pid=ImgDetMain',
businessName: '麻辣烫',
businessPhone: '13613639360', */
businessProfile: '',
categoryId: 0,
endBusiness: '',
id: 1830063677349658625,
id: businessId,
startBusiness: '',
state: 0,
storeStatus: 1,
userId: 0
storeStatus: storeStatus.value,
userId: userId
};
uni.request({
url:apiImageUrl+'/api/business/update/my',
method:'POST',
header: {
'content-type': 'application/json'
},
data: data,
success(res) {
console.log('Success:', res.data);
},
fail() {
console.error('Error:', error);
}
}) */
};
method:'POST',
header: {
'content-type': 'application/json'
},
data: data,
success(res) {
console.log('Success:', res.data);
},
fail() {
console.error('Error:', error);
}
})
};
</script>

View File

@ -1,5 +1,5 @@
<script setup lang="ts">
//import {apiImageUrl} from '../../API/api'
import {apiImageUrl} from '../../API/api'
import { ref,onMounted,computed,onUnmounted } from 'vue'
const currentIndex = ref(0);
@ -9,37 +9,41 @@ import { ref,onMounted,computed,onUnmounted } from 'vue'
{ name: '退款' }
]);
const switchTab = (index) => {
currentIndex.value = index;
};
const orderList= ref([
{
imgUrl: 'https://img.zcool.cn/community/015ac85f110b9fa801206621387957.png@1280w_1l_2o_100sh.png',
money:13,
time:'2024-03-15 11:15:10',
orderNumber:4568415846158841
},
{
imgUrl: 'https://img.zcool.cn/community/015ac85f110b9fa801206621387957.png@1280w_1l_2o_100sh.png',
money:12,
time:'2024-03-15 11:15:10',
orderNumber:4568415846158841
},
{
imgUrl: 'https://img.zcool.cn/community/0105ec5b5ac3cba801206a35cf08a8.jpg@1280w_1l_2o_100sh.jpg',
money:123,
time:'2024-03-15 11:15:10',
orderNumber:4568415846158841
},
{
imgUrl: 'https://img.zcool.cn/community/015ac85f110b9fa801206621387957.png@1280w_1l_2o_100sh.png',
money:123,
time:'2024-03-15 11:15:10',
orderNumber:4568415846158841
}
])
const orderList = ref([]);
const getOrder = () => {
uni.request({
url: apiImageUrl + '/api/orders/my/page',
method: 'POST',
data: {
current: 1,
endTime: "",
id: "",
pageSize: 100,
pickupMethod: 0,
sortField: "",
sortOrder: "",
startTime: "",
state: 0
},
success(res) {
console.log(res);
orderList.value = res.data.data.records;
console.log(orderList.value);
},
fail() {
console.log('出错啦');
}
});
};
// 使 onMounted
onMounted(() => {
getOrder();
});
</script>
<template>
@ -57,49 +61,49 @@ import { ref,onMounted,computed,onUnmounted } from 'vue'
<view class="content">
<block v-if="currentIndex === 0">
<view class="container">
<view class="orderItem" v-for="(item,index) in orderList" :key="index">
<view class="orderItem" v-for="(order, index) in orderList" :key="index">
<view class="orderImg">
<image :src="item.imgUrl" class="img"></image>
<image src="https://tse4-mm.cn.bing.net/th/id/OIP-C.cDfrXgI1DKvU7OklwmBfewHaHa?rs=1&pid=ImgDetMain" class="img"></image>
</view>
<view class="orderMessage">
<text class="money">+{{ order.totalPrice }}</text>
<br />
<text class="time">下单时间:{{ order.createTime }}</text>
<br />
<text class="time">订单编号:{{ order.id }}</text>
</view>
<view class="orderMessage">
<text class="money">+{{item.money}}</text>
<br />
<text class="time">下单时间:{{item.time}}</text>
<br />
<text class="time">订单编号:{{item.orderNumber}}</text>
</view>
</view>
</view>
</block>
<block v-if="currentIndex === 1">
<view class="container">
<view class="orderItem" v-for="(item,index) in orderList" :key="index">
<view class="orderImg">
<image :src="item.imgUrl" class="img"></image>
</view>
<view class="orderMessage">
<text class="money">+{{item.money}}</text>
<br />
<text class="time">下单时间:{{item.time}}</text>
<br />
<text class="time">订单编号:{{item.orderNumber}}</text>
</view>
</view>
</view>
<view class="container">
<view class="orderItem" v-for="(order, index) in orderList" :key="index">
<view class="orderImg">
<image src="https://tse4-mm.cn.bing.net/th/id/OIP-C.cDfrXgI1DKvU7OklwmBfewHaHa?rs=1&pid=ImgDetMain" class="img"></image>
</view>
<view class="orderMessage">
<text class="money">+{{ order.totalPrice }}</text>
<br />
<text class="time">下单时间:{{ order.createTime }}</text>
<br />
<text class="time">订单编号:{{ order.id }}</text>
</view>
</view>
</view>
</block>
<block v-if="currentIndex === 2">
<view class="container">
<view class="orderItem" v-for="(item,index) in orderList" :key="index">
<view class="orderItem" v-for="(order, index) in orderList" :key="index">
<view class="orderImg">
<image :src="item.imgUrl" class="img"></image>
<image src="https://tse4-mm.cn.bing.net/th/id/OIP-C.cDfrXgI1DKvU7OklwmBfewHaHa?rs=1&pid=ImgDetMain" class="img"></image>
</view>
<view class="orderMessage">
<text class="money">+{{ order.totalPrice }}</text>
<br />
<text class="time">下单时间:{{ order.createTime.substr(0, 29).replace('T', ' ') }}</text>
<br />
<text class="time">订单编号:{{ order.id }}</text>
</view>
<view class="orderMessage">
<text class="money">+{{item.money}}</text>
<br />
<text class="time">下单时间:{{item.time}}</text>
<br />
<text class="time">订单编号:{{item.orderNumber}}</text>
</view>
</view>
</view>
</block>

View File

@ -0,0 +1,13 @@
<template>
<view>
测试页面4
</view>
</template>
<script>
</script>
<style>
</style>

View File

@ -0,0 +1,50 @@
<template>
<div>
<button @click="handleSwitchChange">点击我</button>
<p>当前状态: {{ storeStatus }}</p>
</div>
</template>
<script setup>
import { apiImageUrl } from '../../API/api';
import { ref } from 'vue';
const storeStatus = ref(0);
const handleSwitchChange = () => {
storeStatus.value = storeStatus.value === 0 ? 1 : 0;
console.log('当前状态:', storeStatus.value);
const data = {
address: '',
businessAvatar: 'https://tse4-mm.cn.bing.net/th/id/OIP-C.vNYHZ0vsWMLi4nfLG4rWEwHaE7?rs=1&pid=ImgDetMain',
businessImages: 'https://tse4-mm.cn.bing.net/th/id/OIP-C.vNYHZ0vsWMLi4nfLG4rWEwHaE7?rs=1&pid=ImgDetMain',
businessName: '麻辣烫',
businessPhone: '',
businessProfile: '',
categoryId: 0,
endBusiness: '',
id: 1830063677349658625,
startBusiness: '',
state: 0,
storeStatus: storeStatus.value,
userId: 0
};
uni.request({
url:apiImageUrl+'/api/business/update/my',
method:'POST',
header: {
'content-type': 'application/json'
},
data: data,
success(res) {
console.log('Success:', res.data);
},
fail() {
console.error('Error:', error);
}
})
};
</script>

View File

@ -0,0 +1,376 @@
<script setup lang="ts">
import {apiImageUrl} from '../../API/api'
import { ref,onMounted,computed,onUnmounted } from 'vue'
const currentIndex = ref(0);
const tabs = ref([
{ name: '待出餐' },
{ name: '已取消' },
{ name: '已完成' },
]);
const switchTab = (index) => {
currentIndex.value = index;
};
const orderList = ref([]);
const getOrder = () => {
uni.request({
url: apiImageUrl + '/api/orders/my/page',
method: 'POST',
data: {
current: 1,
endTime: "",
id: "",
pageSize: 100,
pickupMethod: 0,
sortField: "",
sortOrder: "",
startTime: "",
state: 0
},
success(res) {
console.log(res);
orderList.value = res.data.data.records.reverse();
console.log(orderList.value);
},
fail() {
console.log('出错啦');
}
});
};
onMounted(() => {
getOrder();
});
</script>
<template>
<scroll-view scroll-y class="preview">
<!-- 商品详情 -->
<view class="tab-menu">
<view class="tab-item"
v-for="(tab, index) in tabs"
:key="index"
:class="{active: currentIndex === index}"
@click="switchTab(index)">
{{ tab.name }}
</view>
</view>
<view class="content">
<block v-if="currentIndex === 0">
<view class="container1" v-for="(order, index) in orderList" :key="index">
<view class="box">
<view class="numberState">
<view class="number">
#{{ order.id }}
</view>
<view class="state">
商家已自动接单
</view>
</view>
<view class="time">
立即送达/{{ order.createTime }}前送达
</view>
<view class="message">
<view class="name">
柿子先生
</view>
<view class="phone">
手机尾号{{order.phone}}
</view>
</view>
<view class="button">
门店新客
</view>
<view class="button">
美团外卖会员
</view>
<view class="sure">
确认出餐
</view>
</view>
<view class="box2">
<view class="beizhu">
顾客需要餐具
</view>
<view class="goods">
1种商品共1件
</view>
<view class="money">
预计收入{{ order.totalPrice }}
</view>
</view>
</view>
</block>
<block v-if="currentIndex === 1">
<view class="container1" v-for="(order, index) in orderList" :key="index">
<view class="box">
<view class="numberState">
<view class="number">
#{{ order.id }}
</view>
<view class="state">
已取消
</view>
</view>
<view class="time">
立即送达/{{ order.createTime }}前送达
</view>
<view class="message">
<view class="name">
柿子先生
</view>
<view class="phone">
手机尾号{{order.phone}}
</view>
</view>
<view class="km">
1.5km|点击查看配送地址 >
</view>
<view class="button">
门店新客
</view>
<view class="button">
美团外卖会员
</view>
</view>
</view>
</block>
<block v-if="currentIndex === 2">
<view class="container1" v-for="(order, index) in orderList" :key="index">
<view class="box">
<view class="numberState">
<view class="number">
#{{ order.id }}
</view>
<view class="state">
已完成
</view>
</view>
<view class="time">
立即送达/{{ order.createTime }}前送达
</view>
<view class="message">
<view class="name">
柿子先生
</view>
<view class="phone">
手机尾号{{order.phone}}
</view>
</view>
<view class="km">
1.5km|点击查看配送地址 >
</view>
<view class="button">
门店新客
</view>
<view class="button">
美团外卖会员
</view>
<view class="sure">
打印小票
</view>
</view>
</view>
</block>
</view>
</scroll-view>
</template>
<style lang="scss">
.tabs {
display: flex;
justify-content: space-around;
line-height: 60rpx;
margin: 0 10rpx;
background-color: #fff;
box-shadow: 0 4rpx 6rpx rgba(240, 240, 240, 0.6);
position: relative;
z-index: 9;
.item {
flex: 1;
text-align: center;
padding: 20rpx;
font-size: 28rpx;
color: #262626;
}
.cursor {
position: absolute;
left: 0;
bottom: 0;
width: 18%;
height: 6rpx;
padding: 0 50rpx;
background-color: #4095e5;
/* 过渡效果 */
transition: all 0.4s;
}
}
.preview image {
width: 100%;
}
page {
height: 100%;
overflow: hidden;
background-color: #f5f5f5;
}
.tab-menu {
display: flex;
justify-content: space-around;
padding: 10px 0;
background-color: #f5f5f5;
}
.tab-item {
padding: 10px;
cursor: pointer;
}
.tab-item.active {
color: #4095e5;
font-weight: bold;
}
.scroll-view {
/* #ifndef APP-NVUE */
width: 100%;
height: 100%;
/* #endif */
flex:1
}
.orderItem {
width: 100%;
height: 80px;
margin-bottom: 10px;
background-color: #fff;
}
.orderImg {
display: inline-block;
width: 20%;
height: 100%;
margin: auto 0;
}
.img {
width: 100%;
height: 100%;
border-radius: 15px;
}
.orderMessage {
width: 75%;
height: 80%;
float: right;
display: inline-block;
margin-top: 10px;
}
.money {
font-size: 30rpx;
font-weight: 700;
}
.time {
font-size: 25rpx;
}
.container {
width: 90%;
height: 100vh;
margin: 0 auto;
}
.container1 {
width: 80%;
margin: 0 auto;
background-color: #fff;
margin-bottom: 20px;
}
.numberState {
height: 80rpx;
}
.number {
font-weight: 700;
font-size: 60rpx;
float: left;
}
.state {
font-size: 30rpx;
font-weight: 700;
float: right;
margin-top: 15rpx;
}
.time {
font-size: 30rpx;
color: #999;
padding-bottom: 10px;
border-bottom: 1px dotted #787878;
}
.message {
padding-top: 15rpx;
height: 70rpx;
}
.name {
font-size: 45rpx;
font-weight: 700;
float: left;
}
.phone {
float: left;
font-size: 30rpx;
line-height: 70rpx;
padding-left: 10rpx;
color: #787878;
}
.km {
font-size: 30rpx;
padding-top: 5px;
color: #787878;
margin-bottom: 10px;
}
.button{
display: inline;
color: #787878;
padding: 5px 10px 5px 10px;
border: 1px solid gray;
margin-right: 10px;
font-size: 24rpx;
border-radius: 5px;
margin-top: 10px;
}
.sure {
display: block;
font-size: 30rpx;
background-color: #c1c1c1;
color: #000;
border-radius: 5px;
padding: 10px;
width: 65px;
margin-left: 220px;
}
.box {
padding-bottom: 30px;
border-bottom: 1px dotted #787878;
}
.beizhu{
font-size: 40rpx;
font-weight: 700;
padding-bottom: 15px;
padding-top: 10px;
background: linear-gradient(to bottom, #fde16d, #fff);
}
.goods {
float: left;
font-size: 40rpx;
font-weight: 700;
}
.money {
font-size: 30rpx;
float: right;
margin-top: 5px;
}
.box2 {
padding-bottom: 50px;
border-bottom: 1px dotted #787878;
}
</style>

View File

@ -1 +1 @@
{"version":3,"file":"app.js","sources":["../../../../App.vue","../../../../main.js"],"sourcesContent":null,"names":["createSSRApp"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACC,MAAK,YAAU;AAAA,EACd,UAAU,WAAW;AACpB,YAAQ,IAAI,YAAY;AAAA,EACxB;AAAA,EACD,QAAQ,WAAW;AAClB,YAAQ,IAAI,UAAU;AAAA,EACtB;AAAA,EACD,QAAQ,WAAW;AAClB,YAAQ,IAAI,UAAU;AAAA,EACvB;AACD;;ACIM,SAAS,YAAY;AAC1B,QAAM,MAAMA,cAAY,aAAC,GAAG;AAC5B,SAAO;AAAA,IACL;AAAA,EACD;AACH;AACC,YAAO,IAAA,MAAA,MAAA;;"}
{"version":3,"file":"app.js","sources":["../../../../App.vue","../../../../main.js"],"sourcesContent":null,"names":["createSSRApp"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AACC,MAAK,YAAU;AAAA,EACd,UAAU,WAAW;AACpB,YAAQ,IAAI,YAAY;AAAA,EACxB;AAAA,EACD,QAAQ,WAAW;AAClB,YAAQ,IAAI,UAAU;AAAA,EACtB;AAAA,EACD,QAAQ,WAAW;AAClB,YAAQ,IAAI,UAAU;AAAA,EACvB;AACD;;ACIM,SAAS,YAAY;AAC1B,QAAM,MAAMA,cAAY,aAAC,GAAG;AAC5B,SAAO;AAAA,IACL;AAAA,EACD;AACH;AACC,YAAO,IAAA,MAAA,MAAA;;"}

View File

@ -1 +0,0 @@
{"version":3,"file":"cancel.js","sources":[],"sourcesContent":null,"names":[],"mappings":";;;;;;;;"}

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
{"version":3,"file":"finish.js","sources":[],"sourcesContent":null,"names":[],"mappings":";;;;;;;;"}

View File

@ -1 +0,0 @@
{"version":3,"file":"list.js","sources":[],"sourcesContent":null,"names":[],"mappings":";;;;;;;;"}

View File

@ -1 +1 @@
{"version":3,"file":"distribution.js","sources":["../../../../../../pages/distribution/distribution.vue","../../../../../../../../大二上/HTML5/HBuilderX.3.5.3.20220729/HBuilderX/plugins/uniapp-cli-vite/uniPage:/cGFnZXMvZGlzdHJpYnV0aW9uL2Rpc3RyaWJ1dGlvbi52dWU"],"sourcesContent":null,"names":["ref","uni"],"mappings":";;;;;AASiBA,kBAAAA,IAAIC,cAAG,MAAC,eAAe,UAAU,CAAC;AACjCD,kBAAAA,IAAIC,cAAG,MAAC,eAAe,WAAW,CAAC;AACrD,UAAM,mBAAmBD,cAAAA,IAAIC,cAAAA,MAAI,eAAe,kBAAkB,CAAC;AAGnE,aAAS,kBAAkB,KAAK;AAC9B,UAAI,QAAQ,CAAA;AACZ,eAAS,IAAI,GAAG,IAAI,IAAI,QAAQ,EAAE,GAAG;AACnC,cAAM,KAAK,IAAI,WAAW,CAAC,CAAC;AAAA,MAC7B;AACD,aAAO;AAAA,IACT;AAGA,UAAM,mBAAmB,CAAC,aAAa;AAGjCA,oBAAAA,MAAI,4BAA4B;AAAA,QAC9B,UAAU;AAAA,QACV,WAAW;AAAA,QACX,kBAAkB;AAAA,QAClB,OAAO,IAAI,WAAW,QAAQ;AAAA,MACtC,CAAO;AAAA,IAOP;AAGA,UAAM,kBAAkB,YAAY;AAClC,UAAI,CAAC,iBAAiB,OAAO;AAC3B,gBAAQ,MAAM,WAAW;AACzB;AAAA,MACD;AAGD,YAAM,WAAW;AAAA,QACf,GAAG,CAAC,IAAM,EAAI;AAAA,QACd,GAAG,CAAC,IAAM,IAAM,CAAI;AAAA,QACpB,GAAG,kBAAkB,eAAe;AAAA,QACpC,GAAG,CAAC,IAAM,IAAM,CAAI;AAAA,MACxB;AAEE,YAAM,iBAAiB,QAAQ;AAAA,IACjC;;;;;;;;;ACvDA,GAAG,WAAW,eAAe;"}
{"version":3,"file":"distribution.js","sources":["../../../../../../pages/distribution/distribution.vue","../../../../../../../../大二上/HTML5/HBuilderX.3.5.3.20220729/HBuilderX/plugins/uniapp-cli-vite/uniPage:/cGFnZXMvZGlzdHJpYnV0aW9uL2Rpc3RyaWJ1dGlvbi52dWU"],"sourcesContent":null,"names":["ref","uni","onMounted"],"mappings":"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"}

View File

@ -1 +1 @@
{"version":3,"file":"cancel.js","sources":["../../../../../../../../../大二上/HTML5/HBuilderX.3.5.3.20220729/HBuilderX/plugins/uniapp-cli-vite/uniPage:/cGFnZXMvaW5kZXgvY2FuY2VsL2NhbmNlbC52dWU"],"sourcesContent":null,"names":["MiniProgramPage"],"mappings":";;;AACA,GAAG,WAAWA,OAAe,eAAA;"}
{"version":3,"file":"cancel.js","sources":["../../../../../../../../../大二上/HTML5/HBuilderX.3.5.3.20220729/HBuilderX/plugins/uniapp-cli-vite/uniPage:/cGFnZXMvaW5kZXgvY2FuY2VsL2NhbmNlbC52dWU"],"sourcesContent":null,"names":[],"mappings":";;;;;;;AACA,GAAG,WAAW,eAAe;"}

View File

@ -1 +0,0 @@
{"version":3,"file":"cancel2.js","sources":["../../../../../../../../../大二上/HTML5/HBuilderX.3.5.3.20220729/HBuilderX/plugins/uniapp-cli-vite/uniPage:/RDovMTExMTExMDAwMDAwL3VuaWFwcDA1L3BhZ2VzL2luZGV4L2NhbmNlbC9jYW5jZWwudnVl"],"sourcesContent":null,"names":["MiniProgramPage"],"mappings":";;;AACA,GAAG,WAAWA,OAAe,eAAA;"}

View File

@ -1 +1 @@
{"version":3,"file":"finish.js","sources":["../../../../../../../../../大二上/HTML5/HBuilderX.3.5.3.20220729/HBuilderX/plugins/uniapp-cli-vite/uniPage:/cGFnZXMvaW5kZXgvZmluaXNoL2ZpbmlzaC52dWU"],"sourcesContent":null,"names":["MiniProgramPage"],"mappings":";;;AACA,GAAG,WAAWA,OAAe,eAAA;"}
{"version":3,"file":"finish.js","sources":["../../../../../../../../../大二上/HTML5/HBuilderX.3.5.3.20220729/HBuilderX/plugins/uniapp-cli-vite/uniPage:/cGFnZXMvaW5kZXgvZmluaXNoL2ZpbmlzaC52dWU"],"sourcesContent":null,"names":[],"mappings":";;;;;;;AACA,GAAG,WAAW,eAAe;"}

View File

@ -1 +0,0 @@
{"version":3,"file":"finish2.js","sources":["../../../../../../../../../大二上/HTML5/HBuilderX.3.5.3.20220729/HBuilderX/plugins/uniapp-cli-vite/uniPage:/RDovMTExMTExMDAwMDAwL3VuaWFwcDA1L3BhZ2VzL2luZGV4L2ZpbmlzaC9maW5pc2gudnVl"],"sourcesContent":null,"names":["MiniProgramPage"],"mappings":";;;AACA,GAAG,WAAWA,OAAe,eAAA;"}

View File

@ -1 +1 @@
{"version":3,"file":"index.js","sources":["../../../../../../pages/index/index.vue","../../../../../../../../大二上/HTML5/HBuilderX.3.5.3.20220729/HBuilderX/plugins/uniapp-cli-vite/uniPage:/cGFnZXMvaW5kZXgvaW5kZXgudnVl"],"sourcesContent":null,"names":["ref"],"mappings":";;;;;AAEA,MAAA,OAAiB,MAAA;AACjB,MAAA,SAAmB,MAAA;AACnB,MAAA,SAAmB,MAAA;;;;AAGT,UAAA,eAAeA,kBAAI,CAAC;AAC1B,UAAM,OAAOA,cAAAA,IAAI;AAAA,MACf,EAAE,MAAM,MAAM;AAAA,MACd,EAAE,MAAM,MAAM;AAAA,MACd,EAAE,MAAM,MAAM;AAAA,IAAA,CACf;AAGK,UAAA,YAAY,CAAC,UAAU;AAC3B,mBAAa,QAAQ;AAAA,IAAA;;;;;;;;;;;;;;;;;;;;;ACf3B,GAAG,WAAW,eAAe;"}
{"version":3,"file":"index.js","sources":["../../../../../../pages/index/index.vue","../../../../../../../../大二上/HTML5/HBuilderX.3.5.3.20220729/HBuilderX/plugins/uniapp-cli-vite/uniPage:/cGFnZXMvaW5kZXgvaW5kZXgudnVl"],"sourcesContent":null,"names":["ref","uni","apiImageUrl","onMounted"],"mappings":";;;;;;AAIU,UAAA,eAAeA,kBAAI,CAAC;AAC1B,UAAM,OAAOA,cAAAA,IAAI;AAAA,MACf,EAAE,MAAM,MAAM;AAAA,MACd,EAAE,MAAM,MAAM;AAAA,MACd,EAAE,MAAM,MAAM;AAAA,IAAA,CACf;AAEK,UAAA,YAAY,CAAC,UAAU;AAC3B,mBAAa,QAAQ;AAAA,IAAA;AAErB,UAAA,YAAYA,kBAAI,CAAA,CAAE;AAExB,UAAM,WAAW,MAAM;AACrBC,oBAAAA,MAAI,QAAQ;AAAA,QACV,KAAKC,QAAc,cAAA;AAAA,QACnB,QAAQ;AAAA,QACR,MAAM;AAAA,UACJ,SAAS;AAAA,UACT,SAAS;AAAA,UACT,IAAI;AAAA,UACJ,UAAU;AAAA,UACV,cAAc;AAAA,UACd,WAAW;AAAA,UACX,WAAW;AAAA,UACX,WAAW;AAAA,UACX,OAAO;AAAA,QACT;AAAA,QACA,QAAQ,KAAK;AACX,kBAAQ,IAAI,GAAG;AACf,oBAAU,QAAQ,IAAI,KAAK,KAAK,QAAQ;AAChC,kBAAA,IAAI,UAAU,KAAK;AAAA,QAE7B;AAAA,QACA,OAAO;AACL,kBAAQ,IAAI,KAAK;AAAA,QACnB;AAAA,MAAA,CACD;AAAA,IAAA;AAGHC,kBAAAA,UAAU,MAAM;AACL;IAAA,CACV;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC5CD,GAAG,WAAW,eAAe;"}

View File

@ -1 +1 @@
{"version":3,"file":"list.js","sources":["../../../../../../../../大二上/HTML5/HBuilderX.3.5.3.20220729/HBuilderX/plugins/uniapp-cli-vite/uniPage:/cGFnZXMvaW5kZXgvbGlzdC52dWU"],"sourcesContent":null,"names":["MiniProgramPage"],"mappings":";;;AACA,GAAG,WAAWA,KAAe,eAAA;"}
{"version":3,"file":"list.js","sources":["../../../../../../../../大二上/HTML5/HBuilderX.3.5.3.20220729/HBuilderX/plugins/uniapp-cli-vite/uniPage:/cGFnZXMvaW5kZXgvbGlzdC52dWU"],"sourcesContent":null,"names":[],"mappings":";;;;;;;AACA,GAAG,WAAW,eAAe;"}

View File

@ -1 +0,0 @@
{"version":3,"file":"list2.js","sources":["../../../../../../../../大二上/HTML5/HBuilderX.3.5.3.20220729/HBuilderX/plugins/uniapp-cli-vite/uniPage:/RDovMTExMTExMDAwMDAwL3VuaWFwcDA1L3BhZ2VzL2luZGV4L2xpc3QudnVl"],"sourcesContent":null,"names":["MiniProgramPage"],"mappings":";;;AACA,GAAG,WAAWA,KAAe,eAAA;"}

View File

@ -1 +1 @@
{"version":3,"file":"my.js","sources":["../../../../../../pages/my/my.vue","../../../../../../../../大二上/HTML5/HBuilderX.3.5.3.20220729/HBuilderX/plugins/uniapp-cli-vite/uniPage:/cGFnZXMvbXkvbXkudnVl"],"sourcesContent":null,"names":["onShow","ref","uni","apiImageUrl"],"mappings":";;;;;;;;;;;;;;AAuEAA,kBAAAA,OAAO,MAAM;AACX;IACF,CAAC;AACD,UAAM,OAAOC,cAAAA,IAAI;AAAA,MACf,YAAY;AAAA,MACZ,UAAU;AAAA,MACV,SAAQ;AAAA,IACV,CAAC;AACD,UAAM,eAAe,MAAM;AACzBC,oBAAAA,MAAI,QAAQ;AAAA;AAAA,QAEV,KAAKC,QAAW,cAAG;AAAA,QACnB,QAAQ;AAAA,QACR,QAAQ;AAAA,UACN,UAAUD,cAAAA,MAAI,eAAe,QAAQ;AAAA,QACtC;AAAA,QACD,MAAM,CAAE;AAAA,QACV,SAAS,CAAC,QAAQ;AACjB,kBAAQ,IAAI,IAAI,KAAK,OAAO;AAC5B,eAAK,MAAM,UAAQ,IAAI,KAAK;AAC5B,cAAG,KAAK,MAAM,YAAU,MACxB;AACC,iBAAK,MAAM,WAAS,IAAI,KAAK,KAAK;AAClC,iBAAK,MAAM,aAAa,IAAI,KAAK,KAAK;AAAA,UACtC;AAGD,kBAAQ,IAAI,GAAG;AACf,kBAAQ,IAAI,YAAY;AAAA,QACxB;AAAA,QACC,OAAO;AACL,kBAAQ,IAAI,KAAK;AAAA,QAClB;AAAA,MACL,CAAG;AAAA,IACH;AACA,UAAM,cAAcD,cAAAA,IAAI;AAAA,MACtB,EAAE,KAAK,wBAAwB,QAAQ,mCAAmC,MAAM,OAAQ;AAAA,MACxF,EAAE,KAAK,0BAA0B,QAAQ,0CAA0C,MAAM,OAAQ;AAAA,MACjG,EAAE,KAAK,gCAAgC,QAAQ,0CAA0C,MAAM,OAAQ;AAAA,MACvG,EAAE,KAAK,0CAA0C,QAAQ,sCAAsC,MAAM,OAAQ;AAAA,MAC7G,EAAE,KAAK,8BAA8B,QAAQ,2CAA2C,MAAM,OAAQ;AAAA,MACtG,EAAE,KAAK,4BAA4B,QAAQ,6CAA6C,MAAM,OAAQ;AAAA,MACtG,EAAE,KAAK,oCAAoC,QAAQ,0CAA0C,MAAM,OAAQ;AAAA,MAC3G,EAAE,KAAK,oBAAoB,QAAQ,wCAAwC,MAAM,OAAQ;AAAA,IAC3F,CAAC;AACD,UAAM,gBAAgB,MAAM;AAC1BC,oBAAAA,MAAI,WAAW;AAAA,QACb,KAAK;AAAA,MACT,CAAG;AAAA,IACH;AACA,UAAM,SAAS,MAAM;AACnBA,0BAAI,kBAAkB,UAAU;AAChCA,0BAAI,kBAAkB,QAAQ;AAC9BA,0BAAI,kBAAkB,UAAU;AAChCA,oBAAAA,MAAI,SAAS;AAAA,QACX,KAAK;AAAA,MACT,CAAG;AACDA,oBAAAA,MAAI,UAAU;AAAA,QACZ,OAAO;AAAA,QACP,UAAU;AAAA,MACd,CAAG;AAAA,IACH;AAUI,UAAM,CAAC,aAAa,cAAc,IAAI,SAAS,CAAC;AAGhD,UAAM,qBAAqB,CAAC,UAAU;AACpC,YAAM,iBAAiB,QAAQ,IAAI;AACnC,qBAAe,cAAc;AAC7B,cAAQ,IAAI,kBAAkB,gBAAgB;AAAA,IAoCpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACvLA,GAAG,WAAW,eAAe;"}
{"version":3,"file":"my.js","sources":["../../../../../../pages/my/my.vue","../../../../../../../../大二上/HTML5/HBuilderX.3.5.3.20220729/HBuilderX/plugins/uniapp-cli-vite/uniPage:/cGFnZXMvbXkvbXkudnVl"],"sourcesContent":null,"names":["onShow","ref","uni","apiImageUrl"],"mappings":"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"}

View File

@ -1 +1 @@
{"version":3,"file":"orderManagement.js","sources":["../../../../../../pages/orderManagement/orderManagement.vue","../../../../../../../../大二上/HTML5/HBuilderX.3.5.3.20220729/HBuilderX/plugins/uniapp-cli-vite/uniPage:/cGFnZXMvb3JkZXJNYW5hZ2VtZW50L29yZGVyTWFuYWdlbWVudC52dWU"],"sourcesContent":null,"names":["ref"],"mappings":";;;;;AAIU,UAAA,eAAeA,kBAAI,CAAC;AAC1B,UAAM,OAAOA,cAAAA,IAAI;AAAA,MACf,EAAE,MAAM,KAAK;AAAA,MACb,EAAE,MAAM,KAAK;AAAA,MACb,EAAE,MAAM,KAAK;AAAA,IAAA,CACd;AAGK,UAAA,YAAY,CAAC,UAAU;AAC3B,mBAAa,QAAQ;AAAA,IAAA;AAG1B,UAAM,YAAWA,cAAAA,IAAI;AAAA,MAChB;AAAA,QACE,QAAQ;AAAA,QACR,OAAM;AAAA,QACZ,MAAK;AAAA,QACL,aAAY;AAAA,MACR;AAAA,MACH;AAAA,QACE,QAAQ;AAAA,QACR,OAAM;AAAA,QACP,MAAK;AAAA,QACL,aAAY;AAAA,MACb;AAAA,MACA;AAAA,QACE,QAAQ;AAAA,QACR,OAAM;AAAA,QACP,MAAK;AAAA,QACL,aAAY;AAAA,MACb;AAAA,MACA;AAAA,QACE,QAAQ;AAAA,QACR,OAAM;AAAA,QACP,MAAK;AAAA,QACL,aAAY;AAAA,MACb;AAAA,IAAA,CACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACxCD,GAAG,WAAW,eAAe;"}
{"version":3,"file":"orderManagement.js","sources":["../../../../../../pages/orderManagement/orderManagement.vue","../../../../../../../../大二上/HTML5/HBuilderX.3.5.3.20220729/HBuilderX/plugins/uniapp-cli-vite/uniPage:/cGFnZXMvb3JkZXJNYW5hZ2VtZW50L29yZGVyTWFuYWdlbWVudC52dWU"],"sourcesContent":null,"names":["ref","uni","apiImageUrl","onMounted"],"mappings":";;;;;;AAIU,UAAA,eAAeA,kBAAI,CAAC;AAC1B,UAAM,OAAOA,cAAAA,IAAI;AAAA,MACf,EAAE,MAAM,KAAK;AAAA,MACb,EAAE,MAAM,KAAK;AAAA,MACb,EAAE,MAAM,KAAK;AAAA,IAAA,CACd;AAEK,UAAA,YAAY,CAAC,UAAU;AAC3B,mBAAa,QAAQ;AAAA,IAAA;AAErB,UAAA,YAAYA,kBAAI,CAAA,CAAE;AAExB,UAAM,WAAW,MAAM;AACrBC,oBAAAA,MAAI,QAAQ;AAAA,QACV,KAAKC,QAAc,cAAA;AAAA,QACnB,QAAQ;AAAA,QACR,MAAM;AAAA,UACJ,SAAS;AAAA,UACT,SAAS;AAAA,UACT,IAAI;AAAA,UACJ,UAAU;AAAA,UACV,cAAc;AAAA,UACd,WAAW;AAAA,UACX,WAAW;AAAA,UACX,WAAW;AAAA,UACX,OAAO;AAAA,QACT;AAAA,QACA,QAAQ,KAAK;AACX,kBAAQ,IAAI,GAAG;AACL,oBAAA,QAAQ,IAAI,KAAK,KAAK;AACxB,kBAAA,IAAI,UAAU,KAAK;AAAA,QAC7B;AAAA,QACA,OAAO;AACL,kBAAQ,IAAI,KAAK;AAAA,QACnB;AAAA,MAAA,CACD;AAAA,IAAA;AAIHC,kBAAAA,UAAU,MAAM;AACL;IAAA,CACV;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC5CD,GAAG,WAAW,eAAe;"}

View File

@ -0,0 +1 @@
{"version":3,"file":"testfour.js","sources":["../../../../../../../../大二上/HTML5/HBuilderX.3.5.3.20220729/HBuilderX/plugins/uniapp-cli-vite/uniPage:/cGFnZXMvdGVzdGZvdXIvdGVzdGZvdXIudnVl"],"sourcesContent":null,"names":[],"mappings":";;;;;;;AACA,GAAG,WAAW,eAAe;"}

View File

@ -0,0 +1 @@
{"version":3,"file":"testone.js","sources":["../../../../../../pages/testone/testone.vue","../../../../../../../../大二上/HTML5/HBuilderX.3.5.3.20220729/HBuilderX/plugins/uniapp-cli-vite/uniPage:/cGFnZXMvdGVzdG9uZS90ZXN0b25lLnZ1ZQ"],"sourcesContent":null,"names":["ref","uni","apiImageUrl"],"mappings":";;;;;;AAYA,UAAM,cAAcA,kBAAI,CAAC;AAEzB,UAAM,qBAAqB,MAAM;AAC/B,kBAAY,QAAQ,YAAY,UAAU,IAAI,IAAI;AAClD,cAAQ,IAAI,SAAS,YAAY,KAAK;AAEtC,YAAM,OAAO;AAAA,QACX,SAAS;AAAA,QACT,gBAAgB;AAAA,QAChB,gBAAgB;AAAA,QAChB,cAAc;AAAA,QACd,eAAe;AAAA,QACf,iBAAiB;AAAA,QACjB,YAAY;AAAA,QACZ,aAAa;AAAA,QACb,IAAI;AAAA,QACJ,eAAe;AAAA,QACf,OAAO;AAAA,QACP,aAAa,YAAY;AAAA,QACzB,QAAQ;AAAA,MACZ;AACEC,oBAAAA,MAAI,QAAQ;AAAA,QACX,KAAIC,QAAW,cAAC;AAAA,QAChB,QAAO;AAAA,QACL,QAAQ;AAAA,UACJ,gBAAgB;AAAA,QACjB;AAAA,QACD;AAAA,QAEJ,QAAQ,KAAK;AACZ,kBAAQ,IAAI,YAAY,IAAI,IAAI;AAAA,QAChC;AAAA,QACD,OAAO;AACN,kBAAQ,MAAM,UAAU,KAAK;AAAA,QAC7B;AAAA,MACJ,CAAG;AAAA,IACH;;;;;;;;;;AC/CA,GAAG,WAAW,eAAe;"}

View File

@ -0,0 +1 @@
{"version":3,"file":"three.js","sources":["../../../../../../pages/three/three.vue","../../../../../../../../大二上/HTML5/HBuilderX.3.5.3.20220729/HBuilderX/plugins/uniapp-cli-vite/uniPage:/cGFnZXMvdGhyZWUvdGhyZWUudnVl"],"sourcesContent":null,"names":["ref","uni","apiImageUrl","onMounted"],"mappings":";;;;;;AAIU,UAAA,eAAeA,kBAAI,CAAC;AAC1B,UAAM,OAAOA,cAAAA,IAAI;AAAA,MACf,EAAE,MAAM,MAAM;AAAA,MACd,EAAE,MAAM,MAAM;AAAA,MACd,EAAE,MAAM,MAAM;AAAA,IAAA,CACf;AAEK,UAAA,YAAY,CAAC,UAAU;AAC3B,mBAAa,QAAQ;AAAA,IAAA;AAErB,UAAA,YAAYA,kBAAI,CAAA,CAAE;AAExB,UAAM,WAAW,MAAM;AACrBC,oBAAAA,MAAI,QAAQ;AAAA,QACV,KAAKC,QAAc,cAAA;AAAA,QACnB,QAAQ;AAAA,QACR,MAAM;AAAA,UACJ,SAAS;AAAA,UACT,SAAS;AAAA,UACT,IAAI;AAAA,UACJ,UAAU;AAAA,UACV,cAAc;AAAA,UACd,WAAW;AAAA,UACX,WAAW;AAAA,UACX,WAAW;AAAA,UACX,OAAO;AAAA,QACT;AAAA,QACA,QAAQ,KAAK;AACX,kBAAQ,IAAI,GAAG;AACf,oBAAU,QAAQ,IAAI,KAAK,KAAK,QAAQ;AAChC,kBAAA,IAAI,UAAU,KAAK;AAAA,QAE7B;AAAA,QACA,OAAO;AACL,kBAAQ,IAAI,KAAK;AAAA,QACnB;AAAA,MAAA,CACD;AAAA,IAAA;AAGHC,kBAAAA,UAAU,MAAM;AACL;IAAA,CACV;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC5CD,GAAG,WAAW,eAAe;"}

View File

@ -22,6 +22,9 @@ if (!Math) {
"./pages/Printer/Printer.js";
"./pages/distribution/distribution.js";
"./pages/manage/manage.js";
"./pages/testone/testone.js";
"./pages/testfour/testfour.js";
"./pages/three/three.js";
}
const _sfc_main = {
onLaunch: function() {

View File

@ -19,7 +19,10 @@
"pages/merchant/merchant",
"pages/Printer/Printer",
"pages/distribution/distribution",
"pages/manage/manage"
"pages/manage/manage",
"pages/testone/testone",
"pages/testfour/testfour",
"pages/three/three"
],
"window": {
"defaultTitle": "uni-app",

View File

@ -1,8 +0,0 @@
"use strict";
const common_vendor = require("./common/vendor.js");
const _sfc_main = {};
function _sfc_render(_ctx, _cache) {
return {};
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "D:/111111000000/uniapp05/pages/index/cancel/cancel.vue"]]);
exports.MiniProgramPage = MiniProgramPage;

View File

@ -7776,6 +7776,28 @@ const pages = [
enablePullDownRefresh: false,
navigationBarBackgroundColor: "#4095e5"
}
},
{
path: "pages/testone/testone",
style: {
navigationBarTitleText: "",
enablePullDownRefresh: false
}
},
{
path: "pages/testfour/testfour",
style: {
navigationBarTitleText: "测试页四",
enablePullDownRefresh: false
}
},
{
path: "pages/three/three",
style: {
navigationBarTitleText: "订单",
enablePullDownRefresh: false,
navigationBarBackgroundColor: "#4095e5"
}
}
];
const globalStyle = {

View File

@ -1,8 +0,0 @@
"use strict";
const common_vendor = require("./common/vendor.js");
const _sfc_main = {};
function _sfc_render(_ctx, _cache) {
return {};
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "D:/111111000000/uniapp05/pages/index/finish/finish.vue"]]);
exports.MiniProgramPage = MiniProgramPage;

View File

@ -1 +1 @@
<view><button onTap="{{a}}">打印 Hello World</button></view>
<view><button onTap="{{a}}">打印订单</button></view>

View File

@ -3,40 +3,116 @@ const common_vendor = require("../../common/vendor.js");
const _sfc_main = {
__name: "distribution",
setup(__props) {
common_vendor.ref(common_vendor.index.getStorageSync("deviceId"));
common_vendor.ref(common_vendor.index.getStorageSync("serviceId"));
const deviceId = common_vendor.ref(common_vendor.index.getStorageSync("deviceId"));
const serviceId = common_vendor.ref(common_vendor.index.getStorageSync("serviceId"));
const characteristicId = common_vendor.ref(common_vendor.index.getStorageSync("characteristicId"));
function stringToByteArray(str) {
let bytes = [];
for (let i = 0; i < str.length; ++i) {
bytes.push(str.charCodeAt(i));
}
return bytes;
}
const sendPrintCommand = (commands) => {
common_vendor.index.writeBLECharacteristicValue({
deviceId: "86:67:7A:48:06:9C",
serviceId: "e7810a71-73ae-499d-8c15-faa9aef0c3f2",
characteristicId: "bef8d6c9-9c21-4c9e-b632-bd58c1009f9f",
value: new Uint8Array(commands)
});
};
const printHelloWorld = async () => {
const startPrinting = () => {
if (!characteristicId.value) {
console.error("请先获取特征值ID");
return;
}
const commands = [
...[27, 64],
...[27, 97, 0],
...stringToByteArray("Hello World\n"),
...[29, 86, 0]
];
await sendPrintCommand(commands);
const orderNumber = "123456";
const itemName = "麻辣烫";
const price = "10.00";
sendPrintCommand(orderNumber, itemName, price);
};
const generatePrintData = (orderNumber, itemName, price) => {
try {
let priceString;
if (price < 0) {
priceString = (-Math.abs(price)).toFixed(2);
} else {
priceString = price.toFixed(2);
}
const bufferLength = orderNumber.length + itemName.length + priceString.length + 7;
const buffer = new ArrayBuffer(bufferLength);
const dataView = new DataView(buffer);
dataView.setUint8(0, 27);
dataView.setUint8(1, 64);
dataView.setUint8(2, 27);
dataView.setUint8(3, 33);
dataView.setUint8(4, orderNumber.length);
for (let i = 0; i < orderNumber.length; i++) {
dataView.setUint8(i + 5, orderNumber.charCodeAt(i));
}
dataView.setUint8(orderNumber.length + 5, 27);
dataView.setUint8(orderNumber.length + 6, 41);
dataView.setUint8(orderNumber.length + 7, itemName.length);
for (let i = 0; i < itemName.length; i++) {
dataView.setUint8(i + orderNumber.length + 8, itemName.charCodeAt(i));
}
dataView.setUint8(itemName.length + orderNumber.length + 8, 27);
dataView.setUint8(itemName.length + orderNumber.length + 9, 42);
dataView.setUint8(itemName.length + orderNumber.length + 10, priceString.length);
for (let i = 0; i < priceString.length; i++) {
dataView.setUint8(i + itemName.length + orderNumber.length + 10, priceString.charCodeAt(i));
}
return buffer;
} catch (error) {
console.error("生成打印数据出错", error);
return null;
}
};
const sendPrintCommand = (orderNumber, itemName, price) => {
try {
const buffer = generatePrintData(orderNumber, itemName, price);
if (!buffer) {
return;
}
const dataView = new DataView(buffer);
common_vendor.index.writeBLECharacteristicValue({
deviceId: deviceId.value,
serviceId: serviceId.value,
characteristicId: characteristicId.value,
// 使用正确的变量名
value: Array.from(new Uint8Array(buffer)),
success: (res) => {
console.log("发送打印指令成功", res);
},
fail: (err) => {
console.error("发送打印指令失败", err);
}
});
} catch (error) {
console.error("发送打印指令出错", error);
}
};
const getCharacteristicId = async () => {
try {
await common_vendor.index.getBLEDeviceCharacteristics({
deviceId: deviceId.value,
serviceId: serviceId.value,
success: (res) => {
const characteristics = res.characteristics;
for (let i = 0; i < characteristics.length; i++) {
if (characteristics[i].uuid === "已知的特征值UUID") {
characteristicId.value = characteristics[i].uuid;
console.log("找到特征值ID:", characteristicId.value);
sendPrintCommand();
break;
}
}
},
fail: (err) => {
console.error("获取特征值失败", err);
}
});
} catch (error) {
console.error("获取特征值出错", error);
}
};
common_vendor.onMounted(async () => {
if (deviceId.value && serviceId.value) {
if (characteristicId.value) {
console.log("已知特征值ID:", characteristicId.value);
} else {
await getCharacteristicId();
}
}
});
return (_ctx, _cache) => {
return {
a: common_vendor.o(printHelloWorld)
a: common_vendor.o(startPrinting)
};
};
}

View File

@ -1,4 +1,8 @@
"use strict";
const cancel = require("../../../cancel.js");
require("../../../common/vendor.js");
my.createPage(cancel.MiniProgramPage);
const common_vendor = require("../../../common/vendor.js");
const _sfc_main = {};
function _sfc_render(_ctx, _cache) {
return {};
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "D:/111111000000/uniapp05/pages/index/cancel/cancel.vue"]]);
my.createPage(MiniProgramPage);

View File

@ -1,4 +0,0 @@
"use strict";
const cancel = require("../../../cancel.js");
require("../../../common/vendor.js");
my.createPage(cancel.MiniProgramPage);

View File

@ -1,4 +1,8 @@
"use strict";
const finish = require("../../../finish.js");
require("../../../common/vendor.js");
my.createPage(finish.MiniProgramPage);
const common_vendor = require("../../../common/vendor.js");
const _sfc_main = {};
function _sfc_render(_ctx, _cache) {
return {};
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "D:/111111000000/uniapp05/pages/index/finish/finish.vue"]]);
my.createPage(MiniProgramPage);

View File

@ -1,4 +0,0 @@
"use strict";
const finish = require("../../../finish.js");
require("../../../common/vendor.js");
my.createPage(finish.MiniProgramPage);

View File

@ -23,7 +23,40 @@
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.tabs {
display: flex;
justify-content: space-around;
line-height: 60rpx;
margin: 0 10rpx;
background-color: #fff;
box-shadow: 0 4rpx 6rpx rgba(240, 240, 240, 0.6);
position: relative;
z-index: 9;
}
.tabs .item {
flex: 1;
text-align: center;
padding: 20rpx;
font-size: 28rpx;
color: #262626;
}
.tabs .cursor {
position: absolute;
left: 0;
bottom: 0;
width: 18%;
height: 6rpx;
padding: 0 50rpx;
background-color: #4095e5;
/* 过渡效果 */
transition: all 0.4s;
}
.preview image {
width: 100%;
}
page {
height: 100%;
overflow: hidden;
background-color: #f5f5f5;
}
.tab-menu {
@ -40,7 +73,137 @@ page {
color: #4095e5;
font-weight: bold;
}
.scroll-view {
width: 100%;
height: 100%;
flex: 1;
}
.orderItem {
width: 100%;
height: 80px;
margin-bottom: 10px;
background-color: #fff;
}
.orderImg {
display: inline-block;
width: 20%;
height: 100%;
margin: auto 0;
}
.img {
width: 100%;
height: 100%;
border-radius: 15px;
}
.orderMessage {
width: 75%;
height: 80%;
float: right;
display: inline-block;
margin-top: 10px;
}
.money {
font-size: 30rpx;
font-weight: 700;
}
.time {
font-size: 25rpx;
}
.container {
align-items: center;
padding: 20rpx;
width: 90%;
height: 100vh;
margin: 0 auto;
}
.container1 {
width: 80%;
margin: 0 auto;
background-color: #fff;
margin-bottom: 20px;
}
.numberState {
height: 80rpx;
}
.number {
font-weight: 700;
font-size: 60rpx;
float: left;
}
.state {
font-size: 30rpx;
font-weight: 700;
float: right;
margin-top: 15rpx;
}
.time {
font-size: 30rpx;
color: #999;
padding-bottom: 10px;
border-bottom: 1px dotted #787878;
}
.message {
padding-top: 15rpx;
height: 70rpx;
}
.name {
font-size: 45rpx;
font-weight: 700;
float: left;
}
.phone {
float: left;
font-size: 30rpx;
line-height: 70rpx;
padding-left: 10rpx;
color: #787878;
}
.km {
font-size: 30rpx;
padding-top: 5px;
color: #787878;
margin-bottom: 10px;
}
.button {
display: inline;
color: #787878;
padding: 5px 10px 5px 10px;
border: 1px solid gray;
margin-right: 10px;
font-size: 24rpx;
border-radius: 5px;
margin-top: 10px;
}
.sure {
display: block;
font-size: 30rpx;
background-color: #c1c1c1;
color: #000;
border-radius: 5px;
padding: 10px;
width: 65px;
margin-left: 220px;
}
.box {
padding-bottom: 30px;
border-bottom: 1px dotted #787878;
}
.beizhu {
font-size: 40rpx;
font-weight: 700;
padding-bottom: 15px;
padding-top: 10px;
background: linear-gradient(to bottom, #fde16d, #fff);
}
.goods {
float: left;
font-size: 40rpx;
font-weight: 700;
}
.money {
font-size: 30rpx;
float: right;
margin-top: 5px;
}
.box2 {
padding-bottom: 50px;
border-bottom: 1px dotted #787878;
}

View File

@ -1 +1 @@
<scroll-view scroll-y class="preview"><view class="tab-menu"><view a:for="{{a}}" a:for-item="tab" a:key="b" class="{{('tab-item') + ' ' + (tab.c && 'active')}}" onTap="{{tab.d}}">{{tab.a}}</view></view><view class="content"><block a:if="{{b}}"><list u-i="0fd131b5-0" onVI="__l"></list></block><block a:if="{{c}}"><finish u-i="0fd131b5-1" onVI="__l"></finish></block><block a:if="{{d}}"><cancel u-i="0fd131b5-2" onVI="__l"></cancel></block></view></scroll-view>
<scroll-view scroll-y class="preview"><view class="tab-menu"><view a:for="{{a}}" a:for-item="tab" a:key="b" class="{{('tab-item') + ' ' + (tab.c && 'active')}}" onTap="{{tab.d}}">{{tab.a}}</view></view><view class="content"><block a:if="{{b}}"><view a:for="{{c}}" a:for-item="order" a:key="e" class="container1"><view class="box"><view class="numberState"><view class="number"> #{{order.a}}</view><view class="state"> 商家已自动接单 </view></view><view class="time"> 立即送达/{{order.b}}前送达 </view><view class="message"><view class="name"> 柿子先生 </view><view class="phone"> 手机尾号{{order.c}}</view></view><view class="button"> 门店新客 </view><view class="button"> 美团外卖会员 </view><view class="sure"> 确认出餐 </view></view><view class="box2"><view class="beizhu"> 顾客需要餐具; </view><view class="goods"> 1种商品共1件 </view><view class="money"> 预计收入¥{{order.d}}</view></view></view></block><block a:if="{{d}}"><view a:for="{{e}}" a:for-item="order" a:key="d" class="container1"><view class="box"><view class="numberState"><view class="number"> #{{order.a}}</view><view class="state"> 已取消 </view></view><view class="time"> 立即送达/{{order.b}}前送达 </view><view class="message"><view class="name"> 柿子先生 </view><view class="phone"> 手机尾号{{order.c}}</view></view><view class="km"> 1.5km|点击查看配送地址 > </view><view class="button"> 门店新客 </view><view class="button"> 美团外卖会员 </view></view></view></block><block a:if="{{f}}"><view a:for="{{g}}" a:for-item="order" a:key="d" class="container1"><view class="box"><view class="numberState"><view class="number"> #{{order.a}}</view><view class="state"> 已完成 </view></view><view class="time"> 立即送达/{{order.b}}前送达 </view><view class="message"><view class="name"> 柿子先生 </view><view class="phone"> 手机尾号{{order.c}}</view></view><view class="km"> 1.5km|点击查看配送地址 > </view><view class="button"> 门店新客 </view><view class="button"> 美团外卖会员 </view><view class="sure"> 打印小票 </view></view></view></block></view></scroll-view>

View File

@ -1,23 +1,47 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
if (!Math) {
(list + finish + cancel)();
}
const list = () => "./list2.js";
const finish = () => "./finish/finish2.js";
const cancel = () => "./cancel/cancel2.js";
const API_api = require("../../API/api.js");
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
__name: "index",
setup(__props) {
const currentIndex = common_vendor.ref(0);
const tabs = common_vendor.ref([
{ name: "待出餐" },
{ name: "已完成" },
{ name: "已取消" }
{ name: "已取消" },
{ name: "已完成" }
]);
const switchTab = (index) => {
currentIndex.value = index;
};
const orderList = common_vendor.ref([]);
const getOrder = () => {
common_vendor.index.request({
url: API_api.apiImageUrl + "/api/orders/my/page",
method: "POST",
data: {
current: 1,
endTime: "",
id: "",
pageSize: 100,
pickupMethod: 0,
sortField: "",
sortOrder: "",
startTime: "",
state: 0
},
success(res) {
console.log(res);
orderList.value = res.data.data.records.reverse();
console.log(orderList.value);
},
fail() {
console.log("出错啦");
}
});
};
common_vendor.onMounted(() => {
getOrder();
});
return (_ctx, _cache) => {
return common_vendor.e({
a: common_vendor.f(tabs.value, (tab, index, i0) => {
@ -29,11 +53,39 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
};
}),
b: currentIndex.value === 0
}, currentIndex.value === 0 ? {} : {}, {
c: currentIndex.value === 1
}, currentIndex.value === 1 ? {} : {}, {
d: currentIndex.value === 2
}, currentIndex.value === 2 ? {} : {});
}, currentIndex.value === 0 ? {
c: common_vendor.f(orderList.value, (order, index, i0) => {
return {
a: common_vendor.t(order.id),
b: common_vendor.t(order.createTime),
c: common_vendor.t(order.phone),
d: common_vendor.t(order.totalPrice),
e: index
};
})
} : {}, {
d: currentIndex.value === 1
}, currentIndex.value === 1 ? {
e: common_vendor.f(orderList.value, (order, index, i0) => {
return {
a: common_vendor.t(order.id),
b: common_vendor.t(order.createTime),
c: common_vendor.t(order.phone),
d: index
};
})
} : {}, {
f: currentIndex.value === 2
}, currentIndex.value === 2 ? {
g: common_vendor.f(orderList.value, (order, index, i0) => {
return {
a: common_vendor.t(order.id),
b: common_vendor.t(order.createTime),
c: common_vendor.t(order.phone),
d: index
};
})
} : {});
};
}
});

View File

@ -1,9 +1,5 @@
{
"defaultTitle": "订单",
"titleBarColor": "#4095e5",
"usingComponents": {
"list": "./list",
"finish": "./finish/finish",
"cancel": "./cancel/cancel"
}
"usingComponents": {}
}

View File

@ -1,4 +1,8 @@
"use strict";
const list = require("../../list.js");
require("../../common/vendor.js");
my.createPage(list.MiniProgramPage);
const common_vendor = require("../../common/vendor.js");
const _sfc_main = {};
function _sfc_render(_ctx, _cache) {
return {};
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "D:/111111000000/uniapp05/pages/index/list.vue"]]);
my.createPage(MiniProgramPage);

View File

@ -1,4 +0,0 @@
"use strict";
const list = require("../../list.js");
require("../../common/vendor.js");
my.createPage(list.MiniProgramPage);

View File

@ -30,7 +30,9 @@ const _sfc_main = {
},
data: {},
success: (res) => {
console.log(res.data.message);
console.log(res.data.data.id);
common_vendor.index.setStorageSync("businessId", res.data.data.id);
console.log(res.data.data);
user.value.message = res.data.message;
if (user.value.message === "ok") {
user.value.userName = res.data.data.businessName;
@ -71,11 +73,48 @@ const _sfc_main = {
duration: 2e3
});
};
const [storeStatus, setStoreStatus] = useState(0);
const handleSwitchChange = (value) => {
const newStoreStatus = value ? 1 : 0;
setStoreStatus(newStoreStatus);
console.log(`storeStatus值为: ${newStoreStatus}`);
const avatarUrl = common_vendor.index.getStorageSync("avatarUrl") || "";
const username = common_vendor.index.getStorageSync("username") || "";
const phone = common_vendor.index.getStorageSync("phone") || "";
const userId = common_vendor.index.getStorageSync("id") || "";
const businessId = common_vendor.index.getStorageSync("businessId") || "";
const storeStatus = common_vendor.ref(0);
const handleSwitchChange = () => {
storeStatus.value = storeStatus.value === 0 ? 1 : 0;
console.log("当前状态:", storeStatus.value);
const data = {
address: "",
businessAvatar: avatarUrl,
businessImages: avatarUrl,
businessName: username,
businessPhone: phone,
/* businessAvatar:'https://tse2-mm.cn.bing.net/th/id/OIP-C.wq-7irlVpAizKGvyvO0BNQHaFj?rs=1&pid=ImgDetMain',
businessImages: 'https://tse2-mm.cn.bing.net/th/id/OIP-C.wq-7irlVpAizKGvyvO0BNQHaFj?rs=1&pid=ImgDetMain',
businessName: '麻辣烫',
businessPhone: '13613639360', */
businessProfile: "",
categoryId: 0,
endBusiness: "",
id: businessId,
startBusiness: "",
state: 0,
storeStatus: storeStatus.value,
userId
};
common_vendor.index.request({
url: API_api.apiImageUrl + "/api/business/update/my",
method: "POST",
header: {
"content-type": "application/json"
},
data,
success(res) {
console.log("Success:", res.data);
},
fail() {
console.error("Error:", error);
}
});
};
return (_ctx, _cache) => {
return common_vendor.e({

View File

@ -1 +1 @@
<scroll-view scroll-y class="preview"><view class="tab-menu"><view a:for="{{a}}" a:for-item="tab" a:key="b" class="{{('tab-item') + ' ' + (tab.c && 'active')}}" onTap="{{tab.d}}">{{tab.a}}</view></view><view class="content"><block a:if="{{b}}"><view class="container"><view a:for="{{c}}" a:for-item="item" a:key="e" class="orderItem"><view class="orderImg"><image src="{{item.a}}" class="img"></image></view><view class="orderMessage"><text class="money">+{{item.b}}元</text><view/><text class="time">下单时间:{{item.c}}</text><view/><text class="time">订单编号:{{item.d}}</text></view></view></view></block><block a:if="{{d}}"><view class="container"><view a:for="{{e}}" a:for-item="item" a:key="e" class="orderItem"><view class="orderImg"><image src="{{item.a}}" class="img"></image></view><view class="orderMessage"><text class="money">+{{item.b}}元</text><view/><text class="time">下单时间:{{item.c}}</text><view/><text class="time">订单编号:{{item.d}}</text></view></view></view></block><block a:if="{{f}}"><view class="container"><view a:for="{{g}}" a:for-item="item" a:key="e" class="orderItem"><view class="orderImg"><image src="{{item.a}}" class="img"></image></view><view class="orderMessage"><text class="money">+{{item.b}}元</text><view/><text class="time">下单时间:{{item.c}}</text><view/><text class="time">订单编号:{{item.d}}</text></view></view></view></block></view></scroll-view>
<scroll-view scroll-y class="preview"><view class="tab-menu"><view a:for="{{a}}" a:for-item="tab" a:key="b" class="{{('tab-item') + ' ' + (tab.c && 'active')}}" onTap="{{tab.d}}">{{tab.a}}</view></view><view class="content"><block a:if="{{b}}"><view class="container"><view a:for="{{c}}" a:for-item="order" a:key="d" class="orderItem"><view class="orderImg"><image src="https://tse4-mm.cn.bing.net/th/id/OIP-C.cDfrXgI1DKvU7OklwmBfewHaHa?rs=1&pid=ImgDetMain" class="img"></image></view><view class="orderMessage"><text class="money">+{{order.a}}元</text><view/><text class="time">下单时间:{{order.b}}</text><view/><text class="time">订单编号:{{order.c}}</text></view></view></view></block><block a:if="{{d}}"><view class="container"><view a:for="{{e}}" a:for-item="order" a:key="d" class="orderItem"><view class="orderImg"><image src="https://tse4-mm.cn.bing.net/th/id/OIP-C.cDfrXgI1DKvU7OklwmBfewHaHa?rs=1&pid=ImgDetMain" class="img"></image></view><view class="orderMessage"><text class="money">+{{order.a}}元</text><view/><text class="time">下单时间:{{order.b}}</text><view/><text class="time">订单编号:{{order.c}}</text></view></view></view></block><block a:if="{{f}}"><view class="container"><view a:for="{{g}}" a:for-item="order" a:key="d" class="orderItem"><view class="orderImg"><image src="https://tse4-mm.cn.bing.net/th/id/OIP-C.cDfrXgI1DKvU7OklwmBfewHaHa?rs=1&pid=ImgDetMain" class="img"></image></view><view class="orderMessage"><text class="money">+{{order.a}}元</text><view/><text class="time">下单时间:{{order.b}}</text><view/><text class="time">订单编号:{{order.c}}</text></view></view></view></block></view></scroll-view>

View File

@ -1,5 +1,6 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const API_api = require("../../API/api.js");
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
__name: "orderManagement",
setup(__props) {
@ -12,32 +13,35 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
const switchTab = (index) => {
currentIndex.value = index;
};
const orderList = common_vendor.ref([
{
imgUrl: "https://img.zcool.cn/community/015ac85f110b9fa801206621387957.png@1280w_1l_2o_100sh.png",
money: 13,
time: "2024-03-15 11:15:10",
orderNumber: 4568415846158841
},
{
imgUrl: "https://img.zcool.cn/community/015ac85f110b9fa801206621387957.png@1280w_1l_2o_100sh.png",
money: 12,
time: "2024-03-15 11:15:10",
orderNumber: 4568415846158841
},
{
imgUrl: "https://img.zcool.cn/community/0105ec5b5ac3cba801206a35cf08a8.jpg@1280w_1l_2o_100sh.jpg",
money: 123,
time: "2024-03-15 11:15:10",
orderNumber: 4568415846158841
},
{
imgUrl: "https://img.zcool.cn/community/015ac85f110b9fa801206621387957.png@1280w_1l_2o_100sh.png",
money: 123,
time: "2024-03-15 11:15:10",
orderNumber: 4568415846158841
}
]);
const orderList = common_vendor.ref([]);
const getOrder = () => {
common_vendor.index.request({
url: API_api.apiImageUrl + "/api/orders/my/page",
method: "POST",
data: {
current: 1,
endTime: "",
id: "",
pageSize: 100,
pickupMethod: 0,
sortField: "",
sortOrder: "",
startTime: "",
state: 0
},
success(res) {
console.log(res);
orderList.value = res.data.data.records;
console.log(orderList.value);
},
fail() {
console.log("出错啦");
}
});
};
common_vendor.onMounted(() => {
getOrder();
});
return (_ctx, _cache) => {
return common_vendor.e({
a: common_vendor.f(tabs.value, (tab, index, i0) => {
@ -50,37 +54,34 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
}),
b: currentIndex.value === 0
}, currentIndex.value === 0 ? {
c: common_vendor.f(orderList.value, (item, index, i0) => {
c: common_vendor.f(orderList.value, (order, index, i0) => {
return {
a: item.imgUrl,
b: common_vendor.t(item.money),
c: common_vendor.t(item.time),
d: common_vendor.t(item.orderNumber),
e: index
a: common_vendor.t(order.totalPrice),
b: common_vendor.t(order.createTime),
c: common_vendor.t(order.id),
d: index
};
})
} : {}, {
d: currentIndex.value === 1
}, currentIndex.value === 1 ? {
e: common_vendor.f(orderList.value, (item, index, i0) => {
e: common_vendor.f(orderList.value, (order, index, i0) => {
return {
a: item.imgUrl,
b: common_vendor.t(item.money),
c: common_vendor.t(item.time),
d: common_vendor.t(item.orderNumber),
e: index
a: common_vendor.t(order.totalPrice),
b: common_vendor.t(order.createTime),
c: common_vendor.t(order.id),
d: index
};
})
} : {}, {
f: currentIndex.value === 2
}, currentIndex.value === 2 ? {
g: common_vendor.f(orderList.value, (item, index, i0) => {
g: common_vendor.f(orderList.value, (order, index, i0) => {
return {
a: item.imgUrl,
b: common_vendor.t(item.money),
c: common_vendor.t(item.time),
d: common_vendor.t(item.orderNumber),
e: index
a: common_vendor.t(order.totalPrice),
b: common_vendor.t(order.createTime.substr(0, 29).replace("T", " ")),
c: common_vendor.t(order.id),
d: index
};
})
} : {});

View File

@ -0,0 +1 @@
<view> 测试页面4 </view>

View File

@ -1,8 +1,8 @@
"use strict";
const common_vendor = require("./common/vendor.js");
const common_vendor = require("../../common/vendor.js");
const _sfc_main = {};
function _sfc_render(_ctx, _cache) {
return {};
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "D:/111111000000/uniapp05/pages/index/list.vue"]]);
exports.MiniProgramPage = MiniProgramPage;
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "D:/111111000000/uniapp05/pages/testfour/testfour.vue"]]);
my.createPage(MiniProgramPage);

View File

@ -0,0 +1,5 @@
{
"defaultTitle": "测试页四",
"pullRefresh": false,
"usingComponents": {}
}

View File

@ -0,0 +1 @@
<view><button onTap="{{a}}">点击我</button><view>当前状态: {{b}}</view></view>

View File

@ -0,0 +1,50 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const API_api = require("../../API/api.js");
const _sfc_main = {
__name: "testone",
setup(__props) {
const storeStatus = common_vendor.ref(0);
const handleSwitchChange = () => {
storeStatus.value = storeStatus.value === 0 ? 1 : 0;
console.log("当前状态:", storeStatus.value);
const data = {
address: "",
businessAvatar: "https://tse4-mm.cn.bing.net/th/id/OIP-C.vNYHZ0vsWMLi4nfLG4rWEwHaE7?rs=1&pid=ImgDetMain",
businessImages: "https://tse4-mm.cn.bing.net/th/id/OIP-C.vNYHZ0vsWMLi4nfLG4rWEwHaE7?rs=1&pid=ImgDetMain",
businessName: "麻辣烫",
businessPhone: "",
businessProfile: "",
categoryId: 0,
endBusiness: "",
id: 1830063677349658600,
startBusiness: "",
state: 0,
storeStatus: storeStatus.value,
userId: 0
};
common_vendor.index.request({
url: API_api.apiImageUrl + "/api/business/update/my",
method: "POST",
header: {
"content-type": "application/json"
},
data,
success(res) {
console.log("Success:", res.data);
},
fail() {
console.error("Error:", error);
}
});
};
return (_ctx, _cache) => {
return {
a: common_vendor.o(handleSwitchChange),
b: common_vendor.t(storeStatus.value)
};
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__file", "D:/111111000000/uniapp05/pages/testone/testone.vue"]]);
my.createPage(MiniProgramPage);

View File

@ -0,0 +1,5 @@
{
"defaultTitle": "",
"pullRefresh": false,
"usingComponents": {}
}

View File

@ -0,0 +1,209 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.tabs {
display: flex;
justify-content: space-around;
line-height: 60rpx;
margin: 0 10rpx;
background-color: #fff;
box-shadow: 0 4rpx 6rpx rgba(240, 240, 240, 0.6);
position: relative;
z-index: 9;
}
.tabs .item {
flex: 1;
text-align: center;
padding: 20rpx;
font-size: 28rpx;
color: #262626;
}
.tabs .cursor {
position: absolute;
left: 0;
bottom: 0;
width: 18%;
height: 6rpx;
padding: 0 50rpx;
background-color: #4095e5;
/* 过渡效果 */
transition: all 0.4s;
}
.preview image {
width: 100%;
}
page {
height: 100%;
overflow: hidden;
background-color: #f5f5f5;
}
.tab-menu {
display: flex;
justify-content: space-around;
padding: 10px 0;
background-color: #f5f5f5;
}
.tab-item {
padding: 10px;
cursor: pointer;
}
.tab-item.active {
color: #4095e5;
font-weight: bold;
}
.scroll-view {
width: 100%;
height: 100%;
flex: 1;
}
.orderItem {
width: 100%;
height: 80px;
margin-bottom: 10px;
background-color: #fff;
}
.orderImg {
display: inline-block;
width: 20%;
height: 100%;
margin: auto 0;
}
.img {
width: 100%;
height: 100%;
border-radius: 15px;
}
.orderMessage {
width: 75%;
height: 80%;
float: right;
display: inline-block;
margin-top: 10px;
}
.money {
font-size: 30rpx;
font-weight: 700;
}
.time {
font-size: 25rpx;
}
.container {
width: 90%;
height: 100vh;
margin: 0 auto;
}
.container1 {
width: 80%;
margin: 0 auto;
background-color: #fff;
margin-bottom: 20px;
}
.numberState {
height: 80rpx;
}
.number {
font-weight: 700;
font-size: 60rpx;
float: left;
}
.state {
font-size: 30rpx;
font-weight: 700;
float: right;
margin-top: 15rpx;
}
.time {
font-size: 30rpx;
color: #999;
padding-bottom: 10px;
border-bottom: 1px dotted #787878;
}
.message {
padding-top: 15rpx;
height: 70rpx;
}
.name {
font-size: 45rpx;
font-weight: 700;
float: left;
}
.phone {
float: left;
font-size: 30rpx;
line-height: 70rpx;
padding-left: 10rpx;
color: #787878;
}
.km {
font-size: 30rpx;
padding-top: 5px;
color: #787878;
margin-bottom: 10px;
}
.button {
display: inline;
color: #787878;
padding: 5px 10px 5px 10px;
border: 1px solid gray;
margin-right: 10px;
font-size: 24rpx;
border-radius: 5px;
margin-top: 10px;
}
.sure {
display: block;
font-size: 30rpx;
background-color: #c1c1c1;
color: #000;
border-radius: 5px;
padding: 10px;
width: 65px;
margin-left: 220px;
}
.box {
padding-bottom: 30px;
border-bottom: 1px dotted #787878;
}
.beizhu {
font-size: 40rpx;
font-weight: 700;
padding-bottom: 15px;
padding-top: 10px;
background: linear-gradient(to bottom, #fde16d, #fff);
}
.goods {
float: left;
font-size: 40rpx;
font-weight: 700;
}
.money {
font-size: 30rpx;
float: right;
margin-top: 5px;
}
.box2 {
padding-bottom: 50px;
border-bottom: 1px dotted #787878;
}

View File

@ -0,0 +1 @@
<scroll-view scroll-y class="preview"><view class="tab-menu"><view a:for="{{a}}" a:for-item="tab" a:key="b" class="{{('tab-item') + ' ' + (tab.c && 'active')}}" onTap="{{tab.d}}">{{tab.a}}</view></view><view class="content"><block a:if="{{b}}"><view a:for="{{c}}" a:for-item="order" a:key="e" class="container1"><view class="box"><view class="numberState"><view class="number"> #{{order.a}}</view><view class="state"> 商家已自动接单 </view></view><view class="time"> 立即送达/{{order.b}}前送达 </view><view class="message"><view class="name"> 柿子先生 </view><view class="phone"> 手机尾号{{order.c}}</view></view><view class="button"> 门店新客 </view><view class="button"> 美团外卖会员 </view><view class="sure"> 确认出餐 </view></view><view class="box2"><view class="beizhu"> 顾客需要餐具; </view><view class="goods"> 1种商品共1件 </view><view class="money"> 预计收入¥{{order.d}}</view></view></view></block><block a:if="{{d}}"><view a:for="{{e}}" a:for-item="order" a:key="d" class="container1"><view class="box"><view class="numberState"><view class="number"> #{{order.a}}</view><view class="state"> 已取消 </view></view><view class="time"> 立即送达/{{order.b}}前送达 </view><view class="message"><view class="name"> 柿子先生 </view><view class="phone"> 手机尾号{{order.c}}</view></view><view class="km"> 1.5km|点击查看配送地址 > </view><view class="button"> 门店新客 </view><view class="button"> 美团外卖会员 </view></view></view></block><block a:if="{{f}}"><view a:for="{{g}}" a:for-item="order" a:key="d" class="container1"><view class="box"><view class="numberState"><view class="number"> #{{order.a}}</view><view class="state"> 已完成 </view></view><view class="time"> 立即送达/{{order.b}}前送达 </view><view class="message"><view class="name"> 柿子先生 </view><view class="phone"> 手机尾号{{order.c}}</view></view><view class="km"> 1.5km|点击查看配送地址 > </view><view class="button"> 门店新客 </view><view class="button"> 美团外卖会员 </view><view class="sure"> 打印小票 </view></view></view></block></view></scroll-view>

View File

@ -0,0 +1,93 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const API_api = require("../../API/api.js");
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
__name: "three",
setup(__props) {
const currentIndex = common_vendor.ref(0);
const tabs = common_vendor.ref([
{ name: "待出餐" },
{ name: "已取消" },
{ name: "已完成" }
]);
const switchTab = (index) => {
currentIndex.value = index;
};
const orderList = common_vendor.ref([]);
const getOrder = () => {
common_vendor.index.request({
url: API_api.apiImageUrl + "/api/orders/my/page",
method: "POST",
data: {
current: 1,
endTime: "",
id: "",
pageSize: 100,
pickupMethod: 0,
sortField: "",
sortOrder: "",
startTime: "",
state: 0
},
success(res) {
console.log(res);
orderList.value = res.data.data.records.reverse();
console.log(orderList.value);
},
fail() {
console.log("出错啦");
}
});
};
common_vendor.onMounted(() => {
getOrder();
});
return (_ctx, _cache) => {
return common_vendor.e({
a: common_vendor.f(tabs.value, (tab, index, i0) => {
return {
a: common_vendor.t(tab.name),
b: index,
c: currentIndex.value === index ? 1 : "",
d: common_vendor.o(($event) => switchTab(index))
};
}),
b: currentIndex.value === 0
}, currentIndex.value === 0 ? {
c: common_vendor.f(orderList.value, (order, index, i0) => {
return {
a: common_vendor.t(order.id),
b: common_vendor.t(order.createTime),
c: common_vendor.t(order.phone),
d: common_vendor.t(order.totalPrice),
e: index
};
})
} : {}, {
d: currentIndex.value === 1
}, currentIndex.value === 1 ? {
e: common_vendor.f(orderList.value, (order, index, i0) => {
return {
a: common_vendor.t(order.id),
b: common_vendor.t(order.createTime),
c: common_vendor.t(order.phone),
d: index
};
})
} : {}, {
f: currentIndex.value === 2
}, currentIndex.value === 2 ? {
g: common_vendor.f(orderList.value, (order, index, i0) => {
return {
a: common_vendor.t(order.id),
b: common_vendor.t(order.createTime),
c: common_vendor.t(order.phone),
d: index
};
})
} : {});
};
}
});
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__file", "D:/111111000000/uniapp05/pages/three/three.vue"]]);
my.createPage(MiniProgramPage);

View File

@ -0,0 +1,6 @@
{
"defaultTitle": "订单",
"pullRefresh": false,
"titleBarColor": "#4095e5",
"usingComponents": {}
}