剩余其他页面

This commit is contained in:
952108534@qq.com 2022-01-13 14:32:47 +08:00
parent 5e49a44f2b
commit 25a06260a7
6 changed files with 1302 additions and 2 deletions

View File

@ -0,0 +1,512 @@
<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.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");
}
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() {
if(this.usermessage!=='' ||this.usermessage.data!==undefined){
this.usermessage= JSON.parse(localStorage.getItem("userInfo"));
}
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;
}
}
}
}
// // /* 768px1920 *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

@ -0,0 +1,321 @@
<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>

View File

@ -332,9 +332,9 @@ obligation(item,index){
return
}else{
if(index==2){
if(item.title=='收货地址'){
this.$router.push({
path: `/personal/useraddress/`
path: `/useraddress/openaddress/`
})
console.log('这是地址的跳转');

View File

@ -0,0 +1,73 @@
<template>
<van-address-edit
:area-list="areaList"
show-postal
show-delete
show-set-default
show-search-result
:search-result="searchResult"
:area-columns-placeholder="['请选择', '请选择', '请选择']"
@save="onSave"
@delete="onDelete"
@change-detail="onChangeDetail"
/>
</template>
<script>
import { editaddress } from "../../ajax/getData";
import { Toast } from 'vant';
import { areaList } from '@vant/area-data';
export default {
data(){
return{
areaList,
searchResult: [],
userid:null,
addressdetail:'',
}
},
methods:{
async onSave(content) {
// Toast('save');
console.log(content);
let recipient=content.name;
let tel=content.tel;
let provinceId=Number(content.areaCode.substring(0,2)+'0000')//id
let cityId=Number(content.areaCode.substring(0,4)+'00') //id
let districtId=Number(content.areaCode);//
console.log(provinceId,cityId,districtId);
console.log(content.areaCode.substring(0,2)+'0000');//
console.log(content.areaCode.substring(0,4)+'00'); //id
console.log(content.areaCode) //
//id / id/id/
let data = await editaddress(this.userid,this.addressdetail,recipient,tel,provinceId,cityId,districtId);
console.log(data);
},
onDelete() {
Toast('delete');
},
onChangeDetail(val){
this.addressdetail=val;
}
},
mounted(){
let user= JSON.parse(localStorage.getItem("userInfo"));
// this.userid=user.data.id;
this.userid=3242
},
components:{
},
}
</script>
<style>
</style>

View File

@ -0,0 +1,99 @@
<template>
<van-address-edit
:area-list="areaList"
show-postal
show-set-default
show-search-result
:search-result="searchResult"
:address-info="AddressInfo"
:area-columns-placeholder="['请选择', '请选择', '请选择']"
@save="onSave"
@change-detail="onChangeDetail"
>
<!-- <div class="main">
<span>我的</span>
</div> -->
</van-address-edit>
</template>
<script>
import { Toast } from 'vant';
import { areaList } from '@vant/area-data';
import { editupdate } from "../../ajax/getData";
export default {
data(){
return{
areaList,
searchResult: [],
AddressInfo:{//
name:'',//
tel:'',//
province:'',//
city:'',//
country:'',//
address:'',
areaCode:'',//codeID
addressDetail:'',//
isDefault:false,//
},
}
},
methods:{
valf(){
setTimeout(()=>{
let s=this.$route.query.id;
console.log(s);
this.AddressInfo.name= s.recipient,
this.AddressInfo.tel=s.recipientPhone,
this.AddressInfo.province=s.name
this.AddressInfo.city=s.name
this.AddressInfo.addressDetail=s.detailAddress
this.AddressInfo.isDefault=s.isDefault,
this.AddressInfo.country='江西省'
this.AddressInfo.address='江西省'
},100)
},
async onSave(content) {
let data = await editupdate(this.tel);
console.log(data);
console.log(content);
// Toast('save');
console.log(content.areaCode.substring(0,2)+'0000');//
console.log(content.areaCode.substring(0,4)+'00'); //id
console.log(content.areaCode) //
},
onDelete() {
Toast('delete');
},
onChangeDetail(val){
console.log(this.searchResult);
console.log(val);
}
},
mounted(){
this.valf();
this.searchResult = [
{
name: '黄龙万科中心',
address: '杭州市西湖区',
},
];
},
components:{
},
}
</script>
<style>
</style>

View File

@ -0,0 +1,295 @@
<template>
<div>
<Myheader></Myheader>
<div class="usermain">
<div class="rc-main" v-for="(item, index) in list" :key="index">
<div class="rc-center">
<div class="rc-header">
<em>
{{ item.recipient }}
</em>
<span>
{{ item.recipientPhone }}
</span>
</div>
<div class="rc-address">
<span>
{{ item.detailAddress }}
</span>
</div>
<div class="rc-footer">
<div class="rc-foot">
<span>设置为默认收货地址</span>
<!-- <van-switch v-model="checked" /> -->
</div>
<div class="rc-right">
<span @click="onEdit(item, index)">编辑</span>
<span @click="userdelete(item, index)">删除</span>
</div>
</div>
</div>
</div>
</div>
<div class="rc-button">
<div class="rc-footbutton" @click="onAdd()">
<span>新增收货地址</span>
</div>
</div>
</div>
</template>
<script>
import { areaList } from "@vant/area-data";
import { selectaddress } from "../../ajax/getData";
import { editdelete } from "../../ajax/getData";
import Myheader from "~/components/header.vue";
import { Toast } from "vant";
export default {
data() {
return {
chosenAddressId: "1",
checked: true,
userid: null,
usermessage:null,
list: [
{
id: 1,
name: "张三",
tel: "13000000000",
address: "浙江省杭州市西湖区文三路 138 号",
isDefault: true,
},
{
id: 2,
name: "李四",
tel: "1310000000",
address: "浙江省杭州市拱墅区莫干山路 50 号",
},
{
id: 3,
name: "李四",
tel: "1310000000",
address: "浙江省杭州市拱墅区莫干山路 50 号",
},
],
areaList,
};
},
methods: {
onAdd() {
Toast("新增地址");
this.$router.push({ path: "/useraddress/addaddress" });
},
onEdit(item, index) {
let userid = item.id;
console.log(item);
this.$router.push({
path: "/useraddress/editaddress",
query: {
id: item,
},
});
},
//
async userdelete(item) {
console.log(item.memberId);
let data = await editdelete(this.userid, item.id);
this.editaddress(this.usermessage);
console.log(data);
},
//
async editaddress(user) {
user.data.id=3242
let data = await selectaddress(user.data.id);
this.list=data.data;
console.log(this.list);
console.log(data);
},
},
components: {
Myheader,
},
mounted() {
//
this.usermessage = JSON.parse(localStorage.getItem("userInfo"));
this.editaddress(this.usermessage);
this.userid = this.usermessage.data.id;
},
};
</script>
<style lang="less" scoped >
.rc-main {
width: 93%;
margin: 0 auto;
margin-top: 8px;
}
//
@media screen and(min-width: 320px) and(max-width:768px) {
.rc-button {
height: 80px;
background: #ffffff;
box-shadow: 0px -3px 6px rgba(0, 0, 0, 0.1);
opacity: 1;
display: flex;
align-items: center;
justify-content: center;
.rc-footbutton {
width: 164px;
height: 48px;
border: 2px solid #e2001a;
opacity: 1;
border-radius: 30px;
display: flex;
align-items: center;
background: #e2001a;
span {
display: block;
text-align: center;
color: white;
font-size: 16px;
width: 100%;
}
}
}
.rc-header {
display: flex;
align-items: center;
color: #333333;
em {
font-style: normal;
font-size: 14px;
}
span {
display: block;
margin-left: 8px;
}
}
.rc-address {
margin-top: 8px;
text-overflow: -o-ellipsis-lastline;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
line-clamp: 2;
-webkit-box-orient: vertical;
font-size: 14px;
color: #333333;
}
.rc-footer {
display: flex;
justify-content: space-between;
align-items: center;
padding-bottom: 20px;
margin-top: 8px;
.rc-right {
span {
border-bottom: 1px solid #666666;
}
span:first-child {
margin-right: 16px;
}
}
}
}
//pc
@media screen and (min-width: 768px) and (max-width: 1920px) {
.usermain{
width: 90%;
margin: 0 auto;
}
.rc-main{
width: 45%;
height: 164px;
margin-top: 60px;
background: #FFFFFF;
border: 1px solid #D7D7D7;
opacity: 1;
border-radius: 3px;
margin-left: 40px;
float: left;
.rc-center{
margin-top: 24px;
margin-left: 24px;
}
}
.rc-button {
height: 80px;
background: #ffffff;
box-shadow: 0px -3px 6px rgba(0, 0, 0, 0.1);
opacity: 1;
display: flex;
align-items: center;
justify-content: center;
display: none;
.rc-footbutton {
width: 164px;
height: 48px;
border: 2px solid #e2001a;
opacity: 1;
border-radius: 30px;
display: flex;
align-items: center;
background: #e2001a;
span {
display: block;
text-align: center;
color: white;
font-size: 16px;
width: 100%;
}
}
}
.rc-header {
display: flex;
align-items: center;
color: #333333;
em {
font-style: normal;
font-size: 14px;
}
span {
display: block;
margin-left: 8px;
}
}
.rc-address {
margin-top: 8px;
text-overflow: -o-ellipsis-lastline;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
line-clamp: 2;
-webkit-box-orient: vertical;
font-size: 14px;
color: #333333;
}
.rc-footer {
display: flex;
justify-content: space-between;
align-items: center;
padding-bottom: 20px;
margin-top: 8px;
.rc-right {
span {
border-bottom: 1px solid #666666;
}
span:first-child {
margin-right: 16px;
}
}
}
}
</style>