Commit b7f71db551a4dcd81cf5e92e1735d914131d23ec
Merge branch 'version_2.0.0_optimization_mall_update' of http://bj.gitlab.cnlive…
….com/w-front-end/select_good into version_2.0.0_optimization_mall_update
Showing
4 changed files
with
91 additions
and
9 deletions
src/components/goodsItem_2/goodsItem_2.vue
| @@ -9,7 +9,7 @@ | @@ -9,7 +9,7 @@ | ||
| 9 | <div class="content-box"> | 9 | <div class="content-box"> |
| 10 | 10 | ||
| 11 | <!-- 因积分商城需要显示白色灰色字体标示 --> | 11 | <!-- 因积分商城需要显示白色灰色字体标示 --> |
| 12 | - <div class="title" :class="{'grey': item.num ? true : false, 'align-center': pid == '5'}" v-if="pid == undefined || pid == '1' || pid == '3' || pid == '4' || pid == '5'">{{item.title}}</div> | 12 | + <div class="title" :class="{'grey': item.num, 'align-center': pid == '5' || item.num}" v-if="pid == undefined || pid == '1' || pid == '3' || pid == '4' || pid == '5'">{{item.title}}</div> |
| 13 | 13 | ||
| 14 | <!-- 因积分商城不价格所有加上 !item.grade判断 --> | 14 | <!-- 因积分商城不价格所有加上 !item.grade判断 --> |
| 15 | <div class="price-box" v-if="pid != '5' && !item.num"> | 15 | <div class="price-box" v-if="pid != '5' && !item.num"> |
src/pages/goodDetails/goodDetails.vue
| @@ -53,7 +53,7 @@ | @@ -53,7 +53,7 @@ | ||
| 53 | <div class="good-title"> | 53 | <div class="good-title"> |
| 54 | <span class="left"></span>商品详情<span class="right"></span> | 54 | <span class="left"></span>商品详情<span class="right"></span> |
| 55 | </div> | 55 | </div> |
| 56 | - <div v-if="goodsInfo && goodsInfo.content" v-html="goodsInfo.content" class="good-desc"> | 56 | + <div v-if="goodsInfo && goodsInfo.content" v-html="goodsInfo.content" class="good-desc html_box"> |
| 57 | </div> | 57 | </div> |
| 58 | <div class="good-title"> | 58 | <div class="good-title"> |
| 59 | <span class="left"></span>兑换规则<span class="right"></span> | 59 | <span class="left"></span>兑换规则<span class="right"></span> |
| @@ -103,7 +103,7 @@ | @@ -103,7 +103,7 @@ | ||
| 103 | </div> | 103 | </div> |
| 104 | </div> | 104 | </div> |
| 105 | <!-- 地址信息组件 --> | 105 | <!-- 地址信息组件 --> |
| 106 | - <address-toast ref="itemsInfo" @toUpdate="getGoodsInfo" v-show="pointsToast_control"></address-toast> | 106 | + <address-toast ref="itemsInfo" @toUpdate="toLinkPointsMall" v-show="pointsToast_control"></address-toast> |
| 107 | </div> | 107 | </div> |
| 108 | </template> | 108 | </template> |
| 109 | 109 | ||
| @@ -147,9 +147,30 @@ export default { | @@ -147,9 +147,30 @@ export default { | ||
| 147 | methods: { | 147 | methods: { |
| 148 | // 跳转网家家购买音频协议 | 148 | // 跳转网家家购买音频协议 |
| 149 | toLink () { | 149 | toLink () { |
| 150 | - window.location.href = "https://wjj.ys1.cnliveimg.com/term/liveFwxy.html" | 150 | + if (this.isCNLive.value) { |
| 151 | + // 跳转封装 | ||
| 152 | + if (typeof this.$parent.gotoDetail === 'function') { | ||
| 153 | + // 设置跳转参数 | ||
| 154 | + let params = { | ||
| 155 | + type: '34', | ||
| 156 | + to: "https://wjj.ys1.cnliveimg.com/term/liveFwxy.html?type=web", | ||
| 157 | + shop_type: '' | ||
| 158 | + }; | ||
| 159 | + // 页面跳转 | ||
| 160 | + this.$parent.gotoDetail(params); | ||
| 161 | + } | ||
| 162 | + } else { | ||
| 163 | + this.$parent.callApps(); | ||
| 164 | + } | ||
| 165 | + }, | ||
| 166 | + toLinkPointsMall () { | ||
| 167 | + this.$router.push({ | ||
| 168 | + path: '/pointsMall', | ||
| 169 | + query: { | ||
| 170 | + uid: this.getStore("uid") | ||
| 171 | + } | ||
| 172 | + }) | ||
| 151 | }, | 173 | }, |
| 152 | - | ||
| 153 | /** | 174 | /** |
| 154 | * 后退 | 175 | * 后退 |
| 155 | */ | 176 | */ |
| @@ -170,7 +191,6 @@ export default { | @@ -170,7 +191,6 @@ export default { | ||
| 170 | * @param {Object} item [数据对象] | 191 | * @param {Object} item [数据对象] |
| 171 | */ | 192 | */ |
| 172 | toDetail (item) { | 193 | toDetail (item) { |
| 173 | - console.log(item.id); | ||
| 174 | if (this.isCNLive.value) { | 194 | if (this.isCNLive.value) { |
| 175 | // 跳转封装 | 195 | // 跳转封装 |
| 176 | if (typeof this.$parent.gotoDetail === 'function') { | 196 | if (typeof this.$parent.gotoDetail === 'function') { |
| @@ -423,3 +443,10 @@ export default { | @@ -423,3 +443,10 @@ export default { | ||
| 423 | @import './goodDetails.less'; | 443 | @import './goodDetails.less'; |
| 424 | </style> | 444 | </style> |
| 425 | 445 | ||
| 446 | +<style> | ||
| 447 | +.html_box img { | ||
| 448 | + display: block; | ||
| 449 | + width: 100%; | ||
| 450 | +} | ||
| 451 | +</style> | ||
| 452 | + |
src/pages/pointsMall/pointsMall.less
| @@ -10,6 +10,11 @@ | @@ -10,6 +10,11 @@ | ||
| 10 | height: 93px; | 10 | height: 93px; |
| 11 | } | 11 | } |
| 12 | } | 12 | } |
| 13 | +// 列表 | ||
| 14 | +.column-list-box{ | ||
| 15 | + display: flex; | ||
| 16 | + justify-content: center; | ||
| 17 | +} | ||
| 13 | .hide{ | 18 | .hide{ |
| 14 | display:none; | 19 | display:none; |
| 15 | } | 20 | } |
| @@ -19,6 +24,10 @@ | @@ -19,6 +24,10 @@ | ||
| 19 | } | 24 | } |
| 20 | .back-box{ | 25 | .back-box{ |
| 21 | background-color: transparent; | 26 | background-color: transparent; |
| 27 | + position: fixed; | ||
| 28 | + top: 0; | ||
| 29 | + left:0; | ||
| 30 | + z-index: 2; | ||
| 22 | } | 31 | } |
| 23 | .main_box{ | 32 | .main_box{ |
| 24 | width: 100%; | 33 | width: 100%; |
src/pages/pointsMall/pointsMall.vue
| @@ -12,11 +12,13 @@ | @@ -12,11 +12,13 @@ | ||
| 12 | <!-- pl --> | 12 | <!-- pl --> |
| 13 | <div class="pl" :class="{'is-open-app': $parent.isOpenApp.value, 'hide': $route.query.hideBack == true}"></div> | 13 | <div class="pl" :class="{'is-open-app': $parent.isOpenApp.value, 'hide': $route.query.hideBack == true}"></div> |
| 14 | <div class="main_box"> | 14 | <div class="main_box"> |
| 15 | + <!-- pl --> | ||
| 16 | + <div class="pl" :class="{'is-cnlive': isCNLive.value, 'hide': $route.query.hideBack == true}"></div> | ||
| 15 | <back-box | 17 | <back-box |
| 16 | v-if="isCNLive.value" | 18 | v-if="isCNLive.value" |
| 17 | :class="{'hide': $route.query.hideBack == true}" | 19 | :class="{'hide': $route.query.hideBack == true}" |
| 18 | class="back-box" | 20 | class="back-box" |
| 19 | - :style="'padding-top: ' + $parent.top.value + 'px'" | 21 | + :style="'padding-top: ' + $parent.top.value + 'px; background-color: rgba(255, 248, 232, ' + opacity + ')'" ref="navBox" |
| 20 | @back="back" | 22 | @back="back" |
| 21 | :backs="backs"> | 23 | :backs="backs"> |
| 22 | </back-box> | 24 | </back-box> |
| @@ -43,7 +45,7 @@ | @@ -43,7 +45,7 @@ | ||
| 43 | <div class="earn_points_box"> | 45 | <div class="earn_points_box"> |
| 44 | <img class="earn_icon" src="static/img/points_icon_pice.png" alt=""> | 46 | <img class="earn_icon" src="static/img/points_icon_pice.png" alt=""> |
| 45 | <div class="desc">赚取更多积分,兑换精美礼品~</div> | 47 | <div class="desc">赚取更多积分,兑换精美礼品~</div> |
| 46 | - <div @click="jumpClientIntegralList" class="btn">赚取积分 <img class="earn_right_back" src="static/img/points_icon_white_right.png" alt=""/></div> | 48 | + <div @click="jumpClientIntegralList" class="btn">赚积分 <img class="earn_right_back" src="static/img/points_icon_white_right.png" alt=""/></div> |
| 47 | </div> | 49 | </div> |
| 48 | </div> | 50 | </div> |
| 49 | <!-- 为你推荐 --> | 51 | <!-- 为你推荐 --> |
| @@ -123,6 +125,7 @@ export default { | @@ -123,6 +125,7 @@ export default { | ||
| 123 | name: 'pointsmall', | 125 | name: 'pointsmall', |
| 124 | data () { | 126 | data () { |
| 125 | return { | 127 | return { |
| 128 | + opacity: 0, // 透明度 | ||
| 126 | title: "", // 标题 | 129 | title: "", // 标题 |
| 127 | backs: null, // 后退按钮组 | 130 | backs: null, // 后退按钮组 |
| 128 | navs: null, // 导航 | 131 | navs: null, // 导航 |
| @@ -313,6 +316,47 @@ export default { | @@ -313,6 +316,47 @@ export default { | ||
| 313 | Toast(res.message); | 316 | Toast(res.message); |
| 314 | } | 317 | } |
| 315 | }, | 318 | }, |
| 319 | + | ||
| 320 | + /** | ||
| 321 | +* 滚动条滚动/touchmove监听处理 | ||
| 322 | +* @param {object} e [滚动条对象] | ||
| 323 | +* @param {boolean} isTimeout [是否为setTimeout方法调用] | ||
| 324 | +*/ | ||
| 325 | + onPageScrollFun (e, isTimeout = false) { | ||
| 326 | + | ||
| 327 | + // 获取滚动条位置,浏览器兼容处理 | ||
| 328 | + let scrollTop = (document.documentElement.scrollTop || document.body.scrollTop) || 0; | ||
| 329 | + | ||
| 330 | + // 滚动控制高度 | ||
| 331 | + let maxHeight = 200; | ||
| 332 | + | ||
| 333 | + // 动态获取百分比分配比例 | ||
| 334 | + if (typeof this.$refs === "object" && typeof this.$refs.navBox === "object" && typeof this.$refs.navBox.clientHeight === "number") { | ||
| 335 | + maxHeight = (this.$refs.navBox.clientHeight + this.$parent.top.value) * 2; | ||
| 336 | + } | ||
| 337 | + | ||
| 338 | + if (scrollTop >= 0 && scrollTop <= maxHeight) { | ||
| 339 | + this.opacity = scrollTop / maxHeight; | ||
| 340 | + } else if (scrollTop > maxHeight) { | ||
| 341 | + this.opacity = 1; | ||
| 342 | + } else { | ||
| 343 | + this.opacity = 0; | ||
| 344 | + } | ||
| 345 | + | ||
| 346 | + if (!isTimeout) { | ||
| 347 | + | ||
| 348 | + if (this.timer) { | ||
| 349 | + clearTimeout(this.timer); | ||
| 350 | + } | ||
| 351 | + | ||
| 352 | + // 倒计时校正滚动条位置 | ||
| 353 | + this.timer = setTimeout(function (options) { | ||
| 354 | + | ||
| 355 | + // 递归 | ||
| 356 | + options.context.onPageScrollFun(options.e, true); | ||
| 357 | + }, 1000, { e, context: this }); | ||
| 358 | + } | ||
| 359 | + } | ||
| 316 | }, | 360 | }, |
| 317 | head: { | 361 | head: { |
| 318 | title () { | 362 | title () { |
| @@ -374,7 +418,7 @@ export default { | @@ -374,7 +418,7 @@ export default { | ||
| 374 | }); | 418 | }); |
| 375 | 419 | ||
| 376 | // 设置标题 | 420 | // 设置标题 |
| 377 | - this.$set(this.backs, 'title', '优选'); | 421 | + this.$set(this.backs, 'title', '积分商城'); |
| 378 | } | 422 | } |
| 379 | // 获取商品信息接口 | 423 | // 获取商品信息接口 |
| 380 | this.integralMallIndex(); | 424 | this.integralMallIndex(); |
| @@ -391,6 +435,8 @@ export default { | @@ -391,6 +435,8 @@ export default { | ||
| 391 | }); | 435 | }); |
| 392 | } | 436 | } |
| 393 | } | 437 | } |
| 438 | + // 监听滚动条,设置滚动条推动渐变颜色和图片 | ||
| 439 | + window.addEventListener("scroll", this.onPageScrollFun, true); | ||
| 394 | } | 440 | } |
| 395 | } | 441 | } |
| 396 | </script> | 442 | </script> |