Commit 62a31627 authored by liwei's avatar liwei

liwei

parent c8c8d69a
......@@ -6,11 +6,11 @@
<div class="invite-friends cell">
<img src="../../assets/inviteFriends/img_title1.png" alt />
<p class="cell-content money">
<span>100</span>
<span>{{earnings}}</span>
<span></span>
</p>
<p class="cell-content people">
<span>10</span>
<span>{{userNum}}</span>
<span></span>
</p>
<div class="invite-record-btn" @click="lookMyInviteRecords">
......@@ -57,14 +57,15 @@
</div>
</template>
<script>
// import Vue from "vue";
// import { Image } from "vant";
// Vue.use(Image);
import { getInviteResultApi, getInviteListApi } from "../../service/api";
export default {
name: "inviteFriends",
components: {},
data() {
return {
earnings: 0,
userNum: 0,
records: [
{
name: "test",
......@@ -93,11 +94,38 @@ export default {
]
};
},
mounted() {
this.getInviteResult();
this.getInviteList();
},
methods: {
lookMyInviteRecords() {
this.$refs.inviteRecord.scrollIntoView();
},
lookMoreRecord() {}
lookMoreRecord() {},
getInviteResult() {
let id = this.$route.query.shopId;
id = 46;
getInviteResultApi({}, id).then(res => {
this.earnings = res.earnings;
this.userNum = res.user_num;
});
},
getInviteList() {
let json = {
page: 1,
limit: 6
};
let id = this.$route.query.shopId;
id = 46;
getInviteListApi(json, id).then(res => {
if (res) {
if (res.list && res.list.length > 0) {
this.records = res.list;
}
}
});
}
}
};
</script>
......
<template>
<div class="invite-record-list">
<div class="title" ref="title">
<span>邀请记录</span>
<span>购买时间</span>
</div>
<div class="container" :style="{height: height+'px'}">
<ul>
<li v-for="(item,index) in list" :key="index">
<p>{{item.name}}</p>
<p>{{item.buy_date}}</p>
</li>
</ul>
</div>
</div>
</template>
<script>
export default {
name: "inviteRecordList",
data() {
return {
height: 0,
pullup: true,
list: [
{
name: "test111",
buy_date: "2019.7.5"
},
{
name: "test",
buy_date: "2019.7.5"
},
{
name: "test11111111111111111111111",
buy_date: "2019.7.5"
},
{
name: "test",
buy_date: "2019.7.5"
},
{
name: "test",
buy_date: "2019.7.5"
},
{
name: "test",
buy_date: "2019.7.5"
},
{
name: "test11111111111111111111111",
buy_date: "2019.7.5"
},
{
name: "test",
buy_date: "2019.7.5"
},
{
name: "test",
buy_date: "2019.7.5"
},
{
name: "test",
buy_date: "2019.7.5"
},
{
name: "test11111111111111111111111",
buy_date: "2019.7.5"
},
{
name: "test",
buy_date: "2019.7.5"
},
{
name: "test",
buy_date: "2019.7.5"
},
{
name: "test",
buy_date: "2019.7.5"
},
{
name: "test11111111111111111111111",
buy_date: "2019.7.5"
},
{
name: "test",
buy_date: "2019.7.5"
},
{
name: "test",
buy_date: "2019.7.5"
},
{
name: "test",
buy_date: "2019.7.5"
},
{
name: "test11111111111111111111111",
buy_date: "2019.7.5"
},
{
name: "test",
buy_date: "2019.7.5"
},
{
name: "test",
buy_date: "2019.7.5"
},
{
name: "test11111111111111111111111",
buy_date: "2019.7.5"
},
{
name: "test",
buy_date: "2019.7.5"
},
{
name: "test",
buy_date: "2019.7.5"
},
{
name: "test11111111111111111111111",
buy_date: "2019.7.5"
},
{
name: "test",
buy_date: "2019.7.5"
}
]
};
},
mounted() {
let self = this;
this.height =
window.innerHeight -
this.$refs.title.getBoundingClientRect().bottom -
this.$refs.title.getBoundingClientRect().height;
},
methods: {
onReachBottom() {
console.log("onReachBottom");
}
}
};
</script>
<style lang="less" scoped>
@import "../../util/public";
@tocurrentvw : 1/2 * @toVw;
@tocurrentvh : 1/2 * @toVh;
.invite-record-list {
display: flex;
flex-direction: column;
margin: 64 * @tocurrentvh auto;
width: 688 * @tocurrentvw;
.title {
margin: 0;
height: 76 * @tocurrentvh;
display: flex;
align-items: center;
background-color: #fbebe3;
border-radius: 5 * @tocurrentvw;
font-size: 28 * @tocurrentvw;
font-weight: 400;
color: #eb7162;
}
.container {
margin: 0;
width: 100%;
overflow: hidden;
ul {
li {
height: 65 * @tocurrentvh;
width: 100%;
display: flex;
align-items: center;
border-radius: 5 * @tocurrentvw;
font-size: 28 * @tocurrentvw;
font-weight: 400;
color: #696765;
&:nth-child(odd) {
background-color: #fff;
}
&:nth-child(even) {
background-color: #fffaf8;
}
p {
text-align: center;
width: 40%;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
}
}
}
}
</style>
......@@ -40,9 +40,9 @@ Vue.component('scroll', scroll);
// Vue.prototype.$throw = (error)=> errorHandler(error,this);
/* eslint-disable no-new */
// if (process.env.NODE_ENV != 'production') {
// new VConsole();
// }
if (process.env.NODE_ENV != 'production') {
new VConsole();
}
router.beforeEach((to, from, next) => {
next()
......
......@@ -317,6 +317,15 @@ const router = new Router({
noNew: true,
}
},
{
path: '/inviteRecordList',
name: 'inviteRecordList',
component: e => require(['@/components/buy/inviteRecordList'], e),//
meta: {
deep: 0,
noNew: true,
}
},
{
path: '/activityInvite',
name: 'activityInvite',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment