<template>
|
<view class="user-datail" :data-theme='theme()' :class="theme() || ''">
|
<view class="user-body p30 bg-white">
|
<view class="f28">
|
<view class="d-s-c p-20-0 border-b">
|
<view class="w160 mr10">操作类型</view>
|
<radio-group class="d-a-c" @change="changeRadio($event)">
|
<label class="d-s-c make-item ">
|
<view>
|
<radio style="transform:scale(0.7)" color="#ff6633" :checked="form.mode == 'inc'" :value="inc" />
|
</view>
|
<view class="color-57">增加积分</view>
|
</label>
|
<label class="d-s-c make-item ">
|
<view>
|
<radio style="transform:scale(0.7)" color="#ff6633" :checked="form.mode == 'dec'" :value="dec" />
|
</view>
|
<view class="color-57">减少积分</view>
|
</label>
|
</radio-group>
|
</view>
|
<view class="d-s-c p-20-0 border-b">
|
<view class="w160 mr10">变更数量</view>
|
<input type="number" class="make-item input-box" v-model="form.value" placeholder="请输入变更数量" />
|
</view>
|
<view class="d-s-c p-20-0 border-b">
|
<view class="w160 mr10">小票商家</view>
|
<view class="d-s-c flex-1" @tap="StoreUp">
|
<view class="flex-1">{{store_name}}</view>
|
<view class="icon iconfont icon-jiantou ml80 f-s-0"></view>
|
</view>
|
</view>
|
<view class="d-s-s p-20-0">
|
<view class="w160 mr10">备注</view>
|
<view class="flex-1"><textarea v-model="form.remark" placeholder="选填" class="text_area" /></view>
|
</view>
|
</view>
|
<view class="pt40"><button class="theme-btn send_btn" @click="onSubmit">确认</button></view>
|
<StoreList :showStore="showStore" @close="closeStoreFunc"></StoreList>
|
</view>
|
</view>
|
</template>
|
|
<script>
|
import Popup from '@/components/uni-popup.vue'
|
import utils from '@/common/utils.js';
|
import StoreList from './storelist.vue';
|
export default {
|
components: {
|
StoreList
|
},
|
data() {
|
return {
|
loading: true,
|
form: {
|
mode: 'inc',
|
store_id: 0,
|
shop_supplier_id: 0,
|
value: '',
|
remark: ''
|
},
|
store_name: '请选择',
|
showStore: false
|
};
|
},
|
props: ['user_id'],
|
onLoad(e) {
|
|
},
|
mounted() {
|
let self = this;
|
self.$fire.on('selectStoreId', function(e) {
|
self.store_name = e.store_name;
|
self.form.store_id = e.store_id;
|
self.form.shop_supplier_id = e.shop_supplier_id;
|
});
|
},
|
methods: {
|
/*获取数据*/
|
getData() {
|
let self = this;
|
uni.showLoading({
|
title: '加载中'
|
});
|
self._get(
|
'user.qrcode/detail', {
|
user_id: self.user_id
|
},
|
function(res) {
|
self.loading = false;
|
self.user = res.data.user;
|
|
// self.extractStore = res.data.order.extractStore;
|
uni.hideLoading();
|
},
|
function(res) {
|
uni.switchTab({
|
url:'/pages/index/index'
|
})
|
}
|
);
|
},
|
|
StoreUp() {
|
this.showStore = true;
|
},
|
|
closeStoreFunc(e) {
|
this.showStore = false;
|
console.log(e);
|
},
|
|
changeRadio(e) {
|
this.mode = e.detail.value;
|
},
|
|
/*核销*/
|
onSubmit() {
|
let self = this;
|
let params = self.form;
|
params.user_id = self.user_id;
|
params.source = 'points';
|
if (!params.value || params.value < 0) {
|
uni.showToast({
|
title: '请输入有效的积分数量',
|
duration: 2000,
|
icon:'none'
|
});
|
return;
|
}
|
if (params.store_id == 0) {
|
uni.showToast({
|
title: '请选择小票商家',
|
duration: 2000,
|
icon:'none'
|
});
|
return;
|
}
|
wx.showModal({
|
title: "提示",
|
content: "您确定要提交吗?",
|
success: function(o) {
|
o.confirm && self._post(
|
'user.qrcode/recharge', params,
|
function(res) {
|
uni.showToast({
|
title: res.msg,
|
duration: 2000,
|
icon: 'success',
|
});
|
setTimeout(function () {
|
self.gotoPage('/pages/index/index');
|
}, 2000);
|
}
|
);
|
}
|
});
|
},
|
}
|
};
|
</script>
|
|
<style lang="scss" scoped>
|
.user-header {
|
position: relative;
|
height: 100%;
|
@include background_color('background_color');
|
}
|
|
.user-header .user-info {
|
display: flex;
|
justify-content: flex-start;
|
align-items: center;
|
}
|
|
.user-header .photo,
|
.user-header .photo image {
|
width: 50rpx;
|
height: 50rpx;
|
border-radius: 50%;
|
}
|
|
.user-header .photo {
|
border: 2rpx solid #ffffff;
|
}
|
|
.user-header .info {
|
padding-left: 20rpx;
|
box-sizing: border-box;
|
overflow: hidden;
|
color: #FFFFFF;
|
}
|
|
.user-header .info .name {
|
font-size: 26rpx;
|
}
|
.w160 {
|
width: 160rpx;
|
}
|
.d-f-c {
|
display: flex;
|
justify-content: space-between;
|
align-items: center;
|
overflow: hidden;
|
}
|
.text_area{
|
width: 100%;
|
height: 80rpx;
|
box-sizing: border-box;
|
// font-size: 28rpx;
|
}
|
|
</style>
|