header.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668
  1. <template>
  2. <div>
  3. <div style="-webkit-app-region: drag;height:45px;line-height: 45px;">
  4. <div class="soft-head">
  5. <p class="soft-name">
  6. <img src="../assets/image/icon.png" class="soft-icon" />
  7. <span style="letter-spacing: 2px;">{{productName}}</span>
  8. </p>
  9. <div style="-webkit-app-region:no-drag">
  10. <div>
  11. <template v-if="authority.validity_type != 2">
  12. <span v-if="authority.isAuthority" class="o-member twinkle_text" @click="openVip()">
  13. <img src="../assets/image/i-vip.png" />
  14. <span>会员中心</span>
  15. </span>
  16. <span v-else class="o-member twinkle_text" @click="openVip()">
  17. <img src="../assets/image/i-vip.png" />
  18. <span>开通会员</span>
  19. </span>
  20. </template>
  21. <div class="login-cur" v-if="!userInfo.username" @click="loginModel = true">
  22. <el-avatar icon="el-icon-user-solid" size="small" class="login-icon"></el-avatar><span class="font-12">未登录</span>
  23. </div>
  24. <div class="login-cur" v-else>
  25. <img v-if="userInfo.avatar" :src="userInfo.avatar" class="login-icon" />
  26. <el-avatar v-else icon="el-icon-user-solid" size="small" class="login-icon"></el-avatar>
  27. <span v-if="userInfo.username">{{userInfo.username}}</span>
  28. <span v-else>微信用户</span>
  29. <img src="../assets/image/vip.png" v-if="authority.isAuthority" style="width: 25px;vertical-align: middle;"/>
  30. </div>
  31. <el-dropdown @command="changeMenu">
  32. <i class="el-icon-s-operation sys-icon"></i>
  33. <el-dropdown-menu slot="dropdown">
  34. <el-dropdown-item command="vip">{{authority.isAuthority ? '会员中心' : '开通会员'}}</el-dropdown-item>
  35. <el-dropdown-item command="update">检查更新</el-dropdown-item>
  36. <el-dropdown-item command="help"><a href="https://www.xingyousoft.com/help" style="color: inherit;">使用教程</a></el-dropdown-item>
  37. <el-dropdown-item command="setting">软件设置</el-dropdown-item>
  38. <el-dropdown-item command="out" v-if="userInfo.username || userInfo.avatar">退出登录</el-dropdown-item>
  39. </el-dropdown-menu>
  40. </el-dropdown>
  41. <i class="el-icon-minus sys-icon" @click="softMini()"></i>
  42. <i class="el-icon-full-screen sys-icon" @click="softMax()"></i>
  43. <i class="el-icon-close sys-icon" @click="softClose()"></i>
  44. </div>
  45. </div>
  46. </div>
  47. </div>
  48. <!-- 登录 -->
  49. <el-dialog title="用户注册登录" :visible.sync="loginModel" width="400px" :close-on-click-modal="false">
  50. <div class="login-model" style="position: relative;">
  51. <iframe v-if="loginModel" id="loginFrame" ref="loginFrame" style="border: none; width: 100%; height:100%;" :src="loginUrl"></iframe>
  52. <img src="../assets/image/icon-b.png" style="position: absolute; bottom: -30px; right: -20px; width: 40px;"/>
  53. </div>
  54. <span slot="title">
  55. <img src="../assets/image/logo.png" style="width: 25px; vertical-align: middle; margin-right: 4px;"/>注册用户登录
  56. </span>
  57. </el-dialog>
  58. <!-- 会员弹窗 -->
  59. <el-dialog custom-class="member-dialog member-dialog1" :visible.sync="vipModel" width="700px" :close-on-click-modal="false">
  60. <div slot="title">
  61. <p class="soft-mtitle">
  62. <img src="../assets/image/icon.png" class="soft-icon" />
  63. {{productName}}
  64. </p>
  65. </div>
  66. <div style="height: 580px;">
  67. <iframe v-if="vipModel" id="vipFrame" style="border: none; width: 100%; height:100%;" :src="vipUrl"></iframe>
  68. </div>
  69. </el-dialog>
  70. <!-- 未登录弹窗 -->
  71. <el-dialog :visible.sync="memberModel" width="400px" custom-class="member-dialog member-dialog2" style="border-radius: 20px; overflow: hidden;">
  72. <div class="member-model">
  73. <div class="adv-banner" v-if="popupAdvInfo.logo">
  74. <img :src="imgUrl + popupAdvInfo.logo" style="width: 100%; height: 100%;"/>
  75. </div>
  76. <div class="font-12" style="padding: 20px; margin-bottom: 10px;">
  77. <div style="text-align: center; margin-bottom: 10px;">
  78. <p style="font-size: 16px;font-weight: 600;color: #f73131;">非VIP仅处理前5个,VIP即享修改时间属性功能</p>
  79. <p style="font-size: 14px; font-weight: 600; margin-top: 15px;">开通会员即享以下权益</p>
  80. </div>
  81. <el-row :gutter="20" class="micon-list">
  82. <el-col :span="6" class="micon-item">
  83. <img src="../assets/image/member1.png" style="width: 60px;"/>
  84. <p>不限功能</p>
  85. </el-col>
  86. <el-col :span="6" class="micon-item">
  87. <img src="../assets/image/member2.png" style="width: 60px;"/>
  88. <p>不限设备</p>
  89. </el-col>
  90. <el-col :span="6" class="micon-item">
  91. <img src="../assets/image/member3.png" style="width: 60px;"/>
  92. <p>免费升级</p>
  93. </el-col>
  94. <el-col :span="6" class="micon-item">
  95. <img src="../assets/image/member4.png" style="width: 60px;"/>
  96. <p>技术支持</p>
  97. </el-col>
  98. </el-row>
  99. </div>
  100. <div class="micon-btn">
  101. <template v-if="!tipsModal">
  102. <el-button class="micon-btn1" style="margin:0 10px;" v-if="!isClick" @click="next()" :round="true">继续试用</el-button>
  103. <el-button class="micon-btn1" style="margin:0 10px;" v-else @click="next()" :round="true">开始处理</el-button>
  104. </template>
  105. <template v-else>
  106. <el-button class="micon-btn1" style="margin:0 10px;" @click="memberModel = false" :round="true">我在想想</el-button>
  107. </template>
  108. <el-button class="micon-btn2" type="primary" @click="openVip()" :round="true">开通会员</el-button>
  109. </div>
  110. </div>
  111. </el-dialog>
  112. <!-- 退出提示 -->
  113. <el-dialog title="关闭提示" :visible.sync="closeModel" width="400px">
  114. <div style="text-align:center">
  115. <el-radio-group v-model="closeType" style="text-align:left">
  116. <el-radio :label="1">最小化到系统托盘</el-radio>
  117. <div style="height: 20px;"> </div>
  118. <el-radio :label="2">直接退出应用程序</el-radio>
  119. </el-radio-group>
  120. </div>
  121. <span slot="footer" class="dialog-footer">
  122. <el-checkbox v-model="isRemember" style="float:left">不再提醒</el-checkbox>
  123. <el-button type="primary" size="small" @click="saveClose">确定</el-button>
  124. </span>
  125. </el-dialog>
  126. <!-- 软件设置 -->
  127. <el-dialog title="软件设置" :visible.sync="settingModal" width="400px">
  128. <div>
  129. <el-divider content-position="left">退出设置</el-divider>
  130. <el-radio-group v-model="closeType">
  131. <el-radio :label="1">最小化到系统托盘</el-radio>
  132. <el-radio :label="2">直接退出应用程序</el-radio>
  133. </el-radio-group>
  134. </div>
  135. <span slot="footer" class="dialog-footer">
  136. <el-button type="primary" @click="saveSetting">保存设置</el-button>
  137. </span>
  138. </el-dialog>
  139. </div>
  140. </template>
  141. <script>
  142. import {
  143. ipcRenderer
  144. } from 'electron';
  145. import QRCode from 'qrcodejs2'
  146. import pjson from '/package.json'
  147. import electronApi from '@/utils/electronApi';
  148. import fs from 'fs';
  149. import os from 'os';
  150. import path from 'path';
  151. export default {
  152. name: "headerTop",
  153. data(){
  154. return {
  155. sysInfo: {},
  156. vipUrl: '',
  157. loginUrl: '',
  158. memberUrl: '',
  159. settingModal: false,
  160. boot: false, // 开机启动
  161. closeModel: false,
  162. closeType: 2,
  163. isRemember:true,
  164. //
  165. productName: pjson.softInfo.softName,
  166. imgUrl: this.$api.imgUrl,
  167. loginType: 1,
  168. loginModel: false, // 登录弹窗
  169. loginImg: '',
  170. loginExpire: 100,
  171. loginInterval: false, // 登录倒计时
  172. checkLoginInterval: false,
  173. isLogin: false,
  174. userInfo: {},
  175. authority: { //软件的会员权限
  176. isAuthority: false
  177. },
  178. memberModel: false,
  179. isClick: false, // 是否点击转换按钮
  180. vipModel: false, // 会员弹窗
  181. productInfo: {},
  182. productIndex: 4,
  183. payType: 1, // 支付方式 1微信 2支付宝
  184. checkPayInterval: false,
  185. order_no: '', //创建的订单号
  186. alipayUrl: '', // 支付宝
  187. payMoney: 0,
  188. clickVip: false,
  189. popupAdvInfo: [],
  190. vipAdvInfo: [],
  191. agreementInfo: [], // 会员协议
  192. agreeFlag: true,
  193. agreementModel: false,
  194. alipayDoc: '',
  195. limitModal: false, // 限时购买弹窗
  196. limitLogin: false, // 限时购买时的登录状态
  197. tipsModal: false,
  198. }
  199. },
  200. props: {
  201. },
  202. async mounted(){
  203. this.getAdv();
  204. this.checkLogin();
  205. if(this.$utils.getStorage('userInfo')){
  206. this.userInfo = this.$utils.getStorage('userInfo');
  207. }
  208. window.addEventListener('message', e => {
  209. if (e.origin === 'https://www.xingyousoft.com') {
  210. if(e.data.userInfo){ // 返回用户信息
  211. this.userInfo = e.data.userInfo;
  212. this.$utils.setStorage('userInfo', e.data.userInfo);
  213. this.loginModel = false;
  214. }
  215. if(e.data.officialToken != undefined){
  216. this.$utils.setStorage('token', e.data.officialToken);
  217. this.getUserInfo();
  218. this.loginModel = false;
  219. }
  220. if(e.data == 'paySuccess'){ // 支付成功
  221. this.vipModel = false;
  222. this.$notify({title: '成功',message: '支付成功',type: 'success'});
  223. this.getUserInfo();
  224. }
  225. if(e.data == 'next'){
  226. this.next();
  227. }
  228. if(e.data == 'openVip'){
  229. this.openVip();
  230. }
  231. }else{
  232. return;
  233. }
  234. }, false);
  235. //加载的时候会出现白屏,延迟加载解决白屏问题
  236. setTimeout(() => {
  237. ipcRenderer.send('close-loading-window', {isClose:true});
  238. }, 2000);
  239. // 接收系统托盘命令 - 软件设置
  240. ipcRenderer.on('setting', (event, message) => {
  241. this.changeMenu('setting');
  242. })
  243. // 接收系统托盘命令 - 帮助中心
  244. ipcRenderer.on('help', (event, message) => {
  245. electronApi.openExternal("https://www.xingyousoft.com/help");
  246. })
  247. },
  248. methods: {
  249. softMini() { // 软件最小化
  250. ipcRenderer.send('min');
  251. },
  252. softMax() { // 软件最大化
  253. ipcRenderer.send('max');
  254. },
  255. softClose() { // 软件关闭
  256. let isRemember = this.$utils.getStorage('isRemember');
  257. if(isRemember == true){
  258. let type = this.$utils.getStorage('closeType');
  259. if(type == 2){
  260. ipcRenderer.send('exit');
  261. }else{
  262. ipcRenderer.send('tray');
  263. }
  264. }else{
  265. this.closeModel = true;
  266. }
  267. },
  268. saveClose(){
  269. if(this.isRemember == true){
  270. this.$utils.setStorage('closeType',this.closeType);
  271. }
  272. this.$utils.setStorage('isRemember', this.isRemember);
  273. if(this.closeType == 2){
  274. ipcRenderer.send('exit');
  275. }else{
  276. this.closeModel = false;
  277. ipcRenderer.send('tray');
  278. }
  279. },
  280. // 保存设置
  281. saveSetting(){
  282. this.$utils.setStorage('closeType', this.closeType);
  283. this.$utils.setStorage('isRemember', true)
  284. ipcRenderer.send('boot', this.boot);
  285. this.settingModal = false;
  286. },
  287. //
  288. getAdv() {
  289. // 非会员广告接口
  290. this.$http.post(this.$api.target + '/api/api/m_position_list_byid', { id: pjson.softInfo.popupAdvId }).then((response) => {
  291. if (!response.data.error) {
  292. this.popupAdvInfo = response.data.result;
  293. }
  294. })
  295. electronApi.spawnExec(['cert.exe','token']).then(res => {
  296. this.sysInfo = JSON.parse(res.stdout.toString());
  297. this.$utils.setStorage('session', this.sysInfo.windows_uuid);
  298. 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;
  299. 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;
  300. if(process.env.NODE_ENV != "development"){ // 非开发环境运行
  301. let params = {
  302. type: 3,
  303. tag: '',
  304. product_version: pjson.version,
  305. windows_uuid: this.sysInfo.windows_uuid,
  306. os_platform: this.sysInfo.os_platform,
  307. os_version: this.sysInfo.os_version,
  308. cpu: this.sysInfo.cpu,
  309. statistics_flag: '',
  310. from: this.sysInfo.from,
  311. }
  312. // 使用日志
  313. // this.$http.post(this.$api.statistics + pjson.softInfo.softMid, params).then((response) => {
  314. // })
  315. }
  316. }).catch(err => {
  317. console.log(err);
  318. let windows_uuid = this.$utils.guid();
  319. if(this.$utils.getStorage('session')){
  320. windows_uuid = this.$utils.getStorage('session');
  321. }
  322. this.$utils.setStorage('session', windows_uuid);
  323. 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;
  324. 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;
  325. });
  326. },
  327. // 刷新登录二维码
  328. refreshCode() {
  329. this.clearLoginInterval();
  330. let data = {
  331. scene_str: pjson.softInfo.softMid + ':' + this.$utils.getStorage('session')
  332. };
  333. this.$http.post(this.$api.createQrcode, data).then((response) => {
  334. if (response.data.result) {
  335. this.loginImg = response.data.result.url;
  336. this.loginExpire = response.data.result.expire_seconds;
  337. this.loginInterval = setInterval(() => {
  338. this.loginExpire--;
  339. if (this.loginExpire <= 0) {
  340. this.clearLoginInterval();
  341. }
  342. }, 1000)
  343. this.checkLoginInterval = setInterval(() => {
  344. this.checkLogin();
  345. }, 3000)
  346. }
  347. });
  348. },
  349. // 继续试用 or 开始转换
  350. next() {
  351. if(this.isClick){ // 开始转换
  352. this.$emit('export-file', true);
  353. }else{ // 继续试用
  354. this.memberModel = false;
  355. }
  356. },
  357. // 开通会员
  358. openVip() {
  359. this.clickVip = true;
  360. this.memberModel = false;
  361. if (this.$utils.getStorage('token')) {
  362. this.vipModel = true;
  363. 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();
  364. } else {
  365. this.loginModel = true;
  366. }
  367. },
  368. // 检查微信是否登录
  369. checkLogin() {
  370. let data = {
  371. scene_str: pjson.softInfo.softMid + ':' + this.$utils.getStorage('session')
  372. };
  373. this.$http.post(this.$api.checkLogin, data).then((response) => {
  374. if (response.data.error) { // 未登录
  375. this.authority.isAuthority = false;
  376. this.userInfo = {};
  377. this.$utils.setStorage('token', '');
  378. this.$utils.setStorage('userInfo', '');
  379. if(!this.loginModel && !this.limitModal) {
  380. this.memberModel = true;
  381. }
  382. }else{ // 登录成功
  383. this.$utils.setStorage('token', response.data.result);
  384. this.loginModel = false;
  385. this.getUserInfo();
  386. if(this.limitModal){ // 限时优惠 已登录
  387. this.limitLogin = true;
  388. }
  389. if (this.clickVip) { // 点击开通会员 登陆后直接展示会员购买弹窗
  390. this.vipModel = true;
  391. 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();
  392. this.clickVip = false;
  393. }else{
  394. // this.getProductInfo();
  395. }
  396. }
  397. });
  398. },
  399. // 获取用户信息
  400. getUserInfo() {
  401. this.$http.post(this.$api.getUserInfo).then((response) => {
  402. if (!response.data.error) {
  403. this.userInfo = response.data.result;
  404. this.getAuthority();
  405. }
  406. });
  407. },
  408. // 清空登录有关定时器
  409. clearLoginInterval() {
  410. clearInterval(this.loginInterval);
  411. clearInterval(this.checkLoginInterval);
  412. },
  413. // 获取用户账单
  414. getAuthority() {
  415. this.$http.post(this.$api.userBill + pjson.softInfo.softMid).then((response) => {
  416. if (!response.data.error) {
  417. this.authority = response.data.result;
  418. let nowDate = new Date().getTime();
  419. if (nowDate <= new Date(this.authority.validity_end_time).getTime() || this.authority.validity_type == 2) {
  420. this.authority.isAuthority = true;
  421. } else {
  422. this.authority.isAuthority = false;
  423. if (!this.vipModel && !this.limitModal) {
  424. this.memberModel = true;
  425. }
  426. }
  427. this.$forceUpdate();
  428. }
  429. })
  430. },
  431. // 监听会员弹窗状态
  432. vipChange(e) {
  433. },
  434. // 监听显示购买弹窗状态
  435. limitChange(e){
  436. if (e) {
  437. if(!this.limitLogin && this.limitModal){
  438. this.refreshCode();
  439. }
  440. }else{
  441. clearInterval(this.checkPayInterval)
  442. }
  443. },
  444. // 监听登录弹窗状态
  445. loginChange(e) {
  446. if (e) {
  447. this.refreshCode();
  448. } else {
  449. this.clickVip = false;
  450. this.clearLoginInterval();
  451. }
  452. },
  453. // 选择支付方式
  454. selectPaytype(index) {
  455. this.payType = index; // 1微信支付 2支付宝支付
  456. if(this.limitModal){
  457. this.selectTerm(5);
  458. }else{
  459. this.selectTerm();
  460. }
  461. },
  462. // 生成微信支付二维码
  463. createQrcode(str) {
  464. document.getElementById('qrcode').innerHTML = ''
  465. let qrcode = new QRCode('qrcode', {
  466. width: 210,
  467. height: 210, // 高度
  468. text: str, // 二维码内容
  469. render: 'canvas', // 设置渲染方式(有两种方式 table和canvas,默认是canvas)
  470. background: '#f0f',
  471. foreground: '#ff0'
  472. })
  473. },
  474. // 选择会员期限创建订单
  475. selectTerm(index) {
  476. if (index) {
  477. this.productIndex = index;
  478. }
  479. this.payMoney = this.productInfo['price' + this.productIndex];
  480. let params = {
  481. product_type: 1,
  482. id: this.productInfo.id,
  483. type: this.productIndex
  484. };
  485. clearInterval(this.checkPayInterval);
  486. this.$http.post(this.$api.target + '/order/createOrder', params).then((response) => {
  487. if (response.data.result) {
  488. this.order_no = response.data.data;
  489. if (this.payType == 1) { // 微信支付
  490. this.wepay();
  491. } else {
  492. this.alipay();
  493. }
  494. } else {
  495. this.$message.error(response.data.msg);
  496. }
  497. });
  498. },
  499. // 微信支付
  500. wepay() {
  501. this.$http.post(this.$api.target + '/pay/wechatPay', { order_no: this.order_no }).then((res) => {
  502. if (res.data.result) {
  503. if (JSON.stringify(res.data.data) != '[]') {
  504. this.wxPayErcode = res.data.data.code_url
  505. this.createQrcode(res.data.data.code_url)
  506. this.checkWxPay()
  507. }
  508. }
  509. });
  510. },
  511. // 支付宝支付
  512. alipay() {
  513. this.$http.post(this.$api.target + '/pay/alipay', { order_no: this.order_no }).then((res) => {
  514. var content = res.data; //内容
  515. this.alipayDoc = content;
  516. this.checkWxPay();
  517. });
  518. },
  519. // 每2秒检测一次是否支付成功
  520. checkWxPay() {
  521. clearInterval(this.checkPayInterval);
  522. this.checkPayInterval = setInterval(() => {
  523. this.$http.post(this.$api.target + '/order/checkIsWXPay', { order_no: this.order_no, product_type: 1 }).then((res) => {
  524. if (res.data.result) {
  525. if (JSON.stringify(res.data.data) != '[]') {
  526. if (res.data.code == '1001') {
  527. clearInterval(this.checkPayInterval);
  528. this.vipModel = false;
  529. this.limitModal = false;
  530. this.getAuthority();
  531. this.$notify({title: '支付通知',message: res.data.msg,type: 'success'});
  532. }
  533. }
  534. }
  535. });
  536. }, 2000)
  537. // 5分钟后关闭
  538. // setTimeout(() => {
  539. // clearInterval(this.checkPayInterval)
  540. // }, 1000 * 300)
  541. },
  542. // 选择菜单
  543. changeMenu(e) {
  544. if (e === 'out') {
  545. this.$confirm("是否退出登录该账号?", '提示', {
  546. type: 'warning'
  547. }).then(() => {
  548. this.$http.post(this.$api.loginOut).then((response) => {
  549. if (!response.data.error) {
  550. this.userInfo = {};
  551. this.authority.isAuthority = false;
  552. this.$utils.setStorage('token', '');
  553. this.$utils.setStorage('userInfo', '');
  554. this.$message({message: '账号已退出',type: 'success'});
  555. // this.$refs.loginFrame.contentWindow.postMessage('out', '*');
  556. }
  557. });
  558. }).catch(() => {
  559. });
  560. } else if (e === 'vip') {
  561. this.openVip();
  562. } else if (e === 'update') {
  563. this.$emit('update-soft', true);
  564. } else if (e === 'setting'){
  565. this.settingModal = true;
  566. }
  567. },
  568. },
  569. }
  570. </script>
  571. <style lang="scss">
  572. .vip-banner{
  573. background-color: #eee;
  574. height: 60px;
  575. width: 100%;
  576. margin-bottom: 15px;
  577. }
  578. .adv-banner{
  579. height: 150px;
  580. width: 100%;
  581. }
  582. .login-cur{
  583. margin: 0 10px;
  584. display: inline-block;
  585. cursor: pointer;
  586. }
  587. .vip-modal .ivu-icon-ios-close{
  588. color: #f8f8f8 !important;
  589. }
  590. .member-dialog{
  591. .el-dialog__header{
  592. padding: 0;
  593. }
  594. .el-dialog__body{
  595. padding: 0;
  596. }
  597. }
  598. .member-dialog1{
  599. .el-dialog__headerbtn{
  600. top: 13px;
  601. }
  602. }
  603. .member-dialog2{
  604. border-radius: 20px !important;
  605. overflow: hidden;
  606. }
  607. .micon-list{
  608. padding: 20px 10px;
  609. background: linear-gradient(to bottom, #fdd6ca69, #ffffff);
  610. border-radius: 20px;
  611. }
  612. .micon-item{
  613. text-align: center;
  614. font-size: 14px;
  615. font-weight: 600;
  616. color: #ec6b44;
  617. }
  618. .micon-btn{
  619. text-align: center;
  620. padding-bottom: 20px;
  621. }
  622. .soft-mtitle{
  623. font-size: 16px;
  624. line-height: 40px;
  625. font-weight: 600;
  626. padding: 0 15px;
  627. }
  628. </style>