diff --git a/config/dev.env.js b/config/dev.env.js index 8a7404f87bc0485309aa4003ad16a3e32f5830e4..ca30e8f7d2af0bcf343bdb55fb13131b1e2bde8c 100644 --- a/config/dev.env.js +++ b/config/dev.env.js @@ -2,7 +2,21 @@ const merge = require('webpack-merge'); const prodEnv = require('./prod.env'); // const ip = 'http://10.1.23.212:8085/' -const ip = 'http://10.1.22.249:8085/' +const ip = `http://${getIP()}:8085/`; + +function getIP() { + var interfaces = require('os').networkInterfaces(); + for (var devName in interfaces) { + var iface = interfaces[devName]; + for (var i = 0; i < iface.length; i++) { + var alias = iface[i]; + if (alias.family === 'IPv4' && alias.address !== '127.0.0.1' && !alias.internal) { + return alias.address; + } + } + } +} + module.exports = merge(prodEnv, { NODE_ENV: '"development"', API_URL: `"${ip}"`, diff --git a/config/index.js b/config/index.js index f51a3ccbfec095ea81fa9bf394d6220f2a57596f..7e229bfc7076483537ec5eb46bd2cccadb74e843 100644 --- a/config/index.js +++ b/config/index.js @@ -7,7 +7,21 @@ const env = process.env.NODE_ENV === 'testing' ? require('../config/test.env') : require('../config/prod.env') // let Paths = 'static/'+env.versionTime - let Paths = 'static' + let Paths = 'static'; + +function getIP() { + var interfaces = require('os').networkInterfaces(); + for (var devName in interfaces) { + var iface = interfaces[devName]; + for (var i = 0; i < iface.length; i++) { + var alias = iface[i]; + if (alias.family === 'IPv4' && alias.address !== '127.0.0.1' && !alias.internal) { + return alias.address; + } + } + } +} + module.exports = { dev: { // Paths @@ -20,9 +34,8 @@ module.exports = { } }, // Various Dev Server settings - // host: '10.1.23.212', // can be overwritten by process.env.HOST - host: '10.1.22.249', // can be overwritten by process.env.HOST // host: 'localhost', // can be overwritten by process.env.HOST + host: getIP(), // can be overwritten by process.env.HOST port: 8085, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined autoOpenBrowser: false, errorOverlay: true, diff --git a/src/components/buy/success.vue b/src/components/buy/success.vue index 30f992a3a9c633517ea888bb89f380d6f6155aeb..5c817da8ca652d41e3e48679dba1b9e7b5b49a1f 100644 --- a/src/components/buy/success.vue +++ b/src/components/buy/success.vue @@ -187,21 +187,24 @@ export default { }, changeText() { if (this.textIndex == 1) { - this.textContent = `[跳跳]å‘现一个对å©åå¯è’™ç‰¹åˆ«æœ‰ç”¨çš„å¹³å°ï¼ŒåŽŸæ¥è‹±è¯è¿˜å¯ä»¥è¿™æ ·å¦ï¼ + this.textContent = +`[跳跳]å‘现一个对å©åå¯è’™ç‰¹åˆ«æœ‰ç”¨çš„å¹³å°ï¼ŒåŽŸæ¥è‹±è¯è¿˜å¯ä»¥è¿™æ ·å¦ï¼ 🎉现在他们的课程在åšå›¢è´æ´»åЍ -[红包]åªè¦${this.groupDetail.current_price/100}元就å¯ä»¥å›¢è´ä»·å€¼${this.groupDetail.original_price/100}å…ƒ${this.groupDetail.course_name} +[红包]åªè¦${this.groupDetail.current_price / 100}元就å¯ä»¥å›¢è´ä»·å€¼${this.groupDetail.original_price / 100}å…ƒ${this.groupDetail.goods_desc.course_title} [爱心]${this.groupDetail.desc.group_number}人å³å¯æˆå›¢ [机智]å¿«æ¥å’Œæˆ‘一起拼团上课å§`; this.textIndex = 2; } else if (this.textIndex == 2) { - this.textContent = `[强]百万家长都在带å®å®å¦çš„唱唱å¯è’™è‹±è¯è¯¾ -🎉现在åªè¦${this.groupDetail.current_price/100}元就å¯ä»¥å›¢è´ä»·å€¼${this.groupDetail.original_price/100}å…ƒ${this.groupDetail.course_name} + this.textContent = +`[强]百万家长都在带å®å®å¦çš„唱唱å¯è’™è‹±è¯è¯¾ +🎉现在åªè¦${this.groupDetail.current_price / 100}元就å¯ä»¥å›¢è´ä»·å€¼${this.groupDetail.original_price / 100}å…ƒ${this.groupDetail.goods_desc.course_title} 🎤æ¯å¤©10分钟,让å®å®çˆ±å¦æ•¢è¯´ä¼šå”± [机智]抓ä½å®å®çš„è¯è¨€é»„金期,快æ¥å’Œæˆ‘一起拼团上课å§`; this.textIndex = 3; } else { - this.textContent = `[激动]å‘现一款超赞的å¯è’™è‹±è¯è¯¾ -👉åªè¦${this.groupDetail.current_price/100}元就å¯ä»¥å›¢è´ä»·å€¼${this.groupDetail.original_price/100}å…ƒ${this.groupDetail.course_name} + this.textContent = +`[激动]å‘现一款超赞的å¯è’™è‹±è¯è¯¾ +👉åªè¦${this.groupDetail.current_price / 100}元就å¯ä»¥å›¢è´ä»·å€¼${this.groupDetail.original_price / 100}å…ƒ${this.groupDetail.goods_desc.course_title} [爱心]${this.groupDetail.desc.group_number}人å³å¯æˆå›¢èŽ·å¾—è¯¾ç¨‹ [强]哈佛å师亲授,比动画片更有趣哦 [机智]å¿«æ¥å’Œæˆ‘一起拼团上课å§`; @@ -361,8 +364,9 @@ export default { data.goods_desc = JSON.parse(data.goods_desc); data.share_desc = JSON.parse(data.share_desc); this.groupDetail = data; - this.textContent = `[激动]å‘现一款超赞的å¯è’™è‹±è¯è¯¾ -[太阳]åªè¦${this.groupDetail.current_price/100}元就å¯ä»¥å›¢è´ä»·å€¼${this.groupDetail.original_price/100}å…ƒ${this.groupDetail.course_name} + this.textContent = +`[激动]å‘现一款超赞的å¯è’™è‹±è¯è¯¾ +[太阳]åªè¦${this.groupDetail.current_price / 100}元就å¯ä»¥å›¢è´ä»·å€¼${this.groupDetail.original_price / 100}å…ƒ${this.groupDetail.goods_desc.course_title} [爱心]${this.groupDetail.desc.group_number}人å³å¯æˆå›¢èŽ·å¾—è¯¾ç¨‹ [强]哈佛å师亲授,比动画片更有趣哦 [机智]å¿«æ¥å’Œæˆ‘一起拼团上课å§`; diff --git a/src/util/wechatEmoji.js b/src/util/wechatEmoji.js index 33a025880515f5b9d4ff8ce4433ffcc7645b433c..3eed58a4e830debcea858bdf0f2ad792b20ad599 100755 --- a/src/util/wechatEmoji.js +++ b/src/util/wechatEmoji.js @@ -123,6 +123,8 @@ export function addEmoji(string) { "[耶]": "114.png" }; + string = string.replace(/\n/g, "<br/>"); + for (let key in map) { if (string.indexOf(key) != -1) { string = replaceAll(key, `<img src="/static/images/wechat/${map[key]}">`, string);