diff --git a/rc-busness/ajax/util.js b/rc-busness/ajax/util.js index eca95534..1d383876 100644 --- a/rc-busness/ajax/util.js +++ b/rc-busness/ajax/util.js @@ -33,6 +33,47 @@ let util = { } else { return 2; } + }, + checkPaytypeValidated($paytype) { + 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 == 3) { + return {'result':true}; + } + 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/assets/css/producted.less b/rc-busness/assets/css/producted.less index f74ce4b9..87e388dd 100644 --- a/rc-busness/assets/css/producted.less +++ b/rc-busness/assets/css/producted.less @@ -54,6 +54,13 @@ color: #333333; display:inline-block; } + .ts-record { + font-size: 12px; + margin-left: 16px; + font-style: normal; + color: #333333; + display:inline-block; + } .ts-row-title + i { color: #666666; display:inline-flex; @@ -297,6 +304,7 @@ } .productdetails { margin-top: 19px; + } .rc-productdeta { @@ -367,11 +375,17 @@ .ts-row-title{ font-size: 16px; width:82px; + } .ts-row-title + i { font-size: 16px; max-width:596px; } + .ts-row-record{ + color: #999; + margin-left: 12px; + font-size: 12px; + } } .rc-button{ width: 100%; 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/nuxt.config.js b/rc-busness/nuxt.config.js index 5b889a0c..9ee49b7f 100644 --- a/rc-busness/nuxt.config.js +++ b/rc-busness/nuxt.config.js @@ -1,7 +1,10 @@ const trackingScript = 'var dataLayer = window.dataLayer = window.dataLayer || [];dataLayer.push({"user":{"sitecoreId":"00000000-0000-0000-0000-000000000000","locale":"zh-HK"},"session":{"id":"vvfwez43vfoomct4y3yqneqy"},"site":{"country":"HK","id":"RCGlobalMC1","environment":"prd"},"page":{"type":"Start of Life Page","hitTimestamp":"2020-10-16T16:26:21.7350880+00:00","topic":"Collecting your kitten and their first week with you","theme":"Cat"},"pet":{"specieId":"2"}});'; const assetsUrl = 'var assetsUrl="/royalcanin-cdn-assets-new/css_js/";var isInitialized=false;'; export default { - + env: { + //NODE_ENV: 'development' + NODE_ENV: 'production' + }, // Global page headers: https://go.nuxtjs.dev/config-head head: { title: '皇家宠物食品官方商城', 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 8b02832b..d5aeac27 100644 --- a/rc-busness/pages/personal/useraddress.vue +++ b/rc-busness/pages/personal/useraddress.vue @@ -132,7 +132,18 @@ - + +
    +
    + +
    +
    +

    温馨提示

    + {{ paytypeWarning.message}} +
    +
    +
    + @@ -140,10 +151,14 @@ import Myheader from "~/components/header.vue"; import MyFooter from '~/components/rc-footer.vue'; import tabs from "~/components/tabs.vue"; -import { customerorders, userindent, canceldanhao,generateOrderWX } from "../../ajax/getData"; +import util from "@/ajax/util"; +import { customerorders, userindent, canceldanhao, repayOrde } from "../../ajax/getData"; export default { data() { return { + util, + paytypeWarning:{result:true,message:''}, + showPaytypeWarning:false, crumbs:[ { path:'/personal/mypersonal/', @@ -277,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", @@ -295,79 +309,83 @@ 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) { - console.log(item); - let postData = []; - let userPayData = { - userprice: item.salesAmount, - orderId:item.orderNumber, - userinformation:item.addressUserName + - " " + - item.phoneNumber, - wxPay: "weixin://wxpay/bizpayurl?pr=4RJbokxzz", - }; - this.$router.push({ - path: "/personal/userpay", - query: { - userData:item.orderNumber, - stype:1, - userPayData: JSON.stringify(userPayData), - }, - }); - }, - + //订单立即支付 + async getwei(item) { + let payType = this.util.pickPaytype(); + let data = await this.repayOrde(item.orderNumber, payType); + if(data.code==1) { + let userPayData = { + userprice: item.salesAmount, + orderId: item.orderNumber, + userinformation: item.addressUserName + " " + item.phoneNumber, + wxPay:data.msg + }; + this.$router.push({ + path: "/personal/userpay", + query: { + userData: item.orderNumber, + stype: 1, + userPayData: JSON.stringify(userPayData), + }, + }); + } else { + this.$message({ + type: "error", + message: "订单数据错误,请联系客服进行处理", + }); + } + }, + async repayOrde(ordernumber) { + let payType = this.util.pickPaytype(); + let res = await repayOrde(ordernumber, payType); + if (res) { + return res; + } + }, usertiaozhuan(item){ this.$router.push({ path: "/myorder/usertion", @@ -430,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 a48b1c32..11c4c97c 100644 --- a/rc-busness/pages/personal/userpay.vue +++ b/rc-busness/pages/personal/userpay.vue @@ -94,7 +94,9 @@
    -
    +
    + +
    @@ -112,6 +114,7 @@ export default { data() { return { util, + h5payRedirectUrl:'', activeIndex: 0, paymentTimer:undefined, isSucess: false, @@ -172,10 +175,19 @@ 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(); if(this.userPayData.wxPay && isMobile) { + //this.$refs["h5SubmitForm"].action="http://47.96.75.242:10086/royalcanin/royalcanin/redirectUrlWXH5"; this.$refs["h5SubmitForm"].action=this.userPayData.wxPay; this.$refs["h5SubmitForm"].submit(); //window.location.href=this.userPayData.wxPay;; @@ -224,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 8a372e80..214c12c9 100644 --- a/rc-busness/pages/productdetails/producted.vue +++ b/rc-busness/pages/productdetails/producted.vue @@ -124,6 +124,11 @@ ¥{{ curItem.rsp }} + + 购买该商品你将获得{{curItem.basePoint}}积分 + + +
    @@ -259,7 +264,7 @@
    - +
    @@ -321,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; @@ -358,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,8 +379,8 @@ export default { activeIndexa, curItem, newlist, - chufang, - videolist, + chufang, + videolist, productAttachmentList, userbuy } @@ -399,8 +399,8 @@ export default { drawlist: [], //用户可以领取的优惠券 alldraw: [], userlistmenu: [], - msg: ["11111111"], - parent_msg: ["111"], + msg: [""], + parent_msg: [""], usermessage: [], dialogInfo2: false, productCode: "", //商品code @@ -463,21 +463,22 @@ export default { mounted() { 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; @@ -491,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: { @@ -500,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, }); } @@ -535,6 +558,8 @@ export default { async userquery() { let data = await goodsmessage(this.productCode); if (data) { + console.log(data) + debugger this.newlist = data.data; } this.productAttachmentList = this.newlist[0].productAttachmentList; @@ -547,6 +572,8 @@ export default { let data = await oncequery(this.productCode); let outputObj = {}; if (data) { + console.log(data); + debugger outputObj = data; outputObj.productName = data.name; outputObj.picture = 'https://royalcanincn.escase.cn/jc/royalcanin/'+outputObj.picture; @@ -673,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 = [ @@ -691,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", diff --git a/smart-admin-service/smart-admin-api/src/main/resources/static/44_1.jpg b/smart-admin-service/smart-admin-api/src/main/resources/static/44_1.jpg new file mode 100644 index 00000000..110a32a7 Binary files /dev/null and b/smart-admin-service/smart-admin-api/src/main/resources/static/44_1.jpg differ diff --git a/smart-admin-service/smart-admin-api/src/main/resources/static/44_2.jpg b/smart-admin-service/smart-admin-api/src/main/resources/static/44_2.jpg new file mode 100644 index 00000000..1b1c7590 Binary files /dev/null and b/smart-admin-service/smart-admin-api/src/main/resources/static/44_2.jpg differ diff --git a/smart-admin-service/smart-admin-api/src/main/resources/static/45_1.jpg b/smart-admin-service/smart-admin-api/src/main/resources/static/45_1.jpg new file mode 100644 index 00000000..ae7887e3 Binary files /dev/null and b/smart-admin-service/smart-admin-api/src/main/resources/static/45_1.jpg differ diff --git a/smart-admin-service/smart-admin-api/src/main/resources/static/45_2.jpg b/smart-admin-service/smart-admin-api/src/main/resources/static/45_2.jpg new file mode 100644 index 00000000..710de043 Binary files /dev/null and b/smart-admin-service/smart-admin-api/src/main/resources/static/45_2.jpg differ