|
@@ -11,7 +11,7 @@
|
|
|
</view>
|
|
|
<view class="uni-list-cell">
|
|
|
<view class="uni-list-cell-db">
|
|
|
- <picker style="width: 100%; height: 100%;" @change="bindPickerChange" :value="index" :range="shopArray" range-key="name">
|
|
|
+ <picker style="width: 100%; height: 100%" @change="bindPickerChange" :value="index" :range="shopArray" range-key="name">
|
|
|
<view class="uni-input">{{ shopArray[index].name }}</view>
|
|
|
</picker>
|
|
|
<view class="icon-warp">
|
|
@@ -23,49 +23,40 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="btn-time">
|
|
|
- <uni-calendar ref="calendar" :insert="false" :range="true" :startDate="'2020-01-01'" :endDate="date" @confirm="confirm"/>
|
|
|
+ <uni-calendar ref="calendar" :insert="false" :range="true" :startDate="'2020-01-01'" :endDate="date" @confirm="confirm" />
|
|
|
<view class="opentime" @tap="openTime">
|
|
|
<view class="start">{{ startdate ? startdate : date }}</view>
|
|
|
<text class="guo">至</text>
|
|
|
<view class="end">{{ enddate ? enddate : date }}</view>
|
|
|
<text class="sundate">共:{{ sunday }}天</text>
|
|
|
</view>
|
|
|
- <view style="width: 19upx;">
|
|
|
- <image src="../../static/images/moreicon.png" class="iconRight"></image>
|
|
|
+ <view style="width: 19upx">
|
|
|
+ <image
|
|
|
+ src="../../static/images/moreicon.png"
|
|
|
+ class="iconRight"
|
|
|
+ ></image>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="header-bar">
|
|
|
- <view class="item" @tap="changeTab(0, flagList[0])" :class="{ active: isactive === 0,henganimationLeft: direction === 'right', henganimationRight: direction === 'left' }">
|
|
|
+ <view class="item" @tap="changeTab('pay', flagList[0])" :class="{ active: isactive === 'pay' }">
|
|
|
<view class="ordertype">已付款</view>
|
|
|
<view class="heng"></view>
|
|
|
</view>
|
|
|
- <view
|
|
|
- class="item"
|
|
|
- @tap="changeTab(1, flagList[1])"
|
|
|
- :class="{ active: isactive === 1,henganimationLeft: direction === 'right', henganimationRight: direction === 'left' }"
|
|
|
- >
|
|
|
+ <view class="item" @tap="changeTab('refund', flagList[1])" :class="{ active: isactive === 'refund' }">
|
|
|
<view class="ordertype">已完成</view>
|
|
|
<view class="heng"></view>
|
|
|
</view>
|
|
|
- <view
|
|
|
- class="item"
|
|
|
- @tap="changeTab(2, flagList[2])"
|
|
|
- :class="{ active: isactive === 2,henganimationLeft: direction === 'right', henganimationRight: direction === 'left' }"
|
|
|
- >
|
|
|
+ <view class="item" @tap="changeTab('rubbishOrder', flagList[2])" :class="{ active: isactive === 'rubbishOrder'}">
|
|
|
<view class="ordertype">退款</view>
|
|
|
<view class="heng"></view>
|
|
|
</view>
|
|
|
<view class="line"></view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view style="height: 352upx;"></view>
|
|
|
+ <view style="height: 352upx"></view>
|
|
|
|
|
|
- <view
|
|
|
- class="order-content"
|
|
|
- v-if="isactive === 0"
|
|
|
- :class="{ leaveRightToLeft: isactive === 0 && direction=== 'left', leaveLeftToRight: isactive === 0 && direction ==='right'}"
|
|
|
-
|
|
|
- >
|
|
|
+ <!-- <view class="order-content" v-if="isactive === 'pay'" :class="{ leaveRightToLeft: isactive === 0 && direction === 'left', leaveLeftToRight: isactive === 0 && direction === 'right', }"> -->
|
|
|
+ <view class="order-content" v-if="isactive === 'pay'" >
|
|
|
<view
|
|
|
class="order-list"
|
|
|
@tap="todetail(item.ordersNo)"
|
|
@@ -100,9 +91,7 @@
|
|
|
</view>
|
|
|
<view
|
|
|
class="order-content"
|
|
|
- v-if="isactive === 1"
|
|
|
- :class="{ leaveRightToLeft: isactive === 1 && direction=== 'left', leaveLeftToRight: isactive === 1 && direction ==='right'}"
|
|
|
-
|
|
|
+ v-if="isactive === 'refund'"
|
|
|
>
|
|
|
<view
|
|
|
class="order-list"
|
|
@@ -138,9 +127,7 @@
|
|
|
</view>
|
|
|
<view
|
|
|
class="order-content"
|
|
|
- v-if="isactive === 2"
|
|
|
- :class="{ leaveRightToLeft: isactive === 2 && direction=== 'left', leaveLeftToRight: isactive === 2 && direction ==='right'}"
|
|
|
-
|
|
|
+ v-if="isactive === 'rubbishOrder'"
|
|
|
>
|
|
|
<view
|
|
|
class="order-list"
|
|
@@ -167,19 +154,18 @@
|
|
|
>
|
|
|
<view class="playtime"
|
|
|
>游玩时间:<text class="message"
|
|
|
- >{{ item.palyTime.substring(0, 11) }}
|
|
|
- {{ item.timePart ? item.timePart : '' }}</text
|
|
|
+ >{{ item.palyTime.substring(0, 11)
|
|
|
+ }}{{ item.timePart ? item.timePart : '' }}</text
|
|
|
></view
|
|
|
>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
-
|
|
|
<uni-load-more :status="more"> </uni-load-more>
|
|
|
<rf-loading v-if="loading"></rf-loading>
|
|
|
- <tabBar :currentIndex="typeNum" ></tabBar>
|
|
|
- <view style="height: 100upx;"></view>
|
|
|
+ <tabBar :currentIndex="typeNum"></tabBar>
|
|
|
+ <view style="height: 100upx"></view>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
@@ -190,16 +176,18 @@ import uniCalendar from '@/components/uni-calendar/uni-calendar.vue';
|
|
|
export default {
|
|
|
name: 'order',
|
|
|
components: { uniLoadMore, uniCalendar },
|
|
|
- data() {
|
|
|
+ data () {
|
|
|
//这里存放数据
|
|
|
return {
|
|
|
+ roleList: [],
|
|
|
typeNum: null,
|
|
|
// loading: false,
|
|
|
shopArray: [{ name: '全部', id: '' }],
|
|
|
index: 0,
|
|
|
shopID: 0,
|
|
|
|
|
|
- isactive: 0, // tab
|
|
|
+ isactive: 'pay', // tab
|
|
|
+
|
|
|
flagList: ['pay', 'accomplish', 'refundorder'],
|
|
|
direction: '',
|
|
|
|
|
@@ -238,7 +226,7 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
// 下拉刷新page.json中要配置
|
|
|
- onPullDownRefresh() {
|
|
|
+ onPullDownRefresh () {
|
|
|
this.startdate = '';
|
|
|
this.enddate = '';
|
|
|
this.sunday = 1;
|
|
@@ -256,7 +244,7 @@ export default {
|
|
|
this.getOrderList();
|
|
|
},
|
|
|
// 页面触底加载
|
|
|
- onReachBottom() {
|
|
|
+ onReachBottom () {
|
|
|
if (this.soleStatus === 1) {
|
|
|
if (this.more === 'noMore') {
|
|
|
return;
|
|
@@ -264,23 +252,25 @@ export default {
|
|
|
this.loadMoreList();
|
|
|
}
|
|
|
},
|
|
|
- onLoad() {
|
|
|
+ onLoad () {
|
|
|
this.typeNum = this.$mStore.state.roleIndex
|
|
|
+ // 权限设置
|
|
|
|
|
|
this.getShopList();
|
|
|
this.getOrderList();
|
|
|
},
|
|
|
//方法集合
|
|
|
methods: {
|
|
|
-
|
|
|
+
|
|
|
+ /*
|
|
|
// 手势开始
|
|
|
- handstart(event) {
|
|
|
+ handstart (event) {
|
|
|
this.startTime = Date.now();
|
|
|
this.startX = event.changedTouches[0].clientX;
|
|
|
this.startY = event.changedTouches[0].clientY;
|
|
|
},
|
|
|
// 手势结束
|
|
|
- handend(event) {
|
|
|
+ handend (event) {
|
|
|
const endTime = Date.now();
|
|
|
const endX = event.changedTouches[0].clientX;
|
|
|
const endY = event.changedTouches[0].clientY;
|
|
@@ -327,15 +317,17 @@ export default {
|
|
|
return;
|
|
|
}
|
|
|
},
|
|
|
+ */
|
|
|
+
|
|
|
// 打开日历
|
|
|
- openTime() {
|
|
|
+ openTime () {
|
|
|
this.startdate = '';
|
|
|
this.enddate = '';
|
|
|
this.sunday = 1;
|
|
|
this.$refs.calendar.open();
|
|
|
},
|
|
|
// 确认时间后
|
|
|
- confirm(e) {
|
|
|
+ confirm (e) {
|
|
|
this.more = 'loading';
|
|
|
|
|
|
this.startdate = e.range.before;
|
|
@@ -354,7 +346,7 @@ export default {
|
|
|
},
|
|
|
|
|
|
// 根据订单号或者手机号查询
|
|
|
- orderByNum() {
|
|
|
+ orderByNum () {
|
|
|
this.more = 'loading';
|
|
|
let num = '';
|
|
|
num = this.params.buyPhone;
|
|
@@ -370,30 +362,47 @@ export default {
|
|
|
},
|
|
|
|
|
|
// 商铺选择
|
|
|
- bindPickerChange(e) {
|
|
|
+ bindPickerChange (e) {
|
|
|
this.more = 'loading';
|
|
|
this.index = e.detail.value;
|
|
|
this.params.shopId = this.shopArray[this.index].id;
|
|
|
this.getOrderList();
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
// tab
|
|
|
- changeTab(type, falg) {
|
|
|
- this.direction = '' // 关闭动画
|
|
|
- this.more = 'loading';
|
|
|
- this.params.pageNum = 1;
|
|
|
- this.isactive = type;
|
|
|
- console.log(this.isactive);
|
|
|
- this.params.orderFlag = falg;
|
|
|
- this.getOrderList();
|
|
|
+ changeTab (type, falg) {
|
|
|
+ console.log(type);
|
|
|
+ let childrenRole = []
|
|
|
+ this.roleList = this.$mStore.state.role
|
|
|
+ this.roleList.forEach((element,index) => {
|
|
|
+ if (element.code === 'order') {
|
|
|
+ element.children.forEach((element,index)=>{
|
|
|
+ if (element.code) {
|
|
|
+ childrenRole.push(element.code)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if (childrenRole.includes(type)) {
|
|
|
+ this.isactive = type;
|
|
|
+ this.more = 'loading';
|
|
|
+ this.params.pageNum = 1;
|
|
|
+ this.params.orderFlag = falg;
|
|
|
+ this.getOrderList();
|
|
|
+ } else {
|
|
|
+ this.$mHelper.toast('无权限访问')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+ // this.direction = '' // 关闭动画
|
|
|
},
|
|
|
// 跳转详情
|
|
|
- todetail(num) {
|
|
|
+ todetail (num) {
|
|
|
uni.setStorageSync('order', num);
|
|
|
this.$mRouter.push({ route: '/pages/order/orderdetail' });
|
|
|
},
|
|
|
// 获取店铺列表
|
|
|
- async getShopList() {
|
|
|
+ async getShopList () {
|
|
|
await this.$http.get('/homePage/getShopByMerId').then((res) => {
|
|
|
if (res.data && res.code === 200) {
|
|
|
let newarr = [{ name: '全部', id: '' }];
|
|
@@ -402,7 +411,7 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
// 订单列表
|
|
|
- async getOrderList() {
|
|
|
+ async getOrderList () {
|
|
|
this.soleStatus = 1;
|
|
|
this.orderList = [];
|
|
|
await this.$http
|
|
@@ -420,7 +429,7 @@ export default {
|
|
|
uni.stopPullDownRefresh();
|
|
|
},
|
|
|
// 上拉加载
|
|
|
- async loadMoreList() {
|
|
|
+ async loadMoreList () {
|
|
|
this.params.pageNum++;
|
|
|
await this.$http
|
|
|
.post('/orders/proList', this.params)
|
|
@@ -573,26 +582,26 @@ export default {
|
|
|
display: block;
|
|
|
}
|
|
|
.henganimationLeft .heng {
|
|
|
- transition: all .5s;
|
|
|
- animation: hengRightToLeft .5s;
|
|
|
+ transition: all 0.5s;
|
|
|
+ animation: hengRightToLeft 0.5s;
|
|
|
}
|
|
|
.henganimationRight .heng {
|
|
|
- transition: all .5s;
|
|
|
- animation: hengLeftToRight .5s;
|
|
|
+ transition: all 0.5s;
|
|
|
+ animation: hengLeftToRight 0.5s;
|
|
|
}
|
|
|
@keyframes hengRightToLeft {
|
|
|
- from{
|
|
|
+ from {
|
|
|
transform: translateX(141upx);
|
|
|
}
|
|
|
- to{
|
|
|
+ to {
|
|
|
transform: translateX(0);
|
|
|
}
|
|
|
}
|
|
|
@keyframes hengLeftToRight {
|
|
|
- from{
|
|
|
+ from {
|
|
|
transform: translateX(-141upx);
|
|
|
}
|
|
|
- to{
|
|
|
+ to {
|
|
|
transform: translateX(0);
|
|
|
}
|
|
|
}
|
|
@@ -643,12 +652,12 @@ export default {
|
|
|
}
|
|
|
.leaveRightToLeft {
|
|
|
transition: all 0.5s linear;
|
|
|
- animation: leaveinRihthToLeft .5s;
|
|
|
+ animation: leaveinRihthToLeft 0.5s;
|
|
|
z-index: 10;
|
|
|
}
|
|
|
.leaveLeftToRight {
|
|
|
transition: all 0.5s linear;
|
|
|
- animation: leaveLeftToRight .5s;
|
|
|
+ animation: leaveLeftToRight 0.5s;
|
|
|
z-index: 10;
|
|
|
}
|
|
|
|