已改续租接口
This commit is contained in:
parent
ca09639935
commit
a023cdc367
|
|
@ -13,8 +13,8 @@ export function getDeviceTypes() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据设备id获取租赁套餐列表
|
* 根据设备类型id获取租赁套餐列表
|
||||||
* @param {string} typeId - 设备ids
|
* @param {string} typeId - 设备类型id
|
||||||
* @returns {Promise} 返回租赁套餐列表数据
|
* @returns {Promise} 返回租赁套餐列表数据
|
||||||
*/
|
*/
|
||||||
export function getPeriodPackagesByTypeId(typeId) {
|
export function getPeriodPackagesByTypeId(typeId) {
|
||||||
|
|
@ -28,6 +28,22 @@ export function getPeriodPackagesByTypeId(typeId) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据设备id获取租赁套餐列表
|
||||||
|
* @param {string} devId - 设备id
|
||||||
|
* @returns {Promise} 返回租赁套餐列表数据
|
||||||
|
*/
|
||||||
|
export function getPeriodPackagesByDevId(devId) {
|
||||||
|
return request({
|
||||||
|
url: '/app/suit/listByDevId',
|
||||||
|
method: 'GET',
|
||||||
|
params: {
|
||||||
|
devId: devId,
|
||||||
|
},
|
||||||
|
loadingText: '加载套餐中...',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据套餐ids获取租赁套餐列表
|
* 根据套餐ids获取租赁套餐列表
|
||||||
* @param {string} suitIds - 套餐ids
|
* @param {string} suitIds - 套餐ids
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
{{ getStatusText(device.status) }}
|
{{ getStatusText(device.status) }}
|
||||||
</text>
|
</text>
|
||||||
<text v-if="device.endTime" class="device-time">
|
<text v-if="device.endTime" class="device-time">
|
||||||
到期时间: {{ formatTime(device.endTime) }}
|
到期时间: {{ uni.$uv.date(device.endTime) }}
|
||||||
</text>
|
</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -45,7 +45,7 @@
|
||||||
>
|
>
|
||||||
<view class="package-info">
|
<view class="package-info">
|
||||||
<text class="package-name">{{ item.name || `套餐${index + 1}` }}</text>
|
<text class="package-name">{{ item.name || `套餐${index + 1}` }}</text>
|
||||||
<text class="package-desc">{{ item.description || item.period || '暂无描述' }}</text>
|
<!-- <text class="package-desc">{{ item.description || item.period || '暂无描述' }}</text>-->
|
||||||
</view>
|
</view>
|
||||||
<view class="package-price">
|
<view class="package-price">
|
||||||
<text class="price-symbol">¥</text>
|
<text class="price-symbol">¥</text>
|
||||||
|
|
@ -147,13 +147,6 @@ export default {
|
||||||
}
|
}
|
||||||
return statusMap[status] || '未知状态'
|
return statusMap[status] || '未知状态'
|
||||||
},
|
},
|
||||||
|
|
||||||
// 格式化时间
|
|
||||||
formatTime(timeStr) {
|
|
||||||
if (!timeStr) return ''
|
|
||||||
const date = new Date(timeStr)
|
|
||||||
return `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, '0')}-${String(date.getDate()).padStart(2, '0')}`
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,12 @@ import RenewModal from '../../components/renew-modal/renew-modal.vue'
|
||||||
import { getNewAnnouncement } from '../../api/article/article.js'
|
import { getNewAnnouncement } from '../../api/article/article.js'
|
||||||
import { getBannerList } from '../../api/banner/banner.js'
|
import { getBannerList } from '../../api/banner/banner.js'
|
||||||
import { getDeviceList } from '../../api/device/device.js'
|
import { getDeviceList } from '../../api/device/device.js'
|
||||||
import { renewDevice, getPeriodPackages, getPeriodPackagesByTypeId } from '../../api/lease/lease.js'
|
import {
|
||||||
|
renewDevice,
|
||||||
|
getPeriodPackages,
|
||||||
|
getPeriodPackagesByTypeId,
|
||||||
|
getPeriodPackagesByDevId,
|
||||||
|
} from '../../api/lease/lease.js'
|
||||||
import { getIsRealName } from '../../api'
|
import { getIsRealName } from '../../api'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
@ -293,8 +298,9 @@ export default {
|
||||||
this.packageLoading = true
|
this.packageLoading = true
|
||||||
|
|
||||||
// 根据设备ID查询套餐
|
// 根据设备ID查询套餐
|
||||||
await this.fetchPackageList(this.selectedDevice.originalData.typeId)
|
console.log('设备信息originalData', this.selectedDevice.originalData)
|
||||||
console.log('设备类型id', this.selectedDevice.originalData.typeId)
|
await this.fetchPackageList(this.selectedDevice.originalData.id)
|
||||||
|
console.log('设备id', this.selectedDevice.originalData.id)
|
||||||
this.showRenewModal = true
|
this.showRenewModal = true
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('打开续费弹窗失败:', error)
|
console.error('打开续费弹窗失败:', error)
|
||||||
|
|
@ -310,7 +316,7 @@ export default {
|
||||||
try {
|
try {
|
||||||
console.log('设备类型ID:', deviceId)
|
console.log('设备类型ID:', deviceId)
|
||||||
|
|
||||||
const response = await getPeriodPackagesByTypeId(deviceId)
|
const response = await getPeriodPackagesByDevId(deviceId)
|
||||||
|
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
this.packageList = response.data || []
|
this.packageList = response.data || []
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user