上传代码
This commit is contained in:
49
uniapp04/unpackage/dist/dev/mp-weixin/pages/fullOrder/fullOrder.js
vendored
Normal file
49
uniapp04/unpackage/dist/dev/mp-weixin/pages/fullOrder/fullOrder.js
vendored
Normal file
@ -0,0 +1,49 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
if (!Math) {
|
||||
(orderStateVue + orderStateZeroVue + common_vendor.unref(orderStateOneNvue) + orderStateThree + orderStateFiveVue)();
|
||||
}
|
||||
const orderStateVue = () => "./orderState.js";
|
||||
const orderStateZeroVue = () => "./orderStateZero.js";
|
||||
const orderStateOneNvue = () => "./orderStateOne.js";
|
||||
const orderStateThree = () => "./orderStateThree.js";
|
||||
const orderStateFiveVue = () => "./orderStateFive.js";
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
__name: "fullOrder",
|
||||
setup(__props) {
|
||||
const currentIndex = common_vendor.ref(0);
|
||||
const tabs = common_vendor.ref([
|
||||
{ name: "未支付" },
|
||||
{ name: "已支付" },
|
||||
{ name: "已退款" },
|
||||
{ name: "已出餐" },
|
||||
{ name: "已完成" }
|
||||
]);
|
||||
const switchTab = (index) => {
|
||||
currentIndex.value = index;
|
||||
};
|
||||
common_vendor.index.getSystemInfoSync();
|
||||
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), index)
|
||||
};
|
||||
}),
|
||||
b: currentIndex.value === 0
|
||||
}, currentIndex.value === 0 ? {} : {}, {
|
||||
c: currentIndex.value === 1
|
||||
}, currentIndex.value === 1 ? {} : {}, {
|
||||
d: currentIndex.value === 2
|
||||
}, currentIndex.value === 2 ? {} : {}, {
|
||||
e: currentIndex.value === 3
|
||||
}, currentIndex.value === 3 ? {} : {}, {
|
||||
f: currentIndex.value === 4
|
||||
}, currentIndex.value === 4 ? {} : {});
|
||||
};
|
||||
}
|
||||
});
|
||||
wx.createPage(_sfc_main);
|
11
uniapp04/unpackage/dist/dev/mp-weixin/pages/fullOrder/fullOrder.json
vendored
Normal file
11
uniapp04/unpackage/dist/dev/mp-weixin/pages/fullOrder/fullOrder.json
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
"navigationBarTitleText": "全部订单",
|
||||
"enablePullDownRefresh": true,
|
||||
"usingComponents": {
|
||||
"order-state-vue": "./orderState",
|
||||
"order-state-zero-vue": "./orderStateZero",
|
||||
"order-state-one-nvue": "./orderStateOne",
|
||||
"order-state-three": "./orderStateThree",
|
||||
"order-state-five-vue": "./orderStateFive"
|
||||
}
|
||||
}
|
1
uniapp04/unpackage/dist/dev/mp-weixin/pages/fullOrder/fullOrder.wxml
vendored
Normal file
1
uniapp04/unpackage/dist/dev/mp-weixin/pages/fullOrder/fullOrder.wxml
vendored
Normal file
@ -0,0 +1 @@
|
||||
<view class="tab-menu"><view wx:for="{{a}}" wx:for-item="tab" wx:key="b" class="{{['tab-item', tab.c && 'active']}}" bindtap="{{tab.d}}">{{tab.a}}</view></view><view class="content"><block wx:if="{{b}}"><order-state-vue u-i="2d10110e-0" bind:__l="__l"></order-state-vue></block><block wx:if="{{c}}"><order-state-zero-vue u-i="2d10110e-1" bind:__l="__l"></order-state-zero-vue></block><block wx:if="{{d}}"><order-state-one-nvue u-i="2d10110e-2" bind:__l="__l"></order-state-one-nvue></block><block wx:if="{{e}}"><order-state-three u-i="2d10110e-3" bind:__l="__l"></order-state-three></block><block wx:if="{{f}}"><order-state-five-vue u-i="2d10110e-4" bind:__l="__l"></order-state-five-vue></block></view>
|
214
uniapp04/unpackage/dist/dev/mp-weixin/pages/fullOrder/fullOrder.wxss
vendored
Normal file
214
uniapp04/unpackage/dist/dev/mp-weixin/pages/fullOrder/fullOrder.wxss
vendored
Normal file
@ -0,0 +1,214 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
page {
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
.viewport {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background-color: #fff;
|
||||
}
|
||||
.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: 20%;
|
||||
height: 6rpx;
|
||||
padding: 0 50rpx;
|
||||
background-color: #4095e5;
|
||||
transition: all 0.4s;
|
||||
}
|
||||
.swiper {
|
||||
background-color: #4095e5;
|
||||
}
|
||||
.orders .card {
|
||||
min-height: 100rpx;
|
||||
padding: 20rpx;
|
||||
margin: 20rpx 20rpx 0;
|
||||
border-radius: 10rpx;
|
||||
background-color: #fff;
|
||||
}
|
||||
.orders .card:last-child {
|
||||
padding-bottom: 40rpx;
|
||||
}
|
||||
.orders .status {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-size: 28rpx;
|
||||
color: #999;
|
||||
margin-bottom: 15rpx;
|
||||
}
|
||||
.orders .status .title {
|
||||
color: #343434;
|
||||
font-weight: 700;
|
||||
flex: 1;
|
||||
}
|
||||
.orders .status .primary {
|
||||
color: #ff9240;
|
||||
}
|
||||
.orders .status .icon-delete {
|
||||
line-height: 1;
|
||||
margin-left: 10rpx;
|
||||
padding-left: 10rpx;
|
||||
border-left: 1rpx solid #e3e3e3;
|
||||
}
|
||||
.orders .goods {
|
||||
display: flex;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
.orders .goods .cover {
|
||||
width: 170rpx;
|
||||
height: 170rpx;
|
||||
margin-right: 20rpx;
|
||||
border-radius: 10rpx;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
.orders .goods .quantity {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
line-height: 1;
|
||||
padding: 6rpx 4rpx 6rpx 8rpx;
|
||||
font-size: 24rpx;
|
||||
color: #fff;
|
||||
border-radius: 10rpx 0 0 0;
|
||||
background-color: rgba(0, 0, 0, 0.6);
|
||||
}
|
||||
.orders .goods .meta {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
}
|
||||
.orders .goods .name {
|
||||
height: 80rpx;
|
||||
font-size: 26rpx;
|
||||
color: #444;
|
||||
}
|
||||
.orders .goods .type {
|
||||
line-height: 1.8;
|
||||
padding: 0 15rpx;
|
||||
margin-top: 10rpx;
|
||||
font-size: 24rpx;
|
||||
align-self: flex-start;
|
||||
border-radius: 4rpx;
|
||||
color: #888;
|
||||
background-color: #f7f7f8;
|
||||
}
|
||||
.orders .goods .more {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 22rpx;
|
||||
color: #333;
|
||||
}
|
||||
.orders .action {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
padding-top: 20rpx;
|
||||
}
|
||||
.orders .action .button {
|
||||
width: 180rpx;
|
||||
height: 60rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin-left: 20rpx;
|
||||
border-radius: 60rpx;
|
||||
border: 1rpx solid #ccc;
|
||||
font-size: 26rpx;
|
||||
color: #444;
|
||||
}
|
||||
.orders .action .secondary {
|
||||
color: #4095e5;
|
||||
border-color: #4095e5;
|
||||
}
|
||||
.orders .action .primary {
|
||||
color: #fff;
|
||||
background-color: #4095e5;
|
||||
}
|
||||
.orders .loading-text {
|
||||
text-align: center;
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
padding: 20rpx 0;
|
||||
}
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 20px;
|
||||
}
|
||||
.status-btn {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 92rpx;
|
||||
margin: 30rpx;
|
||||
background-color: #007AFF;
|
||||
}
|
||||
.example-body {
|
||||
display: block;
|
||||
padding: 15px;
|
||||
flex-direction: row;
|
||||
}
|
||||
.tab-menu {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
padding: 10px 0;
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
.tab-item {
|
||||
padding: 10px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.tab-item.active {
|
||||
color: #007aff;
|
||||
font-weight: bold;
|
||||
}
|
175
uniapp04/unpackage/dist/dev/mp-weixin/pages/fullOrder/orderState.js
vendored
Normal file
175
uniapp04/unpackage/dist/dev/mp-weixin/pages/fullOrder/orderState.js
vendored
Normal file
@ -0,0 +1,175 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const API_api = require("../../API/api.js");
|
||||
if (!Array) {
|
||||
const _easycom_uni_pagination2 = common_vendor.resolveComponent("uni-pagination");
|
||||
_easycom_uni_pagination2();
|
||||
}
|
||||
const _easycom_uni_pagination = () => "../../uni_modules/uni-pagination/components/uni-pagination/uni-pagination.js";
|
||||
if (!Math) {
|
||||
_easycom_uni_pagination();
|
||||
}
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
__name: "orderState",
|
||||
setup(__props) {
|
||||
const currentPage = common_vendor.ref(1);
|
||||
const pageSize = common_vendor.ref(10);
|
||||
const totalPage = common_vendor.ref(1);
|
||||
const orderList = common_vendor.ref([]);
|
||||
const getOrder = (page) => {
|
||||
common_vendor.index.request({
|
||||
url: `${API_api.apiImageUrl}/api/orders/my/page`,
|
||||
method: "POST",
|
||||
data: {
|
||||
current: page,
|
||||
endTime: "",
|
||||
id: "",
|
||||
pageSize: pageSize.value,
|
||||
pickupMethod: "",
|
||||
sortField: "",
|
||||
sortOrder: "",
|
||||
startTime: "",
|
||||
state: 0
|
||||
},
|
||||
header: {
|
||||
"Content-Type": "application/json",
|
||||
"cookie": common_vendor.index.getStorageSync("cookie") || ""
|
||||
},
|
||||
success(res) {
|
||||
if (res.data.code === 0) {
|
||||
const records = res.data.data.records;
|
||||
orderList.value = records.reverse();
|
||||
totalPage.value = Math.ceil(res.data.data.total / pageSize.value);
|
||||
console.log("订单数据:", orderList.value);
|
||||
}
|
||||
},
|
||||
fail() {
|
||||
console.log("出错啦");
|
||||
}
|
||||
});
|
||||
};
|
||||
common_vendor.onMounted(() => {
|
||||
getOrder(currentPage.value);
|
||||
});
|
||||
const onPageChange = (e) => {
|
||||
currentPage.value = e.current;
|
||||
getOrder(e.current);
|
||||
};
|
||||
const closeOrder = (order) => {
|
||||
console.log(order);
|
||||
console.log(order.id);
|
||||
common_vendor.index.request({
|
||||
url: API_api.apiImageUrl + "/api/orders/cancel",
|
||||
method: "POST",
|
||||
data: {
|
||||
id: order.id
|
||||
},
|
||||
success(res) {
|
||||
console.log("成功");
|
||||
console.log(res);
|
||||
},
|
||||
fail() {
|
||||
console.log("失败");
|
||||
}
|
||||
});
|
||||
};
|
||||
const goToPay = (order) => {
|
||||
console.log(order);
|
||||
common_vendor.index.request({
|
||||
url: API_api.apiImageUrl + "/api/Alipay/payment/create",
|
||||
method: "GET",
|
||||
data: {
|
||||
id: order
|
||||
},
|
||||
header: {
|
||||
"Content-Type": "application/json",
|
||||
// 确保设置正确的 Content-Type
|
||||
"cookie": common_vendor.index.getStorageSync("cookie") || ""
|
||||
},
|
||||
success: function(result) {
|
||||
console.log(result);
|
||||
console.log(result.data.data);
|
||||
common_vendor.index.setStorageSync("tradeNo", result.data.data);
|
||||
my.tradePay({
|
||||
tradeNO: result.data.data,
|
||||
success: (res) => {
|
||||
console.log("成功调用");
|
||||
console.log(res);
|
||||
console.log(res.resultCode);
|
||||
if (res.resultCode == 6001) {
|
||||
console.log("我是6001");
|
||||
common_vendor.index.setStorageSync("notPay", orderId);
|
||||
common_vendor.index.navigateTo({
|
||||
url: "/pages/goToPay/goToPay"
|
||||
});
|
||||
} else if (res.resultCode == 9e3) {
|
||||
common_vendor.index.setStorageSync("orderId", orderId);
|
||||
common_vendor.index.navigateTo({
|
||||
url: "/pages/testFive/testFive"
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: (res) => {
|
||||
my.alert({
|
||||
content: JSON.stringify(res)
|
||||
});
|
||||
console.log("失败");
|
||||
console.log(res);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
const merchantDetail = (order) => {
|
||||
var _a, _b, _c;
|
||||
console.log((_a = order.businessVO) == null ? void 0 : _a.id);
|
||||
common_vendor.index.setStorageSync("businessItem", (_b = order.businessVO) == null ? void 0 : _b.id);
|
||||
const merchantId = (_c = order.businessVO) == null ? void 0 : _c.id;
|
||||
common_vendor.index.navigateTo({
|
||||
url: `/pages/merchant/merchant?merchantId=${merchantId}`
|
||||
});
|
||||
};
|
||||
return (_ctx, _cache) => {
|
||||
var _a;
|
||||
return {
|
||||
a: common_vendor.f(orderList.value, (order, index, i0) => {
|
||||
var _a2, _b;
|
||||
return common_vendor.e({
|
||||
a: common_vendor.t((_a2 = order.businessVO) == null ? void 0 : _a2.businessName),
|
||||
b: common_vendor.o(($event) => merchantDetail(order), index),
|
||||
c: common_vendor.t(order.id),
|
||||
d: common_vendor.f(1, (sku, k1, i1) => {
|
||||
return {
|
||||
a: common_vendor.f(order.orderDetailsVOList, (item, index2, i2) => {
|
||||
var _a3;
|
||||
return {
|
||||
a: common_vendor.t((_a3 = item.dishesVO) == null ? void 0 : _a3.dishesName),
|
||||
b: common_vendor.t(item.attributeNames)
|
||||
};
|
||||
}),
|
||||
b: sku
|
||||
};
|
||||
}),
|
||||
e: (_b = order.businessVO) == null ? void 0 : _b.businessAvatar
|
||||
}, {
|
||||
f: common_vendor.o(() => closeOrder(order), index),
|
||||
g: common_vendor.o(($event) => goToPay(order.id), index)
|
||||
}, {
|
||||
i: index
|
||||
});
|
||||
}),
|
||||
b: `/pagesOrder/detail/detail?id=1`,
|
||||
c: common_vendor.t("没有更多数据~"),
|
||||
d: ((_a = _ctx.safeAreaInsets) == null ? void 0 : _a.bottom) + "px",
|
||||
e: common_vendor.o(onPageChange),
|
||||
f: common_vendor.p({
|
||||
title: "订单列表",
|
||||
["show-icon"]: true,
|
||||
current: currentPage.value,
|
||||
total: totalPage.value * pageSize.value
|
||||
})
|
||||
};
|
||||
};
|
||||
}
|
||||
});
|
||||
wx.createComponent(_sfc_main);
|
6
uniapp04/unpackage/dist/dev/mp-weixin/pages/fullOrder/orderState.json
vendored
Normal file
6
uniapp04/unpackage/dist/dev/mp-weixin/pages/fullOrder/orderState.json
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"uni-pagination": "../../uni_modules/uni-pagination/components/uni-pagination/uni-pagination"
|
||||
}
|
||||
}
|
1
uniapp04/unpackage/dist/dev/mp-weixin/pages/fullOrder/orderState.wxml
vendored
Normal file
1
uniapp04/unpackage/dist/dev/mp-weixin/pages/fullOrder/orderState.wxml
vendored
Normal file
@ -0,0 +1 @@
|
||||
<view class="viewport"><scroll-view scroll-y class="orders"><view wx:for="{{a}}" wx:for-item="order" wx:key="i" class="card"><view class="status"><text class="title" bindtap="{{order.b}}">{{order.a}}</text><text>{{order.c}}</text><text class="icon-delete"></text></view><navigator wx:for="{{order.d}}" wx:for-item="sku" wx:key="b" class="goods" url="{{b}}" hover-class="none"><view class="cover"><image mode="aspectFit" src="{{order.e}}"></image></view><view wx:for="{{sku.a}}" wx:for-item="item" class="meta"><view class="type">{{item.a}}--{{item.b}}</view><text class="type">下单即送20积分</text></view></navigator><view class="action"><block wx:if="{{true}}"><view class="button primary" bindtap="{{order.f}}">取消订单</view><view class="button primary" bindtap="{{order.g}}"> 去支付 </view></block><block wx:else><navigator class="button secondary" url="{{order.h}}" hover-class="none"> 再次购买 </navigator><view wx:if="{{false}}" class="button primary">确认收货</view></block></view></view><view class="loading-text" style="{{'padding-bottom:' + d}}">{{c}}</view></scroll-view><uni-pagination wx:if="{{f}}" bindchange="{{e}}" u-i="6cf1f5e4-0" bind:__l="__l" u-p="{{f}}"/></view>
|
214
uniapp04/unpackage/dist/dev/mp-weixin/pages/fullOrder/orderState.wxss
vendored
Normal file
214
uniapp04/unpackage/dist/dev/mp-weixin/pages/fullOrder/orderState.wxss
vendored
Normal file
@ -0,0 +1,214 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
page {
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
.viewport {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background-color: #fff;
|
||||
}
|
||||
.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: 20%;
|
||||
height: 6rpx;
|
||||
padding: 0 50rpx;
|
||||
background-color: #4095e5;
|
||||
transition: all 0.4s;
|
||||
}
|
||||
.swiper {
|
||||
background-color: #4095e5;
|
||||
}
|
||||
.orders .card {
|
||||
min-height: 100rpx;
|
||||
padding: 20rpx;
|
||||
margin: 20rpx 20rpx 0;
|
||||
border-radius: 10rpx;
|
||||
background-color: #fff;
|
||||
}
|
||||
.orders .card:last-child {
|
||||
padding-bottom: 40rpx;
|
||||
}
|
||||
.orders .status {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-size: 28rpx;
|
||||
color: #999;
|
||||
margin-bottom: 15rpx;
|
||||
}
|
||||
.orders .status .title {
|
||||
color: #343434;
|
||||
font-weight: 700;
|
||||
flex: 1;
|
||||
}
|
||||
.orders .status .primary {
|
||||
color: #ff9240;
|
||||
}
|
||||
.orders .status .icon-delete {
|
||||
line-height: 1;
|
||||
margin-left: 10rpx;
|
||||
padding-left: 10rpx;
|
||||
border-left: 1rpx solid #e3e3e3;
|
||||
}
|
||||
.orders .goods {
|
||||
display: flex;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
.orders .goods .cover {
|
||||
width: 170rpx;
|
||||
height: 170rpx;
|
||||
margin-right: 20rpx;
|
||||
border-radius: 10rpx;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
.orders .goods .quantity {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
line-height: 1;
|
||||
padding: 6rpx 4rpx 6rpx 8rpx;
|
||||
font-size: 24rpx;
|
||||
color: #fff;
|
||||
border-radius: 10rpx 0 0 0;
|
||||
background-color: rgba(0, 0, 0, 0.6);
|
||||
}
|
||||
.orders .goods .meta {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
}
|
||||
.orders .goods .name {
|
||||
height: 80rpx;
|
||||
font-size: 26rpx;
|
||||
color: #444;
|
||||
}
|
||||
.orders .goods .type {
|
||||
line-height: 1.8;
|
||||
padding: 0 15rpx;
|
||||
margin-top: 10rpx;
|
||||
font-size: 24rpx;
|
||||
align-self: flex-start;
|
||||
border-radius: 4rpx;
|
||||
color: #888;
|
||||
background-color: #f7f7f8;
|
||||
}
|
||||
.orders .goods .more {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 22rpx;
|
||||
color: #333;
|
||||
}
|
||||
.orders .action {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
padding-top: 20rpx;
|
||||
}
|
||||
.orders .action .button {
|
||||
width: 180rpx;
|
||||
height: 60rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin-left: 20rpx;
|
||||
border-radius: 60rpx;
|
||||
border: 1rpx solid #ccc;
|
||||
font-size: 26rpx;
|
||||
color: #444;
|
||||
}
|
||||
.orders .action .secondary {
|
||||
color: #4095e5;
|
||||
border-color: #4095e5;
|
||||
}
|
||||
.orders .action .primary {
|
||||
color: #fff;
|
||||
background-color: #4095e5;
|
||||
}
|
||||
.orders .loading-text {
|
||||
text-align: center;
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
padding: 20rpx 0;
|
||||
}
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 20px;
|
||||
}
|
||||
.status-btn {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 92rpx;
|
||||
margin: 30rpx;
|
||||
background-color: #007AFF;
|
||||
}
|
||||
.example-body {
|
||||
display: block;
|
||||
padding: 15px;
|
||||
flex-direction: row;
|
||||
}
|
||||
.tab-menu {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
padding: 10px 0;
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
.tab-item {
|
||||
padding: 10px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.tab-item.active {
|
||||
color: #007aff;
|
||||
font-weight: bold;
|
||||
}
|
157
uniapp04/unpackage/dist/dev/mp-weixin/pages/fullOrder/orderStateFive.js
vendored
Normal file
157
uniapp04/unpackage/dist/dev/mp-weixin/pages/fullOrder/orderStateFive.js
vendored
Normal file
@ -0,0 +1,157 @@
|
||||
"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");
|
||||
const _easycom_uni_pagination2 = common_vendor.resolveComponent("uni-pagination");
|
||||
(_easycom_uni_steps2 + _easycom_uni_pagination2)();
|
||||
}
|
||||
const _easycom_uni_steps = () => "../../uni_modules/uni-steps/components/uni-steps/uni-steps.js";
|
||||
const _easycom_uni_pagination = () => "../../uni_modules/uni-pagination/components/uni-pagination/uni-pagination.js";
|
||||
if (!Math) {
|
||||
(_easycom_uni_steps + _easycom_uni_pagination)();
|
||||
}
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
__name: "orderStateFive",
|
||||
setup(__props) {
|
||||
const currentPage = common_vendor.ref(1);
|
||||
const pageSize = common_vendor.ref(10);
|
||||
const totalPage = common_vendor.ref(1);
|
||||
const orderList = common_vendor.ref([]);
|
||||
const getOrder = (page) => {
|
||||
common_vendor.index.request({
|
||||
url: `${API_api.apiImageUrl}/api/orders/my/page`,
|
||||
method: "POST",
|
||||
data: {
|
||||
current: page,
|
||||
endTime: "",
|
||||
id: "",
|
||||
pageSize: pageSize.value,
|
||||
pickupMethod: "",
|
||||
sortField: "",
|
||||
sortOrder: "",
|
||||
startTime: "",
|
||||
state: 5
|
||||
},
|
||||
header: {
|
||||
"Content-Type": "application/json",
|
||||
"cookie": common_vendor.index.getStorageSync("cookie") || ""
|
||||
},
|
||||
success(res) {
|
||||
if (res.data.code === 0) {
|
||||
const records = res.data.data.records;
|
||||
orderList.value = records.reverse();
|
||||
totalPage.value = Math.ceil(res.data.data.total / pageSize.value);
|
||||
console.log("订单数据:", orderList.value);
|
||||
}
|
||||
},
|
||||
fail() {
|
||||
console.log("出错啦");
|
||||
}
|
||||
});
|
||||
};
|
||||
common_vendor.onMounted(() => {
|
||||
getOrder(currentPage.value);
|
||||
});
|
||||
const onPageChange = (e) => {
|
||||
currentPage.value = e.current;
|
||||
getOrder(e.current);
|
||||
};
|
||||
const deleteOrder = (order) => {
|
||||
const orderId = order.id;
|
||||
common_vendor.index.request({
|
||||
url: `${API_api.apiImageUrl}/api/orders/delete`,
|
||||
method: "POST",
|
||||
data: {
|
||||
id: orderId
|
||||
},
|
||||
header: {
|
||||
"Content-Type": "application/json",
|
||||
"cookie": common_vendor.index.getStorageSync("cookie") || ""
|
||||
},
|
||||
success(res) {
|
||||
console.log(res);
|
||||
getOrder(currentPage.value);
|
||||
},
|
||||
fail(Error) {
|
||||
console.log(Error);
|
||||
}
|
||||
});
|
||||
};
|
||||
const evaluation = (order) => {
|
||||
common_vendor.index.setStorageSync("evaluationOrderID", order.id);
|
||||
common_vendor.index.navigateTo({
|
||||
url: "/pages/orderEvaluation/orderEvaluation"
|
||||
});
|
||||
};
|
||||
common_vendor.onMounted(() => {
|
||||
getOrder(currentPage.value);
|
||||
});
|
||||
const tell = (phone) => {
|
||||
console.log(phone);
|
||||
common_vendor.index.makePhoneCall({
|
||||
phoneNumber: phone
|
||||
});
|
||||
};
|
||||
const merchantDetail = (order) => {
|
||||
var _a, _b, _c;
|
||||
console.log((_a = order.businessVO) == null ? void 0 : _a.id);
|
||||
common_vendor.index.setStorageSync("businessItem", (_b = order.businessVO) == null ? void 0 : _b.id);
|
||||
const merchantId = (_c = order.businessVO) == null ? void 0 : _c.id;
|
||||
common_vendor.index.navigateTo({
|
||||
url: `/pages/merchant/merchant?merchantId=${merchantId}`
|
||||
});
|
||||
};
|
||||
return (_ctx, _cache) => {
|
||||
var _a;
|
||||
return {
|
||||
a: common_vendor.f(orderList.value, (order, index, i0) => {
|
||||
var _a2, _b;
|
||||
return common_vendor.e({
|
||||
a: common_vendor.t((_a2 = order.businessVO) == null ? void 0 : _a2.businessName),
|
||||
b: common_vendor.o(($event) => merchantDetail(order), index),
|
||||
c: common_vendor.t(order.id),
|
||||
d: common_vendor.f(1, (sku, k1, i1) => {
|
||||
return {
|
||||
a: common_vendor.f(order.orderDetailsVOList, (item, index2, i2) => {
|
||||
var _a3;
|
||||
return {
|
||||
a: common_vendor.t((_a3 = item.dishesVO) == null ? void 0 : _a3.dishesName),
|
||||
b: common_vendor.t(item.attributeNames)
|
||||
};
|
||||
}),
|
||||
b: sku
|
||||
};
|
||||
}),
|
||||
e: (_b = order.businessVO) == null ? void 0 : _b.businessAvatar,
|
||||
f: "24b321b6-0-" + i0
|
||||
}, {
|
||||
g: common_vendor.o(() => deleteOrder(order), index),
|
||||
h: common_vendor.o(() => {
|
||||
var _a3;
|
||||
return tell((_a3 = order.businessVO) == null ? void 0 : _a3.businessPhone);
|
||||
}, index),
|
||||
i: common_vendor.o(() => evaluation(order), index)
|
||||
}, {
|
||||
k: index
|
||||
});
|
||||
}),
|
||||
b: `/pagesOrder/detail/detail?id=1`,
|
||||
c: common_vendor.p({
|
||||
options: _ctx.list1,
|
||||
active: _ctx.active
|
||||
}),
|
||||
d: common_vendor.t("没有更多数据~"),
|
||||
e: ((_a = _ctx.safeAreaInsets) == null ? void 0 : _a.bottom) + "px",
|
||||
f: common_vendor.o(onPageChange),
|
||||
g: common_vendor.p({
|
||||
title: "订单列表",
|
||||
["show-icon"]: true,
|
||||
current: currentPage.value,
|
||||
total: totalPage.value * pageSize.value
|
||||
})
|
||||
};
|
||||
};
|
||||
}
|
||||
});
|
||||
wx.createComponent(_sfc_main);
|
7
uniapp04/unpackage/dist/dev/mp-weixin/pages/fullOrder/orderStateFive.json
vendored
Normal file
7
uniapp04/unpackage/dist/dev/mp-weixin/pages/fullOrder/orderStateFive.json
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"uni-steps": "../../uni_modules/uni-steps/components/uni-steps/uni-steps",
|
||||
"uni-pagination": "../../uni_modules/uni-pagination/components/uni-pagination/uni-pagination"
|
||||
}
|
||||
}
|
1
uniapp04/unpackage/dist/dev/mp-weixin/pages/fullOrder/orderStateFive.wxml
vendored
Normal file
1
uniapp04/unpackage/dist/dev/mp-weixin/pages/fullOrder/orderStateFive.wxml
vendored
Normal file
@ -0,0 +1 @@
|
||||
<view class="viewport"><scroll-view scroll-y class="orders"><view wx:for="{{a}}" wx:for-item="order" wx:key="k" class="card"><view class="status"><text class="title" bindtap="{{order.b}}">{{order.a}}</text><text>{{order.c}}</text><text class="icon-delete"></text></view><navigator wx:for="{{order.d}}" wx:for-item="sku" wx:key="b" class="goods" url="{{b}}" hover-class="none"><view class="cover"><image mode="aspectFit" src="{{order.e}}"></image></view><view wx:for="{{sku.a}}" wx:for-item="item" class="meta"><view class="type">{{item.a}}--{{item.b}}</view><text class="type">下单即送20积分</text></view></navigator><view><uni-steps wx:if="{{c}}" u-i="{{order.f}}" bind:__l="__l" u-p="{{c}}"/></view><view class="action"><block wx:if="{{true}}"><view class="button primary" bindtap="{{order.g}}">删除订单</view><view class="button primary" bindtap="{{order.h}}">拨打电话</view><view class="button primary" bindtap="{{order.i}}">去评价</view></block><block wx:else><navigator class="button secondary" url="{{order.j}}" hover-class="none"> 再次购买 </navigator><view wx:if="{{false}}" class="button primary">确认收货</view></block></view></view><view class="loading-text" style="{{'padding-bottom:' + e}}">{{d}}</view></scroll-view><uni-pagination wx:if="{{g}}" bindchange="{{f}}" u-i="24b321b6-1" bind:__l="__l" u-p="{{g}}"/></view>
|
214
uniapp04/unpackage/dist/dev/mp-weixin/pages/fullOrder/orderStateFive.wxss
vendored
Normal file
214
uniapp04/unpackage/dist/dev/mp-weixin/pages/fullOrder/orderStateFive.wxss
vendored
Normal file
@ -0,0 +1,214 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
page {
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
.viewport {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background-color: #fff;
|
||||
}
|
||||
.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: 20%;
|
||||
height: 6rpx;
|
||||
padding: 0 50rpx;
|
||||
background-color: #4095e5;
|
||||
transition: all 0.4s;
|
||||
}
|
||||
.swiper {
|
||||
background-color: #4095e5;
|
||||
}
|
||||
.orders .card {
|
||||
min-height: 100rpx;
|
||||
padding: 20rpx;
|
||||
margin: 20rpx 20rpx 0;
|
||||
border-radius: 10rpx;
|
||||
background-color: #fff;
|
||||
}
|
||||
.orders .card:last-child {
|
||||
padding-bottom: 40rpx;
|
||||
}
|
||||
.orders .status {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-size: 28rpx;
|
||||
color: #999;
|
||||
margin-bottom: 15rpx;
|
||||
}
|
||||
.orders .status .title {
|
||||
color: #343434;
|
||||
font-weight: 700;
|
||||
flex: 1;
|
||||
}
|
||||
.orders .status .primary {
|
||||
color: #ff9240;
|
||||
}
|
||||
.orders .status .icon-delete {
|
||||
line-height: 1;
|
||||
margin-left: 10rpx;
|
||||
padding-left: 10rpx;
|
||||
border-left: 1rpx solid #e3e3e3;
|
||||
}
|
||||
.orders .goods {
|
||||
display: flex;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
.orders .goods .cover {
|
||||
width: 170rpx;
|
||||
height: 170rpx;
|
||||
margin-right: 20rpx;
|
||||
border-radius: 10rpx;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
.orders .goods .quantity {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
line-height: 1;
|
||||
padding: 6rpx 4rpx 6rpx 8rpx;
|
||||
font-size: 24rpx;
|
||||
color: #fff;
|
||||
border-radius: 10rpx 0 0 0;
|
||||
background-color: rgba(0, 0, 0, 0.6);
|
||||
}
|
||||
.orders .goods .meta {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
}
|
||||
.orders .goods .name {
|
||||
height: 80rpx;
|
||||
font-size: 26rpx;
|
||||
color: #444;
|
||||
}
|
||||
.orders .goods .type {
|
||||
line-height: 1.8;
|
||||
padding: 0 15rpx;
|
||||
margin-top: 10rpx;
|
||||
font-size: 24rpx;
|
||||
align-self: flex-start;
|
||||
border-radius: 4rpx;
|
||||
color: #888;
|
||||
background-color: #f7f7f8;
|
||||
}
|
||||
.orders .goods .more {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 22rpx;
|
||||
color: #333;
|
||||
}
|
||||
.orders .action {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
padding-top: 20rpx;
|
||||
}
|
||||
.orders .action .button {
|
||||
width: 180rpx;
|
||||
height: 60rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin-left: 20rpx;
|
||||
border-radius: 60rpx;
|
||||
border: 1rpx solid #ccc;
|
||||
font-size: 26rpx;
|
||||
color: #444;
|
||||
}
|
||||
.orders .action .secondary {
|
||||
color: #4095e5;
|
||||
border-color: #4095e5;
|
||||
}
|
||||
.orders .action .primary {
|
||||
color: #fff;
|
||||
background-color: #4095e5;
|
||||
}
|
||||
.orders .loading-text {
|
||||
text-align: center;
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
padding: 20rpx 0;
|
||||
}
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 20px;
|
||||
}
|
||||
.status-btn {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 92rpx;
|
||||
margin: 30rpx;
|
||||
background-color: #007AFF;
|
||||
}
|
||||
.example-body {
|
||||
display: block;
|
||||
padding: 15px;
|
||||
flex-direction: row;
|
||||
}
|
||||
.tab-menu {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
padding: 10px 0;
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
.tab-item {
|
||||
padding: 10px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.tab-item.active {
|
||||
color: #007aff;
|
||||
font-weight: bold;
|
||||
}
|
156
uniapp04/unpackage/dist/dev/mp-weixin/pages/fullOrder/orderStateOne.js
vendored
Normal file
156
uniapp04/unpackage/dist/dev/mp-weixin/pages/fullOrder/orderStateOne.js
vendored
Normal file
@ -0,0 +1,156 @@
|
||||
"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");
|
||||
const _easycom_uni_pagination2 = common_vendor.resolveComponent("uni-pagination");
|
||||
(_easycom_uni_steps2 + _easycom_uni_pagination2)();
|
||||
}
|
||||
const _easycom_uni_steps = () => "../../uni_modules/uni-steps/components/uni-steps/uni-steps.js";
|
||||
const _easycom_uni_pagination = () => "../../uni_modules/uni-pagination/components/uni-pagination/uni-pagination.js";
|
||||
if (!Math) {
|
||||
(_easycom_uni_steps + _easycom_uni_pagination)();
|
||||
}
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
__name: "orderStateOne",
|
||||
setup(__props) {
|
||||
const currentPage = common_vendor.ref(1);
|
||||
const pageSize = common_vendor.ref(10);
|
||||
const totalItems = common_vendor.ref(0);
|
||||
const active = common_vendor.ref(1);
|
||||
const list1 = common_vendor.reactive([
|
||||
{ title: "备餐中" },
|
||||
{ title: "已出餐" },
|
||||
{ title: "已完成" }
|
||||
]);
|
||||
const orderList = common_vendor.ref([]);
|
||||
const getOrder = (page) => {
|
||||
common_vendor.index.request({
|
||||
url: `${API_api.apiImageUrl}/api/orders/my/page`,
|
||||
method: "POST",
|
||||
data: {
|
||||
current: page,
|
||||
endTime: "",
|
||||
id: "",
|
||||
pageSize: pageSize.value,
|
||||
pickupMethod: "",
|
||||
sortField: "",
|
||||
sortOrder: "",
|
||||
startTime: "",
|
||||
state: 2
|
||||
},
|
||||
header: {
|
||||
"Content-Type": "application/json",
|
||||
"cookie": common_vendor.index.getStorageSync("cookie") || ""
|
||||
},
|
||||
success(res) {
|
||||
if (res.data.code === 0) {
|
||||
const records = res.data.data.records;
|
||||
orderList.value = records;
|
||||
totalItems.value = res.data.data.total;
|
||||
console.log("订单数据:", orderList.value);
|
||||
}
|
||||
},
|
||||
fail() {
|
||||
console.log("出错啦");
|
||||
}
|
||||
});
|
||||
};
|
||||
const deleteOrder = async (orderId) => {
|
||||
try {
|
||||
const response = await common_vendor.index.request({
|
||||
url: `${API_api.apiImageUrl}/api/orders/delete`,
|
||||
method: "POST",
|
||||
header: {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
data: JSON.stringify({ id: orderId })
|
||||
});
|
||||
if (response.statusCode === 200) {
|
||||
console.log(`成功取消订单:${orderId}`);
|
||||
common_vendor.index.showModal({
|
||||
title: "提示",
|
||||
content: "删除订单成功",
|
||||
showCancel: false,
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
getOrder();
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
console.error(`无法取消订单:${orderId},错误码:${response.statusCode}`);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(`发生错误:${error.message}`);
|
||||
}
|
||||
};
|
||||
const onPageChange = (e) => {
|
||||
currentPage.value = e.current;
|
||||
getOrder(e.current);
|
||||
};
|
||||
common_vendor.onMounted(() => {
|
||||
getOrder(currentPage.value);
|
||||
});
|
||||
const orderDetail = (order) => {
|
||||
console.log(order);
|
||||
};
|
||||
const merchantDetail = (order) => {
|
||||
var _a, _b, _c;
|
||||
console.log((_a = order.businessVO) == null ? void 0 : _a.id);
|
||||
common_vendor.index.setStorageSync("businessItem", (_b = order.businessVO) == null ? void 0 : _b.id);
|
||||
const merchantId = (_c = order.businessVO) == null ? void 0 : _c.id;
|
||||
common_vendor.index.navigateTo({
|
||||
url: `/pages/merchant/merchant?merchantId=${merchantId}`
|
||||
});
|
||||
};
|
||||
return (_ctx, _cache) => {
|
||||
var _a;
|
||||
return {
|
||||
a: common_vendor.f(orderList.value, (order, index, i0) => {
|
||||
var _a2, _b;
|
||||
return common_vendor.e({
|
||||
a: common_vendor.t((_a2 = order.businessVO) == null ? void 0 : _a2.businessName),
|
||||
b: common_vendor.o(($event) => merchantDetail(order), index),
|
||||
c: common_vendor.t(order.id),
|
||||
d: common_vendor.f(1, (sku, k1, i1) => {
|
||||
return {
|
||||
a: common_vendor.f(order.orderDetailsVOList, (item, index2, i2) => {
|
||||
var _a3;
|
||||
return {
|
||||
a: common_vendor.t((_a3 = item.dishesVO) == null ? void 0 : _a3.dishesName),
|
||||
b: common_vendor.t(item.attributeNames)
|
||||
};
|
||||
}),
|
||||
b: sku
|
||||
};
|
||||
}),
|
||||
e: (_b = order.businessVO) == null ? void 0 : _b.businessAvatar,
|
||||
f: "979ef368-0-" + i0
|
||||
}, {
|
||||
g: common_vendor.o(() => deleteOrder(order.id), index)
|
||||
}, {
|
||||
i: index,
|
||||
j: common_vendor.o(($event) => orderDetail(order), index)
|
||||
});
|
||||
}),
|
||||
b: `/pagesOrder/detail/detail?id=1`,
|
||||
c: common_vendor.p({
|
||||
options: list1,
|
||||
active: active.value
|
||||
}),
|
||||
d: common_vendor.t("没有更多数据~"),
|
||||
e: ((_a = _ctx.safeAreaInsets) == null ? void 0 : _a.bottom) + "px",
|
||||
f: common_vendor.o(onPageChange),
|
||||
g: common_vendor.p({
|
||||
title: "订单列表",
|
||||
["show-icon"]: true,
|
||||
current: currentPage.value,
|
||||
total: totalItems.value,
|
||||
pageSize: pageSize.value
|
||||
})
|
||||
};
|
||||
};
|
||||
}
|
||||
});
|
||||
wx.createComponent(_sfc_main);
|
7
uniapp04/unpackage/dist/dev/mp-weixin/pages/fullOrder/orderStateOne.json
vendored
Normal file
7
uniapp04/unpackage/dist/dev/mp-weixin/pages/fullOrder/orderStateOne.json
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"uni-steps": "../../uni_modules/uni-steps/components/uni-steps/uni-steps",
|
||||
"uni-pagination": "../../uni_modules/uni-pagination/components/uni-pagination/uni-pagination"
|
||||
}
|
||||
}
|
1
uniapp04/unpackage/dist/dev/mp-weixin/pages/fullOrder/orderStateOne.wxml
vendored
Normal file
1
uniapp04/unpackage/dist/dev/mp-weixin/pages/fullOrder/orderStateOne.wxml
vendored
Normal file
@ -0,0 +1 @@
|
||||
<view class="viewport"><scroll-view scroll-y class="orders"><view wx:for="{{a}}" wx:for-item="order" wx:key="i" class="card" bindtap="{{order.j}}"><view class="status"><text class="title" bindtap="{{order.b}}">{{order.a}}</text><text>{{order.c}}</text><text class="icon-delete"></text></view><navigator wx:for="{{order.d}}" wx:for-item="sku" wx:key="b" class="goods" url="{{b}}" hover-class="none"><view class="cover"><image mode="aspectFit" src="{{order.e}}"></image></view><view wx:for="{{sku.a}}" wx:for-item="item" class="meta"><view class="type">{{item.a}}--{{item.b}}</view><text class="type">下单即送20积分</text></view></navigator><view><uni-steps wx:if="{{c}}" u-i="{{order.f}}" bind:__l="__l" u-p="{{c}}"/></view><view class="action"><block wx:if="{{true}}"><view class="button primary" bindtap="{{order.g}}">删除订单</view><view class="button primary">在线联系</view></block><block wx:else><navigator class="button secondary" url="{{order.h}}" hover-class="none"> 再次购买 </navigator><view wx:if="{{false}}" class="button primary">确认收货</view></block></view></view><view class="loading-text" style="{{'padding-bottom:' + e}}">{{d}}</view></scroll-view><uni-pagination wx:if="{{g}}" bindchange="{{f}}" u-i="979ef368-1" bind:__l="__l" u-p="{{g}}"/></view>
|
214
uniapp04/unpackage/dist/dev/mp-weixin/pages/fullOrder/orderStateOne.wxss
vendored
Normal file
214
uniapp04/unpackage/dist/dev/mp-weixin/pages/fullOrder/orderStateOne.wxss
vendored
Normal file
@ -0,0 +1,214 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
page {
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
.viewport {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background-color: #fff;
|
||||
}
|
||||
.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: 20%;
|
||||
height: 6rpx;
|
||||
padding: 0 50rpx;
|
||||
background-color: #4095e5;
|
||||
transition: all 0.4s;
|
||||
}
|
||||
.swiper {
|
||||
background-color: #4095e5;
|
||||
}
|
||||
.orders .card {
|
||||
min-height: 100rpx;
|
||||
padding: 20rpx;
|
||||
margin: 20rpx 20rpx 0;
|
||||
border-radius: 10rpx;
|
||||
background-color: #fff;
|
||||
}
|
||||
.orders .card:last-child {
|
||||
padding-bottom: 40rpx;
|
||||
}
|
||||
.orders .status {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-size: 28rpx;
|
||||
color: #999;
|
||||
margin-bottom: 15rpx;
|
||||
}
|
||||
.orders .status .title {
|
||||
color: #343434;
|
||||
font-weight: 700;
|
||||
flex: 1;
|
||||
}
|
||||
.orders .status .primary {
|
||||
color: #ff9240;
|
||||
}
|
||||
.orders .status .icon-delete {
|
||||
line-height: 1;
|
||||
margin-left: 10rpx;
|
||||
padding-left: 10rpx;
|
||||
border-left: 1rpx solid #e3e3e3;
|
||||
}
|
||||
.orders .goods {
|
||||
display: flex;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
.orders .goods .cover {
|
||||
width: 170rpx;
|
||||
height: 170rpx;
|
||||
margin-right: 20rpx;
|
||||
border-radius: 10rpx;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
.orders .goods .quantity {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
line-height: 1;
|
||||
padding: 6rpx 4rpx 6rpx 8rpx;
|
||||
font-size: 24rpx;
|
||||
color: #fff;
|
||||
border-radius: 10rpx 0 0 0;
|
||||
background-color: rgba(0, 0, 0, 0.6);
|
||||
}
|
||||
.orders .goods .meta {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
}
|
||||
.orders .goods .name {
|
||||
height: 80rpx;
|
||||
font-size: 26rpx;
|
||||
color: #444;
|
||||
}
|
||||
.orders .goods .type {
|
||||
line-height: 1.8;
|
||||
padding: 0 15rpx;
|
||||
margin-top: 10rpx;
|
||||
font-size: 24rpx;
|
||||
align-self: flex-start;
|
||||
border-radius: 4rpx;
|
||||
color: #888;
|
||||
background-color: #f7f7f8;
|
||||
}
|
||||
.orders .goods .more {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 22rpx;
|
||||
color: #333;
|
||||
}
|
||||
.orders .action {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
padding-top: 20rpx;
|
||||
}
|
||||
.orders .action .button {
|
||||
width: 180rpx;
|
||||
height: 60rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin-left: 20rpx;
|
||||
border-radius: 60rpx;
|
||||
border: 1rpx solid #ccc;
|
||||
font-size: 26rpx;
|
||||
color: #444;
|
||||
}
|
||||
.orders .action .secondary {
|
||||
color: #4095e5;
|
||||
border-color: #4095e5;
|
||||
}
|
||||
.orders .action .primary {
|
||||
color: #fff;
|
||||
background-color: #4095e5;
|
||||
}
|
||||
.orders .loading-text {
|
||||
text-align: center;
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
padding: 20rpx 0;
|
||||
}
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 20px;
|
||||
}
|
||||
.status-btn {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 92rpx;
|
||||
margin: 30rpx;
|
||||
background-color: #007AFF;
|
||||
}
|
||||
.example-body {
|
||||
display: block;
|
||||
padding: 15px;
|
||||
flex-direction: row;
|
||||
}
|
||||
.tab-menu {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
padding: 10px 0;
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
.tab-item {
|
||||
padding: 10px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.tab-item.active {
|
||||
color: #007aff;
|
||||
font-weight: bold;
|
||||
}
|
145
uniapp04/unpackage/dist/dev/mp-weixin/pages/fullOrder/orderStateThree.js
vendored
Normal file
145
uniapp04/unpackage/dist/dev/mp-weixin/pages/fullOrder/orderStateThree.js
vendored
Normal file
@ -0,0 +1,145 @@
|
||||
"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");
|
||||
const _easycom_uni_pagination2 = common_vendor.resolveComponent("uni-pagination");
|
||||
(_easycom_uni_steps2 + _easycom_uni_pagination2)();
|
||||
}
|
||||
const _easycom_uni_steps = () => "../../uni_modules/uni-steps/components/uni-steps/uni-steps.js";
|
||||
const _easycom_uni_pagination = () => "../../uni_modules/uni-pagination/components/uni-pagination/uni-pagination.js";
|
||||
if (!Math) {
|
||||
(_easycom_uni_steps + _easycom_uni_pagination)();
|
||||
}
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
__name: "orderStateThree",
|
||||
setup(__props) {
|
||||
const currentPage = common_vendor.ref(1);
|
||||
const pageSize = common_vendor.ref(10);
|
||||
const totalItems = common_vendor.ref(0);
|
||||
const orderList = common_vendor.ref([]);
|
||||
const tell = (phone) => {
|
||||
console.log(phone);
|
||||
common_vendor.index.makePhoneCall({
|
||||
phoneNumber: phone
|
||||
});
|
||||
};
|
||||
const obtion = (order) => {
|
||||
console.log(order.id);
|
||||
common_vendor.index.request({
|
||||
url: `${API_api.apiImageUrl}/api/orders/update/state/user`,
|
||||
method: "POST",
|
||||
data: {
|
||||
id: order.id
|
||||
},
|
||||
header: {
|
||||
"Content-Type": "application/json",
|
||||
"cookie": common_vendor.index.getStorageSync("cookie") || ""
|
||||
},
|
||||
success(res) {
|
||||
console.log(res);
|
||||
},
|
||||
fail(err) {
|
||||
console.log(err);
|
||||
}
|
||||
});
|
||||
};
|
||||
const getOrder = (page) => {
|
||||
common_vendor.index.request({
|
||||
url: `${API_api.apiImageUrl}/api/orders/my/page`,
|
||||
method: "POST",
|
||||
data: {
|
||||
current: page,
|
||||
endTime: "",
|
||||
id: "",
|
||||
pageSize: pageSize.value,
|
||||
pickupMethod: "",
|
||||
sortField: "",
|
||||
sortOrder: "",
|
||||
startTime: "",
|
||||
state: 4
|
||||
},
|
||||
header: {
|
||||
"Content-Type": "application/json",
|
||||
"cookie": common_vendor.index.getStorageSync("cookie") || ""
|
||||
},
|
||||
success(res) {
|
||||
if (res.data.code === 0) {
|
||||
const records = res.data.data.records;
|
||||
orderList.value = records.reverse();
|
||||
totalItems.value = res.data.data.total;
|
||||
console.log("订单数据:", orderList.value);
|
||||
}
|
||||
},
|
||||
fail() {
|
||||
console.log("出错啦");
|
||||
}
|
||||
});
|
||||
};
|
||||
const onPageChange = (e) => {
|
||||
currentPage.value = e.current;
|
||||
getOrder(e.current);
|
||||
};
|
||||
common_vendor.onMounted(() => {
|
||||
getOrder(currentPage.value);
|
||||
});
|
||||
const merchantDetail = (order) => {
|
||||
var _a, _b, _c;
|
||||
console.log((_a = order.businessVO) == null ? void 0 : _a.id);
|
||||
common_vendor.index.setStorageSync("businessItem", (_b = order.businessVO) == null ? void 0 : _b.id);
|
||||
const merchantId = (_c = order.businessVO) == null ? void 0 : _c.id;
|
||||
common_vendor.index.navigateTo({
|
||||
url: `/pages/merchant/merchant?merchantId=${merchantId}`
|
||||
});
|
||||
};
|
||||
return (_ctx, _cache) => {
|
||||
var _a;
|
||||
return {
|
||||
a: common_vendor.f(orderList.value, (order, index, i0) => {
|
||||
var _a2, _b;
|
||||
return {
|
||||
a: common_vendor.t((_a2 = order.businessVO) == null ? void 0 : _a2.businessName),
|
||||
b: common_vendor.o(($event) => merchantDetail(order), index),
|
||||
c: common_vendor.t(order.id),
|
||||
d: common_vendor.f(1, (sku, k1, i1) => {
|
||||
return {
|
||||
a: common_vendor.f(order.orderDetailsVOList, (item, index2, i2) => {
|
||||
var _a3;
|
||||
return {
|
||||
a: common_vendor.t((_a3 = item.dishesVO) == null ? void 0 : _a3.dishesName),
|
||||
b: common_vendor.t(item.attributeNames)
|
||||
};
|
||||
}),
|
||||
b: sku
|
||||
};
|
||||
}),
|
||||
e: (_b = order.businessVO) == null ? void 0 : _b.businessAvatar,
|
||||
f: "54db654a-0-" + i0,
|
||||
g: common_vendor.o(() => obtion(order), index),
|
||||
h: common_vendor.o(() => {
|
||||
var _a3;
|
||||
return tell((_a3 = order.businessVO) == null ? void 0 : _a3.businessPhone);
|
||||
}, index),
|
||||
i: index
|
||||
};
|
||||
}),
|
||||
b: `/pagesOrder/detail/detail?id=1`,
|
||||
c: common_vendor.p({
|
||||
options: _ctx.list1,
|
||||
active: _ctx.active
|
||||
}),
|
||||
d: common_vendor.t("没有更多数据~"),
|
||||
e: ((_a = _ctx.safeAreaInsets) == null ? void 0 : _a.bottom) + "px",
|
||||
f: common_vendor.o(onPageChange),
|
||||
g: common_vendor.p({
|
||||
title: "订单列表",
|
||||
["show-icon"]: true,
|
||||
current: currentPage.value,
|
||||
total: totalItems.value,
|
||||
pageSize: pageSize.value
|
||||
})
|
||||
};
|
||||
};
|
||||
}
|
||||
});
|
||||
wx.createComponent(_sfc_main);
|
7
uniapp04/unpackage/dist/dev/mp-weixin/pages/fullOrder/orderStateThree.json
vendored
Normal file
7
uniapp04/unpackage/dist/dev/mp-weixin/pages/fullOrder/orderStateThree.json
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"uni-steps": "../../uni_modules/uni-steps/components/uni-steps/uni-steps",
|
||||
"uni-pagination": "../../uni_modules/uni-pagination/components/uni-pagination/uni-pagination"
|
||||
}
|
||||
}
|
1
uniapp04/unpackage/dist/dev/mp-weixin/pages/fullOrder/orderStateThree.wxml
vendored
Normal file
1
uniapp04/unpackage/dist/dev/mp-weixin/pages/fullOrder/orderStateThree.wxml
vendored
Normal file
@ -0,0 +1 @@
|
||||
<view class="viewport"><scroll-view scroll-y class="orders"><view wx:for="{{a}}" wx:for-item="order" wx:key="i" class="card"><view class="status"><text class="title" bindtap="{{order.b}}">{{order.a}}</text><text>{{order.c}}</text><text class="icon-delete"></text></view><navigator wx:for="{{order.d}}" wx:for-item="sku" wx:key="b" class="goods" url="{{b}}" hover-class="none"><view class="cover"><image mode="aspectFit" src="{{order.e}}"></image></view><view wx:for="{{sku.a}}" wx:for-item="item" class="meta"><view class="type">{{item.a}}--{{item.b}}</view><text class="type">下单即送20积分</text></view></navigator><view><uni-steps wx:if="{{c}}" u-i="{{order.f}}" bind:__l="__l" u-p="{{c}}"/></view><view class="action"><view class="button primary" bindtap="{{order.g}}">确认收货</view><view class="button primary" bindtap="{{order.h}}">拨打电话</view></view></view><view class="loading-text" style="{{'padding-bottom:' + e}}">{{d}}</view></scroll-view><uni-pagination wx:if="{{g}}" bindchange="{{f}}" u-i="54db654a-1" bind:__l="__l" u-p="{{g}}"/></view>
|
214
uniapp04/unpackage/dist/dev/mp-weixin/pages/fullOrder/orderStateThree.wxss
vendored
Normal file
214
uniapp04/unpackage/dist/dev/mp-weixin/pages/fullOrder/orderStateThree.wxss
vendored
Normal file
@ -0,0 +1,214 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
page {
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
.viewport {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background-color: #fff;
|
||||
}
|
||||
.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: 20%;
|
||||
height: 6rpx;
|
||||
padding: 0 50rpx;
|
||||
background-color: #4095e5;
|
||||
transition: all 0.4s;
|
||||
}
|
||||
.swiper {
|
||||
background-color: #4095e5;
|
||||
}
|
||||
.orders .card {
|
||||
min-height: 100rpx;
|
||||
padding: 20rpx;
|
||||
margin: 20rpx 20rpx 0;
|
||||
border-radius: 10rpx;
|
||||
background-color: #fff;
|
||||
}
|
||||
.orders .card:last-child {
|
||||
padding-bottom: 40rpx;
|
||||
}
|
||||
.orders .status {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-size: 28rpx;
|
||||
color: #999;
|
||||
margin-bottom: 15rpx;
|
||||
}
|
||||
.orders .status .title {
|
||||
color: #343434;
|
||||
font-weight: 700;
|
||||
flex: 1;
|
||||
}
|
||||
.orders .status .primary {
|
||||
color: #ff9240;
|
||||
}
|
||||
.orders .status .icon-delete {
|
||||
line-height: 1;
|
||||
margin-left: 10rpx;
|
||||
padding-left: 10rpx;
|
||||
border-left: 1rpx solid #e3e3e3;
|
||||
}
|
||||
.orders .goods {
|
||||
display: flex;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
.orders .goods .cover {
|
||||
width: 170rpx;
|
||||
height: 170rpx;
|
||||
margin-right: 20rpx;
|
||||
border-radius: 10rpx;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
.orders .goods .quantity {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
line-height: 1;
|
||||
padding: 6rpx 4rpx 6rpx 8rpx;
|
||||
font-size: 24rpx;
|
||||
color: #fff;
|
||||
border-radius: 10rpx 0 0 0;
|
||||
background-color: rgba(0, 0, 0, 0.6);
|
||||
}
|
||||
.orders .goods .meta {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
}
|
||||
.orders .goods .name {
|
||||
height: 80rpx;
|
||||
font-size: 26rpx;
|
||||
color: #444;
|
||||
}
|
||||
.orders .goods .type {
|
||||
line-height: 1.8;
|
||||
padding: 0 15rpx;
|
||||
margin-top: 10rpx;
|
||||
font-size: 24rpx;
|
||||
align-self: flex-start;
|
||||
border-radius: 4rpx;
|
||||
color: #888;
|
||||
background-color: #f7f7f8;
|
||||
}
|
||||
.orders .goods .more {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 22rpx;
|
||||
color: #333;
|
||||
}
|
||||
.orders .action {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
padding-top: 20rpx;
|
||||
}
|
||||
.orders .action .button {
|
||||
width: 180rpx;
|
||||
height: 60rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin-left: 20rpx;
|
||||
border-radius: 60rpx;
|
||||
border: 1rpx solid #ccc;
|
||||
font-size: 26rpx;
|
||||
color: #444;
|
||||
}
|
||||
.orders .action .secondary {
|
||||
color: #4095e5;
|
||||
border-color: #4095e5;
|
||||
}
|
||||
.orders .action .primary {
|
||||
color: #fff;
|
||||
background-color: #4095e5;
|
||||
}
|
||||
.orders .loading-text {
|
||||
text-align: center;
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
padding: 20rpx 0;
|
||||
}
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 20px;
|
||||
}
|
||||
.status-btn {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 92rpx;
|
||||
margin: 30rpx;
|
||||
background-color: #007AFF;
|
||||
}
|
||||
.example-body {
|
||||
display: block;
|
||||
padding: 15px;
|
||||
flex-direction: row;
|
||||
}
|
||||
.tab-menu {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
padding: 10px 0;
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
.tab-item {
|
||||
padding: 10px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.tab-item.active {
|
||||
color: #007aff;
|
||||
font-weight: bold;
|
||||
}
|
198
uniapp04/unpackage/dist/dev/mp-weixin/pages/fullOrder/orderStateZero.js
vendored
Normal file
198
uniapp04/unpackage/dist/dev/mp-weixin/pages/fullOrder/orderStateZero.js
vendored
Normal file
@ -0,0 +1,198 @@
|
||||
"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");
|
||||
const _easycom_uni_pagination2 = common_vendor.resolveComponent("uni-pagination");
|
||||
(_easycom_uni_steps2 + _easycom_uni_pagination2)();
|
||||
}
|
||||
const _easycom_uni_steps = () => "../../uni_modules/uni-steps/components/uni-steps/uni-steps.js";
|
||||
const _easycom_uni_pagination = () => "../../uni_modules/uni-pagination/components/uni-pagination/uni-pagination.js";
|
||||
if (!Math) {
|
||||
(_easycom_uni_steps + _easycom_uni_pagination)();
|
||||
}
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
__name: "orderStateZero",
|
||||
setup(__props) {
|
||||
const currentPage = common_vendor.ref(1);
|
||||
const pageSize = common_vendor.ref(10);
|
||||
const totalItems = common_vendor.ref(0);
|
||||
const active = common_vendor.ref(1);
|
||||
const list1 = common_vendor.reactive([
|
||||
{ title: "备餐中" },
|
||||
{ title: "已出餐" },
|
||||
{ title: "已完成" }
|
||||
]);
|
||||
const orderList = common_vendor.ref([]);
|
||||
const getOrder = (page) => {
|
||||
common_vendor.index.request({
|
||||
url: `${API_api.apiImageUrl}/api/orders/my/page`,
|
||||
method: "POST",
|
||||
data: {
|
||||
current: page,
|
||||
endTime: "",
|
||||
id: "",
|
||||
pageSize: pageSize.value,
|
||||
pickupMethod: "",
|
||||
sortField: "",
|
||||
sortOrder: "",
|
||||
startTime: "",
|
||||
state: 1
|
||||
},
|
||||
header: {
|
||||
"Content-Type": "application/json",
|
||||
"cookie": common_vendor.index.getStorageSync("cookie") || ""
|
||||
},
|
||||
success(res) {
|
||||
if (res.data.code === 0) {
|
||||
const records = res.data.data.records;
|
||||
orderList.value = records.reverse();
|
||||
totalItems.value = res.data.data.total;
|
||||
console.log("订单数据:", orderList.value);
|
||||
}
|
||||
},
|
||||
fail() {
|
||||
console.log("出错啦");
|
||||
}
|
||||
});
|
||||
};
|
||||
const onPageChange = (e) => {
|
||||
currentPage.value = e.current;
|
||||
getOrder(e.current);
|
||||
};
|
||||
const deleteOrder = (order) => {
|
||||
const orderId = order.id;
|
||||
common_vendor.index.request({
|
||||
url: `${API_api.apiImageUrl}/api/orders/delete`,
|
||||
method: "POST",
|
||||
data: {
|
||||
id: orderId
|
||||
},
|
||||
success(res) {
|
||||
console.log(res);
|
||||
getOrder(currentPage.value);
|
||||
},
|
||||
fail(Error) {
|
||||
console.log(Error);
|
||||
}
|
||||
});
|
||||
};
|
||||
common_vendor.onMounted(() => {
|
||||
getOrder(currentPage.value);
|
||||
});
|
||||
const refund = (order) => {
|
||||
console.log(order.pickupCode);
|
||||
common_vendor.index.setStorageSync("pickupCode", order.pickupCode);
|
||||
common_vendor.index.setStorageSync("refundId", order.id);
|
||||
common_vendor.index.navigateTo({
|
||||
url: "/pages/refund/refund"
|
||||
});
|
||||
};
|
||||
const showButton = common_vendor.ref(true);
|
||||
const countdownTime = common_vendor.ref(180);
|
||||
let intervalId;
|
||||
common_vendor.onMounted(() => {
|
||||
intervalId = setInterval(() => {
|
||||
if (countdownTime.value > 0) {
|
||||
countdownTime.value--;
|
||||
} else {
|
||||
clearInterval(intervalId);
|
||||
showButton.value = false;
|
||||
}
|
||||
}, 1e3);
|
||||
});
|
||||
common_vendor.onUnmounted(() => {
|
||||
clearInterval(intervalId);
|
||||
});
|
||||
const tell = (phone) => {
|
||||
console.log(phone);
|
||||
common_vendor.index.makePhoneCall({
|
||||
phoneNumber: phone
|
||||
});
|
||||
};
|
||||
const obtion = (order) => {
|
||||
console.log(order.id);
|
||||
common_vendor.index.request({
|
||||
url: `${API_api.apiImageUrl}/api/orders/update/state/user`,
|
||||
method: "POST",
|
||||
data: {
|
||||
id: order.id
|
||||
},
|
||||
header: {
|
||||
"Content-Type": "application/json",
|
||||
"cookie": common_vendor.index.getStorageSync("cookie") || ""
|
||||
},
|
||||
success(res) {
|
||||
console.log(res);
|
||||
},
|
||||
fail(err) {
|
||||
console.log(err);
|
||||
}
|
||||
});
|
||||
};
|
||||
const merchantDetail = (order) => {
|
||||
var _a, _b, _c;
|
||||
console.log((_a = order.businessVO) == null ? void 0 : _a.id);
|
||||
common_vendor.index.setStorageSync("businessItem", (_b = order.businessVO) == null ? void 0 : _b.id);
|
||||
const merchantId = (_c = order.businessVO) == null ? void 0 : _c.id;
|
||||
common_vendor.index.navigateTo({
|
||||
url: `/pages/merchant/merchant?merchantId=${merchantId}`
|
||||
});
|
||||
};
|
||||
return (_ctx, _cache) => {
|
||||
var _a;
|
||||
return {
|
||||
a: common_vendor.f(orderList.value, (order, index, i0) => {
|
||||
var _a2, _b;
|
||||
return common_vendor.e({
|
||||
a: common_vendor.t((_a2 = order.businessVO) == null ? void 0 : _a2.businessName),
|
||||
b: common_vendor.o(($event) => merchantDetail(order), index),
|
||||
c: common_vendor.t(order.id),
|
||||
d: common_vendor.f(1, (sku, k1, i1) => {
|
||||
return {
|
||||
a: common_vendor.f(order.orderDetailsVOList, (item, index2, i2) => {
|
||||
var _a3;
|
||||
return {
|
||||
a: common_vendor.t((_a3 = item.dishesVO) == null ? void 0 : _a3.dishesName),
|
||||
b: common_vendor.t(item.attributeNames)
|
||||
};
|
||||
}),
|
||||
b: sku
|
||||
};
|
||||
}),
|
||||
e: (_b = order.businessVO) == null ? void 0 : _b.businessAvatar,
|
||||
f: "686b3eac-0-" + i0
|
||||
}, common_vendor.e({
|
||||
g: common_vendor.o(() => deleteOrder(order), index),
|
||||
h: common_vendor.o(() => obtion(order), index),
|
||||
i: common_vendor.o(() => {
|
||||
var _a3;
|
||||
return tell((_a3 = order.businessVO) == null ? void 0 : _a3.businessPhone);
|
||||
}, index),
|
||||
j: showButton.value
|
||||
}, showButton.value ? {
|
||||
k: common_vendor.o(() => refund(order), index)
|
||||
} : {}), {
|
||||
m: index
|
||||
});
|
||||
}),
|
||||
b: `/pagesOrder/detail/detail?id=1`,
|
||||
c: common_vendor.p({
|
||||
options: list1,
|
||||
active: active.value
|
||||
}),
|
||||
d: common_vendor.t("没有更多数据~"),
|
||||
e: ((_a = _ctx.safeAreaInsets) == null ? void 0 : _a.bottom) + "px",
|
||||
f: common_vendor.o(onPageChange),
|
||||
g: common_vendor.p({
|
||||
title: "订单列表",
|
||||
["show-icon"]: true,
|
||||
current: currentPage.value,
|
||||
total: totalItems.value,
|
||||
pageSize: pageSize.value
|
||||
})
|
||||
};
|
||||
};
|
||||
}
|
||||
});
|
||||
wx.createComponent(_sfc_main);
|
7
uniapp04/unpackage/dist/dev/mp-weixin/pages/fullOrder/orderStateZero.json
vendored
Normal file
7
uniapp04/unpackage/dist/dev/mp-weixin/pages/fullOrder/orderStateZero.json
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"uni-steps": "../../uni_modules/uni-steps/components/uni-steps/uni-steps",
|
||||
"uni-pagination": "../../uni_modules/uni-pagination/components/uni-pagination/uni-pagination"
|
||||
}
|
||||
}
|
1
uniapp04/unpackage/dist/dev/mp-weixin/pages/fullOrder/orderStateZero.wxml
vendored
Normal file
1
uniapp04/unpackage/dist/dev/mp-weixin/pages/fullOrder/orderStateZero.wxml
vendored
Normal file
@ -0,0 +1 @@
|
||||
<view class="viewport"><scroll-view scroll-y class="orders"><view wx:for="{{a}}" wx:for-item="order" wx:key="m" class="card"><view class="status"><text class="title" bindtap="{{order.b}}">{{order.a}}</text><text>{{order.c}}</text><text class="icon-delete"></text></view><navigator wx:for="{{order.d}}" wx:for-item="sku" wx:key="b" class="goods" url="{{b}}" hover-class="none"><view class="cover"><image mode="aspectFit" src="{{order.e}}"></image></view><view wx:for="{{sku.a}}" wx:for-item="item" class="meta"><view class="type">{{item.a}}--{{item.b}}</view><text class="type">下单即送20积分</text></view></navigator><view><uni-steps wx:if="{{c}}" u-i="{{order.f}}" bind:__l="__l" u-p="{{c}}"/></view><view class="action"><block wx:if="{{true}}"><view class="button primary" bindtap="{{order.g}}">删除订单</view><view class="button primary" bindtap="{{order.h}}">确认收货</view><view class="button primary" bindtap="{{order.i}}">拨打电话</view><view wx:if="{{order.j}}" class="button primary" bindtap="{{order.k}}"> 去退款 </view></block><block wx:else><navigator class="button secondary" url="{{order.l}}" hover-class="none"> 再次购买 </navigator><view wx:if="{{false}}" class="button primary">确认收货</view></block></view></view><view class="loading-text" style="{{'padding-bottom:' + e}}">{{d}}</view></scroll-view><uni-pagination wx:if="{{g}}" bindchange="{{f}}" u-i="686b3eac-1" bind:__l="__l" u-p="{{g}}"/></view>
|
214
uniapp04/unpackage/dist/dev/mp-weixin/pages/fullOrder/orderStateZero.wxss
vendored
Normal file
214
uniapp04/unpackage/dist/dev/mp-weixin/pages/fullOrder/orderStateZero.wxss
vendored
Normal file
@ -0,0 +1,214 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
page {
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
.viewport {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background-color: #fff;
|
||||
}
|
||||
.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: 20%;
|
||||
height: 6rpx;
|
||||
padding: 0 50rpx;
|
||||
background-color: #4095e5;
|
||||
transition: all 0.4s;
|
||||
}
|
||||
.swiper {
|
||||
background-color: #4095e5;
|
||||
}
|
||||
.orders .card {
|
||||
min-height: 100rpx;
|
||||
padding: 20rpx;
|
||||
margin: 20rpx 20rpx 0;
|
||||
border-radius: 10rpx;
|
||||
background-color: #fff;
|
||||
}
|
||||
.orders .card:last-child {
|
||||
padding-bottom: 40rpx;
|
||||
}
|
||||
.orders .status {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-size: 28rpx;
|
||||
color: #999;
|
||||
margin-bottom: 15rpx;
|
||||
}
|
||||
.orders .status .title {
|
||||
color: #343434;
|
||||
font-weight: 700;
|
||||
flex: 1;
|
||||
}
|
||||
.orders .status .primary {
|
||||
color: #ff9240;
|
||||
}
|
||||
.orders .status .icon-delete {
|
||||
line-height: 1;
|
||||
margin-left: 10rpx;
|
||||
padding-left: 10rpx;
|
||||
border-left: 1rpx solid #e3e3e3;
|
||||
}
|
||||
.orders .goods {
|
||||
display: flex;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
.orders .goods .cover {
|
||||
width: 170rpx;
|
||||
height: 170rpx;
|
||||
margin-right: 20rpx;
|
||||
border-radius: 10rpx;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
.orders .goods .quantity {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
line-height: 1;
|
||||
padding: 6rpx 4rpx 6rpx 8rpx;
|
||||
font-size: 24rpx;
|
||||
color: #fff;
|
||||
border-radius: 10rpx 0 0 0;
|
||||
background-color: rgba(0, 0, 0, 0.6);
|
||||
}
|
||||
.orders .goods .meta {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
}
|
||||
.orders .goods .name {
|
||||
height: 80rpx;
|
||||
font-size: 26rpx;
|
||||
color: #444;
|
||||
}
|
||||
.orders .goods .type {
|
||||
line-height: 1.8;
|
||||
padding: 0 15rpx;
|
||||
margin-top: 10rpx;
|
||||
font-size: 24rpx;
|
||||
align-self: flex-start;
|
||||
border-radius: 4rpx;
|
||||
color: #888;
|
||||
background-color: #f7f7f8;
|
||||
}
|
||||
.orders .goods .more {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 22rpx;
|
||||
color: #333;
|
||||
}
|
||||
.orders .action {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
padding-top: 20rpx;
|
||||
}
|
||||
.orders .action .button {
|
||||
width: 180rpx;
|
||||
height: 60rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin-left: 20rpx;
|
||||
border-radius: 60rpx;
|
||||
border: 1rpx solid #ccc;
|
||||
font-size: 26rpx;
|
||||
color: #444;
|
||||
}
|
||||
.orders .action .secondary {
|
||||
color: #4095e5;
|
||||
border-color: #4095e5;
|
||||
}
|
||||
.orders .action .primary {
|
||||
color: #fff;
|
||||
background-color: #4095e5;
|
||||
}
|
||||
.orders .loading-text {
|
||||
text-align: center;
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
padding: 20rpx 0;
|
||||
}
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 20px;
|
||||
}
|
||||
.status-btn {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 92rpx;
|
||||
margin: 30rpx;
|
||||
background-color: #007AFF;
|
||||
}
|
||||
.example-body {
|
||||
display: block;
|
||||
padding: 15px;
|
||||
flex-direction: row;
|
||||
}
|
||||
.tab-menu {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
padding: 10px 0;
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
.tab-item {
|
||||
padding: 10px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.tab-item.active {
|
||||
color: #007aff;
|
||||
font-weight: bold;
|
||||
}
|
Reference in New Issue
Block a user