Authored by Tao

Merge branch 'develop' of http://git.yoho.cn/fe/xianyu-ufo-app-web into develop

@@ -59,6 +59,7 @@ const xianyu = { @@ -59,6 +59,7 @@ const xianyu = {
59 }, 59 },
60 60
61 goXianyuNewPage(args) { 61 goXianyuNewPage(args) {
  62 + console.log(args);
62 if (!args.url) { 63 if (!args.url) {
63 return; 64 return;
64 } 65 }
@@ -8,7 +8,6 @@ @@ -8,7 +8,6 @@
8 :totalTime="totalTime" 8 :totalTime="totalTime"
9 :lineWidth="lineWidth" 9 :lineWidth="lineWidth"
10 ></canvas> 10 ></canvas>
11 - <p>{{desc}}</p>  
12 </div> 11 </div>
13 12
14 </template> 13 </template>
@@ -21,7 +20,7 @@ @@ -21,7 +20,7 @@
21 * 在自己的页面做定时器,修改time, 20 * 在自己的页面做定时器,修改time,
22 */ 21 */
23 export default { // 环形倒计时 22 export default { // 环形倒计时
24 - name: 'count-circle', 23 + name: 'CountCircle',
25 props: { 24 props: {
26 time: { 25 time: {
27 type: Number, 26 type: Number,
@@ -35,10 +34,6 @@ export default { // 环形倒计时 @@ -35,10 +34,6 @@ export default { // 环形倒计时
35 type: Number, 34 type: Number,
36 default: 8 35 default: 8
37 }, 36 },
38 - desc: {  
39 - type: String,  
40 - default: '正在支付中...'  
41 - }  
42 }, 37 },
43 data() { 38 data() {
44 return { 39 return {
@@ -80,7 +75,6 @@ export default { // 环形倒计时 @@ -80,7 +75,6 @@ export default { // 环形倒计时
80 y: this.canvasHeight / 2, 75 y: this.canvasHeight / 2,
81 radius: this.canvasWidth / 2 76 radius: this.canvasWidth / 2
82 }; 77 };
83 - console.log(this.canvas, this.circle, this.time, this.totalTime);  
84 }, 78 },
85 drawCircle() { 79 drawCircle() {
86 if (this.canvas && this.context) { 80 if (this.canvas && this.context) {
1 <template> 1 <template>
2 <LayoutApp :show-back="true" :title="title"> 2 <LayoutApp :show-back="true" :title="title">
3 - <Scroll :scrollEvents="['scroll']" :options="scrollOptions" @scroll="scroll" 3 + <Scroll :scroll-events="['scroll-end','scroll']"
  4 + @scroll-end="fetchList"
4 v-if="favoriteProductList.list.length" 5 v-if="favoriteProductList.list.length"
5 - @pulling-up="onPullingUp"> 6 + >
6 <ProductList :list="favoriteProductList.list"></ProductList> 7 <ProductList :list="favoriteProductList.list"></ProductList>
7 </Scroll> 8 </Scroll>
8 <!-- <empty-list v-show="!isShowEmpty" /> --> 9 <!-- <empty-list v-show="!isShowEmpty" /> -->
@@ -42,20 +43,23 @@ export default { @@ -42,20 +43,23 @@ export default {
42 this.fetchFavoriteList(); 43 this.fetchFavoriteList();
43 }, 44 },
44 methods: { 45 methods: {
45 - ...mapActions(['fetchFavoriteList','isShowEmpty']), 46 + ...mapActions(['fetchFavoriteList','isMore']),
46 47
47 - async onPullingUp() {  
48 - await this.fetchFavoriteList(); 48 + async fetchList() {
  49 + if(isMore){
  50 + await this.fetchFavoriteList();
  51 + }
  52 +
49 }, 53 },
50 - scroll({ y }) {  
51 - const height = this.$refs.banner.$el.offsetHeight + this.$refs.header.offsetHeight; 54 + // scroll({ y }) {
  55 + // const height = this.$refs.banner.$el.offsetHeight + this.$refs.header.offsetHeight;
52 56
53 - if (-y >= height) {  
54 - this.fixed = true;  
55 - } else {  
56 - this.fixed = false;  
57 - }  
58 - } 57 + // if (-y >= height) {
  58 + // this.fixed = true;
  59 + // } else {
  60 + // this.fixed = false;
  61 + // }
  62 + // }
59 }, 63 },
60 64
61 computed: { 65 computed: {
@@ -24,7 +24,7 @@ export default { @@ -24,7 +24,7 @@ export default {
24 ...mapState( 24 ...mapState(
25 { 25 {
26 amountPart1: (state) => { 26 amountPart1: (state) => {
27 - return (''+state.userWalletInfo.walletAmount).split('.')[0] 27 + return (''+state.userWalletInfo.walletAmount).split('.')[0].split('¥')[1]
28 }, 28 },
29 amountPart2: (state) => { 29 amountPart2: (state) => {
30 return (''+state.userWalletInfo.walletAmount).split('.')[1] 30 return (''+state.userWalletInfo.walletAmount).split('.')[1]
@@ -46,7 +46,7 @@ export default { @@ -46,7 +46,7 @@ export default {
46 }, 46 },
47 onLinkClick() { 47 onLinkClick() {
48 if (this.url) { 48 if (this.url) {
49 - 49 + this.$xianyu.goXianyuNewPage({url: this.url});
50 } 50 }
51 } 51 }
52 } 52 }
@@ -242,9 +242,9 @@ export default { @@ -242,9 +242,9 @@ export default {
242 this.platformFeeModalVisible = true; 242 this.platformFeeModalVisible = true;
243 }, 243 },
244 244
245 - showEarnestQuestion() { // 跳转保证金页面 245 + showEarnestQuestion() { // 跳转保证金说明页
246 console.log('showEarnest'); 246 console.log('showEarnest');
247 - 247 + this.$xianyu.goXianyuNewPage({url: this.agreementURL});
248 }, 248 },
249 249
250 /** 250 /**
1 import { get, set } from 'lodash'; 1 import { get, set } from 'lodash';
2 import { getImgUrl } from '../../common/utils'; 2 import { getImgUrl } from '../../common/utils';
3 import Vue from 'vue'; 3 import Vue from 'vue';
4 -const uid = '500031170'; 4 +// const uid = '500031170';
5 5
6 export default function() { 6 export default function() {
7 return { 7 return {
@@ -13,17 +13,23 @@ export default function() { @@ -13,17 +13,23 @@ export default function() {
13 favoriteProductList: { 13 favoriteProductList: {
14 list:[] 14 list:[]
15 }, 15 },
16 - isShowEmpty: false, 16 + isMore: true,
17 }, 17 },
18 mutations: { 18 mutations: {
19 addList(state, { data }) { 19 addList(state, { data }) {
20 console.log(data) 20 console.log(data)
21 if(data && data.product_list){ 21 if(data && data.product_list){
22 // data.product_list. 22 // data.product_list.
23 - let { page, product_list = [] } = data; 23 + let { page, product_list = [], pageTotal } = data;
24 let isShowEmpty = page === 1 && product_list === 0; 24 let isShowEmpty = page === 1 && product_list === 0;
25 // console.log("isShowEmpty:"+isShowEmpty) 25 // console.log("isShowEmpty:"+isShowEmpty)
26 // state.isShowEmpty = isShowEmpty 26 // state.isShowEmpty = isShowEmpty
  27 + if(pageTotal > page){
  28 + state.isMore = true;
  29 + }
  30 + state.pageTotal = pageTotal;
  31 + state.page = page + 1;
  32 +
27 let list = state.favoriteProductList.list.concat(product_list); 33 let list = state.favoriteProductList.list.concat(product_list);
28 Vue.set(state.favoriteProductList, "list", list); 34 Vue.set(state.favoriteProductList, "list", list);
29 }else { 35 }else {
@@ -38,16 +44,21 @@ export default function() { @@ -38,16 +44,21 @@ export default function() {
38 44
39 }, 45 },
40 actions: { 46 actions: {
41 - async fetchFavoriteList({ commit }) {  
42 - const result = await this.$api.get('/api/ufo/home/favoriteProduct', {uid});  
43 - if (result.code === 200) {  
44 - let data =result.data;  
45 - commit('addList', { data:data });  
46 - }else {  
47 - // console.log("error=//=isShowEmpty:")  
48 - commit('errorData');  
49 - }  
50 - return result.data || []; 47 + async fetchFavoriteList({ commit, state }) {
  48 + let page = state.page;
  49 + let limit = 20;
  50 + const result = await this.$api.get('/api/ufo/home/favoriteProduct', {page, limit});
  51 + if (result.code === 200) {
  52 + let data =result.data;
  53 + commit('addList', { data:data });
  54 + }else {
  55 + // console.log("error=//=isShowEmpty:")
  56 + commit('errorData');
  57 + }
  58 + return result.data || [];
  59 + // }else {
  60 + // return [];
  61 + // }
51 }, 62 },
52 }, 63 },
53 }; 64 };
@@ -46,11 +46,11 @@ export default function() { @@ -46,11 +46,11 @@ export default function() {
46 endTime: 0, 46 endTime: 0,
47 }, 47 },
48 userWalletInfo: { 48 userWalletInfo: {
49 - totalAmount: 0.0, 49 + totalAmount: 0.00,
50 withdrawLimit: 0, 50 withdrawLimit: 0,
51 withdrawAmount: 0, 51 withdrawAmount: 0,
52 shareSettlementAmount: 0, 52 shareSettlementAmount: 0,
53 - walletAmount: 0.0, 53 + walletAmount: '¥0.00',
54 }, 54 },
55 filterData: { 55 filterData: {
56 tradeTypes: [], 56 tradeTypes: [],
@@ -102,7 +102,7 @@ export default function() { @@ -102,7 +102,7 @@ export default function() {
102 resource1: { name: 'resource1', data: state.resource1 }, 102 resource1: { name: 'resource1', data: state.resource1 },
103 income: { 103 income: {
104 title: '我的收入', 104 title: '我的收入',
105 - num: '¥' + state.userWalletInfo.walletAmount, 105 + num: state.userWalletInfo.walletAmount,
106 page: 'income', 106 page: 'income',
107 }, // 原交易收入 tradeIncome 107 }, // 原交易收入 tradeIncome
108 buyOrder: { 108 buyOrder: {
@@ -249,6 +249,8 @@ export default function() { @@ -249,6 +249,8 @@ export default function() {
249 state.walletData.endTime = endTime; 249 state.walletData.endTime = endTime;
250 }, 250 },
251 addUserWalletInfo(state, data) { 251 addUserWalletInfo(state, data) {
  252 + // data.totalAmount = formatNumber(data.totalAmount);
  253 + data.walletAmount = formatNumber(data.walletAmount);
252 state.userWalletInfo = data; 254 state.userWalletInfo = data;
253 }, 255 },
254 addfilterData(state, data) { 256 addfilterData(state, data) {
@@ -84,6 +84,7 @@ module.exports = { @@ -84,6 +84,7 @@ module.exports = {
84 ufo: true, 84 ufo: true,
85 api: 'ufo.user.favoriteList', 85 api: 'ufo.user.favoriteList',
86 params: {}, 86 params: {},
  87 + auth: true,
87 }, 88 },
88 '/api/ufo/channel/channelList': { 89 '/api/ufo/channel/channelList': {
89 ufo: true, 90 ufo: true,