apply patch

This commit is contained in:
林滔
2025-08-15 10:49:43 +08:00
parent 6eeb305e79
commit d26d3b4d11
27 changed files with 877 additions and 522 deletions

4
app.js
View File

@@ -144,7 +144,8 @@ App({
code,
data: res.encryptedData,
iv: res.iv,
Options: this.globalData.launchOptions
Options: this.globalData.launchOptions,
inviter_nickname: wx.getStorageSync('inviter_nickname')
},
success: res => resolve(res),
fail: error => reject(error)
@@ -162,6 +163,7 @@ App({
method: 'POST',
data: {
'openid': wx.getStorageSync('openid'),
},
success: res => {
console.log('获取信息成功', res);

View File

@@ -45,7 +45,7 @@
},
{
"pagePath": "pages/video_list/video_list",
"text": "违规检测",
"text": "需求中心",
"iconPath": "images/文案库.png",
"selectedIconPath": "images/文案库点击.png"
},

5
app.miniapp.json Normal file
View File

@@ -0,0 +1,5 @@
{
"adapteByMiniprogram": {
"userName": "gh_d6b54fcc1462"
}
}

View File

@@ -20,7 +20,7 @@ Component({
pagePath: "/pages/video_list/video_list",
iconPath: "/images/文案库.png",
selectedIconPath: "/images/文案库点击.png",
text: "违规检测"
text: "需求中心"
},
{
pagePath: "/pages/mine/mine",

11
i18n/base.json Normal file
View File

@@ -0,0 +1,11 @@
{
"ios": {
"name": "快影下载"
},
"android": {
"name": "快影下载"
},
"common": {
"name": "快影下载"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

View File

@@ -141,6 +141,7 @@ Page({
},
copyAccount(e) {
console.log(e.currentTarget.dataset)
const account = e.currentTarget.dataset.account;
wx.setClipboardData({
data: account,

View File

@@ -14,7 +14,8 @@ Page({
page: 1,
isLoading: false,
hasMore: true,
externalOpenid:''
externalOpenid: '',
showQrcodePopup: false, // 新增:二维码弹窗显示状态
},
// 切换单选框模式
@@ -169,8 +170,37 @@ goToExtract(e) {
openid: wx.getStorageSync("openid")
},
success: (res) => {
console.log("视频提取结果:", res);
if (res.data.data.medias[0]) {
// 新增额度判断
if (res.data.success === false || res.data.code === 1000) {
let isIOS = false;
try {
const sysInfo = wx.getSystemInfoSync();
isIOS = sysInfo.system.toLowerCase().indexOf('ios') !== -1;
} catch (e) {
console.error('获取系统信息失败');
}
if (isIOS) {
this.setData({ showQrcodePopup: true });
} else {
wx.showModal({
title: "提取视频",
content:"哎呀!去开通会员不限次数使用哦",
confirmColor: "#00B269",
cancelColor: "#858585",
success: function(e) {
if (e.confirm) {
wx.navigateTo({
url: "../vip_recharge/vip_recharge?show=true"
});
}
}
});
}
wx.hideLoading();
return;
}
// 只有额度足够才执行下面
if (res.data.data && res.data.data.medias && res.data.data.medias[0]) {
const media = res.data.data.medias[0];
wx.navigateTo({
url: `../video/video?url=${encodeURIComponent(media.resource_url)}&image=${encodeURIComponent(media.preview_url)}&preview=${encodeURIComponent(res.data.data.text)}&type=index&read_count=0`
@@ -181,6 +211,7 @@ goToExtract(e) {
icon: "none"
});
}
wx.hideLoading();
},
fail: (err) => {
console.error("视频解析失败:", err);
@@ -226,17 +257,31 @@ extractText() {
},
success(res) {
if (res.data.success === false) {
wx.showModal({
title: "提取视频",
content: '哎呀!去开通会员不限次数使用哦',
confirmColor: "#00B269",
cancelColor: "#858585",
success: function(e) {
e.confirm ? (console.log("确定"), wx.navigateTo({
url: "../vip_recharge/vip_recharge?show=true"
})) : e.cancel && console.log("取消");
}
});
// 判断系统类型(平台)
let isIOS = false;
try {
const sysInfo = wx.getSystemInfoSync();
isIOS = sysInfo.system.toLowerCase().indexOf('ios') !== -1;
} catch (e) {
console.error('获取系统信息失败');
}
if (isIOS) {
// iOS弹二维码弹窗
that.setData({ showQrcodePopup: true });
} else {
// 安卓弹原有会员弹窗
wx.showModal({
title: "提取视频",
content: '哎呀!去开通会员不限次数使用哦',
confirmColor: "#00B269",
cancelColor: "#858585",
success: function(e) {
e.confirm ? (console.log("确定"), wx.navigateTo({
url: "../vip_recharge/vip_recharge?show=true"
})) : e.cancel && console.log("取消");
}
});
}
wx.hideLoading();
return;
}
@@ -459,5 +504,10 @@ removeTimestampAndMergeLines: function(textWithTimestamp) {
path: `/pages/index/index?uuid=${wx.getStorageSync("uuid")}`,
imageUrl: "/images/share.jpg"
};
}
},
// 关闭二维码弹窗
closeQrcodePopup() {
this.setData({ showQrcodePopup: false });
},
});

View File

@@ -2,7 +2,7 @@
"usingComponents": {
"popup": "/popup/popup"
},
"navigationBarTitleText": "快影下载",
"navigationBarTitleText": "抖视下载",
"navigationBarBackgroundColor": "#222238",
"navigationBarTextStyle": "white"

View File

@@ -116,3 +116,11 @@
buttonText="查看详情"
targetUrl="/pages/details/details"
/>
<view wx:if="{{showQrcodePopup}}" class="qrcode-popup-mask" bindtap="closeQrcodePopup">
<view class="qrcode-popup" catchtap="preventDefault">
<image src="../../images/qrcode_for_gh_e64390b2d04e_258.jpg" class="qrcode-img" show-menu-by-longpress="true"></image>
<view class="qrcode-tip">长按识别二维码,前往公众号获取更多额度</view>
<view class="qrcode-close-btn" bindtap="closeQrcodePopup">关闭</view>
</view>
</view>

View File

@@ -364,4 +364,57 @@ page {
40% {
transform: translateY(-10rpx);
}
}
.qrcode-popup-mask {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.6);
z-index: 2000;
display: flex;
align-items: center;
justify-content: center;
}
.qrcode-popup {
background: #fff;
border-radius: 18px;
box-shadow: 0 8px 32px rgba(0,0,0,0.25);
padding: 32px 24px 20px 24px;
display: flex;
flex-direction: column;
align-items: center;
min-width: 260px;
max-width: 80vw;
}
.qrcode-img {
width: 180px;
height: 180px;
border-radius: 12px;
margin-bottom: 18px;
box-shadow: 0 2px 12px rgba(0,0,0,0.10);
}
.qrcode-tip {
font-size: 16px;
color: #333;
margin-bottom: 18px;
text-align: center;
font-weight: 500;
}
.qrcode-close-btn {
margin-top: 8px;
padding: 8px 32px;
background: linear-gradient(90deg, #8d72d2, #7183f3);
color: #fff;
border: none;
border-radius: 24px;
font-size: 15px;
font-weight: bold;
box-shadow: 0 2px 8px rgba(0,0,0,0.10);
transition: background 0.2s;
}
.qrcode-close-btn:active {
background: linear-gradient(90deg, #7183f3, #8d72d2);
}

View File

@@ -33,7 +33,8 @@ Page({
n.setData({
inviteCount: wx.getStorageSync("invitees_count"),
rewardCount: 10 * wx.getStorageSync("invitees_count"),
number: wx.getStorageSync("balance")
number: wx.getStorageSync("balance"),
uuid:wx.getStorageSync("uuid"),
});
}).catch(function(e) {
console.error("An error occurred:", e);

View File

@@ -20,7 +20,7 @@
<view class="description warning">禁止任何形式的作弊行为,</view>
<view class="description warning">如发现使用外挂等违规行为,</view>
<view class="description warning">将取消活动资格。</view>
<view class="countdown">活动限时有效</view>
<view class="countdown">活动方式仅向合作者开放</view>
<view class="invite-path">
<text class="path-text" bindtap="copyPath" selectable="true">/pages/index/index?uuid={{uuid}}</text>

View File

@@ -46,7 +46,7 @@ Component({
var e = this.data.endTime;
// 将秒时间戳转换为毫秒时间戳
var date = new Date(e * 1000);
// 格式化为“YYYY年MM月DD日”
var year = date.getFullYear();
var month = String(date.getMonth() + 1).padStart(2, "0"); // 月份从 0 开始,需要 +1

View File

@@ -13,6 +13,7 @@ Page({
totalLength: 0,
isExtracting: false,
read_count: 0,
showQrcodePopup: false, // 新增:二维码弹窗显示状态
},
onLoad: function (options) {
@@ -131,6 +132,7 @@ Page({
// 扣除额度
CreditLimit() {
var that = this;
return new Promise((resolve, reject) => {
app.apiRequest({
url: '/myapp/increment-download-count/',
@@ -143,17 +145,26 @@ Page({
console.log(e, !e.data.success)
if (e.data.success === false) {
wx.hideLoading()
wx.showModal({
title: "提取视频",
content: '哎呀!去开通会员不限次数使用哦',
confirmColor: "#00B269",
cancelColor: "#858585",
success: function (e) {
e.confirm ? (console.log("确定"), wx.navigateTo({
url: "../vip_recharge/vip_recharge?show=true"
})) : e.cancel && console.log("取消");
}
})
// 判断系统类型
const systemInfo = wx.getSystemInfoSync();
const isIOS = systemInfo.system.toLowerCase().indexOf('ios') !== -1;
if (isIOS) {
// iOS弹二维码弹窗
that.setData({ showQrcodePopup: true });
} else {
// 安卓弹原有会员弹窗
wx.showModal({
title: "提取视频",
content: '哎呀!去开通会员不限次数使用哦',
confirmColor: "#00B269",
cancelColor: "#858585",
success: function (e) {
e.confirm ? (console.log("确定"), wx.navigateTo({
url: "../vip_recharge/vip_recharge?show=true"
})) : e.cancel && console.log("取消");
}
})
}
resolve(false)
}
resolve(true)
@@ -551,4 +562,9 @@ Page({
}
});
},
// 关闭二维码弹窗
closeQrcodePopup: function () {
this.setData({ showQrcodePopup: false });
},
});

View File

@@ -26,3 +26,11 @@
buttonText="查看详情"
targetUrl="/pages/details/details"
/>
<view wx:if="{{showQrcodePopup}}" class="qrcode-popup-mask" bindtap="closeQrcodePopup">
<view class="qrcode-popup" catchtap="preventDefault">
<image src="../../images/qrcode_for_gh_e64390b2d04e_258.jpg" class="qrcode-img" show-menu-by-longpress="true"></image>
<view class="qrcode-tip">长按识别二维码,前往公众号获取更多额度</view>
<view class="qrcode-close-btn" bindtap="closeQrcodePopup">关闭</view>
</view>
</view>

View File

@@ -86,4 +86,77 @@ page {
.advertisement image {
width: 100%;
}
/* 二维码弹窗样式 */
.qrcode-popup-mask {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.6);
z-index: 2000;
display: flex;
align-items: center;
justify-content: center;
}
.qrcode-popup {
background: #fff;
border-radius: 18px;
box-shadow: 0 8px 32px rgba(0,0,0,0.25);
padding: 32px 24px 20px 24px;
display: flex;
flex-direction: column;
align-items: center;
min-width: 260px;
max-width: 80vw;
animation: popupFadeIn 0.3s ease;
}
@keyframes popupFadeIn {
from {
opacity: 0;
transform: scale(0.9);
}
to {
opacity: 1;
transform: scale(1);
}
}
.qrcode-img {
width: 180px;
height: 180px;
border-radius: 12px;
margin-bottom: 18px;
box-shadow: 0 2px 12px rgba(0,0,0,0.10);
}
.qrcode-tip {
font-size: 16px;
color: #333;
margin-bottom: 18px;
text-align: center;
font-weight: 500;
line-height: 1.4;
}
.qrcode-close-btn {
margin-top: 8px;
padding: 8px 32px;
background: linear-gradient(90deg, #8d72d2, #7183f3);
color: #fff;
border: none;
border-radius: 24px;
font-size: 15px;
font-weight: bold;
box-shadow: 0 2px 8px rgba(0,0,0,0.10);
transition: all 0.2s ease;
}
.qrcode-close-btn:active {
transform: scale(0.95);
background: linear-gradient(90deg, #7183f3, #8d72d2);
}

View File

@@ -2,237 +2,212 @@ const app = getApp();
Page({
data: {
inputValue: '', // 输入框的内容
detectResult: '', // 识别结果
detectType: 'text', // 默认识别类型为文本
maxLength: 20000, // 最大允许的字节数
inputLength: 0, // 当前输入的字节数
task_id: '', // 任务ID
detectButtonDisabled: false, // 文本检测按钮是否禁用
modifyButtonDisabled: false // 智能修改按钮是否禁用
requirementTypes: [
{ value: 'new_feature', label: '新功能需求' },
{ value: 'cooperation', label: '合作需求' },
{ value: 'advertising', label: '广告投放' },
{ value: 'miniapp_dev', label: '小程序开发' },
{ value: 'software_custom', label: '软件定制' },
{ value: 'other', label: '其他需求' }
],
selectedType: '', // 选中的需求类型
title: '', // 需求标题
description: '', // 功能描述
contactInfo: '', // 联系方式(微信号)
submitButtonDisabled: false, // 提交按钮是否禁用
showTypeSelector: false // 是否显示类型选择器
},
onLoad: function(e) {
wx.showShareMenu({
withShareTicket: true,
menus: ["shareAppMessage", "shareTimeline"]
});
},
onShow: function() {
var t = this;
t.resetData()
t.resetData();
app.getCurrentTabbar(2, this);
app.checkUpdateVersion();
app.getUserInfo().then(() => {
console.log('获取用户信息完成');
console.log(wx.getStorageSync('defaultDailyFreeParseNum'));
const rewrittenText = wx.getStorageSync('rewrittenText'); // 从缓存中获取存储的文案
if (rewrittenText) {
this.setData({
inputValue: rewrittenText // 设置到页面的数据中
});
wx.removeStorageSync('rewrittenText'); // 清除数据,避免下次重复加载
wx.showToast({
title: '点击开始检测按钮检测文本违规词。',
icon: 'none'
});
}
}).catch(error => {
console.error('获取用户信息失败:', error);
}).finally(() => {
console.log('getUserInfo调用完成');
});
},
resetData: function() {
// 重置页面数据为默认值
this.setData({
inputValue: '', // 输入框的内容
detectResult: '', // 识别结果
detectType: 'text', // 默认识别类型为文本
inputLength: 0, // 当前输入的字节数
task_id: '', // 任务ID
detectButtonDisabled: false, // 文本检测按钮是否禁用
modifyButtonDisabled: false // 智能修改按钮是否禁用
selectedType: '',
title: '',
description: '',
contactInfo: '',
submitButtonDisabled: false,
showTypeSelector: false
});
},
// 切换识别类型
switchDetectType(e) {
const detectType = e.currentTarget.dataset.type;
this.recordClick(detectType);
// 显示需求类型选择器
showTypeSelector() {
this.setData({
detectType,
detectResult: '' // 切换时清空结果
showTypeSelector: true
});
if (detectType === 'audio' || detectType === 'video') {
wx.showToast({
title: '该功能正在开发中',
icon: 'none'
});
} else {
wx.showToast({
title: '切换到文本识别',
icon: 'none'
});
}
},
// 文本识别函数
detectText() {
const { inputValue, maxLength } = this.data;
const byteSize = this.getByteLength(inputValue);
// 隐藏需求类型选择器
hideTypeSelector() {
this.setData({
showTypeSelector: false
});
},
// 检查文本是否为空或长度过短
if (!inputValue.trim() || this.getByteLength(inputValue) < 10) {
// 选择需求类型
selectType(e) {
const type = e.currentTarget.dataset.type;
const label = e.currentTarget.dataset.label;
this.setData({
selectedType: type,
selectedTypeLabel: label,
showTypeSelector: false
});
},
// 处理标题输入
onTitleInput(e) {
this.setData({
title: e.detail.value
});
},
// 处理描述输入
onDescriptionInput(e) {
this.setData({
description: e.detail.value
});
},
// 处理联系方式输入
onContactInput(e) {
this.setData({
contactInfo: e.detail.value
});
},
// 验证表单
validateForm() {
const { selectedType, description, contactInfo } = this.data;
if (!selectedType) {
wx.showToast({
title: '请输入有效的文本',
title: '请选择需求类型',
icon: 'none'
});
return false;
}
if (!description.trim()) {
wx.showToast({
title: '请填写功能描述',
icon: 'none'
});
return false;
}
if (!contactInfo.trim()) {
wx.showToast({
title: '请填写微信号',
icon: 'none'
});
return false;
}
return true;
},
// 提交需求
submitRequirement() {
if (!this.validateForm()) {
return;
}
// 超出字节长度检测
if (byteSize > maxLength) {
wx.showToast({
title: `内容不能超过 ${maxLength} 字节`,
icon: 'none'
});
return;
}
// 禁用检测按钮
this.setData({ detectButtonDisabled: true });
// 禁用提交按钮
this.setData({ submitButtonDisabled: true });
wx.showLoading({
title: '正在检测...',
title: '正在提交...',
});
// 调用后端审核接口
const { selectedType, title, description, contactInfo } = this.data;
// 调用后端需求提交接口
app.apiRequest({
url: '/myapp/text_review/',
url: '/myapp/submit_requirement/',
method: 'POST',
data: {
text: inputValue,
openid: wx.getStorageSync('openid'),
nickname: wx.getStorageSync('uuid')
nickname: wx.getStorageSync('uuid'),
requirement_type: selectedType,
title: title,
description: description,
contact_info: contactInfo,
wechat_id: contactInfo // 使用同一个值作为微信号
},
success: (res) => {
wx.hideLoading();
this.setData({ detectButtonDisabled: false }); // 启用检测按钮
if (res.data.code === 200) {
// 审核成功
this.setData({
detectResult: res.data.data.result,
task_id: res.data.task_id
});
console.log(res.data.data.result);
wx.showToast({
title: '检测成功',
icon: 'success'
});
if (res.data.data.result.conclusion === '不合规') {
wx.showModal({
title: "提示",
content: "检测结果不合规,是否使用智能合规功能一键修改文案?",
confirmText: "一键修改",
cancelText: "取消",
success: (modalRes) => {
if (modalRes.confirm) {
this.modifyContent(); // 调用一键合规函数
}
}
});
}
} else if (res.data.code === 400 && res.data.message === '余额不足') {
// 积分不足,提示充值
this.setData({ submitButtonDisabled: false });
if (res.data.success) {
wx.showModal({
title: "检测文本",
content: '创意点不足!',
confirmColor: "#00B269",
cancelColor: "#858585",
success: function(e) {
if (e.confirm) {
console.log("确定");
wx.navigateTo({
url: "../vip_recharge/vip_recharge?show=true"
});
} else {
console.log("取消");
}
title: "提交成功",
content: res.data.message || "需求提交成功,我们会尽快处理您的需求",
showCancel: false,
confirmText: "确定",
success: () => {
// 重置表单
this.resetData();
}
});
} else {
// 其他失败情况
wx.showToast({
title: res.data.message || '检测失败,请稍后重试',
title: res.data.error || '提交失败,请稍后重试',
icon: 'none'
});
}
},
fail: (err) => {
wx.hideLoading();
this.setData({ detectButtonDisabled: false }); // 启用检测按钮
this.setData({ submitButtonDisabled: false });
console.error('请求失败:', err);
wx.showToast({
title: '网络异常,请稍后重试',
icon: 'none'
});
// 处理常见错误
if (err.statusCode === 400) {
wx.showToast({
title: '请检查填写信息',
icon: 'none'
});
} else if (err.statusCode === 404) {
wx.showToast({
title: '用户信息异常,请重新登录',
icon: 'none'
});
} else {
wx.showToast({
title: '网络异常,请稍后重试',
icon: 'none'
});
}
}
});
},
// 计算文本的字节长度(区分中英文)
getByteLength(text) {
return text.replace(/[^\x00-\xff]/g, 'aa').length;
},
// 处理输入框内容变化
bindInput(e) {
const inputValue = e.detail.value;
const inputLength = this.getByteLength(inputValue);
// 更新输入内容和字节长度
this.setData({
inputValue,
inputLength
});
// 如果字数超出最大限制,提示用户
if (inputLength > this.data.maxLength) {
wx.showToast({
title: `已超出 ${this.data.maxLength} 字节`,
icon: 'none'
});
}
},
// 复制内容
copyContent() {
wx.setClipboardData({
data: this.data.inputValue,
success() {
wx.showToast({
title: '内容已复制',
icon: 'none'
});
}
});
},
// 清空输入框内容
clearInput() {
// 清空表单
clearForm() {
wx.showModal({
title: "提示",
content: "确定要清空所有内容吗?",
success: (res) => {
if (res.confirm) {
this.setData({
inputValue: '',
inputLength: 0,
detectResult: ''
});
this.resetData();
wx.showToast({
title: '已清空内容',
icon: 'none'
@@ -240,89 +215,5 @@ Page({
}
}
});
},
// 调用智能修改AI合规
modifyContent() {
// 禁用智能修改按钮
this.setData({ modifyButtonDisabled: true });
wx.showLoading({
title: '正在修改...',
});
app.apiRequest({
url: '/myapp/ai_modify_text/',
method: 'POST',
data: {
task_id: this.data.task_id,
openid: wx.getStorageSync('openid')
},
success: (res) => {
wx.hideLoading();
this.setData({ modifyButtonDisabled: false }); // 启用智能修改按钮
if (res.data.code === 200) {
// 修改成功
this.setData({
inputValue: res.data.data.modified_text,
detectResult: '' // 清空检测结果
});
wx.showToast({
title: '修改成功',
icon: 'success'
});
}else if (res.data.code === 400 && res.data.message === '积分不足,请充值') {
// 积分不足,提示用户充值并引导
wx.showModal({
title: "提示",
content: "您的积分不足,无法进行智能修改,请充值后再尝试。",
confirmText: "去充值",
cancelText: "取消",
success: (modalRes) => {
if (modalRes.confirm) {
wx.navigateTo({
url: "../vip_recharge/vip_recharge?show=true"
});
}
}
});
} else {
// 其他失败情况
wx.showToast({
title: res.data.message || '修改失败,请稍后重试',
icon: 'none'
});
}
},
fail: (err) => {
wx.hideLoading();
this.setData({ modifyButtonDisabled: false }); // 启用智能修改按钮
console.error('请求失败:', err);
wx.showToast({
title: '网络异常,请稍后重试',
icon: 'none'
});
}
});
},
// 记录点击的功能类型
recordClick(functionClicked) {
app.apiRequest({
url: `/myapp/record_click/`, // 点击统计接口
method: 'POST',
data: {
openid: wx.getStorageSync('openid'),
nickname: wx.getStorageSync('uuid'),
function_clicked: functionClicked
},
header: {
'content-type': 'application/json'
},
success: (res) => {
}
});
}
});

View File

@@ -1,5 +1,5 @@
{
"navigationBarTitleText": "违规词识别",
"navigationBarTitleText": "需求提交",
"navigationBarBackgroundColor": "#222238",
"navigationBarTextStyle": "white",
"component": true,

View File

@@ -1,85 +1,90 @@
<view class="container">
<!-- 顶部按钮组 -->
<!-- 标题区域 -->
<view class="header">
<view class="button-group">
<button class="detect-button active" data-type="text" bindtap="switchDetectType">文本识别</button>
<button class="detect-button" data-type="audio" bindtap="switchDetectType">音频识别</button>
<button class="detect-button" data-type="video" bindtap="switchDetectType">视频识别</button>
</view>
<view class="title">提交您的需求</view>
<view class="subtitle">我们会认真考虑每一个建议</view>
</view>
<!-- 输入框区域 -->
<view class="input-area">
<textarea class="input-field"
bindinput="bindInput"
value="{{inputValue}}"
placeholder-class="b-palceholder"
placeholder="输入或粘贴文本,自动识别违规内容并智能修改..."
maxlength="20000">
</textarea>
<!-- 字数统计及提示信息 -->
<view class="text-counter">
<text>{{inputLength}} / {{maxLength}}</text>
<text wx:if="{{inputLength > maxLength}}" class="error-text">内容不能超过 {{maxLength}} 字节</text>
</view>
<!-- 操作按钮 第一行:检测和智能修改 -->
<view class="button-group">
<button class="detect-button" disabled="{{detectButtonDisabled}}" bindtap="detectText">开始检测</button>
<button class="modify-button" disabled="{{modifyButtonDisabled}}" bindtap="modifyContent">一键合规</button>
</view>
<!-- 操作按钮 第二行:复制和清空 -->
<view class="button-group">
<button class="copy-button" bindtap="copyContent">复制内容</button>
<button class="clear-button" bindtap="clearInput">清空输入</button>
</view>
<view class="disclaimer">
<text>单次消耗3创意点。检测中请勿退出本页面很快完成</text>
</view>
</view>
<view class="report-container" wx:if="{{detectResult}}">
<!-- 报告标题 -->
<view class="report-title">检测报告</view>
<!-- 检测结果 -->
<view class="result-summary">
<text class="{{detectResult.conclusion === '合规' ? 'compliant' : 'non-compliant'}}">
检测结果: {{detectResult.conclusion}}
</text>
</view>
<!-- 表格 -->
<view class="result-table">
<!-- 表头 -->
<view class="table-row table-header">
<view class="table-cell">疑似命中</view>
<view class="table-cell">关键词</view>
<view class="table-cell">字符位置</view>
<view class="table-cell">置信度</view>
</view>
<!-- 表格内容 -->
<block wx:for="{{detectResult.data}}" wx:key="index">
<view class="table-row">
<view class="table-cell">{{item.reason}}</view>
<view class="table-cell">{{item.keyword}}</view>
<view class="table-cell">{{item.position}}</view>
<view class="table-cell">{{item.confidence}}</view>
<!-- 表单区域 -->
<view class="form-area">
<!-- 需求类型选择 -->
<view class="form-item">
<view class="label">需求类型 <text class="required">*</text></view>
<view class="type-selector" bindtap="showTypeSelector">
<text class="{{selectedType ? 'selected' : 'placeholder'}}">
{{selectedTypeLabel || '请选择需求类型'}}
</text>
<text class="arrow">></text>
</view>
</block>
</view>
</view>
<!-- 设置底部间距 -->
<view class="bottom-space"></view>
<view class="disclaimer">
<text>功能介绍:本功能用于检测文本中可能存在的违规内容,帮助用户规避潜在风险。\n</text>
<text>免责声明:本检测结果仅供参考,具体结果请以实际情况为准,平台不承担由此产生的任何法律责任。</text>
<!-- 需求标题 -->
<view class="form-item">
<view class="label">需求标题</view>
<input class="input-field"
bindinput="onTitleInput"
value="{{title}}"
placeholder="请输入需求标题(选填)"
maxlength="100" />
</view>
<!-- 功能描述 -->
<view class="form-item">
<view class="label">功能描述 <text class="required">*</text></view>
<textarea class="textarea-field"
bindinput="onDescriptionInput"
value="{{description}}"
placeholder="请详细描述您的需求,包括具体功能、使用场景等..."
maxlength="1000">
</textarea>
</view>
<!-- 微信号 -->
<view class="form-item">
<view class="label">微信号 <text class="required">*</text></view>
<input class="input-field"
bindinput="onContactInput"
value="{{contactInfo}}"
placeholder="请输入微信号"
maxlength="50" />
</view>
<!-- 操作按钮 -->
<view class="button-group">
<button class="submit-button"
disabled="{{submitButtonDisabled}}"
bindtap="submitRequirement">
提交需求
</button>
<button class="clear-button" bindtap="clearForm">清空表单</button>
</view>
<!-- 说明文字 -->
<view class="disclaimer">
<text>• 请详细描述您的需求,便于我们更好地理解和评估</text>
</view>
</view>
</view>
<!-- 需求类型选择器弹窗 -->
<view class="type-selector-modal" wx:if="{{showTypeSelector}}">
<view class="modal-mask" bindtap="hideTypeSelector"></view>
<view class="modal-content">
<view class="modal-header">
<text class="modal-title">选择需求类型</text>
<text class="modal-close" bindtap="hideTypeSelector">×</text>
</view>
<view class="type-list">
<view class="type-item"
wx:for="{{requirementTypes}}"
wx:key="value"
data-type="{{item.value}}"
data-label="{{item.label}}"
bindtap="selectType">
<text class="type-label">{{item.label}}</text>
<text class="type-check" wx:if="{{selectedType === item.value}}">✓</text>
</view>
</view>
</view>
</view>

View File

@@ -8,44 +8,28 @@ page {
display: flex;
flex-direction: column;
padding: 20px;
min-height: 100vh;
}
.header {
display: flex;
justify-content: space-around;
margin-bottom: 20px;
width: 100%;
}
.button-group {
display: flex;
width: 100%;
justify-content: space-around;
}
.detect-button{
width: 30%;
height: 35px;
font-size: 12px;
line-height: 35px;
background: linear-gradient(90deg, #8d72d2, #7183f3);
border-radius: 5px;
text-align: center;
color: white;
box-shadow: 0 4px 10px rgba(141, 114, 210, 0.4);
transition: background 0.3s, transform 0.3s;
margin-bottom: 30px;
width: 100%;
}
.detect-button:hover {
background: linear-gradient(90deg, #664da5, #4e66d8);
.title {
font-size: 24px;
color: #fff;
font-weight: bold;
margin-bottom: 10px;
}
.active {
border: 1px solid #fff;
.subtitle {
font-size: 14px;
color: #a790e2;
}
.input-area {
.form-area {
width: 100%;
background-color: #222238;
box-shadow: 0 4px 10px rgba(141, 114, 210, 0.4);
@@ -55,150 +39,225 @@ page {
margin-bottom: 20px;
}
.form-item {
margin-bottom: 20px;
}
.label {
font-size: 14px;
color: #fff;
margin-bottom: 8px;
display: block;
}
.required {
color: #ff4d4f;
}
.input-field {
background: #33334c;
color: #a790e2;
padding: 15px;
padding: 12px 15px;
box-sizing: border-box;
border-radius: 5px;
width: 100%;
height: 230px;
height: 40px;
border: 1px solid #a790e2;
outline: none;
font-size: 14px;
}
.textarea-field {
background: #33334c;
color: #a790e2;
padding: 12px 15px;
box-sizing: border-box;
border-radius: 5px;
width: 100%;
height: 120px;
border: 1px solid #a790e2;
outline: none;
resize: none;
font-size: 14px;
}
.input-field:hover {
.input-field:hover, .textarea-field:hover {
border-color: #fff;
}
.type-selector {
background: #33334c;
color: #a790e2;
padding: 0 15px;
box-sizing: border-box;
border-radius: 5px;
width: 100%;
height: 40px;
border: 1px solid #a790e2;
display: flex;
justify-content: space-between;
align-items: center;
}
.type-selector:hover {
border-color: #fff;
}
.placeholder {
color: #999;
line-height: 1;
}
.selected {
color: #a790e2;
line-height: 0.2;
}
.arrow {
color: #a790e2;
font-size: 16px;
line-height: 1;
}
.button-group {
display: flex;
justify-content: space-between;
margin-top: 10px;
margin-top: 20px;
}
.copy-button, .modify-button ,.detect-button, .clear-button{
width: 30%;
.submit-button, .clear-button {
width: 48%;
height: 40px;
box-sizing: border-box;
background: linear-gradient(90deg, #8d72d2, #7183f3);
border-radius: 5px;
text-align: center;
color: white;
font-size: 14px;
line-height: 40px;
box-shadow: 0 4px 10px rgba(141, 114, 210, 0.4);
transition: background 0.3s, transform 0.3s;
}
.copy-button:hover, .modify-button:hover {
.submit-button {
background: linear-gradient(90deg, #8d72d2, #7183f3);
}
.submit-button:hover {
background: linear-gradient(90deg, #664da5, #4e66d8);
transform: translateY(-2px);
}
.result-area {
.clear-button {
background: linear-gradient(90deg, #666, #888);
}
.clear-button:hover {
background: linear-gradient(90deg, #555, #777);
transform: translateY(-2px);
}
.disclaimer {
margin-top: 20px;
background: linear-gradient(135deg, #a3a3df, #eaeaf5); /* 浅色渐变背景 */
width: 90%;
padding: 15px;
border-radius: 10px;
box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1); /* 添加轻微阴影效果 */
margin-bottom: 20px;
border: 1px solid #ddd; /* 增加边框 */
}
.text-counter{
background: rgba(167, 144, 226, 0.1);
border-radius: 5px;
color: #a790e2;
font-size: 12px;
color: white;
text-align: left;
margin:2px;
}
.error-text {
color: red;
margin-left: 60px;
line-height: 1.5;
}
/* 报告容器样式 */
.report-container {
width: 95%;
background-color: #f5f8ff;
padding: 20rpx;
border-radius: 15rpx;
box-shadow: 0rpx 5rpx 15rpx rgba(0, 0, 0, 0.1);
margin-top: 20rpx;
margin-bottom: 45px;
.disclaimer text {
display: block;
margin-bottom: 5px;
}
/* 标题样式 */
.report-title {
font-size: 36rpx;
color: #333;
font-weight: bold;
text-align: center;
margin-bottom: 2rpx;
}
/* 检测结果样式 */
.result-summary {
font-size: 28rpx;
color: #666;
margin-bottom: 20rpx;
text-align: center;
}
/* 合规与不合规文本样式 */
.compliant {
color: #00b269; /* 绿色 */
}
.non-compliant {
color: #ff4d4f; /* 红色 */
}
/* 表格样式 */
.result-table {
/* 弹窗样式 */
.type-selector-modal {
position: fixed;
top: 0;
left: 0;
width: 100%;
border-collapse: collapse;
height: 100%;
z-index: 1000;
}
/* 表格行样式 */
.table-row {
.modal-mask {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
}
.modal-content {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
background: #222238;
border-radius: 15px 15px 0 0;
padding: 20px;
box-sizing: border-box;
animation: slideUp 0.3s ease-out;
}
@keyframes slideUp {
from {
transform: translateY(100%);
}
to {
transform: translateY(0);
}
}
.modal-header {
display: flex;
justify-content: space-between;
padding: 10rpx 0;
border-bottom: 1rpx solid #eaeaea;
align-items: center;
margin-bottom: 20px;
border-bottom: 1px solid #a790e2;
padding-bottom: 15px;
}
/* 表格头部样式 */
.table-header {
.modal-title {
font-size: 16px;
color: #fff;
font-weight: bold;
background-color: #eef1f8;
padding: 10rpx 0;
text-align: center;
}
/* 表格单元格样式 */
.table-cell {
flex: 1;
text-align: center;
font-size: 26rpx;
color: #333;
padding: 10rpx 0;
.modal-close {
font-size: 24px;
color: #a790e2;
cursor: pointer;
}
/* 底部空白区 */
.bottom-space {
height: 50rpx;
.type-list {
max-height: 300px;
overflow-y: auto;
}
/* Disclaimer styling */
.disclaimer {
margin-top: 20rpx;
padding: 10rpx;
color: #999;
font-size: 22rpx; /* 小号字体 */
text-align: center;
.type-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 15px 0;
border-bottom: 1px solid rgba(167, 144, 226, 0.2);
}
.type-item:last-child {
border-bottom: none;
}
.type-label {
font-size: 14px;
color: #a790e2;
}
.type-check {
font-size: 16px;
color: #00b269;
font-weight: bold;
}

View File

@@ -8,47 +8,25 @@ Page({
selectedType: null,
cards: [],
isQuota: false,
show: false,
show: true, // 默认显示,前端判断
isIOS: false, // 是否为 iOS 系统
showQrcodePopup: false, // 新增:二维码弹窗显示状态
},
onLoad: function (e) {
const that = this;
getApp().check_status()
.then(function(res) {
that.setData({
show: res.data.data.show
});
if (!that.data.show) {
wx.showModal({
title: "提示",
content: "iOS 暂时无法使用此功能,请稍后再试。",
showCancel: false,
confirmText: "知道了",
success: () => {
// 可选:用户确认后返回上一级页面
wx.reLaunch({
url: "/pages/index/index",
})
}
});
return; // 停止执行后续逻辑
}
})
.catch(function(err) {
console.error("获取文章信息失败:", err);
})
.finally(function() {
console.log("check_status调用完成");
});
// 使用 wx.getDeviceInfo() 检测系统是否为 iOS
// 前端判断系统类型
const systemInfo = wx.getSystemInfoSync();
const isIOS = systemInfo.system.toLowerCase().indexOf('ios') !== -1;
this.setData({ isIOS });
if (isIOS) {
// iOS弹二维码弹窗
this.setData({ showQrcodePopup: true, show: false });
return;
}
// 非 iOS 系统,继续加载页面逻辑
var t = wx.getStorageSync("cards").filter(function (t) {
return t.is_quota === JSON.parse(e.isQuota || "false");
});
console.log("renderCards", t);
this.setData({
cards: t,
@@ -169,7 +147,7 @@ Page({
// 将秒时间戳转换为毫秒时间戳
var date = new Date(e * 1000);
// 格式化为YYYY年MM月DD日
// 格式化为"YYYY年MM月DD日"
var year = date.getFullYear();
var month = String(date.getMonth() + 1).padStart(2, "0"); // 月份从 0 开始,需要 +1
var day = String(date.getDate()).padStart(2, "0");
@@ -184,4 +162,15 @@ Page({
onPullDownRefresh: function () {},
onReachBottom: function () {},
onShareAppMessage: function () {},
// 关闭二维码弹窗
closeQrcodePopup: function() {
this.setData({ showQrcodePopup: false });
wx.navigateBack(); // 返回上一页
},
// 阻止事件冒泡
preventDefault: function(e) {
// 阻止点击弹窗内容时触发关闭
}
});

View File

@@ -30,3 +30,11 @@
<text>成为会员,享受无限使用功能特权,体验更多专属内容!</text>
</view>
</view>
<view wx:if="{{showQrcodePopup}}" class="qrcode-popup-mask" bindtap="closeQrcodePopup">
<view class="qrcode-popup" catchtap="preventDefault">
<image src="../../images/qrcode_for_gh_e64390b2d04e_258.jpg" class="qrcode-img" show-menu-by-longpress="true"></image>
<view class="qrcode-tip">IOS此功能暂不可用。长按识别二维码前往公众号获取更多额度</view>
<view class="qrcode-close-btn" bindtap="closeQrcodePopup">关闭</view>
</view>
</view>

View File

@@ -130,4 +130,103 @@ page {
.right {
color: #fff;
}
/* 二维码弹窗样式 */
.qrcode-popup-mask {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.7);
z-index: 2000;
display: flex;
align-items: center;
justify-content: center;
backdrop-filter: blur(4px);
}
.qrcode-popup {
background: linear-gradient(145deg, #2f2f50, #383861);
border-radius: 24px;
box-shadow: 0 12px 36px rgba(0,0,0,0.3);
padding: 36px 28px 24px;
display: flex;
flex-direction: column;
align-items: center;
min-width: 280px;
max-width: 85vw;
animation: popupFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
border: 1px solid rgba(255, 255, 255, 0.1);
}
@keyframes popupFadeIn {
0% {
opacity: 0;
transform: scale(0.95) translateY(10px);
}
100% {
opacity: 1;
transform: scale(1) translateY(0);
}
}
.qrcode-img {
width: 200px;
height: 200px;
border-radius: 16px;
margin-bottom: 24px;
box-shadow: 0 4px 16px rgba(0,0,0,0.15);
background: #fff;
padding: 8px;
transition: transform 0.3s ease;
}
.qrcode-img:active {
transform: scale(0.98);
}
.qrcode-tip {
font-size: 17px;
color: #a790e2;
margin-bottom: 24px;
text-align: center;
font-weight: 500;
line-height: 1.5;
padding: 0 12px;
}
.qrcode-close-btn {
margin-top: 12px;
padding: 12px 36px;
background: linear-gradient(90deg, #8d72d2, #7183f3);
color: #fff;
border: none;
border-radius: 24px;
font-size: 16px;
font-weight: 600;
box-shadow: 0 4px 12px rgba(141, 114, 210, 0.3);
transition: all 0.3s ease;
position: relative;
overflow: hidden;
}
.qrcode-close-btn:active {
transform: scale(0.96);
background: linear-gradient(90deg, #7183f3, #8d72d2);
box-shadow: 0 2px 8px rgba(141, 114, 210, 0.2);
}
.qrcode-close-btn::after {
content: '';
position: absolute;
top: -50%;
left: -50%;
width: 200%;
height: 200%;
background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 70%);
transform: scale(0);
opacity: 0;
transition: transform 0.6s, opacity 0.6s;
}

View File

@@ -28,7 +28,7 @@
"useCompilerPlugins": false,
"minifyWXML": true,
"ignoreUploadUnusedFiles": false,
"condition": false,
"condition": true,
"ignoreDevUnusedFiles": false
},
"condition": {},
@@ -41,5 +41,9 @@
"ignore": [],
"include": []
},
"appid": "wx80e72720be2de560"
"appid": "wx80e72720be2de560",
"projectArchitecture": "multiPlatform",
"simulatorPluginLibVersion": {
"wxext14566970e7e9f62": "3.6.5-29"
}
}

65
project.miniapp.json Normal file
View File

@@ -0,0 +1,65 @@
{
"miniVersion": "v2",
"name": "%name%",
"version": "0.0.1",
"versionCode": 100,
"i18nFilePath": "i18n",
"mini-android": {
"resourcePath": "miniapp/android/nativeResources",
"sdkVersion": "1.6.7",
"toolkitVersion": "0.11.0",
"useExtendedSdk": {
"media": false,
"bluetooth": false,
"network": false,
"scanner": false,
"xweb": false
},
"icons": {
"hdpi": "",
"xhdpi": "",
"xxhdpi": "",
"xxxhdpi": ""
},
"splashscreen": {
"hdpi": "",
"xhdpi": "",
"xxhdpi": ""
},
"enableVConsole": "open",
"privacy": {
"enable": true
}
},
"mini-ios": {
"sdkVersion": "1.6.10",
"toolkitVersion": "0.0.9",
"useExtendedSdk": {
"WeAppOpenFuns": true,
"WeAppNetwork": false,
"WeAppBluetooth": false,
"WeAppMedia": false,
"WeAppLBS": false,
"WeAppOthers": false
},
"enableVConsole": "open",
"icons": {
"mainIcon120": "",
"mainIcon180": "",
"spotlightIcon80": "",
"spotlightIcon120": "",
"settingsIcon58": "",
"settingsIcon87": "",
"notificationIcon40": "",
"notificationIcon60": "",
"appStore1024": ""
},
"splashScreen": {
"customImage": ""
},
"privacy": {
"enable": false
},
"enableOpenUrlNavigate": true
}
}

View File

@@ -3,13 +3,27 @@
"projectname": "wxb5a1857369e5809e",
"setting": {
"compileHotReLoad": true,
"urlCheck": false,
"urlCheck": true,
"preloadBackgroundData": false
},
"libVersion": "development",
"libVersion": "3.8.11",
"condition": {
"miniprogram": {
"list": [
{
"name": "pages/video/video",
"pathName": "pages/video/video",
"query": "url=https%3A%2F%2Ffinder.video.qq.com%2F251%2F20302%2Fstodownload%3Fencfilekey%3DCvvj5Ix3eewK0tHtibORqcsqchXNh0Gf3sJcaYqC2rQCfmornp3whTPnj2l7Vq3ticgwramgKkTz36fGR1JqvG9bE4VgIVBhfxSPwRBWGvmCMtzCFbP5T3d1APsibaubkFK%26token%3DcztXnd9GyrHyDUNS08mucTAAeWm30HgicdEw44AV0iaVpjUkL6HGh3njcLvWYTesTwadriaTA7jBfBolPVfibmcHJEAa6D44kZjUEBqsPcZu9RV1c1lMn1M8mW5yYCZtKoLdaOTyRx9Yh8P0YuegDvdGDBTUskWaibB2O8LYfWD79vkc%26idx%3D1%26bizid%3D1023%26dotrans%3D0%26hy%3DSH%26m%3D%26uzid%3D1&type=weixin",
"launchMode": "default",
"scene": null
},
{
"name": "邀请测试",
"pathName": "pages/index/index",
"query": "uuid=49810",
"launchMode": "default",
"scene": null
},
{
"name": "pages/bot-list/bot-list",
"pathName": "pages/bot-list/bot-list",
@@ -31,13 +45,6 @@
"launchMode": "default",
"scene": null
},
{
"name": "pages/video/video",
"pathName": "pages/video/video",
"query": "url=https%3A%2F%2Ffinder.video.qq.com%2F251%2F20302%2Fstodownload%3Fencfilekey%3DCvvj5Ix3eewK0tHtibORqcsqchXNh0Gf3sJcaYqC2rQCfmornp3whTPnj2l7Vq3ticgwramgKkTz36fGR1JqvG9bE4VgIVBhfxSPwRBWGvmCMtzCFbP5T3d1APsibaubkFK%26token%3DcztXnd9GyrHyDUNS08mucTAAeWm30HgicdEw44AV0iaVpjUkL6HGh3njcLvWYTesTwadriaTA7jBfBolPVfibmcHJEAa6D44kZjUEBqsPcZu9RV1c1lMn1M8mW5yYCZtKoLdaOTyRx9Yh8P0YuegDvdGDBTUskWaibB2O8LYfWD79vkc%26idx%3D1%26bizid%3D1023%26dotrans%3D0%26hy%3DSH%26m%3D%26uzid%3D1&type=weixin",
"launchMode": "default",
"scene": null
},
{
"name": "pages/index/index",
"pathName": "pages/index/index",