添加:客户预支积分功能
This commit is contained in:
parent
4d7e9806f8
commit
a4e6c44506
|
|
@ -691,6 +691,10 @@ export function getCustomList(merId, data) {
|
|||
export function customIntegralChange(merId, data) {
|
||||
return request.post("custom/integral_change/"+merId, data);
|
||||
}
|
||||
// 客户管理 - 预支积分
|
||||
export function advanceExchangeIntegral( data) {
|
||||
return request.post("custom/advance_exchange_integral", data);
|
||||
}
|
||||
// 积分中心 - 获取商户积分记录
|
||||
export function getMerchantIntegral(data) {
|
||||
return request.post("user/integral/mer_list", data);
|
||||
|
|
|
|||
|
|
@ -18,10 +18,11 @@
|
|||
<view class="nickname">{{ item.nickname }}</view>
|
||||
<view class="custom-id">{{ item.uid }}</view>
|
||||
</view>
|
||||
<view class="info-bottom">积分:{{ item.merchant_integral }}</view>
|
||||
<view class="info-bottom">已预支积分:{{ item.advance_exchange_integral }}</view>
|
||||
</view>
|
||||
<view class="right-btn">
|
||||
<!--<view class="give-btn" @click="showIntegralChangePopup(item)">赠送积分</view>-->
|
||||
<view class="give-btn" v-if="Number(item.advance_exchange_integral) <= 0" @click="advanceIntegral(item)">预支积分</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -67,7 +68,8 @@
|
|||
<script>
|
||||
import avatar from "@/components/yq-avatar/yq-avatar.vue";
|
||||
import { HTTP_REQUEST_URL } from '@/config/app';
|
||||
import { getCustomList,customIntegralChange } from "@/api/user.js";
|
||||
import { getCustomList,customIntegralChange,advanceExchangeIntegral } from "@/api/user.js";
|
||||
|
||||
export default {
|
||||
name: 'custom',
|
||||
components: {
|
||||
|
|
@ -205,6 +207,39 @@ export default {
|
|||
console.log("错误 catch:",err);
|
||||
})
|
||||
},
|
||||
// 预支积分
|
||||
advanceIntegral(item){
|
||||
let _this = this;
|
||||
// 点击按钮触发弹框输入框的显示
|
||||
uni.showModal({
|
||||
title: '预支积分', // 弹框标题
|
||||
content: '',
|
||||
editable: true,//是否显示输入框
|
||||
placeholderText: '请输入预支积分数量',//输入框提示内容
|
||||
showCancel: true, // 是否显示取消按钮
|
||||
cancelText: '取消', // 取消按钮文字
|
||||
confirmText: '确定', // 确认按钮文字
|
||||
success: (res) => {
|
||||
if (res.confirm && Number(res.content) > 0) {
|
||||
let inputValue = Number(res.content);
|
||||
let params = {
|
||||
mer_id: _this.mer_id,
|
||||
integral: inputValue,
|
||||
uid: item.uid,
|
||||
};
|
||||
advanceExchangeIntegral(params).then(res => {
|
||||
this.$util.Tips({ title: res.message });
|
||||
// 刷新
|
||||
_this.getCustom(true);
|
||||
}).catch(err => {
|
||||
this.$util.Tips({title: err});
|
||||
});
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击了取消');
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
// 加载动画
|
||||
loadingModel(){
|
||||
uni.showLoading({
|
||||
|
|
|
|||
Loading…
Reference in New Issue