收藏
回答

服务通知点进去小程序同一个页面 不同场景下ios小程序页面会白屏什么问题?

开发者工具正常 体验版本模拟正常。 只有ios正式版本某两个固定场景不可以。

回答关注问题邀请回答
收藏

3 个回答

  • 社区技术运营专员-Jahozheng
    社区技术运营专员-Jahozheng
    02-14

    请具体描述问题出现的流程,并提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。

    02-14
    有用
    回复 6
    • 不退
      不退
      02-14
      import React, { useState, useRef, useEffect } from 'react';
      import { View, Text, Picker, Button } from '@tarojs/components';
      import * as request from '@utils/request';
      import styles from './index.scss';
      import Taro, { useRouter } from '@tarojs/taro';
      const bizTypeMap = {
        //住院床位变化通知
        '66': {
          pageTitle: '住院床位变化通知',
          fieldList: [
            { title: '就诊人', key: 'name' },
            { title: '证件号', key: 'cardNo' },
            { title: '科室', key: 'deptName' },
            { title: '病区', key: 'areaName' },
            { title: '病床', key: 'bedNumber' },
          ],
        },
        // 报告异常提醒 (用户自己选)
        '57': {
          pageTitle: '报告异常提醒',
          fieldList: [
            { title: '就诊人', key: 'name' },
            { title: '证件号', key: 'cardNo' },
            { title: '科室', key: 'deptName' },
            { title: '医生', key: 'doctorName' },
          ],
        },
        // 手术通知
        '65': {
          pageTitle: '手术通知',
          fieldList: [
            { title: '就诊人', key: 'name' },
            { title: '证件号', key: 'cardNo' },
            { title: '科室', key: 'deptName' },
            { title: '病区', key: 'areaName' },
            { title: '病床', key: 'bedNumber' },
            { title: '手术名称', key: 'projectName' },
          ],
        },
        // 出院通知
        '67': {
          pageTitle: '出院通知',
          fieldList: [
            { title: '就诊人', key: 'name' },
            { title: '证件号', key: 'cardNo' },
            { title: '科室', key: 'deptName' },
            { title: '病区', key: 'areaName' },
            { title: '病床', key: 'bedNumber' },
          ],
        },
        // 出院带药
        '68': {
          pageTitle: '出院带药',
          fieldList: [
            { title: '就诊人', key: 'name' },
            { title: '证件号', key: 'cardNo' },
            { title: '科室', key: 'deptName' },
            { title: '病区', key: 'areaName' },
            { title: '病床', key: 'bedNumber' },
          ],
        },
      };
      const Index: React.FC<{}> = () => {
        const [info, setInfo] = useState({});
        const [list, setList] = useState([]);
        const [remark, setRemark] = useState('');
        const { params: routerParams } = useRouter();
        useEffect(() => {
          const { msgId } = routerParams;
          console.log(routerParams, 'routerParams');
          if (!msgId) {
            Taro.showModal({
              title: '系统提示',
              content: '缺少msgId参数',
              showCancel: false,
              success: function (res) {
                if (res.confirm) {
                  wx.reLaunch({
                    url: '/pages/extra/home/index',
                  });
                }
              },
            });
            return;
          }
          getXCXMsgInfo(msgId);
        }, []);
        const getXCXMsgInfo = async msgId => {
          const { code, data: customizeData } = await request.post(
            '/api/customize/getXCXMsgInfo',
            {
              msgId,
            },
            { isRouteApi: true }
          );
          if (code == 0) {
            const typeItem = bizTypeMap[customizeData.informate_type];
            Taro.setNavigationBarTitle({
              title: typeItem ? typeItem.pageTitle : '注意事项',
            });
            let initData = {};
            try {
              initData = JSON.parse(customizeData.push_input);
            } catch (e) {}
            try {
              initData.itemList = initData.itemList ? JSON.parse(initData.itemList) : [];
            } catch (e) {}
            if (typeItem) {
              const formattedList = typeItem.fieldList
                .map(({ title, key }) => {
                  const value = initData[key];
                  return {
                    key,
                    title,
                    value,
                  };
                })
                .filter(item => item.value);
              setList(formattedList);
            }
            try {
              setInfo(initData);
            } catch (error) {
              console.log(error, 'setInfo');
            }
          }
        };
        const goback = () => {
          Taro.reLaunch({
            url: '/pages/extra/home/index',
          });
        };
        const golookjc = () => {
          Taro.navigateTo({
            url: '/pkg2/report/reportlist/index',
          });
        };
        const golookjy = () => {
          Taro.navigateTo({
            url: '/pkg2/inspectionReport/index',
          });
        };
        return (
          <View className={styles.home}>
            <View className={styles.title}>
              <View className={styles.title_left}></View>
              <View className={styles.title_wenzi}>基础信息</View>
            </View>
            <View className={styles.foundation}>
              {list.map((item, index) => (
                <View key={index} className={styles.foundation_row}>
                  <View className={styles.foundation_row_left}>{item.title}:</View>
                  <View className={styles.foundation_row_right}>{item.value}</View>
                </View>
              ))}
            </View>
            <View className={styles.title}>
              <View className={styles.title_left}></View>
              <View className={styles.title_wenzi}>详情</View>
            </View>
            {info.informateType && info.informateType == '66' ? (
              <View className={styles.detail}>
                {info.explain}!<View>老床位:{info.oldBed}</View> <View>新床位:{info.bedNumber}</View>
              </View>
            ) : info.informateType == '68' ? (
              <View className={styles.detail}>
                {info.explain} &nbsp;&nbsp;&nbsp;&nbsp; 诊断:{info.diagnosis}。
              </View>
            ) : (
              <View className={styles.detail}>
                {info.explain}。{info.remark}
              </View>
            )}
            {info.informateType && info.informateType == '57' ? (
              <View className={styles.container}>
                <View className={styles.button} onClick={golookjc}>
                  看检查
                </View>
                <View className={styles.button} onClick={golookjy}>
                  看检验
                </View>
              </View>
            ) : (
              <View className={styles.btn} onClick={goback}>
                返回
              </View>
            )}
          </View>
        );
      };
      export default Index;
          这是页面完整代码  Taro编译小程序
      info.informateType 为57和66的时候ios手机小程序打开页面白屏  。  其他手机包括电脑微信都正常。        msgId为服务通知点击带进来的id
      02-14
      回复
    • 社区技术运营专员-Jahozheng
      社区技术运营专员-Jahozheng
      02-14回复不退
      在正式版打开调试还有一种方法,就是先在开发版或体验版打开调试,再切到正式版就能看到vConsole
      02-14
      回复
    • 不退
      不退
      02-14
      TypeError: __wxAppCode__['pkg3/checknote/index.wxss'] is not a function. (In '__wxAppCode__['pkg3/checknote/index.wxss']()', '__wxAppCode__['pkg3/checknote/index.wxss']' is undefined)\n\t/wx727bdbda7344d415/83/page-frame.html:1:174\nglobal code@https://servicewechat.com/wx727bdbda7344d415/83/page-frame.html:1:174    这个错误警告 。
      02-14
      回复
    • 不退
      不退
      02-14回复不退
      是我info.informateType 为57和66的时候写法不兼容ios吗
      02-14
      回复
    • 社区技术运营专员-Jahozheng
      社区技术运营专员-Jahozheng
      02-14回复不退
      不是 看代码检查是不是方法写错了吧
      02-14
      回复
    查看更多(1)
  • M.J
    M.J
    09-10

    我这周也碰到了类似的问题,只有在聊天会话中消息卡片打开时白屏,其他场景值正常展示,且安卓都正常。楼主这个问题有解决吗?

    09-10
    有用
    回复
  • 智能回答 智能回答 该问答由AI生成
    02-11
    有用
登录 后发表内容