Component({ properties: { price: { type: Number, value: -1, observer: 'updatePrice', }, count: { type: Number, value: -1, }, showCancel: { type: Boolean, value: false, }, submitText: { type: String, value: '立即支付', }, cancelLoading: { type: Boolean, value: false, }, submitLoading: { type: Boolean, value: false, }, submitDisabled: { type: Boolean, value: false, }, safeAreaInsetBottom: { type: Boolean, value: true, }, }, data: { yuanPrice: '', }, methods: { updatePrice() { this.setData({ yuanPrice: (this.data.price / 100).toFixed(2), }); }, onCancel() { if (!(this.data.cancelLoading || this.data.submitLoading)) { this.triggerEvent('cancel'); } }, onSubmit() { if (!(this.data.cancelLoading || this.data.submitLoading)) { this.triggerEvent('submit'); } }, }, });