소스 검색

分享朋友圈样式和位置

孙志雷 6 년 전
부모
커밋
e908c1f3c1

+ 1 - 0
component/my/my.js

@@ -1,3 +1,4 @@
+import APIClient from '../../utils/APIClient';
 export const myInit = (that) => {
   that.setData({
     myData: {

+ 9 - 4
component/share/share.js

@@ -62,15 +62,19 @@ Component({
         })
         .then(() => {
           debugger;
+          console.log(this.data.QRCodeImagePath);
           wx.getImageInfo({
             src: this.data.QRCodeImagePath,//服务器返回的图片地址
             success: function (res) {
+              console.log('下载content成功1')
+              console.log(res.path)
               //res.path是网络图片的本地地址
               ctx.drawImage(res.path, 227, 364, 135, 135);
 
 
 
 
+              console.log('下载content成功2')
               ctx.draw(true, function (res) {
                 wx.canvasToTempFilePath({
                   x: 0,
@@ -99,6 +103,7 @@ Component({
                   }
                 })
               })
+              console.log('下载content成功3')
 
 
 
@@ -289,7 +294,7 @@ Component({
       let group = new Promise((resolve, reject) => {
         //resolve(() => {
           ctx.fillText('郎朗读书声是世上最美的声音', 50, 138)
-        ctx.drawImage(this.data.groupPurchaseInfo.bgImg, 9, 205, 352, 145);
+          ctx.drawImage(this.data.iconImg, 9, 205, 352, 145);
           ctx.drawImage('../../../static/groupImg/Rectangle 41.png', 134, 358, 59, 20);
           ctx.setFontSize(14)
           ctx.setFillStyle('#fff')
@@ -301,13 +306,13 @@ Component({
           ctx.moveTo(64, 368)
           ctx.lineTo(114, 368)
           ctx.stroke()
-          ctx.fillText(`¥${parseFloat(this.data.groupPurchaseInfo.originPrice / 100).toFixed(2)}元`, 64, 373)
+          ctx.fillText(`¥${parseFloat(this.data.groupPurchaseInfo.originPrice / 100).toFixed(2)}元`, 54, 373)
           ctx.setFontSize(18)
           ctx.fillText('团购价仅需', 20, 403)
-          ctx.fillText('元', 174, 403)
+          ctx.fillText('元', 185, 403)
           ctx.setFontSize(20)
           ctx.setFillStyle('red')
-          ctx.fillText(`¥${parseFloat(this.data.groupPurchaseInfo.price / 100).toFixed(2)}`, 109, 403)
+          ctx.fillText(`¥${parseFloat(this.data.groupPurchaseInfo.price / 100).toFixed(2)}`, 115, 403)
           ctx.drawImage('../../../static/groupImg/share_bottom.png', 3, 419, 370, 192);
           ctx.setFontSize(20)
           ctx.setFillStyle('red')

+ 1 - 1
component/share/share.wxss

@@ -5,7 +5,7 @@
     top: 0;
     width: 100%;
     height: 100%;
-    background: rgba(0, 0, 0, .3);
+    background: rgba(0, 0, 0, .9);
     z-index: 99;
 }
 

+ 1 - 1
pages/groupPage/collage-details/collage-details.wxml

@@ -60,7 +60,7 @@
         * 转发给自己的朋友们,分享好课, 追随您一起学习进步。您的魅力不是吹的! * 如果拼团失败,您预付的课程费将在48小时内退回您的账户。
     </view>
 </view> 
-<canvas canvas-id="myCanvas" style="width:370px; height: 507px; position: absolute; left: -99rpx; top: -999rpx;"></canvas>
+<canvas canvas-id="myCanvas" style="width:370px; height: 507px; position: absolute; left: -999rpx; top: -9999rpx;"></canvas>
 <shareDialog id="share-dialog" shareType='group' shareId="{{orderId}}"/>
 
 <popup

+ 1 - 1
pages/groupPage/group-details/group-details.wxss

@@ -68,7 +68,7 @@
 
 .shengyu-time .time  text{
     position: absolute;
-    left: 2rpx;
+    left: 4rpx;
     top: 0;
     z-index: 2;
     color: #fff;

+ 1 - 1
pages/groupPage/make-money/make-money.wxml

@@ -43,5 +43,5 @@
     </view>
 </view>  
 
-<canvas canvas-id="myCanvas" style="width:370px; height: 507px; position: absolute; left: -99rpx; top: -999rpx;"></canvas>
+<canvas canvas-id="myCanvas" style="width:370px; height: 507px; position: absolute; left: -999rpx; top: -9999rpx;"></canvas>
 <shareDialog id="share-dialog" bindcustomevent="eventListener"/>

+ 1 - 1
pages/main/class/class.wxml

@@ -32,6 +32,6 @@
             <text>分享</text>
         </view>
     </view>
-    <canvas canvas-id="myCanvas" style="width:370px;z-index=99999; height: 507px; position: absolute; left: -99rpx; top: -999rpx;"></canvas>
+    <canvas canvas-id="myCanvas" style="width:370px;z-index=99999; height: 507px; position: absolute; left: -999rpx; top: -9999rpx;"></canvas>
     <shareDialog id="share-dialog" shareType='class' />
 </view>

+ 1 - 1
pages/social/works/works.wxml

@@ -67,7 +67,7 @@
         </view>
     </view>
     <!-- 分享框 -->
-    <canvas canvas-id="myCanvas" style="width:370px;z-index=99999; height: 507px; position: absolute; left: -99rpx; top: -999rpx;"></canvas>
+    <canvas canvas-id="myCanvas" style="width:370px;z-index=99999; height: 507px; position: absolute; left: -999rpx; top: -9999rpx;"></canvas>
     <shareDialog id="share-dialog" shareType='works' shareId="{{id}}" />
     <!-- 评论框 -->
     <view class="replySection" wx:if="{{replyModal}}">