Handy_Cao 1 year ago
parent
commit
988ef6fc2d

+ 1 - 1
oem/gstj/config/appconfig.json

@@ -3,7 +3,7 @@
   "appName": "甘肃碳交",
   "version": "1.0.28",
   "versionCode": "100028",
-  "apiUrl": "http://8.130.69.63:8280/cfg?key=gstj",
+  "apiUrl": "http://192.168.31.167:8080/cfg?key=test_167",
   "tradeChannel": "ws",
   "modules": [
     "register",

+ 10 - 1
src/packages/gstj/views/holdbank/holddeposit/Index.vue

@@ -3,7 +3,7 @@
         <template #header>
             <app-navbar title="代扣申请查询" >
                 <template #right>
-                    <div class="button-more" v-if="signStatus === SignStatus.Signed" @click="openComponent('apply')">
+                    <div class="button-more" @click="showComponent('apply')">
                         <span>新增</span>
                     </div>
                 </template>
@@ -56,6 +56,7 @@ import { SignStatus } from '@/constants/bank'
 import { Calendar, Cell } from 'vant'
 import { queryGtwithholddepositapply, queryGetGtwithholdsigninfo } from '@/services/api/bank'
 import { getBillResultName } from '@/constants/order'
+import { dialog } from '@/utils/vant'
 import moment from 'moment'
 import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
 
@@ -85,6 +86,14 @@ useRequest(queryGetGtwithholdsigninfo, {
     }
 })
 
+const showComponent = (componentName: string) => {
+    if (signStatus.value != SignStatus.Signed) {
+        dialog('未进行入金代扣签约申请')
+        return
+    }
+    openComponent(componentName)
+}
+
 const { loading, pageIndex, pageCount, run, dataList } = useRequest(queryGtwithholddepositapply)
 
 // 选择日期

+ 46 - 4
src/packages/gstj/views/mine/Index.vue

@@ -60,7 +60,7 @@
                     </ul>
                 </div>
                 <div class="button">
-                    <Button type="danger" size="small" round @click="doInOutMoney('0')">入金</Button>
+                    <Button type="danger" size="small" round @click="showComponent('apply')">代扣入金</Button>
                     <Button size="small" round @click="doInOutMoney('1')">出金</Button>
                 </div>
             </div>
@@ -100,12 +100,17 @@
                 </Cell>
                 <Cell is-link :to="{ name: 'hold-sign' }" v-if="authStatus === AuthStatus.Certified">
                     <template #title>
-                        <Iconfont icon="g-icon-signing"> 代扣签约申请</Iconfont>
+                        <Iconfont icon="g-icon-signing"> 代扣签约</Iconfont>
                     </template>
                 </Cell>
                 <Cell is-link :to="{ name: 'hold-deposit' }" v-if="authStatus === AuthStatus.Certified">
                     <template #title>
-                        <Iconfont icon="g-icon-wallet">入金代扣申请</Iconfont>
+                        <Iconfont icon="g-icon-wallet">代扣查询</Iconfont>
+                    </template>
+                </Cell>
+                <Cell is-link @click="doInOutMoney('0')" v-if="authStatus === AuthStatus.Certified">
+                    <template #title>
+                        <Iconfont icon="g-icon-wallet">银行入金</Iconfont>
                     </template>
                 </Cell>
                 <Cell is-link :to="{ name: 'mine-profile' }">
@@ -143,21 +148,33 @@
         <div class="mine-footer">
             <Button class="button-logout" type="danger" size="small" round @click="userLogout">退出登录</Button>
         </div>
+        <component ref="componentRef" :is="componentMap.get(componentId)" @closed="closeComponent"
+            v-if="componentId" />
     </app-view>
 </template>
 
 <script lang="ts" setup>
-import { shallowRef, onActivated, computed } from 'vue'
+import { shallowRef, onActivated, computed, defineAsyncComponent } from 'vue'
 import { Cell, CellGroup, Button, Icon } from 'vant'
 import { parsePercent } from '@/filters'
 import { fullloading, dialog } from '@/utils/vant'
+import { useRequest } from '@/hooks/request'
 import { useNavigation } from '@mobile/router/navigation'
 import { AuthStatus } from '@/constants/account'
 import { queryBankAccountSign } from '@/services/api/bank'
 import { useLoginStore, useAccountStore, useUserStore } from '@/stores'
