浏览代码

海报修改

twt 2 年之前
父节点
当前提交
027984e49b
共有 2 个文件被更改,包括 34 次插入12 次删除
  1. 2 1
      pages/integral/integral.vue
  2. 32 11
      pages/shop/wp.vue

+ 2 - 1
pages/integral/integral.vue

@@ -42,6 +42,7 @@
 							<view class="exchangeName">{{item.name}}</view>
 							<view> <span class="jfspan1">{{item.integral}}</span> <span class="jfspan2">积分</span></view>
 						</view>
+						<view style="width: 20rpx;"></view>
 					<!-- </view> -->
 					
 				</scroll-view>
@@ -318,7 +319,7 @@
 	border-radius: 16rpx;
 	border: 1px solid #EEEEEE;
 	overflow: hidden;
-	width: 272rpx;
+	width: 270rpx;
 	display: inline-block;
 }
 .exchangeLineImg{

+ 32 - 11
pages/shop/wp.vue

@@ -63,17 +63,18 @@
 				this.sellingPoint=opt.sellingPoint;
 			}
 			console.log('this.sellingPoint==='+this.sellingPoint)
-			
-			if(this.nickname.length>18){
-				this.nickname=this.nickname.substring(0,18)+'...'
+			//console.log(this.nickname+this.nickname.length)
+			if(this.nickname.length>16){
+				this.nickname=this.nickname.substring(0,16)+'...'
 			}
+			//console.log(this.nickname+this.nickname.length)
 			this.userInfo=this.$store.state.userInfo;
 			this.ext=this.$common.getExtStoreId();
 			this.canvasW =uni.upx2px(600)
 			if(this.sellingPoint){
-				this.canvasH = uni.upx2px(817)
+				this.canvasH = uni.upx2px(840)
 			}else{
-				this.canvasH = uni.upx2px(717)
+				this.canvasH = uni.upx2px(740)
 			}
 			
 			var that=this;
@@ -162,18 +163,20 @@
 				const padding = uni.upx2px(34)
 				const cardHeight = uni.upx2px(380)
 				const cw = this.canvasW - 2 * padding
-
+               const r = uni.upx2px(12)
 				let ctx = uni.createCanvasContext('mini_poster', this)
                 // 左上角
 				var cx =  uni.upx2px(30)
 				var cy =  uni.upx2px(30)
+				//this._drawRoundRect(ctx, 30, 30, this.canvasW, this.canvasH, r)
                // ctx.arc(this.canvasW, 0, this.canvasW,this.canvasH, cx)
 				// 透明背景
-				// ctx.setFillStyle('rgba(255, 255, 255, 0)')
-				ctx.setFillStyle('#FFFFFF')
+				 ctx.setFillStyle('rgba(255, 255, 255, 0)')
+				//ctx.setFillStyle('#FFFFFF')
+				//ctx.setFillStyle('#D53533')
 				ctx.fillRect(0, 0, this.canvasW, this.canvasH)
 				// draw card round rect
-				const r = uni.upx2px(12)
+				this.drawback(ctx)
 				this.drawRoundRect(ctx, padding, padding, cw, cardHeight, r, 2)
 				// draw card content
 				this.drawCard(ctx, padding, padding, cw, cardHeight)
@@ -241,7 +244,7 @@
 				//let vp = y + uni.upx2px(45)
 				//const hp = x + uni.upx2px(52)
 				let vp =  uni.upx2px(400)
-				const hp = uni.upx2px(52)
+				const hp = uni.upx2px(36)
 				ctx.setTextBaseline('center')
 				const fz30 = uni.upx2px(32)
 				ctx.fillStyle = '#212121'
@@ -361,9 +364,12 @@
 			_drawRoundRect(ctx, x, y, w, h, r) {
 				ctx.beginPath()
 				// 左上角
+				console.log("x="+x+'y='+y+'w='+w+'h='+h+'r='+r)
 				ctx.arc(x + r, y + r, r, Math.PI, Math.PI * 1.5)
+				//ctx.arc(0, 0, 15, Math.PI, Math.PI * 1.5)
 				// 右上角
 				ctx.arc(x + w - r, y + r, r, Math.PI * 1.5, Math.PI * 2)
+				//ctx.arc(0, 0, 0, Math.PI, Math.PI * 1.5)
 				// 右下角
 				ctx.arc(x + w - r, y + h - r, r, 0, Math.PI * 0.5)
 				// 左下角
@@ -375,6 +381,8 @@
 				ctx.fill()
 			},
 			drawRoundRect(ctx, x, y, w, h, r, lineWidth) {
+				//return false;
+				
 				ctx.save()
 				//this._drawRoundRect(ctx, x, y, w, h, r)
 				ctx.clip()
@@ -385,11 +393,24 @@
 				}else{
 					var y=uni.upx2px(519)
 				}
-				
+				ctx.arc(0, 0, 15, Math.PI, Math.PI * 1.5)
 				var bWidth=uni.upx2px(600)
 			    ctx.fillRect(0, y, bWidth, 2)
 				ctx.restore()
 			},
+			drawback(ctx){
+				ctx.save()
+				var bWidth=uni.upx2px(12)
+				this._drawRoundRect(ctx, 0, 0, this.canvasW, this.canvasH,bWidth )
+				ctx.clip()
+				// draw left border
+				ctx.fillStyle = '#FFFFFF'
+				
+				
+				var bWidth=uni.upx2px(600)
+				ctx.fillRect(0, 0, bWidth, this.canvasH)
+				ctx.restore()
+			},
 			drawRoundRectAvatar(ctx, x, y, w, h, r, imgPath) {
 				ctx.save()
 				this._drawRoundRect(ctx, x, y, w, h, r)