分销新增上级用户修改
parent
2296513a44
commit
54a90d002f
8
App.vue
8
App.vue
|
|
@ -6,13 +6,13 @@
|
|||
// 基础配置
|
||||
// 数据接口请求地址
|
||||
// request_url: 'https://new.shopxo.vip/',
|
||||
request_url: 'https://d1.shopxo.vip/',
|
||||
// request_url: 'http://shopxo.com/',
|
||||
// request_url: 'https://d1.shopxo.vip/',
|
||||
request_url: 'http://shopxo.com/',
|
||||
|
||||
// 静态资源地址(如系统根目录不在public目录下面请在静态地址后面加public目录、如:https://d1.shopxo.vip/public/)
|
||||
// static_url: 'https://new.shopxo.vip/',
|
||||
static_url: 'https://d1.shopxo.vip/',
|
||||
// static_url: 'http://shopxo.com/',
|
||||
// static_url: 'https://d1.shopxo.vip/',
|
||||
static_url: 'http://shopxo.com/',
|
||||
|
||||
// 系统类型(默认default、如额外独立小程序、可与程序分身插件实现不同主体小程序及支付独立)
|
||||
system_type: 'default',
|
||||
|
|
|
|||
|
|
@ -314,6 +314,20 @@ button:before {
|
|||
padding: 40rpx 90rpx;
|
||||
background-color: #fff;
|
||||
box-shadow: inset 0px 1px 3px 0px rgba(0, 0, 0, 0.08);
|
||||
}
|
||||
|
||||
/**
|
||||
* 底部右侧浮动+号
|
||||
*/
|
||||
.buttom-right-submit {
|
||||
position: fixed;
|
||||
bottom: 50rpx;
|
||||
right: 50rpx;
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
line-height: 86rpx;
|
||||
box-shadow: 0 0 10px 2px #c4c4c4;
|
||||
font-size: 76rpx;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
<template>
|
||||
<view :class="theme_view">
|
||||
<view class="search-content pr">
|
||||
<view :class="'search-content pr '+propSize">
|
||||
<view class="search-icon dis-inline-block pa" @tap="search_icon_event">
|
||||
<iconfont :name="propIcon" :color="propIconColor" size="24rpx"></iconfont>
|
||||
</view>
|
||||
<input
|
||||
type="text"
|
||||
confirm-type="search"
|
||||
:class="'round wh-auto dis-block '+propClass"
|
||||
:class="'input round wh-auto dis-block '+propClass"
|
||||
:placeholder="propPlaceholder"
|
||||
:placeholder-class="propPlaceholderClass"
|
||||
:value="propDefaultValue"
|
||||
|
|
@ -103,6 +103,10 @@
|
|||
propIsBtn: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
propSize: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
},
|
||||
// 属性值改变监听
|
||||
|
|
@ -183,7 +187,7 @@
|
|||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
<style scoped>
|
||||
.search-content .search-icon {
|
||||
z-index: 1;
|
||||
left: 0;
|
||||
|
|
@ -192,15 +196,13 @@
|
|||
line-height: 28rpx;
|
||||
height: 42rpx;
|
||||
}
|
||||
|
||||
.search-content input {
|
||||
font-size: 24rpx;
|
||||
.search-content .input {
|
||||
box-sizing: border-box;
|
||||
font-size: 24rpx;
|
||||
padding: 0 32rpx 0 64rpx;
|
||||
box-sizing: border-box;
|
||||
height: 56rpx;
|
||||
line-height: 56rpx;
|
||||
}
|
||||
|
||||
.search-content .search-btn {
|
||||
width: 106rpx;
|
||||
height: 46rpx;
|
||||
|
|
@ -213,5 +215,17 @@
|
|||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.search-content.md .search-icon {
|
||||
padding-top: 20rpx;
|
||||
}
|
||||
.search-content.md .input {
|
||||
height: 66rpx;
|
||||
line-height: 66rpx;
|
||||
}
|
||||
.search-content.md .search-btn {
|
||||
height: 56rpx;
|
||||
line-height: 56rpx;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -551,14 +551,14 @@
|
|||
"path": "visit-list/visit-list",
|
||||
"style": {
|
||||
"enablePullDownRefresh": true,
|
||||
"navigationBarTitleText": "拜访客户"
|
||||
"navigationBarTitleText": "客户拜访"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "visit-form/visit-form",
|
||||
"style": {
|
||||
"enablePullDownRefresh": true,
|
||||
"navigationBarTitleText": "新增拜访客户"
|
||||
"navigationBarTitleText": "客户拜访新增/编辑"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
|
|||
|
|
@ -286,6 +286,7 @@
|
|||
if (res.data.code == 0) {
|
||||
app.globalData.showToast(res.data.msg, 'success');
|
||||
setTimeout(function () {
|
||||
uni.$emit('refresh');
|
||||
uni.navigateBack();
|
||||
}, 1000);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -1,10 +0,0 @@
|
|||
.add-submit {
|
||||
position: fixed;
|
||||
bottom: 50rpx;
|
||||
right: 50rpx;
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
line-height: 86rpx;
|
||||
box-shadow: 0 0 10px 2px #c4c4c4;
|
||||
font-size: 76rpx;
|
||||
}
|
||||
|
|
@ -38,7 +38,7 @@
|
|||
|
||||
<!-- 新增入口 -->
|
||||
<navigator url="/pages/plugins/distribution/recommend-form/recommend-form" hover-class="none">
|
||||
<view class="add-submit bg-main cr-white round tc">+</view>
|
||||
<view class="buttom-right-submit bg-main cr-white round tc">+</view>
|
||||
</navigator>
|
||||
|
||||
<!-- 分享弹窗 -->
|
||||
|
|
@ -79,11 +79,25 @@ export default {
|
|||
componentBottomLine,
|
||||
componentSharePopup,
|
||||
},
|
||||
props: {},
|
||||
props: {},
|
||||
|
||||
onLoad(params) {
|
||||
this.setData({
|
||||
params: params,
|
||||
});
|
||||
|
||||
// 初始数据
|
||||
this.init();
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 数据加载
|
||||
this.init();
|
||||
onShow() {
|
||||
// 先解绑自定义事件
|
||||
uni.$off('refresh');
|
||||
// 监听自定义事件并进行页面刷新操作
|
||||
uni.$on('refresh', (data) => {
|
||||
// 重新请求数据
|
||||
this.init();
|
||||
});
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
|
|
@ -105,8 +119,11 @@ export default {
|
|||
});
|
||||
return false;
|
||||
} else {
|
||||
// 获取数据
|
||||
this.get_data_list();
|
||||
// 获取数据
|
||||
this.setData({
|
||||
data_page: 1,
|
||||
});
|
||||
this.get_data_list(1);
|
||||
}
|
||||
} else {
|
||||
this.setData({
|
||||
|
|
@ -135,11 +152,6 @@ export default {
|
|||
data_list_loding_status: 1,
|
||||
});
|
||||
|
||||
// 加载loding
|
||||
uni.showLoading({
|
||||
title: "加载中...",
|
||||
});
|
||||
|
||||
// 参数
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("index", "recommend", "distribution"),
|
||||
|
|
@ -150,7 +162,6 @@ export default {
|
|||
},
|
||||
dataType: "json",
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
if (res.data.data.data.length > 0) {
|
||||
|
|
@ -195,7 +206,6 @@ export default {
|
|||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
|
|
@ -289,5 +299,4 @@ export default {
|
|||
};
|
||||
</script>
|
||||
<style>
|
||||
@import "./recommend-list.css";
|
||||
</style>
|
||||
</style>
|
||||
|
|
@ -104,4 +104,15 @@
|
|||
.promotion-btn {
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户上级
|
||||
*/
|
||||
.user-search .custom-info {
|
||||
height: 58rpx;
|
||||
}
|
||||
.user-search .custom-info .custom-avatar {
|
||||
width: 50rpx;
|
||||
height: 50rpx;
|
||||
}
|
||||
|
|
@ -43,12 +43,15 @@
|
|||
</view>
|
||||
|
||||
<!-- 上级用户 -->
|
||||
<view v-if="(superior || null) != null" class="superior">
|
||||
<view v-if="(data_base.is_show_superior || 0) == 1 && ((superior || null) != null || (data_base.is_modify_superior || 0) == 1)" class="superior">
|
||||
<view class="superior-item flex-row jc-sb align-c oh border-radius-top-main">
|
||||
<view class="superior-title cr-white fw-b va-m text-size">上级用户</view>
|
||||
<view class="superior-content">
|
||||
<image :src="superior.avatar" mode="widthFix" class="circle va-m"></image>
|
||||
<text class="cr-white va-m margin-left-sm text-size-xs">{{ superior.user_name_view }}</text>
|
||||
<view class="superior-title cr-white fw-b va-m text-size-sm">上级用户</view>
|
||||
<view class="superior-content">
|
||||
<block v-if="(data_base.is_show_superior || 0) == 1 && (superior || null) != null">
|
||||
<image :src="superior.avatar" mode="widthFix" class="circle va-m"></image>
|
||||
<text class="cr-white va-m margin-left-sm text-size-xs">{{ superior.user_name_view }}</text>
|
||||
</block>
|
||||
<text v-if="(data_base.is_modify_superior || 0) == 1" class="cr-white text-size-xs br round padding-horizontal-main padding-top-xs padding-bottom-xs margin-left" @tap="modify_superior_open_event">修改</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -124,7 +127,7 @@
|
|||
</view>
|
||||
|
||||
<!-- 导航 -->
|
||||
<view v-if="nav_list.length > 0" class="nav oh flex-row flex-warp padding-sm" :class="(profit_ladder || null) != null ? 'padding-bottom-main' : 'nav-bottom'">
|
||||
<view v-if="nav_list.length > 0" class="nav oh flex-row flex-warp padding-sm" :class="(profit_ladder || null) != null ? 'nav-bottom' : 'padding-bottom-main'">
|
||||
<block v-for="(item, index) in nav_list" :key="index">
|
||||
<view class="flex-width-half">
|
||||
<view class="item bg-white border-radius-main margin-sm">
|
||||
|
|
@ -192,6 +195,57 @@
|
|||
</form>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
|
||||
<!-- 修改上级用户弹窗 -->
|
||||
<component-popup :propShow="modify_superior_popup_status" propPosition="bottom" @onclose="modify_superior_close_event">
|
||||
<view class="padding-horizontal-main padding-top-main bg-white">
|
||||
<view class="close oh">
|
||||
<view class="tr" @tap.stop="modify_superior_close_event">
|
||||
<iconfont name="icon-huiyuan-guanbi" size="28rpx" color="#999"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
<view class="popup-time-container page-bottom-fixed">
|
||||
<view class="form-container">
|
||||
<view class="form-gorup margin-top-xl">
|
||||
<view class="user-search">
|
||||
<component-search
|
||||
@onsearch="modify_superior_search_submit_event"
|
||||
:propIsOnEvent="true"
|
||||
:propIsRequired="false"
|
||||
propPlaceholder="输入用户ID/名/昵称/会员码/手机/邮箱"
|
||||
propClass="br"
|
||||
propSize="md"
|
||||
:propIsBtn="true"
|
||||
:propDefaultValue="modify_superior_search_input_keywords_value"
|
||||
<!-- #ifdef MP || APP -->
|
||||
propIcon="icon-mendian-sousuosm"
|
||||
propIconColor="#333"
|
||||
@onicon="modify_superior_search_icon_event"
|
||||
:propIsIconOnEvent="true"
|
||||
<!-- #endif -->
|
||||
></component-search>
|
||||
<view class="custom-info margin-top-lg">
|
||||
<block v-if="(modify_superior_user_data || null) != null">
|
||||
<block v-if="(modify_superior_user_data.data || null) != null">
|
||||
<image class="custom-avatar circle br va-m" :src="modify_superior_user_data.data.avatar" mode="aspectFill"></image>
|
||||
<text class="va-m margin-left-sm">{{modify_superior_user_data.data.user_name_view}}</text>
|
||||
<text class="cr-grey fr">{{modify_superior_user_data.data.add_time_text}}</text>
|
||||
</block>
|
||||
<view v-else class="cr-red">{{modify_superior_user_data.error_msg}}</view>
|
||||
</block>
|
||||
<view v-else class="cr-grey">请先输入用户信息搜索!</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottom-fixed br-0">
|
||||
<view class="bottom-line-exclude">
|
||||
<button type="default" class="bg-main br-main cr-white round text-size" :disabled="form_submit_disabled_status" @tap="modify_superior_submit_event">提交</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -207,7 +261,8 @@
|
|||
const app = getApp();
|
||||
import componentNavBack from '@/components/nav-back/nav-back';
|
||||
import componentNoData from '../../../../components/no-data/no-data';
|
||||
import componentPopup from '../../../../components/popup/popup';
|
||||
import componentPopup from '../../../../components/popup/popup';
|
||||
import componentSearch from '../../../../components/search/search';
|
||||
var currency_symbol = app.globalData.currency_symbol();
|
||||
var distribution_static_url = app.globalData.get_static_url('distribution', true) + 'app/';
|
||||
export default {
|
||||
|
|
@ -238,14 +293,18 @@
|
|||
popup_time_status: false,
|
||||
form_submit_disabled_status: false,
|
||||
popup_time_value: { name: '自定义', start: '', end: '', index: '' },
|
||||
quit_time_checked_name: '',
|
||||
quit_time_checked_name: '',
|
||||
modify_superior_popup_status: false,
|
||||
modify_superior_search_input_keywords_value: '',
|
||||
modify_superior_user_data: null
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentNavBack,
|
||||
componentNoData,
|
||||
componentPopup,
|
||||
componentPopup,
|
||||
componentSearch
|
||||
},
|
||||
props: {},
|
||||
|
||||
|
|
@ -464,6 +523,125 @@
|
|||
app.globalData.showToast('网络开小差了哦~');
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 上级用户修改事件 - 打开
|
||||
modify_superior_open_event(e) {
|
||||
this.setData({
|
||||
modify_superior_popup_status: true
|
||||
});
|
||||
},
|
||||
|
||||
// 上级用户修改事件 - 关闭
|
||||
modify_superior_close_event(e) {
|
||||
this.setData({
|
||||
modify_superior_popup_status: false
|
||||
});
|
||||
},
|
||||
|
||||
// 上级用户修改 - 搜索关键字事件
|
||||
modify_superior_search_input_keywords_event(e) {
|
||||
this.setData({
|
||||
modify_superior_search_input_keywords_value: e.detail.value,
|
||||
});
|
||||
},
|
||||
|
||||
// 上级用户修改 - 搜索确认事件
|
||||
modify_superior_search_submit_event(e) {
|
||||
this.setData({
|
||||
modify_superior_search_input_keywords_value: e
|
||||
});
|
||||
this.modify_superior_search_user();
|
||||
},
|
||||
|
||||
// 上级用户修改 - icon事件
|
||||
modify_superior_search_icon_event(e) {
|
||||
var self = this;
|
||||
uni.scanCode({
|
||||
success: function (res) {
|
||||
self.setData({
|
||||
modify_superior_search_input_keywords_value: res.result
|
||||
});
|
||||
self.modify_superior_search_user();
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 上级用户修改 - 搜索用户
|
||||
modify_superior_search_user() {
|
||||
uni.showLoading({
|
||||
title: '搜索中...',
|
||||
mask: true
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("userquery", "user", "distribution"),
|
||||
method: "POST",
|
||||
data: {keywords: this.modify_superior_search_input_keywords_value},
|
||||
dataType: "json",
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
this.setData({
|
||||
modify_superior_user_data: {
|
||||
data: res.data.data
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
modify_superior_user_data: {
|
||||
error_msg: res.data.msg
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
app.globalData.showToast("网络开小差了哦~");
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 上级用户修改 - 提交
|
||||
modify_superior_submit_event(e) {
|
||||
if((this.modify_superior_user_data || null) == null || (this.modify_superior_user_data.data || null) == null) {
|
||||
app.globalData.showToast('请先搜索用户');
|
||||
return false;
|
||||
}
|
||||
this.setData({
|
||||
form_submit_disabled_status: true
|
||||
});
|
||||
uni.showLoading({
|
||||
title: '处理中...',
|
||||
mask: true
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("superiorsave", "user", "distribution"),
|
||||
method: "POST",
|
||||
data: {superior_id: this.modify_superior_user_data.data.id},
|
||||
dataType: "json",
|
||||
success: (res) => {
|
||||
this.setData({
|
||||
form_submit_disabled_status: false
|
||||
});
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
this.setData({
|
||||
modify_superior_popup_status: false,
|
||||
superior: res.data.data,
|
||||
});
|
||||
app.globalData.showToast(res.data.msg, 'success');
|
||||
} else {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
this.setData({
|
||||
form_submit_disabled_status: false
|
||||
});
|
||||
uni.hideLoading();
|
||||
app.globalData.showToast("网络开小差了哦~");
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 页面滚动监听
|
||||
|
|
|
|||
|
|
@ -8,8 +8,9 @@
|
|||
@onsearch="search_submit_event"
|
||||
:propIsOnEvent="true"
|
||||
:propIsRequired="false"
|
||||
propPlaceholder="输入用户名/昵称/会员码/手机/邮箱"
|
||||
propPlaceholder="输入用户ID/名/昵称/会员码/手机/邮箱"
|
||||
propClass="br"
|
||||
propSize="md"
|
||||
:propIsBtn="true"
|
||||
:propDefaultValue="search_input_keywords_value"
|
||||
<!-- #ifdef MP || APP -->
|
||||
|
|
@ -34,11 +35,11 @@
|
|||
|
||||
<view class="form-gorup bg-white border-radius-main margin-top-main">
|
||||
<view class="form-gorup-title">拜访内容<text class="form-group-tips-must">*</text></view>
|
||||
<textarea class="cr-base" name="content" maxlength="230" auto-height placeholder-class="cr-grey-9" placeholder="拜访内容,最多230个字符"></textarea>
|
||||
<textarea class="cr-base" name="content" maxlength="230" auto-height placeholder-class="cr-grey-9" placeholder="拜访内容,最多230个字符" :value="data.content || ''"></textarea>
|
||||
</view>
|
||||
|
||||
<view class="form-gorup form-container-upload oh border-radius-main margin-top-main">
|
||||
<view class="form-gorup-title">上传照片<text class="form-group-tips-must">*</text><text class="form-group-tips">最多上传{{form_images_max_count}}张</text></view>
|
||||
<view class="form-gorup-title">拜访照片<text class="form-group-tips-must">*</text><text class="form-group-tips">最多上传{{form_images_max_count}}张</text></view>
|
||||
<view class="form-upload-data oh">
|
||||
<block v-if="form_images_list.length > 0">
|
||||
<view v-for="(item, index) in form_images_list" :key="index" class="item fl">
|
||||
|
|
@ -78,10 +79,11 @@ export default {
|
|||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
params: null,
|
||||
search_input_keywords_value: "",
|
||||
search_input_keywords_value: '',
|
||||
data: {},
|
||||
form_images_list: [],
|
||||
form_images_max_count: 30,
|
||||
editor_path_type: "",
|
||||
editor_path_type: '',
|
||||
form_submit_disabled_status: false,
|
||||
custom_data: null,
|
||||
};
|
||||
|
|
@ -138,10 +140,13 @@ export default {
|
|||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
var result = res.data.data;
|
||||
var data = result.data || {};
|
||||
this.setData({
|
||||
data: data.data,
|
||||
editor_path_type: data.editor_path_type || "",
|
||||
data: data,
|
||||
form_images_list: data.images || [],
|
||||
custom_data: {data: data.custom_user || null},
|
||||
editor_path_type: result.editor_path_type || '',
|
||||
data_list_loding_status: 3,
|
||||
data_list_loding_msg: '',
|
||||
});
|
||||
|
|
@ -171,12 +176,16 @@ export default {
|
|||
var form_data = e.detail.value;
|
||||
form_data['custom_user_id'] = ((this.custom_data || null) != null && (this.custom_data.data || null) != null) ? this.custom_data.data.id : 0;
|
||||
form_data['images'] = this.form_images_list;
|
||||
// 是否编辑
|
||||
if((this.data || null) != null) {
|
||||
form_data['id'] = this.data.id || 0;
|
||||
}
|
||||
|
||||
// 数据校验
|
||||
var validation = [
|
||||
{ fields: 'custom_user_id', msg: '请选择客户' },
|
||||
{ fields: 'content', msg: '请填写拜访内容' },
|
||||
{ fields: 'images', msg: '请上传拜访图片' },
|
||||
{ fields: 'images', msg: '请上传拜访照片' },
|
||||
];
|
||||
|
||||
// 验证提交表单
|
||||
|
|
@ -197,6 +206,7 @@ export default {
|
|||
if (res.data.code == 0) {
|
||||
app.globalData.showToast(res.data.msg, 'success');
|
||||
setTimeout(function () {
|
||||
uni.$emit('refresh');
|
||||
uni.navigateBack();
|
||||
}, 1000);
|
||||
} else {
|
||||
|
|
@ -256,7 +266,7 @@ export default {
|
|||
mask: true
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("userquery", "visit", "distribution"),
|
||||
url: app.globalData.get_request_url("userquery", "user", "distribution"),
|
||||
method: "POST",
|
||||
data: {keywords: this.search_input_keywords_value},
|
||||
dataType: "json",
|
||||
|
|
|
|||
|
|
@ -0,0 +1,5 @@
|
|||
.data-list .base .custom-avatar,
|
||||
.data-list .content .item-images {
|
||||
width: 50rpx;
|
||||
height: 50rpx;
|
||||
}
|
||||
|
|
@ -1,8 +1,294 @@
|
|||
<template>
|
||||
</template>
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<!-- 列表 -->
|
||||
<scroll-view :scroll-y="true" class="scroll-box" @scrolltolower="scroll_lower" lower-threshold="60">
|
||||
<view v-if="data_list.length > 0" class="data-list padding-horizontal-main padding-top-main">
|
||||
<view v-for="(item, index) in data_list" :key="index" class="item padding-main border-radius-main oh bg-white spacing-mb">
|
||||
<view class="base oh br-b padding-bottom-main">
|
||||
<view class="custom-info dis-inline-block">
|
||||
<image class="custom-avatar circle br va-m" :src="item.custom_user.avatar" mode="aspectFill"></image>
|
||||
<text class="va-m margin-left-sm">{{item.custom_user.user_name_view}}</text>
|
||||
</view>
|
||||
<text class="fr cr-base margin-top-xs">{{item.add_time}}</text>
|
||||
</view>
|
||||
<view class="content margin-top">
|
||||
<block v-for="(fv, fi) in content_list" :key="fi">
|
||||
<view v-if="(item[fv.field] || null) != null" class="single-text margin-top-sm">
|
||||
<text class="cr-grey margin-right-xl va-m">{{ fv.name }}</text>
|
||||
<block v-if="fv.field == 'images'">
|
||||
<block v-for="(iv, ix) in item[fv.field]" :key="ix">
|
||||
<image :class="'item-images va-m br radius '+(ix > 0 ? 'margin-left-sm' : '')" :src="iv" mode="aspectFill" :data-index="index" :data-ix="ix" @tap="images_event"></image>
|
||||
</block>
|
||||
</block>
|
||||
<text v-else class="cr-base">{{ item[fv.field] }}</text>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<view class="item-operation tr br-t padding-top-main margin-top-main">
|
||||
<button type="default" size="mini" class="bg-white br-green cr-green text-size-xs round" :data-value="'/pages/plugins/distribution/visit-form/visit-form?id='+item.id" @tap="url_event">编辑</button>
|
||||
<button type="default" size="mini" class="bg-white br-red cr-red text-size-xs round margin-left-main" :data-index="index" @tap="delete_event">删除</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status"></component-no-data>
|
||||
</view>
|
||||
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</scroll-view>
|
||||
|
||||
<script>
|
||||
</script>
|
||||
<!-- 新增入口 -->
|
||||
<navigator url="/pages/plugins/distribution/visit-form/visit-form" hover-class="none">
|
||||
<view class="buttom-right-submit bg-main cr-white round tc">+</view>
|
||||
</navigator>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentNoData from "../../../../components/no-data/no-data";
|
||||
import componentBottomLine from "../../../../components/bottom-line/bottom-line";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
data_list: [],
|
||||
data_total: 0,
|
||||
data_page_total: 0,
|
||||
data_page: 1,
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false,
|
||||
data_is_loading: 0,
|
||||
params: null,
|
||||
content_list: [
|
||||
{ name: "拜访描述", field: "content" },
|
||||
{ name: "拜访图片", field: "images"},
|
||||
{ name: "更新时间", field: "upd_time" },
|
||||
],
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
},
|
||||
props: {},
|
||||
|
||||
onLoad(params) {
|
||||
this.setData({
|
||||
params: params,
|
||||
});
|
||||
|
||||
// 初始数据
|
||||
this.init();
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 先解绑自定义事件
|
||||
uni.$off('refresh');
|
||||
// 监听自定义事件并进行页面刷新操作
|
||||
uni.$on('refresh', (data) => {
|
||||
// 重新请求数据
|
||||
this.init();
|
||||
});
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle();
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.setData({
|
||||
data_page: 1,
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
methods: {
|
||||
init() {
|
||||
var user = app.globalData.get_user_info(this, "init");
|
||||
if (user != false) {
|
||||
// 用户未绑定手机则转到登录页面
|
||||
if (app.globalData.user_is_need_login(user)) {
|
||||
uni.redirectTo({
|
||||
url: "/pages/login/login?event_callback=init",
|
||||
});
|
||||
return false;
|
||||
} else {
|
||||
// 获取数据
|
||||
this.setData({
|
||||
data_page: 1,
|
||||
});
|
||||
this.get_data_list(1);
|
||||
}
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_bottom_line_status: false,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data_list(is_mandatory) {
|
||||
// 分页是否还有数据
|
||||
if ((is_mandatory || 0) == 0) {
|
||||
if (this.data_bottom_line_status == true) {
|
||||
uni.stopPullDownRefresh();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// 是否加载中
|
||||
if (this.data_is_loading == 1) {
|
||||
return false;
|
||||
}
|
||||
this.setData({
|
||||
data_is_loading: 1,
|
||||
data_list_loding_status: 1,
|
||||
});
|
||||
|
||||
// 获取数据
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("index", "visit", "distribution"),
|
||||
method: "POST",
|
||||
data: {
|
||||
page: this.data_page
|
||||
},
|
||||
dataType: "json",
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
if (res.data.data.data.length > 0) {
|
||||
if (this.data_page <= 1) {
|
||||
var temp_data_list = res.data.data.data;
|
||||
} else {
|
||||
var temp_data_list = this.data_list || [];
|
||||
var temp_data = res.data.data.data;
|
||||
for (var i in temp_data) {
|
||||
temp_data_list.push(temp_data[i]);
|
||||
}
|
||||
}
|
||||
this.setData({
|
||||
data_list: temp_data_list,
|
||||
data_total: res.data.data.total,
|
||||
data_page_total: res.data.data.page_total,
|
||||
data_list_loding_status: 3,
|
||||
data_page: this.data_page + 1,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
|
||||
// 是否还有数据
|
||||
this.setData({
|
||||
data_bottom_line_status: this.data_page > 1 && this.data_page > this.data_page_total,
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_list: [],
|
||||
data_bottom_line_status: false,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
if (app.globalData.is_login_check(res.data, this, "get_data_list")) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
app.globalData.showToast("网络开小差了哦~");
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 滚动加载
|
||||
scroll_lower(e) {
|
||||
this.get_data_list();
|
||||
},
|
||||
|
||||
// 图片预览
|
||||
images_event(e) {
|
||||
var index = e.currentTarget.dataset.index;
|
||||
var ix = e.currentTarget.dataset.ix;
|
||||
uni.previewImage({
|
||||
current: this.data_list[index]['images'][ix],
|
||||
urls: this.data_list[index]['images'],
|
||||
});
|
||||
},
|
||||
|
||||
// url事件
|
||||
url_event(e) {
|
||||
app.globalData.url_event(e);
|
||||
},
|
||||
|
||||
// 删除事件
|
||||
delete_event(e) {
|
||||
var index = e.currentTarget.dataset.index || 0;
|
||||
var temp_data = this.data_list;
|
||||
var data = temp_data[index] || null;
|
||||
if (data == null) {
|
||||
app.globalData.showToast("数据有误");
|
||||
return false;
|
||||
}
|
||||
uni.showModal({
|
||||
title: "温馨提示",
|
||||
content: "删除后不可恢复,确定继续吗?",
|
||||
confirmText: "确认",
|
||||
cancelText: "不了",
|
||||
success: (result) => {
|
||||
if (result.confirm) {
|
||||
uni.showLoading({
|
||||
title: "处理中...",
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("delete", "visit", "distribution"),
|
||||
method: "POST",
|
||||
data: { ids: data.id },
|
||||
dataType: "json",
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
temp_data.splice(index, 1);
|
||||
this.setData({
|
||||
data_list: temp_data
|
||||
});
|
||||
|
||||
// 是否还存在数据
|
||||
if(temp_data.length == 0) {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_bottom_line_status: false
|
||||
});
|
||||
}
|
||||
app.globalData.showToast(res.data.msg, "success");
|
||||
} else {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
app.globalData.showToast("网络开小差了哦~");
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import "./visit-list.css";
|
||||
</style>
|
||||
|
|
@ -237,7 +237,7 @@
|
|||
},
|
||||
{
|
||||
name: '退款/售后',
|
||||
status: 4,
|
||||
status: 101,
|
||||
count: 0,
|
||||
url: '/pages/user-orderaftersale/user-orderaftersale',
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue