vhall-mini-sdk 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/player/components/online-hot/index.js +2 -2
- package/lib/sdk/main/index.js +1 -0
- package/package.json +2 -4
- package/postinstall.js +21 -51
- package/dist/components/chat/chat-edit/chat-edit.js +0 -127
- package/dist/components/chat/chat-edit/chat-edit.json +0 -4
- package/dist/components/chat/chat-edit/chat-edit.wxml +0 -7
- package/dist/components/chat/chat-edit/chat-edit.wxss +0 -1
- package/dist/components/chat/chat-item/chat-item.js +0 -253
- package/dist/components/chat/chat-item/chat-item.json +0 -3
- package/dist/components/chat/chat-item/chat-item.wxml +0 -96
- package/dist/components/chat/chat-item/chat-item.wxss +0 -1
- package/dist/components/chat/chat-list/chat-list.js +0 -216
- package/dist/components/chat/chat-list/chat-list.json +0 -6
- package/dist/components/chat/chat-list/chat-list.wxml +0 -9
- package/dist/components/chat/chat-list/chat-list.wxss +0 -1
- package/dist/components/chat/chat.js +0 -98
- package/dist/components/chat/chat.json +0 -7
- package/dist/components/chat/chat.wxml +0 -7
- package/dist/components/chat/chat.wxss +0 -1
- package/dist/components/gift/gift-display/gift-display.js +0 -118
- package/dist/components/gift/gift-display/gift-display.json +0 -3
- package/dist/components/gift/gift-display/gift-display.wxml +0 -16
- package/dist/components/gift/gift-display/gift-display.wxss +0 -1
- package/dist/components/gift/gift-sender/gift-sender.js +0 -63
- package/dist/components/gift/gift-sender/gift-sender.json +0 -6
- package/dist/components/gift/gift-sender/gift-sender.wxml +0 -19
- package/dist/components/gift/gift-sender/gift-sender.wxss +0 -1
- package/dist/components/introduction/introduction.js +0 -43
- package/dist/components/introduction/introduction.json +0 -3
- package/dist/components/introduction/introduction.wxml +0 -8
- package/dist/components/introduction/introduction.wxss +0 -1
- package/dist/components/invite-rank/img/bronze.png +0 -0
- package/dist/components/invite-rank/img/gold.png +0 -0
- package/dist/components/invite-rank/img/silver.png +0 -0
- package/dist/components/invite-rank/index.js +0 -135
- package/dist/components/invite-rank/index.json +0 -8
- package/dist/components/invite-rank/index.wxml +0 -42
- package/dist/components/invite-rank/index.wxss +0 -1
- package/dist/components/invite-rank/invite-rank-item.js +0 -12
- package/dist/components/invite-rank/invite-rank-item.json +0 -4
- package/dist/components/invite-rank/invite-rank-item.wxml +0 -21
- package/dist/components/invite-rank/invite-rank-item.wxss +0 -1
- package/dist/components/invite-rank/my-invite-detail.js +0 -82
- package/dist/components/invite-rank/my-invite-detail.json +0 -7
- package/dist/components/invite-rank/my-invite-detail.wxml +0 -27
- package/dist/components/invite-rank/my-invite-detail.wxss +0 -1
- package/dist/components/invite-rank/util.wxs +0 -21
- package/dist/components/live-landscape/live-landscape.js +0 -216
- package/dist/components/live-landscape/live-landscape.json +0 -39
- package/dist/components/live-landscape/live-landscape.wxml +0 -73
- package/dist/components/live-landscape/live-landscape.wxss +0 -1
- package/dist/components/live-portrait/live-portrait.js +0 -274
- package/dist/components/live-portrait/live-portrait.json +0 -38
- package/dist/components/live-portrait/live-portrait.wxml +0 -106
- package/dist/components/live-portrait/live-portrait.wxss +0 -1
- package/dist/components/lottery/lottery-accept/index.js +0 -249
- package/dist/components/lottery/lottery-accept/index.json +0 -4
- package/dist/components/lottery/lottery-accept/index.wxml +0 -49
- package/dist/components/lottery/lottery-accept/index.wxss +0 -1
- package/dist/components/lottery/lottery-history/index.js +0 -36
- package/dist/components/lottery/lottery-history/index.json +0 -3
- package/dist/components/lottery/lottery-history/index.wxml +0 -28
- package/dist/components/lottery/lottery-history/index.wxss +0 -1
- package/dist/components/lottery/lottery-shake/lottery-shake.js +0 -328
- package/dist/components/lottery/lottery-shake/lottery-shake.json +0 -1
- package/dist/components/lottery/lottery-shake/lottery-shake.wxml +0 -52
- package/dist/components/lottery/lottery-shake/lottery-shake.wxss +0 -1
- package/dist/components/lottery/lottery-slot/lottery-slot.js +0 -230
- package/dist/components/lottery/lottery-slot/lottery-slot.json +0 -1
- package/dist/components/lottery/lottery-slot/lottery-slot.wxml +0 -62
- package/dist/components/lottery/lottery-slot/lottery-slot.wxss +0 -1
- package/dist/components/lottery/lottery-wheel/lottery-wheel.js +0 -153
- package/dist/components/lottery/lottery-wheel/lottery-wheel.json +0 -4
- package/dist/components/lottery/lottery-wheel/lottery-wheel.wxml +0 -91
- package/dist/components/lottery/lottery-wheel/lottery-wheel.wxss +0 -1
- package/dist/components/lottery/lottery-winners/index.js +0 -101
- package/dist/components/lottery/lottery-winners/index.json +0 -4
- package/dist/components/lottery/lottery-winners/index.wxml +0 -39
- package/dist/components/lottery/lottery-winners/index.wxss +0 -1
- package/dist/components/lottery/lottery.js +0 -388
- package/dist/components/lottery/lottery.json +0 -11
- package/dist/components/lottery/lottery.wxml +0 -78
- package/dist/components/lottery/lottery.wxss +0 -1
- package/dist/components/lottery/wheel.json +0 -49
- package/dist/components/mall-reward/common/reward-card.wxss +0 -0
- package/dist/components/mall-reward/duration-icon/index.js +0 -101
- package/dist/components/mall-reward/duration-icon/index.json +0 -3
- package/dist/components/mall-reward/duration-icon/index.wxml +0 -7
- package/dist/components/mall-reward/duration-icon/index.wxss +0 -1
- package/dist/components/mall-reward/f-count-down/index.js +0 -61
- package/dist/components/mall-reward/f-count-down/index.json +0 -3
- package/dist/components/mall-reward/f-count-down/index.wxml +0 -9
- package/dist/components/mall-reward/f-count-down/index.wxss +0 -1
- package/dist/components/mall-reward/f-empty/index.js +0 -11
- package/dist/components/mall-reward/f-empty/index.json +0 -3
- package/dist/components/mall-reward/f-empty/index.wxml +0 -8
- package/dist/components/mall-reward/f-empty/index.wxss +0 -1
- package/dist/components/mall-reward/f-history/index.js +0 -84
- package/dist/components/mall-reward/f-history/index.json +0 -4
- package/dist/components/mall-reward/f-history/index.wxml +0 -38
- package/dist/components/mall-reward/f-history/index.wxss +0 -1
- package/dist/components/mall-reward/f-open/index.js +0 -36
- package/dist/components/mall-reward/f-open/index.json +0 -3
- package/dist/components/mall-reward/f-open/index.wxml +0 -10
- package/dist/components/mall-reward/f-open/index.wxss +0 -1
- package/dist/components/mall-reward/f-receive/index.js +0 -36
- package/dist/components/mall-reward/f-receive/index.json +0 -3
- package/dist/components/mall-reward/f-receive/index.wxml +0 -9
- package/dist/components/mall-reward/f-receive/index.wxss +0 -1
- package/dist/components/mall-reward/index.js +0 -374
- package/dist/components/mall-reward/index.json +0 -8
- package/dist/components/mall-reward/index.wxml +0 -4
- package/dist/components/mall-reward/index.wxss +0 -0
- package/dist/components/mall-reward/main-popup/index.js +0 -46
- package/dist/components/mall-reward/main-popup/index.json +0 -12
- package/dist/components/mall-reward/main-popup/index.wxml +0 -16
- package/dist/components/mall-reward/main-popup/index.wxss +0 -1
- package/dist/components/player/assets/image/arrow-left.png +0 -0
- package/dist/components/player/assets/image/arrow-right.png +0 -0
- package/dist/components/player/assets/image/enterFullScreen.png +0 -0
- package/dist/components/player/assets/image/exitFullScreen.png +0 -0
- package/dist/components/player/assets/image/fullscreen_1.png +0 -0
- package/dist/components/player/assets/image/fullscreen_2.png +0 -0
- package/dist/components/player/assets/image/pause.png +0 -0
- package/dist/components/player/assets/image/pause_1.png +0 -0
- package/dist/components/player/assets/image/play.png +0 -0
- package/dist/components/player/assets/image/play_1.png +0 -0
- package/dist/components/player/assets/image/refresh.png +0 -0
- package/dist/components/player/assets/image/refresh_1.png +0 -0
- package/dist/components/player/assets/image/subtitle_close.png +0 -0
- package/dist/components/player/assets/image/subtitle_default.png +0 -0
- package/dist/components/player/assets/image/volume-off.png +0 -0
- package/dist/components/player/assets/image/volume-on.png +0 -0
- package/dist/components/player/common/config.js +0 -7
- package/dist/components/player/common/veComponent.js +0 -4
- package/dist/components/player/components/barrage/barrage-canvas.js +0 -488
- package/dist/components/player/components/barrage/barrage-dom.js +0 -471
- package/dist/components/player/components/barrage/index.js +0 -62
- package/dist/components/player/components/barrage/index.json +0 -4
- package/dist/components/player/components/barrage/index.wxml +0 -39
- package/dist/components/player/components/barrage/index.wxss +0 -1
- package/dist/components/player/components/barrage/utils.js +0 -71
- package/dist/components/player/components/controls/controls.js +0 -93
- package/dist/components/player/components/controls/controls.json +0 -6
- package/dist/components/player/components/controls/controls.wxml +0 -60
- package/dist/components/player/components/controls/controls.wxss +0 -1
- package/dist/components/player/components/danmaku/danmaku.js +0 -23
- package/dist/components/player/components/danmaku/danmaku.json +0 -4
- package/dist/components/player/components/danmaku/danmaku.wxml +0 -1
- package/dist/components/player/components/danmaku/danmaku.wxss +0 -0
- package/dist/components/player/components/error/error.js +0 -15
- package/dist/components/player/components/error/error.json +0 -3
- package/dist/components/player/components/error/error.wxml +0 -6
- package/dist/components/player/components/error/error.wxss +0 -1
- package/dist/components/player/components/loading/loading.js +0 -9
- package/dist/components/player/components/loading/loading.json +0 -3
- package/dist/components/player/components/loading/loading.wxml +0 -4
- package/dist/components/player/components/loading/loading.wxss +0 -1
- package/dist/components/player/components/main/extensions/data.js +0 -8
- package/dist/components/player/components/main/extensions/export.js +0 -83
- package/dist/components/player/components/main/extensions/methods.js +0 -110
- package/dist/components/player/components/main/extensions/observers.js +0 -41
- package/dist/components/player/components/main/extensions/props.js +0 -177
- package/dist/components/player/components/main/index.js +0 -44
- package/dist/components/player/components/main/index.json +0 -4
- package/dist/components/player/components/main/index.wxml +0 -7
- package/dist/components/player/components/main/index.wxss +0 -1
- package/dist/components/player/components/marquee/marquee.js +0 -304
- package/dist/components/player/components/marquee/marquee.json +0 -4
- package/dist/components/player/components/marquee/marquee.wxml +0 -14
- package/dist/components/player/components/marquee/marquee.wxss +0 -1
- package/dist/components/player/components/online-hot/assets/line-hot.png +0 -0
- package/dist/components/player/components/online-hot/assets/line-user.png +0 -0
- package/dist/components/player/components/online-hot/index.js +0 -66
- package/dist/components/player/components/online-hot/index.json +0 -3
- package/dist/components/player/components/online-hot/index.wxml +0 -15
- package/dist/components/player/components/online-hot/index.wxss +0 -1
- package/dist/components/player/components/poster/poster.js +0 -12
- package/dist/components/player/components/poster/poster.json +0 -3
- package/dist/components/player/components/poster/poster.wxml +0 -5
- package/dist/components/player/components/poster/poster.wxss +0 -1
- package/dist/components/player/components/watermark/watermark.js +0 -52
- package/dist/components/player/components/watermark/watermark.json +0 -4
- package/dist/components/player/components/watermark/watermark.wxml +0 -8
- package/dist/components/player/components/watermark/watermark.wxss +0 -1
- package/dist/components/player/extensions/data.js +0 -63
- package/dist/components/player/extensions/export.js +0 -325
- package/dist/components/player/extensions/methods.js +0 -406
- package/dist/components/player/extensions/observers.js +0 -114
- package/dist/components/player/extensions/props.js +0 -162
- package/dist/components/player/player.js +0 -83
- package/dist/components/player/player.json +0 -33
- package/dist/components/player/player.wxml +0 -48
- package/dist/components/player/player.wxss +0 -1
- package/dist/components/praise/praise.js +0 -150
- package/dist/components/praise/praise.json +0 -5
- package/dist/components/praise/praise.wxml +0 -17
- package/dist/components/praise/praise.wxss +0 -1
- package/dist/components/product/product-card/product-card.js +0 -109
- package/dist/components/product/product-card/product-card.json +0 -3
- package/dist/components/product/product-card/product-card.wxml +0 -47
- package/dist/components/product/product-card/product-card.wxss +0 -1
- package/dist/components/product/product-detail/product-detail.js +0 -127
- package/dist/components/product/product-detail/product-detail.json +0 -3
- package/dist/components/product/product-detail/product-detail.wxml +0 -57
- package/dist/components/product/product-detail/product-detail.wxss +0 -1
- package/dist/components/product/product-item/product-item.js +0 -56
- package/dist/components/product/product-item/product-item.json +0 -3
- package/dist/components/product/product-item/product-item.wxml +0 -35
- package/dist/components/product/product-item/product-item.wxss +0 -1
- package/dist/components/product/product-list/product-list.js +0 -67
- package/dist/components/product/product-list/product-list.json +0 -6
- package/dist/components/product/product-list/product-list.wxml +0 -16
- package/dist/components/product/product-list/product-list.wxss +0 -1
- package/dist/components/product/product-order/product-order.js +0 -394
- package/dist/components/product/product-order/product-order.json +0 -3
- package/dist/components/product/product-order/product-order.wxml +0 -75
- package/dist/components/product/product-order/product-order.wxss +0 -1
- package/dist/components/signin/signin-dialog.js +0 -305
- package/dist/components/signin/signin-dialog.json +0 -7
- package/dist/components/signin/signin-dialog.wxml +0 -19
- package/dist/components/signin/signin-dialog.wxss +0 -1
- package/dist/components/top-notify/index.js +0 -14
- package/dist/components/top-notify/index.json +0 -3
- package/dist/components/top-notify/index.wxml +0 -2
- package/dist/components/top-notify/index.wxss +0 -1
- package/dist/pubComponents/countdown/countdown.js +0 -97
- package/dist/pubComponents/countdown/countdown.json +0 -5
- package/dist/pubComponents/countdown/countdown.wxml +0 -19
- package/dist/pubComponents/countdown/countdown.wxss +0 -1
- package/dist/pubComponents/error-page/index.js +0 -146
- package/dist/pubComponents/error-page/index.json +0 -5
- package/dist/pubComponents/error-page/index.wxml +0 -37
- package/dist/pubComponents/error-page/index.wxss +0 -1
- package/dist/pubComponents/popup/popup.js +0 -161
- package/dist/pubComponents/popup/popup.json +0 -5
- package/dist/pubComponents/popup/popup.wxml +0 -17
- package/dist/pubComponents/popup/popup.wxss +0 -1
- package/dist/pubComponents/tabs/index.js +0 -95
- package/dist/pubComponents/tabs/index.json +0 -4
- package/dist/pubComponents/tabs/index.wxml +0 -22
- package/dist/pubComponents/tabs/index.wxss +0 -1
- package/dist/sdk/config/index.js +0 -1
- package/dist/sdk/main/index.js +0 -1
- package/dist/sdk/player/index.js +0 -1
- package/dist/sdk/plugins/ChatServer.js +0 -1
- package/dist/sdk/plugins/CustomMenuServer.js +0 -1
- package/dist/sdk/plugins/InteractServer.js +0 -1
- package/dist/sdk/plugins/InviteCardServer.js +0 -1
- package/dist/sdk/plugins/LotteryServer.js +0 -1
- package/dist/sdk/plugins/MallRewardServer.js +0 -1
- package/dist/sdk/plugins/ProductServer.js +0 -1
- package/dist/shared/RequestUtil.js +0 -1
- package/dist/shared/SerializableMap.js +0 -1
- package/dist/shared/base.server.js +0 -1
- package/dist/shared/cacheUtil.js +0 -1
- package/dist/shared/dateUtil.js +0 -1
- package/dist/shared/logger.js +0 -1
- package/dist/shared/mpUtils.js +0 -1
- package/dist/shared/utils.js +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vhall-mini-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"author": "vhall",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"miniprogram": "lib",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"lint": "eslint ./packages --ext .js,.ts --fix && stylelint \"packages/**/*.less\" --fix",
|
|
13
13
|
"prepare": "husky",
|
|
14
14
|
"release": "sh build/release.sh",
|
|
15
|
-
"build:lib": "SKIP_MP_COMPONENTS_SYNC=true yarn && npx gulp -f build/compiler.js --series
|
|
15
|
+
"build:lib": "SKIP_MP_COMPONENTS_SYNC=true yarn && npx gulp -f build/compiler.js --series buildLib"
|
|
16
16
|
},
|
|
17
17
|
"files": [
|
|
18
18
|
"dist",
|
|
@@ -74,9 +74,7 @@
|
|
|
74
74
|
},
|
|
75
75
|
"dependencies": {
|
|
76
76
|
"await-to-js": "^3.0.0",
|
|
77
|
-
"chalk": "4",
|
|
78
77
|
"crc-32": "^1.2.0",
|
|
79
|
-
"fs-extra": "^11.3.6",
|
|
80
78
|
"js-base64": "^3.7.7",
|
|
81
79
|
"miniprogram-sm-crypto": "^0.3.13"
|
|
82
80
|
}
|
package/postinstall.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
const fs = require('fs
|
|
1
|
+
const fs = require('fs');
|
|
2
2
|
const path = require('path');
|
|
3
|
-
const chalk = require('chalk'); // 可选,让日志更好看,需要 npm i chalk -D 加到组件库依赖里
|
|
4
3
|
|
|
5
4
|
/**
|
|
6
5
|
* 1. 基础路径定义
|
|
@@ -29,9 +28,9 @@ const userPkgPath = path.resolve(projectRoot, 'package.json');
|
|
|
29
28
|
let userPkg = {};
|
|
30
29
|
if (fs.existsSync(userPkgPath)) {
|
|
31
30
|
try {
|
|
32
|
-
userPkg = fs.
|
|
31
|
+
userPkg = JSON.parse(fs.readFileSync(userPkgPath, 'utf-8'));
|
|
33
32
|
} catch (e) {
|
|
34
|
-
console.warn(
|
|
33
|
+
console.warn('[vhall-mini-sdk] 无法读取用户项目 package.json,使用默认配置');
|
|
35
34
|
}
|
|
36
35
|
}
|
|
37
36
|
// 如果用户自定义了 uni-app 根目录,就用自定义的
|
|
@@ -43,53 +42,24 @@ if (userPkg.mpComponents?.root) {
|
|
|
43
42
|
* 3. 核心:判断是否为 uni-app 环境
|
|
44
43
|
*/
|
|
45
44
|
function isUniAppProject(root) {
|
|
46
|
-
//
|
|
45
|
+
// 强制开关:如果用户设置了环境变量,优先遵循
|
|
47
46
|
if (process.env.SKIP_MP_COMPONENTS_SYNC === 'true') {
|
|
48
|
-
console.log(
|
|
47
|
+
console.log('[vhall-mini-sdk] SKIP_MP_COMPONENTS_SYNC=true,跳过 wxcomponents 同步');
|
|
49
48
|
return false;
|
|
50
49
|
}
|
|
51
50
|
if (process.env.FORCE_MP_COMPONENTS_SYNC === 'true') {
|
|
52
|
-
console.log(
|
|
51
|
+
console.log('[vhall-mini-sdk] FORCE_MP_COMPONENTS_SYNC=true,强制同步');
|
|
53
52
|
return true;
|
|
54
53
|
}
|
|
55
54
|
|
|
56
|
-
//
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
if (!fs.existsSync(pagesPath) || !fs.existsSync(manifestPath)) {
|
|
61
|
-
console.log(chalk.gray('ℹ️ 未检测到 uni-app 环境(缺少 pages.json/manifest.json),跳过 wxcomponents 同步'));
|
|
62
|
-
return false;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
// 3.3 辅助校验:pages.json 是合法 JSON,且包含 uni-app 特有字段
|
|
66
|
-
try {
|
|
67
|
-
const pagesConfig = fs.readJsonSync(pagesPath);
|
|
68
|
-
// uni-app 的 pages.json 一定有 pages 数组或 globalStyle 字段
|
|
69
|
-
if (!pagesConfig.pages && !pagesConfig.globalStyle) {
|
|
70
|
-
console.log(chalk.gray('ℹ️ 检测到 pages.json 不符合 uni-app 规范,跳过同步'));
|
|
71
|
-
return false;
|
|
72
|
-
}
|
|
73
|
-
} catch (e) {
|
|
74
|
-
console.log(chalk.gray('ℹ️ pages.json 不是合法 JSON,跳过同步'));
|
|
75
|
-
return false;
|
|
55
|
+
// 同时存在 pages.json 和 manifest.json 即判定为 uni-app 项目
|
|
56
|
+
if (fs.existsSync(path.resolve(root, 'pages.json')) && fs.existsSync(path.resolve(root, 'manifest.json'))) {
|
|
57
|
+
return true;
|
|
76
58
|
}
|
|
77
59
|
|
|
78
|
-
//
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
// Object.keys(userPkg.devDependencies || {}).some((dep) => dep.startsWith('@dcloudio'));
|
|
82
|
-
// if (!hasDCloudDep) {
|
|
83
|
-
// console.log(
|
|
84
|
-
// chalk.gray(
|
|
85
|
-
// 'ℹ️ 未检测到 @dcloudio 相关依赖,若确认是 uni-app 项目,请设置 FORCE_MP_COMPONENTS_SYNC=true',
|
|
86
|
-
// ),
|
|
87
|
-
// );
|
|
88
|
-
// // 这里可以根据团队要求决定是否返回 false,一般前两步过了就可以放行
|
|
89
|
-
// // return false
|
|
90
|
-
// }
|
|
91
|
-
|
|
92
|
-
return true;
|
|
60
|
+
// 兜底:如果是 CLI 项目,校验是否有 @dcloudio 依赖
|
|
61
|
+
const deps = { ...userPkg.dependencies, ...userPkg.devDependencies };
|
|
62
|
+
return !!(deps['@dcloudio/uni-app'] || deps['@dcloudio/vue-cli-plugin-uni']);
|
|
93
63
|
}
|
|
94
64
|
|
|
95
65
|
/**
|
|
@@ -98,7 +68,7 @@ function isUniAppProject(root) {
|
|
|
98
68
|
function syncWxComponents() {
|
|
99
69
|
let srcDir = path.resolve(PKG_ROOT, 'lib');
|
|
100
70
|
if (!fs.existsSync(srcDir)) {
|
|
101
|
-
console.error(
|
|
71
|
+
console.error('[vhall-mini-sdk] 组件库内未找到 lib 目录,同步失败');
|
|
102
72
|
return;
|
|
103
73
|
}
|
|
104
74
|
// 目标目录
|
|
@@ -106,19 +76,19 @@ function syncWxComponents() {
|
|
|
106
76
|
|
|
107
77
|
try {
|
|
108
78
|
// 清空旧目录
|
|
109
|
-
fs.
|
|
79
|
+
fs.rmSync(destDir, { recursive: true, force: true });
|
|
110
80
|
// 拷贝组件
|
|
111
|
-
fs.
|
|
81
|
+
fs.cpSync(srcDir, destDir, { recursive: true });
|
|
112
82
|
// 同步 package.json(提供组件元信息,便于 uni-app 识别该 npm 组件)
|
|
113
83
|
const srcPkg = path.resolve(PKG_ROOT, 'package.json');
|
|
114
84
|
if (fs.existsSync(srcPkg)) {
|
|
115
|
-
fs.
|
|
85
|
+
fs.copyFileSync(srcPkg, path.resolve(destDir, 'package.json'));
|
|
116
86
|
}
|
|
117
|
-
console.log(
|
|
118
|
-
console.log(
|
|
119
|
-
console.log(
|
|
87
|
+
console.log('[vhall-mini-sdk] wxcomponents 同步成功');
|
|
88
|
+
console.log(` 源目录:${srcDir}`);
|
|
89
|
+
console.log(` 目标目录:${destDir}`);
|
|
120
90
|
} catch (err) {
|
|
121
|
-
console.error(
|
|
91
|
+
console.error('[vhall-mini-sdk] wxcomponents 同步失败:', err.message);
|
|
122
92
|
// 不主动 exit(1),避免阻断用户 npm install
|
|
123
93
|
}
|
|
124
94
|
}
|
|
@@ -129,5 +99,5 @@ try {
|
|
|
129
99
|
syncWxComponents();
|
|
130
100
|
}
|
|
131
101
|
} catch (err) {
|
|
132
|
-
console.error(
|
|
102
|
+
console.error('[vhall-mini-sdk] postinstall 脚本执行异常:', err.message);
|
|
133
103
|
}
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
Component({
|
|
2
|
-
options: {
|
|
3
|
-
styleIsolation: 'apply-shared',
|
|
4
|
-
},
|
|
5
|
-
properties: {
|
|
6
|
-
sdkInstance: {
|
|
7
|
-
type: Object,
|
|
8
|
-
value: null,
|
|
9
|
-
},
|
|
10
|
-
},
|
|
11
|
-
|
|
12
|
-
data: {
|
|
13
|
-
userInfo: {},
|
|
14
|
-
isBanned: false, //是否禁言
|
|
15
|
-
isAllBanned: false, //是否禁言所有人,
|
|
16
|
-
bannedMode: 1,//1禁言无感知,0禁言有感知
|
|
17
|
-
placeholder: '参与聊天',
|
|
18
|
-
chatValue: '',
|
|
19
|
-
inputBottom: 0,
|
|
20
|
-
keyboardListener: null,
|
|
21
|
-
},
|
|
22
|
-
lifetimes: {
|
|
23
|
-
attached() {
|
|
24
|
-
this.ListenKeyboard();
|
|
25
|
-
},
|
|
26
|
-
detached: function detached() {
|
|
27
|
-
this.unsub && this.unsub();
|
|
28
|
-
this.keyboardListener && this.keyboardListener.disconnect();
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
observers: {
|
|
32
|
-
isBanned(newVal) {
|
|
33
|
-
this.setPlaceholder()
|
|
34
|
-
},
|
|
35
|
-
isAllBanned(newVal) {
|
|
36
|
-
this.setPlaceholder()
|
|
37
|
-
},
|
|
38
|
-
bannedMode(newVal) {
|
|
39
|
-
this.setPlaceholder()
|
|
40
|
-
},
|
|
41
|
-
sdkInstance: function sdkInstance(_sdkInstance) {
|
|
42
|
-
if (!_sdkInstance) return;
|
|
43
|
-
this.unsub = _sdkInstance.store.get({
|
|
44
|
-
user: (val) => {
|
|
45
|
-
this.setData({
|
|
46
|
-
userInfo: val,
|
|
47
|
-
});
|
|
48
|
-
},
|
|
49
|
-
'interactToolStatus.is_banned': (val) => {
|
|
50
|
-
this.setData({
|
|
51
|
-
isBanned: !!val,
|
|
52
|
-
});
|
|
53
|
-
},
|
|
54
|
-
'interactToolStatus.all_banned': (val) => {
|
|
55
|
-
this.setData({
|
|
56
|
-
isAllBanned: !!val,
|
|
57
|
-
});
|
|
58
|
-
},
|
|
59
|
-
'interactToolStatus.banned_mode': (val) => {
|
|
60
|
-
this.setData({
|
|
61
|
-
bannedMode: val,
|
|
62
|
-
})
|
|
63
|
-
},
|
|
64
|
-
'permissions': (val) => {
|
|
65
|
-
const status = _sdkInstance.store.get('liveInfo.status');
|
|
66
|
-
// 4 点播 5 回放 && 开启了回放禁言
|
|
67
|
-
if ((status == 4 || status == 5) && val['ui.watch_record_no_chatting'] == 1) {
|
|
68
|
-
this.setData({
|
|
69
|
-
isAllBanned: true,
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
'liveInfo.status': (status) => {
|
|
74
|
-
if (status == 3) {
|
|
75
|
-
this.setData({
|
|
76
|
-
isAllBanned: true,
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
});
|
|
81
|
-
},
|
|
82
|
-
},
|
|
83
|
-
methods: {
|
|
84
|
-
ListenKeyboard() {
|
|
85
|
-
this.keyboardListener = wx.onKeyboardHeightChange((res) => {
|
|
86
|
-
this.setData({
|
|
87
|
-
inputBottom: res.height,
|
|
88
|
-
});
|
|
89
|
-
});
|
|
90
|
-
},
|
|
91
|
-
// 获得焦点
|
|
92
|
-
onInputFocus(e) {
|
|
93
|
-
this.setPlaceholder('focus')
|
|
94
|
-
},
|
|
95
|
-
onInputBlur() {
|
|
96
|
-
// 失去焦点时重置位置,并移除键盘监听
|
|
97
|
-
this.setData({ inputBottom: 0 });
|
|
98
|
-
this.setPlaceholder()
|
|
99
|
-
},
|
|
100
|
-
setPlaceholder(action) {
|
|
101
|
-
if (this.data.isBanned && this.data.bannedMode != 1 || this.data.isAllBanned) {
|
|
102
|
-
this.setData({
|
|
103
|
-
placeholder: '禁止发言'
|
|
104
|
-
})
|
|
105
|
-
} else {
|
|
106
|
-
this.setData({
|
|
107
|
-
placeholder: action === 'focus' ? '' : '参与聊天'
|
|
108
|
-
})
|
|
109
|
-
}
|
|
110
|
-
},
|
|
111
|
-
chatInputChange: function chatInputChange(e) {},
|
|
112
|
-
bindconfirm: function bindconfirm(e) {
|
|
113
|
-
if (!e.detail.value.trim()) {
|
|
114
|
-
return;
|
|
115
|
-
}
|
|
116
|
-
const sdkInstance = this.properties.sdkInstance;
|
|
117
|
-
if (sdkInstance) {
|
|
118
|
-
sdkInstance.sendChat({
|
|
119
|
-
data: e.detail.value,
|
|
120
|
-
});
|
|
121
|
-
this.setData({
|
|
122
|
-
chatValue: '',
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
},
|
|
126
|
-
},
|
|
127
|
-
});
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
<view class="comment-wrapper safe-area-inset-bottom">
|
|
2
|
-
<image wx:if="{{userInfo.avatar}}" class="avatar" src="{{userInfo.avatar}}"></image>
|
|
3
|
-
<view class="chat-edit-input-box {{inputBottom !== 0 ? 'input-active' : ''}}" style="bottom: {{inputBottom}}px;">
|
|
4
|
-
<input bindinput="chatInputChange" adjust-position="{{false}}" value="{{ chatValue }}" class="chat-edit-input" id="chat-edit-input" placeholder-class="chat-edit-input-placeholder" placeholder="{{placeholder}}" disabled="{{isBanned&&bannedMode!=1 ||isAllBanned}}" maxlength="200" bindconfirm="bindconfirm" bindtap="bindtap" bindblur="onInputBlur" bindfocus="onInputFocus" confirm-type="send" type="text" />
|
|
5
|
-
</view>
|
|
6
|
-
<slot></slot>
|
|
7
|
-
</view>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.comment-wrapper{align-items:center;display:flex;flex:1;height:100%;justify-content:flex-start;margin:0 28rpx 5px}.comment-wrapper .avatar{border-radius:50%;height:2rem;width:2rem}.comment-wrapper .chat-edit-input-box{box-sizing:border-box;flex:1;padding:0 10rpx}.comment-wrapper .chat-edit-input-box.input-active{align-items:center;background:#fff;display:flex;left:0;padding:16rpx 24rpx;position:fixed;right:0;width:100%}.comment-wrapper .chat-edit-input-box.input-active .chat-edit-input,.comment-wrapper .chat-edit-input-box.input-active .chat-edit-input-placeholder{color:#262626!important}.chat-edit-input{background-color:rgba(0,0,0,.25);border:none;border-radius:1rem;box-sizing:border-box;color:#262626;flex:1;font-size:1rem;height:2rem;padding:14rpx 30rpx;text-overflow:ellipsis;white-space:nowrap}.chat-edit-input-placeholder{color:#262626}.comment-wrapper-fixed{background-color:#fff;bottom:0;box-sizing:border-box;height:55px;margin:0;padding:0 10px;position:fixed;width:100vw}
|
|
@@ -1,253 +0,0 @@
|
|
|
1
|
-
const faceArr = {
|
|
2
|
-
'[微笑]': '1',
|
|
3
|
-
'[撇嘴]': '2',
|
|
4
|
-
'[色]': '3',
|
|
5
|
-
'[发呆]': '4',
|
|
6
|
-
'[得意]': '5',
|
|
7
|
-
'[流泪]': '6',
|
|
8
|
-
'[害羞]': '7',
|
|
9
|
-
'[闭嘴]': '8',
|
|
10
|
-
'[睡]': '9',
|
|
11
|
-
'[哭]': '10',
|
|
12
|
-
'[尴尬]': '11',
|
|
13
|
-
'[发怒]': '12',
|
|
14
|
-
'[调皮]': '13',
|
|
15
|
-
'[呲牙]': '14',
|
|
16
|
-
'[惊讶]': '15',
|
|
17
|
-
'[难过]': '16',
|
|
18
|
-
'[酷]': '17',
|
|
19
|
-
'[汗]': '18',
|
|
20
|
-
'[抓狂]': '19',
|
|
21
|
-
'[吐]': '20',
|
|
22
|
-
'[偷笑]': '21',
|
|
23
|
-
'[愉快]': '22',
|
|
24
|
-
'[白眼]': '23',
|
|
25
|
-
'[傲慢]': '24',
|
|
26
|
-
'[饥饿]': '25',
|
|
27
|
-
'[困]': '26',
|
|
28
|
-
'[惊恐]': '27',
|
|
29
|
-
'[流汗]': '28',
|
|
30
|
-
'[憨笑]': '29',
|
|
31
|
-
'[悠闲]': '30',
|
|
32
|
-
'[奋斗]': '31',
|
|
33
|
-
'[咒骂]': '32',
|
|
34
|
-
'[疑问]': '33',
|
|
35
|
-
'[嘘]': '34',
|
|
36
|
-
'[晕]': '35',
|
|
37
|
-
'[疯了]': '36',
|
|
38
|
-
'[衰]': '37',
|
|
39
|
-
'[骷髅]': '38',
|
|
40
|
-
'[敲打]': '39',
|
|
41
|
-
'[再见]': '40',
|
|
42
|
-
'[擦汗]': '41',
|
|
43
|
-
'[抠鼻]': '42',
|
|
44
|
-
'[鼓掌]': '43',
|
|
45
|
-
'[糗大了]': '44',
|
|
46
|
-
'[坏笑]': '45',
|
|
47
|
-
'[左哼哼]': '46',
|
|
48
|
-
'[右哼哼]': '47',
|
|
49
|
-
'[哈欠]': '48',
|
|
50
|
-
'[鄙视]': '49',
|
|
51
|
-
'[委屈]': '50',
|
|
52
|
-
'[快哭了]': '51',
|
|
53
|
-
'[阴险]': '52',
|
|
54
|
-
'[亲亲]': '53',
|
|
55
|
-
'[吓]': '54',
|
|
56
|
-
'[可怜]': '55',
|
|
57
|
-
'[菜刀]': '56',
|
|
58
|
-
'[西瓜]': '57',
|
|
59
|
-
'[啤酒]': '58',
|
|
60
|
-
'[篮球]': '59',
|
|
61
|
-
'[乒乓]': '60',
|
|
62
|
-
'[咖啡]': '61',
|
|
63
|
-
'[饭]': '62',
|
|
64
|
-
'[猪头]': '63',
|
|
65
|
-
'[玫瑰]': '64',
|
|
66
|
-
'[凋谢]': '65',
|
|
67
|
-
'[嘴唇]': '66',
|
|
68
|
-
'[爱心]': '67',
|
|
69
|
-
'[心碎]': '68',
|
|
70
|
-
'[蛋糕]': '69',
|
|
71
|
-
'[闪电]': '70',
|
|
72
|
-
'[炸弹]': '71',
|
|
73
|
-
'[刀]': '72',
|
|
74
|
-
'[足球]': '73',
|
|
75
|
-
'[瓢虫]': '74',
|
|
76
|
-
'[便便]': '75',
|
|
77
|
-
'[月亮]': '76',
|
|
78
|
-
'[太阳]': '77',
|
|
79
|
-
'[礼物]': '78',
|
|
80
|
-
'[拥抱]': '79',
|
|
81
|
-
'[强]': '80',
|
|
82
|
-
'[弱]': '81',
|
|
83
|
-
'[握手]': '82',
|
|
84
|
-
'[胜利]': '83',
|
|
85
|
-
'[抱拳]': '84',
|
|
86
|
-
'[勾引]': '85',
|
|
87
|
-
'[拳头]': '86',
|
|
88
|
-
'[差劲]': '87',
|
|
89
|
-
'[爱你]': '88',
|
|
90
|
-
'[NO]': '89',
|
|
91
|
-
'[OK]': '90',
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
Component({
|
|
95
|
-
properties: {
|
|
96
|
-
chatItem: {
|
|
97
|
-
type: Object,
|
|
98
|
-
value: null,
|
|
99
|
-
},
|
|
100
|
-
mode: {
|
|
101
|
-
type: Number,
|
|
102
|
-
value: 1,
|
|
103
|
-
},
|
|
104
|
-
memberLevel: {
|
|
105
|
-
type: Object,
|
|
106
|
-
value: null,
|
|
107
|
-
},
|
|
108
|
-
},
|
|
109
|
-
data: {
|
|
110
|
-
roleName: {
|
|
111
|
-
1: '主持人',
|
|
112
|
-
2: '观众',
|
|
113
|
-
3: '助理',
|
|
114
|
-
4: '嘉宾',
|
|
115
|
-
},
|
|
116
|
-
textContent: '',
|
|
117
|
-
memberLevelIcon: '',
|
|
118
|
-
},
|
|
119
|
-
lifetimes: {
|
|
120
|
-
attached() {
|
|
121
|
-
this._updateContent();
|
|
122
|
-
this._updateMemberLevelIcon();
|
|
123
|
-
},
|
|
124
|
-
detached: function detached() {},
|
|
125
|
-
},
|
|
126
|
-
observers: {
|
|
127
|
-
'chatItem, memberLevel'(chatItem, memberLevel) {
|
|
128
|
-
this._updateContent();
|
|
129
|
-
this._updateMemberLevelIcon();
|
|
130
|
-
},
|
|
131
|
-
},
|
|
132
|
-
methods: {
|
|
133
|
-
_updateContent() {
|
|
134
|
-
if (!['text', 'image'].includes(this.data.chatItem?.type || this.data.chatItem?.data?.type))
|
|
135
|
-
return;
|
|
136
|
-
this.setData({
|
|
137
|
-
textContent: this._wrapMatchedString(this.data.chatItem),
|
|
138
|
-
});
|
|
139
|
-
},
|
|
140
|
-
_updateMemberLevelIcon() {
|
|
141
|
-
const memberLevel = this.data.memberLevel;
|
|
142
|
-
const level = this.data.chatItem?.context?.member_level;
|
|
143
|
-
|
|
144
|
-
/* prettier-ignore */ // 开启或等级无效时不显示图标
|
|
145
|
-
if (!memberLevel || memberLevel.status != 1 || !Number.isInteger(level) || level < 1 || level > 21) {
|
|
146
|
-
this.setData({ memberLevelIcon: '' });
|
|
147
|
-
return;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
let icon = '';
|
|
151
|
-
if (memberLevel.type === 'custom') {
|
|
152
|
-
const item = (memberLevel.custom_list || []).find((item) => item.level == level);
|
|
153
|
-
icon = item?.icon || '';
|
|
154
|
-
} else {
|
|
155
|
-
icon = `https://t-alistatic01.e.vhall.com/common-static/images/mp/vip/vip${level}.png`;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
this.setData({ memberLevelIcon: icon });
|
|
159
|
-
},
|
|
160
|
-
preview(event) {
|
|
161
|
-
const index = event.currentTarget.dataset.index;
|
|
162
|
-
const imgList = this.data.chatItem.data.image_urls;
|
|
163
|
-
const currentUrl = imgList[index];
|
|
164
|
-
wx.previewImage({
|
|
165
|
-
current: currentUrl,
|
|
166
|
-
urls: imgList,
|
|
167
|
-
});
|
|
168
|
-
},
|
|
169
|
-
// 辅助函数:转义正则表达式中的特殊字符
|
|
170
|
-
_escapeRegExp(string) {
|
|
171
|
-
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
172
|
-
},
|
|
173
|
-
_wrapMatchedString(chatItem) {
|
|
174
|
-
const {
|
|
175
|
-
context: {
|
|
176
|
-
atList = []
|
|
177
|
-
} = {}, // 关键:= {}
|
|
178
|
-
data: {
|
|
179
|
-
text_content: text
|
|
180
|
-
} = {},
|
|
181
|
-
} = chatItem;
|
|
182
|
-
const atNames = atList.map(
|
|
183
|
-
(item) => `@${item.nick_name || item.nickname || item.nickName}`
|
|
184
|
-
);
|
|
185
|
-
|
|
186
|
-
// 构建正则表达式来匹配 @ 昵称和表情
|
|
187
|
-
const atPattern =
|
|
188
|
-
atNames.length > 0 ?
|
|
189
|
-
atNames.map((name) => this._escapeRegExp(name)).join('|') :
|
|
190
|
-
'';
|
|
191
|
-
const facePattern = Object.keys(faceArr)
|
|
192
|
-
.map(this._escapeRegExp)
|
|
193
|
-
.join('|');
|
|
194
|
-
const validPatterns = [atPattern, facePattern].filter(
|
|
195
|
-
(pattern) => pattern
|
|
196
|
-
);
|
|
197
|
-
const combinedPattern =
|
|
198
|
-
validPatterns.length > 0 ? `(${validPatterns.join('|')})` : null;
|
|
199
|
-
|
|
200
|
-
if (!combinedPattern) {
|
|
201
|
-
return [{
|
|
202
|
-
text,
|
|
203
|
-
isHighlight: false
|
|
204
|
-
}];
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
const regex = new RegExp(combinedPattern, 'g');
|
|
208
|
-
|
|
209
|
-
const result = [];
|
|
210
|
-
let lastIndex = 0;
|
|
211
|
-
|
|
212
|
-
let match;
|
|
213
|
-
while ((match = regex.exec(text)) !== null) {
|
|
214
|
-
const matchIndex = match.index;
|
|
215
|
-
const matchedText = match[0];
|
|
216
|
-
|
|
217
|
-
// 处理匹配之前的普通文本
|
|
218
|
-
if (matchIndex > lastIndex) {
|
|
219
|
-
result.push({
|
|
220
|
-
text: text.slice(lastIndex, matchIndex),
|
|
221
|
-
isHighlight: false,
|
|
222
|
-
});
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
if (atNames.includes(matchedText)) {
|
|
226
|
-
// 处理匹配的 @ 昵称
|
|
227
|
-
result.push({
|
|
228
|
-
text: matchedText,
|
|
229
|
-
isHighlight: true,
|
|
230
|
-
});
|
|
231
|
-
} else {
|
|
232
|
-
// 处理匹配的表情
|
|
233
|
-
result.push({
|
|
234
|
-
type: 'image',
|
|
235
|
-
text: matchedText,
|
|
236
|
-
imageSrc: `https://cnstatic01.e.vhall.com/static/img/arclist/Expression_${faceArr[matchedText]}@2x.png`,
|
|
237
|
-
isHighlight: false,
|
|
238
|
-
});
|
|
239
|
-
}
|
|
240
|
-
lastIndex = regex.lastIndex;
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
// 处理剩余的普通文本
|
|
244
|
-
if (lastIndex < text.length) {
|
|
245
|
-
result.push({
|
|
246
|
-
text: text.slice(lastIndex),
|
|
247
|
-
isHighlight: false,
|
|
248
|
-
});
|
|
249
|
-
}
|
|
250
|
-
return result;
|
|
251
|
-
},
|
|
252
|
-
},
|
|
253
|
-
});
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
<view>
|
|
2
|
-
<!-- 横屏消息 -->
|
|
3
|
-
<view class="chat-item mode{{ mode }}" wx:if="{{ mode == 1 }}">
|
|
4
|
-
<!-- 礼物消息 -->
|
|
5
|
-
<block wx:if="{{chatItem.type=='gift_send_success'}}">
|
|
6
|
-
<view class="gift-msg">
|
|
7
|
-
{{chatItem.gift_user_name}}送出了一个 {{chatItem.gift_name}}
|
|
8
|
-
<image class="gift-img" src="{{chatItem.gift_image_url}}" />
|
|
9
|
-
</view>
|
|
10
|
-
</block>
|
|
11
|
-
<block wx:else>
|
|
12
|
-
<view class="chat-item_left">
|
|
13
|
-
<image class="chat-item_left_avatar" src="{{chatItem.context.avatar ||'https://cnstatic01.e.vhall.com/common-static/images/default_avatar.png'}}"></image>
|
|
14
|
-
</view>
|
|
15
|
-
<view class="chat-item_right">
|
|
16
|
-
<view class="chat-item_right_user">
|
|
17
|
-
<!-- 会员等级 -->
|
|
18
|
-
<view class="chat-item_right_user_level" wx:if="{{memberLevelIcon}}">
|
|
19
|
-
<image class="chat-item_vip-icon" mode="heightFix" src="{{memberLevelIcon}}"></image>
|
|
20
|
-
</view>
|
|
21
|
-
<view class="chat-item_right_user_name">
|
|
22
|
-
{{ chatItem.context.nick_name || chatItem.context.nickname }}
|
|
23
|
-
</view>
|
|
24
|
-
<view class="chat-item_right_user_role role_{{ chatItem.context.role_name }}" wx:if="{{ chatItem.context.role_name != 2 }}">
|
|
25
|
-
{{ roleName[chatItem.context.role_name] }}
|
|
26
|
-
</view>
|
|
27
|
-
</view>
|
|
28
|
-
<view class="chat-item_right_content">
|
|
29
|
-
<view class="chat-item_content_reply" wx:if="{{ chatItem.context.replyMsg.content }}">
|
|
30
|
-
<view class="chat-item_content_reply_username">
|
|
31
|
-
{{ chatItem.context.replyMsg.nick_name || chatItem.context.replyMsg.nickname }}:
|
|
32
|
-
</view>
|
|
33
|
-
<text class="chat-item_reply_text">
|
|
34
|
-
{{chatItem.context.replyMsg.content.text_content ||chatItem.context.replyMsg.content.text_content}}
|
|
35
|
-
</text>
|
|
36
|
-
</view>
|
|
37
|
-
<view>
|
|
38
|
-
<text class="relpy_icon" wx:if="{{ chatItem.context.replyMsg.content }}">回复</text>
|
|
39
|
-
<block wx:for="{{ textContent }}" wx:key="*this">
|
|
40
|
-
<image class="face_img" src="{{ item.imageSrc }}" wx:if="{{ item.type === 'image' }}"></image>
|
|
41
|
-
<text class="{{ item.isHighlight ? 'highlight' : '' }}" wx:else>{{ item.text }}</text>
|
|
42
|
-
</block>
|
|
43
|
-
</view>
|
|
44
|
-
<view class="chat-item_right_content_img_box" wx:if="{{ chatItem.data.image_urls }}">
|
|
45
|
-
<image class="chat-item_right_content_img" bindtap="preview" wx:for="{{ chatItem.data.image_urls }}" wx:for-index="index" wx:for-item="item" data-index="{{ index }}" wx:key="index" src="{{ item }}"></image>
|
|
46
|
-
</view>
|
|
47
|
-
</view>
|
|
48
|
-
</view>
|
|
49
|
-
</block>
|
|
50
|
-
</view>
|
|
51
|
-
<!-- 竖屏消息 -->
|
|
52
|
-
<view class="chat-item mode{{ mode }}" wx:if="{{ mode == 0 }}">
|
|
53
|
-
<!-- 礼物消息 -->
|
|
54
|
-
<block wx:if="{{chatItem.type=='gift_send_success'}}">
|
|
55
|
-
<view class="gift-msg">
|
|
56
|
-
<text>{{chatItem.gift_user_name}}送出了一个 {{chatItem.gift_name}}</text>
|
|
57
|
-
<image class="gift-img" src="{{chatItem.gift_image_url}}" />
|
|
58
|
-
</view>
|
|
59
|
-
</block>
|
|
60
|
-
<block wx:else>
|
|
61
|
-
<view class="chat-item_content_reply" wx:if="{{ chatItem.context.replyMsg.content }}">
|
|
62
|
-
<view class="chat-item_content_reply_username">
|
|
63
|
-
{{ chatItem.context.replyMsg.nick_name || chatItem.context.replyMsg.nickname }}:
|
|
64
|
-
</view>
|
|
65
|
-
<text>
|
|
66
|
-
{{chatItem.context.replyMsg.content.text_content ||chatItem.context.replyMsg.content.text_content}}
|
|
67
|
-
</text>
|
|
68
|
-
</view>
|
|
69
|
-
<!-- 会员等级 / 昵称 / 角色 一行显示 -->
|
|
70
|
-
<view class="chat-item_right_user">
|
|
71
|
-
<!-- 会员等级 -->
|
|
72
|
-
<view class="chat-item_right_user_level" wx:if="{{memberLevelIcon}}">
|
|
73
|
-
<image class="chat-item_vip-icon" mode="heightFix" src="{{memberLevelIcon}}"></image>
|
|
74
|
-
</view>
|
|
75
|
-
<view class="chat-item_user_name">
|
|
76
|
-
{{ chatItem.context.nick_name || chatItem.context.nickname }}:
|
|
77
|
-
</view>
|
|
78
|
-
<view class="chat-item_role role_{{ chatItem.context.role_name }}" wx:if="{{ chatItem.context.role_name != 2 }}">
|
|
79
|
-
{{ roleName[chatItem.context.role_name] }}
|
|
80
|
-
</view>
|
|
81
|
-
</view>
|
|
82
|
-
<view class="chat-item_content">
|
|
83
|
-
<view>
|
|
84
|
-
<text class="relpy_icon" wx:if="{{ chatItem.context.replyMsg.content }}">回复</text>
|
|
85
|
-
<block wx:for="{{ textContent }}" wx:key="*this">
|
|
86
|
-
<image class="face_img" src="{{ item.imageSrc }}" wx:if="{{ item.type === 'image' }}"></image>
|
|
87
|
-
<text class="{{ item.isHighlight ? 'highlight' : '' }}" wx:else>{{ item.text }}</text>
|
|
88
|
-
</block>
|
|
89
|
-
</view>
|
|
90
|
-
<view class="chat-item_right_content_img_box" wx:if="{{ chatItem.data.image_urls }}">
|
|
91
|
-
<image class="chat-item_right_content_img" bindtap="preview" wx:for="{{ chatItem.data.image_urls }}" wx:for-index="index" wx:for-item="item" data-index="{{ index }}" wx:key="index" src="{{ item }}"></image>
|
|
92
|
-
</view>
|
|
93
|
-
</view>
|
|
94
|
-
</block>
|
|
95
|
-
</view>
|
|
96
|
-
</view>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.chat-item{display:flex;margin-bottom:24rpx}.chat-item_left{margin-right:16rpx}.chat-item_left_avatar{border-radius:50%;height:2rem;width:2rem}.chat-item_right{flex:1}.chat-item_right_user{align-items:center;display:flex;line-height:2rem}.chat-item_right_user_level{align-items:center;display:flex;margin-right:8rpx}.chat-item_right_user_level .chat-item_vip-icon{height:1rem;width:auto}.chat-item_right_user_name{align-items:center;color:#8c8c8c;display:flex;font-size:1rem;margin-right:8rpx;max-width:340rpx;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-break:break-all}.chat-item_right_user_role{align-items:center;border-radius:.6rem;display:flex;font-size:.8rem;height:1.2rem;line-height:1;padding:0 .3rem}.chat-item_right_user_role.role_1{background-color:rgba(251,38,38,.15);color:#fb2626}.chat-item_right_user_role.role_3,.chat-item_right_user_role.role_4{background-color:rgba(10,127,245,.15);color:#0a7ff5}.chat-item_right_content{background-color:#fff;border-radius:0 16rpx 16rpx 16rpx;font-size:1rem;line-height:1.25rem;margin-top:10rpx;max-width:460rpx;overflow-wrap:break-word;padding:12rpx 16rpx;width:-webkit-fit-content;width:fit-content;word-break:break-word}.chat-item_right_content .chat-item_reply_text{vertical-align:middle}.chat-item_right_content .face_img{height:1.2rem;vertical-align:middle;width:1.2rem}.chat-item_right_content_img{border-radius:12rpx;height:100rpx;margin-right:10rpx;object-fit:contain;width:100rpx}.chat-item_right_content_img:last-child{margin-right:0}.chat-item .chat-item_content_reply{color:#999;font-size:.93rem;padding-left:20rpx;position:relative}.chat-item .chat-item_content_reply:before{background:#bfbfbf;border-radius:3rpx;content:" ";height:100%;left:0;position:absolute;top:0;width:6rpx}.chat-item .chat-item_content_reply_username{color:#8c8c8c;display:inline}.chat-item .relpy_icon{color:#fc9600;margin-right:8rpx}.chat-item.mode0{background:rgba(0,0,0,.35);border-radius:26rpx;color:#fff;display:block;font-size:1rem;margin-bottom:16rpx;max-width:520rpx;padding:8rpx 24rpx;width:-webkit-fit-content;width:fit-content;word-break:break-all}.chat-item.mode0 .chat-item_right_user{align-items:baseline;display:inline-flex;flex-wrap:nowrap;vertical-align:top}.chat-item.mode0 .chat-item_right_user .chat-item_right_user_level{align-items:center;align-self:center;display:flex;flex:none;margin-right:8rpx}.chat-item.mode0 .chat-item_right_user .chat-item_right_user_level .chat-item_vip-icon{height:1.1rem;width:auto}.chat-item.mode0 .chat-item_right_user .chat-item_user_name{color:#8ce7ff;flex:none;font-size:1rem;line-height:1.25rem;margin-right:0;white-space:nowrap}.chat-item.mode0 .chat-item_right_user .chat-item_role{flex:none}.chat-item.mode0 .chat-item_role{border-radius:.5rem;display:inline-block;font-size:.68rem;height:1rem;line-height:1rem;margin-right:12rpx;padding:0 10rpx;vertical-align:middle}.chat-item.mode0 .chat-item_role.role_1{background-color:rgba(251,38,38,.15);color:#fb2626}.chat-item.mode0 .chat-item_role.role_3,.chat-item.mode0 .chat-item_role.role_4{background-color:rgba(10,127,245,.15);color:#0a7ff5}.chat-item.mode0 .chat-item_content{display:inline-block;font-size:1rem;line-height:1.25rem;vertical-align:top}.chat-item.mode0 .gift-msg{background:transparent;color:#fff;height:auto;margin:0}.chat-item .highlight{color:#0a7ff5}.chat-item .gift-msg{background-color:hsla(9,100%,89%,.2);border-radius:24rpx;color:#262626;height:48rpx;margin:0 auto;padding:0 50rpx 0 24rpx;width:-webkit-fit-content;width:fit-content}.chat-item .gift-msg .gift-img{display:inline-block;height:40rpx;transform:scale(1.8);transform-origin:left center;vertical-align:text-bottom;width:40rpx}.face_img{display:inline-block;height:1.25rem;vertical-align:middle;width:1.25rem}
|