+import { queryGetGtwithholdsigninfo } from '@/services/api/bank'
+import { useComponent } from '@/hooks/component'
+import { SignStatus } from '@/constants/bank'
 import eventBus from '@/services/bus'
 import Iconfont from '@/components/base/iconfont/index.vue'
 
+const componentMap = new Map<string, unknown>([
+    ['apply', defineAsyncComponent(() => import('../holdbank/holddeposit/components/apply/Index.vue'))],
+])
+
+const { componentRef, componentId, openComponent, closeComponent } = useComponent()
+
 const { router, routerTo } = useNavigation()
 const loginStore = useLoginStore()
 const userStore = useUserStore()
@@ -166,12 +183,23 @@ const { currentAccount } = accountStore.$toRefs()
 
 const headerRef = shallowRef<HTMLDivElement>()
 const authStatus = computed(() => userStore.userAccount.hasauth) // 实名认证状态
+const signStatus = shallowRef(SignStatus.Unsigned)
 
 const onReady = (el: HTMLDivElement) => {
     // 设置背景图位置
     headerRef.value?.style.setProperty('background-position', `0 -${el.clientHeight}px`)
 }
 
+// 查询已经入金代扣申请签约
+useRequest(queryGetGtwithholdsigninfo, {
+    onSuccess: (res) => {
+        /// 签约状态
+        if (res.data.length != 0) {
+            signStatus.value = res.data[0].accountsignstatus
+        }
+    }
+})
+
 /// 进行出入金操作判断
 const doInOutMoney = (tab: string) => {
     if (authStatus.value === AuthStatus.Certified) {
@@ -206,6 +234,20 @@ const doInOutMoney = (tab: string) => {
     }
 }
 
+const showComponent = (companyName: string) => {
+    if (signStatus.value != SignStatus.Signed) {
+        dialog({
+            showCancelButton: true,
+            confirmButtonText: '签约申请',
+            message: '未进行入金代扣签约申请'
+        }).then(() => {
+            router.push({ name: 'hold-sign' })
+        })
+        return
+    }
+    openComponent(companyName)
+}
+
 const userLogout = () => {
     dialog({
         message: '是否退出当前账号?',

+ 1 - 1
src/packages/mobile/views/goods/detail/Index.vue

@@ -10,7 +10,7 @@
         <template #footer>
             <div class="g-form__footer">
                 <Button block type="danger" square @click="onListing(BuyOrSell.Buy)">买入</Button>
-                <Button block type="primary" square @click="onListing(BuyOrSell.Sell)">卖出</Button>
+                <Button block color="#199e00" square @click="onListing(BuyOrSell.Sell)">卖出</Button>
             </div>
             <component ref="componentRef" :is="componentMap.get(componentId)" v-bind="{ goodsCode, buyOrSell }"
                 @closed="closeComponent" v-if="componentId" />

+ 5 - 2
src/packages/mobile/views/goods/detail/components/listing/Index.vue

@@ -60,7 +60,7 @@
                     <template v-if="direction === BuyOrSell.Buy">
                         <Button type="danger" block square :disabled="!formData.OrderQty"
                             @click="onBeforeSubmit(EBuildType.BUILDTYPE_OPEN)" v-if="!quote?.iscannotbuy">订立买入</Button>
-                        <Button type="primary" block square
+                        <Button color="#199e00" block square
                             :disabled="!formData.OrderQty || !sellQty || (formData.OrderQty > sellQty)"
                             @click="onBeforeSubmit(EBuildType.BUILDTYPE_CLOSE)" v-if="!isTrademode16">
                             <span>转让买入</span>
@@ -71,7 +71,7 @@
                         <Button type="danger" block square :disabled="!formData.OrderQty"
                             @click="onBeforeSubmit(EBuildType.BUILDTYPE_OPEN)"
                             v-if="!isTrademode16 && !quote?.iscannotsell">订立卖出</Button>
-                        <Button type="primary" block square
+                        <Button color="#199e00" block square
                             :disabled="!formData.OrderQty || !buyQty || (formData.OrderQty > buyQty)"
                             @click="onBeforeSubmit(EBuildType.BUILDTYPE_CLOSE)">
                             <span>转让卖出</span>
@@ -184,7 +184,10 @@ const formRules: { [key: string]: FieldRule[] } = {
 }
 
 const onPriceClick = (buyorsell: BuyOrSell, value: number) => {
+    /// 价格显示
     formData.OrderPrice = value
+    /// 方向也变化
+    direction.value = buyorsell === BuyOrSell.Buy ? 1 : 0
 }
 
 const onRadioChange = (value: number) => {