lyqu 4 년 전
부모
커밋
629383ac7c

+ 3 - 3
components/works-poster/works-poster.vue

@@ -86,17 +86,17 @@
 				//绘制热力值
 				this.ctx.setFontSize(24);
 				this.ctx.setFillStyle('#000000');
-				this.ctx.fillText(this.works.hotValue ,((this.canvasW-hW) / 2) + uni.upx2px(380),(((this.canvasW-hW) / 2) + hH + uni.upx2px(280)))
+				this.ctx.fillText(this.works.hotValue ,((this.canvasW-hW) / 2) + uni.upx2px(2),(((this.canvasW-hW) / 2) + hH + uni.upx2px(390)))
 				
 				//绘制排名
 				this.ctx.setFontSize(12);
 				this.ctx.setFillStyle('#000000');
-				this.ctx.fillText("热力榜第"+this.works.rank ,((this.canvasW-hW) / 2) + uni.upx2px(380),(((this.canvasW-hW) / 2) + hH + uni.upx2px(320)))
+				this.ctx.fillText("热力榜第 "+this.works.rank ,((this.canvasW-hW) / 2) + uni.upx2px(2),(((this.canvasW-hW) / 2) + hH + uni.upx2px(430)))
 				
 				//提示文案
 				this.ctx.setFontSize(12);
 				this.ctx.setFillStyle('#858585');
-				this.ctx.fillText('来自 '+ this.works.name +' 的分享',(((this.canvasW-hW) / 2)),(((this.canvasW-hW) / 2) + hH + uni.upx2px(440)))
+				this.ctx.fillText('来自 '+ this.works.name +' 的分享',(((this.canvasW-hW) / 2)),(((this.canvasW-hW) / 2) + hH + uni.upx2px(500)))
 				//底部广告
 				// let BottomAdImg = await this.getImageInfo(this.abImg)
 				// this.ctx.drawImage(BottomAdImg.path,(((this.canvasW-hW) / 2)),(((this.canvasW-hW) / 2) + hH + uni.upx2px(310)),uni.upx2px(350),uni.upx2px(110))

+ 6 - 1
pages/activityList/activity/authorBoost.vue

@@ -1,6 +1,6 @@
 <template>
 	<view>
-		<view v-if="!$u.test.isEmpty(boostDetail.cover)"  class="bg-img" style="height: 563upx;" :style="{'backgroundImage':'url('+ boostDetail.cover +')'}"></view>
+		<view v-if="!$u.test.isEmpty(boostDetail.cover)" @click="preViewImg(boostDetail.cover)" class="bg-img" style="height: 563upx;" :style="{'backgroundImage':'url('+ boostDetail.cover +')'}"></view>
 		<view v-else class="bg-img"  style="height: 563upx;background-image: url('https://yyzs.nanyue6688.com/obsfile/ea1a9741a5d5469e967dac8e8e7f0c9d-singerBg.png');"></view>
 		<view class="homeBtn" @click="home">
 			<image src="/static/home.png" style="width: 40upx;height: 40upx;" />
@@ -367,6 +367,11 @@
 					this.presentDetail = res;
 					this.dialogShow = true;
 				})
+			},
+			preViewImg(url) {
+				uni.previewImage({
+					urls: [url]
+				});
 			}
 		}
 	}

+ 6 - 1
pages/activityList/activity/musicBoost.vue

@@ -3,7 +3,7 @@
 		<view v-if="boostDetail.urlsType == 1">
 			<video :src="boostDetail.urls" style="width: 100%;height: 400upx;"></video>
 		</view>
-		<view v-else  class="bg-img" style="height: 563upx;" :style="{'backgroundImage':'url('+ boostDetail.urls +')'}"></view>
+		<view v-else  class="bg-img" style="height: 563upx;" @click="preViewImg(boostDetail.urls)" :style="{'backgroundImage':'url('+ boostDetail.urls +')'}"></view>
 		<view class="homeBtn" @click="home">
 			<image src="/static/home.png" style="width: 40upx;height: 40upx;" />
 		</view>
@@ -381,6 +381,11 @@
 					this.presentDetail = res;
 					this.dialogShow = true;
 				})
