ddfe94eb by joe

新增查找抽奖结果功能

1 parent 52562072
......@@ -249,7 +249,8 @@
"version": "1.0.0",
"resolved": "http://registry.npm.taobao.org/assert-plus/download/assert-plus-1.0.0.tgz",
"integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=",
"dev": true
"dev": true,
"optional": true
},
"assign-symbols": {
"version": "1.0.0",
......@@ -1886,6 +1887,7 @@
"resolved": "http://registry.npm.taobao.org/combined-stream/download/combined-stream-1.0.7.tgz",
"integrity": "sha1-LR0kMXr7ir6V1tLAsHtXgTU52Cg=",
"dev": true,
"optional": true,
"requires": {
"delayed-stream": "~1.0.0"
}
......@@ -2626,7 +2628,8 @@
"version": "1.0.0",
"resolved": "http://registry.npm.taobao.org/delayed-stream/download/delayed-stream-1.0.0.tgz",
"integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=",
"dev": true
"dev": true,
"optional": true
},
"depd": {
"version": "1.1.2",
......@@ -3356,7 +3359,8 @@
"version": "1.3.0",
"resolved": "http://registry.npm.taobao.org/extsprintf/download/extsprintf-1.3.0.tgz",
"integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=",
"dev": true
"dev": true,
"optional": true
},
"fast-deep-equal": {
"version": "1.1.0",
......@@ -3681,7 +3685,8 @@
"ansi-regex": {
"version": "2.1.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"aproba": {
"version": "1.2.0",
......@@ -3702,12 +3707,14 @@
"balanced-match": {
"version": "1.0.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"brace-expansion": {
"version": "1.1.11",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
......@@ -3722,17 +3729,20 @@
"code-point-at": {
"version": "1.1.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"concat-map": {
"version": "0.0.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"console-control-strings": {
"version": "1.1.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"core-util-is": {
"version": "1.0.2",
......@@ -3849,7 +3859,8 @@
"inherits": {
"version": "2.0.3",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"ini": {
"version": "1.3.5",
......@@ -3861,6 +3872,7 @@
"version": "1.0.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"number-is-nan": "^1.0.0"
}
......@@ -3875,6 +3887,7 @@
"version": "3.0.4",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"brace-expansion": "^1.1.7"
}
......@@ -3882,12 +3895,14 @@
"minimist": {
"version": "0.0.8",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"minipass": {
"version": "2.2.4",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"safe-buffer": "^5.1.1",
"yallist": "^3.0.0"
......@@ -3906,6 +3921,7 @@
"version": "0.5.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"minimist": "0.0.8"
}
......@@ -3986,7 +4002,8 @@
"number-is-nan": {
"version": "1.0.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"object-assign": {
"version": "4.1.1",
......@@ -3998,6 +4015,7 @@
"version": "1.4.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"wrappy": "1"
}
......@@ -4083,7 +4101,8 @@
"safe-buffer": {
"version": "5.1.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"safer-buffer": {
"version": "2.1.2",
......@@ -4119,6 +4138,7 @@
"version": "1.0.2",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
......@@ -4138,6 +4158,7 @@
"version": "3.0.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"ansi-regex": "^2.0.0"
}
......@@ -4181,12 +4202,14 @@
"wrappy": {
"version": "1.0.2",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"yallist": {
"version": "3.0.2",
"bundled": true,
"dev": true
"dev": true,
"optional": true
}
}
},
......@@ -5269,7 +5292,8 @@
"version": "0.1.1",
"resolved": "http://registry.npm.taobao.org/jsbn/download/jsbn-0.1.1.tgz",
"integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=",
"dev": true
"dev": true,
"optional": true
},
"jsesc": {
"version": "1.3.0",
......@@ -10181,7 +10205,8 @@
"version": "0.14.5",
"resolved": "http://registry.npm.taobao.org/tweetnacl/download/tweetnacl-0.14.5.tgz",
"integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=",
"dev": true
"dev": true,
"optional": true
},
"type-is": {
"version": "1.6.16",
......
......@@ -13,7 +13,7 @@ import {
let base = "/ocadminapi";
if (process.env.NODE_ENV == "development") {
base = 'http://admin.k.wxpai.cn/ocadminapi';
base = 'http://h5.k.wxpai.cn/ocadminapi';
}
//获取session
......@@ -36,6 +36,9 @@ axios.interceptors.request.use(
config => {
if (config.params) {
config.params.adminSessionId = getApiSession();
} else {
config.params = {};
config.params.adminSessionId = getApiSession();
}
//从data中传
// if (config.data) {
......@@ -201,3 +204,39 @@ export const addUser = params => {
params: params
}).then(res => res.data);
};
export const request = {
post(url, data) {
return axios.post(`${base}${url}`, data);
},
get(url, data) {
return axios.get(`${base}${url}`, { params: data });
},
form(url, params) {
let formData = new FormData(); //使用formData对象
for (let key in params) {
formData.append(key, params[key]);
}
let requestUrl = url.indexOf("://") >= 0 ? `${url}` : `${base}${url}`;
return axios.post(requestUrl, formData, formDataHeaders)
},
build(url, params) {
let fullUrl = `${base}${url}`;
let split = "";
for (let key in params) {
if (split) {
split = "&";
} else {
split = "?"
}
fullUrl += split + key + "=" + params[key];
}
return fullUrl;
},
requestDomain() {
return `${requestDomain}`
}
/*test*/
};
\ No newline at end of file
......
<template>
<section class="checkcode-container">
<!--工具条-->
<div class="toolbar">
<el-input width="200" v-model="filters.openid" placeholder="请输入用户openid"></el-input>
<el-switch
style="display: block"
v-model="switchValue"
active-color="#13ce66"
inactive-color="#ff4949"
active-text="只看发送失败"
inactive-text="全部结果"
></el-switch>
<el-button type="primary" :disabled="loading" v-on:click="reqGetDrawsnQuery">查询</el-button>
</div>
<template>
<div class="app-container" v-for="(application,index) in applications" :key="index">
<h3>{{application.appName}} {{application.appDir}}</h3>
<el-table
class="table"
highlight-current-row
v-loading="application.loading || loading"
:data="application.list"
>
<el-table-column label="openid" prop="openid"></el-table-column>
<el-table-column label="头像">
<template slot-scope="scope">
<div class="avatar">
<img v-show="scope.row.avatar" :src="scope.row.avatar" />
</div>
</template>
</el-table-column>
<el-table-column label="昵称" prop="nickname"></el-table-column>
<el-table-column label="串码" prop="drawSn"></el-table-column>
<el-table-column label="奖品名称" prop="prizeName"></el-table-column>
<el-table-column label="派发结果">
<template slot-scope="scope">
<el-tag type="success" v-if="scope.row.sendSuccess == 1">成功</el-tag>
<el-tooltip
v-if="scope.row.sendSuccess == 0"
class="item"
effect="dark"
:content="scope.row.failureReason"
placement="top-start"
>
<el-tag type="danger">失败</el-tag>
</el-tooltip>
</template>
</el-table-column>
<el-table-column label="中奖时间" :formatter="formatDate"></el-table-column>
<el-table-column label="派发结果">
<template slot-scope="scope">
<el-button
type="primary"
plain
v-if="scope.row.sendSuccess == 0"
@click="markSuccess(application,index,scope.row)"
:disabled="loading"
>标记成功</el-button>
</template>
</el-table-column>
</el-table>
<div class="tips">*标记成功的数据将于当日发送到portal平台</div>
</div>
</template>
<!--列表-->
<!-- <template>
<el-table
class="table"
highlight-current-row
v-loading="loading"
style="width: 100%;"
>
<el-table-column label="头像">
<template slot-scope="scope">
<div class="avatar">
<img v-show="scope.row.avatar" :src="scope.row.avatar" />
</div>
</template>
</el-table-column>
</el-table>
</template>-->
</section>
</template>
<script>
Date.prototype.format = function(fmt) {
var o = {
"M+": this.getMonth() + 1, //月份
"d+": this.getDate(), //日
"h+": this.getHours(), //小时
"m+": this.getMinutes(), //分
"s+": this.getSeconds(), //秒
"q+": Math.floor((this.getMonth() + 3) / 3), //季度
S: this.getMilliseconds() //毫秒
};
if (/(y+)/.test(fmt))
fmt = fmt.replace(
RegExp.$1,
(this.getFullYear() + "").substr(4 - RegExp.$1.length)
);
for (var k in o)
if (new RegExp("(" + k + ")").test(fmt))
fmt = fmt.replace(
RegExp.$1,
RegExp.$1.length == 1 ? o[k] : ("00" + o[k]).substr(("" + o[k]).length)
);
return fmt;
};
let urls = {
applications: "/admin/kd/application/available",
query: "/admin/kd/record/query",
change: "/admin/kd/record/success"
};
import { request } from "./../../api/api.js";
import { formatDate } from "./../../common/utils.js";
export default {
data() {
return {
loading: false,
filters: {
openid: "oUzSMtz0_YXWTTfi5WJfm2yqZa1I"
},
switchValue: true,
applications: [],
total: 0,
page: 1,
pageSize: 20,
searchNeedMinLength: 3
};
},
methods: {
init() {
request.get(urls.applications).then(res => {
this.applications = res.data.content;
console.log("this.applications==", this.applications);
this.applications.forEach(element => {
element.loading = false;
element.list = [];
});
});
},
markSuccess(application, index, row) {
let params = {
appCode: application.appCode,
recordCodes: [row.recordCode]
};
this.$confirm("请确保红包下发给用户后再标记成功哦!", "提示", {
confirmButtonText: "已经下发成功",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
this.loading = true;
request.post(urls.change, params).then(res => {
this.loading = false;
this._requestResult(index, application);
});
})
.catch(() => {});
},
formatDate: function(row, column) {
return row.createAt
? new Date(row.createAt).format("yyyy-MM-dd hh:mm:ss")
: "-";
},
reqGetDrawsnQuery() {
for (let index in this.applications) {
let application = this.applications[index];
this._requestResult(index, application);
}
},
_requestResult(index, application) {
let params = {
appCode: application.appCode,
onlyFailure: this.switchValue ? 1 : 0,
openid: this.filters.openid
};
application.loading = true;
this.$set(this.applications, index, application);
request.get(urls.query, params).then(res => {
application.list = res.data.content;
application.loading = false;
this.$set(this.applications, index, application);
console.log(this.applications);
});
}
},
mounted() {
this.init();
}
};
</script>
<style scoped lang="less">
.toolbar {
display: flex;
align-items: center;
}
.el-input {
width: 200px;
}
.el-switch {
margin: 0 20px;
}
.app-container {
width: 100%;
margin-top: 20px;
padding: 20px;
img {
max-width: 50px;
max-height: 50px;
}
}
.tips {
text-align: right;
color: #ff0000;
}
</style>
......@@ -16,6 +16,7 @@ import echarts from './../pages/charts/echarts.vue'
import Apps from './../pages/apps/Apps.vue'
import Report from './../pages/report/Report.vue'
import CheckCode from './../pages/checkcode/CheckCode.vue'
import LotteryQuery from './../pages/lottery/index.vue'
import {
COOKIES_EX
......@@ -75,6 +76,18 @@ const router = new Router({
name: '查码'
}]
},
{
path: '/',
component: Home,
name: '',
iconCls: 'fa fa-address-card',
leaf: true, //只有一个节点
children: [{
path: '/lottery/query',
component: LotteryQuery,
name: '抽奖查询'
}]
},
//{ path: '/main', component: Main },
// {
// path: '/',
......