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

@ -35,20 +35,45 @@ let util = {
} }
}, },
checkPaytypeValidated($paytype) { checkPaytypeValidated($paytype) {
if(isWx && $paytype == 1) { let isMobile = this.isMobile();
//return 3; let isWx = this.isWX();
return true; //Dictionary : 1:WX native pay, 2:Alipay, 3:WX H5 pay
} else if(isWx && $paytype!=1) { if((isWx || !isMobile) && $paytype == 1) {
return false; return {'result':true};
} }
if(isMobile && $paytype == 3) {
if(!isMobile && $paytype == 1) { return {'result':true};
//Desktop, use native pay
return true;
} else if(isMobile && $paytype == 2) {
return true;
} }
return false; if($paytype == 2) {
return {'result':true};
}
let message='';
switch($paytype) {
case "1":
message = '请返回电脑端继续当前订单的支付';
break;
case "2":
message = '请返回支付宝继续当前订单的支付';
break;
case "3":
message = '请返回手机端继续当前订单的支付';
break;
default:
message = '订单已过期,请重新下单';
break;
}
return {'result':false,'message':message};
},
getTextByPaytype(paytype){
//Dictionary : 1:WX native pay, 2:Alipay, 3:WX H5 pay
let mapping = {
"1":"微信扫码支付",
"2":"支付宝支付",
"3":"手机网页支付",
};
if(mapping.hasOwnProperty(paytype))
return mapping[paytype];
return '';
} }
} }
export default util; export default util;

View File

@ -13,6 +13,23 @@
var s = document.getElementsByTagName("script")[0]; var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s); s.parentNode.insertBefore(hm, s);
})(); })();
function bindTracking(ele,timeout)
{
var eventName=ele.getAttribute('evt-name');
var eventCat=ele.getAttribute('evt-cat');
var eventVal=ele.getAttribute('evt-val');
var eventParams={};
eventParams[eventCat]=eventVal;
_hmt.push(['_trackEvent', eventName, eventCat, eventVal]); //Baidu Analytics Event Push
if(timeout)
{
setTimeout(function(){
window.location.href=ele.href;
},timeout);
return false;
}
return true;
}
</script> </script>
</body> </body>
</html> </html>

View File

