绿满眶商城微信小程序-uniapp
xiangpei
2025-07-09 a1c289e7dfc5d9a3b8dc7ca9b05857f276c05f8d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<template>
    <view class="container">
        <uni-table ref="table" :loading="loading" border stripe type="selection" emptyText="暂无更多数据"
            @selection-change="selectionChange">
            <uni-tr>
                <uni-th width="40" align="center">商品 </uni-th>
                <uni-th width="50" align="center">单价</uni-th>
                <uni-th width="50">数量</uni-th>
                <uni-th width="20">已发包裹 </uni-th>
                <uni-th width="20">小计 </uni-th>
            </uni-tr>
            <uni-tr v-for="(item, index) in tableData" :key="index">
                <uni-td>{{ item.date }}</uni-td>
                <uni-td>
                    <view class="name">{{ item.name }}</view>
                </uni-td>
                <uni-td align="center">{{ item.address }}</uni-td>
                <uni-td>
                    <view class="uni-group">
                        <button class="uni-button" size="mini" type="primary">修改</button>
                        <button class="uni-button" size="mini" type="warn">删除</button>
                    </view>
                </uni-td>
            </uni-tr>
        </uni-table>
    </view>
</template>
 
<script>
    import {
        supplierOrderDetail
    } from '@/api/supplier.js'
    export default {
        data() {
            return {
                tableData: [],
                loading: false,
                selectedIndexs: []
 
            }
        },
        methods: {
            methods: {
                // 多选处理
                selectedItems() {
                    if(this.tableData.length == 0) return
                    return this.selectedIndexs.map(i => this.tableData[i])
                },
                // 多选
                selectionChange(e) {
                    console.log(e.detail.index)
                    this.selectedIndexs = e.detail.index
                },
            },
            async onLoad(query) {
                // const {
                //     order_sn
                // } = query
                const order_sn = 'O202507091942755596113694720'
                const orderDetail = await supplierOrderDetail(order_sn);
                this.tableData = orderDetail.data.result.orderItems
                console.log('------------------------------>', JSON.stringify(this.tableData))
            }
        }
    }
</script>
 
<style>
</style>