diff --git a/App.vue b/App.vue index 748b045..da88b8f 100644 --- a/App.vue +++ b/App.vue @@ -8,6 +8,7 @@ // url: 'https://hsg.dctpay.com/crest', // v1url:'https://hsg.dctpay.com/v1', // orderurl:' https://hsg.dctpay.com/order', + // userurl:'https://hsg.dctpay.com/user', // imgUrl: 'https://hsg.dctpay.com/filesystem/', // brestUrl: 'https://hsg.dctpay.com/brest', // imageWxImg: 'https://hsg.dctpay.com/filesystem/wxApplets/', @@ -16,6 +17,7 @@ url: 'https://hsgcs.dctpay.com/crest', v1url: 'https://hsgcs.dctpay.com/v1', orderurl:'https://hsgcs.dctpay.com/order', + userurl:'https://hsgcs.dctpay.com/user', 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 868959b..36d5a4f 100644 --- a/Utils/Api.js +++ b/Utils/Api.js @@ -7,6 +7,7 @@ import { let app = getApp(); let base = app.globalData.url; let orderbase = app.globalData.orderurl; +let userbase = app.globalData.userurl; let v1base = app.globalData.v1url; let brestBase = app.globalData.brestUrl; //公众号获取跳小程序参数 @@ -19,11 +20,6 @@ export const getScheme = params => { } - -//根据code获取openId -export const HandleCode = params => { - return POST('GET', `${base}/wechat/handleCode`, params).then(res => res.data); -} //微信登录获取手机号 export const GetPhoneNumber = params => { return POST('GET', `${base}/wechat/getPhoneNumber`, params).then(res => res.data); @@ -46,21 +42,13 @@ export const findByLatAndLng = params => { } //获取用户信息 -export const findUser = params => { - return POST('GET', `${base}/highUser/findUser`, params).then(res => res.data); -} -//绑定用户电话 -export const loginByPhone = params => { - return POST('GET', `${base}/wechat/loginByPhone`, params).then(res => res.data); -}; +// export const findUser = params => { +// return POST('GET', `${base}/highUser/findUser`, params).then(res => res.data); +// } //微信登录 export const WXlogin = params => { return POST('GET', `${base}/wechat/login`, params).then(res => res.data); }; -//H5 退出登录 -export const loginOut = params => { - return POST('GET', `${base}/user/loginOut`, params).then(res => res.data); -}; //通过openid获取用户的信息 export const OpenidGetUser = (openId, params) => { return POST('GET', `${base}/User/openid/${openId}`, params).then(res => res.data); @@ -137,10 +125,6 @@ export const getUserCouponDetail = params => { 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 cancelOrder = params => { return POST('GET', `${base}/highOrder/cancelOrder`, params).then(res => res.data); @@ -198,10 +182,6 @@ export const getCouponByDiscount = params => { export const againReceiveCoupon = params => { return POST('GET', `${base}/coupon/againReceiveCoupon`, params).then(res => res.data); } -//查询我的优惠券 -export const getUserDiscountList = params => { - return POST('GET', `${base}/userDiscount/getUserDiscountList`, params).then(res => res.data); -} //使用优惠券 export const useDiscount = params => { return POST('GET', `${base}/discount/useDiscount`, params).then(res => res.data); @@ -245,11 +225,7 @@ export const oilPriceDiscountCompute = params => { //在线加油优惠券 export const canUseDiscount = params => { return POST('POST', `${base}/userDiscount/canUseDiscount`, params).then(res => res.data); -} -//在线加油详情 -export const getOrderByOrderNo = params => { - return POST('GET', `${base}/gasOrder/getOrderByOrderNo`, params).then(res => res.data); -} +} //查询卡数据字典 export const getDictionaryByCodeType = params => { @@ -396,10 +372,6 @@ export const listByStoreCode = params => { export const getThirdOrderByOrderNo = params => { return POST('GET', `${base}/highThirdParty/getThirdOrderByOrderNo`, params).then(res => res.data); } -//肯德基,星巴克取消订单 -export const thirdCancelOrder = params => { - return POST('GET', `${base}/highThirdParty/thirdCancelOrder`, params).then(res => res.data); -} @@ -420,10 +392,6 @@ export const getStarbucksProducts = params => { 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 => { @@ -458,10 +426,6 @@ export const qzOrderToPay = params => { export const getGatewayToken = params => { return POST('GET', `${base}/tPig/getGatewayToken`, params).then(res => res.data); } -//取消订单 -export const cancelOrderByOrderNo = params => { - return POST('GET', `${base}/highOrder/cancelOrderByOrderNo`, params).then(res => res.data); -} //中石油生成二维码 export const getVerifyQRCode = params => { @@ -649,18 +613,63 @@ export const getDetailByOrderNo = params => { //取消订单 export const cancel = params => { return POST('POST', `${orderbase}/cancel`, params).then(res => res.data); -} -//微信支付 +} +//微信支付 export const wechatPay = params => { return POST('POST', `${orderbase}/orderPay/wechatPay`, params).then(res => res.data); -} -//工会卡、油卡 +} +//工会卡、油卡 export const cardPay = params => { return POST('POST', `${orderbase}/orderPay/cardPay`, params).then(res => res.data); -} - +} + //已完成未查看 export const orderCheck = params => { - return POST('GET', `${orderbase}/highOrder/orderCheck`, params).then(res => res.data); + return POST('GET', `${orderbase}/orderCheck`, params).then(res => res.data); +} + +//在线加油详情 +export const getOrderByOrderNo = params => { + return POST('GET', `${orderbase}/oil/getOrderByOrderNo`, params).then(res => res.data); +} + + + +//----------------我的页面接口 +// 获取登录验证码 +export const getLoginSMSCode = params => { + return POST('POST', `${userbase}/sms/getLoginSMSCode`, params).then(res => res.data); +} + +// 手机号登录 +export const phone = params => { + return POST('POST', `${userbase}/login/phone`, params).then(res => res.data); +} + +// 微信小程序code解析 +export const HandleCode = params => { + return POST('POST', `${userbase}/login/wxMiniHandleCode`, params).then(res => res.data); +} + +// 微信小程序授权手机号登录 +export const loginByPhone = params => { + return POST('POST', `${userbase}/login/wxMini`, params).then(res => res.data); +} +// 退出登录 +export const loginOut = params => { + return POST('POST', `${userbase}/login/out`, params).then(res => res.data); +} +// 获取用户信息 +export const findUser = params => { + return POST('POST', `${userbase}/getUserDetail`, params).then(res => res.data); +} + +// 获取用户余额 +export const getUserAccount = params => { + return POST('POST', `${userbase}/getUserAccount`, params).then(res => res.data); +} +//查询优惠券 +export const getUserDiscountList = params => { + return POST('GET', `${userbase}/discount/getUserDiscountList`, params).then(res => res.data); } diff --git a/pages/goods/refuel-confirm/refuel-confirm.vue b/pages/goods/refuel-confirm/refuel-confirm.vue index 3249677..3a52bbb 100644 --- a/pages/goods/refuel-confirm/refuel-confirm.vue +++ b/pages/goods/refuel-confirm/refuel-confirm.vue @@ -76,6 +76,13 @@ ¥0 + + + + + 邀请码 + + @@ -280,12 +287,19 @@ rechargeDes: '', // 支付详情 rebateIntegral: '', //返回积分 Integrastu: 1, //返积分状态 - paytypeList: [], //支付方式 + paytypeList: [], //支付方式 + identificationCode: '', //渠道商 } }, onLoad(e) { this.gasOrderList = app.globalData.pelletoilList; - this.orderPrice = this.gasOrderList.highChildOrderList[0].goodsPrice; + this.orderPrice = this.gasOrderList.highChildOrderList[0].goodsPrice; + // #ifdef H5 + this.identificationCode = app.globalData.staffCode; + // #endif + // #ifdef MP + this.identificationCode = app.globalData.identificationCode; + // #endif }, onShow() { let that = this; @@ -544,7 +558,7 @@ "saleCount": 1, }], "payGold": this.priceValue[1], - "promoteCode": this.gasOrderList.identificationCode, + "promoteCode": this.identificationCode, "payPwd": this.PaymentPassword } @@ -617,7 +631,7 @@ if (this.paytype == '3' || this.paytype == '6') { let params = { - "orderId": this.orderNo, + "orderNo": this.orderNo, "cardNo": this.user.hltCardNo.cardNo, "password": this.PaymentPassword } @@ -782,15 +796,15 @@ "gasGunNo": this.gasOrderList.highChildOrderList[0].gasGunNo, "gasOilNo": this.gasOrderList.highChildOrderList[0].gasOilNo, "isTyAgent": this.gasOrderList.isTyAgent, - "goodsId": this.gasOrderList.highChildOrderList[0].goodsId, "goodsPrice": this.gasOrderList.highChildOrderList[0].goodsPrice, "goodsType": 3, "saleCount": 1, }], "payGold": this.priceValue[1], - "promoteCode": this.gasOrderList.identificationCode, - "payPwd": this.PaymentPassword + "promoteCode": this.identificationCode, + "payPwd": this.PaymentPassword, + memDiscountId:this.memDiscountId } create(goods).then(res => { diff --git a/pages/goods/refuel-details/refuel-details.vue b/pages/goods/refuel-details/refuel-details.vue index cbfee48..92d5d3d 100644 --- a/pages/goods/refuel-details/refuel-details.vue +++ b/pages/goods/refuel-details/refuel-details.vue @@ -173,7 +173,6 @@ diff --git a/pages/tabBar/user/user.vue b/pages/tabBar/user/user.vue index de7528f..17fb8bd 100644 --- a/pages/tabBar/user/user.vue +++ b/pages/tabBar/user/user.vue @@ -53,6 +53,9 @@ :text="therrNum" type="error" size="normal"> + + @@ -60,15 +63,15 @@ {{row.text}} - - - + + + 等待付款 - 剩余时间: 13:44 + 剩余时间: {{countdownm}}:{{countdowns}} 去支付 @@ -96,17 +99,19 @@ **** - ¥2400 + {{userAccount.integral}} 积分余额 **** - ¥2400 + ¥{{userAccount.oilCardPrice}} + 油卡余额 **** - ¥2400 + ¥{{userAccount.hltCardPrice}} + 工会卡余额 @@ -158,7 +163,10 @@ import { loginByPhone, findUser, - loginOut + loginOut, + getUserAccount, + getUserOrderList, + orderCheck } from "../../../Utils/Api.js"; // import authorize from '../../../components/Authorize'; import uniBadge from "../../../components/uni-badge/components/uni-badge/uni-badge.vue"; @@ -199,9 +207,13 @@ ], //操作列表 czList: '', - nopaylist: [1, 2, 3, 4, 5], - assetsstu: 2, - userphone:'' // 手机号 + nopaylist: [], + assetsstu: 2, + userphone: '', // 手机号 + userAccount: '', //用户余额, + countdownm: '', // 倒计时分 + countdowns: '', // 倒计时秒 + } }, //下拉刷新,需要自己在page.json文件中配置开启页面下拉刷新 "enablePullDownRefresh": true @@ -310,9 +322,9 @@ // #endif }, methods: { + //查询我的信息接口 findUser() { - let params; - findUser(params).then(res => { + findUser().then(res => { if (res.return_code == '000000') { app.globalData.userInfo = res.return_data; this.user = res.return_data; @@ -321,8 +333,9 @@ this.therrNum = res.return_data.unpaid; this.whetherCheckNum = res.return_data.whetherCheckNum; this.orderPayNum = res.return_data.orderPayNum; - this.rechargeOrderNum = res.return_data.rechargeOrderNum; + this.rechargeOrderNum = res.return_data.rechargeOrderNum; this.geTel(this.user.phone); + this.getUserOrderList(); uni.setStorage({ key: "user", data: res.return_data @@ -330,6 +343,27 @@ } }); }, + //查询订单列表 + getUserOrderList() { + uni.showLoading({ + title: '加载中...' + }) + let pagenum = this.pageNum; + let params = { + status: 1, + pageNum: 1, + pageSize: 5 + } + getUserOrderList(params).then(res => { + uni.hideLoading(); + if (res.return_code == '000000' && res.return_data.list != '') { + this.nopaylist = res.return_data.list; + this.timesettime(res.return_data.list[0].createTime); + } else { + this.nopaylist = []; + } + }) + }, //跳转用户信息 jumplogin() { uni.navigateTo({ @@ -352,9 +386,61 @@ this.assetsstu = 2; } if (item == 2) { - this.assetsstu = 1; + this.getUserAccount(); } }, + + //查询余额 + getUserAccount() { + getUserAccount().then(res => { + if (res.return_code == '000000') { + this.assetsstu = 1; + this.userAccount = res.return_data; + } + }); + }, + //轮播滚动 + swiperChange(e) { + this.timesettime(this.nopaylist[e.detail.current].createTime); + }, + //跳转详情 + jumpDetails(e, item) { + this.orderCheck(e); + if (item == 1 || item == 2 || item == 3) { + uni.navigateTo({ + url: '/qianzhu-KFC/order-details/order-details?id=' + e + }) + return; + } + uni.navigateTo({ + url: '/pages/user/order_details/order_details?id=' + e + }) + }, + //查看状态 + orderCheck(item) { + let datas = { + orderNo: item + } + orderCheck(datas).then(res => { + + }); + }, + //计算时间 + timesettime(item) { + var nowtime = new Date(), //获取当前时间 + endtime = item + 600000; //定义结束时间 + var lefttime = endtime - nowtime, //距离结束时间的毫秒数 + leftd = Math.floor(lefttime / (1000 * 60 * 60 * 24)), //计算天数 + lefth = Math.floor((lefttime / (1000 * 60 * 60) % 24) + leftd * 24) < 10 ? "0" + Math.floor((lefttime / + (1000 * 60 * 60) % 24) + leftd * 24) : Math.floor((lefttime / (1000 * 60 * 60) % 24) + leftd * + 24), //计算小时数 + leftm = Math.floor(lefttime / (1000 * 60) % 60) < 10 ? "0" + Math.floor(lefttime / (1000 * 60) % 60) : + Math.floor(lefttime / (1000 * 60) % 60), //计算分钟数 + lefts = Math.floor(lefttime / 1000 % 60) < 10 ? "0" + Math.floor(lefttime / 1000 % 60) : Math.floor( + lefttime / 1000 % 60); //计算秒数 + this.countdownm = leftm //返回倒计时的字符串 + this.countdowns = lefts //返回倒计时的字符串 + }, // 推广 jumppage(item) { if (item == 1) { diff --git a/pages/user/coupon/coupon.vue b/pages/user/coupon/coupon.vue index 3f6847d..e8c310b 100644 --- a/pages/user/coupon/coupon.vue +++ b/pages/user/coupon/coupon.vue @@ -8,8 +8,8 @@ - {{item}} + {{item.codeName}} @@ -23,48 +23,55 @@ - + + + 满减券 + + - + + + 抵扣券 + + + 折扣券 话费券 - {{row.highDiscount.discountName}} + style="width: 50px;background-color: #347edd;border-radius: 20px;">{{orderTyplist | msgFormat(row.discountUseScope)}} + {{row.discountName}} 有效期:{{row.useEndTime | formatDate('-')}} - - - {{row.highDiscount.discountPrice * 10}} + + + {{row.discountPrice * 10}} - {{row.highDiscount.discountPrice}} + {{row.discountPrice}} - + - 去使用 - 去使用 @@ -79,34 +86,58 @@ - - - {{row.highDiscount.discountName}} + + + + + 满减券 + + + + + 抵扣券 + + + + + 折扣券 + + + + {{orderTyplist | msgFormat(row.discountUseScope)}} + {{row.discountName}} - 使用时间:{{row.useTime | formatDate('-')}} + 有效期:{{row.useEndTime | formatDate('-')}} + - - - - {{row.highDiscount.discountPrice}} + + + + {{row.discountPrice * 10}} + + + {{row.discountPrice}} - + + 折 + + - - {{row.highDiscount.discountName}} - - - 已使用 - + @@ -114,34 +145,58 @@ - - - {{row.highDiscount.discountName}} + + + + + 满减券 + + + + + 抵扣券 + + + + + 折扣券 + + + + {{orderTyplist | msgFormat(row.discountUseScope)}} + {{row.discountName}} - 过期时间:{{row.useEndTime | formatDate('-')}} + 有效期:{{row.useEndTime | formatDate('-')}} + - - - - {{row.highDiscount.discountPrice}} + + + + {{row.discountPrice * 10}} + + + {{row.discountPrice}} - + + 折 + + - - {{row.highDiscount.discountName}} - - - 已过期 - + @@ -179,7 +234,8 @@ import { getUserDiscountList, verifyWx, - useDiscount + useDiscount, + getDictionaryByCodeType } from '../../../Utils/Api.js'; // #ifdef H5 var wx = require('jweixin-module'); @@ -193,8 +249,8 @@ couponnoinvalidList: [], imagewxUrl: app.globalData.imageWxImg, imgadres: 'noorder.png', - headerTop: 0, - headerswiperTop:'45px', + headerTop: 0, + headerswiperTop: '45px', //控制滑动效果 typeClass: 'valid', subState: '', @@ -206,9 +262,10 @@ isNoMoreData: false, loadingText: '', couponcout: 0, - orderTyplist: ['全部订单', '在线加油', '肯德基', '星巴克', '话费充值', '卡券订单'], //消息类型 ordertypeid: 1, //类型id usercouFeedbackHidden: 'none', // 默认隐藏 + orderTyplist: '', //订单类型 + statusid: '' //状态 } }, onPageScroll(e) { @@ -249,11 +306,11 @@ // #endif }, onLoad() { - // #ifdef H5 - this.headerTop = '44PX'; - this.headerswiperTop = '89px'; - // #endif - this.getUserDiscountList(1); + // #ifdef H5 + this.headerTop = '44PX'; + this.headerswiperTop = '89px'; + // #endif + this.getDictionaryByCodeType(); }, filters: { //过滤器 用于格式化时间 @@ -271,6 +328,15 @@ mm = mm >= 10 ? mm : "0" + mm; s = s >= 10 ? s : "0" + s; return `${year}${spe}${month}${spe}${day} ${h}:${mm}:${s}`; + }, + //过滤器 用于格式化状态 + msgFormat: function(value, value1) { + for (var i = 0; i < value.length; i++) { + if (value1 == value[i].codeValue) { + let a = value[i].codeName; + return a; + } + } } }, onReachBottom() { @@ -285,6 +351,7 @@ methods: { //查询我的优惠券 getUserDiscountList(item) { + this.statusid = item; uni.showLoading({ title: '加载中...' }) @@ -297,7 +364,8 @@ let params = { pageNum: pagenum, status: item, - pageSize: this.pageSize + pageSize: this.pageSize, + useScope: this.ordertypeid } getUserDiscountList(params).then(res => { if (res.return_code == '000000') { @@ -323,31 +391,55 @@ } }) }, + + //分类类型 + getDictionaryByCodeType() { + let datas = { + codeType: 'USING_RANGE' + } + getDictionaryByCodeType(datas).then(res => { + if (res.return_code == '000000') { + this.orderTyplist = res.return_data; + this.ordertypeid = res.return_data[0].codeValue; + this.getUserDiscountList(1); + } + }) + }, + //筛选类型 + selectlist(item) { + this.ordertypeid = item.codeValue; + this.pageNum = 1; + this.couponValidList = []; + this.couponinvalidList = []; + this.couponnoinvalidList = []; + this.isNoMoreData = false; + this.getUserDiscountList(this.statusid); + }, //跳转详情 jumpcoupons(e) { - if (e.highDiscount.useScope == 3) { + if (e.useScope == 3) { uni.navigateTo({ url: '../../../subPages/recharge/recharge' }) - } else if (e.highDiscount.useScope == 4) { + } else if (e.useScope == 4) { app.globalData.distinguishid = 1; uni.navigateTo({ url: '/qianzhu-KFC/buffet-order/buffet-order' }) - } else if (e.highDiscount.useScope == 5) { + } else if (e.useScope == 5) { app.globalData.distinguishid = 2; uni.navigateTo({ url: '/qianzhu-KFC/buffet-order/buffet-order' }) - } else if (e.highDiscount.useScope == 6) { + } else if (e.useScope == 6) { uni.navigateTo({ url: '/member-Recharge/choicepage/choicepage' }) - }else if (e.highDiscount.useScope == 7) { + } else if (e.useScope == 7) { uni.navigateTo({ url: '/pages/goods/refuel/refuel' }) - } else if (e.highDiscount.usingRange == 5) { + } else if (e.usingRange == 5) { this.useDiscount(e.discountAgentCodeId); } else { uni.navigateTo({ @@ -782,8 +874,8 @@ } .ticket { - background-image: radial-gradient(6px at top left, #f5f5f5 50px, #009DFF); - padding-top: 1vw; + // background-image: radial-gradient(6px at top left, #f5f5f5 50px, #009DFF); + // padding-top: 1vw; justify-content: center; align-items: baseline; diff --git a/pages/user/deposit/deposit.vue b/pages/user/deposit/deposit.vue index 218b1ef..d57a2aa 100644 --- a/pages/user/deposit/deposit.vue +++ b/pages/user/deposit/deposit.vue @@ -131,14 +131,14 @@ //模板模拟支付,实际应用请调起微信/支付宝 // #ifdef H5 let params = { - "orderId": res.return_data.id, + "orderNo": res.return_data.orderNo, "openId": app.globalData.openId, "openIdType": 2 } // #endif // #ifdef MP let params = { - "orderId": res.return_data.id, + "orderNo": res.return_data.orderNo, "openId": app.globalData.openId, "openIdType": 1 } @@ -187,7 +187,9 @@ } else { uni.showToast({ - title: res.return_msg + title: res.return_msg, + duration:2000, + icon:'none' }); } }) diff --git a/pages/user/order_details/order_details.vue b/pages/user/order_details/order_details.vue index 3717e1c..7fd2f09 100644 --- a/pages/user/order_details/order_details.vue +++ b/pages/user/order_details/order_details.vue @@ -14,7 +14,7 @@ {{typeText[recinfo.orderStatus]}} - 实付:¥{{recinfo.payRealPrice}} + 实付:¥{{recinfo.payRealPrice}} {{recinfo.createTime | formatDate('-')}} @@ -426,7 +426,7 @@ {{recinfo.payPrice*100}} - 取消订单 + 取消订单 去支付 @@ -443,7 +443,7 @@