源文件

This commit is contained in:
gyq
2025-04-25 09:49:53 +08:00
commit 791d82b9e3
640 changed files with 130029 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
/*
* 三级联动
*/
.select-address {
box-sizing: border-box;
height: 70rpx;
line-height: 70rpx;
padding: 0 10rpx;
}
.select-address .section {
width: 33.33%;
box-sizing: border-box;
}
.select-address .section:not(:first-child) {
padding: 0 5rpx;
}

View File

@@ -0,0 +1,605 @@
<template>
<view :class="theme_view">
<view class="page-bottom-fixed">
<form @submit="form_submit" class="form-container">
<view class="padding-main oh border-radius-main">
<view class="form-gorup bg-white form-container-upload oh">
<view class="form-gorup-title">{{$t('extraction-apply.extraction-apply.u439pg')}}<text class="form-group-tips">{{$t('extraction-apply.extraction-apply.bflosr')}}</text></view>
<view class="form-upload-data oh">
<block v-if="(extraction_data.logo || null) != null">
<view class="item fl">
<text class="delete-icon" @tap="upload_delete_event">x</text>
<image :src="extraction_data.logo" @tap="upload_show_event" mode="aspectFill"></image>
</view>
</block>
<image class="item fl upload-icon" :src="common_static_url + 'upload-icon.png'" mode="aspectFill" @tap="file_upload_event"></image>
</view>
</view>
<view class="form-gorup bg-white">
<view class="form-gorup-title">{{$t('extraction-apply.extraction-apply.9t81k8')}}</view>
<input type="text" name="alias" :value="extraction_data.alias || ''" placeholder-class="cr-grey" class="cr-base" :placeholder="$t('extraction-apply.extraction-apply.wt1w0m')" />
</view>
<view class="form-gorup bg-white">
<view class="form-gorup-title">{{$t('user-detail.user-detail.k5867n')}}<text class="form-group-tips-must">*</text></view>
<input type="text" name="name" :value="extraction_data.name || ''" placeholder-class="cr-grey" class="cr-base" :placeholder="$t('extraction-apply.extraction-apply.73efnt')" />
</view>
<view class="form-gorup bg-white">
<view class="form-gorup-title">{{$t('user-detail.user-detail.gfe703')}}<text class="form-group-tips-must">*</text></view>
<input type="text" name="tel" :value="extraction_data.tel || ''" placeholder-class="cr-grey" class="cr-base" :placeholder="$t('extraction-apply.extraction-apply.qixk24')" />
</view>
<view class="form-gorup bg-white">
<view class="form-gorup-title">{{$t('extraction-apply.extraction-apply.cy87k6')}}<text class="form-group-tips-must">*</text></view>
<view class="select-address oh">
<view class="section fl">
<picker name="province" @change="select_province_event" :value="province_value" :range="province_list" range-key="name">
<view :class="'name ' + (province_value == null ? 'cr-grey' : 'cr-base')">{{ (province_list[province_value] || null) == null ? default_province : province_list[province_value]['name'] }}</view>
</picker>
</view>
<view class="section fl">
<picker v-if="(province_id || null) != null" name="city" @change="select_city_event" :value="city_value" :range="city_list" range-key="name">
<view :class="'name ' + (city_value == null ? 'cr-grey' : 'cr-base')">{{ (city_list[city_value] || null) == null ? default_city : city_list[city_value]['name'] }}</view>
</picker>
<text v-else class="cr-grey" @tap="region_select_error_event" :data-value="$t('extraction-apply.extraction-apply.liqbru')">{{$t('extraction-apply.extraction-apply.liqbru')}}</text>
</view>
<view class="section fl">
<picker v-if="(city_id || null) != null" name="county" @change="select_county_event" :value="county_value" :range="county_list" range-key="name">
<view :class="'name ' + (county_value == null ? 'cr-grey' : 'cr-base')">{{ (county_list[county_value] || null) == null ? default_county : county_list[county_value]['name'] }}</view>
</picker>
<text v-else class="cr-grey" @tap="region_select_error_event" :data-value="$t('extraction-apply.extraction-apply.r4q86m')">{{$t('extraction-apply.extraction-apply.r4q86m')}}</text>
</view>
</view>
</view>
<view class="form-gorup bg-white">
<view class="form-gorup-title">{{$t('personal.personal.6m33c4')}}<text class="form-group-tips-must">*</text></view>
<input type="text" name="address" :value="extraction_data.address || ''" placeholder-class="cr-grey" class="cr-base" :placeholder="$t('extraction-apply.extraction-apply.gxo73a')" />
</view>
<view class="form-gorup bg-white">
<view class="form-gorup-title">{{$t('extraction-apply.extraction-apply.47v7m0')}}<text class="form-group-tips-must">*</text></view>
<view @tap="choose_location_event" class="form-gorup-text">
<view v-if="(user_location.status || 0) == 1" class="cr-base">{{ user_location.lng }}, {{ user_location.lat }}</view>
<view v-else class="cr-grey">{{$t('extraction-apply.extraction-apply.8831v6')}}</view>
</view>
</view>
<view v-if="(extraction_data || null) != null && (extraction_data.status || 0) == 1" class="cr-red margin-top-sm spacing-mb">{{$t('extraction-apply.extraction-apply.5y2yzu')}}</view>
<view class="bottom-fixed" :style="bottom_fixed_style">
<view class="bottom-line-exclude">
<button class="item bg-main br-main cr-white round text-size" type="default" form-type="submit" hover-class="none" :disabled="form_submit_disabled_status">{{$t('form.form.4yd066')}}</button>
</view>
</view>
</view>
</form>
</view>
<!-- 位置选择 -->
<component-choice-location ref="choice_location" :propIsShowAddressChoice="false" @onBack="user_back_choice_location"></component-choice-location>
<!-- 公共 -->
<component-common ref="common"></component-common>
</view>
</template>
<script>
const app = getApp();
import componentCommon from '@/components/common/common';
import componentChoiceLocation from '@/components/choice-location/choice-location';
var common_static_url = app.globalData.get_static_url('common');
export default {
data() {
return {
theme_view: app.globalData.get_theme_value_view(),
common_static_url: common_static_url,
params: {},
data_list_loding_status: 1,
data_list_loding_msg: '',
bottom_fixed_style: '',
extraction_data: {},
province_list: [],
city_list: [],
county_list: [],
province_id: null,
city_id: null,
county_id: null,
editor_path_type: '',
default_province: this.$t('extraction-apply.extraction-apply.s3h5o3'),
default_city: this.$t('extraction-apply.extraction-apply.4s4s15'),
default_county: this.$t('extraction-apply.extraction-apply.fk4gw5'),
province_value: null,
city_value: null,
county_value: null,
user_location: {},
form_submit_disabled_status: false,
};
},
components: {
componentCommon,
componentChoiceLocation
},
onLoad(params) {
// 调用公共事件方法
app.globalData.page_event_onload_handle(params);
// 设置参数
this.setData({
params: params || {},
});
// 清除位置缓存信息
app.globalData.choice_user_location_remove();
// 初始数据
this.init();
},
onShow() {
// 调用公共事件方法
app.globalData.page_event_onshow_handle();
// 用户位置初始化
this.user_location_init();
// 公共onshow事件
if ((this.$refs.common || null) != null) {
this.$refs.common.on_show();
}
// 分享菜单处理
app.globalData.page_share_handle();
},
methods: {
init() {
var user = app.globalData.get_user_info(this, 'init');
if (user != false) {
this.get_province_list();
this.applyinfo_init();
} else {
this.setData({
data_list_loding_status: 2,
data_list_loding_msg: this.$t('extraction-apply.extraction-apply.m3xdif'),
});
}
},
// 自提点信息
applyinfo_init() {
var self = this;
uni.request({
url: app.globalData.get_request_url('applyinfo', 'extraction', 'distribution'),
method: 'POST',
data: {is_lang: 0},
dataType: 'json',
success: (res) => {
if (res.data.code == 0) {
var data = res.data.data;
var extraction_data = data.extraction_data || null;
self.setData({
extraction_data: extraction_data || {},
editor_path_type: data.editor_path_type || '',
});
// 数据设置
if (extraction_data != null) {
self.setData({
province_id: extraction_data.province || null,
city_id: extraction_data.city || null,
county_id: extraction_data.county || null,
});
// 地理位置
var lng = extraction_data.lng || 0;
var lat = extraction_data.lat || 0;
if (lng != 0 && lat != 0) {
self.setData({
user_location: {
lng: lng,
lat: lat,
address: extraction_data.address || '',
},
});
}
}
// 获取城市、区县
self.get_city_list();
self.get_county_list();
// 半秒后初始化数据
setTimeout(function () {
self.init_region_value();
}, 500);
} else {
if (app.globalData.is_login_check(res.data)) {
app.globalData.showToast(res.data.msg);
}
}
},
fail: () => {
app.globalData.showToast(this.$t('extraction-apply.extraction-apply.h8f437'));
},
});
},
// 地区数据初始化
init_region_value() {
this.setData({
province_value: this.get_region_value('province_list', 'province_id'),
city_value: this.get_region_value('city_list', 'city_id'),
county_value: this.get_region_value('county_list', 'county_id'),
});
},
// 地区初始化匹配索引
get_region_value(list, id) {
var data = this[list];
var data_id = this[id];
var value = null;
data.forEach((d, i) => {
if (d.id == data_id) {
value = i;
return false;
}
});
return value;
},
// 获取省份
get_province_list() {
var self = this;
uni.request({
url: app.globalData.get_request_url('index', 'region'),
method: 'POST',
data: {},
dataType: 'json',
success: (res) => {
if (res.data.code == 0) {
var data = res.data.data;
self.setData({
province_list: data,
});
} else {
app.globalData.showToast(res.data.msg);
}
},
fail: () => {
app.globalData.showToast(this.$t('extraction-apply.extraction-apply.fo7y6c'));
},
});
},
// 获取市
get_city_list() {
var self = this;
if (self.province_id) {
uni.request({
url: app.globalData.get_request_url('index', 'region'),
method: 'POST',
data: {
pid: self.province_id,
},
dataType: 'json',
success: (res) => {
if (res.data.code == 0) {
var data = res.data.data;
self.setData({
city_list: data,
});
} else {
app.globalData.showToast(res.data.msg);
}
},
fail: () => {
app.globalData.showToast(this.$t('extraction-apply.extraction-apply.b6qg7b'));
},
});
}
},
// 获取区/县
get_county_list() {
var self = this;
if (self.city_id) {
// 加载loding
uni.request({
url: app.globalData.get_request_url('index', 'region'),
method: 'POST',
data: {
pid: self.city_id,
},
dataType: 'json',
success: (res) => {
if (res.data.code == 0) {
var data = res.data.data;
self.setData({
county_list: data,
});
} else {
app.globalData.showToast(res.data.msg);
}
},
fail: () => {
app.globalData.showToast(this.$t('extraction-apply.extraction-apply.5s5734'));
},
});
}
},
// 省份事件
select_province_event(e) {
var index = e.detail.value || 0;
if (index >= 0) {
var data = this.province_list[index];
this.setData({
province_value: index,
province_id: data.id,
city_value: null,
county_value: null,
city_id: null,
county_id: null,
});
this.get_city_list();
}
},
// 市事件
select_city_event(e) {
var index = e.detail.value || 0;
if (index >= 0) {
var data = this.city_list[index];
this.setData({
city_value: index,
city_id: data.id,
county_value: null,
county_id: null,
});
this.get_county_list();
}
},
// 区/县事件
select_county_event(e) {
var index = e.detail.value || 0;
if (index >= 0) {
var data = this.county_list[index];
this.setData({
county_value: index,
county_id: data.id,
});
}
},
// 省市区未按照顺序选择提示
region_select_error_event(e) {
var value = e.currentTarget.dataset.value || null;
if (value != null) {
app.globalData.showToast(value);
}
},
// 选择地理位置
choose_location_event(e) {
if ((this.$refs.choice_location || null) != null) {
this.$refs.choice_location.choose_user_location();
}
},
// 选择用户地理位置回调
user_back_choice_location(e) {
this.setData({
user_location: e
});
},
// 地址信息初始化
user_location_init() {
this.setData({
user_location: app.globalData.choice_user_location_init()
});
},
// 数据提交
form_submit(e) {
var self = this;
// 表单数据
var form_data = e.detail.value;
// 数据校验
var validation = [
{ fields: 'name', msg: this.$t('extraction-apply.extraction-apply.q15b4n') },
{ fields: 'tel', msg: this.$t('extraction-apply.extraction-apply.3or25c') },
{ fields: 'province', msg: this.$t('extraction-apply.extraction-apply.m99d2g') },
{ fields: 'city', msg: this.$t('extraction-apply.extraction-apply.03587o') },
{ fields: 'county', msg: this.$t('extraction-apply.extraction-apply.pt8436') },
{ fields: 'address', msg: this.$t('extraction-apply.extraction-apply.v1g617') },
{ fields: 'lng', msg: this.$t('extraction-apply.extraction-apply.8831v6') },
{ fields: 'lat', msg: this.$t('extraction-apply.extraction-apply.8831v6') },
];
// logo
form_data['logo'] = (this.extraction_data || null) != null ? this.extraction_data.logo || '' : '';
// 地区
form_data['province'] = self.province_id;
form_data['city'] = self.city_id;
form_data['county'] = self.county_id;
// 地理位置
var lng = 0;
var lat = 0;
if ((self.user_location || null) != null) {
lng = self.user_location.lng || 0;
lat = self.user_location.lat || 0;
}
if ((self.extraction_data || null) != null) {
if ((lng || null) == null) {
lng = self.extraction_data.lng || 0;
}
if ((lat || null) == null) {
lat = self.extraction_data.lat || 0;
}
}
form_data['lng'] = lng;
form_data['lat'] = lat;
// 验证提交表单
if (app.globalData.fields_check(form_data, validation)) {
if ((self.extraction_data || null) != null && (self.extraction_data.status || 0) == 1) {
uni.showModal({
title: this.$t('common.warm_tips'),
content: this.$t('extraction-apply.extraction-apply.rm14pu'),
confirmText: this.$t('common.confirm'),
cancelText: this.$t('common.not_yet'),
success: (result) => {
if (result.confirm) {
self.request_data_save(form_data);
}
},
});
} else {
self.request_data_save(form_data);
}
}
},
// 数据保存
request_data_save(data) {
var self = this;
self.setData({
form_submit_disabled_status: true,
});
uni.showLoading({
title: this.$t('common.processing_in_text'),
});
uni.request({
url: app.globalData.get_request_url('applysave', 'extraction', 'distribution'),
method: 'POST',
data: data,
dataType: 'json',
success: (res) => {
uni.hideLoading();
if (res.data.code == 0) {
app.globalData.showToast(res.data.msg, 'success');
setTimeout(function () {
uni.navigateBack();
}, 1000);
} else {
self.setData({
form_submit_disabled_status: false,
});
if (app.globalData.is_login_check(res.data)) {
app.globalData.showToast(res.data.msg);
} else {
app.globalData.showToast(this.$t('common.sub_error_retry_tips'));
}
}
},
fail: () => {
self.setData({
form_submit_disabled_status: false,
});
uni.hideLoading();
app.globalData.showToast(this.$t('common.internet_error_tips'));
},
});
},
// 上传图片预览
upload_show_event(e) {
uni.previewImage({
current: this.extraction_data.logo,
urls: [this.extraction_data.logo],
});
},
// 图片删除
upload_delete_event(e) {
var self = this;
uni.showModal({
title: this.$t('common.warm_tips'),
content: this.$t('order.order.psi67g'),
success(res) {
if (res.confirm) {
var temp_data = self.extraction_data || {};
temp_data['logo'] = '';
self.setData({
extraction_data: temp_data,
});
}
},
});
},
// 文件上传
file_upload_event(e) {
var self = this;
uni.chooseImage({
count: 1,
success(res) {
var success = 0;
var fail = 0;
var length = res.tempFilePaths.length;
var count = 0;
self.upload_one_by_one(res.tempFilePaths, success, fail, count, length);
},
});
},
// 采用递归的方式上传多张
upload_one_by_one(img_paths, success, fail, count, length) {
var self = this;
uni.uploadFile({
url: app.globalData.get_request_url('index', 'ueditor'),
filePath: img_paths[count],
name: 'upfile',
formData: {
action: 'uploadimage',
path_type: self.editor_path_type,
},
success: function (res) {
success++;
if (res.statusCode == 200) {
var data = typeof res.data == 'object' ? res.data : JSON.parse(res.data);
if (data.code == 0 && (data.data.url || null) != null) {
var temp_data = self.extraction_data || {};
temp_data['logo'] = data.data.url;
self.setData({
extraction_data: temp_data,
});
} else {
app.globalData.showToast(data.msg);
}
}
},
fail: function (e) {
fail++;
},
complete: function (e) {
count++;
// 下一张
if (count >= length) {
// 上传完毕,作一下提示
//app.showToast('上传成功' + success +'张', 'success');
} else {
// 递归调用,上传下一张
self.upload_one_by_one(img_paths, success, fail, count, length);
}
},
});
},
},
};
</script>
<style>
@import './extraction-apply.css';
</style>

View File

@@ -0,0 +1,23 @@
/*
* 导航
*/
.nav-base .item {
width: 33.33%;
}
/*
* 搜索
*/
.search-drag {
width: 35px;
height: 35px;
line-height: 48px;
background: hsla(0, 0%, 0%, 0.01);
margin-top: calc(100vh - 260rpx);
margin-left: calc(50% - 17px);
box-shadow: 0px 3rpx 16rpx rgba(0, 0, 0, 0.2);
padding: 5px;
/* #ifdef H5 */
line-height: 26px;
/* #endif */
}

View File

@@ -0,0 +1,414 @@
<template>
<view :class="theme_view">
<!-- 导航 -->
<view class="nav-base bg-white">
<block v-for="(item, index) in nav_status_list" :key="index">
<view :class="'item fl tc ' + (nav_status_index == index ? 'cr-main' : '')" :data-index="index" @tap="nav_event">{{ item.name }}</view>
</block>
</view>
<movable-area class="wh-auto ht-auto">
<!-- 列表 -->
<scroll-view :scroll-y="true" class="scroll-box scroll-box-ece-nav" @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">
<text class="cr-base">{{ item.add_time }}</text>
<text class="cr-main fr">{{ item.status_name }}</text>
</view>
<view class="content margin-top">
<block v-for="(fv, fi) in content_list" :key="fi">
<view class="single-text margin-top-xs">
<text class="cr-grey margin-right-xl">{{ fv.name }}</text>
<text class="cr-base">{{ item[fv.field] }}</text>
<text v-if="(fv.unit || null) != null" class="cr-grey">{{ fv.unit }}</text>
</view>
</block>
</view>
<view v-if="item.status == 0" class="item-operation tr br-t-dashed padding-top-main margin-top-main">
<button class="round bg-white br cr-base" type="default" size="mini" hover-class="none" :data-index="index" :data-oid="item.order_id" :data-uid="item.order_user_id" @tap="list_submit_take_event">{{$t('extraction-order.extraction-order.2y7lq1')}}</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>
<!-- 拖拽按钮 -->
<movable-view class="search-drag tc circle" direction="all" @tap="drag_event">
<icon type="search" size="20"></icon>
</movable-view>
</movable-area>
<!-- 取货 popup -->
<component-popup :propShow="is_show_take_popup" propPosition="bottom" @onclose="take_popup_event_close">
<view class="form-container bg-base padding-horizontal-main padding-top-main padding-bottom-xs">
<view class="form-gorup tc bg-white margin-top-lg">
<view class="form-gorup-title">{{$t('extraction-order.extraction-order.3m038g')}}</view>
<input type="number" :value="extraction_code" placeholder-class="cr-grey" class="cr-base" :placeholder="$t('extraction-order.extraction-order.suo4oz')" maxlength="4" @input="extraction_code_input_event" />
</view>
<view class="form-gorup form-gorup-submit">
<button class="bg-main br-main cr-white round text-size" type="default" hover-class="none" :disabled="form_submit_disabled_status" @tap="form_submit_take_event">{{$t('common.confirm')}}</button>
</view>
</view>
</component-popup>
<!-- 搜索 popup -->
<component-popup :propShow="is_show_search_popup" propPosition="bottom" @onclose="search_popup_event_close">
<view class="form-container bg-base padding-horizontal-main padding-top-main padding-bottom-xs">
<view class="form-gorup tc bg-white margin-top-lg">
<view class="form-gorup-title">{{$t('extraction-order.extraction-order.xb4044')}}</view>
<input type="number" :value="search_keywords_value" placeholder-class="cr-grey" class="cr-base" :placeholder="$t('extraction-order.extraction-order.kuqvlv')" @input="search_input_keywords_event" />
</view>
<view class="form-gorup form-gorup-submit">
<button class="bg-main-pair br-main-pair cr-white round text-size" type="default" hover-class="none" :disabled="form_submit_disabled_status" @tap="search_submit_event">{{$t('common.search')}}</button>
</view>
</view>
</component-popup>
<!-- 公共 -->
<component-common ref="common"></component-common>
</view>
</template>
<script>
const app = getApp();
import componentCommon from '@/components/common/common';
import componentPopup from "@/components/popup/popup";
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,
nav_status_list: [
{ name: this.$t('common.all'), value: "-1" },
{ name: this.$t('extraction.extraction.53h4fj'), value: "0" },
{ name: this.$t('extraction.extraction.wq25fk'), value: "1" },
],
nav_status_index: 0,
is_show_take_popup: false,
extraction_value: null,
extraction_code: "",
form_submit_disabled_status: false,
is_show_search_popup: false,
search_keywords_value: "",
content_list: [
{ name: this.$t('order-detail.order-detail.36op8f'), field: "order_no" },
{ name: this.$t('user-order-detail.user-order-detail.516tlr'), field: "pay_price" },
],
};
},
components: {
componentCommon,
componentPopup,
componentNoData,
componentBottomLine,
},
onLoad(params) {
// 调用公共事件方法
app.globalData.page_event_onload_handle(params);
// 是否指定状态
var nav_status_index = 0;
if (params.status != undefined) {
for (var i in this.nav_status_list) {
if (this.nav_status_list[i]["value"] == params.status) {
nav_status_index = i;
break;
}
}
}
this.setData({
params: params,
nav_status_index: nav_status_index,
});
this.init();
},
onShow() {
// 调用公共事件方法
app.globalData.page_event_onshow_handle();
// 公共onshow事件
if ((this.$refs.common || null) != null) {
this.$refs.common.on_show();
}
// 分享菜单处理
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) {
this.get_data_list();
} 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,
});
// 加载loding
if(this.data_page > 1) {
uni.showLoading({
title: this.$t('common.loading_in_text'),
});
}
// 参数
var status = (this.nav_status_list[this.nav_status_index] || null) == null ? -1 : this.nav_status_list[this.nav_status_index]["value"];
// 获取数据
uni.request({
url: app.globalData.get_request_url("order", "extraction", "distribution"),
method: "POST",
data: {
page: this.data_page,
status: status || 0,
keywords: this.search_keywords_value || "",
},
dataType: "json",
success: (res) => {
if(this.data_page > 1) {
uni.hideLoading();
}
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: () => {
if(this.data_page > 1) {
uni.hideLoading();
}
uni.stopPullDownRefresh();
this.setData({
data_list_loding_status: 2,
data_is_loading: 0,
});
app.globalData.showToast(this.$t('common.internet_error_tips'));
},
});
},
// 滚动加载
scroll_lower(e) {
this.get_data_list();
},
// 导航事件
nav_event(e) {
this.setData({
nav_status_index: e.currentTarget.dataset.index || 0,
data_page: 1,
data_list: [],
data_list_loding_status: 1,
data_bottom_line_status: false
});
this.get_data_list(1);
},
// 取件码弹层-开启
list_submit_take_event(e) {
this.setData({
is_show_take_popup: true,
extraction_code: "",
extraction_value: {
index: e.currentTarget.dataset.index,
oid: e.currentTarget.dataset.oid,
uid: e.currentTarget.dataset.uid,
},
});
},
// 取件码弹层-关闭
take_popup_event_close() {
this.setData({
is_show_take_popup: false,
});
},
// 取件码输入事件
extraction_code_input_event(e) {
this.setData({
extraction_code: e.detail.value || "",
});
},
// 取件提交
form_submit_take_event(e) {
// 参数
if ((this.extraction_code || null) == null) {
app.globalData.showToast(this.$t('extraction-order.extraction-order.znufs8'));
return false;
}
if ((this.extraction_value || null) == null) {
app.globalData.showToast(this.$t('extraction-order.extraction-order.hbj4y7'));
return false;
}
// 提交表单
var data = {
id: this.extraction_value.oid,
user_id: this.extraction_value.uid,
extraction_code: this.extraction_code,
};
this.setData({
form_submit_disabled_status: true,
});
uni.showLoading({
title: this.$t('common.processing_in_text'),
});
uni.request({
url: app.globalData.get_request_url("take", "extraction", "distribution"),
method: "POST",
data: data,
dataType: "json",
success: (res) => {
this.setData({
form_submit_disabled_status: false,
});
uni.hideLoading();
if (res.data.code == 0) {
var temp_data_list = this.data_list;
var index = this.extraction_value.index;
temp_data_list[index]["status"] = 1;
temp_data_list[index]["status_name"] = this.$t('extraction.extraction.wq25fk');
this.setData({
is_show_take_popup: false,
data_list: temp_data_list,
});
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(this.$t('common.internet_error_tips'));
},
});
},
// 搜索弹层-开启
drag_event(e) {
this.setData({
is_show_search_popup: true,
});
},
// 搜索弹层-关闭
search_popup_event_close() {
this.setData({
is_show_search_popup: false,
});
},
// 搜索关键字输入事件
search_input_keywords_event(e) {
this.setData({
search_keywords_value: e.detail.value || "",
});
},
// 搜索确认事件
search_submit_event(e) {
this.setData({
is_show_search_popup: false,
data_page: 1,
});
this.get_data_list(1);
},
},
};
</script>
<style>
@import "./extraction-order.css";
</style>

