فهرست منبع

修复微信支付api的问题
修复内嵌歌词在播控中心无法显示

onecold 1 سال پیش
والد
کامیت
0364558437

+ 4 - 1
entry/src/main/ets/common/constants/CommonConstants.ets

@@ -83,12 +83,15 @@ export class CommonConstants {
 
 
   //德本的接口调用微信支付下单接口返回的支付交易会话ID,该值有效期为2小时。
-  static readonly WX_PAY_API: string = "https://pay.ss5.xyz/wechat/prepay?"
+  static readonly WX_PAY_API: string = "https://pay.ss5.xyz/wechat/prepay"
   //微信支付商务号 剑虾
   static readonly WX_PAY_MCHID: string = "1557416681"
   //微信支付应用的id
   static readonly WX_PAY_APPID: string = "wx263d1c80d204c3c0"
 
+
+  static readonly OUT_TRADE_NO_PRE: string = "TTJT"
+
   //微信支付的证书序列号id,在账户中心,API安全
   static readonly WX_PAY_SERIALNO: string = "60A30CD8E9591C492497DF601456767AE4E09065"
 

+ 15 - 10
entry/src/main/ets/pages/VipPage.ets

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

+ 7 - 5
entry/src/main/ets/view/LocalMusic.ets

@@ -4257,7 +4257,7 @@ export struct LocalMusic {
   /**
    * 初始化歌词加载与展示逻辑
    * @param lyricPath 歌词文件路径(支持普通.lrc和加密.lrcc)
-   * @param isToast 是否弹出Toast提示(可选)
+   * @param isToast 是否弹出Toast提示(可选)获取在线歌词为true
    * @param isApi2 是否使用API2获取歌词(可选)
    *
    * 主要流程:
@@ -4299,9 +4299,11 @@ export struct LocalMusic {
     let jiaMilyricPath = lyricPath.substring(0, lyricPath.lastIndexOf('.')) + '.lrcc'
     LogUtil.debug("onecold lyricPath =" + lyricPath)
 
-    const neiqianLrc = LrcParser.getLyrics(this.videoUrl);
+    const neiqianLrc = LrcParser.getLyrics(this.videoUrl);//获取内嵌歌词
     LogUtil.debug("onecold 找到内嵌歌词 neiqianLrc =" + neiqianLrc  )
-    if(StrUtil.isNotEmpty(neiqianLrc)){
+    if(StrUtil.isNotEmpty(neiqianLrc)&&!isToast){
+      //赋值给this.lyricContent,播控中心才可以显示歌词
+      this.lyricContent = neiqianLrc
       // 将文件内容按行分割成字符串数组
       let lines = neiqianLrc.split('\n').map(line => line.trim());
       // 3.解析歌词
@@ -4325,9 +4327,9 @@ export struct LocalMusic {
             LogUtil.debug("onecold 不是赞助会员")
             return
           }
-        if(!Utility.isPassInstallTime(10)){
+        if(!Utility.isPassInstallTime(12)){
             LogUtil.debug("onecold not pass time")
-            // LogUtil.debug("onecold 用户安装app没超过2天" )
+            // LogUtil.debug("onecold 用户安装app没超过12天" )
             return
           }
         }