Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
kastnerorz committed Apr 15, 2020
2 parents c6b7a43 + 86aaf1c commit badf318
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
![Docker Image Size (latest by date)](https://img.shields.io/docker/image-size/kastnerorz/animal-crossing-trading-system?logo=docker&sort=date)
![Docker Image Version (latest semver)](https://img.shields.io/docker/v/kastnerorz/animal-crossing-trading-system?sort=semver&logo=docker)
![Docker Pulls](https://img.shields.io/docker/pulls/kastnerorz/animal-crossing-trading-system?logo=docker)

[![Netlify Status](https://api.netlify.com/api/v1/badges/1132ab46-4412-43e6-86b8-dad0747ea5ab/deploy-status)](https://app.netlify.com/sites/dtc-trading/deploys)
## API Doc
Please go to [wiki](https://github.com/kastnerorz/animal-crossing-trading-system/wiki).

Expand Down
23 changes: 13 additions & 10 deletions app/components/MyTrade.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@
</b-field>
</div>
<div class="lr-block" v-if="openType === 'PASS_CODE'">
<b-field label="手续费">
<b-field label="手续费(选填)">
<div class="control is-clearfix">
<div class="input-icon">
<ICON type="money" />
</div>
<input class="input" placeholder="请输入岛屿手续费(选填)" v-model="handlingFee" />
<input class="input" placeholder="手续费" v-model.number="handlingFee" />
</div>
</b-field>
<b-field label="岛屿密码">
<div class="control is-clearfix">
<input class="input" placeholder="请输入岛屿密码" v-model="passCode" />
<input class="input" placeholder="岛屿密码" v-model="passCode" />
</div>
</b-field>
</div>
Expand All @@ -40,9 +40,9 @@
:class="['friendCode-wrap-title', {'friendCode-wrap-title-gray': switchFriendCode.length === 0}]">SW-</span>
</div>
</b-field>
<b-field v-if="openType === 'FRIENDS'" label="手续费">
<b-field v-if="openType === 'FRIENDS'" label="手续费(选填)">
<div class="control is-clearfix">
<input class="input" placeholder="请输入岛屿手续费(选填)" v-model="handlingFee" />
<input class="input" placeholder="手续费" v-model="handlingFee" />
</div>
</b-field>
<b-button v-if="isAuth" class="btn-reg" type="is-primary" @click="validateAllData">{{hasQuotation ? '修改' : '发布'}}
Expand All @@ -57,19 +57,20 @@ import { mapMutations } from "vuex";
import asyncValidator from "async-validator";
const validateRules = {
price: [
{ required: true, message: "收购价不能为空" },
{ required: true, message: "收购价不能为空" },
{ type: "number", message: "收购价必须为数字" },
{
validator: function() {
if (Number(arguments[1]) === 0) {
return new Error("收购价不可为 0");
}
if (!Number(arguments[1])) {
return new Error("收购价必须为数字");
}
return true;
}
}
],
handlingFee: [
{ required: false, type: "number", message: "手续费必须为数字" },
],
openType: [
{
required: true,
Expand Down Expand Up @@ -160,10 +161,12 @@ export default {
validateAllData(type) {
const rules = {
price: validateRules.price,
handlingFee: validateRules.handlingFee,
openType: validateRules.openType
};
const vaildData = {
price: this.price,
handlingFee: this.handlingFee,
openType: this.openType
};
if (this.openType === "PASS_CODE") {
Expand Down Expand Up @@ -234,7 +237,7 @@ export default {
this.$store.commit("setLoading");
const quoParam = {
type: this.tradeType,
handlingFee: this.handlingFee + "" || "0",
handlingFee: this.handlingFee || 0,
price: this.price,
openType: this.openType,
passCode: this.passCode
Expand Down

0 comments on commit badf318

Please sign in to comment.