li.shaoyi 2 jaren geleden
bovenliggende
commit
bbd2cd601d

File diff suppressed because it is too large
+ 0 - 0
src/packages/mobile/assets/icons/wddj.svg


+ 11 - 0
src/packages/mobile/router/index.ts

@@ -272,6 +272,17 @@ const routes: Array<RouteRecordRaw> = [
     ],
   },
   {
+    path: "/pricing",
+    component: Page,
+    children: [
+      {
+        path: "",
+        name: "Pricing",
+        component: () => import("../views/mine/pricing/list/index.vue"),
+      },
+    ],
+  },
+  {
     path: "/wareorder",
     component: Page,
     children: [

+ 4 - 0
src/packages/mobile/views/mine/main/index.vue

@@ -58,6 +58,10 @@
           <img src="@mobile/assets/icons/order.svg" />
           <span>我的订单</span>
         </li>
+        <li @click="routerTo('Pricing')">
+          <img src="@mobile/assets/icons/wddj.svg" />
+          <span>我的点价</span>
+        </li>
         <li @click="routerTo('my-wareorder')">
           <img src="@mobile/assets/icons/wareorder.svg" />
           <span>我的仓单</span>

+ 24 - 12
src/packages/mobile/views/mine/order/detail/purchasetrade/index.vue

@@ -30,7 +30,8 @@
                 <Cell title="合同单号" :value="detail.wrtradedetailid" :is-link="!!detail.contractaddrbuy"
                     @click="openPDF(detail?.contractaddrbuy)" />
             </CellGroup>
-            <CellGroup title="点价信息" v-if="detail.pointflag && detail.buyuserid === detail.firstbuyuserid">
+            <CellGroup title="点价信息"
+                v-if="detail.pointflag && (detail.buyuserid === detail.firstbuyuserid || ['2', '3'].includes(type.toString()))">
                 <Cell title="已点价格" :value="detail.pointprice" />
                 <Cell title="已点收益" :value="detail.pointincome" />
             </CellGroup>
@@ -40,16 +41,27 @@
         </div>
         <template #footer>
             <div class="g-form__footer" v-if="detail">
-                <Button block round type="primary"
-                    v-if="detail.buyuserid === detail.firstbuyuserid && detail.availabletime > 0 && detail.presalestatus === 2 && detail.orderstatus === 1"
-                    @click="spotPricingSubmit">点价</Button>
-                <Button block round type="primary"
-                    v-if="detail.thjdeliverymode === 1 && detail.presalestatus === 2 && detail.orderstatus === 1"
-                    @click="showDialog">合同转让</Button>
-                <Button block round type="primary" v-if="detail.orderstatus === 9" @click="spotCancelSubmit">撤销转让</Button>
-                <Button block round type="primary" v-if="detail.orderstatus === 5" @click="spotConfirmSubmit">确认交收</Button>
-                <Button block round type="primary" v-if="detail.orderstatus === 3" @click="spotApplySubmit">违约</Button>
-                <Button block round type="primary" v-if="detail.orderstatus === 3" @click="spotPlaymentSubmit">支付</Button>
+                <!-- 参数类型为 2 时只显示点价按钮 -->
+                <template v-if="type.toString() === '2'">
+                    <Button block round type="primary"
+                        v-if="detail.buyuserid === detail.firstbuyuserid && detail.availabletime > 0 && detail.presalestatus === 2 && detail.orderstatus === 1"
+                        @click="spotPricingSubmit">点价</Button>
+                </template>
+                <template v-else-if="type.toString() !== '3'">
+                    <Button block round type="primary"
+                        v-if="detail.buyuserid === detail.firstbuyuserid && detail.availabletime > 0 && detail.presalestatus === 2 && detail.orderstatus === 1"
+                        @click="spotPricingSubmit">点价</Button>
+                    <Button block round type="primary"
+                        v-if="detail.thjdeliverymode === 1 && detail.presalestatus === 2 && detail.orderstatus === 1"
+                        @click="showDialog">合同转让</Button>
+                    <Button block round type="primary" v-if="detail.orderstatus === 9"
+                        @click="spotCancelSubmit">撤销转让</Button>
+                    <Button block round type="primary" v-if="detail.orderstatus === 5"
+                        @click="spotConfirmSubmit">确认交收</Button>
+                    <Button block round type="primary" v-if="detail.orderstatus === 3" @click="spotApplySubmit">违约</Button>
+                    <Button block round type="primary" v-if="detail.orderstatus === 3"
+                        @click="spotPlaymentSubmit">支付</Button>
+                </template>
             </div>
         </template>
         <!-- 转让价格 -->
@@ -73,9 +85,9 @@ import { useSpotPresaleDeliveryConfirm, useSpotPresaleBreachOfContractApply, use
 import plus from '@/utils/h5plus'
 
 const { route, router } = useNavigation()
+const { item, type } = route.params
 /// 是否显示dialog
 const show = shallowRef(false)
-const item = route.params.item
 const detail = shallowRef<Model.THJPurchaseTradeDetailRsp>()
 
 if (item) {

+ 10 - 2
src/packages/mobile/views/mine/order/list/components/purchasetrade/index.vue

@@ -55,6 +55,14 @@ import { useRequest } from '@/hooks/request'
 import { queryTHJPurchaseTradeDetail } from '@/services/api/order'
 import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
 
+const props = defineProps({
+    // 类型 - 0:未完成 1:已完成 2:可点订单 3:已点订单
+    type: {
+        type: Number,
+        default: 0
+    }
+})
+
 const { router } = useNavigation()
 const dataList = shallowRef<Model.THJPurchaseTradeDetailRsp[]>([])
 const error = shallowRef(false)
@@ -64,7 +72,7 @@ const { loading, pageIndex, pageCount, run } = useRequest(queryTHJPurchaseTradeD
     manual: true,
     params: {
         pagesize: 20,
-        type: 0,
+        type: props.type,
     },
     onSuccess: (res) => {
         if (pageIndex.value === 1) {
@@ -78,7 +86,7 @@ const { loading, pageIndex, pageCount, run } = useRequest(queryTHJPurchaseTradeD
 })
 
 const onClick = (item: Model.THJPurchaseTradeDetailRsp) => {
-    router.push({ name: 'purchase-trade-detail', params: { item: JSON.stringify(item) } })
+    router.push({ name: 'purchase-trade-detail', params: { item: JSON.stringify(item), type: props.type } })
 }
 
 onActivated(() => {

+ 89 - 0
src/packages/mobile/views/mine/pricing/list/index.less

@@ -0,0 +1,89 @@
+.order-list {
+    .van-tabs {
+        display: flex;
+        flex-direction: column;
+        height: 100%;
+
+        &__content {
+            flex: 1;
+            overflow-y: auto;
+        }
+
+        .van-tab__panel {
+            height: 100%;
+        }
+    }
+
+    &__wrapper {
+        .section {
+            padding: .2rem;
+            padding-bottom: 0;
+
+            &-item {
+                background-color: #fff;
+                border-radius: .16rem;
+                padding: .24rem;
+
+                &:not(:first-child) {
+                    margin-top: .2rem;
+                }
+
+                &__titlebar {
+                    display: flex;
+                    justify-content: space-between;
+                    align-items: center;
+                    margin-bottom: .2rem;
+
+                    .left {
+                        span {
+                            &:first-child {
+                                margin-right: .2rem;
+                            }
+
+                            &:not(:first-child):not(:last-child) {
+                                &::after {
+                                    content: '/';
+                                    margin: 0 .1rem;
+                                }
+                            }
+                        }
+                    }
+
+                    .right {
+                        font-size: .24rem;
+                        color: #999;
+                    }
+                }
+
+                &__content {
+                    table {
+                        width: 100%;
+                        font-size: .24rem;
+
+                        th,
+                        td {
+                            padding: .08rem 0;
+                        }
+
+                        th {
+                            font-weight: normal;
+                            color: #999;
+                        }
+                    }
+                }
+
+                &__btnbar {
+                    display: flex;
+                    justify-content: flex-end;
+                    gap: .16rem;
+                    margin-top: .2rem;
+
+                    .van-button {
+                        width: 1.6rem;
+                        border-width: 1px;
+                    }
+                }
+            }
+        }
+    }
+}

+ 28 - 0
src/packages/mobile/views/mine/pricing/list/index.vue

@@ -0,0 +1,28 @@
+<!-- 我的点价 -->
+<template>
+    <app-view class="order-list">
+        <template #header>
+            <app-navbar title="我的点价" />
+        </template>
+        <Tabs v-model:active="activeTab">
+            <Tab title="可点价订单">
+                <PurchaseTrade :type="2" v-if="activeTab === 0" />
+            </Tab>
+            <Tab title="已点价订单">
+                <PurchaseTrade :type="3" v-if="activeTab === 1" />
+            </Tab>
+        </Tabs>
+    </app-view>
+</template>
+
+<script lang="ts" setup>
+import { shallowRef } from 'vue'
+import { Tab, Tabs } from 'vant'
+import PurchaseTrade from '@mobile/views/mine/order/list/components/purchasetrade/index.vue'
+
+const activeTab = shallowRef(0)
+</script>
+
+<style lang="less">
+@import './index.less';
+</style>

+ 15 - 8
src/packages/mobile/views/news/details/index.vue

@@ -70,14 +70,21 @@ const { data } = useRequest(queryNewContents, {
 
             nextTick(() => {
                 const el = htmlRef.value
-                el?.querySelectorAll('img').forEach((e, i) => {
-                    e.onclick = () => {
-                        showImagePreview({
-                            images: getImageSrc(details.context),
-                            startPosition: i,
-                        })
-                    }
-                })
+                if (el) {
+                    el.querySelectorAll('img').forEach((e, i) => {
+                        e.onclick = () => {
+                            showImagePreview({
+                                images: getImageSrc(details.context),
+                                startPosition: i,
+                            })
+                        }
+                    })
+                    el.querySelectorAll('a').forEach((e) => {
+                        const href = e.href
+                        e.onclick = () => plus.openURL(href)
+                        e.removeAttribute('href')
+                    })
+                }
             })
 
             run({ columnid: details.columnid })

+ 6 - 3
src/packages/mobile/views/purchase/detail/index.vue

@@ -218,10 +218,13 @@ const formRules: { [key in keyof Proto.SpotPresaleDestingOrderReq | 'addressInfo
         message: '请输入采购数量',
         validator: (val) => {
             if (val && Number(val)) {
-                if (Number(val) <= maxQty.value) {
-                    return true
+                if (Number(val) < 5) {
+                    return '数量必须大于等于5'
                 }
-                return '剩余数量不足'
+                if (maxQty.value < Number(val)) {
+                    return '剩余数量不足'
+                }
+                return true
             }
             return false
         }

+ 15 - 8
src/packages/mobile/views/share/news/index.vue

@@ -43,14 +43,21 @@ const { data } = useRequest(queryNewContents, {
 
             nextTick(() => {
                 const el = htmlRef.value
-                el?.querySelectorAll('img').forEach((e, i) => {
-                    e.onclick = () => {
-                        showImagePreview({
-                            images: getImageSrc(details.context),
-                            startPosition: i,
-                        })
-                    }
-                })
+                if (el) {
+                    el.querySelectorAll('img').forEach((e, i) => {
+                        e.onclick = () => {
+                            showImagePreview({
+                                images: getImageSrc(details.context),
+                                startPosition: i,
+                            })
+                        }
+                    })
+                    el.querySelectorAll('a').forEach((e) => {
+                        const href = e.href
+                        e.onclick = () => plus.openURL(href)
+                        e.removeAttribute('href')
+                    })
+                }
             })
         }
     }

+ 7 - 6
src/stores/modules/account.ts

@@ -32,11 +32,12 @@ export const accountStore = createStore({
     },
     actions: {
         // 获取资金账户列表
-        getAccountList() {
+        async getAccountList() {
             this.state.loading = true
-            return queryTaAccounts({
-                loginID: loginStore.getters.loginId
-            }).then((res) => {
+            try {
+                const res = await queryTaAccounts({
+                    loginID: loginStore.getters.loginId
+                })
                 const dataList = res.data
                 if (dataList.length) {
                     this.state.accountList = dataList
@@ -52,9 +53,9 @@ export const accountStore = createStore({
                     this.state.loading = false
                     this.actions.reset()
                 }
-            }).catch(() => {
+            } catch {
                 this.state.loading = false
-            })
+            }
         },
         // 重置数据
         reset() {

+ 5 - 4
src/stores/modules/errorInfo.ts

@@ -14,16 +14,17 @@ export const errorInfoStore = createStore({
     },
     actions: {
         // 获取系统错误信息
-        getErrorInfoList() {
+        async getErrorInfoList() {
             if (this.state.errorInfos.length) {
                 return Promise.resolve()
             }
             this.state.loading = true
-            return queryErrorInfos().then((res) => {
+            try {
+                const res = await queryErrorInfos()
                 this.state.errorInfos = res.data
-            }).finally(() => {
+            } finally {
                 this.state.loading = false
-            })
+            }
         },
         // 根据 code 获取错误信息
         getErrorInfoByCode(code: number) {

+ 20 - 1
src/stores/modules/login.ts

@@ -1,5 +1,6 @@
+import { encryptAES, decryptAES } from '@/utils/crypto'
 import { createStore } from '../base'
-import { sessionData } from '../storage'
+import { sessionData, localData } from '../storage'
 
 /**
  * 登录存储对象
@@ -35,5 +36,23 @@ export const loginStore = createStore({
         getLoginInfo<K extends keyof Proto.LoginRsp>(key: K) {
             return this.state.loginInfo[key]
         },
+        // 获取自动登录数据
+        getAutoLoginData(data: Proto.LoginReq) {
+            const encryptedData = encryptAES(JSON.stringify(data)) // 数据加密
+            localData.setValue('autoLoginEncryptedData', encryptedData)
+        },
+        // 设置自动登录数据
+        setAutoLoginData(): Proto.LoginRsp {
+            const encryptedData = localData.getValue('autoLoginEncryptedData')
+            if (encryptedData) {
+                const decryptedString = decryptAES(encryptedData)
+                return JSON.parse(decryptedString)
+            }
+            return Object.create(null)
+        },
+        // 清除自动登录数据
+        clearAutoLoginData() {
+            localData.reset('autoLoginEncryptedData')
+        }
     }
 })

Some files were not shown because too many files changed in this diff