From 851a905cb3ae2d2b6cecee17df8ca9d98b27c56d Mon Sep 17 00:00:00 2001 From: Wik-T <812952667@qq.com> Date: Fri, 14 Oct 2022 11:51:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 2 + Utils/Api.js | 172 +++++++++-------- pages/goods/goods-list/goods-list.vue | 12 +- pages/order/confirmation.vue | 167 ++++++++++++++-- pages/tabBar/home/home.vue | 179 +++--------------- .../mineCouponsDestails.vue | 12 +- subPages/coupon-package/coupon-package.vue | 12 +- subPages/recharge/recharge.vue | 12 +- .../unionComfirmation/unionComfirmation.vue | 4 +- 9 files changed, 327 insertions(+), 245 deletions(-) diff --git a/App.vue b/App.vue index fc1b4eb..659a93a 100644 --- a/App.vue +++ b/App.vue @@ -7,6 +7,7 @@ //正式 // url: 'https://hsg.dctpay.com/crest', // v1url:'https://hsg.dctpay.com/v1', + // orderurl:' https://hsg.dctpay.com/order', // imgUrl: 'https://hsg.dctpay.com/filesystem/', // brestUrl: 'https://hsg.dctpay.com/brest', // imageWxImg: 'https://hsg.dctpay.com/filesystem/wxApplets/', @@ -14,6 +15,7 @@ //测试 url: 'https://hsgcs.dctpay.com/crest', v1url: 'https://hsgcs.dctpay.com/v1', + orderurl:' https://hsgcs.dctpay.com/order', brestUrl: 'https://hsgcs.dctpay.com/brest', imgUrl: 'https://hsgcs.dctpay.com/filesystem/', imageWxImg: 'https://hsgcs.dctpay.com/filesystem/wxApplets/', diff --git a/Utils/Api.js b/Utils/Api.js index 0359dd1..0045154 100644 --- a/Utils/Api.js +++ b/Utils/Api.js @@ -6,19 +6,20 @@ import { } from "./bRequest.js"; let app = getApp(); let base = app.globalData.url; +let orderbase = app.globalData.orderurl; let v1base = app.globalData.v1url; -let brestBase = app.globalData.brestUrl; -//公众号获取跳小程序参数 +let brestBase = app.globalData.brestUrl; +//公众号获取跳小程序参数 export const verifyWx = params => { return POST('GET', `${v1base}/wxMsg/verifyWx`, params).then(res => res.data); -} -//公众号获取跳转小程序地址 +} +//公众号获取跳转小程序地址 export const getScheme = params => { return POST('GET', `${v1base}/wxMsg/getScheme`, params).then(res => res.data); -} - - - +} + + + //根据code获取openId export const HandleCode = params => { return POST('GET', `${base}/wechat/handleCode`, params).then(res => res.data); @@ -119,11 +120,11 @@ export const orderToGoldPay = params => { //查询用户积分使用情况 export const getUserGoldRecList = params => { return POST('GET', `${base}/highGoldRec/getUserGoldRecList`, params).then(res => res.data); -} -//查询积分7天过期 +} +//查询积分7天过期 export const selectByExpiringSoon = params => { return POST('GET', `${base}/highGoldRec/selectByExpiringSoon`, params).then(res => res.data); -} +} //获取用户卡券 export const getUserCouponList = params => { return POST('GET', `${base}/coupon/getUserCouponList`, params).then(res => res.data); @@ -137,9 +138,9 @@ export const getUserNewCouponDetail = params => { return POST('GET', `${base}/coupon/getUserNewCouponDetail`, params).then(res => res.data); } //获取订单信息 -export const getUserOrderList = params => { - return POST('GET', `${base}/highOrder/getUserOrderList`, params).then(res => res.data); -} +// export const getUserOrderList = params => { +// return POST('GET', `${base}/highOrder/getUserOrderList`, params).then(res => res.data); +// } //取消订单 export const cancelOrder = params => { return POST('GET', `${base}/highOrder/cancelOrder`, params).then(res => res.data); @@ -147,11 +148,11 @@ export const cancelOrder = params => { //订单查询详情 export const getOrderById = params => { return POST('GET', `${base}/highOrder/getOrderById`, params).then(res => res.data); -} -//已完成未查看 +} +//已完成未查看 export const orderCheck = params => { return POST('GET', `${base}/highOrder/orderCheck`, params).then(res => res.data); -} +} //获取商户列表 export const getMerchantList = params => { @@ -173,18 +174,18 @@ export const getUserOrderPreList = params => { //领取优惠券 export const receiveDiscount = params => { return POST('POST', `${base}/userDiscount/receiveDiscount`, params).then(res => res.data); -} - -//领取优惠券 +} + +//领取优惠券 export const receive = params => { return POST('POST', `${base}/userDiscount/receive`, params).then(res => res.data); -} - -//根据code查询优惠券 +} + +//根据code查询优惠券 export const getDiscountByCode = params => { return POST('GET', `${base}/discount/getDiscountByCode`, params).then(res => res.data); -} - +} + // 根据优惠券查卡券 export const getCouponByDiscount = params => { @@ -233,11 +234,11 @@ export const oilPriceCompute = params => { //团油计算新价格 export const oilPriceDiscountCompute = params => { return POST('GET', `${base}/highGas/oilPriceDiscountCompute`, params).then(res => res.data); -} -//在线加油优惠券 +} +//在线加油优惠券 export const canUseDiscount = params => { return POST('POST', `${base}/userDiscount/canUseDiscount`, params).then(res => res.data); -} +} //查询卡数据字典 export const getDictionaryByCodeType = params => { return POST('GET', `${base}/common/getDictionaryByCodeType`, params).then(res => res.data); @@ -351,11 +352,11 @@ export const getWinLotteryList = params => { //跳转是否赠券 export const getMembershipLevel = params => { return POST('GET', `${base}/highUser/GetMembershipLevel`, params).then(res => res.data); -} -//查询配置方式 +} +//查询配置方式 export const getThirdPartyByDetail = params => { return POST('GET', `${base}/highThirdParty/getThirdPartyByDetail`, params).then(res => res.data); -} +} /** * 肯德基地址 */ @@ -365,29 +366,29 @@ export const getTPigKFCToken = params => { //查询城市列表 export const getAllCity = params => { return POST('GET', `${base}/highThirdParty/getAllCity`, params).then(res => res.data); -} -//首页城市选择 +} +//首页城市选择 export const findCompanyByCityName = params => { return POST('GET', `${base}/common/findCompanyByCityName`, params).then(res => res.data); -} +} //查询肯德基门店列表 export const getKfcStoresList = params => { return POST('GET', `${base}/highThirdParty/getKfcStoresList`, params).then(res => res.data); -} -//肯德基商品详情 +} +//肯德基商品详情 export const listByStoreCode = params => { return POST('GET', `${base}/highThirdParty/listByStoreCode`, params).then(res => res.data); -} -//肯德基订单详情 +} +//肯德基订单详情 export const getThirdOrderByOrderId = params => { return POST('GET', `${base}/highThirdParty/getThirdOrderByOrderId`, params).then(res => res.data); -} -//肯德基,星巴克取消订单 +} +//肯德基,星巴克取消订单 export const thirdCancelOrder = params => { return POST('GET', `${base}/highThirdParty/thirdCancelOrder`, params).then(res => res.data); -} - +} + //电影票 @@ -403,40 +404,40 @@ export const getStarbucksStore = params => { export const getStarbucksProducts = params => { return POST('GET', `${base}/highThirdParty/getStarbucksProducts`, params).then(res => res.data); } -//微信支付千猪 +//微信支付千猪 export const qianzhuorderToPayByWx = params => { return POST('POST', `${base}/thirdOrder/orderToPayByWx`, params).then(res => res.data); -} -//星巴克下单 +} +//星巴克下单 export const xbkaddOrder = params => { return POST('POST', `${base}/highThirdParty/addOrder`, params).then(res => res.data); -} - -//会员充值产品 +} + +//会员充值产品 export const getMemberProducts = params => { return POST('GET', `${base}/highThirdParty/getMemberProducts`, params).then(res => res.data); -} - -//分销统计数据 +} + +//分销统计数据 export const userDistributionStatistics = params => { return POST('GET', `${base}/highUser/userDistributionStatistics`, params).then(res => res.data); -} -//邀请列表 +} +//邀请列表 export const distributionInviteList = params => { return POST('GET', `${base}/highUser/distributionInviteList`, params).then(res => res.data); -} -//分销用户积分列表 +} +//分销用户积分列表 export const distributionOrderList = params => { return POST('GET', `${base}/highUser/distributionOrderList`, params).then(res => res.data); -} -//分销用户积分列表 +} +//分销用户积分列表 export const promoteOrderList = params => { return POST('GET', `${base}/highUser/promoteOrderList`, params).then(res => res.data); -} -//生成海报 +} +//生成海报 export const promotionalPosters = params => { return POST('GET', `${base}/highUser/promotionalPosters`, params).then(res => res.data); -} +} export const qzOrderToPay = params => { return POST('POST', `${base}/order/qzOrderToPay`, params).then(res => res.data); @@ -449,25 +450,25 @@ export const getGatewayToken = params => { export const cancelOrderByOrderNo = params => { return POST('GET', `${base}/highOrder/cancelOrderByOrderNo`, params).then(res => res.data); } - -//中石油生成二维码 + +//中石油生成二维码 export const getVerifyQRCode = params => { return POST('GET', `${base}/coupon/getVerifyQRCode`, params).then(res => res.data); -} +} /** * H5 获取用户信息 - */ - -//判断是否有手机号 + */ + +//判断是否有手机号 export const getH5AccessByOpenId = params => { return POST('GET', `${base}/wechat/getH5AccessByOpenId`, params).then(res => res.data); } - -//h5静默登陆 + +//h5静默登陆 export const loginBySilence = params => { return POST('GET', `${base}/wechat/loginBySilence`, params).then(res => res.data); -} +} export const getH5UserInfo = params => { return POST('GET', `${base}/wechat/getH5UserInfo`, params).then(res => res.data); @@ -515,8 +516,8 @@ export const getCodeListByAgentCoupon = params => { // 生成二维码 export const generateCode = params => { return POSTBREST('POST', `${brestBase}/highCouponAgent/generateCode`, params).then(res => res.data); -} - +} + // 兑换码填写备注 export const highremark = params => { @@ -604,17 +605,36 @@ export const orderToPayByWx = params => { //工会卡支付 export const hltUnionCardPayghk = params => { return POST('POST', `${base}/czOrder/hltUnionCardPay`, params).then(res => res.data); -} +} export const czhltUnionCardPay = params => { return POST('POST', `${base}/thirdOrder/hltUnionCardPay`, params).then(res => res.data); -} +} //话费列表 export const getUserOrderListhuafei = params => { return POST('GET', `${base}/outRechargeOrder/getUserOrderList`, params).then(res => res.data); -} - -//肯德基返利 +} + +//肯德基返利 export const getRebateIntegral = params => { return POST('POST', `${base}/common/getRebateIntegral`, params).then(res => res.data); +} + + +// -----------订单新接口------------ +//新建订单 +export const create = params => { + return POST('POST', `${orderbase}/create`, params).then(res => res.data); +} +//获取订单列表 +export const getUserOrderList = params => { + return POST('GET', `${orderbase}/getUserOrderList`, params).then(res => res.data); +} +//订单详情 +export const getDetailByOrderNo = params => { + return POST('GET', `${orderbase}/getDetailByOrderNo`, params).then(res => res.data); +} +//取消订单 +export const cancel = params => { + return POST('POST', `${orderbase}/cancel`, params).then(res => res.data); } diff --git a/pages/goods/goods-list/goods-list.vue b/pages/goods/goods-list/goods-list.vue index a99c9d9..453e332 100644 --- a/pages/goods/goods-list/goods-list.vue +++ b/pages/goods/goods-list/goods-list.vue @@ -185,9 +185,17 @@ this.getCouponListArea(); }, //获取弹出或者弹窗 - getCmsContent(item) { + getCmsContent(item) { + let code; + // #ifdef H5 + code = '2' + // #endif + // #ifdef MP + code = '1' + // #endif let params = { - regionId: app.globalData.cityId, + companyId: app.globalData.companyId, + platform: code, categoryCode: item } getCmsContent(params).then(res => { diff --git a/pages/order/confirmation.vue b/pages/order/confirmation.vue index 5903071..e83e383 100644 --- a/pages/order/confirmation.vue +++ b/pages/order/confirmation.vue @@ -95,7 +95,55 @@ - + + + + + 积分抵扣 + + + 0 + + + {{availIntegal}} + + + + + + 抵扣金额 + + + ¥{{priceValue[1] / 100}} + + + + + + + + 下单返积分 + + + 返{{rebateIntegral}}积分 + + + {{rebateIntegral}} + + + + + 积分抵扣与优惠券抵扣不同享 + + + 支付方式: import { - addOrder, + addOrder, + create, getCouponById, loginByPhone, getUserNormalDiscountList, orderToPay, orderToGoldPay, findUser, - hltUnionCardPay, - getHuiLianTongCardBalance + hltUnionCardPay, + getRebateIntegral, + getHuiLianTongCardBalance, + findById } from '../../Utils/Api.js'; - import wybPopup from '../../components/wyb-popup/wyb-popup.vue'; + import wybPopup from '../../components/wyb-popup/wyb-popup.vue'; + import cjSlider from '../../components/cj-slider/cj-slider.vue'; import ssPaymentPassword from '../../components/sanshui-payment-password' let app = getApp(); // #ifdef H5 @@ -243,7 +295,15 @@ coupondiscountid: '', orderDetails: '', //订单详情 payGold: '', //积分数 - identificationCode: '' //渠道商 + identificationCode: '' ,//渠道商 + paytypeList: [], //支付方式 + priceValue: [0, 0], // 积分可以指定默认值 + changePrice: '', //滑动值 + isDiscount: true, + availIntegal: '', // 可用积分 + isUse: true, // 是否禁用状态 + rebateIntegral: '', //返回积分 + Integrastu: 1 //返积分状态 }; }, onLoad(option) { @@ -289,24 +349,79 @@ return `${year}${spe}${month}${spe}${day} ${h}:${mm}:${s}`; } }, - methods: { + methods: { + //查询详情 + findById() { + uni.showLoading({ + title: '加载中' + }) + let showType; + // #ifdef H5 + showType = 2; + // #endif + // #ifdef MP + showType = 1; + // #endif + let datas = { + platformId: showType, + id: this.objectId + } + findById(datas).then(res => { + if (res.return_code == '000000') { + uni.hideLoading(); + this.rechargeDes = res.return_data; + this.paytypeList = res.return_data.productPayTypeString.split(','); + this.paytypeList = this.paytypeList.slice(0, this.paytypeList.length - 1); + let zkprice = parseFloat(res.return_data.integralDiscount / 100).toFixed(2); + let pprice = parseFloat(res.return_data.payPrice * 100).toFixed(0) + let payprice = parseFloat(res.return_data.payPrice * 100 * zkprice).toFixed( + 0); + if (payprice > this.user.gold) { + this.availIntegal = this.user.gold; + } else { + this.availIntegal = payprice; + } + } + }); + }, //查询积分 findUser() { let params; findUser(params).then(res => { if (res.return_code == '000000') { app.globalData.userInfo = res.return_data; - this.user = res.return_data; + this.user = res.return_data; + this.availIntegal = res.return_data.gold; + this.findById(); if (this.user.hltCardNo) { - this.getHuiLianTongCardBalance(); + this.getHuiLianTongCardBalance(); } - this.getUserNormalDiscountList(); + this.getUserNormalDiscountList(); + this.getRebateIntegral(); uni.setStorage({ key: "user", data: res.return_data }) } }); + }, + //支付返利积分 + getRebateIntegral() { + let datas = { + "companyId": app.globalData.companyId, + "price": this.paytheprice, + "productId": 1, + "type": 1, + } + getRebateIntegral(datas).then(res => { + if (res.return_code == '000000') { + this.rebateIntegral = res.return_data; + this.Integrastu = 1; + } else { + this.rebateIntegral = res.return_msg; + this.Integrastu = 2; + } + }) }, //查询卡券详情 getCouponById() { @@ -833,7 +948,31 @@ duration: 4000 }); }); - }, + }, + + blockStart() {}, + blockMoving() { + // console.log('正在滑动中') + }, + //滑动结束 + blockEnd() { + this.isDiscount = 1; + if (this.deductionPrice == 0) { + this.payPrice = parseFloat(this.saveprice - parseFloat(this.priceValue[1] / 100).toFixed(2)).toFixed( + 2); + } else { + this.payPrice = parseFloat(this.orderPrice - parseFloat(this.priceValue[1] / 100).toFixed(2) - this + .deductionPrice).toFixed(2); + } + if (this.payPrice == 0) { + this.isUse = false; + this.paytype = ''; + } else { + this.isUse = true; + } + this.getRebateIntegral(); + }, + //跳转积分充值 jumpdeposits() { uni.navigateTo({ @@ -859,6 +998,12 @@ width: 40rpx; height: 40rpx; margin-top: 30rpx; + } + + .cj-slider { + width: 100%; + align-items: center; + display: flex; } .goodsimg { diff --git a/pages/tabBar/home/home.vue b/pages/tabBar/home/home.vue index d363cb3..bf60002 100644 --- a/pages/tabBar/home/home.vue +++ b/pages/tabBar/home/home.vue @@ -35,8 +35,8 @@ - + @@ -49,8 +49,8 @@ - + @@ -89,7 +89,8 @@ - + {{item.name}} @@ -108,7 +109,8 @@ {{goods.title}} - {{goods.effectiveTiem | timeFormat('yyyy-mm-dd hh:mm:ss')}} + + {{goods.effectiveTiem | timeFormat('yyyy-mm-dd hh:mm:ss')}} ¥{{goods.price}} @@ -120,11 +122,15 @@ + :src="imageUrl+item.childCategory[0].imgData" + @click="goGoodsList(item.childCategory[0].jumpUrl)"> - - - + + +