Index content / bug completed, method of login checking in store/index.js added

This commit is contained in:
Vion 2022-01-22 13:29:19 +08:00
parent 60c6a6b8b4
commit debf618d7e
9 changed files with 307 additions and 275 deletions

View File

@ -41,6 +41,36 @@ body{
top:0; top:0;
} }
} }
input[type=checkbox]{
position:relative;
cursor: pointer;
border:none;
border: 1px solid #d7d7d7;
border-radius: 3px;
width: 1.5rem;
height: 1.5rem;
&:before {
top: 0;
left: 0;
content: "";
width: 1.5rem;
height: 1.5rem;
position: absolute;
display: inline-block;
background-color: #fff;
background-image: url("../image/rc-select.png");
background-size: contain;
}
&:checked:before {
background-image: url("../image/rc-unselect.png");
}
}
label {
input[type=checkbox] {
top:.375rem;
}
}
.userloding { .userloding {
background: url(../image/onloading.png) center center no-repeat; background: url(../image/onloading.png) center center no-repeat;
width: 3.12rem; width: 3.12rem;
@ -139,12 +169,13 @@ img, picture {
font-size: 1.125rem; font-size: 1.125rem;
margin-top: .5rem; margin-top: .5rem;
display: block; display: block;
min-height:1.6rem;
} }
} }
} }
img{ img{
width:10rem; width:10rem;
height:10rem; //min-height:19.875rem;
object-fit: contain; object-fit: contain;
display: flex; display: flex;
margin: 0 auto; margin: 0 auto;
@ -340,6 +371,14 @@ img, picture {
html { html {
//font-size:100px; //font-size:100px;
} }
label {
input[type=checkbox] {
top:.25rem;
}
}
.rc-header__nav--primary{
overflow:hidden;
}
.ts-login--xs .rc-screen-reader{ .ts-login--xs .rc-screen-reader{
left:7%; left:7%;
top:22%; top:22%;
@ -445,10 +484,6 @@ img, picture {
max-width:20rem; max-width:20rem;
min-width:18.75rem; min-width:18.75rem;
width:22.8vw; width:22.8vw;
//margin-right:.875rem;
margin-left:2vw;
padding-left:1px;
padding-right:1px;
box-sizing: border-box; box-sizing: border-box;
.rc-column{ .rc-column{
span{ span{
@ -625,14 +660,7 @@ img, picture {
} }
@media screen and (min-width: 769px) and (max-width: 1370px) @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;
}
}
} }
.rc_contline { .rc_contline {
border-bottom: 3px solid #f6f6f6; border-bottom: 3px solid #f6f6f6;

View File

@ -46,8 +46,8 @@
.uservideo{ .uservideo{
overflow: hidden; overflow: hidden;
video{ video{
height:100%; width:100%;
width:auto; height:auto;
} }
} }
.ul-dog{ .ul-dog{
@ -181,38 +181,31 @@
#xxxFullScreen { #xxxFullScreen {
background-color: white; background-color: white;
margin-top: 0.40rem; margin-top: 0.40rem;
#swiper1 {
overflow: hidden;
}
.swiper-container{ .swiper-container{
height: 6.45rem; height: 6.45rem;
} }
.swiper-container, .swiper-container2 { .swiper-container {
width: 100%; width: 100%;
// overflow: visible !important;
height: 100%; height: 100%;
position: relative; position: relative;
} }
#swiper1 .swiper-container .swiper-wrapper .swiper-slide { .swiper-container .swiper-wrapper .swiper-slide {
width: 17.25rem; width: 17.25rem;
//height: 6.45rem !important; //Auto adaption //height: 6.45rem !important; //Auto adaption
} }
/* 上一张 */ /* 上一张 */
#swiper1 .swiper-container .swiper-wrapper .swiper-slide-prev { swiper-container .swiper-wrapper .swiper-slide-prev {
margin-top: 0.05rem; margin-top: 0.05rem;
height: 100%; height: 100%;
} }
/* 下一张 */ /* 下一张 */
#swiper1 .swiper-container .swiper-wrapper .swiper-slide-next { .swiper-container .swiper-wrapper .swiper-slide-next {
margin-top: 0.05rem; margin-top: 0.05rem;
height: 100%; height: 100%;
} }
.swiper-container .swiper-wrapper .swiper-slide-active { .swiper-container .swiper-wrapper .swiper-slide-active {
height: 100%; height: 100%;
} }
.uservideo{ .uservideo{
width: 100%; width: 100%;
@ -476,7 +469,7 @@
text-overflow: ellipsis; text-overflow: ellipsis;
display: -webkit-box; display: -webkit-box;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
-webkit-line-clamp: 2; /* 这里是超出几行省略 */ -webkit-line-clamp: 2;
color: #666666; color: #666666;
margin-top: 0.16rem; margin-top: 0.16rem;
text-align: center; text-align: center;

View File

@ -128,12 +128,11 @@
margin: 0 auto; margin: 0 auto;
color: #333333; color: #333333;
} }
.rc-button span {
border-bottom: 1px solid #333333;
}
.rc-button span { .rc-button span {
margin-left: 20px; margin-left: 20px;
margin-top: 24px; margin-top: 24px;
border-bottom: 1px solid #333333;
padding-bottom:.5rem;
} }
.rc-button span:last-child { .rc-button span:last-child {
margin-right: 20px; margin-right: 20px;
@ -142,7 +141,7 @@
} }
} }
// /* 最小768px最大1920 *pc端/ // /* 最小768px最大1920 *pc端/
@media screen and (min-width: 768px) and (max-width: 1920px) { @media screen and (min-width: 769px) {
.usecheck{ .usecheck{
display: flex; display: flex;
text-align: left; text-align: left;
@ -232,7 +231,6 @@ margin-top: 24px;
} }
.rc-button { .rc-button {
.rc-styled-link{ .rc-styled-link{
padding-bottom:3px;
border-bottom:1px solid #333; border-bottom:1px solid #333;
&:hover{ &:hover{
border-bottom:1px solid #e2001a; border-bottom:1px solid #e2001a;

View File

@ -42,7 +42,7 @@
</div> </div>
</a> </a>
<a class="rc-md-up rc-btn rc-btn--icon rc-icon ts-login--xs rc-iconography rc-interactive" aria-label="login" @click="turnlogin"> <a class="rc-xl-up rc-btn rc-btn--icon rc-icon ts-login--xs rc-iconography rc-interactive" aria-label="login" @click="turnlogin">
<span class="rc-screen-reader-text"> <span class="rc-screen-reader-text">
登录 登录
</span> </span>

View File

@ -6,7 +6,7 @@
<div class="ts-banner-swiper-container"> <div class="ts-banner-swiper-container">
<swiper :options="headerSwiperOption"> <swiper :options="headerSwiperOption">
<swiper-slide> <swiper-slide>
<a href="#" target="_blank"> <a href="/" target="_blank">
<picture> <picture>
<source media="(max-width: 768px)" srcset="/images/banner/one.jpg"> <source media="(max-width: 768px)" srcset="/images/banner/one.jpg">
<source media="(min-width: 769px)" srcset="/images/banner/pc-banner1.png"> <source media="(min-width: 769px)" srcset="/images/banner/pc-banner1.png">
@ -16,7 +16,7 @@
</swiper-slide> </swiper-slide>
<swiper-slide> <swiper-slide>
<a href="#" target="_blank"> <a href="/" target="_blank">
<picture> <picture>
<source media="(max-width: 768px)" srcset="/images/banner/two.jpg"> <source media="(max-width: 768px)" srcset="/images/banner/two.jpg">
<source media="(min-width: 769px)" srcset="/images/banner/pc-banner2.png"> <source media="(min-width: 769px)" srcset="/images/banner/pc-banner2.png">
@ -26,7 +26,7 @@
</swiper-slide> </swiper-slide>
<swiper-slide> <swiper-slide>
<a href="#" target="_blank"> <a href="/" target="_blank">
<picture> <picture>
<source media="(max-width: 768px)" srcset="/images/banner/three.jpg"> <source media="(max-width: 768px)" srcset="/images/banner/three.jpg">
<source media="(min-width: 769px)" srcset="/images/banner/pc-banner3.png"> <source media="(min-width: 769px)" srcset="/images/banner/pc-banner3.png">
@ -36,7 +36,7 @@
</swiper-slide> </swiper-slide>
<swiper-slide> <swiper-slide>
<a href="#" target="_blank"> <a href="/" target="_blank">
<picture> <picture>
<source media="(max-width: 768px)" srcset="/images/banner/four.jpg"> <source media="(max-width: 768px)" srcset="/images/banner/four.jpg">
<source media="(min-width: 769px)" srcset="/images/banner/pc-banner4.png"> <source media="(min-width: 769px)" srcset="/images/banner/pc-banner4.png">
@ -952,7 +952,12 @@
catimage: "/images/cat/one.jpg", catimage: "/images/cat/one.jpg",
productimage: "/images/cat/star-1.png", productimage: "/images/cat/star-1.png",
detail:'为10柔软细腻慕斯 适合离乳期幼猫舔食', detail:'为10柔软细腻慕斯 适合离乳期幼猫舔食',
price:'¥77', price:'¥372',
productList:[
{
productCode : "80240008F24"
}
]
}, },
{ {
title: "幼猫成长专属", title: "幼猫成长专属",
@ -960,7 +965,12 @@
catimage: "/images/cat/two.jpg", catimage: "/images/cat/two.jpg",
productimage: "/images/cat/star-2.png", productimage: "/images/cat/star-2.png",
detail:'支持幼猫自身保护力 为快速生长提供足够能量', detail:'支持幼猫自身保护力 为快速生长提供足够能量',
price:'¥147', price:'¥33',
productList:[
{
productCode : "20030040"
}
]
}, },
{ {
title: "室内成猫专属", title: "室内成猫专属",
@ -968,7 +978,12 @@
catimage: "/images/cat/three.jpg", catimage: "/images/cat/three.jpg",
productimage: "/images/cat/star-3.png", productimage: "/images/cat/star-3.png",
detail:'高易消化蛋白 减少粪便量和异味', detail:'高易消化蛋白 减少粪便量和异味',
price:'¥140', price:'¥157',
productList:[
{
productCode : "21100200"
}
]
}, },
{ {
title: "英短成猫专属", title: "英短成猫专属",
@ -976,7 +991,12 @@
catimage: "/images/cat/four.jpg", catimage: "/images/cat/four.jpg",
productimage: "/images/cat/star-4.png", productimage: "/images/cat/star-4.png",
detail:'增强肌肉质量 支持骨骼与关节健康', detail:'增强肌肉质量 支持骨骼与关节健康',
price:'¥183', price:'¥402',
productList:[
{
productCode : "23040450"
}
]
}, },
], ],
@ -988,84 +1008,61 @@
catimage: "/images/dog/one.jpg", catimage: "/images/dog/one.jpg",
productimage: "/images/dog/star-1.png", productimage: "/images/dog/star-1.png",
detail:'柔软细腻慕斯 适合离乳期幼犬舔食', detail:'柔软细腻慕斯 适合离乳期幼犬舔食',
price:'¥77', price:'¥359',
productList:[
{
productCode : "81220020F12"
}
]
}, },
{ {
title: "贵宾成犬专属", title: "贵宾成犬专属",
video:"/images/dog/two.mp4", video:"/images/dog/two.mp4",
catimage: "/images/dog/two.jpg", catimage: "/images/dog/two.jpg",
productimage: "/images/cat/star-2.png", productimage: "/images/dog/star-2.png",
detail:'护肤靓毛 理想体态', detail:'护肤靓毛 理想体态',
price:'¥241', price:'¥562',
productList:[
{
productCode : "14200300"
}
]
}, },
{ {
title: "小型犬成犬专属", title: "小型犬成犬专属",
video:"/images/dog/three.mp4", video:"/images/dog/three.mp4",
catimage: "/images/dog/three.jpg", catimage: "/images/dog/three.jpg",
productimage: "/images/cat/star-3.png", productimage: "/images/dog/star-3.png",
detail:'亮泽被毛 呵护牙齿', detail:'亮泽被毛 呵护牙齿',
price:'¥121', price:'¥57',
productList:[
{
productCode : "16020080"
}
]
}, },
{ {
title: "离乳期全价奶糕", title: "离乳期全价奶糕",
video:"/images/dog/four.mp4", video:"/images/dog/four.mp4",
catimage: "/images/dog/four.jpg", catimage: "/images/dog/four.jpg",
productimage: "/images/cat/star-4.png", productimage: "/images/dog/star-4.png",
detail:'高易再水合颗粒 帮助增强保护健康成长', detail:'高易再水合颗粒 帮助增强保护健康成长',
price:'¥88', price:'¥263',
productList:[
{
productCode : "17220400"
}
]
}, },
], ],
rccontair: [ rccontair: [
{ {
title: "皇家英国短毛猫全价湿粮", title: "",
price:'¥123.45', price:'',
ordernum: 1, ordernum: 1,
catimage: require("../assets/image/rc-cat.png"), catimage: "",
}, },
{
title: "皇家英国短毛猫全价湿粮",
price:'¥123.45',
ordernum: "2",
catimage: require("../assets/image/rc-cat.png"),
},
{
title: "皇家英国短毛猫全价湿粮",
price:'¥123.45',
ordernum: "2",
catimage: require("../assets/image/rc-cat.png"),
},
{
title: "皇家英国短毛猫全价湿粮",
price:'¥123.45',
ordernum: "2",
catimage: require("../assets/image/rc-cat.png"),
},
{
title: "皇家英国短毛猫全价湿粮",
price:'¥123.45',
ordernum: "2",
catimage: require("../assets/image/rc-dog.png"),
},
{
title: "皇家英国短毛猫全价湿粮",
price:'¥123.45',
ordernum: "2",
catimage: require("../assets/image/rc-dog.png"),
},
// {
// title: "湿",
// price:'123.45',
// ordernum: "2",
// catimage: require("../assets/image/rc-dog.png"),
// },
// {
// title: "湿",
// price:'123.45',
// ordernum: "2",
// catimage: require("../assets/image/rc-dog.png"),
// },
], ],
headerSwiperOption: { headerSwiperOption: {

View File

@ -99,6 +99,10 @@
</div> </div>
</div> </div>
<div class="online bold"></div> <div class="online bold"></div>
<div class="ts-btn" v-if="!islogin">
<div class="ts-standard-btn center" @click="logout">退出登录</div>
</div>
</div> </div>
</div> </div>
@ -141,6 +145,7 @@ 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 { mapMutations } from "vuex";
export default { export default {
middleware: 'metaTitle', middleware: 'metaTitle',
// middleware: 'metaTitle', // middleware: 'metaTitle',
@ -211,15 +216,21 @@ export default {
}, },
methods: { methods: {
...mapMutations(["logoutSystem","checkIsLogin"]),
logout() {
this.logoutSystem();
this.$router.push({
path: "/",
});
},
userinter(){ userinter(){
let user= localStorage.getItem("userInfo"); let user= this.checkIsLogin();
if(user==undefined||user==null||user==''){ if(!user){
this.$message({ this.$message({
type: 'warning', type: 'warning',
message: '您还未登录' message: '您还未登录'
}); });
return return
} else { } else {
this.$router.push({ this.$router.push({
path: "/personal/integral/", path: "/personal/integral/",
@ -323,17 +334,15 @@ obligation(item,index){
this.dialogInfo1=false; this.dialogInfo1=false;
this.usermessage='关注皇家爱宠荟,兑换更多福利'; this.usermessage='关注皇家爱宠荟,兑换更多福利';
} }
return false;
} else { } else {
this.dialogInfo1=false; this.dialogInfo1=false;
window.location.href="weixin://dl/business/?t=BE1OA2AngRs"; return true;
} }
}, },
openaddress(item,index){ openaddress(item,index){
console.log(item,index);
let user= localStorage.getItem("userInfo"); let user= localStorage.getItem("userInfo");
if(user==undefined||user==null||user==''){ if(user==undefined||user==null||user==''){
console.log('---=');
this.$message({ this.$message({
type: 'warning', type: 'warning',
message: '您还未登录' message: '您还未登录'
@ -342,25 +351,21 @@ obligation(item,index){
}else{ }else{
if(item.title=='收货地址'){ if(item.title=='收货地址'){
this.$router.push({ this.$router.push({
path: `/useraddress/openaddress/` path: `/useraddress/openaddress/`
}) })
console.log('这是地址的跳转');
} }
if(index==0){ if(index==0){
this.userlog=true this.userlog=true
this.ifadroind(); let isMobile = this.ifadroind();
if(isMobile)
window.location.href="weixin://dl/business/?t=BE1OA2AngRs";
} }
if(index==1){ if(index==1){
this.$router.push({ this.$router.push({
path: `/personal/discount/` path: `/personal/discount/`
}) })
console.log('这是地址的跳转');
} }
} }
@ -372,20 +377,14 @@ this.$router.push({
} }
}, },
mounted() { mounted() {
console.log(this.islogin)
console.log(this.userid);
let userwidth=0; let userwidth=0;
this.ifadroind(); this.ifadroind();
let user= JSON.parse(localStorage.getItem("userInfo")); let user= this.checkIsLogin();
console.log(user) if(user){
if(user!==null){
console.log('11')
this.userid=user.data; this.userid=user.data;
console.log(this.userid); this.islogin=false;
this.usertitle=this.userid.memberName; this.usertitle=this.userid.memberName;
this.rcrcord=this.userid.availiblePoint; this.rcrcord=this.userid.availiblePoint;
if(this.userid.memberLevel==1){ if(this.userid.memberLevel==1){
let userlength=this.userid.availiblePoint.toString().length; let userlength=this.userid.availiblePoint.toString().length;
this.userimage=require('../../assets/image/rc-new.png'); this.userimage=require('../../assets/image/rc-new.png');
@ -419,16 +418,12 @@ this.$router.push({
tagEle.style.left=tagEleLeft+"%"; tagEle.style.left=tagEleLeft+"%";
} }
} else { } else {
console.log('---'); this.userid='';
this.userid=[];
} }
if(this.userid==undefined ||this.userid==''||this.userid==null){ if(this.userid==undefined ||this.userid==''||this.userid==null){
console.log(this.userid)
this.islogin=true; this.islogin=true;
} }
}, },

View File

@ -732,11 +732,18 @@ export default {
openclose() { openclose() {
this.dialogInfo1 = false; this.dialogInfo1 = false;
}, },
selectproduce() { selectproduce(item,index){
if(item.productList[0]==undefined){
item.productlist[0].productCode=0;
}
if(item.productList[0]==undefined){
item.productlist[0]=[];
}
this.$router.push({ this.$router.push({
path: "/productdetails/producted", path: "/productdetails/producted",
query: { query: {
stype: 1, stype: 1,
productCode:item.productList[0].productCode
}, },
}); });
}, },

View File

@ -14,6 +14,7 @@
show-action show-action
placeholder="请输入搜索关键词" placeholder="请输入搜索关键词"
@search="onSearch" @search="onSearch"
@cancel="onCancel"
class="rc-keyword" class="rc-keyword"
> >
<template #action> <template #action>
@ -664,12 +665,18 @@ export default {
element.checked = false; element.checked = false;
}); });
}, },
selectproduce(item) { selectproduce(item,index){
if(item.productList[0]==undefined){
item.productlist[0].productCode=0;
}
if(item.productList[0]==undefined){
item.productlist[0]=[];
}
this.$router.push({ this.$router.push({
path: "/productdetails/producted", path: "/productdetails/producted",
query: { query: {
stype: 1, stype: 1,
productCode: item.productList[0].productCode, productCode:item.productList[0].productCode
}, },
}); });
}, },
@ -769,6 +776,10 @@ export default {
onSearch(e) { onSearch(e) {
this.usetmessage(this.activeIndex1, this.value); this.usetmessage(this.activeIndex1, this.value);
}, },
onCancel() {
debugger;
this.value='';
},
selectGoods(item, index, onlyRefreshCategory) { selectGoods(item, index, onlyRefreshCategory) {
this.activeIndex1 = index; this.activeIndex1 = index;
this.resetAllOptions(); this.resetAllOptions();

View File

@ -25,20 +25,23 @@ const mutations = {
// }, // },
changeClod(state, val) { changeClod(state, val) {
localStorage.setItem('userInfo', val.cloud); localStorage.setItem('userInfo', val.cloud);
console.log(state,val);
}, },
logoutSystem(state) {
localStorage.removeItem('userInfo')
},
checkIsLogin() {
let rawUserInfoStr = localStorage.getItem('userInfo');
let rawUserInfo = JSON.parse(rawUserInfoStr);
if(rawUserInfo && rawUserInfo.hasOwnProperty('xaccessToken') && rawUserInfo['xaccessToken'].length>36)
return rawUserInfo;
return false;
},
changemessage(state, val) { changemessage(state, val) {
localStorage.setItem('message', val.data); localStorage.setItem('message', val.data);
console.log(state,val);
}, },
selectMenu(state, val) { selectMenu(state, val) {
let result = state.tabsList.findIndex(item => item.name === val.data.name) let result = state.tabsList.findIndex(item => item.name === val.data.name)
result === -1 ? state.tabsList.push(val.data) : '' result === -1 ? state.tabsList.push(val.data) : ''
}, },
// changeMenu(state, user){ // changeMenu(state, user){