修复充值bug

master
Lee 2022-09-29 15:25:24 +08:00
parent 109bebbbce
commit 93ac9e7075
17 changed files with 44 additions and 37 deletions

View File

@ -12,7 +12,7 @@
</view>
</view>
<!-- 充值金额 -->
<view class="recharge-amount border-box pad-all20 mar-s20">
<view class="recharge-amount border-box pad-all20 mar-s20" v-if="amountList.length">
<view class="recharge-title font30 flex">
<view class="line background-orange"></view>
<text>充值金额</text>
@ -41,7 +41,7 @@
</view>
</view>
<!-- 尾部 -->
<view class="pull-footer-bg background-white pad-all20 radius30 border-box">
<view class="pull-footer-bg background-white pad-all20 radius30 border-box" v-if="amountPrice!==''">
<view class="pull-footer background-grey radius30 pad-all20 border-box flex">
<view class="price color-ff" style="margin-left: 24rpx;">
<view class="font60 flex">{{amountPrice}}</view>
@ -101,7 +101,10 @@
amountArr.push(amountObj);
})
this.amountList = amountArr;
this.amountPrice = this.$toolAll.tools.addXiaoShu(this.amountList[0].price);
if(res.data.length){
//
this.amountPrice = this.$toolAll.tools.addXiaoShu(this.amountList[0].price);
}
}
})
},
@ -111,13 +114,13 @@
uni.showLoading({
title:'加载中'
})
this.$requst.post('/api/user/balance-log-list',{template_id:this.amountList[this.amountIndex].id}).then(res=>{
this.$requst.post('/api/user/balance-log-list').then(res=>{
if(res.code == 0){
console.log(res,'余额记录');
this.detailedList = res.data;
uni.hideLoading();
this.isLoading = true;
}
uni.hideLoading();
this.isLoading = true;
})
},

View File

@ -44,7 +44,7 @@
<scroll-view scroll-y="true" class="specs-list" v-if="shopDetail.is_over==0">
<view class="specs-item border-box radius20 mar-s20 pad-zy20 font36 flex" :class="skuIndex==index?'active':''" v-for="(item,index) in shopSku" :key="index" @tap="changeSpecs(index)">
<text>{{item.title}}</text>
<text>{{vip_level>0?item.price:item.original_price}}</text>
<text>{{vip_level>0?item.price:item.price}}</text>
</view>
</scroll-view>
<view class="specs-btns flex" v-if="shopDetail.is_over==0">

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -120,19 +120,20 @@ var render = function() {
var _vm = this
var _h = _vm.$createElement
var _c = _vm._self._c || _h
var l0 = _vm.isLoading
? _vm.__map(_vm.amountList, function(item, index) {
var $orig = _vm.__get_orig(item)
var l0 =
_vm.isLoading && _vm.amountList.length
? _vm.__map(_vm.amountList, function(item, index) {
var $orig = _vm.__get_orig(item)
var m0 = parseInt(item.money)
var m1 = parseInt(item.price)
return {
$orig: $orig,
m0: m0,
m1: m1
}
})
: null
var m0 = parseInt(item.money)
var m1 = parseInt(item.price)
return {
$orig: $orig,
m0: m0,
m1: m1
}
})
: null
var l1 = _vm.isLoading
? _vm.__map(_vm.detailedList, function(item, index) {
var $orig = _vm.__get_orig(item)
@ -289,7 +290,10 @@ var _default =
amountArr.push(amountObj);
});
_this2.amountList = amountArr;
_this2.amountPrice = _this2.$toolAll.tools.addXiaoShu(_this2.amountList[0].price);
if (res.data.length) {
// 设置初始金额
_this2.amountPrice = _this2.$toolAll.tools.addXiaoShu(_this2.amountList[0].price);
}
}
});
},
@ -299,13 +303,13 @@ var _default =
uni.showLoading({
title: '加载中' });
this.$requst.post('/api/user/balance-log-list', { template_id: this.amountList[this.amountIndex].id }).then(function (res) {
this.$requst.post('/api/user/balance-log-list').then(function (res) {
if (res.code == 0) {
console.log(res, '余额记录');
_this3.detailedList = res.data;
uni.hideLoading();
_this3.isLoading = true;
}
uni.hideLoading();
_this3.isLoading = true;
});
},

View File

@ -1 +1 @@
<block wx:if="{{isLoading}}"><view class="pad-x170"><status-nav vue-id="7d2a92db-1" ifReturn="{{true}}" navBarTitle="我的余额" marginBottom="{{0}}" bind:__l="__l"></status-nav><view class="recharge border-box"><view class="recharge-msg radius30 border-box"><view class="txt flex"><text class="font30">我的余额</text><text class="font24">余额可用于购物使用</text></view><view class="price font60"><text class="font48">¥</text>{{balance}}</view></view></view><view class="recharge-amount border-box pad-all20 mar-s20"><view class="recharge-title font30 flex"><view class="line background-orange"></view><text>充值金额</text></view><view class="amount-list flex"><block wx:for="{{$root.l0}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view data-event-opts="{{[['tap',[['changeAmount',[index]]]]]}}" class="{{['amount-item','border-box','radius20','mar-s25',index==amountIndex?'checked':'']}}" bindtap="__e"><view class="font48 mar-s15">{{item.m0+"元"}}</view><text class="font24">{{"售价"+item.m1+"元"}}</text></view></block></view></view><view class="recharge-detailed border-box pad-all20 mar-s20"><view class="recharge-title font30 flex"><view class="line background-orange"></view><text>消费明细</text></view><view class="detailed-list"><block wx:for="{{$root.l1}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view class="detailed-item font30 border-box pad-sx20 flex"><view class="txt"><view class="name mar-x10">{{item.$orig.title}}</view><view class="time font24 color-99">{{item.$orig.create_time}}</view></view><view class="{{['price',item.m2<0?'color-red':'']}}">{{item.$orig.money}}</view></view></block></view></view><view class="pull-footer-bg background-white pad-all20 radius30 border-box"><view class="pull-footer background-grey radius30 pad-all20 border-box flex"><view class="price color-ff" style="margin-left:24rpx;"><view class="font60 flex">{{"¥"+amountPrice}}</view></view><view data-event-opts="{{[['tap',[['submitEv',['$event']]]]]}}" class="btn font36 color-48 background-orange radius30 flex" bindtap="__e">确认充值</view></view></view></view></block>
<block wx:if="{{isLoading}}"><view class="pad-x170"><status-nav vue-id="7d2a92db-1" ifReturn="{{true}}" navBarTitle="我的余额" marginBottom="{{0}}" bind:__l="__l"></status-nav><view class="recharge border-box"><view class="recharge-msg radius30 border-box"><view class="txt flex"><text class="font30">我的余额</text><text class="font24">余额可用于购物使用</text></view><view class="price font60"><text class="font48">¥</text>{{balance}}</view></view></view><block wx:if="{{amountList.length}}"><view class="recharge-amount border-box pad-all20 mar-s20"><view class="recharge-title font30 flex"><view class="line background-orange"></view><text>充值金额</text></view><view class="amount-list flex"><block wx:for="{{$root.l0}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view data-event-opts="{{[['tap',[['changeAmount',[index]]]]]}}" class="{{['amount-item','border-box','radius20','mar-s25',index==amountIndex?'checked':'']}}" bindtap="__e"><view class="font48 mar-s15">{{item.m0+"元"}}</view><text class="font24">{{"售价"+item.m1+"元"}}</text></view></block></view></view></block><view class="recharge-detailed border-box pad-all20 mar-s20"><view class="recharge-title font30 flex"><view class="line background-orange"></view><text>消费明细</text></view><view class="detailed-list"><block wx:for="{{$root.l1}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view class="detailed-item font30 border-box pad-sx20 flex"><view class="txt"><view class="name mar-x10">{{item.$orig.title}}</view><view class="time font24 color-99">{{item.$orig.create_time}}</view></view><view class="{{['price',item.m2<0?'color-red':'']}}">{{item.$orig.money}}</view></view></block></view></view><block wx:if="{{amountPrice!==''}}"><view class="pull-footer-bg background-white pad-all20 radius30 border-box"><view class="pull-footer background-grey radius30 pad-all20 border-box flex"><view class="price color-ff" style="margin-left:24rpx;"><view class="font60 flex">{{"¥"+amountPrice}}</view></view><view data-event-opts="{{[['tap',[['submitEv',['$event']]]]]}}" class="btn font36 color-48 background-orange radius30 flex" bindtap="__e">确认充值</view></view></view></block></view></block>

View File

@ -1 +1 @@
<view class="pad-x170 data-v-374e5d04"><block wx:if="{{scroolTop}}"><view class="scrool-top background-white data-v-374e5d04" style="{{'height:'+(statusHeight+50+'px')+';'}}"></view></block><view data-event-opts="{{[['tap',[['backEv',['$event']]]]]}}" class="back-btn flex data-v-374e5d04" style="{{'top:'+(statusHeight+'px')+';'}}" bindtap="__e"><view class="icon icon-return _i data-v-374e5d04" style="{{'font-size:38rpx;'+('color:'+(scroolTop?'#000000':'#ffffff')+';')}}"></view></view><view class="shop-top-img data-v-374e5d04"><image src="{{shopDetail.images[0]}}" mode="widthFix" class="data-v-374e5d04"></image><block wx:if="{{shopDetail.has_video==1}}"><view class="video-bg data-v-374e5d04"></view></block><block wx:if="{{shopDetail.has_video==1}}"><view data-event-opts="{{[['tap',[['playEv',['$0'],['shopDetail.video']]]]]}}" class="video-btn data-v-374e5d04" bindtap="__e"><image src="../../static/icon/video.png" mode="widthFix" class="data-v-374e5d04"></image></view></block></view><view class="shop-content pad-all20 background-white data-v-374e5d04"><view class="shop-title font40 mar-x35 data-v-374e5d04" style="padding:30rpx 0 30rpx;"><view class="data-v-374e5d04">{{shopDetail.name}}</view><block wx:if="{{shopDetail.coupon_taboo==1}}"><view class="coupon_taboo font24 color-99 mar-s10 data-v-374e5d04">当前商品无法使用优惠券</view></block></view><view class="shop-body data-v-374e5d04"><view class="pull-title mar-x20 data-v-374e5d04"><view class="txt font30 pad-sx15 data-v-374e5d04">详情介绍</view><view class="line background-orange data-v-374e5d04"></view></view><view class="body-txt font30 color-48 data-v-374e5d04"><rich-text nodes="{{shopDetail.content}}" class="data-v-374e5d04"></rich-text></view></view></view><block wx:if="{{showSku}}"><view class="pull-bg data-v-374e5d04"></view></block><block wx:if="{{showSku}}"><view class="shop-specs background-white border-box data-v-374e5d04"><view class="specs-top flex data-v-374e5d04"><view class="title font30 data-v-374e5d04">{{shopDetail.is_over==0?'规格选择':'商品已售罄'}}</view><view data-event-opts="{{[['tap',[['closeSpecs',['$event']]]]]}}" class="close data-v-374e5d04" bindtap="__e"><image src="/static/icon/icon-close.png" mode="widthFix" class="data-v-374e5d04"></image></view></view><block wx:if="{{shopDetail.is_over==0}}"><scroll-view class="specs-list data-v-374e5d04" scroll-y="true"><block wx:for="{{shopSku}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view data-event-opts="{{[['tap',[['changeSpecs',[index]]]]]}}" class="{{['specs-item','border-box','radius20','mar-s20','pad-zy20','font36','flex','data-v-374e5d04',skuIndex==index?'active':'']}}" bindtap="__e"><text class="data-v-374e5d04">{{item.title}}</text><text class="data-v-374e5d04">{{"¥"+(vip_level>0?item.price:item.original_price)}}</text></view></block></scroll-view></block><block wx:if="{{shopDetail.is_over==0}}"><view class="specs-btns flex data-v-374e5d04"><view data-event-opts="{{[['tap',[['joinCart',['$event']]]]]}}" class="btn radius30 font36 color-ff background-grey flex data-v-374e5d04" bindtap="__e">加入购物车</view><view data-event-opts="{{[['tap',[['buyNow',['$event']]]]]}}" class="btn radius30 font36 color-ff background-orange flex data-v-374e5d04" bindtap="__e">立即购买</view></view></block><block wx:if="{{shopDetail.is_over==1}}"><view class="sell-out font30 color-66 data-v-374e5d04">{{"预估上货时间:"+(shopDetail.cycle!==''?shopDetail.cycle:'未知')}}</view></block></view></block><view class="shop-foot border-box background-white pad-all20 data-v-374e5d04"><view class="shop-footer background-grey pad-sx15 radius30 flex data-v-374e5d04"><view data-event-opts="{{[['tap',[['goHome',['$event']]]]]}}" class="shop-nav font24 color-ff flex data-v-374e5d04" bindtap="__e"><image src="/static/icon/icon-home.png" mode="widthFix" class="data-v-374e5d04"></image><text class="data-v-374e5d04">首页</text></view><view data-event-opts="{{[['tap',[['goCart',['$event']]]]]}}" class="shop-cart background-white radius100 flex data-v-374e5d04" bindtap="__e"><image src="/static/icon/icon-cart.png" mode="widthFix" class="data-v-374e5d04"></image><block wx:if="{{cartNum*1>=0&&cartNum*1<=99}}"><view class="shop-num radius100 font24 color-ff flex data-v-374e5d04"><text class="data-v-374e5d04">{{cartNum}}</text></view></block><block wx:if="{{cartNum*1>99}}"><view class="shop-num radius100 font24 color-ff flex data-v-374e5d04"><text class="data-v-374e5d04">99</text></view></block></view><view data-event-opts="{{[['tap',[['openSpecs',['$event']]]]]}}" class="shop-btn background-orange font36 color-48 radius30 flex data-v-374e5d04" bindtap="__e">立即购买</view></view></view><share-coupon vue-id="b27c4170-1" spuId="{{shopDetail.id}}" class="data-v-374e5d04" bind:__l="__l"></share-coupon></view>
<view class="pad-x170 data-v-374e5d04"><block wx:if="{{scroolTop}}"><view class="scrool-top background-white data-v-374e5d04" style="{{'height:'+(statusHeight+50+'px')+';'}}"></view></block><view data-event-opts="{{[['tap',[['backEv',['$event']]]]]}}" class="back-btn flex data-v-374e5d04" style="{{'top:'+(statusHeight+'px')+';'}}" bindtap="__e"><view class="icon icon-return _i data-v-374e5d04" style="{{'font-size:38rpx;'+('color:'+(scroolTop?'#000000':'#ffffff')+';')}}"></view></view><view class="shop-top-img data-v-374e5d04"><image src="{{shopDetail.images[0]}}" mode="widthFix" class="data-v-374e5d04"></image><block wx:if="{{shopDetail.has_video==1}}"><view class="video-bg data-v-374e5d04"></view></block><block wx:if="{{shopDetail.has_video==1}}"><view data-event-opts="{{[['tap',[['playEv',['$0'],['shopDetail.video']]]]]}}" class="video-btn data-v-374e5d04" bindtap="__e"><image src="../../static/icon/video.png" mode="widthFix" class="data-v-374e5d04"></image></view></block></view><view class="shop-content pad-all20 background-white data-v-374e5d04"><view class="shop-title font40 mar-x35 data-v-374e5d04" style="padding:30rpx 0 30rpx;"><view class="data-v-374e5d04">{{shopDetail.name}}</view><block wx:if="{{shopDetail.coupon_taboo==1}}"><view class="coupon_taboo font24 color-99 mar-s10 data-v-374e5d04">当前商品无法使用优惠券</view></block></view><view class="shop-body data-v-374e5d04"><view class="pull-title mar-x20 data-v-374e5d04"><view class="txt font30 pad-sx15 data-v-374e5d04">详情介绍</view><view class="line background-orange data-v-374e5d04"></view></view><view class="body-txt font30 color-48 data-v-374e5d04"><rich-text nodes="{{shopDetail.content}}" class="data-v-374e5d04"></rich-text></view></view></view><block wx:if="{{showSku}}"><view class="pull-bg data-v-374e5d04"></view></block><block wx:if="{{showSku}}"><view class="shop-specs background-white border-box data-v-374e5d04"><view class="specs-top flex data-v-374e5d04"><view class="title font30 data-v-374e5d04">{{shopDetail.is_over==0?'规格选择':'商品已售罄'}}</view><view data-event-opts="{{[['tap',[['closeSpecs',['$event']]]]]}}" class="close data-v-374e5d04" bindtap="__e"><image src="/static/icon/icon-close.png" mode="widthFix" class="data-v-374e5d04"></image></view></view><block wx:if="{{shopDetail.is_over==0}}"><scroll-view class="specs-list data-v-374e5d04" scroll-y="true"><block wx:for="{{shopSku}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view data-event-opts="{{[['tap',[['changeSpecs',[index]]]]]}}" class="{{['specs-item','border-box','radius20','mar-s20','pad-zy20','font36','flex','data-v-374e5d04',skuIndex==index?'active':'']}}" bindtap="__e"><text class="data-v-374e5d04">{{item.title}}</text><text class="data-v-374e5d04">{{"¥"+(vip_level>0?item.price:item.price)}}</text></view></block></scroll-view></block><block wx:if="{{shopDetail.is_over==0}}"><view class="specs-btns flex data-v-374e5d04"><view data-event-opts="{{[['tap',[['joinCart',['$event']]]]]}}" class="btn radius30 font36 color-ff background-grey flex data-v-374e5d04" bindtap="__e">加入购物车</view><view data-event-opts="{{[['tap',[['buyNow',['$event']]]]]}}" class="btn radius30 font36 color-ff background-orange flex data-v-374e5d04" bindtap="__e">立即购买</view></view></block><block wx:if="{{shopDetail.is_over==1}}"><view class="sell-out font30 color-66 data-v-374e5d04">{{"预估上货时间:"+(shopDetail.cycle!==''?shopDetail.cycle:'未知')}}</view></block></view></block><view class="shop-foot border-box background-white pad-all20 data-v-374e5d04"><view class="shop-footer background-grey pad-sx15 radius30 flex data-v-374e5d04"><view data-event-opts="{{[['tap',[['goHome',['$event']]]]]}}" class="shop-nav font24 color-ff flex data-v-374e5d04" bindtap="__e"><image src="/static/icon/icon-home.png" mode="widthFix" class="data-v-374e5d04"></image><text class="data-v-374e5d04">首页</text></view><view data-event-opts="{{[['tap',[['goCart',['$event']]]]]}}" class="shop-cart background-white radius100 flex data-v-374e5d04" bindtap="__e"><image src="/static/icon/icon-cart.png" mode="widthFix" class="data-v-374e5d04"></image><block wx:if="{{cartNum*1>=0&&cartNum*1<=99}}"><view class="shop-num radius100 font24 color-ff flex data-v-374e5d04"><text class="data-v-374e5d04">{{cartNum}}</text></view></block><block wx:if="{{cartNum*1>99}}"><view class="shop-num radius100 font24 color-ff flex data-v-374e5d04"><text class="data-v-374e5d04">99</text></view></block></view><view data-event-opts="{{[['tap',[['openSpecs',['$event']]]]]}}" class="shop-btn background-orange font36 color-48 radius30 flex data-v-374e5d04" bindtap="__e">立即购买</view></view></view><share-coupon vue-id="b27c4170-1" spuId="{{shopDetail.id}}" class="data-v-374e5d04" bind:__l="__l"></share-coupon></view>