Merge branch 'sit-Carl' into sit-jiamin-v2
@ -201,32 +201,27 @@ export const userque = (stype) => {
|
|||||||
|
|
||||||
|
|
||||||
//标品全部信息
|
//标品全部信息
|
||||||
export const biaomessage = (stype,name) => {
|
export const biaomessage = (stype,name,curPage,curRow) => {
|
||||||
console.log(stype);
|
if(!curPage)
|
||||||
if(stype.length>1){
|
curPage=1;
|
||||||
console.log("========");
|
if(!curRow)
|
||||||
let list={};
|
curRow=10;
|
||||||
stype.map(item=>{
|
let queryTail='&page='+curPage+'&rows='+curRow;
|
||||||
console.log(item);
|
if(stype.length>1){
|
||||||
list=item
|
let list={};
|
||||||
})
|
stype.map(item=>{
|
||||||
var str = "?";
|
console.log(item);
|
||||||
for(var key in list){
|
list=item
|
||||||
str = str + key + "=" + list[key] + "&";
|
})
|
||||||
}
|
var str = "?";
|
||||||
stype = str.substr(0,str.length-1);
|
for(var key in list){
|
||||||
var data = {
|
str = str + key + "=" + list[key] + "&";
|
||||||
page:1,
|
}
|
||||||
row:10
|
stype = str.substr(0,str.length-1);
|
||||||
}
|
return fetch('product/query'+stype+queryTail, '', 'POST' )
|
||||||
return fetch('product/query'+stype, data, 'POST' )
|
}else{
|
||||||
}else{
|
return fetch('product/query?petType='+stype+queryTail, '', 'POST' )
|
||||||
console.log('-==');
|
}
|
||||||
return fetch('product/query?petType='+stype,data, 'POST' )
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const searchchanpin = (stype) => {
|
export const searchchanpin = (stype) => {
|
||||||
|
Before Width: | Height: | Size: 39 KiB |
Before Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 39 KiB |
Before Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 25 KiB |
@ -132,7 +132,7 @@ margin-top: 8px;
|
|||||||
}
|
}
|
||||||
.rc-footer {
|
.rc-footer {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items:flex-end
|
align-items:flex-end;
|
||||||
span {
|
span {
|
||||||
width: 72px;
|
width: 72px;
|
||||||
height: 25px;
|
height: 25px;
|
||||||
|
@ -38,8 +38,7 @@ img, picture {
|
|||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
justify-content: space-evenly;
|
justify-content: space-evenly;
|
||||||
&:after{
|
&:after{
|
||||||
content:"";
|
|
||||||
width:154px;
|
|
||||||
}
|
}
|
||||||
li{
|
li{
|
||||||
border: 1px solid #D7D7D7;
|
border: 1px solid #D7D7D7;
|
||||||
@ -151,11 +150,9 @@ img, picture {
|
|||||||
flex-wrap: nowrap;
|
flex-wrap: nowrap;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
width: 86%;
|
width: 86%;
|
||||||
&::-webkit-scrollbar{
|
|
||||||
display:none;
|
|
||||||
}
|
|
||||||
li{
|
li{
|
||||||
border-radius: 100px;
|
border-radius: 100px;
|
||||||
|
flex-shrink:0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.active{
|
.active{
|
||||||
@ -345,6 +342,9 @@ img, picture {
|
|||||||
font-size:.75rem;
|
font-size:.75rem;
|
||||||
line-height: 1.375rem;
|
line-height: 1.375rem;
|
||||||
}
|
}
|
||||||
|
&::-webkit-scrollbar{
|
||||||
|
display:none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -369,17 +369,25 @@ img, picture {
|
|||||||
display:block;
|
display:block;
|
||||||
li{
|
li{
|
||||||
max-width:20rem;
|
max-width:20rem;
|
||||||
margin-right:.9rem;
|
//margin-right:.875rem;
|
||||||
margin-left:.9rem;
|
margin-left:2.2vw;
|
||||||
.rc-column{
|
.rc-column{
|
||||||
span{
|
span{
|
||||||
font-size:1.875rem;
|
font-size:1.875rem;
|
||||||
height: 5.2rem;
|
height: 5.2rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
&:nth-child(4n+1){
|
||||||
|
margin-left:0;
|
||||||
|
}
|
||||||
|
&:nth-child(4n){
|
||||||
|
//margin-right:0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
img{
|
img{
|
||||||
width:20rem;
|
width:21.7vw;
|
||||||
|
max-width:320px;
|
||||||
|
min-width:160px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.ts-right-arr {
|
.ts-right-arr {
|
||||||
@ -489,12 +497,30 @@ img, picture {
|
|||||||
{
|
{
|
||||||
li
|
li
|
||||||
{
|
{
|
||||||
margin-left: 40px;
|
margin-left: 30px;
|
||||||
width: 8.125rem;
|
width: 8.125rem;
|
||||||
height: 2.5rem;
|
height: 2.5rem;
|
||||||
line-height: 40px;
|
line-height: 40px;
|
||||||
font-size: .875rem;
|
font-size: .875rem;
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
&::-webkit-scrollbar{
|
||||||
|
background:unset;
|
||||||
|
height:4px;
|
||||||
|
}
|
||||||
|
&::-webkit-scrollbar-thumb{
|
||||||
|
background-color:#d7d7d7;
|
||||||
|
height:2px;
|
||||||
|
}
|
||||||
|
&::-webkit-scrollbar-track{
|
||||||
|
background-color:ddd;
|
||||||
|
|
||||||
|
height:2px;
|
||||||
|
}
|
||||||
|
&::-webkit-scrollbar-button{
|
||||||
|
background:unset;
|
||||||
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -511,4 +537,15 @@ img, picture {
|
|||||||
.rc-xl-down {
|
.rc-xl-down {
|
||||||
display: none!important;
|
display: none!important;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
@media screen and (min-width: 769px) and (max-width: 1370px)
|
||||||
|
{
|
||||||
|
.ts-product-list {
|
||||||
|
display:flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
li{
|
||||||
|
margin-left:0;
|
||||||
|
margin-right:0;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
@ -5,6 +5,36 @@
|
|||||||
/deep/.van-swipe__indicator--active{
|
/deep/.van-swipe__indicator--active{
|
||||||
background-color: #E1001A;
|
background-color: #E1001A;
|
||||||
}
|
}
|
||||||
|
.rc-ma{
|
||||||
|
.ul-zhuan{
|
||||||
|
li{
|
||||||
|
background: unset;;
|
||||||
|
img{
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
&.active {
|
||||||
|
img{
|
||||||
|
border: 3px solid #E2001A;
|
||||||
|
}
|
||||||
|
color: #E2001A;
|
||||||
|
|
||||||
|
}
|
||||||
|
&.unactive {
|
||||||
|
color: #444444;
|
||||||
|
img{
|
||||||
|
border: 3px solid #D7D7D7;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.uservideo{
|
||||||
|
overflow: hidden;
|
||||||
|
video{
|
||||||
|
height:100%;
|
||||||
|
width:auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
@media screen and (max-width:768px){
|
@media screen and (max-width:768px){
|
||||||
.ul-dog{
|
.ul-dog{
|
||||||
display: none;
|
display: none;
|
||||||
@ -24,16 +54,14 @@
|
|||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
img{
|
img{
|
||||||
width: 0.64rem;
|
width: 4rem;
|
||||||
height: 0.64rem;
|
height: 4rem;
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
li{
|
li{
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin-left: 0.20rem;
|
margin-left: 0.20rem;
|
||||||
width: 0.64rem;
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
height: 0.64rem;
|
|
||||||
background: #F6F6F6;
|
background: #F6F6F6;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
@ -97,7 +125,6 @@
|
|||||||
height: 26.31rem;
|
height: 26.31rem;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
font-size: 0.20px;
|
font-size: 0.20px;
|
||||||
line-height: 1.50rem;
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
@ -260,12 +287,7 @@
|
|||||||
li{
|
li{
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin-left: 1.25rem;
|
margin-left: 1.25rem;
|
||||||
width: 4rem;
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
height: 4rem;
|
|
||||||
background: #F6F6F6;
|
|
||||||
border-radius: 50%;
|
|
||||||
opacity: 1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -280,15 +302,16 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.active {
|
.active {
|
||||||
font-size: 0.14rem;
|
font-size: 0.14rem;
|
||||||
border: 1px solid red;
|
img{
|
||||||
color: red;
|
border-width: 1px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.unactive {
|
.unactive {
|
||||||
font-size: 0.14rem;
|
font-size: 0.14rem;
|
||||||
color: #444444;
|
img{
|
||||||
border: 1px solid #D7D7D7;
|
border-width: 1px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// .usermain{
|
// .usermain{
|
||||||
// display: none;
|
// display: none;
|
||||||
@ -314,7 +337,6 @@ object-fit: cover;
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
font-size: 1.25rem;
|
font-size: 1.25rem;
|
||||||
line-height: 9.375rem;
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
||||||
|
|
||||||
@ -411,35 +433,33 @@ object-fit: cover;
|
|||||||
margin-top: 1rem;
|
margin-top: 1rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.uservideo{
|
.uservideo{
|
||||||
width: 35rem;
|
width: 35rem;
|
||||||
height: 31.6rem;
|
height: 31.6rem;
|
||||||
display: block;
|
display: block;
|
||||||
border: 1px solid red;
|
}
|
||||||
|
.userleft{
|
||||||
}
|
position: absolute;
|
||||||
.userleft{
|
top: 50%;
|
||||||
position: absolute;
|
left:0;
|
||||||
top: 50%;
|
margin-top: -.72rem;
|
||||||
left:0;
|
img{
|
||||||
margin-top: -.72rem;
|
width: .69rem;
|
||||||
img{
|
height: 1.38rem;
|
||||||
width: .69rem;
|
display: block;
|
||||||
height: 1.38rem;
|
}
|
||||||
display: block;
|
}
|
||||||
}
|
.userright{
|
||||||
}
|
position: absolute;
|
||||||
.userright{
|
top: 50%;
|
||||||
position: absolute;
|
right:0;
|
||||||
top: 50%;
|
margin-top: -.72rem;
|
||||||
right:0;
|
img{
|
||||||
margin-top: -.72rem;
|
width: .69rem;
|
||||||
img{
|
height: 1.375rem;
|
||||||
width: .69rem;
|
display: block;
|
||||||
height: 1.375rem;
|
}
|
||||||
display: block;
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -494,23 +514,18 @@ img{
|
|||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
span{
|
span{
|
||||||
margin-top: 2.5rem;
|
margin-top: 1vw;
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
img{
|
img{
|
||||||
width: 9.5rem;
|
width: 10vw;
|
||||||
height: 9.5rem;
|
height: 10vw;
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
li{
|
li{
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
width: 9.875rem;
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
height: 9.875rem;
|
|
||||||
background: #F6F6F6;
|
|
||||||
border-radius: 50%;
|
|
||||||
margin-left:1.25rem;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -525,8 +540,6 @@ img{
|
|||||||
|
|
||||||
}
|
}
|
||||||
.usermain{
|
.usermain{
|
||||||
margin-top: 2.5rem;
|
|
||||||
padding-bottom: 2.82rem;
|
|
||||||
.ul-dog{
|
.ul-dog{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -593,17 +606,18 @@ margin-left: 2.5rem;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.active {
|
.active {
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
border: 3px solid red;
|
img{
|
||||||
color: red;
|
border-width: 3px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.unactive {
|
.unactive {
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
color: #444444;
|
img{
|
||||||
border: 1px solid #D7D7D7;
|
border-width: 1px;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
.rc-maa{
|
.rc-maa{
|
||||||
ul{
|
ul{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@ -635,15 +649,12 @@ border-radius: 50%;
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.userselection {
|
.userselection {
|
||||||
font-size: 0.16rem;
|
font-size: 0.16rem;
|
||||||
|
color: #E2001A;
|
||||||
color: #E2001A;
|
}
|
||||||
|
|
||||||
}
|
|
||||||
.unselection {
|
.unselection {
|
||||||
font-size: 0.16rem;
|
font-size: 0.16rem;
|
||||||
|
|
||||||
}
|
}
|
||||||
.rc-usermessage{
|
.rc-usermessage{
|
||||||
span{
|
span{
|
||||||
@ -653,3 +664,14 @@ color: #E2001A;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media screen and (min-width:600px) and (max-width:768px)
|
||||||
|
{
|
||||||
|
.ul-zhuan{
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-evenly;
|
||||||
|
li{
|
||||||
|
margin-left:0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -140,6 +140,7 @@ ul li ol li em strong i {
|
|||||||
}
|
}
|
||||||
.rc-cordd{
|
.rc-cordd{
|
||||||
color:#666666;
|
color:#666666;
|
||||||
|
position:relative;
|
||||||
span{
|
span{
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin-top: 16px;
|
margin-top: 16px;
|
||||||
@ -249,6 +250,13 @@ ul li ol li em strong i {
|
|||||||
width: 440px;
|
width: 440px;
|
||||||
height: 652px;
|
height: 652px;
|
||||||
}
|
}
|
||||||
|
.ts-mypersonal{
|
||||||
|
margin-left:0;
|
||||||
|
.rc-column{
|
||||||
|
padding-left:0;
|
||||||
|
padding-right:0;
|
||||||
|
}
|
||||||
|
}
|
||||||
.online{
|
.online{
|
||||||
margin:40px auto;
|
margin:40px auto;
|
||||||
}
|
}
|
||||||
@ -362,17 +370,29 @@ ul li ol li em strong i {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.block{
|
.block{
|
||||||
height: 8px;
|
height: 8px;
|
||||||
background: #D7D7D7;
|
background: #D7D7D7;
|
||||||
margin-top: 16px;
|
margin-top: 16px;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
.r-block{
|
position:relative;
|
||||||
width: 0%;
|
margin-top:3.32rem;
|
||||||
height: 100%;
|
.r-block{
|
||||||
background: #008900;
|
width: 0%;
|
||||||
}
|
height: 100%;
|
||||||
|
background: #008900;
|
||||||
|
}
|
||||||
|
.ts-point-tag{
|
||||||
|
background:url("../image/img-pointBg.png") no-repeat center top;
|
||||||
|
background-size:contain;
|
||||||
|
height:2.375rem;
|
||||||
|
width:3.625rem;
|
||||||
|
text-align:center;
|
||||||
|
position:absolute;
|
||||||
|
font-size:.875rem;
|
||||||
|
line-height:2rem;
|
||||||
|
left:0;
|
||||||
|
top:-2.6rem;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.rc-value{
|
.rc-value{
|
||||||
display: flex;
|
display: flex;
|
||||||
|
Before Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 16 KiB |
BIN
rc-busness/assets/image/img-pointBg.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 39 KiB |
Before Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 25 KiB |
@ -379,21 +379,23 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
const isReload={
|
||||||
|
needload:false
|
||||||
|
};
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
headerScroll:false,
|
headerScroll:false,
|
||||||
loginornot:true,//用户是否登录提示点
|
loginornot:true,//用户是否登录提示点
|
||||||
usermessage:null,//存储用户信息
|
usermessage:null,//存储用户信息
|
||||||
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
created(){
|
||||||
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
//判断用户有无登录显示红点
|
//判断用户有无登录显示红点
|
||||||
let usernot=JSON.parse(localStorage.getItem("userInfo"));
|
let usernot=JSON.parse(localStorage.getItem("userInfo"));
|
||||||
console.log(usernot);
|
//console.log(usernot);
|
||||||
if(usernot==null ||usernot==undefined){
|
if(usernot==null ||usernot==undefined){
|
||||||
console.log(usernot);
|
console.log(usernot);
|
||||||
this.loginornot=true
|
this.loginornot=true
|
||||||
@ -401,21 +403,53 @@ export default {
|
|||||||
this.loginornot=false
|
this.loginornot=false
|
||||||
this.usermessage=usernot;
|
this.usermessage=usernot;
|
||||||
}
|
}
|
||||||
console.log(this.loginornot);
|
//debugger;
|
||||||
|
if(isReload.needload)
|
||||||
|
location.reload();
|
||||||
|
if(isReload.needload==false)
|
||||||
|
isReload.needload=true;
|
||||||
|
//console.log(this.loginornot);
|
||||||
|
/*
|
||||||
|
if(RCDL && RCDL.utilities && RCDL.navigation && RCDL.navigation.rebuild)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (["sm", "xs", "md-1"].includes(RCDL.utilities.breakpoints.values.width.current)) {
|
||||||
|
this.refreshMobileNav();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.refreshDesktopNav();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
*/
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
refreshDesktopNav:function(){
|
||||||
|
RCDL.navigation.currentState=null;
|
||||||
|
RCDL.navigation.rebuild();
|
||||||
|
},
|
||||||
|
refreshMobileNav:function(){
|
||||||
|
let itemGroupList=document.querySelectorAll("nav[data-toggle-group=mobile] .rc-list--align[role=menu]");
|
||||||
|
itemGroupList.forEach(function(ele,i){
|
||||||
|
if(ele.className.indexOf("rc-expand--horizontal")<0 && ele.className.indexOf("rc-btn-offset--top")<0)
|
||||||
|
{
|
||||||
|
if(ele.id.indexOf("nav-list")>=0)
|
||||||
|
ele.classList.add("rc-expand--horizontal");
|
||||||
|
else if(ele.id.indexOf("nav-footer")>=0)
|
||||||
|
ele.classList.add("rc-expand--vertical");
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
bindTracking: function(){
|
bindTracking: function(){
|
||||||
console.log('bindTracking');
|
//console.log('bindTracking');
|
||||||
},
|
},
|
||||||
|
|
||||||
//
|
//
|
||||||
//跳转搜索
|
//跳转搜索
|
||||||
searchturn(){
|
searchturn(){
|
||||||
this.$router.push({ name: "usersearch-search",
|
this.$router.push({ name: "usersearch-search",})
|
||||||
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
//判断有无登录跳转不同页面
|
//判断有无登录跳转不同页面
|
||||||
turnlogin(){
|
turnlogin(){
|
||||||
|
@ -1,288 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="magnify">
|
|
||||||
<div class="left_contaner">
|
|
||||||
<div class="middle_img" @mouseover="boxMouseOver" @mouseleave="boxMouseLeave">
|
|
||||||
<img :src="middleImg" alt="" style="width:100%">
|
|
||||||
<div class="shade" @mouseover="shadeMouseOver" @mousemove="shadeMouseMove" ref="shade" v-show="isShade"></div>
|
|
||||||
</div>
|
|
||||||
<div class="carousel">
|
|
||||||
<div class="left_arrow arrow" @click="leftArrowClick">
|
|
||||||
<img src="../assets/image/userleft.jpg" alt="">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="show_box">
|
|
||||||
<ul class="picture_container" ref="middlePicture">
|
|
||||||
<li class="picture_item" @click="tabPicture(item,index)" v-for="(item, index) in pictureList" :key="index">
|
|
||||||
<img :src="item.attachmentPath" class="small_img" alt="">
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
<div class="right_arrow arrow" @click="rightArrowClick">
|
|
||||||
<img src="../assets/image/userright.png" alt="">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="right_contanier" v-show="isBig">
|
|
||||||
<img :src="middleImg" ref="bigImg" class="big_img" alt="">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import $ from 'jquery'
|
|
||||||
export default {
|
|
||||||
props:['parentmsg'],
|
|
||||||
props: {
|
|
||||||
|
|
||||||
tableLabelTest:Array,
|
|
||||||
imgList: Array, // 图片数据
|
|
||||||
zoom: {
|
|
||||||
default: 2, // 缩略比例,放大比例
|
|
||||||
type: Number
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
middleImgWidth:350,
|
|
||||||
middleImgHeight:350,
|
|
||||||
thumbnailHeight:100,
|
|
||||||
|
|
||||||
tableLabelTest1:this.tableLabelTest,
|
|
||||||
pictureList: [
|
|
||||||
{url: require("../assets/four.png")},
|
|
||||||
{url: require("../assets/cat.png")},
|
|
||||||
{url: require("../assets/one.png")},
|
|
||||||
{url: require("../assets/six.png")},
|
|
||||||
{url: require("../assets/six.png")},
|
|
||||||
{url: require("../assets/six.png")},
|
|
||||||
{url: require("../assets/four.png")},
|
|
||||||
{url: require("../assets/cat.png")},
|
|
||||||
{url: require("../assets/one.png")},
|
|
||||||
{url: require("../assets/six.png")},
|
|
||||||
{url: require("../assets/six.png")},
|
|
||||||
{url: require("../assets/six.png")},
|
|
||||||
],
|
|
||||||
menu:[],
|
|
||||||
middleImg: '', // 中图图片地址
|
|
||||||
bigImg: '', // 大图图片地址
|
|
||||||
isShade: false, // 控制阴影显示与否
|
|
||||||
isBig: false, // 控制放大图显示与否
|
|
||||||
initX: 0, // 初始clientX值
|
|
||||||
initY: 0, // 初始clientY值
|
|
||||||
leftX: 0, // 初始定位left
|
|
||||||
topY: 0, // 初始定位top
|
|
||||||
middleLeft: 0, // 当前放置小图盒子的定位left值,
|
|
||||||
itemWidth: 80, // 缩略图每张的宽度
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch:{
|
|
||||||
data:'ifadroind',// 值可以为methods的方法名
|
|
||||||
inputName: function(newValue) {
|
|
||||||
this.pictureList=newValue;
|
|
||||||
this.menu=newValue;
|
|
||||||
console.log(this.newValue);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
mounted() {
|
|
||||||
let user= JSON.parse(localStorage.getItem("message"));
|
|
||||||
console.log(user);
|
|
||||||
if(user!==null){
|
|
||||||
this.pictureList=user;
|
|
||||||
}
|
|
||||||
if (user && user.length) {
|
|
||||||
this.pictureList = user
|
|
||||||
}
|
|
||||||
this.middleImg = this.pictureList[0].attachmentPath;
|
|
||||||
console.log(this.middleImg);
|
|
||||||
// 计算缩略图的宽度,默认是显示4张图片,两边箭头的宽度和为50
|
|
||||||
// this.itemWidth = (this.middleImgWidth-30) / 2
|
|
||||||
this.ifadroind();
|
|
||||||
this.$nextTick(() => {
|
|
||||||
console.log(this.menu);
|
|
||||||
// 容器的高
|
|
||||||
const imgWidth = this.middleImgHeight + this.thumbnailHeight + 20
|
|
||||||
// 设置容器宽高
|
|
||||||
// $('.magnify').css({
|
|
||||||
// width: this.middleImgWidth,
|
|
||||||
// height: imgWidth
|
|
||||||
// })
|
|
||||||
|
|
||||||
// 设置移动阴影图宽高
|
|
||||||
$('.middle_img .shade').css({
|
|
||||||
width: this.middleImgWidth/this.zoom,
|
|
||||||
height: this.middleImgHeight/this.zoom
|
|
||||||
})
|
|
||||||
// 设置缩略图容器高
|
|
||||||
$('.carousel').css({
|
|
||||||
height: this.thumbnailHeight
|
|
||||||
})
|
|
||||||
// 设置每个缩略图宽
|
|
||||||
// $('.picture_item').css({
|
|
||||||
// width: this.itemWidth
|
|
||||||
// })
|
|
||||||
// 设置放大后图片容器的宽高,left
|
|
||||||
$('.right_contanier').css({
|
|
||||||
left: this.middleImgWidth,
|
|
||||||
width: imgWidth,
|
|
||||||
height: imgWidth
|
|
||||||
})
|
|
||||||
// 设置放大图片的宽高(图片的放大倍数)
|
|
||||||
$('.right_contanier .big_img').css({
|
|
||||||
width: imgWidth * this.zoom,
|
|
||||||
height: imgWidth * this.zoom
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
|
||||||
//判断是手机打开还是电脑打开
|
|
||||||
ifadroind(){
|
|
||||||
var sUserAgent = navigator.userAgent.toLowerCase();
|
|
||||||
var bIsIpad = sUserAgent.match(/ipad/i) == "ipad";
|
|
||||||
var bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os";
|
|
||||||
var bIsMidp = sUserAgent.match(/midp/i) == "midp";
|
|
||||||
var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4";
|
|
||||||
var bIsUc = sUserAgent.match(/ucweb/i) == "ucweb";
|
|
||||||
var bIsAndroid = sUserAgent.match(/android/i) == "android";
|
|
||||||
var bIsCE = sUserAgent.match(/windows ce/i) == "windows ce";
|
|
||||||
var bIsWM = sUserAgent.match(/windows mobile/i) == "windows mobile";
|
|
||||||
|
|
||||||
if ((bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM)) {
|
|
||||||
//Mob Screen
|
|
||||||
}else{
|
|
||||||
//PC screen size
|
|
||||||
this.middleImgWidth=560;
|
|
||||||
this.middleImgHeight=560;
|
|
||||||
}
|
|
||||||
$('.middle_img').css({
|
|
||||||
width: this.middleImgWidth,
|
|
||||||
height: this.middleImgHeight
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 产品图片鼠标移入事件,显示阴影,显示大图
|
|
||||||
boxMouseOver (e) {
|
|
||||||
e.preventDefault();
|
|
||||||
e.stopPropagation();
|
|
||||||
this.isShade = true
|
|
||||||
this.isBig = true
|
|
||||||
// 计算阴影的位置
|
|
||||||
let x = e.offsetX - $('.shade').width()/2
|
|
||||||
let y = e.offsetY - $('.shade').height()/2
|
|
||||||
let maxLeft = $('.middle_img').width() - $('.shade').width()
|
|
||||||
let maxTop = $('.middle_img').height() - $('.shade').height()
|
|
||||||
x = x <= 0 ? 0 : x
|
|
||||||
x = x >= maxLeft ? maxLeft : x
|
|
||||||
y = y <= 0 ? 0 : y
|
|
||||||
y = y >= maxTop ? maxTop : y
|
|
||||||
$('.shade').css({
|
|
||||||
left: x,
|
|
||||||
top: y
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 鼠标在阴影移动
|
|
||||||
shadeMouseMove (e) {
|
|
||||||
|
|
||||||
e.preventDefault();
|
|
||||||
e.stopPropagation();
|
|
||||||
|
|
||||||
//用页面x - 父盒子的offsetLeft - 父盒子的左边框宽度
|
|
||||||
var x = this.getEventPage(e).pageX - $('.middle_img')[0].offsetParent.offsetLeft - $('.middle_img')[0].offsetParent.clientLeft;
|
|
||||||
//用页面y - 父盒子的offsetTop - 父盒子的上边框宽度
|
|
||||||
var y = this.getEventPage(e).pageY - $('.middle_img')[0].offsetParent.offsetTop - $('.middle_img')[0].offsetParent.clientTop;
|
|
||||||
|
|
||||||
//让阴影的坐标居中
|
|
||||||
x -= $('.shade').width() / 2;
|
|
||||||
y -= $('.shade').height() / 2;
|
|
||||||
|
|
||||||
// 移动边界限制
|
|
||||||
let maxLeft = $('.middle_img').width() - $('.shade').width()
|
|
||||||
let maxTop = $('.middle_img').height() - $('.shade').height()
|
|
||||||
x = x <= 0 ? 0 : x
|
|
||||||
x = x >= maxLeft ? maxLeft : x
|
|
||||||
y = y <= 0 ? 0 : y
|
|
||||||
y = y >= maxTop ? maxTop : y
|
|
||||||
// 重新赋值当前的定位值
|
|
||||||
$('.shade').css({
|
|
||||||
left: x,
|
|
||||||
top: y
|
|
||||||
})
|
|
||||||
// 计算出实时的大图的定位,首先计算出比例
|
|
||||||
// 比例为x:大图宽度/小图宽度 y: 大图高度/小图高度,将小图的定位乘以比例就是大图的定位
|
|
||||||
const xRate = $('.big_img').width() / $('.middle_img').width()
|
|
||||||
const yRate = $('.big_img').height() / $('.middle_img').height()
|
|
||||||
$('.big_img').css({
|
|
||||||
left: -x*xRate,
|
|
||||||
top: -y*yRate
|
|
||||||
})
|
|
||||||
// console.log(e, x, y, xRate, yRate, 66677)
|
|
||||||
},
|
|
||||||
// 鼠标移入阴影,去除自定义事件
|
|
||||||
shadeMouseOver (e) {
|
|
||||||
e.preventDefault();
|
|
||||||
e.stopPropagation();
|
|
||||||
// console.log(88888, e)
|
|
||||||
},
|
|
||||||
// 图片移出隐藏阴影和大图
|
|
||||||
boxMouseLeave () {
|
|
||||||
this.isShade = false
|
|
||||||
this.isBig = false
|
|
||||||
},
|
|
||||||
// 切换图片
|
|
||||||
tabPicture (item,index) {
|
|
||||||
this.middleImg = item.attachmentPath
|
|
||||||
this.$emit('changeName',item)
|
|
||||||
console.log(item,index)
|
|
||||||
},
|
|
||||||
// 点击左边箭头
|
|
||||||
leftArrowClick () {
|
|
||||||
if (this.middleLeft < 0) {
|
|
||||||
// 每次向右平移一个图片盒子的宽度
|
|
||||||
this.middleLeft += this.itemWidth
|
|
||||||
$('.picture_container').animate({
|
|
||||||
left: this.middleLeft
|
|
||||||
}, 500)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 点击右边箭头
|
|
||||||
rightArrowClick () {
|
|
||||||
// 每次向左平移一个盒子的宽度,最多移动的宽度为(图片数组长度-1)*每张缩略图的宽度
|
|
||||||
if (this.middleLeft > -this.itemWidth*(this.pictureList.length-1)) {
|
|
||||||
this.middleLeft -= this.itemWidth
|
|
||||||
$('.picture_container').animate({
|
|
||||||
left: this.middleLeft
|
|
||||||
}, 500)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 获取网页滚出去的距离(包括上面滚出去的部分和左边滚出去的部分)
|
|
||||||
* @returns {{scrollTop: (Number|number), scrollLeft: (Number|number)}}
|
|
||||||
*/
|
|
||||||
getPageScroll() {
|
|
||||||
return {
|
|
||||||
scrollTop: window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0,
|
|
||||||
scrollLeft: window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft || 0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取事件对象点击的点,相对于文档左上角的坐标
|
|
||||||
* @param e
|
|
||||||
* @returns {{pageX: *, pageY: *}}
|
|
||||||
*/
|
|
||||||
getEventPage(e) {
|
|
||||||
return {
|
|
||||||
pageX: e.clientX + this.getPageScroll().scrollLeft,
|
|
||||||
pageY: e.clientY + this.getPageScroll().scrollTop
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="less" scoped>
|
|
||||||
@import url("../assets/css/magnifier.less");
|
|
||||||
</style>
|
|
@ -50,7 +50,6 @@ export default {
|
|||||||
plugins: [
|
plugins: [
|
||||||
'@/plugins/vant',
|
'@/plugins/vant',
|
||||||
'@/plugins/ElementUI',
|
'@/plugins/ElementUI',
|
||||||
{ src: "~/plugins/swiper.js", ssr: false },
|
|
||||||
{ src: '@/plugins/localStorage', ssr: false },
|
{ src: '@/plugins/localStorage', ssr: false },
|
||||||
|
|
||||||
|
|
||||||
|
28614
rc-busness/package-lock.json
generated
@ -16,12 +16,10 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nuxtjs/axios": "^5.13.6",
|
"@nuxtjs/axios": "^5.13.6",
|
||||||
"@vant/touch-emulator": "^1.3.2",
|
|
||||||
"amfe-flexible": "^2.2.1",
|
"amfe-flexible": "^2.2.1",
|
||||||
"core-js": "^3.15.1",
|
"core-js": "^3.15.1",
|
||||||
"element-ui": "^2.15.6",
|
"element-ui": "^2.15.6",
|
||||||
"ip": "^1.1.5",
|
"ip": "^1.1.5",
|
||||||
"jquery": "^3.6.0",
|
|
||||||
"less": "^4.1.2",
|
"less": "^4.1.2",
|
||||||
"less-loader": "^6.0.0",
|
"less-loader": "^6.0.0",
|
||||||
"nuxt": "^2.15.7",
|
"nuxt": "^2.15.7",
|
||||||
@ -29,7 +27,8 @@
|
|||||||
"qrcodejs2": "^0.0.2",
|
"qrcodejs2": "^0.0.2",
|
||||||
"vant": "^2.12.22",
|
"vant": "^2.12.22",
|
||||||
"vue-awesome-swiper": "^4.1.1",
|
"vue-awesome-swiper": "^4.1.1",
|
||||||
"vuex-persistedstate": "^4.1.0"
|
"vuex-persistedstate": "^4.1.0",
|
||||||
|
"swiper":"^5.4.5"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@vant/area-data": "^1.1.5",
|
"@vant/area-data": "^1.1.5",
|
||||||
|
@ -47,7 +47,8 @@
|
|||||||
<div class="rc-cordd">
|
<div class="rc-cordd">
|
||||||
<span>距离升级还差:</span> <span class="lackOfPoint">{{ rcvalue }}</span>
|
<span>距离升级还差:</span> <span class="lackOfPoint">{{ rcvalue }}</span>
|
||||||
<div class="block">
|
<div class="block">
|
||||||
<div class="r-block" ref="userblock"></div>
|
<div class="ts-point-tag rc-md-up">0</div>
|
||||||
|
<div class="r-block" ref="userblock"></div>
|
||||||
<!-- <el-slider v-model="value" range show-stops :max="10"> </el-slider> -->
|
<!-- <el-slider v-model="value" range show-stops :max="10"> </el-slider> -->
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@ -129,7 +130,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<MyFooter></MyFooter>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
@ -138,11 +139,12 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Myheader from '~/components/header.vue'
|
import Myheader from '~/components/header.vue'
|
||||||
|
import MyFooter from '~/components/rc-footer.vue'
|
||||||
import tabs from "@/components/tabs.vue";
|
import tabs from "@/components/tabs.vue";
|
||||||
export default {
|
export default {
|
||||||
middleware: 'metaTitle',
|
middleware: 'metaTitle',
|
||||||
// middleware: 'metaTitle',
|
// middleware: 'metaTitle',
|
||||||
meta: {title: '个人中心'},
|
meta: {title: '个人中心'},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
userlog:false,
|
userlog:false,
|
||||||
@ -199,13 +201,14 @@ export default {
|
|||||||
};
|
};
|
||||||
|
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
Myheader,
|
Myheader,
|
||||||
tabs,
|
MyFooter,
|
||||||
},
|
tabs
|
||||||
watch:{
|
},
|
||||||
|
watch:{
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
userinter(){
|
userinter(){
|
||||||
let user= localStorage.getItem("userInfo");
|
let user= localStorage.getItem("userInfo");
|
||||||
@ -405,7 +408,15 @@ this.$router.push({
|
|||||||
this.usrnewlist=this.goldmedal;
|
this.usrnewlist=this.goldmedal;
|
||||||
userwidth=100
|
userwidth=100
|
||||||
}
|
}
|
||||||
this.$refs.userblock.style.width=userwidth+'%'
|
this.$refs.userblock.style.width=userwidth+'%';
|
||||||
|
let tagEle=document.querySelector('.ts-point-tag');
|
||||||
|
if(tagEle){
|
||||||
|
tagEle.innerText=this.userid.availiblePoint;
|
||||||
|
let tagEleLeft=userwidth-1;
|
||||||
|
if(tagEleLeft<=0)
|
||||||
|
tagEleLeft=0;
|
||||||
|
tagEle.style.left=tagEleLeft+"%";
|
||||||
|
}
|
||||||
} else{
|
} else{
|
||||||
console.log('---');
|
console.log('---');
|
||||||
this.userid=[];
|
this.userid=[];
|
||||||
|
@ -7,9 +7,6 @@
|
|||||||
<div class="online" id="fixed-catbar-seperator"></div>
|
<div class="online" id="fixed-catbar-seperator"></div>
|
||||||
<div class="rc-top"></div>
|
<div class="rc-top"></div>
|
||||||
<div class="rc-usermain ts-product-detail rc-max-width--xl rc-layout-container rc-two-column rc-border-bottom rc-border-colour--brand4">
|
<div class="rc-usermain ts-product-detail rc-max-width--xl rc-layout-container rc-two-column rc-border-bottom rc-border-colour--brand4">
|
||||||
<!--
|
|
||||||
<magnifier v-bind:parentmsg="msg" ></magnifier>
|
|
||||||
-->
|
|
||||||
<div class="rc-column">
|
<div class="rc-column">
|
||||||
<div data-js-carousel="" data-image-gallery="true">
|
<div data-js-carousel="" data-image-gallery="true">
|
||||||
<div class="rc-carousel rc-carousel__gallery-image" data-zoom-container="328b2e5f-6904-4cac-9709-51ed18d2500f" data-zoom-factor="2">
|
<div class="rc-carousel rc-carousel__gallery-image" data-zoom-container="328b2e5f-6904-4cac-9709-51ed18d2500f" data-zoom-factor="2">
|
||||||
@ -223,7 +220,6 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Myheader from "~/components/header.vue";
|
import Myheader from "~/components/header.vue";
|
||||||
import magnifier from "@/components/magnifier.vue";
|
|
||||||
import tabs from "@/components/tabs.vue";
|
import tabs from "@/components/tabs.vue";
|
||||||
import unlogin from "~/components/unlogin.vue";
|
import unlogin from "~/components/unlogin.vue";
|
||||||
import { mapMutations } from "vuex";
|
import { mapMutations } from "vuex";
|
||||||
@ -320,7 +316,6 @@ export default {
|
|||||||
components: {
|
components: {
|
||||||
Myheader,
|
Myheader,
|
||||||
tabs,
|
tabs,
|
||||||
magnifier,
|
|
||||||
unlogin,
|
unlogin,
|
||||||
Myfooter
|
Myfooter
|
||||||
|
|
||||||
|
@ -1,161 +1,147 @@
|
|||||||
// <!-- -->
|
|
||||||
<template>
|
<template>
|
||||||
|
<div class="container rc-full-width">
|
||||||
|
<Myheader></Myheader>
|
||||||
|
<div class="rc-top"></div>
|
||||||
|
|
||||||
<div class="container rc-full-width">
|
<div class="content ts-max-width--460">
|
||||||
<Myheader></Myheader>
|
<h2 class="rc-beta rc-text--center">账号注册</h2>
|
||||||
|
|
||||||
<div class="content ts-max-width--460">
|
<div class="rc-layout-container rc-one-column">
|
||||||
<h2 class="rc-beta rc-text--center">账号注册</h2>
|
<div class="rc-column">
|
||||||
|
<input
|
||||||
<div class="rc-layout-container rc-one-column">
|
class="ts-standard-input"
|
||||||
<div class="rc-column">
|
v-model="tel"
|
||||||
<input
|
placeholder="请输入手机号"
|
||||||
class="ts-standard-input"
|
:error-message="usertel"
|
||||||
v-model="tel"
|
v-if="!ifpassword"
|
||||||
placeholder="请输入手机号"
|
clearable
|
||||||
:error-message="usertel"
|
/>
|
||||||
v-if="!ifpassword"
|
</div>
|
||||||
clearable
|
</div>
|
||||||
/>
|
<!-- <van-field
|
||||||
</div>
|
v-model="password"
|
||||||
</div>
|
type="password"
|
||||||
<!-- <van-field
|
placeholder="请输入密码"
|
||||||
v-model="password"
|
:error-message="pass"
|
||||||
type="password"
|
|
||||||
placeholder="请输入密码"
|
|
||||||
:error-message="pass"
|
|
||||||
|
|
||||||
clearable
|
|
||||||
/> -->
|
|
||||||
<div class="rc-layout-container rc-two-column">
|
|
||||||
<div class="rc-column">
|
|
||||||
<input
|
|
||||||
v-if="!ifpassword"
|
|
||||||
v-model="sms"
|
|
||||||
class="ts-standard-input ts-standard-input--two center"
|
|
||||||
center
|
|
||||||
clearable
|
|
||||||
placeholder="请输入验证码"
|
|
||||||
|
|
||||||
>
|
|
||||||
</div>
|
|
||||||
<div class="rc-column">
|
|
||||||
<button
|
|
||||||
:disabled="flag"
|
|
||||||
slot="button"
|
|
||||||
size="small"
|
|
||||||
@click="sendCode"
|
|
||||||
class="rc-use ts-standard-btn ts-standard-btn--two"
|
|
||||||
>{{ buttonmsg }}</button
|
|
||||||
>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="rc-layout-container rc-one-column">
|
|
||||||
<div class="usecheck rc-column rc-text--left">
|
|
||||||
<label>
|
|
||||||
<input
|
|
||||||
type="checkbox"
|
|
||||||
@click="checkBox()"
|
|
||||||
style="width: 24px; height: 24px"
|
|
||||||
v-model="inRank"
|
|
||||||
/>我已阅读同意隐私声明和账号使用协议
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="rc-layout-container rc-two-column rc-button">
|
|
||||||
<div class="rc-column rc-text--left">
|
|
||||||
<a href="#" class="rc-styled-link"><span>隐私政策</span></a>
|
|
||||||
</div>
|
|
||||||
<div class="rc-column rc-text--right">
|
|
||||||
<nuxt-link :to="`/userlogin/login/`" class="rc-styled-link">
|
|
||||||
<span>返回登录</span>
|
|
||||||
</nuxt-link>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="rc-layout-container rc-one-column">
|
clearable
|
||||||
<div class="rc-column">
|
/> -->
|
||||||
<input
|
<div class="rc-layout-container rc-two-column">
|
||||||
type="primary"
|
<div class="rc-column">
|
||||||
:loading="loading"
|
<input
|
||||||
loading-text="注册中..."
|
v-if="!ifpassword"
|
||||||
size="large"
|
v-model="sms"
|
||||||
:disabled="zhud"
|
class="ts-standard-input ts-standard-input--two center"
|
||||||
@click="register()"
|
center
|
||||||
class="ts-standard-btn ts-standard-btn--max-width"
|
clearable
|
||||||
value="注册"
|
placeholder="请输入验证码"
|
||||||
></input
|
|
||||||
>
|
>
|
||||||
<!-- <van-divider @click="toLogin">注册账户</van-divider> -->
|
</div>
|
||||||
</div>
|
<div class="rc-column">
|
||||||
</div>
|
<button
|
||||||
</div>
|
:disabled="flag"
|
||||||
|
slot="button"
|
||||||
|
size="small"
|
||||||
|
@click="sendCode"
|
||||||
|
class="rc-use ts-standard-btn ts-standard-btn--two"
|
||||||
|
>{{ buttonmsg }}</button
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="rc-layout-container rc-one-column">
|
||||||
|
<div class="usecheck rc-column rc-text--left">
|
||||||
|
<label>
|
||||||
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
@click="checkBox()"
|
||||||
|
style="width: 24px; height: 24px"
|
||||||
|
v-model="inRank"
|
||||||
|
/>我已阅读同意隐私声明和账号使用协议
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="rc-layout-container rc-two-column rc-button">
|
||||||
|
<div class="rc-column rc-text--left">
|
||||||
|
<a href="#" class="rc-styled-link"><span>隐私政策</span></a>
|
||||||
|
</div>
|
||||||
|
<div class="rc-column rc-text--right">
|
||||||
|
<nuxt-link :to="`/userlogin/login/`" class="rc-styled-link">
|
||||||
|
<span>返回登录</span>
|
||||||
|
</nuxt-link>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="rc-layout-container rc-one-column">
|
||||||
|
<div class="rc-column">
|
||||||
|
<input
|
||||||
|
type="primary"
|
||||||
|
:loading="loading"
|
||||||
|
loading-text="注册中..."
|
||||||
|
size="large"
|
||||||
|
:disabled="zhud"
|
||||||
|
@click="register()"
|
||||||
|
class="ts-standard-btn ts-standard-btn--max-width"
|
||||||
|
value="注册"
|
||||||
|
></input
|
||||||
|
>
|
||||||
|
<!-- <van-divider @click="toLogin">注册账户</van-divider> -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {useredit,inserdiscount,sendMsg,vadatnmsg } from '../../ajax/getData'
|
import {useredit,inserdiscount,sendMsg,vadatnmsg } from '../../ajax/getData'
|
||||||
import Myheader from '~/components/header.vue' //引用头部公共组件
|
import Myheader from '~/components/header.vue' //引用头部公共组件
|
||||||
export default {
|
export default {
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
phone:'',
|
phone:'',
|
||||||
layerMSg:'手机格式不对',
|
layerMSg:'手机格式不对',
|
||||||
tel:'',
|
tel:'',
|
||||||
password:'',
|
password:'',
|
||||||
captchadata:'',
|
captchadata:'',
|
||||||
tamp:'',
|
tamp:'',
|
||||||
hash:'',
|
hash:'',
|
||||||
sms:'',
|
sms:'',
|
||||||
buttonmsg:'获取验证码',
|
buttonmsg:'获取验证码',
|
||||||
flag:false,
|
flag:false,
|
||||||
adminCode:'',
|
adminCode:'',
|
||||||
zhud:false,
|
zhud:false,
|
||||||
usercheckbox:false,
|
usercheckbox:false,
|
||||||
loading:false,
|
loading:false,
|
||||||
usertitle:true,
|
usertitle:true,
|
||||||
gender: '',
|
gender: '',
|
||||||
inRank:false
|
inRank:false,
|
||||||
|
ifpassword:false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
// Myheader,
|
Myheader,
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
usertel () {
|
usertel () {
|
||||||
if (this.tel === ""){
|
if (this.tel === ""){
|
||||||
return ''
|
return ''
|
||||||
}else if(!/^[1][3,4,5,7,8][0-9]{9}$/.test(this.tel)){
|
}else if(!/^[1][3,4,5,7,8][0-9]{9}$/.test(this.tel)){
|
||||||
return '手机号格式错误'
|
return '手机号格式错误'
|
||||||
}else {
|
}else {
|
||||||
return ''
|
return ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
pass () {
|
pass () {
|
||||||
if (this.password === ""){
|
if (this.password === ""){
|
||||||
return ''
|
return ''
|
||||||
}else if(this.password.length<6){
|
}else if(this.password.length<6){
|
||||||
return '密码不可小于6位'
|
return '密码不可小于6位'
|
||||||
}else {
|
}else {
|
||||||
return ''
|
return ''
|
||||||
}
|
}
|
||||||
},
|
|
||||||
// test () {
|
|
||||||
// if (this.sms === ""){
|
|
||||||
// return ''
|
|
||||||
// }else if(this.sms.length !== 5){
|
|
||||||
// return '验证码格式错误'
|
|
||||||
// }else {
|
|
||||||
// return ''
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
},
|
},
|
||||||
|
|
||||||
components: {
|
|
||||||
|
|
||||||
},
|
},
|
||||||
mounted(){
|
mounted(){
|
||||||
},
|
},
|
||||||
@ -163,165 +149,160 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
|
|
||||||
//获取验证码
|
//获取验证码
|
||||||
async usermsg() {
|
async usermsg() {
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
//发送验证码数据
|
async vadmsg() {
|
||||||
async vadmsg() {
|
//console.log("-----");
|
||||||
console.log("-----");
|
let data = await vadatnmsg(this.sms,this.hash,this.tamp);
|
||||||
let data = await vadatnmsg(this.captchadata,this.hash,this.tamp);
|
|
||||||
if(data){
|
if(data){
|
||||||
console.log(data);
|
return data;
|
||||||
if(!data.code==1){
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
checkBox(){
|
|
||||||
console.log(event.target.checked)
|
checkBox(){
|
||||||
this.usercheckbox=event.target.checked
|
//console.log(event.target.checked)
|
||||||
|
this.usercheckbox=event.target.checked
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
//添加优惠券
|
//添加优惠券
|
||||||
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);
|
||||||
}
|
}
|
||||||
console.log(data);
|
//console.log(data);
|
||||||
|
},
|
||||||
|
//注册账户
|
||||||
|
sendCode () {
|
||||||
|
this.getCode()
|
||||||
},
|
},
|
||||||
//注册账户
|
|
||||||
sendCode () {
|
|
||||||
this.getCode()
|
|
||||||
},
|
|
||||||
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: 'warning',
|
||||||
message: '手机号码输入有误'
|
message: '手机号码输入有误'
|
||||||
});
|
});
|
||||||
return
|
return
|
||||||
|
|
||||||
} else{
|
} else{
|
||||||
let time = 60;
|
let time = 60;
|
||||||
let timer;
|
let timer;
|
||||||
|
|
||||||
timer = setInterval(() => {
|
timer = setInterval(() => {
|
||||||
time--;
|
time--;
|
||||||
if (time === 0) {
|
if (time === 0) {
|
||||||
clearInterval(timer);
|
clearInterval(timer);
|
||||||
this.flag = false;
|
this.flag = false;
|
||||||
this.buttonmsg = "点击发送验证码";
|
this.buttonmsg = "点击发送验证码";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.flag = true;
|
this.flag = true;
|
||||||
this.buttonmsg = time + "秒后重新发送";
|
this.buttonmsg = time + "秒后重新发送";
|
||||||
}, 1000);
|
}, 1000);
|
||||||
this.usermsg();
|
this.usermsg();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
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: 'warning',
|
||||||
message: '手机号码输入有误'
|
message: '手机号码输入有误'
|
||||||
});
|
});
|
||||||
return
|
return
|
||||||
|
|
||||||
}
|
}
|
||||||
if(this.sms!==this.captchadata){
|
// if(this.sms!==this.captchadata){
|
||||||
this.$message({
|
// this.$message({
|
||||||
type: 'warning',
|
// type: 'warning',
|
||||||
message: '验证码输入有误请重新输入'
|
// message: '验证码输入有误请重新输入'
|
||||||
});
|
// });
|
||||||
return
|
// return
|
||||||
}
|
// }
|
||||||
if(this.sms==''){
|
if(this.sms==''){
|
||||||
this.$message({
|
this.$message({
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
message: '请输入验证码'
|
message: '请输入验证码'
|
||||||
});
|
});
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
console.log(this.usercheckbox);
|
console.log(this.usercheckbox);
|
||||||
if(this.usercheckbox==false){
|
if(this.usercheckbox==false){
|
||||||
console.log('----');
|
console.log('----');
|
||||||
|
this.$message({
|
||||||
|
type: 'warning',
|
||||||
|
message: '请先同意隐私声明和账号使用协议'
|
||||||
|
});
|
||||||
|
if (!/^[1][3,4,5,7,8][0-9]{9}$/.test(this.tel) || this.tel === "") {
|
||||||
this.$message({
|
this.$message({
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
message: '请先勾选'
|
message: '手机号码输入有误'
|
||||||
});
|
});
|
||||||
if (!/^[1][3,4,5,7,8][0-9]{9}$/.test(this.tel) || this.tel === "") {
|
return
|
||||||
this.$message({
|
|
||||||
type: 'warning',
|
|
||||||
message: '手机号码输入有误'
|
|
||||||
});
|
|
||||||
return
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
|
|
||||||
|
}
|
||||||
let user= JSON.parse(localStorage.getItem("userInfo"));
|
}
|
||||||
console.log(this.tel);
|
else{
|
||||||
let data=await useredit(this.tel);
|
//let user= JSON.parse(localStorage.getItem("userInfo"));
|
||||||
this.vadmsg();
|
let data = await this.vadmsg();
|
||||||
this.$message({
|
if(data.code=="1")
|
||||||
type: 'warning',
|
{
|
||||||
message: data.msg
|
data=await useredit(this.tel);
|
||||||
});
|
if(data.code=='1'){
|
||||||
if(data){
|
let couponId='0000000123';
|
||||||
let couponId='0000000123';
|
this.serdiscount(this.tel,couponId);
|
||||||
this.serdiscount(user.data.mobile,couponId);
|
setTimeout(() => {
|
||||||
setTimeout(() => {
|
this.serdiscount(this.tel,"0000000140");
|
||||||
this.serdiscount(user.data.mobile,"0000000140");
|
}, 100);
|
||||||
}, 100);
|
setTimeout(() => {
|
||||||
setTimeout(() => {
|
this.serdiscount(this.tel,"0000000122");
|
||||||
this.serdiscount(user.data.mobile,"0000000122");
|
}, 500);
|
||||||
}, 500);
|
this.$router.push({
|
||||||
|
path: "/",
|
||||||
}
|
});
|
||||||
|
return;
|
||||||
return
|
}
|
||||||
|
}
|
||||||
|
this.$message({
|
||||||
|
type: 'warning',
|
||||||
|
message: data.msg
|
||||||
|
});
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
// reallR () {
|
},
|
||||||
// this.zhud=true
|
|
||||||
// this.loading=true
|
// reallR () {
|
||||||
// axios.post('https://www.daxunxun.com/users/register', {
|
// this.zhud=true
|
||||||
// username: this.tel,
|
// this.loading=true
|
||||||
// password: this.password
|
// axios.post('https://www.daxunxun.com/users/register', {
|
||||||
// }).then(res=>{
|
// username: this.tel,
|
||||||
// this.zhud=false
|
// password: this.password
|
||||||
// this.loading=false
|
// }).then(res=>{
|
||||||
// if (res.data === 2) {
|
// this.zhud=false
|
||||||
// Toast('用户名已注册,请直接登录')
|
// this.loading=false
|
||||||
// } else if (res.data === 0) {
|
// if (res.data === 2) {
|
||||||
// Toast('注册失败')
|
// Toast('用户名已注册,请直接登录')
|
||||||
// } else {
|
// } else if (res.data === 0) {
|
||||||
// Toast('注册成功')
|
// Toast('注册失败')
|
||||||
// }
|
// } else {
|
||||||
// })
|
// Toast('注册成功')
|
||||||
// }
|
// }
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,39 +1,38 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="container rc-full-width">
|
<div class="container rc-full-width">
|
||||||
<Myheader></Myheader>
|
<Myheader></Myheader>
|
||||||
|
<div class="rc-top"></div>
|
||||||
<div class="content ts-max-width--460">
|
<div class="content ts-max-width--460">
|
||||||
<h2 class="rc-beta rc-text--center">{{ usertitle ? "账号登录" : "" }}</h2>
|
<h2 class="rc-beta rc-text--center">{{ usertitle ? "账号登录" : "" }}</h2>
|
||||||
<!-- Deprecated : No tab switching as no password
|
<!-- Deprecated : No tab switching as no password
|
||||||
<div class="rc-header">
|
<div class="rc-header">
|
||||||
<span
|
<span
|
||||||
v-for="(item, index) in swiperData"
|
v-for="(item, index) in swiperData"
|
||||||
:key="index"
|
:key="index"
|
||||||
@click="selectGoods(item, index)"
|
@click="selectGoods(item, index)"
|
||||||
:class="activeIndex == index ? 'active' : 'unactive'"
|
:class="activeIndex == index ? 'active' : 'unactive'"
|
||||||
>{{ item.title }}</span
|
>{{ item.title }}</span
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
-->
|
-->
|
||||||
|
<div class="rc-layout-container rc-one-column">
|
||||||
<div class="rc-layout-container rc-one-column">
|
<div class="rc-column">
|
||||||
<div class="rc-column">
|
<input
|
||||||
<input
|
class="ts-standard-input"
|
||||||
class="ts-standard-input"
|
v-model="tel"
|
||||||
v-model="tel"
|
placeholder="请输入手机号"
|
||||||
placeholder="请输入手机号"
|
:error-message="usertel"
|
||||||
:error-message="usertel"
|
v-if="!ifpassword"
|
||||||
v-if="!ifpassword"
|
clearable
|
||||||
clearable
|
/>
|
||||||
/>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<!-- Deprecated : No tab switching as no password
|
||||||
<!-- Deprecated : No tab switching as no password
|
|
||||||
<input
|
<input
|
||||||
v-model="text"
|
v-model="text"
|
||||||
class="ts-standard-input ts-standard-input--two"
|
class="ts-standard-input ts-standard-input--two"
|
||||||
placeholder="请输入账号"
|
placeholder="请输入账号"
|
||||||
|
|
||||||
v-if="ifpassword"
|
v-if="ifpassword"
|
||||||
clearable
|
clearable
|
||||||
/>
|
/>
|
||||||
@ -42,76 +41,76 @@
|
|||||||
v-model="password"
|
v-model="password"
|
||||||
type="password"
|
type="password"
|
||||||
placeholder="请输入密码"
|
placeholder="请输入密码"
|
||||||
|
|
||||||
v-if="ifpassword"
|
v-if="ifpassword"
|
||||||
clearable
|
clearable
|
||||||
/>
|
/>
|
||||||
-->
|
-->
|
||||||
<div class="rc-layout-container rc-two-column">
|
<div class="rc-layout-container rc-two-column">
|
||||||
<div class="rc-column">
|
<div class="rc-column">
|
||||||
<input
|
<input
|
||||||
v-if="!ifpassword"
|
v-if="!ifpassword"
|
||||||
v-model="sms"
|
v-model="sms"
|
||||||
class="ts-standard-input ts-standard-input--two center"
|
class="ts-standard-input ts-standard-input--two center"
|
||||||
center
|
center
|
||||||
clearable
|
clearable
|
||||||
placeholder="请输入验证码"
|
placeholder="请输入验证码"
|
||||||
|
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
<div class="rc-column">
|
<div class="rc-column">
|
||||||
<button
|
<button
|
||||||
:disabled="flag"
|
:disabled="flag"
|
||||||
slot="button"
|
slot="button"
|
||||||
size="small"
|
size="small"
|
||||||
@click="sendCode"
|
@click="sendCode"
|
||||||
class="rc-use ts-standard-btn ts-standard-btn--two"
|
class="rc-use ts-standard-btn ts-standard-btn--two"
|
||||||
>{{ buttonmsg }}</button
|
>{{ buttonmsg }}</button
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="rc-layout-container rc-one-column">
|
<div class="rc-layout-container rc-one-column">
|
||||||
<div class="usecheck rc-column rc-text--left">
|
<div class="usecheck rc-column rc-text--left">
|
||||||
<label>
|
<label>
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
@click="checkBox()"
|
@click="checkBox()"
|
||||||
style="width: 24px; height: 24px"
|
style="width: 24px; height: 24px"
|
||||||
v-model="inRank"
|
v-model="inRank"
|
||||||
/>我已阅读同意隐私声明和账号使用协议
|
/>我已阅读同意隐私声明和账号使用协议
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="rc-layout-container rc-two-column rc-button">
|
<div class="rc-layout-container rc-two-column rc-button">
|
||||||
<div class="rc-column rc-text--left">
|
<div class="rc-column rc-text--left">
|
||||||
<a href="#" class="rc-styled-link"><span>隐私政策</span></a>
|
<a href="#" class="rc-styled-link"><span>隐私政策</span></a>
|
||||||
</div>
|
</div>
|
||||||
<div class="rc-column rc-text--right">
|
<div class="rc-column rc-text--right">
|
||||||
<nuxt-link :to="`/userlogin/edit/`" class="rc-styled-link">
|
<nuxt-link :to="`/userlogin/edit/`" class="rc-styled-link">
|
||||||
<span>注册账户</span>
|
<span>注册账户</span>
|
||||||
</nuxt-link>
|
</nuxt-link>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="rc-layout-container rc-one-column">
|
<div class="rc-layout-container rc-one-column">
|
||||||
<div class="rc-column">
|
<div class="rc-column">
|
||||||
<input
|
<input
|
||||||
type="primary"
|
type="primary"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
loading-text="登录..."
|
loading-text="登录..."
|
||||||
size="large"
|
size="large"
|
||||||
:disabled="zhud"
|
:disabled="zhud"
|
||||||
@click="register()"
|
@click="register()"
|
||||||
class="ts-standard-btn ts-standard-btn--max-width"
|
class="ts-standard-btn ts-standard-btn--max-width"
|
||||||
value="登录"
|
value="登录"
|
||||||
></input
|
></input
|
||||||
>
|
>
|
||||||
<!-- <van-divider @click="toLogin">注册账户</van-divider> -->
|
<!-- <van-divider @click="toLogin">注册账户</van-divider> -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
||||||
@ -146,11 +145,11 @@ export default {
|
|||||||
swiperData: [
|
swiperData: [
|
||||||
// { index: 1 ,title:'短信验证码登录'},
|
// { index: 1 ,title:'短信验证码登录'},
|
||||||
// { index: 2 ,title:'密码登录'},
|
// { index: 2 ,title:'密码登录'},
|
||||||
],
|
]
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
Myheader
|
Myheader
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
usertel() {
|
usertel() {
|
||||||
@ -181,48 +180,40 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
components: {},
|
|
||||||
mounted() {
|
mounted() {
|
||||||
console.log(this.$route.params);
|
//console.log(this.$route.params);
|
||||||
},
|
},
|
||||||
// watch: function () {
|
// watch: function () {
|
||||||
// console.log(this.inRank);
|
// console.log(this.inRank);
|
||||||
// },
|
// },
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
...mapMutations(["changeClod"]),
|
...mapMutations(["changeClod"]),
|
||||||
checkBox(){
|
checkBox(){
|
||||||
console.log(event.target.checked)
|
console.log(event.target.checked)
|
||||||
this.usercheckbox=event.target.checked
|
this.usercheckbox=event.target.checked
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
//获取验证码
|
//获取验证码
|
||||||
async usermsg() {
|
async usermsg() {
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
//发送验证码数据
|
//发送验证码数据
|
||||||
async vadmsg() {
|
async vadmsg() {
|
||||||
console.log("-----");
|
//console.log("-----");
|
||||||
let data = await vadatnmsg(this.captchadata,this.hash,this.tamp);
|
let data = await vadatnmsg(this.sms,this.hash,this.tamp);
|
||||||
if(data){
|
if(data){
|
||||||
console.log(data.code);
|
return data;
|
||||||
if(!data.code==1){
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
onClickHander(e) {
|
onClickHander(e) {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
@ -239,7 +230,7 @@ export default {
|
|||||||
},
|
},
|
||||||
//注册账户
|
//注册账户
|
||||||
useredd() {
|
useredd() {
|
||||||
console.log("---注册账户");
|
//console.log("---注册账户");
|
||||||
this.usertitle = false;
|
this.usertitle = false;
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -248,134 +239,96 @@ export default {
|
|||||||
},
|
},
|
||||||
sendCode() {
|
sendCode() {
|
||||||
|
|
||||||
this.getCode();
|
this.getCode();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
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: 'warning',
|
||||||
message: '手机号码输入有误'
|
message: '手机号码输入有误'
|
||||||
});
|
});
|
||||||
return
|
return
|
||||||
|
|
||||||
} else{
|
|
||||||
|
|
||||||
|
|
||||||
let time = 60;
|
} else{
|
||||||
let timer;
|
|
||||||
|
|
||||||
timer = setInterval(() => {
|
let time = 60;
|
||||||
time--;
|
let timer;
|
||||||
if (time === 0) {
|
|
||||||
clearInterval(timer);
|
timer = setInterval(() => {
|
||||||
this.flag = false;
|
time--;
|
||||||
this.buttonmsg = "点击发送验证码";
|
if (time === 0) {
|
||||||
return;
|
clearInterval(timer);
|
||||||
}
|
this.flag = false;
|
||||||
this.flag = true;
|
this.buttonmsg = "点击发送验证码";
|
||||||
this.buttonmsg = time + "秒后重新发送";
|
return;
|
||||||
}, 1000);
|
}
|
||||||
this.usermsg();
|
this.flag = true;
|
||||||
|
this.buttonmsg = time + "秒后重新发送";
|
||||||
|
}, 1000);
|
||||||
|
this.usermsg();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
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: 'warning',
|
||||||
message: '手机号码输入有误'
|
message: '手机号码输入有误'
|
||||||
});
|
});
|
||||||
return
|
return
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if(this.sms!==this.captchadata){
|
|
||||||
this.$message({
|
|
||||||
type: 'warning',
|
|
||||||
message: '验证码输入有误请重新输入'
|
|
||||||
});
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
if(this.sms==''){
|
if(this.sms==''){
|
||||||
this.$message({
|
this.$message({
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
message: '请输入验证码'
|
message: '请输入验证码'
|
||||||
});
|
});
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
console.log(this.usercheckbox);
|
|
||||||
if(this.usercheckbox==false){
|
if(this.usercheckbox==false){
|
||||||
console.log('----');
|
//console.log('----');
|
||||||
|
this.$message({
|
||||||
|
type: 'warning',
|
||||||
|
message: '请先同意隐私声明和账号使用协议'
|
||||||
|
});
|
||||||
|
if (!/^[1][3,4,5,7,8][0-9]{9}$/.test(this.tel) || this.tel === "") {
|
||||||
this.$message({
|
this.$message({
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
message: '请先勾选'
|
message: '手机号码输入有误'
|
||||||
});
|
});
|
||||||
if (!/^[1][3,4,5,7,8][0-9]{9}$/.test(this.tel) || this.tel === "") {
|
return
|
||||||
this.$message({
|
|
||||||
type: 'warning',
|
|
||||||
message: '手机号码输入有误'
|
|
||||||
});
|
|
||||||
return
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
console.log(this.tel);
|
|
||||||
let data = await userLongin(this.tel);
|
|
||||||
console.log(data);
|
|
||||||
this.vadmsg();
|
|
||||||
|
|
||||||
|
|
||||||
this.$message({
|
}
|
||||||
type: 'warning',
|
|
||||||
message: '登录成功'
|
|
||||||
});
|
|
||||||
if(data.msg=='SUCCESS'){
|
|
||||||
this.$router.push({
|
|
||||||
path: "/",
|
|
||||||
|
|
||||||
});
|
|
||||||
let token=JSON.stringify(data);
|
|
||||||
this.changeClod({ cloud: token });
|
|
||||||
}else{
|
|
||||||
this.$message({
|
|
||||||
type: 'warning',
|
|
||||||
message: data.msg
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
else{
|
||||||
|
let data=await this.vadmsg();
|
||||||
|
if(data.code=="1")
|
||||||
|
{
|
||||||
|
data = await userLongin(this.tel);
|
||||||
|
if(data.msg=='SUCCESS'){
|
||||||
|
this.$message({
|
||||||
|
type: 'warning',
|
||||||
|
message: '登录成功'
|
||||||
|
});
|
||||||
|
this.$router.push({
|
||||||
|
path: "/",
|
||||||
|
});
|
||||||
|
let token=JSON.stringify(data);
|
||||||
|
this.changeClod({ cloud: token });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.$message({
|
||||||
|
type: 'warning',
|
||||||
|
message: data.msg
|
||||||
|
});
|
||||||
|
|
||||||
|
return
|
||||||
},
|
}},
|
||||||
|
|
||||||
// reallR () {
|
|
||||||
// this.zhud=true
|
|
||||||
// this.loading=true
|
|
||||||
// axios.post('https://www.daxunxun.com/users/register', {
|
|
||||||
// username: this.tel,
|
|
||||||
// password: this.password
|
|
||||||
// }).then(res=>{
|
|
||||||
// this.zhud=false
|
|
||||||
// this.loading=false
|
|
||||||
// if (res.data === 2) {
|
|
||||||
// Toast('用户名已注册,请直接登录')
|
|
||||||
// } else if (res.data === 0) {
|
|
||||||
// Toast('注册失败')
|
|
||||||
// } else {
|
|
||||||
// Toast('注册成功')
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
@import url("../../assets/css/global.less");
|
|
||||||
@import url("../../assets/css/login.less");
|
@import url("../../assets/css/login.less");
|
||||||
</style>
|
</style>
|
@ -1,4 +0,0 @@
|
|||||||
import Vue from 'vue'
|
|
||||||
import VueAwesomeSwiper from 'vue-awesome-swiper'
|
|
||||||
|
|
||||||
Vue.use(VueAwesomeSwiper)
|
|
Before Width: | Height: | Size: 85 KiB After Width: | Height: | Size: 85 KiB |
Before Width: | Height: | Size: 170 KiB After Width: | Height: | Size: 170 KiB |
BIN
rc-busness/static/images/banner/pc-banner1.png
Normal file
After Width: | Height: | Size: 117 KiB |
BIN
rc-busness/static/images/banner/pc-banner2.png
Normal file
After Width: | Height: | Size: 136 KiB |
Before Width: | Height: | Size: 1.0 MiB After Width: | Height: | Size: 1.0 MiB |
Before Width: | Height: | Size: 286 KiB After Width: | Height: | Size: 286 KiB |
@ -29,6 +29,15 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
-->
|
-->
|
||||||
|
|
||||||
|
<!--JWT-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.auth0</groupId>
|
||||||
|
<artifactId>java-jwt</artifactId>
|
||||||
|
<version>3.8.2</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-aop</artifactId>
|
<artifactId>spring-boot-starter-aop</artifactId>
|
||||||
|
@ -1,47 +1,25 @@
|
|||||||
package net.lab1024.smartadmin.module.system.royalcanin;
|
package net.lab1024.smartadmin.module.system.royalcanin;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import eu.bitwalker.useragentutils.UserAgent;
|
|
||||||
import io.jsonwebtoken.Claims;
|
|
||||||
import io.jsonwebtoken.Jwts;
|
|
||||||
import io.jsonwebtoken.SignatureAlgorithm;
|
|
||||||
import net.lab1024.smartadmin.common.constant.JudgeEnum;
|
|
||||||
import net.lab1024.smartadmin.common.heartbeat.StringUtil;
|
import net.lab1024.smartadmin.common.heartbeat.StringUtil;
|
||||||
import net.lab1024.smartadmin.module.business.log.LogService;
|
|
||||||
import net.lab1024.smartadmin.module.business.log.userloginlog.domain.UserLoginLogEntity;
|
|
||||||
import net.lab1024.smartadmin.module.system.royalcanin.member.*;
|
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.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.Value;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.time.ZoneId;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class MemberService {
|
public class MemberService {
|
||||||
private String url = "http://miniapp-test.royalcanin.com.cn:7080/crm/member/";
|
private String url = "http://miniapp-test.royalcanin.com.cn:7080/crm/member/";
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private LogService logService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 过期时间一天
|
|
||||||
*/
|
|
||||||
private static final int EXPIRE_SECONDS = 1 * 24 * 3600;
|
|
||||||
/**
|
|
||||||
* jwt加密字段
|
|
||||||
*/
|
|
||||||
private static final String CLAIM_ID_KEY = "id";
|
|
||||||
|
|
||||||
@Value("${jwt.key}")
|
|
||||||
private String jwtKey;
|
|
||||||
|
|
||||||
|
|
||||||
public String memberGet(MemberGetEntity memberGetEntity, HttpServletRequest request)throws Exception {
|
public String memberGet(MemberGetEntity memberGetEntity, HttpServletRequest request)throws Exception {
|
||||||
Map<String, String> paramMap = MapRemoveNullUtil.setConditionMap(memberGetEntity);
|
Map<String, String> paramMap = MapRemoveNullUtil.setConditionMap(memberGetEntity);
|
||||||
@ -52,7 +30,7 @@ public class MemberService {
|
|||||||
if(jsonObject.getString("code").equals("0")){
|
if(jsonObject.getString("code").equals("0")){
|
||||||
JSONObject json = JSONObject.parseObject(jsonObject.getString("data"));
|
JSONObject json = JSONObject.parseObject(jsonObject.getString("data"));
|
||||||
String id = json.getString("id");
|
String id = json.getString("id");
|
||||||
jsonObject.put("xaccessToken",generateToken(id));
|
jsonObject.put("xaccessToken", SmartJWTUtil.generateToken(id));
|
||||||
return jsonObject.toJSONString();
|
return jsonObject.toJSONString();
|
||||||
}else {
|
}else {
|
||||||
return sb;
|
return sb;
|
||||||
@ -83,7 +61,7 @@ public class MemberService {
|
|||||||
return SmartHttpUtil.httpPostRaw(url+"check",jsonObject.toString(),null,"utf-8");
|
return SmartHttpUtil.httpPostRaw(url+"check",jsonObject.toString(),null,"utf-8");
|
||||||
}
|
}
|
||||||
|
|
||||||
public String memberUpdate(MemberUpdateEntity memberUpdateEntity)throws Exception{
|
public String memberUpdate(MemberUpdateEntity memberUpdateEntity){
|
||||||
Map<String, String> paramMap = MapRemoveNullUtil.setConditionMap(memberUpdateEntity);
|
Map<String, String> paramMap = MapRemoveNullUtil.setConditionMap(memberUpdateEntity);
|
||||||
paramMap.put("id",StringUtil.toString(memberUpdateEntity.getId()).equals("0")?null:StringUtil.toString(memberUpdateEntity.getId()));
|
paramMap.put("id",StringUtil.toString(memberUpdateEntity.getId()).equals("0")?null:StringUtil.toString(memberUpdateEntity.getId()));
|
||||||
paramMap.put("cityId",StringUtil.toString(memberUpdateEntity.getCityId()).equals("0")?null:StringUtil.toString(memberUpdateEntity.getCityId()));
|
paramMap.put("cityId",StringUtil.toString(memberUpdateEntity.getCityId()).equals("0")?null:StringUtil.toString(memberUpdateEntity.getCityId()));
|
||||||
@ -94,25 +72,7 @@ public class MemberService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 功能描述: 生成JWT TOKEN
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
* @auther Carl
|
|
||||||
* @date 2021/12/8 0012
|
|
||||||
*/
|
|
||||||
public String generateToken(String UserId) {
|
|
||||||
Long id = Long.parseLong(UserId);
|
|
||||||
/**将token设置为jwt格式*/
|
|
||||||
String baseToken = UUID.randomUUID().toString();
|
|
||||||
LocalDateTime localDateTimeNow = LocalDateTime.now();
|
|
||||||
LocalDateTime localDateTimeExpire = localDateTimeNow.plusSeconds(EXPIRE_SECONDS);
|
|
||||||
Date from = Date.from(localDateTimeNow.atZone(ZoneId.systemDefault()).toInstant());
|
|
||||||
Date expire = Date.from(localDateTimeExpire.atZone(ZoneId.systemDefault()).toInstant());
|
|
||||||
|
|
||||||
Claims jwtClaims = Jwts.claims().setSubject(baseToken);
|
|
||||||
jwtClaims.put(CLAIM_ID_KEY, id);
|
|
||||||
String compactJws = Jwts.builder().setClaims(jwtClaims).setNotBefore(from).setExpiration(expire).signWith(SignatureAlgorithm.HS512, jwtKey).compact();
|
|
||||||
return compactJws;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,7 @@ public class SMSController {
|
|||||||
String hash = MD5Utils.getMD5Code(KEY + "@" + currentTime + "@" + randomNum);//生成MD5值
|
String hash = MD5Utils.getMD5Code(KEY + "@" + currentTime + "@" + randomNum);//生成MD5值
|
||||||
Map<String, Object> resultMap = new HashMap<>();
|
Map<String, Object> resultMap = new HashMap<>();
|
||||||
resultMap.put("hash", hash);
|
resultMap.put("hash", hash);
|
||||||
resultMap.put("msgNum",randomNum);
|
// resultMap.put("msgNum",randomNum);
|
||||||
resultMap.put("tamp", currentTime);
|
resultMap.put("tamp", currentTime);
|
||||||
return resultMap; //将hash值和tamp时间返回给前端
|
return resultMap; //将hash值和tamp时间返回给前端
|
||||||
}
|
}
|
||||||
@ -53,6 +53,9 @@ public class SMSController {
|
|||||||
String tamp = requestMap.get("tamp").toString();
|
String tamp = requestMap.get("tamp").toString();
|
||||||
String msgNum = requestMap.get("msgNum").toString();
|
String msgNum = requestMap.get("msgNum").toString();
|
||||||
String hash = MD5Utils.getMD5Code(KEY + "@" + tamp + "@" + msgNum);
|
String hash = MD5Utils.getMD5Code(KEY + "@" + tamp + "@" + msgNum);
|
||||||
|
if(tamp == "")
|
||||||
|
return ResponseDTO.wrap(OrderResponseCodeConst.SMS_FAIL);
|
||||||
|
|
||||||
if (tamp.compareTo(currentTime) > 0) {
|
if (tamp.compareTo(currentTime) > 0) {
|
||||||
if (hash.equalsIgnoreCase(requestHash)){
|
if (hash.equalsIgnoreCase(requestHash)){
|
||||||
//校验成功
|
//校验成功
|
||||||
|
@ -17,11 +17,13 @@ import net.lab1024.smartadmin.module.system.royalcanin.good.model.ProductMasterQ
|
|||||||
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.good.service.CartService;
|
import net.lab1024.smartadmin.module.system.royalcanin.good.service.CartService;
|
||||||
import net.lab1024.smartadmin.module.system.royalcanin.good.service.GoodService;
|
import net.lab1024.smartadmin.module.system.royalcanin.good.service.GoodService;
|
||||||
|
import net.lab1024.smartadmin.util.SmartJWTUtil;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -33,6 +35,8 @@ public class GoodController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private RoyalcaninOperateLogService royalcaninOperateLogService;
|
private RoyalcaninOperateLogService royalcaninOperateLogService;
|
||||||
|
|
||||||
|
public static final String TOKEN_NAME = "x-access-token";
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private CartService cartService;
|
private CartService cartService;
|
||||||
|
|
||||||
@ -119,18 +123,19 @@ public class GoodController {
|
|||||||
|
|
||||||
@ApiOperation(value = "查询购物车信息", notes = "查询购物车信息")
|
@ApiOperation(value = "查询购物车信息", notes = "查询购物车信息")
|
||||||
@PostMapping("royalcanin/getCartProductInfo")
|
@PostMapping("royalcanin/getCartProductInfo")
|
||||||
public List<CartEntity> getCartProductInfo(String memberId){
|
public List<CartEntity> getCartProductInfo(HttpServletRequest request){
|
||||||
|
String memberId = SmartJWTUtil.decodeToken(request.getHeader(TOKEN_NAME));
|
||||||
return cartService.getAllProductbyMember(memberId);
|
return cartService.getAllProductbyMember(memberId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "删除购物车信息", notes = "删除购物车信息")
|
@ApiOperation(value = "删除购物车信息", notes = "删除购物车信息")
|
||||||
@PostMapping("royalcanin/cancelCartProductInfo")
|
@PostMapping("royalcanin/cancelCartProductInfo")
|
||||||
public ResponseDTO<String> cancelCartProductInfo(String memberId,@RequestBody List<String> productCode){
|
public ResponseDTO<String> cancelCartProductInfo(HttpServletRequest request, @RequestBody List<String> productCode){
|
||||||
|
String memberId = SmartJWTUtil.decodeToken(request.getHeader(TOKEN_NAME));
|
||||||
for (int i = 0 ;i < productCode.size();i++) {
|
for (int i = 0 ;i < productCode.size();i++) {
|
||||||
cartService.cancelProduct(memberId,productCode.get(i));
|
cartService.cancelProduct(memberId,productCode.get(i));
|
||||||
}
|
}
|
||||||
return ResponseDTO.succ();
|
return ResponseDTO.succ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -216,14 +216,21 @@ public class OrderService {
|
|||||||
royalcaninOperateLogEntity.setAcceptTime(dateformat.format(acceptTime));
|
royalcaninOperateLogEntity.setAcceptTime(dateformat.format(acceptTime));
|
||||||
royalcaninOperateLogService.add(royalcaninOperateLogEntity);
|
royalcaninOperateLogService.add(royalcaninOperateLogEntity);
|
||||||
return ResponseDTO.succ();
|
return ResponseDTO.succ();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public double couponTotal(String couponTypeId,double discount,double total,int buyCount){
|
public double couponTotal(String couponTypeId,double discount,double total,int buyCount){
|
||||||
double endTotal = 0;
|
double endTotal = 0;
|
||||||
switch (couponTypeId)
|
switch (couponTypeId)
|
||||||
{
|
{
|
||||||
case "5" :
|
// case "5" :
|
||||||
endTotal = (total * (buyCount-1)) + (total * discount);
|
// endTotal = (total * (buyCount-1)) + (total * discount);
|
||||||
|
// break;
|
||||||
|
case "2":
|
||||||
|
endTotal = total * buyCount - discount;
|
||||||
|
break;
|
||||||
|
case "3":
|
||||||
|
endTotal = (total * buyCount) * discount;
|
||||||
break;
|
break;
|
||||||
case "1" :
|
case "1" :
|
||||||
endTotal = total * buyCount - discount;
|
endTotal = total * buyCount - discount;
|
||||||
|
@ -14,7 +14,7 @@ public class MemberAddressAddEntity {
|
|||||||
/**
|
/**
|
||||||
* 会员ID
|
* 会员ID
|
||||||
*/
|
*/
|
||||||
private int memberId;
|
private String memberId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 省份ID
|
* 省份ID
|
||||||
@ -24,12 +24,12 @@ public class MemberAddressAddEntity {
|
|||||||
/**
|
/**
|
||||||
* 城市ID
|
* 城市ID
|
||||||
*/
|
*/
|
||||||
private int cityId;
|
private String cityId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 区ID
|
* 区ID
|
||||||
*/
|
*/
|
||||||
private int districtId;
|
private String districtId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 地址
|
* 地址
|
||||||
|
@ -16,7 +16,7 @@ public class MemberAddressDeleteEntity {
|
|||||||
/**
|
/**
|
||||||
* 会员ID
|
* 会员ID
|
||||||
*/
|
*/
|
||||||
private int memberId;
|
private String memberId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 宠物ID
|
* 宠物ID
|
||||||
|
@ -19,5 +19,5 @@ public class MemberAddressGetAllEntity {
|
|||||||
/**
|
/**
|
||||||
* 会员ID
|
* 会员ID
|
||||||
*/
|
*/
|
||||||
private int memberId;
|
private String memberId;
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@ public class MemberAddressUpdateEntity {
|
|||||||
/**
|
/**
|
||||||
* 会员ID
|
* 会员ID
|
||||||
*/
|
*/
|
||||||
private int memberId;
|
private String memberId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 会员地址ID
|
* 会员地址ID
|
||||||
@ -32,12 +32,12 @@ public class MemberAddressUpdateEntity {
|
|||||||
/**
|
/**
|
||||||
* 城市ID
|
* 城市ID
|
||||||
*/
|
*/
|
||||||
private int cityId;
|
private String cityId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 区ID
|
* 区ID
|
||||||
*/
|
*/
|
||||||
private int districtId;
|
private String districtId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 地址
|
* 地址
|
||||||
|
@ -0,0 +1,85 @@
|
|||||||
|
package net.lab1024.smartadmin.util;
|
||||||
|
|
||||||
|
import com.auth0.jwt.JWT;
|
||||||
|
import com.auth0.jwt.JWTVerifier;
|
||||||
|
import com.auth0.jwt.algorithms.Algorithm;
|
||||||
|
import com.auth0.jwt.exceptions.JWTVerificationException;
|
||||||
|
import com.auth0.jwt.interfaces.DecodedJWT;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class SmartJWTUtil {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 过期时间一天
|
||||||
|
*/
|
||||||
|
private static final int EXPIRE_SECONDS = 1 * 24 * 3600;
|
||||||
|
/**
|
||||||
|
* jwt加密字段
|
||||||
|
*/
|
||||||
|
private static final String CLAIM_ID_KEY = "id";
|
||||||
|
|
||||||
|
//设置过期时间
|
||||||
|
private static final long EXPIRE_DATE = 30 * 60 * 100000;
|
||||||
|
//token秘钥
|
||||||
|
private static final String TOKEN_SECRET = "smart-admin-jwt-key";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static String generateToken(String userId) {
|
||||||
|
String token;
|
||||||
|
try {
|
||||||
|
//过期时间
|
||||||
|
Date date = new Date(System.currentTimeMillis() + EXPIRE_DATE);
|
||||||
|
//秘钥及加密算法
|
||||||
|
Algorithm algorithm = Algorithm.HMAC256(TOKEN_SECRET);
|
||||||
|
//设置头部信息
|
||||||
|
Map<String, Object> header = new HashMap<>();
|
||||||
|
header.put("typ", "JWT");
|
||||||
|
header.put("alg", "HS256");
|
||||||
|
//携带UserId信息,生成签名
|
||||||
|
token = JWT.create()
|
||||||
|
.withHeader(header)
|
||||||
|
.withClaim(CLAIM_ID_KEY, userId)
|
||||||
|
.withExpiresAt(date)
|
||||||
|
.sign(algorithm);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return token;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* JWT解密
|
||||||
|
*
|
||||||
|
* @Author: RZH
|
||||||
|
* @Date: 2020/4/6 9:30
|
||||||
|
*/
|
||||||
|
public static String decodeToken(final String token) {
|
||||||
|
String userId = null;
|
||||||
|
try {
|
||||||
|
JWTVerifier verifier = JWT.require(Algorithm.HMAC256(TOKEN_SECRET))
|
||||||
|
.build();
|
||||||
|
DecodedJWT jwt = verifier.verify(token);
|
||||||
|
if (jwt != null) {
|
||||||
|
userId = jwt.getClaim(CLAIM_ID_KEY).asString();
|
||||||
|
}
|
||||||
|
} catch (JWTVerificationException exception) {
|
||||||
|
exception.printStackTrace();
|
||||||
|
} catch (IllegalArgumentException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return userId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
String token = SmartJWTUtil.generateToken("844350");
|
||||||
|
System.out.println(SmartJWTUtil.decodeToken(token));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|