上传代码

This commit is contained in:
2025-08-18 14:20:34 +08:00
commit 527fd07910
2408 changed files with 427370 additions and 0 deletions

View File

@ -0,0 +1,152 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const API_api = require("../../API/api.js");
if (!Array) {
const _easycom_uni_steps2 = common_vendor.resolveComponent("uni-steps");
_easycom_uni_steps2();
}
const _easycom_uni_steps = () => "../../uni_modules/uni-steps/components/uni-steps/uni-steps.js";
if (!Math) {
_easycom_uni_steps();
}
const _sfc_main = {
__name: "testFive",
setup(__props) {
common_vendor.onUnload(() => {
common_vendor.index.reLaunch({
url: "/pages/index/index"
});
});
const LookImage = () => {
var _a;
if ((_a = orderItem.value) == null ? void 0 : _a.imageAddress) {
common_vendor.index.previewImage({
urls: ["http://" + orderItem.value.imageAddress],
current: 0
});
}
};
const active = common_vendor.ref(1);
const list1 = common_vendor.reactive([]);
const orderItem = common_vendor.ref(null);
const getOrder = () => {
const orderId = common_vendor.index.getStorageSync("orderId");
common_vendor.index.request({
url: API_api.apiImageUrl + "/api/orders/get/my",
method: "GET",
data: {
id: orderId
},
header: {
"Content-Type": "application/x-www-form-urlencoded",
// 确保设置正确的 Content-Type
"cookie": common_vendor.index.getStorageSync("cookie") || ""
},
success(res) {
console.log(res.data.data);
if (res.data && res.data.data) {
orderItem.value = res.data.data;
if ([0, 1].includes(orderItem.value.pickupMethod)) {
list1.splice(
0,
list1.length,
{ title: "备餐中" },
{ title: "已出餐" },
{ title: "已完成" }
);
} else if (orderItem.value.pickupMethod === 2) {
list1.splice(
0,
list1.length,
{ title: "备餐中" },
{ title: "已出餐" },
{ title: "送餐中" },
{ title: "已完成" }
);
}
}
},
fail() {
console.log("失败");
}
});
};
common_vendor.onMounted(getOrder());
const copyText = async () => {
try {
await common_vendor.index.setClipboardData({
data: orderItem.value,
success: () => {
common_vendor.index.showToast({
title: "复制成功",
icon: "success",
duration: 2e3
});
},
fail: (err) => {
common_vendor.index.showToast({
title: "复制失败",
icon: "none",
duration: 2e3
});
}
});
} catch (error) {
console.error("复制失败:", error);
common_vendor.index.showToast({
title: "复制失败",
icon: "none",
duration: 2e3
});
}
};
common_vendor.ref([
{
imgUrl: "https://img95.699pic.com/photo/50093/6813.jpg_wh860.jpg",
title: "鸡腿饭",
unread: "1",
time: "单价25元",
message: "这次点的外卖真是超乎预期的好吃!【香辣鸡腿堡】外皮酥脆,鸡肉鲜嫩多汁,辣度适中,每一口都是满满的幸福感。【薯条】也是惊喜,又脆又香,完全没有油腻感。最棒的是配送员【小张】,准时送达,态度亲切,还特意提醒我餐品有点烫,小心食用。整体体验满分,下次还会再点!"
}
]);
return (_ctx, _cache) => {
return common_vendor.e({
a: !orderItem.value
}, !orderItem.value ? {} : common_vendor.e({
b: [0, 1].includes(orderItem.value.pickupMethod)
}, [0, 1].includes(orderItem.value.pickupMethod) ? {
c: common_vendor.t(orderItem.value.id)
} : orderItem.value.pickupMethod === 2 && orderItem.value.imageAddress ? {
e: "http://" + orderItem.value.imageAddress
} : {}, {
d: orderItem.value.pickupMethod === 2 && orderItem.value.imageAddress,
f: common_vendor.p({
options: list1,
active: active.value
}),
g: orderItem.value.pickupMethod === 2 && orderItem.value.imageAddress
}, orderItem.value.pickupMethod === 2 && orderItem.value.imageAddress ? {
h: common_vendor.o(LookImage)
} : {}, {
i: common_vendor.f(orderItem.value.orderDetailsVOList, (item, k0, i0) => {
return {
a: item.dishesVO.dishesImage,
b: common_vendor.t(item.dishesVO.dishesName),
c: common_vendor.t(item.quantity),
d: common_vendor.t(item.dishesVO.dishesName),
e: common_vendor.t(item.dishesVO.dishesPrice)
};
}),
j: common_vendor.t(orderItem.value.totalPrice),
k: common_vendor.t(orderItem.value.notes),
l: common_vendor.t(orderItem.value.phone.slice(-4)),
m: common_vendor.t(orderItem.value.pickupMethod === 0 ? "堂食" : orderItem.value.pickupMethod === 1 ? "自取" : "跑腿"),
n: common_vendor.t(orderItem.value.pickupCode),
o: common_vendor.o(copyText),
p: common_vendor.t(orderItem.value.payMethod === 0 ? "支付宝支付" : "线下支付")
}));
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-2e2c92b9"]]);
wx.createPage(MiniProgramPage);

View File

@ -0,0 +1,8 @@
{
"navigationBarTitleText": "测试页面五",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#4095e5",
"usingComponents": {
"uni-steps": "../../uni_modules/uni-steps/components/uni-steps/uni-steps"
}
}

View File

@ -0,0 +1 @@
<view wx:if="{{a}}" class="data-v-2e2c92b9"><image src="https://www.iyunying.org/wp-content/uploads/2022/08/2022080502504482.png" class="image-box data-v-2e2c92b9"></image></view><view wx:else class="data-v-2e2c92b9"><view class="header data-v-2e2c92b9"><view class="order data-v-2e2c92b9"><view wx:if="{{b}}" class="order-number-container data-v-2e2c92b9"><view class="order-number data-v-2e2c92b9">取餐号</view><view class="order-number-value data-v-2e2c92b9">#{{c}}</view></view><view wx:elif="{{d}}" class="order-number-container data-v-2e2c92b9"><view class="Lookbackground data-v-2e2c92b9"><image class="data-v-2e2c92b9" src="{{e}}" mode="aspectFit" style="width:100%;height:100%"></image></view></view><uni-steps wx:if="{{f}}" class="step-item data-v-2e2c92b9" u-i="2e2c92b9-0" bind:__l="__l" u-p="{{f}}"/></view><text wx:if="{{g}}" class="data-v-2e2c92b9" bindtap="{{h}}">点击查看图片</text></view><view class="order-details data-v-2e2c92b9"><view class="order-details-center data-v-2e2c92b9"><view class="order-items data-v-2e2c92b9"><view wx:for="{{i}}" wx:for-item="item" class="order-item data-v-2e2c92b9"><image class="item-image data-v-2e2c92b9" src="{{item.a}}"></image><view class="item-info data-v-2e2c92b9"><view class="item-name data-v-2e2c92b9">{{item.b}}</view><view class="item-description data-v-2e2c92b9">{{item.c}}×{{item.d}}</view><view class="item-price data-v-2e2c92b9">¥{{item.e}}</view></view></view><view class="order-summary data-v-2e2c92b9"><view class="summary-item data-v-2e2c92b9"><text class="data-v-2e2c92b9">商品总价</text><text class="data-v-2e2c92b9">¥{{j}}</text></view></view></view><view class="order-info data-v-2e2c92b9"><view class="order-label data-v-2e2c92b9">订单信息</view><view class="order-detail data-v-2e2c92b9"><view class="detail-item data-v-2e2c92b9"><text class="data-v-2e2c92b9">备注</text><text class="data-v-2e2c92b9">{{k}}</text></view><view class="detail-item data-v-2e2c92b9"><text class="data-v-2e2c92b9">手机尾号</text><text class="data-v-2e2c92b9">{{l}}</text></view><view class="detail-item data-v-2e2c92b9"><text class="data-v-2e2c92b9">订单类型</text><text class="data-v-2e2c92b9">{{m}}</text></view><view class="detail-item data-v-2e2c92b9"><text class="data-v-2e2c92b9">订单编号</text><text class="data-v-2e2c92b9" bindtap="{{o}}">{{n}}</text></view><view class="detail-item data-v-2e2c92b9"><text class="data-v-2e2c92b9">下单时间</text><text class="data-v-2e2c92b9">2023-04-22 11:32:36</text></view><view class="detail-item data-v-2e2c92b9"><text class="data-v-2e2c92b9">支付方式</text><text class="data-v-2e2c92b9">{{p}}</text></view></view></view></view></view></view>

View File

@ -0,0 +1,164 @@
.order-details.data-v-2e2c92b9 {
padding: 10px;
background-color: #ece8ea;
}
.order-details-center.data-v-2e2c92b9 {
padding: 10px;
background-color: #fff;
border-radius: 2%;
}
.header.data-v-2e2c92b9 {
display: flex;
flex-direction: column; /* 子元素垂直排列 */
align-items: center; /* 子元素水平居中 */
justify-content: center; /* 子元素垂直居中 */
padding: 20px 0;
background-color: #4095e5;
width: 100%;
height: 200px;
position: relative;
top: 0;
}
.Lookbackground.data-v-2e2c92b9 {
width: 250px;
height: 100px;
margin-bottom: 10px;
background: #f5f5f5;
border-radius: 8px;
overflow: hidden;
display: flex;
justify-content: center;
align-items: center;
}
.header text.data-v-2e2c92b9 {
color: #fff;
font-size: 14px;
margin-top: 10px;
margin-top: 5px;
text-decoration: underline;
}
.order.data-v-2e2c92b9 {
padding: 20px;
background-color: #f9f9f9;
width: 85%;
border-radius: 5%;
}
.order-number-container.data-v-2e2c92b9 {
display: flex;
flex-direction: column; /* 子元素垂直排列 */
align-items: center; /* 子元素水平居中 */
}
.order-number.data-v-2e2c92b9 {
font-size: 24px;
font-weight: bold;
margin-bottom: 10px; /* 添加底部间距 */
}
.order-number-value.data-v-2e2c92b9 {
font-size: 48px;
font-weight: bold;
margin-bottom: 20px;
}
.status-bar.data-v-2e2c92b9 {
display: flex;
justify-content: space-around;
padding: 20px 0;
}
.status-item.data-v-2e2c92b9 {
display: flex;
align-items: center;
}
.status-icon.data-v-2e2c92b9 {
width: 24px;
height: 24px;
margin-right: 10px;
}
.restaurant-info.data-v-2e2c92b9 {
display: flex;
align-items: center;
justify-content: space-between;
padding: 20px 0;
background-color: #fff;
border-bottom: 1px solid #dedede;
}
.restaurant-name.data-v-2e2c92b9 {
font-size: 18px;
font-weight: bold;
}
.restaurant-address.data-v-2e2c92b9 {
font-size: 14px;
color: #666;
}
.contact.data-v-2e2c92b9 {
display: flex;
align-items: center;
}
.contact-icon.data-v-2e2c92b9 {
width: 24px;
height: 24px;
margin-right: 10px;
}
.order-items.data-v-2e2c92b9 {
padding: 20px 0;
background-color: #fff;
border-bottom: 1px solid #dedede;
}
.order-item.data-v-2e2c92b9 {
display: flex;
align-items: center;
padding: 10px 0;
}
.item-image.data-v-2e2c92b9 {
width: 80px;
height: 80px;
margin-right: 20px;
}
.item-info.data-v-2e2c92b9 {
flex: 1;
}
.item-name.data-v-2e2c92b9 {
font-size: 18px;
font-weight: bold;
}
.item-description.data-v-2e2c92b9 {
font-size: 14px;
color: #666;
}
.item-price.data-v-2e2c92b9 {
font-size: 18px;
font-weight: bold;
text-align: right;
}
.order-summary.data-v-2e2c92b9 {
padding: 20px 0;
}
.summary-item.data-v-2e2c92b9 {
display: flex;
justify-content: space-between;
padding: 10px 0;
}
.order-info.data-v-2e2c92b9 {
padding: 20px 0;
background-color: #fff;
border-bottom: 1px solid #dedede;
}
.order-label.data-v-2e2c92b9 {
font-size: 18px;
font-weight: bold;
padding-bottom: 10px;
}
.order-detail.data-v-2e2c92b9 {
display: flex;
flex-direction: column;
}
.detail-item.data-v-2e2c92b9 {
display: flex;
justify-content: space-between;
padding: 10px 0;
}
.image-box.data-v-2e2c92b9 {
width: 250rpx;
height: 250rpx;
display: block; /* 确保img作为块级元素以便margin auto生效 */
margin: 40px auto 0; /* 上边距40px左右自动居中 */
}