自定义扫码界面
This commit is contained in:
@@ -104,12 +104,12 @@
|
||||
</view>
|
||||
<view class="padding-lg padding-top-0 padding-bottom-xl">
|
||||
<button v-show="formQr" @tap="scanQr" class="bg-main-oil margin-bottom">
|
||||
<text class="cuIcon-scan padding-right-xs"></text>
|
||||
<text class="cuIcon-scan padding-right-xs"></text>
|
||||
继续加油</button>
|
||||
<button class="bg-red light margin-bottom" @tap="backHome">
|
||||
<button class="bg-red light margin-bottom" @tap="backHome">
|
||||
<text class="cuIcon-home padding-right-xs"></text>
|
||||
返回首页</button>
|
||||
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -120,7 +120,7 @@
|
||||
return {
|
||||
// orderId:'',
|
||||
orderId: uni.getStorageSync('orderId'),
|
||||
formQr: uni.getStorageSync('formQr')?true:false,
|
||||
formQr: uni.getStorageSync('formQr') ? true : false,
|
||||
orderItem: {},
|
||||
baseURL: this.global.baseURL
|
||||
}
|
||||
@@ -128,53 +128,31 @@
|
||||
created() {
|
||||
this.getOrderDetail()
|
||||
},
|
||||
onHide(){
|
||||
onHide() {
|
||||
this.clearStatus()
|
||||
},
|
||||
onUnload() {
|
||||
this.clearStatus()
|
||||
},
|
||||
methods: {
|
||||
clearStatus(){
|
||||
clearStatus() {
|
||||
uni.removeStorageSync('formQr')
|
||||
},
|
||||
scanQr() {
|
||||
var that = this
|
||||
uni.scanCode({
|
||||
onlyFromCamera: true,
|
||||
success: function(res) {
|
||||
console.log('条码类型:' + res.scanType);
|
||||
console.log('条码内容:' + res.result);
|
||||
uni.setStorageSync('qrCode', res.result)
|
||||
uni.navigateTo({
|
||||
url: '/pages/stationDetail/stationDetail',
|
||||
fail: (err) => {
|
||||
console.log(err)
|
||||
},
|
||||
success: (res) => {
|
||||
console.log('chengg', res)
|
||||
}
|
||||
})
|
||||
scanUrl = '/pages/station-info/scan-camera/scan-camera'
|
||||
uni.navigateTo({
|
||||
url: scanUrl,
|
||||
fail: (err) => {
|
||||
console.log(err)
|
||||
},
|
||||
// 方便测试
|
||||
// complete: () => {
|
||||
// uni.setStorageSync('qrCode', 'XM&1309328197641433088')
|
||||
// uni.navigateTo({
|
||||
// url: that.scanUrl,
|
||||
// fail: (err) => {
|
||||
// console.log(err)
|
||||
// },
|
||||
// success: (res) => {
|
||||
// console.log('chengg', res)
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
|
||||
success: (res) => {
|
||||
console.log('chengg', res)
|
||||
}
|
||||
})
|
||||
},
|
||||
backHome(){
|
||||
backHome() {
|
||||
uni.navigateBack({
|
||||
delta:2
|
||||
delta: 2
|
||||
})
|
||||
},
|
||||
copyId(id, name) {
|
||||
|
||||
Reference in New Issue
Block a user