1***@qq.com
1***@qq.com
  • 发布:2020-03-25 08:41
  • 更新:2020-03-25 17:55
  • 阅读:1101

【报Bug】web-view 路径为上个页面传过来时,在苹果手机上不显示

分类:HBuilderX

上个页面列表里传了个数据对象过来,在h5端页面正常显示,在苹果端显示空白

[内容]

<template>  
    <view>  
        <web-view :src="item.url"></web-view>  
    </view>  
</template>  

<script>  
    export default {  
        data() {  
            return {  
                userInfo: {} ,// 用户信息  
                item: {}  
            }  
        },  
        onLoad(e) {  
            // 获取缓存user信息  
            this.item = JSON.parse(e.item)  
            console.log('列表详情信息', JSON.parse(e.item), this.url)  
            this.userInfo = uni.getStorageSync('tokenInfo')  
            this.$forceUpdate();  
        },  
        // 右上角 导航栏按钮  
        onNavigationBarButtonTap(e) {  
            var arr1 = ['审核', '修改痕迹', '流程记录', '修改', '删除']  
            // 判断审核显示 1记者 2编辑  // 判断该条是否为自己的 稿源中心里isAuditor 1自己  我的列表里0自己  
            if (this.userInfo.isAuditor == 1)  {  
                arr1.splice(0, 1)  
            }  
            if (this.item.isAuthor == 0 && this.userInfo.isAuthor == 1) return;  
            uni.showActionSheet({  
                itemList: arr1,  
                success: res => {  
                    // 审核  
                    if (arr1.findIndex(item => item == '审核') == res.tapIndex) {  
                        console.log('审核')  
                        uni.showModal({  
                            content: '通过还是退回',  
                            cancelText: '退回',  
                            confirmText: '通过',  
                            success: res=> {  
                                if (res.confirm) {  
                                    //0 删除 1通过 2审核 99 草稿箱  
                                    this.affirmAudit(1)  
                                } else if (res.cancel) {  
                                    uni.navigateTo({  
                                        url: '/pages/index/seeDetails/sendBack?id=' + this.item.idInfo  
                                    })  
                                }  
                            }  
                        });  
                    }  

                    // 修改痕迹  
                    if (arr1.findIndex(item => item == '修改痕迹') == res.tapIndex) {  
                        console.log()  
                        uni.navigateTo({  
                            url: '/pages/index/seeDetails/alterTrail?id=' + this.item.idInfo  
                        })  
                    }  

                    // 流程记录  
                    if (arr1.findIndex(item => item == '流程记录') == res.tapIndex) {  
                        uni.navigateTo({  
                            url: '/pages/index/seeDetails/flowHistory?id=' + this.item.idInfo  
                        })  
                    }  
                    // 修改  
                    if (arr1.findIndex(item => item == '修改') == res.tapIndex) {  
                        // 1 新闻 2 专题  3图集 4视频 5音频  
                        switch (this.item.typeInfo) {  
                            case 1:   
                                uni.navigateTo({  
                                    url: '/pages/index/navList/cast_draft/cast_draft?param=' + JSON.stringify(this.item)  
                                })  
                                break;  
                            case 2:  
                                break;  
                            case 3:  
                                uni.navigateTo({  
                                    url: '/pages/index/navList/cast_image/cast_image?param=' + JSON.stringify(this.item)  
                                })  
                                break;  
                            case 4:  
                                break;  
                            case 5:  
                                break;  
                        }  
                    }  

                    // 删除  
                    if (arr1.findIndex(item => item == '删除') == res.tapIndex) {  
                        uni.showModal({  
                            title: '温馨提示',  
                            content: '确定删除稿件?该操作无法撤回',  
                            cancelText: '取消',  
                            confirmText: '确定',  
                            success: res => {  
                                if (res.confirm) {  
                                    this.affirmAudit(0)  
                                }  
                            }  
                        });  
                    }  
                }  
            });  
        },  
        methods: {  
            // 审核操作 0 删除 1通过 2审核 99 草稿箱  
            examine(status) {  
                return new Promise((resolve, reject)=> {  
                    uni.request({  
                        url: this.websiteUrl + '/news/auditNews',  
                        method: "POST",  
                        header: {  
                            'Content-Type': 'application/x-www-form-urlencoded',  
                            userid: this.userInfo.id,  
                            type: this.userInfo.isAuditor,  
                            token: this.userInfo.tokenInfo,  
                            siteid: this.userInfo.siteIdInfo  
                        },  
                        data: {  
                            id: this.item.idInfo,  
                            status: status //0 删除 1通过 2审核 99 草稿箱  
                        },  
                        success: (res) => {  
                            resolve(res.data)  
                        }  
                    });  
                })  
            },  
            // 确定操作  
            async affirmAudit(e) {  
                var title = ''  
                switch (e){  
                    case 0:  
                    title = '删除成功'  
                        break;  
                    case 1:  
                    title = '已通过'  
                        break;  
                    default:  
                        break;  
                }  
                try{  
                    var example1 = await this.examine(e)  
                    console.log(example1)  
                    if (example1.code == 1) {  
                        uni.showToast({  
                            icon: 'none',  
                            title: title,  
                            duration: 1000  
                        })  
                        var timer1 = setTimeout(()=>{  
                            uni.navigateBack({  
                                delta:1  
                            })  
                        }, 1000)  
                        this.$once('hook:beforeDestroy',()=>{  
                            clearTimeout(timer1)  
                        })  
                    }  
                }catch(e){  
                    //TODO handle the exception  
                }  
            }  
        }  
    }  
</script>  

<style scoped>  

</style>  

IDE运行环境说明

编译器版本 2.5.1

版本号 2.5.1.20200103

windows 10操作系统

iphone 6 版本 12.4.5

联系方式 QQ: 1140691970

2020-03-25 08:41 负责人:无 分享
已邀请:
6***@qq.com

6***@qq.com

此问题已提交等下个版本吧
https://ask.dcloud.net.cn/question/91311?notification_id-701404rf-falseitem_id-117460__answer_id-117460__single-TRUE#!answer_117460

DCloud_uniCloud_WYQ

DCloud_uniCloud_WYQ

可以先升级HBuilderX验证一下,还有问题可以上传一份能运行的demo

该问题目前已经被锁定, 无法添加新回复