ddc356b9 by simon

默认提交

1 parent 70f2b522
......@@ -22,6 +22,7 @@ App({
this.share()
},
globalData: {
configData: {},
indexInfo: null,
userInfo: null,
wxcode: store.getItem("wxcode"),
......
......@@ -55,6 +55,9 @@ module.exports = {
// 提现
pointsWithDraw: '/points/withdraw',
// 配置项
config: '/constant',
areaQuery: 'https://api.k.wxpai.cn/bizproxy/kdapi/area', // post 区域查询
uploadFile: '/kdapi/file/upload' //上传图片通用接口
......
......@@ -21,7 +21,8 @@ Page({
code: "", // 手输入码 / 扫出的奖金码
memberCode: "", // 扫出的用户码
isVerify: true, // 是否已经认证
options: {}
options: {},
configData: {}
},
onShareAppMessage() {},
showAuth() {
......@@ -33,8 +34,7 @@ Page({
this.setData({
options: options
})
this.queryConfig();
},
onShow() {
......@@ -234,11 +234,15 @@ Page({
*/
onCashExchangeHanler(evt) {
let _this = this;
let minPoints = Fen2Yuan(500);
let {
configData
} = _this.data;
let minPoints = configData.minPoints || 500;
let minPointsYuan = Fen2Yuan(minPoints);
wx.showModal({
title: '提示',
content: `确认兑换所有奖金?\r\n(余额满${minPoints}元才能提现)`,
content: `确认兑换所有奖金?\r\n(余额满${minPointsYuan}元才能提现)`,
success(res) {
if (res.confirm) {
_this.queryPointsWithDraw();
......@@ -337,6 +341,21 @@ Page({
});
},
queryConfig() {
return new Promise((resolve, reject) => {
app.post({
url: app.api.config,
data: {}
}).then((result) => {
this.setData({
configData: result
})
app.globalData.configData = result;
resolve(result);
})
});
},
/**
* 扫个人码 做任务,用户无感知
* 如果没有码,直接返回
......