diff --git a/config/api/coupon.js b/config/api/coupon.js new file mode 100644 index 0000000..5041c62 --- /dev/null +++ b/config/api/coupon.js @@ -0,0 +1,39 @@ +import request from '../http' + +// 按场地查询可用优惠券 +export const getCouponsByPosition = (positionId) => { + return request({ + url: `/device/coupon/app/position/${positionId}`, + method: 'get' + }) +} + +// 创建优惠券支付订单 +export const createCouponPayment = (couponId) => { + return request({ + url: '/app/coupon/pay', + method: 'post', + data: { + couponId + } + }) +} + +// 查询用户优惠券 +export const getUserCoupons = (status) => { + return request({ + url: '/device/userPurchase/app/my', + method: 'get', + data: { + status + } + }) +} + + +export const cancelCouponPayment = (orderNo) => { + return request({ + url: `/device/userPurchase/app/cancel/${orderNo}`, + method: 'post' + }) +} diff --git a/config/api/member.js b/config/api/member.js new file mode 100644 index 0000000..fbc9d10 --- /dev/null +++ b/config/api/member.js @@ -0,0 +1,39 @@ +import request from '../http' + +// 创建会员卡支付订单 +export const createMemberCardPayment = (memberCardId) => { + return request({ + url: '/app/member/pay', + method: 'post', + data: { + memberCardId + } + }) +} + + + +// 根据场地ID查询可用会员卡列表 +export const getMemberCardsByPosition = (positionId) => { + return request({ + url: `/device/memberCard/app/position/${positionId}`, + method: 'get' + }) +} + + +//根据状态查询个人会员卡 +export const getMemberCardsByStatus = () => { + return request({ + url: `/device/userMemberCard/app/my`, + method: 'get' + }) +} + +// 取消会员卡支付订单 +export const cancelMemberCardPayment = (orderNo) => { + return request({ + url: `/device/userMemberCard/app/cancel/${orderNo}`, + method: 'post' + }) +} diff --git a/config/url.js b/config/url.js index 914ef91..f1c0198 100644 --- a/config/url.js +++ b/config/url.js @@ -1,7 +1,7 @@ // export const URL = "https://my.gxfs123.com/api" //正式服务器-弃用 -export const URL = "https://manager.fdzpower.com/api" //正式服务器 -// export const URL = "https://fansdev.gxfs123.com/api" //测试服务器 -// export const URL = "http://192.168.5.30:8080" //本地调试 +// export const URL = "https://manager.fdzpower.com/api" //正式服务器 +export const URL = "https://fansdev.gxfs123.com/api" //测试服务器 +// export const URL = "http://192.168.5.52:8080" //本地调试 // export const URL = "http://127.0.0.1:8080" //本地调试 export const appid = "wx2165f0be356ae7a9" //微信小程序appid diff --git a/locale/en-US.js b/locale/en-US.js index de3a1c4..97126cb 100644 --- a/locale/en-US.js +++ b/locale/en-US.js @@ -52,7 +52,8 @@ export default { refresh: 'Refresh', pull: 'Pull to refresh', release: 'Release to refresh', - noMore: 'No more' + noMore: 'No more', + functionDeveloping: 'Function under development' }, nav: { @@ -145,7 +146,9 @@ export default { rentSuccess: 'Rent successful', rentFailedRetry: 'Rent failed, please retry', getPayParamsFailed: 'Failed to get payment parameters', - payScoreFailedCancelled: 'Pay score call failed, order cancelled' + payScoreFailedCancelled: 'Pay score call failed, order cancelled', + canUsePromotion: 'Tips: Coupons and membership cards available', + goToBuy: 'Buy Now' }, order: { @@ -272,6 +275,8 @@ export default { quickReturnDesc: '(View active orders)', expressReturn: 'Express Return', myOrders: 'Orders', + myCards: 'My Cards', + myCoupons: 'My Coupons', customerService: 'Support', feedback: 'Feedback', businessLicense: 'License', @@ -682,6 +687,64 @@ export default { nicknameUpdated: 'Nickname updated successfully', updateFailed: 'Update failed', uploading: 'Uploading...' + }, + + purchase: { + title: 'Offers', + memberCard: 'Member Card', + coupon: 'Coupon', + buyNow: 'Buy Now', + myCards: 'My Cards', + myCoupons: 'My Coupons', + cardDescription: 'Card Description', + couponDescription: 'Coupon Description', + pleaseSelect: 'Please select a product to purchase', + noCards: 'No cards available', + noCoupons: 'No coupons available', + cardUseInstruction: 'Usage Instructions', + cardValidityPeriod: 'Validity Period', + cardRefundPolicy: 'Refund Policy', + cardUseDescription: 'Membership card takes effect immediately after purchase and can be used at designated locations. Per-use cards are charged by number of uses, time-based cards are charged by duration. Please choose the appropriate card type according to your actual needs.', + cardValidityDescription: 'Membership card takes effect from the date of purchase, with validity periods varying by card type. Per-use cards expire when all uses are consumed within the validity period, and time-based cards expire when the accumulated usage duration reaches the limit within the validity period.', + cardRefundDescription: 'Refunds are not supported after purchasing membership cards. Unused portions can continue to be used within the validity period. In case of special circumstances requiring a refund, please contact customer service for processing.', + couponUseInstruction: 'Usage Instructions', + couponValidityPeriod: 'Validity Period', + couponUsageScope: 'Usage Scope', + couponUseDescription: 'Coupons take effect immediately after purchase and can be used at checkout. Only one coupon can be used per order, and coupons cannot be stacked with other promotional offers.', + couponValidityDescription: 'Coupons take effect from the date of purchase, please use within the validity period. After expiration, coupons will automatically become invalid and cannot be extended.', + couponUsageDescription: 'Coupons can be used at designated locations. Please check the coupon details for specific available locations. Some coupons have minimum spending requirements, please pay attention to the usage conditions.' + }, + + myCard: { + type: 'Type', + timesCard: 'Times Card', + durationCard: 'Duration Card', + remainingTimes: 'Remaining Times', + remainingDuration: 'Remaining Duration', + hours: 'Hours', + validPeriod: 'Valid Period', + active: 'Active', + expired: 'Expired', + used: 'Used Up', + position: 'Usage Location', + price: 'Purchase Price', + noCards: 'No cards', + buyNow: 'Buy Now', + getListFailed: 'Failed to get card list' + }, + + myCoupon: { + available: 'Available', + used: 'Used', + expired: 'Expired', + useNow: 'Use Now', + usedStatus: 'Used', + expiredStatus: 'Expired', + noAvailableCoupons: 'No available coupons', + noUsedCoupons: 'No used coupons', + noExpiredCoupons: 'No expired coupons', + buyNow: 'Buy Now', + getListFailed: 'Failed to get coupon list' } } diff --git a/locale/zh-CN.js b/locale/zh-CN.js index deded74..e735b78 100644 --- a/locale/zh-CN.js +++ b/locale/zh-CN.js @@ -52,7 +52,8 @@ export default { refresh: '刷新', pull: '下拉刷新', release: '释放刷新', - noMore: '没有更多了' + noMore: '没有更多了', + functionDeveloping: '功能开发中' }, nav: { @@ -145,7 +146,9 @@ export default { rentSuccess: '租借成功', rentFailedRetry: '租借失败,请重试', getPayParamsFailed: '获取支付参数失败', - payScoreFailedCancelled: '支付分调用失败,订单已取消' + payScoreFailedCancelled: '支付分调用失败,订单已取消', + canUsePromotion: '提示:可使用优惠券、会员卡', + goToBuy: '去购买' }, order: { @@ -272,6 +275,8 @@ export default { quickReturnDesc: '(直接查看使用中的订单)', expressReturn: '快递归还记录', myOrders: '我的订单', + myCards: '我的会员卡', + myCoupons: '我的优惠券', customerService: '客服中心', feedback: '投诉与建议', businessLicense: '营业资质', @@ -682,6 +687,64 @@ export default { nicknameUpdated: '昵称修改成功', updateFailed: '修改失败', uploading: '上传中...' + }, + + purchase: { + title: '优惠专区', + memberCard: '会员卡', + coupon: '优惠券', + buyNow: '立即购买', + myCards: '我的会员卡', + myCoupons: '我的优惠券', + cardDescription: '会员卡说明', + couponDescription: '优惠券说明', + pleaseSelect: '请选择要购买的商品', + noCards: '暂无可用会员卡', + noCoupons: '暂无可用优惠券', + cardUseInstruction: '使用说明', + cardValidityPeriod: '有效期限', + cardRefundPolicy: '退款说明', + cardUseDescription: '会员卡购买后即时生效,可在指定场地使用。次卡按使用次数计费,时长卡按使用时长计费,请根据您的实际需求选择合适的卡种。', + cardValidityDescription: '会员卡自购买之日起生效,有效期根据卡种不同而有所区别。次卡在有效期内使用完毕即失效,时长卡在有效期内累计使用时长达到后失效。', + cardRefundDescription: '会员卡购买后不支持退款,未使用部分可以在有效期内继续使用。如遇特殊情况需要退款,请联系客服进行处理。', + couponUseInstruction: '使用说明', + couponValidityPeriod: '有效期限', + couponUsageScope: '使用范围', + couponUseDescription: '优惠券购买后即时生效,可在订单结算时使用。每张订单仅可使用一张优惠券,优惠券不可与其他优惠活动叠加使用。', + couponValidityDescription: '优惠券自购买之日起生效,请在有效期内使用。过期后优惠券将自动失效,不可延期使用。', + couponUsageDescription: '优惠券可在指定场地使用,具体可用场地请查看优惠券详情。部分优惠券有最低消费门槛要求,请注意查看使用条件。' + }, + + myCard: { + type: '类型', + timesCard: '次卡', + durationCard: '时长卡', + remainingTimes: '剩余次数', + remainingDuration: '剩余时长', + hours: '小时', + validPeriod: '有效期', + active: '使用中', + expired: '已过期', + used: '已用完', + position: '使用地点', + price: '购买价格', + noCards: '暂无会员卡', + buyNow: '立即购买', + getListFailed: '获取会员卡列表失败' + }, + + myCoupon: { + available: '可使用', + used: '已使用', + expired: '已过期', + useNow: '立即使用', + usedStatus: '已使用', + expiredStatus: '已过期', + noAvailableCoupons: '暂无可用优惠券', + noUsedCoupons: '暂无已使用优惠券', + noExpiredCoupons: '暂无已过期优惠券', + buyNow: '立即购买', + getListFailed: '获取优惠券列表失败' } } diff --git a/pages.json b/pages.json index dfb941f..fedef6e 100644 --- a/pages.json +++ b/pages.json @@ -248,6 +248,30 @@ "navigationBarBackgroundColor": "#ffffff", "navigationBarTextStyle": "black" } + }, + { + "path": "pages/purchase/index", + "style": { + "navigationBarTitleText": "优惠专区", + "navigationBarBackgroundColor": "#ffffff", + "navigationBarTextStyle": "black" + } + }, + { + "path": "pages/my/card", + "style": { + "navigationBarTitleText": "", + "navigationBarBackgroundColor": "#ffffff", + "navigationBarTextStyle": "black" + } + }, + { + "path": "pages/my/coupon", + "style": { + "navigationBarTitleText": "", + "navigationBarBackgroundColor": "#ffffff", + "navigationBarTextStyle": "black" + } } ], "globalStyle": { diff --git a/pages/device/detail.vue b/pages/device/detail.vue index d231845..1a6b168 100644 --- a/pages/device/detail.vue +++ b/pages/device/detail.vue @@ -4,7 +4,7 @@ - + {{ deviceLocation }} @@ -23,16 +23,16 @@ {{ $t('device.pricingRules') }} - - - ¥ - {{ deviceFeeConfig.maxHourPrice || '5.00' }} - /{{ getPriceUnit() }} + + + ¥ + {{ deviceFeeConfig.maxHourPrice || '5.00' }} + /{{ getPriceUnit() }} + + + {{ deviceInfo.depositAmount || '99' }}{{ $t('device.capLimit') }} + - - {{ deviceInfo.depositAmount || '99' }}{{ $t('device.capLimit') }} - - @@ -69,6 +69,16 @@ + + + {{ $t('device.canUsePromotion') }} + + + {{ $t('device.goToBuy') }} + + + +