From 57bb9a39e3f797b5a8e9523c05cb7872e5de634f Mon Sep 17 00:00:00 2001 From: Toyobayashi Date: Tue, 22 May 2018 18:53:57 +0800 Subject: [PATCH] [renderer] event_available.reward_id => event_data.bg_id --- .npmrc | 2 +- package-lock.json | 22 +++++++++++----------- package.json | 2 +- src/ts/renderer/mishiro-update.ts | 17 ++++++++++------- 4 files changed, 23 insertions(+), 20 deletions(-) diff --git a/.npmrc b/.npmrc index 6a036f8..15f965a 100644 --- a/.npmrc +++ b/.npmrc @@ -1,4 +1,4 @@ build_from_source = true runtime = "electron" -target = "2.0.0" +target = "2.0.1" dist_url = "https://atom.io/download/electron" diff --git a/package-lock.json b/package-lock.json index 074aac6..1b6cb49 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1830,20 +1830,20 @@ } }, "electron": { - "version": "2.0.0", - "resolved": "http://registry.npm.taobao.org/electron/download/electron-2.0.0.tgz", - "integrity": "sha1-6V3H86CJpSuMKlLHyeECTbDI1G4=", + "version": "2.0.1", + "resolved": "http://registry.npm.taobao.org/electron/download/electron-2.0.1.tgz", + "integrity": "sha1-2d78wYeGIUO5AnN4vnhJDt2/q/Q=", "dev": true, "requires": { - "@types/node": "8.10.13", + "@types/node": "8.10.17", "electron-download": "3.3.0", "extract-zip": "1.6.6" }, "dependencies": { "@types/node": { - "version": "8.10.13", - "resolved": "http://registry.npm.taobao.org/@types/node/download/@types/node-8.10.13.tgz", - "integrity": "sha1-eGFTrL4+jguEQFPnLJ2fLbcceWo=", + "version": "8.10.17", + "resolved": "http://registry.npm.taobao.org/@types/node/download/@types/node-8.10.17.tgz", + "integrity": "sha1-1IzxDw3G3PWfgn9aP8ekpgBDGNM=", "dev": true } } @@ -1856,7 +1856,7 @@ "requires": { "debug": "2.6.9", "fs-extra": "0.30.0", - "home-path": "1.0.5", + "home-path": "1.0.6", "minimist": "1.2.0", "nugget": "2.0.1", "path-exists": "2.1.0", @@ -3887,9 +3887,9 @@ "dev": true }, "home-path": { - "version": "1.0.5", - "resolved": "http://registry.npm.taobao.org/home-path/download/home-path-1.0.5.tgz", - "integrity": "sha1-eIspgVsS1Tus9XVkhHbm+QQdEz8=", + "version": "1.0.6", + "resolved": "http://registry.npm.taobao.org/home-path/download/home-path-1.0.6.tgz", + "integrity": "sha1-1UncJGU4in+GZyQsWzFYjSmvKfw=", "dev": true }, "hosted-git-info": { diff --git a/package.json b/package.json index b5e703a..5e0452b 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "@types/uglifyjs-webpack-plugin": "^1.1.0", "@types/webpack": "^4.1.3", "css-loader": "^0.28.11", - "electron": "2.0.0", + "electron": "2.0.1", "electron-packager": "^12.0.2", "fs-extra": "^6.0.0", "mini-css-extract-plugin": "^0.4.0", diff --git a/src/ts/renderer/mishiro-update.ts b/src/ts/renderer/mishiro-update.ts index e2ee38c..22b1ca4 100644 --- a/src/ts/renderer/mishiro-update.ts +++ b/src/ts/renderer/mishiro-update.ts @@ -42,11 +42,13 @@ export default class extends Vue { @Prop() value!: any @Prop() isTouched!: boolean - getEventCardId (eventAvailable: any[]): number[] { - eventAvailable.sort(function (a, b) { - return a.recommend_order - b.recommend_order - }) - return [eventAvailable[0].reward_id, eventAvailable[eventAvailable.length - 1].reward_id] + getEventCardId (/* eventAvailable: any[] */eventData: any): number[] { + // eventAvailable.sort(function (a, b) { + // return a.recommend_order - b.recommend_order + // }) + // console.log(eventAvailable) + // return [eventAvailable[0].reward_id, eventAvailable[eventAvailable.length - 1].reward_id] + return [Number(eventData.bg_id) - 1] } @Emit('ready') @@ -183,8 +185,9 @@ export default class extends Vue { } } - const eventAvailable = masterData.eventAvailable - const cardId = this.getEventCardId(eventAvailable) + // const eventAvailable = masterData.eventAvailable + // const cardId = this.getEventCardId(eventAvailable) + const cardId = this.getEventCardId(masterData.eventData) if (masterData.eventHappening) { localStorage.setItem('msrEvent', `{"id":${masterData.eventData.id},"card":${Number(cardId[0]) + 1}}`)