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 #79 from StellarCN/v2.0.0
Browse files Browse the repository at this point in the history
V2.0.3
  • Loading branch information
imloama authored Apr 29, 2018
2 parents 4b49241 + 00ac185 commit 4c2a033
Show file tree
Hide file tree
Showing 18 changed files with 145 additions and 129 deletions.
4 changes: 2 additions & 2 deletions 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.1" 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.3" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>firefly</name>
<description>
stellar wallet
Expand Down Expand Up @@ -78,9 +78,9 @@
<plugin name="cordova-plugin-inappbrowser" spec="^1.7.2" />
<plugin name="cordova-plugin-globalization" spec="^1.0.9" />
<plugin name="cordova-plugin-screen-orientation" spec="^3.0.1" />
<plugin name="cordova-plugin-wkwebview-engine" spec="git+https://github.com/apache/cordova-plugin-wkwebview-engine.git" />
<plugin name="cordova-plugin-advanced-http" spec="^1.11.1" />
<plugin name="cordova-hot-code-push-plugin" spec="^1.5.3" />
<plugin name="cordova-plugin-x-socialsharing" spec="^5.3.2" />
<plugin name="cordova-plugin-themeablebrowser" spec="git+https://github.com/imloama/cordova-plugin-themeablebrowser.git" />
<plugin name="cordova-plugin-wkwebview-engine" spec="^1.1.4" />
</widget>
6 changes: 4 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "firefly",
"version": "2.0.1",
"version": "2.0.3",
"description": "stellar mobile wallet",
"repository": {
"type": "git",
Expand Down Expand Up @@ -50,7 +50,7 @@
"cordova-plugin-swift-support": "^3.1.1",
"cordova-plugin-themeablebrowser": "git+https://github.com/imloama/cordova-plugin-themeablebrowser.git",
"cordova-plugin-whitelist": "^1",
"cordova-plugin-wkwebview-engine": "git+https://github.com/apache/cordova-plugin-wkwebview-engine.git",
"cordova-plugin-wkwebview-engine": "^1.1.4",
"cordova-plugin-x-socialsharing": "^5.3.2",
"cordova-sqlite-storage": "^2.1.2",
"decimal.js": ">=9.0.1",
Expand Down Expand Up @@ -157,11 +157,11 @@
"cordova-plugin-inappbrowser": {},
"cordova-plugin-globalization": {},
"cordova-plugin-screen-orientation": {},
"cordova-plugin-wkwebview-engine": {},
"cordova-plugin-advanced-http": {},
"cordova-hot-code-push-plugin": {},
"cordova-plugin-x-socialsharing": {},
"cordova-plugin-themeablebrowser": {}
"cordova-plugin-themeablebrowser": {},
"cordova-plugin-wkwebview-engine": {}
},
"platforms": [
"browser",
Expand Down
22 changes: 15 additions & 7 deletions src/components/KLine.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @Author: mazhaoyong@gmail.com
* @Date: 2018-01-26 15:59:49
* @Last Modified by: mazhaoyong@gmail.com
* @Last Modified time: 2018-04-20 15:13:52
* @Last Modified time: 2018-04-29 16:17:03
* @License MIT
*/

Expand All @@ -19,7 +19,7 @@
{{titleData.rate}}%</div>
</div>
<div class="flex1 working" v-else>
<v-progress-circular indeterminate color="primary" v-if="lastTrade && lastTradeAggregation"></v-progress-circular>
<v-progress-circular indeterminate color="primary" v-if="!lineData"></v-progress-circular>
<span v-else></span>
</div>
</div>
Expand Down Expand Up @@ -59,6 +59,8 @@ export default {
//lastTrade:null,
tradeInterval: null,//查询最新一次交易数据的interval
working: true,
lineData: null,
}
},
props: {
Expand Down Expand Up @@ -116,9 +118,9 @@ export default {
...mapState({
tradePairKLineData: state => state.accounts.tradePairKLineData
}),
lineData(){
return this.tradePairKLineData[this.tradepairIndex]
},
// lineData(){
// return this.tradePairKLineData[this.tradepairIndex]
// },
lastTrade(){
return this.lineData ? this.lineData.lastTrade : null
},
Expand Down Expand Up @@ -161,7 +163,10 @@ export default {
}
this.deleteTradeInterval()
this.init()
}
} ,
tradePairKLineData(){
this.lineData = this.tradePairKLineData[this.tradepairIndex]
}
},
beforeMount () {
//生成随机的id
Expand All @@ -173,7 +178,7 @@ export default {
},
mounted () {
//先从缓存中取值
this.lineData = this.tradePairKLineData[this.tradepairIndex]
this.init()
},
methods: {
Expand Down Expand Up @@ -238,6 +243,9 @@ export default {
})
this.$store.commit(SET_TRADEPAIR_KLINE_7DAY_TRADEAGGREGATION,{
index: this.tradepairIndex, date: this.lasttime, data: {data: opt_data, dates:opt_dates}})
this.$nextTick(()=>{
this.lineData = this.tradePairKLineData[this.tradepairIndex]
})
this.opt.xAxis.date = opt_dates
this.opt.series[0].data = opt_data
this.ele.setOption(this.opt)
Expand Down
21 changes: 16 additions & 5 deletions src/components/OrderBook.vue
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@
</div>
<div class="table-row body-2"
v-for="(item,index) in deals" :key="index" :class='item.type'>
<div class="b-row price" >{{Number(item.price.toFixed(4))}}</div>
<div class="b-row price" >{{Number(item.price.toFixed(7))}}</div>
<div class="b-row" v-if="item.base_asset === BaseAsset.code && item.base_issuer === BaseAsset.issuer">+{{Number(item.amount).toFixed(4)}}</div>
<div class="b-row" v-else>-{{Number(item.total).toFixed(4)}}</div>
<div class="b-row" v-else>-{{Number(item.total).toFixed(7)}}</div>
<div class="b-row" v-if="item.base_asset === CounterAsset.code && item.base_issuer === CounterAsset.issuer">+{{Number(item.amount).toFixed(4)}}</div>
<div class="b-row" v-else>-{{Number(item.total).toFixed(4)}}</div>
<div class="b-row" v-else>-{{Number(item.total).toFixed(7)}}</div>
<div class="b-row">{{$t(item.type)}}</div>
</div>
</div>
Expand Down Expand Up @@ -276,7 +276,11 @@ export default {
})
},
load(){
return Promise.all([this.queryOrderBook(), this.queryMyOffers(), this.queryAllOffers()])
let queryOffersFn = new Promise((resolve,reject)=>{
this.queryAllOffers()
resolve()
})
return Promise.all([this.queryOrderBook(), this.queryMyOffers(), queryOffersFn])
},
//撤消委单
cancelMyOffer(item,index){
Expand Down Expand Up @@ -329,7 +333,14 @@ export default {
return true
}else if(key01===key2 && key02 === key1){
item.itype = 'sell'
item.price = Number(new Decimal(1).div(item.price).toFixed(7))
if(item.type === 'finished'){
let t = item.amount
item.amount = item.total
item.total = t
}else{
item.price = Number(new Decimal(1).div(item.price).toFixed(7))
}
return true
}else{
return false
Expand Down
8 changes: 5 additions & 3 deletions src/components/SecretKeyInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @Author: mazhaoyong@gmail.com
* @Date: 2018-03-05 17:30:09
* @Last Modified by: mazhaoyong@gmail.com
* @Last Modified time: 2018-03-21 15:57:39
* @Last Modified time: 2018-04-29 14:05:02
* @License MIT
*/
<template>
Expand All @@ -22,7 +22,6 @@

<script>
import endsWith from 'lodash/endsWith'
import replace from 'lodash/replace'
import util from './SecretKeyInputUtil'
export default {
data(){
Expand Down Expand Up @@ -78,7 +77,10 @@
},
getSeed(){
return replace(this.seedInput, this.delimiter,'').toUpperCase()
if(this.seedInput){
return this.seedInput.replace(new RegExp(this.delimiter, 'gm'), '').toUpperCase()
}
return null
}
}
Expand Down
13 changes: 9 additions & 4 deletions src/components/TradePairToolBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @Author: mazhaoyong@gmail.com
* @Date: 2018-02-08 15:40:36
* @Last Modified by: mazhaoyong@gmail.com
* @Last Modified time: 2018-04-12 17:17:00
* @Last Modified time: 2018-04-29 19:32:43
* @License MIT
*/

Expand Down Expand Up @@ -44,7 +44,7 @@
<div class="toolbar__title toolbar-title white--text textcenter tb-title">{{$t("Trade.SelfSelection")}}</div>
<v-btn icon style="visibility:hidden;"><v-icon class="back-icon"></v-icon></v-btn>
</v-toolbar>
<v-card class="dlg-content mt-5">
<div class="dlg-content mt-5">
<div v-for="(item,index) in tradepairs" :key="index" :class="'flex-row row100 pt-2 pb-2 ' + (isChoosenTrade(item.from,item.to) ? 'active':'')" @click="choseTrade(index,item)">
<div class="flex2">&nbsp;</div>
<div class="flex3 textcenter">
Expand All @@ -62,7 +62,7 @@
</div>
<div class="flex2">&nbsp;</div>
</div>
</v-card>
</div>
</v-dialog>


Expand Down Expand Up @@ -169,7 +169,12 @@ export default {
.material-icons
font-size: 24px
.dlg-content
padding-top: 70px!important
background: $primarycolor.gray
padding-top: 48px!important
padding-bottom: 48px!important
overflow-y: auto
-webkit-overflow-scrolling: touch
height: 100%!important
.row100
width: 100vw
&.active
Expand Down
2 changes: 1 addition & 1 deletion src/pages/CreateAccountReady.vue
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ export default {
...mapActions(['createAccount','cleanGlobalState','coverAccount']),
goback(){
this.$router.back()
this.$router.push({name:'CreateAccount'})
//this.$router.push({name:'CreateAccount'})
},
copy(value){
if(cordova.plugins.clipboard){
Expand Down
39 changes: 15 additions & 24 deletions src/pages/ImportAccount.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,7 @@

<div class="content" v-if="!showScanner">
<div>
<v-text-field
dark
:label="$t('SecretKey')"
:value="seed"
@input="inputSeed"
required
multi-line
rows=2
>
</v-text-field>
<secret-key-input ref="secretkeyRef"></secret-key-input>
</div>
</div>
<div class="footer" v-if="!showScanner">
Expand All @@ -49,9 +40,10 @@
</template>

<script>
import Toolbar from '../components/Toolbar'
import QRScan from '../components/QRScan'
import {importAccount,isValidSeed} from '../api/account'
import Toolbar from '@/components/Toolbar'
import QRScan from '@/components/QRScan'
import SecretKeyInput from '@/components/SecretKeyInput'
import {importAccount,isValidSeed} from '@/api/account'
import { mapState, mapActions} from 'vuex'
export default {
data(){
Expand All @@ -67,9 +59,9 @@ export default {
seed: state => state.seed
}),
nextStepClass(){
if(this.seed === null || typeof this.seed === 'undefined'){
return 'btn-unavailable'
}
// if(this.seed === null || typeof this.seed === 'undefined'){
// return 'btn-unavailable'
// }
return 'btn-available'
}
},
Expand All @@ -83,9 +75,9 @@ export default {
goback(){
this.$router.back()
},
inputSeed(value){
this.setNewSeed({seed:value})
},
// inputSeed(value){
// this.setNewSeed({seed:value})
// },
scan(){
//只能识别stargazer类似的格式数据
if(this.showScanner){
Expand Down Expand Up @@ -116,21 +108,20 @@ export default {
this.title = 'ImportAccount'
},
nextStep(){
if(this.seed === null || typeof this.seed === 'undefined'){
return
}
this.seed = this.seed.toUpperCase()
let seed = this.$refs.secretkeyRef.getSeed()
if(!isValidSeed(this.seed)){
this.$toasted.error(this.$t('Error.NotValidSeed'))
return
}
this.setNewSeed({seed})
this.$router.push({name: 'CreateAccount'})
}
},
components: {
Toolbar,
QRScan
QRScan,
SecretKeyInput,
}
}
</script>
Expand Down
11 changes: 5 additions & 6 deletions src/pages/asset/MyAssets.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,14 @@
<i :class="'iconfont ' + assetIcon(item.code,item.issuer)"></i>
</div>
</v-flex>
<v-flex xs4 class="myassets-wrapper">
<v-flex xs3 class="myassets-wrapper">
<div class="myassets">
<div class="myassets-name">{{item.code}}</div>
<div class="myassets-issuer" v-if="assethosts[item.issuer]">{{assethosts[item.issuer] }}</div>
<div class="myassets-issuer" v-else>{{item.issuer | miniaddress}}</div>
</div>
</v-flex>
<v-flex xs6 class="myassets-wrapper">
<v-flex xs7 class="myassets-wrapper">
<div class="myassets-balance third">
<span class="balance">{{item.balanceStr}}</span>
<span class="label">{{$t('Total')}}</span>
Expand Down Expand Up @@ -164,7 +164,7 @@ export default {
needpwd: false,
is_Flag: FLAG_DEFAULT,
sort_flag: SORT_DEFAULT,
sort_flag: SORT_BANLANCE,
price:[],
_getPriceFn: null,
Expand All @@ -181,8 +181,8 @@ export default {
key: SORT_BANLANCE,
label: 'SortByAsset'
}],
selectedSortItem:{key: SORT_DEFAULT,
label: 'DefaultSort'}
selectedSortItem:{key: SORT_BANLANCE,
label: 'SortByAsset'}
}
},
mixins: [backbutton, loadaccount],
Expand Down Expand Up @@ -280,7 +280,6 @@ export default {
}
},
mounted() {
this._getPriceFn = throttle(()=>{
getAssetPrice(this.balances.filter(item=> Number(item.balance)>0).map(item=> {
return {code: item.code, issuer:item.issuer }
Expand Down
2 changes: 1 addition & 1 deletion src/pages/asset/SendAsset.vue
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ export default {
console.log(err)
this.sending = false
this.sendfail = true
this.realDestination = null
//this.realDestination = null
let msg = getXdrResultCode(err)
this.loadingTitle = this.$t('Error.SendAssetFail')
if(msg){
Expand Down
Loading

0 comments on commit 4c2a033

Please sign in to comment.