achao před 2 roky
rodič
revize
ddccd5a07f

+ 9 - 2
xiaochengxu/components/zhangyuhao-poster/Poster.vue

@@ -69,6 +69,14 @@ list参数说明:
 			};
 		},
 		watch: {
+			list(newVal, oldVal){
+				debugger
+				this.list = newVal
+				if(this.list.length!=0){
+					this.generateImg()
+					console.log('mounted')
+				}
+			},
 			drawPathQueue(newVal, oldVal) {
 				// 绘制单行文字
 				const fillText = (textOptions) => {
@@ -237,8 +245,7 @@ list参数说明:
 		},
 		mounted() {
 			this.ctx = uni.createCanvasContext('myCanvas', this)
-			this.generateImg()
-			console.log('mounted')
+			
 		},
 
 		methods: {

+ 24 - 23
xiaochengxu/pages.json

@@ -2,7 +2,29 @@
 	"easycom": {
 		"^u-(.*)": "@/uni_modules/uview-ui/components/u-$1/u-$1.vue"
 	},
-	"pages": [{
+	"pages": [
+		{
+			"path": "pages/cardHolder/cardHolder",
+			"style": {
+				"navigationBarTitleText": "电子名片",
+				"navigationStyle": "custom"
+				// 	"enablePullDownRefresh": false,
+				// 	"app-plus": {
+				// 		"titleNView": {
+				// 			"autoBackButton": false,
+				// 			"backgroundColor": "#fff",
+				// 			"buttons": [{
+				// 				"fontSrc": "/static/icons/iconfont.ttf",
+				// 				"float": "left",
+				// 				"text": "\ue759",
+				// 				"fontSize": "22px"
+				// 			}]
+				// 		}
+				// 	}
+		
+			}
+		
+		},{
 			"path": "pages/mySet/myInfo",
 			"style": {
 				"navigationBarTitleText": "我的名片",
@@ -25,28 +47,7 @@
 				"enablePullDownRefresh": false
 			}
 
-		}, {
-			"path": "pages/cardHolder/cardHolder",
-			"style": {
-				"navigationBarTitleText": "电子名片",
-				"navigationStyle": "custom"
-				// 	"enablePullDownRefresh": false,
-				// 	"app-plus": {
-				// 		"titleNView": {
-				// 			"autoBackButton": false,
-				// 			"backgroundColor": "#fff",
-				// 			"buttons": [{
-				// 				"fontSrc": "/static/icons/iconfont.ttf",
-				// 				"float": "left",
-				// 				"text": "\ue759",
-				// 				"fontSize": "22px"
-				// 			}]
-				// 		}
-				// 	}
-
-			}
-
-		}, {
+		},  {
 			"path": "pages/cardHolder/map",
 			"style": {
 				"navigationBarTitleText": "地图",

+ 11 - 9
xiaochengxu/pages/cardHolder/cardHolder.vue

@@ -132,7 +132,7 @@
 		</u-popup>
 		<!-- <image :src="poster" style="width: 750rpx;height: 1334rpx;"></image> -->
 		<!-- 生成图片 -->
-		<poster v-if="list.length" :list="list" background-color="#FFF"
+		<poster :list="canvasData" background-color="#FFF"
 			@on-success="posterSuccess" ref="poster" @on-error="posterError"></poster>
 	</view>
 </template>
@@ -222,6 +222,7 @@
 			                console.log(err)
 			            },
 			            posterSuccess(url) {
+							console.log("hahahah",url)
 			                // 生成成功,会把临时路径在这里返回
 			                this.poster = url;
 			                console.log(url)
@@ -240,7 +241,7 @@
 				this.popupshow = false
 				this.qrcodeShow = true
 			},
-			share(item) {
+			share(item) {debugger
 				this.currectData = item
 				this.canvasData = [{
 						type: 'image',
@@ -249,16 +250,17 @@
 						y: 0,
 						width: 750,
 						height: 424
-					},{
-						type: 'text',
-						text:item.name,
-						x: 0,
-						y: 0,
-						size:13
 					},
+					// {
+					// 	type: 'text',
+					// 	text:item.name,
+					// 	x: 0,
+					// 	y: 0,
+					// 	size:13
+					// },
 					
 				]
-				this.popupshow = true
+				// this.popupshow = true
 			},
 			async delConfirm() {
 				uni.showLoading({