二维码url处理
parent
b8a3fe720c
commit
0492be9b5e
|
|
@ -71,6 +71,9 @@ class Goods extends Common
|
||||||
$this->assign('goods', $goods[0]);
|
$this->assign('goods', $goods[0]);
|
||||||
$this->assign('home_seo_site_title', $goods[0]['title']);
|
$this->assign('home_seo_site_title', $goods[0]['title']);
|
||||||
|
|
||||||
|
// 二维码
|
||||||
|
$this->assign('qrcode_url', MyUrl('index/qrcode/index', ['content'=>urlencode(base64_encode(MyUrl('index/goods/index', ['id'=>$id], true, true)))]));
|
||||||
|
|
||||||
// 商品访问统计
|
// 商品访问统计
|
||||||
GoodsService::GoodsAccessCountInc(['goods_id'=>$id]);
|
GoodsService::GoodsAccessCountInc(['goods_id'=>$id]);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ class QrCode extends Common
|
||||||
$level = isset($params['level']) && in_array($params['level'], array('L','M','Q','H')) ? $params['level'] : 'L';
|
$level = isset($params['level']) && in_array($params['level'], array('L','M','Q','H')) ? $params['level'] : 'L';
|
||||||
$point_size = isset($params['size']) ? min(max(intval($params['size']), 1), 10) : 6;
|
$point_size = isset($params['size']) ? min(max(intval($params['size']), 1), 10) : 6;
|
||||||
$mr = isset($params['mr']) ? intval($params['mr']) : 1;
|
$mr = isset($params['mr']) ? intval($params['mr']) : 1;
|
||||||
$content = isset($params['content']) ? urldecode(trim($params['content'])) : __MY_URL__;
|
$content = isset($params['content']) ? base64_decode(urldecode(trim($params['content']))) : __MY_URL__;
|
||||||
\QRcode::png($content, false, $level, $point_size, $mr);
|
\QRcode::png($content, false, $level, $point_size, $mr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -100,7 +100,7 @@
|
||||||
<div class="goods-qrcode am-hide-sm-only">
|
<div class="goods-qrcode am-hide-sm-only">
|
||||||
<span>手机扫一扫购买</span>
|
<span>手机扫一扫购买</span>
|
||||||
<i class="am-icon-qrcode am-icon-sm"></i>
|
<i class="am-icon-qrcode am-icon-sm"></i>
|
||||||
<img class="qrcode-images am-img-thumbnail" src="{{:MyUrl('index/qrcode/index', ['content'=>urlencode(MyUrl('index/goods/index', ['id'=>$goods['id']], true, true))])}}" />
|
<img class="qrcode-images am-img-thumbnail" src="{{$qrcode_url}}" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -172,7 +172,7 @@ class Weixin
|
||||||
// web支付
|
// web支付
|
||||||
case 'NATIVE' :
|
case 'NATIVE' :
|
||||||
$pay_params = [
|
$pay_params = [
|
||||||
'url' => urlencode($data['code_url']),
|
'url' => urlencode(base64_encode($data['code_url'])),
|
||||||
'order_no' => $params['order_no'],
|
'order_no' => $params['order_no'],
|
||||||
'name' => urlencode('微信支付'),
|
'name' => urlencode('微信支付'),
|
||||||
'msg' => urlencode('打开微信APP扫一扫进行支付'),
|
'msg' => urlencode('打开微信APP扫一扫进行支付'),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue