ll
liukangdong
2024-10-22 85b460b57cd7e9ad935042df74f40e1bbdfa3408
ll
已修改4个文件
42 ■■■■■ 文件已修改
h5_meeting/pages/index/config.vue 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
h5_meeting/pages/index/index.vue 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
h5_meeting/utils/config.js 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
h5_meeting/utils/service.js 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
h5_meeting/pages/index/config.vue
@@ -28,17 +28,20 @@
</template>
<script>
    import { baseUrl } from '@/utils/config.js'
    export default {
        data() {
            return {
                param: {
                    baseUrl: 'http://192.168.5.13/gateway_interface/'
                    baseUrl,
                    time: 60
                }
            };
        },
        onLoad(){
            const param = uni.getStorageSync('param') || {
                baseUrl: 'http://192.168.5.13/gateway_interface/'
                baseUrl: baseUrl,
                time: 60
            }
            this.param = { ...param }
        },
h5_meeting/pages/index/index.vue
@@ -98,20 +98,24 @@
                    4: '即将开始',
                    5: '已撤销',
                },
                meetingInfo: {}
                meetingInfo: {},
                timer: null
            }
        },
        onShow() {
            this.initDatetime()
            this.param = uni.getStorageSync('param') || {}
            if (!this.param.code) {
                return uni.navigateTo({
                    url: '/pages/index/config'
                })
            }
            this.getData()
        },
        onReady() {},
        onHide(){
            if(this.timer){
                clearInterval(this.timer)
            }
        },
        methods: {
            getData() {
                this.showQrbg = false
@@ -174,7 +178,12 @@
                    this.time = dayjs().format('HH:mm')
                    this.date = dayjs().format('YYYY-MM-DD') + ' ' + weeks[new Date().getDay()]
                }, 1000)
                setInterval(() => {
                this.param = uni.getStorageSync('param') || {}
                if(this.timer){
                    clearInterval(this.timer)
                }
                this.getData()
                this.timer = setInterval(() => {
                    this.getData()
                }, this.param.time ? this.param.time * 1000 : 60 * 1000)
            }
h5_meeting/utils/config.js
@@ -1,6 +1,7 @@
export const baseUrl = 'gateway_interface/'
// export const baseUrl = 'http://192.168.5.13/gateway_interface/'
// export const baseUrl = 'gateway_interface/'
export const baseUrl = 'http://192.168.5.13/gateway_interface/'
// export const baseUrl = 'http://10.50.250.253:8088/gateway_interface/'
export const statusMap = {
    0: '待确认',
h5_meeting/utils/service.js
@@ -8,13 +8,14 @@
            // uni.showLoading({
            //     title:"加载中..."
            // })
            uni.showLoading({
                title: '加载中',
                mask: true
            })
            // uni.showLoading({
            //     title: '加载中',
            //     mask: true
            // })
            const param = uni.getStorageSync('param') || {}
            uni.request({
                url: (param.baseUrl || baseUrl) + options.url,
                // url: baseUrl + options.url,
                data: options.data || {},
                method: options.method || 'GET',
                header: options.header || {
@@ -25,7 +26,7 @@
                success: (res) => {
                    let data = res.data
                    // 控制台显示数据信息
                    uni.hideLoading()
                    // uni.hideLoading()
                    // 登录过期
                    if (data.code === 5112) {
                        setTimeout(() => {
@@ -63,7 +64,7 @@
                    console.log('msg', baseUrl + options.url)
                    // 返回错误消息
                    reject(err)
                    uni.hideLoading()
                    // uni.hideLoading()
                },
                catch: (e) => {
                    console.log(e)