fix:拼团按钮文案显示判断条件修改

pull/8/head
kele 2023-02-07 15:55:01 +08:00
parent e6f94af4d0
commit 6885d6de69
2 changed files with 11 additions and 14 deletions

View File

@ -193,7 +193,7 @@
}) })
" "
> >
{{ state.orderInfo.status_code === 'groupon_invalid' ? '拼团详情' : '邀请拼团' }} {{ state.orderInfo.status_code === 'groupon_ing' ? '邀请拼团' : '拼团详情' }}
</button> </button>
<button <button
class="ss-reset-button cancel-btn" class="ss-reset-button cancel-btn"

View File

@ -137,7 +137,7 @@
class="tool-btn ss-reset-button" class="tool-btn ss-reset-button"
@tap.stop="onOrderGroupon(order)" @tap.stop="onOrderGroupon(order)"
> >
{{ order.status_code === 'groupon_invalid' ? '拼团详情' : '邀请拼团' }} {{ order.status_code === 'groupon_ing' ? '邀请拼团' : '拼团详情' }}
</button> </button>
<button <button
v-if="order.btns.includes('invoice')" v-if="order.btns.includes('invoice')"
@ -240,6 +240,12 @@
import sheep from '@/sheep'; import sheep from '@/sheep';
import _ from 'lodash'; import _ from 'lodash';
const pagination = {
data: [],
current_page: 1,
total: 1,
last_page: 1,
};
// //
const state = reactive({ const state = reactive({
currentTab: 0, currentTab: 0,
@ -281,13 +287,7 @@
function onTabsChange(e) { function onTabsChange(e) {
if (state.currentTab === e.index) return; if (state.currentTab === e.index) return;
state.pagination = { state.pagination = pagination
data: [],
current_page: 1,
total: 1,
last_page: 1,
};
state.currentTab = e.index; state.currentTab = e.index;
getOrderList(); getOrderList();
@ -379,7 +379,7 @@
} }
// 退 // 退
async function onRefund(orderId, confirm = false) { async function onRefund(orderId) {
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: '确定要申请退款吗?', content: '确定要申请退款吗?',
@ -408,15 +408,11 @@
}); });
state.error = res.error; state.error = res.error;
if (res.error === 0) { if (res.error === 0) {
if (page >= 2) {
let orderList = _.concat(state.pagination.data, res.data.data); let orderList = _.concat(state.pagination.data, res.data.data);
state.pagination = { state.pagination = {
...res.data, ...res.data,
data: orderList, data: orderList,
}; };
} else {
state.pagination = res.data;
}
if (state.pagination.current_page < state.pagination.last_page) { if (state.pagination.current_page < state.pagination.last_page) {
state.loadStatus = 'more'; state.loadStatus = 'more';
@ -447,6 +443,7 @@
// //
onPullDownRefresh(() => { onPullDownRefresh(() => {
state.pagination = pagination
getOrderList(); getOrderList();
setTimeout(function () { setTimeout(function () {
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();