View File

@@ -0,0 +1,15 @@
.address-logo {
width: 140rpx;
height: 140rpx !important;
}
.address .item-icon {
width: 30rpx;
height: 35rpx !important;
}
.address-alias {
padding: 0 10rpx;
}
.address .text {
line-height: 44rpx;
width: calc(100% - 40rpx);
}

View File

@@ -0,0 +1,299 @@
<template>
<view :class="theme_view">
<view class="page">
<view v-if="data_list.length > 0" class="data-list padding-main">
<view v-for="(item, index) in data_list" :key="index" class="item bg-white padding-main border-radius-main spacing-mb">
<view @tap="address_conent_event" :data-index="index" class="oh">
<view v-if="(item.logo || null) != null" class="fl oh margin-right-lg">
<image class="dis-block address-logo radius" :src="item.logo" mode="widthFix"></image>
</view>
<view class="oh">
<view class="base oh padding-bottom-main padding-top-xs">
<text v-if="(item.alias || null) != null" class="address-alias br-main cr-main round margin-right-sm">{{ item.alias }}</text>
<text>{{ item.name }}</text>
<text class="fr">{{ item.tel }}</text>
</view>
<view class="address oh padding-top-sm">
<image class="item-icon fl margin-top-xs" :src="common_static_url + 'map-icon.png'" mode="widthFix"></image>
<view class="text fr"> {{ item.province_name || "" }}{{ item.city_name || "" }}{{ item.county_name || "" }}{{ item.address || "" }} </view>
</view>
</view>
</view>
<view v-if="((item.distance_value || null) != null && (item.distance_unit || null) != null) || ((item.lng || 0) != 0 && (item.lat || 0) != 0)" class="br-t oh padding-top-main margin-top-main">
<view v-if="(item.distance_value || null) != null && (item.distance_unit || null) != null" class="fl margin-top-lg">
<text class="cr-grey">{{$t('extraction-switch.extraction-switch.w94x36')}}</text>
<text class="cr-base">{{ item.distance_value }}</text>
<text class="cr-grey">{{ item.distance_unit }}</text>
</view>
<view class="item-operation fr oh">
<button v-if="(item.is_default || 0) == 0" class="round bg-white cr-green br-green" type="default" size="mini" @tap="address_switch_event" :data-index="index" hover-class="none">{{$t('buy.buy.inyxpx')}}</button>
<button v-if="(item.lng || 0) != 0 && (item.lat || 0) != 0" class="round bg-white cr-base br" type="default" size="mini" @tap="address_map_event" :data-index="index" hover-class="none">{{$t('buy.buy.o7722q')}}</button>
</view>
</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>
</view>
<!-- 位置选择 -->
<component-choice-location ref="choice_location" :propIsShowAddressChoice="false" @onBack="user_back_choice_location"></component-choice-location>
<!-- 公共 -->
<component-common ref="common"></component-common>
</view>
</template>
<script>
const app = getApp();
import componentCommon from '@/components/common/common';
import componentNoData from "@/components/no-data/no-data";
import componentBottomLine from "@/components/bottom-line/bottom-line";
import componentChoiceLocation from '@/components/choice-location/choice-location';
var common_static_url = app.globalData.get_static_url("common");
export default {
data() {
return {
theme_view: app.globalData.get_theme_value_view(),
common_static_url: common_static_url,
data_list_loding_status: 1,
data_bottom_line_status: false,
data_list: [],
params: null,
user_location: null,
is_first: 1,
home_extraction_address_position: 0,
};
},
components: {
componentCommon,
componentNoData,
componentBottomLine,
componentChoiceLocation
},
onLoad(params) {
// 调用公共事件方法
app.globalData.page_event_onload_handle(params);
// 设置参数
this.setData({
params: params,
home_extraction_address_position: app.globalData.get_config("config.home_extraction_address_position", 0),
});
// 清除位置缓存信息
app.globalData.choice_user_location_remove();
},
onShow() {
// 调用公共事件方法
app.globalData.page_event_onshow_handle();
// 是否需要选择地理位置
if (this.home_extraction_address_position == 1) {
// 用户位置初始化
this.user_location_init();
} else {
this.init();
}
this.setData({
is_first: 0,
});
// 是否获取位置
if (this.home_extraction_address_position == 1) {
if((this.user_location || null) == null || this.user_location.status != 1) {
this.$refs.choice_location.choose_user_location();
}
}
// 公共onshow事件
if ((this.$refs.common || null) != null) {
this.$refs.common.on_show();
}
// 分享菜单处理
app.globalData.page_share_handle();
},
// 下拉刷新
onPullDownRefresh() {
this.get_data_list();
},
methods: {
// 初始化
init() {
var user = app.globalData.get_user_info(this, "init");
if (user != false) {
this.get_data_list();
} else {
this.setData({
data_list_loding_status: 0,
data_bottom_line_status: false,
});
}
},
// 选择用户地理位置回调
user_back_choice_location(e) {
this.setData({
user_location: e
});
this.init();
},
// 地址信息初始化
user_location_init() {
this.setData({
user_location: app.globalData.choice_user_location_init()
});
},
// 获取数据列表
get_data_list() {
// 加载loding
uni.showLoading({
title: this.$t('common.loading_in_text'),
});
this.setData({
data_list_loding_status: 1,
});
// 获取数据
var data = {};
// 是否有坐标
if ((this.user_location || null) != null) {
data["lng"] = this.user_location.lng;
data["lat"] = this.user_location.lat;
}
// 请求接口
uni.request({
url: app.globalData.get_request_url("switchinfo", "extraction", "distribution"),
method: "POST",
data: data,
dataType: "json",
success: (res) => {
uni.hideLoading();
uni.stopPullDownRefresh();
if (res.data.code == 0) {
var data = res.data.data;
if (data.extraction_address.length > 0) {
this.setData({
data_list: data.extraction_address,
data_list_loding_status: 3,
data_bottom_line_status: true,
});
} else {
this.setData({
data_list_loding_status: 0,
});
}
} else {
this.setData({
data_list_loding_status: 0,
});
if (app.globalData.is_login_check(res.data, this, "get_data_list")) {
app.globalData.showToast(res.data.msg);
}
}
},
fail: () => {
uni.hideLoading();
uni.stopPullDownRefresh();
this.setData({
data_list_loding_status: 2,
});
app.globalData.showToast(this.$t('common.internet_error_tips'));
},
});
},
// 地图查看
address_map_event(e) {
var index = e.currentTarget.dataset.index || 0;
var data = this.data_list[index] || null;
if (data == null) {
app.globalData.showToast(this.$t('user-order-detail.user-order-detail.i876o3'));
return false;
}
// 打开地图
var name = data.alias || data.name || "";
var address = (data.province_name || "") + (data.city_name || "") + (data.county_name || "") + (data.address || "");
app.globalData.open_location(data.lng, data.lat, name, address);
},
// 地址内容事件
address_conent_event(e) {
var index = e.currentTarget.dataset.index || 0;
var is_back = this.params.is_back || 0;
if (is_back == 1) {
uni.setStorage({
key: app.globalData.data.cache_buy_user_address_select_key,
data: this.data_list[index],
});
uni.navigateBack();
}
},
// 切换选择事件
address_switch_event(e) {
var index = e.currentTarget.dataset.index || 0;
var temp_data = this.data_list;
if ((temp_data[index] || null) == null) {
app.globalData.showToast(this.$t('extraction-switch.extraction-switch.613b58'));
return false;
}
// 请求切换
uni.showLoading({
title: this.$t('common.processing_in_text'),
});
uni.request({
url: app.globalData.get_request_url("switchsave", "extraction", "distribution"),
method: "POST",
data: {
id: temp_data[index]["id"],
value: temp_data[index]["id_old"] || 0,
},
dataType: "json",
success: (res) => {
uni.hideLoading();
if (res.data.code == 0) {
app.globalData.showToast(res.data.msg, "success");
var temp_data = this.data_list;
for (var i in temp_data) {
temp_data[i]["is_default"] = i == index ? 1 : 0;
}
this.setData({
data_list: temp_data,
});
} else {
if (app.globalData.is_login_check(res.data)) {
app.globalData.showToast(res.data.msg);
} else {
app.globalData.showToast(this.$t('common.sub_error_retry_tips'));
}
}
},
fail: () => {
uni.hideLoading();
app.globalData.showToast(this.$t('common.internet_error_tips'));
},
});
},
},
};
</script>
<style>
@import "./extraction-switch.css";
</style>

View File

@@ -0,0 +1,7 @@
.alias {
padding: 2rpx 10rpx;
}
.statistics .item {
width: 50%;
box-sizing: border-box;
}

View File

@@ -0,0 +1,241 @@
<template>
<view :class="theme_view">
<view v-if="data_base != null">
<view class="padding-main">
<!-- 未申请 -->
<view v-if="extraction == null">
<view v-if="(data_base.self_extraction_apply_desc || null) != null && data_base.self_extraction_apply_desc.length > 0" class="notice-content-blue spacing-mb">
<view v-for="(item, index) in data_base.self_extraction_apply_desc" :key="index" class="item">
{{ item }}
</view>
</view>
<view class="margin-top-xxxl">
<button data-value="/pages/plugins/distribution/extraction-apply/extraction-apply" @tap="url_event" class="bg-main br-main cr-white round wh-auto" type="default" size="mini" hover-class="none">{{$t('extraction.extraction.suna53')}}</button>
</view>
</view>
<!-- 已存在申请信息 -->
<view v-else class="apply-already">
<!-- status 状态0待审核, 1已通过, 2已拒绝 -->
<!-- 审核中 -->
<view v-if="extraction.status == 0">
<view class="padding-main border-radius-main bg-white">
<view class="cr-red tc text-size-lg">{{$t('extraction.extraction.j0o47u')}}</view>
</view>
<view class="margin-top-xxxl">
<button data-value="/pages/plugins/distribution/extraction-apply/extraction-apply" @tap="url_event" class="bg-green br-green cr-white round wh-auto" type="default" size="mini" hover-class="none">{{$t('common.edit')}}</button>
</view>
</view>
<!-- 审核通过 -->
<view v-else-if="extraction.status == 1 || extraction.status == 3" class="valid">
<view class="padding-main border-radius-main bg-white">
<!-- 导航 -->
<view class="padding-bottom-main br-b">
<text class="fw-b">{{$t('extraction.extraction.60601g')}}</text>
<view data-value="/pages/plugins/distribution/extraction-apply/extraction-apply" @tap="url_event" class="fr cr-blue cp">{{$t('extraction.extraction.48rp75')}}</view>
</view>
<!-- 地址信息 -->
<view class="margin-top-lg" @tap="address_map_event">
<text v-if="(extraction.alias || null) != null" class="alias br-main cr-main bg-white round margin-right-sm">{{ extraction.alias }}</text>
<text class="cr-base">{{ extraction.province_name }}{{ extraction.city_name }}{{ extraction.county_name }}{{ extraction.address }}</text>
</view>
</view>
<view v-if="extraction.status == 1" class="spacing-mt">
<view class="padding-main border-radius-main bg-white">
<!-- 导航 -->
<view class="padding-bottom-main br-b">
<text class="fw-b">{{$t('extraction.extraction.641gp7')}}</text>
<view data-value="/pages/plugins/distribution/extraction-order/extraction-order" @tap="url_event" class="fr cr-blue cp">{{$t('extraction.extraction.wcv68q')}}</view>
</view>
<!-- 自提地点统计 -->
<view class="statistics oh padding-top-main">
<view class="item fl tc padding-main" data-value="0" @tap="order_event">
<view class="title cr-base">{{$t('extraction.extraction.53h4fj')}}</view>
<view class="single-text cr-red fw-b margin-top-sm">{{ statistical.order_wait || 0 }}</view>
</view>
<view class="item fl tc padding-main" data-value="1" @tap="order_event">
<view class="title cr-base">{{$t('extraction.extraction.wq25fk')}}</view>
<view class="single-text cr-green fw-b margin-top-sm">{{ statistical.order_already || 0 }}</view>
</view>
</view>
</view>
<!-- 通知 -->
<view v-if="(data_base || null) != null && (data_base.self_extraction_common_notice || null) != null && data_base.self_extraction_common_notice.length > 0" class="spacing-mt">
<view class="notice-content">
<view v-for="(item, index) in data_base.self_extraction_common_notice" :key="index" class="item">
{{ item }}
</view>
</view>
</view>
</view>
<!-- 已解约 -->
<view v-else class="spacing-mt">
<view class="notice-content-blue">{{$t('extraction.extraction.864dtt')}}</view>
</view>
</view>
<!-- 审核失败 -->
<view v-else="extraction.status == 2">
<view class="padding-main border-radius-main bg-white spacing-mb">
<view class="cr-red tc text-size-lg">{{$t('extraction.extraction.11825x')}}</view>
<view v-if="(extraction.fail_reason || null) != null" class="margin-top-lg">
<text class="fw-b">{{$t('extraction.extraction.w6hg74')}}</text>
<text class="cr-grey">{{ extraction.fail_reason }}</text>
</view>
</view>
<view class="margin-top-xxxl">
<button data-value="/pages/plugins/distribution/extraction-apply/extraction-apply" @tap="url_event" class="bg-green br-green cr-white round wh-auto" type="default" size="mini" hover-class="none">{{$t('common.edit')}}</button>
</view>
</view>
</view>
</view>
<!-- 结尾 -->
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
</view>
<view v-else>
<!-- 提示信息 -->
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
</view>
<!-- 公共 -->
<component-common ref="common"></component-common>
</view>
</template>
<script>
const app = getApp();
import componentCommon from '@/components/common/common';
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_bottom_line_status: false,
data_list_loding_status: 1,
data_list_loding_msg: "",
data_base: null,
extraction: null,
statistical: null,
};
},
components: {
componentCommon,
componentNoData,
componentBottomLine,
},
onLoad(params) {
// 调用公共事件方法
app.globalData.page_event_onload_handle(params);
},
onShow() {
// 调用公共事件方法
app.globalData.page_event_onshow_handle();
// 加载数据
this.init();
// 公共onshow事件
if ((this.$refs.common || null) != null) {
this.$refs.common.on_show();
}
// 分享菜单处理
app.globalData.page_share_handle();
},
// 下拉刷新
onPullDownRefresh() {
this.get_data();
},
methods: {
init() {
var user = app.globalData.get_user_info(this, "init");
if (user != false) {
this.get_data();
} else {
this.setData({
data_list_loding_status: 0,
data_bottom_line_status: false,
});
}
},
// 获取数据
get_data() {
uni.request({
url: app.globalData.get_request_url("index", "extraction", "distribution"),
method: "POST",
data: {},
dataType: "json",
success: (res) => {
uni.hideLoading();
uni.stopPullDownRefresh();
if (res.data.code == 0) {
var data = res.data.data;
this.setData({
data_base: data.base || null,
extraction: data.extraction || null,
statistical: data.statistical || null,
data_list_loding_msg: "",
data_list_loding_status: 0,
data_bottom_line_status: true,
});
} else {
this.setData({
data_bottom_line_status: false,
data_list_loding_status: 2,
data_list_loding_msg: res.data.msg,
});
if (app.globalData.is_login_check(res.data, this, "get_data")) {
app.globalData.showToast(res.data.msg);
}
}
},
fail: () => {
uni.hideLoading();
uni.stopPullDownRefresh();
this.setData({
data_bottom_line_status: false,
data_list_loding_status: 2,
data_list_loding_msg: this.$t('common.internet_error_tips'),
});
app.globalData.showToast(this.$t('common.internet_error_tips'));
},
});
},
// 地图查看
address_map_event(e) {
if ((this.extraction || null) == null) {
return false;
}
var data = this.extraction;
// 打开地图
var name = data.alias || data.name || "";
var address = (data.province_name || "") + (data.city_name || "") + (data.county_name || "") + (data.address || "");
app.globalData.open_location(data.lng, data.lat, name, address);
},
// 进入取货订单管理
order_event(e) {
var value = e.currentTarget.dataset.value || 0;
app.globalData.url_open('/pages/plugins/distribution/extraction-order/extraction-order?status=' + value);
},
// url事件
url_event(e) {
app.globalData.url_event(e);
}
},
};
</script>
<style>
@import "./extraction.css";
</style>

View File

@@ -0,0 +1,4 @@
.panel-item .level-icon {
width: 50rpx;
height: 50rpx !important;
}

View File

