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

去掉alert日志

上级 ff85213f
...@@ -116,7 +116,7 @@ ...@@ -116,7 +116,7 @@
needSubContent needSubContent
:isShowDialog="isShowCantBuyTips" :isShowDialog="isShowCantBuyTips"
@handlerAction="isShowCantBuyTips=false" @handlerAction="isShowCantBuyTips=false"
></ShowCantBuyTips> ></ShowCantBuyTips>
</div> </div>
</template> </template>
...@@ -186,7 +186,7 @@ export default { ...@@ -186,7 +186,7 @@ export default {
shareTitleInfo: "", shareTitleInfo: "",
isShowShare: true, isShowShare: true,
isShowCantBuyTips: false, isShowCantBuyTips: false,
couponToken: "", couponToken: ""
}; };
}, },
computed: { computed: {
...@@ -229,8 +229,8 @@ export default { ...@@ -229,8 +229,8 @@ export default {
this.projectId = this.$route.query.projectId; this.projectId = this.$route.query.projectId;
this.goodsId = this.$route.query.goodsId; this.goodsId = this.$route.query.goodsId;
this.courseUrl = this.$route.query.courseUrl || ""; // this.courseUrl = this.$route.query.courseUrl || ""; //
this.couponToken = this.$route.query.couponToken || "" this.couponToken = this.$route.query.couponToken || "";
alert(this.couponToken); console.log('this.couponToken', this.couponToken);
this.shareUrl = getWebPageUrl( this.shareUrl = getWebPageUrl(
`profexam/#/goods-detail?goodsId=${this.goodsId}` `profexam/#/goods-detail?goodsId=${this.goodsId}`
); );
...@@ -280,7 +280,8 @@ export default { ...@@ -280,7 +280,8 @@ export default {
if (this.isWeb) { if (this.isWeb) {
let { token, info } = this.$store.state.user; let { token, info } = this.$store.state.user;
token = token =
token || this.couponToken || token ||
this.couponToken ||
localStorage.getItem("couponToken") || localStorage.getItem("couponToken") ||
getCookie("couponToken"); getCookie("couponToken");
this.token = token; this.token = token;
...@@ -293,8 +294,8 @@ export default { ...@@ -293,8 +294,8 @@ export default {
if (token && !info.id) { if (token && !info.id) {
// this.commonCheckToken(() => { // this.commonCheckToken(() => {
// this.$store.dispatch('setToken', this.token); // this.$store.dispatch('setToken', this.token);
this.$store.dispatch("getUserInfo"); this.$store.dispatch("getUserInfo");
// }); // });
// return; // return;
} }
...@@ -475,84 +476,83 @@ export default { ...@@ -475,84 +476,83 @@ export default {
return; return;
} }
// this.commonCheckToken(() => { // this.commonCheckToken(() => {
this.GET(`trade/goods/goodInfoV3/${this.goodsId}`, {}).then(res => { this.GET(`trade/goods/goodInfoV3/${this.goodsId}`, {}).then(res => {
if (res.code == "000000") { if (res.code == "000000") {
const goods = res.data; const goods = res.data;
const tabs = []; const tabs = [];
let priceNew = goods.preferentialPrice || goods.costPrice; let priceNew = goods.preferentialPrice || goods.costPrice;
let price = let price =
goods.couponPrice || goods.preferentialPrice || goods.costPrice; goods.couponPrice || goods.preferentialPrice || goods.costPrice;
this.goods = goods; this.goods = goods;
this.defaultCouponId = this.defaultCouponId =
(goods.couponDTO && goods.couponDTO.couponId) || ""; (goods.couponDTO && goods.couponDTO.couponId) || "";
// 获取到商品后,再获取优惠券 // 获取到商品后,再获取优惠券
this.getCanUseCoupons({ this.getCanUseCoupons({
goodsType: goods.goodsType, goodsType: goods.goodsType,
cardType: goods.cardType, cardType: goods.cardType,
price: priceNew, price: priceNew,
count: 0 count: 0
}); });
goods.salePriceNew = this.formatPrice(priceNew); goods.salePriceNew = this.formatPrice(priceNew);
goods.salePrice = this.formatPrice(price); goods.salePrice = this.formatPrice(price);
goods.costPriceText = (goods.costPrice / 100).toFixed(2); goods.costPriceText = (goods.costPrice / 100).toFixed(2);
goods.hasDiscount = !!goods.preferentialPrice; goods.hasDiscount = !!goods.preferentialPrice;
// goods.hasDiscount = !!(goods.couponPrice || goods.preferentialPrice); // goods.hasDiscount = !!(goods.couponPrice || goods.preferentialPrice);
let savePrice = 0; let savePrice = 0;
if (goods.couponPrice) { if (goods.couponPrice) {
if (goods.preferentialPrice) { if (goods.preferentialPrice) {
savePrice = ( savePrice = (
(goods.preferentialPrice - goods.couponPrice) / (goods.preferentialPrice - goods.couponPrice) /
100 100
).toFixed(2); ).toFixed(2);
} else { } else {
savePrice = ( savePrice = ((goods.costPrice - goods.couponPrice) / 100).toFixed(
(goods.costPrice - goods.couponPrice) / 2
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.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 { ...@@ -676,7 +676,7 @@ export default {
preCreateOrder() { preCreateOrder() {
this.commonCheckToken(() => { this.commonCheckToken(() => {
const { goodsType, cardType } = this.goods; const { goodsType, cardType } = this.goods;
console.log('goodsType, cardType', goodsType, cardType); console.log("goodsType, cardType", goodsType, cardType);
// 只有一类卡才做相应判断 // 只有一类卡才做相应判断
if (goodsType == 2 && cardType == 1) { if (goodsType == 2 && cardType == 1) {
this.GET( this.GET(
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册