Compare commits

..

No commits in common. "85adfec0dbf3e5747dc46f071275cd14d7210b35" and "4e565346953e511cdf514b590f049eac30894dab" have entirely different histories.

15 changed files with 174 additions and 460 deletions

View File

@ -122,19 +122,6 @@ public class RechargeOrderController {
return success(pageResult); return success(pageResult);
} }
@GetMapping("/promoterDraw-excel")
@Operation(summary = "导出推广员抽佣统计")
@PreAuthorize("@ss.hasPermission('shop:recharge-order:export')")
@OperateLog(type = EXPORT)
@TenantIgnore
public void getRechargeOrderExcel(@Valid PromoterDrawReqExcelVO excelVO, HttpServletResponse response) throws IOException {
if(!TenantContextHolder.ID_SYSTEM.equals(SecurityFrameworkUtils.getLoginUser().getTenantId())){
excelVO.setTenantId(SecurityFrameworkUtils.getLoginUser().getTenantId());
}
List<PromoterDrawExcelVO> list = rechargeOrderService.findPromoterDrawExcel(excelVO);
ExcelUtils.write(response, "推广员抽佣统计.xls", "数据", PromoterDrawExcelVO.class, list);
}
@GetMapping("/export-excel") @GetMapping("/export-excel")
@Operation(summary = "导出订单 Excel") @Operation(summary = "导出订单 Excel")

View File

@ -1,36 +0,0 @@
package cn.iocoder.yudao.module.shop.controller.admin.recharge.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;
@Data
public class PromoterDrawExcelVO {
@ExcelProperty( "组织名称")
private String deptName;
@ExcelProperty( "组织结构名称")
private String parentOrganizationName;
@ExcelProperty( "推广员名称")
private String nickname;
@ExcelProperty( "手机号")
private String mobile;
@ExcelProperty( "成为推广员时间")
private LocalDateTime createTime;
@ExcelProperty( "会员提成")
private Integer memberCommission;
@ExcelProperty( "商品提成")
private Integer goodsCommission;
@ExcelProperty( "成交定单数")
private BigDecimal orderCount;
@ExcelProperty( "可提现金额")
private BigDecimal drawAmount;
@ExcelProperty( "成交金额")
private BigDecimal dealAmount;
@ExcelProperty( "累计金额")
private BigDecimal totalAmount;
}

View File

@ -1,34 +0,0 @@
package cn.iocoder.yudao.module.shop.controller.admin.recharge.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Data
public class PromoterDrawReqExcelVO implements Serializable {
private static final long serialVersionUID = -3999440180896951708L;
private Long tenantId;
@Schema(description = "商户名称")
private String deptName;
@Schema(description = "组织结构名称")
private String parentOrganizationName;
@Schema(description = "推广员名称")
private String nickname;
@Schema(description = "手机号")
private String mobile;
@Schema(description = "成为推广员时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

View File

@ -6,6 +6,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@ -28,7 +29,7 @@ public class PromoterDrawReqVO extends PageParam {
@Schema(description = "成为推广员时间") @Schema(description = "成为推广员时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime; private LocalDateTime[] createTime;
@Schema(description = "排序1升序2降序")
private String sort;
} }

View File

@ -62,7 +62,6 @@ public interface RechargeOrderMapper extends BaseMapperX<RechargeOrderDO> {
IPage<RechargeOrderRespVO> findListPage(IPage<RechargeOrderRespVO> page, @Param("data") RechargeOrderPageReqVO data); IPage<RechargeOrderRespVO> findListPage(IPage<RechargeOrderRespVO> page, @Param("data") RechargeOrderPageReqVO data);
IPage<PromoterDrawVO> findPromoterDrawPage(IPage<PromoterDrawVO> page, @Param("data") PromoterDrawReqVO data); IPage<PromoterDrawVO> findPromoterDrawPage(IPage<PromoterDrawVO> page, @Param("data") PromoterDrawReqVO data);
List<PromoterDrawExcelVO> findPromoterDrawExcel(@Param("data") PromoterDrawReqExcelVO data);
List<PromoterDrawVO> findPromoterDrawCount(@Param("promoterIds") List<Long> promoterIds); List<PromoterDrawVO> findPromoterDrawCount(@Param("promoterIds") List<Long> promoterIds);
BigDecimal promoterOrderCount(@Param("startDate") LocalDateTime startDate, @Param("endDate")LocalDateTime endDate,@Param("promoterId") Long promoterId); BigDecimal promoterOrderCount(@Param("startDate") LocalDateTime startDate, @Param("endDate")LocalDateTime endDate,@Param("promoterId") Long promoterId);

View File

@ -89,6 +89,4 @@ public interface RechargeOrderService {
Boolean memberChangeTie(MemberChangeTieRequest changeTieRequest); Boolean memberChangeTie(MemberChangeTieRequest changeTieRequest);
ShoppingMemberOrderVO shoppingOrderCount(Integer type, Long loginUserId); ShoppingMemberOrderVO shoppingOrderCount(Integer type, Long loginUserId);
List<PromoterDrawExcelVO> findPromoterDrawExcel(PromoterDrawReqExcelVO excelVO);
} }

View File

@ -20,7 +20,6 @@ import cn.iocoder.yudao.module.system.api.tenant.TenantApi;
import cn.iocoder.yudao.module.system.api.tenant.dto.TenantDTO; import cn.iocoder.yudao.module.system.api.tenant.dto.TenantDTO;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -133,52 +132,31 @@ public class RechargeOrderServiceImpl implements RechargeOrderService {
return new PageResult<>(page.getRecords(), page.getTotal()); return new PageResult<>(page.getRecords(), page.getTotal());
} }
@Override @Override
public List<PromoterDrawExcelVO> findPromoterDrawExcel(PromoterDrawReqExcelVO excelVO) {
return rechargeOrderMapper.findPromoterDrawExcel(excelVO);
}
@Override
public PageResult<PromoterDrawVO> findPromoterDrawPage(PromoterDrawReqVO pageReqVO) { public PageResult<PromoterDrawVO> findPromoterDrawPage(PromoterDrawReqVO pageReqVO) {
Page<PromoterDrawVO> page = new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize()); Page<PromoterDrawVO> page = new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize());
if (Objects.nonNull(pageReqVO.getSort())&& StringUtils.equals("2",pageReqVO.getSort())) {
pageReqVO.setSort(null);
}
rechargeOrderMapper.findPromoterDrawPage(page, pageReqVO); rechargeOrderMapper.findPromoterDrawPage(page, pageReqVO);
List<PromoterDrawVO> list = page.getRecords(); List<PromoterDrawVO> list = page.getRecords();
if (list != null && list.size() > 0) { if (list != null && list.size() > 0) {
// List<Long> collect1 = list.stream().map(PromoterDrawVO::getUserId).collect(Collectors.toList()); List<Long> collect1 = list.stream().map(PromoterDrawVO::getUserId).collect(Collectors.toList());
// List<PromoterDrawVO> promoterDrawVOList = rechargeOrderMapper.findPromoterDrawCount(collect1); List<PromoterDrawVO> promoterDrawVOList = rechargeOrderMapper.findPromoterDrawCount(collect1);
// Map<Long, PromoterDrawVO> nameList = promoterDrawVOList.stream().collect(toMap(PromoterDrawVO::getUserId, value -> value, (value1, value2) -> value1)); Map<Long, PromoterDrawVO> nameList = promoterDrawVOList.stream().collect(toMap(PromoterDrawVO::getUserId, value -> value, (value1, value2) -> value1));
list.forEach(promoterDrawVO -> { list.forEach(promoterDrawVO -> {
if (promoterDrawVO.getMemberCommission() == null) { PromoterDrawVO promoterDrawNew = nameList.get(promoterDrawVO.getUserId());
promoterDrawVO.setMemberCommission(0); if (promoterDrawNew != null) {
} promoterDrawVO.setDealAmount(promoterDrawNew.getDealAmount());
if (promoterDrawVO.getTotalAmount() == null) { promoterDrawVO.setTotalAmount(promoterDrawNew.getTotalAmount());
promoterDrawVO.setTotalAmount(new BigDecimal(0)); promoterDrawVO.setOrderCount(promoterDrawNew.getOrderCount());
} if (promoterDrawVO.getMemberCommission() == null) {
if (promoterDrawVO.getDealAmount() == null) { promoterDrawVO.setMemberCommission(0);
}
promoterDrawVO.setDrawAmount(NumberUtil.mul(promoterDrawNew.getDealAmount(), NumberUtil.div(promoterDrawVO.getMemberCommission().toString(), "100"), 2));
} else {
promoterDrawVO.setDealAmount(new BigDecimal(0)); promoterDrawVO.setDealAmount(new BigDecimal(0));
} promoterDrawVO.setTotalAmount(new BigDecimal(0));
if (promoterDrawVO.getOrderCount() == null) {
promoterDrawVO.setOrderCount(new BigDecimal(0)); promoterDrawVO.setOrderCount(new BigDecimal(0));
promoterDrawVO.setMemberCommission(0);
promoterDrawVO.setDrawAmount(new BigDecimal(0));
} }
promoterDrawVO.setDrawAmount(NumberUtil.mul(promoterDrawVO.getDealAmount(), NumberUtil.div(promoterDrawVO.getMemberCommission().toString(), "100"), 2));
// PromoterDrawVO promoterDrawNew = nameList.get(promoterDrawVO.getUserId());
// if (promoterDrawNew != null) {
// promoterDrawVO.setDealAmount(promoterDrawNew.getDealAmount());
// promoterDrawVO.setTotalAmount(promoterDrawNew.getTotalAmount());
// promoterDrawVO.setOrderCount(promoterDrawNew.getOrderCount());
// if (promoterDrawVO.getMemberCommission() == null) {
// promoterDrawVO.setMemberCommission(0);
// }
// promoterDrawVO.setDrawAmount(NumberUtil.mul(promoterDrawNew.getDealAmount(), NumberUtil.div(promoterDrawVO.getMemberCommission().toString(), "100"), 2));
// } else {
// promoterDrawVO.setDealAmount(new BigDecimal(0));
// promoterDrawVO.setTotalAmount(new BigDecimal(0));
// promoterDrawVO.setOrderCount(new BigDecimal(0));
// promoterDrawVO.setMemberCommission(0);
// promoterDrawVO.setDrawAmount(new BigDecimal(0));
// }
}); });
} }
return new PageResult<>(list, page.getTotal()); return new PageResult<>(list, page.getTotal());
@ -380,5 +358,4 @@ public class RechargeOrderServiceImpl implements RechargeOrderService {
return shoppingMemberOrderVO; return shoppingMemberOrderVO;
} }
} }

View File

@ -10,31 +10,23 @@
--> -->
<select id="findPromoterDrawPage" <select id="findPromoterDrawPage" resultType="cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.PromoterDrawVO">
resultType="cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.PromoterDrawVO">
SELECT SELECT
x1.*, a.user_id,
x2.order_count, a.dept_id,
x2.deal_amount, a.tenant_id,
x2.total_amount c.`name`as dept_name,
c.parent_organization_name,
d.nickname,
d.mobile,
a.create_time,
b.member_commission,
b.goods_commission
FROM FROM
( member_promoter a
SELECT LEFT JOIN system_dept c on c.id= a.dept_id
a.user_id, LEFT JOIN member_user d on d.id=a.user_id
a.dept_id, LEFT JOIN system_tenant b on b.id=a.tenant_id
a.tenant_id,
c.`name` AS dept_name,
c.parent_organization_name,
d.nickname,
d.mobile,
a.create_time,
b.member_commission,
b.goods_commission
FROM
member_promoter a
LEFT JOIN system_dept c ON c.id = a.dept_id
LEFT JOIN member_user d ON d.id = a.user_id
LEFT JOIN system_tenant b ON b.id = a.tenant_id
<where> <where>
<if test="data.tenantId!=null"> <if test="data.tenantId!=null">
and a.tenant_id=#{data.tenantId} and a.tenant_id=#{data.tenantId}
@ -55,50 +47,29 @@
and a.create_time &lt;=#{data.createTime[1]} and a.create_time &lt;=#{data.createTime[1]}
</if> </if>
</where> </where>
) x1
LEFT JOIN (
SELECT
b.promoter_id AS user_id,
count( CASE b.paid = 1 WHEN 1 THEN 0 END ) AS order_count,
sum( CASE WHEN b.paid = 1 THEN b.pay_price ELSE 0 END ) AS deal_amount,
sum( CASE WHEN b.paid IN ( 1, 2 ) THEN b.pay_price ELSE 0 END ) AS total_amount
FROM
cy_recharge_order b
GROUP BY
b.promoter_id
) x2 ON x1.user_id = x2.user_id
<choose>
<when test="data.sort !=null and data.sort!=''">
ORDER BY x2.total_amount ASC
</when>
<otherwise>
ORDER BY x2.total_amount DESC
</otherwise>
</choose>
</select> </select>
<select id="findPromoterDrawCount" <select id="findPromoterDrawCount" resultType="cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.PromoterDrawVO">
resultType="cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.PromoterDrawVO">
SELECT SELECT
b.promoter_id AS user_id, b.promoter_id AS user_id,
count( CASE b.paid = 1 WHEN 1 THEN 0 END) AS order_count, count( CASE b.paid = 1 WHEN 1 THEN 0 END) AS order_count,
sum( CASE WHEN b.paid = 1 THEN b.pay_price ELSE 0 END ) AS deal_amount, sum( CASE WHEN b.paid = 1 THEN b.pay_price ELSE 0 END ) AS deal_amount,
sum( CASE WHEN b.paid IN ( 1, 2 ) THEN b.pay_price ELSE 0 END ) AS total_amount sum( CASE WHEN b.paid IN ( 1, 2 ) THEN b.pay_price ELSE 0 END ) AS total_amount
FROM FROM
cy_recharge_order b cy_recharge_order b
<where> <where>
<if test="promoterIds!=null and promoterIds.size()>0"> <if test="promoterIds!=null and promoterIds.size()>0">
and b.promoter_id in and b.promoter_id in
<foreach collection="promoterIds" separator="," open="(" close=")" item="id"> <foreach collection="promoterIds" separator="," open="(" close=")" item="id">
#{id} #{id}
</foreach> </foreach>
</if> </if>
</where> </where>
GROUP BY b.promoter_id GROUP BY b.promoter_id
</select> </select>
<select id="findListPage"
resultType="cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.RechargeOrderRespVO"> <select id="findListPage" resultType="cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.RechargeOrderRespVO">
select select
a.order_id, a.order_id,
a.pay_serial_number, a.pay_serial_number,
@ -137,8 +108,7 @@
</where> </where>
</select> </select>
<select id="findListExcel" <select id="findListExcel" resultType="cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.RechargeOrderExcelVO">
resultType="cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.RechargeOrderExcelVO">
select select
a.id, a.id,
a.order_id, a.order_id,
@ -166,65 +136,6 @@
<include refid="baseWhere"> <include refid="baseWhere">
</include> </include>
</select> </select>
<select id="findPromoterDrawExcel"
resultType="cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.PromoterDrawExcelVO">
SELECT
x1.*,
x2.order_count,
x2.deal_amount,
x2.total_amount
FROM
(
SELECT
a.user_id,
a.dept_id,
a.tenant_id,
c.`name` AS dept_name,
c.parent_organization_name,
d.nickname,
d.mobile,
a.create_time,
b.member_commission,
b.goods_commission
FROM
member_promoter a
LEFT JOIN system_dept c ON c.id = a.dept_id
LEFT JOIN member_user d ON d.id = a.user_id
LEFT JOIN system_tenant b ON b.id = a.tenant_id
<where>
<if test="data.tenantId!=null">
and a.tenant_id=#{data.tenantId}
</if>
<if test="data.parentOrganizationName!=null and data.parentOrganizationName!=''">
and c.parent_Organization_name like CONCAT('%',#{data.parentOrganizationName},'%')
</if>
<if test="data.mobile!=null and data.mobile!=''">
and d.mobile like CONCAT('%',#{data.mobile},'%')
</if>
<if test="data.nickname!=null and data.nickname!=''">
and d.nickname like CONCAT('%',#{data.nickname},'%')
</if>
<if test="data.createTime !=null and data.createTime.length>=1">
and a.create_time &gt;=#{data.createTime[0]}
</if>
<if test="data.createTime !=null and data.createTime.length>=2">
and a.create_time &lt;=#{data.createTime[1]}
</if>
</where>
) x1
LEFT JOIN (
SELECT
b.promoter_id AS user_id,
count( CASE b.paid = 1 WHEN 1 THEN 0 END ) AS order_count,
sum( CASE WHEN b.paid = 1 THEN b.pay_price ELSE 0 END ) AS deal_amount,
sum( CASE WHEN b.paid IN ( 1, 2 ) THEN b.pay_price ELSE 0 END ) AS total_amount
FROM
cy_recharge_order b
GROUP BY
b.promoter_id
) x2 ON x1.user_id = x2.user_id ORDER BY x2.total_amount DESC
</select>
<sql id="baseWhere"> <sql id="baseWhere">
<where> <where>
<if test="data.orderId !=null and data.orderId!=''"> <if test="data.orderId !=null and data.orderId!=''">

View File

@ -3,7 +3,6 @@ import App from './App'
import store from './store' import store from './store'
import Cache from './utils/cache' import Cache from './utils/cache'
import util from 'utils/util' import util from 'utils/util'
import * as Amount from 'utils/money'
import configs from './config/app.js' import configs from './config/app.js'
import * as Order from './libs/order'; import * as Order from './libs/order';
@ -14,10 +13,6 @@ Vue.prototype.$eventHub = new Vue();
Vue.config.productionTip = false Vue.config.productionTip = false
Vue.prototype.$Order = Order; Vue.prototype.$Order = Order;
Vue.filter('currency', function (value) {
return Amount.toMoney(value)
})
// #ifdef H5 // #ifdef H5
import { parseQuery } from "./utils"; import { parseQuery } from "./utils";
import Auth from './libs/wechat'; import Auth from './libs/wechat';

View File

@ -840,14 +840,12 @@
// } // }
query.select(idView).boundingClientRect(); query.select(idView).boundingClientRect();
query.exec(function(res) { query.exec(function(res) {
if(Array.isArray(res) && res.length > 0 && res[0]){ var top = res[0].top;
var top = res[0].top; var height = res[0].height;
var height = res[0].height; topArr.push(top);
topArr.push(top); heightArr.push(height);
heightArr.push(height); that.$set(that, 'topArr', topArr);
that.$set(that, 'topArr', topArr); that.$set(that, 'heightArr', heightArr);
that.$set(that, 'heightArr', heightArr);
}
}); });
}; };
}, },

View File

@ -1,85 +1,77 @@
<template> <template>
<view class="box"> <view class="box">
<u-navbar autoBack :title="performance[active].name" bgColor="rgba(255,255,255,0)" :placeholder="true" <u-navbar autoBack :title="performance[active].name" bgColor="rgba(255,255,255,0)" :placeholder="true" leftIconSize="40"
leftIconSize="40" leftIconColor="#fff" titleStyle="font-size:35rpx;color:#fff"> leftIconColor="#fff" titleStyle="font-size:35rpx;color:#fff">
<!-- <view slot="right"> <!-- <view slot="right">
<u-icon name="more-dot-fill" color="#fff" @click="show = true"></u-icon> <u-icon name="more-dot-fill" color="#fff" @click="show = true"></u-icon>
</view> --> </view> -->
</u-navbar> </u-navbar>
<u-sticky bgColor="#fff"> <u-sticky bgColor="#fff">
<u-tabs @change="handleChange" :list="list" itemStyle=" padding-left: 46rpx; padding-right: 46rpx; height: 46px;" <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>
lineColor="#DA2E55" lineWidth="48rpx" lineHeight="10rpx" :activeStyle="activeStyle"
:inactiveStyle="inactiveStyle"></u-tabs>
</u-sticky> </u-sticky>
<view class="sale_content"> <view class="sale_content">
<view class="sale_money"> <view class="sale_money">
<view class="money_total"> <view class="money_total">
<view class="money_left"> <view class="money_left">
<image src="../../static/images/money1.png"></image> <image src="../../static/images/money1.png" ></image>
<text>总计金额</text> <text>总计金额</text>
</view> </view>
<view class="money_right"><text></text>{{orderDetail.totalAmount | currency}}</view> <view class="money_right"><text></text>{{orderDetail.totalAmount}}</view>
</view> </view>
<view class="money_statistics"> <view class="money_statistics">
<view class="money_left"> <view class="money_left">
<image class="logo" src="../../static/images/money2.png"></image> <image class="logo" src="../../static/images/money2.png" ></image>
<view class="segmentation" <view class="segmentation" style="background: linear-gradient(0deg, #FFFFFF 0%, #FFE0C5 47%, #FFFFFF 100%);"></view>
style="background: linear-gradient(0deg, #FFFFFF 0%, #FFE0C5 47%, #FFFFFF 100%);"></view>
<text>已发展会员个数</text> <text>已发展会员个数</text>
</view> </view>
<view class="money_right" style="color: #FF4800;">{{orderDetail.memberCount}}</view> <view class="money_right" style="color: #FF4800;">{{orderDetail.memberCount}}</view>
<image class="fillet" src="../../static/images/fillet1.png"></image> <image class="fillet" src="../../static/images/fillet1.png" ></image>
</view>
<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>
<text>提成比例</text>
</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>
<text>预计提成金额</text>
</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>
<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>
<text>提成比例</text>
</view>
<view class="money_right" style="color: #1082FF;">{{orderDetail.memberCommission}}%</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>
<text>预计提成金额</text>
</view>
<view class="money_right" style="color: #32A84F;">{{parseFloat(orderDetail.totalAmount*(parseFloat(orderDetail.memberCommission) / 100))}}</view>
<image class="fillet" src="../../static/images/fillet3.png" ></image>
</view>
</view> </view>
<view class="sale_turnover"> <view class="sale_turnover">
<view class="turnover_title"> <view class="turnover_title">
{{performance[active].fund}} {{performance[active].fund}}
</view> </view>
<view class="turnover_list"> <view class="turnover_list">
<u-list height="500" @scrolltolower="scrolltolower"> <u-list
<u-list-item v-for="(item, index) in orderData" :key="index"> height="500"
<view class="list_item"> @scrolltolower="scrolltolower"
<view class="info-wrap"> >
<view class="name"> <u-list-item
<view class="item_radius"></view> v-for="(item, index) in orderData"
<text>{{item.nickname}}</text> :key="index"
</view> >
<text class="extra"> <view class="list_item">
{{ timestampToTime(item.payTime) }} <view>
<view>{{ item.grade }}</view> <view class="item_radius"></view>
</text> <text>{{item.nickname}}</text>
</view> </view>
<text>{{item.payPrice | currency}}</text> <text>{{item.payPrice}}</text>
</view> </view>
</u-list-item> </u-list-item>
</u-list> </u-list>
</view> </view>
</view> </view>
</view> </view>
<u-action-sheet :actions="performance" @close="show = false" :closeOnClickOverlay="true" :closeOnClickAction="true" <u-action-sheet :actions="performance" @close="show = false" :closeOnClickOverlay="true" :closeOnClickAction="true" @select="selectClick" :title="title" :show="show"></u-action-sheet>
@select="selectClick" :title="title" :show="show"></u-action-sheet>
</view> </view>
</template> </template>
@ -93,34 +85,35 @@
name: "sale_performance", name: "sale_performance",
data() { data() {
return { return {
activeStyle: { activeStyle:{
fontSize: '34rpx', fontSize: '34rpx',
fontFamily: 'PingFang SC', fontFamily: 'PingFang SC',
fontWeight: '400', fontWeight: '400',
color: '#DA2E55' color: '#DA2E55'
}, },
inactiveStyle: { inactiveStyle:{
fontSize: '30rpx', fontSize: '30rpx',
fontFamily: 'PingFang SC', fontFamily: 'PingFang SC',
fontWeight: '400', fontWeight: '400',
color: '#fff' color: '#fff'
}, },
show: false, show:false,
title: '业绩', title:'业绩',
active: 0, active:0,
performance: [{ performance: [
fund: '流水明细', {
name: '发展会员业绩', fund:'流水明细',
fontSize: '30', name:'发展会员业绩',
id: 0 fontSize:'30',
}, id:0
{ },
fund: '订单流水', {
name: '商品订单业绩', fund:'订单流水',
fontSize: '30', name: '商品订单业绩',
id: 1 fontSize:'30',
}, id:1
], },
],
list: [{ list: [{
name: '今日', name: '今日',
}, { }, {
@ -130,13 +123,13 @@
}, { }, {
name: '累计' name: '累计'
}], }],
pageData: { pageData:{
pageNo: 1, pageNo:1,
pageSize: 10 pageSize:10
}, },
orderDetail: {}, orderDetail:{},
orderData: [], orderData:[],
total: 0 total:0
}; };
}, },
@ -152,44 +145,30 @@
} }
}, },
methods: { methods: {
timestampToTime(timestamp) { selectClick(value){
// 10*1000131000
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) console.log(value)
this.active = value.id this.active = value.id
}, },
async scrolltolower() { async scrolltolower() {
if (this.total > this.orderData.length) { if(this.total>this.orderData.length){
this.pageData.pageNo++ this.pageData.pageNo++
await this.orderInfo(true) await this.orderInfo(true)
} }
}, },
async orderInfo(bool = true) { async orderInfo(bool=true){
const res = await promoterOrderInfo(this.pageData) const res = await promoterOrderInfo(this.pageData)
this.orderData = bool ? this.orderData.concat(res.data.list) : this.orderData = res.data.list this.orderData = bool? this.orderData.concat(res.data.list):this.orderData = res.data.list
this.total = res.data.total this.total = res.data.total
}, },
async orderCount(index) { async orderCount(index){
const res = await promoterOrderCount(index + 1) const res = await promoterOrderCount(index+1)
this.orderDetail = res.data this.orderDetail = res.data
}, },
async handleChange(value) { async handleChange(value){
this.pageData.pageNo = 1 this.pageData.pageNo = 1
await this.orderCount(value.index) await this.orderCount(value.index)
await this.orderInfo(false) await this.orderInfo(false)
} }
} }
}; };
</script> </script>
@ -203,22 +182,18 @@
background-repeat: no-repeat; background-repeat: no-repeat;
background-attachment: fixed; background-attachment: fixed;
padding: 0 40rpx; padding: 0 40rpx;
::v-deep .u-sticky{
::v-deep .u-sticky {
background: rgba(255, 255, 255, 0) !important; background: rgba(255, 255, 255, 0) !important;
display: flex; display: flex;
justify-content: center; justify-content: center;
} }
.sale_content{
.sale_content {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.sale_money{
.sale_money {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.money_total{
.money_total {
margin-bottom: 14rpx; margin-bottom: 14rpx;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
@ -226,28 +201,25 @@
background: url(../../static/images/money_total.png); background: url(../../static/images/money_total.png);
background-size: 100%; background-size: 100%;
background-repeat: no-repeat; background-repeat: no-repeat;
.money_left{
.money_left {
display: flex; display: flex;
align-items: center; align-items: center;
text { text{
font-size: 30rpx; font-size: 30rpx;
font-family: PingFang SC; font-family: PingFang SC;
font-weight: 400; font-weight: 400;
color: #000000; color: #000000;
margin-left: 37rpx; margin-left: 37rpx;
} }
image{
image { margin:10rpx 0 0 10rpx;
margin: 10rpx 0 0 10rpx;
width: 100rpx; width: 100rpx;
height: 111rpx; height: 111rpx;
align-self: flex-start; align-self: flex-start;
} }
} }
.money_right{
.money_right {
display: flex; display: flex;
align-items: center; align-items: center;
margin-right: 48rpx; margin-right: 48rpx;
@ -255,8 +227,7 @@
font-family: PingFang SC; font-family: PingFang SC;
font-weight: 400; font-weight: 400;
color: #DA2E55; color: #DA2E55;
text{
text {
font-size: 30rpx; font-size: 30rpx;
font-family: PingFang SC; font-family: PingFang SC;
font-weight: 400; font-weight: 400;
@ -265,100 +236,78 @@
} }
} }
.money_statistics{
.money_statistics {
margin-bottom: 14rpx; margin-bottom: 14rpx;
padding: 19rpx 36rpx 15rpx 19rpx; padding: 19rpx 36rpx 15rpx 19rpx;
background: #FFFFFF; background: #FFFFFF;
box-shadow: 0px 0px 18rpx 0px rgba(127, 127, 127, 0.08); box-shadow: 0px 0px 18rpx 0px rgba(127,127,127,0.08);
border-radius: 20rpx; border-radius: 20rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
position: relative; position: relative;
.fillet{
.fillet {
width: 23rpx; width: 23rpx;
height: 20rpx; height: 20rpx;
position: absolute; position: absolute;
bottom: 10rpx; bottom: 10rpx;
right: 10rpx; right: 10rpx;
} }
.money_left{
.money_left {
display: flex; display: flex;
align-items: center; align-items: center;
font-size: 28rpx; font-size: 28rpx;
font-family: PingFang SC; font-family: PingFang SC;
font-weight: 400; font-weight: 400;
color: #000000; color: #000000;
.logo{
.logo {
width: 80rpx; width: 80rpx;
height: 80rpx; height: 80rpx;
} }
.segmentation{
.segmentation { margin: 0 24rpx 0 18rpx;
margin: 0 24rpx 0 18rpx; width: 6rpx;
width: 6rpx; height: 43rpx;
height: 43rpx;
} }
} }
.money_right{
.money_right {
font-size: 30rpx; font-size: 30rpx;
font-family: PingFang SC; font-family: PingFang SC;
font-weight: 400; font-weight: 400;
} }
} }
} }
.sale_turnover{
.sale_turnover {
margin-top: 22rpx; margin-top: 22rpx;
padding: 30rpx 32rpx; padding: 30rpx 32rpx;
background: #FFFFFF; background: #FFFFFF;
box-shadow: 0px 0px 18rpx 0px rgba(127, 127, 127, 0.08); box-shadow: 0px 0px 18rpx 0px rgba(127,127,127,0.08);
border-radius: 20rpx; border-radius: 20rpx;
.turnover_title{
.turnover_title {
font-size: 32rpx; font-size: 32rpx;
font-family: PingFang SC; font-family: PingFang SC;
font-weight: 600; font-weight: 600;
color: #000000; color: #000000;
} }
.turnover_list{
.turnover_list {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.list_item{
.list_item {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center;
padding: 29rpx 0; padding: 29rpx 0;
border-bottom: 1px solid #D8D8D8; border-bottom: 1px solid #D8D8D8;
text{
text {
font-size: 30rpx; font-size: 30rpx;
font-family: PingFang SC; font-family: PingFang SC;
font-weight: 400; font-weight: 400;
color: #000000; color: #000000;
} }
view{
display: flex;
align-items: center;
.info-wrap { .item_radius{
.extra {
display: flex;
margin-top: 10rpx;
font-size: 26rpx;
color: #909399;
}
.name {
display: flex;
align-items: center;
}
.item_radius {
margin-right: 19rpx; margin-right: 19rpx;
width: 10rpx; width: 10rpx;
height: 10rpx; height: 10rpx;

View File

@ -97,10 +97,6 @@
@click="jumpPage('/pages/users/user_spread_code/index')"> @click="jumpPage('/pages/users/user_spread_code/index')">
<u-icon slot="icon" size="45" name="/static/images/user_icon2.png"></u-icon> <u-icon slot="icon" size="45" name="/static/images/user_icon2.png"></u-icon>
</u-cell> </u-cell>
<u-cell title="销售业绩" v-if="userInfo.userType === 'PROMOTER'" isLink
@click="jumpPage('/pages/sale_performance/index')">
<u-icon slot="icon" size="45" name="/static/images/user_icon5.png"></u-icon>
</u-cell>
<u-cell title="热线电话" value="400-8009935" isLink @click="callPhone"> <u-cell title="热线电话" value="400-8009935" isLink @click="callPhone">
<u-icon slot="icon" size="45" name="/static/images/user_icon3.png"></u-icon> <u-icon slot="icon" size="45" name="/static/images/user_icon3.png"></u-icon>
</u-cell> </u-cell>

View File

@ -24,7 +24,7 @@
</view> </view>
<view class="extra-item"> <view class="extra-item">
<view class="text"><span></span>客服联系电话</view> <view class="text"><span></span>客服联系电话</view>
<view class="text service-phone">400-8009935</view> <view class="text service-phone">{{tenantInfo.serviceMobile}}</view>
</view> </view>
</view> </view>
</view> </view>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

View File

@ -1,27 +0,0 @@
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
}