|
@@ -54,10 +54,10 @@ export struct VipPage{
|
|
|
static readonly IS_AGREE: string = 'isAgree';
|
|
static readonly IS_AGREE: string = 'isAgree';
|
|
|
static readonly FOEVEER_DATE: string = 'forever';
|
|
static readonly FOEVEER_DATE: string = 'forever';
|
|
|
@State params: object = router.getParams()
|
|
@State params: object = router.getParams()
|
|
|
- @State payPrice:number = 9 //9是一个 19是一年 19是永久赞助
|
|
|
|
|
- static readonly TYPE_MONTH: number = 0.09;
|
|
|
|
|
|
|
+ @State payPrice:number = 19.8 //9是一个 19是一年 19是永久赞助
|
|
|
|
|
+ static readonly TYPE_MONTH: number = 9.8;
|
|
|
static readonly TYPE_YEAR: number = 19
|
|
static readonly TYPE_YEAR: number = 19
|
|
|
- static readonly TYPE_FOREVER: number = 19
|
|
|
|
|
|
|
+ static readonly TYPE_FOREVER: number = 19.8
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -277,12 +277,16 @@ export struct VipPage{
|
|
|
.backgroundColor($r('app.color.title_bar_bg'))
|
|
.backgroundColor($r('app.color.title_bar_bg'))
|
|
|
.alignSelf(ItemAlign.Center)
|
|
.alignSelf(ItemAlign.Center)
|
|
|
.margin({ left: 25 })
|
|
.margin({ left: 25 })
|
|
|
- Text('永久赞助:'+VipPage.TYPE_FOREVER+'元')
|
|
|
|
|
|
|
+ Text('永久赞助:'+VipPage.TYPE_FOREVER+'元 ')
|
|
|
.margin({ left: 10, right: 20 })
|
|
.margin({ left: 10, right: 20 })
|
|
|
.fontSize(15)
|
|
.fontSize(15)
|
|
|
.fontColor(Color.Gray)
|
|
.fontColor(Color.Gray)
|
|
|
.fontWeight(480)
|
|
.fontWeight(480)
|
|
|
.id('text_update')
|
|
.id('text_update')
|
|
|
|
|
+ Text('(原价¥39.8)')
|
|
|
|
|
+ .fontSize(14)
|
|
|
|
|
+ .fontColor(Color.Gray)
|
|
|
|
|
+ .decoration({ type: TextDecorationType.LineThrough })
|
|
|
Blank()
|
|
Blank()
|
|
|
Checkbox()
|
|
Checkbox()
|
|
|
.select(this.payPrice===VipPage.TYPE_FOREVER?true:false)
|
|
.select(this.payPrice===VipPage.TYPE_FOREVER?true:false)
|
|
@@ -500,7 +504,7 @@ export struct VipPage{
|
|
|
|
|
|
|
|
//需要德本的服务端支持,德本的接口返回prepayId
|
|
//需要德本的服务端支持,德本的接口返回prepayId
|
|
|
createWeChatOrder(CommonConstants.WX_PAY_APPID, CommonConstants.WX_PAY_MCHID,
|
|
createWeChatOrder(CommonConstants.WX_PAY_APPID, CommonConstants.WX_PAY_MCHID,
|
|
|
- this.appName, this.payPrice*100)
|
|
|
|
|
|
|
+ this.appName, this.payPrice*100,CommonConstants.OUT_TRADE_NO_PRE)
|
|
|
.then((prepayId: string) => {
|
|
.then((prepayId: string) => {
|
|
|
this.wechatPay(prepayId)
|
|
this.wechatPay(prepayId)
|
|
|
// console.log('onecold Prepay ID:', prepayId);
|
|
// console.log('onecold Prepay ID:', prepayId);
|
|
@@ -854,18 +858,19 @@ interface Amount {
|
|
|
|
|
|
|
|
//调用服务端接口,用户在商户APP端选择微信支付后,商户需调用该接口在微信支付下单,生成用于调起支付的预支付交易会话标识(prepay_id)。
|
|
//调用服务端接口,用户在商户APP端选择微信支付后,商户需调用该接口在微信支付下单,生成用于调起支付的预支付交易会话标识(prepay_id)。
|
|
|
async function createWeChatOrder(
|
|
async function createWeChatOrder(
|
|
|
- appid: string,
|
|
|
|
|
- mchid: string,
|
|
|
|
|
|
|
+ app_id: string,
|
|
|
|
|
+ mch_id: string,
|
|
|
description: string,
|
|
description: string,
|
|
|
amount: number,
|
|
amount: number,
|
|
|
|
|
+ out_trade_no_pre: string,
|
|
|
): Promise<string> {
|
|
): Promise<string> {
|
|
|
|
|
|
|
|
let requestUrl = CommonConstants.WX_PAY_API
|
|
let requestUrl = CommonConstants.WX_PAY_API
|
|
|
- + '?appid=' + encodeURIComponent(appid.trim())
|
|
|
|
|
- + '&mchid=' + encodeURIComponent(mchid.trim())
|
|
|
|
|
|
|
+ + '?app_id=' + encodeURIComponent(app_id.trim())
|
|
|
|
|
+ + '&mch_id=' + encodeURIComponent(mch_id.trim())
|
|
|
+ '&description=' + encodeURIComponent(description.trim())
|
|
+ '&description=' + encodeURIComponent(description.trim())
|
|
|
+ '&amount=' + encodeURIComponent(amount)
|
|
+ '&amount=' + encodeURIComponent(amount)
|
|
|
-
|
|
|
|
|
|
|
+ + '&out_trade_no_pre=' + encodeURIComponent(out_trade_no_pre)
|
|
|
LogUtil.debug("onecold 微信支付 requestUrl=" + requestUrl)
|
|
LogUtil.debug("onecold 微信支付 requestUrl=" + requestUrl)
|
|
|
|
|
|
|
|
|
|
|