@@ -0,0 +1,177 @@
<template>
<view :class="theme_view">
<view v-if="data_base != null">
<view class="padding-horizontal-main padding-top-main">
<!-- 等级信息 -->
<view v-if="level_list.length > 0" class="panel-item spacing-mb">
<view v-for="(item, index) in level_list" :key="index" class="padding-main border-radius-main bg-white spacing-mb">
<view class="br-b padding-bottom-main fw-b text-size">{{ item.name }}</view>
<view class="panel-content oh padding-top-main">
<view class="item br-b oh padding-vertical-main">
<view class="title fl padding-right-main cr-grey">{{$t('introduce.introduce.017d67')}}</view>
<view class="content fl br-l padding-left-main">
<image :src="item.images_url" class="dis-block fl level-icon" mode="widthFix"></image>
</view>
</view>
<view class="item br-b oh padding-vertical-main">
<view class="title fl padding-right-main cr-grey">{{$t('introduce.introduce.el4ib2')}}</view>
<view class="content fl br-l padding-left-main">
<view>{{$t('introduce.introduce.syf66q')}}{{ item.level_rate_one }}%</view>
<view v-if="data_base.level == undefined || data_base.level > 0">{{$t('introduce.introduce.q4t9kl')}}{{ item.level_rate_two }}%</view>
<view v-if="data_base.level == undefined || data_base.level > 1">{{$t('introduce.introduce.e5os6e')}}{{ item.level_rate_three }}%</view>
</view>
</view>
<view class="item br-b oh padding-vertical-main">
<view class="title fl padding-right-main cr-grey">{{$t('introduce.introduce.d7kle4')}}</view>
<view class="content fl br-l padding-left-main">
<block v-if="(item.rules_msg_list || null) != null">
<view>{{ item.rules_msg_list.name }}</view>
<view class="padding-left-xxl">
<block v-if="(item.rules_msg_list.data || null) != null && item.rules_msg_list.data.length > 0">
<block v-for="(rv, ri) in item.rules_msg_list.data" :key="ri">
<view>
<text>{{ rv.name }}</text>
<text class="fr fw-b">{{ rv.value }}</text>
</view>
</block>
</block>
<block v-else>
<view class="cr-grey">{{$t('introduce.introduce.5t5vzi')}}</view>
</block>
</view>
</block>
</view>
</view>
</view>
</view>
</view>
<!-- 等级介绍 -->
<view v-if="(data_base.user_center_level_desc || null) != null && data_base.user_center_level_desc.length > 0" class="spacing-mb">
<view class="notice-content-blue">
<view v-for="(item, index) in data_base.user_center_level_desc" :key="index" class="item">
{{ item }}
</view>
</view>
</view>
</view>
<!-- 结尾 -->
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
</view>
<view v-else>
<!-- 提示信息 -->
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
</view>
<!-- 公共 -->
<component-common ref="common"></component-common>
</view>
</template>
<script>
const app = getApp();
import componentCommon from '@/components/common/common';
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(),
params: null,
data_list_loding_status: 1,
data_list_loding_msg: "",
data_bottom_line_status: false,
data_base: null,
level_list: [],
};
},
components: {
componentCommon,
componentNoData,
componentBottomLine,
},
onLoad(params) {
// 调用公共事件方法
app.globalData.page_event_onload_handle(params);
// 设置参数
this.setData({
params: params,
});
this.init();
},
onShow() {
// 调用公共事件方法
app.globalData.page_event_onshow_handle();
// 公共onshow事件
if ((this.$refs.common || null) != null) {
this.$refs.common.on_show();
}
// 分享菜单处理
app.globalData.page_share_handle();
},
// 下拉刷新
onPullDownRefresh() {
this.init();
},
methods: {
init() {
this.setData({
data_list_loding_status: 1,
});
uni.request({
url: app.globalData.get_request_url("index", "introduce", "distribution"),
method: "POST",
data: {
id: this.params.id,
},
dataType: "json",
success: (res) => {
uni.stopPullDownRefresh();
if (res.data.code == 0) {
var data = res.data.data;
var data_base = data.base || null;
var level_list = (data.level_list || null) != null && data.level_list.length > 0 ? data.level_list : [];
this.setData({
data_base: data_base,
level_list: level_list,
data_list_loding_status: data_base == null || level_list.length <= 0 ? 0 : 3,
data_bottom_line_status: true,
data_list_loding_msg: "",
});
} else {
this.setData({
data_list_loding_status: 2,
data_bottom_line_status: false,
data_list_loding_msg: res.data.msg,
});
if (app.globalData.is_login_check(res.data, this, "init")) {
app.globalData.showToast(res.data.msg);
}
}
},
fail: () => {
uni.stopPullDownRefresh();
this.setData({
data_list_loding_status: 2,
data_bottom_line_status: false,
data_list_loding_msg: this.$t('common.internet_error_tips'),
});
app.globalData.showToast(this.$t('common.internet_error_tips'));
},
});
},
},
};
</script>
<style>
@import "./introduce.css";
</style>

View File

@@ -0,0 +1,38 @@
.map-container {
height: 60vh;
}
.map-container .map-center-icon {
top: calc(50% - 30rpx);
left: calc(50% - 30rpx);
width: 60rpx;
height: 60rpx;
}
.user-container {
height: 40vh;
padding-bottom: calc(env(safe-area-inset-bottom) - 20rpx);
}
.user-container .item.active {
background: #f2f2f2;
}
.user-container .item .avatar {
width: 140rpx;
height: 140rpx;
}
.user-container .item .base {
width: calc(100% - 160rpx);
height: 140rpx;
}
.user-container .item .base-top .view-name {
width: calc(100% - 200rpx);
}
.user-container .item .base-bottom .address {
width: calc(100% - 110rpx);
}
.user-container .item .base-top-icon .dis-inline-block:not(:last-child) {
margin-right: 30rpx;
}
.user-container .item .order-submit {
padding: 0rpx 20rpx !important;
line-height: 40rpx !important;
}

View File

@@ -0,0 +1,313 @@
<template>
<view :class="theme_view">
<block v-if="data_list_loding_status == 3">
<view class="map-container pr">
<map class="wh-auto ht-auto"
:enable-zoom="true"
:enable-scroll="true"
:show-location="true"
:latitude="latitude"
:longitude="longitude"
:scale="scale"
:markers="markers"
@regionchange="region_change_event"
@markertap="marker_tap_event"
></map>
<image v-if="map_center_icon_status == 1" class="map-center-icon pa" :src="map_location_icon" mode="aspectFit"></image>
</view>
<scroll-view :scroll-y="true" :scroll-top="scroll_top" :scroll-with-animation="true" class="bg-white bs-bb user-container">
<block v-if="(user || null) != null && user.length > 0">
<block v-for="(item, index) in user" :key="index">
<view :class="'item padding-main oh pr br-b '+(item.active || '')" :data-index="index" @tap="user_event">
<image class="circle br dis-block fl avatar" :src="item.avatar" mode="aspectFit"></image>
<view class="base fr">
<view class="base-top oh br-b-dashed padding-bottom-xs">
<view class="single-text cr-base fl view-name">{{item.user_name_view}}</view>
<view class="fr base-top-icon">
<view v-if="(item.username || null) != null" class="dis-inline-block va-m" data-event="copy" :data-value="item.username" @tap.stop="text_event">
<uni-icons type="person" size="34rpx" color="#999"></uni-icons>
</view>
<view v-if="(item.mobile || null) != null" class="dis-inline-block va-m" data-event="tel" :data-value="item.mobile" @tap.stop="text_event">
<uni-icons type="phone" size="34rpx" color="#999"></uni-icons>
</view>
<view v-if="(item.email || null) != null" class="dis-inline-block va-m" data-event="copy" :data-value="item.email" @tap.stop="text_event">
<uni-icons type="email" size="34rpx" color="#999"></uni-icons>
</view>
</view>
</view>
<view class="base-bottom cr-grey text-size-xs margin-top-sm oh">
<text class="single-text fl address">{{item.address}}</text>
<view class="fr">
<view class="dis-inline-block va-m" data-event="copy" :data-value="item.address" @tap.stop="text_event">
<uni-icons type="chatboxes" size="34rpx" color="#999"></uni-icons>
</view>
<view class="dis-inline-block va-m margin-left-xxl" data-event="copy" :data-value="item.address" :data-lng="item.lng" :data-lat="item.lat" @tap.stop="map_route_event">
<uni-icons type="paperplane" size="34rpx" color="#999"></uni-icons>
</view>
</view>
</view>
<view class="text-size-xs margin-top-sm">
<text class="cr-grey">{{$t('map.map.ivy154')}}</text>
<text class="cr-base fw-b margin-left-sm">{{item.order_count}}</text>
<button type="default" size="mini" class="br-main cr-main bg-white text-size-xs round fr order-submit" :data-value="item.id" @tap="user_order_event">{{$t('map.map.557z8x')}}</button>
</view>
</view>
</view>
</block>
</block>
<block v-else>
<component-no-data propStatus="0"></component-no-data>
</block>
</scroll-view>
</block>
<block v-else>
<!-- 提示信息 -->
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
</block>
<!-- 公共 -->
<component-common ref="common"></component-common>
</view>
</template>
<script>
const app = getApp();
import componentCommon from '@/components/common/common';
import componentNoData from "@/components/no-data/no-data";
var plugins_static_url = app.globalData.get_static_url('distribution', true);
export default {
data() {
return {
theme_view: app.globalData.get_theme_value_view(),
data_list_loding_status: 1,
data_list_loding_msg: '',
data_bottom_line_status: false,
params: null,
data_list: [],
map_location_icon: plugins_static_url+'app/map/location-icon.png',
user: [],
scale: 10,
latitude: 39.909,
longitude: 116.39742,
markers: [],
map_center_icon_status: 1,
markers_active_index: null,
scroll_top: 0
};
},
components: {
componentCommon,
componentNoData
},
onLoad(params) {
// 调用公共事件方法
app.globalData.page_event_onload_handle(params);
// 设置参数
this.setData({
params: params
});
// 获取数据
this.init();
},
onShow() {
// 调用公共事件方法
app.globalData.page_event_onshow_handle();
// 公共onshow事件
if ((this.$refs.common || null) != null) {
this.$refs.common.on_show();
}
},
methods: {
// 获取数据
init() {
var user = app.globalData.get_user_info(this, 'init');
if (user != false) {
// 位置权限、回调并获取数据
app.globalData.get_location_check('scope.userLocation', this, 'location_back_handle');
} else {
this.setData({
data_list_loding_status: 0,
data_bottom_line_status: false
});
}
},
// 获取数据
get_data() {
// 参数
uni.request({
url: app.globalData.get_request_url("map", "order", "distribution"),
method: 'POST',
data: {
lng: this.longitude,
lat: this.latitude
},
dataType: 'json',
success: res => {
if (res.data.code == 0) {
var data = res.data.data;
var user = data.user || [];
var temp_markers = [];
if(user.length > 0) {
user.forEach((item, index) => {
temp_markers.push({
id: index,
width: 25,
height: 25,
latitude: item.lat,
longitude: item.lng,
iconPath: plugins_static_url+'app/map/markers-icon.png'
});
});
}
this.setData({
user: user,
markers: temp_markers,
markers_active_index: null,
scale: data.scale || 10,
data_list_loding_status: 3
});
} else {
this.setData({
data_list_loding_status: 3,
data_list_loding_msg: res.data.msg
});
}
},
fail: () => {
this.setData({
data_list_loding_status: 3,
data_list_loding_msg: this.$t('common.internet_error_tips')
});
}
});
},
// 文本事件
text_event(e) {
app.globalData.text_event_handle(e);
},
// 地址导航
map_route_event(e) {
app.globalData.open_location(e.currentTarget.dataset.lng, e.currentTarget.dataset.lat, '', e.currentTarget.dataset.value);
},
// 位置权限校验回调
location_back_handle(status = 0) {
var self = this;
if(status == 1) {
uni.getLocation({
type: 'wgs84',
success: function (res) {
self.setData({
longitude: res.longitude,
latitude: res.latitude,
});
// 获取数据
self.get_data();
}
});
} else {
if(app.globalData.data.is_distribution_map_force_location == 1) {
app.globalData.url_open('/pages/common/open-setting-location/open-setting-location?is_check_success_back=1');
} else {
// 获取数据
self.get_data();
}
}
},
// 视野改变事件
region_change_event(e) {
// 仅拖动及手势有效
if(e.causedBy == 'drag' || e.causedBy == 'gesture') {
// 1. 开始显示中心图标
// 2. 结束重新拉取数据
if(e.type == 'end') {
this.setData({
latitude: e.detail.centerLocation.latitude,
longitude: e.detail.centerLocation.longitude
});
// 获取数据
this.get_data();
} else {
this.setData({
map_center_icon_status: 1,
});
}
}
},
// 点击标记点事件
marker_tap_event(e) {
// 索引值
var index = e.detail.markerId;
// 选中处理
this.user_markers_active_handle(index);
// 列表滑动到用户位置
this.setData({
scroll_top: (index*182)+'rpx'
});
},
// 用户点击事件
user_event(e) {
// 索引值
var index = e.currentTarget.dataset.index || 0;
// 选中处理
this.user_markers_active_handle(index);
// 设置地图中心位置为当前用户位置
var temp = this.user[index];
this.setData({
latitude: temp['lat'],
longitude: temp['lng']
});
},
// 用户和覆盖物选中处理
user_markers_active_handle(index) {
// 覆盖物
var temp_markers = this.markers;
for(var i in temp_markers) {
if(i == index) {
temp_markers[i]['iconPath'] = plugins_static_url+'app/map/markers-active-icon.png';
} else {
temp_markers[i]['iconPath'] = plugins_static_url+'app/map/markers-icon.png';
}
}
// 用户信息
var temp_user = this.user;
for(var i in temp_user) {
if(i == index) {
temp_user[i]['active'] = 'active';
} else {
temp_user[i]['active'] = '';
}
}
// 设置数据
this.setData({
markers_active_index: index,
markers: temp_markers,
user: temp_user,
map_center_icon_status: 0
});
},
// 用户订单事件
user_order_event(e) {
var value = e.currentTarget.dataset.value;
app.globalData.url_open('/pages/plugins/distribution/order/order?uid='+value);
}
}
};
</script>
<style>
@import './map.css';
</style>

View File

@@ -0,0 +1,45 @@
/**
* 头像
*/
.avatar {
width: 45rpx;
height: 45rpx;
}
/*
* 商品信息
*/
.goods-base {
min-height: 160rpx;
margin-left: 180rpx;
}
.goods .goods-item:last-child {
border-bottom: 0;
}
.goods-image {
width: 160rpx;
height: 160rpx;
}
/*
* 地址信息
*/
.address-base,
.address-detail {
padding: 10rpx 0;
}
.address-detail .icon {
width: 30rpx;
height: 35rpx !important;
}
.address-detail .text {
width: calc(100% - 40rpx);
}
.address-detail .text {
line-height: 36rpx;
}
.address-alias,
.address-map-submit {
padding: 0 15rpx;
line-height: 40rpx;
}

View File

@@ -0,0 +1,219 @@
<template>
<view :class="theme_view">
<view v-if="detail != null">
<view class="padding-horizontal-main padding-top-main">
<!-- 地址 -->
<view v-if="(detail.address_data || null) != null" class="goods bg-white padding-main border-radius-main spacing-mb">
<view class="address-base oh">
<text v-if="(detail.address_data.alias || null) != null" class="address-alias round br-main cr-main bg-white margin-right-sm">{{ detail.address_data.alias }}</text>
<text data-event="copy" :data-value="detail.address_data.name" @tap="text_event">{{ detail.address_data.name }}</text>
<text class="fr" data-event="tel" :data-value="detail.address_data.tel" @tap="text_event">{{ detail.address_data.tel }}</text>
</view>
<view class="address-detail oh margin-bottom-main">
<image class="icon fl" :src="common_static_url + 'map-icon.png'" mode="widthFix"></image>
<view class="text fr">
<text data-event="copy" :data-value="detail.address_data.province_name + detail.address_data.city_name + detail.address_data.county_name + detail.address_data.address" @tap="text_event"
>{{ detail.address_data.province_name }}{{ detail.address_data.city_name }}{{ detail.address_data.county_name }}{{ detail.address_data.address }}</text
>
</view>
</view>
<view class="address-divider spacing-mb"></view>
</view>
<!-- 基础信息 -->
<view v-if="detail_list.length > 0" class="panel-item padding-main border-radius-main bg-white spacing-mb">
<view class="br-b padding-bottom-main fw-b text-size">{{$t('order-detail.order-detail.9er1pc')}}</view>
<view class="panel-content oh">
<view class="item br-b oh padding-vertical-main">
<view class="title fl padding-right-main cr-grey">{{$t('order-detail.order-detail.pyw6xg')}}</view>
<view class="content fl br-l padding-left-main">
<image :src="detail.avatar" class="avatar dis-block circle fl" mode="widthFix" @tap="avatar_event" :data-value="detail.avatar"></image>
</view>
</view>
<view v-for="(item, index) in detail_list" :key="index" class="item br-b-dashed oh padding-vertical-main">
<view class="title fl padding-right-main cr-grey">{{ item.name }}</view>
<view class="content fl br-l padding-left-main">{{ item.value }}</view>
</view>
</view>
</view>
<!-- 商品列表 -->
<view v-if="detail.items.length > 0" class="goods bg-white padding-main border-radius-main spacing-mb">
<view class="br-b padding-bottom-main fw-b text-size">{{$t('user-order-detail.user-order-detail.7f8p26')}}</view>
<view v-for="(item, index) in detail.items" :key="index" class="goods-item br-b-dashed oh padding-main">
<view :data-value="item.goods_url" @tap="url_event" class="cp">
<image class="goods-image fl radius" :src="item.images" mode="aspectFill"></image>
<view class="goods-base pr">
<view class="multi-text">{{ item.title }}</view>
<view v-if="item.spec != null" class="margin-top-sm">
<block v-for="(sv, si) in item.spec" :key="si">
<text v-if="si > 0" class="cr-grey padding-left-xs padding-right-xs">;</text>
<text class="cr-grey">{{ sv.value }}</text>
</block>
</view>
<view class="margin-top-sm">
<text class="fw-b">{{ detail.currency_data.currency_symbol }}{{ item.price }}</text>
<text class="margin-left-sm">x{{ item.buy_number }}</text>
</view>
<view v-if="detail.is_can_launch_aftersale == 1 && (item.orderaftersale_btn_text || null) != null" class="orderaftersale-btn-text cr-blue pa bg-white" @tap.stop="orderaftersale_event" :data-oid="detail.id" :data-did="item.id">{{ item.orderaftersale_btn_text }}</view>
</view>
</view>
</view>
<view class="padding-top-main tr cr-base text-size">
<text>{{$t('user-order-detail.user-order-detail.423rmr')}}<text class="fw-b">{{ detail.buy_number_count }}</text>{{$t('user-order-detail.user-order-detail.41ty94')}}<text class="sales-price margin-right-xs">{{ detail.currency_data.currency_symbol }}{{ detail.total_price }}</text></text>
</view>
</view>
</view>
<!-- 结尾 -->
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
</view>
<view v-else>
<!-- 提示信息 -->
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
</view>
<!-- 公共 -->
<component-common ref="common"></component-common>
</view>
</template>
<script>
const app = getApp();
import componentCommon from '@/components/common/common';
import componentNoData from "@/components/no-data/no-data";
import componentBottomLine from "@/components/bottom-line/bottom-line";
var common_static_url = app.globalData.get_static_url("common");
export default {
data() {
return {
theme_view: app.globalData.get_theme_value_view(),
common_static_url: common_static_url,
params: null,
data_list_loding_status: 1,
data_list_loding_msg: "",
data_bottom_line_status: false,
detail: null,
detail_list: [],
};
},
components: {
componentCommon,
componentNoData,
componentBottomLine,
},
onLoad(params) {
// 调用公共事件方法
app.globalData.page_event_onload_handle(params);
// 设置参数
this.setData({
params: params,
});
this.init();
},
onShow() {
// 调用公共事件方法
app.globalData.page_event_onshow_handle();
// 公共onshow事件
if ((this.$refs.common || null) != null) {
this.$refs.common.on_show();
}
// 分享菜单处理
app.globalData.page_share_handle();
},
// 下拉刷新
onPullDownRefresh() {
this.init();
},
methods: {
init() {
this.setData({
data_list_loding_status: 1,
});
uni.request({
url: app.globalData.get_request_url("detail", "order", "distribution"),
method: "POST",
data: {
id: this.params.id,
},
dataType: "json",
success: (res) => {
uni.stopPullDownRefresh();
if (res.data.code == 0) {
var data = res.data.data;
this.setData({
detail: data.data,
detail_list: [
{ name: this.$t('order-detail.order-detail.2d766e'), value: data.data.user_name_view || "" },
{ name: this.$t('order-detail.order-detail.36op8f'), value: data.data.order_no || "" },
{ name: this.$t('order-detail.order-detail.x3ge6c'), value: data.data.total_price || "" },
{ name: this.$t('order-detail.order-detail.v52n5r'), value: data.data.refund_price || "" },
{ name: this.$t('user-order-detail.user-order-detail.yxwu8n'), value: data.data.order_status_name || "" },
{ name: this.$t('user-order-detail.user-order-detail.23qj7m'), value: data.data.order_pay_status_name || "" },
{ name: this.$t('order.order.330m76'), value: data.data.order_client_type_name || "" },
{ name: this.$t('order-detail.order-detail.8n1f72'), value: data.data.buy_number_count || "" },
{ name: this.$t('order-detail.order-detail.w78rgm'), value: data.data.add_time || "" },
],
data_list_loding_status: 3,
data_bottom_line_status: true,
data_list_loding_msg: "",
});
} else {
this.setData({
data_list_loding_status: 2,
data_bottom_line_status: false,
data_list_loding_msg: res.data.msg,
});
if (app.globalData.is_login_check(res.data, this, "init")) {
app.globalData.showToast(res.data.msg);
}
}
},
fail: () => {
uni.stopPullDownRefresh();
this.setData({
data_list_loding_status: 2,
data_bottom_line_status: false,
data_list_loding_msg: this.$t('common.internet_error_tips'),
});
app.globalData.showToast(this.$t('common.internet_error_tips'));
},
});
},
// 头像查看
avatar_event(e) {
var value = e.currentTarget.dataset.value || null;
if (value != null) {
uni.previewImage({
current: value,
urls: [value],
});
} else {
app.globalData.showToast(this.$t('order.order.p3scy0'));
}
},
// 文本事件
text_event(e) {
app.globalData.text_event_handle(e);
},
// url事件
url_event(e) {
app.globalData.url_event(e);
}
},
};
</script>
<style>
@import "./order-detail.css";
</style>

View File

@@ -0,0 +1,14 @@
/*
* 导航
*/
.nav-base .item {
width: 16.66%;
}
/*
* 列表
*/
.data-list .item .base .avatar {
width: 40rpx;
height: 40rpx !important;
}

View File

