代码提交
This commit is contained in:
@ -1,68 +1,68 @@
|
||||
<template>
|
||||
<view>
|
||||
<layout>
|
||||
<uv-sticky
|
||||
bgColor="#fff"
|
||||
customNavHeight="0"
|
||||
<uv-sticky
|
||||
bgColor="#fff"
|
||||
customNavHeight="0"
|
||||
>
|
||||
<uv-navbar
|
||||
:fixed="false"
|
||||
:title="title"
|
||||
@leftClick="goBack"
|
||||
/>
|
||||
<uv-tabs
|
||||
:list="navList"
|
||||
@click="click"
|
||||
lineColor="#f56c6c"
|
||||
:current="actionType"
|
||||
>
|
||||
<uv-navbar
|
||||
:fixed="false"
|
||||
:title="title"
|
||||
@leftClick="goBack"
|
||||
/>
|
||||
<uv-tabs
|
||||
:list="navList"
|
||||
@click="click"
|
||||
lineColor="#f56c6c"
|
||||
:current="actionType"
|
||||
>
|
||||
</uv-tabs>
|
||||
</uv-sticky>
|
||||
</uv-tabs>
|
||||
</uv-sticky>
|
||||
|
||||
<view class="orderList">
|
||||
<template v-if="!listEmpty">
|
||||
<order
|
||||
:data="item"
|
||||
v-for="(item, index) in dataList"
|
||||
:key="actionType + '_' + index"
|
||||
@refresh="handleRefresh"
|
||||
@pay="openPay"
|
||||
/>
|
||||
</template>
|
||||
<Empty
|
||||
:iconSrc="emptyIcon"
|
||||
v-else
|
||||
>
|
||||
您还没有相关订单~
|
||||
</Empty>
|
||||
<!-- 加载中 -->
|
||||
<ListLoadLoading v-if="loading" />
|
||||
<!-- 加载完毕-->
|
||||
<ListLoadOver v-if="loadend" />
|
||||
</view>
|
||||
</layout>
|
||||
<view class="orderList">
|
||||
<template v-if="!listEmpty">
|
||||
<order
|
||||
:data="item"
|
||||
v-for="(item, index) in dataList"
|
||||
:key="actionType + '_' + index"
|
||||
@refresh="handleRefresh"
|
||||
@pay="openPay"
|
||||
/>
|
||||
</template>
|
||||
<Empty
|
||||
:iconSrc="emptyOrderIcon"
|
||||
v-else
|
||||
>
|
||||
您还没有相关订单~
|
||||
</Empty>
|
||||
<!-- 加载中 -->
|
||||
<ListLoadLoading v-if="loading" />
|
||||
<!-- 加载完毕-->
|
||||
<ListLoadOver v-if="loadend" />
|
||||
</view>
|
||||
<!-- 支付弹窗 -->
|
||||
<PayPopup
|
||||
ref="payPopupRef"
|
||||
@confirm="paySuccess"
|
||||
/>
|
||||
</view>
|
||||
<ReturnTop :scroll-top="scrollTop" />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed, ref, unref } from 'vue'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import { onLoad, onPageScroll } from '@dcloudio/uni-app'
|
||||
import { orderList } from '@/api/order'
|
||||
import { useRouter } from "@/hooks/useRouter";
|
||||
import ListLoadOver from "@/components/ListLoadOver/index.vue"
|
||||
import ListLoadLoading from "@/components/ListLoadLoading/index.vue"
|
||||
import Empty from '@/components/Empty/index.vue'
|
||||
import emptyIcon from '@/static/icon/empty/订单.png'
|
||||
import { emptyOrderIcon } from "@/utils/images";
|
||||
import PayPopup from '@/components/PayPopup/index.vue'
|
||||
import { usePage } from "@/hooks";
|
||||
import Header from "@/components/Header/index.vue"
|
||||
import { getProductList } from "@/api/product";
|
||||
import ReturnTop from "@/components/ReturnTop/index.vue";
|
||||
import { useScroll } from "@/hooks/useScroll";
|
||||
|
||||
const {scrollTop} = useScroll()
|
||||
const {type, refresh, dataList, loadend, loading, listEmpty} = usePage(orderList)
|
||||
|
||||
const {getParams, goBack, push} = useRouter()
|
||||
@ -82,9 +82,9 @@ const navList = ref([
|
||||
// { name: "退款", value: 7, },
|
||||
])
|
||||
|
||||
const title = computed(()=>{
|
||||
const find = navList.value.find(item=>item.value === type.value);
|
||||
return find?`${find.name}订单`:'订单'
|
||||
const title = computed(() => {
|
||||
const find = navList.value.find(item => item.value === type.value);
|
||||
return find ? `${ find.name }订单` : '订单'
|
||||
})
|
||||
|
||||
|
||||
@ -119,7 +119,7 @@ function openPay(orderId) {
|
||||
}
|
||||
|
||||
function paySuccess() {
|
||||
push({url: '/pages/payStatus/index'},{})
|
||||
push({url: '/pages/payStatus/index'}, {})
|
||||
}
|
||||
|
||||
|
||||
@ -135,6 +135,10 @@ onLoad((options) => {
|
||||
})
|
||||
|
||||
|
||||
onPageScroll((e)=>{
|
||||
})
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
|
Reference in New Issue
Block a user