Commit 36b18a57c202fe7e49d69ed43ca1e4d72e0189fe

Authored by zhiyangdu
1 parent 598e1334

'is_data' :"1", // 是否有赠礼 1 有 0 无

src/components/giftGivingItem/giftGivingItem.less
@@ -148,11 +148,6 @@ @@ -148,11 +148,6 @@
148 display: flex; 148 display: flex;
149 justify-content: center; 149 justify-content: center;
150 align-items: center; 150 align-items: center;
151 - img {  
152 - display: block;  
153 - width: 260px;  
154 - height: 230px;  
155 - }  
156 .tip { 151 .tip {
157 width: 100%; 152 width: 100%;
158 height: 42px; 153 height: 42px;
@@ -162,26 +157,41 @@ @@ -162,26 +157,41 @@
162 line-height: 42px; 157 line-height: 42px;
163 margin-top: 30px; 158 margin-top: 30px;
164 } 159 }
165 - .desc {  
166 - width: 100%;  
167 - height: 33px;  
168 - font-size: 24px;  
169 - font-family: PingFang-SC-Regular, PingFang-SC;  
170 - font-weight: 400;  
171 - color: rgba(153, 153, 153, 1);  
172 - line-height: 33px;  
173 - margin-top: 10px;  
174 - text-align: center; 160 + .box {
  161 + img {
  162 + display: block;
  163 + width: 260px;
  164 + height: 230px;
  165 + }
  166 + .desc {
  167 + width: 100%;
  168 + height: 33px;
  169 + font-size: 24px;
  170 + font-family: PingFang-SC-Regular, PingFang-SC;
  171 + font-weight: 400;
  172 + color: rgba(153, 153, 153, 1);
  173 + line-height: 33px;
  174 + margin-top: 10px;
  175 + text-align: center;
  176 + }
  177 + .btn {
  178 + width: 172px;
  179 + height: 56px;
  180 + border-radius: 8px;
  181 + border: 1px solid rgba(208, 2, 27, 1);
  182 + line-height: 56px;
  183 + color: #d0021b;
  184 + font-size: 26px;
  185 + text-align: center;
  186 + margin: 46px auto 0 auto;
  187 + }
175 } 188 }
176 - .btn {  
177 - width: 172px;  
178 - height: 56px;  
179 - border-radius: 8px;  
180 - border: 1px solid rgba(208, 2, 27, 1);  
181 - line-height: 56px;  
182 - color: #D0021B;  
183 - font-size: 26px;  
184 - text-align:center;  
185 - margin: 46px auto 0 auto; 189 + .box2{
  190 + img{
  191 + width: 200px;
  192 + height: 200px;
  193 + display: block;
  194 + margin: 0 auto;
  195 + }
186 } 196 }
187 } 197 }
src/components/giftGivingItem/giftGivingItem.vue
@@ -94,12 +94,16 @@ @@ -94,12 +94,16 @@
94 </div> 94 </div>
95 <!-- 您还未送过礼物哦~--> 95 <!-- 您还未送过礼物哦~-->
96 <div v-else class="noGift"> 96 <div v-else class="noGift">
97 - <div class="box"> 97 + <div v-if="isData==0" class="box">
98 <img src="/static/img/noGifts.png" /> 98 <img src="/static/img/noGifts.png" />
99 <div class="tip">一份礼品 一份轻易</div> 99 <div class="tip">一份礼品 一份轻易</div>
100 <div class="desc">您还未送出礼物</div> 100 <div class="desc">您还未送出礼物</div>
101 <div class="btn">去购买送礼</div> 101 <div class="btn">去购买送礼</div>
102 </div> 102 </div>
  103 + <div v-else class="box2">
  104 + <img src="/static/img/noItem.png" />
  105 + <div class="tip">您还没有相关订单</div>
  106 + </div>
