reactor:清理部分 TODO
parent
93ce26f6be
commit
08e7b32fc3
|
@ -28,10 +28,9 @@
|
|||
<view class="flex align-center justify-between ss-p-25">
|
||||
<!-- 左侧图标 -->
|
||||
<view class="time-icon">
|
||||
<!-- TODO 芋艿:图片统一维护 -->
|
||||
<image
|
||||
class="ss-w-100 ss-h-100"
|
||||
src="http://mall.yudao.iocoder.cn/static/images/priceTag.png"
|
||||
:src="sheep.$url.static('/static/img/shop/priceTag.png')"
|
||||
/>
|
||||
</view>
|
||||
<scroll-view
|
||||
|
|
|
@ -62,7 +62,7 @@
|
|||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 签到说明 TODO @科举:这里改成【已累计签到】 -->
|
||||
<!-- 签到说明 -->
|
||||
<view class="bg-white ss-m-t-16 ss-p-t-30 ss-p-b-60 ss-p-x-40">
|
||||
<view class="activity-title ss-m-b-30">签到说明</view>
|
||||
<view class="activity-des">1.已累计签到{{ state.signInfo.totalDay }}天</view>
|
||||
|
@ -160,7 +160,6 @@
|
|||
getSignInfo();
|
||||
getSignConfigList();
|
||||
});
|
||||
// TODO 芋艿:1)css 需要优化,例如说引入的图片;2)删除多余的样式
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
|
|
@ -1,27 +1,29 @@
|
|||
<!-- 页面 TODO 芋艿:该页面的实现代码需要优化,包括 js 和 css,以及相关的样式设计 -->
|
||||
<!-- 页面 -->
|
||||
<template>
|
||||
<s-layout title="我的团队" :class="state.scrollTop ? 'team-wrap' : ''" navbar="inner">
|
||||
<view
|
||||
class="header-box"
|
||||
:style="[
|
||||
{
|
||||
marginTop: '-' + Number(statusBarHeight + 88) + 'rpx',
|
||||
paddingTop: Number(statusBarHeight + 108) + 'rpx',
|
||||
},
|
||||
]"
|
||||
>
|
||||
<!-- 推广数据总览 -->
|
||||
<view class="team-data-box ss-flex ss-col-center ss-row-between" style="width: 100%">
|
||||
<view class="data-card" style="width: 100%">
|
||||
<view class="total-item" style="width: 100%">
|
||||
<view class="item-title" style="text-align: center">推广人数</view>
|
||||
<view class="total-num" style="text-align: center">
|
||||
{{ state.summary.firstBrokerageUserCount + state.summary.secondBrokerageUserCount || 0 }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view
|
||||
class="header-box"
|
||||
:style="[
|
||||
{
|
||||
marginTop: '-' + Number(statusBarHeight + 88) + 'rpx',
|
||||
paddingTop: Number(statusBarHeight + 108) + 'rpx',
|
||||
},
|
||||
]"
|
||||
>
|
||||
<!-- 推广数据总览 -->
|
||||
<view class="team-data-box ss-flex ss-col-center ss-row-between" style="width: 100%">
|
||||
<view class="data-card" style="width: 100%">
|
||||
<view class="total-item" style="width: 100%">
|
||||
<view class="item-title" style="text-align: center">推广人数</view>
|
||||
<view class="total-num" style="text-align: center">
|
||||
{{
|
||||
state.summary.firstBrokerageUserCount + state.summary.secondBrokerageUserCount || 0
|
||||
}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="promoter-list">
|
||||
<!--<view
|
||||
class="promoterHeader bg-color"
|
||||
|
@ -44,7 +46,7 @@
|
|||
</view>
|
||||
</view>-->
|
||||
<view style="padding: 0 20rpx">
|
||||
<view class="nav acea-row row-around l1" style="margin-top:20rpx;">
|
||||
<view class="nav acea-row row-around l1" style="margin-top: 20rpx">
|
||||
<view :class="state.level == 1 ? 'item on' : 'item'" @click="setType(1)">
|
||||
一级({{ state.summary.firstBrokerageUserCount || 0 }})
|
||||
</view>
|
||||
|
@ -66,7 +68,7 @@
|
|||
/>
|
||||
</view>
|
||||
<image
|
||||
src="/static/images/search.png"
|
||||
:src="sheep.$url.static('/static/img/shop/search.png')"
|
||||
mode=""
|
||||
style="width: 60rpx; height: 64rpx"
|
||||
@click="submitForm"
|
||||
|
@ -80,8 +82,7 @@
|
|||
v-if="sort === 'userCountDESC'"
|
||||
>
|
||||
团队排序
|
||||
<!-- TODO 芋艿:看看怎么从项目里拿出去 -->
|
||||
<image src="/static/images/sort1.png" />
|
||||
<image :src="sheep.$url.static('/static/img/shop/sort1.png')" />
|
||||
</view>
|
||||
<view
|
||||
class="sortItem"
|
||||
|
@ -89,15 +90,15 @@
|
|||
v-else-if="sort === 'userCountASC'"
|
||||
>
|
||||
团队排序
|
||||
<image src="/static/images/sort3.png" />
|
||||
<image :src="sheep.$url.static('/static/img/shop/sort3.png')" />
|
||||
</view>
|
||||
<view class="sortItem" @click="setSort('userCount', 'desc')" v-else>
|
||||
团队排序
|
||||
<image src="/static/images/sort2.png" />
|
||||
<image :src="sheep.$url.static('/static/img/shop/sort2.png')" />
|
||||
</view>
|
||||
<view class="sortItem" @click="setSort('price', 'asc')" v-if="sort === 'priceDESC'">
|
||||
金额排序
|
||||
<image src="/static/images/sort1.png" />
|
||||
<image :src="sheep.$url.static('/static/img/shop/sort1.png')" />
|
||||
</view>
|
||||
<view
|
||||
class="sortItem"
|
||||
|
@ -105,11 +106,11 @@
|
|||
v-else-if="sort === 'priceASC'"
|
||||
>
|
||||
金额排序
|
||||
<image src="/static/images/sort3.png" />
|
||||
<image :src="sheep.$url.static('/static/img/shop/sort3.png')" />
|
||||
</view>
|
||||
<view class="sortItem" @click="setSort('price', 'desc')" v-else>
|
||||
金额排序
|
||||
<image src="/static/images/sort2.png" />
|
||||
<image :src="sheep.$url.static('/static/img/shop/sort2.png')" />
|
||||
</view>
|
||||
<view
|
||||
class="sortItem"
|
||||
|
@ -117,7 +118,7 @@
|
|||
v-if="sort === 'orderCountDESC'"
|
||||
>
|
||||
订单排序
|
||||
<image src="/static/images/sort1.png" />
|
||||
<image :src="sheep.$url.static('/static/img/shop/sort1.png')" />
|
||||
</view>
|
||||
<view
|
||||
class="sortItem"
|
||||
|
@ -125,11 +126,11 @@
|
|||
v-else-if="sort === 'orderCountASC'"
|
||||
>
|
||||
订单排序
|
||||
<image src="/static/images/sort3.png" />
|
||||
<image :src="sheep.$url.static('/static/img/shop/sort3.png')" />
|
||||
</view>
|
||||
<view class="sortItem" @click="setSort('orderCount', 'desc')" v-else>
|
||||
订单排序
|
||||
<image src="/static/images/sort2.png" />
|
||||
<image :src="sheep.$url.static('/static/img/shop/sort2.png')" />
|
||||
</view>
|
||||
</view>
|
||||
<block v-for="(item, index) in state.pagination.list" :key="index">
|
||||
|
@ -173,7 +174,7 @@
|
|||
</view>
|
||||
</block>
|
||||
<block v-if="state.pagination.list.length === 0">
|
||||
<view style="text-align: center;margin-top:30rpx;">暂无推广人数</view>
|
||||
<view style="text-align: center; margin-top: 30rpx">暂无推广人数</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
<template>
|
||||
<view v-if="state.list.length > 0" class="groupon-list detail-card ss-p-x-20">
|
||||
<view class="join-activity ss-flex ss-row-between ss-m-t-30">
|
||||
<!-- todo: 接口缺少总数 -->
|
||||
<view class="">已有{{ state.list.length }}人参与活动</view>
|
||||
<text class="cicon-forward"></text>
|
||||
</view>
|
||||
|
@ -37,7 +36,7 @@
|
|||
import { onMounted, reactive } from 'vue';
|
||||
import sheep from '@/sheep';
|
||||
import { useDurationTime } from '@/sheep/hooks/useGoods';
|
||||
import CombinationApi from "@/sheep/api/promotion/combination";
|
||||
import CombinationApi from '@/sheep/api/promotion/combination';
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: {
|
||||
|
@ -74,7 +73,7 @@
|
|||
onMounted(async () => {
|
||||
// 查询参团记录
|
||||
// status = 0 表示未成团
|
||||
const { data } = await CombinationApi.getHeadCombinationRecordList(props.modelValue.id, 0 , 10);
|
||||
const { data } = await CombinationApi.getHeadCombinationRecordList(props.modelValue.id, 0, 10);
|
||||
state.list = data;
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -68,7 +68,7 @@
|
|||
</view>
|
||||
</view>
|
||||
<view class="line">
|
||||
<image :src="sheep.$url.static('/static/images/line.png', 'local')" />
|
||||
<image :src="sheep.$url.static('/static/img/shop/line.png')" />
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
|
|
@ -64,7 +64,6 @@
|
|||
v-model="formData.applyDescription"
|
||||
placeholder="客官~请描述您遇到的问题,建议上传照片"
|
||||
/>
|
||||
<!-- TODO 芋艿:上传的测试 -->
|
||||
<view class="upload-img">
|
||||
<s-uploader
|
||||
v-model:url="formData.applyPicUrls"
|
||||
|
|
|
@ -194,7 +194,7 @@
|
|||
@close="state.showCoupon = false"
|
||||
/>
|
||||
|
||||
<!-- 满额折扣弹框 TODO @puhui999:【折扣】后续要把优惠信息打进去 -->
|
||||
<!-- 满额折扣弹框 -->
|
||||
<s-discount-list
|
||||
v-model="state.orderInfo"
|
||||
:show="state.showDiscount"
|
||||
|
|
|
@ -331,7 +331,7 @@
|
|||
// 确认收货
|
||||
async function onConfirm(orderId, ignore = false) {
|
||||
// 需开启确认收货组件
|
||||
// todo: 芋艿:待接入微信
|
||||
// todo: 芋艿:待接入微信 https://gitee.com/sheepjs/shopro-uniapp/commit/a6bbba49b84dd418b84c5fefc8b7463df8f4901f
|
||||
// 1.怎么检测是否开启了发货组件功能?如果没有开启的话就不能在这里return出去
|
||||
// 2.如果开启了走mpConfirm方法,需要在App.vue的show方法中拿到确认收货结果
|
||||
let isOpenBusinessView = true;
|
||||
|
@ -432,7 +432,7 @@
|
|||
onShow(async () => {
|
||||
//onShow中获取订单列表,保证跳转后页面为最新状态
|
||||
await getOrderDetail(state.orderInfo.id);
|
||||
})
|
||||
});
|
||||
|
||||
onLoad(async (options) => {
|
||||
let id = 0;
|
||||
|
@ -444,7 +444,7 @@
|
|||
if (state.comeinType === 'wechat') {
|
||||
state.merchantTradeNo = options.merchant_trade_no;
|
||||
}
|
||||
state.orderInfo.id = id
|
||||
state.orderInfo.id = id;
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
@ -209,7 +209,7 @@
|
|||
// 确认收货 TODO 芋艿:待测试
|
||||
async function onConfirm(order, ignore = false) {
|
||||
// 需开启确认收货组件
|
||||
// todo: 芋艿:需要后续接入微信收货组件
|
||||
// todo: 芋艿:需要后续接入微信收货组件 https://gitee.com/sheepjs/shopro-uniapp/commit/a6bbba49b84dd418b84c5fefc8b7463df8f4901f
|
||||
// 1.怎么检测是否开启了发货组件功能?如果没有开启的话就不能在这里return出去
|
||||
// 2.如果开启了走mpConfirm方法,需要在App.vue的show方法中拿到确认收货结果
|
||||
let isOpenBusinessView = true;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<view class='order-details'>
|
||||
<view class="order-details">
|
||||
<!-- 自提商品核销 -->
|
||||
<view v-if="orderInfo.deliveryType === 2 && orderInfo.payStatus" class="writeOff borRadius14">
|
||||
<view class="title">核销信息</view>
|
||||
|
@ -8,21 +8,19 @@
|
|||
<image
|
||||
v-if="!!painterImageUrl"
|
||||
:src="painterImageUrl"
|
||||
:style="{width: `${state.qrcodeSize}px`, height: `${state.qrcodeSize}px`}"
|
||||
:style="{ width: `${state.qrcodeSize}px`, height: `${state.qrcodeSize}px` }"
|
||||
:show-menu-by-longpress="true"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="gear">
|
||||
<image :src="sheep.$url.static('/static/images/writeOff.png', 'local')"></image>
|
||||
<image :src="sheep.$url.static('/static/img/shop/writeOff.png')"></image>
|
||||
</view>
|
||||
<view class="num">{{ orderInfo.pickUpVerifyCode }}</view>
|
||||
<view class="rules">
|
||||
<!-- TODO puhui999: 需要后端放回:使用 receiveTime 即可 -->
|
||||
<view class="item">
|
||||
<view class="rulesTitle flex flex-wrap align-center">
|
||||
核销时间
|
||||
</view>
|
||||
<view class="rulesTitle flex flex-wrap align-center"> 核销时间 </view>
|
||||
<view class="info">
|
||||
每日:
|
||||
<text class="time">2020-2-+52</text>
|
||||
|
@ -37,7 +35,10 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="orderInfo.deliveryType === 2" class="map flex flex-wrap align-center ss-row-between borRadius14">
|
||||
<view
|
||||
v-if="orderInfo.deliveryType === 2"
|
||||
class="map flex flex-wrap align-center ss-row-between borRadius14"
|
||||
>
|
||||
<view>自提地址信息</view>
|
||||
<view class="place cart-color flex flex-wrap flex-center" @tap="showMaoLocation">
|
||||
查看位置
|
||||
|
@ -64,14 +65,14 @@
|
|||
type: Object,
|
||||
default() {},
|
||||
},
|
||||
systemStore:{
|
||||
systemStore: {
|
||||
type: Object,
|
||||
default() {},
|
||||
}
|
||||
},
|
||||
});
|
||||
const state = reactive({
|
||||
qrcodeSize: 145
|
||||
})
|
||||
qrcodeSize: 145,
|
||||
});
|
||||
|
||||
/**
|
||||
* 打开地图
|
||||
|
@ -80,7 +81,7 @@
|
|||
console.log(props.systemStore);
|
||||
if (!props.systemStore.latitude || !props.systemStore.longitude) {
|
||||
sheep.$helper.toast('缺少经纬度信息无法查看地图!');
|
||||
return
|
||||
return;
|
||||
}
|
||||
uni.openLocation({
|
||||
latitude: props.systemStore.latitude,
|
||||
|
@ -89,19 +90,19 @@
|
|||
name: props.systemStore.name,
|
||||
address: props.systemStore.areaName + props.systemStore.detailAddress,
|
||||
});
|
||||
}
|
||||
};
|
||||
/**
|
||||
* 拨打电话
|
||||
*/
|
||||
const makePhone = () => {
|
||||
uni.makePhoneCall({
|
||||
phoneNumber: props.systemStore.phone
|
||||
})
|
||||
}
|
||||
phoneNumber: props.systemStore.phone,
|
||||
});
|
||||
};
|
||||
|
||||
const painterRef = ref(); // 海报画板
|
||||
const painterImageUrl = ref(); // 海报 url
|
||||
const showPainter = ref(true)
|
||||
const showPainter = ref(true);
|
||||
// 渲染海报
|
||||
const renderPoster = async (poster) => {
|
||||
await painterRef.value.render(poster);
|
||||
|
@ -109,7 +110,7 @@
|
|||
// 获得生成的图片
|
||||
const setPainterImageUrl = (path) => {
|
||||
painterImageUrl.value = path;
|
||||
showPainter.value = false
|
||||
showPainter.value = false;
|
||||
};
|
||||
/**
|
||||
* 生成核销二维码
|
||||
|
@ -118,23 +119,23 @@
|
|||
renderPoster({
|
||||
css: {
|
||||
width: `${state.qrcodeSize}px`,
|
||||
height: `${state.qrcodeSize}px`
|
||||
height: `${state.qrcodeSize}px`,
|
||||
},
|
||||
views:[
|
||||
views: [
|
||||
{
|
||||
type: 'qrcode',
|
||||
text: text,
|
||||
css: {
|
||||
width: `${state.qrcodeSize}px`,
|
||||
height: `${state.qrcodeSize}px`
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
height: `${state.qrcodeSize}px`,
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
};
|
||||
defineExpose({
|
||||
markCode
|
||||
})
|
||||
markCode,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
@ -142,10 +143,10 @@
|
|||
border-radius: 14rpx !important;
|
||||
}
|
||||
.cart-color {
|
||||
color: #E93323 !important;
|
||||
border: 1px solid #E93323 !important
|
||||
color: #e93323 !important;
|
||||
border: 1px solid #e93323 !important;
|
||||
}
|
||||
.order-details{
|
||||
.order-details {
|
||||
border-radius: 10rpx;
|
||||
margin: 0 20rpx 20rpx 20rpx;
|
||||
}
|
||||
|
|
|
@ -262,7 +262,6 @@
|
|||
const spu = state.spuList.find((spu) => activity.spuId === spu.id);
|
||||
if (spu) {
|
||||
// 赋值活动名称
|
||||
// TODO 芋艿:暂定活动名。会在调研一些类似有赞、淘宝、京东的选择
|
||||
spu.name = activity.name;
|
||||
// 赋值最低价格
|
||||
spu.price = Math.min(combinationPrice, spu.price);
|
||||
|
|
|
@ -262,7 +262,6 @@
|
|||
const spu = state.spuList.find((spu) => activity.spuId === spu.id);
|
||||
if (spu) {
|
||||
// 赋值活动名称
|
||||
// TODO 芋艿:暂定活动名。会在调研一些类似有赞、淘宝、京东的选择
|
||||
spu.name = activity.name;
|
||||
// 赋值最低价格
|
||||
spu.price = Math.min(seckillPrice, spu.price);
|
||||
|
|
|
@ -19,8 +19,10 @@
|
|||
<view class="goods-title ss-line-2">{{ state.goodsInfo.name }}</view>
|
||||
<view class="header-right-bottom ss-flex ss-col-center ss-row-between">
|
||||
<!-- 价格 -->
|
||||
<view v-if="state.goodsInfo.activity_type === PromotionActivityTypeEnum.POINT.type"
|
||||
class="price-text ss-flex">
|
||||
<view
|
||||
v-if="state.goodsInfo.activity_type === PromotionActivityTypeEnum.POINT.type"
|
||||
class="price-text ss-flex"
|
||||
>
|
||||
<image
|
||||
v-if="!isEmpty(state.selectedSku)"
|
||||
:src="sheep.$url.static('/static/img/shop/goods/score1.svg')"
|
||||
|
@ -97,7 +99,6 @@
|
|||
/**
|
||||
* 秒杀活动SKU选择,
|
||||
* 与s-select-sku的区别:多一个秒杀价的标签、没有加入购物车按钮、立即购买按钮叫确认、秒杀有最大购买数量限制
|
||||
* 差别不大,可以考虑合并 todo @芋艿
|
||||
*/
|
||||
// 按钮状态: active,nostock
|
||||
import { computed, reactive, watch } from 'vue';
|
||||
|
@ -110,8 +111,7 @@
|
|||
const props = defineProps({
|
||||
modelValue: {
|
||||
type: Object,
|
||||
default() {
|
||||
},
|
||||
default() {},
|
||||
},
|
||||
show: {
|
||||
type: Boolean,
|
||||
|
|
|
@ -43,8 +43,6 @@ function ShoproDebug() {
|
|||
// new vconsole.default();
|
||||
// });
|
||||
// #endif
|
||||
|
||||
// TODO 芋艿:可以打印路由
|
||||
// 同步前端页面到后端
|
||||
// console.log(ROUTES)
|
||||
}
|
||||
|
|
|
@ -39,8 +39,14 @@ export default {
|
|||
timestamp: data.timestamp,
|
||||
nonceStr: data.nonceStr,
|
||||
signature: data.signature,
|
||||
jsApiList: ['chooseWXPay', 'openLocation', 'getLocation','updateTimelineShareData','scanQRCode'], // TODO 芋艿:后续可以设置更多权限;
|
||||
openTagList: data.openTagList
|
||||
jsApiList: [
|
||||
'chooseWXPay',
|
||||
'openLocation',
|
||||
'getLocation',
|
||||
'updateTimelineShareData',
|
||||
'scanQRCode',
|
||||
], // TODO 芋艿:后续可以设置更多权限;
|
||||
openTagList: data.openTagList,
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -55,7 +61,7 @@ export default {
|
|||
if (configSuccess) {
|
||||
console.log('微信 JSSDK 初始化成功');
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
// 回调
|
||||
if (callback) {
|
||||
|
@ -110,7 +116,7 @@ export default {
|
|||
});
|
||||
},
|
||||
|
||||
// 更新微信分享信息 TODO 芋艿:未测试
|
||||
// 更新微信分享信息
|
||||
updateShareInfo(data, callback = null) {
|
||||
this.isReady(() => {
|
||||
const shareData = {
|
||||
|
@ -141,7 +147,7 @@ export default {
|
|||
...data,
|
||||
success: function (res) {
|
||||
console.log(res);
|
||||
}
|
||||
},
|
||||
});
|
||||
});
|
||||
},
|
||||
|
|
|
@ -15,7 +15,6 @@ const platformMap = ['H5', 'WechatOfficialAccount', 'WechatMiniProgram', 'App'];
|
|||
// 设置分享方式: 1=直接转发,2=海报,3=复制链接,...按需扩展
|
||||
const fromMap = ['forward', 'poster', 'link'];
|
||||
|
||||
// TODO 芋艿:分享的接入
|
||||
// 设置分享信息参数
|
||||
const getShareInfo = (
|
||||
scene = {
|
||||
|
@ -37,7 +36,7 @@ const getShareInfo = (
|
|||
link: '', // 分享Url+参数
|
||||
query: '', // 分享参数
|
||||
poster, // 海报所需数据
|
||||
forward: {} // 转发所需参数
|
||||
forward: {}, // 转发所需参数
|
||||
};
|
||||
shareInfo.title = scene.title;
|
||||
shareInfo.image = $url.cdn(scene.image);
|
||||
|
|
|
@ -119,7 +119,6 @@ const app = defineStore({
|
|||
},
|
||||
});
|
||||
|
||||
// todo: @owen 先做数据适配,后期重构
|
||||
const adaptTemplate = async (appTemplate, templateId) => {
|
||||
const { data: diyTemplate } = templateId
|
||||
? // 查询指定模板,一般是预览时使用
|
||||
|
|
|
@ -128,7 +128,6 @@ const user = defineStore({
|
|||
},
|
||||
|
||||
// 登录后,加载各种信息
|
||||
// TODO 芋艿:整理下;
|
||||
async loginAfter() {
|
||||
await this.updateUserData();
|
||||
|
||||
|
|
|
@ -40,19 +40,6 @@ export const floatToFixed2 = (num) => {
|
|||
return str;
|
||||
};
|
||||
|
||||
/**
|
||||
* 将一个分数转换为整数
|
||||
*
|
||||
* @param {number | string | undefined} num 分数
|
||||
* @return {number} 整数
|
||||
*/
|
||||
export const convertToInteger = (num) => {
|
||||
if (typeof num === 'undefined') return 0;
|
||||
const parsedNumber = typeof num === 'string' ? parseFloat(num) : num;
|
||||
// TODO 分转元后还有小数则四舍五入
|
||||
return Math.round(parsedNumber * 100);
|
||||
};
|
||||
|
||||
/**
|
||||
* 时间日期转换
|
||||
* @param {dayjs.ConfigType} date 当前时间,new Date() 格式
|
||||
|
@ -110,8 +97,6 @@ export function handleTree(
|
|||
/**
|
||||
* 重置分页对象
|
||||
*
|
||||
* TODO 芋艿:需要处理其它页面
|
||||
*
|
||||
* @param pagination 分页对象
|
||||
*/
|
||||
export function resetPagination(pagination) {
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 3.9 KiB |
Binary file not shown.
Before Width: | Height: | Size: 5.0 KiB |
Binary file not shown.
Before Width: | Height: | Size: 1.1 KiB |
Binary file not shown.
Before Width: | Height: | Size: 1.1 KiB |
Binary file not shown.
Before Width: | Height: | Size: 1.1 KiB |
Binary file not shown.
Before Width: | Height: | Size: 2.3 KiB |
Loading…
Reference in New Issue