Layout fixed

This commit is contained in:
Vion
2022-01-08 20:29:31 +08:00
parent 82e02dbc0b
commit 15c71d6348
24 changed files with 2653 additions and 4390 deletions

View File

@@ -1,522 +0,0 @@
<template>
<div>
<Myheader></Myheader>
<div class="rc-main">
<div class="rc-usermain">
<div class="rc-header">
<span
v-for="(item, index) in discountlist"
:key="index"
@click="selectGoods(item, index)"
:class="activeIndex == index ? 'active' : 'unactive'"
>
{{ item.title }}
</span>
<!-- <span @click="tanchu()">弹出</span> -->
</div>
<div class="rs-dis">
<div
class="rc-discount"
v-for="(item, index) in newlist"
:key="index"
>
<img :src="userimage" alt="" />
<div class="rc-contair">
<div class="rc-left" ref="userleft" id="userleft">
<div>
<i></i><span>{{ item.couponAmount }}</span>
</div>
<strong>{{ item.couponName }}</strong>
</div>
<div class="rc-right">
<i>
{{ item.couponDesc }}
</i>
<div class="rc-main" id="rc-main">
<span>有效期{{item.validFrom}}</span>
<em>{{ item.validTo }}</em>
</div>
<nuxt-link :to="`/`">
<div class="rc-footer" v-if="userload">
<span @click="usertiao()">立即使用</span>
</div>
</nuxt-link>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import {allConfig,getdraw} from "../../ajax/getData";
export default {
data() {
return {
userload: true,
pastdue: false,
unused: false,
usermessage:[],
userstates:0,
userimage: require("../../assets/image/unused.png"),
newlist: [
{
price: "30",
pricestype: "新客优惠券",
special: "全场每满299-30",
period: "有效期",
starttime: "2021.11.29-2022.01.28",
catimage: require("../../assets/image/unused.png"),
},
{
price: "30",
pricestype: "新客优惠券",
special: "全场每满299-30",
period: "有效期",
starttime: "2021.11.29-2022.01.28",
catimage: require("../../assets/image/unused.png"),
},
{
price: "30",
pricestype: "新客优惠券",
special: "全场每满299-30",
period: "有效期",
starttime: "2021.11.29-2022.01.28",
catimage: require("../../assets/image/unused.png"),
},
{
price: "30",
pricestype: "新客优惠券",
special: "全场每满299-30",
period: "有效期",
starttime: "2021.11.29-2022.01.28",
},
{
price: "30",
pricestype: "新客优惠券",
special: "全场每满299-30",
period: "有效期",
starttime: "2021.11.29-2022.01.28",
},
{
price: "30",
pricestype: "新客优惠券",
special: "全场每满299-30",
period: "有效期",
starttime: "2021.11.29-2022.01.28",
},
{
price: "30",
pricestype: "新客优惠券",
special: "全场每满299-30",
period: "有效期",
starttime: "2021.11.29-2022.01.28",
},
{
price: "30",
pricestype: "新客优惠券",
special: "全场每满299-30",
period: "有效期",
starttime: "2021.11.29-2022.01.28",
},
{
price: "30",
pricestype: "新客优惠券",
special: "全场每满299-30",
period: "有效期",
starttime: "2021.11.29-2022.01.28",
},
{
price: "30",
pricestype: "新客优惠券",
special: "全场每满299-30",
period: "有效期",
starttime: "2021.11.29-2022.01.28",
},
],
discountlist: [
{
title: "未使用",
},
{
title: "已使用",
},
{
title: "已过期",
},
],
preferential: [
{
price: "30",
pricestype: "新客优惠券",
special: "全场每满299-30",
period: "有效期",
starttime: "2021.11.29-2022.01.28",
},
{
price: "30",
pricestype: "新客优惠券",
special: "全场每满299-30",
period: "有效期",
starttime: "2021.11.29-2022.01.28",
},
{
price: "30",
pricestype: "新客优惠券",
special: "全场每满299-30",
period: "有效期",
starttime: "2021.11.29-2022.01.28",
},
],
userdiscount:[],
activeIndex: 0,
};
},
methods: {
//获取用户领取的优惠券
async userdraw(mobile,states) {
let data = await getdraw(mobile,states);
if(data){
console.log(data);
this.newlist=data.data;
console.log(this.newlist);
}
},
selectGoods(item, index) {
this.activeIndex = index;
if(this.usermessage!==null){
if (this.activeIndex == 1) {
this.userload = false;
this.pastdue = true;
this.userimage = require("../../assets/image/hasused.png");
this.userstates=1
this.userdraw(this.usermessage.data.mobile,1)
}
if (this.activeIndex == 0) {
this.userload = true;
this.pastdue = false;
this.userdraw(this.usermessage.data.mobile,0)
this.userstates=0
this.userimage = require("../../assets/image/unused.png");
}
if (this.activeIndex == 2) {
this.userload = false;
this.pastdue = true;
this.userdraw(this.usermessage.data.mobile,2)
this.userstates=2
this.userimage = require("../../assets/image/expired.png");
}
}else{
this.$message({
type: 'warning',
message: '请先去登录'
});
}
console.log(index);
},
usertiao(){
this.$router.push({
path: "/",
query: {
stype: 1,
},
});
},
// tanchu() {
// console.log('---')
// var option = {
// customer: {id: '', name: '', email: '', mobile: '', memberId: '999999'}
// }
// dis_livchat(option);
// }
},
mounted() {
this.usermessage= JSON.parse(localStorage.getItem("userInfo"));
if(this.usermessage!==null){
this.userdraw(this.usermessage.data.mobile,);
}
},
components: {
Myheader,
},
};
import Myheader from "~/components/header.vue";
</script>
<style lang="less" scoped>
// 手机端
@media screen and(min-width: 320px) and(max-width:768px) {
.active {
font-size: 14px;
color: #e2001a;
}
.unactive {
font-size: 14px;
color: #444444;
}
.rc-header {
height: 64px;
display: flex;
align-items: center;
margin-left: 23px;
span {
display: block;
margin-left: 32px;
}
span:first-child {
margin-left: 0;
}
}
.rc-discount {
margin-left: 23px;
display: flex;
margin-top: 16px;
width: 335px;
background: #ffffff;
position: relative;
height: 120px;
img {
display: block;
width: 100%;
height: 100%;
}
.rc-contair {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
}
.rc-left {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
color: #e1001a;
padding-right: 21px;
width: 30%;
float: left;
height: 100%;
i {
font-style: normal;
font-size: 12px;
}
span {
font-size: 26px;
}
strong {
font-style: normal;
font-size: 12px;
display: block;
margin-top: 8px;
}
}
.rc-right {
display: flex;
flex-direction: column;
margin-left: 36px;
justify-content: center;
height: 100%;
i {
font-style: normal;
font-size: 14px;
color: #e1001a;
}
.rc-main {
color: #999999;
font-size: 12px;
}
span {
display: block;
margin-top: 8px;
}
em {
font-style: normal;
}
}
.rc-footer {
display: flex;
justify-content: flex-end;
span {
width: 72px;
height: 25px;
background: #e2001a;
text-align: center;
line-height: 25px;
font-size: 12px;
color: #ffffff;
margin-bottom: 8px;
border-radius: 100px;
margin-right: 30px;
}
}
}
}
// // /* 最小768px最大1920 *pc端/
@media screen and (min-width: 768px) and (max-width: 1920px) {
.rc-main {
width: 100%;
.rc-usermain {
width: 92%;
margin: 0 auto;
}
}
.active {
font-size: 16px;
color: #e2001a;
cursor: pointer;
}
.unactive {
font-size: 16px;
color: #444444;
cursor: pointer;
}
.rc-header {
height: 64px;
display: flex;
align-items: center;
margin-left: 23px;
justify-content: center;
span {
display: block;
margin-left: 32px;
}
span:first-child {
margin-left: 0;
}
}
.rs-dis {
margin-top: 70px;
}
.rc-discount {
margin-left: 50px;
display: flex;
margin-top: 40px;
width: 335px;
background: #ffffff;
position: relative;
height: 120px;
float: left;
img {
display: block;
width: 100%;
height: 100%;
}
.rc-contair {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
}
.rc-left {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
color: #e1001a;
padding-right: 21px;
width: 30%;
float: left;
height: 100%;
i {
font-style: normal;
font-size: 12px;
}
span {
font-size: 26px;
}
strong {
font-style: normal;
font-size: 12px;
display: block;
margin-top: 8px;
}
}
.rc-right {
display: flex;
flex-direction: column;
margin-left: 36px;
justify-content: center;
height: 100%;
i {
font-style: normal;
font-size: 16px;
color: #e1001a;
}
.rc-main {
color: #999999;
font-size: 12px;
}
span {
display: block;
margin-top: 8px;
}
em {
font-style: normal;
}
}
.rc-footer {
display: flex;
justify-content: flex-end;
margin-right: 10px;
span {
width: 72px;
height: 25px;
background: #e2001a;
text-align: center;
line-height: 25px;
font-size: 12px;
color: #ffffff;
margin-bottom: 8px;
border-radius: 100px;
margin-right: 30px;
}
}
.rc-userright {
display: flex;
align-items: center;
width: 78px;
justify-content: center;
height: 78px;
border: 2px solid #999999;
border-radius: 50%;
span {
width: 60px;
height: 60px;
border: 1px solid #999999;
border-radius: 50%;
display: flex;
align-items: center;
text-align: center;
justify-content: center;
}
}
}
}
</style>

View File

@@ -1,321 +0,0 @@
<template>
<div>
<Myheader></Myheader>
<div class="rc-header">
<div class="rc-main">
<ul>
<li v-for="(item,index) in userrecord" :key="index">
{{item.title}}
</li>
</ul>
<ol>
<li v-for="(item,index) in usermessage" :key="index">
<span>{{item.startDate}}</span>
<em>{{item.changeValue}}</em>
<i>{{item.remark}}</i>
</li>
</ol>
</div>
</div>
<div class="rc-button">
<div class="rc-order">
<span>积分兑换</span>
</div>
</div>
</div>
</template>
<script>
import Myheader from '~/components/header.vue'
import { memberAccount } from "../../ajax/getData";
export default {
data(){
return{
userrecord:[
{
title:'日期',
},
{
title:'积分',
},
{
title:'类型',
},
],
usermessage:[
{
title:'2021-09-11',
rccord:'+100',
buycord:'购物积分'
},
{
title:'2021-09-11',
rccord:'+100',
buycord:'购物积分'
},
{
title:'2021-09-11',
rccord:'+100',
buycord:'购物积分'
},
{
title:'2021-09-11',
rccord:'+100',
buycord:'购物积分'
},
{
title:'2021-09-11',
rccord:'+100',
buycord:'购物积分'
},
]
}
},
methods:{
//请求猫
async catmessage() {
let user= JSON.parse(localStorage.getItem("userInfo"));
let data = await memberAccount(user.data.id);
if(data){
this.usermessage=data.data;
console.log(this.usermessage.data);
}
},
},
mounted(){
this.catmessage();
},
components:{
Myheader,
},
}
</script>
<style lang="less" scoped>
ul li ol li em strong i {
list-style: none;
font-style: normal;
}
.rc-header {
width: 100%;
}
//手机端
@media screen and (max-width: 768px) {
.rc-button{
width: 100%;
height: 80px;
background: #FFFFFF;
box-shadow: 0px -3px 6px rgba(0, 0, 0, 0.1);
display: flex;
align-items: center;
justify-content: center;
margin-top: 12px;
.rc-order{
width: 164px;
height: 48px;
border: 2px solid #E2001A;
border-radius: 30px;
background: #E2001A;
text-align: center;
align-items: center;
line-height: 48px;
span{
font-size: 16px;
display: block;
color: #FFFFFF;
}
}
}
.rc-main{
width: 92%;
margin: 0 auto;
ul{
height: 70px;
display: block;
border-bottom: 1px solid #D8D8D8;
display: flex;
align-items: center;
justify-content: center;
text-align: center;
font-size: 16px;
color: #444444;
li{
float: left;
width: 30%;
}
li:after{
// height: 2px;
// border: 1px solid red;
// display: block;
content:"|";
color: #707070;
margin-left: 5px;
}
li:last-child:after{
content:"";
}
}
ol{
li{
font-style: normal;
display: block;
height: 32px;
margin-top: 16px;
display: flex;
// justify-content: space-between;
align-items: center;
color: #666666;
font-size: 14px;
text-align: center;
i{
font-style: normal;
display: block;
width: 40%;
}
span{
font-style: normal;
display: block;
width: 36%;
}
em{
font-style: normal;
display: block;
width: 23%;
}
}
}
}
}
//pc端
@media screen and (min-width: 768px) and (max-width: 1920px) {
.rc-button{
width: 100%;
height: 80px;
background: #FFFFFF;
box-shadow: 0px -3px 6px rgba(0, 0, 0, 0.1);
display: flex;
align-items: center;
justify-content: center;
margin-top: 12px;
display: none;
.rc-order{
width: 164px;
height: 48px;
border: 2px solid #E2001A;
border-radius: 30px;
background: #E2001A;
text-align: center;
align-items: center;
line-height: 48px;
span{
font-size: 16px;
display: block;
color: #FFFFFF;
}
}
}
.rc-main{
width: 92%;
margin: 0 auto;
margin-top: 60px;
ul{
height: 64px;
background: #F6F6F6;
border: 1px solid #D7D7D7;
opacity: 1;
border-radius: 3px 3px 0px 0px;
display: block;
display: flex;
align-items: center;
justify-content: center;
text-align: center;
font-size: 16px;
color: #444444;
li{
float: left;
width: 42%;
}
}
ol{
li{
font-style: normal;
display: block;
height: 48px;
margin-top: 16px;
display: flex;
border: 1px solid #D7D7D7;
// justify-content: space-between;
align-items: center;
color: #666666;
font-size: 14px;
text-align: center;
i{
font-style: normal;
display: block;
width: 34%;
}
span{
font-style: normal;
display: block;
width: 34%;
}
em{
font-style: normal;
display: block;
width: 34%;
}
}
}
}
}
</style>