@@ -0,0 +1,280 @@
<template>
<view :class="theme_view">
<!-- 导航 -->
<view class="nav-base bg-white">
<view v-for="(item, index) in nav_status_list" :key="index">
<view :class="'item fl tc ' + (nav_status_index == index ? 'cr-main nav-active-line' : '')" :data-index="index" @tap="nav_event">{{ item.name }}</view>
</view>
</view>
<!-- 列表 -->
<scroll-view :scroll-y="true" class="scroll-box scroll-box-ece-nav" @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">
<image class="avatar dis-block fl circle" :src="item.avatar" mode="widthFix" @tap="avatar_event" :data-value="item.avatar"></image>
<text class="cr-base margin-left-sm">{{ item.user_name_view || "" }}</text>
<text class="cr-base fr">{{ item.order_status_name }}</text>
</view>
<view :data-value="'/pages/plugins/distribution/order-detail/order-detail?id=' + item.id" @tap="url_event" class="content margin-top cp">
<view v-for="(fv, fi) in content_list" :key="fi">
<view class="single-text margin-top-xs">
<text class="cr-grey margin-right-xl">{{ fv.name }}</text>
<text class="cr-base">{{ item[fv.field] }}</text>
<text v-if="(fv.unit || null) != null" class="cr-grey">{{ fv.unit }}</text>
</view>
</view>
</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>
<!-- 公共 -->
<component-common ref="common"></component-common>
</view>
</template>
<script>
const app = getApp();
import componentCommon from '@/components/common/common';
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,
nav_status_list: [
{ name: this.$t('common.all'), value: "-1" },
{ name: this.$t('order.order.pjb15r'), value: "1" },
{ name: this.$t('order.order.s8g966'), value: "2" },
{ name: this.$t('order.order.q820hx'), value: "3" },
{ name: this.$t('order.order.15lr5l'), value: "4" },
{ name: this.$t('detail.detail.32171c'), value: "5,6" },
],
nav_status_index: 0,
content_list: [
{ name: this.$t('order-detail.order-detail.36op8f'), field: "order_no" },
{ name: this.$t('order-detail.order-detail.x3ge6c'), field: "total_price" },
{ name: this.$t('user-order-detail.user-order-detail.23qj7m'), field: "order_pay_status_name" },
{ name: this.$t('order.order.330m76'), field: "order_client_type_name" },
{ name: this.$t('order-detail.order-detail.9153qn'), field: "add_time" },
],
};
},
components: {
componentCommon,
componentNoData,
componentBottomLine,
},
onLoad(params) {
// 调用公共事件方法
app.globalData.page_event_onload_handle(params);
// 是否指定状态
var nav_status_index = 0;
if ((params.status || null) != null) {
for (var i in this.nav_status_list) {
if (this.nav_status_list[i]["value"] == params.status) {
nav_status_index = i;
break;
}
}
}
this.setData({
params: params,
nav_status_index: nav_status_index,
});
this.init();
},
onShow() {
// 调用公共事件方法
app.globalData.page_event_onshow_handle();
// 公共onshow事件
if ((this.$refs.common || null) != null) {
this.$refs.common.on_show();
}
// 分享菜单处理
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) {
this.get_data_list();
} 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,
});
// 加载loding
if(this.data_page > 1) {
uni.showLoading({
title: this.$t('common.loading_in_text'),
});
}
// 参数
var order_status = (this.nav_status_list[this.nav_status_index] || null) == null ? -1 : this.nav_status_list[this.nav_status_index]["value"];
// 获取数据
uni.request({
url: app.globalData.get_request_url("index", "order", "distribution"),
method: "POST",
data: {
page: this.data_page,
status: order_status,
uid: this.params.uid || 0,
is_more: 1,
},
dataType: "json",
success: (res) => {
if(this.data_page > 1) {
uni.hideLoading();
}
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: () => {
if(this.data_page > 1) {
uni.hideLoading();
}
uni.stopPullDownRefresh();
this.setData({
data_list_loding_status: 2,
data_is_loading: 0,
});
app.globalData.showToast(this.$t('common.internet_error_tips'));
},
});
},
// 滚动加载
scroll_lower(e) {
this.get_data_list();
},
// 导航事件
nav_event(e) {
this.setData({
nav_status_index: e.currentTarget.dataset.index || 0,
data_page: 1,
data_list: [],
data_list_loding_status: 1,
data_bottom_line_status: false
});
this.get_data_list(1);
},
// 头像查看
avatar_event(e) {
var value = e.currentTarget.dataset.value || null;
if (value != null) {
uni.previewImage({
current: value,
urls: [value],
});
} else {
app.globalData.showToast(this.$t('order.order.p3scy0'));
}
},
// url事件
url_event(e) {
app.globalData.url_event(e);
}
},
};
</script>
<style>
@import "./order.css";
</style>

View File

@@ -0,0 +1,10 @@
.share .title {
border-style: solid;
border-width: 0 0 0 3px;
}
.submit-double .item {
width: 48%;
}
.submit-double .item button {
width: 46%;
}

View File

@@ -0,0 +1,225 @@
<template>
<view :class="theme_view">
<view v-if="user_share_poster != null || user_share_qrode != null || user_share_url != null" class="padding-main">
<!-- 海报 -->
<view v-if="user_share_poster != null" class="share qrcode padding-main border-radius-main bg-white spacing-mb">
<view class="title border-color-main padding-left-lg text-size fw-b">{{$t('poster.poster.rbdj4b')}}</view>
<view class="cr-grey br-b padding-vertical-main">{{$t('poster.poster.m54q3e')}}</view>
<view class="margin-top-lg">
<image :src="user_share_poster" class="wh-auto dis-block radius" mode="widthFix"></image>
</view>
<view class="submit-double oh margin-top-lg">
<button class="fl item bg-white cr-green br-green round" type="default" hover-class="none" size="mini" :data-value="user_share_poster" @tap="images_show_event">{{$t('poster.poster.b5i123')}}</button>
<view class="fr item">
<button class="bg-white cr-main br-main round" type="default" hover-class="none" size="mini" @tap="poster_refresh_event">{{$t('poster.poster.hk8c9p')}}</button>
<button class="fr bg-white cr-base br-base round" type="default" hover-class="none" size="mini" @tap="share_event">{{$t('common.share')}}</button>
</view>
</view>
</view>
<!-- 二维码 -->
<view v-if="user_share_qrode != null" class="share qrcode padding-main border-radius-main bg-white spacing-mb">
<view class="title border-color-main padding-left-lg text-size fw-b">{{$t('poster.poster.9y4bwq')}}</view>
<view class="cr-grey br-b padding-vertical-main">{{$t('poster.poster.h212v8')}}</view>
<view class="margin-top-lg">
<image :src="user_share_qrode" class="wh-auto dis-block radius" mode="widthFix"></image>
</view>
<view class="margin-top-lg">
<button class="dis-block wh-auto bg-white cr-green br-green round" type="default" size="mini" hover-class="none" @tap="images_show_event" :data-value="user_share_qrode">{{$t('poster.poster.j3qv45')}}</button>
</view>
</view>
<!-- 链接 -->
<view v-if="user_share_url != null" class="share url padding-main border-radius-main bg-white spacing-mb">
<view class="title border-color-main padding-left-lg text-size fw-b">{{$t('poster.poster.r534xd')}}</view>
<view class="cr-grey br-b padding-vertical-main">{{$t('poster.poster.vn36y7')}}</view>
<view class="cr-main text-size margin-top-lg">{{ user_share_url }}</view>
<view class="margin-top-lg">
<button class="dis-block wh-auto bg-white cr-green br-green round" type="default" size="mini" hover-class="none" @tap="url_event" :data-value="user_share_url">{{$t('poster.poster.673605')}}</button>
</view>
</view>
<!-- 结尾 -->
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
<!-- 分享弹窗 -->
<component-share-popup ref="share"></component-share-popup>
</view>
<view v-else>
<!-- 提示信息 -->
<component-no-data :propStatus="data_list_loding_status"></component-no-data>
</view>
<!-- 公共 -->
<component-common ref="common"></component-common>
</view>
</template>
<script>
const app = getApp();
import componentCommon from '@/components/common/common';
import componentNoData from "@/components/no-data/no-data";
import componentBottomLine from "@/components/bottom-line/bottom-line";
import componentSharePopup from "@/components/share-popup/share-popup";
export default {
data() {
return {
theme_view: app.globalData.get_theme_value_view(),
data_list_loding_status: 1,
data_list_loding_msg: this.$t('common.loading_in_text'),
data_bottom_line_status: false,
user_share_poster: null,
user_share_qrode: null,
user_share_url: null,
};
},
components: {
componentCommon,
componentNoData,
componentBottomLine,
componentSharePopup
},
onLoad(params) {
// 调用公共事件方法
app.globalData.page_event_onload_handle(params);
// 加载数据
this.init();
},
onShow() {
// 调用公共事件方法
app.globalData.page_event_onshow_handle();
// 公共onshow事件
if ((this.$refs.common || null) != null) {
this.$refs.common.on_show();
}
// 分享菜单处理
app.globalData.page_share_handle();
},
// 下拉刷新
onPullDownRefresh() {
this.init();
},
methods: {
init() {
this.setData({
data_list_loding_status: 1,
});
uni.request({
url: app.globalData.get_request_url("index", "poster", "distribution"),
method: "POST",
data: {},
dataType: "json",
success: (res) => {
uni.stopPullDownRefresh();
if (res.data.code == 0) {
var data = res.data.data;
this.setData({
user_share_poster: data.user_share_poster || null,
user_share_qrode: data.user_share_qrode || null,
user_share_url: data.user_share_url || null,
data_list_loding_status: 3,
data_bottom_line_status: true,
data_list_loding_msg: "",
});
// 是否全部没数据
if (this.user_share_poster == null && this.user_share_qrode == null && this.user_share_url == null) {
this.setData({
data_list_loding_status: 0,
data_bottom_line_status: false,
});
}
} else {
this.setData({
data_list_loding_status: 2,
data_bottom_line_status: false,
data_list_loding_msg: res.data.msg,
});
if (app.globalData.is_login_check(res.data, this, "init")) {
app.globalData.showToast(res.data.msg);
}
}
},
fail: () => {
uni.stopPullDownRefresh();
this.setData({
data_list_loding_status: 2,
data_bottom_line_status: false,
data_list_loding_msg: this.$t('common.internet_error_tips'),
});
app.globalData.showToast(this.$t('common.internet_error_tips'));
},
});
},
// 刷新海报
poster_refresh_event(e) {
uni.showLoading({
title: this.$t('common.processing_in_text'),
});
uni.request({
url: app.globalData.get_request_url("refresh", "poster", "distribution"),
method: "POST",
data: {},
dataType: "json",
success: (res) => {
uni.hideLoading();
if (res.data.code == 0) {
this.setData({
user_share_poster: res.data.data,
});
app.globalData.showToast(res.data.msg, "success");
} else {
if (app.globalData.is_login_check(res.data, self, "init")) {
app.globalData.showToast(res.data.msg);
}
}
},
fail: () => {
uni.hideLoading();
app.globalData.showToast(this.$t('common.internet_error_tips'));
},
});
},
// 图片查看事件
images_show_event(e) {
var value = e.currentTarget.dataset.value || null;
if (value != null) {
uni.previewImage({
current: value,
urls: [value],
});
} else {
app.globalData.showToast(this.$t('poster.poster.eu3j21'));
}
},
// url事件
url_event(e) {
app.globalData.text_copy_event(e);
},
// 分享事件
share_event(e) {
if ((this.$refs.share || null) != null) {
this.$refs.share.init({
type: 2,
images: this.user_share_poster || this.user_share_qrode
});
}
}
},
};
</script>
<style>
@import "./poster.css";
</style>

View File

@@ -0,0 +1,140 @@
<template>
<view :class="theme_view">
<block v-if="detail != null">
<view class="padding-horizontal-main padding-top-main">
<view v-if="detail_list.length > 0" class="panel-item padding-main border-radius-main bg-white spacing-mb">
<view class="panel-content oh">
<view v-for="(item, index) in detail_list" :key="index" class="item br-b-dashed oh padding-vertical-main">
<view class="title fl padding-right-main cr-grey">{{ item.name }}</view>
<view class="content fl br-l padding-left-main">{{ item.value }}</view>
</view>
</view>
</view>
</view>
<!-- 结尾 -->
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
</block>
<block v-else>
<!-- 提示信息 -->
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
</block>
<!-- 公共 -->
<component-common ref="common"></component-common>
</view>
</template>
<script>
const app = getApp();
import componentCommon from '@/components/common/common';
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(),
params: null,
data_list_loding_status: 1,
data_list_loding_msg: "",
data_bottom_line_status: false,
detail: null,
detail_list: [],
};
},
components: {
componentCommon,
componentNoData,
componentBottomLine,
},
onLoad(params) {
// 调用公共事件方法
app.globalData.page_event_onload_handle(params);
// 设置参数
this.setData({
params: params,
});
this.init();
},
onShow() {
// 调用公共事件方法
app.globalData.page_event_onshow_handle();
// 公共onshow事件
if ((this.$refs.common || null) != null) {
this.$refs.common.on_show();
}
// 分享菜单处理
app.globalData.page_share_handle();
},
// 下拉刷新
onPullDownRefresh() {
this.init();
},
methods: {
init() {
this.setData({
data_list_loding_status: 1,
});
uni.request({
url: app.globalData.get_request_url("detail", "profit", "distribution"),
method: "POST",
data: {
id: this.params.id,
},
dataType: "json",
success: (res) => {
uni.stopPullDownRefresh();
if (res.data.code == 0) {
var data = res.data.data;
this.setData({
detail: data.data,
detail_list: [
{ name: this.$t('order-detail.order-detail.x3ge6c'), value: data.data.total_price || "" },
{ name: this.$t('order-detail.order-detail.v52n5r'), value: data.data.refund_price || "" },
{ name: this.$t('profit.profit.utg512'), value: data.data.profit_price || "" },
{ name: this.$t('profit.profit.6a7t71'), value: data.data.level_name || "" },
{ name: this.$t('profit-detail.profit-detail.kn8yye'), value: data.data.status_name || "" },
{ name: this.$t('user-order-detail.user-order-detail.yxwu8n'), value: data.data.order_status_name || "" },
{ name: this.$t('profit-detail.profit-detail.x28rw5'), value: data.data.order_pay_status_name || "" },
{ name: this.$t('order.order.330m76'), value: data.data.order_client_type_name || "" },
{ name: this.$t('common.add_time'), value: data.data.add_time || "" },
{ name: this.$t('common.upd_time'), value: data.data.upd_time || "" },
],
data_list_loding_status: 3,
data_bottom_line_status: true,
data_list_loding_msg: "",
});
} else {
this.setData({
data_list_loding_status: 2,
data_bottom_line_status: false,
data_list_loding_msg: res.data.msg,
});
if (app.globalData.is_login_check(res.data, this, "init")) {
app.globalData.showToast(res.data.msg);
}
}
},
fail: () => {
uni.stopPullDownRefresh();
this.setData({
data_list_loding_status: 2,
data_bottom_line_status: false,
data_list_loding_msg: this.$t('common.internet_error_tips'),
});
app.globalData.showToast(this.$t('common.internet_error_tips'));
},
});
},
},
};
</script>
<style></style>

View File

@@ -0,0 +1,6 @@
/*
* 导航
*/
.nav-base .item {
width: 20%;
}

View File

@@ -0,0 +1,262 @@
<template>
<view :class="theme_view">
<!-- 导航 -->
<view class="nav-base bg-white">
<view v-for="(item, index) in nav_status_list" :key="index">
<view :class="'item fl tc ' + (nav_status_index == index ? 'cr-main nav-active-line' : '')" :data-index="index" @tap="nav_event">{{ item.name }}</view>
</view>
</view>
<!-- 列表 -->
<scroll-view :scroll-y="true" class="scroll-box scroll-box-ece-nav" @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">
<text class="cr-base">{{ item.add_time }}</text>
<text class="fr cr-main">{{ item.status_name }}</text>
</view>
<view :data-value="'/pages/plugins/distribution/profit-detail/profit-detail?id=' + item.id" @tap="url_event" class="content margin-top cp">
<view v-for="(fv, fi) in content_list" :key="fi">
<view class="single-text margin-top-xs">
<text class="cr-grey margin-right-xl">{{ fv.name }}</text>
<text class="cr-base">{{ item[fv.field] }}</text>
<text v-if="(fv.unit || null) != null" class="cr-grey">{{ fv.unit }}</text>
</view>
</view>
</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>
<!-- 公共 -->
<component-common ref="common"></component-common>
</view>
</template>
<script>
const app = getApp();
import componentCommon from '@/components/common/common';
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,
nav_status_list: [
{ name: this.$t('common.all'), value: "-1" },
{ name: this.$t('profit.profit.3c7zmg'), value: "0" },
{ name: this.$t('profit.profit.67o785'), value: "1" },
{ name: this.$t('profit.profit.l5knxu'), value: "2" },
{ name: this.$t('detail.detail.32171c'), value: "3" },
],
nav_status_index: 0,
content_list: [
{ name: this.$t('order-detail.order-detail.x3ge6c'), field: "total_price" },
{ name: this.$t('order-detail.order-detail.v52n5r'), field: "refund_price" },
{ name: this.$t('profit.profit.utg512'), field: "profit_price" },
{ name: this.$t('profit.profit.6a7t71'), field: "level_name" },
],
};
},
components: {
componentCommon,
componentNoData,
componentBottomLine,
},
onLoad(params) {
// 调用公共事件方法
app.globalData.page_event_onload_handle(params);
// 是否指定状态
var nav_status_index = 0;
if ((params.status || null) != null) {
for (var i in this.nav_status_list) {
if (this.nav_status_list[i]["value"] == params.status) {
nav_status_index = i;
break;
}
}
}
this.setData({
params: params,
nav_status_index: nav_status_index,
});
this.init();
},
onShow() {
// 调用公共事件方法
app.globalData.page_event_onshow_handle();
// 公共onshow事件
if ((this.$refs.common || null) != null) {
this.$refs.common.on_show();
}
// 分享菜单处理
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) {
this.get_data_list();
} 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,
});
// 加载loding
if(this.data_page > 1) {
uni.showLoading({
title: this.$t('common.loading_in_text'),
});
}
// 获取数据
var status = (this.nav_status_list[this.nav_status_index] || null) == null ? -1 : this.nav_status_list[this.nav_status_index]["value"];
uni.request({
url: app.globalData.get_request_url("index", "profit", "distribution"),
method: "POST",
data: {
page: this.data_page,
status: status,
is_more: 1,
},
dataType: "json",
success: (res) => {
if(this.data_page > 1) {
uni.hideLoading();
}
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: () => {
if(this.data_page > 1) {
uni.hideLoading();
}
uni.stopPullDownRefresh();
this.setData({
data_list_loding_status: 2,
data_is_loading: 0,
});
app.globalData.showToast(this.$t('common.internet_error_tips'));
},
});
},
// 滚动加载
scroll_lower(e) {
this.get_data_list();
},
// 导航事件
nav_event(e) {
this.setData({
nav_status_index: e.currentTarget.dataset.index || 0,
data_page: 1,
data_list: [],
data_list_loding_status: 1,
data_bottom_line_status: false
});
this.get_data_list(1);
},
// url事件
url_event(e) {
app.globalData.url_event(e);
}
},
};
</script>
<style>
@import "./profit.css";
</style>

View File

@@ -0,0 +1,14 @@
/*
* 导航
*/
.nav-base .item {
width: 33.33%;
}
/*
* 列表
*/
.data-list .item .base .avatar {
width: 40rpx;
height: 40rpx !important;
}

View File

@@ -0,0 +1,276 @@
<template>
<view :class="theme_view">
<!-- 导航 -->
<view class="nav-base bg-white">
<view v-for="(item, index) in nav_type_list" :key="index">
<view :class="'item fl tc ' + (nav_type_index == index ? 'cr-main nav-active-line' : 'cr-grey')" :data-index="index" @tap="nav_event">{{ item.name }}</view>
</view>
</view>
<!-- 列表 -->
<scroll-view :scroll-y="true" class="scroll-box scroll-box-ece-nav" @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">
<image class="avatar dis-block fl circle" :src="item.avatar" mode="widthFix" @tap="avatar_event" :data-value="item.avatar"></image>
<text class="cr-base margin-left-sm">{{ item.user_name_view || "" }}</text>
<text class="cr-base fr">{{ item.order_status_name }}</text>
</view>
<view :data-value="'/pages/plugins/distribution/order-detail/order-detail?id=' + item.id" @tap="url_event" class="content margin-top cp">
<view v-for="(fv, fi) in content_list" :key="fi">
<view class="single-text margin-top-xs">
<text class="cr-grey margin-right-xl">{{ fv.name }}</text>
<text class="cr-base">{{ item[fv.field] }}</text>
<text v-if="(fv.unit || null) != null" class="cr-grey">{{ fv.unit }}</text>
</view>
</view>
</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>
<!-- 公共 -->
<component-common ref="common"></component-common>
</view>
</template>
<script>
const app = getApp();
import componentCommon from '@/components/common/common';
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,
nav_type_list: [
{ name: this.$t('promotion-order.promotion-order.6rs63v'), value: 0 },
{ name: this.$t('promotion-order.promotion-order.iwa646'), value: 1 },
{ name: this.$t('promotion-order.promotion-order.2p5215'), value: 2 },
],
nav_type_index: 0,
content_list: [
{ name: this.$t('order-detail.order-detail.36op8f'), field: "order_no" },
{ name: this.$t('order-detail.order-detail.x3ge6c'), field: "total_price" },
{ name: this.$t('user-order-detail.user-order-detail.23qj7m'), field: "order_pay_status_name" },
{ name: this.$t('order.order.330m76'), field: "order_client_type_name" },
{ name: this.$t('order-detail.order-detail.9153qn'), field: "add_time" },
],
};
},
components: {
componentCommon,
componentNoData,
componentBottomLine,
},
onLoad(params) {
// 调用公共事件方法
app.globalData.page_event_onload_handle(params);
// 是否指定状态
var nav_type_index = 0;
if (params.type != undefined) {
for (var i in this.nav_type_list) {
if (this.nav_type_list[i]["value"] == params.type) {
nav_type_index = i;
break;
}
}
}
this.setData({
params: params,
nav_type_index: nav_type_index,
});
this.init();
},
onShow() {
// 调用公共事件方法
app.globalData.page_event_onshow_handle();
// 公共onshow事件
if ((this.$refs.common || null) != null) {
this.$refs.common.on_show();
}
// 分享菜单处理
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) {
this.get_data_list();
} 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,
});
// 加载loding
if(this.data_page > 1) {
uni.showLoading({
title: this.$t('common.loading_in_text'),
});
}
// 请求参数
var type = (this.nav_type_list[this.nav_type_index] || null) == null ? -1 : this.nav_type_list[this.nav_type_index]["value"];
var data = this.params;
data['page'] = this.data_page;
data['type'] = type;
// 获取数据
uni.request({
url: app.globalData.get_request_url("index", "promotionorder", "distribution"),
method: "POST",
data: data,
dataType: "json",
success: (res) => {
if(this.data_page > 1) {
uni.hideLoading();
}
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: () => {
if(this.data_page > 1) {
uni.hideLoading();
}
uni.stopPullDownRefresh();
this.setData({
data_list_loding_status: 2,
data_is_loading: 0,
});
app.globalData.showToast(this.$t('common.internet_error_tips'));
},
});
},
// 滚动加载
scroll_lower(e) {
this.get_data_list();
},
// 导航事件
nav_event(e) {
this.setData({
nav_type_index: e.currentTarget.dataset.index || 0,
data_page: 1,
data_list: [],
data_list_loding_status: 1,
data_bottom_line_status: false
});
this.get_data_list(1);
},
// 头像查看
avatar_event(e) {
var value = e.currentTarget.dataset.value || null;
if (value != null) {
uni.previewImage({
current: value,
urls: [value],
});
} else {
app.globalData.showToast(this.$t('order.order.p3scy0'));
}
},
// url事件
url_event(e) {
app.globalData.url_event(e);
}
},
};
</script>
<style>
@import "./promotion-order.css";
</style>