+			},
+			preViewImg(url) {
+				uni.previewImage({
+					urls: [url]
+				});
 			}
 		}
 	}

+ 6 - 4
pages/activityList/activity/signUp.vue

@@ -8,7 +8,7 @@
 			</block>
 			<block v-else>
 				<block v-if="data.urlsType == 0">
-					<image :src="data.urls" style="height: 400upx;" @click="preViewImg(data.urls)"></image>
+					<image :src="data.urls" style="height: 400upx;" mode="aspectFit" @click.stop="preViewImg(data.urls)"></image>
 				</block>
 				<block v-else>
 					<video :src="data.urls" style="height: 400upx;"></video>
@@ -21,7 +21,7 @@
 				<view class="text-black text-bold text-sm">请上传作品封面</view>
 			</block>
 			<block v-else>
-				<image :src="data.cover" style="height: 400upx;" @click="preViewImg(data.cover)"></image>
+				<image :src="data.cover" style="height: 400upx;" mode="aspectFit" @click.stop="preViewImg(data.cover)"></image>
 			</block>
 		</view>
 		
@@ -109,6 +109,7 @@
 					filePath: path,
 					name: 'file',
 					success: (uploadFileRes) => {
+						this.data.urls = JSON.parse(uploadFileRes.data).data;
 						this.data.cover = JSON.parse(uploadFileRes.data).data;
 					}
 				});
@@ -121,7 +122,8 @@
 				this.data.urlsType = index
 				if (index == 0) {
 					//上传图片
-					res = await this.$mpi.uploadFile()
+					// res = await this.$mpi.uploadFile()
+					this.chooseAvatar();
 				} else {
 					//上传视频
 					res = await this.$mpi.uploadVideo()
@@ -164,7 +166,7 @@
 						// 输出图片宽度,高等于宽,单位px
 						destWidth: 300,
 						// 裁剪框宽度,高等于宽,单位px
-						rectWidth: 280,
+						rectWidth: 300,
 						// 输出的图片类型,如果'png'类型发现裁剪的图片太大,改成"jpg"即可
 						fileType: 'jpg',
 					}

+ 10 - 3
pages/activityList/mine/myMusic.vue

@@ -2,7 +2,7 @@
 	<view>
 		<view v-if="data.cover" class="bg-img flex align-center" :style="[{backgroundImage:'url('+ data.cover +')'}]" style="height: 450upx;" @click="selectShow = true"></view>
 		<view v-else class="flex justify-center align-center"  style="height: 450upx;background-color: #5a3ee8;">
-			<view class="text-white" @click="uploadCover">
+			<view class="text-white" @click="chooseAvatar">
 				<text class="cuIcon-add " style="font-size: 120rpx;"></text>
 				<view>上传封面</view>
 			</view>
@@ -120,6 +120,12 @@
 		 			name: 'file',
 		 			success: (uploadFileRes) => {
 		 				this.data.cover = JSON.parse(uploadFileRes.data).data;
+						this.$u.api.user.submit({
+							id: uni.getStorageSync("userId"),
+							cover: JSON.parse(uploadFileRes.data).data
+						}).then(res=>{
+							this.fetchMineData()
+						})
 		 			}
 		 		});
 		 	})
@@ -148,6 +154,7 @@
 				})
 			},
 			chooseAvatar() {
+				console.log("触发裁剪方法");
 				// 此为uView的跳转方法,详见"文档-JS"部分,也可以用uni的uni.navigateTo
 				this.$u.route({
 					// 关于此路径,请见下方"注意事项"
@@ -157,7 +164,7 @@
 						// 输出图片宽度,高等于宽,单位px
 						destWidth: 300,
 						// 裁剪框宽度,高等于宽,单位px
-						rectWidth: 280,
+						rectWidth: 300,
 						// 输出的图片类型,如果'png'类型发现裁剪的图片太大,改成"jpg"即可
 						fileType: 'jpg',
 					}
@@ -205,7 +212,7 @@
 						urls: [this.data.cover]
 					})
 				} else {
-					this.uploadCover();
+					this.chooseAvatar();
 				}
 			}
 		}