Commit e7ee243fd5478394e29b060352f8e59007567637
1 parent
5ea9febc
党建积分商城兑换
Showing
3 changed files
with
201 additions
and
3 deletions
src/pages/partyBuildingGoodDetails/partyBuildingGoodDetails.vue
src/pages/partyBuildingPointsMall/partyBuildingPointsMall.less
| ... | ... | @@ -26,6 +26,89 @@ |
| 26 | 26 | height: 93px; |
| 27 | 27 | } |
| 28 | 28 | } |
| 29 | + // 头部 | |
| 30 | + .top_main{ | |
| 31 | + margin:40px 30px; | |
| 32 | + padding: 30px; | |
| 33 | + background: #FFFFFF; | |
| 34 | + box-shadow: 0px 0px 24px 0px rgba(0, 0, 0, 0.06); | |
| 35 | + border-radius: 24px; | |
| 36 | + .top{ | |
| 37 | + display: flex; | |
| 38 | + justify-content: space-between; | |
| 39 | + .left{ | |
| 40 | + height: 40px; | |
| 41 | + font-size: 28px; | |
| 42 | + font-weight: 400; | |
| 43 | + color: #45270D; | |
| 44 | + line-height: 40px; | |
| 45 | + span{ | |
| 46 | + margin-left: 8px; | |
| 47 | + height: 40px; | |
| 48 | + font-size: 28px; | |
| 49 | + font-weight: 500; | |
| 50 | + color: #F5A623; | |
| 51 | + line-height: 40px; | |
| 52 | + } | |
| 53 | + } | |
| 54 | + .right{ | |
| 55 | + height: 33px; | |
| 56 | + font-size: 24px; | |
| 57 | + font-weight: 400; | |
| 58 | + color: #999999; | |
| 59 | + line-height: 33px; | |
| 60 | + display: flex; | |
| 61 | + justify-content: center; | |
| 62 | + align-items: center; | |
| 63 | + .back_right_iocn{ | |
| 64 | + display: block; | |
| 65 | + width: 20px; | |
| 66 | + height:20px; | |
| 67 | + margin-left: 10px; | |
| 68 | + } | |
| 69 | + } | |
| 70 | + } | |
| 71 | + //赚取积分 | |
| 72 | + .earn_points_box{ | |
| 73 | + height: 90px; | |
| 74 | + background: #FFF8E8; | |
| 75 | + border-radius: 12px; | |
| 76 | + display:flex; | |
| 77 | + justify-content: space-between; | |
| 78 | + align-items: center; | |
| 79 | + padding: 20px 20px; | |
| 80 | + margin-top: 20px; | |
| 81 | + .earn_icon{ | |
| 82 | + display: block; | |
| 83 | + width: 36px; | |
| 84 | + height:36px; | |
| 85 | + } | |
| 86 | + .desc{ | |
| 87 | + height: 90px; | |
| 88 | + font-size: 26px; | |
| 89 | + font-weight: 400; | |
| 90 | + color: #746037; | |
| 91 | + line-height: 90px; | |
| 92 | + } | |
| 93 | + .btn{ | |
| 94 | + font-size: 24px; | |
| 95 | + padding: 0 20px; | |
| 96 | + height: 50px; | |
| 97 | + background: #DAB277; | |
| 98 | + border-radius: 26px; | |
| 99 | + color: #fff; | |
| 100 | + text-align: center; | |
| 101 | + display: flex; | |
| 102 | + align-items: center; | |
| 103 | + .earn_right_back{ | |
| 104 | + display: block; | |
| 105 | + width: 9px; | |
| 106 | + height: 18px; | |
| 107 | + margin-left: 8px; | |
| 108 | + } | |
| 109 | + } | |
| 110 | + } | |
| 111 | + } | |
| 29 | 112 | .back-box{ |
| 30 | 113 | background-color: #FFF; |
| 31 | 114 | position:fixed; | ... | ... |
src/pages/partyBuildingPointsMall/partyBuildingPointsMall.vue
| ... | ... | @@ -18,6 +18,34 @@ |
| 18 | 18 | :style="'padding-top: ' + $parent.top.value + 'px'" |
| 19 | 19 | :class="{'is-cnlive': isCNLive.value, 'is-open-app': $parent.isOpenApp.value, 'hide': $route.query.hideBack == true}"></div> |
| 20 | 20 | <!-- 商品样式 7 列表 --> |
| 21 | + <div class="top_main"> | |
| 22 | + <!-- 头部 --> | |
| 23 | + <div class="top"> | |
| 24 | + <div class="left"> | |
| 25 | + 我的积分: | |
| 26 | + <span>{{myGrade || 0}}</span> | |
| 27 | + </div> | |
| 28 | + <div @click="toExchangeRecord" | |
| 29 | + class="right"> | |
| 30 | + 兑换记录 | |
| 31 | + <!-- 返回图标 --> | |
| 32 | + <img class="back_right_iocn" | |
| 33 | + src="static/img/points_icon_grey_right.png" | |
| 34 | + alt="" /> | |
| 35 | + </div> | |
| 36 | + </div> | |
| 37 | + <!--积分赚取 --> | |
| 38 | + <div class="earn_points_box"> | |
| 39 | + <img class="earn_icon" | |
| 40 | + src="static/img/points_icon_pice.png" | |
| 41 | + alt=""> | |
| 42 | + <div class="desc">赚取更多积分,兑换精美礼品~</div> | |
| 43 | + <div @click="jumpClientIntegralList" | |
| 44 | + class="btn">赚积分 <img class="earn_right_back" | |
| 45 | + src="static/img/points_icon_white_right.png" | |
| 46 | + alt="" /></div> | |
| 47 | + </div> | |
| 48 | + </div> | |
| 21 | 49 | <div class="gift_main_box" |
| 22 | 50 | v-if="phyicalGoods && phyicalGoods.list && phyicalGoods.list.length" |
| 23 | 51 | infinite-scroll-immediate-check="true" |
| ... | ... | @@ -54,6 +82,7 @@ export default { |
| 54 | 82 | name: 'morePoints', |
| 55 | 83 | data () { |
| 56 | 84 | return { |
| 85 | + myGrade: 0, // 我的积分 | |
| 57 | 86 | title: "积分商城", // 标题 |
| 58 | 87 | backs: null, // 后退按钮组 |
| 59 | 88 | loading: true, |
| ... | ... | @@ -95,6 +124,22 @@ export default { |
| 95 | 124 | }, |
| 96 | 125 | //方法表示一个具体的操作,主要书写业务逻辑; |
| 97 | 126 | methods: { |
| 127 | + /** | |
| 128 | + * 跳转到兑换记录详情页 | |
| 129 | + * @param {Object} item [数据对象] | |
| 130 | + */ | |
| 131 | + toExchangeRecord () { | |
| 132 | + // 校验登录 | |
| 133 | + if (this.$parent.checkLogin()) { | |
| 134 | + this.$router.push({ | |
| 135 | + path: '/pointsExchangeRecords', | |
| 136 | + query: { | |
| 137 | + uid: this.getStore("uid"), | |
| 138 | + type: 3 // 1亲子嘉年华 2 康疫健步 3 积分商城 4 脐橙 7 健康商城 | |
| 139 | + } | |
| 140 | + }) | |
| 141 | + } | |
| 142 | + }, | |
| 98 | 143 | /** |
| 99 | 144 | * 上拉加载 |
| 100 | 145 | */ |
| ... | ... | @@ -198,7 +243,75 @@ export default { |
| 198 | 243 | } |
| 199 | 244 | } |
| 200 | 245 | }, |
| 246 | + /** | |
| 247 | + * 跳转赚取积分页面 | |
| 248 | + * @param {Object} item [数据对象] | |
| 249 | + */ | |
| 250 | + jumpClientIntegralList () { | |
| 251 | + // 判断APP内 | |
| 252 | + if (this.isCNLive.value) { | |
| 253 | + // 校验登录 | |
| 254 | + if (this.$parent.checkLogin()) { | |
| 255 | + // (判断app内是否有该方法) | |
| 256 | + if (window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.jumpClientIntegralList) { | |
| 257 | + // 跳转到原生的任务列表 | |
| 258 | + window.webkit.messageHandlers.jumpClientIntegralList.postMessage({ body: {} }); | |
| 259 | + } else if (window.obj && window.obj.jumpClientIntegralList) { | |
| 260 | + // 跳转到原生的任务列表 | |
| 261 | + window.obj.jumpClientIntegralList(); | |
| 262 | + } | |
| 263 | + } | |
| 264 | + } else { | |
| 265 | + this.$parent.callApp(); | |
| 266 | + } | |
| 267 | + }, | |
| 268 | + // 积分商场首页 | |
| 269 | + /** | |
| 270 | + * 获取积分商场首页信息 | |
| 271 | + * * @param {string} uid [用户id] | |
| 272 | + */ | |
| 273 | + integralMallIndex () { | |
| 274 | + | |
| 275 | + // 加载中提示 | |
| 276 | + Indicator.open('加载中...'); | |
| 277 | + | |
| 278 | + // 请求接口 | |
| 279 | + this.http("/Api/" + (this.getApiVersion().LuckDraw) + "/integralNewIndex", { | |
| 280 | + uid: this.getStore("uid"), | |
| 281 | + goods_id:this.$route.query.user_selected_goods_id || 0 // 记录从优选库那个商品点击进入进来的 | |
| 282 | + }, this.integralMallIndexCallback, { | |
| 283 | + method: "POST" | |
| 284 | + }); | |
| 285 | + }, | |
| 286 | + | |
| 287 | + /** | |
| 288 | + * 获取积分商场首页信息 | |
| 289 | + * @param {object} res [服务器返回数据] | |
| 290 | + * @param {object} ext [扩展参数] | |
| 291 | + */ | |
| 292 | + integralMallIndexCallback (res, ext) { | |
| 293 | + | |
| 294 | + // 加载完成 | |
| 295 | + Indicator.close(); | |
| 296 | + | |
| 297 | + // 返回处理 | |
| 298 | + if (res.code == 200) { | |
| 201 | 299 | |
| 300 | + // 解构数据 | |
| 301 | + let { data: datas } = res; | |
| 302 | + this.info = datas | |
| 303 | + /* 积分商场首页信息 开始 */ | |
| 304 | + /*用户信息 */ | |
| 305 | + this.$set(this, "myGrade", datas.grade); | |
| 306 | + } else if (res.code == 400) { | |
| 307 | + | |
| 308 | + // 获取积分商场首页信息失败 | |
| 309 | + Toast(res.message || "获取积分商场首页信息失败"); | |
| 310 | + } else { | |
| 311 | + // 获取积分商场首页信息失败 | |
| 312 | + Toast(res.message); | |
| 313 | + } | |
| 314 | + }, | |
| 202 | 315 | /** |
| 203 | 316 | * 后退 |
| 204 | 317 | */ |
| ... | ... | @@ -231,7 +344,7 @@ export default { |
| 231 | 344 | }, |
| 232 | 345 | //请求数据 |
| 233 | 346 | created () { |
| 234 | - // 抽奖记录 | |
| 347 | + // 加载商品列表 | |
| 235 | 348 | this.getIntegralNewGoodsList(this.page); |
| 236 | 349 | |
| 237 | 350 | // 判断是否在App内 |
| ... | ... | @@ -255,7 +368,8 @@ export default { |
| 255 | 368 | /*设置标题 */ |
| 256 | 369 | this.$set(this.backs, 'title', "积分商城"); |
| 257 | 370 | } |
| 258 | - | |
| 371 | + // 获取积分商城商品信息接口 | |
| 372 | + this.integralMallIndex(); | |
| 259 | 373 | }, |
| 260 | 374 | mounted () { |
| 261 | 375 | // 如果是App外,设置唤起App和微信内分享参数 | ... | ... |