View File

@@ -0,0 +1,17 @@
/*
* 列表
*/
.data-list .item .base .avatar {
width: 40rpx;
height: 40rpx !important;
}
/*
* 隐藏滚动条
*/
scroll-view ::-webkit-scrollbar {
display: none;
width: 0;
height: 0;
color: transparent;
}

View File

@@ -0,0 +1,310 @@
<template>
<view :class="theme_view">
<!-- 导航 -->
<view class="nav-base bg-white scroll-view-horizontal padding-horizontal-main">
<scroll-view :scroll-x="true" :show-scrollbar="false" :scroll-with-animation="true" :scroll-into-view="'one-nav-item-' + nav_type_index" class="top-nav-scroll">
<block v-for="(item, index) in nav_type_list" :key="index">
<view :class="'item dis-inline-block margin-right-lg ' + (nav_type_index == index ? 'cr-main nav-active-line' : 'cr-grey')" :id="'one-nav-item-' + index" :data-index="index" @tap="nav_event">{{ item.name }}</view>
</block>
</scroll-view>
</view>
<!-- 数据列表 -->
<scroll-view :scroll-y="true" class="scroll-box scroll-box-ece-nav" @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">
<image class="avatar dis-block fl circle" :src="item.avatar" mode="widthFix" @tap="avatar_event" :data-value="item.avatar"></image>
<text class="cr-base margin-left-sm">{{ item.user_name_view || "" }}</text>
<text class="cr-base fr">{{ item.add_time }}</text>
</view>
<view class="content margin-top">
<block v-for="(fv, fi) in content_list" :key="fi">
<view class="single-text margin-top-xs">
<text class="cr-grey margin-right-xl">{{ fv.name }}</text>
<text class="cr-base" :data-event="fv.event" :data-value="item[fv.field]" @tap="text_event">{{ item[fv.field] || fv.default }}</text>
<text v-if="(fv.unit || null) != null" class="cr-grey">{{ fv.unit }}</text>
</view>
</block>
</view>
<view class="item-operation tr br-t padding-top-main margin-top-main">
<button v-if="(item.email || null) != null" class="round bg-white br cr-base" type="default" size="mini" hover-class="none" @tap="text_event" data-event="copy" :data-value="item.email">{{$t('login.login.p54kf1')}}</button>
<button v-if="(item.mobile || null) != null" class="round bg-white br cr-base" type="default" size="mini" hover-class="none" @tap="text_event" data-event="tel" :data-value="item.mobile">{{$t('promotion-user.promotion-user.62c8m1')}}</button>
<button class="round bg-white br cr-base" type="default" size="mini" hover-class="none" @tap="user_order_event" :data-value="item.id">{{$t('promotion-user.promotion-user.i2rf31')}}</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>
<!-- 公共 -->
<component-common ref="common"></component-common>
</view>
</template>
<script>
const app = getApp();
import componentCommon from '@/components/common/common';
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,
nav_type_list: [
{ name: this.$t('promotion-user.promotion-user.o6qi74'), value: 0 },
{ name: this.$t('promotion-user.promotion-user.kx7595'), value: 1 },
{ name: this.$t('promotion-user.promotion-user.2ey5t1'), value: 2 },
{ name: this.$t('promotion-user.promotion-user.852zib'), value: 3 },
{ name: this.$t('promotion-user.promotion-user.h8mx3e'), value: 4 },
{ name: this.$t('promotion-user.promotion-user.fvbq25'), value: 5 },
],
// 导航下标
nav_type_index: 0,
content_list: [
{ name: this.$t('promotion-user.promotion-user.2g7enc'), field: "order_count", unit: "", default: 0 },
{ name: this.$t('promotion-user.promotion-user.32bf15'), field: "order_total", unit: "", default: 0 },
{ name: this.$t('promotion-user.promotion-user.76748p'), field: "order_last_time", default: "" },
{ name: this.$t('promotion-user.promotion-user.u43380'), field: "find_order_count", unit: "", default: 0 },
{ name: this.$t('promotion-user.promotion-user.8n4tr3'), field: "find_order_total", unit: "", default: 0 },
{ name: this.$t('promotion-user.promotion-user.1gc3ny'), field: "find_order_last_time", default: "" },
{ name: this.$t('promotion-user.promotion-user.3l1187'), field: "referrer_count", unit: "", default: 0 },
],
nav_search_buy_type_list: [
{ value: -1, name: this.$t('common.all') },
{ value: 0, name: this.$t('promotion-user.promotion-user.g5332w') },
{ value: 1, name: this.$t('promotion-user.promotion-user.8i641g') },
],
nav_search_value: {
team_search_user_time_start: "",
team_search_user_time_end: "",
team_search_user_time_reverse: [],
team_search_order_time_start: "",
team_search_order_time_end: "",
team_search_order_time_reverse: [],
team_search_buy_type: [],
},
};
},
components: {
componentCommon,
componentNoData,
componentBottomLine,
},
onLoad(params) {
// 调用公共事件方法
app.globalData.page_event_onload_handle(params);
// 是否指定状态
var nav_type_index = 0;
if (params.type != undefined) {
for (var i in this.nav_type_list) {
if (this.nav_type_list[i]["value"] == params.type) {
nav_type_index = i;
break;
}
}
}
this.setData({
params: params,
nav_type_index: nav_type_index,
});
this.init();
},
onShow() {
// 调用公共事件方法
app.globalData.page_event_onshow_handle();
// 公共onshow事件
if ((this.$refs.common || null) != null) {
this.$refs.common.on_show();
}
// 分享菜单处理
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) {
this.get_data_list();
} 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,
});
// 加载loding
if(this.data_page > 1) {
uni.showLoading({
title: this.$t('common.loading_in_text'),
});
}
// 请求参数
var type = (this.nav_type_list[this.nav_type_index] || null) == null ? 0 : this.nav_type_list[this.nav_type_index]["value"];
var data = this.params;
data['page'] = this.data_page;
data['type'] = type;
// 获取数据
uni.request({
url: app.globalData.get_request_url("index", "promotionuser", "distribution"),
method: "POST",
data: data,
dataType: "json",
success: (res) => {
if(this.data_page > 1) {
uni.hideLoading();
}
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: () => {
if(this.data_page > 1) {
uni.hideLoading();
}
uni.stopPullDownRefresh();
this.setData({
data_list_loding_status: 2,
data_is_loading: 0,
});
app.globalData.showToast(this.$t('common.internet_error_tips'));
},
});
},
// 滚动加载
scroll_lower(e) {
this.get_data_list();
},
// 头像查看
avatar_event(e) {
var value = e.currentTarget.dataset.value || null;
if (value != null) {
uni.previewImage({
current: value,
urls: [value],
});
} else {
app.globalData.showToast(this.$t('order.order.p3scy0'));
}
},
// 用户订单事件
user_order_event(e) {
var value = e.currentTarget.dataset.value;
app.globalData.url_open('/pages/plugins/distribution/order/order?uid=' + value);
},
// 导航事件
nav_event(e) {
this.setData({
nav_type_index: e.currentTarget.dataset.index || 0,
data_page: 1,
data_list: [],
data_list_loding_status: 1,
data_bottom_line_status: false
});
this.get_data_list(1);
},
// 文本事件
text_event(e) {
app.globalData.text_event_handle(e);
}
},
};
</script>
<style>
@import "./promotion-user.css";
</style>

View File

@@ -0,0 +1,66 @@
/**
* 基础
*/
.base-container .icon {
width: 50rpx;
height: 50rpx;
}
.base-container .title {
width: calc(100% - 240rpx);
}
.base-container .share-submit {
line-height: 50rpx;
height: 50rpx;
}
/**
* 商品列表
*/
.data-list .item .goods-img {
width:170rpx;
height: 170rpx !important;
}
.data-list .item .right-base {
width: calc(100% - 190rpx);
}
.data-list .item .spec-text {
width: calc(100% - 240rpx);
}
/**
* 数量操作
*/
.data-list .item .number-content {
right: 20rpx;
bottom: 20rpx;
border: 1px solid #f0f0f0;
}
.data-list .item .number-content .number-submit {
width: 60rpx;
font-weight: bold;
}
.data-list .item .number-content input {
width: 50px;
border-width: 0 1px 0 1px;
border-style: solid;
border-color: #f0f0f0;
}
.data-list .item .number-content .number-submit,
.data-list .item .number-content input {
padding: 0;
height: 50rpx;
line-height: 50rpx;
}
/**
* 导航
*/
.nav-button {
box-shadow: 0 -2px 6px #e2e2e2;
}
.nav-button .left-price {
width: calc(100% - 270rpx);
}
.nav-button .right-button {
width: 250rpx;
}

View File

@@ -0,0 +1,381 @@
<template>
<view :class="theme_view">
<view v-if="(data || null) != null" class="page-bottom-fixed">
<view class="padding-horizontal-main padding-top-main">
<!-- 基础信息 -->
<view class="base-container oh spacing-mb">
<image v-if="(data.icon || null) != null" class="dis-inline-block round br va-m margin-right-sm icon" :src="data.icon" mode="aspectFit"></image>
<view class="text-size cr-base fw dis-inline-block va-m title">{{ data.title }}</view>
<button class="round bg-white br-green cr-green fr share-submit" type="default" size="mini" hover-class="none" @tap="share_event" :data-index="index">
<view class="dis-inline-block va-m">
<uni-icons type="redo" size="34rpx" color="#1AAD19"></uni-icons>
</view>
<text class="va-m">{{$t('common.share')}}</text>
</button>
</view>
<view v-if="(data.detail_list || null) != null && data.detail_list.length > 0">
<!-- 商品 -->
<view class="data-list oh">
<view v-for="(item, index) in data.detail_list" :key="index" :class="'item padding-main border-radius-main bg-white oh pr spacing-mb ' + (item.goods.is_error == 0 ? '' : 'br-red')">
<image class="goods-img dis-block border-radius-main fl" :src="item.goods.images" mode="aspectFit" :data-value="item.goods.goods_url" @tap="url_event"></image>
<view class="right-base fr">
<label v-if="item.goods.is_error == 0" class="fr" :data-index="index" @tap="goods_choice_event">
<radio :checked="item.checked == undefined || item.checked == true" style="transform: scale(0.9)" />
</label>
<view class="single-text padding-right">{{ item.goods.title }}</view>
<view class="single-text margin-top-lg">
<text class="sales-price">{{ currency_symbol }}{{ item.goods.price }}</text>
<text v-if="item.goods.original_price != 0" class="original-price margin-left-sm">{{ currency_symbol }}{{ item.goods.original_price }}</text>
<text class="cr-grey text-size-xs fr">{{ item.goods.inventory }}{{ item.goods.inventory_unit }}</text>
</view>
<view class="margin-top-sm">
<view v-if="item.goods.is_error == 0">
<view v-if="(item.spec_text_view || null) != null" class="cr-grey text-size-xs spec-text">{{ item.spec_text_view }}</view>
<view class="number-content tc oh round pa">
<view class="number-submit tc cr-grey fl va-m" data-type="0" :data-index="index" @tap="goods_buy_number_event">-</view>
<input class="tc cr-grey bg-white fl va-m radius-0" type="number" :value="item.stock || item.goods.buy_min_number || 1" :data-index="index" @blur="goods_buy_number_blur" />
<view class="number-submit tc cr-grey fl va-m" data-type="1" :data-index="index" @tap="goods_buy_number_event">+</view>
</view>
</view>
<view v-else class="cr-red text-size-xs tr margin-top-xxl">{{ item.goods.error_msg }}</view>
</view>
</view>
</view>
</view>
<!-- 导航 -->
<view class="nav-button bg-white pf pa-w bottom-0 left-0 right-0 wh-auto">
<view class="padding-main">
<view class="oh">
<view class="left-price fl">
<view class="sales-price single-text margin-top-sm">{{ currency_symbol }}{{ data.total_price }}</view>
</view>
<view class="right-button fr tr">
<button type="default" size="mini" class="bg-main br-main cr-white round dis-block text-size-sm" @tap="buy_event">{{$t('detail.detail.27pmj3')}}</button>
</view>
</view>
</view>
</view>
</view>
<view v-else>
<!-- 提示信息 -->
<component-no-data propStatus="0" :propMsg="$t('detail.detail.5knxg6')"></component-no-data>
</view>
</view>
<!-- 结尾 -->
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
<!-- 分享弹窗 -->
<component-share-popup ref="share"></component-share-popup>
</view>
<view v-else>
<!-- 提示信息 -->
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
</view>
<!-- 公共 -->
<component-common ref="common"></component-common>
</view>
</template>
<script>
const app = getApp();
import base64 from '@/common/js/lib/base64.js';
import componentCommon from '@/components/common/common';
import componentNoData from '@/components/no-data/no-data';
import componentBottomLine from '@/components/bottom-line/bottom-line';
import componentSharePopup from '@/components/share-popup/share-popup';
export default {
data() {
return {
theme_view: app.globalData.get_theme_value_view(),
data_bottom_line_status: false,
data_list_loding_status: 1,
data_list_loding_msg: '',
currency_symbol: app.globalData.currency_symbol(),
params: null,
user: null,
data_base: null,
data: null,
// 自定义分享信息
share_info: {},
};
},
components: {
componentCommon,
componentNoData,
componentBottomLine,
componentSharePopup,
},
onLoad(params) {
// 调用公共事件方法
app.globalData.page_event_onload_handle(params);
// 设置参数
this.setData({
params: params,
});
},
onShow() {
// 调用公共事件方法
app.globalData.page_event_onshow_handle();
// 初始化配置
this.init_config();
// 获取数据
this.get_data();
// 公共onshow事件
if ((this.$refs.common || null) != null) {
this.$refs.common.on_show();
}
},
// 下拉刷新
onPullDownRefresh() {
this.get_data();
},
methods: {
// 初始化配置
init_config(status) {
if ((status || false) == true) {
this.setData({
currency_symbol: app.globalData.get_config('currency_symbol'),
});
} else {
app.globalData.is_config(this, 'init_config');
}
},
// 获取数据
get_data() {
uni.request({
url: app.globalData.get_request_url('detail', 'recommend', 'distribution'),
method: 'POST',
data: {
id: this.params.id || 0,
},
dataType: 'json',
success: (res) => {
uni.stopPullDownRefresh();
if (res.data.code == 0) {
var data = res.data.data;
this.setData({
data: data || null,
data_list_loding_msg: '',
data_list_loding_status: 0,
data_bottom_line_status: (data || null) != null,
});
if ((this.data || null) != null) {
// 基础自定义分享
this.setData({
share_info: {
title: this.data.seo_title || this.data.title,
desc: this.data.seo_desc || this.data.describe,
path: '/pages/plugins/distribution/recommend-detail/recommend-detail',
query: 'id=' + this.data.id,
img: this.data.icon || '',
},
});
// 标题
if ((this.data.title || null) != null) {
uni.setNavigationBarTitle({
title: this.data.title,
});
}
}
} else {
this.setData({
data_bottom_line_status: false,
data_list_loding_status: 2,
data_list_loding_msg: res.data.msg,
});
}
// 分享菜单处理
app.globalData.page_share_handle(this.share_info);
},
fail: () => {
uni.stopPullDownRefresh();
this.setData({
data_bottom_line_status: false,
data_list_loding_status: 2,
data_list_loding_msg: this.$t('common.internet_error_tips'),
});
app.globalData.showToast(this.$t('common.internet_error_tips'));
},
});
},
// url事件
url_event(e) {
app.globalData.url_event(e);
},
// 商品选择事件
goods_choice_event(e) {
// 选择处理
var index = e.currentTarget.dataset.index || 0;
var temp_data = this.data;
var detail_list = temp_data.detail_list;
detail_list[index]['checked'] = detail_list[index]['checked'] == undefined || detail_list[index]['checked'] == true ? false : true;
temp_data['detail_list'] = detail_list;
this.setData({ data: temp_data });
// 导航总数处理
this.nav_total_handle();
},
// 导航总数处理
nav_total_handle() {
var temp_data = this.data;
var detail_list = temp_data.detail_list;
var total_price = 0;
for (var i in detail_list) {
if ((detail_list[i]['checked'] == undefined || detail_list[i]['checked'] == true) && detail_list[i]['goods']['is_error'] == 0) {
var stock = parseInt(detail_list[i]['stock'] || detail_list[i]['goods']['buy_min_number'] || 1);
total_price += parseFloat(detail_list[i]['goods']['price'] || 0) * stock;
}
}
temp_data['total_price'] = app.globalData.price_two_decimal(total_price);
this.setData({ data: temp_data });
},
// 立即购买
buy_event(e) {
// 是否需要选择商品
var type = parseInt(this.data.type || 0);
var goods_data = [];
var temp_goods = this.data.detail_list;
for (var i in temp_goods) {
if (temp_goods[i]['goods']['is_error'] == 0 && (temp_goods[i]['checked'] == undefined || temp_goods[i]['checked'] == true)) {
goods_data.push({
goods_id: temp_goods[i]['goods']['id'],
stock: temp_goods[i]['stock'] || temp_goods[i]['goods']['buy_min_number'] || 1,
spec: temp_goods[i]['spec'] || '',
});
}
}
var buy_min_number = 1;
if (goods_data.length < buy_min_number) {
app.globalData.showToast(this.$t('detail.detail.jsj3u8') + buy_min_number + this.$t('detail.detail.jksm81'));
return false;
}
// 进入订单确认页面
var data = {
buy_type: 'goods',
goods_data: encodeURIComponent(base64.encode(JSON.stringify(goods_data))),
};
app.globalData.url_open('/pages/buy/buy?data=' + encodeURIComponent(base64.encode(JSON.stringify(data))));
},
// 数量输入事件
goods_buy_number_blur(e) {
var index = e.currentTarget.dataset.index || 0;
var temp_data = this.data;
var detail_list = temp_data.detail_list;
var item = detail_list[index];
var goods = item['goods'];
var number = parseInt(e.detail.value) || 1;
if (isNaN(number)) {
number = goods['buy_min_number'] || 1;
}
this.goods_stock_handle(index, temp_data, detail_list, item, goods, number);
},
// 数量操作事件
goods_buy_number_event(e) {
var type = parseInt(e.currentTarget.dataset.type || 0);
var index = e.currentTarget.dataset.index || 0;
var temp_data = this.data;
var detail_list = temp_data.detail_list;
var item = detail_list[index];
var goods = item['goods'];
var temp_stock = parseInt(item['stock'] || goods['buy_min_number'] || 1);
var number = type == 0 ? temp_stock - 1 : temp_stock + 1;
this.goods_stock_handle(index, temp_data, detail_list, item, goods, number);
},
// 数量处理方法
goods_stock_handle(index, temp_data, detail_list, item, goods, number) {
var buy_min_number = parseInt(goods.buy_min_number || 1);
var buy_max_number = parseInt(goods.buy_max_number || 0);
var inventory = parseInt(goods.inventory || 0);
var inventory_unit = goods.inventory_unit;
// 最小起购数量
if (buy_min_number > 0 && number < buy_min_number) {
number = buy_min_number;
app.globalData.showToast(this.$t('recommend-detail.recommend-detail.265vyu') + buy_min_number + inventory_unit);
}
// 最大购买数量
if (buy_max_number > 0 && number > buy_max_number) {
number = buy_max_number;
app.globalData.showToast(this.$t('goods-category.goods-category.z1eh3v') + buy_max_number + inventory_unit);
}
// 是否超过库存数量
if (number > inventory) {
number = inventory;
app.globalData.showToast(this.$t('recommend-detail.recommend-detail.2sis3v') + inventory + inventory_unit);
}
// 获取数据
var data = this.params;
data['id'] = goods.id;
data['spec'] = item.spec || '';
data['stock'] = number;
uni.request({
url: app.globalData.get_request_url('stock', 'goods'),
method: 'POST',
data: data,
dataType: 'json',
success: (res) => {
if (res.data.code == 0) {
// 基础数据
detail_list[index]['stock'] = number;
detail_list[index]['goods']['price'] = res.data.data.spec_base.price;
detail_list[index]['goods']['original_price'] = res.data.data.spec_base.original_price;
detail_list[index]['goods']['inventory'] = res.data.data.spec_base.inventory;
temp_data['detail_list'] = detail_list;
this.setData({
data: temp_data,
});
// 导航总数处理
this.nav_total_handle();
} else {
app.globalData.showToast(res.data.msg);
}
},
fail: () => {
app.globalData.showToast(this.$t('common.internet_error_tips'));
},
});
},
// 分享开启弹层
share_event(e) {
if ((this.$refs.share || null) != null) {
this.$refs.share.init({
share_info: this.share_info
});
}
},
},
};
</script>
<style>
@import './recommend-detail.css';
</style>

View File

@@ -0,0 +1,36 @@
/**
* 商品列表
*/
.view-goods-list image {
width: 130rpx;
height: 130rpx;
}
.view-goods-list .base {
width: calc(100% - 150rpx);
}
.view-goods-list .operate-submit {
right: 0;
bottom: 0;
}
/**
* 商品选择弹窗
*/
.popup-goods-choice-container .nav-search {
height: 90rpx;
}
.popup-goods-choice-container .nav-search .item {
width: calc(50% - 140rpx);
height: 60rpx;
line-height: 60rpx;
}
.popup-goods-choice-container .nav-search input.item,
.popup-goods-choice-container .nav-search button {
height: 64rpx;
line-height: 64rpx;
}
.popup-goods-choice-container .view-goods-list {
height: 80vh;
overflow-y: scroll;
overflow-x: hidden;
}

View File

