修复切换购买类型优惠券异常问题

This commit is contained in:
X1627315083
2025-05-21 22:35:28 +08:00
parent d174a7a8f1
commit fb06427982
2 changed files with 8 additions and 4 deletions

View File

@@ -119,7 +119,7 @@
</template>
<script lang="ts">
import { defineComponent,computed,reactive,toRefs ,onMounted} from "vue";
import { defineComponent,computed,reactive,toRefs ,watch} from "vue";
import { message } from "ant-design-vue";
import payMethod from "@/component/Pay/payMethod.vue";
import { useStore } from "vuex";
@@ -314,10 +314,14 @@ export default defineComponent({
}
})
}
const clearPromotionCode = ()=>{
watch(()=>renewData.current.type,(newVal,oldVal)=>{
clearPromotionCode(oldVal)
})
const clearPromotionCode = (str:any)=>{
let type = str || renewData.current.type
renewData.promotionData.error = '';
renewData.promotionData.code = ''
renewData.current.price[renewData.current.type] = renewData.promotionData.oldPrice
if(renewData.promotionData.oldPrice)renewData.current.price[str] = renewData.promotionData.oldPrice
renewData.promotionData.oldPrice = ''
}
return{