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;
}
}
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 {
background: url(../image/onloading.png) center center no-repeat;
width: 3.12rem;
@ -139,12 +169,13 @@ img, picture {
font-size: 1.125rem;
margin-top: .5rem;
display: block;
min-height:1.6rem;
}
}
}
img{
width:10rem;
height:10rem;
//min-height:19.875rem;
object-fit: contain;
display: flex;
margin: 0 auto;
@ -340,6 +371,14 @@ img, picture {
html {
//font-size:100px;
}
label {
input[type=checkbox] {
top:.25rem;
}
}
.rc-header__nav--primary{
overflow:hidden;
}
.ts-login--xs .rc-screen-reader{
left:7%;
top:22%;
@ -445,10 +484,6 @@ img, picture {
max-width:20rem;
min-width:18.75rem;
width:22.8vw;
//margin-right:.875rem;
margin-left:2vw;
padding-left:1px;
padding-right:1px;
box-sizing: border-box;
.rc-column{
span{
@ -625,14 +660,7 @@ img, picture {
}
@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 {
border-bottom: 3px solid #f6f6f6;

View File

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

View File

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

View File

@ -42,7 +42,7 @@
</div>
</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>

View File

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

View File

@ -99,6 +99,10 @@
</div>
</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>
@ -141,6 +145,7 @@ import Myheader from '~/components/header.vue'
import MyFooter from '~/components/rc-footer.vue'
import FixRight from "~/components/fixed-right.vue";
import tabs from "@/components/tabs.vue";
import { mapMutations } from "vuex";
export default {
middleware: 'metaTitle',
// middleware: 'metaTitle',
@ -150,7 +155,7 @@ export default {
userlog:false,
islogin:false,
dialogInfo1:false,
userid:null,
userid:null,
usertitle:'',
rcvalue:5000,
usermessage:'关注皇家爱宠荟,修改个人资料',
@ -211,24 +216,30 @@ export default {
},
methods: {
userinter(){
let user= localStorage.getItem("userInfo");
if(user==undefined||user==null||user==''){
this.$message({
type: 'warning',
message: '您还未登录'
});
return
}else{
this.$router.push({
path: "/personal/integral/",
query: {
stype: 1,
},
});
}
},
...mapMutations(["logoutSystem","checkIsLogin"]),
logout() {
this.logoutSystem();
this.$router.push({
path: "/",
});
},
userinter(){
let user= this.checkIsLogin();
if(!user){
this.$message({
type: 'warning',
message: '您还未登录'
});
return
} else {
this.$router.push({
path: "/personal/integral/",
query: {
stype: 1,
},
});
}
},
findall(){
console.log('PPP');
console.log(this.userid.length);
@ -304,64 +315,58 @@ obligation(item,index){
open(){
},
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";
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)) {
if(this.userlog==true){
this.usermessage='关注皇家爱宠荟,修改个人资料',
this.dialogInfo1=true;
}else{
this.dialogInfo1=false;
this.usermessage='关注皇家爱宠荟,兑换更多福利';
}
}else{
this.dialogInfo1=false;
window.location.href="weixin://dl/business/?t=BE1OA2AngRs";
}
},
if (!(bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM)) {
if(this.userlog==true){
this.usermessage='关注皇家爱宠荟,修改个人资料',
this.dialogInfo1=true;
}else{
this.dialogInfo1=false;
this.usermessage='关注皇家爱宠荟,兑换更多福利';
}
return false;
} else {
this.dialogInfo1=false;
return true;
}
},
openaddress(item,index){
console.log(item,index);
let user= localStorage.getItem("userInfo");
if(user==undefined||user==null||user==''){
console.log('---=');
this.$message({
type: 'warning',
message: '您还未登录'
});
return
let user= localStorage.getItem("userInfo");
if(user==undefined||user==null||user==''){
this.$message({
type: 'warning',
message: '您还未登录'
});
return
}else{
if(item.title=='收货地址'){
this.$router.push({
path: `/useraddress/openaddress/`
})
console.log('这是地址的跳转');
}
if(item.title=='收货地址'){
this.$router.push({
path: `/useraddress/openaddress/`
})
}
if(index==0){
this.userlog=true
this.ifadroind();
let isMobile = this.ifadroind();
if(isMobile)
window.location.href="weixin://dl/business/?t=BE1OA2AngRs";
}
if(index==1){
this.$router.push({
path: `/personal/discount/`
})
console.log('这是地址的跳转');
}
if(index==1){
this.$router.push({
path: `/personal/discount/`
})
}
}
},
@ -372,43 +377,37 @@ this.$router.push({
}
},
mounted() {
console.log(this.islogin)
console.log(this.userid);
let userwidth=0;
this.ifadroind();
let user= JSON.parse(localStorage.getItem("userInfo"));
console.log(user)
if(user!==null){
console.log('11')
this.userid=user.data;
console.log(this.userid);
this.usertitle=this.userid.memberName;
this.rcrcord=this.userid.availiblePoint;
if(this.userid.memberLevel==1){
let userlength=this.userid.availiblePoint.toString().length;
this.userimage=require('../../assets/image/rc-new.png');
this.userorder='新手铲屎官';
this.uservalue=5000; //
this.rcvalue=this.uservalue-this.userid.availiblePoint; //
if(userlength==1||userlength==2||userlength==3||userlength==4){
userwidth=this.userid.availiblePoint/100
console.log(userwidth);
}
}
else if(this.userid.memberLevel==2){
this.userimage=require('../../assets/image/rc-new2.png');
this.userorder='资深铲屎官';
this.uservalue=10000;
this.rcvalue=this.uservalue-this.userid.availiblePoint;
userwidth=this.userid.availiblePoint/100
}else if( this.userid.memberLevel==3){
this.userimage=require('../../assets/image/rc-new1.png');
this.userorder='金牌铲屎官';
this.usrnewlist=this.goldmedal;
userwidth=100
}
let user= this.checkIsLogin();
if(user){
this.userid=user.data;
this.islogin=false;
this.usertitle=this.userid.memberName;
this.rcrcord=this.userid.availiblePoint;
if(this.userid.memberLevel==1){
let userlength=this.userid.availiblePoint.toString().length;
this.userimage=require('../../assets/image/rc-new.png');
this.userorder='新手铲屎官';
this.uservalue=5000; //
this.rcvalue=this.uservalue-this.userid.availiblePoint; //
if(userlength==1||userlength==2||userlength==3||userlength==4){
userwidth=this.userid.availiblePoint/100
console.log(userwidth);
}
}
else if(this.userid.memberLevel==2){
this.userimage=require('../../assets/image/rc-new2.png');
this.userorder='资深铲屎官';
this.uservalue=10000;
this.rcvalue=this.uservalue-this.userid.availiblePoint;
userwidth=this.userid.availiblePoint/100
}else if( this.userid.memberLevel==3){
this.userimage=require('../../assets/image/rc-new1.png');
this.userorder='金牌铲屎官';
this.usrnewlist=this.goldmedal;
userwidth=100
}
this.$refs.userblock.style.width=userwidth+'%';
let tagEle=document.querySelector('.ts-point-tag');
if(tagEle){
@ -418,17 +417,13 @@ this.$router.push({
tagEleLeft=0;
tagEle.style.left=tagEleLeft+"%";
}
} else{
console.log('---');
this.userid=[];
} else {
this.userid='';
}
if(this.userid==undefined ||this.userid==''||this.userid==null){
console.log(this.userid)
this.islogin=true;
}
if(this.userid==undefined ||this.userid==''||this.userid==null){
this.islogin=true;
}
},

View File

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

View File

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

View File

@ -25,21 +25,24 @@ const mutations = {
// },
changeClod(state, val) {
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) {
localStorage.setItem('message', val.data);
console.log(state,val);
},
selectMenu(state, val) {
let result = state.tabsList.findIndex(item => item.name === val.data.name)
result === -1 ? state.tabsList.push(val.data) : ''
},
},
// changeMenu(state, user){
// // console.log("vuex存储的变化",JSON.parse(user))