@@ -0,0 +1,582 @@
<template>
<view :class="theme_view">
<view class="page-bottom-fixed">
<block v-if="data_list_loding_status == 3">
<form @submit="form_submit" class="form-container">
<view class="padding-main oh">
<view class="form-gorup bg-white form-container-upload oh">
<view class="form-gorup-title">{{$t('recommend-form.recommend-form.57zrl5')}}<text class="form-group-tips">{{$t('recommend-form.recommend-form.3vk50b')}}</text></view>
<view class="form-upload-data oh">
<block v-if="(recommend_data.icon || null) != null">
<view class="item fl">
<text class="delete-icon" @tap="upload_delete_event">x</text>
<image :src="recommend_data.icon" @tap="upload_show_event" mode="aspectFill"></image>
</view>
</block>
<image class="item fl upload-icon" :src="common_static_url + 'upload-icon.png'" mode="aspectFill" @tap="file_upload_event"></image>
</view>
</view>
<view class="form-gorup bg-white">
<view class="form-gorup-title">{{$t('user-detail.user-detail.uy6lrz')}}<text class="form-group-tips-must">*</text></view>
<input type="text" name="title" :value="recommend_data.title || ''" placeholder-class="cr-grey" class="cr-base" :placeholder="$t('recommend-form.recommend-form.q4qr64')" />
</view>
<view class="form-gorup bg-white">
<view class="form-gorup-title">{{$t('form.form.xy87t8')}}</view>
<input type="text" name="describe" :value="recommend_data.describe || ''" placeholder-class="cr-grey" class="cr-base" :placeholder="$t('recommend-form.recommend-form.29au77')" />
</view>
<view class="form-gorup anonymous">
<view class="form-gorup-title">{{$t('form.form.043a10')}}</view>
<switch name="is_enable" style="transform: scale(0.9)" class="margin-top-sm" :checked="recommend_data.is_enable == 1"></switch>
</view>
<view class="form-gorup bg-white">
<view class="form-gorup-title">{{$t('recommend-form.recommend-form.5ws7m3')}}<text class="form-group-tips-must">*</text></view>
<view v-if="(recommend_data.detail_list || null) != null && recommend_data.detail_list.length > 0" class="margin-top-lg view-goods-list">
<block v-for="(item, index) in recommend_data.detail_list" :key="index">
<view v-if="(item.goods || null) != null" :class="'item oh pr ' + (index > 0 ? 'br-t-dashed padding-top-lg margin-top-lg' : '')">
<view :data-value="item.goods.goods_url" @tap="url_event" class="cp br dis-block fl radius oh">
<image :src="item.goods.images" mode="aspectFill" class="dis-block"></image>
</view>
<view class="base fr">
<view class="cr-base single-text">{{ item.goods.title }}</view>
<view class="margin-top-xs">
<text class="sales-price">{{ currency_symbol }}{{ item.goods.price }}</text>
<text class="fr cr-grey">{{ item.goods.inventory }}{{ item.goods.inventory_unit }}</text>
</view>
<view v-if="(item.spec_text_view || null) != null" class="cr-grey margin-top-xs text-size-xs">{{ item.spec_text_view }}</view>
<text class="br-red cr-red text-size-xs padding-horizontal-main padding-top-xs padding-bottom-xs round pa cp operate-submit" :data-index="index" @tap="goods_remove_event">{{$t('recommend-form.recommend-form.q536vp')}}</text>
</view>
</view>
</block>
</view>
<view class="margin-top-sm padding-vertical-main">
<text class="br-dashed-grey cr-base text-size-sm padding-horizontal-main padding-top-xs padding-bottom-xs round cp" @tap="goods_add_event">{{$t('recommend-form.recommend-form.27goz3')}}</text>
</view>
</view>
<view class="bottom-fixed" :style="bottom_fixed_style">
<view class="bottom-line-exclude">
<button class="item bg-main br-main cr-white round text-size" type="default" form-type="submit" hover-class="none" :disabled="form_submit_disabled_status">{{$t('form.form.4yd066')}}</button>
</view>
</view>
</view>
</form>
<!-- 商品选择弹窗 -->
<component-popup :propShow="popup_goods_choice_status" propPosition="bottom" @onclose="popup_goods_choice_close_event">
<view class="padding-top-main bg-white">
<view class="padding-horizontal-main">
<view class="close oh">
<view class="fr" @tap.stop="popup_goods_choice_close_event">
<iconfont name="icon-close-o" size="28rpx" color="#999"></iconfont>
</view>
</view>
</view>
<view class="popup-goods-choice-container">
<view class="nav-search oh br-b margin-top-sm padding-horizontal-main">
<picker class="item br round fl padding-horizontal-main" @change="popup_goods_category_event" :value="popup_goods_cetagory_index" :range="goods_category_list" range-key="name">
<view :class="'picker ' + (popup_goods_cetagory_index == 0 ? 'cr-grey' : 'cr-base') + ' arrow-bottom'">
{{ popup_goods_cetagory_index == 0 ? $t('recommend-form.recommend-form.203itn') : goods_category_list[popup_goods_cetagory_index]['name'] }}
</view>
</picker>
<input type="search" :value="popup_keywords_value" placeholder-class="cr-grey" class="cr-base item br round fl padding-horizontal-main margin-left-main" :placeholder="$t('recommend-form.recommend-form.h5v45f')" @input="popup_keywords_value_event" @confirm="popup_goods_search_event" />
<button type="default" size="mini" class="bg-main br-main cr-white text-size-xs round fr" @tap="popup_goods_search_event">{{$t('common.search')}}</button>
</view>
<view class="view-goods-list padding-horizontal-main">
<block v-if="popup_search_goods_list.length > 0">
<block v-for="(item, index) in popup_search_goods_list" :key="index">
<view :class="'item oh pr margin-top-lg ' + (index > 0 ? 'br-t-dashed padding-top-lg' : '')">
<view :data-value="item.goods_url" @tap="url_event" class="cp br dis-block fl radius oh">
<image :src="item.images" mode="aspectFill" class="dis-block"></image>
</view>
<view class="base fr">
<view class="cr-base single-text">{{ item.title }}</view>
<view class="margin-top-xs sales-price">{{ currency_symbol }}{{ item.price }}</view>
<view class="cr-grey margin-top-xs text-size-xs">{{ item.inventory }}{{ item.inventory_unit }}</view>
<text class="br-green cr-green text-size-xs padding-horizontal-main padding-top-xs padding-bottom-xs round pa cp operate-submit" :data-index="index" @tap="popup_goods_choice_event">{{$t('buy.buy.inyxpx')}}</text>
</view>
</view>
</block>
<view class="tc br-t-dashed padding-vertical-main margin-top-main cr-grey text-size-xs">{{$t('recommend-form.recommend-form.6rlju7')}}{{ popup_search_goods_list.length }}{{$t('goods-search.goods-search.t9nikq')}}</view>
</block>
<block v-else>
<component-no-data :propStatus="search_data_list_loding_status" :propMsg="search_data_list_loding_msg"></component-no-data>
</block>
</view>
</view>
</view>
</component-popup>
<!-- 规格选择 -->
<component-goods-spec-choice ref="goods_spec_choice" v-on:specConfirmEvent="spec_confirm_event" propIndex="101"></component-goods-spec-choice>
</block>
<block v-else>
<!-- 提示信息 -->
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
</block>
</view>
<!-- 公共 -->
<component-common ref="common"></component-common>
</view>
</template>
<script>
const app = getApp();
import base64 from '@/common/js/lib/base64.js';
import componentCommon from '@/components/common/common';
import componentNoData from '@/components/no-data/no-data';
import componentPopup from '@/components/popup/popup';
import componentGoodsSpecChoice from '@/components/goods-spec-choice/goods-spec-choice';
var common_static_url = app.globalData.get_static_url('common');
export default {
data() {
return {
theme_view: app.globalData.get_theme_value_view(),
common_static_url: common_static_url,
data_list_loding_status: 1,
data_list_loding_msg: '',
bottom_fixed_style: '',
params: {},
recommend_data: {},
form_submit_disabled_status: false,
currency_symbol: app.globalData.currency_symbol(),
// 商品选择弹窗
popup_goods_choice_status: false,
goods_category_list: [],
popup_goods_cetagory_index: 0,
popup_keywords_value: '',
popup_search_goods_list: [],
search_data_list_loding_status: 1,
search_data_list_loding_msg: this.$t('recommend-form.recommend-form.20m5gj'),
};
},
components: {
componentCommon,
componentNoData,
componentPopup,
componentGoodsSpecChoice,
},
onLoad(params) {
// 调用公共事件方法
app.globalData.page_event_onload_handle(params);
// 设置参数
this.setData({
params: params,
});
},
onShow() {
// 调用公共事件方法
app.globalData.page_event_onshow_handle();
// 数据加载
this.init();
// 公共onshow事件
if ((this.$refs.common || null) != null) {
this.$refs.common.on_show();
}
},
// 下拉刷新
onPullDownRefresh() {
this.init();
},
methods: {
// 初始数据
init() {
var user = app.globalData.get_user_info(this, 'init');
if (user != false) {
this.get_data();
} else {
uni.stopPullDownRefresh();
this.setData({
data_list_loding_status: 2,
data_list_loding_msg: this.$t('extraction-apply.extraction-apply.m3xdif'),
});
}
},
// 获取数据
get_data() {
uni.request({
url: app.globalData.get_request_url('savedata', 'recommend', 'distribution'),
method: 'POST',
data: {...this.params, ...{lang_can_key: 'goods_category_list'}},
dataType: 'json',
success: (res) => {
uni.stopPullDownRefresh();
if (res.data.code == 0) {
var data = res.data.data;
// 如果存在分类则在最前面增加全部分类选项
var goods_category_list = data.goods_category_list || [];
if (goods_category_list.length > 0) {
goods_category_list.unshift({ id: null, name: this.$t('recommend-form.recommend-form.7gc30l') });
}
this.setData({
data_list_loding_status: 3,
recommend_data: data.data || {},
goods_category_list: goods_category_list,
editor_path_type: data.editor_path_type || '',
});
} else {
this.setData({
data_list_loding_status: 0,
data_list_loding_msg: res.data.msg,
});
}
},
fail: () => {
uni.stopPullDownRefresh();
this.setData({
data_list_loding_status: 0,
data_list_loding_msg: this.$t('extraction-apply.extraction-apply.h8f437'),
});
},
});
},
// 数据提交
form_submit(e) {
// 表单数据
var form_data = e.detail.value;
// 基础数据
if ((this.recommend_data || null) != null) {
form_data['id'] = this.recommend_data.id || '';
form_data['icon'] = this.recommend_data.icon || '';
// 关联商品
if ((this.recommend_data.detail_list || null) != null && this.recommend_data.detail_list.length > 0) {
var goods_data = [];
this.recommend_data.detail_list.forEach((item, index) => {
goods_data.push({
goods_id: item.goods_id,
spec: item.spec || '',
});
});
if (goods_data.length > 0) {
form_data['goods_data'] = encodeURIComponent(base64.encode(JSON.stringify(goods_data)));
}
}
}
// 校验参数并提交
var validation = [
{ fields: 'title', msg: this.$t('recommend-form.recommend-form.yd3833') },
{ fields: 'goods_data', msg: this.$t('recommend-form.recommend-form.31k41l') },
];
if (app.globalData.fields_check(form_data, validation)) {
this.setData({
form_submit_disabled_status: true,
});
uni.showLoading({
title: this.$t('common.processing_in_text'),
});
uni.request({
url: app.globalData.get_request_url('save', 'recommend', 'distribution'),
method: 'POST',
data: form_data,
dataType: 'json',
success: (res) => {
uni.hideLoading();
if (res.data.code == 0) {
app.globalData.showToast(res.data.msg, 'success');
setTimeout(function () {
uni.$emit('refresh');
uni.navigateBack();
}, 1000);
} else {
this.setData({
form_submit_disabled_status: false,
});
if (app.globalData.is_login_check(res.data)) {
app.globalData.showToast(res.data.msg);
} else {
app.globalData.showToast(this.$t('common.sub_error_retry_tips'));
}
}
},
fail: () => {
this.setData({
form_submit_disabled_status: false,
});
uni.hideLoading();
app.globalData.showToast(this.$t('common.internet_error_tips'));
},
});
}
},
// 上传图片预览
upload_show_event(e) {
uni.previewImage({
current: this.recommend_data.icon,
urls: [this.recommend_data.icon],
});
},
// 图片删除
upload_delete_event(e) {
var self = this;
uni.showModal({
title: this.$t('common.warm_tips'),
content: this.$t('order.order.psi67g'),
success(res) {
if (res.confirm) {
var temp_data = self.recommend_data || {};
temp_data['icon'] = '';
self.setData({
recommend_data: temp_data,
});
}
},
});
},
// 文件上传
file_upload_event(e) {
var self = this;
uni.chooseImage({
count: 1,
success(res) {
var success = 0;
var fail = 0;
var length = res.tempFilePaths.length;
var count = 0;
self.upload_one_by_one(res.tempFilePaths, success, fail, count, length);
},
});
},
// 采用递归的方式上传多张
upload_one_by_one(img_paths, success, fail, count, length) {
var self = this;
uni.uploadFile({
url: app.globalData.get_request_url('index', 'ueditor'),
filePath: img_paths[count],
name: 'upfile',
formData: {
action: 'uploadimage',
path_type: self.editor_path_type,
},
success: function (res) {
success++;
if (res.statusCode == 200) {
var data = typeof res.data == 'object' ? res.data : JSON.parse(res.data);
if (data.code == 0 && (data.data.url || null) != null) {
var temp_data = self.recommend_data || {};
temp_data['icon'] = data.data.url;
self.setData({
recommend_data: temp_data,
});
} else {
app.globalData.showToast(data.msg);
}
}
},
fail: function (e) {
fail++;
},
complete: function (e) {
count++;
// 下一张
if (count >= length) {
// 上传完毕,作一下提示
//app.showToast('上传成功' + success +'张', 'success');
} else {
// 递归调用,上传下一张
self.upload_one_by_one(img_paths, success, fail, count, length);
}
},
});
},
// 商品移除
goods_remove_event(e) {
var index = e.currentTarget.dataset.index || 0;
var temp_data = this.recommend_data;
temp_data.detail_list.splice(index, 1);
this.setData({
recommend_data: temp_data,
});
},
// 商品选择开启弹层
goods_add_event(e) {
this.setData({
popup_goods_choice_status: true,
});
// 没有商品列表则调用商品搜索方法
if (this.popup_search_goods_list.length == 0) {
this.popup_goods_search_event();
}
},
// 商品选择关闭弹层
popup_goods_choice_close_event(e) {
this.setData({
popup_goods_choice_status: false,
});
},
// 商品分类选择事件
popup_goods_category_event(e) {
this.setData({
popup_goods_cetagory_index: parseInt(e.detail.value || 0),
});
},
// 商品关键字名称输入事件
popup_keywords_value_event(e) {
this.setData({
popup_keywords_value: e.detail.value,
});
},
// 商品搜索事件
popup_goods_search_event() {
var data = {
keywords: this.popup_keywords_value,
};
if (this.popup_goods_cetagory_index > 0) {
data['category_id'] = this.goods_category_list[this.popup_goods_cetagory_index]['id'];
}
uni.showLoading({
title: this.$t('common.processing_in_text'),
});
this.setData({
search_data_list_loding_status: 1,
search_data_list_loding_msg: this.$t('recommend-form.recommend-form.e5k407'),
});
uni.request({
url: app.globalData.get_request_url('goodssearch', 'recommend', 'distribution'),
method: 'POST',
data: data,
dataType: 'json',
success: (res) => {
uni.hideLoading();
if (res.data.code == 0) {
var list = res.data.data || [];
this.setData({
popup_search_goods_list: list,
search_data_list_loding_status: list.length > 0 ? 3 : 0,
search_data_list_loding_msg: list.length > 0 ? '' : this.$t('detail.detail.5knxg6'),
});
} else {
this.setData({
search_data_list_loding_status: 0,
search_data_list_loding_msg: res.data.msg,
});
}
},
fail: () => {
uni.hideLoading();
this.setData({
search_data_list_loding_status: 2,
search_data_list_loding_msg: this.$t('common.internet_error_tips'),
});
},
});
},
// 弹窗商品选择
popup_goods_choice_event(e) {
var index = e.currentTarget.dataset.index || 0;
var goods = this.popup_search_goods_list[index];
var temp_data = this.recommend_data;
// 是否多规格
if (parseInt(goods.is_exist_many_spec || 0) == 1) {
if ((this.$refs.goods_spec_choice || null) != null) {
this.$refs.goods_spec_choice.init(goods.id, goods['specifications']['choose'], goods.buy_min_number, index);
}
} else {
var status = true;
if ((temp_data.detail_list || null) == null) {
temp_data.detail_list = [];
}
if (temp_data.detail_list.length > 0) {
for (var i in temp_data.detail_list) {
if (temp_data.detail_list[i]['goods_id'] == goods['id']) {
status = false;
break;
}
}
}
// 追加到关联商品中
if (status) {
temp_data.detail_list.push({
goods: goods,
goods_id: goods['id'],
spec: '',
spec_text_view: '',
});
this.setData({
recommend_data: temp_data,
});
app.globalData.showToast(this.$t('recommend-form.recommend-form.145ci4'), 'success');
} else {
app.globalData.showToast(this.$t('recommend-form.recommend-form.ocg49p'));
}
}
},
// 规格确认回调事件
spec_confirm_event(value) {
var goods = this.popup_search_goods_list[value.out_value];
var temp_data = this.recommend_data;
var spec_str = JSON.stringify(value.spec);
// 数据判断处理
var status = true;
if ((temp_data.detail_list || null) == null) {
temp_data.detail_list = [];
}
if (temp_data.detail_list.length > 0) {
for (var i in temp_data.detail_list) {
if (temp_data.detail_list[i]['goods_id'] == goods['id'] && temp_data.detail_list[i]['spec'] == spec_str) {
status = false;
break;
}
}
}
// 追加到关联商品中
if (status) {
temp_data.detail_list.push({
goods: goods,
goods_id: goods['id'],
spec: spec_str,
spec_text_view: value.spec
.map((v) => {
return v.value;
})
.join(' / '),
});
this.setData({
recommend_data: temp_data,
});
app.globalData.showToast(this.$t('recommend-form.recommend-form.145ci4'), 'success');
} else {
app.globalData.showToast(this.$t('recommend-form.recommend-form.ocg49p'));
}
},
},
// url事件
url_event(e) {
app.globalData.url_event(e);
}
};
</script>
<style>
@import './recommend-form.css';
</style>

View File

@@ -0,0 +1,309 @@
<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">
<text class="cr-base">{{ item.add_time }}</text>
<text :class="'fr ' + (item.is_enable == 1 ? 'cr-green' : 'cr-grey')">{{ item.is_enable_text }}</text>
</view>
<view :data-value="'/pages/plugins/distribution/recommend-detail/recommend-detail?id=' + item.id" @tap="url_event" class="content margin-top cp">
<view v-for="(fv, fi) in content_list" :key="fi">
<view class="single-text margin-top-xs">
<text class="cr-grey margin-right-xl">{{ fv.name }}</text>
<text class="cr-base">{{ item[fv.field] }}</text>
</view>
</view>
</view>
<view class="item-operation tr br-t padding-top-main margin-top-main">
<button class="round bg-white br-green cr-green" type="default" size="mini" hover-class="none" @tap="popup_share_event" :data-index="index">{{$t('common.share')}}</button>
<button :data-value="'/pages/plugins/distribution/recommend-form/recommend-form?id=' + item.id" @tap="url_event" class="round bg-white br-main cr-main margin-left-lg" type="default" size="mini" hover-class="none">{{$t('common.edit')}}</button>
<button class="round bg-white br-red cr-red margin-left-lg" type="default" size="mini" hover-class="none" @tap="delete_event" :data-index="index">{{$t('common.del')}}</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>
<!-- 新增入口 -->
<view data-value="/pages/plugins/distribution/recommend-form/recommend-form" @tap="url_event" class="buttom-right-submit bg-main cr-white round tc cp">+</view>
<!-- 分享弹窗 -->
<component-share-popup ref="share"></component-share-popup>
<!-- 公共 -->
<component-common ref="common"></component-common>
</view>
</template>
<script>
const app = getApp();
import componentCommon from '@/components/common/common';
import componentNoData from "@/components/no-data/no-data";
import componentBottomLine from "@/components/bottom-line/bottom-line";
import componentSharePopup from "@/components/share-popup/share-popup";
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: this.$t('user-detail.user-detail.uy6lrz'), field: "title" },
{ name: this.$t('form.form.xy87t8'), field: "describe" },
{ name: this.$t('recommend-list.recommend-list.x74z3o'), field: "goods_count" },
{ name: this.$t('recommend-list.recommend-list.78n1ly'), field: "access_count" },
],
// 自定义分享信息
share_info: {},
};
},
components: {
componentCommon,
componentNoData,
componentBottomLine,
componentSharePopup,
},
onLoad(params) {
// 调用公共事件方法
app.globalData.page_event_onload_handle(params);
// 设置参数
this.setData({
params: params,
});
// 初始数据
this.init();
},
onShow() {
// 调用公共事件方法
app.globalData.page_event_onshow_handle();
// 先解绑自定义事件
uni.$off('refresh');
// 监听自定义事件并进行页面刷新操作
uni.$on('refresh', (data) => {
// 重新请求数据
this.init();
});
// 公共onshow事件
if ((this.$refs.common || null) != null) {
this.$refs.common.on_show();
}
},
// 下拉刷新
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) {
// 获取数据
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", "recommend", "distribution"),
method: "POST",
data: {
page: this.data_page,
is_more: 1,
},
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(this.$t('common.internet_error_tips'));
},
});
},
// 滚动加载
scroll_lower(e) {
this.get_data_list();
},
// 分享开启弹层
popup_share_event(e) {
var index = e.currentTarget.dataset.index || 0;
var data = this.data_list[index] || null;
if (data == null) {
app.globalData.showToast(this.$t('extraction-switch.extraction-switch.613b58'));
return false;
}
this.setData({
share_info: {
title: data.seo_title || data.title,
kds: data.seo_keywords || data.describe,
desc: data.seo_desc || data.describe,
path: "/pages/plugins/distribution/recommend-detail/recommend-detail",
query: "id=" + data.id,
img: data.icon || "",
},
});
// 分享菜单处理
app.globalData.page_share_handle(this.share_info);
// 调取分享弹窗
if ((this.$refs.share || null) != null) {
this.$refs.share.init({
share_info: this.share_info
});
}
},
// 删除数据
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(this.$t('extraction-switch.extraction-switch.613b58'));
return false;
}
uni.showModal({
title: this.$t('common.warm_tips'),
content: this.$t('recommend-list.recommend-list.54d418'),
confirmText: this.$t('common.confirm'),
cancelText: this.$t('recommend-list.recommend-list.w9460o'),
success: (result) => {
if (result.confirm) {
uni.showLoading({
title: this.$t('common.processing_in_text'),
});
uni.request({
url: app.globalData.get_request_url("delete", "recommend", "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,
});
app.globalData.showToast(res.data.msg, "success");
} else {
app.globalData.showToast(res.data.msg);
}
},
fail: () => {
uni.hideLoading();
app.globalData.showToast(this.$t('common.internet_error_tips'));
},
});
}
},
});
},
// url事件
url_event(e) {
app.globalData.url_event(e);
}
},
};
</script>
<style>
</style>

