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' )
|
return fetch('goods?petType='+stype, data, 'POST' )
|
||||||
}
|
}
|
||||||
//处方信息
|
//处方信息
|
||||||
export const userque = (goodsName, curPage,curRow) => {
|
export const userque = (goodsName, petType, curPage,curRow) => {
|
||||||
if(!curPage)
|
if(!curPage)
|
||||||
curPage=1;
|
curPage=1;
|
||||||
if(!curRow)
|
if(!curRow)
|
||||||
curRow=10;
|
curRow=10;
|
||||||
let queryTail='page='+curPage+'&rows='+curRow;
|
let queryTail='&page='+curPage+'&rows='+curRow;
|
||||||
|
let query='?0';
|
||||||
if(goodsName)
|
if(goodsName)
|
||||||
queryTail = '?goodsName='+goodsName;
|
query += '&goodsName='+goodsName;
|
||||||
|
if(petType!==undefined && petType!=='') {
|
||||||
|
query += '&petType='+petType;
|
||||||
|
}
|
||||||
|
query += queryTail;
|
||||||
var data = {
|
var data = {
|
||||||
}
|
}
|
||||||
return fetch('goods'+queryTail, data, 'POST' )
|
return fetch('goods'+query, data, 'POST' )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -35,20 +35,45 @@ let util = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
checkPaytypeValidated($paytype) {
|
checkPaytypeValidated($paytype) {
|
||||||
if(isWx && $paytype == 1) {
|
let isMobile = this.isMobile();
|
||||||
//return 3;
|
let isWx = this.isWX();
|
||||||
return true;
|
//Dictionary : 1:WX native pay, 2:Alipay, 3:WX H5 pay
|
||||||
} else if(isWx && $paytype!=1) {
|
if((isWx || !isMobile) && $paytype == 1) {
|
||||||
return false;
|
return {'result':true};
|
||||||
}
|
}
|
||||||
|
if(isMobile && !isWx && $paytype == 3) {
|
||||||
if(!isMobile && $paytype == 1) {
|
return {'result':true};
|
||||||
//Desktop, use native pay
|
|
||||||
return true;
|
|
||||||
} else if(isMobile && $paytype == 2) {
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
return false;
|
if($paytype == 2) {
|
||||||
|
return {'result':true};
|
||||||
|
}
|
||||||
|
let message='';
|
||||||
|
switch($paytype) {
|
||||||
|
case "1":
|
||||||
|
message = '请返回电脑网页端继续当前订单的支付';
|
||||||
|
break;
|
||||||
|
case "2":
|
||||||
|
message = '请返回支付宝继续当前订单的支付';
|
||||||
|
break;
|
||||||
|
case "3":
|
||||||
|
message = '请返回手机网页端继续当前订单的支付';
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
message = '订单已过期,请重新下单';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return {'result':false,'message':message};
|
||||||
|
},
|
||||||
|
getTextByPaytype(paytype){
|
||||||
|
//Dictionary : 1:WX native pay, 2:Alipay, 3:WX H5 pay
|
||||||
|
let mapping = {
|
||||||
|
"1":"微信扫码支付",
|
||||||
|
"2":"支付宝支付",
|
||||||
|
"3":"手机网页支付",
|
||||||
|
};
|
||||||
|
if(mapping.hasOwnProperty(paytype))
|
||||||
|
return mapping[paytype];
|
||||||
|
return '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
export default util;
|
export default util;
|
@ -13,6 +13,23 @@
|
|||||||
var s = document.getElementsByTagName("script")[0];
|
var s = document.getElementsByTagName("script")[0];
|
||||||
s.parentNode.insertBefore(hm, s);
|
s.parentNode.insertBefore(hm, s);
|
||||||
})();
|
})();
|
||||||
|
function bindTracking(ele,timeout)
|
||||||
|
{
|
||||||
|
var eventName=ele.getAttribute('evt-name');
|
||||||
|
var eventCat=ele.getAttribute('evt-cat');
|
||||||
|
var eventVal=ele.getAttribute('evt-val');
|
||||||
|
var eventParams={};
|
||||||
|
eventParams[eventCat]=eventVal;
|
||||||
|
_hmt.push(['_trackEvent', eventName, eventCat, eventVal]); //Baidu Analytics Event Push
|
||||||
|
if(timeout)
|
||||||
|
{
|
||||||
|
setTimeout(function(){
|
||||||
|
window.location.href=ele.href;
|
||||||
|
},timeout);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
@ -10,6 +10,20 @@ body {
|
|||||||
border:unset;
|
border:unset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ts-warning-popup {
|
||||||
|
.title{
|
||||||
|
img {
|
||||||
|
width:5rem;
|
||||||
|
height:auto;
|
||||||
|
margin-left:auto;
|
||||||
|
margin-right:auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.content span {
|
||||||
|
line-height:2rem;
|
||||||
|
font-size:1.2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.rc-menu--xs .rc-screen-reader{
|
.rc-menu--xs .rc-screen-reader{
|
||||||
left:28%;
|
left:28%;
|
||||||
@ -191,7 +205,13 @@ picture {
|
|||||||
white-space: normal;
|
white-space: normal;
|
||||||
color: #E2001A;
|
color: #E2001A;
|
||||||
}
|
}
|
||||||
|
.desc {
|
||||||
|
height:3.8rem;
|
||||||
|
white-space: break-spaces;
|
||||||
|
word-break: keep-all;
|
||||||
|
margin:1rem auto;
|
||||||
|
line-height:1.9rem;
|
||||||
|
}
|
||||||
i {
|
i {
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-size: 1.125rem;
|
font-size: 1.125rem;
|
||||||
|
@ -122,6 +122,16 @@
|
|||||||
max-width:100%;
|
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) {
|
@media screen and (max-width:768px) {
|
||||||
.uservideo{
|
.uservideo{
|
||||||
|
@ -1,15 +1,28 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="rc-fixright" >
|
<div class="rc-fixright-container">
|
||||||
<ul >
|
<div class="rc-fixright">
|
||||||
<li v-for="(userfixed,index) in fixedlist" :key="index" @click="lianxi(userfixed,index)">
|
<ul>
|
||||||
<img :src="userfixed.catimage" alt="">
|
<li v-for="(userfixed,index) in fixedlist" :key="index" @click="lianxi(userfixed,index)">
|
||||||
<span> {{userfixed.title}}</span>
|
<img :src="userfixed.catimage" alt="">
|
||||||
</li>
|
<span> {{userfixed.title}}</span>
|
||||||
</ul>
|
</li>
|
||||||
<div class="tuntop" @click="toTop" v-show="gotop">
|
</ul>
|
||||||
<img src="../assets/image/turntop.png" alt="">
|
<div class="tuntop" @click="toTop" v-show="gotop">
|
||||||
<span>回到顶部</span>
|
<img src="../assets/image/turntop.png" alt="">
|
||||||
</div>
|
<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>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -18,6 +31,7 @@ import { mapMutations } from "vuex";
|
|||||||
export default {
|
export default {
|
||||||
data(){
|
data(){
|
||||||
return{
|
return{
|
||||||
|
customerServerStop:false,
|
||||||
gotop: false,
|
gotop: false,
|
||||||
loginornot:false,
|
loginornot:false,
|
||||||
fixedlist: [
|
fixedlist: [
|
||||||
@ -43,10 +57,21 @@ export default {
|
|||||||
...mapMutations(["checkIsLogin"]),
|
...mapMutations(["checkIsLogin"]),
|
||||||
lianxi(item,index){
|
lianxi(item,index){
|
||||||
if(item.title=='在线客服'){
|
if(item.title=='在线客服'){
|
||||||
|
this.customerServerStop = true;
|
||||||
|
/* Stop until 2022-2-10
|
||||||
var option = {
|
var option = {
|
||||||
customer: {id: '', name: '', email: '', mobile: '', memberId: '999999'}
|
customer: {id: '', name: '', email: '', mobile: '', memberId: '999999'}
|
||||||
}
|
}
|
||||||
dis_livchat(option);
|
dis_livchat(option);
|
||||||
|
_hmt.push([
|
||||||
|
"_trackCustomEvent",
|
||||||
|
"cs_consult",
|
||||||
|
{
|
||||||
|
"page_name_":this.$route.path,
|
||||||
|
"shop_right_btn": 1,
|
||||||
|
}
|
||||||
|
])
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
if(item.title=='购物车'){
|
if(item.title=='购物车'){
|
||||||
if(this.loginornot){
|
if(this.loginornot){
|
||||||
@ -60,10 +85,22 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(item.title=='营养专家'){
|
if(item.title=='营养专家'){
|
||||||
|
this.customerServerStop = true;
|
||||||
|
/* Stop until 2022-2-10
|
||||||
var option = {
|
var option = {
|
||||||
customer: {id: '', name: '', email: '', mobile: '', memberId: '999999'}
|
customer: {id: '', name: '', email: '', mobile: '', memberId: '999999'}
|
||||||
}
|
}
|
||||||
dis_livchat(option);
|
dis_livchat(option);
|
||||||
|
console.log(this.$route.path);
|
||||||
|
_hmt.push([
|
||||||
|
"_trackCustomEvent",
|
||||||
|
"sol_consult",
|
||||||
|
{
|
||||||
|
"page_name_":this.$route.path,
|
||||||
|
"shop_right_btn": 1,
|
||||||
|
}
|
||||||
|
])
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
toTop() {
|
toTop() {
|
||||||
|
@ -211,6 +211,13 @@
|
|||||||
|
|
||||||
<div class="footer-block9 rc-layout-container rc-one-column rc-text-colour--brand3">
|
<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">
|
<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>
|
<a target='_blank' href='https://beian.miit.gov.cn'><span class="">沪ICP备08000779号-2</span></a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -9,7 +9,7 @@ let baseUrl = 'http://47.96.75.242:10086/royalcanin/royalcanin/'
|
|||||||
if (process.env.NODE_ENV === 'development') {
|
if (process.env.NODE_ENV === 'development') {
|
||||||
baseUrl = 'http://47.96.75.242:10086/royalcanin/royalcanin/';
|
baseUrl = 'http://47.96.75.242:10086/royalcanin/royalcanin/';
|
||||||
} else if (process.env.NODE_ENV === 'production') {
|
} else if (process.env.NODE_ENV === 'production') {
|
||||||
baseUrl = 'http://47.96.75.242:10086/royalcanin/royalcanin/';
|
baseUrl = 'https://shop.royalcanin.com.cn/royalcanin/royalcanin/royalcanin/';
|
||||||
}
|
}
|
||||||
export {
|
export {
|
||||||
baseUrl,
|
baseUrl,
|
||||||
|
@ -36,7 +36,7 @@ export default async(url = '', data = {}, type = 'GET', method = 'fetch') => {
|
|||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'x-access-token': token
|
'x-access-token': token
|
||||||
},
|
},
|
||||||
mode: 'cors',
|
// mode: 'cors',
|
||||||
// channelId:'H5@2021',
|
// channelId:'H5@2021',
|
||||||
cache: 'force-cache'
|
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 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;';
|
const assetsUrl = 'var assetsUrl="/royalcanin-cdn-assets-new/css_js/";var isInitialized=false;';
|
||||||
export default {
|
export default {
|
||||||
|
env: {
|
||||||
|
//NODE_ENV: 'development'
|
||||||
|
NODE_ENV: 'production'
|
||||||
|
},
|
||||||
// Global page headers: https://go.nuxtjs.dev/config-head
|
// Global page headers: https://go.nuxtjs.dev/config-head
|
||||||
head: {
|
head: {
|
||||||
title: '皇家宠物食品官方商城',
|
title: '皇家宠物食品官方商城',
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
</swiper-slide>
|
</swiper-slide>
|
||||||
|
|
||||||
<swiper-slide>
|
<swiper-slide>
|
||||||
<a href="#" target="_blank">
|
<a @click="toMiniShop" target="_blank">
|
||||||
<picture>
|
<picture>
|
||||||
<source
|
<source
|
||||||
media="(max-width: 768px)"
|
media="(max-width: 768px)"
|
||||||
@ -1032,12 +1032,23 @@
|
|||||||
</nuxt-link>
|
</nuxt-link>
|
||||||
</div> -->
|
</div> -->
|
||||||
|
|
||||||
<FixRight></FixRight>
|
<FixRight ref="fixRightComponent"></FixRight>
|
||||||
<div v-if="!dataLoaded" class="ts-mask">
|
<div v-if="!dataLoaded" class="ts-mask">
|
||||||
<div class="ts-mask-bg"></div>
|
<div class="ts-mask-bg"></div>
|
||||||
<div class="userloding"></div>
|
<div class="userloding"></div>
|
||||||
<span>数据加载中</span>
|
<span>数据加载中</span>
|
||||||
</div>
|
</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>
|
<Myfooter></Myfooter>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -1048,6 +1059,7 @@ import FixRight from "~/components/fixed-right.vue";
|
|||||||
import Myfooter from "~/components/rc-footer.vue";
|
import Myfooter from "~/components/rc-footer.vue";
|
||||||
import unlogin from "~/components/unlogin.vue";
|
import unlogin from "~/components/unlogin.vue";
|
||||||
import { mapMutations } from "vuex";
|
import { mapMutations } from "vuex";
|
||||||
|
import envData from "~/config/env-data.js";
|
||||||
import {
|
import {
|
||||||
userquery,
|
userquery,
|
||||||
postCourseId,
|
postCourseId,
|
||||||
@ -1055,6 +1067,7 @@ import {
|
|||||||
userque,
|
userque,
|
||||||
searchchanpin,
|
searchchanpin,
|
||||||
} from "../ajax/getData";
|
} from "../ajax/getData";
|
||||||
|
import util from "@/ajax/util";
|
||||||
const settings = require("@/config");
|
const settings = require("@/config");
|
||||||
export default {
|
export default {
|
||||||
middleware: "metaTitle",
|
middleware: "metaTitle",
|
||||||
@ -1062,15 +1075,17 @@ export default {
|
|||||||
meta: { title: "首页" },
|
meta: { title: "首页" },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
util,
|
||||||
|
showMiniShopQr:false,
|
||||||
fixedHeader: false,
|
fixedHeader: false,
|
||||||
dataLoaded: true,
|
dataLoaded: true,
|
||||||
usermargin: { marginTop: "0" },
|
usermargin: { marginTop: "0" },
|
||||||
useraindex: 0,
|
useraindex: 0,
|
||||||
|
envData,
|
||||||
indexacindex:0,
|
indexacindex:0,
|
||||||
mobileVideoPlaying: false,
|
mobileVideoPlaying: false,
|
||||||
usertitle: "明星猫粮",
|
usertitle: "明星猫粮",
|
||||||
dogtitle: "明星犬粮",
|
dogtitle: "明星犬粮",
|
||||||
userdata:'999999',
|
|
||||||
processinformation: [],
|
processinformation: [],
|
||||||
catshi: [],
|
catshi: [],
|
||||||
userindex: 0,
|
userindex: 0,
|
||||||
@ -1257,113 +1272,12 @@ export default {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
catlistvideo: [
|
catlistvideo: [
|
||||||
{
|
|
||||||
title: "主食级猫湿粮",
|
|
||||||
video: "/images/cat/one.mp4",
|
|
||||||
catimage: "/images/cat/one.jpg",
|
|
||||||
productimage: "/images/cat/star-1.png",
|
|
||||||
detail: "为10柔软细腻慕斯 适合离乳期幼猫舔食",
|
|
||||||
price: "¥372",
|
|
||||||
productList: [
|
|
||||||
{
|
|
||||||
productCode: "80240008F24",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "幼猫成长专属",
|
|
||||||
video: "/images/cat/two.mp4",
|
|
||||||
catimage: "/images/cat/two.jpg",
|
|
||||||
productimage: "/images/cat/star-2.png",
|
|
||||||
detail: "支持幼猫自身保护力 为快速生长提供足够能量",
|
|
||||||
price: "¥33",
|
|
||||||
productList: [
|
|
||||||
{
|
|
||||||
productCode: "20030040",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "室内成猫专属",
|
|
||||||
video: "/images/cat/three.mp4",
|
|
||||||
catimage: "/images/cat/three.jpg",
|
|
||||||
productimage: "/images/cat/star-3.png",
|
|
||||||
detail: "高易消化蛋白 减少粪便量和异味",
|
|
||||||
price: "¥157",
|
|
||||||
productList: [
|
|
||||||
{
|
|
||||||
productCode: "21100200",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "英短成猫专属",
|
|
||||||
video: "/images/cat/four.mp4",
|
|
||||||
catimage: "/images/cat/four.jpg",
|
|
||||||
productimage: "/images/cat/star-4.png",
|
|
||||||
detail: "增强肌肉质量 支持骨骼与关节健康",
|
|
||||||
price: "¥402",
|
|
||||||
productList: [
|
|
||||||
{
|
|
||||||
productCode: "23040450",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
|
|
||||||
doglistvideo: [
|
doglistvideo: [
|
||||||
{
|
|
||||||
title: "主食级狗湿粮",
|
|
||||||
video: "/images/dog/one.mp4",
|
|
||||||
catimage: "/images/dog/one.jpg",
|
|
||||||
productimage: "/images/dog/star-1.png",
|
|
||||||
detail: "柔软细腻慕斯 适合离乳期幼犬舔食",
|
|
||||||
price: "¥359",
|
|
||||||
productList: [
|
|
||||||
{
|
|
||||||
productCode: "81220020F12",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "贵宾成犬专属",
|
|
||||||
video: "/images/dog/two.mp4",
|
|
||||||
catimage: "/images/dog/two.jpg",
|
|
||||||
productimage: "/images/dog/star-2.png",
|
|
||||||
detail: "护肤靓毛 理想体态",
|
|
||||||
price: "¥562",
|
|
||||||
productList: [
|
|
||||||
{
|
|
||||||
productCode: "14200300",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "小型犬成犬专属",
|
|
||||||
video: "/images/dog/three.mp4",
|
|
||||||
catimage: "/images/dog/three.jpg",
|
|
||||||
productimage: "/images/dog/star-3.png",
|
|
||||||
detail: "亮泽被毛 呵护牙齿",
|
|
||||||
price: "¥57",
|
|
||||||
productList: [
|
|
||||||
{
|
|
||||||
productCode: "16020080",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "离乳期全价奶糕",
|
|
||||||
video: "/images/dog/four.mp4",
|
|
||||||
catimage: "/images/dog/four.jpg",
|
|
||||||
productimage: "/images/dog/star-4.png",
|
|
||||||
detail: "高易再水合颗粒 帮助增强保护健康成长",
|
|
||||||
price: "¥263",
|
|
||||||
productList: [
|
|
||||||
{
|
|
||||||
productCode: "17220400",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
rccontair: [
|
rccontair: [
|
||||||
{
|
{
|
||||||
@ -1414,6 +1328,7 @@ export default {
|
|||||||
// console.log("1");
|
// console.log("1");
|
||||||
// }
|
// }
|
||||||
if (this.realIndex == 2) {
|
if (this.realIndex == 2) {
|
||||||
|
|
||||||
// setTimeout(() => {
|
// setTimeout(() => {
|
||||||
// var option = {
|
// var option = {
|
||||||
// customer: {
|
// customer: {
|
||||||
@ -1492,52 +1407,56 @@ export default {
|
|||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
vm = this;
|
vm = this;
|
||||||
|
let curEnv = process.env.NODE_ENV;
|
||||||
|
this.catlistvideo = envData[curEnv].catlistvideo;
|
||||||
|
this.doglistvideo = envData[curEnv].doglistvideo;
|
||||||
},
|
},
|
||||||
watch: {},
|
watch: {},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.checkIsLogin();
|
let popupMessage = this.$route.query.msg;
|
||||||
if(this.$store.state.userInfo===undefined){
|
if(popupMessage) {
|
||||||
this.userdata=' '
|
this.$message({
|
||||||
}else{
|
type: 'success',
|
||||||
this.userdata = this.$store.state.userInfo.data.id;
|
message: popupMessage,
|
||||||
}
|
});
|
||||||
console.log(this.userdata);
|
}
|
||||||
const that = this;
|
this.checkIsLogin();
|
||||||
|
|
||||||
this.ifAdoid();
|
const that = this;
|
||||||
this.usermessage = JSON.parse(localStorage.getItem("userInfo"));
|
|
||||||
if (this.usermessage == null || this.usermessage == undefined) {
|
|
||||||
this.userunlogin = true;
|
|
||||||
}
|
|
||||||
window.addEventListener("scroll", this.handleScroll, true);
|
|
||||||
this.userchufang(); //查询处方粮商品信息
|
|
||||||
|
|
||||||
this.catmessage(); //查询猫的信息
|
this.ifAdoid();
|
||||||
this.catclickGan();
|
this.usermessage = JSON.parse(localStorage.getItem("userInfo"));
|
||||||
this.catclickShi();
|
if (this.usermessage == null || this.usermessage == undefined) {
|
||||||
|
this.userunlogin = true;
|
||||||
|
}
|
||||||
|
window.addEventListener("scroll", this.handleScroll, true);
|
||||||
|
this.userchufang(); //查询处方粮商品信息
|
||||||
|
|
||||||
this.dogmessage(); //查询狗的信息
|
this.catmessage(); //查询猫的信息
|
||||||
this.userdogShi();
|
this.catclickGan();
|
||||||
this.userdogGan();
|
this.catclickShi();
|
||||||
|
|
||||||
|
this.dogmessage(); //查询狗的信息
|
||||||
|
this.userdogShi();
|
||||||
|
this.userdogGan();
|
||||||
},
|
},
|
||||||
destroyed() {
|
destroyed() {
|
||||||
window.removeEventListener("scroll", this.scrollToTop);
|
window.removeEventListener("scroll", this.scrollToTop);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
diaoqi(){
|
...mapMutations(["checkIsLogin"]),
|
||||||
|
diaoqi(){
|
||||||
var option = {
|
this.$refs['fixRightComponent'].lianxi({title:'营养专家'});
|
||||||
customer: {
|
},
|
||||||
id: "",
|
toMiniShop(){
|
||||||
name: "",
|
let isMobile = this.util.isMobile();
|
||||||
email: "",
|
if(isMobile) {
|
||||||
mobile: "",
|
window.location.href="https://miniapp-product.royalcanin.com.cn/rcmini2020/admin/Voucher/urlRedirect.html";
|
||||||
memberId: this.userdata,
|
} else {
|
||||||
},
|
this.showMiniShopQr=true;
|
||||||
};
|
// /images/qrcode-minishop.png
|
||||||
dis_livchat(option);
|
}
|
||||||
},
|
},
|
||||||
...mapMutations(["checkIsLogin"]),
|
|
||||||
playMobileVideo(item) {
|
playMobileVideo(item) {
|
||||||
let videoPath = item.video;
|
let videoPath = item.video;
|
||||||
let player = this.$refs["mobile-video-player"];
|
let player = this.$refs["mobile-video-player"];
|
||||||
@ -1944,7 +1863,7 @@ export default {
|
|||||||
if (!item) item = this.discounchufang[0].title;
|
if (!item) item = this.discounchufang[0].title;
|
||||||
this.dataLoaded = false;
|
this.dataLoaded = false;
|
||||||
let list = [];
|
let list = [];
|
||||||
let data = await userque(item, 1, 8);
|
let data = await userque(item, '', 1, 8);
|
||||||
if (data) {
|
if (data) {
|
||||||
list = data.slice(0, 8);
|
list = data.slice(0, 8);
|
||||||
this.processinformation = list;
|
this.processinformation = list;
|
||||||
@ -1971,7 +1890,7 @@ export default {
|
|||||||
catclickGan() {
|
catclickGan() {
|
||||||
this.userstype = 0;
|
this.userstype = 0;
|
||||||
this.maoganCurIndex = this.maoganCurIndex ? this.maoganCurIndex : 0;
|
this.maoganCurIndex = this.maoganCurIndex ? this.maoganCurIndex : 0;
|
||||||
let apiCatAgeType = this.discoun[this.maoshiCurIndex].title;
|
let apiCatAgeType = this.discoun[this.maoganCurIndex].title;
|
||||||
let petType = {
|
let petType = {
|
||||||
petType: 0,
|
petType: 0,
|
||||||
tagStatus: 1, //干
|
tagStatus: 1, //干
|
||||||
|
@ -118,7 +118,7 @@
|
|||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<span>付款方式:</span>
|
<span>付款方式:</span>
|
||||||
<i>{{ information.paytype }}</i>
|
<i>{{ information.paytypeText }}</i>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<span>配送方式:</span>
|
<span>配送方式:</span>
|
||||||
@ -158,7 +158,18 @@
|
|||||||
{{ payorsucess }}
|
{{ payorsucess }}
|
||||||
</i>
|
</i>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<el-dialog :visible.sync="showPaytypeWarning" :close-on-click-modal="false">
|
||||||
|
<div class="ts-warning-popup">
|
||||||
|
<div class="title rc-full-width">
|
||||||
|
<img src="../../assets/error.png" alt="" />
|
||||||
|
</div>
|
||||||
|
<div class="content rc-full-width rc-text--center rc-margin-y--md">
|
||||||
|
<h3>温馨提示</h3>
|
||||||
|
<span class="">{{ paytypeWarning.message}}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
<MyFooter></MyFooter>
|
<MyFooter></MyFooter>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -184,6 +195,8 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
util,
|
util,
|
||||||
|
paytypeWarning:{result:true,message:''},
|
||||||
|
showPaytypeWarning:false,
|
||||||
goldmedal: [],
|
goldmedal: [],
|
||||||
userproductId: "",
|
userproductId: "",
|
||||||
logisticsDate: "",
|
logisticsDate: "",
|
||||||
@ -214,12 +227,9 @@ export default {
|
|||||||
useraddress: [],
|
useraddress: [],
|
||||||
shopprice: {},
|
shopprice: {},
|
||||||
information: {
|
information: {
|
||||||
reference: "1111111111111111",
|
paytypeText: "",
|
||||||
ordertime: "2012-12-01 11:20:00",
|
distribution: "快递",
|
||||||
paytype: "微信支付",
|
catimage: require("../../assets/image/rc-left.png"),
|
||||||
distribution: "快递",
|
|
||||||
trackingnumber: "11111111111111",
|
|
||||||
catimage: require("../../assets/image/rc-left.png"),
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@ -267,16 +277,20 @@ export default {
|
|||||||
},
|
},
|
||||||
//订单支付和再次购买
|
//订单支付和再次购买
|
||||||
onceagain(item) {
|
onceagain(item) {
|
||||||
if (this.payorsucess == "立即支付") {
|
this.paytypeWarning = this.util.checkPaytypeValidated(this.paytype);
|
||||||
this.getwei(item);
|
this.showPaytypeWarning = !this.paytypeWarning.result;
|
||||||
} else {
|
if(this.paytypeWarning.result) {
|
||||||
this.$router.push({
|
if (this.payorsucess == "立即支付") {
|
||||||
path: "/productdetails/producted",
|
this.getwei(item);
|
||||||
query: {
|
} else {
|
||||||
stype: 1,
|
this.$router.push({
|
||||||
productCode: this.userproductId,
|
path: "/productdetails/producted",
|
||||||
},
|
query: {
|
||||||
});
|
stype: 1,
|
||||||
|
productCode: this.userproductId,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async orderquantity(orderNumber) {
|
async orderquantity(orderNumber) {
|
||||||
@ -304,7 +318,8 @@ export default {
|
|||||||
this.usersalesAmount = this.goldmedal[i].salesAmount;
|
this.usersalesAmount = this.goldmedal[i].salesAmount;
|
||||||
this.addressUserName = this.goldmedal[i].addressUserName;
|
this.addressUserName = this.goldmedal[i].addressUserName;
|
||||||
this.addressPhoneNumber = this.goldmedal[i].addressPhoneNumber;
|
this.addressPhoneNumber = this.goldmedal[i].addressPhoneNumber;
|
||||||
this.paytype = (this.goldmedal[i].paytype=="1"?'微信支付':'支付宝');
|
this.paytype = this.goldmedal[i].paytype;
|
||||||
|
this.information.paytypeText = this.util.getTextByPaytype(this.paytype);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
¥
|
¥
|
||||||
</i>
|
</i>
|
||||||
<span>
|
<span>
|
||||||
{{ item.couponAmount?item.couponAmount:(parseInt((item.discount)*10)+'折') }}
|
{{ item.couponAmount?item.couponAmount:(parseInt((1-item.discount)*10)+'折') }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<strong>{{ item.couponName }}</strong>
|
<strong>{{ item.couponName }}</strong>
|
||||||
@ -43,7 +43,7 @@
|
|||||||
<i :style='usercolor'>
|
<i :style='usercolor'>
|
||||||
{{ item.couponDesc }}
|
{{ item.couponDesc }}
|
||||||
</i>
|
</i>
|
||||||
<div class="rc-userfont">
|
<div class="rc-userfont" :style="(item.validTo?'visibility:visible':'visibility:hidden')">
|
||||||
<strong>有效期</strong>
|
<strong>有效期</strong>
|
||||||
<span>{{item.validFrom}}至</span>
|
<span>{{item.validFrom}}至</span>
|
||||||
<em>{{item.validTo}}</em>
|
<em>{{item.validTo}}</em>
|
||||||
|
@ -167,7 +167,7 @@
|
|||||||
¥
|
¥
|
||||||
</i>
|
</i>
|
||||||
<span>
|
<span>
|
||||||
{{ item.couponAmount?item.couponAmount:(parseInt((item.discount)*10)+'折') }}
|
{{ item.couponAmount?item.couponAmount:(parseInt((1-item.discount)*10)+'折') }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<strong>{{ item.couponName }}</strong>
|
<strong>{{ item.couponName }}</strong>
|
||||||
@ -176,7 +176,7 @@
|
|||||||
<i :style='usercolor'>
|
<i :style='usercolor'>
|
||||||
{{ item.couponName }}
|
{{ item.couponName }}
|
||||||
</i>
|
</i>
|
||||||
<div class="rc-userfont">
|
<div class="rc-userfont" :style="(item.validTo?'visibility:visible':'visibility:hidden')">
|
||||||
<strong>有效期</strong>
|
<strong>有效期</strong>
|
||||||
<span>{{item.validFrom}}至</span>
|
<span>{{item.validFrom}}至</span>
|
||||||
<em>{{item.validTo}}</em>
|
<em>{{item.validTo}}</em>
|
||||||
@ -287,12 +287,13 @@ export default {
|
|||||||
checkResult = false;
|
checkResult = false;
|
||||||
}
|
}
|
||||||
if(checkResult) {
|
if(checkResult) {
|
||||||
|
this.discountedProductCode = this.goldmedal[0].productCode
|
||||||
if(this.curCoupon.couponAmount && this.curCoupon.couponAmount>0) {
|
if(this.curCoupon.couponAmount && this.curCoupon.couponAmount>0) {
|
||||||
this.discountAmount = this.curCoupon.couponAmount;
|
this.discountAmount = this.curCoupon.couponAmount;
|
||||||
return this.sumPrice - this.curCoupon.couponAmount;
|
return this.sumPrice - this.curCoupon.couponAmount;
|
||||||
} else if(this.curCoupon.discount && this.curCoupon.discount>0) {
|
} else if(this.curCoupon.discount && this.curCoupon.discount>0) {
|
||||||
this.discountAmount = this.sumPrice*this.curCoupon.discount;
|
this.discountAmount = this.sumPrice*this.curCoupon.discount;
|
||||||
return this.sumPrice * (1-this.curCoupon.discount);
|
return this.sumPrice * ( 1 - this.curCoupon.discount );
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return this.sumPrice;
|
return this.sumPrice;
|
||||||
@ -330,8 +331,8 @@ export default {
|
|||||||
break;
|
break;
|
||||||
case 3: //Limited product % discount
|
case 3: //Limited product % discount
|
||||||
case 4: //% discount
|
case 4: //% discount
|
||||||
total = total + (itemInCart.productPrice * itemInCart.buyCount) * this.curCoupon.discount;
|
total = total + (itemInCart.productPrice * itemInCart.buyCount) * ( 1 - this.curCoupon.discount );
|
||||||
this.discountAmount = (itemInCart.productPrice * itemInCart.buyCount) * ( 1 - this.curCoupon.discount);
|
this.discountAmount = (itemInCart.productPrice * itemInCart.buyCount) * this.curCoupon.discount;
|
||||||
this.discountedProductCode = itemInCart.productCode;
|
this.discountedProductCode = itemInCart.productCode;
|
||||||
couponUsed=true;
|
couponUsed=true;
|
||||||
break;
|
break;
|
||||||
@ -375,7 +376,7 @@ export default {
|
|||||||
userget(){
|
userget(){
|
||||||
let user = this.$store.state.userInfo;
|
let user = this.$store.state.userInfo;
|
||||||
if (user) {
|
if (user) {
|
||||||
this.userdraw(user.data.mobile);
|
//this.userdraw(user.data.mobile);
|
||||||
this.dialogInfo1 = true;
|
this.dialogInfo1 = true;
|
||||||
} else {
|
} else {
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
@ -391,7 +392,7 @@ export default {
|
|||||||
let valDateFromTime=0;
|
let valDateFromTime=0;
|
||||||
let valDateToTime=0;
|
let valDateToTime=0;
|
||||||
let dateChecked=true;
|
let dateChecked=true;
|
||||||
|
let avaliableCouponNum = 0;
|
||||||
if (data) {
|
if (data) {
|
||||||
this.drawlist=[];
|
this.drawlist=[];
|
||||||
for(let itemInCart of this.goldmedal) {
|
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)) {
|
if(dateChecked && myCoupon.activityId != 10 && myCoupon.status == 0 && (!myCoupon.productCodes || myCoupon.productCodes.indexOf(itemInCart.productCode)>-1)) {
|
||||||
data.data.splice(tmpIndex,1);
|
data.data.splice(tmpIndex,1);
|
||||||
_self.drawlist.push(myCoupon);
|
_self.drawlist.push(myCoupon);
|
||||||
|
avaliableCouponNum++;
|
||||||
}
|
}
|
||||||
tmpIndex++;
|
tmpIndex++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(avaliableCouponNum > 0) {
|
||||||
|
this.curCoupon.couponName = '有 '+avaliableCouponNum+' 张优惠券可以使用';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
pickCoupon(item){
|
pickCoupon(item){
|
||||||
@ -513,28 +518,28 @@ export default {
|
|||||||
let postData = [];
|
let postData = [];
|
||||||
let tmpCounter=0;
|
let tmpCounter=0;
|
||||||
this.goldmedal.forEach((item) => {
|
this.goldmedal.forEach((item) => {
|
||||||
let basePoint = (item.basePoint?item.basePoint:0);
|
let basePoint = (item.basePoint?item.basePoint:0);
|
||||||
let oneProduct = {
|
let oneProduct = {
|
||||||
basePoint:basePoint,
|
basePoint:basePoint,
|
||||||
productName: item.productName,
|
productName: item.productName,
|
||||||
buyCount: item.buyCount,
|
buyCount: item.buyCount,
|
||||||
productCode: item.productCode,
|
productCode: item.productCode,
|
||||||
payAmount: item.productPrice,
|
payAmount: item.productPrice,
|
||||||
memberId: userInfo.data.id,
|
memberId: userInfo.data.id,
|
||||||
phoneNumber: userInfo.data.mobile,
|
phoneNumber: userInfo.data.mobile,
|
||||||
// couponId: "NGQ2022P12",
|
// couponId: "NGQ2022P12",
|
||||||
// couponTypeId: "4",
|
// couponTypeId: "4",
|
||||||
// couponName: "内购券",
|
// couponName: "内购券",
|
||||||
// couponAmount: "0.3175",
|
// couponAmount: "0.3175",
|
||||||
// couponCode: "0007792402",
|
// couponCode: "0007792402",
|
||||||
orderAddress: {
|
orderAddress: {
|
||||||
addressPhoneNumber: orderAddress[0].recipientPhone,
|
addressPhoneNumber: orderAddress[0].recipientPhone,
|
||||||
addressUserName: orderAddress[0].recipient,
|
addressUserName: orderAddress[0].recipient,
|
||||||
addressProvinceName: orderAddress[0].provinceName,
|
addressProvinceName: orderAddress[0].provinceName,
|
||||||
addressCityName: orderAddress[0].cityName,
|
addressCityName: orderAddress[0].cityName,
|
||||||
addressCountyName: orderAddress[0].districtName,
|
addressCountyName: orderAddress[0].districtName,
|
||||||
addressDetailInfo: orderAddress[0].detailAddress,
|
addressDetailInfo: orderAddress[0].detailAddress,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
if(this.curCoupon.couponId && item.productCode == this.discountedProductCode) {
|
if(this.curCoupon.couponId && item.productCode == this.discountedProductCode) {
|
||||||
oneProduct.couponId = this.curCoupon.couponId;
|
oneProduct.couponId = this.curCoupon.couponId;
|
||||||
@ -626,6 +631,22 @@ export default {
|
|||||||
this.getAddressList();
|
this.getAddressList();
|
||||||
this.checkIsLogin();
|
this.checkIsLogin();
|
||||||
this.finalAmount = this.sumPrice;
|
this.finalAmount = this.sumPrice;
|
||||||
|
this.goldmedal.forEach((item) => {
|
||||||
|
_hmt.push([
|
||||||
|
"_trackCustomEvent",
|
||||||
|
"placing_order",
|
||||||
|
{
|
||||||
|
"product_id":item.productCode,
|
||||||
|
"product_name": item.productName,
|
||||||
|
"product_quantity" : item.buyCount,
|
||||||
|
"product_amount" : item.buyCount*item.productPrice,
|
||||||
|
}
|
||||||
|
])
|
||||||
|
});
|
||||||
|
let user = this.$store.state.userInfo;
|
||||||
|
if(user) {
|
||||||
|
this.userdraw(user.data.mobile);
|
||||||
|
}
|
||||||
// this.addressstype = this.$route.query.stype;
|
// this.addressstype = this.$route.query.stype;
|
||||||
// this.orderNumber = this.$route.query.orderNumber;
|
// this.orderNumber = this.$route.query.orderNumber;
|
||||||
// this.canceldanhao(this.orderNumber);
|
// this.canceldanhao(this.orderNumber);
|
||||||
|
@ -132,7 +132,18 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<MyFooter></MyFooter>
|
<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>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -146,6 +157,8 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
util,
|
util,
|
||||||
|
paytypeWarning:{result:true,message:''},
|
||||||
|
showPaytypeWarning:false,
|
||||||
crumbs:[
|
crumbs:[
|
||||||
{
|
{
|
||||||
path:'/personal/mypersonal/',
|
path:'/personal/mypersonal/',
|
||||||
@ -279,7 +292,6 @@ export default {
|
|||||||
this.userdata = user.data.mobile;
|
this.userdata = user.data.mobile;
|
||||||
let stype = this.$route.query.stype;
|
let stype = this.$route.query.stype;
|
||||||
this.userstype=this.$route.query.stype;
|
this.userstype=this.$route.query.stype;
|
||||||
console.log(stype);
|
|
||||||
if (user == "" || user == null) {
|
if (user == "" || user == null) {
|
||||||
this.$message({
|
this.$message({
|
||||||
type: "warning",
|
type: "warning",
|
||||||
@ -297,68 +309,62 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async indet(mobile, stype) {
|
async indet(mobile, stype) {
|
||||||
let data = await userindent(mobile,undefined,1,100);
|
let data = await userindent(mobile,undefined,1,100);
|
||||||
this.activeIndex = stype;
|
this.activeIndex = stype;
|
||||||
this.goldmedal = data;
|
this.goldmedal = data;
|
||||||
this.alllist=[];
|
this.alllist=[];
|
||||||
this.useralllist=[];
|
this.allmessage=[];
|
||||||
this.obligation=[];
|
this.useralllist=[];
|
||||||
this.receiving=[];
|
this.obligation=[];
|
||||||
this.pending=[];
|
this.receiving=[];
|
||||||
for (let i = 0; i < this.goldmedal.length; i++) {
|
this.pending=[];
|
||||||
this.useralllist.push(this.goldmedal[i].orderDetailList[0]);
|
for (let i = 0; i < this.goldmedal.length; i++) {
|
||||||
this.alllist.push(this.goldmedal[i].orderDetailList[0])
|
this.useralllist.push(this.goldmedal[i].orderDetailList[0]);
|
||||||
this.allmessage.push(this.goldmedal[i].orderDetailList[0])
|
this.alllist.push(this.goldmedal[i].orderDetailList[0])
|
||||||
if(this.goldmedal[i].status==0){
|
this.allmessage.push(this.goldmedal[i].orderDetailList[0])
|
||||||
this.obligation.push(this.goldmedal[i].orderDetailList[0]);
|
if(this.goldmedal[i].status==0){
|
||||||
}else if(this.goldmedal[i].status==1){
|
this.obligation.push(this.goldmedal[i].orderDetailList[0]);
|
||||||
this.receiving.push(this.goldmedal[i].orderDetailList[0]);
|
}else if(this.goldmedal[i].status==1){
|
||||||
}
|
this.receiving.push(this.goldmedal[i].orderDetailList[0]);
|
||||||
else if(this.useralllist[i].status==2){
|
}
|
||||||
this.pending.push(this.goldmedal[i].orderDetailList[0]);
|
else if(this.goldmedal[i].status==2){
|
||||||
}
|
this.pending.push(this.goldmedal[i].orderDetailList[0]);
|
||||||
}
|
}
|
||||||
for (var i = 0; i < this.useralllist.length; i++) {
|
}
|
||||||
this.useralllist[i].orderNumber = this.goldmedal[i].orderNumber;
|
for (let i = 0; i < this.goldmedal.length; i++) {
|
||||||
this.useralllist[i].status = this.goldmedal[i].status;
|
this.useralllist[i].orderNumber = this.goldmedal[i].orderNumber;
|
||||||
this.useralllist[i].addressUserName = this.goldmedal[i].addressUserName;
|
this.useralllist[i].status = this.goldmedal[i].status;
|
||||||
this.useralllist[i].phoneNumber = this.goldmedal[i].addressPhoneNumber;
|
this.useralllist[i].addressUserName = this.goldmedal[i].addressUserName;
|
||||||
this.useralllist[i].salesAmount = this.goldmedal[i].salesAmount;
|
this.useralllist[i].phoneNumber = this.goldmedal[i].addressPhoneNumber;
|
||||||
// this.useralllist[i].picFile = this.goldmedal[i].picFile; //图片路径
|
this.useralllist[i].salesAmount = this.goldmedal[i].salesAmount;
|
||||||
// this.useralllist[i].productName=this.goldmedal[i].productName;//商品名称
|
this.useralllist[i].lengthnum=this.goldmedal[i].orderDetailList.length;
|
||||||
// this.useralllist[i].ecPrice=this.goldmedal[i].ecPrice//第一个的单价
|
this.useralllist[i].paytype=this.goldmedal[i].paytype;
|
||||||
// this.useralllist[i].pcs=this.goldmedal[i].pcs//数量
|
}
|
||||||
|
if(this.userstype==1){
|
||||||
|
this.useralllist=this.obligation
|
||||||
|
}else if(this.userstype==2){
|
||||||
|
this.useralllist=this.pending
|
||||||
|
}
|
||||||
|
else if(this.userstype==0){
|
||||||
|
this.useralllist=this.allmessage
|
||||||
|
}
|
||||||
|
else if(this.userstype==3){
|
||||||
|
this.useralllist=this.receiving
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
this.useralllist[i].lengthnum=this.goldmedal[i].orderDetailList.length
|
|
||||||
}
|
|
||||||
console.log(this.obligation)
|
|
||||||
if(this.userstype==1){
|
|
||||||
this.useralllist=this.obligation
|
|
||||||
}else if(this.userstype==2){
|
|
||||||
this.useralllist=this.pending
|
|
||||||
}
|
|
||||||
else if(this.userstype==0){
|
|
||||||
this.useralllist=this.allmessage
|
|
||||||
}
|
|
||||||
else if(this.userstype==3){
|
|
||||||
this.useralllist=this.receiving
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
//订单立即支付
|
//订单立即支付
|
||||||
async getwei(item) {
|
async getwei(item) {
|
||||||
let data = await this.repayOrde(item.orderNumber);
|
let payType = this.util.pickPaytype();
|
||||||
|
let data = await this.repayOrde(item.orderNumber, payType);
|
||||||
if(data.code==1) {
|
if(data.code==1) {
|
||||||
let userPayData = {
|
let userPayData = {
|
||||||
userprice: item.usersalesAmount,
|
userprice: item.salesAmount,
|
||||||
orderId: item.orderNumber,
|
orderId: item.orderNumber,
|
||||||
userinformation: item.addressUserName + " " + item.addressPhoneNumber,
|
userinformation: item.addressUserName + " " + item.phoneNumber,
|
||||||
wxPay:data.msg
|
wxPay:data.msg
|
||||||
};
|
};
|
||||||
|
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
path: "/personal/userpay",
|
path: "/personal/userpay",
|
||||||
query: {
|
query: {
|
||||||
@ -443,51 +449,49 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
selectGoods(item, index) {
|
selectGoods(item, index) {
|
||||||
let list=[]
|
let list=[]
|
||||||
this.activeIndex = index;
|
this.activeIndex = index;
|
||||||
console.log(this.obligation)
|
if(item.title=='待付款'){
|
||||||
if(item.title=='待付款'){
|
list=this.obligation
|
||||||
list=this.obligation
|
}
|
||||||
}
|
else if(item.title=='待收货'){
|
||||||
else if(item.title=='待收货'){
|
list=this.receiving
|
||||||
list=this.receiving
|
}else if(item.title=='待发货'){
|
||||||
console.log(this.receiving);
|
this.useralllist=this.pending
|
||||||
|
list=this.pending
|
||||||
|
}
|
||||||
|
|
||||||
}else if(item.title=='待发货'){
|
else if(item.title=='全部'){
|
||||||
this.useralllist=this.pending
|
list=this.alllist
|
||||||
list=this.pending
|
}
|
||||||
}
|
this.useralllist=[];
|
||||||
|
for (var i = 0; i < this.useralllist.length; i++) {
|
||||||
else if(item.title=='全部'){
|
this.useralllist[i].orderNumber =this.goldmedal[i].orderNumber;
|
||||||
list=this.alllist
|
this.useralllist[i].status = this.goldmedal[i].status
|
||||||
}
|
this.useralllist[i].addressUserName =this.goldmedal[i].addressUserName;
|
||||||
this.useralllist=[];
|
this.useralllist[i].phoneNumber = this.goldmedal[i].phoneNumber;
|
||||||
console.log(this.useralllist,list);
|
this.useralllist[i].salesAmount = this.goldmedal[i].salesAmount;
|
||||||
for (var i = 0; i < this.useralllist.length; i++) {
|
this.useralllist[i].lengthnum=this.goldmedal[i].orderDetailList.length
|
||||||
this.useralllist[i].orderNumber =this.goldmedal[i].orderNumber;
|
}
|
||||||
this.useralllist[i].status = this.goldmedal[i].status
|
this.useralllist=list
|
||||||
this.useralllist[i].addressUserName =this.goldmedal[i].addressUserName;
|
|
||||||
this.useralllist[i].phoneNumber = this.goldmedal[i].phoneNumber;
|
|
||||||
this.useralllist[i].salesAmount = this.goldmedal[i].salesAmount;
|
|
||||||
this.useralllist[i].lengthnum=this.goldmedal[i].orderDetailList.length
|
|
||||||
}
|
|
||||||
this.useralllist=list
|
|
||||||
|
|
||||||
},
|
|
||||||
userfind(item) {
|
|
||||||
if(item.status==0){
|
|
||||||
this.getwei(item);
|
|
||||||
}else{
|
|
||||||
this.$router.push({
|
|
||||||
path: "/myorder/usertion",
|
|
||||||
query: {
|
|
||||||
stype: item.status,
|
|
||||||
orderNumber: item.orderNumber,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
userfind(item) {
|
||||||
|
this.paytypeWarning = this.util.checkPaytypeValidated(item.paytype);
|
||||||
|
this.showPaytypeWarning = !this.paytypeWarning.result;
|
||||||
|
if(this.paytypeWarning.result) {
|
||||||
|
if(item.status==0){
|
||||||
|
this.getwei(item);
|
||||||
|
}else{
|
||||||
|
this.$router.push({
|
||||||
|
path: "/myorder/usertion",
|
||||||
|
query: {
|
||||||
|
stype: item.status,
|
||||||
|
orderNumber: item.orderNumber,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
usertwo() {
|
usertwo() {
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
path: "/myorder/userrecord",
|
path: "/myorder/userrecord",
|
||||||
|
@ -175,6 +175,14 @@ export default {
|
|||||||
//TODO raise WX jsapi pay
|
//TODO raise WX jsapi pay
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
_hmt.push([
|
||||||
|
"_trackCustomEvent",
|
||||||
|
"payment",
|
||||||
|
{
|
||||||
|
"payType" : payType,
|
||||||
|
"product_amount" : this.userPayData.userprice,
|
||||||
|
}
|
||||||
|
])
|
||||||
},
|
},
|
||||||
goPayH5() {
|
goPayH5() {
|
||||||
let isMobile = this.util.isMobile();
|
let isMobile = this.util.isMobile();
|
||||||
@ -228,7 +236,14 @@ export default {
|
|||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.qrtext = '成功加入群的二维码';
|
this.qrtext = '成功加入群的二维码';
|
||||||
this.dialogSuccess = true;
|
this.dialogSuccess = true;
|
||||||
|
_hmt.push([
|
||||||
|
"_trackCustomEvent",
|
||||||
|
"payment_finished",
|
||||||
|
{
|
||||||
|
"payType" : 'native',
|
||||||
|
"product_amount" : this.userPayData.userprice,
|
||||||
|
}
|
||||||
|
])
|
||||||
} else if (res.fail) {
|
} else if (res.fail) {
|
||||||
this.dialogFail = true;
|
this.dialogFail = true;
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -39,8 +39,8 @@
|
|||||||
</li>
|
</li>
|
||||||
</ol>
|
</ol>
|
||||||
</div>
|
</div>
|
||||||
<div class="online rc-md-up"></div>
|
<div class="online rc-md-up" v-if="!inRxGoods"></div>
|
||||||
<div class="ts-scrollable-container">
|
<div class="ts-scrollable-container" v-if="!inRxGoods">
|
||||||
<h2>年龄:</h2>
|
<h2>年龄:</h2>
|
||||||
<ol class="ts-scrollable">
|
<ol class="ts-scrollable">
|
||||||
<li
|
<li
|
||||||
@ -54,8 +54,8 @@
|
|||||||
</li>
|
</li>
|
||||||
</ol>
|
</ol>
|
||||||
</div>
|
</div>
|
||||||
<div class="online rc-md-up"></div>
|
<div class="online rc-md-up" v-if="!inRxGoods"></div>
|
||||||
<div class="ts-scrollable-container">
|
<div class="ts-scrollable-container" v-if="!inRxGoods">
|
||||||
<h2>功能:</h2>
|
<h2>功能:</h2>
|
||||||
<ol class="ts-scrollable">
|
<ol class="ts-scrollable">
|
||||||
<li
|
<li
|
||||||
@ -69,8 +69,8 @@
|
|||||||
</li>
|
</li>
|
||||||
</ol>
|
</ol>
|
||||||
</div>
|
</div>
|
||||||
<div class="online rc-md-up"></div>
|
<div class="online rc-md-up" v-if="!inRxGoods"></div>
|
||||||
<div class="ts-scrollable-container">
|
<div class="ts-scrollable-container" v-if="!inRxGoods">
|
||||||
<h2>品种:</h2>
|
<h2>品种:</h2>
|
||||||
<ol class="ts-scrollable">
|
<ol class="ts-scrollable">
|
||||||
<li
|
<li
|
||||||
@ -84,6 +84,20 @@
|
|||||||
</li>
|
</li>
|
||||||
</ol>
|
</ol>
|
||||||
</div>
|
</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 class="online rc-md-up"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -313,12 +327,14 @@ import Myheader from "~/components/header.vue";
|
|||||||
import MyFooter from '~/components/rc-footer.vue'
|
import MyFooter from '~/components/rc-footer.vue'
|
||||||
import FixRight from "~/components/fixed-right.vue";
|
import FixRight from "~/components/fixed-right.vue";
|
||||||
import tabs from "~/components/tabs.vue";
|
import tabs from "~/components/tabs.vue";
|
||||||
|
import envData from "~/config/env-data.js";
|
||||||
import {
|
import {
|
||||||
userstype,
|
userstype,
|
||||||
biaome,
|
biaome,
|
||||||
biaomessage,
|
biaomessage,
|
||||||
searchchanpin,
|
searchchanpin,
|
||||||
userquery
|
userquery,
|
||||||
|
userque
|
||||||
} from "../../ajax/getData";
|
} from "../../ajax/getData";
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
@ -328,6 +344,8 @@ export default {
|
|||||||
path:'/productdetails/productlist/',
|
path:'/productdetails/productlist/',
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
envData,
|
||||||
|
rxFilters:[],
|
||||||
value: "",
|
value: "",
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
userstype: [],
|
userstype: [],
|
||||||
@ -507,13 +525,10 @@ export default {
|
|||||||
_self.chooseDefaultOptions();
|
_self.chooseDefaultOptions();
|
||||||
//_self.usetmessage();
|
//_self.usetmessage();
|
||||||
});
|
});
|
||||||
/*
|
//Handling RxGoods filter
|
||||||
if (stype !== "" && stype !== undefined) {
|
let curEnv = process.env.NODE_ENV;
|
||||||
this.onmessage(stype);//Wont happen
|
this.rxFilters = envData[curEnv].rxGoodsFilter;
|
||||||
} else {
|
//Handling RxGoods filter end
|
||||||
this.usetmessage();
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async usersearch(stype, usertype) {
|
async usersearch(stype, usertype) {
|
||||||
@ -598,7 +613,7 @@ export default {
|
|||||||
|
|
||||||
async usetmessage() {
|
async usetmessage() {
|
||||||
this.isLoading = true;
|
this.isLoading = true;
|
||||||
let data = await biaome(this.activeIndex1, "", 1, 10);
|
let data = await biaome(this.activeIndex1, "", 1, 20);
|
||||||
if (data) {
|
if (data) {
|
||||||
this.rccontair = data;
|
this.rccontair = data;
|
||||||
this.isLoading = false;
|
this.isLoading = false;
|
||||||
@ -606,12 +621,21 @@ export default {
|
|||||||
},
|
},
|
||||||
async onmessage(stype) {
|
async onmessage(stype) {
|
||||||
this.isLoading = true;
|
this.isLoading = true;
|
||||||
let data = await biaomessage(stype, "", 1, 10);
|
let data = await biaomessage(stype, "", 1, 20);
|
||||||
if (data) {
|
if (data) {
|
||||||
this.rccontair = data;
|
this.rccontair = data;
|
||||||
this.isLoading = false;
|
this.isLoading = false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
async getRxGoodsByFunc(functionName) {
|
||||||
|
this.isLoading = true;
|
||||||
|
let petType = this.activeIndex1;
|
||||||
|
let data = await userque(functionName, petType, 1, 20);
|
||||||
|
if (data) {
|
||||||
|
this.rccontair = data;
|
||||||
|
this.isLoading = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
chooseDefaultOptions(){
|
chooseDefaultOptions(){
|
||||||
let tagStatus = this.routeParams.tagStatus;
|
let tagStatus = this.routeParams.tagStatus;
|
||||||
let categoryName = this.routeParams.categoryName;
|
let categoryName = this.routeParams.categoryName;
|
||||||
@ -713,8 +737,24 @@ export default {
|
|||||||
else {
|
else {
|
||||||
this.prefecture[this.rxGoodsIndexPointer].checked=false;
|
this.prefecture[this.rxGoodsIndexPointer].checked=false;
|
||||||
this.inRxGoods=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(){
|
resetAllOptions(){
|
||||||
let _self = this;
|
let _self = this;
|
||||||
let categoriesSelectionEles=this.prefecture;
|
let categoriesSelectionEles=this.prefecture;
|
||||||
@ -725,6 +765,7 @@ export default {
|
|||||||
allSelectionEles.forEach(function(tmp,index){
|
allSelectionEles.forEach(function(tmp,index){
|
||||||
tmp.checked=false;
|
tmp.checked=false;
|
||||||
});
|
});
|
||||||
|
this.checkRxGoods(false);
|
||||||
this.userserachlist = [
|
this.userserachlist = [
|
||||||
{
|
{
|
||||||
categoryName: [], //专区
|
categoryName: [], //专区
|
||||||
|
@ -1,44 +1,54 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div class="rc-padding-y--lg">
|
||||||
<Myheader></Myheader>
|
<Myheader></Myheader>
|
||||||
<div class="rc-top"></div>
|
<div class="rc-top"></div>
|
||||||
<div class="ts-banner-swiper-container">
|
<div class="ts-banner-swiper-container">
|
||||||
<img src="/images/userbanner.png" alt="" class="user-pc" />
|
<picture>
|
||||||
<img src="/images/rc-phone.png" alt="" class="user-phone" />
|
<source
|
||||||
</div>
|
media="(max-width: 768px)"
|
||||||
<div class="all-contair">
|
srcset="/images/rc-phone.png"
|
||||||
<div class="all-contair dog-foot">
|
/>
|
||||||
<h2>明星犬粮</h2>
|
<source
|
||||||
<img src="/images/dogfoot.png" alt="" />
|
media="(min-width: 769px)"
|
||||||
<strong>中型幼犬离乳期全家奶糕</strong>
|
srcset="/images/userbanner.png"
|
||||||
<p>
|
/>
|
||||||
中心犬离乳期专属<br />高易再水合颗粒<br />
|
<img src="/images/banner/pc-weixin.png" />
|
||||||
帮助增强保护健康成长
|
</picture>
|
||||||
</p>
|
|
||||||
<em
|
|
||||||
class="ts-standard-btn ts-standard-btn--two rc-margin-y--md center"
|
|
||||||
@click="userselect(1)"
|
|
||||||
>
|
|
||||||
点击查看
|
|
||||||
</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)"
|
|
||||||
>
|
|
||||||
点击查看
|
|
||||||
</em>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
<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"
|
||||||
|
>
|
||||||
|
<h2 class="rc-beta rc-margin-y--md">{{ index==1?'明星猫粮':'明星犬粮' }}</h2>
|
||||||
|
<div
|
||||||
|
class="rc-click rc-margin-bottom--md"
|
||||||
|
@click="selectproduce(item, index)"
|
||||||
|
>
|
||||||
|
<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">
|
<div class="contair">
|
||||||
<nuxt-link :to="`/productdetails/productlist/`">
|
<nuxt-link :to="`/productdetails/productlist/`">
|
||||||
<span class="ts-standard-btn center">查看更多</span>
|
<span class="ts-standard-btn center">查看更多</span>
|
||||||
@ -49,219 +59,72 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Myheader from "~/components/header.vue";
|
import Myheader from "~/components/header.vue";
|
||||||
|
import envData from "~/config/env-data.js";
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {};
|
return {
|
||||||
|
envData,
|
||||||
|
dataList:{amature:[]}
|
||||||
|
};
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
Myheader,
|
Myheader,
|
||||||
},
|
},
|
||||||
|
mounted(){
|
||||||
|
let env=process.env.NODE_ENV;
|
||||||
|
this.dataList=this.envData[env];
|
||||||
|
},
|
||||||
methods:{
|
methods:{
|
||||||
userselect(item){
|
selectproduce(item) {
|
||||||
let productCode=88451
|
let isRxGoods = false;
|
||||||
if(item==1){
|
let productCode = [];
|
||||||
|
let mainProductCode = item.productCode;
|
||||||
this.$router.push({
|
if (!item.ecPrice && !item.price) {
|
||||||
path: "/productdetails/producted",
|
isRxGoods = 1;
|
||||||
query: {
|
productCode = [item.productCode];
|
||||||
stype: 1,
|
} else {
|
||||||
isRxGoods: false,
|
for (let i of item.productList) {
|
||||||
productCode: '80240008F24',
|
productCode.push(i.productCode);
|
||||||
},
|
}
|
||||||
});
|
}
|
||||||
}else{
|
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
path: "/productdetails/producted",
|
path: "/productdetails/producted",
|
||||||
query: {
|
query: {
|
||||||
stype: 1,
|
stype: 1,
|
||||||
isRxGoods: false,
|
isRxGoods: isRxGoods,
|
||||||
productCode: '80240008F24',
|
mainProductCode: mainProductCode,
|
||||||
},
|
productCode: productCode.join(","),
|
||||||
});
|
},
|
||||||
}
|
});
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped >
|
<style lang="less" scoped >
|
||||||
@import url("../../assets/css/global.less");
|
.ts-banner-swiper-container {
|
||||||
|
|
||||||
//手机端
|
|
||||||
@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 {
|
|
||||||
img {
|
img {
|
||||||
width: 100%;
|
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;
|
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.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;
|
||||||
|
}
|
||||||
|
.rc-column span {
|
||||||
|
height:auto;
|
||||||
|
}
|
||||||
|
.desc {
|
||||||
|
width:13rem;
|
||||||
|
height:auto;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
@ -144,47 +144,49 @@
|
|||||||
<script>
|
<script>
|
||||||
import { userLongin,sendMsg,vadatnmsg,userregOrLogin,inserdiscount } from "../../ajax/getData";
|
import { userLongin,sendMsg,vadatnmsg,userregOrLogin,inserdiscount } from "../../ajax/getData";
|
||||||
import { mapMutations } from "vuex";
|
import { mapMutations } from "vuex";
|
||||||
|
import envData from "~/config/env-data.js";
|
||||||
import Myheader from "~/components/header.vue"; //引用头部公共组件
|
import Myheader from "~/components/header.vue"; //引用头部公共组件
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
phone: "",
|
envData,
|
||||||
layerMSg: "手机格式不对",
|
phone: "",
|
||||||
tel: "",
|
layerMSg: "手机格式不对",
|
||||||
password: "",
|
tel: "",
|
||||||
userdata:{},
|
password: "",
|
||||||
allcheck:false,
|
userdata:{},
|
||||||
activeIndex: 0,
|
allcheck:false,
|
||||||
tamp:'',
|
activeIndex: 0,
|
||||||
radioData: [
|
tamp:'',
|
||||||
{ value: '全部' ,href:'https://royalcanin.com.cn/privacy' },
|
radioData: [
|
||||||
{ value: '部分' ,href:''},
|
{ value: '全部' ,href:'https://royalcanin.com.cn/privacy' },
|
||||||
{ value: '零散' }
|
{ value: '部分' ,href:''},
|
||||||
],
|
{ value: '零散' }
|
||||||
hash:'',
|
],
|
||||||
text: "",
|
hash:'',
|
||||||
sms: "",
|
text: "",
|
||||||
buttonmsg: "获取验证码",
|
sms: "",
|
||||||
flag: false,
|
buttonmsg: "获取验证码",
|
||||||
adminCode: "",
|
flag: false,
|
||||||
captchadata:'',
|
adminCode: "",
|
||||||
zhud: false,
|
captchadata:'',
|
||||||
loading: false,
|
zhud: false,
|
||||||
usertitle: true,
|
loading: false,
|
||||||
ifpassword: false,
|
usertitle: true,
|
||||||
verification:'',//验证码数据
|
ifpassword: false,
|
||||||
userislogin:[],//登录成功数据
|
verification:'',//验证码数据
|
||||||
checked: false,
|
userislogin:[],//登录成功数据
|
||||||
isRank: false,
|
checked: false,
|
||||||
isRanka: false,
|
isRank: false,
|
||||||
usercheckbox:false,
|
isRanka: false,
|
||||||
|
usercheckbox:false,
|
||||||
|
|
||||||
swiperData: [
|
swiperData: [
|
||||||
// { index: 1 ,title:'短信验证码登录'},
|
// { index: 1 ,title:'短信验证码登录'},
|
||||||
// { index: 2 ,title:'密码登录'},
|
// { index: 2 ,title:'密码登录'},
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
Myheader
|
Myheader
|
||||||
},
|
},
|
||||||
@ -228,7 +230,7 @@ export default {
|
|||||||
//全选
|
//全选
|
||||||
checkBoxa(e,order){
|
checkBoxa(e,order){
|
||||||
let checked=e.target.checked;
|
let checked=e.target.checked;
|
||||||
console.log(e.target.checked);
|
// console.log(e.target.checked);
|
||||||
// this.isRank=e.target.checked;
|
// this.isRank=e.target.checked;
|
||||||
// this.isRanka=e.target.checked;
|
// this.isRanka=e.target.checked;
|
||||||
if(order==3){
|
if(order==3){
|
||||||
@ -241,7 +243,7 @@ export default {
|
|||||||
else if(order==1){
|
else if(order==1){
|
||||||
this.isRanka=e.target.checked;
|
this.isRanka=e.target.checked;
|
||||||
}
|
}
|
||||||
console.log(this.isRank,this.isRanka);
|
//console.log(this.isRank,this.isRanka);
|
||||||
if(this.isRanka==true && this.isRank==true){
|
if(this.isRanka==true && this.isRank==true){
|
||||||
this.allcheck=true;
|
this.allcheck=true;
|
||||||
}else{
|
}else{
|
||||||
@ -268,7 +270,7 @@ export default {
|
|||||||
//console.log("-----");
|
//console.log("-----");
|
||||||
let data = await sendMsg(this.tel);
|
let data = await sendMsg(this.tel);
|
||||||
if(data){
|
if(data){
|
||||||
console.log(data);
|
//console.log(data);
|
||||||
//this.captchadata=data.msgNum;
|
//this.captchadata=data.msgNum;
|
||||||
this.tamp=data.tamp;
|
this.tamp=data.tamp;
|
||||||
this.hash=data.hash;
|
this.hash=data.hash;
|
||||||
@ -276,51 +278,46 @@ export default {
|
|||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
//添加优惠券
|
//添加优惠券
|
||||||
async serdiscount (mobile,couponId) {
|
async serdiscount (mobile,couponId) {
|
||||||
let data = await inserdiscount(mobile,couponId);
|
let data = await inserdiscount(mobile,couponId);
|
||||||
if(data){
|
if(data){
|
||||||
console.log(data);
|
|
||||||
}
|
|
||||||
//console.log(data);
|
|
||||||
},
|
|
||||||
|
|
||||||
//发送验证码数据
|
}
|
||||||
async vadmsg() {
|
//console.log(data);
|
||||||
//console.log("-----");
|
},
|
||||||
let data = await vadatnmsg(this.sms,this.hash,this.tamp);
|
|
||||||
if(data){
|
//发送验证码数据
|
||||||
return data;
|
async vadmsg() {
|
||||||
}
|
//console.log("-----");
|
||||||
|
let data = await vadatnmsg(this.sms,this.hash,this.tamp);
|
||||||
},
|
if(data){
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
},
|
||||||
//登录成功数据
|
//登录成功数据
|
||||||
async userlogin() {
|
async userlogin() {
|
||||||
//console.log("-----");
|
|
||||||
let data= await userregOrLogin(this.tel);
|
let data= await userregOrLogin(this.tel);
|
||||||
if(data){
|
if(data){
|
||||||
this.userislogin=data;
|
this.userislogin=data;
|
||||||
console.log(this.userislogin);
|
//console.log(this.userislogin);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
onClickHander(e) {
|
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 {
|
|
||||||
this.ifpassword = true;
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
selectGoods(item, index) {
|
||||||
|
this.activeIndex = index;
|
||||||
|
if (this.activeIndex == 0) {
|
||||||
|
this.ifpassword = false;
|
||||||
|
} else {
|
||||||
|
this.ifpassword = true;
|
||||||
|
}
|
||||||
|
},
|
||||||
//注册账户
|
//注册账户
|
||||||
useredd() {
|
useredd() {
|
||||||
//console.log("---注册账户");
|
|
||||||
this.usertitle = false;
|
this.usertitle = false;
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -336,7 +333,7 @@ export default {
|
|||||||
getCode() {
|
getCode() {
|
||||||
if (!/^[1][3,4,5,7,8][0-9]{9}$/.test(this.tel) || this.tel === "") {
|
if (!/^[1][3,4,5,7,8][0-9]{9}$/.test(this.tel) || this.tel === "") {
|
||||||
this.$message({
|
this.$message({
|
||||||
type: 'warning',
|
type: 'error',
|
||||||
message: '手机号码输入有误'
|
message: '手机号码输入有误'
|
||||||
});
|
});
|
||||||
return
|
return
|
||||||
@ -361,85 +358,90 @@ export default {
|
|||||||
async register() {
|
async register() {
|
||||||
if (!/^[1][3,4,5,7,8][0-9]{9}$/.test(this.tel) || this.tel === "") {
|
if (!/^[1][3,4,5,7,8][0-9]{9}$/.test(this.tel) || this.tel === "") {
|
||||||
this.$message({
|
this.$message({
|
||||||
type: 'warning',
|
type: 'error',
|
||||||
message: '手机号码输入有误'
|
message: '手机号码输入有误'
|
||||||
});
|
});
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if(this.sms==''){
|
if(this.sms==''){
|
||||||
this.$message({
|
this.$message({
|
||||||
type: 'warning',
|
type: 'error',
|
||||||
message: '请输入验证码'
|
message: '请输入验证码'
|
||||||
});
|
});
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if(this.usercheckbox==false){
|
if(this.usercheckbox==false){
|
||||||
this.$message({
|
this.$message({
|
||||||
type: 'warning',
|
type: 'error',
|
||||||
message: '请先勾选相关协议'
|
message: '请先勾选相关协议'
|
||||||
});
|
});
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if(this.usercheckbox==false){
|
if(this.usercheckbox==false){
|
||||||
//console.log('----');
|
|
||||||
if (!/^[1][3,4,5,7,8][0-9]{9}$/.test(this.tel) || this.tel === "") {
|
if (!/^[1][3,4,5,7,8][0-9]{9}$/.test(this.tel) || this.tel === "") {
|
||||||
this.$message({
|
this.$message({
|
||||||
type: 'warning',
|
type: 'error',
|
||||||
message: '手机号码输入有误'
|
message: '手机号码输入有误'
|
||||||
});
|
});
|
||||||
this.$message({
|
this.$message({
|
||||||
type: 'warning',
|
type: 'error',
|
||||||
message: '请先同意隐私声明和账号使用协议'
|
message: '请先同意隐私声明和账号使用协议'
|
||||||
});
|
});
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
console.log('===')
|
|
||||||
let data=await this.vadmsg();
|
let data=await this.vadmsg();
|
||||||
if(data.code=="1")
|
if(data.code=="1")
|
||||||
{
|
{
|
||||||
data = await userregOrLogin(this.tel);
|
data = await userregOrLogin(this.tel);
|
||||||
console.log(data);
|
let token=JSON.stringify(data);
|
||||||
let token=JSON.stringify(data);
|
this.changeClod({ cloud: token });
|
||||||
this.changeClod({ cloud: token });
|
this.checkIsLogin();
|
||||||
this.checkIsLogin();
|
let returnMessage='';
|
||||||
if(data.type==1){
|
if(data.type==1) {
|
||||||
if(data.data.memberName===undefined){
|
if(data.data.memberName===undefined){
|
||||||
this.$message({
|
returnMessage = '欢迎回来';
|
||||||
type: 'warning',
|
}
|
||||||
message: '欢迎回来'
|
else{
|
||||||
});
|
returnMessage = '欢迎回来'+data.data.memberName;
|
||||||
console.log('-----')
|
}
|
||||||
}
|
_hmt.push([
|
||||||
else{
|
"_trackCustomEvent",
|
||||||
this.$message({
|
"login",
|
||||||
type: 'warning',
|
{}
|
||||||
message: '欢迎回来'+data.data.memberName
|
])
|
||||||
});
|
} else if(data.type==2) {
|
||||||
}
|
returnMessage = '恭喜注册成功';
|
||||||
}else if(data.type==2){
|
_hmt.push([
|
||||||
this.$message({
|
"_trackCustomEvent",
|
||||||
type: 'warning',
|
"register",
|
||||||
message: '恭喜注册成功'
|
{}
|
||||||
});
|
])
|
||||||
let couponId='0000000123';
|
|
||||||
this.serdiscount(this.tel,couponId);
|
let curEnv = process.env.NODE_ENV;
|
||||||
setTimeout(() => {
|
let newGuestCouponCodes = envData[curEnv].newGuestCoupon;
|
||||||
this.serdiscount(this.tel,"0000000140");
|
let couponId=newGuestCouponCodes[0];
|
||||||
}, 100);
|
this.serdiscount(this.tel,couponId);
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.serdiscount(this.tel,"0000000122");
|
this.serdiscount(this.tel,newGuestCouponCodes[1]);
|
||||||
}, 500);
|
}, 100);
|
||||||
}
|
setTimeout(() => {
|
||||||
this.$router.push({
|
this.serdiscount(this.tel,newGuestCouponCodes[2]);
|
||||||
path: "/",
|
}, 500);
|
||||||
});
|
setTimeout(() => {
|
||||||
|
this.serdiscount(this.tel,newGuestCouponCodes[3]);
|
||||||
|
}, 500);
|
||||||
|
}
|
||||||
|
this.$router.push({
|
||||||
|
path: "/",
|
||||||
|
query:{msg:returnMessage}
|
||||||
|
});
|
||||||
}else{
|
}else{
|
||||||
this.$message({
|
this.$message({
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
message: data.msg,
|
message: data.msg,
|
||||||
});
|
});
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}},
|
}},
|
||||||
|
@ -78,7 +78,7 @@
|
|||||||
</ol>
|
</ol>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="ts-scrollable-container">
|
<div class="ts-scrollable-container" v-if="!inRxGoods">
|
||||||
<h2>年龄:</h2>
|
<h2>年龄:</h2>
|
||||||
<ol class="ts-scrollable">
|
<ol class="ts-scrollable">
|
||||||
<li
|
<li
|
||||||
@ -92,6 +92,21 @@
|
|||||||
</li>
|
</li>
|
||||||
</ol>
|
</ol>
|
||||||
</div>
|
</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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -177,7 +192,7 @@
|
|||||||
</ol>
|
</ol>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="ts-scrollable-container">
|
<div class="ts-scrollable-container" v-if="!inRxGoods">
|
||||||
<h2>年龄:</h2>
|
<h2>年龄:</h2>
|
||||||
<ol class="ts-scrollable">
|
<ol class="ts-scrollable">
|
||||||
<li
|
<li
|
||||||
@ -191,7 +206,7 @@
|
|||||||
</li>
|
</li>
|
||||||
</ol>
|
</ol>
|
||||||
</div>
|
</div>
|
||||||
<div class="ts-scrollable-container">
|
<div class="ts-scrollable-container" v-if="!inRxGoods">
|
||||||
<h2>功能:</h2>
|
<h2>功能:</h2>
|
||||||
<ol class="ts-scrollable">
|
<ol class="ts-scrollable">
|
||||||
<li
|
<li
|
||||||
@ -205,7 +220,7 @@
|
|||||||
</li>
|
</li>
|
||||||
</ol>
|
</ol>
|
||||||
</div>
|
</div>
|
||||||
<div class="ts-scrollable-container">
|
<div class="ts-scrollable-container" v-if="!inRxGoods">
|
||||||
<h2>品种:</h2>
|
<h2>品种:</h2>
|
||||||
<ol class="ts-scrollable">
|
<ol class="ts-scrollable">
|
||||||
<li
|
<li
|
||||||
@ -220,6 +235,20 @@
|
|||||||
</ol>
|
</ol>
|
||||||
</div>
|
</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>
|
</div>
|
||||||
|
|
||||||
@ -263,7 +292,7 @@
|
|||||||
</ol>
|
</ol>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="ts-scrollable-container">
|
<div class="ts-scrollable-container" v-if="!inRxGoods">
|
||||||
<h2>年龄:</h2>
|
<h2>年龄:</h2>
|
||||||
<ol class="ts-scrollable">
|
<ol class="ts-scrollable">
|
||||||
<li
|
<li
|
||||||
@ -277,7 +306,7 @@
|
|||||||
</li>
|
</li>
|
||||||
</ol>
|
</ol>
|
||||||
</div>
|
</div>
|
||||||
<div class="ts-scrollable-container">
|
<div class="ts-scrollable-container" v-if="!inRxGoods">
|
||||||
<h2>功能:</h2>
|
<h2>功能:</h2>
|
||||||
<ol class="ts-scrollable">
|
<ol class="ts-scrollable">
|
||||||
<li
|
<li
|
||||||
@ -291,7 +320,7 @@
|
|||||||
</li>
|
</li>
|
||||||
</ol>
|
</ol>
|
||||||
</div>
|
</div>
|
||||||
<div class="ts-scrollable-container">
|
<div class="ts-scrollable-container" v-if="!inRxGoods">
|
||||||
<h2>品种:</h2>
|
<h2>品种:</h2>
|
||||||
<ol class="ts-scrollable">
|
<ol class="ts-scrollable">
|
||||||
<li
|
<li
|
||||||
@ -305,6 +334,19 @@
|
|||||||
</li>
|
</li>
|
||||||
</ol>
|
</ol>
|
||||||
</div>
|
</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>
|
</div>
|
||||||
<!--
|
<!--
|
||||||
@ -331,16 +373,19 @@ import Myheader from "~/components/header.vue";
|
|||||||
import MyFooter from '~/components/rc-footer.vue'
|
import MyFooter from '~/components/rc-footer.vue'
|
||||||
import FixRight from "~/components/fixed-right.vue";
|
import FixRight from "~/components/fixed-right.vue";
|
||||||
import tabs from "~/components/tabs.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 {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
value: "",
|
value: "",
|
||||||
|
envData,
|
||||||
crumbs:[
|
crumbs:[
|
||||||
{
|
{
|
||||||
path:'/usersearch/search/',
|
path:'/usersearch/search/',
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
rxFilters:[],
|
||||||
isLoading: true,
|
isLoading: true,
|
||||||
userserachlist: [
|
userserachlist: [
|
||||||
{
|
{
|
||||||
@ -528,6 +573,10 @@ export default {
|
|||||||
mounted() {
|
mounted() {
|
||||||
this.usetmessage();
|
this.usetmessage();
|
||||||
this.userst();
|
this.userst();
|
||||||
|
//Handling RxGoods filter
|
||||||
|
let curEnv = process.env.NODE_ENV;
|
||||||
|
this.rxFilters = envData[curEnv].rxGoodsFilter;
|
||||||
|
//Handling RxGoods filter end
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
//换一批
|
//换一批
|
||||||
@ -605,6 +654,15 @@ export default {
|
|||||||
this.isLoading=false;
|
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() {
|
async userst() {
|
||||||
this.isLoading = true;
|
this.isLoading = true;
|
||||||
let pinzhong = [];
|
let pinzhong = [];
|
||||||
@ -721,6 +779,19 @@ export default {
|
|||||||
this.inRxGoods=false;
|
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(){
|
resetAllOptions(){
|
||||||
let _self = this;
|
let _self = this;
|
||||||
let categoriesSelectionEles=this.prefecture;
|
let categoriesSelectionEles=this.prefecture;
|
||||||
@ -731,6 +802,7 @@ export default {
|
|||||||
allSelectionEles.forEach(function(tmp,index){
|
allSelectionEles.forEach(function(tmp,index){
|
||||||
tmp.checked=false;
|
tmp.checked=false;
|
||||||
});
|
});
|
||||||
|
this.checkRxGoods(false);
|
||||||
this.userserachlist = [
|
this.userserachlist = [
|
||||||
{
|
{
|
||||||
categoryName: [], //专区
|
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 h = time.getHours() < 10 ? '0' + time.getHours() : time.getHours();
|
||||||
var mm = time.getMinutes() < 10 ? '0' + time.getMinutes() : time.getMinutes();
|
var mm = time.getMinutes() < 10 ? '0' + time.getMinutes() : time.getMinutes();
|
||||||
var s = time.getSeconds() < 10 ? '0' + time.getSeconds() : time.getSeconds();
|
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;
|
return timedate;
|
||||||
}else{
|
}else{
|
||||||
var time = new Date(te);
|
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 h = time.getHours() < 10 ? '0' + time.getHours() : time.getHours();
|
||||||
var mm = time.getMinutes() < 10 ? '0' + time.getMinutes() : time.getMinutes();
|
var mm = time.getMinutes() < 10 ? '0' + time.getMinutes() : time.getMinutes();
|
||||||
var s = time.getSeconds() < 10 ? '0' + time.getSeconds() : time.getSeconds();
|
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;
|
return timedate;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -325,9 +325,7 @@
|
|||||||
<properties>
|
<properties>
|
||||||
<profiles.active>dev</profiles.active>
|
<profiles.active>dev</profiles.active>
|
||||||
</properties>
|
</properties>
|
||||||
<activation>
|
|
||||||
<activeByDefault>true</activeByDefault>
|
|
||||||
</activation>
|
|
||||||
</profile>
|
</profile>
|
||||||
<profile>
|
<profile>
|
||||||
<id>telework</id>
|
<id>telework</id>
|
||||||
@ -352,6 +350,9 @@
|
|||||||
<properties>
|
<properties>
|
||||||
<profiles.active>prod</profiles.active>
|
<profiles.active>prod</profiles.active>
|
||||||
</properties>
|
</properties>
|
||||||
|
<activation>
|
||||||
|
<activeByDefault>true</activeByDefault>
|
||||||
|
</activation>
|
||||||
</profile>
|
</profile>
|
||||||
</profiles>
|
</profiles>
|
||||||
|
|
||||||
|
@ -17,7 +17,6 @@ import java.util.UUID;
|
|||||||
@Service
|
@Service
|
||||||
public class AliPayService {
|
public class AliPayService {
|
||||||
|
|
||||||
public static String notify_url = "http://47.96.75.242:10086/smart-admin-api/royalcanin/updateOrderAliPay";
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private OrderService orderService;
|
private OrderService orderService;
|
||||||
@ -34,7 +33,7 @@ public class AliPayService {
|
|||||||
model.setGoodsDetail(aliPayEntity.getGoodsDetail());
|
model.setGoodsDetail(aliPayEntity.getGoodsDetail());
|
||||||
AlipayTradePrecreateRequest request = new AlipayTradePrecreateRequest();
|
AlipayTradePrecreateRequest request = new AlipayTradePrecreateRequest();
|
||||||
request.setBizModel(model);
|
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);
|
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);
|
AlipayTradePrecreateResponse alipayTradePrecreateResponse = alipayClient.execute(request);
|
||||||
if (alipayTradePrecreateResponse.isSuccess()) {
|
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.MapRemoveNullUtil;
|
||||||
import net.lab1024.smartadmin.util.SmartHttpUtil;
|
import net.lab1024.smartadmin.util.SmartHttpUtil;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
@ -47,7 +48,8 @@ public class AlipayController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private OrderService orderService;
|
private OrderService orderService;
|
||||||
|
|
||||||
String url = "https://miniapp-test.royalcanin.com.cn/rcmini/h5/";
|
@Value("${royalcanin.goods}")
|
||||||
|
private String url ;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private MemberAccountService memberAccountService;
|
private MemberAccountService memberAccountService;
|
||||||
|
@ -20,6 +20,7 @@ public class AlipayConfig {
|
|||||||
// 应用ID,您的APPID,收款账号既是您的APPID对应支付宝账号
|
// 应用ID,您的APPID,收款账号既是您的APPID对应支付宝账号
|
||||||
// public static String app_id = "2016101800716209";
|
// public static String app_id = "2016101800716209";
|
||||||
public static String app_id = "2021003108690157";
|
public static String app_id = "2021003108690157";
|
||||||
|
// public static String app_id = "2088341384149564";
|
||||||
|
|
||||||
// 商户私钥,您的PKCS8格式RSA2私钥
|
// 商户私钥,您的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";
|
// 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下的支付宝公钥。
|
// 支付宝公钥,查看地址: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 ="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 ="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这类自定义参数,必须外网可以正常访问
|
// 服务器异步通知页面路径 需http://格式的完整路径,不能加?id=123这类自定义参数,必须外网可以正常访问
|
||||||
public static String notify_url = "https://royalcanincn.escase.cn/jc/royalcanin/royalcanin/updateOrderAliPay";
|
public static String notify_url = "https://royalcanincn.escase.cn/jc/royalcanin/royalcanin/updateOrderAliPay";
|
||||||
// 页面跳转同步通知页面路径 需http://格式的完整路径,不能加?id=123这类自定义参数,必须外网可以正常访问
|
// 页面跳转同步通知页面路径 需http://格式的完整路径,不能加?id=123这类自定义参数,必须外网可以正常访问
|
||||||
|
@ -38,7 +38,8 @@ import java.util.UUID;
|
|||||||
@Service
|
@Service
|
||||||
public class LoginTokenService {
|
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.module.system.royalcanin.couponConfig.CouponConfigGetEntity;
|
||||||
import net.lab1024.smartadmin.util.MapRemoveNullUtil;
|
import net.lab1024.smartadmin.util.MapRemoveNullUtil;
|
||||||
import net.lab1024.smartadmin.util.SmartHttpUtil;
|
import net.lab1024.smartadmin.util.SmartHttpUtil;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class CouponConfigService {
|
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{
|
public String couponConfigGet(CouponConfigGetEntity couponConfigGetEntity) throws Exception{
|
||||||
Map<String, String> paramMap = MapRemoveNullUtil.setConditionMap(couponConfigGetEntity);
|
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.module.system.royalcanin.coupon.*;
|
||||||
import net.lab1024.smartadmin.util.MapRemoveNullUtil;
|
import net.lab1024.smartadmin.util.MapRemoveNullUtil;
|
||||||
import net.lab1024.smartadmin.util.SmartHttpUtil;
|
import net.lab1024.smartadmin.util.SmartHttpUtil;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class CouponService {
|
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{
|
public String couponCancel(CouponCancelEntity couponCancelEntity) throws Exception{
|
||||||
Map<String, String> paramMap = MapRemoveNullUtil.setConditionMap(couponCancelEntity);
|
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.module.system.royalcanin.memberAccount.MemberAccountHistoryEntity;
|
||||||
import net.lab1024.smartadmin.util.MapRemoveNullUtil;
|
import net.lab1024.smartadmin.util.MapRemoveNullUtil;
|
||||||
import net.lab1024.smartadmin.util.SmartHttpUtil;
|
import net.lab1024.smartadmin.util.SmartHttpUtil;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -16,7 +16,8 @@ import java.util.Map;
|
|||||||
@Service
|
@Service
|
||||||
public class MemberAccountService {
|
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){
|
public String memberAccountChange(MemberAccountChangeEntity memberAccountChangeEntity){
|
||||||
memberAccountChangeEntity.setChannelId(15);
|
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.module.system.royalcanin.memberAddress.MemberAddressUpdateEntity;
|
||||||
import net.lab1024.smartadmin.util.MapRemoveNullUtil;
|
import net.lab1024.smartadmin.util.MapRemoveNullUtil;
|
||||||
import net.lab1024.smartadmin.util.SmartHttpUtil;
|
import net.lab1024.smartadmin.util.SmartHttpUtil;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class MemberAddressService {
|
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 {
|
public String membberAddressGetAll(MemberAddressGetAllEntity memberAddressGetAllEntity) throws Exception {
|
||||||
Map<String, String> paramMap = MapRemoveNullUtil.setConditionMap(memberAddressGetAllEntity);
|
Map<String, String> paramMap = MapRemoveNullUtil.setConditionMap(memberAddressGetAllEntity);
|
||||||
@ -24,14 +24,14 @@ public class MemberAddressService {
|
|||||||
return SmartHttpUtil.sendPostForm(url+"getAll",paramMap,null);
|
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);
|
Map<String, String> paramMap = MapRemoveNullUtil.setConditionMap(memberAddressAddEntity);
|
||||||
MapRemoveNullUtil.removeNullEntry(paramMap);
|
MapRemoveNullUtil.removeNullEntry(paramMap);
|
||||||
net.sf.json.JSONObject jsonObject = net.sf.json.JSONObject.fromObject(paramMap);
|
net.sf.json.JSONObject jsonObject = net.sf.json.JSONObject.fromObject(paramMap);
|
||||||
return SmartHttpUtil.httpPostRaw(url+"add",jsonObject.toString(),null,"utf-8");
|
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);
|
Map<String, String> paramMap = MapRemoveNullUtil.setConditionMap(memberAddressUpdateEntity);
|
||||||
paramMap.put("id",StringUtil.toString(memberAddressUpdateEntity.equals("0")?null:StringUtil.toString(memberAddressUpdateEntity.getId())));
|
paramMap.put("id",StringUtil.toString(memberAddressUpdateEntity.equals("0")?null:StringUtil.toString(memberAddressUpdateEntity.getId())));
|
||||||
MapRemoveNullUtil.removeNullEntry(paramMap);
|
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.MapRemoveNullUtil;
|
||||||
import net.lab1024.smartadmin.util.SmartJWTUtil;
|
import net.lab1024.smartadmin.util.SmartJWTUtil;
|
||||||
import net.lab1024.smartadmin.util.SmartHttpUtil;
|
import net.lab1024.smartadmin.util.SmartHttpUtil;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class MemberService {
|
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 {
|
public String memberGet(MemberGetEntity memberGetEntity)throws Exception {
|
||||||
Map<String, String> paramMap = MapRemoveNullUtil.setConditionMap(memberGetEntity);
|
Map<String, String> paramMap = MapRemoveNullUtil.setConditionMap(memberGetEntity);
|
||||||
|
@ -73,13 +73,13 @@ public class TransitionController {
|
|||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case "get":
|
case "get":
|
||||||
result = memberService.memberGet(objectMapper.convertValue(object,MemberGetEntity.class)).toString();
|
result = memberService.memberGet(objectMapper.convertValue(object,MemberGetEntity.class));
|
||||||
break;
|
break;
|
||||||
case "check":
|
case "check":
|
||||||
result = memberService.memberCheck(objectMapper.convertValue(object,MemberCheckEntity.class));
|
result = memberService.memberCheck(objectMapper.convertValue(object,MemberCheckEntity.class));
|
||||||
break;
|
break;
|
||||||
case "add":
|
case "add":
|
||||||
result = memberService.memberAdd(objectMapper.convertValue(object,MemberAddEntity.class)).toString();
|
result = memberService.memberAdd(objectMapper.convertValue(object,MemberAddEntity.class));
|
||||||
break;
|
break;
|
||||||
case "updateMemberLevel":
|
case "updateMemberLevel":
|
||||||
result = memberService.memberUpdateMemberLevel(objectMapper.convertValue(object, MemberUpdateMemberLevelEntity.class));
|
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.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import net.lab1024.smartadmin.common.anno.OperateLog;
|
import net.lab1024.smartadmin.common.anno.OperateLog;
|
||||||
@ -118,16 +117,21 @@ public class GoodController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
String result = "";
|
||||||
|
try{
|
||||||
|
long startTime = System.currentTimeMillis();
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
long startTime = System.currentTimeMillis();
|
|
||||||
String 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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "查询商品信息", notes = "查询商品信息")
|
@ApiOperation(value = "查询商品信息", notes = "查询商品信息")
|
||||||
|
@ -3,7 +3,6 @@ package net.lab1024.smartadmin.module.system.royalcanin.good;
|
|||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.alipay.api.internal.util.AlipaySignature;
|
import com.alipay.api.internal.util.AlipaySignature;
|
||||||
import com.beust.jcommander.Parameter;
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import net.lab1024.smartadmin.common.anno.OperateLog;
|
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.OrderAddress;
|
||||||
import net.lab1024.smartadmin.module.system.royalcanin.good.model.OrderEntity;
|
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.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.CartService;
|
||||||
import net.lab1024.smartadmin.module.system.royalcanin.good.service.OrderService;
|
import net.lab1024.smartadmin.module.system.royalcanin.good.service.OrderService;
|
||||||
import net.lab1024.smartadmin.module.system.royalcanin.orderMaster.OrderDatilListEntity;
|
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.WxpayService;
|
||||||
import net.lab1024.smartadmin.module.system.wxpay.wxPayModel.WxPayEntity;
|
import net.lab1024.smartadmin.module.system.wxpay.wxPayModel.WxPayEntity;
|
||||||
import net.lab1024.smartadmin.util.GenerateSequenceUtil;
|
import net.lab1024.smartadmin.util.GenerateSequenceUtil;
|
||||||
import net.lab1024.smartadmin.util.MapRemoveNullUtil;
|
|
||||||
import net.lab1024.smartadmin.util.SmartHttpUtil;
|
|
||||||
import net.sf.json.JSONArray;
|
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.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.URLEncoder;
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
@Api(tags = {SwaggerTagConst.Admin.MANAGER_MALL_API})
|
@Api(tags = {SwaggerTagConst.Admin.MANAGER_MALL_API})
|
||||||
@ -77,65 +70,73 @@ public class OrderController {
|
|||||||
JSONArray orderDatilListJson = new JSONArray();
|
JSONArray orderDatilListJson = new JSONArray();
|
||||||
OrdersEntity ordersEntity = new OrdersEntity();
|
OrdersEntity ordersEntity = new OrdersEntity();
|
||||||
OrderAddress orderAddress = new OrderAddress();
|
OrderAddress orderAddress = new OrderAddress();
|
||||||
for (OrdersEntity ordersEntitys:ordersEntityList) {
|
try {
|
||||||
cartService.cancelProduct(ordersEntitys.getMemberId(),ordersEntity.getProductCode());
|
for (OrdersEntity ordersEntitys : ordersEntityList) {
|
||||||
//存储orderDetailList
|
// System.out.println("ordersEntityList.size()"+ordersEntityList.size());
|
||||||
OrderDatilListEntity orderDatilListEntity= new OrderDatilListEntity();
|
cartService.cancelProduct(ordersEntitys.getMemberId(), ordersEntity.getProductCode());
|
||||||
orderDatilListEntity.setProductName(ordersEntitys.getProductName());
|
//存储orderDetailList
|
||||||
orderDatilListEntity.setPcs(ordersEntitys.getBuyCount());
|
OrderDatilListEntity orderDatilListEntity = new OrderDatilListEntity();
|
||||||
orderDatilListEntity.setProductCode(ordersEntitys.getProductCode());
|
orderDatilListEntity.setProductName(ordersEntitys.getProductName());
|
||||||
orderDatilListEntity.setEcPrice(ordersEntitys.getPayAmount());
|
orderDatilListEntity.setPcs(ordersEntitys.getBuyCount());
|
||||||
orderDatilListJson.add(orderDatilListEntity);
|
orderDatilListEntity.setProductCode(ordersEntitys.getProductCode());
|
||||||
if(ordersEntitys.getCouponCode() != "" && ordersEntitys.getCouponCode() != null) {
|
orderDatilListEntity.setEcPrice(ordersEntitys.getPayAmount());
|
||||||
CouponGetAllEntity couponGetAllEntity = new CouponGetAllEntity ();
|
orderDatilListJson.add(orderDatilListEntity);
|
||||||
couponGetAllEntity.setMemberId(ordersEntitys.getMemberId());
|
if (ordersEntitys.getCouponCode() != "" && ordersEntitys.getCouponCode() != null) {
|
||||||
couponGetAllEntity.setCouponCode(ordersEntitys.getCouponCode());
|
CouponGetAllEntity couponGetAllEntity = new CouponGetAllEntity();
|
||||||
String couponInfo = couponService.couponGetAll(couponGetAllEntity);
|
couponGetAllEntity.setMemberId(ordersEntitys.getMemberId());
|
||||||
JSONObject jsonObject = JSONObject.parseObject(couponInfo);
|
couponGetAllEntity.setCouponCode(ordersEntitys.getCouponCode());
|
||||||
com.alibaba.fastjson.JSONArray jsonArray = JSONObject.parseArray(jsonObject.getString("data"));
|
String couponInfo = couponService.couponGetAll(couponGetAllEntity);
|
||||||
JSONObject jsonObjectData = (JSONObject)jsonArray.get(0);
|
JSONObject jsonObject = JSONObject.parseObject(couponInfo);
|
||||||
|
com.alibaba.fastjson.JSONArray jsonArray = JSONObject.parseArray(jsonObject.getString("data"));
|
||||||
|
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.setCouponCode(jsonObjectData.getString("couponCode"));
|
||||||
ordersEntity.setCouponName(jsonObjectData.getString("couponName"));
|
ordersEntity.setCouponName(jsonObjectData.getString("couponName"));
|
||||||
ordersEntity.setCouponId(jsonObjectData.getString("couponId"));
|
ordersEntity.setCouponId(jsonObjectData.getString("couponId"));
|
||||||
total_fee = total_fee + orderService.couponTotal(ordersEntitys.getCouponTypeId(),Double.parseDouble(ordersEntitys.getCouponAmount()),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{
|
} else {
|
||||||
total_fee = total_fee + Double.parseDouble(ordersEntitys.getPayAmount()) * ordersEntitys.getBuyCount() ;
|
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() + ",");
|
||||||
|
memberId = ordersEntitys.getMemberId();
|
||||||
|
mobile = ordersEntitys.getPhoneNumber();
|
||||||
|
buyCount = buyCount + ordersEntitys.getBuyCount();
|
||||||
}
|
}
|
||||||
basePoint = basePoint + ordersEntitys.getBasePoint();
|
ordersEntity.setOrderAddress(orderAddress);
|
||||||
orderAddress.setAddressCityName(ordersEntitys.getOrderAddress().getAddressCityName());
|
ordersEntity.setProductCode(productId.substring(0, productId.length() - 1));
|
||||||
orderAddress.setAddressCountyName(ordersEntitys.getOrderAddress().getAddressCountyName());
|
ordersEntity.setProductName(productName.substring(0, productName.length() - 1));
|
||||||
orderAddress.setAddressDetailInfo(ordersEntitys.getOrderAddress().getAddressDetailInfo());
|
ordersEntity.setOrderAmount(StringUtil.toString(total_fee));
|
||||||
orderAddress.setAddressPhoneNumber(ordersEntitys.getOrderAddress().getAddressPhoneNumber());
|
ordersEntity.setMemberId(memberId);
|
||||||
orderAddress.setAddressUserName(ordersEntitys.getOrderAddress().getAddressUserName());
|
ordersEntity.setPhoneNumber(mobile);
|
||||||
orderAddress.setAddressProvinceName(ordersEntitys.getOrderAddress().getAddressProvinceName());
|
ordersEntity.setBuyCount(buyCount);
|
||||||
productId.append(ordersEntitys.getProductCode()+",");
|
ordersEntity.setOrderNo(GenerateSequenceUtil.generateSequenceNo());
|
||||||
productName.append(ordersEntitys.getProductName()+",");
|
ordersEntity.setOrderStatus("0");
|
||||||
memberId = ordersEntitys.getMemberId();
|
ordersEntity.setBasePoint(basePoint);
|
||||||
mobile = ordersEntitys.getPhoneNumber();
|
int result = orderService.generateOrder(ordersEntity, orderDatilListJson);
|
||||||
buyCount = buyCount + ordersEntitys.getBuyCount();
|
if (result == 1) {
|
||||||
}
|
System.out.println("orderService.generateOrder(ordersEntity, orderDatilListJson) == 1");
|
||||||
ordersEntity.setOrderAddress(orderAddress);
|
wxPayEntity.setProduct_id(ordersEntity.getProductCode());
|
||||||
ordersEntity.setProductCode(productId.substring(0,productId.length()-1));
|
wxPayEntity.setTotal_fee(StringUtil.toString(total_fee));
|
||||||
ordersEntity.setProductName(productName.substring(0,productName.length()-1));
|
wxPayEntity.setOut_trade_no(ordersEntity.getOrderNo());
|
||||||
ordersEntity.setOrderAmount(StringUtil.toString(total_fee));
|
Map<String, String> returnMap = new HashMap<>();
|
||||||
ordersEntity.setMemberId(memberId);
|
returnMap.put("orderNumber", ordersEntity.getOrderNo());
|
||||||
ordersEntity.setPhoneNumber(mobile);
|
returnMap.put("orderAmount", ordersEntity.getOrderAmount());
|
||||||
ordersEntity.setBuyCount(buyCount);
|
return ResponseDTO.succData(returnMap, wxpayService.generateQRCode(wxPayEntity));
|
||||||
ordersEntity.setOrderNo(GenerateSequenceUtil.generateSequenceNo());
|
}else if (result == 3){
|
||||||
ordersEntity.setOrderStatus("0");
|
return ResponseDTO.wrap(OrderResponseCodeConst.GENERATE_FAIL_COUPONDED);
|
||||||
ordersEntity.setBasePoint(basePoint);
|
}
|
||||||
|
}catch (Exception e){
|
||||||
if(orderService.generateOrder(ordersEntity,orderDatilListJson) == 1){
|
System.out.println(e.getMessage());
|
||||||
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));
|
|
||||||
}
|
}
|
||||||
return ResponseDTO.wrap(OrderResponseCodeConst.GENERATE_ORDER_FAIL);
|
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 = 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_FAIL = new OrderResponseCodeConst(9005, " 短信校验失败!");
|
||||||
|
|
||||||
public static final OrderResponseCodeConst SMS_OVERTIME = new OrderResponseCodeConst(9006, "短信校验超时!");
|
public static final OrderResponseCodeConst SMS_OVERTIME = new OrderResponseCodeConst(9006, "短信校验超时!");
|
||||||
|
@ -1,21 +1,21 @@
|
|||||||
package net.lab1024.smartadmin.module.system.royalcanin.good.service;
|
package net.lab1024.smartadmin.module.system.royalcanin.good.service;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONArray;
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import net.lab1024.smartadmin.common.heartbeat.StringUtil;
|
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.dao.GoodsDao;
|
||||||
import net.lab1024.smartadmin.module.system.royalcanin.good.model.GoodsEntity;
|
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.ProductMasterQueryEntity;
|
||||||
import net.lab1024.smartadmin.module.system.royalcanin.good.model.ProductQueryEntity;
|
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.AESUtil;
|
||||||
import net.lab1024.smartadmin.util.MapRemoveNullUtil;
|
import net.lab1024.smartadmin.util.MapRemoveNullUtil;
|
||||||
import net.lab1024.smartadmin.util.SmartHttpUtil;
|
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.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.data.redis.core.RedisTemplate;
|
import org.springframework.data.redis.core.RedisTemplate;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -24,7 +24,11 @@ import java.util.concurrent.TimeUnit;
|
|||||||
@Service
|
@Service
|
||||||
public class GoodService {
|
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
|
@Autowired
|
||||||
private GoodsDao goodsDao;
|
private GoodsDao goodsDao;
|
||||||
@ -32,16 +36,22 @@ public class GoodService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private RedisTemplate redisTemplate;
|
private RedisTemplate redisTemplate;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ProductSearchTagService productSearchTagService;
|
||||||
|
|
||||||
|
|
||||||
public GoodsEntity listGoodsByProductCode(String productCode){
|
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){
|
public List<GoodsEntity> listGoodsByNameBankNameTagUsedAge(String title,String petType){
|
||||||
String ip = "https://royalcanincn.escase.cn/jc/royalcanin/";
|
|
||||||
List<GoodsEntity> goodsList = goodsDao.selectRoleIdByGoodsNameBankNameTagUsedAge(title,petType);
|
List<GoodsEntity> goodsList = goodsDao.selectRoleIdByGoodsNameBankNameTagUsedAge(title,petType);
|
||||||
for (GoodsEntity goodsEntity:goodsList) {
|
for (GoodsEntity goodsEntity:goodsList) {
|
||||||
goodsEntity.setShowImgFile(ip+goodsEntity.getPicture());
|
goodsEntity.setShowImgFile(goodsIp+goodsEntity.getShowImgFile());
|
||||||
goodsEntity.setPicture(ip+goodsEntity.getPicture());
|
goodsEntity.setPicture(goodsIp+goodsEntity.getPicture());
|
||||||
}
|
}
|
||||||
return goodsList;
|
return goodsList;
|
||||||
}
|
}
|
||||||
@ -80,6 +90,21 @@ public class GoodService {
|
|||||||
String sb = SmartHttpUtil.sendPostForm(url+"productSearchTag/query",paramMap,null);
|
String sb = SmartHttpUtil.sendPostForm(url+"productSearchTag/query",paramMap,null);
|
||||||
JSONObject jsonObject = JSONObject.parseObject(sb);
|
JSONObject jsonObject = JSONObject.parseObject(sb);
|
||||||
String result = AESUtil.decryptLinux(jsonObject.getString("data"), AESUtil.KEY);
|
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;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,11 +24,13 @@ import net.lab1024.smartadmin.util.MapRemoveNullUtil;
|
|||||||
import net.lab1024.smartadmin.util.SmartHttpUtil;
|
import net.lab1024.smartadmin.util.SmartHttpUtil;
|
||||||
import net.sf.json.JSONArray;
|
import net.sf.json.JSONArray;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@ -46,61 +48,69 @@ public class OrderService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private NotifyService notifyService;
|
private NotifyService notifyService;
|
||||||
|
|
||||||
private String url = "https://miniapp-test.royalcanin.com.cn/rcmini/h5/orderMaster/";
|
@Value("${royalcanin.order}")
|
||||||
|
private String url ;
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public int generateOrder(OrdersEntity ordersEntity, JSONArray listJson) throws Exception {
|
public int generateOrder(OrdersEntity ordersEntity, JSONArray listJson) throws Exception {
|
||||||
AddOrSaveEntity addOrSaveEntity = new AddOrSaveEntity();
|
AddOrSaveEntity addOrSaveEntity = new AddOrSaveEntity();
|
||||||
if (ordersEntity.getCouponCode() != ""&& null != ordersEntity.getCouponCode()) {
|
try {
|
||||||
CouponCosumeEntity couponCosumeEntity = new CouponCosumeEntity();
|
if (ordersEntity.getCouponCode() != "" && null != ordersEntity.getCouponCode()) {
|
||||||
couponCosumeEntity.setCouponCode(ordersEntity.getCouponCode());
|
CouponCosumeEntity couponCosumeEntity = new CouponCosumeEntity();
|
||||||
couponCosumeEntity.setOrderNo(ordersEntity.getOrderNo());
|
couponCosumeEntity.setCouponCode(ordersEntity.getCouponCode());
|
||||||
couponCosumeEntity.setProductCode(ordersEntity.getProductCode());
|
couponCosumeEntity.setOrderNo(ordersEntity.getOrderNo());
|
||||||
BigDecimal realCouponAmount =new BigDecimal(ordersEntity.getOrderAmount());
|
couponCosumeEntity.setProductCode(ordersEntity.getProductCode());
|
||||||
couponCosumeEntity.setRealCouponAmount(realCouponAmount);
|
BigDecimal realCouponAmount = new BigDecimal(ordersEntity.getOrderAmount());
|
||||||
JSONObject jsonObject = JSONObject.parseObject(couponService.couponCosume(couponCosumeEntity));
|
couponCosumeEntity.setRealCouponAmount(realCouponAmount);
|
||||||
if(!jsonObject.getString("code").equals("0")) {
|
JSONObject jsonObject = JSONObject.parseObject(couponService.couponCosume(couponCosumeEntity));
|
||||||
|
if (!jsonObject.getString("code").equals("0")) {
|
||||||
|
return 3;
|
||||||
|
}
|
||||||
|
//coupon json化
|
||||||
|
OrderCouponEntity orderCouponEntity = new OrderCouponEntity();
|
||||||
|
orderCouponEntity.setCouponCode(ordersEntity.getCouponCode());
|
||||||
|
orderCouponEntity.setCouponName(ordersEntity.getCouponName());
|
||||||
|
orderCouponEntity.setCouponId(ordersEntity.getCouponId());
|
||||||
|
Map<String, String> orderCouponParamMap = MapRemoveNullUtil.setConditionMap(orderCouponEntity);
|
||||||
|
MapRemoveNullUtil.removeNullEntry(orderCouponParamMap);
|
||||||
|
net.sf.json.JSONObject orderCouponJson = net.sf.json.JSONObject.fromObject(orderCouponParamMap);
|
||||||
|
addOrSaveEntity.setOrderCoupon(orderCouponJson.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, String> paramMap = MapRemoveNullUtil.setConditionMap(ordersEntity);
|
||||||
|
paramMap.remove("orderAddress");
|
||||||
|
paramMap.remove("couponTypeId");
|
||||||
|
ObjectMapper objectMapper = new ObjectMapper();
|
||||||
|
OrderEntity orderEntity = objectMapper.convertValue(paramMap, OrderEntity.class);
|
||||||
|
if (ordersDao.insert(orderEntity) == 1) {
|
||||||
|
ordersEntity.setOrderStatus("0");
|
||||||
|
addOrSaveEntity.setPhoneNumber(ordersEntity.getPhoneNumber());
|
||||||
|
addOrSaveEntity.setStatus("0");
|
||||||
|
addOrSaveEntity.setOrderNumber(ordersEntity.getOrderNo());
|
||||||
|
addOrSaveEntity.setSalesAmount(ordersEntity.getOrderAmount());
|
||||||
|
addOrSaveEntity.setOrderDetailList(listJson.toString());
|
||||||
|
OrderAddress orderAddress = ordersEntity.getOrderAddress();
|
||||||
|
|
||||||
|
addOrSaveEntity.setAddressCityName(orderAddress.getAddressCityName());
|
||||||
|
addOrSaveEntity.setAddressCountyName(orderAddress.getAddressCountyName());
|
||||||
|
addOrSaveEntity.setAddressDetailInfo(orderAddress.getAddressDetailInfo());
|
||||||
|
addOrSaveEntity.setAddressPhoneNumber(orderAddress.getAddressPhoneNumber());
|
||||||
|
addOrSaveEntity.setAddressProvinceName(orderAddress.getAddressProvinceName());
|
||||||
|
addOrSaveEntity.setAddressUserName(orderAddress.getAddressUserName());
|
||||||
|
JSONObject jsonObject = JSONObject.parseObject(addOrSave(addOrSaveEntity));
|
||||||
|
|
||||||
|
if (jsonObject.getString("code").equals("1"))
|
||||||
|
return 1;
|
||||||
|
else
|
||||||
|
return 0;
|
||||||
|
} else {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
//coupon json化
|
}catch (Exception e){
|
||||||
OrderCouponEntity orderCouponEntity = new OrderCouponEntity();
|
System.out.println(e.getMessage()
|
||||||
orderCouponEntity.setCouponCode(ordersEntity.getCouponCode());
|
);
|
||||||
orderCouponEntity.setCouponName(ordersEntity.getCouponName());
|
|
||||||
orderCouponEntity.setCouponId(ordersEntity.getCouponId());
|
|
||||||
Map<String, String> orderCouponParamMap = MapRemoveNullUtil.setConditionMap(orderCouponEntity);
|
|
||||||
MapRemoveNullUtil.removeNullEntry(orderCouponParamMap);
|
|
||||||
net.sf.json.JSONObject orderCouponJson = net.sf.json.JSONObject.fromObject(orderCouponParamMap);
|
|
||||||
addOrSaveEntity.setOrderCoupon(orderCouponJson.toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
Map<String, String> paramMap = MapRemoveNullUtil.setConditionMap(ordersEntity);
|
|
||||||
paramMap.remove("orderAddress");
|
|
||||||
paramMap.remove("couponTypeId");
|
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
|
||||||
OrderEntity orderEntity = objectMapper.convertValue(paramMap, OrderEntity.class);
|
|
||||||
if(ordersDao.insert(orderEntity) == 1) {
|
|
||||||
ordersEntity.setOrderStatus("0");
|
|
||||||
addOrSaveEntity.setPhoneNumber(ordersEntity.getPhoneNumber());
|
|
||||||
addOrSaveEntity.setStatus("0");
|
|
||||||
addOrSaveEntity.setOrderNumber(ordersEntity.getOrderNo());
|
|
||||||
addOrSaveEntity.setSalesAmount(ordersEntity.getOrderAmount());
|
|
||||||
addOrSaveEntity.setOrderDetailList(listJson.toString());
|
|
||||||
OrderAddress orderAddress = ordersEntity.getOrderAddress();
|
|
||||||
|
|
||||||
addOrSaveEntity.setAddressCityName(orderAddress.getAddressCityName());
|
|
||||||
addOrSaveEntity.setAddressCountyName(orderAddress.getAddressCountyName());
|
|
||||||
addOrSaveEntity.setAddressDetailInfo(orderAddress.getAddressDetailInfo());
|
|
||||||
addOrSaveEntity.setAddressPhoneNumber(orderAddress.getAddressPhoneNumber());
|
|
||||||
addOrSaveEntity.setAddressProvinceName(orderAddress.getAddressProvinceName());
|
|
||||||
addOrSaveEntity.setAddressUserName(orderAddress.getAddressUserName());
|
|
||||||
JSONObject jsonObject = JSONObject.parseObject(addOrSave(addOrSaveEntity));
|
|
||||||
if(jsonObject.getString("code").equals("1"))
|
|
||||||
return 1;
|
|
||||||
else
|
|
||||||
return 0;
|
|
||||||
}else {
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int checkNotify(String orderNumber){
|
public int checkNotify(String orderNumber){
|
||||||
@ -209,11 +219,13 @@ public class OrderService {
|
|||||||
jsonObject.put("orderCoupon",orderCoupon);
|
jsonObject.put("orderCoupon",orderCoupon);
|
||||||
jsonObject.put("orderDetailList",detailList);
|
jsonObject.put("orderDetailList",detailList);
|
||||||
long startTime = System.currentTimeMillis();
|
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 acceptTime = System.currentTimeMillis() ;
|
||||||
long elapsedTime = acceptTime - startTime;
|
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;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -229,15 +241,15 @@ public class OrderService {
|
|||||||
com.alibaba.fastjson.JSONArray jsonArray = JSONObject.parseArray(afterDecodeResult);
|
com.alibaba.fastjson.JSONArray jsonArray = JSONObject.parseArray(afterDecodeResult);
|
||||||
for (int i = 0; i < jsonArray.size();i++){
|
for (int i = 0; i < jsonArray.size();i++){
|
||||||
JSONObject jsonObjectResult = (JSONObject)jsonArray.get(i);
|
JSONObject jsonObjectResult = (JSONObject)jsonArray.get(i);
|
||||||
OrderEntity orderEntity = ordersDao.findByOrderId(jsonObjectResult.getString("orderNumber"));
|
OrderEntity orderEntity = ordersDao.findByOrderId(jsonObjectResult.getString("orderNumber"));
|
||||||
if (orderEntity == null){
|
if (orderEntity == null){
|
||||||
jsonObjectResult.put("paytype","0");
|
jsonObjectResult.put("paytype","0");
|
||||||
jsonObjectResult.put("basePoint","0");
|
jsonObjectResult.put("basePoint","0");
|
||||||
}else {
|
}else {
|
||||||
//新增支付方式paytype
|
//新增支付方式paytype
|
||||||
jsonObjectResult.put("paytype",orderEntity.getPayType());
|
jsonObjectResult.put("paytype",orderEntity.getPayType());
|
||||||
jsonObjectResult.put("basePoint",orderEntity.getBasePoint());
|
jsonObjectResult.put("basePoint",orderEntity.getBasePoint());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
//记录服务响应时间
|
//记录服务响应时间
|
||||||
@ -273,13 +285,13 @@ public class OrderService {
|
|||||||
endTotal = total * buyCount - discount;
|
endTotal = total * buyCount - discount;
|
||||||
break;
|
break;
|
||||||
case "3":
|
case "3":
|
||||||
endTotal = (total * buyCount) * discount;
|
endTotal = (total * buyCount) * (1-discount);
|
||||||
break;
|
break;
|
||||||
case "1" :
|
case "1" :
|
||||||
endTotal = total * buyCount - discount;
|
endTotal = total * buyCount - discount;
|
||||||
break;
|
break;
|
||||||
case "4" :
|
case "4" :
|
||||||
endTotal = (total * buyCount) * discount;
|
endTotal = (total * buyCount) * (1-discount);
|
||||||
break;
|
break;
|
||||||
case "6" :
|
case "6" :
|
||||||
endTotal = total * buyCount - discount;
|
endTotal = total * buyCount - discount;
|
||||||
|
@ -13,4 +13,7 @@ import java.util.List;
|
|||||||
public interface ProductSearchTagDao extends BaseMapper<ProductSearchTagEntity> {
|
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);
|
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){
|
public List<ProductSearchTagEntity> findAllByCondition( List<String> brandNameList,String petType,List<String> tagNameList,String tagStatus){
|
||||||
return productSearchTagDao.findAllByCondition(brandNameList,petType,tagNameList,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 {
|
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 ="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 = "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 回调地址
|
// 微信支付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";
|
public static String UFDODER_URL = "https://api.mch.weixin.qq.com/pay/unifiedorder";
|
||||||
|
|
||||||
|
|
||||||
private byte[] certData;
|
private byte[] certData;
|
||||||
|
|
||||||
public MyConfig() throws Exception {
|
public MyConfig() throws Exception {
|
||||||
@ -50,6 +51,7 @@ public class MyConfig implements WXPayConfig {
|
|||||||
return "indexphpcorecertapicert201903200";
|
return "indexphpcorecertapicert201903200";
|
||||||
}
|
}
|
||||||
//b69497999e8fd1f8f1f0a9591b24eb72
|
//b69497999e8fd1f8f1f0a9591b24eb72
|
||||||
|
//1DDE55AD98ED71D6EDD4A4A16996DE7B47773A8C
|
||||||
|
|
||||||
public InputStream getCertStream() {
|
public InputStream getCertStream() {
|
||||||
ByteArrayInputStream certBis = new ByteArrayInputStream(this.certData);
|
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.MapRemoveNullUtil;
|
||||||
import net.lab1024.smartadmin.util.SmartHttpUtil;
|
import net.lab1024.smartadmin.util.SmartHttpUtil;
|
||||||
import net.lab1024.smartadmin.util.SmartIPUtil;
|
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.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
@ -25,11 +25,8 @@ import java.io.BufferedReader;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.net.Inet4Address;
|
import java.net.Inet4Address;
|
||||||
import java.net.InetAddress;
|
import java.net.InetAddress;
|
||||||
import java.net.URLEncoder;
|
|
||||||
import java.text.DecimalFormat;
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@ -49,31 +46,8 @@ public class WxpayService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private MemberAccountService memberAccountService;
|
private MemberAccountService memberAccountService;
|
||||||
|
|
||||||
String url = "https://miniapp-test.royalcanin.com.cn/rcmini/h5/";
|
@Value("${royalcanin.goods}")
|
||||||
|
private String url;
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public String generateQRCode(WxPayEntity wxPayEntity) throws Exception {
|
public String generateQRCode(WxPayEntity wxPayEntity) throws Exception {
|
||||||
WXPay wxpay = new WXPay(config);
|
WXPay wxpay = new WXPay(config);
|
||||||
@ -120,8 +94,7 @@ public class WxpayService {
|
|||||||
// 更新订单状态
|
// 更新订单状态
|
||||||
if ("SUCCESS".equals(sortedMap.get("result_code"))) {
|
if ("SUCCESS".equals(sortedMap.get("result_code"))) {
|
||||||
String outTradeNo = sortedMap.get("out_trade_no"); // 流水号
|
String outTradeNo = sortedMap.get("out_trade_no"); // 流水号
|
||||||
DecimalFormat df = new DecimalFormat("0.00");
|
String totalFee = sortedMap.get("total_fee"); // 交易金额
|
||||||
String totalFee = StringUtil.toString(df.format(df.format(Double.parseDouble(sortedMap.get("total_fee")) / 100))); // 交易金额
|
|
||||||
OrderEntity orderEntity = orderService.findByOrderId(outTradeNo);
|
OrderEntity orderEntity = orderService.findByOrderId(outTradeNo);
|
||||||
String [] products = orderEntity.getProductCode().split(",");
|
String [] products = orderEntity.getProductCode().split(",");
|
||||||
ProductMasterQueryEntity productMasterQueryEntity = new ProductMasterQueryEntity();
|
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
|
org.quartz.plugin.jobInitializer.scanInterval = 300
|
||||||
|
|
||||||
spring.mvc.static-path-pattern=/**
|
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 id="findAllByCondition" resultMap="ProductSearchTagEntity">
|
||||||
select tag_code,brand_name,tag_name from t_royalcanin_productsearchtag WHERE
|
select tag_code,brand_name,tag_name from t_royalcanin_productsearchtag WHERE
|
||||||
is_delete = 0
|
is_delete = 0
|
||||||
|
<if test="petType != null and petType != ''">
|
||||||
|
AND pet_type = #{petType}
|
||||||
|
</if>
|
||||||
<if test="brandNameList != null and brandNameList.size > 0">
|
<if test="brandNameList != null and brandNameList.size > 0">
|
||||||
AND brand_name in
|
AND brand_name in
|
||||||
<foreach collection="brandNameList" open="(" close=")" separator="," item="brandName">
|
<foreach collection="brandNameList" open="(" close=")" separator="," item="brandName">
|
||||||
@ -21,14 +24,21 @@
|
|||||||
#{tagName}
|
#{tagName}
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
<if test="tagStatus != null and tagStatus == 1">
|
<if test="tagStatus != null and tagStatus == 1 and tagNameList != null and tagNameList.size > 0">
|
||||||
or brand_name in ( '专区' ) and tag_name not like '%湿粮%'
|
OR brand_name in ( '专区' ) and tag_name not like '%湿粮%' AND pet_type = #{petType}
|
||||||
</if>
|
</if>
|
||||||
<if test="tagStatus != null and tagStatus == 2">
|
<if test="tagStatus != null and tagStatus == 2 and tagNameList != null and tagNameList.size > 0">
|
||||||
or brand_name in ( '专区' ) and tag_name like '%湿粮%'
|
OR brand_name in ( '专区' ) and tag_name like '%湿粮%' AND pet_type = #{petType}
|
||||||
</if>
|
</if>
|
||||||
<if test="petType != null and petType != ''">
|
<if test="tagStatus != null and tagStatus == 1 and tagNameList.size == 0">
|
||||||
AND pet_type = #{petType}
|
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>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<delete id="deleteAllProductSearchTag">
|
||||||
|
delete from t_royalcanin_productsearchtag
|
||||||
|
</delete>
|
||||||
</mapper>
|
</mapper>
|
@ -23,7 +23,7 @@ spring.servlet.multipart.max-request-size=30MB
|
|||||||
file-upload-service.path=/home/upload/smart-admin-file
|
file-upload-service.path=/home/upload/smart-admin-file
|
||||||
|
|
||||||
######################### database #########################
|
######################### 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.username=azureuser@rc-hub-mysql
|
||||||
spring.datasource.password=(G=q0D5ez2Fz
|
spring.datasource.password=(G=q0D5ez2Fz
|
||||||
spring.datasource.initial-size=2
|
spring.datasource.initial-size=2
|
||||||
@ -118,3 +118,14 @@ spring.quartz.job-store-type=jdbc
|
|||||||
#ALWAYS,EMBEDDED,NEVER
|
#ALWAYS,EMBEDDED,NEVER
|
||||||
spring.quartz.jdbc.initialize-schema=NEVER
|
spring.quartz.jdbc.initialize-schema=NEVER
|
||||||
spring.quartz.jdbc.schema=classpath:sql/quartz_mysql_2.3.0.sql
|
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 的数据库结构
|
-- 导出 smart-admin-dev 的数据库结构
|
||||||
DROP DATABASE IF EXISTS `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' */;
|
CREATE DATABASE IF NOT EXISTS `smart-admin-pro` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci */ /*!80016 DEFAULT ENCRYPTION='N' */;
|
||||||
USE `smart-admin-dev`;
|
USE `smart-admin-pro`;
|
||||||
|
|
||||||
-- 导出 表 smart-admin-dev.t_department 结构
|
-- 导出 表 smart-admin-dev.t_department 结构
|
||||||
DROP TABLE IF EXISTS `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,
|
`code` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||||
`msg` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
|
`msg` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE=MyISAM AUTO_INCREMENT=51 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
)
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE `t_good_orders` (
|
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'),
|
(1032, '16518816', '品种', '0', '布偶', '1017', '1017014', 0, '2022-01-19 16:41:55'),
|
||||||
(1033, '16518816', '品种', '0', '暹罗', '1017', '1017015', 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'),
|
(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'),
|
(1035, '16518816', '年龄', '1', '幼年', '1018', '1018001', 0, '2022-01-19 16:41:55'),
|
||||||
(1036, '16518816,555131355', '年龄', '1', '成年', '1018', '1018002', 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'),
|
(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'),
|
(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'),
|
(1039, '16518816', '年龄', '0', '1-7岁', '1018', '1018005', 0, '2022-01-19 16:41:55'),
|
||||||
|
Loading…
Reference in New Issue
Block a user