#
whycq
2023-10-07 e3a9edfa7a5fe7be708eaf84ea534bbde700d1e0
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<template>
    <view>
        <view class="main" v-for="(it,i) in dataList" :key="i">
            <view class="main-left">{{it.key}}</view>
            
            <view class="main-right" 
                v-show="!it.type">
                    {{it.value}}
            </view>
            
            <input class="main-right" 
                v-show="it.type == 'input'" 
                type="text" 
                v-model="it.value"
            >
            <view class="main-right dis-center" v-show="it.type == 'number-box'" @click="numChange(i)">
                <uni-number-box
                    color="#747474" 
                    v-show="it.type == 'number-box'" 
                    :value="it.value" 
                    :max="99999999" 
                    :step='1' 
                    @change="changeValue" 
                />
            </view>
            
        </view>
        
        <button @click="back">back</button>
    </view>
</template>
 
<script>
    export default {
        data() {
            return {
                dataList: [
                    {key: '商品编码',value: 'fbr3dasdasd242fbr3dasdasd242fbr3dasdasd242fbr3dasdasd242fbr2'},
                    {key: '批号',value: '20231006',type: 'input'},
                    {key: '数量',value: 200,type: 'number-box'},
                ],
                baseIP:'',
                basePORT:'',
                index: 0,
                val: 0,
            }
        },
        onLoad(option) {
            let that = this
            // #ifdef APP-NVUE
            const eventChannel = this.$scope.eventChannel; // 兼容APP-NVUE
            // #endif
            // #ifndef APP-NVUE
            const eventChannel = this.getOpenerEventChannel();
            // #endif
            
            // 监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据
            eventChannel.on('mat', function(data) {
                that.dataList = data.data
            })
            
            
        },
        methods: {
            numChange(i) {
                this.dataList[i].value = this.val
            },
            changeValue(value) {
                this.val = value
            },
            back() {
                this.getOpenerEventChannel().emit('dataList', {data: this.dataList});
                uni.navigateBack({
                    
                })
            }
        }
    }
</script>
 
<style scoped> 
    .main {
        display: flex;
        border-bottom: 1px solid #333;
        min-height: 70rpx;
        align-items: center;
        margin-left: 8px;
        padding: 8rpx;
    }
    .main-left {
        width: 140rpx;
        text-align: right;
    }
    .main-right {
        flex: 1;
        background-color: aquamarine;
        margin-left: 8rpx;
        display: flex;
        flex-wrap: wrap;
        /* word-wrap: break-word; */
        word-break: break-all;
    }
    .dis-center {
        justify-content: center;
    }
</style>