Commit 460d553a by wangjian

1

parent 49f05bfe
......@@ -57,7 +57,7 @@ export default {
.then(res => {
if (res.code === 200) {
this.name = res.data.staffName;
this.integralCount = res.data.allIntegral;
this.integralCount = res.data.surplusIntegral;
this.isLogin = true
this.$store.commit('refreshUserInfo', res.data)
} else {
......
......@@ -64,6 +64,7 @@
</view>
</view>
</view>
<AlertRecover v-show="showRecover" closeName="showRecover"></AlertRecover>
</view>
</template>
......@@ -73,20 +74,27 @@
return {
height: this.CustomBarHeight,
statusBarHeight: this.StatusBarHeight,
userInfo: {}
userInfo: {},
showRecover: false
};
},
onLoad() {
this.getUserInfo()
},
onShow() {
this.getUserInfo()
},
onTabItemTap () {
if (this.$store.state.isLogin) {
if (!this.$store.state.isLogin) {
this.$router.push('Login')
}
this.getUserInfo()
},
methods: {
getUserInfo() {
if (!this.$store.state.isLogin) {
this.$router.push('Login')
return
}
this.$net.get('/staff/detail').then(res => {
if (res.code === 200) {
this.userInfo = res.data
......@@ -97,6 +105,10 @@
})
},
getImg() {
if (!this.$store.state.isLogin) {
this.$router.push('Login')
return
}
var that = this
uni.chooseImage({
count: 1,
......@@ -114,8 +126,12 @@
});
},
clickItem(index) {
if (!this.$store.state.isLogin) {
this.$router.push('Login')
return
}
if (index === 1) {
this.showRecover = true
} else if (index === 2) {
this.$router.push('IntegralDetail')
} else if (index === 3) {
......@@ -123,8 +139,21 @@
}
},
setting() {
if (!this.$store.state.isLogin) {
this.$router.push('Login')
return
}
this.$router.push('Setting')
}
},
watch: {
showRecover (newVal, oldVal) {
if (newVal) {
uni.hideTabBar()
} else {
uni.showTabBar()
}
}
}
}
</script>
......
<template>
<view class="container">
<view class="empty" v-if="orderLists.length<=0 && loadingType != 'loading'">
<!-- <image class="empty-img" src="../../static/order/empty-order.png" mode=""></image> -->
<image class="empty-img" src="../../static/empty-coupon.png" mode=""></image>
<view class="empty-text">暂无订单</view>
</view>
<view class="order-list">
......@@ -59,7 +59,7 @@
this.getList()
},
onTabItemTap () {
if (this.$store.state.isLogin) {
if (!this.$store.state.isLogin) {
this.$router.push('Login')
}
this.orderLists = []
......@@ -69,7 +69,7 @@
},
methods: {
getList() {
if (this.loadingType == 'noMore' || this.loadingType == 'loading') {
if (this.loadingType == 'noMore') {
return
}
this.loadingType = 'loading';
......
......@@ -9,7 +9,7 @@
</view>
<view class="num">
<view class="left">卡券数量:{{couponData.cardNumberTotal}}</view>
<view class="right">卡券回收</view>
<view class="right" @click="showRecover=true">卡券回收</view>
</view>
<view class="money"><text>价值</text>{{couponData.cardCostTotal}}</view>
<view class="tab">
......@@ -25,7 +25,7 @@
</view>
</view>
</view>
<view class="list">
<view class="list" v-if="list.length>0">
<view class="coupon-content" v-for="(item,index) in list" :key="index">
<image @click="addItem(item)" v-if="selectBtn" class="select-img" :src="selectCouponArray.indexOf(item.cardId)>-1?'../../static/select-h.png':'../../static/select-n.png'" mode=""></image>
<view class="coupon-big">
......@@ -61,6 +61,10 @@
</view>
</view>
<uni-load-more :status="loadingType" v-if="list.length>0"></uni-load-more>
<view class="empty" v-if="list.length<=0 && loadingType != 'loading'">
<image class="empty-img" src="../../static/empty-coupon.png" mode=""></image>
<view class="empty-text">暂无订单</view>
</view>
<view class="bottom" v-if="selectBtn" :style="{'height':safeAreaBottom+60+'px'}">
<view class="left">
<image @click="addAllItem()" class="img" :src="isSelectAll?'../../static/select-h.png':'../../static/select-n.png'" mode=""></image>
......@@ -72,6 +76,7 @@
</view>
<AlertSelectStatus v-show="showChangeStatusAlert" closeName="showChangeStatusAlert" :useState="changeStatusItem.useState" @change="changeStatus"></AlertSelectStatus>
<AlertUnlock v-show="showUnlockAlert" closeName="showUnlockAlert" @certain="unLockCard"></AlertUnlock>
<AlertRecover v-show="showRecover" closeName="showRecover"></AlertRecover>
</view>
</template>
......@@ -92,7 +97,8 @@
selectCouponArray: [],
changeStatusItem: {},
showChangeStatusAlert: false,
showUnlockAlert: false
showUnlockAlert: false,
showRecover: false
}
},
onLoad(options) {
......@@ -470,6 +476,20 @@
}
}
}
.empty {
padding: 100rpx 136rpx 0;
.empty-img {
height: 280rpx;
width: 480rpx;
}
.empty-text {
font-size: 28rpx;
color: #BFBFBF;
margin-top: 48rpx;
width: 480rpx;
text-align: center;
}
}
.bottom {
// height: 120rpx;
bottom: 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment