123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739 |
- <template>
- <view>
- <view v-if="footer == 'tongji'" class="order-index" ref="container">
- <view class="header acea-row">
- <view class="items">
- <image :src="user.avatar" mode=""></image>
- <span class="font">{{ user.user_nickname }}</span><span>( 配送员 )</span>
- </view>
- <!-- #ifdef MP || APP-->
- <view class="item">
- <view class="iconfont icon-saoma ite" @click="to"></view>
- </view>
- <!-- #endif -->
- <!-- #ifdef H5 -->
- <view v-if="isWeixin" class="item">
- <view class="iconfont icon-saoma ite" @click="to"></view>
- </view>
- <!-- #endif -->
-
- </view>
- <view class="wrapper">
- <view class="title">
- <view class="uni-list-cell-db" @click="hiddened">
- <picker @change="bindPickerChange" :range="arrays" @cancel="cancel">
- <!-- <span class="iconfont icon-shujutongji"></span> -->
- <label class="aa">{{array[index].name}}</label>
- <text class='iconfont' :class='hidden==true?"icon-xiangxia":"icon-xiangshang"'></text>
- </picker>
- </view>
- <view class="tab">
- <view class="box" :class="detailtabs== 'today' ? 'on':''" @click="detailtab('today')">今日</view>
- <view class="box" :class="detailtabs== 'yesterday' ? 'on':''" @click="detailtab('yesterday')">昨日</view>
- <view class="box" :class="detailtabs== 'month' ? 'on':''" @click="detailtab('month')">本月</view>
- </view>
- </view>
- <Loading :loaded="loaded" :loading="loading"></Loading>
- <view class="list acea-row" v-if="!loading">
- <view class="item">
- <view class="num">{{ census.unsend }}</view>
- <view>待配送订单</view>
- </view>
- <view class="item">
- <view class="num">{{ census.send }}</view>
- <view>已配送订单</view>
- </view>
- <view class="item">
- <view class="num">{{ census.send_price }}</view>
- <view>完成配送额</view>
- </view>
- </view>
- </view>
- <view class="public-wrapper">
- <view class="title">
- <view class="uni-list-cell-db" @click="hiddened">
- 配送数据
- </view>
- </view>
- <view class="nav acea-row row-between-wrapper">
- <view class="data">日期</view>
- <view class="browse">订单数</view>
- <view class="turnover">金额</view>
- </view>
- <Loading :loaded="loaded" :loading="loading"></Loading>
- <view v-if="list[0]" class="conter">
- <view class="item acea-row row-between-wrapper" v-for="(item, index) in list" :key="index">
- <view class="data">{{ item.time }}</view>
- <view class="browse">{{ item.count }}</view>
- <view class="turnover">¥{{ item.price }}</view>
- </view>
- </view>
- <view v-else class="unconter">
- <view v-if="!loading">暂无数据</view>
- </view>
- </view>
- </view>
- <view v-if="footer == 'list'" class="order-index">
- <view class="tongji-index">
- <view class="header acea-row">
- <view class="items">
- <image :src="user.avatar" mode=""></image>
- <span class="font">{{ user.user_nickname }}</span><span>( 配送员 )</span>
- </view>
- <view class="item">
- <!-- #ifdef MP || MP-WEIXIN -->
- <view class="item">
- <view class="iconfont icon-saoma ite" @click="to"></view>
- </view>
- <!-- #endif -->
- <!-- #ifdef H5 -->
- <view v-if="isWeixin" class="item">
- <view class="iconfont icon-saoma ite" @click="to"></view>
- </view>
- <!-- #endif -->
- </view>
- </view>
- <view class="tab">
- <view><span class="box" :class="type == '1'?'on':''" @click="tab('1')">待配送( {{ count.unsend }} )</span></view>
- <view><span class="box" :class="type == '2'?'on':''" @click="tab('2')">已配送( {{ count.send }} )</span></view>
- </view>
- <view>
- <view v-if="orderlist.length != 0" class="content" v-for="(item,index) in orderlist" @click="jump(item.id)">
- <view class="content_top pad">
- <!-- item.order_id -->
- <view class="content_top_left">{{ item.add_time }}</view>
- <view v-if="item.store" class="content_top_right line1">{{item.store.name}}</view>
- </view>
- <view class="content_font pad">
- <p v-if="item.store" class="txt">门店地址:{{item.store.detailed_address}}</p>
- <p class="txt">配送地址:{{item.user_address}}</p>
- </view>
- <view class="content_box" v-for="(val, key) in item._info" :key="key">
- <image :src="val.cart_info.productInfo.image" mode=""></image>
- <view class="content_box_title">
- <view class="txt">
- <view class="textbox"><text class="icon-color" v-if="val.cart_info.is_gift">[赠品]</text>{{ val.cart_info.productInfo.store_name }}</view>
- <view>x {{ val.cart_info.cart_num }}</view>
- </view>
- <p class="attribute">属性:{{ val.cart_info.productInfo.attrInfo.suk }}</p>
- <p>¥ {{ val.cart_info.productInfo.attrInfo.price }} </p>
- </view>
- </view>
- <view class="content_bottom">
- <view></view>
- <view>共{{ item.total_num }}件商品,订单实付:<span class="money">¥{{ item.pay_price }}</span></view>
- </view>
- </view>
- <view v-if="!orderlist.length && !loading" class="nothing">
- <image :src="imgHost + '/statics/images/no-thing.png'" mode=""></image>
- <view>暂无数据</view>
- </view>
- </view>
- <Loading :loaded="loaded" :loading="loading"></Loading>
- </view>
- </view>
- <view class="footer">
- <view class="tab" :class="footer == 'list'?'on':''" @click="footerTab('list')">
- <view class="iconfont icon-dingdan"></view>
- <view class="font">订单列表</view>
- </view>
- <view class="tab" :class="footer == 'tongji'?'on':''" @click="footerTab('tongji')">
- <view class="iconfont icon-tongji"></view>
- <view class="font">数据统计</view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import {
- // getStatisticsInfo,
- // getStatisticsMonth,
- deliveryInfo,
- deliveryStatistics,
- deliveryList,
- deliveryOrderList,
- orderWriteoffInfo
- } from "@/api/admin";
- import Loading from '@/components/Loading/index.vue';
- import {HTTP_REQUEST_URL} from '@/config/app';
- export default {
- name: 'adminOrder',
- components: {
- Loading
- },
- data() {
- return {
- hidden: true,
- index: 0,
- detailtabs: 'today',
- footer: 'list',
- type: '1',
- arrays: [], //展示下拉时的数据
- array: [], //下拉时选择的数据
- storeInfoid: 0, //下拉时选择的数据ID
- census: {},
- list: [],
- orderlist: [],
- count: {},
- page: 1,
- limit: 15,
- loaded: false,
- loading: false,
- user: {},
- ids: '',
- verify_code: '',
- // #ifdef H5
- isWeixin: this.$wechat.isWeixin(),
- // #endif
- imgHost:HTTP_REQUEST_URL
- }
- },
- onLoad() {
- // this.getIndex();
- // this.init()
- this.userInfo();
- this.footerTab('list')
-
- // this.$scroll(this.$refs.container, () => {
- // !this.loading && this.getList();
- // });
- },
- methods: {
- userInfo(){
- deliveryInfo().then(res=>{
- this.user = res.data
- this.array = res.data.store_info.map(a => a);
- this.arrays = res.data.store_info.map(a => a.name);
- let obj = {
- id: 0,
- name: '全部'
- }
- this.array.unshift(obj);
- this.arrays.unshift(obj.name);
- })
- },
- getStatistics(){
- let data = {
- store_id: this.storeInfoid,
- data: this.detailtabs
- }
- deliveryStatistics(data).then(res=>{
- this.census = res.data
- })
- },
- deliveryLists(){
- let data = {
- page: this.page,
- limit: this.limit,
- store_id: this.storeInfoid,
- data: this.detailtabs
- }
- if (this.loading || this.loaded) return;
- this.loading = true
- deliveryList(data).then(res=>{
- this.loading = false
- this.loaded = res.data.length < this.limit
- this.page += 1
- // this.list = res.data
- this.list.push.apply(this.list, res.data);
- })
- },
- getOrderList(){
- if (this.loading || this.loaded) return;
- this.loading = true
- deliveryOrderList({type:this.type,page:this.page,limit:this.limit}).then(res=>{
- this.loading = false
- this.count = res.data.data
- this.loaded = res.data.list.length < this.limit
- this.page += 1
- this.orderlist.push.apply(this.orderlist, res.data.list);
- })
- },
- init: function() {
- this.orderlist = [];
- this.list = [];
- this.page = 1;
- this.loaded = false;
- this.loading = false;
- },
- to(){
- var self = this;
- // #ifdef MP || APP
- uni.scanCode({
- scanType: ["qrCode", "barCode"],
- success(res) {
- self.verify_code = res.result
- self.codeChange();
- },
- fail(res) {},
- })
- // #endif
- //#ifdef H5
- this.$wechat.wechatEvevt('scanQRCode', {
- needResult: 1,
- scanType: ["qrCode", "barCode"]
- }).then(res => {
- let result = res.resultStr;
- if(result.includes(',')){
- result = result.split(",")[1]
- }
- this.verify_code = result
- this.codeChange();
- });
- //#endif
- },
- // 立即核销
- codeChange: function() {
- let self = this
- let ref = /^[0-9]*$/;
- if (!this.verify_code) return self.$util.Tips({
- title: '请输入核销码'
- });
- if (!ref.test(this.verify_code)) return self.$util.Tips({
- title: '请输入正确的核销码'
- });
- self.$util.Tips({
- title: '查询中'
- });
- setTimeout(() => {
- orderWriteoffInfo(2,{verify_code:self.verify_code,code_type:2}).then(res=>{
- if(res.status == 200){
- uni.navigateTo({
- url:'./scanning/index?code='+self.verify_code
- })
- }else{
- self.$util.Tips({ title: res.msg });
- }
- }).catch(err=>{
- self.$util.Tips({
- title: err
- });
- })
- }, 800);
- },
- footerTab: function(type) {
- this.footer = type
- this.init()
- if(type == 'tongji'){
- this.deliveryLists()
- this.getStatistics()
- }
- if(type == 'list'){
- this.getOrderList()
- }
-
- },
- tab(type){
- this.type = type
- this.init()
- this.getOrderList()
- },
- hiddened: function(e) {
- this.hidden = !this.hidden;
- },
- cancel: function() {
- this.hidden = !this.hidden;
- },
- bindPickerChange: function(e) {
- this.hidden = !this.hidden;
- this.index = e.target.value
- this.storeInfoid = this.array[this.index].id
- this.init()
- this.getStatistics()
- this.deliveryLists()
- },
- detailtab: function(type) {
- this.detailtabs = type
- this.init()
- this.deliveryLists()
- this.getStatistics()
- },
- jump: function(id){
- uni.navigateTo({
- url:'orderDetail/index?id='+id
- })
- }
- },
- onReachBottom(){
- if(this.footer == 'tongji'){
- this.deliveryList()
- }
- if(this.footer == 'list'){
- this.getOrderList()
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .nothing{
- width: 80%;
- margin: 0 auto;
- margin-top: 30px;
- text-align: center;
- color: #cfcfcf;
- }
- .ite{
- font-size: 20px;
- }
- .footer{
- display: flex;
- justify-content: space-around;
- width: 100%;
- text-align: center;
- height: 100upx;
- background: #FFFFFF;
- position: fixed;
- bottom: 0;
- left: 0;
- .tab{
- display: flex;
- flex-direction: column;
- color: #999999;
- margin-top: 16upx;
-
- }
- .on{
- color: #1890FF;
- .font{
- color: #3B3B3B;
- }
- }
- }
- .tongji-index{
- padding-bottom: 160upx;
- .header {
- background-size: 100% 100%;
- width: 100%;
- height: 186upx !important;
- padding: 20upx 30upx 0 30upx !important;
- box-sizing: border-box;
- background: linear-gradient(270deg, #4276F6 0%, #00ACF8 100%);
- display: flex;
- justify-content: space-between;
- .items, .item{
- font-size: 24upx;
- color: #fff;
- height: 120upx;
- display: flex;
- align-items: center;
- image{
- width: 64upx;
- height: 64upx;
- border-radius: 60upx;
- border: 2upx solid #FFFFFF;
- }
- .font{
- display: inline-block;
- margin-left: 16upx;
- margin-right: 16upx;
- font-size: 30upx;
- }
- }
- }
- .tab{
- width: 694upx;
- height: 86upx;
- background: #FFFFFF;
- border-radius: 12upx;
- margin: -40upx auto 0 auto;
- display: flex;
- justify-content: space-around;
- text-align: center;
- align-items: center;
- .box{
- display: block;
- height: 62upx;
- margin-top: 26upx;
- }
- .on{
- border-bottom: 4upx solid #1890FF;
- color: #1890FF;
- }
- }
- .content{
- margin: 16upx auto 16upx auto;
- width: 694upx;
- // height: 428upx;
- padding-bottom: 20upx;
- background: #FFFFFF;
- border-radius: 12upx;
- .pad{padding: 20upx 20upx 22upx;}
- .content_top{
- // height: 78upx;
- align-items: center;
- font-weight: 400;
- display: flex;
- justify-content: space-between;
- border-bottom: 2upx solid #F5F5F5;
- .content_top_left{
- font-size: 26upx;
- }
- .content_top_right{
- font-size: 18upx;
- color: #1890FF;
- border: 2upx solid #1890FF;
- padding: 6upx 10upx;
- max-width: 300upx;
- }
- }
- .content_font{
- font-size: 24upx;
- color: #666666;
- font-weight: 400;
- .txt{margin-bottom: 14upx;}
- }
- .content_box{
- // height: 70px;
- background: #F5F5F5;
- border-radius: 8upx;
- margin: 0upx 20upx 22upx;
- padding: 14upx;
- padding-right: 22upx;
- display: flex;
- justify-content: start;
- image{
- width: 112upx;
- height: 112upx;
- border-radius: 8upx;
- }
- .content_box_title{
- flex: 1;
- margin-left: 18upx;
- font-size: 20upx;
- font-weight: 400;
- .txt{
- display: flex;
- justify-content: space-between;
- font-size: 24upx;
- .textbox{
- width: 408upx;
- white-space: nowrap;
- text-overflow: ellipsis;
- overflow: hidden;
- word-break: break-all;
- }
- }
- .attribute{
- color: #999999;
- margin: 4upx 0upx 10upx;
- }
- }
- }
- .content_bottom{
- display: flex;
- justify-content: space-between;
- font-size: 22upx;
- padding: 0upx 20upx;
- color: #666666;
- .money{
- font-size: 26upx;
- color: #F5222D;
- }
- }
- }
- }
- /*订单首页*/
- .order-index{position: relative;}
- .order-index .header {
- background-size: 100% 100%;
- width: 100%;
- height: 302upx;
- padding: 45upx 30upx 0 30upx;
- box-sizing: border-box;
- background: linear-gradient(270deg, #4276F6 0%, #00ACF8 100%);
- display: flex;
- justify-content: space-between;
- }
-
- .order-index .header .icon-saoma{
- font-size: 40rpx;
- padding: 30rpx 20rpx 30rpx 80rpx;
- }
- .order-index .header .item,.order-index .header .items {
- font-size: 24upx;
- color: #fff;
- height: 120upx;
- display: flex;
- align-items: center;
-
- }
- .order-index .header .item .font,.order-index .header .items .font{
- display: inline-block;
- margin-left: 16upx;
- margin-right: 16upx;
- font-size: 30upx;
-
- }
- .order-index .header .items image{
- width: 64upx;
- height: 64upx;
- border-radius: 60upx;
- border: 2upx solid #FFFFFF;
- }
- .order-index .wrapper {
- width: 690upx;
- background-color: #fff;
- border-radius: 10upx;
- margin: -115upx auto 0 auto;
- padding-top: 25upx;
- }
-
- .order-index .wrapper .title .iconfont {
- color: #2291f8;
- font-size: 40upx;
- margin-right: 13upx;
- vertical-align: middle;
- }
- .order-index .wrapper .title {
- font-size: 30upx;
- color: #282828;
- padding: 0 30upx;
- margin-bottom: 40upx;
- display: flex;
- justify-content: space-between;
- .uni-list-cell-db .iconfont{
- font-size: 24upx ;
- color: #999 ;
- margin-left: 14upx;
- }
- .tab{
- width: 240upx;
- height: 48upx;
- background: #F5F5F5;
- border-radius: 24upx;
- display: flex;
- justify-content: space-between;
- font-weight: 400;
- color: #999999;
- font-size: 24upx;
- .box{
- width: 82upx;
- height: 48upx;
- border-radius: 24upx;
- text-align: center;
- line-height: 48upx;
- }
- .on{
- background: #1890FF;
- color: #FFFFFF;
- }
-
- }
- }
- .order-index .wrapper .list .item {
- width: 33.33%;
- text-align: center;
- font-size: 24upx;
- color: #999;
- margin-bottom: 45upx;
- }
- .order-index .wrapper .list .item .num {
- font-size: 40upx;
- color: #333;
- }
- .public-wrapper .title {
- font-size: 30upx;
- color: #282828;
- padding: 0 30upx;
- margin-bottom: 20upx;
- font-size: 30upx;
- // margin-bottom: 40upx;
- display: flex;
- justify-content: space-between;
- .uni-list-cell-db .iconfont{
- font-size: 24upx ;
- color: #999 ;
- margin-left: 14upx;
- }
- .tab{
- width: 240upx;
- height: 48upx;
- background: #F5F5F5;
- border-radius: 24upx;
- display: flex;
- justify-content: space-between;
- font-weight: 400;
- color: #999999;
- font-size: 24upx;
- .box{
- width: 82upx;
- height: 48upx;
- border-radius: 24upx;
- text-align: center;
- line-height: 48upx;
- }
- .on{
- background: #1890FF;
- color: #FFFFFF;
- }
-
- }
- }
- .public-wrapper .title .iconfont {
- color: #2291f8;
- font-size: 40upx;
- margin-right: 13upx;
- vertical-align: middle;
- }
- .public-wrapper {
- margin: 18upx auto 0 auto;
- margin-bottom: 160upx;
- width: 690upx;
- background-color: #fff;
- border-radius: 10upx;
- padding-top: 25upx;
- }
- .public-wrapper .nav {
- padding: 0 30upx;
- height: 70upx;
- line-height: 70upx;
- font-size: 24upx;
- color: #999;
- }
- .public-wrapper .data {
- width: 210upx;
- text-align: left;
- }
- .public-wrapper .browse {
- width: 192upx;
- text-align: left;
- }
- .public-wrapper .turnover {
- width: 227upx;
- text-align: right;
- }
- .public-wrapper .conter {
- padding: 0 30upx;
- }
- .public-wrapper .conter .item {
- border-bottom: 1px solid #f7f7f7;
- height: 70upx;
- font-size: 24upx;
- }
- .public-wrapper .conter .item .turnover {
- color: #000000;
- font-weight: 400;
- }
- .public-wrapper .unconter{
- text-align: center;
- color: #999;
- padding: 25upx;
- }
- </style>
|