Commit b1f3a576 by GiottoMaster

update

parent 594a1396
......@@ -141,6 +141,20 @@ export const changeMoney = (money: any) => {
return x1 + x2
}
// 价格转换(加逗号)
export const changeMoney2 = (money: any) => {
money = Number(money).toFixed(0)
money += ''
const x = money.split('.')
let x1 = x[0]
const x2 = x.length > 1 ? '.' + x[1] : ''
const reg = /(\d+)(\d{3})/
while (reg.test(x1)) {
x1 = x1.replace(reg, '$1' + ',' + '$2')
}
return x1 + x2
}
// 全角转半角
export const toHalfWidth = (str: any) => {
return (
......
const messages = {
common: {
submit: '提交',
nodata: '暂无数据~'
nodata: '暂无数据~',
unit: '元'
},
search: {
title: '搜索',
......
const messages = {
common: {
submit: '送信',
nodata: 'データなし'
nodata: 'データなし',
unit: '円',
unit2: '株'
},
search: {
title: '検索',
......
......@@ -21,7 +21,7 @@
<span class="name">{{ activeGupiao?.name || '' }}</span>
<van-icon name="arrow-down" color="#141414"></van-icon>
</div>
<div class="price" :style="{ color: getColor(activeGupiao) == 'up' ? '#EA3522' : '#31CC43' }">{{ activeGupiao.price }}</div>
<div class="price" :style="{ color: getColor(activeGupiao) == 'up' ? '#EA3522' : '#31CC43' }">{{ activeGupiao.price }}{{ $t('common.unit') }}</div>
<div class="flex">
<div class="info">
<div class="label" :style="{ color: getColor(activeGupiao) == 'up' ? '#EA3522' : '#31CC43' }">{{ activeGupiao?.zhangdieshu }}</div>
......@@ -65,7 +65,7 @@
<div class="bottom">
<view>
<view class="text-primary text-lg">
<span class="price" :class="getColor(item)">{{ item.price }}</span>
<span class="price" :class="getColor(item)">{{ item.price }}{{ $t('common.unit') }}</span>
<span v-if="item.zhangdiebaifenbi === 0"> - </span>
<van-icon v-else :class="getColor(item, true)" name="down" size=".75rem" />
</view>
......@@ -348,7 +348,7 @@ const handleSelect = (index: number) => {
white-space: nowrap;
}
.price {
font-size: 2.19rem;
font-size: 2rem;
font-weight: bold;
}
.info {
......@@ -434,7 +434,7 @@ const handleSelect = (index: number) => {
box-shadow: 0rem 0rem 0.38rem 0rem rgba(0, 0, 0, 0.2);
.price {
font-size: 1.0625rem;
font-size: 0.925rem;
font-weight: 500;
}
......
......@@ -83,7 +83,7 @@
<div class="price">
<img v-if="item.zhangdiebaifenbi > 0" :src="up" alt="" style="width: 0.5rem; height: 0.625rem; margin-right: 0.3438rem" />
<img v-if="item.zhangdiebaifenbi < 0" :src="down" alt="" style="width: 0.5rem; height: 0.625rem; margin-right: 0.3438rem" />
<span :class="getColor(item)">{{ item.price }}</span>
<span :class="getColor(item)">{{ item.price }}{{ $t('common.unit') }}</span>
</div>
</div>
</div>
......@@ -117,7 +117,7 @@
<div class="price">
<img v-if="item.zhangdiebaifenbi > 0" :src="up" alt="" style="width: 0.5rem; height: 0.625rem; margin-right: 0.3438rem" />
<img v-if="item.zhangdiebaifenbi < 0" :src="down" alt="" style="width: 0.5rem; height: 0.625rem; margin-right: 0.3438rem" />
<span :class="getColor(item)">{{ item.price }}</span>
<span :class="getColor(item)">{{ item.price }}{{ $t('common.unit') }}</span>
</div>
</div>
</div>
......
......@@ -16,8 +16,8 @@
<view v-for="(item, index) in dadanList" v-show="pageType === 0" :key="index" class="gupiao1 flex" @click="openWindow(item)">
<view class="text_ellipsis tt">{{ item.product_name }}</view>
<view>{{ item.product_code }}</view>
<view class="text-center red">{{ changeMoney(item.now_price) }}</view>
<view class="text-center red">{{ changeMoney(item.hedging_price) }}</view>
<view class="text-center red">{{ changeMoney(item.now_price) }}{{ $t('common.unit') }}</view>
<view class="text-center red">{{ changeMoney(item.hedging_price) }}{{ $t('common.unit') }}</view>
</view>
<view v-show="pageType === 1" class="card2">
<view v-for="(item, index) in shenqingList" :key="index" class="gupiao2">
......@@ -29,7 +29,7 @@
<div class="row">
<div class="left">
<view class="label">{{ t('hongli.column_jiage') }}</view>
<view class="value red">{{ changeMoney(item.buy_in_price) }}</view>
<view class="value red">{{ changeMoney(item.buy_in_price) }}{{ $t('common.unit') }}</view>
</div>
<div class="right">
<view class="label">{{ t('jiaoyi.shenqingliang') }}</view>
......@@ -40,7 +40,7 @@
<div class="row">
<div class="left">
<view class="label">{{ t('hongli.column_chengjiaoe') }}</view>
<view class="value red">{{ changeMoney(Math.floor(item.buy_in_amount)) }}</view>
<view class="value red">{{ changeMoney(Math.floor(item.buy_in_amount)) }}{{ $t('common.unit') }}</view>
</div>
<div class="right">
<view class="label">{{ t('hongli.column_zhuangtai') }}</view>
......@@ -68,11 +68,11 @@
</view>
<view class="row">
<view class="label">{{ t('dadan.column_jiage') }}</view>
<view class="value">{{ windowDetail.hedging_price }}</view>
<view class="value">{{ windowDetail.hedging_price }}{{ $t('common.unit') }}</view>
</view>
<view class="row">
<view class="label">{{ t('dadan.heji') }}</view>
<view class="value">{{ changeMoney(totalPrice) }}</view>
<view class="value">{{ changeMoney(totalPrice) }}{{ $t('common.unit') }}</view>
</view>
<view class="row">
<view class="label" style="color: red">{{ t('dadan.zhuyi') }}</view>
......
......@@ -48,11 +48,11 @@
<view class="flex justify-between">
<view class="flex flex-1 text-left de" style="width: 9.375rem">
<view class="text-lg text-gray hh2">{{ t('gupiaoDetail.label5') }}:</view>
<view class="text-lg" style="color: #ff0021">{{ gupiaoDetail.vol }}</view>
<view class="text-lg" style="color: #ff0021">{{ changeMoney2(gupiaoDetail.vol) }}{{ $t('common.unit2') }}</view>
</view>
<view class="flex flex-1 text-left de2" style="width: 9.375rem">
<view class="text-lg text-gray hh2">{{ t('gupiaoDetail.label6') }}:</view>
<view class="text-lg" style="color: #141414">{{ gupiaoDetail.totalMoney }}({{ t('gupiaoDetail.yi') }})</view>
<view class="text-lg" style="color: #141414">{{ gupiaoDetail.totalMoney }}({{ t('gupiaoDetail.yi') }}{{ t('common.unit') }})</view>
</view>
</view>
</view>
......@@ -165,7 +165,7 @@ import GupiaoChart from './components/gupiaoChart.vue'
import { useCounterStore } from '@/store/store'
import { useI18n } from 'vue-i18n'
import { getGupiaoDetailApi, getTickerKApi, collectApi, collectDetailApi, getUserMoneyApi, buyGupiaoApi } from '@/api/index/index'
import { timestempToDate, getColor, changeMoney } from '@/common/common'
import { timestempToDate, getColor, changeMoney, changeMoney2 } from '@/common/common'
import { onHide, onLoad, onShow } from '@dcloudio/uni-app'
import { ref } from 'vue'
import { buyGupiaoType } from '@/api/index/indexType'
......
......@@ -18,7 +18,7 @@
<view v-for="(item, index) in gupiaoList" :key="index" class="gupiao1 flex" @click="openWindow(item)">
<view class="tt">{{ item?.product?.name }}</view>
<view class="red">{{ changeMoney(item.buy_in_money) }}</view>
<view class="red">{{ changeMoney(item.buy_in_money) }}{{ $t('common.unit') }}</view>
<view>{{ item?.product?.shuzidaima }}</view>
</view>
</view>
......@@ -35,7 +35,7 @@
<div class="row">
<div class="left">
<view class="label">{{ t('hongli.column_jiage') }}</view>
<view class="value red">{{ changeMoney(item.buy_in_money) }}</view>
<view class="value red">{{ changeMoney(item.buy_in_money) }}{{ $t('common.unit') }}</view>
</div>
<div class="right">
<view class="label">{{ t('jiaoyi.shenqingliang') }}</view>
......@@ -47,7 +47,7 @@
<div class="row">
<div class="left">
<view class="label">{{ t('hongli.column_chengjiaoe') }}</view>
<view class="value">{{ changeMoney(Math.floor(item.buy_in_amount)) }}</view>
<view class="value">{{ changeMoney(Math.floor(item.buy_in_amount)) }}{{ $t('common.unit') }}</view>
</div>
<div class="right">
<view class="label">{{ t('hongli.column_zhuangtai') }}</view>
......@@ -74,7 +74,7 @@
</view>
<view class="row">
<view class="label">{{ t('hongli.window_shijia') }}</view>
<view class="value">{{ changeMoney(windowDetail.price) }}</view>
<view class="value">{{ changeMoney(windowDetail.price) }}{{ $t('common.unit') }}</view>
</view>
<view class="row">
<view class="label">{{ t('hongli.window_zhangdie') }}</view>
......@@ -82,15 +82,15 @@
</view>
<view class="row">
<view class="label">{{ t('hongli.column_jiage') }}</view>
<view class="value">{{ changeMoney(windowDetail.buy_in_money) }}</view>
<view class="value">{{ changeMoney(windowDetail.buy_in_money) }}{{ $t('common.unit') }}</view>
</view>
<view class="row">
<view class="label">{{ t('hongli.window_heji') }}</view>
<view class="value">{{ changeMoney(totalPrice) }}</view>
<view class="value">{{ changeMoney(totalPrice) }}{{ $t('common.unit') }}</view>
</view>
<view class="row">
<view class="label">{{ t('hongli.window_yue') }}</view>
<view class="value">{{ changeMoney(userMoneyInfo.money) }}</view>
<view class="value">{{ changeMoney(userMoneyInfo.money) }}{{ $t('common.unit') }}</view>
</view>
<view class="row" style="width: 100%; justify-content: space-between">
......@@ -378,7 +378,7 @@ const buy = async () => {
color: #fff;
view {
color: $uni-text-color;
font-size: 0.8rem;
font-size: 0.73rem;
}
}
}
......
......@@ -21,7 +21,7 @@
<div class="left">
<div class="row">
<div class="label">{{ t('ipo.jiage') }}</div>
<div class="value price">{{ changeMoney(item.chengxiaojia) }}</div>
<div class="value price">{{ changeMoney(item.chengxiaojia) }}{{ $t('common.unit') }}</div>
</div>
<div class="row">
<div class="label">{{ t('ipo.shuliang') }}</div>
......@@ -51,7 +51,7 @@
<div class="row">
<div class="left">
<view class="label">{{ t('jiaoyi.jiage') }}</view>
<view class="value red">{{ changeMoney(item.price) }}</view>
<view class="value red">{{ changeMoney(item.price) }}{{ $t('common.unit') }}</view>
</div>
<div class="right">
<view class="label">{{ t('jiaoyi.zhognqianshuliang') }}</view>
......@@ -95,7 +95,7 @@
<view class="row">
<view class="label">{{ t('ipo.windowLabel1') }}</view>
<view class="value">{{ changeMoney(windowDetail.chengxiaojia) }}</view>
<view class="value">{{ changeMoney(windowDetail.chengxiaojia) }}{{ $t('common.unit') }}</view>
</view>
<view class="row">
<view class="label">{{ t('ipo.windowLabel2') }}{{ t('ipo.zang') }}</view>
......
......@@ -7,10 +7,10 @@
</div>
<view class="mas">
<view class="input_wrap">
<input v-model="loginParams.account" :placeholder="t('login.account_placeholder')" />
<input v-model="loginParams.account" :placeholder="t('login.account_placeholder')" autocomplete />
</view>
<view class="input_wrap">
<input v-model="loginParams.password" :placeholder="t('login.password_placeholder')" type="password" />
<input v-model="loginParams.password" :placeholder="t('login.password_placeholder')" type="password" autocomplete />
</view>
</view>
<view class="button-wrap">
......
......@@ -34,7 +34,7 @@ const bottomFn = () => {
<view class="list-item-time" style="text-align: left">{{ item.createtime }}</view>
</div>
<div class="right">
<view class="list-item-shouru">{{ changeMoney(item.money) }}</view>
<view class="list-item-shouru">{{ changeMoney(item.money) }}{{ $t('common.unit') }}</view>
<view v-if="props.value === 1" class="list-item-tag">{{ item.remark }}</view>
<view v-if="props.value === 2" class="list-item-tag">{{ remark[Number(item.status)].value }}</view>
</div>
......
......@@ -32,7 +32,7 @@ const bottomFn = () => {
<div class="label">{{ t('transactionLog.tip1') }}{{ item.order_sn }}</div>
<div class="row">
<div class="label">{{ item.createtime }}</div>
<div class="price" :class="item.money > 0 ? 'txt-red' : 'txt-green'">{{ changeMoney(item.money) }}</div>
<div class="price" :class="item.money > 0 ? 'txt-red' : 'txt-green'">{{ changeMoney(item.money) }}{{ $t('common.unit') }}</div>
</div>
</view>
</view>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment