Commit 1cf86515 by wangjian

fixbug

parent 21f50f3f
...@@ -98,10 +98,31 @@ export function getGoodsPrice (goods, type='home') { ...@@ -98,10 +98,31 @@ export function getGoodsPrice (goods, type='home') {
} }
} }
export function moneyFormat(num,counts,mark){
num = num.toString().split(".");
var tempAry = num[0].split("").reverse();
var res=[];
for(var i=0,len=tempAry.length;i<len;i++){
if(i%counts===0&&i!==0){
res.push(mark);
}
res.push(tempAry[i]);
}
res.reverse();
if(num[1]){
res=res.join("").concat("."+num[1]);
}else{
res=res.join("");
}
return res;
}
export default { export default {
numAdd: numAdd, numAdd: numAdd,
numSub: numSub, numSub: numSub,
numMulti: numMulti, numMulti: numMulti,
numDivision: numDivision, numDivision: numDivision,
getGoodsPrice: getGoodsPrice getGoodsPrice: getGoodsPrice,
moneyFormat: moneyFormat
} }
\ No newline at end of file
...@@ -7,17 +7,18 @@ ...@@ -7,17 +7,18 @@
<view class="item first-item"> <view class="item first-item">
<view>设置支付密码:</view> <view>设置支付密码:</view>
<view class="input-content"> <view class="input-content">
<input class="input" :password="!firstOpen" :value="firstPwd" placeholder="请输入6位数字密码" placeholder-style="color:#999999" /> <input class="input" :password="!firstOpen" v-model="firstPwd" placeholder="请输入6位数字密码" placeholder-style="color:#999999" maxlength="6" />
<image class="eye" @click="clickEye(1)" :src="firstOpen?'../../static/eye-open.png':'../../static/eye-off.png'" mode=""></image> <image class="eye" @click="clickEye(1)" :src="firstOpen?'../../static/eye-open.png':'../../static/eye-off.png'" mode=""></image>
</view> </view>
</view> </view>
<view class="item"> <view class="item">
<view>确认支付密码:</view> <view>确认支付密码:</view>
<view class="input-content"> <view class="input-content">
<input class="input" :password="!secondOpen" :value="secondPwd" placeholder="再次输入密码" placeholder-style="color:#999999" /> <input class="input" :password="!secondOpen" v-model="secondPwd" placeholder="再次输入密码" placeholder-style="color:#999999" maxlength="6" />
<image class="eye" @click="clickEye(2)" :src="secondOpen?'../../static/eye-open.png':'../../static/eye-off.png'" mode=""></image> <image class="eye" @click="clickEye(2)" :src="secondOpen?'../../static/eye-open.png':'../../static/eye-off.png'" mode=""></image>
</view> </view>
</view> </view>
<view @click="submit()" class="buy-bottom" :style="{'background-color':firstPwd===secondPwd&&secondPwd!=''?'#FF0520':''}">确认支付密码</view>
</view> </view>
</view> </view>
</template> </template>
...@@ -64,6 +65,9 @@ ...@@ -64,6 +65,9 @@
}) })
}, },
close() { close() {
this.firstPwd = ''
this.secondPwd = ''
console.log(this.firstPwd);
this.$parent[this.closeName] = false this.$parent[this.closeName] = false
}, },
getUserInfo() { getUserInfo() {
...@@ -96,11 +100,11 @@ ...@@ -96,11 +100,11 @@
background-color: rgba($color: #000000, $alpha: 0.7); background-color: rgba($color: #000000, $alpha: 0.7);
z-index: 99999; z-index: 99999;
.content { .content {
margin: 50% auto; margin: 50% 28rpx;
border-radius: 16rpx; border-radius: 16rpx;
background-color: #FFFFFF; background-color: #FFFFFF;
padding: 48rpx 40rpx; padding: 48rpx 40rpx;
width: 640rpx; // width: 640rpx;
position: relative; position: relative;
.close { .close {
position: absolute; position: absolute;
...@@ -153,17 +157,15 @@ ...@@ -153,17 +157,15 @@
} }
} }
.buy-bottom { .buy-bottom {
margin-top: 96rpx; margin: 64rpx 0 48rpx;
border-radius: 40rpx; border-radius: 40rpx;
height: 80rpx; height: 80rpx;
width: 686rpx;
background-color: #FF0520; background-color: #FF0520;
line-height: 82rpx; line-height: 82rpx;
text-align: center; text-align: center;
color: #FFFFFF; color: #FFFFFF;
font-size: 32rpx; font-size: 32rpx;
z-index: 99999; z-index: 99999;
margin-bottom: 32rpx;
} }
} }
} }
......
...@@ -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.surplusIntegral; this.integralCount = this.$numUtils.moneyFormat(res.data.surplusIntegral, 3, ',');
this.isLogin = true this.isLogin = true
this.$store.commit('refreshUserInfo', res.data) this.$store.commit('refreshUserInfo', res.data)
} else { } else {
......
...@@ -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">{{userInfo.allIntegral}}</view> <view class="num">{{$numUtils.moneyFormat(userInfo.allIntegral, 3, ',')}}</view>
<view class="bottom">累计积分</view> <view class="bottom">累计积分</view>
</view> </view>
<view class="item"> <view class="item">
<view class="num">{{userInfo.surplusIntegral}}</view> <view class="num">{{$numUtils.moneyFormat(userInfo.surplusIntegral, 3, ',')}}</view>
<view class="bottom">当前积分</view> <view class="bottom">当前积分</view>
</view> </view>
<view class="item"> <view class="item">
<view class="num">{{userInfo.consumeIntegral}}</view> <view class="num">{{$numUtils.moneyFormat(userInfo.consumeIntegral, 3, ',')}}</view>
<view class="bottom">消费积分</view> <view class="bottom">消费积分</view>
</view> </view>
</view> </view>
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
<view class="item" @click="clickItem(1)"> <view class="item" @click="clickItem(1)">
<view class="left"> <view class="left">
<image class="left-img" src="../../static/coupon.png" mode=""></image> <image class="left-img" src="../../static/coupon.png" mode=""></image>
<view class="title">回收</view> <view class="title">回收</view>
</view> </view>
<image class="right-arrow" src="../../static/arrow-right.png" mode=""></image> <image class="right-arrow" src="../../static/arrow-right.png" mode=""></image>
</view> </view>
......
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
<view class="layout"> <view class="layout">
<view class="list"> <view class="list">
<view class="item" v-for="(item, index) in goodList" @click="goGoodDetail(item.spuNo, item.skuNo)" :key="index"> <view class="item" v-for="(item, index) in goodList" @click="goGoodDetail(item.spuNo, item.skuNo)" :key="index">
<image class="img" :src="item.spuImg"></image> <image class="img" :src="item.skuImg"></image>
<view class="item-rigth"> <view class="item-rigth">
<text class="item-title">{{ item.name }}{{ item.skuName }}</text> <text class="item-title">{{ item.skuName }}</text>
<view><text class="item-brand">{{ item.name }}</text></view> <view><text class="item-brand">{{ item.BrandName }}</text></view>
<text class="item-integral">{{ item.sellingPrice }}积分</text> <text class="item-integral">{{ item.sellingPrice }}积分</text>
</view> </view>
</view> </view>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<swiper class="swiper" @change="swiperChange"> <swiper class="swiper" @change="swiperChange">
<swiper-item v-for="(item, index) in goods.image" :key="index"> <swiper-item v-for="(item, index) in goods.image" :key="index">
<view @click="showPreviewImages = true"> <view @click="showPreviewImages = true">
<image :src="item.url" class="good-image" mode="aspectFill"></image> <image :src="item" class="good-image" mode="aspectFill"></image>
<!-- <video v-if="goodsData.picVideo" style="width: 18.8rem;height: 18.8rem;" autoplay="true" loop="false" muted="true" mode="widthFix" :src="goodsData.picVideo"></video> --> <!-- <video v-if="goodsData.picVideo" style="width: 18.8rem;height: 18.8rem;" autoplay="true" loop="false" muted="true" mode="widthFix" :src="goodsData.picVideo"></video> -->
</view> </view>
</swiper-item> </swiper-item>
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
</view> </view>
</view> </view>
<view class="good-title"> <view class="good-title">
{{goods.skuDetail.name}} {{goods.skuDetail.skuName}}
</view> </view>
</view> </view>
</view> </view>
...@@ -33,13 +33,13 @@ ...@@ -33,13 +33,13 @@
<view class="good-attr-rule" @click="showSkuDialog" > <view class="good-attr-rule" @click="showSkuDialog" >
<text class="attr-name">已选</text> <text class="attr-name">已选</text>
<text>:</text> <text>:</text>
<text class="attrs">{{goods.skuDetail.validityType}}</text> <text class="attrs">{{goods.skuDetail.denomination}}</text>
<image class="right-row" src="../../static/arrow-right.png"></image> <image class="right-row" src="../../static/arrow-right.png"></image>
</view> </view>
<view class="good-attr-rule"> <view class="good-attr-rule">
<text class="attr-name">购买限制</text> <text class="attr-name">购买限制</text>
<text>:</text> <text>:</text>
<text class="attrs">{{goods.skuDetail.skuName}}</text> <text class="attrs">{{goods.skuDetail.validityType}}</text>
</view> </view>
</view> </view>
......
...@@ -106,7 +106,7 @@ ...@@ -106,7 +106,7 @@
this.$net.tokenSave(res.data.token || '') this.$net.tokenSave(res.data.token || '')
this.$store.commit('refreshUserLogin', true) this.$store.commit('refreshUserLogin', true)
if (res.data.list&&res.data.list.length>0) { if (res.data.list&&res.data.list.length>0) {
this.$router.replaceTo('SelectAccount') this.$router.replace('SelectAccount')
} else { } else {
this.$router.pop() this.$router.pop()
} }
......
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