|
@@ -280,6 +280,8 @@ Page({
|
|
|
if (that.scanType == 'QR_CODE') {//二维码
|
|
|
that.substrValue = that.value.substring(0, 5);
|
|
|
that.value = that.value.substring(5, that.value.length);
|
|
|
+ var goodId = that.value.substring(18, that.value.length);
|
|
|
+
|
|
|
if (that.substrValue != 'emato') {//../goods/goods?id=
|
|
|
wx.showModal({
|
|
|
title: '',
|
|
@@ -294,17 +296,27 @@ Page({
|
|
|
}
|
|
|
});
|
|
|
} else {
|
|
|
- // 跳转页面
|
|
|
- wx.navigateTo({
|
|
|
- url: that.value,
|
|
|
- success: function (e) {
|
|
|
- console.log('跳转成功');
|
|
|
- },
|
|
|
- fail: function (e) {
|
|
|
- console.log('跳转失败');
|
|
|
- }
|
|
|
- })
|
|
|
|
|
|
+ util.request(api.GoodsDetail, { id: goodId, referrer: '' }).then(function (res) {
|
|
|
+ if (res.errno === 0) {
|
|
|
+ // 跳转页面
|
|
|
+ wx.navigateTo({
|
|
|
+ url: that.value,
|
|
|
+ success: function (e) {
|
|
|
+ console.log('跳转成功');
|
|
|
+ },
|
|
|
+ fail: function (e) {
|
|
|
+ console.log('跳转失败');
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ wx.showModal({
|
|
|
+ title: '扫描结果',
|
|
|
+ content: '商品不存在',
|
|
|
+ showCancel: false
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
}else{//其他码
|
|
|
//弹框显示结果
|