Commit 3f3cb77c by wangjian

1

parent 52d076bb
...@@ -99,7 +99,7 @@ export function getGoodsPrice (goods, type='home') { ...@@ -99,7 +99,7 @@ export function getGoodsPrice (goods, type='home') {
} }
export function moneyFormat(num,counts,mark){ export function moneyFormat(num,counts,mark){
num = num.toString().split("."); num = num.split(".");
var tempAry = num[0].split("").reverse(); var tempAry = num[0].split("").reverse();
var res=[]; var res=[];
for(var i=0,len=tempAry.length;i<len;i++){ for(var i=0,len=tempAry.length;i<len;i++){
......
...@@ -123,7 +123,11 @@ export default { ...@@ -123,7 +123,11 @@ export default {
} }
}; };
</script> </script>
<style>
page {
background-color: #FFEEEE;
}
</style>
<style lang="scss" scoped> <style lang="scss" scoped>
.layout { .layout {
width: 100%; width: 100%;
......
...@@ -19,15 +19,15 @@ ...@@ -19,15 +19,15 @@
<view class="line"></view> <view class="line"></view>
<view class="user-integral"> <view class="user-integral">
<view class="item"> <view class="item">
<view class="num">{{$numUtils.moneyFormat(userInfo.allIntegral, 3, ',')}}</view> <view class="num">{{all}}</view>
<view class="bottom">累计积分</view> <view class="bottom">累计积分</view>
</view> </view>
<view class="item"> <view class="item">
<view class="num">{{$numUtils.moneyFormat(userInfo.surplusIntegral, 3, ',')}}</view> <view class="num">{{current}}</view>
<view class="bottom">当前积分</view> <view class="bottom">当前积分</view>
</view> </view>
<view class="item"> <view class="item">
<view class="num">{{$numUtils.moneyFormat(userInfo.consumeIntegral, 3, ',')}}</view> <view class="num">{{used}}</view>
<view class="bottom">消费积分</view> <view class="bottom">消费积分</view>
</view> </view>
</view> </view>
...@@ -82,6 +82,7 @@ ...@@ -82,6 +82,7 @@
this.getUserInfo() this.getUserInfo()
}, },
onShow() { onShow() {
this.userInfo = {}
this.getUserInfo() this.getUserInfo()
}, },
onTabItemTap () { onTabItemTap () {
...@@ -89,6 +90,26 @@ ...@@ -89,6 +90,26 @@
this.$router.push('Login') this.$router.push('Login')
} }
}, },
computed: {
all() {
if (!this.userInfo.allIntegral) {
return '0'
}
return this.$numUtils.moneyFormat(this.userInfo.allIntegral, 3, ',')
},
current() {
if (!this.userInfo.allIntegral) {
return '0'
}
return this.$numUtils.moneyFormat(this.userInfo.surplusIntegral, 3, ',')
},
used() {
if (!this.userInfo.allIntegral) {
return '0'
}
return this.$numUtils.moneyFormat(this.userInfo.consumeIntegral, 3, ',')
}
},
methods: { methods: {
getUserInfo() { getUserInfo() {
if (!this.$store.state.isLogin) { if (!this.$store.state.isLogin) {
......
...@@ -13,15 +13,15 @@ ...@@ -13,15 +13,15 @@
</view> </view>
<view class="money"><text>价值</text>{{couponData.cardCostTotal}}</view> <view class="money"><text>价值</text>{{couponData.cardCostTotal}}</view>
<view class="tab"> <view class="tab">
<view @click="clickSelectBtn()" class="btn" :style="{'opacity': type===100?'':'0.4'}"> <view @click="clickSelectBtn()" class="btn" :style="{'opacity': selectBtnActive?'':'0.4'}">
<image class="img" :src="selectBtn?'../../static/coupon-select-close.png':'../../static/coupon-select-btn.png'" mode=""></image> <image class="img" :src="selectBtn?'../../static/coupon-select-close.png':'../../static/coupon-select-btn.png'" mode=""></image>
<view class="text">批量管理</view> <view class="text">批量管理</view>
</view> </view>
<view @click="clickType(100)" class="item" :class="[type==100?'active':'']"> <view @click="clickType(100)" class="item" :class="[type==100?'active':'']">
待解锁 待解锁({{couponData.waitCardNumberTotal}})
</view> </view>
<view @click="clickType(200)" class="item" :class="[type==200?'active':'']"> <view @click="clickType(200)" class="item" :class="[type==200?'active':'']">
已解锁 已解锁({{couponData.successCardNumberTotal}})
</view> </view>
</view> </view>
</view> </view>
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
<image class="img" :src="item.brandImg" mode=""></image> <image class="img" :src="item.brandImg" mode=""></image>
<view class="info"> <view class="info">
<view class="name">{{item.brandName}}</view> <view class="name">{{item.brandName}}</view>
<view class="spec">{{item.faceValue}}</view> <view class="spec">{{item.attrName}}:{{item.denomination}}</view>
</view> </view>
</view> </view>
<view class="num"> <view class="num">
...@@ -49,13 +49,16 @@ ...@@ -49,13 +49,16 @@
<image v-if="!isExpired(item)" class="bg-img" src="../../static/coupon-bottom-h.png" mode=""></image> <image v-if="!isExpired(item)" class="bg-img" src="../../static/coupon-bottom-h.png" mode=""></image>
<image v-if="isExpired(item)" class="bg-img" src="../../static/coupon-bottom-gray.png" mode=""></image> <image v-if="isExpired(item)" class="bg-img" src="../../static/coupon-bottom-gray.png" mode=""></image>
<view class="left" v-if="item.validityStatus===100"> <view class="left" v-if="item.validityStatus===100">
<view>卡号:{{item.cardAccount}}</view> <view v-if="item.cardAccount">卡号:{{item.cardAccount}}<text v-if="type==200">复制</text></view>
<view>卡密:{{item.cardPasswd}}</view> <view>卡密:{{item.cardPasswd}}<text v-if="type==200">复制</text></view>
</view> </view>
<view class="left" v-if="isExpired(item)"> <view class="left" v-if="isExpired(item)">
<view>卡密:{{item.cardPasswd}}</view> <view>卡密:{{item.cardPasswd}}</view>
</view> </view>
<image @click="clickItem(item)" class="img" :src="getImg(item)" mode=""></image> <view>
<image @click="clickItem(item)" class="img" :src="getImg(item)" mode=""></image>
<view v-if="type==200" class="bottom-text">{{item.useState==100?'待使用':'已使用'}}</view>
</view>
</view> </view>
</view> </view>
</view> </view>
...@@ -112,6 +115,9 @@ ...@@ -112,6 +115,9 @@
computed: { computed: {
isSelectAll() { isSelectAll() {
return this.selectCouponArray.length === this.list.length return this.selectCouponArray.length === this.list.length
},
selectBtnActive() {
return this.type===100 && this.list.length>0
} }
}, },
methods: { methods: {
...@@ -176,7 +182,7 @@ ...@@ -176,7 +182,7 @@
this.refreshList() this.refreshList()
}, },
clickSelectBtn() { clickSelectBtn() {
if (this.type === 200) { if (this.type === 200 || this.list.length == 0) {
return return
} }
this.selectBtn = !this.selectBtn this.selectBtn = !this.selectBtn
...@@ -206,14 +212,17 @@ ...@@ -206,14 +212,17 @@
this.toast('请至少选择一张卡券解锁') this.toast('请至少选择一张卡券解锁')
return return
} }
this.selectBtn = false
this.$net.post('/cards/unlock', {'cardIds':this.selectCouponArray}).then(res=>{ this.$net.post('/cards/unlock', {'cardIds':this.selectCouponArray}).then(res=>{
this.selectCouponArray = [] this.selectCouponArray = []
if (res.code === 200) { if (res.code === 200) {
this.toast(this.selectBtn?'批量解锁成功':'解锁成功')
this.clickType(200) this.clickType(200)
this.getCouponData()
this.showUnlockAlert = false this.showUnlockAlert = false
this.selectBtn = false
} else { } else {
this.toast(res.message) this.toast(res.message)
this.selectBtn = false
} }
}) })
}, },
...@@ -222,6 +231,7 @@ ...@@ -222,6 +231,7 @@
if (res.code == 200) { if (res.code == 200) {
this.refreshList() this.refreshList()
this.showChangeStatusAlert = false this.showChangeStatusAlert = false
this.toast('状态变更成功')
} else { } else {
this.toast(res.message) this.toast(res.message)
} }
...@@ -463,12 +473,22 @@ ...@@ -463,12 +473,22 @@
.second { .second {
margin-top: 24rpx; margin-top: 24rpx;
} }
text {
margin-left: 14rpx;
font-size: 26rpx;
color: #FF0520;
}
} }
.img { .img {
height: 80rpx; height: 80rpx;
width: 80rpx; width: 80rpx;
border-radius: 40rpx; border-radius: 40rpx;
} }
.bottom-text {
text-align: center;
font-size: 20rpx;
color: #666666;
}
} }
.expired { .expired {
position: absolute; position: absolute;
......
...@@ -75,8 +75,8 @@ export default { ...@@ -75,8 +75,8 @@ export default {
pageSize: 20, pageSize: 20,
loadingType: 'more', loadingType: 'more',
isLoading: true, isLoading: true,
allConsume: '', allConsume: '0.00',
allIncome: '', allIncome: '0.00',
title: 'picker-view', title: 'picker-view',
years, years,
year, year,
...@@ -104,9 +104,9 @@ export default { ...@@ -104,9 +104,9 @@ export default {
this.$net this.$net
.post('/integral/index', { page: this.page, pageSize: this.pageSize, applyDate: this.applyDate, type: this.currentTab }) .post('/integral/index', { page: this.page, pageSize: this.pageSize, applyDate: this.applyDate, type: this.currentTab })
.then(res => { .then(res => {
this.applyDate = res.data.applyDate;
if (res.data.list.length > 0) { if (res.data.list.length > 0) {
this.integralList = this.integralList.concat(res.data.list); this.integralList = this.integralList.concat(res.data.list);
this.applyDate = res.data.applyDate;
this.allConsume = res.data.allConsume; this.allConsume = res.data.allConsume;
this.allIncome = res.data.allIncome; this.allIncome = res.data.allIncome;
this.page += 1; this.page += 1;
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<view class="input-code input"> <view class="input-code input">
<input class="left" confirm-type="search" type="text" :value="code" placeholder="请输入验证码" <input class="left" confirm-type="search" type="text" :value="code" placeholder="请输入验证码"
@input="bottomInputChange" :placeholder-style="{'color':'#848689'}" :maxlength="4"/> @input="bottomInputChange" :placeholder-style="{'color':'#848689'}" :maxlength="4"/>
<text @click="sendCode()" class="right" :style="{'color':isSendCode?'#FF0520':''}">{{btnText}}</text> <text @click="sendCode()" class="right" :style="{'color':isSendCode?'':'#FF0520'}">{{btnText}}</text>
</view> </view>
</view> </view>
<view class="login-btn" @click="login()"> <view class="login-btn" @click="login()">
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
code: '', code: '',
time: 300, time: 300,
isSendCode: false, isSendCode: false,
btnText: '发送验证码', btnText: '获取验证码',
showSelectAccount: false, showSelectAccount: false,
showGetPhoneBtn: true showGetPhoneBtn: true
} }
...@@ -48,9 +48,10 @@ ...@@ -48,9 +48,10 @@
this.code = e.detail.value this.code = e.detail.value
}, },
getphonenumber (e) { getphonenumber (e) {
console.log(e);
this.liteLogin(e.detail.code) this.liteLogin(e.detail.code)
}, },
sendVerifyCode() { sendCode() {
if (this.phone.length != 11) { if (this.phone.length != 11) {
this.toast('请输入正确的手机号') this.toast('请输入正确的手机号')
return return
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
</view> </view>
<uni-popup class="pop" ref="popup" type="center"> <uni-popup class="pop" ref="popup" type="center">
<view class="dialog"> <view class="dialog">
<view class="title">是否退出登</view> <view class="title">是否退出登</view>
<view class="button-layout"> <view class="button-layout">
<text class="cancel" @click="cancel">取消</text> <text class="cancel" @click="cancel">取消</text>
<text class="sure" @click="sure">确认</text> <text class="sure" @click="sure">确认</text>
...@@ -57,9 +57,10 @@ ...@@ -57,9 +57,10 @@
this.$refs.popup.close() this.$refs.popup.close()
}, },
sure() { sure() {
this.$store.commit("refreshUserInfo", {}) this.$store.commit('refreshUserInfo',{})
this.$store.commit('refreshUserLogin', false)
this.$net.tokenSave('') this.$net.tokenSave('')
this.$router.pop() this.$router.replaceTo('Home')
} }
} }
} }
......
static/coupon-bottom-gray.png

88.4 KB | W: | H:

static/coupon-bottom-gray.png

54.9 KB | W: | H:

static/coupon-bottom-gray.png
static/coupon-bottom-gray.png
static/coupon-bottom-gray.png
static/coupon-bottom-gray.png
  • 2-up
  • Swipe
  • Onion skin
static/coupon-bottom-h.png

127 KB | W: | H:

static/coupon-bottom-h.png

78.3 KB | W: | H:

static/coupon-bottom-h.png
static/coupon-bottom-h.png
static/coupon-bottom-h.png
static/coupon-bottom-h.png
  • 2-up
  • Swipe
  • Onion skin
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