123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709 |
- <template>
- <view class="container">
- <view class="bgf pof">
- <view class="flex-center search-content">
- <view class="search flex-y-center" style="margin-bottom: 0;">
- <icon type="search" size="16" />
- <input placeholder="请输入搜索内容" class="flex-grow-1" type="text" value="" @confirm="firmSeach"
- @input="putSeach" />
- </view>
- <text @click="bindSeach">搜索</text>
- </view>
- <view class="box-pack-between header-hg100 flex-y-center ">
- <view class="flex-y-center flex-grow-1 ft26 header-text">
- <view class="flex-grow-1 flex-center" data-text="1" :class="act_index==5?'act':''"
- @click="onTopBtnTap(5)" v-if="admin_id">
- <view class="store-name">{{level_text}}</view>
- <view class="d3" :style="'border-color:'+act_index==1?'#007AFF':''"></view>
- </view>
- <view class="flex-grow-1 flex-center" data-text="1" :class="act_index==1?'act':''"
- @click="onTopBtnTap(1)">
- {{status_text}}
- <view class="d3" :style="'border-color:'+act_index==1?'#007AFF':''"></view>
- </view>
- <view class="flex-grow-1 flex-center" data-text="2" :class="act_index==2?'act':''"
- @click="onTopBtnTap(2)">
- {{order_text}}
- <view class="d3" :style="'border-color:'+act_index==2?'#007AFF':''"></view>
- </view>
- <view class="flex-grow-1 flex-center" data-text="3" :class="act_index==3?'act':''"
- @click="onTopBtnTap(3)">
- {{pay_text}}
- <view class="d3"></view>
- </view>
- <view class="flex-grow-1 flex-center" data-text="4" :class="act_index==4?'act':''"
- @click="onTopBtnTap(4)">
- {{start_text}}
- <view class="d3"></view>
- </view>
- </view>
- </view>
- </view>
- <view class="list">
- <navigator :url="`/saomaDiancan/orderDetail/orderDetail?id=${item.id}`" class="item"
- v-for="(item,index) in list" :key="index">
- <view class="top flex flex-y-center box-pack-between">
- <view class="name text-1">{{item.order_no}}</view>
- <view class="pay-info flex flex-y-center">
- <view class="pay-status" style="color:red;">
-
- <!-- `order_status` smallint(1) NOT NULL DEFAULT '0' COMMENT '订单状态
- 0:待支付 1:待配送 2:配送中 3:已完成 4:已取消 5:已退款 6:部分退款 7:待自提', -->
- <!-- <block v-if="item.is_pay == 1"> -->
- <!-- {{item.cancel_status==2?'已退款':item.state==1?'堂食订单':item.state==3?'自提订单':item.state==2?(item.is_send==1?'已配送':'待配送'):''}} -->
- <!-- </block> -->
- <!-- <block v-else> -->
-
- <!-- item.order_status==0?'待支付': -->
- {{item.order_status==1?'待配送' :item.order_status==2?'配送中':
- item.order_status==3?'已完成':item.order_status==4?'已取消':item.order_status==5?'已退款':
- item.order_status==6?'部分退款':item.order_status==7?'待自提':''}}
-
- <!-- </block> -->
- </view>
- </view>
- </view>
- <view class="content" style="border-bottom: 1rpx solid #f1f1f1;">
- <view class="cell flex flex-y-center" v-if="item.state == 1">
- <view class="title">取单号:</view>
- <view class="desc flex-grow-1">
- <view class="flex flex-y-center box-pack-between">
- <text>{{item.number||item.id}}</text>
- <view class="qc-btn" @click.stop="onQucan(index)" v-if="item.no_meal == 1">
- {{item.no_meal == 1?'请取单':'再次通知取单'}}
- </view>
- </view>
- </view>
- </view>
-
- <view class="box-pack-between">
- <view class="cell flex flex-y-center">
- <view class="title">支付金额:</view>
- <view class="desc" style="color:red">¥{{item.pay_price}}</view>
- </view>
- <view class="pay-info flex flex-y-center">
- <image
- :src="item.pay_type == 1?'../../static/images/wx.png':item.pay_type == 2?'../../static/images/ali.png':'../static/images/yu.png'"
- class="pay-type-icon"></image>
- <view class="pay-status">{{item.is_pay == 1?(item.cancel_status==2?'已退款':'支付成功'):'待支付'}}
- </view>
- </view>
- </view>
- <view class="cell flex flex-y-center" v-if="item.state == 1">
- <view class="title">桌号:</view>
- <view class="desc" style="color:red">
- {{item.table_name?item.table_name:'自助结账'}}
- </view>
- </view>
-
- <view class="cell flex flex-y-center" v-if="item.type!=3">
- <view class="title">付款方式:</view>
- <view class="desc" style="color:red">
- {{item.type == 1 ?'餐前付款':item.type ==2?'餐后付款':""}}
- </view>
- </view>
- <view class="cell flex flex-y-center" >
- <view class="title">下单方式:</view>
- <view class="desc" style="color:red">
- <template v-if="item.state==1">堂食</template>
- <template v-else-if="item.state == 2">外卖</template>
- <template v-else-if="item.state == 3">自提</template>
- <template v-else>快速收款</template>
- </view>
- </view>
- <view class="cell flex flex-y-center" v-if="item.remark">
- <view class="title">订单备注:</view>
- <view class="desc" style="color:#000">
- {{item.remark}}
- </view>
- </view>
- <view class="cell flex flex-y-center arr-r">
- <view class="title">订单时间 :</view>
- <view class="desc">{{item.create_time}}</view>
- </view>
- </view>
- <!-- <block v-if="item.goods_list.lenght>0"> -->
- <view class="goods_list flex" v-for="(items,index) of item.goods_list" :key='index'>
- <view class="goods_list-title flex-grow-1 box-pack-between">
- <view class="">
- {{items.name}} ×{{items.num}}
- </view>
- <view class="goods_list-price">
- ¥{{items.total_price}}
- </view>
- </view>
- </view>
- <!-- </block>-->
- </navigator>
- <view class="no-more" v-if="is_bottom">
- ---没有更多了---
- </view>
- </view>
- <uni-popup-top ref="popup" type="top" :top="top" :maskClass="maskClass">
- <view class="showpay">
- <block v-if='act_index==5'>
- <view class="box-li" :class="store_id==0?'active':''" @click="Onlevel(0,'全部')" data-text='全部'>全部
- </view>
- <scroll-view scroll-y="true" style="height: 400rpx;">
- <view class="box-li" v-for="(item,index) of tableTypeList" :key='index'
- :class="item.id==store_id?'active':''" @click="Onlevel(item.id,item.title)">
- {{item.title}}
- </view>
- </scroll-view>
- </block>
- <block v-if='act_index==1'>
- <view class="box-li" :class="status==''?'active':''" @click="payStatus(0,'全部')" data-type=''
- data-text='全部'>全部
- </view>
- <view class="box-li" :class="status==1?'active':''" @click="payStatus(1,'已支付')" data-type='1'
- data-text='已支付'>已支付
- </view>
- <view class="box-li" :class="status==4?'active':''" @click="payStatus(4,'未支付')" data-type='4'
- data-text='未支付'>未支付
- </view>
- <view class="box-li" :class="status==5?'active':''" @click="payStatus(5,'已退款')" data-type='5'
- data-text='已退款'>已退款
- </view>
- </block>
- <block v-if='act_index==2'>
- <view class="box-li" :class="state==''?'active':''" @click="pay(0,'全部')" data-type=''
- data-text='全部'>全部
- </view>
- <view class="box-li" :class="state==1?'active':''" @click="pay(1,'堂食')" data-type='1'
- data-text='堂食'>堂食
- </view>
- <view class="box-li" :class="state==2?'active':''" @click="pay(2,'外卖')" data-type='2'
- data-text='外卖'>外卖
- </view>
- <view class="box-li" :class="state==3?'active':''" @click="pay(3,'自提')" data-type='3'
- data-text='自提'>自提
- </view>
- <view class="box-li" :class="state==4?'active':''" @click="pay(4,'快速收款')" data-type='4'
- data-text='快速收款'>快速收款
- </view>
- </block>
- <block v-if='act_index==3'>
- <view class="box-li" :class="pay_type==0?'active':''" @click="payType(0,'全部')" data-text='微信'>全部
- </view>
- <view class="box-li" :class="pay_type==1?'active':''" @click="payType(1,'微信')" data-text='微信'>微信
- </view>
- <view class="box-li" :class="pay_type==2?'active':''" @click="payType(2,'支付宝')" data-text='支付宝'>支付宝
- </view>
- <view class="box-li" :class="pay_type==3?'active':''" @click="payType(3,'余额支付')" data-text='余额支付'>
- 余额支付
- </view>
- </block>
- <block v-if='act_index==4'>
- <view class="model">
- <view class="flex-center model-date box-pack-between">
- <view class="model-item" :class="time_index==1?'act':''">
- <picker mode='date' :value="start" :start="startDate" :end="endDate"
- @change="bindDateChange1" data-index="1">
- <view class="flex-center">
- <text>{{start}}</text>
- </view>
- </picker>
- </view>
- <view class="model-item" :class="time_index==2?'act':''">
- <picker mode='date' :value="end" :start="startDate" :end="endDate"
- @change="bindDateChange2" data-index="1">
- <view class="flex-center">
- <text>{{end}}</text>
- </view>
- </picker>
- </view>
- </view>
- <view class="flex">
- <view class="model-btn-close model-btn flex-center" @click="clear">
- 清空
- </view>
- <view class="model-btn-success flex-center model-btn" @click="sure">
- 确定
- </view>
- </view>
- </view>
- </block>
- </view>
- </uni-popup-top>
- </view>
- </template>
- <script>
- import uniPopupTop from '@/components/zx-uni-popup/uni-popup-top.vue'
- export default {
- components: {
- uniPopupTop
- },
- data() {
- return {
- state: 0,
- pay_type: 0,
- URL: getApp().globalData.URL,
- admin_id: "",
- store_id: "",
- list: [],
- page: 1,
- is_bottom: false,
- act_index: 1,
- time_index: 0,
- time_index2: 0,
- start: "开始时间",
- end: "结束时间",
- top: "200rpx",
- maskClass: {
- 'position': 'fixed',
- 'bottom': 0,
- 'top': "100rpx",
- 'left': 0,
- 'right': 0,
- 'backgroundColor': 'rgba(0, 0, 0, 0.4)'
- },
- tableTypeList: [], //门店列表
- level_text: '门店',
- status_text: '订单状态',
- order_text: '下单方式',
- pay_text: '支付方式',
- start_text: '日期查找',
- status: 1
- }
- },
- onLoad(options) {
- console.log(options)
- this.store_id = uni.getStorageSync("store_id");
- this.admin_id = uni.getStorageSync("admin_id");
- if (this.admin_id) {
- this.shop_store_index()
- this.act_index = 5
- }
- if (options.day) {
- this.end = options.day;
- this.start = options.day;
- this.start_text = options.day;
- }
- if (options.state && options.order_text) {
- this.order_text = options.order_text
- this.state = options.state
- }
- console.log(this.state)
- },
- onShow() {
- this.getData(1);
- },
- onReachBottom() {
- if (!this.is_bottom) {
- this.getData(this.page + 1)
- }
- },
- methods: {
- shop_store_index() {
- this.request({
- url: 'Smdcshop/shop_store_index',
- data: {
- admin_id: this.admin_id,
- }
- }).then(res => {
- if (res.code == 200) {
- if (res.data.length > 0) {
- this.tableTypeList = res.data;
- }
- }
- })
- },
- Onlevel(e, text) {
- this.store_id = e;
- this.level_text = text;
- this.list = [];
- this.getData(1);
- this.$refs.popup.close();
- },
- // 键盘完成事件
- firmSeach(e) {
- this.serch = e.detail.value;
- this.getData(1);
- this.$refs.popup.close();
- },
- // 监听input
- putSeach(e) {
- this.serch = e.detail.value;
- if (!e.detail.value) {
- this.getData(1);
- }
- },
- // 搜索
- bindSeach(e) {
- this.getData(1);
- this.$refs.popup.close();
- },
- // 订单状态
- payStatus(e, text) {
- this.status = e;
- this.status_text = text;
- this.getData(1);
- this.$refs.popup.close();
- },
- // 下单方式
- pay(e, text) {
- this.state = e;
- this.order_text = text;
- this.getData(1);
- this.$refs.popup.close();
- },
- // 支付方式搜索
- payType(e, text) {
- this.pay_type = e;
- this.pay_text = text;
- this.getData(1);
- this.$refs.popup.close();
- },
- bindDateChange1(e) {
- this.time_index = e.currentTarget.dataset.index;
- this.start = e.target.value;
- },
- bindDateChange2(e) {
- this.time_index2 = e.currentTarget.dataset.index;
- this.end = e.target.value;
- },
- sure(e) {
- this.getData(1);
- this.$refs.popup.close();
- this.start_text = this.end;
- },
- clear() {
- this.start = '开始时间';
- this.start_text = '日期查找';
- this.end = '结束时间';
- this.getData(1);
- this.$refs.popup.close();
- },
- onTopBtnTap(e) {
- this.act_index = e;
- this.$refs.popup.open();
- },
- getData(page) {
- if (page == 1) {
- this.list = []
- this.page = 1
- this.is_bottom = false
- }
- this.request({
- url: 'Smdcshop/order_index',
- data: {
- page,
- limit: 10,
- admin_id: this.admin_id,
- store_id: this.store_id,
- serch: this.serch,
- state: this.state || '', //1 堂食 2外卖 3自提
- // order_xdtime: this.start == '选择时间' ? '' : this.start,
- start: this.start == '开始时间' ? '' : this.start,
- end: this.end == '结束时间' ? '' : this.end,
- pay_type: this.pay_type || '',
- is_pay: this.status,
- }
- }).then(res => {
- if (res.code == 200 && res.data.length) {
- this.list = this.list.concat(res.data)
- this.page = page
- if (res.data.is_dd == 1 && res.data.is_send == 1) {
- this.GetDadaInfo(res.data.info.id);
- }
- } else {
- this.is_bottom = true
- }
- })
- },
- GetDadaInfo(id) {
- this.request({
- url: 'Smdcshop/GetDadaInfo',
- data: {
- id: id
- }
- }).then(res => {
- this.obj = res.data;
- })
- },
- //提醒取餐
- onQucan(index) {
- console.log(index)
- this.request({
- url: 'merchant/take_meal',
- is_agent: 'agent',
- data: {
- order_id: this.list[index].id
- }
- }).then(res => {
- if (res.code == 200) {
- uni.showModal({
- content: "已提醒取单",
- showCancel: false,
- success: r => {
- this.list[index].no_meal = 2
- console.log(this.list[index])
- }
- })
- }
- })
- }
- },
- }
- </script>
- <style lang="scss">
- .store-name {
- max-width: 150rpx;
- text-overflow: ellipsis;
- white-space: nowrap;
- overflow: hidden;
- }
- .header-text .act {
- color: red;
- }
- .header-text .act .d3 {
- border-color: red transparent transparent transparent;
- }
- .pof {
- position: fixed;
- left: 0;
- z-index: 999;
- background: #fff;
- width: 100%;
- }
- .search-content {
- width: 100%;
- height: 100rpx;
- font-size: 28rpx;
- top: 0;
- .search {
- width: 80%;
- border: 1rpx solid #F1F1F1;
- margin-right: 15rpx;
- padding: 10rpx;
- border-radius: 50rpx;
- icon {
- margin-right: 15rpx;
- }
- }
- }
- .model {
- width: 100%;
- z-index: 10;
- background: #FFFFFF;
- padding-bottom: 20rpx;
- .model-date {
- width: 100%;
- padding: 20rpx 80rpx;
- border-bottom: 1rpx solid #F1F1F1;
- .model-item {
- width: 270rpx;
- text-align: center;
- font-size: 28rpx;
- color: #999;
- position: relative;
- padding: 10rpx 0;
- text-align: center;
- border-radius: 8rpx;
- border: 1rpx solid #999;
- }
- .act {
- // color: #FFFFFF;
- // background: #FFBE2C;
- // border: 1rpx solid #FFBE2C;
- }
- }
- .model-btn {
- border-radius: 8rpx;
- box-shadow: 0px 0px 8rpx 0px rgba(51, 135, 255, 0.20);
- margin: 0 auto;
- margin-top: 20rpx;
- text-align: center;
- width: 41%;
- height: 80rpx;
- border-radius: none;
- }
- .model-btn-close {
- border: 1rpx solid #F1F1F1;
- color: #000;
- }
- .model-btn-success {
- color: #FFFFFF;
- background: linear-gradient(315deg, #3387ff 2%, #569bff 99%);
- }
- }
- page {
- background-color: #F4F5F7;
- }
- .showpay {
- width: 100%;
- z-index: 10;
- background: #FFFFFF;
- }
- .showpay .active {
- color: red
- }
- .header-hg100 {
- height: 100rpx;
- top: 100rpx;
- width: 100%;
- }
- .list {
- padding: 210rpx 25rpx 0;
- }
- .list .item {
- background-color: #fff;
- border-radius: 8rpx;
- overflow: hidden;
- padding: 0 25rpx;
- margin-bottom: 30rpx;
- box-shadow: 0rpx 6rpx 10rpx 0rpx rgba(213, 213, 213, 0.04);
- }
- .list .item .top {
- height: 80rpx;
- border-bottom: 1rpx solid #f5f5f5;
- }
- .list .item .top .pay-info {
- flex: none;
- }
- .pay-type-icon {
- display: block;
- width: 28rpx;
- height: 28rpx;
- flex: none;
- margin-right: 8rpx;
- }
- .pay-status {
- font-size: 28rpx;
- color: #464646;
- }
- .list .item .content {
- padding: 20rpx 0;
- }
- .list .content .cell {
- margin-bottom: 16rpx;
- font-size: 26rpx;
- color: #99A0AD;
- }
- .list .content .cell:last-child {
- margin-bottom: 0;
- }
- .list .content .cell .title {
- color: #99A0AD;
- }
- .list .content .cell .desc {
- color: #666;
- }
- .qc-btn {
- background-color: #3387FF;
- color: #fff;
- border-radius: 6rpx;
- height: 48rpx;
- line-height: 48rpx;
- padding: 0 20rpx;
- margin-left: 10rpx;
- }
- .header-text {
- text-align: center;
- }
- .box-li {
- background-color: #fff;
- text-align: center;
- border-bottom: 1rpx solid #f1f1f1;
- height: 80rpx;
- line-height: 80rpx;
- font-size: 26rpx;
- }
- .goods_list {
- font-size: 28rpx;
- }
- .goods_list-title {
- padding: 20rpx 0;
- }
- .goods_list-price {
- font-size: 26rpx;
- color: red;
- }
- .goods_list-num {
- font-size: 26rpx;
- }
- .d3 {
- width: 0;
- height: 0;
- border-width: 12rpx;
- border-style: solid;
- border-color: #000 transparent transparent transparent;
- margin-top: 14rpx;
- margin-left: 6rpx;
- }
- </style>
|