From 6725fb9961cdc1b0051ceb9ff4f7bf91454b1e01 Mon Sep 17 00:00:00 2001 From: Vion Date: Fri, 28 Jan 2022 18:19:40 +0800 Subject: [PATCH] Web code updated --- rc-busness/ajax/util.js | 49 +++- rc-busness/app.html | 17 ++ rc-busness/assets/css/global.less | 14 + rc-busness/components/fixed-right.vue | 59 +++- rc-busness/config/async/env.js | 2 +- rc-busness/pages/index.vue | 260 ++++++++++-------- rc-busness/pages/myorder/usertion.vue | 53 ++-- rc-busness/pages/personal/settlement.vue | 54 ++-- rc-busness/pages/personal/useraddress.vue | 197 ++++++------- rc-busness/pages/personal/userpay.vue | 17 +- rc-busness/pages/productdetails/producted.vue | 108 +++++--- 11 files changed, 514 insertions(+), 316 deletions(-) diff --git a/rc-busness/ajax/util.js b/rc-busness/ajax/util.js index 9be51c9c..1d383876 100644 --- a/rc-busness/ajax/util.js +++ b/rc-busness/ajax/util.js @@ -35,20 +35,45 @@ let util = { } }, checkPaytypeValidated($paytype) { - if(isWx && $paytype == 1) { - //return 3; - return true; - } else if(isWx && $paytype!=1) { - return false; + let isMobile = this.isMobile(); + let isWx = this.isWX(); + //Dictionary : 1:WX native pay, 2:Alipay, 3:WX H5 pay + if((isWx || !isMobile) && $paytype == 1) { + return {'result':true}; } - - if(!isMobile && $paytype == 1) { - //Desktop, use native pay - return true; - } else if(isMobile && $paytype == 2) { - return true; + if(isMobile && $paytype == 3) { + return {'result':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; \ No newline at end of file diff --git a/rc-busness/app.html b/rc-busness/app.html index afb50e74..9d062a45 100644 --- a/rc-busness/app.html +++ b/rc-busness/app.html @@ -13,6 +13,23 @@ var s = document.getElementsByTagName("script")[0]; 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; + } \ No newline at end of file diff --git a/rc-busness/assets/css/global.less b/rc-busness/assets/css/global.less index 4c11f919..731e59d4 100644 --- a/rc-busness/assets/css/global.less +++ b/rc-busness/assets/css/global.less @@ -10,6 +10,20 @@ body { 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{ left:28%; diff --git a/rc-busness/components/fixed-right.vue b/rc-busness/components/fixed-right.vue index 6fbcad19..b10e7bc1 100644 --- a/rc-busness/components/fixed-right.vue +++ b/rc-busness/components/fixed-right.vue @@ -1,15 +1,28 @@ @@ -18,6 +31,7 @@ import { mapMutations } from "vuex"; export default { data(){ return{ + customerServerStop:false, gotop: false, loginornot:false, fixedlist: [ @@ -43,10 +57,21 @@ export default { ...mapMutations(["checkIsLogin"]), lianxi(item,index){ if(item.title=='在线客服'){ + this.customerServerStop = true; + /* Stop until 2022-2-10 var option = { customer: {id: '', name: '', email: '', mobile: '', memberId: '999999'} } dis_livchat(option); + _hmt.push([ + "_trackCustomEvent", + "cs_consult", + { + "page_name_":this.$route.path, + "shop_right_btn": 1, + } + ]) + */ } if(item.title=='购物车'){ if(this.loginornot){ @@ -60,10 +85,22 @@ export default { } } if(item.title=='营养专家'){ + this.customerServerStop = true; + /* Stop until 2022-2-10 var option = { customer: {id: '', name: '', email: '', mobile: '', memberId: '999999'} } dis_livchat(option); + console.log(this.$route.path); + _hmt.push([ + "_trackCustomEvent", + "sol_consult", + { + "page_name_":this.$route.path, + "shop_right_btn": 1, + } + ]) + */ } }, toTop() { diff --git a/rc-busness/config/async/env.js b/rc-busness/config/async/env.js index 9242ccff..8ff9739b 100644 --- a/rc-busness/config/async/env.js +++ b/rc-busness/config/async/env.js @@ -9,7 +9,7 @@ let baseUrl = 'http://47.96.75.242:10086/royalcanin/royalcanin/' if (process.env.NODE_ENV === 'development') { baseUrl = 'http://47.96.75.242:10086/royalcanin/royalcanin/'; } 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 { baseUrl, diff --git a/rc-busness/pages/index.vue b/rc-busness/pages/index.vue index 264b56d6..fb27a3b2 100644 --- a/rc-busness/pages/index.vue +++ b/rc-busness/pages/index.vue @@ -1256,113 +1256,11 @@ export default { }, ], 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", - }, - ], - }, + ], rccontair: [ { @@ -1492,9 +1390,126 @@ export default { }, created() { 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: {}, mounted() { + console.log(process.env.NODE_ENV,' mounted'); this.checkIsLogin(); this.userdata = this.$store.state.userInfo; console.log(this.userdata); @@ -1520,21 +1535,28 @@ export default { window.removeEventListener("scroll", this.scrollToTop); }, methods: { - diaoqi(){ - console.log('----'); - setTimeout(() => { - var option = { - customer: { - id: "", - name: "", - email: "", - mobile: "", - memberId: vm.userdata.data.id, - }, - }; - dis_livchat(option); - }, 500); - }, + diaoqi(){ + setTimeout(() => { + var option = { + customer: { + id: "", + name: "", + email: "", + mobile: "", + memberId: vm.userdata.data.id, + }, + }; + dis_livchat(option); + _hmt.push([ + "_trackCustomEvent", + "sol_consult", + { + "page":this.$route.path, + "shop_head_banner": 1, + } + ]) + }, 500); + }, ...mapMutations(["checkIsLogin"]), playMobileVideo(item) { let videoPath = item.video; diff --git a/rc-busness/pages/myorder/usertion.vue b/rc-busness/pages/myorder/usertion.vue index 0e5a1ae2..2df60d1e 100644 --- a/rc-busness/pages/myorder/usertion.vue +++ b/rc-busness/pages/myorder/usertion.vue @@ -118,7 +118,7 @@
  • 付款方式: - {{ information.paytype }} + {{ information.paytypeText }}
  • 配送方式: @@ -158,7 +158,18 @@ {{ payorsucess }} - + + +
    +
    + +
    +
    +

    温馨提示

    + {{ paytypeWarning.message}} +
    +
    +
    @@ -184,6 +195,8 @@ export default { data() { return { util, + paytypeWarning:{result:true,message:''}, + showPaytypeWarning:false, goldmedal: [], userproductId: "", logisticsDate: "", @@ -214,12 +227,9 @@ export default { useraddress: [], shopprice: {}, information: { - reference: "1111111111111111", - ordertime: "2012-12-01 11:20:00", - paytype: "微信支付", - distribution: "快递", - trackingnumber: "11111111111111", - catimage: require("../../assets/image/rc-left.png"), + paytypeText: "", + distribution: "快递", + catimage: require("../../assets/image/rc-left.png"), }, }; }, @@ -267,16 +277,20 @@ export default { }, //订单支付和再次购买 onceagain(item) { - if (this.payorsucess == "立即支付") { - this.getwei(item); - } else { - this.$router.push({ - path: "/productdetails/producted", - query: { - stype: 1, - productCode: this.userproductId, - }, - }); + this.paytypeWarning = this.util.checkPaytypeValidated(this.paytype); + this.showPaytypeWarning = !this.paytypeWarning.result; + if(this.paytypeWarning.result) { + if (this.payorsucess == "立即支付") { + this.getwei(item); + } else { + this.$router.push({ + path: "/productdetails/producted", + query: { + stype: 1, + productCode: this.userproductId, + }, + }); + } } }, async orderquantity(orderNumber) { @@ -304,7 +318,8 @@ export default { this.usersalesAmount = this.goldmedal[i].salesAmount; this.addressUserName = this.goldmedal[i].addressUserName; 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); } } }, diff --git a/rc-busness/pages/personal/settlement.vue b/rc-busness/pages/personal/settlement.vue index 52022db4..88da1551 100644 --- a/rc-busness/pages/personal/settlement.vue +++ b/rc-busness/pages/personal/settlement.vue @@ -513,28 +513,28 @@ export default { let postData = []; let tmpCounter=0; this.goldmedal.forEach((item) => { - let basePoint = (item.basePoint?item.basePoint:0); + let basePoint = (item.basePoint?item.basePoint:0); let oneProduct = { - basePoint:basePoint, - productName: item.productName, - buyCount: item.buyCount, - productCode: item.productCode, - payAmount: item.productPrice, - memberId: userInfo.data.id, - phoneNumber: userInfo.data.mobile, - // couponId: "NGQ2022P12", - // couponTypeId: "4", - // couponName: "内购券", - // couponAmount: "0.3175", - // couponCode: "0007792402", - orderAddress: { - addressPhoneNumber: orderAddress[0].recipientPhone, - addressUserName: orderAddress[0].recipient, - addressProvinceName: orderAddress[0].provinceName, - addressCityName: orderAddress[0].cityName, - addressCountyName: orderAddress[0].districtName, - addressDetailInfo: orderAddress[0].detailAddress, - }, + basePoint:basePoint, + productName: item.productName, + buyCount: item.buyCount, + productCode: item.productCode, + payAmount: item.productPrice, + memberId: userInfo.data.id, + phoneNumber: userInfo.data.mobile, + // couponId: "NGQ2022P12", + // couponTypeId: "4", + // couponName: "内购券", + // couponAmount: "0.3175", + // couponCode: "0007792402", + orderAddress: { + addressPhoneNumber: orderAddress[0].recipientPhone, + addressUserName: orderAddress[0].recipient, + addressProvinceName: orderAddress[0].provinceName, + addressCityName: orderAddress[0].cityName, + addressCountyName: orderAddress[0].districtName, + addressDetailInfo: orderAddress[0].detailAddress, + }, }; if(this.curCoupon.couponId && item.productCode == this.discountedProductCode) { oneProduct.couponId = this.curCoupon.couponId; @@ -626,6 +626,18 @@ export default { this.getAddressList(); this.checkIsLogin(); 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.orderNumber = this.$route.query.orderNumber; // this.canceldanhao(this.orderNumber); diff --git a/rc-busness/pages/personal/useraddress.vue b/rc-busness/pages/personal/useraddress.vue index 956a4e5a..d5aeac27 100644 --- a/rc-busness/pages/personal/useraddress.vue +++ b/rc-busness/pages/personal/useraddress.vue @@ -132,7 +132,18 @@ - + +
    +
    + +
    +
    +

    温馨提示

    + {{ paytypeWarning.message}} +
    +
    +
    + @@ -146,6 +157,8 @@ export default { data() { return { util, + paytypeWarning:{result:true,message:''}, + showPaytypeWarning:false, crumbs:[ { path:'/personal/mypersonal/', @@ -279,7 +292,6 @@ export default { this.userdata = user.data.mobile; let stype = this.$route.query.stype; this.userstype=this.$route.query.stype; - console.log(stype); if (user == "" || user == null) { this.$message({ type: "warning", @@ -297,68 +309,61 @@ export default { }, methods: { async indet(mobile, stype) { - let data = await userindent(mobile,undefined,1,100); - this.activeIndex = stype; - this.goldmedal = data; - this.alllist=[]; - this.useralllist=[]; - this.obligation=[]; - this.receiving=[]; - this.pending=[]; - for (let i = 0; i < this.goldmedal.length; i++) { - this.useralllist.push(this.goldmedal[i].orderDetailList[0]); - this.alllist.push(this.goldmedal[i].orderDetailList[0]) - this.allmessage.push(this.goldmedal[i].orderDetailList[0]) - if(this.goldmedal[i].status==0){ - this.obligation.push(this.goldmedal[i].orderDetailList[0]); - }else if(this.goldmedal[i].status==1){ - this.receiving.push(this.goldmedal[i].orderDetailList[0]); - } - else if(this.useralllist[i].status==2){ - this.pending.push(this.goldmedal[i].orderDetailList[0]); - } - } - for (var i = 0; i < this.useralllist.length; i++) { - this.useralllist[i].orderNumber = this.goldmedal[i].orderNumber; - this.useralllist[i].status = this.goldmedal[i].status; - this.useralllist[i].addressUserName = this.goldmedal[i].addressUserName; - this.useralllist[i].phoneNumber = this.goldmedal[i].addressPhoneNumber; - this.useralllist[i].salesAmount = this.goldmedal[i].salesAmount; - // this.useralllist[i].picFile = this.goldmedal[i].picFile; //图片路径 - // this.useralllist[i].productName=this.goldmedal[i].productName;//商品名称 - // this.useralllist[i].ecPrice=this.goldmedal[i].ecPrice//第一个的单价 - // this.useralllist[i].pcs=this.goldmedal[i].pcs//数量 + let data = await userindent(mobile,undefined,1,100); + this.activeIndex = stype; + this.goldmedal = data; + this.alllist=[]; + this.useralllist=[]; + this.obligation=[]; + this.receiving=[]; + this.pending=[]; + for (let i = (this.goldmedal.length-1); i >= 0; i--) { + this.useralllist.unshift(this.goldmedal[i].orderDetailList[0]); + this.alllist.push(this.goldmedal[i].orderDetailList[0]) + this.allmessage.push(this.goldmedal[i].orderDetailList[0]) + if(this.goldmedal[i].status==0){ + this.obligation.push(this.goldmedal[i].orderDetailList[0]); + }else if(this.goldmedal[i].status==1){ + this.receiving.push(this.goldmedal[i].orderDetailList[0]); + } + else if(this.goldmedal[i].status==2){ + this.pending.push(this.goldmedal[i].orderDetailList[0]); + } + } + for (let i = (this.goldmedal.length-1); i >0; i--) { + this.useralllist[i].orderNumber = this.goldmedal[i].orderNumber; + this.useralllist[i].status = this.goldmedal[i].status; + this.useralllist[i].addressUserName = this.goldmedal[i].addressUserName; + this.useralllist[i].phoneNumber = this.goldmedal[i].addressPhoneNumber; + this.useralllist[i].salesAmount = this.goldmedal[i].salesAmount; + this.useralllist[i].lengthnum=this.goldmedal[i].orderDetailList.length; + this.useralllist[i].paytype=this.goldmedal[i].paytype; + } + if(this.userstype==1){ + this.useralllist=this.obligation + }else if(this.userstype==2){ + this.useralllist=this.pending + } + else if(this.userstype==0){ + this.useralllist=this.allmessage + } + else if(this.userstype==3){ + this.useralllist=this.receiving + } - - this.useralllist[i].lengthnum=this.goldmedal[i].orderDetailList.length - } - console.log(this.obligation) - if(this.userstype==1){ - this.useralllist=this.obligation - }else if(this.userstype==2){ - this.useralllist=this.pending - } - else if(this.userstype==0){ - this.useralllist=this.allmessage - } - else if(this.userstype==3){ - this.useralllist=this.receiving - } - }, - //订单立即支付 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) { let userPayData = { - userprice: item.usersalesAmount, + userprice: item.salesAmount, orderId: item.orderNumber, - userinformation: item.addressUserName + " " + item.addressPhoneNumber, + userinformation: item.addressUserName + " " + item.phoneNumber, wxPay:data.msg }; - this.$router.push({ path: "/personal/userpay", query: { @@ -443,51 +448,49 @@ export default { } }, selectGoods(item, index) { - let list=[] - this.activeIndex = index; - console.log(this.obligation) - if(item.title=='待付款'){ - list=this.obligation - } - else if(item.title=='待收货'){ - list=this.receiving - console.log(this.receiving); + let list=[] + this.activeIndex = index; + if(item.title=='待付款'){ + list=this.obligation + } + else if(item.title=='待收货'){ + list=this.receiving + }else if(item.title=='待发货'){ + this.useralllist=this.pending + list=this.pending + } - }else if(item.title=='待发货'){ - this.useralllist=this.pending - list=this.pending - } - - else if(item.title=='全部'){ - list=this.alllist - } - this.useralllist=[]; - console.log(this.useralllist,list); - for (var i = 0; i < this.useralllist.length; i++) { - this.useralllist[i].orderNumber =this.goldmedal[i].orderNumber; - this.useralllist[i].status = this.goldmedal[i].status - this.useralllist[i].addressUserName =this.goldmedal[i].addressUserName; - this.useralllist[i].phoneNumber = this.goldmedal[i].phoneNumber; - this.useralllist[i].salesAmount = this.goldmedal[i].salesAmount; - this.useralllist[i].lengthnum=this.goldmedal[i].orderDetailList.length - } - this.useralllist=list - - }, - userfind(item) { - if(item.status==0){ - this.getwei(item); - }else{ - this.$router.push({ - path: "/myorder/usertion", - query: { - stype: item.status, - orderNumber: item.orderNumber, - }, - }); - } - + else if(item.title=='全部'){ + list=this.alllist + } + this.useralllist=[]; + for (var i = 0; i < this.useralllist.length; i++) { + this.useralllist[i].orderNumber =this.goldmedal[i].orderNumber; + this.useralllist[i].status = this.goldmedal[i].status + this.useralllist[i].addressUserName =this.goldmedal[i].addressUserName; + this.useralllist[i].phoneNumber = this.goldmedal[i].phoneNumber; + this.useralllist[i].salesAmount = this.goldmedal[i].salesAmount; + this.useralllist[i].lengthnum=this.goldmedal[i].orderDetailList.length + } + this.useralllist=list }, + userfind(item) { + this.paytypeWarning = this.util.checkPaytypeValidated(item.paytype); + this.showPaytypeWarning = !this.paytypeWarning.result; + if(this.paytypeWarning.result) { + if(item.status==0){ + this.getwei(item); + }else{ + this.$router.push({ + path: "/myorder/usertion", + query: { + stype: item.status, + orderNumber: item.orderNumber, + }, + }); + } + } + }, usertwo() { this.$router.push({ path: "/myorder/userrecord", diff --git a/rc-busness/pages/personal/userpay.vue b/rc-busness/pages/personal/userpay.vue index 00a0e599..11c4c97c 100644 --- a/rc-busness/pages/personal/userpay.vue +++ b/rc-busness/pages/personal/userpay.vue @@ -175,6 +175,14 @@ export default { //TODO raise WX jsapi pay break; } + _hmt.push([ + "_trackCustomEvent", + "payment", + { + "payType" : payType, + "product_amount_" : this.userPayData.userprice, + } + ]) }, goPayH5() { let isMobile = this.util.isMobile(); @@ -228,7 +236,14 @@ export default { if (res.success) { this.qrtext = '成功加入群的二维码'; this.dialogSuccess = true; - + _hmt.push([ + "_trackCustomEvent", + "payment_finished", + { + "payType" : 'native', + "product_amount_" : this.userPayData.userprice, + } + ]) } else if (res.fail) { this.dialogFail = true; diff --git a/rc-busness/pages/productdetails/producted.vue b/rc-busness/pages/productdetails/producted.vue index 7680ffb9..214c12c9 100644 --- a/rc-busness/pages/productdetails/producted.vue +++ b/rc-busness/pages/productdetails/producted.vue @@ -264,7 +264,7 @@ - +
    @@ -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",