Compare commits

...

2 Commits

Author SHA1 Message Date
wangfuduo 9bbbf334ac refactor: response 2026-07-08 18:02:11 +08:00
wangfuduo 5b36a0e24d refactor: response 2026-07-08 18:02:02 +08:00
2 changed files with 4 additions and 5 deletions

View File

@ -16,7 +16,7 @@ func New(param Params) *Button {
func (b *Button) CouponButton() []*response.Button { func (b *Button) CouponButton() []*response.Button {
return []*response.Button{ return []*response.Button{
{Url: b.param.Str(config.ServiceVipExpireUrl), Type: config.ButtonInput}, {Url: b.param.Str(config.ServiceVipExpireUrl), Type: config.ButtonInput},
{Text: "提交", Type: config.ButtonClick}, {Text: b.param.Str(config.ServiceCouponSubmitButton), Type: config.ButtonClick},
{Text: b.param.Str(config.ButtonTxtContractCustomer), Type: config.ButtonClick}, {Text: b.param.Str(config.ButtonTxtContractCustomer), Type: config.ButtonClick},
} }
} }

View File

@ -137,16 +137,15 @@ func (u *User) PkgCheck() *response.Response {
Button(New(u.params).LackButton()...) Button(New(u.params).LackButton()...)
} }
// 先判断是否强制更新 // 先判断是否强制更新expireCheck 已设置强制更新文案且不可关闭,直接返回
if resp = u.expireCheck(userPkg, u.params.Int(config.ServiceForceUpdateDay)); resp != nil { if resp = u.expireCheck(userPkg, u.params.Int(config.ServiceForceUpdateDay)); resp != nil {
resp.Closable(false).Title(u.params.Str(config.ServiceForceUpdateNotice))
return resp return resp
} }
// 判断是否提示更新 // 判断是否提示更新:覆盖为更新提示文案,且允许关闭
if resp = u.expireCheck(userPkg, u.params.Int(config.ServiceUpdateBeforeDay)); resp != nil { if resp = u.expireCheck(userPkg, u.params.Int(config.ServiceUpdateBeforeDay)); resp != nil {
msg := fmt.Sprintf(u.params.Str(config.ServiceUpdateNotice), time.Unix(userPkg.Pkg.ExpireTime, 0).Format("2006-01-02")) msg := fmt.Sprintf(u.params.Str(config.ServiceUpdateNotice), time.Unix(userPkg.Pkg.ExpireTime, 0).Format("2006-01-02"))
resp.Closable(true).Title(msg) resp.Closable(true).Message(msg)
return resp return resp
} }