修改详情投币bug
This commit is contained in:
parent
25b6e6128d
commit
2f3e1198e6
@ -31,7 +31,7 @@ service.interceptors.request.use(config => {
|
|||||||
// config['headers']['authorization'] = "qj2q1qk1on0curclipghjtv5ja1g9eq2"
|
// config['headers']['authorization'] = "qj2q1qk1on0curclipghjtv5ja1g9eq2"
|
||||||
// config['headers']['authorization'] = "661aiz52k5e6vqgmkxnz0wvbv8nciz8h"
|
// config['headers']['authorization'] = "661aiz52k5e6vqgmkxnz0wvbv8nciz8h"
|
||||||
|
|
||||||
if (process.env.NODE_ENV == "development") config['headers']['authorization'] = "qj2q1qk1on0curclipghjtv5ja1g9eq2"
|
// if (process.env.NODE_ENV == "development") config['headers']['authorization'] = "uqw2cz1zdqf2uvcd22kxxy5gtsrrctiz"
|
||||||
|
|
||||||
return config
|
return config
|
||||||
}, error => {
|
}, error => {
|
||||||
|
@ -437,31 +437,40 @@ export default {
|
|||||||
let isbuy = data.info.isbuy // 是否已经投币
|
let isbuy = data.info.isbuy // 是否已经投币
|
||||||
let isauthor = data.info.isauthor // 是否是作者
|
let isauthor = data.info.isauthor // 是否是作者
|
||||||
|
|
||||||
|
|
||||||
if (price > 0 && isbuy == 0 && isauthor != 1) {
|
if (price > 0 && isbuy == 0 && isauthor != 1) {
|
||||||
let message = info['message']
|
let message = info['message']
|
||||||
if (message.indexOf("[free]") != -1) {
|
// if (message.indexOf("[free]") != -1) {
|
||||||
info['message'] = ""
|
info['message'] = ""
|
||||||
const regex = /\[(free|hide)\]([^[]+)\[\/(free|hide)\]/g;
|
const regex = /\[(free|hide)\]([^[]+)\[\/(free|hide)\]/g;
|
||||||
let result = message.match(regex);
|
let result = message.match(regex) || [];
|
||||||
|
for (let i = 0; i < result.length; i++) {
|
||||||
for (let i = 0; i < result.length; i++) {
|
result[i] = result[i].replace("[free]", "")
|
||||||
result[i] = result[i].replace("[free]", "")
|
result[i] = result[i].replace("[/free]", "")
|
||||||
result[i] = result[i].replace("[/free]", "")
|
info['message'] += result[i]
|
||||||
info['message'] += result[i]
|
|
||||||
}
|
|
||||||
info['message'] += coinVisibleHtml
|
|
||||||
}
|
}
|
||||||
|
info['message'] += coinVisibleHtml
|
||||||
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (isbuy == 1 || isauthor == 1) {
|
if (isbuy == 1 || isauthor == 1) {
|
||||||
let message = info['message']
|
let message = info['message']
|
||||||
let mubiao = "" // 目标 message
|
let mubiao = "" // 目标 message
|
||||||
|
|
||||||
const regex = /\[(free|hide|\/free|\/hide)\]/g;
|
// const regex = /\[(free|hide|\/free|\/hide)\]/g;
|
||||||
const numericIndices = Array.from(message.matchAll(regex), match => match.index);
|
// const regex = /\[(free|hide|\/free|\/hide)\]/g;
|
||||||
|
|
||||||
|
// const regex = /\[(free|hide(?:=[0-9]+)?|\/free|\/hide)\]/g;
|
||||||
|
// const regex = /\[(free|hide(?:=[0-9]+)?|\/free|\/hide)\]/g;
|
||||||
|
// const regex = /\[(free|hide=\d+\|\/free|\/hide)\]/g;
|
||||||
|
// (?:=[0-9]+)?\
|
||||||
|
// const regex = /\[(free|hide(?:=[0-9]+)?|\/free|\/hide)\]/g;
|
||||||
|
|
||||||
|
const regex = /\[free\]|\[\/free\]|\[hide\]|\[\/hide\]|\[hide=[^\]]+\]/g;
|
||||||
|
|
||||||
|
const numericIndices = Array.from(message.matchAll(regex), match => match.index);
|
||||||
const result2D = [];
|
const result2D = [];
|
||||||
for (let i = 0; i < numericIndices.length; i += 2) {
|
for (let i = 0; i < numericIndices.length; i += 2) {
|
||||||
const pair = [numericIndices[i], numericIndices[i + 1]];
|
const pair = [numericIndices[i], numericIndices[i + 1]];
|
||||||
@ -470,8 +479,6 @@ export default {
|
|||||||
|
|
||||||
|
|
||||||
result2D.forEach((element, index) => {
|
result2D.forEach((element, index) => {
|
||||||
mubiao += message.slice(element[0], element[1] + 7)
|
|
||||||
|
|
||||||
if (index != 0) {
|
if (index != 0) {
|
||||||
let temporary = message.slice(result2D[index - 1][1] + 7, element[0])
|
let temporary = message.slice(result2D[index - 1][1] + 7, element[0])
|
||||||
temporary = this.goEmpty(temporary)
|
temporary = this.goEmpty(temporary)
|
||||||
@ -482,7 +489,8 @@ export default {
|
|||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
let temporary = message.slice(0, element[0])
|
let temporary = message.slice(0, element[0])
|
||||||
temporary = this.goEmpty(temporary)
|
temporary = this.goEmpty(temporary)
|
||||||
if (temporary) mubiao += replyVisibleHtmlAlready.replace('标记', message.slice(0, element[0]))
|
// if (temporary) mubiao += replyVisibleHtmlAlready.replace('标记', message.slice(0, element[0]))
|
||||||
|
if (temporary) mubiao += message.slice(0, element[0])
|
||||||
}
|
}
|
||||||
|
|
||||||
// 最后一个
|
// 最后一个
|
||||||
@ -491,6 +499,7 @@ export default {
|
|||||||
temporary = this.goEmpty(temporary)
|
temporary = this.goEmpty(temporary)
|
||||||
if (temporary) mubiao += replyVisibleHtmlAlready.replace('标记', message.slice(element[1] + 7, message.length - 1))
|
if (temporary) mubiao += replyVisibleHtmlAlready.replace('标记', message.slice(element[1] + 7, message.length - 1))
|
||||||
}
|
}
|
||||||
|
mubiao += message.slice(element[0], element[1] + 7)
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -499,19 +508,27 @@ export default {
|
|||||||
mubiao = mubiao.replaceAll('[/free]', '')
|
mubiao = mubiao.replaceAll('[/free]', '')
|
||||||
|
|
||||||
info['message'] = mubiao
|
info['message'] = mubiao
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (info['message'].indexOf("[hide]") != -1) {
|
|
||||||
|
const regex1 = /\[hide(?:=[0-9]+)?\]/;
|
||||||
|
if (regex1.test(info['message'])) {
|
||||||
|
// if (info['message'].indexOf("[hide]") != -1) {
|
||||||
const regex = /\[hide\].*?\[\/hide\]/g; // 获取所有[hide] 中间内容的正则
|
const regex = /\[hide\].*?\[\/hide\]/g; // 获取所有[hide] 中间内容的正则
|
||||||
if (ispost == 0 && isauthor != 1) info['message'] = info['message'].replace(regex, replyVisibleHtml);
|
if (ispost == 0 && isauthor != 1) info['message'] = info['message'].replace(regex, replyVisibleHtml);
|
||||||
if (ispost == 1 || isauthor == 1) {
|
if (ispost == 1 || isauthor == 1) {
|
||||||
info['message'] = info['message'].replaceAll("[hide]", `<div class="content-unlock content-already"><div class="content-already-header flexflex">- 本内容回复可见 -</div><div class="content-unlock-wenzi">`)
|
// info['message'] = info['message'].replaceAll("[hide]", `<div class="content-unlock content-already"><div class="content-already-header flexflex">- 本内容回复可见 -</div><div class="content-unlock-wenzi">`)
|
||||||
|
var pattern = /\[hide(=\d+)?\]/g;
|
||||||
|
info['message'] = info['message'].replaceAll(pattern, `<div class="content-unlock content-already"><div class="content-already-header flexflex">- 本内容回复可见 -</div><div class="content-unlock-wenzi">`)
|
||||||
info['message'] = info['message'].replaceAll("[/hide]", `</div></div>`)
|
info['message'] = info['message'].replaceAll("[/hide]", `</div></div>`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!this.islogin && isbuy == 0) {
|
||||||
|
info['message'] = info['message'].replaceAll('[free]', '')
|
||||||
|
info['message'] = info['message'].replaceAll('[/free]', '')
|
||||||
|
}
|
||||||
|
|
||||||
data.type == 0 ? this.$refs['vHtmlMessage'] ? this.$refs.vHtmlMessage.innerHTML = info['message'] : "" : ""
|
data.type == 0 ? this.$refs['vHtmlMessage'] ? this.$refs.vHtmlMessage.innerHTML = info['message'] : "" : ""
|
||||||
|
|
||||||
let replyVisibleList = document.getElementsByClassName("replyVisible")
|
let replyVisibleList = document.getElementsByClassName("replyVisible")
|
||||||
@ -545,7 +562,6 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
this.$on('registerVisibleClick', () => {
|
this.$on('registerVisibleClick', () => {
|
||||||
console.log("fkfkfkf");
|
|
||||||
this.isloginBtnState = true
|
this.isloginBtnState = true
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user