Skip to content
This repository has been archived by the owner on Feb 25, 2019. It is now read-only.

Commit

Permalink
Merge pull request #80 from StellarCN/v2.0.0
Browse files Browse the repository at this point in the history
features: updates and importaccount
  • Loading branch information
imloama authored May 1, 2018
2 parents 4c2a033 + 8e3f54b commit b72f7ec
Show file tree
Hide file tree
Showing 14 changed files with 480 additions and 36 deletions.
2 changes: 1 addition & 1 deletion config.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.github.stellarcn.firefly" version="2.0.3" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<widget id="com.github.stellarcn.firefly" version="2.0.4" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>firefly</name>
<description>
stellar wallet
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "firefly",
"version": "2.0.3",
"version": "2.0.4",
"description": "stellar mobile wallet",
"repository": {
"type": "git",
Expand Down
62 changes: 60 additions & 2 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,33 @@
<router-view />
</v-content>
<tab-bar v-if="tabBarShow"/>

<v-dialog v-model="updateConfirmDlg" max-width="95%" persistent>
<div>
<div class="a-card-content">
<div class="avatar-div textcenter">
<v-avatar>
<img src="./assets/img/logo-red.png" />
</v-avatar>
</div>
<div class="a-t1 a-red textcenter" v-if="updating">{{$t('UpdateHint')}}</div>
<div class="a-t1 a-red textcenter" v-if="!updating">{{$t('FindNewVersion',[latestVersion])}}</div>
<div class="a-btns flex-row" v-if="!updating">
<div class="flex1 a-red textcenter" @click="doUpdate">{{$t('Update')}}</div>
<div class="flex1 a-red textcenter" @click="updateConfirmDlg = false">{{$t('Button.Cancel')}}</div>
</div>
</div>
</div>
</v-dialog>


</v-app>

<div class="fuzzy-view" v-if="showFuzzyView">

</div>


</div>
</template>

Expand All @@ -29,6 +50,7 @@ import { getDeviceLanguage } from "@/locales";
import TabBar from '@/components/TabBar'
import { getFchainRss } from '@/api/fchain'
import initCordovaPlugin from '@/libs/pkgs/initCordovaPlugin'
import updateMixin from '@/mixins/update'
export default {
data() {
Expand All @@ -42,6 +64,9 @@ export default {
tabBarItems: ['MyAssets', 'TradeCenter', 'Funding', 'My'],
messagesInterval: null,
updateConfirmDlg: false,
latestVersion: null,
updating: false,
// items:Store.fetch(),
};
},
Expand All @@ -64,6 +89,7 @@ export default {
accounts: state => state.accounts.data
})
},
mixins: [updateMixin],
beforeMount() {
if(this.tabBarItems.indexOf(this.$route.name) >=0 ){
Expand Down Expand Up @@ -177,6 +203,20 @@ export default {
this.$router.push({ name: "Picklanguage" });
}
});
//检查更新
this.getReleaseVersion()
.then(data=>{
if(data.needUpdate){
this.updateConfirmDlg = true
this.latestVersion = data.latestVersion
}
})
.catch(err=>{
console.error(err)
this.updateConfirmDlg = false
})
});
},
mounted() {
Expand Down Expand Up @@ -218,6 +258,10 @@ export default {
this.$router.push({ name: "PinLock" });
}
}
},
doUpdate(){
this.updating = true
this.checkForUpdates()
}
// toPicklanguage(){
// this.$router.push({name:'Picklanguage'})
Expand All @@ -241,7 +285,7 @@ export default {
background-color: $primarycolor.gray;
}
.hide {
.bg-hide {
background: none;
background-color: transparent;
}
Expand Down Expand Up @@ -332,6 +376,20 @@ export default {
// .ios-app
// .page
// padding-top: .2rem!important
.a-card-content
padding: 20px 10px
background: $secondarycolor.gray
.a-t1
font-size: 20px
padding-top: 5px
padding-bottom: 5px
.a-red
color: $primarycolor.red
.a-btns
font-size: 16px
@css {
html{
background: none;
Expand All @@ -349,7 +407,7 @@ export default {
.app.application.theme--dark{
background: #212122;
}
.app.application.theme--dark.hide{
.app.application.theme--dark.bg-hide{
background: none;
background-color:transparent;
}
Expand Down
38 changes: 22 additions & 16 deletions src/components/QRScan.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
</template>

<script>
const HIDE_CLASSNAME = 'bg-hide'
export default {
data(){
return {
Expand Down Expand Up @@ -55,18 +56,20 @@ export default {
this.closeQRScanner()
}else{
// 成功
QRScanner.cancelScan()
QRScanner.destroy(()=>{
console.log('destory qrscanner')
})
this.$emit('finish',result)
}
}
})
var body = window.document.querySelector('body')
this.addClass(body,'hide')
this.addClass(body,HIDE_CLASSNAME)
var app = window.document.querySelector('.app')
this.addClass(app,'hide')
this.addClass(app,HIDE_CLASSNAME)
var page = window.document.querySelector('.page')
this.addClass(page,'hide')
this.addClass(page,HIDE_CLASSNAME)
//var loading = window.document.querySelector('.loading')
//this.addClass(loading,'hide')
QRScanner.show()
Expand All @@ -78,11 +81,11 @@ export default {
}
//window.document.querySelector('.app').classList.remove('hide');
var body = window.document.querySelector('body')
this.removeClass(body,'hide')
this.removeClass(body,HIDE_CLASSNAME)
var app = window.document.querySelector('.app')
this.removeClass(app,'hide')
this.removeClass(app,HIDE_CLASSNAME)
var page = window.document.querySelector('.page')
this.removeClass(page,'hide')
this.removeClass(page,HIDE_CLASSNAME)
//var loading = window.document.querySelector('.loading')
//this.removeClass(loading,'hide')
QRScanner.destroy()
Expand Down Expand Up @@ -128,7 +131,10 @@ export default {
this.isBackCamera = !this.isBackCamera
},
hasClass(ele, cls) {
return ele.className.match(new RegExp("(\\s|^)" + cls + "(\\s|$)"));
if(ele){
return ele.className.match(new RegExp("(\\s|^)" + cls + "(\\s|$)"));
}
return false
},
//为指定的dom元素添加样式
addClass(ele, cls) {
Expand Down Expand Up @@ -165,18 +171,18 @@ export default {
left: 0
right: 0
.qrscanner-area
width: 100%
height: 85%
background: url(../assets/img/scanner.svg) no-repeat center center
background-size: 50%
background-color:transparent
width: 100%!important
height: 85%!important
background: url(../assets/img/scanner.svg) no-repeat center center!important
background-size: 50%!important
background-color:transparent!important
.qrscanner-btn-group
text-align: center
background: none
text-align: center!important
background: none!important
.qrscanner-btn
padding: 12px 5px
display: inline-block
display: inline-block!important
text-align: center
vertical-align: middle
justify-content: center;
Expand Down
61 changes: 57 additions & 4 deletions src/components/SecretKeyInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,41 @@
* @Author: mazhaoyong@gmail.com
* @Date: 2018-03-05 17:30:09
* @Last Modified by: mazhaoyong@gmail.com
* @Last Modified time: 2018-04-29 14:05:02
* @Last Modified time: 2018-05-01 15:14:45
* @License MIT
*/
<template>
<div>

<v-text-field dark
:label="$t('SecretKey')"
v-model="seedInput"
required
multi-line
:disabled="disabled"
class="seed-input"
onpaste="return false"
:onpaste="pasteHandler"
:onfocus="focusHandler"
@input="inputText"
rows=2></v-text-field>
rows=3></v-text-field>

<secret-keyboard
:onChange="keyBoardChange"
:onDone="keyBoardDone"
:onBack="keyBoardBack"
/>
</div>

</template>

<script>
import endsWith from 'lodash/endsWith'
import util from './SecretKeyInputUtil'
import SecretKeyboard from '@/libs/custom-keyboard/SecretKeyboard'
export default {
data(){
return {
seedInput: 'S-',
seedInput: '',
cleaveInstance: null,
blocks: [1,5,5,5,5,5,5,5,5,5,5,5],
delimiter: '-',
Expand All @@ -36,7 +47,25 @@
}
},
props:{
enablePaste:{
type: Boolean,
default: false
},
disabled: {
type: Boolean,
default: false
},
seed:{
type: String
}
},
watch: {
},
methods:{
pasteHandler(){
return this.enablePaste
},
inputText(value){
if(value && endsWith(value, this.delimiter)){
this.seedInput = this.seedInput.substr(0, this.seedInput.length -1)
Expand Down Expand Up @@ -77,12 +106,36 @@
},
getSeed(){
if(this.seed)return this.seed.toUpperCase()
if(this.seedInput){
return this.seedInput.replace(new RegExp(this.delimiter, 'gm'), '').toUpperCase()
}
return null
},
keyBoardChange(val){
let str = this.seedInput||''
str += val
this.inputText(str)
},
keyBoardDone(){
console.log('done')
},
keyBoardBack(){
let str = this.seedInput
if(str && str.length > 1)
this.seedInput = str.substring(0, str.length -1)
this.inputText(this.seedInput)
},
focusHandler(){
//禁止弹出输入框
document.activeElement.blur()
}
},
components: {
SecretKeyboard,
}
}
</script>
Expand Down
Loading

0 comments on commit b72f7ec

Please sign in to comment.