1***@qq.com
1***@qq.com
  • 发布:2021-08-10 18:45
  • 更新:2021-08-10 18:45
  • 阅读:933

已解决:uni-app小程序支付宝, 富文本 显示问题

分类:uni-app

https://ext.dcloud.net.cn/plugin?id=263 使用这个,返回空数组,好无语,怎么解决

uniapp 支付宝小程序富文本,解决不支持String问题
https://blog.csdn.net/L630642270/article/details/100174595?utm_medium=distribute.pc_relevant.none-task-blog-2~default~BlogCommendFromBaidu~default-9.pc_relevant_baidujshouduan&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2~default~BlogCommendFromBaidu~default-9.pc_relevant_baidujshouduan

uniapp支付宝小程序 富文本处理
https://blog.csdn.net/weixin_42448623/article/details/114676455?utm_medium=distribute.pc_relevant_download.none-task-blog-baidujs-2.nonecase&depth_1-utm_source=distribute.pc_relevant_download.none-task-blog-baidujs-2.nonecase

import parse from "@/node_modules/mini-html-parser2"  
 export function zfbRichText(htmStr){  
    return new Promise((resolve, reject)=>{  
        parse(htmStr, (err, htmlNodes) => {  
            if(!err) {  
                 resolve(htmlNodes);  
            }  
        })  
    })  
}  
                     // #ifdef MP-ALIPAY  
          let html = '<div style="text-align:center;">12312313<span style="color:red">222</span></div>'  
          var brs = html.replace(/<br[^>]*>/gi, '<br/>').replace(/<img[^>]*>/gi, $ => $.replace(/>/gi,'\/>'));  
          zfbRichText(brs).then(res=>{_this.nodes = res})  
           // #endif   
2021-08-10 18:45 负责人:无 分享
已邀请:

该问题目前已经被锁定, 无法添加新回复