Commit 1f5e63c2 authored by linking2014's avatar linking2014

修复分享文案字段读错的问题

新增分享文案换行展示
parent baf7a9bc
'use strict';
const merge = require('webpack-merge');
const prodEnv = require('./prod.env');
// const ip = 'http://10.1.23.212:8085/'
const ip = 'http://192.168.0.111: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}"`,
......
......@@ -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: '192.168.0.111', // 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,
......
......@@ -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}人即可成团获得课程
[强]哈佛名师亲授,比动画片更有趣哦
[机智]快来和我一起拼团上课吧`;
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment