<template>
|
<view class="bussiness-order">
|
<!-- 团购、粗去玩、深夜食堂、挖宝商品 -->
|
<!-- <view style="position: fixed;left: 0;right: 0;top: 0;background-color: #fff;height: 84rpx;z-index: 999;">
|
|
</view>
|
<view style="height: 100rpx;"></view> -->
|
<top-tabs :tabs="statusList" :flg.sync="tabIndex" @change="changeTab"></top-tabs>
|
|
<!-- 根据tab不同显示不同信息 -->
|
<view class="bussiness-order-items" style="min-height: calc(100vh - 200rpx);">
|
|
<no-data v-if="!list||list.length==0" style="width: 100%;"></no-data>
|
<view class="order-item" v-for="(item,index) of list" :key="index" :class="[type||'']" @click="op(item)">
|
<view class="name">{{item.title||item.name || item.orderNo || '-'}}</view>
|
<view class="time" v-if="type=='travel'">{{item.startTimeStr}} 到 {{item.endTimeStr}}</view>
|
<view class="time" v-if="type!=='travel'">下单时间: {{item.createdDate}}</view>
|
<view class="flex scroll-canteen" v-if="type=='canteen'">
|
<scroll-view class="flex scroll-view" :scroll-x="true" style="max-width: 500rpx;" v-if="item.items">
|
<view class="flex">
|
<view v-for="each of item.items" class="item-each">
|
<image :src="each.cover" class="cover"></image>
|
<view class="cover-name word-e">
|
<!-- {{each.num}} -->
|
<!-- <spanstyle="font-weight: 600;color: #000;"> x </span> -->
|
{{each.name}}({{each.num || 0}}件)</view>
|
</view>
|
</view>
|
</scroll-view>
|
<view style="min-width: 100rpx;margin-left: auto;">
|
<view class="price"><span class="dot">¥</span>{{item.totalAmount ||'0.0'}}
|
</view>
|
<view class="num-tip">共{{getItemsNum(item.items)||0}}件</view>
|
</view>
|
</view>
|
|
|
<view class="v-line"></view>
|
<view class="flex peoples" v-if="type=='travel'">
|
<view class="flex">
|
<view class="icons">
|
<view class="flex">
|
<view class="total">总计: ¥ </view>
|
<view class="price">{{item.price||'0.0'}}</view>
|
</view>
|
<view class="desc">
|
{{item.currentNum||0}}人上车
|
</view>
|
</view>
|
|
</view>
|
<view class="card-list-item-button-green">
|
详情
|
</view>
|
</view>
|
|
<!-- 具体的一些信息 -->
|
<view class="infos" v-if="type!=='travel'">
|
<view class="flex">
|
<view class="info-user-name flex flex1">
|
<uni-icons type="person-filled" class="icon"></uni-icons>
|
{{item.customer}}
|
</view>
|
<view class="info-user-tel flex flex1">
|
<uni-icons type="phone-filled" class="icon"></uni-icons>
|
{{item.customerTel}}
|
</view>
|
</view>
|
<view class="info-user-address flex">
|
<uni-icons type="location-filled" class="icon"></uni-icons>
|
{{item.customerAddress}}
|
</view>
|
|
</view>
|
</view>
|
</view>
|
<!-- 根据不同加载不同的继续的底部 -->
|
<view v-if="false">
|
<view v-if="type=='shop'" class="order-container">
|
<card-list-item :type="type" :dto="item" v-for="(item,index) in list" :key="index"></card-list-item>
|
</view>
|
<view v-if="type=='travel'" class="order-container">
|
<card-list-item :type="type" :dto="item" v-for="(item,index) in list" :key="index"></card-list-item>
|
</view>
|
<view v-if="type=='canteen'" class="order-container">
|
<!-- 时间,状态 -->
|
<view class="order-item good-item" v-for="(item,index) in list" :key="index">
|
<view class="flex ">
|
<view class="time">下单: {{item.createdDate}}</view>
|
<view class="status">{{item.statusStr}}</view>
|
</view>
|
|
<view class="flex">
|
<!-- overfi -->
|
<scroll-view class="flex scroll-view" :scroll-x="true" v-if="item.items">
|
<view v-for="each of item.items" class="item-each">
|
<image :src="each.cover" class="cover"></image>
|
<!-- 文字缩写 -->
|
<view class="cover-name word-e">{{each.name}}</view>
|
</view>
|
</scroll-view>
|
<view style="min-width: 100rpx;margin-left: auto;">
|
<view class="price"><span class="dot">¥</span>{{item.paymentAmount||'0.0'}}</view>
|
<view class="num-tip">共{{item.items&&item.items.length||0}}件</view>
|
</view>
|
</view>
|
<view class="address">
|
{{item.customerAddress}}
|
</view>
|
</view>
|
<!-- 货物单 -->
|
<!-- 地址 -->
|
</view>
|
<view v-if="type=='good'" class="order-container">
|
<view class="order-item good-item" v-for="(item,index) in list" :key="index">
|
<view class="flex ">
|
<view class="time">下单: {{item.createdDate}}</view>
|
<view class="status">{{item.statusStr}}</view>
|
</view>
|
<view class="flex">
|
<image class="cover" :src="item.items[0].cover"></image>
|
<view>
|
<view class="name">{{item.items[0].name}}</view>
|
<!-- <view>介绍尺码</view> -->
|
<view class="price"><span class="dot">¥</span>{{item.paymentAmount||'0.0'}}</view>
|
</view>
|
</view>
|
<!-- <view class="buttons">
|
<view class="button-wuliu button">查看物流</view>
|
<view class="button-shouhuo button">确认收货地址</view>
|
</view> -->
|
</view>
|
</view>
|
</view>
|
|
<footer-msg :more="page.total>0&&page.total>page.current*page.size"></footer-msg>
|
|
|
<uni-popup ref="popup_travel_people" type="bottom">
|
<view class="popup-form">
|
<!-- 背景图片 -->
|
<view class="p10 close-parent">
|
<!-- 报名用户 -->
|
<top-tabs :tabs="tripOrderStatusList" :flg.sync="peopleStatusIndex" @change="refreshPeople"></top-tabs>
|
|
<uni-icons class="close" type="closeempty" @click="closeMorePeople"></uni-icons>
|
</view>
|
<view class="title">
|
已有{{tripUserList&&tripUserList.length || 0}}人报名
|
</view>
|
<view class="title" @click.stop="toScan({})" style="color: #e1000e;text-align: center;margin-top: 40rpx;margin-bottom: 40rpx;">
|
点击扫码核销
|
</view>
|
<view style="min-height: 400rpx;max-height: 900rpx;overflow-y: scroll;">
|
<view v-if="tripUserList">
|
<view :key="index" v-for="(people,index) of tripUserList" class="p10 flex">
|
<view class="people-name m-l-0 m-r-10">{{index+1}}.</view>
|
<image :src="people.cover||people.picture" class="people-img"></image>
|
<view class="people-name">{{people.nickName}}</view>
|
<!--
|
<view class="button-red-tmp m-l-a" v-if="people.status=='P'" @click="toScan(people)">
|
扫码核销
|
</view> -->
|
<view class="button-green-tmp m-l-a" @click="toDetail(people)">
|
详情
|
</view>
|
</view>
|
</view>
|
|
</view>
|
|
<image src="../../../static/imgs/travel/chuqu.png" class="bottom-img"></image>
|
<view class="bottom-info">——出去,一起更好玩——</view>
|
</view>
|
</uni-popup>
|
</view>
|
</template>
|
|
<script>
|
export default {
|
data() {
|
return {
|
type: '',
|
typename: '',
|
tabIndex: 0,
|
query: {
|
checkStatus: '',
|
},
|
dstatusList: [{
|
id: '',
|
name: '全部'
|
}, {
|
id: 'PENDING',
|
name: '未送达',
|
}, {
|
id: 'COMPLETED',
|
name: '已送达',
|
}],
|
tripOrderStatusList: [{
|
id: '',
|
name: '全部'
|
}, {
|
id: 'P',
|
name: '未上车',
|
}, {
|
id: 'G',
|
name: '已上车',
|
}, {
|
id: 'O',
|
name: '已结束',
|
}],
|
// dstatusList: [{
|
// id: '',
|
// name: '全部'
|
// },{
|
// id: 'PREPAYMENT',
|
// name: '已支付',
|
// }, {
|
// id: 'REFUND',
|
// name: '已退款',
|
// }, {
|
// id: 'COMPLETED',
|
// name: '已完成',
|
// }],
|
// dstatusList: [{
|
// id: '',
|
// name: '全部'
|
// }, {
|
// id: 'P',
|
// name: '未上车',
|
// }, {
|
// id: 'COMPLETED',
|
// name: '已上车',
|
// }],
|
statusList: [],
|
tabs: [{
|
name: '团购',
|
id: 'shop',
|
api: '/api/buy/employee/order/list'
|
},
|
{
|
name: '粗去玩',
|
id: 'travel',
|
api: '/api/trip/employee/list/mine',
|
status: [],
|
// status: [{
|
// id: '',
|
// name: '全部'
|
// }, {
|
// id: 'PENDING',
|
// name: '未核销',
|
// }, {
|
// id: 'COMPLETED',
|
// name: '已核销',
|
// }]
|
// status: [{
|
// id: '',
|
// name: '全部'
|
// }, {
|
// id: 'P',
|
// name: '未上车',
|
// }, {
|
// id: 'G',
|
// name: '已上车',
|
// }, {
|
// id: 'O',
|
// name: '已结束',
|
// }]
|
},
|
{
|
name: '每日维C',
|
id: 'canteen',
|
api: '/api/canteen/employee/order/list',
|
// status: [{
|
// id: '',
|
// name: '全部'
|
// }, {
|
// id: 'PENDING',
|
// name: '未送达',
|
// }, {
|
// id: 'COMPLETED',
|
// name: '已送达',
|
// }]
|
|
},
|
{
|
name: '挖宝商品',
|
id: 'good',
|
api: '/api/wabao/employee/order/list'
|
|
},
|
],
|
tripUserList: [],
|
curTripId: '',
|
peopleStatusIndex: 0,
|
}
|
},
|
onLoad(options) {
|
this.type = options.type || ''
|
// var index = -1
|
this.statusList = this.dstatusList
|
for (var item of this.tabs) {
|
// index++
|
if (item.id == this.type) {
|
// this.tabIndex = index
|
this.listApi = item.api
|
this.typename = item.name
|
if (item.status) {
|
this.statusList = item.status
|
}
|
uni.setNavigationBarTitle({
|
title: this.typename || ''
|
})
|
break
|
}
|
}
|
this.refresh()
|
|
|
},
|
onReachBottom() {
|
this.page.current += 1
|
this.getMore()
|
},
|
methods: {
|
getItemsNum(arr) {
|
var a = 0
|
if (arr) {
|
for (var item of arr) {
|
a += item.num || 0
|
}
|
}
|
|
return a
|
},
|
openMorePeople() {
|
this.$refs.popup_travel_people.open()
|
|
},
|
closeMorePeople() {
|
this.$refs.popup_travel_people.close()
|
},
|
toTravelDetail(row){
|
this.toDetail(row)
|
},
|
op(row) {
|
if (this.type == 'travel') {
|
this.showPeoples(row)
|
// if (this.type == 'canteen')
|
} else {
|
//去详情
|
this.toDetail(row)
|
}
|
},
|
async showPeoples(row) {
|
//展示用户列表,然后选择一个看详情
|
// this.tripUserList = row.
|
|
this.peopleStatusIndex = 0
|
this.curTripId = row.id
|
await this.initShowPeople('')
|
this.openMorePeople()
|
|
},
|
async refreshPeople(e) {
|
// console.log('refreshPeople',e)
|
this.peopleStatusIndex = e
|
var status = this.tripOrderStatusList[e].id
|
await this.initShowPeople(status)
|
},
|
async initShowPeople(status) {
|
this.$message.showLoading()
|
const {
|
data
|
} = await this.$http.request('get', '/api/trip/employee/list/user/check', {
|
params: {
|
tripId: this.curTripId,
|
size: 2000,
|
status: status
|
}
|
})
|
this.$message.hideLoading()
|
this.tripUserList = data.records || []
|
},
|
toDetail(row) {
|
var url = `/pages/order/bussiness-order/bussincess-order-detail?type=${this.type}`
|
if (this.type == 'travel') {
|
url += `&id=${row.tripId}&userId=${row.id}`
|
} else {
|
url += `&id=${row.orderId || row.id}`
|
}
|
// console.log('url',url,row)
|
uni.navigateTo({
|
url: url
|
})
|
},
|
toScan(row={}) {
|
// toScan
|
let that = this
|
uni.scanCode({
|
success: function(res) {
|
// console.log('条码类型:' + res.scanType);
|
console.log('条码内容:' + res.result);
|
var dto = undefined
|
try {
|
dto = JSON.parse(res.result)
|
if (!!dto['tripId']) {
|
//请求核销
|
if(!dto['userId']){
|
that.$message.showToast('用户不存在')
|
}else{
|
if (dto['tripId'] !== that.curTripId) {
|
that.$message.showToast('非此活动二维码')
|
} else {
|
that.checkTrip(dto['tripId'], dto['userId'])
|
}
|
}
|
|
} else {
|
that.$message.showToast('二维码格式不正确扫码失败')
|
}
|
} catch (e) {
|
that.$message.showToast('二维码格式不正确扫码失败')
|
}
|
},
|
fail() {
|
that.$message.showToast('扫码失败')
|
|
}
|
});
|
},
|
async checkTrip(tripId, userId) {
|
//核销
|
await this.$message.confirm('确定核销吗?')
|
this.$message.showLoading()
|
|
const {
|
code
|
} = await this.$http.request('get', '/api/trip/employee/check/user/trip', {
|
params: {
|
userId: userId,
|
tripId: tripId,
|
}
|
})
|
this.$message.hideLoading()
|
if (code == 0) {
|
this.$message.showToast('核销成功')
|
this.refreshPeople(this.peopleStatusIndex)
|
}
|
},
|
refresh() {
|
//获取
|
console.log('refresh')
|
this.page.current = 1
|
this.getList()
|
},
|
changeTab(e) {
|
this.query.checkStatus = this.statusList[e].id
|
// console.log('this.type', this.type, this.tabs, e)
|
|
// this.list = []
|
// for (var item of this.statusList) {
|
// if (item.id == this.type) {
|
// this.listApi = item.api
|
// break
|
// }
|
// }
|
this.refresh()
|
},
|
}
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
@import '../order.scss'
|
</style>
|