12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- /**
- * 充值卡模型
- */
- define(['base', '$', 'native', 'api', 'user', 'config'], function (base, $, native, api, user) {
- var Recharge = function () {
- if (typeof Recharge.instance === 'object') {
- return Recharge.instance;
- }
- Recharge.instance = this;
- this.storagePrefix = 'recharge';
- }
- Recharge.prototype = new base();
- // 获取充值卡列表
- Recharge.prototype.getRechargeList = function (callback) {
- var that = this;
- api.getRechargeList({}, function (res) {
- if (res.success) {
- }
- if (typeof(callback) == 'function') {
- callback(res);
- }
- });
- };
- // 充值
- Recharge.prototype.addRechargeorder = function (data, callback) {
- var that = this;
- api.addRechargeorder({
- user_id: data.user_id,
- value:data.value,
- recharge_id: data.recharge_id
- }, function (res) {
- if (res.success) {
- //更新user
- }
- if (typeof(callback) == 'function') {
- callback(res);
- }
- });
- };
- return new Recharge();
- })
|