103 </div> 107 </div>
104 </div> 108 </div>
105 </template> 109 </template>
@@ -110,7 +114,7 @@ export default { @@ -110,7 +114,7 @@ export default {
110 data() { 114 data() {
111 return {}; 115 return {};
112 }, 116 },
113 - props: ["giftGivingItem"], 117 + props: ["giftGivingItem","isData"],
114 created() {}, 118 created() {},
115 methods: { 119 methods: {
116 // 跳转到礼物详情页 120 // 跳转到礼物详情页
src/components/receivingGiftsItem/receivingGiftsItem.less
@@ -200,11 +200,6 @@ @@ -200,11 +200,6 @@
200 display: flex; 200 display: flex;
201 justify-content: center; 201 justify-content: center;
202 align-items: center; 202 align-items: center;
203 - img {  
204 - display: block;  
205 - width: 260px;  
206 - height: 230px;  
207 - }  
208 .tip { 203 .tip {
209 width: 100%; 204 width: 100%;
210 height: 42px; 205 height: 42px;
@@ -213,6 +208,22 @@ @@ -213,6 +208,22 @@
213 color: rgba(51, 51, 51, 1); 208 color: rgba(51, 51, 51, 1);
214 line-height: 42px; 209 line-height: 42px;
215 margin-top: 30px; 210 margin-top: 30px;
  211 + text-align: center;
  212 + }
  213 + .box {
  214 + img {
  215 + display: block;
  216 + width: 260px;
  217 + height: 230px;
  218 + }
  219 + }
  220 + .box2{
  221 + img{
  222 + width: 200px;
  223 + height: 200px;
  224 + display: block;
  225 + margin: 0 auto;
  226 + }
216 } 227 }
217 } 228 }
218 } 229 }
src/components/receivingGiftsItem/receivingGiftsItem.vue
1 <template> 1 <template>
2 <div class="receivingGiftsInfo"> 2 <div class="receivingGiftsInfo">
3 - <div v-if="receivingGiftsInfo && receivingGiftsInfo.length > 0">  
4 - <div  
5 - class="giftItem_box"  
6 - v-for="(item, index) in receivingGiftsInfo"  
7 - :key="index"  
8 - @click="onReceivingGifts(item)"  
9 - v-if="item"  
10 - >  
11 - <!--用户信息-->  
12 - <div class="user_info">  
13 - <img  
14 - v-if="item&&item.user&&item.user.img"  
15 - v-on:click.stop="onUserInfo(item)"  
16 - v-lazy="item.user.img"  
17 - />  
18 - <div v-if="item&&item.user&&item.user.username" class="name">{{ item.user.username }}(赠礼)</div>  
19 - <div v-on:click.stop="giftInReturn(item)" class="btn">  
20 - 回赠礼物 3 + <div v-if="receivingGiftsInfo && receivingGiftsInfo.length > 0">
  4 + <div
  5 + class="giftItem_box"
  6 + v-for="(item, index) in receivingGiftsInfo"
  7 + :key="index"
  8 + @click="onReceivingGifts(item)"
  9 + v-if="item"
  10 + >
  11 + <!--用户信息-->
  12 + <div class="user_info">
  13 + <img
  14 + v-if="item && item.user && item.user.img"
  15 + v-on:click.stop="onUserInfo(item)"
  16 + v-lazy="item.user.img"
  17 + />
  18 + <div
  19 + v-if="item && item.user && item.user.username"
  20 + class="name"
  21 + >
  22 + {{ item.user.username }}(赠礼)
  23 + </div>
  24 + <div v-on:click.stop="giftInReturn(item)" class="btn">
  25 + 回赠礼物
  26 + </div>
  27 + <div class="gift_active"></div>
21 </div> 28 </div>
22 - <div class="gift_active"></div>  
23 - </div>  
24 - <!--商品信息-->  
25 - <div class="item_info">  
26 - <img v-if="item&&item.goods&&item.goods.simg" v-lazy="item.goods.simg" />  
27 - <div class="box">  
28 - <div v-if="item&&item.goods&&item.goods.title" class="name">{{ item.goods.title }}</div>  
29 - <div class="pirce">  
30 - <div v-if="item&&item.goods&&item.goods.price" class="title">  
31 - <span>¥</span>{{ item.goods.price }} 29 + <!--商品信息-->
  30 + <div class="item_info">
  31 + <img
  32 + v-if="item && item.goods && item.goods.simg"
  33 + v-lazy="item.goods.simg"
  34 + />
  35 + <div class="box">
  36 + <div
  37 + v-if="item && item.goods && item.goods.title"
  38 + class="name"
  39 + >
  40 + {{ item.goods.title }}
