forked from gxwebsoft/mp-10550
refactor(components): 重构 CouponCard 组件样式
- 优化了 CouponCard 组件的视觉效果,增加了更多细节和动画 - 添加了响应式样式,提高了移动端体验 - 新增了 CouponList组件样式,用于展示优惠券列表
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import Taro from '@tarojs/taro'
|
||||
import { goTo } from './navigation'
|
||||
|
||||
export default function navTo(url: string, isLogin = false) {
|
||||
if (isLogin) {
|
||||
@@ -11,14 +12,13 @@ export default function navTo(url: string, isLogin = false) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Taro.navigateTo({
|
||||
url: url
|
||||
})
|
||||
// 使用新的导航工具,自动处理路径格式化
|
||||
goTo(url)
|
||||
}
|
||||
|
||||
|
||||
// 转base64
|
||||
export function fileToBase64(filePath) {
|
||||
export function fileToBase64(filePath:string) {
|
||||
return new Promise((resolve) => {
|
||||
let fileManager = Taro.getFileSystemManager();
|
||||
fileManager.readFile({
|
||||
@@ -35,7 +35,7 @@ export function fileToBase64(filePath) {
|
||||
* 转义微信富文本图片样式
|
||||
* @param htmlText
|
||||
*/
|
||||
export function wxParse(htmlText) {
|
||||
export function wxParse(htmlText:string) {
|
||||
// Replace <img> tags with max-width, height and margin styles to remove spacing
|
||||
htmlText = htmlText.replace(/\<img/gi, '<img style="max-width:100%;height:auto;margin:0;padding:0;display:block;"');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user