From ccc03895a7afb2a75c0aa898bae7e0e317623e70 Mon Sep 17 00:00:00 2001 From: liaozetao <1107136310@qq.com> Date: Fri, 23 Feb 2024 20:35:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=AE=B8=E6=84=BF=E8=BD=AE?= =?UTF-8?q?=E6=AC=A1=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/wishingStar/wishingStar.js | 25 +++++++ src/utils/system-helper.js | 34 ++++++++- src/views/wishingStar/wishingRound.vue | 96 +++++++++++++++++++------- 3 files changed, 130 insertions(+), 25 deletions(-) diff --git a/src/api/wishingStar/wishingStar.js b/src/api/wishingStar/wishingStar.js index 327c6db..a089a96 100644 --- a/src/api/wishingStar/wishingStar.js +++ b/src/api/wishingStar/wishingStar.js @@ -36,3 +36,28 @@ export const promiseStarConfigUpdateEnable = query => { data: query }); }; + +export const promiseStarRoundPage = query => { + return request({ + url: '/admin/promiseStarRound/page', + method: 'get', + params: query + }); +}; + +export const promiseStarUserRecordGetPromiseUsers = query => { + return request({ + url: '/admin/promiseStarUserRecord/getPromiseUsers', + method: 'get', + params: query + }); +}; + +export const promiseStarUserRecordSetUserWhite = query => { + return request({ + url: '/admin/promiseStarUserRecord/setUserWhite', + headers:{"Content-Type": 'application/x-www-form-urlencoded'}, + method: 'post', + data: query + }); +}; diff --git a/src/utils/system-helper.js b/src/utils/system-helper.js index 43edf12..2004767 100644 --- a/src/utils/system-helper.js +++ b/src/utils/system-helper.js @@ -1,6 +1,38 @@ //获取url中的参数 -function getUrlParam(name) { +export function getUrlParam(name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象 var r = window.location.search.substr(1).match(reg); //匹配目标参数 if (r != null) return unescape(r[2]); return null; //返回参数值 +} + +export function dateFormat (date, fmt) { + date = new Date(date); + var o = { + 'M+': date.getMonth() + 1, + 'd+': date.getDate(), + 'h+': date.getHours(), + 'm+': date.getMinutes(), + 's+': date.getSeconds() + }; + + // 补全0 + let padLeftZero = (str) => { + return ('00' + str).substr(str.length); + } + + // 年份 + if (/(y+)/.test(fmt)) { + fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length)); + } + + // 月日时分秒 + for (var k in o) { + if (new RegExp('(' + k + ')').test(fmt)) { + var str = o[k] + ''; + fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? str : padLeftZero(str)); + } + } + + date = o = padLeftZero = null; + return fmt; } \ No newline at end of file diff --git a/src/views/wishingStar/wishingRound.vue b/src/views/wishingStar/wishingRound.vue index fdacbf9..e1e6a35 100644 --- a/src/views/wishingStar/wishingRound.vue +++ b/src/views/wishingStar/wishingRound.vue @@ -31,46 +31,48 @@ - - + + - + - + + + - id:{{ scope.row.x }} - 名称:{{ scope.row.x }} - 价值:{{ scope.row.x }} + id:{{ scope.row.giftId }} + 名称:{{ scope.row.giftName }} + 价值:{{ scope.row.giftPrice }} - + - 人数: {{ scope.row.x }}人数: {{ scope.row.userCount ?? 0 }} - 白名单:{{ scope.row.x }} + 白名单:{{ scope.row.whiteCount ?? 0 }} - {{ scope.row.x }}/{{ scope.row.x }} + {{ scope.row.processNum }}/{{ scope.row.targetNum }} - 用户id:{{ scope.row.x }} - 用户昵称:{{ scope.row.x }} + 用户id:{{ scope.row.winnerErBanNo }} + 用户昵称:{{ scope.row.winnerNick }} @@ -94,9 +96,9 @@ - - - + + +