From 73a8f4f87b505e42c66d5501043db9cdcace1e82 Mon Sep 17 00:00:00 2001 From: gongfuxiang Date: Sat, 6 Jul 2024 23:49:07 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A4=BC=E5=93=81=E5=8D=A1=E5=8D=A1=E5=AF=86?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=B1=95=E7=A4=BA=E4=BC=98=E5=8C=96=EF=BC=8C?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=89=AB=E7=A0=81=E5=85=91=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/payment/payment.vue | 2 +- locale/en.json | 1 + locale/zh.json | 1 + pages/plugins/giftcard/form/form.vue | 47 +++++++++++++++++++----- pages/plugins/giftcard/index/index.css | 3 ++ pages/plugins/giftcard/index/index.vue | 49 +++++++++++++++++++------- 6 files changed, 81 insertions(+), 22 deletions(-) create mode 100644 pages/plugins/giftcard/index/index.css diff --git a/components/payment/payment.vue b/components/payment/payment.vue index a99e8846..58a73941 100644 --- a/components/payment/payment.vue +++ b/components/payment/payment.vue @@ -486,7 +486,7 @@ self.setData({ open_pay_url_status: false }); - self.order_item_pay_fail_handle(data, order_id, error); + self.order_item_pay_fail_handle(data, order_id, error.message+'('+error.code+')'); }); // 定时3秒后提示用户确认支付状态 self.open_pay_url_timer = setTimeout(function() { diff --git a/locale/en.json b/locale/en.json index c82df9cf..83ca5b96 100644 --- a/locale/en.json +++ b/locale/en.json @@ -29,6 +29,7 @@ "share": "Share", "return": "Return", "view_text": "Check", + "place_order_text": "Place Order", "processing_in_text": "Processing", "loading_in_text": "Loading", "upload_in_text": "Uploading", diff --git a/locale/zh.json b/locale/zh.json index dba884a3..ab4d82c9 100644 --- a/locale/zh.json +++ b/locale/zh.json @@ -29,6 +29,7 @@ "share": "分享", "return": "返回", "view_text": "查看", + "place_order_text": "下单", "processing_in_text": "处理中...", "loading_in_text": "加载中...", "upload_in_text": "上传中...", diff --git a/pages/plugins/giftcard/form/form.vue b/pages/plugins/giftcard/form/form.vue index 485f264f..bb9d4d90 100644 --- a/pages/plugins/giftcard/form/form.vue +++ b/pages/plugins/giftcard/form/form.vue @@ -4,8 +4,13 @@
- {{$t('giftcard-index.giftcard-index.hfg2fg')}} - + {{$t('giftcard-index.giftcard-index.hfg2fg')}} + + + + + + @@ -27,7 +32,8 @@ theme_view: app.globalData.get_theme_value_view(), data_list_loding_status: 1, data_list_loding_msg: '', - form_submit_loading: false + form_submit_loading: false, + secret_key_value: '' }; }, components: { @@ -62,13 +68,38 @@ }); } }, + + // 输入事件 + secret_key_event(e) { + this.setData({ + secret_key_value: e.detail.value + }); + }, - // 转账表单提交 - form_submit(e) { + // 扫码事件 + scan_event(e) { + var self = this; + uni.scanCode({ + success: function (res) { + if((res.result || null) != null) { + self.setData({ + secret_key_value: res.result + }); + self.form_submit(); + } + } + }); + }, + + // 表单提交 + form_submit() { + var form_data = { + secret_key: this.secret_key_value + } var validation = [ { fields: 'secret_key', msg: this.$t('giftcard-index.giftcard-index.fu3rf1') } ]; - if (app.globalData.fields_check(e.detail.value, validation)) { + if (app.globalData.fields_check(form_data, validation)) { uni.showLoading({ title: this.$t('common.processing_in_text'), }); @@ -78,7 +109,7 @@ uni.request({ url: app.globalData.get_request_url('exchange', 'index', 'giftcard'), method: 'POST', - data: e.detail.value, + data: form_data, dataType: 'json', success: (res) => { uni.hideLoading(); @@ -96,7 +127,7 @@ } }, 1500); } else { - if (app.globalData.is_login_check(res.data, this, 'form_submit', e)) { + if (app.globalData.is_login_check(res.data, this, 'form_submit')) { this.setData({ form_submit_loading: false }); diff --git a/pages/plugins/giftcard/index/index.css b/pages/plugins/giftcard/index/index.css new file mode 100644 index 00000000..5189be84 --- /dev/null +++ b/pages/plugins/giftcard/index/index.css @@ -0,0 +1,3 @@ +.secret-value-data .value-title { + width: calc(100% - 160rpx); +} \ No newline at end of file diff --git a/pages/plugins/giftcard/index/index.vue b/pages/plugins/giftcard/index/index.vue index 0e7ca793..0fe9740a 100644 --- a/pages/plugins/giftcard/index/index.vue +++ b/pages/plugins/giftcard/index/index.vue @@ -4,16 +4,41 @@ - - - - {{ fv.name }}: - {{ item[fv.field] }} - {{ fv.unit }} - + + + {{ $t('giftcard-index.giftcard-index.87ytyh') }}: + {{ item.data_type_name }} + + + {{ $t('giftcard-index.giftcard-index.hfg2fg') }}: + {{ item.secret_key }} + + + {{ $t('giftcard-index.giftcard-index.fyjnsd') }}: + {{ item.secret_value_text }} + {{ $t('common.view_text') }} + {{ $t('common.view_text') }} + {{ $t('common.view_text') }} + + + {{$t('giftcard-index.giftcard-index.fyjnsd')}} + + + {{items.title}} + {{(item.use_data || null) == null ? $t('common.place_order_text') : $t('common.view_text') }} + + + {{ $t('common.no_relevant_data_tips') }} + + + + {{ fv.name }}: + {{ item[fv.field] }} + {{ fv.unit }} + - {{$t('giftcard-index.giftcard-index.6redfg')}} + {{$t('giftcard-index.giftcard-index.6redfg')}} {{$t('user-order-detail.user-order-detail.n18sd2')}}: @@ -68,10 +93,7 @@ data_bottom_line_status: false, data_is_loading: 0, params: null, - content_list: [ - { name: this.$t('giftcard-index.giftcard-index.87ytyh'), field: 'data_type_name' }, - { name: this.$t('giftcard-index.giftcard-index.hfg2fg'), field: 'secret_key' }, - { name: this.$t('giftcard-index.giftcard-index.fyjnsd'), field: 'secret_value_text' }, + content_list: [ { name: this.$t('giftcard-index.giftcard-index.87yyj3'), field: 'exchange_time' }, { name: this.$t('common.add_time'), field: 'add_time' }, { name: this.$t('common.upd_time'), field: 'upd_time' }, @@ -235,5 +257,6 @@ }, }; - \ No newline at end of file