lifuxiong 4 anos atrás
pai
commit
e706e50429

+ 12 - 0
app.js

@@ -3,10 +3,21 @@ const net = require("utils/net.js");
 const { api_app_config } = require("utils/api.js");
 App({
   onLaunch: function () {
+    this.checkGetSystemInfo();
     this.getAppConfig();
     this.checkForUpdate();
   },
 
+  checkGetSystemInfo: function () {
+    const self = this;
+    wx.getSystemInfo({
+      success: function (res) {
+        wx.setStorageSync("SYSTEMINFO", res);
+        self.globalData.windowHeight = res.windowHeight;
+      },
+    });
+  },
+
   getAppConfig() {
     const self = this;
     let params = {};
@@ -54,5 +65,6 @@ App({
   },
   globalData: {
     isRelease: false,
+    windowHeight: 0,
   },
 });

+ 6 - 3
components/bottomTabs/bottomTabs.wxss

@@ -24,14 +24,17 @@
   justify-content: center;
 }
 
-.share-btn {
+button {
+  background-color: transparent;
   padding: 0;
   margin: 0;
 }
 
-.share-btn::after,
-.share-btn::before {
+button::after,
+button::before {
   border: 0;
+  padding: 0;
+  margin: 0;
 }
 
 .item .icon {

+ 4 - 4
components/newCell/newCell.wxml

@@ -8,12 +8,12 @@
     <view class="flex flex-col flex-bet">
       <text class="title {{(historyObj[data.id] || isLook) && !isHistory ? 'normal' : ''}}">{{ data.title }}</text>
       <view class="imgs-wrap" wx:if="{{ data.imgsUrl.length >= 3 }}">
-        <image class="img img-three" lazy-load="{{true}}" wx:for="{{ data.imgsUrl }}" wx:key="index" mode="aspectFill"
+        <image class="img img-three" lazy-load="true" wx:for="{{ data.imgsUrl }}" wx:key="index" mode="aspectFill"
           src="{{ item }}"></image>
       </view>
     </view>
     <block wx:if="{{ data.imgsUrl.length && data.imgsUrl.length < 3 }}">
-      <image class="cover-img" lazy-load="{{true}}" mode="aspectFill" src="{{ data.imgsUrl[0] }}"></image>
+      <image class="cover-img" lazy-load="true" mode="aspectFill" src="{{ data.imgsUrl[0] }}"></image>
     </block>
   </view>
 </view>
@@ -23,8 +23,8 @@
   </user-card>
   <text class="content">{{ data.title }}</text>
   <view wx:if="{{ data.type == 2 }}" class="video-wrap">
-    <image class="video-img" lazy-load="{{true}}" mode="aspectFill"
-      src="{{ data.videoCoverImgUrl || data.coverImgUrl }}"></image>
+    <image class="video-img" lazy-load="true" mode="aspectFill" src="{{ data.videoCoverImgUrl || data.coverImgUrl }}">
+    </image>
     <image class="video-icon" src="../../images/play.png"></image>
   </view>
   <tags-card tag-list="{{data.tagList}}"></tags-card>

+ 30 - 13
components/painter/lib/pen.js

@@ -28,7 +28,7 @@ export default class Painter {
     this._doClip(this.data.borderRadius, width, height);
     if (!bg) {
       // 如果未设置背景,则默认使用白色
-      this.ctx.setFillStyle("#fff");
+      this.ctx.fillStyle = "#fff";
       this.ctx.fillRect(-(width / 2), -(height / 2), width, height);
     } else if (
       bg.startsWith("#") ||
@@ -36,7 +36,7 @@ export default class Painter {
       bg.toLowerCase() === "transparent"
     ) {
       // 背景填充颜色
-      this.ctx.setFillStyle(bg);
+      this.ctx.fillStyle = bg;
       this.ctx.fillRect(-(width / 2), -(height / 2), width, height);
     } else {
       // 背景填充图片
@@ -77,8 +77,8 @@ export default class Painter {
       const r = Math.min(borderRadius.toPx(), width / 2, height / 2);
       // 防止在某些机型上周边有黑框现象,此处如果直接设置 setFillStyle 为透明,在 Android 机型上会导致被裁减的图片也变为透明, iOS 和 IDE 上不会
       // setGlobalAlpha 在 1.9.90 起支持,低版本下无效,但把 setFillStyle 设为了 white,相对默认的 black 要好点
-      this.ctx.setGlobalAlpha(0);
-      this.ctx.setFillStyle("white");
+      this.ctx.globalAlpha = 0;
+      this.ctx.fillStyle = "white";
       this.ctx.beginPath();
       this.ctx.arc(
         -width / 2 + r,
@@ -117,7 +117,7 @@ export default class Painter {
       ) {
         this.ctx.clip();
       }
-      this.ctx.setGlobalAlpha(1);
+      this.ctx.globalAlpha = 1;
     }
   }
 
@@ -194,8 +194,9 @@ export default class Painter {
         width = view.css.width ? view.css.width.toPx() : textLength;
         // 计算行数
         const calLines = Math.ceil(textLength / width);
-        const lines =
-          view.css.maxLines < calLines ? view.css.maxLines : calLines;
+        const maxLines = view.css.maxLines;
+        const lines = maxLines < calLines ? maxLines : calLines;
+
         let lineHeight = view.css.lineHeight
           ? view.css.lineHeight.toPx()
           : view.css.fontSize.toPx();
@@ -203,6 +204,7 @@ export default class Painter {
         height = lineHeight * lines;
         extra = {
           lines: lines,
+          maxLines: maxLines || 0,
           lineHeight: lineHeight,
         };
         break;
@@ -344,29 +346,43 @@ export default class Painter {
     }
     this.ctx.save();
     const { width, height, extra } = this._preProcess(view);
-    this.ctx.setFillStyle(view.css.color || "black");
-    const { lines, lineHeight } = extra;
+    this.ctx.fillStyle = view.css.color || "black";
+    const { lines, lineHeight, maxLines } = extra;
     const preLineLength = Math.round(view.text.length / lines);
     let start = 0;
     let alreadyCount = 0;
+
+    // 先获取一个文字的宽度
+    let alphabetStart = 0;
+    let alphabet = view.text.substr(alphabetStart, alphabetStart + 1);
+    let alphabetWith = this.ctx.measureText(alphabet).width;
+    while (!alphabetWith) {
+      alphabet = view.text.substr(++alphabetStart, alphabetStart + 1);
+      alphabetWith = this.ctx.measureText(alphabet).width;
+    }
+
     for (let i = 0; i < lines; ++i) {
-      alreadyCount = preLineLength;
+      alreadyCount =
+        maxLines > 0 ? Number(width / alphabetWith) : preLineLength;
       let text = view.text.substr(start, alreadyCount);
       let measuredWith = this.ctx.measureText(text).width;
       // 如果测量大小小于width一个字符的大小,则进行补齐,如果测量大小超出 width,则进行减除
-      // 如果已经到文本末尾,也不要进行该循环
+      // 如果已经到文本末尾,也不要进行该循
       while (
         start + alreadyCount <= view.text.length &&
         (width - measuredWith > view.css.fontSize.toPx() ||
-          measuredWith > width)
+          (measuredWith > width && !isStop))
       ) {
         if (measuredWith < width) {
+          console.log("+++++++++", view.css.fontSize);
           text = view.text.substr(start, ++alreadyCount);
         } else {
           if (text.length <= 1) {
             // 如果只有一个字符时,直接跳出循环
             break;
           }
+          console.log("---------", view.css.fontSize);
+
           text = view.text.substr(start, --alreadyCount);
         }
         measuredWith = this.ctx.measureText(text).width;
@@ -384,6 +400,7 @@ export default class Painter {
         text += "...";
         measuredWith = this.ctx.measureText(text).width;
       }
+      console.log("ssss====", text, measuredWith);
       this.ctx.setTextAlign(view.css.align ? view.css.align : "left");
       let x;
       switch (view.css.align) {
@@ -435,7 +452,7 @@ export default class Painter {
   _drawAbsRect(view) {
     this.ctx.save();
     const { width, height } = this._preProcess(view);
-    this.ctx.setFillStyle(view.css.backgroundColor || "#FFFFFF");
+    this.ctx.fillStyle = view.css.backgroundColor || "#FFFFFF";
     this.ctx.fillRect(-(width / 2), -(height / 2), width, height);
     this.ctx.restore();
     this._doBorder(view, width, height);

+ 2 - 1
components/painter/painter.js

@@ -113,6 +113,7 @@ Component({
         let preCount = 0;
         let completeCount = 0;
         const paletteCopy = JSON.parse(JSON.stringify(this.properties.palette));
+        console.log("sssss====", paletteCopy);
         if (paletteCopy.background) {
           preCount++;
           downloader.download(paletteCopy.background).then(
@@ -216,7 +217,7 @@ Component({
             Math.abs(
               (infoRes.width * that.canvasHeightInPx -
                 that.canvasWidthInPx * infoRes.height) /
-              (infoRes.height * that.canvasHeightInPx)
+                (infoRes.height * that.canvasHeightInPx)
             ) < 0.01
           ) {
             that.triggerEvent("imgOK", {

Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 0
components/parser.min/trees/trees.js


Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 0
components/parser.min/trees/trees.wxml


+ 1 - 1
components/poster/poster.wxml

@@ -1,7 +1,7 @@
 <!-- type = 1 文章  type = 2 视频  type =  帖子   -->
 <view class="poster-global {{obj.type != 3 ? 'is-visibility ':''}}">
   <view id="container" class="poster-container canvas-part">
-    <view id="above" class="poster-above canvas-part">
+    <view id="rect" class="poster-above canvas-part">
       <view id="rect" class="poster-photo-wrapper canvas-part">
         <image id="coverImage" class="poster-photo canvas-part" mode="widthFix"
           src="{{ obj.coverImg || 'https://static.hoolihome.com/weapp/daily/poster-cover.png' }}"

+ 1 - 2
components/selectImgs/selectImgs.js

@@ -81,7 +81,7 @@ Component({
       const { imgsList, maxSize, imgsUrl, imgsListObj } = this.data;
       let index = imgsList.length;
       wx.chooseImage({
-        count: 9 - imgsListObj.length,
+        count: this.properties.maxCount - imgsListObj.length,
         sizeType: ["compressed"],
         sourceType: [type],
         success(res) {
@@ -151,7 +151,6 @@ Component({
           }
           imgsUrl.splice(index, 1, obj);
           this.triggerEvent("imgs", { imgs: imgsUrl });
-          console.log("object====", imgsUrl);
           this.setData({
             [`imgsListObj[${index}]`]: imgObj,
           });

+ 5 - 4
components/tagsCard/tagsCard.wxss

@@ -2,7 +2,7 @@
 .tags-wrap {
   display: flex;
   flex-wrap: wrap;
-  margin-top: 20rpx;
+  margin-top: 10rpx;
 }
 
 .tags-wrap .tag {
@@ -13,9 +13,10 @@
   padding: 10rpx 20rpx;
   background: #f6f6f6;
   border-radius: 28px;
-  margin-left: 12rpx;
+  margin-right: 12rpx;
+  margin-top: 10rpx;
 }
 
-.tags-wrap .tag:first-child {
-  margin-left: 0;
+.tags-wrap .tag:last-child {
+  margin-right: 0;
 }

+ 4 - 0
components/userCard/userCard.js

@@ -20,6 +20,10 @@ Component({
       type: Boolean,
       value: true,
     },
+    isLike: {
+      type: Boolean,
+      value: true,
+    },
     isShowMore: {
       type: Boolean,
       value: false,

+ 3 - 2
pages/index/index.js

@@ -2,12 +2,13 @@
 const net = require("../../utils/net.js");
 const util = require("../../utils/util.js");
 const { api_news_list, api_category_list } = require("../../utils/api.js");
+const app = getApp();
 Page({
   data: {
     newList: [],
-    scrollH: 500,
+    scrollH: app.globalData.windowHeight - 80,
     categoryList: [],
-    limit: 20,
+    limit: 10,
     categoryId: null,
     selectTab: 0,
     historyObj: {},

+ 2 - 1
pages/index/index.wxml

@@ -9,7 +9,8 @@
   </view>
   <!-- <block wx:for="{{ categoryList }}" wx:key="index"> -->
   <!-- hidden="{{ selectTab != index }}" -->
-  <scroll-view scroll-y="true" scroll-top="{{scrollTop}}" style="height: {{ scrollH }}px;" upper-threshold="{{ 100 }}"
+  <scroll-view scroll-y="true" enable-back-to-top="true" scroll-top="{{scrollTop}}"
+    style="height: {{ scrollH }}px;-webkit-overflow-scrolling: touch" upper-threshold="{{ 100 }}"
     refresher-enabled="{{true}}" refresher-triggered="{{isRefresh}}" bindrefresherrefresh="refresherrefresh"
     bindscrolltolower="scrollToLower">
     <block wx:if="{{ newList[selectTab].length }}">

+ 3 - 2
pages/loginMobile/loginMobile.js

@@ -21,12 +21,13 @@ Page({
   onLoad: function () {
     const prefixArr = util.getStorageSync("MOBILEPREFIXDATA");
     if (prefixArr) {
+      prefixArr = JSON.parse(decodeURIComponent(prefixArr));
       this.setData(
         {
-          prefixArr: JSON.parse(decodeURIComponent(prefixArr)),
+          prefixArr: prefixArr,
         },
         () => {
-          this.selectPrefix86(JSON.parse(decodeURIComponent(prefixArr)));
+          this.selectPrefix86(prefixArr);
         }
       );
     } else {

+ 13 - 2
pages/newDetail/newDetail.js

@@ -76,6 +76,12 @@ Page({
       }, 800);
     }
   },
+
+  onUnload: function () {
+    if (this._palette) {
+      this._palette = null;
+    }
+  },
   /**
    * 用户点击右上角分享
    */
@@ -509,9 +515,9 @@ Page({
           isShowQRPoster: false,
         },
         () => {
-          let palette = new Poster().palette(arr);
+          this._palette = new Poster().palette(arr);
           this.setData({
-            template: palette,
+            template: this._palette,
           });
         }
       );
@@ -539,6 +545,11 @@ Page({
       }
     );
   },
+
+  onImgErr: function () {
+    util.showToast({ title: "生成分享海报失败,请您稍后再试..." });
+  },
+
   saveImgAction: function () {
     const _this = this;
     wx.saveImageToPhotosAlbum({

+ 20 - 23
pages/newDetail/newDetail.wxml

@@ -10,11 +10,11 @@
         object-fit="contain" poster="{{ detailData.videoCoverImgUrl }}" bind:loadedmetadata="loadedVideoMetaData"
         bind:fullscreenchange="fullscreenVideochange"></video>
     </view>
-
     <view class="continer" wx:if="{{detailData}}">
       <block wx:if="{{ detailData.type !== 1 }}">
         <user-card layout-type="{{detailData.type == 3 ? 1 : 3}}" author-info="{{detailData.authorInfo}}"
-          time="{{detailData.createTimeText}}" is-like="{{detailData.isAttention}}" is-author="{{detailData.isAuthor}}">
+          time="{{detailData.createTimeText}}" is-like="{{!!detailData.isAttention}}"
+          is-author="{{detailData.isAuthor}}">
         </user-card>
         <text class="video-title">{{ detailData.title || detailData.content }}</text>
         <block wx:if="{{detailData.type == 3 && detailData.imgsUrl && detailData.imgsUrl.length}}">
@@ -46,26 +46,23 @@
     </comment-cell>
   </block>
   <empty wx:if="{{isEmpty}}" tips="还没有任何人评论哦" is-fixed="{{false}}"></empty>
-  <message-textarea wx:if="{{showInput}}" reply-name="{{replyName}}" is-author="{{isAuthor}}" autofocus="{{showInput}}"
-    inputValue="{{inputValue}}" bindblur="onBlur" bind:send="sendCommentAction">
-  </message-textarea>
-  <bottom-tabs wx:if="{{!isFullScreen && detailData}}" sub-id="{{newId}}" like-num="{{likeNum}}"
-    comment-num="{{ totalCount }}" is-like="{{detailData.isLike}}" is-author="{{detailData.isAuthor}}"
-    bind:like="handleLikeAction" bind:reply="tapReplyAction" bind:message="tapMessageAction"
-    bind:poster="handleGeneratePoster">
-  </bottom-tabs>
-
-  <cover-view wx:if="{{isShowPostMask}}" catchtouchmove="true" class='mask'>
-    <cover-view class="mask-container">
-      <cover-image class="post-img" bind:load="shareQRImgLoad" src='{{shareQRImgSrc}}'></cover-image>
-      <cover-view wx:if="{{shareQRImgLoad}}" class="save-btn">已保存到相册,快去分享吧</cover-view>
-    </cover-view>
-    <cover-image class="pose-close-img" bindtap='postMaskHide' src="../../images/close.png"></cover-image>
+</view>
+<message-textarea wx:if="{{showInput}}" reply-name="{{replyName}}" is-author="{{isAuthor}}" autofocus="{{showInput}}"
+  inputValue="{{inputValue}}" bindblur="onBlur" bind:send="sendCommentAction">
+</message-textarea>
+<bottom-tabs wx:if="{{!isFullScreen && detailData}}" sub-id="{{newId}}" like-num="{{likeNum}}"
+  comment-num="{{ totalCount }}" is-like="{{detailData.isLike}}" is-author="{{detailData.isAuthor}}"
+  bind:like="handleLikeAction" bind:reply="tapReplyAction" bind:message="tapMessageAction"
+  bind:poster="handleGeneratePoster">
+</bottom-tabs>
+<cover-view wx:if="{{isShowPostMask}}" catchtouchmove="true" class='mask'>
+  <cover-view class="mask-container">
+    <cover-image class="post-img" bind:load="shareQRImgLoad" src='{{shareQRImgSrc}}'></cover-image>
+    <cover-view wx:if="{{shareQRImgLoad}}" class="save-btn">已保存到相册,快去分享吧</cover-view>
   </cover-view>
-
-
-  <poster wx:if="{{isShowQRPoster}}" obj="{{extendObj}}" barcodeImgUrl="{{postImgSrc}}"></poster>
-  <view wx:if="{{isShowCanvas}}" class="canvas-conatiner">
-    <painter palette="{{template}}" bind:imgOK="onImgOK" />
-  </view>
+  <cover-image class="pose-close-img" bindtap='postMaskHide' src="../../images/close.png"></cover-image>
+</cover-view>
+<poster wx:if="{{isShowQRPoster}}" obj="{{extendObj}}" barcodeImgUrl="{{postImgSrc}}"></poster>
+<view wx:if="{{isShowCanvas}}" class="canvas-conatiner">
+  <painter palette="{{template}}" bind:imgOK="onImgOK" bind:imgErr="onImgErr" />
 </view>

+ 0 - 99
pages/newDetail/newDetail.wxss

@@ -70,90 +70,6 @@ page {
   margin-top: 20rpx;
 }
 
-.new-detail .bottom-wrap {
-  position: fixed;
-  left: 0;
-  right: 0;
-  bottom: 0;
-  display: flex;
-  padding-top: 13rpx;
-  padding-bottom: calc(var(--safe-area-inset-bottom, 0) + 13rpx);
-  background-color: #fff;
-}
-
-.new-detail .bottom-wrap .line {
-  position: absolute;
-  top: 0;
-  left: 0;
-  right: 0;
-  height: 1rpx;
-  background-color: #efefef;
-}
-
-.new-detail .bottom-wrap .btn-wrap {
-  flex: 1;
-  display: flex;
-  align-items: center;
-  justify-content: center;
-}
-
-.new-detail .bottom-wrap .share-btn {
-  flex: 1;
-  display: flex;
-  flex-direction: row;
-  align-items: center;
-  justify-content: center;
-}
-
-.new-detail .bottom-wrap .btn-wrap .txt {
-  font-size: 32rpx;
-  font-family: PingFangSC-Regular, PingFang SC;
-  font-weight: 400;
-  color: rgba(51, 51, 51, 1);
-}
-
-.new-detail .bottom-wrap .btn-wrap .img {
-  width: 42rpx;
-  height: 42rpx;
-  margin-right: 16rpx;
-}
-
-button {
-  background-color: transparent;
-  line-height: unset;
-  border-radius: unset;
-  padding: 0;
-  margin: 0;
-}
-
-button::after,
-button::before {
-  border: 0;
-  padding: 0;
-  margin: 0;
-}
-
-.tags-wrap {
-  display: flex;
-  flex-wrap: wrap;
-  margin-top: 20rpx;
-}
-
-.tags-wrap .tag {
-  font-size: 24rpx;
-  font-family: PingFangSC-Medium, PingFang SC;
-  font-weight: 500;
-  color: rgba(51, 51, 51, 1);
-  padding: 10rpx 20rpx;
-  background: #f6f6f6;
-  border-radius: 28px;
-  margin-left: 20rpx;
-}
-
-.tags-wrap .tag:first-child {
-  margin-left: 0;
-}
-
 .mask {
   position: fixed;
   top: 0;
@@ -194,21 +110,6 @@ button::before {
   text-align: center;
 }
 
-button {
-  background-color: transparent;
-  line-height: unset;
-  border-radius: unset;
-  padding: 0;
-  margin: 0;
-}
-
-button::after,
-button::before {
-  border: 0;
-  padding: 0;
-  margin: 0;
-}
-
 .canvas-conatiner {
   position: absolute;
   top: 20000px;

+ 4 - 2
pages/postList/postList.js

@@ -1,6 +1,8 @@
 const net = require("../../utils/net.js");
 const util = require("../../utils/util.js");
 const { api_news_list, api_tips_delete } = require("../../utils/api.js");
+const app = getApp();
+
 Page({
   /**
    * 页面的初始数据
@@ -8,8 +10,8 @@ Page({
   data: {
     postList: [],
     page: 1,
-    limit: 20,
-    scrollH: 500,
+    limit: 10,
+    scrollH: app.globalData.windowHeight - 60,
     isEmpty: false,
     isEnd: false,
     isRefresh: false,

+ 2 - 2
pages/postList/postList.wxml

@@ -1,7 +1,8 @@
 <!--pages/post/post.wxml-->
 <view class="post-page">
     <nav-bar id="navBar" back="{{false}}" title="圈子" home="{{false}}"></nav-bar>
-    <scroll-view scroll-y="true" scroll-top="{{scrollTop}}" style="height: {{ scrollH }}px;" upper-threshold="{{ 100 }}"
+    <scroll-view scroll-y="true" enable-back-to-top="true" scroll-top="{{scrollTop}}"
+        style="height: {{ scrollH }}px;-webkit-overflow-scrolling: touch" upper-threshold="{{ 100 }}"
         refresher-enabled="{{true}}" refresher-triggered="{{isRefresh}}" bindrefresherrefresh="refresherrefresh"
         bindscrolltolower="scrollToLower">
         <block wx:if="{{postList && postList.length}}">
@@ -12,5 +13,4 @@
         <view wx:if="{{!isEmpty &&isEnd}}" class="end-txt">已显示全部内容</view>
     </scroll-view>
     <publish-btn></publish-btn>
-
 </view>

+ 4 - 1
pages/pulishPost/pulishPost.js

@@ -66,7 +66,7 @@ Page({
   tapPulishAction() {
     const { tagIdList, inputValue, imgs } = this.data;
     const imgsUrl = [];
-    if (imgs.length || inputValue.length) {
+    if ((imgs.length || inputValue.length) && !this._isPulish) {
       for (let i = 0, n = imgs.length; i < n; i++) {
         const imgObj = imgs[i];
         if (imgObj.type != 3) {
@@ -89,6 +89,7 @@ Page({
       util.showLoading({
         title: "发布中...",
       });
+      this._isPulish = true;
       net.req(params, true).then(
         (data) => {
           util.showToast({ title: "发布成功" });
@@ -99,10 +100,12 @@ Page({
             reloadPage.refreshCallback();
           wx.navigateBack();
           util.hideLoading();
+          this._isPulish = false;
         },
         (e) => {
           util.showToast({ title: e.msg || "" });
           util.hideLoading();
+          this._isPulish = false;
         }
       );
     } else {

+ 4 - 2
project.config.json

@@ -41,7 +41,9 @@
 			"disablePlugins": [],
 			"outputPath": ""
 		},
-		"bundle": true
+		"bundle": true,
+		"useCompilerModule": false,
+		"userConfirmedUseCompilerModuleSwitch": false
 	},
 	"compileType": "miniprogram",
 	"libVersion": "2.11.0",
@@ -88,7 +90,7 @@
 					"id": 1,
 					"name": "pages/newDetail/newDetail",
 					"pathName": "pages/newDetail/newDetail",
-					"query": "newId=1112",
+					"query": "newId=1237",
 					"scene": null
 				},
 				{

+ 6 - 4
utils/poster.js

@@ -56,7 +56,7 @@ export default class Poster {
                 width: `${width}px`,
                 height: `${height}px`,
                 backgroundColor: `${backgroundColor || "#FFFFFF"}`,
-                borderRadius: `${borderRadius}`,
+                borderRadius: `${borderRadius || 0}`,
               },
             });
             break;
@@ -69,14 +69,17 @@ export default class Poster {
                 top: `${top}px`,
                 width: `${width}px`,
                 height: `${height}px`,
-                borderRadius: `${borderRadius}`,
+                borderRadius: `${borderRadius || 0}`,
               },
             });
             break;
           case "coverImage":
             canvasObj.views.push({
               type: "image",
-              url: uri || what,
+              url:
+                uri ||
+                what ||
+                "https://static.hoolihome.com/weapp/daily/poster-cover.png",
               css: {
                 left: `${left}px`,
                 top: `${top}px`,
@@ -85,7 +88,6 @@ export default class Poster {
               },
             });
             break;
-
           case "content":
             canvasObj.views.push({
               type: "text",

Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff