This commit is contained in:
weipengfei 2024-04-15 10:50:24 +08:00
parent f4cba29c3d
commit d23ad0114f
2 changed files with 101 additions and 12 deletions

View File

@ -53,6 +53,22 @@ export function productLstApi(merId, data) {
login: true
});
}
/**
* 检测收银状态
*/
export function micropayQueryApi(data) {
return request.get(`micropay_query`, data, {
login: true
});
}
/**
* 支付失败后进行提单
*/
export function orderLadingApi(data) {
return request.get(`order_lading`, data, {
login: true
});
}
/**
* 商品列表 -- 删除

View File

@ -85,7 +85,8 @@
<text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{loadTitle}}
</view> -->
</view>
<view class='footer acea-row row-between-wrapper' :class="isFooter?'':'on'" v-if="cartList.valid.length > 0">
<view style="text-align: center;color: #999;font-size: 22rpx;" @click="copyText(PC_URL)">PC收银台网址: <text style="margin-left: 20rpx;">{{PC_URL}}</text></view>
<view class='footer acea-row row-between-wrapper' :class="isFooter?'':'on'">
<block v-if="footerswitch==true">
<view class='money acea-row row-middle'>
<text class='t-color' style="font-weight: bold;font-size: 32rpx;">{{selectCountPrice}}</text>
@ -124,8 +125,7 @@
</block>
<block v-else>
<view class="order-list">
<view class="item" v-for="(item, index) in orderList"
:key="index" @click="navTo(item)">
<view class="item" v-for="(item, index) in orderList" :key="index" @click="navTo(item)">
<view class="top">
<view class="sn" :class="
item.pay_type === 11 ||
@ -172,9 +172,9 @@
<view class="cashier" v-else>平台订单</view>
</view>
<view v-if="!item.paid" class="b-button">
<button>重新支付</button>
<button>检测状态</button>
<button style="background-color: #1890ff;">提单</button>
<button @click.stop="reOrderPay(item)">重新支付</button>
<button @click.stop="micropayQuery(item)">检测状态</button>
<button @click.stop="orderLading(item)" style="background-color: #1890ff;">提单</button>
</view>
</view>
</view>
@ -226,7 +226,8 @@
cartDel,
cartProductAttr,
createOrder,
getOrderConfirm
getOrderConfirm,
orderPay
} from '@/api/order.js';
import {
getCoupons,
@ -237,7 +238,9 @@
collectAll
} from '@/api/store.js';
import {
productLstApi
productLstApi,
micropayQueryApi,
orderLadingApi
} from "@/api/product.js";
import {
getOrderList
@ -251,6 +254,7 @@
configMap
} from '@/utils';
import { ENV } from "@/config/app.js"
import { Toast } from '../../libs/uniApi';
const app = getApp();
export default {
props: {
@ -316,7 +320,7 @@
newData: {},
activeRouter: '',
userInfo: '',
navTab: 2,
navTab: 1,
orderList: []
};
},
@ -661,6 +665,69 @@
updatePrice() {
console.log('改价');
},
//
reOrderPay(item) {
uni.scanCode({
onlyFromCamera: true,
hideAlbum: true,
success: (res) => {
if (res.result) {
const regexWechat = /^(10|11|12|13|14|15)\d{16}$/; // 10-1518
const regexPay = /^(25|26|27|28|29|30)\d{14,22}$/; // 25-3016-24
let pay_type;
if (regexWechat.test(res.result)) pay_type = "micropay";
else if (regexPay.test(res.result)) pay_type = "alipayBar";
else {
return uni.showToast({
icon: 'none',
title: '请输入正确的支付码'
})
}
orderPay(item.group_order_id, {
type: pay_type,
auth_code: res.result
}).then(res => {
uni.showToast({
title: '支付成功',
icon: 'success'
})
}).catch(err => {
console.log(err);
Toast(err)
})
}
}
})
},
//
micropayQuery(item) {
console.log(item);
micropayQueryApi({
order_sn: item.order_sn
}).then(res => {
uni.showToast({
title: '支付成功',
icon: 'success'
})
}).catch(err => {
console.log(err);
Toast(err)
})
},
//
orderLading(item) {
orderLadingApi({
order_sn: item.order_sn,
staff_id: this.$store.state.app.userInfo.service.service_id
}).then(res => {
console.log(res);
Toast(res.message);
this.changeNavTab(1);
}).catch(err => {
console.log(err);
Toast(err);
})
},
//
scanShopCode() {
productLstApi(this.$store.state.app.userInfo.service.mer_id, {
@ -670,6 +737,8 @@
staff_id: this.$store.state.app.userInfo.service.service_id
}).then(({ data }) => {
console.log(data);
}).catch(err => {
console.error(err);
})
uni.scanCode({
success: (res) => {
@ -686,6 +755,7 @@
},
//
subOrder: function(event) {
if (this.cartList.valid.length == 0) return Toast('请先添加商品')
let selectValue = []
this.cartList.valid.forEach(el => {
el.list.forEach(goods => {
@ -1065,7 +1135,8 @@
}
});
},
navTo(item){
navTo(item) {
if (item.paid == 0) return Toast('订单未支付!');
uni.navigateTo({
url: `/pages/admin/orderDetail/index?id=${item.order_id}&mer_id=${this.userInfo.service.mer_id}`
})
@ -1690,11 +1761,13 @@
font-size: 26rpx;
color: #777;
}
.b-button{
.b-button {
display: flex;
justify-content: flex-end;
margin-top: 20rpx;
button{
button {
font-size: 26rpx;
background-color: #2ec479;
color: #fff;