qiushang 1 жил өмнө
parent
commit
4fc9d5de34

+ 18 - 143
src/renderer/components/header.vue

@@ -19,7 +19,7 @@
 							</span>
 						</template>
 						
-						<div class="login-cur" v-if="!userInfo.username" @click="loginModel = true">
+						<div class="login-cur" v-if="!userInfo.username" @click="startLogin()">
 							<el-avatar icon="el-icon-user-solid" size="small" class="login-icon"></el-avatar><span class="font-12">未登录</span>
 						</div>
 						<div class="login-cur" v-else>
@@ -62,8 +62,7 @@
 		<el-dialog custom-class="member-dialog member-dialog1" :visible.sync="vipModel" width="700px" :close-on-click-modal="false">
 			<div slot="title">
 				<p class="soft-mtitle">
-					<img src="../assets/image/icon.png" class="soft-icon" />
-					{{productName}}
+					会员中心
 				</p>
 			</div>
 			<div style="height: 580px;">
@@ -79,7 +78,7 @@
 				</div>
 				<div class="font-12" style="padding: 20px; margin-bottom: 10px;">
 					<div style="text-align: center; margin-bottom: 10px;">
-						<p style="font-size: 16px;font-weight: 600;color: #f73131;">非VIP限制文件大小为300KB</p>
+						<p style="font-size: 16px;font-weight: 600;color: #f73131;">非VIP图片/音频限制大小为300KB,视频/文档限制大小为2MB</p>
 						<p style="font-size: 14px; font-weight: 600; margin-top: 15px;">开通会员即享以下权益</p>
 					</div>
 					<el-row :gutter="20" class="micon-list">
@@ -227,6 +226,9 @@
 						this.$utils.setStorage('token', e.data.officialToken);
 						this.getUserInfo();
 						this.loginModel = false;
+						if(e.data.click == 'openVip'){
+							this.openVip();
+						}
 					}
 					if(e.data == 'paySuccess'){ // 支付成功
 						this.vipModel = false;
@@ -310,7 +312,7 @@
 					this.sysInfo = JSON.parse(res.stdout.toString());
 					this.$utils.setStorage('session', this.sysInfo.windows_uuid);
 					
-					this.loginUrl = "https://www.xingyousoft.com/soft/login2/"+pjson.softInfo.softMid+"?p_mid="+pjson.softInfo.softMid+"&agent_mid="+this.sysInfo.agentMid+"&uuid="+this.sysInfo.windows_uuid+"&soft_type="+this.sysInfo.softType;
+					this.loginUrl = "https://www.xingyousoft.com/soft/login2/"+pjson.softInfo.softMid+"?p_mid="+pjson.softInfo.softMid+"&click=false&agent_mid="+this.sysInfo.agentMid+"&uuid="+this.sysInfo.windows_uuid+"&soft_type="+this.sysInfo.softType;
 					this.memberUrl = "https://www.xingyousoft.com/soft/reminder2/"+pjson.softInfo.softMid+"?p_mid="+pjson.softInfo.softMid+"&agent_mid="+this.sysInfo.agentMid+"&uuid="+this.sysInfo.windows_uuid+"&soft_type="+this.sysInfo.softType;
 					if(process.env.NODE_ENV != "development"){ // 非开发环境运行
 						let params = {
@@ -335,35 +337,13 @@
 					if(this.$utils.getStorage('session')){
 						windows_uuid = this.$utils.getStorage('session');
 					}
+					this.sysInfo.windows_uuid = windows_uuid;
 					this.$utils.setStorage('session', windows_uuid);
-					this.loginUrl = "https://www.xingyousoft.com/soft/login2/"+pjson.softInfo.softMid+"?p_mid="+pjson.softInfo.softMid+"&agent_mid="+this.sysInfo.agentMid+"&uuid="+windows_uuid+"&soft_type="+this.sysInfo.softType;
+					this.loginUrl = "https://www.xingyousoft.com/soft/login2/"+pjson.softInfo.softMid+"?p_mid="+pjson.softInfo.softMid+"&click=false&agent_mid="+this.sysInfo.agentMid+"&uuid="+windows_uuid+"&soft_type="+this.sysInfo.softType;
 					this.memberUrl = "https://www.xingyousoft.com/soft/reminder2/"+pjson.softInfo.softMid+"?p_mid="+pjson.softInfo.softMid+"&agent_mid="+this.sysInfo.agentMid+"&uuid="+windows_uuid+"&soft_type="+this.sysInfo.softType;
 				});
 				
 			},
-			// 刷新登录二维码
-			refreshCode() {
-			    this.clearLoginInterval();
-			    let data = {
-			        scene_str: pjson.softInfo.softMid + ':' + this.$utils.getStorage('session')
-			    };
-			    this.$http.post(this.$api.createQrcode, data).then((response) => {
-			        if (response.data.result) {
-			            this.loginImg = response.data.result.url;
-			            this.loginExpire = response.data.result.expire_seconds;
-			            this.loginInterval = setInterval(() => {
-			                this.loginExpire--;
-			                if (this.loginExpire <= 0) {
-			                    this.clearLoginInterval();
-			                }
-			            }, 1000)
-			
-			            this.checkLoginInterval = setInterval(() => {
-			                this.checkLogin();
-			            }, 3000)
-			        }
-			    });
-			},
 			// 继续试用 or 开始转换
 			next() {
 				if(this.isClick){ // 开始转换
@@ -372,6 +352,11 @@
 					this.memberModel = false;
 				}
 			},
