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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
<template>
    <view class="noob-tour"
        v-if="roleType===3&&isFirstLogin||isPersonCenter">
        <combined-title title="操作指引"></combined-title>
        <u-cell-group>
            <u-cell title="接单预约操作指引"
                name='1'
                :clickable="true"
                @click="noobTour(1)">
                <u-badge type="primary"
                    value="01"
                    slot='icon'></u-badge>
                <u-icon slot="value"
                    name="arrow-right"
                    size="30"
                    color="#b8b8b8"></u-icon>
            </u-cell>
            <u-cell title="外销单过磅指引"
                name='1'
                :clickable="true"
                @click="noobTour(2)">
                <u-badge type="primary"
                    value="02"
                    slot='icon'></u-badge>
                <u-icon slot="value"
                    name="arrow-right"
                    size="30"
                    color="#b8b8b8"></u-icon>
            </u-cell>
            <u-cell title="外购单过磅指引"
                name='1'
                :clickable="true"
                @click="noobTour(3)">
                <u-badge type="primary"
                    value="03"
                    slot='icon'></u-badge>
                <u-icon slot="value"
                    name="arrow-right"
                    size="30"
                    color="#b8b8b8"></u-icon>
            </u-cell>
            <u-cell title="内调单过磅指引"
                name='1'
                :clickable="true"
                @click="noobTour(4)">
                <u-badge type="primary"
                    value="04"
                    slot='icon'></u-badge>
                <u-icon slot="value"
                    name="arrow-right"
                    size="30"
                    color="#b8b8b8"></u-icon>
            </u-cell>
        </u-cell-group>
        <!-- 图片预览弹出框 -->
        <view class="previewImage-container">
            <previewImage ref="previewImage"
                :imgs="imgList"
                :saveBtn='false'></previewImage>
        </view>
    </view>
</template>
 
<script>
    import combinedTitle from '@/components/combined-title/combined-title.vue';
    import previewImage from '@/components/kxj-previewImage/kxj-previewImage.vue';
    import { mapState } from 'vuex'
    import { BaseUrl } from '@/api/publicInterface.js'
    export default {
        name: "noobTour",
        components: {
            combinedTitle,
            previewImage
        },
        created() {
            if (!this.isFirstTime) {
                this.getLogOn()
            }
        },
        props: {
            isPersonCenter: {
                type: Boolean,
                default: () => false
            }
        },
        data() {
            return {
                imgList: [],
                isFirstLogin: true, //是否是第一次登录
                phone: "",
                isFirstTime: false, //是否是登录进入首页,还是别的页面返回 false是登录 true是别的页面
            };
        },
        computed: {
            ...mapState(['driverTourImgList']),
            roleType() {
                return uni.getStorageSync('roleType');
            },
        },
        methods: {
            noobTour(order) {
                switch (order) {
                    case 1:
                        this.imgList = this.driverTourImgList.slice(0, 8)
                        this.$nextTick(() => {
                            this.$refs.previewImage.open(
                                'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj1.png')
                        })
                        break;
                    case 2:
                        this.imgList = this.driverTourImgList
                        this.$nextTick(() => {
                            this.$refs.previewImage.open(
                                'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj1.png')
                        })
                        break;
                    case 3:
                        this.imgList = this.driverTourImgList
                        this.$nextTick(() => {
                            this.$refs.previewImage.open(
                                'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj1.png')
                        })
                        break;
                    case 4:
                        this.imgList = this.driverTourImgList
                        this.$nextTick(() => {
                            this.$refs.previewImage.open(
                                'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj1.png')
                        })
                        break;
                    default:
                        break;
                }
 
            },
            getLogOn() {
                this.isFirstTime = true
                this.$reqGet('getUserEntity').then(res => {
                    this.phone = res.data.phone
                }).then(() => {
                    uni.request({
                        url: `${BaseUrl}/admin/log/getLogOnType?phone=${this.phone}`,
                        success: res => {
                            // res.data.data 为1 代表第一次登录  为0取消学习指引 为2 代表存在
                            if (res.data.data === 1) {
                                this.noobTour()
                            } else if (res.data.data === 2) {
                                this.isFirstLogin = true
                                this.$emit('isFirstLogin', this.isFirstLogin)
                            } else {
                                this.isFirstLogin = false
                                this.$emit('isFirstLogin', this.isFirstLogin)
                            }
                        }
                    });
                })
            },
        }
    }
</script>
 
<style lang="scss">
 
</style>