This commit is contained in:
@@ -11,9 +11,9 @@
|
|||||||
<!-- 商品信息 -->
|
<!-- 商品信息 -->
|
||||||
<view class="w-full" v-for="(itm, idx) in orderData" :key="idx">
|
<view class="w-full" v-for="(itm, idx) in orderData" :key="idx">
|
||||||
<view class="order-card">
|
<view class="order-card">
|
||||||
<view class="mb-[10px] text-[28px] text-[#9C9C9C]">{{
|
<view class="mb-[10px] text-[28px] text-[#9C9C9C]"
|
||||||
itm.Store.name
|
>{{ itm.Store.name }}
|
||||||
}}</view>
|
</view>
|
||||||
<view
|
<view
|
||||||
class="center mb-[20px]"
|
class="center mb-[20px]"
|
||||||
v-for="(item, index) in itm.OrderGoods"
|
v-for="(item, index) in itm.OrderGoods"
|
||||||
@@ -21,9 +21,9 @@
|
|||||||
<view class="top">
|
<view class="top">
|
||||||
<image :src="item.Goods.cover" />
|
<image :src="item.Goods.cover" />
|
||||||
<view class="flex flex-col justify-between flex-1 h-[150px]">
|
<view class="flex flex-col justify-between flex-1 h-[150px]">
|
||||||
<view class="title line-clamp-2 text-[25px]">{{
|
<view class="title line-clamp-2 text-[25px]"
|
||||||
item.Goods?.name
|
>{{ item.Goods?.name }}
|
||||||
}}</view>
|
</view>
|
||||||
<view class="text-[#F83D3D] mt-5">
|
<view class="text-[#F83D3D] mt-5">
|
||||||
<view
|
<view
|
||||||
>¥{{ item.pay_price }}元
|
>¥{{ item.pay_price }}元
|
||||||
@@ -83,6 +83,7 @@
|
|||||||
<nut-button
|
<nut-button
|
||||||
shape="square"
|
shape="square"
|
||||||
:loading="isLoading"
|
:loading="isLoading"
|
||||||
|
:disabled="isLoading"
|
||||||
type="primary"
|
type="primary"
|
||||||
block
|
block
|
||||||
@click="pay"
|
@click="pay"
|
||||||
@@ -97,7 +98,6 @@ import Taro from '@tarojs/taro';
|
|||||||
import {IconFont} from '@nutui/icons-vue-taro';
|
import {IconFont} from '@nutui/icons-vue-taro';
|
||||||
import {onUnmounted, ref} from 'vue';
|
import {onUnmounted, ref} from 'vue';
|
||||||
import {getActiveOrderDetail, getPayList} from '@/api/goods';
|
import {getActiveOrderDetail, getPayList} from '@/api/goods';
|
||||||
import {getUserPoint} from '@/api/admin';
|
|
||||||
import {payOrder} from '@/api/order';
|
import {payOrder} from '@/api/order';
|
||||||
import * as dayjs from 'dayjs';
|
import * as dayjs from 'dayjs';
|
||||||
|
|
||||||
@@ -132,7 +132,7 @@ const get_pay_list = async () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const getData = async (oid: string, bid: string, OrderType: number) => {
|
const getData = async (oid: string, bid: string, OrderType: number) => {
|
||||||
const user_info = Taro.getStorageSync('userInfo');
|
// const user_info = Taro.getStorageSync('userInfo');
|
||||||
// const data = await getUserPoint({
|
// const data = await getUserPoint({
|
||||||
// phone: user_info.data.phone,
|
// phone: user_info.data.phone,
|
||||||
// bid,
|
// bid,
|
||||||
@@ -173,18 +173,16 @@ const getData = async (oid: string, bid: string, OrderType: number) => {
|
|||||||
|
|
||||||
const pay = async () => {
|
const pay = async () => {
|
||||||
try {
|
try {
|
||||||
|
if (isLoading.value) return;
|
||||||
isLoading.value = true;
|
isLoading.value = true;
|
||||||
if (!payVal.value)
|
if (!payVal.value)
|
||||||
return Taro.showToast({title: '请选择支付方式', icon: 'none'});
|
return Taro.showToast({title: '请选择支付方式', icon: 'none'});
|
||||||
|
|
||||||
await confirmPay();
|
await confirmPay();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
title: error.msg,
|
title: error.msg,
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
});
|
});
|
||||||
} finally {
|
|
||||||
isLoading.value = false;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -219,15 +217,16 @@ const confirmPay = async () => {
|
|||||||
url: `/pages/users/order_list/index?type=0`,
|
url: `/pages/users/order_list/index?type=0`,
|
||||||
});
|
});
|
||||||
}, 2000);
|
}, 2000);
|
||||||
|
isLoading.value = false;
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
isLoading.value = false;
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
isLoading.value = false;
|
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
title: err.msg,
|
title: err.msg,
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
});
|
});
|
||||||
|
} finally {
|
||||||
|
isLoading.value = false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -83,3 +83,29 @@ export function showTips(msg: string) {
|
|||||||
icon: 'none',
|
icon: 'none',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 防抖函数
|
||||||
|
export function debounce(fn: Function, delay: number = 500) {
|
||||||
|
let timer: any = null;
|
||||||
|
return function (...args: any[]) {
|
||||||
|
if (timer) {
|
||||||
|
clearTimeout(timer);
|
||||||
|
}
|
||||||
|
timer = setTimeout(() => {
|
||||||
|
fn.apply(this, args);
|
||||||
|
}, delay);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
// 节流函数
|
||||||
|
export function throttle(fn: Function, delay: number) {
|
||||||
|
let timer: any = null;
|
||||||
|
return function (...args: any[]) {
|
||||||
|
if (!timer) {
|
||||||
|
timer = setTimeout(() => {
|
||||||
|
fn.apply(this, args);
|
||||||
|
timer = null;
|
||||||
|
}, delay);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user