1、合作商余额查询

2、分油账户司机可用额度
This commit is contained in:
2026-10-20 23:21:10 +08:00
parent 45452c1799
commit fafd3e2c16
134 changed files with 2344 additions and 352 deletions
+174 -42
View File
@@ -81,6 +81,25 @@
>{{ item.name }}</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="企油通发放态">
<a-select v-decorator="['oil_status_zsy', { initialValue: -1 }]">
<a-select-option :value="-1">全部</a-select-option>
<a-select-option :value="0">未提交</a-select-option>
<a-select-option :value="1">发放中</a-select-option>
<a-select-option :value="2">发放成功</a-select-option>
<a-select-option :value="3">发放失败</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="退款状态">
<a-select v-decorator="['refund_status', { initialValue: -1 }]">
<a-select-option :value="-1">全部</a-select-option>
<a-select-option :value="0">未退款</a-select-option>
<a-select-option :value="1">退款中</a-select-option>
<a-select-option :value="2">已退款</a-select-option>
<a-select-option :value="3">退款失败</a-select-option>
<a-select-option :value="4">待人工确认</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="商品编码">
<a-input v-decorator="['goods_no']" placeholder="商品编码" />
</a-form-item>
@@ -133,10 +152,10 @@
<tbody class="ant-table-tbody">
<template v-for="(item) in orderList.data">
<tr class="order-empty" :key="`order_${item.order_id}_1`">
<td colspan="15"></td>
<td colspan="16"></td>
</tr>
<tr :key="`order_${item.order_id}_2`">
<td colspan="15">
<td colspan="16">
<span class="mr-20">{{ item.create_time }}</span>
<span class="mr-20">订单号:{{ item.order_no }}</span>
<platform-icon :name="item.platform" :showTips="true" />
@@ -163,47 +182,58 @@
</td>
<td>
<div class="actions">
<!--<router-link
v-if="$auth('/order/detail')"
:to="{ path: '/order/detail', query: { orderId: item.order_id } }"
>详情</router-link>
<!-- 企油通:发放/加油/退款/发票,与合作商订单页同一套接口 -->
<template v-if="goodsItm.qyt">
<a
v-action:deliver
v-if="(
item.pay_status == PayStatusEnum.SUCCESS.value
&& item.delivery_type == DeliveryTypeEnum.EXPRESS.value
&& item.delivery_status == DeliveryStatusEnum.NOT_DELIVERED.value
&& !inArray(item.order_status, [OrderStatusEnum.CANCELLED.value, OrderStatusEnum.APPLY_CANCEL.value])
)"
@click="handleDelivery(item)"
>发货</a>
v-if="goodsItm.qyt.oil_status_zsy === 3 && goodsItm.qyt.oil_status === 0"
@click="handleShare(goodsItm.qyt)"
>重新发放</a>
<a
v-action:cancel
v-if="item.order_status == OrderStatusEnum.APPLY_CANCEL.value"
@click="handleCancel(item)"
>审核取消</a>
<a v-action:delete @click="handleDelete(item)">删除</a>
v-if="goodsItm.qyt.oil_status_zsy === 2 && goodsItm.qyt.oil_status === 1
&& goodsItm.qyt.refund_status !== 2 && Number(remainAmount(goodsItm.qyt)) > 0"
@click="handlePay(goodsItm.qyt)"
>加油链接</a>
<a
v-if="$auth('/order/cancelshare') && (goodsItm.oilCardType !== 'zsy_ticket') && (
inArray(item.order_status, [OrderStatusEnum.COMPLETED.value])
)"
@click="handleCancelShare(goodsItm)"
>分油撤销</a>-->
<!--有付款权限,订单状态为进行中,已支付,并且未使用-->
v-if="goodsItm.qyt.oil_status_zsy === 2 && goodsItm.qyt.oil_status === 1"
@click="handleOil(goodsItm.qyt)"
>重推发放结果</a>
<a
v-if="$auth('/order/pay') && (
inArray(item.order_status, [OrderStatusEnum.NORMAL.value])
) && inArray(item.pay_status, [PayStatusEnum.SUCCESS.value]) && goodsItm.use_status === 0 && goodsItm.oil_status === 1 && goodsItm.oilCardType === 'zsy_ticket'"
@click="handlePay(goodsItm)"
>付款码</a>
<a
v-if="$auth('/order/pay') && (
inArray(item.order_status, [OrderStatusEnum.NORMAL.value])
) && inArray(item.pay_status, [PayStatusEnum.SUCCESS.value]) && goodsItm.oil_status === 0 && goodsItm.oilCardType === 'zsy_ticket'"
@click="handleShare(goodsItm)"
>手动分油</a>
v-if="goodsItm.qyt.oil_status_zsy === 2 && goodsItm.qyt.use_status === 1"
@click="handleUse(goodsItm.qyt)"
>重推加油结果</a>
<a v-if="canRefund(goodsItm.qyt)" @click="handleRefund(goodsItm.qyt)">{{ refundLabel(goodsItm.qyt) }}</a>
<a v-if="goodsItm.qyt.use_status === 1" @click="handleInvoice(goodsItm.qyt)">发票</a>
</template>
<span v-else-if="goodsItm.oilCardType === 'zsy_ticket'" class="c-muted-1">未生成发放单</span>
</div>
</td>
<!-- 司机(实名信息随单固化) -->
<td>
<template v-if="goodsItm.qyt">
<p class="mtb-2">{{ goodsItm.qyt.driver_name || '-' }}</p>
<p class="mtb-2 f-13">{{ goodsItm.qyt.mobile }}</p>
<p class="mtb-2 f-13">{{ goodsItm.qyt.id_card_mask || '-' }}</p>
<p class="mtb-2 f-13">车牌:{{ goodsItm.qyt.plate_no || '-' }}</p>
</template>
<span v-else>-</span>
</td>
<!-- 企油通单号 -->
<td>
<template v-if="goodsItm.qyt">
<p class="mtb-2 f-13">批次:{{ goodsItm.qyt.batch_no || '-' }}</p>
<p class="mtb-2 f-13">运单:{{ goodsItm.qyt.waybill_no || '-' }}</p>
</template>
<span v-else>-</span>
</td>
<!-- 加油信息 -->
<td>
<template v-if="goodsItm.qyt && goodsItm.qyt.use_status === 1">
<p class="mtb-2 f-13">已加油:¥{{ goodsItm.qyt.used_amount }}({{ goodsItm.qyt.used_num }} 次)</p>
<p class="mtb-2 f-13">剩余:¥{{ remainAmount(goodsItm.qyt) }}</p>
<p class="mtb-2 f-13">最近:{{ goodsItm.qyt.station_name || '-' }} {{ goodsItm.qyt.oil_name }} {{ goodsItm.qyt.litter }}L</p>
</template>
<span v-else>-</span>
</td>
<template v-if="goodsIdx===0">
<td :rowspan="item.goods.length">
<p>¥{{ item.pay_price }}</p>
@@ -252,6 +282,17 @@
:color="goodsItm.use_status == UseStatusEnum.USE.value ? 'green' : ''"
>{{ UseStatusEnum[goodsItm.use_status].name }}</a-tag>
</p>
<template v-if="goodsItm.qyt">
<p class="mtb-2">
<span class="f-13">企油通:</span>
<a-tag :color="qytColor(goodsItm.qyt.oil_status_zsy)">{{ qytText(goodsItm.qyt.oil_status_zsy) }}</a-tag>
</p>
<p v-if="goodsItm.qyt.oil_text" class="mtb-2 f-13 order-remark">{{ goodsItm.qyt.oil_text }}</p>
<p v-if="goodsItm.qyt.refund_status > 0" class="mtb-2">
<span class="f-13">退款:</span>
<a-tag :color="refundColor(goodsItm.qyt.refund_status)">{{ refundText(goodsItm.qyt.refund_status) }}</a-tag>
</p>
</template>
<p
v-if="[OrderStatusEnum.CANCELLED.value,OrderStatusEnum.APPLY_CANCEL.value].includes(item.order_status)"
class="mtb-2"
@@ -284,8 +325,13 @@
<DeliveryForm ref="DeliveryForm" @handleSubmit="handleRefresh" />
<CancelForm ref="CancelForm" @handleSubmit="handleRefresh" />
<CancelShareForm ref="CancelShareForm" @handleSubmit="handleRefresh" />
<!-- 企油通相关弹窗直接复用合作商订单页的组件,底层调的是 /partners.order/* -->
<ShareForm ref="ShareForm" @handleSubmit="handleRefresh" />
<PayForm ref="PayForm" @handleSubmit="handleRefresh" />
<OilForm ref="OilForm" @handleSubmit="handleRefresh" />
<UseForm ref="UseForm" @handleSubmit="handleRefresh" />
<RefundForm ref="RefundForm" @handleSubmit="handleRefresh" />
<InvoiceModal ref="InvoiceModal" />
</a-spin>
</a-card>
</template>
@@ -312,7 +358,9 @@ import {
OilStatusEnum,
UseStatusEnum
} from '@/common/enum/order'
import { DeliveryForm, CancelForm, CancelShareForm, ShareForm, PayForm } from './modules'
import { DeliveryForm, CancelForm, CancelShareForm } from './modules'
// 企油通的发放/加油/退款/发票与合作商订单完全同构,组件和接口都直接复用
import { OilForm, UseForm, ShareForm, PayForm, RefundForm, InvoiceModal } from '@/views/partners/order/modules'
// 表格字段
const columns = [
@@ -330,9 +378,24 @@ const columns = [
{
title: '操作',
dataIndex: 'action',
width: '180px',
width: '220px',
scopedSlots: { customRender: 'action' }
},
{
title: '司机',
align: 'center',
scopedSlots: { customRender: 'driver' }
},
{
title: '企油通单号',
align: 'center',
scopedSlots: { customRender: 'qyt' }
},
{
title: '加油信息',
align: 'center',
scopedSlots: { customRender: 'consume' }
},
{
title: '实付款',
align: 'center',
@@ -407,7 +470,11 @@ export default {
CancelForm,
CancelShareForm,
ShareForm,
PayForm
PayForm,
OilForm,
UseForm,
RefundForm,
InvoiceModal
},
data () {
return {
@@ -565,14 +632,68 @@ export default {
handleCancelShare (record) {
this.$refs.CancelShareForm.show(record)
},
// 手动分油
// ================================================================
// 企油通:发放 / 加油 / 退款 / 发票
// 这些操作的对象是订单商品行上挂的发放单(goodsItm.qyt,即 partners_order 记录),
// 调的接口与合作商订单页是同一套 /partners.order/*
// ================================================================
// 重新发放(仅「发放失败」可用;会重新扣减下单用户余额)
handleShare (record) {
this.$refs.ShareForm.show(record)
},
// 付款码
// 加油链接(企油通 7.15 免登 H5)
handlePay (record) {
this.$refs.PayForm.show(record)
},
// 重推发放结果(小程序单没有下游平台,等于把状态重新同步到用户端)
handleOil (record) {
this.$refs.OilForm.show(record)
},
// 重推加油结果
handleUse (record) {
this.$refs.UseForm.show(record)
},
// 退款
handleRefund (record) {
this.$refs.RefundForm.show(record)
},
// 企业发票(企油通 7.14)
handleInvoice (record) {
this.$refs.InvoiceModal.show(record)
},
// 企油通发放态文案 / 颜色
qytText (v) {
return { 0: '未提交', 1: '发放中', 2: '发放成功', 3: '发放失败' }[v] || '未知'
},
qytColor (v) {
return { 1: 'blue', 2: 'green', 3: 'red' }[v] || ''
},
// 退款状态文案 / 颜色
refundText (v) {
return { 0: '未退款', 1: '退款中', 2: '已退款', 3: '退款失败', 4: '待人工确认' }[v] || '未知'
},
refundColor (v) {
return { 1: 'blue', 2: 'green', 3: 'red', 4: 'orange' }[v] || ''
},
// 发放成功才可能退款;已经有退款记录的单总是可以打开看流水
canRefund (item) {
if (item.oilCardType !== 'zsy_ticket' || item.oil_status_zsy !== 2 || item.oil_status !== 1) {
return false
}
return item.refund_status > 0 || Number(this.remainAmount(item)) > 0
},
// 剩余未加油金额:发放金额 − 已加油 −(已退款时)退款金额
remainAmount (item) {
const refunded = item.refund_status === 2 ? Number(item.refund_amount || 0) : 0
const remain = Number(item.total_price || 0) - Number(item.used_amount || 0) - refunded
return Math.max(0, remain).toFixed(2)
},
refundLabel (item) {
return { 2: '退款记录', 4: '确认退款' }[item.refund_status] || '退款'
},
formatTime (timestamp) {
const date = new Date(timestamp)
const year = date.getFullYear()
@@ -649,4 +770,15 @@ export default {
font-size: 20px;
font-weight: 500;
}
// 操作栏:按钮较多会换行,横向纵向都留出间距(覆盖全局 .actions>a 的 8px 右边距)
.actions {
display: flex;
flex-wrap: wrap;
gap: 8px 16px;
& > a {
margin-right: 0 !important;
white-space: nowrap;
}
}
</style>
@@ -10,7 +10,7 @@
<a-spin :spinning="isLoading">
<div class="info">
<p>油卡编号:{{ record.oilCardNo }}</p>
<p>司机:{{ record.driver_name || '-' }}&nbsp;&nbsp;{{ record.mobile }}</p>
<p>司机:{{ record.driver_name || '-' }}&nbsp;&nbsp;{{ record.mobile }}<a-tag v-if="record.source === 'mall'" class="ml-10">小程序订单</a-tag></p>
<p>订单金额:¥{{ record.total_price }}&nbsp;&nbsp;已加油:¥{{ record.used_amount || '0.00' }}({{ record.used_num || 0 }} 次)</p>
<p>
退款金额:<b class="amount">¥{{ refundAmount }}</b>
@@ -28,7 +28,7 @@
<a-alert type="info" show-icon class="block">
<div slot="message">
一张订单可以分多次加油,<b>退款金额固定为剩余未加油金额</b>,已加油的部分不退,每单只能成功退一次。
<br>退款会先用企油通 7.17 查询司机支付凭证,再用 7.16 把凭证额度调低退款金额;成功后原路回补合作商余额,并推送油卡变动通知。
<br>退款会先用企油通 7.17 查询司机支付凭证,再用 7.16 把凭证额度调低退款金额;成功后{{ backText }}。
<br>额度在凭证上按司机累计,若凭证可用余额不足退款金额(被该司机其他订单用掉),会直接拒绝。
</div>
</a-alert>
@@ -113,6 +113,12 @@ export default {
statusColor () {
return STATUS_COLOR[this.status] || ''
},
// 退款成功后钱退到哪里:合作商单回补合作商余额,小程序单退回下单用户余额
backText () {
return this.record.source === 'mall'
? '把钱退回下单用户的账户余额(按实付金额折算),并同步订单状态到用户端'
: '原路回补合作商余额,并推送油卡变动通知'
},
// 已退款显示实际退款金额;否则为剩余未加油金额(后端同口径计算)
refundAmount () {
if (this.status === 2) {
+23 -2
View File
@@ -55,7 +55,23 @@
<a-form-item label="消费回调地址" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="https://你的域名/qytconsume.php" v-decorator="['consume_notify_url']" />
<div class="form-item-help">
<p class="extra">此处仅作记录留档,实际生效需在企油通后台配置同一地址。</p>
<p class="extra">企油通 7.10 加油明细推送。此处仅作记录留档,实际生效需在企油通后台配置同一地址。</p>
</div>
</a-form-item>
<a-form-item label="发放结果通知地址" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="https://你的域名/qytwaybill.php" v-decorator="['waybill_notify_url']" />
<div class="form-item-help">
<p class="extra">企油通 3.10 发放结果通知(场景 scene=oil 运单油费下发)。同样需要在企油通后台配置同一地址才会生效。</p>
</div>
</a-form-item>
<a-form-item label="发放结果通知已生效" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-switch checked-children="开" un-checked-children="关" v-decorator="['waybill_notify', { valuePropName: 'checked' }]" />
<div class="form-item-help">
<p class="extra">
确认企油通后台已配好上面的地址、并且能正常收到通知后再打开。
打开后发放结果以推送为准,7.8 轮询退为安全网(间隔放长,只兜底漏推的单)。
</p>
<p class="extra warning-tip">对方还没配好就打开,分油结果会要等轮询才能拿到,反而变慢。</p>
</div>
</a-form-item>
@@ -127,6 +143,8 @@ export default {
'h5_base_url': record.h5_base_url,
'h5_app_id': record.h5_app_id,
'consume_notify_url': record.consume_notify_url,
'waybill_notify_url': record.waybill_notify_url,
'waybill_notify': !!Number(record.waybill_notify),
'log': !!Number(record.log)
})
})
@@ -144,7 +162,7 @@ export default {
// 提交到后端api
onFormSubmit (values) {
this.isLoading = true
const form = { ...values, log: values.log ? 1 : 0 }
const form = { ...values, log: values.log ? 1 : 0, waybill_notify: values.waybill_notify ? 1 : 0 }
Api.update(this.key, { form })
.then(result => {
this.$message.success(result.message, 1.5)
@@ -177,4 +195,7 @@ export default {
.input-inst {
width: 70%;
}
.warning-tip {
color: #faad14;
}
</style>
+13 -1
View File
@@ -5,7 +5,9 @@ const api = {
userInfo: 'user/info',
assets: 'user/assets',
bindMobile: 'user/bindMobile',
personal: 'user/personal'
personal: 'user/personal',
realname: 'user/realname',
saveRealname: 'user/saveRealname'
}
// 当前登录的用户信息
@@ -32,3 +34,13 @@ export const bindMobile = (data, option) => {
export const personal = (data, option) => {
return request.post(api.personal, data, option)
}
// 实名信息(姓名/身份证号/车牌号):油券发放实名制,下单前必须补全
export const realname = (param, option) => {
return request.get(api.realname, param, option)
}
// 保存实名信息
export const saveRealname = (data, option) => {
return request.post(api.saveRealname, data, option)
}
+1 -1
View File
@@ -5,7 +5,7 @@ module.exports = {
// 必填: 后端api地址, 斜杠/结尾, 参照下面格式
// 例如: https://www.你的域名.com/index.php?s=/api/
apiUrl: "https://www.hmzkw.com/index.php?s=/api/",
apiUrl: "http://47.104.73.7/index.php?s=/api/",
/**
* 是否启用商城设置缓存
+10 -4
View File
@@ -5,7 +5,7 @@
"borderStyle": "black",
"backgroundColor": "#ffffff",
"list": [{
"pagePath": "pages/station/index",
"pagePath": "pages/index/index",
"iconPath": "static/tabbar/home.png",
"selectedIconPath": "static/tabbar/home-active.png",
"text": "首页"
@@ -30,15 +30,15 @@
}]
},
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
{
"path": "pages/station/index"
},
{
"path": "pages/index/index",
"style": {
"enablePullDownRefresh": true
}
},
{
"path": "pages/station/index"
},
{
"path": "pages/category/index",
"style": {
@@ -89,6 +89,12 @@
"navigationBarTitleText": "个人信息"
}
},
{
"path": "pages/user/realname/index",
"style": {
"navigationBarTitleText": "实名信息"
}
},
{
"path": "pages/article/index",
"style": {
+3 -46
View File
@@ -2,7 +2,6 @@
<view class="container">
<!-- 搜索框 -->
<search class="search" tips="搜索商品" @event="$navTo('pages/search/index')" />
<select-province class='province' ref="choiceProvince" :provinces="provinceList" :value="province" @change="onProvinceChange" v-model="province" />
<!-- 一级分类 -->
<primary v-if="setting.style == PageCategoryStyleEnum.ONE_LEVEL_BIG.value || setting.style == PageCategoryStyleEnum.ONE_LEVEL_SMALL.value"
:display="setting.style" :list="list" />
@@ -16,7 +15,6 @@
</template>
<script>
import SelectProvince from '@/components/select-province/select-province'
import MescrollCompMixin from '@/components/mescroll-uni/mixins/mescroll-comp'
import { setCartTabBadge } from '@/core/app'
import SettingKeyEnum from '@/common/enum/setting/Key'
@@ -38,8 +36,7 @@
Empty,
Primary,
Secondary,
Commodity,
SelectProvince
Commodity
},
mixins: [MescrollCompMixin],
data() {
@@ -53,9 +50,6 @@
trade: {},
// 正在加载中
isLoading: true,
// 地区
provinceList: [],
province: '',
}
},
@@ -77,26 +71,9 @@
}
},
methods: {
async initPage(){
try {
// 第一步:获取商城设置(等待返回)
const setting = await SettingModel.data(false) // 如果你不传参数,默认根据配置决定是否用缓存
console.log('商城设置:', setting)
const trade = setting[SettingKeyEnum.TRADE.value]
this.provinceList = trade.province_list.split(',')
// 第二步:获取本地已选择的省份
const savedProvince = uni.getStorageSync('province')
if (savedProvince) {
this.province = savedProvince
// 分类不再按省份过滤,进页面直接加载
initPage(){
this.onRefreshPage()
} else {
this.$refs.choiceProvince.open()
}
} catch (e) {
console.error('获取商城设置失败:', e)
}
},
// 刷新页面
@@ -136,7 +113,6 @@
initSetting(setting) {
this.setting = setting[SettingKeyEnum.PAGE_CATEGORY_TEMPLATE.value]
this.trade = setting[SettingKeyEnum.TRADE.value]
this.provinceList = this.trade.province_list.split(',')
},
/**
@@ -146,15 +122,6 @@
initCategory(result) {
this.list = result.data.list
},
onProvinceChange(val) {
this.province = val
// 存储省份
uni.setStorageSync('province', val)
// 加载页面数据
this.onRefreshPage()
}
},
/**
@@ -197,15 +164,5 @@
left: var(--window-left);
right: var(--window-right);
z-index: 9;
width: 78%;
}
.province {
position: fixed;
top: var(--window-top);
right: var(--window-right);
width: 20%;
height: 40px;
z-index: 9;
line-height: 40px;
}
</style>
+35
View File
@@ -30,6 +30,24 @@
</view>
</view>
<!-- 实名信息(油券发放实名制:上游分油前核验姓名+身份证号) -->
<view v-if="personal.hasOilGoods" class="flow-realname b-f" @click="onNavRealname">
<view class="flow-realname__hd dis-flex flex-x-between flex-y-center">
<text class="f-28">实名信息</text>
<view class="dis-flex flex-y-center">
<text v-if="personal.isRealnameReady" class="f-26 col-9">已完善</text>
<text v-else class="f-26 col-m">请完善</text>
<text class="right-arrow iconfont icon-arrow-right"></text>
</view>
</view>
<view v-if="personal.isRealnameReady" class="flow-realname__bd">
<text class="f-26 col-6">{{ personal.real_name }}&nbsp;&nbsp;{{ maskIdCard(personal.id_card) }}&nbsp;&nbsp;{{ personal.plate_no }}</text>
</view>
<view v-else class="flow-realname__bd">
<text class="f-24 col-9">油券为实名发放,下单前请先填写姓名、身份证号和车牌号</text>
</view>
</view>
<!-- 商品列表 -->
<view class="m-top20">
<view class="checkout_list" v-for="(item, index) in order.goodsList" :key="index">
@@ -435,6 +453,17 @@
this.$navTo('pages/goods/detail', { goodsId })
},
// 跳转到实名信息页(back=1 表示保存后返回本页)
onNavRealname() {
this.$navTo('pages/user/realname/index', { back: 1 })
},
// 身份证号脱敏展示
maskIdCard(value) {
const str = String(value || '')
return str.length < 8 ? str : `${str.substr(0, 4)}**********${str.substr(-4)}`
},
// 订单提交
onSubmitOrder() {
const app = this
@@ -445,6 +474,12 @@
if (!app.onVerifyFrom()) {
return false
}
// 油券实名制:缺信息先去补全,补完返回本页继续下单
if (app.personal.needRealname) {
app.$toast('请先完善姓名、身份证号和车牌号')
app.onNavRealname()
return false
}
// 按钮禁用
app.disabled = true
// 请求api
+21
View File
@@ -443,3 +443,24 @@
}
}
// 实名信息(油券发放实名制)
.flow-realname {
margin-top: 20rpx;
padding: 24rpx 30rpx;
&__hd {
line-height: 44rpx;
}
&__bd {
margin-top: 10rpx;
line-height: 36rpx;
}
.right-arrow {
margin-left: 8rpx;
color: #999;
font-size: 24rpx;
}
}
+22 -4
View File
@@ -106,12 +106,13 @@
</view>
<!-- 申请支付码 -->
<view class="goods-refund">
<text v-if="goods.use_status" class="stata-text">已加油</text>
<text v-if="goods.refund_status == 2" class="stata-text">已退款</text>
<text v-else-if="goods.oil_status && oilRemain(goods) <= 0" class="stata-text">已加完</text>
<!-- #ifdef MP-WEIXIN -->
<view v-else-if="order.order_status === 10 && goods.oil_status" class="action-btn" @click.stop="layerPayQrcode(goods.order_goods_id)">核销码</view>
<view v-else-if="order.order_status === 10 && goods.oil_status" class="action-btn" @click.stop="layerPayQrcode(goods.order_goods_id)">去加油</view>
<!-- #endif -->
<!-- #ifdef !MP-WEIXIN -->
<view v-else-if="order.order_status === 10 && goods.oil_status" class="action-btn" @click.stop="handlePayQrcode(goods.order_goods_id)">核销码</view>
<view v-else-if="order.order_status === 10 && goods.oil_status" class="action-btn" @click.stop="handlePayQrcode(goods.order_goods_id)">去加油</view>
<!-- #endif -->
</view>
<!-- 商品售后 -->
@@ -119,8 +120,17 @@
<text v-if="goods.refund" class="stata-text">已申请售后</text>
<view v-else-if="order.isAllowRefund" class="action-btn" @click.stop="handleApplyRefund(goods.order_goods_id)">申请售后</view>
</view> -->
<!-- 发放进度:7.7 运单油费下发是异步的,受理后要等上游发放结果 -->
<view v-if="goods.oilCardType === 'zsy_ticket' && goods.oilCardNo && !goods.oil_status" class="order-countdown">
<text v-if="goods.oil_status_zsy == 3" class="f-24 col-m">发放失败:{{ goods.oil_text || '请联系客服' }}</text>
<text v-else class="f-24 col-9">油费发放中,请稍候…</text>
</view>
<!-- 加油进度:一张订单可以分多次加油 -->
<view v-if="goods.used_num > 0" class="order-countdown">
<text class="f-24 col-9">已加油¥{{ goods.used_amount }}({{ goods.used_num }}次),剩余¥{{ oilRemain(goods).toFixed(2) }}</text>
</view>
<!-- 过期剩余时间 -->
<view v-if="order.order_status === 10 && goods.oil_status && !goods.use_status" class="order-countdown">
<view v-if="order.order_status === 10 && goods.oil_status && !goods.use_status && goods.expiration_time > 0" class="order-countdown">
<text class="m-r-6">剩余时间</text>
<count-down :date="goods.expiration_time" separator="zh" theme="text" />
</view>
@@ -342,6 +352,14 @@
canReset && uni.$emit('syncRefresh', true, true)
},
// 剩余可加油金额 = 发放金额 - 已加油 - 已退款(一单可分多次加油)
oilRemain(goods) {
const total = Number(goods.total_price || 0)
const used = Number(goods.used_amount || 0)
const refund = Number(goods.refund_amount || 0)
return Math.max(0, Math.round((total - used - refund) * 100) / 100)
},
// 获取核销码,弹窗展示二维码
layerPayQrcode(orderGoodsId) {
uni.navigateTo({
+22 -4
View File
@@ -44,18 +44,28 @@
</view>
<!-- 申请支付码 -->
<view class="goods-refund">
<text v-if="goods.use_status" class="stata-text">已加油</text>
<text v-if="goods.refund_status == 2" class="stata-text">已退款</text>
<text v-else-if="goods.oil_status && oilRemain(goods) <= 0" class="stata-text">已加完</text>
<!-- #ifdef MP-WEIXIN -->
<view v-else-if="item.order_status === 10 && goods.oil_status" class="action-btn" @click.stop="layerPayQrcode(goods.order_goods_id)">核销码</view>
<view v-else-if="item.order_status === 10 && goods.oil_status" class="action-btn" @click.stop="layerPayQrcode(goods.order_goods_id)">去加油</view>
<!-- #endif -->
<!-- #ifdef !MP-WEIXIN -->
<view v-else-if="item.order_status === 10 && goods.oil_status" class="action-btn" @click.stop="handlePayQrcode(goods.order_goods_id)">核销码</view>
<view v-else-if="item.order_status === 10 && goods.oil_status" class="action-btn" @click.stop="handlePayQrcode(goods.order_goods_id)">去加油</view>
<!-- #endif -->
</view>
</view>
</view>
<!-- 发放进度:7.7 运单油费下发是异步的,受理后要等上游发放结果 -->
<view v-if="goods.oilCardType === 'zsy_ticket' && goods.oilCardNo && !goods.oil_status" class="order-countdown">
<text v-if="goods.oil_status_zsy == 3" class="f-24 col-m">发放失败:{{ goods.oil_text || '请联系客服' }}</text>
<text v-else class="f-24 col-9">油费发放中,请稍候…</text>
</view>
<!-- 加油进度:一张订单可以分多次加油 -->
<view v-if="goods.used_num > 0" class="order-countdown">
<text class="f-24 col-9">已加油¥{{ goods.used_amount }}({{ goods.used_num }}次),剩余¥{{ oilRemain(goods).toFixed(2) }}</text>
</view>
<!-- 过期剩余时间 -->
<view v-if="item.order_status === 10 && goods.oil_status && !goods.use_status" class="order-countdown">
<view v-if="item.order_status === 10 && goods.oil_status && !goods.use_status && goods.expiration_time > 0" class="order-countdown">
<text class="m-r-6">剩余时间</text>
<count-down :date="goods.expiration_time" separator="zh" theme="text" />
</view>
@@ -352,6 +362,14 @@
});
},
// 剩余可加油金额 = 发放金额 - 已加油 - 已退款(一单可分多次加油)
oilRemain(goods) {
const total = Number(goods.total_price || 0)
const used = Number(goods.used_amount || 0)
const refund = Number(goods.refund_amount || 0)
return Math.max(0, Math.round((total - used - refund) * 100) / 100)
},
// 获取核销码,弹窗展示二维码
layerPayQrcode(orderGoodsId) {
uni.navigateTo({
+1
View File
@@ -168,6 +168,7 @@
* id: 标识; name: 标题名称; icon: 图标; type 类型(link和button); url: 跳转的链接
*/
const service = [
{ id: 'realname', name: '实名信息', icon: 'profile', type: 'link', url: 'pages/user/realname/index' },
{ id: 'address', name: '收货地址', icon: 'shouhuodizhi', type: 'link', url: 'pages/address/index' },
{ id: 'coupon', name: '领券中心', icon: 'lingquan', type: 'link', url: 'pages/coupon/index' },
// { id: 'myCoupon', name: '优惠券', icon: 'youhuiquan', type: 'link', url: 'pages/my-coupon/index' },
+221
View File
@@ -0,0 +1,221 @@
<template>
<view class="container">
<!-- 页面头部 -->
<view class="header">
<view class="title">
<text>完善实名信息</text>
</view>
<view class="sub-title">
<text>油券发放为实名制,需核验姓名与身份证号;车牌号仅用于您的加油记录。</text>
</view>
</view>
<!-- 表单 -->
<view class="submit-form">
<!-- 姓名 -->
<view class="form-item">
<text class="form-item--label">姓&emsp;&emsp;名</text>
<input class="form-item--input" type="text" v-model="realName" maxlength="20" placeholder="请输入身份证上的姓名" />
</view>
<!-- 身份证号 -->
<view class="form-item">
<text class="form-item--label">身份证号</text>
<input
class="form-item--input"
type="idcard"
v-model="idCard"
maxlength="18"
:disabled="idCardLocked"
:placeholder="idCardLocked ? '已核验,不可修改' : '请输入18位身份证号'"
/>
</view>
<!-- 车牌号 -->
<view class="form-item">
<text class="form-item--label">车&ensp;牌&ensp;号</text>
<input class="form-item--input" type="text" v-model="plateNo" maxlength="8" placeholder="如 闽A12345" />
</view>
<view v-if="idCardLocked" class="tips">
<text>身份证号已用于油券发放,如需变更请联系客服。</text>
</view>
<!-- 保存 -->
<view class="submit-button" :class="{ disabled: isLoading }" @click="handleSubmit()">
<text>保存</text>
</view>
</view>
</view>
</template>
<script>
import * as UserApi from '@/api/user'
export default {
data() {
return {
// 正在加载
isLoading: false,
// 姓名
realName: '',
// 身份证号
idCard: '',
// 车牌号
plateNo: '',
// 身份证号是否已锁定(已用于分油,不允许再改)
idCardLocked: false,
// 保存成功后是否返回上一页(从结算台跳过来时为 1)
back: 0
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.back = Number(options.back || 0)
this.getDetail()
},
methods: {
// 获取已保存的实名信息
getDetail() {
const app = this
app.isLoading = true
UserApi.realname()
.then(result => {
const { realname } = result.data
app.realName = realname.realName
app.idCard = realname.idCard
app.plateNo = realname.plateNo
app.idCardLocked = realname.idCardLocked
})
.finally(() => app.isLoading = false)
},
// 点击保存
handleSubmit() {
const app = this
if (app.isLoading || !app.formValidation()) {
return false
}
app.isLoading = true
UserApi.saveRealname({
form: {
realName: app.realName,
idCard: app.idCard,
plateNo: app.plateNo
}
})
.then(result => {
app.$toast(result.message)
// 从结算台跳过来的:保存完回到结算台继续下单
setTimeout(() => {
app.back ? uni.navigateBack({ delta: 1 }) : app.getDetail()
}, 1200)
})
.finally(() => app.isLoading = false)
},
// 表单验证
formValidation() {
const app = this
const realName = (app.realName || '').trim()
const idCard = (app.idCard || '').trim().toUpperCase()
const plateNo = (app.plateNo || '').trim().toUpperCase()
if (!/^[一-龥][一-龥·]{1,19}$/.test(realName)) {
app.$toast('请填写身份证上的中文姓名')
return false
}
if (!/^\d{17}[\dX]$/.test(idCard)) {
app.$toast('身份证号格式不正确(18位)')
return false
}
// 省份简称 + 城市字母(不含 I/O) + 5~7 位序号(含新能源 8 位车牌)
if (!/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-HJ-NP-Z][A-HJ-NP-Z0-9]{4,6}$/.test(plateNo)) {
app.$toast('车牌号格式不正确')
return false
}
app.realName = realName
app.idCard = idCard
app.plateNo = plateNo
return true
}
}
}
</script>
<style lang="scss" scoped>
.container {
padding: 80rpx 60rpx;
min-height: 100vh;
background-color: #fff;
}
// 页面头部
.header {
margin-bottom: 50rpx;
.title {
color: #191919;
font-size: 50rpx;
}
.sub-title {
margin-top: 20rpx;
color: #b3b3b3;
font-size: 25rpx;
line-height: 38rpx;
}
}
// 输入框元素
.form-item {
display: flex;
align-items: center;
padding: 18rpx;
border-bottom: 1rpx solid #f3f1f2;
margin-bottom: 25rpx;
height: 96rpx;
&--label {
width: 180rpx;
font-size: 28rpx;
color: #555;
}
&--input {
font-size: 28rpx;
letter-spacing: 1rpx;
flex: 1;
height: 100%;
}
}
.tips {
margin-top: 10rpx;
font-size: 24rpx;
color: #f37b1d;
line-height: 36rpx;
}
// 提交按钮
.submit-button {
margin-top: 70rpx;
height: 88rpx;
line-height: 88rpx;
text-align: center;
color: #fff;
font-size: 30rpx;
border-radius: 44rpx;
background: linear-gradient(to right, #f9211c, #ff6335);
&.disabled {
opacity: 0.6;
}
}
</style>
+1 -3
View File
@@ -81,9 +81,7 @@ export default class request {
data.data.referrer_id = uni.getStorageSync('uid');
data.data.latitude = uni.getStorageSync('latitude');
data.data.longitude = uni.getStorageSync('longitude');
data.data.province = uni.getStorageSync('province');
data.data.city = uni.getStorageSync('city');
data.data.district = uni.getStorageSync('district');
// 商品/分类不再按省份过滤,省市区不再随请求下发(原先后端会据此过滤油券)
// 请求数据
let requestInfo,
// 是否运行过请求开始钩子
+79 -6
View File
@@ -24,6 +24,10 @@ use app\store\model\Company as CompanyModel;
use app\store\model\Express as ExpressModel;
use app\common\enum\order\PayType as OrderPayTypeEnum;
use app\store\model\order\QrCode as QrCodeModel;
use app\common\model\qyt\Enterprise as EnterpriseModel;
use app\common\service\QytOil;
use app\api\service\User as UserService;
use think\facade\Db;
use cores\exception\BaseException;
use think\facade\Request;
use think\response\Json;
@@ -309,9 +313,77 @@ class Order extends Controller
*/
public function qrCode(): Json
{
// 企油通改造:小程序油品发放/核销链路已停用(上游定聚已下线)。
// 保留接口避免小程序端报错,统一返回提示;如需恢复请改走 QytOil。
return $this->renderError('该功能已停用');
$orderGoodsId = (int)$this->request->param('orderGoodsId');
[$order, $error] = $this->findOilOrder($orderGoodsId);
if ($error !== '') {
return $this->renderError($error);
}
// 免登链接要带本单企业的 creditcode(营业执照号),把登录固定到该企业
$enterprise = EnterpriseModel::detail((int)$order['qyt_enterprise_id']);
if (!$enterprise) {
return $this->renderError('本单绑定的企油通企业不存在,无法获取加油地址');
}
if ($enterprise['status'] !== 'approved') {
return $this->renderError('企业尚未通过企油通审核,暂时无法加油');
}
$h5Url = QytOil::forEnterprise($enterprise)->h5Url((string)$order['mobile']);
if (!$h5Url) {
return $this->renderError('获取加油地址失败,请稍后重试');
}
// 留痕
(new QrCodeModel())->add([
'oilCardNo' => $order['oilCardNo'],
'qrCode' => $h5Url,
'amount' => $order['goods_price'],
'order_id' => (int)$order['mall_order_id'],
'user_id' => (int)$order['user_id'],
'store_id' => (int)$order['store_id'],
]);
return $this->renderSuccess(['qrCode' => $h5Url], '提交成功');
}
/**
* 按订单商品行找到对应的企油通发放单,并校验是否还能加油
*
* 小程序单在支付成功后由 MallOil::create 建了一条 yoshop_partners_order
* (source='mall',mall_order_goods_id 指回这里的订单商品行)。
*
* @param int $orderGoodsId
* @return array [发放单, 错误信息]
* @throws BaseException
*/
private function findOilOrder(int $orderGoodsId): array
{
if ($orderGoodsId <= 0) {
return [null, '缺少参数 orderGoodsId'];
}
$userId = (int)UserService::getCurrentLoginUserId();
$orderGoods = Db::name('order_goods')->where('order_goods_id', '=', $orderGoodsId)->find();
if (!$orderGoods) {
return [null, '未找到订单商品'];
}
// 越权校验:只能取自己订单的加油地址
if ((int)$orderGoods['user_id'] !== $userId) {
return [null, '未找到订单商品'];
}
$order = Db::name('partners_order')
->where('source', '=', 'mall')
->where('mall_order_goods_id', '=', $orderGoodsId)
->find();
if (!$order) {
return [null, '该订单还没有发放记录'];
}
if ((int)$order['oil_status'] !== 1) {
return [null, '油费还在发放中,请稍后再试'];
}
if ((int)$order['refund_status'] === 2) {
return [null, '该订单已退款,不能再加油'];
}
// 一单可以分多次加油:没加完的单继续给加油地址
if ((float)$order['used_amount'] + 0.005 >= (float)$order['total_price']) {
return [null, '该订单金额已全部加油'];
}
return [$order, ''];
}
/**
@@ -321,9 +393,10 @@ class Order extends Controller
*/
public function qrCodeImg(): Json
{
// 企油通改造:小程序油品发放/核销链路已停用(上游定聚已下线)。
// 保留接口避免小程序端报错,统一返回提示;如需恢复请改走 QytOil。
return $this->renderError('该功能已停用');
// 企油通给的是 H5 免登链接,没有二维码图片接口。
// 本商城跑在 H5(微信内置浏览器)下,走的是 qrCode + webview;
// 本方法只在微信小程序环境下被调用,暂不支持。
return $this->renderError('请在微信或浏览器中打开加油链接');
}
public function getBase64($url){
+81 -2
View File
@@ -2,8 +2,13 @@
// +----------------------------------------------------------------------
// | 企油通 · 回调接收
// +----------------------------------------------------------------------
// | 入口:public/qytconsume.php -> /qytNotify/consume
// | 对应企油通 7.10「运单加油明细推送(异步)」,我方须返回 {"code":"100","msg":"Success"}
// | 入口:
// | public/qytconsume.php -> /qytNotify/consume 企油通 7.10「运单加油明细推送」
// | public/qytwaybill.php -> /qytNotify/waybill 企油通 3.10「发放结果通知」
// |
// | 两个回调都是 multipart/form-data,业务参数在表单字段里(JSON 字符串):
// | 7.10 -> params 我方须返回 {"code":"100","msg":"Success"}
// | 3.10 -> data + sign 我方只要返回 HTTP 2xx 即算成功,响应体不做要求
// +----------------------------------------------------------------------
declare (strict_types=1);
@@ -70,4 +75,78 @@ class QytNotify extends Controller
return json(['code' => '100', 'msg' => 'Success']);
}
/**
* 3.10 发放结果通知(运单油费 / 企业福利)
*
* 企油通把 7.7 提交的批次处理完后(全部成功 / 部分成功 / 处理失败)主动推过来,
* 一个批次一条,内容与 7.8 查询结果一致。接上之后就不必再靠轮询等结果。
*
* 约定(见文档 3.10):
* · form-data,字段 data(JSON 字符串)+ sign
* · scene 区分场景:oil=运单油费下发(7.7),welfare=员工福利下发(9.3)
* · 接收端返回 HTTP 2xx 即视为成功;非 2xx 或 5 秒内无响应会重试,最多 5 次
* · 同一批次可能收到多次(重试 / 批次重新提交),必须幂等
* · 明细最多约 1 万条,报文可能很大
*
* 所以这里只做「尽快收下、丢进队列、立刻回 200」,真正的状态跃迁交给
* callback:queue 异步做,避免大报文处理超过上游 5 秒超时导致无谓重试。
*
* @return \think\response\Json
*/
public function waybill()
{
$request = Request::instance();
// ⚠️ 必须直接读 $_POST:cores\Request 给所有入参挂了全局过滤器
// ['my_trim','my_htmlspecialchars','filter_emoji'],走 $request->post() 取到的
// JSON 引号会被转义成 &quot;,json_decode 必然失败(通知会被静默丢掉)
$formData = isset($_POST['data']) ? trim((string) $_POST['data']) : '';
$sign = isset($_POST['sign']) ? trim((string) $_POST['sign']) : '';
$raw = $request->getContent();
$payload = $formData !== '' ? $formData : $raw;
$qyt = new QytOil();
// 明细可能上万条,日志只留头部,完整报文靠 batch_no 去企油通后台对
$qyt->saveLog('3.10 发放结果通知原文[' . $request->contentType() . '](截断):'
. mb_substr($payload, 0, 4000) . (mb_strlen($payload) > 4000 ? ' …(已截断)' : ''));
$data = json_decode($payload, true);
// 兜底:若上游或中间层做过 HTML 转义,反转义后再解析一次
if (!is_array($data) && strpos($payload, '&quot;') !== false) {
$data = json_decode(htmlspecialchars_decode($payload, ENT_QUOTES), true);
}
// 兼容:直接推 JSON body 且外层包了一层 {data: ..., sign: ...}
if (is_array($data) && isset($data['data'])) {
$sign === '' && $sign = (string) ($data['sign'] ?? '');
$data = is_string($data['data']) ? json_decode($data['data'], true) : $data['data'];
}
if (!is_array($data) || empty($data['batch_no'])) {
$qyt->saveLog('3.10 发放结果通知解析失败或缺少 batch_no,已忽略');
// 仍然回 2xx:报文我方解析不了,让上游重试 5 次也没有意义,
// 这类单由 7.8 轮询兜底(轮询并没有下线)
return json(['code' => '100', 'msg' => 'Success']);
}
// TODO 验签(对 data 原串签名,规则见开发指南 2.5,待对接人给到平台公钥与算法确认)
// if ($sign !== '' && !(new QytCrypto())->verifyNotify($payload, $sign)) {
// $qyt->saveLog('3.10 发放结果通知验签失败 batch_no=' . $data['batch_no']);
// return json(['code' => '99', 'msg' => 'sign error']);
// }
// 只处理运单油费(7.7)。员工福利(9.3)我方没有对接,收下回 2xx 即可,
// 否则上游会按失败重试 5 次。
$scene = (string) ($data['scene'] ?? 'oil');
if ($scene !== 'oil') {
$qyt->saveLog('3.10 发放结果通知 scene=' . $scene . '(非运单油费),已忽略 batch_no=' . $data['batch_no']);
return json(['code' => '100', 'msg' => 'Success']);
}
(new QueueService())->push('callback_queue', json_encode([
'header' => ['method' => 'qyt_waybill_result'],
'res' => $data,
], 320));
return json(['code' => '100', 'msg' => 'Success']);
}
}
+41
View File
@@ -17,6 +17,7 @@ use app\api\model\User as UserModel;
use app\api\model\UserCoupon as UserCouponModel;
use app\api\service\User as UserService;
use cores\exception\BaseException;
use think\facade\Db;
/**
* 用户管理
@@ -76,6 +77,46 @@ class User extends Controller
return $this->renderSuccess('恭喜您,手机号绑定成功');
}
/**
* 实名信息(姓名 / 身份证号 / 车牌号)
*
* 分油实名制:上游分油前做「姓名 + 身份证号」二要素认证,所以下单前必须补全。
* 车牌号只在本地留存与后台展示,不上送上游。
* @return Json
* @throws BaseException
*/
public function realname(): Json
{
$userInfo = UserService::getCurrentLoginUser(true);
return $this->renderSuccess([
'realname' => [
'realName' => (string)$userInfo['real_name'],
'idCard' => (string)$userInfo['id_card'],
'plateNo' => (string)$userInfo['plate_no'],
// 身份证号已用于分油后不允许再改(上游按身份证号累计司机额度)
'idCardLocked' => (string)$userInfo['id_card'] !== '' && Db::name('partners_order')
->where('user_id', '=', (int)$userInfo['user_id'])
->where('source', '=', 'mall')
->count() > 0,
'isReady' => UserModel::isRealnameReady($userInfo),
]
]);
}
/**
* 保存实名信息
* @return Json
* @throws BaseException
*/
public function saveRealname(): Json
{
$model = new UserModel;
if (!$model->realname($this->postForm())) {
return $this->renderError($model->getError() ?: '保存失败');
}
return $this->renderSuccess('保存成功');
}
/**
* 修改个人信息(头像昵称)
* @return Json
+70
View File
@@ -16,6 +16,7 @@ use app\common\enum\user\balanceLog\Scene as SceneEnum;
use app\common\library\helper;
use app\store\model\user\BalanceLog as BalanceLogModel;
use think\facade\Cache;
use think\facade\Db;
use app\api\service\User as UserService;
use app\api\model\UserOauth as UserOauthModel;
use app\common\model\User as UserModel;
@@ -112,6 +113,75 @@ class User extends UserModel
return $userInfo->save($data);
}
/**
* 保存实名信息(姓名 / 身份证号 / 车牌号)
*
* 分油是实名制的:上游在分油前会做「姓名 + 身份证号」二要素认证,
* 所以这三项必须在下单前补全。车牌号只在本地留存与后台展示,不上送上游。
*
* @param array $form
* @return bool
* @throws BaseException
*/
public function realname(array $form): bool
{
$realName = trim((string)($form['realName'] ?? ''));
$idCard = strtoupper(trim((string)($form['idCard'] ?? '')));
$plateNo = strtoupper(trim((string)($form['plateNo'] ?? '')));
if ($realName === '') {
$this->error = '请填写真实姓名';
return false;
}
// 中文姓名 2~20 字,允许少数民族姓名里的间隔号
if (!preg_match('/^[\x{4e00}-\x{9fa5}][\x{4e00}-\x{9fa5}·]{1,19}$/u', $realName)) {
$this->error = '姓名格式不正确,请填写身份证上的中文姓名';
return false;
}
if (!preg_match('/^\d{17}[\dX]$/', $idCard)) {
$this->error = '身份证号格式不正确(18位)';
return false;
}
// 省份简称 + 城市字母(不含 I/O,避免与 1/0 混淆) + 5~7 位序号(含新能源 8 位车牌)
if (!preg_match('/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-HJ-NP-Z][A-HJ-NP-Z0-9]{4,6}$/u', $plateNo)) {
$this->error = '车牌号格式不正确';
return false;
}
// 当前登录的用户信息
$userInfo = UserService::getCurrentLoginUser(true);
// 身份证号一旦用于分油就不允许再改:上游按身份证号累计司机额度,
// 改了会导致历史订单的额度与司机对不上。姓名/车牌可以改。
if ((string)$userInfo['id_card'] !== '' && (string)$userInfo['id_card'] !== $idCard) {
$used = Db::name('partners_order')
->where('user_id', '=', (int)$userInfo['user_id'])
->where('source', '=', 'mall')
->count();
if ($used > 0) {
$this->error = '身份证号已用于分油,不能修改,请联系客服';
return false;
}
}
return $userInfo->save([
'real_name' => $realName,
'id_card' => $idCard,
'plate_no' => $plateNo,
]) !== false;
}
/**
* 实名信息是否已补全(下单前的必要条件)
* @param array|static $user
* @return bool
*/
public static function isRealnameReady($user): bool
{
return trim((string)($user['real_name'] ?? '')) !== ''
&& trim((string)($user['id_card'] ?? '')) !== ''
&& trim((string)($user['plate_no'] ?? '')) !== '';
}
/**
* 验证绑定的手机号
* @param array $data
@@ -370,9 +370,30 @@ class Checkout extends BaseService
'balance' => $this->user['balance'],
'points' => $this->user['points'],
'address_id' => $this->user['address_id'],
// 实名信息(分油实名制,下单前必须补全):结算页据此拦截并跳去补全
'real_name' => (string)$this->user['real_name'],
'id_card' => (string)$this->user['id_card'],
'plate_no' => (string)$this->user['plate_no'],
'isRealnameReady' => UserModel::isRealnameReady($this->user),
'hasOilGoods' => $this->hasOilGoods(),
'needRealname' => $this->hasOilGoods() && !UserModel::isRealnameReady($this->user),
];
}
/**
* 本次结算是否包含油券商品(oilCardType = zsy_ticket)
* 油券要走企油通分油,必须有姓名/身份证号/车牌号
*/
private function hasOilGoods(): bool
{
foreach ($this->goodsList as $goods) {
if (($goods['oilCardType'] ?? '') === 'zsy_ticket') {
return true;
}
}
return false;
}
/**
* 当前用户可用的优惠券列表
* @param float $orderTotalPrice 总金额
@@ -757,6 +778,12 @@ class Checkout extends BaseService
return false;
}
}
// 油券商品要走企油通分油(实名制:上游做姓名+身份证号二要素认证),
// 下单前必须补全实名信息。结算页已拦截,这里是服务端兜底。
if ($this->hasOilGoods() && !UserModel::isRealnameReady($this->user)) {
$this->error = '请先完善姓名、身份证号和车牌号后再下单';
return false;
}
return true;
}
+29 -59
View File
@@ -18,6 +18,7 @@ use app\common\lock\RedisLock;
use app\common\model\Coupon;
use app\common\service\SybOil;
use app\common\service\IdingjuOil;
use app\common\service\MallOil;
use app\store\model\Company as CompanyModel;
use app\store\model\Coupon as CouponModel;
use app\store\model\GoodsCoupon as GoodsCouponModel;
@@ -108,15 +109,6 @@ class PaySuccess extends BaseService
}
// 获取订单详情
$detail = OrderModel::getUserOrderDetail((int)$this->model['order_id']);
// 触发分油接口
$shareStatus = $this->shareOil($detail);
if (!$shareStatus) {
// 记录日志
log_record(['name' => '分油失败', [
'order_id' => $this->model['order_id'],
]]);
// return false;
}
// 事务处理
$this->model->transaction(function () use ($payType, $payData, $detail) {
// 更新订单状态
@@ -126,6 +118,16 @@ class PaySuccess extends BaseService
// 记录订单支付信息
$this->updatePayInfo($payType);
});
// 触发分油/发券(放在事务之后:企油通发放是真金白银,必须等订单确实置为已支付再发,
// 否则事务回滚会出现「订单未支付但油费已下发」)
$shareStatus = $this->shareOil($detail);
if (!$shareStatus) {
// 记录日志;不影响支付成功的结果,发放失败由 7.8 判定后自动退回用户余额
log_record(['name' => '分油失败', [
'order_id' => $this->model['order_id'],
'error' => $this->error,
]]);
}
return true;
}
@@ -250,61 +252,29 @@ class PaySuccess extends BaseService
}
}
/**
* 支付成功后的商品发放
* · 油券(zsy_ticket) -> 建企油通发放单,由 partners:queue 调 7.7 下发
* · 优惠券(coupon) -> 直接发券(原逻辑不变)
*
* 返回 false 只用于写一条「分油失败」日志,不阻断支付成功:用户已经付过款,
* 订单必须正常置为已支付。发放失败由 7.8 判定后自动退回用户余额,或后台「重新发放」。
*/
private function shareOil($order): bool
{
$IdingjuOil = new IdingjuOil();
$ok = true;
// 下单用户(含实名信息:姓名/身份证号/车牌号,结算时已校验必填)
$user = Db::name('user')->where('user_id', (int)$order['user_id'])->find() ?: [];
foreach ($order->goods as $goods) {
/* @var GoodsModel $goods */
// 企油通改造:小程序油品发放链路已停用,支付成功后不再触发上游分油(保留优惠券发放)。
// 如需恢复小程序侧发放,改走 QytOil 并补齐司机三要素来源。
if ($goods['oilCardType'] == 'zsy_ticket') {
continue;
// 企油通:一个油券商品行建一条发放单,金额取该行实付金额
$res = MallOil::create($order->toArray(), $goods->toArray(), $user);
if (!$res['ok']) {
$this->error = $res['message'];
$goods->save(['oil_text' => mb_substr($res['message'], 0, 190)]);
$ok = false;
}
if($goods['oilCardType'] == 'zsy_ticket') {
$data['amount'] = $goods['total_price']; // 金额
$company = CompanyModel::detail(['orgNo' => $this->getCompany($goods['goods_no'])]);
if (!$company) {
$this->error = '没有可用参数';
return false;
}
try {
// 查找一个未被调用的用户
$account = $this->processUserOrders($company['company_id']);
} catch (\Throwable $e) {
$this->error = $e->getMessage();
return false;
}
// 查询公司余额
/*if ($data['amount'] > $company['balance']) {
$this->error = '公司余额不足';
return false;
}*/
// 对接平台接口
$res = $IdingjuOil->oilOilCardShare([
'goodsNo'=>$goods['goods_no'],
'amount'=>$data['amount'],
'userNo'=>$account['userNo'],
'mobile'=>$account['mobile'],
'saleOrderNo'=>$goods['oilCardNo'],
'oilCardType'=>$goods['oilCardType']
], $company);
//$res = json_decode('{"code":"00","message":"请求成功","errCode":null,"errMessage":null,"data":{"oilCardNo":null,"amount":100,"balance":null,"shareNo":"CDV2408021928160001"}}', true);
if ($res['code'] != 1) {
$this->error = ($res['errMessage'] ?? $res['message']);
return false;
}
$item['account_id'] = $account['account_id'];
$item['userNo'] = $account['userNo'];
$item['mobile'] = $account['mobile'];
$item['company_id'] = $company['company_id'];
$item['shareNo'] = $res['data']['trade_no'] ?? '';
$item['qrCode'] = $res['data']['useUrl'] ?? '';
$item['oil_status_zsy'] = $res['data']['state'] ?? 0;
$item['oil_time'] = time();
$item['oil_status'] = $item['oil_status_zsy'] == 2 ? 1 : 0; // 已发券 为1
$goods->save($item);
} elseif ($goods['oilCardType'] == 'coupon') {
// 发放优惠券
$coupons = GoodsCouponModel::getCouponList($goods['goods_id'])->toArray();
@@ -319,7 +289,7 @@ class PaySuccess extends BaseService
}
}
}
return true;
return $ok;
}
/**
+20
View File
@@ -200,6 +200,26 @@ function runtime_root_path(): string
return dirname(runtime_path()) . DIRECTORY_SEPARATOR;
}
/**
* 上游对接日志(storelog)的统一目录
*
* ⚠️ 不能用 runtime_path():多应用模式下 think-multi-app 会把运行时目录改写成
* runtime/{应用名}/(vendor/topthink/think-multi-app/src/MultiApp.php::setApp 里的
* setRuntimePath),于是同一条业务链路的日志会散到三个地方:
* CLI 常驻队列进程 runtime/storelog/
* api 入口(回调接收) runtime/api/storelog/
* store 后台操作 runtime/store/storelog/
* 排查时极易找错目录(比如回调明明收到了,却在 CLI 那个目录里怎么都 grep 不到)。
* 这里按项目根目录固定,所有进程写同一处。
*
* 注:改动只影响新日志,历史日志仍留在原来的三个目录里。
* @return string 带结尾分隔符的绝对路径
*/
function store_log_path(): string
{
return app()->getRootPath() . 'runtime' . DIRECTORY_SEPARATOR . 'storelog' . DIRECTORY_SEPARATOR;
}
/**
* 写入日志 (使用tp自带驱动记录到runtime目录中)
* @param mixed $value
+3 -8
View File
@@ -237,15 +237,10 @@ class Goods extends BaseModel
$query->join($GoodsCategoryRelName, "{$GoodsCategoryRelName}.goods_id = {$this->name}.goods_id");
// 设置分类ID条件
$query->where('goods_category_rel.category_id', '=', (int)$params['categoryId']);
}elseif(!empty($params['province']) && $params['location'] != 1){
// 前端请求,没有分类则不展示商品
// 关联商品与分类关系记录表
$GoodsCategoryRelName = (new GoodsCategoryRelModel)->getName();
$query->join($GoodsCategoryRelName, "{$GoodsCategoryRelName}.goods_id = {$this->name}.goods_id");
// 设置分类ID条件
$query->where('goods_category_rel.category_id', '=', -1);
}
// 原先这里有一条「带了 province 又没带分类 -> 强制返回空列表」的分支,
// 配合首页地图选城市使用。商品不再按省份强制过滤,该分支已移除:
// 没传 categoryId 就是查全部商品。
// 商品名称
!empty($params['goodsName']) && $filter[] = ['goods_name', 'like', "%{$params['goodsName']}%"];
// 商品编码
@@ -328,6 +328,8 @@ class Setting extends BaseModel
'h5_base_url' => '', // 7.15 落地页
'h5_app_id' => '', // 7.15 免登 appId
'consume_notify_url' => '', // 7.10 回调地址(仅记录,实际在企油通后台配)
'waybill_notify_url' => '', // 3.10 发放结果通知地址(同上)
'waybill_notify' => 0, // 3.10 发放结果通知是否已生效(开 -> 7.8 轮询退为安全网)
'log' => 1, // 是否记录详细请求/响应日志
],
],
+2 -2
View File
@@ -35,8 +35,8 @@ class IdingjuOil extends BaseService
public function saveLogStore($data){
$years = date('Ym');
$day = date('Ymd');
//设置路径目录信息
$dir = runtime_path('storelog/').$years.'/'.$day;
//设置路径目录信息(store_log_path 保证 CLI / api / store 各进程写同一处,见 app/common.php)
$dir = store_log_path().$years.'/'.$day;
//目录不存在就创建
$this->mk_dir_store($dir);
$url = $dir.'/'.date('YmdH').'.txt';
+390
View File
@@ -0,0 +1,390 @@
<?php
// +----------------------------------------------------------------------
// | 小程序(商城)订单 -> 企油通发放
// +----------------------------------------------------------------------
// | 设计:小程序订单不另起一套企油通链路,而是在支付成功后为每个油券商品行
// | 建一条 yoshop_partners_order(source='mall'),复用现有机器:
// | · partners:queue 7.7 运单油费下发
// | · qyt:status 7.8 轮询发放结果
// | · 7.10 消费回调 按 waybill_no_code 匹配,无需改动
// | · QytRefund 7.17 查凭证 + 7.16 调低额度
// | · QytInvoice 7.14 企业发票
// | · QytDriver 司机档案
// |
// | 两种来源的差异只有三处,全部收敛在本类:
// | 1. 额度:合作商单扣/补 partners.balance;商城单用户已付款,改退用户余额
// | 2. 通知:合作商单 HTTP 回调下单平台;商城单没有下游,改回写 order_goods
// | 3. 建单:合作商单由开放接口 OilCard::share 建;商城单由 PaySuccess 建
// +----------------------------------------------------------------------
declare (strict_types=1);
namespace app\common\service;
use app\common\enum\user\balanceLog\Scene as SceneEnum;
use app\common\model\qyt\Enterprise as EnterpriseModel;
use think\facade\Db;
class MallOil
{
/** partners_order.source 取值 */
const SOURCE_MALL = 'mall';
const SOURCE_PARTNER = 'partner';
/**
* 是否小程序(商城)单
* @param array|\think\Model $order partners_order 记录
* @return bool
*/
public static function isMall($order): bool
{
return (string) ($order['source'] ?? self::SOURCE_PARTNER) === self::SOURCE_MALL;
}
// ================================================================
// 建单(支付成功后调用)
// ================================================================
/**
* 为一个油券商品行创建企油通发放单并投递 partners_queue
*
* 幂等:复用已有唯一键 uk_partner_saleorder(partners_id, partners_order_no),
* mall 行 partners_id=0、partners_order_no='M{订单号}-{order_goods_id}'。
* 支付回调重入时唯一键冲突 -> 当作「已建过」返回原单,绝不重复发放。
*
* @param array $order 商城订单(yoshop_order)
* @param array $goods 订单商品行(yoshop_order_goods)
* @param array $user 下单用户(含 real_name / id_card / plate_no)
* @return array ['ok' => bool, 'message' => string, 'order_id' => int]
*/
public static function create(array $order, array $goods, array $user): array
{
// 发放金额按油券面值(数量 x 单价),与改造前的口径一致;
// 用户实付(优惠券/积分抵扣后)另存 total_pay_price,退款回补余额时按它折算。
$amount = round((float) $goods['total_price'], 2);
$paid = round((float) $goods['total_pay_price'], 2);
$paid > $amount && $paid = $amount;
if ($amount <= 0) {
return self::fail('商品金额为 0,不发放');
}
$mobile = trim((string) ($user['mobile'] ?? ''));
$name = trim((string) ($user['real_name'] ?? ''));
$idCard = strtoupper(trim((string) ($user['id_card'] ?? '')));
$plateNo = strtoupper(trim((string) ($user['plate_no'] ?? '')));
// 两个支付通道都要求实名,缺一不可。结算时已拦截,这里是第二道闸。
$missing = [];
$mobile === '' && $missing[] = '手机号';
$name === '' && $missing[] = '姓名';
$idCard === '' && $missing[] = '身份证号';
if ($missing) {
return self::fail('缺' . implode('/', $missing) . ',无法发放');
}
// 本单使用的企油通企业:小程序没有合作商绑定关系,直接取默认企业
$enterprise = EnterpriseModel::resolve(0);
if (!$enterprise) {
return self::fail('系统未配置可用的企油通企业,无法发放');
}
$saleOrderNo = 'M' . $order['order_no'] . '-' . $goods['order_goods_id'];
$exist = Db::name('partners_order')
->where('partners_id', 0)
->where('partners_order_no', $saleOrderNo)
->find();
if ($exist) {
// 已建过(支付回调重入):直接复用,并补投一次队列(下发是条件跃迁,重复投递安全)
self::push((int) $exist['order_id']);
return ['ok' => true, 'message' => '已存在发放单', 'order_id' => (int) $exist['order_id']];
}
$now = time();
// 带上 order_goods_id(全局唯一)保证油卡编号不会撞号
$oilCardNo = 'OIL' . $now . 'G' . (int) $goods['order_goods_id'];
$row = [
'province' => (string) ($goods['province'] ?? ''),
'mobile' => $mobile,
'driver_name' => $name,
'id_card' => $idCard,
'plate_no' => $plateNo,
// 企业与通道随单固化:之后切默认企业,在途单仍按下单时的企业发放
'qyt_enterprise_id' => (int) $enterprise['enterprise_id'],
'passageway' => (string) $enterprise['passageway'],
'oilCardType' => 'zsy_ticket',
'oilCardNo' => $oilCardNo,
'partners_order_no' => $saleOrderNo,
'partners_id' => 0,
'source' => self::SOURCE_MALL,
'mall_order_id' => (int) $order['order_id'],
'mall_order_goods_id' => (int) $goods['order_goods_id'],
'user_id' => (int) $order['user_id'],
'goods_id' => (int) $goods['goods_id'],
'goods_name' => (string) $goods['goods_name'],
'goods_no' => (string) $goods['goods_no'],
'goods_price' => $amount,
'total_num' => 1,
'total_price' => $amount,
'total_pay_price' => $paid,
'order_status' => 10,
'store_id' => (int) $order['store_id'],
'create_time' => $now,
'update_time' => $now,
];
try {
$orderId = (int) Db::name('partners_order')->insertGetId($row);
} catch (\Throwable $e) {
if (strpos($e->getMessage(), 'Duplicate') !== false) {
$again = Db::name('partners_order')->where('partners_id', 0)
->where('partners_order_no', $saleOrderNo)->find();
if ($again) {
self::push((int) $again['order_id']);
return ['ok' => true, 'message' => '已存在发放单', 'order_id' => (int) $again['order_id']];
}
}
self::log('商城单建发放单失败 order_goods=' . $goods['order_goods_id'] . ':' . $e->getMessage());
return self::fail('建发放单失败:' . $e->getMessage());
}
// 把油卡编号写回订单商品行,小程序端与后台基础列继续按原字段展示
Db::name('order_goods')->where('order_goods_id', (int) $goods['order_goods_id'])->update([
'oilCardNo' => $oilCardNo,
'mobile' => $mobile,
'oil_text' => '已提交发放',
]);
// 司机档案(按身份证号归档并标记信息冲突;内部吞异常,不影响主流程)
QytDriver::touch([
'order_id' => $orderId,
'id_card' => $idCard,
'driver_name' => $name,
'mobile' => $mobile,
'store_id' => (int) $order['store_id'],
]);
self::push($orderId);
return ['ok' => true, 'message' => '已提交发放', 'order_id' => $orderId];
}
// ================================================================
// 额度回补(发放失败 / 退款成功)
// ================================================================
/**
* 按订单来源把钱退回原处:
* · 合作商单 -> 回补 partners.balance
* · 商城单 -> 回补下单用户余额并记一条余额流水
* 只在状态跃迁胜出后调用,天然只执行一次。
*
* @param array|\think\Model $order partners_order 记录
* @param float $amount 金额(元)
* @param string $scene 场景描述,写进流水
*/
public static function giveBack($order, float $amount, string $scene = '发放失败'): void
{
if ($amount <= 0) {
return;
}
if (!self::isMall($order)) {
PartnersBalance::refund(
(int) $order['partners_id'],
$amount,
(string) $order['partners_order_no'],
(int) $order['order_id'],
(int) $order['store_id']
);
self::log("{$scene}已回补合作商余额 order={$order['order_id']} amount={$amount}");
return;
}
$userId = (int) ($order['user_id'] ?? 0);
if ($userId <= 0) {
self::log("【告警】商城单缺少 user_id,无法退款 order={$order['order_id']} amount={$amount}");
return;
}
// 退回余额按「用户实付 / 油券面值」折算:用过优惠券或积分抵扣时,
// 面值大于实付,按面值原额退会白送钱。全额发放失败时折算结果正好等于实付。
$amount = self::toPaid($order, $amount);
if ($amount <= 0) {
return;
}
$money = self::money($amount);
try {
Db::transaction(function () use ($userId, $money, $amount, $order, $scene) {
Db::name('user')->where('user_id', $userId)
->update(['balance' => Db::raw('`balance` + ' . $money)]);
Db::name('user_balance_log')->insert([
'user_id' => $userId,
'scene' => SceneEnum::REFUND,
'money' => round($amount, 2),
'describe' => $scene . ':' . ($order['oilCardNo'] ?: $order['order_id']),
'remark' => '',
'store_id' => (int) $order['store_id'],
'create_time' => time(),
]);
});
self::log("{$scene}已退回用户余额 order={$order['order_id']} user={$userId} amount={$amount}");
} catch (\Throwable $e) {
// 退款失败必须人工介入:额度那边可能已经收回了
self::log("【告警】商城单退回用户余额失败 order={$order['order_id']} user={$userId}"
. " amount={$amount}:" . $e->getMessage());
}
}
/**
* 扣减额度(后台「重新发放」用)
* 发放失败时额度已原路退回,重发必须重新扣一次:
* · 合作商单 -> 扣 partners.balance
* · 商城单 -> 扣下单用户余额(按实付折算)
* 两者都是 UPDATE ... WHERE balance >= amount,天然防并发超扣。
*
* @return bool false=余额不足,未做任何变更
*/
public static function take($order, float $amount, string $scene = '重新发放'): bool
{
if ($amount <= 0) {
return true;
}
if (!self::isMall($order)) {
$logId = PartnersBalance::deduct(
(int) $order['partners_id'],
$amount,
(string) $order['partners_order_no'],
(int) $order['order_id'],
(int) $order['store_id']
);
return $logId !== false;
}
$userId = (int) ($order['user_id'] ?? 0);
if ($userId <= 0) {
return false;
}
$amount = self::toPaid($order, $amount);
if ($amount <= 0) {
return true;
}
$money = self::money($amount);
$affected = Db::name('user')->where('user_id', $userId)
->where('balance', '>=', $amount)
->update(['balance' => Db::raw('`balance` - ' . $money)]);
if (!$affected) {
return false;
}
try {
Db::name('user_balance_log')->insert([
'user_id' => $userId,
'scene' => SceneEnum::CONSUME,
'money' => -$amount,
'describe' => $scene . ':' . ($order['oilCardNo'] ?: $order['order_id']),
'remark' => '',
'store_id' => (int) $order['store_id'],
'create_time' => time(),
]);
} catch (\Throwable $e) {
self::log('商城单扣款流水写入失败 order=' . $order['order_id'] . ':' . $e->getMessage());
}
return true;
}
/** 额度不足时的提示文案 */
public static function notEnoughText($order): string
{
return self::isMall($order)
? '下单用户余额不足(发放失败时已退回其余额),无法重新发放'
: '合作商余额不足,请先充值后再重发';
}
// ================================================================
// 状态回写(代替合作商单的 HTTP 回调)
// ================================================================
/**
* 把发放单的状态同步回 yoshop_order_goods。
* 小程序端的订单列表/详情、后台订单页的基础列都读 order_goods,
* 所以商城单不走 HTTP 通知,改为在同样的时机回写这张表。
*
* @param array|\think\Model $order partners_order 记录
* @param string $optType share_oil / add_oil / refund
*/
public static function syncGoods($order, string $optType = ''): void
{
$goodsId = (int) ($order['mall_order_goods_id'] ?? 0);
if (!self::isMall($order) || $goodsId <= 0) {
return;
}
try {
// 锁内重读发放单:调用方可能持有的是跃迁前的旧快照
$fresh = Db::name('partners_order')->where('order_id', (int) $order['order_id'])->find();
if (!$fresh) {
return;
}
$data = [
'oil_status' => (int) $fresh['oil_status'],
'oil_status_zsy' => (int) $fresh['oil_status_zsy'],
'oil_time' => (int) $fresh['oil_time'],
'oil_text' => mb_substr((string) $fresh['oil_text'], 0, 190),
'shareNo' => (string) $fresh['shareNo'],
'use_status' => (int) $fresh['use_status'],
'use_time' => (int) $fresh['use_time'],
'use_text' => mb_substr((string) $fresh['use_text'], 0, 190),
// 一单可分多次加油:把累计值带到订单商品行,小程序端据此算剩余可加油金额
'used_amount' => (float) $fresh['used_amount'],
'used_num' => (int) $fresh['used_num'],
'refund_status' => (int) $fresh['refund_status'],
'refund_amount' => (float) $fresh['refund_amount'],
];
// 发放失败时额度已原路退回用户余额,把这句一起告诉用户,省掉一轮客服询问
if ((int) $fresh['oil_status_zsy'] === 3) {
$data['oil_text'] = mb_substr($fresh['oil_text'] . ',款项已退回账户余额', 0, 190);
}
// 已退款的单在小程序端不应再显示「可核销」
if ((int) $fresh['refund_status'] === 2) {
$data['oil_text'] = mb_substr('已退款:' . $fresh['refund_text'], 0, 190);
}
Db::name('order_goods')->where('order_goods_id', $goodsId)->update($data);
} catch (\Throwable $e) {
self::log('商城单回写 order_goods 失败 order=' . $order['order_id'] . ':' . $e->getMessage());
}
}
// ================================================================
// 内部
// ================================================================
/**
* 把「油券面值金额」折算成「用户实付金额」
* 面值 total_price 与实付 total_pay_price 在用过优惠券/积分时不相等。
*/
protected static function toPaid($order, float $amount): float
{
$face = (float) ($order['total_price'] ?? 0);
$paid = (float) ($order['total_pay_price'] ?? 0);
if ($face <= 0 || $paid >= $face) {
return round($amount, 2);
}
return round(min($amount * $paid / $face, $paid), 2);
}
/** 投递下发队列 */
protected static function push(int $orderId): void
{
(new QueueService())->push('partners_queue', json_encode(['order_id' => $orderId], 320));
}
protected static function fail(string $message): array
{
return ['ok' => false, 'message' => $message, 'order_id' => 0];
}
/** 金额安全格式化(仅数字与小数点,防拼接注入) */
protected static function money(float $amount): string
{
return number_format(round($amount, 2), 2, '.', '');
}
protected static function log(string $text): void
{
(new QytOil())->saveLog('[商城单] ' . $text);
}
}
@@ -35,8 +35,8 @@ class PartnersOil extends BaseService
public function saveLogStore($data){
$years = date('Ym');
$day = date('Ymd');
//设置路径目录信息
$dir = runtime_path('storelog/').$years.'/'.$day;
//设置路径目录信息(store_log_path 保证 CLI / api / store 各进程写同一处,见 app/common.php)
$dir = store_log_path().$years.'/'.$day;
//目录不存在就创建
$this->mk_dir_store($dir);
$url = $dir.'/'.date('YmdH').'.txt';
@@ -29,6 +29,31 @@ class QueueService
return $message ? json_decode($message, true) : null;
}
/**
* 阻塞式取出消息:队列空时挂在 Redis 上等,有消息立刻返回。
*
* 相比 pop() + sleep(1) 的轮询,取到消息的延迟从「最多 1 秒」降到接近 0,
* 对「下单 -> 调上游发放」这种链路首段能实打实省掉一截等待。
*
* @param string $queueName
* @param int $timeout 最长阻塞秒数(到点返回 null,便于外层做兜底巡检)
* @return array|string|null
*/
public function bpop($queueName, $timeout = 5)
{
// BLPOP 会把连接挂住 $timeout 秒,必须短于 Redis 连接的读超时
// (未显式配置时取 PHP default_socket_timeout,通常 60 秒),
// 否则会抛读超时异常而不是正常返回 null。这里夹到 30 秒以内。
$timeout = max(1, min(30, (int) $timeout));
// Predis 的 blpop 返回 [队列名, 消息],超时返回 null
$res = $this->redis->blpop([$queueName], $timeout);
if (empty($res[1])) {
return null;
}
$decoded = json_decode($res[1], true);
return $decoded === null ? $res[1] : $decoded;
}
/**
* 延迟推送(ZSET)
* @param string $queueName
+5 -2
View File
@@ -29,7 +29,7 @@ class QytConfig
/** 后台设置可覆盖的接入方级标量项 */
const OVERRIDABLE = [
'base_url', 'app_id', 'no_prefix', 'voucher_name',
'h5_base_url', 'h5_app_id', 'consume_notify_url',
'h5_base_url', 'h5_app_id', 'consume_notify_url', 'waybill_notify_url',
];
/** @var array|null */
@@ -55,10 +55,13 @@ class QytConfig
$conf[$k] = trim((string) $db[$k]);
}
}
// 日志开关是布尔,0 是合法值,不能用非空判断
// 布尔项 0 是合法值,不能用非空判断
if (isset($db['log'])) {
$conf['log'] = (bool) $db['log'];
}
if (isset($db['waybill_notify'])) {
$conf['waybill_notify'] = (bool) $db['waybill_notify'];
}
self::$cache = $conf;
self::$cacheAt = time();
+2 -2
View File
@@ -550,13 +550,13 @@ class QytOil extends BaseService
return bcdiv((string) (int) $fen, '100', 2);
}
/** 记录日志到 runtime/storelog */
/** 记录日志到 runtime/storelog(store_log_path 保证各进程写同一处,见 app/common.php) */
public function saveLog($data): void
{
if (empty($this->conf['log'])) {
return;
}
$dir = runtime_path('storelog/') . date('Ym') . '/' . date('Ymd');
$dir = store_log_path() . date('Ym') . '/' . date('Ymd');
is_dir($dir) || @mkdir($dir, 0777, true);
@file_put_contents(
$dir . '/qyt_' . date('YmdH') . '.txt',
+6 -4
View File
@@ -403,10 +403,11 @@ class QytRefund
'response' => self::dumpRes($res),
'update_time' => time(),
]);
// 只有状态跃迁胜出者才回补合作商余额,保证只退一次
// 只有状态跃迁胜出者才原路退款,保证只退一次
// · 合作商单 -> 回补 partners.balance
// · 商城单 -> 退回下单用户余额(按实付折算)
if ($won) {
PartnersBalance::refund((int) $order['partners_id'], $amount, (string) $order['partners_order_no'],
(int) $order['order_id'], (int) $order['store_id']);
MallOil::giveBack($order, $amount, '订单退款');
}
});
@@ -422,7 +423,8 @@ class QytRefund
'optType' => 'refund',
'retry_count' => 0,
], 320));
(new QytOil())->saveLog("退款成功 order={$order['order_id']} refund_no={$refundNo} amount={$amount},已回补合作商余额");
MallOil::syncGoods($order, 'refund');
(new QytOil())->saveLog("退款成功 order={$order['order_id']} refund_no={$refundNo} amount={$amount},已原路退款");
}
$order['refund_status'] = self::SUCCESS;
$order['refund_amount'] = $amount;
@@ -0,0 +1,207 @@
<?php
// +----------------------------------------------------------------------
// | 企油通 · 运单油费「发放结果」状态机
// +----------------------------------------------------------------------
// | 7.7 运单油费下发是【异步】接口,受理成功不等于发放成功。拿到最终结果有两条路:
// | · 推:3.10 发放结果通知(一个批次一条,整批处理完后企油通主动推给我们)
// | · 拉:7.8 waybillBatch 按 batch_no 查询(兜底,见下)
// |
// | 两条路得出的结论必须完全一致,所以判定与状态跃迁都收敛在本类,
// | QytNotify(推)与 QytStatusQueue(拉)只负责把数据喂进来。
// |
// | 为什么有了推送还要留着拉:
// | 1. 未在企油通后台配置接收地址 -> 根本不推(且不视为失败、不补推)
// | 2. 推送失败重试 5 次后放弃(文档建议此时用 7.8 查)
// | 3. 我们自己的接收端宕机 / 发版重启窗口期
// | 所以轮询保留为安全网,只是间隔放长(见 QytStatusQueue::intervalSql)
// |
// | 并发/幂等:
// | 状态跃迁是条件 UPDATE(... WHERE oil_status_zsy=1),affected=1 才退款/回调,
// | 因此「同一批次重复推送」「推送与轮询同时到达」都只会生效一次。
// +----------------------------------------------------------------------
declare (strict_types=1);
namespace app\common\service;
use think\facade\Db;
class QytWaybill
{
// 明细级 handle_status(7.8 出参 / 3.10 通知 data.list[].handle_status)
const HANDLE_PENDING = 1;
const HANDLE_SUCCESS = 2;
const HANDLE_FAILED = 3;
// 批次级 status(7.8 出参 data.status / 3.10 通知 data.status)
const BATCH_PENDING = 1; // 待处理
const BATCH_RUNNING = 2; // 处理中
const BATCH_ALL_OK = 3; // 全部成功
const BATCH_PART_OK = 4; // 部分成功
const BATCH_FAILED = 5; // 处理失败
// judge() 的结论
const R_SUCCESS = 'success';
const R_FAILED = 'failed';
const R_PENDING = 'pending';
/**
* 纯函数:根据批次级 status 与本条明细,判定这一单的最终发放结果。
*
* 文档 3.10 明确:**以批次级 status 为准**——批次因「企业信息不存在」之类
* 整体失败时,明细里可能仍然写着「待处理」。只看 handle_status 会让这种单
* 永远停在发放中,钱也永远不退。
*
* @param int $batchStatus 批次级 status
* @param array|null $row 本条明细 ['handle_status','error_msg','remark'],不存在传 null
* @return array ['result' => success|failed|pending, 'text' => string]
*/
public static function judge(int $batchStatus, ?array $row): array
{
$handle = $row ? (int) ($row['handle_status'] ?? 0) : 0;
// 1) 整批处理失败:不管明细写的是什么,这一单都拿不到钱
if ($batchStatus === self::BATCH_FAILED && $handle !== self::HANDLE_SUCCESS) {
$msg = $row ? trim((string) ($row['error_msg'] ?? '')) : '';
return ['result' => self::R_FAILED, 'text' => $msg !== '' ? $msg : '企油通返回整批处理失败'];
}
// 2) 明细里没有这一条:批次还在排队,继续等
if (!$row) {
return ['result' => self::R_PENDING, 'text' => ''];
}
if ($handle === self::HANDLE_SUCCESS) {
return ['result' => self::R_SUCCESS, 'text' => trim((string) ($row['remark'] ?? '')) ?: '发放成功'];
}
if ($handle === self::HANDLE_FAILED) {
return ['result' => self::R_FAILED, 'text' => trim((string) ($row['error_msg'] ?? '')) ?: '企油通发放失败'];
}
// 1 待处理,或未知值 -> 继续等
return ['result' => self::R_PENDING, 'text' => ''];
}
/**
* 从 3.10 通知或 7.8 响应的 data.list 里挑出某条运单流水
* @return array|null ['handle_status','error_msg','remark']
*/
public static function pick(array $data, string $waybillNoCode): ?array
{
return QytOil::pickWaybill($data, $waybillNoCode);
}
/**
* 发放成功:条件跃迁 1 -> 2,胜出者才回调下游 / 同步小程序端
*
* @param array $order partners_order 记录
* @param string $text 备注(上游 remark)
* @param string $from 结果来源,只用于日志:'3.10 通知' / '7.8 轮询'
* @return bool 是否由本次调用完成跃迁
*/
public static function markSuccess(array $order, string $text, string $from = ''): bool
{
$affected = Db::name('partners_order')
->where('order_id', $order['order_id'])
->where('oil_status_zsy', 1)
->update([
'oil_status' => 1,
'oil_status_zsy' => 2,
'oil_time' => time(),
'oil_text' => mb_substr($text, 0, 190),
'update_time' => time(),
]);
if (!$affected) {
return false;
}
MallOil::syncGoods($order, 'share_oil');
(new QueueService())->push('notify_queue', json_encode([
'order_id' => $order['order_id'],
'type' => 'add',
'optType' => 'share_oil',
'retry_count' => 0,
], 320));
self::log("{$from} 确认发放成功 order={$order['order_id']} batch_no={$order['batch_no']}");
return true;
}
/**
* 发放失败:条件跃迁 1 -> 3,胜出者才退款(保证只退一次)
*
* @return bool 是否由本次调用完成跃迁
*/
public static function markFailed(array $order, string $reason, string $from = ''): bool
{
$affected = Db::name('partners_order')
->where('order_id', $order['order_id'])
->where('oil_status_zsy', 1)
->update([
'oil_status_zsy' => 3,
'oil_text' => mb_substr('发放失败:' . $reason, 0, 190),
'update_time' => time(),
]);
if (!$affected) {
return false;
}
// 原路退款:合作商单回补合作商余额,商城单退回下单用户余额
MallOil::giveBack($order, (float) $order['total_price'], '发放失败');
MallOil::syncGoods($order, 'share_oil');
self::log("{$from} 确认发放失败 order={$order['order_id']} 原因={$reason},已原路退款 {$order['total_price']}");
return true;
}
/**
* 按判定结果落状态。已经不在「发放中」的单会被安全忽略,
* 但「已判失败又被告知成功」属于资损风险,必须告警而不是静默翻转。
*
* @return string 实际发生的动作:success / failed / pending / skipped / conflict
*/
public static function apply(array $order, array $judged, string $from = ''): string
{
$current = (int) $order['oil_status_zsy'];
if ($judged['result'] === self::R_PENDING) {
return self::R_PENDING;
}
if ($current !== 1) {
// 终态与上游结论不一致 -> 一律只告警、不自动翻转:
// 3 -> 成功:我们已经退过款,钱却可能真发出去了(资损)
// 2 -> 失败:我们已经通知下游发放成功、小程序端也显示可加油了
// 两种都要人工到企油通后台核对,自动改状态只会把问题放大。
$conflict = ($current === 3 && $judged['result'] === self::R_SUCCESS)
|| ($current === 2 && $judged['result'] === self::R_FAILED);
if ($conflict) {
self::log("【告警】order={$order['order_id']} batch_no={$order['batch_no']} 本地发放态为「"
. ($current === 3 ? '发放失败(已退款)' : '发放成功(已通知下游)')
. "」,但{$from}返回「" . ($judged['result'] === self::R_SUCCESS ? '发放成功' : '发放失败')
. "」:{$judged['text']}。请人工到企油通后台核对,系统不会自动翻转状态。");
return 'conflict';
}
return 'skipped';
}
if ($judged['result'] === self::R_SUCCESS) {
return self::markSuccess($order, $judged['text'], $from) ? self::R_SUCCESS : 'skipped';
}
return self::markFailed($order, $judged['text'], $from) ? self::R_FAILED : 'skipped';
}
/**
* 记录本次通知时间与次数,便于排查「这单到底推没推过、推了几次」。
* 纯留痕,失败不能影响发放态跃迁(比如迁移脚本还没跑、少了这两列)。
*/
public static function touchNotify(int $orderId, int $notifyTime): void
{
try {
Db::name('partners_order')->where('order_id', $orderId)->update([
'qyt_notify_time' => $notifyTime ?: time(),
'qyt_notify_num' => Db::raw('qyt_notify_num + 1'),
]);
} catch (\Throwable $e) {
self::log('3.10 通知留痕失败 order=' . $orderId . ':' . $e->getMessage()
. '(不影响发放态,确认 qyt_migration_waybill_notify.sql 是否已执行)');
}
}
protected static function log(string $text): void
{
(new QytOil())->saveLog($text);
}
}
+2 -2
View File
@@ -35,8 +35,8 @@ class SybOil extends BaseService
public function saveLogStore($data){
$years = date('Ym');
$day = date('Ymd');
//设置路径目录信息
$dir = runtime_path('storelog/').$years.'/'.$day;
//设置路径目录信息(store_log_path 保证 CLI / api / store 各进程写同一处,见 app/common.php)
$dir = store_log_path().$years.'/'.$day;
//目录不存在就创建
$this->mk_dir_store($dir);
$url = $dir.'/'.date('YmdH').'.txt';
@@ -8,6 +8,8 @@ use think\console\Input;
use think\console\Output;
use app\store\model\order\Record as RecordModel;
use app\common\service\SybOil;
use app\common\service\QytWaybill;
use app\common\lock\RedisLock;
use think\facade\Db;
class CallbackQueue extends Command
@@ -427,6 +429,58 @@ class CallbackQueue extends Command
$SybOil->saveLogStore('企油通消费回调处理成功:' . json_encode($c, 320));
}
break;
case "qyt_waybill_result":
// 企油通 3.10「发放结果通知」:一个批次一条,整批明细都在 res.list 里。
// 判定与状态跃迁跟 7.8 轮询共用 QytWaybill,保证两条路结论一致、互相幂等。
$batchNo = (string)($res['batch_no'] ?? '');
$batchStatus = (int)($res['status'] ?? 0);
$notifyTime = !empty($res['notify_time']) ? (strtotime((string)$res['notify_time']) ?: time()) : time();
$list = (array)($res['list'] ?? []);
$stat = ['success' => 0, 'failed' => 0, 'pending' => 0, 'skipped' => 0, 'conflict' => 0, 'miss' => 0];
foreach ($list as $row) {
$code = trim((string)($row['waybill_no_code'] ?? ''));
if ($code === '') {
$stat['miss']++;
continue;
}
$order = Db::name('partners_order')->where('waybill_no_code', $code)->find();
if (!$order) {
// 同一个 appId 下可能还挂着别的接入系统提交的批次,匹配不到不算异常
$stat['miss']++;
continue;
}
// 留痕:这一单到底收没收到过推送、收了几次
QytWaybill::touchNotify((int)$order['order_id'], $notifyTime);
// 每单串行,避免与 qyt:status 轮询同时跃迁
$lock = new RedisLock('qyt:status:' . $order['order_id'], 60);
if (!$lock->acquireLock()) {
// 轮询正在处理这一单,跳过即可:两条路的结论一样
$stat['skipped']++;
continue;
}
try {
// 锁内重读,拿到最新状态
$fresh = Db::name('partners_order')->where('order_id', $order['order_id'])->find();
$judged = QytWaybill::judge($batchStatus, [
'handle_status' => (int)($row['handle_status'] ?? 0),
'error_msg' => (string)($row['error_msg'] ?? ''),
'remark' => (string)($row['remark'] ?? ''),
]);
$stat[QytWaybill::apply($fresh ?: $order, $judged, '3.10 通知')]++;
} finally {
$lock->releaseLock();
}
}
$SybOil->saveLogStore('3.10 发放结果通知处理完成 batch_no=' . $batchNo
. ' 批次状态=' . $batchStatus . ' 明细=' . count($list)
. ' 成功=' . $stat['success'] . ' 失败=' . $stat['failed']
. ' 待处理=' . $stat['pending'] . ' 已是终态=' . $stat['skipped']
. ' 未匹配=' . $stat['miss']
. ($stat['conflict'] ? ' 【冲突=' . $stat['conflict'] . ',需人工核对】' : ''));
break;
default:
$SybOil->saveLogStore('队列数据处理异常,未知:【'.$message.'】');
}
@@ -1,6 +1,7 @@
<?php
namespace app\console\command;
use app\common\service\MallOil;
use app\common\service\PartnersOil;
use app\common\service\QueueService;
use think\console\Command;
@@ -82,6 +83,17 @@ class NotifyQueue extends Command
if(!$order){
return false;
}
// 小程序(商城)单没有下游下单平台可回调:把状态回写到 yoshop_order_goods,
// 小程序端的订单列表/详情、后台订单页的基础列都读那张表。直接算成功,不重试。
if (MallOil::isMall($order)) {
MallOil::syncGoods($order, (string)($data['optType'] ?? ''));
// 逐笔标记已处理,否则后台「重推加油结果」会一直认为这些流水没通知过
if (!empty($data['consume_id'])) {
Db::name('qyt_consume')->where('id', (int)$data['consume_id'])
->update(['notify_status' => 1, 'notify_time' => time()]);
}
return true;
}
$partners = partnersModel::detail($order['partners_id']);
if(!$partners){
return false;
@@ -22,7 +22,7 @@ namespace app\console\command;
use app\common\lock\RedisLock;
use app\common\model\partners\Order as OrderModel;
use app\common\model\qyt\Enterprise as EnterpriseModel;
use app\common\service\PartnersBalance;
use app\common\service\MallOil;
use app\common\service\QueueService;
use app\common\service\QytOil;
use think\console\Command;
@@ -48,12 +48,13 @@ class PartnersQueue extends Command
{
$this->queueService = new QueueService();
while (true) {
$message = $this->queueService->pop('partners_queue');
// 阻塞式取队列:有单立刻开始下发,不用等轮询间隔。
// 5 秒超时只是为了让空闲时也能跑到下面的兜底巡检(内部已限频 60s)。
$message = $this->queueService->bpop('partners_queue', 5);
if ($message) {
$this->processMessage($message);
} else {
$this->reconcile();
sleep(1);
}
}
}
@@ -198,18 +199,14 @@ class PartnersQueue extends Command
}
/**
* 发放失败 -> 回补合作商余额(仅在状态跃迁胜出时调用,天然幂等)
* 发放失败 -> 原路退款(仅在状态跃迁胜出时调用,天然幂等)
* · 合作商单 -> 回补 partners.balance
* · 商城单 -> 退回下单用户余额(按实付折算),并把失败状态回写 order_goods
*/
protected function refundBalance($order)
{
PartnersBalance::refund(
(int) $order['partners_id'],
(float) $order['total_price'],
(string) $order['partners_order_no'],
(int) $order['order_id'],
(int) $order['store_id']
);
(new QytOil())->saveLog("发放失败已回补合作商余额 order={$order['order_id']} amount={$order['total_price']}");
MallOil::giveBack($order, (float) $order['total_price'], '发放失败');
MallOil::syncGoods($order);
}
/**
@@ -2,8 +2,15 @@
// +----------------------------------------------------------------------
// | 企油通「运单发放结果」轮询 (7.8 waybillBatch)
// +----------------------------------------------------------------------
// | 为什么需要它:7.7 运单油费下发是【异步】接口,返回成功只代表受理,
// | 真实发放结果必须按 batch_no 调 7.8 查(《企油通接口对接文档.md》§5 第 7 条)。
// | 为什么需要它:7.7 运单油费下发是【异步】接口,返回成功只代表受理。
// |
// | 拿最终结果有两条路,判定逻辑共用 app\common\service\QytWaybill:
// | · 推:3.10 发放结果通知 -> public/qytwaybill.php -> callback:queue(主路径)
// | · 拉:本命令按 batch_no 调 7.8 查询(安全网)
// |
// | 接上推送后本命令不会下线:上游未配置接收地址不推送、推送重试 5 次后放弃、
// | 我方接收端宕机或发版重启,这三种情况都只能靠轮询兜底。此时退避间隔会自动放长,
// | 见 intervalSql()。
// |
// | 状态流转(oil_status_zsy):
// | 0 未提交 --PartnersQueue 调7.7受理--> 1 发放中 --本命令查7.8--> 2 成功 / 3 失败
@@ -27,9 +34,9 @@ namespace app\console\command;
use app\common\lock\RedisLock;
use app\common\model\qyt\Enterprise as EnterpriseModel;
use app\common\service\PartnersBalance;
use app\common\service\QueueService;
use app\common\service\QytConfig;
use app\common\service\QytOil;
use app\common\service\QytWaybill;
use think\console\Command;
use think\console\Input;
use think\console\Output;
@@ -40,15 +47,12 @@ class QytStatusQueue extends Command
/** 每轮扫描的最大订单数 */
const BATCH_LIMIT = 100;
/** 空转时的休眠秒数 */
const IDLE_SLEEP = 5;
/** 空转时的休眠秒数(只是一条轻量 SQL,不打上游,可以压到 1 秒) */
const IDLE_SLEEP = 1;
/** 查询次数达到该值后仍未定论,视为异常滞留,写告警日志 */
const STUCK_NUM = 100;
/** @var QueueService */
protected $queueService;
protected function configure()
{
$this->setName('qyt:status')
@@ -57,7 +61,7 @@ class QytStatusQueue extends Command
protected function execute(Input $input, Output $output)
{
$this->queueService = new QueueService();
// 通知下游 / 同步小程序端都在 QytWaybill 里做,这里只负责查结果
while (true) {
$handled = 0;
try {
@@ -94,11 +98,38 @@ class QytStatusQueue extends Command
/**
* 退避间隔(秒)的 SQL 表达式:查得越久间隔越长,避免高频打上游
* 前 10 次 30s,10~30 次 120s,之后 600s
*
* 为什么前几次要这么密:7.7 受理后第一次 7.8 几乎必然返回「待处理」,
* 如果第二次要等 30 秒,哪怕企油通第 8 秒就发完了,用户也得等到第 35 秒。
* 绝大多数单在前 20 秒内就有结果,所以把这一段压到 3 秒一次,
* 代价是每单多打上游几次;拖久的单自动退到长间隔,总 QPS 不会失控。
*
* 注意:若已接入 3.10 发放结果通知(后台「企油通对接设置」里打开开关),
* 走的是上面那条「安全网」曲线,不是下面这条抢时间的曲线。
*
* 次数 <6 -> 3s (覆盖 0~18s,正常单在这里出结果)
* 次数 <16 -> 10s (覆盖至约 2 分钟)
* 次数 <26 -> 30s (覆盖至约 7 分钟)
* 次数 <46 -> 120s (覆盖至约 47 分钟)
* 之后 -> 600s
*/
protected function intervalSql(): string
{
return 'CASE WHEN qyt_query_num < 10 THEN 30 WHEN qyt_query_num < 30 THEN 120 ELSE 600 END';
// 接上 3.10 发放结果通知后,结果以推送为主,轮询退为安全网:
// 只覆盖「上游没配接收地址 / 推送重试 5 次仍失败 / 我方接收端当时不可用」
// 这三种情况,没必要再抢在推送前面把上游打一遍。
if (!empty(QytConfig::get()['waybill_notify'])) {
return 'CASE'
. ' WHEN qyt_query_num < 3 THEN 60'
. ' WHEN qyt_query_num < 8 THEN 300'
. ' ELSE 900 END';
}
return 'CASE'
. ' WHEN qyt_query_num < 6 THEN 3'
. ' WHEN qyt_query_num < 16 THEN 10'
. ' WHEN qyt_query_num < 26 THEN 30'
. ' WHEN qyt_query_num < 46 THEN 120'
. ' ELSE 600 END';
}
/**
@@ -143,31 +174,16 @@ class QytStatusQueue extends Command
return;
}
// 判定与状态跃迁跟 3.10 推送共用 QytWaybill,两条路结论必须一致
$batchStatus = (int) ($res['data']['status'] ?? 0);
$row = QytOil::pickWaybill($res['data'], (string) $order['waybill_no_code']);
$row = QytWaybill::pick($res['data'], (string) $order['waybill_no_code']);
$judged = QytWaybill::judge($batchStatus, $row);
// 整批处理失败,且明细里没有本条 -> 判失败
if (!$row && $batchStatus === 5) {
$this->markFailed($order, '企油通返回整批处理失败', $qyt);
return;
}
// 明细里还没有本条:批次还在排队,继续等
if (!$row) {
if ($judged['result'] === QytWaybill::R_PENDING) {
$this->alertIfStuck($order, $qyt);
return;
}
switch ($row['handle_status']) {
case 2: // 成功
$this->markSuccess($order, $row['remark'] ?: '发放成功', $qyt);
break;
case 3: // 失败
$this->markFailed($order, $row['error_msg'] ?: '企油通发放失败', $qyt);
break;
default: // 1 待处理,或未知值 -> 继续等
$this->alertIfStuck($order, $qyt);
break;
}
QytWaybill::apply($order, $judged, '7.8 轮询');
} catch (\Throwable $e) {
$this->log("order={$orderId} 轮询异常:" . $e->getMessage() . ' @ ' . $e->getFile() . ':' . $e->getLine());
} finally {
@@ -175,60 +191,6 @@ class QytStatusQueue extends Command
}
}
/**
* 发放成功:条件跃迁 1 -> 2,胜出者才回调下单平台
*/
protected function markSuccess(array $order, string $text, QytOil $qyt): void
{
$affected = Db::name('partners_order')
->where('order_id', $order['order_id'])
->where('oil_status_zsy', 1)
->update([
'oil_status' => 1,
'oil_status_zsy' => 2,
'oil_time' => time(),
'oil_text' => $text,
'update_time' => time(),
]);
if (!$affected) {
return;
}
$this->queueService->push('notify_queue', json_encode([
'order_id' => $order['order_id'],
'type' => 'add',
'optType' => 'share_oil',
'retry_count' => 0,
], 320));
$qyt->saveLog("7.8 确认发放成功 order={$order['order_id']} batch_no={$order['batch_no']}"
. " 查询次数={$order['qyt_query_num']}");
}
/**
* 发放失败:条件跃迁 1 -> 3,胜出者才退款(保证只退一次)
*/
protected function markFailed(array $order, string $reason, QytOil $qyt): void
{
$affected = Db::name('partners_order')
->where('order_id', $order['order_id'])
->where('oil_status_zsy', 1)
->update([
'oil_status_zsy' => 3,
'oil_text' => '发放失败:' . $reason,
'update_time' => time(),
]);
if (!$affected) {
return;
}
PartnersBalance::refund(
(int) $order['partners_id'],
(float) $order['total_price'],
(string) $order['partners_order_no'],
(int) $order['order_id'],
(int) $order['store_id']
);
$qyt->saveLog("7.8 确认发放失败 order={$order['order_id']} 原因={$reason},已回补合作商余额 {$order['total_price']}");
}
/**
* 长期拿不到结果时告警。只写日志,不改状态、不退款
*/
+12 -6
View File
@@ -153,8 +153,10 @@ class Order extends Controller
*/
public function cancelShare(): Json
{
// 企油通改造:本功能依赖已下线的上游(智慧油客/定聚),现已停用。
return $this->renderError('小程序油品链路已停用');
// 企油通改造:小程序订单的发放/加油/退款统一走 yoshop_partners_order,
// 后台操作接口复用 app/store/controller/partners/Order.php(/partners.order/*),
// 前端订单页传的是商品行上挂的 qyt.order_id。本接口保留仅为兼容老前端。
return $this->renderError('该入口已迁移,请使用 /partners.order/ 下的同名接口');
}
/**
@@ -164,8 +166,10 @@ class Order extends Controller
*/
public function qrCode(): Json
{
// 企油通改造:本功能依赖已下线的上游(智慧油客/定聚),现已停用。
return $this->renderError('小程序油品链路已停用');
// 企油通改造:小程序订单的发放/加油/退款统一走 yoshop_partners_order,
// 后台操作接口复用 app/store/controller/partners/Order.php(/partners.order/*),
// 前端订单页传的是商品行上挂的 qyt.order_id。本接口保留仅为兼容老前端。
return $this->renderError('该入口已迁移,请使用 /partners.order/ 下的同名接口');
}
/**
@@ -250,7 +254,9 @@ class Order extends Controller
*/
public function share(): Json
{
// 企油通改造:本功能依赖已下线的上游(智慧油客/定聚),现已停用。
return $this->renderError('小程序油品链路已停用');
// 企油通改造:小程序订单的发放/加油/退款统一走 yoshop_partners_order,
// 后台操作接口复用 app/store/controller/partners/Order.php(/partners.order/*),
// 前端订单页传的是商品行上挂的 qyt.order_id。本接口保留仅为兼容老前端。
return $this->renderError('该入口已迁移,请使用 /partners.order/ 下的同名接口');
}
}
@@ -13,7 +13,7 @@ declare (strict_types=1);
namespace app\store\controller\partners;
use app\common\service\PartnersBalance;
use app\common\service\MallOil;
use app\common\service\QueueService;
use app\common\model\qyt\Enterprise as EnterpriseModel;
use app\common\service\QytInvoice;
@@ -119,16 +119,10 @@ class Order extends Controller
if ($order['use_status'] != 0) {
return $this->renderError('该单已加油核销,不可重发');
}
// 发放失败时余额已回补,重发需重新扣减合作商余额
$logId = PartnersBalance::deduct(
(int) $order['partners_id'],
(float) $order['total_price'],
(string) $order['partners_order_no'],
$orderId,
(int) $order['store_id']
);
if ($logId === false) {
return $this->renderError('合作商余额不足,请先充值后再重发');
// 发放失败时额度已原路退回,重发需重新扣减:
// 合作商单扣合作商余额,小程序单扣下单用户余额
if (!MallOil::take($order, (float) $order['total_price'])) {
return $this->renderError(MallOil::notEnoughText($order));
}
// 仅允许从「发放失败(3)」重置为「未提交(0)」,避免与「发放中(1)」的单冲突。
// 同时清空编号并把重发次数 +1:企油通按 batch_no 幂等,沿用老批次的话
@@ -148,17 +142,13 @@ class Order extends Controller
'update_time' => time(),
]);
if (!$reset) {
// 状态已被其它进程改变 -> 回补刚扣的余额
PartnersBalance::refund(
(int) $order['partners_id'],
(float) $order['total_price'],
(string) $order['partners_order_no'],
$orderId,
(int) $order['store_id']
);
// 状态已被其它进程改变 -> 回补刚扣的额度
MallOil::giveBack($order, (float) $order['total_price'], '重发撤销');
return $this->renderError('当前状态不允许重发(仅「发放失败」的订单可重发)');
}
(new QueueService())->push('partners_queue', json_encode(['order_id' => $orderId], 320));
// 小程序单把「重新发放」状态同步回订单商品行,用户端立刻能看到
MallOil::syncGoods($order);
return $this->renderSuccess('已提交重新发放,请稍后刷新查看结果');
}
+70
View File
@@ -21,6 +21,7 @@ use think\facade\Request;
use app\common\model\Goods as GoodsModel;
use app\common\model\Order as OrderModel;
use app\common\service\Order as OrderService;
use app\common\service\QytOil;
use app\common\service\Message as MessageService;
use app\common\service\order\Refund as RefundService;
use app\common\enum\order\OrderStatus as OrderStatusEnum;
@@ -121,6 +122,8 @@ class Order extends OrderModel
})
->order(['order.create_time' => 'desc'])
->paginate(10);
// 给每个油券商品行挂上对应的企油通发放单(后台订单页的企油通列与操作按钮用)
$this->setQytData($list);
// 获取数据列表
return [
'list' => $list,
@@ -128,6 +131,55 @@ class Order extends OrderModel
];
}
/**
* 给订单商品行挂上企油通发放单数据(字段名 qyt)
*
* 小程序订单在支付成功后由 MallOil::create 为每个油券商品行建了一条
* yoshop_partners_order(source='mall',mall_order_goods_id 指回商品行),
* 企油通的发放/加油/退款/发票全挂在那张表上。后台订单页要展示这些信息、
* 并复用 /partners.order/* 的操作接口,所以这里按商品行把发放单带出来。
*
* @param \think\Paginator|\think\Collection $list
*/
public function setQytData($list): void
{
$goodsIds = [];
foreach ($list as $order) {
foreach ($order['goods'] as $goods) {
$goodsIds[] = (int)$goods['order_goods_id'];
}
}
if (!$goodsIds) {
return;
}
$rows = Db::name('partners_order')
->where('source', '=', 'mall')
->whereIn('mall_order_goods_id', $goodsIds)
->select()->toArray();
$map = [];
foreach ($rows as $row) {
// 身份证号脱敏(后台展示层)
$row['id_card_mask'] = QytOil::maskIdCard((string)$row['id_card']);
unset($row['id_card']);
// 前端用的是严格相等(item.oil_status_zsy !== 2),这里显式转型,
// 不依赖 PDO 是否把 int 列取成字符串
foreach (['order_id', 'oil_status', 'oil_status_zsy', 'use_status', 'refund_status',
'used_num', 'oil_callback', 'use_callback', 'qyt_enterprise_id',
'mall_order_id', 'mall_order_goods_id', 'user_id'] as $k) {
$row[$k] = (int)$row[$k];
}
// 剩余可退金额 = 发放金额 - 已加油 - 已退款
$row['remain_amount'] = number_format(max(0, (float)$row['total_price']
- (float)$row['used_amount'] - (float)$row['refund_amount']), 2, '.', '');
$map[(int)$row['mall_order_goods_id']] = $row;
}
foreach ($list as $order) {
foreach ($order['goods'] as $goods) {
$goods['qyt'] = $map[(int)$goods['order_goods_id']] ?? null;
}
}
}
/**
* 订单列表(全部)
@@ -173,6 +225,8 @@ class Order extends OrderModel
'pay_status' => -1, // 支付状态
'oil_status' => -1, // 分油状态
'use_status' => -1, // 使用状态
'oil_status_zsy' => -1, // 企油通发放态 0未提交 1发放中 2成功 3失败
'refund_status' => -1, // 退款状态 0未退款 1退款中 2已退款 3退款失败 4待人工确认
'deliveryType' => -1, // 配送方式
'betweenTime' => [], // 起止时间
'userId' => 0, // 会员ID
@@ -233,6 +287,22 @@ class Order extends OrderModel
->column('order_id'); // 获取所有符合条件的 order_id 数组
$filter[] = ['order.order_id', 'in', $subQuery];
}
// 企油通发放态(挂在 partners_order 上,按 mall_order_id 反查)
if($params['oil_status_zsy'] > -1){
$subQuery = Db::name('partners_order')
->where('source', '=', 'mall')
->where('oil_status_zsy', '=', (int)$params['oil_status_zsy'])
->column('mall_order_id');
$filter[] = ['order.order_id', 'in', $subQuery];
}
// 退款状态(同上)
if($params['refund_status'] > -1){
$subQuery = Db::name('partners_order')
->where('source', '=', 'mall')
->where('refund_status', '=', (int)$params['refund_status'])
->column('mall_order_id');
$filter[] = ['order.order_id', 'in', $subQuery];
}
// 配送方式
$params['deliveryType'] > -1 && $filter[] = ['delivery_type', '=', (int)$params['deliveryType']];
// 用户id
@@ -81,10 +81,13 @@ class Order extends OrderModel
'use_status' => -1, // 加油核销状态
'refund_status' => -1, // 退款状态 0未退款 1退款中 2已退款 3退款失败 4待人工确认
'id_card' => '', // 司机身份证号(从司机管理跳转过来时使用)
'source' => 'partner', // 订单来源 partner=下单平台 mall=小程序商城 all=全部
'betweenTime' => [] // 起止时间
]);
// 检索查询条件
$filter = [];
// 来源:本页只管下单平台的单,小程序单在「订单管理」里看,默认过滤掉
$params['source'] !== 'all' && $filter[] = ['order.source', '=', (string)$params['source']];
// 合作商ID
$params['partners_id'] > 0 && $filter[] = ['order.partners_id', '=', $params['partners_id']];
// 司机手机号
@@ -150,8 +153,9 @@ class Order extends OrderModel
if(!empty($partners)) {
$filter[] = ['partners_id', '=', $partners['partners_id']];
}
// 总销售额
// 总销售额(只统计下单平台的单,小程序单不计入合作商口径)
return $query->where('oil_status_zsy', '=', 2)
->where('source', '=', 'partner')
->where($filter)
->sum('total_price');
}
+9
View File
@@ -56,6 +56,15 @@ return [
// 形如 https://你的域名/qytconsume.php
'consume_notify_url' => env('qyt.consume_notify_url', ''),
// ★ 我方对外回调地址(配置到企油通后台,用于 3.10 发放结果通知,scene=oil)
// 形如 https://你的域名/qytwaybill.php
'waybill_notify_url' => env('qyt.waybill_notify_url', ''),
// 3.10 发放结果通知是否已在企油通后台配好并生效。
// 打开后 7.8 轮询自动退为「安全网」,间隔放长(见 QytStatusQueue::intervalSql);
// 关闭时按抢时间的密集曲线轮询。⚠️ 对方还没配地址就打开,会让分油变慢。
'waybill_notify' => (bool) env('qyt.waybill_notify', false),
// 7.15 H5 免登落地页地址(测试 / 正式不同)
// 测试:http://dev.paytaskpage.worknoya.vip/#/ 正式:https://paytaskpage.worknoya.vip/#/
'h5_base_url' => env('qyt.h5_base_url', 'https://paytaskpage.worknoya.vip/#/'),
+5
View File
@@ -29,5 +29,10 @@ H5_BASE_URL = https://paytaskpage.worknoya.vip/#/
H5_APP_ID =
; 我方 7.10 回调地址(此项仅作记录,实际需在企油通后台配置)
CONSUME_NOTIFY_URL = https://www.hmzkw.com/qytconsume.php
; 我方 3.10 发放结果通知地址(同上,需在企油通后台按 scene=oil 配置)
WAYBILL_NOTIFY_URL = https://www.hmzkw.com/qytwaybill.php
; 3.10 发放结果通知是否已生效:true -> 7.8 轮询退为安全网,间隔放长
; ⚠️ 对方还没配好接收地址就设 true,分油结果要等轮询才拿得到,反而变慢
WAYBILL_NOTIFY = false
; 是否记录详细请求/响应日志到 runtime/storelog
LOG = true
+333
View File
@@ -0,0 +1,333 @@
<?php
// +----------------------------------------------------------------------
// | 模拟企油通 3.10「发放结果通知」 —— 联调 / 补推用(CLI)
// +----------------------------------------------------------------------
// | 按企油通的真实口径推送:multipart/form-data,业务参数放在表单字段 data 里,
// | 另带一个 sign 字段(我方暂未验签,填什么都行)。
// |
// | 用法(在站点根目录执行):
// | php deploy/qyt_waybill_push.php --fake # 【通链路自检】不需要任何订单
// | php deploy/qyt_waybill_push.php --order=6 # 该单发放成功
// | php deploy/qyt_waybill_push.php --order=6 --result=failed # 该单发放失败(会触发原路退款)
// | php deploy/qyt_waybill_push.php --order=6 --batch-status=5 # 整批处理失败(明细仍写待处理)
// | php deploy/qyt_waybill_push.php --batch=HMB2026... # 按批次号推,批次内所有单一起推
// | php deploy/qyt_waybill_push.php --order=6 --dry-run # 只打印报文不发送
// |
// | 常用参数:
// | --fake 自检模式:造一条不存在的运单推过去,只验「入口 -> 解析 ->
// | 队列 -> 消费者」这条链路通不通,不碰数据库、不改任何订单。
// | 预期结果是「未匹配=1」—— 那正是自检通过的标志。
// | --order=订单ID 单推一条(推荐)
// | --batch=批次号 按 batch_no 把该批次的单全推一遍
// | --result=success|failed|pending 明细级 handle_status,默认 success
// | --batch-status=3|4|5 批次级 status,默认按 result 推导(成功=3 失败=5)
// | --msg=文案 成功时写 remark,失败时写 error_msg
// | --url=通知地址 默认取 .env 的 QYT.WAYBILL_NOTIFY_URL
// | --dry-run 只打印,不实际发送
// |
// | ⚠️ 这会真实推进订单发放态:判成功会通知下游 / 同步小程序端,判失败会原路退款。
// | 只用于联调环境。联调结束请删除本文件。
// +----------------------------------------------------------------------
declare (strict_types=1);
if (PHP_SAPI !== 'cli') {
http_response_code(403);
exit('仅限命令行执行');
}
$root = dirname(__DIR__);
// ---------------- 参数解析 ----------------
$opt = [];
foreach (array_slice($argv, 1) as $arg) {
if (preg_match('/^--([a-zA-Z0-9\-_]+)(?:=(.*))?$/', $arg, $m)) {
$opt[str_replace('-', '_', $m[1])] = $m[2] ?? '1';
}
}
$fake = !empty($opt['fake']);
$orderId = isset($opt['order']) ? (int) $opt['order'] : 0;
$batchNo = isset($opt['batch']) ? trim((string) $opt['batch']) : '';
$dryRun = !empty($opt['dry_run']);
$result = isset($opt['result']) ? strtolower(trim((string) $opt['result'])) : 'success';
$msg = isset($opt['msg']) ? (string) $opt['msg'] : '';
if (!$fake && $orderId <= 0 && $batchNo === '') {
exit("用法:php deploy/qyt_waybill_push.php --fake # 不需要订单,自检链路\n"
. " php deploy/qyt_waybill_push.php --order=<订单ID> [--result=success|failed]\n"
. " php deploy/qyt_waybill_push.php --batch=<批次号>\n"
. "详细参数见本文件头部注释。\n");
}
if (!in_array($result, ['success', 'failed', 'pending'], true)) {
exit("--result 只能是 success / failed / pending\n");
}
// 明细级 handle_status:1 待处理 / 2 成功 / 3 失败
$handleStatus = ['success' => 2, 'failed' => 3, 'pending' => 1][$result];
// 批次级 status:3 全部成功 / 4 部分成功 / 5 处理失败
$batchStatus = isset($opt['batch_status'])
? (int) $opt['batch_status']
: ($result === 'success' ? 3 : ($result === 'failed' ? 5 : 2));
// ---------------- 读取 .env ----------------
$ini = @parse_ini_file($root . '/.env', true, INI_SCANNER_RAW) ?: [];
$db = $ini['DATABASE'] ?? [];
$qyt = $ini['QYT'] ?? [];
$url = isset($opt['url']) ? (string) $opt['url'] : trim((string) ($qyt['WAYBILL_NOTIFY_URL'] ?? ''));
if ($url === '') {
$url = 'http://127.0.0.1/qytwaybill.php';
}
// ---------------- 取订单(自检模式跳过) ----------------
$pdo = null;
$orders = [];
if ($fake) {
// 造一条绝不会命中任何订单的运单流水号:
// 服务端应当「收下 -> 入队 -> 消费者判为未匹配」,整条链路都走到,但不动任何数据
$batchNo === '' && $batchNo = 'SELFCHECK' . date('YmdHis');
$fakeCode = 'SELFCHECKCODE' . date('YmdHis') . mt_rand(100, 999);
} else {
try {
$pdo = new PDO(
'mysql:host=' . ($db['HOSTNAME'] ?? '127.0.0.1') . ';port=' . ($db['HOSTPORT'] ?? '3306')
. ';dbname=' . ($db['DATABASE'] ?? 'oil') . ';charset=' . ($db['CHARSET'] ?? 'utf8'),
$db['USERNAME'] ?? 'root', $db['PASSWORD'] ?? '',
[PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC]
);
} catch (Throwable $e) {
exit("连不上数据库:{$e->getMessage()}\n(本脚本需要读订单的 batch_no / waybill_no_code)\n");
}
if ($orderId > 0) {
$st = $pdo->prepare('SELECT * FROM yoshop_partners_order WHERE order_id = ? LIMIT 1');
$st->execute([$orderId]);
$orders = array_filter([$st->fetch() ?: null]);
if (!$orders) {
exit("未找到订单 order_id={$orderId}\n");
}
} else {
$st = $pdo->prepare('SELECT * FROM yoshop_partners_order WHERE batch_no = ? ORDER BY order_id');
$st->execute([$batchNo]);
$orders = $st->fetchAll();
if (!$orders) {
exit("未找到批次 batch_no={$batchNo} 下的订单\n");
}
}
}
// ---------------- 组装报文(字段与 3.10 文档一致) ----------------
$list = [];
$now = date('Y-m-d H:i:s');
$i = 0;
if ($fake) {
$list[] = [
'id' => 1,
'batch_no' => $batchNo,
'waybill_no' => 'SELFCHECKWB' . date('YmdHis'),
'waybill_no_code' => $fakeCode,
'mobile' => '13800000000',
'id_card' => '110101199001011234',
'name' => '自检',
'quota_amount' => 1,
'voucher_name' => '运单卡',
'effective_start' => '',
'effective_end' => '',
'handle_status' => $handleStatus,
'remark' => '链路自检,不对应任何真实订单',
'error_msg' => '',
'create_time' => $now,
'update_time' => $now,
];
}
foreach ($orders as $o) {
if ((string) $o['waybill_no_code'] === '') {
echo "⚠️ 跳过 order_id={$o['order_id']}:还没有运单流水号,说明 7.7 还没成功受理\n";
continue;
}
$batchNo === '' && $batchNo = (string) $o['batch_no'];
$list[] = [
'id' => ++$i,
'batch_no' => (string) $o['batch_no'],
'waybill_no' => (string) $o['waybill_no'],
'waybill_no_code' => (string) $o['waybill_no_code'],
'mobile' => (string) $o['mobile'],
'id_card' => (string) $o['id_card'],
'name' => (string) $o['driver_name'],
'quota_amount' => (int) round((float) $o['total_price'] * 100),
'voucher_name' => '运单卡',
'effective_start' => '',
'effective_end' => '',
'handle_status' => $handleStatus,
'remark' => $result === 'success' ? ($msg !== '' ? $msg : '发放成功') : '',
'error_msg' => $result === 'failed' ? ($msg !== '' ? $msg : '模拟发放失败') : '',
'create_time' => $now,
'update_time' => $now,
];
}
if (!$list) {
exit("没有可推送的明细\n");
}
$statusText = [3 => '全部成功', 4 => '部分成功', 5 => '处理失败'][$batchStatus] ?? '处理中';
$data = [
'appId' => (string) ($qyt['APP_ID'] ?? 'SIMAPPID'),
'scene' => 'oil',
'business_license' => '',
'batch_no' => $batchNo,
'passageway' => ((string) ($orders[0]['passageway'] ?? 'alipay')) === 'pingan' ? 2 : 1, // 自检模式下固定 1
'status' => $batchStatus,
'status_text' => $statusText,
'remark' => '模拟推送',
'notify_time' => $now,
'list' => $list,
];
$json = json_encode($data, JSON_UNESCAPED_UNICODE);
echo "通知地址:{$url}\n";
echo "批次:{$batchNo} 批次状态:{$batchStatus}({$statusText}) 明细:" . count($list) . " 条\n";
if ($fake) {
echo "自检模式:运单流水号 {$fakeCode}(刻意不对应任何订单,不会改动任何数据)\n";
}
foreach ($orders as $o) {
printf(" order_id=%s 油卡号=%s 金额=%s 当前发放态=%s\n",
$o['order_id'], $o['oilCardNo'], $o['total_price'], $o['oil_status_zsy']);
}
echo "data:" . mb_substr($json, 0, 1500) . (mb_strlen($json) > 1500 ? ' …(截断)' : '') . "\n\n";
if ($dryRun) {
echo "--dry-run:未发送\n";
exit;
}
// ---------------- 发送:multipart/form-data,data + sign ----------------
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => $url,
CURLOPT_POST => true,
// 传数组 => cURL 自动用 multipart/form-data 编码,与企油通口径一致
CURLOPT_POSTFIELDS => ['data' => $json, 'sign' => 'SIMULATED'],
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 30,
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_SSL_VERIFYHOST => false,
]);
$resp = curl_exec($ch);
$http = (int) curl_getinfo($ch, CURLINFO_HTTP_CODE);
$err = curl_error($ch);
curl_close($ch);
echo "HTTP {$http}\n响应:" . ($resp === false ? "cURL 失败:{$err}" : $resp) . "\n";
// 3.10 的成功判据就是 HTTP 2xx,响应体不做要求
$ok = $http >= 200 && $http < 300;
echo $ok ? "接收端已受理(HTTP 2xx)\n" : "⚠️ 接收端未返回 2xx,企油通会重试最多 5 次;请查 runtime/storelog 下当天的 qyt_*.txt\n";
if (!$ok) {
exit;
}
// ---------------- 自检模式:靠日志验证整条链路 ----------------
if ($fake) {
// 日志目录:接收端与队列进程现在统一写 runtime/storelog(见 app/common.php 的
// store_log_path)。为了兼容「代码还没全量更新」和历史日志,这里把多应用模式下的
// 旧目录 runtime/{api,store}/storelog 也一并扫上。
$sub = date('Ym') . '/' . date('Ymd');
$dirs = [
$root . '/runtime/storelog/' . $sub,
$root . '/runtime/api/storelog/' . $sub,
$root . '/runtime/store/storelog/' . $sub,
];
$grep = static function (array $dirs, string $pattern, string $needle): bool {
foreach ($dirs as $dir) {
foreach ((array) glob($dir . '/' . $pattern) as $f) {
if (strpos((string) @file_get_contents($f), $needle) !== false) {
return true;
}
}
}
return false;
};
echo "\n等待 callback:queue 处理";
$received = false;
$consumed = false;
for ($n = 0; $n < 10; $n++) {
sleep(1);
echo '.';
$received = $received || $grep($dirs, 'qyt_*.txt', $batchNo);
$consumed = $grep($dirs, '[0-9]*.txt', '3.10 发放结果通知处理完成 batch_no=' . $batchNo);
if ($consumed) {
break;
}
}
echo "\n\n自检结果:\n";
printf(" %s 1/3 入口可达,返回 HTTP %d\n", '✅', $http);
printf(" %s 2/3 接收端解析到报文(%s 里出现了 batch_no)\n",
$received ? '✅' : '❌', $dirs[0] . '/qyt_*.txt');
printf(" %s 3/3 callback:queue 消费并完成判定\n", $consumed ? '✅' : '❌');
// 3/3 过了就说明整条链路都走到了(接收端日志受「详细日志」开关控制,没有不代表没收到)
if ($consumed) {
echo "\n链路通了。日志里那条「未匹配=1」是预期结果——自检用的运单号本来就不对应任何订单,\n"
. "说明「入口 -> 表单解析 -> 入队 -> 消费者取出 -> 逐条判定」每一步都走到了。\n"
. "真实通知到达时,这一条会变成「成功=1」或「失败=1」。\n";
if (!$received) {
echo "\n注:2/3 没打钩不影响功能,常见原因是「详细日志」开关关着\n"
. " (后台 ->「企油通对接设置」->「详细日志」)。联调期建议打开,\n"
. " 出问题时能看到上游推过来的原文:\n"
. " tail -n 50 {$dirs[0]}/qyt_*.txt\n";
}
exit;
}
echo "\n排查方向(按顺序排查):\n";
if (!$received) {
echo " 1) 请求可能根本没打到本站点:确认 --url 指向的就是这台机器,\n"
. " 且 nginx 能访问到 public/qytwaybill.php(伪静态别把它拦掉)。\n"
. " 先把「详细日志」打开再跑一次,能看到原文就说明收到了。\n";
}
echo " 2) callback:queue 进程多半没在跑,确认一下:\n"
. " /www/server/panel/pyenv/bin/supervisorctl status | grep callback\n"
. " 也可以先前台手动跑一个看报错:php think callback:queue\n";
echo " 3) Redis 不通的话入队就失败了,接收端日志里会有异常:redis-cli ping\n";
exit;
}
// ---------------- 等队列处理并对比结果 ----------------
echo "\n等待 callback:queue 处理";
$ids = array_column($orders, 'order_id');
$in = implode(',', array_map('intval', $ids));
$before = [];
foreach ($orders as $o) {
$before[$o['order_id']] = (int) $o['oil_status_zsy'];
}
$changed = false;
for ($n = 0; $n < 10; $n++) {
sleep(1);
echo '.';
$rows = $pdo->query("SELECT order_id, oil_status, oil_status_zsy, oil_text FROM yoshop_partners_order WHERE order_id IN ({$in})")->fetchAll();
$changed = true;
foreach ($rows as $r) {
if ((int) $r['oil_status_zsy'] === $before[$r['order_id']]) {
$changed = false;
}
}
if ($changed) {
break;
}
}
echo "\n";
$textOf = [0 => '未提交', 1 => '发放中', 2 => '发放成功', 3 => '发放失败'];
$rows = $pdo->query("SELECT order_id, oil_status, oil_status_zsy, oil_text FROM yoshop_partners_order WHERE order_id IN ({$in})")->fetchAll();
foreach ($rows as $r) {
printf("%s order_id=%s 发放态 %s -> %s %s\n",
(int) $r['oil_status_zsy'] === $before[$r['order_id']] ? '⚠️' : '✅',
$r['order_id'],
$textOf[$before[$r['order_id']]] ?? $before[$r['order_id']],
$textOf[(int) $r['oil_status_zsy']] ?? $r['oil_status_zsy'],
$r['oil_text']);
}
if (!$changed) {
echo "\n可能原因:\n"
. " 1) callback:queue 进程没在跑(supervisorctl status 看一下)\n"
. " 2) 订单当前不是「发放中」,已经是终态了(状态跃迁只从 1 出发,这是幂等设计)\n"
. " 3) 处理异常,查 runtime/storelog 下当天的 qyt_" . date('YmdH') . ".txt\n";
}
+11 -4
View File
@@ -18,14 +18,21 @@
;
; 【进程数说明】
; partners:queue 可多进程(同一订单由 RedisLock 串行,安全)
; qyt:status 可多进程(同上)。7.8 是「一单一次 HTTP 调用」,单进程串行时
; 在途单一多,一轮扫描就要几十秒,退避间隔会被拖长、分油变慢,
; 所以默认给 3 个进程。在途量更大时继续加。
; callback:queue / notify:queue 建议保持单进程
;
; 【改完必须重启】
; /www/server/panel/pyenv/bin/supervisorctl update
; /www/server/panel/pyenv/bin/supervisorctl restart all
; ============================================================
[program:qyt-partners-queue]
command=/www/server/php/74/bin/php think partners:queue
directory=/www/wwwroot/oil
user=www
numprocs=1
numprocs=2
process_name=%(program_name)s_%(process_num)02d
autostart=true
autorestart=true
@@ -33,7 +40,7 @@ startsecs=3
startretries=99
stopwaitsecs=10
redirect_stderr=true
stdout_logfile=/www/wwwlogs/supervisor/qyt-partners-queue.log
stdout_logfile=/www/wwwlogs/supervisor/qyt-partners-queue-%(process_num)02d.log
stdout_logfile_maxbytes=50MB
stdout_logfile_backups=5
@@ -41,7 +48,7 @@ stdout_logfile_backups=5
command=/www/server/php/74/bin/php think qyt:status
directory=/www/wwwroot/oil
user=www
numprocs=1
numprocs=3
process_name=%(program_name)s_%(process_num)02d
autostart=true
autorestart=true
@@ -49,7 +56,7 @@ startsecs=3
startretries=99
stopwaitsecs=10
redirect_stderr=true
stdout_logfile=/www/wwwlogs/supervisor/qyt-status-queue.log
stdout_logfile=/www/wwwlogs/supervisor/qyt-status-queue-%(process_num)02d.log
stdout_logfile_maxbytes=50MB
stdout_logfile_backups=5
+1 -1
View File
@@ -1,2 +1,2 @@
<!DOCTYPE html><html lang=zh-CN><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><title>加油</title><script>var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel=stylesheet href=./static/index.2da1efab.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=./static/js/chunk-vendors.2d543954.js></script><script src=./static/js/index.a18d945d.js></script></body></html>
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel=stylesheet href=./static/index.2da1efab.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=./static/js/chunk-vendors.47dac25a.js></script><script src=./static/js/index.108fa453.js></script></body></html>
+27
View File
@@ -0,0 +1,27 @@
<?php
// [ 企油通 3.10 发放结果通知入口 ]
// 把本文件的外网地址给企油通对接人,配到「运单油费下发(scene=oil)」的接收地址上:
// https://你的域名/qytwaybill.php
// 注意:3.10 一条通知携带整批明细(最多约 1 万条),接收端的请求体大小限制要放宽,
// 建议 php.ini: post_max_size >= 20M;nginx: client_max_body_size 20m;
namespace think;
// 检测PHP环境
if (version_compare(PHP_VERSION, '7.1.0', '<')) die('require PHP > 7.1.0 !');
// 加载核心文件
require __DIR__ . '/../vendor/autoload.php';
// 执行HTTP应用并响应
$http = (new App())->http;
// 手动指定路由
$_SERVER['PATH_INFO'] = '/qytNotify/waybill';
// 绑定 api 应用
$response = $http->name('api')->run();
$response->send();
$http->end($response);
Binary file not shown.

After

Width:  |  Height:  |  Size: 971 B

File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-custom-index"],{"0eb1":function(t,n,e){"use strict";e.r(n);var a=e("af73"),i=e("3747");for(var r in i)["default"].indexOf(r)<0&&function(t){e.d(n,t,(function(){return i[t]}))}(r);e("10f6");var s=e("828b"),o=Object(s["a"])(i["default"],a["b"],a["c"],!1,null,"6c0de1e4",null,!1,a["a"],void 0);n["default"]=o.exports},"10f6":function(t,n,e){"use strict";var a=e("48d1"),i=e.n(a);i.a},3033:function(t,n,e){"use strict";e("6a54");var a=e("f5bd").default,i=e("3639").default;Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0,e("bf0f");var r=i(e("16a0")),s=a(e("a41a")),o=(getApp(),{components:{Page:s.default},data:function(){return{options:{},page:{},items:[]}},onLoad:function(t){this.options=t,this.getPageData()},methods:{getPageData:function(t){var n=this,e=n.options.pageId||0;r.detail(e).then((function(t){var e=t.data.pageData;n.page=e.page,n.items=e.items,n.setPageBar()})).finally((function(){return t&&t()}))},setPageBar:function(){var t=this.page;uni.setNavigationBarTitle({title:t.params.title}),uni.setNavigationBarColor({frontColor:"white"===t.style.titleTextColor?"#ffffff":"#000000",backgroundColor:t.style.titleBackgroundColor})}},onPullDownRefresh:function(){this.getPageData((function(){uni.stopPullDownRefresh()}))},onShareAppMessage:function(){var t=this.page;return{title:t.params.share_title,path:"/pages/index/index?"+this.$getShareUrlParams()}},onShareTimeline:function(){var t=this.page;return{title:t.params.share_title,path:"/pages/index/index?"+this.$getShareUrlParams()}}});n.default=o},3747:function(t,n,e){"use strict";e.r(n);var a=e("3033"),i=e.n(a);for(var r in a)["default"].indexOf(r)<0&&function(t){e.d(n,t,(function(){return a[t]}))}(r);n["default"]=i.a},"48d1":function(t,n,e){var a=e("73de");a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[t.i,a,""]]),a.locals&&(t.exports=a.locals);var i=e("967d").default;i("0e95445c",a,!0,{sourceMap:!1,shadowMode:!1})},"73de":function(t,n,e){var a=e("c86c");n=a(!1),n.push([t.i,'@charset "UTF-8";\n/**\n * 这里是uni-app内置的常用样式变量\n *\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\n *\n */\n/**\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\n *\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\n */\n/* 颜色变量 */\n/* 行为相关颜色 */\n/* 文字基本颜色 */\n/* 背景颜色 */\n/* 边框颜色 */\n/* 尺寸变量 */\n/* 文字尺寸 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */\n/* 透明度 */\n/* 文章场景相关 */\n/* 引入uView全局scss变量文件 */.container[data-v-6c0de1e4]{background:#fff}',""]),t.exports=n},af73:function(t,n,e){"use strict";e.d(n,"b",(function(){return a})),e.d(n,"c",(function(){return i})),e.d(n,"a",(function(){}));var a=function(){var t=this.$createElement,n=this._self._c||t;return n("v-uni-view",{staticClass:"container"},[n("Page",{attrs:{items:this.items}})],1)},i=[]}}]);
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-help-index"],{"15a3":function(t,n,e){"use strict";e("6a54");var i=e("3639").default,a=e("f5bd").default;Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0,e("bf0f");var o=a(e("292a")),s=a(e("bd05")),u=i(e("ee7f")),l=e("d45e"),r={components:{MescrollBody:o.default},mixins:[s.default],data:function(){return{list:(0,l.getEmptyPaginateObj)(),upOption:{auto:!0,page:{size:15},noMoreSize:12,empty:{tip:"亲,暂无相关数据"}}}},onLoad:function(t){},methods:{upCallback:function(t){var n=this;n.getHelpList(t.num).then((function(t){var e=t.data.length,i=t.data.total;n.mescroll.endBySize(e,i)})).catch((function(){return n.mescroll.endErr()}))},getHelpList:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=this;return new Promise((function(e,i){u.list({page:t}).then((function(i){var a=i.data.list;n.list.data=(0,l.getMoreListData)(a,n.list,t),e(a)}))}))}}};n.default=r},"3f9d":function(t,n,e){"use strict";e.r(n);var i=e("e96e"),a=e("9280");for(var o in a)["default"].indexOf(o)<0&&function(t){e.d(n,t,(function(){return a[t]}))}(o);e("e8b88");var s=e("828b"),u=Object(s["a"])(a["default"],i["b"],i["c"],!1,null,"298ff59a",null,!1,i["a"],void 0);n["default"]=u.exports},6886:function(t,n,e){var i=e("85b3");i.__esModule&&(i=i.default),"string"===typeof i&&(i=[[t.i,i,""]]),i.locals&&(t.exports=i.locals);var a=e("967d").default;a("0d269712",i,!0,{sourceMap:!1,shadowMode:!1})},"85b3":function(t,n,e){var i=e("c86c");n=i(!1),n.push([t.i,'@charset "UTF-8";\n/**\n * 这里是uni-app内置的常用样式变量\n *\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\n *\n */\n/**\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\n *\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\n */\n/* 颜色变量 */\n/* 行为相关颜色 */\n/* 文字基本颜色 */\n/* 背景颜色 */\n/* 边框颜色 */\n/* 尺寸变量 */\n/* 文字尺寸 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */\n/* 透明度 */\n/* 文章场景相关 */\n/* 引入uView全局scss变量文件 */.help[data-v-298ff59a]{border-bottom:%?1?% solid #f6f6f9}.help .title[data-v-298ff59a]{font-size:%?32?%;color:#333;margin-bottom:%?10?%}.help .content[data-v-298ff59a]{font-size:%?26?%;color:#666}',""]),t.exports=n},9280:function(t,n,e){"use strict";e.r(n);var i=e("15a3"),a=e.n(i);for(var o in i)["default"].indexOf(o)<0&&function(t){e.d(n,t,(function(){return i[t]}))}(o);n["default"]=a.a},e8b88:function(t,n,e){"use strict";var i=e("6886"),a=e.n(i);a.a},e96e:function(t,n,e){"use strict";e.d(n,"b",(function(){return i})),e.d(n,"c",(function(){return a})),e.d(n,"a",(function(){}));var i=function(){var t=this,n=t.$createElement,e=t._self._c||n;return e("v-uni-view",{staticClass:"container"},[e("mescroll-body",{ref:"mescrollRef",attrs:{sticky:!0,down:{use:!1},up:t.upOption},on:{init:function(n){arguments[0]=n=t.$handleEvent(n),t.mescrollInit.apply(void 0,arguments)},up:function(n){arguments[0]=n=t.$handleEvent(n),t.upCallback.apply(void 0,arguments)}}},t._l(t.list.data,(function(n,i){return e("v-uni-view",{key:i,staticClass:"help cont-box b-f"},[e("v-uni-view",{staticClass:"title"},[e("v-uni-text",[t._v(t._s(n.title))])],1),e("v-uni-view",{staticClass:"content"},[e("v-uni-text",[t._v(t._s(n.content))])],1)],1)})),1)],1)},a=[]},ee7f:function(t,n,e){"use strict";e("6a54");var i=e("f5bd").default;Object.defineProperty(n,"__esModule",{value:!0}),n.list=void 0;var a=i(e("3318")),o={list:"help/list"};n.list=function(t){return a.default.get(o.list,t)}}}]);
@@ -0,0 +1 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-index-index"],{"2b4f":function(t,n,e){"use strict";e.r(n);var a=e("34e4"),i=e("86ac");for(var r in i)["default"].indexOf(r)<0&&function(t){e.d(n,t,(function(){return i[t]}))}(r);e("49f6");var s=e("828b"),o=Object(s["a"])(i["default"],a["b"],a["c"],!1,null,"57f5c5e5",null,!1,a["a"],void 0);n["default"]=o.exports},"2cba":function(t,n,e){var a=e("c86c");n=a(!1),n.push([t.i,'@charset "UTF-8";\n/**\n * 这里是uni-app内置的常用样式变量\n *\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\n *\n */\n/**\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\n *\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\n */\n/* 颜色变量 */\n/* 行为相关颜色 */\n/* 文字基本颜色 */\n/* 背景颜色 */\n/* 边框颜色 */\n/* 尺寸变量 */\n/* 文字尺寸 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */\n/* 透明度 */\n/* 文章场景相关 */\n/* 引入uView全局scss变量文件 */.container[data-v-57f5c5e5]{background:#fff}',""]),t.exports=n},"34e4":function(t,n,e){"use strict";e.d(n,"b",(function(){return a})),e.d(n,"c",(function(){return i})),e.d(n,"a",(function(){}));var a=function(){var t=this.$createElement,n=this._self._c||t;return n("v-uni-view",{staticClass:"container"},[n("Page",{attrs:{items:this.items}})],1)},i=[]},"3b34":function(t,n,e){var a=e("2cba");a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[t.i,a,""]]),a.locals&&(t.exports=a.locals);var i=e("967d").default;i("da5b6684",a,!0,{sourceMap:!1,shadowMode:!1})},"49f6":function(t,n,e){"use strict";var a=e("3b34"),i=e.n(a);i.a},"86ac":function(t,n,e){"use strict";e.r(n);var a=e("87c3"),i=e.n(a);for(var r in a)["default"].indexOf(r)<0&&function(t){e.d(n,t,(function(){return a[t]}))}(r);n["default"]=i.a},"87c3":function(t,n,e){"use strict";e("6a54");var a=e("f5bd").default,i=e("3639").default;Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0,e("bf0f");var r=e("d45e"),s=i(e("16a0")),o=a(e("a41a")),u=(getApp(),{components:{Page:o.default},data:function(){return{options:{},page:{},items:[]}},onLoad:function(t){this.options=t,this.getPageData()},onShow:function(){(0,r.setCartTabBadge)()},methods:{getPageData:function(t){var n=this,e=n.options.pageId||0;s.detail(e).then((function(t){var e=t.data.pageData;n.page=e.page,n.items=e.items,n.setPageBar()})).finally((function(){return t&&t()}))},setPageBar:function(){var t=this.page;uni.setNavigationBarTitle({title:t.params.title}),uni.setNavigationBarColor({frontColor:"white"===t.style.titleTextColor?"#ffffff":"#000000",backgroundColor:t.style.titleBackgroundColor})}},onPullDownRefresh:function(){this.getPageData((function(){uni.stopPullDownRefresh()}))},onShareAppMessage:function(){var t=this.page;return{title:t.params.share_title,path:"/pages/index/index?"+this.$getShareUrlParams()}},onShareTimeline:function(){var t=this.page;return{title:t.params.share_title,path:"/pages/index/index?"+this.$getShareUrlParams()}}});n.default=u}}]);
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-points-log"],{"01fe":function(t,e,n){"use strict";n.r(e);var a=n("353c"),i=n.n(a);for(var s in a)["default"].indexOf(s)<0&&function(t){n.d(e,t,(function(){return a[t]}))}(s);e["default"]=i.a},"0a87":function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return i})),n.d(e,"a",(function(){}));var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("v-uni-view",{staticClass:"container"},[n("mescroll-body",{ref:"mescrollRef",attrs:{sticky:!0,down:{use:!1},up:t.upOption},on:{init:function(e){arguments[0]=e=t.$handleEvent(e),t.mescrollInit.apply(void 0,arguments)},up:function(e){arguments[0]=e=t.$handleEvent(e),t.upCallback.apply(void 0,arguments)}}},[n("v-uni-view",{staticClass:"log-list"},t._l(t.list.data,(function(e,a){return n("v-uni-view",{key:a,staticClass:"log-item"},[n("v-uni-view",{staticClass:"item-left flex-box"},[n("v-uni-view",{staticClass:"rec-status"},[n("v-uni-text",[t._v(t._s(e.describe))])],1),n("v-uni-view",{staticClass:"rec-time"},[n("v-uni-text",[t._v(t._s(e.create_time))])],1)],1),n("v-uni-view",{staticClass:"item-right",class:[e.value>0?"col-green":"col-6"]},[n("v-uni-text",[t._v(t._s(e.value>0?"+":"")+t._s(e.value))])],1)],1)})),1)],1)],1)},i=[]},"0d47":function(t,e,n){var a=n("e102");a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[t.i,a,""]]),a.locals&&(t.exports=a.locals);var i=n("967d").default;i("15d45972",a,!0,{sourceMap:!1,shadowMode:!1})},"353c":function(t,e,n){"use strict";n("6a54");var a=n("3639").default,i=n("f5bd").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,n("bf0f");var s=i(n("292a")),o=i(n("bd05")),u=a(n("9745")),l=n("d45e"),r={components:{MescrollBody:s.default},mixins:[o.default],data:function(){return{list:(0,l.getEmptyPaginateObj)(),upOption:{auto:!0,page:{size:15},noMoreSize:12,empty:{tip:"亲,暂无相关数据"}}}},onLoad:function(t){},methods:{upCallback:function(t){var e=this;e.getLogList(t.num).then((function(t){var n=t.data.length,a=t.data.total;e.mescroll.endBySize(n,a)})).catch((function(){return e.mescroll.endErr()}))},getLogList:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=this;return new Promise((function(n,a){u.list({page:t}).then((function(a){var i=a.data.list;e.list.data=(0,l.getMoreListData)(i,e.list,t),n(i)}))}))}}};e.default=r},5251:function(t,e,n){"use strict";n.r(e);var a=n("0a87"),i=n("01fe");for(var s in i)["default"].indexOf(s)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(s);n("b4a1");var o=n("828b"),u=Object(o["a"])(i["default"],a["b"],a["c"],!1,null,"b3e51b6a",null,!1,a["a"],void 0);e["default"]=u.exports},9745:function(t,e,n){"use strict";n("6a54");var a=n("f5bd").default;Object.defineProperty(e,"__esModule",{value:!0}),e.list=void 0;var i=a(n("3318")),s={list:"points.log/list"};e.list=function(t){return i.default.get(s.list,t)}},b4a1:function(t,e,n){"use strict";var a=n("0d47"),i=n.n(a);i.a},e102:function(t,e,n){var a=n("c86c");e=a(!1),e.push([t.i,'@charset "UTF-8";\n/**\n * 这里是uni-app内置的常用样式变量\n *\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\n *\n */\n/**\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\n *\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\n */\n/* 颜色变量 */\n/* 行为相关颜色 */\n/* 文字基本颜色 */\n/* 背景颜色 */\n/* 边框颜色 */\n/* 尺寸变量 */\n/* 文字尺寸 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */\n/* 透明度 */\n/* 文章场景相关 */\n/* 引入uView全局scss变量文件 */uni-page-body[data-v-b3e51b6a],\n.container[data-v-b3e51b6a]{background:#fff}body.?%PAGE?%[data-v-b3e51b6a]{background:#fff}.log-list[data-v-b3e51b6a]{padding:0 %?30?%}.log-item[data-v-b3e51b6a]{font-size:%?28?%;padding:%?20?% %?20?%;line-height:1.8;border-bottom:%?1?% solid #eee;display:flex;justify-content:center;align-items:center}.rec-status[data-v-b3e51b6a]{color:#333}.rec-status .rec-time[data-v-b3e51b6a]{color:#a0a0a0;font-size:%?26?%}',""]),t.exports=e}}]);
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-wallet-balance-log"],{"63f5":function(t,n,e){"use strict";e.r(n);var a=e("f4ff"),i=e.n(a);for(var s in a)["default"].indexOf(s)<0&&function(t){e.d(n,t,(function(){return a[t]}))}(s);n["default"]=i.a},"72d9":function(t,n,e){var a=e("c86c");n=a(!1),n.push([t.i,'@charset "UTF-8";\n/**\n * 这里是uni-app内置的常用样式变量\n *\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\n *\n */\n/**\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\n *\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\n */\n/* 颜色变量 */\n/* 行为相关颜色 */\n/* 文字基本颜色 */\n/* 背景颜色 */\n/* 边框颜色 */\n/* 尺寸变量 */\n/* 文字尺寸 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */\n/* 透明度 */\n/* 文章场景相关 */\n/* 引入uView全局scss变量文件 */uni-page-body[data-v-da64f4fa],\n.container[data-v-da64f4fa]{background:#fff}body.?%PAGE?%[data-v-da64f4fa]{background:#fff}.log-list[data-v-da64f4fa]{padding:0 %?30?%}.log-item[data-v-da64f4fa]{font-size:%?28?%;padding:%?20?% %?20?%;line-height:1.8;border-bottom:%?1?% solid #eee;display:flex;justify-content:center;align-items:center}.rec-status[data-v-da64f4fa]{color:#333}.rec-status .rec-time[data-v-da64f4fa]{color:#a0a0a0;font-size:%?26?%}',""]),t.exports=n},"87f3":function(t,n,e){"use strict";e("6a54");var a=e("f5bd").default;Object.defineProperty(n,"__esModule",{value:!0}),n.list=void 0;var i=a(e("3318")),s={list:"balance.log/list"};n.list=function(t){return i.default.get(s.list,t)}},a15f:function(t,n,e){var a=e("72d9");a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[t.i,a,""]]),a.locals&&(t.exports=a.locals);var i=e("967d").default;i("6c40a443",a,!0,{sourceMap:!1,shadowMode:!1})},e79f:function(t,n,e){"use strict";e.r(n);var a=e("f52a"),i=e("63f5");for(var s in i)["default"].indexOf(s)<0&&function(t){e.d(n,t,(function(){return i[t]}))}(s);e("fa3b");var o=e("828b"),f=Object(o["a"])(i["default"],a["b"],a["c"],!1,null,"da64f4fa",null,!1,a["a"],void 0);n["default"]=f.exports},f4ff:function(t,n,e){"use strict";e("6a54");var a=e("3639").default,i=e("f5bd").default;Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0,e("bf0f");var s=i(e("292a")),o=i(e("bd05")),f=a(e("87f3")),u=e("d45e"),r={components:{MescrollBody:s.default},mixins:[o.default],data:function(){return{list:(0,u.getEmptyPaginateObj)(),upOption:{auto:!0,page:{size:15},noMoreSize:12,empty:{tip:"亲,暂无账单明细"}}}},onLoad:function(t){},methods:{upCallback:function(t){var n=this;n.getLogList(t.num).then((function(t){var e=t.data.length,a=t.data.total;n.mescroll.endBySize(e,a)})).catch((function(){return n.mescroll.endErr()}))},getLogList:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=this;return new Promise((function(e,a){f.list({page:t}).then((function(a){var i=a.data.list;n.list.data=(0,u.getMoreListData)(i,n.list,t),e(i)}))}))}}};n.default=r},f52a:function(t,n,e){"use strict";e.d(n,"b",(function(){return a})),e.d(n,"c",(function(){return i})),e.d(n,"a",(function(){}));var a=function(){var t=this,n=t.$createElement,e=t._self._c||n;return e("v-uni-view",{staticClass:"container"},[e("mescroll-body",{ref:"mescrollRef",attrs:{sticky:!0,down:{use:!1},up:t.upOption},on:{init:function(n){arguments[0]=n=t.$handleEvent(n),t.mescrollInit.apply(void 0,arguments)},up:function(n){arguments[0]=n=t.$handleEvent(n),t.upCallback.apply(void 0,arguments)}}},[e("v-uni-view",{staticClass:"log-list"},t._l(t.list.data,(function(n,a){return e("v-uni-view",{key:a,staticClass:"log-item"},[e("v-uni-view",{staticClass:"item-left flex-box"},[e("v-uni-view",{staticClass:"rec-status"},[e("v-uni-text",[t._v(t._s(n.describe))])],1),e("v-uni-view",{staticClass:"rec-time"},[e("v-uni-text",[t._v(t._s(n.create_time))])],1)],1),e("v-uni-view",{staticClass:"item-right"},[e("v-uni-text",[t._v(t._s(n.money>0?"+":"")+t._s(n.money)+"元")])],1)],1)})),1)],1)],1)},i=[]},fa3b:function(t,n,e){"use strict";var a=e("a15f"),i=e.n(a);i.a}}]);
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-wallet-exchange-log"],{"15b9":function(t,e,n){"use strict";n.r(e);var a=n("f973"),i=n("7a01");for(var s in i)["default"].indexOf(s)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(s);n("4fd9");var o=n("828b"),r=Object(o["a"])(i["default"],a["b"],a["c"],!1,null,"07b7f853",null,!1,a["a"],void 0);e["default"]=r.exports},"4fd9":function(t,e,n){"use strict";var a=n("d1e1"),i=n.n(a);i.a},"7a01":function(t,e,n){"use strict";n.r(e);var a=n("b243"),i=n.n(a);for(var s in a)["default"].indexOf(s)<0&&function(t){n.d(e,t,(function(){return a[t]}))}(s);e["default"]=i.a},"8f12":function(t,e,n){var a=n("c86c");e=a(!1),e.push([t.i,'@charset "UTF-8";\n/**\n * 这里是uni-app内置的常用样式变量\n *\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\n *\n */\n/**\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\n *\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\n */\n/* 颜色变量 */\n/* 行为相关颜色 */\n/* 文字基本颜色 */\n/* 背景颜色 */\n/* 边框颜色 */\n/* 尺寸变量 */\n/* 文字尺寸 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */\n/* 透明度 */\n/* 文章场景相关 */\n/* 引入uView全局scss变量文件 */uni-page-body[data-v-07b7f853],\n.container[data-v-07b7f853]{background:#fff}body.?%PAGE?%[data-v-07b7f853]{background:#fff}.log-list[data-v-07b7f853]{padding:0 %?30?%}.log-item[data-v-07b7f853]{font-size:%?28?%;padding:%?20?% %?20?%;line-height:1.8;border-bottom:%?1?% solid #eee;display:flex;justify-content:center;align-items:center}.rec-status .rec-time[data-v-07b7f853]{color:#a0a0a0;font-size:%?26?%}.red[data-v-07b7f853]{color:red}',""]),t.exports=e},b243:function(t,e,n){"use strict";n("6a54");var a=n("3639").default,i=n("f5bd").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,n("bf0f");var s=i(n("292a")),o=i(n("bd05")),r=a(n("f620")),u=n("d45e"),c={components:{MescrollBody:s.default},mixins:[o.default],data:function(){return{list:(0,u.getEmptyPaginateObj)(),upOption:{auto:!0,page:{size:15},noMoreSize:12,empty:{tip:"亲,暂无兑换明细"}}}},onLoad:function(t){},methods:{upCallback:function(t){var e=this;e.getLogList(t.num).then((function(t){var n=t.data.length,a=t.data.total;e.mescroll.endBySize(n,a)})).catch((function(){return e.mescroll.endErr()}))},getLogList:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=this;return new Promise((function(n,a){r.list({page:t}).then((function(a){var i=a.data.list;e.list.data=(0,u.getMoreListData)(i,e.list,t),n(i)}))}))}}};e.default=c},d1e1:function(t,e,n){var a=n("8f12");a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[t.i,a,""]]),a.locals&&(t.exports=a.locals);var i=n("967d").default;i("b4ce4144",a,!0,{sourceMap:!1,shadowMode:!1})},f620:function(t,e,n){"use strict";n("6a54");var a=n("f5bd").default;Object.defineProperty(e,"__esModule",{value:!0}),e.list=void 0;var i=a(n("3318")),s={list:"card.log/list"};e.list=function(t){return i.default.get(s.list,t)}},f973:function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return i})),n.d(e,"a",(function(){}));var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("v-uni-view",{staticClass:"container"},[n("mescroll-body",{ref:"mescrollRef",attrs:{sticky:!0,down:{use:!1},up:t.upOption},on:{init:function(e){arguments[0]=e=t.$handleEvent(e),t.mescrollInit.apply(void 0,arguments)},up:function(e){arguments[0]=e=t.$handleEvent(e),t.upCallback.apply(void 0,arguments)}}},[n("v-uni-view",{staticClass:"log-list"},t._l(t.list.data,(function(e,a){return n("v-uni-view",{key:a,staticClass:"log-item "},[n("v-uni-view",{class:["item-left","flex-box",10===e.state?"red":""]},[n("v-uni-view",{staticClass:"rec-status"},[n("v-uni-text",[t._v(t._s(e.card_number)+" "+t._s(e.describe))])],1),n("v-uni-view",{staticClass:"rec-time"},[n("v-uni-text",[t._v(t._s(e.create_time))])],1)],1),n("v-uni-view",{class:["item-right",10===e.state?"red":""]},[n("v-uni-text",[t._v(t._s(e.money)+"元")])],1)],1)})),1)],1)],1)},i=[]}}]);
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-wallet-recharge-order"],{"23fb":function(t,e,n){"use strict";n("6a54");var a=n("3639").default,i=n("f5bd").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,n("bf0f");var s=i(n("292a")),o=i(n("bd05")),r=a(n("e77a")),u=n("d45e"),c={components:{MescrollBody:s.default},mixins:[o.default],data:function(){return{list:(0,u.getEmptyPaginateObj)(),upOption:{auto:!0,page:{size:15},noMoreSize:12,empty:{tip:"亲,暂无充值记录"}}}},onLoad:function(t){},methods:{upCallback:function(t){var e=this;e.getLogList(t.num).then((function(t){var n=t.data.length,a=t.data.total;e.mescroll.endBySize(n,a)})).catch((function(){return e.mescroll.endErr()}))},getLogList:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=this;return new Promise((function(n,a){r.list({page:t}).then((function(a){var i=a.data.list;e.list.data=(0,u.getMoreListData)(i,e.list,t),n(i)}))}))}}};e.default=c},"26e3":function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return i})),n.d(e,"a",(function(){}));var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("v-uni-view",{staticClass:"container"},[n("mescroll-body",{ref:"mescrollRef",attrs:{sticky:!0,down:{use:!1},up:t.upOption},on:{init:function(e){arguments[0]=e=t.$handleEvent(e),t.mescrollInit.apply(void 0,arguments)},up:function(e){arguments[0]=e=t.$handleEvent(e),t.upCallback.apply(void 0,arguments)}}},[n("v-uni-view",{staticClass:"log-list"},t._l(t.list.data,(function(e,a){return n("v-uni-view",{key:a,staticClass:"log-item"},[n("v-uni-view",{staticClass:"item-left flex-box"},[n("v-uni-view",{staticClass:"rec-status"},[n("v-uni-text",[t._v(t._s("充值成功"))])],1),n("v-uni-view",{staticClass:"rec-time"},[n("v-uni-text",[t._v(t._s(e.pay_time))])],1)],1),n("v-uni-view",{staticClass:"item-right"},[n("v-uni-text",[t._v("+"+t._s(e.actual_money)+"元")])],1)],1)})),1)],1)],1)},i=[]},"74ca":function(t,e,n){"use strict";var a=n("bce6"),i=n.n(a);i.a},a636:function(t,e,n){"use strict";n.r(e);var a=n("26e3"),i=n("d949");for(var s in i)["default"].indexOf(s)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(s);n("74ca");var o=n("828b"),r=Object(o["a"])(i["default"],a["b"],a["c"],!1,null,"636f2665",null,!1,a["a"],void 0);e["default"]=r.exports},bce6:function(t,e,n){var a=n("d058");a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[t.i,a,""]]),a.locals&&(t.exports=a.locals);var i=n("967d").default;i("523e2374",a,!0,{sourceMap:!1,shadowMode:!1})},d058:function(t,e,n){var a=n("c86c");e=a(!1),e.push([t.i,'@charset "UTF-8";\n/**\n * 这里是uni-app内置的常用样式变量\n *\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\n *\n */\n/**\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\n *\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\n */\n/* 颜色变量 */\n/* 行为相关颜色 */\n/* 文字基本颜色 */\n/* 背景颜色 */\n/* 边框颜色 */\n/* 尺寸变量 */\n/* 文字尺寸 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */\n/* 透明度 */\n/* 文章场景相关 */\n/* 引入uView全局scss变量文件 */uni-page-body[data-v-636f2665],\n.container[data-v-636f2665]{background:#fff}body.?%PAGE?%[data-v-636f2665]{background:#fff}.log-list[data-v-636f2665]{padding:0 %?30?%}.log-item[data-v-636f2665]{font-size:%?28?%;padding:%?20?% %?20?%;line-height:1.8;border-bottom:%?1?% solid #eee;display:flex;justify-content:center;align-items:center}.rec-status[data-v-636f2665]{color:#333}.rec-status .rec-time[data-v-636f2665]{color:#a0a0a0;font-size:%?26?%}',""]),t.exports=e},d949:function(t,e,n){"use strict";n.r(e);var a=n("23fb"),i=n.n(a);for(var s in a)["default"].indexOf(s)<0&&function(t){n.d(e,t,(function(){return a[t]}))}(s);e["default"]=i.a},e77a:function(t,e,n){"use strict";n("6a54");var a=n("f5bd").default;Object.defineProperty(e,"__esModule",{value:!0}),e.list=void 0;var i=a(n("3318")),s={list:"recharge.order/list"};e.list=function(t){return i.default.get(s.list,t)}}}]);
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-webview-webview"],{"8ff3":function(n,e,t){"use strict";var r=t("b991"),o=t.n(r);o.a},a738:function(n,e,t){"use strict";t("6a54"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r={data:function(){return{webUrl:""}},onLoad:function(n){console.log(n),this.webUrl=n.url},methods:{onError:function(n){console.error("Error loading webview:",n)}}};e.default=r},b909:function(n,e,t){"use strict";t.d(e,"b",(function(){return r})),t.d(e,"c",(function(){return o})),t.d(e,"a",(function(){}));var r=function(){var n=this,e=n.$createElement,t=n._self._c||e;return t("v-uni-view",[t("v-uni-web-view",{attrs:{src:n.webUrl},on:{message:function(e){arguments[0]=e=n.$handleEvent(e),n.onMessage.apply(void 0,arguments)}}})],1)},o=[]},b991:function(n,e,t){var r=t("fc1f");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[n.i,r,""]]),r.locals&&(n.exports=r.locals);var o=t("967d").default;o("644ea13a",r,!0,{sourceMap:!1,shadowMode:!1})},c2c2:function(n,e,t){"use strict";t.r(e);var r=t("b909"),o=t("f0e99");for(var u in o)["default"].indexOf(u)<0&&function(n){t.d(e,n,(function(){return o[n]}))}(u);t("8ff3");var a=t("828b"),i=Object(a["a"])(o["default"],r["b"],r["c"],!1,null,"71cd8b31",null,!1,r["a"],void 0);e["default"]=i.exports},f0e99:function(n,e,t){"use strict";t.r(e);var r=t("a738"),o=t.n(r);for(var u in r)["default"].indexOf(u)<0&&function(n){t.d(e,n,(function(){return r[n]}))}(u);e["default"]=o.a},fc1f:function(n,e,t){var r=t("c86c");e=r(!1),e.push([n.i,"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n/* 样式可以根据需要自定义 */",""]),n.exports=e}}]);
Binary file not shown.

After

Width:  |  Height:  |  Size: 909 B

Some files were not shown because too many files have changed in this diff Show More