提交 cf87bd7a 编写于 作者: guangjun.yang's avatar guangjun.yang

去掉alert日志

上级 ff85213f
......@@ -116,7 +116,7 @@
needSubContent
:isShowDialog="isShowCantBuyTips"
@handlerAction="isShowCantBuyTips=false"
></ShowCantBuyTips>
></ShowCantBuyTips>
</div>
</template>
......@@ -186,7 +186,7 @@ export default {
shareTitleInfo: "",
isShowShare: true,
isShowCantBuyTips: false,
couponToken: "",
couponToken: ""
};
},
computed: {
......@@ -229,8 +229,8 @@ export default {
this.projectId = this.$route.query.projectId;
this.goodsId = this.$route.query.goodsId;
this.courseUrl = this.$route.query.courseUrl || ""; //
this.couponToken = this.$route.query.couponToken || ""
alert(this.couponToken);
this.couponToken = this.$route.query.couponToken || "";
console.log('this.couponToken', this.couponToken);
this.shareUrl = getWebPageUrl(
`profexam/#/goods-detail?goodsId=${this.goodsId}`
);
......@@ -280,7 +280,8 @@ export default {
if (this.isWeb) {
let { token, info } = this.$store.state.user;
token =
token || this.couponToken ||
token ||
this.couponToken ||
localStorage.getItem("couponToken") ||
getCookie("couponToken");
this.token = token;
......@@ -293,8 +294,8 @@ export default {
if (token && !info.id) {
// this.commonCheckToken(() => {
// this.$store.dispatch('setToken', this.token);
this.$store.dispatch("getUserInfo");
// this.$store.dispatch('setToken', this.token);
this.$store.dispatch("getUserInfo");
// });
// return;
}
......@@ -475,84 +476,83 @@ export default {
return;
}
// this.commonCheckToken(() => {
this.GET(`trade/goods/goodInfoV3/${this.goodsId}`, {}).then(res => {
if (res.code == "000000") {
const goods = res.data;
const tabs = [];
let priceNew = goods.preferentialPrice || goods.costPrice;
let price =
goods.couponPrice || goods.preferentialPrice || goods.costPrice;
this.goods = goods;
this.defaultCouponId =
(goods.couponDTO && goods.couponDTO.couponId) || "";
// 获取到商品后,再获取优惠券
this.getCanUseCoupons({
goodsType: goods.goodsType,
cardType: goods.cardType,
price: priceNew,
count: 0
});
goods.salePriceNew = this.formatPrice(priceNew);
goods.salePrice = this.formatPrice(price);
goods.costPriceText = (goods.costPrice / 100).toFixed(2);
goods.hasDiscount = !!goods.preferentialPrice;
// goods.hasDiscount = !!(goods.couponPrice || goods.preferentialPrice);
let savePrice = 0;
if (goods.couponPrice) {
if (goods.preferentialPrice) {
savePrice = (
(goods.preferentialPrice - goods.couponPrice) /
100
).toFixed(2);
} else {
savePrice = (
(goods.costPrice - goods.couponPrice) /
100
).toFixed(2);
}
}
if (goods.goodsDescWhere) {
tabs.push({ name: "使用范围", detail: goods.goodsDescWhere });
}
if (goods.goodsDescHow) {
tabs.push({ name: "如何使用", detail: goods.goodsDescHow });
}
if (goods.goodsDescQaq) {
tabs.push({ name: "常见问题", detail: goods.goodsDescQaq });
this.GET(`trade/goods/goodInfoV3/${this.goodsId}`, {}).then(res => {
if (res.code == "000000") {
const goods = res.data;
const tabs = [];
let priceNew = goods.preferentialPrice || goods.costPrice;
let price =
goods.couponPrice || goods.preferentialPrice || goods.costPrice;
this.goods = goods;
this.defaultCouponId =
(goods.couponDTO && goods.couponDTO.couponId) || "";
// 获取到商品后,再获取优惠券
this.getCanUseCoupons({
goodsType: goods.goodsType,
cardType: goods.cardType,
price: priceNew,
count: 0
});
goods.salePriceNew = this.formatPrice(priceNew);
goods.salePrice = this.formatPrice(price);
goods.costPriceText = (goods.costPrice / 100).toFixed(2);
goods.hasDiscount = !!goods.preferentialPrice;
// goods.hasDiscount = !!(goods.couponPrice || goods.preferentialPrice);
let savePrice = 0;
if (goods.couponPrice) {
if (goods.preferentialPrice) {
savePrice = (
(goods.preferentialPrice - goods.couponPrice) /
100
).toFixed(2);
} else {
savePrice = ((goods.costPrice - goods.couponPrice) / 100).toFixed(
2
);
}
this.totalPrice = {
...goods.salePrice,
preferentialPrice: goods.preferentialPrice,
costPrice: goods.costPrice,
costPriceText: goods.costPriceText,
savePrice
};
this.swiperList = (res.data && res.data.imgList) || [];
this.tabs = tabs;
this.getTabW();
let sharePrice = goods.preferentialPrice || goods.costPrice;
let shareTitleInfo = "¥" + (sharePrice / 100).toFixed(2);
shareTitleInfo += "\n" + (goods.shareContent || "");
let shareUrl = getWebPageUrl(
`profexam/#/goods-detail?goodsId=${this.goods.id}`
);
this.shareTitleInfo = shareTitleInfo;
this.wechatShare(
{
link: shareUrl,
title: goods.goodsName,
friendtitle: goods.goodsName,
desc: shareTitleInfo,
imgUrl: "https://file.yunqueyi.com/logo.png"
},
() => {
console.log("share success...");
}
);
} else {
this.$toast(res.message);
}
});
if (goods.goodsDescWhere) {
tabs.push({ name: "使用范围", detail: goods.goodsDescWhere });
}
if (goods.goodsDescHow) {
tabs.push({ name: "如何使用", detail: goods.goodsDescHow });
}
if (goods.goodsDescQaq) {
tabs.push({ name: "常见问题", detail: goods.goodsDescQaq });
}
this.totalPrice = {
...goods.salePrice,
preferentialPrice: goods.preferentialPrice,
costPrice: goods.costPrice,
costPriceText: goods.costPriceText,
savePrice
};
this.swiperList = (res.data && res.data.imgList) || [];
this.tabs = tabs;
this.getTabW();
let sharePrice = goods.preferentialPrice || goods.costPrice;
let shareTitleInfo = "¥" + (sharePrice / 100).toFixed(2);
shareTitleInfo += "\n" + (goods.shareContent || "");
let shareUrl = getWebPageUrl(
`profexam/#/goods-detail?goodsId=${this.goods.id}`
);
this.shareTitleInfo = shareTitleInfo;
this.wechatShare(
{
link: shareUrl,
title: goods.goodsName,
friendtitle: goods.goodsName,
desc: shareTitleInfo,
imgUrl: "https://file.yunqueyi.com/logo.png"
},
() => {
console.log("share success...");
}
);
} else {
this.$toast(res.message);
}
});
// });
},
......@@ -676,7 +676,7 @@ export default {
preCreateOrder() {
this.commonCheckToken(() => {
const { goodsType, cardType } = this.goods;
console.log('goodsType, cardType', goodsType, cardType);
console.log("goodsType, cardType", goodsType, cardType);
// 只有一类卡才做相应判断
if (goodsType == 2 && cardType == 1) {
this.GET(
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册