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 这个错误警告 。
请具体描述问题出现的流程,并提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。
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} 诊断:{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
我这周也碰到了类似的问题,只有在聊天会话中消息卡片打开时白屏,其他场景值正常展示,且安卓都正常。楼主这个问题有解决吗?