Commit b7f71db551a4dcd81cf5e92e1735d914131d23ec

Authored by 王强
2 parents a1e7e3c7 d77b4f8b

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
src/components/goodsItem_2/goodsItem_2.vue
... ... @@ -9,7 +9,7 @@
9 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 14 <!-- 因积分商城不价格所有加上 !item.grade判断 -->
15 15 <div class="price-box" v-if="pid != '5' && !item.num">
... ...
src/pages/goodDetails/goodDetails.vue
... ... @@ -53,7 +53,7 @@
53 53 <div class="good-title">
54 54 <span class="left"></span>商品详情<span class="right"></span>
55 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 57 </div>
58 58 <div class="good-title">
59 59 <span class="left"></span>兑换规则<span class="right"></span>
... ... @@ -103,7 +103,7 @@
103 103 </div>
104 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 107 </div>
108 108 </template>
109 109  
... ... @@ -147,9 +147,30 @@ export default {
147 147 methods: {
148 148 // 跳转网家家购买音频协议
149 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 191 * @param {Object} item [数据对象]
171 192 */
172 193 toDetail (item) {
173   - console.log(item.id);
174 194 if (this.isCNLive.value) {
175 195 // 跳转封装
176 196 if (typeof this.$parent.gotoDetail === 'function') {
... ... @@ -423,3 +443,10 @@ export default {
423 443 @import './goodDetails.less';
424 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 10 height: 93px;
11 11 }
12 12 }
  13 +// 列表
  14 +.column-list-box{
  15 + display: flex;
  16 + justify-content: center;
  17 +}
13 18 .hide{
14 19 display:none;
15 20 }
... ... @@ -19,6 +24,10 @@
19 24 }
20 25 .back-box{
21 26 background-color: transparent;
  27 + position: fixed;
  28 + top: 0;
  29 + left:0;
  30 + z-index: 2;
22 31 }
23 32 .main_box{
24 33 width: 100%;
... ...
src/pages/pointsMall/pointsMall.vue
... ... @@ -12,11 +12,13 @@
12 12 <!-- pl -->
13 13 <div class="pl" :class="{'is-open-app': $parent.isOpenApp.value, 'hide': $route.query.hideBack == true}"></div>
14 14 <div class="main_box">
  15 + <!-- pl -->
  16 + <div class="pl" :class="{'is-cnlive': isCNLive.value, 'hide': $route.query.hideBack == true}"></div>
15 17 <back-box
16 18 v-if="isCNLive.value"
17 19 :class="{'hide': $route.query.hideBack == true}"
18 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 22 @back="back"
21 23 :backs="backs">
22 24 </back-box>
... ... @@ -43,7 +45,7 @@
43 45 <div class="earn_points_box">
44 46 <img class="earn_icon" src="static/img/points_icon_pice.png" alt="">
45 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 49 </div>
48 50 </div>
49 51 <!-- 为你推荐 -->
... ... @@ -123,6 +125,7 @@ export default {
123 125 name: 'pointsmall',
124 126 data () {
125 127 return {
  128 + opacity: 0, // 透明度
126 129 title: "", // 标题
127 130 backs: null, // 后退按钮组
128 131 navs: null, // 导航
... ... @@ -313,6 +316,47 @@ export default {
313 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 361 head: {
318 362 title () {
... ... @@ -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 424 this.integralMallIndex();
... ... @@ -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 442 </script>
... ...