Explorar el Código

upload

newCard
HolyKnightIX hace 2 años
padre
commit
436f971a51
Se han modificado 2 ficheros con 20 adiciones y 8 borrados
  1. +19
    -7
      pages/exchangeCard/exchangeCard.js
  2. +1
    -1
      pages/exchangeCard/exchangeCard.wxml

+ 19
- 7
pages/exchangeCard/exchangeCard.js Ver fichero

@@ -27,7 +27,7 @@ Page({
searchCard(e) { searchCard(e) {
let code = e.detail.value.code; let code = e.detail.value.code;
this.setData({ this.setData({
code: e.detail.value.code
code: code
}) })
this.getCardDetail(code) this.getCardDetail(code)
}, },
@@ -93,6 +93,13 @@ Page({
}) })
}, },


codeInput(e) {
console.log(e);
this.setData({
code: e.detail.value
})
},

// 扫描二维码 // 扫描二维码
goScanCode() { goScanCode() {
console.log('scan!!!'); console.log('scan!!!');
@@ -124,13 +131,14 @@ Page({
}) })
.then(res => { .then(res => {
console.log(res, 'res'); console.log(res, 'res');
// 取不到时清空参数
that.setData({ that.setData({
title: res.data.title,
phone: res.data.ownerPhone,
ownerUserId: res.data.ownerUserId,
eCardId: res.data.eCardId,
owned: res.data.owned,
remainAmount: res.data.remainAmount / 100,
title: res.data.title || "",
phone: res.data.ownerPhone || "",
ownerUserId: res.data.ownerUserId || "",
eCardId: res.data.eCardId || "",
owned: res.data.owned || "",
remainAmount: res.data.remainAmount / 100 || "",
isSHowInfoCard: true // 显示卡详情 isSHowInfoCard: true // 显示卡详情
}) })
}) })
@@ -187,6 +195,10 @@ Page({


submit() { submit() {
const data = this.data const data = this.data
const e = {
detail: { value: { code: this.data.code } }
}
this.searchCard(e)
this.getCouponOrderByPassword(data.code) this.getCouponOrderByPassword(data.code)
}, },




+ 1
- 1
pages/exchangeCard/exchangeCard.wxml Ver fichero

@@ -9,7 +9,7 @@


<form bindsubmit='searchCard' report-submit='true'> <form bindsubmit='searchCard' report-submit='true'>
<view class="section"> <view class="section">
<input name='code' placeholder="请输入卡号卡密或扫描二维码" clearable value="{{code}}" />
<input name='code' placeholder="请输入卡号卡密或扫描二维码" clearable value="{{code}}" bindinput="codeInput" />
<button size="primarySize" style="background:#FD832D;color:#fff;" hover-class="opcaity" form-type="submit">查询</button> <button size="primarySize" style="background:#FD832D;color:#fff;" hover-class="opcaity" form-type="submit">查询</button>
<image class="scan" src="../../assets/images/scan.png" bindtap="goScanCode"></image> <image class="scan" src="../../assets/images/scan.png" bindtap="goScanCode"></image>
</view> </view>


Cargando…
Cancelar
Guardar