deploy: auto commit repo-root changes 2026-07-05 12:33:57
This commit is contained in:
@@ -2,77 +2,34 @@
|
||||
|
||||
namespace app\api\controller;
|
||||
|
||||
use app\common\service\ai\AiService;
|
||||
use app\common\model\match\MatchEvent;
|
||||
use app\common\model\match\MatchHistory;
|
||||
use app\common\model\match\MatchRecent;
|
||||
use app\common\model\article\Article;
|
||||
use app\common\enum\YesNoEnum;
|
||||
use app\common\model\ai\AiUnlock;
|
||||
use app\common\service\ai\AiAnalysisRequestService;
|
||||
|
||||
class AiController extends BaseApiController
|
||||
{
|
||||
public array $notNeedLogin = ['matchPredict', 'articleAnalysis'];
|
||||
public array $notNeedLogin = [];
|
||||
|
||||
/**
|
||||
* AI分析统一入口
|
||||
*/
|
||||
public function analyze()
|
||||
{
|
||||
$type = $this->request->get('type/s', '');
|
||||
$params = $this->request->get();
|
||||
$result = AiAnalysisRequestService::analyze($type, $params, $this->userId);
|
||||
return $this->respondAnalysis($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 赛事AI预测
|
||||
*/
|
||||
public function matchPredict()
|
||||
{
|
||||
$matchId = $this->request->get('match_id/d');
|
||||
if (empty($matchId)) {
|
||||
return $this->fail('参数缺失');
|
||||
}
|
||||
|
||||
$cacheKey = 'ai_match_predict_' . $matchId;
|
||||
$cached = cache($cacheKey);
|
||||
if ($cached) {
|
||||
$cached['from_cache'] = true;
|
||||
return $this->data($cached);
|
||||
}
|
||||
|
||||
$match = MatchEvent::where('id', $matchId)->where('is_show', 1)->findOrEmpty();
|
||||
if ($match->isEmpty()) {
|
||||
return $this->fail('赛事不存在');
|
||||
}
|
||||
$data = $match->toArray();
|
||||
|
||||
$homeTeam = $data['home_team'];
|
||||
$awayTeam = $data['away_team'];
|
||||
|
||||
// 组装分析数据
|
||||
$matchData = [
|
||||
'match_info' => [
|
||||
'home_team' => $homeTeam,
|
||||
'away_team' => $awayTeam,
|
||||
'league' => $data['league_name'] ?? '',
|
||||
'match_time' => date('Y-m-d H:i', $data['match_time'] ?? time()),
|
||||
'status' => $data['status'] ?? 0,
|
||||
],
|
||||
'head_to_head' => MatchHistory::where(function ($query) use ($homeTeam, $awayTeam) {
|
||||
$query->where([['home_team', '=', $homeTeam], ['away_team', '=', $awayTeam]])
|
||||
->whereOr([['home_team', '=', $awayTeam], ['away_team', '=', $homeTeam]]);
|
||||
})->order('match_time desc')->limit(5)->select()->toArray(),
|
||||
'home_recent' => MatchRecent::where('team_name', $homeTeam)
|
||||
->order('match_time desc')->limit(5)->select()->toArray(),
|
||||
'away_recent' => MatchRecent::where('team_name', $awayTeam)
|
||||
->order('match_time desc')->limit(5)->select()->toArray(),
|
||||
];
|
||||
|
||||
$result = AiService::predictMatch($matchId, $matchData, $this->userId);
|
||||
if (!$result['success']) {
|
||||
return $this->fail($result['error'] ?? 'AI分析失败');
|
||||
}
|
||||
|
||||
$responseData = [
|
||||
'analysis' => $result['data'],
|
||||
'from_cache' => false,
|
||||
'match_info' => $matchData['match_info'],
|
||||
];
|
||||
|
||||
cache($cacheKey, $responseData, 6 * 3600);
|
||||
|
||||
return $this->data($responseData);
|
||||
$result = AiAnalysisRequestService::analyzeMatchFull(
|
||||
$this->request->get('match_id/d'),
|
||||
$this->userId
|
||||
);
|
||||
return $this->respondAnalysis($result);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -80,73 +37,12 @@ class AiController extends BaseApiController
|
||||
*/
|
||||
public function matchPredictSection()
|
||||
{
|
||||
$matchId = $this->request->get('match_id/d');
|
||||
$section = $this->request->get('section/s', '');
|
||||
if (empty($matchId) || empty($section)) {
|
||||
return $this->fail('参数缺失');
|
||||
}
|
||||
|
||||
if (!$this->userId) {
|
||||
return $this->fail('请先登录', [], 0, 401);
|
||||
}
|
||||
|
||||
// 解锁检查:只有本人解锁过的才免费,其他人的缓存不算
|
||||
$isUnlocked = AiUnlock::isUnlocked($this->userId, $matchId);
|
||||
if (!$isUnlocked) {
|
||||
if ($section === 'prediction') {
|
||||
$unlockResult = AiUnlock::unlock($this->userId, $matchId);
|
||||
if (!$unlockResult['ok']) {
|
||||
return $this->fail($unlockResult['msg']);
|
||||
}
|
||||
} else {
|
||||
return $this->fail('请先解锁该赛事分析');
|
||||
}
|
||||
}
|
||||
|
||||
$match = MatchEvent::where('id', $matchId)->where('is_show', 1)->findOrEmpty();
|
||||
if ($match->isEmpty()) {
|
||||
return $this->fail('赛事不存在');
|
||||
}
|
||||
$data = $match->toArray();
|
||||
|
||||
$homeTeam = $data['home_team'];
|
||||
$awayTeam = $data['away_team'];
|
||||
|
||||
$matchData = [
|
||||
'match_info' => [
|
||||
'home_team' => $homeTeam,
|
||||
'away_team' => $awayTeam,
|
||||
'league' => $data['league_name'] ?? '',
|
||||
'match_time' => date('Y-m-d H:i', $data['match_time'] ?? time()),
|
||||
'status' => $data['status'] ?? 0,
|
||||
'home_score' => $data['home_score'] ?? 0,
|
||||
'away_score' => $data['away_score'] ?? 0,
|
||||
'home_odds' => $data['home_odds'] ?? 0,
|
||||
'draw_odds' => $data['draw_odds'] ?? 0,
|
||||
'away_odds' => $data['away_odds'] ?? 0,
|
||||
],
|
||||
'head_to_head' => MatchHistory::where(function ($query) use ($homeTeam, $awayTeam) {
|
||||
$query->where([['home_team', '=', $homeTeam], ['away_team', '=', $awayTeam]])
|
||||
->whereOr([['home_team', '=', $awayTeam], ['away_team', '=', $homeTeam]]);
|
||||
})->order('match_time desc')->limit(5)->select()->toArray(),
|
||||
'home_recent' => MatchRecent::where('team_name', $homeTeam)
|
||||
->order('match_time desc')->limit(5)->select()->toArray(),
|
||||
'away_recent' => MatchRecent::where('team_name', $awayTeam)
|
||||
->order('match_time desc')->limit(5)->select()->toArray(),
|
||||
];
|
||||
|
||||
$result = AiService::predictMatchSection($matchId, $section, $matchData, $this->userId);
|
||||
if (!$result['success']) {
|
||||
return $this->fail($result['error'] ?? 'AI分析失败');
|
||||
}
|
||||
|
||||
return $this->data([
|
||||
'section' => $section,
|
||||
'data' => $result['data'],
|
||||
'from_cache' => $result['from_cache'] ?? false,
|
||||
'match_info' => $matchData['match_info'],
|
||||
'remain_count' => AiUnlock::getRemainCount($this->userId),
|
||||
]);
|
||||
$result = AiAnalysisRequestService::analyzeMatchSection(
|
||||
$this->request->get('match_id/d'),
|
||||
$this->request->get('section/s', ''),
|
||||
$this->userId
|
||||
);
|
||||
return $this->respondAnalysis($result);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -154,25 +50,11 @@ class AiController extends BaseApiController
|
||||
*/
|
||||
public function articleAnalysis()
|
||||
{
|
||||
$articleId = $this->request->get('article_id/d');
|
||||
if (empty($articleId)) {
|
||||
return $this->fail('参数缺失');
|
||||
}
|
||||
|
||||
$article = Article::where(['id' => $articleId, 'is_show' => YesNoEnum::YES])->findOrEmpty();
|
||||
if ($article->isEmpty()) {
|
||||
return $this->fail('文章不存在');
|
||||
}
|
||||
|
||||
$articleData = $article->toArray();
|
||||
$result = AiService::analyzeArticle($articleId, $articleData, $this->userId);
|
||||
if (!$result['success']) {
|
||||
return $this->fail($result['error'] ?? 'AI分析失败');
|
||||
}
|
||||
return $this->data([
|
||||
'analysis' => $result['data'],
|
||||
'from_cache' => $result['from_cache'] ?? false,
|
||||
]);
|
||||
$result = AiAnalysisRequestService::analyzeArticle(
|
||||
$this->request->get('article_id/d'),
|
||||
$this->userId
|
||||
);
|
||||
return $this->respondAnalysis($result);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -180,28 +62,11 @@ class AiController extends BaseApiController
|
||||
*/
|
||||
public function userCredibility()
|
||||
{
|
||||
$targetUserId = $this->request->get('user_id/d');
|
||||
if (empty($targetUserId)) {
|
||||
return $this->fail('参数缺失');
|
||||
}
|
||||
|
||||
// 组装用户数据(简化版,后续可扩展)
|
||||
$userData = [
|
||||
'user_id' => $targetUserId,
|
||||
'register_days' => 30,
|
||||
'post_count' => 0,
|
||||
'comment_count' => 0,
|
||||
'like_received' => 0,
|
||||
];
|
||||
|
||||
$result = AiService::analyzeCredibility($targetUserId, $userData, $this->userId);
|
||||
if (!$result['success']) {
|
||||
return $this->fail($result['error'] ?? 'AI分析失败');
|
||||
}
|
||||
return $this->data([
|
||||
'analysis' => $result['data'],
|
||||
'from_cache' => $result['from_cache'] ?? false,
|
||||
]);
|
||||
$result = AiAnalysisRequestService::analyzeUserCredibility(
|
||||
$this->request->get('user_id/d'),
|
||||
$this->userId
|
||||
);
|
||||
return $this->respondAnalysis($result);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -209,23 +74,12 @@ class AiController extends BaseApiController
|
||||
*/
|
||||
public function lotteryAnalysis()
|
||||
{
|
||||
$type = $this->request->get('type', 'ssq');
|
||||
|
||||
// 简化版彩票数据
|
||||
$lotteryData = [
|
||||
'lottery_type' => $type,
|
||||
'recent_draws' => [],
|
||||
'description' => $type === 'ssq' ? '双色球' : '大乐透',
|
||||
];
|
||||
|
||||
$result = AiService::analyzeLottery($lotteryData, $this->userId);
|
||||
if (!$result['success']) {
|
||||
return $this->fail($result['error'] ?? 'AI分析失败');
|
||||
$params = $this->request->get();
|
||||
if (empty($params['code']) && !empty($params['type'])) {
|
||||
$params['code'] = $params['type'];
|
||||
}
|
||||
return $this->data([
|
||||
'analysis' => $result['data'],
|
||||
'from_cache' => $result['from_cache'] ?? false,
|
||||
]);
|
||||
$result = AiAnalysisRequestService::analyze('lottery', $params, $this->userId);
|
||||
return $this->respondAnalysis($result);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -244,4 +98,16 @@ class AiController extends BaseApiController
|
||||
'remain_count' => $remain,
|
||||
]);
|
||||
}
|
||||
|
||||
private function respondAnalysis(array $result)
|
||||
{
|
||||
if (empty($result['success'])) {
|
||||
return $this->fail($result['error'] ?? 'AI分析失败', [
|
||||
'remain_count' => $result['remain_count'] ?? null,
|
||||
]);
|
||||
}
|
||||
|
||||
unset($result['success'], $result['error'], $result['code']);
|
||||
return $this->data($result);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ use app\common\model\user\User;
|
||||
use app\common\model\ai\AiAnalysis;
|
||||
use app\common\enum\user\AccountLogEnum;
|
||||
use app\common\logic\AccountLogLogic;
|
||||
use app\common\service\ai\AiAnalysisRequestService;
|
||||
use app\common\service\ai\AiService;
|
||||
use app\common\service\ai\KbSyncService;
|
||||
use app\common\service\chat\PrivateChatService;
|
||||
@@ -585,56 +586,20 @@ class CommunityController extends BaseApiController
|
||||
|
||||
public function aiAnalysis()
|
||||
{
|
||||
try {
|
||||
$postId = $this->request->get('post_id/d', 0);
|
||||
if ($postId <= 0) {
|
||||
return $this->fail('参数缺失');
|
||||
}
|
||||
$result = AiAnalysisRequestService::analyzePost(
|
||||
$this->request->get('post_id/d', 0),
|
||||
$this->userId,
|
||||
$this->request->get('force/d', 0) === 1
|
||||
);
|
||||
|
||||
$post = CommunityPost::where('id', $postId)->where('status', 1)->findOrEmpty();
|
||||
if ($post->isEmpty()) {
|
||||
return $this->fail('帖子不存在');
|
||||
}
|
||||
|
||||
$data = $post->toArray();
|
||||
$ext = is_array($data['ext'] ?? null) ? $data['ext'] : (json_decode((string) ($data['ext'] ?? ''), true) ?: []);
|
||||
$tags = $this->getPostTags($postId);
|
||||
$isTrumpPost = $this->isTrumpPost($tags);
|
||||
$isLiuhePost = $this->isLiuhePost($tags, $ext);
|
||||
if ($isTrumpPost) {
|
||||
return $this->fail('特朗普帖子仅支持翻译');
|
||||
}
|
||||
if (!$isLiuhePost) {
|
||||
return $this->fail('该帖子类型无需AI分析');
|
||||
}
|
||||
|
||||
$analysis = $this->ensureLiuheAnalysisContent($post, $ext);
|
||||
if (!$analysis['success']) {
|
||||
return $this->fail($analysis['error'] ?? '图片分析失败');
|
||||
}
|
||||
$ext = $analysis['ext'];
|
||||
$data['tags'] = array_values($tags);
|
||||
$data['ext'] = $ext;
|
||||
if (!empty($ext['translated_content'])) {
|
||||
$data['translated_content'] = (string) $ext['translated_content'];
|
||||
}
|
||||
if (!empty($ext['lottery_analysis_content'])) {
|
||||
$data['lottery_analysis_content'] = (string) $ext['lottery_analysis_content'];
|
||||
}
|
||||
|
||||
$force = $this->request->get('force/d', 0) === 1;
|
||||
$result = AiService::analyzePost($postId, $data, $this->userId, true, $force);
|
||||
if (!$result['success']) {
|
||||
return $this->fail($result['error'] ?? 'AI分析失败');
|
||||
}
|
||||
|
||||
return $this->data([
|
||||
'analysis' => $result['data'],
|
||||
'from_cache' => $result['from_cache'] ?? false,
|
||||
if (empty($result['success'])) {
|
||||
return $this->fail($result['error'] ?? 'AI分析失败', [
|
||||
'remain_count' => $result['remain_count'] ?? null,
|
||||
]);
|
||||
} catch (\Throwable $e) {
|
||||
return $this->fail('AI分析异常: ' . $e->getMessage());
|
||||
}
|
||||
|
||||
unset($result['success'], $result['error'], $result['code']);
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
public function aiAnalysisResult()
|
||||
|
||||
@@ -10,11 +10,11 @@ use app\common\model\lottery\LotteryDrawResult;
|
||||
use app\common\model\lottery\LotteryAiAnalysis;
|
||||
use app\common\model\lottery\LotteryNumberMapping;
|
||||
use app\common\model\lottery\LotteryRegion;
|
||||
use app\common\service\ai\AiService;
|
||||
use app\common\service\ai\AiAnalysisRequestService;
|
||||
|
||||
class LotteryController extends BaseApiController
|
||||
{
|
||||
public array $notNeedLogin = ['categoryList', 'regionList', 'drawList', 'drawDetail', 'latestDraw', 'aiPredict', 'gameList', 'latestDrawResult', 'drawResultList', 'aiHistory', 'aiHotCold', 'aiTrend', 'aiStats', 'aiColorZodiac', 'aiAnalysisHistory'];
|
||||
public array $notNeedLogin = ['categoryList', 'regionList', 'drawList', 'drawDetail', 'latestDraw', 'gameList', 'latestDrawResult', 'drawResultList', 'aiHistory', 'aiAnalysisHistory'];
|
||||
|
||||
/**
|
||||
* 彩种游戏列表(一级分类 + 二级彩种)
|
||||
@@ -341,87 +341,7 @@ class LotteryController extends BaseApiController
|
||||
*/
|
||||
public function aiPredict()
|
||||
{
|
||||
$categoryId = $this->request->get('category_id/d', 0);
|
||||
$code = $this->request->get('code', '');
|
||||
|
||||
// 支持两种查找方式:category_id(旧表)或 code(新表)
|
||||
if (!empty($code)) {
|
||||
$game = LotteryGame::where('code', $code)->findOrEmpty();
|
||||
if ($game->isEmpty()) {
|
||||
return $this->fail('彩种不存在');
|
||||
}
|
||||
|
||||
$recentDraws = LotteryDrawResult::where('code', $code)
|
||||
->where('draw_code', '<>', '')
|
||||
->order('draw_time desc, issue desc')
|
||||
->limit(30)
|
||||
->field('issue,draw_time,draw_code')
|
||||
->select()
|
||||
->toArray();
|
||||
|
||||
foreach ($recentDraws as &$d) {
|
||||
$d['numbers'] = $d['draw_code'] ? explode(',', $d['draw_code']) : [];
|
||||
}
|
||||
|
||||
$lotteryData = [
|
||||
'lottery_type' => $code,
|
||||
'lottery_name' => $game['name'],
|
||||
'draw_rule' => $game['template'] ?? '',
|
||||
'recent_draws' => $recentDraws,
|
||||
];
|
||||
|
||||
$result = AiService::analyzeLottery($lotteryData, $this->userId);
|
||||
if (!$result['success']) {
|
||||
return $this->fail($result['error'] ?? 'AI分析失败');
|
||||
}
|
||||
return $this->data([
|
||||
'analysis' => $result['data'],
|
||||
'from_cache' => $result['from_cache'] ?? false,
|
||||
'category_name' => $game['name'],
|
||||
]);
|
||||
}
|
||||
|
||||
if (empty($categoryId)) {
|
||||
return $this->fail('参数缺失');
|
||||
}
|
||||
|
||||
$category = LotteryCategory::where('id', $categoryId)->findOrEmpty();
|
||||
if ($category->isEmpty()) {
|
||||
return $this->fail('彩种不存在');
|
||||
}
|
||||
|
||||
// 获取最近30期已开奖数据
|
||||
$recentDraws = LotteryDraw::where('category_id', $categoryId)
|
||||
->where('status', 1)
|
||||
->where('is_show', 1)
|
||||
->order('draw_date desc, period desc')
|
||||
->limit(30)
|
||||
->field('period,draw_date,numbers,special_number,zodiac,color')
|
||||
->select()
|
||||
->toArray();
|
||||
|
||||
foreach ($recentDraws as &$d) {
|
||||
$d['numbers'] = is_string($d['numbers']) ? json_decode($d['numbers'], true) : $d['numbers'];
|
||||
$d['zodiac'] = is_string($d['zodiac']) ? json_decode($d['zodiac'], true) : $d['zodiac'];
|
||||
$d['color'] = is_string($d['color']) ? json_decode($d['color'], true) : $d['color'];
|
||||
}
|
||||
|
||||
$lotteryData = [
|
||||
'lottery_type' => $category['code'],
|
||||
'lottery_name' => $category['name'],
|
||||
'draw_rule' => $category['draw_rule'],
|
||||
'recent_draws' => $recentDraws,
|
||||
];
|
||||
|
||||
$result = AiService::analyzeLottery($lotteryData, $this->userId);
|
||||
if (!$result['success']) {
|
||||
return $this->fail($result['error'] ?? 'AI分析失败');
|
||||
}
|
||||
return $this->data([
|
||||
'analysis' => $result['data'],
|
||||
'from_cache' => $result['from_cache'] ?? false,
|
||||
'category_name' => $category['name'],
|
||||
]);
|
||||
return $this->respondAnalysis(AiAnalysisRequestService::analyzeLotteryOverview($this->request->get(), $this->userId));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -465,29 +385,7 @@ class LotteryController extends BaseApiController
|
||||
*/
|
||||
public function aiHotCold()
|
||||
{
|
||||
$code = $this->request->get('code', '');
|
||||
if (empty($code)) {
|
||||
return $this->fail('参数缺失');
|
||||
}
|
||||
|
||||
$game = LotteryGame::where('code', $code)->findOrEmpty();
|
||||
if ($game->isEmpty()) {
|
||||
return $this->fail('彩种不存在');
|
||||
}
|
||||
|
||||
$recentDraws = $this->getRecentDrawCodes($code, 30);
|
||||
$lotteryData = [
|
||||
'lottery_type' => $code,
|
||||
'lottery_name' => $game['name'],
|
||||
'draw_rule' => $game['template'] ?? '',
|
||||
'recent_draws' => $recentDraws,
|
||||
];
|
||||
|
||||
$result = AiService::analyzeLotteryModule($lotteryData, 'hot_cold', $this->userId);
|
||||
if (!$result['success']) {
|
||||
return $this->fail($result['error'] ?? 'AI分析失败');
|
||||
}
|
||||
return $this->data($result['data']);
|
||||
return $this->respondLotteryModule('hot_cold');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -495,29 +393,7 @@ class LotteryController extends BaseApiController
|
||||
*/
|
||||
public function aiTrend()
|
||||
{
|
||||
$code = $this->request->get('code', '');
|
||||
if (empty($code)) {
|
||||
return $this->fail('参数缺失');
|
||||
}
|
||||
|
||||
$game = LotteryGame::where('code', $code)->findOrEmpty();
|
||||
if ($game->isEmpty()) {
|
||||
return $this->fail('彩种不存在');
|
||||
}
|
||||
|
||||
$recentDraws = $this->getRecentDrawCodes($code, 30);
|
||||
$lotteryData = [
|
||||
'lottery_type' => $code,
|
||||
'lottery_name' => $game['name'],
|
||||
'draw_rule' => $game['template'] ?? '',
|
||||
'recent_draws' => $recentDraws,
|
||||
];
|
||||
|
||||
$result = AiService::analyzeLotteryModule($lotteryData, 'trend', $this->userId);
|
||||
if (!$result['success']) {
|
||||
return $this->fail($result['error'] ?? 'AI分析失败');
|
||||
}
|
||||
return $this->data($result['data']);
|
||||
return $this->respondLotteryModule('trend');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -525,29 +401,7 @@ class LotteryController extends BaseApiController
|
||||
*/
|
||||
public function aiStats()
|
||||
{
|
||||
$code = $this->request->get('code', '');
|
||||
if (empty($code)) {
|
||||
return $this->fail('参数缺失');
|
||||
}
|
||||
|
||||
$game = LotteryGame::where('code', $code)->findOrEmpty();
|
||||
if ($game->isEmpty()) {
|
||||
return $this->fail('彩种不存在');
|
||||
}
|
||||
|
||||
$recentDraws = $this->getRecentDrawCodes($code, 30);
|
||||
$lotteryData = [
|
||||
'lottery_type' => $code,
|
||||
'lottery_name' => $game['name'],
|
||||
'draw_rule' => $game['template'] ?? '',
|
||||
'recent_draws' => $recentDraws,
|
||||
];
|
||||
|
||||
$result = AiService::analyzeLotteryModule($lotteryData, 'stats', $this->userId);
|
||||
if (!$result['success']) {
|
||||
return $this->fail($result['error'] ?? 'AI分析失败');
|
||||
}
|
||||
return $this->data($result['data']);
|
||||
return $this->respondLotteryModule('stats');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -555,42 +409,7 @@ class LotteryController extends BaseApiController
|
||||
*/
|
||||
public function aiColorZodiac()
|
||||
{
|
||||
$code = $this->request->get('code', '');
|
||||
if (empty($code)) {
|
||||
return $this->fail('参数缺失');
|
||||
}
|
||||
|
||||
$game = LotteryGame::where('code', $code)->findOrEmpty();
|
||||
if ($game->isEmpty()) {
|
||||
return $this->fail('彩种不存在');
|
||||
}
|
||||
|
||||
if (($game['template'] ?? '') !== 'HK6') {
|
||||
return $this->fail('该彩种不支持波色生肖分析');
|
||||
}
|
||||
|
||||
$recentDraws = $this->getRecentDrawCodes($code, 30);
|
||||
|
||||
$year = (int) date('Y');
|
||||
$colorMap = LotteryNumberMapping::getMapByType($year, LotteryNumberMapping::TYPE_COLOR);
|
||||
$zodiacMap = LotteryNumberMapping::getMapByType($year, LotteryNumberMapping::TYPE_ZODIAC);
|
||||
|
||||
$lotteryData = [
|
||||
'lottery_type' => $code,
|
||||
'lottery_name' => $game['name'],
|
||||
'draw_rule' => $game['template'] ?? '',
|
||||
'recent_draws' => $recentDraws,
|
||||
'number_mapping' => [
|
||||
'color' => $colorMap,
|
||||
'zodiac' => $zodiacMap,
|
||||
],
|
||||
];
|
||||
|
||||
$result = AiService::analyzeLotteryModule($lotteryData, 'color_zodiac', $this->userId);
|
||||
if (!$result['success']) {
|
||||
return $this->fail($result['error'] ?? 'AI分析失败');
|
||||
}
|
||||
return $this->data($result['data']);
|
||||
return $this->respondLotteryModule('color_zodiac');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -638,4 +457,36 @@ class LotteryController extends BaseApiController
|
||||
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
private function respondLotteryModule(string $module)
|
||||
{
|
||||
$result = AiAnalysisRequestService::analyzeLotteryModule(
|
||||
$this->request->get('code', ''),
|
||||
$module,
|
||||
$this->userId
|
||||
);
|
||||
if (empty($result['success'])) {
|
||||
return $this->fail($result['error'] ?? 'AI分析失败', [
|
||||
'remain_count' => $result['remain_count'] ?? null,
|
||||
]);
|
||||
}
|
||||
|
||||
$data = is_array($result['data'] ?? null) ? $result['data'] : [];
|
||||
$data['remain_count'] = $result['remain_count'] ?? 0;
|
||||
$data['unlocked'] = $result['unlocked'] ?? true;
|
||||
$data['charged'] = $result['charged'] ?? false;
|
||||
return $this->data($data);
|
||||
}
|
||||
|
||||
private function respondAnalysis(array $result)
|
||||
{
|
||||
if (empty($result['success'])) {
|
||||
return $this->fail($result['error'] ?? 'AI分析失败', [
|
||||
'remain_count' => $result['remain_count'] ?? null,
|
||||
]);
|
||||
}
|
||||
|
||||
unset($result['success'], $result['error'], $result['code']);
|
||||
return $this->data($result);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace app\common\model\ai;
|
||||
|
||||
use app\common\model\BaseModel;
|
||||
|
||||
class AiQuotaUnlock extends BaseModel
|
||||
{
|
||||
}
|
||||
@@ -3,7 +3,6 @@
|
||||
namespace app\common\model\ai;
|
||||
|
||||
use app\common\model\BaseModel;
|
||||
use app\common\model\user\User;
|
||||
use app\common\service\ai\AiQuotaService;
|
||||
|
||||
class AiUnlock extends BaseModel
|
||||
@@ -13,7 +12,9 @@ class AiUnlock extends BaseModel
|
||||
*/
|
||||
public static function isUnlocked(int $userId, int $matchId): bool
|
||||
{
|
||||
return self::where('user_id', $userId)->where('match_id', $matchId)->count() > 0;
|
||||
$analysisKey = AiQuotaService::makeKey(AiQuotaService::TYPE_MATCH, $matchId);
|
||||
return AiQuotaService::hasUnlocked($userId, $analysisKey)
|
||||
|| self::where('user_id', $userId)->where('match_id', $matchId)->count() > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -22,42 +23,20 @@ class AiUnlock extends BaseModel
|
||||
*/
|
||||
public static function unlock(int $userId, int $matchId): array
|
||||
{
|
||||
// 已解锁则直接返回
|
||||
if (self::isUnlocked($userId, $matchId)) {
|
||||
return ['ok' => true, 'msg' => '已解锁'];
|
||||
}
|
||||
|
||||
// 检查今日剩余次数
|
||||
$user = User::findOrEmpty($userId);
|
||||
if ($user->isEmpty()) {
|
||||
return ['ok' => false, 'msg' => '用户不存在'];
|
||||
}
|
||||
|
||||
// VIP用户不限次数
|
||||
if (AiQuotaService::isVip($user)) {
|
||||
$analysisKey = AiQuotaService::makeKey(AiQuotaService::TYPE_MATCH, $matchId);
|
||||
$result = AiQuotaService::unlock($userId, AiQuotaService::TYPE_MATCH, $analysisKey, $matchId);
|
||||
if (!empty($result['ok']) && self::where('user_id', $userId)->where('match_id', $matchId)->count() <= 0) {
|
||||
self::create([
|
||||
'user_id' => $userId,
|
||||
'match_id' => $matchId,
|
||||
]);
|
||||
return ['ok' => true, 'msg' => 'VIP解锁'];
|
||||
}
|
||||
|
||||
$freeCount = AiQuotaService::resetDailyIfNeeded($user);
|
||||
|
||||
if ($freeCount <= 0) {
|
||||
return ['ok' => false, 'msg' => '今日免费次数已用完,升级VIP可无限使用'];
|
||||
}
|
||||
|
||||
// 扣次数 + 写解锁记录
|
||||
$user->ai_free_count = $freeCount - 1;
|
||||
$user->save();
|
||||
|
||||
self::create([
|
||||
'user_id' => $userId,
|
||||
'match_id' => $matchId,
|
||||
]);
|
||||
|
||||
return ['ok' => true, 'msg' => '解锁成功', 'remain' => $user->ai_free_count];
|
||||
return [
|
||||
'ok' => (bool) ($result['ok'] ?? false),
|
||||
'msg' => (string) ($result['msg'] ?? ''),
|
||||
'remain' => $result['remain'] ?? AiQuotaService::getRemainCount($userId),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,759 @@
|
||||
<?php
|
||||
|
||||
namespace app\common\service\ai;
|
||||
|
||||
use app\common\enum\YesNoEnum;
|
||||
use app\common\model\article\Article;
|
||||
use app\common\model\community\CommunityPost;
|
||||
use app\common\model\community\CommunityTag;
|
||||
use app\common\model\lottery\LotteryCategory;
|
||||
use app\common\model\lottery\LotteryDraw;
|
||||
use app\common\model\lottery\LotteryDrawResult;
|
||||
use app\common\model\lottery\LotteryGame;
|
||||
use app\common\model\lottery\LotteryNumberMapping;
|
||||
use app\common\model\match\MatchEvent;
|
||||
use app\common\model\match\MatchHistory;
|
||||
use app\common\model\match\MatchRecent;
|
||||
use app\common\service\FileService;
|
||||
use think\facade\Db;
|
||||
|
||||
class AiAnalysisRequestService
|
||||
{
|
||||
private const LIUHE_TAGS = ['旧澳六合', '新澳六合'];
|
||||
private const MATCH_SECTIONS = ['prediction', 'factors', 'odds', 'summary'];
|
||||
private const LOTTERY_MODULES = ['hot_cold', 'trend', 'stats', 'color_zodiac'];
|
||||
|
||||
public static function analyze(string $type, array $params, int $userId): array
|
||||
{
|
||||
$type = strtolower(str_replace('-', '_', trim($type)));
|
||||
|
||||
return match ($type) {
|
||||
'match', 'match_section' => self::analyzeMatchSection(
|
||||
(int) ($params['match_id'] ?? 0),
|
||||
(string) ($params['section'] ?? 'prediction'),
|
||||
$userId
|
||||
),
|
||||
'match_full', 'match_predict' => self::analyzeMatchFull((int) ($params['match_id'] ?? 0), $userId),
|
||||
'article' => self::analyzeArticle((int) ($params['article_id'] ?? 0), $userId),
|
||||
'post' => self::analyzePost((int) ($params['post_id'] ?? 0), $userId, (int) ($params['force'] ?? 0) === 1),
|
||||
'lottery' => self::analyzeLotteryOverview($params, $userId),
|
||||
'lottery_module' => self::analyzeLotteryModule(
|
||||
(string) ($params['code'] ?? ''),
|
||||
(string) ($params['module'] ?? ''),
|
||||
$userId
|
||||
),
|
||||
'credibility', 'user_credibility' => self::analyzeUserCredibility((int) ($params['user_id'] ?? 0), $userId),
|
||||
default => self::fail('不支持的AI分析类型'),
|
||||
};
|
||||
}
|
||||
|
||||
public static function analyzeMatchFull(int $matchId, int $userId): array
|
||||
{
|
||||
if ($matchId <= 0) {
|
||||
return self::fail('参数缺失');
|
||||
}
|
||||
|
||||
$matchData = self::buildMatchData($matchId, false);
|
||||
if (empty($matchData['success'])) {
|
||||
return $matchData;
|
||||
}
|
||||
|
||||
$quota = self::ensureQuota($userId, AiQuotaService::TYPE_MATCH, $matchId, $matchId);
|
||||
if (empty($quota['success'])) {
|
||||
return $quota;
|
||||
}
|
||||
|
||||
$result = AiService::predictMatch($matchId, $matchData['data'], $userId);
|
||||
if (!$result['success']) {
|
||||
return self::fail($result['error'] ?? 'AI分析失败', 0, $quota['quota']);
|
||||
}
|
||||
|
||||
return self::withQuota([
|
||||
'analysis' => $result['data'],
|
||||
'from_cache' => $result['from_cache'] ?? false,
|
||||
'match_info' => $matchData['data']['match_info'],
|
||||
], $quota['quota']);
|
||||
}
|
||||
|
||||
public static function analyzeMatchSection(int $matchId, string $section, int $userId): array
|
||||
{
|
||||
$section = trim($section);
|
||||
if ($matchId <= 0 || $section === '') {
|
||||
return self::fail('参数缺失');
|
||||
}
|
||||
if (!in_array($section, self::MATCH_SECTIONS, true)) {
|
||||
return self::fail('无效的分析模块');
|
||||
}
|
||||
|
||||
$matchData = self::buildMatchData($matchId, true);
|
||||
if (empty($matchData['success'])) {
|
||||
return $matchData;
|
||||
}
|
||||
|
||||
$quota = self::ensureQuota($userId, AiQuotaService::TYPE_MATCH, $matchId, $matchId);
|
||||
if (empty($quota['success'])) {
|
||||
return $quota;
|
||||
}
|
||||
|
||||
$result = AiService::predictMatchSection($matchId, $section, $matchData['data'], $userId);
|
||||
if (!$result['success']) {
|
||||
return self::fail($result['error'] ?? 'AI分析失败', 0, $quota['quota']);
|
||||
}
|
||||
|
||||
return self::withQuota([
|
||||
'section' => $section,
|
||||
'data' => $result['data'],
|
||||
'from_cache' => $result['from_cache'] ?? false,
|
||||
'match_info' => $matchData['data']['match_info'],
|
||||
], $quota['quota']);
|
||||
}
|
||||
|
||||
public static function analyzeArticle(int $articleId, int $userId): array
|
||||
{
|
||||
if ($articleId <= 0) {
|
||||
return self::fail('参数缺失');
|
||||
}
|
||||
|
||||
$article = Article::where(['id' => $articleId, 'is_show' => YesNoEnum::YES])->findOrEmpty();
|
||||
if ($article->isEmpty()) {
|
||||
return self::fail('文章不存在');
|
||||
}
|
||||
|
||||
$quota = self::ensureQuota($userId, AiQuotaService::TYPE_ARTICLE, $articleId, $articleId);
|
||||
if (empty($quota['success'])) {
|
||||
return $quota;
|
||||
}
|
||||
|
||||
$result = AiService::analyzeArticle($articleId, $article->toArray(), $userId);
|
||||
if (!$result['success']) {
|
||||
return self::fail($result['error'] ?? 'AI分析失败', 0, $quota['quota']);
|
||||
}
|
||||
|
||||
return self::withQuota([
|
||||
'analysis' => $result['data'],
|
||||
'from_cache' => $result['from_cache'] ?? false,
|
||||
], $quota['quota']);
|
||||
}
|
||||
|
||||
public static function analyzeUserCredibility(int $targetUserId, int $userId): array
|
||||
{
|
||||
if ($targetUserId <= 0) {
|
||||
return self::fail('参数缺失');
|
||||
}
|
||||
|
||||
$quota = self::ensureQuota($userId, AiQuotaService::TYPE_CREDIBILITY, $targetUserId, $targetUserId);
|
||||
if (empty($quota['success'])) {
|
||||
return $quota;
|
||||
}
|
||||
|
||||
$userData = [
|
||||
'user_id' => $targetUserId,
|
||||
'register_days' => 30,
|
||||
'post_count' => 0,
|
||||
'comment_count' => 0,
|
||||
'like_received' => 0,
|
||||
];
|
||||
|
||||
$result = AiService::analyzeCredibility($targetUserId, $userData, $userId);
|
||||
if (!$result['success']) {
|
||||
return self::fail($result['error'] ?? 'AI分析失败', 0, $quota['quota']);
|
||||
}
|
||||
|
||||
return self::withQuota([
|
||||
'analysis' => $result['data'],
|
||||
'from_cache' => $result['from_cache'] ?? false,
|
||||
], $quota['quota']);
|
||||
}
|
||||
|
||||
public static function analyzePost(int $postId, int $userId, bool $force = false): array
|
||||
{
|
||||
if ($postId <= 0) {
|
||||
return self::fail('参数缺失');
|
||||
}
|
||||
|
||||
try {
|
||||
$post = CommunityPost::where('id', $postId)->where('status', 1)->findOrEmpty();
|
||||
if ($post->isEmpty()) {
|
||||
return self::fail('帖子不存在');
|
||||
}
|
||||
|
||||
$data = $post->toArray();
|
||||
$ext = is_array($data['ext'] ?? null) ? $data['ext'] : (json_decode((string) ($data['ext'] ?? ''), true) ?: []);
|
||||
$tags = self::getPostTags($postId);
|
||||
if (self::isTrumpPost($tags)) {
|
||||
return self::fail('特朗普帖子仅支持翻译');
|
||||
}
|
||||
if (!self::isLiuhePost($tags, $ext)) {
|
||||
return self::fail('该帖子类型无需AI分析');
|
||||
}
|
||||
|
||||
$quota = self::ensureQuota($userId, AiQuotaService::TYPE_POST, $postId, $postId);
|
||||
if (empty($quota['success'])) {
|
||||
return $quota;
|
||||
}
|
||||
|
||||
$analysis = self::ensureLiuheAnalysisContent($post, $ext);
|
||||
if (!$analysis['success']) {
|
||||
return self::fail($analysis['error'] ?? '图片分析失败', 0, $quota['quota']);
|
||||
}
|
||||
|
||||
$ext = $analysis['ext'];
|
||||
$data['tags'] = array_values($tags);
|
||||
$data['ext'] = $ext;
|
||||
if (!empty($ext['translated_content'])) {
|
||||
$data['translated_content'] = (string) $ext['translated_content'];
|
||||
}
|
||||
if (!empty($ext['lottery_analysis_content'])) {
|
||||
$data['lottery_analysis_content'] = (string) $ext['lottery_analysis_content'];
|
||||
}
|
||||
|
||||
$result = AiService::analyzePost($postId, $data, $userId, true, $force);
|
||||
if (!$result['success']) {
|
||||
return self::fail($result['error'] ?? 'AI分析失败', 0, $quota['quota']);
|
||||
}
|
||||
|
||||
return self::withQuota([
|
||||
'analysis' => $result['data'],
|
||||
'from_cache' => $result['from_cache'] ?? false,
|
||||
], $quota['quota']);
|
||||
} catch (\Throwable $e) {
|
||||
return self::fail('AI分析异常: ' . $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public static function analyzeLotteryOverview(array $params, int $userId): array
|
||||
{
|
||||
$prepared = self::buildLotteryOverviewData($params);
|
||||
if (empty($prepared['success'])) {
|
||||
return $prepared;
|
||||
}
|
||||
|
||||
$quota = self::ensureQuota(
|
||||
$userId,
|
||||
AiQuotaService::TYPE_LOTTERY,
|
||||
self::lotteryQuotaRef($prepared['code'], $prepared['latest_issue']),
|
||||
self::crcRefId($prepared['code'] . ':' . $prepared['latest_issue'])
|
||||
);
|
||||
if (empty($quota['success'])) {
|
||||
return $quota;
|
||||
}
|
||||
|
||||
$result = AiService::analyzeLottery($prepared['lottery_data'], $userId);
|
||||
if (!$result['success']) {
|
||||
return self::fail($result['error'] ?? 'AI分析失败', 0, $quota['quota']);
|
||||
}
|
||||
|
||||
return self::withQuota([
|
||||
'analysis' => $result['data'],
|
||||
'from_cache' => $result['from_cache'] ?? false,
|
||||
'category_name' => $prepared['category_name'],
|
||||
], $quota['quota']);
|
||||
}
|
||||
|
||||
public static function analyzeLotteryModule(string $code, string $module, int $userId): array
|
||||
{
|
||||
$code = trim($code);
|
||||
$module = trim($module);
|
||||
if ($code === '' || $module === '') {
|
||||
return self::fail('参数缺失');
|
||||
}
|
||||
if (!in_array($module, self::LOTTERY_MODULES, true)) {
|
||||
return self::fail('无效的分析模块');
|
||||
}
|
||||
|
||||
$prepared = self::buildLotteryModuleData($code, $module);
|
||||
if (empty($prepared['success'])) {
|
||||
return $prepared;
|
||||
}
|
||||
|
||||
$quota = self::ensureQuota(
|
||||
$userId,
|
||||
AiQuotaService::TYPE_LOTTERY,
|
||||
self::lotteryQuotaRef($code, $prepared['latest_issue']),
|
||||
self::crcRefId($code . ':' . $prepared['latest_issue'])
|
||||
);
|
||||
if (empty($quota['success'])) {
|
||||
return $quota;
|
||||
}
|
||||
|
||||
$result = AiService::analyzeLotteryModule($prepared['lottery_data'], $module, $userId);
|
||||
if (!$result['success']) {
|
||||
return self::fail($result['error'] ?? 'AI分析失败', 0, $quota['quota']);
|
||||
}
|
||||
|
||||
return self::withQuota([
|
||||
'module' => $module,
|
||||
'data' => $result['data'],
|
||||
'from_cache' => $result['from_cache'] ?? false,
|
||||
], $quota['quota']);
|
||||
}
|
||||
|
||||
private static function buildMatchData(int $matchId, bool $includeOdds): array
|
||||
{
|
||||
$match = MatchEvent::where('id', $matchId)->where('is_show', 1)->findOrEmpty();
|
||||
if ($match->isEmpty()) {
|
||||
return self::fail('赛事不存在');
|
||||
}
|
||||
|
||||
$data = $match->toArray();
|
||||
$homeTeam = $data['home_team'];
|
||||
$awayTeam = $data['away_team'];
|
||||
$matchInfo = [
|
||||
'home_team' => $homeTeam,
|
||||
'away_team' => $awayTeam,
|
||||
'league' => $data['league_name'] ?? '',
|
||||
'match_time' => date('Y-m-d H:i', $data['match_time'] ?? time()),
|
||||
'status' => $data['status'] ?? 0,
|
||||
];
|
||||
|
||||
if ($includeOdds) {
|
||||
$matchInfo += [
|
||||
'home_score' => $data['home_score'] ?? 0,
|
||||
'away_score' => $data['away_score'] ?? 0,
|
||||
'home_odds' => $data['home_odds'] ?? 0,
|
||||
'draw_odds' => $data['draw_odds'] ?? 0,
|
||||
'away_odds' => $data['away_odds'] ?? 0,
|
||||
];
|
||||
}
|
||||
|
||||
return [
|
||||
'success' => true,
|
||||
'data' => [
|
||||
'match_info' => $matchInfo,
|
||||
'head_to_head' => MatchHistory::where(function ($query) use ($homeTeam, $awayTeam) {
|
||||
$query->where([['home_team', '=', $homeTeam], ['away_team', '=', $awayTeam]])
|
||||
->whereOr([['home_team', '=', $awayTeam], ['away_team', '=', $homeTeam]]);
|
||||
})->order('match_time desc')->limit(5)->select()->toArray(),
|
||||
'home_recent' => MatchRecent::where('team_name', $homeTeam)
|
||||
->order('match_time desc')->limit(5)->select()->toArray(),
|
||||
'away_recent' => MatchRecent::where('team_name', $awayTeam)
|
||||
->order('match_time desc')->limit(5)->select()->toArray(),
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
private static function buildLotteryOverviewData(array $params): array
|
||||
{
|
||||
$categoryId = (int) ($params['category_id'] ?? 0);
|
||||
$code = trim((string) ($params['code'] ?? ''));
|
||||
|
||||
if ($code !== '') {
|
||||
$game = LotteryGame::where('code', $code)->findOrEmpty();
|
||||
if ($game->isEmpty()) {
|
||||
return self::fail('彩种不存在');
|
||||
}
|
||||
|
||||
$recentDraws = LotteryDrawResult::where('code', $code)
|
||||
->where('draw_code', '<>', '')
|
||||
->order('draw_time desc, issue desc')
|
||||
->limit(30)
|
||||
->field('issue,draw_time,draw_code')
|
||||
->select()
|
||||
->toArray();
|
||||
|
||||
foreach ($recentDraws as &$draw) {
|
||||
$draw['numbers'] = $draw['draw_code'] ? explode(',', $draw['draw_code']) : [];
|
||||
}
|
||||
|
||||
return [
|
||||
'success' => true,
|
||||
'code' => $code,
|
||||
'latest_issue' => (string) ($recentDraws[0]['issue'] ?? ''),
|
||||
'category_name' => $game['name'],
|
||||
'lottery_data' => [
|
||||
'lottery_type' => $code,
|
||||
'lottery_name' => $game['name'],
|
||||
'draw_rule' => $game['template'] ?? '',
|
||||
'recent_draws' => $recentDraws,
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
if ($categoryId <= 0) {
|
||||
return self::fail('参数缺失');
|
||||
}
|
||||
|
||||
$category = LotteryCategory::where('id', $categoryId)->findOrEmpty();
|
||||
if ($category->isEmpty()) {
|
||||
return self::fail('彩种不存在');
|
||||
}
|
||||
|
||||
$recentDraws = LotteryDraw::where('category_id', $categoryId)
|
||||
->where('status', 1)
|
||||
->where('is_show', 1)
|
||||
->order('draw_date desc, period desc')
|
||||
->limit(30)
|
||||
->field('period,draw_date,numbers,special_number,zodiac,color')
|
||||
->select()
|
||||
->toArray();
|
||||
|
||||
foreach ($recentDraws as &$draw) {
|
||||
$draw['numbers'] = is_string($draw['numbers']) ? json_decode($draw['numbers'], true) : $draw['numbers'];
|
||||
$draw['zodiac'] = is_string($draw['zodiac']) ? json_decode($draw['zodiac'], true) : $draw['zodiac'];
|
||||
$draw['color'] = is_string($draw['color']) ? json_decode($draw['color'], true) : $draw['color'];
|
||||
}
|
||||
|
||||
return [
|
||||
'success' => true,
|
||||
'code' => (string) $category['code'],
|
||||
'latest_issue' => (string) ($recentDraws[0]['period'] ?? ''),
|
||||
'category_name' => $category['name'],
|
||||
'lottery_data' => [
|
||||
'lottery_type' => $category['code'],
|
||||
'lottery_name' => $category['name'],
|
||||
'draw_rule' => $category['draw_rule'],
|
||||
'recent_draws' => $recentDraws,
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
private static function buildLotteryModuleData(string $code, string $module): array
|
||||
{
|
||||
$game = LotteryGame::where('code', $code)->findOrEmpty();
|
||||
if ($game->isEmpty()) {
|
||||
return self::fail('彩种不存在');
|
||||
}
|
||||
|
||||
if ($module === 'color_zodiac' && ($game['template'] ?? '') !== 'HK6') {
|
||||
return self::fail('该彩种不支持波色生肖分析');
|
||||
}
|
||||
|
||||
$recentDraws = self::getRecentDrawCodes($code, 30);
|
||||
$lotteryData = [
|
||||
'lottery_type' => $code,
|
||||
'lottery_name' => $game['name'],
|
||||
'draw_rule' => $game['template'] ?? '',
|
||||
'recent_draws' => $recentDraws,
|
||||
];
|
||||
|
||||
if ($module === 'color_zodiac') {
|
||||
$year = (int) date('Y');
|
||||
$lotteryData['number_mapping'] = [
|
||||
'color' => LotteryNumberMapping::getMapByType($year, LotteryNumberMapping::TYPE_COLOR),
|
||||
'zodiac' => LotteryNumberMapping::getMapByType($year, LotteryNumberMapping::TYPE_ZODIAC),
|
||||
];
|
||||
}
|
||||
|
||||
return [
|
||||
'success' => true,
|
||||
'latest_issue' => (string) ($recentDraws[0]['issue'] ?? ''),
|
||||
'lottery_data' => $lotteryData,
|
||||
];
|
||||
}
|
||||
|
||||
private static function getRecentDrawCodes(string $code, int $limit = 30): array
|
||||
{
|
||||
$rows = LotteryDrawResult::where('code', $code)
|
||||
->where('draw_code', '<>', '')
|
||||
->order('draw_time desc, issue desc')
|
||||
->limit($limit)
|
||||
->field('issue,draw_time,draw_code')
|
||||
->select()
|
||||
->toArray();
|
||||
|
||||
foreach ($rows as &$row) {
|
||||
$row['numbers'] = $row['draw_code'] ? array_map('intval', explode(',', $row['draw_code'])) : [];
|
||||
unset($row['draw_code']);
|
||||
}
|
||||
|
||||
return $rows;
|
||||
}
|
||||
|
||||
private static function ensureQuota(int $userId, string $analysisType, $refId, int $dbRefId): array
|
||||
{
|
||||
$analysisKey = AiQuotaService::makeKey($analysisType, $refId);
|
||||
$quota = AiQuotaService::unlock($userId, $analysisType, $analysisKey, $dbRefId);
|
||||
if (empty($quota['ok'])) {
|
||||
return self::fail((string) ($quota['msg'] ?? '今日免费次数已用完'), (int) ($quota['code'] ?? 0), $quota);
|
||||
}
|
||||
|
||||
return ['success' => true, 'quota' => $quota];
|
||||
}
|
||||
|
||||
private static function withQuota(array $payload, array $quota): array
|
||||
{
|
||||
return array_merge(['success' => true], $payload, [
|
||||
'remain_count' => $quota['remain'] ?? 0,
|
||||
'unlocked' => $quota['unlocked'] ?? true,
|
||||
'charged' => $quota['charged'] ?? false,
|
||||
]);
|
||||
}
|
||||
|
||||
private static function fail(string $error, int $code = 0, array $quota = []): array
|
||||
{
|
||||
$result = ['success' => false, 'error' => $error, 'code' => $code];
|
||||
if (array_key_exists('remain', $quota)) {
|
||||
$result['remain_count'] = $quota['remain'];
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
private static function lotteryQuotaRef(string $code, string $latestIssue): string
|
||||
{
|
||||
return $latestIssue !== '' ? $code . ':' . $latestIssue : $code;
|
||||
}
|
||||
|
||||
private static function crcRefId(string $value): int
|
||||
{
|
||||
return (int) sprintf('%u', crc32($value));
|
||||
}
|
||||
|
||||
private static function getPostTags(int $postId): array
|
||||
{
|
||||
$tagIds = Db::name('community_post_tag')->where('post_id', $postId)->column('tag_id');
|
||||
if (empty($tagIds)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return array_values(CommunityTag::whereIn('id', $tagIds)->column('name'));
|
||||
}
|
||||
|
||||
private static function isTrumpPost(array $tags): bool
|
||||
{
|
||||
return in_array('特朗普', $tags, true);
|
||||
}
|
||||
|
||||
private static function isLiuhePost(array $tags, array $ext = []): bool
|
||||
{
|
||||
foreach (self::LIUHE_TAGS as $tag) {
|
||||
if (in_array($tag, $tags, true)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
$lotteryKey = (string) ($ext['lottery_key'] ?? '');
|
||||
return in_array($lotteryKey, ['a6', 'xa6'], true);
|
||||
}
|
||||
|
||||
private static function localizeLiuhePostImagesForAi(CommunityPost $post, array $images): array
|
||||
{
|
||||
$localizedImages = [];
|
||||
$changed = false;
|
||||
|
||||
foreach ($images as $image) {
|
||||
$image = trim((string) $image);
|
||||
if ($image === '') {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (self::isLocalUploadImage($image)) {
|
||||
$localUrl = self::normalizeLocalUploadImageUrl($image);
|
||||
$localizedImages[] = $localUrl;
|
||||
$changed = $changed || $localUrl !== $image;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!preg_match('/^https?:\/\//i', $image)) {
|
||||
$localUrl = FileService::getFileUrl(ltrim($image, '/'));
|
||||
$localizedImages[] = $localUrl;
|
||||
$changed = $changed || $localUrl !== $image;
|
||||
continue;
|
||||
}
|
||||
|
||||
$localUrl = self::saveRemoteImageForAiAnalysis($image);
|
||||
if ($localUrl === '') {
|
||||
return ['success' => false, 'error' => '图片下载到本地失败,请稍后重试', 'images' => []];
|
||||
}
|
||||
|
||||
$localizedImages[] = $localUrl;
|
||||
$changed = true;
|
||||
}
|
||||
|
||||
if (empty($localizedImages)) {
|
||||
return ['success' => false, 'error' => '帖子图片为空,无法分析', 'images' => []];
|
||||
}
|
||||
|
||||
if ($changed || $localizedImages !== array_values($images)) {
|
||||
$now = time();
|
||||
Db::name('community_post')->where('id', (int) $post->id)->update([
|
||||
'images' => json_encode($localizedImages, JSON_UNESCAPED_UNICODE),
|
||||
'update_time' => $now,
|
||||
]);
|
||||
|
||||
Db::name('community_post_image')->where('post_id', (int) $post->id)->delete();
|
||||
foreach ($localizedImages as $index => $imageUrl) {
|
||||
Db::name('community_post_image')->insert([
|
||||
'post_id' => (int) $post->id,
|
||||
'image_url' => $imageUrl,
|
||||
'sort' => $index,
|
||||
'create_time' => $now,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
return ['success' => true, 'images' => $localizedImages, 'changed' => $changed];
|
||||
}
|
||||
|
||||
private static function isLocalUploadImage(string $image): bool
|
||||
{
|
||||
if (!preg_match('/^https?:\/\//i', $image)) {
|
||||
return str_starts_with(ltrim($image, '/'), 'uploads/');
|
||||
}
|
||||
|
||||
$path = (string) (parse_url($image, PHP_URL_PATH) ?: '');
|
||||
if (!str_starts_with($path, '/uploads/')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$imageHost = strtolower((string) (parse_url($image, PHP_URL_HOST) ?: ''));
|
||||
$currentHost = strtolower((string) (parse_url(request()->domain(), PHP_URL_HOST) ?: ''));
|
||||
return $imageHost !== '' && $currentHost !== '' && $imageHost === $currentHost;
|
||||
}
|
||||
|
||||
private static function normalizeLocalUploadImageUrl(string $image): string
|
||||
{
|
||||
if (preg_match('/^https?:\/\//i', $image)) {
|
||||
return $image;
|
||||
}
|
||||
|
||||
return FileService::getFileUrl(ltrim($image, '/'));
|
||||
}
|
||||
|
||||
private static function saveRemoteImageForAiAnalysis(string $imageUrl): string
|
||||
{
|
||||
$ch = curl_init($imageUrl);
|
||||
curl_setopt_array($ch, [
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_FOLLOWLOCATION => true,
|
||||
CURLOPT_CONNECTTIMEOUT => 10,
|
||||
CURLOPT_TIMEOUT => 25,
|
||||
CURLOPT_SSL_VERIFYPEER => false,
|
||||
CURLOPT_USERAGENT => 'Mozilla/5.0 SportEraBot/1.0',
|
||||
]);
|
||||
|
||||
$body = curl_exec($ch);
|
||||
$httpCode = (int) curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
||||
$contentType = (string) curl_getinfo($ch, CURLINFO_CONTENT_TYPE);
|
||||
curl_close($ch);
|
||||
|
||||
if ($httpCode !== 200 || !is_string($body) || $body === '' || strlen($body) > 8 * 1024 * 1024) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$mime = strtolower(trim(explode(';', $contentType)[0] ?? ''));
|
||||
$imageInfo = @getimagesizefromstring($body);
|
||||
if (is_array($imageInfo) && !empty($imageInfo['mime'])) {
|
||||
$mime = strtolower((string) $imageInfo['mime']);
|
||||
}
|
||||
|
||||
$extension = match ($mime) {
|
||||
'image/jpeg', 'image/jpg' => 'jpg',
|
||||
'image/png' => 'png',
|
||||
'image/webp' => 'webp',
|
||||
'image/gif' => 'gif',
|
||||
default => '',
|
||||
};
|
||||
|
||||
if ($extension === '') {
|
||||
$path = parse_url($imageUrl, PHP_URL_PATH) ?: '';
|
||||
$extension = strtolower(pathinfo($path, PATHINFO_EXTENSION));
|
||||
if (!in_array($extension, ['jpg', 'jpeg', 'png', 'webp', 'gif'], true)) {
|
||||
return '';
|
||||
}
|
||||
$extension = $extension === 'jpeg' ? 'jpg' : $extension;
|
||||
}
|
||||
|
||||
$relativeDir = 'uploads/ai_lottery_posts/' . date('Ymd');
|
||||
$publicRoot = rtrim(public_path(), DIRECTORY_SEPARATOR . '/');
|
||||
$targetDir = $publicRoot . DIRECTORY_SEPARATOR . str_replace('/', DIRECTORY_SEPARATOR, $relativeDir);
|
||||
if (!is_dir($targetDir) && !@mkdir($targetDir, 0755, true) && !is_dir($targetDir)) {
|
||||
return '';
|
||||
}
|
||||
if (!is_writable($targetDir)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$filename = sha1($imageUrl . "\n" . $body) . '.' . $extension;
|
||||
$relativeUri = $relativeDir . '/' . $filename;
|
||||
$targetPath = $targetDir . DIRECTORY_SEPARATOR . $filename;
|
||||
|
||||
if (!is_file($targetPath) && @file_put_contents($targetPath, $body) === false) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return FileService::getFileUrl($relativeUri);
|
||||
}
|
||||
|
||||
private static function ensureLiuheAnalysisContent(CommunityPost $post, array $ext): array
|
||||
{
|
||||
$images = is_array($post->images) ? array_values($post->images) : [];
|
||||
$originalImageHash = md5(json_encode($images, JSON_UNESCAPED_UNICODE));
|
||||
$localizeResult = self::localizeLiuhePostImagesForAi($post, $images);
|
||||
if (empty($localizeResult['success'])) {
|
||||
return [
|
||||
'success' => false,
|
||||
'error' => (string) ($localizeResult['error'] ?? '图片下载到本地失败'),
|
||||
];
|
||||
}
|
||||
|
||||
$images = array_values($localizeResult['images']);
|
||||
$imageHash = md5(json_encode($images, JSON_UNESCAPED_UNICODE));
|
||||
$cacheSource = (string) ($ext['lottery_analysis_source'] ?? '');
|
||||
$cacheHash = (string) ($ext['lottery_analysis_images_hash'] ?? '');
|
||||
|
||||
if (
|
||||
!empty($ext['lottery_analysis_content'])
|
||||
&& $cacheSource === 'image_only'
|
||||
&& in_array($cacheHash, [$imageHash, $originalImageHash], true)
|
||||
) {
|
||||
if ($cacheHash !== $imageHash) {
|
||||
$ext['lottery_analysis_images_hash'] = $imageHash;
|
||||
CommunityPost::where('id', (int) $post->id)->update([
|
||||
'ext' => json_encode($ext, JSON_UNESCAPED_UNICODE),
|
||||
'update_time' => time(),
|
||||
]);
|
||||
KbSyncService::enqueue('post', 'post', (int) $post->id, 'upsert', 45);
|
||||
}
|
||||
return ['success' => true, 'ext' => $ext, 'from_cache' => true];
|
||||
}
|
||||
|
||||
$result = AiService::analyzeLotteryPostImages($post->content ?: '', $images);
|
||||
if (empty($result['success']) || empty($result['content'])) {
|
||||
$fallbackContent = self::buildLiuheImageAnalysisFallback($images, (string) ($result['error'] ?? ''));
|
||||
if ($fallbackContent === '') {
|
||||
return [
|
||||
'success' => false,
|
||||
'error' => (string) ($result['error'] ?? '帖子图片分析失败'),
|
||||
];
|
||||
}
|
||||
|
||||
$result = [
|
||||
'success' => true,
|
||||
'content' => $fallbackContent,
|
||||
'tokens' => 0,
|
||||
'cost_ms' => (int) ($result['cost_ms'] ?? 0),
|
||||
];
|
||||
}
|
||||
|
||||
$ext['lottery_analysis_content'] = trim((string) $result['content']);
|
||||
$ext['lottery_analysis_source'] = 'image_only';
|
||||
$ext['lottery_analysis_images_hash'] = $imageHash;
|
||||
$ext['lottery_analysis_generated_at'] = time();
|
||||
|
||||
CommunityPost::where('id', (int) $post->id)->update([
|
||||
'ext' => json_encode($ext, JSON_UNESCAPED_UNICODE),
|
||||
'update_time' => time(),
|
||||
]);
|
||||
KbSyncService::enqueue('post', 'post', (int) $post->id, 'upsert', 45);
|
||||
|
||||
return ['success' => true, 'ext' => $ext, 'from_cache' => false];
|
||||
}
|
||||
|
||||
private static function buildLiuheImageAnalysisFallback(array $images, string $error): string
|
||||
{
|
||||
$error = trim($error);
|
||||
$isTimeout = $error !== '' && (stripos($error, 'timed out') !== false
|
||||
|| stripos($error, 'timeout') !== false
|
||||
|| stripos($error, 'cURL错误') !== false);
|
||||
if (!$isTimeout) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return implode("\n", [
|
||||
'图片已下载并替换为站内链接,但视觉模型在限定时间内未返回完整识别结果。',
|
||||
'当前可确认信息:帖子包含 ' . count($images) . ' 张本地化图片,可在原帖图片区域查看。',
|
||||
'识别状态:图片文字、号码、生肖、波色等细项暂未可靠识别。',
|
||||
'处理建议:以下分析只能结合帖子文案和图片展示场景进行保守解读,不能视为开奖结果或中奖承诺。',
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -2,13 +2,21 @@
|
||||
|
||||
namespace app\common\service\ai;
|
||||
|
||||
use app\common\model\ai\AiQuotaUnlock;
|
||||
use app\common\model\user\User;
|
||||
use think\facade\Db;
|
||||
|
||||
class AiQuotaService
|
||||
{
|
||||
public const DAILY_FREE_COUNT = 3;
|
||||
public const VIP_REMAIN_COUNT = 999;
|
||||
|
||||
public const TYPE_MATCH = 'match';
|
||||
public const TYPE_ARTICLE = 'article';
|
||||
public const TYPE_POST = 'post';
|
||||
public const TYPE_LOTTERY = 'lottery';
|
||||
public const TYPE_CREDIBILITY = 'credibility';
|
||||
|
||||
public static function isVip(User $user): bool
|
||||
{
|
||||
return (int) $user->getData('is_vip') === 1 && (int) $user->getData('vip_expire_time') > time();
|
||||
@@ -41,4 +49,132 @@ class AiQuotaService
|
||||
|
||||
return self::resetDailyIfNeeded($user);
|
||||
}
|
||||
|
||||
public static function makeKey(string $analysisType, $refId = 0, array $parts = []): string
|
||||
{
|
||||
$segments = array_merge([$analysisType, (string) $refId], array_map(static function ($part) {
|
||||
return trim((string) $part);
|
||||
}, $parts));
|
||||
$segments = array_values(array_filter($segments, static fn($part) => $part !== ''));
|
||||
return self::normalizeKey(implode(':', $segments), $analysisType);
|
||||
}
|
||||
|
||||
public static function hasUnlocked(int $userId, string $analysisKey): bool
|
||||
{
|
||||
if ($userId <= 0 || $analysisKey === '') {
|
||||
return false;
|
||||
}
|
||||
|
||||
return AiQuotaUnlock::where('user_id', $userId)
|
||||
->where('analysis_key', self::normalizeKey($analysisKey))
|
||||
->count() > 0;
|
||||
}
|
||||
|
||||
public static function unlock(int $userId, string $analysisType, string $analysisKey, int $refId = 0): array
|
||||
{
|
||||
if ($userId <= 0) {
|
||||
return [
|
||||
'ok' => false,
|
||||
'msg' => '请先登录',
|
||||
'code' => 401,
|
||||
'remain' => 0,
|
||||
'unlocked' => false,
|
||||
'charged' => false,
|
||||
];
|
||||
}
|
||||
|
||||
$analysisType = trim($analysisType);
|
||||
$analysisKey = self::normalizeKey($analysisKey, $analysisType);
|
||||
if ($analysisType === '' || $analysisKey === '') {
|
||||
return ['ok' => false, 'msg' => 'AI分析类型缺失', 'remain' => self::getRemainCount($userId)];
|
||||
}
|
||||
|
||||
return Db::transaction(function () use ($userId, $analysisType, $analysisKey, $refId) {
|
||||
$user = User::where('id', $userId)->lock(true)->findOrEmpty();
|
||||
if ($user->isEmpty()) {
|
||||
return ['ok' => false, 'msg' => '用户不存在', 'remain' => 0];
|
||||
}
|
||||
|
||||
$existing = AiQuotaUnlock::where('user_id', $userId)
|
||||
->where('analysis_key', $analysisKey)
|
||||
->findOrEmpty();
|
||||
if (!$existing->isEmpty()) {
|
||||
return [
|
||||
'ok' => true,
|
||||
'msg' => '已解锁',
|
||||
'remain' => self::getRemainCountForUser($user),
|
||||
'unlocked' => true,
|
||||
'charged' => false,
|
||||
];
|
||||
}
|
||||
|
||||
if (self::isVip($user)) {
|
||||
self::createUnlockRecord($userId, $analysisType, $analysisKey, $refId);
|
||||
return [
|
||||
'ok' => true,
|
||||
'msg' => 'VIP解锁',
|
||||
'remain' => self::VIP_REMAIN_COUNT,
|
||||
'unlocked' => true,
|
||||
'charged' => false,
|
||||
];
|
||||
}
|
||||
|
||||
$freeCount = self::resetDailyIfNeeded($user);
|
||||
if ($freeCount <= 0) {
|
||||
return [
|
||||
'ok' => false,
|
||||
'msg' => '今日免费次数已用完,升级VIP可无限使用',
|
||||
'remain' => 0,
|
||||
'unlocked' => false,
|
||||
'charged' => false,
|
||||
];
|
||||
}
|
||||
|
||||
$remain = $freeCount - 1;
|
||||
$user->save(['ai_free_count' => $remain]);
|
||||
self::createUnlockRecord($userId, $analysisType, $analysisKey, $refId);
|
||||
|
||||
return [
|
||||
'ok' => true,
|
||||
'msg' => '解锁成功',
|
||||
'remain' => $remain,
|
||||
'unlocked' => true,
|
||||
'charged' => true,
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
private static function createUnlockRecord(int $userId, string $analysisType, string $analysisKey, int $refId): void
|
||||
{
|
||||
AiQuotaUnlock::create([
|
||||
'user_id' => $userId,
|
||||
'analysis_type' => $analysisType,
|
||||
'analysis_key' => $analysisKey,
|
||||
'ref_id' => $refId,
|
||||
]);
|
||||
}
|
||||
|
||||
private static function getRemainCountForUser(User $user): int
|
||||
{
|
||||
if (self::isVip($user)) {
|
||||
return self::VIP_REMAIN_COUNT;
|
||||
}
|
||||
|
||||
return self::resetDailyIfNeeded($user);
|
||||
}
|
||||
|
||||
private static function normalizeKey(string $analysisKey, string $analysisType = 'ai'): string
|
||||
{
|
||||
$analysisKey = trim(preg_replace('/\s+/', '', $analysisKey) ?? '');
|
||||
if ($analysisKey === '') {
|
||||
return '';
|
||||
}
|
||||
|
||||
if (strlen($analysisKey) <= 190) {
|
||||
return $analysisKey;
|
||||
}
|
||||
|
||||
$prefix = trim($analysisType) ?: 'ai';
|
||||
return $prefix . ':' . sha1($analysisKey);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
@@ -1 +1 @@
|
||||
import{d as a,c as s,k as t,z as e,w as n,l as i,q as l,t as r,e as _,o,_ as c}from"./index-Becg0v_n.js";const u=c(a({__name:"ai-assistant-entry",props:{align:{default:"left"},size:{default:"regular"}},setup(a){const c=()=>{_({url:"/pages/ai_assistant/ai_assistant"})};return(a,_)=>{const u=l,d=t;return o(),s(d,{class:e(["ai-entry",[`ai-entry--${a.size}`,`ai-entry--align-${a.align}`]]),onClick:c},{default:n(()=>[i(u,{class:"ai-entry__line ai-entry__line--top"},{default:n(()=>[r("AI")]),_:1}),i(u,{class:"ai-entry__line ai-entry__line--bottom"},{default:n(()=>[r("助手")]),_:1})]),_:1},8,["class"])}}}),[["__scopeId","data-v-70ecc891"]]);export{u as A};
|
||||
import{d as a,c as s,k as t,z as e,w as n,l as i,q as l,t as r,e as _,o,_ as c}from"./index-gD80NK0s.js";const u=c(a({__name:"ai-assistant-entry",props:{align:{default:"left"},size:{default:"regular"}},setup(a){const c=()=>{_({url:"/pages/ai_assistant/ai_assistant"})};return(a,_)=>{const u=l,d=t;return o(),s(d,{class:e(["ai-entry",[`ai-entry--${a.size}`,`ai-entry--align-${a.align}`]]),onClick:c},{default:n(()=>[i(u,{class:"ai-entry__line ai-entry__line--top"},{default:n(()=>[r("AI")]),_:1}),i(u,{class:"ai-entry__line ai-entry__line--bottom"},{default:n(()=>[r("助手")]),_:1})]),_:1},8,["class"])}}}),[["__scopeId","data-v-70ecc891"]]);export{u as A};
|
||||
@@ -1 +0,0 @@
|
||||
import{M as t}from"./index-Becg0v_n.js";import{w as a,A as r}from"./aiRequest.br0QglYY.js";function e(e){return t.get(a({url:"/ai/matchPredictSection",data:e}),r)}function i(e){return t.get(a({url:"/ai/articleAnalysis",data:e}),{...r,withToken:!1})}function n(a){return t.get({url:"/ai/checkUnlock",data:a})}export{i as a,n as c,e as g};
|
||||
@@ -0,0 +1 @@
|
||||
import{M as t}from"./index-gD80NK0s.js";import{w as a,A as r}from"./aiRequest.br0QglYY.js";function e(e){return t.get(a({url:"/ai/analyze",data:e}),{...r,isAuth:!0})}function n(t){return e({type:"match",...t})}function i(t){return e({type:"article",...t})}function u(a){return t.get({url:"/ai/checkUnlock",data:a})}export{i as a,u as c,n as g,e as r};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
-1
@@ -1 +1 @@
|
||||
import{M as t}from"./index-Becg0v_n.js";function a(a){return t.get({url:"/chat/sessions",data:a})}function s(a){return t.post({url:"/chat/open",data:a})}function n(a){return t.get({url:"/chat/messages",data:a})}function r(a){return t.post({url:"/chat/send",data:a})}export{n as a,a as g,s as o,r as s};
|
||||
import{M as t}from"./index-gD80NK0s.js";function a(a){return t.get({url:"/chat/sessions",data:a})}function s(a){return t.post({url:"/chat/open",data:a})}function n(a){return t.get({url:"/chat/messages",data:a})}function r(a){return t.post({url:"/chat/send",data:a})}export{n as a,a as g,s as o,r as s};
|
||||
@@ -0,0 +1 @@
|
||||
import{M as t}from"./index-gD80NK0s.js";import{w as n,A as u}from"./aiRequest.br0QglYY.js";import{r as a}from"./ai.dzY7BI1V.js";function o(n){return t.get({url:"/community/postLists",data:n})}function r(n){return t.get({url:"/community/postDetail",data:n})}function s(n){return t.post({url:"/community/publish",data:n})}function i(n){return t.get({url:"/community/commentLists",data:n})}function e(n){return t.post({url:"/community/addComment",data:n})}function m(n){return t.post({url:"/community/deleteComment",data:n})}function c(n){return t.post({url:"/community/deletePost",data:n})}function l(n){return t.post({url:"/community/like",data:n})}function f(n){return t.post({url:"/community/follow",data:n})}function d(){return t.get({url:"/community/tagLists"})}function p(n){return t.post({url:"/community/purchasePost",data:n})}function y(n){return t.post({url:"/community/translatePost",data:n})}function g(t){return a({type:"post",...t})}function j(a){return t.get(n({url:"/community/aiAnalysisResult",data:a}),u)}function P(n){return t.get({url:"/community/userProfile",data:n})}export{r as a,g as b,j as c,d,l as e,y as f,o as g,s as h,i,e as j,m as k,c as l,P as m,p,f as t};
|
||||
@@ -1 +0,0 @@
|
||||
import{M as t}from"./index-Becg0v_n.js";import{w as n,A as u}from"./aiRequest.br0QglYY.js";function a(n){return t.get({url:"/community/postLists",data:n})}function o(n){return t.get({url:"/community/postDetail",data:n})}function r(n){return t.post({url:"/community/publish",data:n})}function s(n){return t.get({url:"/community/commentLists",data:n})}function i(n){return t.post({url:"/community/addComment",data:n})}function e(n){return t.post({url:"/community/deleteComment",data:n})}function m(n){return t.post({url:"/community/deletePost",data:n})}function c(n){return t.post({url:"/community/like",data:n})}function l(n){return t.post({url:"/community/follow",data:n})}function d(){return t.get({url:"/community/tagLists"})}function f(n){return t.post({url:"/community/purchasePost",data:n})}function y(n){return t.post({url:"/community/translatePost",data:n})}function p(a){return t.get(n({url:"/community/aiAnalysis",data:a}),u)}function g(a){return t.get(n({url:"/community/aiAnalysisResult",data:a}),u)}function P(n){return t.get({url:"/community/userProfile",data:n})}export{o as a,p as b,g as c,d,c as e,y as f,a as g,r as h,s as i,i as j,e as k,m as l,P as m,f as p,l as t};
|
||||
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
-1
@@ -1 +1 @@
|
||||
import{M as a,d as e,H as l,G as t,r as u,at as n,ap as o,a3 as s,o as p,c,k as i,w as r,l as _,m as d,D as v,q as f,t as g,p as k,v as h,au as b,R as y,a8 as m,e as w,av as T,aw as x,af as C,ax as P,X as q,s as D,_ as G}from"./index-Becg0v_n.js";function I(e){return a.post({url:"/popup/report",data:e},{withToken:!1})}const N="popup_shown_",M=G(e({__name:"global-popup",props:{pagePath:{},triggerTick:{}},setup(e){const G=e,M=l();const j=t(()=>G.pagePath||M.popupPagePath||function(){const a=m();if(!a.length)return"";let e=a[a.length-1].route||"";return e=e.replace(/^\//,""),e.startsWith("mobile/")&&(e=e.replace("mobile/","")),"/"+e}()),F=t(()=>G.triggerTick??M.popupTick),H=u(!1),R=u(null),S=u(!1),W=u(100);let X=null;const z=t(()=>{return{width:W.value+"%",backgroundColor:(a=W.value,a>60?"#4cd964":a>30?"#ff9500":"#ff3b30"),transitionDuration:"200ms"};var a}),A=P(),B=n();let E=null;const J=new Set;async function K(){var e;if(j.value)try{const l=await(e={page_path:j.value,platform:A},a.get({url:"/popup/list",data:e},{withToken:!1})),t=(null==l?void 0:l.lists)||[];if(!t.length)return;const u=t.find(a=>function(a){const e=N+a.id,l=Date.now();switch(a.frequency){case 1:return!0;case 2:return!J.has(a.id);case 3:try{const a=q(e);return!a||l-Number(a)>=864e5}catch(t){return!0}case 4:try{return!q(e)}catch(t){return!0}default:return!0}}(a));if(!u)return;const n=()=>{R.value=u,H.value=!0,function(a){if(J.add(a.id),3===a.frequency||4===a.frequency)try{D(N+a.id,Date.now())}catch(e){}}(u),function(a){V();const e=Number(a.auto_close_seconds||0);if(e<=0)return;const l=1e3*e,t=200,u=100*t/l;W.value=100,S.value=!0,X=setInterval(()=>{W.value=Math.max(0,W.value-u)},t),E=setTimeout(()=>{!function(){if(!R.value)return;I({popup_id:R.value.id,action:3,page_path:j.value,device_id:B,platform:A}).catch(()=>{}),U()}()},l)}(u),I({popup_id:u.id,action:1,page_path:j.value,device_id:B,platform:A}).catch(()=>{})};u.delay_seconds&&u.delay_seconds>0?setTimeout(n,1e3*u.delay_seconds):n()}catch(l){console.warn("[GlobalPopup] 拉取弹窗失败:",l)}}function L(){if(!R.value)return;const a=R.value;I({popup_id:a.id,action:2,page_path:j.value,device_id:B,platform:A}).catch(()=>{}),1===a.link_type&&a.link_url?(w({url:a.link_url,fail:()=>{T({url:a.link_url,fail:()=>x({url:a.link_url})})}}),U()):2===a.link_type&&a.link_url?(window.open(a.link_url,"_blank"),U()):3===a.link_type&&a.link_url&&(C({phoneNumber:a.link_url}),U())}function O(){R.value&&(V(),I({popup_id:R.value.id,action:3,page_path:j.value,device_id:B,platform:A}).catch(()=>{}),U())}function Q(){R.value&&0===R.value.is_closable||O()}function U(){V(),H.value=!1,R.value=null}function V(){E&&(clearTimeout(E),E=null),X&&(clearInterval(X),X=null),S.value=!1,W.value=100}return o(()=>{K()}),s(F,()=>{H.value||K()}),s(j,()=>{H.value||K()}),(a,e)=>{const l=i,t=f,u=k,n=b;return H.value&&R.value?(p(),c(l,{key:0,class:"global-popup-mask",onClick:Q},{default:r(()=>[_(l,{class:"global-popup-wrap",onClick:e[0]||(e[0]=y(()=>{},["stop"]))},{default:r(()=>[S.value?(p(),c(l,{key:0,class:"global-popup__progress"},{default:r(()=>[_(l,{class:"global-popup__progress-inner",style:d(z.value)},null,8,["style"])]),_:1})):v("",!0),_(l,{class:"global-popup"},{default:r(()=>[0!==R.value.is_closable?(p(),c(l,{key:0,class:"global-popup__close",onClick:O},{default:r(()=>[_(t,null,{default:r(()=>[g("×")]),_:1})]),_:1})):v("",!0),_(l,{class:"global-popup__body",onClick:L},{default:r(()=>[R.value.image?(p(),c(u,{key:0,src:R.value.image,class:"global-popup__image",mode:"widthFix"},null,8,["src"])):v("",!0),R.value.title||R.value.content?(p(),c(l,{key:1,class:"global-popup__text"},{default:r(()=>[R.value.title?(p(),c(t,{key:0,class:"global-popup__title"},{default:r(()=>[g(h(R.value.title),1)]),_:1})):v("",!0),R.value.content?(p(),c(n,{key:1,class:"global-popup__content",nodes:R.value.content},null,8,["nodes"])):v("",!0)]),_:1})):v("",!0),0!==R.value.link_type?(p(),c(l,{key:2,class:"global-popup__btn"},{default:r(()=>[_(t,null,{default:r(()=>[g("查看详情")]),_:1})]),_:1})):v("",!0)]),_:1})]),_:1})]),_:1})]),_:1})):v("",!0)}}}),[["__scopeId","data-v-d510a7ad"]]);export{M as G};
|
||||
import{M as a,d as e,H as l,G as t,r as u,at as n,ap as o,a3 as s,o as p,c,k as i,w as r,l as _,m as d,D as v,q as f,t as g,p as k,v as h,au as b,R as y,a8 as m,e as w,av as T,aw as x,af as C,ax as P,X as q,s as D,_ as G}from"./index-gD80NK0s.js";function I(e){return a.post({url:"/popup/report",data:e},{withToken:!1})}const N="popup_shown_",M=G(e({__name:"global-popup",props:{pagePath:{},triggerTick:{}},setup(e){const G=e,M=l();const j=t(()=>G.pagePath||M.popupPagePath||function(){const a=m();if(!a.length)return"";let e=a[a.length-1].route||"";return e=e.replace(/^\//,""),e.startsWith("mobile/")&&(e=e.replace("mobile/","")),"/"+e}()),F=t(()=>G.triggerTick??M.popupTick),H=u(!1),R=u(null),S=u(!1),W=u(100);let X=null;const z=t(()=>{return{width:W.value+"%",backgroundColor:(a=W.value,a>60?"#4cd964":a>30?"#ff9500":"#ff3b30"),transitionDuration:"200ms"};var a}),A=P(),B=n();let E=null;const J=new Set;async function K(){var e;if(j.value)try{const l=await(e={page_path:j.value,platform:A},a.get({url:"/popup/list",data:e},{withToken:!1})),t=(null==l?void 0:l.lists)||[];if(!t.length)return;const u=t.find(a=>function(a){const e=N+a.id,l=Date.now();switch(a.frequency){case 1:return!0;case 2:return!J.has(a.id);case 3:try{const a=q(e);return!a||l-Number(a)>=864e5}catch(t){return!0}case 4:try{return!q(e)}catch(t){return!0}default:return!0}}(a));if(!u)return;const n=()=>{R.value=u,H.value=!0,function(a){if(J.add(a.id),3===a.frequency||4===a.frequency)try{D(N+a.id,Date.now())}catch(e){}}(u),function(a){V();const e=Number(a.auto_close_seconds||0);if(e<=0)return;const l=1e3*e,t=200,u=100*t/l;W.value=100,S.value=!0,X=setInterval(()=>{W.value=Math.max(0,W.value-u)},t),E=setTimeout(()=>{!function(){if(!R.value)return;I({popup_id:R.value.id,action:3,page_path:j.value,device_id:B,platform:A}).catch(()=>{}),U()}()},l)}(u),I({popup_id:u.id,action:1,page_path:j.value,device_id:B,platform:A}).catch(()=>{})};u.delay_seconds&&u.delay_seconds>0?setTimeout(n,1e3*u.delay_seconds):n()}catch(l){console.warn("[GlobalPopup] 拉取弹窗失败:",l)}}function L(){if(!R.value)return;const a=R.value;I({popup_id:a.id,action:2,page_path:j.value,device_id:B,platform:A}).catch(()=>{}),1===a.link_type&&a.link_url?(w({url:a.link_url,fail:()=>{T({url:a.link_url,fail:()=>x({url:a.link_url})})}}),U()):2===a.link_type&&a.link_url?(window.open(a.link_url,"_blank"),U()):3===a.link_type&&a.link_url&&(C({phoneNumber:a.link_url}),U())}function O(){R.value&&(V(),I({popup_id:R.value.id,action:3,page_path:j.value,device_id:B,platform:A}).catch(()=>{}),U())}function Q(){R.value&&0===R.value.is_closable||O()}function U(){V(),H.value=!1,R.value=null}function V(){E&&(clearTimeout(E),E=null),X&&(clearInterval(X),X=null),S.value=!1,W.value=100}return o(()=>{K()}),s(F,()=>{H.value||K()}),s(j,()=>{H.value||K()}),(a,e)=>{const l=i,t=f,u=k,n=b;return H.value&&R.value?(p(),c(l,{key:0,class:"global-popup-mask",onClick:Q},{default:r(()=>[_(l,{class:"global-popup-wrap",onClick:e[0]||(e[0]=y(()=>{},["stop"]))},{default:r(()=>[S.value?(p(),c(l,{key:0,class:"global-popup__progress"},{default:r(()=>[_(l,{class:"global-popup__progress-inner",style:d(z.value)},null,8,["style"])]),_:1})):v("",!0),_(l,{class:"global-popup"},{default:r(()=>[0!==R.value.is_closable?(p(),c(l,{key:0,class:"global-popup__close",onClick:O},{default:r(()=>[_(t,null,{default:r(()=>[g("×")]),_:1})]),_:1})):v("",!0),_(l,{class:"global-popup__body",onClick:L},{default:r(()=>[R.value.image?(p(),c(u,{key:0,src:R.value.image,class:"global-popup__image",mode:"widthFix"},null,8,["src"])):v("",!0),R.value.title||R.value.content?(p(),c(l,{key:1,class:"global-popup__text"},{default:r(()=>[R.value.title?(p(),c(t,{key:0,class:"global-popup__title"},{default:r(()=>[g(h(R.value.title),1)]),_:1})):v("",!0),R.value.content?(p(),c(n,{key:1,class:"global-popup__content",nodes:R.value.content},null,8,["nodes"])):v("",!0)]),_:1})):v("",!0),0!==R.value.link_type?(p(),c(l,{key:2,class:"global-popup__btn"},{default:r(()=>[_(t,null,{default:r(()=>[g("查看详情")]),_:1})]),_:1})):v("",!0)]),_:1})]),_:1})]),_:1})]),_:1})):v("",!0)}}}),[["__scopeId","data-v-d510a7ad"]]);export{M as G};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+3
-3
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
import{M as t}from"./index-gD80NK0s.js";import{r as e}from"./ai.dzY7BI1V.js";const n=t=>({...(null==t?void 0:t.data)||{},remain_count:null==t?void 0:t.remain_count,unlocked:null==t?void 0:t.unlocked,charged:null==t?void 0:t.charged});function r(e){return t.get({url:"/lottery/drawDetail",data:e},{withToken:!1})}function o(){return t.get({url:"/lottery/gameList"},{withToken:!1})}function u(e){return t.get({url:"/lottery/latestDrawResult",data:e},{withToken:!1})}function a(e){return t.get({url:"/lottery/drawResultList",data:e},{withToken:!1})}function l(t){return e({type:"lottery",...t})}function i(e){return t.get({url:"/lottery/aiHistory",data:e},{withToken:!1})}function d(t){return e({type:"lottery_module",module:"hot_cold",...t}).then(n)}function s(t){return e({type:"lottery_module",module:"trend",...t}).then(n)}function c(t){return e({type:"lottery_module",module:"stats",...t}).then(n)}export{u as a,a as b,l as c,r as d,i as e,d as f,o as g,s as h,c as i};
|
||||
@@ -1 +0,0 @@
|
||||
import{M as t}from"./index-Becg0v_n.js";import{w as e,A as r}from"./aiRequest.br0QglYY.js";function a(e){return t.get({url:"/lottery/drawDetail",data:e},{withToken:!1})}function n(){return t.get({url:"/lottery/gameList"},{withToken:!1})}function o(e){return t.get({url:"/lottery/latestDrawResult",data:e},{withToken:!1})}function i(e){return t.get({url:"/lottery/drawResultList",data:e},{withToken:!1})}function u(a){return t.get(e({url:"/lottery/aiPredict",data:a}),{...r,withToken:!1})}function l(e){return t.get({url:"/lottery/aiHistory",data:e},{withToken:!1})}function s(a){return t.get(e({url:"/lottery/aiHotCold",data:a}),{...r,withToken:!1})}function d(a){return t.get(e({url:"/lottery/aiTrend",data:a}),{...r,withToken:!1})}function w(a){return t.get(e({url:"/lottery/aiStats",data:a}),{...r,withToken:!1})}export{o as a,i as b,u as c,a as d,l as e,s as f,n as g,d as h,w as i};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
-1
@@ -1 +1 @@
|
||||
import{M as t}from"./index-Becg0v_n.js";function n(n){return t.get({url:"/match/lists",data:n},{withToken:!1})}function e(n){return t.get({url:"/match/detail",data:n},{withToken:!1})}function a(){return t.get({url:"/match/sportTypes"},{withToken:!1})}function r(n){return t.get({url:"/match/leagues",data:n},{withToken:!1})}function u(n){return t.get({url:"/match/liveText",data:n},{withToken:!1})}function i(n){return t.get({url:"/match/lineup",data:n},{withToken:!1})}function o(){return t.get({url:"/match/worldCupStandings"},{withToken:!1})}function c(n){return t.get({url:"/match/worldCupRankings",data:n},{withToken:!1})}function h(){return t.get({url:"/match/worldCupSchedule"},{withToken:!1})}function l(){return t.get({url:"/match/worldCupLiveCards"},{withToken:!1})}export{u as a,i as b,a as c,r as d,n as e,h as f,e as g,o as h,c as i,l as j};
|
||||
import{M as t}from"./index-gD80NK0s.js";function n(n){return t.get({url:"/match/lists",data:n},{withToken:!1})}function e(n){return t.get({url:"/match/detail",data:n},{withToken:!1})}function a(){return t.get({url:"/match/sportTypes"},{withToken:!1})}function r(n){return t.get({url:"/match/leagues",data:n},{withToken:!1})}function u(n){return t.get({url:"/match/liveText",data:n},{withToken:!1})}function i(n){return t.get({url:"/match/lineup",data:n},{withToken:!1})}function o(){return t.get({url:"/match/worldCupStandings"},{withToken:!1})}function c(n){return t.get({url:"/match/worldCupRankings",data:n},{withToken:!1})}function h(){return t.get({url:"/match/worldCupSchedule"},{withToken:!1})}function l(){return t.get({url:"/match/worldCupLiveCards"},{withToken:!1})}export{u as a,i as b,a as c,r as d,n as e,h as f,e as g,o as h,c as i,l as j};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
-1
@@ -1 +1 @@
|
||||
import{M as t}from"./index-Becg0v_n.js";function a(){return t.get({url:"/article/cate"},{withToken:!1})}function r(a){return t.get({url:"/article/lists",data:a})}function e(a){return t.get({url:"/article/detail",data:a})}function n(a){return t.post({url:"/article/addCollect",data:a},{isAuth:!0})}function u(a){return t.post({url:"/article/cancelCollect",data:a},{isAuth:!0})}function i(){return t.get({url:"/article/collect"})}function c(a){return t.get({url:"/article/commentList",data:a},{withToken:!1})}function l(a){return t.post({url:"/article/addComment",data:a},{isAuth:!0})}function o(a){return t.post({url:"/article/vote",data:a},{isAuth:!0})}export{r as a,e as b,c,l as d,o as e,u as f,a as g,n as h,i};
|
||||
import{M as t}from"./index-gD80NK0s.js";function a(){return t.get({url:"/article/cate"},{withToken:!1})}function r(a){return t.get({url:"/article/lists",data:a})}function e(a){return t.get({url:"/article/detail",data:a})}function n(a){return t.post({url:"/article/addCollect",data:a},{isAuth:!0})}function u(a){return t.post({url:"/article/cancelCollect",data:a},{isAuth:!0})}function i(){return t.get({url:"/article/collect"})}function c(a){return t.get({url:"/article/commentList",data:a},{withToken:!1})}function l(a){return t.post({url:"/article/addComment",data:a},{isAuth:!0})}function o(a){return t.post({url:"/article/vote",data:a},{isAuth:!0})}export{r as a,e as b,c,l as d,o as e,u as f,a as g,n as h,i};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{_ as e,x as t,l as a,w as l,F as s,P as n,k as r,o as u,t as p}from"./index-Becg0v_n.js";const x=e({},[["render",function(e,x){const c=n("page-meta"),d=n("u-empty"),f=r,o=n("router-navigate");return u(),t(s,null,[a(c,{"page-style":e.$theme.pageStyle},null,8,["page-style"]),a(f,{class:"h-screen flex flex-col justify-center items-center"},{default:l(()=>[a(f,null,{default:l(()=>[a(d,{text:"对不起,您访问的页面不存在",mode:"data"})]),_:1}),a(f,{class:"w-full px-[100rpx] mt-[40rpx]"},{default:l(()=>[a(o,{class:"bg-primary rounded-full text-btn-text leading-[80rpx] text-center",to:"/","nav-type":"reLaunch"},{default:l(()=>[p(" 返回首页 ")]),_:1})]),_:1})]),_:1})],64)}]]);export{x as default};
|
||||
import{_ as e,x as t,l as a,w as l,F as s,P as n,k as r,o as u,t as p}from"./index-gD80NK0s.js";const x=e({},[["render",function(e,x){const c=n("page-meta"),d=n("u-empty"),f=r,o=n("router-navigate");return u(),t(s,null,[a(c,{"page-style":e.$theme.pageStyle},null,8,["page-style"]),a(f,{class:"h-screen flex flex-col justify-center items-center"},{default:l(()=>[a(f,null,{default:l(()=>[a(d,{text:"对不起,您访问的页面不存在",mode:"data"})]),_:1}),a(f,{class:"w-full px-[100rpx] mt-[40rpx]"},{default:l(()=>[a(o,{class:"bg-primary rounded-full text-btn-text leading-[80rpx] text-center",to:"/","nav-type":"reLaunch"},{default:l(()=>[p(" 返回首页 ")]),_:1})]),_:1})]),_:1})],64)}]]);export{x as default};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{d as e,r as a,a2 as t,f as l,x as s,l as r,w as u,F as o,M as p,P as d,o as n,k as c,t as i,v as m,ae as _,y,c as f,z as x,D as g,b8 as v}from"./index-Becg0v_n.js";const b=e({__name:"points_log",setup(e){const b=a([{name:"全部",type:""},{name:"收入",type:1},{name:"支出",type:2}]),h=t(),w=a([]),k=a(0),V=e=>{k.value=e,h.value.reload()},j=async(e,a)=>{try{const t=b.value[k.value].type,l=await v({action:t,type:"up",page_no:e,page_size:a});h.value.complete(l.lists)}catch(t){h.value.complete(!1)}},z=a(0);return l(()=>{(async()=>{try{const e=await p.get({url:"/community/userStats"},{isTransformResponse:!1});1===(null==e?void 0:e.code)&&e.data&&(z.value=e.data.user_points||0)}catch(e){}})()}),(e,a)=>{const t=d("page-meta"),l=c,p=_,v=d("u-tabs"),C=d("z-paging");return n(),s(o,null,[r(t,{"page-style":e.$theme.pageStyle},null,8,["page-style"]),r(C,{ref_key:"paging",ref:h,modelValue:w.value,"onUpdate:modelValue":a[1]||(a[1]=e=>w.value=e),onQuery:j,"show-loading-more-when-reload":!0},{default:u(()=>[r(l,{class:"points-log"},{default:u(()=>[r(l,{class:"p-[20rpx]"},{default:u(()=>[r(l,{class:"bg-primary rounded-[14rpx] flex items-center justify-between pl-[44rpx] py-[54rpx] text-white"},{default:u(()=>[r(l,null,{default:u(()=>[r(l,{class:"text-sm"},{default:u(()=>[i("当前积分")]),_:1}),r(l,{class:"text-[60rpx]"},{default:u(()=>[i(m(z.value),1)]),_:1})]),_:1}),r(p,{url:"/packages/pages/points_products/points_products","hover-class":"none"},{default:u(()=>[r(l,{class:"text-primary px-[30rpx] py-[15rpx] bg-white rounded-l-full"},{default:u(()=>[i(" 去购买 ")]),_:1})]),_:1})]),_:1})]),_:1}),r(v,{list:b.value,"is-scroll":!1,modelValue:k.value,"onUpdate:modelValue":a[0]||(a[0]=e=>k.value=e),activeColor:"var(--color-primary)",onChange:V},null,8,["list","modelValue"]),r(l,{class:"pt-2.5"},{default:u(()=>[(n(!0),s(o,null,y(w.value,e=>(n(),f(l,{key:e.id,class:"bg-white border-solid border-b border-0 border-light px-[26rpx] py-[24rpx]"},{default:u(()=>[r(l,{class:"flex justify-between"},{default:u(()=>[r(l,{class:"mr-2"},{default:u(()=>[i(m(e.type_desc),1)]),_:2},1024),r(l,{class:x(["text-lg",{"text-primary":1==e.action}])},{default:u(()=>[i(m(e.change_amount_desc),1)]),_:2},1032,["class"])]),_:2},1024),e.remark?(n(),f(l,{key:0,class:"text-sm text-muted mt-1"},{default:u(()=>[i(m(e.remark),1)]),_:2},1024)):g("",!0),r(l,{class:"text-sm text-muted mr-1"},{default:u(()=>[i(m(e.create_time),1)]),_:2},1024)]),_:2},1024))),128))]),_:1})]),_:1})]),_:1},8,["modelValue"])],64)}}});export{b as default};
|
||||
import{d as e,r as a,a2 as t,f as l,x as s,l as r,w as u,F as o,M as p,P as d,o as n,k as c,t as i,v as m,ae as _,y,c as f,z as x,D as g,b8 as v}from"./index-gD80NK0s.js";const b=e({__name:"points_log",setup(e){const b=a([{name:"全部",type:""},{name:"收入",type:1},{name:"支出",type:2}]),h=t(),w=a([]),k=a(0),V=e=>{k.value=e,h.value.reload()},j=async(e,a)=>{try{const t=b.value[k.value].type,l=await v({action:t,type:"up",page_no:e,page_size:a});h.value.complete(l.lists)}catch(t){h.value.complete(!1)}},z=a(0);return l(()=>{(async()=>{try{const e=await p.get({url:"/community/userStats"},{isTransformResponse:!1});1===(null==e?void 0:e.code)&&e.data&&(z.value=e.data.user_points||0)}catch(e){}})()}),(e,a)=>{const t=d("page-meta"),l=c,p=_,v=d("u-tabs"),C=d("z-paging");return n(),s(o,null,[r(t,{"page-style":e.$theme.pageStyle},null,8,["page-style"]),r(C,{ref_key:"paging",ref:h,modelValue:w.value,"onUpdate:modelValue":a[1]||(a[1]=e=>w.value=e),onQuery:j,"show-loading-more-when-reload":!0},{default:u(()=>[r(l,{class:"points-log"},{default:u(()=>[r(l,{class:"p-[20rpx]"},{default:u(()=>[r(l,{class:"bg-primary rounded-[14rpx] flex items-center justify-between pl-[44rpx] py-[54rpx] text-white"},{default:u(()=>[r(l,null,{default:u(()=>[r(l,{class:"text-sm"},{default:u(()=>[i("当前积分")]),_:1}),r(l,{class:"text-[60rpx]"},{default:u(()=>[i(m(z.value),1)]),_:1})]),_:1}),r(p,{url:"/packages/pages/points_products/points_products","hover-class":"none"},{default:u(()=>[r(l,{class:"text-primary px-[30rpx] py-[15rpx] bg-white rounded-l-full"},{default:u(()=>[i(" 去购买 ")]),_:1})]),_:1})]),_:1})]),_:1}),r(v,{list:b.value,"is-scroll":!1,modelValue:k.value,"onUpdate:modelValue":a[0]||(a[0]=e=>k.value=e),activeColor:"var(--color-primary)",onChange:V},null,8,["list","modelValue"]),r(l,{class:"pt-2.5"},{default:u(()=>[(n(!0),s(o,null,y(w.value,e=>(n(),f(l,{key:e.id,class:"bg-white border-solid border-b border-0 border-light px-[26rpx] py-[24rpx]"},{default:u(()=>[r(l,{class:"flex justify-between"},{default:u(()=>[r(l,{class:"mr-2"},{default:u(()=>[i(m(e.type_desc),1)]),_:2},1024),r(l,{class:x(["text-lg",{"text-primary":1==e.action}])},{default:u(()=>[i(m(e.change_amount_desc),1)]),_:2},1032,["class"])]),_:2},1024),e.remark?(n(),f(l,{key:0,class:"text-sm text-muted mt-1"},{default:u(()=>[i(m(e.remark),1)]),_:2},1024)):g("",!0),r(l,{class:"text-sm text-muted mr-1"},{default:u(()=>[i(m(e.create_time),1)]),_:2},1024)]),_:2},1024))),128))]),_:1})]),_:1})]),_:1},8,["modelValue"])],64)}}});export{b as default};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{d as a,r as s,J as t,b as e,c as d,w as l,k as o,P as r,o as u,l as c,t as n,v as i,b9 as _,_ as p}from"./index-Becg0v_n.js";import{b as f,a as m}from"./points.mwwYRoCN.js";const v=p(a({__name:"points_order",setup(a){const p=s(0),v=s(!1),b=t({product_id:0,name:"",points:0,amount:"0.00"}),y=async()=>{v.value=!0;try{const a=await m({product_id:p.value});_({url:`/packages/pages/points_order_detail/points_order_detail?order_id=${a.order_id}`})}finally{v.value=!1}};return e(a=>{p.value=Number(a.product_id||0),(async()=>{const a=await f({product_id:p.value});Object.assign(b,a)})()}),(a,s)=>{const t=o,e=r("u-button");return u(),d(t,{class:"points-order"},{default:l(()=>[c(t,{class:"card"},{default:l(()=>[c(t,{class:"title"},{default:l(()=>[n("确认订单")]),_:1}),c(t,{class:"product"},{default:l(()=>[c(t,null,{default:l(()=>[c(t,{class:"name"},{default:l(()=>[n(i(b.name),1)]),_:1}),c(t,{class:"desc"},{default:l(()=>[n("到账积分:"+i(b.points),1)]),_:1})]),_:1}),c(t,{class:"amount"},{default:l(()=>[n("¥"+i(b.amount),1)]),_:1})]),_:1})]),_:1}),c(t,{class:"submit"},{default:l(()=>[c(e,{loading:v.value,type:"primary",shape:"circle",onClick:y},{default:l(()=>[n("提交订单")]),_:1},8,["loading"])]),_:1})]),_:1})}}}),[["__scopeId","data-v-18c0ce5e"]]);export{v as default};
|
||||
import{d as a,r as s,J as t,b as e,c as d,w as l,k as o,P as r,o as u,l as c,t as n,v as i,b9 as _,_ as p}from"./index-gD80NK0s.js";import{b as f,a as m}from"./points.DvWPN6Un.js";const v=p(a({__name:"points_order",setup(a){const p=s(0),v=s(!1),b=t({product_id:0,name:"",points:0,amount:"0.00"}),y=async()=>{v.value=!0;try{const a=await m({product_id:p.value});_({url:`/packages/pages/points_order_detail/points_order_detail?order_id=${a.order_id}`})}finally{v.value=!1}};return e(a=>{p.value=Number(a.product_id||0),(async()=>{const a=await f({product_id:p.value});Object.assign(b,a)})()}),(a,s)=>{const t=o,e=r("u-button");return u(),d(t,{class:"points-order"},{default:l(()=>[c(t,{class:"card"},{default:l(()=>[c(t,{class:"title"},{default:l(()=>[n("确认订单")]),_:1}),c(t,{class:"product"},{default:l(()=>[c(t,null,{default:l(()=>[c(t,{class:"name"},{default:l(()=>[n(i(b.name),1)]),_:1}),c(t,{class:"desc"},{default:l(()=>[n("到账积分:"+i(b.points),1)]),_:1})]),_:1}),c(t,{class:"amount"},{default:l(()=>[n("¥"+i(b.amount),1)]),_:1})]),_:1})]),_:1}),c(t,{class:"submit"},{default:l(()=>[c(e,{loading:v.value,type:"primary",shape:"circle",onClick:y},{default:l(()=>[n("提交订单")]),_:1},8,["loading"])]),_:1})]),_:1})}}}),[["__scopeId","data-v-18c0ce5e"]]);export{v as default};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{d as a,r as s,J as e,b as t,f as l,c as o,w as d,k as r,P as u,o as _,l as c,t as n,v as i,q as p,D as f,_ as h}from"./index-Becg0v_n.js";import{c as w}from"./points.mwwYRoCN.js";const y=h(a({__name:"points_order_detail",setup(a){const h=s(0),y=e({}),m=e({showPay:!1,showCheck:!1,redirect:"/packages/pages/points_order_detail/points_order_detail"}),k=async()=>{const a=await w({order_id:h.value});Object.assign(y,a)},v=async()=>{m.showPay=!1,m.showCheck=!1,await k(),uni.$u.toast("支付成功")},C=()=>{uni.$u.toast("支付失败")};return t(a=>{h.value=Number(a.order_id||0),m.redirect=`/packages/pages/points_order_detail/points_order_detail?order_id=${h.value}`}),l(()=>{h.value&&k()}),(a,s)=>{const e=r,t=p,l=u("u-button"),w=u("payment");return _(),o(e,{class:"points-detail"},{default:d(()=>[c(e,{class:"card"},{default:d(()=>[c(e,{class:"status"},{default:d(()=>[n(i(y.pay_status_text),1)]),_:1}),c(e,{class:"row"},{default:d(()=>[c(t,null,{default:d(()=>[n("订单编号")]),_:1}),c(t,null,{default:d(()=>[n(i(y.sn),1)]),_:1})]),_:1}),c(e,{class:"row"},{default:d(()=>[c(t,null,{default:d(()=>[n("积分套餐")]),_:1}),c(t,null,{default:d(()=>[n(i(y.product_name),1)]),_:1})]),_:1}),c(e,{class:"row"},{default:d(()=>[c(t,null,{default:d(()=>[n("到账积分")]),_:1}),c(t,null,{default:d(()=>[n(i(y.points),1)]),_:1})]),_:1}),c(e,{class:"row"},{default:d(()=>[c(t,null,{default:d(()=>[n("支付金额")]),_:1}),c(t,{class:"amount"},{default:d(()=>[n("¥"+i(y.order_amount),1)]),_:1})]),_:1}),y.pay_time?(_(),o(e,{key:0,class:"row"},{default:d(()=>[c(t,null,{default:d(()=>[n("支付时间")]),_:1}),c(t,null,{default:d(()=>[n(i(y.pay_time),1)]),_:1})]),_:1})):f("",!0)]),_:1}),0===y.pay_status?(_(),o(e,{key:0,class:"pay-card"},{default:d(()=>[c(e,{class:"pay-title"},{default:d(()=>[n("请选择支付方式")]),_:1}),c(e,{class:"pay-tips"},{default:d(()=>[n("支持支付宝、微信支付;使用币支付入口预留中")]),_:1}),c(l,{type:"primary",shape:"circle",onClick:s[0]||(s[0]=a=>m.showPay=!0)},{default:d(()=>[n("立即支付")]),_:1})]),_:1})):f("",!0),c(w,{show:m.showPay,"onUpdate:show":s[1]||(s[1]=a=>m.showPay=a),"show-check":m.showCheck,"onUpdate:showCheck":s[2]||(s[2]=a=>m.showCheck=a),"order-id":h.value,from:"points_order",redirect:m.redirect,onSuccess:v,onFail:C},null,8,["show","show-check","order-id","redirect"])]),_:1})}}}),[["__scopeId","data-v-98326827"]]);export{y as default};
|
||||
import{d as a,r as s,J as e,b as t,f as l,c as o,w as d,k as r,P as u,o as _,l as c,t as n,v as i,q as p,D as f,_ as h}from"./index-gD80NK0s.js";import{c as w}from"./points.DvWPN6Un.js";const y=h(a({__name:"points_order_detail",setup(a){const h=s(0),y=e({}),m=e({showPay:!1,showCheck:!1,redirect:"/packages/pages/points_order_detail/points_order_detail"}),k=async()=>{const a=await w({order_id:h.value});Object.assign(y,a)},v=async()=>{m.showPay=!1,m.showCheck=!1,await k(),uni.$u.toast("支付成功")},C=()=>{uni.$u.toast("支付失败")};return t(a=>{h.value=Number(a.order_id||0),m.redirect=`/packages/pages/points_order_detail/points_order_detail?order_id=${h.value}`}),l(()=>{h.value&&k()}),(a,s)=>{const e=r,t=p,l=u("u-button"),w=u("payment");return _(),o(e,{class:"points-detail"},{default:d(()=>[c(e,{class:"card"},{default:d(()=>[c(e,{class:"status"},{default:d(()=>[n(i(y.pay_status_text),1)]),_:1}),c(e,{class:"row"},{default:d(()=>[c(t,null,{default:d(()=>[n("订单编号")]),_:1}),c(t,null,{default:d(()=>[n(i(y.sn),1)]),_:1})]),_:1}),c(e,{class:"row"},{default:d(()=>[c(t,null,{default:d(()=>[n("积分套餐")]),_:1}),c(t,null,{default:d(()=>[n(i(y.product_name),1)]),_:1})]),_:1}),c(e,{class:"row"},{default:d(()=>[c(t,null,{default:d(()=>[n("到账积分")]),_:1}),c(t,null,{default:d(()=>[n(i(y.points),1)]),_:1})]),_:1}),c(e,{class:"row"},{default:d(()=>[c(t,null,{default:d(()=>[n("支付金额")]),_:1}),c(t,{class:"amount"},{default:d(()=>[n("¥"+i(y.order_amount),1)]),_:1})]),_:1}),y.pay_time?(_(),o(e,{key:0,class:"row"},{default:d(()=>[c(t,null,{default:d(()=>[n("支付时间")]),_:1}),c(t,null,{default:d(()=>[n(i(y.pay_time),1)]),_:1})]),_:1})):f("",!0)]),_:1}),0===y.pay_status?(_(),o(e,{key:0,class:"pay-card"},{default:d(()=>[c(e,{class:"pay-title"},{default:d(()=>[n("请选择支付方式")]),_:1}),c(e,{class:"pay-tips"},{default:d(()=>[n("支持支付宝、微信支付;使用币支付入口预留中")]),_:1}),c(l,{type:"primary",shape:"circle",onClick:s[0]||(s[0]=a=>m.showPay=!0)},{default:d(()=>[n("立即支付")]),_:1})]),_:1})):f("",!0),c(w,{show:m.showPay,"onUpdate:show":s[1]||(s[1]=a=>m.showPay=a),"show-check":m.showCheck,"onUpdate:showCheck":s[2]||(s[2]=a=>m.showCheck=a),"order-id":h.value,from:"points_order",redirect:m.redirect,onSuccess:v,onFail:C},null,8,["show","show-check","order-id","redirect"])]),_:1})}}}),[["__scopeId","data-v-98326827"]]);export{y as default};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{d as a,u as e,I as s,r as l,J as o,G as t,f as _,c as d,w as r,M as p,k as u,P as c,o as i,l as n,q as f,t as m,v,x as h,F as k,y as w,z as y,D as g,Q as b,b9 as I,e as C,_ as x}from"./index-Becg0v_n.js";import{p as $,a as z}from"./points.mwwYRoCN.js";const U=x(a({__name:"points_products",setup(a){const x=e(),{userInfo:U}=s(x),j=l([]),D=l(0),S=l(!1),q=l(0),F=l(!1),G=o({show:!1,showCheck:!1,orderId:0,from:"points_order"}),J=t(()=>j.value.find(a=>a.id===q.value)||null),M=async()=>{try{const a=await p.get({url:"/community/userStats"},{isTransformResponse:!1});1===(null==a?void 0:a.code)&&a.data&&(D.value=a.data.user_points||0)}catch(a){}},P=async()=>{if(J.value&&!F.value){F.value=!0;try{const a=await z({product_id:J.value.id});G.orderId=a.order_id,G.from=a.from,G.show=!0}catch(a){uni.$u.toast((null==a?void 0:a.msg)||"下单失败")}finally{F.value=!1}}},Q=()=>{uni.$u.toast("支付成功"),M(),I({url:`/packages/pages/points_order_detail/points_order_detail?order_id=${G.orderId}`})},R=()=>{G.orderId&&C({url:`/packages/pages/points_order_detail/points_order_detail?order_id=${G.orderId}`})};return _(()=>{(async()=>{S.value=!0;try{const a=await $();j.value=a||[]}finally{S.value=!1}})(),M(),x.getUser(),q.value=0,G.show=!1,G.orderId=0}),(a,e)=>{const s=f,l=u,o=c("u-icon"),t=c("u-loading"),_=c("payment");return i(),d(l,{class:"pp"},{default:r(()=>[n(l,{class:"pp-header"},{default:r(()=>[n(l,{class:"pp-header__row"},{default:r(()=>[n(s,{class:"pp-header__label"},{default:r(()=>[m("当前积分")]),_:1}),n(s,{class:"pp-header__value"},{default:r(()=>[m(v(D.value),1)]),_:1})]),_:1})]),_:1}),n(l,{class:"pp-section"},{default:r(()=>[n(l,{class:"pp-section__title"},{default:r(()=>[m("选择积分套餐")]),_:1}),n(l,{class:"pp-grid"},{default:r(()=>[(i(!0),h(k,null,w(j.value,a=>(i(),d(l,{key:a.id,class:y(["pp-grid__item",{"pp-grid__item--active":q.value===a.id}]),onClick:e=>(a=>{q.value!==a.id&&(q.value=a.id)})(a)},{default:r(()=>[n(s,{class:"pp-grid__points"},{default:r(()=>[m(v(a.points),1)]),_:2},1024),n(s,{class:"pp-grid__unit"},{default:r(()=>[m("积分")]),_:1}),n(s,{class:"pp-grid__price"},{default:r(()=>[m("¥"+v(a.amount),1)]),_:2},1024),q.value===a.id?(i(),d(l,{key:0,class:"pp-grid__check"},{default:r(()=>[n(o,{name:"checkbox-mark",color:"#fff",size:"20"})]),_:1})):g("",!0)]),_:2},1032,["class","onClick"]))),128))]),_:1})]),_:1}),J.value?(i(),d(l,{key:0,class:"pp-section"},{default:r(()=>[n(l,{class:"pp-section__title"},{default:r(()=>[m("订单确认")]),_:1}),n(l,{class:"pp-confirm"},{default:r(()=>[n(l,{class:"pp-confirm__row"},{default:r(()=>[n(s,{class:"pp-confirm__label"},{default:r(()=>[m("商品名称")]),_:1}),n(s,{class:"pp-confirm__value"},{default:r(()=>[m(v(J.value.name),1)]),_:1})]),_:1}),n(l,{class:"pp-confirm__row"},{default:r(()=>[n(s,{class:"pp-confirm__label"},{default:r(()=>[m("积分数量")]),_:1}),n(s,{class:"pp-confirm__value"},{default:r(()=>[m(v(J.value.points)+" 积分",1)]),_:1})]),_:1}),n(l,{class:"pp-confirm__row"},{default:r(()=>[n(s,{class:"pp-confirm__label"},{default:r(()=>[m("支付金额")]),_:1}),n(s,{class:"pp-confirm__value pp-confirm__value--price"},{default:r(()=>[m("¥"+v(J.value.amount),1)]),_:1})]),_:1}),n(l,{class:"pp-confirm__row"},{default:r(()=>[n(s,{class:"pp-confirm__label"},{default:r(()=>[m("充值账号")]),_:1}),n(s,{class:"pp-confirm__value"},{default:r(()=>[m(v(b(U).nickname)+" (ID: "+v(b(U).sn)+")",1)]),_:1})]),_:1})]),_:1})]),_:1})):g("",!0),j.value.length||S.value?g("",!0):(i(),d(l,{key:1,class:"pp-empty"},{default:r(()=>[n(s,null,{default:r(()=>[m("暂无积分套餐")]),_:1})]),_:1})),q.value?(i(),d(l,{key:2,class:"pp-bottom"},{default:r(()=>[n(l,{class:"pp-bottom__left"},{default:r(()=>[n(s,{class:"pp-bottom__total"},{default:r(()=>{var a;return[m("¥"+v((null==(a=J.value)?void 0:a.amount)||"0.00"),1)]}),_:1})]),_:1}),n(l,{class:y(["pp-bottom__btn",{"pp-bottom__btn--disabled":F.value}]),onClick:P},{default:r(()=>[F.value?(i(),d(t,{key:1,color:"#fff",size:"36"})):(i(),d(s,{key:0},{default:r(()=>[m("确认支付")]),_:1}))]),_:1},8,["class"])]),_:1})):g("",!0),n(_,{show:G.show,"onUpdate:show":e[0]||(e[0]=a=>G.show=a),showCheck:G.showCheck,"onUpdate:showCheck":e[1]||(e[1]=a=>G.showCheck=a),orderId:G.orderId,from:G.from,redirect:"/packages/pages/points_order_detail/points_order_detail",onSuccess:Q,onClose:R},null,8,["show","showCheck","orderId","from"])]),_:1})}}}),[["__scopeId","data-v-78db5d91"]]);export{U as default};
|
||||
import{d as a,u as e,I as s,r as l,J as o,G as t,f as _,c as d,w as r,M as p,k as u,P as c,o as i,l as n,q as f,t as m,v,x as h,F as k,y as w,z as y,D as g,Q as b,b9 as I,e as C,_ as x}from"./index-gD80NK0s.js";import{p as $,a as z}from"./points.DvWPN6Un.js";const U=x(a({__name:"points_products",setup(a){const x=e(),{userInfo:U}=s(x),j=l([]),D=l(0),S=l(!1),q=l(0),F=l(!1),G=o({show:!1,showCheck:!1,orderId:0,from:"points_order"}),J=t(()=>j.value.find(a=>a.id===q.value)||null),M=async()=>{try{const a=await p.get({url:"/community/userStats"},{isTransformResponse:!1});1===(null==a?void 0:a.code)&&a.data&&(D.value=a.data.user_points||0)}catch(a){}},P=async()=>{if(J.value&&!F.value){F.value=!0;try{const a=await z({product_id:J.value.id});G.orderId=a.order_id,G.from=a.from,G.show=!0}catch(a){uni.$u.toast((null==a?void 0:a.msg)||"下单失败")}finally{F.value=!1}}},Q=()=>{uni.$u.toast("支付成功"),M(),I({url:`/packages/pages/points_order_detail/points_order_detail?order_id=${G.orderId}`})},R=()=>{G.orderId&&C({url:`/packages/pages/points_order_detail/points_order_detail?order_id=${G.orderId}`})};return _(()=>{(async()=>{S.value=!0;try{const a=await $();j.value=a||[]}finally{S.value=!1}})(),M(),x.getUser(),q.value=0,G.show=!1,G.orderId=0}),(a,e)=>{const s=f,l=u,o=c("u-icon"),t=c("u-loading"),_=c("payment");return i(),d(l,{class:"pp"},{default:r(()=>[n(l,{class:"pp-header"},{default:r(()=>[n(l,{class:"pp-header__row"},{default:r(()=>[n(s,{class:"pp-header__label"},{default:r(()=>[m("当前积分")]),_:1}),n(s,{class:"pp-header__value"},{default:r(()=>[m(v(D.value),1)]),_:1})]),_:1})]),_:1}),n(l,{class:"pp-section"},{default:r(()=>[n(l,{class:"pp-section__title"},{default:r(()=>[m("选择积分套餐")]),_:1}),n(l,{class:"pp-grid"},{default:r(()=>[(i(!0),h(k,null,w(j.value,a=>(i(),d(l,{key:a.id,class:y(["pp-grid__item",{"pp-grid__item--active":q.value===a.id}]),onClick:e=>(a=>{q.value!==a.id&&(q.value=a.id)})(a)},{default:r(()=>[n(s,{class:"pp-grid__points"},{default:r(()=>[m(v(a.points),1)]),_:2},1024),n(s,{class:"pp-grid__unit"},{default:r(()=>[m("积分")]),_:1}),n(s,{class:"pp-grid__price"},{default:r(()=>[m("¥"+v(a.amount),1)]),_:2},1024),q.value===a.id?(i(),d(l,{key:0,class:"pp-grid__check"},{default:r(()=>[n(o,{name:"checkbox-mark",color:"#fff",size:"20"})]),_:1})):g("",!0)]),_:2},1032,["class","onClick"]))),128))]),_:1})]),_:1}),J.value?(i(),d(l,{key:0,class:"pp-section"},{default:r(()=>[n(l,{class:"pp-section__title"},{default:r(()=>[m("订单确认")]),_:1}),n(l,{class:"pp-confirm"},{default:r(()=>[n(l,{class:"pp-confirm__row"},{default:r(()=>[n(s,{class:"pp-confirm__label"},{default:r(()=>[m("商品名称")]),_:1}),n(s,{class:"pp-confirm__value"},{default:r(()=>[m(v(J.value.name),1)]),_:1})]),_:1}),n(l,{class:"pp-confirm__row"},{default:r(()=>[n(s,{class:"pp-confirm__label"},{default:r(()=>[m("积分数量")]),_:1}),n(s,{class:"pp-confirm__value"},{default:r(()=>[m(v(J.value.points)+" 积分",1)]),_:1})]),_:1}),n(l,{class:"pp-confirm__row"},{default:r(()=>[n(s,{class:"pp-confirm__label"},{default:r(()=>[m("支付金额")]),_:1}),n(s,{class:"pp-confirm__value pp-confirm__value--price"},{default:r(()=>[m("¥"+v(J.value.amount),1)]),_:1})]),_:1}),n(l,{class:"pp-confirm__row"},{default:r(()=>[n(s,{class:"pp-confirm__label"},{default:r(()=>[m("充值账号")]),_:1}),n(s,{class:"pp-confirm__value"},{default:r(()=>[m(v(b(U).nickname)+" (ID: "+v(b(U).sn)+")",1)]),_:1})]),_:1})]),_:1})]),_:1})):g("",!0),j.value.length||S.value?g("",!0):(i(),d(l,{key:1,class:"pp-empty"},{default:r(()=>[n(s,null,{default:r(()=>[m("暂无积分套餐")]),_:1})]),_:1})),q.value?(i(),d(l,{key:2,class:"pp-bottom"},{default:r(()=>[n(l,{class:"pp-bottom__left"},{default:r(()=>[n(s,{class:"pp-bottom__total"},{default:r(()=>{var a;return[m("¥"+v((null==(a=J.value)?void 0:a.amount)||"0.00"),1)]}),_:1})]),_:1}),n(l,{class:y(["pp-bottom__btn",{"pp-bottom__btn--disabled":F.value}]),onClick:P},{default:r(()=>[F.value?(i(),d(t,{key:1,color:"#fff",size:"36"})):(i(),d(s,{key:0},{default:r(()=>[m("确认支付")]),_:1}))]),_:1},8,["class"])]),_:1})):g("",!0),n(_,{show:G.show,"onUpdate:show":e[0]||(e[0]=a=>G.show=a),showCheck:G.showCheck,"onUpdate:showCheck":e[1]||(e[1]=a=>G.showCheck=a),orderId:G.orderId,from:G.from,redirect:"/packages/pages/points_order_detail/points_order_detail",onSuccess:Q,onClose:R},null,8,["show","showCheck","orderId","from"])]),_:1})}}}),[["__scopeId","data-v-78db5d91"]]);export{U as default};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{d as e,r as a,J as r,b as s,f as t,x as o,l,w as c,F as u,P as d,k as n,o as i,t as m,aB as h,q as p,v as f,Q as y,ae as g,e as _}from"./index-Becg0v_n.js";import{r as x,a as w}from"./recharge.JdiuEq7x.js";import{u as k}from"./useLockFn.Ba2tGmTB.js";const b=e({__name:"recharge",setup(e){const b=a(""),v=r({orderId:"",from:"",showPay:!1,showCheck:!1,redirect:"/packages/pages/recharge/recharge"}),C=r({user_money:"",min_amount:0}),{isLock:$,lockFn:P}=k(async()=>{const e=C.min_amount;if(!b.value)return uni.$u.toast("请输入充值金额");if(0==e&&Number(b.value)==e)return uni.$u.toast("充值金额必须大于0");if(Number(b.value)<e)return uni.$u.toast(`最低充值金额${e}`);const a=await w({money:b.value});v.orderId=a.order_id,v.from=a.from,v.showPay=!0}),j=async()=>{v.showPay=!1,v.showCheck=!1,_({url:`/pages/payment_result/payment_result?id=${v.orderId}&from=${v.from}`})},I=async()=>{uni.$u.toast("支付失败")};return s(e=>{(null==e?void 0:e.checkPay)&&(v.orderId=e.id,v.from=e.from,v.showCheck=!0)}),t(()=>{(async()=>{const e=await x();Object.assign(C,e)})()}),(e,a)=>{const r=d("page-meta"),s=n,t=h,_=p,x=d("u-button"),w=g,k=d("payment");return i(),o(u,null,[l(r,{"page-style":e.$theme.pageStyle},null,8,["page-style"]),l(s,{class:"recharge p-[20rpx]"},{default:c(()=>[l(s,{class:"bg-white rounded-[14rpx] p-[40rpx]"},{default:c(()=>[l(s,{class:"text-content"},{default:c(()=>[m("充值金额")]),_:1}),l(s,{class:"border-0 border-b border-solid border-light"},{default:c(()=>[l(t,{modelValue:b.value,"onUpdate:modelValue":a[0]||(a[0]=e=>b.value=e),class:"text-[60rpx] h-[60rpx] py-[24rpx]",placeholder:"0.00",type:"digit"},null,8,["modelValue"])]),_:1}),l(s,{class:"mt-[20rpx] text-xs text-muted"},{default:c(()=>[m(" 当前可用余额 "),l(_,{class:"text-primary"},{default:c(()=>[m(f(C.user_money),1)]),_:1})]),_:1})]),_:1}),l(s,{class:"mt-[40rpx]"},{default:c(()=>[l(x,{loading:y($),type:"primary",shape:"circle",onClick:y(P)},{default:c(()=>[m(" 立即充值 ")]),_:1},8,["loading","onClick"])]),_:1}),l(s,{class:"flex justify-center m-[60rpx]"},{default:c(()=>[l(w,{url:"/packages/pages/recharge_record/recharge_record","hover-class":"none"},{default:c(()=>[l(_,{class:"text-content text-sm"},{default:c(()=>[m("充值记录")]),_:1})]),_:1})]),_:1}),l(k,{show:v.showPay,"onUpdate:show":a[1]||(a[1]=e=>v.showPay=e),"show-check":v.showCheck,"onUpdate:showCheck":a[2]||(a[2]=e=>v.showCheck=e),"order-id":v.orderId,from:v.from,redirect:v.redirect,onSuccess:j,onFail:I},null,8,["show","show-check","order-id","from","redirect"])]),_:1})],64)}}});export{b as default};
|
||||
import{d as e,r as a,J as r,b as s,f as t,x as o,l,w as c,F as u,P as d,k as n,o as i,t as m,aB as h,q as p,v as f,Q as y,ae as g,e as _}from"./index-gD80NK0s.js";import{r as x,a as w}from"./recharge.rAzkbKbG.js";import{u as k}from"./useLockFn.C1IWlALv.js";const b=e({__name:"recharge",setup(e){const b=a(""),v=r({orderId:"",from:"",showPay:!1,showCheck:!1,redirect:"/packages/pages/recharge/recharge"}),C=r({user_money:"",min_amount:0}),{isLock:$,lockFn:P}=k(async()=>{const e=C.min_amount;if(!b.value)return uni.$u.toast("请输入充值金额");if(0==e&&Number(b.value)==e)return uni.$u.toast("充值金额必须大于0");if(Number(b.value)<e)return uni.$u.toast(`最低充值金额${e}`);const a=await w({money:b.value});v.orderId=a.order_id,v.from=a.from,v.showPay=!0}),j=async()=>{v.showPay=!1,v.showCheck=!1,_({url:`/pages/payment_result/payment_result?id=${v.orderId}&from=${v.from}`})},I=async()=>{uni.$u.toast("支付失败")};return s(e=>{(null==e?void 0:e.checkPay)&&(v.orderId=e.id,v.from=e.from,v.showCheck=!0)}),t(()=>{(async()=>{const e=await x();Object.assign(C,e)})()}),(e,a)=>{const r=d("page-meta"),s=n,t=h,_=p,x=d("u-button"),w=g,k=d("payment");return i(),o(u,null,[l(r,{"page-style":e.$theme.pageStyle},null,8,["page-style"]),l(s,{class:"recharge p-[20rpx]"},{default:c(()=>[l(s,{class:"bg-white rounded-[14rpx] p-[40rpx]"},{default:c(()=>[l(s,{class:"text-content"},{default:c(()=>[m("充值金额")]),_:1}),l(s,{class:"border-0 border-b border-solid border-light"},{default:c(()=>[l(t,{modelValue:b.value,"onUpdate:modelValue":a[0]||(a[0]=e=>b.value=e),class:"text-[60rpx] h-[60rpx] py-[24rpx]",placeholder:"0.00",type:"digit"},null,8,["modelValue"])]),_:1}),l(s,{class:"mt-[20rpx] text-xs text-muted"},{default:c(()=>[m(" 当前可用余额 "),l(_,{class:"text-primary"},{default:c(()=>[m(f(C.user_money),1)]),_:1})]),_:1})]),_:1}),l(s,{class:"mt-[40rpx]"},{default:c(()=>[l(x,{loading:y($),type:"primary",shape:"circle",onClick:y(P)},{default:c(()=>[m(" 立即充值 ")]),_:1},8,["loading","onClick"])]),_:1}),l(s,{class:"flex justify-center m-[60rpx]"},{default:c(()=>[l(w,{url:"/packages/pages/recharge_record/recharge_record","hover-class":"none"},{default:c(()=>[l(_,{class:"text-content text-sm"},{default:c(()=>[m("充值记录")]),_:1})]),_:1})]),_:1}),l(k,{show:v.showPay,"onUpdate:show":a[1]||(a[1]=e=>v.showPay=e),"show-check":v.showCheck,"onUpdate:showCheck":a[2]||(a[2]=e=>v.showCheck=e),"order-id":v.orderId,from:v.from,redirect:v.redirect,onSuccess:j,onFail:I},null,8,["show","show-check","order-id","from","redirect"])]),_:1})],64)}}});export{b as default};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{d as e,a2 as a,r as t,x as s,l,w as r,F as o,P as u,o as d,k as p,y as c,c as n,t as m,v as i}from"./index-Becg0v_n.js";import{b as g}from"./recharge.JdiuEq7x.js";const _=e({__name:"recharge_record",setup(e){const _=a(),f=t([]),y=async(e,a)=>{try{const t=await g({page_no:e,page_size:a});_.value.complete(t.lists)}catch(t){_.value.complete(!1)}};return(e,a)=>{const t=u("page-meta"),g=p,x=u("z-paging");return d(),s(o,null,[l(t,{"page-style":e.$theme.pageStyle},null,8,["page-style"]),l(x,{ref_key:"paging",ref:_,modelValue:f.value,"onUpdate:modelValue":a[0]||(a[0]=e=>f.value=e),onQuery:y,"show-loading-more-when-reload":!0},{default:r(()=>[l(g,{class:"pt-2.5"},{default:r(()=>[(d(!0),s(o,null,c(f.value,e=>(d(),n(g,{key:e.id,class:"bg-white border-solid border-b border-0 border-light px-[26rpx] py-[24rpx]"},{default:r(()=>[l(g,{class:"flex justify-between"},{default:r(()=>[l(g,{class:"mr-2"},{default:r(()=>[m(i(e.tips),1)]),_:2},1024),l(g,{class:"text-lg text-primary"},{default:r(()=>[m(" +"+i(e.order_amount),1)]),_:2},1024)]),_:2},1024),l(g,{class:"text-sm text-muted mr-1"},{default:r(()=>[m(i(e.create_time),1)]),_:2},1024)]),_:2},1024))),128))]),_:1})]),_:1},8,["modelValue"])],64)}}});export{_ as default};
|
||||
import{d as e,a2 as a,r as t,x as s,l,w as r,F as o,P as u,o as d,k as p,y as c,c as n,t as m,v as i}from"./index-gD80NK0s.js";import{b as g}from"./recharge.rAzkbKbG.js";const _=e({__name:"recharge_record",setup(e){const _=a(),f=t([]),y=async(e,a)=>{try{const t=await g({page_no:e,page_size:a});_.value.complete(t.lists)}catch(t){_.value.complete(!1)}};return(e,a)=>{const t=u("page-meta"),g=p,x=u("z-paging");return d(),s(o,null,[l(t,{"page-style":e.$theme.pageStyle},null,8,["page-style"]),l(x,{ref_key:"paging",ref:_,modelValue:f.value,"onUpdate:modelValue":a[0]||(a[0]=e=>f.value=e),onQuery:y,"show-loading-more-when-reload":!0},{default:r(()=>[l(g,{class:"pt-2.5"},{default:r(()=>[(d(!0),s(o,null,c(f.value,e=>(d(),n(g,{key:e.id,class:"bg-white border-solid border-b border-0 border-light px-[26rpx] py-[24rpx]"},{default:r(()=>[l(g,{class:"flex justify-between"},{default:r(()=>[l(g,{class:"mr-2"},{default:r(()=>[m(i(e.tips),1)]),_:2},1024),l(g,{class:"text-lg text-primary"},{default:r(()=>[m(" +"+i(e.order_amount),1)]),_:2},1024)]),_:2},1024),l(g,{class:"text-sm text-muted mr-1"},{default:r(()=>[m(i(e.create_time),1)]),_:2},1024)]),_:2},1024))),128))]),_:1})]),_:1},8,["modelValue"])],64)}}});export{_ as default};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{d as e,r as a,a2 as l,f as t,x as s,l as u,w as _,F as d,P as r,o as c,k as o,t as n,v as m,q as f,y as i,c as p,z as w,D as v,b8 as x,_ as y}from"./index-Becg0v_n.js";import{r as h}from"./recharge.JdiuEq7x.js";const b=y(e({__name:"user_wallet",setup(e){const y=a([{name:"全部",type:""},{name:"收入",type:1},{name:"支出",type:2}]),b=l(),g=a([]),k=a(0),j=async(e,a)=>{try{const l=y.value[k.value].type,t=await x({action:l,type:"um",page_no:e,page_size:a});b.value.complete(t.lists)}catch(l){b.value.complete(!1)}},z=a({});return t(()=>{(async()=>{z.value=await h()})()}),(e,a)=>{const l=r("page-meta"),t=o,x=f,h=r("z-paging");return c(),s(d,null,[u(l,{"page-style":"background-color: #005fff"}),u(h,{ref_key:"paging",ref:b,modelValue:g.value,"onUpdate:modelValue":a[0]||(a[0]=e=>g.value=e),onQuery:j,"show-loading-more-when-reload":!0},{default:_(()=>[u(t,{class:"user-wallet"},{default:_(()=>[u(t,{class:"wallet-header"},{default:_(()=>[u(t,{class:"wallet-header__card"},{default:_(()=>[u(t,{class:"wallet-header__label"},{default:_(()=>[n("钱包余额")]),_:1}),u(t,{class:"wallet-header__amount"},{default:_(()=>[n(m(z.value.user_money||"0.00"),1)]),_:1}),u(t,{class:"wallet-header__row"},{default:_(()=>[u(t,{class:"wallet-header__item"},{default:_(()=>[u(x,{class:"wallet-header__item-label"},{default:_(()=>[n("总收益")]),_:1}),u(x,{class:"wallet-header__item-value"},{default:_(()=>[n(m(z.value.total_income||"0.00"),1)]),_:1})]),_:1}),u(t,{class:"wallet-header__item"},{default:_(()=>[u(x,{class:"wallet-header__item-label"},{default:_(()=>[n("佣金比例")]),_:1}),u(x,{class:"wallet-header__item-value"},{default:_(()=>[n(m(z.value.commission_rate||"0")+"%",1)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1}),u(t,{class:"wallet-card"},{default:_(()=>[u(t,{class:"wallet-tabs"},{default:_(()=>[(c(!0),s(d,null,i(y.value,(e,a)=>(c(),p(t,{key:a,class:w(["wallet-tabs__item",{"wallet-tabs__item--active":k.value===a}]),onClick:e=>{return l=a,k.value=l,void b.value.reload();var l}},{default:_(()=>[u(x,null,{default:_(()=>[n(m(e.name),1)]),_:2},1024)]),_:2},1032,["class","onClick"]))),128))]),_:1}),(c(!0),s(d,null,i(g.value,e=>(c(),p(t,{key:e.id,class:"border-solid border-b border-0 border-light px-[26rpx] py-[24rpx]"},{default:_(()=>[u(t,{class:"flex justify-between items-start"},{default:_(()=>[u(t,null,{default:_(()=>[u(t,{class:"text-[28rpx] font-medium"},{default:_(()=>[n(m(e.type_desc),1)]),_:2},1024),u(t,{class:"text-[24rpx] text-muted mt-[6rpx]"},{default:_(()=>[n(m(e.create_time),1)]),_:2},1024)]),_:2},1024),u(t,{class:"text-right"},{default:_(()=>[u(t,{class:w(["text-[32rpx] font-bold",1==e.action?"text-primary":"text-[#333]"])},{default:_(()=>[n(m(e.change_amount_desc),1)]),_:2},1032,["class"]),void 0!==e.left_amount?(c(),p(t,{key:0,class:"text-[22rpx] text-muted mt-[4rpx]"},{default:_(()=>[n(" 剩余 "+m(e.left_amount),1)]),_:2},1024)):v("",!0)]),_:2},1024)]),_:2},1024)]),_:2},1024))),128))]),_:1})]),_:1})]),_:1},8,["modelValue"])],64)}}}),[["__scopeId","data-v-3e29e595"]]);export{b as default};
|
||||
import{d as e,r as a,a2 as l,f as t,x as s,l as u,w as _,F as d,P as r,o as c,k as o,t as n,v as m,q as f,y as i,c as p,z as w,D as v,b8 as x,_ as y}from"./index-gD80NK0s.js";import{r as h}from"./recharge.rAzkbKbG.js";const b=y(e({__name:"user_wallet",setup(e){const y=a([{name:"全部",type:""},{name:"收入",type:1},{name:"支出",type:2}]),b=l(),g=a([]),k=a(0),j=async(e,a)=>{try{const l=y.value[k.value].type,t=await x({action:l,type:"um",page_no:e,page_size:a});b.value.complete(t.lists)}catch(l){b.value.complete(!1)}},z=a({});return t(()=>{(async()=>{z.value=await h()})()}),(e,a)=>{const l=r("page-meta"),t=o,x=f,h=r("z-paging");return c(),s(d,null,[u(l,{"page-style":"background-color: #005fff"}),u(h,{ref_key:"paging",ref:b,modelValue:g.value,"onUpdate:modelValue":a[0]||(a[0]=e=>g.value=e),onQuery:j,"show-loading-more-when-reload":!0},{default:_(()=>[u(t,{class:"user-wallet"},{default:_(()=>[u(t,{class:"wallet-header"},{default:_(()=>[u(t,{class:"wallet-header__card"},{default:_(()=>[u(t,{class:"wallet-header__label"},{default:_(()=>[n("钱包余额")]),_:1}),u(t,{class:"wallet-header__amount"},{default:_(()=>[n(m(z.value.user_money||"0.00"),1)]),_:1}),u(t,{class:"wallet-header__row"},{default:_(()=>[u(t,{class:"wallet-header__item"},{default:_(()=>[u(x,{class:"wallet-header__item-label"},{default:_(()=>[n("总收益")]),_:1}),u(x,{class:"wallet-header__item-value"},{default:_(()=>[n(m(z.value.total_income||"0.00"),1)]),_:1})]),_:1}),u(t,{class:"wallet-header__item"},{default:_(()=>[u(x,{class:"wallet-header__item-label"},{default:_(()=>[n("佣金比例")]),_:1}),u(x,{class:"wallet-header__item-value"},{default:_(()=>[n(m(z.value.commission_rate||"0")+"%",1)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1}),u(t,{class:"wallet-card"},{default:_(()=>[u(t,{class:"wallet-tabs"},{default:_(()=>[(c(!0),s(d,null,i(y.value,(e,a)=>(c(),p(t,{key:a,class:w(["wallet-tabs__item",{"wallet-tabs__item--active":k.value===a}]),onClick:e=>{return l=a,k.value=l,void b.value.reload();var l}},{default:_(()=>[u(x,null,{default:_(()=>[n(m(e.name),1)]),_:2},1024)]),_:2},1032,["class","onClick"]))),128))]),_:1}),(c(!0),s(d,null,i(g.value,e=>(c(),p(t,{key:e.id,class:"border-solid border-b border-0 border-light px-[26rpx] py-[24rpx]"},{default:_(()=>[u(t,{class:"flex justify-between items-start"},{default:_(()=>[u(t,null,{default:_(()=>[u(t,{class:"text-[28rpx] font-medium"},{default:_(()=>[n(m(e.type_desc),1)]),_:2},1024),u(t,{class:"text-[24rpx] text-muted mt-[6rpx]"},{default:_(()=>[n(m(e.create_time),1)]),_:2},1024)]),_:2},1024),u(t,{class:"text-right"},{default:_(()=>[u(t,{class:w(["text-[32rpx] font-bold",1==e.action?"text-primary":"text-[#333]"])},{default:_(()=>[n(m(e.change_amount_desc),1)]),_:2},1032,["class"]),void 0!==e.left_amount?(c(),p(t,{key:0,class:"text-[22rpx] text-muted mt-[4rpx]"},{default:_(()=>[n(" 剩余 "+m(e.left_amount),1)]),_:2},1024)):v("",!0)]),_:2},1024)]),_:2},1024)]),_:2},1024))),128))]),_:1})]),_:1})]),_:1},8,["modelValue"])],64)}}}),[["__scopeId","data-v-3e29e595"]]);export{b as default};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
import{d as a,r as e,J as s,G as l,ap as t,K as i,c as u,w as c,k as n,P as o,o as p,l as d,m as _,t as h,z as m,q as g,v as r,S as f,ao as b,x as v,F as y,y as k,p as x,D as C,ba as w,aB as V,a8 as j,a0 as z,av as F,L as T,e as I,j as q,aE as D,aD as P,_ as U}from"./index-gD80NK0s.js";import{d as B,h as E}from"./community.C9wEHP7Q.js";import"./aiRequest.br0QglYY.js";import"./ai.dzY7BI1V.js";const G=U(a({__name:"publish",setup(a){const U=e(0),G=e(500),H=e(!1),J=e([]),K=e([]),L=e(!1),O=e(""),R=s({content:"",images:[]}),S=l(()=>R.content.trim().length>0||R.images.length>0);t(()=>{const a=i();U.value=20,G.value=a.windowHeight-U.value-88,W()});const W=async()=>{try{const a=await B();J.value=a||[]}catch(a){}},A=()=>{j().length>1?z():F({url:"/pages/empty/empty"})},M=async()=>{if(T()){if(S.value&&!H.value){H.value=!0;try{if(L.value){const a=parseInt(O.value);if(!a||a<1||a>9999)return q({title:"积分价格范围1~9999",icon:"none"}),void(H.value=!1)}const a=[];for(const e of R.images)if(e.startsWith("http"))a.push(e);else{const s=T(),l=await D(e,s||"");(null==l?void 0:l.uri)&&a.push(l.uri)}await E({content:R.content,images:a,tag_ids:K.value,post_type:0,is_paid:L.value?1:0,price_points:L.value?parseInt(O.value):0}),q({title:"发布成功",icon:"success"}),setTimeout(()=>{j().length>1?z():F({url:"/pages/empty/empty"})},1200)}catch(a){q({title:"发布失败",icon:"none"})}finally{H.value=!1}}}else I({url:"/pages/login/login"})},N=()=>{const a=18-R.images.length;a<=0||P({count:a,sizeType:["compressed"],sourceType:["album","camera"],success:a=>{R.images.push(...a.tempFilePaths)}})};return(a,e)=>{const s=n,l=g,t=b,i=x,j=o("u-icon"),z=w,F=V,T=f;return p(),u(s,{class:"publish-page"},{default:c(()=>[d(s,{class:"publish-header",style:_({paddingTop:U.value+"px"})},{default:c(()=>[d(s,{class:"publish-header__left",onClick:A},{default:c(()=>[h("取消")]),_:1}),d(s,{class:"publish-header__title"},{default:c(()=>[h("发帖")]),_:1}),d(s,{class:"publish-header__right"},{default:c(()=>[d(s,{class:m(["publish-btn",{"publish-btn--disabled":!S.value||H.value}]),onClick:M},{default:c(()=>[d(l,null,{default:c(()=>[h(r(H.value?"发布中":"发布"),1)]),_:1})]),_:1},8,["class"])]),_:1})]),_:1},8,["style"]),d(T,{"scroll-y":"",class:"publish-scroll",style:_({height:G.value+"px"})},{default:c(()=>[d(s,{class:"publish-body"},{default:c(()=>[d(t,{modelValue:R.content,"onUpdate:modelValue":e[0]||(e[0]=a=>R.content=a),class:"publish-textarea",placeholder:"分享你的体育见解...",maxlength:2e3,"auto-height":""},null,8,["modelValue"]),d(s,{class:"publish-images"},{default:c(()=>[(p(!0),v(y,null,k(R.images.slice(0,R.images.length>=9?8:R.images.length),(a,e)=>(p(),u(s,{key:e,class:"publish-images__item"},{default:c(()=>[d(i,{src:a,mode:"aspectFill",class:"publish-images__img"},null,8,["src"]),d(s,{class:"publish-images__del",onClick:a=>(a=>{R.images.splice(a,1)})(e)},{default:c(()=>[d(j,{name:"close",size:"24",color:"#fff"})]),_:2},1032,["onClick"])]),_:2},1024))),128)),R.images.length>=9?(p(),u(s,{key:0,class:"publish-images__more",onClick:N},{default:c(()=>[d(i,{src:R.images[8],mode:"aspectFill",class:"publish-images__img"},null,8,["src"]),d(s,{class:"publish-images__more-mask"},{default:c(()=>[d(l,{class:"publish-images__more-text"},{default:c(()=>[h("+"+r(R.images.length-8),1)]),_:1}),d(l,{class:"publish-images__more-hint"},{default:c(()=>[h("点击继续添加")]),_:1})]),_:1})]),_:1})):C("",!0),R.images.length<9?(p(),u(s,{key:1,class:"publish-images__add",onClick:N},{default:c(()=>[d(j,{name:"plus",size:"52",color:"#ccc"})]),_:1})):C("",!0)]),_:1})]),_:1}),d(s,{class:"publish-paid"},{default:c(()=>[d(s,{class:"publish-paid__row"},{default:c(()=>[d(l,{class:"publish-paid__label"},{default:c(()=>[h("收费阅读")]),_:1}),d(z,{checked:L.value,onChange:e[1]||(e[1]=a=>L.value=a.detail.value),color:"#185dff"},null,8,["checked"])]),_:1}),L.value?(p(),u(s,{key:0,class:"publish-paid__price"},{default:c(()=>[d(l,{class:"publish-paid__label"},{default:c(()=>[h("积分价格")]),_:1}),d(F,{modelValue:O.value,"onUpdate:modelValue":e[2]||(e[2]=a=>O.value=a),type:"number",class:"publish-paid__input",placeholder:"输入积分(1~9999)"},null,8,["modelValue"])]),_:1})):C("",!0)]),_:1}),d(s,{class:"publish-tags"},{default:c(()=>[d(s,{class:"publish-tags__label"},{default:c(()=>[d(l,null,{default:c(()=>[h("选择标签")]),_:1})]),_:1}),d(s,{class:"publish-tags__list"},{default:c(()=>[(p(!0),v(y,null,k(J.value,a=>(p(),u(s,{key:a.id,class:m(["publish-tags__item",{"publish-tags__item--active":K.value.includes(a.id)}]),onClick:e=>(a=>{const e=K.value.indexOf(a);if(e>=0)K.value.splice(e,1);else{if(K.value.length>=3)return void q({title:"最多选择3个标签",icon:"none"});K.value.push(a)}})(a.id)},{default:c(()=>[d(l,null,{default:c(()=>[h("#"+r(a.name),1)]),_:2},1024)]),_:2},1032,["class","onClick"]))),128))]),_:1})]),_:1})]),_:1},8,["style"])]),_:1})}}}),[["__scopeId","data-v-4fd73ce8"]]);export{G as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{d as a,r as e,J as s,G as l,ap as t,K as i,c as u,w as c,k as n,P as o,o as p,l as d,m as _,t as h,z as m,q as g,v as r,S as f,ao as b,x as v,F as y,y as k,p as x,D as C,ba as w,aB as V,a8 as j,a0 as z,av as F,L as T,e as I,j as q,aE as D,aD as P,_ as U}from"./index-Becg0v_n.js";import{d as B,h as E}from"./community.DYAFKSiZ.js";import"./aiRequest.br0QglYY.js";const G=U(a({__name:"publish",setup(a){const U=e(0),G=e(500),H=e(!1),J=e([]),K=e([]),L=e(!1),O=e(""),R=s({content:"",images:[]}),S=l(()=>R.content.trim().length>0||R.images.length>0);t(()=>{const a=i();U.value=20,G.value=a.windowHeight-U.value-88,W()});const W=async()=>{try{const a=await B();J.value=a||[]}catch(a){}},A=()=>{j().length>1?z():F({url:"/pages/empty/empty"})},M=async()=>{if(T()){if(S.value&&!H.value){H.value=!0;try{if(L.value){const a=parseInt(O.value);if(!a||a<1||a>9999)return q({title:"积分价格范围1~9999",icon:"none"}),void(H.value=!1)}const a=[];for(const e of R.images)if(e.startsWith("http"))a.push(e);else{const s=T(),l=await D(e,s||"");(null==l?void 0:l.uri)&&a.push(l.uri)}await E({content:R.content,images:a,tag_ids:K.value,post_type:0,is_paid:L.value?1:0,price_points:L.value?parseInt(O.value):0}),q({title:"发布成功",icon:"success"}),setTimeout(()=>{j().length>1?z():F({url:"/pages/empty/empty"})},1200)}catch(a){q({title:"发布失败",icon:"none"})}finally{H.value=!1}}}else I({url:"/pages/login/login"})},N=()=>{const a=18-R.images.length;a<=0||P({count:a,sizeType:["compressed"],sourceType:["album","camera"],success:a=>{R.images.push(...a.tempFilePaths)}})};return(a,e)=>{const s=n,l=g,t=b,i=x,j=o("u-icon"),z=w,F=V,T=f;return p(),u(s,{class:"publish-page"},{default:c(()=>[d(s,{class:"publish-header",style:_({paddingTop:U.value+"px"})},{default:c(()=>[d(s,{class:"publish-header__left",onClick:A},{default:c(()=>[h("取消")]),_:1}),d(s,{class:"publish-header__title"},{default:c(()=>[h("发帖")]),_:1}),d(s,{class:"publish-header__right"},{default:c(()=>[d(s,{class:m(["publish-btn",{"publish-btn--disabled":!S.value||H.value}]),onClick:M},{default:c(()=>[d(l,null,{default:c(()=>[h(r(H.value?"发布中":"发布"),1)]),_:1})]),_:1},8,["class"])]),_:1})]),_:1},8,["style"]),d(T,{"scroll-y":"",class:"publish-scroll",style:_({height:G.value+"px"})},{default:c(()=>[d(s,{class:"publish-body"},{default:c(()=>[d(t,{modelValue:R.content,"onUpdate:modelValue":e[0]||(e[0]=a=>R.content=a),class:"publish-textarea",placeholder:"分享你的体育见解...",maxlength:2e3,"auto-height":""},null,8,["modelValue"]),d(s,{class:"publish-images"},{default:c(()=>[(p(!0),v(y,null,k(R.images.slice(0,R.images.length>=9?8:R.images.length),(a,e)=>(p(),u(s,{key:e,class:"publish-images__item"},{default:c(()=>[d(i,{src:a,mode:"aspectFill",class:"publish-images__img"},null,8,["src"]),d(s,{class:"publish-images__del",onClick:a=>(a=>{R.images.splice(a,1)})(e)},{default:c(()=>[d(j,{name:"close",size:"24",color:"#fff"})]),_:2},1032,["onClick"])]),_:2},1024))),128)),R.images.length>=9?(p(),u(s,{key:0,class:"publish-images__more",onClick:N},{default:c(()=>[d(i,{src:R.images[8],mode:"aspectFill",class:"publish-images__img"},null,8,["src"]),d(s,{class:"publish-images__more-mask"},{default:c(()=>[d(l,{class:"publish-images__more-text"},{default:c(()=>[h("+"+r(R.images.length-8),1)]),_:1}),d(l,{class:"publish-images__more-hint"},{default:c(()=>[h("点击继续添加")]),_:1})]),_:1})]),_:1})):C("",!0),R.images.length<9?(p(),u(s,{key:1,class:"publish-images__add",onClick:N},{default:c(()=>[d(j,{name:"plus",size:"52",color:"#ccc"})]),_:1})):C("",!0)]),_:1})]),_:1}),d(s,{class:"publish-paid"},{default:c(()=>[d(s,{class:"publish-paid__row"},{default:c(()=>[d(l,{class:"publish-paid__label"},{default:c(()=>[h("收费阅读")]),_:1}),d(z,{checked:L.value,onChange:e[1]||(e[1]=a=>L.value=a.detail.value),color:"#185dff"},null,8,["checked"])]),_:1}),L.value?(p(),u(s,{key:0,class:"publish-paid__price"},{default:c(()=>[d(l,{class:"publish-paid__label"},{default:c(()=>[h("积分价格")]),_:1}),d(F,{modelValue:O.value,"onUpdate:modelValue":e[2]||(e[2]=a=>O.value=a),type:"number",class:"publish-paid__input",placeholder:"输入积分(1~9999)"},null,8,["modelValue"])]),_:1})):C("",!0)]),_:1}),d(s,{class:"publish-tags"},{default:c(()=>[d(s,{class:"publish-tags__label"},{default:c(()=>[d(l,null,{default:c(()=>[h("选择标签")]),_:1})]),_:1}),d(s,{class:"publish-tags__list"},{default:c(()=>[(p(!0),v(y,null,k(J.value,a=>(p(),u(s,{key:a.id,class:m(["publish-tags__item",{"publish-tags__item--active":K.value.includes(a.id)}]),onClick:e=>(a=>{const e=K.value.indexOf(a);if(e>=0)K.value.splice(e,1);else{if(K.value.length>=3)return void q({title:"最多选择3个标签",icon:"none"});K.value.push(a)}})(a.id)},{default:c(()=>[d(l,null,{default:c(()=>[h("#"+r(a.name),1)]),_:2},1024)]),_:2},1032,["class","onClick"]))),128))]),_:1})]),_:1})]),_:1},8,["style"])]),_:1})}}}),[["__scopeId","data-v-4fd73ce8"]]);export{G as default};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
|
||||
import{d as t,r as s,b as a,c as o,o as r}from"./index-Becg0v_n.js";import{M as e}from"./MatchShellPage.2dsgqG7i.js";import"./ai-assistant-entry.DF5oe7Pc.js";import"./match.eHAFLu-m.js";import"./news.jRRCA4t0.js";import"./translated-article-card.CAWyQUYr.js";const i=t({__name:"index",setup(t){const i=s({});return a(t=>{i.value=t||{}}),(t,s)=>(r(),o(e,{"initial-view":"worldcup","route-options":i.value},null,8,["route-options"]))}});export{i as default};
|
||||
@@ -0,0 +1 @@
|
||||
import{d as t,r as s,b as a,c as o,o as r}from"./index-gD80NK0s.js";import{M as e}from"./MatchShellPage.B49AV8w8.js";import"./ai-assistant-entry.BLCoe4gZ.js";import"./match.DQ-syC__.js";import"./news.BPuRIjrP.js";import"./translated-article-card.D6LrBQC8.js";const i=t({__name:"index",setup(t){const i=s({});return a(t=>{i.value=t||{}}),(t,s)=>(r(),o(e,{"initial-view":"worldcup","route-options":i.value},null,8,["route-options"]))}});export{i as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{d as t,r as s,b as a,c as o,o as r}from"./index-Becg0v_n.js";import{M as e}from"./MatchShellPage.2dsgqG7i.js";import"./ai-assistant-entry.DF5oe7Pc.js";import"./match.eHAFLu-m.js";import"./news.jRRCA4t0.js";import"./translated-article-card.CAWyQUYr.js";const i=t({__name:"worldcup",setup(t){const i=s({});return a(t=>{i.value=t||{}}),(t,s)=>(r(),o(e,{"initial-view":"worldcup","route-options":i.value},null,8,["route-options"]))}});export{i as default};
|
||||
@@ -0,0 +1 @@
|
||||
import{d as t,r as s,b as a,c as o,o as r}from"./index-gD80NK0s.js";import{M as e}from"./MatchShellPage.B49AV8w8.js";import"./ai-assistant-entry.BLCoe4gZ.js";import"./match.DQ-syC__.js";import"./news.BPuRIjrP.js";import"./translated-article-card.D6LrBQC8.js";const i=t({__name:"worldcup",setup(t){const i=s({});return a(t=>{i.value=t||{}}),(t,s)=>(r(),o(e,{"initial-view":"worldcup","route-options":i.value},null,8,["route-options"]))}});export{i as default};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{d as t,r as a,b as s,c as e,w as n,aL as l,ay as r,k as o,P as p,o as u,l as c}from"./index-Becg0v_n.js";const i=t({__name:"agreement",setup(t){let i=a("");const m=a("");return s(t=>{t.type&&(i=t.type,(async t=>{const a=await l({type:t});m.value=a.content,r({title:String(a.title)})})(i))}),(t,a)=>{const s=p("u-parse"),l=o;return u(),e(l,{class:"p-[30rpx]"},{default:n(()=>[c(s,{html:m.value},null,8,["html"])]),_:1})}}});export{i as default};
|
||||
import{d as t,r as a,b as s,c as e,w as n,aL as l,ay as r,k as o,P as p,o as u,l as c}from"./index-gD80NK0s.js";const i=t({__name:"agreement",setup(t){let i=a("");const m=a("");return s(t=>{t.type&&(i=t.type,(async t=>{const a=await l({type:t});m.value=a.content,r({title:String(a.title)})})(i))}),(t,a)=>{const s=p("u-parse"),l=o;return u(),e(l,{class:"p-[30rpx]"},{default:n(()=>[c(s,{html:m.value},null,8,["html"])]),_:1})}}});export{i as default};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
@@ -1 +1 @@
|
||||
import{d as e,r as a,b as t,c as l,w as s,M as u,ay as i,k as n,P as r,o as c,l as v,q as _,t as d,v as o,D as f,_ as w}from"./index-Becg0v_n.js";const y=w(e({__name:"article_view",setup(e){const w=a(!0),y=a(""),g=a(""),m=a(""),p=a(""),k=e=>{if(!e)return"";if(/^\d+$/.test(e)){const a=new Date(1e3*Number(e));return h(a)}const a=new Date(e.replace(/-/g,"/"));return isNaN(a.getTime())?e:h(a)},h=e=>{const a=e=>String(e).padStart(2,"0");return`${e.getFullYear()}-${a(e.getMonth()+1)}-${a(e.getDate())} ${a(e.getHours())}:${a(e.getMinutes())}`};return t(e=>{const a=(null==e?void 0:e.type)||"",t=(null==e?void 0:e.id)||"";if(!a)return y.value="参数错误:缺少 type",void(w.value=!1);(async(e,a)=>{w.value=!0,y.value="";try{const t=await u.get({url:"/content/detail",data:{type:e,id:a}},{withToken:!1});g.value=t.title||"",m.value=t.content||"",p.value=t.create_time||"",g.value&&i({title:g.value})}catch(t){y.value=String((null==t?void 0:t.msg)||t||"加载失败")}finally{w.value=!1}})(a,t)}),(e,a)=>{const t=_,u=n,i=r("u-parse");return c(),l(u,{class:"article-view"},{default:s(()=>[w.value?(c(),l(u,{key:0,class:"article-view__state"},{default:s(()=>[v(t,null,{default:s(()=>[d("加载中...")]),_:1})]),_:1})):y.value?(c(),l(u,{key:1,class:"article-view__state"},{default:s(()=>[v(t,null,{default:s(()=>[d(o(y.value),1)]),_:1})]),_:1})):(c(),l(u,{key:2,class:"article-view__body"},{default:s(()=>[g.value?(c(),l(u,{key:0,class:"article-view__head"},{default:s(()=>[v(t,{class:"article-view__title"},{default:s(()=>[d(o(g.value),1)]),_:1}),p.value?(c(),l(t,{key:0,class:"article-view__time"},{default:s(()=>[d(o(k(p.value)),1)]),_:1})):f("",!0)]),_:1})):f("",!0),v(u,{class:"article-view__content"},{default:s(()=>[v(i,{html:m.value},null,8,["html"])]),_:1})]),_:1}))]),_:1})}}}),[["__scopeId","data-v-da7cac58"]]);export{y as default};
|
||||
import{d as e,r as a,b as t,c as l,w as s,M as u,ay as i,k as n,P as r,o as c,l as v,q as _,t as d,v as o,D as f,_ as w}from"./index-gD80NK0s.js";const y=w(e({__name:"article_view",setup(e){const w=a(!0),y=a(""),g=a(""),m=a(""),p=a(""),k=e=>{if(!e)return"";if(/^\d+$/.test(e)){const a=new Date(1e3*Number(e));return h(a)}const a=new Date(e.replace(/-/g,"/"));return isNaN(a.getTime())?e:h(a)},h=e=>{const a=e=>String(e).padStart(2,"0");return`${e.getFullYear()}-${a(e.getMonth()+1)}-${a(e.getDate())} ${a(e.getHours())}:${a(e.getMinutes())}`};return t(e=>{const a=(null==e?void 0:e.type)||"",t=(null==e?void 0:e.id)||"";if(!a)return y.value="参数错误:缺少 type",void(w.value=!1);(async(e,a)=>{w.value=!0,y.value="";try{const t=await u.get({url:"/content/detail",data:{type:e,id:a}},{withToken:!1});g.value=t.title||"",m.value=t.content||"",p.value=t.create_time||"",g.value&&i({title:g.value})}catch(t){y.value=String((null==t?void 0:t.msg)||t||"加载失败")}finally{w.value=!1}})(a,t)}),(e,a)=>{const t=_,u=n,i=r("u-parse");return c(),l(u,{class:"article-view"},{default:s(()=>[w.value?(c(),l(u,{key:0,class:"article-view__state"},{default:s(()=>[v(t,null,{default:s(()=>[d("加载中...")]),_:1})]),_:1})):y.value?(c(),l(u,{key:1,class:"article-view__state"},{default:s(()=>[v(t,null,{default:s(()=>[d(o(y.value),1)]),_:1})]),_:1})):(c(),l(u,{key:2,class:"article-view__body"},{default:s(()=>[g.value?(c(),l(u,{key:0,class:"article-view__head"},{default:s(()=>[v(t,{class:"article-view__title"},{default:s(()=>[d(o(g.value),1)]),_:1}),p.value?(c(),l(t,{key:0,class:"article-view__time"},{default:s(()=>[d(o(k(p.value)),1)]),_:1})):f("",!0)]),_:1})):f("",!0),v(u,{class:"article-view__content"},{default:s(()=>[v(i,{html:m.value},null,8,["html"])]),_:1})]),_:1}))]),_:1})}}}),[["__scopeId","data-v-da7cac58"]]);export{y as default};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{d as s,H as a,r as e,x as t,l,w as o,F as n,P as r,k as c,o as m,p,Q as u,t as f,v as i,_}from"./index-Becg0v_n.js";import{m as d}from"./manifest.DVfGyaYk.js";const g=_(s({__name:"as_us",setup(s){const _=a(),g=e(d.versionName);return(s,a)=>{const e=r("page-meta"),d=p,x=c;return m(),t(n,null,[l(e,{"page-style":s.$theme.pageStyle},null,8,["page-style"]),l(x,{class:"as-us flex flex-1 flex-col items-center"},{default:o(()=>[l(d,{src:u(_).getWebsiteConfig.shop_logo,mode:"",class:"img"},null,8,["src"]),l(x,{class:"text-content mt-[20rpx]"},{default:o(()=>[f("当前版本 v"+i(g.value),1)]),_:1})]),_:1})],64)}}}),[["__scopeId","data-v-e695cc45"]]);export{g as default};
|
||||
import{d as s,H as a,r as e,x as t,l,w as o,F as n,P as r,k as c,o as m,p,Q as u,t as f,v as i,_}from"./index-gD80NK0s.js";import{m as d}from"./manifest.DVfGyaYk.js";const g=_(s({__name:"as_us",setup(s){const _=a(),g=e(d.versionName);return(s,a)=>{const e=r("page-meta"),d=p,x=c;return m(),t(n,null,[l(e,{"page-style":s.$theme.pageStyle},null,8,["page-style"]),l(x,{class:"as-us flex flex-1 flex-col items-center"},{default:o(()=>[l(d,{src:u(_).getWebsiteConfig.shop_logo,mode:"",class:"img"},null,8,["src"]),l(x,{class:"text-content mt-[20rpx]"},{default:o(()=>[f("当前版本 v"+i(g.value),1)]),_:1})]),_:1})],64)}}}),[["__scopeId","data-v-e695cc45"]]);export{g as default};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{d as e,a2 as l,r as t,u as a,J as o,b as s,x as r,l as d,w as n,F as i,P as u,k as c,o as m,t as x,v as p,c as b,D as f,q as h,z as g,ag as v,N as _,aS as y,av as k,_ as $}from"./index-Becg0v_n.js";const w=$(e({__name:"bind_mobile",setup(e){const $=l(),w=t(""),C=t(!1),V=a(),T=e=>{w.value=e},S=o({type:"bind",mobile:"",code:""});s(e=>{"verify"===(null==e?void 0:e.from)&&(null==e?void 0:e.mobile)&&(C.value=!0,S.mobile=e.mobile,S.type="change")});const U=async()=>{var e,l;if(!S.mobile)return uni.$u.toast("请输入手机号码");if(null==(e=$.value)?void 0:e.canGetCode)try{const e=await v({mobile:S.mobile,scene:C.value?"change":"bind"}),t=e.phone,a=e.code;S.code=a,null==(l=$.value)||l.start(),_({title:"发送验证短信",content:`请发送短信到 ${t}\n发送内容:${a}\n\n点击确定将打开短信编辑界面`,confirmText:"发送短信",success:e=>{e.confirm&&(window.location.href=`sms:${t}?body=${a}`)}})}catch(t){uni.$u.toast(t||"获取验证信息失败")}},j=async()=>S.mobile?S.code?(await y(S,{token:V.temToken||V.token}),uni.$u.toast("绑定成功"),V.temToken&&V.login(V.temToken),void k({url:"/pages/index/index"})):uni.$u.toast("请输入验证码"):uni.$u.toast("请输入手机号码"),q=()=>{V.login(V.temToken),k({url:"/pages/index/index"})};return(e,l)=>{const t=u("page-meta"),a=c,o=u("u-input"),s=u("u-verification-code"),v=h,_=u("u-button");return m(),r(i,null,[d(t,{"page-style":e.$theme.pageStyle},null,8,["page-style"]),d(a,{class:"bg-white min-h-full flex flex-col items-center px-[40rpx] pt-[40rpx] box-border"},{default:n(()=>[d(a,{class:"w-full"},{default:n(()=>[d(a,{class:"text-2xl font-medium mb-[60rpx]"},{default:n(()=>[x(p(C.value?"验证手机号":"绑定手机号"),1)]),_:1}),C.value&&S.mobile?(m(),b(a,{key:0,class:"text-sm text-muted mb-[30rpx]"},{default:n(()=>[x("请验证您的手机号 "+p(S.mobile),1)]),_:1})):f("",!0),d(a,{class:"px-[18rpx] border border-solid border-lightc border-light rounded-[10rpx] h-[100rpx] items-center flex"},{default:n(()=>[d(o,{class:"flex-1",modelValue:S.mobile,"onUpdate:modelValue":l[0]||(l[0]=e=>S.mobile=e),border:!1,placeholder:"请输入手机号码"},null,8,["modelValue"])]),_:1}),d(a,{class:"px-[18rpx] border border-solid border-lightc border-light rounded-[10rpx] h-[100rpx] items-center flex mt-[40rpx]"},{default:n(()=>[d(o,{class:"flex-1",modelValue:S.code,"onUpdate:modelValue":l[1]||(l[1]=e=>S.code=e),placeholder:"请输入验证码",border:!1},null,8,["modelValue"]),d(a,{class:"border-l border-solid border-0 border-light pl-3 leading-4 ml-3 w-[180rpx]",onClick:U},{default:n(()=>[d(s,{ref_key:"uCodeRef",ref:$,seconds:60,onChange:T,"change-text":"x秒"},null,512),d(v,{class:g(S.mobile?"text-primary":"text-muted")},{default:n(()=>[x(p(w.value),1)]),_:1},8,["class"])]),_:1})]),_:1}),d(a,{class:"mt-[40rpx]"},{default:n(()=>[d(_,{type:"primary","hover-class":"none",customStyle:{height:"100rpx",opacity:S.mobile&&S.code?"1":"0.5"},onClick:j},{default:n(()=>[x(" 确定 ")]),_:1},8,["customStyle"])]),_:1}),d(a,{class:"mt-[24rpx] text-center"},{default:n(()=>[d(v,{class:"text-muted text-sm",onClick:q},{default:n(()=>[x("跳过,暂不绑定")]),_:1})]),_:1})]),_:1})]),_:1})],64)}}}),[["__scopeId","data-v-1dfaf36f"]]);export{w as default};
|
||||
import{d as e,a2 as l,r as t,u as a,J as o,b as s,x as r,l as d,w as n,F as i,P as u,k as c,o as m,t as x,v as p,c as b,D as f,q as h,z as g,ag as v,N as _,aS as y,av as k,_ as $}from"./index-gD80NK0s.js";const w=$(e({__name:"bind_mobile",setup(e){const $=l(),w=t(""),C=t(!1),V=a(),T=e=>{w.value=e},S=o({type:"bind",mobile:"",code:""});s(e=>{"verify"===(null==e?void 0:e.from)&&(null==e?void 0:e.mobile)&&(C.value=!0,S.mobile=e.mobile,S.type="change")});const U=async()=>{var e,l;if(!S.mobile)return uni.$u.toast("请输入手机号码");if(null==(e=$.value)?void 0:e.canGetCode)try{const e=await v({mobile:S.mobile,scene:C.value?"change":"bind"}),t=e.phone,a=e.code;S.code=a,null==(l=$.value)||l.start(),_({title:"发送验证短信",content:`请发送短信到 ${t}\n发送内容:${a}\n\n点击确定将打开短信编辑界面`,confirmText:"发送短信",success:e=>{e.confirm&&(window.location.href=`sms:${t}?body=${a}`)}})}catch(t){uni.$u.toast(t||"获取验证信息失败")}},j=async()=>S.mobile?S.code?(await y(S,{token:V.temToken||V.token}),uni.$u.toast("绑定成功"),V.temToken&&V.login(V.temToken),void k({url:"/pages/index/index"})):uni.$u.toast("请输入验证码"):uni.$u.toast("请输入手机号码"),q=()=>{V.login(V.temToken),k({url:"/pages/index/index"})};return(e,l)=>{const t=u("page-meta"),a=c,o=u("u-input"),s=u("u-verification-code"),v=h,_=u("u-button");return m(),r(i,null,[d(t,{"page-style":e.$theme.pageStyle},null,8,["page-style"]),d(a,{class:"bg-white min-h-full flex flex-col items-center px-[40rpx] pt-[40rpx] box-border"},{default:n(()=>[d(a,{class:"w-full"},{default:n(()=>[d(a,{class:"text-2xl font-medium mb-[60rpx]"},{default:n(()=>[x(p(C.value?"验证手机号":"绑定手机号"),1)]),_:1}),C.value&&S.mobile?(m(),b(a,{key:0,class:"text-sm text-muted mb-[30rpx]"},{default:n(()=>[x("请验证您的手机号 "+p(S.mobile),1)]),_:1})):f("",!0),d(a,{class:"px-[18rpx] border border-solid border-lightc border-light rounded-[10rpx] h-[100rpx] items-center flex"},{default:n(()=>[d(o,{class:"flex-1",modelValue:S.mobile,"onUpdate:modelValue":l[0]||(l[0]=e=>S.mobile=e),border:!1,placeholder:"请输入手机号码"},null,8,["modelValue"])]),_:1}),d(a,{class:"px-[18rpx] border border-solid border-lightc border-light rounded-[10rpx] h-[100rpx] items-center flex mt-[40rpx]"},{default:n(()=>[d(o,{class:"flex-1",modelValue:S.code,"onUpdate:modelValue":l[1]||(l[1]=e=>S.code=e),placeholder:"请输入验证码",border:!1},null,8,["modelValue"]),d(a,{class:"border-l border-solid border-0 border-light pl-3 leading-4 ml-3 w-[180rpx]",onClick:U},{default:n(()=>[d(s,{ref_key:"uCodeRef",ref:$,seconds:60,onChange:T,"change-text":"x秒"},null,512),d(v,{class:g(S.mobile?"text-primary":"text-muted")},{default:n(()=>[x(p(w.value),1)]),_:1},8,["class"])]),_:1})]),_:1}),d(a,{class:"mt-[40rpx]"},{default:n(()=>[d(_,{type:"primary","hover-class":"none",customStyle:{height:"100rpx",opacity:S.mobile&&S.code?"1":"0.5"},onClick:j},{default:n(()=>[x(" 确定 ")]),_:1},8,["customStyle"])]),_:1}),d(a,{class:"mt-[24rpx] text-center"},{default:n(()=>[d(v,{class:"text-muted text-sm",onClick:q},{default:n(()=>[x("跳过,暂不绑定")]),_:1})]),_:1})]),_:1})]),_:1})],64)}}}),[["__scopeId","data-v-1dfaf36f"]]);export{w as default};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{d as e,r as a,J as s,b as l,ay as o,x as t,l as r,w as d,F as u,P as p,k as m,o as n,t as c,v as f,c as i,D as _,aM as w,a0 as b,_ as x}from"./index-Becg0v_n.js";const y=x(e({__name:"change_password",setup(e){const x=a(""),y=s({password:"",password_confirm:""}),h=async()=>y.old_password||"set"==x.value?y.password?y.password_confirm?y.password!=y.password_confirm?uni.$u.toast("两次输入的密码不一致"):(await w(y),uni.$u.toast("操作成功"),void setTimeout(()=>{b()},1500)):uni.$u.toast("请输入确认密码"):uni.$u.toast("请输入密码"):uni.$u.toast("请输入原来的密码");return l(e=>{x.value=e.type||"","set"==x.value&&o({title:"设置登录密码"})}),(e,a)=>{const s=p("page-meta"),l=m,o=p("u-input"),w=p("u-form-item"),b=p("u-form"),V=p("u-button");return n(),t(u,null,[r(s,{"page-style":e.$theme.pageStyle},null,8,["page-style"]),r(l,{class:"register bg-white min-h-full flex flex-col items-center px-[40rpx] pt-[100rpx] box-border"},{default:d(()=>[r(l,{class:"w-full"},{default:d(()=>[r(l,{class:"text-2xl font-medium mb-[60rpx]"},{default:d(()=>[c(f("set"==x.value?"设置登录密码":"修改登录密码"),1)]),_:1}),r(b,{borderBottom:"","label-width":150},{default:d(()=>["set"!=x.value?(n(),i(w,{key:0,label:"原密码",borderBottom:""},{default:d(()=>[r(o,{class:"flex-1",type:"password",modelValue:y.old_password,"onUpdate:modelValue":a[0]||(a[0]=e=>y.old_password=e),border:!1,placeholder:"请输入原来的密码"},null,8,["modelValue"])]),_:1})):_("",!0),r(w,{label:"新密码",borderBottom:""},{default:d(()=>[r(o,{class:"flex-1",type:"password",modelValue:y.password,"onUpdate:modelValue":a[1]||(a[1]=e=>y.password=e),placeholder:"6-20位数字+字母或符号组合",border:!1},null,8,["modelValue"])]),_:1}),r(w,{label:"确认密码",borderBottom:""},{default:d(()=>[r(o,{class:"flex-1",type:"password",modelValue:y.password_confirm,"onUpdate:modelValue":a[2]||(a[2]=e=>y.password_confirm=e),placeholder:"再次输入新密码",border:!1},null,8,["modelValue"])]),_:1})]),_:1}),r(l,{class:"mt-[100rpx]"},{default:d(()=>[r(V,{type:"primary",shape:"circle",onClick:h},{default:d(()=>[c(" 确定 ")]),_:1})]),_:1})]),_:1})]),_:1})],64)}}}),[["__scopeId","data-v-6a5e07fb"]]);export{y as default};
|
||||
import{d as e,r as a,J as s,b as l,ay as o,x as t,l as r,w as d,F as u,P as p,k as m,o as n,t as c,v as f,c as i,D as _,aM as w,a0 as b,_ as x}from"./index-gD80NK0s.js";const y=x(e({__name:"change_password",setup(e){const x=a(""),y=s({password:"",password_confirm:""}),h=async()=>y.old_password||"set"==x.value?y.password?y.password_confirm?y.password!=y.password_confirm?uni.$u.toast("两次输入的密码不一致"):(await w(y),uni.$u.toast("操作成功"),void setTimeout(()=>{b()},1500)):uni.$u.toast("请输入确认密码"):uni.$u.toast("请输入密码"):uni.$u.toast("请输入原来的密码");return l(e=>{x.value=e.type||"","set"==x.value&&o({title:"设置登录密码"})}),(e,a)=>{const s=p("page-meta"),l=m,o=p("u-input"),w=p("u-form-item"),b=p("u-form"),V=p("u-button");return n(),t(u,null,[r(s,{"page-style":e.$theme.pageStyle},null,8,["page-style"]),r(l,{class:"register bg-white min-h-full flex flex-col items-center px-[40rpx] pt-[100rpx] box-border"},{default:d(()=>[r(l,{class:"w-full"},{default:d(()=>[r(l,{class:"text-2xl font-medium mb-[60rpx]"},{default:d(()=>[c(f("set"==x.value?"设置登录密码":"修改登录密码"),1)]),_:1}),r(b,{borderBottom:"","label-width":150},{default:d(()=>["set"!=x.value?(n(),i(w,{key:0,label:"原密码",borderBottom:""},{default:d(()=>[r(o,{class:"flex-1",type:"password",modelValue:y.old_password,"onUpdate:modelValue":a[0]||(a[0]=e=>y.old_password=e),border:!1,placeholder:"请输入原来的密码"},null,8,["modelValue"])]),_:1})):_("",!0),r(w,{label:"新密码",borderBottom:""},{default:d(()=>[r(o,{class:"flex-1",type:"password",modelValue:y.password,"onUpdate:modelValue":a[1]||(a[1]=e=>y.password=e),placeholder:"6-20位数字+字母或符号组合",border:!1},null,8,["modelValue"])]),_:1}),r(w,{label:"确认密码",borderBottom:""},{default:d(()=>[r(o,{class:"flex-1",type:"password",modelValue:y.password_confirm,"onUpdate:modelValue":a[2]||(a[2]=e=>y.password_confirm=e),placeholder:"再次输入新密码",border:!1},null,8,["modelValue"])]),_:1})]),_:1}),r(l,{class:"mt-[100rpx]"},{default:d(()=>[r(V,{type:"primary",shape:"circle",onClick:h},{default:d(()=>[c(" 确定 ")]),_:1})]),_:1})]),_:1})]),_:1})],64)}}}),[["__scopeId","data-v-6a5e07fb"]]);export{y as default};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{d as a,u as e,r as l,g as n,b as s,c as t,w as c,m as i,W as u,X as o,j as d,k as _,P as r,o as f,l as h,q as g,t as v,S as p,v as m,x as y,F as x,y as k,z as S,D as w,N as C,e as b,Y as j,s as L,Z as z,a0 as A,_ as E}from"./index-Becg0v_n.js";import{g as I}from"./news.jRRCA4t0.js";const M="user_my_channels",T=E(a({__name:"channel-manage",setup(a){const E=e(),T=l(0),W=l(!1),q=l([]),D=l([]),F=l(-1),N=l([]),P=l(!1);n({success:a=>{T.value=0}});const X=()=>{const a=new Set(q.value.map(a=>String(a.id))),e=D.value.filter(e=>!a.has(String(e.id)));N.value=e.length?[{title:"推荐频道",channels:e}]:[]},Y=()=>{W.value||E.isLogin?(W.value&&P.value&&(Z(),P.value=!1),W.value=!W.value):C({title:"提示",content:"登录后才能编辑频道,是否前往登录?",confirmText:"去登录",success:a=>{a.confirm&&b({url:"/pages/login/login"})}})},Z=()=>{const a=q.value.filter(a=>a.id).map(a=>a.id);E.isLogin?j({channel_ids:a}).catch(a=>{console.log("保存频道配置失败=>",a),d({title:"保存失败",icon:"none"})}):L(M,a)},B=a=>{P.value&&Z(),z("channelChanged",{channels:P.value?[...q.value]:null,selectIndex:a??-1}),A()},G=()=>{B()};return s(()=>{P.value=!1,(async()=>{try{const e=await I();D.value=e||[];const l=(e||[]).map(a=>({...a,fixed:!1}));if(E.isLogin)try{const a=await u();if(a&&Array.isArray(a.channel_ids)){const l=a.channel_ids,n=new Map(e.map(a=>[String(a.id),a])),s=[];return l.forEach(a=>{const e=n.get(String(a));e&&s.push({...e,fixed:!1})}),q.value=s,void X()}}catch(a){console.log("获取用户频道配置失败=>",a)}else{const a=o(M);if(a&&a.length){const l=new Map(e.map(a=>[String(a.id),a])),n=[];if(a.forEach(a=>{const e=l.get(String(a));e&&n.push({...e,fixed:!1})}),n.length)return q.value=n,void X()}}q.value=l,X()}catch(a){console.log("获取分类失败=>",a),q.value.length||d({title:"加载失败,请重试",icon:"none"})}})()}),(a,e)=>{const l=r("u-icon"),n=_,s=g,u=p;return f(),t(n,{class:"channel-manage-page",style:i({paddingTop:T.value+"px"})},{default:c(()=>[h(n,{class:"page-header"},{default:c(()=>[h(n,{class:"page-header__back",onClick:G},{default:c(()=>[h(l,{name:"arrow-left",size:"36",color:"#333"})]),_:1}),h(s,{class:"page-header__title"},{default:c(()=>[v("频道管理")]),_:1}),h(n,{class:"page-header__right"})]),_:1}),h(u,{"scroll-y":"",class:"page-scroll"},{default:c(()=>[h(n,{class:"channel-section"},{default:c(()=>[h(n,{class:"channel-section__header"},{default:c(()=>[h(s,{class:"channel-section__title"},{default:c(()=>[v("我的频道")]),_:1}),h(s,{class:"channel-section__tip"},{default:c(()=>[v(m(W.value?"拖拽可排序":"点击进入频道"),1)]),_:1}),h(s,{class:"channel-section__edit",onClick:Y},{default:c(()=>[v(m(W.value?"完成":"编辑"),1)]),_:1})]),_:1}),h(n,{class:"channel-grid"},{default:c(()=>[(f(!0),y(x,null,k(q.value,(a,e)=>(f(),t(n,{key:a.id||"__recommend__",class:S(["channel-tag",{"channel-tag--active":e===F.value,"channel-tag--fixed":a.fixed}]),onClick:a=>(a=>{if(W.value){if(q.value[a].fixed)return;q.value.splice(a,1),X(),P.value=!0}else F.value=a,B(a)})(e)},{default:c(()=>[h(s,null,{default:c(()=>[v(m(a.name),1)]),_:2},1024),W.value&&!a.fixed?(f(),t(n,{key:0,class:"channel-tag__remove-btn"},{default:c(()=>[h(s,{class:"channel-tag__remove"},{default:c(()=>[v("×")]),_:1})]),_:1})):w("",!0)]),_:2},1032,["class","onClick"]))),128))]),_:1})]),_:1}),(f(!0),y(x,null,k(N.value,a=>(f(),t(n,{key:a.title,class:"channel-section"},{default:c(()=>[h(n,{class:"channel-section__header"},{default:c(()=>[h(s,{class:"channel-section__title"},{default:c(()=>[v(m(a.title),1)]),_:2},1024)]),_:2},1024),h(n,{class:"channel-grid"},{default:c(()=>[(f(!0),y(x,null,k(a.channels,a=>(f(),t(n,{key:a.id,class:"channel-tag channel-tag--add",onClick:e=>(a=>{W.value&&(q.value.some(e=>String(e.id)===String(a.id))||(q.value.push({...a,fixed:!1}),X(),P.value=!0))})(a)},{default:c(()=>[h(s,null,{default:c(()=>[v(m(a.name),1)]),_:2},1024),W.value?(f(),t(s,{key:0,class:"channel-tag__add"},{default:c(()=>[v("+")]),_:1})):w("",!0)]),_:2},1032,["onClick"]))),128))]),_:2},1024)]),_:2},1024))),128))]),_:1})]),_:1},8,["style"])}}}),[["__scopeId","data-v-a65f7fdf"]]);export{T as default};
|
||||
import{d as a,u as e,r as l,g as n,b as s,c as t,w as c,m as i,W as u,X as o,j as d,k as _,P as r,o as f,l as h,q as g,t as v,S as p,v as m,x as y,F as x,y as k,z as S,D as w,N as C,e as b,Y as j,s as L,Z as z,a0 as A,_ as E}from"./index-gD80NK0s.js";import{g as I}from"./news.BPuRIjrP.js";const M="user_my_channels",T=E(a({__name:"channel-manage",setup(a){const E=e(),T=l(0),W=l(!1),q=l([]),D=l([]),F=l(-1),N=l([]),P=l(!1);n({success:a=>{T.value=0}});const X=()=>{const a=new Set(q.value.map(a=>String(a.id))),e=D.value.filter(e=>!a.has(String(e.id)));N.value=e.length?[{title:"推荐频道",channels:e}]:[]},Y=()=>{W.value||E.isLogin?(W.value&&P.value&&(Z(),P.value=!1),W.value=!W.value):C({title:"提示",content:"登录后才能编辑频道,是否前往登录?",confirmText:"去登录",success:a=>{a.confirm&&b({url:"/pages/login/login"})}})},Z=()=>{const a=q.value.filter(a=>a.id).map(a=>a.id);E.isLogin?j({channel_ids:a}).catch(a=>{console.log("保存频道配置失败=>",a),d({title:"保存失败",icon:"none"})}):L(M,a)},B=a=>{P.value&&Z(),z("channelChanged",{channels:P.value?[...q.value]:null,selectIndex:a??-1}),A()},G=()=>{B()};return s(()=>{P.value=!1,(async()=>{try{const e=await I();D.value=e||[];const l=(e||[]).map(a=>({...a,fixed:!1}));if(E.isLogin)try{const a=await u();if(a&&Array.isArray(a.channel_ids)){const l=a.channel_ids,n=new Map(e.map(a=>[String(a.id),a])),s=[];return l.forEach(a=>{const e=n.get(String(a));e&&s.push({...e,fixed:!1})}),q.value=s,void X()}}catch(a){console.log("获取用户频道配置失败=>",a)}else{const a=o(M);if(a&&a.length){const l=new Map(e.map(a=>[String(a.id),a])),n=[];if(a.forEach(a=>{const e=l.get(String(a));e&&n.push({...e,fixed:!1})}),n.length)return q.value=n,void X()}}q.value=l,X()}catch(a){console.log("获取分类失败=>",a),q.value.length||d({title:"加载失败,请重试",icon:"none"})}})()}),(a,e)=>{const l=r("u-icon"),n=_,s=g,u=p;return f(),t(n,{class:"channel-manage-page",style:i({paddingTop:T.value+"px"})},{default:c(()=>[h(n,{class:"page-header"},{default:c(()=>[h(n,{class:"page-header__back",onClick:G},{default:c(()=>[h(l,{name:"arrow-left",size:"36",color:"#333"})]),_:1}),h(s,{class:"page-header__title"},{default:c(()=>[v("频道管理")]),_:1}),h(n,{class:"page-header__right"})]),_:1}),h(u,{"scroll-y":"",class:"page-scroll"},{default:c(()=>[h(n,{class:"channel-section"},{default:c(()=>[h(n,{class:"channel-section__header"},{default:c(()=>[h(s,{class:"channel-section__title"},{default:c(()=>[v("我的频道")]),_:1}),h(s,{class:"channel-section__tip"},{default:c(()=>[v(m(W.value?"拖拽可排序":"点击进入频道"),1)]),_:1}),h(s,{class:"channel-section__edit",onClick:Y},{default:c(()=>[v(m(W.value?"完成":"编辑"),1)]),_:1})]),_:1}),h(n,{class:"channel-grid"},{default:c(()=>[(f(!0),y(x,null,k(q.value,(a,e)=>(f(),t(n,{key:a.id||"__recommend__",class:S(["channel-tag",{"channel-tag--active":e===F.value,"channel-tag--fixed":a.fixed}]),onClick:a=>(a=>{if(W.value){if(q.value[a].fixed)return;q.value.splice(a,1),X(),P.value=!0}else F.value=a,B(a)})(e)},{default:c(()=>[h(s,null,{default:c(()=>[v(m(a.name),1)]),_:2},1024),W.value&&!a.fixed?(f(),t(n,{key:0,class:"channel-tag__remove-btn"},{default:c(()=>[h(s,{class:"channel-tag__remove"},{default:c(()=>[v("×")]),_:1})]),_:1})):w("",!0)]),_:2},1032,["class","onClick"]))),128))]),_:1})]),_:1}),(f(!0),y(x,null,k(N.value,a=>(f(),t(n,{key:a.title,class:"channel-section"},{default:c(()=>[h(n,{class:"channel-section__header"},{default:c(()=>[h(s,{class:"channel-section__title"},{default:c(()=>[v(m(a.title),1)]),_:2},1024)]),_:2},1024),h(n,{class:"channel-grid"},{default:c(()=>[(f(!0),y(x,null,k(a.channels,a=>(f(),t(n,{key:a.id,class:"channel-tag channel-tag--add",onClick:e=>(a=>{W.value&&(q.value.some(e=>String(e.id)===String(a.id))||(q.value.push({...a,fixed:!1}),X(),P.value=!0))})(a)},{default:c(()=>[h(s,null,{default:c(()=>[v(m(a.name),1)]),_:2},1024),W.value?(f(),t(s,{key:0,class:"channel-tag__add"},{default:c(()=>[v("+")]),_:1})):w("",!0)]),_:2},1032,["onClick"]))),128))]),_:2},1024)]),_:2},1024))),128))]),_:1})]),_:1},8,["style"])}}}),[["__scopeId","data-v-a65f7fdf"]]);export{T as default};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{d as e,a2 as a,J as s,r as l,x as t,l as o,w as n,F as i,P as u,o as c,y as r,c as d}from"./index-Becg0v_n.js";import{i as p,f as m}from"./news.jRRCA4t0.js";const w=e({__name:"collection",setup(e){const w=a(),g=s([{text:"取消收藏",style:{color:"#FFFFFF",backgroundColor:"#FF2C3C"}}]),y=l([]),f=async(e,a)=>{const{lists:s}=await p();s.forEach(e=>{e.show=!1}),y.value=s,w.value.complete(s)},h=async e=>{try{const a=y.value[e].article_id;await m({id:a}),uni.$u.toast("已取消收藏"),w.value.reload()}catch(a){console.log("取消收藏报错=>",a)}};return(e,a)=>{const s=u("page-meta"),l=u("news-card"),p=u("u-swipe-action"),m=u("z-paging");return c(),t(i,null,[o(s,{"page-style":e.$theme.pageStyle},null,8,["page-style"]),o(m,{ref_key:"paging",ref:w,modelValue:y.value,"onUpdate:modelValue":a[0]||(a[0]=e=>y.value=e),onQuery:f,fixed:!1,height:"100%","use-page-scroll":""},{default:n(()=>[(c(!0),t(i,null,r(y.value,(e,a)=>(c(),d(p,{show:e.show,index:a,key:e.id,onClick:h,options:g,"btn-width":"120"},{default:n(()=>[o(l,{item:e,newsId:e.article_id},null,8,["item","newsId"])]),_:2},1032,["show","index","options"]))),128))]),_:1},8,["modelValue"])],64)}}});export{w as default};
|
||||
import{d as e,a2 as a,J as s,r as l,x as t,l as o,w as n,F as i,P as u,o as c,y as r,c as d}from"./index-gD80NK0s.js";import{i as p,f as m}from"./news.BPuRIjrP.js";const w=e({__name:"collection",setup(e){const w=a(),g=s([{text:"取消收藏",style:{color:"#FFFFFF",backgroundColor:"#FF2C3C"}}]),y=l([]),f=async(e,a)=>{const{lists:s}=await p();s.forEach(e=>{e.show=!1}),y.value=s,w.value.complete(s)},h=async e=>{try{const a=y.value[e].article_id;await m({id:a}),uni.$u.toast("已取消收藏"),w.value.reload()}catch(a){console.log("取消收藏报错=>",a)}};return(e,a)=>{const s=u("page-meta"),l=u("news-card"),p=u("u-swipe-action"),m=u("z-paging");return c(),t(i,null,[o(s,{"page-style":e.$theme.pageStyle},null,8,["page-style"]),o(m,{ref_key:"paging",ref:w,modelValue:y.value,"onUpdate:modelValue":a[0]||(a[0]=e=>y.value=e),onQuery:f,fixed:!1,height:"100%","use-page-scroll":""},{default:n(()=>[(c(!0),t(i,null,r(y.value,(e,a)=>(c(),d(p,{show:e.show,index:a,key:e.id,onClick:h,options:g,"btn-width":"120"},{default:n(()=>[o(l,{item:e,newsId:e.article_id},null,8,["item","newsId"])]),_:2},1032,["show","index","options"]))),128))]),_:1},8,["modelValue"])],64)}}});export{w as default};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{d as a,r as e,G as l,b as s,g as t,f as c,aC as o,aA as r,c as n,w as u,j as i,k as _,a as d,P as f,o as y,l as m,m as p,q as h,t as v,x as b,F as g,y as w,z as k,v as C,aB as x,D as L,S as j,e as z,_ as I}from"./index-Becg0v_n.js";import{A as T}from"./ai-assistant-entry.DF5oe7Pc.js";import{l as V,g as A}from"./crypto.d9u1MTx-.js";const F=I(a({__name:"crypto",setup(a){const I=e(0),F=e(667),R=l(()=>{const a=I.value+d(232);return F.value-a+"px"}),$=e([]),q=e(""),B=e([{label:"热门",key:"hot"},{label:"涨幅榜",key:"gainers"},{label:"跌幅榜",key:"losers"},{label:"成交额",key:"volume"}]),D=e(0),G=l(()=>{let a=[...$.value];const e=q.value.trim().toLowerCase();return e&&(a=a.filter(a=>a.symbol.toLowerCase().includes(e)||a.name.toLowerCase().includes(e))),1===D.value?a.sort((a,e)=>e.change-a.change):2===D.value?a.sort((a,e)=>a.change-e.change):3===D.value?a.sort((a,e)=>e.priceRaw-a.priceRaw):a}),H=async()=>{console.log("[CryptoList] fetchTickers start");try{$.value=await A(),console.log("[CryptoList] fetchTickers ok count=>",$.value.length)}catch(a){console.error("[CryptoList] fetchTickers error=>",a),i({title:"行情加载失败",icon:"none"})}};let M=null;const P=()=>{M&&(clearInterval(M),M=null)};return s(()=>{t({success:a=>{F.value=a.windowHeight||667,I.value=0}}),V().then(H)}),c(()=>{P(),M=setInterval(H,3e4)}),o(()=>{P()}),r(()=>{P()}),(a,e)=>{const l=_,s=h,t=f("u-icon"),c=x,o=j;return y(),n(l,{class:"crypto-page"},{default:u(()=>[m(l,{class:"status-bar",style:p({height:I.value+"px"})},null,8,["style"]),m(l,{class:"navbar"},{default:u(()=>[m(s,{class:"navbar__title"},{default:u(()=>[v("加密行情")]),_:1}),m(T,{size:"compact"})]),_:1}),m(l,{class:"market-tabs"},{default:u(()=>[(y(!0),b(g,null,w(B.value,(a,e)=>(y(),n(l,{key:e,class:k(["market-tab",{active:D.value===e}]),onClick:a=>(a=>{D.value=a})(e)},{default:u(()=>[m(s,null,{default:u(()=>[v(C(a.label),1)]),_:2},1024)]),_:2},1032,["class","onClick"]))),128)),m(l,{class:"market-tabs__search"},{default:u(()=>[m(t,{name:"search",size:"24",color:"#999"}),m(c,{class:"market-tabs__input",modelValue:q.value,"onUpdate:modelValue":e[0]||(e[0]=a=>q.value=a),placeholder:"搜索","placeholder-style":"color:#ccc","confirm-type":"search"},null,8,["modelValue"]),q.value?(y(),n(t,{key:0,name:"close-circle-fill",size:"28",color:"#ccc",onClick:e[1]||(e[1]=a=>q.value="")})):L("",!0)]),_:1})]),_:1}),m(l,{class:"list-header"},{default:u(()=>[m(s,{class:"list-header__col"},{default:u(()=>[v("名称")]),_:1}),m(s,{class:"list-header__col"},{default:u(()=>[v("最新价")]),_:1}),m(s,{class:"list-header__col"},{default:u(()=>[v("24h涨跌")]),_:1})]),_:1}),m(o,{"scroll-y":"",class:"coin-list",style:p({height:R.value})},{default:u(()=>[(y(!0),b(g,null,w(G.value,a=>(y(),n(l,{key:a.symbol,class:"coin-row",onClick:e=>(a=>{z({url:`/pages/crypto/crypto_detail?symbol=${a.symbol}`})})(a)},{default:u(()=>[m(l,{class:"coin-row__left"},{default:u(()=>[m(l,{class:"coin-row__logo",style:p({background:a.color+"18"})},{default:u(()=>[m(s,{class:"coin-row__logo-text",style:p({color:a.color})},{default:u(()=>[v(C(a.icon),1)]),_:2},1032,["style"])]),_:2},1032,["style"]),m(l,{class:"coin-row__name"},{default:u(()=>[m(s,{class:"coin-row__symbol"},{default:u(()=>[v(C(a.symbol),1)]),_:2},1024),m(s,{class:"coin-row__subtitle"},{default:u(()=>[v(C(a.name),1)]),_:2},1024)]),_:2},1024)]),_:2},1024),m(l,{class:"coin-row__price"},{default:u(()=>[m(s,{class:"coin-row__price-val"},{default:u(()=>[v("$"+C(a.price),1)]),_:2},1024),m(s,{class:"coin-row__mcap"},{default:u(()=>[v("市值"+C(a.mcap),1)]),_:2},1024)]),_:2},1024),m(l,{class:k(["coin-row__badge",a.change>=0?"up":"down"])},{default:u(()=>[m(s,{class:"coin-row__badge-arrow"},{default:u(()=>[v(C(a.change>=0?"▲":"▼"),1)]),_:2},1024),m(s,{class:"coin-row__badge-text"},{default:u(()=>[v(C(Math.abs(a.change).toFixed(2))+"%",1)]),_:2},1024)]),_:2},1032,["class"])]),_:2},1032,["onClick"]))),128))]),_:1},8,["style"])]),_:1})}}}),[["__scopeId","data-v-c5a71f36"]]);export{F as default};
|
||||
import{d as a,r as e,G as l,b as s,g as t,f as c,aC as o,aA as r,c as n,w as u,j as i,k as _,a as d,P as f,o as y,l as m,m as p,q as h,t as v,x as b,F as g,y as w,z as k,v as C,aB as x,D as L,S as j,e as z,_ as I}from"./index-gD80NK0s.js";import{A as T}from"./ai-assistant-entry.BLCoe4gZ.js";import{l as V,g as A}from"./crypto.C-mKXcTs.js";const F=I(a({__name:"crypto",setup(a){const I=e(0),F=e(667),R=l(()=>{const a=I.value+d(232);return F.value-a+"px"}),$=e([]),q=e(""),B=e([{label:"热门",key:"hot"},{label:"涨幅榜",key:"gainers"},{label:"跌幅榜",key:"losers"},{label:"成交额",key:"volume"}]),D=e(0),G=l(()=>{let a=[...$.value];const e=q.value.trim().toLowerCase();return e&&(a=a.filter(a=>a.symbol.toLowerCase().includes(e)||a.name.toLowerCase().includes(e))),1===D.value?a.sort((a,e)=>e.change-a.change):2===D.value?a.sort((a,e)=>a.change-e.change):3===D.value?a.sort((a,e)=>e.priceRaw-a.priceRaw):a}),H=async()=>{console.log("[CryptoList] fetchTickers start");try{$.value=await A(),console.log("[CryptoList] fetchTickers ok count=>",$.value.length)}catch(a){console.error("[CryptoList] fetchTickers error=>",a),i({title:"行情加载失败",icon:"none"})}};let M=null;const P=()=>{M&&(clearInterval(M),M=null)};return s(()=>{t({success:a=>{F.value=a.windowHeight||667,I.value=0}}),V().then(H)}),c(()=>{P(),M=setInterval(H,3e4)}),o(()=>{P()}),r(()=>{P()}),(a,e)=>{const l=_,s=h,t=f("u-icon"),c=x,o=j;return y(),n(l,{class:"crypto-page"},{default:u(()=>[m(l,{class:"status-bar",style:p({height:I.value+"px"})},null,8,["style"]),m(l,{class:"navbar"},{default:u(()=>[m(s,{class:"navbar__title"},{default:u(()=>[v("加密行情")]),_:1}),m(T,{size:"compact"})]),_:1}),m(l,{class:"market-tabs"},{default:u(()=>[(y(!0),b(g,null,w(B.value,(a,e)=>(y(),n(l,{key:e,class:k(["market-tab",{active:D.value===e}]),onClick:a=>(a=>{D.value=a})(e)},{default:u(()=>[m(s,null,{default:u(()=>[v(C(a.label),1)]),_:2},1024)]),_:2},1032,["class","onClick"]))),128)),m(l,{class:"market-tabs__search"},{default:u(()=>[m(t,{name:"search",size:"24",color:"#999"}),m(c,{class:"market-tabs__input",modelValue:q.value,"onUpdate:modelValue":e[0]||(e[0]=a=>q.value=a),placeholder:"搜索","placeholder-style":"color:#ccc","confirm-type":"search"},null,8,["modelValue"]),q.value?(y(),n(t,{key:0,name:"close-circle-fill",size:"28",color:"#ccc",onClick:e[1]||(e[1]=a=>q.value="")})):L("",!0)]),_:1})]),_:1}),m(l,{class:"list-header"},{default:u(()=>[m(s,{class:"list-header__col"},{default:u(()=>[v("名称")]),_:1}),m(s,{class:"list-header__col"},{default:u(()=>[v("最新价")]),_:1}),m(s,{class:"list-header__col"},{default:u(()=>[v("24h涨跌")]),_:1})]),_:1}),m(o,{"scroll-y":"",class:"coin-list",style:p({height:R.value})},{default:u(()=>[(y(!0),b(g,null,w(G.value,a=>(y(),n(l,{key:a.symbol,class:"coin-row",onClick:e=>(a=>{z({url:`/pages/crypto/crypto_detail?symbol=${a.symbol}`})})(a)},{default:u(()=>[m(l,{class:"coin-row__left"},{default:u(()=>[m(l,{class:"coin-row__logo",style:p({background:a.color+"18"})},{default:u(()=>[m(s,{class:"coin-row__logo-text",style:p({color:a.color})},{default:u(()=>[v(C(a.icon),1)]),_:2},1032,["style"])]),_:2},1032,["style"]),m(l,{class:"coin-row__name"},{default:u(()=>[m(s,{class:"coin-row__symbol"},{default:u(()=>[v(C(a.symbol),1)]),_:2},1024),m(s,{class:"coin-row__subtitle"},{default:u(()=>[v(C(a.name),1)]),_:2},1024)]),_:2},1024)]),_:2},1024),m(l,{class:"coin-row__price"},{default:u(()=>[m(s,{class:"coin-row__price-val"},{default:u(()=>[v("$"+C(a.price),1)]),_:2},1024),m(s,{class:"coin-row__mcap"},{default:u(()=>[v("市值"+C(a.mcap),1)]),_:2},1024)]),_:2},1024),m(l,{class:k(["coin-row__badge",a.change>=0?"up":"down"])},{default:u(()=>[m(s,{class:"coin-row__badge-arrow"},{default:u(()=>[v(C(a.change>=0?"▲":"▼"),1)]),_:2},1024),m(s,{class:"coin-row__badge-text"},{default:u(()=>[v(C(Math.abs(a.change).toFixed(2))+"%",1)]),_:2},1024)]),_:2},1032,["class"])]),_:2},1032,["onClick"]))),128))]),_:1},8,["style"])]),_:1})}}}),[["__scopeId","data-v-c5a71f36"]]);export{F as default};
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
@@ -1 +1 @@
|
||||
import{d as e,J as s,x as a,l as t,w as n,F as l,O as c,P as r,k as o,o as u,y as p,c as m,D as y}from"./index-Becg0v_n.js";const i=e({__name:"customer_service",setup(e){const i=s({pages:[]});return(async()=>{const e=await c({id:3});i.pages=JSON.parse(e.data)})(),(e,s)=>{const c=r("page-meta"),d=r("w-customer-service"),g=o;return u(),a(l,null,[t(c,{"page-style":e.$theme.pageStyle},null,8,["page-style"]),t(g,{class:"customer-service"},{default:n(()=>[(u(!0),a(l,null,p(i.pages,(e,s)=>(u(),m(g,{key:s},{default:n(()=>["customer-service"==e.name?(u(),m(d,{key:0,content:e.content,styles:e.styles},null,8,["content","styles"])):y("",!0)]),_:2},1024))),128))]),_:1})],64)}}});export{i as default};
|
||||
import{d as e,J as s,x as a,l as t,w as n,F as l,O as c,P as r,k as o,o as u,y as p,c as m,D as y}from"./index-gD80NK0s.js";const i=e({__name:"customer_service",setup(e){const i=s({pages:[]});return(async()=>{const e=await c({id:3});i.pages=JSON.parse(e.data)})(),(e,s)=>{const c=r("page-meta"),d=r("w-customer-service"),g=o;return u(),a(l,null,[t(c,{"page-style":e.$theme.pageStyle},null,8,["page-style"]),t(g,{class:"customer-service"},{default:n(()=>[(u(!0),a(l,null,p(i.pages,(e,s)=>(u(),m(g,{key:s},{default:n(()=>["customer-service"==e.name?(u(),m(d,{key:0,content:e.content,styles:e.styles},null,8,["content","styles"])):y("",!0)]),_:2},1024))),128))]),_:1})],64)}}});export{i as default};
|
||||
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
-1
@@ -1 +1 @@
|
||||
import{d as e,a2 as l,r as a,J as o,x as s,l as t,w as d,F as r,P as u,k as m,o as n,t as i,q as p,z as c,v as f,aj as b,ak as _,al as x,a0 as w,_ as h}from"./index-Becg0v_n.js";const V=h(e({__name:"forget_pwd",setup(e){const h=l(),V=a(""),g=o({mobile:"",code:"",password:"",password_confirm:""}),y=e=>{V.value=e},v=async()=>{var e,l;g.mobile&&(null==(e=h.value)?void 0:e.canGetCode)&&(await b({scene:_.FIND_PASSWORD,mobile:g.mobile}),uni.$u.toast("发送成功"),null==(l=h.value)||l.start())},$=async()=>g.mobile?g.password?g.password_confirm?g.password!=g.password_confirm?uni.$u.toast("两次输入的密码不一致"):(await x(g),void setTimeout(()=>{w()},1500)):uni.$u.toast("请输入确认密码"):uni.$u.toast("请输入密码"):uni.$u.toast("请输入手机号码");return(e,l)=>{const a=u("page-meta"),o=m,b=u("u-input"),_=u("u-form-item"),x=u("u-verification-code"),w=p,k=u("u-form"),B=u("u-button");return n(),s(r,null,[t(a,{"page-style":e.$theme.pageStyle},null,8,["page-style"]),t(o,{class:"register bg-white min-h-full flex flex-col items-center px-[40rpx] pt-[100rpx] box-border"},{default:d(()=>[t(o,{class:"w-full"},{default:d(()=>[t(o,{class:"text-2xl font-medium mb-[60rpx]"},{default:d(()=>[i("忘记登录密码")]),_:1}),t(k,{borderBottom:"","label-width":150},{default:d(()=>[t(_,{label:"手机号",borderBottom:""},{default:d(()=>[t(b,{class:"flex-1",modelValue:g.mobile,"onUpdate:modelValue":l[0]||(l[0]=e=>g.mobile=e),border:!1,placeholder:"请输入手机号码"},null,8,["modelValue"])]),_:1}),t(_,{label:"验证码",borderBottom:""},{default:d(()=>[t(b,{class:"flex-1",modelValue:g.code,"onUpdate:modelValue":l[1]||(l[1]=e=>g.code=e),placeholder:"请输入验证码",border:!1},null,8,["modelValue"]),t(o,{class:"border-l border-solid border-0 border-light pl-3 text-muted leading-4 ml-3 w-[180rpx]",onClick:v},{default:d(()=>[t(x,{ref_key:"uCodeRef",ref:h,seconds:60,onChange:y,"change-text":"x秒"},null,512),t(w,{class:c(g.mobile?"text-primary":"text-muted")},{default:d(()=>[i(f(V.value),1)]),_:1},8,["class"])]),_:1})]),_:1}),t(_,{label:"新密码",borderBottom:""},{default:d(()=>[t(b,{class:"flex-1",type:"password",modelValue:g.password,"onUpdate:modelValue":l[2]||(l[2]=e=>g.password=e),placeholder:"6-20位数字+字母或符号组合",border:!1},null,8,["modelValue"])]),_:1}),t(_,{label:"确认密码",borderBottom:""},{default:d(()=>[t(b,{class:"flex-1",type:"password",modelValue:g.password_confirm,"onUpdate:modelValue":l[3]||(l[3]=e=>g.password_confirm=e),placeholder:"再次输入新密码",border:!1},null,8,["modelValue"])]),_:1})]),_:1}),t(o,{class:"mt-[100rpx]"},{default:d(()=>[t(B,{type:"primary",shape:"circle",onClick:$},{default:d(()=>[i(" 确定 ")]),_:1})]),_:1})]),_:1})]),_:1})],64)}}}),[["__scopeId","data-v-4d2f3a44"]]);export{V as default};
|
||||
import{d as e,a2 as l,r as a,J as o,x as s,l as t,w as d,F as r,P as u,k as m,o as n,t as i,q as p,z as c,v as f,aj as b,ak as _,al as x,a0 as w,_ as h}from"./index-gD80NK0s.js";const V=h(e({__name:"forget_pwd",setup(e){const h=l(),V=a(""),g=o({mobile:"",code:"",password:"",password_confirm:""}),y=e=>{V.value=e},v=async()=>{var e,l;g.mobile&&(null==(e=h.value)?void 0:e.canGetCode)&&(await b({scene:_.FIND_PASSWORD,mobile:g.mobile}),uni.$u.toast("发送成功"),null==(l=h.value)||l.start())},$=async()=>g.mobile?g.password?g.password_confirm?g.password!=g.password_confirm?uni.$u.toast("两次输入的密码不一致"):(await x(g),void setTimeout(()=>{w()},1500)):uni.$u.toast("请输入确认密码"):uni.$u.toast("请输入密码"):uni.$u.toast("请输入手机号码");return(e,l)=>{const a=u("page-meta"),o=m,b=u("u-input"),_=u("u-form-item"),x=u("u-verification-code"),w=p,k=u("u-form"),B=u("u-button");return n(),s(r,null,[t(a,{"page-style":e.$theme.pageStyle},null,8,["page-style"]),t(o,{class:"register bg-white min-h-full flex flex-col items-center px-[40rpx] pt-[100rpx] box-border"},{default:d(()=>[t(o,{class:"w-full"},{default:d(()=>[t(o,{class:"text-2xl font-medium mb-[60rpx]"},{default:d(()=>[i("忘记登录密码")]),_:1}),t(k,{borderBottom:"","label-width":150},{default:d(()=>[t(_,{label:"手机号",borderBottom:""},{default:d(()=>[t(b,{class:"flex-1",modelValue:g.mobile,"onUpdate:modelValue":l[0]||(l[0]=e=>g.mobile=e),border:!1,placeholder:"请输入手机号码"},null,8,["modelValue"])]),_:1}),t(_,{label:"验证码",borderBottom:""},{default:d(()=>[t(b,{class:"flex-1",modelValue:g.code,"onUpdate:modelValue":l[1]||(l[1]=e=>g.code=e),placeholder:"请输入验证码",border:!1},null,8,["modelValue"]),t(o,{class:"border-l border-solid border-0 border-light pl-3 text-muted leading-4 ml-3 w-[180rpx]",onClick:v},{default:d(()=>[t(x,{ref_key:"uCodeRef",ref:h,seconds:60,onChange:y,"change-text":"x秒"},null,512),t(w,{class:c(g.mobile?"text-primary":"text-muted")},{default:d(()=>[i(f(V.value),1)]),_:1},8,["class"])]),_:1})]),_:1}),t(_,{label:"新密码",borderBottom:""},{default:d(()=>[t(b,{class:"flex-1",type:"password",modelValue:g.password,"onUpdate:modelValue":l[2]||(l[2]=e=>g.password=e),placeholder:"6-20位数字+字母或符号组合",border:!1},null,8,["modelValue"])]),_:1}),t(_,{label:"确认密码",borderBottom:""},{default:d(()=>[t(b,{class:"flex-1",type:"password",modelValue:g.password_confirm,"onUpdate:modelValue":l[3]||(l[3]=e=>g.password_confirm=e),placeholder:"再次输入新密码",border:!1},null,8,["modelValue"])]),_:1})]),_:1}),t(o,{class:"mt-[100rpx]"},{default:d(()=>[t(B,{type:"primary",shape:"circle",onClick:$},{default:d(()=>[i(" 确定 ")]),_:1})]),_:1})]),_:1})]),_:1})],64)}}}),[["__scopeId","data-v-4d2f3a44"]]);export{V as default};
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
import{d as t,r as a,b as s,c as o,o as r}from"./index-gD80NK0s.js";import{M as e}from"./MatchShellPage.B49AV8w8.js";import"./ai-assistant-entry.BLCoe4gZ.js";import"./match.DQ-syC__.js";import"./news.BPuRIjrP.js";import"./translated-article-card.D6LrBQC8.js";const i=t({__name:"match",setup(t){const i=a({});return s(t=>{i.value=t||{}}),(t,a)=>(r(),o(e,{"initial-view":"match","route-options":i.value},null,8,["route-options"]))}});export{i as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{d as t,r as a,b as s,c as o,o as r}from"./index-Becg0v_n.js";import{M as e}from"./MatchShellPage.2dsgqG7i.js";import"./ai-assistant-entry.DF5oe7Pc.js";import"./match.eHAFLu-m.js";import"./news.jRRCA4t0.js";import"./translated-article-card.CAWyQUYr.js";const i=t({__name:"match",setup(t){const i=a({});return s(t=>{i.value=t||{}}),(t,a)=>(r(),o(e,{"initial-view":"match","route-options":i.value},null,8,["route-options"]))}});export{i as default};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
import{d as l,r as a,b as o,ay as t,M as e,c as s,w as u,k as i,P as c,o as _,l as f,z as n,q as d,t as m,S as w,D as v,x as r,F as y,y as p,p as k,v as g,R as h,N as b,e as C,_ as $}from"./index-gD80NK0s.js";import{t as x}from"./community.C9wEHP7Q.js";import{o as j}from"./chat.UW4yFR8z.js";import"./aiRequest.br0QglYY.js";import"./ai.dzY7BI1V.js";const q=$(l({__name:"my_follow",setup(l){const $=a("follow"),q=a([]),z=a(!1),D=a(!1),F=a(1);o(l=>{(null==l?void 0:l.type)&&($.value=l.type),t({title:"follow"===$.value?"我的关注":"我的粉丝"}),L(!0)});const I=l=>{$.value!==l&&($.value=l,t({title:"follow"===l?"我的关注":"我的粉丝"}),q.value=[],L(!0))},L=async(l=!1)=>{if(l&&(F.value=1,D.value=!1),!D.value){z.value=!0;try{const a="follow"===$.value?"/community/followList":"/community/fansList",o=await e.get({url:a,data:{page_no:F.value,page_size:20}}),t=(null==o?void 0:o.lists)||[];l||1===F.value?q.value=t:q.value.push(...t),t.length<20&&(D.value=!0)}catch(a){}finally{z.value=!1}}},N=()=>{D.value||z.value||(F.value++,L())},R=async l=>{try{const a=await j({target_user_id:Number(l.id||0)});(null==a?void 0:a.id)&&C({url:`/pages/private_chat/room?session_id=${a.id}`})}catch(a){}};return(l,a)=>{const o=d,t=i,e=c("u-loading"),j=k,F=c("u-empty"),L=w;return _(),s(t,{class:"follow-page"},{default:u(()=>[f(t,{class:"follow-tabs"},{default:u(()=>[f(t,{class:n(["follow-tabs__item",{"follow-tabs__item--active":"follow"===$.value}]),onClick:a[0]||(a[0]=l=>I("follow"))},{default:u(()=>[f(o,null,{default:u(()=>[m("关注")]),_:1})]),_:1},8,["class"]),f(t,{class:n(["follow-tabs__item",{"follow-tabs__item--active":"fans"===$.value}]),onClick:a[1]||(a[1]=l=>I("fans"))},{default:u(()=>[f(o,null,{default:u(()=>[m("粉丝")]),_:1})]),_:1},8,["class"])]),_:1}),f(L,{"scroll-y":"",class:"follow-list",style:{height:"calc(100vh - 90rpx)"},onScrolltolower:N},{default:u(()=>[z.value&&0===q.value.length?(_(),s(t,{key:0,class:"follow-loading"},{default:u(()=>[f(e,{mode:"circle"})]),_:1})):v("",!0),(_(!0),r(y,null,p(q.value,l=>(_(),s(t,{key:l.id,class:"follow-item",onClick:a=>{var o;(o=l.id)&&C({url:`/packages_community/pages/user_profile?user_id=${o}`})}},{default:u(()=>[f(j,{class:"follow-item__avatar",src:l.avatar||"/static/images/avatar.png",mode:"aspectFill"},null,8,["src"]),f(t,{class:"follow-item__info"},{default:u(()=>[f(o,{class:"follow-item__name"},{default:u(()=>[m(g(l.nickname||"用户"),1)]),_:2},1024),f(o,{class:"follow-item__id"},{default:u(()=>[m("ID: "+g(l.sn||""),1)]),_:2},1024)]),_:2},1024),"follow"===$.value?(_(),s(t,{key:0,class:"follow-item__actions"},{default:u(()=>[f(t,{class:"follow-item__btn follow-item__btn--followed",onClick:h(a=>(async l=>{b({title:"提示",content:`确定取消关注「${l.nickname||"该用户"}」吗?`,success:async a=>{if(a.confirm)try{await x({follow_user_id:l.id}),q.value=q.value.filter(a=>a.id!==l.id),uni.$u.toast("已取消好友")}catch(o){uni.$u.toast("操作失败,请重试")}}})})(l),["stop"])},{default:u(()=>[f(o,null,{default:u(()=>[m(g(l.is_mutual?"互相关注":"已好友"),1)]),_:2},1024)]),_:2},1032,["onClick"]),f(t,{class:"follow-item__chat",onClick:h(a=>R(l),["stop"])},{default:u(()=>[f(o,null,{default:u(()=>[m("私聊")]),_:1})]),_:2},1032,["onClick"])]),_:2},1024)):(_(),s(t,{key:1,class:"follow-item__actions"},{default:u(()=>[f(t,{class:n(["follow-item__btn",{"follow-item__btn--followed":l.is_followed}]),onClick:h(a=>(async l=>{try{const a=await x({follow_user_id:l.id}),o=null==a?void 0:a.is_followed;l.is_followed=o,l.is_mutual=!!o,uni.$u.toast(o?"已加好友":"已取消好友")}catch(a){uni.$u.toast("操作失败,请重试")}})(l),["stop"])},{default:u(()=>[f(o,null,{default:u(()=>[m(g(l.is_followed?l.is_mutual?"互相关注":"已好友":"加好友"),1)]),_:2},1024)]),_:2},1032,["class","onClick"]),l.is_followed?(_(),s(t,{key:0,class:"follow-item__chat",onClick:h(a=>R(l),["stop"])},{default:u(()=>[f(o,null,{default:u(()=>[m("私聊")]),_:1})]),_:2},1032,["onClick"])):v("",!0)]),_:2},1024))]),_:2},1032,["onClick"]))),128)),z.value||0!==q.value.length?v("",!0):(_(),s(t,{key:1,class:"follow-empty"},{default:u(()=>[f(F,{text:"follow"===$.value?"暂无关注":"暂无粉丝",mode:"data"},null,8,["text"])]),_:1})),D.value&&q.value.length>0?(_(),s(t,{key:2,class:"follow-loadmore"},{default:u(()=>[f(o,null,{default:u(()=>[m("没有更多了")]),_:1})]),_:1})):v("",!0)]),_:1})]),_:1})}}}),[["__scopeId","data-v-d8eda4db"]]);export{q as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{d as l,r as a,b as o,ay as t,M as e,c as s,w as u,k as i,P as c,o as _,l as f,z as n,q as d,t as m,S as w,D as v,x as r,F as y,y as p,p as k,v as g,R as h,N as b,e as C,_ as $}from"./index-Becg0v_n.js";import{t as x}from"./community.DYAFKSiZ.js";import{o as j}from"./chat.DC5NB-4O.js";import"./aiRequest.br0QglYY.js";const q=$(l({__name:"my_follow",setup(l){const $=a("follow"),q=a([]),z=a(!1),D=a(!1),F=a(1);o(l=>{(null==l?void 0:l.type)&&($.value=l.type),t({title:"follow"===$.value?"我的关注":"我的粉丝"}),L(!0)});const I=l=>{$.value!==l&&($.value=l,t({title:"follow"===l?"我的关注":"我的粉丝"}),q.value=[],L(!0))},L=async(l=!1)=>{if(l&&(F.value=1,D.value=!1),!D.value){z.value=!0;try{const a="follow"===$.value?"/community/followList":"/community/fansList",o=await e.get({url:a,data:{page_no:F.value,page_size:20}}),t=(null==o?void 0:o.lists)||[];l||1===F.value?q.value=t:q.value.push(...t),t.length<20&&(D.value=!0)}catch(a){}finally{z.value=!1}}},N=()=>{D.value||z.value||(F.value++,L())},R=async l=>{try{const a=await j({target_user_id:Number(l.id||0)});(null==a?void 0:a.id)&&C({url:`/pages/private_chat/room?session_id=${a.id}`})}catch(a){}};return(l,a)=>{const o=d,t=i,e=c("u-loading"),j=k,F=c("u-empty"),L=w;return _(),s(t,{class:"follow-page"},{default:u(()=>[f(t,{class:"follow-tabs"},{default:u(()=>[f(t,{class:n(["follow-tabs__item",{"follow-tabs__item--active":"follow"===$.value}]),onClick:a[0]||(a[0]=l=>I("follow"))},{default:u(()=>[f(o,null,{default:u(()=>[m("关注")]),_:1})]),_:1},8,["class"]),f(t,{class:n(["follow-tabs__item",{"follow-tabs__item--active":"fans"===$.value}]),onClick:a[1]||(a[1]=l=>I("fans"))},{default:u(()=>[f(o,null,{default:u(()=>[m("粉丝")]),_:1})]),_:1},8,["class"])]),_:1}),f(L,{"scroll-y":"",class:"follow-list",style:{height:"calc(100vh - 90rpx)"},onScrolltolower:N},{default:u(()=>[z.value&&0===q.value.length?(_(),s(t,{key:0,class:"follow-loading"},{default:u(()=>[f(e,{mode:"circle"})]),_:1})):v("",!0),(_(!0),r(y,null,p(q.value,l=>(_(),s(t,{key:l.id,class:"follow-item",onClick:a=>{var o;(o=l.id)&&C({url:`/packages_community/pages/user_profile?user_id=${o}`})}},{default:u(()=>[f(j,{class:"follow-item__avatar",src:l.avatar||"/static/images/avatar.png",mode:"aspectFill"},null,8,["src"]),f(t,{class:"follow-item__info"},{default:u(()=>[f(o,{class:"follow-item__name"},{default:u(()=>[m(g(l.nickname||"用户"),1)]),_:2},1024),f(o,{class:"follow-item__id"},{default:u(()=>[m("ID: "+g(l.sn||""),1)]),_:2},1024)]),_:2},1024),"follow"===$.value?(_(),s(t,{key:0,class:"follow-item__actions"},{default:u(()=>[f(t,{class:"follow-item__btn follow-item__btn--followed",onClick:h(a=>(async l=>{b({title:"提示",content:`确定取消关注「${l.nickname||"该用户"}」吗?`,success:async a=>{if(a.confirm)try{await x({follow_user_id:l.id}),q.value=q.value.filter(a=>a.id!==l.id),uni.$u.toast("已取消好友")}catch(o){uni.$u.toast("操作失败,请重试")}}})})(l),["stop"])},{default:u(()=>[f(o,null,{default:u(()=>[m(g(l.is_mutual?"互相关注":"已好友"),1)]),_:2},1024)]),_:2},1032,["onClick"]),f(t,{class:"follow-item__chat",onClick:h(a=>R(l),["stop"])},{default:u(()=>[f(o,null,{default:u(()=>[m("私聊")]),_:1})]),_:2},1032,["onClick"])]),_:2},1024)):(_(),s(t,{key:1,class:"follow-item__actions"},{default:u(()=>[f(t,{class:n(["follow-item__btn",{"follow-item__btn--followed":l.is_followed}]),onClick:h(a=>(async l=>{try{const a=await x({follow_user_id:l.id}),o=null==a?void 0:a.is_followed;l.is_followed=o,l.is_mutual=!!o,uni.$u.toast(o?"已加好友":"已取消好友")}catch(a){uni.$u.toast("操作失败,请重试")}})(l),["stop"])},{default:u(()=>[f(o,null,{default:u(()=>[m(g(l.is_followed?l.is_mutual?"互相关注":"已好友":"加好友"),1)]),_:2},1024)]),_:2},1032,["class","onClick"]),l.is_followed?(_(),s(t,{key:0,class:"follow-item__chat",onClick:h(a=>R(l),["stop"])},{default:u(()=>[f(o,null,{default:u(()=>[m("私聊")]),_:1})]),_:2},1032,["onClick"])):v("",!0)]),_:2},1024))]),_:2},1032,["onClick"]))),128)),z.value||0!==q.value.length?v("",!0):(_(),s(t,{key:1,class:"follow-empty"},{default:u(()=>[f(F,{text:"follow"===$.value?"暂无关注":"暂无粉丝",mode:"data"},null,8,["text"])]),_:1})),D.value&&q.value.length>0?(_(),s(t,{key:2,class:"follow-loadmore"},{default:u(()=>[f(o,null,{default:u(()=>[m("没有更多了")]),_:1})]),_:1})):v("",!0)]),_:1})]),_:1})}}}),[["__scopeId","data-v-d8eda4db"]]);export{q as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{d as a,I as e,u as t,r as l,f as s,c as u,w as o,k as n,P as r,o as c,l as d,S as _,D as i,x as f,F as v,y as p,q as m,t as y,v as g,e as h,_ as k}from"./index-Becg0v_n.js";import{g as w}from"./community.DYAFKSiZ.js";import"./aiRequest.br0QglYY.js";const D=k(a({__name:"my_posts",setup(a){const{userInfo:k}=e(t()),D=l([]),x=l(!1),M=l(!1),j=l(!1),I=l(1);s(()=>{I.value=1,j.value=!1,$(!0)});const $=async(a=!1)=>{var e;if(a&&(I.value=1,j.value=!1),!j.value){1===I.value?x.value=!0:M.value=!0;try{const t=await w({page_no:I.value,page_size:15,user_id:null==(e=k.value)?void 0:e.id}),l=(null==t?void 0:t.lists)||[];a||1===I.value?D.value=l:D.value.push(...l),l.length<15&&(j.value=!0)}catch(t){}finally{x.value=!1,M.value=!1}}},q=()=>{j.value||M.value||(I.value++,$())},z=a=>{if(!a)return"";let e;if(e="string"==typeof a?new Date(a.replace(/-/g,"/")).getTime()/1e3:a,isNaN(e))return"";const t=Date.now()/1e3-e;if(t<60)return"刚刚";if(t<3600)return Math.floor(t/60)+"分钟前";if(t<86400)return Math.floor(t/3600)+"小时前";if(t<2592e3)return Math.floor(t/86400)+"天前";const l=new Date(1e3*e);return`${l.getMonth()+1}-${l.getDate()}`};return(a,e)=>{const t=r("u-loading"),l=n,s=m,k=r("u-empty"),w=_;return c(),u(l,{class:"my-posts-page"},{default:o(()=>[d(w,{"scroll-y":"",class:"my-posts-list",style:{height:"100vh"},onScrolltolower:q},{default:o(()=>[x.value&&0===D.value.length?(c(),u(l,{key:0,class:"my-posts-loading"},{default:o(()=>[d(t,{mode:"circle"})]),_:1})):i("",!0),(c(!0),f(v,null,p(D.value,a=>(c(),u(l,{key:a.id,class:"post-card",onClick:e=>{return t=a.id,void h({url:`/packages_community/pages/post_detail?id=${t}`});var t}},{default:o(()=>[d(l,{class:"post-card__content"},{default:o(()=>[d(s,null,{default:o(()=>[y(g(a.content_short||a.content),1)]),_:2},1024)]),_:2},1024),a.tags&&a.tags.length>0?(c(),u(l,{key:0,class:"post-card__tags"},{default:o(()=>[(c(!0),f(v,null,p(a.tags,(a,e)=>(c(),u(s,{key:e,class:"post-card__tag"},{default:o(()=>[y("#"+g(a),1)]),_:2},1024))),128))]),_:2},1024)):i("",!0),d(l,{class:"post-card__footer"},{default:o(()=>[d(s,{class:"post-card__time"},{default:o(()=>[y(g(z(a.create_time)),1)]),_:2},1024),d(l,{class:"post-card__stats"},{default:o(()=>[d(s,null,{default:o(()=>[y("浏览 "+g(a.view_count||0),1)]),_:2},1024),d(s,null,{default:o(()=>[y("评论 "+g(a.comment_count||0),1)]),_:2},1024),d(s,null,{default:o(()=>[y("点赞 "+g(a.like_count||0),1)]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1032,["onClick"]))),128)),x.value||0!==D.value.length?i("",!0):(c(),u(l,{key:1,class:"my-posts-empty"},{default:o(()=>[d(k,{text:"暂无帖子",mode:"data"})]),_:1})),M.value?(c(),u(l,{key:2,class:"my-posts-loadmore"},{default:o(()=>[d(t,{mode:"circle",size:"28"}),d(s,null,{default:o(()=>[y("加载中...")]),_:1})]),_:1})):i("",!0),j.value&&D.value.length>0?(c(),u(l,{key:3,class:"my-posts-loadmore"},{default:o(()=>[d(s,null,{default:o(()=>[y("没有更多了")]),_:1})]),_:1})):i("",!0)]),_:1})]),_:1})}}}),[["__scopeId","data-v-41c9ad81"]]);export{D as default};
|
||||
@@ -0,0 +1 @@
|
||||
import{d as a,I as e,u as t,r as l,f as s,c as u,w as o,k as n,P as r,o as c,l as d,S as _,D as i,x as f,F as v,y as p,q as m,t as y,v as g,e as h,_ as k}from"./index-gD80NK0s.js";import{g as w}from"./community.C9wEHP7Q.js";import"./aiRequest.br0QglYY.js";import"./ai.dzY7BI1V.js";const D=k(a({__name:"my_posts",setup(a){const{userInfo:k}=e(t()),D=l([]),j=l(!1),x=l(!1),M=l(!1),I=l(1);s(()=>{I.value=1,M.value=!1,$(!0)});const $=async(a=!1)=>{var e;if(a&&(I.value=1,M.value=!1),!M.value){1===I.value?j.value=!0:x.value=!0;try{const t=await w({page_no:I.value,page_size:15,user_id:null==(e=k.value)?void 0:e.id}),l=(null==t?void 0:t.lists)||[];a||1===I.value?D.value=l:D.value.push(...l),l.length<15&&(M.value=!0)}catch(t){}finally{j.value=!1,x.value=!1}}},q=()=>{M.value||x.value||(I.value++,$())},z=a=>{if(!a)return"";let e;if(e="string"==typeof a?new Date(a.replace(/-/g,"/")).getTime()/1e3:a,isNaN(e))return"";const t=Date.now()/1e3-e;if(t<60)return"刚刚";if(t<3600)return Math.floor(t/60)+"分钟前";if(t<86400)return Math.floor(t/3600)+"小时前";if(t<2592e3)return Math.floor(t/86400)+"天前";const l=new Date(1e3*e);return`${l.getMonth()+1}-${l.getDate()}`};return(a,e)=>{const t=r("u-loading"),l=n,s=m,k=r("u-empty"),w=_;return c(),u(l,{class:"my-posts-page"},{default:o(()=>[d(w,{"scroll-y":"",class:"my-posts-list",style:{height:"100vh"},onScrolltolower:q},{default:o(()=>[j.value&&0===D.value.length?(c(),u(l,{key:0,class:"my-posts-loading"},{default:o(()=>[d(t,{mode:"circle"})]),_:1})):i("",!0),(c(!0),f(v,null,p(D.value,a=>(c(),u(l,{key:a.id,class:"post-card",onClick:e=>{return t=a.id,void h({url:`/packages_community/pages/post_detail?id=${t}`});var t}},{default:o(()=>[d(l,{class:"post-card__content"},{default:o(()=>[d(s,null,{default:o(()=>[y(g(a.content_short||a.content),1)]),_:2},1024)]),_:2},1024),a.tags&&a.tags.length>0?(c(),u(l,{key:0,class:"post-card__tags"},{default:o(()=>[(c(!0),f(v,null,p(a.tags,(a,e)=>(c(),u(s,{key:e,class:"post-card__tag"},{default:o(()=>[y("#"+g(a),1)]),_:2},1024))),128))]),_:2},1024)):i("",!0),d(l,{class:"post-card__footer"},{default:o(()=>[d(s,{class:"post-card__time"},{default:o(()=>[y(g(z(a.create_time)),1)]),_:2},1024),d(l,{class:"post-card__stats"},{default:o(()=>[d(s,null,{default:o(()=>[y("浏览 "+g(a.view_count||0),1)]),_:2},1024),d(s,null,{default:o(()=>[y("评论 "+g(a.comment_count||0),1)]),_:2},1024),d(s,null,{default:o(()=>[y("点赞 "+g(a.like_count||0),1)]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1032,["onClick"]))),128)),j.value||0!==D.value.length?i("",!0):(c(),u(l,{key:1,class:"my-posts-empty"},{default:o(()=>[d(k,{text:"暂无帖子",mode:"data"})]),_:1})),x.value?(c(),u(l,{key:2,class:"my-posts-loadmore"},{default:o(()=>[d(t,{mode:"circle",size:"28"}),d(s,null,{default:o(()=>[y("加载中...")]),_:1})]),_:1})):i("",!0),M.value&&D.value.length>0?(c(),u(l,{key:3,class:"my-posts-loadmore"},{default:o(()=>[d(s,null,{default:o(()=>[y("没有更多了")]),_:1})]),_:1})):i("",!0)]),_:1})]),_:1})}}}),[["__scopeId","data-v-41c9ad81"]]);export{D as default};
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
@@ -1 +1 @@
|
||||
import{M as e,d as a,r as t,a$ as s,J as l,G as r,b as u,x as n,l as c,w as i,F as d,P as o,ac as m,o as _,k as p,q as f,t as g,v as y,c as x,D as h,_ as v}from"./index-Becg0v_n.js";const w=v(a({__name:"payment_result",setup(a){const v=m(),w={succeed:{text:"支付成功",image:"/static/images/payment/icon_succeed.png"},waiting:{text:"等待支付",image:"/static/images/payment/icon_waiting.png"}},b=t(s.LOADING),k=t({id:"",from:""}),O=l({order:{}}),R=r(()=>{const e=!!O.pay_status;return w[e?"succeed":"waiting"]}),A=()=>new Promise((a,t)=>{var s;(s={order_id:k.value.id,from:k.value.from},e.get({url:"/pay/payStatus",data:s},{isAuth:!0})).then(e=>{Object.assign(O,e),a(e)}).catch(e=>{t(e)})}),L=()=>{v.reLaunch("/pages/index/index")},j=()=>{if("recharge"===k.value.from)v.navigateBack()};return u(async e=>{try{if(!e.id)throw new Error("订单不存在");k.value=e,await A(),b.value=s.NORMAL}catch(a){console.log(a),b.value=s.ERROR}}),(e,a)=>{const t=o("page-meta"),s=o("u-empty"),l=o("u-image"),r=f,u=p,m=o("u-button"),v=o("page-status");return _(),n(d,null,[c(t,{"page-style":e.$theme.pageStyle},null,8,["page-style"]),c(v,{status:b.value},{error:i(()=>[c(s,{text:"订单不存在",mode:"order"})]),default:i(()=>[c(u,{class:"payment-result p-[20rpx]"},{default:i(()=>[c(u,{class:"result bg-white p-[20rpx] rounded-md"},{default:i(()=>[c(u,{class:"flex flex-col items-center my-[40rpx]"},{default:i(()=>[c(l,{class:"status-image",src:R.value.image,width:"100",height:"100",shape:"circle"},null,8,["src"]),c(r,{class:"text-2xl font-medium mt-[20rpx]"},{default:i(()=>[g(y(R.value.text),1)]),_:1}),c(u,{class:"text-3xl font-medium mt-[20rpx]"},{default:i(()=>[g(" ¥ "+y(O.order.order_amount),1)]),_:1})]),_:1}),c(u,{class:"result-info"},{default:i(()=>[c(u,{class:"result-info__item"},{default:i(()=>[c(r,null,{default:i(()=>[g("订单编号")]),_:1}),c(r,null,{default:i(()=>[g(y(O.order.order_sn),1)]),_:1})]),_:1}),c(u,{class:"result-info__item"},{default:i(()=>[c(r,null,{default:i(()=>[g("付款时间")]),_:1}),c(r,null,{default:i(()=>[g(y(O.order.pay_time),1)]),_:1})]),_:1}),c(u,{class:"result-info__item"},{default:i(()=>[c(r,null,{default:i(()=>[g("支付方式")]),_:1}),O.pay_status?(_(),x(r,{key:0},{default:i(()=>[g(y(O.order.pay_way||"-"),1)]),_:1})):(_(),x(r,{key:1},{default:i(()=>[g("未支付")]),_:1}))]),_:1})]),_:1})]),_:1}),c(u,{class:"mt-[40rpx]"},{default:i(()=>[c(u,{class:"mb-[20rpx]"},{default:i(()=>["recharge"==k.value.from?(_(),x(m,{key:0,type:"primary",shape:"circle","hover-class":"none",onClick:j},{default:i(()=>[g(" 继续充值 ")]),_:1})):h("",!0)]),_:1}),c(u,{class:"mb-[20rpx]"},{default:i(()=>[c(m,{type:"primary",plain:"",shape:"circle","hover-class":"none",onClick:L},{default:i(()=>[g(" 返回首页 ")]),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,["status"])],64)}}}),[["__scopeId","data-v-bba82a10"]]);export{w as default};
|
||||
import{M as e,d as a,r as t,a$ as s,J as l,G as r,b as u,x as n,l as c,w as i,F as d,P as o,ac as m,o as _,k as p,q as f,t as g,v as y,c as x,D as h,_ as v}from"./index-gD80NK0s.js";const w=v(a({__name:"payment_result",setup(a){const v=m(),w={succeed:{text:"支付成功",image:"/static/images/payment/icon_succeed.png"},waiting:{text:"等待支付",image:"/static/images/payment/icon_waiting.png"}},b=t(s.LOADING),k=t({id:"",from:""}),O=l({order:{}}),R=r(()=>{const e=!!O.pay_status;return w[e?"succeed":"waiting"]}),A=()=>new Promise((a,t)=>{var s;(s={order_id:k.value.id,from:k.value.from},e.get({url:"/pay/payStatus",data:s},{isAuth:!0})).then(e=>{Object.assign(O,e),a(e)}).catch(e=>{t(e)})}),L=()=>{v.reLaunch("/pages/index/index")},j=()=>{if("recharge"===k.value.from)v.navigateBack()};return u(async e=>{try{if(!e.id)throw new Error("订单不存在");k.value=e,await A(),b.value=s.NORMAL}catch(a){console.log(a),b.value=s.ERROR}}),(e,a)=>{const t=o("page-meta"),s=o("u-empty"),l=o("u-image"),r=f,u=p,m=o("u-button"),v=o("page-status");return _(),n(d,null,[c(t,{"page-style":e.$theme.pageStyle},null,8,["page-style"]),c(v,{status:b.value},{error:i(()=>[c(s,{text:"订单不存在",mode:"order"})]),default:i(()=>[c(u,{class:"payment-result p-[20rpx]"},{default:i(()=>[c(u,{class:"result bg-white p-[20rpx] rounded-md"},{default:i(()=>[c(u,{class:"flex flex-col items-center my-[40rpx]"},{default:i(()=>[c(l,{class:"status-image",src:R.value.image,width:"100",height:"100",shape:"circle"},null,8,["src"]),c(r,{class:"text-2xl font-medium mt-[20rpx]"},{default:i(()=>[g(y(R.value.text),1)]),_:1}),c(u,{class:"text-3xl font-medium mt-[20rpx]"},{default:i(()=>[g(" ¥ "+y(O.order.order_amount),1)]),_:1})]),_:1}),c(u,{class:"result-info"},{default:i(()=>[c(u,{class:"result-info__item"},{default:i(()=>[c(r,null,{default:i(()=>[g("订单编号")]),_:1}),c(r,null,{default:i(()=>[g(y(O.order.order_sn),1)]),_:1})]),_:1}),c(u,{class:"result-info__item"},{default:i(()=>[c(r,null,{default:i(()=>[g("付款时间")]),_:1}),c(r,null,{default:i(()=>[g(y(O.order.pay_time),1)]),_:1})]),_:1}),c(u,{class:"result-info__item"},{default:i(()=>[c(r,null,{default:i(()=>[g("支付方式")]),_:1}),O.pay_status?(_(),x(r,{key:0},{default:i(()=>[g(y(O.order.pay_way||"-"),1)]),_:1})):(_(),x(r,{key:1},{default:i(()=>[g("未支付")]),_:1}))]),_:1})]),_:1})]),_:1}),c(u,{class:"mt-[40rpx]"},{default:i(()=>[c(u,{class:"mb-[20rpx]"},{default:i(()=>["recharge"==k.value.from?(_(),x(m,{key:0,type:"primary",shape:"circle","hover-class":"none",onClick:j},{default:i(()=>[g(" 继续充值 ")]),_:1})):h("",!0)]),_:1}),c(u,{class:"mb-[20rpx]"},{default:i(()=>[c(m,{type:"primary",plain:"",shape:"circle","hover-class":"none",onClick:L},{default:i(()=>[g(" 返回首页 ")]),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,["status"])],64)}}}),[["__scopeId","data-v-bba82a10"]]);export{w as default};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{d as e,r as a,b as s,K as t,f as l,c as n,w as u,k as i,P as o,o as r,l as _,m as c,q as d,t as v,S as m,D as g,x as f,F as p,y as h,p as y,v as k,e as b,a8 as w,a0 as D,av as x,_ as S}from"./index-Becg0v_n.js";import{g as F}from"./chat.DC5NB-4O.js";const N=S(e({__name:"list",setup(e){const S=a(0),N=a([]),$=a(!1),C=a(!1),M=a(1);s(()=>{t(),S.value=0}),l(()=>{z(!0)});const z=async(e=!0)=>{if(!$.value&&(e&&(M.value=1,C.value=!1),!C.value)){$.value=!0;try{const a=await F({page_no:M.value,page_size:20}),s=(null==a?void 0:a.lists)||[];N.value=e?s:N.value.concat(s),s.length<20?C.value=!0:M.value++}catch(a){e&&(N.value=[])}finally{$.value=!1}}},j=()=>{$.value||C.value||z(!1)},T=e=>e.last_message_id?"image"===e.last_message_type?"[图片]":e.last_message_content||"消息":"还没有消息",Y=e=>{var a,s;return(null==(a=e.relationship)?void 0:a.relationship_text)||((null==(s=e.relationship)?void 0:s.is_mutual)?"互相关注":"对方还未添加你为好友")},q=e=>{if(!e)return"";let a=0;if("number"==typeof e)a=e>1e12?e:1e3*e;else{const s=Number(e);a=Number.isFinite(s)&&s>0?1e3*s:new Date(e.replace(/-/g,"/")).getTime()}if(!a||Number.isNaN(a))return"";const s=new Date(a),t=new Date,l=s.getFullYear()===t.getFullYear()&&s.getMonth()===t.getMonth()&&s.getDate()===t.getDate(),n=String(s.getHours()).padStart(2,"0"),u=String(s.getMinutes()).padStart(2,"0");return l?`${n}:${u}`:`${s.getMonth()+1}-${s.getDate()}`},H=()=>{w().length>1?D():x({url:"/pages/user/user"})};return(e,a)=>{const s=o("u-icon"),t=i,l=d,w=o("u-loading"),D=y,x=o("u-empty"),F=m;return r(),n(t,{class:"chat-list-page"},{default:u(()=>[_(t,{class:"chat-nav",style:c({paddingTop:S.value+"px"})},{default:u(()=>[_(t,{class:"chat-nav__btn",onClick:H},{default:u(()=>[_(s,{name:"arrow-left",size:"34",color:"#111827"})]),_:1}),_(l,{class:"chat-nav__title"},{default:u(()=>[v("私聊消息")]),_:1}),_(t,{class:"chat-nav__btn",onClick:a[0]||(a[0]=e=>z(!0))},{default:u(()=>[_(s,{name:"reload",size:"30",color:"#111827"})]),_:1})]),_:1},8,["style"]),_(F,{"scroll-y":"",class:"chat-list-scroll",onScrolltolower:j},{default:u(()=>[$.value&&0===N.value.length?(r(),n(t,{key:0,class:"chat-list-state"},{default:u(()=>[_(w,{mode:"circle"})]),_:1})):g("",!0),(r(!0),f(p,null,h(N.value,e=>(r(),n(t,{key:e.id,class:"session-item",onClick:a=>(e=>{b({url:`/pages/private_chat/room?session_id=${e.id}`})})(e)},{default:u(()=>{var a;return[_(D,{class:"session-item__avatar",src:(null==(a=e.target_user)?void 0:a.avatar)||"/static/images/avatar.png",mode:"aspectFill"},null,8,["src"]),_(t,{class:"session-item__body"},{default:u(()=>[_(t,{class:"session-item__top"},{default:u(()=>[_(l,{class:"session-item__name"},{default:u(()=>{var a;return[v(k((null==(a=e.target_user)?void 0:a.nickname)||"用户"),1)]}),_:2},1024),_(l,{class:"session-item__time"},{default:u(()=>[v(k(q(e.last_active_time||e.create_time)),1)]),_:2},1024)]),_:2},1024),_(t,{class:"session-item__bottom"},{default:u(()=>[_(l,{class:"session-item__message"},{default:u(()=>[v(k(T(e)),1)]),_:2},1024),_(l,{class:"session-item__relation"},{default:u(()=>[v(k(Y(e)),1)]),_:2},1024)]),_:2},1024)]),_:2},1024),e.unread_count>0?(r(),n(t,{key:0,class:"session-item__badge"},{default:u(()=>[_(l,null,{default:u(()=>[v(k(e.unread_count>99?"99+":e.unread_count),1)]),_:2},1024)]),_:2},1024)):g("",!0)]}),_:2},1032,["onClick"]))),128)),$.value||0!==N.value.length?g("",!0):(r(),n(t,{key:1,class:"chat-list-empty"},{default:u(()=>[_(x,{text:"暂无私聊消息",mode:"data"})]),_:1})),C.value&&N.value.length>0?(r(),n(t,{key:2,class:"chat-list-finished"},{default:u(()=>[_(l,null,{default:u(()=>[v("没有更多了")]),_:1})]),_:1})):g("",!0)]),_:1})]),_:1})}}}),[["__scopeId","data-v-67a71261"]]);export{N as default};
|
||||
import{d as e,r as a,b as s,K as t,f as l,c as n,w as u,k as i,P as o,o as r,l as _,m as c,q as d,t as v,S as m,D as g,x as f,F as p,y as h,p as y,v as k,e as b,a8 as w,a0 as D,av as x,_ as S}from"./index-gD80NK0s.js";import{g as F}from"./chat.UW4yFR8z.js";const N=S(e({__name:"list",setup(e){const S=a(0),N=a([]),$=a(!1),C=a(!1),M=a(1);s(()=>{t(),S.value=0}),l(()=>{z(!0)});const z=async(e=!0)=>{if(!$.value&&(e&&(M.value=1,C.value=!1),!C.value)){$.value=!0;try{const a=await F({page_no:M.value,page_size:20}),s=(null==a?void 0:a.lists)||[];N.value=e?s:N.value.concat(s),s.length<20?C.value=!0:M.value++}catch(a){e&&(N.value=[])}finally{$.value=!1}}},j=()=>{$.value||C.value||z(!1)},T=e=>e.last_message_id?"image"===e.last_message_type?"[图片]":e.last_message_content||"消息":"还没有消息",Y=e=>{var a,s;return(null==(a=e.relationship)?void 0:a.relationship_text)||((null==(s=e.relationship)?void 0:s.is_mutual)?"互相关注":"对方还未添加你为好友")},q=e=>{if(!e)return"";let a=0;if("number"==typeof e)a=e>1e12?e:1e3*e;else{const s=Number(e);a=Number.isFinite(s)&&s>0?1e3*s:new Date(e.replace(/-/g,"/")).getTime()}if(!a||Number.isNaN(a))return"";const s=new Date(a),t=new Date,l=s.getFullYear()===t.getFullYear()&&s.getMonth()===t.getMonth()&&s.getDate()===t.getDate(),n=String(s.getHours()).padStart(2,"0"),u=String(s.getMinutes()).padStart(2,"0");return l?`${n}:${u}`:`${s.getMonth()+1}-${s.getDate()}`},H=()=>{w().length>1?D():x({url:"/pages/user/user"})};return(e,a)=>{const s=o("u-icon"),t=i,l=d,w=o("u-loading"),D=y,x=o("u-empty"),F=m;return r(),n(t,{class:"chat-list-page"},{default:u(()=>[_(t,{class:"chat-nav",style:c({paddingTop:S.value+"px"})},{default:u(()=>[_(t,{class:"chat-nav__btn",onClick:H},{default:u(()=>[_(s,{name:"arrow-left",size:"34",color:"#111827"})]),_:1}),_(l,{class:"chat-nav__title"},{default:u(()=>[v("私聊消息")]),_:1}),_(t,{class:"chat-nav__btn",onClick:a[0]||(a[0]=e=>z(!0))},{default:u(()=>[_(s,{name:"reload",size:"30",color:"#111827"})]),_:1})]),_:1},8,["style"]),_(F,{"scroll-y":"",class:"chat-list-scroll",onScrolltolower:j},{default:u(()=>[$.value&&0===N.value.length?(r(),n(t,{key:0,class:"chat-list-state"},{default:u(()=>[_(w,{mode:"circle"})]),_:1})):g("",!0),(r(!0),f(p,null,h(N.value,e=>(r(),n(t,{key:e.id,class:"session-item",onClick:a=>(e=>{b({url:`/pages/private_chat/room?session_id=${e.id}`})})(e)},{default:u(()=>{var a;return[_(D,{class:"session-item__avatar",src:(null==(a=e.target_user)?void 0:a.avatar)||"/static/images/avatar.png",mode:"aspectFill"},null,8,["src"]),_(t,{class:"session-item__body"},{default:u(()=>[_(t,{class:"session-item__top"},{default:u(()=>[_(l,{class:"session-item__name"},{default:u(()=>{var a;return[v(k((null==(a=e.target_user)?void 0:a.nickname)||"用户"),1)]}),_:2},1024),_(l,{class:"session-item__time"},{default:u(()=>[v(k(q(e.last_active_time||e.create_time)),1)]),_:2},1024)]),_:2},1024),_(t,{class:"session-item__bottom"},{default:u(()=>[_(l,{class:"session-item__message"},{default:u(()=>[v(k(T(e)),1)]),_:2},1024),_(l,{class:"session-item__relation"},{default:u(()=>[v(k(Y(e)),1)]),_:2},1024)]),_:2},1024)]),_:2},1024),e.unread_count>0?(r(),n(t,{key:0,class:"session-item__badge"},{default:u(()=>[_(l,null,{default:u(()=>[v(k(e.unread_count>99?"99+":e.unread_count),1)]),_:2},1024)]),_:2},1024)):g("",!0)]}),_:2},1032,["onClick"]))),128)),$.value||0!==N.value.length?g("",!0):(r(),n(t,{key:1,class:"chat-list-empty"},{default:u(()=>[_(x,{text:"暂无私聊消息",mode:"data"})]),_:1})),C.value&&N.value.length>0?(r(),n(t,{key:2,class:"chat-list-finished"},{default:u(()=>[_(l,null,{default:u(()=>[v("没有更多了")]),_:1})]),_:1})):g("",!0)]),_:1})]),_:1})}}}),[["__scopeId","data-v-67a71261"]]);export{N as default};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
-1
@@ -1 +1 @@
|
||||
import{d as e,r as a,H as l,G as t,J as r,x as s,l as o,w as d,F as u,P as p,k as n,o as c,t as i,c as m,R as f,D as x,ai as _,a0 as g,_ as h}from"./index-Becg0v_n.js";const y=h(e({__name:"register",setup(e){const h=a(!1),y=l(),b=t(()=>1==y.getLoginConfig.login_agreement),v=r({account:"",password:"",password_confirm:""}),w=a(!1),V=async()=>v.account?v.password?v.password_confirm?!h.value&&b.value?w.value=!0:v.password!=v.password_confirm?uni.$u.toast("两次输入的密码不一致"):(await _(v),void setTimeout(function(){g()},1e3)):uni.$u.toast("请输入确认密码"):uni.$u.toast("请输入密码"):uni.$u.toast("请输入账号");return(e,a)=>{const l=p("page-meta"),t=n,r=p("u-input"),_=p("router-navigate"),g=p("u-checkbox"),y=p("u-button"),k=p("u-modal");return c(),s(u,null,[o(l,{"page-style":e.$theme.pageStyle},null,8,["page-style"]),o(t,{class:"register bg-white min-h-full flex flex-col items-center px-[40rpx] pt-[40rpx] box-border"},{default:d(()=>[o(t,{class:"w-full"},{default:d(()=>[o(t,{class:"text-2xl font-medium mb-[60rpx]"},{default:d(()=>[i("注册新账号")]),_:1}),o(t,{class:"px-[18rpx] border border-solid border-lightc border-light rounded-[10rpx] h-[100rpx] items-center flex"},{default:d(()=>[o(r,{class:"flex-1",modelValue:v.account,"onUpdate:modelValue":a[0]||(a[0]=e=>v.account=e),border:!1,placeholder:"请输入账号"},null,8,["modelValue"])]),_:1}),o(t,{class:"px-[18rpx] border border-solid border-lightc border-light rounded-[10rpx] h-[100rpx] items-center flex mt-[40rpx]"},{default:d(()=>[o(r,{class:"flex-1",type:"password",modelValue:v.password,"onUpdate:modelValue":a[1]||(a[1]=e=>v.password=e),placeholder:"请输入密码",border:!1},null,8,["modelValue"])]),_:1}),o(t,{class:"px-[18rpx] border border-solid border-lightc border-light rounded-[10rpx] h-[100rpx] items-center flex mt-[40rpx]"},{default:d(()=>[o(r,{class:"flex-1",type:"password",modelValue:v.password_confirm,"onUpdate:modelValue":a[2]||(a[2]=e=>v.password_confirm=e),placeholder:"请再次输入密码",border:!1},null,8,["modelValue"])]),_:1}),b.value?(c(),m(t,{key:0,class:"mt-[40rpx]"},{default:d(()=>[o(g,{modelValue:h.value,"onUpdate:modelValue":a[5]||(a[5]=e=>h.value=e),shape:"circle"},{default:d(()=>[o(t,{class:"text-xs flex"},{default:d(()=>[i(" 已阅读并同意 "),o(t,{onClick:a[3]||(a[3]=f(()=>{},["stop"]))},{default:d(()=>[o(_,{class:"text-primary","hover-class":"none",to:"/pages/agreement/agreement?type=service"},{default:d(()=>[i(" 《服务协议》 ")]),_:1})]),_:1}),i(" 和 "),o(t,{onClick:a[4]||(a[4]=f(()=>{},["stop"]))},{default:d(()=>[o(_,{class:"text-primary","hover-class":"none",to:"/pages/agreement/agreement?type=privacy"},{default:d(()=>[i(" 《隐私协议》 ")]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"])]),_:1})):x("",!0),o(t,{class:"mt-[60rpx]"},{default:d(()=>[o(y,{type:"primary","hover-class":"none",onClick:V,customStyle:{height:"100rpx",opacity:v.account&&v.password&&v.password_confirm?"1":"0.5"}},{default:d(()=>[i(" 注册 ")]),_:1},8,["customStyle"])]),_:1})]),_:1})]),_:1}),o(k,{modelValue:w.value,"onUpdate:modelValue":a[6]||(a[6]=e=>w.value=e),"show-cancel-button":"","show-title":!1,onConfirm:a[7]||(a[7]=e=>{h.value=!0,w.value=!1}),onCancel:a[8]||(a[8]=e=>w.value=!1),"confirm-color":"var(--color-primary)"},{default:d(()=>[o(t,{class:"text-center px-[70rpx] py-[60rpx]"},{default:d(()=>[o(t,null,{default:d(()=>[i(" 请先阅读并同意")]),_:1}),o(t,{class:"flex justify-center"},{default:d(()=>[o(_,{"data-theme":"",to:"/pages/agreement/agreement?type=service"},{default:d(()=>[o(t,{class:"text-primary"},{default:d(()=>[i("《服务协议》")]),_:1})]),_:1}),i(" 和 "),o(_,{to:"/pages/agreement/agreement?type=privacy"},{default:d(()=>[o(t,{class:"text-primary"},{default:d(()=>[i("《隐私协议》")]),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"])],64)}}}),[["__scopeId","data-v-d6995219"]]);export{y as default};
|
||||
import{d as e,r as a,H as l,G as t,J as r,x as s,l as o,w as d,F as u,P as p,k as n,o as c,t as i,c as m,R as f,D as x,ai as _,a0 as g,_ as h}from"./index-gD80NK0s.js";const y=h(e({__name:"register",setup(e){const h=a(!1),y=l(),b=t(()=>1==y.getLoginConfig.login_agreement),v=r({account:"",password:"",password_confirm:""}),w=a(!1),V=async()=>v.account?v.password?v.password_confirm?!h.value&&b.value?w.value=!0:v.password!=v.password_confirm?uni.$u.toast("两次输入的密码不一致"):(await _(v),void setTimeout(function(){g()},1e3)):uni.$u.toast("请输入确认密码"):uni.$u.toast("请输入密码"):uni.$u.toast("请输入账号");return(e,a)=>{const l=p("page-meta"),t=n,r=p("u-input"),_=p("router-navigate"),g=p("u-checkbox"),y=p("u-button"),k=p("u-modal");return c(),s(u,null,[o(l,{"page-style":e.$theme.pageStyle},null,8,["page-style"]),o(t,{class:"register bg-white min-h-full flex flex-col items-center px-[40rpx] pt-[40rpx] box-border"},{default:d(()=>[o(t,{class:"w-full"},{default:d(()=>[o(t,{class:"text-2xl font-medium mb-[60rpx]"},{default:d(()=>[i("注册新账号")]),_:1}),o(t,{class:"px-[18rpx] border border-solid border-lightc border-light rounded-[10rpx] h-[100rpx] items-center flex"},{default:d(()=>[o(r,{class:"flex-1",modelValue:v.account,"onUpdate:modelValue":a[0]||(a[0]=e=>v.account=e),border:!1,placeholder:"请输入账号"},null,8,["modelValue"])]),_:1}),o(t,{class:"px-[18rpx] border border-solid border-lightc border-light rounded-[10rpx] h-[100rpx] items-center flex mt-[40rpx]"},{default:d(()=>[o(r,{class:"flex-1",type:"password",modelValue:v.password,"onUpdate:modelValue":a[1]||(a[1]=e=>v.password=e),placeholder:"请输入密码",border:!1},null,8,["modelValue"])]),_:1}),o(t,{class:"px-[18rpx] border border-solid border-lightc border-light rounded-[10rpx] h-[100rpx] items-center flex mt-[40rpx]"},{default:d(()=>[o(r,{class:"flex-1",type:"password",modelValue:v.password_confirm,"onUpdate:modelValue":a[2]||(a[2]=e=>v.password_confirm=e),placeholder:"请再次输入密码",border:!1},null,8,["modelValue"])]),_:1}),b.value?(c(),m(t,{key:0,class:"mt-[40rpx]"},{default:d(()=>[o(g,{modelValue:h.value,"onUpdate:modelValue":a[5]||(a[5]=e=>h.value=e),shape:"circle"},{default:d(()=>[o(t,{class:"text-xs flex"},{default:d(()=>[i(" 已阅读并同意 "),o(t,{onClick:a[3]||(a[3]=f(()=>{},["stop"]))},{default:d(()=>[o(_,{class:"text-primary","hover-class":"none",to:"/pages/agreement/agreement?type=service"},{default:d(()=>[i(" 《服务协议》 ")]),_:1})]),_:1}),i(" 和 "),o(t,{onClick:a[4]||(a[4]=f(()=>{},["stop"]))},{default:d(()=>[o(_,{class:"text-primary","hover-class":"none",to:"/pages/agreement/agreement?type=privacy"},{default:d(()=>[i(" 《隐私协议》 ")]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"])]),_:1})):x("",!0),o(t,{class:"mt-[60rpx]"},{default:d(()=>[o(y,{type:"primary","hover-class":"none",onClick:V,customStyle:{height:"100rpx",opacity:v.account&&v.password&&v.password_confirm?"1":"0.5"}},{default:d(()=>[i(" 注册 ")]),_:1},8,["customStyle"])]),_:1})]),_:1})]),_:1}),o(k,{modelValue:w.value,"onUpdate:modelValue":a[6]||(a[6]=e=>w.value=e),"show-cancel-button":"","show-title":!1,onConfirm:a[7]||(a[7]=e=>{h.value=!0,w.value=!1}),onCancel:a[8]||(a[8]=e=>w.value=!1),"confirm-color":"var(--color-primary)"},{default:d(()=>[o(t,{class:"text-center px-[70rpx] py-[60rpx]"},{default:d(()=>[o(t,null,{default:d(()=>[i(" 请先阅读并同意")]),_:1}),o(t,{class:"flex justify-center"},{default:d(()=>[o(_,{"data-theme":"",to:"/pages/agreement/agreement?type=service"},{default:d(()=>[o(t,{class:"text-primary"},{default:d(()=>[i("《服务协议》")]),_:1})]),_:1}),i(" 和 "),o(_,{to:"/pages/agreement/agreement?type=privacy"},{default:d(()=>[o(t,{class:"text-primary"},{default:d(()=>[i("《隐私协议》")]),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"])],64)}}}),[["__scopeId","data-v-d6995219"]]);export{y as default};
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user