10 changed files with 391 additions and 1 deletions
-
11src/pages.json
-
8src/pages/index/index.vue
-
2src/pages/write_off/operate/operate.vue
-
BINsrc/static/images/icon/index/tab_10.png
-
1src/store/index.js
-
11src/subpackage/blacklist/js/api.js
-
10src/subpackage/blacklist/js/server.js
-
349src/subpackage/blacklist/pages/abnormal_list/abnormal_list.vue
-
BINsrc/subpackage/blacklist/static/images/arrow.png
-
BINsrc/subpackage/blacklist/static/images/triangle.png
After Width: 52 | Height: 52 | Size: 604 B |
@ -0,0 +1,11 @@ |
|||
import { ORIGIN } from '../../../js/api'; |
|||
|
|||
export const BLACKLIST_API = { |
|||
stadiumList:`${ORIGIN}/admin/stadium/list`, // 店铺列表
|
|||
identifyRecords:`${ORIGIN}/admin/stadium/identify/records`, // 疑似逃票的记录
|
|||
blacklistAdd:`${ORIGIN}/admin/user/blacklist/add`, // 黑名单添加-后台
|
|||
blacklistRemove:`${ORIGIN}/admin/user/blacklist/remove`, // 黑名单移除-后台
|
|||
|
|||
} |
|||
|
|||
export default BLACKLIST_API; |
@ -0,0 +1,10 @@ |
|||
import { Server } from '../../../js/server'; |
|||
|
|||
class BlacklistServer extends Server { |
|||
constructor(props){ |
|||
super(props) |
|||
} |
|||
} |
|||
|
|||
|
|||
export default new BlacklistServer(); |
@ -0,0 +1,349 @@ |
|||
<template> |
|||
<view class="abnormal-list"> |
|||
<view class="al-stadium-change"> |
|||
<view class="asc-name">当前门店</view> |
|||
<picker :range="stadiumLs" range-key="name" @change="stadiumChange"> |
|||
<view class="asc-frame"> |
|||
<view class="af-content"> |
|||
<view :class="[ 'ac-txt', selectStadium.name?'select':'' ]">{{ selectStadium.name || '全部' }}</view> |
|||
<image class="ac-icon" mode="aspectFit" src="/subpackage/blacklist/static/images/arrow.png"></image> |
|||
</view> |
|||
</view> |
|||
</picker> |
|||
</view> |
|||
<view class="al-date"> |
|||
<picker mode="date" @change="dateChange"> |
|||
<view class="ad-content"> |
|||
<view class="ac-txt">核销日期:{{ curDate || '' }}</view> |
|||
<image class="ac-icon" mode="aspectFit" src="/subpackage/blacklist/static/images/triangle.png"></image> |
|||
</view> |
|||
</picker> |
|||
</view> |
|||
<view class="al-list"> |
|||
<view class="al-item" v-for="(e, i) in blackLs" :key="i"> |
|||
<view class="al-title">{{ e.extension.stadium_name || '-' }}</view> |
|||
<view class="ai-line"> |
|||
<view class="ai-txt">订单编号:{{ e.order_no || '-' }}</view> |
|||
<view class="ai-tag">({{ e.type || '-' }})</view> |
|||
</view> |
|||
<view class="ai-line"> |
|||
<view class="ai-txt">用户信息:{{ e.extension.mobile || '-' }}({{ e.extension.nickname || '-' }})</view> |
|||
</view> |
|||
<view class="ai-line"> |
|||
<view class="ai-txt">核销码:{{ e.verify_code || '-' }}</view> |
|||
</view> |
|||
<view class="ai-line"> |
|||
<view class="ai-txt">验证方式:{{ e.verify_desc || '-' }}</view> |
|||
</view> |
|||
<view class="ai-line"> |
|||
<view class="ai-txt">核销时间:{{ e.verify_leave_time || '-' }}</view> |
|||
</view> |
|||
<view class="ai-line"> |
|||
<view class="ai-txt">抓拍图片:</view> |
|||
<view class="ai-img"> |
|||
<image |
|||
v-if="e.evidence_img" |
|||
@click="previewImg(e.evidence_img || '')" |
|||
mode="aspectFit" |
|||
:src="e.evidence_img || ''" |
|||
></image> |
|||
</view> |
|||
</view> |
|||
<view |
|||
v-if="e.in_black_list === 1 || e.in_black_list === 0" |
|||
:class="['ai-btn', e.in_black_list === 1?'red':'']" |
|||
@click="operateBtn(e, i)" |
|||
>{{e.in_black_list === 1?'移出黑名单':'加入黑名单'}}</view> |
|||
</view> |
|||
|
|||
</view> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import server from '../../js/server'; |
|||
import util from '../../../../utils/util'; |
|||
import { BLACKLIST_API } from '../../js/api'; |
|||
export default { |
|||
data(){ |
|||
return { |
|||
stadiumLs: [], |
|||
selectStadium: {}, |
|||
curDate: '', |
|||
blackLs: [], |
|||
page: 1 |
|||
} |
|||
}, |
|||
async onLoad(options){ |
|||
try{ |
|||
let _date = this.curDate = util.formatDate({}); |
|||
let _stadiumLs = await this.getStoreList({}); |
|||
this.getRecords({ |
|||
brand_id: options.brand_id, |
|||
verify_time: _date |
|||
}); |
|||
}catch(err){ |
|||
console.warn('get records ls err --->', err); |
|||
} |
|||
}, |
|||
onReachBottom(){ |
|||
let { selectStadium, curDate, page } = this; |
|||
this.getRecords({ |
|||
brand_id: selectStadium.brand_id, |
|||
stadium_id: selectStadium.id, |
|||
verify_time: curDate, |
|||
page: ++page |
|||
}) |
|||
}, |
|||
methods: { |
|||
previewImg(url){ |
|||
uni.previewImage({ urls: [url] }); |
|||
}, |
|||
getRecords({ |
|||
authority = 'wx', // 后台:随便字段写死 |
|||
brand_id = 63, |
|||
stadium_id = '', |
|||
page = 1, |
|||
page_size = 10, |
|||
verify_time = '' |
|||
}){ |
|||
util.showLoad(); |
|||
server.get({ |
|||
url: BLACKLIST_API.identifyRecords, |
|||
data: { |
|||
authority, brand_id, page, page_size, |
|||
stadium_id: stadium_id || '', verify_time |
|||
}, |
|||
failMsg: '加载列表失败!' |
|||
}) |
|||
.then(res => { |
|||
util.hideLoad(); |
|||
let _ls = res.list || []; |
|||
if(page ===1)return this.blackLs = _ls; |
|||
if(!_ls.length)return util.showNone('没有更多数据!'); |
|||
this.page = page; |
|||
this.blackLs = [ ...this.blackLs, ..._ls ]; |
|||
|
|||
}) |
|||
}, |
|||
dateChange(e){ |
|||
let { selectStadium } = this; |
|||
let _date = e.detail.value || '-' |
|||
this.curDate = _date; |
|||
this.page = 1; |
|||
this.blackLs = []; |
|||
this.getRecords({ |
|||
brand_id: selectStadium.brand_id, |
|||
stadium_id: selectStadium.id, |
|||
verify_time: _date, |
|||
}) |
|||
}, |
|||
stadiumChange(e){ |
|||
let { stadiumLs, curDate } = this; |
|||
let _curStadium = stadiumLs[e.detail.value] || {}; |
|||
this.selectStadium = _curStadium; |
|||
this.page = 1; |
|||
this.blackLs = []; |
|||
this.getRecords({ |
|||
brand_id: _curStadium.brand_id, |
|||
stadium_id: _curStadium.id, |
|||
verify_time: curDate, |
|||
}) |
|||
}, |
|||
operateBtn(e, idx){ |
|||
let _status = e.in_black_list || '' |
|||
let _qry = { |
|||
uid: e.user_id, |
|||
brand_id: e.brand_id, |
|||
idx: idx, |
|||
status: _status, |
|||
enter_black_list_cause: '人数异常加入' |
|||
} |
|||
if(_status == 0)return this.modalToDo({ qry: _qry, content: '确定将该用户拉入黑名单吗?确定后用户将不能再进入小程序' }); |
|||
|
|||
if(_status === 1)return this.modalToDo({ qry: _qry, content: '确定移出黑名单吗?' }); |
|||
|
|||
}, |
|||
modalToDo({ qry, content }){ |
|||
util.showModal({ |
|||
title: '提示', |
|||
content: content, |
|||
showCancel: true, |
|||
success: mRes => { |
|||
if(mRes.confirm)this.blackLsOpt(qry); |
|||
} |
|||
}) |
|||
}, |
|||
blackLsOpt: util.debounce(function({ uid, brand_id, idx, status, enter_black_list_cause}){ |
|||
let _url = ''; |
|||
if(status == 0)_url = BLACKLIST_API.blacklistAdd; |
|||
if(status == 1)_url = BLACKLIST_API.blacklistRemove; |
|||
util.showLoad(); |
|||
server.get({ |
|||
url: _url, |
|||
data: { |
|||
id: uid, |
|||
brand_id, |
|||
enter_black_list_cause |
|||
}, |
|||
isDefaultGet: false |
|||
}) |
|||
.then(res=>{ |
|||
util.hideLoad(); |
|||
if(res.data.code == 0){ |
|||
util.showNone('操作成功!'); |
|||
let _blackLs = this.blackLs || []; |
|||
_blackLs[idx].in_black_list = status == 0 ? 1 : 0; |
|||
this.blackLs = _blackLs; |
|||
setTimeout(_=>this.$forceUpdate(), 1200); |
|||
}else{ |
|||
util.showNone(res.data.message || '操作失败!稍后重试'); |
|||
} |
|||
}) |
|||
}, 300, true), |
|||
// 获取店铺列表 |
|||
getStoreList({ |
|||
page=1, |
|||
page_size=99999, |
|||
brand_id='', |
|||
}){ |
|||
return server.get({ |
|||
url: BLACKLIST_API.stadiumList, |
|||
data: { |
|||
page, |
|||
page_size, |
|||
brand_id, |
|||
}, |
|||
failMsg: '获取店铺列表失败!' |
|||
}) |
|||
.then(res=>{ |
|||
let _list = res.list || []; |
|||
_list.unshift({ name: '全部', id: '' }) |
|||
this.stadiumLs = _list; |
|||
return _list |
|||
}) |
|||
}, |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped lang="scss"> |
|||
@import "~style/public.scss"; |
|||
.abnormal-list{ |
|||
|
|||
} |
|||
.al-stadium-change{ |
|||
margin-bottom: 24upx; |
|||
padding: 26upx 24upx; |
|||
background-color: #fff; |
|||
@include centerFlex(space-between); |
|||
.asc-name{ |
|||
margin-right: 20upx; |
|||
flex-shrink: 0; |
|||
font-size: 28upx; |
|||
color: #9C9C9F; |
|||
} |
|||
.asc-frame{ |
|||
width: 570upx; |
|||
height: 92upx; |
|||
border-radius: 10upx; |
|||
background-color: #F2F2F7; |
|||
.af-content{ |
|||
@include centerFlex(space-between); |
|||
height: 100%; |
|||
padding: 0 20upx; |
|||
.ac-txt{ |
|||
@include textHide(1); |
|||
font-size: 28upx; |
|||
color: #9c9c9f; |
|||
&.select{ |
|||
color: #1A1A1A; |
|||
} |
|||
} |
|||
.ac-icon{ |
|||
flex-shrink: 0; |
|||
width: 28upx; |
|||
height: 28upx; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
.al-date{ |
|||
padding: 0 24upx; |
|||
.ad-content{ |
|||
@include centerFlex(flex-start); |
|||
.ac-txt{ |
|||
line-height: 44upx; |
|||
font-weight: 500; |
|||
font-size: 32upx; |
|||
color: #1a1a1a; |
|||
} |
|||
.ac-icon{ |
|||
flex-grow: 0; |
|||
flex-shrink: 0; |
|||
margin-left: 16upx; |
|||
width: 22upx; |
|||
height: 22upx; |
|||
} |
|||
} |
|||
} |
|||
.al-list{ |
|||
padding: 34upx 24upx; |
|||
.al-item{ |
|||
padding: 4upx 20upx 48upx; |
|||
margin-bottom: 24upx; |
|||
border-radius: 10upx; |
|||
background-color: #fff; |
|||
.al-title{ |
|||
margin-bottom: 10upx; |
|||
line-height: 96upx; |
|||
font-weight: 500; |
|||
font-size: 28upx; |
|||
color: #1A1A1A; |
|||
border-bottom: 2upx solid #d8d8d8; |
|||
@include textHide(1); |
|||
} |
|||
.ai-line{ |
|||
display: flex; |
|||
.ai-txt{ |
|||
line-height: 52upx; |
|||
font-size: 28upx; |
|||
color: #9c9c9f; |
|||
@include textHide(1); |
|||
} |
|||
.ai-tag{ |
|||
flex-shrink: 0; |
|||
margin-left: 12upx; |
|||
line-height: 52upx; |
|||
font-size: 28upx; |
|||
color: $themeColor; |
|||
} |
|||
|
|||
.ai-img{ |
|||
width: 240upx; |
|||
height: 180upx; |
|||
overflow: hidden; |
|||
border-radius: 6upx; |
|||
>image{ |
|||
width: 100%; |
|||
height: 100%; |
|||
} |
|||
} |
|||
} |
|||
.ai-btn{ |
|||
margin: 40upx auto 0; |
|||
width: 240upx; |
|||
line-height: 68upx; |
|||
text-align: center; |
|||
font-size: 28upx; |
|||
font-weight: 500; |
|||
border-radius: 10upx; |
|||
background-color: $themeColor; |
|||
color: #fff; |
|||
&.red{ |
|||
background-color: #EA5061; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
</style> |
After Width: 28 | Height: 28 | Size: 230 B |
After Width: 22 | Height: 22 | Size: 227 B |
Write
Preview
Loading…
Cancel
Save
Reference in new issue