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" : {
|
||||
"urlCheck" : false,
|
||||
"minified" : true,
|
||||
"postcss" : false,
|
||||
"es6" : true
|
||||
"postcss" : true,
|
||||
"es6" : true,
|
||||
"enhance" : true
|
||||
},
|
||||
"permission" : {
|
||||
"scope.userLocation" : {
|
||||
|
||||
@@ -194,7 +194,7 @@ function awaitPay(payment: string) {
|
||||
}
|
||||
|
||||
function padTime(val: number) {
|
||||
return String(val ?? 0).padStart(2, '0')
|
||||
return String(val != null ? val : 0).padStart(2, '0')
|
||||
}
|
||||
|
||||
function onPayTimeout() {
|
||||
|
||||
@@ -74,7 +74,7 @@ const withdrawParams = ref({ pageNumber: 1, pageSize: 10 })
|
||||
const achievementParams = ref({ pageNumber: 1, pageSize: 10 })
|
||||
|
||||
onLoad((option) => {
|
||||
const type = Number(option.type ?? 0)
|
||||
const type = Number(option.type != null ? option.type : 0)
|
||||
listType.value = type
|
||||
routeQuery.value = option || {}
|
||||
uni.setNavigationBarTitle({
|
||||
|
||||
@@ -59,7 +59,7 @@ function fetchDistributionInfo() {
|
||||
}
|
||||
|
||||
function submitWithdraw() {
|
||||
const amount = String(price.value ?? '')
|
||||
const amount = String(price.value != null ? price.value : '')
|
||||
if (proxy.$u.test.amount(parseInt(amount))) {
|
||||
cash({ price: amount }).then((res) => {
|
||||
if (res.data.success) {
|
||||
@@ -75,7 +75,10 @@ function submitWithdraw() {
|
||||
}
|
||||
|
||||
function fillAllAmount() {
|
||||
price.value = distributionData.value.canRebate ?? ''
|
||||
price.value =
|
||||
distributionData.value.canRebate != null
|
||||
? distributionData.value.canRebate
|
||||
: ''
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -188,7 +188,7 @@ function fetchTrackList() {
|
||||
}
|
||||
|
||||
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
|
||||
if (!goodsId) return
|
||||
deleteHistoryListId(goodsId).then((res) => {
|
||||
|
||||
@@ -162,7 +162,7 @@ function refreshCountdown(list = promotionList.value) {
|
||||
}
|
||||
|
||||
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) {
|
||||
|
||||
@@ -317,7 +317,7 @@ function initPageData() {
|
||||
num: storeId.value,
|
||||
})
|
||||
.then((res) => {
|
||||
const payload = res?.data ?? res
|
||||
const payload = res?.data != null ? res.data : res
|
||||
const result = payload?.result
|
||||
const pageDataStr = result?.pageData
|
||||
if (!isPageDataSuccess(payload) || !pageDataStr) {
|
||||
@@ -571,31 +571,31 @@ onMounted(() => {
|
||||
min-height: 56rpx;
|
||||
}
|
||||
|
||||
.store-name {
|
||||
width: 100%;
|
||||
font-size: 34rpx;
|
||||
color: #333;
|
||||
letter-spacing: 1rpx;
|
||||
font-weight: bold;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.store-name-text {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
display: block;
|
||||
padding: 0 150rpx 0 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.store-message {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
flex-wrap: nowrap;
|
||||
margin-top: 12rpx;
|
||||
font-size: 24rpx;
|
||||
.store-name {
|
||||
width: 100%;
|
||||
font-size: 34rpx;
|
||||
color: #333;
|
||||
letter-spacing: 1rpx;
|
||||
font-weight: bold;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.store-name-text {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
display: block;
|
||||
padding: 0 150rpx 0 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.store-message {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
flex-wrap: nowrap;
|
||||
margin-top: 12rpx;
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
|
||||
@@ -898,7 +898,9 @@ function normalizeMqttLiveStatus(status: string | number) {
|
||||
2: LIVE_STATUS.ENDED,
|
||||
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) {
|
||||
|
||||
@@ -124,7 +124,7 @@ function init() {
|
||||
loading.value = true
|
||||
getFloorData()
|
||||
.then((res) => {
|
||||
const payload = res?.data ?? res
|
||||
const payload = res?.data != null ? res.data : res
|
||||
const pageDataStr = payload?.result?.pageData
|
||||
const isSuccess = payload?.success === true || payload?.code === 200
|
||||
if (!isSuccess || !pageDataStr) return
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
{
|
||||
"setting": {
|
||||
"minifyWXML": true
|
||||
"minifyWXML": true,
|
||||
"es6": true,
|
||||
"minified": true,
|
||||
"postcss": true,
|
||||
"enhance": true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user