已支付订单列表:where.payStatus = 1;

This commit is contained in:
2024-07-10 22:44:18 +08:00
parent 9dd834adb5
commit 1311eb03b8
611 changed files with 92828 additions and 400 deletions
+380
View File
@@ -0,0 +1,380 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const api_shop_order_index = require("../../api/shop/order/index.js");
const api_shop_wechatDeposit_index = require("../../api/shop/wechatDeposit/index.js");
const utils_common = require("../../utils/common.js");
const _sfc_main = {
components: {},
data() {
return {
isRefresh: false,
isLogin: false,
userId: 0,
where: {
page: 1,
type: 1,
// 0商城订单 1场地预定
sceneType: "showOrderInfo"
// 查询订单附加场地信息
},
canReset: false,
loadMore: "more",
logo: "",
items: ["全部订单", "未支付", "已支付", "已完成", "押金"],
orderList: [],
styles: [
{
value: "button",
text: "按钮",
checked: true
},
{
value: "text",
text: "文字"
}
],
colors: ["#333333", "#4cd964", "#dd524d"],
current: 0,
colorIndex: 0,
activeColor: "#108001",
styleType: "text",
getWeek: utils_common.getWeek,
// 骨架屏
hideTools: true
};
},
onLoad(option) {
this.openLogin();
},
onShow(e) {
this.openLogin();
this.reload();
},
// 触底函数
onReachBottom() {
const app = this;
const {
where
} = this;
if (app.canReset) {
app.where.page = ++where.page;
app.reload();
}
},
methods: {
reload() {
const app = this;
const {
where,
userId
} = this;
if (userId == 0) {
app.openLogin();
return;
}
where.userId = userId;
app.loadMore = "loading";
api_shop_order_index.pageOrder(where).then((res) => {
const list = res.list.map((d) => {
console.log(d);
return d;
});
if (app.orderList.length < res.count) {
console.log("11111: ", 11111);
app.orderList = app.orderList.concat(list);
app.canReset = true;
app.loadMore = "no-more";
} else {
app.canReset = false;
app.loadMore = "no-more";
console.log("22222: ", 22222);
}
common_vendor.index.hideLoading();
app.isRefresh = false;
}).catch(() => {
common_vendor.index.showToast({
title: "请检查您的网络.",
icon: "none"
});
common_vendor.index.hideLoading();
app.isRefresh = false;
});
},
onClickItem(e) {
const app = this;
const {
where,
userId
} = this;
const index = e.currentIndex;
if (this.current !== e.currentIndex) {
this.current = e.currentIndex;
}
if (userId === 0) {
app.openLogin();
return;
}
if (index === 0) {
where.payStatus = void 0;
where.orderStatus = void 0;
}
if (index === 1) {
where.payStatus = 0;
where.orderStatus = void 0;
}
if (index === 2) {
where.payStatus = 1;
}
if (index === 3) {
where.payStatus = 1;
where.orderStatus = 1;
}
if (index === 4) {
api_shop_wechatDeposit_index.pageWechatDeposit({
uid: common_vendor.index.getStorageSync("user_id")
}).then((res) => {
app.orderList = res.list;
if (res.count == 0) {
app.loadMore = "no-more";
}
common_vendor.index.hideLoading();
});
return false;
}
this.where.page = 1;
this.orderList = [];
this.reload();
},
openUrl(url) {
common_vendor.index.navigateTo({
url
});
},
toPay(orderId) {
common_vendor.index.navigateTo({
url: "/package/booking/confirm?id=" + orderId
});
},
closeOrder(item) {
common_vendor.index.showModal({
title: "确定取消此订单?",
success(o) {
if (o.confirm) {
api_shop_order_index.updateOrder({
orderStatus: 2,
orderId: item.orderId
}).then((msg) => {
common_vendor.index.showToast({
title: msg,
icon: "none"
});
item.orderStatus = 2;
}).catch(() => {
common_vendor.index.showToast({
title: "请检查您的网络.",
icon: "none"
});
common_vendor.index.hideLoading();
});
}
}
});
},
// 弹出登录提示框
async openLogin() {
this.userId = common_vendor.index.getStorageSync("user_id");
if (!this.userId) {
this.$refs.login.open("bottom");
return false;
}
},
// 申请开票
onInvoice(id) {
common_vendor.index.navigateTo({
url: "/package/user/invoice?id=" + id
});
},
showInvoice(id) {
common_vendor.index.navigateTo({
url: `/package/user/invoice-show?id=${id}`
});
}
}
};
if (!Array) {
const _easycom_uni_segmented_control2 = common_vendor.resolveComponent("uni-segmented-control");
const _easycom_uv_avatar2 = common_vendor.resolveComponent("uv-avatar");
const _easycom_uv_count_down2 = common_vendor.resolveComponent("uv-count-down");
const _easycom_uv_cell2 = common_vendor.resolveComponent("uv-cell");
const _easycom_uv_cell_group2 = common_vendor.resolveComponent("uv-cell-group");
const _easycom_uni_card2 = common_vendor.resolveComponent("uni-card");
const _easycom_uv_skeleton2 = common_vendor.resolveComponent("uv-skeleton");
const _easycom_uv_gap2 = common_vendor.resolveComponent("uv-gap");
const _easycom_uni_load_more2 = common_vendor.resolveComponent("uni-load-more");
const _easycom_ws_login2 = common_vendor.resolveComponent("ws-login");
(_easycom_uni_segmented_control2 + _easycom_uv_avatar2 + _easycom_uv_count_down2 + _easycom_uv_cell2 + _easycom_uv_cell_group2 + _easycom_uni_card2 + _easycom_uv_skeleton2 + _easycom_uv_gap2 + _easycom_uni_load_more2 + _easycom_ws_login2)();
}
const _easycom_uni_segmented_control = () => "../../uni_modules/uni-segmented-control/components/uni-segmented-control/uni-segmented-control.js";
const _easycom_uv_avatar = () => "../../uni_modules/uv-avatar/components/uv-avatar/uv-avatar.js";
const _easycom_uv_count_down = () => "../../uni_modules/uv-count-down/components/uv-count-down/uv-count-down.js";
const _easycom_uv_cell = () => "../../uni_modules/uv-cell/components/uv-cell/uv-cell.js";
const _easycom_uv_cell_group = () => "../../uni_modules/uv-cell/components/uv-cell-group/uv-cell-group.js";
const _easycom_uni_card = () => "../../uni_modules/uni-card/components/uni-card/uni-card.js";
const _easycom_uv_skeleton = () => "../../uni_modules/uv-skeleton/components/uv-skeleton/uv-skeleton.js";
const _easycom_uv_gap = () => "../../uni_modules/uv-gap/components/uv-gap/uv-gap.js";
const _easycom_uni_load_more = () => "../../uni_modules/uni-load-more/components/uni-load-more/uni-load-more.js";
const _easycom_ws_login = () => "../../uni_modules/ws-login/components/ws-login/ws-login.js";
if (!Math) {
(_easycom_uni_segmented_control + _easycom_uv_avatar + _easycom_uv_count_down + _easycom_uv_cell + _easycom_uv_cell_group + _easycom_uni_card + _easycom_uv_skeleton + _easycom_uv_gap + _easycom_uni_load_more + _easycom_ws_login)();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: common_vendor.o($options.onClickItem),
b: common_vendor.p({
current: $data.current,
values: $data.items,
styleType: $data.styleType,
activeColor: $data.activeColor,
inActiveColor: "#808080"
}),
c: $data.orderList.length > 0
}, $data.orderList.length > 0 ? {
d: common_vendor.f($data.orderList, (item, index, i0) => {
return common_vendor.e({
a: "1317716d-2-" + i0 + "," + ("1317716d-1-" + i0),
b: common_vendor.p({
src: item.merchantAvatar,
size: "24"
}),
c: common_vendor.t(item.merchantName),
d: item.orderStatus == 2
}, item.orderStatus == 2 ? {} : item.orderStatus == 1 ? {} : common_vendor.e({
f: item.payStatus == 1
}, item.payStatus == 1 ? {} : {}, {
g: item.payStatus == 0
}, item.payStatus == 0 ? {
h: "1317716d-3-" + i0 + "," + ("1317716d-1-" + i0),
i: common_vendor.p({
time: item.timestamp,
format: "mm:ss"
})
} : {}), {
e: item.orderStatus == 1,
j: common_vendor.f(item.orderInfo, (sub, subIndex, i1) => {
return {
a: common_vendor.o(($event) => $options.openUrl(`/package/order/detail?id=${item.orderId}`), subIndex),
b: "1317716d-5-" + i0 + "-" + i1 + "," + ("1317716d-4-" + i0),
c: common_vendor.p({
title: `${sub.fieldName}`,
label: `${sub.comments}`,
cellStyle: {
padding: "0",
paddingBottom: "5px"
},
border: false
}),
d: subIndex
};
}),
k: "1317716d-4-" + i0 + "," + ("1317716d-1-" + i0),
l: common_vendor.t(item.totalPrice),
m: common_vendor.t(item.payPrice),
n: item.payStatus == 0 && item.orderStatus == 0
}, item.payStatus == 0 && item.orderStatus == 0 ? {
o: common_vendor.o(($event) => $options.closeOrder(item), index),
p: common_vendor.o(($event) => $options.toPay(item.orderId), index)
} : {}, {
q: item.payStatus == 1
}, item.payStatus == 1 ? common_vendor.e({
r: item.isInvoice == 0
}, item.isInvoice == 0 ? {
s: common_vendor.o(($event) => $options.onInvoice(item.orderId), index)
} : {
t: common_vendor.o(($event) => $options.showInvoice(item.orderId), index)
}) : {}, {
v: "1317716d-1-" + i0,
w: index
});
}),
e: common_vendor.p({
customStyle: {
backgroundColor: "#ffffff"
},
border: false
}),
f: common_vendor.p({
border: false,
["is-shadow"]: false,
padding: 0
})
} : {}, {
g: $data.orderList.length == 0 && $data.loadMore != "no-more"
}, $data.orderList.length == 0 && $data.loadMore != "no-more" ? {
h: common_vendor.p({
rows: "3",
avatar: true,
loading: $data.hideTools,
title: false
}),
i: common_vendor.p({
height: "16"
}),
j: common_vendor.p({
border: false,
padding: "18px 6px"
}),
k: common_vendor.p({
rows: "3",
avatar: true,
loading: $data.hideTools,
title: false
}),
l: common_vendor.p({
height: "16"
}),
m: common_vendor.p({
border: false,
padding: "18px 6px"
}),
n: common_vendor.p({
rows: "3",
avatar: true,
loading: $data.hideTools,
title: false
}),
o: common_vendor.p({
height: "16"
}),
p: common_vendor.p({
border: false,
padding: "18px 6px"
}),
q: common_vendor.p({
rows: "3",
avatar: true,
loading: $data.hideTools,
title: false
}),
r: common_vendor.p({
height: "16"
}),
s: common_vendor.p({
border: false,
padding: "18px 6px"
})
} : {}, {
t: $data.orderList.length > 0
}, $data.orderList.length > 0 ? {
v: common_vendor.p({
status: $data.loadMore
})
} : {}, {
w: common_vendor.sr("login", "1317716d-19"),
x: common_vendor.o($options.reload),
y: common_vendor.p({
logo: $data.logo
})
});
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/Users/gxwebsoft/APP/gxtyzx-uniapp-cli/src/pages/order/order.vue"]]);
wx.createPage(MiniProgramPage);
+16
View File
@@ -0,0 +1,16 @@
{
"navigationBarTitleText": "我的订单",
"enablePullDownRefresh": false,
"usingComponents": {
"uni-segmented-control": "../../uni_modules/uni-segmented-control/components/uni-segmented-control/uni-segmented-control",
"uv-avatar": "../../uni_modules/uv-avatar/components/uv-avatar/uv-avatar",
"uv-count-down": "../../uni_modules/uv-count-down/components/uv-count-down/uv-count-down",
"uv-cell": "../../uni_modules/uv-cell/components/uv-cell/uv-cell",
"uv-cell-group": "../../uni_modules/uv-cell/components/uv-cell-group/uv-cell-group",
"uni-card": "../../uni_modules/uni-card/components/uni-card/uni-card",
"uv-skeleton": "../../uni_modules/uv-skeleton/components/uv-skeleton/uv-skeleton",
"uv-gap": "../../uni_modules/uv-gap/components/uv-gap/uv-gap",
"uni-load-more": "../../uni_modules/uni-load-more/components/uni-load-more/uni-load-more",
"ws-login": "../../uni_modules/ws-login/components/ws-login/ws-login"
}
}
+1
View File
@@ -0,0 +1 @@
<view><view class="segmented"><uni-segmented-control wx:if="{{b}}" bindclickItem="{{a}}" u-i="1317716d-0" bind:__l="__l" u-p="{{b}}"/></view><view class="order"><block wx:if="{{c}}"><block wx:for="{{d}}" wx:for-item="item" wx:key="w"><uni-card wx:if="{{f}}" u-s="{{['title','d']}}" u-i="{{item.v}}" bind:__l="__l" u-p="{{f}}"><view class="order-title web-cell" slot="title"><view class="web-cell web-cell-content"><view class="merchant-avatar"><uv-avatar wx:if="{{item.b}}" u-i="{{item.a}}" bind:__l="__l" u-p="{{item.b}}"></uv-avatar></view><text class="merchant-name">{{item.c}}</text></view><block wx:if="{{item.d}}"><text class="btn-status web-text-secondary">已取消</text></block><block wx:elif="{{item.e}}"><text class="btn-status web-text-success">已完成</text></block><block wx:else><text wx:if="{{item.f}}" class="btn-status web-text-success">已支付</text><view wx:if="{{item.g}}" class="btn-status web-text-danger"><uv-count-down wx:if="{{item.i}}" u-i="{{item.h}}" bind:__l="__l" u-p="{{item.i}}"></uv-count-down><text class="no-pay" style="margin-left:10rpx">未支付</text></view></block></view><view class="order-body web-cell web-cell-align-top"><view class="web-cell-content"><uv-cell-group wx:if="{{e}}" u-s="{{['d']}}" u-i="{{item.k}}" bind:__l="__l" u-p="{{e}}"><block wx:for="{{item.j}}" wx:for-item="sub" wx:key="d"><uv-cell wx:if="{{sub.c}}" bindclick="{{sub.a}}" u-i="{{sub.b}}" bind:__l="__l" u-p="{{sub.c}}"/></block></uv-cell-group><view class="total-price"><view class="web-text-heading">合计:¥{{item.l}}</view><view class="web-text-heading" style="font-weight:500"> 实付:¥{{item.m}}</view></view></view></view><view slot="actions" class="card-actions"><view wx:if="{{item.n}}" class="card-actions-item"><button class="mini-btn" size="mini" bindtap="{{item.o}}" style="margin-right:20rpx">取消订单</button><button class="mini-btn" type="primary" size="mini" bindtap="{{item.p}}">去支付</button></view><view wx:if="{{item.q}}" class="card-actions-item"><button wx:if="{{item.r}}" class="mini-btn" size="mini" bindtap="{{item.s}}">申请开票</button><button wx:else class="mini-btn" size="mini" bindtap="{{item.t}}">查看发票</button></view></view></uni-card></block></block><block wx:if="{{g}}"><uni-card wx:if="{{j}}" u-s="{{['d']}}" u-i="1317716d-6" bind:__l="__l" u-p="{{j}}"><uv-skeleton wx:if="{{h}}" u-i="1317716d-7,1317716d-6" bind:__l="__l" u-p="{{h}}"></uv-skeleton><uv-gap wx:if="{{i}}" u-i="1317716d-8,1317716d-6" bind:__l="__l" u-p="{{i}}"></uv-gap></uni-card><uni-card wx:if="{{m}}" u-s="{{['d']}}" u-i="1317716d-9" bind:__l="__l" u-p="{{m}}"><uv-skeleton wx:if="{{k}}" u-i="1317716d-10,1317716d-9" bind:__l="__l" u-p="{{k}}"></uv-skeleton><uv-gap wx:if="{{l}}" u-i="1317716d-11,1317716d-9" bind:__l="__l" u-p="{{l}}"></uv-gap></uni-card><uni-card wx:if="{{p}}" u-s="{{['d']}}" u-i="1317716d-12" bind:__l="__l" u-p="{{p}}"><uv-skeleton wx:if="{{n}}" u-i="1317716d-13,1317716d-12" bind:__l="__l" u-p="{{n}}"></uv-skeleton><uv-gap wx:if="{{o}}" u-i="1317716d-14,1317716d-12" bind:__l="__l" u-p="{{o}}"></uv-gap></uni-card><uni-card wx:if="{{s}}" u-s="{{['d']}}" u-i="1317716d-15" bind:__l="__l" u-p="{{s}}"><uv-skeleton wx:if="{{q}}" u-i="1317716d-16,1317716d-15" bind:__l="__l" u-p="{{q}}"></uv-skeleton><uv-gap wx:if="{{r}}" u-i="1317716d-17,1317716d-15" bind:__l="__l" u-p="{{r}}"></uv-gap></uni-card></block><uni-load-more wx:if="{{t}}" u-i="1317716d-18" bind:__l="__l" u-p="{{v}}"></uni-load-more><ws-login wx:if="{{y}}" class="r" u-r="login" binddone="{{x}}" u-i="1317716d-19" bind:__l="__l" u-p="{{y}}"/></view></view>
+97
View File
@@ -0,0 +1,97 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.content {
display: flex;
justify-content: center;
align-items: center;
height: 150px;
text-align: center;
}
.segmented {
padding: 0 12rpx;
}
.content-text {
font-size: 14px;
color: #666;
}
.color-tag {
width: 25px;
height: 25px;
}
.uni-list {
flex: 1;
}
.order .order-title {
padding: 20rpx 0;
border-bottom: 1px #eee solid;
}
.order .order-title .merchant-avatar {
margin-right: 12rpx;
}
.order .order-title .btn-status {
font-size: 30rpx;
display: flex;
}
.order .order-body {
padding: 16px 0;
}
.ele-flex {
display: flex;
justify-content: space-between;
}
.card-actions {
display: flex;
flex-direction: row;
justify-content: flex-end;
align-items: center;
height: 45px;
border-top: 1px #eee solid;
}
.card-actions-item {
display: flex;
flex-direction: row;
align-items: center;
}
.card-actions-item-text {
font-size: 12px;
color: #666;
margin-left: 5px;
}
.close {
top: 60rpx !important;
}
.total-price {
display: flex;
flex-direction: column;
justify-content: flex-start;
font-size: 30rpx;
align-items: flex-start;
padding-left: 6rpx;
margin-left: 450rpx;
}
.total-price .web-text-heading {
font-size: 30rpx !important;
}