123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454 |
- <template>
- <view class="pages" :style="{'min-height':h+'px','padding-top':(mt)+'px'}">
- <c-nav-bar title="我的订单"></c-nav-bar>
- <view class="tb">
- <view class="tabs">
- <view v-for="(item,index) in tabList" :key="index" @tap="changeStatus(index)">
- <text :class="index==current?'active':''">{{item.name}}</text>
- </view>
- </view>
- </view>
- <view class="mainContain">
- <view v-if="dataList.length>0" class="card" v-for="item,index in dataList" :key="index">
- <template v-if="merchantType==10">
- <view class="header">
- <text style="font-weight: bold;">{{item.payTime}}出发/{{item.orderType==3?'拼船':'包船'}}</text>
- <text :class="oscConfig[item.status]||'textDcx'">{{FishJialeOcfg[item.status]}}</text>
- </view>
- <view class="mainContent" @tap="navTo(item)">
- <image class="image" :src="item.coverImg||'../../../static/orderEg.png'" mode="aspectFill">
- </image>
- <view class="middle">
- <view class="title" style="display: flex; justify-content: space-between;">
- <span> {{item.goodsNameAndType}}</span>
- <span> ¥{{item.totalPrice}}</span>
- </view>
- <span class='info' style="display: flex; justify-content: space-between;">
- <span>
- <span style="margin-right: 15rpx;">{{item.linkName}}</span>
- <span>{{item.linkPhone}}</span>
- </span>
- <span>x{{item.num}}</span>
- </span>
- </view>
- </view>
- <!-- 待使用 -->
- <view class="bottom" @click="handleDetail(item)" v-if="item.status==1">
- <view class="detail s1">
- 核销订单
- </view>
- </view>
- <!-- <view class="bottom" @click="Detail(item)" v-else>
- <view class="detail">
- 删除订单
- </view>
- </view> -->
- </template>
- <template v-if="merchantType==4">
- <view class="header">
- <text style="font-weight: bold;">{{item.merchantName}}</text>
- <text :class="oscConfig2[item.orderStatus]||'textDcx'">{{FishJialeOcfg2[item.orderStatus]}}</text>
- </view>
- <view class="mainContent" @tap="navTo(item)">
- <image class="image" :src="item.productImg||'../../../static/orderEg.png'" mode="aspectFill">
- </image>
- <view class="middle">
- <view class="title" style="display: flex; justify-content: space-between;">
- <span> {{item.productName}}</span>
- <span> ¥{{item.realityPay}}</span>
- </view>
- <span class='info' style="display: flex; justify-content: space-between;">
- <span>
- <span style="margin-right: 15rpx;">{{item.activityStartTime||''}}{{item.activityEndTime}}</span>
- </span>
- <span>x{{item.num}}</span>
- </span>
- </view>
- </view>
- <!-- 待使用 -->
- <view class="bottom" @click="handleDetail(item)" v-if="item.state==1">
- <view class="detail s1">
- 核销订单
- </view>
- </view>
- </template>
- </view>
- <view class="nodata" v-if='dataList.length==0'>
- <NoData></NoData>
- </view>
- </view>
- </view>
- </template>
- <script>
- import TopTabs from '@/components/TopTabs/topTabs.vue';
- // import NoData from '../../components/NoData/index.vue';
- export default {
- components: {
- TopTabs,
- // NoData
- },
- data() {
- return {
- //渔家乐
- FishJialeOcfg: {
- 0: '待支付',
- 1: '待使用',
- 2: '拼船中',
- 3: '已使用',
- 4: '退款中',
- 5: '已退款',
- 6: '已取消',
- 7: '已完成',
- 8: '拼团失败'
- },
- //餐饮
- FishJialeOcfg2: {
- 0: '待支付',
- 4: '待使用',
- 3: '已完成',
- '-1': '已取消',
- '-2': '退款中',
- '-3': '已退款',
- },
- oscConfig2: {
- 0: 'textDzf',
- 4: 'textDcx',
- 3: 'textQx',
- '-1': 'textQx',
- '-2': 'textQx',
- '-3': 'textQx',
- },
- oscConfig: {
- 0: 'textDzf',
- 1: 'textDcx',
- 2: 'textDcx',
- 3: 'textQx',
- 4: 'textQx',
- 5: 'textQx',
- 6: 'textQx',
- 7: 'textQx',
- 8: 'textQx',
- },
- disScroll: false,
- pageIndex: 1,
- pageCount: 50,
- current: 0,
- dataList: [],
- status: '',
- state:'',
- merchantId: uni.getStorageSync('merchantId'),
- merchantType: uni.getStorageSync('merchantType'),
- tabList: [{
- name: '全部订单'
- },
- {
- name: '待支付'
- },
- {
- name: '待使用'
- },
- {
- name: '已完成'
- },
- {
- name: '退款/售后'
- },
- ],
- }
- },
- onLoad(option) {
- if (option.type) {
- const type = parseInt(option.type);
- //其他页面入参
- // if (type == 0) {
- // this.changeStatus(1)
- // } else if (type == 4) {
- // this.changeStatus(2)
- // } else if (type == 3) {
- // this.changeStatus(3)
- // } else if (type == -3) {
- // this.changeStatus(4)
- // }
- } else {
- if(this.merchantType==10){
- this.getOrderList()
- }else{
- this.getOrderList2()
- }
-
- }
- },
- methods: {
- // 去详情
- navTo(item) {
- uni.navigateTo({
- url: '/pagesHouse/Mine/ordersList/details/details?orderCode=' + item.orderCode
- })
- },
- // 核销
- handleDetail() {
- uni.navigateTo({
- url: '/pagesHouse/Verification/index'
- })
- },
- init() {
- this.pageIndex = 1;
- this.dataList = [];
- if(this.merchantType==10){
- this.getOrderList()
- }else{
- this.getOrderList2()
- }
- },
- changeStatus(index) {
- this.current=index;
- if(this.merchantType==10){
- if (index === 0) this.status = '';
- else if (index === 1) this.status = '0'
- else if (index === 2) this.status = '1';
- else if (index === 3) this.status = '3,7';
- else if (index === 4) this.status = '4,5';
- }else{
- if (index === 0) this.state = '';
- else if (index === 1) this.state = '0'
- else if (index === 2) this.state = '4';
- else if (index === 3) this.state = '3';
- else if (index === 4) this.state = '-3';
- }
- this.init();
- },
- //渔家乐订单
- getOrderList() {
- let that = this;
- this.$api.get('/api/fishering/personCenterPage', {
- merchantId: this.merchantId,
- status: this.status,
- page: this.pageIndex,
- limit: this.pageCount,
- }).then(res => {
- if (res.data.code === 0) {
- let {
- list,
- total
- } = res.data.data;
- that.dataList = [...that.dataList, ...list];
- if (res.data.data.list.length < 10) {
- this.disScroll = true;
- } else {
- that.pageIndex++;
- }
- } else that.$showToast(res.data.msg);
- })
- },
- getOrderList2() {
- let that = this;
- this.$api.get('/api/merchant/food/queryPageMerchantOrder', {
- merchantId: this.merchantId,
- state: this.state,
- page: this.pageIndex,
- limit: this.pageCount,
- }).then(res => {
- if (res.data.code === 0) {
- let {
- list,
- total
- } = res.data.data;
- that.dataList = [...that.dataList, ...list];
- if (res.data.data.list.length < 10) {
- this.disScroll = true;
- } else {
- that.pageIndex++;
- }
- } else that.$showToast(res.data.msg);
- })
- },
- hexiao(item) {
- // this.$api.post('/scenic/order/sailWriteOff',{
- // orderType:item.orderType,
- // touristList:this.data
- // }).then(res=>{
- // if(res.data.code==0){
- // uni.redirectTo({
- // url:"/pagesHouse/Verification/success?boatNo="+this.boatNo+'&price='+this.orderInfo.realPrice
- // })
- // }
- // })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .textQx {
- color: #999;
- }
- .textDcx {
- color: #333333;
- }
- .textDzf {
- color: #FF7D01;
- }
- .pages {
- background: #F9FAFC;
- box-sizing: border-box;
- padding-bottom: 50rpx;
- .tb {
- width: 100%;
- top: 0;
- left: 0;
- z-index: 999;
- .searchBoxParent {
- width: 100%;
- background: #fff;
- padding: 20rpx 24rpx 6rpx;
- box-sizing: border-box;
- .searchBox {
- width: 100%;
- background-color: #fff;
- }
- }
- .tabs {
- background: #fff;
- padding: 26rpx 0;
- display: flex;
- align-items: center;
- width: 100%;
- &>view {
- width: 25%;
- font-size: 28rpx;
- font-family: PingFangSC-Regular, PingFang SC;
- font-weight: 400;
- color: black;
- line-height: 40rpx;
- position: relative;
- text-align: center;
- }
- .active {
- font-size: 32rpx;
- font-family: PingFang-SC-Bold, PingFang-SC;
- font-weight: bold;
- color: black;
- line-height: 45rpx;
- }
- .active::after {
- position: absolute;
- content: '';
- width: 50rpx;
- height: 8rpx;
- background: #007A69;
- bottom: -26rpx;
- left: 60%;
- margin-left: -42rpx;
- }
- }
- }
- .green {}
- .mainContain {
- display: flex;
- flex-direction: column;
- padding: 0 20rpx;
- .nodata {
- background: white;
- }
- .card {
- background: #fff;
- border-radius: 16rpx;
- margin: 20rpx 0;
- padding: 0 24rpx 30rpx;
- .header {
- display: flex;
- justify-content: space-between;
- padding: 34rpx 0;
- font-size: 28rpx;
- }
- .mainContent {
- display: flex;
- .image {
- background-repeat: no-repeat;
- background-size: cover;
- width: 136rpx;
- min-width: 136rpx;
- height: 136rpx;
- border-radius: 12rpx;
- }
- .middle {
- color: #777777;
- margin-left: 20rpx;
- width: 100%;
- .title {
- font-weight: bold;
- font-size: 30rpx;
- margin: 16rpx 0 30rpx;
- }
- .info {
- font-size: 26rpx;
- color: #777777;
- }
- }
- .price {
- color: red;
- text-align: center;
- height: 100%;
- align-items: center;
- align-self: center;
- font-size: 29rpx;
- font-weight: 700;
- }
- }
- .bottom {
- display: flex;
- justify-content: flex-end;
- margin-top: 16rpx;
- .detail {
- border-radius: 16rpx;
- color: darkgrey;
- padding: 13rpx 34rpx;
- background-color: #F6F6F6;
- font-size: 26rpx;
- color: #333333;
- font-weight: Regular;
- }
- .s1 {
- border-radius: 16rpx;
- color: darkgrey;
- padding: 13rpx 34rpx;
- background-color: #007A69;
- font-size: 26rpx;
- color: #fff;
- font-weight: Regular;
- }
- }
- }
- }
- }
- </style>
|