333
schangxiang@126.com
2025-09-19 18966e02fb573c7e2bb0c6426ed792b38b910940
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
<template>
    <view class="">
        <view class="margin_top40rpx text_align_center" v-for="(item,index) in list" :key='index'>
            <view class="little_card fontSize36rpx" @click="skip(item,index)" :class="active==index?'active':''">
                {{item.name}}
            </view>
        </view>
        <modal-code :rescode='rescode' :resmessage='resmessage' ref="resmodal" />
    </view>
</template>
 
<script>
    import ModalCode from '@/components/ModalCode.vue'
    import {
        callingTpFn
    } from '@/src/api/artificial.js'
    export default {
        data() {
            return {
                active: null,
                type:'',
                list: [
                    {
                        name: '呼叫大托盘',
                        pages: '2'
                    }, 
                    {
                        name: '呼叫小托盘',
                        pages: '1'
                    }
                ],
                resmessage: "",
                rescode: 0
            }
        },
        components: {
            ModalCode
        },
        onLoad(options) {
            this.type = options.type
        },
        methods: {
            skip(item, index) {
                uni.showModal({
                    title: '提示',
                    content: '是否确认呼叫?',
                    showCancel: true,
                    cancelColor: '#333333',
                    success: (res => {
                        if (res.confirm) {
                            let params = {
                                "containerTypeId":item.pages
                            };
                            callingTpFn(params).then(res => {
                                if(res.data){ //200
                                    this.rescode = 200
                                    this.resmessage = "呼叫成功"
                                    this.$refs.resmodal.show = true
                                }else{
                                    this.resmessage = res.data.msg;
                                    this.rescode = 400
                                    this.$refs.resmodal.show = true
                                }
                            })
                        } else if (res.cancel) {
                
                        }
                    })
                });
                
                
                // this.active = index
                // if (item.pages) {
                //     setTimeout(() => {
                //         uni.navigateTo({
                //             url:  item.pages
                //         })
                //     }, 100)
                // }
            }
        }
    }
</script>
 
<style>
 
</style>