Authored by yyq

Merge branch 'feature/scroll' into develop

Showing 45 changed files with 429 additions and 185 deletions
1 <template> 1 <template>
2 - <CubeScroll v-if="dialogEnable" class="third-bind-wrapper"> 2 + <div v-if="dialogEnable" class="third-bind-wrapper">
3 <div class="bind-dialog"> 3 <div class="bind-dialog">
4 <p class="bind-title">为了提供有效服务<br>请关联手机号</p> 4 <p class="bind-title">为了提供有效服务<br>请关联手机号</p>
5 <div class="under-row"> 5 <div class="under-row">
@@ -20,12 +20,12 @@ @@ -20,12 +20,12 @@
20 <CubeButton class="bind-btn" :disabled="submitDisable" @click="bindSubmit">登录</CubeButton> 20 <CubeButton class="bind-btn" :disabled="submitDisable" @click="bindSubmit">登录</CubeButton>
21 </div> 21 </div>
22 </div> 22 </div>
23 - </CubeScroll> 23 + </div>
24 </template> 24 </template>
25 25
26 <script> 26 <script>
27 27
28 -import { Button, Scroll, Input } from 'cube-ui'; 28 +import { Button, Input } from 'cube-ui';
29 import { mapActions, mapState, mapMutations } from 'vuex'; 29 import { mapActions, mapState, mapMutations } from 'vuex';
30 30
31 export default { 31 export default {
@@ -140,7 +140,6 @@ export default { @@ -140,7 +140,6 @@ export default {
140 } 140 }
141 }, 141 },
142 components: { 142 components: {
143 - CubeScroll: Scroll,  
144 CubeInput: Input, 143 CubeInput: Input,
145 CubeButton: Button 144 CubeButton: Button
146 } 145 }
1 import LayoutApp from './layout/layout-app'; 1 import LayoutApp from './layout/layout-app';
2 import LayoutHeader from './layout/layout-header'; 2 import LayoutHeader from './layout/layout-header';
3 import LayoutLink from './layout/layout-link'; 3 import LayoutLink from './layout/layout-link';
  4 +import LayoutScroll from './layout/layout-scroll';
4 import Images from './images'; 5 import Images from './images';
5 import YohoButton from './button'; 6 import YohoButton from './button';
6 import CountCircle from './count-circle'; 7 import CountCircle from './count-circle';
@@ -9,6 +10,7 @@ export default [ @@ -9,6 +10,7 @@ export default [
9 LayoutApp, 10 LayoutApp,
10 LayoutHeader, 11 LayoutHeader,
11 LayoutLink, 12 LayoutLink,
  13 + LayoutScroll,
12 ...Images, 14 ...Images,
13 YohoButton, 15 YohoButton,
14 ...CountCircle 16 ...CountCircle
1 <template> 1 <template>
2 - <div ref="layout" class="layout"> 2 + <div
  3 + ref="layout"
  4 + class="layout"
  5 + @touchstart="webviewScrollStart"
  6 + @touchmove="webviewScrollMove"
  7 + @touchend="webviewScrollEnd">
3 <slot name="header"> 8 <slot name="header">
4 <LayoutHeader 9 <LayoutHeader
5 v-if="!hideHeader" 10 v-if="!hideHeader"
@@ -60,14 +65,15 @@ export default { @@ -60,14 +65,15 @@ export default {
60 this.touchStartY = e.changedTouches[0].pageY; 65 this.touchStartY = e.changedTouches[0].pageY;
61 }, 66 },
62 webviewScrollMove(e) { 67 webviewScrollMove(e) {
63 - if (this.isTouchStart && !this.isStop) { 68 + if (this.isTouchStart && this.isStop) {
64 let scrollTop = this.$refs.layout.scrollTop; 69 let scrollTop = this.$refs.layout.scrollTop;
65 70
66 this.touchMoveY = e.changedTouches[0].pageY; 71 this.touchMoveY = e.changedTouches[0].pageY;
67 if (scrollTop <= 0 && this.touchMoveY > this.touchStartY) { 72 if (scrollTop <= 0 && this.touchMoveY > this.touchStartY) {
68 73
69 - e.stopPropagation();  
70 - e.preventDefault(); 74 +
  75 + e.stopPropagation && e.stopPropagation();
  76 + e.preventDefault && e.preventDefault();
71 77
72 } 78 }
73 } 79 }
  1 +<template>
  2 + <div class="layout-scroll">
  3 + <div class="layout-scroll-main" ref="scroll">
  4 + <slot></slot>
  5 + <div v-if="loading && !loading.hide" class="loading">
  6 + <p v-if="loading.noMore" class="load-text">没有更多了</p>
  7 + <Loading v-else :size="20"></Loading>
  8 + </div>
  9 + </div>
  10 + </div>
  11 +</template>
  12 +
  13 +<script>
  14 +import {throttle} from 'lodash';
  15 +import {Loading} from 'cube-ui';
  16 +
  17 +const EVENT_SCROLL = 'scroll';
  18 +
  19 +export default {
  20 + name: 'LayoutScroll',
  21 + data() {
  22 + return {
  23 + noMore: false
  24 + };
  25 + },
  26 + props: {
  27 + loading: Object
  28 + },
  29 + mounted() {
  30 + this._forceUpdate = throttle(this.forceUpdate.bind(this), 500);
  31 + this._onPullingUp = throttle(this.onPullingUp.bind(this), 1000);
  32 +
  33 + let supportsPassive = false;
  34 +
  35 + try {
  36 + const opts = Object.defineProperty({}, 'passive', {
  37 + get() {
  38 + supportsPassive = true;
  39 + return true;
  40 + }
  41 + });
  42 +
  43 + window.addEventListener('test', null, opts);
  44 + } catch (e) {} //eslint-disable-line
  45 + this.$el.addEventListener(EVENT_SCROLL, this.onScroll, supportsPassive ? { passive: true } : false);
  46 + },
  47 + beforeDestroy() {
  48 + this.$el.removeEventListener(EVENT_SCROLL, this.onScroll);
  49 + },
  50 + methods: {
  51 + scrollTo() {
  52 + let top = arguments[1] || arguments[0];
  53 +
  54 + this.$el.scrollTop = Math.abs(top);
  55 + },
  56 + onScroll() {
  57 + let top = this.$el.scrollTop;
  58 +
  59 + if (this.lastTop === top) {
  60 + return;
  61 + }
  62 +
  63 + this._forceUpdate();
  64 +
  65 + this.lastTop = top;
  66 + this.$emit('scroll', {y: -top});
  67 +
  68 + this.scrollTimer && clearTimeout(this.scrollTimer);
  69 + this.scrollTimer = setTimeout(this.onScrollEnd.bind(this), 400);
  70 +
  71 + if (this.scrollHeight - top < this.$el.offsetHeight * 2) {
  72 + this._onPullingUp();
  73 + }
  74 + },
  75 + onScrollEnd() {
  76 + this.$emit('scroll-end', {y: -this.$el.scrollTop});
  77 + },
  78 + onPullingUp() {
  79 + this.$emit('pulling-up');
  80 + },
  81 + forceUpdate() {
  82 + this.scrollHeight = this.$refs.scroll.offsetHeight;
  83 + }
  84 + },
  85 + components: {
  86 + Loading
  87 + }
  88 +};
  89 +</script>
  90 +
  91 +<style lang="scss" scoped>
  92 +.layout-scroll {
  93 + height: 100%;
  94 + overflow-x: hidden;
  95 + overflow-y: auto;
  96 + -webkit-overflow-scrolling: touch;
  97 + position: relative;
  98 + z-index: 0;
  99 +}
  100 +
  101 +.layout-scroll-main {
  102 + min-height: 100%;
  103 +}
  104 +
  105 +.loading {
  106 + padding: 20px 0;
  107 + line-height: 40px;
  108 + text-align: center;
  109 +
  110 + /deep/ .cube-loading-spinners {
  111 + margin: auto;
  112 + }
  113 +}
  114 +</style>
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 <div class="address-select-component"> 2 <div class="address-select-component">
3 <div class="address-select-box"> 3 <div class="address-select-box">
4 <div class="component-title"> 4 <div class="component-title">
5 - <span class="title">所在地区</span> 5 + <span class="title">选择地区</span>
6 <span class="icon-close close" @click="closeAddBox"></span> 6 <span class="icon-close close" @click="closeAddBox"></span>
7 </div> 7 </div>
8 8
@@ -35,6 +35,7 @@ @@ -35,6 +35,7 @@
35 <li 35 <li
36 v-for="(pprovince, index) in provinces" 36 v-for="(pprovince, index) in provinces"
37 :key="index" 37 :key="index"
  38 + :class="{active: pprovince.id === province.id}"
38 @click="switchAddress(pprovince.id, pprovince.caption)" 39 @click="switchAddress(pprovince.id, pprovince.caption)"
39 > 40 >
40 {{pprovince.caption}} 41 {{pprovince.caption}}
@@ -45,6 +46,7 @@ @@ -45,6 +46,7 @@
45 <li 46 <li
46 v-for="(pcity, index) in citys" 47 v-for="(pcity, index) in citys"
47 :key="index" 48 :key="index"
  49 + :class="{active: pcity.id === city.id}"
48 @click="switchAddress(pcity.id, pcity.caption)" 50 @click="switchAddress(pcity.id, pcity.caption)"
49 > 51 >
50 {{pcity.caption}} 52 {{pcity.caption}}
@@ -55,6 +57,7 @@ @@ -55,6 +57,7 @@
55 <li 57 <li
56 v-for="(parea, index) in areas" 58 v-for="(parea, index) in areas"
57 :key="index" 59 :key="index"
  60 + :class="{active: parea.id === area.id}"
58 @click="switchAddress(parea.id, parea.caption)" 61 @click="switchAddress(parea.id, parea.caption)"
59 > 62 >
60 {{parea.caption}} 63 {{parea.caption}}
@@ -65,6 +68,7 @@ @@ -65,6 +68,7 @@
65 <li 68 <li
66 v-for="(pstreet, index) in streets" 69 v-for="(pstreet, index) in streets"
67 :key="index" 70 :key="index"
  71 + :class="{active: pstreet.id === street.id}"
68 @click="switchAddress(pstreet.id, pstreet.caption)" 72 @click="switchAddress(pstreet.id, pstreet.caption)"
69 > 73 >
70 {{pstreet.caption}} 74 {{pstreet.caption}}
@@ -417,9 +421,10 @@ export default { @@ -417,9 +421,10 @@ export default {
417 421
418 .component-title { 422 .component-title {
419 text-align: center; 423 text-align: center;
420 - line-height: 80px;  
421 - font-size: 32px;  
422 - color: #ccc; 424 + line-height: 88px;
  425 + font-size: 34px;
  426 + font-weight: bold;
  427 + color: #000;
423 padding: 0 30px; 428 padding: 0 30px;
424 429
425 .close { 430 .close {
@@ -429,26 +434,26 @@ export default { @@ -429,26 +434,26 @@ export default {
429 .icon-close { 434 .icon-close {
430 height: 40px; 435 height: 40px;
431 width: 40px; 436 width: 40px;
432 - margin-top: 20px; 437 + margin-top: 24px;
433 background: url("~statics/image/address/close.png"); 438 background: url("~statics/image/address/close.png");
434 background-size: cover; 439 background-size: cover;
435 } 440 }
436 } 441 }
437 442
438 .head-address-ul { 443 .head-address-ul {
439 - margin: 0 0 0 30px;  
440 padding: 0; 444 padding: 0;
  445 + margin: 0 0 0 30px;
441 list-style: none; 446 list-style: none;
442 overflow: hidden; 447 overflow: hidden;
443 - background-color: white;  
444 - font-size: 24px;  
445 - color: #444; 448 + font-size: 28px;
  449 + color: #999;
446 450
447 li { 451 li {
448 display: block; 452 display: block;
449 float: left; 453 float: left;
450 - height: 40px;  
451 - line-height: 40px; 454 + height: 60px;
  455 + font-size: 28px;
  456 + line-height: 60px;
452 position: relative; 457 position: relative;
453 margin-right: 70px; 458 margin-right: 70px;
454 } 459 }
@@ -458,13 +463,12 @@ export default { @@ -458,13 +463,12 @@ export default {
458 } 463 }
459 464
460 .head-address-li { 465 .head-address-li {
461 - color: #f23030; 466 + color: #000;
462 } 467 }
463 468
464 .head-address-li:after { 469 .head-address-li:after {
465 width: 100%; 470 width: 100%;
466 - height: 1px;  
467 - border-bottom: 2px solid #f23030; 471 + border-bottom: 4px solid #000;
468 position: absolute; 472 position: absolute;
469 bottom: 0; 473 bottom: 0;
470 left: 0; 474 left: 0;
@@ -472,24 +476,12 @@ export default { @@ -472,24 +476,12 @@ export default {
472 } 476 }
473 } 477 }
474 478
475 - .head-address-ul:after {  
476 - content: "";  
477 - width: 100%;  
478 - height: 1px;  
479 - position: absolute;  
480 - border-bottom: 1px solid #e3e5e9;  
481 - left: 0;  
482 - bottom: 0;  
483 - transform: scaleY(0.5);  
484 - -webkit-transform: scaleY(0.5);  
485 - }  
486 -  
487 .address-container { 479 .address-container {
488 margin: 0; 480 margin: 0;
489 overflow: hidden; 481 overflow: hidden;
490 height: 100%; 482 height: 100%;
491 width: 100%; 483 width: 100%;
492 - border-top: solid 1px #ccc; 484 + border-top: solid 1px #eee;
493 485
494 .address-content { 486 .address-content {
495 transform: translate(0, 0) translateZ(0); 487 transform: translate(0, 0) translateZ(0);
@@ -503,8 +495,8 @@ export default { @@ -503,8 +495,8 @@ export default {
503 list-style: none; 495 list-style: none;
504 height: 100%; 496 height: 100%;
505 overflow: auto; 497 overflow: auto;
506 - font-size: 24px;  
507 - color: #232326; 498 + font-size: 28px;
  499 + color: #999;
508 justify-content: center; 500 justify-content: center;
509 501
510 li { 502 li {
@@ -516,6 +508,12 @@ export default { @@ -516,6 +508,12 @@ export default {
516 display: flex; 508 display: flex;
517 align-items: center; 509 align-items: center;
518 510
  511 + &.active {
  512 + font-size: 36px;
  513 + color: #000;
  514 + font-weight: bold;
  515 + }
  516 +
519 .icon-check { 517 .icon-check {
520 display: inline-block; 518 display: inline-block;
521 margin-left: 18px; 519 margin-left: 18px;
@@ -526,17 +524,6 @@ export default { @@ -526,17 +524,6 @@ export default {
526 background-size: 100% 100%; 524 background-size: 100% 100%;
527 } 525 }
528 } 526 }
529 -  
530 - li:after {  
531 - content: "";  
532 - width: 100%;  
533 - height: 1px;  
534 - position: absolute;  
535 - left: 0;  
536 - bottom: 0;  
537 - transform: scaleY(0.5);  
538 - -webkit-transform: scaleY(0.5);  
539 - }  
540 } 527 }
541 } 528 }
542 } 529 }
@@ -140,6 +140,8 @@ export default { @@ -140,6 +140,8 @@ export default {
140 <style lang="scss" scoped> 140 <style lang="scss" scoped>
141 .input-label { 141 .input-label {
142 font-size: 36px; 142 font-size: 36px;
  143 + color: #000;
  144 + font-family: 'PingFang-SC-Regular';
143 display: inline-block; 145 display: inline-block;
144 font-weight: bold; 146 font-weight: bold;
145 } 147 }
@@ -150,7 +152,9 @@ export default { @@ -150,7 +152,9 @@ export default {
150 152
151 .wrapper-input { 153 .wrapper-input {
152 font-size: 28px; 154 font-size: 28px;
  155 + color: #000;
153 width: 100%; 156 width: 100%;
  157 + font-family: 'SFProText-Regular';
154 /*line-height: 1;*/ 158 /*line-height: 1;*/
155 line-height: normal; 159 line-height: normal;
156 } 160 }
1 <template> 1 <template>
2 - <LayoutApp class="yohoufo-channel-page" :show-back="true" :hide-header="hideHeader" :title="title">  
3 - <div class="fixed-nav scroll-nav-wrap" v-if="isShow && navList.length">  
4 - <ScrollNav :list="navList" :current="active" @transfer="getIndex" style="background: #f2f2f2;"></ScrollNav> 2 + <LayoutApp class="yohoufo-channel-page" :show-back="true" :hide-header="hideHeader" :title="title" :isStop="isStop">
  3 + <div class="fixed-nav scroll-nav-wrap" v-if="navList.length" v-show="isShow">
  4 + <ScrollNav :list="navList" :current="active" @transfer="getIndex"></ScrollNav>
5 </div> 5 </div>
6 - <Scroll 6 + <LayoutScroll
7 ref="scroll" 7 ref="scroll"
8 class="channel-scroll" 8 class="channel-scroll"
9 - :scroll-events="scrollEvents"  
10 @scroll="scrollHandler" 9 @scroll="scrollHandler"
11 @scroll-end="scrollEndHandler" 10 @scroll-end="scrollEndHandler"
12 - :options="options"  
13 - @pulling-up="onPullingUp"  
14 - :data="productList.list"> 11 + @pulling-up="onPullingUp" >
15 <div class="channel-body" ref="body"> 12 <div class="channel-body" ref="body">
16 <div ref="topSource" class="channel-html"> 13 <div ref="topSource" class="channel-html">
17 <div class="search-header middle" @click="goSearch"> 14 <div class="search-header middle" @click="goSearch">
@@ -25,15 +22,15 @@ @@ -25,15 +22,15 @@
25 <TwoBanner :list="item.data" :ref="index" :PAGE_URL="PAGE_URL" :key="index" v-if="item.template_name == 'twoPicture'"/> 22 <TwoBanner :list="item.data" :ref="index" :PAGE_URL="PAGE_URL" :key="index" v-if="item.template_name == 'twoPicture'"/>
26 </template> 23 </template>
27 </div> 24 </div>
28 - <div ref="scrollNav" class="scroll-nav-wrap" v-if="!isShow && navList.length"> 25 + <div ref="scrollNav" class="scroll-nav-wrap" v-if="navList.length">
29 <ScrollNav :list="navList" :current="active" @transfer="getIndex"></ScrollNav> 26 <ScrollNav :list="navList" :current="active" @transfer="getIndex"></ScrollNav>
30 </div> 27 </div>
31 - <div class="list-wrap" :style="{minHeight: total + 'px'}"> 28 + <div class="list-wrap">
32 <ProductList ref="product" :list="productList.list" :yasParams="listYasParams" v-if="productList.list.length > 0"></ProductList> 29 <ProductList ref="product" :list="productList.list" :yasParams="listYasParams" v-if="productList.list.length > 0"></ProductList>
33 <UfoNoItem class="channel-no-item" :tip="`暂无数据`" v-else></UfoNoItem> 30 <UfoNoItem class="channel-no-item" :tip="`暂无数据`" v-else></UfoNoItem>
34 </div> 31 </div>
35 </div> 32 </div>
36 - </Scroll> 33 + </LayoutScroll>
37 </LayoutApp> 34 </LayoutApp>
38 </template> 35 </template>
39 36
@@ -106,13 +103,18 @@ export default { @@ -106,13 +103,18 @@ export default {
106 page: null, // 当前页号 103 page: null, // 当前页号
107 coupon_token: null, // 优惠券token 104 coupon_token: null, // 优惠券token
108 }, 105 },
109 - selectedCategory: {} 106 + selectedCategory: {},
  107 + height: 0,
  108 + isA: false,
110 }; 109 };
111 }, 110 },
112 computed: { 111 computed: {
113 ...mapState(['channelList']), 112 ...mapState(['channelList']),
114 navList() { 113 navList() {
115 return get(find(this.channelList.list, ['template_name', 'guessLike']), 'data') || []; 114 return get(find(this.channelList.list, ['template_name', 'guessLike']), 'data') || [];
  115 + },
  116 + isStop() {
  117 + return this.scrollY < 10;
116 } 118 }
117 }, 119 },
118 watch: { 120 watch: {
@@ -126,10 +128,13 @@ export default { @@ -126,10 +128,13 @@ export default {
126 } 128 }
127 }, 129 },
128 activated() { 130 activated() {
  131 + this.$refs.scroll && this.scrollY && this.$refs.scroll.scrollTo(this.scrollY);
  132 +
129 if (!this.channelList.list || !this.channelList.list.length) { 133 if (!this.channelList.list || !this.channelList.list.length) {
130 this.fetchChannelList(); 134 this.fetchChannelList();
131 } 135 }
132 this.init(); 136 this.init();
  137 +
133 this.PAGE_URL = window.location.href; 138 this.PAGE_URL = window.location.href;
134 // 首页进入上报 139 // 首页进入上报
135 this.$store.dispatch('reportYas', { 140 this.$store.dispatch('reportYas', {
@@ -249,7 +254,7 @@ export default { @@ -249,7 +254,7 @@ export default {
249 this.selectedCategory = params; 254 this.selectedCategory = params;
250 this.setYasParam({index,...params}); 255 this.setYasParam({index,...params});
251 this.active = Number(index); 256 this.active = Number(index);
252 - this.$refs.scroll.scrollTo(0, -this.navTop, 300); 257 + this.isShow && this.$refs.scroll.scrollTo(0, -this.navTop, 300);
253 }, 258 },
254 scrollEndHandler({y}) { 259 scrollEndHandler({y}) {
255 let scrollHeight = Math.abs(y) 260 let scrollHeight = Math.abs(y)
@@ -257,15 +262,15 @@ export default { @@ -257,15 +262,15 @@ export default {
257 this.$refs.product && this.$refs.product.yasShowEvent(scrollHeight+this.navTop); 262 this.$refs.product && this.$refs.product.yasShowEvent(scrollHeight+this.navTop);
258 }, 263 },
259 scrollHandler({ y }) { 264 scrollHandler({ y }) {
  265 + this.scrollY = -y;
260 266
261 if (this.navTop) { 267 if (this.navTop) {
262 - let scrollY = -y;  
263 - // console.log(parseInt(scrollY));  
264 - // console.log(this.navTop);  
265 - if (scrollY >= this.navTop) { 268 + if (this.scrollY >= this.navTop) {
266 this.isShow = true; 269 this.isShow = true;
  270 + // this.isA = false;
267 } else { 271 } else {
268 this.isShow = false; 272 this.isShow = false;
  273 + // this.isA = true;
269 } 274 }
270 } 275 }
271 }, 276 },
@@ -354,11 +359,6 @@ export default { @@ -354,11 +359,6 @@ export default {
354 name: 'Search', 359 name: 'Search',
355 }); 360 });
356 }, 361 },
357 -  
358 - // getParams(params) {  
359 - // this.reportParams = params;  
360 - // console.log(this.reportParams);  
361 - // }  
362 }, 362 },
363 components: { 363 components: {
364 Swiper, 364 Swiper,
@@ -401,10 +401,6 @@ export default { @@ -401,10 +401,6 @@ export default {
401 background-color: #fefefe; 401 background-color: #fefefe;
402 overflow: hidden; 402 overflow: hidden;
403 } 403 }
404 -  
405 - &.fixed-nav:after {  
406 - display: none;  
407 - }  
408 } 404 }
409 405
410 .channel-scroll { 406 .channel-scroll {
@@ -508,4 +504,7 @@ input::-webkit-input-placeholder { @@ -508,4 +504,7 @@ input::-webkit-input-placeholder {
508 background: url(~statics/image/list/searchPage_icon@3x.png) no-repeat; 504 background: url(~statics/image/list/searchPage_icon@3x.png) no-repeat;
509 background-size: cover; 505 background-size: cover;
510 } 506 }
  507 +.class-a {
  508 + padding-top: 104px;
  509 +}
511 </style> 510 </style>
@@ -19,7 +19,7 @@ export default { @@ -19,7 +19,7 @@ export default {
19 return { 19 return {
20 isUnionType: false, 20 isUnionType: false,
21 shareUrl: 21 shareUrl:
22 - "https://activity.yoho.cn/feature/5475.html?share_id=8169&title=新人礼遇" 22 + "https://activity.yoho.cn/feature/5475.html?share_id=8169&title=新人礼遇&nodownload=1"
23 }; 23 };
24 }, 24 },
25 mounted() { 25 mounted() {
@@ -11,10 +11,9 @@ @@ -11,10 +11,9 @@
11 @click="onChangeList('overtime')">已失效{{overtime.total && '('+ overtime.total + ')' || null}} 11 @click="onChangeList('overtime')">已失效{{overtime.total && '('+ overtime.total + ')' || null}}
12 </div> 12 </div>
13 </div> 13 </div>
14 - <Scroll ref="couponlist" 14 + <LayoutScroll ref="couponlist"
15 class="coupon-list" 15 class="coupon-list"
16 - :options="scrollOptions"  
17 - :data="list" 16 + :loading="loadingOptions"
18 @pulling-up="onPullingUp" v-show="!showEmpty"> 17 @pulling-up="onPullingUp" v-show="!showEmpty">
19 <div class="item" v-for="(item,index) in list"> 18 <div class="item" v-for="(item,index) in list">
20 <div :class="type === 'unused' ? 'item-bg' : 'item-gray-bg'"> 19 <div :class="type === 'unused' ? 'item-bg' : 'item-gray-bg'">
@@ -48,7 +47,7 @@ @@ -48,7 +47,7 @@
48 </div> 47 </div>
49 </div> 48 </div>
50 </div> 49 </div>
51 - </Scroll> 50 + </LayoutScroll>
52 <div 51 <div
53 class="empty-wrapper" 52 class="empty-wrapper"
54 v-show="showEmpty" 53 v-show="showEmpty"
@@ -61,7 +60,6 @@ @@ -61,7 +60,6 @@
61 60
62 <script> 61 <script>
63 62
64 -import {Scroll} from 'cube-ui';  
65 import {createNamespacedHelpers} from 'vuex'; 63 import {createNamespacedHelpers} from 'vuex';
66 import EmptyList from '../../../components/ufo-no-item'; 64 import EmptyList from '../../../components/ufo-no-item';
67 65
@@ -69,7 +67,7 @@ const {mapState, mapActions} = createNamespacedHelpers('home/coupon'); @@ -69,7 +67,7 @@ const {mapState, mapActions} = createNamespacedHelpers('home/coupon');
69 67
70 export default { 68 export default {
71 name: 'Coupon', 69 name: 'Coupon',
72 - components: {Scroll, EmptyList}, 70 + components: {EmptyList},
73 activated: function() { 71 activated: function() {
74 this.type = 'unused'; 72 this.type = 'unused';
75 this.fetchCouponList({type: 'unused', isReset: true}).then(r=>{ 73 this.fetchCouponList({type: 'unused', isReset: true}).then(r=>{
@@ -90,7 +88,7 @@ export default { @@ -90,7 +88,7 @@ export default {
90 }, 88 },
91 type: 'unused', 89 type: 'unused',
92 list: [], 90 list: [],
93 - showEmpty: false, 91 + showEmpty: false
94 }; 92 };
95 }, 93 },
96 methods: { 94 methods: {
@@ -132,6 +130,14 @@ export default { @@ -132,6 +130,14 @@ export default {
132 }, 130 },
133 computed: { 131 computed: {
134 ...mapState(['unused', 'used', 'overtime']), 132 ...mapState(['unused', 'used', 'overtime']),
  133 + loadingOptions() {
  134 + let info = this[this.type];
  135 +
  136 + return {
  137 + hide: !this.list || !this.list.length,
  138 + noMore: info && info.reachedEnd
  139 + }
  140 + }
135 }, 141 },
136 }; 142 };
137 </script> 143 </script>
@@ -43,7 +43,6 @@ export default { @@ -43,7 +43,6 @@ export default {
43 </script> 43 </script>
44 44
45 <style lang="scss" scoped> 45 <style lang="scss" scoped>
46 -@import "../../../../statics/scss/variable";  
47 .assets-record-container { 46 .assets-record-container {
48 display: flex; 47 display: flex;
49 margin: 0 40px; 48 margin: 0 40px;
1 <template> 1 <template>
2 <div v-if="validStatus !== 1" class=""> 2 <div v-if="validStatus !== 1" class="">
3 <div @click="goBind" class="bind-alipay">绑定支付宝</div> 3 <div @click="goBind" class="bind-alipay">绑定支付宝</div>
4 - <p class="bind-tip">请先设置支付宝账号作为货款和补偿款的收款户, 4 + <p class="bind-tip">请先设置支付宝账号作为货款和补偿款的收款户,
5 绑定完成在我的收入中展示支付宝绑定账户</p> 5 绑定完成在我的收入中展示支付宝绑定账户</p>
6 </div> 6 </div>
7 </template> 7 </template>
@@ -20,7 +20,7 @@ export default { @@ -20,7 +20,7 @@ export default {
20 }, 20 },
21 data() { 21 data() {
22 return { 22 return {
23 - 23 +
24 }; 24 };
25 }, 25 },
26 computed: { 26 computed: {
@@ -43,7 +43,6 @@ export default { @@ -43,7 +43,6 @@ export default {
43 </script> 43 </script>
44 44
45 <style lang="scss" scoped> 45 <style lang="scss" scoped>
46 -@import "../../../../statics/scss/variable";  
47 46
48 .orders { 47 .orders {
49 display: flex; 48 display: flex;
@@ -87,7 +87,6 @@ export default { @@ -87,7 +87,6 @@ export default {
87 </script> 87 </script>
88 88
89 <style lang="scss" scoped> 89 <style lang="scss" scoped>
90 -@import "../../../../statics/scss/variable";  
91 90
92 .tab-item { 91 .tab-item {
93 display: flex; 92 display: flex;
1 <template> 1 <template>
2 <LayoutApp :show-back="true" :hideHeader="hideHeader"> 2 <LayoutApp :show-back="true" :hideHeader="hideHeader">
3 <div class="scroll-list-wrap"> 3 <div class="scroll-list-wrap">
4 - <Scroll 4 + <LayoutScroll
5 ref="scroll" 5 ref="scroll"
6 :options="options" 6 :options="options"
  7 + :loading="loadingOptions"
7 @pulling-up="onPullingUp" 8 @pulling-up="onPullingUp"
8 :data="newsList.list"> 9 :data="newsList.list">
9 <div class="news-content"> 10 <div class="news-content">
@@ -11,7 +12,7 @@ @@ -11,7 +12,7 @@
11 <List v-if="newsList.list && newsList.list.length > 0" isTitle :list="newsList.list || []"></List> 12 <List v-if="newsList.list && newsList.list.length > 0" isTitle :list="newsList.list || []"></List>
12 <UfoNoItem v-else :tip="`暂无数据`" style="margin-top: 60px"></UfoNoItem> 13 <UfoNoItem v-else :tip="`暂无数据`" style="margin-top: 60px"></UfoNoItem>
13 </div> 14 </div>
14 - </Scroll> 15 + </LayoutScroll>
15 </div> 16 </div>
16 </LayoutApp> 17 </LayoutApp>
17 </template> 18 </template>
@@ -68,6 +69,12 @@ export default { @@ -68,6 +69,12 @@ export default {
68 return { 69 return {
69 pullUpLoad: this.newsList.list.length > 0 ? true : false, 70 pullUpLoad: this.newsList.list.length > 0 ? true : false,
70 } 71 }
  72 + },
  73 + loadingOptions() {
  74 + return {
  75 + hide: !this.newsList.list || this.newsList.list.length === 0,
  76 + noMore: !this.newsList.isMoreData
  77 + }
71 } 78 }
72 }, 79 },
73 created() { 80 created() {
@@ -39,7 +39,6 @@ export default { @@ -39,7 +39,6 @@ export default {
39 </script> 39 </script>
40 40
41 <style lang="scss" scoped> 41 <style lang="scss" scoped>
42 -@import "../../../../statics/scss/variable";  
43 .income-header-wrapper { 42 .income-header-wrapper {
44 position: relative; 43 position: relative;
45 } 44 }
1 <template> 1 <template>
2 <LayoutApp :show-back="true" title="我的收入"> 2 <LayoutApp :show-back="true" title="我的收入">
3 <div class="body" ref="body"> 3 <div class="body" ref="body">
4 - <Scroll  
5 - ref="scroll"  
6 - :data="incomeData.list"  
7 - :options="options"  
8 - @pulling-down="onPullingDown"  
9 - @pulling-up="onPullingUp">  
10 -  
11 - <incomeHeader :data="getAssetSummary"></incomeHeader>  
12 - <payAccount></payAccount>  
13 - <incomeDetail :data="incomeData">  
14 - <template v-for="(item,index) in incomeData.list">  
15 - <incomeItem :data="item" :key="index"></incomeItem>  
16 - </template>  
17 - </incomeDetail> 4 + <LayoutScroll
  5 + ref="scroll"
  6 + :loading="loadingOptions"
  7 + @pulling-up="onPullingUp">
  8 +
  9 + <incomeHeader :data="getAssetSummary"></incomeHeader>
  10 + <payAccount></payAccount>
  11 + <incomeDetail :data="incomeData">
  12 + <template v-for="(item,index) in incomeData.list">
  13 + <incomeItem :data="item" :key="index"></incomeItem>
  14 + </template>
  15 + </incomeDetail>
18 <!-- 自定义下拉刷新内容 --> 16 <!-- 自定义下拉刷新内容 -->
19 <!-- <template v-if="customPullDown" slot="pulldown" slot-scope="props"> 17 <!-- <template v-if="customPullDown" slot="pulldown" slot-scope="props">
20 <pullDown :propsData="props" :pullDownRefreshThreshold="pullDownRefreshThreshold"></pullDown> 18 <pullDown :propsData="props" :pullDownRefreshThreshold="pullDownRefreshThreshold"></pullDown>
21 </template> --> 19 </template> -->
22 - </Scroll> 20 + </LayoutScroll>
23 </div> 21 </div>
24 </LayoutApp> 22 </LayoutApp>
25 </template> 23 </template>
@@ -38,20 +36,26 @@ export default { @@ -38,20 +36,26 @@ export default {
38 mixins: [scrollMixin], 36 mixins: [scrollMixin],
39 data() { 37 data() {
40 return { 38 return {
41 - 39 + page: 0,
  40 + totalPage: 0
42 } 41 }
43 }, 42 },
44 computed:{ 43 computed:{
45 ...mapGetters(['getAssetSummary']), 44 ...mapGetters(['getAssetSummary']),
46 - ...mapState({  
47 - incomeData: (state) => state.assetData  
48 - }),  
49 - 45 + ...mapState({
  46 + incomeData: (state) => state.assetData
  47 + }),
  48 + loadingOptions() {
  49 + return {
  50 + hide: !this.totalPage,
  51 + noMore: this.page > this.totalPage
  52 + };
  53 + }
50 }, 54 },
51 created() { 55 created() {
52 }, 56 },
53 activated() { 57 activated() {
54 - this.fetchAssets(true) 58 + this.fetchAssetsAsync(true)
55 }, 59 },
56 watch: { 60 watch: {
57 "incomeData.list": function(val) { 61 "incomeData.list": function(val) {
@@ -66,15 +70,22 @@ export default { @@ -66,15 +70,22 @@ export default {
66 }, 70 },
67 methods: { 71 methods: {
68 ...mapActions(['fetchAssets']), 72 ...mapActions(['fetchAssets']),
69 - onPullingDown() {  
70 - this.fetchAssets(true)  
71 - },  
72 onPullingUp() { 73 onPullingUp() {
73 if(!this.incomeData.endReached) { 74 if(!this.incomeData.endReached) {
74 - this.fetchAssets(false) 75 + this.fetchAssetsAsync(false)
75 } else { 76 } else {
76 this.$refs.scroll.forceUpdate() 77 this.$refs.scroll.forceUpdate()
77 } 78 }
  79 + },
  80 + fetchAssetsAsync(reFetch) {
  81 + return this.fetchAssets(reFetch).then(res => {
  82 + if (res.code === 200) {
  83 + let { page, pagetotal } = res.data || {};
  84 +
  85 + this.page = page || 0;
  86 + this.pageTotal = pagetotal || 0;
  87 + }
  88 + });
78 } 89 }
79 }, 90 },
80 components: { 91 components: {
@@ -83,8 +94,7 @@ export default { @@ -83,8 +94,7 @@ export default {
83 incomeItem, 94 incomeItem,
84 pullDown, 95 pullDown,
85 payAccount, 96 payAccount,
86 - Style,  
87 - Scroll 97 + Style
88 } 98 }
89 }; 99 };
90 </script> 100 </script>
@@ -172,7 +172,7 @@ export default { @@ -172,7 +172,7 @@ export default {
172 } 172 }
173 173
174 .bg { 174 .bg {
175 - padding: 24px; 175 + padding: 24px 24px 8px;
176 display: flex; 176 display: flex;
177 flex-wrap: wrap; 177 flex-wrap: wrap;
178 } 178 }
@@ -72,9 +72,9 @@ export default { @@ -72,9 +72,9 @@ export default {
72 72
73 if (this.yoho.direction === 'forword') { 73 if (this.yoho.direction === 'forword') {
74 Object.assign(this.$data, this.$options.data()); 74 Object.assign(this.$data, this.$options.data());
  75 + !params.order && (params.order = 'sale_desc');
  76 + this.fetchData(params);
75 } 77 }
76 - !params.order && (params.order = 'sale_desc');  
77 - this.fetchData(params);  
78 }, 78 },
79 79
80 computed: { 80 computed: {
@@ -163,7 +163,7 @@ export default { @@ -163,7 +163,7 @@ export default {
163 this.yasParams.ENT_NAME = ENT_NAME.toString(); 163 this.yasParams.ENT_NAME = ENT_NAME.toString();
164 164
165 params.isReset = true; 165 params.isReset = true;
166 - this.yas(this.yasParams) 166 + this.yas(this.yasParams);
167 this.$parent.fetchList(params); 167 this.$parent.fetchList(params);
168 this.$parent.$refs.scroll.scrollTo(0, 0, 300); 168 this.$parent.$refs.scroll.scrollTo(0, 0, 300);
169 this.hide(); 169 this.hide();
1 <template> 1 <template>
2 <div> 2 <div>
3 - <LayoutApp :show-back="true" :title="title"> 3 + <LayoutApp :show-back="true" :title="title" :isStop="isStop">
4 <div class="filter"> 4 <div class="filter">
5 <div class="filter-tab"> 5 <div class="filter-tab">
6 <div class="tab-item" :class="selectedType === 2 && 'selected-tab'" @click="pressType(2)">人气</div> 6 <div class="tab-item" :class="selectedType === 2 && 'selected-tab'" @click="pressType(2)">人气</div>
@@ -18,14 +18,16 @@ @@ -18,14 +18,16 @@
18 <div class="search-img" @click="goSearch()"></div> 18 <div class="search-img" @click="goSearch()"></div>
19 </div> 19 </div>
20 </div> 20 </div>
21 - <Scroll ref="scroll" class="product-list" v-show="!productList.isEmpty"  
22 - :scroll-events="['scroll-end']"  
23 - :options="scrollOptions"  
24 - :data="productList.list"  
25 - @scroll-end="scrollHandler"  
26 - @pulling-up="onPullingUp"> 21 + <LayoutScroll ref="scroll" class="product-list" v-show="!productList.isEmpty"
  22 + :loading="loadingOption"
  23 + :scroll-events="['scroll', 'scroll-end']"
  24 + :options="scrollOptions"
  25 + :data="productList.list"
  26 + @scroll="scrollHandler"
  27 + @scroll-end="scrollEndHandler"
  28 + @pulling-up="onPullingUp">
27 <ProductList ref="product" :list="productList.list" :yasParams="yasParams"></ProductList> 29 <ProductList ref="product" :list="productList.list" :yasParams="yasParams"></ProductList>
28 - </Scroll> 30 + </LayoutScroll>
29 <EmptyList class="empty-wrapper product-list" :tip="`暂无数据`" v-show="productList.isEmpty"> 31 <EmptyList class="empty-wrapper product-list" :tip="`暂无数据`" v-show="productList.isEmpty">
30 </EmptyList> 32 </EmptyList>
31 </LayoutApp> 33 </LayoutApp>
@@ -65,6 +67,7 @@ export default { @@ -65,6 +67,7 @@ export default {
65 priceDesc: true, 67 priceDesc: true,
66 arrowImage: '', 68 arrowImage: '',
67 title: '', 69 title: '',
  70 + scrollY: 0,
68 yasParams: {P_NAME: 'XY_UFOSearchList', TYPE_ID: 1}, 71 yasParams: {P_NAME: 'XY_UFOSearchList', TYPE_ID: 1},
69 productList: { 72 productList: {
70 showErrorPage: false, 73 showErrorPage: false,
@@ -99,24 +102,34 @@ export default { @@ -99,24 +102,34 @@ export default {
99 if (this.yoho.direction === 'forword') { 102 if (this.yoho.direction === 'forword') {
100 this.$refs.filtrate.hide(); 103 this.$refs.filtrate.hide();
101 Object.assign(this.$data, this.$options.data()); 104 Object.assign(this.$data, this.$options.data());
102 - }  
103 - this.changeArrow();  
104 - let params = {...this.$route.query}; 105 + this.changeArrow();
  106 + let params = {...this.$route.query};
105 107
106 - if (params.title) {  
107 - this.title = params.title;  
108 - delete params.title; 108 + if (params.title) {
  109 + this.title = params.title;
  110 + delete params.title;
  111 + } else {
  112 + this.title = '商品列表';
  113 + }
  114 + this.setYasParam({param: params, tab: {index: 1, name: '人气'}});
  115 + !params.order && (params.order = 'sale_desc');
  116 + await this.fetchList({...params, isReset: true});
109 } else { 117 } else {
110 - this.title = '商品列表'; 118 + this.scrollY && this.$refs.scroll.scrollTo(this.scrollY);
111 } 119 }
112 - this.setYasParam({param: params, tab: {index: 1, name: '人气'}});  
113 - !params.order && (params.order = 'sale_desc');  
114 - await this.fetchList({...params, isReset: true});  
115 this.yasShowPage(); 120 this.yasShowPage();
116 }, 121 },
117 122
118 computed: { 123 computed: {
119 - ...mapState(['yoho']) 124 + ...mapState(['yoho']),
  125 + loadingOption() {
  126 + return {
  127 + noMore: this.productList && this.productList.endReached
  128 + };
  129 + },
  130 + isStop() {
  131 + return this.scrollY < 10;
  132 + }
120 }, 133 },
121 134
122 methods: { 135 methods: {
@@ -128,6 +141,10 @@ export default { @@ -128,6 +141,10 @@ export default {
128 }, 141 },
129 142
130 scrollHandler({y}) { 143 scrollHandler({y}) {
  144 + this.scrollY = -y;
  145 + },
  146 +
  147 + scrollEndHandler({y}) {
131 let height = -y; 148 let height = -y;
132 149
133 this.$refs.product.yasShowEvent(height); 150 this.$refs.product.yasShowEvent(height);
@@ -371,6 +388,7 @@ export default { @@ -371,6 +388,7 @@ export default {
371 388
372 .product-list { 389 .product-list {
373 background: #f5f5f5; 390 background: #f5f5f5;
  391 + height: calc(100% - 120px);
374 } 392 }
375 393
376 .search-img { 394 .search-img {
@@ -36,7 +36,6 @@ export default { @@ -36,7 +36,6 @@ export default {
36 </script> 36 </script>
37 37
38 <style lang="scss" scoped> 38 <style lang="scss" scoped>
39 -@import "../../../../statics/scss/variable";  
40 39
41 .price-item { 40 .price-item {
42 display: flex; 41 display: flex;
@@ -25,7 +25,6 @@ export default { @@ -25,7 +25,6 @@ export default {
25 </script> 25 </script>
26 26
27 <style lang="scss" scoped> 27 <style lang="scss" scoped>
28 -@import "../../../../statics/scss/variable";  
29 28
30 .product-wrapper { 29 .product-wrapper {
31 height: 180px; 30 height: 180px;
1 <template> 1 <template>
2 <div class="fee-detail"> 2 <div class="fee-detail">
3 <div class="item"> 3 <div class="item">
4 - <div>平台用费:<i class="iconfont iconquestion icon-class" @click="onClick"></i></div> 4 + <div>平台费用:<i class="iconfont iconquestion icon-class" @click="onClick"></i></div>
5 <div>{{data.platformFee.amount || '¥0'}}</div> 5 <div>{{data.platformFee.amount || '¥0'}}</div>
6 </div> 6 </div>
7 <div class="item"> 7 <div class="item">
@@ -67,7 +67,6 @@ export default { @@ -67,7 +67,6 @@ export default {
67 </script> 67 </script>
68 68
69 <style lang="scss" scoped> 69 <style lang="scss" scoped>
70 -@import "../../../statics/scss/variable";  
71 70
72 .count-down-wrapper { 71 .count-down-wrapper {
73 display: flex; 72 display: flex;
@@ -17,7 +17,7 @@ export default { @@ -17,7 +17,7 @@ export default {
17 methods: { 17 methods: {
18 onClick() { 18 onClick() {
19 this.$yoho.goNewPage({ 19 this.$yoho.goNewPage({
20 - url: 'https://activity.yoho.cn/feature/5729.html?title=活动规则&openby:yohobuy={"action":"go.h5","params":{"title":"活动规则","url":"https://activity.yoho.cn/feature/5729.html"}}' 20 + url: 'https://activity.yoho.cn/feature/5729.html?nodownload=1&title=活动规则&openby:yohobuy={"action":"go.h5","params":{"title":"活动规则","url":"https://activity.yoho.cn/feature/5729.html"}}'
21 }); 21 });
22 } 22 }
23 } 23 }
@@ -18,7 +18,7 @@ export default { @@ -18,7 +18,7 @@ export default {
18 data() { 18 data() {
19 return { 19 return {
20 isUnionType: false, 20 isUnionType: false,
21 - shareUrl: 'https://activity.yoho.cn/feature/5475.html?share_id=8169&title=新人礼遇' 21 + shareUrl: 'https://activity.yoho.cn/feature/5475.html?share_id=8169&title=新人礼遇&nodownload=1'
22 }; 22 };
23 }, 23 },
24 mounted() { 24 mounted() {
@@ -50,7 +50,7 @@ @@ -50,7 +50,7 @@
50 ></i> 50 ></i>
51 <span>我已阅读并同意</span> 51 <span>我已阅读并同意</span>
52 <LayoutLink 52 <LayoutLink
53 - href="//activity.yoho.cn/feature/4049.html?share_id=6729&title=UFO卖家商品质检标准" 53 + href="//activity.yoho.cn/feature/4049.html?share_id=6729&title=卖家商品质检标准"
54 >《卖家商品质检标准》</LayoutLink 54 >《卖家商品质检标准》</LayoutLink
55 > 55 >
56 </div> 56 </div>
@@ -173,7 +173,7 @@ export default { @@ -173,7 +173,7 @@ export default {
173 "dg-notice-content-title": true 173 "dg-notice-content-title": true
174 } 174 }
175 }, 175 },
176 - isChanged ? "UFO仓库调整公告" : title 176 + isChanged ? "仓库调整公告" : title
177 ), 177 ),
178 ...info.map(val => { 178 ...info.map(val => {
179 return createElement( 179 return createElement(
@@ -232,7 +232,10 @@ export default { @@ -232,7 +232,10 @@ export default {
232 extra: JSON.stringify({ 232 extra: JSON.stringify({
233 forward: { 233 forward: {
234 name: isDetail ? 'buyOrderDetail' : 'OrderList', 234 name: isDetail ? 'buyOrderDetail' : 'OrderList',
235 - params: this.$route.params, 235 + params: isDetail ? {
  236 + owner: this.$route.params.owner,
  237 + code: bidData.orderCode,//改为新订单号
  238 + } : this.$route.params,
236 }, 239 },
237 reportType: 'buy', 240 reportType: 'buy',
238 }), 241 }),
@@ -146,7 +146,7 @@ export default { @@ -146,7 +146,7 @@ export default {
146 return { 146 return {
147 title: '调价', 147 title: '调价',
148 agreementURL: 148 agreementURL:
149 - 'https://activity.yoho.cn/feature/3187.html?share_id=5851&title=ufo-%E5%8D%96%E5%AE%B6%E5%8D%8F%E8%AE%AE', 149 + 'https://activity.yoho.cn/feature/3187.html?share_id=5851&title=ufo-%E5%8D%96%E5%AE%B6%E5%8D%8F%E8%AE%AE&nodownload=1',
150 platformFeeModalVisible: false, 150 platformFeeModalVisible: false,
151 platformFee: { 151 platformFee: {
152 amount: '-¥0', 152 amount: '-¥0',
@@ -73,7 +73,7 @@ export default { @@ -73,7 +73,7 @@ export default {
73 error: false, 73 error: false,
74 agreeDesc: '有货卖家协议', 74 agreeDesc: '有货卖家协议',
75 url: 75 url:
76 - 'https://activity.yoho.cn/feature/6773.html?share_id=9479&title=%E9%97%B2%E9%B1%BC%E6%BD%AE%E5%8D%96%E5%AE%B6%E5%8D%8F%E8%AE%AE', 76 + 'https://activity.yoho.cn/feature/6773.html?share_id=9479&title=%E9%97%B2%E9%B1%BC%E6%BD%AE%E5%8D%96%E5%AE%B6%E5%8D%8F%E8%AE%AE&nodownload=1',
77 superSell: false, 77 superSell: false,
78 addNumError: false, 78 addNumError: false,
79 scrollOption: { 79 scrollOption: {
@@ -81,7 +81,7 @@ export default { @@ -81,7 +81,7 @@ export default {
81 click: true 81 click: true
82 }, 82 },
83 tipUrl: 83 tipUrl:
84 - 'https://activity.yoho.cn/feature/6773.html?share_id=9479&title=%E9%97%B2%E9%B1%BC%E6%BD%AE%E5%8D%96%E5%AE%B6%E5%8D%8F%E8%AE%AE' 84 + 'https://activity.yoho.cn/feature/6773.html?share_id=9479&title=%E9%97%B2%E9%B1%BC%E6%BD%AE%E5%8D%96%E5%AE%B6%E5%8D%8F%E8%AE%AE&nodownload=1'
85 }; 85 };
86 }, 86 },
87 activated() { 87 activated() {
@@ -455,7 +455,6 @@ export default { @@ -455,7 +455,6 @@ export default {
455 </script> 455 </script>
456 456
457 <style lang="scss" scoped> 457 <style lang="scss" scoped>
458 -@import "~statics/scss/variable";  
459 458
460 .body { 459 .body {
461 height: 100%; 460 height: 100%;
1 <template> 1 <template>
2 <LayoutApp class="yohoufo-real-auth-page" title="实名认证"> 2 <LayoutApp class="yohoufo-real-auth-page" title="实名认证">
3 <div class="auth-content"> 3 <div class="auth-content">
4 - <p class="auth-sub-title">UFO平台将严格保密您的认证信息,请按照种类分别填写以下信息,保证上传的图片文字清晰可见。</p> 4 + <p class="auth-sub-title">平台将严格保密您的认证信息,请按照种类分别填写以下信息,保证上传的图片文字清晰可见。</p>
5 <div class="auth-form"> 5 <div class="auth-form">
6 <p class="form-title">姓名</p> 6 <p class="form-title">姓名</p>
7 <div class="form-input-block"> 7 <div class="form-input-block">
@@ -215,7 +215,7 @@ export default { @@ -215,7 +215,7 @@ export default {
215 align-items: baseline; 215 align-items: baseline;
216 font-size: 40px; 216 font-size: 40px;
217 letter-spacing: 0; 217 letter-spacing: 0;
218 - font-family: $num-font; 218 + @include num;
219 219
220 span:nth-child(2) { 220 span:nth-child(2) {
221 font-size: 0.8em; 221 font-size: 0.8em;
@@ -220,7 +220,7 @@ export default { @@ -220,7 +220,7 @@ export default {
220 220
221 .size-info, 221 .size-info,
222 .size-price { 222 .size-price {
223 - font-family: $num-font; 223 + @include num;
224 } 224 }
225 &.selected { 225 &.selected {
226 background: $primary-color; 226 background: $primary-color;
@@ -259,7 +259,8 @@ export default { @@ -259,7 +259,8 @@ export default {
259 259
260 .size-info { 260 .size-info {
261 color: #000; 261 color: #000;
262 - font-family: $num-font; 262 +
  263 + @include num;
263 font-weight: bold; 264 font-weight: bold;
264 font-size: 40px; 265 font-size: 40px;
265 display: inline-block; 266 display: inline-block;
@@ -221,7 +221,6 @@ export default { @@ -221,7 +221,6 @@ export default {
221 221
222 <style lang="scss" scoped> 222 <style lang="scss" scoped>
223 @import "../product-detail"; 223 @import "../product-detail";
224 - @import "../../../statics/scss/variable";  
225 224
226 .title { 225 .title {
227 font-size: 40px; 226 font-size: 40px;
@@ -343,7 +342,7 @@ export default { @@ -343,7 +342,7 @@ export default {
343 } 342 }
344 343
345 .crash-info { 344 .crash-info {
346 - font-family: $num-font; 345 + @include num;
347 } 346 }
348 347
349 .footer { 348 .footer {
@@ -106,7 +106,8 @@ export default { @@ -106,7 +106,8 @@ export default {
106 } 106 }
107 107
108 .price { 108 .price {
109 - font-family: $num-font; 109 + @include num;
  110 +
110 font-weight: bold; 111 font-weight: bold;
111 font-size: 32px; 112 font-size: 32px;
112 line-height: 38px; 113 line-height: 38px;
1 $primary-color : #08304b; 1 $primary-color : #08304b;
2 $sub-color : #64ad88; 2 $sub-color : #64ad88;
3 -$num-font: "DINAlternate-Bold", "din alternate", "PingFang SC", "HiraginoSansGB-W3", "SanFranciscoText-Regular", Helvetica, Roboto, "Heiti SC", "黑体", Arial;  
4 3
5 @mixin cube-ufo-btn { 4 @mixin cube-ufo-btn {
6 [type="button"] { 5 [type="button"] {
@@ -27,7 +27,7 @@ @@ -27,7 +27,7 @@
27 <div class="info-name"><div>{{productDetail.product_name}}</div></div> 27 <div class="info-name"><div>{{productDetail.product_name}}</div></div>
28 </div> 28 </div>
29 <a class="banner" v-if="resource" @click.prevent="gotoNewPage(resource.url)"> 29 <a class="banner" v-if="resource" @click.prevent="gotoNewPage(resource.url)">
30 - <img-size :src="sizeImg(resource.src)"/> 30 + <img-size ref="resourceImg" :src="sizeImg(resource.src)"/>
31 </a> 31 </a>
32 <div class="info"> 32 <div class="info">
33 <transition-group name="info-list" tag="div" class="info-list"> 33 <transition-group name="info-list" tag="div" class="info-list">
@@ -50,7 +50,7 @@ @@ -50,7 +50,7 @@
50 <img class="ref-img" v-lazy="prdDetailImage" /> 50 <img class="ref-img" v-lazy="prdDetailImage" />
51 51
52 <div class="recommend" v-if="recommend"><h2>相关推荐</h2> 52 <div class="recommend" v-if="recommend"><h2>相关推荐</h2>
53 - <product-list :list="recommend" priceKey="price"/> 53 + <product-list ref="recommendList" :list="recommend" priceKey="price" :yas-params="recommendYasParams"/>
54 </div> 54 </div>
55 </div> 55 </div>
56 <div class="footer"> 56 <div class="footer">
@@ -97,7 +97,7 @@ import TopList from './components/top-list'; @@ -97,7 +97,7 @@ import TopList from './components/top-list';
97 import SquareImg from './components/square-img'; 97 import SquareImg from './components/square-img';
98 import stateShortCutsMixins from './mixins'; 98 import stateShortCutsMixins from './mixins';
99 99
100 -const { mapActions } = createNamespacedHelpers('product'); 100 +const { mapActions, mapState } = createNamespacedHelpers('product');
101 101
102 export default { 102 export default {
103 name: 'ProductDetail', 103 name: 'ProductDetail',
@@ -133,10 +133,23 @@ export default { @@ -133,10 +133,23 @@ export default {
133 showSizeSelectSheet: false, 133 showSizeSelectSheet: false,
134 showSizeRequestSheet: false, 134 showSizeRequestSheet: false,
135 selectSizeConfig: {}, 135 selectSizeConfig: {},
  136 +
  137 + /**
  138 + * 商品详情页-推荐商品曝光时
  139 + * XY_UFO_SHOW_EVENT
  140 + * 1.P_NAME:页面名称,UFOProductDetail_LIST;
  141 + * 2.P_PARAM:页面参数;
  142 + * 3.I_INDEX:曝光顺序;
  143 + * 4.PRD_SKN:商品id;
  144 + */
  145 + recommendYasParams: {
  146 + P_NAME: 'UFOProductDetail_LIST',
  147 + },
136 }; 148 };
137 }, 149 },
138 computed: { 150 computed: {
139 ...mapGetters(['isQiugouEnabled']), 151 ...mapGetters(['isQiugouEnabled']),
  152 + ...mapState(['resourceContentCode']),
140 productDec() { 153 productDec() {
141 const goods = get(this.productDetail, 'goods_list[0]', {}); 154 const goods = get(this.productDetail, 'goods_list[0]', {});
142 155
@@ -198,6 +211,31 @@ export default { @@ -198,6 +211,31 @@ export default {
198 211
199 this.loadData(this.productId); 212 this.loadData(this.productId);
200 this.refresh(); 213 this.refresh();
  214 +
  215 + if (this._resourceImgWatcher) {
  216 + this._resourceImgWatcher();
  217 + }
  218 +
  219 + if (this.resource && this.resource.url) {
  220 + this.yasResourceVisible();
  221 + } else {
  222 + this._resourceImgWatcher = this.$watch(() => {
  223 + return this.resource && this.resource.url;
  224 + }, (url) => {
  225 + if (url) {
  226 + this._resourceImgWatcher && this._resourceImgWatcher();
  227 + this.yasResourceVisible();
  228 + }
  229 + }, {
  230 + immediate: true,
  231 + });
  232 + }
  233 + },
  234 + deactivated() {
  235 + if (this._resourceImgWatcher) {
  236 + this._resourceImgWatcher();
  237 + this._resourceImgWatcher = null;
  238 + }
201 }, 239 },
202 beforeRouteUpdate(to, from ,next) { 240 beforeRouteUpdate(to, from ,next) {
203 if (this.historyBackGuard() === false) { 241 if (this.historyBackGuard() === false) {
@@ -228,6 +266,31 @@ export default { @@ -228,6 +266,31 @@ export default {
228 refresh() { 266 refresh() {
229 this.$refs.slide && this.$refs.slide.refresh && this.$refs.slide.refresh(); 267 this.$refs.slide && this.$refs.slide.refresh && this.$refs.slide.refresh();
230 }, 268 },
  269 + yasResourceVisible() {
  270 + /**
  271 + * 商品详情页中的资源位曝光
  272 + * XY_UFO_SHOW_EVENT
  273 + * 1.P_NAME:当前页面名称,XY_UFOProductDetail;
  274 + * 2.P_PARAM:当前页面资源位code;
  275 + * 3.PRD_ID:商品ID;
  276 + * 4.ACTION_URL:资源位跳转URL;
  277 + */
  278 + this.$store.dispatch('reportYas', {
  279 + params: {
  280 + appop: 'XY_UFO_SHOW_EVENT',
  281 + param: {
  282 + P_NAME: 'XY_UFOProductDetail',
  283 + P_PARAM: this.resourceContentCode,
  284 + PRD_ID: this.productId,
  285 + ACTION_URL: this.resource.url,
  286 + },
  287 + }
  288 + });
  289 + if (this._resourceImgWatcher) {
  290 + this._resourceImgWatcher();
  291 + this._resourceImgWatcher = null;
  292 + }
  293 + },
231 sizeImg(src, width = 360, height = 72) { 294 sizeImg(src, width = 360, height = 72) {
232 if (src) { 295 if (src) {
233 return getImgUrl(src, width, height); 296 return getImgUrl(src, width, height);
@@ -344,19 +407,23 @@ export default { @@ -344,19 +407,23 @@ export default {
344 407
345 // 选择出售或购买 408 // 选择出售或购买
346 async onSelectTradeProduct(tradeProduct) { 409 async onSelectTradeProduct(tradeProduct) {
  410 + /**
  411 + * 数据埋点
  412 + * 商品详情页点击出售/购买/求购按钮
  413 + * event: XY_UFO_PRD_DT_SALE_C
  414 + * params: 1.TAB_ID:1-出售,2-购买,3-求购;
  415 + * 2.PRD_ID:商品ID;
  416 + */
  417 + this.$store.dispatch('reportYas', {
  418 + params: {
  419 + appop: 'XY_UFO_PRD_DT_BUY_SEL_C',
  420 + param: {
  421 + TAB_ID: this.selectSizeConfig.type === 'buy' ? 2 : 1,
  422 + PRD_ID: tradeProduct.productId
  423 + },
  424 + }
  425 + });
347 if (this.selectSizeConfig.type === 'buy') { 426 if (this.selectSizeConfig.type === 'buy') {
348 - //数据埋点  
349 - this.$store.dispatch('reportYas', {  
350 - params: {  
351 - appop: 'XY_UFO_PRD_DT_BUY_SEL_C',  
352 - param: {  
353 - PRD_ID: tradeProduct.productId,  
354 - PRD_SKU: tradeProduct.skup,  
355 - PRD_SIZE: tradeProduct.size_name,  
356 - },  
357 - }  
358 - });  
359 -  
360 try { 427 try {
361 const info = await this.payment({ 428 const info = await this.payment({
362 skup: tradeProduct.skup, 429 skup: tradeProduct.skup,
@@ -423,6 +490,15 @@ export default { @@ -423,6 +490,15 @@ export default {
423 // 打开求购列表 490 // 打开求购列表
424 qiugou() { 491 qiugou() {
425 this.showBidSheet = true; 492 this.showBidSheet = true;
  493 + this.$store.dispatch('reportYas', {
  494 + params: {
  495 + appop: 'XY_UFO_PRD_DT_SALE_C',
  496 + param: {
  497 + TAB_ID: 3,
  498 + PRD_ID: this.productId,
  499 + },
  500 + }
  501 + });
426 }, 502 },
427 503
428 // 购买 504 // 购买
@@ -432,6 +508,21 @@ export default { @@ -432,6 +508,21 @@ export default {
432 508
433 // 资源位 509 // 资源位
434 gotoNewPage(url) { 510 gotoNewPage(url) {
  511 + /**
  512 + * 商品详情页中的资源位点击
  513 + * XY_UFO_GDS_DT_BANNER_C
  514 + * 1.PRD_ID:商品ID
  515 + * 2.ACTION_URL:跳转的URL
  516 + */
  517 + this.$store.dispatch('reportYas', {
  518 + params: {
  519 + appop: 'XY_UFO_GDS_DT_BANNER_C',
  520 + param: {
  521 + PRD_ID: this.productId,
  522 + ACTION_URL: url,
  523 + },
  524 + }
  525 + });
435 this.$xianyu.goXianyuNewPage({url}); 526 this.$xianyu.goXianyuNewPage({url});
436 }, 527 },
437 }, 528 },
@@ -550,7 +641,8 @@ export default { @@ -550,7 +641,8 @@ export default {
550 .info-price { 641 .info-price {
551 color: #d0021b; 642 color: #d0021b;
552 font-size: 48px; 643 font-size: 48px;
553 - font-family: $num-font; 644 +
  645 + @include num;
554 font-weight: bold; 646 font-weight: bold;
555 line-height: 56px; 647 line-height: 56px;
556 height: 56px; 648 height: 56px;
@@ -17,7 +17,8 @@ export default function() { @@ -17,7 +17,8 @@ export default function() {
17 validStatus 17 validStatus
18 } = data; 18 } = data;
19 19
20 - state.alipayAccount = maskAccount(alipayAccount); 20 + // state.alipayAccount = maskAccount(alipayAccount);
  21 + state.alipayAccount = alipayAccount;
21 state.nickName = nickName || ''; 22 state.nickName = nickName || '';
22 state.certName = certName; 23 state.certName = certName;
23 state.validStatus = validStatus; 24 state.validStatus = validStatus;
@@ -106,7 +106,7 @@ export default function() { @@ -106,7 +106,7 @@ export default function() {
106 page: 'tradeIncome', 106 page: 'tradeIncome',
107 }, // 原交易收入 tradeIncome, 余额 income 107 }, // 原交易收入 tradeIncome, 余额 income
108 buyOrder: { 108 buyOrder: {
109 - title: '我的订单', 109 + title: '我的购买订单',
110 num: state.buyNum, 110 num: state.buyNum,
111 page: 'OrderList', 111 page: 'OrderList',
112 params: { owner: ownType.BUY, status: 1 }, 112 params: { owner: ownType.BUY, status: 1 },
@@ -408,6 +408,8 @@ export default function() { @@ -408,6 +408,8 @@ export default function() {
408 assetData.list = newList; 408 assetData.list = newList;
409 commit('addAssets', assetData); 409 commit('addAssets', assetData);
410 } 410 }
  411 +
  412 + return result;
411 }, 413 },
412 414
413 async fetchWallet( 415 async fetchWallet(
@@ -6,13 +6,13 @@ export default { @@ -6,13 +6,13 @@ export default {
6 ensureProduct({ commit }, { productId }) { 6 ensureProduct({ commit }, { productId }) {
7 commit(Types.ENSURE_PRODUCT_DETAIL, { productId }); 7 commit(Types.ENSURE_PRODUCT_DETAIL, { productId });
8 }, 8 },
9 - async fetchProductInfo({ commit }, { productId }) { 9 + async fetchProductInfo({ commit, state }, { productId }) {
10 const queryTasks = ['', '/resource', '/activity', '/recommend'].map(path => { 10 const queryTasks = ['', '/resource', '/activity', '/recommend'].map(path => {
11 let params = { product_id: productId }; 11 let params = { product_id: productId };
12 12
13 if (path === '/resource') { 13 if (path === '/resource') {
14 params = { 14 params = {
15 - content_code: '05e4f5782dfc3a5e10d39b8f04a7dcb9', 15 + content_code: state.resourceContentCode,
16 }; 16 };
17 } 17 }
18 return this.$api.post(`/api/ufo/product${path}`, params).then(result => { 18 return this.$api.post(`/api/ufo/product${path}`, params).then(result => {
@@ -50,7 +50,7 @@ export function defaultProduct() { @@ -50,7 +50,7 @@ export function defaultProduct() {
50 export function defaultState() { 50 export function defaultState() {
51 return { 51 return {
52 products: {}, 52 products: {},
53 - 53 + resourceContentCode: '05e4f5782dfc3a5e10d39b8f04a7dcb9', // 资源位code,当前只有一个固定的code
54 /** 54 /**
55 1: 当前商品对应品牌系统的推荐 55 1: 当前商品对应品牌系统的推荐
56 2: 商品详情页面取前3 56 2: 商品详情页面取前3
@@ -26,6 +26,7 @@ const webpackConfig = { @@ -26,6 +26,7 @@ const webpackConfig = {
26 alias: { 26 alias: {
27 vue$: 'vue/dist/vue.runtime.esm.js', 27 vue$: 'vue/dist/vue.runtime.esm.js',
28 'lottie-web': 'lottie-web/build/player/lottie_light.min.js', 28 'lottie-web': 'lottie-web/build/player/lottie_light.min.js',
  29 + '@': resolve('apps')
29 }, 30 },
30 modules: [path.join(__dirname, '../apps'), 'node_modules'], 31 modules: [path.join(__dirname, '../apps'), 'node_modules'],
31 }, 32 },
@@ -76,7 +76,7 @@ const webpackConfig = merge(baseConfig, { @@ -76,7 +76,7 @@ const webpackConfig = merge(baseConfig, {
76 loader: 'sass-loader', 76 loader: 'sass-loader',
77 options: { 77 options: {
78 sourceMap: isProd, 78 sourceMap: isProd,
79 - // data: '@import "variables";', 79 + data: '@import "@/statics/scss/variable.scss";',
80 }, 80 },
81 }, 81 },
82 ], 82 ],
@@ -191,7 +191,7 @@ const devRender = (route) => { @@ -191,7 +191,7 @@ const devRender = (route) => {
191 const ck = getCacheKey(req, route); 191 const ck = getCacheKey(req, route);
192 192
193 if (route.accessLog) { 193 if (route.accessLog) {
194 - logger.info(`${req.yoho.clientIp} | ${req.url} | uid:${req.user.uid} | ${new Date()}`); 194 + logger.info(`[page access] ${req.yoho.clientIp} | ${req.url} | uid:${req.user.uid} | ${new Date()}`);
195 } 195 }
196 196
197 // return require('request-promise')({ 197 // return require('request-promise')({
@@ -64,7 +64,8 @@ module.exports = (app) => { @@ -64,7 +64,8 @@ module.exports = (app) => {
64 }, 64 },
65 cookie: { 65 cookie: {
66 domain: 'yohobuy.com', 66 domain: 'yohobuy.com',
67 - httpOnly: true 67 + httpOnly: true,
  68 + maxAge: 1000 * 60 * 60 * 24 * 7 // 7天
68 }, 69 },
69 store: new RedisStore(Object.assign(config.redis.session, { 70 store: new RedisStore(Object.assign(config.redis.session, {
70 logErrors: (e) => { 71 logErrors: (e) => {