diff --git a/rc-busness/ajax/getData.js b/rc-busness/ajax/getData.js index f1324f3a..8207ca71 100644 --- a/rc-busness/ajax/getData.js +++ b/rc-busness/ajax/getData.js @@ -208,17 +208,22 @@ export const userquery = (stype, ) => { return fetch('goods?petType='+stype, data, 'POST' ) } //处方信息 -export const userque = (goodsName, curPage,curRow) => { +export const userque = (goodsName, petType, curPage,curRow) => { if(!curPage) curPage=1; if(!curRow) curRow=10; - let queryTail='page='+curPage+'&rows='+curRow; + let queryTail='&page='+curPage+'&rows='+curRow; + let query='?0'; if(goodsName) - queryTail = '?goodsName='+goodsName; + query += '&goodsName='+goodsName; + if(petType!==undefined && petType!=='') { + query += '&petType='+petType; + } + query += queryTail; var data = { } - return fetch('goods'+queryTail, data, 'POST' ) + return fetch('goods'+query, data, 'POST' ) } diff --git a/rc-busness/ajax/util.js b/rc-busness/ajax/util.js index 9be51c9c..469b9115 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 && !isWx && $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..4ddce0ae 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%; @@ -191,7 +205,13 @@ picture { white-space: normal; color: #E2001A; } - + .desc { + height:3.8rem; + white-space: break-spaces; + word-break: keep-all; + margin:1rem auto; + line-height:1.9rem; + } i { font-style: normal; font-size: 1.125rem; diff --git a/rc-busness/assets/css/producted.less b/rc-busness/assets/css/producted.less index 87e388dd..07a91ebd 100644 --- a/rc-busness/assets/css/producted.less +++ b/rc-busness/assets/css/producted.less @@ -122,6 +122,16 @@ max-width:100%; } } +.tns-item { + video { + max-width:31.25rem; + min-width:28.25rem; + max-height:31.25rem; + min-height:28.25rem; + width:36vw; + height:36vw; + } +} // 手机端 @media screen and (max-width:768px) { .uservideo{ 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/components/rc-footer.vue b/rc-busness/components/rc-footer.vue index 1f94e5e1..e827759a 100644 --- a/rc-busness/components/rc-footer.vue +++ b/rc-busness/components/rc-footer.vue @@ -211,6 +211,13 @@ 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/config/async/fetch.js b/rc-busness/config/async/fetch.js index 3a3bf8ef..71538891 100644 --- a/rc-busness/config/async/fetch.js +++ b/rc-busness/config/async/fetch.js @@ -36,7 +36,7 @@ export default async(url = '', data = {}, type = 'GET', method = 'fetch') => { 'Content-Type': 'application/json', 'x-access-token': token }, - mode: 'cors', + // mode: 'cors', // channelId:'H5@2021', cache: 'force-cache' } diff --git a/rc-busness/config/env-data.js b/rc-busness/config/env-data.js new file mode 100644 index 00000000..0643ef69 --- /dev/null +++ b/rc-busness/config/env-data.js @@ -0,0 +1,285 @@ +let devData={ + newGuestCoupon:['0000000123','0000000140','0000000122'], + rxGoodsFilter:[{tagName:'体重管理',tagValue:'体重'},{tagName:'提升活力',tagValue:'活力'},{tagName:'泌尿道',tagValue:'泌尿'},{tagName:'消化道',tagValue:'消化'},{tagName:'皮肤',tagValue:'皮肤'}], + 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", + }, + ], + }, + ], + amature:[ + { + title: "中型幼犬离乳期全价奶糕", + productimage: "/images/dogfoot.png", + detail: "中心犬离乳期专属 高易再水合颗粒 帮助增强保护健康成长", + productCode:'17220400', + price: "¥263", + productList: [ + { + productCode: "17220400,17221000,1722040002,17220400F03", + }, + ], + }, + { + title: "皇家离乳期幼猫全价奶糕", + productimage: "/images/catfoot.png", + detail: "幼猫成长专属 支持幼猫自身保护力 为快速生长提供足够能量", + price: "¥189", + productCode:'20010200', + productList: [ + { + productCode: "20010200,20011000,20010040", + }, + ], + }, + ] + }; + +//Production data +let prdData={ + newGuestCoupon:['0000000123','0000000140','0000000122','HJXRL20210827'], + rxGoodsFilter:[{tagName:'体重管理',tagValue:'体重'},{tagName:'提升活力',tagValue:'活力'},{tagName:'泌尿道',tagValue:'泌尿'},{tagName:'消化道',tagValue:'消化'},{tagName:'皮肤',tagValue:'皮肤'}], + catlistvideo:[ + { + title: "主食级猫湿粮", + video: "/images/cat/one.mp4", + catimage: "/images/cat/one.jpg", + productimage: "/images/cat/star-1.png", + detail: "为10柔软细腻慕斯 适合离乳期幼猫舔食", + price: "¥77", + productList: [ + { + productCode: "80240008F24", + }, + ], + }, + { + title: "幼猫成长专属", + video: "/images/cat/two.mp4", + catimage: "/images/cat/two.jpg", + productimage: "/images/cat/star-2.png", + detail: "支持幼猫自身保护力 为快速生长提供足够能量", + price: "¥146", + productList: [ + { + productCode: "20030200,2003004003", + }, + ], + }, + { + title: "室内成猫专属", + video: "/images/cat/three.mp4", + catimage: "/images/cat/three.jpg", + productimage: "/images/cat/star-3.png", + detail: "高易消化蛋白 减少粪便量和异味", + price: "¥140", + productList: [ + { + productCode: "21100200,2110020002", + }, + ], + }, + { + title: "英短成猫专属", + video: "/images/cat/four.mp4", + catimage: "/images/cat/four.jpg", + productimage: "/images/cat/star-4.png", + detail: "增强肌肉质量 支持骨骼与关节健康", + price: "¥183", + productList: [ + { + productCode: "23040200,2304004003,2304020002,23040450,23041000", + }, + ], + } + ], + doglistvideo: [ + { + title: "主食级狗湿粮", + video: "/images/dog/one.mp4", + catimage: "/images/dog/one.jpg", + productimage: "/images/dog/star-1.png", + detail: "柔软细腻慕斯 适合离乳期幼犬舔食", + price: "¥78", + productList: [ + { + productCode: "81220020F03,81220020F06,81220020F12", + }, + ], + }, + { + title: "贵宾成犬专属", + video: "/images/dog/two.mp4", + catimage: "/images/dog/two.jpg", + productimage: "/images/dog/star-2.png", + detail: "护肤靓毛 理想体态", + price: "¥241", + productList: [ + { + productCode: "14560300,1456030002,14560750", + }, + ], + }, + { + title: "小型犬成犬专属", + video: "/images/dog/three.mp4", + catimage: "/images/dog/three.jpg", + productimage: "/images/dog/star-3.png", + detail: "亮泽被毛 呵护牙齿", + price: "¥121", + productList: [ + { + productCode: "10030200,10030800,1003020002", + }, + ], + }, + { + title: "离乳期全价奶糕", + video: "/images/dog/four.mp4", + catimage: "/images/dog/four.jpg", + productimage: "/images/dog/star-4.png", + detail: "高易再水合颗粒 帮助增强保护健康成长", + price: "¥88", + productList: [ + { + productCode: "16220100,16220300,16221000,1622010002,1622030002,16220100F03,16220300F03", + }, + ], + }, + ], + amature:[ + { + title: "中型幼犬离乳期全价奶糕", + productimage: "/images/dogfoot.png", + detail: "中心犬离乳期专属 高易再水合颗粒 帮助增强保护健康成长", + ecPrice: "¥263", + productCode:'17220400', + productList: [ + { + productCode: "17220400,17220100,17221000,1722040002", + }, + ], + }, + { + title: "皇家离乳期幼猫全价奶糕", + productimage: "/images/catfoot.png", + detail: "幼猫成长专属 支持幼猫自身保护力 为快速生长提供足够能量", + ecPrice: "¥189", + productCode:'20010200', + productList: [ + { + productCode: "20010200,2001020002,20010200F03,2001004003", + }, + ], + }, + ] + }; +//Production data end +let data = { + 'development':devData, + 'production':prdData +}; + +export default data; \ No newline at end of file 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 77977c08..cf50c3db 100644 --- a/rc-busness/pages/index.vue +++ b/rc-busness/pages/index.vue @@ -22,7 +22,7 @@ - + --> - +
数据加载中
+ +
+
+ +
+
+

