Commit 78186beea97af6a333cc9d3ce31e423dd49d449e

Authored by zhiyangdu
1 parent b91fc160

新增兑换记录页面

src/pages/pointsExchangeRecords/pointsExchangeRecords.less
1 -.ExchangeRecords_box{  
2 - width: 100%;  
3 - min-height: 100vh;  
4 - background: rgb(241,46,50,1) url("../../../static/img/pointsMall/ExchangeRecords.jpg") no-repeat  
5 - center bottom;  
6 - background-size: 100%;  
7 - padding: 1px 0 0 0;  
8 - .top_back{  
9 - height: 60px; 1 +.records_back{
  2 + background: #F6F6F6;
  3 + .com_box{
  4 + margin: 30px 30px 0 30px;
  5 + background: #FFFFFF;
  6 + border-radius: 24px;
  7 + .item_box{
  8 + padding: 30px;
  9 + border-bottom: solid 2px #EAEAEA;
  10 + display: flex;
  11 + padding-bottom: 28px;
  12 + img{
10 display: flex; 13 display: flex;
11 - justify-content: flex-start;  
12 - padding: 0 0 40px 40px;  
13 - img{  
14 - width: 60px;  
15 - height: 60px; 14 + width: 190px;
  15 + height: 190px;
  16 + }
  17 + .right{
  18 + margin-left: 32px;
  19 + .name{
  20 + height: 80px;
  21 + font-size: 28px;
  22 + font-weight: 400;
  23 + color: #333333;
  24 + line-height: 40px;
  25 + display: -webkit-box;
  26 + -webkit-line-clamp: 2;
  27 + /*! autoprefixer: off */
  28 + -webkit-box-orient: vertical;
  29 + /*! autoprefixer: on */
  30 + text-overflow: ellipsis;
  31 + overflow: hidden;
16 } 32 }
17 - }  
18 - .drawRecord_title{  
19 - width: 588px;  
20 - height: 390px;  
21 - //background: url("../../../static/img/pointsMall/title.png") no-repeat center top;  
22 - background-size: 100%;  
23 - margin: 2px 81px 64px 81px;  
24 - }  
25 - .title_t{  
26 - height:53px;  
27 - font-size:34px;  
28 - font-weight:400;  
29 - color:rgba(249,249,249,1);  
30 - line-height:53px;  
31 - text-align: center;  
32 - margin: 49px 0;  
33 - }  
34 - .content_box{  
35 - width:670px;  
36 - height:669px;  
37 - background:rgba(241,46,50,1);  
38 - border-radius:16px;  
39 - margin: auto;  
40 - padding-top: 1px;  
41 - .tip{  
42 - text-align: center; 33 + .address_name{
  34 + margin-top: 10px;
  35 + height: 33px;
  36 + font-size: 24px;
  37 + font-weight: 400;
  38 + color: #9B9B9B;
  39 + line-height: 33px;
43 } 40 }
44 - ul{  
45 - height: 540px;  
46 - overflow-y: auto;  
47 - }  
48 - div{  
49 - //display: flex;  
50 - //justify-content: space-between;  
51 - color: #fff;  
52 - }  
53 - .content_top{  
54 - width:580px;  
55 - height:60px;  
56 - line-height: 60px;  
57 - background:rgba(232,28,32,1);  
58 - border-radius:12px;  
59 - margin: 20px auto;  
60 - font-size: 30px;  
61 - font-weight: 600;  
62 - padding: 0 27px;  
63 - display: flex;  
64 - justify-content: space-between;  
65 - div{  
66 - color:rgba(255,202,40,1);  
67 - }  
68 - }  
69 - .item{  
70 - padding: 20px 34px 20px 20px;  
71 - font-size:28px;  
72 - font-weight:400;  
73 - color:rgba(255,255,255,1);  
74 - line-height:40px;  
75 - position: relative;  
76 - display: flex;  
77 - align-items: center;  
78 - .adderss{  
79 - position: absolute;  
80 - right:72px;  
81 - top:48px;  
82 - width:100px;  
83 - height:34px;  
84 - line-height: 34px;  
85 - border-radius:18px;  
86 - border:1px solid rgba(244,195,47,1);  
87 - color: #F4C32F;  
88 - font-size: 22px;  
89 - display: flex;  
90 - justify-content: center !important;  
91 - }  
92 - div:nth-child(1){  
93 - float: left;  
94 - display: flex;  
95 - justify-content: flex-start;  
96 - flex: 1;  
97 - text-overflow: ellipsis;  
98 - overflow: hidden;  
99 - display: -webkit-box;  
100 - -webkit-box-orient:vertical;  
101 - -webkit-line-clamp:2;  
102 - -ms-word-wrap:break-word;  
103 - word-wrap:break-word;  
104 - }  
105 - div:nth-child(2){  
106 - float: left;  
107 - width: 280px;  
108 - display: flex;  
109 - justify-content: flex-start;  
110 - }  
111 - div:nth-child(3){  
112 - width: 80px;  
113 - text-align: center;  
114 - } 41 + .exchange_time{
  42 + margin-top: 34px;
  43 + height: 33px;
  44 + font-size: 24px;
  45 + font-weight: 400;
  46 + color: #9B9B9B;
  47 + line-height: 33px;
115 } 48 }
  49 + }
116 } 50 }
117 - .btn{  
118 - width:520px;  
119 - height:88px;  
120 - background:linear-gradient(180deg,rgba(241,205,59,1) 0%,rgba(254,155,2,1) 100%);  
121 - border-radius:44px;  
122 - border:1px solid rgba(151,151,151,1);  
123 - margin: 64px auto; 51 + }
  52 + .is_more{
  53 + text-align: center;
  54 + padding-bottom: 20px;
  55 + color: #6D7278;
  56 + font-size: 32px;
  57 + font-weight: 500;
  58 + height: 100px;
  59 + line-height: 100px;
  60 + }
  61 + // 返回按钮
  62 + .title_box{
  63 + width: 100%;
  64 + position: fixed;
  65 + left: 0;
  66 + font-size: 36px;
  67 + font-weight: 400;
  68 + color: #000000;
  69 + height: 93px;
  70 + line-height: 93px;
  71 + top: 0;
  72 + text-align: center;
  73 + background-color: #fff;
  74 + .title{
  75 + display: flex;
  76 + position: relative;
  77 + .goback{
  78 + display: block;
  79 + width: 38px;
  80 + height: 38px;
  81 + position: absolute;
  82 + left: 20px;
  83 + top: 27px;
  84 + }
  85 + .text{
  86 + flex: 1;
124 text-align: center; 87 text-align: center;
125 - line-height: 88px;  
126 - font-size: 34px;  
127 - color: #0A0741; 88 + }
128 } 89 }
129 -} 90 + }
  91 + // 占位
  92 + .title_box_lh{
  93 + height: 93px;
  94 + }
  95 +}
130 \ No newline at end of file 96 \ No newline at end of file
src/pages/pointsExchangeRecords/pointsExchangeRecords.vue
1 <template> 1 <template>
2 - <div>  
3 - <div class="ExchangeRecords_box">  
4 - <!--<div v-if="this.isCNLive.value&&this.$parent.isBackIcon" class="top_back" :style="'padding-top: ' + (($parent.top.value)+8) + 'px'">-->  
5 - <!--<img v-if="this.isAndroid.value" @click="$parent.back()" src="static/img/go_back.png" alt="">-->  
6 - <!--<img v-else="this.isiPhone.value" @click="goLucky()" src="static/img/go_back.png" alt="">-->  
7 - <!--</div>-->  
8 - <div class="top_back" :style="'margin-top: ' + (($parent.top.value)+8) + 'px'">  
9 - <img @click="goointsMall()" src="static/img/pointsMall/go_back.png" alt="">  
10 - </div>  
11 - <div class="drawRecord_title" :style="{backgroundImage: 'url('+ titleImg +')',marginTop:+($parent.top.value)+'px'}"></div>  
12 - <div class="title_t">兑换记录</div>  
13 - <div class="content_box">  
14 - <div class="content_top">  
15 - <div>兑换名称</div>  
16 - <div>兑换时间</div>  
17 - <div>数量</div>  
18 - </div>  
19 - <div class="tip" v-if="list&&list.length==0">  
20 - 暂无兑换记录  
21 - </div>  
22 - <ul  
23 - v-if="list"  
24 - v-infinite-scroll="loadMore"  
25 - infinite-scroll-disabled="loading"  
26 - :infinite-scroll-distance="list.length">  
27 - <li v-for="(item,index) in list" :key="index">  
28 - <div class="item">  
29 - <div v-if="item&&item.title" class="item.title">  
30 - {{item.title}}  
31 - </div>  
32 - <div v-if="item&&item.create_time">{{item.create_time*1000 | datetime('yyyy-MM-dd hh:mm:ss')}}</div>  
33 - <div>{{item.num}}个</div>  
34 - </div>  
35 - </li>  
36 - </ul>  
37 - </div>  
38 - </div> 2 +<div class="records_back">
  3 + <!-- 占位 -->
  4 + <div v-show="this.isCNLive.value" class="title_box_lh" :style="'padding-top: ' + (($parent.top.value)+8) + 'px'">
39 5
40 </div> 6 </div>
  7 + <!--返回按钮-->
  8 + <div class="title_box" :style="'padding-top: ' + (($parent.top.value)+8) + 'px'" >
  9 + <div class="title"> <!--返回按钮-->
  10 + <img v-if="this.isCNLive.value" @click="goback"
  11 + class="goback" src="static/img/icon_back.png" />
  12 + <div class="text">兑换记录</div>
  13 + </div>
  14 + </div>
  15 + <div class="com_box"
  16 + v-infinite-scroll="loadMore"
  17 + infinite-scroll-disabled="loading"
  18 + :infinite-scroll-distance="list.length">
  19 + <div class="item_box" v-for="(item, index) in list" :key="index">
  20 + <img v-lazy="item.simg" src="item" alt=""/>
  21 + <div class="right">
  22 + <div class="name">
  23 + {{item.title}}
  24 + </div>
  25 + <div class="address_name">
  26 + 收货人 {{item.address_name}}
  27 + </div>
  28 + <div class="exchange_time">
  29 + 兑换时间 {{item.create_time*1000 | datetime('yyyy-MM-dd hh:mm:ss')}}
  30 + </div>
  31 + </div>
  32 + </div>
  33 + <div v-if="isMore==0" class="is_more">
  34 + 没有更多了
  35 + </div>
  36 + </div>
  37 +</div>
41 </template> 38 </template>
42 39
43 <script> 40 <script>
44 // 引入组件 41 // 引入组件
45 -import { Toast, Indicator } from 'mint-ui'; 42 +import { Toast, Indicator } from "mint-ui";
46 export default { 43 export default {
47 - name: 'ExchangeRecords',  
48 data () { 44 data () {
49 return { 45 return {
50 - list: [],  
51 - page: 1,  
52 - titleImg: null // 标题图片 46 + list: [], // 中奖记录列表
  47 + page: 0,
  48 + isMore: 1, // 0没有更多1有更多
  49 + addressInfo: null // 暂存已选商品发货地址信息
53 } 50 }
54 }, 51 },
55 - created () {  
56 - document.title = "兑奖记录"  
57 - this.getmyLuckIntegralOrder(this.page) 52 + //部件
  53 + components: {
58 }, 54 },
59 - mounted () {  
60 - let activeId = this.$route.query.activeId  
61 - this.getShareData(activeId) 55 + //静态
  56 + props: [
  57 + ],
  58 + //对象内部的属性监听,也叫深度监听
  59 + watch: {
  60 + },
  61 + //属性的结果会被缓存,除非依赖的响应式属性变化才会重新计算。主要当作属性来使用;
  62 + computed: {
62 }, 63 },
  64 + //方法表示一个具体的操作,主要书写业务逻辑;
63 methods: { 65 methods: {
64 - // 跳转到积分商城首页  
65 - goointsMall () {  
66 - this.$router.push({  
67 - path: '/pointsMall',  
68 - query: {  
69 - uid: this.getStore("uid") || 0,  
70 - }  
71 - }) 66 + // 下拉刷新
  67 + loadMore () {
  68 + this.loading = true;
  69 + this.page++;
  70 + this.getmyLuckDraw(this.page);
72 }, 71 },
73 // 抽奖记录 72 // 抽奖记录
74 /** 73 /**
@@ -76,41 +75,47 @@ export default { @@ -76,41 +75,47 @@ export default {
76 * @param {string} id [活动id] 75 * @param {string} id [活动id]
77 * * @param {string} uid [用户id] 76 * * @param {string} uid [用户id]
78 */ 77 */
79 - getmyLuckIntegralOrder (page) {  
80 -  
81 - // 加载中提示  
82 - Indicator.open('加载中...');  
83 -  
84 - // 请求接口  
85 - this.http("/Api/" + (this.getApiVersion().LuckDraw) + "/myLuckIntegralOrder", {  
86 - uid: this.getStore("uid"),  
87 - page: page  
88 - }, this.getmyLuckIntegralOrderCallback, {  
89 - method: "POST"  
90 - }); 78 + getmyLuckDraw (page) {
  79 + if (this.isMore == 1) {
  80 + // 加载中提示
  81 + Indicator.open("加载中...");
  82 + // 请求接口
  83 + this.http(
  84 + "/Api/" + this.getApiVersion().LuckDraw + "/myLuckIntegralOrder",
  85 + {
  86 + uid: this.getStore("uid"),
  87 + page: page,
  88 + type: "1"
  89 + },
  90 + this.myLuckDrawCallback,
  91 + {
  92 + method: "POST"
  93 + }
  94 + );
  95 + }
91 }, 96 },
92 -  
93 /** 97 /**
94 * 获取抽奖记录信息回调 98 * 获取抽奖记录信息回调
95 * @param {object} res [服务器返回数据] 99 * @param {object} res [服务器返回数据]
96 * @param {object} ext [扩展参数] 100 * @param {object} ext [扩展参数]
97 */ 101 */
98 - getmyLuckIntegralOrderCallback (res, ext) { 102 + myLuckDrawCallback (res, ext) {
99 this.loading = false; 103 this.loading = false;
100 // 加载完成 104 // 加载完成
101 Indicator.close(); 105 Indicator.close();
102 106
103 // 返回处理 107 // 返回处理
104 if (res.code == 200) { 108 if (res.code == 200) {
105 -  
106 // 解构数据 109 // 解构数据
107 let { data: datas } = res; 110 let { data: datas } = res;
108 - /* 获取活动详情页数据 开始 */  
109 - for (let i = 1; i <= datas.list.length; i++) {  
110 - this.list.push(datas.list[i - 1]); 111 + if (datas.list.length == 0) {
  112 + this.isMore = 0;
  113 + } else {
  114 + /* 获取活动详情页数据 开始 */
  115 + for (let i = 1; i <= datas.list.length; i++) {
  116 + this.list.push(datas.list[i - 1]);
  117 + }
111 } 118 }
112 - // 抽奖记录标题  
113 - this.titleImg = datas.luck_title_img  
114 /* 获取抽奖记录 结束 */ 119 /* 获取抽奖记录 结束 */
115 } else if (res.code == 400) { 120 } else if (res.code == 400) {
116 // 获取抽奖记录失败 121 // 获取抽奖记录失败
@@ -120,23 +125,29 @@ export default { @@ -120,23 +125,29 @@ export default {
120 Toast("获取抽奖记录失败"); 125 Toast("获取抽奖记录失败");
121 } 126 }
122 }, 127 },
123 - // 下拉刷新  
124 - loadMore () {  
125 - this.loading = true;  
126 - this.page++  
127 - this.getmyLuckIntegralOrder(this.page)  
128 - },  
129 - // 获取并设置分享参数  
130 - getShareData (activeId) {  
131 - this.$parent.getShareData({  
132 - type: 14,  
133 - id: activeId,  
134 - url: ""  
135 - }); 128 + // 返回
  129 + goback () {
  130 + if (this.isAndroid.value) {
  131 + this.$parent.back();
  132 + } else {
  133 + this.$router.push({
  134 + path: '/pointsMall',
  135 + query: {
  136 + uid: this.getStore("uid") || 0,
  137 + }
  138 + })
  139 + }
136 } 140 }
  141 + },
  142 + //请求数据
  143 + created () {
  144 + },
  145 + mounted () {
137 } 146 }
138 } 147 }
139 </script> 148 </script>
140 -<style rel="stylesheet/less" lang="less">  
141 -@import './pointsExchangeRecords'; 149 +
  150 +<style rel="stylesheet/less" scoped lang="less">
  151 +@import 'pointsExchangeRecords';
142 </style> 152 </style>
  153 +
src/router/index.js
@@ -225,6 +225,8 @@ const router = new Router({ @@ -225,6 +225,8 @@ const router = new Router({
225 requireAuth: false 225 requireAuth: false
226 } 226 }
227 }, 227 },
  228 + /* 优选和商城页面改版升级页面 结束 */
  229 + /* 积分商城开始 */
228 { 230 {
229 // 积分商城首页 231 // 积分商城首页
230 path: "/pointsMall", 232 path: "/pointsMall",
@@ -235,9 +237,20 @@ const router = new Router({ @@ -235,9 +237,20 @@ const router = new Router({
235 meta: { 237 meta: {
236 requireAuth: false 238 requireAuth: false
237 } 239 }
  240 + },
  241 + {
  242 + // 积分商城兑换记录
  243 + path: "/pointsExchangeRecords",
  244 + name: "pointsExchangeRecords",
  245 + component: resolve => {
  246 + require([
  247 + "@/pages/pointsExchangeRecords/pointsExchangeRecords"
  248 + ], resolve);
  249 + },
  250 + meta: {
  251 + requireAuth: false
  252 + }
238 } 253 }
239 -  
240 - /* 优选和商城页面改版升级页面 结束 */  
241 ] 254 ]
242 }, 255 },
243 { 256 {