mirror of
https://gitee.com/technical-laohu/mpay.git
synced 2025-09-18 01:36:40 +08:00
优化二维码生成交互逻辑
This commit is contained in:
parent
6b3f6c5448
commit
27867c65c5
2
.env
2
.env
@ -1,4 +1,4 @@
|
|||||||
APP_DEBUG = false
|
APP_DEBUG = true
|
||||||
|
|
||||||
DB_TYPE = mysql
|
DB_TYPE = mysql
|
||||||
DB_HOST = 127.0.0.1
|
DB_HOST = 127.0.0.1
|
||||||
|
@ -101,14 +101,16 @@ class Order extends BaseModel
|
|||||||
public static function showOrderDetail($id)
|
public static function showOrderDetail($id)
|
||||||
{
|
{
|
||||||
$order = self::find($id);
|
$order = self::find($id);
|
||||||
$a_list = PayAccount::with('payChannel')->hasWhere('payChannel', ['id' => $order->cid])->where('PayAccount.id', $order->aid)->find();
|
$a_list = PayAccount::find($order->aid);
|
||||||
|
$c_list = PayChannel::find($order->cid);
|
||||||
if (!$order) {
|
if (!$order) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
$order->platform = $a_list->platform ?? '···';
|
$order->platform = $a_list['platform'] ?? '···';
|
||||||
$order->account = $a_list->account ?? '···';
|
$order->account = $a_list['account'] ?? '···';
|
||||||
$order->channel = $a_list->payChannel[0]->channel ?? '···';
|
$order->channel = $c_list['channel'] ?? '···';
|
||||||
$order->qrcode = $a_list->payChannel[0]->qrcode ?? '···';
|
$order->qrcode = $c_list['qrcode'] ?? '···';
|
||||||
|
$order->url_type = $c_list['type'] ?? '···';
|
||||||
return $order->toArray();
|
return $order->toArray();
|
||||||
}
|
}
|
||||||
// 选择收款通道
|
// 选择收款通道
|
||||||
|
@ -198,7 +198,8 @@
|
|||||||
<div class="layui-col-xs9">
|
<div class="layui-col-xs9">
|
||||||
<div class="list">
|
<div class="list">
|
||||||
<a href="javascript:;" class="layui-font-blue" lay-on="getQrcode"
|
<a href="javascript:;" class="layui-font-blue" lay-on="getQrcode"
|
||||||
data-qrcode="<?php echo $qrcode ?>"><span class="icon pear-icon"></span></a>
|
data-qrcode="<?php echo $qrcode ?>" data-type="<?php echo $url_type ?>"><span
|
||||||
|
class="icon pear-icon"></span></a>
|
||||||
<?php echo $qrcode ?>
|
<?php echo $qrcode ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -215,7 +216,18 @@
|
|||||||
util.on({
|
util.on({
|
||||||
getQrcode: function () {
|
getQrcode: function () {
|
||||||
(async () => {
|
(async () => {
|
||||||
const qrcode_data = this.getAttribute("data-qrcode")
|
const type_data = this.getAttribute("data-type");
|
||||||
|
const qrcode_data = this.getAttribute("data-qrcode");
|
||||||
|
if (type_data == 1) {
|
||||||
|
layer.open({
|
||||||
|
type: 1,
|
||||||
|
area: ['200px', '200px'],
|
||||||
|
title: false,
|
||||||
|
closeBtn: 0,
|
||||||
|
shadeClose: true,
|
||||||
|
content: `<img width="100%" src="${qrcode_data}">`
|
||||||
|
});
|
||||||
|
} else if (type_data == 0) {
|
||||||
const qrcode_img = await getQrcode(qrcode_data, QR);
|
const qrcode_img = await getQrcode(qrcode_data, QR);
|
||||||
layer.open({
|
layer.open({
|
||||||
type: 1,
|
type: 1,
|
||||||
@ -225,6 +237,7 @@
|
|||||||
shadeClose: true,
|
shadeClose: true,
|
||||||
content: `<img width="100%" src="${qrcode_img}">`
|
content: `<img width="100%" src="${qrcode_img}">`
|
||||||
});
|
});
|
||||||
|
}
|
||||||
})()
|
})()
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user