Authored by huzhiming

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

@@ -202,6 +202,17 @@ const xianyu = { @@ -202,6 +202,17 @@ const xianyu = {
202 errorAction && errorAction(error); 202 errorAction && errorAction(error);
203 }); 203 });
204 } 204 }
  205 + },
  206 + getClientInfo(okAction, errorAction) {
  207 + if (this.isAliApp && window.WindVane) {
  208 + window.WindVane.call('WVNativeDetector', 'getModelInfo', {}, data => {
  209 + okAction && okAction(data);
  210 + }, error => {
  211 + errorAction && errorAction(error);
  212 + });
  213 + } else {
  214 + errorAction && errorAction();
  215 + }
205 } 216 }
206 }; 217 };
207 218
@@ -32,6 +32,11 @@ import 'video.js/dist/video-js.css'; @@ -32,6 +32,11 @@ import 'video.js/dist/video-js.css';
32 32
33 import sdk from 'yoho-activity-sdk'; 33 import sdk from 'yoho-activity-sdk';
34 34
  35 +if (process.env.NODE_ENV === 'development') {
  36 + const VConsole = require('vconsole');
  37 + const vConsole = new VConsole();
  38 +}
  39 +
35 import { 40 import {
36 initClient, 41 initClient,
37 initBaseLogs 42 initBaseLogs
@@ -78,6 +83,7 @@ Vue.use(ChangeBidPriceDialog); @@ -78,6 +83,7 @@ Vue.use(ChangeBidPriceDialog);
78 initClient(store); 83 initClient(store);
79 initBaseLogs(); 84 initBaseLogs();
80 85
  86 +store.$xianyu = xianyu;
81 xianyu.$router = router; 87 xianyu.$router = router;
82 yoho.auth = async(args) => { 88 yoho.auth = async(args) => {
83 let { 89 let {
1 import * as Types from './types'; 1 import * as Types from './types';
2 import cookie from 'yoho-cookie'; 2 import cookie from 'yoho-cookie';
3 -import { merge } from 'lodash'; 3 +import { get, set, merge } from 'lodash';
4 4
5 export default function(mergeState = {}) { 5 export default function(mergeState = {}) {
6 return { 6 return {
@@ -201,12 +201,38 @@ export default function(mergeState = {}) { @@ -201,12 +201,38 @@ export default function(mergeState = {}) {
201 { 201 {
202 params: { appop, param }, 202 params: { appop, param },
203 asyncindx = false, 203 asyncindx = false,
  204 + retry = false
204 }, 205 },
205 ) { 206 ) {
  207 +
206 try { 208 try {
207 // console.log(appop) 209 // console.log(appop)
208 // console.log(param) 210 // console.log(param)
209 setTimeout(() => { 211 setTimeout(() => {
  212 + // 获取设备信息
  213 + if (!retry && !get(window, 'appBaseLogs.device.dm') && this.$xianyu.getClientInfo) {
  214 + this.$xianyu.getClientInfo(info => {
  215 + info = info || {}
  216 + set(window, 'appBaseLogs.device.dm', info.platformName ? info.platformName : `${info.brand} ${info.model}`);
  217 +
  218 + this.dispatch('reportYas', {
  219 + params: { appop, param },
  220 + asyncindx,
  221 + retry: true
  222 + });
  223 + }, (error) => {
  224 + error && set(window, 'appBaseLogs.device.dm', 'unknown');
  225 +
  226 + this.dispatch('reportYas', {
  227 + params: { appop, param },
  228 + asyncindx,
  229 + retry: true
  230 + });
  231 + });
  232 +
  233 + return;
  234 + }
  235 +
210 if (window._yas && window._yas.sendAppLogs) { 236 if (window._yas && window._yas.sendAppLogs) {
211 param = param || {}; 237 param = param || {};
212 238
1 { 1 {
2 "name": "xianyu-ufo-app-web", 2 "name": "xianyu-ufo-app-web",
3 - "version": "0.0.2-beta-1", 3 + "version": "0.0.2-beta-2",
4 "private": true, 4 "private": true,
5 "description": "Xianyu Project With Express", 5 "description": "Xianyu Project With Express",
6 "repository": { 6 "repository": {
@@ -131,6 +131,7 @@ @@ -131,6 +131,7 @@
131 "terser-webpack-plugin": "^2.1.3", 131 "terser-webpack-plugin": "^2.1.3",
132 "uglifyjs-webpack-plugin": "^2.2.0", 132 "uglifyjs-webpack-plugin": "^2.2.0",
133 "url-loader": "^1.1.2", 133 "url-loader": "^1.1.2",
  134 + "vconsole": "^3.3.4",
134 "webpack": "4.16.5", 135 "webpack": "4.16.5",
135 "webpack-bundle-analyzer": "^3.0.3", 136 "webpack-bundle-analyzer": "^3.0.3",
136 "webpack-cli": "^3.1.2", 137 "webpack-cli": "^3.1.2",
@@ -10893,6 +10893,11 @@ vary@~1.1.2: @@ -10893,6 +10893,11 @@ vary@~1.1.2:
10893 resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" 10893 resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc"
10894 integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw= 10894 integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=
10895 10895
  10896 +vconsole@^3.3.4:
  10897 + version "3.3.4"
  10898 + resolved "http://npm.yohops.com/vconsole/-/vconsole-3.3.4.tgz#a7dacd8887b3d3e902e8d18425cda56c34e77f51"
  10899 + integrity sha1-p9rNiIez0+kC6NGEJc2lbDTnf1E=
  10900 +
10896 verror@1.10.0: 10901 verror@1.10.0:
10897 version "1.10.0" 10902 version "1.10.0"
10898 resolved "http://npm.yohops.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" 10903 resolved "http://npm.yohops.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400"