diff --git a/src/api/goods/index.ts b/src/api/goods/index.ts index 42466ab..58e330c 100644 --- a/src/api/goods/index.ts +++ b/src/api/goods/index.ts @@ -24,3 +24,4 @@ export const getOrderList = (data: { payStatus: number } }) => post({ url: URL.orderList, data }); + diff --git a/src/api/goods/types.ts b/src/api/goods/types.ts index 1522d8a..6d456d5 100644 --- a/src/api/goods/types.ts +++ b/src/api/goods/types.ts @@ -26,6 +26,7 @@ export interface GoodsBean { price: number; send_num: number; price_ext: number; + payPrice: number; profile: string; remark: string; remark1: string; @@ -44,6 +45,15 @@ export interface GoodsBean { update_time: string; years_id: string; years_name: string; + + /*extra params*/ + goodsNum: number; + salePrice: number; + originPrice: number; + consumePrice: number; + stockStock: StockBean + checkedStock: StockBean; + checked: boolean | false; } export interface StockBean { diff --git a/src/api/groupbuy/index.ts b/src/api/groupbuy/index.ts index 940d634..c7274ad 100644 --- a/src/api/groupbuy/index.ts +++ b/src/api/groupbuy/index.ts @@ -1,4 +1,6 @@ import { get, post } from '@/utils/request'; +import { GroupBuyBean, RecordBean } from '@/api/groupbuy/types'; +import { GoodsBean } from '@/api/goods/types'; export const getGroupBuyList = (data: { pageNum: number, @@ -9,11 +11,14 @@ export const getGroupBuyList = (data: { }) => post({ url: '/group/coupons/wx_query', data }); export const getGroupBuyDetail = ( - id: string) => get({ url: `wechat/coupons/group/get/${id}` }); + id: string) => get({ url: `wechat/coupons/group/get/${id}` }); -export const getGroupBuyRecordList = (groupId: string, pageNum: number, pageSize: number) => post({ +export const getGroupBuyRecordList = (groupId: string, pageNum: number, pageSize: number) => post({ url: `wechat/coupons/group/order/list?groupId=${groupId}&pageNum=${pageNum}&pageSize=${pageSize}` }); -export const preOrder = (data: any) => post({ url: 'wechat/coupons/group/pre_v2', data }); +export const preOrder = (data: any) => post({ url: 'wechat/coupons/group/pre_v2', data }); + +export const progress = (data: any) => post({ url: 'wechat/coupons/group/pay/progress', data }); +export const pay = (data: any) => post({ url: 'wechat/coupons/group/pay', data }); diff --git a/src/api/groupbuy/types.ts b/src/api/groupbuy/types.ts new file mode 100644 index 0000000..5138ac2 --- /dev/null +++ b/src/api/groupbuy/types.ts @@ -0,0 +1,125 @@ +import { GoodsBean, StockBean } from '@/api/goods/types'; +import { CouponBean } from '@/api/user/types'; + +export interface GroupBuyBean { + companyId: string; + content: string; + couponsList: CouponBean[]; + createTime: string; + creatorId: string; + creatorName: string; + endDate: string; + fake: number; + goods: GoodsBean; + id: string; + name: string; + offsetPrice: number; + payPrice: number; + goodsPrice: number; + periodDay: number; + price: number; + publicNum: number; + sendNum: number; + startDate: string; + status: number; + threshold: number; + title: string; + totalNum: number; +} + +export interface RecordBean { + bizId: string; + createTime: string; + goodsCode: string; + goodsNum: number; + groupId: string; + memberImage: string; +} + +export interface OrderBean { + allowIntegral: boolean; + bizId: string; + classify: number; + companyId: string; + consignTime: string; + consumerId: string; + consumerName: string; + coupon: string; + couponIds: string; + couponsStatus: number; + createTime: string; + creatorId: number; + creatorName: string; + device: string; + discount: number; + discountPrice: number; + finishTime: string; + freePrice: number; + goodsNum: number; + id: string; + integral: number; + itemNum: number; + marketingPrice: number; + marketingText: string; + modifierIds: string; + needPaid: number; + ogList: any[]; + orderGoods: GoodsBean[]; + changeStockNum: number; + companyId: string; + consumePrice: number; + consumerId: string; + consumerName: string; + createTime: string; + creatorId: number; + creatorName: string; + discount: number; + discountOriginPrice: number; + discountPrice: number; + goodsCode: string; + goodsId: string; + goodsName: string; + goodsNum: number; + goodsPriceModify: string; + goodsTypeName: string; + id: string; + images: string; + offset: string; + orderId: string; + orderNo: string; + originPrice: number; + originStockNum: number; + priceModify: []; + produceIntegral: number; + remark: string; + salePrice: number; + stockId: string; + stockStock: StockBean[]; + storeId: string; + type: number; + typeName: string; + updateTime: string; + payStatus: number; + payTypeIds: string; + printed: string; + produceIntegralNumber: number; + profit: string; + reducePrice: number; + relatedId: string; + remark: string; + replacementOrder: string; + saleNum: number; + salers: []; + status: number; + storeId: string; + storeName: string; + storeOrder: string; + totalPrice: number; + transactionPrice: number; + type: number; + typeName: string; + updateTime: string; + updated: boolean; + useGold: number; + wholePrice: number; +} diff --git a/src/api/user/index.ts b/src/api/user/index.ts index f956869..33fffe5 100644 --- a/src/api/user/index.ts +++ b/src/api/user/index.ts @@ -1,7 +1,7 @@ /** * 用户信息相关接口 */ -import type { LoginParams, LoginResult, RegisterParams } from './types'; +import type { CouponBean, LoginParams, LoginResult, RegisterParams, TerminalBean } from './types'; import { get, post } from '@/utils/request'; import type { UserState } from '@/store/modules/user/types'; @@ -25,7 +25,8 @@ enum URL { rechargeList = '/ext/recharge/rule_config', recharge = '/memberIncoming/wx_save', couponList = '/wechat/coupons/coupons/pageList', - integralList = '/ext/member/integral_query' + integralList = '/ext/member/integral_query', + terminal = 'wechat/coupons/terminal?companyId=' } export const getUserProfile = () => get({ url: URL.profile }); @@ -49,6 +50,8 @@ export const getRechargeList = () => get({ url: URL.rechargeList }); export const recharge = (data: any) => post({ url: URL.recharge, data }); -export const getCouponList = (data: any) => post({ url: URL.couponList, data }); +export const getCouponList = (data: any) => post({ url: URL.couponList, data }); export const getIntegralList = (data: any) => get({ url: URL.integralList, data }); + +export const getTerminal = (companyId: string) => get({ url: URL.terminal + companyId }); diff --git a/src/api/user/types.ts b/src/api/user/types.ts index 4e34823..9f4d929 100644 --- a/src/api/user/types.ts +++ b/src/api/user/types.ts @@ -1,4 +1,4 @@ -import { UserState } from '@/store/modules/user/types'; +import { UserBean } from '@/store/modules/user/types'; export interface LoginParams { // phone: string; @@ -27,7 +27,7 @@ export interface LoginByCodeParams { export interface LoginResult { sessionKey: string; - user: UserState; + user: UserBean; userInfo: any; token: string; } @@ -40,3 +40,77 @@ export interface IntegralBean { type: number; value: number; } + +export interface CouponBean { + companyId: string; + couponsId: string; + createTime: string; + creatorId: number; + creatorName: string; + dayType: number; + endTime: string; + id: string; + images: string; + imcomingId: string; + memberId: string; + memberName: string; + name: string; + notice: number; + offsetPrice: number; + orderId: null; + periodDay: number; + reduce: number; + remark: string; + startTime: string; + status: number; + strategyType: string; + telephone: string; + threshold: string; + type: number; + userTime: string; +} + +export interface TerminalBean { + applyId: string; + bindId: string; + bindName: string; + bindStatus: number; + company: string; + companyId: string; + companyName: string; + contact: string; + createTime: string; + creatorId: string; + creatorName: string; + deviceRole: string; + employee: string; + expireTime: string; + id: string; + managerPermission: string; + name: string; + permission: { + deletablePer: boolean, + profitPer: boolean, + exportTypes: any[], + checkoutPer: boolean, + showPhoneNumber: boolean, + storePer: any[] + }; + checkoutPer: boolean; + deletablePer: boolean; + exportPer: boolean; + exportTypes: any[]; + profitPer: boolean; + showPhoneNumber: boolean; + storePer: any[]; + signDate: string; + status: number; + store: string; + storeId: string; + storeName: string; + storeOrder: number; + terminalKey: string; + terminalSn: string; + token: string; + type: number; +} diff --git a/src/components/sku-dialog.vue b/src/components/sku-dialog.vue index 4e3d796..f8e1f64 100644 --- a/src/components/sku-dialog.vue +++ b/src/components/sku-dialog.vue @@ -2,10 +2,10 @@ - + - {{ bean?.name }} - {{ bean?.price || 0 }} + {{ goodsDetailBean?.name }} + {{ flashPrice > 0 ? `${flashPrice}` : `${goodsDetailBean?.price}` || 0 }} @@ -50,46 +50,40 @@ @@ -360,7 +362,7 @@ const placeOrder = async () => { margin-left: 12rpx; margin-right: 12rpx; background: #FFFFFF; - border-radius: 7rpx 7rpx 7rpx 7rpx; + border-radius: 7rpx; color: #F32B2B; } @@ -467,7 +469,7 @@ const placeOrder = async () => { font-size: 24rpx; color: #999999; position: absolute; - top: 40rpx; + top: 50rpx; left: 100rpx; } } @@ -527,7 +529,7 @@ const placeOrder = async () => { .bottom-view { background: #FFFFFF; - padding: 20rpx 30rpx 78rpx 33rpx; + padding: 20rpx 30rpx 78rpx 30rpx; position: fixed; left: 0; right: 0; diff --git a/src/pages/common/groupbuy/order.vue b/src/pages/common/groupbuy/order.vue index eb24494..3c26bc1 100644 --- a/src/pages/common/groupbuy/order.vue +++ b/src/pages/common/groupbuy/order.vue @@ -2,21 +2,27 @@ - - - 商品名称 - 颜色、尺码 - + 实付 - ¥100 + ¥{{ orderBean?.totalPrice || 0 }} @@ -27,12 +33,57 @@