代码更新

This commit is contained in:
GaoHao
2025-03-12 14:13:29 +08:00
parent 2f1523d4e9
commit c2135c6119
105 changed files with 2026 additions and 278 deletions

View File

@@ -55,7 +55,7 @@
<script setup>
import { onLoad } from '@dcloudio/uni-app'
import { reactive, onBeforeMount, ref } from 'vue';
import { getCreditBuyerPage } from '@/api/buyer.js';
import { getCreditBuyerPage } from '@/http/api/buyer.js';
let nouser = ref(false)
let timer = null

View File

@@ -55,7 +55,7 @@
</view>
<view class="u-m-r-20 u-font-24 u-flex" v-if="item.returnAmount">
<view class="color-666">退款金额:</view>
<view class="color-999 u-m-l-6">{{item.returnAmount*item.refundNum}}</view>
<view class="color-999 u-m-l-6">{{item.unitPrice*item.refundNum}}</view>
</view>
<view class="u-m-r-20 u-font-24 u-flex" v-if="item.returnNum">
<view class="color-666">退菜数量:</view>
@@ -71,7 +71,7 @@
</view>
<view class="u-text-right u-m-t-28">
<template v-if="item.refundNum>0">
<view>{{(returnTotalMoney(item)-item.refundNum*item.returnAmount).toFixed(2)}}</view>
<view>{{(returnTotalMoney(item)-item.refundNum*item.unitPrice).toFixed(2)}}</view>
<view class="line-th color-666 ">{{returnTotalMoney(item)}}</view>
</template>
<template v-else-if="item.userCouponId">
@@ -177,7 +177,7 @@
<template v-if="orderInfo.status=='unpaid'">
<view>
<text>总计</text>
<text class="font-bold u-font-32">{{orderInfo.orderAmount.toFixed(2)}}</text>
<text class="font-bold u-font-32">{{orderInfo.originAmount.toFixed(2)}}</text>
</view>
</template>
<template v-else>
@@ -523,7 +523,7 @@
return props.orderInfo.productCouponDiscountAmount
}
const goodsPrice = props.data.reduce((a, b) => {
const curTotal = b.info.filter(v => v.gift != true && v.userCouponId).reduce((prve,
const curTotal = b.info.filter(v => !v.isGift && v.userCouponId).reduce((prve,
cur) => {
const isVip = props.user.isVip && cur.isMember
const memberPrice = cur.memberPrice ? cur.memberPrice : cur.price
@@ -540,6 +540,7 @@
* 已优惠金额
*/
const youhuiAllPrice = computed(() => {
console.log(productCoupPrice)
const n = props.orderInfo.originAmount - props.orderInfo.orderAmount + vipDiscountPrice.value * 1
return (n < 0 ? 0 : n).toFixed(2)
})

View File

@@ -55,10 +55,10 @@
import {hasPermission} from '@/commons/utils/hasPermission.js'
import OrderDetail from './page.js'
import { getHistoryOrder, refundOrder,getOrderById,printOrder } from '@/api/order.js'
import { shopStaffDetail } from '@/api/staff.js'
import { shopUserDetail } from '@/api/shopUser.js'
import { getShopInfo } from '@/api/shop.js'
import { getHistoryOrder, refundOrder,getOrderById,printOrder } from '@/http/api/order.js'
import { shopStaffDetail } from '@/http/api/staff.js'
import { shopUserDetail } from '@/http/api/shopUser.js'
import { getShopInfo } from '@/http/api/shop.js'
const tuicai = reactive({
show: false,
@@ -100,6 +100,7 @@
function getShopInfoData () {
getShopInfo({id:uni.getStorageSync('shopInfo').id}).then(res=>{
pageData.shopInfo = res;
uni.setStorageSync('shopInfo',res)
})
}

View File

@@ -11,7 +11,7 @@
<order-list @printOrder="onPrintOrder" :list="pageData.list"></order-list>
<template v-if="pageData.list.length>0">
<my-pagination @change="pageChange" :totalElements="pageData.total"></my-pagination>
<my-pagination :page="pageData.query.page" @change="pageChange" :totalElements="pageData.total"></my-pagination>
</template>
<view style="height: 100rpx;"></view>
</view>
@@ -25,7 +25,7 @@
import orderList from './compoents/order-list.vue';
import infoBox from '@/commons/utils/infoBox.js'
import {getTodayTimestamps} from '@/commons/utils/dayjs-time.js';
import { getOrderList,printOrder } from '@/api/order.js'
import { getOrderList,printOrder } from '@/http/api/order.js'
const search = reactive({
placeholder: '搜索单号/商品名称',

View File

@@ -252,12 +252,12 @@
returnProductCanUseNum
} from '../quan_util.js'
import { getCouponList } from '@/api/coupon.js'
import { getHistoryOrder } from '@/api/order.js'
import { getPayTypeList } from '@/api/payType.js'
import { scanPay,microPay,cashPay,vipPay,creditPay,getOrderPayUrl } from '@/api/pay.js'
import { shopUserDetail } from '@/api/shopUser.js'
import { calcUsablePoints,calcDeductionAmount,payedDeductPoints,consumeAwardPoints } from '@/api/points.js'
import { getCouponList } from '@/http/api/coupon.js'
import { getHistoryOrder } from '@/http/api/order.js'
import { getPayTypeList } from '@/http/api/payType.js'
import { scanPay,microPay,cashPay,vipPay,creditPay,getOrderPayUrl } from '@/http/api/pay.js'
import { shopUserDetail } from '@/http/api/shopUser.js'
import { calcUsablePoints,calcDeductionAmount,payedDeductPoints,consumeAwardPoints } from '@/http/api/points.js'
const modal = reactive({
@@ -405,7 +405,7 @@
let goodsPrice = pageData.goodsList.filter(v => v.price != 0 && v.status !== "return").reduce((a, b) => {
return a + (b.num * b.price)
}, 0)
return (goodsPrice + (pageData.seatNum||0) + packAmount.value).toFixed(2)
return (goodsPrice + (pageData.seatNum*uni.getStorageSync("shopInfo").tableFee||0) + packAmount.value).toFixed(2)
}
})
@@ -626,7 +626,6 @@
coup.number)
const number = Math.min($goodsPayPriceMap[coup.proId].length, coupUseNum)
coup.number = number
console.log($goodsPayPriceMap[coup.proId]);
const findGoods = order.detailList.find(v => v.productId == coup.proId)
const isMember = findGoods.isMember
coup.discountAmount = returnProductCoupAllPrice($goodsPayPriceMap[coup.proId],

View File

@@ -144,9 +144,9 @@
returnProductCoupon,
returnCanUseFullReductionCoupon
} from '../quan_util.js'
import { getHistoryOrder } from '@/api/order.js'
import { shopUserDetail } from '@/api/shopUser.js'
import { getFindCoupon } from '@/api/coupon.js'
import { getHistoryOrder } from '@/http/api/order.js'
import { shopUserDetail } from '@/http/api/shopUser.js'
import { getFindCoupon } from '@/http/api/coupon.js'
const modal = reactive({

View File

@@ -132,22 +132,24 @@ export function returnProCoupStartIndex(coupArr,index){
}
//返回商品数量从0到n每一个对应的价格对照表
export function returnGoodsPayPriceMap(goodsArr){
let goods_arr = [{}]
let goods_arr = []
Object.values(goodsArr).forEach(item=>{
goods_arr = [...goods_arr,...item]
goods_arr = [...goods_arr,...Object.values(item)]
})
console.log(goods_arr)
return goods_arr.reduce((prve,cur)=>{
if(!prve.hasOwnProperty(cur.productId)){
prve[cur.productId]=[]
}
let arr=new Array(cur.num).fill(cur).map(v=>{
console.log(Math.ceil(cur.num))
let arr = new Array(Math.ceil(cur.num)).fill(cur).map(v=>{
return {
memberPrice:v.memberPrice?v.memberPrice:v.price,
price:v.price
}
})
prve[cur.productId].push(...arr)
console.log(prve)
return prve
},{})

View File

@@ -91,7 +91,7 @@
import color from '@/commons/color.js';
import infoBox from '@/commons/utils/infoBox.js';
import {hasPermission} from '@/commons/utils/hasPermission.js'
import { refundOrder } from '@/api/order.js'
import { refundOrder } from '@/http/api/order.js'
let allTui = ref(false)
let note = ref('')
@@ -171,8 +171,8 @@
if (newval <= 0) {
newval = 0;
}
if (newval >= item.num) {
newval = item.num;
if (newval >= (item.num-(item.refundNum>0?item.refundNum:0))) {
newval = (item.num-(item.refundNum>0?item.refundNum:0));
}
item.number = newval;
allTui.value = totalNumber.value == tuikuanNumber.value ? true : false;