-
{{timerTxt}}
+
{{timer}}
@@ -34,6 +34,10 @@ export default {
type : Number | String,
default : ''
},
+ timer : {
+ type : String,
+ default : '',
+ },
money : {
type : String | Number,
default : 0
@@ -43,8 +47,6 @@ export default {
return {
imgUrl : '',
timerTxt : '',
- timerStop : null,
- startSecondNum : 0
}
},
computed:{
@@ -59,32 +61,12 @@ export default {
},
methods : {
async getCodeImg(){
- this.startSecondNum = 1800;
- // 待支付 开始倒计时
- if(this.timerStop){
- clearTimeout(this.timerStop);
- }
- this.timerStop = null;
const {error, result} = await ApiPostPayCdoeImg({orderId : this.orderId});
if(error){
return false;
}
- this.timer();
this.imgUrl = result.dataInfo.codeImgData;
},
- /**
- * 待付款的倒计时
- */
- timer(){
- if(this.startSecondNum === 0){
- return false
- }
- this.startSecondNum--;
- let minute = parseInt(this.startSecondNum / 60);
- let second = parseInt(this.startSecondNum % 60);
- this.timerTxt = `剩余${minute > 0 ? `${minute}分` : ''} ${second}秒`;
- this.timerStop = setTimeout(()=>this.timer(),1000)
- },
close(){
this.$emit('cancel');
},
diff --git a/components/UIGoodsInfo.vue b/components/UIGoodsInfo.vue
index eeaae78..97cb992 100644
--- a/components/UIGoodsInfo.vue
+++ b/components/UIGoodsInfo.vue
@@ -2,7 +2,7 @@
* @Author: ch
* @Date: 2022-05-08 14:41:42
* @LastEditors: ch
- * @LastEditTime: 2022-05-08 15:11:29
+ * @LastEditTime: 2022-05-09 22:01:52
* @Description: file content
-->
@@ -12,7 +12,7 @@
{{goods.productName}}
- {{goods.skuDescribe}}{{goods.productName}}
+ {{goods.skuDescribe}}