32 </div> 41 </div>
33 - <div v-if="item.get_gift_state < 6" class="btn">  
34 - <span v-if="item.get_gift_state < 3">点击收礼</span>  
35 - <span v-else-if="item.get_gift_state == 3"  
36 - >填写地址</span  
37 - >  
38 - <span v-else-if="item.get_gift_state == 4"  
39 - >商家发货</span  
40 - >  
41 - <span v-else-if="item.get_gift_state == 5"  
42 - >确认收货</span 42 + <div class="pirce">
  43 + <div
  44 + v-if="item && item.goods && item.goods.price"
  45 + class="title"
43 > 46 >
  47 + <span>¥</span>{{ item.goods.price }}
  48 + </div>
  49 + <div v-if="item.get_gift_state < 6" class="btn">
  50 + <span v-if="item.get_gift_state < 3"
  51 + >点击收礼</span
  52 + >
  53 + <span v-else-if="item.get_gift_state == 3"
  54 + >填写地址</span
  55 + >
  56 + <span v-else-if="item.get_gift_state == 4"
  57 + >商家发货</span
  58 + >
  59 + <span v-else-if="item.get_gift_state == 5"
  60 + >确认收货</span
  61 + >
  62 + </div>
44 </div> 63 </div>
45 </div> 64 </div>
46 </div> 65 </div>
47 - </div>  
48 - <!--步骤条-->  
49 - <div class="steps_box" v-if="item.get_gift_state < 6">  
50 - <div class="line_box">  
51 - <div  
52 - :class="[  
53 - 'box',  
54 - item.get_gift_state > 2  
55 - ? item.get_gift_state > 3  
56 - ? 'active active_line'  
57 - : 'active'  
58 - : ''  
59 - ]"  
60 - >  
61 - <div class="item">  
62 - <div class="img"></div>  
63 - <div class="line_box"><div class="line"></div></div> 66 + <!--步骤条-->
  67 + <div class="steps_box" v-if="item.get_gift_state < 6">
  68 + <div class="line_box">
  69 + <div
  70 + :class="[
  71 + 'box',
  72 + item.get_gift_state > 2
  73 + ? item.get_gift_state > 3
  74 + ? 'active active_line'
  75 + : 'active'
  76 + : ''
  77 + ]"
  78 + >
  79 + <div class="item">
  80 + <div class="img"></div>
  81 + <div class="line_box">
  82 + <div class="line"></div>
  83 + </div>
  84 + </div>
64 </div> 85 </div>
65 - </div>  
66 - <div  
67 - :class="[  
68 - 'box',  
69 - item.get_gift_state > 3  
70 - ? item.get_gift_state > 4  
71 - ? 'active active_line'  
72 - : 'active'  
73 - : ''  
74 - ]"  
75 - >  
76 - <div class="item">  
77 - <div class="img"></div>  
78 - <div class="line_box"><div class="line"></div></div> 86 + <div
  87 + :class="[
  88 + 'box',
  89 + item.get_gift_state > 3
  90 + ? item.get_gift_state > 4
  91 + ? 'active active_line'
  92 + : 'active'
  93 + : ''
  94 + ]"
  95 + >
  96 + <div class="item">
  97 + <div class="img"></div>
  98 + <div class="line_box">
  99 + <div class="line"></div>
  100 + </div>
  101 + </div>
79 </div> 102 </div>
80 - </div>  
81 - <div  
82 - :class="[  
83 - 'box',  
84 - item.get_gift_state > 4  
85 - ? item.get_gift_state > 5  
86 - ? 'active active_line'  
87 - : 'active'  
88 - : ''  
89 - ]"  
90 - >  
91 - <div class="item">  
92 - <div class="img"></div>  
93 - <div class="line_box"><div class="line"></div></div> 103 + <div
  104 + :class="[
  105 + 'box',
  106 + item.get_gift_state > 4
  107 + ? item.get_gift_state > 5
  108 + ? 'active active_line'
  109 + : 'active'
  110 + : ''
  111 + ]"
  112 + >
  113 + <div class="item">
  114 + <div class="img"></div>
  115 + <div class="line_box">
  116 + <div class="line"></div>
  117 + </div>
  118 + </div>
94 </div> 119 </div>
95 - </div>  
96 - <div  
97 - :class="[  
98 - 'box',  
99 - item.get_gift_state > 5  
100 - ? item.get_gift_state > 6  
101 - ? 'active active_line'  
102 - : 'active'  
103 - : ''  
104 - ]"  
105 - >  
106 - <div class="item">  
107 - <div class="img"></div>  
108 - <div class="line_box"><div class="line"></div></div> 120 + <div
  121 + :class="[
  122 + 'box',
  123 + item.get_gift_state > 5
  124 + ? item.get_gift_state > 6
  125 + ? 'active active_line'
  126 + : 'active'
  127 + : ''
  128 + ]"
  129 + >
  130 + <div class="item">
  131 + <div class="img"></div>
  132 + <div class="line_box">
  133 + <div class="line"></div>
  134 + </div>
  135 + </div>
109 </div> 136 </div>
110 </div> 137 </div>
111 - </div>  
112 - <div class="desc_box">  
113 - <div  
114 - class="desc"  
115 - :class="{ active: item.get_gift_state > 2 }"  
116 - >  
117 - 点击收礼  
118 - </div>  
119 - <div  
120 - class="desc"  
121 - :class="{ active: item.get_gift_state > 3 }"  
122 - >  
123 - 填写地址  
124 - </div>  
125 - <div  
126 - class="desc"  
127 - :class="{ active: item.get_gift_state > 4 }"  
128 - >  
129 - 商家发货  
130 - </div>  
131 - <div  
132 - class="desc"  
133 - :class="{ active: item.get_gift_state > 5 }"  
134 - >  
135 - 确认收货 138 + <div class="desc_box">
  139 + <div
  140 + class="desc"
  141 + :class="{ active: item.get_gift_state > 2 }"
  142 + >
  143 + 点击收礼
  144 + </div>
  145 + <div
  146 + class="desc"
  147 + :class="{ active: item.get_gift_state > 3 }"
  148 + >
  149 + 填写地址
  150 + </div>
  151 + <div
  152 + class="desc"
  153 + :class="{ active: item.get_gift_state > 4 }"
  154 + >
  155 + 商家发货
  156 + </div>
  157 + <div
  158 + class="desc"
  159 + :class="{ active: item.get_gift_state > 5 }"
  160 + >
  161 + 确认收货
  162 + </div>
136 </div> 163 </div>
137 </div> 164 </div>
  165 + <!-- 显示文字 -->
  166 + <div class="text_tip" v-else>完成</div>
  167 + </div>
  168 + </div>
  169 + <!-- 您还未收到过礼物哦~-->
  170 + <div v-else class="noGift">
  171 + <div v-if="isData==0" class="box">
  172 + <img src="/static/img/noGifts.png" />
  173 + <div class="tip">您还未收到过该礼物哦</div>
  174 + </div>
  175 + <div v-else class="box2">
  176 + <img src="/static/img/noItem.png" />
  177 + <div class="tip">您还没有相关订单</div>
