Merge remote-tracking branch 'origin/main'

This commit is contained in:
DESKTOP-369JRHT\12997 2024-10-17 13:57:56 +08:00
commit 442f1aa0ac
10 changed files with 154 additions and 71 deletions

View File

@ -243,6 +243,11 @@ export default {
},
methods: {
updateMax(item) {
this.cardCouponList.forEach(item1 => {
if (item.vouchersId==item1.id){
item.giftCardName = item1.name
}
})
//
item.giftCardTotal = 1;
//

View File

@ -264,16 +264,16 @@ public class ActiveAppletServiceImpl extends ServiceImpl<ActiveAppletMapper, Act
.eq(ActiveRecommendRecords::getStoreId, storeId)
.eq(ActiveRecommendRecords::getUserId, nowAccountInfo.getId()));
//通过券ids查询券信息
for (ActiveRecommendRecords activeRecommendRecord : activeRecommendRecords) {
String[] split = activeRecommendRecord.getActiveRecommendIds().split(",");
List<ActiveRecommendChild> cardCoupons = activeRecommendChildMapper.selectList(new LambdaQueryWrapper<ActiveRecommendChild>()
.in(ActiveRecommendChild::getId, split));
if (cardCoupons != null) {
List<String> collect = cardCoupons.stream().map(ActiveRecommendChild::getGiftCardName).collect(Collectors.toList());
activeRecommendRecord.setCouponNames(collect);
}
}
// //通过券ids查询券信息
// for (ActiveRecommendRecords activeRecommendRecord : activeRecommendRecords) {
// String[] split = activeRecommendRecord.getActiveRecommendIds().split(",");
// List<ActiveRecommendChild> cardCoupons = activeRecommendChildMapper.selectList(new LambdaQueryWrapper<ActiveRecommendChild>()
// .in(ActiveRecommendChild::getId, split));
// if (cardCoupons != null) {
// List<String> collect = cardCoupons.stream().map(ActiveRecommendChild::getGiftCardName).collect(Collectors.toList());
// activeRecommendRecord.setCouponNames(collect);
// }
// }
return activeRecommendRecords;
}

View File

@ -96,5 +96,15 @@ public class ActiveRecommendRecordsController extends BaseController {
public ResponseObject delete(@RequestParam("idList") List<Long> idList) {
return getSuccessResult(this.activeRecommendRecordsService.removeByIds(idList));
}
/**
* 查询邀请记录奖励列表
* @param storeId
* @return
*/
@GetMapping("selectRecord")
public ResponseObject selectRecord(Integer storeId){
return getSuccessResult(this.activeRecommendRecordsService.selectAll(storeId));
}
}

View File

@ -48,7 +48,8 @@ public class ActiveRecommendRecords extends Model<ActiveRecommendRecords> {
//更新时间
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
private Date updateTime;
private String activeRecommendIds;
private String vouchersIds;
private String vouchersNames;
private Integer points;
private Integer growthValue;
@TableField(exist = false)

View File

@ -5,6 +5,9 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.fuint.business.marketingActivity.activeRecommend.dto.ActiveRecommendRecordsDTO;
import com.fuint.business.marketingActivity.activeRecommend.entity.ActiveRecommendRecords;
import com.fuint.business.marketingActivity.activeRecommend.vo.RecordsVo;
import java.util.List;
/**
* 邀请有礼记录表(ActiveRecommendRecords)表服务接口
@ -42,5 +45,12 @@ public interface ActiveRecommendRecordsService extends IService<ActiveRecommendR
* @param payType 支付方式
*/
void recommendMembersRechargePolite(Integer storeId,Integer inviteeUserId, String payType);
/**
* 领奖记录
* @param storeId
* @return
*/
List<RecordsVo> selectAll(Integer storeId);
}

View File

@ -23,6 +23,7 @@ import com.fuint.business.marketingActivity.activeRecommend.service.ActiveRecomm
import com.fuint.business.marketingActivity.activeRecommend.service.ActiveRecommendService;
import com.fuint.business.marketingActivity.activeRecommend.vo.ActiveRecommendRecordsVO;
import com.fuint.business.marketingActivity.activeRecommend.vo.ActiveRecommendVO;
import com.fuint.business.marketingActivity.activeRecommend.vo.RecordsVo;
import com.fuint.business.marketingActivity.activeUserRecharge.entity.ActiveUserRecharge;
import com.fuint.business.marketingActivity.activeUserRecharge.entity.ActiveUserRechargeChild;
import com.fuint.business.marketingActivity.activeUserRecharge.entity.ActiveUserRechargeRecords;
@ -58,6 +59,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
@ -470,6 +472,39 @@ public class ActiveRecommendRecordsServiceImpl extends ServiceImpl<ActiveRecomme
}
}
@Override
public List<RecordsVo> selectAll(Integer storeId) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
List<ActiveRecommendRecords> activeRecommendRecords = baseMapper.selectList(new LambdaQueryWrapper<ActiveRecommendRecords>()
.eq(ActiveRecommendRecords::getStoreId, storeId)
.eq(ActiveRecommendRecords::getUserId, nowAccountInfo.getId()));
List<RecordsVo> recordsVos = new ArrayList<>();
for (ActiveRecommendRecords activeRecommendRecord : activeRecommendRecords) {
if (ObjectUtil.isNotEmpty(activeRecommendRecord.getPoints())) {
RecordsVo recordsVo = new RecordsVo();
recordsVo.setName(activeRecommendRecord.getPoints() + "积分");
recordsVo.setTime(activeRecommendRecord.getCreateTime().toString());
recordsVos.add(recordsVo);
}
if (ObjectUtil.isNotEmpty(activeRecommendRecord.getGrowthValue())) {
RecordsVo recordsVo1 = new RecordsVo();
recordsVo1.setName(activeRecommendRecord.getGrowthValue() + "成长值");
recordsVo1.setTime(activeRecommendRecord.getCreateTime().toString());
recordsVos.add(recordsVo1);
}
String[] split = activeRecommendRecord.getVouchersNames().split(",");
if (split.length > 0) {
for (String s : split) {
RecordsVo recordsVo2 = new RecordsVo();
recordsVo2.setName(s);
recordsVo2.setTime(activeRecommendRecord.getCreateTime().toString());
recordsVos.add(recordsVo2);
}
}
}
return recordsVos;
}
private boolean isTimeBetween(Date activeStartTime, Date activeEndTime, DateTime now) {
if (now.isAfterOrEquals(activeStartTime) && now.isBeforeOrEquals(activeEndTime)) {
return true;

View File

@ -0,0 +1,9 @@
package com.fuint.business.marketingActivity.activeRecommend.vo;
import lombok.Data;
@Data
public class RecordsVo {
private String name;
private String time;
}

View File

@ -4,33 +4,24 @@
<view class="box-hang">
<view class="dis">活动名称</view>
<view class="">
<text>{{activeInfo.name}}</text>
<text>{{activeInfo.activeName}}</text>
</view>
</view>
<view class="box-hang">
<view class="dis">活动时间</view>
<view class="">
<text>长期有效</text>
<text>{{activeInfo.activeStartTime || '--'}}~{{activeInfo.activeEndTime || ""}}</text>
</view>
</view>
<view class="box-hang">
<view class="dis">推荐人等级</view>
<view class="">
<text>{{activeInfo.userGradeName}}</text>
</view>
</view>
<view class="box-hang">
<view class="dis">支付方式</view>
<view class="">
<text>微信支付宝云闪付现金pos刷卡</text>
</view>
</view>
<view class="box-hang">
<view class="dis">赠送优惠券</view>
<view class="">
<text>50元优惠券</text>
<view v-if="activeInfo.couponList">
<view class="box-hang" v-for="(item,index) in activeInfo.couponList" :key="index">
<view class="dis">赠送优惠券</view>
<view class="">
<text>{{item.giftCardName || "--"}}</text>
</view>
</view>
</view>
<view class="box-hang">
<view class="dis">赠送积分</view>
<view class="">
@ -43,6 +34,12 @@
<text>{{activeInfo.growaValue || 0}}成长值</text>
</view>
</view>
<view class="box-hang">
<view class="dis">活动详情</view>
<view class="">
<text>{{activeInfo.activityDetails || "--"}}</text>
</view>
</view>
</view>
</view>
</template>

View File

@ -19,9 +19,9 @@
<view class="min-size">奖励记录</view>
</view>
</view>
<view class="or-aniu">
<button class="or-aniu" open-type="share">
立即分享
</view>
</button>
</view>
<view class="h_bs">
<view class="title_">推荐会员消费有礼</view>
@ -33,7 +33,7 @@
<view v-if="activeInfo.couponList">
<view class="si_" v-for="(item,index) in activeInfo.couponList" :key="index">
<view class="">赠送优惠券</view>
<view class="">{{item.giftCardName}}</view>
<view class="">{{item.giftCardName || "--"}}</view>
</view>
</view>
@ -44,7 +44,7 @@
<view class="backf">
<view class="n_hang">
<view class="">特权说明</view>
<view class="">{{activeInfo.discountActiveDescribe}}</view>
<view class="">加油立享优惠</view>
</view>
<view class="n_hang">
<view class="">有效期</view>
@ -74,10 +74,11 @@
<view class="title_or">扫码领会员</view>
<view class="d-s">
<view class="touxiang">
<image src="../../static/logo.png" mode=""></image>
<image v-if="!store.logo" src="../../static/logo.png" mode=""></image>
<image v-else :src="baseUrl+store.logo" mode=""></image>
</view>
<view class="">
<view class="tiitle_">百业兴加油站</view>
<view class="tiitle_">{{store.name}}</view>
<view class="size_">油站会员卡</view>
</view>
</view>
@ -129,6 +130,7 @@
export default {
data() {
return {
titles:"",
query: {
storeId: ''
},
@ -154,6 +156,8 @@
lon: "",
//
lat: "",
// url
baseUrl: this.$baseUrl,
//
store: {
name: "测试油站",
@ -168,6 +172,13 @@
// '&userId=' + uni.getStorageSync('userId') + '&type=yaoqingyouli'
// console.log(codes);
// this.query.storeId = uni.getStorageSync("storeId");
// #ifdef MP-WEIXIN
wx.showShareMenu({
withShareTicket: true,
//Menus
menus: ["shareAppMessage", "shareTimeline"]
})
// #endif
},
onShow() {
this.getAllAmount();
@ -205,7 +216,7 @@
wx.onShareAppMessage(function() {
return {
title: '来个油惠',
title: '矩油惠 百业兴',
path: '/pages/index/index',
imageUrl: 'https://example.com/share.jpg',
success: function(res) {
@ -219,10 +230,11 @@
},
onShareAppMessage(res) {
if (res.from === 'button') { //
console.log(res.target)
console.log(res.target,233)
}
return {
title: '来个油惠',
title: '矩油惠 百业兴',
path: '/pages/index/index?storeId=' + uni.getStorageSync('storeId') + '&userId=' + uni
.getStorageSync('userId') + '&type=yaoqingyouli'
}
@ -252,9 +264,10 @@
//
savePicture() {
console.log(230);
let url = this.options.code;
//
uni.downloadFile({
url: 'https://www.example.com/file/test', //
url: url,
success: (res) => {
if (res.statusCode === 200) {
console.log('下载成功');

View File

@ -1,7 +1,7 @@
<template>
<view class="content">
<view class="container">
<view class="top_box">
<!-- <view class="top_box">
<view class="two_t">
<view class="">浏览人数</view>
<view class="size_">50</view>
@ -10,7 +10,7 @@
<view class="">注册人数</view>
<view class="size_">50</view>
</view>
</view>
</view> -->
<view class="tab_">
<view class="t-box" :class="{'orsize' : tindex == index }" v-for="(item,index) in tabList" :key="index"
@click="setIndex(index)">{{item.name}}</view>
@ -22,16 +22,24 @@
</view>
</view>
<view class="whit-box" v-else>
<view class="one_h" v-for="(item,index) in 4" :key="index">
<view class="one_h" v-for="(item,index) in list" :key="index">
<view class="d-s">
<view class="touxiang">
<image src="../../static/logo.png" mode=""></image>
</view>
<view class="">名字</view>
<view class="">{{item.inviteeUserName || "--"}}</view>
</view>
<view class="">2024-8-7</view>
<view class="">{{item.createTime}}</view>
</view>
</view>
<view v-if="tindex == 1 && rewardList.length==0">
<u-empty mode="list" icon="http://cdn.uviewui.com/uview/empty/list.png">
</u-empty>
</view>
<view v-if="tindex != 1 && list.length==0">
<u-empty mode="list" icon="http://cdn.uviewui.com/uview/empty/list.png">
</u-empty>
</view>
</view>
</view>
</template>
@ -51,15 +59,12 @@
}
],
List: [],
list: [],
pageNo: 1,
pageSize: 10,
totalPage: '',
rewardList: []
}
},
onLoad() {
},
onPullDownRefresh() {
//
@ -82,6 +87,12 @@
components: {
},
onLoad() {
},
onShow() {
this.getList()
},
methods: {
setIndex(num) {
@ -92,30 +103,22 @@
this.pageNo = 1
this.pageSize = 10
this.totalPage = ''
this.List = []
this.list = []
},
//
async getList() {
uni.showLoading({
title: '加载中'
});
let res = await request({
url: '网络请求',
//
getList() {
request({
url: '/business/marketingActivity/activeApplet/getRecommendedRecordsByStoreId',
method: 'get',
data: {
pageNo: this.pageNo,
pageSize: this.pageSize,
params: {
storeId: uni.getStorageSync("storeId")
}
}).then(res => {
console.log(res, 106)
if (res.code == 200) {
this.list = res.data
}
})
if (res.code == 200) {
uni.hideLoading(); //
if (this.pageNo != 1) {
this.List = this.ruleList.concat(res.result.records)
} else {
this.List = res.result.records
}
this.totalPage = res.result.pages
}
},
goback() {
uni.navigateBack()
@ -133,7 +136,7 @@
width: 100%;
height: 100vh;
box-sizing: border-box;
padding-top: 15px;
}
.top_box {
@ -185,7 +188,7 @@
.whit-box {
width: 95%;
background: #fff;
margin: 15px;
margin: 10px auto;
}