Commit 1cf86515 by wangjian

fixbug

parent 21f50f3f
......@@ -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 {
numAdd: numAdd,
numSub: numSub,
numMulti: numMulti,
numDivision: numDivision,
getGoodsPrice: getGoodsPrice
getGoodsPrice: getGoodsPrice,
moneyFormat: moneyFormat
}
\ No newline at end of file
......@@ -7,17 +7,18 @@
<view class="item first-item">
<view>设置支付密码:</view>
<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>
</view>
</view>
<view class="item">
<view>确认支付密码:</view>
<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>
</view>
</view>
<view @click="submit()" class="buy-bottom" :style="{'background-color':firstPwd===secondPwd&&secondPwd!=''?'#FF0520':''}">确认支付密码</view>
</view>
</view>
</template>
......@@ -64,6 +65,9 @@
})
},
close() {
this.firstPwd = ''
this.secondPwd = ''
console.log(this.firstPwd);
this.$parent[this.closeName] = false
},
getUserInfo() {
......@@ -96,11 +100,11 @@
background-color: rgba($color: #000000, $alpha: 0.7);
z-index: 99999;
.content {
margin: 50% auto;
margin: 50% 28rpx;
border-radius: 16rpx;
background-color: #FFFFFF;
padding: 48rpx 40rpx;
width: 640rpx;
// width: 640rpx;
position: relative;
.close {
position: absolute;
......@@ -153,17 +157,15 @@
}
}
.buy-bottom {
margin-top: 96rpx;
margin: 64rpx 0 48rpx;
border-radius: 40rpx;
height: 80rpx;
width: 686rpx;
background-color: #FF0520;
line-height: 82rpx;
text-align: center;
color: #FFFFFF;
font-size: 32rpx;
z-index: 99999;
margin-bottom: 32rpx;
}
}
}
......
......@@ -57,7 +57,7 @@ export default {
.then(res => {
if (res.code === 200) {
this.name = res.data.staffName;
this.integralCount = res.data.surplusIntegral;
this.integralCount = this.$numUtils.moneyFormat(res.data.surplusIntegral, 3, ',');
this.isLogin = true
this.$store.commit('refreshUserInfo', res.data)
} else {
......
......@@ -19,15 +19,15 @@
<view class="line"></view>
<view class="user-integral">
<view class="item">
<view class="num">{{userInfo.allIntegral}}</view>
<view class="num">{{$numUtils.moneyFormat(userInfo.allIntegral, 3, ',')}}</view>
<view class="bottom">累计积分</view>
</view>
<view class="item">
<view class="num">{{userInfo.surplusIntegral}}</view>
<view class="num">{{$numUtils.moneyFormat(userInfo.surplusIntegral, 3, ',')}}</view>
<view class="bottom">当前积分</view>
</view>
<view class="item">
<view class="num">{{userInfo.consumeIntegral}}</view>
<view class="num">{{$numUtils.moneyFormat(userInfo.consumeIntegral, 3, ',')}}</view>
<view class="bottom">消费积分</view>
</view>
</view>
......@@ -37,7 +37,7 @@
<view class="item" @click="clickItem(1)">
<view class="left">
<image class="left-img" src="../../static/coupon.png" mode=""></image>
<view class="title">回收</view>
<view class="title">回收</view>
</view>
<image class="right-arrow" src="../../static/arrow-right.png" mode=""></image>
</view>
......
......@@ -2,10 +2,10 @@
<view class="layout">
<view class="list">
<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">
<text class="item-title">{{ item.name }}{{ item.skuName }}</text>
<view><text class="item-brand">{{ item.name }}</text></view>
<text class="item-title">{{ item.skuName }}</text>
<view><text class="item-brand">{{ item.BrandName }}</text></view>
<text class="item-integral">{{ item.sellingPrice }}积分</text>
</view>
</view>
......
......@@ -6,7 +6,7 @@
<swiper class="swiper" @change="swiperChange">
<swiper-item v-for="(item, index) in goods.image" :key="index">
<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> -->
</view>
</swiper-item>
......@@ -23,7 +23,7 @@
</view>
</view>
<view class="good-title">
{{goods.skuDetail.name}}
{{goods.skuDetail.skuName}}
</view>
</view>
</view>
......@@ -33,13 +33,13 @@
<view class="good-attr-rule" @click="showSkuDialog" >
<text class="attr-name">已选</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>
</view>
<view class="good-attr-rule">
<text class="attr-name">购买限制</text>
<text>:</text>
<text class="attrs">{{goods.skuDetail.skuName}}</text>
<text class="attrs">{{goods.skuDetail.validityType}}</text>
</view>
</view>
......
......@@ -106,7 +106,7 @@
this.$net.tokenSave(res.data.token || '')
this.$store.commit('refreshUserLogin', true)
if (res.data.list&&res.data.list.length>0) {
this.$router.replaceTo('SelectAccount')
this.$router.replace('SelectAccount')
} else {
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