View File

@@ -0,0 +1,32 @@
/**
* 搜索导航
*/
.nav-search .multiple-picker {
width: calc(100% - 240rpx);
}
.nav-search .multiple-picker .item {
width: calc(50% - 24rpx);
}
.nav-search .multiple-picker .uni-date .uni-date__x-input {
font-size: 24rpx;
height: 55rpx;
line-height: 55rpx;
}
.nav-search .search-submit-list {
right: 20rpx;
bottom: 15rpx;
}
.nav-search .search-submit-list button {
line-height: 42rpx !important;
}
/*
* 列表
*/
.scroll-box {
height: calc(100vh - 228rpx);
}
.data-list .item .base .avatar {
width: 40rpx;
height: 40rpx !important;
}

View File

@@ -0,0 +1,376 @@
<template>
<view :class="theme_view">
<!-- 搜索条件 -->
<view class="form-container nav-search bg-white br-b oh padding-horizontal-main padding-bottom-main text-size-xs cr-base pr">
<view class="margin-top oh">
<view class="fl margin-top">{{$t('team.team.784249')}}</view>
<view class="multiple-picker fl tc">
<view class="item br dis-inline-block pr radius tl fl">
<uni-datetime-picker v-model="nav_search_value.team_search_user_time_start" :border="false" :showFirstIcon="false" :hide-second="true" type="datetime" :placeholder="$t('team.team.pcaom3')" placeholder-class="cr-grey" />
</view>
<view class="dis-inline-block cr-grey-white margin-top-sm">-</view>
<view class="item br dis-inline-block pr radius tl fr">
<uni-datetime-picker v-model="nav_search_value.team_search_user_time_end" :border="false" :showFirstIcon="false" :hide-second="true" type="datetime" :placeholder="$t('team.team.iee9bp')" placeholder-class="cr-grey" />
</view>
</view>
<checkbox-group class="dis-inline-block fr margin-top-xs" data-value="team_search_user_time_reverse" @change="search_cholce_event">
<label> <checkbox value="1" :checked="nav_search_value.team_search_user_time_reverse.indexOf('1') != -1" style="transform: scale(0.7)" />{{$t('team.team.i040fg')}}</label>
</checkbox-group>
</view>
<view class="margin-top oh">
<view class="fl margin-top">{{$t('team.team.2ny6k1')}}</view>
<view class="multiple-picker fl tc">
<view class="item br dis-inline-block pr radius tl fl">
<uni-datetime-picker v-model="nav_search_value.team_search_order_time_start" :border="false" :showFirstIcon="false" :hide-second="true" type="datetime" :placeholder="$t('team.team.pcaom3')" placeholder-class="cr-grey" />
</view>
<view class="dis-inline-block cr-grey-white margin-top-sm">-</view>
<view class="item br dis-inline-block pr radius tl fr">
<uni-datetime-picker v-model="nav_search_value.team_search_order_time_end" :border="false" :showFirstIcon="false" :hide-second="true" type="datetime" :placeholder="$t('team.team.iee9bp')" placeholder-class="cr-grey" />
</view>
</view>
<checkbox-group class="dis-inline-block fr margin-top-xs" data-value="team_search_order_time_reverse" @change="search_cholce_event">
<label> <checkbox value="1" :checked="nav_search_value.team_search_order_time_reverse.indexOf('1') != -1" style="transform: scale(0.7)" />{{$t('team.team.i040fg')}}</label>
</checkbox-group>
</view>
<view class="margin-top oh">
<view class="fl">{{$t('team.team.2i4k79')}}</view>
<checkbox-group data-value="team_search_buy_type" @change="search_cholce_event">
<label> <checkbox value="0" :checked="nav_search_value.team_search_buy_type.indexOf('0') != -1" style="transform: scale(0.7)" />{{$t('promotion-user.promotion-user.g5332w')}}</label>
<label class="margin-left-xxl"> <checkbox value="1" :checked="nav_search_value.team_search_buy_type.indexOf('1') != -1" style="transform: scale(0.7)" />{{$t('promotion-user.promotion-user.8i641g')}}</label>
</checkbox-group>
</view>
<view class="search-submit-list pa">
<button type="default" size="mini" class="bg-grey br-grey cr-base text-size-xs round margin-right-main" @tap="search_reset_event">{{$t('team.team.3l538c')}}</button>
<button type="default" size="mini" class="bg-main br-main cr-white text-size-xs round" @tap="search_submit_event">{{$t('common.search')}}</button>
</view>
</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">
<image class="avatar dis-block fl circle" :src="item.avatar" mode="widthFix" @tap="avatar_event" :data-value="item.avatar"></image>
<text class="cr-base margin-left-sm">{{ item.user_name_view || "" }}</text>
<text class="cr-base fr">{{ item.add_time }}</text>
</view>
<view class="content margin-top">
<block v-for="(fv, fi) in content_list" :key="fi">
<view class="single-text margin-top-xs">
<text class="cr-grey margin-right-xl">{{ fv.name }}</text>
<text class="cr-base" :data-event="fv.event" :data-value="item[fv.field]" @tap="text_event">{{ item[fv.field] || fv.default }}</text>
<text v-if="(fv.unit || null) != null" class="cr-grey">{{ fv.unit }}</text>
</view>
</block>
</view>
<view class="item-operation tr br-t padding-top-main margin-top-main">
<button v-if="(item.email || null) != null" class="round bg-white br cr-base" type="default" size="mini" hover-class="none" @tap="text_event" data-event="copy" :data-value="item.email">{{$t('login.login.p54kf1')}}</button>
<button v-if="(item.mobile || null) != null" class="round bg-white br cr-base" type="default" size="mini" hover-class="none" @tap="text_event" data-event="tel" :data-value="item.mobile">{{$t('promotion-user.promotion-user.62c8m1')}}</button>
<button class="round bg-white br cr-base" type="default" size="mini" hover-class="none" @tap="user_order_event" :data-value="item.id">{{$t('promotion-user.promotion-user.i2rf31')}}</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>
<!-- 公共 -->
<component-common ref="common"></component-common>
</view>
</template>
<script>
const app = getApp();
import componentCommon from '@/components/common/common';
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: this.$t('promotion-user.promotion-user.2g7enc'), field: "order_count", unit: "", default: 0 },
{ name: this.$t('promotion-user.promotion-user.32bf15'), field: "order_total", unit: "", default: 0 },
{ name: this.$t('promotion-user.promotion-user.76748p'), field: "order_last_time", default: "" },
{ name: this.$t('promotion-user.promotion-user.u43380'), field: "find_order_count", unit: "", default: 0 },
{ name: this.$t('promotion-user.promotion-user.8n4tr3'), field: "find_order_total", unit: "", default: 0 },
{ name: this.$t('promotion-user.promotion-user.1gc3ny'), field: "find_order_last_time", default: "" },
{ name: this.$t('promotion-user.promotion-user.3l1187'), field: "referrer_count", unit: "", default: 0 },
],
nav_search_buy_type_list: [
{ value: -1, name: this.$t('common.all') },
{ value: 0, name: this.$t('promotion-user.promotion-user.g5332w') },
{ value: 1, name: this.$t('promotion-user.promotion-user.8i641g') },
],
nav_search_value: {
team_search_user_time_start: "",
team_search_user_time_end: "",
team_search_user_time_reverse: [],
team_search_order_time_start: "",
team_search_order_time_end: "",
team_search_order_time_reverse: [],
team_search_buy_type: [],
},
};
},
components: {
componentCommon,
componentNoData,
componentBottomLine,
},
onLoad(params) {
// 调用公共事件方法
app.globalData.page_event_onload_handle(params);
// 设置参数
this.setData({
params: params,
});
// 初始数据
this.init();
},
onShow() {
// 调用公共事件方法
app.globalData.page_event_onshow_handle();
// 公共onshow事件
if ((this.$refs.common || null) != null) {
this.$refs.common.on_show();
}
// 分享菜单处理
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) {
this.get_data_list();
} 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,
});
// 加载loding
if(this.data_page > 1) {
uni.showLoading({
title: this.$t('common.loading_in_text'),
});
}
// 请求参数
var data = {
page: this.data_page,
};
// 搜索注册时间
if ((this.nav_search_value.team_search_user_time_start || null) != null) {
data["team_search_user_time_start"] = this.nav_search_value.team_search_user_time_start;
}
if ((this.nav_search_value.team_search_user_time_end || null) != null) {
data["team_search_user_time_end"] = this.nav_search_value.team_search_user_time_end;
}
// 用户反向
if (this.nav_search_value.team_search_user_time_reverse.length > 0) {
data["team_search_user_time_reverse"] = 1;
}
// 搜索下单时间
if ((this.nav_search_value.team_search_order_time_start || null) != null) {
data["team_search_order_time_start"] = this.nav_search_value.team_search_order_time_start;
}
if ((this.nav_search_value.team_search_order_time_end || null) != null) {
data["team_search_order_time_end"] = this.nav_search_value.team_search_order_time_end;
}
// 订单反向
if (this.nav_search_value.team_search_order_time_reverse.length > 0) {
data["team_search_order_time_reverse"] = 1;
}
// 搜索是否下单
if (this.nav_search_value.team_search_buy_type.length > 0) {
data["team_search_buy_type"] = this.nav_search_value.team_search_buy_type.join(",");
}
// 获取数据
uni.request({
url: app.globalData.get_request_url("index", "team", "distribution"),
method: "POST",
data: data,
dataType: "json",
success: (res) => {
if(this.data_page > 1) {
uni.hideLoading();
}
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: () => {
if(this.data_page > 1) {
uni.hideLoading();
}
uni.stopPullDownRefresh();
this.setData({
data_list_loding_status: 2,
data_is_loading: 0,
});
app.globalData.showToast(this.$t('common.internet_error_tips'));
},
});
},
// 滚动加载
scroll_lower(e) {
this.get_data_list();
},
// 头像查看
avatar_event(e) {
var value = e.currentTarget.dataset.value || null;
if (value != null) {
uni.previewImage({
current: value,
urls: [value],
});
} else {
app.globalData.showToast(this.$t('order.order.p3scy0'));
}
},
// 用户订单事件
user_order_event(e) {
var value = e.currentTarget.dataset.value;
app.globalData.url_open('/pages/plugins/distribution/order/order?uid=' + value);
},
// 搜索条件事件
search_cholce_event(e) {
var value = e.currentTarget.dataset.value;
var temp_data = this.nav_search_value;
temp_data[value] = e.detail.value;
this.setData({
nav_search_value: temp_data,
});
},
// 搜索重置事件
search_reset_event(e) {
var temp_data = this.nav_search_value;
var arr_field = ["team_search_buy_type", "team_search_order_time_reverse", "team_search_user_time_reverse"];
for (var i in temp_data) {
temp_data[i] = arr_field.indexOf(i) == -1 ? "" : [];
}
this.setData({
nav_search_value: temp_data,
data_page: 1,
});
this.get_data_list(1);
},
// 搜索确认事件
search_submit_event(e) {
this.setData({
data_page: 1,
});
this.get_data_list(1);
},
// 文本事件
text_event(e) {
app.globalData.text_event_handle(e);
},
},
};
</script>
<style>
@import "./team.css";
</style>

View File

@@ -0,0 +1,122 @@
/*
* 头部
*/
.head-img {
width: 116rpx;
height: 116rpx;
}
.head-bottom {
height: 48rpx;
}
.head-item .level-item {
padding: 0 20rpx;
height: 48rpx;
line-height: 48rpx;
background-color: #FF8AA1;
}
.head-item .level-icon {
width: 26rpx;
height: 26rpx !important;
}
.head-base {
right: 0;
top: 74%;
transform: translateY(-50%);
}
.head-base button {
height: 52rpx;
line-height: 52rpx;
background: rgba(0, 0, 0, 0.3);
border-radius: 200rpx 0 0 200rpx;
padding: 0 40rpx 0 26rpx;
margin: 0;
}
/**
* 上级用户
*/
.superior {
padding: 0 54rpx;
}
.superior-item {
background: rgba(255, 72, 110, 0.51);
height: 90rpx;
line-height: 90rpx;
padding: 0 24rpx;
}
.superior .superior-content image {
width: 56rpx !important;
height: 56rpx !important;
}
/**
* 统计数据
*/
.stats-container-4 .item {
width: 25%;
}
.stats-container .stats-switch-submit {
height: 52rpx;
line-height: 52rpx;
padding: 0 44rpx 0 22rpx;
}
.popup-time-container .quit-time .item {
width: 25%;
}
.count-img {
width: 60rpx;
height: 60rpx !important;
}
.anti-mercenary-count {
padding: 20rpx 40rpx;
}
.promotion-size {
font-size: 44rpx;
}
/*
* 导航
*/
.nav.nav-bottom {
padding-bottom: 170rpx;
}
.nav .item {
padding: 32rpx 20rpx;
}
.nav .item image {
width: 100rpx;
height: 100rpx;
}
/*
* 推广按钮
*/
.promotion-btn {
height: 80rpx;
line-height: 80rpx;
}
/**
* 修改用户上级
*/
.user-search .custom-info {
height: 100rpx;
}
.user-search .custom-info .custom-avatar {
width: 50rpx;
height: 50rpx;
}

View File

