Commit 3bbd76bb308478c564f79eea758f1b8d6dc52da1
1 parent
7c1b7a45
店铺详情页跳转
Showing
3 changed files
with
50 additions
and
98 deletions
src/components/giftGivingItem/giftGivingItem.vue
| ... | ... | @@ -36,7 +36,7 @@ |
| 36 | 36 | <!-- 店铺信息 --> |
| 37 | 37 | <div class="shop_info"> |
| 38 | 38 | <img |
| 39 | - v-on:click.stop="onUserInfo(item)" | |
| 39 | + v-on:click.stop="toShopDetails(item)" | |
| 40 | 40 | src="static/img/1.png"/> |
| 41 | 41 | <div class="name"> |
| 42 | 42 | 店铺名字 |
| ... | ... | @@ -81,7 +81,7 @@ |
| 81 | 81 | </div> |
| 82 | 82 | </div> |
| 83 | 83 | <!-- 展开和折叠按钮 --> |
| 84 | - <div class="fold_box" @click="onLoginMore"> | |
| 84 | + <div class="fold_box" @click.stop="onLoginMore"> | |
| 85 | 85 | <div class="fold"> |
| 86 | 86 | 共五件 <div :class="[triangle?'triangle_top':'triangle_bottom']"> </div> |
| 87 | 87 | </div> |
| ... | ... | @@ -155,6 +155,10 @@ export default { |
| 155 | 155 | onGiftGiving(item) { |
| 156 | 156 | this.$emit("onGiftGiving", item); |
| 157 | 157 | }, |
| 158 | + // 跳转到商铺详情页 | |
| 159 | + toShopDetails(item) { | |
| 160 | + this.$emit("toShopDetails", item); | |
| 161 | + }, | |
| 158 | 162 | // 跳转到原声生支付 |
| 159 | 163 | jumpToPay(item) { |
| 160 | 164 | this.$emit("jumpToPay", item); | ... | ... |
src/components/receivingGiftsItem/receivingGiftsItem.vue
| ... | ... | @@ -6,7 +6,8 @@ |
| 6 | 6 | v-for="(item, index) in receivingGiftsInfo" |
| 7 | 7 | :key="index" |
| 8 | 8 | @click="onReceivingGifts(item)" |
| 9 | - v-if="item"> | |
| 9 | + v-if="item" | |
| 10 | + > | |
| 10 | 11 | <!--用户信息--> |
| 11 | 12 | <div class="user_info"> |
| 12 | 13 | <img |
| ... | ... | @@ -26,14 +27,12 @@ |
| 26 | 27 | <div class="gift_active"></div> |
| 27 | 28 | </div> |
| 28 | 29 | <!-- 订单状态集合 --> |
| 29 | - <div class="statu_list"> | |
| 30 | - <div class="btn">可分享</div> | |
| 31 | - </div> | |
| 30 | + <div class="statu_list"><div class="btn">可分享</div></div> | |
| 32 | 31 | <!-- 店铺信息 --> |
| 33 | 32 | <div class="shop_info"> |
| 34 | 33 | <img |
| 35 | 34 | v-if="item && item.user && item.user.img" |
| 36 | - v-on:click.stop="onUserInfo(item)" | |
| 35 | + v-on:click.stop="toShopDetails(item)" | |
| 37 | 36 | v-lazy="item.user.img" |
| 38 | 37 | /> |
| 39 | 38 | <div |
| ... | ... | @@ -43,13 +42,14 @@ |
| 43 | 42 | 店铺名字 |
| 44 | 43 | </div> |
| 45 | 44 | <!-- 商品订单按钮 --> |
| 46 | - <div | |
| 47 | - @click="OrderLink" | |
| 48 | - v-if="index == 0" | |
| 49 | - class="oredr_link_box"> | |
| 50 | - <div>商品订单</div> | |
| 51 | - <van-icon class="icon" name="arrow" /> | |
| 52 | - </div> | |
| 45 | + <div | |
| 46 | + @click="OrderLink" | |
| 47 | + v-if="index == 0" | |
| 48 | + class="oredr_link_box" | |
| 49 | + > | |
| 50 | + <div>商品订单</div> | |
| 51 | + <van-icon class="icon" name="arrow" /> | |
| 52 | + </div> | |
| 53 | 53 | </div> |
| 54 | 54 | <!--商品信息--> |
| 55 | 55 | <div class="item_info"> |
| ... | ... | @@ -90,83 +90,7 @@ |
| 90 | 90 | </div> |
| 91 | 91 | </div> |
| 92 | 92 | </div> |
| 93 | - <div v-show="triangle" class="item_info"> | |
| 94 | - <img | |
| 95 | - v-if="item && item.goods && item.goods.simg" | |
| 96 | - v-lazy="item.goods.simg" | |
| 97 | - /> | |
| 98 | - <div class="box"> | |
| 99 | - <div | |
| 100 | - v-if="item && item.goods && item.goods.title" | |
| 101 | - class="name" | |
| 102 | - > | |
| 103 | - {{ item.goods.title }} | |
| 104 | - </div> | |
| 105 | - <!-- 每人多少件 --> | |
| 106 | - <div class="num_desc">每人 1 件</div> | |
| 107 | - <div class="pirce"> | |
| 108 | - <div | |
| 109 | - v-if="item && item.goods && item.goods.price" | |
| 110 | - class="title" | |
| 111 | - > | |
| 112 | - <span>¥</span>{{ item.goods.price }} | |
| 113 | - </div> | |
| 114 | - <div v-if="item.get_gift_state < 6" class="btn"> | |
| 115 | - <span v-if="item.get_gift_state < 3" | |
| 116 | - >点击收礼</span | |
| 117 | - > | |
| 118 | - <span v-else-if="item.get_gift_state == 3" | |
| 119 | - >填写地址</span | |
| 120 | - > | |
| 121 | - <span v-else-if="item.get_gift_state == 4" | |
| 122 | - >商家发货</span | |
| 123 | - > | |
| 124 | - <span v-else-if="item.get_gift_state == 5" | |
| 125 | - >确认收货</span | |
| 126 | - > | |
| 127 | - </div> | |
| 128 | - </div> | |
| 129 | - </div> | |
| 130 | - </div> | |
| 131 | - <div v-show="triangle" class="item_info"> | |
| 132 | - <img | |
| 133 | - v-if="item && item.goods && item.goods.simg" | |
| 134 | - v-lazy="item.goods.simg" | |
| 135 | - /> | |
| 136 | - <div class="box"> | |
| 137 | - <div | |
| 138 | - v-if="item && item.goods && item.goods.title" | |
| 139 | - class="name" | |
| 140 | - > | |
| 141 | - {{ item.goods.title }} | |
| 142 | - </div> | |
| 143 | - <!-- 每人多少件 --> | |
| 144 | - <div class="num_desc">每人 1 件</div> | |
| 145 | - <div class="pirce"> | |
| 146 | - <div | |
| 147 | - v-if="item && item.goods && item.goods.price" | |
| 148 | - class="title" | |
| 149 | - > | |
| 150 | - <span>¥</span>{{ item.goods.price }} | |
| 151 | - </div> | |
| 152 | - <div v-if="item.get_gift_state < 6" class="btn"> | |
| 153 | - <span v-if="item.get_gift_state < 3" | |
| 154 | - >点击收礼</span | |
| 155 | - > | |
| 156 | - <span v-else-if="item.get_gift_state == 3" | |
| 157 | - >填写地址</span | |
| 158 | - > | |
| 159 | - <span v-else-if="item.get_gift_state == 4" | |
| 160 | - >商家发货</span | |
| 161 | - > | |
| 162 | - <span v-else-if="item.get_gift_state == 5" | |
| 163 | - >确认收货</span | |
| 164 | - > | |
| 165 | - </div> | |
| 166 | - </div> | |
| 167 | - </div> | |
| 168 | - </div> | |
| 169 | - <div v-show="triangle" class="item_info"> | |
| 93 | + <div v-show="triangle" class="item_info"> | |
| 170 | 94 | <img |
| 171 | 95 | v-if="item && item.goods && item.goods.simg" |
| 172 | 96 | v-lazy="item.goods.simg" |
| ... | ... | @@ -205,13 +129,17 @@ |
| 205 | 129 | </div> |
| 206 | 130 | </div> |
| 207 | 131 | <!-- 展开和折叠按钮 --> |
| 208 | - <div class="fold_box" @click="onLoginMore"> | |
| 132 | + <div class="fold_box" @click.stop="onLoginMore"> | |
| 209 | 133 | <div class="fold"> |
| 210 | - 共五件 <div :class="[triangle?'triangle_top':'triangle_bottom']"> </div> | |
| 134 | + 共五件 | |
| 135 | + <div | |
| 136 | + :class="[ | |
| 137 | + triangle ? 'triangle_top' : 'triangle_bottom' | |
| 138 | + ]" | |
| 139 | + ></div> | |
| 211 | 140 | </div> |
| 212 | 141 | </div> |
| 213 | 142 | </div> |
| 214 | - | |
| 215 | 143 | </div> |
| 216 | 144 | <!-- 您还未收到过礼物哦~--> |
| 217 | 145 | <div v-else class="noGift"> |
| ... | ... | @@ -232,7 +160,7 @@ export default { |
| 232 | 160 | name: "receivingGiftsInfo", |
| 233 | 161 | data() { |
| 234 | 162 | return { |
| 235 | - triangle:false // 三角型号false向下true向上 | |
| 163 | + triangle: false // 三角型号false向下true向上 | |
| 236 | 164 | }; |
| 237 | 165 | }, |
| 238 | 166 | props: ["receivingGiftsInfo", "isData"], |
| ... | ... | @@ -250,14 +178,17 @@ export default { |
| 250 | 178 | onUserInfo(item) { |
| 251 | 179 | this.$emit("onUserInfo", item); |
| 252 | 180 | }, |
| 181 | + // 跳转到商铺详情页 | |
| 182 | + toShopDetails(item) { | |
| 183 | + this.$emit("toShopDetails", item); | |
| 184 | + }, | |
| 253 | 185 | // 跳转到商品订单 |
| 254 | 186 | OrderLink() { |
| 255 | 187 | this.$emit("OrderLink"); |
| 256 | 188 | }, |
| 257 | 189 | // 展开加载更多 |
| 258 | - onLoginMore(){ | |
| 190 | + onLoginMore() { | |
| 259 | 191 | this.triangle = !this.triangle; |
| 260 | - | |
| 261 | 192 | } |
| 262 | 193 | } |
| 263 | 194 | }; | ... | ... |
src/pages/myGiftBox/myGiftBox.vue
| ... | ... | @@ -513,6 +513,23 @@ export default { |
| 513 | 513 | Toast("获取收礼订单列表失败"); |
| 514 | 514 | } |
| 515 | 515 | }, |
| 516 | + // 跳转到店铺详情页 | |
| 517 | + toShopDetails(item) { | |
| 518 | + // 判断并调用通用跳转 | |
| 519 | + if (typeof this.$parent.gotoDetail === "function") { | |
| 520 | + // 临时,设置跳转商品详情参数 | |
| 521 | + Object.assign(item, { | |
| 522 | + type: "43", | |
| 523 | + to: JSON.stringify({ | |
| 524 | + uid: item.user.uid, | |
| 525 | + username: item.user.username, | |
| 526 | + img: item.user.img | |
| 527 | + }), | |
| 528 | + shop_type: "" | |
| 529 | + }); | |
| 530 | + this.$parent.gotoDetail(item); | |
| 531 | + } | |
| 532 | + }, | |
| 516 | 533 | // 跳转到用户详情页 |
| 517 | 534 | onUserInfo(item) { |
| 518 | 535 | // 判断并调用通用跳转 |
| ... | ... | @@ -558,7 +575,7 @@ export default { |
| 558 | 575 | this.$parent.gotoDetail(item); |
| 559 | 576 | } |
| 560 | 577 | }, |
| 561 | - // 送礼列表的商品订单跳转 | |
| 578 | + // 列表的商品订单跳转 | |
| 562 | 579 | OrderLink(){ |
| 563 | 580 | |
| 564 | 581 | }, | ... | ... |