Fix(分销详情):[#1738]分销详情的说明文本对接

This commit is contained in:
lifizer
2024-06-16 14:09:21 +08:00
parent 2f217e8dc1
commit 4e6d5598b7
2 changed files with 38 additions and 22 deletions
+7
View File
@@ -554,3 +554,10 @@ export function getUserPointInfo(param) {
export function getUserPointBill(param) {
return request.get('/user/points/bill', param, { login: true })
}
/*
* 用户分销说明
*/
export function getUserSpreadRule(param) {
return request.get('/userSpreadRule', param, { login: false })
}
+31 -22
View File
@@ -10,7 +10,7 @@
</view>
</view>
<view class="" style="flex-grow: 1;font-size: 24rpx;">
返佣说明1.下线客户下单成功后平台设置为默认7天收货成功佣金便自动计算添加到上线的返佣2.如过程中下单客户有退货退款则此订单返佣无效会自动取消或相应扣除
{{ ruleText }}
</view>
</view>
</view>
@@ -60,7 +60,7 @@
</view>
</template>
<script>
import { getSpreadOrder } from "@/api/user";
import { getSpreadOrder, getUserSpreadRule } from "@/api/user";
import Loading from "@/components/Loading";
export default {
name: "PromoterOrder",
@@ -77,39 +77,48 @@ export default {
},
loaded: false,
loading: false,
loadTitle: "",
count: ""
};
loadTitle: '',
count: '',
ruleText: ''
}
},
mounted: function() {
this.getIndex();
mounted() {
this.getIndex()
this.getRuleText()
},
onReachBottom() {
!this.loading && this.getIndex();
!this.loading && this.getIndex()
},
methods: {
getIndex: function() {
let there = this;
if (there.loaded == true || there.loading == true) return;
there.loading = true;
getRuleText() {
getUserSpreadRule().then(res => {
const { success, data } = res
if (success) {
this.ruleText = data.userSpreadRule || ''
}
})
},
getIndex() {
let there = this
if (there.loaded == true || there.loading == true) return
there.loading = true
getSpreadOrder(there.where).then(
res => {
there.loading = false;
there.loaded = res.data.list.length < there.where.limit;
there.loadTitle = there.loaded ? "人家是有底线的" : "上拉加载更多";
there.where.page = there.where.page + 1;
there.list.push.apply(there.list, res.data.list);
there.count = res.data.count;
there.loading = false
there.loaded = res.data.list.length < there.where.limit
there.loadTitle = there.loaded ? "人家是有底线的" : "上拉加载更多"
there.where.page = there.where.page + 1
there.list.push.apply(there.list, res.data.list)
there.count = res.data.count
},
err => {
uni.showToast({
title: err.msg || err.response.data.msg|| err.response.data.message,
icon: "none",
duration: 2000
});
},
300
);
})
}
)
}
}
};