Browse Source

单商户v3.2.1 佣金明细不显示问题

zyh
Gao xiaosong 4 years ago
parent
commit
d2f134d3d6
  1. 60
      pages/user/promotion/CommissionDetails/index.vue

60
pages/user/promotion/CommissionDetails/index.vue

@ -21,9 +21,7 @@
<view>{{ val.addTime }}</view> <view>{{ val.addTime }}</view>
</view> </view>
<view class="num" v-if="val.pm == 1">+{{ val.number }}</view> <view class="num" v-if="val.pm == 1">+{{ val.number }}</view>
<view class="num font-color-red" v-if="val.pm == 0"> <view class="num font-color-red" v-if="val.pm == 0"> -{{ val.number }} </view>
-{{ val.number }}
</view>
</view> </view>
</view> </view>
</view> </view>
@ -33,13 +31,13 @@
</view> </view>
</template> </template>
<script> <script>
import { getCommissionInfo, getSpreadInfo } from "@/api/user"; import { getCommissionInfo, getSpreadInfo } from '@/api/user'
import Loading from "@/components/Loading"; import Loading from '@/components/Loading'
export default { export default {
name: "CommissionDetails", name: 'CommissionDetails',
components: { components: {
Loading Loading,
}, },
props: {}, props: {},
data: function() { data: function() {
@ -48,57 +46,57 @@ export default {
commission: 0, commission: 0,
where: { where: {
page: 1, page: 1,
limit: 3 limit: 3,
}, },
types: 3, types: 3,
loaded: false, loaded: false,
loading: false loading: false,
}; }
}, },
mounted: function() { mounted: function() {
this.getCommission(); this.getCommission()
this.getIndex(); this.getIndex()
}, },
onReachBottom() { onReachBottom() {
this.loading === false && this.getIndex(); this.loading === false && this.getIndex()
}, },
methods: { methods: {
getIndex: function() { getIndex: function() {
let that = this; let that = this
if (that.loading == true || that.loaded == true) return; if (that.loading == true || that.loaded == true) return
that.loading = true; that.loading = true
getCommissionInfo(that.where, that.types).then( getCommissionInfo(that.where, that.types).then(
res => { res => {
that.loading = false; that.loading = false
that.loaded = res.data.length < that.where.limit; that.loaded = res.data.length < that.where.limit
that.loadTitle = that.loaded ? "人家是有底线的" : "上拉加载更多"; that.loadTitle = that.loaded ? '人家是有底线的' : '上拉加载更多'
that.where.page = that.where.page + 1; that.where.page = that.where.page + 1
that.info.push.apply(that.info, res.data); that.info.push.apply(that.info, res.data[0])
}, },
err => { err => {
uni.showToast({ uni.showToast({
title: err.msg || err.response.data.msg || err.response.data.message, title: err.msg || err.response.data.msg || err.response.data.message,
icon: 'none', icon: 'none',
duration: 2000 duration: 2000,
}); })
} }
); )
}, },
getCommission: function() { getCommission: function() {
let that = this; let that = this
getSpreadInfo().then( getSpreadInfo().then(
res => { res => {
that.commission = res.data.commissionCount; that.commission = res.data.commissionCount
}, },
err => { err => {
uni.showToast({ uni.showToast({
title: err.msg || err.response.data.msg || err.response.data.message, title: err.msg || err.response.data.msg || err.response.data.message,
icon: 'none', icon: 'none',
duration: 2000 duration: 2000,
}); })
}
);
} }
)
},
},
} }
};
</script> </script>

Loading…
Cancel
Save