Commit 460d553a by wangjian

1

parent 49f05bfe
...@@ -57,7 +57,7 @@ export default { ...@@ -57,7 +57,7 @@ export default {
.then(res => { .then(res => {
if (res.code === 200) { if (res.code === 200) {
this.name = res.data.staffName; this.name = res.data.staffName;
this.integralCount = res.data.allIntegral; this.integralCount = res.data.surplusIntegral;
this.isLogin = true this.isLogin = true
this.$store.commit('refreshUserInfo', res.data) this.$store.commit('refreshUserInfo', res.data)
} else { } else {
......
...@@ -64,6 +64,7 @@ ...@@ -64,6 +64,7 @@
</view> </view>
</view> </view>
</view> </view>
<AlertRecover v-show="showRecover" closeName="showRecover"></AlertRecover>
</view> </view>
</template> </template>
...@@ -73,20 +74,27 @@ ...@@ -73,20 +74,27 @@
return { return {
height: this.CustomBarHeight, height: this.CustomBarHeight,
statusBarHeight: this.StatusBarHeight, statusBarHeight: this.StatusBarHeight,
userInfo: {} userInfo: {},
showRecover: false
}; };
}, },
onLoad() { onLoad() {
this.getUserInfo() this.getUserInfo()
}, },
onShow() {
this.getUserInfo()
},
onTabItemTap () { onTabItemTap () {
if (this.$store.state.isLogin) { if (!this.$store.state.isLogin) {
this.$router.push('Login') this.$router.push('Login')
} }
this.getUserInfo()
}, },
methods: { methods: {
getUserInfo() { getUserInfo() {
if (!this.$store.state.isLogin) {
this.$router.push('Login')
return
}
this.$net.get('/staff/detail').then(res => { this.$net.get('/staff/detail').then(res => {
if (res.code === 200) { if (res.code === 200) {
this.userInfo = res.data this.userInfo = res.data
...@@ -97,6 +105,10 @@ ...@@ -97,6 +105,10 @@
}) })
}, },
getImg() { getImg() {
if (!this.$store.state.isLogin) {
this.$router.push('Login')
return
}
var that = this var that = this
uni.chooseImage({ uni.chooseImage({
count: 1, count: 1,
...@@ -114,8 +126,12 @@ ...@@ -114,8 +126,12 @@
}); });
}, },
clickItem(index) { clickItem(index) {
if (!this.$store.state.isLogin) {
this.$router.push('Login')
return
}
if (index === 1) { if (index === 1) {
this.showRecover = true
} else if (index === 2) { } else if (index === 2) {
this.$router.push('IntegralDetail') this.$router.push('IntegralDetail')
} else if (index === 3) { } else if (index === 3) {
...@@ -123,8 +139,21 @@ ...@@ -123,8 +139,21 @@
} }
}, },
setting() { setting() {
if (!this.$store.state.isLogin) {
this.$router.push('Login')
return
}
this.$router.push('Setting') this.$router.push('Setting')
} }
},
watch: {
showRecover (newVal, oldVal) {
if (newVal) {
uni.hideTabBar()
} else {
uni.showTabBar()
}
}
} }
} }
</script> </script>
......
<template> <template>
<view class="container"> <view class="container">
<view class="empty" v-if="orderLists.length<=0 && loadingType != 'loading'"> <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 class="empty-text">暂无订单</view>
</view> </view>
<view class="order-list"> <view class="order-list">
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
this.getList() this.getList()
}, },
onTabItemTap () { onTabItemTap () {
if (this.$store.state.isLogin) { if (!this.$store.state.isLogin) {
this.$router.push('Login') this.$router.push('Login')
} }
this.orderLists = [] this.orderLists = []
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
}, },
methods: { methods: {
getList() { getList() {
if (this.loadingType == 'noMore' || this.loadingType == 'loading') { if (this.loadingType == 'noMore') {
return return
} }
this.loadingType = 'loading'; this.loadingType = 'loading';
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
</view> </view>
<view class="num"> <view class="num">
<view class="left">卡券数量:{{couponData.cardNumberTotal}}</view> <view class="left">卡券数量:{{couponData.cardNumberTotal}}</view>
<view class="right">卡券回收</view> <view class="right" @click="showRecover=true">卡券回收</view>
</view> </view>
<view class="money"><text>价值</text>{{couponData.cardCostTotal}}</view> <view class="money"><text>价值</text>{{couponData.cardCostTotal}}</view>
<view class="tab"> <view class="tab">
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
</view> </view>
</view> </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"> <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> <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"> <view class="coupon-big">
...@@ -61,6 +61,10 @@ ...@@ -61,6 +61,10 @@
</view> </view>
</view> </view>
<uni-load-more :status="loadingType" v-if="list.length>0"></uni-load-more> <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="bottom" v-if="selectBtn" :style="{'height':safeAreaBottom+60+'px'}">
<view class="left"> <view class="left">
<image @click="addAllItem()" class="img" :src="isSelectAll?'../../static/select-h.png':'../../static/select-n.png'" mode=""></image> <image @click="addAllItem()" class="img" :src="isSelectAll?'../../static/select-h.png':'../../static/select-n.png'" mode=""></image>
...@@ -72,6 +76,7 @@ ...@@ -72,6 +76,7 @@
</view> </view>
<AlertSelectStatus v-show="showChangeStatusAlert" closeName="showChangeStatusAlert" :useState="changeStatusItem.useState" @change="changeStatus"></AlertSelectStatus> <AlertSelectStatus v-show="showChangeStatusAlert" closeName="showChangeStatusAlert" :useState="changeStatusItem.useState" @change="changeStatus"></AlertSelectStatus>
<AlertUnlock v-show="showUnlockAlert" closeName="showUnlockAlert" @certain="unLockCard"></AlertUnlock> <AlertUnlock v-show="showUnlockAlert" closeName="showUnlockAlert" @certain="unLockCard"></AlertUnlock>
<AlertRecover v-show="showRecover" closeName="showRecover"></AlertRecover>
</view> </view>
</template> </template>
...@@ -92,7 +97,8 @@ ...@@ -92,7 +97,8 @@
selectCouponArray: [], selectCouponArray: [],
changeStatusItem: {}, changeStatusItem: {},
showChangeStatusAlert: false, showChangeStatusAlert: false,
showUnlockAlert: false showUnlockAlert: false,
showRecover: false
} }
}, },
onLoad(options) { onLoad(options) {
...@@ -470,6 +476,20 @@ ...@@ -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 { .bottom {
// height: 120rpx; // height: 120rpx;
bottom: 0; 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