|
@@ -32,6 +32,7 @@
|
|
|
<u-cell-item icon="rmb-circle" title="支付宝支付退款" v-if="userAgent!='wxAgent'" @click="handleAliRefund()"></u-cell-item>
|
|
|
<!-- <u-cell-item icon="rmb-circle" title="支付宝gotoPayPage" v-if="userAgent!='wxAgent'" @click="handleAliPayPage()"></u-cell-item> -->
|
|
|
<u-cell-item icon="rmb-circle" title="支付宝生成收款码" v-if="userAgent!='wxAgent'" @click="handleAligetPayimg()"></u-cell-item>
|
|
|
+ <u-cell-item icon="rmb-circle" title="支付宝条码支付" v-if="userAgent!='wxAgent'" @click="handleShowScanner()"></u-cell-item>
|
|
|
</u-cell-group>
|
|
|
</view>
|
|
|
|
|
@@ -52,6 +53,14 @@
|
|
|
</u-cell-group>
|
|
|
</view>
|
|
|
|
|
|
+ <!-- 获取扫描信息 -->
|
|
|
+ <view class="scanner" v-if="showScanner" @click.self="handleCloseScanner"><!-- @click="handleCloseScanner" -->
|
|
|
+ <!-- <u-input v-model="scannerText" type="text" :focus="true" :border="true" @change="scannerChange" /> -->
|
|
|
+ <u-field v-model="scannerText" :focus="true" label-width="0" label="" placeholder="请使用扫描枪扫码" confirm="scannerChange">
|
|
|
+ </u-field>
|
|
|
+ <u-button type="primary" @click="handleBarcode">确定</u-button>
|
|
|
+ </view>
|
|
|
+
|
|
|
<u-toast ref="uToast" />
|
|
|
</view>
|
|
|
</template>
|
|
@@ -71,6 +80,9 @@
|
|
|
userAgent:null,
|
|
|
//二维码内容
|
|
|
qrcontent:null,
|
|
|
+ // 扫描枪内容
|
|
|
+ scannerText:null,
|
|
|
+ showScanner:false,
|
|
|
}
|
|
|
},
|
|
|
onLoad() {
|
|
@@ -285,6 +297,29 @@
|
|
|
}).catch(err=>{
|
|
|
console.log('handleAliPayPage err',err);
|
|
|
})
|
|
|
+ },
|
|
|
+ // handleShowScanner
|
|
|
+ handleShowScanner(){
|
|
|
+ this.scannerText = null,
|
|
|
+ this.showScanner = true;
|
|
|
+ },
|
|
|
+ handleCloseScanner(){
|
|
|
+ this.scannerText = null,
|
|
|
+ this.showScanner = false;
|
|
|
+ },
|
|
|
+ handleBarcode(){
|
|
|
+ this.$u.api.barcode({authCode:this.scannerText})
|
|
|
+ .then(res=>{
|
|
|
+ console.log('handleBarcode res',res);
|
|
|
+ this.scannerText = null;
|
|
|
+ this.showScanner = false;
|
|
|
+ console.log('this.scannerText',this.scannerText);
|
|
|
+ alert(res.retHead.errMsg);
|
|
|
+ }).catch(err=>{
|
|
|
+ this.scannerText = null;
|
|
|
+ console.log('this.scannerText',this.scannerText);
|
|
|
+ console.log('handleBarcode err',err);
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -307,4 +342,7 @@ page{
|
|
|
.user-box{
|
|
|
background-color: #fff;
|
|
|
}
|
|
|
+// 获取扫描枪内容
|
|
|
+.scanner{position: fixed;left: 0;top: 0;bottom: 0;right: 0;padding: 0 20px;background: rgba(0,0,0,0.5);z-index: 999;display: flex;align-items: center;justify-content: center;}
|
|
|
+.scanner .u-field{background-color: #fff;}
|
|
|
</style>
|