Merge remote-tracking branch 'origin/feature/mall_product' into feature/mall_product
commit
160f9d306f
|
@ -3,6 +3,7 @@ import App from './App'
|
|||
import store from './store'
|
||||
import Cache from './utils/cache'
|
||||
import util from 'utils/util'
|
||||
import * as Amount from 'utils/money'
|
||||
import configs from './config/app.js'
|
||||
import * as Order from './libs/order';
|
||||
|
||||
|
@ -13,6 +14,10 @@ Vue.prototype.$eventHub = new Vue();
|
|||
Vue.config.productionTip = false
|
||||
Vue.prototype.$Order = Order;
|
||||
|
||||
Vue.filter('currency', function (value) {
|
||||
return Amount.toMoney(value)
|
||||
})
|
||||
|
||||
// #ifdef H5
|
||||
import { parseQuery } from "./utils";
|
||||
import Auth from './libs/wechat';
|
||||
|
|
|
@ -840,12 +840,14 @@
|
|||
// }
|
||||
query.select(idView).boundingClientRect();
|
||||
query.exec(function(res) {
|
||||
if(Array.isArray(res) && res.length > 0 && res[0]){
|
||||
var top = res[0].top;
|
||||
var height = res[0].height;
|
||||
topArr.push(top);
|
||||
heightArr.push(height);
|
||||
that.$set(that, 'topArr', topArr);
|
||||
that.$set(that, 'heightArr', heightArr);
|
||||
}
|
||||
});
|
||||
};
|
||||
},
|
||||
|
|
|
@ -1,13 +1,15 @@
|
|||
<template>
|
||||
<view class="box">
|
||||
<u-navbar autoBack :title="performance[active].name" bgColor="rgba(255,255,255,0)" :placeholder="true" leftIconSize="40"
|
||||
leftIconColor="#fff" titleStyle="font-size:35rpx;color:#fff">
|
||||
<u-navbar autoBack :title="performance[active].name" bgColor="rgba(255,255,255,0)" :placeholder="true"
|
||||
leftIconSize="40" leftIconColor="#fff" titleStyle="font-size:35rpx;color:#fff">
|
||||
<!-- <view slot="right">
|
||||
<u-icon name="more-dot-fill" color="#fff" @click="show = true"></u-icon>
|
||||
</view> -->
|
||||
</u-navbar>
|
||||
<u-sticky bgColor="#fff">
|
||||
<u-tabs @change="handleChange" :list="list" itemStyle=" padding-left: 46rpx; padding-right: 46rpx; height: 46px;" lineColor="#DA2E55" lineWidth="48rpx" lineHeight="10rpx" :activeStyle="activeStyle" :inactiveStyle="inactiveStyle"></u-tabs>
|
||||
<u-tabs @change="handleChange" :list="list" itemStyle=" padding-left: 46rpx; padding-right: 46rpx; height: 46px;"
|
||||
lineColor="#DA2E55" lineWidth="48rpx" lineHeight="10rpx" :activeStyle="activeStyle"
|
||||
:inactiveStyle="inactiveStyle"></u-tabs>
|
||||
</u-sticky>
|
||||
<view class="sale_content">
|
||||
<view class="sale_money">
|
||||
|
@ -16,12 +18,13 @@
|
|||
<image src="../../static/images/money1.png"></image>
|
||||
<text>总计金额</text>
|
||||
</view>
|
||||
<view class="money_right"><text>¥</text>{{orderDetail.totalAmount}}</view>
|
||||
<view class="money_right"><text>¥</text>{{orderDetail.totalAmount | currency}}</view>
|
||||
</view>
|
||||
<view class="money_statistics">
|
||||
<view class="money_left">
|
||||
<image class="logo" src="../../static/images/money2.png"></image>
|
||||
<view class="segmentation" style="background: linear-gradient(0deg, #FFFFFF 0%, #FFE0C5 47%, #FFFFFF 100%);"></view>
|
||||
<view class="segmentation"
|
||||
style="background: linear-gradient(0deg, #FFFFFF 0%, #FFE0C5 47%, #FFFFFF 100%);"></view>
|
||||
<text>已发展会员个数</text>
|
||||
</view>
|
||||
<view class="money_right" style="color: #FF4800;">{{orderDetail.memberCount}}个</view>
|
||||
|
@ -30,19 +33,23 @@
|
|||
<view class="money_statistics">
|
||||
<view class="money_left">
|
||||
<image class="logo" src="../../static/images/money3.png"></image>
|
||||
<view class="segmentation" style="background: linear-gradient(0deg, #FFFFFF 0%, #C8EFFF 47%, #FFFFFF 100%);"></view>
|
||||
<view class="segmentation"
|
||||
style="background: linear-gradient(0deg, #FFFFFF 0%, #C8EFFF 47%, #FFFFFF 100%);"></view>
|
||||
<text>提成比例</text>
|
||||
</view>
|
||||
<view class="money_right" style="color: #1082FF;">{{orderDetail.memberCommission}}%</view>
|
||||
<view class="money_right" style="color: #1082FF;">{{orderDetail.memberCommission | currency}}%</view>
|
||||
<image class="fillet" src="../../static/images/fillet2.png"></image>
|
||||
</view>
|
||||
<view class="money_statistics">
|
||||
<view class="money_left">
|
||||
<image class="logo" src="../../static/images/money4.png"></image>
|
||||
<view class="segmentation" style="background: linear-gradient(0deg, #FFFFFF 0%, #CEF0DA 47%, #FFFFFF 100%);"></view>
|
||||
<view class="segmentation"
|
||||
style="background: linear-gradient(0deg, #FFFFFF 0%, #CEF0DA 47%, #FFFFFF 100%);"></view>
|
||||
<text>预计提成金额</text>
|
||||
</view>
|
||||
<view class="money_right" style="color: #32A84F;">{{parseFloat(orderDetail.totalAmount*(parseFloat(orderDetail.memberCommission) / 100))}}</view>
|
||||
<view class="money_right" style="color: #32A84F;">
|
||||
¥{{parseFloat(orderDetail.totalAmount*(parseFloat(orderDetail.memberCommission) / 100)) | currency}}
|
||||
</view>
|
||||
<image class="fillet" src="../../static/images/fillet3.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -51,27 +58,28 @@
|
|||
{{performance[active].fund}}
|
||||
</view>
|
||||
<view class="turnover_list">
|
||||
<u-list
|
||||
height="500"
|
||||
@scrolltolower="scrolltolower"
|
||||
>
|
||||
<u-list-item
|
||||
v-for="(item, index) in orderData"
|
||||
:key="index"
|
||||
>
|
||||
<u-list height="500" @scrolltolower="scrolltolower">
|
||||
<u-list-item v-for="(item, index) in orderData" :key="index">
|
||||
<view class="list_item">
|
||||
<view>
|
||||
<view class="info-wrap">
|
||||
<view class="name">
|
||||
<view class="item_radius"></view>
|
||||
<text>{{item.nickname}}</text>
|
||||
</view>
|
||||
<text>¥{{item.payPrice}}</text>
|
||||
<text class="extra">
|
||||
{{ timestampToTime(item.payTime) }}
|
||||
<view>{{ item.grade }}</view>
|
||||
</text>
|
||||
</view>
|
||||
<text>¥{{item.payPrice | currency}}</text>
|
||||
</view>
|
||||
</u-list-item>
|
||||
</u-list>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-action-sheet :actions="performance" @close="show = false" :closeOnClickOverlay="true" :closeOnClickAction="true" @select="selectClick" :title="title" :show="show"></u-action-sheet>
|
||||
<u-action-sheet :actions="performance" @close="show = false" :closeOnClickOverlay="true" :closeOnClickAction="true"
|
||||
@select="selectClick" :title="title" :show="show"></u-action-sheet>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
@ -100,8 +108,7 @@
|
|||
show: false,
|
||||
title: '业绩',
|
||||
active: 0,
|
||||
performance: [
|
||||
{
|
||||
performance: [{
|
||||
fund: '流水明细',
|
||||
name: '发展会员业绩',
|
||||
fontSize: '30',
|
||||
|
@ -145,6 +152,20 @@
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
timestampToTime(timestamp) {
|
||||
// 时间戳为10位需*1000,时间戳为13位不需乘1000
|
||||
var date = new Date(timestamp);
|
||||
var Y = date.getFullYear() + "-";
|
||||
var M =
|
||||
(date.getMonth() + 1 < 10
|
||||
? "0" + (date.getMonth() + 1)
|
||||
: date.getMonth() + 1) + "-";
|
||||
var D = (date.getDate() < 10 ? "0" + date.getDate() : date.getDate()) + " ";
|
||||
var h = (date.getHours() < 10 ? "0" + date.getHours() : date.getHours()) + ":";
|
||||
var m = (date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes()) + ":";
|
||||
var s = (date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds());
|
||||
return Y + M + D + h + m + s;
|
||||
},
|
||||
selectClick(value) {
|
||||
console.log(value)
|
||||
this.active = value.id
|
||||
|
@ -182,17 +203,21 @@
|
|||
background-repeat: no-repeat;
|
||||
background-attachment: fixed;
|
||||
padding: 0 40rpx;
|
||||
|
||||
::v-deep .u-sticky {
|
||||
background: rgba(255, 255, 255, 0) !important;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.sale_content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.sale_money {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.money_total {
|
||||
margin-bottom: 14rpx;
|
||||
display: flex;
|
||||
|
@ -201,6 +226,7 @@
|
|||
background: url(../../static/images/money_total.png);
|
||||
background-size: 100%;
|
||||
background-repeat: no-repeat;
|
||||
|
||||
.money_left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
@ -212,6 +238,7 @@
|
|||
color: #000000;
|
||||
margin-left: 37rpx;
|
||||
}
|
||||
|
||||
image {
|
||||
margin: 10rpx 0 0 10rpx;
|
||||
width: 100rpx;
|
||||
|
@ -219,6 +246,7 @@
|
|||
align-self: flex-start;
|
||||
}
|
||||
}
|
||||
|
||||
.money_right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
@ -227,6 +255,7 @@
|
|||
font-family: PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #DA2E55;
|
||||
|
||||
text {
|
||||
font-size: 30rpx;
|
||||
font-family: PingFang SC;
|
||||
|
@ -236,6 +265,7 @@
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
.money_statistics {
|
||||
margin-bottom: 14rpx;
|
||||
padding: 19rpx 36rpx 15rpx 19rpx;
|
||||
|
@ -246,6 +276,7 @@
|
|||
align-items: center;
|
||||
justify-content: space-between;
|
||||
position: relative;
|
||||
|
||||
.fillet {
|
||||
width: 23rpx;
|
||||
height: 20rpx;
|
||||
|
@ -253,6 +284,7 @@
|
|||
bottom: 10rpx;
|
||||
right: 10rpx;
|
||||
}
|
||||
|
||||
.money_left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
@ -260,16 +292,19 @@
|
|||
font-family: PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #000000;
|
||||
|
||||
.logo {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
}
|
||||
|
||||
.segmentation {
|
||||
margin: 0 24rpx 0 18rpx;
|
||||
width: 6rpx;
|
||||
height: 43rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.money_right {
|
||||
font-size: 30rpx;
|
||||
font-family: PingFang SC;
|
||||
|
@ -277,35 +312,51 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
.sale_turnover {
|
||||
margin-top: 22rpx;
|
||||
padding: 30rpx 32rpx;
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0px 0px 18rpx 0px rgba(127, 127, 127, 0.08);
|
||||
border-radius: 20rpx;
|
||||
|
||||
.turnover_title {
|
||||
font-size: 32rpx;
|
||||
font-family: PingFang SC;
|
||||
font-weight: 600;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
.turnover_list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.list_item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 29rpx 0;
|
||||
border-bottom: 1px solid #D8D8D8;
|
||||
|
||||
text {
|
||||
font-size: 30rpx;
|
||||
font-family: PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #000000;
|
||||
}
|
||||
view{
|
||||
|
||||
.info-wrap {
|
||||
.extra {
|
||||
display: flex;
|
||||
margin-top: 10rpx;
|
||||
font-size: 26rpx;
|
||||
color: #909399;
|
||||
}
|
||||
|
||||
.name {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.item_radius {
|
||||
margin-right: 19rpx;
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
export function toMoney(num) {
|
||||
if (num) {
|
||||
if (isNaN(num)) {
|
||||
return
|
||||
}
|
||||
num = typeof num == 'string' ? parseFloat(num) : num //判断是否是字符串如果是字符串转成数字
|
||||
num = num.toFixed(2) //保留两位
|
||||
num = parseFloat(num) //转成数字
|
||||
num = num.toLocaleString() //转成金额显示模式
|
||||
//判断是否有小数
|
||||
if (num.indexOf('.') == -1) {
|
||||
num = num + '.00'
|
||||
} else {
|
||||
num = num.split('.')[1].length < 2 ? num + '0' : num
|
||||
}
|
||||
return num //返回的是字符串23,245.12保留2位小数
|
||||
} else {
|
||||
return (num = '0.00')
|
||||
}
|
||||
}
|
||||
|
||||
export function toNum(money) {
|
||||
let num = 0
|
||||
num = money.split(',').join('')
|
||||
return num
|
||||
}
|
||||
|
Loading…
Reference in New Issue