|
|
@@ -6,12 +6,10 @@
|
|
|
<view :class="['iconfont', 'iconchenggong']"></view>
|
|
|
<view class="result-title">充值成功</view>
|
|
|
<view class="textarea-container">
|
|
|
- <textarea
|
|
|
+ <view
|
|
|
class="result-textarea"
|
|
|
- v-model="copyText"
|
|
|
- readonly
|
|
|
- placeholder=""
|
|
|
- ></textarea>
|
|
|
+ :style="{ height: textareaHeight + 'upx' }"
|
|
|
+ >{{ copyText }}</view>
|
|
|
</view>
|
|
|
<view style="font-size:34upx;color:#807d7d;">复制上面文字,发给客户</view>
|
|
|
<view class="pay-confirm-content">
|
|
|
@@ -32,7 +30,8 @@ export default {
|
|
|
return {
|
|
|
orderInfo:[],
|
|
|
copyText:"",
|
|
|
- remainDebtPrice:0
|
|
|
+ remainDebtPrice:0,
|
|
|
+ textareaHeight: 300
|
|
|
}
|
|
|
},
|
|
|
onLoad(){
|
|
|
@@ -56,10 +55,26 @@ export default {
|
|
|
let rechargeAccountLink = res.data.rechargeAccountLink ? res.data.rechargeAccountLink:''
|
|
|
let orderLink = res.data.orderLink?res.data.orderLink:''
|
|
|
that.copyText = "已售后,欠款减少"+amount+"元,本单剩余欠款"+that.remainDebtPrice+"元,点击下面链接查看详情\n\n余额 "+rechargeAccountLink+"\n\n本单 "+orderLink+"\n\n链接30天后失效"
|
|
|
+ that.$nextTick(() => {
|
|
|
+ that.calculateHeight()
|
|
|
+ })
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
+ calculateHeight(){
|
|
|
+ // 根据文本内容计算合适的高度
|
|
|
+ const lineHeight = 1.6
|
|
|
+ const fontSize = 28
|
|
|
+ const padding = 60 // 上下padding各30upx
|
|
|
+ const minHeight = 300
|
|
|
+
|
|
|
+ // 计算行数(按换行符分割)
|
|
|
+ const lines = this.copyText.split('\n').length
|
|
|
+ const calculatedHeight = Math.max(minHeight, lines * fontSize * lineHeight + padding)
|
|
|
+
|
|
|
+ this.textareaHeight = calculatedHeight
|
|
|
+ },
|
|
|
copyBack(){
|
|
|
uni.setClipboardData({
|
|
|
data: this.copyText,
|
|
|
@@ -127,15 +142,12 @@ export default {
|
|
|
background: #f8f9fa;
|
|
|
border: 2upx solid #e9ecef;
|
|
|
border-radius: 16upx;
|
|
|
- font-size: 32upx;
|
|
|
+ font-size: 28upx;
|
|
|
line-height: 1.6;
|
|
|
color: #333;
|
|
|
- resize: none;
|
|
|
-
|
|
|
- &:focus {
|
|
|
- border-color: $mainColor1;
|
|
|
- background: #fff;
|
|
|
- }
|
|
|
+ word-wrap: break-word;
|
|
|
+ white-space: pre-wrap;
|
|
|
+ overflow-y: auto;
|
|
|
}
|
|
|
}
|
|
|
}
|