Commit 6f025476fb4b4fdb2712e5465cd29ff0fb20b8b9
1 parent
b448b2bc
回赠礼物跳转到商城首页
Showing
2 changed files
with
22 additions
and
2 deletions
src/components/receivingGiftsItem/receivingGiftsItem.vue
| ... | ... | @@ -9,7 +9,7 @@ |
| 9 | 9 | <div class="user_info"> |
| 10 | 10 | <img v-lazy="item.user.img" /> |
| 11 | 11 | <div class="name">{{ item.user.username }}(赠礼)</div> |
| 12 | - <div class="btn">回赠礼物</div> | |
| 12 | + <div @click="giftInReturn(item)" class="btn">回赠礼物</div> | |
| 13 | 13 | <div class="gift_active"></div> |
| 14 | 14 | </div> |
| 15 | 15 | <!--商品信息--> |
| ... | ... | @@ -136,6 +136,9 @@ export default { |
| 136 | 136 | props: ["receivingGiftsInfo"], |
| 137 | 137 | created() {}, |
| 138 | 138 | methods: { |
| 139 | + giftInReturn(item){ | |
| 140 | + this.$emit('giftInReturn',item) | |
| 141 | + } | |
| 139 | 142 | } |
| 140 | 143 | }; |
| 141 | 144 | </script> | ... | ... |
src/pages/myGiftBox/myGiftBox.vue
| ... | ... | @@ -19,6 +19,7 @@ |
| 19 | 19 | :infinite-scroll-distance="50" |
| 20 | 20 | > |
| 21 | 21 | <receiving-gifts-item |
| 22 | + @giftInReturn="giftInReturn" | |
| 22 | 23 | :receivingGiftsInfo="receivingGiftsInfo" |
| 23 | 24 | ></receiving-gifts-item> |
| 24 | 25 | </div> |
| ... | ... | @@ -110,7 +111,23 @@ export default { |
| 110 | 111 | // 获取优选库精选活动失败 |
| 111 | 112 | Toast("获取收礼订单列表失败"); |
| 112 | 113 | } |
| 113 | - } | |
| 114 | + }, | |
| 115 | + // 跳转回赠礼物 | |
| 116 | + giftInReturn(item){ | |
| 117 | + // 判断并调用通用跳转 | |
| 118 | + if (typeof this.$parent.gotoDetail === "function") { | |
| 119 | + | |
| 120 | + // 临时,设置跳转商品详情参数 | |
| 121 | + Object.assign(item, { | |
| 122 | + type: "14", | |
| 123 | + to: "", | |
| 124 | + shop_type: "" | |
| 125 | + }); | |
| 126 | + | |
| 127 | + | |
| 128 | + this.$parent.gotoDetail(item); | |
| 129 | + } | |
| 130 | + }, | |
| 114 | 131 | } |
| 115 | 132 | }; |
| 116 | 133 | </script> | ... | ... |