+			startLogin(){
+				let windows_uuid = this.$utils.getStorage('session');
+				this.loginUrl = "https://www.xingyousoft.com/soft/login2/"+pjson.softInfo.softMid+"?p_mid="+pjson.softInfo.softMid+"&click=false&agent_mid="+this.sysInfo.agentMid+"&uuid="+windows_uuid+"&soft_type="+this.sysInfo.softType;
+				this.loginModel = true;
+			},
 			// 开通会员 
 			openVip() {
 			    this.clickVip = true;
@@ -380,7 +365,9 @@
 			        this.vipModel = true;
 					this.vipUrl = "https://www.xingyousoft.com/soft/buy2/"+pjson.softInfo.softMid+"?p_mid="+pjson.softInfo.softMid+"&agent_mid="+this.sysInfo.agentMid+"&uuid="+this.sysInfo.windows_uuid+"&token="+this.$utils.getStorage('token')+"&soft_type="+this.sysInfo.softType+"&time="+new Date().getTime();
 			    } else {
-			        this.loginModel = true;
+					let windows_uuid = this.$utils.getStorage('session');
+					this.loginUrl = "https://www.xingyousoft.com/soft/login2/"+pjson.softInfo.softMid+"?p_mid="+pjson.softInfo.softMid+"&click=openVip&agent_mid="+this.sysInfo.agentMid+"&uuid="+windows_uuid+"&soft_type="+this.sysInfo.softType;
+					this.loginModel = true;
 			    }
 			},
 			// 检查微信是否登录
@@ -446,119 +433,6 @@
 			        }
 			    })
 			},
-			// 监听会员弹窗状态
-			vipChange(e) {
-				
-			},
-			// 监听显示购买弹窗状态
-			limitChange(e){
-				if (e) {
-					if(!this.limitLogin && this.limitModal){
-						this.refreshCode();
-					}
-				}else{
-				    clearInterval(this.checkPayInterval)
-				}
-			},
-			// 监听登录弹窗状态
-			loginChange(e) {
-			    if (e) {
-			        this.refreshCode();
-			    } else {
-					this.clickVip = false;
-			        this.clearLoginInterval();
-			    }
-			},
-			// 选择支付方式
-			selectPaytype(index) {
-			    this.payType = index; // 1微信支付 2支付宝支付
-				if(this.limitModal){
-					this.selectTerm(5);
-				}else{
-					this.selectTerm();
-				}
-			},
-			// 生成微信支付二维码
-			createQrcode(str) {
-			    document.getElementById('qrcode').innerHTML = ''
-			    let qrcode = new QRCode('qrcode', {
-			        width: 210,
-			        height: 210, // 高度
-			        text: str, // 二维码内容
-			        render: 'canvas', // 设置渲染方式(有两种方式 table和canvas,默认是canvas)
-			        background: '#f0f',
-			        foreground: '#ff0'
-			    })
-			},
-			// 选择会员期限创建订单
-			selectTerm(index) {
-			    if (index) {
-			        this.productIndex = index;
-			    }
-			    this.payMoney = this.productInfo['price' + this.productIndex];
-			    let params = {
-			        product_type: 1,
-			        id: this.productInfo.id,
-			        type: this.productIndex
-			    };
-			    clearInterval(this.checkPayInterval);
-			    this.$http.post(this.$api.target + '/order/createOrder', params).then((response) => {
-			        if (response.data.result) {
-			            this.order_no = response.data.data;
-			            if (this.payType == 1) { // 微信支付
-			                this.wepay();
-			            } else {
-			                this.alipay();
-			            }
-			        } else {
-						this.$message.error(response.data.msg);
-					}
-			    });
-			},
-			// 微信支付
-			wepay() {
-			    this.$http.post(this.$api.target + '/pay/wechatPay', { order_no: this.order_no }).then((res) => {
-			        if (res.data.result) {
-			            if (JSON.stringify(res.data.data) != '[]') {
-			                this.wxPayErcode = res.data.data.code_url
-			                this.createQrcode(res.data.data.code_url)
-			                this.checkWxPay()
-			            }
-			        }
-			    });
-			},
-			// 支付宝支付
-			alipay() {
-			    this.$http.post(this.$api.target + '/pay/alipay', { order_no: this.order_no }).then((res) => {
-			        var content = res.data; //内容
-					this.alipayDoc = content;
-					this.checkWxPay();
-			    });
-			},
-			// 每2秒检测一次是否支付成功
-			checkWxPay() {
-				clearInterval(this.checkPayInterval);
-			    this.checkPayInterval = setInterval(() => {
-			        this.$http.post(this.$api.target + '/order/checkIsWXPay', { order_no: this.order_no, product_type: 1 }).then((res) => {
-			            if (res.data.result) {
-			                if (JSON.stringify(res.data.data) != '[]') {
-			                    if (res.data.code == '1001') {
-			                        clearInterval(this.checkPayInterval);
-			                        this.vipModel = false;
-									this.limitModal = false;
-			                        this.getAuthority();
-									this.$notify({title: '支付通知',message: res.data.msg,type: 'success'});
-			                    }
-			                }
-			            }
-			        });
-			    }, 2000)
-			
-			    // 5分钟后关闭
-			    // setTimeout(() => {
-			    //     clearInterval(this.checkPayInterval)
-			    // }, 1000 * 300)
-			},
 			// 选择菜单
 			changeMenu(e) {
 			    if (e === 'out') {
@@ -569,6 +443,7 @@
 						    if (!response.data.error) {
 						        this.userInfo = {};
 						        this.authority.isAuthority = false;
+								this.authority.validity_type = 1;
 						        this.$utils.setStorage('token', '');
 								this.$utils.setStorage('userInfo', '');
 								this.$message({message: '账号已退出',type: 'success'});