update donate bar

This commit is contained in:
Jay 2018-08-26 21:30:49 +08:00
parent 5532e35a93
commit 97315e7684
3 changed files with 11 additions and 19 deletions

View File

@ -12,20 +12,20 @@
</sui-segment>
<sui-form @submit.prevent="formSubmit">
<sui-form-field>
<label>Title</label>
<label>標題</label>
<input placeholder="Doante bar title" v-model="title" name="title"/>
</sui-form-field>
<sui-form-field>
<label>TargetAmount</label>
<label>目標金額</label>
<input placeholder="Target amount" type="number" v-model="amount" name="amount"/>
</sui-form-field>
<sui-form-fields :fields="2">
<sui-form-field>
<label>StartDate</label>
<DatePicker v-model="sDate" format="yyyy-MM-dd"/>
<label>起始金額</label>
<input placeholder="start amount" type="number" v-model="startAmount" name="start_amount" />
</sui-form-field>
<sui-form-field>
<label>EndDate</label>
<label>結束時間</label>
<DatePicker v-model="eDate" format="yyyy-MM-dd"/>
</sui-form-field>
</sui-form-fields>
@ -52,7 +52,7 @@ export default {
return {
title: '',
amount: 0,
sDate: '',
startAmount: 0,
eDate: ''
}
},
@ -60,10 +60,6 @@ export default {
...mapActions(['changeOpaySetting']),
...mapMutations(['addDialog']),
formSubmit: function () {
let sts = 0
try {
sts = new Date(this.sDate).getTime()
} catch (err) {}
let ets = 0
try {
ets = new Date(this.eDate).getTime()
@ -71,7 +67,7 @@ export default {
let data = {
title: this.title,
amount: this.amount,
start: sts,
start_amount: this.startAmount,
end: ets
}
this.changeOpaySetting({
@ -84,7 +80,7 @@ export default {
setting: function (val, old) {
this.title = val.title
this.amount = val.target_amount
this.sDate = val.start_date
this.startAmount = val.start_amount
this.eDate = val.end_date
}
},

View File

@ -18,8 +18,9 @@
<style lang="less" scoped>
.main {
width: 100%;
font-size: 1em;
font-size: 1.5em;
font-weight: 900;
color: #666;
.title {
text-align: center;

View File

@ -4,12 +4,6 @@
</div>
</template>
<style lang="less">
html,body,#app {
background-color: inherit;
}
</style>
<style lang="less" scoped>
.show-donate {
padding: 5px 10px;
@ -34,6 +28,7 @@ export default {
}
},
mounted () {
document.getElementById('app').style.backgroundColor = 'inherit'
this.client = axios.create({
baseURL: apiUrl
})