| | |
| | | |
| | | /* 获取商铺信息 */ |
| | | export const queryShop = (params, config = {}) => http.get(URL + |
| | | '/service-merchant/v1/web/aggregatePayAllin/queryShopById', params, config) |
| | | '/payfour-merchant/v1/web/aggregatePayAllin/queryShopById', params, config) |
| | | |
| | | /* 获取成功页面配置 */ |
| | | export const getPayCompleteUrl = (params, config = {}) => http.get(URL + |
| | | '/service-base/v1/base/pc/global/config/getPayCompleteUrl', params, config) |
| | | '/payfour-base/v1/base/pc/global/config/getPayCompleteUrl', params, config) |
| | | |
| | | /* 获取积分价值 */ |
| | | export const getScoreWorth = (params, config = {}) => http.get(URL + |
| | | '/service-merchant/v1/web/aggregatePayAllin/getScoreWorth', params, config) |
| | | '/payfour-merchant/v1/web/aggregatePayAllin/getScoreWorth', params, config) |
| | | |
| | | /* 获取用户银行卡 */ |
| | | export const myBankCard = (params, config = {}) => http.get(URL + |
| | | '/service-shop/v1/shop/wechat/h5/bankCard/myBankCard', params, config) |
| | | '/payfour-shop/v1/shop/wechat/h5/bankCard/myBankCard', params, config) |
| | | |
| | | /* 获取商铺微信配置 */ |
| | | export const getWechatInfo = (params, config = {}) => http.get(URL + |
| | | '/service-merchant/v1/web/aggregatePayAllin/getWechatInfo', params, config = {}); |
| | | '/payfour-merchant/v1/web/aggregatePayAllin/getWechatInfo', params, config = {}); |
| | | /* 静默授权登录 */ |
| | | export const getOpenIdBase = (params, config = {}) => http.get(URL + |
| | | '/service-merchant/v1/web/aggregatePayAllin/getOpenIdBase', params, config = {}); |
| | | '/payfour-merchant/v1/web/aggregatePayAllin/getOpenIdBase', params, config = {}); |
| | | |
| | | /* 微信普通授权登录 */ |
| | | export const getOpenId = (params, config = {}) => http.get(URL + '/service-merchant/v1/web/aggregatePayAllin/getOpenId', |
| | | export const getOpenId = (params, config = {}) => http.get(URL + '/payfour-merchant/v1/web/aggregatePayAllin/getOpenId', |
| | | params, config = {}); |
| | | /* 支付宝普通授权登录 */ |
| | | export const getUserId = (params, config = {}) => http.get(URL + '/service-merchant/v1/web/h5PayAli/getUserIdByCode', |
| | | export const getUserId = (params, config = {}) => http.get(URL + '/payfour-merchant/v1/web/h5PayAli/getUserIdByCode', |
| | | params, config = {}); |
| | | export const userLogin = (params, config = {}) => { |
| | | let path = '/service-merchant/v1/web/aggregatePayAllin/getOpenId' |
| | | let path = '/payfour-merchant/v1/web/aggregatePayAllin/getOpenId' |
| | | if(params.platform==5){ |
| | | path = '/service-merchant/v1/web/h5PayAli/getUserIdByCode' |
| | | path = '/payfour-merchant/v1/web/h5PayAli/getUserIdByCode' |
| | | } |
| | | return http.get(URL + path, |
| | | params, config = {}) |
| | | }; |
| | | /* 获取用户积分 */ |
| | | export const queryScore = (params, config = {}) => http.get(URL + |
| | | '/service-merchant/v1/web/aggregatePayAllin/queryScore', params, config = {}); |
| | | '/payfour-merchant/v1/web/aggregatePayAllin/queryScore', params, config = {}); |
| | | /* 获取用户可用优惠券 面值最大的*/ |
| | | export const queryMyUseSweepPayMaxCoupon = (params, config = {}) => http.get(URL + |
| | | '/service-merchant/v1/web/aggregatePayAllin/queryMyUseSweepPayMaxCoupon', params, config = {}); |
| | | '/payfour-merchant/v1/web/aggregatePayAllin/queryMyUseSweepPayMaxCoupon', params, config = {}); |
| | | /* 获取用户可用优惠券 */ |
| | | export const queryUseSweepPayCoupon = (params, config = {}) => http.get(URL + |
| | | '/service-merchant/v1/web/aggregatePayAllin/queryUseSweepPayCoupon', params, config = {}); |
| | | '/payfour-merchant/v1/web/aggregatePayAllin/queryUseSweepPayCoupon', params, config = {}); |
| | | |
| | | /* 获取微信js sdk配置 */ |
| | | export const getWechatConfigInfo = (params, config = {}) => http.post(URL + |
| | | '/service-merchant/v1/web/aggregatePayAllin/getWechatConfigInfo', params, config = {}); |
| | | '/payfour-merchant/v1/web/aggregatePayAllin/getWechatConfigInfo', params, config = {}); |
| | | |
| | | /* 微信支付 */ |
| | | export const saveWxOrder = (params, config = {}) => http.post(URL + |
| | | '/service-merchant/v1/web/aggregatePayAllin/saveWxOrder', params, config = {}); |
| | | export const saveWxOrder1 = (params, config = {}) => http.post(URL + |
| | | '/service-merchant/v1/web/aggregatePayAllin/saveOrder', params, config = {}); |
| | | '/payfour-merchant/v1/web/aggregatePayAllin/saveWxOrder', params, config = {}); |
| | | export const saveOrder = (params, config = {}) => http.post(URL + |
| | | '/payfour-merchant/v1/web/aggregatePayAllin/saveOrder', params, config = {}); |
| | | |
| | | /* 图形验证吗 */ |
| | | export const getVerify = (params, config = {}) => http.get(URL + |
| | | '/service-merchant/v1/web/aggregatePayAllin/getVerify', params, config = {}); |
| | | '/payfour-merchant/v1/web/aggregatePayAllin/getVerify', params, config = {}); |
| | | |
| | | /* 短信验证码 */ |
| | | export const getH5PayCheckVerifyCode = (params, config = {}) => http.post(URL + |
| | | '/service-merchant/v1/web/aggregatePayAllin/getH5PayCheckVerifyCode', params, config = {}); |
| | | '/payfour-merchant/v1/web/aggregatePayAllin/getH5PayCheckVerifyCode', params, config = {}); |
| | | |
| | | /* 微信支付 */ |
| | | export const h5PayLogin = (params, config = {}) => http.post(URL + '/service-shop/v1/shop/web/wechat/h5PayLogin', |
| | | export const h5PayLogin = (params, config = {}) => http.post(URL + '/payfour-shop/v1/shop/web/wechat/h5PayLogin', |
| | | params, config = {}); |
| | | |
| | | /* 通联快捷支付 */ |
| | | export const tlPay = (params, config = {}) => http.post(URL + |
| | | '/service-merchant/v1/web/aggregatePayAllin/payagreeconfirm', |
| | | '/payfour-merchant/v1/web/aggregatePayAllin/payagreeconfirm', |
| | | params, config = {}); |
| | | |
| | | /* 微信支付结果 */ |
| | | export const getWxOrderInfo = (params, config = {}) => http.post(URL + |
| | | '/service-merchant/v1/web/aggregatePayAllin/getWxOrderInfo', |
| | | '/payfour-merchant/v1/web/aggregatePayAllin/getWxOrderInfo', |
| | | params, config = {}); |
| | | |
| | | /* 判断是否在卡段内 */ |
| | | export const isContain = (params, config = {}) => http.get(URL + |
| | | '/service-base/v1/base/pc/bankCardPeriod/isContain', |
| | | '/payfour-base/v1/base/pc/bankCardPeriod/isContain', |
| | | params, config = {}); |
| | | |
| | | /* 获取银行卡配置 */ |
| | | export const bankCardStyle = (params, config = {}) => http.get(URL + |
| | | '/service-base/v1/base/pc/global/config/bankCardStyle', |
| | | '/payfour-base/v1/base/pc/global/config/bankCardStyle', |
| | | params, config = {}); |
| | | |
| | | /* 获取用户信息 */ |
| | | export const getUserInfo = (params, config = {}) => http.post(URL + |
| | | '/service-shop/v1/shop/wechat/h5/bankCard/noEnc', |
| | | '/payfour-shop/v1/shop/wechat/h5/bankCard/noEnc', |
| | | params, config = {}); |
| | | /* 获取店铺优惠信息 */ |
| | | export const queryMyDiscount = (params, config = {}) => http.get(URL + |
| | | '/service-merchant/v1/web/aggregatePayAllin/queryMyDiscount', |
| | | '/payfour-merchant/v1/web/aggregatePayAllin/queryMyDiscount', |
| | | params, config = {}); |
| | | /* 签约申请绑卡 */ |
| | | export const signUpToApply = (params, config = {}) => http.post(URL + |
| | | '/service-shop/v1/shop/wechat/h5/bankCard/signUpToApply', |
| | | '/payfour-shop/v1/shop/wechat/h5/bankCard/signUpToApply', |
| | | params, config = {}); |
| | | |
| | | /* 签约申请确认 */ |
| | | export const bindCard = (params, config = {}) => http.post(URL + |
| | | '/service-shop/v1/shop/wechat/h5/bankCard/bindCard', |
| | | '/payfour-shop/v1/shop/wechat/h5/bankCard/bindCard', |
| | | params, config = {}); |
| | | |
| | | /* 获取绑卡活动赠送的优惠券 */ |
| | | export const getMyCoupUseDetail = (params, config = {}) => http.get(URL + |
| | | '/service-merchant/v1/web/aggregatePayAllin/headBand/getMyCoupUseDetail', |
| | | '/payfour-merchant/v1/web/aggregatePayAllin/headBand/getMyCoupUseDetail', |
| | | params, config = {}); |
| | | /* 获取首绑有礼 */ |
| | | export const headBand = (params, config = {}) => http.get(URL + |
| | | '/service-shop/v1/shop/wechat/activity/headBand/detail', |
| | | '/payfour-shop/v1/shop/wechat/activity/headBand/detail', |
| | | params, config = {}); |
| | |
| | | |
| | | /* 获取刷卡活动信息 */ |
| | | export const activityInfo = (params, config = {}) => http.get(URL + |
| | | '/service-merchant/v1/web/monthBrush/info', params, config) |
| | | '/payfour-merchant/v1/web/monthBrush/info', params, config) |
| | | /* 参与活动 */ |
| | | export const signActivity = (params, config = {}) => http.get(URL + |
| | | '/service-merchant/v1/web/monthBrush/sign', params, config) |
| | | '/payfour-merchant/v1/web/monthBrush/sign', params, config) |
| | | /* 获取用户参与信息 */ |
| | | export const myBrushDetail = (params, config = {}) => http.get(URL + |
| | | '/service-merchant/v1/web/monthBrush/myBrushDetail', params, config) |
| | | '/payfour-merchant/v1/web/monthBrush/myBrushDetail', params, config) |
| | | /* 查询优惠券 */ |
| | | export const orderRefBrushNode = (params, config = {}) => http.get(URL + |
| | | '/service-merchant/v1/web/monthBrush/orderRefBrushNode', params, config) |
| | | '/payfour-merchant/v1/web/monthBrush/orderRefBrushNode', params, config) |
| | |
| | | |
| | | // 开发 |
| | | const dev = { |
| | | webURL: 'https://jmy.jinmingyuan.com/pay', |
| | | webURL: 'https://sfzf.cpbtsoft.cn/pay', |
| | | baseURL: '/dev-api', |
| | | sftpURL: 'https://yqzx.jinmingyuan.com/file', |
| | | wx_appid: 'wxe4a1e9fddc509c46', |
| | | ali_appid: '2021003199690698' |
| | | wx_appid: 'wx4c146dba764dcb05', |
| | | ali_appid: '2021004144693340' |
| | | } |
| | | // 测试 |
| | | const test = { |
| | | webURL: 'https://sfzf.cpbtsoft.cn/pay', |
| | | baseURL: 'https://sfzf.cpbtsoft.cn', |
| | | baseURL: 'https://sfzf.cpbtsoft.cn/prod-api', |
| | | sftpURL: 'https://sfzf.cpbtsoft.cn/file', |
| | | wx_appid: 'wxe4a1e9fddc509c46', |
| | | ali_appid: '2021003199690698' |
| | | wx_appid: 'wx4c146dba764dcb05', |
| | | ali_appid: '2021004144693340' |
| | | } |
| | | // 正式 |
| | | const prod = { |
| | | webURL: 'https://jmy.jinmingyuan.com/pay', |
| | | baseURL: 'https://yqzx.jinmingyuan.com', |
| | | sftpURL: 'https://yqzx.jinmingyuan.com/file', |
| | | wx_appid: 'wxad8cc511da676bd4', |
| | | ali_appid: '2021003199690698' |
| | | wx_appid: 'wx4c146dba764dcb05', |
| | | ali_appid: '2021004144693340' |
| | | } |
| | | |
| | | const cardType = { |
| | |
| | | '02': '信用卡' |
| | | } |
| | | module.exports = { |
| | | config: test, |
| | | config: dev, |
| | | ACCESSTOKEN: "Authorization", |
| | | /* 是否打印请求日志 */ |
| | | DEBUG: false, |
| | |
| | | "^/dev-api" : "" |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "port" : "" |
| | | }, |
| | | "optimization" : { |
| | | "treeShaking" : { |
| | |
| | | queryUseSweepPayCoupon, |
| | | getWechatConfigInfo, |
| | | saveWxOrder, |
| | | saveOrder, |
| | | tlPay |
| | | } from '@/common/api/index' |
| | | import wx from 'weixin-js-sdk'; // 使用js-sdk |
| | |
| | | onLoad(opt) { |
| | | this.isNew = uni.getStorageSync('IS_NEW') |
| | | this.cid = uni.getStorageSync('CID') |
| | | this.discountInfo = uni.getStorageSync('DISCOUNT_INFO') |
| | | if(uni.getStorageSync('DISCOUNT_INFO')){ |
| | | this.discountInfo = uni.getStorageSync('DISCOUNT_INFO') |
| | | } |
| | | |
| | | const token = uni.getStorageSync(ACCESSTOKEN) || null |
| | | if (opt.shopInfo) { |
| | | this.shopInfo = JSON.parse(decodeURIComponent(opt.shopInfo)) |
| | |
| | | if (opt.money) { |
| | | this.money = parseFloat(opt.money).toFixed(2) |
| | | let dis = this.money * 100 * (1 - this.discountInfo.shopDiscount) |
| | | console.log('dis',dis) |
| | | let money = parseInt((this.money * 100 * this.discountInfo.shopDiscount)) |
| | | if (dis < 1) { |
| | | money = parseInt((this.money * 100)) |
| | |
| | | if (this.payWay == 3) { |
| | | params.bankCardId = this.bankCardId |
| | | } |
| | | saveWxOrder(params).then(res => { |
| | | saveOrder(params).then(res => { |
| | | uni.hideLoading() |
| | | try { |
| | | this.orderId = res.orderId |
| | |
| | | queryMyUseSweepPayMaxCoupon, |
| | | getWechatConfigInfo, |
| | | saveWxOrder, |
| | | saveOrder, |
| | | tlPay |
| | | } from '@/common/api/index' |
| | | import wx from 'weixin-js-sdk'; // 使用js-sdk |
| | |
| | | }, |
| | | // 获取会员相关信息 |
| | | getUserInfo() { |
| | | this.end += 2 |
| | | this.end += 1 |
| | | |
| | | queryMyDiscount({ |
| | | /*queryMyDiscount({ |
| | | shopId: this.shopInfo.id |
| | | }).then(res => { |
| | | this.count++ |
| | |
| | | if (this.count >= this.end) { |
| | | uni.hideLoading() |
| | | } |
| | | }) |
| | | })*/ |
| | | /* //获取用户银行卡 |
| | | myBankCard().then(res => { |
| | | this.count++ |
| | |
| | | params.bankCardId = this.bankCardId |
| | | } |
| | | //生成订单 |
| | | saveWxOrder(params).then(res => { |
| | | saveOrder(params).then(res => { |
| | | uni.hideLoading() |
| | | try { |
| | | this.orderId = res.orderId |