-
Notifications
You must be signed in to change notification settings - Fork 264
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from coolhwm/dev
会员卡管理、会员核销、会员积分、优惠券发放
- Loading branch information
Showing
50 changed files
with
2,148 additions
and
220 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import base from './base'; | ||
import Page from '../utils/Page'; | ||
|
||
export default class Member extends base { | ||
/** | ||
* 获取会员信息 | ||
*/ | ||
static async Info (number) { | ||
const url = `${this.baseUrl}/members/number?number=${number}`; | ||
return await this.get(url); | ||
} | ||
|
||
/** | ||
* 增加积分信息 | ||
*/ | ||
static async memberAdd (bonusDetail) { | ||
const url = `${this.baseUrl}/members/bonus_detail`; | ||
return this.post(url, bonusDetail); | ||
} | ||
|
||
/** | ||
* 获取买家会员数据 | ||
*/ | ||
static async customerInfo (customerId) { | ||
const url = `${this.baseUrl}/members?customer_id=${customerId}`; | ||
return await this.get(url); | ||
} | ||
|
||
/** | ||
* 获取买家会员卡数据 | ||
*/ | ||
static async cardInfo () { | ||
const url = `${this.baseUrl}/memberCards`; | ||
return await this.get(url); | ||
} | ||
|
||
/** | ||
* 历史积分信息 | ||
*/ | ||
static async bonusPage(customerId) { | ||
const url = `${this.baseUrl}/members/bonus_detail?by=create_time&sort=desc&customer_id=${customerId}`; | ||
return new Page(url, this.processBonusTransformation.bind(this)); | ||
} | ||
static processBonusTransformation (bonusInfo) { | ||
const comment = {}; | ||
if (bonusInfo.addBonus > 0) { | ||
comment.costMoney = `消费金额:¥ ${bonusInfo.costMoney.toFixed(2)}`; | ||
} else { | ||
comment.costMoney = `抵扣金额:¥ ${bonusInfo.costMoney.toFixed(2)}`; | ||
} | ||
comment.addBonus = bonusInfo.addBonus; | ||
comment.createTime = bonusInfo.createTime; | ||
comment.orderId = bonusInfo.orderId; | ||
comment.typeDesc = bonusInfo.typeDesc; | ||
return comment; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import base from './base'; | ||
|
||
export default class vip extends base { | ||
/** | ||
* 会员卡信息 | ||
*/ | ||
static async info () { | ||
const url = `${this.baseUrl}/memberCards`; | ||
return await this.get(url); | ||
} | ||
|
||
/** | ||
* 添加会员卡 | ||
*/ | ||
static async create (cardParam) { | ||
const url = `${this.baseUrl}/memberCards`; | ||
return this.post(url, cardParam); | ||
} | ||
|
||
/** | ||
* 编辑会员卡 | ||
*/ | ||
static async update (cardParam) { | ||
const url = `${this.baseUrl}/memberCards`; | ||
return this.put(url, cardParam); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.