Explorar o código

修改价格乱码

ext.liuqiwen3 hai 1 mes
pai
achega
4221fc0718
Modificáronse 2 ficheiros con 9 adicións e 7 borrados
  1. 8 7
      components/productWindow/index.vue
  2. 1 0
      pages/goods/goods_details/index.vue

+ 8 - 7
components/productWindow/index.vue

@@ -225,13 +225,13 @@ const calcNumPrice = computed(() => {
   return total.toFixed(2);
 });
 
-// 监听 calcNumPrice 变化并传递给父组件
-watch(calcNumPrice, (newPrice) => {
-  emit("updatePrice", newPrice);
-}, { immediate: true });
-function goCat() {
-  emit("goCat");
-}
+// // 监听 calcNumPrice 变化并传递给父组件
+// watch(calcNumPrice, (newPrice) => {
+//   emit("updatePrice", newPrice);
+// }, { immediate: true });
+// function goCat() {
+//   emit("goCat");
+// }
 
 function bindCode() {
   emit("iptCartNum", props.attr.productSelect.cart_num);
@@ -242,6 +242,7 @@ function close() {
 }
 
 function submit() {
+  emit("updatePrice", calcNumPrice);
   emit("submit");
 }
 

+ 1 - 0
pages/goods/goods_details/index.vue

@@ -833,6 +833,7 @@ const DefaultSelect = () => {
     attrValue.value = "";
     attrTxt.value = "请选择";
   }
+  attr.value.productSelect.cart_num = 1;
 };
 
 const getCouponList = async (type = "") => {