温馨提示

+ 请使用微信扫描小程序码 +
+
+
@@ -1048,6 +1059,7 @@ import FixRight from "~/components/fixed-right.vue"; import Myfooter from "~/components/rc-footer.vue"; import unlogin from "~/components/unlogin.vue"; import { mapMutations } from "vuex"; +import envData from "~/config/env-data.js"; import { userquery, postCourseId, @@ -1055,6 +1067,7 @@ import { userque, searchchanpin, } from "../ajax/getData"; +import util from "@/ajax/util"; const settings = require("@/config"); export default { middleware: "metaTitle", @@ -1062,15 +1075,17 @@ export default { meta: { title: "首页" }, data() { return { + util, + showMiniShopQr:false, fixedHeader: false, dataLoaded: true, usermargin: { marginTop: "0" }, useraindex: 0, + envData, indexacindex:0, mobileVideoPlaying: false, usertitle: "明星猫粮", dogtitle: "明星犬粮", - userdata:'999999', processinformation: [], catshi: [], userindex: 0, @@ -1257,113 +1272,12 @@ 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: [ { @@ -1414,6 +1328,7 @@ export default { // console.log("1"); // } if (this.realIndex == 2) { + // setTimeout(() => { // var option = { // customer: { @@ -1492,52 +1407,56 @@ export default { }, created() { vm = this; + let curEnv = process.env.NODE_ENV; + this.catlistvideo = envData[curEnv].catlistvideo; + this.doglistvideo = envData[curEnv].doglistvideo; }, watch: {}, mounted() { - this.checkIsLogin(); - if(this.$store.state.userInfo===undefined){ - this.userdata=' ' - }else{ - this.userdata = this.$store.state.userInfo.data.id; - } - console.log(this.userdata); - const that = this; + let popupMessage = this.$route.query.msg; + if(popupMessage) { + this.$message({ + type: 'success', + message: popupMessage, + }); + } + this.checkIsLogin(); - this.ifAdoid(); - this.usermessage = JSON.parse(localStorage.getItem("userInfo")); - if (this.usermessage == null || this.usermessage == undefined) { - this.userunlogin = true; - } - window.addEventListener("scroll", this.handleScroll, true); - this.userchufang(); //查询处方粮商品信息 + const that = this; - this.catmessage(); //查询猫的信息 - this.catclickGan(); - this.catclickShi(); + this.ifAdoid(); + this.usermessage = JSON.parse(localStorage.getItem("userInfo")); + if (this.usermessage == null || this.usermessage == undefined) { + this.userunlogin = true; + } + window.addEventListener("scroll", this.handleScroll, true); + this.userchufang(); //查询处方粮商品信息 - this.dogmessage(); //查询狗的信息 - this.userdogShi(); - this.userdogGan(); + this.catmessage(); //查询猫的信息 + this.catclickGan(); + this.catclickShi(); + + this.dogmessage(); //查询狗的信息 + this.userdogShi(); + this.userdogGan(); }, destroyed() { window.removeEventListener("scroll", this.scrollToTop); }, methods: { - diaoqi(){ - - var option = { - customer: { - id: "", - name: "", - email: "", - mobile: "", - memberId: this.userdata, - }, - }; - dis_livchat(option); - }, - ...mapMutations(["checkIsLogin"]), + ...mapMutations(["checkIsLogin"]), + diaoqi(){ + this.$refs['fixRightComponent'].lianxi({title:'营养专家'}); + }, + toMiniShop(){ + let isMobile = this.util.isMobile(); + if(isMobile) { + window.location.href="https://miniapp-product.royalcanin.com.cn/rcmini2020/admin/Voucher/urlRedirect.html"; + } else { + this.showMiniShopQr=true; + // /images/qrcode-minishop.png + } + }, playMobileVideo(item) { let videoPath = item.video; let player = this.$refs["mobile-video-player"]; @@ -1944,7 +1863,7 @@ export default { if (!item) item = this.discounchufang[0].title; this.dataLoaded = false; let list = []; - let data = await userque(item, 1, 8); + let data = await userque(item, '', 1, 8); if (data) { list = data.slice(0, 8); this.processinformation = list; @@ -1971,7 +1890,7 @@ export default { catclickGan() { this.userstype = 0; this.maoganCurIndex = this.maoganCurIndex ? this.maoganCurIndex : 0; - let apiCatAgeType = this.discoun[this.maoshiCurIndex].title; + let apiCatAgeType = this.discoun[this.maoganCurIndex].title; let petType = { petType: 0, tagStatus: 1, //干 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/discount.vue b/rc-busness/pages/personal/discount.vue index fd34793b..7d7c4572 100644 --- a/rc-busness/pages/personal/discount.vue +++ b/rc-busness/pages/personal/discount.vue @@ -34,7 +34,7 @@ ¥ - {{ item.couponAmount?item.couponAmount:(parseInt((item.discount)*10)+'折') }} + {{ item.couponAmount?item.couponAmount:(parseInt((1-item.discount)*10)+'折') }} {{ item.couponName }} @@ -43,7 +43,7 @@ {{ item.couponDesc }} -
    +
    有效期 {{item.validFrom}}至 {{item.validTo}} diff --git a/rc-busness/pages/personal/settlement.vue b/rc-busness/pages/personal/settlement.vue index 52022db4..88466d22 100644 --- a/rc-busness/pages/personal/settlement.vue +++ b/rc-busness/pages/personal/settlement.vue @@ -167,7 +167,7 @@ ¥ - {{ item.couponAmount?item.couponAmount:(parseInt((item.discount)*10)+'折') }} + {{ item.couponAmount?item.couponAmount:(parseInt((1-item.discount)*10)+'折') }}
    {{ item.couponName }} @@ -176,7 +176,7 @@ {{ item.couponName }} -
    +
    有效期 {{item.validFrom}}至 {{item.validTo}} @@ -287,12 +287,13 @@ export default { checkResult = false; } if(checkResult) { + this.discountedProductCode = this.goldmedal[0].productCode if(this.curCoupon.couponAmount && this.curCoupon.couponAmount>0) { this.discountAmount = this.curCoupon.couponAmount; return this.sumPrice - this.curCoupon.couponAmount; } else if(this.curCoupon.discount && this.curCoupon.discount>0) { this.discountAmount = this.sumPrice*this.curCoupon.discount; - return this.sumPrice * (1-this.curCoupon.discount); + return this.sumPrice * ( 1 - this.curCoupon.discount ); } } else { return this.sumPrice; @@ -330,8 +331,8 @@ export default { break; case 3: //Limited product % discount case 4: //% discount - total = total + (itemInCart.productPrice * itemInCart.buyCount) * this.curCoupon.discount; - this.discountAmount = (itemInCart.productPrice * itemInCart.buyCount) * ( 1 - this.curCoupon.discount); + total = total + (itemInCart.productPrice * itemInCart.buyCount) * ( 1 - this.curCoupon.discount ); + this.discountAmount = (itemInCart.productPrice * itemInCart.buyCount) * this.curCoupon.discount; this.discountedProductCode = itemInCart.productCode; couponUsed=true; break; @@ -375,7 +376,7 @@ export default { userget(){ let user = this.$store.state.userInfo; if (user) { - this.userdraw(user.data.mobile); + //this.userdraw(user.data.mobile); this.dialogInfo1 = true; } else { this.$router.push({ @@ -391,7 +392,7 @@ export default { let valDateFromTime=0; let valDateToTime=0; let dateChecked=true; - + let avaliableCouponNum = 0; if (data) { this.drawlist=[]; for(let itemInCart of this.goldmedal) { @@ -422,10 +423,14 @@ export default { if(dateChecked && myCoupon.activityId != 10 && myCoupon.status == 0 && (!myCoupon.productCodes || myCoupon.productCodes.indexOf(itemInCart.productCode)>-1)) { data.data.splice(tmpIndex,1); _self.drawlist.push(myCoupon); + avaliableCouponNum++; } tmpIndex++; } } + if(avaliableCouponNum > 0) { + this.curCoupon.couponName = '有 '+avaliableCouponNum+' 张优惠券可以使用'; + } } }, pickCoupon(item){ @@ -513,28 +518,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 +631,22 @@ 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, + } + ]) + }); + let user = this.$store.state.userInfo; + if(user) { + this.userdraw(user.data.mobile); + } // 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..46566de4 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,62 @@ 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.allmessage=[]; + 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.goldmedal[i].status==2){ + this.pending.push(this.goldmedal[i].orderDetailList[0]); + } + } + for (let i = 0; i < this.goldmedal.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].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 +449,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..5746e85d 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 5f92ae55..44434f2a 100644 --- a/rc-busness/pages/productdetails/producted.vue +++ b/rc-busness/pages/productdetails/producted.vue @@ -1,793 +1,733 @@ - - - - - \ No newline at end of file diff --git a/rc-busness/pages/productdetails/productlist.vue b/rc-busness/pages/productdetails/productlist.vue index d11951f8..4dde4374 100644 --- a/rc-busness/pages/productdetails/productlist.vue +++ b/rc-busness/pages/productdetails/productlist.vue @@ -39,8 +39,8 @@
  • -
    -
    +
    +

    年龄:

    -
    -
    +
    +

    功能:

    -
    -
    +
    +

    品种:

    +
    +
    +

    功能:

    +
      +
    1. + {{ item.tagName }} +
    2. +
    +
    @@ -313,12 +327,14 @@ import Myheader from "~/components/header.vue"; import MyFooter from '~/components/rc-footer.vue' import FixRight from "~/components/fixed-right.vue"; import tabs from "~/components/tabs.vue"; +import envData from "~/config/env-data.js"; import { userstype, biaome, biaomessage, searchchanpin, - userquery + userquery, + userque } from "../../ajax/getData"; export default { data() { @@ -328,6 +344,8 @@ export default { path:'/productdetails/productlist/', } ], + envData, + rxFilters:[], value: "", isLoading: false, userstype: [], @@ -507,13 +525,10 @@ export default { _self.chooseDefaultOptions(); //_self.usetmessage(); }); - /* - if (stype !== "" && stype !== undefined) { - this.onmessage(stype);//Wont happen - } else { - this.usetmessage(); - } - */ + //Handling RxGoods filter + let curEnv = process.env.NODE_ENV; + this.rxFilters = envData[curEnv].rxGoodsFilter; + //Handling RxGoods filter end }, methods: { async usersearch(stype, usertype) { @@ -598,7 +613,7 @@ export default { async usetmessage() { this.isLoading = true; - let data = await biaome(this.activeIndex1, "", 1, 10); + let data = await biaome(this.activeIndex1, "", 1, 20); if (data) { this.rccontair = data; this.isLoading = false; @@ -606,12 +621,21 @@ export default { }, async onmessage(stype) { this.isLoading = true; - let data = await biaomessage(stype, "", 1, 10); + let data = await biaomessage(stype, "", 1, 20); if (data) { this.rccontair = data; this.isLoading = false; } }, + async getRxGoodsByFunc(functionName) { + this.isLoading = true; + let petType = this.activeIndex1; + let data = await userque(functionName, petType, 1, 20); + if (data) { + this.rccontair = data; + this.isLoading = false; + } + }, chooseDefaultOptions(){ let tagStatus = this.routeParams.tagStatus; let categoryName = this.routeParams.categoryName; @@ -713,8 +737,24 @@ export default { else { this.prefecture[this.rxGoodsIndexPointer].checked=false; this.inRxGoods=false; + for(let tmp of this.rxFilters) { + tmp.checked = false; + } } }, + selectFilter(item) { + for(let tmp of this.rxFilters) { + if(item.tagValue == tmp.tagValue) { + item.checked = !item.checked; + } else { + tmp.checked = false; + } + } + if(item.checked) + this.getRxGoodsByFunc(item.tagValue); + else + this.getRxGoodsByFunc(); + }, resetAllOptions(){ let _self = this; let categoriesSelectionEles=this.prefecture; @@ -725,6 +765,7 @@ export default { allSelectionEles.forEach(function(tmp,index){ tmp.checked=false; }); + this.checkRxGoods(false); this.userserachlist = [ { categoryName: [], //专区 diff --git a/rc-busness/pages/resentation/resentation.vue b/rc-busness/pages/resentation/resentation.vue index 9c77133f..2d3182b8 100644 --- a/rc-busness/pages/resentation/resentation.vue +++ b/rc-busness/pages/resentation/resentation.vue @@ -1,44 +1,54 @@