| | |
| | | <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> |
| | |
| | | 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 = () => { |