Commit 78421bc6 authored by 袁玲利's avatar 袁玲利

充值和消费界面新增

parents 763c770e 7a08ae19
...@@ -363,7 +363,7 @@ ...@@ -363,7 +363,7 @@
}, 10); }, 10);
}) })
const respes = await requestPost('/cgi-xpay/app/h5/ConsumeLimitData', { const respes = await requestPost('/cgi-xpay/app/h5/ConsumeLimitData', {
accountId: 0 accountId: sessionStorage.getItem('accountId') * 1
}) })
uni.hideLoading() uni.hideLoading()
if (respes['code'] != 200) { if (respes['code'] != 200) {
...@@ -574,10 +574,8 @@ ...@@ -574,10 +574,8 @@
supermarketConsumptionLimit: supermarketConsumptionLimit, supermarketConsumptionLimit: supermarketConsumptionLimit,
}; };
// 设置消费限额 // 设置消费限额
let respes = await this.$httpWX.post({ const respes = await requestPost('/cgi-xpay/app/h5/SetParentConsumeLimit', Object.assign({
url: '/cgi-xpay/app/user/SetParentConsumeLimitV2' accountId: sessionStorage.getItem('accountId') * 1, // 消费用户账户id
}, Object.assign({
accountId: this.ConsumptionQuotaUser.id, // 消费用户账户id
}, params)) }, params))
if (respes.code != 200) { if (respes.code != 200) {
uni.showToast({ uni.showToast({
......
...@@ -96,6 +96,7 @@ ...@@ -96,6 +96,7 @@
Dialog Dialog
} from 'vant'; } from 'vant';
import config from '../common/config.js' import config from '../common/config.js'
// console.warn(config['ServiceEnum'])
import { import {
requestGet, requestGet,
requestPost requestPost
...@@ -143,42 +144,58 @@ ...@@ -143,42 +144,58 @@
}; };
}, },
onLoad(options) { onLoad(options) {
uni.setStorageSync('token', if (!options['token']) {
`eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwaG9uZSI6IjE4OTQyNTA4MzY0IiwidXNlcklkIjoiMjA4ODIxMjM4MzI0MDM1MSIsImJpbmRVc2VySWQiOiI2MTMwMCIsImJpbmRVc2VyVHlwZSI6IjIiLCJiaW5kQWNjb3VudElkIjoiMTEzIiwic291cmNlIjoiYWxpcGF5IiwiZXhwIjoxNjg4NzE3MDQyLCJpc3MiOiJhZG1pbiIsIm5iZiI6MTY4ODcxMjQ0Mn0.TJIWWE85hrDLENglp5YVqh8sVFzi5hE-17DjfputrOg` Dialog({
) title: '系统提示',
this.HomePageData() message: 'token为空!',
// if (!options['schoolId'] || !options['userId']) { confirmButtonText: "知道了"
// Dialog({ }).then(res => {
// title: '系统提示!', window.close()
// message: '学生Id或学校Id为必传参数!', })
// confirmButtonText: "知道了" return;
// }).then(res => { }
// window.close() this.UserLogin(options['token'])
// })
// return;
// }
}, },
methods: { methods: {
//登录获取用户信息
async UserLogin(token) {
let data = await requestPost('/cgi-xpay/app/Login', {
grantType: 'GT_azCloud_h5',
code: token,
})
if (data['code'] != 200) {
await Dialog({
title: '温馨提示',
message: data['message'],
confirmButtonText: "知道了"
})
return
}
uni.setStorageSync('token', data.data['token'])
this.HomePageData()
},
// 查询消费会员权益项 // 查询消费会员权益项
async QueryProductContractItem() { async QueryProductContractItem(serviceItemCode = '1008') {
const data = await requestPost('/cgi-xpay/app/h5/QueryProductContractItem', { const data = await requestPost('/cgi-xpay/app/h5/QueryProductContractItem', {
accountId: this.HomeDataInfo['accountId'], accountId: this.HomeDataInfo['accountId'],
serviceItemCode: '1008' serviceItemCode
}) })
if (data['code'] != 200) { if (data['code'] != 200) {
await Dialog({ await Dialog({
title: '温馨提示',
message: data['message'], message: data['message'],
confirmButtonText: "知道了" confirmButtonText: "知道了"
}) })
return return
} }
console.warn(data) return data.data['result']
}, },
// 获取首页数据 // 获取首页数据
async HomePageData() { async HomePageData() {
const data = await requestPost('/cgi-xpay/app/h5/HomePageData', {}) const data = await requestPost('/cgi-xpay/app/h5/HomePageData', {})
if (data['code'] != 200) { if (data['code'] != 200) {
await Dialog({ await Dialog({
title: '温馨提示',
message: data['message'], message: data['message'],
confirmButtonText: "知道了" confirmButtonText: "知道了"
}) })
...@@ -196,6 +213,7 @@ ...@@ -196,6 +213,7 @@
} }
data.data['schoolConsumption'] = schoolConsumption data.data['schoolConsumption'] = schoolConsumption
this.HomeDataInfo = data.data this.HomeDataInfo = data.data
sessionStorage.setItem('accountId', this.HomeDataInfo['accountId'])
// 查询消费会员权益项 // 查询消费会员权益项
this.QueryProductContractItem() this.QueryProductContractItem()
}, },
...@@ -214,7 +232,7 @@ ...@@ -214,7 +232,7 @@
}, },
// 跳转云平台权益中心 // 跳转云平台权益中心
async openAzMenber() { async openAzMenber() {
wx.miniProgram.navigateTo({ jWeixin.miniProgram.navigateTo({
url: '/pages/nationalCenterForLesbianRights/index' url: '/pages/nationalCenterForLesbianRights/index'
}) })
}, },
......
...@@ -23,8 +23,22 @@ if (window.location.host == 'pay.xiaopay.net') { ...@@ -23,8 +23,22 @@ if (window.location.host == 'pay.xiaopay.net') {
env = "product"; env = "product";
baseURL = 'https://pay.xiaopay.net' baseURL = 'https://pay.xiaopay.net'
} }
const ServiceEnum = {
Auth1: '1001', //'消费方式-刷脸模式',
Auth2: '1002', //'消费周报/月报',
Auth3: '1003', //'消费方式-刷卡模式',
Auth4: '1004', //'扣款方式-微信代扣',
Auth5: '1005', //'扣款方式-钱包代扣',
Auth6: '1006', //'在线充值',
Auth7: '1007', //'微信垫资',
Auth8: '1008', //'家长自定义限额',
Auth9: '1009', //'微信公众号推送',
Auth10: '1010', //'消费记录明细',
Auth11: '1011', //'每日异常小报告'
}
const json = { const json = {
env, env,
baseURL baseURL,
ServiceEnum
} }
export default json; export default json;
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment