|
|
@@ -1,264 +0,0 @@
|
|
|
-<template>
|
|
|
- <view class="order-page">
|
|
|
- <app-tabs :tabs="tabs" :isFixed="true" :currentTab="tabIndex" @change="change" itemWidth="20%"/>
|
|
|
-
|
|
|
- <view style="margin-left:60upx;margin-top:110upx;padding-bottom:30upx;position: relative;">
|
|
|
- <DateSelect @selectDateFn="selectDateFn" defaultShowName='时间' />
|
|
|
-
|
|
|
- <button class="admin-button-com mini-btn blue" style="position: absolute;right:300upx;top:-8upx;" @click="selGhs()">{{ ghsName==''?'选批发店':ghsName }}</button>
|
|
|
-
|
|
|
- <button class="admin-button-com mini-btn blue" style="position: absolute;right:80upx;top:-8upx;" @click="resetSearch()">重置搜索</button>
|
|
|
-
|
|
|
- </view>
|
|
|
-
|
|
|
- <block v-if="!$util.isEmpty(list.data)">
|
|
|
- <view class="pay_list">
|
|
|
- <OrderItem v-for="(item, index) in list.data" :key="index" :info="item" @click="goToDetail"></OrderItem>
|
|
|
- </view>
|
|
|
- </block>
|
|
|
- <block v-else>
|
|
|
- <view>
|
|
|
- <AppWrapperEmpty title="暂无数据" :is-empty="$util.isEmpty(list.data)"/>
|
|
|
- </view>
|
|
|
- </block>
|
|
|
-
|
|
|
- <NotLogin></NotLogin>
|
|
|
- <custom-tab-bar :current="1" />
|
|
|
-
|
|
|
- </view>
|
|
|
- </template>
|
|
|
- <script>
|
|
|
- import AppTabs from "@/components/plugin/tabs";
|
|
|
- import OrderItem from "./orderItem";
|
|
|
- import { list } from "@/mixins";
|
|
|
- import AppWrapperEmpty from "@/components/app-wrapper-empty";
|
|
|
- import { ghsList, purchaseList } from "@/api/purchase/index";
|
|
|
- import DateSelect from "@/components/module/dateSelect";
|
|
|
- import NotLogin from "@/components/not-login";
|
|
|
- export default {
|
|
|
- components: {
|
|
|
- AppWrapperEmpty,
|
|
|
- OrderItem,
|
|
|
- AppTabs,
|
|
|
- DateSelect,
|
|
|
- NotLogin
|
|
|
- },
|
|
|
- mixins: [list],
|
|
|
- data () {
|
|
|
- return {
|
|
|
- tabs: [
|
|
|
- {
|
|
|
- name: "全部",
|
|
|
- value: 0,
|
|
|
- key: '0'
|
|
|
- },
|
|
|
- {
|
|
|
- name: "待付款",
|
|
|
- value: 0,
|
|
|
- key: '1'
|
|
|
- },
|
|
|
- {
|
|
|
- name: "待发货",
|
|
|
- value: 0,
|
|
|
- key: '2'
|
|
|
- },
|
|
|
- {
|
|
|
- name: "配送中",
|
|
|
- value: 0,
|
|
|
- key: '3'
|
|
|
- },
|
|
|
- {
|
|
|
- name: "已完成",
|
|
|
- value: 0,
|
|
|
- key: '4'
|
|
|
- }
|
|
|
- ],
|
|
|
- list: {
|
|
|
- data: []
|
|
|
- },
|
|
|
- supplierList: [],
|
|
|
- tabIndex: 0,
|
|
|
- status: '0',
|
|
|
- refreshPage:1,
|
|
|
- searchContent:'',
|
|
|
- searchTime:'',
|
|
|
- startTime:'',
|
|
|
- ghsId:0,
|
|
|
- ghsName:''
|
|
|
- }
|
|
|
- },
|
|
|
- onReachBottom () {
|
|
|
- if (!this.list.finished) {
|
|
|
- this.getMyPurchase().then(res => {
|
|
|
- uni.stopPullDownRefresh()
|
|
|
- });
|
|
|
- } else {
|
|
|
- uni.stopPullDownRefresh()
|
|
|
- }
|
|
|
- },
|
|
|
- onPullDownRefresh () {
|
|
|
- this.resetList();
|
|
|
- this.getMyPurchase().then(res => {
|
|
|
- uni.stopPullDownRefresh()
|
|
|
- })
|
|
|
- },
|
|
|
- onShow(){
|
|
|
- if(this.refreshPage == 1){
|
|
|
- this.resetList()
|
|
|
- this.getMyPurchase()
|
|
|
- }
|
|
|
- },
|
|
|
- methods: {
|
|
|
- selGhs(){
|
|
|
- this.$util.pageTo({ url: "/pagesPurchase/selectGhs"})
|
|
|
- },
|
|
|
- resetSearch(){
|
|
|
- this.ghsId = 0
|
|
|
- this.ghsName=''
|
|
|
- this.searchTime = ''
|
|
|
- this.startTime = ''
|
|
|
- this.endTime = ''
|
|
|
- this.resetList()
|
|
|
- this.getMyPurchase()
|
|
|
- },
|
|
|
- selectDateFn(val) {
|
|
|
- this.searchTime = val.searchTime
|
|
|
- this.startTime = val.startTime
|
|
|
- this.endTime = val.endTime
|
|
|
- this.resetList()
|
|
|
- this.getMyPurchase()
|
|
|
- },
|
|
|
- change(e) {
|
|
|
- if (this.tabIndex != e.index) {
|
|
|
- uni.pageScrollTo({
|
|
|
- scrollTop: 0,
|
|
|
- duration: 0
|
|
|
- });
|
|
|
- this.resetList();
|
|
|
- this.list.finished = true;
|
|
|
- this.tabIndex = e.index;
|
|
|
- this.status = e.item.key;
|
|
|
- this.getMyPurchase().then(() => {
|
|
|
- this.list.finished = false;
|
|
|
- });
|
|
|
- }
|
|
|
- },
|
|
|
- init() {
|
|
|
- if(this.option.ghsId){
|
|
|
- this.ghsId = this.option.ghsId?this.option.ghsId:0
|
|
|
- this.ghsName = this.option.ghsName?this.option.ghsName:''
|
|
|
- }
|
|
|
- this.getMyPurchase()
|
|
|
- },
|
|
|
- getMyPurchase () {
|
|
|
- return purchaseList({ status: this.status,page: this.list.page,searchTime: this.searchTime,startTime: this.startTime,endTime: this.endTime,ghsId:this.ghsId}).then(res => {
|
|
|
- this.completes(res)
|
|
|
- if (this.$util.isEmpty(res.data)){
|
|
|
- return false
|
|
|
- }
|
|
|
- this.tabs[0].value = res.data.shop.totalPurchaseOrder
|
|
|
- this.tabs[1].value = res.data.shop.cgUnPay
|
|
|
- this.tabs[2].value = res.data.shop.cgUnSend
|
|
|
- this.tabs[3].value = res.data.shop.cgSending
|
|
|
- this.tabs[4].value = res.data.shop.cgFinish
|
|
|
- })
|
|
|
- },
|
|
|
- goToDetail (val) {
|
|
|
- uni.navigateTo({ url: '/pagesPurchase/purDetails?id=' + val.id })
|
|
|
- },
|
|
|
- addEvent() {
|
|
|
- uni.navigateTo({url: '/pagesPurchase/order'})
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- </script>
|
|
|
-
|
|
|
- <style lang="scss" scoped>
|
|
|
- .order-page {
|
|
|
- .tabs {
|
|
|
- height: 80upx;
|
|
|
- line-height: 80upx;
|
|
|
- & > view {
|
|
|
- // padding: 0 80upx;
|
|
|
- width: 50%;
|
|
|
- text-align: center;
|
|
|
- font-size: 28upx;
|
|
|
- color: #666;
|
|
|
- display: inline-block;
|
|
|
- }
|
|
|
- & > .active {
|
|
|
- position: relative;
|
|
|
- color: #3385ff;
|
|
|
- font-weight: 700;
|
|
|
- }
|
|
|
- & > .active::after {
|
|
|
- content: "";
|
|
|
- position: absolute;
|
|
|
- bottom: 0;
|
|
|
- left: 50%;
|
|
|
- transform: translateX(-50%);
|
|
|
- width: 70upx;
|
|
|
- height: 6upx;
|
|
|
- background: #3385ff;
|
|
|
- }
|
|
|
- }
|
|
|
- .order_list {
|
|
|
- // height: 200upx;
|
|
|
- height: 100%;
|
|
|
- background: #f0f2f6;
|
|
|
- padding: 0 0 20upx;
|
|
|
- .list_item {
|
|
|
- margin: 20upx 0 0;
|
|
|
- // padding-left: 20upx;
|
|
|
- position: relative;
|
|
|
- height: 180upx;
|
|
|
- width: 100vw;
|
|
|
- background: #fff;
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- & > image {
|
|
|
- margin-left: 30upx;
|
|
|
- width: 120upx;
|
|
|
- height: 120upx;
|
|
|
- border-radius: 60upx;
|
|
|
- }
|
|
|
- & > .store_name {
|
|
|
- margin-left: 30upx;
|
|
|
- & > .store_title {
|
|
|
- margin-bottom: 30upx;
|
|
|
- font-size: 32upx;
|
|
|
- font-weight: 700;
|
|
|
- color: #333;
|
|
|
- }
|
|
|
- & > .accumulative {
|
|
|
- font-size: 26upx;
|
|
|
- color: #999;
|
|
|
- }
|
|
|
- }
|
|
|
- & > .store_btn {
|
|
|
- position: absolute;
|
|
|
- right: 30upx;
|
|
|
- // padding-right: 30upx;
|
|
|
- & > .btn_entrance {
|
|
|
- display: inline-block;
|
|
|
- font-size: 26upx;
|
|
|
- color: #3385ff;
|
|
|
- border: 1px solid #3385ff;
|
|
|
- border-radius: 8upx;
|
|
|
- padding: 15upx 30upx;
|
|
|
- margin-left: 30upx;
|
|
|
- }
|
|
|
- & > .btn_forbid {
|
|
|
- border: 1px solid #999;
|
|
|
- color: #999;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- .pay_list {
|
|
|
- padding-top:20upx;
|
|
|
- padding-bottom: 100upx;
|
|
|
- background-color: #f0f2f6;
|
|
|
- }
|
|
|
- }
|
|
|
- </style>
|