Authored by yyq

Merge branch 'feature/invite' of git.yoho.cn:fe/ufo-app-web into feature/invite

@@ -8,7 +8,7 @@ @@ -8,7 +8,7 @@
8 <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"> 8 <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
9 <meta name="apple-mobile-web-app-status-bar-style" content="black"> 9 <meta name="apple-mobile-web-app-status-bar-style" content="black">
10 <meta content="yes" name="apple-mobile-web-app-capable"> 10 <meta content="yes" name="apple-mobile-web-app-capable">
11 - <meta content="telephone=yes" name="format-detection"> 11 + <meta content="telephone=no" name="format-detection">
12 <meta content="email=no" name="format-detection"> 12 <meta content="email=no" name="format-detection">
13 <script type="text/javascript"> 13 <script type="text/javascript">
14 (function(d,c){var e=d.documentElement,a="orientationchange" in window?"orientationchange":"resize",b=function(){var f=e.clientWidth;if(!f){return}if(f>=750){e.style.fontSize="40px"}else{e.style.fontSize=40*(f/750)+"px"}};if(!d.addEventListener){return}b();c.addEventListener(a,b,false);d.addEventListener("DOMContentLoaded",b,false)})(document,window); 14 (function(d,c){var e=d.documentElement,a="orientationchange" in window?"orientationchange":"resize",b=function(){var f=e.clientWidth;if(!f){return}if(f>=750){e.style.fontSize="40px"}else{e.style.fontSize=40*(f/750)+"px"}};if(!d.addEventListener){return}b();c.addEventListener(a,b,false);d.addEventListener("DOMContentLoaded",b,false)})(document,window);
@@ -28,7 +28,8 @@ export default { @@ -28,7 +28,8 @@ export default {
28 }, 28 },
29 props: { 29 props: {
30 card: { 30 card: {
31 - type: Object, 31 + type: Boolean,
  32 + default: false
32 } 33 }
33 }, 34 },
34 methods: { 35 methods: {
@@ -15,7 +15,7 @@ @@ -15,7 +15,7 @@
15 <tbody class="tbody"> 15 <tbody class="tbody">
16 <tr v-for="item in list"> 16 <tr v-for="item in list">
17 <td align="left"> 17 <td align="left">
18 - <span>{{item.nickName}}</span> 18 + <span class="nick-name">{{item.nickName}}</span>
19 </td> 19 </td>
20 <td align="center"> 20 <td align="center">
21 <span>{{item.enterTime}}</span> 21 <span>{{item.enterTime}}</span>
@@ -72,15 +72,23 @@ export default { @@ -72,15 +72,23 @@ export default {
72 tbody { 72 tbody {
73 tr { 73 tr {
74 height: 110px; 74 height: 110px;
75 - box-shadow: inset 0 -1px 0 0 rgba(255,255,255,0.09); 75 + border-bottom: 1px solid rgba(255, 255, 255, 0.09);
76 76
77 span { 77 span {
78 color: #94b0c4; 78 color: #94b0c4;
79 - display: inline-block; 79 + display: block;
80 height: 110px; 80 height: 110px;
81 line-height: 110px; 81 line-height: 110px;
82 } 82 }
83 } 83 }
84 } 84 }
85 } 85 }
  86 +
  87 +.nick-name {
  88 + width: 150px;
  89 + overflow: hidden;
  90 + text-overflow: ellipsis;
  91 + white-space: nowrap;
  92 +}
  93 +
86 </style> 94 </style>
@@ -41,6 +41,7 @@ @@ -41,6 +41,7 @@
41 <script> 41 <script>
42 42
43 import ClipboardJS from 'clipboard'; 43 import ClipboardJS from 'clipboard';
  44 +import {get} from 'lodash';
44 45
45 export default { 46 export default {
46 name: 'InviteCode', 47 name: 'InviteCode',
@@ -80,7 +81,7 @@ export default { @@ -80,7 +81,7 @@ export default {
80 async onClick() { 81 async onClick() {
81 const result = await this.$store.dispatch('license/form/getStoreStatus', null, { root: true}); 82 const result = await this.$store.dispatch('license/form/getStoreStatus', null, { root: true});
82 83
83 - if (result.data === true || result.data.isStoredSeller) { 84 + if (result.data === true || get(result, 'data.isStoredSeller', false)) {
84 this.$yoho.goPage('go.ufo', { 85 this.$yoho.goPage('go.ufo', {
85 pagename: 'merchantsSettled', 86 pagename: 'merchantsSettled',
86 isnavhidden: 1, 87 isnavhidden: 1,
@@ -86,7 +86,7 @@ export default { @@ -86,7 +86,7 @@ export default {
86 tbody { 86 tbody {
87 tr { 87 tr {
88 height: 110px; 88 height: 110px;
89 - box-shadow: inset 0 -1px 0 0 rgba(255, 255, 255, 0.09); 89 + border-bottom: 1px solid rgba(255, 255, 255, 0.09);
90 90
91 span { 91 span {
92 color: #94b0c4; 92 color: #94b0c4;
@@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
4 <div class="body-wrapper"> 4 <div class="body-wrapper">
5 <InviteCode class="mg" :data="inviteCode"></InviteCode> 5 <InviteCode class="mg" :data="inviteCode"></InviteCode>
6 <FriendList class="mg" :list="inviteCode.inviteRecordList" v-if="inviteCode.inviteRecordList.length > 0"></FriendList> 6 <FriendList class="mg" :list="inviteCode.inviteRecordList" v-if="inviteCode.inviteRecordList.length > 0"></FriendList>
7 - <BankStatus class="mg" :card="card"></BankStatus> 7 + <BankStatus class="mg" :card="getBandLength"></BankStatus>
8 <RecordList class="mg" :list="recordList"></RecordList> 8 <RecordList class="mg" :list="recordList"></RecordList>
9 <DescPage class="mg"></DescPage> 9 <DescPage class="mg"></DescPage>
10 </div> 10 </div>
@@ -20,12 +20,20 @@ import DescPage from '../components/desc'; @@ -20,12 +20,20 @@ import DescPage from '../components/desc';
20 import BannerPage from './components/banner'; 20 import BannerPage from './components/banner';
21 import {createNamespacedHelpers} from 'vuex'; 21 import {createNamespacedHelpers} from 'vuex';
22 22
23 -const {mapState} = createNamespacedHelpers('invite/invite'); 23 +const {mapState, mapGetters} = createNamespacedHelpers('invite/invite');
24 24
25 export default { 25 export default {
26 name: 'detailPage', 26 name: 'detailPage',
27 computed: { 27 computed: {
28 - ...mapState(['card', 'recordList', 'inviteCode']) 28 + ...mapState(['recordList', 'inviteCode']),
  29 + ...mapGetters(['getBandLength'])
  30 + },
  31 + data() {
  32 + return {
  33 + card: null
  34 + };
  35 + },
  36 + mounted() {
29 }, 37 },
30 components: { 38 components: {
31 InviteCode, 39 InviteCode,
1 import * as Types from './types'; 1 import * as Types from './types';
  2 +import {get} from 'lodash';
2 3
3 export default { 4 export default {
4 async fetchOrderList({ commit }) { 5 async fetchOrderList({ commit }) {
5 const result = await this.$api.get('/api/ufo/invite/recordList'); 6 const result = await this.$api.get('/api/ufo/invite/recordList');
6 7
7 if (result.code === 200) { 8 if (result.code === 200) {
8 - commit(Types.FETCH_INVITE_ORDERLIST, { list: result.data.list }); 9 + commit(Types.FETCH_INVITE_ORDERLIST, { list: get(result, 'data.list', []) });
9 } 10 }
10 }, 11 },
11 12
@@ -13,7 +14,9 @@ export default { @@ -13,7 +14,9 @@ export default {
13 const result = await this.$api.get('/api/ufo/invite/friendList'); 14 const result = await this.$api.get('/api/ufo/invite/friendList');
14 15
15 if (result.code === 200) { 16 if (result.code === 200) {
16 - commit(Types.FETCH_INVITE_CODE, result.data); 17 + commit(Types.FETCH_INVITE_CODE, Object.assign({
  18 + inviteRecordList: []
  19 + }, result.data));
17 } 20 }
18 }, 21 },
19 22
@@ -32,8 +35,7 @@ export default { @@ -32,8 +35,7 @@ export default {
32 async fetchAll({ dispatch }) { 35 async fetchAll({ dispatch }) {
33 return Promise.all([ 36 return Promise.all([
34 dispatch('fetchFriendList'), 37 dispatch('fetchFriendList'),
35 - dispatch('fetchOrderList'),  
36 - dispatch('mine/bankCard/fetchBankCard', null, { root: true }) 38 + dispatch('fetchOrderList')
37 ]); 39 ]);
38 } 40 }
39 }; 41 };
@@ -16,6 +16,11 @@ export default function() { @@ -16,6 +16,11 @@ export default function() {
16 status: 0 16 status: 0
17 }, 17 },
18 actions, 18 actions,
19 - mutations 19 + mutations,
  20 + getters: {
  21 + getBandLength(state, getters, rootState) {
  22 + return rootState.mine.bankCard.bankCardList.length === 1;
  23 + }
  24 + }
20 }; 25 };
21 } 26 }