Commit 3f3cb77c by wangjian

1

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