li.shaoyi преди 2 години
родител
ревизия
991b637e0e
променени са 79 файла, в които са добавени 727 реда и са изтрити 642 реда
  1. 8 97
      src/business/bank/index.ts
  2. 0 38
      src/business/contract/index.ts
  3. 1 56
      src/business/market/index.ts
  4. 0 27
      src/business/order/index.ts
  5. 2 1
      src/business/trade/index.ts
  6. 1 34
      src/business/user/account.ts
  7. 1 31
      src/business/user/address.ts
  8. 2 2
      src/business/user/index.ts
  9. 1 31
      src/business/user/invoice.ts
  10. 32 5
      src/filters/index.ts
  11. 6 2
      src/hooks/navigation/index.ts
  12. BIN
      src/packages/mobile/assets/icons/ccwl.png
  13. 0 0
      src/packages/mobile/assets/icons/ccwl.svg
  14. BIN
      src/packages/mobile/assets/icons/cpjg.png
  15. 0 0
      src/packages/mobile/assets/icons/cpjg.svg
  16. BIN
      src/packages/mobile/assets/icons/cpjs.png
  17. 1 0
      src/packages/mobile/assets/icons/cpjs.svg
  18. BIN
      src/packages/mobile/assets/icons/generalize.png
  19. 0 0
      src/packages/mobile/assets/icons/generalize.svg
  20. BIN
      src/packages/mobile/assets/icons/htzr.png
  21. 1 0
      src/packages/mobile/assets/icons/htzr.svg
  22. BIN
      src/packages/mobile/assets/icons/order.png
  23. 0 0
      src/packages/mobile/assets/icons/order.svg
  24. BIN
      src/packages/mobile/assets/icons/ptgz.png
  25. 0 0
      src/packages/mobile/assets/icons/ptgz.svg
  26. BIN
      src/packages/mobile/assets/icons/red-envelope.png
  27. 0 0
      src/packages/mobile/assets/icons/red-envelope.svg
  28. BIN
      src/packages/mobile/assets/icons/schedule.png
  29. 0 0
      src/packages/mobile/assets/icons/schedule.svg
  30. BIN
      src/packages/mobile/assets/icons/statement.png
  31. 0 0
      src/packages/mobile/assets/icons/statement.svg
  32. BIN
      src/packages/mobile/assets/icons/wareorder.png
  33. 0 0
      src/packages/mobile/assets/icons/wareorder.svg
  34. BIN
      src/packages/mobile/assets/icons/wdrw.png
  35. 0 0
      src/packages/mobile/assets/icons/wdrw.svg
  36. 8 2
      src/packages/mobile/components/layouts/view/index.vue
  37. 11 0
      src/packages/mobile/router/index.ts
  38. 4 4
      src/packages/mobile/views/boot/index.vue
  39. 28 15
      src/packages/mobile/views/contract/details/index.vue
  40. 2 2
      src/packages/mobile/views/contract/list/index.vue
  41. 3 3
      src/packages/mobile/views/credit/signin/index.vue
  42. 15 17
      src/packages/mobile/views/home/components/main/index.vue
  43. 3 3
      src/packages/mobile/views/home/index.vue
  44. 3 4
      src/packages/mobile/views/market/list/components/spot/index.vue
  45. 4 5
      src/packages/mobile/views/mine/address/index.vue
  46. 4 5
      src/packages/mobile/views/mine/invoice/index.vue
  47. 8 9
      src/packages/mobile/views/mine/main/index.vue
  48. 8 8
      src/packages/mobile/views/mine/order/detail/transfer/index.vue
  49. 21 11
      src/packages/mobile/views/news/details/index.less
  50. 75 25
      src/packages/mobile/views/news/details/index.vue
  51. 1 2
      src/packages/mobile/views/news/list/index.vue
  52. 3 3
      src/packages/mobile/views/product/detail/index.vue
  53. 2 2
      src/packages/mobile/views/product/list/index.vue
  54. 6 2
      src/packages/mobile/views/purchase/detail/index.vue
  55. 2 2
      src/packages/mobile/views/purchase/list/index.vue
  56. 41 0
      src/packages/mobile/views/share/news/index.less
  57. 69 0
      src/packages/mobile/views/share/news/index.vue
  58. 3 3
      src/packages/mobile/views/supply-demand/detail/index.vue
  59. 2 2
      src/packages/mobile/views/supply-demand/list/index.vue
  60. 2 7
      src/packages/mobile/views/user/login/index.vue
  61. 2 2
      src/packages/pc/components/layouts/header/index.vue
  62. 25 29
      src/packages/pc/views/member/index.vue
  63. 12 27
      src/packages/pc/views/profit/index.vue
  64. 12 11
      src/packages/pc/views/promotion/components/details/index.vue
  65. 13 8
      src/packages/pc/views/promotion/index.vue
  66. 13 27
      src/packages/pc/views/ratio/components/history/index.vue
  67. 6 19
      src/packages/pc/views/ratio/index.vue
  68. 13 8
      src/packages/pc/views/tradedata/index.vue
  69. 7 3
      src/services/api/bank/index.ts
  70. 5 0
      src/services/api/common/index.ts
  71. 14 0
      src/services/api/news/index.ts
  72. 4 0
      src/services/api/user/index.ts
  73. 3 3
      src/services/http/index.ts
  74. 7 8
      src/services/index.ts
  75. 1 1
      src/types/model/bank.d.ts
  76. 2 2
      src/types/model/common.d.ts
  77. 59 2
      src/types/model/news.d.ts
  78. 1 1
      src/types/model/user.d.ts
  79. 144 31
      src/utils/h5plus/index.ts

+ 8 - 97
src/business/bank/index.ts

@@ -1,99 +1,12 @@
 import { reactive, shallowRef, computed } from 'vue'
-import { useDataTable } from '@/hooks/datatable'
 import { loginStore, userStore } from '@/stores'
-import { t2bBankWithdraw, queryBankAccountSign, t2bBankDeposit, queryAccountInOutApply, queryCusBankSignBank, t2bBankSign, t2bBankCancelSign, accountFundInfoReq } from '@/services/api/bank'
+import { t2bBankWithdraw, queryBankAccountSign, t2bBankDeposit, queryCusBankSignBank, t2bBankSign, t2bBankCancelSign, accountFundInfoReq } from '@/services/api/bank'
 import { SignStatus } from '@/constants/bank'
 import { decryptAES } from '@/utils/websocket/crypto'
 import moment from "moment"
 
 const { userId, firstAccountId } = loginStore.$mapGetters()
 
-
-// 获取出入金流水列表
-export function useAccouuntInOutApplyListList() {
-    const { dataList, total, pageIndex, pageSize, pageCount } = useDataTable<Model.AccountOutInApplyRsp>()
-    const loading = shallowRef(false)
-
-    const getAccouuntInOutApplyList = async () => {
-        try {
-            loading.value = true
-            const res = await queryAccountInOutApply({
-                userid: userId.value
-            })
-            total.value = res.total
-            dataList.value = res.data
-        } finally {
-            loading.value = false
-        }
-    }
-
-    return {
-        loading,
-        dataList,
-        total,
-        pageIndex,
-        pageSize,
-        pageCount,
-        getAccouuntInOutApplyList
-    }
-}
-
-// 查询可签约的托管银行列表
-export function getCusBankSignBankList() {
-    const { dataList, total, pageIndex, pageSize, pageCount } = useDataTable<Model.CusBankSignBankRsp>()
-    const loading = shallowRef(false)
-
-    const getCusBankSignBankList = async () => {
-        try {
-            loading.value = true
-            const res = await queryCusBankSignBank()
-            total.value = res.total
-            dataList.value = res.data
-        } finally {
-            loading.value = false
-        }
-    }
-
-    return {
-        loading,
-        dataList,
-        total,
-        pageIndex,
-        pageSize,
-        pageCount,
-        getCusBankSignBankList
-    }
-}
-
-// 查询当前已经签约信息列表
-export function useBankAccountSign() {
-    const { dataList } = useDataTable<Model.BankAccountSignRsp>()
-    const loading = shallowRef(false)
-
-    const getBankAccountList = async () => {
-        try {
-            loading.value = true
-            const res = await queryBankAccountSign({
-                userid: userId.value
-            })
-            dataList.value = res.data
-        } finally {
-            loading.value = false
-        }
-    }
-
-    const bankInfo = computed(() => {
-        return dataList.value[0]
-    })
-
-    return {
-        loading,
-        dataList,
-        bankInfo,
-        getBankAccountList
-    }
-}
-
 // 提现请求
 export function useDoWithdraw() {
     const loading = shallowRef(false)
@@ -205,9 +118,9 @@ export function useDoDeposit() {
 
 /// 银行签约请求
 export function useDoBankSign() {
-
-    const loading = shallowRef(false)
     const { userInfo } = userStore.$mapGetters()
+    const loading = shallowRef(false)
+    const bankInfo = shallowRef<Model.BankAccountSignRsp>()
 
     /// 托管银行信息
     const cusSignBank = shallowRef<Model.CusBankSignBankRsp>()
@@ -227,9 +140,9 @@ export function useDoBankSign() {
         return (cusSignBank.value?.Banklst ?? []).filter(e => e.status == 0)
     })
 
-    const { getBankAccountList, bankInfo } = useBankAccountSign()
     /// 判断是否有签约信息 有就做修改
-    getBankAccountList().then(() => {
+    queryBankAccountSign().then((res) => {
+        bankInfo.value = res.data[0]
         if (bankInfo.value) {
             ({
                 currency: formData.Currency,
@@ -257,8 +170,6 @@ export function useDoBankSign() {
         BankAccountName: userInfo.value?.customername,
     })
 
-    console.log(formData)
-
     const onSubmit = async () => {
         await request
         loading.value = true
@@ -290,10 +201,9 @@ export function useDoBankSign() {
 
 /// 银行解约请求
 export function useDoCancelBankSign() {
-    const { getBankAccountList, bankInfo } = useBankAccountSign()
-
     /// 获取UserId
     const loading = shallowRef(false)
+    const bankInfo = shallowRef<Model.BankAccountSignRsp>()
 
     /// 表单信息
     const formData = reactive<Partial<Proto.t2bBankCancelSignReq>>({
@@ -303,7 +213,8 @@ export function useDoCancelBankSign() {
     const sign = shallowRef<Model.BankAccountSignRsp[]>([])
 
     const formRefresh = () => {
-        getBankAccountList().then(() => {
+        queryBankAccountSign().then((res) => {
+            bankInfo.value = res.data[0];
             ({
                 currency: formData.Currency,
                 cusbankid: formData.CusBankID,

+ 0 - 38
src/business/contract/index.ts

@@ -1,38 +0,0 @@
-import { shallowRef, reactive } from 'vue'
-import { EchartsDataset } from '@/hooks/echarts/line/interface'
-import { queryTHJPurchaseTransferDetail } from '@/services/api/contract'
-
-// 合同转让详情
-export function useContractDetails(wrstandardid: number) {
-    const loading = shallowRef(false)
-    const details = shallowRef<Partial<Model.THJPurchaseTransferDetailRsp>>({})
-
-    // 图表数据
-    const chartData = reactive<EchartsDataset['line']['source']>({
-        price: [],
-        date: []
-    })
-
-    const getContractDetails = async () => {
-        try {
-            loading.value = true
-            const res = await queryTHJPurchaseTransferDetail({
-                wrstandardid,
-            })
-            details.value = res.data
-            res.data.spotgoodspricelogs.forEach(({ spotgoodsprice, tradedate }) => {
-                chartData.price.push(spotgoodsprice)
-                chartData.date.push(tradedate)
-            })
-        } finally {
-            loading.value = false
-        }
-    }
-
-    return {
-        loading,
-        details,
-        chartData,
-        getContractDetails,
-    }
-}

+ 1 - 56
src/business/market/index.ts

@@ -1,62 +1,7 @@
-import { shallowRef, computed } from 'vue'
-import { useDataTable } from '@/hooks/datatable'
-import { querySpotGoodsPrice, querySpotgoodsPrice } from '@/services/api/market'
+import { computed } from 'vue'
 import { futuresStore } from '@/stores'
 import subscribe from '@/services/subscribe'
 
-// 现货行情
-export function useSpotGoodsPrice() {
-    const { dataList, total, pageIndex, pageSize, pageCount } = useDataTable<Model.SpotGoodsPriceRsp>()
-    const loading = shallowRef(false)
-
-    const getSpotGoodsPrice = async () => {
-        try {
-            loading.value = true
-            const res = await querySpotGoodsPrice({
-                page: pageIndex.value,
-                pagesize: pageSize.value,
-            })
-            total.value = res.total
-            dataList.value = res.data
-        } finally {
-            loading.value = false
-        }
-    }
-
-    return {
-        loading,
-        dataList,
-        total,
-        pageIndex,
-        pageSize,
-        pageCount,
-        getSpotGoodsPrice,
-    }
-}
-
-// 现货行情列表
-export function useSpotGoodsPriceList() {
-    const { dataList, pageCount } = useDataTable<Model.SpotgoodsPriceRsp>()
-    const loading = shallowRef(false)
-
-    const getSpotGoodsPriceList = async () => {
-        try {
-            loading.value = true
-            const res = await querySpotgoodsPrice()
-            dataList.value = res.data
-        } finally {
-            loading.value = false
-        }
-    }
-
-    return {
-        loading,
-        dataList,
-        pageCount,
-        getSpotGoodsPriceList,
-    }
-}
-
 // 期货行情列表
 export function useFuturesList() {
     const dataList = computed(() => futuresStore.getters.quoteList.filter((e) => e.marketid === 99201))

+ 0 - 27
src/business/order/index.ts

@@ -1,27 +0,0 @@
-import { shallowRef } from 'vue'
-import { queryTHJPurchaseTransferOrderDetail } from '@/services/api/order'
-
-// 查询我的订单-转让/受让订单详情
-export function useQueryTTHJPurchaseTransferOrderDetail(transferid: string) {
-    const details = shallowRef<Model.THJPurchaseTransferOrderDetailRsp>()
-    const loading = shallowRef(false)
-
-    const getTHJPurchaseTransferOrderDetail = () => {
-        loading.value = true
-        queryTHJPurchaseTransferOrderDetail({
-            transferid,
-        }).then((res) => {
-            if (res.data.length) {
-                details.value = res.data[0]
-            }
-        }).finally(() => {
-            loading.value = false
-        })
-    }
-
-    return {
-        loading,
-        details,
-        getTHJPurchaseTransferOrderDetail,
-    }
-}

+ 2 - 1
src/business/trade/index.ts

@@ -30,7 +30,8 @@ export function usePurchaseOrderDesting() {
         UserID: userId.value, // 用户ID,必填
         AccountID: firstAccountId.value, // 资金账号,必填
         ClientType: ClientType.Web, // 终端类型
-        UpdatorID: loginId.value // 操作人,必填
+        UpdatorID: loginId.value, // 操作人,必填
+        Qty: 5,
     })
 
     const formSubmit = () => {

+ 1 - 34
src/business/user/account.ts

@@ -1,43 +1,10 @@
 import { shallowRef, reactive } from 'vue'
 import { loginStore } from '@/stores'
-import { useDataTable } from '@/hooks/datatable'
-import { investorDel, modifyPassword, queryWrDraftUserInfo, requestAddAuth } from '@/services/api/account'
+import { investorDel, modifyPassword, requestAddAuth } from '@/services/api/account'
 import cryptojs from 'crypto-js'
 
 const { loginId, userId, firstAccountId } = loginStore.$mapGetters()
 
-// 查询用户实名认证信息
-export function getWrDraftUserInfo(userstatus?: number) {
-    const { dataList } = useDataTable<Model.UserInfo>()
-    const loading = shallowRef(false)
-
-    const formData = reactive<Model.WrDraftUserInfoReq>({
-        userstatus: userstatus,
-        userid: userId.value
-    })
-
-    const getWrDraftUserInfoList = async () => {
-        try {
-            loading.value = true
-            const { userstatus, userid } = formData
-            const res = await queryWrDraftUserInfo({
-                userid: userid,
-                userstatus: userstatus
-            })
-            dataList.value = res.data
-        } finally {
-            loading.value = false
-        }
-    }
-
-    return {
-        loading,
-        formData,
-        dataList,
-        getWrDraftUserInfoList
-    }
-}
-
 // 用户实名认证
 export function addAuthReq() {
     const loading = shallowRef(false)

+ 1 - 31
src/business/user/address.ts

@@ -1,39 +1,9 @@
 import { shallowRef, reactive, computed } from 'vue'
-import { useDataTable } from '@/hooks/datatable'
 import { loginStore } from '@/stores'
-import { queryUserReceiveInfo, userReceiveInfo, delUserReceiveInfo, userReceiveIsDefault } from '@/services/api/user'
+import { userReceiveInfo, delUserReceiveInfo, userReceiveIsDefault } from '@/services/api/user'
 
 const { userId } = loginStore.$mapGetters()
 
-export function useAddress() {
-    const { dataList, total, pageIndex, pageSize } = useDataTable<Model.UserReceiveInfoRsp>()
-    const loading = shallowRef(false)
-    const columns = shallowRef([])
-
-    const getUserAddressList = async () => {
-        try {
-            loading.value = true
-            const res = await queryUserReceiveInfo({
-                userid: userId.value,
-            })
-            total.value = res.total
-            dataList.value = res.data
-        } finally {
-            loading.value = false
-        }
-    }
-
-    return {
-        loading,
-        dataList,
-        columns,
-        total,
-        pageIndex,
-        pageSize,
-        getUserAddressList,
-    }
-}
-
 export function useAddressForm(selectedRow?: Model.UserReceiveInfoRsp) {
     const loading = shallowRef(false)
 

+ 2 - 2
src/business/user/index.ts

@@ -1,3 +1,3 @@
 export { useAccountCancellation, useAccountPassword, addAuthReq } from './account'
-export { useAddress, useAddressForm } from './address'
-export { useInvoice, useInvoiceForm } from './invoice'
+export { useAddressForm } from './address'
+export { useInvoiceForm } from './invoice'

+ 1 - 31
src/business/user/invoice.ts

@@ -1,40 +1,10 @@
 import { shallowRef, reactive } from 'vue'
-import { useDataTable } from '@/hooks/datatable'
-import { queryWrUserReceiptInfo, userReceiptInfo, delUserReceiptInfo } from '@/services/api/user'
+import { userReceiptInfo, delUserReceiptInfo } from '@/services/api/user'
 import { loginStore } from '@/stores'
 import { getCertificateTypeList } from '@/constants/certificate'
 
 const { userId } = loginStore.$mapGetters()
 
-export function useInvoice() {
-    const { dataList, total, pageIndex, pageSize } = useDataTable<Model.WrUserReceiptInfoRsp>()
-    const loading = shallowRef(false)
-    const columns = shallowRef([])
-
-    const getUserInvoiceList = async () => {
-        try {
-            loading.value = true
-            const res = await queryWrUserReceiptInfo({
-                userid: userId.value,
-            })
-            total.value = res.total
-            dataList.value = res.data
-        } finally {
-            loading.value = false
-        }
-    }
-
-    return {
-        loading,
-        dataList,
-        columns,
-        total,
-        pageIndex,
-        pageSize,
-        getUserInvoiceList,
-    }
-}
-
 export function useInvoiceForm(selectedRow?: Model.WrUserReceiptInfoRsp) {
     const loading = shallowRef(false)
     const certificateTypeList = getCertificateTypeList()

+ 32 - 5
src/filters/index.ts

@@ -14,18 +14,27 @@ export function getUrl(url: string, base?: string) {
 }
 
 /**
- * 获取图片地址
- * @param fileUrl 
+ * 获取文件链接地址
+ * @param filePath 
  */
-export function getImageUrl(fileUrl?: string) {
-    if (fileUrl) {
-        const url = getUrl(fileUrl)
+export function getFileUrl(filePath?: string) {
+    if (filePath) {
+        const url = getUrl(filePath)
         return url.href
     }
     return ''
 }
 
 /**
+ * 获取资讯分享链接
+ * @param filePath 
+ */
+export function getNewsShareUrl(id: number | string = 0) {
+    const { shareUrl } = service.config
+    return shareUrl + '/#/share/news?id=' + id
+}
+
+/**
  * 格式化html字符串
  * @param text 
  * @returns 
@@ -40,6 +49,24 @@ export function formatHtmlString(text: string) {
 }
 
 /**
+ * 获取html中的图片链接
+ * @param text 
+ * @returns 
+ */
+export function getImageSrc(text?: string) {
+    const images = text?.match(/<img.*?>/g)
+    const urls = images?.reduce((res, img) => {
+        const src = img.match(/\ssrc=['"](.*?)['"]/)
+        if (src) {
+            const url = getUrl(src[1])
+            res.push(url.href)
+        }
+        return res
+    }, [] as string[])
+    return urls ?? []
+}
+
+/**
  * 处理价格颜色的显示
  */
 export function handlePriceColor(curValue: number, preValue: number) {

+ 6 - 2
src/hooks/navigation/index.ts

@@ -91,8 +91,12 @@ export function useNavigation() {
     }
 
     // 路由跳转
-    const routerTo = (to: string) => {
-        router.push({ name: to })
+    const routerTo = (name: string, replace = false) => {
+        if (replace) {
+            router.replace({ name })
+        } else {
+            router.push({ name })
+        }
     }
 
     // 导航守卫

BIN
src/packages/mobile/assets/icons/ccwl.png


Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
src/packages/mobile/assets/icons/ccwl.svg


BIN
src/packages/mobile/assets/icons/cpjg.png


Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
src/packages/mobile/assets/icons/cpjg.svg


BIN
src/packages/mobile/assets/icons/cpjs.png


+ 1 - 0
src/packages/mobile/assets/icons/cpjs.svg

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 204.49 205.39"><defs><style>.cls-1,.cls-2,.cls-3{fill-rule:evenodd;}.cls-1{fill:url(#未命名的渐变_2);}.cls-2{opacity:0.5;fill:url(#未命名的渐变_5);}.cls-2,.cls-3{isolation:isolate;}.cls-3,.cls-4{fill:#fff;}.cls-3{opacity:0.2;}.cls-5{fill:#c30d23;}</style><linearGradient id="未命名的渐变_2" x1="-948.92" y1="1698.32" x2="-948.31" y2="1699.33" gradientTransform="matrix(174.47, 0, 0, -174.47, 165599.73, 296506.15)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#c30d23"/><stop offset="1" stop-color="#dd364a"/></linearGradient><linearGradient id="未命名的渐变_5" x1="131.37" y1="115.54" x2="177.6" y2="174.65" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#ffc6cd"/><stop offset="1" stop-color="#e83a4f"/></linearGradient></defs><title>1-产品介绍</title><g id="图层_2" data-name="图层 2"><g id="图层_1-2" data-name="图层 1"><path class="cls-1" d="M102.24,0c137.31,6.2,135.34,200.13,0,205.39C-35.07,199.19-33.09,5.26,102.24,0Z"/><path class="cls-2" d="M110,204.86C34.91,173.61,47.38,51.24,143.18,47.6c24,1.1,42.66,9.34,56.06,21.59C217.65,125.73,187.49,197.43,110,204.86Z"/><path class="cls-3" d="M.15,108.59C-2.09,65.72,20.91,21.49,68.66,5.83,79.64,49,56.45,100.76.15,108.59Z"/><path class="cls-4" d="M145,43.73A66.72,66.72,0,0,0,37.76,109.6c2.59,12.15,1.3,30.1-2,45.2a7,7,0,0,0,6.82,8.65c.08,0,1.43-.22,1.43-.22,15.63-3.11,35.1-5.24,44.87-2.39A50.49,50.49,0,0,0,103,162.35,66.72,66.72,0,0,0,145,43.73Zm-35.29,73H74.54a5.27,5.27,0,1,1,0-10.53h35.12a5.27,5.27,0,1,1,0,10.53ZM130.73,88.6H74.54a5.27,5.27,0,0,1,0-10.54h56.19a5.27,5.27,0,1,1,0,10.54Z"/><path class="cls-5" d="M114.93,111.43a5.26,5.26,0,0,1-5.27,5.26H74.54a5.27,5.27,0,1,1,0-10.53h35.12A5.27,5.27,0,0,1,114.93,111.43Z"/><path class="cls-5" d="M136,83.33a5.27,5.27,0,0,1-5.27,5.27H74.54a5.27,5.27,0,0,1,0-10.54h56.19A5.27,5.27,0,0,1,136,83.33Z"/></g></g></svg>

BIN
src/packages/mobile/assets/icons/generalize.png


Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
src/packages/mobile/assets/icons/generalize.svg


BIN
src/packages/mobile/assets/icons/htzr.png


+ 1 - 0
src/packages/mobile/assets/icons/htzr.svg

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 204.49 205.39"><defs><style>.cls-1,.cls-2,.cls-3{fill-rule:evenodd;}.cls-1{fill:url(#未命名的渐变_2);}.cls-2{opacity:0.5;fill:url(#未命名的渐变_5);}.cls-2,.cls-3{isolation:isolate;}.cls-3,.cls-4{fill:#fff;}.cls-3{opacity:0.2;}</style><linearGradient id="未命名的渐变_2" x1="-1233.09" y1="1692.07" x2="-1232.49" y2="1693.08" gradientTransform="matrix(174.47, 0, 0, -174.47, 215179.21, 295416.49)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#c30d23"/><stop offset="1" stop-color="#dd364a"/></linearGradient><linearGradient id="未命名的渐变_5" x1="131.37" y1="115.54" x2="177.6" y2="174.65" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#ffc6cd"/><stop offset="1" stop-color="#e83a4f"/></linearGradient></defs><title>1-合同转让</title><g id="图层_2" data-name="图层 2"><g id="图层_1-2" data-name="图层 1"><path class="cls-1" d="M102.24,0c137.31,6.2,135.34,200.13,0,205.39C-35.07,199.19-33.09,5.26,102.24,0Z"/><path class="cls-2" d="M110,204.86C34.91,173.61,47.38,51.24,143.18,47.6c24,1.1,42.66,9.34,56.06,21.59C217.65,125.73,187.49,197.43,110,204.86Z"/><path class="cls-3" d="M.15,108.59C-2.09,65.72,20.91,21.49,68.66,5.83,79.64,49,56.45,100.76.15,108.59Z"/><rect class="cls-4" x="66.42" y="42.99" width="71.65" height="119.41" rx="13.32"/><path class="cls-4" d="M160.11,62.28h0A10.41,10.41,0,0,0,149.7,72.69V135a10.41,10.41,0,0,0,10.41,10.41h0A10.41,10.41,0,0,0,170.52,135V72.69A10.41,10.41,0,0,0,160.11,62.28Z"/><path class="cls-4" d="M44.37,62.28A10.41,10.41,0,0,0,34,72.69V135a10.41,10.41,0,0,0,20.82,0V72.69A10.41,10.41,0,0,0,44.37,62.28Z"/></g></g></svg>

BIN
src/packages/mobile/assets/icons/order.png


Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
src/packages/mobile/assets/icons/order.svg


BIN
src/packages/mobile/assets/icons/ptgz.png


Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
src/packages/mobile/assets/icons/ptgz.svg


BIN
src/packages/mobile/assets/icons/red-envelope.png


Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
src/packages/mobile/assets/icons/red-envelope.svg


BIN
src/packages/mobile/assets/icons/schedule.png


Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
src/packages/mobile/assets/icons/schedule.svg


BIN
src/packages/mobile/assets/icons/statement.png


Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
src/packages/mobile/assets/icons/statement.svg


BIN
src/packages/mobile/assets/icons/wareorder.png


Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
src/packages/mobile/assets/icons/wareorder.svg


BIN
src/packages/mobile/assets/icons/wdrw.png


Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
src/packages/mobile/assets/icons/wdrw.svg


+ 8 - 2
src/packages/mobile/components/layouts/view/index.vue

@@ -1,5 +1,5 @@
 <template>
-    <div class="app-view">
+    <div ref="viewRef" class="app-view">
         <template v-if="showLoading">
             <slot name="loading">
                 <Loading class="app-view__loading" color="#0094ff" />
@@ -16,7 +16,7 @@
 </template>
 
 <script lang="ts" setup>
-import { shallowRef, computed, watch, nextTick } from 'vue'
+import { shallowRef, computed, watch, nextTick, onMounted } from 'vue'
 import { Loading } from 'vant'
 
 const props = defineProps({
@@ -36,6 +36,8 @@ const props = defineProps({
     },
 })
 
+const emit = defineEmits(['ready'])
+const viewRef = shallowRef()
 const showAnimation = shallowRef(true)
 const showLoading = computed(() => {
     return props.loading ? showAnimation.value : false
@@ -45,6 +47,10 @@ nextTick(() => {
     showAnimation.value = props.animation
 })
 
+onMounted(() => {
+    emit('ready', viewRef.value)
+})
+
 watch(() => props.animation, (status) => {
     if (!status) {
         showAnimation.value = false

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

@@ -485,6 +485,17 @@ const routes: Array<RouteRecordRaw> = [
       },
     ],
   },
+  {
+    path: "/share",
+    component: Page,
+    children: [
+      {
+        path: "news",
+        name: "ShareNews",
+        component: () => import("../views/share/news/index.vue"),
+      },
+    ],
+  },
 ];
 
 const router = animateRouter.create({

+ 4 - 4
src/packages/mobile/views/boot/index.vue

@@ -65,11 +65,11 @@ const skip = (promise: Promise<void>) => {
     } else {
       router.replace({ name: 'Home' })
     }
-  }).catch(() => {
+  }).catch((err) => {
     if (service.isReady) {
       router.replace({ name: 'Home' })
     } else {
-      tryInit()
+      tryInit(err)
     }
   }).finally(() => {
     toast?.close()
@@ -77,9 +77,9 @@ const skip = (promise: Promise<void>) => {
 }
 
 // 初始化失败重试
-const tryInit = () => {
+const tryInit = (message: string) => {
   dialog({
-    message: '加载失败,请稍后再试',
+    message,
     showCancelButton: plus.hasPlus(),
     cancelButtonText: '退出',
     confirmButtonText: '重试'

+ 28 - 15
src/packages/mobile/views/contract/details/index.vue

@@ -57,12 +57,13 @@
 </template>
 
 <script lang="ts" setup>
-import { shallowRef, computed, defineAsyncComponent } from 'vue'
+import { shallowRef, reactive, computed, defineAsyncComponent } from 'vue'
 import { CellGroup, Button, Field, Form, FormInstance, showSuccessToast, showFailToast, Divider } from 'vant'
 import { fullloading, dialog } from '@/utils/vant'
-import { getImageUrl, formatDate, parsePercent } from '@/filters'
+import { getFileUrl, formatDate, parsePercent } from '@/filters'
 import { useNavigation } from '@/hooks/navigation'
-import { useContractDetails } from '@/business/contract'
+import { useRequest } from '@/hooks/request'
+import { queryTHJPurchaseTransferDetail } from '@/services/api/contract'
 import { useSpotPresaleTransferDesting } from '@/business/trade'
 import AppSelect from '@mobile/components/base/select/index.vue'
 import AppList from '@mobile/components/base/list/index.vue'
@@ -73,12 +74,14 @@ const componentMap = new Map<string, unknown>([
 ])
 
 const { router, getQueryStringToNumber } = useNavigation()
-
-const wrstandardid = getQueryStringToNumber('wrstandardid')
+const { formData, destingSubmit } = useSpotPresaleTransferDesting()
 const formRef = shallowRef<FormInstance>()
 
-const { loading, details, chartData, getContractDetails } = useContractDetails(wrstandardid)
-const { formData, destingSubmit } = useSpotPresaleTransferDesting()
+// 图表数据
+const chartData = reactive<{ price: number[]; date: string[]; }>({
+    price: [],
+    date: []
+})
 
 const columns: Model.TableColumn[] = [
     { prop: 'transferprice', label: '转让价格' },
@@ -86,22 +89,34 @@ const columns: Model.TableColumn[] = [
     { prop: 'operate', label: '操作' },
 ]
 
+const { loading, data: details } = useRequest(queryTHJPurchaseTransferDetail, {
+    params: {
+        wrstandardid: getQueryStringToNumber('wrstandardid')
+    },
+    onSuccess: (res) => {
+        res.data.spotgoodspricelogs.forEach(({ spotgoodsprice, tradedate }) => {
+            chartData.price.push(spotgoodsprice)
+            chartData.date.push(tradedate)
+        })
+    }
+})
+
 // 当前选中的交割月份
 const selectedMonth = shallowRef('')
 // 当前选中的定金比例
 const selectedRate = shallowRef(0)
 // 商品信息
-const goodsinfo = computed<Partial<Model.THJPurchaseTransferDetailRsp['goodsinfo']>>(() => details.value.goodsinfo ?? {})
+const goodsinfo = computed(() => details.value?.goodsinfo)
 
 // 商品图片列表
 const goodsImages = computed(() => {
-    const pictureurls = goodsinfo.value.pictureurls ?? ''
-    return pictureurls.split(',').map((path) => getImageUrl(path))
+    const pictureurls = goodsinfo.value?.pictureurls ?? ''
+    return pictureurls.split(',').map((path) => getFileUrl(path))
 })
 
 // 交割月份列表
 const deliveryMonths = computed(() => {
-    const list = details.value.deliverydate ?? []
+    const list = details.value?.deliverydate ?? []
     const monthMap = new Map<string, { label: string, value: string; }>()
     // 日期去重
     list.forEach(({ enddate, endmonth }) => {
@@ -117,7 +132,7 @@ const deliveryMonths = computed(() => {
 
 // 定金比例列表
 const depositRates = computed(() => {
-    const list = details.value.deliverydate ?? []
+    const list = details.value?.deliverydate ?? []
     const rateMap = new Map<number, { label: string, value: number; }>()
     // 比例去重
     list.forEach(({ enddate, depositrate }) => {
@@ -135,7 +150,7 @@ const depositRates = computed(() => {
 
 // 表格数据
 const tableList = computed(() => {
-    const list = details.value.deliverydate ?? []
+    const list = details.value?.deliverydate ?? []
     return list.filter((e) => e.enddate === selectedMonth.value && e.depositrate === selectedRate.value).sort((a, b) => a.transferprice - b.transferprice)
 })
 
@@ -155,8 +170,6 @@ const onSubmit = (item: Model.THJPurchaseTransferDetailRsp['deliverydate'][numbe
         })
     })
 }
-
-getContractDetails()
 </script>
 
 <style lang="less">

+ 2 - 2
src/packages/mobile/views/contract/list/index.vue

@@ -28,7 +28,7 @@
 <script lang="ts" setup>
 import { shallowRef, onActivated } from 'vue'
 import { Search, Button } from 'vant'
-import { getImageUrl } from '@/filters'
+import { getFileUrl } from '@/filters'
 import { useRequest } from '@/hooks/request'
 import { queryTHJPurchaseTransfer } from '@/services/api/contract'
 import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
@@ -56,7 +56,7 @@ const { loading, pageIndex, pageCount, run } = useRequest(queryTHJPurchaseTransf
 
 // 获取产品首图
 const getFirstImage = (url: string) => {
-    const images = url.split(',').map((path) => getImageUrl(path))
+    const images = url.split(',').map((path) => getFileUrl(path))
     return images[0] ?? ''
 }
 

+ 3 - 3
src/packages/mobile/views/credit/signin/index.vue

@@ -17,16 +17,16 @@
                 <div class="iconbar">
                     <ul>
                         <li @click="userSignin">
-                            <img src="@mobile/assets/icons/schedule.png" />
+                            <img src="@mobile/assets/icons/schedule.svg" />
                             <span v-if="userAccount.issigned">已签到</span>
                             <span v-else>签到</span>
                         </li>
                         <li>
-                            <img src="@mobile/assets/icons/red-envelope.png" @click="routerTo('credit-lottery')" />
+                            <img src="@mobile/assets/icons/red-envelope.svg" @click="routerTo('credit-lottery')" />
                             <span>积分红包</span>
                         </li>
                         <li>
-                            <img src="@mobile/assets/icons/statement.png" @click="routerTo('credit-statement')" />
+                            <img src="@mobile/assets/icons/statement.svg" @click="routerTo('credit-statement')" />
                             <span>积分流水</span>
                         </li>
                     </ul>

+ 15 - 17
src/packages/mobile/views/home/components/main/index.vue

@@ -7,7 +7,7 @@
       <div class="home-main__banner home-main__banner--header">
         <Swipe :autoplay="5000" indicator-color="white" lazy-render>
           <SwipeItem v-for="(item, index) in topBanners" :key="index">
-            <img :src="getImageUrl(item.imagepath)" />
+            <img :src="getFileUrl(item.imagepath)" />
           </SwipeItem>
         </Swipe>
       </div>
@@ -16,29 +16,29 @@
       <app-block class="home-main__iconbar bg">
         <ul>
           <li @click="routerTo('product')">
-            <img src="@mobile/assets/icons/cpjs.png" />
+            <img src="@mobile/assets/icons/cpjs.svg" />
             <span>产品介绍</span>
           </li>
           <li @click="routerTo('Market')">
-            <img src="@mobile/assets/icons/cpjg.png" />
+            <img src="@mobile/assets/icons/cpjg.svg" />
             <span>产品价格</span>
           </li>
           <li @click="routerTo('NavigationPTGZ')">
-            <img src="@mobile/assets/icons/ptgz.png" />
+            <img src="@mobile/assets/icons/ptgz.svg" />
             <span>平台规则</span>
           </li>
         </ul>
         <ul>
           <li @click="routerTo('credit-signin')">
-            <img src="@mobile/assets/icons/wdrw.png" />
+            <img src="@mobile/assets/icons/wdrw.svg" />
             <span>我的任务</span>
           </li>
           <li @click="routerTo('contract')">
-            <img src="@mobile/assets/icons/htzr.png" />
+            <img src="@mobile/assets/icons/htzr.svg" />
             <span>合同转让</span>
           </li>
           <li @click="routerTo('rules-ccwl')">
-            <img src="@mobile/assets/icons/ccwl.png" />
+            <img src="@mobile/assets/icons/ccwl.svg" />
             <span>仓储物流</span>
           </li>
         </ul>
@@ -96,7 +96,7 @@
       <app-block class="home-main__banner home-main__banner--body" v-if="false">
         <Swipe :autoplay="5000" indicator-color="white" lazy-render>
           <SwipeItem v-for="(item, index) in bodyBanners" :key="index">
-            <img :src="getImageUrl(item.imagepath)" />
+            <img :src="getFileUrl(item.imagepath)" />
           </SwipeItem>
         </Swipe>
       </app-block>
@@ -111,10 +111,8 @@
           </Cell>
           <template v-for="(item, index) in newsList" :key="index">
             <Cell class="article-item" title-class="article-item__title" value-class="article-item__time"
-              :title="item.title" :value="formatDate(item.creaedate, 'MM/DD')" :to="{
-                name: 'news-details',
-                params: { item: JSON.stringify(item) },
-              }" />
+              :title="item.title" :value="formatDate(item.creaedate, 'MM/DD')"
+              :to="{ name: 'news-details', query: { id: item.id } }" />
           </template>
         </CellGroup>
       </app-block>
@@ -125,10 +123,10 @@
 <script lang="ts" setup>
 import { shallowRef, computed } from "vue";
 import { Cell, CellGroup, Swipe, SwipeItem, PullRefresh } from "vant";
-import { formatDecimal, getImageUrl, formatDate, handlePriceColor, parsePercent, handleNumberValue, changeUnit } from "@/filters";
+import { formatDecimal, getFileUrl, formatDate, handlePriceColor, parsePercent, handleNumberValue, changeUnit } from "@/filters";
 import { useNavigation } from "@/hooks/navigation";
 import { queryImageConfigs } from "@/services/api/common";
-import { querySiteColumnDetail } from "@/services/api/news";
+import { queryNewTitles } from "@/services/api/news";
 import { useFuturesList } from "@/business/market";
 import { queryMarketRun } from "@/services/api/goods";
 import { queryThjSpotQuoteConfig } from "@/services/api/market";
@@ -138,7 +136,7 @@ const { dataList } = useFuturesList();
 const refreshing = shallowRef(false); // 是否处于加载中状态
 const topBanners = shallowRef<Model.ImageConfigsRsp[]>([]); // 轮播图列表
 const bodyBanners = shallowRef<Model.ImageConfigsRsp[]>([]); // 轮播图列表
-const newsList = shallowRef<Model.SiteColumnDetailRsp[]>([]); // 资讯列表
+const newsList = shallowRef<Model.NewTitlesRsp[]>([]); // 资讯列表
 const spotQuoteList = shallowRef<Model.ThjSpotQuoteConfigRsp[]>([]); // 现货行情
 const spotQuoteIndex = shallowRef(0) // 当前现货行情索引
 const marketRun = shallowRef<Partial<Model.MarketRunRsp>>({}); // 市场
@@ -151,7 +149,7 @@ const openNewsDetails = (id: number) => {
   if (id) {
     const details = newsList.value.find((e) => e.id === id)
     if (details) {
-      router.push({ name: 'news-details', params: { item: JSON.stringify(details) } })
+      router.push({ name: 'news-details', query: { id: details.id } })
     }
   }
 }
@@ -168,7 +166,7 @@ const onRefresh = () => {
     spotQuoteList.value = res.data
   })
   // 市场资讯
-  querySiteColumnDetail({
+  queryNewTitles({
     page: 1,
     pagesize: 10,
   }).then((res) => {

+ 3 - 3
src/packages/mobile/views/home/index.vue

@@ -81,8 +81,8 @@ onActivated(() => {
   }
 })
 
-// 获取当前应用版本号
-plus.getVersionCode((currentVersionCode) => {
+if (plus.getSystemInfo('os') === 'Android') {
+  const currentVersionCode = plus.getSystemInfo('versionCode')
   // 获取应用更新信息
   GetAppUpdateInfo().then((res) => {
     const data = JSON.parse(res)
@@ -99,7 +99,7 @@ plus.getVersionCode((currentVersionCode) => {
       }
     }
   })
-})
+}
 </script>
 
 <style lang="less">

+ 3 - 4
src/packages/mobile/views/market/list/components/spot/index.vue

@@ -7,10 +7,11 @@
 
 <script lang="ts" setup>
 import { Empty } from 'vant'
-import { useSpotGoodsPriceList } from '@/business/market'
+import { useRequest } from '@/hooks/request'
+import { querySpotgoodsPrice } from '@/services/api/market'
 import AppList from '@mobile/components/base/list/index.vue'
 
-const { dataList, getSpotGoodsPriceList } = useSpotGoodsPriceList()
+const { dataList } = useRequest(querySpotgoodsPrice)
 
 const columns: Model.TableColumn[] = [
     { prop: 'wrstandardname', label: '名称' },
@@ -18,6 +19,4 @@ const columns: Model.TableColumn[] = [
     { prop: 'spotgoodsqty', label: '招标量' },
     { prop: 'tradedate', label: '日期' },
 ]
-
-getSpotGoodsPriceList()
 </script>

+ 4 - 5
src/packages/mobile/views/mine/address/index.vue

@@ -41,7 +41,8 @@
 import { shallowRef, defineAsyncComponent, PropType } from 'vue'
 import { RadioGroup, Radio, Button, Tag, Empty } from 'vant'
 import { useComponent } from '@/hooks/component'
-import { useAddress } from '@/business/user'
+import { useRequest } from '@/hooks/request'
+import { queryUserReceiveInfo } from '@/services/api/user'
 
 const componentMap = new Map<string, unknown>([
     ['edit', defineAsyncComponent(() => import('./components/edit/index.vue'))],
@@ -59,8 +60,8 @@ const props = defineProps({
 })
 
 const emit = defineEmits(['change'])
-const { dataList, getUserAddressList } = useAddress()
-const { componentRef, componentId, openComponent, closeComponent } = useComponent(getUserAddressList)
+const { dataList, run } = useRequest(queryUserReceiveInfo)
+const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => run())
 const checkedRow = shallowRef(props.checked)
 const selectedRow = shallowRef()
 
@@ -74,8 +75,6 @@ const onEdit = (item?: Model.UserReceiveInfoRsp) => {
     selectedRow.value = item
     openComponent('edit')
 }
-
-getUserAddressList()
 </script>
 
 <style lang="less">

+ 4 - 5
src/packages/mobile/views/mine/invoice/index.vue

@@ -38,7 +38,8 @@ import { shallowRef, defineAsyncComponent, PropType } from 'vue'
 import { RadioGroup, Radio, Button, Tag, Empty } from 'vant'
 import { getReceiptTypeName } from '@/constants/receipt'
 import { useComponent } from '@/hooks/component'
-import { useInvoice } from '@/business/user'
+import { useRequest } from '@/hooks/request'
+import { queryWrUserReceiptInfo } from '@/services/api/user'
 
 const componentMap = new Map<string, unknown>([
     ['edit', defineAsyncComponent(() => import('./components/edit/index.vue'))],
@@ -56,8 +57,8 @@ const props = defineProps({
 })
 
 const emit = defineEmits(['change'])
-const { dataList, getUserInvoiceList } = useInvoice()
-const { componentRef, componentId, openComponent, closeComponent } = useComponent(getUserInvoiceList)
+const { dataList, run } = useRequest(queryWrUserReceiptInfo)
+const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => run())
 const checkedRow = shallowRef(props.checked)
 const selectedRow = shallowRef()
 
@@ -71,8 +72,6 @@ const onEdit = (item?: Model.WrUserReceiptInfoRsp) => {
     selectedRow.value = item
     openComponent('edit')
 }
-
-getUserInvoiceList()
 </script>
 
 <style lang="less">

+ 8 - 9
src/packages/mobile/views/mine/main/index.vue

@@ -51,15 +51,15 @@
     <app-block class="mine-iconbar">
       <ul>
         <li @click="showQRCode = true">
-          <img src="@mobile/assets/icons/generalize.png" />
+          <img src="@mobile/assets/icons/generalize.svg" />
           <span>注册编码</span>
         </li>
         <li @click="routerTo('my-order')">
-          <img src="@mobile/assets/icons/order.png" />
+          <img src="@mobile/assets/icons/order.svg" />
           <span>我的订单</span>
         </li>
         <li @click="routerTo('my-wareorder')">
-          <img src="@mobile/assets/icons/wareorder.png" />
+          <img src="@mobile/assets/icons/wareorder.svg" />
           <span>我的仓单</span>
         </li>
       </ul>
@@ -120,11 +120,11 @@
 import { shallowRef, onActivated, computed } from 'vue'
 import { Cell, CellGroup, Button, Tag, showFailToast } from 'vant'
 import { fullloading, dialog } from '@/utils/vant'
-import { getImageUrl } from '@/filters'
+import { getFileUrl } from '@/filters'
 import { useNavigation } from '@/hooks/navigation'
 import { loginStore, accountStore, userStore } from '@/stores'
 import AppIconfont from '@mobile/components/base/iconfont/index.vue'
-import { useBankAccountSign } from '@/business/bank'
+import { queryBankAccountSign } from '@/services/api/bank'
 import { queryUserAccount } from '@/services/api/account'
 import { AuthStatus, getAuthStatusName } from '@/constants/account'
 import eventBus from '@/services/bus'
@@ -133,7 +133,6 @@ import AppRegisterCode from '@mobile/components/modules/register-code/index.vue'
 const { router, routerTo } = useNavigation()
 const { userId, loginId, firstAccountId } = loginStore.$mapGetters()
 const { userInfo } = userStore.$mapGetters()
-const { getBankAccountList, bankInfo } = useBankAccountSign()
 const { accountInfo, freezeMargin, avaiableMoney } = accountStore.$mapGetters()
 
 const authStatus = shallowRef(AuthStatus.Uncertified) // 实名认证状态
@@ -144,7 +143,7 @@ const showQRCode = shallowRef(false)
 // 用户头像
 const userAvatar = computed(() => {
   const file = userInfo.value?.headurl
-  return file ? getImageUrl(file) : ''
+  return file ? getFileUrl(file) : ''
 })
 
 const onReady = (el: HTMLDivElement) => {
@@ -156,9 +155,9 @@ const onReady = (el: HTMLDivElement) => {
 const doInOutMoney = (tab: string) => {
   if (authStatus.value === AuthStatus.Certified) {
     fullloading((hideLoading) => {
-      getBankAccountList().then(() => {
+      queryBankAccountSign().then((res) => {
         hideLoading()
-        const { signstatus } = bankInfo.value ?? {}
+        const { signstatus } = res.data[0] ?? {}
         /// 只有已签约的情况下才可以进行出入金
         if (signstatus && signstatus === 4) {
           router.push({ name: 'bank-wallet', query: { tab } })

+ 8 - 8
src/packages/mobile/views/mine/order/detail/transfer/index.vue

@@ -46,17 +46,20 @@ import { useNavigation } from '@/hooks/navigation'
 import { fullloading, dialog } from '@/utils/vant'
 import { CellGroup, Cell, Empty, Button, showFailToast } from 'vant'
 import { getUrl } from '@/filters'
+import { getTHJTransferStatusName, getTHJDeliveryModeName } from '@/constants/order'
+import { useRequest } from '@/hooks/request'
+import { queryTHJPurchaseTransferOrderDetail } from '@/services/api/order'
 import { useSpotPresaleTransferCancel } from "@/business/trade"
-import { useQueryTTHJPurchaseTransferOrderDetail } from "@/business/order"
 import { handleNumberValue, parsePercent, formatDate } from '@/filters'
-import { getTHJTransferStatusName, getTHJDeliveryModeName } from "@/constants/order"
 import plus from '@/utils/h5plus'
 
 const { router, getQueryString } = useNavigation()
-const transferid = getQueryString('id')
-
-const { getTHJPurchaseTransferOrderDetail, details } = useQueryTTHJPurchaseTransferOrderDetail(transferid)
 const { transferCancelSubmit } = useSpotPresaleTransferCancel()
+const { data: details } = useRequest(queryTHJPurchaseTransferOrderDetail, {
+    params: {
+        transferid: getQueryString('id')
+    }
+})
 
 // 打开pdf文件
 const openPDF = (file?: string) => {
@@ -83,7 +86,4 @@ const spotCancelSubmit = () => {
         })
     })
 }
-
-/// 查询数据
-getTHJPurchaseTransferOrderDetail()
 </script>

+ 21 - 11
src/packages/mobile/views/news/details/index.less

@@ -1,31 +1,41 @@
 @import '@mobile/assets/themes/base/mixin.less';
 
-.new-details {
+.news-details {
     background-color: #fff;
 
+    &__share {
+        display: flex;
+        align-items: center;
+        height: 100%;
+        padding: 0 .28rem;
+    }
+
     &__container {
         padding: .32rem;
 
         >h1 {
-            font-size  : .35rem;
+            font-size: .35rem;
             font-weight: bold;
         }
 
         >h4 {
+            display: flex;
+            align-items: center;
+            gap: .12rem;
             font-size: .24rem;
-            color    : #999;
-            padding  : .32rem 0;
+            color: #999;
+            padding: .32rem 0;
 
-            span {
-                &:first-child {
-                    color       : dodgerblue;
-                    margin-right: .12rem;
-                }
+            img {
+                width: .48rem;
+                height: .48rem;
+                border-radius: 50%;
+                font-size: 0;
             }
         }
 
         >p {
-            font-size  : .28rem;
+            font-size: .28rem;
             line-height: .48rem;
 
             img {
@@ -43,7 +53,7 @@
             }
 
             &__time {
-                flex       : initial;
+                flex: initial;
                 margin-left: .48rem;
             }
         }

+ 75 - 25
src/packages/mobile/views/news/details/index.vue

@@ -1,23 +1,31 @@
 <template>
-    <app-view class="new-details">
+    <app-view class="news-details">
         <template #header>
-            <app-navbar title="资讯详情" />
+            <app-navbar title="资讯详情">
+                <template #right>
+                    <div class="news-details__share" :data-clipboard-text="getNewsShareUrl(newsId)" round v-copy="onCopy">
+                        <Icon name="share" size=".32rem" />
+                    </div>
+                </template>
+            </app-navbar>
         </template>
-        <section class="new-details__container" v-if="details">
-            <h1>{{ details.title }}</h1>
+        <section class="news-details__container" v-if="data">
+            <h1>{{ data.title }}</h1>
             <h4>
-                <span>{{ details.author }}</span>
-                <span>{{ details.creaedate }}</span>
+                <img :src="getFileUrl(data.srclogo)" v-if="data.srclogo" />
+                <span @click="openUrl(data?.srcurl)" style="color:dodgerblue" v-if="data.srcname">{{ data.srcname }}</span>
+                <span>{{ formatDate(data.creaedate, 'YYYY-MM-DD') }}</span>
+                <span style="margin-left: auto;">阅览数:{{ data.hits }}</span>
             </h4>
-            <p v-html="formatHtmlString(details.context)"></p>
+            <p ref="htmlRef" v-html="formatHtmlString(data.context)"></p>
+            <p style="color: #999;margin-top: .24rem;font-size: .24rem;" v-if="data.author">作者:{{ data.author }}</p>
         </section>
         <Divider>热门资讯</Divider>
-        <CellGroup class="new-details__list">
+        <CellGroup class="news-details__list">
             <template v-for="(item, index) in dataList" :key="index">
                 <Cell class="article-item" title-class="article-item__title" value-class="article-item__time"
                     :title="item.title" :value="formatDate(item.creaedate, 'MM/DD')"
-                    :to="{ name: 'news-details', query: { t: new Date().getTime() }, params: { item: JSON.stringify(item), columnid } }"
-                    replace />
+                    :to="{ name: 'news-details', query: { id: item.id, t: new Date().getTime() } }" replace />
             </template>
         </CellGroup>
     </app-view>
@@ -25,30 +33,72 @@
 
 <script lang="ts" setup>
 import { shallowRef } from 'vue'
-import { CellGroup, Cell, Divider } from 'vant'
-import { formatDate } from '@/filters'
+import { CellGroup, Cell, Divider, showImagePreview, showFailToast, showToast, Icon } from 'vant'
+import { formatDate, formatHtmlString, getImageSrc, getFileUrl, getNewsShareUrl } from '@/filters'
 import { useNavigation } from '@/hooks/navigation'
 import { useRequest } from '@/hooks/request'
-import { formatHtmlString } from '@/filters'
-import { querySiteColumnDetail } from '@/services/api/news'
+import { queryNewTitles, queryNewContents } from '@/services/api/news'
+import plus from '@/utils/h5plus'
 
-const { route } = useNavigation()
-const { item, columnid } = route.params
-const details = shallowRef<Model.SiteColumnDetailRsp>()
+const { getQueryString } = useNavigation()
+const htmlRef = shallowRef<HTMLElement>()
+const newsId = getQueryString('id')
 
-if (item) {
-    details.value = JSON.parse(item.toString())
-}
-
-const { dataList } = useRequest(querySiteColumnDetail, {
+const { dataList, run } = useRequest(queryNewTitles, {
+    manual: true,
     params: {
         pagesize: 10,
-        columnid: columnid ? Number(columnid) : undefined,
     },
-    onFinally: () => {
-        dataList.value = dataList.value.filter((e) => e.id !== details.value?.id)
+    onSuccess: (res) => {
+        dataList.value = res.data.filter((e) => e.id.toString() !== newsId)
     }
 })
+
+const { data } = useRequest(queryNewContents, {
+    params: {
+        ids: newsId
+    },
+    onSuccess: (res) => {
+        if (res.data.length) {
+            const details = res.data[0]
+            data.value = details
+
+            setTimeout(() => {
+                const el = htmlRef.value
+                el?.querySelectorAll('img').forEach((e, i) => {
+                    e.onclick = () => {
+                        showImagePreview({
+                            images: getImageSrc(details.context),
+                            startPosition: i,
+                        })
+                    }
+                })
+            }, 500);
+
+            run({ columnid: details.columnid })
+        } else {
+            run()
+        }
+    }
+})
+
+// 跳转链接
+const openUrl = (url?: string) => {
+    if (url) {
+        plus.openURL(url)
+    }
+}
+
+const onCopy = (status: boolean) => {
+    if (status) {
+        showToast({
+            message: '已复制,快去粘贴吧~',
+            position: 'bottom',
+        })
+    } else {
+        showFailToast('复制失败')
+    }
+}
 </script>
 
 <style lang="less">

+ 1 - 2
src/packages/mobile/views/news/list/index.vue

@@ -13,8 +13,7 @@
       <Empty v-if="!dataList.length" />
       <template v-for="(item, index) in dataList" :key="index">
         <Cell class="article-item" title-class="article-item__title" value-class="article-item__time" :title="item.title"
-          :value="formatDate(item.creaedate, 'MM/DD')"
-          :to="{ name: 'news-details', params: { item: JSON.stringify(item), columnid: currentColumnId } }" />
+          :value="formatDate(item.creaedate, 'MM/DD')" :to="{ name: 'news-details', query: { id: item.id } }" />
       </template>
     </app-pull-refresh>
   </app-view>

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

@@ -35,7 +35,7 @@
 import { defineAsyncComponent, computed } from 'vue'
 import { useNavigation } from '@/hooks/navigation'
 import { Swipe, SwipeItem } from 'vant'
-import { getImageUrl } from "@/filters";
+import { getFileUrl } from "@/filters";
 import { useWrstandardDetails } from '@/business/goods'
 import { getGoodsUnitName } from '@/constants/unit'
 
@@ -54,13 +54,13 @@ const goodsinfo = computed<Partial<Model.THJWrstandardDetailRsp['goodsinfo']>>((
 // 商品图片列表
 const goodsImages = computed(() => {
     const pictureurls = goodsinfo.value.pictureurls ?? ''
-    return pictureurls.split(',').map((path) => getImageUrl(path))
+    return pictureurls.split(',').map((path) => getFileUrl(path))
 })
 
 // 商品banner
 const topBanners = computed(() => {
     const bannerpicurls = goodsinfo.value.bannerpicurl ?? ''
-    return bannerpicurls.split(',').map((path) => getImageUrl(path))
+    return bannerpicurls.split(',').map((path) => getFileUrl(path))
 })
 
 /// 收藏

+ 2 - 2
src/packages/mobile/views/product/list/index.vue

@@ -24,7 +24,7 @@
 <script lang="ts" setup>
 import { shallowRef } from 'vue'
 import { Button } from 'vant'
-import { getImageUrl } from '@/filters'
+import { getFileUrl } from '@/filters'
 import { useRequest } from '@/hooks/request'
 import { queryTHJProduct } from '@/services/api/goods'
 import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
@@ -51,7 +51,7 @@ const { loading, pageIndex, pageCount, run } = useRequest(queryTHJProduct, {
 
 // 获取产品首图
 const getFirstImage = (url: string) => {
-  const images = url.split(',').map((path) => getImageUrl(path))
+  const images = url.split(',').map((path) => getFileUrl(path))
   return images[0] ?? ''
 }
 </script>

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

@@ -93,7 +93,7 @@
 import { shallowRef, computed, defineAsyncComponent } from 'vue'
 import { CellGroup, Button, Field, Form, FormInstance, showSuccessToast, showFailToast, FieldRule } from 'vant'
 import { fullloading, dialog } from '@/utils/vant'
-import { getImageUrl, parsePercent } from '@/filters'
+import { getFileUrl, parsePercent } from '@/filters'
 import { getGoodsUnitName } from '@/constants/unit'
 import { useComponent } from '@/hooks/component'
 import { useNavigation } from '@/hooks/navigation'
@@ -126,7 +126,7 @@ const goodsinfo = computed<Partial<Model.THJWrstandardDetailRsp['goodsinfo']>>((
 // 商品图片列表
 const goodsImages = computed(() => {
     const pictureurls = goodsinfo.value.pictureurls ?? ''
-    return pictureurls.split(',').map((path) => getImageUrl(path))
+    return pictureurls.split(',').map((path) => getFileUrl(path))
 })
 
 // 定金比例列表,商品定金比例和个性化定金比例进行合并
@@ -251,7 +251,11 @@ const onDepositChange = (value: number, index: number) => {
     formData.value.DepositType = item.type
     formData.value.DepositRate = item.value
     formRef.value?.validate('DepositID')
+
     if (formData.value.Qty) {
+        if (formData.value.Qty > maxQty.value) {
+            formData.value.Qty = maxQty.value
+        }
         formRef.value?.validate('Qty')
     }
 }

+ 2 - 2
src/packages/mobile/views/purchase/list/index.vue

@@ -28,7 +28,7 @@
 <script lang="ts" setup>
 import { shallowRef, onActivated } from 'vue'
 import { Search, Button } from 'vant'
-import { getImageUrl } from '@/filters'
+import { getFileUrl } from '@/filters'
 import { useRequest } from '@/hooks/request'
 import { queryTHJWrstandard } from '@/services/api/goods'
 import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
@@ -60,7 +60,7 @@ const onRefresh = () => {
 
 // 获取商品首图
 const getFirstImage = (url: string) => {
-  const images = url.split(',').map((path) => getImageUrl(path))
+  const images = url.split(',').map((path) => getFileUrl(path))
   return images[0] ?? ''
 }
 

+ 41 - 0
src/packages/mobile/views/share/news/index.less

@@ -0,0 +1,41 @@
+.share-news {
+    background-color: #fff;
+
+    &__container {
+        padding: .32rem;
+
+        >h1 {
+            font-size: .35rem;
+            font-weight: bold;
+        }
+
+        >h4 {
+            display: flex;
+            align-items: center;
+            gap: .12rem;
+            font-size: .24rem;
+            color: #999;
+            padding: .32rem 0;
+
+            img {
+                width: .48rem;
+                height: .48rem;
+                border-radius: 50%;
+                font-size: 0;
+            }
+        }
+
+        >p {
+            font-size: .28rem;
+            line-height: .48rem;
+
+            img {
+                max-width: 100%;
+            }
+        }
+    }
+
+    &__footer {
+        padding: .32rem;
+    }
+}

+ 69 - 0
src/packages/mobile/views/share/news/index.vue

@@ -0,0 +1,69 @@
+<template>
+    <app-view class="share-news">
+        <template #header>
+            <app-navbar title="铁合金掌上行" :show-back-button="false" />
+        </template>
+        <section class="share-news__container" v-if="data">
+            <h1>{{ data.title }}</h1>
+            <h4>
+                <img :src="getFileUrl(data.srclogo)" v-if="data.srclogo" />
+                <span @click="openUrl(data?.srcurl)" style="color:dodgerblue" v-if="data.srcname">{{ data.srcname }}</span>
+                <span>{{ formatDate(data.creaedate, 'YYYY-MM-DD') }}</span>
+                <span style="margin-left: auto;">阅览数:{{ data.hits }}</span>
+            </h4>
+            <p ref="htmlRef" v-html="formatHtmlString(data.context)"></p>
+            <p style="color: #999;margin-top: .24rem;font-size: .24rem;" v-if="data.author">作者:{{ data.author }}</p>
+        </section>
+        <div class="share-news__footer">
+            <Button type="primary" round block @click="router.replace({ name: 'Home' })">进入首页</Button>
+        </div>
+    </app-view>
+</template>
+
+<script lang="ts" setup>
+import { shallowRef } from 'vue'
+import { Button, showImagePreview, } from 'vant'
+import { formatDate, formatHtmlString, getImageSrc, getFileUrl } from '@/filters'
+import { useNavigation } from '@/hooks/navigation'
+import { useRequest } from '@/hooks/request'
+import { queryNewContents } from '@/services/api/news'
+import plus from '@/utils/h5plus'
+
+const { router, getQueryString } = useNavigation()
+const htmlRef = shallowRef<HTMLElement>()
+
+const { data } = useRequest(queryNewContents, {
+    params: {
+        ids: getQueryString('id')
+    },
+    onSuccess: (res) => {
+        if (res.data.length) {
+            const details = res.data[0]
+            data.value = details
+
+            setTimeout(() => {
+                const el = htmlRef.value
+                el?.querySelectorAll('img').forEach((e, i) => {
+                    e.onclick = () => {
+                        showImagePreview({
+                            images: getImageSrc(details.context),
+                            startPosition: i,
+                        })
+                    }
+                })
+            }, 500);
+        }
+    }
+})
+
+// 跳转链接
+const openUrl = (url?: string) => {
+    if (url) {
+        plus.openURL(url)
+    }
+}
+</script>
+
+<style lang="less">
+@import './index.less';
+</style>

+ 3 - 3
src/packages/mobile/views/supply-demand/detail/index.vue

@@ -90,7 +90,7 @@
 <script lang="ts" setup>
 import { shallowRef, computed, defineAsyncComponent, onUnmounted } from 'vue'
 import { Cell, Swipe, SwipeItem, Empty, Divider, Button } from 'vant'
-import { getImageUrl } from '@/filters'
+import { getFileUrl } from '@/filters'
 import { useComponent } from '@/hooks/component'
 import { useNavigation } from '@/hooks/navigation'
 import { BuyOrSell } from '@/constants/order'
@@ -125,13 +125,13 @@ const columns: Model.TableColumn[] = [
 // 商品banner
 const topBanners = computed(() => {
     const bannerpicurl = quoteItem.value?.bannerpicurl ?? ''
-    return bannerpicurl?.split(',').map((path) => getImageUrl(path))
+    return bannerpicurl?.split(',').map((path) => getFileUrl(path))
 })
 
 // 商品图片列表
 const goodsImages = computed(() => {
     const pictureurls = quoteItem.value?.pictureurls ?? ''
-    return pictureurls.split(',').map((path) => getImageUrl(path))
+    return pictureurls.split(',').map((path) => getFileUrl(path))
 })
 
 // 挂牌下单

+ 2 - 2
src/packages/mobile/views/supply-demand/list/index.vue

@@ -31,7 +31,7 @@
 <script lang="ts" setup>
 import { shallowRef, onActivated } from 'vue'
 import { Search, Button } from 'vant'
-import { getImageUrl } from '@/filters'
+import { getFileUrl } from '@/filters'
 import { useRequest } from '@/hooks/request'
 import { queryOrderQuote } from '@/services/api/goods'
 import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
@@ -64,7 +64,7 @@ const onRefresh = () => {
 
 // 获取商品首图
 const getFirstImage = (url: string) => {
-  const images = url.split(',').map((path) => getImageUrl(path))
+  const images = url.split(',').map((path) => getFileUrl(path))
   return images[0] ?? ''
 }
 

+ 2 - 7
src/packages/mobile/views/user/login/index.vue

@@ -26,7 +26,7 @@
         <span>、</span>
         <span @click="routerTo('rules-yszc')" style="color:#E92020">《隐私政策》</span>
       </div>
-      <div class="login-footer__version" v-if="appVersion">
+      <div class="login-footer__version" v-if="plus.getSystemInfo('os') !== 'Web'">
         <span>v{{ appVersion }}</span>
       </div>
     </div>
@@ -48,7 +48,7 @@ const { getClientAgent } = themeStore.actions
 const { routerBack, routerTo } = useNavigation()
 const { formData, userLogin } = useLogin()
 const checked = shallowRef(false) // 是否同意协议管理
-const appVersion = shallowRef('') // 应用版本号
+const appVersion = plus.getSystemInfo('version') // 应用版本号
 
 // 导航跳转
 const navigationTo = (name: string) => {
@@ -78,11 +78,6 @@ const formSubmit = () => {
     showToast('请先同意使用条款')
   }
 }
-
-// 获取当前应用版本号
-plus.getVersion((version) => {
-  appVersion.value = version
-})
 </script>
 
 <style lang="less">

+ 2 - 2
src/packages/pc/components/layouts/header/index.vue

@@ -37,7 +37,7 @@
 <script lang="ts" setup>
 import { ref, onMounted, computed } from 'vue'
 import { ArrowRight, SwitchButton } from '@element-plus/icons-vue'
-import { getImageUrl } from '@/filters'
+import { getFileUrl } from '@/filters'
 import { userStore, themeStore } from '@/stores'
 import eventBus from '@/services/bus'
 import AppIcon from '@pc/components/base/icon/index.vue'
@@ -49,7 +49,7 @@ const fullScreen = ref(false)
 // 用户头像
 const userAvatar = computed(() => {
     const file = userInfo.value?.headurl
-    return file ? getImageUrl(file) : ''
+    return file ? getFileUrl(file) : ''
 })
 
 // 全屏

+ 25 - 29
src/packages/pc/views/member/index.vue

@@ -47,7 +47,8 @@
 import { shallowRef, reactive, watch } from 'vue'
 import { ElMessage, ElTree } from 'element-plus'
 import { formatDate } from '@/filters'
-import { useDataTable, useDataFilter } from '@/hooks/datatable'
+import { useRequest } from '@/hooks/request'
+import { useDataFilter } from '@/hooks/datatable'
 import { queryTHJFriends, queryInvestorLevelGroup } from '@/services/api/common'
 import { loginStore, userStore } from '@/stores'
 import { decryptAES } from '@/utils/websocket/crypto'
@@ -63,9 +64,7 @@ interface TreeData {
 
 const { userId } = loginStore.$mapGetters()
 const { accountName } = userStore.$mapGetters()
-const { dataList, total, pageIndex, pageSize } = useDataTable<Model.THJFriendsRsp>()
 const { filterOptons, getQueryParams } = useDataFilter<Model.THJFriendsReq>()
-const loading = shallowRef(false)
 const treeRef = shallowRef<InstanceType<typeof ElTree>>()
 const filterText = shallowRef('')
 const selectedId = shallowRef(userId.value) // 当前选中用户ID
@@ -85,6 +84,24 @@ const tableColumns = shallowRef<Model.TableColumn[]>([
     { prop: 'createtime', label: '开户时间' },
 ])
 
+const { loading, dataList, total, pageIndex, pageSize, run } = useRequest(queryTHJFriends, {
+    params: {
+        pagesize: 20,
+        userid: selectedId.value,
+    },
+    onSuccess: (res) => {
+        if (treeList[0].children?.length === 0) {
+            treeList[0].children = res.data.map((e) => ({
+                label: e.customername,
+                userid: e.frienduserid,
+            }))
+        }
+    },
+    onError: (err) => {
+        ElMessage.error(err)
+    }
+})
+
 filterOptons.selectList = [
     {
         label: '等级',
@@ -130,29 +147,6 @@ const getPhoneNumber = (value: string) => {
     return phoneNumber?.replace(reg, '$1****$2')
 }
 
-const getTHJFriends = async (params: Partial<Model.THJFriendsReq> = {}) => {
-    try {
-        loading.value = true
-        const res = await queryTHJFriends({
-            userid: selectedId.value,
-            page: pageIndex.value,
-            pagesize: pageSize.value,
-            ...params
-        })
-        total.value = res.total
-        dataList.value = res.data
-
-        if (treeList[0].children?.length === 0) {
-            treeList[0].children = res.data.map((e) => ({
-                label: e.customername,
-                userid: e.frienduserid,
-            }))
-        }
-    } finally {
-        loading.value = false
-    }
-}
-
 // 当节点被点击的时候触发
 const onNodeClick = ({ userid }: TreeData) => {
     if (selectedId.value !== userid) {
@@ -172,13 +166,15 @@ const filterNode = (value: string, data: TreeData) => {
 const onSearch = (clear = false) => {
     getQueryParams((qs) => {
         pageIndex.value = 1
-        getTHJFriends(qs)
+        qs.userid = selectedId.value
+        run(qs)
     }, clear)
 }
 
 const onRefresh = () => {
     getQueryParams((qs) => {
-        getTHJFriends(qs).catch((err) => ElMessage.error(err))
+        qs.userid = selectedId.value
+        run(qs)
     })
 }
 
@@ -189,7 +185,7 @@ queryInvestorLevelGroup().then((res) => {
         value: e.levelgroupid
     }))
 })
-onRefresh()
+
 watch(filterText, (val) => {
     treeRef.value?.filter(val)
 })

+ 12 - 27
src/packages/pc/views/profit/index.vue

@@ -22,19 +22,24 @@
 import { shallowRef } from 'vue'
 import { ElMessage } from 'element-plus'
 import { formatDate } from '@/filters'
+import { useRequest } from '@/hooks/request'
 import { getTHJMarketList } from '@/constants/market'
 import { getTHJProfitRoleTypeName } from '@/constants/account'
-import { useDataTable, useDataFilter } from '@/hooks/datatable'
+import { useDataFilter } from '@/hooks/datatable'
 import { queryTHJProfits } from '@/services/api/common'
-import { loginStore } from '@/stores'
 import AppTable from '@pc/components/base/table/index.vue'
 import AppFilter from '@pc/components/base/table-filter/index.vue'
 import AppPagination from '@pc/components/base/pagination/index.vue'
 
-const { userId } = loginStore.$mapGetters()
-const { dataList, total, pageIndex, pageSize } = useDataTable<Model.THJProfitsRsp>()
 const { filterOptons, getQueryParams } = useDataFilter<Model.THJProfitsReq>()
-const loading = shallowRef(false)
+const { loading, dataList, total, pageIndex, pageSize, run } = useRequest(queryTHJProfits, {
+    params: {
+        pagesize: 20,
+    },
+    onError: (err) => {
+        ElMessage.error(err)
+    }
+})
 
 const tableColumns = shallowRef<Model.TableColumn[]>([
     { prop: 'marketname', label: '市场' },
@@ -79,34 +84,14 @@ filterOptons.buttonList = [
     { lable: '查询', className: 'el-button--primary', onClick: () => onSearch() }
 ]
 
-const getTHJProfits = async (params: Partial<Model.THJProfitsReq> = {}) => {
-    try {
-        loading.value = true
-        const res = await queryTHJProfits({
-            userid: userId.value,
-            page: pageIndex.value,
-            pagesize: pageSize.value,
-            ...params,
-        })
-        total.value = res.total
-        dataList.value = res.data
-    } finally {
-        loading.value = false
-    }
-}
-
 const onSearch = (clear = false) => {
     getQueryParams((qs) => {
         pageIndex.value = 1
-        getTHJProfits(qs)
+        run(qs)
     }, clear)
 }
 
 const onRefresh = () => {
-    getQueryParams((qs) => {
-        getTHJProfits(qs).catch((err) => ElMessage.error(err))
-    })
+    getQueryParams((qs) => run(qs))
 }
-
-onRefresh()
 </script>

+ 12 - 11
src/packages/pc/views/promotion/components/details/index.vue

@@ -7,8 +7,7 @@
                 {{ formatDate(value) }}
             </template>
             <template #footer>
-                <app-pagination :total="total" v-model:page-size="pageSize" v-model:page-index="pageIndex"
-                    @change="onRefresh" />
+                <app-pagination :total="total" v-model:page-size="pageSize" v-model:page-index="pageIndex" @change="run" />
             </template>
         </app-table>
     </app-drawer>
@@ -18,7 +17,8 @@
 import { shallowRef, PropType } from 'vue'
 import { ElMessage } from 'element-plus'
 import { formatDate } from '@/filters'
-import { useQueryTHJPromotionIncomeDetail } from '@/business/order'
+import { useRequest } from '@/hooks/request'
+import { queryTHJPromotionIncomeDetail } from '@/services/api/order'
 import AppDrawer from '@pc/components/base/drawer/index.vue'
 import AppTable from '@pc/components/base/table/index.vue'
 import AppPagination from '@pc/components/base/pagination/index.vue'
@@ -30,9 +30,16 @@ const props = defineProps({
     },
 })
 
-const { loading, dataList, total, pageIndex, pageSize, getTHJPromotionIncomeDetail } = useQueryTHJPromotionIncomeDetail(props.selectedRow.profitmonth)
 const show = shallowRef(true)
-pageSize.value = 10
+const { loading, dataList, total, pageIndex, pageSize, run } = useRequest(queryTHJPromotionIncomeDetail, {
+    params: {
+        pagesize: 10,
+        mouth: props.selectedRow.profitmonth,
+    },
+    onError: (err) => {
+        ElMessage.error(err)
+    }
+})
 
 const tableColumns = shallowRef<Model.TableColumn[]>([
     { prop: 'tradetime', label: '时间', width: 180 },
@@ -42,10 +49,4 @@ const tableColumns = shallowRef<Model.TableColumn[]>([
     { prop: 'profitroletype', label: '级别' },
     { prop: 'profitamount', label: '金额' },
 ])
-
-const onRefresh = () => {
-    getTHJPromotionIncomeDetail().catch((err) => ElMessage.error(err))
-}
-
-onRefresh()
 </script>

+ 13 - 8
src/packages/pc/views/promotion/index.vue

@@ -28,14 +28,23 @@ import { shallowRef } from 'vue'
 import { ElMessage } from 'element-plus'
 import { formatDate } from '@/filters'
 import { useDataFilter } from '@/hooks/datatable'
-import { useQueryTHJPromotionIncome } from '@/business/order'
+import { useRequest } from '@/hooks/request'
+import { queryTHJPromotionIncome } from '@/services/api/order'
 import AppTable from '@pc/components/base/table/index.vue'
 import AppFilter from '@pc/components/base/table-filter/index.vue'
 import AppPagination from '@pc/components/base/pagination/index.vue'
 import AppAuthOperation from '@pc/components/modules/auth-operation/index.vue'
 
-const { loading, dataList, total, pageIndex, pageSize, getTHJPromotionIncome } = useQueryTHJPromotionIncome()
 const { filterOptons, getQueryParams } = useDataFilter<Model.THJPromotionIncomeReq>()
+const { loading, dataList, total, pageIndex, pageSize, run } = useRequest(queryTHJPromotionIncome, {
+    params: {
+        pagesize: 20,
+        profitstatus: 1,
+    },
+    onError: (err) => {
+        ElMessage.error(err)
+    }
+})
 
 const tableColumns = shallowRef<Model.TableColumn[]>([
     { prop: 'profitmonth', label: '时间' },
@@ -72,15 +81,11 @@ const handleOperateButtons = (row: Model.THJPromotionIncomeRsp) => {
 const onSearch = (clear = false) => {
     getQueryParams((qs) => {
         pageIndex.value = 1
-        getTHJPromotionIncome(qs.profitstatus)
+        run(qs)
     }, clear)
 }
 
 const onRefresh = () => {
-    getQueryParams((qs) => {
-        getTHJPromotionIncome(qs.profitstatus).catch((err) => ElMessage.error(err))
-    })
+    getQueryParams((qs) => run(qs))
 }
-
-onRefresh()
 </script>

+ 13 - 27
src/packages/pc/views/ratio/components/history/index.vue

@@ -6,8 +6,7 @@
                 {{ formatDate(value) }}
             </template>
             <template #footer>
-                <app-pagination :total="total" v-model:page-size="pageSize" v-model:page-index="pageIndex"
-                    @change="onRefresh" />
+                <app-pagination :total="total" v-model:page-size="pageSize" v-model:page-index="pageIndex" @change="run" />
             </template>
         </app-table>
     </app-drawer>
@@ -17,7 +16,7 @@
 import { shallowRef, PropType } from 'vue'
 import { ElMessage } from 'element-plus'
 import { formatDate } from '@/filters'
-import { useDataTable } from '@/hooks/datatable'
+import { useRequest } from '@/hooks/request'
 import { queryTHJInvesotrDepositLog } from '@/services/api/common'
 import AppDrawer from '@pc/components/base/drawer/index.vue'
 import AppTable from '@pc/components/base/table/index.vue'
@@ -30,9 +29,18 @@ const props = defineProps({
     },
 })
 
-const { dataList, total, pageIndex, pageSize } = useDataTable<Model.THJInvesotrDepositLogRsp>({ pageSize: 10 })
+const { loading, dataList, total, pageIndex, pageSize, run } = useRequest(queryTHJInvesotrDepositLog, {
+    params: {
+        pagesize: 10,
+        userid: props.selectedRow.userid,
+        depositrate: props.selectedRow.depositrate,
+    },
+    onError: (err) => {
+        ElMessage.error(err)
+    }
+})
+
 const show = shallowRef(true)
-const loading = shallowRef(false)
 
 const tableColumns = shallowRef<Model.TableColumn[]>([
     { prop: 'updatetime', label: '变更时间', width: 180 },
@@ -42,26 +50,4 @@ const tableColumns = shallowRef<Model.TableColumn[]>([
     { prop: 'accountname', label: '采购人' },
     { prop: 'wrtradedetailid', label: '采购单号', width: 200 },
 ])
-
-const getTHJInvesotrDepositLog = async () => {
-    try {
-        loading.value = true
-        const res = await queryTHJInvesotrDepositLog({
-            userid: props.selectedRow.userid,
-            depositrate: props.selectedRow.depositrate,
-            page: pageIndex.value,
-            pagesize: pageSize.value,
-        })
-        total.value = res.total
-        dataList.value = res.data
-    } finally {
-        loading.value = false
-    }
-}
-
-const onRefresh = () => {
-    getTHJInvesotrDepositLog().catch((err) => ElMessage.error(err))
-}
-
-onRefresh()
 </script>

+ 6 - 19
src/packages/pc/views/ratio/index.vue

@@ -19,33 +19,20 @@
 import { shallowRef } from 'vue'
 import { ElMessage } from 'element-plus'
 import { parsePercent } from '@/filters'
-import { useDataTable } from '@/hooks/datatable'
+import { useRequest } from '@/hooks/request'
 import { queryMyDeposit } from '@/services/api/common'
-import { loginStore } from '@/stores'
 import AppTable from '@pc/components/base/table/index.vue'
 import AppAuthOperation from '@pc/components/modules/auth-operation/index.vue'
 
-const { userId } = loginStore.$mapGetters()
-const { dataList } = useDataTable<Model.MyDepositRsp>()
-const loading = shallowRef(false)
+const { loading, dataList } = useRequest(queryMyDeposit, {
+    onError: (err) => {
+        ElMessage.error(err)
+    }
+})
 
 const tableColumns = shallowRef<Model.TableColumn[]>([
     { prop: 'depositrate', label: '比例' },
     { prop: 'depositqty', label: '剩余量' },
     { prop: 'operate', label: '操作', width: 160, fixed: 'right' }
 ])
-
-const getMyDeposit = async () => {
-    try {
-        loading.value = true
-        const res = await queryMyDeposit({
-            userid: userId.value,
-        })
-        dataList.value = res.data
-    } finally {
-        loading.value = false
-    }
-}
-
-getMyDeposit().catch((err) => ElMessage.error(err))
 </script>

+ 13 - 8
src/packages/pc/views/tradedata/index.vue

@@ -36,13 +36,22 @@ import { ElMessage } from 'element-plus'
 import { formatDate } from '@/filters'
 import { Market, getTHJMarketList, getTHJMarketName } from '@/constants/market'
 import { useDataFilter } from '@/hooks/datatable'
-import { useQueryTHJTradeDataList } from '@/business/goods'
+import { useRequest } from '@/hooks/request'
+import { queryTHJTradeData } from '@/services/api/goods'
 import AppTable from '@pc/components/base/table/index.vue'
 import AppFilter from '@pc/components/base/table-filter/index.vue'
 import AppPagination from '@pc/components/base/pagination/index.vue'
 
-const { loading, dataList, total, pageIndex, pageSize, getQueryTHJTradeDataList } = useQueryTHJTradeDataList()
 const { filterOptons, getQueryParams } = useDataFilter<Model.THJTradeDataReq>()
+const { loading, dataList, total, pageIndex, pageSize, run } = useRequest(queryTHJTradeData, {
+    params: {
+        pagesize: 20,
+        marketid: Market.THJ,
+    },
+    onError: (err) => {
+        ElMessage.error(err)
+    }
+})
 
 const tableColumns = shallowRef<Model.TableColumn[]>([
     { prop: 'reckondate', label: '日期' },
@@ -70,15 +79,11 @@ filterOptons.buttonList = [
 const onSearch = (clear = false) => {
     getQueryParams((qs) => {
         pageIndex.value = 1
-        getQueryTHJTradeDataList(qs.marketid)
+        run(qs)
     }, clear)
 }
 
 const onRefresh = () => {
-    getQueryParams((qs) => {
-        getQueryTHJTradeDataList(qs.marketid).catch((err) => ElMessage.error(err))
-    })
+    getQueryParams((qs) => run(qs))
 }
-
-onRefresh()
 </script>

+ 7 - 3
src/services/api/bank/index.ts

@@ -3,7 +3,7 @@ import { tradeServerRequest } from '@/services/socket/trade'
 import { TradeParams } from '@/services/socket/trade/interface'
 import { loginStore } from '@/stores'
 
-const { firstAccountId } = loginStore.$mapGetters()
+const { userId, firstAccountId } = loginStore.$mapGetters()
 
 /**
  * 账户资金信息请求
@@ -57,8 +57,12 @@ export function queryBankInfo() {
 /**
  * 查询签约银行信息(提现账户管理)
  */
-export function queryBankAccountSign(params: Model.BankAccountSignReq) {
-    return httpRequest<Model.BankAccountSignRsp[]>('/Qhj/QueryBankAccountSign', 'get', params);
+export function queryBankAccountSign(params?: Model.BankAccountSignReq) {
+    const payload = {
+        userid: userId.value,
+        ...params
+    }
+    return httpRequest<Model.BankAccountSignRsp[]>('/Qhj/QueryBankAccountSign', 'get', payload);
 }
 
 /**

+ 5 - 0
src/services/api/common/index.ts

@@ -1,4 +1,7 @@
 import { httpRequest, commonRequest, getServiceUrl } from '@/services/http'
+import { loginStore } from '@/stores'
+
+const { userId } = loginStore.$mapGetters()
 
 /**
  * 获取应用配置信息
@@ -110,6 +113,7 @@ export function queryTHJFriends(params: Model.THJFriendsReq) {
  * 查询收益
  */
 export function queryTHJProfits(params: Model.THJProfitsReq) {
+    params.userid = userId.value
     return httpRequest<Model.THJProfitsRsp[]>('/Ferroalloy/QueryTHJProfits', 'get', params);
 }
 
@@ -117,6 +121,7 @@ export function queryTHJProfits(params: Model.THJProfitsReq) {
  * 查询本人定金比例
  */
 export function queryMyDeposit(params: Partial<Model.MyDepositReq>) {
+    params.userid = userId.value
     return httpRequest<Model.MyDepositRsp[]>('/Ferroalloy/QueryMyDeposit', 'get', params);
 }
 

+ 14 - 0
src/services/api/news/index.ts

@@ -12,4 +12,18 @@ export function querySiteColumnDetail(params: Model.SiteColumnDetailReq) {
  */
 export function querySiteColumnConfig(params?: Model.SiteColumnConfigReq) {
     return httpRequest<Model.SiteColumnConfigRsp[]>('/WrTrade2/QuerySiteColumnConfig', 'get', params);
+}
+
+/**
+ * 取资讯标题列表
+ */
+export function queryNewTitles(params: Model.NewTitlesReq) {
+    return httpRequest<Model.NewTitlesRsp[]>('/Common/QueryNewTitles', 'get', params);
+}
+
+/**
+ * 获取资讯内容
+ */
+export function queryNewContents(params: Model.NewContentsReq) {
+    return httpRequest<Model.NewContentsRsp[]>('/Common/QueryNewContents', 'get', params);
 }

+ 4 - 0
src/services/api/user/index.ts

@@ -1,11 +1,15 @@
 import { httpRequest } from '@/services/http'
 import { tradeServerRequest } from '@/services/socket/trade'
 import { TradeParams } from '@/services/socket/trade/interface'
+import { loginStore } from '@/stores'
+
+const { userId } = loginStore.$mapGetters()
 
 /**
  * 查询收货地址信息
  */
 export function queryUserReceiveInfo(params: Model.UserReceiveInfoReq) {
+    params.userid = userId.value
     return httpRequest<Model.UserReceiveInfoRsp[]>('/Qhj/QueryUserReceiveInfo', 'get', params);
 }
 

+ 3 - 3
src/services/http/index.ts

@@ -68,7 +68,7 @@ axiosInstance.interceptors.response.use(
  * @param errMsg 
  * @returns 
  */
-export async function commonRequest<T>(url: string, method: Method, payload?: unknown, errMsg?: string) {
+export async function commonRequest<T>(url: string, method: Method = 'get', payload?: unknown, errMsg?: string) {
     await service.onReady().then((config) => {
         axiosInstance.defaults.baseURL = config.goCommonSearchUrl
     })
@@ -99,7 +99,7 @@ export async function commonRequest<T>(url: string, method: Method, payload?: un
  * @param errMsg 
  * @returns 
  */
-export async function httpRequest<T>(url: string, method: Method, payload?: unknown, errMsg?: string) {
+export async function httpRequest<T>(url: string, method: Method = 'get', payload?: unknown, errMsg?: string) {
     const res = await commonRequest<CommonResult<T>>(url, method, payload, errMsg)
     switch (res.code) {
         case ResultCode.InvalidToken:
@@ -116,6 +116,6 @@ export async function httpRequest<T>(url: string, method: Method, payload?: unkn
  * @param key 
  * @returns 
  */
-export function getServiceUrl(key: keyof typeof service.config) {
+export function getServiceUrl<K extends keyof typeof service.config>(key: K) {
     return service.config[key]
 }

+ 7 - 8
src/services/index.ts

@@ -27,6 +27,7 @@ export default new (class {
         androidUpdateUrl: '',
         pcNewsUrl: '',
         pcMangerUrl: '',
+        shareUrl: '',
     }
 
     /** 服务初始化完成状态 */
@@ -53,14 +54,13 @@ export default new (class {
 
     /**
      * 失败时重新尝试初始化,直到成功为止
-     * @param msg 
      */
-    private tryinit = (msg: string) => {
+    private tryinit = () => {
         return new Promise<typeof this.config>((resolve, reject) => {
-            if (this.retryCount >= 10) {
+            if (this.retryCount >= 5) {
                 this.retryCount = 0
                 this.isPending = false
-                reject(msg)
+                reject('服务加载失败,请稍后再试')
             } else {
                 this.retryCount++
                 // 自动计算每次重试的延时,重试次数越多,延时越大
@@ -78,7 +78,7 @@ export default new (class {
      */
     private init(): Promise<typeof this.config> {
         this.isPending = true
-        return new Promise((resolve) => {
+        return new Promise((resolve, reject) => {
             const filePath = './config/appconfig.json'
             const getAppConfig = async () => {
                 if (plus.hasPlus()) {
@@ -96,12 +96,11 @@ export default new (class {
                     this.isReady = true
                     resolve(this.config)
                 }).catch(() => {
-                    const result = this.tryinit('服务地址加载失败')
+                    const result = this.tryinit()
                     resolve(result)
                 })
             }).catch(() => {
-                const result = this.tryinit('配置文件加载失败')
-                resolve(result)
+                reject('配置文件加载失败,请稍后再试')
             })
         })
     }

+ 1 - 1
src/types/model/bank.d.ts

@@ -48,7 +48,7 @@ declare namespace Model {
 
     /** 查询签约银行信息(提现账户管理) 请求 */
     interface BankAccountSignReq {
-        userid: number;  // 用户ID
+        userid?: number;  // 用户ID
     }
 
     /** 查询签约银行信息(提现账户管理) 响应 */

+ 2 - 2
src/types/model/common.d.ts

@@ -190,7 +190,7 @@ declare global {
 
         /** 查询收益 请求 */
         interface THJProfitsReq {
-            userid: number; // 用户ID
+            userid?: number; // 用户ID
             marketid?: number; // 市场ID
             accountname?: string; // 好友名称,模糊查询
             goods?: string; // 商品代码或商品名称,模糊查询
@@ -219,7 +219,7 @@ declare global {
 
         /** 查询本人定金比例 请求 */
         interface MyDepositReq {
-            userid: number; // 用户ID
+            userid?: number; // 用户ID
         }
 
         /** 查询本人定金比例 响应 */

+ 59 - 2
src/types/model/news.d.ts

@@ -20,8 +20,8 @@ declare namespace Model {
         updatedate: string; // 修改时间
     }
 
-     /** 查询资讯栏目配置 请求 */
-     interface SiteColumnConfigReq {
+    /** 查询资讯栏目配置 请求 */
+    interface SiteColumnConfigReq {
         page?: number; // 页码
         pagesize?: number; // 每页条数
         columntype?: number; // 栏目类型 - 1:行情资讯 10:会员服务 30:关于我们 100:核心企业栏目-百色
@@ -48,4 +48,61 @@ declare namespace Model {
         // 修改时间
         updatedate: string
     }
+
+    /** 取资讯标题列表 请求 */
+    interface NewTitlesReq {
+        page?: number; // 页码
+        pagesize?: number; // 每页条数
+        columnid?: number; // 所属栏目
+    }
+
+    /** 取资讯标题列表 响应 */
+    interface NewTitlesRsp {
+        author: string; // 作者
+        brief: string; // 简介
+        columnid: number; // 所属栏目
+        coverimage: string; // 封面图片
+        creaedate: string; // 创建时间
+        creatorid: number; // 创建人
+        hits: number; // 点击数
+        id: number; // ID(SEQ_SITE_COLUMNDETAIL)
+        isshow: number; // 是否展示 - 0:不展示 1:展示
+        istop: number; // 是否置顶 - 0:不置 1:置顶
+        modifierid: number; // 操作人
+        publishdate: string; // 发布日期
+        status: number; // 状态 - 1:暂存 10:待审核 20:审核通过 30:审核拒绝
+        title: string; // 标题
+        updatedate: string; // 修改时间
+        userid: number; // 用户ID(默认为0, 核心为为机构用户ID)
+    }
+
+    /** 获取资讯内容 请求 */
+    interface NewContentsReq {
+        ids?: string; // 资讯ID列表,格式 1,2,3
+    }
+
+    /** 获取资讯内容 响应 */
+    interface NewContentsRsp {
+        author: string; // 作者
+        brief: string; // 简介
+        columnid: number; // 所属栏目
+        context: string; // 内容
+        coverimage: string; // 封面图片
+        creaedate: string; // 创建时间
+        creatorid: number; // 创建人
+        hits: number; // 点击数
+        id: number; // ID(SEQ_SITE_COLUMNDETAIL)
+        isshow: number; // 是否展示 - 0:不展示 1:展示
+        istop: number; // 是否置顶 - 0:不置 1:置顶
+        modifierid: number; // 操作人
+        publishdate: string; // 发布日期
+        srcid: number; // 来源ID
+        srclogo: string; // 图片地址\来源LOGO
+        srcname: string; // 会员名称\来源名称
+        srcurl: string; // 标签(逗号分隔)\来源网址
+        status: number; // 状态 - 1:暂存 10:待审核 20:审核通过 30:审核拒绝
+        title: string; // 标题
+        updatedate: string; // 修改时间
+        userid: number; // 用户ID(默认为0, 核心为为机构用户ID)
+    }
 }

+ 1 - 1
src/types/model/user.d.ts

@@ -7,7 +7,7 @@ declare namespace Model {
 
     /** 查询收货地址信息 请求 */
     interface UserReceiveInfoReq {
-        userid: number; // 用户ID
+        userid?: number; // 用户ID
     }
 
     /** 查询收货地址信息 响应 */

+ 144 - 31
src/utils/h5plus/index.ts

@@ -1,17 +1,92 @@
 /* eslint-disable */
 
-interface HTML5 extends Window {
-    plus?: any;
+declare global {
+    interface Window {
+        plus: any;
+    }
+}
+
+interface SystemInfo {
+    os: 'Web' | 'Android' | 'iOS'; // 客户端操作系统
+    version: string; // 客户端版本号
+    versionCode: string; // 客户端版本代码
+    statusBarHeight: number; // 状态栏高度
+}
+
+const urlScheme = {
+    appStore: {
+        name: 'App Store',
+        pname: '',
+        scheme: 'itms-apps://'
+    },
+    alipay: {
+        name: '支付宝',
+        pname: 'com.eg.android.AlipayGphone',
+        scheme: 'alipay://'
+    },
+    taobao: {
+        name: '淘宝',
+        pname: 'com.taobao.taobao',
+        scheme: 'taobao://'
+    },
+    qq: {
+        name: 'QQ',
+        pname: 'com.tencent.mobileqq',
+        scheme: 'mqq://'
+    },
+    weixin: {
+        name: '微信',
+        pname: 'com.tencent.mm',
+        scheme: 'weixin://'
+    },
+    jd: {
+        name: '京东',
+        pname: 'com.jingdong.app.mall',
+        scheme: 'openApp.jdMobile://'
+    },
+    weibo: {
+        name: '新浪微博',
+        pname: 'com.sina.weibo',
+        scheme: 'sinaweibo://'
+    },
+    youku: {
+        name: '优酷',
+        pname: 'com.youku.phone',
+        scheme: 'youku://'
+    }
 }
 
 export default new (class {
-    private h5 = new Promise<HTML5>((resolve) => {
-        document.addEventListener('plusready', () => {
-            resolve(window)
-        })
+    private readonly plusready = new Promise<void>((resolve) => {
+        if (this.hasPlus()) {
+            resolve()
+        } else {
+            document.addEventListener('plusready', () => resolve())
+        }
     })
 
+    /**
+     * 系统信息
+     */
+    private systemInfo: SystemInfo = {
+        os: 'Web', // 客户端操作系统
+        version: '1.0', // 客户端版本号
+        versionCode: '100000', // 客户端版本代码
+        statusBarHeight: 0, // 状态栏高度
+    }
+
     constructor() {
+        this.plusready.then(() => {
+            const plus = window.plus
+            this.systemInfo.os = plus.os.name
+            this.systemInfo.statusBarHeight = plus.navigator.getStatusbarHeight()
+
+            plus.runtime.getProperty(plus.runtime.appid, (info: any) => {
+                this.systemInfo.version = info.version
+                this.systemInfo.versionCode = info.versionCode
+            })
+        })
+
         // 监听返回按钮事件
         this.onPlusReady((plus) => {
             let firstBack = true
@@ -39,14 +114,14 @@ export default new (class {
         })
     }
 
-    onPlusReady(callback: (plus: any) => void) {
-        this.h5.then((res) => {
-            callback(res.plus)
-        })
+    hasPlus() {
+        return !!window.plus
     }
 
-    hasPlus() {
-        return Object.prototype.hasOwnProperty.call(window, 'plus')
+    onPlusReady(callback: (plus: Window['plus']) => void) {
+        this.plusready.then(() => {
+            callback(window.plus)
+        })
     }
 
     /**
@@ -59,27 +134,12 @@ export default new (class {
     }
 
     /**
-     * 客户端的版本名称
-     * @returns 
-     */
-    getVersion(callback: (version: string) => void) {
-        this.onPlusReady((plus) => {
-            plus.runtime.getProperty(plus.runtime.appid, (info: { version: string }) => {
-                callback(info.version)
-            })
-        })
-    }
-
-    /**
-     * 获取客户端的版本号
+     * 获取系统信息
+     * @param prop 
      * @returns 
      */
-    getVersionCode(callback: (versionCode: string) => void) {
-        this.onPlusReady((plus) => {
-            plus.runtime.getProperty(plus.runtime.appid, (info: { versionCode: string }) => {
-                callback(info.versionCode)
-            })
-        })
+    getSystemInfo<K extends keyof SystemInfo>(prop: K) {
+        return this.systemInfo[prop]
     }
 
     /**
@@ -284,4 +344,57 @@ export default new (class {
             })
         })
     }
+
+    /**
+     * 内容分享
+     */
+    share() {
+        this.onPlusReady((plus) => {
+            // 成功回调
+            const success = (services: any) => {
+                console.log('分享列表', services)
+                services.forEach((e: any) => {
+                    if (e.id === 'weixin') {
+                        e.send({
+                            type: 'web',
+                            title: '标题',
+                            content: '内容',
+                            href: 'https://',
+                        }, () => {
+                            console.log('分享成功')
+                        }, (e: Error) => {
+                            console.log('分享失败', e.message)
+                        })
+                    }
+                })
+            }
+            // 失败回调
+            const error = (e: Error) => {
+                console.log('获取分享列表失败', e.message)
+            }
+            plus.share.getServices(success, error)
+        })
+    }
+
+    /**
+     * 打开第三方APP
+     * @param app 
+     */
+    launchApplication<K extends keyof typeof urlScheme>(app: K) {
+        this.onPlusReady((plus) => {
+            const os = this.getSystemInfo('os')
+            const params = Object.create(null)
+
+            if (os === 'Android') {
+                params.pname = urlScheme[app].pname
+            }
+            if (os === 'iOS') {
+                params.action = urlScheme[app].scheme
+            }
+
+            plus.runtime.launchApplication(params, (e: Error) => {
+                console.log('失败', e.message)
+            })
+        })
+    }
 })

Някои файлове не бяха показани, защото твърде много файлове са промени