Commit 0d2eed2849c4e6cdb106a918aa11fc4d0f7f6e17
1 parent
5c4e5cb2
礼物分享功能开发
Showing
4 changed files
with
46 additions
and
5 deletions
src/components/giftGivingItem/giftGivingItem.less
| ... | ... | @@ -141,6 +141,16 @@ |
| 141 | 141 | color: #d0021b; |
| 142 | 142 | } |
| 143 | 143 | } |
| 144 | + .btn{ | |
| 145 | + width: 146px; | |
| 146 | + height: 52px; | |
| 147 | + line-height: 52px; | |
| 148 | + border-radius: 8px; | |
| 149 | + text-align: center; | |
| 150 | + font-size: 26px; | |
| 151 | + background: rgba(253, 241, 242, 1); | |
| 152 | + color: #d0021b; | |
| 153 | + } | |
| 144 | 154 | } |
| 145 | 155 | } |
| 146 | 156 | .noGift { | ... | ... |
src/components/giftGivingItem/giftGivingItem.vue
| ... | ... | @@ -77,8 +77,8 @@ |
| 77 | 77 | > |
| 78 | 78 | </div> |
| 79 | 79 | <!-- 按钮 --> |
| 80 | - <div v-show="item.status == 0" class="btn_list"> | |
| 81 | - <div class="box"> | |
| 80 | + <div class="btn_list"> | |
| 81 | + <div v-show="item.status == 0" class="box"> | |
| 82 | 82 | <div |
| 83 | 83 | v-on:click.stop="onCancelPayment(item)" |
| 84 | 84 | class="btn" |
| ... | ... | @@ -89,18 +89,24 @@ |
| 89 | 89 | 立即支付 |
| 90 | 90 | </div> |
| 91 | 91 | </div> |
| 92 | + <!-- 可分享按钮 --> | |
| 93 | + <div class="btn" v-show="item.status == 1" > | |
| 94 | + <div v-on:click.stop="giftToShare(item)" class="active"> | |
| 95 | + 分享礼物 | |
| 96 | + </div> | |
| 97 | + </div> | |
| 92 | 98 | </div> |
| 93 | 99 | </div> |
| 94 | 100 | </div> |
| 95 | 101 | <!-- 您还未送过礼物哦~--> |
| 96 | 102 | <div v-else class="noGift"> |
| 97 | - <div v-if="isData==0" class="box"> | |
| 103 | + <div v-if="isData == 0" class="box"> | |
| 98 | 104 | <img src="static/img/noGifts.png" /> |
| 99 | 105 | <div class="tip">一份礼品 一份轻易</div> |
| 100 | 106 | <div class="desc">您还未送出礼物</div> |
| 101 | 107 | <div class="btn">去购买送礼</div> |
| 102 | 108 | </div> |
| 103 | - <div v-else class="box2"> | |
| 109 | + <div v-else class="box2"> | |
| 104 | 110 | <img src="static/img/noItem.png" /> |
| 105 | 111 | <div class="tip">您还没有相关订单</div> |
| 106 | 112 | </div> |
| ... | ... | @@ -114,7 +120,7 @@ export default { |
| 114 | 120 | data() { |
| 115 | 121 | return {}; |
| 116 | 122 | }, |
| 117 | - props: ["giftGivingItem","isData"], | |
| 123 | + props: ["giftGivingItem", "isData"], | |
| 118 | 124 | created() {}, |
| 119 | 125 | methods: { |
| 120 | 126 | // 跳转到礼物详情页 |
| ... | ... | @@ -128,6 +134,10 @@ export default { |
| 128 | 134 | // 取消订单 |
| 129 | 135 | onCancelPayment(item) { |
| 130 | 136 | this.$emit("onCancelPayment", item); |
| 137 | + }, | |
| 138 | + // 分享礼物 | |
| 139 | + giftToShare(item){ | |
| 140 | + this.$emit("giftToShare", item); | |
| 131 | 141 | } |
| 132 | 142 | } |
| 133 | 143 | }; | ... | ... |
src/pages/myGiftBox/myGiftBox.less
src/pages/myGiftBox/myGiftBox.vue
| ... | ... | @@ -56,6 +56,7 @@ |
| 56 | 56 | @onGiftGiving="onGiftGiving" |
| 57 | 57 | @onCancelPayment="onCancelPayment" |
| 58 | 58 | @jumpToPay="jumpToPay" |
| 59 | + @giftToShare="giftToShare" | |
| 59 | 60 | v-show="active != 0 && active == 1" |
| 60 | 61 | :giftGivingItem="giftGivingItem" |
| 61 | 62 | :isData="this.giftGiving.isData" |
| ... | ... | @@ -740,7 +741,23 @@ export default { |
| 740 | 741 | this.$set(ext.item, "status", "1"); |
| 741 | 742 | } |
| 742 | 743 | } |
| 744 | + }, | |
| 745 | + /** | |
| 746 | + * 调用原生分享礼物 | |
| 747 | + */ | |
| 748 | + giftToShare(item){ | |
| 749 | + // 判断并调用通用跳转 | |
| 750 | + if (typeof this.$parent.toShare === "function") { | |
| 751 | + /** | |
| 752 | + * App内拉起分享 | |
| 753 | + * @param {int} type [分享类型] | |
| 754 | + * @param {int} id [页面id] | |
| 755 | + * @param {object} ext [分享扩展参数,可选参数] | |
| 756 | + */ | |
| 757 | + this.$parent.toShare('8',item.id,); | |
| 758 | + } | |
| 743 | 759 | } |
| 760 | + | |
| 744 | 761 | } |
| 745 | 762 | }; |
| 746 | 763 | </script> | ... | ... |