赞
踩
给元素增加一个点击事件
<template>
<view>
<image src="/static/erweim.png" mode="aspectFit"></image>
<view>
<button type="primary" @click="gotoStore()">
<image src="/static/smIcon.png"></image>扫码点餐
</button>
</view>
</view>
</template>
export default {
data() {
return {}
},
methods: {
gotoStore(page) {
uni.scanCode({
success: function (res) {
console.log('扫码功能', res)
const a = res.result.split('?')[1]
uni.navigateTo({ url: '/pages/product/list/store?' + a })
},
})
},
},
}
获取扫码的参数
if (e.q) {//微信扫码进入
const strr = e.q.replace(/\s*/g, '')
const str = decodeURIComponent(strr)
self.facilityObj = self.urlToObj(str)
self.facilityObj.table_no = self.facilityObj.facilityNo
console.log('facilityObj', self.facilityObj)
} else {//页面点击进入
e.table_no = e.facilityNo
self.facilityObj = e
}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。