Web code updated

This commit is contained in:
Vion
2022-01-28 18:19:40 +08:00
parent 61c365c3fc
commit 6725fb9961
11 changed files with 514 additions and 316 deletions

View File

@@ -264,7 +264,7 @@
</div>
</div>
</el-dialog>
<el-dialog :visible.sync="dialogInfo2" @close="userclose">
<el-dialog :visible.sync="dialogInfo2" @close="userclose" :close-on-click-modal="false">
<div class="rc-headera">
<div class="rc-title">
<img src="../../assets/error.png" alt="" />
@@ -326,25 +326,21 @@ export default {
if(!productCode || productCode.length<=0)
throw new Error('Empty product code');
productCode = productCode.split(",");
// console.log(this.productCode);
if(isRxGoods){
let data = await oncequery(mainProductCode);
let outputObj = {};
if (data) {
chufang=data;
chufang=data;
outputObj = data;
outputObj.productName = data.name;
outputObj.picture = 'https://royalcanincn.escase.cn/jc/royalcanin/'+outputObj.picture;
outputObj.showImgFile = 'https://royalcanincn.escase.cn/jc/royalcanin/'+outputObj.showImgFile;
outputObj.picture = outputObj.picture;
outputObj.showImgFile = outputObj.showImgFile;
newlist = [outputObj];
curItem = outputObj;
}
let insertTmpObj = {id:1, attachmentType:1, sort:1, attachmentPath:newlist[0].picture};
productAttachmentList = [insertTmpObj];
userbuy = false;
console.log('这是处方量数据')
} else {
let stopLeftAllotmentChecking = false;
let stopIndex = 0;
@@ -363,8 +359,7 @@ export default {
}
if(curItem.productAttachmentList != undefined)
productAttachmentList = curItem.productAttachmentList;
let list=[];
let list=[];
if(curItem.productName == undefined)
curItem = newlist[0];
userbuy = true;
@@ -379,14 +374,13 @@ export default {
title: curItem.productName,
}
];
console.log(curItem);
return {
crumbs,
activeIndexa,
curItem,
newlist,
chufang,
videolist,
chufang,
videolist,
productAttachmentList,
userbuy
}
@@ -405,8 +399,8 @@ export default {
drawlist: [], //用户可以领取的优惠券
alldraw: [],
userlistmenu: [],
msg: ["11111111"],
parent_msg: ["111"],
msg: [""],
parent_msg: [""],
usermessage: [],
dialogInfo2: false,
productCode: "", //商品code
@@ -471,20 +465,20 @@ export default {
this.checkIsLogin();
// console.log(this.curItem);
if (this.usermessage !== "" || this.usermessage.data !== undefined) {
this.usermessage = this.$store.state.userInfo;
this.productCode = this.$route.query.productCode;
//video显示
this.productAttachmentList.map(element=>{
if(element.attachmentPath.substring(element.attachmentPath.lastIndexOf(".")+1)=='mp4'){
this.videolist=element.attachmentPath;
}
})
this.videoimg=this.productAttachmentList[0].attachmentPath;
if(this.videolist.length>0){
this.videoshow=true
}else{
this.videoshow=false;
}
this.usermessage = this.$store.state.userInfo;
this.productCode = this.$route.query.productCode;
//video显示
this.productAttachmentList.map(element=>{
if(element.attachmentPath.substring(element.attachmentPath.lastIndexOf(".")+1)=='mp4'){
this.videolist=element.attachmentPath;
}
})
this.videoimg=this.productAttachmentList[0].attachmentPath;
if(this.videolist.length>0){
this.videoshow=true
}else{
this.videoshow=false;
}
/*
let stype = this.$route.query.stype;
@@ -498,6 +492,15 @@ export default {
this.userbuy = true;
}
*/
_hmt.push([
"_trackCustomEvent",
"product_visit",
{
"product_id_":this.curItem.productCode,
"product_category_":this.curItem.categoryName,
"product_name_": this.curItem.productName,
}
])
}
},
methods: {
@@ -507,21 +510,34 @@ export default {
},
//领取优惠券
usergetconf(item) {
console.log(item);
if (this.usermessage.data !== "" || this.usermessage.data !== undefined) {
this.getconf(this.usermessage.data.id, item.couponId);
}
_hmt.push([
"_trackCustomEvent",
"get_coupon",
{
"product_id_":this.curItem.productCode,
"product_category_":this.curItem.categoryName,
"product_name_": this.curItem.productName,
"product_quantity_" : this.sales_num,
"product_amount_" : this.sales_num*this.curItem.ecPrice,
}
])
if (this.usermessage.data !== "" || this.usermessage.data !== undefined) {
this.getconf(this.usermessage.data.id, item.couponId);
}
},
//获取用户领取的优惠券
async getconf(memberId, couponId) {
let data = await getConfig(memberId, couponId);
let msg = '领取成功';
let msgType = 'success';
if (data) {
if(data.code!='0')
if(data.code!='0') {
msgType = 'warning';
msg = data.msg;
}
this.$message({
type: "warning",
type: msgType,
message: msg,
});
}
@@ -684,6 +700,17 @@ export default {
type: "warning",
message: "加入购物车成功",
});
_hmt.push([
"_trackCustomEvent",
"add_to_cart",
{
"product_id_":this.curItem.productCode,
"product_category_":this.curItem.categoryName,
"product_name_": this.curItem.productName,
"product_quantity_" : this.sales_num,
"product_amount_" : this.sales_num*this.curItem.ecPrice,
}
])
}
if (orderm == 1) {
let list = [
@@ -702,6 +729,17 @@ export default {
checked: true,
},
];
_hmt.push([
"_trackCustomEvent",
"add_to_cart",
{
"product_id_":this.curItem.productCode,
"product_category_":this.curItem.categoryName,
"product_name_": this.curItem.productName,
"product_quantity_" : this.sales_num,
"product_amount_" : this.sales_num*this.curItem.ecPrice,
}
])
this.$router.push({
path: "/personal/settlement",