Commit ed7138f09e31c3d98bfe1c207b3d227111a63ef1
1 parent
b68ee934
调试
Showing
2 changed files
with
42 additions
and
13 deletions
src/components/receivingGiftsItem/receivingGiftsItem.vue
| 1 | <template> | 1 | <template> |
| 2 | - <div v-if="receivingGiftsInfo && receivingGiftsInfo.length>0"> | 2 | + <div v-if="receivingGiftsInfo && receivingGiftsInfo.length > 0"> |
| 3 | <div | 3 | <div |
| 4 | class="giftItem_box" | 4 | class="giftItem_box" |
| 5 | v-for="(item, index) in receivingGiftsInfo" | 5 | v-for="(item, index) in receivingGiftsInfo" |
| @@ -8,9 +8,14 @@ | @@ -8,9 +8,14 @@ | ||
| 8 | > | 8 | > |
| 9 | <!--用户信息--> | 9 | <!--用户信息--> |
| 10 | <div class="user_info"> | 10 | <div class="user_info"> |
| 11 | - <img v-lazy="item.user.img" /> | 11 | + <img |
| 12 | + v-on:click.stop="onUserInfo(item)" | ||
| 13 | + v-lazy="item.user.img" | ||
| 14 | + /> | ||
| 12 | <div class="name">{{ item.user.username }}(赠礼)</div> | 15 | <div class="name">{{ item.user.username }}(赠礼)</div> |
| 13 | - <div v-on:click.stop="giftInReturn(item)" class="btn">回赠礼物</div> | 16 | + <div v-on:click.stop="giftInReturn(item)" class="btn"> |
| 17 | + 回赠礼物 | ||
| 18 | + </div> | ||
| 14 | <div class="gift_active"></div> | 19 | <div class="gift_active"></div> |
| 15 | </div> | 20 | </div> |
| 16 | <!--商品信息--> | 21 | <!--商品信息--> |
| @@ -22,9 +27,17 @@ | @@ -22,9 +27,17 @@ | ||
| 22 | <div class="title"> | 27 | <div class="title"> |
| 23 | <span>¥</span>{{ item.goods.price }} | 28 | <span>¥</span>{{ item.goods.price }} |
| 24 | </div> | 29 | </div> |
| 25 | - <div v-if="item.get_gift_state!=7" class="btn"> | ||
| 26 | - <span v-if="item.get_gift_state < 3">点击收礼</span> <span v-else-if="item.get_gift_state == 3">填写地址</span> | ||
| 27 | - <span v-else-if="item.get_gift_state == 4">商家发货</span> <span v-else-if="item.get_gift_state == 5">确认收货</span> | 30 | + <div v-if="item.get_gift_state != 7" class="btn"> |
| 31 | + <span v-if="item.get_gift_state < 3">点击收礼</span> | ||
| 32 | + <span v-else-if="item.get_gift_state == 3" | ||
| 33 | + >填写地址</span | ||
| 34 | + > | ||
| 35 | + <span v-else-if="item.get_gift_state == 4" | ||
| 36 | + >商家发货</span | ||
| 37 | + > | ||
| 38 | + <span v-else-if="item.get_gift_state == 5" | ||
| 39 | + >确认收货</span | ||
| 40 | + > | ||
| 28 | </div> | 41 | </div> |
| 29 | </div> | 42 | </div> |
| 30 | </div> | 43 | </div> |
| @@ -121,9 +134,7 @@ | @@ -121,9 +134,7 @@ | ||
| 121 | </div> | 134 | </div> |
| 122 | </div> | 135 | </div> |
| 123 | <!-- 显示文字 --> | 136 | <!-- 显示文字 --> |
| 124 | - <div class="text_tip" v-else> | ||
| 125 | - 完成 | ||
| 126 | - </div> | 137 | + <div class="text_tip" v-else>完成</div> |
| 127 | </div> | 138 | </div> |
| 128 | </div> | 139 | </div> |
| 129 | </template> | 140 | </template> |
| @@ -138,12 +149,16 @@ export default { | @@ -138,12 +149,16 @@ export default { | ||
| 138 | created() {}, | 149 | created() {}, |
| 139 | methods: { | 150 | methods: { |
| 140 | // 回赠礼物跳转到商城 | 151 | // 回赠礼物跳转到商城 |
| 141 | - giftInReturn(item){ | ||
| 142 | - this.$emit('giftInReturn',item) | 152 | + giftInReturn(item) { |
| 153 | + this.$emit("giftInReturn", item); | ||
| 143 | }, | 154 | }, |
| 144 | // 跳转到礼物详情页 | 155 | // 跳转到礼物详情页 |
| 145 | - onReceivingGifts(item){ | ||
| 146 | - this.$emit('onReceivingGifts',item) | 156 | + onReceivingGifts(item) { |
| 157 | + this.$emit("onReceivingGifts", item); | ||
| 158 | + }, | ||
| 159 | + // 跳转到用户详情页 | ||
| 160 | + onUserInfo(item) { | ||
| 161 | + this.$emit("onUserInfo", item); | ||
| 147 | } | 162 | } |
| 148 | } | 163 | } |
| 149 | }; | 164 | }; |
src/pages/myGiftBox/myGiftBox.vue
| @@ -21,6 +21,7 @@ | @@ -21,6 +21,7 @@ | ||
| 21 | <!-- 收礼列表 --> | 21 | <!-- 收礼列表 --> |
| 22 | <receiving-gifts-item | 22 | <receiving-gifts-item |
| 23 | v-show="active != 1 && active == 0" | 23 | v-show="active != 1 && active == 0" |
| 24 | + @onUserInfo="onUserInfo" | ||
| 24 | @giftInReturn="giftInReturn" | 25 | @giftInReturn="giftInReturn" |
| 25 | @onReceivingGifts="onReceivingGifts" | 26 | @onReceivingGifts="onReceivingGifts" |
| 26 | :receivingGiftsInfo="receivingGiftsInfo" | 27 | :receivingGiftsInfo="receivingGiftsInfo" |
| @@ -155,6 +156,19 @@ export default { | @@ -155,6 +156,19 @@ export default { | ||
| 155 | Toast("获取收礼订单列表失败"); | 156 | Toast("获取收礼订单列表失败"); |
| 156 | } | 157 | } |
| 157 | }, | 158 | }, |
| 159 | + // 跳转到用户详情页 | ||
| 160 | + onUserInfo(item) { | ||
| 161 | + // 判断并调用通用跳转 | ||
| 162 | + if (typeof this.$parent.gotoDetail === "function") { | ||
| 163 | + // 临时,设置跳转商品详情参数 | ||
| 164 | + Object.assign(item, { | ||
| 165 | + type: "43", | ||
| 166 | + to:JSON.stringify({"uid":item.user.uid,"username":item.user.username,"img":item.user.img}), | ||
| 167 | + shop_type: "" | ||
| 168 | + }); | ||
| 169 | + this.$parent.gotoDetail(item); | ||
| 170 | + } | ||
| 171 | + }, | ||
| 158 | // 跳转回赠礼物 | 172 | // 跳转回赠礼物 |
| 159 | giftInReturn(item) { | 173 | giftInReturn(item) { |
| 160 | // 判断并调用通用跳转 | 174 | // 判断并调用通用跳转 |