138 </div> 178 </div>
139 - <!-- 显示文字 -->  
140 - <div class="text_tip" v-else>完成</div>  
141 </div> 179 </div>
142 - </div>  
143 - <!-- 您还未收到过礼物哦~-->  
144 - <div v-else class="noGift">  
145 - <div class=box>  
146 - <img src="/static/img/noGifts.png"/>  
147 - <div class="tip">您还未收到过礼物哦</div>  
148 - </div>  
149 - </div>  
150 </div> 180 </div>
151 </template> 181 </template>
152 182
@@ -156,7 +186,7 @@ export default { @@ -156,7 +186,7 @@ export default {
156 data() { 186 data() {
157 return {}; 187 return {};
158 }, 188 },
159 - props: ["receivingGiftsInfo"], 189 + props: ["receivingGiftsInfo","isData"],
160 created() {}, 190 created() {},
161 methods: { 191 methods: {
162 // 回赠礼物跳转到商城 192 // 回赠礼物跳转到商城
src/pages/myGiftBox/myGiftBox.vue
@@ -38,6 +38,7 @@ @@ -38,6 +38,7 @@
38 @giftInReturn="giftInReturn" 38 @giftInReturn="giftInReturn"
39 @onReceivingGifts="onReceivingGifts" 39 @onReceivingGifts="onReceivingGifts"
40 :receivingGiftsInfo="receivingGiftsInfo" 40 :receivingGiftsInfo="receivingGiftsInfo"
  41 + :isData=this.receivingGifts.isData
41 ></receiving-gifts-item> 42 ></receiving-gifts-item>
42 <!-- 送礼列表 --> 43 <!-- 送礼列表 -->
43 <giftGivingItem 44 <giftGivingItem
@@ -46,6 +47,7 @@ @@ -46,6 +47,7 @@
46 @jumpToPay="jumpToPay" 47 @jumpToPay="jumpToPay"
47 v-show="active != 0 && active == 1" 48 v-show="active != 0 && active == 1"
48 :giftGivingItem="giftGivingItem" 49 :giftGivingItem="giftGivingItem"
  50 + :isData= this.giftGiving.isData
49 > 51 >
50 </giftGivingItem> 52 </giftGivingItem>
51 <!-- 没有更多了 --> 53 <!-- 没有更多了 -->
@@ -99,7 +101,8 @@ export default { @@ -99,7 +101,8 @@ export default {
99 // 收礼 101 // 收礼
100 loading: false, // 加载 102 loading: false, // 加载
101 pages: 1, // 分页 103 pages: 1, // 分页
102 - tipText:null // 数据加载完提示 104 + tipText:null, // 数据加载完提示
  105 + isData:null // 是否有赠礼 1 有 0 无
103 }, 106 },
104 giftGivingItem: null, // 送礼列表页数据 107 giftGivingItem: null, // 送礼列表页数据
105 giftsRuleUrl: null, // 礼物规则URL 108 giftsRuleUrl: null, // 礼物规则URL
@@ -107,7 +110,8 @@ export default { @@ -107,7 +110,8 @@ export default {
107 // 送礼 110 // 送礼
108 loading: false, // 加载 111 loading: false, // 加载
109 pages: 1, // 分页 112 pages: 1, // 分页
110 - tipText:null // 数据加载完提示 113 + tipText:null, // 数据加载完提示
  114 + isData:null // 是否有赠礼 1 有 0 无
111 }, 115 },
112 // tipText: null, // 是否已加载完 116 // tipText: null, // 是否已加载完
113 actionSheetShow: false, 117 actionSheetShow: false,
@@ -174,10 +178,12 @@ export default { @@ -174,10 +178,12 @@ export default {
174 if(this.active==0){ 178 if(this.active==0){
175 // 收礼订单列表 179 // 收礼订单列表
176 this.receivingGiftStatue = name; 180 this.receivingGiftStatue = name;
  181 + this.receivingGifts.tipText = null
177 this.getorderGiftList(1); 182 this.getorderGiftList(1);
178 }else{ 183 }else{
179 // 送礼订单列表 184 // 送礼订单列表
180 this.giveGifStatue = name; 185 this.giveGifStatue = name;
  186 + this.receivingGifts.giftGiving = null
181 this.getorderGiveGiftList(1); 187 this.getorderGiveGiftList(1);
182 } 188 }
183 }, 189 },
@@ -292,6 +298,8 @@ export default { @@ -292,6 +298,8 @@ export default {
292 this.receivingGifts.loading = false; 298 this.receivingGifts.loading = false;
293 // 解构数据 299 // 解构数据
294 let { data: datas } = res; 300 let { data: datas } = res;
  301 + // is_data是否有赠礼 1 有 0 无
  302 + this.receivingGifts.isData = datas.is_data
295 // 页脚等于1的时候会出现数据获取为空 303 // 页脚等于1的时候会出现数据获取为空
296 if(ext.initPage==1 || this.receivingGifts.pages==1){ 304 if(ext.initPage==1 || this.receivingGifts.pages==1){
297 this.receivingGiftsInfo = datas.list; 305 this.receivingGiftsInfo = datas.list;
@@ -419,6 +427,8 @@ export default { @@ -419,6 +427,8 @@ export default {
419 if (res.code == 200) { 427 if (res.code == 200) {
420 // 解构数据 428 // 解构数据
421 let { data: datas } = res; 429 let { data: datas } = res;
  430 + // is_data是否有赠礼 1 有 0 无
  431 + this.giftGiving.isData = datas.is_data
422 // 页脚等于1的时候会出现数据获取为空 432 // 页脚等于1的时候会出现数据获取为空
423 if(ext.initPage==1 || this.receivingGifts.pages==1){ 433 if(ext.initPage==1 || this.receivingGifts.pages==1){
424 this.giftGivingItem = datas.list; 434 this.giftGivingItem = datas.list;
static/img/noItem.png 0 → 100644

16.4 KB