Commit fb224db1 authored by 李硕's avatar 李硕

模板错误内容修改

parent 760b0b33
...@@ -27,17 +27,24 @@ ...@@ -27,17 +27,24 @@
</form-item> </form-item>
<form-item class="edit-content-formItem" label="发货状态" labelTextAlign="right"> <form-item class="edit-content-formItem" label="发货状态" labelTextAlign="right">
<select onChange="onSelectShipStatus"> <select onChange="onSelectShipStatus">
<option value="{{1}}">全部</option> <option value="{{1}}">全部实物</option>
<option value="{{2}}">未发货</option> <option value="{{2}}">未发货</option>
<option value="{{3}}">已发货</option> <option value="{{3}}">已发货</option>
</select> </select>
</form-item> </form-item>
<form-item class="edit-content-formItem" label="奖品类型"> <form-item class="edit-content-formItem" label="奖品类型">
<select onChange="onSelectPrizeType"> <select data-type="prizeType" onChange="onSelectPrizeType">
<option value="{{1}}">优惠券</option> <option value="{{1}}">优惠券</option>
<option value="{{3}}">实物</option> <option value="{{3}}">实物</option>
</select> </select>
</form-item> </form-item>
<form-item class="edit-content-formItem" label="发奖来源">
<select data-type="prizeDataType" onChange="onSelectPrizeType">
<option value="{{1}}">排行榜</option>
<option value="{{2}}">抽奖</option>
<option value="{{3}}">大转盘</option>
</select>
</form-item>
</form> </form>
<view a:if="{{isSearch}}" style="textAlign:right"> <view a:if="{{isSearch}}" style="textAlign:right">
......
...@@ -51,7 +51,7 @@ Component({ ...@@ -51,7 +51,7 @@ Component({
{ title: '发奖时间', prop: 'createTime' }, { title: '发奖时间', prop: 'createTime' },
{ title: '填地址时间', prop: 'receiveTime' }, { title: '填地址时间', prop: 'receiveTime' },
{ title: '用户昵称', prop: 'userNick' }, { title: '用户昵称', prop: 'userNick' },
{ title: '奖池类型', prop: 'prizeDataType' }, { title: '发奖来源', prop: 'prizeDataType' },
{ title: '奖品类型', prop: 'type' }, { title: '奖品类型', prop: 'type' },
{ title: '奖品名', prop: 'prizeName' }, { title: '奖品名', prop: 'prizeName' },
{ title: '收货人', prop: 'receiveName' }, { title: '收货人', prop: 'receiveName' },
...@@ -76,6 +76,7 @@ Component({ ...@@ -76,6 +76,7 @@ Component({
shipStatus: "", shipStatus: "",
timeRange: [], timeRange: [],
prizeType: "", prizeType: "",
prizeDataType: "",
showShip: false, showShip: false,
winactivityId: "", winactivityId: "",
pageNo: PageInfo.PAGE_NO, pageNo: PageInfo.PAGE_NO,
...@@ -109,6 +110,7 @@ Component({ ...@@ -109,6 +110,7 @@ Component({
timeRange: [], timeRange: [],
shipStatus: "", shipStatus: "",
prizeType: "", prizeType: "",
prizeDataType: "",
pageNo: PageInfo.PAGE_NO, pageNo: PageInfo.PAGE_NO,
pageSize: PageInfo.PAGE_SIZE, pageSize: PageInfo.PAGE_SIZE,
total: 0, total: 0,
...@@ -186,10 +188,10 @@ Component({ ...@@ -186,10 +188,10 @@ Component({
}, },
async exportWinnerListBySearch(evt) { async exportWinnerListBySearch(evt) {
const { activityId, title } = this.props.selectedItem; const { activityId, title } = this.props.selectedItem;
let { prizeId, userId, startT, endT, shipStatus, pageNo, pageSize, prizeType } = this.data; let { prizeId, userId, startT, endT, shipStatus, pageNo, pageSize, prizeType, prizeDataType } = this.data;
let timeStart = this.timeExchange(startT); let timeStart = this.timeExchange(startT);
let timeEnd = this.timeExchange(endT); let timeEnd = this.timeExchange(endT);
if (prizeId || userId || (timeStart && timeEnd) || shipStatus || prizeType) { if (prizeId || userId || (timeStart && timeEnd) || shipStatus || prizeType || prizeDataType) {
try { try {
console.log("导出名单数据接口"); console.log("导出名单数据接口");
const { success, data, message } = await exportAwardsInfoBySearch({ const { success, data, message } = await exportAwardsInfoBySearch({
...@@ -201,7 +203,8 @@ Component({ ...@@ -201,7 +203,8 @@ Component({
timeStart, timeStart,
timeEnd, timeEnd,
shipStatus, shipStatus,
prizeType prizeType,
prizeDataType
}); });
if (success) { if (success) {
if (!data) { if (!data) {
...@@ -258,12 +261,12 @@ Component({ ...@@ -258,12 +261,12 @@ Component({
// 《条件搜索》搜索 // 《条件搜索》搜索
async onChangeSearch() { async onChangeSearch() {
const { activityId, title } = this.props.selectedItem; const { activityId, title } = this.props.selectedItem;
let { prizeId, userId, startT, endT, pageNo, pageSize, shipStatus, prizeType } = this.data; let { prizeId, userId, startT, endT, pageNo, pageSize, shipStatus, prizeType, prizeDataType } = this.data;
let timeStart = this.timeExchange(startT); let timeStart = this.timeExchange(startT);
let timeEnd = this.timeExchange(endT); let timeEnd = this.timeExchange(endT);
console.log(prizeId, userId, timeStart, timeEnd, pageNo, pageSize, shipStatus, prizeType); console.log(prizeId, userId, timeStart, timeEnd, pageNo, pageSize, shipStatus, prizeType, prizeDataType);
if (prizeId || userId || (timeStart && timeEnd) || shipStatus === 0 || shipStatus || prizeType > 0) { if (prizeId || userId || (timeStart && timeEnd) || shipStatus === 0 || shipStatus || prizeType || prizeDataType) {
let rewardList = await findWinnerInfoListBySearch({ activityId, pageNo, pageSize, title, prizeId, userId, timeStart, timeEnd, shipStatus, prizeType }); let rewardList = await findWinnerInfoListBySearch({ activityId, pageNo, pageSize, title, prizeId, userId, timeStart, timeEnd, shipStatus, prizeType, prizeDataType });
if (rewardList.data.list.length == 0) { if (rewardList.data.list.length == 0) {
this.setData({ this.setData({
list: [], list: [],
...@@ -326,14 +329,15 @@ Component({ ...@@ -326,14 +329,15 @@ Component({
}, },
// 《条件搜索》奖品类型筛选 // 《条件搜索》奖品类型筛选
onSelectPrizeType(e) { onSelectPrizeType(e) {
let { type } = e.target.dataset;
console.log('筛选奖品类型e>>>', e); console.log('筛选奖品类型e>>>', e);
this.setData({ this.setData({
prizeType: e.detail.value, [type]: e.detail.value,
pageNo: PageInfo.PAGE_NO, pageNo: PageInfo.PAGE_NO,
pageSize: PageInfo.PAGE_SIZE, pageSize: PageInfo.PAGE_SIZE,
total: 0, total: 0,
}); });
console.log("type", this.data.prizeType); console.log("type", this.data[type]);
}, },
// 《条件搜索》更换页码时调用接口 // 《条件搜索》更换页码时调用接口
onChangePageNo(e) { onChangePageNo(e) {
......
...@@ -60,7 +60,7 @@ const findWinnerInfoList = async (context) => { ...@@ -60,7 +60,7 @@ const findWinnerInfoList = async (context) => {
// ); // );
// console.log(`awardslist:》》》 ${JSON.stringify(awardslist)}《《《`); // console.log(`awardslist:》》》 ${JSON.stringify(awardslist)}《《《`);
awardslist.map((item) => { awardslist.map((item) => {
let ad = item.province + item.city + item.area + item.addressdetail, type0 = item.type; let ad = item.province + item.city + item.area + item.addressDetail, type0 = item.type;
item.prizeId = item._id; item.prizeId = item._id;
item.createTime = formatTime(new Date(item.createTime)) || ""; item.createTime = formatTime(new Date(item.createTime)) || "";
item.receiveTime = item.receiveTime ? formatTime(new Date(item.receiveTime)) : '未填'; item.receiveTime = item.receiveTime ? formatTime(new Date(item.receiveTime)) : '未填';
...@@ -109,7 +109,7 @@ const exportAwardsList = async (context) => { ...@@ -109,7 +109,7 @@ const exportAwardsList = async (context) => {
"中奖时间", "中奖时间",
"地址填写时间", "地址填写时间",
"用户昵称", "用户昵称",
"奖品种类", "发奖来源",
"奖品类型", "奖品类型",
"中奖名称", "中奖名称",
"收货人", "收货人",
...@@ -136,7 +136,7 @@ const exportAwardsList = async (context) => { ...@@ -136,7 +136,7 @@ const exportAwardsList = async (context) => {
v.prizeName || "", v.prizeName || "",
v.type == 1 ? "/" : v.receiveName || "", v.type == 1 ? "/" : v.receiveName || "",
v.type == 1 ? "/" : v.phone || "未填", v.type == 1 ? "/" : v.phone || "未填",
v.type == 1 ? "/" : (v.province ? v.province + v.city + v.area + v.addressdetail : "未填"), v.type == 1 ? "/" : (v.province ? v.province + v.city + v.area + v.addressDetail : "未填"),
v.type == 1 ? "/" : shipMsg[v.shipStatus], v.type == 1 ? "/" : shipMsg[v.shipStatus],
v.type == 1 ? "/" : v.shipCompany || "/", v.type == 1 ? "/" : v.shipCompany || "/",
v.type == 1 ? "/" : v.shipNum || "/", v.type == 1 ? "/" : v.shipNum || "/",
...@@ -171,7 +171,7 @@ const exportAwardsList = async (context) => { ...@@ -171,7 +171,7 @@ const exportAwardsList = async (context) => {
const exportAwardsInfoBySearch = async (context) => { const exportAwardsInfoBySearch = async (context) => {
/******VV */ /******VV */
let { cloud } = context; let { cloud } = context;
let { activityId, title, prizeId, userId: userNick, timeStart, timeEnd, shipStatus, prizeType } = context.data; let { activityId, title, prizeId, userId: userNick, timeStart, timeEnd, shipStatus, prizeType, prizeDataType } = context.data;
if (!activityId) { if (!activityId) {
return resultsModel.error(CODE_TYPES.PARAMS_ERROR, `缺少activityId`); return resultsModel.error(CODE_TYPES.PARAMS_ERROR, `缺少activityId`);
} }
...@@ -179,7 +179,7 @@ const exportAwardsInfoBySearch = async (context) => { ...@@ -179,7 +179,7 @@ const exportAwardsInfoBySearch = async (context) => {
return resultsModel.error(CODE_TYPES.PARAMS_ERROR, `缺少title`); return resultsModel.error(CODE_TYPES.PARAMS_ERROR, `缺少title`);
} }
console.log("prizeId=====", prizeId); console.log("prizeId=====", prizeId);
if (!prizeId && !userNick && !timeStart && !timeEnd && !shipStatus && !prizeType) { if (!prizeId && !userNick && !timeStart && !timeEnd && !shipStatus && !prizeType && !prizeDataType) {
return resultsModel.error(CODE_TYPES.PARAMS_ERROR, `未填写筛选信息`); return resultsModel.error(CODE_TYPES.PARAMS_ERROR, `未填写筛选信息`);
} }
console.log("activityId--1--", activityId, "prizeId--1-", prizeId, "userNick--1-", userNick, "timeStart--1-", timeStart, "timeEnd--1-", timeEnd); console.log("activityId--1--", activityId, "prizeId--1-", prizeId, "userNick--1-", userNick, "timeStart--1-", timeStart, "timeEnd--1-", timeEnd);
...@@ -187,7 +187,15 @@ const exportAwardsInfoBySearch = async (context) => { ...@@ -187,7 +187,15 @@ const exportAwardsInfoBySearch = async (context) => {
/*******/ /*******/
let rankopenprizeService = new RankopenprizeService(context); let rankopenprizeService = new RankopenprizeService(context);
// 获取活动中奖列表 // 获取活动中奖列表
let total = await rankopenprizeService.getTotalObjectCount(activityId, prizeId, userNick, timeStart, timeEnd, shipStatus, prizeType); let total = await rankopenprizeService.getTotalObjectCount(
activityId,
prizeId,
userNick,
timeStart,
timeEnd,
shipStatus,
prizeType,
prizeDataType);
let awardslist = []; let awardslist = [];
//导出中奖名单的pagesize和pageNo //导出中奖名单的pagesize和pageNo
let pageSize0 = 500; let pageSize0 = 500;
...@@ -198,15 +206,30 @@ const exportAwardsInfoBySearch = async (context) => { ...@@ -198,15 +206,30 @@ const exportAwardsInfoBySearch = async (context) => {
pageNo = i; pageNo = i;
let awardMore = await rankopenprizeService.getUserPrizeByActivityId( let awardMore = await rankopenprizeService.getUserPrizeByActivityId(
activityId, activityId,
pageNo, pageSize0, pageNo,
prizeId, userNick, timeStart, timeEnd, shipStatus, prizeType pageSize0,
prizeId,
userNick,
timeStart,
timeEnd,
shipStatus,
prizeType,
prizeDataType
); );
awardslist = awardslist.concat(awardMore); awardslist = awardslist.concat(awardMore);
} }
} else { } else {
awardslist = await rankopenprizeService.getUserPrizeByActivityId( awardslist = await rankopenprizeService.getUserPrizeByActivityId(
activityId, activityId,
pageNo, total, prizeId, userNick, timeStart, timeEnd, shipStatus, prizeType pageNo,
total,
prizeId,
userNick,
timeStart,
timeEnd,
shipStatus,
prizeType,
prizeDataType
); );
} }
console.log(`awardslist:》》》 ${JSON.stringify(awardslist)}《《《`); console.log(`awardslist:》》》 ${JSON.stringify(awardslist)}《《《`);
...@@ -218,7 +241,7 @@ const exportAwardsInfoBySearch = async (context) => { ...@@ -218,7 +241,7 @@ const exportAwardsInfoBySearch = async (context) => {
"中奖时间", "中奖时间",
"地址填写时间", "地址填写时间",
"用户昵称", "用户昵称",
"奖品种类", "发奖来源",
"奖品类型", "奖品类型",
"中奖名称", "中奖名称",
"收货人", "收货人",
...@@ -245,7 +268,7 @@ const exportAwardsInfoBySearch = async (context) => { ...@@ -245,7 +268,7 @@ const exportAwardsInfoBySearch = async (context) => {
v.prizeName || "", v.prizeName || "",
v.type == 1 ? "/" : v.receiveName || "", v.type == 1 ? "/" : v.receiveName || "",
v.type == 1 ? "/" : v.phone || "未填", v.type == 1 ? "/" : v.phone || "未填",
v.type == 1 ? "/" : (v.province ? v.province + v.city + v.area + v.addressdetail : "未填"), v.type == 1 ? "/" : (v.province ? v.province + v.city + v.area + v.addressDetail : "未填"),
v.type == 1 ? "/" : shipMsg[v.shipStatus], v.type == 1 ? "/" : shipMsg[v.shipStatus],
v.type == 1 ? "/" : v.shipCompany || "/", v.type == 1 ? "/" : v.shipCompany || "/",
v.type == 1 ? "/" : v.shipNum || "/", v.type == 1 ? "/" : v.shipNum || "/",
...@@ -280,7 +303,7 @@ const exportAwardsInfoBySearch = async (context) => { ...@@ -280,7 +303,7 @@ const exportAwardsInfoBySearch = async (context) => {
//筛选中奖名单 //筛选中奖名单
const findWinnerInfoListBySearch = async (context) => { const findWinnerInfoListBySearch = async (context) => {
let { cloud } = context; let { cloud } = context;
let { activityId, title, pageNo, pageSize, prizeId, userId: userNick, timeStart, timeEnd, shipStatus, prizeType } = context.data; let { activityId, title, pageNo, pageSize, prizeId, userId: userNick, timeStart, timeEnd, shipStatus, prizeType, prizeDataType } = context.data;
console.log('data>>>>>', context.data) console.log('data>>>>>', context.data)
if (!activityId) { if (!activityId) {
return resultsModel.error(CODE_TYPES.PARAMS_ERROR, `缺少activityId`); return resultsModel.error(CODE_TYPES.PARAMS_ERROR, `缺少activityId`);
...@@ -289,13 +312,13 @@ const findWinnerInfoListBySearch = async (context) => { ...@@ -289,13 +312,13 @@ const findWinnerInfoListBySearch = async (context) => {
return resultsModel.error(CODE_TYPES.PARAMS_ERROR, `缺少title`); return resultsModel.error(CODE_TYPES.PARAMS_ERROR, `缺少title`);
} }
console.log("prizeId=====", prizeId); console.log("prizeId=====", prizeId);
if (!prizeId && !userNick && !timeStart && !timeEnd && !shipStatus && !prizeType) { if (!prizeId && !userNick && !timeStart && !timeEnd && !shipStatus && !prizeType && !prizeDataType) {
return resultsModel.error(CODE_TYPES.PARAMS_ERROR, `未填写筛选信息`); return resultsModel.error(CODE_TYPES.PARAMS_ERROR, `未填写筛选信息`);
} }
let rankopenprizeService = new RankopenprizeService(context); let rankopenprizeService = new RankopenprizeService(context);
console.log("activityId----", activityId, "prizeId---", prizeId, "userNick---", userNick, "timeStart---", timeStart, "timeEnd---", timeEnd, shipStatus); console.log("activityId----", activityId, "prizeId---", prizeId, "userNick---", userNick, "timeStart---", timeStart, "timeEnd---", timeEnd, shipStatus);
// 获取活动中奖列表 // 获取活动中奖列表
let total = await rankopenprizeService.getTotalObjectCount(activityId, prizeId, userNick, timeStart, timeEnd, shipStatus, prizeType); let total = await rankopenprizeService.getTotalObjectCount(activityId, prizeId, userNick, timeStart, timeEnd, shipStatus, prizeType, prizeDataType);
console.log("totle=========", total); console.log("totle=========", total);
let awardslist = []; let awardslist = [];
if (total > 10) { if (total > 10) {
...@@ -309,7 +332,8 @@ const findWinnerInfoListBySearch = async (context) => { ...@@ -309,7 +332,8 @@ const findWinnerInfoListBySearch = async (context) => {
timeStart, timeStart,
timeEnd, timeEnd,
shipStatus, shipStatus,
prizeType prizeType,
prizeDataType
); );
// console.list() // console.list()
awardslist = awardslist.concat(awardMore); awardslist = awardslist.concat(awardMore);
...@@ -323,13 +347,14 @@ const findWinnerInfoListBySearch = async (context) => { ...@@ -323,13 +347,14 @@ const findWinnerInfoListBySearch = async (context) => {
timeStart, timeStart,
timeEnd, timeEnd,
shipStatus, shipStatus,
prizeType prizeType,
prizeDataType
); );
console.log('awardslist>>>>', awardslist) console.log('awardslist>>>>', awardslist)
} }
console.log(`awardslist:》》》 ${JSON.stringify(awardslist)}《《《`); console.log(`awardslist:》》》 ${JSON.stringify(awardslist)}《《《`);
awardslist.map((item) => { awardslist.map((item) => {
let ad = item.province + item.city + item.area + item.addressdetail, type0 = item.type; let ad = item.province + item.city + item.area + item.addressDetail, type0 = item.type;
item.prizeId = item._id; item.prizeId = item._id;
item.createTime = formatTime(new Date(item.createTime)) || ""; item.createTime = formatTime(new Date(item.createTime)) || "";
item.receiveTime = item.receiveTime ? formatTime(new Date(item.receiveTime)) : '未填'; item.receiveTime = item.receiveTime ? formatTime(new Date(item.receiveTime)) : '未填';
......
...@@ -58,7 +58,7 @@ class ActivityTopService { ...@@ -58,7 +58,7 @@ class ActivityTopService {
let result = await this.activitySellerDao.find({ let result = await this.activitySellerDao.find({
openId, openId,
}); });
return { session:(result.length && result[0].accessToken) || this.context.accessToken }; return { session: (result.length && result[0].accessToken) || this.context.accessToken };
} }
//淘宝top接口获取商品列表 //淘宝top接口获取商品列表
...@@ -238,9 +238,9 @@ class ActivityTopService { ...@@ -238,9 +238,9 @@ class ActivityTopService {
} = this.context.data; } = this.context.data;
let data = { let data = {
fields: GOODSINFO, fields: GOODSINFO,
page_no: pageNo, pageNo,
q: title, q: title,
page_size: pageSize, pageSize,
...sellerConfig, ...sellerConfig,
}; };
console.log(data, "data"); console.log(data, "data");
......
...@@ -70,7 +70,8 @@ class RankopenprizeService { ...@@ -70,7 +70,8 @@ class RankopenprizeService {
) )
: ''; : '';
let t = type ? { type: +type } : ''; let t = type ? { type: +type } : '';
let arr = [p, u, c, s, t]; let d = prizeDataType ? { prizeDataType: +prizeDataType } : '';
let arr = [p, u, c, s, t, d];
arr = arr.filter((i) => { return i }); arr = arr.filter((i) => { return i });
console.log('arr--222---', arr); console.log('arr--222---', arr);
return await this.rankopenprizeDao.find( return await this.rankopenprizeDao.find(
...@@ -100,9 +101,9 @@ class RankopenprizeService { ...@@ -100,9 +101,9 @@ class RankopenprizeService {
) )
) )
: ''; : '';
let t = type ? { type: +type } : '' let t = type ? { type: +type } : '';
let arr = [p, u, c, s, t]; let d = prizeDataType ? { prizeDataType: +prizeDataType } : '';
arr = arr.filter((i) => { return i }); let arr = [p, u, c, s, t, d];
console.log('arr--111---', arr, "s>>>", s); console.log('arr--111---', arr, "s>>>", s);
return await this.rankopenprizeDao.count({ return await this.rankopenprizeDao.count({
activityId, activityId,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment