Commit f8ad693018874b2576dc18536775b61cc47ea3bc
1 parent
5274a181
兑换记录填地址
Showing
4 changed files
with
56 additions
and
2 deletions
src/components/addressToast/addressToast.vue
src/pages/pointsExchangeRecords/pointsExchangeRecords.less
| ... | ... | @@ -16,6 +16,7 @@ |
| 16 | 16 | height: 190px; |
| 17 | 17 | } |
| 18 | 18 | .right{ |
| 19 | + flex: 1; | |
| 19 | 20 | margin-left: 32px; |
| 20 | 21 | .name{ |
| 21 | 22 | height: 80px; |
| ... | ... | @@ -47,6 +48,30 @@ |
| 47 | 48 | color: #9B9B9B; |
| 48 | 49 | line-height: 33px; |
| 49 | 50 | } |
| 51 | + .btn-box{ | |
| 52 | + display: flex; | |
| 53 | + justify-content: flex-end; | |
| 54 | + margin-top: 30px; | |
| 55 | + .btn{ | |
| 56 | + width: 157px; | |
| 57 | + height: 50px; | |
| 58 | + border-radius: 26px; | |
| 59 | + border: 1px solid #FC1541; | |
| 60 | + padding:10px 20px; | |
| 61 | + font-size: 24px; | |
| 62 | + color: #FF415F; | |
| 63 | + text-align: center; | |
| 64 | + display: flex; | |
| 65 | + align-items: center; | |
| 66 | + justify-content: center; | |
| 67 | + } | |
| 68 | + img{ | |
| 69 | + display: block; | |
| 70 | + width: 22px; | |
| 71 | + height: 22px; | |
| 72 | + margin: 6px 0 0 4px; | |
| 73 | + } | |
| 74 | + } | |
| 50 | 75 | } |
| 51 | 76 | } |
| 52 | 77 | } | ... | ... |
src/pages/pointsExchangeRecords/pointsExchangeRecords.vue
| ... | ... | @@ -28,6 +28,12 @@ |
| 28 | 28 | <div class="exchange_time"> |
| 29 | 29 | 兑换时间 {{item.create_time*1000 | datetime('yyyy-MM-dd hh:mm:ss')}} |
| 30 | 30 | </div> |
| 31 | + <div v-show="item.shop_type == 1 && !item.address_name && !item.address_name" class="btn-box"> | |
| 32 | + <div @click="addAddressInfo(item)" class="btn"> | |
| 33 | + 填写地址 | |
| 34 | + <img src="static/img/red_right_icon.png" alt=""/> | |
| 35 | + </div> | |
| 36 | + </div> | |
| 31 | 37 | </div> |
| 32 | 38 | </div> |
| 33 | 39 | </div> |
| ... | ... | @@ -39,12 +45,15 @@ |
| 39 | 45 | <div v-show="list.length>0 && isMore ==0" class="is_more"> |
| 40 | 46 | 没有更多了 |
| 41 | 47 | </div> |
| 48 | + <!-- 地址信息组件 --> | |
| 49 | + <address-toast ref="itemsInfo" @toUpdate="updateAddressInfo" v-show="pointsToast_control"></address-toast> | |
| 42 | 50 | </div> |
| 43 | 51 | </template> |
| 44 | 52 | |
| 45 | 53 | <script> |
| 46 | 54 | // 引入组件 |
| 47 | 55 | import { Toast, Indicator } from "mint-ui"; |
| 56 | +import addressToast from "@/components/addressToast/addressToast"; | |
| 48 | 57 | export default { |
| 49 | 58 | data () { |
| 50 | 59 | return { |
| ... | ... | @@ -52,11 +61,13 @@ export default { |
| 52 | 61 | page: 0, |
| 53 | 62 | isMore: 1, // 0没有更多1有更多 |
| 54 | 63 | addressInfo: null, // 暂存已选商品发货地址信息 |
| 55 | - isCall: false // 是否调用接口 | |
| 64 | + isCall: false, // 是否调用接口 | |
| 65 | + pointsToast_control: this.$route.query.pointsToast_control, | |
| 56 | 66 | } |
| 57 | 67 | }, |
| 58 | 68 | //部件 |
| 59 | 69 | components: { |
| 70 | + addressToast | |
| 60 | 71 | }, |
| 61 | 72 | //静态 |
| 62 | 73 | props: [ |
| ... | ... | @@ -85,6 +96,24 @@ export default { |
| 85 | 96 | } |
| 86 | 97 | } |
| 87 | 98 | }, |
| 99 | + // 填写地址 | |
| 100 | + addAddressInfo (item) { | |
| 101 | + // 如果是实物弹起填写地址弹窗 | |
| 102 | + this.pointsToast_control = true; | |
| 103 | + // 礼品兑换弹框派发 | |
| 104 | + this.$refs.itemsInfo.getItemInfo(item, item.id); | |
| 105 | + }, | |
| 106 | + // 填写完地址回调 | |
| 107 | + updateAddressInfo (orderId) { | |
| 108 | + this.list.forEach(item => { | |
| 109 | + let obj = item; | |
| 110 | + for (let key in obj) { | |
| 111 | + if (item.id == orderId) { | |
| 112 | + this.$set(item, "shop_type", 2); | |
| 113 | + } | |
| 114 | + } | |
| 115 | + }); | |
| 116 | + }, | |
| 88 | 117 | // 下拉刷新 |
| 89 | 118 | loadMore () { |
| 90 | 119 | this.loading = true; | ... | ... |
static/img/red_right_icon.png
0 → 100755
357 Bytes