商城-购物车

pull/2/head
js199000126 2023-05-25 15:47:41 +08:00
commit f3f523f5c9
58 changed files with 824 additions and 286 deletions

View File

@ -25,4 +25,10 @@ services:
test: ["CMD", "curl", "-f", "http://localhost:48080/actuator/health"]
timeout: 30s
interval: 45s
retries: 3
retries: 3
networks:
- app_net
networks:
app_net:
external: true
name: cyywlnet

View File

@ -0,0 +1,22 @@
package cn.iocoder.yudao.module.shop.request.product;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;
/**
* @Title:DelectCartRequest
* @Description: TODO
* @author: tangqian
* @date: 2023/5/25 13:03
* @version: V1.0.0
*/
@Data
public class DeleteCartRequest implements Serializable {
private static final long serialVersionUID = 8471460222619043734L;
@Schema(description = "商品id")
private List<Long> ids;
}

View File

@ -51,4 +51,7 @@ public class ShippingTemplatesFreeRespVO implements Serializable {
@Schema(description = "分组唯一值", required = true)
private String uniqid;
@Schema(description = "城市名称描述")
private String title;
}

View File

@ -39,4 +39,7 @@ public class ShippingTemplatesNoDeliveryRespVO implements Serializable {
@Schema(description = "省ID, 多个逗号分割。 全国 all", required = true, example = "1,2,3,4")
private String provinceId;
@Schema(description = "城市名称描述", required = true)
private String title;
}

View File

@ -58,4 +58,7 @@ public class ShippingTemplatesRegionRespVO implements Serializable {
@Schema(description = "分组唯一值", required = true)
private String uniqid;
@Schema(description = "城市名称描述")
private String title;
}

View File

@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.shop.controller.admin.notify;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.json.JSONUtil;
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.RechargeOrderDO;
import cn.iocoder.yudao.module.shop.dal.mysql.recharge.RechargeOrderMapper;
import cn.iocoder.yudao.module.shop.service.order.StoreOrderService;
@ -46,7 +47,7 @@ public class WxPayNotifyController {
private StoreOrderService storeOrderService;
@Autowired
private RechargeOrderMapper rechargeOrderMapper;
@Autowired
private PhoneRecordService phoneRecordService;
@ -115,6 +116,7 @@ public class WxPayNotifyController {
* @return:
*/
@PostMapping("/refund_notify")
@TenantIgnore
public String wxPayRefundNotify(@RequestBody String jsonData, HttpServletRequest request, HttpServletResponse response) throws Exception {
// 支付结果通用通知文档: https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=9_7
// 支付成功结果通知
@ -134,18 +136,22 @@ public class WxPayNotifyController {
BigDecimal payerTotal = NumberUtil.div(result.getAmount().getPayerTotal() + "", "100", 2);
// 处理相关逻辑
RechargeOrderDO orderDO = rechargeOrderMapper.selectOne(Wrappers.<RechargeOrderDO>lambdaQuery().eq(RechargeOrderDO::getOrderId, result.getOutTradeNo()));
if (payerTotal.compareTo(orderDO.getPayPrice()) != 0) {
log.error("支付金额不匹配,订单实际支付金额:{},微信入参验证金额:{}", orderDO.getPayPrice(), payerTotal);
return "failure";
if(orderDO!=null){
if (payerTotal.compareTo(orderDO.getPayPrice()) != 0) {
log.error("支付金额不匹配,订单实际支付金额:{},微信入参验证金额:{}", orderDO.getPayPrice(), payerTotal);
return "failure";
}
orderDO.setRefundStatus(2);
orderDO.setPaid(2);
rechargeOrderMapper.updateById(orderDO);
//删除提报记录
phoneRecordService.deletePhoneGear(orderDO.getOrderId());
//删除本地提报记录
phoneRecordService.deletePhoneRecord(orderDO.getId());
// 修改订单状态
// 写入
response.setStatus(HttpServletResponse.SC_OK);
}
orderDO.setRefundStatus(2);
orderDO.setPaid(2);
rechargeOrderMapper.updateById(orderDO);
//删除提报记录
phoneRecordService.deletePhoneGear(orderDO.getOrderId());
// 修改订单状态
// 写入
response.setStatus(HttpServletResponse.SC_OK);
return "success";
}
} catch (Exception e) {

View File

@ -32,7 +32,7 @@ public class RechargeOrderBaseVO {
@Schema(description = "用户id", required = true, example = "28969")
@NotNull(message = "用户id不能为空")
private Integer uid;
private Long uid;
@Schema(description = "用户姓名", required = true, example = "张三")
@NotNull(message = "用户姓名不能为空")

View File

@ -22,7 +22,7 @@ public class RechargeOrderExportReqVO {
private Long tenantId;
@Schema(description = "用户id", example = "28969")
private Integer uid;
private Long uid;
@Schema(description = "用户姓名", example = "张三")
private String realName;

View File

@ -24,7 +24,7 @@ public class RechargeOrderPageReqVO extends PageParam {
private Long tenantId;
@Schema(description = "用户id", example = "28969")
private Integer uid;
private Long uid;
@Schema(description = "用户姓名", example = "张三")
private String realName;

View File

@ -6,6 +6,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.module.shop.request.product.CartNumRequest;
import cn.iocoder.yudao.module.shop.request.product.CartRequest;
import cn.iocoder.yudao.module.shop.request.product.CartResetRequest;
import cn.iocoder.yudao.module.shop.request.product.DeleteCartRequest;
import cn.iocoder.yudao.module.shop.response.product.CartInfoResponse;
import cn.iocoder.yudao.module.shop.service.product.StoreCartService;
import com.github.pagehelper.PageInfo;
@ -78,12 +79,11 @@ public class CartController {
/**
*
* @param ids ids
*/
@Operation(summary = "删除")
@RequestMapping(value = "/delete", method = RequestMethod.POST)
public CommonResult<String> delete(@RequestParam(value = "ids") List<Long> ids) {
if (storeCartService.deleteCartByIds(ids)) {
public CommonResult<String> delete(@RequestBody @Validated DeleteCartRequest request) {
if (storeCartService.deleteCartByIds(request.getIds())) {
return CommonResult.success("删除购物车成功");
} else {
return CommonResult.error(GlobalErrorCodeConstants.OPERATION_ERROR.getCode(), "删除购物车失败");

View File

@ -74,4 +74,12 @@ public class MemberController {
return CommonResult.success(rechargeGearService.memberByPhoneGradeInfo(phone));
}
// 充值列表记录
@Operation(summary = "根据手机号获取充值充值记录")
@RequestMapping(value = "/memberOrderInfoByPhone", method = RequestMethod.GET)
@PreAuthenticated
@TenantIgnore
public CommonResult<List<RechargeOrderRespVO>> memberOrderInfoByPhone(@RequestParam String phone) {
return CommonResult.success(rechargeOrderService.memberOrderInfoByPhone(phone));
}
}

View File

@ -37,42 +37,4 @@ import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.E
@Slf4j
public class AppPhoneRecordController {
@Resource
private PhoneRecordService phoneRecordService;
@Value("${phone.query-url}")
private String phoneUrl;
@Value("${phone.token}")
private String token;
@PostMapping("test")
public CommonResult<Boolean> test(@RequestBody List<PhoneRecordAdd> data){
String result = HttpRequest.post(phoneUrl+"query/createReport")
.header("token",token)
.body(JSONObject.toJSONString(data))
.execute()
.body();
JSONObject resultJson = JSONObject.parseObject(result);
log.info("提报新增返回结果{}",JSONObject.toJSONString(resultJson));
if("0000".equals(resultJson.get("code"))){
return success(null);
}
return success(null);
}
@PostMapping("delete")
public CommonResult<Boolean> delete(@RequestBody String data){
String result = HttpRequest.post(phoneUrl+"query/deleteReport?orderNo="+data)
.header("token",token)
.execute()
.body();
JSONObject resultJson = JSONObject.parseObject(result);
log.info("删除返回结果{}",JSONObject.toJSONString(resultJson));
if("0000".equals(resultJson.get("code"))){
return success(null);
}
return success(null);
}
}

View File

@ -69,4 +69,9 @@ public class ShippingTemplatesFreeDO implements Serializable {
*
*/
private Boolean status;
/**
*
*/
private String title;
}

View File

@ -50,5 +50,10 @@ public class ShippingTemplatesNoDeliveryDO implements Serializable {
*/
private String uniqid;
/**
*
*/
private String title;
}

View File

@ -81,5 +81,10 @@ public class ShippingTemplatesRegionDO implements Serializable {
*/
private Boolean status;
/**
*
*/
private String title;
}

View File

@ -43,7 +43,7 @@ public class StoreProductLog implements Serializable {
private Integer productId;
@Schema(description= "用户ID")
private Integer uid;
private Long uid;
@Schema(description= "是否浏览")
private Boolean visitNum;

View File

@ -44,7 +44,7 @@ public class RechargeOrderDO extends TenantBaseDO {
/**
* id
*/
private Integer uid;
private Long uid;
/**
*
*/

View File

@ -70,5 +70,5 @@ public interface StoreOrderMapper extends BaseMapperX<StoreOrder> {
* @param uid uid
* @param spreadId 广uid
*/
OrderBrokerageData getBrokerageData(@Param("uid") Integer uid, @Param("spreadId") Integer spreadId);
OrderBrokerageData getBrokerageData(@Param("uid") Long uid, @Param("spreadId") Integer spreadId);
}

View File

@ -317,7 +317,6 @@ public class CategoryServiceImpl extends ServiceImpl<CategoryMapper, Category> i
list.add(tree);
}
}
log.info("无限极分类 : getTree:" + JsonUtils.toJsonString(list));
return list;
}

View File

@ -67,7 +67,7 @@ public class ShippingTemplatesFreeServiceImpl extends ServiceImpl<ShippingTempla
for (Integer cityId: cityIdList) {
ShippingTemplatesFreeDO shippingTemplatesFreeDO = new ShippingTemplatesFreeDO();
shippingTemplatesFreeDO.setCityId(cityId);
// shippingTemplatesFreeDO.setTitle(shippingTemplatesFreeRespVO.getTitle());
shippingTemplatesFreeDO.setTitle(shippingTemplatesFreeRespVO.getTitle());
shippingTemplatesFreeDO.setUniqid(uniqueKey);
shippingTemplatesFreeDO.setTempId(tempId);
shippingTemplatesFreeDO.setType(type);

View File

@ -50,6 +50,7 @@ public class ShippingTemplatesNoDeliveryServiceImpl extends ServiceImpl<Shipping
for (Integer cityId: cityIdList) {
ShippingTemplatesNoDeliveryDO shippingTemplatesNoDeliveryDO = new ShippingTemplatesNoDeliveryDO();
shippingTemplatesNoDeliveryDO.setCityId(cityId);
shippingTemplatesNoDeliveryDO.setTitle(shippingTemplatesNoDeliveryRespVOS.getTitle());
shippingTemplatesNoDeliveryDO.setUniqid(uniqueKey);
shippingTemplatesNoDeliveryDO.setTempId(tempId);
shippingTemplatesNoDeliveryDOS.add(shippingTemplatesNoDeliveryDO);

View File

@ -79,7 +79,7 @@ public class ShippingTemplatesRegionServiceImpl extends ServiceImpl<ShippingTemp
ShippingTemplatesRegionDO shippingTemplatesRegionDO = new ShippingTemplatesRegionDO();
shippingTemplatesRegionDO.setCityId(cityId);
shippingTemplatesRegionDO.setUniqid(uniqueKey);
// shippingTemplatesRegionDO.setTitle(shippingTemplatesRegionRespVO.getTitle());
shippingTemplatesRegionDO.setTitle(shippingTemplatesRegionRespVO.getTitle());
shippingTemplatesRegionDO.setRenewal(shippingTemplatesRegionRespVO.getRenewal());
shippingTemplatesRegionDO.setRenewalPrice(shippingTemplatesRegionRespVO.getRenewalPrice());
shippingTemplatesRegionDO.setFirst(shippingTemplatesRegionRespVO.getFirst());

View File

@ -66,7 +66,7 @@ public interface StoreOrderService extends IService<StoreOrder> {
* @param pageParamRequest
* @return
*/
List<StoreOrder> getUserOrderList(Integer uid, Integer status, PageParam pageParamRequest);
List<StoreOrder> getUserOrderList(Long uid, Integer status, PageParam pageParamRequest);
/**
*
* @param storeOrder
@ -141,21 +141,21 @@ public interface StoreOrderService extends IService<StoreOrder> {
* @param seckillId id
* @return
*/
List<StoreOrder> getUserCurrentDaySecKillOrders(Integer uid, Integer seckillId);
List<StoreOrder> getUserCurrentDaySecKillOrders(Long uid, Integer seckillId);
/**
*
* @param uid uid
* @return
*/
List<StoreOrder> getUserCurrentBargainOrders(Integer uid, Integer bargainId);
List<StoreOrder> getUserCurrentBargainOrders(Long uid, Integer bargainId);
/**
*
* @param uid uid
* @return
*/
List<StoreOrder> getUserCurrentCombinationOrders(Integer uid, Integer combinationId);
List<StoreOrder> getUserCurrentCombinationOrders(Long uid, Integer combinationId);
StoreOrder getByOderId(String orderId);
@ -206,7 +206,7 @@ public interface StoreOrderService extends IService<StoreOrder> {
* @param uid uid
* @return Integer
*/
Long getOrderCountByUid(Integer uid);
Long getOrderCountByUid(Long uid);
/**
*
@ -220,7 +220,7 @@ public interface StoreOrderService extends IService<StoreOrder> {
* @param uid uid
* @return Integer
*/
Long getOrderCountByUidAndDate(Integer uid, String date);
Long getOrderCountByUidAndDate(Long uid, String date);
/**
* ()
@ -380,7 +380,7 @@ public interface StoreOrderService extends IService<StoreOrder> {
* @param uid uid
* @param spreadId 广uid
*/
OrderBrokerageData getBrokerageData(Integer uid, Integer spreadId);
OrderBrokerageData getBrokerageData(Long uid, Integer spreadId);
/**
*

View File

@ -325,13 +325,13 @@ public class OrderServiceImpl implements OrderService {
@Override
public OrderDataResponse orderData(String dateLimit, Integer type, String payType) {
OrderDataResponse response = new OrderDataResponse();
if (type.equals(2)) {
if (type!=null && type==2) {
type = null;
}
// 已完成订单数量
response.setCompleteCount(getCount(dateLimit, Constants.ORDER_STATUS_COMPLETE, type));
// 待核销订单数量
response.setEvaluatedCount(getCount(dateLimit, Constants.ORDER_STATUS_STR_TOBE_WRITTEN_OFF, type));
// response.setEvaluatedCount(getCount(dateLimit, Constants.ORDER_STATUS_STR_TOBE_WRITTEN_OFF, type));
// 支付订单总数
response.setOrderCount(getCount(dateLimit, Constants.ORDER_STATUS_ALL, type));
// 待收货订单数量

View File

@ -231,7 +231,7 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderMapper, StoreOr
* @return
*/
@Override
public List<StoreOrder> getUserOrderList(Integer uid, Integer status, PageParam pageParamRequest) {
public List<StoreOrder> getUserOrderList(Long uid, Integer status, PageParam pageParamRequest) {
PageHelper.startPage(pageParamRequest.getPageNo(), pageParamRequest.getPageSize());
LambdaQueryWrapper<StoreOrder> lqw = new LambdaQueryWrapper<>();
orderUtil.statusApiByWhere(lqw, status);
@ -541,7 +541,7 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderMapper, StoreOr
* @return
*/
@Override
public List<StoreOrder> getUserCurrentDaySecKillOrders(Integer uid, Integer seckillId) {
public List<StoreOrder> getUserCurrentDaySecKillOrders(Long uid, Integer seckillId) {
String dayStart = DateUtils.nowDateTime(Constants.DATE_FORMAT_START);
String dayEnd = DateUtils.nowDateTime(Constants.DATE_FORMAT_END);
LambdaQueryWrapper<StoreOrder> lqw = Wrappers.lambdaQuery();
@ -560,7 +560,7 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderMapper, StoreOr
* @return
*/
@Override
public List<StoreOrder> getUserCurrentBargainOrders(Integer uid, Integer bargainId) {
public List<StoreOrder> getUserCurrentBargainOrders(Long uid, Integer bargainId) {
LambdaQueryWrapper<StoreOrder> lqw = Wrappers.lambdaQuery();
lqw.eq(StoreOrder::getUid, uid);
lqw.eq(StoreOrder::getBargainId, bargainId);
@ -576,7 +576,7 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderMapper, StoreOr
* @return
*/
@Override
public List<StoreOrder> getUserCurrentCombinationOrders(Integer uid, Integer combinationId) {
public List<StoreOrder> getUserCurrentCombinationOrders(Long uid, Integer combinationId) {
LambdaQueryWrapper<StoreOrder> lqw = Wrappers.lambdaQuery();
lqw.eq(StoreOrder::getUid, uid);
lqw.eq(StoreOrder::getCombinationId, combinationId);
@ -724,7 +724,7 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderMapper, StoreOr
* @return Integer
*/
@Override
public Long getOrderCountByUid(Integer uid) {
public Long getOrderCountByUid(Long uid) {
LambdaQueryWrapper<StoreOrder> lqw = Wrappers.lambdaQuery();
lqw.eq(StoreOrder::getPaid, true);
lqw.eq(StoreOrder::getIsDel, false);
@ -759,7 +759,7 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderMapper, StoreOr
* @return Integer
*/
@Override
public Long getOrderCountByUidAndDate(Integer uid, String date) {
public Long getOrderCountByUidAndDate(Long uid, String date) {
LambdaQueryWrapper<StoreOrder> lqw = Wrappers.lambdaQuery();
lqw.eq(StoreOrder::getPaid, true);
lqw.eq(StoreOrder::getIsDel, false);
@ -1165,7 +1165,7 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderMapper, StoreOr
* @param spreadId 广uid
*/
@Override
public OrderBrokerageData getBrokerageData(Integer uid, Integer spreadId) {
public OrderBrokerageData getBrokerageData(Long uid, Integer spreadId) {
return null;
}
@ -1223,10 +1223,11 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderMapper, StoreOr
//删除提报记录
try {
phoneRecordService.deletePhoneGear(orderDO.getOrderId());
}catch (Exception e) {
log.error("删除提报记录异常{}",e);
} catch (Exception e) {
log.error("删除提报记录异常{}", e);
}
//删除本地提报记录
phoneRecordService.deletePhoneRecord(orderDO.getId());
// 表示退款
} else {
// 表示支付
@ -1267,7 +1268,7 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderMapper, StoreOr
phoneRecordDO.setRefundFeeAmount(replace(info.getPrice()));
phoneRecordDO.setRechargeGearId(Long.valueOf(info.getRechargeGearId()));
LocalDateTime localDateTime = LocalDateTime.now();
LocalDateTime newLocalDateTime = LocalDateTimeUtil.offset(localDateTime,12, ChronoUnit.MONTHS);
LocalDateTime newLocalDateTime = LocalDateTimeUtil.offset(localDateTime, 12, ChronoUnit.MONTHS);
phoneRecordDO.setRefundFeeEndDate(newLocalDateTime);
phoneRecordDO.setRefundFeeNumber(12);
phoneRecordAdd.setChannel(deptRespDTO.getParentOrganizationName());
@ -1275,15 +1276,15 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderMapper, StoreOr
phoneRecordAdd.setMoney(info.getPrice());
phoneRecordAdd.setOrderNo(orderDO.getOrderId());
phoneRecordAdd.setOrderTime(LocalDateTimeUtil.formatNormal(orderDO.getPayTime().toLocalDate()));
phoneRecordAdd.setGear(rechargeGearDO.getRefundAmount().toString());
phoneRecordAdd.setGear(rechargeGearDO.getRefundAmount().intValue() + "");
phoneRecordAdds.add(phoneRecordAdd);
recordDOS.add(phoneRecordDO);
});
phoneRecordMapper.insertBatch(recordDOS);
try {
phoneRecordService.insertPhone(phoneRecordAdds);
}catch (Exception e){
log.info("调取提报新增报错{}",e);
} catch (Exception e) {
log.info("调取提报新增报错{}", e);
}
}
@ -1400,7 +1401,7 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderMapper, StoreOr
private RechargeOrderDO initializeOrder(OrderContentRequest request, String code, MemberUserRespDTO user, PromoterDTO promoterDTO) {
Long tenantId = TenantContextHolder.getTenantId();
Long deptId = promoterDTO.getDeptId();
if(deptId==null){
if (deptId == null) {
DeptRespDTO deptRespDTO = deptApi.findParentDept(tenantId);
deptId = deptRespDTO.getId();
}
@ -1408,7 +1409,7 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderMapper, StoreOr
RechargeOrderDO orderDO = new RechargeOrderDO();
List<OrderContentRequest.OrderInfo> orderInfos = request.getOrderInfos();
orderDO.setOrderId(code);
orderDO.setUid(user.getId().intValue());
orderDO.setUid(user.getId());
orderDO.setRealName(user.getNickname());
orderDO.setUserPhone(StringUtils.isEmpty(request.getUserPhone()) ? user.getMobile() : request.getUserPhone());
orderDO.setConfirmPhone(StringUtils.isEmpty(request.getConfirmPhone()) ? user.getMobile() : request.getConfirmPhone());
@ -1447,6 +1448,7 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderMapper, StoreOr
rechargeOrderInfoMapper.insertBatch(infoDOS);
return orderDO;
}
private void orderCheck(OrderContentRequest request, MemberUserRespDTO user) {
List<OrderContentRequest.OrderInfo> orderInfos = request.getOrderInfos();
Assert.isTrue(!CollectionUtils.isEmpty(orderInfos), "订单信息不能为空!");
@ -1454,15 +1456,16 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderMapper, StoreOr
//先查询提报总表
List<Long> collect = orderInfos.stream().map(OrderContentRequest.OrderInfo::getGearId).collect(Collectors.toList());
List<RechargeGearDO> rechargeGearDOList = rechargeGearService.getRechargeGearList(collect);
rechargeGearDOList.forEach(rechargeGearDO->{
Boolean flag = phoneRecordService.verifyPhone(request.getConfirmPhone(),rechargeGearDO.getRefundAmount().intValue()+"");
rechargeGearDOList.forEach(rechargeGearDO -> {
Boolean flag = phoneRecordService.verifyPhone(request.getUserPhone(), rechargeGearDO.getRefundAmount().intValue() + "");
if (flag) {
throw new ServiceException("该挡位:" + rechargeGearDO.getName() + "你已购买,请勿重复操作");
}
});
List<PhoneRecordDO> infoDOS = phoneRecordMapper.selectList(Wrappers.<PhoneRecordDO>lambdaQuery()
.eq(PhoneRecordDO::getUserId, user.getId())
.eq(PhoneRecordDO::getPhone, user.getMobile())
.eq(PhoneRecordDO::getDeleted, 0)
.in(PhoneRecordDO::getRechargeGearId, collect));
if (!CollectionUtils.isEmpty(infoDOS)) {
@ -1480,7 +1483,7 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderMapper, StoreOr
MemberUserRespDTO userByMobile = userService.getUserByMobile(request.getUserPhone());
// 初始化一个账号
if (Objects.isNull(userByMobile)) {
userService.saveMemberUser(request.getUserPhone());
userService.saveMemberUser(request.getUserPhone(), user.getPromoterId());
}
}
}

View File

@ -53,7 +53,7 @@ public interface StoreProductRelationService extends IService<StoreProductRelati
* @param uid uid
* @return
*/
Integer getCollectCountByUid(Integer uid);
Integer getCollectCountByUid(Long uid);
/**
* Id

View File

@ -159,7 +159,7 @@ public class StoreProductRelationServiceImpl extends ServiceImpl<StoreProductRel
* @return
*/
@Override
public Integer getCollectCountByUid(Integer uid) {
public Integer getCollectCountByUid(Long uid) {
LambdaQueryWrapper<StoreProductRelation> lqr = Wrappers.lambdaQuery();
lqr.eq(StoreProductRelation::getUid, uid);
lqr.eq(StoreProductRelation::getType,"collect");

View File

@ -7,15 +7,21 @@ import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.module.member.api.user.MemberUserApi;
import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO;
import cn.iocoder.yudao.module.shop.controller.app.recharge.vo.PhoneRecordAdd;
import cn.iocoder.yudao.module.shop.dal.dataobject.order.StoreOrder;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import java.util.*;
import cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.*;
import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.PhoneRecordDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
@ -70,11 +76,12 @@ public class PhoneRecordServiceImpl implements PhoneRecordService {
// 校验存在
validatePhoneRecordExists(id);
// 删除
phoneRecordMapper.deleteById(id);
phoneRecordMapper.delete(Wrappers.<PhoneRecordDO>lambdaQuery().eq(PhoneRecordDO::getRechargeOrderId, id));
}
private void validatePhoneRecordExists(Long id) {
if (phoneRecordMapper.selectById(id) == null) {
PhoneRecordDO phoneRecordDO = phoneRecordMapper.selectOne(Wrappers.<PhoneRecordDO>lambdaQuery().eq(PhoneRecordDO::getRechargeOrderId, id));
if (phoneRecordDO == null) {
throw exception(PHONE_RECORD_NOT_EXISTS);
}
}
@ -92,7 +99,7 @@ public class PhoneRecordServiceImpl implements PhoneRecordService {
@Override
public PageResult<PhoneRecordRespVO> getPhoneRecordPage(PhoneRecordPageReqVO pageReqVO) {
Page<PhoneRecordRespVO> page = new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize());
phoneRecordMapper.findListPage(page,pageReqVO);
phoneRecordMapper.findListPage(page, pageReqVO);
return new PageResult<>(page.getRecords(), page.getTotal());
}
@ -115,17 +122,18 @@ public class PhoneRecordServiceImpl implements PhoneRecordService {
@Override
public Boolean verifyPhone(String phone, String gear) {
JSONObject param = new JSONObject();
param.put("phone",phone);
param.put("gear",gear);
String result = HttpRequest.post(phoneUrl+"query/verify")
.header("token",token)
param.put("phone", phone);
param.put("gear", gear);
String result = HttpRequest.post(phoneUrl + "query/verify")
.header("token", token)
.body(JSONObject.toJSONString(param))
.execute()
.body();
JSONObject resultJson = JSONObject.parseObject(result);
if("0000".equals(resultJson.get("code"))){
log.info("query/verify:返回参数{}", resultJson);
if ("0000".equals(resultJson.get("code"))) {
return resultJson.getBoolean("body");
}else{
} else {
throw new ServiceException("手机号档位验证失败");
}
}
@ -141,13 +149,13 @@ public class PhoneRecordServiceImpl implements PhoneRecordService {
*/
@Override
public Boolean deletePhoneGear(String orderId) {
String result = HttpRequest.post(phoneUrl+"query/deleteReport?orderNo="+orderId)
.header("token",token)
String result = HttpRequest.post(phoneUrl + "query/deleteReport?orderNo=" + orderId)
.header("token", token)
.execute()
.body();
JSONObject resultJson = JSONObject.parseObject(result);
log.info("删除提报{}",JSONObject.toJSONString(resultJson));
if("0000".equals(resultJson.get("code"))){
log.info("删除提报{}", JSONObject.toJSONString(resultJson));
if ("0000".equals(resultJson.get("code"))) {
return true;
}
return false;
@ -166,14 +174,14 @@ public class PhoneRecordServiceImpl implements PhoneRecordService {
*/
@Override
public Boolean insertPhone(List<PhoneRecordAdd> data) {
String result = HttpRequest.post(phoneUrl+"query/createReport")
.header("token",token)
String result = HttpRequest.post(phoneUrl + "query/createReport")
.header("token", token)
.body(JSONObject.toJSONString(data))
.execute()
.body();
JSONObject resultJson = JSONObject.parseObject(result);
log.info("提报新增返回结果{}",JSONObject.toJSONString(resultJson));
if("0000".equals(resultJson.get("code"))){
log.info("提报新增返回结果{}", JSONObject.toJSONString(resultJson));
if ("0000".equals(resultJson.get("code"))) {
return true;
}
return false;

View File

@ -1,35 +1,33 @@
package cn.iocoder.yudao.module.shop.service.recharge;
import cn.iocoder.yudao.framework.common.exception.ServiceException;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.security.core.LoginUser;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.module.member.api.user.MemberUserApi;
import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO;
import cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.*;
import cn.iocoder.yudao.module.shop.convert.recharge.RechargeGearConvert;
import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.PhoneRecordDO;
import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.RechargeOrderDO;
import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.RechargeOrderInfoDO;
import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.RechargeGearDO;
import cn.iocoder.yudao.module.shop.dal.mysql.recharge.PhoneRecordMapper;
import cn.iocoder.yudao.module.shop.dal.mysql.recharge.RechargeGearMapper;
import cn.iocoder.yudao.module.shop.dal.mysql.recharge.RechargeOrderInfoMapper;
import cn.iocoder.yudao.module.shop.dal.mysql.recharge.RechargeOrderMapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import org.springframework.util.Assert;
import org.springframework.util.CollectionUtils;
import org.springframework.validation.annotation.Validated;
import java.util.*;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.*;
import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.RechargeGearDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.shop.convert.recharge.RechargeGearConvert;
import cn.iocoder.yudao.module.shop.dal.mysql.recharge.RechargeGearMapper;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.shop.enums.ErrorCodeConstants.*;
import static cn.iocoder.yudao.module.shop.enums.ErrorCodeConstants.RECHARGE_GEAR_NOT_EXISTS;
/**
* Service
@ -48,6 +46,8 @@ public class RechargeGearServiceImpl implements RechargeGearService {
private RechargeOrderMapper orderMapper;
@Resource
private PhoneRecordMapper phoneRecordMapper;
@Autowired
private MemberUserApi userService;
@Override
public Long createRechargeGear(RechargeGearCreateReqVO createReqVO) {
@ -104,6 +104,7 @@ public class RechargeGearServiceImpl implements RechargeGearService {
@Override
public List<RechargeGearRespVO> getGradeInfo() {
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
MemberUserRespDTO user = userService.getUser(loginUser.getId());
Assert.notNull(loginUser, "登录失效,请重新登录!");
List<RechargeGearDO> rechargeGearDOS = rechargeGearMapper.selectList(Wrappers.<RechargeGearDO>lambdaQuery()
.eq(RechargeGearDO::getDeleted, 0));
@ -111,7 +112,7 @@ public class RechargeGearServiceImpl implements RechargeGearService {
throw new ServiceException("未初始化档次信息!");
}
List<RechargeGearRespVO> rechargeGearRespVOS = RechargeGearConvert.INSTANCE.convertList(rechargeGearDOS);
List<PhoneRecordDO> infoDOS = phoneRecordMapper.selectList(Wrappers.<PhoneRecordDO>lambdaQuery().eq(PhoneRecordDO::getUserId, loginUser.getId()));
List<PhoneRecordDO> infoDOS = phoneRecordMapper.selectList(Wrappers.<PhoneRecordDO>lambdaQuery().eq(PhoneRecordDO::getPhone, user.getMobile()));
Map<Long, List<PhoneRecordDO>> collect = infoDOS.stream().collect(Collectors.groupingBy(PhoneRecordDO::getRechargeGearId));
rechargeGearRespVOS.forEach(vo -> {
List<PhoneRecordDO> infoDOS1 = collect.get(vo.getId());

View File

@ -76,4 +76,6 @@ public interface RechargeOrderService {
List<RechargeOrderRespVO> memberOrderInfo();
MemberHeadResponse memberHeadInfo();
List<RechargeOrderRespVO> memberOrderInfoByPhone(String phone);
}

View File

@ -171,4 +171,35 @@ public class RechargeOrderServiceImpl implements RechargeOrderService {
return response;
}
@Override
public List<RechargeOrderRespVO> memberOrderInfoByPhone(String phone) {
List<RechargeOrderDO> orderDOS = rechargeOrderMapper.selectList(Wrappers.<RechargeOrderDO>lambdaQuery()
.eq(RechargeOrderDO::getUserPhone, phone).eq(RechargeOrderDO::getPaid, 1));
if (!CollectionUtils.isEmpty(orderDOS)) {
List<RechargeOrderRespVO> rechargeOrderRespVOS = RechargeOrderConvert.INSTANCE.convertList(orderDOS);
List<String> collect1 = rechargeOrderRespVOS.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 : rechargeOrderRespVOS) {
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 rechargeOrderRespVOS;
}
return null;
}
}

View File

@ -3,6 +3,22 @@
<mapper namespace="cn.iocoder.yudao.module.shop.dal.mysql.express.ShippingTemplatesFreeMapper">
<select id="getListGroup" resultType="cn.iocoder.yudao.module.shop.controller.admin.express.vo.ShippingTemplatesFreeRespVO" parameterType="integer">
SELECT group_concat(`city_id`) AS city_id, province_id, `number`, price, uniqid FROM eb_shipping_templates_free where temp_id = #{tempId, jdbcType=INTEGER} GROUP BY `uniqid`,id ORDER BY id ASC
SELECT
city_id, province_id, title, `number`, price, uniqid
FROM
eb_shipping_templates_free es
JOIN
(
SELECT
MAX(id) id
FROM
eb_shipping_templates_free
where
temp_id = #{tempId, jdbcType=INTEGER}
GROUP BY
`uniqid`
ORDER BY id ASC
) a
ON a.id = es.id
</select>
</mapper>

View File

@ -3,6 +3,22 @@
<mapper namespace="cn.iocoder.yudao.module.shop.dal.mysql.express.ShippingTemplatesNoDeliveryMapper">
<select id="getList" resultType="cn.iocoder.yudao.module.shop.controller.admin.express.vo.ShippingTemplatesNoDeliveryRespVO" parameterType="integer">
SELECT group_concat(`city_id`) AS city_id, province_id, uniqid FROM eb_shipping_templates_no_delivery WHERE temp_id = #{tempId, jdbcType=INTEGER} GROUP BY `uniqid`,id ORDER BY id ASC
SELECT
city_id, province_id, title, uniqid
FROM
eb_shipping_templates_no_delivery es
JOIN
(
SELECT
MAX(id) id
FROM
eb_shipping_templates_no_delivery
where
temp_id = #{tempId, jdbcType=INTEGER}
GROUP BY
`uniqid`
ORDER BY id ASC
) a
ON a.id = es.id
</select>
</mapper>

View File

@ -3,6 +3,22 @@
<mapper namespace="cn.iocoder.yudao.module.shop.dal.mysql.express.ShippingTemplatesRegionMapper">
<select id="getListGroup" resultType="cn.iocoder.yudao.module.shop.controller.admin.express.vo.ShippingTemplatesRegionRespVO" parameterType="integer">
SELECT group_concat(`city_id`) AS city_id, province_id, `first`, first_price, `renewal`, renewal_price, uniqid FROM eb_shipping_templates_region where temp_id = #{tempId, jdbcType=INTEGER} GROUP BY `uniqid`,id ORDER BY id ASC
SELECT
city_id, province_id, `first`, first_price, title, `renewal`, renewal_price, uniqid
FROM
eb_shipping_templates_region es
JOIN
(
SELECT
MAX(id) id
FROM
eb_shipping_templates_region
where
temp_id = #{tempId, jdbcType=INTEGER}
GROUP BY
`uniqid`
ORDER BY id ASC
) a
ON a.id = es.id
</select>
</mapper>

View File

@ -80,7 +80,7 @@ public interface MemberUserApi {
MemberUserRespDTO getInfo();
void saveMemberUser(String phone);
void saveMemberUser(String phone,Long promoterId);
PromoterDTO getPromoterDOByUserId(Long userId);
}

View File

@ -5,9 +5,11 @@ import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
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.controller.app.auth.vo.AppAuthSmsLoginReqVO;
import cn.iocoder.yudao.module.member.convert.user.UserConvert;
import cn.iocoder.yudao.module.member.dal.dataobject.promoter.PromoterDO;
import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO;
import cn.iocoder.yudao.module.member.service.auth.MemberAuthService;
import cn.iocoder.yudao.module.member.service.promoter.PromoterService;
import cn.iocoder.yudao.module.member.service.user.MemberUserService;
import com.thoughtworks.xstream.core.SecurityUtils;
@ -31,6 +33,8 @@ public class MemberUserApiImpl implements MemberUserApi {
private MemberUserService userService;
@Resource
private PromoterService promoterService;
@Resource
private MemberAuthService authService;
@Override
@TenantIgnore
@ -103,8 +107,12 @@ public class MemberUserApiImpl implements MemberUserApi {
}
@Override
public void saveMemberUser(String phone) {
userService.saveMemberUser(phone);
public void saveMemberUser(String phone,Long promoterId) {
AppAuthSmsLoginReqVO reqVO = new AppAuthSmsLoginReqVO();
reqVO.setMobile(phone);
reqVO.setPromoterId(promoterId);
reqVO.setRealName("初始化账号");
authService.initialize(reqVO);
}
@Override

View File

@ -44,6 +44,14 @@ public interface MemberAuthService {
*/
Long register(@Valid AppAuthSmsLoginReqVO reqVO);
/**
*
*
* @param reqVO
* @return
*/
Long initialize(@Valid AppAuthSmsLoginReqVO reqVO);
/**
* 使 code

View File

@ -139,6 +139,19 @@ public class MemberAuthServiceImpl implements MemberAuthService {
return memberUserDO.getId();
}
@Override
public Long initialize(AppAuthSmsLoginReqVO reqVO) {
// 校验验证码
String userIp = getClientIP();
// 用户已经存在
MemberUserDO user = userService.getUserByMobile(reqVO.getMobile());
if (user != null) {
throw new ServiceException(ErrorCodeConstants.AUTH_MOBILE_EXISTS);
}
MemberUserDO memberUserDO = userService.createUserIfAbsent(reqVO.getMobile(),reqVO.getRealName(), userIp,reqVO.getPromoterId());
return memberUserDO.getId();
}
@Override
public AppAuthLoginRespVO socialLogin(AppAuthSocialLoginReqVO reqVO) {
// 使用 code 授权码,进行登录。然后,获得到绑定的用户编号

View File

@ -101,7 +101,7 @@ public class MemberUserServiceImpl implements MemberUserService {
user.setMobile(mobile);
user.setNickname(realName);
user.setStatus(CommonStatusEnum.ENABLE.getStatus()); // 默认开启
user.setPassword(encodePassword(password)); // 加密密码
user.setPassword(encodePassword("123456")); // 加密密码
user.setRegisterIp(registerIp);
user.setPromoterId(promoterId);
memberUserMapper.insert(user);

View File

@ -255,5 +255,5 @@ justauth:
timeout: 24h # 超时时长,目前只对 Redis 缓存生效,默认 3 分钟
phone:
query-url: http://192.168.1.189:4006/cyywl-phone-query-api/
query-url: http://phone.cyywl.top/cyywl-phone-query-api/
token: eyIwLnR5cCI6IkpXVCIsImFsZyI6IkhTNTEyIn0

View File

@ -6,7 +6,7 @@
width="70%"
:before-close="handleClose"
>
<el-form ref="ruleForm" :model="ruleForm" label-width="120px" size="mini" v-if="dialogVisible" :rules="rules">
<el-form ref="ruleForm" :model="ruleForm" label-width="180px" size="mini" v-if="dialogVisible" :rules="rules">
<el-form-item label="模板名称" prop="name">
<el-input v-model="ruleForm.name" class="withs" placeholder="请输入模板名称" />
</el-form-item>
@ -31,7 +31,6 @@
collapse-tags
clearable
filterable
@change="changeRegion"
/>
</template>
</el-table-column>
@ -306,9 +305,6 @@ export default {
noRegion: []
}
},
changeRegion(value) {
console.log(value)
},
changeRadio(num) {
this.columns = Object.assign({}, statusMap[num - 1])
},
@ -346,8 +342,10 @@ export default {
name: info.name,
type: info.type,
appoint: info.appoint,
noDelivery: info.noDelivery,
sort: info.sort
})
console.log(this.ruleForm)
this.columns = Object.assign({}, statusMap[this.ruleForm.type - 1])
this.$nextTick(() => {
loadingInstance.close()
@ -374,8 +372,8 @@ export default {
shippingRegion() {
logistics.shippingRegion({ tempId: this.tempId }).then(res => {
res.data.forEach((item, index) => {
item.title = JSON.parse(item.title)
item.city_ids = item.title
// item.title = JSON.parse(item.title)
item.city_ids = JSON.parse(item.title)
})
this.ruleForm.region = res.data
})
@ -385,23 +383,16 @@ export default {
logistics.shippingFree({ tempId: this.tempId }).then(res => {
res.data.forEach((item, index) => {
// item.title = JSON.parse(item.title)
item.city_ids = item.cityId.split(',')
item.city_ids = JSON.parse(item.title)
})
this.ruleForm.free = res.data
console.log(this.ruleForm.free )
})
},
//
shippingNodelivery() {
logistics.shippingNodelivery({ tempId: this.tempId }).then(res => {
res.data.forEach((item, index) => {
// item.title = JSON.parse(item.title)
item.city_ids = item.cityId.split(',')
})
this.ruleForm.noDelivery = res.data
console.log(this.ruleForm.noDelivery )
this.ruleForm.noRegion = JSON.parse(res.data[0].title)
})
},
removeChild(list){
@ -462,9 +453,11 @@ export default {
}
this.ruleForm.region.forEach((el, index) => {
if(el.city_ids.length > 0){
el.cityId = JSON.stringify(el.city_ids)
el.title = JSON.stringify(el.city_ids)
el.cityId = el.city_ids.join(",")
}else{
el.cityId = 'all'
el.title = 0
}
})
param.shippingTemplatesRegionRespVOList = this.ruleForm.region
@ -484,9 +477,11 @@ export default {
if (this.ruleForm.appoint) {
this.ruleForm.free.forEach((el, index) => {
if(el.city_ids.length > 0){
el.cityId = JSON.stringify(el.city_ids)
el.title = JSON.stringify(el.city_ids)
el.cityId = el.city_ids.join(",")
}else{
el.cityId = 'all'
el.title = 0
}
})
param.shippingTemplatesFreeRespVOList = this.ruleForm.free
@ -504,13 +499,10 @@ export default {
// })
}
if (this.ruleForm.noDelivery) {
param.shippingTemplatesNoDeliveryRespVOS = [{
cityId:[],
}]
this.ruleForm.noRegion.forEach((item,index) => {
param.shippingTemplatesNoDeliveryRespVOS[0].cityId.push(item[2])
})
param.shippingTemplatesNoDeliveryRespVOS[0].cityId = param.shippingTemplatesNoDeliveryRespVOS[0].cityId.join(",")
param.shippingTemplatesNoDeliveryRespVOS = {
title:JSON.stringify(this.ruleForm.noRegion),
cityId:this.ruleForm.noRegion.join(','),
}
}
if (this.type === 0) {
logistics.shippingSave(param).then(res => {

View File

@ -10,6 +10,10 @@
{
"launchtype" : "local"
},
"h5" :
{
"launchtype" : "local"
},
"mp-weixin" :
{
"launchtype" : "local"

View File

@ -15,6 +15,13 @@ export function memberOrderInfo(){
return request.get('api/order/member/memberOrderInfo', {})
}
/**
* 根据当前手机号获取账号的充值记录
*/
export function memberOrderInfoByPhone(phone){
return request.get(`api/order/member/memberOrderInfoByPhone?phone=${phone}`, {})
}
/**
* 查询权益档位信息
*/

View File

@ -216,7 +216,7 @@
width: 100%;
border-radius: 16rpx 16rpx 0 0;
background-color: #fff;
padding-bottom: 100rpx;
padding-bottom: 20%;
z-index: 99;
transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9);
transform: translate3d(0, 100%, 0);

View File

@ -1,14 +1,12 @@
// let domain = 'http://api.cyywl.top'
let domain = 'http://192.168.1.188:48080'
let domain = process.env.APP_BASE_URL
module.exports = {
// 请求域名 格式: https://您的域名
// #ifdef MP
HTTP_REQUEST_URL: domain,
// #endif
HTTP_ADMIN_URL:'http://api.cyywl.top', //PC后台的API请求地址上传图片用
// HTTP_ADMIN_URL:'http://192.168.1.188:48080', //PC后台的API请求地址上传图片用
HTTP_ADMIN_URL: process.env.APP_BASE_URL, //PC后台的API请求地址上传图片用
// #ifdef H5
//H5接口是浏览器地址
// HTTP_REQUEST_URL: window.location.protocol+"//"+window.location.host,

View File

@ -18,32 +18,32 @@ import { parseQuery } from "./utils";
import Auth from './libs/wechat';
import { SPREAD } from './config/cache';
Vue.prototype.$wechat = Auth;
let cookieName = "VCONSOLE",
query = parseQuery(),
urlSpread = query["spread"],
vconsole = query[cookieName.toLowerCase()],
md5Crmeb = "b14d1e9baeced9bb7525ab19ee35f2d2", //CRMEB MD5 加密开启vconsole模式
md5UnCrmeb = "3dca2162c4e101b7656793a1af20295c"; //UN_CREMB MD5 加密关闭vconsole模式
// let cookieName = "VCONSOLE",
// query = parseQuery(),
// urlSpread = query["spread"],
// // vconsole = query[cookieName.toLowerCase()],
// vconsole = "b14d1e9baeced9bb7525ab19ee35f2d2",
// md5Crmeb = "b14d1e9baeced9bb7525ab19ee35f2d2", //CRMEB MD5 加密开启vconsole模式
// md5UnCrmeb = "3dca2162c4e101b7656793a1af20295c"; //UN_CREMB MD5 加密关闭vconsole模式
if (urlSpread !== undefined) {
var spread = Cache.get(SPREAD);
urlSpread = parseInt(urlSpread);
if (!Number.isNaN(urlSpread) && spread !== urlSpread) {
Cache.set("spread", urlSpread || 0);
} else if (spread === 0 || typeof spread !== "number") {
Cache.set("spread", urlSpread || 0);
}
}
// if (urlSpread !== undefined) {
// var spread = Cache.get(SPREAD);
// urlSpread = parseInt(urlSpread);
// if (!Number.isNaN(urlSpread) && spread !== urlSpread) {
// Cache.set("spread", urlSpread || 0);
// } else if (spread === 0 || typeof spread !== "number") {
// Cache.set("spread", urlSpread || 0);
// }
// }
if (vconsole !== undefined) {
if (vconsole === md5UnCrmeb && Cache.has(cookieName))
Cache.clear(cookieName);
} else vconsole = Cache.get(cookieName);
// if (vconsole !== undefined) {
// if (vconsole === md5UnCrmeb && Cache.has(cookieName))
// Cache.clear(cookieName);
// } else vconsole = Cache.get(cookieName);
import VConsole from './components/vconsole.min.js'
if (vconsole !== undefined && vconsole === md5Crmeb) {
Cache.set(cookieName, md5Crmeb, 3600);
if (process.env.isVConsole) {
let vConsole = new VConsole();
}

View File

@ -13,5 +13,25 @@
"clipboard": "^2.0.11",
"html-to-image": "^1.11.11",
"qrcode": "^1.5.3"
},
"uni-app": {
"scripts": {
"dev": {
"title": "开发版",
"env": {
"UNI_PLATFORM": "h5",
"isVConsole": true,
"APP_BASE_URL": "http://192.168.1.147:48080"
}
},
"prod": {
"title": "生产版",
"env": {
"UNI_PLATFORM": "h5",
"isVConsole": false,
"APP_BASE_URL": "http://api.cyywl.top"
}
}
}
}
}

View File

@ -22,6 +22,12 @@
"navigationBarTitleText": "权益明细"
}
},
{
"path": "pages/member_back/index",
"style": {
"navigationBarTitleText": "话费返回"
}
},
{
"path": "pages/member_equity/index",
"style": {
@ -589,15 +595,15 @@
{
"pagePath": "pages/index/index",
"iconPath": "static/images/tabbar/nav_icon_shop.png",
"selectedIconPath": "static/images/1-002.png",
"selectedIconPath": "static/images/tabbar/nav_icon_shop_active.png",
"text": "商城"
},
// {
// "pagePath": "pages/goods_cate/goods_cate",
// "iconPath": "static/images/tabbar/nav_icon_sort.png",
// "selectedIconPath": "static/images/2-002.png",
// "text": "分类"
// },
{
"pagePath": "pages/goods_cate/goods_cate",
"iconPath": "static/images/tabbar/nav_icon_sort.png",
"selectedIconPath": "static/images/tabbar/nav_icon_sort_active.png",
"text": "分类"
},
{
"pagePath": "pages/member_application/index",
"iconPath": "static/images/tabbar/nav_icon_member.png",

View File

@ -40,7 +40,7 @@
<view class="right">
<view class="search">
<view class="icon">
</view>
<view class="input">
<u--input
@ -74,12 +74,12 @@
<view class="item" v-for="item in productList" @click="goDetail(item)">
<image :src="item.image" mode=""></image>
<view class="name">{{item.storeName}}</view>
<text><u--text color="#E50202" mode="price" :text="item.price"></u--text></text>
</view>
</view>
<view class="" style="margin-top: 110rpx;">
</view>
</view>
</template>
@ -108,13 +108,13 @@
import {
getTemlIds
} from '@/api/api.js';
// import {
// SUBSCRIBE_MESSAGE,
// TIPS_KEY
// } from '@/config/cache';
// #endif
// #ifdef H5
// #ifdef H5
import {
follow
} from '@/api/public.js';
@ -370,17 +370,17 @@
go(){
console.log(this.productList,'------')
},
// banneruserInfo
getBanners(){
// console.log(this.$store.tenantId,'tenantId')
getBanner().then(res=>{
this.bannerList = res.data.list[0]
console.log(this.bannerList,'banner')
})
console.log(this.userInfo.userId,'userInfo111111')
},
getCoupon: function(id, index) {
let that = this;
@ -487,7 +487,7 @@
this.getGroomList();
this.shareApi();
this.getcouponList();
// #ifdef H5
// that.subscribe = res.data.subscribe;
// #endif
@ -629,7 +629,7 @@
get_host_product: function() {
let that = this;
that.loading = true;
if (that.hotScroll) return
getProductHot(
that.hotPage,
@ -648,7 +648,9 @@
// H5
let appSearchH = uni.createSelectorQuery().select(".serch-wrapper");
appSearchH.boundingClientRect(function(data) {
self.searchH = data.height
if(data){
self.searchH = data.height
}
}).exec()
// #endif
},
@ -716,13 +718,13 @@
.left {
width: 164rpx;
height: 164rpx;
.image {
border: 3rpx solid #EE5423;
border-radius: 50%;
border: linear-gradient(0deg, #F77C4D, #EE5423);
}
}
.center {
width: 330rpx;
@ -801,7 +803,7 @@
display: flex;
justify-content: center;
align-items: center;
}
.hot {
width: 663rpx;
@ -810,7 +812,7 @@
margin-left: 44rpx;
background: #fff;
border-radius: 20rpx;
.contain {
width: 100%;
height: 1rpx;
@ -942,7 +944,7 @@
background: #fff;
overflow: hidden;
border-radius: 20rpx;
image {
width: 100%;
height: 294rpx;
@ -970,7 +972,7 @@
}
.car {
position: absolute;
width: 60rpx;
height: 60rpx;
background: url(@/static/images/shop/car.png);
@ -982,11 +984,11 @@
::v-deep .notice{
.u-icon__icon {
color: #FF4802 !important;
span {
font-size: 28rpx;
}
}
}
}
</style>

View File

@ -58,16 +58,6 @@
},
data() {
return {
// list: [
// {
// name:'',
// fontSize:'28'
// },
// {
// name:'',
// fontSize:'28'
// },
// ],
memberData: [],
payInfo: {
userPhone: '',
@ -97,7 +87,7 @@
};
},
async onLoad() {
async onShow() {
try{
uni.showLoading({
title: '加载中',
@ -106,7 +96,7 @@
const res = await memberGradeInfo()
if(res.data.some((item) => !!parseInt(item.isExist))){
uni.setTabBarItem({
index: 0,
index: 2,
pagePath: '/pages/member_equity/index'
})
uni.switchTab({
@ -114,7 +104,7 @@
})
}else{
uni.setTabBarItem({
index: 0,
index: 2,
pagePath: '/pages/member_application/index'
})
}

View File

@ -0,0 +1,325 @@
<template>
<view class="box">
<view class="list-item" >
<view class="item-title">
<view class="item-phone">
<view></view>
<text>充值号码{{memberDetail.userPhone}}</text>
</view>
</view>
<view class="item-text">
<text>充值档次{{memberDetail.grade}}</text>
</view>
</view>
<view class="box-equity">
<view class="equity-text">
<view >
<image src='../../static/images/memberLogo.png'></image>
<text class="equity-member">我的会员权益</text>
</view>
<text class="equity-look">查看权益></text>
</view>
<view class="equity-item" v-for="(item,index) in equityData" :key="index">
<view class="equity-grade">
<image :src='list[list.findIndex((i) => item.gear == i.name)].img'></image>
<text>办理日期{{item.startTime}}</text>
</view>
<view class="equity-money">
<view class="money-box money-completed">
<text>已返回金额</text>
<view>
<text class="money-text">{{item.totalMoney}}</text>
<text class="money-detailed" @click="handleDetailed(item.reportId)">></text>
</view>
</view>
<view class="money-box money-treat">
<text>带返还金额 () </text>
<text class="money-text">{{list[list.findIndex((i) => item.gear == i.name)].name-item.totalMoney}}</text>
</view>
<view class="money-box money-term">
<text>带返还期额</text>
<text class="money-text">{{item.frequency}}x12</text>
</view>
<view class="money-box money-time">
<text>返费结束时间</text>
<text class="money-text">{{item.endTime}}</text>
</view>
</view>
</view>
</view>
<u-navbar autoBack title="购买纪录"></u-navbar>
</view>
</template>
<script>
import {
memberHeadInfo,
memberGradeInfo,
query
} from '@/api/member.js';
import {
mapGetters
} from 'vuex'
export default {
name: "member_application",
data() {
return {
list: [
{
img:'../../static/images/member240.png',
name:360
},
{
img:'../../static/images/member400.png',
name:600
},
{
img:'../../static/images/member960.png',
name:900
},
],
vipData:['普通会员','中级会员','高级会员'],
show: false,
memberDetail:{},
equityData:[]
};
},
computed: mapGetters(['userInfo']),
async onLoad(options) {
this.memberDetail = options
const equity = await query(this.userInfo.mobile)
this.equityData = equity.data
},
methods: {
handleDetailed(reportId){
uni.navigateTo({
url:`/pages/member_detail/index?reportId=${reportId}`,
})
},
handleRenew(){
uni.navigateTo({
url:'/pages/member_renew/index'
})
},
handleRouter(value){
switch (value){
case "购买记录":
uni.navigateTo({
url:'/pages/member_record/index'
})
break;
case "为他人充值":
uni.navigateTo({
url:'/pages/member_others/index'
})
break;
default:
break;
}
},
}
};
</script>
<style lang="scss" scoped>
.box {
padding: 40rpx 20rpx;
margin-top: 10%;
background: #fff;
height: 100vh;
background: url(../../static/images/memberBg.png);
background-size: cover;
background-repeat: no-repeat;
background-attachment: fixed;
.list-item{
margin-bottom: 10%;
padding: 30rpx 16rpx 25rpx 16rpx;
background: #FDF0F1;
border-radius: 20rpx;
display: flex;
flex-direction: column;
justify-content: space-between;
.item-title{
display: flex;
justify-content: space-between;
.item-phone{
display: flex;
align-items: center;
font-size: 30rpx;
color: #E91D51;
view{
border-radius: 3rpx;
margin-right: 10rpx;
width: 5rpx;
height: 12rpx;
background: #E91D51;
}
}
button{
padding: 6rpx ;
font-size: 26rpx;
background: rgb(22,155,213);
color: #fff;
}
}
.item-text{
padding: 34rpx 12rpx;
background: #fff;
margin-top: 20rpx;
display: flex;
justify-content: space-between;
font-size: 30rpx;
}
}
.box-equity {
width: 100%;
padding: 0 40rpx;
background: url(../../static/images/memberEquity.png);
background-size: 100%;
background-repeat: no-repeat;
display: flex;
flex-direction: column;
position: relative;
.equity-text {
margin: 5% 0;
display: flex;
align-items: center;
height: 10%;
view{
display: flex;
align-items: center;
justify-content: center;
width: 44%;
image{
width: 26rpx;
height: 26rpx;
}
}
.equity-member {
margin: 0 10%;
font-size: 30rpx;
font-family: PingFang SC;
font-weight: 400;
color: #FFFFFF;
}
.equity-look {
font-size: 28rpx;
font-family: PingFang SC;
font-weight: 400;
color: #FF4922;
}
}
.equity-item {
background: #fff;
display: flex;
flex-direction: column;
justify-content: space-between;
border-radius: 20rpx;
margin: 0 20rpx 20rpx 20rpx;
.equity-grade {
border-radius: 10rpx 10rpx;
padding: 20rpx;
display: flex;
justify-content: space-between;
font-size: 24rpx;
font-family: PingFang SC;
font-weight: 400;
color: #000000;
image{
width: 295rpx;
height: 35rpx;
}
}
.equity-money {
display: flex;
justify-content: space-around;
flex-wrap: wrap;
.money-box {
width: 46%;
padding: 24rpx 25rpx;
border-radius: 10px;
display: flex;
flex-direction: column;
justify-content: space-between;
font-size: 28rpx;
font-family: PingFang SC;
font-weight: 400;
color: #000000;
margin-bottom: 18rpx;
.money-text {
font-size: 30rpx;
font-family: PingFang SC;
font-weight: 400;
}
}
.money-completed {
background: #FFF2F2;
border: 1px solid #F22E60;
.money-text {
color: #F91F57;
}
view {
margin-top: 26rpx;
display: flex;
justify-content: space-between;
align-items: center;
font-size: 24rpx;
font-family: PingFang SC;
font-weight: 400;
color: #000000;
}
}
.money-treat {
background: #FFFDF1;
border: 1px solid #FF962F;
.money-text {
margin-top: 26rpx;
color: #EBAF00;
}
}
.money-term {
background: #F8FFF8;
border: 1px solid #38A74F;
.money-text {
margin-top: 26rpx;
color: #2C9E2C;
}
}
.money-time {
background: #F0FDFC;
border: 1px solid #5CA4E8;
.money-text {
margin-top: 26rpx;
color: #2D7AC9;
}
}
}
}
}
}
</style>

View File

@ -10,11 +10,11 @@
<text>再升1级即可获得XX等6项权益</text>
<view class="left-button">
<view class="left-shopping" @click="handleRouter('购买记录')">
<text>购买记录</text>
<text>购买记录</text>
<image src="../../static/images/shopping-right.png" ></image>
</view>
<view class="left-others" @click="handleRouter('为他人充值')">
他人充值
他人充值
<image src="../../static/images/others-right.png" ></image>
</view>
</view>
@ -22,7 +22,7 @@
<view class="member-right">
<image src='../../static/images/vipStar.png'></image>
<text>会员等级{{vipData.findIndex((item) => item == memberDetail.grade) +1}}</text>
<button @click="handleRenew"></button>
<button @click="handleRenew" class="right-button">立即续</button>
</view>
</view>
<view class="box-equity">
@ -47,11 +47,11 @@
</view>
</view>
<view class="money-box money-treat">
<text>返还金额 () </text>
<text>返还金额 () </text>
<text class="money-text">{{list[list.findIndex((i) => item.gear == i.name)].name-item.totalMoney}}</text>
</view>
<view class="money-box money-term">
<text>返还期额</text>
<text>返还期额</text>
<text class="money-text">{{item.frequency}}x12</text>
</view>
<view class="money-box money-time">
@ -81,15 +81,15 @@
list: [
{
img:'../../static/images/member240.png',
name:'360'
name:360
},
{
img:'../../static/images/member400.png',
name:'600'
name:600
},
{
img:'../../static/images/member960.png',
name:'900'
name:900
},
],
vipData:['普通会员','中级会员','高级会员'],
@ -99,16 +99,16 @@
};
},
computed: mapGetters(['userInfo']),
async onLoad() {
async onShow() {
const resful = await memberGradeInfo()
if(resful.data.some((item) => !!parseInt(item.isExist))){
uni.setTabBarItem({
index: 0,
index: 2,
pagePath: '/pages/member_equity/index'
})
}else{
uni.setTabBarItem({
index: 0,
index: 2,
pagePath: '/pages/member_application/index'
})
uni.switchTab({
@ -117,8 +117,7 @@
}
const res = await memberHeadInfo()
this.memberDetail = res.data
// this.userInfo.mobile
const equity = await query(13668261228)
const equity = await query(this.userInfo.mobile)
this.equityData = equity.data
},
methods: {
@ -171,6 +170,7 @@
}
.box-member {
padding: 36rpx 40rpx;
border-radius: 20rpx;
@ -257,12 +257,12 @@
margin-bottom: 10rpx;
}
button {
.right-button {
border-radius: 18rpx;
margin-top: 10rpx;
padding: 7rpx 16rpx;
background: #F22E60;
border-image: linear-gradient(0deg, #A8052E, #FFFFFF) 10 10;
border-radius: 18rpx;
font-size: 22rpx;
font-family: PingFang SC;
font-weight: 400;

View File

@ -43,7 +43,6 @@
<script>
import {
memberGradeInfo,
memberByHomeGradeInfo
} from '@/api/member.js';
import paymentMember from '@/components/paymentMember';
@ -120,11 +119,11 @@
mask: true
});
try{
const res = await memberGradeInfo()
this.memberData = res.data
const res = await memberByHomeGradeInfo()
this.memberData = res.data
} finally{
uni.hideLoading();
}
uni.hideLoading();
}
},
watch:{
'form.confirmPhone' (){

View File

@ -3,13 +3,14 @@
<view class="box-seach">
<u-search placeholder="按手机号搜索查询" v-model="keyword" border-color="#F94B78" height="70" margin="0 0 35rpx 0" placeholder-color="#9C9C9C" bg-color="#fff" :show-action="false"></u-search>
</view>
<view class="list-item" v-for="(item,index) in memberData" :key="index">
<view class="list-item" v-for="(item,index) in memberData" :key="index" @click.stop="handleBack(item)">
<view class="item-title">
<view class="item-phone">
<view></view>
<text>充值号码{{item.userPhone}}</text>
</view>
<button v-show="item.bool" @click="handleService(item.orderId)">退</button>
<button v-show="item.bool && item.refundStatus == 0" @click.stop="handleService(item)">退</button>
<view v-show="item.refundStatus == 1">退</view>
</view>
<view class="item-text">
<text>充值档次{{item.grade}}</text>
@ -22,7 +23,7 @@
<script>
import {
memberOrderInfo,memberApplyRefund
memberOrderInfo,memberApplyRefund,memberOrderInfoByPhone
} from '@/api/member.js';
import { Debounce } from '@/utils/validate.js'
export default {
@ -34,38 +35,61 @@
};
},
async onLoad() {
let milliseconds = 2 * 3600 * 1000 // 7200000
let timestamp = new Date().getTime()
const res = await memberOrderInfo()
const arr = res.data.map((item) => {
return {
...item,
bool:item.createTime+milliseconds>timestamp
}
})
this.memberData = arr
await this.getList()
},
watch:{
keyword :Debounce (function (){
this.memberData.sort((a,b) =>{
let aIndex = this.keyword.indexOf(a.userPhone)
let bIndex = this.keyword.indexOf(b.userPhone)
console.log(aIndex,bIndex)
if(aIndex > bIndex) return -1
if(aIndex < bIndex) return 1
if(a.userPhone == b.userPhone){
return a.stringCreateTime - b.stringCreateTime
}else{
if(a.stringCreateTime<b.stringCreateTime) return -1
if(a.stringCreateTime>b.stringCreateTime) return 1
return 0
}
})
keyword :Debounce (async function (){
if(this.keyword == ''){
await this.getList()
}else{
await this.searchList()
}
},1000)
},
methods: {
async handleService(orderId){
await memberApplyRefund({orderId})
handleBack(item){
uni.navigateTo({
url:`/pages/member_back/index?userPhone=${item.userPhone}&grade=${item.grade}`
})
},
async searchList(){
let milliseconds = 2 * 3600 * 1000 // 7200000
let timestamp = new Date().getTime()
const res = await memberOrderInfoByPhone(this.keyword)
if(res.data){
const arr = res.data.map((item) => {
return {
...item,
bool:item.createTime+milliseconds>timestamp
}
})
this.memberData = arr
}else{
this.memberData = []
}
},
async getList(){
let milliseconds = 2 * 3600 * 1000 // 7200000
let timestamp = new Date().getTime()
const res = await memberOrderInfo()
if(res.data){
const arr = res.data.map((item) => {
return {
...item,
bool:item.createTime+milliseconds>timestamp
}
})
this.memberData = arr
}else{
this.memberData = []
}
},
async handleService(item){
await memberApplyRefund({orderId:item.id,type:3})
this.$util.Tips({
title: '申请成功'
});
await this.getList()
}
}
};
@ -75,11 +99,17 @@
.box {
margin-top: 10%;
padding: 20% 40rpx;
height: 100vh;
background: url(../../static/images/memberBg.png);
background-size: cover;
background-repeat: no-repeat;
background-attachment: fixed;
.box-seach{
padding: 10% 40rpx;
z-index: 999;
padding: 0 40rpx;
width: 100%;
position: fixed;
top: 3%;
top: 8%;
left: 0;
}
.list-item{

View File

@ -115,7 +115,7 @@
if (!that.mobile) return that.$util.Tips({
title: '请填写手机号码'
});
if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.mobile)) return that.$util.Tips({
if (!/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/.test(that.mobile)) return that.$util.Tips({
title: '请输入正确的手机号码'
});
if (!that.captcha) return that.$util.Tips({
@ -156,7 +156,7 @@
if (!that.mobile) return that.$util.Tips({
title: '请填写手机号码'
});
if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.mobile)) return that.$util.Tips({
if (!/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/.test(that.mobile)) return that.$util.Tips({
title: '请输入正确的手机号码'
});
if (!that.captcha) return that.$util.Tips({
@ -204,7 +204,7 @@
if (!that.mobile) return that.$util.Tips({
title: '请填写手机号码'
});
if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.mobile)) return that.$util.Tips({
if (!/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/.test(that.mobile)) return that.$util.Tips({
title: '请输入正确的手机号码'
});
await registerVerify(that.mobile, 1)

View File

@ -88,7 +88,7 @@
if (!this.registerForm.mobile) return this.$util.Tips({
title: '请填写手机号码'
});
if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(this.registerForm.mobile)) return this.$util.Tips({
if (!/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[1-25-9])\d{8}$/g.test(this.registerForm.mobile)) return this.$util.Tips({
title: '请输入正确的手机号码'
});
if(this.checked.length === 0) return this.$util.Tips({

View File

@ -85,7 +85,7 @@
if (!that.account) return that.$util.Tips({
title: '请填写手机号码'
});
if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.account)) return that.$util.Tips({
if (!/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/.test(that.account)) return that.$util.Tips({
title: '请输入正确的手机号码'
});
if (!that.captcha) return that.$util.Tips({
@ -114,7 +114,7 @@
if (!that.account) return that.$util.Tips({
title: '请填写手机号码'
});
if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.account)) return that.$util.Tips({
if (!/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/.test(that.account)) return that.$util.Tips({
title: '请输入正确的手机号码'
});
await registerVerify(that.account, 3)

View File

@ -11,7 +11,7 @@
<view class="text">可享一年返回<span>{{item.refundAmount}}</span>话费</view>
</view>
<view class="tips">
三个活动可同时参与每个手机号仅限一次最高可<span>1920</span>话费
三个活动可同时参与每个手机号仅限一次最高可<span>{{total}}</span>话费
</view>
<view class="service-phone">{{tenantInfo.serviceMobile}}</view>
<view class="tenant-info-wrap">
@ -55,7 +55,16 @@
isHideBtn: false
};
},
computed: mapGetters(['isLogin', 'uid', 'userInfo', 'tenantId', 'tenantInfo']),
computed:{
...mapGetters(['isLogin', 'uid', 'userInfo', 'tenantId', 'tenantInfo']),
total: function(){
let _total = 0
for (let active of this.activityList) {
_total+= parseInt(active.refundAmount)
}
return _total
},
},
onLoad() {
if (!this.isLogin) {
toLogin()
@ -77,6 +86,7 @@
quality: 0.95,
cacheBust: true
});
console.log('i', i)
}
htmlToImage.toPng(document.getElementById('poster-wrap'), {
quality: 0.95,
@ -89,7 +99,12 @@
that.$util.Tips({
title: '生成成功,长按保存图片'
})
});
}).catch(()=>{
that.$util.Tips({
title: '生成失败'
})
that.isHideBtn = false
})
},
//
make() {