Commit a2ca2415 authored by 石建新(贵阳日报)'s avatar 石建新(贵阳日报)
parents 00384b91 8d9235a7
This diff is collapsed.
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
"@dcloudio/uni-quickapp-webview": "3.0.0-4000720240327002", "@dcloudio/uni-quickapp-webview": "3.0.0-4000720240327002",
"@typescript-eslint/parser": "6.15.0", "@typescript-eslint/parser": "6.15.0",
"pinia": "2.0.36", "pinia": "2.0.36",
"qrcode": "^1.5.3",
"vue": "^3.3.11", "vue": "^3.3.11",
"vue-i18n": "^9.1.9", "vue-i18n": "^9.1.9",
"wot-design-uni": "^1.2.26" "wot-design-uni": "^1.2.26"
......
...@@ -8,3 +8,30 @@ export function getOrderList(data) { ...@@ -8,3 +8,30 @@ export function getOrderList(data) {
data, data,
}); });
} }
// 订单列表接口
export function getOrderDetail(data) {
return request({
url: '/sgyrdd/sgyOrder/groupBuy/orderInfo',
method: 'GET',
data,
});
}
// 商品详情接口
export function getProdDetail(data) {
return request({
url: '/sgyrdd/prod/getProd',
method: 'GET',
data,
});
}
// 商铺详情接口
export function getShopDetail(data) {
return request({
url: '/sgyrdd/shop/getById',
method: 'GET',
data,
});
}
<template> <template>
<view class="content"> <view class="content" v-if="dataList.length > 0">
<view class="box"> <view class="box" v-for="(item, index) in dataList" :key="index">
<view class="header"> <view class="header" @click="handleDetail(item.orderNumber)">
<view class="left"> <view class="left">
<image src="@/static/order/shop.png" /> <image src="@/static/order/shop.png" />
<view class="title">宽带融合5G 169套餐</view> <view class="title">{{ item.shopName }}</view>
</view> </view>
<span class="status">待消费</span> <span class="status">{{ statusList[item.status] }}</span>
</view> </view>
<view class="info"> <view class="info" @click="handleDetail(item.orderNumber)">
<image <image mode="aspectFill" :src="fileDomain + item.orderItems[0].pic" />
mode="aspectFill"
src="https://registry.npmmirror.com/wot-design-uni-assets/*/files/redpanda.jpg"
/>
<view class="info-box"> <view class="info-box">
<view class="text">下单时间:2023-06-27 15:53</view> <view class="text">下单时间:{{ item.createTime }}</view>
<view class="text">预约时间:2023-07-04 10:00-12:00</view> <view class="text">预约时间:{{ item.receiverTime }}</view>
<view class="text">数量:1</view> <view class="text">数量:{{ item.orderItems[0].prodCount }}</view>
<view class="text">实付:¥169</view> <view class="text">实付:¥{{ item.actualTotal }}</view>
</view> </view>
</view> </view>
<view class="btn"> <view class="btn">
<view class="btn-info">删除</view> <view class="btn-info" v-if="item.status == 5 || item.status == 6">删除</view>
<view class="btn-info">查看预约</view> <view class="btn-info" v-if="item.status == 3" @click="handleDetail(item.orderNumber)">
<view class="btn-error">再来一单</view> 查看预约
</view>
<view class="btn-info" v-if="item.status == 1">取消订单</view>
<view class="btn-info">联系商家</view>
<view class="btn-error" v-if="item.status == 7">售后详情</view>
<view class="btn-error" v-if="item.status == 2 || item.status == 3 || item.status == 4">
申请退款
</view>
<view class="btn-error" v-if="item.status == 5">再来一单</view>
<view class="btn-error" v-if="item.status == 1">立即支付</view>
</view> </view>
</view> </view>
<wd-loadmore :state="state" @reload="loadmore" /> <wd-loadmore :state="state" @reload="getList" />
</view> </view>
<wd-status-tip image="content" tip="暂无内容" v-else />
</template> </template>
<script setup> <script setup>
import { getOrderList } from '@/api/order'; import { getOrderList } from '@/api/order';
const fileDomain = import.meta.env.VITE_APP_IMG_URL;
const emits = defineEmits(['refresh']);
const state = ref('loading'); const state = ref('loading');
const page = reactive({ const catalog = reactive({
pageNum: 0, current: 0,
pageSize: 10, size: 10,
startDate: '',
endDate: '',
keyword: '',
status: '', // 订单状态,1-待付款,2-待接单,3-待取货,4-待评价,5-完成,6-取消,7-退款
}); });
const statusList = ref({
1: '待付款',
3: '待消费',
4: '待评价',
5: '已完成',
6: '已取消',
7: '已退款',
});
const total = ref(0);
const dataList = ref([]);
const num = ref(0); const getList = async () => {
const max = ref(60); catalog.current++;
onReachBottom(() => { state.value = 'loading';
if (num.value === 45) { const res = await getOrderList(catalog);
if (res.code === 0) {
if (res.data.records.length > 0) {
dataList.value.push(...res.data.records);
total.value = res.data.total;
console.log(total.value);
} else {
state.value = 'finished';
}
} else {
state.value = 'error'; state.value = 'error';
} else if (num.value < max.value) { }
getList(); };
} else if (num.value === max.value) { getList();
onReachBottom(() => {
if (dataList.value.length >= total.value) {
state.value = 'finished'; state.value = 'finished';
} else {
getList();
} }
}); });
const getList = async () => { const handleDetail = (id) => {
const res = await getOrderList(); uni.navigateTo({
state.value = 'loading'; url: `/pages/order/detail?orderNumber=${id}`,
console.log(res); });
}; };
getList(); const handleRefresh = (e) => {
catalog.status = e;
if (e === '0') {
catalog.status = '';
}
catalog.current = 0;
dataList.value = [];
total.value = 0;
getList();
};
defineExpose({
refresh: handleRefresh,
});
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
...@@ -69,6 +120,7 @@ getList(); ...@@ -69,6 +120,7 @@ getList();
align-items: center; align-items: center;
justify-content: center; justify-content: center;
padding: 20rpx; padding: 20rpx;
gap: 24rpx;
.box { .box {
background-color: #fff; background-color: #fff;
......
This diff is collapsed.
...@@ -2,13 +2,12 @@ ...@@ -2,13 +2,12 @@
<view class="container"> <view class="container">
<Header title="全部订单"></Header> <Header title="全部订单"></Header>
<view class="tabs"> <view class="tabs">
<wd-tabs v-model="tab" animated lineWidth="38" lineHeight="3"> <wd-tabs v-model="tab" animated :lineWidth="38" :lineHeight="3" @change="handleChange">
<block v-for="item in tabs" :key="item"> <block v-for="item in tabs" :key="item.value">
<wd-tab :title="`${item}`" :name="item"> <wd-tab :title="`${item.name}`" :name="item.value"></wd-tab>
<OrderList></OrderList>
</wd-tab>
</block> </block>
</wd-tabs> </wd-tabs>
<OrderList ref="OrderListRef"></OrderList>
</view> </view>
</view> </view>
</template> </template>
...@@ -17,8 +16,37 @@ ...@@ -17,8 +16,37 @@
import Header from './components/Header/index.vue'; import Header from './components/Header/index.vue';
import OrderList from './components/OrderList/index.vue'; import OrderList from './components/OrderList/index.vue';
const tabs = ref(['全部', '待付款', '待收货', '待使用', '待评价', '退款/售后']); const tabs = ref([
const tab = ref('待使用'); {
name: '全部',
value: '0',
},
{
name: '待付款',
value: '1',
},
{
name: '待使用',
value: '3',
},
{
name: '待评价',
value: '4',
},
{
name: '退款/售后',
value: '7',
},
]);
const tab = ref('0');
onReachBottom(() => {});
const OrderListRef = ref(null);
const handleChange = (e) => {
tab.value = e.name;
OrderListRef.value.refresh(tab.value);
};
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment