ddfe94eb by joe

新增查找抽奖结果功能

1 parent 52562072
...@@ -249,7 +249,8 @@ ...@@ -249,7 +249,8 @@
249 "version": "1.0.0", 249 "version": "1.0.0",
250 "resolved": "http://registry.npm.taobao.org/assert-plus/download/assert-plus-1.0.0.tgz", 250 "resolved": "http://registry.npm.taobao.org/assert-plus/download/assert-plus-1.0.0.tgz",
251 "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", 251 "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=",
252 "dev": true 252 "dev": true,
253 "optional": true
253 }, 254 },
254 "assign-symbols": { 255 "assign-symbols": {
255 "version": "1.0.0", 256 "version": "1.0.0",
...@@ -1886,6 +1887,7 @@ ...@@ -1886,6 +1887,7 @@
1886 "resolved": "http://registry.npm.taobao.org/combined-stream/download/combined-stream-1.0.7.tgz", 1887 "resolved": "http://registry.npm.taobao.org/combined-stream/download/combined-stream-1.0.7.tgz",
1887 "integrity": "sha1-LR0kMXr7ir6V1tLAsHtXgTU52Cg=", 1888 "integrity": "sha1-LR0kMXr7ir6V1tLAsHtXgTU52Cg=",
1888 "dev": true, 1889 "dev": true,
1890 "optional": true,
1889 "requires": { 1891 "requires": {
1890 "delayed-stream": "~1.0.0" 1892 "delayed-stream": "~1.0.0"
1891 } 1893 }
...@@ -2626,7 +2628,8 @@ ...@@ -2626,7 +2628,8 @@
2626 "version": "1.0.0", 2628 "version": "1.0.0",
2627 "resolved": "http://registry.npm.taobao.org/delayed-stream/download/delayed-stream-1.0.0.tgz", 2629 "resolved": "http://registry.npm.taobao.org/delayed-stream/download/delayed-stream-1.0.0.tgz",
2628 "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", 2630 "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=",
2629 "dev": true 2631 "dev": true,
2632 "optional": true
2630 }, 2633 },
2631 "depd": { 2634 "depd": {
2632 "version": "1.1.2", 2635 "version": "1.1.2",
...@@ -3356,7 +3359,8 @@ ...@@ -3356,7 +3359,8 @@
3356 "version": "1.3.0", 3359 "version": "1.3.0",
3357 "resolved": "http://registry.npm.taobao.org/extsprintf/download/extsprintf-1.3.0.tgz", 3360 "resolved": "http://registry.npm.taobao.org/extsprintf/download/extsprintf-1.3.0.tgz",
3358 "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", 3361 "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=",
3359 "dev": true 3362 "dev": true,
3363 "optional": true
3360 }, 3364 },
3361 "fast-deep-equal": { 3365 "fast-deep-equal": {
3362 "version": "1.1.0", 3366 "version": "1.1.0",
...@@ -3681,7 +3685,8 @@ ...@@ -3681,7 +3685,8 @@
3681 "ansi-regex": { 3685 "ansi-regex": {
3682 "version": "2.1.1", 3686 "version": "2.1.1",
3683 "bundled": true, 3687 "bundled": true,
3684 "dev": true 3688 "dev": true,
3689 "optional": true
3685 }, 3690 },
3686 "aproba": { 3691 "aproba": {
3687 "version": "1.2.0", 3692 "version": "1.2.0",
...@@ -3702,12 +3707,14 @@ ...@@ -3702,12 +3707,14 @@
3702 "balanced-match": { 3707 "balanced-match": {
3703 "version": "1.0.0", 3708 "version": "1.0.0",
3704 "bundled": true, 3709 "bundled": true,
3705 "dev": true 3710 "dev": true,
3711 "optional": true
3706 }, 3712 },
3707 "brace-expansion": { 3713 "brace-expansion": {
3708 "version": "1.1.11", 3714 "version": "1.1.11",
3709 "bundled": true, 3715 "bundled": true,
3710 "dev": true, 3716 "dev": true,
3717 "optional": true,
3711 "requires": { 3718 "requires": {
3712 "balanced-match": "^1.0.0", 3719 "balanced-match": "^1.0.0",
3713 "concat-map": "0.0.1" 3720 "concat-map": "0.0.1"
...@@ -3722,17 +3729,20 @@ ...@@ -3722,17 +3729,20 @@
3722 "code-point-at": { 3729 "code-point-at": {
3723 "version": "1.1.0", 3730 "version": "1.1.0",
3724 "bundled": true, 3731 "bundled": true,
3725 "dev": true 3732 "dev": true,
3733 "optional": true
3726 }, 3734 },
3727 "concat-map": { 3735 "concat-map": {
3728 "version": "0.0.1", 3736 "version": "0.0.1",
3729 "bundled": true, 3737 "bundled": true,
3730 "dev": true 3738 "dev": true,
3739 "optional": true
3731 }, 3740 },
3732 "console-control-strings": { 3741 "console-control-strings": {
3733 "version": "1.1.0", 3742 "version": "1.1.0",
3734 "bundled": true, 3743 "bundled": true,
3735 "dev": true 3744 "dev": true,
3745 "optional": true
3736 }, 3746 },
3737 "core-util-is": { 3747 "core-util-is": {
3738 "version": "1.0.2", 3748 "version": "1.0.2",
...@@ -3849,7 +3859,8 @@ ...@@ -3849,7 +3859,8 @@
3849 "inherits": { 3859 "inherits": {
3850 "version": "2.0.3", 3860 "version": "2.0.3",
3851 "bundled": true, 3861 "bundled": true,
3852 "dev": true 3862 "dev": true,
3863 "optional": true
3853 }, 3864 },
3854 "ini": { 3865 "ini": {
3855 "version": "1.3.5", 3866 "version": "1.3.5",
...@@ -3861,6 +3872,7 @@ ...@@ -3861,6 +3872,7 @@
3861 "version": "1.0.0", 3872 "version": "1.0.0",
3862 "bundled": true, 3873 "bundled": true,
3863 "dev": true, 3874 "dev": true,
3875 "optional": true,
3864 "requires": { 3876 "requires": {
3865 "number-is-nan": "^1.0.0" 3877 "number-is-nan": "^1.0.0"
3866 } 3878 }
...@@ -3875,6 +3887,7 @@ ...@@ -3875,6 +3887,7 @@
3875 "version": "3.0.4", 3887 "version": "3.0.4",
3876 "bundled": true, 3888 "bundled": true,
3877 "dev": true, 3889 "dev": true,
3890 "optional": true,
3878 "requires": { 3891 "requires": {
3879 "brace-expansion": "^1.1.7" 3892 "brace-expansion": "^1.1.7"
3880 } 3893 }
...@@ -3882,12 +3895,14 @@ ...@@ -3882,12 +3895,14 @@
3882 "minimist": { 3895 "minimist": {
3883 "version": "0.0.8", 3896 "version": "0.0.8",
3884 "bundled": true, 3897 "bundled": true,
3885 "dev": true 3898 "dev": true,
3899 "optional": true
3886 }, 3900 },
3887 "minipass": { 3901 "minipass": {
3888 "version": "2.2.4", 3902 "version": "2.2.4",
3889 "bundled": true, 3903 "bundled": true,
3890 "dev": true, 3904 "dev": true,
3905 "optional": true,
3891 "requires": { 3906 "requires": {
3892 "safe-buffer": "^5.1.1", 3907 "safe-buffer": "^5.1.1",
3893 "yallist": "^3.0.0" 3908 "yallist": "^3.0.0"
...@@ -3906,6 +3921,7 @@ ...@@ -3906,6 +3921,7 @@
3906 "version": "0.5.1", 3921 "version": "0.5.1",
3907 "bundled": true, 3922 "bundled": true,
3908 "dev": true, 3923 "dev": true,
3924 "optional": true,
3909 "requires": { 3925 "requires": {
3910 "minimist": "0.0.8" 3926 "minimist": "0.0.8"
3911 } 3927 }
...@@ -3986,7 +4002,8 @@ ...@@ -3986,7 +4002,8 @@
3986 "number-is-nan": { 4002 "number-is-nan": {
3987 "version": "1.0.1", 4003 "version": "1.0.1",
3988 "bundled": true, 4004 "bundled": true,
3989 "dev": true 4005 "dev": true,
4006 "optional": true
3990 }, 4007 },
3991 "object-assign": { 4008 "object-assign": {
3992 "version": "4.1.1", 4009 "version": "4.1.1",
...@@ -3998,6 +4015,7 @@ ...@@ -3998,6 +4015,7 @@
3998 "version": "1.4.0", 4015 "version": "1.4.0",
3999 "bundled": true, 4016 "bundled": true,
4000 "dev": true, 4017 "dev": true,
4018 "optional": true,
4001 "requires": { 4019 "requires": {
4002 "wrappy": "1" 4020 "wrappy": "1"
4003 } 4021 }
...@@ -4083,7 +4101,8 @@ ...@@ -4083,7 +4101,8 @@
4083 "safe-buffer": { 4101 "safe-buffer": {
4084 "version": "5.1.1", 4102 "version": "5.1.1",
4085 "bundled": true, 4103 "bundled": true,
4086 "dev": true 4104 "dev": true,
4105 "optional": true
4087 }, 4106 },
4088 "safer-buffer": { 4107 "safer-buffer": {
4089 "version": "2.1.2", 4108 "version": "2.1.2",
...@@ -4119,6 +4138,7 @@ ...@@ -4119,6 +4138,7 @@
4119 "version": "1.0.2", 4138 "version": "1.0.2",
4120 "bundled": true, 4139 "bundled": true,
4121 "dev": true, 4140 "dev": true,
4141 "optional": true,
4122 "requires": { 4142 "requires": {
4123 "code-point-at": "^1.0.0", 4143 "code-point-at": "^1.0.0",
4124 "is-fullwidth-code-point": "^1.0.0", 4144 "is-fullwidth-code-point": "^1.0.0",
...@@ -4138,6 +4158,7 @@ ...@@ -4138,6 +4158,7 @@
4138 "version": "3.0.1", 4158 "version": "3.0.1",
4139 "bundled": true, 4159 "bundled": true,
4140 "dev": true, 4160 "dev": true,
4161 "optional": true,
4141 "requires": { 4162 "requires": {
4142 "ansi-regex": "^2.0.0" 4163 "ansi-regex": "^2.0.0"
4143 } 4164 }
...@@ -4181,12 +4202,14 @@ ...@@ -4181,12 +4202,14 @@
4181 "wrappy": { 4202 "wrappy": {
4182 "version": "1.0.2", 4203 "version": "1.0.2",
4183 "bundled": true, 4204 "bundled": true,
4184 "dev": true 4205 "dev": true,
4206 "optional": true
4185 }, 4207 },
4186 "yallist": { 4208 "yallist": {
4187 "version": "3.0.2", 4209 "version": "3.0.2",
4188 "bundled": true, 4210 "bundled": true,
4189 "dev": true 4211 "dev": true,
4212 "optional": true
4190 } 4213 }
4191 } 4214 }
4192 }, 4215 },
...@@ -5269,7 +5292,8 @@ ...@@ -5269,7 +5292,8 @@
5269 "version": "0.1.1", 5292 "version": "0.1.1",
5270 "resolved": "http://registry.npm.taobao.org/jsbn/download/jsbn-0.1.1.tgz", 5293 "resolved": "http://registry.npm.taobao.org/jsbn/download/jsbn-0.1.1.tgz",
5271 "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", 5294 "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=",
5272 "dev": true 5295 "dev": true,
5296 "optional": true
5273 }, 5297 },
5274 "jsesc": { 5298 "jsesc": {
5275 "version": "1.3.0", 5299 "version": "1.3.0",
...@@ -10181,7 +10205,8 @@ ...@@ -10181,7 +10205,8 @@
10181 "version": "0.14.5", 10205 "version": "0.14.5",
10182 "resolved": "http://registry.npm.taobao.org/tweetnacl/download/tweetnacl-0.14.5.tgz", 10206 "resolved": "http://registry.npm.taobao.org/tweetnacl/download/tweetnacl-0.14.5.tgz",
10183 "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", 10207 "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=",
10184 "dev": true 10208 "dev": true,
10209 "optional": true
10185 }, 10210 },
10186 "type-is": { 10211 "type-is": {
10187 "version": "1.6.16", 10212 "version": "1.6.16",
......
...@@ -13,7 +13,7 @@ import { ...@@ -13,7 +13,7 @@ import {
13 13
14 let base = "/ocadminapi"; 14 let base = "/ocadminapi";
15 if (process.env.NODE_ENV == "development") { 15 if (process.env.NODE_ENV == "development") {
16 base = 'http://admin.k.wxpai.cn/ocadminapi'; 16 base = 'http://h5.k.wxpai.cn/ocadminapi';
17 } 17 }
18 18
19 //获取session 19 //获取session
...@@ -36,6 +36,9 @@ axios.interceptors.request.use( ...@@ -36,6 +36,9 @@ axios.interceptors.request.use(
36 config => { 36 config => {
37 if (config.params) { 37 if (config.params) {
38 config.params.adminSessionId = getApiSession(); 38 config.params.adminSessionId = getApiSession();
39 } else {
40 config.params = {};
41 config.params.adminSessionId = getApiSession();
39 } 42 }
40 //从data中传 43 //从data中传
41 // if (config.data) { 44 // if (config.data) {
...@@ -201,3 +204,39 @@ export const addUser = params => { ...@@ -201,3 +204,39 @@ export const addUser = params => {
201 params: params 204 params: params
202 }).then(res => res.data); 205 }).then(res => res.data);
203 }; 206 };
207
208
209
210 export const request = {
211 post(url, data) {
212 return axios.post(`${base}${url}`, data);
213 },
214 get(url, data) {
215 return axios.get(`${base}${url}`, { params: data });
216 },
217 form(url, params) {
218 let formData = new FormData(); //使用formData对象
219 for (let key in params) {
220 formData.append(key, params[key]);
221 }
222 let requestUrl = url.indexOf("://") >= 0 ? `${url}` : `${base}${url}`;
223 return axios.post(requestUrl, formData, formDataHeaders)
224 },
225 build(url, params) {
226 let fullUrl = `${base}${url}`;
227 let split = "";
228 for (let key in params) {
229 if (split) {
230 split = "&";
231 } else {
232 split = "?"
233 }
234 fullUrl += split + key + "=" + params[key];
235 }
236 return fullUrl;
237 },
238 requestDomain() {
239 return `${requestDomain}`
240 }
241 /*test*/
242 };
...\ No newline at end of file ...\ No newline at end of file
......
1 <template>
2 <section class="checkcode-container">
3 <!--工具条-->
4 <div class="toolbar">
5 <el-input width="200" v-model="filters.openid" placeholder="请输入用户openid"></el-input>
6 <el-switch
7 style="display: block"
8 v-model="switchValue"
9 active-color="#13ce66"
10 inactive-color="#ff4949"
11 active-text="只看发送失败"
12 inactive-text="全部结果"
13 ></el-switch>
14 <el-button type="primary" :disabled="loading" v-on:click="reqGetDrawsnQuery">查询</el-button>
15 </div>
16
17 <template>
18 <div class="app-container" v-for="(application,index) in applications" :key="index">
19 <h3>{{application.appName}} {{application.appDir}}</h3>
20 <el-table
21 class="table"
22 highlight-current-row
23 v-loading="application.loading || loading"
24 :data="application.list"
25 >
26 <el-table-column label="openid" prop="openid"></el-table-column>
27 <el-table-column label="头像">
28 <template slot-scope="scope">
29 <div class="avatar">
30 <img v-show="scope.row.avatar" :src="scope.row.avatar" />
31 </div>
32 </template>
33 </el-table-column>
34 <el-table-column label="昵称" prop="nickname"></el-table-column>
35 <el-table-column label="串码" prop="drawSn"></el-table-column>
36 <el-table-column label="奖品名称" prop="prizeName"></el-table-column>
37 <el-table-column label="派发结果">
38 <template slot-scope="scope">
39 <el-tag type="success" v-if="scope.row.sendSuccess == 1">成功</el-tag>
40 <el-tooltip
41 v-if="scope.row.sendSuccess == 0"
42 class="item"
43 effect="dark"
44 :content="scope.row.failureReason"
45 placement="top-start"
46 >
47 <el-tag type="danger">失败</el-tag>
48 </el-tooltip>
49 </template>
50 </el-table-column>
51 <el-table-column label="中奖时间" :formatter="formatDate"></el-table-column>
52 <el-table-column label="派发结果">
53 <template slot-scope="scope">
54 <el-button
55 type="primary"
56 plain
57 v-if="scope.row.sendSuccess == 0"
58 @click="markSuccess(application,index,scope.row)"
59 :disabled="loading"
60 >标记成功</el-button>
61 </template>
62 </el-table-column>
63 </el-table>
64 <div class="tips">*标记成功的数据将于当日发送到portal平台</div>
65 </div>
66 </template>
67 <!--列表-->
68 <!-- <template>
69 <el-table
70 class="table"
71 highlight-current-row
72 v-loading="loading"
73 style="width: 100%;"
74 >
75 <el-table-column label="头像">
76 <template slot-scope="scope">
77 <div class="avatar">
78 <img v-show="scope.row.avatar" :src="scope.row.avatar" />
79 </div>
80 </template>
81 </el-table-column>
82 </el-table>
83 </template>-->
84 </section>
85 </template>
86
87 <script>
88 Date.prototype.format = function(fmt) {
89 var o = {
90 "M+": this.getMonth() + 1, //月份
91 "d+": this.getDate(), //日
92 "h+": this.getHours(), //小时
93 "m+": this.getMinutes(), //分
94 "s+": this.getSeconds(), //秒
95 "q+": Math.floor((this.getMonth() + 3) / 3), //季度
96 S: this.getMilliseconds() //毫秒
97 };
98 if (/(y+)/.test(fmt))
99 fmt = fmt.replace(
100 RegExp.$1,
101 (this.getFullYear() + "").substr(4 - RegExp.$1.length)
102 );
103 for (var k in o)
104 if (new RegExp("(" + k + ")").test(fmt))
105 fmt = fmt.replace(
106 RegExp.$1,
107 RegExp.$1.length == 1 ? o[k] : ("00" + o[k]).substr(("" + o[k]).length)
108 );
109 return fmt;
110 };
111
112 let urls = {
113 applications: "/admin/kd/application/available",
114 query: "/admin/kd/record/query",
115 change: "/admin/kd/record/success"
116 };
117
118 import { request } from "./../../api/api.js";
119 import { formatDate } from "./../../common/utils.js";
120
121 export default {
122 data() {
123 return {
124 loading: false,
125 filters: {
126 openid: "oUzSMtz0_YXWTTfi5WJfm2yqZa1I"
127 },
128 switchValue: true,
129 applications: [],
130 total: 0,
131 page: 1,
132 pageSize: 20,
133 searchNeedMinLength: 3
134 };
135 },
136 methods: {
137 init() {
138 request.get(urls.applications).then(res => {
139 this.applications = res.data.content;
140 console.log("this.applications==", this.applications);
141 this.applications.forEach(element => {
142 element.loading = false;
143 element.list = [];
144 });
145 });
146 },
147 markSuccess(application, index, row) {
148 let params = {
149 appCode: application.appCode,
150 recordCodes: [row.recordCode]
151 };
152 this.$confirm("请确保红包下发给用户后再标记成功哦!", "提示", {
153 confirmButtonText: "已经下发成功",
154 cancelButtonText: "取消",
155 type: "warning"
156 })
157 .then(() => {
158 this.loading = true;
159 request.post(urls.change, params).then(res => {
160 this.loading = false;
161 this._requestResult(index, application);
162 });
163 })
164 .catch(() => {});
165 },
166 formatDate: function(row, column) {
167 return row.createAt
168 ? new Date(row.createAt).format("yyyy-MM-dd hh:mm:ss")
169 : "-";
170 },
171 reqGetDrawsnQuery() {
172 for (let index in this.applications) {
173 let application = this.applications[index];
174 this._requestResult(index, application);
175 }
176 },
177 _requestResult(index, application) {
178 let params = {
179 appCode: application.appCode,
180 onlyFailure: this.switchValue ? 1 : 0,
181 openid: this.filters.openid
182 };
183 application.loading = true;
184 this.$set(this.applications, index, application);
185 request.get(urls.query, params).then(res => {
186 application.list = res.data.content;
187 application.loading = false;
188 this.$set(this.applications, index, application);
189 console.log(this.applications);
190 });
191 }
192 },
193 mounted() {
194 this.init();
195 }
196 };
197 </script>
198
199 <style scoped lang="less">
200 .toolbar {
201 display: flex;
202 align-items: center;
203 }
204
205 .el-input {
206 width: 200px;
207 }
208
209 .el-switch {
210 margin: 0 20px;
211 }
212
213 .app-container {
214 width: 100%;
215 margin-top: 20px;
216 padding: 20px;
217
218 img {
219 max-width: 50px;
220 max-height: 50px;
221 }
222 }
223 .tips {
224 text-align: right;
225 color: #ff0000;
226 }
227 </style>
...@@ -16,6 +16,7 @@ import echarts from './../pages/charts/echarts.vue' ...@@ -16,6 +16,7 @@ import echarts from './../pages/charts/echarts.vue'
16 import Apps from './../pages/apps/Apps.vue' 16 import Apps from './../pages/apps/Apps.vue'
17 import Report from './../pages/report/Report.vue' 17 import Report from './../pages/report/Report.vue'
18 import CheckCode from './../pages/checkcode/CheckCode.vue' 18 import CheckCode from './../pages/checkcode/CheckCode.vue'
19 import LotteryQuery from './../pages/lottery/index.vue'
19 20
20 import { 21 import {
21 COOKIES_EX 22 COOKIES_EX
...@@ -75,6 +76,18 @@ const router = new Router({ ...@@ -75,6 +76,18 @@ const router = new Router({
75 name: '查码' 76 name: '查码'
76 }] 77 }]
77 }, 78 },
79 {
80 path: '/',
81 component: Home,
82 name: '',
83 iconCls: 'fa fa-address-card',
84 leaf: true, //只有一个节点
85 children: [{
86 path: '/lottery/query',
87 component: LotteryQuery,
88 name: '抽奖查询'
89 }]
90 },
78 //{ path: '/main', component: Main }, 91 //{ path: '/main', component: Main },
79 // { 92 // {
80 // path: '/', 93 // path: '/',
......