Jelajahi Sumber

修复历史数据

lex 1 tahun lalu
induk
melakukan
f06bee73ff

+ 0 - 1
src/components/the-sticky/index.tsx

@@ -58,7 +58,6 @@ export default defineComponent({
     const divRef = ref()
     const div2Ref = ref()
     onMounted(() => {
-      console.log(forms.divStyle, 'forms.divStyle', props.position)
       if (props.position === 'top') {
         forms.divStyle.top = props.offsetTop || '0px'
       } else {

+ 26 - 3
src/tenant/trade/detail.tsx

@@ -26,8 +26,30 @@ export default defineComponent({
             hideLoading: status
           }
         )
-        console.log(res.data)
-        result.value = res.data
+        const temp = res.data || {}
+
+        temp.orderDetailList?.forEach((item: any) => {
+          const bizContent = item.bizContent ? JSON.parse(item.bizContent) : {}
+          if (bizContent && bizContent.purchaseType) {
+            const template = {
+              MONTH: 1,
+              QUARTERLY: 3,
+              YEAR_HALF: 6,
+              YEAR: 12
+            }
+            if (bizContent.purchaseType === 'DAY') {
+              item.unit = '天'
+            } else {
+              item.unit = '个月'
+              item.bizInfo.bizValidTime =
+                item.bizInfo.bizValidTime * template[bizContent.purchaseType]
+            }
+          } else {
+            item.unit = '个月'
+          }
+        })
+
+        result.value = temp
       } catch {
         //
       }
@@ -84,7 +106,8 @@ export default defineComponent({
                             <>
                               {orderDetail.goodType === 'TENANT_ALBUM' ? (
                                 <span class={styles.t}>
-                                  x{orderDetail.bizInfo?.bizValidTime}天
+                                  x{orderDetail.bizInfo?.bizValidTime}
+                                  {orderDetail.unit}
                                 </span>
                               ) : (
                                 <span class={styles.t}>永久</span>

+ 28 - 2
src/tenant/trade/index.tsx

@@ -65,7 +65,6 @@ export default defineComponent({
           ...state.params,
           searchDate: dayjs(state.currentSearchDate).format('YYYY-MM')
         }
-        console.log(state.params, 'state.params')
 
         const url =
           state.type === 'buy'
@@ -80,6 +79,32 @@ export default defineComponent({
         })
         if (code === 200) {
           const result = data || {}
+          result.rows?.forEach((item: any) => {
+            const orderDetails = item.orderDetailList || []
+            orderDetails.forEach((item: any) => {
+              const bizContent = item.bizContent
+                ? JSON.parse(item.bizContent)
+                : {}
+              if (bizContent && bizContent.purchaseType) {
+                const template = {
+                  MONTH: 1,
+                  QUARTERLY: 3,
+                  YEAR_HALF: 6,
+                  YEAR: 12
+                }
+                if (bizContent.purchaseType === 'DAY') {
+                  item.unit = '天'
+                } else {
+                  item.unit = '个月'
+                  item.bizInfo.bizValidTime =
+                    item.bizInfo.bizValidTime *
+                    template[bizContent.purchaseType]
+                }
+              } else {
+                item.unit = '个月'
+              }
+            })
+          })
           state.list = state.list.concat(result.rows || [])
           state.finished = result.pageNo >= result.totalPage
           state.params.page = result.pageNo + 1
@@ -272,7 +297,8 @@ export default defineComponent({
                                   <>
                                     {orderDetail.goodType === 'TENANT_ALBUM' ? (
                                       <span class={styles.t}>
-                                        x{orderDetail.bizInfo?.bizValidTime}天
+                                        x{orderDetail.bizInfo?.bizValidTime}
+                                        {orderDetail.unit}
                                       </span>
                                     ) : (
                                       <span class={styles.t}>永久</span>

+ 1 - 1
vite.config.ts

@@ -11,7 +11,7 @@ function resolve(dir: string) {
 }
 // https://vitejs.dev/config/
 // https://github.com/vitejs/vite/issues/1930 .env
-// const proxyUrl = 'https://online.colexiu.com/';
+// const proxyUrl = 'https://online.colexiu.com/'
 const proxyUrl = 'https://dev.colexiu.com/'
 // const proxyUrl = 'http://192.168.3.14:8000/'
 export default defineConfig({