feat: 更新应用版本号并调整构建配置以支持热更
This commit is contained in:
parent
79a8dae49f
commit
a6a42525f7
|
|
@ -10,7 +10,7 @@ export const IOS_UNIVERSAL_LINK = 'duooomi.bowong.cn'
|
||||||
// 原生版本,原生代码变更时需要更新此版本号
|
// 原生版本,原生代码变更时需要更新此版本号
|
||||||
export const VERSION = '1.1.0'
|
export const VERSION = '1.1.0'
|
||||||
// JavaScript版本,JS代码变更时需要更新此版本号
|
// JavaScript版本,JS代码变更时需要更新此版本号
|
||||||
export const APP_VERSION = 'dev202601191538'
|
export const APP_VERSION = 'dev202601201650'
|
||||||
|
|
||||||
const ALIPAY_SCHEMA = 'alipay2021006119657394'
|
const ALIPAY_SCHEMA = 'alipay2021006119657394'
|
||||||
const ALIPAY_SCHEMA_SANDBOX = 'alipay9021000158673972'
|
const ALIPAY_SCHEMA_SANDBOX = 'alipay9021000158673972'
|
||||||
|
|
@ -118,8 +118,9 @@ export default ({ config }) => {
|
||||||
},
|
},
|
||||||
android: {
|
android: {
|
||||||
// 解决构建打包时webp导致内存占用过高,临时禁用
|
// 解决构建打包时webp导致内存占用过高,临时禁用
|
||||||
enableProguardInReleaseBuilds: false,
|
// 测试环境不压缩,会导致 developmentClient 构建失败
|
||||||
enableShrinkResourcesInReleaseBuilds: false,
|
enableProguardInReleaseBuilds: true,
|
||||||
|
enableShrinkResourcesInReleaseBuilds: true,
|
||||||
|
|
||||||
// 增加 Java 堆内存
|
// 增加 Java 堆内存
|
||||||
packagingOptions: {
|
packagingOptions: {
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ const navItems = [
|
||||||
{ id: 'index', label: '探索', iconName: 'compass-outline' },
|
{ id: 'index', label: '探索', iconName: 'compass-outline' },
|
||||||
{ id: 'generate', label: '生成', iconName: 'image-outline' },
|
{ id: 'generate', label: '生成', iconName: 'image-outline' },
|
||||||
{ id: 'sync', label: '同步', iconName: 'refresh' },
|
{ id: 'sync', label: '同步', iconName: 'refresh' },
|
||||||
{ id: 'explore', label: '蓝牙调试', iconName: 'person-outline' },
|
// { id: 'explore', label: '蓝牙调试', iconName: 'person-outline' },
|
||||||
]
|
]
|
||||||
|
|
||||||
function renderNavItem(item: (typeof navItems)[0], isActive: boolean, onRouteChange: (route: string) => void) {
|
function renderNavItem(item: (typeof navItems)[0], isActive: boolean, onRouteChange: (route: string) => void) {
|
||||||
|
|
|
||||||
|
|
@ -63,6 +63,10 @@ const Index = observer(function Index() {
|
||||||
const [loadingMore, setLoadingMore] = useState(false)
|
const [loadingMore, setLoadingMore] = useState(false)
|
||||||
const [hasMore, setHasMore] = useState(true)
|
const [hasMore, setHasMore] = useState(true)
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
console.log('expo env------------', process.env.EXPO_PUBLIC_ENV)
|
||||||
|
}, [])
|
||||||
|
|
||||||
/** ================= refs(核心) ================= */
|
/** ================= refs(核心) ================= */
|
||||||
|
|
||||||
const queryRef = useRef({
|
const queryRef = useRef({
|
||||||
|
|
@ -283,57 +287,56 @@ const Index = observer(function Index() {
|
||||||
|
|
||||||
Toast.showLoading()
|
Toast.showLoading()
|
||||||
try {
|
try {
|
||||||
await userBalanceStore.load(true)
|
// await userBalanceStore.load(true)
|
||||||
|
|
||||||
const currentBalance = userBalanceStore.balance
|
const currentBalance = userBalanceStore.balance
|
||||||
if (currentBalance < selectedItem.price) {
|
if (currentBalance < selectedItem.price) {
|
||||||
Toast.show({ title: '余额不足,请充值' })
|
Toast.show({ title: '余额不足,请充值' })
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Toast.showModal(
|
||||||
|
<ConfirmModal
|
||||||
|
content={
|
||||||
|
<Text className="text-[14px] font-bold">
|
||||||
|
生成将消耗
|
||||||
|
<Text className="mx-[4px] text-[20px] text-[#e61e25]">{selectedItem.price}</Text>
|
||||||
|
</Text>
|
||||||
|
}
|
||||||
|
onCancel={Toast.hideModal}
|
||||||
|
onConfirm={async () => {
|
||||||
|
Toast.hideModal()
|
||||||
|
Toast.showLoading()
|
||||||
|
|
||||||
|
try {
|
||||||
|
userBalanceStore.deductBalance(selectedItem.price)
|
||||||
|
|
||||||
|
const { generationId, error } = await runTemplate({
|
||||||
|
templateId: selectedItem.id,
|
||||||
|
data: {},
|
||||||
|
})
|
||||||
|
await userBalanceStore.load(true)
|
||||||
|
|
||||||
|
if (generationId && user?.id) {
|
||||||
|
Toast.show({ title: '生成任务开启,请在我的生成中查看' })
|
||||||
|
} else {
|
||||||
|
userBalanceStore.setBalance(userBalanceStore.balance + selectedItem.price)
|
||||||
|
Toast.show({ title: error?.message || '生成失败' })
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
userBalanceStore.setBalance(userBalanceStore.balance + selectedItem.price)
|
||||||
|
Toast.show({ title: '网络异常,请重试' })
|
||||||
|
} finally {
|
||||||
|
Toast.hideLoading()
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
/>,
|
||||||
|
)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
Toast.show({ title: '余额加载失败,请重试' })
|
Toast.show({ title: '余额加载失败,请重试' })
|
||||||
return
|
return
|
||||||
} finally {
|
} finally {
|
||||||
Toast.hideLoading()
|
Toast.hideLoading()
|
||||||
}
|
}
|
||||||
|
|
||||||
Toast.showModal(
|
|
||||||
<ConfirmModal
|
|
||||||
content={
|
|
||||||
<Text className="text-[14px] font-bold">
|
|
||||||
生成将消耗
|
|
||||||
<Text className="mx-[4px] text-[20px] text-[#e61e25]">{selectedItem.price}</Text>
|
|
||||||
</Text>
|
|
||||||
}
|
|
||||||
onCancel={Toast.hideModal}
|
|
||||||
onConfirm={async () => {
|
|
||||||
Toast.hideModal()
|
|
||||||
Toast.showLoading()
|
|
||||||
|
|
||||||
try {
|
|
||||||
userBalanceStore.deductBalance(selectedItem.price)
|
|
||||||
|
|
||||||
const { generationId, error } = await runTemplate({
|
|
||||||
templateId: selectedItem.id,
|
|
||||||
data: {},
|
|
||||||
})
|
|
||||||
|
|
||||||
if (generationId && user?.id) {
|
|
||||||
await userBalanceStore.load(true)
|
|
||||||
Toast.show({ title: '生成任务开启,请在我的生成中查看' })
|
|
||||||
} else {
|
|
||||||
userBalanceStore.setBalance(userBalanceStore.balance + selectedItem.price)
|
|
||||||
Toast.show({ title: error?.message || '生成失败' })
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
userBalanceStore.setBalance(userBalanceStore.balance + selectedItem.price)
|
|
||||||
Toast.show({ title: '网络异常,请重试' })
|
|
||||||
} finally {
|
|
||||||
Toast.hideLoading()
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
/>,
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const renderListEmpty = () => {
|
const renderListEmpty = () => {
|
||||||
|
|
@ -388,7 +391,7 @@ const Index = observer(function Index() {
|
||||||
for (let i = Math.max(0, first - 6); i < first; i++) {
|
for (let i = Math.max(0, first - 6); i < first; i++) {
|
||||||
if (allItems[i]) currentVisible.add(allItems[i].id)
|
if (allItems[i]) currentVisible.add(allItems[i].id)
|
||||||
}
|
}
|
||||||
for (let i = last + 1; i < Math.min(allItems.length, last - 6); i++) {
|
for (let i = last + 1; i < Math.min(allItems.length, last - 9); i++) {
|
||||||
currentVisible.add(allItems[i].id)
|
currentVisible.add(allItems[i].id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue