yeg
2026-09-17 b9b255187d654e1e49606009ab21e1737c8ba7a4
fix(rencaika): 待使用页核销码图片加载失败不再留白

核销码 `<image>` 缺 @error 兜底:取图失败时 codeImage 仍是非空字符串,v-if 依旧成立,
「核销码加载失败,点击重试」的 v-else 永远显示不出来,页面只剩一片空白,用户分不清是没生成、
没网还是码失效。这正是 7.22 遗留问题 P1-006(远程图片失败会直接留白)的同一类缺陷,
人才码页与免费券码页都已按 @error 回退处理,待使用页被漏掉。

补上 @error:收回图片地址、显示失败文案,并把重试入口挂到占位文案上;同页商品封面图同样
@error 回退本地占位图(P1-006 对商品图的要求)。

真机上图片取不回来的原因(http 图片受 downloadFile 白名单与 HTTPS 限制)不单独排期,
后台切到 HTTPS 合法域名后自然消失,结论见 .scratch/order-payment-display/issues/。
1个文件已修改
8 ■■■■■ 已修改文件
rencaika/pages/pending-use/pending-use.uvue 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rencaika/pages/pending-use/pending-use.uvue
@@ -12,12 +12,12 @@
        <scroll-view class="content" scroll-y="true" show-scrollbar="false">
            <view class="content-inner">
                <view class="qr-card">
                    <image v-if="codeImage != ''" class="code-image" :src="codeImage" mode="aspectFit"></image><text v-else class="dynamic-code-placeholder">{{codeError ? '核销码加载失败,点击重试' : '正在生成核销码'}}</text>
                    <image v-if="codeImage != ''" class="code-image" :src="codeImage" mode="aspectFit" @error="handleCodeImageError"></image><text v-else class="dynamic-code-placeholder" @tap="refreshCode">{{codeError ? '核销码加载失败,点击重试' : '正在生成核销码'}}</text>
                    <text class="qr-tip" @tap="refreshCode">{{codeText}}</text>
                </view>
                <view class="product-card">
                    <image class="product-image" :src="productCoverUrl" mode="aspectFill"></image>
                    <image class="product-image" :src="productCoverUrl" mode="aspectFill" @error="handleCoverImageError"></image>
                    <view class="product-info"><text class="product-name">{{productName}}</text><text class="product-original">¥ {{originalAmount}}</text></view>
                    <view class="product-payment"><text class="payment-label">实付</text><text class="payment-price">¥ {{payAmount}}</text></view>
                </view>
@@ -87,6 +87,10 @@
        productName.value=data.productNameSnapshot||productName.value; productCoverUrl.value=resolveApiUrl(data.productCoverUrlSnapshot||'/static/home-assets/top.jpg'); originalAmount.value=Number(data.originalAmount).toFixed(2); payAmount.value=Number(data.payAmount).toFixed(2); discountAmount.value=Number(data.discountAmount).toFixed(2); merchantName.value=data.merchantNameSnapshot||''; merchantAddress.value=data.merchantAddressSnapshot||''; merchantMobile.value=data.merchantMobileSnapshot||''; merchantLatitude.value=Number(data.merchantLatitudeSnapshot); merchantLongitude.value=Number(data.merchantLongitudeSnapshot); createdAt.value=(''+data.createdAt).replace('T',' ').substring(0,19); verifyTime.value=data.verifyTime?(''+data.verifyTime).replace('T',' ').substring(0,19):'-'; canRefund.value=data.canRefund===true }, () => {})
    const stopRefresh=()=>{if(refreshTimer!=0){clearTimeout(refreshTimer);refreshTimer=0}}
    const refreshCode=()=>{stopRefresh(); if(orderId.value=='')return; codeError.value=false; issueOrderVerificationCode(orderId.value,talentId.value,(data:any)=>{codeImage.value=resolveApiUrl(data.imagePath as string);codeText.value='核销码 '+(data.displayCode as string)+',请向商家出示';refreshTimer=setTimeout(()=>refreshCode(),Math.max(1,Number(data.refreshAfterSeconds)-3)*1000)},()=>{codeImage.value='';codeError.value=true;codeText.value='点击重新生成核销码'})}
    // @error 必须收回图片地址:二维码取不回来时页面只会剩一片空白,用户分不清是没生成、没网还是码失效。
    // 这是 7.22 遗留问题 P1-006(远程图片失败会留白)的同一类缺陷,人才码和免费券码页都已按此处理。
    const handleCodeImageError=()=>{codeImage.value='';codeError.value=true;codeText.value='核销码加载失败,点击重新生成'}
    const handleCoverImageError=()=>{productCoverUrl.value='/static/home-assets/top.jpg'}
    const openNavigation = () => { if(merchantLatitude.value==0||merchantLongitude.value==0){uni.showToast({title:'商户暂未配置导航地址',icon:'none'});return};uni.openLocation({latitude:merchantLatitude.value,longitude:merchantLongitude.value,name:merchantName.value,address:merchantAddress.value,scale:16}) }
    const callMerchant = () => { if(merchantMobile.value==''){uni.showToast({title:'商户暂未配置联系电话',icon:'none'});return};uni.makePhoneCall({phoneNumber:merchantMobile.value}) }
    const requestRefund = () => {