#
whycq
2025-01-04 d52b996f9ef0e78f7ae99b6b45985a04fcbf3f7e
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
<template>
    <view>
        <view class="data-list" v-for="item in dataList">
            <view class="data-item">
                <view><text>订单号:</text><text>{{item.orderNo}}</text></view>
                <view><text>订单数量:</text><text>{{item.combMats != null ? item.combMats.length : 0}}</text></view>
            </view>
            <view class="data-options">
                <uni-icons type="right" color="#FFF" size="50rpx" @click="back(item)"></uni-icons>
            </view>
        </view>
    </view>
</template>
 
<script>
    export default {
        data() {
            return {
                dataList:[]
            }
        },
        onLoad(option) {
            let _this = this
            // #ifdef APP-NVUE
            const eventChannel = this.$scope.eventChannel; // 兼容APP-NVUE
            // #endif
            // #ifndef APP-NVUE
            const eventChannel = this.getOpenerEventChannel();
            // #endif
            // 监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据
            eventChannel.on('orderDetls', function(data) {
                _this.dataList = data.data
            })
        },
        methods: {
            back(item) {
                this.getOpenerEventChannel().emit('detls', {data: item});
                uni.navigateBack({
                    
                })
            }
        }
    }
</script>
 
<style>
    .data-list {
        margin: 16rpx;
        background-color: antiquewhite;
        display: flex;
        background-color: #888;
        color: #fff;
        border-radius: 16rpx;
    }
    .data-item {
        flex: 1;
        padding: 16rpx 24rpx;
    }
    .data-options {
        width: 15%;
        border-left: 1px solid #ddd;
        display: flex;
        align-items: center;
        justify-content: center;
    }
</style>