lhl 1 year ago
parent
commit
77b2ab3679
2 changed files with 72 additions and 52 deletions
  1. 68 48
      pages/user/model/model.vue
  2. 4 4
      pages/user/shareQrCode.vue

+ 68 - 48
pages/user/model/model.vue

@@ -162,7 +162,7 @@
 		</view>
 
 		<view class="ljrz" v-if="userInfo.work_type_id <=0" @click="navto('/pages/user/model/modelrz?modelid=' + mtype + '&type=2')">
-			立即认证
+			生成我的名片
 		</view>
 		<view class="create-model flex" v-if="!shareId && !is_yl && userInfo.work_type_id >0 && look && islook == 1">
 			<view class="price-show">
@@ -379,54 +379,74 @@
 				subShowTemplateOrder({
 					id: that.mtype,
 					pay_type: that.payType
-				}).then(res => {
-					let da = res.data.jsApiParameters;
-					let data = {
-						appId: da.appId,
-						// #ifdef H5
-						timestamp: da.timeStamp,
-						// #endif
-						// #ifdef MP
-						timeStamp: da.timeStamp + '',
-						// #endif
-						nonceStr: da.nonceStr,
-						package: da.package,
-						signType: da.signType,
-						paySign: da.paySign,
-						success: function(res) {
-							// obj.paySuccessTo();
-							// alert('支付成功')
-							uni.showModal({
-								title: '提示',
-								content: '支付成功!',
-								cancelText: '关闭',
-								confirmText: '查看模板',
-								success: res => {
-									if (res.confirm) {
-										uni.reLaunch({
-											url: '/pages/user/model/model?mtype=' +
-												that.mtype,
-										});
-									}
-								},
-								fail: () => {},
-								complete: () => {}
-							});
-							console.log('支付成功')
-						},
-						fail: (err) => {
-							console.log(err)
-							// alert('支付失败')
-							// uni.navigateTo({
-							// 	url: '/pages/order/order?state=0'
-							// });
-						}
-					};
-					console.log(data, 'timeStamp')
-					if (that.payType == 'wxpay') {
-						console.log('到这里')
-						wx.requestPayment(data)
+				}).then(res => {
+					if(res.data.status == 1) {
+						uni.showModal({
+							title: '提示',
+							content: '支付成功!',
+							cancelText: '关闭',
+							confirmText: '查看模板',
+							success: res => {
+								if (res.confirm) {
+									uni.reLaunch({
+										url: '/pages/user/model/model?mtype=' +
+											that.mtype,
+									});
+								}
+							},
+							fail: () => {},
+							complete: () => {}
+						});
+					}else {
+						let da = res.data.jsApiParameters;
+						let data = {
+							appId: da.appId,
+							// #ifdef H5
+							timestamp: da.timeStamp,
+							// #endif
+							// #ifdef MP
+							timeStamp: da.timeStamp + '',
+							// #endif
+							nonceStr: da.nonceStr,
+							package: da.package,
+							signType: da.signType,
+							paySign: da.paySign,
+							success: function(res) {
+								// obj.paySuccessTo();
+								// alert('支付成功')
+								uni.showModal({
+									title: '提示',
+									content: '支付成功!',
+									cancelText: '关闭',
+									confirmText: '查看模板',
+									success: res => {
+										if (res.confirm) {
+											uni.reLaunch({
+												url: '/pages/user/model/model?mtype=' +
+													that.mtype,
+											});
+										}
+									},
+									fail: () => {},
+									complete: () => {}
+								});
+								console.log('支付成功')
+							},
+							fail: (err) => {
+								console.log(err)
+								// alert('支付失败')
+								// uni.navigateTo({
+								// 	url: '/pages/order/order?state=0'
+								// });
+							}
+						};
+						console.log(data, 'timeStamp')
+						if (that.payType == 'wxpay') {
+							console.log('到这里')
+							wx.requestPayment(data)
+						}
 					}
+					
 				})
 			},
 			// 获取模板详情

+ 4 - 4
pages/user/shareQrCode.vue

@@ -1,6 +1,6 @@
 <template>
 	<view class="container">
-		<canvas :style="{ width:  '554rpx', height: '1200rpx',}" canvas-id="myCanvas" id="myCanvas" class="hb"></canvas>
+		<canvas :style="{ width:  '750rpx', height: '1624rpx',}" canvas-id="myCanvas" id="myCanvas" class="hb"></canvas>
 		<!-- #ifndef MP -->
 		<div class="preserve">
 			<div class="line"></div>
@@ -226,10 +226,10 @@
 				this.ewmImg = await this.getImageInfo(that.qrcode);
 				// this.canvasW = this.SystemInfo.windowWidth; // 画布宽度
 				this.ratio = this.SystemInfo.windowWidth / 750;
-				this.canvasW = 554 * this.ratio;
-				this.canvasH = 1200 * this.ratio;
+				this.canvasW =750 * this.ratio;
+				this.canvasH = 1624 * this.ratio;
 
-				this.ewmW = 180 * this.ratio;
+				this.ewmW = 220 * this.ratio;
 	
 				
 				console.log(this.canvasH, 'this.canvasH')