Merge remote-tracking branch 'origin/feature/mall_product' into feature/mall_product

# Conflicts:
#	yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/app/member/MemberController.java
#	yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/RechargeOrderServiceImpl.java
pull/2/head
tangqian 2023-05-29 14:59:06 +08:00
commit 7709370ca5
39 changed files with 445 additions and 63 deletions

View File

@ -133,6 +133,7 @@ public class RechargeOrderController {
@PreAuthenticated @PreAuthenticated
@Operation(summary = "退款") @Operation(summary = "退款")
@RequestMapping(value = "/memberRefund", method = RequestMethod.POST) @RequestMapping(value = "/memberRefund", method = RequestMethod.POST)
@PreAuthorize("@ss.hasPermission('shop:recharge-order:refund')")
public CommonResult<Object> memberRefund(@Valid @RequestBody RefundRequest request, HttpServletRequest servletRequest) throws Exception { public CommonResult<Object> memberRefund(@Valid @RequestBody RefundRequest request, HttpServletRequest servletRequest) throws Exception {
log.info("memberRefund会员退款===>{}", request); log.info("memberRefund会员退款===>{}", request);
Object obj=null; Object obj=null;

View File

@ -126,6 +126,10 @@ public class RechargeOrderPageReqVO extends PageParam {
@Schema(description = "第三方支付流水号") @Schema(description = "第三方支付流水号")
private String paySerialNumber; private String paySerialNumber;
/**
* 广id
*/
@Schema(description = "推广员id")
private Long promoterId;
} }

View File

@ -1,11 +1,14 @@
package cn.iocoder.yudao.module.shop.controller.app.member; package cn.iocoder.yudao.module.shop.controller.app.member;
import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated; import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore; import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
import cn.iocoder.yudao.module.member.api.user.MemberUserApi;
import cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.RechargeGearRespVO; import cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.RechargeGearRespVO;
import cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.RechargeOrderPageReqVO;
import cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.RechargeOrderRespVO; import cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.RechargeOrderRespVO;
import cn.iocoder.yudao.module.shop.controller.app.member.vo.PromoterMemberOrderVO;
import cn.iocoder.yudao.module.shop.convert.recharge.RechargeOrderConvert; import cn.iocoder.yudao.module.shop.convert.recharge.RechargeOrderConvert;
import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.RechargeOrderDO; import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.RechargeOrderDO;
import cn.iocoder.yudao.module.shop.request.member.MemberChangeTieRequest; import cn.iocoder.yudao.module.shop.request.member.MemberChangeTieRequest;
@ -21,6 +24,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.*;
import java.util.List; import java.util.List;
@ -60,6 +64,22 @@ public class MemberController {
public CommonResult<List<RechargeOrderRespVO>> memberOrderInfo() { public CommonResult<List<RechargeOrderRespVO>> memberOrderInfo() {
return CommonResult.success(rechargeOrderService.memberOrderInfo()); return CommonResult.success(rechargeOrderService.memberOrderInfo());
} }
@Operation(summary = "获取当前登录账号的推广员推广会员记录")
@RequestMapping(value = "/promoterOrderInfo", method = RequestMethod.POST)
@PreAuthenticated
@TenantIgnore
public CommonResult<PageResult<RechargeOrderRespVO>> promoterOrderInfo(@RequestBody RechargeOrderPageReqVO pageRespVO) {
pageRespVO.setPromoterId(SecurityFrameworkUtils.getLoginUserId());
return CommonResult.success(rechargeOrderService.promoterOrderInfo(pageRespVO));
}
@Operation(summary = "获取当前登录发展会员数量统计")
@RequestMapping(value = "/promoterOrderCount", method = RequestMethod.GET)
@PreAuthenticated
@TenantIgnore
@Parameter(name = "type", description = "时间类型1、当日2、上周3、上月4、累计", required = true)
public CommonResult<PromoterMemberOrderVO> promoterOrderCount(@RequestParam Integer type) {
return CommonResult.success(rechargeOrderService.promoterOrderCount(type,SecurityFrameworkUtils.getLoginUserId()));
}
@Operation(summary = "会员头部信息") @Operation(summary = "会员头部信息")
@RequestMapping(value = "/memberHeadInfo", method = RequestMethod.GET) @RequestMapping(value = "/memberHeadInfo", method = RequestMethod.GET)
@PreAuthenticated @PreAuthenticated

View File

@ -0,0 +1,18 @@
package cn.iocoder.yudao.module.shop.controller.app.member.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.math.BigDecimal;
@Data
@Schema(description = "会员发展数量统计")
public class PromoterMemberOrderVO {
@Schema(description = "总金额")
private Long memberCount;
@Schema(description = "总金额")
private BigDecimal totalAmount;
@Schema(description = "会员提成")
private Integer memberCommission;
}

View File

@ -1,5 +1,7 @@
package cn.iocoder.yudao.module.shop.dal.mysql.recharge; package cn.iocoder.yudao.module.shop.dal.mysql.recharge;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.*; import java.util.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
@ -10,6 +12,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.*; import cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.*;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
/** /**
* Mapper * Mapper
@ -57,7 +60,7 @@ public interface RechargeOrderMapper extends BaseMapperX<RechargeOrderDO> {
.orderByDesc(RechargeOrderDO::getId)); .orderByDesc(RechargeOrderDO::getId));
} }
IPage<RechargeOrderRespVO> findListPage(IPage<RechargeOrderRespVO> page, @Param("data") RechargeOrderPageReqVO data); IPage<RechargeOrderRespVO> findListPage(IPage<RechargeOrderRespVO> page, @Param("data") RechargeOrderPageReqVO data);
BigDecimal promoterOrderCount(@Param("startDate") LocalDateTime startDate, @Param("endDate")LocalDateTime endDate,@Param("promoterId") Long promoterId);
List<RechargeOrderExcelVO> findListExcel(@Param("data") RechargeOrderExportReqVO data); List<RechargeOrderExcelVO> findListExcel(@Param("data") RechargeOrderExportReqVO data);
default List<RechargeOrderDO> selectList(RechargeOrderExportReqVO reqVO) { default List<RechargeOrderDO> selectList(RechargeOrderExportReqVO reqVO) {

View File

@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.shop.service.recharge;
import java.util.*; import java.util.*;
import javax.validation.*; import javax.validation.*;
import cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.*; import cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.*;
import cn.iocoder.yudao.module.shop.controller.app.member.vo.PromoterMemberOrderVO;
import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.RechargeOrderDO; import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.RechargeOrderDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.shop.request.member.MemberChangeTieRequest; import cn.iocoder.yudao.module.shop.request.member.MemberChangeTieRequest;
@ -76,6 +77,10 @@ public interface RechargeOrderService {
List<RechargeOrderRespVO> memberOrderInfo(); List<RechargeOrderRespVO> memberOrderInfo();
PageResult<RechargeOrderRespVO> promoterOrderInfo(RechargeOrderPageReqVO pageRespVO);
PromoterMemberOrderVO promoterOrderCount(Integer type,Long promoterId);
MemberHeadResponse memberHeadInfo(); MemberHeadResponse memberHeadInfo();
List<RechargeOrderRespVO> memberOrderInfoByPhone(String phone); List<RechargeOrderRespVO> memberOrderInfoByPhone(String phone);

View File

@ -1,14 +1,20 @@
package cn.iocoder.yudao.module.shop.service.recharge; package cn.iocoder.yudao.module.shop.service.recharge;
import cn.hutool.core.date.LocalDateTimeUtil;
import cn.iocoder.yudao.framework.security.core.LoginUser; import cn.iocoder.yudao.framework.security.core.LoginUser;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
import cn.iocoder.yudao.module.member.api.user.MemberUserApi; import cn.iocoder.yudao.module.member.api.user.MemberUserApi;
import cn.iocoder.yudao.module.member.api.user.dto.AppUserInfoReqDTO;
import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO; import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO;
import cn.iocoder.yudao.module.shop.controller.app.member.vo.PromoterMemberOrderVO;
import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.RechargeOrderInfoDO; import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.RechargeOrderInfoDO;
import cn.iocoder.yudao.module.shop.dal.mysql.recharge.RechargeOrderInfoMapper; import cn.iocoder.yudao.module.shop.dal.mysql.recharge.RechargeOrderInfoMapper;
import cn.iocoder.yudao.module.shop.request.member.MemberChangeTieRequest; import cn.iocoder.yudao.module.shop.request.member.MemberChangeTieRequest;
import cn.iocoder.yudao.module.shop.request.member.RefundRequest; import cn.iocoder.yudao.module.shop.request.member.RefundRequest;
import cn.iocoder.yudao.module.shop.response.member.MemberHeadResponse; import cn.iocoder.yudao.module.shop.response.member.MemberHeadResponse;
import cn.iocoder.yudao.module.system.api.tenant.TenantApi;
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.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -21,7 +27,11 @@ import org.springframework.util.CollectionUtils;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.DayOfWeek;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.time.temporal.TemporalAdjusters;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -54,6 +64,8 @@ public class RechargeOrderServiceImpl implements RechargeOrderService {
private PhoneRecordService phoneRecordService; private PhoneRecordService phoneRecordService;
@Autowired @Autowired
private MemberUserApi memberUserApi; private MemberUserApi memberUserApi;
@Resource
private TenantApi tenantApi;
@Override @Override
public Long createRechargeOrder(RechargeOrderCreateReqVO createReqVO) { public Long createRechargeOrder(RechargeOrderCreateReqVO createReqVO) {
@ -128,7 +140,7 @@ public class RechargeOrderServiceImpl implements RechargeOrderService {
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
Assert.notNull(loginUser, "登录失效,请重新登录!"); Assert.notNull(loginUser, "登录失效,请重新登录!");
List<RechargeOrderDO> orderDOS = rechargeOrderMapper.selectList(Wrappers.<RechargeOrderDO>lambdaQuery() List<RechargeOrderDO> orderDOS = rechargeOrderMapper.selectList(Wrappers.<RechargeOrderDO>lambdaQuery()
.eq(RechargeOrderDO::getUid, loginUser.getId()).eq(RechargeOrderDO::getPaid, 1)); .eq(RechargeOrderDO::getUid, loginUser.getId()).ne(RechargeOrderDO::getPaid, 0));
if (!CollectionUtils.isEmpty(orderDOS)) { if (!CollectionUtils.isEmpty(orderDOS)) {
List<RechargeOrderRespVO> rechargeOrderRespVOS = RechargeOrderConvert.INSTANCE.convertList(orderDOS); List<RechargeOrderRespVO> rechargeOrderRespVOS = RechargeOrderConvert.INSTANCE.convertList(orderDOS);
List<String> collect1 = rechargeOrderRespVOS.stream().map(RechargeOrderBaseVO::getOrderId).collect(Collectors.toList()); List<String> collect1 = rechargeOrderRespVOS.stream().map(RechargeOrderBaseVO::getOrderId).collect(Collectors.toList());
@ -156,6 +168,65 @@ public class RechargeOrderServiceImpl implements RechargeOrderService {
return null; return null;
} }
@Override
public PageResult<RechargeOrderRespVO> promoterOrderInfo(RechargeOrderPageReqVO pageReqVO) {
Page<RechargeOrderRespVO> page = new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize());
rechargeOrderMapper.findListPage(page, pageReqVO);
if (!CollectionUtils.isEmpty(page.getRecords())) {
List<String> collect1 = page.getRecords().stream().map(RechargeOrderBaseVO::getOrderId).collect(Collectors.toList());
List<RechargeOrderInfoDO> infoDOS = infoMapper.selectList(Wrappers.<RechargeOrderInfoDO>lambdaQuery().in(RechargeOrderInfoDO::getOrderNo, collect1));
Map<String, List<RechargeOrderInfoDO>> collect = infoDOS.stream().collect(Collectors.groupingBy(RechargeOrderInfoDO::getOrderNo));
for (RechargeOrderRespVO orderDO : page.getRecords()) {
StringBuilder grade = new StringBuilder();
List<RechargeOrderInfoDO> infoDOS1 = collect.get(orderDO.getOrderId());
for (RechargeOrderInfoDO infoDO : infoDOS1) {
if (infoDO.getPrice().compareTo(new BigDecimal("240")) == 0) {
grade.append("套餐1,");
} else if (infoDO.getPrice().compareTo(new BigDecimal("400")) == 0) {
grade.append("套餐2,");
} else if (infoDO.getPrice().compareTo(new BigDecimal("640")) == 0) {
grade.append("套餐3");
}
}
orderDO.setGrade(grade.toString());
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
orderDO.setStringCreateTime(orderDO.getCreateTime().format(formatter));
}
return new PageResult<>(page.getRecords(), page.getTotal());
}
return null;
}
@Override
public PromoterMemberOrderVO promoterOrderCount(Integer type,Long promoterId) {
PromoterMemberOrderVO promoterMemberOrderVO = new PromoterMemberOrderVO();
AppUserInfoReqDTO appUserInfoReqDTO = new AppUserInfoReqDTO();
appUserInfoReqDTO.setPromoterId(promoterId);
if(type==1){
appUserInfoReqDTO.setStartTime(LocalDateTimeUtil.beginOfDay(LocalDateTime.now()));
appUserInfoReqDTO.setEndTime(LocalDateTimeUtil.endOfDay(LocalDateTime.now()));
}else if (type == 2){
LocalDateTime todayOfLastWeek = LocalDateTime.now().minusDays(7);
LocalDateTime monday = todayOfLastWeek.with(TemporalAdjusters.previous(DayOfWeek.SUNDAY)).plusDays(1);
LocalDateTime sunday = todayOfLastWeek.with(TemporalAdjusters.next(DayOfWeek.MONDAY)).minusDays(1);
appUserInfoReqDTO.setStartTime(LocalDateTimeUtil.beginOfDay(monday));
appUserInfoReqDTO.setEndTime(LocalDateTimeUtil.endOfDay(sunday));
} else if (type == 3) {
LocalDateTime lastMonth = LocalDateTime.now().minusMonths(1); // 当前月份减1
LocalDateTime firstDay = lastMonth.with(TemporalAdjusters.firstDayOfMonth()); // 获取当前月的第一天
LocalDateTime lastDay = lastMonth.with(TemporalAdjusters.lastDayOfMonth()); // 获取当前月的最后一天
appUserInfoReqDTO.setStartTime(LocalDateTimeUtil.beginOfDay(firstDay));
appUserInfoReqDTO.setEndTime(LocalDateTimeUtil.endOfDay(lastDay));
}
BigDecimal totalAmount =rechargeOrderMapper.promoterOrderCount(appUserInfoReqDTO.getStartTime(),appUserInfoReqDTO.getEndTime(),promoterId);
promoterMemberOrderVO.setTotalAmount(totalAmount);
promoterMemberOrderVO.setMemberCount(memberUserApi.promoterOrderCount(appUserInfoReqDTO));
TenantDTO tenantDTO = tenantApi.getTenant(TenantContextHolder.getTenantId());
promoterMemberOrderVO.setMemberCommission(tenantDTO.getMemberCommission());
return promoterMemberOrderVO;
}
@Override @Override
public MemberHeadResponse memberHeadInfo() { public MemberHeadResponse memberHeadInfo() {
MemberHeadResponse response = new MemberHeadResponse(); MemberHeadResponse response = new MemberHeadResponse();

View File

@ -57,6 +57,19 @@
<include refid="baseWhere"> <include refid="baseWhere">
</include> </include>
</select> </select>
<select id="promoterOrderCount" resultType="java.math.BigDecimal">
select sum(pay_price) from cy_recharge_order
<where>
paid=1 and promoter_id=#{promoterId}
<if test="startDate!=null">
and pay_time&gt;=#{startDate}
</if>
<if test="endDate!=null">
and pay_time&lt;=#{endDate}
</if>
</where>
</select>
<select id="findListExcel" resultType="cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.RechargeOrderExcelVO"> <select id="findListExcel" resultType="cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.RechargeOrderExcelVO">
select select
a.id, a.id,
@ -113,6 +126,10 @@
<if test="data.payTime !=null "> <if test="data.payTime !=null ">
and a.pay_time &lt;=#{data.payTime[1]} and a.pay_time &lt;=#{data.payTime[1]}
</if> </if>
<if test="data.promoterId !=null ">
and a.promoter_id =#{data.promoterId}
</if>
</where> </where>
</sql> </sql>
</mapper> </mapper>

View File

@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.member.api.user; package cn.iocoder.yudao.module.member.api.user;
import cn.iocoder.yudao.module.member.api.user.dto.AppUserInfoReqDTO;
import cn.iocoder.yudao.module.member.api.user.dto.MemberUserBillDTO; import cn.iocoder.yudao.module.member.api.user.dto.MemberUserBillDTO;
import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO; import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO;
import cn.iocoder.yudao.module.member.api.user.dto.PromoterDTO; import cn.iocoder.yudao.module.member.api.user.dto.PromoterDTO;
@ -83,4 +84,6 @@ public interface MemberUserApi {
void saveMemberUser(String phone,Long promoterId,String userName); void saveMemberUser(String phone,Long promoterId,String userName);
PromoterDTO getPromoterDOByUserId(Long userId); PromoterDTO getPromoterDOByUserId(Long userId);
Long promoterOrderCount(AppUserInfoReqDTO reqVO);
} }

View File

@ -0,0 +1,19 @@
package cn.iocoder.yudao.module.member.api.user.dto;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.time.LocalDateTime;
import java.util.Date;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class AppUserInfoReqDTO {
private Long promoterId;
private LocalDateTime startTime;
private LocalDateTime endTime;
}

View File

@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.member.api.user;
import cn.iocoder.yudao.framework.common.exception.ServiceException; import cn.iocoder.yudao.framework.common.exception.ServiceException;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore; import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
import cn.iocoder.yudao.module.member.api.user.dto.AppUserInfoReqDTO;
import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO; import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO;
import cn.iocoder.yudao.module.member.api.user.dto.PromoterDTO; import cn.iocoder.yudao.module.member.api.user.dto.PromoterDTO;
import cn.iocoder.yudao.module.member.controller.app.auth.vo.AppAuthSmsLoginReqVO; import cn.iocoder.yudao.module.member.controller.app.auth.vo.AppAuthSmsLoginReqVO;
@ -147,4 +148,9 @@ public class MemberUserApiImpl implements MemberUserApi {
} }
return user; return user;
} }
@Override
public Long promoterOrderCount(AppUserInfoReqDTO reqDTO) {
return userService.promoterOrderCount(reqDTO);
}
} }

View File

@ -1,4 +1,4 @@
package cn.iocoder.yudao.module.member.controller.app.user.vo; package cn.iocoder.yudao.module.member.controller.admin.user.vo;
import cn.hutool.core.date.DatePattern; import cn.hutool.core.date.DatePattern;
import cn.iocoder.yudao.module.system.enums.common.SexEnum; import cn.iocoder.yudao.module.system.enums.common.SexEnum;
@ -24,8 +24,30 @@ public class AppUserInfoReqVO {
@Schema(description = "用户昵称", required = true, example = "芋艿") @Schema(description = "用户昵称", required = true, example = "芋艿")
@NotEmpty(message = "用户昵称不能为空") @NotEmpty(message = "用户昵称不能为空")
private String nickname; private String nickname;
/**
*
*/
private String realName;
@Schema(description = "用户头像", required = true, example = "/infra/file/get/35a12e57-4297-4faa-bf7d-7ed2f211c952") @Schema(description = "用户头像", required = true, example = "/infra/file/get/35a12e57-4297-4faa-bf7d-7ed2f211c952")
private String avatar; private String avatar;
/**
*
* <p>
* {@link SexEnum}
*/
private Integer sex;
@Schema(description = "用户手机号", required = true, example = "15601691300")
private String mobile;
/**
*
*/
@NotEmpty(message = "用户昵称不能为空")
private String userAddress;
/**
*
*/
@JsonFormat(pattern = DatePattern.NORM_DATE_PATTERN)
private Date userBirthday;
} }

View File

@ -1,13 +1,11 @@
package cn.iocoder.yudao.module.member.controller.app.user; package cn.iocoder.yudao.module.member.controller.app.user;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.date.LocalDateTimeUtil;
import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; import cn.iocoder.yudao.framework.common.enums.UserTypeEnum;
import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated; import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated;
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore; import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
import cn.iocoder.yudao.module.member.controller.admin.promoter.vo.PromoterRespVO; import cn.iocoder.yudao.module.member.controller.admin.promoter.vo.PromoterRespVO;
import cn.iocoder.yudao.module.member.controller.app.user.vo.AppUserInfoReqVO; import cn.iocoder.yudao.module.member.controller.admin.user.vo.AppUserInfoReqVO;
import cn.iocoder.yudao.module.member.controller.app.user.vo.AppUserInfoRespVO; import cn.iocoder.yudao.module.member.controller.app.user.vo.AppUserInfoRespVO;
import cn.iocoder.yudao.module.member.controller.app.user.vo.AppUserUpdateMobileReqVO; import cn.iocoder.yudao.module.member.controller.app.user.vo.AppUserUpdateMobileReqVO;
import cn.iocoder.yudao.module.member.controller.app.user.vo.UserSpreadBannerVO; import cn.iocoder.yudao.module.member.controller.app.user.vo.UserSpreadBannerVO;

View File

@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.member.dal.mysql.user;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.member.api.user.dto.AppUserInfoReqDTO;
import cn.iocoder.yudao.module.member.controller.admin.user.dto.AdminUserQueryDTO; import cn.iocoder.yudao.module.member.controller.admin.user.dto.AdminUserQueryDTO;
import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO; import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
@ -33,4 +34,10 @@ public interface MemberUserMapper extends BaseMapperX<MemberUserDO> {
.eqIfPresent(MemberUserDO::getTenantId,reqVO.getTenantId()) .eqIfPresent(MemberUserDO::getTenantId,reqVO.getTenantId())
.orderByDesc(MemberUserDO::getId)); .orderByDesc(MemberUserDO::getId));
} }
default Long promoterOrderCount(AppUserInfoReqDTO reqVO){
return selectCount(new LambdaQueryWrapperX<MemberUserDO>()
.geIfPresent(MemberUserDO::getCreateTime,reqVO.getStartTime())
.leIfPresent(MemberUserDO::getCreateTime,reqVO.getEndTime())
.eqIfPresent(MemberUserDO::getPromoterId, reqVO.getPromoterId()));
}
} }