@ -10,6 +10,20 @@ body {
border:unset; border:unset;
} }
.ts-warning-popup {
.title{
img {
width:5rem;
height:auto;
margin-left:auto;
margin-right:auto;
}
}
.content span {
line-height:2rem;
font-size:1.2
}
}
.rc-menu--xs .rc-screen-reader{ .rc-menu--xs .rc-screen-reader{
left:28%; left:28%;

View File

@ -1,4 +1,5 @@
<template> <template>
<div class="rc-fixright-container">
<div class="rc-fixright"> <div class="rc-fixright">
<ul> <ul>
<li v-for="(userfixed,index) in fixedlist" :key="index" @click="lianxi(userfixed,index)"> <li v-for="(userfixed,index) in fixedlist" :key="index" @click="lianxi(userfixed,index)">
@ -11,6 +12,18 @@
<span>回到顶部</span> <span>回到顶部</span>
</div> </div>
</div> </div>
<el-dialog :visible.sync="customerServerStop" :close-on-click-modal="false">
<div class="ts-warning-popup">
<div class="title rc-full-width">
<img src="../assets/error.png" alt="" />
</div>
<div class="content rc-full-width rc-text--center rc-margin-y--md">
<h3>温馨提示</h3>
<span class="">客服因法定春节假期暂停服务<br/>预计2月10日恢复正常服务</span>
</div>
</div>
</el-dialog>
</div>
</template> </template>
<script> <script>
@ -18,6 +31,7 @@ import { mapMutations } from "vuex";
export default { export default {
data(){ data(){
return{ return{
customerServerStop:false,
gotop: false, gotop: false,
loginornot:false, loginornot:false,
fixedlist: [ fixedlist: [
@ -43,10 +57,21 @@ export default {
...mapMutations(["checkIsLogin"]), ...mapMutations(["checkIsLogin"]),
lianxi(item,index){ lianxi(item,index){
if(item.title=='在线客服'){ if(item.title=='在线客服'){
this.customerServerStop = true;
/* Stop until 2022-2-10
var option = { var option = {
customer: {id: '', name: '', email: '', mobile: '', memberId: '999999'} customer: {id: '', name: '', email: '', mobile: '', memberId: '999999'}
} }
dis_livchat(option); dis_livchat(option);
_hmt.push([
"_trackCustomEvent",
"cs_consult",
{
"page_name_":this.$route.path,
"shop_right_btn": 1,
}
])
*/
} }
if(item.title=='购物车'){ if(item.title=='购物车'){
if(this.loginornot){ if(this.loginornot){
@ -60,10 +85,22 @@ export default {
} }
} }
if(item.title=='营养专家'){ if(item.title=='营养专家'){
this.customerServerStop = true;
/* Stop until 2022-2-10
var option = { var option = {
customer: {id: '', name: '', email: '', mobile: '', memberId: '999999'} customer: {id: '', name: '', email: '', mobile: '', memberId: '999999'}
} }
dis_livchat(option); dis_livchat(option);
console.log(this.$route.path);
_hmt.push([
"_trackCustomEvent",
"sol_consult",
{
"page_name_":this.$route.path,
"shop_right_btn": 1,
}
])
*/
} }
}, },
toTop() { toTop() {

View File

@ -9,7 +9,7 @@ let baseUrl = 'http://47.96.75.242:10086/royalcanin/royalcanin/'
if (process.env.NODE_ENV === 'development') { if (process.env.NODE_ENV === 'development') {
baseUrl = 'http://47.96.75.242:10086/royalcanin/royalcanin/'; baseUrl = 'http://47.96.75.242:10086/royalcanin/royalcanin/';
} else if (process.env.NODE_ENV === 'production') { } else if (process.env.NODE_ENV === 'production') {
baseUrl = 'http://47.96.75.242:10086/royalcanin/royalcanin/'; baseUrl = 'https://shop.royalcanin.com.cn/royalcanin/royalcanin/royalcanin/';
} }
export { export {
baseUrl, baseUrl,

View File

@ -1256,113 +1256,11 @@ export default {
}, },
], ],
catlistvideo: [ catlistvideo: [
{
title: "主食级猫湿粮",
video: "/images/cat/one.mp4",
catimage: "/images/cat/one.jpg",
productimage: "/images/cat/star-1.png",
detail: "为10柔软细腻慕斯 适合离乳期幼猫舔食",
price: "¥372",
productList: [
{
productCode: "80240008F24",
},
],
},
{
title: "幼猫成长专属",
video: "/images/cat/two.mp4",
catimage: "/images/cat/two.jpg",
productimage: "/images/cat/star-2.png",
detail: "支持幼猫自身保护力 为快速生长提供足够能量",
price: "¥33",
productList: [
{
productCode: "20030040",
},
],
},
{
title: "室内成猫专属",
video: "/images/cat/three.mp4",
catimage: "/images/cat/three.jpg",
productimage: "/images/cat/star-3.png",
detail: "高易消化蛋白 减少粪便量和异味",
price: "¥157",
productList: [
{
productCode: "21100200",
},
],
},
{
title: "英短成猫专属",
video: "/images/cat/four.mp4",
catimage: "/images/cat/four.jpg",
productimage: "/images/cat/star-4.png",
detail: "增强肌肉质量 支持骨骼与关节健康",
price: "¥402",
productList: [
{
productCode: "23040450",
},
],
},
], ],
doglistvideo: [ doglistvideo: [
{
title: "主食级狗湿粮",
video: "/images/dog/one.mp4",
catimage: "/images/dog/one.jpg",
productimage: "/images/dog/star-1.png",
detail: "柔软细腻慕斯 适合离乳期幼犬舔食",
price: "¥359",
productList: [
{
productCode: "81220020F12",
},
],
},
{
title: "贵宾成犬专属",
video: "/images/dog/two.mp4",
catimage: "/images/dog/two.jpg",
productimage: "/images/dog/star-2.png",
detail: "护肤靓毛 理想体态",
price: "¥562",
productList: [
{
productCode: "14200300",
},
],
},
{
title: "小型犬成犬专属",
video: "/images/dog/three.mp4",
catimage: "/images/dog/three.jpg",
productimage: "/images/dog/star-3.png",
detail: "亮泽被毛 呵护牙齿",
price: "¥57",
productList: [
{
productCode: "16020080",
},
],
},
{
title: "离乳期全价奶糕",
video: "/images/dog/four.mp4",
catimage: "/images/dog/four.jpg",
productimage: "/images/dog/star-4.png",
detail: "高易再水合颗粒 帮助增强保护健康成长",
price: "¥263",
productList: [
{
productCode: "17220400",
},
],
},
], ],
rccontair: [ rccontair: [
{ {
@ -1492,9 +1390,126 @@ export default {
}, },
created() { created() {
vm = this; vm = this;
let curEnv = process.env.NODE_ENV;
let envVariable = {
'development':{
catlistvideo:[
{
title: "主食级猫湿粮",
video: "/images/cat/one.mp4",
catimage: "/images/cat/one.jpg",
productimage: "/images/cat/star-1.png",
detail: "为10柔软细腻慕斯 适合离乳期幼猫舔食",
price: "¥372",
productList: [
{
productCode: "80240008F24",
},
],
},
{
title: "幼猫成长专属",
video: "/images/cat/two.mp4",
catimage: "/images/cat/two.jpg",
productimage: "/images/cat/star-2.png",
detail: "支持幼猫自身保护力 为快速生长提供足够能量",
price: "¥33",
productList: [
{
productCode: "20030040",
},
],
},
{
title: "室内成猫专属",
video: "/images/cat/three.mp4",
catimage: "/images/cat/three.jpg",
productimage: "/images/cat/star-3.png",
detail: "高易消化蛋白 减少粪便量和异味",
price: "¥157",
productList: [
{
productCode: "21100200",
},
],
},
{
title: "英短成猫专属",
video: "/images/cat/four.mp4",
catimage: "/images/cat/four.jpg",
productimage: "/images/cat/star-4.png",
detail: "增强肌肉质量 支持骨骼与关节健康",
price: "¥402",
productList: [
{
productCode: "23040450",
},
],
}
],
doglistvideo: [
{
title: "主食级狗湿粮",
video: "/images/dog/one.mp4",
catimage: "/images/dog/one.jpg",
productimage: "/images/dog/star-1.png",
detail: "柔软细腻慕斯 适合离乳期幼犬舔食",
price: "¥359",
productList: [
{
productCode: "81220020F12",
},
],
},
{
title: "贵宾成犬专属",
video: "/images/dog/two.mp4",
catimage: "/images/dog/two.jpg",
productimage: "/images/dog/star-2.png",
detail: "护肤靓毛 理想体态",
price: "¥562",
productList: [
{
productCode: "14200300",
},
],
},
{
title: "小型犬成犬专属",
video: "/images/dog/three.mp4",
catimage: "/images/dog/three.jpg",
productimage: "/images/dog/star-3.png",
detail: "亮泽被毛 呵护牙齿",
price: "¥57",
productList: [
{
productCode: "16020080",
},
],
},
{
title: "离乳期全价奶糕",
video: "/images/dog/four.mp4",
catimage: "/images/dog/four.jpg",
productimage: "/images/dog/star-4.png",
detail: "高易再水合颗粒 帮助增强保护健康成长",
price: "¥263",
productList: [
{
productCode: "17220400",
},
],
},
]
},
'production':{}
}
this.catlistvideo = envVariable[curEnv].catlistvideo;
this.doglistvideo = envVariable[curEnv].doglistvideo;
}, },
watch: {}, watch: {},
mounted() { mounted() {
console.log(process.env.NODE_ENV,' mounted');
this.checkIsLogin(); this.checkIsLogin();
this.userdata = this.$store.state.userInfo; this.userdata = this.$store.state.userInfo;
console.log(this.userdata); console.log(this.userdata);
@ -1521,7 +1536,6 @@ export default {
}, },
methods: { methods: {
diaoqi(){ diaoqi(){
console.log('----');
setTimeout(() => { setTimeout(() => {
var option = { var option = {
customer: { customer: {
@ -1533,6 +1547,14 @@ export default {
}, },
}; };
dis_livchat(option); dis_livchat(option);
_hmt.push([
"_trackCustomEvent",
"sol_consult",
{
"page":this.$route.path,
"shop_head_banner": 1,
}
])
}, 500); }, 500);
}, },
...mapMutations(["checkIsLogin"]), ...mapMutations(["checkIsLogin"]),

View File

@ -118,7 +118,7 @@
</li> </li>
<li> <li>
<span>付款方式:</span> <span>付款方式:</span>
<i>{{ information.paytype }}</i> <i>{{ information.paytypeText }}</i>
</li> </li>
<li> <li>
<span>配送方式:</span> <span>配送方式:</span>
@ -159,6 +159,17 @@
</i> </i>
</div> </div>
<el-dialog :visible.sync="showPaytypeWarning" :close-on-click-modal="false">
<div class="ts-warning-popup">
<div class="title rc-full-width">
<img src="../../assets/error.png" alt="" />
</div>
<div class="content rc-full-width rc-text--center rc-margin-y--md">
<h3>温馨提示</h3>
<span class="">{{ paytypeWarning.message}}</span>
</div>
</div>
</el-dialog>
<MyFooter></MyFooter> <MyFooter></MyFooter>
</div> </div>
</template> </template>
@ -184,6 +195,8 @@ export default {
data() { data() {
return { return {
util, util,
paytypeWarning:{result:true,message:''},
showPaytypeWarning:false,
goldmedal: [], goldmedal: [],
userproductId: "", userproductId: "",
logisticsDate: "", logisticsDate: "",
@ -214,11 +227,8 @@ export default {
useraddress: [], useraddress: [],
shopprice: {}, shopprice: {},
information: { information: {
reference: "1111111111111111", paytypeText: "",
ordertime: "2012-12-01 11:20:00",
paytype: "微信支付",
distribution: "快递", distribution: "快递",
trackingnumber: "11111111111111",
catimage: require("../../assets/image/rc-left.png"), catimage: require("../../assets/image/rc-left.png"),
}, },
}; };
@ -267,6 +277,9 @@ export default {
}, },
// //
onceagain(item) { onceagain(item) {
this.paytypeWarning = this.util.checkPaytypeValidated(this.paytype);
this.showPaytypeWarning = !this.paytypeWarning.result;
if(this.paytypeWarning.result) {
if (this.payorsucess == "立即支付") { if (this.payorsucess == "立即支付") {
this.getwei(item); this.getwei(item);
} else { } else {
@ -278,6 +291,7 @@ export default {
}, },
}); });
} }
}
}, },
async orderquantity(orderNumber) { async orderquantity(orderNumber) {
let data = await userin(orderNumber); let data = await userin(orderNumber);
@ -304,7 +318,8 @@ export default {
this.usersalesAmount = this.goldmedal[i].salesAmount; this.usersalesAmount = this.goldmedal[i].salesAmount;
this.addressUserName = this.goldmedal[i].addressUserName; this.addressUserName = this.goldmedal[i].addressUserName;
this.addressPhoneNumber = this.goldmedal[i].addressPhoneNumber; this.addressPhoneNumber = this.goldmedal[i].addressPhoneNumber;
this.paytype = (this.goldmedal[i].paytype=="1"?'微信支付':'支付宝'); this.paytype = this.goldmedal[i].paytype;
this.information.paytypeText = this.util.getTextByPaytype(this.paytype);
} }
} }
}, },

View File

@ -626,6 +626,18 @@ export default {
this.getAddressList(); this.getAddressList();
this.checkIsLogin(); this.checkIsLogin();
this.finalAmount = this.sumPrice; this.finalAmount = this.sumPrice;
this.goldmedal.forEach((item) => {
_hmt.push([
"_trackCustomEvent",
"placing_order",
{
"product_id_":item.productCode,
"product_name_": item.productName,
"product_quantity_" : item.buyCount,
"product_amount_" : item.buyCount*item.productPrice,
}
])
});
// this.addressstype = this.$route.query.stype; // this.addressstype = this.$route.query.stype;
// this.orderNumber = this.$route.query.orderNumber; // this.orderNumber = this.$route.query.orderNumber;
// this.canceldanhao(this.orderNumber); // this.canceldanhao(this.orderNumber);

View File

@ -132,6 +132,17 @@
</div> </div>
</div> </div>
<el-dialog :visible.sync="showPaytypeWarning" :close-on-click-modal="false">
<div class="ts-warning-popup">
<div class="title rc-full-width">
<img src="../../assets/error.png" alt="" />
</div>
<div class="content rc-full-width rc-text--center rc-margin-y--md">
<h3>温馨提示</h3>
<span class="">{{ paytypeWarning.message}}</span>
</div>
</div>
</el-dialog>
<MyFooter></MyFooter> <MyFooter></MyFooter>
</div> </div>
</template> </template>
@ -146,6 +157,8 @@ export default {
data() { data() {
return { return {
util, util,
paytypeWarning:{result:true,message:''},
showPaytypeWarning:false,
crumbs:[ crumbs:[
{ {
path:'/personal/mypersonal/', path:'/personal/mypersonal/',
@ -279,7 +292,6 @@ export default {
this.userdata = user.data.mobile; this.userdata = user.data.mobile;
let stype = this.$route.query.stype; let stype = this.$route.query.stype;
this.userstype=this.$route.query.stype; this.userstype=this.$route.query.stype;
console.log(stype);
if (user == "" || user == null) { if (user == "" || user == null) {
this.$message({ this.$message({
type: "warning", type: "warning",
@ -305,8 +317,8 @@ export default {
this.obligation=[]; this.obligation=[];
this.receiving=[]; this.receiving=[];
this.pending=[]; this.pending=[];
for (let i = 0; i < this.goldmedal.length; i++) { for (let i = (this.goldmedal.length-1); i >= 0; i--) {
this.useralllist.push(this.goldmedal[i].orderDetailList[0]); this.useralllist.unshift(this.goldmedal[i].orderDetailList[0]);
this.alllist.push(this.goldmedal[i].orderDetailList[0]) this.alllist.push(this.goldmedal[i].orderDetailList[0])
this.allmessage.push(this.goldmedal[i].orderDetailList[0]) this.allmessage.push(this.goldmedal[i].orderDetailList[0])
if(this.goldmedal[i].status==0){ if(this.goldmedal[i].status==0){
@ -314,25 +326,19 @@ export default {
}else if(this.goldmedal[i].status==1){ }else if(this.goldmedal[i].status==1){
this.receiving.push(this.goldmedal[i].orderDetailList[0]); this.receiving.push(this.goldmedal[i].orderDetailList[0]);
} }
else if(this.useralllist[i].status==2){ else if(this.goldmedal[i].status==2){
this.pending.push(this.goldmedal[i].orderDetailList[0]); this.pending.push(this.goldmedal[i].orderDetailList[0]);
} }
} }
for (var i = 0; i < this.useralllist.length; i++) { for (let i = (this.goldmedal.length-1); i >0; i--) {
this.useralllist[i].orderNumber = this.goldmedal[i].orderNumber; this.useralllist[i].orderNumber = this.goldmedal[i].orderNumber;
this.useralllist[i].status = this.goldmedal[i].status; this.useralllist[i].status = this.goldmedal[i].status;
this.useralllist[i].addressUserName = this.goldmedal[i].addressUserName; this.useralllist[i].addressUserName = this.goldmedal[i].addressUserName;
this.useralllist[i].phoneNumber = this.goldmedal[i].addressPhoneNumber; this.useralllist[i].phoneNumber = this.goldmedal[i].addressPhoneNumber;
this.useralllist[i].salesAmount = this.goldmedal[i].salesAmount; this.useralllist[i].salesAmount = this.goldmedal[i].salesAmount;
// this.useralllist[i].picFile = this.goldmedal[i].picFile; // this.useralllist[i].lengthnum=this.goldmedal[i].orderDetailList.length;
// this.useralllist[i].productName=this.goldmedal[i].productName;// this.useralllist[i].paytype=this.goldmedal[i].paytype;
// this.useralllist[i].ecPrice=this.goldmedal[i].ecPrice//
// this.useralllist[i].pcs=this.goldmedal[i].pcs//
this.useralllist[i].lengthnum=this.goldmedal[i].orderDetailList.length
} }
console.log(this.obligation)
if(this.userstype==1){ if(this.userstype==1){
this.useralllist=this.obligation this.useralllist=this.obligation
}else if(this.userstype==2){ }else if(this.userstype==2){
@ -347,18 +353,17 @@ export default {
}, },
// //
async getwei(item) { async getwei(item) {
let data = await this.repayOrde(item.orderNumber); let payType = this.util.pickPaytype();
let data = await this.repayOrde(item.orderNumber, payType);
if(data.code==1) { if(data.code==1) {
let userPayData = { let userPayData = {
userprice: item.usersalesAmount, userprice: item.salesAmount,
orderId: item.orderNumber, orderId: item.orderNumber,
userinformation: item.addressUserName + " " + item.addressPhoneNumber, userinformation: item.addressUserName + " " + item.phoneNumber,
wxPay:data.msg wxPay:data.msg
}; };
this.$router.push({ this.$router.push({
path: "/personal/userpay", path: "/personal/userpay",
query: { query: {
@ -445,14 +450,11 @@ export default {
selectGoods(item, index) { selectGoods(item, index) {
let list=[] let list=[]
this.activeIndex = index; this.activeIndex = index;
console.log(this.obligation)
if(item.title=='待付款'){ if(item.title=='待付款'){
list=this.obligation list=this.obligation
} }
else if(item.title=='待收货'){ else if(item.title=='待收货'){
list=this.receiving list=this.receiving
console.log(this.receiving);
}else if(item.title=='待发货'){ }else if(item.title=='待发货'){
this.useralllist=this.pending this.useralllist=this.pending
list=this.pending list=this.pending
@ -462,7 +464,6 @@ export default {
list=this.alllist list=this.alllist
} }
this.useralllist=[]; this.useralllist=[];
console.log(this.useralllist,list);
for (var i = 0; i < this.useralllist.length; i++) { for (var i = 0; i < this.useralllist.length; i++) {
this.useralllist[i].orderNumber =this.goldmedal[i].orderNumber; this.useralllist[i].orderNumber =this.goldmedal[i].orderNumber;
this.useralllist[i].status = this.goldmedal[i].status this.useralllist[i].status = this.goldmedal[i].status
@ -472,9 +473,11 @@ export default {
this.useralllist[i].lengthnum=this.goldmedal[i].orderDetailList.length this.useralllist[i].lengthnum=this.goldmedal[i].orderDetailList.length
} }
this.useralllist=list this.useralllist=list
}, },
userfind(item) { userfind(item) {
this.paytypeWarning = this.util.checkPaytypeValidated(item.paytype);
this.showPaytypeWarning = !this.paytypeWarning.result;
if(this.paytypeWarning.result) {
if(item.status==0){ if(item.status==0){
this.getwei(item); this.getwei(item);
}else{ }else{
@ -486,7 +489,7 @@ export default {
}, },
}); });
} }
}
}, },
usertwo() { usertwo() {
this.$router.push({ this.$router.push({

View File

@ -175,6 +175,14 @@ export default {
//TODO raise WX jsapi pay //TODO raise WX jsapi pay
break; break;
} }
_hmt.push([
"_trackCustomEvent",
"payment",
{
"payType" : payType,
"product_amount_" : this.userPayData.userprice,
}
])
}, },
goPayH5() { goPayH5() {
let isMobile = this.util.isMobile(); let isMobile = this.util.isMobile();
@ -228,7 +236,14 @@ export default {
if (res.success) { if (res.success) {
this.qrtext = '成功加入群的二维码'; this.qrtext = '成功加入群的二维码';
this.dialogSuccess = true; this.dialogSuccess = true;
_hmt.push([
"_trackCustomEvent",
"payment_finished",
{
"payType" : 'native',
"product_amount_" : this.userPayData.userprice,
}
])
} else if (res.fail) { } else if (res.fail) {
this.dialogFail = true; this.dialogFail = true;

View File

@ -264,7 +264,7 @@
</div> </div>
</div> </div>
</el-dialog> </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-headera">
<div class="rc-title"> <div class="rc-title">
<img src="../../assets/error.png" alt="" /> <img src="../../assets/error.png" alt="" />
@ -326,7 +326,6 @@ export default {
if(!productCode || productCode.length<=0) if(!productCode || productCode.length<=0)
throw new Error('Empty product code'); throw new Error('Empty product code');
productCode = productCode.split(","); productCode = productCode.split(",");
// console.log(this.productCode);
if(isRxGoods){ if(isRxGoods){
let data = await oncequery(mainProductCode); let data = await oncequery(mainProductCode);
let outputObj = {}; let outputObj = {};
@ -334,17 +333,14 @@ export default {
chufang=data; chufang=data;
outputObj = data; outputObj = data;
outputObj.productName = data.name; outputObj.productName = data.name;
outputObj.picture = 'https://royalcanincn.escase.cn/jc/royalcanin/'+outputObj.picture; outputObj.picture = outputObj.picture;
outputObj.showImgFile = 'https://royalcanincn.escase.cn/jc/royalcanin/'+outputObj.showImgFile; outputObj.showImgFile = outputObj.showImgFile;
newlist = [outputObj]; newlist = [outputObj];
curItem = outputObj; curItem = outputObj;
} }
let insertTmpObj = {id:1, attachmentType:1, sort:1, attachmentPath:newlist[0].picture}; let insertTmpObj = {id:1, attachmentType:1, sort:1, attachmentPath:newlist[0].picture};
productAttachmentList = [insertTmpObj]; productAttachmentList = [insertTmpObj];
userbuy = false; userbuy = false;
console.log('这是处方量数据')
} else { } else {
let stopLeftAllotmentChecking = false; let stopLeftAllotmentChecking = false;
let stopIndex = 0; let stopIndex = 0;
@ -364,7 +360,6 @@ export default {
if(curItem.productAttachmentList != undefined) if(curItem.productAttachmentList != undefined)
productAttachmentList = curItem.productAttachmentList; productAttachmentList = curItem.productAttachmentList;
let list=[]; let list=[];
if(curItem.productName == undefined) if(curItem.productName == undefined)
curItem = newlist[0]; curItem = newlist[0];
userbuy = true; userbuy = true;
@ -379,7 +374,6 @@ export default {
title: curItem.productName, title: curItem.productName,
} }
]; ];
console.log(curItem);
return { return {
crumbs, crumbs,
activeIndexa, activeIndexa,
@ -405,8 +399,8 @@ export default {
drawlist: [], // drawlist: [], //
alldraw: [], alldraw: [],
userlistmenu: [], userlistmenu: [],
msg: ["11111111"], msg: [""],
parent_msg: ["111"], parent_msg: [""],
usermessage: [], usermessage: [],
dialogInfo2: false, dialogInfo2: false,
productCode: "", //code productCode: "", //code
@ -498,6 +492,15 @@ export default {
this.userbuy = true; this.userbuy = true;
} }
*/ */
_hmt.push([
"_trackCustomEvent",
"product_visit",
{
"product_id_":this.curItem.productCode,
"product_category_":this.curItem.categoryName,
"product_name_": this.curItem.productName,
}
])
} }
}, },
methods: { methods: {
@ -507,7 +510,17 @@ export default {
}, },
// //
usergetconf(item) { usergetconf(item) {
console.log(item); _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) { if (this.usermessage.data !== "" || this.usermessage.data !== undefined) {
this.getconf(this.usermessage.data.id, item.couponId); this.getconf(this.usermessage.data.id, item.couponId);
} }
@ -517,11 +530,14 @@ export default {
async getconf(memberId, couponId) { async getconf(memberId, couponId) {
let data = await getConfig(memberId, couponId); let data = await getConfig(memberId, couponId);
let msg = '领取成功'; let msg = '领取成功';
let msgType = 'success';
if (data) { if (data) {
if(data.code!='0') if(data.code!='0') {
msgType = 'warning';
msg = data.msg; msg = data.msg;
}
this.$message({ this.$message({
type: "warning", type: msgType,
message: msg, message: msg,
}); });
} }
@ -684,6 +700,17 @@ export default {
type: "warning", type: "warning",
message: "加入购物车成功", 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) { if (orderm == 1) {
let list = [ let list = [
@ -702,6 +729,17 @@ export default {
checked: true, 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({ this.$router.push({
path: "/personal/settlement", path: "/personal/settlement",