@@ -0,0 +1,688 @@
<template>
<view :class="theme_view">
<view class="pr">
<component-nav-back></component-nav-back>
<view v-if="(data_base || null) != null" class="weixin-nav-padding-top">
<view class="padding-top-xxxl">
<!-- 头部背景 -->
<image :src="distribution_static_url + 'distribution-bg.png'" mode="widthFix" class="pa top-0 bg-img wh-auto" />
<view class="pr padding-top-main">
<view class="padding-top-xxxl oh">
<!-- 头部 -->
<view class="padding-main border-radius-main oh pr">
<view class="flex-row align-c">
<view class="head-img avatar bg-white circle">
<image class="wh-auto circle" @tap="preview_event" @error="user_avatar_error" :src="avatar" mode="widthFix"></image>
</view>
<view class="head-item padding-left-main flex-1 flex-width">
<view class="cr-white">
<view class="dis-inline-block text-size fw-b" @tap="user_referrer">{{ nickname }}</view>
<view v-if="(user_referrer || null) != null" class="dis-inline-block margin-left-lg br-b-f9 padding-bottom-xss text-size-xs" data-event="copy" :data-value="user_referrer" @tap="text_event">
<view class="dis-inline-block">
<text>{{$t('common.recommend_code_name')}}</text>
<text class="fw-b margin-left-sm">{{user_referrer}}</text>
</view>
<view class="dis-inline-block margin-left-xs">
<iconfont name="icon-copy" size="22rpx" color="#fff"></iconfont>
</view>
</view>
</view>
<view class="margin-top oh head-bottom">
<view v-if="(user_level || null) != null" class="single-text level-item round dis-inline-block">
<image v-if="(user_level.images_url || null) != null" class="level-icon margin-right-sm pr top-sm" :src="user_level.images_url" mode="widthFix"></image>
<text v-if="(user_level.name || null) != null" class="cr-white text-size-xs">{{ user_level.name }}</text>
</view>
<view class="head-base pa">
<block v-if="(data_base || null) != null && (data_base.is_enable_self_extraction || 0) == 1">
<button data-value="/pages/plugins/distribution/extraction/extraction" @tap="url_event" class="text-size-xs cr-white" size="mini" type="default" hover-class="none">
{{ (extraction || null) == null ? $t('user.user.2344s8') : '' }}{{$t('user.user.b5cnj1')}}<iconfont name="icon-arrow-right" size="18rpx" color="#fff" propClass="pa"></iconfont>
</button>
</block>
</view>
</view>
</view>
</view>
</view>
</view>
<!-- 会员中心通知 -->
<view v-if="(user_level || null) != null && (data_base.user_center_notice || null) != null && data_base.user_center_notice.length > 0" class="padding-horizontal-main padding-bottom-main">
<view :class="(superior || null) != null ? 'padding-horizontal-main margin-horizontal-xs' : ''">
<uni-notice-bar show-icon scrollable :text="data_base.user_center_notice.join('')" background-color="transparent" color="#fff" />
</view>
</view>
<!-- 上级用户 -->
<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-sm">{{$t('user.user.4rj120')}}</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">{{$t('user.user.567lwz')}}</text>
</view>
</view>
</view>
<!-- 数据统计 -->
<view v-if="stats_user_promotion_data_list.length > 0 || stats_base_data_list.length > 0 || stats_profit_data_list.length > 0" class="padding-horizontal-main oh">
<view class="stats-container padding-main border-radius-main bg-white pr spacing-mb">
<view class="flex-row jc-sb align-c">
<view class="title-left-border text-size fw-b">{{$t('user.user.67y36w')}}</view>
<button type="default" size="mini" class="br-grey-f5 bg-grey-f5 round stats-switch-submit text-size-xs pr margin-0" @tap="popup_time_event">
{{ popup_time_value.name }}
<iconfont name="icon-arrow-bottom" size="24rpx" class="pa" color="#999"></iconfont>
</button>
</view>
<!-- 推广统计 -->
<view v-if="stats_user_promotion_data_list.length > 0" class="margin-top-main oh tc flex-row jc-sa align-c">
<block v-for="(item, index) in stats_user_promotion_data_list" :key="index">
<view class="padding-main flex-1" :class="stats_user_promotion_data_list.length - 1 > index ? 'divider-r-f5' : ''" :data-value="item.to_page" @tap="url_event">
<view class="single-text margin-top-sm">
<text class="fw-b promotion-size">{{ item.value }}</text>
<text v-if="(item.unit || null) != null" class="cr-grey-9 text-size-xs">{{$t('user.user.rjye50')}}</text>
</view>
<view class="cr-grey text-size-xs">{{ item.name }}</view>
</view>
</block>
</view>
<!-- 基础统计 -->
<view v-if="stats_base_data_list.length > 0" class="margin-top oh tc">
<block v-for="(item, index) in stats_base_data_list_children" :key="index">
<view class="flex-row jc-sa bg-grey-f5 border-radius-main" :class="stats_base_data_list_children.length - 1 > index ? 'spacing-mb' : ''">
<block v-for="(child, i) in item" :key="i">
<view class="flex-width-half pr">
<view class="padding-vertical-xxxl padding-left-xxxl padding-right-sm flex-row jc-c align-c" :data-value="child.to_page" @tap="url_event">
<image :src="child.icon" mode="widthFix" class="count-img" />
<view class="tl flex-1 flex-width padding-left-main">
<view class="text-size-xs single-text">{{ child.name }}</view>
<view class="single-text margin-top-sm">
<text v-if="(child.first || null) != null" class="text-size-xs">{{ child.first }}</text>
<text class="text-size-lg fw-b">{{ child.value }}</text>
<text v-if="(child.unit || null) != null" class="cr-grey-9 text-size-xs">{{ child.unit }}</text>
</view>
</view>
</view>
<view v-if="child.data" class="flex-row jc-c align-c padding-horizontal-xs padding-bottom-sm pa bottom-0 left-0 right-0">
<view v-for="(cdata, ci) in child.data" :key="ci" class="padding-horizontal-sm">
<view class="cr-grey-9 text-size-xss" :data-value="cdata.to_page" @tap.stop="url_event">{{ cdata.name }}</view>
</view>
</view>
</view>
</block>
</view>
</block>
</view>
</view>
<!-- 返佣统计 -->
<view v-if="stats_profit_data_list.length > 0" class="stats-container padding-sm border-radius-main bg-white pr">
<view class="title-left-border text-size fw-b padding-vertical-sm padding-horizontal-main margin-left-sm">{{$t('user.user.q822fj')}}</view>
<view class="flex-row flex-wrap">
<block v-for="(item, index) in stats_profit_data_list" :key="index">
<view class="flex-width-half">
<view class="anti-mercenary-count bg-grey-f5 border-radius-main margin-sm">
<view class="text-size-xs single-text">{{ item.name }}</view>
<view class="single-text margin-top-sm">
<text class="text-size-xs">{{ currency_symbol }}</text>
<text class="text-size-lg fw-b">{{ item.value }}</text>
</view>
</view>
</view>
</block>
</view>
</view>
</view>
<!-- 导航 -->
<view v-if="nav_list.length > 0" class="nav oh flex-row flex-wrap 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">
<view :data-value="item.url" @tap="url_event" class="flex-row align-c">
<image :src="item.icon" mode="scaleToFill" class="dis-block"></image>
<view class="padding-left-main text-size fw-b flex-1 flex-width single-text">{{ item.title }}</view>
</view>
</view>
</view>
</block>
</view>
<!-- 不符合分销条件描述 -->
<view v-if="(user_level || null) == null && (data_base.non_conformity_desc || null) != null && data_base.non_conformity_desc.length > 0" class="padding-horizontal-main">
<uni-notice-bar class="padding-0" show-icon scrollable :text="data_base.non_conformity_desc.join" background-color="transparent" color="#fff" />
</view>
<!-- 阶梯返佣提示 -->
<view v-if="(profit_ladder || null) != null" class="bg-white pf pa-w bottom-0 left-0 right-0 wh-auto">
<view class="padding-main">
<view class="flex-row jc-sb align-c bottom-line-exclude">
<text class="cr-base">{{ profit_ladder.msg }}</text>
<text data-value="/pages/plugins/distribution/poster/poster" @tap="url_event" class="text-size bg-main cr-white dis-inline-block round cp padding-horizontal-xxxl promotion-btn">{{$t('user.user.xjxb2v')}}</text>
</view>
</view>
</view>
<!-- 时间选择弹窗 -->
<component-popup :propShow="popup_time_status" propPosition="bottom" @onclose="popup_time_close_event">
<view class="padding-horizontal-main padding-top-main bg-white">
<view class="close oh">
<view class="tr" @tap.stop="popup_time_close_event">
<iconfont name="icon-close-o" size="28rpx" color="#999"></iconfont>
</view>
</view>
<view class="popup-time-container page-bottom-fixed">
<form @submit="form_submit" class="form-container">
<view v-if="(time_data || null) != null" class="quit-time oh">
<block v-for="(item, index) in time_data" :key="index">
<view class="item fl padding-main bs-bb">
<view class="text-size-xs round padding-top-xs padding-bottom-xs tc" :class="quit_time_checked_name === item.name ? 'br-main bg-main cr-white' : 'br-grey cr-grey bg-white'" :data-value="item.name" :data-index="index" @tap="quit_time_event">
{{ item.name }}
</view>
</view>
</block>
</view>
<view class="form-gorup bg-white">
<view class="form-gorup-title">{{$t('team.team.pcaom3')}}</view>
<view class="br-b">
<uni-datetime-picker @change="time_start_change_event" v-model="popup_time_value.start" :border="false" :showFirstIcon="false" :hide-second="true" type="datetime" :placeholder="$t('team.team.pcaom3')" placeholder-class="cr-grey" />
</view>
</view>
<view class="form-gorup bg-white">
<view class="form-gorup-title">{{$t('team.team.iee9bp')}}</view>
<view class="br-b">
<uni-datetime-picker @change="time_end_change_event" v-model="popup_time_value.end" :border="false" :showFirstIcon="false" :hide-second="true" type="datetime" :placeholder="$t('team.team.iee9bp')" placeholder-class="cr-grey" />
</view>
</view>
<view class="bottom-fixed">
<view class="bottom-line-exclude">
<button class="bg-main br-main cr-white round text-size" type="default" form-type="submit" hover-class="none" :disabled="form_submit_disabled_status">{{$t('user.user.25f97u')}}</button>
</view>
</view>
</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-close-o" 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="$t('user.user.nk3cpq')"
propClass="br"
propSize="md"
:propIsBtn="true"
:propDefaultValue="modify_superior_search_input_keywords_value"
<!-- #ifdef MP || APP -->
propIcon="icon-scan"
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">{{$t('user.user.iynkpl')}}</view>
<view v-if="(superior || null) != null && (superior.can_modify_number_msg || null) != null" class="cr-yellow margin-top">{{superior.can_modify_number_msg}}</view>
</view>
</view>
</view>
<view class="bottom-fixed">
<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">{{$t('form.form.4yd066')}}</button>
</view>
</view>
</view>
</view>
</view>
</component-popup>
</view>
</view>
</view>
<view v-else>
<!-- 提示信息 -->
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
</view>
</view>
<!-- 公共 -->
<component-common ref="common"></component-common>
</view>
</template>
<script>
const app = getApp();
import componentCommon from '@/components/common/common';
import componentNavBack from '@/components/nav-back/nav-back';
import componentNoData from '@/components/no-data/no-data';
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 {
data() {
return {
theme_view: app.globalData.get_theme_value_view(),
distribution_static_url: distribution_static_url,
data_bottom_line_status: false,
data_list_loding_status: 1,
data_list_loding_msg: '',
currency_symbol: currency_symbol,
avatar: app.globalData.data.default_user_head_src,
nickname: this.$t('login.login.6yfr9g'),
user_referrer: null,
data_base: null,
user_level: null,
extraction: null,
superior: null,
profit_ladder: null,
nav_list: [],
time_data: null,
base_data: null,
user_promotion_data: null,
profit_data: null,
stats_user_promotion_data_list: [],
stats_base_data_list: [],
stats_base_data_list_children: [],
stats_profit_data_list: [],
popup_time_status: false,
form_submit_disabled_status: false,
popup_time_value: { name: this.$t('user.user.dcbt21'), start: '', end: '', index: '' },
quit_time_checked_name: '',
modify_superior_popup_status: false,
modify_superior_search_input_keywords_value: '',
modify_superior_user_data: null
};
},
components: {
componentCommon,
componentNavBack,
componentNoData,
componentPopup,
componentSearch
},
onLoad(params) {
// 调用公共事件方法
app.globalData.page_event_onload_handle(params);
// 加载数据
this.init();
},
onShow() {
// 调用公共事件方法
app.globalData.page_event_onshow_handle();
// 公共onshow事件
if ((this.$refs.common || null) != null) {
this.$refs.common.on_show();
}
// 分享菜单处理
app.globalData.page_share_handle();
},
// 下拉刷新
onPullDownRefresh() {
this.init();
},
methods: {
init(e) {
var user = app.globalData.get_user_info(this, 'init');
if (user != false) {
this.get_data();
this.set_user_base(user);
}
},
// 设置用户基础信息
set_user_base(user) {
if ((user.avatar || null) != null) {
this.setData({ avatar: user.avatar });
}
if ((user.user_name_view || null) != null) {
this.setData({ nickname: user.user_name_view });
}
},
// 获取数据
get_data() {
uni.request({
url: app.globalData.get_request_url('index', 'user', 'distribution'),
method: 'POST',
data: {},
dataType: 'json',
success: (res) => {
uni.stopPullDownRefresh();
if (res.data.code == 0) {
var data = res.data.data;
// 选择时间处理
var time_data = data.time_data || null;
var temp_value = this.popup_time_value;
if (time_data != null) {
var temp = time_data[data.default_day];
temp_value.start = temp.start;
temp_value.end = temp.end;
temp_value.name = temp.name;
}
this.setData({
data_base: data.base || null,
user_level: data.user_level || null,
extraction: data.extraction || null,
superior: data.superior || null,
user_referrer: data.user_referrer || null,
profit_ladder: data.profit_ladder || null,
nav_list: data.nav_list || [],
time_data: time_data,
stats_user_promotion_data_list: data.stats_user_promotion_data_list || [],
stats_base_data_list: data.stats_base_data_list || [],
stats_base_data_list_children: app.globalData.group_arry(data.stats_base_data_list, 2) || [],
stats_profit_data_list: data.stats_profit_data_list || [],
popup_time_value: temp_value,
quit_time_checked_name: temp_value.name || '',
data_list_loding_msg: '',
data_list_loding_status: 0,
data_bottom_line_status: false,
});
} else {
this.setData({
data_bottom_line_status: false,
data_list_loding_status: 2,
data_list_loding_msg: res.data.msg,
});
if (app.globalData.is_login_check(res.data, this, 'get_data')) {
app.globalData.showToast(res.data.msg);
}
}
},
fail: () => {
uni.stopPullDownRefresh();
this.setData({
data_bottom_line_status: false,
data_list_loding_status: 2,
data_list_loding_msg: this.$t('common.internet_error_tips'),
});
app.globalData.showToast(this.$t('common.internet_error_tips'));
},
});
},
// 头像查看
preview_event() {
if (app.globalData.data.default_user_head_src != this.avatar) {
uni.previewImage({
current: this.avatar,
urls: [this.avatar],
});
}
},
// 头像加载错误
user_avatar_error(e) {
this.setData({
avatar: app.globalData.data.default_user_head_src,
});
},
// 时间选择开启弹层
popup_time_event(e) {
this.setData({
popup_time_status: true,
});
},
// 时间选择关闭弹层
popup_time_close_event(e) {
this.setData({
popup_time_status: false,
});
},
// 时间快捷选择
quit_time_event(e) {
var index = e.currentTarget.dataset.index;
var item = this.time_data[index];
var temp_value = this.popup_time_value;
temp_value.start = item.start;
temp_value.end = item.end;
temp_value.index = index;
this.setData({
popup_time_value: temp_value,
quit_time_checked_name: e.currentTarget.dataset.value,
});
},
// 自定义开始时间事件
time_start_change_event(e) {
var temp_value = this.popup_time_value;
temp_value.start = e;
temp_value.index = '';
this.setData({
popup_time_value: temp_value,
quit_time_checked_name: '',
});
},
// 自定义结束时间事件
time_end_change_event(e) {
var temp_value = this.popup_time_value;
temp_value.end = e;
temp_value.index = '';
this.setData({
popup_time_value: temp_value,
quit_time_checked_name: '',
});
},
// 数据提交
form_submit(e) {
this.setData({
form_submit_disabled_status: true,
});
uni.showLoading({
title: this.$t('user.user.4141u2'),
});
uni.request({
url: app.globalData.get_request_url('stats', 'user', 'distribution'),
method: 'POST',
data: this.popup_time_value,
dataType: 'json',
success: (res) => {
uni.hideLoading();
if (res.data.code == 0) {
var data = res.data.data;
var temp_value = this.popup_time_value;
temp_value.name = (temp_value.index || null) == null ? ((temp_value.start || null) == null && (temp_value.end || null) == null ? this.$t('common.all') : this.$t('user.user.dcbt21')) : this.time_data[temp_value.index]['name'];
this.setData({
popup_time_status: false,
form_submit_disabled_status: false,
stats_user_promotion_data_list: data.stats_user_promotion_data_list || [],
stats_base_data_list: data.stats_base_data_list || [],
stats_base_data_list_children: app.globalData.group_arry(data.stats_base_data_list, 2) || [],
popup_time_value: temp_value,
quit_time_checked_name: temp_value.name || '',
});
} else {
this.setData({
form_submit_disabled_status: false,
});
if (app.globalData.is_login_check(res.data)) {
app.globalData.showToast(res.data.msg);
} else {
app.globalData.showToast(this.$t('common.sub_error_retry_tips'));
}
}
},
fail: () => {
this.setData({
form_submit_disabled_status: false,
});
uni.hideLoading();
app.globalData.showToast(this.$t('common.internet_error_tips'));
},
});
},
// 上级用户修改事件 - 打开
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: this.$t('recommend-form.recommend-form.e5k407'),
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(this.$t('common.internet_error_tips'));
},
});
},
// 上级用户修改 - 提交
modify_superior_submit_event(e) {
if((this.modify_superior_user_data || null) == null || (this.modify_superior_user_data.data || null) == null) {
app.globalData.showToast(this.$t('user.user.f5rny5'));
return false;
}
this.setData({
form_submit_disabled_status: true
});
uni.showLoading({
title: this.$t('common.processing_in_text'),
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(this.$t('common.internet_error_tips'));
},
});
},
// 页面滚动监听
onPageScroll(res) {
uni.$emit('onPageScroll', res);
},
// url事件
url_event(e) {
app.globalData.url_event(e);
},
// 文本事件
text_event(e) {
app.globalData.text_event_handle(e);
}
},
};
</script>
<style>
@import './user.css';
</style>

View File

@@ -0,0 +1,7 @@
.user-search .custom-info {
height: 58rpx;
}
.user-search .custom-info .custom-avatar {
width: 50rpx;
height: 50rpx;
}

View File

@@ -0,0 +1,399 @@
<template>
<view :class="theme_view">
<view v-if="data_list_loding_status != 1" class="page-bottom-fixed">
<form @submit="form_submit" class="form-container">
<view class="padding-main oh border-radius-main">
<view class="user-search">
<component-search
@onsearch="search_submit_event"
:propIsOnEvent="true"
:propIsRequired="false"
:propPlaceholder="$t('user.user.nk3cpq')"
propClass="br"
propSize="md"
:propIsBtn="true"
:propDefaultValue="search_input_keywords_value"
<!-- #ifdef MP || APP -->
propIcon="icon-scan"
propIconColor="#333"
@onicon="search_icon_event"
:propIsIconOnEvent="true"
<!-- #endif -->
></component-search>
<view class="custom-info margin-top-sm">
<block v-if="(custom_data || null) != null && (custom_data.data || null) != null">
<image class="custom-avatar circle br va-m" :src="custom_data.data.avatar" mode="aspectFill"></image>
<text class="va-m margin-left-sm">{{custom_data.data.user_name_view}}</text>
<text class="cr-grey fr">{{custom_data.data.add_time_text || ''}}</text>
</block>
<view v-else class="cr-red">{{custom_data.error_msg || $t('user.user.iynkpl')}}</view>
</view>
</view>
<view class="form-gorup bg-white border-radius-main margin-top-main">
<view class="form-gorup-title">{{$t('visit-form.visit-form.0su017')}}<text class="form-group-tips-must">*</text></view>
<textarea class="cr-base" name="content" maxlength="230" auto-height placeholder-class="cr-grey-9" :placeholder="$t('visit-form.visit-form.e9r65a')" :value="data.content || ''"></textarea>
</view>
<view class="form-gorup form-container-upload oh border-radius-main margin-top-main">
<view class="form-gorup-title">{{$t('visit-form.visit-form.6l81lz')}}<text class="form-group-tips-must">*</text><text class="form-group-tips">{{$t('order.order.o11d44')}}{{form_images_max_count}}{{$t('buy.buy.5iuqow')}}</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">
<text class="delete-icon" @tap="upload_delete_event" :data-index="index">x</text>
<image :src="item" @tap="upload_show_event" :data-index="index" mode="aspectFill"></image>
</view>
</block>
<image v-if="(form_images_list || null) == null || form_images_list.length < form_images_max_count" class="item fl upload-icon" :src="common_static_url + 'upload-icon.png'" mode="aspectFill" @tap="file_upload_event"></image>
</view>
</view>
<view class="bottom-fixed" :style="bottom_fixed_style">
<view class="bottom-line-exclude">
<button class="item bg-main br-main cr-white round text-size" type="default" form-type="submit" hover-class="none" :disabled="form_submit_disabled_status">{{$t('form.form.4yd066')}}</button>
</view>
</view>
</view>
</form>
</view>
<block v-else>
<component-no-data :propStatus="data_list_loding_status" :propMag="data_list_loding_msg"></component-no-data>
</block>
<!-- 公共 -->
<component-common ref="common"></component-common>
</view>
</template>
<script>
const app = getApp();
import componentCommon from '@/components/common/common';
import componentNoData from "@/components/no-data/no-data";
import componentSearch from '@/components/search/search';
var common_static_url = app.globalData.get_static_url("common");
export default {
data() {
return {
theme_view: app.globalData.get_theme_value_view(),
common_static_url: common_static_url,
data_list_loding_status: 1,
data_list_loding_msg: '',
bottom_fixed_style: '',
params: {},
search_input_keywords_value: '',
data: {},
form_images_list: [],
form_images_max_count: 30,
editor_path_type: '',
form_submit_disabled_status: false,
custom_data: null,
};
},
components: {
componentCommon,
componentNoData,
componentSearch
},
onLoad(params) {
// 调用公共事件方法
app.globalData.page_event_onload_handle(params);
// 设置参数
this.setData({
params: params,
});
// 初始数据
this.init();
},
onShow() {
// 调用公共事件方法
app.globalData.page_event_onshow_handle();
// 公共onshow事件
if ((this.$refs.common || null) != null) {
this.$refs.common.on_show();
}
// 分享菜单处理
app.globalData.page_share_handle();
},
// 下拉刷新
onPullDownRefresh() {
this.init();
},
methods: {
// 初始化
init() {
var user = app.globalData.get_user_info(this, "init");
if (user != false) {
this.get_data();
} else {
this.setData({
data_list_loding_status: 0,
});
}
},
// 获取数据
get_data() {
uni.request({
url: app.globalData.get_request_url("saveinfo", "visit", "distribution"),
method: "POST",
data: {...this.params, ...{is_lang: 0}},
dataType: "json",
success: (res) => {
uni.stopPullDownRefresh();
if (res.data.code == 0) {
var result = res.data.data;
var data = result.data || {};
this.setData({
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: '',
});
} else {
this.setData({
data_list_loding_status: 0,
data_list_loding_msg: res.data.msg,
});
if (app.globalData.is_login_check(res.data, this, "get_data")) {
app.globalData.showToast(res.data.msg);
}
}
},
fail: () => {
uni.stopPullDownRefresh();
this.setData({
data_list_loding_status: 2,
data_list_loding_msg: this.$t('common.internet_error_tips'),
});
app.globalData.showToast(this.$t('common.internet_error_tips'));
},
});
},
// 数据提交
form_submit(e) {
// 表单数据
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: this.$t('visit-form.visit-form.6f63it') },
{ fields: 'content', msg: this.$t('visit-form.visit-form.5k455y') },
{ fields: 'images', msg: this.$t('visit-form.visit-form.56vk4m') },
];
// 验证提交表单
if (app.globalData.fields_check(form_data, validation)) {
uni.showLoading({
title: this.$t('common.processing_in_text'),
});
this.setData({
form_submit_disabled_status: true,
});
uni.request({
url: app.globalData.get_request_url('save', 'visit', 'distribution'),
method: 'POST',
data: form_data,
dataType: 'json',
success: (res) => {
uni.hideLoading();
if (res.data.code == 0) {
app.globalData.showToast(res.data.msg, 'success');
setTimeout(function () {
uni.$emit('refresh');
uni.navigateBack();
}, 1000);
} else {
this.setData({
form_submit_disabled_status: false,
});
if (app.globalData.is_login_check(res.data)) {
app.globalData.showToast(res.data.msg);
} else {
app.globalData.showToast(this.$t('common.sub_error_retry_tips'));
}
}
},
fail: () => {
uni.hideLoading();
this.setData({
form_submit_disabled_status: false,
});
app.globalData.showToast(this.$t('extraction-apply.extraction-apply.h8f437'));
},
});
}
},
// 搜索关键字事件
search_input_keywords_event(e) {
this.setData({
search_input_keywords_value: e.detail.value,
});
},
// 搜索确认事件
search_submit_event(e) {
this.setData({
search_input_keywords_value: e
});
this.search_user();
},
// icon事件
search_icon_event(e) {
var self = this;
uni.scanCode({
success: function (res) {
self.setData({
search_input_keywords_value: res.result
});
self.search_user();
},
});
},
// 搜索用户
search_user() {
uni.showLoading({
title: this.$t('recommend-form.recommend-form.e5k407'),
mask: true
});
uni.request({
url: app.globalData.get_request_url("userquery", "user", "distribution"),
method: "POST",
data: {keywords: this.search_input_keywords_value},
dataType: "json",
success: (res) => {
uni.hideLoading();
if (res.data.code == 0) {
this.setData({
custom_data: {
data: res.data.data
}
});
} else {
this.setData({
custom_data: {
error_msg: res.data.msg
}
});
}
},
fail: () => {
uni.hideLoading();
app.globalData.showToast(this.$t('common.internet_error_tips'));
},
});
},
// 上传图片预览
upload_show_event(e) {
uni.previewImage({
current: this.form_images_list[e.currentTarget.dataset.index],
urls: this.form_images_list,
});
},
// 图片删除
upload_delete_event(e) {
var self = this;
uni.showModal({
title: this.$t('common.warm_tips'),
content: this.$t('order.order.psi67g'),
success(res) {
if (res.confirm) {
var list = self.form_images_list;
list.splice(e.currentTarget.dataset.index, 1);
self.setData({
form_images_list: list,
});
}
},
});
},
// 文件上传
file_upload_event(e) {
var self = this;
uni.chooseImage({
count: this.form_images_max_count,
success(res) {
var success = 0;
var fail = 0;
var length = res.tempFilePaths.length;
var count = 0;
self.upload_one_by_one(res.tempFilePaths, success, fail, count, length);
},
});
},
// 采用递归的方式上传多张
upload_one_by_one(img_paths, success, fail, count, length) {
var self = this;
if (self.form_images_list.length < this.form_images_max_count) {
uni.uploadFile({
url: app.globalData.get_request_url("index", "ueditor"),
filePath: img_paths[count],
name: "upfile",
formData: {
action: "uploadimage",
path_type: self.editor_path_type,
},
success: function (res) {
success++;
if (res.statusCode == 200) {
var data = typeof res.data == "object" ? res.data : JSON.parse(res.data);
if (data.code == 0 && (data.data.url || null) != null) {
var list = self.form_images_list;
list.push(data.data.url);
self.setData({
form_images_list: list,
});
} else {
app.globalData.showToast(data.msg);
}
}
},
fail: function (e) {
fail++;
},
complete: function (e) {
count++;
// 下一张
if (count >= length) {
// 上传完毕,作一下提示
//app.showToast('上传成功' + success +'张', 'success');
} else {
// 递归调用,上传下一张
self.upload_one_by_one(img_paths, success, fail, count, length);
}
},
});
}
}
},
};
</script>
<style>
@import "./visit-form.css";
</style>

View File

@@ -0,0 +1,5 @@
.data-list .base .custom-avatar,
.data-list .content .item-images {
width: 50rpx;
height: 50rpx;
}

View File

@@ -0,0 +1,300 @@
<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="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">{{$t('common.edit')}}</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">{{$t('common.del')}}</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>
<!-- 新增入口 -->
<view data-value="/pages/plugins/distribution/visit-form/visit-form" @tap="url_event" class="buttom-right-submit bg-main cr-white round tc">+</view>
<!-- 公共 -->
<component-common ref="common"></component-common>
</view>
</template>
<script>
const app = getApp();
import componentCommon from '@/components/common/common';
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: this.$t('visit-list.visit-list.q76du4'), field: "content" },
{ name: this.$t('visit-list.visit-list.4z367h'), field: "images"},
{ name: this.$t('common.upd_time'), field: "upd_time" },
],
};
},
components: {
componentCommon,
componentNoData,
componentBottomLine,
},
onLoad(params) {
// 调用公共事件方法
app.globalData.page_event_onload_handle(params);
// 设置参数
this.setData({
params: params,
});
// 初始数据
this.init();
},
onShow() {
// 调用公共事件方法
app.globalData.page_event_onshow_handle();
// 先解绑自定义事件
uni.$off('refresh');
// 监听自定义事件并进行页面刷新操作
    uni.$on('refresh', (data) => {
// 重新请求数据
this.init();
    });
// 公共onshow事件
if ((this.$refs.common || null) != null) {
this.$refs.common.on_show();
}
// 分享菜单处理
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) {
// 获取数据
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(this.$t('common.internet_error_tips'));
},
});
},
// 滚动加载
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(this.$t('extraction-switch.extraction-switch.613b58'));
return false;
}
uni.showModal({
title: this.$t('common.warm_tips'),
content: this.$t('recommend-list.recommend-list.54d418'),
confirmText: this.$t('common.confirm'),
cancelText: this.$t('recommend-list.recommend-list.w9460o'),
success: (result) => {
if (result.confirm) {
uni.showLoading({
title: this.$t('common.processing_in_text'),
});
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(this.$t('common.internet_error_tips'));
},
});
}
},
});
}
},
};
</script>
<style>
@import "./visit-list.css";
</style>