1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<template>
<div class="sale">
<div style="height: 3.75vw"></div>
<div class="banner">
<img :src="weChatUrl">
</div>
<div>
<!--<div class="shop-block" v-for="data in user_goods_list" @click="goToBuy(data);buttonClick('去购买')">-->
<!--<div class="shop">-->
<!--<div class="img-block">-->
<!--<img :src="data.goods_desc.img[0].url">-->
<!--</div>-->
<!--<div>-->
<!--<div class="title">-->
<!--{{data.name}}-->
<!--</div>-->
<!--<div class="content">-->
<!--{{data.goods_desc.desc}}-->
<!--</div>-->
<!--<div class="price">-->
<!-->>立即购买<<-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
</div>
</div>
</template>
<script>
import weChatUrl from '../../assets/shop/saleSuccess.png'
import {getOrderDetailApi,getGoodsDetailApi,getGoodsListApi} from "../../service/api";
export default {
name: "saleSuccess",
data(){
return {
invite_code:'',
weChatUrl:weChatUrl,
orderNo:this.$route.query.out_trade_no,
goods_id:'',
user_goods_list:[]
}
},
mounted(){
this.initPage()
},
methods:{
buttonClick(buttonName){
this.$sa.track('buttonClick',{
tabTitle:'商品',
moduleTitle:'优惠券购买成功页',
buttonType:'功能',
buttonName:buttonName
});
},
initPage(){
getOrderDetailApi(this.orderNo).then(res=>{
this.goods_id = res.goods_id;
this.invite_code = `CC-${res.invite_type}-${res.invite_id}`;
getGoodsDetailApi(this.goods_id).then(res=>{
let user_goods_id = JSON.parse(res.desc).use_goods_ids;
getGoodsListApi({goods_ids:user_goods_id}).then(res=>{
this.user_goods_list = [];
for(let i = 0; i < res.list.length ; i ++){
res.list[i].desc = JSON.parse(res.list[i].desc);
res.list[i].goods_desc = JSON.parse(res.list[i].goods_desc);
res.list[i].share_desc = JSON.parse(res.list[i].share_desc)
this.user_goods_list.push(res.list[i])
}
});
})
})
},
goToBuy(data){
this.$router.push({name:'buyDetail',query:{shopId:data.id,invite_code:this.$route.query.invite_code}})
}
}
}
</script>
<style scoped lang="less">
@import "../../util/public";
.sale{
background: #eeeeee;
.shop-block{
background: white;
.shop{
padding: 20/7.5vw;
border-bottom: 1px solid #d8d8d8;
position: relative;
&:after{
content:'';
display: block;
clear: both;
}
.img-block{
float: left;
margin-right: 20/7.5vw;
img{
width: 250/7.5vw;
}
min-height: 120px;
}
.title{
font-size: 18px;
overflow: hidden;
text-overflow:ellipsis;
white-space: nowrap;
color: #333333;
margin-bottom: 5/7.5vw;
}
.content{
font-size: 12px;
line-height: 1.4em;
color: #CCCCCC;
height: 4.2em;
overflow: hidden;
}
.price{
font-size: 18px;
color: #FF001F;
position: absolute;
right: 20/7.5vw;
bottom: 20/7.5vw;
}
}
}
.banner{
margin: 0 0 10 * @toVw 0;
background: white;
padding: 10 * @toVw;
img{
width: 100%;
}
}
}
</style>