mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp.git
synced 2026-08-06 02:47:25 +08:00
fix: 更新配置和代码逻辑以提升稳定性和可读性
- 在 manifest.json 和 project.config.json 中启用 postcss 和 enhance 设置 - 在多个 Vue 组件中优化空值处理逻辑,确保更健壮的代码执行 - 调整样式和布局以提升用户体验
This commit is contained in:
@@ -199,8 +199,9 @@
|
|||||||
"setting" : {
|
"setting" : {
|
||||||
"urlCheck" : false,
|
"urlCheck" : false,
|
||||||
"minified" : true,
|
"minified" : true,
|
||||||
"postcss" : false,
|
"postcss" : true,
|
||||||
"es6" : true
|
"es6" : true,
|
||||||
|
"enhance" : true
|
||||||
},
|
},
|
||||||
"permission" : {
|
"permission" : {
|
||||||
"scope.userLocation" : {
|
"scope.userLocation" : {
|
||||||
|
|||||||
@@ -194,7 +194,7 @@ function awaitPay(payment: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function padTime(val: number) {
|
function padTime(val: number) {
|
||||||
return String(val ?? 0).padStart(2, '0')
|
return String(val != null ? val : 0).padStart(2, '0')
|
||||||
}
|
}
|
||||||
|
|
||||||
function onPayTimeout() {
|
function onPayTimeout() {
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ const withdrawParams = ref({ pageNumber: 1, pageSize: 10 })
|
|||||||
const achievementParams = ref({ pageNumber: 1, pageSize: 10 })
|
const achievementParams = ref({ pageNumber: 1, pageSize: 10 })
|
||||||
|
|
||||||
onLoad((option) => {
|
onLoad((option) => {
|
||||||
const type = Number(option.type ?? 0)
|
const type = Number(option.type != null ? option.type : 0)
|
||||||
listType.value = type
|
listType.value = type
|
||||||
routeQuery.value = option || {}
|
routeQuery.value = option || {}
|
||||||
uni.setNavigationBarTitle({
|
uni.setNavigationBarTitle({
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ function fetchDistributionInfo() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function submitWithdraw() {
|
function submitWithdraw() {
|
||||||
const amount = String(price.value ?? '')
|
const amount = String(price.value != null ? price.value : '')
|
||||||
if (proxy.$u.test.amount(parseInt(amount))) {
|
if (proxy.$u.test.amount(parseInt(amount))) {
|
||||||
cash({ price: amount }).then((res) => {
|
cash({ price: amount }).then((res) => {
|
||||||
if (res.data.success) {
|
if (res.data.success) {
|
||||||
@@ -75,7 +75,10 @@ function submitWithdraw() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function fillAllAmount() {
|
function fillAllAmount() {
|
||||||
price.value = distributionData.value.canRebate ?? ''
|
price.value =
|
||||||
|
distributionData.value.canRebate != null
|
||||||
|
? distributionData.value.canRebate
|
||||||
|
: ''
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -188,7 +188,7 @@ function fetchTrackList() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function deleteTracks(e: any, ids?: any) {
|
function deleteTracks(e: any, ids?: any) {
|
||||||
const index = typeof e === 'object' ? (e.name ?? e.index) : e
|
const index = typeof e === 'object' ? (e.name != null ? e.name : e.index) : e
|
||||||
const goodsId = ids || trackList.value[index]?.goodsId
|
const goodsId = ids || trackList.value[index]?.goodsId
|
||||||
if (!goodsId) return
|
if (!goodsId) return
|
||||||
deleteHistoryListId(goodsId).then((res) => {
|
deleteHistoryListId(goodsId).then((res) => {
|
||||||
|
|||||||
@@ -162,7 +162,7 @@ function refreshCountdown(list = promotionList.value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function padTime(val: number | undefined) {
|
function padTime(val: number | undefined) {
|
||||||
return String(val ?? 0).padStart(2, '0')
|
return String(val != null ? val : 0).padStart(2, '0')
|
||||||
}
|
}
|
||||||
|
|
||||||
function countdownDisplayHours(index: number) {
|
function countdownDisplayHours(index: number) {
|
||||||
|
|||||||
@@ -317,7 +317,7 @@ function initPageData() {
|
|||||||
num: storeId.value,
|
num: storeId.value,
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
const payload = res?.data ?? res
|
const payload = res?.data != null ? res.data : res
|
||||||
const result = payload?.result
|
const result = payload?.result
|
||||||
const pageDataStr = result?.pageData
|
const pageDataStr = result?.pageData
|
||||||
if (!isPageDataSuccess(payload) || !pageDataStr) {
|
if (!isPageDataSuccess(payload) || !pageDataStr) {
|
||||||
|
|||||||
@@ -898,7 +898,9 @@ function normalizeMqttLiveStatus(status: string | number) {
|
|||||||
2: LIVE_STATUS.ENDED,
|
2: LIVE_STATUS.ENDED,
|
||||||
3: LIVE_STATUS.PAUSED,
|
3: LIVE_STATUS.PAUSED,
|
||||||
}
|
}
|
||||||
return numMap[status as number] ?? roomInfo.value.liveStatus
|
return numMap[status as number] != null
|
||||||
|
? numMap[status as number]
|
||||||
|
: roomInfo.value.liveStatus
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleMqttLiveMessage(message: string) {
|
function handleMqttLiveMessage(message: string) {
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ function init() {
|
|||||||
loading.value = true
|
loading.value = true
|
||||||
getFloorData()
|
getFloorData()
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
const payload = res?.data ?? res
|
const payload = res?.data != null ? res.data : res
|
||||||
const pageDataStr = payload?.result?.pageData
|
const pageDataStr = payload?.result?.pageData
|
||||||
const isSuccess = payload?.success === true || payload?.code === 200
|
const isSuccess = payload?.success === true || payload?.code === 200
|
||||||
if (!isSuccess || !pageDataStr) return
|
if (!isSuccess || !pageDataStr) return
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
{
|
{
|
||||||
"setting": {
|
"setting": {
|
||||||
"minifyWXML": true
|
"minifyWXML": true,
|
||||||
|
"es6": true,
|
||||||
|
"minified": true,
|
||||||
|
"postcss": true,
|
||||||
|
"enhance": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user