View File

@ -88,4 +88,5 @@ public interface PromoterService {
*/ */
PromoterImportRespVO importUserList(List<PromoterImportExcelVO> importUsers, boolean isUpdateSupport); PromoterImportRespVO importUserList(List<PromoterImportExcelVO> importUsers, boolean isUpdateSupport);
PromoterDO getPromoterDOByUserId(Long userId); PromoterDO getPromoterDOByUserId(Long userId);
} }

View File

@ -224,6 +224,9 @@ public class PromoterServiceImpl implements PromoterService {
return respVO; return respVO;
} }
@Override @Override
public PromoterDO getPromoterDOByUserId(Long userId) { public PromoterDO getPromoterDOByUserId(Long userId) {
return promoterMapper.selectOne(Wrappers.<PromoterDO>lambdaQuery().eq(PromoterDO::getUserId, userId).last("LIMIT 1")); return promoterMapper.selectOne(Wrappers.<PromoterDO>lambdaQuery().eq(PromoterDO::getUserId, userId).last("LIMIT 1"));

View File

@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.member.service.user;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.validation.Mobile; import cn.iocoder.yudao.framework.common.validation.Mobile;
import cn.iocoder.yudao.module.member.api.user.dto.AppUserInfoReqDTO;
import cn.iocoder.yudao.module.member.controller.admin.user.dto.AdminUserQueryDTO; import cn.iocoder.yudao.module.member.controller.admin.user.dto.AdminUserQueryDTO;
import cn.iocoder.yudao.module.member.controller.app.user.vo.AppUserUpdateMobileReqVO; import cn.iocoder.yudao.module.member.controller.app.user.vo.AppUserUpdateMobileReqVO;
import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO; import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO;
@ -137,4 +138,5 @@ public interface MemberUserService {
void saveMemberUser(String phone); void saveMemberUser(String phone);
Long promoterOrderCount(AppUserInfoReqDTO reqVO);
} }

View File

@ -7,6 +7,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore; import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder; import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
import cn.iocoder.yudao.module.infra.api.file.FileApi; import cn.iocoder.yudao.module.infra.api.file.FileApi;
import cn.iocoder.yudao.module.member.api.user.dto.AppUserInfoReqDTO;
import cn.iocoder.yudao.module.member.controller.admin.user.dto.AdminUserQueryDTO; import cn.iocoder.yudao.module.member.controller.admin.user.dto.AdminUserQueryDTO;
import cn.iocoder.yudao.module.member.controller.app.user.vo.AppUserUpdateMobileReqVO; import cn.iocoder.yudao.module.member.controller.app.user.vo.AppUserUpdateMobileReqVO;
import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO; import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO;
@ -255,5 +256,9 @@ public class MemberUserServiceImpl implements MemberUserService {
} }
return user; return user;
} }
@Override
public Long promoterOrderCount(AppUserInfoReqDTO reqVO) {
return memberUserMapper.promoterOrderCount(reqVO);
}
} }

View File

@ -1,5 +1,7 @@
package cn.iocoder.yudao.module.system.api.tenant; package cn.iocoder.yudao.module.system.api.tenant;
import cn.iocoder.yudao.module.system.api.tenant.dto.TenantDTO;
import java.util.List; import java.util.List;
/** /**
@ -23,4 +25,6 @@ public interface TenantApi {
*/ */
void validateTenant(Long id); void validateTenant(Long id);
TenantDTO getTenant(Long id);
} }

View File

@ -0,0 +1,121 @@
package cn.iocoder.yudao.module.system.api.tenant.dto;
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
import lombok.*;
import java.time.LocalDateTime;
/**
* DO
*
* @author
*/
@Data
@ToString(callSuper = true)
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class TenantDTO{
/**
* -
*/
public static final Long PACKAGE_ID_SYSTEM = 0L;
/**
*
*/
private Long id;
/**
*
*/
private String name;
/**
*
*
* {@link AdminUserDO#getId()}
*/
private Long contactUserId;
/**
*
*/
private String contactName;
/**
*
*/
private String contactMobile;
/**
*
*
* {@link CommonStatusEnum}
*/
private Integer status;
/**
*
*
* TODO
*/
private String domain;
/**
*
*
*
* 使使 {@link #PACKAGE_ID_SYSTEM}
*/
private Long packageId;
/**
*
*/
private LocalDateTime expireTime;
/**
*
*/
private Integer accountCount;
/**
*
*/
private String introduction;
/**
*
*/
private String serviceMobile;
/**
*
*/
private String serviceTime;
/**
*
*/
private String saleContactName;
/**
*
*/
private String saleContactMobile;
/**
*
*/
private String wxKfUrl;
/**
*
*/
private String notice;
/**
*
*/
private Integer goodsCommission;
/**
*
*/
private Integer memberCommission;
/**
* logo
*/
private String logo;
}

View File

@ -1,5 +1,8 @@
package cn.iocoder.yudao.module.system.api.tenant; package cn.iocoder.yudao.module.system.api.tenant;
import cn.iocoder.yudao.module.system.api.tenant.dto.TenantDTO;
import cn.iocoder.yudao.module.system.convert.tenant.TenantConvert;
import cn.iocoder.yudao.module.system.dal.dataobject.tenant.TenantDO;
import cn.iocoder.yudao.module.system.service.tenant.TenantService; import cn.iocoder.yudao.module.system.service.tenant.TenantService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -27,4 +30,11 @@ public class TenantApiImpl implements TenantApi {
tenantService.validTenant(id); tenantService.validTenant(id);
} }
@Override
public TenantDTO getTenant(Long id) {
TenantDO tenantDO = tenantService.getTenant(id);
TenantDTO tenantDTO = TenantConvert.INSTANCE.convertDTO(tenantDO);
return tenantDTO;
}
} }

View File

@ -1,6 +1,7 @@
package cn.iocoder.yudao.module.system.convert.tenant; package cn.iocoder.yudao.module.system.convert.tenant;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.system.api.tenant.dto.TenantDTO;
import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.tenant.TenantCreateReqVO; import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.tenant.TenantCreateReqVO;
import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.tenant.TenantExcelVO; import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.tenant.TenantExcelVO;
import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.tenant.TenantRespVO; import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.tenant.TenantRespVO;
@ -28,6 +29,8 @@ public interface TenantConvert {
TenantRespVO convert(TenantDO bean); TenantRespVO convert(TenantDO bean);
TenantDTO convertDTO(TenantDO bean);
List<TenantRespVO> convertList(List<TenantDO> list); List<TenantRespVO> convertList(List<TenantDO> list);
PageResult<TenantRespVO> convertPage(PageResult<TenantDO> page); PageResult<TenantRespVO> convertPage(PageResult<TenantDO> page);

View File

@ -71,7 +71,9 @@ spring:
password: 20221122@dev # 密码,建议生产环境开启 password: 20221122@dev # 密码,建议生产环境开启
--- #################### 定时任务相关配置 #################### --- #################### 定时任务相关配置 ####################
mybatis-plus:
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
# Quartz 配置项,对应 QuartzProperties 配置类 # Quartz 配置项,对应 QuartzProperties 配置类
spring: spring:
quartz: quartz:

View File

@ -64,18 +64,18 @@ export const constantRoutes = [
component: (resolve) => require(['@/views/error/401'], resolve), component: (resolve) => require(['@/views/error/401'], resolve),
hidden: true hidden: true
}, },
{ // {
path: '', // path: '',
component: Layout, // component: Layout,
redirect: 'index', // redirect: 'index',
children: [{ // children: [{
path: 'index', // path: 'index',
component: (resolve) => require(['@/views/index'], resolve), // component: (resolve) => require(['@/views/index'], resolve),
name: '首页', // name: '首页',
meta: {title: '首页', icon: 'dashboard', affix: true} // meta: {title: '首页', icon: 'dashboard', affix: true}
} // }
] // ]
}, // },
{ {
path: '/user', path: '/user',
component: Layout, component: Layout,

View File

@ -158,7 +158,7 @@
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="onClose('ruleForm')"> </el-button> <el-button @click="onClose('ruleForm')"> </el-button>
<el-button type="primary" :loading="loading" @click="onsubmit('ruleForm')" v-hasPermi="['deliverGoods:freightSet:update']"> </el-button> <el-button type="primary" :loading="loading" @click="onsubmit('ruleForm')"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
</template> </template>

View File

@ -11,7 +11,7 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
<el-button type="primary" size="mini" @click="handleSubmit()" v-hasPermi="['deliverGoods:freightSet:create']"></el-button> <el-button type="primary" size="mini" @click="handleSubmit()" v-hasPermi="['admin:shipping:templates:save']"></el-button>
</div> </div>
<el-table <el-table
v-loading="loading" v-loading="loading"
@ -70,8 +70,8 @@
label="操作" label="操作"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" size="small" @click="bindEdit(scope.row)" v-hasPermi="['deliverGoods:freightSet:update']"></el-button> <el-button type="text" size="small" @click="bindEdit(scope.row)" v-hasPermi="['admin:shipping:templates:update']"></el-button>
<el-button type="text" size="small" @click="bindDelete(scope.row)" v-hasPermi="['deliverGoods:freightSet:delete']"></el-button> <el-button type="text" size="small" @click="bindDelete(scope.row)" v-hasPermi="['admin:shipping:templates:delete']"></el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

@ -12,8 +12,8 @@
</el-form> </el-form>
</div> </div>
<div class="acea-row"> <div class="acea-row">
<el-button size="small" type="primary" @click="add" v-hasPermi="['product:property:create']"></el-button> <el-button size="small" type="primary" @click="add" v-hasPermi="['admin:product:rule:save']"></el-button>
<el-button size="small" @click="handleDeleteAll" v-hasPermi="['product:property:delete']"></el-button> <el-button size="small" @click="handleDeleteAll" v-hasPermi="['admin:product:rule:delete']"></el-button>
</div> </div>
</div> </div>
<el-table <el-table
@ -57,8 +57,8 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" min-width="120" align="center"> <el-table-column label="操作" min-width="120" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" size="small" @click="onEdit(scope.row)" class="mr10" v-hasPermi="['product:property:update']"></el-button> <el-button type="text" size="small" @click="onEdit(scope.row)" class="mr10" v-hasPermi="['admin:product:rule:update']"></el-button>
<el-button type="text" size="small" @click="handleDelete(scope.row.id, scope.$index)" v-hasPermi="['product:property:delete']"></el-button> <el-button type="text" size="small" @click="handleDelete(scope.row.id, scope.$index)" v-hasPermi="['admin:product:rule:delete']"></el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

@ -37,7 +37,7 @@
:picker-options="datePickerOptions" :default-time="['00:00:00', '23:59:59']" /> :picker-options="datePickerOptions" :default-time="['00:00:00', '23:59:59']" />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button> <el-button type="primary" icon="el-icon-search" @click="handleQuery" v-hasPermi="['trade:after-sale:query']"></el-button>
<el-button icon="el-icon-refresh" @click="resetQuery"></el-button> <el-button icon="el-icon-refresh" @click="resetQuery"></el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>

View File

@ -21,7 +21,7 @@
<el-input v-model="queryParams.mobile" placeholder="请输入" clearable @keyup.enter.native="handleQuery"/> <el-input v-model="queryParams.mobile" placeholder="请输入" clearable @keyup.enter.native="handleQuery"/>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button> <el-button type="primary" icon="el-icon-search" @click="handleQuery" v-hasPermi="['member:promoter:query']"></el-button>
<el-button icon="el-icon-refresh" @click="resetQuery"></el-button> <el-button icon="el-icon-refresh" @click="resetQuery"></el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -35,7 +35,7 @@
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="info" icon="el-icon-upload2" size="mini" @click="handleImport" <el-button type="info" icon="el-icon-upload2" size="mini" @click="handleImport"
v-hasPermi="['system:user:import']">导入 v-hasPermi="['member:promoter:export']">导入
</el-button> </el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">

View File

@ -17,7 +17,7 @@
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button> <el-button type="primary" icon="el-icon-search" @click="handleQuery" v-hasPermi="['member:user:query']"></el-button>
<el-button icon="el-icon-refresh" @click="resetQuery"></el-button> <el-button icon="el-icon-refresh" @click="resetQuery"></el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>

View File

@ -9,7 +9,7 @@
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button> <el-button type="primary" icon="el-icon-search" @click="handleQuery" v-hasPermi="['shop:phone-record:query']"></el-button>
<el-button icon="el-icon-refresh" @click="resetQuery"></el-button> <el-button icon="el-icon-refresh" @click="resetQuery"></el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>

View File

@ -7,7 +7,7 @@
<el-input v-model="queryParams.name" placeholder="请输入档位名称" clearable @keyup.enter.native="handleQuery"/> <el-input v-model="queryParams.name" placeholder="请输入档位名称" clearable @keyup.enter.native="handleQuery"/>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button> <el-button type="primary" icon="el-icon-search" @click="handleQuery" v-hasPermi="['shop:recharge-gear:query']"></el-button>
<el-button icon="el-icon-refresh" @click="resetQuery"></el-button> <el-button icon="el-icon-refresh" @click="resetQuery"></el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>

View File

@ -28,7 +28,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button> <el-button type="primary" icon="el-icon-search" @click="handleQuery" v-hasPermi="['shop:recharge-order:query']"></el-button>
<el-button icon="el-icon-refresh" @click="resetQuery"></el-button> <el-button icon="el-icon-refresh" @click="resetQuery"></el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -90,12 +90,12 @@
<template v-slot="scope"> <template v-slot="scope">
<template v-if="scope.row.refundStatus === 1"> <template v-if="scope.row.refundStatus === 1">
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleRefund(scope.row, 1)" <el-button size="mini" type="text" icon="el-icon-delete" @click="handleRefund(scope.row, 1)"
v-hasPermi="['shop:recharge-order:delete']">同意退款</el-button> v-hasPermi="['shop:recharge-order:refund']">同意退款</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleRefund(scope.row, 2)" <el-button size="mini" type="text" icon="el-icon-delete" @click="handleRefund(scope.row, 2)"
v-hasPermi="['shop:recharge-order:delete']">拒绝退款</el-button> v-hasPermi="['shop:recharge-order:refund']">拒绝退款</el-button>
</template> </template>
<el-button v-if="scope.row.refundStatus !== 2 && scope.row.refundStatus !== 3 && scope.row.paid==1" size="mini" type="text" icon="el-icon-edit" @click="handleRefund(scope.row, 3)" <el-button v-if="scope.row.refundStatus !== 2 && scope.row.refundStatus !== 3 && scope.row.paid==1" size="mini" type="text" icon="el-icon-edit" @click="handleRefund(scope.row, 3)"
v-hasPermi="['shop:recharge-order:update']">发起退款</el-button> v-hasPermi="['shop:recharge-order:refund']">发起退款</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

@ -219,7 +219,6 @@
// 广ID // 广ID
setSpreadId() { setSpreadId() {
const spreadId = this.$route.query.spreadId || '' const spreadId = this.$route.query.spreadId || ''
console.log('spreadId', spreadId)
if (spreadId) { if (spreadId) {
this.$store.commit("SET_SPREADID", spreadId); this.$store.commit("SET_SPREADID", spreadId);
} }

View File

@ -42,9 +42,9 @@ const unityPay = (options) => {
} }
_options.payInfo.openid = openId _options.payInfo.openid = openId
if (_options.payType === 'WXPAY') { if (_options.payType === 'WXPAY') {
_options.payInfo.payChannel = '微信支付' _options.payInfo.payChannel = 'public'
} else if (_options.payType === 'ALIPAY') { } else if (_options.payType === 'ALIPAY') {
_options.payInfo.payChannel = '支付宝' _options.payInfo.payChannel = 'appAliPay'
} }
uni.showLoading({ uni.showLoading({
title: '支付中', title: '支付中',

View File

@ -8,8 +8,8 @@
</view> </view>
<view class="count-down"> <view class="count-down">
支付剩余时间 支付剩余时间
<countDown :is-day="false" :is-show-hour='false' :tip-text="''" :day-text="''" :hour-text="''" :minute-text="' : '" <countDown :is-day="false" :is-show-hour='false' :tip-text="''" :day-text="''" :hour-text="''"
:second-text="' '" :datatime="invalidTime"></countDown> :minute-text="' : '" :second-text="' '" :datatime="invalidTime"></countDown>
</view> </view>
</view> </view>
<view class="payment"> <view class="payment">
@ -33,15 +33,15 @@
</view> </view>
<view class="btn"> <view class="btn">
<view class="button acea-row row-center-wrapper pay-button" @click='goPay'>确认支付</view> <view class="button acea-row row-center-wrapper pay-button" @click='goPay'>确认支付</view>
<view class="wait-pay" @click="waitPay"></view> <view class="wait-pay" @click="cancelPayModalShow = true">暂不支</view>
</view> </view>
<view v-show="false" v-html="formContent"></view> <view v-show="false" v-html="formContent"></view>
<u-modal :show="cancelPayModalShow" width="519rpx"> <u-modal :show="cancelPayModalShow" width="519rpx">
<view class="modal-wrap"> <view class="modal-wrap">
<view class="count-down"> <view class="count-down">
支付剩余时间 支付剩余时间
<countDown :is-day="false" :is-show-hour='false' :tip-text="''" :day-text="''" :hour-text="''" :minute-text="' : '" <countDown :is-day="false" :is-show-hour='false' :tip-text="''" :day-text="''" :hour-text="''"
:second-text="' '" :datatime="invalidTime"></countDown> :minute-text="' : '" :second-text="' '" :datatime="invalidTime"></countDown>
</view> </view>
<view class="model-content">确认要放弃付款吗</view> <view class="model-content">确认要放弃付款吗</view>
</view> </view>
@ -53,7 +53,7 @@
</view> </view>
</u-modal> </u-modal>
<!-- 支付宝支付链接复制组件 --> <!-- 支付宝支付链接复制组件 -->
<alipay-link-copy :show.sync="alipayShow" :alipayLink="alipayLink"/> <alipay-link-copy :show.sync="alipayShow" :alipayLink="alipayLink" @confirm="onConfirm" />
</view> </view>
</template> </template>
@ -76,9 +76,11 @@
data() { data() {
return { return {
cancelPayModalShow: false, cancelPayModalShow: false,
backPayModalShow: true,
alipayShow: false, alipayShow: false,
alipayLink: '', alipayLink: '',
checked: false, checked: false,
isClickGiveUpBtn: true,
// //
cartArr: [{ cartArr: [{
"name": '微信支付', "name": '微信支付',
@ -95,6 +97,7 @@
payStatus: 1, payStatus: 1,
} }
], ],
paytype: 'WXPAY',
orderId: 0, orderId: 0,
active: 0, active: 0,
payPrice: 10.00, payPrice: 10.00,
@ -113,7 +116,8 @@
}, },
onShow() { onShow() {
let options = wx.getEnterOptionsSync(); let options = wx.getEnterOptionsSync();
console.log(options) window.history.pushState(null, null, document.url)
window.addEventListener('popstate', this.backShowPayModal)
/* /*
if (options.scene == '1038' && options.referrerInfo.appId == 'wxef277996acc166c3' && this.initIn) { if (options.scene == '1038' && options.referrerInfo.appId == 'wxef277996acc166c3' && this.initIn) {
// //
@ -153,10 +157,25 @@
} }
}*/ }*/
}, },
onHide() {
window.removeEventListener('popstate', this.backShowPayModal)
},
onUnload() {
window.removeEventListener('popstate', this.backShowPayModal)
},
methods: { methods: {
backShowPayModal() {
this.isClickGiveUpBtn = false
this.cancelPayModalShow = this.backPayModalShow
},
onGiveUpPay() { onGiveUpPay() {
if (this.isClickGiveUpBtn) {
window.history.back()
}
this.cancelPayModalShow = false this.cancelPayModalShow = false
// uni.navigateBack() uni.navigateBack({
delta: 1
})
}, },
getCashierOrder() { getCashierOrder() {
uni.showLoading({ uni.showLoading({
@ -164,6 +183,7 @@
}); });
getOrderDetail(this.orderId).then(res => { getOrderDetail(this.orderId).then(res => {
const orderInfo = res.data const orderInfo = res.data
this.invalidTime = new Date(res.data.endTime).getTime()
this.payPrice = parseFloat(orderInfo.proTotalPrice).toFixed(2) this.payPrice = parseFloat(orderInfo.proTotalPrice).toFixed(2)
this.payPriceShow = parseFloat(orderInfo.proTotalPrice).toFixed(2) this.payPriceShow = parseFloat(orderInfo.proTotalPrice).toFixed(2)
}).catch(err => { }).catch(err => {
@ -176,12 +196,28 @@
this.active = index; this.active = index;
this.paytype = paytype; this.paytype = paytype;
}, },
waitPay() { onConfirm() {
this.cancelPayModalShow = true let that = this
// uni.reLaunch({ uni.showModal({
// url: '/pages/goods/order_pay_status/index?order_id=' + this.orderId + '&msg=&type=3' + title: '提示',
// '&status=2&totalPrice=' + this.payPriceShow content: '您是否已支付?',
// }) cancelText: '未支付',
confirmText: '已支付',
success: function(res) {
if (res.confirm) {
// popstate
that.backPayModalShow = false
window.history.back()
setTimeout(()=>{
uni.redirectTo({
url: '/pages/users/order_list/index'
})
}, 200)
} else if (res.cancel) {
}
}
});
}, },
goPay() { goPay() {
let that = this; let that = this;
@ -198,7 +234,6 @@
payType: that.paytype, payType: that.paytype,
createOrderFun: wechatOrderPay, createOrderFun: wechatOrderPay,
payResultHandle: (res) => { payResultHandle: (res) => {
console.log(res)
return { return {
jsapiResult: res.jsapiConfig, jsapiResult: res.jsapiConfig,
body: res.body body: res.body
@ -206,6 +241,9 @@
}, },
wxPaySuccess: () => { wxPaySuccess: () => {
// window.location.reload() // window.location.reload()
uni.redirectTo({
url: '/pages/users/order_list/index'
})
}, },
aliPaySuccess: (link) => { aliPaySuccess: (link) => {
that.alipayLink = link that.alipayLink = link
@ -225,6 +263,7 @@
.count-down .time { .count-down .time {
margin-left: 10rpx; margin-left: 10rpx;
} }
.modal-btn-wrap { .modal-btn-wrap {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;

View File

@ -208,7 +208,7 @@
followHid: true, followHid: true,
followCode: false, followCode: false,
logoUrl: "", logoUrl: "",
bannerList: {}, bannerList: [],
imgUrls: [], imgUrls: [],
itemNew: [], itemNew: [],
menus: [], menus: [],

View File

@ -293,7 +293,7 @@
preOrderNo: '' // preOrderNo: '' //
}; };
}, },
computed: mapGetters(['isLogin', 'systemPlatform', 'productType']), computed: mapGetters(['isLogin', 'systemPlatform', 'productType', 'tenantId']),
watch: { watch: {
isLogin: { isLogin: {
handler: function(newV, oldV) { handler: function(newV, oldV) {
@ -628,7 +628,7 @@
}, },
getOrderPay: function(orderNo, message) { getOrderPay: function(orderNo, message) {
let that = this; let that = this;
uni.navigateTo({ uni.redirectTo({
url: '/pages/goods_cashier/index?order_id=' + orderNo url: '/pages/goods_cashier/index?order_id=' + orderNo
}) })
// wechatOrderPay({ // wechatOrderPay({

View File

@ -26,7 +26,6 @@ function baseRequest(url, method, data, {
if (!noAuth) { if (!noAuth) {
//登录过期自动登录 //登录过期自动登录
if (!store.state.app.token && !checkLogin()) { if (!store.state.app.token && !checkLogin()) {
console.log(store.state.app.token,checkLogin(),123123)
toLogin(); toLogin();
return Promise.reject({ return Promise.reject({
msg: '未登录' msg: '未登录'