mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-10-03 18:56:39 +08:00
commit
4a182d93c2
@ -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' )
|
||||
}
|
||||
|
||||
|
||||
|
@ -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;
|
@ -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;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -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;
|
||||
|
@ -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{
|
||||
|
@ -1,6 +1,7 @@
|
||||
<template>
|
||||
<div class="rc-fixright" >
|
||||
<ul >
|
||||
<div class="rc-fixright-container">
|
||||
<div class="rc-fixright">
|
||||
<ul>
|
||||
<li v-for="(userfixed,index) in fixedlist" :key="index" @click="lianxi(userfixed,index)">
|
||||
<img :src="userfixed.catimage" alt="">
|
||||
<span> {{userfixed.title}}</span>
|
||||
@ -11,6 +12,18 @@
|
||||
<span>回到顶部</span>
|
||||
</div>
|
||||
</div>
|
||||
<el-dialog :visible.sync="customerServerStop" :close-on-click-modal="false">
|
||||
<div class="ts-warning-popup">
|
||||
<div class="title rc-full-width">
|
||||
<img src="../assets/error.png" alt="" />
|
||||
</div>
|
||||
<div class="content rc-full-width rc-text--center rc-margin-y--md">
|
||||
<h3>温馨提示</h3>
|
||||
<span class="">客服因法定春节假期暂停服务,<br/>预计2月10日恢复正常服务</span>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@ -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() {
|
||||
|
@ -211,6 +211,13 @@
|
||||
|
||||
<div class="footer-block9 rc-layout-container rc-one-column rc-text-colour--brand3">
|
||||
<div class="rc-column rc-text--center rc-padding-top--none">
|
||||
<a target='_blank' href='https://beian.miit.gov.cn' style="display: inline-block;">
|
||||
<img src='https://royalcanin.com.cn/profiles/custom/royal_canin_profile/themes/royal_canin/images/bei-symblo.png' style="float:left">
|
||||
<p style="float:left;height:20px;line-height:20px;margin: 0px 0px 0px 5px; color:#939393;">
|
||||
沪公网安备 31012002005532号
|
||||
</p>
|
||||
</a>
|
||||
<br/>
|
||||
<a target='_blank' href='https://beian.miit.gov.cn'><span class="">沪ICP备08000779号-2</span></a>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -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,
|
||||
|
@ -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'
|
||||
}
|
||||
|
285
rc-busness/config/env-data.js
Normal file
285
rc-busness/config/env-data.js
Normal file
@ -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;
|
@ -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: '皇家宠物食品官方商城',
|
||||
|
@ -22,7 +22,7 @@
|
||||
</swiper-slide>
|
||||
|
||||
<swiper-slide>
|
||||
<a href="#" target="_blank">
|
||||
<a @click="toMiniShop" target="_blank">
|
||||
<picture>
|
||||
<source
|
||||
media="(max-width: 768px)"
|
||||
@ -1032,12 +1032,23 @@
|
||||
</nuxt-link>
|
||||
</div> -->
|
||||
|
||||
<FixRight></FixRight>
|
||||
<FixRight ref="fixRightComponent"></FixRight>
|
||||
<div v-if="!dataLoaded" class="ts-mask">
|
||||
<div class="ts-mask-bg"></div>
|
||||
<div class="userloding"></div>
|
||||
<span>数据加载中</span>
|
||||
</div>
|
||||
<el-dialog :visible.sync="showMiniShopQr" :close-on-click-modal="false">
|
||||
<div class="rc-headera">
|
||||
<div class="rc-title">
|
||||
<img src="images/qrcode-wxgroup.jpg" alt="" style="margin:0 auto;"/>
|
||||
</div>
|
||||
<div class="rc-logmain rc-text--center">
|
||||
<h3>温馨提示</h3>
|
||||
<span>请使用微信扫描小程序码</span>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<Myfooter></Myfooter>
|
||||
</div>
|
||||
</template>
|
||||
@ -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,16 +1407,21 @@ 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;
|
||||
let popupMessage = this.$route.query.msg;
|
||||
if(popupMessage) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: popupMessage,
|
||||
});
|
||||
}
|
||||
console.log(this.userdata);
|
||||
this.checkIsLogin();
|
||||
|
||||
const that = this;
|
||||
|
||||
this.ifAdoid();
|
||||
@ -1524,20 +1444,19 @@ export default {
|
||||
window.removeEventListener("scroll", this.scrollToTop);
|
||||
},
|
||||
methods: {
|
||||
diaoqi(){
|
||||
|
||||
var option = {
|
||||
customer: {
|
||||
id: "",
|
||||
name: "",
|
||||
email: "",
|
||||
mobile: "",
|
||||
memberId: this.userdata,
|
||||
},
|
||||
};
|
||||
dis_livchat(option);
|
||||
},
|
||||
...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, //干
|
||||
|
@ -118,7 +118,7 @@
|
||||
</li>
|
||||
<li>
|
||||
<span>付款方式:</span>
|
||||
<i>{{ information.paytype }}</i>
|
||||
<i>{{ information.paytypeText }}</i>
|
||||
</li>
|
||||
<li>
|
||||
<span>配送方式:</span>
|
||||
@ -159,6 +159,17 @@
|
||||
</i>
|
||||
</div>
|
||||
|
||||
<el-dialog :visible.sync="showPaytypeWarning" :close-on-click-modal="false">
|
||||
<div class="ts-warning-popup">
|
||||
<div class="title rc-full-width">
|
||||
<img src="../../assets/error.png" alt="" />
|
||||
</div>
|
||||
<div class="content rc-full-width rc-text--center rc-margin-y--md">
|
||||
<h3>温馨提示</h3>
|
||||
<span class="">{{ paytypeWarning.message}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<MyFooter></MyFooter>
|
||||
</div>
|
||||
</template>
|
||||
@ -184,6 +195,8 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
util,
|
||||
paytypeWarning:{result:true,message:''},
|
||||
showPaytypeWarning:false,
|
||||
goldmedal: [],
|
||||
userproductId: "",
|
||||
logisticsDate: "",
|
||||
@ -214,11 +227,8 @@ export default {
|
||||
useraddress: [],
|
||||
shopprice: {},
|
||||
information: {
|
||||
reference: "1111111111111111",
|
||||
ordertime: "2012-12-01 11:20:00",
|
||||
paytype: "微信支付",
|
||||
paytypeText: "",
|
||||
distribution: "快递",
|
||||
trackingnumber: "11111111111111",
|
||||
catimage: require("../../assets/image/rc-left.png"),
|
||||
},
|
||||
};
|
||||
@ -267,6 +277,9 @@ export default {
|
||||
},
|
||||
//订单支付和再次购买
|
||||
onceagain(item) {
|
||||
this.paytypeWarning = this.util.checkPaytypeValidated(this.paytype);
|
||||
this.showPaytypeWarning = !this.paytypeWarning.result;
|
||||
if(this.paytypeWarning.result) {
|
||||
if (this.payorsucess == "立即支付") {
|
||||
this.getwei(item);
|
||||
} else {
|
||||
@ -278,6 +291,7 @@ export default {
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
async orderquantity(orderNumber) {
|
||||
let data = await userin(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);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -34,7 +34,7 @@
|
||||
¥
|
||||
</i>
|
||||
<span>
|
||||
{{ item.couponAmount?item.couponAmount:(parseInt((item.discount)*10)+'折') }}
|
||||
{{ item.couponAmount?item.couponAmount:(parseInt((1-item.discount)*10)+'折') }}
|
||||
</span>
|
||||
</div>
|
||||
<strong>{{ item.couponName }}</strong>
|
||||
@ -43,7 +43,7 @@
|
||||
<i :style='usercolor'>
|
||||
{{ item.couponDesc }}
|
||||
</i>
|
||||
<div class="rc-userfont">
|
||||
<div class="rc-userfont" :style="(item.validTo?'visibility:visible':'visibility:hidden')">
|
||||
<strong>有效期</strong>
|
||||
<span>{{item.validFrom}}至</span>
|
||||
<em>{{item.validTo}}</em>
|
||||
|
@ -167,7 +167,7 @@
|
||||
¥
|
||||
</i>
|
||||
<span>
|
||||
{{ item.couponAmount?item.couponAmount:(parseInt((item.discount)*10)+'折') }}
|
||||
{{ item.couponAmount?item.couponAmount:(parseInt((1-item.discount)*10)+'折') }}
|
||||
</span>
|
||||
</div>
|
||||
<strong>{{ item.couponName }}</strong>
|
||||
@ -176,7 +176,7 @@
|
||||
<i :style='usercolor'>
|
||||
{{ item.couponName }}
|
||||
</i>
|
||||
<div class="rc-userfont">
|
||||
<div class="rc-userfont" :style="(item.validTo?'visibility:visible':'visibility:hidden')">
|
||||
<strong>有效期</strong>
|
||||
<span>{{item.validFrom}}至</span>
|
||||
<em>{{item.validTo}}</em>
|
||||
@ -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){
|
||||
@ -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);
|
||||
|
@ -132,6 +132,17 @@
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<el-dialog :visible.sync="showPaytypeWarning" :close-on-click-modal="false">
|
||||
<div class="ts-warning-popup">
|
||||
<div class="title rc-full-width">
|
||||
<img src="../../assets/error.png" alt="" />
|
||||
</div>
|
||||
<div class="content rc-full-width rc-text--center rc-margin-y--md">
|
||||
<h3>温馨提示</h3>
|
||||
<span class="">{{ paytypeWarning.message}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<MyFooter></MyFooter>
|
||||
</div>
|
||||
</template>
|
||||
@ -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",
|
||||
@ -301,6 +313,7 @@ export default {
|
||||
this.activeIndex = stype;
|
||||
this.goldmedal = data;
|
||||
this.alllist=[];
|
||||
this.allmessage=[];
|
||||
this.useralllist=[];
|
||||
this.obligation=[];
|
||||
this.receiving=[];
|
||||
@ -314,25 +327,19 @@ export default {
|
||||
}else if(this.goldmedal[i].status==1){
|
||||
this.receiving.push(this.goldmedal[i].orderDetailList[0]);
|
||||
}
|
||||
else if(this.useralllist[i].status==2){
|
||||
else if(this.goldmedal[i].status==2){
|
||||
this.pending.push(this.goldmedal[i].orderDetailList[0]);
|
||||
}
|
||||
}
|
||||
for (var i = 0; i < this.useralllist.length; i++) {
|
||||
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].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//数量
|
||||
|
||||
|
||||
this.useralllist[i].lengthnum=this.goldmedal[i].orderDetailList.length
|
||||
this.useralllist[i].lengthnum=this.goldmedal[i].orderDetailList.length;
|
||||
this.useralllist[i].paytype=this.goldmedal[i].paytype;
|
||||
}
|
||||
console.log(this.obligation)
|
||||
if(this.userstype==1){
|
||||
this.useralllist=this.obligation
|
||||
}else if(this.userstype==2){
|
||||
@ -347,18 +354,17 @@ export default {
|
||||
|
||||
|
||||
},
|
||||
|
||||
//订单立即支付
|
||||
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: {
|
||||
@ -445,14 +451,11 @@ 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);
|
||||
|
||||
}else if(item.title=='待发货'){
|
||||
this.useralllist=this.pending
|
||||
list=this.pending
|
||||
@ -462,7 +465,6 @@ export default {
|
||||
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
|
||||
@ -472,9 +474,11 @@ export default {
|
||||
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{
|
||||
@ -486,7 +490,7 @@ export default {
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
usertwo() {
|
||||
this.$router.push({
|
||||
|
@ -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;
|
||||
|
||||
|
@ -15,12 +15,7 @@
|
||||
rc-border-colour--brand4
|
||||
"
|
||||
>
|
||||
<div class="uservideo" v-if="videoshow">
|
||||
<video controls="" preload="videoimg">
|
||||
<source :src="videolist" type="video/mp4" />
|
||||
</video>
|
||||
</div>
|
||||
<div class="rc-column" v-if="!videoshow">
|
||||
<div class="rc-column">
|
||||
<div data-js-carousel="" data-image-gallery="true">
|
||||
<div
|
||||
class="rc-carousel rc-carousel__gallery-image"
|
||||
@ -30,11 +25,10 @@
|
||||
<!-- Big images-->
|
||||
<div v-for="(item, index) in productAttachmentList" :key="index">
|
||||
<div>
|
||||
<img :src="item.attachmentPath" />
|
||||
<!-- <img
|
||||
src="https://cdn.royalcanin-weshare-online.io/m2kia2QBG95Xk-RBC8jn/v1/medium-maxi-giant-pos-2012-packshots-ma-ad-shn-packshot?w=420&fm=jpg&auto=compress"
|
||||
alt="Product alt text"
|
||||
/> -->
|
||||
<img v-if="(item.attachmentPath.indexOf('mp4')<0)" :src="item.attachmentPath" />
|
||||
<video v-if="(item.attachmentPath.indexOf('mp4')>0)" preload="meta" controls="controls">
|
||||
<source :src= item.attachmentPath type="video/mp4">
|
||||
</video>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -57,7 +51,8 @@
|
||||
:key="index"
|
||||
>
|
||||
<div class="rc-img--square">
|
||||
<img :src="item.attachmentPath" />
|
||||
<img :src="item.attachmentPath" v-if="(item.attachmentPath.indexOf('mp4')<0)" />
|
||||
<img src="/images/default.jpg" class="ts-video-btn" v-if="(item.attachmentPath.indexOf('mp4')>0)" />
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="rc-carousel__gallery-thumbnail">
|
||||
@ -111,17 +106,21 @@
|
||||
<div class="rc-productdetail" v-if="!userbuy">
|
||||
<i class="ts-row-title">所属分类:</i>
|
||||
<span>{{ curItem.categoryName }}</span>
|
||||
|
||||
</div>
|
||||
<div class="rc-button" v-if="userloginbuy">
|
||||
<span @click="chuafangbuy()">立即购买</span>
|
||||
<div class="rc-button" v-if="!userbuy && curItem.goodUrl && curItem.goodUrl.length>5">
|
||||
<a :href="curItem.goodUrl" target='_blank' class="ts-standard-btn">立即购买</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="rc-productdetail" v-if="userbuy">
|
||||
<i class="ts-row-title">商品价格:</i>
|
||||
<span class="ts-realprice">¥{{ curItem.ecPrice }}</span>
|
||||
<span class="ts-remove ts-ecprice">¥{{ curItem.rsp }} </span>
|
||||
<span class="ts-record" v-if="curItem.basePoint !== 0">
|
||||
购买该商品你将获得{{ curItem.basePoint }}积分
|
||||
<s class="ts-ecprice" v-if="curItem.ecPrice<curItem.rsp"
|
||||
>¥{{ curItem.rsp }}
|
||||
</s>
|
||||
<span class="ts-record" v-if="curItem.basePoint!==0">
|
||||
购买该商品你将获得<span class="rc-zeta">{{curItem.basePoint}}积分</span>
|
||||
</span>
|
||||
|
||||
<!-- <span class="rc-title">购买该商品你将得到22积分</span> -->
|
||||
@ -147,17 +146,7 @@
|
||||
<i class="ts-row-title">商品规格:</i>
|
||||
</div>
|
||||
<div class="ts-tag-list">
|
||||
<em
|
||||
v-for="(item, index) in newlist"
|
||||
:key="index"
|
||||
@click="selectsearch(item, index)"
|
||||
:class="[
|
||||
activeIndexa == index && item.leftAllotment > 0
|
||||
? 'active'
|
||||
: 'unactive',
|
||||
item.leftAllotment > 0 ? '' : 'disabled',
|
||||
]"
|
||||
>
|
||||
<em v-for="(item, index) in newlist" :key="index" @click="selectsearch(item, index)" :class="[(activeIndexa==index && item.leftAllotment>0)?'active':'unactive',item.leftAllotment>0?'':'disabled']">
|
||||
{{ item.specifications }}
|
||||
</em>
|
||||
</div>
|
||||
@ -169,10 +158,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="rc-main">
|
||||
<div
|
||||
class="rc-produnnum"
|
||||
v-if="userbuy && curItem.leftAllotment > 0"
|
||||
>
|
||||
<div class="rc-produnnum" v-if="(userbuy && curItem.leftAllotment>0)">
|
||||
<div><i class="ts-row-title">商品数量:</i></div>
|
||||
<img
|
||||
src="../../assets/image/userjian.png"
|
||||
@ -217,13 +203,11 @@
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div
|
||||
class="rc-button"
|
||||
v-if="userbuy && curItem.leftAllotment > 0"
|
||||
>
|
||||
<div class="rc-button" v-if="(userbuy && curItem.leftAllotment>0)">
|
||||
<span @click="usertanchu(curItem, 0)">加入购物车</span>
|
||||
<span @click="usertanchu(curItem, 1)">立即购买</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="online bold rc-md-down"></div>
|
||||
</div>
|
||||
@ -235,16 +219,10 @@
|
||||
</div>
|
||||
<FixRight></FixRight>
|
||||
<Myfooter v-on:litentop="showmesg"></Myfooter>
|
||||
|
||||
</div>
|
||||
<el-dialog
|
||||
:visible.sync="dialogInfo1"
|
||||
@close="userclose"
|
||||
class="pop_coupon"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div class="ts-no-data" v-if="usernewlist.length <= 0">
|
||||
目前还没有可用的优惠券
|
||||
</div>
|
||||
<el-dialog :visible.sync="dialogInfo1" @close="userclose" class="pop_coupon" :close-on-click-modal="false">
|
||||
<div class="ts-no-data" v-if="usernewlist.length<=0">目前还没有可用的优惠券</div>
|
||||
<div class="rs-dis">
|
||||
<div
|
||||
class="rc-discount"
|
||||
@ -255,15 +233,11 @@
|
||||
<div class="rc-contair">
|
||||
<div class="rc-left">
|
||||
<div>
|
||||
<i v-if="item.couponTypeId != '4' && item.couponAmount > 0">
|
||||
<i v-if="(item.couponTypeId!='4' && item.couponAmount>0)">
|
||||
¥
|
||||
</i>
|
||||
<span>
|
||||
{{
|
||||
item.couponAmount
|
||||
? item.couponAmount
|
||||
: parseInt(item.discount * 10) + "折"
|
||||
}}
|
||||
{{ item.couponAmount?item.couponAmount:(parseInt((1-item.discount)*10)+'折') }}
|
||||
</span>
|
||||
</div>
|
||||
<strong>{{ item.couponName }}</strong>
|
||||
@ -272,10 +246,10 @@
|
||||
<i>
|
||||
{{ item.couponName }}
|
||||
</i>
|
||||
<div class="rc-userfont">
|
||||
<div class="rc-userfont" :style="(item.validTo?'visibility:visible':'visibility:hidden')">
|
||||
<strong>有效期</strong>
|
||||
<span>{{ item.validFrom }}至</span>
|
||||
<em>{{ item.validTo }}</em>
|
||||
<span>{{item.validFrom}}至</span>
|
||||
<em>{{item.validTo}}</em>
|
||||
</div>
|
||||
<div class="rc-footer">
|
||||
<span @click="usergetconf(item)">立即领取</span>
|
||||
@ -285,7 +259,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog :visible.sync="dialogInfo2" @close="userclose">
|
||||
<el-dialog :visible.sync="dialogInfo2" @close="userclose" :close-on-click-modal="false">
|
||||
<div class="rc-headera">
|
||||
<div class="rc-title">
|
||||
<img src="../../assets/error.png" alt="" />
|
||||
@ -301,16 +275,14 @@
|
||||
</nuxt-link>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<div
|
||||
class="rc-button rc-md-down"
|
||||
v-if="userbuy && curItem.leftAllotment > 0"
|
||||
>
|
||||
<div class="rc-button rc-md-down" v-if="(userbuy && curItem.leftAllotment>0)">
|
||||
<span @click="usertanchu(curItem, 0)">加入购物车</span>
|
||||
<span @click="usertanchu(curItem, 1)">立即购买</span>
|
||||
</div>
|
||||
<div class="rc-button rc-md-down" v-if="userloginbuy">
|
||||
<span @click="chuafangbuy()" style="margin-right: 20px">立即购买</span>
|
||||
<div class="rc-button rc-md-down " v-if="!userbuy && curItem.goodUrl && curItem.goodUrl.length>5">
|
||||
<a :href="curItem.goodUrl" target='_blank' class="ts-standard-btn">立即购买</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -329,98 +301,80 @@ import {
|
||||
getdraw,
|
||||
alldiscount,
|
||||
oncequery,
|
||||
biaomessage,
|
||||
biaomessage
|
||||
} from "../../ajax/getData";
|
||||
|
||||
export default {
|
||||
async asyncData(context) {
|
||||
async asyncData (context) {
|
||||
let isRxGoods = context.route.query.isRxGoods;
|
||||
let userbuy = true;
|
||||
let newlist = [];
|
||||
let curItem = {};
|
||||
let chufang = {};
|
||||
let videolist = [];
|
||||
let videolist=[];
|
||||
let productAttachmentList = [];
|
||||
let userlistmenu = [];
|
||||
isRxGoods = isRxGoods == "1" ? true : false;
|
||||
isRxGoods = (isRxGoods == '1'?true:false);
|
||||
let mainProductCode = context.route.query.mainProductCode;
|
||||
let productCode = context.route.query.productCode;
|
||||
let activeIndexa = 0;
|
||||
if (!productCode || productCode.length <= 0)
|
||||
throw new Error("Empty product code");
|
||||
if(!productCode || productCode.length<=0)
|
||||
throw new Error('Empty product code');
|
||||
productCode = productCode.split(",");
|
||||
// console.log(this.productCode);
|
||||
if (isRxGoods) {
|
||||
if(isRxGoods){
|
||||
let data = await oncequery(mainProductCode);
|
||||
let outputObj = {};
|
||||
if (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;
|
||||
newlist = [outputObj];
|
||||
curItem = outputObj;
|
||||
}
|
||||
let insertTmpObj = {
|
||||
id: 1,
|
||||
attachmentType: 1,
|
||||
sort: 1,
|
||||
attachmentPath: newlist[0].picture,
|
||||
};
|
||||
let insertTmpObj = {id:1, attachmentType:1, sort:1, attachmentPath:newlist[0].picture};
|
||||
productAttachmentList = [insertTmpObj];
|
||||
userbuy = false;
|
||||
console.log(curItem);
|
||||
// debugger
|
||||
|
||||
console.log("这是处方量数据");
|
||||
} else {
|
||||
let stopLeftAllotmentChecking = false;
|
||||
let stopIndex = 0;
|
||||
for (let singleCode of productCode) {
|
||||
for(let singleCode of productCode) {
|
||||
let data = await goodsmessage(singleCode);
|
||||
if (data && data.data.length > 0) {
|
||||
if (data && data.data.length>0) {
|
||||
newlist.push(data.data[0]);
|
||||
|
||||
if (data.data[0].leftAllotment > 0 && !stopLeftAllotmentChecking) {
|
||||
if(data.data[0].leftAllotment>0 && !stopLeftAllotmentChecking) {
|
||||
activeIndexa = stopIndex;
|
||||
curItem = data.data[0];
|
||||
stopLeftAllotmentChecking = true;
|
||||
stopLeftAllotmentChecking=true;
|
||||
}
|
||||
stopIndex++;
|
||||
}
|
||||
}
|
||||
if (curItem.productAttachmentList != undefined)
|
||||
if(curItem.productAttachmentList != undefined)
|
||||
productAttachmentList = curItem.productAttachmentList;
|
||||
let list = [];
|
||||
|
||||
if (curItem.productName == undefined) curItem = newlist[0];
|
||||
let list=[];
|
||||
if(curItem.productName == undefined)
|
||||
curItem = newlist[0];
|
||||
userbuy = true;
|
||||
}
|
||||
if (!curItem || curItem.productName == undefined)
|
||||
if(!curItem || curItem.productName == undefined)
|
||||
throw new Error("商品信息错误");
|
||||
let crumbs = [
|
||||
{
|
||||
path: "/productdetails/productlist/",
|
||||
path:'/productdetails/productlist/',
|
||||
},
|
||||
{
|
||||
title: curItem.productName,
|
||||
},
|
||||
}
|
||||
];
|
||||
|
||||
return {
|
||||
crumbs,
|
||||
activeIndexa,
|
||||
curItem,
|
||||
newlist,
|
||||
chufang,
|
||||
videolist,
|
||||
productAttachmentList,
|
||||
userbuy,
|
||||
};
|
||||
isRxGoods
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -428,17 +382,15 @@ export default {
|
||||
userimage: require("../../assets/image/unused.png"),
|
||||
gotop: false,
|
||||
dialogInfo1: false,
|
||||
videolist: [],
|
||||
videoimg: "",
|
||||
videoshow: false,
|
||||
videolist:[],
|
||||
videoimg:'',
|
||||
name: [],
|
||||
userloginbuy: false,
|
||||
userlist: [],
|
||||
drawlist: [], //用户可以领取的优惠券
|
||||
alldraw: [],
|
||||
userlistmenu: [],
|
||||
msg: ["11111111"],
|
||||
parent_msg: ["111"],
|
||||
msg: [""],
|
||||
parent_msg: [""],
|
||||
usermessage: [],
|
||||
dialogInfo2: false,
|
||||
productCode: "", //商品code
|
||||
@ -493,7 +445,7 @@ export default {
|
||||
tabs,
|
||||
unlogin,
|
||||
Myfooter,
|
||||
FixRight,
|
||||
FixRight
|
||||
},
|
||||
// middleware: 'metaTitle',
|
||||
// // middleware: 'metaTitle',
|
||||
@ -501,59 +453,39 @@ export default {
|
||||
|
||||
mounted() {
|
||||
this.checkIsLogin();
|
||||
console.log(this.curItem);
|
||||
if(!this.userbuy){
|
||||
if (this.curItem.goodUrl.includes("pages")) {
|
||||
this.userloginbuy = false;
|
||||
console.log("------");
|
||||
} else {
|
||||
this.userloginbuy = true;
|
||||
console.log("-22222222");
|
||||
}
|
||||
}
|
||||
|
||||
// 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;
|
||||
_hmt.push([
|
||||
"_trackCustomEvent",
|
||||
"product_visit",
|
||||
{
|
||||
"product_id":this.curItem.productCode,
|
||||
"product_category":this.curItem.categoryName,
|
||||
"product_name": this.curItem.productName,
|
||||
}
|
||||
});
|
||||
this.videoimg = this.productAttachmentList[0].attachmentPath;
|
||||
if (this.videolist.length > 0) {
|
||||
this.videoshow = true;
|
||||
} else {
|
||||
this.videoshow = false;
|
||||
}
|
||||
|
||||
/*
|
||||
let stype = this.$route.query.stype;
|
||||
let isRxGoods = this.$route.query.isRxGoods;
|
||||
isRxGoods = (isRxGoods == '1'?true:false);
|
||||
if(isRxGoods){
|
||||
this.rxquery(this.productCode);
|
||||
this.userbuy = false;
|
||||
} else {
|
||||
this.userquery(this.productCode);
|
||||
this.userbuy = true;
|
||||
}
|
||||
*/
|
||||
])
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
...mapMutations(["changemessage", "checkIsLogin"]),
|
||||
...mapMutations(["changemessage","checkIsLogin"]),
|
||||
showmesg() {
|
||||
this.toTop();
|
||||
},
|
||||
//领取优惠券
|
||||
usergetconf(item) {
|
||||
console.log(item);
|
||||
_hmt.push([
|
||||
"_trackCustomEvent",
|
||||
"get_coupon",
|
||||
{
|
||||
"product_id":this.curItem.productCode,
|
||||
"product_category":this.curItem.categoryName,
|
||||
"product_name": this.curItem.productName,
|
||||
"product_quantity" : this.sales_num,
|
||||
"product_amount" : this.sales_num*this.curItem.ecPrice,
|
||||
}
|
||||
])
|
||||
if (this.usermessage.data !== "" || this.usermessage.data !== undefined) {
|
||||
this.getconf(this.usermessage.data.id, item.couponId);
|
||||
}
|
||||
@ -562,33 +494,28 @@ export default {
|
||||
//获取用户领取的优惠券
|
||||
async getconf(memberId, couponId) {
|
||||
let data = await getConfig(memberId, couponId);
|
||||
let msg = "领取成功";
|
||||
let msg = '领取成功';
|
||||
let msgType = 'success';
|
||||
if (data) {
|
||||
if (data.code != "0") msg = data.msg;
|
||||
if(data.code!='0') {
|
||||
msgType = 'warning';
|
||||
msg = data.msg;
|
||||
}
|
||||
this.$message({
|
||||
type: "warning",
|
||||
type: msgType,
|
||||
message: msg,
|
||||
});
|
||||
}
|
||||
},
|
||||
//处方用粮跳转
|
||||
chuafangbuy() {
|
||||
window.location.href = this.chufang.goodUrl;
|
||||
},
|
||||
|
||||
// changeName(newName){
|
||||
// this.name = newName;
|
||||
// },
|
||||
|
||||
userclose() {
|
||||
this.userlist = [];
|
||||
this.dialogInfo1 = false;
|
||||
this.dialogInfo1=false;
|
||||
},
|
||||
async userquery() {
|
||||
let data = await goodsmessage(this.productCode);
|
||||
if (data) {
|
||||
console.log(data);
|
||||
debugger;
|
||||
console.log(data)
|
||||
debugger
|
||||
this.newlist = data.data;
|
||||
}
|
||||
this.productAttachmentList = this.newlist[0].productAttachmentList;
|
||||
@ -601,15 +528,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;
|
||||
outputObj.showImgFile =
|
||||
"https://royalcanincn.escase.cn/jc/royalcanin/" +
|
||||
outputObj.showImgFile;
|
||||
this.newlist = [outputObj];
|
||||
}
|
||||
let picture = this.newlist[0].picture.split(",");
|
||||
@ -635,10 +555,7 @@ export default {
|
||||
let alllist = [];
|
||||
this.userlist = this.alldraw.data;
|
||||
this.userlist.forEach((element, index) => {
|
||||
if (
|
||||
typeof element.productCodes == "string" ||
|
||||
!element.productCodes
|
||||
) {
|
||||
if (typeof element.productCodes == "string" || !element.productCodes) {
|
||||
userlist.push(element);
|
||||
// let s=element.productCodes.split(',');
|
||||
// console.log(s.indexOf(this.productCode) != -1 )
|
||||
@ -647,24 +564,24 @@ export default {
|
||||
});
|
||||
let menualist = [];
|
||||
userlist.filter((item) => {
|
||||
let valDateFromTime = 0;
|
||||
let valDateToTime = 0;
|
||||
let valDateFromTime=0;
|
||||
let valDateToTime=0;
|
||||
let curTime = new Date().getTime();
|
||||
let dateChecked = true;
|
||||
if (item.fValidFrom) {
|
||||
let dateChecked=true;
|
||||
if(item.fValidFrom) {
|
||||
valDateFromTime = new Date(item.fValidFrom).getTime();
|
||||
}
|
||||
if (item.fValidTo) {
|
||||
if(item.fValidTo) {
|
||||
valDateToTime = new Date(item.fValidTo).getTime();
|
||||
}
|
||||
if (valDateFromTime && curTime < valDateFromTime) {
|
||||
dateChecked = false;
|
||||
if(valDateFromTime && curTime < valDateFromTime) {
|
||||
dateChecked=false;
|
||||
}
|
||||
if (valDateToTime && curTime > valDateToTime) {
|
||||
dateChecked = false;
|
||||
if(valDateToTime && curTime > valDateToTime) {
|
||||
dateChecked=false;
|
||||
}
|
||||
if (dateChecked && item.activityId != 10) {
|
||||
if (!item.productCodes) {
|
||||
if(dateChecked && item.activityId!=10) {
|
||||
if(!item.productCodes) {
|
||||
menualist.push(item);
|
||||
} else {
|
||||
item.productCodes = item.productCodes.split(",");
|
||||
@ -683,10 +600,10 @@ export default {
|
||||
},
|
||||
|
||||
plus(num, index) {
|
||||
if (this.sales_num >= this.curItem.leftAllotment) {
|
||||
if(this.sales_num >= this.curItem.leftAllotment) {
|
||||
this.$message({
|
||||
type: "warning",
|
||||
message: "已达到本品最大购买上限",
|
||||
message: '已达到本品最大购买上限',
|
||||
});
|
||||
} else {
|
||||
this.sales_num = parseInt(this.sales_num) + 1;
|
||||
@ -706,7 +623,7 @@ export default {
|
||||
// let mobile=JSON.parse(location.getItem('userInfo'));
|
||||
// console.log(userid,mobile);
|
||||
let basePoint = item.basePoint;
|
||||
basePoint = basePoint ? basePoint : 0;
|
||||
basePoint = basePoint?basePoint:0;
|
||||
let data = await postCourseId(
|
||||
item.productCode,
|
||||
this.sales_num,
|
||||
@ -735,6 +652,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 = [
|
||||
@ -753,6 +681,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",
|
||||
@ -775,12 +714,13 @@ export default {
|
||||
}
|
||||
},
|
||||
selectsearch(item, index) {
|
||||
if (!item.leftAllotment || item.leftAllotment <= 0) return;
|
||||
if(!item.leftAllotment || item.leftAllotment<=0)
|
||||
return;
|
||||
this.activeIndexa = index;
|
||||
this.curItem = item;
|
||||
this.productAttachmentList = item.productAttachmentList;
|
||||
this.crumbs.pop();
|
||||
this.crumbs.push({ title: item.productName });
|
||||
this.crumbs.push({title: item.productName});
|
||||
},
|
||||
},
|
||||
|
||||
|
@ -39,8 +39,8 @@
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
<div class="online rc-md-up"></div>
|
||||
<div class="ts-scrollable-container">
|
||||
<div class="online rc-md-up" v-if="!inRxGoods"></div>
|
||||
<div class="ts-scrollable-container" v-if="!inRxGoods">
|
||||
<h2>年龄:</h2>
|
||||
<ol class="ts-scrollable">
|
||||
<li
|
||||
@ -54,8 +54,8 @@
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
<div class="online rc-md-up"></div>
|
||||
<div class="ts-scrollable-container">
|
||||
<div class="online rc-md-up" v-if="!inRxGoods"></div>
|
||||
<div class="ts-scrollable-container" v-if="!inRxGoods">
|
||||
<h2>功能:</h2>
|
||||
<ol class="ts-scrollable">
|
||||
<li
|
||||
@ -69,8 +69,8 @@
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
<div class="online rc-md-up"></div>
|
||||
<div class="ts-scrollable-container">
|
||||
<div class="online rc-md-up" v-if="!inRxGoods"></div>
|
||||
<div class="ts-scrollable-container" v-if="!inRxGoods">
|
||||
<h2>品种:</h2>
|
||||
<ol class="ts-scrollable">
|
||||
<li
|
||||
@ -84,6 +84,20 @@
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
<div class="online rc-md-up" v-if="inRxGoods"></div>
|
||||
<div class="ts-scrollable-container" v-if="inRxGoods">
|
||||
<h2>功能:</h2>
|
||||
<ol class="ts-scrollable">
|
||||
<li
|
||||
v-for="(item, index) in rxFilters"
|
||||
:key="index"
|
||||
@click="selectFilter(item, index)"
|
||||
:class="item.checked ? 'active' : 'unactive'"
|
||||
>
|
||||
{{ item.tagName }}
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
<div class="online rc-md-up"></div>
|
||||
</div>
|
||||
</div>
|
||||
@ -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,7 +621,16 @@ 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;
|
||||
@ -713,7 +737,23 @@ 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;
|
||||
@ -725,6 +765,7 @@ export default {
|
||||
allSelectionEles.forEach(function(tmp,index){
|
||||
tmp.checked=false;
|
||||
});
|
||||
this.checkRxGoods(false);
|
||||
this.userserachlist = [
|
||||
{
|
||||
categoryName: [], //专区
|
||||
|
@ -1,44 +1,54 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="rc-padding-y--lg">
|
||||
<Myheader></Myheader>
|
||||
<div class="rc-top"></div>
|
||||
<div class="ts-banner-swiper-container">
|
||||
<img src="/images/userbanner.png" alt="" class="user-pc" />
|
||||
<img src="/images/rc-phone.png" alt="" class="user-phone" />
|
||||
<picture>
|
||||
<source
|
||||
media="(max-width: 768px)"
|
||||
srcset="/images/rc-phone.png"
|
||||
/>
|
||||
<source
|
||||
media="(min-width: 769px)"
|
||||
srcset="/images/userbanner.png"
|
||||
/>
|
||||
<img src="/images/banner/pc-weixin.png" />
|
||||
</picture>
|
||||
</div>
|
||||
<div class="all-contair">
|
||||
<div class="all-contair dog-foot">
|
||||
<h2>明星犬粮</h2>
|
||||
<img src="/images/dogfoot.png" alt="" />
|
||||
<strong>中型幼犬离乳期全家奶糕</strong>
|
||||
<p>
|
||||
中心犬离乳期专属<br />高易再水合颗粒<br />
|
||||
帮助增强保护健康成长
|
||||
</p>
|
||||
<em
|
||||
class="ts-standard-btn ts-standard-btn--two rc-margin-y--md center"
|
||||
@click="userselect(1)"
|
||||
<div>
|
||||
<ul class="ts-product-list rc-margin-bottom--lg">
|
||||
<li
|
||||
v-for="(item, index) in dataList.amature"
|
||||
:key="index"
|
||||
class="rc-margin-top--md"
|
||||
>
|
||||
点击查看
|
||||
</em>
|
||||
</div>
|
||||
<div class="all-contair cat-foot">
|
||||
<h2>明星猫粮</h2>
|
||||
<img src="/images/catfoot.png" alt="" />
|
||||
<strong>皇家离乳期幼猫全家奶糕</strong>
|
||||
<p>
|
||||
幼猫成长专属<br />
|
||||
支持幼猫自身保护力<br />
|
||||
为快速生长提供足够能量
|
||||
</p>
|
||||
<em
|
||||
class="ts-standard-btn ts-standard-btn--two rc-margin-y--md center"
|
||||
@click="userselect(2)"
|
||||
<h2 class="rc-beta rc-margin-y--md">{{ index==1?'明星猫粮':'明星犬粮' }}</h2>
|
||||
<div
|
||||
class="rc-click rc-margin-bottom--md"
|
||||
@click="selectproduce(item, index)"
|
||||
>
|
||||
点击查看
|
||||
</em>
|
||||
<div class="rc-rccontair">
|
||||
<img :src="item.productimage" alt="" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="rc-column">
|
||||
<div class="rc-click" @click="selectproduce(item, index)">
|
||||
<span>{{ item.title }}</span>
|
||||
<div class="desc">{{ item.detail }}</div>
|
||||
</div>
|
||||
<strong
|
||||
class="
|
||||
ts-standard-btn ts-standard-btn--two
|
||||
rc-margin-y--md
|
||||
center
|
||||
"
|
||||
@click="selectproduce(item, index)"
|
||||
>立即购买</strong
|
||||
>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="contair">
|
||||
<nuxt-link :to="`/productdetails/productlist/`">
|
||||
<span class="ts-standard-btn center">查看更多</span>
|
||||
@ -49,219 +59,72 @@
|
||||
|
||||
<script>
|
||||
import Myheader from "~/components/header.vue";
|
||||
import envData from "~/config/env-data.js";
|
||||
export default {
|
||||
data() {
|
||||
return {};
|
||||
return {
|
||||
envData,
|
||||
dataList:{amature:[]}
|
||||
};
|
||||
},
|
||||
components: {
|
||||
Myheader,
|
||||
},
|
||||
mounted(){
|
||||
let env=process.env.NODE_ENV;
|
||||
this.dataList=this.envData[env];
|
||||
},
|
||||
methods:{
|
||||
userselect(item){
|
||||
let productCode=88451
|
||||
if(item==1){
|
||||
|
||||
selectproduce(item) {
|
||||
let isRxGoods = false;
|
||||
let productCode = [];
|
||||
let mainProductCode = item.productCode;
|
||||
if (!item.ecPrice && !item.price) {
|
||||
isRxGoods = 1;
|
||||
productCode = [item.productCode];
|
||||
} else {
|
||||
for (let i of item.productList) {
|
||||
productCode.push(i.productCode);
|
||||
}
|
||||
}
|
||||
this.$router.push({
|
||||
path: "/productdetails/producted",
|
||||
query: {
|
||||
stype: 1,
|
||||
isRxGoods: false,
|
||||
productCode: '80240008F24',
|
||||
isRxGoods: isRxGoods,
|
||||
mainProductCode: mainProductCode,
|
||||
productCode: productCode.join(","),
|
||||
},
|
||||
});
|
||||
}else{
|
||||
this.$router.push({
|
||||
path: "/productdetails/producted",
|
||||
query: {
|
||||
stype: 1,
|
||||
isRxGoods: false,
|
||||
productCode: '80240008F24',
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped >
|
||||
@import url("../../assets/css/global.less");
|
||||
|
||||
//手机端
|
||||
@media screen and (max-width: 768px) {
|
||||
.user-pc {
|
||||
display: none;
|
||||
}
|
||||
.user-phone {
|
||||
display: block;
|
||||
height: 400px;
|
||||
}
|
||||
.contair {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
padding-bottom: 50px;
|
||||
margin-top: 100px;
|
||||
}
|
||||
|
||||
.ts-banner-swiper-container {
|
||||
.ts-banner-swiper-container {
|
||||
img {
|
||||
width: 100%;
|
||||
height: 500px;
|
||||
height: auto;
|
||||
object-fit: contain;
|
||||
}
|
||||
}
|
||||
.all-contair {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
img {
|
||||
width: 260px;
|
||||
height: 185px;
|
||||
display: block;
|
||||
}
|
||||
h2 {
|
||||
color: #e2001a;
|
||||
font-size: 20px;
|
||||
.ts-product-list li{
|
||||
border:none;
|
||||
max-width:22.75rem;
|
||||
min-width:22.75rem;
|
||||
width:22.75rem;
|
||||
h2{
|
||||
margin-left:auto;
|
||||
margin-right:auto;
|
||||
font-weight: bold;
|
||||
}
|
||||
strong {
|
||||
font-size: 16px;
|
||||
color: #e2001a;
|
||||
font-weight: bold;
|
||||
}
|
||||
p {
|
||||
color: #666666;
|
||||
font-size: 20px;
|
||||
margin-top: 13px;
|
||||
}
|
||||
.dog-foot {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
width: 48%;
|
||||
img {
|
||||
width: 260px;
|
||||
height: 185px;
|
||||
display: block;
|
||||
}
|
||||
p {
|
||||
color: #666666;
|
||||
font-size: 16px;
|
||||
margin-top: 15px;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
.cat-foot {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
width: 48%;
|
||||
img {
|
||||
width: 260px;
|
||||
height: 185px;
|
||||
display: block;
|
||||
}
|
||||
p {
|
||||
color: #666666;
|
||||
font-size: 16px;
|
||||
margin-top: 15px;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (min-width: 769px) {
|
||||
.user-phone {
|
||||
display: none;
|
||||
}
|
||||
.contair {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
padding-bottom: 106px;
|
||||
margin-top: 206px;
|
||||
.ts-standard-btn {
|
||||
width: 271px;
|
||||
height: 83px;
|
||||
background: #e2001a;
|
||||
opacity: 1;
|
||||
border-radius: 30px;
|
||||
font-size: 29px;
|
||||
color: #ffffff;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
|
||||
.ts-banner-swiper-container {
|
||||
img {
|
||||
width: 100%;
|
||||
height: 500px;
|
||||
}
|
||||
}
|
||||
.all-contair {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-top: 70px;
|
||||
img {
|
||||
width: 371px;
|
||||
height: 525px;
|
||||
display: block;
|
||||
}
|
||||
h2 {
|
||||
color: #e2001a;
|
||||
font-size: 83px;
|
||||
}
|
||||
strong {
|
||||
font-size: 52px;
|
||||
color: #e2001a;
|
||||
}
|
||||
p {
|
||||
color: #666666;
|
||||
font-size: 40px;
|
||||
margin-top: 33px;
|
||||
}
|
||||
.dog-foot {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
width: 48%;
|
||||
img {
|
||||
width: 371px;
|
||||
height: 525px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
}
|
||||
.cat-foot {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
width: 48%;
|
||||
img {
|
||||
width: 371px;
|
||||
height: 525px;
|
||||
display: block;
|
||||
}
|
||||
p {
|
||||
color: #666666;
|
||||
font-size: 40px;
|
||||
margin-top: 33px;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
.ts-standard-btn {
|
||||
width: 270px;
|
||||
height: 83px;
|
||||
border: 2px solid #e2001a;
|
||||
border-radius: 30px;
|
||||
color: #e2001a;
|
||||
font-size: 29px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
.rc-column span {
|
||||
height:auto;
|
||||
}
|
||||
.desc {
|
||||
width:13rem;
|
||||
height:auto;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -144,10 +144,12 @@
|
||||
<script>
|
||||
import { userLongin,sendMsg,vadatnmsg,userregOrLogin,inserdiscount } from "../../ajax/getData";
|
||||
import { mapMutations } from "vuex";
|
||||
import envData from "~/config/env-data.js";
|
||||
import Myheader from "~/components/header.vue"; //引用头部公共组件
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
envData,
|
||||
phone: "",
|
||||
layerMSg: "手机格式不对",
|
||||
tel: "",
|
||||
@ -228,7 +230,7 @@ export default {
|
||||
//全选
|
||||
checkBoxa(e,order){
|
||||
let checked=e.target.checked;
|
||||
console.log(e.target.checked);
|
||||
// console.log(e.target.checked);
|
||||
// this.isRank=e.target.checked;
|
||||
// this.isRanka=e.target.checked;
|
||||
if(order==3){
|
||||
@ -241,7 +243,7 @@ export default {
|
||||
else if(order==1){
|
||||
this.isRanka=e.target.checked;
|
||||
}
|
||||
console.log(this.isRank,this.isRanka);
|
||||
//console.log(this.isRank,this.isRanka);
|
||||
if(this.isRanka==true && this.isRank==true){
|
||||
this.allcheck=true;
|
||||
}else{
|
||||
@ -268,7 +270,7 @@ export default {
|
||||
//console.log("-----");
|
||||
let data = await sendMsg(this.tel);
|
||||
if(data){
|
||||
console.log(data);
|
||||
//console.log(data);
|
||||
//this.captchadata=data.msgNum;
|
||||
this.tamp=data.tamp;
|
||||
this.hash=data.hash;
|
||||
@ -280,7 +282,7 @@ export default {
|
||||
async serdiscount (mobile,couponId) {
|
||||
let data = await inserdiscount(mobile,couponId);
|
||||
if(data){
|
||||
console.log(data);
|
||||
|
||||
}
|
||||
//console.log(data);
|
||||
},
|
||||
@ -292,26 +294,22 @@ export default {
|
||||
if(data){
|
||||
return data;
|
||||
}
|
||||
|
||||
},
|
||||
//登录成功数据
|
||||
async userlogin() {
|
||||
//console.log("-----");
|
||||
let data= await userregOrLogin(this.tel);
|
||||
if(data){
|
||||
this.userislogin=data;
|
||||
console.log(this.userislogin);
|
||||
//console.log(this.userislogin);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
onClickHander(e) {
|
||||
console.log(e);
|
||||
//console.log(e);
|
||||
},
|
||||
selectGoods(item, index) {
|
||||
this.activeIndex = index;
|
||||
console.log(index);
|
||||
|
||||
if (this.activeIndex == 0) {
|
||||
this.ifpassword = false;
|
||||
} else {
|
||||
@ -320,7 +318,6 @@ export default {
|
||||
},
|
||||
//注册账户
|
||||
useredd() {
|
||||
//console.log("---注册账户");
|
||||
this.usertitle = false;
|
||||
},
|
||||
|
||||
@ -336,7 +333,7 @@ export default {
|
||||
getCode() {
|
||||
if (!/^[1][3,4,5,7,8][0-9]{9}$/.test(this.tel) || this.tel === "") {
|
||||
this.$message({
|
||||
type: 'warning',
|
||||
type: 'error',
|
||||
message: '手机号码输入有误'
|
||||
});
|
||||
return
|
||||
@ -361,79 +358,84 @@ export default {
|
||||
async register() {
|
||||
if (!/^[1][3,4,5,7,8][0-9]{9}$/.test(this.tel) || this.tel === "") {
|
||||
this.$message({
|
||||
type: 'warning',
|
||||
type: 'error',
|
||||
message: '手机号码输入有误'
|
||||
});
|
||||
return
|
||||
}
|
||||
if(this.sms==''){
|
||||
this.$message({
|
||||
type: 'warning',
|
||||
type: 'error',
|
||||
message: '请输入验证码'
|
||||
});
|
||||
return
|
||||
}
|
||||
if(this.usercheckbox==false){
|
||||
this.$message({
|
||||
type: 'warning',
|
||||
type: 'error',
|
||||
message: '请先勾选相关协议'
|
||||
});
|
||||
return
|
||||
}
|
||||
if(this.usercheckbox==false){
|
||||
//console.log('----');
|
||||
if (!/^[1][3,4,5,7,8][0-9]{9}$/.test(this.tel) || this.tel === "") {
|
||||
this.$message({
|
||||
type: 'warning',
|
||||
type: 'error',
|
||||
message: '手机号码输入有误'
|
||||
});
|
||||
this.$message({
|
||||
type: 'warning',
|
||||
type: 'error',
|
||||
message: '请先同意隐私声明和账号使用协议'
|
||||
});
|
||||
return
|
||||
}
|
||||
}
|
||||
else{
|
||||
console.log('===')
|
||||
let data=await this.vadmsg();
|
||||
if(data.code=="1")
|
||||
{
|
||||
data = await userregOrLogin(this.tel);
|
||||
console.log(data);
|
||||
let token=JSON.stringify(data);
|
||||
this.changeClod({ cloud: token });
|
||||
this.checkIsLogin();
|
||||
if(data.type==1){
|
||||
let returnMessage='';
|
||||
if(data.type==1) {
|
||||
if(data.data.memberName===undefined){
|
||||
this.$message({
|
||||
type: 'warning',
|
||||
message: '欢迎回来'
|
||||
});
|
||||
console.log('-----')
|
||||
returnMessage = '欢迎回来';
|
||||
}
|
||||
else{
|
||||
this.$message({
|
||||
type: 'warning',
|
||||
message: '欢迎回来'+data.data.memberName
|
||||
});
|
||||
returnMessage = '欢迎回来'+data.data.memberName;
|
||||
}
|
||||
}else if(data.type==2){
|
||||
this.$message({
|
||||
type: 'warning',
|
||||
message: '恭喜注册成功'
|
||||
});
|
||||
let couponId='0000000123';
|
||||
_hmt.push([
|
||||
"_trackCustomEvent",
|
||||
"login",
|
||||
{}
|
||||
])
|
||||
} else if(data.type==2) {
|
||||
returnMessage = '恭喜注册成功';
|
||||
_hmt.push([
|
||||
"_trackCustomEvent",
|
||||
"register",
|
||||
{}
|
||||
])
|
||||
|
||||
let curEnv = process.env.NODE_ENV;
|
||||
let newGuestCouponCodes = envData[curEnv].newGuestCoupon;
|
||||
let couponId=newGuestCouponCodes[0];
|
||||
this.serdiscount(this.tel,couponId);
|
||||
setTimeout(() => {
|
||||
this.serdiscount(this.tel,"0000000140");
|
||||
this.serdiscount(this.tel,newGuestCouponCodes[1]);
|
||||
}, 100);
|
||||
setTimeout(() => {
|
||||
this.serdiscount(this.tel,"0000000122");
|
||||
this.serdiscount(this.tel,newGuestCouponCodes[2]);
|
||||
}, 500);
|
||||
setTimeout(() => {
|
||||
this.serdiscount(this.tel,newGuestCouponCodes[3]);
|
||||
}, 500);
|
||||
}
|
||||
this.$router.push({
|
||||
path: "/",
|
||||
query:{msg:returnMessage}
|
||||
});
|
||||
}else{
|
||||
this.$message({
|
||||
|
@ -78,7 +78,7 @@
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
<div class="ts-scrollable-container">
|
||||
<div class="ts-scrollable-container" v-if="!inRxGoods">
|
||||
<h2>年龄:</h2>
|
||||
<ol class="ts-scrollable">
|
||||
<li
|
||||
@ -92,6 +92,21 @@
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
<div class="ts-scrollable-container" v-if="inRxGoods">
|
||||
<h2>功能:</h2>
|
||||
<ol class="ts-scrollable">
|
||||
<li
|
||||
v-for="(item, index) in rxFilters"
|
||||
:key="index"
|
||||
@click="selectFilter(item, index)"
|
||||
:class="item.checked ? 'active' : 'unactive'"
|
||||
>
|
||||
{{ item.tagName }}
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -177,7 +192,7 @@
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
<div class="ts-scrollable-container">
|
||||
<div class="ts-scrollable-container" v-if="!inRxGoods">
|
||||
<h2>年龄:</h2>
|
||||
<ol class="ts-scrollable">
|
||||
<li
|
||||
@ -191,7 +206,7 @@
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
<div class="ts-scrollable-container">
|
||||
<div class="ts-scrollable-container" v-if="!inRxGoods">
|
||||
<h2>功能:</h2>
|
||||
<ol class="ts-scrollable">
|
||||
<li
|
||||
@ -205,7 +220,7 @@
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
<div class="ts-scrollable-container">
|
||||
<div class="ts-scrollable-container" v-if="!inRxGoods">
|
||||
<h2>品种:</h2>
|
||||
<ol class="ts-scrollable">
|
||||
<li
|
||||
@ -220,6 +235,20 @@
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
<div class="ts-scrollable-container" v-if="inRxGoods">
|
||||
<h2>功能:</h2>
|
||||
<ol class="ts-scrollable">
|
||||
<li
|
||||
v-for="(item, index) in rxFilters"
|
||||
:key="index"
|
||||
@click="selectFilter(item, index)"
|
||||
:class="item.checked ? 'active' : 'unactive'"
|
||||
>
|
||||
{{ item.tagName }}
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -263,7 +292,7 @@
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
<div class="ts-scrollable-container">
|
||||
<div class="ts-scrollable-container" v-if="!inRxGoods">
|
||||
<h2>年龄:</h2>
|
||||
<ol class="ts-scrollable">
|
||||
<li
|
||||
@ -277,7 +306,7 @@
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
<div class="ts-scrollable-container">
|
||||
<div class="ts-scrollable-container" v-if="!inRxGoods">
|
||||
<h2>功能:</h2>
|
||||
<ol class="ts-scrollable">
|
||||
<li
|
||||
@ -291,7 +320,7 @@
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
<div class="ts-scrollable-container">
|
||||
<div class="ts-scrollable-container" v-if="!inRxGoods">
|
||||
<h2>品种:</h2>
|
||||
<ol class="ts-scrollable">
|
||||
<li
|
||||
@ -305,6 +334,19 @@
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
<div class="ts-scrollable-container" v-if="inRxGoods">
|
||||
<h2>功能:</h2>
|
||||
<ol class="ts-scrollable">
|
||||
<li
|
||||
v-for="(item, index) in rxFilters"
|
||||
:key="index"
|
||||
@click="selectFilter(item, index)"
|
||||
:class="item.checked ? 'active' : 'unactive'"
|
||||
>
|
||||
{{ item.tagName }}
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--
|
||||
@ -331,16 +373,19 @@ 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 { biaome, userstype, searchchanpin, userquery } from "../../ajax/getData";
|
||||
import { biaome, userstype, searchchanpin, userquery, userque } from "../../ajax/getData";
|
||||
import envData from "~/config/env-data.js";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
value: "",
|
||||
envData,
|
||||
crumbs:[
|
||||
{
|
||||
path:'/usersearch/search/',
|
||||
}
|
||||
],
|
||||
rxFilters:[],
|
||||
isLoading: true,
|
||||
userserachlist: [
|
||||
{
|
||||
@ -528,6 +573,10 @@ export default {
|
||||
mounted() {
|
||||
this.usetmessage();
|
||||
this.userst();
|
||||
//Handling RxGoods filter
|
||||
let curEnv = process.env.NODE_ENV;
|
||||
this.rxFilters = envData[curEnv].rxGoodsFilter;
|
||||
//Handling RxGoods filter end
|
||||
},
|
||||
methods: {
|
||||
//换一批
|
||||
@ -605,6 +654,15 @@ export default {
|
||||
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;
|
||||
}
|
||||
},
|
||||
async userst() {
|
||||
this.isLoading = true;
|
||||
let pinzhong = [];
|
||||
@ -721,6 +779,19 @@ export default {
|
||||
this.inRxGoods=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;
|
||||
@ -731,6 +802,7 @@ export default {
|
||||
allSelectionEles.forEach(function(tmp,index){
|
||||
tmp.checked=false;
|
||||
});
|
||||
this.checkRxGoods(false);
|
||||
this.userserachlist = [
|
||||
{
|
||||
categoryName: [], //专区
|
||||
|
BIN
rc-busness/static/images/qrcode-minishop.png
Normal file
BIN
rc-busness/static/images/qrcode-minishop.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 101 KiB |
@ -12,7 +12,8 @@ Vue.prototype.formatConversion = function (te){
|
||||
var h = time.getHours() < 10 ? '0' + time.getHours() : time.getHours();
|
||||
var mm = time.getMinutes() < 10 ? '0' + time.getMinutes() : time.getMinutes();
|
||||
var s = time.getSeconds() < 10 ? '0' + time.getSeconds() : time.getSeconds();
|
||||
var timedate = y + '-' + m + '-' + d + ' ' + h + ':' + mm + ':' + s;
|
||||
//var timedate = y + '-' + m + '-' + d + ' ' + h + ':' + mm + ':' + s;
|
||||
var timedate = y + '-' + m + '-' + d;
|
||||
return timedate;
|
||||
}else{
|
||||
var time = new Date(te);
|
||||
@ -22,7 +23,8 @@ Vue.prototype.formatConversion = function (te){
|
||||
var h = time.getHours() < 10 ? '0' + time.getHours() : time.getHours();
|
||||
var mm = time.getMinutes() < 10 ? '0' + time.getMinutes() : time.getMinutes();
|
||||
var s = time.getSeconds() < 10 ? '0' + time.getSeconds() : time.getSeconds();
|
||||
var timedate = y + '-' + m + '-' + d + ' ' + h + ':' + mm + ':' + s;
|
||||
//var timedate = y + '-' + m + '-' + d + ' ' + h + ':' + mm + ':' + s;
|
||||
var timedate = y + '-' + m + '-' + d;
|
||||
return timedate;
|
||||
}
|
||||
}
|
@ -325,9 +325,7 @@
|
||||
<properties>
|
||||
<profiles.active>dev</profiles.active>
|
||||
</properties>
|
||||
<activation>
|
||||
<activeByDefault>true</activeByDefault>
|
||||
</activation>
|
||||
|
||||
</profile>
|
||||
<profile>
|
||||
<id>telework</id>
|
||||
@ -352,6 +350,9 @@
|
||||
<properties>
|
||||
<profiles.active>prod</profiles.active>
|
||||
</properties>
|
||||
<activation>
|
||||
<activeByDefault>true</activeByDefault>
|
||||
</activation>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
|
@ -17,7 +17,6 @@ import java.util.UUID;
|
||||
@Service
|
||||
public class AliPayService {
|
||||
|
||||
public static String notify_url = "http://47.96.75.242:10086/smart-admin-api/royalcanin/updateOrderAliPay";
|
||||
|
||||
@Autowired
|
||||
private OrderService orderService;
|
||||
@ -34,7 +33,7 @@ public class AliPayService {
|
||||
model.setGoodsDetail(aliPayEntity.getGoodsDetail());
|
||||
AlipayTradePrecreateRequest request = new AlipayTradePrecreateRequest();
|
||||
request.setBizModel(model);
|
||||
request.setNotifyUrl(notify_url);
|
||||
request.setNotifyUrl(AlipayConfig.notify_url);
|
||||
AlipayClient alipayClient = new DefaultAlipayClient(AlipayConfig.gatewayUrl, AlipayConfig.app_id, AlipayConfig.merchant_private_key, "json", AlipayConfig.charset, AlipayConfig.alipay_public_key, AlipayConfig.sign_type);
|
||||
AlipayTradePrecreateResponse alipayTradePrecreateResponse = alipayClient.execute(request);
|
||||
if (alipayTradePrecreateResponse.isSuccess()) {
|
||||
|
@ -26,6 +26,7 @@ import net.lab1024.smartadmin.module.system.royalcanin.notify.service.NotifyServ
|
||||
import net.lab1024.smartadmin.util.MapRemoveNullUtil;
|
||||
import net.lab1024.smartadmin.util.SmartHttpUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
@ -47,7 +48,8 @@ public class AlipayController {
|
||||
@Autowired
|
||||
private OrderService orderService;
|
||||
|
||||
String url = "https://miniapp-test.royalcanin.com.cn/rcmini/h5/";
|
||||
@Value("${royalcanin.goods}")
|
||||
private String url ;
|
||||
|
||||
@Autowired
|
||||
private MemberAccountService memberAccountService;
|
||||
|
@ -20,6 +20,7 @@ public class AlipayConfig {
|
||||
// 应用ID,您的APPID,收款账号既是您的APPID对应支付宝账号
|
||||
// public static String app_id = "2016101800716209";
|
||||
public static String app_id = "2021003108690157";
|
||||
// public static String app_id = "2088341384149564";
|
||||
|
||||
// 商户私钥,您的PKCS8格式RSA2私钥
|
||||
// public static String merchant_private_key = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDL8350XEsOVVSg8+cKZEl6Jx7Tp63JFimk+lldS8chZ8hv3Netz5iMemQJYH328VEB5sKkIXfDiwT1fxR2cgsGdQgmG25omKM/47QfxTRp9C4II65AlMfLsPWOWefc/enaza/gMMzB5SvvFnbpX/71aJmqU7nJvATY8MwW4SxKXKMTEI/K7+jERReR4SxtGHeFTZ892ljr7IOqJbGPnd2CXzLO05AGGhOrsmtFMh9eysD1WzcDKoADJSi26oMI49mExGo3jMF111AcXSR4CgLsx5bSoe4XtXtVbqEr/tOCt4zAWoUbu/Mviog+60eMr9qaE719aobEZP7aI5ECd86NAgMBAAECggEAXRVBtqvU2bLaUCdhYF3LJ0QpjqIt7+P8l75nAOyv8rAiS+O4UCy6TAskEx+F/im/NiXy2eQofAe7+KvKVBDStVy+nl3Qs05O2776G7HurRjz1WUrh3AgC/g06oZgC32buPA9gA3ltez5c0KGfRcCD1FxKMrTtZ3pfHXSP/L/OuRhobxCZvEL5jcWHkxgOeaL37+UQSHJe3dhCPjjj1VOxBj0RLgcAPJ8/KoglcmWHacYvPxgRo26xahrW3yCofcb+cEzG5WhCc3uBK3eSWNB1knSwl2gVMcGmN8gOPBpAneSjqv6pqWUqgAOENxi2kRZYDyTNi3JHt2ZJMdDblU8AQKBgQD2Z+CjGGloaQTvcow/dqxF4a5EAnjeUSA+cdw7ttNqvszNofjvxv9RULKIf8jgrkO9cE5X9ezqHXaWOspyXbFhmPFginH9N5tTGggrzCpeHs7jW3EZKiYJIl2MRzxMVx1jaN8EfT8Z3u/4Ca/QwPvsGNj/Er7kwqLUvkGsLeOHjQKBgQDT5G/8R/T2LqJUvFiKntfY830WVAD9vUGst68ouxfaQKj2IOlOedjvQwRcInOX3GFnQyw8ncWOIZDQOnJdYpQdjQAx3queHmv8toCp+MKyPLLYJYu4LP6ahT/9vd9G9r0QUo57n75sVOcT5tj9ZKdykchPUWe1T02LEUZPxDwjAQKBgQCnf7meZMvSpAEs3EsmIP++iUkzBhMv3Sn0COZS2VciKw2Bg2d7Z2TL2/VhAKyGvy9hKWS4On6QLvMb8F8KG1KnK5Z5r+MI5LH7bai8TQ9H591vhAt/tb0hXHEHGK2On3Fk0Dc6EAHDDl9F1x/i4izeM43e5tlJHF4gDC0MZC1VSQKBgQDMS1yZXXtV/GJw1mN7y2iK+T/qTjXibx2p/DO6TqDRwjPlkpe/HQXGsdO7TVAr48RZvk8hZnB59+zahu+LECeEUlUUv/6xZd1x+zgUKQ72sEUy1wheG6uiqcSnzfA/SFfDLAXKNZtwcW+WJaWisfAsK1h4+SDHk91MruwerjHZAQKBgH6muiaSlg6DvAUBjtxaOE0bgchI+M/j7N4289syb/6A0iTUNeTREWk2kmBT/ZeZCFtrjJx+TdVauyjkRwKx0wEuf9H+WrUM+6i5j5nTrcUEAUTjCY7IRxGk8uhNLM7cyBNvpsD4olI5j2DmRsZWnv/bNuJH2FHbvXMwanZ22vM5";
|
||||
@ -27,7 +28,8 @@ public class AlipayConfig {
|
||||
// 支付宝公钥,查看地址:https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
|
||||
// public static String alipay_public_key ="MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjBThgyJ3SJsx0IYUspiW+R/NDInruz2Tirr0vGmzfaNkBSDmyg2vNLmnkNrxbHApJkIRKWqGbC8yPybyjFz1nXP7oji0d/3sPKZZGdNEqOcZLaki8xPeXfOVu1T/uPH/9S084t94yQPNrD9BqehOlN+I4b/mXJ7tDGRnS2OVrQqDrPbg8pjH3OYa0bELkr71R92EHxCN4V2bSdCS1ag96/etgkodduOCmiBPVSmSRXas/GpRw92NVsRKvesWOatfjEjqST0Bz0nRuOuRnQIy1exxs/D2DHCVa6aO6TNogcPWe3C9dvxjxjw9IOiyhkGThWoWrdk8Ot+V8V8LeomcYwIDAQAB";
|
||||
// public static String alipay_public_key ="MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAr+fwsHUR8dosvQlrQk1uKu8bzWtt4BHRIK4PsY5IVPUuk/NbcSXH9HC/tyj/L4L68/9pxteG7nGMioveqSMx8d5jhf/1sHsBC2C/BiffjzfiaeKsPqIag2jM0GNVFnrtmx1xeKYwx8T3X87BH7T4lcrOqsjt7JCtXDgWlttEpiIJTLTPOgtMlFPLkwvvp/Dlc0f+t2Bo9bHaCkrOkq3AC9TACEzXCVBKIP670MD0rTLnCEr3E/9oKzQazcCydzj548LAmwSQ660Wh+w6pZrL8p43ODski4sbl5ulidw7MklDHKOdZFj/tWf2NqMQjmAdmthZ5oGilJhiLvHiUR1YyQIDAQAB";
|
||||
public static String alipay_public_key = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCnxj/9qwVfgoUh/y2W89L6BkRAFljhNhgPdyPuBV64bfQNN1PjbCzkIM6qRdKBoLPXmKKMiFYnkd6rAoprih3/PrQEB/VsW8OoM8fxn67UDYuyBTqA23MML9q1+ilIZwBC2AQ2UBVOrFXfFl75p6/B5KsiNG9zpgmLCUYuLkxpLQIDAQAB";
|
||||
public static String alipay_public_key = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC9yEe5sOFYFmEW0GdVCyvuU5vXCLsk2lwWmfC/bh/kcjBaBNTaFSiuG1VFPWsNIKWEHLdbEwMQnq4WxhqYN741wXxJlOpvsECFYtGSL6szx7BDaTYATQGVk963SeKYplz5ZPlXg1QiKgcqS3brvnpxxtcS1JKCJ/6iJXJkZXxK2QIDAQAB";
|
||||
// public static String alipay_public_key = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCnxj/9qwVfgoUh/y2W89L6BkRAFljhNhgPdyPuBV64bfQNN1PjbCzkIM6qRdKBoLPXmKKMiFYnkd6rAoprih3/PrQEB/VsW8OoM8fxn67UDYuyBTqA23MML9q1+ilIZwBC2AQ2UBVOrFXfFl75p6/B5KsiNG9zpgmLCUYuLkxpLQIDAQAB";
|
||||
// 服务器异步通知页面路径 需http://格式的完整路径,不能加?id=123这类自定义参数,必须外网可以正常访问
|
||||
public static String notify_url = "https://royalcanincn.escase.cn/jc/royalcanin/royalcanin/updateOrderAliPay";
|
||||
// 页面跳转同步通知页面路径 需http://格式的完整路径,不能加?id=123这类自定义参数,必须外网可以正常访问
|
||||
|
@ -38,7 +38,8 @@ import java.util.UUID;
|
||||
@Service
|
||||
public class LoginTokenService {
|
||||
|
||||
private String url = "http://miniapp-test.royalcanin.com.cn:7080/crm/member/";
|
||||
@Value("${royalcanin.member}")
|
||||
private String url;
|
||||
|
||||
/**
|
||||
* 过期时间一天
|
||||
|
@ -5,15 +5,16 @@ import net.lab1024.smartadmin.module.system.royalcanin.couponConfig.CouponConfig
|
||||
import net.lab1024.smartadmin.module.system.royalcanin.couponConfig.CouponConfigGetEntity;
|
||||
import net.lab1024.smartadmin.util.MapRemoveNullUtil;
|
||||
import net.lab1024.smartadmin.util.SmartHttpUtil;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
public class CouponConfigService {
|
||||
|
||||
private String url = "http://miniapp-test.royalcanin.com.cn:7080/crm/couponConfig/";
|
||||
@Value("${royalcanin.couponconfig}")
|
||||
private String url ;
|
||||
|
||||
public String couponConfigGet(CouponConfigGetEntity couponConfigGetEntity) throws Exception{
|
||||
Map<String, String> paramMap = MapRemoveNullUtil.setConditionMap(couponConfigGetEntity);
|
||||
|
@ -4,15 +4,17 @@ import net.lab1024.smartadmin.common.heartbeat.StringUtil;
|
||||
import net.lab1024.smartadmin.module.system.royalcanin.coupon.*;
|
||||
import net.lab1024.smartadmin.util.MapRemoveNullUtil;
|
||||
import net.lab1024.smartadmin.util.SmartHttpUtil;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
public class CouponService {
|
||||
|
||||
private String url = "http://miniapp-test.royalcanin.com.cn:7080/crm/coupon/";
|
||||
|
||||
@Value("${royalcanin.coupon}")
|
||||
private String url ;
|
||||
|
||||
public String couponCancel(CouponCancelEntity couponCancelEntity) throws Exception{
|
||||
Map<String, String> paramMap = MapRemoveNullUtil.setConditionMap(couponCancelEntity);
|
||||
|
@ -5,9 +5,9 @@ import net.lab1024.smartadmin.module.system.royalcanin.memberAccount.MemberAccou
|
||||
import net.lab1024.smartadmin.module.system.royalcanin.memberAccount.MemberAccountHistoryEntity;
|
||||
import net.lab1024.smartadmin.util.MapRemoveNullUtil;
|
||||
import net.lab1024.smartadmin.util.SmartHttpUtil;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@ -16,7 +16,8 @@ import java.util.Map;
|
||||
@Service
|
||||
public class MemberAccountService {
|
||||
|
||||
private String url = "http://miniapp-test.royalcanin.com.cn:7080/crm/memberAccount/";
|
||||
@Value("${royalcanin.memberaccount}")
|
||||
private String url ;
|
||||
|
||||
public String memberAccountChange(MemberAccountChangeEntity memberAccountChangeEntity){
|
||||
memberAccountChangeEntity.setChannelId(15);
|
||||
|
@ -7,16 +7,16 @@ import net.lab1024.smartadmin.module.system.royalcanin.memberAddress.MemberAddre
|
||||
import net.lab1024.smartadmin.module.system.royalcanin.memberAddress.MemberAddressUpdateEntity;
|
||||
import net.lab1024.smartadmin.util.MapRemoveNullUtil;
|
||||
import net.lab1024.smartadmin.util.SmartHttpUtil;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
public class MemberAddressService {
|
||||
private String url = "http://miniapp-test.royalcanin.com.cn:7080/crm/memberAddress/";
|
||||
|
||||
@Value("${royalcanin.memberaddress}")
|
||||
private String url ;
|
||||
|
||||
public String membberAddressGetAll(MemberAddressGetAllEntity memberAddressGetAllEntity) throws Exception {
|
||||
Map<String, String> paramMap = MapRemoveNullUtil.setConditionMap(memberAddressGetAllEntity);
|
||||
@ -24,14 +24,14 @@ public class MemberAddressService {
|
||||
return SmartHttpUtil.sendPostForm(url+"getAll",paramMap,null);
|
||||
}
|
||||
|
||||
public String memberAddressAdd(MemberAddressAddEntity memberAddressAddEntity) throws Exception{
|
||||
public String memberAddressAdd(MemberAddressAddEntity memberAddressAddEntity) {
|
||||
Map<String, String> paramMap = MapRemoveNullUtil.setConditionMap(memberAddressAddEntity);
|
||||
MapRemoveNullUtil.removeNullEntry(paramMap);
|
||||
net.sf.json.JSONObject jsonObject = net.sf.json.JSONObject.fromObject(paramMap);
|
||||
return SmartHttpUtil.httpPostRaw(url+"add",jsonObject.toString(),null,"utf-8");
|
||||
}
|
||||
|
||||
public String memberAddressUpdate(MemberAddressUpdateEntity memberAddressUpdateEntity) throws Exception{
|
||||
public String memberAddressUpdate(MemberAddressUpdateEntity memberAddressUpdateEntity){
|
||||
Map<String, String> paramMap = MapRemoveNullUtil.setConditionMap(memberAddressUpdateEntity);
|
||||
paramMap.put("id",StringUtil.toString(memberAddressUpdateEntity.equals("0")?null:StringUtil.toString(memberAddressUpdateEntity.getId())));
|
||||
MapRemoveNullUtil.removeNullEntry(paramMap);
|
||||
|
@ -6,20 +6,15 @@ import net.lab1024.smartadmin.module.system.royalcanin.member.*;
|
||||
import net.lab1024.smartadmin.util.MapRemoveNullUtil;
|
||||
import net.lab1024.smartadmin.util.SmartJWTUtil;
|
||||
import net.lab1024.smartadmin.util.SmartHttpUtil;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
public class MemberService {
|
||||
private String url = "http://miniapp-test.royalcanin.com.cn:7080/crm/member/";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Value("${royalcanin.member}")
|
||||
private String url ;
|
||||
|
||||
public String memberGet(MemberGetEntity memberGetEntity)throws Exception {
|
||||
Map<String, String> paramMap = MapRemoveNullUtil.setConditionMap(memberGetEntity);
|
||||
|
@ -73,13 +73,13 @@ public class TransitionController {
|
||||
switch (type)
|
||||
{
|
||||
case "get":
|
||||
result = memberService.memberGet(objectMapper.convertValue(object,MemberGetEntity.class)).toString();
|
||||
result = memberService.memberGet(objectMapper.convertValue(object,MemberGetEntity.class));
|
||||
break;
|
||||
case "check":
|
||||
result = memberService.memberCheck(objectMapper.convertValue(object,MemberCheckEntity.class));
|
||||
break;
|
||||
case "add":
|
||||
result = memberService.memberAdd(objectMapper.convertValue(object,MemberAddEntity.class)).toString();
|
||||
result = memberService.memberAdd(objectMapper.convertValue(object,MemberAddEntity.class));
|
||||
break;
|
||||
case "updateMemberLevel":
|
||||
result = memberService.memberUpdateMemberLevel(objectMapper.convertValue(object, MemberUpdateMemberLevelEntity.class));
|
||||
|
@ -2,7 +2,6 @@ package net.lab1024.smartadmin.module.system.royalcanin.good;
|
||||
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import net.lab1024.smartadmin.common.anno.OperateLog;
|
||||
@ -118,16 +117,21 @@ public class GoodController {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
String result = "";
|
||||
try{
|
||||
long startTime = System.currentTimeMillis();
|
||||
String result = goodService.brandQuery(productQueryEntity);
|
||||
result = goodService.brandQuery(productQueryEntity);
|
||||
long acceptTime = System.currentTimeMillis() ;
|
||||
long elapsedTime = acceptTime - startTime;
|
||||
//记录服务响应时间
|
||||
addOperatreFullData("royalcanin/h5/product/query",result.length()+"", startTime,elapsedTime,acceptTime,result.length() >0 ?"1":"0",result.length() >0 ?"SUCCESS":"FAIL");
|
||||
return result;
|
||||
}catch (Exception e){
|
||||
System.out.println(e.getMessage());
|
||||
}finally {
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询商品信息", notes = "查询商品信息")
|
||||
|
@ -3,7 +3,6 @@ package net.lab1024.smartadmin.module.system.royalcanin.good;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alipay.api.internal.util.AlipaySignature;
|
||||
import com.beust.jcommander.Parameter;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import net.lab1024.smartadmin.common.anno.OperateLog;
|
||||
@ -19,7 +18,6 @@ import net.lab1024.smartadmin.module.system.royalcanin.good.constant.OrderRespon
|
||||
import net.lab1024.smartadmin.module.system.royalcanin.good.model.OrderAddress;
|
||||
import net.lab1024.smartadmin.module.system.royalcanin.good.model.OrderEntity;
|
||||
import net.lab1024.smartadmin.module.system.royalcanin.good.model.OrdersEntity;
|
||||
import net.lab1024.smartadmin.module.system.royalcanin.good.model.ProductMasterQueryEntity;
|
||||
import net.lab1024.smartadmin.module.system.royalcanin.good.service.CartService;
|
||||
import net.lab1024.smartadmin.module.system.royalcanin.good.service.OrderService;
|
||||
import net.lab1024.smartadmin.module.system.royalcanin.orderMaster.OrderDatilListEntity;
|
||||
@ -28,18 +26,13 @@ import net.lab1024.smartadmin.module.system.wxpay.MyConfig;
|
||||
import net.lab1024.smartadmin.module.system.wxpay.WxpayService;
|
||||
import net.lab1024.smartadmin.module.system.wxpay.wxPayModel.WxPayEntity;
|
||||
import net.lab1024.smartadmin.util.GenerateSequenceUtil;
|
||||
import net.lab1024.smartadmin.util.MapRemoveNullUtil;
|
||||
import net.lab1024.smartadmin.util.SmartHttpUtil;
|
||||
import net.sf.json.JSONArray;
|
||||
import org.apache.http.client.methods.HttpPost;
|
||||
import org.apache.http.client.utils.URLEncodedUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.*;
|
||||
|
||||
@Api(tags = {SwaggerTagConst.Admin.MANAGER_MALL_API})
|
||||
@ -77,48 +70,51 @@ public class OrderController {
|
||||
JSONArray orderDatilListJson = new JSONArray();
|
||||
OrdersEntity ordersEntity = new OrdersEntity();
|
||||
OrderAddress orderAddress = new OrderAddress();
|
||||
for (OrdersEntity ordersEntitys:ordersEntityList) {
|
||||
cartService.cancelProduct(ordersEntitys.getMemberId(),ordersEntity.getProductCode());
|
||||
try {
|
||||
for (OrdersEntity ordersEntitys : ordersEntityList) {
|
||||
// System.out.println("ordersEntityList.size()"+ordersEntityList.size());
|
||||
cartService.cancelProduct(ordersEntitys.getMemberId(), ordersEntity.getProductCode());
|
||||
//存储orderDetailList
|
||||
OrderDatilListEntity orderDatilListEntity= new OrderDatilListEntity();
|
||||
OrderDatilListEntity orderDatilListEntity = new OrderDatilListEntity();
|
||||
orderDatilListEntity.setProductName(ordersEntitys.getProductName());
|
||||
orderDatilListEntity.setPcs(ordersEntitys.getBuyCount());
|
||||
orderDatilListEntity.setProductCode(ordersEntitys.getProductCode());
|
||||
orderDatilListEntity.setEcPrice(ordersEntitys.getPayAmount());
|
||||
orderDatilListJson.add(orderDatilListEntity);
|
||||
if(ordersEntitys.getCouponCode() != "" && ordersEntitys.getCouponCode() != null) {
|
||||
CouponGetAllEntity couponGetAllEntity = new CouponGetAllEntity ();
|
||||
if (ordersEntitys.getCouponCode() != "" && ordersEntitys.getCouponCode() != null) {
|
||||
CouponGetAllEntity couponGetAllEntity = new CouponGetAllEntity();
|
||||
couponGetAllEntity.setMemberId(ordersEntitys.getMemberId());
|
||||
couponGetAllEntity.setCouponCode(ordersEntitys.getCouponCode());
|
||||
String couponInfo = couponService.couponGetAll(couponGetAllEntity);
|
||||
JSONObject jsonObject = JSONObject.parseObject(couponInfo);
|
||||
com.alibaba.fastjson.JSONArray jsonArray = JSONObject.parseArray(jsonObject.getString("data"));
|
||||
JSONObject jsonObjectData = (JSONObject)jsonArray.get(0);
|
||||
JSONObject jsonObjectData = (JSONObject) jsonArray.get(0);
|
||||
|
||||
ordersEntity.setCouponAmount(jsonObjectData.getString("couponAmount") == null ?jsonObjectData.getString("discount"):jsonObjectData.getString("couponAmount"));
|
||||
ordersEntity.setCouponAmount(jsonObjectData.getString("couponAmount") == null ? jsonObjectData.getString("discount") : jsonObjectData.getString("couponAmount"));
|
||||
ordersEntity.setCouponCode(jsonObjectData.getString("couponCode"));
|
||||
ordersEntity.setCouponName(jsonObjectData.getString("couponName"));
|
||||
ordersEntity.setCouponId(jsonObjectData.getString("couponId"));
|
||||
total_fee = total_fee + orderService.couponTotal(ordersEntitys.getCouponTypeId(),Double.parseDouble(ordersEntitys.getCouponAmount()),Double.parseDouble(ordersEntitys.getPayAmount()),ordersEntitys.getBuyCount());
|
||||
}else{
|
||||
total_fee = total_fee + Double.parseDouble(ordersEntitys.getPayAmount()) * ordersEntitys.getBuyCount() ;
|
||||
total_fee = total_fee + orderService.couponTotal(ordersEntitys.getCouponTypeId(), Double.parseDouble(ordersEntitys.getCouponAmount()), Double.parseDouble(ordersEntitys.getPayAmount()), ordersEntitys.getBuyCount());
|
||||
} else {
|
||||
total_fee = total_fee + Double.parseDouble(ordersEntitys.getPayAmount()) * ordersEntitys.getBuyCount();
|
||||
}
|
||||
basePoint = basePoint + ordersEntitys.getBasePoint();
|
||||
// System.out.println("basePoint"+basePoint);
|
||||
orderAddress.setAddressCityName(ordersEntitys.getOrderAddress().getAddressCityName());
|
||||
orderAddress.setAddressCountyName(ordersEntitys.getOrderAddress().getAddressCountyName());
|
||||
orderAddress.setAddressDetailInfo(ordersEntitys.getOrderAddress().getAddressDetailInfo());
|
||||
orderAddress.setAddressPhoneNumber(ordersEntitys.getOrderAddress().getAddressPhoneNumber());
|
||||
orderAddress.setAddressUserName(ordersEntitys.getOrderAddress().getAddressUserName());
|
||||
orderAddress.setAddressProvinceName(ordersEntitys.getOrderAddress().getAddressProvinceName());
|
||||
productId.append(ordersEntitys.getProductCode()+",");
|
||||
productName.append(ordersEntitys.getProductName()+",");
|
||||
productId.append(ordersEntitys.getProductCode() + ",");
|
||||
productName.append(ordersEntitys.getProductName() + ",");
|
||||
memberId = ordersEntitys.getMemberId();
|
||||
mobile = ordersEntitys.getPhoneNumber();
|
||||
buyCount = buyCount + ordersEntitys.getBuyCount();
|
||||
}
|
||||
ordersEntity.setOrderAddress(orderAddress);
|
||||
ordersEntity.setProductCode(productId.substring(0,productId.length()-1));
|
||||
ordersEntity.setProductName(productName.substring(0,productName.length()-1));
|
||||
ordersEntity.setProductCode(productId.substring(0, productId.length() - 1));
|
||||
ordersEntity.setProductName(productName.substring(0, productName.length() - 1));
|
||||
ordersEntity.setOrderAmount(StringUtil.toString(total_fee));
|
||||
ordersEntity.setMemberId(memberId);
|
||||
ordersEntity.setPhoneNumber(mobile);
|
||||
@ -126,16 +122,21 @@ public class OrderController {
|
||||
ordersEntity.setOrderNo(GenerateSequenceUtil.generateSequenceNo());
|
||||
ordersEntity.setOrderStatus("0");
|
||||
ordersEntity.setBasePoint(basePoint);
|
||||
|
||||
if(orderService.generateOrder(ordersEntity,orderDatilListJson) == 1){
|
||||
int result = orderService.generateOrder(ordersEntity, orderDatilListJson);
|
||||
if (result == 1) {
|
||||
System.out.println("orderService.generateOrder(ordersEntity, orderDatilListJson) == 1");
|
||||
wxPayEntity.setProduct_id(ordersEntity.getProductCode());
|
||||
wxPayEntity.setTotal_fee(StringUtil.toString(total_fee));
|
||||
wxPayEntity.setOut_trade_no(ordersEntity.getOrderNo());
|
||||
Map<String, String> returnMap = new HashMap<>();
|
||||
returnMap.put("orderNumber",ordersEntity.getOrderNo());
|
||||
returnMap.put("orderAmount",ordersEntity.getOrderAmount());
|
||||
// return ResponseDTO.succData(returnMap,wxpayService.generateQRCode(wxPayEntity));
|
||||
return ResponseDTO.succData(returnMap,wxpayService.testGenerateQRCode(wxPayEntity));
|
||||
returnMap.put("orderNumber", ordersEntity.getOrderNo());
|
||||
returnMap.put("orderAmount", ordersEntity.getOrderAmount());
|
||||
return ResponseDTO.succData(returnMap, wxpayService.generateQRCode(wxPayEntity));
|
||||
}else if (result == 3){
|
||||
return ResponseDTO.wrap(OrderResponseCodeConst.GENERATE_FAIL_COUPONDED);
|
||||
}
|
||||
}catch (Exception e){
|
||||
System.out.println(e.getMessage());
|
||||
}
|
||||
return ResponseDTO.wrap(OrderResponseCodeConst.GENERATE_ORDER_FAIL);
|
||||
}
|
||||
|
@ -12,6 +12,8 @@ public class OrderResponseCodeConst extends ResponseCodeConst {
|
||||
|
||||
public static final OrderResponseCodeConst GENERATE_FAIL = new OrderResponseCodeConst(9003, "数据生成失败!");
|
||||
|
||||
public static final OrderResponseCodeConst GENERATE_FAIL_COUPONDED = new OrderResponseCodeConst(9004, "优惠券已使用!");
|
||||
|
||||
public static final OrderResponseCodeConst SMS_FAIL = new OrderResponseCodeConst(9005, " 短信校验失败!");
|
||||
|
||||
public static final OrderResponseCodeConst SMS_OVERTIME = new OrderResponseCodeConst(9006, "短信校验超时!");
|
||||
|
@ -1,21 +1,21 @@
|
||||
package net.lab1024.smartadmin.module.system.royalcanin.good.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import net.lab1024.smartadmin.common.heartbeat.StringUtil;
|
||||
import net.lab1024.smartadmin.module.system.royalcanin.good.dao.GoodsDao;
|
||||
import net.lab1024.smartadmin.module.system.royalcanin.good.model.GoodsEntity;
|
||||
import net.lab1024.smartadmin.module.system.royalcanin.good.model.ProductMasterQueryEntity;
|
||||
import net.lab1024.smartadmin.module.system.royalcanin.good.model.ProductQueryEntity;
|
||||
import net.lab1024.smartadmin.module.system.royalcanin.productSearchTag.model.ProductSearchTagEntity;
|
||||
import net.lab1024.smartadmin.module.system.royalcanin.productSearchTag.service.ProductSearchTagService;
|
||||
import net.lab1024.smartadmin.util.AESUtil;
|
||||
import net.lab1024.smartadmin.util.MapRemoveNullUtil;
|
||||
import net.lab1024.smartadmin.util.SmartHttpUtil;
|
||||
import net.lab1024.smartadmin.util.SmartIPUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -24,7 +24,11 @@ import java.util.concurrent.TimeUnit;
|
||||
@Service
|
||||
public class GoodService {
|
||||
|
||||
String url = "https://miniapp-test.royalcanin.com.cn/rcmini/h5/";
|
||||
@Value("${royalcanin.goods}")
|
||||
private String url;
|
||||
|
||||
@Value("${royalcanin.goods.ip}")
|
||||
private String goodsIp;
|
||||
|
||||
@Autowired
|
||||
private GoodsDao goodsDao;
|
||||
@ -32,16 +36,22 @@ public class GoodService {
|
||||
@Autowired
|
||||
private RedisTemplate redisTemplate;
|
||||
|
||||
@Autowired
|
||||
private ProductSearchTagService productSearchTagService;
|
||||
|
||||
|
||||
public GoodsEntity listGoodsByProductCode(String productCode){
|
||||
return goodsDao.findByProductCode(productCode);
|
||||
GoodsEntity goodsEntity = goodsDao.findByProductCode(productCode);
|
||||
goodsEntity.setShowImgFile(goodsIp+goodsEntity.getShowImgFile());
|
||||
goodsEntity.setPicture(goodsIp+goodsEntity.getPicture());
|
||||
return goodsEntity;
|
||||
}
|
||||
|
||||
public List<GoodsEntity> listGoodsByNameBankNameTagUsedAge(String title,String petType){
|
||||
String ip = "https://royalcanincn.escase.cn/jc/royalcanin/";
|
||||
List<GoodsEntity> goodsList = goodsDao.selectRoleIdByGoodsNameBankNameTagUsedAge(title,petType);
|
||||
for (GoodsEntity goodsEntity:goodsList) {
|
||||
goodsEntity.setShowImgFile(ip+goodsEntity.getPicture());
|
||||
goodsEntity.setPicture(ip+goodsEntity.getPicture());
|
||||
goodsEntity.setShowImgFile(goodsIp+goodsEntity.getShowImgFile());
|
||||
goodsEntity.setPicture(goodsIp+goodsEntity.getPicture());
|
||||
}
|
||||
return goodsList;
|
||||
}
|
||||
@ -80,6 +90,21 @@ public class GoodService {
|
||||
String sb = SmartHttpUtil.sendPostForm(url+"productSearchTag/query",paramMap,null);
|
||||
JSONObject jsonObject = JSONObject.parseObject(sb);
|
||||
String result = AESUtil.decryptLinux(jsonObject.getString("data"), AESUtil.KEY);
|
||||
productSearchTagService.deleteAllSearchTag();
|
||||
com.alibaba.fastjson.JSONArray jsonArray = JSONObject.parseArray(result);
|
||||
for (int i = 0; i < jsonArray.size();i++){
|
||||
JSONObject jsonObjectResult = (JSONObject)jsonArray.get(i);
|
||||
ProductSearchTagEntity productSearchTagEntity = new ProductSearchTagEntity();
|
||||
productSearchTagEntity.setBrandCode("16518816");
|
||||
productSearchTagEntity.setBrandName(jsonObjectResult.getString("name"));
|
||||
productSearchTagEntity.setIsDelete("0");
|
||||
productSearchTagEntity.setId(jsonObjectResult.getString("id"));
|
||||
productSearchTagEntity.setPetType(jsonObjectResult.getString("petType"));
|
||||
productSearchTagEntity.setTagName(jsonObjectResult.getString("tagName"));
|
||||
productSearchTagEntity.setTagType(jsonObjectResult.getString("tagType"));
|
||||
productSearchTagEntity.setTagCode(jsonObjectResult.getString("tagCode"));
|
||||
productSearchTagService.installAllSearchTag(productSearchTagEntity);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -24,11 +24,13 @@ import net.lab1024.smartadmin.util.MapRemoveNullUtil;
|
||||
import net.lab1024.smartadmin.util.SmartHttpUtil;
|
||||
import net.sf.json.JSONArray;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
@ -46,21 +48,23 @@ public class OrderService {
|
||||
@Autowired
|
||||
private NotifyService notifyService;
|
||||
|
||||
private String url = "https://miniapp-test.royalcanin.com.cn/rcmini/h5/orderMaster/";
|
||||
@Value("${royalcanin.order}")
|
||||
private String url ;
|
||||
|
||||
@Transactional
|
||||
public int generateOrder(OrdersEntity ordersEntity, JSONArray listJson) throws Exception {
|
||||
AddOrSaveEntity addOrSaveEntity = new AddOrSaveEntity();
|
||||
if (ordersEntity.getCouponCode() != ""&& null != ordersEntity.getCouponCode()) {
|
||||
try {
|
||||
if (ordersEntity.getCouponCode() != "" && null != ordersEntity.getCouponCode()) {
|
||||
CouponCosumeEntity couponCosumeEntity = new CouponCosumeEntity();
|
||||
couponCosumeEntity.setCouponCode(ordersEntity.getCouponCode());
|
||||
couponCosumeEntity.setOrderNo(ordersEntity.getOrderNo());
|
||||
couponCosumeEntity.setProductCode(ordersEntity.getProductCode());
|
||||
BigDecimal realCouponAmount =new BigDecimal(ordersEntity.getOrderAmount());
|
||||
BigDecimal realCouponAmount = new BigDecimal(ordersEntity.getOrderAmount());
|
||||
couponCosumeEntity.setRealCouponAmount(realCouponAmount);
|
||||
JSONObject jsonObject = JSONObject.parseObject(couponService.couponCosume(couponCosumeEntity));
|
||||
if(!jsonObject.getString("code").equals("0")) {
|
||||
return 0;
|
||||
if (!jsonObject.getString("code").equals("0")) {
|
||||
return 3;
|
||||
}
|
||||
//coupon json化
|
||||
OrderCouponEntity orderCouponEntity = new OrderCouponEntity();
|
||||
@ -78,7 +82,7 @@ public class OrderService {
|
||||
paramMap.remove("couponTypeId");
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
OrderEntity orderEntity = objectMapper.convertValue(paramMap, OrderEntity.class);
|
||||
if(ordersDao.insert(orderEntity) == 1) {
|
||||
if (ordersDao.insert(orderEntity) == 1) {
|
||||
ordersEntity.setOrderStatus("0");
|
||||
addOrSaveEntity.setPhoneNumber(ordersEntity.getPhoneNumber());
|
||||
addOrSaveEntity.setStatus("0");
|
||||
@ -94,13 +98,19 @@ public class OrderService {
|
||||
addOrSaveEntity.setAddressProvinceName(orderAddress.getAddressProvinceName());
|
||||
addOrSaveEntity.setAddressUserName(orderAddress.getAddressUserName());
|
||||
JSONObject jsonObject = JSONObject.parseObject(addOrSave(addOrSaveEntity));
|
||||
if(jsonObject.getString("code").equals("1"))
|
||||
|
||||
if (jsonObject.getString("code").equals("1"))
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
}else {
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}catch (Exception e){
|
||||
System.out.println(e.getMessage()
|
||||
);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int checkNotify(String orderNumber){
|
||||
@ -209,11 +219,13 @@ public class OrderService {
|
||||
jsonObject.put("orderCoupon",orderCoupon);
|
||||
jsonObject.put("orderDetailList",detailList);
|
||||
long startTime = System.currentTimeMillis();
|
||||
String result = SmartHttpUtil.httpPostRaw(url+"addOrSave?channelId=15&secret=H5@2021",jsonObject.toString(),null,"utf-8");
|
||||
Map<String, String> headers = new HashMap<>();
|
||||
headers.put("Content-Type","application/json");
|
||||
String result = SmartHttpUtil.httpPostRaw(url+"addOrSave?channelId=15&secret=H5@2021",jsonObject.toString(),headers,"utf-8");
|
||||
long acceptTime = System.currentTimeMillis() ;
|
||||
long elapsedTime = acceptTime - startTime;
|
||||
//记录服务响应时间
|
||||
addOperatreFullData(url+"addOrSave",addOrSaveEntity.toString(),result, startTime,elapsedTime,acceptTime);
|
||||
addOperatreFullData(url+"orderMaster/addOrSave",addOrSaveEntity.toString(),result, startTime,elapsedTime,acceptTime);
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -273,13 +285,13 @@ public class OrderService {
|
||||
endTotal = total * buyCount - discount;
|
||||
break;
|
||||
case "3":
|
||||
endTotal = (total * buyCount) * discount;
|
||||
endTotal = (total * buyCount) * (1-discount);
|
||||
break;
|
||||
case "1" :
|
||||
endTotal = total * buyCount - discount;
|
||||
break;
|
||||
case "4" :
|
||||
endTotal = (total * buyCount) * discount;
|
||||
endTotal = (total * buyCount) * (1-discount);
|
||||
break;
|
||||
case "6" :
|
||||
endTotal = total * buyCount - discount;
|
||||
|
@ -13,4 +13,7 @@ import java.util.List;
|
||||
public interface ProductSearchTagDao extends BaseMapper<ProductSearchTagEntity> {
|
||||
|
||||
List<ProductSearchTagEntity> findAllByCondition(@Param("brandNameList") List<String> brandNameList,@Param("petType")String petType,@Param("tagNameList") List<String> tagNameList,@Param("tagStatus")String tagStatus);
|
||||
|
||||
|
||||
int deleteAllProductSearchTag();
|
||||
}
|
||||
|
@ -17,4 +17,12 @@ public class ProductSearchTagService {
|
||||
public List<ProductSearchTagEntity> findAllByCondition( List<String> brandNameList,String petType,List<String> tagNameList,String tagStatus){
|
||||
return productSearchTagDao.findAllByCondition(brandNameList,petType,tagNameList,tagStatus);
|
||||
}
|
||||
|
||||
public void deleteAllSearchTag(){
|
||||
productSearchTagDao.deleteAllProductSearchTag();
|
||||
}
|
||||
|
||||
public int installAllSearchTag(ProductSearchTagEntity ProductSearchTagEntity){
|
||||
return productSearchTagDao.insert(ProductSearchTagEntity);
|
||||
}
|
||||
}
|
||||
|
@ -12,18 +12,19 @@ import java.io.*;
|
||||
public class MyConfig implements WXPayConfig {
|
||||
|
||||
// private String path ="C:/Users/Administrator/IdeaProjects/smart-admin/smart-admin-service/smart-admin-api/src/main/resources/wxpay/pro/";
|
||||
private String path ="/home/royalcanin-dev/cert/pro/";
|
||||
private String path ="/var/www/html/shop/smart-admin/smart-admin-service/smart-admin-api/src/main/resources/wxpay/pro/";
|
||||
|
||||
// public String notify_url = "http://47.96.75.242:10086/smart-admin-api/royalcanin/updateOrderWX";
|
||||
|
||||
public String notify_url = "https://royalcanincn.escase.cn/jc/royalcanin/royalcanin/updateOrderWX";
|
||||
public String notify_url = "https://shop.royalcanin.com.cn/royalcanin/royalcanin/updateOrderWX";
|
||||
|
||||
// 微信支付h5 回调地址
|
||||
public static String NOTIFY_URL_H5 = "https://shop.royalcanin.com.cn/myorder/usertion?";
|
||||
public static String NOTIFY_URL_H5 = "https://shop.royalcanin.com.cn";
|
||||
|
||||
// 请求地址
|
||||
public static String UFDODER_URL = "https://api.mch.weixin.qq.com/pay/unifiedorder";
|
||||
|
||||
|
||||
private byte[] certData;
|
||||
|
||||
public MyConfig() throws Exception {
|
||||
@ -50,6 +51,7 @@ public class MyConfig implements WXPayConfig {
|
||||
return "indexphpcorecertapicert201903200";
|
||||
}
|
||||
//b69497999e8fd1f8f1f0a9591b24eb72
|
||||
//1DDE55AD98ED71D6EDD4A4A16996DE7B47773A8C
|
||||
|
||||
public InputStream getCertStream() {
|
||||
ByteArrayInputStream certBis = new ByteArrayInputStream(this.certData);
|
||||
|
@ -15,8 +15,8 @@ import net.lab1024.smartadmin.module.system.wxpay.wxPayModel.WxPayEntity;
|
||||
import net.lab1024.smartadmin.util.MapRemoveNullUtil;
|
||||
import net.lab1024.smartadmin.util.SmartHttpUtil;
|
||||
import net.lab1024.smartadmin.util.SmartIPUtil;
|
||||
import org.apache.poi.hpsf.Decimal;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
@ -25,11 +25,8 @@ import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.math.BigDecimal;
|
||||
import java.net.Inet4Address;
|
||||
import java.net.InetAddress;
|
||||
import java.net.URLEncoder;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.*;
|
||||
|
||||
@Service
|
||||
@ -49,31 +46,8 @@ public class WxpayService {
|
||||
@Autowired
|
||||
private MemberAccountService memberAccountService;
|
||||
|
||||
String url = "https://miniapp-test.royalcanin.com.cn/rcmini/h5/";
|
||||
|
||||
private String urlNative = "https://api.mch.weixin.qq.com/v3/pay/transactions/native";
|
||||
|
||||
public String testGenerateQRCode(WxPayEntity wxPayEntity)throws Exception{
|
||||
String Authorization = "WECHATPAY2-SHA256-RSA2048";
|
||||
long timestamp = System.currentTimeMillis();
|
||||
SortedMap<String,String> data = new TreeMap<>();
|
||||
SortedMap<String, Integer> amount = new TreeMap<>();
|
||||
amount.put("total",Integer.parseInt(getMoney(wxPayEntity.getTotal_fee())));
|
||||
data.put("out_trade_no",wxPayEntity.getOut_trade_no());
|
||||
data.put("notify_url",config.notify_url);
|
||||
data.put("description","皇家宠物食品官方商城");
|
||||
data.put("appid",config.getAppID());
|
||||
data.put("mchid",config.getMchID());
|
||||
net.sf.json.JSONObject jsonObject = net.sf.json.JSONObject.fromObject(data);
|
||||
jsonObject.put("amount",amount);
|
||||
SortedMap<String ,String>hearder = new TreeMap<>();
|
||||
hearder.put("Accept","application/json");
|
||||
hearder.put("Authorization",Authorization +" mchid="+config.getMchID() +",nonce_str=" + WXPayUtil.generateNonceStr() + ",timestamp=" + timestamp + ",signature=" + WXPayUtil.generateSignature(data, config.getKey()) + ",serial_no=" + config.getKey());
|
||||
String sb = SmartHttpUtil.httpPostRaw(urlNative,jsonObject.toString(),hearder,"utf-8");
|
||||
return sb;
|
||||
}
|
||||
|
||||
|
||||
@Value("${royalcanin.goods}")
|
||||
private String url;
|
||||
|
||||
public String generateQRCode(WxPayEntity wxPayEntity) throws Exception {
|
||||
WXPay wxpay = new WXPay(config);
|
||||
@ -120,8 +94,7 @@ public class WxpayService {
|
||||
// 更新订单状态
|
||||
if ("SUCCESS".equals(sortedMap.get("result_code"))) {
|
||||
String outTradeNo = sortedMap.get("out_trade_no"); // 流水号
|
||||
DecimalFormat df = new DecimalFormat("0.00");
|
||||
String totalFee = StringUtil.toString(df.format(df.format(Double.parseDouble(sortedMap.get("total_fee")) / 100))); // 交易金额
|
||||
String totalFee = sortedMap.get("total_fee"); // 交易金额
|
||||
OrderEntity orderEntity = orderService.findByOrderId(outTradeNo);
|
||||
String [] products = orderEntity.getProductCode().split(",");
|
||||
ProductMasterQueryEntity productMasterQueryEntity = new ProductMasterQueryEntity();
|
||||
|
File diff suppressed because one or more lines are too long
@ -123,3 +123,13 @@ spring.quartz.jdbc.schema=classpath:sql/quartz_mysql_2.3.0.sql
|
||||
org.quartz.plugin.jobInitializer.scanInterval = 300
|
||||
|
||||
spring.mvc.static-path-pattern=/**
|
||||
|
||||
######################### royalcanin URL #############################
|
||||
royalcanin.couponconfig = http://miniapp-test.royalcanin.com.cn:7080/crm/couponConfig/
|
||||
royalcanin.coupon = http://miniapp-test.royalcanin.com.cn:7080/crm/coupon/
|
||||
royalcanin.memberaccount = http://miniapp-test.royalcanin.com.cn:7080/crm/memberAccount/
|
||||
royalcanin.memberaddress = http://miniapp-test.royalcanin.com.cn:7080/crm/memberAddress/
|
||||
royalcanin.member = http://miniapp-test.royalcanin.com.cn:7080/crm/member/
|
||||
royalcanin.order = https://miniapp-test.royalcanin.com.cn/rcmini/h5/orderMaster/
|
||||
royalcanin.goods = https://miniapp-test.royalcanin.com.cn/rcmini/h5/
|
||||
royalcanin.goods.ip = https://royalcanincn.escase.cn/jc/royalcanin/
|
@ -8,6 +8,9 @@
|
||||
<select id="findAllByCondition" resultMap="ProductSearchTagEntity">
|
||||
select tag_code,brand_name,tag_name from t_royalcanin_productsearchtag WHERE
|
||||
is_delete = 0
|
||||
<if test="petType != null and petType != ''">
|
||||
AND pet_type = #{petType}
|
||||
</if>
|
||||
<if test="brandNameList != null and brandNameList.size > 0">
|
||||
AND brand_name in
|
||||
<foreach collection="brandNameList" open="(" close=")" separator="," item="brandName">
|
||||
@ -21,14 +24,21 @@
|
||||
#{tagName}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="tagStatus != null and tagStatus == 1">
|
||||
or brand_name in ( '专区' ) and tag_name not like '%湿粮%'
|
||||
<if test="tagStatus != null and tagStatus == 1 and tagNameList != null and tagNameList.size > 0">
|
||||
OR brand_name in ( '专区' ) and tag_name not like '%湿粮%' AND pet_type = #{petType}
|
||||
</if>
|
||||
<if test="tagStatus != null and tagStatus == 2">
|
||||
or brand_name in ( '专区' ) and tag_name like '%湿粮%'
|
||||
<if test="tagStatus != null and tagStatus == 2 and tagNameList != null and tagNameList.size > 0">
|
||||
OR brand_name in ( '专区' ) and tag_name like '%湿粮%' AND pet_type = #{petType}
|
||||
</if>
|
||||
<if test="petType != null and petType != ''">
|
||||
AND pet_type = #{petType}
|
||||
<if test="tagStatus != null and tagStatus == 1 and tagNameList.size == 0">
|
||||
AND brand_name in ( '专区' ) and tag_name not like '%湿粮%'
|
||||
</if>
|
||||
<if test="tagStatus != null and tagStatus == 2 and tagNameList.size == 0">
|
||||
AND brand_name in ( '专区' ) and tag_name like '%湿粮%'
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<delete id="deleteAllProductSearchTag">
|
||||
delete from t_royalcanin_productsearchtag
|
||||
</delete>
|
||||
</mapper>
|
@ -23,7 +23,7 @@ spring.servlet.multipart.max-request-size=30MB
|
||||
file-upload-service.path=/home/upload/smart-admin-file
|
||||
|
||||
######################### database #########################
|
||||
spring.datasource.url=jdbc:mysql://rc-hub-mysql.mysql.database.chinacloudapi.cn/smart-admin-prod?autoReconnect=true&useServerPreparedStmts=false&rewriteBatchedStatements=true&characterEncoding=UTF-8&useSSL=false&allowMultiQueries=true
|
||||
spring.datasource.url=jdbc:mysql://rc-hub-mysql.mysql.database.chinacloudapi.cn/smart-admin-pro?autoReconnect=true&useServerPreparedStmts=false&rewriteBatchedStatements=true&characterEncoding=UTF-8&serverTimezone=UTC&useSSL=false&allowMultiQueries=true
|
||||
spring.datasource.username=azureuser@rc-hub-mysql
|
||||
spring.datasource.password=(G=q0D5ez2Fz
|
||||
spring.datasource.initial-size=2
|
||||
@ -118,3 +118,14 @@ spring.quartz.job-store-type=jdbc
|
||||
#ALWAYS,EMBEDDED,NEVER
|
||||
spring.quartz.jdbc.initialize-schema=NEVER
|
||||
spring.quartz.jdbc.schema=classpath:sql/quartz_mysql_2.3.0.sql
|
||||
|
||||
|
||||
######################### royalcanin URL #############################
|
||||
royalcanin.couponconfig = http://crm.royalcanin.com.cn:8080/crm/couponConfig/
|
||||
royalcanin.coupon = http://crm.royalcanin.com.cn:8080/crm/coupon/
|
||||
royalcanin.memberaccount = http://crm.royalcanin.com.cn:8080/crm/memberAccount/
|
||||
royalcanin.memberaddress = http://crm.royalcanin.com.cn:8080/crm/memberAddress/
|
||||
royalcanin.member = http://crm.royalcanin.com.cn:8080/crm/member/
|
||||
royalcanin.order = https://miniapp-product.royalcanin.com.cn/rcmini2020/h5/orderMaster/
|
||||
royalcanin.goods = https://miniapp-product.royalcanin.com.cn/rcmini2020/h5/
|
||||
royalcanin.goods.ip = https://shop.royalcanin.com.cn/royalcanin/royalcanin/
|
@ -14,8 +14,8 @@
|
||||
|
||||
-- 导出 smart-admin-dev 的数据库结构
|
||||
DROP DATABASE IF EXISTS `smart-admin-dev`;
|
||||
CREATE DATABASE IF NOT EXISTS `smart-admin-dev` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci */ /*!80016 DEFAULT ENCRYPTION='N' */;
|
||||
USE `smart-admin-dev`;
|
||||
CREATE DATABASE IF NOT EXISTS `smart-admin-pro` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci */ /*!80016 DEFAULT ENCRYPTION='N' */;
|
||||
USE `smart-admin-pro`;
|
||||
|
||||
-- 导出 表 smart-admin-dev.t_department 结构
|
||||
DROP TABLE IF EXISTS `t_department`;
|
||||
@ -1602,7 +1602,7 @@ CREATE TABLE IF NOT EXISTS `t_royalcanin_operate_log` (
|
||||
`code` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||
`msg` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM AUTO_INCREMENT=51 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
)
|
||||
|
||||
|
||||
CREATE TABLE `t_good_orders` (
|
||||
@ -1720,8 +1720,8 @@ INSERT INTO `t_royalcanin_productsearchtag` (`id`, `brand_code`, `brand_name`, `
|
||||
(1032, '16518816', '品种', '0', '布偶', '1017', '1017014', 0, '2022-01-19 16:41:55'),
|
||||
(1033, '16518816', '品种', '0', '暹罗', '1017', '1017015', 0, '2022-01-19 16:41:55'),
|
||||
(1034, '16518816', '品种', '0', '缅因', '1017', '1017016', 0, '2022-01-19 16:41:55'),
|
||||
(1035, '16518816,555131355', '年龄', '1', '幼年', '1018', '1018001', 0, '2022-01-19 16:41:55'),
|
||||
(1036, '16518816,555131355', '年龄', '1', '成年', '1018', '1018002', 0, '2022-01-19 16:41:55'),
|
||||
(1035, '16518816', '年龄', '1', '幼年', '1018', '1018001', 0, '2022-01-19 16:41:55'),
|
||||
(1036, '16518816', '年龄', '1', '成年', '1018', '1018002', 0, '2022-01-19 16:41:55'),
|
||||
(1037, '16518816', '年龄', '1', '老年', '1018', '1018003', 0, '2022-01-19 16:41:55'),
|
||||
(1038, '16518816', '年龄', '0', '4-12月龄', '1018', '1018004', 0, '2022-01-19 16:41:55'),
|
||||
(1039, '16518816', '年龄', '0', '1-7岁', '1018', '1018005', 0, '2022-01-19 16:41:55'),
|
||||
|
Loading…
Reference in New Issue
Block a user