|
@@ -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>
|
|
@@ -217,7 +217,6 @@
|
|
|
|
|
|
window.addEventListener('message', e => {
|
|
|
if (e.origin === 'https://www.xingyousoft.com') {
|
|
|
- // console.log(e.data)
|
|
|
if(e.data.userInfo){ // 返回用户信息
|
|
|
this.userInfo = e.data.userInfo;
|
|
|
this.$utils.setStorage('userInfo', e.data.userInfo);
|
|
@@ -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 = {
|
|
@@ -337,34 +339,11 @@
|
|
|
}
|
|
|
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){ // 开始转换
|
|
@@ -373,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;
|
|
@@ -381,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;
|
|
|
}
|
|
|
},
|
|
|
// 检查微信是否登录
|
|
@@ -447,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') {
|
|
@@ -570,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'});
|