添加:兑换站点支持默认选中某个站点及某人操作员
This commit is contained in:
parent
2b44f238c7
commit
f209bed2c3
|
|
@ -6,15 +6,17 @@
|
|||
<view class="top">
|
||||
<view class="left">
|
||||
<view class="name">提货点:{{ point_info.title || '请选择提货点' }}</view>
|
||||
<view class="change-btn" @click="showPointPopup">{{ point_info.id > 0 ? '选择' : '切换' }}</view>
|
||||
<view v-if="point_search.default_point_id <= 0" class="change-btn" @click="showPointPopup">
|
||||
{{ point_info.id > 0 ? '切换' : '选择' }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="right" @click="goMenuPage('/pages/users/online_payment/exchange/record')">兑换记录</view>
|
||||
</view>
|
||||
<view class="top" v-if="point_info.id > 0">
|
||||
<view class="left">
|
||||
<view class="name">操作员:{{ (staff_info.nickname || staff_info.real_name || staff_info.uid) || '请选择操作员' }}</view>
|
||||
<view class="change-btn" @click="showStaffPopup" v-if="Object.values(staff_list).length > 1">
|
||||
{{ staff_info.uid > 0 ? '选择' : '切换' }}
|
||||
<view class="change-btn" @click="showStaffPopup" v-if="Object.values(staff_list).length > 1 && default_staff_id <= 0">
|
||||
{{ staff_info.uid > 0 ? '切换' : '选择' }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -105,6 +107,7 @@ import {mapGetters} from "vuex";
|
|||
import authorize from '@/components/Authorize';
|
||||
import emptyPage from '@/components/emptyPage.vue';
|
||||
import spread from "@/libs/spread";
|
||||
import util from "../../../../utils/util";
|
||||
|
||||
const app = getApp();
|
||||
export default {
|
||||
|
|
@ -124,10 +127,12 @@ export default {
|
|||
point_search: {
|
||||
address: '',
|
||||
uid: '',
|
||||
default_point_id: 0,
|
||||
},
|
||||
// 操作员
|
||||
staff_info:{},
|
||||
staff_info: {},
|
||||
staff_list: {},
|
||||
default_staff_id: 0,
|
||||
// 提交信息
|
||||
pay_info: {
|
||||
total_money: 0.00,
|
||||
|
|
@ -142,6 +147,11 @@ export default {
|
|||
...mapGetters(['isLogin', 'userInfo', 'viewColor'])
|
||||
},
|
||||
onLoad(options) {
|
||||
if(options.scene){
|
||||
var scene = this.$util.getUrlParams(decodeURIComponent(options.scene));
|
||||
this.point_search.default_point_id = scene.point_id || 0;
|
||||
this.default_staff_id = scene.staff_uid || 0;
|
||||
}
|
||||
// 判断:是否登录
|
||||
if (!this.isLogin) {
|
||||
// 未登录 授权登录
|
||||
|
|
@ -219,8 +229,9 @@ export default {
|
|||
},
|
||||
// 提货点选择 - 显示弹框
|
||||
showPointPopup(){
|
||||
this.$refs.selectedPoint.open('center');
|
||||
if(Object.keys(this.point_list).length <= 0) this.getPointList();
|
||||
// 不存在默认选中 显示弹框
|
||||
if(Number(this.point_search.default_point_id) <= 0) this.$refs.selectedPoint.open('center');
|
||||
},
|
||||
// 提货点选择 - 隐藏弹框
|
||||
pointClosePopup(){
|
||||
|
|
@ -232,6 +243,9 @@ export default {
|
|||
pointList(this.point_search)
|
||||
.then(res => {
|
||||
_this.point_list = res.data || {};
|
||||
if(_this.point_search.default_point_id > 0){
|
||||
_this.selectedPoint(_this.point_list[0]);
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
this.$util.Tips({
|
||||
|
|
@ -246,7 +260,10 @@ export default {
|
|||
this.point_info = item;
|
||||
this.pointClosePopup();
|
||||
// 判断:是否需要选择操作员
|
||||
if(Object.values(this.staff_list).length > 1){
|
||||
if(Number(this.default_staff_id) > 0){
|
||||
// 存在默认 默认选中
|
||||
this.staff_info = item.user_list[this.default_staff_id];
|
||||
}else if(Object.values(this.staff_list).length > 1){
|
||||
// 存在多个 需要选中
|
||||
this.showStaffPopup();
|
||||
}else{
|
||||
|
|
|
|||
Loading…
Reference in New Issue