Handy_Cao před 2 roky
rodič
revize
b97f6cd383

+ 4 - 1
src/business/bank/index.ts

@@ -141,7 +141,10 @@ export function useDoBankSign() {
 
     /// 判断是否有签约信息 有就做修改
     queryBankAccountSign().then((res) => {
-        bankInfo.value = res.data[0]
+        console.log(res.data)
+        bankInfo.value = res.data.filter(obj=> {
+            return ![SignStatus.Rescinded].includes(obj.signstatus)
+        })[0]
         if (bankInfo.value) {
             ({
                 currency: formData.Currency,

+ 2 - 2
src/packages/mobile/components/modules/quote/price/index.vue

@@ -14,7 +14,7 @@
                 <ul>
                     <li>
                         <span>开盘</span>
-                        <span>{{ handleNumberValue(quote.opened) }}</span>
+                        <span :class="quote.openedColor">{{ handleNumberValue(quote.opened) }}</span>
                     </li>
                     <li>
                         <span>最高</span>
@@ -62,7 +62,7 @@
                 </li>
                 <li>
                     <span>均价</span>
-                    <span>{{ handleNumberValue(quote.averageprice) }}</span>
+                    <span :class="quote.averagepriceColor">{{ handleNumberValue(quote.averageprice) }}</span>
                 </li>
                 <li>
                     <span>振幅</span>

+ 8 - 3
src/packages/mobile/views/ballot/detail/components/delisting/index.vue

@@ -12,6 +12,11 @@
                         :auto-fixed="false" integer />
                 </template>
             </Field>
+            <Field label="最大申购量">
+                <template #input>
+                    <span>{{ detail.buymaxqty }}</span>
+                </template>
+            </Field>
             <Field label="预售定金">
                 <template #input>
                     <span>{{ deposit }}</span>
@@ -57,11 +62,11 @@ const formRules: { [key in keyof Proto.OrderReq]?: FieldRule[] } = {
     OrderQty: [{
         message: '请输入数量',
         validator: (val) => {
-            const enable = props.detail.presaleqty - props.detail.presaledqty
-            if (val <= enable) {
+            const buymaxqty = props.detail.buymaxqty
+            if (val <= buymaxqty) {
                 return true
             }
-            return '委托数量不能大于' + `${enable}`
+            return '委托数量不能大于' + `${buymaxqty}`
         }
     }],
 }

+ 2 - 1
src/packages/mobile/views/order/list/components/presale/detail/Index.vue

@@ -12,6 +12,7 @@
                     <Cell title="认购价" :value="selectedRow.orderprice" />
                     <Cell title="认购金额" :value="(selectedRow.orderprice * selectedRow.orderqty).toFixed(2)" />
                     <Cell title="定金方式" :value="selectedRow.presaledepositalgorithm === 1 ? '比率' : '固定'" />
+                    <Cell title="定金比例" :value="parsePercent(selectedRow.presaledepositvalue)" />
                     <Cell title="预售定金" :value="selectedRow.freezemargin" />
                     <Cell title="发售方" :value="selectedRow.sellname" />
                     <Cell title="开始日期" :value="formatDate(selectedRow.starttime, 'YYYY-MM-DD')" />
@@ -30,7 +31,7 @@
 <script lang="ts" setup>
 import { shallowRef, PropType } from 'vue'
 import { CellGroup, Cell } from 'vant'
-import { handleNumberValue, formatDate } from '@/filters'
+import { handleNumberValue, formatDate, parsePercent } from '@/filters'
 import { getOrderStatusName } from '@/constants/order'
 import AppModal from '@/components/base/modal/index.vue'
 

+ 2 - 2
src/packages/mobile/views/order/position/components/goods/close/Index.vue

@@ -16,7 +16,7 @@
                     <Cell title="持仓均价" :value="formatDecimal(selectedRow.averageprice)" />
                     <Cell title="参考损益">
                         <template #value>
-                            <span :class="closepl ? 'g-price-up' : 'g-price-down'">{{ formatDecimal(closepl) }}</span>
+                            <span :class="handlePriceColor(closepl, 0.0)">{{ formatDecimal(closepl) }}</span>
                         </template>
                     </Cell>
                 </CellGroup>
@@ -50,7 +50,7 @@ import { shallowRef, PropType, onMounted, computed } from 'vue'
 import AppModal from '@/components/base/modal/index.vue'
 import { CellGroup, Cell, Button, FieldRule, Form, Field, Stepper } from 'vant'
 import { getBuyOrSellName, BuyOrSell } from '@/constants/order'
-import { formatDecimal, handleNumberValue } from '@/filters'
+import { formatDecimal, handleNumberValue, handlePriceColor } from '@/filters'
 import { useOrder } from '@/business/trade'
 import { dialog, fullloading } from '@/utils/vant'
 import { useFuturesStore } from '@/stores'

+ 1 - 0
src/packages/pc/views/account/sign/components/cancel/index.vue

@@ -40,6 +40,7 @@ const onCancelSumit = () => {
     /// 提交
     cancelSubmit().then(() => {
         ElMessage.success('提交成功')
+        onCancel(true)
     }).catch((err) => {
         ElMessage.error(err)
     })

+ 149 - 0
src/packages/pc/views/auth/forget/index.vue

@@ -0,0 +1,149 @@
+<template>
+    <el-form ref="formRef" :model="formData" :rules="formRules" @submit="formSubmit">
+        <el-form-item prop="mobile">
+            <el-input name="mobile" placeholder="请输入手机号码" type="tel" v-model="formData.mobile" :rules="formRules.mobile"></el-input>
+        </el-form-item>
+        <el-form-item prop="vcode">
+            <el-input name="vcode" placeholder="请输入短信验证码" type="digit" v-model="formData.vcode" :rules="formRules.vcode">
+            </el-input>
+            <el-button size="small" type="primary" :disabled="isCountdown" @click="sendVerifyCode">
+                <span v-if="isCountdown">重新发送({{ currentTime.seconds }})</span>
+                <span v-else>获取验证码</span>
+            </el-button>
+        </el-form-item>
+        <el-form-item prop="password">
+            <el-input name="password" placeholder="请输入新密码" type="password" v-model="formData.password" :rules="formRules.password"></el-input>
+        </el-form-item>
+        <el-form-item prop="confirmpassword">
+            <el-input name="confirmpassword" placeholder="请输入确认密码" type="confirmpassword" v-model="formData.confirmpassword" :rules="formRules.confirmpassword"></el-input>
+        </el-form-item>
+        <el-form-item>
+            <el-button class="submit" type="primary" @click="formSubmit">重置密码</el-button>
+            <el-button class="cancel" type="primary" plain>取消</el-button>
+        </el-form-item>
+    </el-form>
+</template>
+
+<script lang="ts" setup>
+import { reactive, ref, computed } from 'vue'
+import { useCountDown } from '@vant/use'
+import { getEncryptMobile } from '@/filters'
+import { validateRules } from '@/constants/regex'
+import { queryLoginId } from '@/services/api/account'
+import { resetPassword, sendResetVerifyCode } from '@/services/api/common'
+import cryptojs from 'crypto-js'
+import { ElMessage, FormInstance, FormRules } from 'element-plus'
+
+const formRef = ref<FormInstance>()
+const isCountdown = ref(false) // 是否正在倒计时
+
+// 倒计时函数
+const countdown = useCountDown({
+    time: 60 * 1000,
+    onFinish: () => {
+        countdown.reset()
+        isCountdown.value = false
+    }
+})
+
+// 倒计时剩余时间
+const currentTime = computed(() => countdown.current.value)
+
+// 表单数据
+const formData = reactive<Model.ResetPasswordReq & { confirmpassword: string }>({
+    logincode: '',
+    mobile: '',
+    vcode: '',
+    password: '',
+    confirmpassword: '',
+})
+
+// 表单验证规则
+const formRules: FormRules = {
+    mobile: [{
+        required: true,
+        message: '请输入手机号码',
+        validator: (rule, value, callback) => {
+            if (validateRules.phone.validate(value)) {
+                callback()
+            }
+            callback(new Error(validateRules.phone.message)) 
+        }
+    }],
+    password: [{
+        required: true,
+        message: '请输入新密码',
+        validator: (rule, value, callback) => {
+            if (validateRules.password.validate(value)) {
+                callback()
+            }
+            callback(new Error(validateRules.phone.message)) 
+        }
+    }],
+    vcode: [{
+        required: true,
+        message: '请输入短信验证码',
+    }],
+    confirmpassword: [{
+        required: true,
+        message: '请输入确认密码',
+        validator: (rule, value, callback) => {
+            if (formData.password === value) {
+                callback()
+            }
+            callback(new Error('新密码和确认密码不一致')) 
+        }
+    }],
+}
+
+// 发送手机验证码
+const sendVerifyCode = () => {
+    // formRef.value?.validate('mobile').then(() => {
+        sendResetVerifyCode({
+            data: {
+                mobile: getEncryptMobile(formData.mobile),
+                businessType: 1
+            }
+        }).then(() => {
+            isCountdown.value = true
+            countdown.start()
+        }).catch(() => {
+            ElMessage.error('发送失败')
+        })
+    // })
+}
+
+const formSubmit = () => {
+    // fullloading((hideLoading) => {
+        queryLoginId({
+            data: {
+                username: formData.mobile
+            }
+        }).then((res) => {
+            const { mobile, password, vcode } = formData
+            const logincode = res.data
+            const encryptedData = cryptojs.SHA256(logincode + password).toString()
+            const encryptedHex = cryptojs.enc.Hex.parse(encryptedData).toString().toLocaleLowerCase()
+
+            resetPassword({
+                data: {
+                    logincode,
+                    mobile: getEncryptMobile(mobile),
+                    password: encryptedHex,
+                    vcode,
+                }
+            }).then((res) => {
+                if (res.code === '0') {
+                    ElMessage.success('密码重置成功,请重新登录。')
+                } else {
+                    ElMessage.error(res.message)
+                }
+            }).catch((err) => {
+                ElMessage.error(err)
+            })
+        }).catch((err) => {
+            ElMessage.error(err)
+        })
+    // })
+}
+</script>

+ 11 - 4
src/packages/pc/views/auth/login/index.vue

@@ -1,6 +1,6 @@
 <template>
-  <sign-layout class="user-login" title="登录">
-    <el-form ref="formRef" :model="formData" :rules="formRules">
+  <sign-layout class="user-login" :title="islogin ? '登录' : '重置密码'">
+    <el-form ref="formRef" :model="formData" :rules="formRules" v-if="islogin">
       <el-form-item prop="userName">
         <el-input placeholder="用户名/账号/手机号" v-model="formData.userName"></el-input>
       </el-form-item>
@@ -10,15 +10,16 @@
       </el-form-item>
       <el-form-item>
         <el-checkbox label="false" v-model="remember">记住账号</el-checkbox>
+        <span @click="goToFrogetPwd">忘记密码?</span>
       </el-form-item>
       <el-form-item>
         <el-button class="submit" type="primary" :loading="loading" @click="formSubmit">
           <span v-if="loading">正在登录</span>
           <span v-else>登录</span>
         </el-button>
-        <!-- <el-button>注册</el-button> -->
       </el-form-item>
     </el-form>
+    <Forget v-else></Forget>
   </sign-layout>
 </template>
 
@@ -31,6 +32,7 @@ import { ClientType } from '@/constants/client'
 import { useLogin } from '@/business/login'
 import { useMenuStore } from '@/stores'
 import SignLayout from '../components/layout/index.vue'
+import Forget from "../forget/index.vue";
 
 const { formData, remember, userLogin } = useLogin()
 const route = useRoute()
@@ -38,7 +40,7 @@ const router = useRouter()
 const menuStore = useMenuStore()
 const formRef = shallowRef<FormInstance>()
 const loading = shallowRef(false)
-//const remember = shallowRef(false) // 记住账号
+const islogin = shallowRef(true)
 
 const formRules: FormRules = {
   userName: [
@@ -49,6 +51,11 @@ const formRules: FormRules = {
   ]
 }
 
+/// 忘记密码
+const goToFrogetPwd = () => {
+  islogin.value = false
+}
+
 const formSubmit = () => {
   formRef.value?.validate(async (valid) => {
     if (valid) {

+ 10 - 2
src/packages/pc/views/footer/spot/position/components/listing/index.vue

@@ -1,11 +1,14 @@
 <!-- 现货仓单-现货明细-挂牌 -->
 <template>
-    <app-drawer title="挂牌" v-model:show="show" :loading="loading" :refresh="refresh">
+    <app-drawer title="挂牌" v-model:show="show" :loading="loading" :refresh="refresh" :width="500">
         <el-form ref="formRef" class="el-form--vertical" label-width="120px" label-position="left" :model="formData"
             :rules="formRules">
             <el-form-item label="商品代码/名称">
                 <span>{{ selectedRow.wrstandardcode }}/{{ selectedRow.wrstandardname }}</span>
             </el-form-item>
+            <el-form-item prop="PerformanceTemplateID" label="履约方式">
+                <Performance :market-id="17201" v-model="formData.PerformanceTemplateID" />
+            </el-form-item>
             <el-form-item label="仓库">
                 <span>{{ selectedRow.warehousename }}</span>
             </el-form-item>
@@ -22,7 +25,7 @@
                 <el-input-number placeholder="请输入挂牌数量" v-model="formData.OrderQty" :max="selectedRow.enableqty" :min="0" />
             </el-form-item>
             <el-form-item prop="FixedPrice" label="挂牌价格">
-                <el-input-number placeholder="请输入挂牌价格" v-model="formData.FixedPrice" />
+                <el-input-number placeholder="请输入挂牌价格" :precision="2" v-model="formData.FixedPrice" />
             </el-form-item>
         </el-form>
         <template #footer>
@@ -37,6 +40,7 @@ import { ref, PropType } from 'vue'
 import { ElMessage, FormInstance, FormRules } from 'element-plus'
 import { useHdWROrder } from '@/business/trade'
 import AppDrawer from '@pc/components/base/drawer/index.vue'
+import Performance from '@pc/components/modules/performance/index.vue'
 
 const props = defineProps({
     selectedRow: {
@@ -53,6 +57,10 @@ const refresh = ref(false)
 const formRef = ref<FormInstance>()
 
 const formRules: FormRules = {
+    PerformanceTemplateID: [{
+        required: true,
+        message: '请选择履约方式'
+    }],
     FixedPrice: [{
         message: '请输入价格',
         validator: () => {

+ 1 - 0
src/stores/modules/futures.ts

@@ -137,6 +137,7 @@ export const useFuturesStore = defineStore(() => {
                 ask4Color: handleColor(ask4),
                 ask5Color: handleColor(ask5),
                 lastColor: handleColor(last),
+                averagepriceColor: handleColor(averageprice),
                 openedColor: handleColor(opened),
                 highestColor: handleColor(highest),
                 lowestColor: handleColor(lowest),

+ 1 - 0
src/types/model/market.d.ts

@@ -110,6 +110,7 @@ declare namespace Model {
         opened: number; // 开盘
         highest: number; // 最高
         lowest: number; // 最低
+        averagepriceColor: string; // 均价颜色
         bidColor: string;// 买价颜色
         bid2Color: string;// 买价颜色
         bid3Color: string;// 买价颜色