@ray-js/ipc-player-integration 0.0.35-beta.10 → 0.0.35-beta.12
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/ui/ui.js
CHANGED
|
@@ -448,8 +448,18 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
|
|
|
448
448
|
setVerticalMic(verticalMic);
|
|
449
449
|
}, [brandColor, verticalMic]);
|
|
450
450
|
const refreshSmartImageQuality = useMemoizedFn(async () => {
|
|
451
|
-
|
|
452
|
-
|
|
451
|
+
let res = await getSmartImageQualityState(devId);
|
|
452
|
+
console.log('res===refreshSmartImageQuality1', res);
|
|
453
|
+
// if (res === undefined) return;
|
|
454
|
+
// TODO: TEST
|
|
455
|
+
if (res === undefined) {
|
|
456
|
+
res = {
|
|
457
|
+
isPurchase: false,
|
|
458
|
+
buttonState: 0,
|
|
459
|
+
trialRemainingSec: 20,
|
|
460
|
+
canOpenSettings: true
|
|
461
|
+
};
|
|
462
|
+
}
|
|
453
463
|
updatePlayerWidgetProps(instance, 'bottomLeft', 'TryExperience', {
|
|
454
464
|
isPurchase: res.isPurchase,
|
|
455
465
|
buttonState: res.buttonState,
|
package/lib/utils/navigation.js
CHANGED
|
@@ -11,7 +11,7 @@ export const miniIdLabs = {
|
|
|
11
11
|
export function gotoAIDrawMiniProgram(devId, brandColor) {
|
|
12
12
|
const color = new Color(brandColor);
|
|
13
13
|
const rgbColor = color.rgb().toString();
|
|
14
|
-
const url = `godzilla://${miniIdLabs.aiDrawMini}
|
|
14
|
+
const url = `godzilla://${miniIdLabs.aiDrawMini}?deviceId=${devId}&themeColor=${rgbColor}`;
|
|
15
15
|
goToMiniProgramByShortLink(url, 'right');
|
|
16
16
|
}
|
|
17
17
|
export async function gotoSecurityCloudService(homeId, uuid) {
|
|
@@ -61,10 +61,15 @@ export const TryExperience = props => {
|
|
|
61
61
|
});
|
|
62
62
|
const [imgSrc, setImgSrc] = useState();
|
|
63
63
|
useEffect(() => {
|
|
64
|
-
|
|
64
|
+
updateImgSrc();
|
|
65
|
+
}, [buttonState]);
|
|
66
|
+
const updateImgSrc = useCallback(() => {
|
|
67
|
+
console.log('res===updateImgSrc', buttonState, isLowPhone);
|
|
65
68
|
if (isLowPhone) {
|
|
66
69
|
setImgSrc(tryClose);
|
|
67
|
-
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
if (buttonState === 0 || buttonState) {
|
|
68
73
|
const iconUrl = pickIconByStatus(buttonState);
|
|
69
74
|
setImgSrc(iconUrl);
|
|
70
75
|
} else {
|
|
@@ -90,6 +95,7 @@ export const TryExperience = props => {
|
|
|
90
95
|
const getAI = await getAIFrameFeature(devId);
|
|
91
96
|
if (buttonState === TryExperienceStatus.Open) {
|
|
92
97
|
var _getAI$aiFrameFeature, _getAI$aiFrameFeature2, _getAI$aiFrameFeature3, _props$event;
|
|
98
|
+
// 由开变关的时候,只关inPreview
|
|
93
99
|
const scope = _objectSpread(_objectSpread({}, (_getAI$aiFrameFeature = getAI.aiFrameFeature) === null || _getAI$aiFrameFeature === void 0 ? void 0 : _getAI$aiFrameFeature.scope), {}, {
|
|
94
100
|
inPreview: false
|
|
95
101
|
});
|
|
@@ -110,11 +116,12 @@ export const TryExperience = props => {
|
|
|
110
116
|
const scope = _objectSpread(_objectSpread({}, (_getAI$aiFrameFeature4 = getAI.aiFrameFeature) === null || _getAI$aiFrameFeature4 === void 0 ? void 0 : _getAI$aiFrameFeature4.scope), {}, {
|
|
111
117
|
inPreview: true
|
|
112
118
|
});
|
|
119
|
+
// 由关变开的时候,enabled和inPreview两个都开
|
|
113
120
|
await setAIFrameFeature({
|
|
114
121
|
devId,
|
|
115
122
|
scene: 'inPreview',
|
|
116
123
|
// 实时预览场景
|
|
117
|
-
enabled:
|
|
124
|
+
enabled: true,
|
|
118
125
|
aiFrameFeature: {
|
|
119
126
|
scope,
|
|
120
127
|
feature: (_getAI$aiFrameFeature5 = getAI.aiFrameFeature) === null || _getAI$aiFrameFeature5 === void 0 ? void 0 : _getAI$aiFrameFeature5.feature,
|