Browse Source

add black ls api

feat-230721
刘嘉炜 2 years ago
parent
commit
acb2f6b8d2
  1. 2
      src/subpackage/blacklist/js/api.js
  2. 137
      src/subpackage/blacklist/pages/abnormal_list/abnormal_list.vue

2
src/subpackage/blacklist/js/api.js

@ -3,6 +3,8 @@ 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`, // 黑名单移除-后台
}

137
src/subpackage/blacklist/pages/abnormal_list/abnormal_list.vue

@ -5,7 +5,7 @@
<picker :range="stadiumLs" range-key="name" @change="stadiumChange">
<view class="asc-frame">
<view class="af-content">
<view class="ac-txt">{{ selectStadium.name || '全部' }}</view>
<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>
@ -20,29 +20,40 @@
</picker>
</view>
<view class="al-list">
<view class="al-item" v-for="i in 5" :key="i">
<view class="al-title">欧轩智能羽毛球馆(永泰店)</view>
<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">订单编号20195175645666</view>
<view class="ai-tag">租场</view>
<view class="ai-txt">订单编号{{ e.order_no || '-' }}</view>
<view class="ai-tag">{{ e.type || '-' }}</view>
</view>
<view class="ai-line">
<view class="ai-txt">用户信息183165538周大强</view>
<view class="ai-txt">用户信息{{ e.extension.mobile || '-' }}{{ e.extension.nickname || '-' }}</view>
</view>
<view class="ai-line">
<view class="ai-txt">核销码200801108978</view>
<view class="ai-txt">核销码{{ e.verify_code || '-' }}</view>
</view>
<view class="ai-line">
<view class="ai-txt">验证方式扫码器验证(pad)</view>
<view class="ai-txt">验证方式{{ e.verify_desc || '-' }}</view>
</view>
<view class="ai-line">
<view class="ai-txt">核销时间2021-05-17 11:12:58</view>
<view class="ai-txt">核销时间{{ e.verify_leave_time || '-' }}</view>
</view>
<view class="ai-line">
<view class="ai-txt">抓拍图片</view>
<view class="ai-img"></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 :class="['ai-btn', i%2 ==0?'red':'']" @click="operateBtn">移出黑名单</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>
@ -59,6 +70,8 @@ export default {
stadiumLs: [],
selectStadium: {},
curDate: '',
blackLs: [],
page: 1
}
},
async onLoad(options){
@ -73,41 +86,119 @@ export default {
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',
authority = 'wx', // 便
brand_id = 63,
stadium_id = '',
page = 1,
page_size = 15,
page_size = 10,
verify_time = ''
}){
util.showLoad();
server.get({
url: BLACKLIST_API.identifyRecords,
data: {
authority, brand_id, page, page_size,
stadium_id, verify_time
stadium_id: stadium_id || '', verify_time
},
failMsg: '加载列表失败!'
})
.then(res => {
console.warn('getRecords->', 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){
this.curDate = e.detail.value || '-'
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 } = this;
this.selectStadium = stadiumLs[e.detail.value]
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,
}
if(_status == 0)return this.modalToDo({ qry: _qry, content: '确定将该用户拉入黑名单吗?确定后用户将不能再进入小程序' });
if(_status === 1)return this.modalToDo({ qry: _qry, content: '确定移出黑名单吗?' });
},
operateBtn(){
modalToDo({ qry, content }){
util.showModal({
title: '提示',
content: '确定将该用户拉入黑名单吗?确定后用户将不能再进入小程序',
content: content,
showCancel: true,
success: mRes => {
if(mRes.confirm)this.blackLsOpt(qry);
}
})
},
blackLsOpt: util.debounce(function({ uid, brand_id, idx, status}){
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,
},
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,
@ -125,7 +216,7 @@ export default {
})
.then(res=>{
let _list = res.list || [];
_list.unshift({ name: '全部', id: 0 })
_list.unshift({ name: '全部', id: '' })
this.stadiumLs = _list;
return _list
})
@ -163,6 +254,9 @@ export default {
@include textHide(1);
font-size: 28upx;
color: #9c9c9f;
&.select{
color: #1A1A1A;
}
}
.ac-icon{
flex-shrink: 0;
@ -228,7 +322,6 @@ export default {
height: 180upx;
overflow: hidden;
border-radius: 6upx;
background-color: skyblue;
>image{
width: 100%;
height: 100%;

Loading…
Cancel
Save