diff --git a/pages/order/detail/index.js b/pages/order/detail/index.js index b87dbd8..366ed87 100644 --- a/pages/order/detail/index.js +++ b/pages/order/detail/index.js @@ -47,6 +47,8 @@ Page({ API.request(`/api/orders/detail/${orderId}`, 'GET', {}) .then(res => { console.log('获取订单详情成功:', res); + console.log('订单详情数据结构:', JSON.stringify(res.data, null, 2)); + console.log('是否包含QR_code字段:', 'QR_code' in (res.data || {})); if (res.success) { this.setData({ orderDetail: res.data, diff --git a/pages/order/detail/index.wxml b/pages/order/detail/index.wxml index 0ccd5fc..0ee08c0 100644 --- a/pages/order/detail/index.wxml +++ b/pages/order/detail/index.wxml @@ -97,6 +97,18 @@ + + + + 二维码 + + + + 二维码暂无 + QR_code: {{orderDetail.QR_code}} + + + diff --git a/pages/order/detail/index.wxss b/pages/order/detail/index.wxss index 89a03c2..aa2ef79 100644 --- a/pages/order/detail/index.wxss +++ b/pages/order/detail/index.wxss @@ -204,3 +204,41 @@ font-size: 32rpx; color: #999; } + +/* 二维码 */ +.qrcode-container { + display: flex; + justify-content: center; + align-items: center; + background-color: #f9f9f9; + border-radius: 8rpx; + padding: 40rpx; +} + +.qrcode-image { + width: 300rpx; + height: 300rpx; + border-radius: 8rpx; +} + +.qrcode-placeholder { + width: 300rpx; + height: 300rpx; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + background-color: #f0f0f0; + border-radius: 8rpx; + color: #999; + font-size: 24rpx; + text-align: center; +} + +.qrcode-placeholder text { + margin-bottom: 10rpx; +} + +.qrcode-placeholder text:last-child { + margin-bottom: 0; +} diff --git a/server-example/server-mysql.js b/server-example/server-mysql.js index 122a1e9..85e0252 100644 --- a/server-example/server-mysql.js +++ b/server-example/server-mysql.js @@ -2195,6 +2195,11 @@ JdSalesMain.init({ type: DataTypes.STRING(255), allowNull: true, comment: '车牌' + }, + QR_code: { + type: DataTypes.TEXT, + allowNull: true, + comment: '二维码' } }, { sequelize: tradeLibrarySequelize,