源文件
This commit is contained in:
17
pages/plugins/activity/detail/detail.css
Normal file
17
pages/plugins/activity/detail/detail.css
Normal file
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* 基础
|
||||
*/
|
||||
.base-container {
|
||||
height: 280rpx;
|
||||
background-size: cover;
|
||||
background-position: center;
|
||||
}
|
||||
.base-container .text {
|
||||
top: 0;
|
||||
left: 0;
|
||||
background: rgb(0 0 0 / 35%);
|
||||
padding: 100rpx 20rpx 20rpx 20rpx;
|
||||
}
|
||||
.word-content .word-icon:not(:last-child) {
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
193
pages/plugins/activity/detail/detail.vue
Normal file
193
pages/plugins/activity/detail/detail.vue
Normal file
@@ -0,0 +1,193 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view v-if="(data || null) != null">
|
||||
<view class="padding-horizontal-main padding-top-main">
|
||||
<!-- 基础信息 -->
|
||||
<view class="base-container tc pr padding-main border-radius-main bg-main oh spacing-mb" :style="'background-color:' + data.color + ' !important;background-image:url(' + (data.banner || data.cover) + ')'">
|
||||
<view v-if="(data.describe || null) != null" class="text cr-white pa bs-bb text-size wh-auto ht-auto">{{ data.describe }}</view>
|
||||
</view>
|
||||
|
||||
<!-- 关键字 -->
|
||||
<view v-if="data.keywords_arr.length > 0" class="word-content scroll-view-horizontal margin-bottom-sm">
|
||||
<scroll-view scroll-x>
|
||||
<block v-for="(kv, ki) in data.keywords_arr" :key="ki">
|
||||
<text :data-value="'/pages/goods-search/goods-search?keywords=' + kv" @tap="url_event" class="word-icon dis-inline-block bg-main-light text-size-xs cr-main round padding-top-xs padding-bottom-xs padding-left padding-right cp">{{ kv }}</text>
|
||||
</block>
|
||||
</scroll-view>
|
||||
</view>
|
||||
|
||||
<!-- 推荐商品 -->
|
||||
<view v-if="(data.goods_list || null) != null && data.goods_list.length > 0">
|
||||
<view class="spacing-nav-title flex-row align-c jc-sb text-size-xs">
|
||||
<view class="title-left">
|
||||
<text class="text-wrapper title-left-border">{{$t('detail.detail.b4f3nw')}}</text>
|
||||
<text class="vice-name margin-left-lg cr-grey">{{ data.vice_title }}</text>
|
||||
</view>
|
||||
<text data-value="/pages/plugins/activity/index/index" @tap="url_event" class="arrow-right padding-right cr-grey cp">{{$t('detail.detail.ans2p4')}}</text>
|
||||
</view>
|
||||
<component-goods-list :propData="{ style_type: 1, goods_list: data.goods_list }" :propCurrencySymbol="currency_symbol"></component-goods-list>
|
||||
</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>
|
||||
</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';
|
||||
import componentGoodsList from '@/components/goods-list/goods-list';
|
||||
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,
|
||||
componentGoodsList,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: app.globalData.launch_params_handle(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', 'index', 'activity'),
|
||||
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_base: data.base || null,
|
||||
data: data.data || null,
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: 0,
|
||||
data_bottom_line_status: (data.data || null) != null && (data.data.goods_list || null) != null && data.data.goods_list.length > 0,
|
||||
});
|
||||
|
||||
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/activity/detail/detail',
|
||||
query: 'id=' + this.data.id,
|
||||
img: this.data.share_images || this.data.cover,
|
||||
},
|
||||
});
|
||||
|
||||
// 标题
|
||||
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);
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './detail.css';
|
||||
</style>
|
||||
12
pages/plugins/activity/index/index.css
Normal file
12
pages/plugins/activity/index/index.css
Normal file
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* 数据列表
|
||||
*/
|
||||
.data-list {
|
||||
display: flex;
|
||||
flex-flow: row wrap;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.data-list .item {
|
||||
width: calc(50% - 10rpx);
|
||||
}
|
||||
287
pages/plugins/activity/index/index.vue
Normal file
287
pages/plugins/activity/index/index.vue
Normal file
@@ -0,0 +1,287 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<!-- 轮播 -->
|
||||
<view v-if="slider_list.length > 0" class="padding-horizontal-main padding-top-main">
|
||||
<component-banner :propData="slider_list" propSize="mini"></component-banner>
|
||||
</view>
|
||||
|
||||
<!-- 分类 -->
|
||||
<scroll-view v-if="(activity_category || null) != null && activity_category.length > 0" class="scroll-view-horizontal bg-white oh" scroll-x="true">
|
||||
<view :class="'item cr-grey dis-inline-block padding-horizontal-main padding-top-main padding-bottom-sm ' + (nav_active_value == 0 ? 'cr-main nav-active-line bg-main-befor fw-b' : '')" @tap="nav_event" data-value="0">{{$t('common.all')}}</view>
|
||||
<block v-for="(item, index) in activity_category" :key="index">
|
||||
<view :class="'item cr-grey dis-inline-block padding-horizontal-main padding-top-main padding-bottom-sm ' + (nav_active_value == item.id ? 'cr-main nav-active-line bg-main-befor fw-b' : '')" @tap="nav_event" :data-value="item.id">{{ item.name }}</view>
|
||||
</block>
|
||||
</scroll-view>
|
||||
|
||||
<!-- 列表 -->
|
||||
<scroll-view :scroll-y="true" class="scroll-box scroll-box-ece-nav" @scrolltolower="scroll_lower" lower-threshold="30" :style="slider_list.length > 0 ? 'height:calc(100vh - 320rpx);' : ''">
|
||||
<view v-if="(data_list || null) != null && data_list.length > 0" class="data-list padding-horizontal-main padding-top-main oh">
|
||||
<block v-for="(item, index) in data_list" :key="index">
|
||||
<view :data-value="'/pages/plugins/activity/detail/detail?id=' + item.id" @tap="url_event" class="item oh cp spacing-mb">
|
||||
<image :src="item.cover" mode="widthFix" class="wh-auto border-radius-main"></image>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></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 componentBanner from '@/components/slider/slider';
|
||||
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_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
data_bottom_line_status: false,
|
||||
data_is_loading: 0,
|
||||
data_list: [],
|
||||
data_total: 0,
|
||||
data_page_total: 0,
|
||||
data_page: 1,
|
||||
params: null,
|
||||
data_base: null,
|
||||
slider_list: [],
|
||||
activity_category: [],
|
||||
nav_active_value: 0,
|
||||
// 自定义分享信息
|
||||
share_info: {},
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentBanner,
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: params,
|
||||
});
|
||||
|
||||
// 数据加载
|
||||
this.get_data();
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.setData({
|
||||
data_page: 1,
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 初始化
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('index', 'index', 'activity'),
|
||||
method: 'POST',
|
||||
data: {},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
this.setData({
|
||||
data_base: data.base || null,
|
||||
slider_list: data.slider_list || [],
|
||||
activity_category: data.activity_category || [],
|
||||
});
|
||||
|
||||
if ((this.data_base || null) != null) {
|
||||
// 基础自定义分享
|
||||
this.setData({
|
||||
share_info: {
|
||||
title: this.data_base.seo_title || this.data_base.application_name,
|
||||
desc: this.data_base.seo_desc,
|
||||
path: '/pages/plugins/activity/index/index',
|
||||
},
|
||||
});
|
||||
|
||||
// 标题
|
||||
if ((this.data_base.application_name || null) != null) {
|
||||
uni.setNavigationBarTitle({
|
||||
title: this.data_base.application_name,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 获取列表数据
|
||||
this.get_data_list(1);
|
||||
} else {
|
||||
this.setData({
|
||||
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_list_loding_status: 2,
|
||||
data_list_loding_msg: this.$t('common.internet_error_tips'),
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 获取数据列表
|
||||
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,
|
||||
});
|
||||
|
||||
// 加载loding
|
||||
if(this.data_page > 1) {
|
||||
uni.showLoading({
|
||||
title: this.$t('common.loading_in_text'),
|
||||
});
|
||||
}
|
||||
|
||||
// 获取数据
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('datalist', 'index', 'activity'),
|
||||
method: 'POST',
|
||||
data: {
|
||||
page: this.data_page,
|
||||
category_id: this.nav_active_value || 0,
|
||||
},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
if(this.data_page > 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
if (data.data.length > 0) {
|
||||
if (this.data_page <= 1) {
|
||||
var temp_data_list = data.data;
|
||||
} else {
|
||||
var temp_data_list = this.data_list || [];
|
||||
var temp_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: data.total,
|
||||
data_page_total: 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_is_loading: 0,
|
||||
});
|
||||
if (this.data_page <= 1) {
|
||||
this.setData({
|
||||
data_list: [],
|
||||
data_bottom_line_status: false,
|
||||
});
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
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_active_value: e.currentTarget.dataset.value || 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 './index.css';
|
||||
</style>
|
||||
6
pages/plugins/allocation/cashier/cashier.css
Normal file
6
pages/plugins/allocation/cashier/cashier.css
Normal file
@@ -0,0 +1,6 @@
|
||||
.page {
|
||||
height: 100vh;
|
||||
}
|
||||
.page > .content {
|
||||
padding-top: 20%;
|
||||
}
|
||||
177
pages/plugins/allocation/cashier/cashier.vue
Normal file
177
pages/plugins/allocation/cashier/cashier.vue
Normal file
@@ -0,0 +1,177 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view class="page bg-white">
|
||||
<view class="content padding-horizontal-main tc">
|
||||
<block v-if="data_list_loding_status == 3">
|
||||
<view class="padding-vertical-xxxxl">
|
||||
<text class="cr-price fw-b text-size-lg">{{payment_currency_symbol}}</text>
|
||||
<text class="cr-price fw-b text-size-xxl">{{data.pay_price}}</text>
|
||||
</view>
|
||||
<view class="margin-top-sm padding-bottom-xxxxl">
|
||||
<view :class="'cr-'+(pay_status == 1 ? 'green' : (pay_status == 2 ? 'red' : 'grey'))">{{pay_msg}}</view>
|
||||
</view>
|
||||
<view v-if="pay_status == 2" class="margin-top-xxxxl padding-vertical-xxxxl">
|
||||
<button class="bg-green br-green cr-white round text-size-sm padding-horizontal-xxxxl" size="mini" hover-class="none" @tap="pay_handle">重新发起支付</button>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
</block>
|
||||
|
||||
<view v-if="is_back_btn && pay_status != 0" class="margin-top-xxxxl padding-top-xxxxl tc">
|
||||
<button class="bg-white br-main cr-main round text-size-sm padding-horizontal-xxxxl" size="mini" hover-class="none" open-type="launchApp" app-parameter="wechat">返回APP</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 公共 -->
|
||||
<component-common ref="common" :propIsAppAdmin="false"></component-common>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentCommon from '@/components/common/common';
|
||||
import componentNoData from "@/components/no-data/no-data";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
payment_currency_symbol: app.globalData.currency_symbol(),
|
||||
params: {},
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
scene: 0,
|
||||
scene_back_arr: [1069, 1038, 1089, 1090, 1001, 1131, 1187],
|
||||
is_back_btn: false,
|
||||
data: {},
|
||||
pay_status: 0,
|
||||
pay_msg: '',
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData
|
||||
},
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 设置参数
|
||||
params = app.globalData.launch_params_handle(params);
|
||||
var scene = app.globalData.get_scene_data();
|
||||
this.setData({
|
||||
params: params,
|
||||
scene: scene,
|
||||
is_back_btn: this.scene_back_arr.indexOf(scene) != -1,
|
||||
});
|
||||
|
||||
// 数据加载
|
||||
this.get_data();
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.get_data();
|
||||
},
|
||||
|
||||
methods: {
|
||||
// // 初始化
|
||||
get_data() {
|
||||
var self = this;
|
||||
var action = 'login';
|
||||
// #ifdef MP-BAIDU
|
||||
action = 'getLoginCode';
|
||||
// #endif
|
||||
uni[action]({
|
||||
success: (res) => {
|
||||
if (res.code) {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("paydata", "cashier", "allocation"),
|
||||
method: 'POST',
|
||||
data: {...self.params, ...{authcode: res.code}},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0 && (res.data.data || null) != null) {
|
||||
this.setData({
|
||||
data_list_loding_status: 3,
|
||||
data_list_loding_msg: '',
|
||||
data: res.data.data,
|
||||
});
|
||||
|
||||
// 直接调起支付
|
||||
this.pay_handle();
|
||||
} 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: self.$t('common.internet_error_tips'),
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: (e) => {
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_list_loding_msg: self.$t('login.login.3nmrg2'),
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 支付处理
|
||||
pay_handle(e) {
|
||||
if(this.pay_status != 1)
|
||||
{
|
||||
this.setData({
|
||||
pay_status: 0,
|
||||
pay_msg: this.$t('common.payment_in_text'),
|
||||
});
|
||||
uni.requestPayment({
|
||||
timeStamp: this.data.pay_data.timeStamp,
|
||||
nonceStr: this.data.pay_data.nonceStr,
|
||||
package: this.data.pay_data.package,
|
||||
signType: this.data.pay_data.signType,
|
||||
paySign: this.data.pay_data.paySign,
|
||||
success: (res) => {
|
||||
this.setData({
|
||||
pay_status: 1,
|
||||
pay_msg: this.$t('paytips.paytips.679rxu'),
|
||||
});
|
||||
},
|
||||
fail: (res) => {
|
||||
this.setData({
|
||||
pay_status: 2,
|
||||
pay_msg: this.$t('paytips.paytips.6y488i'),
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './cashier.css';
|
||||
</style>
|
||||
19
pages/plugins/antifakecode/index/index.css
Normal file
19
pages/plugins/antifakecode/index/index.css
Normal file
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* 基础
|
||||
*/
|
||||
.page-content {
|
||||
background: #fff;
|
||||
}
|
||||
.scan-button {
|
||||
background: linear-gradient( 270deg, #F1E6C1 0%, #DBC583 100%);
|
||||
max-width: 300rpx;
|
||||
}
|
||||
.scan-button text {
|
||||
color: #CC2121;
|
||||
}
|
||||
/**
|
||||
* 扫码按钮增加页面底部间距
|
||||
*/
|
||||
.page-bottom-fixed {
|
||||
padding-bottom: 100rpx !important;
|
||||
}
|
||||
151
pages/plugins/antifakecode/index/index.vue
Normal file
151
pages/plugins/antifakecode/index/index.vue
Normal file
@@ -0,0 +1,151 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view v-if="(data || null) != null" :class="'page-content min-ht '+((user == null || data.status == -10000) ? 'page-bottom-fixed' : '')">
|
||||
<block v-if="data.status == -10000">
|
||||
<!-- 顶部banner -->
|
||||
<image v-if="(data.data.scan_top_banner || null) != null" :src="data.data.scan_top_banner" mode="widthFix" class="dis-block wh-auto auto"></image>
|
||||
<!-- 底部图片 -->
|
||||
<image v-if="(data.data.scan_bottom_images || null) != null" :src="data.data.scan_bottom_images" mode="widthFix" class="dis-block wh-auto auto"></image>
|
||||
<!-- 扫码 -->
|
||||
<view class="pf left-0 bottom-xxxxl wh-auto tc padding-horizontal-main bs-bb">
|
||||
<view class="bottom-line-exclude">
|
||||
<button type="default" class="scan-button text-size-sm round" @tap="scan_event">
|
||||
<!-- #ifndef H5 -->
|
||||
<view class="va-m dis-inline-block margin-right-xs">
|
||||
<iconfont name="icon-scan" size="28rpx" propClass="lh-il va-m" color="#CC2121"></iconfont>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
<text class="va-m">{{$t('common.scan_name')}}</text>
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</block>
|
||||
<block v-else>
|
||||
<!-- 领取成功 -->
|
||||
<block v-if="data.status == 0">
|
||||
<image v-if="(data.data.scan_first_images || null) != null" :src="data.data.scan_first_images" mode="widthFix" class="dis-block wh-auto auto"></image>
|
||||
<view class="margin-vertical-xxxl tc">{{data.data.scan_first_tips}}</view>
|
||||
</block>
|
||||
<!-- 领取失败 -->
|
||||
<block v-else-if="data.status == -100">
|
||||
<image v-if="(data.data.scan_last_images || null) != null" :src="data.data.scan_last_images" mode="widthFix" class="dis-block wh-auto auto"></image>
|
||||
<view class="margin-vertical-xxxl tc">{{data.data.scan_last_tips}}</view>
|
||||
</block>
|
||||
<!-- 其他错误 -->
|
||||
<block v-else>
|
||||
<component-no-data propStatus="0" :propMsg="data.msg"></component-no-data>
|
||||
</block>
|
||||
</block>
|
||||
</view>
|
||||
<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(),
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
params: null,
|
||||
data: null,
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: app.globalData.launch_params_handle(params),
|
||||
});
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 获取数据
|
||||
this.get_data();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 获取数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('index', 'index', 'antifakecode'),
|
||||
method: 'POST',
|
||||
data: this.params,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
var data = res.data.data || null;
|
||||
this.setData({
|
||||
data: data,
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: 0,
|
||||
data_bottom_line_status: true
|
||||
});
|
||||
},
|
||||
fail: () => {
|
||||
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'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 扫码事件
|
||||
scan_event() {
|
||||
var self = this;
|
||||
uni.scanCode({
|
||||
success: function (res) {
|
||||
if (res.result !== '') {
|
||||
var arr = ['/antifakecode-index-index-id-', 'plugins/index/pluginsname/antifakecode/pluginscontrol/index/pluginsaction/index/id/'];
|
||||
var ret = app.globalData.web_url_value_mate(res.result, arr);
|
||||
if (ret.status == 1 && ret.value != null) {
|
||||
var temp = self.params;
|
||||
temp['id'] = ret.value;
|
||||
self.setData({
|
||||
params: temp
|
||||
});
|
||||
self.get_data();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './index.css';
|
||||
</style>
|
||||
129
pages/plugins/ask/comments/comments.vue
Normal file
129
pages/plugins/ask/comments/comments.vue
Normal file
@@ -0,0 +1,129 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view v-if="(data || null) != null" class="padding-main bg-white">
|
||||
<!-- 评论内容 -->
|
||||
<component-ask-comments :propData="data" :propDataBase="data_base" :propEmojiList="emoji_list" propType="comments"></component-ask-comments>
|
||||
<!-- 结尾 -->
|
||||
<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';
|
||||
import componentAskComments from '../components/ask-comments/ask-comments';
|
||||
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_base: null,
|
||||
data: null,
|
||||
emoji_list: [],
|
||||
// 自定义分享信息
|
||||
share_info: {},
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
componentAskComments,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: params,
|
||||
});
|
||||
|
||||
// 数据加载
|
||||
this.get_data();
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 初始化
|
||||
get_data() {
|
||||
uni.showLoading({
|
||||
title: this.$t('common.loading_in_text'),
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('commentsinfo', 'index', 'ask'),
|
||||
method: 'POST',
|
||||
data: {
|
||||
id: this.params.id || 0,
|
||||
},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
var data = res.data.data;
|
||||
if (res.data.code == 0 && (data.data || null) != null) {
|
||||
var ask = data.data;
|
||||
this.setData({
|
||||
data_bottom_line_status: true,
|
||||
data_list_loding_status: 3,
|
||||
data_base: data.base || null,
|
||||
data: ask,
|
||||
emoji_list: data.emoji_list || [],
|
||||
});
|
||||
|
||||
// 基础自定义分享
|
||||
this.setData({
|
||||
share_info: {
|
||||
title: this.data.seo_title || this.data.title,
|
||||
desc: this.data.seo_desc || this.data.describe,
|
||||
path: '/pages/plugins/ask/detail/detail',
|
||||
query: 'id=' + this.data.id,
|
||||
img: this.data.cover,
|
||||
},
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle(this.share_info);
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style></style>
|
||||
579
pages/plugins/ask/components/ask-comments/ask-comments.vue
Normal file
579
pages/plugins/ask/components/ask-comments/ask-comments.vue
Normal file
@@ -0,0 +1,579 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view v-if="(data || null) != null && (data_base || null) != null">
|
||||
<view class="flex-row jc-sb align-c">
|
||||
<view v-if="(data_base.is_ask_comments_show || 0) == 1" class="fw-b">{{$t('user-order-detail.user-order-detail.423rmr')}}{{ data.comments_count || 0 }}{{$t('goods-list.goods-list.8y3cc7')}}</view>
|
||||
<!-- 点赞、评论、分享 -->
|
||||
<view v-if="propType == 'detail'" class="tr ask-comments-bottom-container cr-base">
|
||||
<view v-if="(data_base.is_ask_comments_show || 0) == 1" class="item dis-inline-block cr-base" :data-value="'/pages/plugins/ask/comments/comments?id=' + data.id" @tap="url_event">
|
||||
<iconfont name="icon-message-square" size="28rpx" propClass="pr top-sm margin-right-xs"></iconfont>
|
||||
<text class="text-size-xs">{{$t('ask-comments.ask-comments.2zlnb5')}}{{ data.comments_count }})</text>
|
||||
</view>
|
||||
<view v-if="(data_base.is_ask_give_thumbs || 0) == 1" :class="'item dis-inline-block cr-' + ((data.is_give_thumbs || 0) == 1 ? 'main' : 'base')" :data-askid="data.id" @tap="give_thumbs_event">
|
||||
<iconfont :name="(data.is_give_thumbs || 0) == 1 ? 'icon-givealike' : 'icon-givealike-o'" size="28rpx" propClass="pr top-sm margin-right-xs"></iconfont>
|
||||
<text class="va-m text-size-xs">{{$t('ask-comments.ask-comments.du7rcv')}}{{ data.give_thumbs_count }})</text>
|
||||
</view>
|
||||
<view class="item dis-inline-block cr-base" @tap="popup_share_event">
|
||||
<iconfont name="icon-share" size="28rpx" propClass="pr top-sm margin-right-xs"></iconfont>
|
||||
<text class="text-size-xs">{{$t('common.share')}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 评论回复表单 -->
|
||||
<view v-if="(data_base.is_ask_comments_add || 0) == 1 && !input_comments_modal_status" class="padding-top-xxxl padding-bottom-xxl ask-comments-reply-container flex-row jc-sb spacing-mb">
|
||||
<image :src="avatar" mode="aspectFill" class="user-avatar fl circle"></image>
|
||||
<view class="right-base flex-1 flex-width">
|
||||
<view class="comments border-radius-main padding-main">
|
||||
<textarea :placeholder="$t('ask-comments.ask-comments.m67961')" placeholder-class="cr-base" class="textarea wh-auto bg-grey-f8" :value="input_comments_value" :maxlength="input_comments_length_max" @input="comments_input_event" @blur="comments_input_event"></textarea>
|
||||
<view class="oh flex-row jc-sb align-e">
|
||||
<image :src="common_static_url + 'emoji-icon.png'" mode="aspectFill" class="emoji-icon va-m" @tap="emoji_event"></image>
|
||||
<view class="flex-row align-e">
|
||||
<!-- #ifndef MP-ALIPAY -->
|
||||
<text class="text-size-xs cr-grey-d margin-right-sm">{{$t('login.login.n24i5u')}}{{ input_comments_length_value }}{{$t('ask-comments.ask-comments.6l6vz7')}}</text>
|
||||
<!-- #endif -->
|
||||
<button type="default" size="mini" class="comment-btn cr-white border-radius-sm text-size-md va-m" :class="input_comments_value.length > 0 ? 'bg-main br-main ' : 'comment-btn-default'" @tap="comments_event">{{$t('user-order.user-order.twc3r7')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 评论回复内容 -->
|
||||
<view v-if="(data_base.is_ask_comments_show || 0) == 1 && (data.comments_list || null) != null && data.comments_list.length > 0" class="ask-comments-list">
|
||||
<block v-for="(item, index) in data.comments_list" :key="index">
|
||||
<view class="item oh flex-row jc-sb">
|
||||
<image :src="item.user.avatar" mode="aspectFill" class="user-avatar circle fl"></image>
|
||||
<view class="right-content flex-1 flex-width" :class="data.comments_list.length > index + 1 ? 'br-b-e padding-bottom-main margin-bottom-main' : ''">
|
||||
<view class="comments-base oh">
|
||||
<text class="username fw-b">{{ item.user.user_name_view }}</text>
|
||||
<text class="cr-grey-9 margin-left-main">{{ item.add_time }}</text>
|
||||
</view>
|
||||
<view class="margin-top-sm comments-content">
|
||||
<mp-html :content="item.content" />
|
||||
</view>
|
||||
<view class="ask-comments-right-content-operate margin-top-main flex-row jc-e align-c text-size-xs cr-grey-9">
|
||||
<view v-if="(data_base.is_ask_comments_show || 0) == 1" class="item dis-inline-block" :data-index="index" :data-username="item.user.user_name_view" :data-askcommentsid="item.id" @tap="modal_open_event">
|
||||
<iconfont name="icon-message-square" size="28rpx" propClass="pr top-md margin-right-xs"></iconfont>
|
||||
<text class="va-m">{{$t('ask-comments.ask-comments.3fcnme')}}{{ item.comments_count }})</text>
|
||||
</view>
|
||||
<view v-if="(data_base.is_ask_give_thumbs || 0) == 1" :class="'item dis-inline-block margin-left-xxxl padding-left-sm cr-' + ((item.is_give_thumbs || 0) == 1 ? 'main' : '')" data-type="1" :data-index="index" :data-askid="item.ask_id" :data-askcommentsid="item.id" @tap="give_thumbs_event">
|
||||
<iconfont :name="(item.is_give_thumbs || 0) == 1 ? 'icon-givealike' : 'icon-givealike-o'" size="28rpx" propClass="pr top-md margin-right-xs"></iconfont>
|
||||
<text class="va-m">{{$t('ask-comments.ask-comments.du7rcv')}}{{ item.give_thumbs_count }})</text>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="(item.reply_comments_list || null) != null && item.reply_comments_list.length > 0" class="reply-ask-comments-list">
|
||||
<block v-for="(comments, index2) in item.reply_comments_list" :key="index2">
|
||||
<view class="bg-grey-e">
|
||||
<view class="item padding-main oh flex-row jc-sb">
|
||||
<image :src="comments.user.avatar" mode="aspectFill" class="user-avatar circle fl"></image>
|
||||
<view class="right-content flex-1 flex-width">
|
||||
<view class="comments-reply-base oh">
|
||||
<text class="username fw-b">{{ comments.user.user_name_view }}</text>
|
||||
<text class="cr-grey-9 margin-left-main">{{ comments.add_time }}</text>
|
||||
</view>
|
||||
<view v-if="(comments.reply_comments_text || null) != null" class="margin-top-sm reply-content">{{ comments.reply_comments_text }}</view>
|
||||
<view class="margin-top-sm">{{ comments.content }}</view>
|
||||
<view class="ask-comments-right-content-operate flex-row jc-e align-c text-size-xs cr-grey-9 padding-0">
|
||||
<view v-if="(data_base.is_ask_comments_show || 0) == 1" class="item dis-inline-block" :data-index="index" :data-username="comments.user.user_name_view" :data-askcommentsid="comments.ask_comments_id" :data-replycommentsid="comments.id" @tap="modal_open_event">
|
||||
<iconfont name="icon-message-square" size="28rpx" propClass="pr top-md margin-right-xs"></iconfont>
|
||||
<text class="va-m">{{$t('ask-comments.ask-comments.3fcnme')}}{{ comments.comments_count }})</text>
|
||||
</view>
|
||||
<view v-if="(data_base.is_ask_give_thumbs || 0) == 1" :class="'item dis-inline-block margin-left-xxxl padding-left-sm cr-' + ((comments.is_give_thumbs || 0) == 1 ? 'main' : '')" data-type="2" :data-index="index" :data-indexs="index2" :data-askid="comments.ask_id" :data-askcommentsid="comments.id" :data-replycommentsid="comments.ask_comments_id" @tap="give_thumbs_event">
|
||||
<iconfont :name="(comments.is_give_thumbs || 0) == 1 ? 'icon-givealike' : 'icon-givealike-o'" size="28rpx" propClass="pr top-md margin-right-xs"></iconfont>
|
||||
<text class="va-m">{{$t('ask-comments.ask-comments.du7rcv')}}{{ comments.give_thumbs_count }})</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<view v-if="(item.comments_count || 0) > 0 && (item.is_comments_list_submit == undefined || item.is_comments_list_submit == 1)" class="margin-top-lg text-size-xs">
|
||||
<text :data-index="index" :data-askid="item.ask_id" :data-askcommentsid="item.id" @tap="comments_list_reply_event">
|
||||
<text v-if="item.is_comments_list_submit == undefined" class="cr-base">{{$t('goods-list.goods-list.278qr1')}}{{ item.comments_count }}{{$t('ask-comments.ask-comments.ymmd24')}}</text>
|
||||
<text v-else class="cr-base">{{$t('ask-comments.ask-comments.dfhg54')}}</text>
|
||||
<iconfont name="icon-arrow-bottom" size="24rpx" propClass="margin-left-xs pr top-xs"></iconfont>
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-if="((data_base.ask_detail_comments_more_page_number || 0) == 0 && (data.comments_count || 0) > 20) || ((data_base.ask_detail_comments_more_page_number || 0) > 0 && data.comments_count > data_base.ask_detail_comments_more_page_number)">
|
||||
<view v-if="propType == 'detail'" class="margin-top-xxxl tc padding-vertical-main bg-grey-f8 border-radius-sm">
|
||||
<text :data-value="'/pages/plugins/ask/comments/comments?id=' + data.id" @tap="url_event">
|
||||
<text class="cr-base">{{$t('goods-list.goods-list.278qr1')}}{{ data.comments_count }}{{$t('ask-comments.ask-comments.5401r1')}}</text>
|
||||
<iconfont name="icon-arrow-right" size="24rpx" propClass="margin-left-xs pr top-xs"></iconfont>
|
||||
</text>
|
||||
</view>
|
||||
<view v-if="propType == 'comments' && (data.is_comments_list_submit == undefined || data.is_comments_list_submit == 1)" class="margin-top-xxxl tc padding-vertical-main bg-grey-f8 border-radius-sm">
|
||||
<text :data-askid="data.id" @tap="comments_list_reply_event">
|
||||
<text class="cr-base">{{$t('ask-comments.ask-comments.4l77wt')}}</text>
|
||||
<iconfont name="icon-arrow-bottom" size="24rpx" propClass="margin-left-xs pr top-xs"></iconfont>
|
||||
</text>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<!-- 回复弹窗 -->
|
||||
<view v-if="input_comments_modal_status" class="ask-comments-modal pf">
|
||||
<view class="ask-comments-modal-content bg-white border-radius-main pr">
|
||||
<view class="tc margin-bottom-lg">
|
||||
<text>{{$t('ask-comments.ask-comments.8sjar6')}}{{ input_comments_modal_username }}</text>
|
||||
<view class="close pa">
|
||||
<view @tap.stop="modal_close_event">
|
||||
<iconfont name="icon-close-o" size="28rpx" color="#999"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<textarea :placeholder="$t('ask-comments.ask-comments.m67961')" placeholder-class="cr-base" class="textarea wh-auto br padding-main" :value="input_comments_value" :maxlength="input_comments_length_max" @input="comments_input_event" @blur="comments_input_event"></textarea>
|
||||
<view class="margin-top-lg oh">
|
||||
<image :src="common_static_url + 'emoji-icon.png'" mode="aspectFill" class="emoji-icon va-m" @tap="emoji_event"></image>
|
||||
<view class="fr">
|
||||
<text class="va-m text-size-xs cr-base margin-right-lg">{{$t('login.login.n24i5u')}}{{ input_comments_length_value }}{{$t('ask-comments.ask-comments.6l6vz7')}}</text>
|
||||
<button type="default" size="mini" class="comment-btn cr-white border-radius-sm text-size-xs va-m" :class="input_comments_value.length > 0 ? 'bg-main br-main ' : 'comment-btn-default'" @tap="comments_event">{{$t('user-order.user-order.twc3r7')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 表情弹窗 -->
|
||||
<component-emoji-popup ref="emoji" v-on:choiceConfirmEvent="emoji_choice_confirm_event"></component-emoji-popup>
|
||||
|
||||
<!-- 分享弹窗 -->
|
||||
<component-share-popup ref="share"></component-share-popup>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
var common_static_url = app.globalData.get_static_url('common');
|
||||
import componentPopup from '@/components/popup/popup';
|
||||
import componentSharePopup from '@/components/share-popup/share-popup';
|
||||
import componentEmojiPopup from '@/components/emoji-popup/emoji-popup';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
common_static_url: common_static_url,
|
||||
avatar: app.globalData.data.default_user_head_src,
|
||||
user: null,
|
||||
data_base: null,
|
||||
data: null,
|
||||
emoji_list: [],
|
||||
input_comments_value: '',
|
||||
input_comments_cursor: 0,
|
||||
input_comments_length_value: 500,
|
||||
input_comments_length_max: 500,
|
||||
input_comments_modal_status: false,
|
||||
input_comments_modal_index: 0,
|
||||
input_comments_modal_username: '',
|
||||
input_comments_modal_ask_comments_id: 0,
|
||||
input_comments_modal_reply_comments_id: 0,
|
||||
};
|
||||
},
|
||||
props: {
|
||||
propType: {
|
||||
type: String,
|
||||
default: 'detail',
|
||||
},
|
||||
propData: {
|
||||
type: [Object, null],
|
||||
default: null,
|
||||
},
|
||||
propDataBase: {
|
||||
type: [Object, null],
|
||||
default: null,
|
||||
},
|
||||
propEmojiList: {
|
||||
type: [Array, null],
|
||||
default: [],
|
||||
},
|
||||
propShareInfo: {
|
||||
type: [Object, null],
|
||||
default: {},
|
||||
}
|
||||
},
|
||||
components: {
|
||||
componentPopup,
|
||||
componentSharePopup,
|
||||
componentEmojiPopup,
|
||||
},
|
||||
|
||||
// 页面被展示
|
||||
created: function (e) {
|
||||
var avatar = app.globalData.data.default_user_head_src;
|
||||
var user = app.globalData.get_user_cache_info() || null;
|
||||
this.setData({
|
||||
user: user,
|
||||
avatar: user == null ? avatar : user.avatar || avatar,
|
||||
data: this.propData,
|
||||
data_base: this.propDataBase,
|
||||
emoji_list: this.propEmojiList,
|
||||
});
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 分享开启弹层
|
||||
popup_share_event(e) {
|
||||
if ((this.$refs.share || null) != null) {
|
||||
this.$refs.share.init({
|
||||
share_info: this.propShareInfo
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 评论弹窗关闭
|
||||
modal_close_event(e) {
|
||||
this.setData({
|
||||
input_comments_modal_status: false,
|
||||
input_comments_modal_index: 0,
|
||||
input_comments_modal_username: '',
|
||||
input_comments_modal_ask_comments_id: 0,
|
||||
input_comments_modal_reply_comments_id: 0,
|
||||
input_comments_value: '',
|
||||
});
|
||||
},
|
||||
|
||||
// 评论弹窗开启
|
||||
modal_open_event(e) {
|
||||
if (!app.globalData.is_single_page_check()) {
|
||||
return false;
|
||||
}
|
||||
var user = app.globalData.get_user_info(this, 'modal_open_event', e);
|
||||
if (user != false) {
|
||||
var index = parseInt(e.currentTarget.dataset.index || 0);
|
||||
var username = e.currentTarget.dataset.username;
|
||||
var ask_comments_id = e.currentTarget.dataset.askcommentsid || 0;
|
||||
var reply_comments_id = e.currentTarget.dataset.replycommentsid || 0;
|
||||
this.setData({
|
||||
input_comments_modal_status: true,
|
||||
input_comments_value: '',
|
||||
input_comments_modal_index: index,
|
||||
input_comments_modal_username: username,
|
||||
input_comments_modal_ask_comments_id: ask_comments_id,
|
||||
input_comments_modal_reply_comments_id: reply_comments_id,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 表情选择事件
|
||||
emoji_event() {
|
||||
if (this.input_comments_length_value == 0) {
|
||||
app.globalData.showToast(this.$t('ask-comments.ask-comments.3o1rq6'));
|
||||
return false;
|
||||
}
|
||||
if ((this.$refs.emoji || null) != null) {
|
||||
this.$refs.emoji.init({ emoji_list: this.emoji_list });
|
||||
}
|
||||
},
|
||||
|
||||
// 评论输入和失去焦点事件
|
||||
comments_input_event(e) {
|
||||
var value = e.detail.value.trim();
|
||||
var length = this.input_comments_length_max - value.length;
|
||||
this.setData({
|
||||
input_comments_cursor: e.detail.cursor || 0,
|
||||
input_comments_value: value,
|
||||
input_comments_length_value: length <= 0 ? 0 : length,
|
||||
});
|
||||
},
|
||||
|
||||
// 表情选择确认事件
|
||||
emoji_choice_confirm_event(emoji) {
|
||||
var value = this.input_comments_value;
|
||||
var cursor = parseInt(this.input_comments_cursor || 0);
|
||||
if (value != '') {
|
||||
if (cursor == 0) {
|
||||
value = emoji + value;
|
||||
} else {
|
||||
var first = value.substr(0, cursor);
|
||||
var last = value.substr(cursor, value.length);
|
||||
value = first + emoji + last;
|
||||
}
|
||||
} else {
|
||||
value = emoji;
|
||||
}
|
||||
var length = this.input_comments_length_max - value.length;
|
||||
this.setData({
|
||||
input_comments_value: value,
|
||||
input_comments_length_value: length <= 0 ? 0 : length,
|
||||
});
|
||||
},
|
||||
|
||||
// 获取评论列表
|
||||
comments_list_reply_event(e) {
|
||||
var temp_data = this.data;
|
||||
var page = 1;
|
||||
var index = parseInt(e.currentTarget.dataset.index || 0);
|
||||
var ask_id = e.currentTarget.dataset.askid;
|
||||
var ask_comments_id = e.currentTarget.dataset.askcommentsid || 0;
|
||||
if (ask_comments_id == 0) {
|
||||
if ((temp_data['page'] || null) == null) {
|
||||
temp_data['page'] = 1;
|
||||
} else {
|
||||
temp_data['page'] += 1;
|
||||
}
|
||||
page = temp_data['page'];
|
||||
} else {
|
||||
if ((temp_data['comments_list'][index]['page'] || null) == null) {
|
||||
temp_data['comments_list'][index]['page'] = 1;
|
||||
} else {
|
||||
temp_data['comments_list'][index]['page'] += 1;
|
||||
}
|
||||
page = temp_data['comments_list'][index]['page'];
|
||||
}
|
||||
uni.showLoading({
|
||||
title: this.$t('common.loading_in_text'),
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('commentsreplylist', 'index', 'ask'),
|
||||
method: 'POST',
|
||||
data: {
|
||||
ask_id: ask_id,
|
||||
ask_comments_id: ask_comments_id,
|
||||
page: page,
|
||||
},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
if (ask_comments_id == 0) {
|
||||
var temp_list = temp_data['comments_list'] || [];
|
||||
} else {
|
||||
var temp_list = temp_data['comments_list'][index]['reply_comments_list'] || [];
|
||||
}
|
||||
var data = res.data.data.data;
|
||||
for (var i in data) {
|
||||
temp_list.push(data[i]);
|
||||
}
|
||||
if (ask_comments_id == 0) {
|
||||
temp_data['comments_list'] = temp_list;
|
||||
temp_data['is_comments_list_submit'] = res.data.data.page >= res.data.data.page_total ? 0 : 1;
|
||||
} else {
|
||||
temp_data['comments_list'][index]['reply_comments_list'] = temp_list;
|
||||
temp_data['comments_list'][index]['is_comments_list_submit'] = res.data.data.page >= res.data.data.page_total ? 0 : 1;
|
||||
}
|
||||
this.setData({ data: temp_data });
|
||||
} else {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 评论
|
||||
comments_event(e) {
|
||||
if (!app.globalData.is_single_page_check()) {
|
||||
return false;
|
||||
}
|
||||
var user = app.globalData.get_user_info(this, 'comments_event', e);
|
||||
if (user != false) {
|
||||
if (this.input_comments_value == '') {
|
||||
app.globalData.showToast(this.$t('user-order-comments.user-order-comments.8f303u'));
|
||||
return false;
|
||||
}
|
||||
uni.showLoading({
|
||||
title: this.$t('buy.buy.r79t77'),
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('comments', 'index', 'ask'),
|
||||
method: 'POST',
|
||||
data: {
|
||||
ask_id: this.data.id,
|
||||
content: this.input_comments_value,
|
||||
ask_comments_id: this.input_comments_modal_ask_comments_id,
|
||||
reply_comments_id: this.input_comments_modal_reply_comments_id,
|
||||
},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
var temp_data = this.data;
|
||||
if ((this.input_comments_modal_ask_comments_id || 0) == 0) {
|
||||
var temp_list = temp_data.comments_list || [];
|
||||
temp_list.splice(0, 0, res.data.data);
|
||||
temp_data['comments_list'] = temp_list;
|
||||
temp_data['comments_count'] = parseInt(temp_data['comments_count']) + 1;
|
||||
} else {
|
||||
var index = this.input_comments_modal_index;
|
||||
var temp_list = temp_data.comments_list[index]['reply_comments_list'] || [];
|
||||
temp_list.splice(0, 0, res.data.data);
|
||||
if ((this.input_comments_modal_reply_comments_id || 0) != 0) {
|
||||
for (var i in temp_list) {
|
||||
if (temp_list[i]['id'] == this.input_comments_modal_reply_comments_id) {
|
||||
temp_list[i]['comments_count'] = parseInt(temp_list[i]['comments_count']) + 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
temp_data.comments_list[index]['reply_comments_list'] = temp_list;
|
||||
temp_data.comments_list[index]['comments_count'] = parseInt(temp_data.comments_list[index]['comments_count']) + 1;
|
||||
}
|
||||
this.setData({
|
||||
data: temp_data,
|
||||
input_comments_value: '',
|
||||
input_comments_length_value: this.input_comments_length_max,
|
||||
input_comments_modal_status: false,
|
||||
input_comments_modal_index: 0,
|
||||
input_comments_modal_username: '',
|
||||
input_comments_modal_ask_comments_id: 0,
|
||||
input_comments_modal_reply_comments_id: 0,
|
||||
});
|
||||
} else {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 点赞
|
||||
give_thumbs_event(e) {
|
||||
if (!app.globalData.is_single_page_check()) {
|
||||
return false;
|
||||
}
|
||||
var user = app.globalData.get_user_info(this, 'give_thumbs_event', e);
|
||||
if (user != false) {
|
||||
var type = parseInt(e.currentTarget.dataset.type || 0);
|
||||
var ask_id = e.currentTarget.dataset.askid;
|
||||
var ask_comments_id = e.currentTarget.dataset.askcommentsid || 0;
|
||||
var reply_comments_id = e.currentTarget.dataset.replycommentsid || 0;
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('givethumbs', 'index', 'ask'),
|
||||
method: 'POST',
|
||||
data: {
|
||||
ask_id: ask_id,
|
||||
ask_comments_id: ask_comments_id,
|
||||
reply_comments_id: reply_comments_id,
|
||||
},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
var temp_data = this.data;
|
||||
switch (type) {
|
||||
// 博客
|
||||
case 0:
|
||||
temp_data.is_give_thumbs = data.is_active;
|
||||
temp_data.give_thumbs_count = data.count;
|
||||
break;
|
||||
// 博客评论
|
||||
case 1:
|
||||
var index = parseInt(e.currentTarget.dataset.index || 0);
|
||||
temp_data['comments_list'][index]['is_give_thumbs'] = data.is_active;
|
||||
temp_data['comments_list'][index]['give_thumbs_count'] = data.count;
|
||||
break;
|
||||
// 博客评论回复
|
||||
case 2:
|
||||
var index = parseInt(e.currentTarget.dataset.index || 0);
|
||||
var indexs = parseInt(e.currentTarget.dataset.indexs || 0);
|
||||
temp_data['comments_list'][index]['reply_comments_list'][indexs]['is_give_thumbs'] = data.is_active;
|
||||
temp_data['comments_list'][index]['reply_comments_list'][indexs]['give_thumbs_count'] = data.count;
|
||||
break;
|
||||
}
|
||||
this.setData({ data: temp_data });
|
||||
} else {
|
||||
if (app.globalData.is_login_check(res.data)) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// url事件
|
||||
url_event(e) {
|
||||
app.globalData.url_event(e);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
/**
|
||||
* 聚合点赞、评论、分享
|
||||
*/
|
||||
.ask-comments-bottom-container .item:not(:last-child) {
|
||||
margin-right: 64rpx;
|
||||
}
|
||||
.ask-comments-reply-container .emoji-icon,
|
||||
.ask-comments-modal .emoji-icon {
|
||||
width: 40rpx;
|
||||
height: 40rpx !important;
|
||||
}
|
||||
.ask-comments-reply-container .user-avatar {
|
||||
width: 72rpx;
|
||||
height: 72rpx !important;
|
||||
border: 1px solid #eee;
|
||||
}
|
||||
.ask-comments-reply-container .right-base {
|
||||
padding-left: 16rpx;
|
||||
}
|
||||
.ask-comments-reply-container .right-base .comments {
|
||||
background-color: #f8f8f8;
|
||||
}
|
||||
.ask-comments-reply-container .right-base .textarea {
|
||||
height: 120rpx;
|
||||
}
|
||||
.ask-comments-modal {
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: calc(100% - 80rpx);
|
||||
height: 100%;
|
||||
background: rgba(0, 0, 0, 0.6);
|
||||
padding: 40rpx;
|
||||
z-index: 10;
|
||||
}
|
||||
.ask-comments-modal-content {
|
||||
padding: 10px;
|
||||
border-radius: 10px;
|
||||
margin: 0 auto;
|
||||
margin-top: 30%;
|
||||
max-width: calc(800px - 180rpx);
|
||||
}
|
||||
.ask-comments-modal-content .textarea {
|
||||
height: 200rpx;
|
||||
}
|
||||
.ask-comments-modal-content .close {
|
||||
top: 20rpx;
|
||||
right: 20rpx;
|
||||
}
|
||||
.comment-btn {
|
||||
height: 56rpx;
|
||||
line-height: 56rpx;
|
||||
padding: 0 24rpx;
|
||||
}
|
||||
.comment-btn-default {
|
||||
border: 2rpx solid #d8dadc;
|
||||
background-color: #d8dadc;
|
||||
}
|
||||
|
||||
/**
|
||||
* 评论列表
|
||||
*/
|
||||
.ask-comments-list > .item .user-avatar {
|
||||
width: 72rpx;
|
||||
height: 72rpx;
|
||||
border: 1px solid #eee;
|
||||
}
|
||||
.ask-comments-list .comments-base,
|
||||
.ask-comments-list .comments-content {
|
||||
padding-left: 16rpx;
|
||||
padding-right: 20rpx;
|
||||
}
|
||||
.reply-ask-comments-list {
|
||||
margin-top: 28rpx;
|
||||
}
|
||||
.reply-ask-comments-list .right-content {
|
||||
padding-left: 16rpx;
|
||||
}
|
||||
</style>
|
||||
46
pages/plugins/ask/detail/detail.css
Normal file
46
pages/plugins/ask/detail/detail.css
Normal file
@@ -0,0 +1,46 @@
|
||||
.admin-img {
|
||||
width: 68rpx;
|
||||
height: 68rpx !important;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品链接
|
||||
*/
|
||||
.goods-link .img {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
}
|
||||
|
||||
.goods-link .title {
|
||||
min-height: 40rpx;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 猜你喜欢
|
||||
*/
|
||||
.guess-like {
|
||||
position: relative;
|
||||
text-align: center;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.guess-like::before,
|
||||
.guess-like::after {
|
||||
content: "";
|
||||
width: 76px;
|
||||
height: 1px;
|
||||
background: #dddddd;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
|
||||
.guess-like::before {
|
||||
left: calc(100% + 20rpx);
|
||||
}
|
||||
|
||||
.guess-like::after {
|
||||
right: calc(100% + 20rpx);
|
||||
}
|
||||
244
pages/plugins/ask/detail/detail.vue
Normal file
244
pages/plugins/ask/detail/detail.vue
Normal file
@@ -0,0 +1,244 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view v-if="(info || null) !== null" :class="(data_base.is_user_add_ask || 0) == 1 ? 'page-bottom-fixed' : ''">
|
||||
<!-- true为空对象 false为非空对象 Object.keys(info).length == 0 -->
|
||||
<view class="ask-container bg-white spacing-mb">
|
||||
<view class="padding-main">
|
||||
<view v-if="(info.title || null) != null" class="fw-b text-size-xl spacing-mb">{{ info.title }}</view>
|
||||
<view class="cr-grey-9 text-size-xs margin-bottom-sm flex-row">
|
||||
{{ $t('detail.detail.kt41ki') }}{{ info.add_time_date }}
|
||||
<view class="fw-b padding-horizontal-xs">·</view>
|
||||
{{ info.access_count || '0' }}{{ $t('detail.detail.e6ga1y') }}
|
||||
</view>
|
||||
<view v-if="info.title != info.content">
|
||||
<mp-html :content="info.content" />
|
||||
</view>
|
||||
<block v-if="(info.goods || null) !== null">
|
||||
<view :data-value="info.goods.goods_url" @tap="url_event" class="cp">
|
||||
<view class="goods-link spacing-mt bg-grey-f9 padding-main border-radius-sm">
|
||||
<view class="flex-row jc-sb">
|
||||
<view class="img border-radius-sm oh margin-right-main">
|
||||
<image :src="info.goods.images" mode="widthFix" class="wh-auto"></image>
|
||||
</view>
|
||||
<view class="flex-1 flex-width flex-row jc-sb align-c">
|
||||
<view class="flex-1 flex-width padding-right-sm">
|
||||
<view class="title multi-text">{{ info.goods.title }}</view>
|
||||
<view class="flex-row align-c margin-top-xs">
|
||||
<text class="cr-red fw-b margin-right-main">{{ currency_symbol }}{{ info.goods.price }}</text>
|
||||
<text class="text-size-xs cr-grey-9 original-price">{{ currency_symbol }}{{ info.goods.original_price }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<iconfont name="icon-arrow-right" color="#999"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<view v-if="info.is_reply && info.is_reply === '1'" class="padding-main br-t-dashed">
|
||||
<view class="flex-row jc-sb align-c">
|
||||
<view class="flex-row align-c">
|
||||
<image v-if="(logo_square || null) != null" :src="logo_square" mode="widthFix" class="admin-img circle br-f5 margin-right-sm"></image>
|
||||
<text>{{ $t('detail.detail.ng628i') }}</text>
|
||||
</view>
|
||||
<view v-if="(info.reply_time_date || null) != null" class="cr-grey-9 text-size-xs">{{ $t('detail.detail.7rg4bb') }}{{ info.reply_time_date }}</view>
|
||||
</view>
|
||||
<view class="padding-top-main">
|
||||
<mp-html :content="info.reply" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="padding-main br-t-dashed">
|
||||
<!-- 评论内容 -->
|
||||
<component-ask-comments :propData="info" :propDataBase="data_base" :propEmojiList="emoji_list" :propShareInfo="share_info"></component-ask-comments>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 猜你喜欢 -->
|
||||
<view v-if="goods_list.length > 0" class="padding-horizontal-main padding-top-sm">
|
||||
<view class="tc spacing-mb">
|
||||
<view class="guess-like fw-b text-size-md">{{ $t('goods-detail.goods-detail.v2974w') }}</view>
|
||||
</view>
|
||||
<component-goods-list :propData="{ style_type: 1, goods_list: goods_list, random: random_value }" :propLabel="plugins_label_data" :propCurrencySymbol="currency_symbol" propSource="detail" @CartSuccessEvent="cart_success_event"></component-goods-list>
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</view>
|
||||
<view v-if="(data_base.is_user_add_ask || 0) == 1" class="bottom-fixed" :style="bottom_fixed_style">
|
||||
<view class="bottom-line-exclude">
|
||||
<view class="item flex-row jc-sa align-c text-size fw-b br bg-white round padding-vertical">
|
||||
<view data-value="/pages/plugins/ask/form/form" @tap="url_event" class="flex-1 tc flex-col jc-c align-c cp">
|
||||
<view class="divider-r-d wh-auto"> <iconfont name="icon-edit-below-line" size="30rpx" color="#333" propClass="margin-right-sm"></iconfont>{{ $t('goods-detail.goods-detail.7ulh8b') }}</view>
|
||||
</view>
|
||||
<view data-value="/pages/plugins/ask/user-list/user-list" @tap="url_event" class="flex-1 tc flex-col jc-c align-c cp">
|
||||
<view class="wh-auto"> <iconfont name="icon-list-dot" size="32rpx" color="#333" propClass="margin-right-sm pr top-xs"></iconfont>{{ $t('detail.detail.p7o522') }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</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';
|
||||
import componentGoodsList from '@/components/goods-list/goods-list';
|
||||
import componentAskComments from '../components/ask-comments/ask-comments';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
logo_square: app.globalData.get_application_logo_square(),
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: true,
|
||||
bottom_fixed_style: '',
|
||||
info: null,
|
||||
data_base: null,
|
||||
emoji_list: [],
|
||||
// 基础配置
|
||||
currency_symbol: app.globalData.currency_symbol(),
|
||||
// 猜你喜欢 参数
|
||||
goods_list: [],
|
||||
goods_is_loading: 0,
|
||||
goods_total: 0,
|
||||
goods_page_total: 0,
|
||||
goods_page: 1,
|
||||
// 标签插件
|
||||
plugins_label_data: null,
|
||||
// 增加随机数,避免无法监听数据列表内部数据更新
|
||||
random_value: 0,
|
||||
params: '',
|
||||
// 自定义分享信息
|
||||
share_info: {},
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
componentGoodsList,
|
||||
componentAskComments,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: app.globalData.launch_params_handle(params),
|
||||
});
|
||||
|
||||
// 获取数据
|
||||
this.get_data();
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.get_data();
|
||||
},
|
||||
|
||||
methods: {
|
||||
get_data(is_mandatory) {
|
||||
// 分页是否还有数据
|
||||
if ((is_mandatory || 0) == 0) {
|
||||
if (this.goods_bottom_line_status == true) {
|
||||
uni.stopPullDownRefresh();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// 是否加载中
|
||||
if (this.goods_is_loading == 1) {
|
||||
return false;
|
||||
}
|
||||
this.setData({
|
||||
goods_is_loading: 1,
|
||||
});
|
||||
// 获取数据
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('detail', 'index', 'ask'),
|
||||
method: 'POST',
|
||||
data: this.params,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
let data = res.data.data;
|
||||
var info = data.data || null;
|
||||
this.setData({
|
||||
info: info,
|
||||
data_base: data.base || null,
|
||||
emoji_list: data.emoji_list || [],
|
||||
goods_list: data.goods,
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: 0,
|
||||
goods_is_loading: 0,
|
||||
});
|
||||
|
||||
if (info != null) {
|
||||
// 基础自定义分享
|
||||
this.setData({
|
||||
share_info: {
|
||||
title: info.title,
|
||||
desc: info.content,
|
||||
path: '/pages/plugins/ask/detail/detail',
|
||||
query: 'id=' + info.id,
|
||||
},
|
||||
});
|
||||
|
||||
// 标题
|
||||
uni.setNavigationBarTitle({ title: info.title || info.content });
|
||||
}
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_msg: res.data.msg,
|
||||
data_list_loding_status: 0,
|
||||
goods_is_loading: 0,
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_msg: this.$t('common.internet_error_tips'),
|
||||
data_list_loding_status: 2,
|
||||
goods_is_loading: 0,
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 猜你喜欢加入购物车回调
|
||||
cart_success_event() {
|
||||
// 传1表示为购物车回调方法调用的此方法
|
||||
this.get_data(1);
|
||||
},
|
||||
|
||||
// url事件
|
||||
url_event(e) {
|
||||
app.globalData.url_event(e);
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
@import './detail.css';
|
||||
</style>
|
||||
3
pages/plugins/ask/form/form.css
Normal file
3
pages/plugins/ask/form/form.css
Normal file
@@ -0,0 +1,3 @@
|
||||
.form-container .form-gorup .textarea-height {
|
||||
min-height: 200rpx !important;
|
||||
}
|
||||
318
pages/plugins/ask/form/form.vue
Normal file
318
pages/plugins/ask/form/form.vue
Normal file
@@ -0,0 +1,318 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<form v-if="data_list_loding_status == 3" @submit="formSubmit" class="form-container">
|
||||
<view class="padding-main oh page-bottom-fixed">
|
||||
<view class="form-gorup border-radius-main oh flex-row jc-sb align-c margin-bottom-main">
|
||||
<view class=""> 标题 <text class="form-group-tips-must">*</text></view>
|
||||
<view class="flex-row align-c flex-1 flex-width">
|
||||
<input type="text" name="title" :value="data.title" maxlength="16" placeholder-class="cr-grey-9 tr" class="cr-base tr" placeholder="请输入标题" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-gorup border-radius-main margin-bottom-main">
|
||||
<view class="margin-bottom-sm">提问内容 <text class="form-group-tips-must">*</text></view>
|
||||
<sp-editor @init="initEditor" @input="rich_text_event" @upinImage="up_in_image_event"></sp-editor>
|
||||
</view>
|
||||
<view class="form-gorup border-radius-main oh flex-row jc-sb align-c margin-bottom-main">
|
||||
<view class=""> 提问分类 </view>
|
||||
<view class="flex-row jc-e align-c flex-1 flex-width">
|
||||
<picker @change="select_change_event" :value="category_id_index" :range="ask_category_list" range-key="name" name="category_id" data-field="category_id" class="margin-right-sm wh-auto tr">
|
||||
<view class="uni-input cr-base picker">
|
||||
<template v-if="category_id_index !== -1">
|
||||
{{ ask_category_list[category_id_index].name || '' }}
|
||||
</template>
|
||||
</view>
|
||||
</picker>
|
||||
<iconfont name="icon-arrow-right" size="34rpx" color="#ccc"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="is_show_email_notice == 1" class="form-gorup border-radius-main oh flex-row jc-sb align-c margin-bottom-main">
|
||||
<view class=""> 回复邮件通知 </view>
|
||||
<view class="flex-row align-c flex-1 flex-width">
|
||||
<input type="text" name="email_notice" :value="data.email_notice" placeholder-class="cr-grey-9 tr" class="cr-base tr" placeholder="请输入邮件" />
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="is_show_mobile_notice == 1" class="form-gorup border-radius-main oh flex-row jc-sb align-c margin-bottom-main">
|
||||
<view class="form-gorup-title"> 回复手机通知 </view>
|
||||
<view class="flex-row align-c flex-1 flex-width">
|
||||
<input type="text" name="mobile_notice" :value="data.mobile_notice" maxlength="16" placeholder-class="cr-grey-9 tr" class="cr-base tr" placeholder="请输入手机号" />
|
||||
</view>
|
||||
</view>
|
||||
<!-- 匿名发布 -->
|
||||
<!-- <view class="form-gorup border-radius-main oh flex-row jc-e align-c">
|
||||
<checkbox-group @change="is_anonymous_change_event">
|
||||
<label class="cr-grey-9">
|
||||
<checkbox value="1" :checked="false" :color="theme_color" style="transform: scale(0.7)" />
|
||||
<text class="pr top-xs">{{ $t('form.form.2f52v3') }}</text>
|
||||
</label>
|
||||
</checkbox-group>
|
||||
</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" :loading="form_submit_loading" :disabled="form_submit_loading">{{ $t('form.form.4yd066') }}</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</form>
|
||||
<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 componentUpload from '@/components/upload/upload';
|
||||
const theme_color = app.globalData.get_theme_color();
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
theme_color: theme_color,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: this.$t('form.form.bniyyt'),
|
||||
params: {},
|
||||
form_submit_loading: false,
|
||||
is_anonymous: '0',
|
||||
editor_path_type: '',
|
||||
|
||||
data: {},
|
||||
ask_category_list: [],
|
||||
is_show_email_notice: 0,
|
||||
is_show_mobile_notice: 0,
|
||||
category_id_index: -1,
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentUpload,
|
||||
},
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle();
|
||||
},
|
||||
|
||||
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: 2,
|
||||
data_list_loding_msg: this.$t('form.form.8l3ul5'),
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 获取初始化信息
|
||||
get_data_list() {
|
||||
uni.showLoading({
|
||||
title: this.$t('common.loading_in_text'),
|
||||
});
|
||||
// 网络请求
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('saveinfo', 'ask', 'ask'),
|
||||
method: 'POST',
|
||||
data: { id: this.params.id || null },
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
var data = res.data.data;
|
||||
if (res.data.code == 0) {
|
||||
this.setData({
|
||||
data_bottom_line_status: true,
|
||||
data_list_loding_status: 3,
|
||||
data: data.data || {},
|
||||
ask_category_list: data.ask_category_list || [],
|
||||
editor_path_type: data.editor_path_type,
|
||||
is_show_email_notice: data.is_show_email_notice,
|
||||
is_show_mobile_notice: data.is_show_mobile_notice,
|
||||
category_id_index: (data.ask_category_list || []).length > 0 && data.data != null ? data.ask_category_list.findIndex((item) => item.id === data.data.category_id) : -1,
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 表单提交
|
||||
formSubmit(e) {
|
||||
// 数据验证
|
||||
var validation = [
|
||||
{ fields: 'content', msg: this.$t('form.form.5v5bjs') },
|
||||
{ fields: 'title', msg: this.$t('form.form.5v5bjs') },
|
||||
];
|
||||
const new_data = {
|
||||
goods_id: this.params.goods_id || 0,
|
||||
id: this.params.id || null,
|
||||
...e.detail.value,
|
||||
content: this.data.content,
|
||||
category_id: this.data.category_id,
|
||||
};
|
||||
if (app.globalData.fields_check(new_data, validation)) {
|
||||
uni.showLoading({
|
||||
title: this.$t('buy.buy.r79t77'),
|
||||
});
|
||||
this.setData({
|
||||
form_submit_loading: true,
|
||||
});
|
||||
// 网络请求
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('save', 'ask', 'ask'),
|
||||
method: 'POST',
|
||||
data: new_data,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
app.globalData.showToast(res.data.msg, 'success');
|
||||
setTimeout(function () {
|
||||
app.globalData.url_open('/pages/plugins/ask/user-list/user-list', true);
|
||||
}, 2000);
|
||||
} else {
|
||||
this.setData({
|
||||
form_submit_loading: 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_loading: false,
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// // 匿名发布
|
||||
// is_anonymous_change_event(e) {
|
||||
// this.setData({
|
||||
// is_anonymous: e.detail.value.length > 0 ? e.detail.value[0] : 0,
|
||||
// });
|
||||
// },
|
||||
|
||||
initEditor(editor) {
|
||||
// 初始化编辑器内容
|
||||
editor.setContents({
|
||||
html: (this.data || null) !== null ? this.data.content : '',
|
||||
});
|
||||
},
|
||||
|
||||
// 回调富文本内容
|
||||
rich_text_event(e) {
|
||||
var new_data = this.data;
|
||||
new_data.content = e.html;
|
||||
this.setData({
|
||||
data: new_data,
|
||||
});
|
||||
},
|
||||
|
||||
// 上传图片
|
||||
up_in_image_event(tempFiles, editorCtx) {
|
||||
var self = this;
|
||||
// 使用 uniCloud.uploadFile 上传图片的示例方法(可适用多选上传)
|
||||
tempFiles.forEach(async (item) => {
|
||||
uni.showLoading({
|
||||
title: self.$t('form.form.2e5rv3'),
|
||||
mask: true,
|
||||
});
|
||||
await uni.uploadFile({
|
||||
url: app.globalData.get_request_url('index', 'ueditor'),
|
||||
// #ifdef APP-PLUS || H5
|
||||
filePath: item.path,
|
||||
// #endif
|
||||
// #ifdef MP-WEIXIN
|
||||
filePath: item.tempFilePath,
|
||||
// #endif
|
||||
name: 'upfile',
|
||||
formData: {
|
||||
action: 'uploadimage',
|
||||
path_type: this.editor_path_type, // 路径类型,默认common
|
||||
},
|
||||
success: function (res) {
|
||||
let data = JSON.parse(res.data);
|
||||
if (res.statusCode == 200) {
|
||||
// 上传完成后处理
|
||||
editorCtx.insertImage({
|
||||
src: data.data.url, // 此处需要将图片地址切换成服务器返回的真实图片地址
|
||||
// width: '50%',
|
||||
alt: self.$t('common.video'),
|
||||
success: function (e) {},
|
||||
});
|
||||
uni.hideLoading();
|
||||
}
|
||||
},
|
||||
fail: function (e) {
|
||||
app.globalData.showToast(e.errMsg);
|
||||
uni.hideLoading();
|
||||
},
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
// 分类选择事件
|
||||
select_change_event(e) {
|
||||
var temp = this.data;
|
||||
const category_id = this.ask_category_list[e.detail.value].id;
|
||||
temp[e.currentTarget.dataset.field] = category_id;
|
||||
this.setData({
|
||||
data: temp,
|
||||
category_id_index: e.detail.value,
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
@import './form.css';
|
||||
</style>
|
||||
23
pages/plugins/ask/goods-list/goods-list.css
Normal file
23
pages/plugins/ask/goods-list/goods-list.css
Normal file
@@ -0,0 +1,23 @@
|
||||
|
||||
|
||||
.question .title{
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
line-height: 40rpx;
|
||||
background: #fd9525;
|
||||
border-radius: 4rpx;
|
||||
}
|
||||
.question .avatar,
|
||||
.ask .avatar {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
border-radius: 4rpx;
|
||||
background: #F5F5F5;
|
||||
}
|
||||
.ask .title{
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
line-height: 40rpx;
|
||||
background: #99BB12;
|
||||
border-radius: 4rpx;
|
||||
}
|
||||
332
pages/plugins/ask/goods-list/goods-list.vue
Normal file
332
pages/plugins/ask/goods-list/goods-list.vue
Normal file
@@ -0,0 +1,332 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<block v-if="data_list.length > 0">
|
||||
<scroll-view :scroll-y="true" class="scroll-box padding-main bs-bb" @scrolltolower="scroll_lower" lower-threshold="60">
|
||||
<view v-for="(item, index) in data_list" :key="index" class="bg-white border-radius-main padding-main oh" :class="data_list.length > index + 1 ? 'spacing-mb' : ''">
|
||||
<view class="title flex-row jc-sb align-c wh-auto">
|
||||
<view class="name flex-1 flex-width cr-base">{{ item.name }}{{$t('goods-list.goods-list.27nkjm')}}</view>
|
||||
<view class="date cr-grey-9">{{ item.add_time_date }}</view>
|
||||
</view>
|
||||
<view class="question spacing-mt">
|
||||
<view :data-value="item.url" @tap="url_event" class="flex-row cp">
|
||||
<view class="title cr-white tc margin-right-sm">{{$t('goods-list.goods-list.00n7i3')}}</view>
|
||||
<view class="flex-1 flex-width">
|
||||
<mp-html :content="item.content" />
|
||||
<view v-if="(item.images || null) != null && item.images.length > 0" class="avatar spacing-mt-10 radius margin-right-sm oh">
|
||||
<image v-for="(img, i) in item.images" class="wh-auto" @tap="comment_images_show_event" :data-index="i" :data-ix="i + 1" :src="img" mode="aspectFit"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<block v-if="item.is_reply == 1 || (item.reply || null) != null">
|
||||
<view class="ask flex-row spacing-mt">
|
||||
<view class="title cr-white tc margin-right-sm">{{$t('goods-list.goods-list.rw12i7')}}</view>
|
||||
<view class="flex-1 flex-width">
|
||||
<view class="padding-bottom-main">
|
||||
<mp-html :content="item.reply" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-if="item.bool_more && (item.comments_list || null) != null && item.comments_list.length > 0">
|
||||
<block v-for="(it, ix) in item.comments_list" :key="ix">
|
||||
<view class="cr-base br-t-f9 padding-vertical-main">{{ it.content }}</view>
|
||||
<view v-if="(it.images || null) != null && it.images.length > 0" class="avatar spacing-mt-10 radius margin-right-sm oh">
|
||||
<block v-for="(img, i) in it.images">
|
||||
<image class="wh-auto" @tap="comment_images_show_event" :data-index="i" :data-ix="i + 1" :src="img" mode="aspectFit"></image>
|
||||
</block>
|
||||
</view>
|
||||
</block>
|
||||
</block>
|
||||
<view v-if="item.comments_count > 0" class="more flex-row jc-e align-c br-t-f9 padding-top-main">
|
||||
<view v-if="(item.hide_more || false) === false && ((item.hide_comments_list_num === 0 && !item.bool_more) || (item.hide_comments_list_num == undefined || item.hide_comments_list_num > 0))" class="cr-red text-size-xs" @tap="open_more(item.id, index)">
|
||||
<text v-if="item.hide_comments_list_num === 0 && !item.bool_more">{{$t('common.view_more')}}</text>
|
||||
<text v-if="item.hide_comments_list_num == undefined || item.hide_comments_list_num > 0">{{$t('goods-list.goods-list.278qr1')}}{{ item.hide_comments_list_num || item.comments_count }}{{$t('goods-list.goods-list.8y3cc7')}}</text>
|
||||
<iconfont :name="item.bool_more ? 'icon-arrow-bottom' : 'icon-arrow-top'" size="24rpx" propClass="pr top-xs"></iconfont>
|
||||
</view>
|
||||
<view v-if="item.bool_more" class="cr-red text-size-xs margin-left-main" @tap="close_more(index)">
|
||||
<text>{{$t('goods-list.goods-list.aem3e6')}}</text>
|
||||
<iconfont name="icon-arrow-top" size="24rpx" propClass="pr top-xs"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</scroll-view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status"></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(),
|
||||
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: {},
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
},
|
||||
|
||||
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.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'),
|
||||
});
|
||||
}
|
||||
|
||||
// 获取数据
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('datalist', 'index', 'ask'),
|
||||
method: 'POST',
|
||||
data: {
|
||||
page: this.data_page,
|
||||
goods_id: this.params.goods_id || 0,
|
||||
is_comments: 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_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();
|
||||
},
|
||||
|
||||
// 评价图片预览
|
||||
comment_images_show_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'],
|
||||
});
|
||||
},
|
||||
|
||||
// 查看更多
|
||||
open_more(id, i) {
|
||||
var new_data_list = this.data_list;
|
||||
new_data_list[i].bool_more = true;
|
||||
if (new_data_list[i].bool_api === undefined || new_data_list[i].bool_api === true) {
|
||||
// 加载loding
|
||||
uni.showLoading({
|
||||
title: this.$t('common.loading_in_text'),
|
||||
});
|
||||
// 获取数据
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('commentsreplylist', 'index', 'ask'),
|
||||
method: 'POST',
|
||||
data: {
|
||||
ask_id: id,
|
||||
ask_comments_id: 0,
|
||||
page: new_data_list[i].page || 1,
|
||||
is_comments: 1,
|
||||
},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
if (res.data.data.data.length > 0) {
|
||||
if ((new_data_list[i].page || 1) <= 1) {
|
||||
new_data_list[i].comments_list = res.data.data.data;
|
||||
} else {
|
||||
new_data_list[i].comments_list = new_data_list[i].comments_list.concat(res.data.data.data);
|
||||
}
|
||||
new_data_list[i].hide_comments_list_num = res.data.data.total-new_data_list[i].comments_list.length;
|
||||
// 判断当前页数是否小于总页数,如果是则继续显示更多按钮,且当前页+1,如果不是则隐藏更多按钮
|
||||
if (res.data.data.page < res.data.data.page_total) {
|
||||
new_data_list[i].hide_more = false;
|
||||
new_data_list[i].page = (new_data_list[i].page || 1) + 1;
|
||||
} else {
|
||||
new_data_list[i].hide_more = true;
|
||||
}
|
||||
new_data_list[i].page_total = res.data.data.page_total;
|
||||
new_data_list[i].bool_api = true;
|
||||
this.setData({
|
||||
data_list: new_data_list,
|
||||
});
|
||||
}
|
||||
} else {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
} else {
|
||||
// 查看更多是否调用接口
|
||||
new_data_list[i].bool_api = true;
|
||||
// 是否隐藏更多查看按钮
|
||||
new_data_list[i].hide_more = !((new_data_list[i].hide_comments_list_num == undefined && new_data_list[i].comments_count > 0) || new_data_list[i].hide_comments_list_num < new_data_list[i].comments_count);
|
||||
this.setData({
|
||||
data_list: new_data_list,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 收起更多
|
||||
close_more(i) {
|
||||
var new_data_list = this.data_list;
|
||||
// 查看更多是否调用接口
|
||||
new_data_list[i].bool_api = false;
|
||||
// 是否隐藏更多查看按钮
|
||||
new_data_list[i].hide_more = false;
|
||||
// 是否展示更多内容
|
||||
new_data_list[i].bool_more = false;
|
||||
this.setData({
|
||||
data_list: new_data_list,
|
||||
});
|
||||
},
|
||||
|
||||
// url事件
|
||||
url_event(e) {
|
||||
app.globalData.url_event(e);
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
@import './goods-list.css';
|
||||
</style>
|
||||
38
pages/plugins/ask/index/index.css
Normal file
38
pages/plugins/ask/index/index.css
Normal file
@@ -0,0 +1,38 @@
|
||||
.scroll-box {
|
||||
height: calc(100vh - 40px);
|
||||
}
|
||||
|
||||
.status .ask-status {
|
||||
padding: 4rpx 10rpx;
|
||||
}
|
||||
|
||||
.ask-bg-green {
|
||||
background-color: #5FB95E;
|
||||
}
|
||||
|
||||
.ask-bg-yellow {
|
||||
background-color: #FAAD14;
|
||||
}
|
||||
|
||||
.status .num {
|
||||
margin-left: 16rpx;
|
||||
}
|
||||
|
||||
.ask-hot {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
line-height: 32rpx;
|
||||
color: #FFB868;
|
||||
}
|
||||
|
||||
.hot-bg-0 {
|
||||
background: linear-gradient(150deg, #FC6761 0%, #ED4540 100%);
|
||||
}
|
||||
|
||||
.hot-bg-1 {
|
||||
background: linear-gradient(150deg, #FFA12A 0%, #FF8605 100%);
|
||||
}
|
||||
|
||||
.hot-bg-2 {
|
||||
background: linear-gradient(150deg, #FFCE90 0%, #FFAA4E 100%);
|
||||
}
|
||||
324
pages/plugins/ask/index/index.vue
Normal file
324
pages/plugins/ask/index/index.vue
Normal file
@@ -0,0 +1,324 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<component-nav-back :propFixed="false" propClass="bg-white cr-black" propColor="#333" :style="'padding-top:' + (status_bar_height + 5) + 'px;'">
|
||||
<template slot="right" :class="is_mp_env ? 'top-search-width' : ''">
|
||||
<view class="margin-left-main" :class="is_mp_env ? '' : 'flex-1 flex-width'">
|
||||
<component-search @onsearch="search_button_event" propIsOnEvent :propIsRequired="false" propIconColor="#ccc" propPlaceholderClass="cr-grey-c" propBgColor="#f6f6f6"></component-search>
|
||||
</view>
|
||||
</template>
|
||||
</component-nav-back>
|
||||
<scroll-view :scroll-y="true" class="scroll-box" @scrolltolower="scroll_lower" lower-threshold="60" :style="'height: calc(100vh - '+(40+status_bar_height)+'px)'">
|
||||
<view class="wh-auto">
|
||||
<!-- 轮播 -->
|
||||
<view v-if="slider_list.length > 0" class="padding-horizontal-main spacing-mb padding-top-main">
|
||||
<component-banner :propData="slider_list"></component-banner>
|
||||
</view>
|
||||
<!-- tab -->
|
||||
<view v-if="nav_list.length > 0" class="ask-tab flex-row jc-sa align-c bg-white wh-auto left-0 top-0 ps z-i padding-bottom-sm">
|
||||
<view v-for="(item, index) in nav_list" :key="index" class="flex-1 padding-vertical-sm tc" :class="nav_index === index ? 'cr-main fw-b nav-active-line' : 'cr-base'" :data-index="index" :data-type="item.type" @tap="nav_change_event">{{ item.name }}</view>
|
||||
</view>
|
||||
<!-- 内容列表 -->
|
||||
<view :class="(data_base.is_user_add_ask || 0) == 1 ? 'page-bottom-fixed' : ''">
|
||||
<view v-if="data_list.length > 0" class="padding-horizontal-main padding-top-main">
|
||||
<block v-for="(item, index) in data_list" :key="index">
|
||||
<view :data-value="'/pages/plugins/ask/detail/detail?id=' + item.id" @tap="url_event" class="padding-main border-radius-main bg-white oh cp spacing-mb flex-row">
|
||||
<view v-if="nav_index === 1">
|
||||
<view class="ask-hot border-radius-sm tc margin-right-sm va-m pr top-md" :class="index < 3 ? 'cr-white text-size-xs hot-bg-' + index : 'text-size-md'">{{ index + 1 }}</view>
|
||||
</view>
|
||||
<view class="flex-1 flex-width">
|
||||
<view class="title text-size fw-b">{{ item.title }}</view>
|
||||
<view v-if="item.title != item.content" class="content cr-base margin-top-sm padding-top-xs multi-text">
|
||||
<mp-html :content="item.content" />
|
||||
</view>
|
||||
<view class="status flex-row align-c spacing-mt text-size-xs">
|
||||
<view v-if="nav_index !== 1" class="ask-status cr-white border-radius-sm text-size-xss" :class="item.is_reply === '1' ? 'ask-bg-green' : 'ask-bg-yellow'">{{ item.is_reply === '1' ? $t('index.index.1c17n3') : $t('index.index.75l3l2') }}</view>
|
||||
<view class="num cr-grey-9 flex-row self-c">
|
||||
{{ item.add_time_date }}
|
||||
<view class="fw-b padding-horizontal-xs">·</view>
|
||||
{{ item.access_count || '0' }}{{ $t('detail.detail.e6ga1y') }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<!-- 结尾 -->
|
||||
<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" :propLoadingLogoTop="slider_list.length > 0 ? '80%' : '50%'"></component-no-data>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view v-if="(data_base.is_user_add_ask || 0) == 1" class="bottom-fixed" :style="bottom_fixed_style">
|
||||
<view class="bottom-line-exclude">
|
||||
<view class="item flex-row jc-sa align-c text-size fw-b br bg-white round padding-vertical">
|
||||
<view data-value="/pages/plugins/ask/form/form" @tap="url_event" class="flex-1 tc flex-col jc-c align-c cp">
|
||||
<view class="divider-r-d wh-auto"> <iconfont name="icon-edit-below-line" size="30rpx" color="#333" propClass="margin-right-sm"></iconfont>{{ $t('goods-detail.goods-detail.7ulh8b') }}</view>
|
||||
</view>
|
||||
<view data-value="/pages/plugins/ask/user-list/user-list" @tap="url_event" class="flex-1 tc flex-col jc-c align-c cp">
|
||||
<view class="wh-auto"> <iconfont name="icon-list-dot" size="32rpx" color="#333" propClass="margin-right-sm pr top-xs"></iconfont>{{ $t('detail.detail.p7o522') }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</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 componentBottomLine from '@/components/bottom-line/bottom-line';
|
||||
import componentSearch from '@/components/search/search';
|
||||
import componentBanner from '@/components/slider/slider';
|
||||
|
||||
// 状态栏高度
|
||||
var bar_height = parseInt(app.globalData.get_system_info('statusBarHeight', 0));
|
||||
// #ifdef MP-TOUTIAO
|
||||
bar_height = 0;
|
||||
// #endif
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
status_bar_height: bar_height,
|
||||
is_mp_env: false,
|
||||
// #ifdef MP-WEIXIN || MP-BAIDU || MP-ALIPAY || MP-QQ || MP-KUAISHOU
|
||||
is_mp_env: true,
|
||||
// #endif
|
||||
bottom_fixed_style: '',
|
||||
data_base: {},
|
||||
data_list: [],
|
||||
data_total: 0,
|
||||
data_page_total: 0,
|
||||
data_page: 1,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
data_bottom_line_status: false,
|
||||
data_is_loading: 0,
|
||||
// 轮播
|
||||
slider_list: [],
|
||||
// 导航分类
|
||||
nav_list: [],
|
||||
nav_index: 0,
|
||||
nav_type: '',
|
||||
// 搜索框关键字
|
||||
search_bwg: '',
|
||||
// 自定义分享信息
|
||||
share_info: {},
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNavBack,
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
componentSearch,
|
||||
componentBanner
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 加载数据
|
||||
this.get_data();
|
||||
|
||||
// 公共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: {
|
||||
get_data() {
|
||||
// 获取数据
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('index', 'index', 'ask'),
|
||||
method: 'POST',
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
if (res.data.data.search_tab_list.length > 0) {
|
||||
var data_base = res.data.data.base || {};
|
||||
this.setData({
|
||||
data_base: data_base,
|
||||
slider_list: res.data.data.slider_list || [],
|
||||
nav_list: res.data.data.search_tab_list || [],
|
||||
// 基础自定义分享
|
||||
share_info: {
|
||||
title: data_base.seo_title || data_base.application_name || this.$t('goods-detail.goods-detail.k5u755'),
|
||||
desc: data_base.seo_desc || '',
|
||||
path: '/pages/plugins/ask/index/index',
|
||||
},
|
||||
});
|
||||
|
||||
// 拉取列表数据
|
||||
this.get_data_list();
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: this.$t('index.index.17vy72'),
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: this.$t('common.internet_error_tips'),
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
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('datalist', 'index', 'ask'),
|
||||
method: 'POST',
|
||||
data: {
|
||||
page: this.data_page,
|
||||
type: this.nav_type,
|
||||
bwd: this.search_bwg,
|
||||
},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 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: temp_data_list.length > 0 ? 3 : 0,
|
||||
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: 2,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: this.$t('common.internet_error_tips'),
|
||||
data_is_loading: 0,
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 滚动加载
|
||||
scroll_lower(e) {
|
||||
this.get_data_list();
|
||||
},
|
||||
|
||||
// 查询
|
||||
search_button_event(e) {
|
||||
this.setData({
|
||||
search_bwg: e || '',
|
||||
data_page: 1,
|
||||
data_list: []
|
||||
});
|
||||
this.reset_scroll();
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// 重置滑动位置
|
||||
reset_scroll() {
|
||||
this.setData({
|
||||
scroll_top: this.scroll_top_old,
|
||||
});
|
||||
this.$nextTick(() => {
|
||||
this.setData({
|
||||
scroll_top: 0,
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
nav_change_event(e) {
|
||||
// 索引值
|
||||
var index = e.currentTarget.dataset.index || 0;
|
||||
var type = e.currentTarget.dataset.type || 0;
|
||||
this.setData({
|
||||
data_list: [],
|
||||
nav_index: index,
|
||||
nav_type: type,
|
||||
data_page: 1,
|
||||
});
|
||||
this.reset_scroll();
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// url事件
|
||||
url_event(e) {
|
||||
app.globalData.url_event(e);
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
@import './index.css';
|
||||
</style>
|
||||
146
pages/plugins/ask/user-detail/user-detail.vue
Normal file
146
pages/plugins/ask/user-detail/user-detail.vue
Normal file
@@ -0,0 +1,146 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<block v-if="data_list_loding_status != 1 && data.length != 0">
|
||||
<component-panel-content :propData="data" :propDataField="field_list" propExcludeField="content" propTitle="详情"></component-panel-content>
|
||||
|
||||
<component-panel-content propTitle="提问内容">
|
||||
<view class="item br-b-f5 oh padding-vertical-main">
|
||||
<mp-html :content="data.content"></mp-html>
|
||||
</view>
|
||||
</component-panel-content>
|
||||
|
||||
<component-panel-content propTitle="回复内容">
|
||||
<view class="item br-b-f5 oh padding-vertical-main">
|
||||
<mp-html :content="data.reply"></mp-html>
|
||||
</view>
|
||||
</component-panel-content>
|
||||
</block>
|
||||
<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 componentNavBack from '@/components/nav-back/nav-back';
|
||||
import componentNoData from '@/components/no-data/no-data';
|
||||
import componentPanelContent from '@/components/panel-content/panel-content';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
ask_static_url: app.globalData.get_static_url('ask', true),
|
||||
data: {},
|
||||
field_list: [],
|
||||
data_list_loding_status: 1,
|
||||
params: '',
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNavBack,
|
||||
componentNoData,
|
||||
componentPanelContent,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 设置参数
|
||||
if (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();
|
||||
}
|
||||
|
||||
// 分享菜单处理
|
||||
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,
|
||||
data_bottom_line_status: false,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
get_data() {
|
||||
// 获取数据
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('detail', 'ask', 'ask'),
|
||||
method: 'POST',
|
||||
data: this.params,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
this.setData({
|
||||
data: res.data.data.data || [],
|
||||
field_list: res.data.data.field_list || [],
|
||||
data_list_loding_status: 3,
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
});
|
||||
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,
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 顶部返回操作
|
||||
top_nav_left_back_event(e) {
|
||||
app.globalData.page_back_prev_event();
|
||||
},
|
||||
|
||||
// 页面滚动监听
|
||||
onPageScroll(res) {
|
||||
uni.$emit('onPageScroll', res);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
3
pages/plugins/ask/user-list/user-list.css
Normal file
3
pages/plugins/ask/user-list/user-list.css
Normal file
@@ -0,0 +1,3 @@
|
||||
.ask-status {
|
||||
padding: 4rpx 10rpx;
|
||||
}
|
||||
237
pages/plugins/ask/user-list/user-list.vue
Normal file
237
pages/plugins/ask/user-list/user-list.vue
Normal file
@@ -0,0 +1,237 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view class="page-bottom-fixed">
|
||||
<view v-if="data_list.length > 0" class="padding-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-dashed padding-bottom-main flex-row jc-sb align-c">
|
||||
<text class="cr-grey-9">{{ item.add_time_time }}</text>
|
||||
<text class="ask-status margin-left-xs" :class="item.is_reply == 1 ? 'cr-green' : 'cr-grey-c'">{{ item.is_reply_name }}</text>
|
||||
</view>
|
||||
<view :data-value="'/pages/plugins/ask/user-detail/user-detail?id=' + item.id" @tap="url_event" class="content margin-top-main cp">
|
||||
<component-panel-content :propData="item" :propDataField="field_list" :propIsItemShowMax="4" propExcludeField="add_time_time,is_reply" :propIsTerse="true"></component-panel-content>
|
||||
</view>
|
||||
<view class="item-operation tr margin-top-main">
|
||||
<button class="btn round br-grey-9 bg-white text-size-md" type="default" size="mini" @tap="delete_event" :data-value="item.id" hover-class="none">{{ $t('common.del') }}</button>
|
||||
<button v-if="item.is_reply == 0" class="btn round cr-main br-main bg-white text-size-md" type="default" size="mini" :data-value="'/pages/plugins/ask/form/form?id=' + item.id" @tap="url_event" hover-class="none">{{ $t('common.edit') }}</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>
|
||||
|
||||
<view class="bottom-fixed" :style="bottom_fixed_style">
|
||||
<view class="bottom-line-exclude">
|
||||
<button class="item bg-white br-main cr-main round text-size" type="default" data-value="/pages/plugins/ask/form/form" @tap="url_event" hover-class="none">{{ $t('goods-detail.goods-detail.7ulh8b') }}</button>
|
||||
</view>
|
||||
</view>
|
||||
</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 componentPanelContent from '@/components/panel-content/panel-content';
|
||||
|
||||
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,
|
||||
bottom_fixed_style: '',
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
componentPanelContent,
|
||||
},
|
||||
|
||||
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.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'),
|
||||
});
|
||||
}
|
||||
|
||||
// 获取数据
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('index', 'ask', 'ask'),
|
||||
method: 'POST',
|
||||
data: {
|
||||
page: this.data_page,
|
||||
},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
if (this.data_page > 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
if (this.data_page <= 1) {
|
||||
var temp_data_list = res.data.data.data_list;
|
||||
} 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,
|
||||
field_list: res.data.data.field_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_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'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 删除留言
|
||||
delete_event(e) {
|
||||
const value = e.currentTarget.dataset.value;
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('delete', 'ask', 'ask'),
|
||||
method: 'POST',
|
||||
data: {
|
||||
ids: value,
|
||||
},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
if (res.data.code == 0) {
|
||||
this.setData({
|
||||
data_page: 1,
|
||||
});
|
||||
this.get_data_list(1);
|
||||
} 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: () => {
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 滚动加载
|
||||
scroll_lower(e) {
|
||||
this.get_data_list();
|
||||
},
|
||||
|
||||
// url事件
|
||||
url_event(e) {
|
||||
app.globalData.url_event(e);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
@import './user-list.css';
|
||||
</style>
|
||||
87
pages/plugins/binding/detail/detail.css
Normal file
87
pages/plugins/binding/detail/detail.css
Normal file
@@ -0,0 +1,87 @@
|
||||
/**
|
||||
* 商品列表
|
||||
*/
|
||||
.data-list .item .goods-img {
|
||||
width: 160rpx;
|
||||
height: 160rpx !important;
|
||||
}
|
||||
|
||||
.data-list .item .binding-check {
|
||||
width: 40rpx;
|
||||
}
|
||||
|
||||
.data-list .item .spec-choice {
|
||||
height: 40rpx;
|
||||
line-height: 40rpx;
|
||||
padding: 0 34rpx 0 20rpx;
|
||||
}
|
||||
|
||||
.data-list .item .cart-badge-icon {
|
||||
top: -16rpx;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.lose-efficacy {
|
||||
z-index: 1;
|
||||
background: rgba(255, 255, 255, 0.6);
|
||||
}
|
||||
|
||||
.lose-efficacy .rotate {
|
||||
width: 130rpx;
|
||||
transform: rotate(-30deg);
|
||||
}
|
||||
|
||||
.lose-efficacy .rotate-img {
|
||||
width: 100%;
|
||||
transform: rotate(30deg);
|
||||
}
|
||||
|
||||
.lose-efficacy .rotate-text {
|
||||
margin-left: 18rpx;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导航
|
||||
*/
|
||||
.bottom-fixed .left-price {
|
||||
width: calc(100% - 270rpx);
|
||||
}
|
||||
|
||||
.bottom-fixed .right-button {
|
||||
width: 240rpx;
|
||||
}
|
||||
|
||||
.bottom-fixed .right-button .btn {
|
||||
height: 80rpx;
|
||||
line-height: 78rpx;
|
||||
}
|
||||
|
||||
.bottom-fixed .left-price .discount-icon {
|
||||
border-top-right-radius: 30rpx;
|
||||
border-bottom-left-radius: 30rpx;
|
||||
background-image: linear-gradient(45deg, #a3f9a3, #248828, #8bc34a, #d2374c, #9c27b0);
|
||||
background-size: 400%;
|
||||
animation: gradient 5s ease infinite;
|
||||
padding: 0 16rpx;
|
||||
}
|
||||
|
||||
.sales-price .price {
|
||||
font-size: 40rpx;
|
||||
}
|
||||
|
||||
@keyframes gradient {
|
||||
0% {
|
||||
background-position: 0% 50%;
|
||||
}
|
||||
|
||||
50% {
|
||||
background-position: 100% 50%;
|
||||
}
|
||||
|
||||
100% {
|
||||
background-position: 0% 50%;
|
||||
}
|
||||
}
|
||||
415
pages/plugins/binding/detail/detail.vue
Normal file
415
pages/plugins/binding/detail/detail.vue
Normal file
@@ -0,0 +1,415 @@
|
||||
<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">
|
||||
<view class="title-left-border text-size fw-b">{{ data.title }}</view>
|
||||
</view>
|
||||
<view v-if="(data.goods || null) != null && data.goods.length > 0">
|
||||
<!-- 商品 -->
|
||||
<view class="data-list oh">
|
||||
<view v-for="(item, index) in data.goods" :key="index" class="item padding-main border-radius-main bg-white oh spacing-mb flex-row pr">
|
||||
<image class="goods-img dis-block border-radius-main" :src="item.images" mode="aspectFit" :data-value="item.goods_url" @tap="url_event"></image>
|
||||
<view class="right-base flex-1 flex-width padding-left-main">
|
||||
<view class="flex-row jc-c">
|
||||
<view :class="'multi-text flex-1 flex-width ' + (data.type == 1 ? 'padding-right' : '')">{{ item.title }}</view>
|
||||
<label v-if="data.type == 1 && item.is_error == 0" class="tr binding-check pr bottom-sm" :data-index="index" @tap="goods_choice_event">
|
||||
<radio :checked="item.checked == undefined || item.checked == true" :color="theme_color" style="transform: scale(0.7)" />
|
||||
</label>
|
||||
</view>
|
||||
<view class="single-text margin-top-sm flex-row align-c">
|
||||
<view v-if="(item.show_field_price_status || 0) == 1" class="margin-right-lg">
|
||||
<text class="sales-price va-m">
|
||||
<text class="text-size-xs">{{ item.show_price_symbol }}</text>
|
||||
<text class="text-size-lg fw-b">{{ item.price }}</text>
|
||||
</text>
|
||||
<text class="cr-grey text-size-xs va-m">{{ item.show_price_unit }}</text>
|
||||
</view>
|
||||
<view v-if="(item.discount_price || 0) != 0" class="cr-green text-size-xs">{{$t('detail.detail.6026t4')}}<text class="text-size-xs">{{ currency_symbol }}</text>
|
||||
{{ item.discount_price }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="margin-top-xs">
|
||||
<view v-if="item.is_error == 0" class="flex-row jc-sb align-c">
|
||||
<view class="flex-row align-c">
|
||||
<view class="margin-right-sm pr" :data-index="index" @tap="goods_cart_event">
|
||||
<iconfont name="icon-cart-add" size="42rpx" color="#E22C08"></iconfont>
|
||||
<view class="cart-badge-icon pa">
|
||||
<component-badge :propNumber="item.user_cart_count || 0"></component-badge>
|
||||
</view>
|
||||
</view>
|
||||
<text class="cr-grey-9 text-size-xs">{{ item.inventory }}{{ item.inventory_unit }}</text>
|
||||
</view>
|
||||
<view v-if="(item.is_exist_many_spec || 0) == 1" class="bg-grey-e cr-grey round single-text text-size-xss spec-choice" :data-index="index" @tap="spec_choice_event">
|
||||
{{ item.spec_choice_text || $t('detail.detail.9624hp') }}
|
||||
<iconfont name="icon-arrow-bottom" size="14rpx" color="#666" class="pa"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else class="cr-grey-9 text-size-xs">{{ item.error_msg }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="item.is_error !== 0" class="pa left-0 right-0 top-0 bottom-0 lose-efficacy flex-row jc-c align-c">
|
||||
<view class="rotate pr">
|
||||
<image :src="binding_static_url + 'lapse-icon.png'" mode="widthFix" class="dis-block rotate-img"></image>
|
||||
<text class="rotate-text pa cr-red text-size">{{$t('detail.detail.32171c')}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 导航 -->
|
||||
<view class="bottom-fixed br-top-shadow pr bg-white bt">
|
||||
<view class="bottom-line-exclude oh flex-row jc-sb align-c">
|
||||
<view class="left-price">
|
||||
<view class="sales-price single-text">
|
||||
<text class="text-size-xs">
|
||||
{{ currency_symbol }}
|
||||
</text>
|
||||
<text class="price">
|
||||
{{ data.estimate_price }}
|
||||
</text>
|
||||
</view>
|
||||
<view v-if="data.estimate_discount_price != 0" class="single-text estimate-discount-price margin-top-sm">
|
||||
<text class="discount-icon cr-white text-size-xs">{{$t('detail.detail.6026t4')}}</text>
|
||||
<text class="cr-green text-size-md">
|
||||
<text class="text-size-xss">
|
||||
{{ currency_symbol }}
|
||||
</text>
|
||||
{{ data.estimate_discount_price }}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="right-button">
|
||||
<button type="default" size="mini" class="btn bg-main br-main cr-white round text-size fw-b wh-auto" @tap="buy_event">{{$t('detail.detail.27pmj3')}}</button>
|
||||
</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>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
</view>
|
||||
|
||||
<!-- 规格选择 -->
|
||||
<component-goods-spec-choice ref="goods_spec_choice" v-on:specConfirmEvent="spec_confirm_event"></component-goods-spec-choice>
|
||||
|
||||
<!-- 商品购买 -->
|
||||
<component-goods-buy ref="goods_buy" :propCurrencySymbol="currency_symbol" v-on:CartSuccessEvent="goods_cart_back_event"></component-goods-buy>
|
||||
|
||||
<!-- 公共 -->
|
||||
<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 componentGoodsSpecChoice from '@/components/goods-spec-choice/goods-spec-choice';
|
||||
import componentGoodsBuy from '@/components/goods-buy/goods-buy';
|
||||
import componentBadge from '@/components/badge/badge';
|
||||
let binding_static_url = app.globalData.get_static_url('binding', true);
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
binding_static_url: binding_static_url,
|
||||
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: {},
|
||||
theme_color: app.globalData.get_theme_color(),
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
componentGoodsSpecChoice,
|
||||
componentGoodsBuy,
|
||||
componentBadge
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: app.globalData.launch_params_handle(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', 'index', 'binding'),
|
||||
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_base: data.base || null,
|
||||
data: data.data || null,
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: 0,
|
||||
data_bottom_line_status: (data.data || null) != null && (data.data.goods || null) != null && data.data.goods.length > 0,
|
||||
});
|
||||
|
||||
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/binding/detail/detail',
|
||||
query: 'id=' + this.data.id,
|
||||
img: this.data.share_images || this.data.images,
|
||||
},
|
||||
});
|
||||
|
||||
// 标题
|
||||
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 goods = temp_data.goods;
|
||||
goods[index]['checked'] = goods[index]['checked'] == undefined || goods[index]['checked'] == true ? false : true;
|
||||
temp_data['goods'] = goods;
|
||||
|
||||
// 已选商品
|
||||
var min_price = 0;
|
||||
var max_price = 0;
|
||||
var min_discount_price = 0;
|
||||
var max_discount_price = 0;
|
||||
for (var i in goods) {
|
||||
if ((goods[i]['checked'] == undefined || goods[i]['checked'] == true) && goods[i]['is_error'] == 0) {
|
||||
min_price += parseFloat(goods[i]['min_price'] || 0);
|
||||
max_price += parseFloat(goods[i]['max_price'] || 0);
|
||||
var discount_price = goods[i]['discount_price'] || null;
|
||||
if (discount_price != null) {
|
||||
if (discount_price.indexOf('-') == -1) {
|
||||
min_discount_price += parseFloat(discount_price);
|
||||
max_discount_price += parseFloat(discount_price);
|
||||
} else {
|
||||
var temp = discount_price.split('-');
|
||||
min_discount_price += parseFloat(temp[0]);
|
||||
max_discount_price += parseFloat(temp[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 价格
|
||||
if (min_price == max_price) {
|
||||
var price = app.globalData.price_two_decimal(min_price);
|
||||
} else {
|
||||
var price = app.globalData.price_two_decimal(min_price) + '-' + app.globalData.price_two_decimal(max_price);
|
||||
}
|
||||
|
||||
// 节省
|
||||
if (min_discount_price == max_discount_price) {
|
||||
var discount_price = app.globalData.price_two_decimal(min_discount_price);
|
||||
} else {
|
||||
var discount_price = app.globalData.price_two_decimal(min_discount_price) + '-' + app.globalData.price_two_decimal(max_discount_price);
|
||||
}
|
||||
|
||||
// 购买价格
|
||||
temp_data['estimate_price'] = price;
|
||||
// 节省价格
|
||||
temp_data['estimate_discount_price'] = discount_price;
|
||||
this.setData({ data: temp_data });
|
||||
},
|
||||
|
||||
// 规格选择
|
||||
spec_choice_event(e) {
|
||||
if ((this.$refs.goods_spec_choice || null) != null) {
|
||||
var index = e.currentTarget.dataset.index || 0;
|
||||
var goods = this.data['goods'][index];
|
||||
this.$refs.goods_spec_choice.init(goods.id, goods['specifications']['choose'], goods.buy_min_number, index);
|
||||
}
|
||||
},
|
||||
|
||||
// 规格确认回调事件
|
||||
spec_confirm_event(value) {
|
||||
var temp_data = this.data;
|
||||
temp_data['goods'][value.out_value]['spec_choice_data'] = value.spec;
|
||||
temp_data['goods'][value.out_value]['spec_choice_text'] = value.spec
|
||||
.map(function (v) {
|
||||
return v.value;
|
||||
})
|
||||
.join(' / ');
|
||||
this.setData({ data: temp_data });
|
||||
},
|
||||
|
||||
// 立即购买
|
||||
buy_event(e) {
|
||||
// 是否需要选择商品
|
||||
var type = parseInt(this.data.type || 0);
|
||||
var goods_data = [];
|
||||
var temp_goods = this.data.goods;
|
||||
for (var i in temp_goods) {
|
||||
if (temp_goods[i]['is_error'] == 0) {
|
||||
var goods_id = null;
|
||||
if (type == 1) {
|
||||
if (temp_goods[i]['checked'] == undefined || temp_goods[i]['checked'] == true) {
|
||||
goods_id = temp_goods[i]['id'];
|
||||
}
|
||||
} else {
|
||||
goods_id = temp_goods[i]['id'];
|
||||
}
|
||||
if (goods_id !== null) {
|
||||
// 是否存在多规格
|
||||
if ((temp_goods[i]['is_exist_many_spec'] || 0) == 1 && (temp_goods[i]['spec_choice_data'] || null) == null) {
|
||||
app.globalData.showToast(this.$t('detail.detail.8618mj') + (parseInt(i) + 1) + this.$t('detail.detail.09e3bx'));
|
||||
return false;
|
||||
}
|
||||
goods_data.push({
|
||||
goods_id: goods_id,
|
||||
stock: temp_goods[i]['buy_min_number'] || 1,
|
||||
spec: temp_goods[i]['spec_choice_data'] || '',
|
||||
});
|
||||
}
|
||||
} else {
|
||||
// 组合搭配则每一个商品都需要正确状态
|
||||
if (type == 0) {
|
||||
app.globalData.showToast(this.$t('detail.detail.40298g') + (parseInt(i) + 1) + this.$t('detail.detail.5kbjoy'));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
var buy_min_number = parseInt(this.data.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 = {
|
||||
binding_id: this.data.id,
|
||||
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_cart_event(e) {
|
||||
if ((this.$refs.goods_buy || null) != null) {
|
||||
var index = e.currentTarget.dataset.index || 0;
|
||||
var goods = this.data['goods'][index];
|
||||
this.$refs.goods_buy.init(goods, { buy_event_type: 'cart', is_direct_cart: 1 }, { index: index });
|
||||
}
|
||||
},
|
||||
|
||||
// 加入购物车成功回调
|
||||
goods_cart_back_event(e) {
|
||||
// 增加数量
|
||||
var back = e.back_data;
|
||||
var temp = this.data;
|
||||
var goods = temp['goods'][back.index];
|
||||
goods['user_cart_count'] = parseInt(goods['user_cart_count'] || 0) + parseInt(e.stock);
|
||||
if (goods['user_cart_count'] > 99) {
|
||||
goods['user_cart_count'] = '99+';
|
||||
}
|
||||
temp['goods'][back.index] = goods;
|
||||
this.setData({ data: temp });
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
@import './detail.css';
|
||||
</style>
|
||||
7
pages/plugins/binding/index/index.css
Normal file
7
pages/plugins/binding/index/index.css
Normal file
@@ -0,0 +1,7 @@
|
||||
.page {
|
||||
padding-bottom: 100rpx;
|
||||
}
|
||||
|
||||
.back-icon {
|
||||
top: -6rpx;
|
||||
}
|
||||
284
pages/plugins/binding/index/index.vue
Normal file
284
pages/plugins/binding/index/index.vue
Normal file
@@ -0,0 +1,284 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<!-- 列表 -->
|
||||
<scroll-view :scroll-y="true" class="scroll-box" @scrolltolower="scroll_lower" lower-threshold="60">
|
||||
<view :class="'padding-main ' + ((shop || null) != null ? 'page-bottom-fixed' : '')">
|
||||
<block v-if="(data_list || null) != null && data_list.length > 0">
|
||||
<!-- 组合搭配组件 -->
|
||||
<component-binding-list :propConfig="data_base" :propData="{data: data_list}" :propCurrencySymbol="currency_symbol"></component-binding-list>
|
||||
</block>
|
||||
<block v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
</block>
|
||||
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</view>
|
||||
|
||||
<!-- 回到店铺 -->
|
||||
<view v-if="(shop || null) != null" class="bottom-fixed" :style="bottom_fixed_style">
|
||||
<view class="bottom-line-exclude">
|
||||
<button class="item bg-white cr-main br-main round dis-block text-size" type="default" hover-class="none" @tap="shop_event" :data-value="shop.url">{{$t('index.index.i78v36')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</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';
|
||||
import componentBindingList from '@/components/binding-list/binding-list';
|
||||
|
||||
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,
|
||||
data_is_loading: 0,
|
||||
currency_symbol: app.globalData.currency_symbol(),
|
||||
bottom_fixed_style: '',
|
||||
data_list: [],
|
||||
data_total: 0,
|
||||
data_page_total: 0,
|
||||
data_page: 1,
|
||||
params: null,
|
||||
data_base: null,
|
||||
shop: null,
|
||||
// 自定义分享信息
|
||||
share_info: {},
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
componentBindingList,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: params,
|
||||
});
|
||||
|
||||
// 初始化配置
|
||||
this.init_config();
|
||||
|
||||
// 获取数据
|
||||
this.get_data();
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 公共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_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('index', 'index', 'binding'),
|
||||
method: 'POST',
|
||||
data: this.params,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
this.setData({
|
||||
data_base: data.base || null,
|
||||
shop: data.shop || null,
|
||||
});
|
||||
|
||||
if ((this.data_base || null) != null) {
|
||||
// 基础自定义分享
|
||||
this.setData({
|
||||
share_info: {
|
||||
title: this.data_base.seo_title || this.data_base.application_name,
|
||||
desc: this.data_base.seo_desc,
|
||||
path: '/pages/plugins/binding/index/index',
|
||||
},
|
||||
});
|
||||
|
||||
// 导航名称
|
||||
if ((this.data_base.application_name || null) != null) {
|
||||
uni.setNavigationBarTitle({
|
||||
title: this.data_base.application_name,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 获取列表数据
|
||||
this.get_data_list(1);
|
||||
} else {
|
||||
this.setData({
|
||||
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_list_loding_status: 2,
|
||||
data_list_loding_msg: this.$t('common.internet_error_tips'),
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 获取数据列表
|
||||
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 });
|
||||
|
||||
// 加载loding
|
||||
if(this.data_page > 1) {
|
||||
uni.showLoading({
|
||||
title: this.$t('common.loading_in_text'),
|
||||
});
|
||||
}
|
||||
|
||||
// 获取数据
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('datalist', 'index', 'binding'),
|
||||
method: 'POST',
|
||||
data: {
|
||||
page: this.data_page,
|
||||
shop_id: this.params.shop_id || 0,
|
||||
},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
if(this.data_page > 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
if (data.data.length > 0) {
|
||||
if (this.data_page <= 1) {
|
||||
var temp_data_list = data.data;
|
||||
} else {
|
||||
var temp_data_list = this.data_list || [];
|
||||
var temp_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: data.total,
|
||||
data_page_total: 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_is_loading: 0,
|
||||
});
|
||||
if (this.data_page <= 1) {
|
||||
this.setData({
|
||||
data_list: [],
|
||||
data_bottom_line_status: false,
|
||||
});
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
if(this.data_page > 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: this.$t('common.internet_error_tips'),
|
||||
data_is_loading: 0,
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 滚动加载
|
||||
scroll_lower(e) {
|
||||
this.get_data_list();
|
||||
},
|
||||
|
||||
// 店铺事件
|
||||
shop_event(e) {
|
||||
var prev_url = app.globalData.prev_page();
|
||||
if (prev_url != null && prev_url.indexOf('pages/plugins/shop/detail/detail') != -1) {
|
||||
uni.navigateBack();
|
||||
} else {
|
||||
app.globalData.url_event(e);
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './index.css';
|
||||
</style>
|
||||
129
pages/plugins/blog/comments/comments.vue
Normal file
129
pages/plugins/blog/comments/comments.vue
Normal file
@@ -0,0 +1,129 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view v-if="(data || null) != null" class="padding-main bg-white">
|
||||
<!-- 评论内容 -->
|
||||
<component-blog-comments :propData="data" :propDataBase="data_base" :propEmojiList="emoji_list" propType="comments"></component-blog-comments>
|
||||
<!-- 结尾 -->
|
||||
<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';
|
||||
import componentBlogComments from '../components/blog-comments/blog-comments';
|
||||
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_base: null,
|
||||
data: null,
|
||||
emoji_list: [],
|
||||
// 自定义分享信息
|
||||
share_info: {},
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
componentBlogComments,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: params,
|
||||
});
|
||||
|
||||
// 数据加载
|
||||
this.get_data();
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 初始化
|
||||
get_data() {
|
||||
uni.showLoading({
|
||||
title: this.$t('common.loading_in_text'),
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('commentsinfo', 'index', 'blog'),
|
||||
method: 'POST',
|
||||
data: {
|
||||
id: this.params.id || 0,
|
||||
},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
var data = res.data.data;
|
||||
if (res.data.code == 0 && (data.data || null) != null) {
|
||||
var blog = data.data;
|
||||
this.setData({
|
||||
data_bottom_line_status: true,
|
||||
data_list_loding_status: 3,
|
||||
data_base: data.base || null,
|
||||
data: blog,
|
||||
emoji_list: data.emoji_list || [],
|
||||
});
|
||||
|
||||
// 基础自定义分享
|
||||
this.setData({
|
||||
share_info: {
|
||||
title: this.data.seo_title || this.data.title,
|
||||
desc: this.data.seo_desc || this.data.describe,
|
||||
path: '/pages/plugins/blog/detail/detail',
|
||||
query: 'id=' + this.data.id,
|
||||
img: this.data.cover,
|
||||
},
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle(this.share_info);
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style></style>
|
||||
587
pages/plugins/blog/components/blog-comments/blog-comments.vue
Normal file
587
pages/plugins/blog/components/blog-comments/blog-comments.vue
Normal file
@@ -0,0 +1,587 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view v-if="(data || null) != null && (data_base || null) != null">
|
||||
<view class="flex-row jc-sb align-c">
|
||||
<view v-if="(data_base.is_blog_comments_show || 0) == 1" class="fw-b">{{$t('user-order.user-order.twc3r7')}}{{ data.comments_count || '' }}</view>
|
||||
<!-- 点赞、评论、分享 -->
|
||||
<view v-if="propType == 'detail'" class="tr blog-comments-bottom-container cr-grey">
|
||||
<view v-if="(data_base.is_blog_comments_show || 0) == 1" class="item dis-inline-block cr-base" :data-value="'/pages/plugins/blog/comments/comments?id=' + data.id" @tap="url_event">
|
||||
<iconfont name="icon-message-square" size="28rpx" propClass="pr top-sm margin-right-xs"></iconfont>
|
||||
<text class="text-size-xs">{{$t('ask-comments.ask-comments.2zlnb5')}}{{ data.comments_count }})</text>
|
||||
</view>
|
||||
<view v-if="(data_base.is_blog_give_thumbs || 0) == 1" :class="'item dis-inline-block cr-' + ((data.is_give_thumbs || 0) == 1 ? 'main' : 'base')" :data-blogid="data.id" @tap="give_thumbs_event">
|
||||
<iconfont :name="(data.is_give_thumbs || 0) == 1 ? 'icon-givealike' : 'icon-givealike-o'" size="28rpx" propClass="pr top-sm margin-right-xs"></iconfont>
|
||||
<text class="va-m text-size-xs">{{$t('ask-comments.ask-comments.du7rcv')}}{{ data.give_thumbs_count }})</text>
|
||||
</view>
|
||||
<view class="item dis-inline-block cr-base" @tap="popup_share_event">
|
||||
<iconfont name="icon-share" size="28rpx" propClass="pr top-sm margin-right-xs"></iconfont>
|
||||
<text class="text-size-xs">{{$t('common.share')}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 评论回复表单 -->
|
||||
<view v-if="(data_base.is_blog_comments_add || 0) == 1 && !input_comments_modal_status" class="padding-top-xxxl padding-bottom-xxl blog-comments-reply-container flex-row jc-sb spacing-mb">
|
||||
<image :src="avatar" mode="aspectFill" class="user-avatar fl circle"></image>
|
||||
<view class="right-base flex-1 flex-width">
|
||||
<view class="comments border-radius-main padding-main">
|
||||
<textarea :placeholder="$t('ask-comments.ask-comments.m67961')" placeholder-class="cr-grey" class="wh-auto bg-grey-f8" :value="input_comments_value" :maxlength="input_comments_length_max" @input="comments_input_event" @blur="comments_input_event"></textarea>
|
||||
<view class="oh flex-row jc-sb align-e">
|
||||
<image :src="common_static_url + 'emoji-icon.png'" mode="aspectFill" class="emoji-icon va-m" @tap="emoji_event"></image>
|
||||
<view class="flex-row align-e">
|
||||
<!-- #ifndef MP-ALIPAY -->
|
||||
<text class="text-size-xs cr-grey-d margin-right-sm">{{$t('login.login.n24i5u')}}{{ input_comments_length_value }}{{$t('ask-comments.ask-comments.6l6vz7')}}</text>
|
||||
<!-- #endif -->
|
||||
<button type="default" size="mini" class="comment-btn cr-white border-radius-sm text-size-md va-m" :class="input_comments_value.length > 0 ? 'bg-main br-main ' : 'comment-btn-default'" @tap="comments_event">{{$t('user-order.user-order.twc3r7')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 评论回复内容 -->
|
||||
<view v-if="(data_base.is_blog_comments_show || 0) == 1 && (data.comments_list || null) != null && data.comments_list.length > 0" class="blog-comments-list">
|
||||
<block v-for="(item, index) in data.comments_list" :key="index">
|
||||
<view class="item oh flex-row jc-sb">
|
||||
<image :src="item.user.avatar" mode="aspectFill" class="user-avatar circle fl"></image>
|
||||
<view class="right-content flex-1 flex-width" :class="data.comments_list.length > index + 1 ? 'br-b-e padding-bottom-main margin-bottom-main' : ''">
|
||||
<view class="comments-base oh">
|
||||
<text class="username fw-b">{{ item.user.user_name_view }}</text>
|
||||
<text class="cr-grey-9 margin-left-main">{{ item.add_time }}</text>
|
||||
</view>
|
||||
<view class="margin-top-sm comments-content">{{ item.content }}</view>
|
||||
<view class="blog-comments-right-content-operate margin-top-main flex-row jc-e align-c text-size-xs cr-grey-9">
|
||||
<view v-if="(data_base.is_blog_comments_show || 0) == 1" class="item dis-inline-block" :data-index="index" :data-username="item.user.user_name_view" :data-blogcommentsid="item.id" @tap="modal_open_event">
|
||||
<iconfont name="icon-message-square" size="28rpx" propClass="pr top-md margin-right-xs"></iconfont>
|
||||
<text class="va-m">{{$t('ask-comments.ask-comments.3fcnme')}}{{ item.comments_count }})</text>
|
||||
</view>
|
||||
<view v-if="(data_base.is_blog_give_thumbs || 0) == 1" :class="'item dis-inline-block margin-left-xxxl padding-left-sm cr-' + ((item.is_give_thumbs || 0) == 1 ? 'main' : '')" data-type="1" :data-index="index" :data-blogid="item.blog_id" :data-blogcommentsid="item.id" @tap="give_thumbs_event">
|
||||
<iconfont :name="(item.is_give_thumbs || 0) == 1 ? 'icon-givealike' : 'icon-givealike-o'" size="28rpx" propClass="pr top-md margin-right-xs"></iconfont>
|
||||
<text class="va-m">{{$t('ask-comments.ask-comments.du7rcv')}}{{ item.give_thumbs_count }})</text>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="(item.reply_comments_list || null) != null && item.reply_comments_list.length > 0" class="reply-blog-comments-list">
|
||||
<block v-for="(comments, index2) in item.reply_comments_list" :key="index2">
|
||||
<view class="bg-grey-e">
|
||||
<view class="item padding-main oh flex-row jc-sb">
|
||||
<image :src="comments.user.avatar" mode="aspectFill" class="user-avatar circle fl"></image>
|
||||
<view class="right-content flex-1 flex-width">
|
||||
<view class="comments-reply-base oh">
|
||||
<text class="username fw-b">{{ comments.user.user_name_view }}</text>
|
||||
<text class="cr-grey-9 margin-left-main">{{ comments.add_time }}</text>
|
||||
</view>
|
||||
<view v-if="(comments.reply_comments_text || null) != null" class="margin-top-sm reply-content">{{ comments.reply_comments_text }}</view>
|
||||
<view class="margin-top-sm">{{ comments.content }}</view>
|
||||
<view class="blog-comments-right-content-operate flex-row jc-e align-c text-size-xs cr-grey-9 padding-0">
|
||||
<view v-if="(data_base.is_blog_comments_show || 0) == 1" class="item dis-inline-block" :data-index="index" :data-username="comments.user.user_name_view" :data-blogcommentsid="comments.blog_comments_id" :data-replycommentsid="comments.id" @tap="modal_open_event">
|
||||
<iconfont name="icon-message-square" size="28rpx" propClass="pr top-md margin-right-xs"></iconfont>
|
||||
<text class="va-m">{{$t('ask-comments.ask-comments.3fcnme')}}{{ comments.comments_count }})</text>
|
||||
</view>
|
||||
<view
|
||||
v-if="(data_base.is_blog_give_thumbs || 0) == 1"
|
||||
:class="'item dis-inline-block margin-left-xxxl padding-left-sm cr-' + ((comments.is_give_thumbs || 0) == 1 ? 'main' : '')"
|
||||
data-type="2"
|
||||
:data-index="index"
|
||||
:data-indexs="index2"
|
||||
:data-blogid="comments.blog_id"
|
||||
:data-blogcommentsid="comments.id"
|
||||
:data-replycommentsid="comments.blog_comments_id"
|
||||
@tap="give_thumbs_event"
|
||||
>
|
||||
<iconfont :name="(comments.is_give_thumbs || 0) == 1 ? 'icon-givealike' : 'icon-givealike-o'" size="28rpx" propClass="pr top-md margin-right-xs"></iconfont>
|
||||
<text class="va-m">{{$t('ask-comments.ask-comments.du7rcv')}}{{ comments.give_thumbs_count }})</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<view v-if="(item.comments_count || 0) > 0 && (item.is_comments_list_submit == undefined || item.is_comments_list_submit == 1)" class="margin-top-lg text-size-xs">
|
||||
<text :data-index="index" :data-blogid="item.blog_id" :data-blogcommentsid="item.id" @tap="comments_list_reply_event">
|
||||
<text v-if="item.is_comments_list_submit == undefined" class="cr-grey">{{$t('goods-list.goods-list.278qr1')}}{{ item.comments_count }}{{$t('ask-comments.ask-comments.ymmd24')}}</text>
|
||||
<text v-else class="cr-grey">{{$t('ask-comments.ask-comments.dfhg54')}}</text>
|
||||
<iconfont name="icon-arrow-bottom" size="24rpx" propClass="margin-left-xs pr top-xs"></iconfont>
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-if="((data_base.blog_detail_comments_more_page_number || 0) == 0 && (data.comments_count || 0) > 20) || ((data_base.blog_detail_comments_more_page_number || 0) > 0 && data.comments_count > data_base.blog_detail_comments_more_page_number)">
|
||||
<view v-if="propType == 'detail'" class="margin-top-xxxl tc padding-vertical-main bg-grey-f8 border-radius-sm">
|
||||
<text :data-value="'/pages/plugins/blog/comments/comments?id=' + data.id" @tap="url_event">
|
||||
<text class="cr-grey">{{$t('goods-list.goods-list.278qr1')}}{{ data.comments_count }}{{$t('ask-comments.ask-comments.5401r1')}}</text>
|
||||
<iconfont name="icon-arrow-right" size="24rpx" propClass="margin-left-xs pr top-xs"></iconfont>
|
||||
</text>
|
||||
</view>
|
||||
<view v-if="propType == 'comments' && (data.is_comments_list_submit == undefined || data.is_comments_list_submit == 1)" class="margin-top-xxxl tc padding-vertical-main bg-grey-f8 border-radius-sm">
|
||||
<text :data-blogid="data.id" @tap="comments_list_reply_event">
|
||||
<text class="cr-grey">{{$t('ask-comments.ask-comments.4l77wt')}}</text>
|
||||
<iconfont name="icon-arrow-bottom" size="24rpx" propClass="margin-left-xs pr top-xs"></iconfont>
|
||||
</text>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<!-- 回复弹窗 -->
|
||||
<view v-if="input_comments_modal_status" class="blog-comments-modal pf">
|
||||
<view class="blog-comments-modal-content bg-white border-radius-main pr">
|
||||
<view class="tc margin-bottom-lg">
|
||||
<text>{{$t('ask-comments.ask-comments.8sjar6')}}{{ input_comments_modal_username }}</text>
|
||||
<view class="close pa">
|
||||
<view @tap.stop="modal_close_event">
|
||||
<iconfont name="icon-close-o" size="28rpx" color="#999"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<textarea :placeholder="$t('ask-comments.ask-comments.m67961')" placeholder-class="cr-grey" class="wh-auto br padding-main" :value="input_comments_value" :maxlength="input_comments_length_max" @input="comments_input_event" @blur="comments_input_event"></textarea>
|
||||
<view class="margin-top-lg oh">
|
||||
<image :src="common_static_url + 'emoji-icon.png'" mode="aspectFill" class="emoji-icon va-m" @tap="emoji_event"></image>
|
||||
<view class="fr">
|
||||
<text class="va-m text-size-xs cr-grey margin-right-lg">{{$t('login.login.n24i5u')}}{{ input_comments_length_value }}{{$t('ask-comments.ask-comments.6l6vz7')}}</text>
|
||||
<button type="default" size="mini" class="comment-btn cr-white border-radius-sm text-size-xs va-m" :class="input_comments_value.length > 0 ? 'bg-main br-main ' : 'comment-btn-default'" @tap="comments_event">{{$t('user-order.user-order.twc3r7')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 表情弹窗 -->
|
||||
<component-emoji-popup ref="emoji" v-on:choiceConfirmEvent="emoji_choice_confirm_event"></component-emoji-popup>
|
||||
|
||||
<!-- 分享弹窗 -->
|
||||
<component-share-popup ref="share"></component-share-popup>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
var common_static_url = app.globalData.get_static_url('common');
|
||||
import componentPopup from '@/components/popup/popup';
|
||||
import componentSharePopup from '@/components/share-popup/share-popup';
|
||||
import componentEmojiPopup from '@/components/emoji-popup/emoji-popup';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
common_static_url: common_static_url,
|
||||
avatar: app.globalData.data.default_user_head_src,
|
||||
user: null,
|
||||
data_base: null,
|
||||
data: null,
|
||||
emoji_list: [],
|
||||
input_comments_value: '',
|
||||
input_comments_cursor: 0,
|
||||
input_comments_length_value: 500,
|
||||
input_comments_length_max: 500,
|
||||
input_comments_modal_status: false,
|
||||
input_comments_modal_index: 0,
|
||||
input_comments_modal_username: '',
|
||||
input_comments_modal_blog_comments_id: 0,
|
||||
input_comments_modal_reply_comments_id: 0,
|
||||
};
|
||||
},
|
||||
props: {
|
||||
propType: {
|
||||
type: String,
|
||||
default: 'detail',
|
||||
},
|
||||
propData: {
|
||||
type: [Object, null],
|
||||
default: null,
|
||||
},
|
||||
propDataBase: {
|
||||
type: [Object, null],
|
||||
default: null,
|
||||
},
|
||||
propEmojiList: {
|
||||
type: [Array, null],
|
||||
default: [],
|
||||
},
|
||||
propShareInfo: {
|
||||
type: [Object, null],
|
||||
default: {},
|
||||
}
|
||||
},
|
||||
components: {
|
||||
componentPopup,
|
||||
componentSharePopup,
|
||||
componentEmojiPopup,
|
||||
},
|
||||
|
||||
// 页面被展示
|
||||
created: function (e) {
|
||||
var avatar = app.globalData.data.default_user_head_src;
|
||||
var user = app.globalData.get_user_cache_info() || null;
|
||||
this.setData({
|
||||
user: user,
|
||||
avatar: user == null ? avatar : user.avatar || avatar,
|
||||
data: this.propData,
|
||||
data_base: this.propDataBase,
|
||||
emoji_list: this.propEmojiList,
|
||||
});
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 分享开启弹层
|
||||
popup_share_event(e) {
|
||||
if ((this.$refs.share || null) != null) {
|
||||
this.$refs.share.init({
|
||||
share_info: this.propShareInfo
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 评论弹窗关闭
|
||||
modal_close_event(e) {
|
||||
this.setData({
|
||||
input_comments_modal_status: false,
|
||||
input_comments_modal_index: 0,
|
||||
input_comments_modal_username: '',
|
||||
input_comments_modal_blog_comments_id: 0,
|
||||
input_comments_modal_reply_comments_id: 0,
|
||||
input_comments_value: '',
|
||||
});
|
||||
},
|
||||
|
||||
// 评论弹窗开启
|
||||
modal_open_event(e) {
|
||||
if (!app.globalData.is_single_page_check()) {
|
||||
return false;
|
||||
}
|
||||
var user = app.globalData.get_user_info(this, 'modal_open_event', e);
|
||||
if (user != false) {
|
||||
var index = parseInt(e.currentTarget.dataset.index || 0);
|
||||
var username = e.currentTarget.dataset.username;
|
||||
var blog_comments_id = e.currentTarget.dataset.blogcommentsid || 0;
|
||||
var reply_comments_id = e.currentTarget.dataset.replycommentsid || 0;
|
||||
this.setData({
|
||||
input_comments_modal_status: true,
|
||||
input_comments_value: '',
|
||||
input_comments_modal_index: index,
|
||||
input_comments_modal_username: username,
|
||||
input_comments_modal_blog_comments_id: blog_comments_id,
|
||||
input_comments_modal_reply_comments_id: reply_comments_id,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 表情选择事件
|
||||
emoji_event() {
|
||||
if (this.input_comments_length_value == 0) {
|
||||
app.globalData.showToast(this.$t('ask-comments.ask-comments.3o1rq6'));
|
||||
return false;
|
||||
}
|
||||
if ((this.$refs.emoji || null) != null) {
|
||||
this.$refs.emoji.init({ emoji_list: this.emoji_list });
|
||||
}
|
||||
},
|
||||
|
||||
// 评论输入和失去焦点事件
|
||||
comments_input_event(e) {
|
||||
var value = e.detail.value.trim();
|
||||
var length = this.input_comments_length_max - value.length;
|
||||
this.setData({
|
||||
input_comments_cursor: e.detail.cursor || 0,
|
||||
input_comments_value: value,
|
||||
input_comments_length_value: length <= 0 ? 0 : length,
|
||||
});
|
||||
},
|
||||
|
||||
// 表情选择确认事件
|
||||
emoji_choice_confirm_event(emoji) {
|
||||
var value = this.input_comments_value;
|
||||
var cursor = parseInt(this.input_comments_cursor || 0);
|
||||
if (value != '') {
|
||||
if (cursor == 0) {
|
||||
value = emoji + value;
|
||||
} else {
|
||||
var first = value.substr(0, cursor);
|
||||
var last = value.substr(cursor, value.length);
|
||||
value = first + emoji + last;
|
||||
}
|
||||
} else {
|
||||
value = emoji;
|
||||
}
|
||||
var length = this.input_comments_length_max - value.length;
|
||||
this.setData({
|
||||
input_comments_value: value,
|
||||
input_comments_length_value: length <= 0 ? 0 : length,
|
||||
});
|
||||
},
|
||||
|
||||
// 获取评论列表
|
||||
comments_list_reply_event(e) {
|
||||
var temp_data = this.data;
|
||||
var page = 1;
|
||||
var index = parseInt(e.currentTarget.dataset.index || 0);
|
||||
var blog_id = e.currentTarget.dataset.blogid;
|
||||
var blog_comments_id = e.currentTarget.dataset.blogcommentsid || 0;
|
||||
if (blog_comments_id == 0) {
|
||||
if ((temp_data['page'] || null) == null) {
|
||||
temp_data['page'] = 1;
|
||||
} else {
|
||||
temp_data['page'] += 1;
|
||||
}
|
||||
page = temp_data['page'];
|
||||
} else {
|
||||
if ((temp_data['comments_list'][index]['page'] || null) == null) {
|
||||
temp_data['comments_list'][index]['page'] = 1;
|
||||
} else {
|
||||
temp_data['comments_list'][index]['page'] += 1;
|
||||
}
|
||||
page = temp_data['comments_list'][index]['page'];
|
||||
}
|
||||
uni.showLoading({
|
||||
title: this.$t('common.loading_in_text'),
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('commentsreplylist', 'index', 'blog'),
|
||||
method: 'POST',
|
||||
data: {
|
||||
blog_id: blog_id,
|
||||
blog_comments_id: blog_comments_id,
|
||||
page: page,
|
||||
},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
if (blog_comments_id == 0) {
|
||||
var temp_list = temp_data['comments_list'] || [];
|
||||
} else {
|
||||
var temp_list = temp_data['comments_list'][index]['reply_comments_list'] || [];
|
||||
}
|
||||
var data = res.data.data.data;
|
||||
for (var i in data) {
|
||||
temp_list.push(data[i]);
|
||||
}
|
||||
if (blog_comments_id == 0) {
|
||||
temp_data['comments_list'] = temp_list;
|
||||
temp_data['is_comments_list_submit'] = res.data.data.page >= res.data.data.page_total ? 0 : 1;
|
||||
} else {
|
||||
temp_data['comments_list'][index]['reply_comments_list'] = temp_list;
|
||||
temp_data['comments_list'][index]['is_comments_list_submit'] = res.data.data.page >= res.data.data.page_total ? 0 : 1;
|
||||
}
|
||||
this.setData({ data: temp_data });
|
||||
} else {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 评论
|
||||
comments_event(e) {
|
||||
if (!app.globalData.is_single_page_check()) {
|
||||
return false;
|
||||
}
|
||||
var user = app.globalData.get_user_info(this, 'comments_event', e);
|
||||
if (user != false) {
|
||||
if (this.input_comments_value == '') {
|
||||
app.globalData.showToast(this.$t('user-order-comments.user-order-comments.8f303u'));
|
||||
return false;
|
||||
}
|
||||
uni.showLoading({
|
||||
title: this.$t('buy.buy.r79t77'),
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('comments', 'index', 'blog'),
|
||||
method: 'POST',
|
||||
data: {
|
||||
blog_id: this.data.id,
|
||||
content: this.input_comments_value,
|
||||
blog_comments_id: this.input_comments_modal_blog_comments_id,
|
||||
reply_comments_id: this.input_comments_modal_reply_comments_id,
|
||||
},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
var temp_data = this.data;
|
||||
if ((this.input_comments_modal_blog_comments_id || 0) == 0) {
|
||||
var temp_list = temp_data.comments_list || [];
|
||||
temp_list.splice(0, 0, res.data.data);
|
||||
temp_data['comments_list'] = temp_list;
|
||||
temp_data['comments_count'] = parseInt(temp_data['comments_count']) + 1;
|
||||
} else {
|
||||
var index = this.input_comments_modal_index;
|
||||
var temp_list = temp_data.comments_list[index]['reply_comments_list'] || [];
|
||||
temp_list.splice(0, 0, res.data.data);
|
||||
if ((this.input_comments_modal_reply_comments_id || 0) != 0) {
|
||||
for (var i in temp_list) {
|
||||
if (temp_list[i]['id'] == this.input_comments_modal_reply_comments_id) {
|
||||
temp_list[i]['comments_count'] = parseInt(temp_list[i]['comments_count']) + 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
temp_data.comments_list[index]['reply_comments_list'] = temp_list;
|
||||
temp_data.comments_list[index]['comments_count'] = parseInt(temp_data.comments_list[index]['comments_count']) + 1;
|
||||
}
|
||||
this.setData({
|
||||
data: temp_data,
|
||||
input_comments_value: '',
|
||||
input_comments_length_value: this.input_comments_length_max,
|
||||
input_comments_modal_status: false,
|
||||
input_comments_modal_index: 0,
|
||||
input_comments_modal_username: '',
|
||||
input_comments_modal_blog_comments_id: 0,
|
||||
input_comments_modal_reply_comments_id: 0,
|
||||
});
|
||||
} else {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 点赞
|
||||
give_thumbs_event(e) {
|
||||
if (!app.globalData.is_single_page_check()) {
|
||||
return false;
|
||||
}
|
||||
var user = app.globalData.get_user_info(this, 'give_thumbs_event', e);
|
||||
if (user != false) {
|
||||
var type = parseInt(e.currentTarget.dataset.type || 0);
|
||||
var blog_id = e.currentTarget.dataset.blogid;
|
||||
var blog_comments_id = e.currentTarget.dataset.blogcommentsid || 0;
|
||||
var reply_comments_id = e.currentTarget.dataset.replycommentsid || 0;
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('givethumbs', 'index', 'blog'),
|
||||
method: 'POST',
|
||||
data: {
|
||||
blog_id: blog_id,
|
||||
blog_comments_id: blog_comments_id,
|
||||
reply_comments_id: reply_comments_id,
|
||||
},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
var temp_data = this.data;
|
||||
switch (type) {
|
||||
// 博客
|
||||
case 0:
|
||||
temp_data.is_give_thumbs = data.is_active;
|
||||
temp_data.give_thumbs_count = data.count;
|
||||
break;
|
||||
// 博客评论
|
||||
case 1:
|
||||
var index = parseInt(e.currentTarget.dataset.index || 0);
|
||||
temp_data['comments_list'][index]['is_give_thumbs'] = data.is_active;
|
||||
temp_data['comments_list'][index]['give_thumbs_count'] = data.count;
|
||||
break;
|
||||
// 博客评论回复
|
||||
case 2:
|
||||
var index = parseInt(e.currentTarget.dataset.index || 0);
|
||||
var indexs = parseInt(e.currentTarget.dataset.indexs || 0);
|
||||
temp_data['comments_list'][index]['reply_comments_list'][indexs]['is_give_thumbs'] = data.is_active;
|
||||
temp_data['comments_list'][index]['reply_comments_list'][indexs]['give_thumbs_count'] = data.count;
|
||||
break;
|
||||
}
|
||||
this.setData({ data: temp_data });
|
||||
} else {
|
||||
if (app.globalData.is_login_check(res.data)) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// url事件
|
||||
url_event(e) {
|
||||
app.globalData.url_event(e);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
/**
|
||||
* 聚合点赞、评论、分享
|
||||
*/
|
||||
.blog-comments-bottom-container .item:not(:last-child) {
|
||||
margin-right: 64rpx;
|
||||
}
|
||||
.blog-comments-reply-container .emoji-icon,
|
||||
.blog-comments-modal .emoji-icon {
|
||||
width: 40rpx;
|
||||
height: 40rpx !important;
|
||||
}
|
||||
.blog-comments-reply-container .user-avatar {
|
||||
width: 72rpx;
|
||||
height: 72rpx !important;
|
||||
border: 1px solid #eee;
|
||||
}
|
||||
.blog-comments-reply-container .right-base {
|
||||
padding-left: 16rpx;
|
||||
}
|
||||
.blog-comments-reply-container .right-base .comments {
|
||||
background-color: #f8f8f8;
|
||||
}
|
||||
.blog-comments-reply-container .right-base textarea {
|
||||
height: 120rpx;
|
||||
}
|
||||
.blog-comments-modal {
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: calc(100% - 80rpx);
|
||||
height: 100%;
|
||||
background: rgba(0, 0, 0, 0.6);
|
||||
padding: 40rpx;
|
||||
z-index: 10;
|
||||
}
|
||||
.blog-comments-modal-content {
|
||||
padding: 10px;
|
||||
border-radius: 10px;
|
||||
margin: 0 auto;
|
||||
margin-top: 30%;
|
||||
max-width: calc(800px - 180rpx);
|
||||
}
|
||||
.blog-comments-modal-content textarea {
|
||||
height: 200rpx;
|
||||
}
|
||||
.blog-comments-modal-content .close {
|
||||
top: 20rpx;
|
||||
right: 20rpx;
|
||||
}
|
||||
.comment-btn {
|
||||
height: 56rpx;
|
||||
line-height: 56rpx;
|
||||
padding: 0 24rpx;
|
||||
}
|
||||
.comment-btn-default {
|
||||
border: 2rpx solid #d8dadc;
|
||||
background-color: #d8dadc;
|
||||
}
|
||||
|
||||
/**
|
||||
* 评论列表
|
||||
*/
|
||||
.blog-comments-list > .item .user-avatar {
|
||||
width: 72rpx;
|
||||
height: 72rpx;
|
||||
border: 1px solid #eee;
|
||||
}
|
||||
.blog-comments-list .comments-base,
|
||||
.blog-comments-list .comments-content {
|
||||
padding-left: 16rpx;
|
||||
padding-right: 20rpx;
|
||||
}
|
||||
.reply-blog-comments-list {
|
||||
margin-top: 28rpx;
|
||||
}
|
||||
.reply-blog-comments-list .right-content {
|
||||
padding-left: 16rpx;
|
||||
}
|
||||
</style>
|
||||
245
pages/plugins/blog/detail/detail.vue
Normal file
245
pages/plugins/blog/detail/detail.vue
Normal file
@@ -0,0 +1,245 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view v-if="(info || null) != null" :class="(data_base || null) != null && (data_base.is_user_add_blog || 0) == 1 ? 'page-bottom-fixed' : ''">
|
||||
<view class="padding-main bg-white spacing-mb">
|
||||
<view class="spacing-mb">
|
||||
<view class="fw-b text-size-xl">{{ info.title }}</view>
|
||||
<view class="cr-grey-9 margin-top-lg oh br-t padding-top-main text-size-xs">
|
||||
<view class="fl">
|
||||
<text>{{ $t('article-detail.article-detail.728374') }}</text>
|
||||
<text>{{ info.add_time }}</text>
|
||||
</view>
|
||||
<view class="fr">
|
||||
<text class="margin-left-xxxl">{{ $t('article-detail.article-detail.j92ru0') }}</text>
|
||||
<text>{{ info.access_count }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="oh web-html-content spacing-mb">
|
||||
<view v-if="(info.video_url || null) != null && ((info.is_live_play || 0) == 0 || client_type == 'weixin')">
|
||||
<video :src="info.video_url" class="wh-auto" :autoplay="false" :controls="true"></video>
|
||||
</view>
|
||||
<mp-html :content="info.content" />
|
||||
</view>
|
||||
<!-- 评论内容 -->
|
||||
<component-blog-comments :propData="info" :propDataBase="data_base" :propEmojiList="emoji_list" :propShareInfo="share_info"></component-blog-comments>
|
||||
</view>
|
||||
|
||||
<view class="padding-horizontal-main">
|
||||
<!-- 上一篇、下一篇 -->
|
||||
<view v-if="(last_next || null) != null" class="last-next-data spacing-mt margin-bottom-xxxl cr-grey-9">
|
||||
<view v-if="(last_next.last || null) != null" class="flex-row">
|
||||
<text>{{ $t('article-detail.article-detail.281s4a') }}</text>
|
||||
<text :data-value="last_next.last.url" @tap="url_event" class="dis-inline-block flex-row flex-width single-text cp item">{{ last_next.last.title }}</text>
|
||||
</view>
|
||||
<view v-if="(last_next.next || null) != null" class="margin-top flex-row cr-main">
|
||||
<text>{{ $t('article-detail.article-detail.uq5814') }}</text>
|
||||
<text :data-value="last_next.next.url" @tap="url_event" class="dis-inline-block flex-row flex-width single-text cp item">{{ last_next.next.title }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 推荐博文 -->
|
||||
<view v-if="right_list.length > 0" class="plugins-blog-list">
|
||||
<view class="spacing-nav-title flex-row align-c jc-sb text-size-xs">
|
||||
<text class="text-wrapper title-left-border single-text flex-1 flex-width padding-right-main">{{ $t('detail.detail.455787') }}{{ blog_main_name }}</text>
|
||||
<text data-value="/pages/plugins/blog/search/search" @tap="url_event" class="arrow-right padding-right cr-grey cp">{{ $t('common.more') }}</text>
|
||||
</view>
|
||||
<view v-for="(item, index) in right_list" :key="index">
|
||||
<view :data-value="item.url" @tap="url_event" class="item oh padding-main border-radius-main bg-white spacing-mb cp">
|
||||
<image class="blog-img fl radius" :src="item.cover" mode="aspectFill"></image>
|
||||
<view class="base fr">
|
||||
<view class="single-text">{{ item.title }}</view>
|
||||
<view class="cr-grey margin-top-sm">{{ item.add_time_date_cn }}</view>
|
||||
<view class="cr-grey multi-text margin-top-sm">{{ item.describe }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 相关商品 -->
|
||||
<view v-if="(info.goods_list || null) != null && info.goods_list.length > 0">
|
||||
<view class="spacing-nav-title flex-row align-c jc-sb text-size-xs">
|
||||
<text class="text-wrapper title-left-border single-text flex-1 flex-width padding-right-main">{{ $t('detail.detail.1j6yxy') }}</text>
|
||||
<text data-value="/pages/goods-search/goods-search" @tap="url_event" class="arrow-right padding-right cr-grey cp">{{ $t('common.more') }}</text>
|
||||
</view>
|
||||
<component-goods-list :propData="{ style_type: 1, goods_list: info.goods_list }" :propCurrencySymbol="currency_symbol"></component-goods-list>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</view>
|
||||
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
|
||||
<!-- 发布博文、我的博文入口 -->
|
||||
<view v-if="(data_base || null) != null && (data_base.is_user_add_blog || 0) == 1" class="bottom-fixed" :style="bottom_fixed_style">
|
||||
<view class="bottom-line-exclude">
|
||||
<view class="item flex-row jc-sa align-c text-size fw-b br bg-white round padding-vertical">
|
||||
<view data-value="/pages/plugins/blog/form/form" @tap="url_event" class="flex-1 tc flex-col jc-c align-c cp">
|
||||
<view class="divider-r-d wh-auto"> <iconfont name="icon-edit-below-line" size="30rpx" color="#333" propClass="margin-right-sm"></iconfont>{{$t('detail.detail.fn3w01')}}{{ blog_main_name }}</view>
|
||||
</view>
|
||||
<view data-value="/pages/plugins/blog/user-list/user-list" @tap="url_event" class="flex-1 tc flex-col jc-c align-c cp">
|
||||
<view class="wh-auto"> <iconfont name="icon-list-dot" size="32rpx" color="#333" propClass="margin-right-sm pr top-xs"></iconfont>{{$t('common.my')}}{{ blog_main_name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</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 componentBlogComments from '../components/blog-comments/blog-comments';
|
||||
import componentGoodsList from '@/components/goods-list/goods-list';
|
||||
|
||||
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: '',
|
||||
data_bottom_line_status: false,
|
||||
currency_symbol: app.globalData.currency_symbol(),
|
||||
client_type: app.globalData.application_client_type(),
|
||||
bottom_fixed_style: '',
|
||||
params: null,
|
||||
data_base: null,
|
||||
info: null,
|
||||
right_list: [],
|
||||
last_next: null,
|
||||
emoji_list: [],
|
||||
blog_main_name: this.$t('detail.detail.e439j9'),
|
||||
// 自定义分享信息
|
||||
share_info: {},
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
componentBlogComments,
|
||||
componentGoodsList,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: app.globalData.launch_params_handle(params),
|
||||
});
|
||||
|
||||
// 初始化配置
|
||||
this.init_config();
|
||||
|
||||
// 数据加载
|
||||
this.get_data();
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 公共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', 'index', 'blog'),
|
||||
method: 'POST',
|
||||
data: {
|
||||
id: this.params.id || 0,
|
||||
},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
var data = res.data.data;
|
||||
if (res.data.code == 0 && (data.data || null) != null) {
|
||||
var info = data.data || null;
|
||||
var base = data.base || null;
|
||||
this.setData({
|
||||
data_bottom_line_status: true,
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: 3,
|
||||
data_base: base,
|
||||
info: info,
|
||||
right_list: data.right_list || [],
|
||||
last_next: data.last_next || null,
|
||||
emoji_list: data.emoji_list || [],
|
||||
blog_main_name: base == null ? this.$t('detail.detail.e439j9') : (base.blog_main_name || this.$t('detail.detail.e439j9')),
|
||||
});
|
||||
|
||||
if (info != null) {
|
||||
// 基础自定义分享
|
||||
this.setData({
|
||||
share_info: {
|
||||
title: info.seo_title || info.title,
|
||||
desc: info.seo_desc || info.describe,
|
||||
path: '/pages/plugins/blog/detail/detail',
|
||||
query: 'id=' + info.id,
|
||||
img: info.share_images || info.cover,
|
||||
},
|
||||
});
|
||||
|
||||
// 标题
|
||||
uni.setNavigationBarTitle({ title: info.title });
|
||||
}
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
}
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle(this.share_info);
|
||||
},
|
||||
fail: () => {
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_msg: this.$t('common.internet_error_tips'),
|
||||
data_list_loding_status: 2,
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// url事件
|
||||
url_event(e) {
|
||||
app.globalData.url_event(e);
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style></style>
|
||||
11
pages/plugins/blog/form/form.css
Normal file
11
pages/plugins/blog/form/form.css
Normal file
@@ -0,0 +1,11 @@
|
||||
.sp-editor {
|
||||
height: 500rpx;
|
||||
}
|
||||
|
||||
.more {
|
||||
transition: all 0.3s ease-in-out;
|
||||
}
|
||||
.p-content {
|
||||
max-height: 50vh;
|
||||
overflow-y: auto;
|
||||
}
|
||||
450
pages/plugins/blog/form/form.vue
Normal file
450
pages/plugins/blog/form/form.vue
Normal file
@@ -0,0 +1,450 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view v-if="data_list_loding_status !== 1">
|
||||
<form @submit="form_submit" class="form-container">
|
||||
<view class="page-bottom-fixed padding-main">
|
||||
<view class="bg-white border-radius-main pr oh spacing-mb">
|
||||
<view class="form-gorup">
|
||||
<view class="flex-row jc-sb align-c">
|
||||
<view class="form-gorup-title padding-right-main">{{$t('user-detail.user-detail.uy6lrz')}}<text class="form-group-tips-must">*</text></view>
|
||||
<input type="text" name="title" :value="data.title || ''" maxlength="16" placeholder-class="cr-grey-9" class="cr-base flex-1 flex-width tr" :placeholder="$t('common.please_input')" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bg-white border-radius-main pr oh spacing-mb">
|
||||
<view class="form-gorup">
|
||||
<view class="flex-row jc-sb align-c">
|
||||
<view class="form-gorup-title padding-right-main">{{$t('common.category')}}<text class="form-group-tips-must">*</text></view>
|
||||
<view class="flex-1 flex-width tr" @tap="popupOpen">
|
||||
<text :class="data.blog_category_name ? 'cr-black' : 'cr-grey-9'">{{ data.blog_category_name || $t('form.form.4cbom4') }}</text>
|
||||
<view class="pr top-sm margin-left-sm dis-inline-block">
|
||||
<iconfont name="icon-arrow-right" color="#999" size="28rpx"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bg-white border-radius-main pr oh spacing-mb">
|
||||
<view class="form-gorup">
|
||||
<view class="flex-row jc-sb align-c">
|
||||
<view class="form-gorup-title padding-right-main">{{$t('form.form.043a10')}}</view>
|
||||
<view class="flex-1 flex-width tr">
|
||||
<switch :color="theme_color" :checked="(data.is_enable || 0) == 1 ? true : false" @change="is_enable_event" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bg-white border-radius-main pr oh spacing-mb">
|
||||
<view class="form-gorup">
|
||||
<view class="form-gorup-title padding-right-main">{{$t('form.form.5hn8k3')}}</view>
|
||||
<view class="margin-top-main">
|
||||
<component-upload :propData="image_list" :propMaxNum="1" :propPathType="editor_path_type" @call-back="retrun_image_event"></component-upload>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bg-white border-radius-main pr oh">
|
||||
<view class="form-gorup">
|
||||
<view class="form-gorup-title padding-right-main">{{$t('user-detail.user-detail.7cufw6')}}<text class="form-group-tips-must">*</text></view>
|
||||
<view class="margin-top-main sp-editor">
|
||||
<!-- <sp-editor :templates="(data || null) !== null ? data.content : ''" @input="rich_text_event" @upinImage="up_in_image_event"></sp-editor> -->
|
||||
<sp-editor @init="initEditor" @input="rich_text_event" @upinImage="up_in_image_event"></sp-editor>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="more oh" :style="'height:' + more_height">
|
||||
<view class="bg-white border-radius-main pr oh spacing-mb spacing-mt">
|
||||
<view class="form-gorup">
|
||||
<view class="form-gorup-title padding-right-main">{{$t('form.form.xy87t8')}}</view>
|
||||
<textarea name="describe" placeholder-class="cr-grey-9" class="cr-base" :placeholder="$t('common.please_input')" maxlength="200" :value="data.describe"></textarea>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bg-white border-radius-main pr oh spacing-mb">
|
||||
<view class="form-gorup">
|
||||
<view class="flex-row jc-sb align-c">
|
||||
<view class="form-gorup-title padding-right-main">{{$t('form.form.kvr2i3')}}</view>
|
||||
<input type="text" name="seo_title" :value="data.seo_title || ''" maxlength="16" placeholder-class="cr-grey-9" class="cr-base flex-1 flex-width tr" :placeholder="$t('common.please_input')" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bg-white border-radius-main pr oh spacing-mb">
|
||||
<view class="form-gorup">
|
||||
<view class="flex-row jc-sb align-c">
|
||||
<view class="form-gorup-title padding-right-main">{{$t('form.form.l87ju1')}}</view>
|
||||
<input type="text" name="seo_keywords" :value="data.seo_keywords || ''" maxlength="16" placeholder-class="cr-grey-9" class="cr-base flex-1 flex-width tr" :placeholder="$t('common.please_input')" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bg-white border-radius-main pr oh">
|
||||
<view class="form-gorup">
|
||||
<view class="flex-row jc-sb align-c">
|
||||
<view class="form-gorup-title padding-right-main">{{$t('form.form.5487bt')}}</view>
|
||||
<input type="text" name="seo_desc" :value="data.seo_desc || ''" maxlength="16" placeholder-class="cr-grey-9" class="cr-base flex-1 flex-width tr" :placeholder="$t('common.please_input')" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bg-white border-radius-main pr oh spacing-mb spacing-mt">
|
||||
<view class="padding-main flex-row jc-c align-c cr-grey-9" @tap="more_event">
|
||||
<text>{{ is_more ? $t('form.form.4h814w') : $t('form.form.lfwj0g') }}</text>
|
||||
<view class="margin-left-sm dis-inline-block">
|
||||
<iconfont :name="is_more ? 'icon-arrow-top' : 'icon-arrow-bottom'" color="#999" size="24rpx"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 底部操作 -->
|
||||
<view class="bottom-fixed" :style="bottom_fixed_style">
|
||||
<view class="bottom-line-exclude">
|
||||
<button class="item cr-white bg-main round text-size wh-auto" type="default" form-type="submit" hover-class="none" :loading="form_submit_loading" :disabled="form_submit_loading">{{$t('form.form.4yd066')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 分类选择 -->
|
||||
<component-popup :propShow="popup_status" propPosition="bottom" @onclose="popup_close_event">
|
||||
<view class="p-title flex-row jc-sb align-c padding-main br-b-e">
|
||||
<view class="text-size-lg fw-b">{{$t('form.form.4vku7u')}}</view>
|
||||
<view class="popup-colse" @tap="popup_close_event">
|
||||
<iconfont name="icon-close-o" color="#333" size="28rpx"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
<view class="p-content padding-main">
|
||||
<view v-for="(item, index) in blog_category_list" :key="index">
|
||||
<view class="padding-vertical-main flex-row jc-sb align-c" :class="data.blog_category_id == item.id ? 'cr-main' : ''" :data-value="item.name" :data-id="item.id" @tap="get_type_event">
|
||||
{{ item.name }}
|
||||
<iconfont v-if="data.blog_category_id === item.id" name="icon-checked" color="#333" size="28rpx"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
</form>
|
||||
</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 componentPopup from '@/components/popup/popup';
|
||||
import componentUpload from '@/components/upload/upload';
|
||||
import componentNoData from '@/components/no-data/no-data';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
theme_color: app.globalData.get_theme_color(),
|
||||
data_list_loding_status: 1,
|
||||
bottom_fixed_style: '',
|
||||
params: {},
|
||||
data: {},
|
||||
index: 0,
|
||||
// 分类选择弹窗
|
||||
popup_status: false,
|
||||
blog_category_list: [],
|
||||
|
||||
// 封面图片
|
||||
image_list: [],
|
||||
// 路径类型
|
||||
editor_path_type: 'common',
|
||||
|
||||
// 内容
|
||||
input_length_max: 500,
|
||||
input_value: '',
|
||||
// 查看更多
|
||||
more_height: '0',
|
||||
is_more: false,
|
||||
|
||||
// 提交按钮
|
||||
form_submit_loading: false,
|
||||
};
|
||||
},
|
||||
components: {
|
||||
componentCommon,
|
||||
componentPopup,
|
||||
componentUpload,
|
||||
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();
|
||||
}
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
// 数据加载
|
||||
this.init();
|
||||
},
|
||||
|
||||
// 页面销毁时执行
|
||||
onUnload: function () {},
|
||||
|
||||
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: 2,
|
||||
data_list_loding_msg: this.$t('form.form.8l3ul5'),
|
||||
});
|
||||
}
|
||||
},
|
||||
get_data_list() {
|
||||
this.setData({
|
||||
data_list_loding_status: 1,
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('saveinfo', 'blog', 'blog'),
|
||||
method: 'POST',
|
||||
data: {...this.params, ...{lang_can_key: 'blog_category_list'}},
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var blog_category_list = res.data.data.blog_category_list || [];
|
||||
if (res.data.data.data) {
|
||||
var data = res.data.data.data || {};
|
||||
// 封面列表
|
||||
var img_list = [];
|
||||
if ((data.cover || null) != null && data.cover.length > 0) {
|
||||
img_list.push(data.cover);
|
||||
}
|
||||
// 分类名称匹配重新匹配赋值
|
||||
var blog_category_name = '';
|
||||
for(var i in blog_category_list) {
|
||||
if(blog_category_list[i]['id'] == data.blog_category_id) {
|
||||
blog_category_name = blog_category_list[i]['name'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
data['blog_category_name'] = blog_category_name;
|
||||
// 设置数据
|
||||
this.setData({
|
||||
data: data,
|
||||
blog_category_list: blog_category_list,
|
||||
image_list: img_list,
|
||||
more_height: data.describe || data.seo_title || data.seo_keywords || data.seo_desc ? '708rpx' : '0',
|
||||
is_more: data.describe || data.seo_title || data.seo_keywords || data.seo_desc ? 'true' : 'false',
|
||||
data_list_loding_status: 3,
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
blog_category_list: blog_category_list,
|
||||
data_list_loding_status: 3,
|
||||
});
|
||||
}
|
||||
} 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.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
// 弹层打开
|
||||
popupOpen() {
|
||||
this.setData({
|
||||
popup_status: true,
|
||||
});
|
||||
},
|
||||
|
||||
// 弹层关闭
|
||||
popup_close_event(e) {
|
||||
this.setData({
|
||||
popup_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 是否启用
|
||||
is_enable_event(e) {
|
||||
var new_data = this.data;
|
||||
new_data.is_enable = e.detail.value ? 1 : 0;
|
||||
this.setData({
|
||||
data: new_data,
|
||||
});
|
||||
},
|
||||
|
||||
// 获取选中的分类
|
||||
get_type_event(e) {
|
||||
var new_data = this.data;
|
||||
new_data.blog_category_id = e.currentTarget.dataset.id;
|
||||
new_data.blog_category_name = e.currentTarget.dataset.value;
|
||||
this.setData({
|
||||
data: new_data,
|
||||
popup_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 上传回调
|
||||
retrun_image_event(data) {
|
||||
var new_data = this.data;
|
||||
new_data.cover = data[0];
|
||||
this.setData({
|
||||
data: new_data,
|
||||
});
|
||||
},
|
||||
|
||||
// 回调富文本内容
|
||||
rich_text_event(e) {
|
||||
var new_data = this.data;
|
||||
new_data.content = e.html;
|
||||
this.setData({
|
||||
data: new_data,
|
||||
});
|
||||
},
|
||||
initEditor(editor) {
|
||||
// 初始化编辑器内容
|
||||
editor.setContents({
|
||||
html: (this.data || null) !== null ? this.data.content : '',
|
||||
});
|
||||
},
|
||||
|
||||
// 上传图片
|
||||
up_in_image_event(tempFiles, editorCtx) {
|
||||
var self = this;
|
||||
// 使用 uniCloud.uploadFile 上传图片的示例方法(可适用多选上传)
|
||||
tempFiles.forEach(async (item) => {
|
||||
uni.showLoading({
|
||||
title: self.$t('form.form.2e5rv3'),
|
||||
mask: true,
|
||||
});
|
||||
await uni.uploadFile({
|
||||
url: app.globalData.get_request_url('index', 'ueditor'),
|
||||
// #ifdef APP-PLUS || H5
|
||||
filePath: item.path,
|
||||
// #endif
|
||||
// #ifdef MP-WEIXIN
|
||||
filePath: item.tempFilePath,
|
||||
// #endif
|
||||
name: 'upfile',
|
||||
formData: {
|
||||
action: 'uploadimage',
|
||||
path_type: 'common', // 路径类型,默认common
|
||||
},
|
||||
success: function (res) {
|
||||
let data = JSON.parse(res.data);
|
||||
if (res.statusCode == 200) {
|
||||
// 上传完成后处理
|
||||
editorCtx.insertImage({
|
||||
src: data.data.url, // 此处需要将图片地址切换成服务器返回的真实图片地址
|
||||
// width: '50%',
|
||||
alt: self.$t('common.video'),
|
||||
success: function (e) {},
|
||||
});
|
||||
uni.hideLoading();
|
||||
}
|
||||
},
|
||||
fail: function (e) {
|
||||
app.globalData.showToast(e.errMsg);
|
||||
uni.hideLoading();
|
||||
},
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
// 更多内容
|
||||
more_event() {
|
||||
this.setData({
|
||||
more_height: !this.is_more ? '708rpx' : '0',
|
||||
is_more: !this.is_more,
|
||||
});
|
||||
},
|
||||
|
||||
// 表单提交
|
||||
form_submit(e) {
|
||||
// 数据验证
|
||||
var validation = [
|
||||
{ fields: 'title', msg: this.$t('form.form.v19gg8') },
|
||||
{ fields: 'blog_category_id', msg: this.$t('form.form.gu3x97') },
|
||||
{ fields: 'content', msg: this.$t('form.form.adiq70') },
|
||||
];
|
||||
var validate = {
|
||||
blog_category_id: this.data.blog_category_id,
|
||||
content: this.data.content,
|
||||
title: e.detail.value.title,
|
||||
};
|
||||
if (app.globalData.fields_check(validate, validation)) {
|
||||
uni.showLoading({
|
||||
title: this.$t('buy.buy.r79t77'),
|
||||
});
|
||||
this.setData({
|
||||
form_submit_loading: true,
|
||||
});
|
||||
var new_data = {
|
||||
...e.detail.value,
|
||||
...this.data,
|
||||
};
|
||||
// 网络请求
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('save', 'blog', 'blog'),
|
||||
method: 'POST',
|
||||
data: new_data,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
app.globalData.showToast(res.data.msg, 'success');
|
||||
setTimeout(function () {
|
||||
app.globalData.page_back_prev_event();
|
||||
}, 2000);
|
||||
} else {
|
||||
this.setData({
|
||||
form_submit_loading: 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_loading: false,
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './form.css';
|
||||
</style>
|
||||
42
pages/plugins/blog/index/index.css
Normal file
42
pages/plugins/blog/index/index.css
Normal file
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* 分类
|
||||
*/
|
||||
.nav-list {
|
||||
height: 38rpx;
|
||||
line-height: 38rpx;
|
||||
width: calc(100% - 155rpx);
|
||||
}
|
||||
|
||||
/**
|
||||
* 推荐博文
|
||||
*/
|
||||
.right-list .item .blog-title {
|
||||
width: calc(100% - 210rpx);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分类导航
|
||||
*/
|
||||
.nav-blog-category .item {
|
||||
width: calc(50% - 10rpx);
|
||||
}
|
||||
.nav-blog-category .item:nth-child(odd) {
|
||||
float: left;
|
||||
}
|
||||
.nav-blog-category .item:nth-child(even) {
|
||||
float: right;
|
||||
}
|
||||
.nav-blog-category .item .icon,
|
||||
.nav-blog-category .item .icon-text {
|
||||
width: 74rpx;
|
||||
height: 74rpx !important;
|
||||
}
|
||||
.nav-blog-category .item .icon-text {
|
||||
line-height: 72rpx;
|
||||
font-size: 48rpx;
|
||||
background: #e6f2f8;
|
||||
color: #3f51b5;
|
||||
}
|
||||
.nav-blog-category .item .right-base {
|
||||
width: calc(100% - 84rpx);
|
||||
}
|
||||
280
pages/plugins/blog/index/index.vue
Normal file
280
pages/plugins/blog/index/index.vue
Normal file
@@ -0,0 +1,280 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view v-if="(data_base || null) != null" :class="(data_base || null) != null && (data_base.is_user_add_blog || 0) == 1 ? 'page-bottom-fixed' : ''">
|
||||
<!-- 搜索框 -->
|
||||
<view class="nav-search padding-main">
|
||||
<component-search propBrColor="#efefef" propBgColor="#fff" propUrl="/pages/plugins/blog/search/search"></component-search>
|
||||
</view>
|
||||
|
||||
<!-- 轮播 -->
|
||||
<view v-if="slide_list.length > 0" class="padding-horizontal-main spacing-mb">
|
||||
<component-banner :propData="slide_list"></component-banner>
|
||||
</view>
|
||||
|
||||
<!-- 分类导航 -->
|
||||
<view v-if="(data_base.is_home_category_main_nav || 0) == 1 && (category || null) != null && category.length > 0" class="nav-blog-category padding-horizontal-main oh">
|
||||
<block v-for="(item, index) in category" :key="index">
|
||||
<view class="item oh padding-main margin-bottom-main radius bg-white bs-bb" :data-value="item.url" @tap="url_event">
|
||||
<image v-if="(item.icon || null) != null" :src="item.icon" mode="aspectFill" class="fl icon radius"></image>
|
||||
<view v-else class="fl radius icon-text tc">{{ item.name.substr(0, 1) }}</view>
|
||||
<view class="fr right-base">
|
||||
<view class="single-text cr-base">
|
||||
<text class="fw">{{ item.name }}</text>
|
||||
<text v-if="(item.blog_data || null) != null && item.blog_data.day_comments_count > 0" class="margin-left-sm cr-red fw">({{ item.blog_data.day_comments_count }})</text>
|
||||
</view>
|
||||
<view v-if="(item.blog_data || null) != null" class="single-text cr-grey text-size-xs">
|
||||
<text>{{ blog_main_name }}: {{ item.blog_data.blog_count }}</text>
|
||||
<text v-if="(data_base.is_blog_comments_show || 0) == 1" class="margin-left">{{ $t('index.index.lkld04') }}{{ item.blog_data.comments_count }}</text>
|
||||
<text v-if="(data_base.is_blog_give_thumbs || 0) == 1" class="margin-left">{{ $t('index.index.r6vv25') }}{{ item.blog_data.give_thumbs_count }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
|
||||
<!-- 分类 -->
|
||||
<view class="padding-horizontal-main">
|
||||
<view class="spacing-nav-title flex-row align-c jc-sb text-size-xs">
|
||||
<text class="text-wrapper title-left-border single-text flex-1 flex-width padding-right-main">{{ $t('index.index.6rsqp1') }}{{ blog_main_name }}</text>
|
||||
<text data-value="/pages/plugins/blog/search/search" @tap="url_event" class="arrow-right padding-right cr-grey cp">{{ $t('common.more') }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 博文列表 -->
|
||||
<view v-if="data_list.length > 0" class="plugins-blog-list padding-horizontal-main">
|
||||
<view v-for="(item, index) in data_list" :key="index">
|
||||
<view :data-value="item.url" @tap="url_event" class="item oh padding-main border-radius-main bg-white cp spacing-mb">
|
||||
<image class="blog-img fl radius" :src="item.cover" mode="aspectFill"></image>
|
||||
<view class="base fr">
|
||||
<view class="single-text text-size">{{ item.title }}</view>
|
||||
<view class="cr-grey margin-top-sm">{{ item.add_time_date_cn }}</view>
|
||||
<view class="cr-base text-size-sm multi-text margin-top-sm">{{ item.describe }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 热门博文-滚动 -->
|
||||
<view v-if="hot_list.length > 0" class="padding-horizontal-main spacing-mb">
|
||||
<view class="spacing-nav-title flex-row align-c jc-sb text-size-xs">
|
||||
<text class="text-wrapper title-left-border single-text flex-1 flex-width padding-right-main">{{ $t('index.index.pot64x') }}{{ blog_main_name }}</text>
|
||||
<text data-value="/pages/plugins/blog/search/search" @tap="url_event" class="arrow-right padding-right cr-grey cp">{{ $t('common.more') }}</text>
|
||||
</view>
|
||||
<view class="rolling-horizontal border-radius-main oh">
|
||||
<view class="plugins-blog-rolling-list scroll-view-horizontal">
|
||||
<swiper :vertical="false" :autoplay="(data_base.is_home_hot_auto_play || 0) == 1" :circular="false" :display-multiple-items="hot_list.length < 3 ? hot_list.length : 3" interval="3000">
|
||||
<block v-for="(item, index) in hot_list" :key="index">
|
||||
<swiper-item>
|
||||
<view :data-value="item.url" @tap="url_event" class="item bg-white border-radius-main margin-right-main oh pr ht-auto pr cp">
|
||||
<image class="blog-img dis-block wh-auto" :src="item.cover" mode="aspectFill"></image>
|
||||
<view class="blog-title pa single-text cr-white padding-horizontal-main padding-top-sm padding-bottom-sm">{{ item.title }}</view>
|
||||
</view>
|
||||
</swiper-item>
|
||||
</block>
|
||||
</swiper>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 推荐博文 -->
|
||||
<view v-if="right_list.length > 0" class="padding-horizontal-main spacing-mb">
|
||||
<view class="spacing-nav-title flex-row align-c jc-sb text-size-xs">
|
||||
<text class="text-wrapper title-left-border single-text flex-1 flex-width padding-right-main">{{ $t('detail.detail.455787') }}{{ blog_main_name }}</text>
|
||||
<text data-value="/pages/plugins/blog/search/search" @tap="url_event" class="arrow-right padding-right cr-grey cp">{{ $t('common.more') }}</text>
|
||||
</view>
|
||||
<view class="right-list padding-horizontal-main border-radius-main bg-white">
|
||||
<block v-for="(item, index) in right_list" :key="index">
|
||||
<view :data-value="item.url" @tap="url_event" :class="'item padding-vertical-main oh cp ' + (index > 0 ? 'br-t' : '')">
|
||||
<view class="blog-title single-text fl">{{ item.title }}</view>
|
||||
<text class="cr-grey fr">{{ $t('detail.detail.e6ga1y') }}{{ item.access_count }}{{ $t('buy.buy.0pgsrm') }}</text>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 推荐商品 -->
|
||||
<view v-if="goods_list.length > 0" class="goods-list oh padding-horizontal-main">
|
||||
<view class="spacing-nav-title flex-row align-c jc-sb text-size-xs">
|
||||
<text class="text-wrapper title-left-border single-text flex-1 flex-width padding-right-main">{{ $t('index.index.8t4j95') }}</text>
|
||||
<text data-value="/pages/goods-search/goods-search" @tap="url_event" class="arrow-right padding-right cr-grey cp">{{ $t('common.more') }}</text>
|
||||
</view>
|
||||
<component-goods-list :propData="{ style_type: 1, goods_list: goods_list }" :propCurrencySymbol="currency_symbol"></component-goods-list>
|
||||
</view>
|
||||
|
||||
<!-- 发布博文、我的博文入口 -->
|
||||
<view v-if="(data_base || null) != null && (data_base.is_user_add_blog || 0) == 1" class="bottom-fixed" :style="bottom_fixed_style">
|
||||
<view class="bottom-line-exclude">
|
||||
<view class="item flex-row jc-sa align-c text-size fw-b br bg-white round padding-vertical">
|
||||
<view data-value="/pages/plugins/blog/form/form" @tap="url_event" class="flex-1 tc flex-col jc-c align-c cp">
|
||||
<view class="divider-r-d wh-auto"> <iconfont name="icon-edit-below-line" size="30rpx" color="#333" propClass="margin-right-sm"></iconfont>{{$t('detail.detail.fn3w01')}}{{ blog_main_name }}</view>
|
||||
</view>
|
||||
<view data-value="/pages/plugins/blog/user-list/user-list" @tap="url_event" class="flex-1 tc flex-col jc-c align-c cp">
|
||||
<view class="wh-auto"> <iconfont name="icon-list-dot" size="32rpx" color="#333" propClass="margin-right-sm pr top-xs"></iconfont>{{$t('common.my')}}{{ blog_main_name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</view>
|
||||
<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 componentSearch from '@/components/search/search';
|
||||
import componentBanner from '@/components/slider/slider';
|
||||
import componentCountdown from '@/components/countdown/countdown';
|
||||
import componentNoData from '@/components/no-data/no-data';
|
||||
import componentBottomLine from '@/components/bottom-line/bottom-line';
|
||||
import componentGoodsList from '@/components/goods-list/goods-list';
|
||||
|
||||
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(),
|
||||
bottom_fixed_style: '',
|
||||
data_base: null,
|
||||
category: [],
|
||||
data_list: [],
|
||||
slide_list: [],
|
||||
goods_list: [],
|
||||
hot_list: [],
|
||||
right_list: [],
|
||||
blog_main_name: this.$t('detail.detail.e439j9'),
|
||||
// 自定义分享信息
|
||||
share_info: {},
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentSearch,
|
||||
componentBanner,
|
||||
componentCountdown,
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
componentGoodsList,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(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('index', 'index', 'blog'),
|
||||
method: 'POST',
|
||||
data: {},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
this.setData({
|
||||
data_base: data.base || null,
|
||||
category: data.category || [],
|
||||
data_list: data.data_list || [],
|
||||
slide_list: data.slide_list || [],
|
||||
goods_list: data.goods_list || [],
|
||||
hot_list: data.hot_list || [],
|
||||
right_list: data.right_list || [],
|
||||
blog_main_name: (data.base || null) == null ? this.$t('detail.detail.e439j9') : data.base.blog_main_name || this.$t('detail.detail.e439j9'),
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: 0,
|
||||
data_bottom_line_status: true,
|
||||
});
|
||||
|
||||
// 基础自定义分享
|
||||
var title = this.data_base.seo_title || this.data_base.application_name;
|
||||
this.setData({
|
||||
share_info: {
|
||||
title: title,
|
||||
desc: this.data_base.seo_desc,
|
||||
path: '/pages/plugins/blog/index/index',
|
||||
img: (this.slide_list || null) != null && this.slide_list.length > 0 ? this.slide_list[0]['images_url'] : '',
|
||||
},
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
}
|
||||
|
||||
// 标题
|
||||
uni.setNavigationBarTitle({ title: title });
|
||||
|
||||
// 分享菜单处理
|
||||
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);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './index.css';
|
||||
</style>
|
||||
31
pages/plugins/blog/search/search.css
Normal file
31
pages/plugins/blog/search/search.css
Normal file
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* 搜索
|
||||
*/
|
||||
.search-keywords icon {
|
||||
left: 30rpx;
|
||||
top: calc(50% - 6px);
|
||||
z-index: 1;
|
||||
}
|
||||
.search-keywords input {
|
||||
font-size: 26rpx;
|
||||
padding: 0 30rpx 0 76rpx;
|
||||
box-sizing: border-box;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
background: #f0f0f0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分类导航
|
||||
*/
|
||||
.nav-list {
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据列表
|
||||
*/
|
||||
.scroll-box {
|
||||
height: calc(100vh - 110rpx - 30px);
|
||||
}
|
||||
342
pages/plugins/blog/search/search.vue
Normal file
342
pages/plugins/blog/search/search.vue
Normal file
@@ -0,0 +1,342 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view v-if="(data_base || null) != null">
|
||||
<!-- 搜索关键字 -->
|
||||
<view class="padding-horizontal-main padding-top-main padding-bottom-sm bg-white">
|
||||
<view class="search-keywords pr">
|
||||
<icon type="search" size="12" class="pa"></icon>
|
||||
<input type="text" confirm-type="search" :placeholder="$t('search.search.723rbx')" :value="search_keywords_value" @confirm="search_keywords_event" class="cr-base round wh-auto" placeholder-class="cr-grey" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 分类 -->
|
||||
<scroll-view v-if="(category || null) != null && category.length > 0" class="nav-list scroll-view-horizontal bg-white oh" scroll-x="true">
|
||||
<view :class="'item cr-grey dis-inline-block padding-horizontal-main ' + (nav_active_value == 0 ? 'cr-main' : '')" @tap="nav_event" data-value="0">{{ $t('common.all') }}</view>
|
||||
<block v-for="(item, index) in category" :key="index">
|
||||
<view :class="'item cr-grey dis-inline-block padding-horizontal-main ' + (nav_active_value == item.id ? 'cr-main' : '')" @tap="nav_event" :data-value="item.id">{{ item.name }}</view>
|
||||
</block>
|
||||
</scroll-view>
|
||||
|
||||
<!-- 列表 -->
|
||||
<scroll-view :scroll-y="true" class="scroll-box" @scrolltolower="scroll_lower" lower-threshold="60">
|
||||
<view :class="(data_base.is_user_add_blog || 0) == 1 ? 'page-bottom-fixed' : ''">
|
||||
<view v-if="(data_list || null) != null && data_list.length > 0" class="plugins-blog-list padding-horizontal-main padding-top-main oh">
|
||||
<view v-for="(item, index) in data_list" :key="index">
|
||||
<view :data-value="item.url" @tap="url_event" class="item oh cp padding-main border-radius-main bg-white spacing-mb">
|
||||
<image class="blog-img fl radius" :src="item.cover" mode="aspectFill"></image>
|
||||
<view class="base fr">
|
||||
<view class="single-text text-size">{{ item.title }}</view>
|
||||
<view class="cr-grey margin-top-sm">{{ item.add_time_date_cn }}</view>
|
||||
<view class="cr-base text-size-sm multi-text margin-top-sm">{{ item.describe }}</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>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
<!-- 发布博文、我的博文入口 -->
|
||||
<view v-if="(data_base.is_user_add_blog || 0) == 1" class="bottom-fixed" :style="bottom_fixed_style">
|
||||
<view class="bottom-line-exclude">
|
||||
<view class="item flex-row jc-sa align-c text-size fw-b br bg-white round padding-vertical">
|
||||
<view data-value="/pages/plugins/blog/form/form" @tap="url_event" class="flex-1 tc flex-col jc-c align-c cp">
|
||||
<view class="divider-r-d wh-auto"> <iconfont name="icon-edit-below-line" size="30rpx" color="#333" propClass="margin-right-sm"></iconfont>{{$t('detail.detail.fn3w01')}}{{ blog_main_name }}</view>
|
||||
</view>
|
||||
<view data-value="/pages/plugins/blog/user-list/user-list" @tap="url_event" class="flex-1 tc flex-col jc-c align-c cp">
|
||||
<view class="wh-auto"> <iconfont name="icon-list-dot" size="32rpx" color="#333" propClass="margin-right-sm pr top-xs"></iconfont>{{$t('common.my')}}{{ blog_main_name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<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(),
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
data_bottom_line_status: false,
|
||||
data_is_loading: 0,
|
||||
bottom_fixed_style: '',
|
||||
data_list: [],
|
||||
data_total: 0,
|
||||
data_page_total: 0,
|
||||
data_page: 1,
|
||||
params: null,
|
||||
data_base: null,
|
||||
category: [],
|
||||
nav_active_value: 0,
|
||||
search_keywords_value: '',
|
||||
// 自定义分享信息
|
||||
share_info: {},
|
||||
blog_main_name: this.$t('detail.detail.e439j9'),
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 参数处理
|
||||
params = app.globalData.launch_params_handle(params);
|
||||
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: params,
|
||||
nav_active_value: params.id || 0,
|
||||
search_keywords_value: params.keywords || '',
|
||||
});
|
||||
|
||||
// 数据加载
|
||||
this.get_data();
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.setData({
|
||||
data_page: 1,
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 初始化
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('index', 'search', 'blog'),
|
||||
method: 'POST',
|
||||
data: {},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
// 标题
|
||||
var blog_main_name = (data.base || null) == null ? this.$t('detail.detail.e439j9') : data.base.blog_main_name || this.$t('detail.detail.e439j9');
|
||||
this.setData({
|
||||
data_base: data.base || null,
|
||||
category: data.category || [],
|
||||
blog_main_name: blog_main_name,
|
||||
});
|
||||
uni.setNavigationBarTitle({ title: blog_main_name + this.$t('common.search') });
|
||||
|
||||
// 获取列表数据
|
||||
this.get_data_list(1);
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 获取数据列表
|
||||
get_data_list(is_mandatory) {
|
||||
// 分页是否还有数据
|
||||
if ((is_mandatory || 0) == 0) {
|
||||
if (this.data_bottom_line_status == true) {
|
||||
uni.stopPullDownRefresh();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// 基础自定义分享
|
||||
this.share_info_handle();
|
||||
|
||||
// 是否加载中
|
||||
if (this.data_is_loading == 1) {
|
||||
return false;
|
||||
}
|
||||
this.setData({ data_is_loading: 1 });
|
||||
|
||||
// 加载loding
|
||||
if(this.data_page > 1) {
|
||||
uni.showLoading({
|
||||
title: this.$t('common.loading_in_text'),
|
||||
});
|
||||
}
|
||||
|
||||
// 获取数据
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('datalist', 'search', 'blog'),
|
||||
method: 'POST',
|
||||
data: {
|
||||
page: this.data_page,
|
||||
id: this.nav_active_value,
|
||||
bwd: this.search_keywords_value,
|
||||
},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
if(this.data_page > 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
if (data.data.length > 0) {
|
||||
if (this.data_page <= 1) {
|
||||
var temp_data_list = data.data;
|
||||
} else {
|
||||
var temp_data_list = this.data_list || [];
|
||||
var temp_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: data.total,
|
||||
data_page_total: 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_loding_msg: this.$t('common.no_relevant_data_tips'),
|
||||
data_is_loading: 0,
|
||||
});
|
||||
if (this.data_page <= 1) {
|
||||
this.setData({
|
||||
data_list: [],
|
||||
data_bottom_line_status: false,
|
||||
});
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
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'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 分享设置处理
|
||||
share_info_handle() {
|
||||
// 基础自定义分享
|
||||
var info = this.data_base || {};
|
||||
if ((this.nav_active_value || 0) != 0 && this.category.length > 0) {
|
||||
for (var i in this.category) {
|
||||
if (this.nav_active_value == this.category[i]['id']) {
|
||||
info = this.category[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
this.setData({
|
||||
share_info: {
|
||||
title: info.seo_title || this.data_base.application_name,
|
||||
desc: info.seo_desc,
|
||||
path: '/pages/plugins/blog/search/search',
|
||||
query: 'id=' + this.nav_active_value + '&keywords=' + this.search_keywords_value,
|
||||
},
|
||||
});
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle(this.share_info);
|
||||
},
|
||||
|
||||
// 滚动加载
|
||||
scroll_lower(e) {
|
||||
this.get_data_list();
|
||||
},
|
||||
|
||||
// 导航事件
|
||||
nav_event(e) {
|
||||
this.setData({
|
||||
nav_active_value: e.currentTarget.dataset.value || 0,
|
||||
data_page: 1,
|
||||
data_list: [],
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// 关键字输入事件
|
||||
search_keywords_event(e) {
|
||||
this.setData({
|
||||
search_keywords_value: e.detail.value || '',
|
||||
data_page: 1,
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// url事件
|
||||
url_event(e) {
|
||||
app.globalData.url_event(e);
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './search.css';
|
||||
</style>
|
||||
37
pages/plugins/blog/user-list/user-list.css
Normal file
37
pages/plugins/blog/user-list/user-list.css
Normal file
@@ -0,0 +1,37 @@
|
||||
.blog-img {
|
||||
width: 236rpx;
|
||||
height: 182rpx;
|
||||
}
|
||||
|
||||
.badge {
|
||||
display: inline-block;
|
||||
height: 32rpx;
|
||||
line-height: 32rpx;
|
||||
border-radius: 18rpx;
|
||||
font-size: 10px;
|
||||
padding: 0 16rpx;
|
||||
}
|
||||
|
||||
.badge.success {
|
||||
color: #52C41A;
|
||||
background: rgb(82 196 26 / 10%);
|
||||
}
|
||||
|
||||
.badge.info {
|
||||
color: #999;
|
||||
background: #f4f4f4;
|
||||
}
|
||||
|
||||
.badge.error {
|
||||
color: #E22C08;
|
||||
background: rgba(226, 45, 8, 0.1);
|
||||
}
|
||||
|
||||
.add-icon {
|
||||
height: 80rpx;
|
||||
line-height: 76rpx;
|
||||
margin-right: 6rpx;
|
||||
}
|
||||
.multi-text {
|
||||
min-height: auto;
|
||||
}
|
||||
281
pages/plugins/blog/user-list/user-list.vue
Normal file
281
pages/plugins/blog/user-list/user-list.vue
Normal file
@@ -0,0 +1,281 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<block v-if="data.length > 0">
|
||||
<scroll-view :scroll-y="true" class="scroll-box" @scrolltolower="scroll_lower" lower-threshold="60">
|
||||
<view class="page-bottom-fixed padding-top-main">
|
||||
<view v-for="(item, index) in data" class="bg-white spacing-mb" :key="index">
|
||||
<view class="padding-main flex-row">
|
||||
<view v-if="item.cover" class="padding-right-main">
|
||||
<image class="blog-img radius" :src="item.cover" mode="aspectFit"></image>
|
||||
</view>
|
||||
<view class="flex-1 flex-width">
|
||||
<view class="multi-text text-size fw-b margin-bottom-xs">{{ item.title }}</view>
|
||||
<view class="text-size-sm cr-grey-9 margin-bottom-sm">{{ item.date }}</view>
|
||||
<view class="badge" :class="item.status == '0' ? 'info' : item.status === '1' ? 'success' : 'error'">{{ item.status_name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="br-t-f5 flex-row jc-sa align-c text-size tc">
|
||||
<view class="cr-base flex-1 divider-r-f5 padding-vertical-main" :data-value="'/pages/plugins/blog/form/form?id=' + item.id" @tap="url_event">
|
||||
<view class="margin-right-xs dis-inline-block">
|
||||
<iconfont name="icon-edit-below-line" size="32rpx"></iconfont>
|
||||
</view>{{$t('common.edit')}}</view>
|
||||
<view class="cr-main flex-1 padding-vertical-main" :data-id="item.id" @tap="del_event">
|
||||
<view class="margin-right-xs dis-inline-block">
|
||||
<iconfont name="icon-delete" size="32rpx"></iconfont>
|
||||
</view>{{$t('common.del')}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</block>
|
||||
|
||||
<!-- 底部操作 -->
|
||||
<view class="bottom-fixed" :style="bottom_fixed_style">
|
||||
<view class="bottom-line-exclude">
|
||||
<button class="item cr-main bg-white br-main round text-size wh-auto flex-row align-c jc-c" type="default" hover-class="none" data-value="/pages/plugins/blog/form/form" @tap="url_event">
|
||||
<view class="add-icon">
|
||||
<iconfont name="icon-xzdz-tianjiabiaoq" size="32rpx"></iconfont>
|
||||
</view>
|
||||
<text>{{$t('common.add')}}</text>
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
<block v-if="data.length == 0 && data_list_loding_status != 3">
|
||||
<!-- 提示信息 -->
|
||||
<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(),
|
||||
theme_color: app.globalData.get_theme_color(),
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
bottom_fixed_style: '',
|
||||
data: [],
|
||||
data_is_loading: 0,
|
||||
data_total: 0,
|
||||
data_page_total: 0,
|
||||
data_page: 1,
|
||||
};
|
||||
},
|
||||
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();
|
||||
}
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.setData({
|
||||
data_page: 1,
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// 页面销毁时执行
|
||||
onUnload: function () {},
|
||||
|
||||
methods: {
|
||||
init() {
|
||||
var user = app.globalData.get_user_info(this, 'init');
|
||||
if (user != false) {
|
||||
this.get_data_list(1);
|
||||
} else {
|
||||
// 提示错误
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: this.$t('form.form.8l3ul5'),
|
||||
});
|
||||
}
|
||||
},
|
||||
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'),
|
||||
});
|
||||
}
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('index', 'blog', 'blog'),
|
||||
method: 'POST',
|
||||
success: (res) => {
|
||||
if(this.data_page > 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
if (data.data.length > 0) {
|
||||
if (this.data_page <= 1) {
|
||||
var temp_data_list = data.data;
|
||||
} else {
|
||||
var temp_data_list = this.data_list || [];
|
||||
var temp_data = data.data;
|
||||
for (var i in temp_data) {
|
||||
temp_data_list.push(temp_data[i]);
|
||||
}
|
||||
}
|
||||
this.setData({
|
||||
data: temp_data_list,
|
||||
data_total: data.total,
|
||||
data_page_total: data.page_total,
|
||||
data_list_loding_status: 3,
|
||||
data_list_loding_msg: '',
|
||||
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_total: 0,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
if (this.data_page <= 1) {
|
||||
this.setData({
|
||||
data: [],
|
||||
data_bottom_line_status: false,
|
||||
});
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
if(this.data_page > 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: this.$t('common.internet_error_tips'),
|
||||
data_is_loading: 0,
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// url事件
|
||||
url_event(e) {
|
||||
app.globalData.url_event(e);
|
||||
},
|
||||
|
||||
// 删除blog
|
||||
del_event(e) {
|
||||
// 是否再次确认
|
||||
if (e.alert_status != 0 && e.alert_status != 1) {
|
||||
app.globalData.alert({
|
||||
msg: this.$t('user-list.user-list.yhvl2q'),
|
||||
is_show_cancel: 1,
|
||||
object: this,
|
||||
params: { id: e.currentTarget.dataset.id },
|
||||
method: 'del_event',
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (e.alert_status == 1) {
|
||||
// 加载loding
|
||||
uni.showLoading({
|
||||
title: this.$t('common.loading_in_text'),
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('delete', 'blog', 'blog'),
|
||||
method: 'POST',
|
||||
data: { ids: e.id },
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
var temp_list = [];
|
||||
var temp_data_list = this.data;
|
||||
for (var i in temp_data_list) {
|
||||
if (e.id.indexOf(temp_data_list[i]['id']) == -1) {
|
||||
temp_list.push(temp_data_list[i]);
|
||||
}
|
||||
}
|
||||
this.setData({
|
||||
data: temp_list,
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.del_success'), 'success');
|
||||
} else {
|
||||
if (app.globalData.is_login_check(res.data)) {
|
||||
app.globalData.showToast(this.$t('common.del_fail'));
|
||||
} else {
|
||||
app.globalData.showToast(this.$t('common.sub_error_retry_tips'));
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
// 滚动加载
|
||||
scroll_lower(e) {
|
||||
this.get_data_list();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './user-list.css';
|
||||
</style>
|
||||
64
pages/plugins/brand/index/index.css
Normal file
64
pages/plugins/brand/index/index.css
Normal file
@@ -0,0 +1,64 @@
|
||||
/**
|
||||
* 分类导航
|
||||
*/
|
||||
|
||||
.nav-list {
|
||||
width: calc(100% - 70rpx);
|
||||
}
|
||||
|
||||
.nav-list .item:first-of-type {
|
||||
margin-left: 16rpx;
|
||||
}
|
||||
|
||||
.nav-list .item {
|
||||
padding: 20rpx 4rpx;
|
||||
}
|
||||
|
||||
.nav-list image {
|
||||
width: 92rpx;
|
||||
height: 92rpx;
|
||||
margin: 0 15rpx;
|
||||
border-radius: 50%;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.nav-list-more {
|
||||
width: 100%;
|
||||
max-height: 550rpx;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.nav-list-more image {
|
||||
width: 92rpx;
|
||||
height: 92rpx;
|
||||
border-radius: 50%;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.nav-list-more .item {
|
||||
width: 20%;
|
||||
padding: 20rpx 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据列表
|
||||
*/
|
||||
.data-list .item {
|
||||
width: calc(50% - 10rpx);
|
||||
margin-bottom: 20rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.data-list .item:nth-child(2n) {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.data-list .item:nth-child(2n+1) {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.data-list .item image {
|
||||
padding-top: 24rpx;
|
||||
width: calc(100% - 48rpx);
|
||||
height: 160rpx !important;
|
||||
}
|
||||
224
pages/plugins/brand/index/index.vue
Normal file
224
pages/plugins/brand/index/index.vue
Normal file
@@ -0,0 +1,224 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view v-if="(data_base || null) != null">
|
||||
<view class="pr">
|
||||
<!-- 分类 -->
|
||||
<scroll-view v-if="(brand_category_list || null) != null && brand_category_list.length > 0" :scroll-x="true" :show-scrollbar="false" :scroll-with-animation="true" :scroll-into-view="'one-nav-item-' + nav_active_index" class="nav-list scroll-view-horizontal bg-white oh" scroll-x="true">
|
||||
<view class="flex-row flex-nowrap align-c">
|
||||
<block v-for="(item, index) in brand_category_list" :key="index">
|
||||
<view class="item flex-col align-c text-size-xss" :id="'one-nav-item-' + index" :data-index="index" @tap="nav_event" :data-value="item.id">
|
||||
<image :src="item.icon" mode="aspectFit"></image>
|
||||
<view class="padding-left-sm padding-right-sm round" :class="nav_active_value == item.id ? 'bg-main cr-white' : ''">
|
||||
{{ item.name }}
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<component-nav-more propClass="bg-white" :propStatus="popupStatus" @open-popup="open_popup_event">
|
||||
<view class="nav-list-more">
|
||||
<view class="flex-row flex-wrap align-c">
|
||||
<block v-for="(item, index) in brand_category_list" :key="index">
|
||||
<view class="item flex-col align-c text-size-xss" @tap="nav_event" :id="'one-nav-item-' + index" :data-index="index" :data-value="item.id">
|
||||
<image :src="item.icon" mode="aspectFit"></image>
|
||||
<view class="padding-left-sm padding-right-sm round" :class="nav_active_value == item.id ? 'bg-main cr-white' : ''">
|
||||
{{ item.name }}
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</component-nav-more>
|
||||
</view>
|
||||
|
||||
<!-- 列表 -->
|
||||
<view v-if="(brand_list || null) != null && brand_list.length > 0" class="data-list padding-horizontal-main padding-top-main oh">
|
||||
<block v-for="(item, index) in brand_list" :key="index">
|
||||
<view v-if="(item.is_not_show || 0) == 0" :data-value="'/pages/goods-search/goods-search?brand=' + item.id" @tap="url_event" class="item border-radius-main bg-white oh cp spacing-mb">
|
||||
<image :src="item.logo" mode="aspectFit"></image>
|
||||
<view class="padding-main tc">
|
||||
<view class="single-text fw-b cr-base">{{ item.name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</view>
|
||||
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
|
||||
<!-- 公共 -->
|
||||
<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 componentNavMore from '@/components/nav-more/nav-more';
|
||||
|
||||
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: '',
|
||||
params: null,
|
||||
data_base: null,
|
||||
brand_list: [],
|
||||
brand_category_list: [],
|
||||
nav_active_value: 0,
|
||||
// 自定义分享信息
|
||||
share_info: {},
|
||||
popupStatus: false,
|
||||
nav_active_index: 0,
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
componentNavMore,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: app.globalData.launch_params_handle(params),
|
||||
});
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 加载数据
|
||||
this.get_data();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.get_data();
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 获取数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('index', 'index', 'brand'),
|
||||
method: 'POST',
|
||||
data: {},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
var brand_list = data.brand_list || [];
|
||||
this.setData({
|
||||
data_base: data.base || null,
|
||||
brand_list: brand_list,
|
||||
brand_category_list: data.brand_category_list || [],
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: brand_list.length > 0 ? 3 : 0,
|
||||
data_bottom_line_status: brand_list.length > 0,
|
||||
});
|
||||
|
||||
// 基础自定义分享
|
||||
this.setData({
|
||||
share_info: {
|
||||
title: this.data_base.seo_title || this.data_base.application_name,
|
||||
desc: this.data_base.seo_desc,
|
||||
path: '/pages/plugins/brand/index/index',
|
||||
},
|
||||
});
|
||||
|
||||
// 导航选中处理
|
||||
this.nav_active_handle();
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle(this.share_info);
|
||||
} else {
|
||||
this.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: 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'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 导航事件
|
||||
nav_event(e) {
|
||||
this.setData({
|
||||
nav_active_value: e.currentTarget.dataset.value || 0,
|
||||
popupStatus: false,
|
||||
nav_active_index: e.currentTarget.dataset.index,
|
||||
});
|
||||
this.nav_active_handle();
|
||||
},
|
||||
// 打开弹窗
|
||||
open_popup_event(e) {
|
||||
this.setData({
|
||||
popupStatus: e,
|
||||
});
|
||||
},
|
||||
|
||||
// 导航选中处理
|
||||
nav_active_handle() {
|
||||
var value = this.nav_active_value;
|
||||
var temp_brand_list = this.brand_list;
|
||||
var count = 0;
|
||||
for (var i in temp_brand_list) {
|
||||
if (value == 0) {
|
||||
temp_brand_list[i]['is_not_show'] = 0;
|
||||
count++;
|
||||
} else {
|
||||
var is_not_show = temp_brand_list[i]['brand_category_ids'].indexOf(value) == -1 ? 1 : 0;
|
||||
temp_brand_list[i]['is_not_show'] = is_not_show;
|
||||
if (is_not_show == 0) {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.setData({
|
||||
brand_list: temp_brand_list,
|
||||
data_list_loding_status: count > 0 ? 3 : 0,
|
||||
data_bottom_line_status: count > 0,
|
||||
});
|
||||
},
|
||||
|
||||
// url事件
|
||||
url_event(e) {
|
||||
app.globalData.url_event(e);
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './index.css';
|
||||
</style>
|
||||
32
pages/plugins/coin/cash-list/cash-list.css
Normal file
32
pages/plugins/coin/cash-list/cash-list.css
Normal file
@@ -0,0 +1,32 @@
|
||||
.cash .nav {
|
||||
z-index: 102;
|
||||
}
|
||||
|
||||
.scroll-box {
|
||||
height: calc(100vh - 88rpx);
|
||||
}
|
||||
|
||||
.convert-group-row .title {
|
||||
min-width: 140rpx;
|
||||
}
|
||||
|
||||
.recharge-del-btn {
|
||||
padding: 0 60rpx;
|
||||
font-size: 28rpx;
|
||||
margin: 0 0 0 20rpx;
|
||||
color: #0079ff !important;
|
||||
background-color: #fff;
|
||||
border: 2rpx solid #0079ff;
|
||||
}
|
||||
|
||||
.recharge-del-btn:active {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
/*
|
||||
* 钱包弹窗
|
||||
*/
|
||||
.popup_accounts_container .item {
|
||||
background-color: #f4f4f4;
|
||||
border-radius: 30rpx;
|
||||
}
|
||||
518
pages/plugins/coin/cash-list/cash-list.vue
Normal file
518
pages/plugins/coin/cash-list/cash-list.vue
Normal file
@@ -0,0 +1,518 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view class="cash">
|
||||
<view class="padding-main bg-white pr nav flex-row oa">
|
||||
<view class="flex-shrink flex-row align-c margin-right-xxxl padding-right-xl pr" @tap="popup_accounts_open_event">
|
||||
<view>{{ accounts_name !== null && accounts_name !== $t('common.all') ? accounts_name : $t('cash-list.cash-list.n74r94') }}</view>
|
||||
<view class="pa right-0"><iconfont :name="popup_accounts_status ? 'icon-arrow-top' : 'icon-arrow-bottom'" size="24rpx"></iconfont></view>
|
||||
</view>
|
||||
<view class="flex-shrink flex-row align-c margin-right-xxxl padding-right-xl pr" @tap="popup_recharge_status_open_event">
|
||||
<view>{{ recharge_status_name !== null && recharge_status_name !== $t('common.all') ? recharge_status_name : $t('invoice-detail.invoice-detail.rrfex6') }}</view>
|
||||
<view class="pa right-0"><iconfont :name="popup_recharge_status_status ? 'icon-arrow-top' : 'icon-arrow-bottom'" size="24rpx"></iconfont></view>
|
||||
</view>
|
||||
<view class="flex-shrink flex-row align-c padding-right-xl pr" @tap="popup_network_open_event">
|
||||
<view>{{ network_name !== null && network_name !== $t('common.all') ? network_name : $t('cash-list.cash-list.2g251t') }}</view>
|
||||
<view class="pa right-0"><iconfont :name="popup_network_status ? 'icon-arrow-top' : 'icon-arrow-bottom'" size="24rpx"></iconfont></view>
|
||||
</view>
|
||||
</view>
|
||||
<scroll-view :scroll-y="true" class="scroll-box" lower-threshold="60" @scroll="scroll_event">
|
||||
<view class="padding-main">
|
||||
<view v-if="data_list.length > 0">
|
||||
<view v-for="(item, index) in data_list" :key="index" class="padding-main bg-white radius-md margin-bottom-main">
|
||||
<view class="br-b-dashed padding-bottom-main margin-bottom-main flex-row jc-sb align-c">
|
||||
<view class="cr-grey-9 title">{{ item.add_time }}</view>
|
||||
<view :class="item.status == 0 ? 'cr-black' : item.status_type == 1 ? 'cr-grey-9' : 'cr-black'">{{ item.status_name }}</view>
|
||||
</view>
|
||||
<view class="convert-group-row">
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('cash-list.cash-list.e6pffe')}}</text>
|
||||
<text class="fw-b warp">{{ item.cash_no }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title title">{{$t('cash-list.cash-list.2w20g2')}}</text>
|
||||
<text class="fw-b warp">{{ item.platform_name }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title title">{{$t('cash-list.cash-list.23ii8s')}}</text>
|
||||
<text class="fw-b warp">{{ item.network_name }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title title">{{$t('cash-list.cash-list.714g2h')}}</text>
|
||||
<text class="fw-b warp">{{ item.address }}</text>
|
||||
</view>
|
||||
<view class="flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('cash-list.cash-list.1o8838')}}</text>
|
||||
<text class="fw-b warp">{{ item.coin }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<div v-if="item.status == 0" class="br-t-dashed padding-top-main margin-top-main flex-row jc-e align-c">
|
||||
<button type="default" class="recharge-del-btn round margin-0" :data-id="item.id" @tap="cash_del_event">{{$t('common.del')}}</button>
|
||||
</div>
|
||||
</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>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<!-- 账户 -->
|
||||
<component-popup :propShow="popup_accounts_status" propPosition="top" :propTop="popup_top_height + 'px'" @onclose="popup_accounts_close_event">
|
||||
<view class="padding-vertical-lg">
|
||||
<view class="padding-horizontal-main text-size-xs">{{$t('cash-list.cash-list.s7l616')}}</view>
|
||||
<view class="popup_accounts_container padding-sm flex-row flex-wrap align-c tc text-size-md">
|
||||
<view class="flex-width-half-half">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="accounts_list_index == null ? 'cr-main bg-main-light' : ''" :data-name="$t('common.all')" :data-value="null" :data-index="null" @tap="accounts_list_event">{{$t('common.all')}}</view>
|
||||
</view>
|
||||
<view v-for="(item, index) in accounts_list" class="flex-width-half-half" :key="index">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="accounts_list_index == index ? 'cr-main bg-main-light' : ''" :data-name="item.platform_name" :data-value="item.id" :data-index="index" @tap="accounts_list_event">{{ item.platform_name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tc padding-top-lg br-t" @tap="popup_accounts_close_event">
|
||||
<text class="padding-right-sm">{{ $t('nav-more.nav-more.h9g4b1') }}</text>
|
||||
<iconfont name="icon-arrow-top" color="#ccc"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
<!-- 类型 -->
|
||||
<component-popup :propShow="popup_recharge_status_status" propPosition="top" :propTop="popup_top_height + 'px'" @onclose="popup_recharge_status_close_event">
|
||||
<view class="padding-vertical-lg">
|
||||
<view class="padding-horizontal-main text-size-xs">{{$t('cash-list.cash-list.t66tu3')}}</view>
|
||||
<view class="popup_accounts_container padding-sm flex-row flex-wrap align-c tc text-size-md">
|
||||
<view class="flex-width-half-half">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="recharge_status_list_index == null ? 'cr-main bg-main-light' : ''" :data-name="$t('common.all')" :data-value="null" :data-index="null" @tap="recharge_status_list_event">{{$t('common.all')}}</view>
|
||||
</view>
|
||||
<view v-for="(item, index) in recharge_status_list" class="flex-width-half-half" :key="index">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="recharge_status_list_index == index ? 'cr-main bg-main-light' : ''" :data-name="item.name" :data-value="item.value" :data-index="index" @tap="recharge_status_list_event">{{ item.name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tc padding-top-lg br-t" @tap="popup_recharge_status_close_event">
|
||||
<text class="padding-right-sm">{{ $t('nav-more.nav-more.h9g4b1') }}</text>
|
||||
<iconfont name="icon-arrow-top" color="#ccc"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
<!-- 网络 -->
|
||||
<component-popup :propShow="popup_network_status" propPosition="top" :propTop="popup_top_height + 'px'" @onclose="popup_network_close_event">
|
||||
<view class="padding-vertical-lg">
|
||||
<view class="padding-horizontal-main text-size-xs">{{$t('cash-list.cash-list.311tt2')}}</view>
|
||||
<view class="popup_accounts_container padding-sm flex-row flex-wrap align-c tc text-size-md">
|
||||
<view class="flex-width-half-half">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="network_list_index == null ? 'cr-main bg-main-light' : ''" :data-name="$t('common.all')" :data-value="null" :data-index="null" @tap="network_list_event">{{$t('common.all')}}</view>
|
||||
</view>
|
||||
<view v-for="(item, index) in network_list" class="flex-width-half-half" :key="index">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="network_list_index == index ? 'cr-main bg-main-light' : ''" :data-name="item.name" :data-value="item.id" :data-index="index" @tap="network_list_event">{{ item.name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tc padding-top-lg br-t" @tap="popup_network_close_event">
|
||||
<text class="padding-right-sm">{{ $t('nav-more.nav-more.h9g4b1') }}</text>
|
||||
<iconfont name="icon-arrow-top" color="#ccc"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
</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 componentPopup from '@/components/popup/popup';
|
||||
import componentBottomLine from '@/components/bottom-line/bottom-line';
|
||||
var wallet_static_url = app.globalData.get_static_url('coin', true) + 'app/';
|
||||
// 状态栏高度
|
||||
var bar_height = parseInt(app.globalData.get_system_info('statusBarHeight', 0, true));
|
||||
// #ifdef MP-TOUTIAO
|
||||
bar_height = 0;
|
||||
// #endif
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
wallet_static_url: wallet_static_url,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
data_bottom_line_status: false,
|
||||
params: {},
|
||||
|
||||
// 弹窗距离顶部距离
|
||||
popup_top_height: 0,
|
||||
|
||||
// 账户
|
||||
popup_accounts_status: false,
|
||||
accounts_id: null,
|
||||
accounts_list_index: null,
|
||||
accounts_name: null,
|
||||
accounts_list: [],
|
||||
// 类型
|
||||
popup_recharge_status_status: false,
|
||||
status: null,
|
||||
recharge_status_list_index: null,
|
||||
recharge_status_name: null,
|
||||
recharge_status_list: [],
|
||||
// 网络
|
||||
popup_network_status: false,
|
||||
network_id: null,
|
||||
network_list_index: null,
|
||||
network_name: null,
|
||||
network_list: [],
|
||||
|
||||
data_list: [],
|
||||
data_page_total: 0,
|
||||
data_page: 1,
|
||||
data_is_loading: 0,
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentPopup,
|
||||
componentBottomLine,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: params,
|
||||
accounts_id: params.id || null,
|
||||
});
|
||||
},
|
||||
|
||||
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.setData({
|
||||
data_page: 1,
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
methods: {
|
||||
init(e) {
|
||||
var user = app.globalData.get_user_info(this, 'init');
|
||||
if (user != false) {
|
||||
this.get_data();
|
||||
this.get_data_list();
|
||||
var self = this;
|
||||
var timer = setInterval(function () {
|
||||
if (self.popup_top_height == 0) {
|
||||
self.popup_top_height_computer();
|
||||
} else {
|
||||
clearInterval(timer);
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
},
|
||||
|
||||
// 初始化数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('init', 'user', 'coin'),
|
||||
method: 'POST',
|
||||
data: {},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
this.setData({
|
||||
accounts_list: data.accounts_list || [],
|
||||
recharge_status_list: data.recharge_status_list || [],
|
||||
network_list: data.network_list || [],
|
||||
});
|
||||
if (this.accounts_list.length > 0 && (this.accounts_id || null) != null) {
|
||||
var index = this.accounts_list.findIndex((item) => item.id == this.accounts_id);
|
||||
this.setData({
|
||||
accounts_list_index: index,
|
||||
accounts_id: this.accounts_list[index].id,
|
||||
accounts_name: this.accounts_list[index].platform_name,
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if (app.globalData.is_login_check(res.data, this, 'get_data_list')) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.stopPullDownRefresh();
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
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 new_data = {
|
||||
accounts_id: this.accounts_id,
|
||||
network_id: this.network_id,
|
||||
status: this.status,
|
||||
page: this.data_page,
|
||||
};
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('index', 'cash', 'coin'),
|
||||
method: 'POST',
|
||||
data: new_data,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
if (this.data_page > 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
// 数据列表
|
||||
var data = res.data.data;
|
||||
if (this.data_page <= 1) {
|
||||
var temp_data_list = data.data_list || [];
|
||||
} else {
|
||||
var temp_data_list = this.data_list || [];
|
||||
var temp_data = data.data_list;
|
||||
for (var i in temp_data) {
|
||||
temp_data_list.push(temp_data[i]);
|
||||
}
|
||||
}
|
||||
|
||||
this.setData({
|
||||
data_list: temp_data_list,
|
||||
data_total: data.total,
|
||||
data_page_total: data.page_total,
|
||||
data_list_loding_status: temp_data_list.length > 0 ? 3 : 0,
|
||||
data_list_loding_msg: '',
|
||||
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: 2,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
if (this.data_page > 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_is_loading: 0,
|
||||
data_list_loding_msg: this.$t('common.internet_error_tips'),
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 账户打开
|
||||
popup_accounts_open_event() {
|
||||
this.setData({
|
||||
popup_accounts_status: !this.popup_accounts_status,
|
||||
popup_recharge_status_status: false,
|
||||
popup_network_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 账户关闭
|
||||
popup_accounts_close_event() {
|
||||
this.setData({
|
||||
popup_accounts_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 账户选择
|
||||
accounts_list_event(e) {
|
||||
this.setData({
|
||||
accounts_list_index: e.currentTarget.dataset.index,
|
||||
accounts_id: e.currentTarget.dataset.value,
|
||||
accounts_name: e.currentTarget.dataset.name,
|
||||
popup_accounts_status: false,
|
||||
data_page: 1,
|
||||
data_list: [],
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// 类型打开
|
||||
popup_recharge_status_open_event() {
|
||||
this.setData({
|
||||
popup_recharge_status_status: !this.popup_recharge_status_status,
|
||||
popup_accounts_status: false,
|
||||
popup_network_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 类型关闭
|
||||
popup_recharge_status_close_event() {
|
||||
this.setData({
|
||||
popup_recharge_status_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 类型选择
|
||||
recharge_status_list_event(e) {
|
||||
this.setData({
|
||||
recharge_status_list_index: e.currentTarget.dataset.index,
|
||||
status: e.currentTarget.dataset.value,
|
||||
recharge_status_name: e.currentTarget.dataset.name,
|
||||
popup_recharge_status_status: false,
|
||||
data_page: 1,
|
||||
data_list: [],
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// 网络打开
|
||||
popup_network_open_event() {
|
||||
this.setData({
|
||||
popup_network_status: !this.popup_network_status,
|
||||
popup_accounts_status: false,
|
||||
popup_recharge_status_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 网络关闭
|
||||
popup_network_close_event() {
|
||||
this.setData({
|
||||
popup_network_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 网络选择
|
||||
network_list_event(e) {
|
||||
this.setData({
|
||||
network_list_index: e.currentTarget.dataset.index,
|
||||
network_id: e.currentTarget.dataset.value,
|
||||
network_name: e.currentTarget.dataset.name,
|
||||
popup_network_status: false,
|
||||
data_page: 1,
|
||||
data_list: [],
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// 删除支付
|
||||
cash_del_event(e) {
|
||||
// 是否再次确认
|
||||
if (e.alert_status != 0 && e.alert_status != 1) {
|
||||
app.globalData.alert({
|
||||
msg: this.$t('cash-list.cash-list.8hrc73'),
|
||||
is_show_cancel: 1,
|
||||
object: this,
|
||||
params: { id: e.currentTarget.dataset.id },
|
||||
method: 'cash_del_event',
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (e.alert_status == 1) {
|
||||
// 加载loding
|
||||
uni.showLoading({
|
||||
title: this.$t('common.loading_in_text'),
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('delete', 'cash', 'coin'),
|
||||
method: 'POST',
|
||||
data: { ids: e.id },
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
this.setData({
|
||||
data_page: 1,
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.del_success'), 'success');
|
||||
this.get_data_list(1);
|
||||
} else {
|
||||
if (app.globalData.is_login_check(res.data)) {
|
||||
app.globalData.showToast(this.$t('common.del_fail'));
|
||||
} else {
|
||||
app.globalData.showToast(this.$t('common.sub_error_retry_tips'));
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 计算搜索框的高度
|
||||
popup_top_height_computer() {
|
||||
const query = uni.createSelectorQuery();
|
||||
query
|
||||
.select('.nav')
|
||||
.boundingClientRect((res) => {
|
||||
if ((res || null) != null) {
|
||||
// 获取搜索框高度
|
||||
this.setData({
|
||||
popup_top_height: res.height,
|
||||
});
|
||||
}
|
||||
})
|
||||
.exec();
|
||||
},
|
||||
|
||||
// 页面滚动监听
|
||||
scroll_event(e) {
|
||||
uni.$emit('onPageScroll', e.detail);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './cash-list.css';
|
||||
</style>
|
||||
118
pages/plugins/coin/cash/cash.css
Normal file
118
pages/plugins/coin/cash/cash.css
Normal file
@@ -0,0 +1,118 @@
|
||||
/*
|
||||
* 顶部
|
||||
*/
|
||||
.cash .title {
|
||||
background: radial-gradient(60% 70% at 90% 79%, rgba(33, 125, 239, 0.85) 0%, #A6C8F3 100%);
|
||||
padding-top: 130rpx;
|
||||
/* #ifndef H5 */
|
||||
padding-top: calc(var(--status-bar-height) + 5px + 130rpx);
|
||||
/* #endif */
|
||||
padding-bottom: 180rpx;
|
||||
}
|
||||
|
||||
.coin-dropdown {
|
||||
--height: 48rpx;
|
||||
height: var(--height);
|
||||
line-height: var(--height);
|
||||
padding: 0 64rpx 0 32rpx;
|
||||
background: rgba(255, 255, 255, 0.23);
|
||||
border-radius: 12px;
|
||||
}
|
||||
|
||||
.coin-dropdown-icon {
|
||||
right: 36rpx;
|
||||
top: 2rpx;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.cash .detail {
|
||||
--height: 64rpx;
|
||||
height: var(--height);
|
||||
line-height: var(--height);
|
||||
background: rgba(255, 255, 255, 0.34);
|
||||
border-radius: 200rpx 0 0 200rpx;
|
||||
padding: 0 32rpx;
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
|
||||
.cash .text {
|
||||
color: #EBF3FF;
|
||||
}
|
||||
|
||||
/*
|
||||
* 内容
|
||||
*/
|
||||
.cash .content {
|
||||
margin-top: -200rpx;
|
||||
border-radius: 32rpx 32rpx 0 0;
|
||||
min-height: calc(100vh - 528rpx);
|
||||
/* #ifndef H5 */
|
||||
min-height: calc(100vh - 528rpx - var(--status-bar-height) - 5px);
|
||||
/* #endif */
|
||||
}
|
||||
.cash .recharge-content-input-bg,
|
||||
.cash .content-input-bg {
|
||||
background-color: #fafafc;
|
||||
}
|
||||
|
||||
.cash .price-item {
|
||||
--size: -10rpx;
|
||||
margin-left: var(--size);
|
||||
margin-right: var(--size);
|
||||
width: calc(100% - var(--size));
|
||||
}
|
||||
|
||||
.cash .price-list {
|
||||
background: #F5F7F9;
|
||||
border: 2rpx solid #F5F7F9;
|
||||
border-radius: 16rpx;
|
||||
padding: 20rpx 0;
|
||||
margin: 18rpx 10rpx;
|
||||
width: calc((100% / 3) - 24rpx);
|
||||
}
|
||||
|
||||
.cash .price-img {
|
||||
--size: 36rpx;
|
||||
width: var(--size);
|
||||
height: var(--size) !important;
|
||||
}
|
||||
|
||||
.cash-btn {
|
||||
background: linear-gradient(107deg, #31B4FC 0%, #0842E2 100%);
|
||||
transition: all 0.3s ease-in-out;
|
||||
}
|
||||
|
||||
.cash-btn:active {
|
||||
background: linear-gradient(107deg, #168ACA 0%, #022A97 100%);
|
||||
}
|
||||
|
||||
.cash .content-tips .item::before {
|
||||
content: '';
|
||||
width: 12rpx;
|
||||
height: 12rpx;
|
||||
border-radius: 12rpx;
|
||||
background: #30B3FC;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 12rpx;
|
||||
}
|
||||
|
||||
.coin-content-list-img {
|
||||
--size: 28rpx;
|
||||
width: var(--size);
|
||||
height: var(--size) !important;
|
||||
}
|
||||
|
||||
/*
|
||||
* 虚拟币弹窗
|
||||
*/
|
||||
.popup_coin_status_container .scroll-y {
|
||||
height: 40vh;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.coin-list-img {
|
||||
--size: 40rpx;
|
||||
width: var(--size);
|
||||
height: var(--size) !important;
|
||||
}
|
||||
362
pages/plugins/coin/cash/cash.vue
Normal file
362
pages/plugins/coin/cash/cash.vue
Normal file
@@ -0,0 +1,362 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<component-nav-back></component-nav-back>
|
||||
<block v-if="accounts_list.length > 0">
|
||||
<view class="cash">
|
||||
<scroll-view :scroll-y="true" class="scroll-box" lower-threshold="60" @scroll="scroll_event">
|
||||
<view class="title flex-col padding-lg">
|
||||
<view class="margin-bottom-xxxl flex-row jc-sb margin-top-xl">
|
||||
<view v-if="(accounts || mull) != null" class="cr-white">
|
||||
<view class="flex-row align-e margin-bottom-main">
|
||||
<view class="flex-row align-c pr coin-dropdown" @tap="popup_coin_status_open_event">
|
||||
<image v-if="(accounts.platform_icon || null) != null" :src="accounts.platform_icon" mode="widthFix" class="coin-content-list-img round" />
|
||||
<text class="margin-left-xs">{{ accounts.platform_name }}</text>
|
||||
<view class="coin-dropdown-icon pa padding-left-xxl">
|
||||
<iconfont name="icon-arrow-bottom" size="24rpx" color="#fff"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
<view class="text-size-xs fw-b padding-left-main text">{{$t('cash.cash.zmhf3n')}}</view>
|
||||
</view>
|
||||
<view class="flex-row align-e">
|
||||
<view class="text-size-40 fw-b">{{ accounts.normal_coin }}</view>
|
||||
<view class="padding-left-sm margin-bottom-main cr-grey-d">{{ accounts.default_symbol }} {{ accounts.default_coin }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="detail pa right-0 fw-b cr-white" :data-value="'/pages/plugins/coin/cash-list/cash-list?id='+accounts.id" @tap="url_event">{{$t('pages.plugins-coin-cash-list')}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="content padding-main">
|
||||
<view class="padding-xxxl bg-white radius-md margin-bottom-main">
|
||||
<view class="margin-bottom-xxxl">
|
||||
<view class="margin-bottom-main fw-b">{{$t('cash.cash.f6p4hm')}}</view>
|
||||
<view class="padding-vertical-main br-b-e flex-row align-c">
|
||||
<input type="digit" :value="coin_num" class="flex-1 flex-width" placeholder-class="text-size-md cr-grey-9" :placeholder="$t('common.please_input')" @input="coin_num_change" />
|
||||
<view @tap.stop="all_cash_event">{{$t('cash.cash.6oc6e7')}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="margin-bottom-xxxl">
|
||||
<view class="margin-bottom-main">{{$t('cash.cash.ucg8e2')}}</view>
|
||||
<view class="recharge-content-input-bg padding-main border-radius-sm flex-row align-c">
|
||||
<input type="text" name="coin_address" class="padding-right-sm flex-1 flex-width" :value="coin_address" placeholder-class="text-size-md cr-grey-9" :placeholder="$t('cash.cash.i1f373')" @input="coin_address_change" />
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<view class="margin-bottom-main">{{$t('cash.cash.h9i16y')}}</view>
|
||||
<block v-if="network_list.length > 0">
|
||||
<picker class="content-input-bg padding-main margin-bottom-main border-radius-sm" @change="cash_event" :value="network_list_index" :range="network_list" range-key="name">
|
||||
<view class="picker arrow-bottom">
|
||||
{{ network_list[network_list_index]['name'] }}
|
||||
</view>
|
||||
</picker>
|
||||
</block>
|
||||
<view v-else class="cr-grey margin-bottom">{{$t('cash.cash.1g49wo')}}</view>
|
||||
<view class="content-input-bg padding-main border-radius-sm">
|
||||
<input type="text" name="user_note" :value="user_note" placeholder-class="text-size-md cr-grey-9" :placeholder="$t('cash.cash.g05p4g')" @input="user_note_change" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="padding-main bg-white radius-md">
|
||||
<view class="padding-vertical-sm border-radius-sm flex-row align-c">
|
||||
<text class="text-size fw-b">支付密码</text>
|
||||
<view class="padding-left-lg">
|
||||
<input type="digit" name="coin" :value="pay_pwd" placeholder-class="text-size-md cr-grey-9" placeholder="请输入支付密码" />
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="padding-xxxl">
|
||||
<button type="default" class="cash-btn cr-white round" @tap="apply_for_cash_event">{{$t('cash.cash.42b37m')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<!-- 虚拟币下拉框 -->
|
||||
<component-popup :propShow="popup_coin_status" propPosition="bottom" @onclose="popup_coin_status_close_event">
|
||||
<view class="padding-horizontal-main padding-top-main bg-white">
|
||||
<view class="oh">
|
||||
<view class="fr" @tap.stop="popup_coin_status_close_event">
|
||||
<iconfont name="icon-close-o" size="28rpx" color="#999"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
<view class="popup_coin_status_container padding-vertical-main flex-col text-size">
|
||||
<view class="scroll-y">
|
||||
<view v-for="(item, index) in accounts_list" :key="index">
|
||||
<view class="flex-row jc-sb align-c padding-vertical-main" :class="accounts_list.length == index + 1 ? '' : 'br-b-f9'" :data-value="item.id" :data-index="index" @tap="coin_checked_event">
|
||||
<view class="flex-row align-c">
|
||||
<image v-if="platform_icon" :src="item.platform_icon" mode="widthFix" class="coin-list-img round" />
|
||||
<view class="margin-left-sm text-size-md single-text">{{ item.platform_name }}</view>
|
||||
</view>
|
||||
<view>
|
||||
<iconfont :name="accounts.id == item.id ? 'icon-zhifu-yixuan cr-red' : 'icon-zhifu-weixuan'" size="40rpx"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
</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 componentNavBack from '@/components/nav-back/nav-back';
|
||||
import componentNoData from '@/components/no-data/no-data';
|
||||
import componentPopup from '@/components/popup/popup';
|
||||
var wallet_static_url = app.globalData.get_static_url('coin', true) + 'app/';
|
||||
// 状态栏高度
|
||||
var bar_height = parseInt(app.globalData.get_system_info('statusBarHeight', 0, true));
|
||||
// #ifdef MP-TOUTIAO
|
||||
bar_height = 0;
|
||||
// #endif
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
wallet_static_url: wallet_static_url,
|
||||
status_bar_height: bar_height,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
params: {},
|
||||
|
||||
// 虚拟币
|
||||
coin_num: '',
|
||||
|
||||
// 账户
|
||||
accounts: {},
|
||||
|
||||
// 虚拟币下拉框探弹窗状态
|
||||
popup_coin_status: false,
|
||||
// 虚拟币下拉框list
|
||||
accounts_list: [],
|
||||
// 充币网络
|
||||
network_list_index: 0,
|
||||
network_list: [],
|
||||
// 提币地址
|
||||
coin_address: '',
|
||||
// 备注
|
||||
user_note: '',
|
||||
// 支付密码
|
||||
pay_pwd: '',
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNavBack,
|
||||
componentNoData,
|
||||
componentPopup,
|
||||
},
|
||||
|
||||
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.get_data();
|
||||
},
|
||||
methods: {
|
||||
init(e) {
|
||||
var user = app.globalData.get_user_info(this, 'init');
|
||||
if (user != false) {
|
||||
this.get_data();
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('createinfo', 'cash', 'coin'),
|
||||
method: 'POST',
|
||||
data: {accounts_id : this.accounts.id || this.params.id || null},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
this.setData({
|
||||
accounts: data.accounts || {},
|
||||
accounts_list: data.accounts_list || [],
|
||||
network_list: data.network_list || [],
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: 3,
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
app.globalData.is_login_check(res.data, this, 'get_data');
|
||||
}
|
||||
},
|
||||
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'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 显示隐藏虚拟币
|
||||
price_change() {
|
||||
this.setData({});
|
||||
},
|
||||
|
||||
// 虚拟币切换
|
||||
coin_checked_event(e) {
|
||||
this.setData({
|
||||
accounts: this.accounts_list[e.currentTarget.dataset.index],
|
||||
coin_num: '',
|
||||
popup_coin_status: false,
|
||||
});
|
||||
this.get_data();
|
||||
},
|
||||
popup_coin_status_open_event() {
|
||||
this.setData({
|
||||
popup_coin_status: !this.popup_coin_status,
|
||||
});
|
||||
},
|
||||
popup_coin_status_close_event() {
|
||||
this.setData({
|
||||
popup_coin_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 充币网络切换
|
||||
cash_event(e) {
|
||||
this.setData({
|
||||
network_list_index: parseInt(e.detail.value || 0),
|
||||
});
|
||||
},
|
||||
|
||||
// 全部提现
|
||||
all_cash_event(e) {
|
||||
this.setData({
|
||||
coin_num: this.accounts.normal_coin || '',
|
||||
});
|
||||
},
|
||||
|
||||
// 提币地址
|
||||
coin_address_change(e) {
|
||||
this.setData({
|
||||
coin_address: e.detail.value,
|
||||
});
|
||||
},
|
||||
|
||||
// 提现数量
|
||||
coin_num_change(e) {
|
||||
this.setData({
|
||||
coin_num: e.detail.value,
|
||||
});
|
||||
},
|
||||
|
||||
// 备注
|
||||
user_note_change(e) {
|
||||
this.setData({
|
||||
user_note: e.detail.value,
|
||||
});
|
||||
},
|
||||
|
||||
// 申请提现
|
||||
apply_for_cash_event() {
|
||||
if(this.network_list.length == 0) {
|
||||
app.globalData.showToast(this.$t('cash.cash.en6vsa'));
|
||||
return false;
|
||||
}
|
||||
|
||||
// 表单数据
|
||||
var new_data = {
|
||||
accounts_id: this.accounts.id,
|
||||
network_id: this.network_list[this.network_list_index].id,
|
||||
address: this.coin_address,
|
||||
coin: this.coin_num,
|
||||
user_note: this.user_note,
|
||||
};
|
||||
// 数据校验
|
||||
var validation = [
|
||||
{ fields: 'coin', msg: this.$t('cash.cash.w01qjc') },
|
||||
{ fields: 'address', msg: this.$t('cash.cash.i1f373') },
|
||||
];
|
||||
// 验证提交表单
|
||||
if (app.globalData.fields_check(new_data, validation)) {
|
||||
uni.showLoading({
|
||||
title: this.$t('common.processing_in_text'),
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('create', 'cash', 'coin'),
|
||||
method: 'POST',
|
||||
data: new_data,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
app.globalData.showToast(res.data.msg, 'success');
|
||||
setTimeout(function () {
|
||||
app.globalData.url_open('/pages/plugins/coin/cash-list/cash-list', true);
|
||||
}, 1000);
|
||||
} 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.stopPullDownRefresh();
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 页面滚动监听
|
||||
scroll_event(e) {
|
||||
uni.$emit('onPageScroll', e.detail);
|
||||
},
|
||||
|
||||
// 复制文本
|
||||
text_copy_event(e) {
|
||||
app.globalData.text_copy_event(e);
|
||||
},
|
||||
|
||||
// url事件
|
||||
url_event(e) {
|
||||
app.globalData.url_event(e);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './cash.css';
|
||||
</style>
|
||||
19
pages/plugins/coin/collection/collection.css
Normal file
19
pages/plugins/coin/collection/collection.css
Normal file
@@ -0,0 +1,19 @@
|
||||
.collection .qrcode {
|
||||
margin-bottom: 80rpx;
|
||||
margin-top: 52rpx;
|
||||
}
|
||||
|
||||
.collection .code {
|
||||
margin-bottom: 52rpx;
|
||||
}
|
||||
|
||||
.collection .code .num {
|
||||
padding: 20rpx 28rpx;
|
||||
word-break: break-all;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.collection .code .copy {
|
||||
padding: 40rpx;
|
||||
color: #635BFF;
|
||||
}
|
||||
87
pages/plugins/coin/collection/collection.vue
Normal file
87
pages/plugins/coin/collection/collection.vue
Normal file
@@ -0,0 +1,87 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view class="collection">
|
||||
<view class="padding-main pr">
|
||||
<block v-if="(params.accounts_key || null) != null">
|
||||
<view class="padding-lg bg-white radius-md margin-bottom-main tc">
|
||||
<view class="flex-row jc-c qrcode">
|
||||
<w-qrcode :options="qrcode"></w-qrcode>
|
||||
</view>
|
||||
<view class="code br-c radius flex-row">
|
||||
<view class="num flex-1 flex-width flex-row align-c text-size-md">{{ params.accounts_key }}</view>
|
||||
<view class="copy br-l-c text-size fw-b" :data-value="params.accounts_key" @tap.stop="text_copy_event">{{$t('collection.collection.856g12')}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cr-grey-9 margin-top-xxl flex-row">
|
||||
<view class="pr">
|
||||
<iconfont name="icon-sigh-o" size="32rpx"></iconfont>
|
||||
</view>
|
||||
<text class="margin-left-sm text-size-xs">{{$t('collection.collection.9p43lu')}}</text>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data propStatus="0"></component-no-data>
|
||||
</block>
|
||||
</view>
|
||||
</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';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
params: {},
|
||||
qrcode: {},
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: params,
|
||||
qrcode: {
|
||||
code: params.accounts_key || null,
|
||||
size: 280,
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle();
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 复制文本
|
||||
text_copy_event(e) {
|
||||
app.globalData.text_copy_event(e);
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './collection.css';
|
||||
</style>
|
||||
18
pages/plugins/coin/convert-list/convert-list.css
Normal file
18
pages/plugins/coin/convert-list/convert-list.css
Normal file
@@ -0,0 +1,18 @@
|
||||
.convert .nav {
|
||||
z-index: 102;
|
||||
}
|
||||
.scroll-box {
|
||||
height: calc(100vh - 88rpx);
|
||||
}
|
||||
|
||||
.convert-group-row .title {
|
||||
min-width: 140rpx;
|
||||
}
|
||||
|
||||
/*
|
||||
* 钱包弹窗
|
||||
*/
|
||||
.popup_accounts_container .item {
|
||||
background-color: #f4f4f4;
|
||||
border-radius: 30rpx;
|
||||
}
|
||||
408
pages/plugins/coin/convert-list/convert-list.vue
Normal file
408
pages/plugins/coin/convert-list/convert-list.vue
Normal file
@@ -0,0 +1,408 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view class="convert">
|
||||
<view class="padding-main bg-white pr nav flex-row oa">
|
||||
<view class="flex-shrink flex-row align-c margin-right-xxxl padding-right-xl pr" @tap="popup_send_accounts_open_event">
|
||||
<view>{{ send_accounts_name !== null && send_accounts_name !== $t('common.all') ? send_accounts_name : $t('convert-list.convert-list.q48666') }}</view>
|
||||
<view class="pa right-0"><iconfont :name="popup_send_accounts_status ? 'icon-arrow-top' : 'icon-arrow-bottom'" size="24rpx"></iconfont></view>
|
||||
</view>
|
||||
<view class="flex-shrink flex-row align-c padding-right-xl pr" @tap="popup_receive_accounts_open_event">
|
||||
<view>{{ receive_accounts_name !== null && receive_accounts_name !== $t('common.all') ? receive_accounts_name : $t('convert-list.convert-list.47646p') }}</view>
|
||||
<view class="pa right-0"><iconfont :name="popup_receive_accounts_status ? 'icon-arrow-top' : 'icon-arrow-bottom'" size="24rpx"></iconfont></view>
|
||||
</view>
|
||||
</view>
|
||||
<scroll-view :scroll-y="true" class="scroll-box" lower-threshold="60" @scroll="scroll_event">
|
||||
<view class="padding-main">
|
||||
<view v-if="data_list.length > 0">
|
||||
<view v-for="(item, index) in data_list" :key="index" class="padding-main bg-white radius-md margin-bottom-main">
|
||||
<view class="br-b-dashed padding-bottom-main margin-bottom-main flex-row jc-e align-c">
|
||||
<view class="cr-grey-9">{{ item.add_time }}</view>
|
||||
</view>
|
||||
<view class="convert-group-row">
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('convert-list.convert-list.8813rd')}}</text>
|
||||
<text class="fw-b warp">{{ item.convert_no }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('convert-list.convert-list.c374ec')}}</text>
|
||||
<text class="fw-b warp">{{ item.convert_value }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('convert-list.convert-list.6mxu85')}}</text>
|
||||
<text class="fw-b warp">{{ item.send_accounts_id }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('convert-list.convert-list.733518')}}</text>
|
||||
<text class="fw-b warp">{{ item.receive_accounts_id }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('convert-list.convert-list.6347mw')}}</text>
|
||||
<text class="fw-b warp">{{ item.coin }}</text>
|
||||
</view>
|
||||
<view class="flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('convert-list.convert-list.9oy325')}}</text>
|
||||
<text class="fw-b warp">{{ item.note }}</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>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<!-- 发起账户 -->
|
||||
<component-popup :propShow="popup_send_accounts_status" propPosition="top" :propTop="popup_top_height + 'px'" @onclose="popup_send_accounts_close_event">
|
||||
<view class="padding-vertical-lg">
|
||||
<view class="padding-horizontal-main text-size-xs">{{$t('convert-list.convert-list.q48666')}}</view>
|
||||
<view class="popup_accounts_container padding-sm flex-row flex-wrap align-c tc text-size-md">
|
||||
<view class="flex-width-half-half">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="send_accounts_list_index == null ? 'cr-main bg-main-light' : ''" :data-name="$t('common.all')" :data-value="null" :data-index="null" @tap="send_accounts_list_event">{{$t('common.all')}}</view>
|
||||
</view>
|
||||
<view v-for="(item, index) in send_accounts_list" class="flex-width-half-half" :key="index">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="send_accounts_list_index == index ? 'cr-main bg-main-light' : ''" :data-name="item.platform_name" :data-value="item.id" :data-index="index" @tap="send_accounts_list_event">{{ item.platform_name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tc padding-top-lg br-t" @tap="popup_send_accounts_close_event">
|
||||
<text class="padding-right-sm">{{ $t('nav-more.nav-more.h9g4b1') }}</text>
|
||||
<iconfont name="icon-arrow-top" color="#ccc"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
<!-- 接收账户 -->
|
||||
<component-popup :propShow="popup_receive_accounts_status" propPosition="top" :propTop="popup_top_height + 'px'" @onclose="popup_receive_accounts_close_event">
|
||||
<view class="padding-vertical-lg">
|
||||
<view class="padding-horizontal-main text-size-xs">{{$t('convert-list.convert-list.47646p')}}</view>
|
||||
<view class="popup_accounts_container padding-sm flex-row flex-wrap align-c tc text-size-md">
|
||||
<view class="flex-width-half-half">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="receive_accounts_list_index == null ? 'cr-main bg-main-light' : ''" :data-name="$t('common.all')" :data-value="null" :data-index="null" @tap="receive_accounts_list_event">{{$t('common.all')}}</view>
|
||||
</view>
|
||||
<view v-for="(item, index) in receive_accounts_list" class="flex-width-half-half" :key="index">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="receive_accounts_list_index == index ? 'cr-main bg-main-light' : ''" :data-name="item.platform_name" :data-value="item.id" :data-index="index" @tap="receive_accounts_list_event">{{ item.platform_name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tc padding-top-lg br-t" @tap="popup_receive_accounts_close_event">
|
||||
<text class="padding-right-sm">{{ $t('nav-more.nav-more.h9g4b1') }}</text>
|
||||
<iconfont name="icon-arrow-top" color="#ccc"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
</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 componentPopup from '@/components/popup/popup';
|
||||
import componentBottomLine from '@/components/bottom-line/bottom-line';
|
||||
var accounts_static_url = app.globalData.get_static_url('coin', true) + 'app/';
|
||||
// 状态栏高度
|
||||
var bar_height = parseInt(app.globalData.get_system_info('statusBarHeight', 0, true));
|
||||
// #ifdef MP-TOUTIAO
|
||||
bar_height = 0;
|
||||
// #endif
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
accounts_static_url: accounts_static_url,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
data_bottom_line_status: false,
|
||||
params: {},
|
||||
|
||||
// 弹窗距离顶部距离
|
||||
popup_top_height: 0,
|
||||
|
||||
// 发起账户
|
||||
popup_send_accounts_status: false,
|
||||
send_accounts_id: null,
|
||||
send_accounts_list_index: null,
|
||||
send_accounts_name: null,
|
||||
send_accounts_list: [],
|
||||
// 接收账户
|
||||
popup_receive_accounts_status: false,
|
||||
receive_accounts_id: null,
|
||||
receive_accounts_list_index: null,
|
||||
receive_accounts_name: null,
|
||||
receive_accounts_list: [],
|
||||
|
||||
data_list: [],
|
||||
data_page_total: 0,
|
||||
data_page: 1,
|
||||
data_is_loading: 0,
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentPopup,
|
||||
componentBottomLine,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: params,
|
||||
send_accounts_id: params.id || null,
|
||||
});
|
||||
},
|
||||
|
||||
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.setData({
|
||||
data_page: 1,
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
methods: {
|
||||
init(e) {
|
||||
var user = app.globalData.get_user_info(this, 'init');
|
||||
if (user != false) {
|
||||
this.get_data();
|
||||
this.get_data_list();
|
||||
var self = this;
|
||||
var timer = setInterval(function () {
|
||||
if (self.popup_top_height == 0) {
|
||||
self.popup_top_height_computer();
|
||||
} else {
|
||||
clearInterval(timer);
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
},
|
||||
|
||||
// 初始化数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('init', 'user', 'coin'),
|
||||
method: 'POST',
|
||||
data: {},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
this.setData({
|
||||
send_accounts_list: data.accounts_list || [],
|
||||
receive_accounts_list: data.accounts_list || [],
|
||||
});
|
||||
if (this.send_accounts_list.length > 0 && (this.send_accounts_id || null) != null) {
|
||||
var index = this.send_accounts_list.findIndex((item) => item.id == this.send_accounts_id);
|
||||
this.setData({
|
||||
send_accounts_list_index: index,
|
||||
send_accounts_id: this.send_accounts_list[index].id,
|
||||
send_accounts_name: this.send_accounts_list[index].platform_name,
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if (app.globalData.is_login_check(res.data, this, 'get_data_list')) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.stopPullDownRefresh();
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
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 new_data = {
|
||||
send_accounts_id: this.send_accounts_id,
|
||||
receive_accounts_id: this.receive_accounts_id,
|
||||
page: this.data_page,
|
||||
};
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('index', 'convert', 'coin'),
|
||||
method: 'POST',
|
||||
data: new_data,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
if (this.data_page > 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
// 数据列表
|
||||
var data = res.data.data;
|
||||
if (this.data_page <= 1) {
|
||||
var temp_data_list = data.data_list || [];
|
||||
} else {
|
||||
var temp_data_list = this.data_list || [];
|
||||
var temp_data = data.data_list;
|
||||
for (var i in temp_data) {
|
||||
temp_data_list.push(temp_data[i]);
|
||||
}
|
||||
}
|
||||
|
||||
this.setData({
|
||||
data_list: temp_data_list,
|
||||
data_total: data.total,
|
||||
data_page_total: data.page_total,
|
||||
data_list_loding_status: temp_data_list.length > 0 ? 3 : 0,
|
||||
data_list_loding_msg: '',
|
||||
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: 2,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
if (this.data_page > 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_is_loading: 0,
|
||||
data_list_loding_msg: this.$t('common.internet_error_tips'),
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 账户打开
|
||||
popup_send_accounts_open_event() {
|
||||
this.setData({
|
||||
popup_send_accounts_status: !this.popup_send_accounts_status,
|
||||
popup_receive_accounts_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 账户关闭
|
||||
popup_send_accounts_close_event() {
|
||||
this.setData({
|
||||
popup_send_accounts_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 账户选择
|
||||
send_accounts_list_event(e) {
|
||||
this.setData({
|
||||
send_accounts_list_index: e.currentTarget.dataset.index,
|
||||
send_accounts_id: e.currentTarget.dataset.value,
|
||||
send_accounts_name: e.currentTarget.dataset.name,
|
||||
popup_send_accounts_status: false,
|
||||
data_page: 1,
|
||||
data_list: [],
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// 账户打开
|
||||
popup_receive_accounts_open_event() {
|
||||
this.setData({
|
||||
popup_receive_accounts_status: !this.popup_receive_accounts_status,
|
||||
popup_send_accounts_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 账户关闭
|
||||
popup_receive_accounts_close_event() {
|
||||
this.setData({
|
||||
popup_receive_accounts_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 账户选择
|
||||
receive_accounts_list_event(e) {
|
||||
this.setData({
|
||||
receive_accounts_list_index: e.currentTarget.dataset.index,
|
||||
receive_accounts_id: e.currentTarget.dataset.value,
|
||||
receive_accounts_name: e.currentTarget.dataset.name,
|
||||
popup_receive_accounts_status: false,
|
||||
data_page: 1,
|
||||
data_list: [],
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// 计算搜索框的高度
|
||||
popup_top_height_computer() {
|
||||
const query = uni.createSelectorQuery();
|
||||
query
|
||||
.select('.nav')
|
||||
.boundingClientRect((res) => {
|
||||
if ((res || null) != null) {
|
||||
// 获取搜索框高度
|
||||
this.setData({
|
||||
popup_top_height: res.height,
|
||||
});
|
||||
}
|
||||
})
|
||||
.exec();
|
||||
},
|
||||
|
||||
// 页面滚动监听
|
||||
scroll_event(e) {
|
||||
uni.$emit('onPageScroll', e.detail);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './convert-list.css';
|
||||
</style>
|
||||
77
pages/plugins/coin/convert/convert.css
Normal file
77
pages/plugins/coin/convert/convert.css
Normal file
@@ -0,0 +1,77 @@
|
||||
.coin-dropdown {
|
||||
--height: 72rpx;
|
||||
height: var(--height);
|
||||
line-height: var(--height);
|
||||
padding: 0 52rpx 0 20rpx;
|
||||
background: #F6F6F6;
|
||||
border-radius: 36rpx;
|
||||
width: 180rpx;
|
||||
}
|
||||
|
||||
.coin-dropdown-icon {
|
||||
right: 24rpx;
|
||||
top: 2rpx;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.coin-list-img {
|
||||
--size: 40rpx;
|
||||
width: var(--size);
|
||||
height: var(--size) !important;
|
||||
}
|
||||
|
||||
.coin-num {
|
||||
--height: 72rpx;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.num.input-br {
|
||||
border: 2rpx solid #F6F6F6;
|
||||
}
|
||||
|
||||
.coin-num .num {
|
||||
height: var(--height);
|
||||
line-height: var(--height);
|
||||
padding: 0 20rpx 0 20rpx;
|
||||
border-radius: 36rpx;
|
||||
width: 196rpx;
|
||||
}
|
||||
|
||||
.coin-center-convert {
|
||||
--size: 82rpx;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
margin-top: -54rpx;
|
||||
width: var(--size);
|
||||
height: var(--size);
|
||||
border: 2rpx solid #e1e1e1;
|
||||
border-radius: 50%;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.convert-icon {
|
||||
transition: all 0.5s ease-in-out;
|
||||
}
|
||||
|
||||
.convert_true {
|
||||
transform: rotate3d(1, 0, 0, 180deg);
|
||||
}
|
||||
|
||||
.convert_false {
|
||||
transform: rotate3d(1, 0, 0, 0deg);
|
||||
}
|
||||
|
||||
.convert-btn {
|
||||
background: linear-gradient(107deg, #31B4FC 0%, #0842E2 100%);
|
||||
transition: all 0.3s ease-in-out;
|
||||
}
|
||||
|
||||
.convert-btn:active {
|
||||
background: linear-gradient(107deg, #168ACA 0%, #022A97 100%);
|
||||
}
|
||||
|
||||
.coin-content-list-img {
|
||||
--size: 36rpx;
|
||||
width: var(--size);
|
||||
height: var(--size) !important;
|
||||
}
|
||||
342
pages/plugins/coin/convert/convert.vue
Normal file
342
pages/plugins/coin/convert/convert.vue
Normal file
@@ -0,0 +1,342 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view v-if="accounts_list.length > 0">
|
||||
<scroll-view :scroll-y="true" class="scroll-box" lower-threshold="60" @scroll="scroll_event">
|
||||
<view class="padding-main pr">
|
||||
<view class="padding-lg bg-white radius-md margin-bottom-main">
|
||||
<view class="br-f5 margin-bottom-main radius-md padding-lg flex-row jc-sb">
|
||||
<view>
|
||||
<view class="flex-row align-c pr coin-dropdown" @tap="popup_coin_status_event(1)">
|
||||
<image v-if="accounts_list[send_accounts_id_index]['platform_icon']" :src="accounts_list[send_accounts_id_index]['platform_icon']" mode="widthFix" class="coin-content-list-img round" />
|
||||
<text class="margin-left-sm fw-b single-text">{{ accounts_list[send_accounts_id_index]['platform_name'] }}</text>
|
||||
<view class="coin-dropdown-icon pa padding-left-xxl">
|
||||
<iconfont name="icon-arrow-bottom" size="24rpx" color="#666"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
<view class="margin-top-main text-size-xs flex-row align-c">
|
||||
<text class="margin-right-sm">{{$t('convert.convert.o56h58')}}</text><text class="cr-blue">{{ accounts_list[send_accounts_id_index]['platform_symbol'] }} {{ accounts_list[send_accounts_id_index]['normal_coin'] }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="coin-num pr flex-col">
|
||||
<input type="digit" name="coin" :value="default_value" class="num input-br text-size" placeholder-class="text-size-sm cr-grey-9" :placeholder="$t('common.please_input')" @input="default_coin_change_event" />
|
||||
<view class="margin-top-main tr text-size-xs">{{ accounts_list[send_accounts_id_index]['platform_symbol'] }} {{ accounts_list[send_accounts_id_index]['default_coin'] }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="coin-center-convert pa flex-row jc-c align-c" @tap="coin_center_convert_event(2)">
|
||||
<iconfont name="icon-convert" class="pa convert-icon" :class="convert_bool ? 'convert_true' : 'convert_false'" color="#1D7DEF" size="36rpx"></iconfont>
|
||||
</view>
|
||||
<view class="br-f5 margin-bottom-main radius-md padding-lg flex-row jc-sb">
|
||||
<view>
|
||||
<view class="flex-row align-c pr coin-dropdown" @tap="popup_coin_status_event">
|
||||
<image v-if="accounts_list[receive_accounts_id_index]['platform_icon']" :src="accounts_list[receive_accounts_id_index]['platform_icon']" mode="widthFix" class="coin-content-list-img round" />
|
||||
<text class="margin-left-sm fw-b single-text">{{ accounts_list[receive_accounts_id_index]['platform_name'] }}</text>
|
||||
<view class="coin-dropdown-icon pa padding-left-xxl">
|
||||
<iconfont name="icon-arrow-bottom" size="24rpx" color="#666"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
<view class="margin-top-main text-size-xs flex-row align-c">
|
||||
<text class="margin-right-sm">{{$t('convert.convert.o56h58')}}</text><text class="cr-blue">{{ accounts_list[receive_accounts_id_index]['platform_symbol'] }} {{ accounts_list[receive_accounts_id_index]['normal_coin'] }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="coin-num pr flex-col">
|
||||
<input type="digit" :value="convert_value" class="num text-size" placeholder-class="text-size-sm cr-grey-9" disabled />
|
||||
<view class="margin-top-main tr text-size-xs">{{ accounts_list[receive_accounts_id_index]['platform_symbol'] }} {{ accounts_list[receive_accounts_id_index]['default_coin'] }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex-row align-c">
|
||||
<iconfont name="icon-recharge" color="#333" size="32rpx"></iconfont>
|
||||
<view class="margin-left-sm">{{ default_value || 0 }} * {{ accounts_list[send_accounts_id_index]['platform_rate'] }} = {{ Math.round(default_value * accounts_list[receive_accounts_id_index]['platform_rate'] * 100) / 100 }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="padding-main bg-white radius-md margin-bottom-xxxxl flex-row align-c">
|
||||
<text class="padding-right">支付密码</text>
|
||||
<input type="password" :value="pay_pwd" class="text-size flex-1 flex-width" placeholder-class="text-size-md cr-grey-9" placeholder="请输入支付密码" />
|
||||
</view> -->
|
||||
<view class="padding-main radius-md margin-bottom-main">
|
||||
<button type="default" class="convert-btn cr-white round" @tap="convert_submit">{{$t('convert.convert.4kcix6')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<!-- 虚拟币下拉框 -->
|
||||
<component-popup :propShow="popup_coin_status" propPosition="bottom" @onclose="popup_coin_status_close_event">
|
||||
<view class="padding-horizontal-main padding-top-main bg-white">
|
||||
<view class="oh">
|
||||
<view class="fr" @tap.stop="popup_coin_status_close_event">
|
||||
<iconfont name="icon-close-o" size="28rpx" color="#999"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
<view class="popup_coin_status_container padding-vertical-main flex-col text-size">
|
||||
<view class="scroll-y">
|
||||
<view v-for="(item, index) in accounts_list" :key="index" class="flex-row jc-sb align-c padding-vertical-main" :class="accounts_list.length == index + 1 ? '' : 'br-b-f9'" :data-value="item.id" :data-index="index" @tap="coin_checked_event">
|
||||
<view class="flex-row align-c">
|
||||
<image v-if="item.platform_icon" :src="item.platform_icon" mode="widthFix" class="coin-list-img round" />
|
||||
<view class="margin-left-sm text-size-md single-text">{{ item.platform_name }}</view>
|
||||
</view>
|
||||
<view>
|
||||
<iconfont :name="coin_index == index ? 'icon-zhifu-yixuan cr-red' : 'icon-zhifu-weixuan'" size="40rpx"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</component-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 componentCommon from '@/components/common/common';
|
||||
import componentNoData from '@/components/no-data/no-data';
|
||||
import componentPopup from '@/components/popup/popup';
|
||||
var wallet_static_url = app.globalData.get_static_url('coin', true) + 'app/';
|
||||
// 状态栏高度
|
||||
var bar_height = parseInt(app.globalData.get_system_info('statusBarHeight', 0, true));
|
||||
// #ifdef MP-TOUTIAO
|
||||
bar_height = 0;
|
||||
// #endif
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
wallet_static_url: wallet_static_url,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
|
||||
// 虚拟币状态
|
||||
coin_type: 1,
|
||||
coin_index: 0,
|
||||
// 下标
|
||||
send_accounts_id_index: 0,
|
||||
receive_accounts_id_index: 0,
|
||||
// id
|
||||
send_accounts_id: 0,
|
||||
receive_accounts_id: 0,
|
||||
popup_coin_status: false,
|
||||
accounts_list: [],
|
||||
// 是否转换
|
||||
convert_bool: false,
|
||||
// 输入默认币
|
||||
default_value: '',
|
||||
// 转换币
|
||||
convert_value: '0.00',
|
||||
// 支付密码
|
||||
pay_pwd: '',
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentPopup,
|
||||
},
|
||||
|
||||
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.get_data();
|
||||
},
|
||||
methods: {
|
||||
init(e) {
|
||||
var user = app.globalData.get_user_info(this, 'init');
|
||||
if (user != false) {
|
||||
this.get_data();
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('createinfo', 'convert', 'coin'),
|
||||
method: 'POST',
|
||||
data: { send_accounts_id: this.send_accounts_id, receive_accounts_id: this.receive_accounts_id },
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
var send_accounts = data.send_accounts || null;
|
||||
var receive_accounts = data.receive_accounts || null;
|
||||
this.setData({
|
||||
data_base: data.base || null,
|
||||
accounts_list: data.accounts_list || [],
|
||||
convert_value: data.convert_value || '0',
|
||||
send_accounts_id: (send_accounts == null) ? 0 : send_accounts.id,
|
||||
receive_accounts_id: (receive_accounts == null) ? 0 : receive_accounts.id,
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: 3,
|
||||
});
|
||||
if (data.accounts_list.length > 0) {
|
||||
this.setData({
|
||||
send_accounts_id_index: data.accounts_list.findIndex((item) => item.id == data.send_accounts.id),
|
||||
receive_accounts_id_index: data.accounts_list.findIndex((item) => item.id == data.receive_accounts.id),
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
app.globalData.is_login_check(res.data, this, 'get_data');
|
||||
}
|
||||
},
|
||||
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'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 虚拟币切换
|
||||
popup_coin_status_event(type) {
|
||||
this.setData({
|
||||
coin_type: type,
|
||||
receive_accounts_idsend_accounts_id_index: this.receive_accounts_id_index,
|
||||
popup_coin_status: true,
|
||||
});
|
||||
},
|
||||
// 切换账户
|
||||
coin_checked_event(e) {
|
||||
var index = parseInt(e.currentTarget.dataset.index || 0);
|
||||
var old_index = (this.coin_type == 1) ? this.receive_accounts_id_index : this.send_accounts_id_index;
|
||||
if(index == old_index) {
|
||||
app.globalData.showToast(this.$t('convert.convert.327y2v'));
|
||||
return false;
|
||||
}
|
||||
if (this.coin_type == 1) {
|
||||
this.setData({
|
||||
send_accounts_id_index: index,
|
||||
send_accounts_id: e.currentTarget.dataset.value,
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
receive_accounts_id_index: index,
|
||||
receive_accounts_id: e.currentTarget.dataset.value,
|
||||
});
|
||||
}
|
||||
this.setData({
|
||||
coin_index: index,
|
||||
popup_coin_status: false,
|
||||
});
|
||||
},
|
||||
// 关闭账户选择弹窗
|
||||
popup_coin_status_close_event() {
|
||||
this.setData({
|
||||
popup_coin_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 虚拟货币调换
|
||||
coin_center_convert_event() {
|
||||
var send_index = this.send_accounts_id_index;
|
||||
var receive_index = this.receive_accounts_id_index;
|
||||
var send_id = this.send_accounts_id;
|
||||
var receive_id = this.receive_accounts_id;
|
||||
this.setData({
|
||||
receive_accounts_id_index: send_index,
|
||||
send_accounts_id_index: receive_index,
|
||||
receive_accounts_id: send_id,
|
||||
send_accounts_id: receive_id,
|
||||
convert_bool: !this.convert_bool,
|
||||
});
|
||||
},
|
||||
// 需要转换的值事件
|
||||
default_coin_change_event(e) {
|
||||
this.setData({
|
||||
default_value: e.detail.value,
|
||||
convert_value: Math.round(e.detail.value * this.accounts_list[this.receive_accounts_id_index]['platform_rate'] * 100) / 100,
|
||||
});
|
||||
},
|
||||
|
||||
// 立即转换
|
||||
convert_submit() {
|
||||
var new_data = {
|
||||
send_accounts_id: this.send_accounts_id,
|
||||
receive_accounts_id: this.receive_accounts_id,
|
||||
coin: this.default_value,
|
||||
};
|
||||
|
||||
// 数据校验
|
||||
var validation = [{ fields: 'coin', msg: this.$t('convert.convert.vyjy7s') }];
|
||||
|
||||
// 验证提交表单
|
||||
if (app.globalData.fields_check(new_data, validation)) {
|
||||
// 远程请求
|
||||
this.setData({
|
||||
form_submit_loading: true,
|
||||
});
|
||||
uni.showLoading({
|
||||
title: this.$t('common.processing_in_text'),
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('create', 'convert', 'coin'),
|
||||
method: 'POST',
|
||||
data: new_data,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
app.globalData.showToast(res.data.msg, 'success');
|
||||
setTimeout(function () {
|
||||
app.globalData.url_open('/pages/plugins/coin/convert-list/convert-list', true);
|
||||
}, 1000);
|
||||
} else {
|
||||
this.setData({
|
||||
form_submit_loading: 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_loading: false,
|
||||
});
|
||||
uni.hideLoading();
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 页面滚动监听
|
||||
scroll_event(e) {
|
||||
uni.$emit('onPageScroll', e.detail);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './convert.css';
|
||||
</style>
|
||||
56
pages/plugins/coin/detail/detail.css
Normal file
56
pages/plugins/coin/detail/detail.css
Normal file
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* 顶部
|
||||
*/
|
||||
.coin-title {
|
||||
background: radial-gradient(60% 70% at 90% 79%, rgba(33, 125, 239, 0.41) 0%, rgba(222, 237, 255, 0.56) 100%);
|
||||
padding-top: 130rpx;
|
||||
/* #ifndef H5 */
|
||||
padding-top: calc(var(--status-bar-height) + 5px + 130rpx);
|
||||
/* #endif */
|
||||
border-bottom-left-radius: 60rpx;
|
||||
border-bottom-right-radius: 60rpx;
|
||||
}
|
||||
|
||||
.coin-oprate-list {
|
||||
--size: 76rpx;
|
||||
height: var(--size);
|
||||
border-radius: 32rpx;
|
||||
}
|
||||
|
||||
/*
|
||||
* 内容
|
||||
*/
|
||||
.coin-content .coin-item {
|
||||
max-height: calc(100vh - 688rpx);
|
||||
/* #ifndef H5 */
|
||||
max-height: calc(100vh - 688rpx - var(--status-bar-height) - 5px);
|
||||
/* #endif */
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.coin-content-list-img {
|
||||
--size: 80rpx;
|
||||
width: var(--size);
|
||||
height: var(--size) !important;
|
||||
}
|
||||
|
||||
/*
|
||||
* 虚拟币弹窗
|
||||
*/
|
||||
.popup_coin_status_container .scroll-y {
|
||||
height: 40vh;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.coin-list-img {
|
||||
--size: 40rpx;
|
||||
width: var(--size);
|
||||
height: var(--size) !important;
|
||||
}
|
||||
|
||||
/*
|
||||
* 明细弹窗
|
||||
*/
|
||||
.popup_user_detail_container .item {
|
||||
background: #EFF0F1;
|
||||
}
|
||||
348
pages/plugins/coin/detail/detail.vue
Normal file
348
pages/plugins/coin/detail/detail.vue
Normal file
@@ -0,0 +1,348 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<component-nav-back :propName="$t('detail.detail.yvmu0z')"></component-nav-back>
|
||||
<view v-if="accounts_list.length > 0">
|
||||
<scroll-view :scroll-y="true" class="scroll-box" lower-threshold="60" @scroll="scroll_event">
|
||||
<view class="coin-title flex-col padding-lg">
|
||||
<view v-if="accounts_list.length > 0 && (accounts || null) != null" class="margin-bottom-xxxxl padding-bottom-main flex-row jc-sb align-c">
|
||||
<view class="flex-row">
|
||||
<image v-if="(accounts.platform_icon || null) != null" :src="accounts.platform_icon" mode="widthFix" class="coin-content-list-img round" />
|
||||
<view class="padding-left-main">
|
||||
<view class="coin-dropdown text-size-md pr margin-bottom-xs flex-row" @tap="popup_coin_status_open_event">
|
||||
<text class="cr-666">{{ accounts.platform_name }}</text>
|
||||
<view class="padding-left-sm">
|
||||
<iconfont name="icon-arrow-bottom" size="24rpx" color="#666"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<text class="fw-b text-size">{{ is_price_show ? accounts.normal_coin : '***' }}</text>
|
||||
<text v-if="is_price_show" class="cr-grey-9 text-size-xs margin-left">{{ accounts.default_symbol }} {{ accounts.default_coin }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view @tap="price_change">
|
||||
<iconfont :name="is_price_show ? 'icon-wodeqianbao-eye' : 'icon-eye-half'" size="44rpx"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex-row jc-sb">
|
||||
<view v-for="(item, index) in coin_oprate_list" class="flex-1 padding-sm tc text-size-md" :key="index" :data-value="item.url" :data-method="item.method" @tap="url_event">
|
||||
<view class="coin-oprate-list bg-white flex-row align-c jc-c">
|
||||
<view class="pr top-xs">
|
||||
<iconfont :name="item.icon" size="28rpx" color="#635BFF"></iconfont>
|
||||
</view>
|
||||
<view class="margin-left-sm fw-b">{{ item.name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="coin-content padding-lg pr">
|
||||
<block v-if="log_list.length > 0" >
|
||||
<view v-for="(item, index) in log_list" :key="index" class="bg-white radius-md padding-main margin-bottom-main">
|
||||
<view class="br-b-dashed padding-bottom-main margin-bottom-main flex-row jc-sb align-c">
|
||||
<view>{{ item.coin_type_name }}</view>
|
||||
<view class="cr-grey-9">{{ item.add_time }}</view>
|
||||
</view>
|
||||
<view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9">{{$t('detail.detail.4w20tq')}}</text>
|
||||
<text class="fw-b warp">{{ item.operate_type_name }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9">{{$t('detail.detail.s101d1')}}</text>
|
||||
<text class="fw-b warp">{{ item.operate_coin }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9">{{$t('detail.detail.e30wj1')}}</text>
|
||||
<text class="fw-b warp">{{ item.original_coin }}</text>
|
||||
</view>
|
||||
<view class="flex-row">
|
||||
<text class="cr-grey-9">{{$t('detail.detail.jdour8')}}</text>
|
||||
<text class="fw-b warp">{{ item.latest_coin }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tc cr-grey cp" :data-value="'/pages/plugins/coin/transaction-list/transaction-list?id=' + accounts.id" @tap="url_event">
|
||||
<text class="va-m">{{$t('detail.detail.7fhy2u')}}</text>
|
||||
<view class="dis-inline-block va-m margin-top-xs margin-left-xs">
|
||||
<iconfont name="icon-arrow-right" color="#999"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
</block>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<block v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
</block>
|
||||
<!-- 虚拟币下拉框 -->
|
||||
<component-popup :propShow="popup_coin_status" propPosition="bottom" @onclose="popup_coin_status_close_event">
|
||||
<view class="padding-horizontal-main padding-top-main bg-white">
|
||||
<view class="oh">
|
||||
<view class="fr" @tap.stop="popup_coin_status_close_event">
|
||||
<iconfont name="icon-close-o" size="28rpx" color="#999"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
<view class="popup_coin_status_container padding-vertical-main flex-col text-size">
|
||||
<view class="scroll-y">
|
||||
<view v-for="(item, index) in accounts_list" :key="index">
|
||||
<view class="flex-row jc-sb align-c padding-vertical-main" :class="accounts_list.length == index + 1 ? '' : 'br-b-f9'" :data-value="item" :data-index="index" @tap="coin_checked_event">
|
||||
<view class="flex-row align-c">
|
||||
<image v-if="item.platform_icon" :src="item.platform_icon" mode="widthFix" class="coin-list-img round" />
|
||||
<view class="margin-left-sm text-size-md single-text">{{ item.platform_name }}</view>
|
||||
</view>
|
||||
<view>
|
||||
<iconfont :name="accounts.id == item.id ? 'icon-zhifu-yixuan cr-red' : 'icon-zhifu-weixuan'" size="40rpx"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
<!-- 明细 -->
|
||||
<component-popup :propShow="popup_user_detail_status" propPosition="bottom" @onclose="popup_user_detail_close_event">
|
||||
<view class="padding-horizontal-main padding-top-main bg-white">
|
||||
<view class="oh">
|
||||
<text class="text-size">{{$t('pages.plugins-coin-detail')}}</text>
|
||||
<view class="fr" @tap.stop="popup_user_detail_close_event">
|
||||
<iconfont name="icon-close-o" size="28rpx" color="#999"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="accounts_list.length > 0 && (accounts || null) != null" class="popup_user_detail_container padding-vertical-main flex-row flex-wrap align-c tc text-size">
|
||||
<view class="flex-width-half">
|
||||
<view class="item padding-vertical-lg radius margin-sm" :data-value="'/pages/plugins/coin/recharge-list/recharge-list?id=' + accounts.id" @tap="url_event">{{$t('pages.plugins-coin-recharge-list')}}</view>
|
||||
</view>
|
||||
<view class="flex-width-half">
|
||||
<view class="item padding-vertical-lg radius margin-sm" :data-value="'/pages/plugins/coin/transfer-list/transfer-list?id=' + accounts.id" @tap="url_event">{{$t('pages.plugins-coin-transfer-list')}}</view>
|
||||
</view>
|
||||
<view class="flex-width-half">
|
||||
<view class="item padding-vertical-lg radius margin-sm" :data-value="'/pages/plugins/coin/transaction-list/transaction-list?id=' + accounts.id" @tap="url_event">{{$t('pages.plugins-coin-transaction-list')}}</view>
|
||||
</view>
|
||||
<view class="flex-width-half">
|
||||
<view class="item padding-vertical-lg radius margin-sm" :data-value="'/pages/plugins/coin/cash-list/cash-list?id=' + accounts.id" @tap="url_event">{{$t('pages.plugins-coin-cash-list')}}</view>
|
||||
</view>
|
||||
<view class="flex-width-half">
|
||||
<view class="item padding-vertical-lg radius margin-sm" :data-value="'/pages/plugins/coin/convert-list/convert-list?id=' + accounts.id" @tap="url_event">{{$t('pages.plugins-coin-convert-list')}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
|
||||
<!-- 公共 -->
|
||||
<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';
|
||||
var wallet_static_url = app.globalData.get_static_url('coin', true) + 'app/';
|
||||
// 状态栏高度
|
||||
var bar_height = parseInt(app.globalData.get_system_info('statusBarHeight', 0, true));
|
||||
// #ifdef MP-TOUTIAO
|
||||
bar_height = 0;
|
||||
// #endif
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
wallet_static_url: wallet_static_url,
|
||||
status_bar_height: bar_height,
|
||||
params: null,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
|
||||
// 虚拟币下拉框探弹窗状态
|
||||
popup_coin_status: false,
|
||||
// 虚拟币下拉框list
|
||||
accounts_list: [],
|
||||
// 账户
|
||||
accounts: {},
|
||||
|
||||
// 是否显示虚拟币
|
||||
is_price_show: false,
|
||||
// 虚拟币操作列表
|
||||
coin_oprate_list: [],
|
||||
|
||||
// 明细弹窗
|
||||
popup_user_detail_status: false,
|
||||
|
||||
// 日志列表
|
||||
log_list: [],
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNavBack,
|
||||
componentNoData,
|
||||
componentPopup,
|
||||
},
|
||||
|
||||
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.get_data();
|
||||
},
|
||||
methods: {
|
||||
init(e) {
|
||||
var user = app.globalData.get_user_info(this, 'init');
|
||||
if (user != false) {
|
||||
this.get_data();
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('detail', 'accounts', 'coin'),
|
||||
method: 'POST',
|
||||
data: {id: this.accounts.id || this.params.id || null},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
this.setData({
|
||||
data_base: data.base || null,
|
||||
accounts: data.accounts || {},
|
||||
accounts_list: data.accounts_list || [],
|
||||
log_list: data.log_list || [],
|
||||
accounts_summary: data.accounts_summary || 0,
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: 0,
|
||||
});
|
||||
|
||||
// 操作导航
|
||||
var temp_coin_oprate_list = [];
|
||||
if(parseInt(this.accounts.platform_data.is_enable_transfer || 0) == 1) {
|
||||
temp_coin_oprate_list.push({
|
||||
name: this.$t('user.user.29f6n5'),
|
||||
icon: 'icon-transfer-count',
|
||||
url: '/pages/plugins/coin/transfer/transfer?id=' + this.accounts.id,
|
||||
});
|
||||
}
|
||||
temp_coin_oprate_list.push({
|
||||
name: this.$t('index.index.6941e7'),
|
||||
icon: 'icon-collection',
|
||||
url: '/pages/plugins/coin/collection/collection?accounts_key=' + this.accounts.accounts_key,
|
||||
});
|
||||
temp_coin_oprate_list.push({
|
||||
name: this.$t('pages.plugins-coin-detail'),
|
||||
icon: 'icon-detail',
|
||||
url: '',
|
||||
method: true,
|
||||
});
|
||||
this.setData({
|
||||
coin_oprate_list: temp_coin_oprate_list
|
||||
});
|
||||
} 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'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 显示隐藏虚拟币
|
||||
price_change() {
|
||||
this.setData({
|
||||
is_price_show: !this.is_price_show,
|
||||
});
|
||||
},
|
||||
|
||||
// 页面滚动监听
|
||||
scroll_event(e) {
|
||||
uni.$emit('onPageScroll', e.detail);
|
||||
},
|
||||
|
||||
// 虚拟币切换
|
||||
coin_checked_event(e) {
|
||||
this.setData({
|
||||
accounts: this.accounts_list[e.currentTarget.dataset.index],
|
||||
popup_coin_status: false,
|
||||
log_list: [],
|
||||
data_list_loding_status: 1,
|
||||
});
|
||||
this.get_data();
|
||||
},
|
||||
popup_coin_status_open_event() {
|
||||
this.setData({
|
||||
popup_coin_status: !this.popup_coin_status,
|
||||
});
|
||||
},
|
||||
popup_coin_status_close_event() {
|
||||
this.setData({
|
||||
popup_coin_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 明细弹窗打开
|
||||
popup_user_detail_open_event() {
|
||||
this.setData({
|
||||
popup_user_detail_status: true,
|
||||
});
|
||||
},
|
||||
// 明细弹窗关闭
|
||||
popup_user_detail_close_event(e) {
|
||||
this.setData({
|
||||
popup_user_detail_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// url事件
|
||||
url_event(e) {
|
||||
if (e.currentTarget.dataset.method) {
|
||||
this.popup_user_detail_open_event();
|
||||
} else {
|
||||
app.globalData.url_event(e);
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './detail.css';
|
||||
</style>
|
||||
42
pages/plugins/coin/recharge-list/recharge-list.css
Normal file
42
pages/plugins/coin/recharge-list/recharge-list.css
Normal file
@@ -0,0 +1,42 @@
|
||||
.convert .nav {
|
||||
z-index: 102;
|
||||
}
|
||||
|
||||
.scroll-box {
|
||||
height: calc(100vh - 88rpx);
|
||||
}
|
||||
|
||||
.recharge-apy-btn,
|
||||
.recharge-del-btn {
|
||||
padding: 0 60rpx;
|
||||
font-size: 28rpx;
|
||||
margin: 0 0 0 20rpx;
|
||||
}
|
||||
|
||||
.recharge-apy-btn:active,
|
||||
.recharge-del-btn:active {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.recharge-del-btn {
|
||||
color: #0079ff !important;
|
||||
background-color: #fff;
|
||||
border: 2rpx solid #0079ff;
|
||||
}
|
||||
|
||||
.recharge-apy-btn {
|
||||
background: linear-gradient(107deg, #31B4FC 0%, #0842E2 100%), #0079FF;
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
.convert-group-row .title {
|
||||
min-width: 140rpx;
|
||||
}
|
||||
|
||||
/*
|
||||
* 钱包弹窗
|
||||
*/
|
||||
.popup_accounts_container .item {
|
||||
background-color: #f4f4f4;
|
||||
border-radius: 30rpx;
|
||||
}
|
||||
523
pages/plugins/coin/recharge-list/recharge-list.vue
Normal file
523
pages/plugins/coin/recharge-list/recharge-list.vue
Normal file
@@ -0,0 +1,523 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view class="convert">
|
||||
<view class="padding-main bg-white pr nav flex-row oa">
|
||||
<view class="flex-shrink flex-row align-c margin-right-xxxl padding-right-xl pr" @tap="popup_accounts_open_event">
|
||||
<view>{{ accounts_name !== null && accounts_name !== $t('common.all') ? accounts_name : $t('cash-list.cash-list.n74r94') }}</view>
|
||||
<view class="pa right-0"><iconfont :name="popup_accounts_status ? 'icon-arrow-top' : 'icon-arrow-bottom'" size="24rpx"></iconfont></view>
|
||||
</view>
|
||||
<view class="flex-shrink flex-row align-c margin-right-xxxl padding-right-xl pr" @tap="popup_recharge_status_open_event">
|
||||
<view>{{ recharge_status_name !== null && recharge_status_name !== $t('common.all') ? recharge_status_name : $t('invoice-detail.invoice-detail.rrfex6') }}</view>
|
||||
<view class="pa right-0"><iconfont :name="popup_recharge_status_status ? 'icon-arrow-top' : 'icon-arrow-bottom'" size="24rpx"></iconfont></view>
|
||||
</view>
|
||||
<view class="flex-shrink flex-row align-c padding-right-xl pr" @tap="popup_network_open_event">
|
||||
<view>{{ network_name !== null && network_name !== $t('common.all') ? network_name : $t('cash-list.cash-list.2g251t') }}</view>
|
||||
<view class="pa right-0"><iconfont :name="popup_network_status ? 'icon-arrow-top' : 'icon-arrow-bottom'" size="24rpx"></iconfont></view>
|
||||
</view>
|
||||
</view>
|
||||
<scroll-view :scroll-y="true" class="scroll-box" lower-threshold="60" @scroll="scroll_event">
|
||||
<view class="padding-main">
|
||||
<view v-if="data_list.length > 0">
|
||||
<view v-for="(item, index) in data_list" :key="index" class="padding-main bg-white radius-md margin-bottom-main">
|
||||
<view class="br-b-dashed padding-bottom-main margin-bottom-main flex-row jc-sb align-c">
|
||||
<view>{{ item.status_name }}</view>
|
||||
<view class="cr-grey-9">{{ item.add_time }}</view>
|
||||
</view>
|
||||
<view class="convert-group-row">
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('recharge-list.recharge-list.6b9399')}}</text>
|
||||
<text class="fw-b warp">{{ item.recharge_no }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('cash-list.cash-list.2w20g2')}}</text>
|
||||
<text class="fw-b warp">{{ item.platform_name }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('cash-list.cash-list.23ii8s')}}</text>
|
||||
<text class="fw-b warp">{{ item.network_name }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('cash-list.cash-list.714g2h')}}</text>
|
||||
<text class="fw-b warp">{{ item.address }}</text>
|
||||
</view>
|
||||
<view class="flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('recharge-list.recharge-list.epd531')}}</text>
|
||||
<text class="fw-b warp">{{ item.coin }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<div v-if="item.status == 0" class="br-t-dashed padding-top-main margin-top-main flex-row jc-e align-c">
|
||||
<button type="default" class="recharge-del-btn round" :data-id="item.id" @tap="recharge_del_event">{{$t('common.del')}}</button>
|
||||
<button type="default" class="recharge-apy-btn round" :data-id="item.id" @tap="recharge_pay_event">{{$t('order.order.1i873j')}}</button>
|
||||
</div>
|
||||
</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>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<!-- 账户 -->
|
||||
<component-popup :propShow="popup_accounts_status" propPosition="top" :propTop="popup_top_height + 'px'" @onclose="popup_accounts_close_event">
|
||||
<view class="padding-vertical-lg">
|
||||
<view class="padding-horizontal-main text-size-xs">{{$t('cash-list.cash-list.s7l616')}}</view>
|
||||
<view class="popup_accounts_container padding-sm flex-row flex-wrap align-c tc text-size-md">
|
||||
<view class="flex-width-half-half">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="accounts_list_index == null ? 'cr-main bg-main-light' : ''" :data-name="$t('common.all')" :data-value="null" :data-index="null" @tap="accounts_list_event">{{$t('common.all')}}</view>
|
||||
</view>
|
||||
<view v-for="(item, index) in accounts_list" class="flex-width-half-half" :key="index">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="accounts_list_index == index ? 'cr-main bg-main-light' : ''" :data-name="item.platform_name" :data-value="item.id" :data-index="index" @tap="accounts_list_event">{{ item.platform_name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tc padding-top-lg br-t" @tap="popup_accounts_close_event">
|
||||
<text class="padding-right-sm">{{ $t('nav-more.nav-more.h9g4b1') }}</text>
|
||||
<iconfont name="icon-arrow-top" color="#ccc"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
<!-- 类型 -->
|
||||
<component-popup :propShow="popup_recharge_status_status" propPosition="top" :propTop="popup_top_height + 'px'" @onclose="popup_recharge_status_close_event">
|
||||
<view class="padding-vertical-lg">
|
||||
<view class="padding-horizontal-main text-size-xs">{{$t('cash-list.cash-list.t66tu3')}}</view>
|
||||
<view class="popup_accounts_container padding-sm flex-row flex-wrap align-c tc text-size-md">
|
||||
<view class="flex-width-half-half">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="recharge_status_list_index == null ? 'cr-main bg-main-light' : ''" :data-name="$t('common.all')" :data-value="null" :data-index="null" @tap="recharge_status_list_event">{{$t('common.all')}}</view>
|
||||
</view>
|
||||
<view v-for="(item, index) in recharge_status_list" class="flex-width-half-half" :key="index">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="recharge_status_list_index == index ? 'cr-main bg-main-light' : ''" :data-name="item.name" :data-value="item.value" :data-index="index" @tap="recharge_status_list_event">{{ item.name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tc padding-top-lg br-t" @tap="popup_recharge_status_close_event">
|
||||
<text class="padding-right-sm">{{ $t('nav-more.nav-more.h9g4b1') }}</text>
|
||||
<iconfont name="icon-arrow-top" color="#ccc"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
<!-- 网络 -->
|
||||
<component-popup :propShow="popup_network_status" propPosition="top" :propTop="popup_top_height + 'px'" @onclose="popup_network_close_event">
|
||||
<view class="padding-vertical-lg">
|
||||
<view class="padding-horizontal-main text-size-xs">{{$t('cash-list.cash-list.311tt2')}}</view>
|
||||
<view class="popup_accounts_container padding-sm flex-row flex-wrap align-c tc text-size-md">
|
||||
<view class="flex-width-half-half">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="network_list_index == null ? 'cr-main bg-main-light' : ''" :data-name="$t('common.all')" :data-value="null" :data-index="null" @tap="network_list_event">{{$t('common.all')}}</view>
|
||||
</view>
|
||||
<view v-for="(item, index) in network_list" class="flex-width-half-half" :key="index">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="network_list_index == index ? 'cr-main bg-main-light' : ''" :data-name="item.name" :data-value="item.id" :data-index="index" @tap="network_list_event">{{ item.name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tc padding-top-lg br-t" @tap="popup_network_close_event">
|
||||
<text class="padding-right-sm">{{ $t('nav-more.nav-more.h9g4b1') }}</text>
|
||||
<iconfont name="icon-arrow-top" color="#ccc"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
</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 componentPopup from '@/components/popup/popup';
|
||||
import componentBottomLine from '@/components/bottom-line/bottom-line';
|
||||
var accounts_static_url = app.globalData.get_static_url('coin', true) + 'app/';
|
||||
// 状态栏高度
|
||||
var bar_height = parseInt(app.globalData.get_system_info('statusBarHeight', 0, true));
|
||||
// #ifdef MP-TOUTIAO
|
||||
bar_height = 0;
|
||||
// #endif
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
accounts_static_url: accounts_static_url,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
data_bottom_line_status: false,
|
||||
params: {},
|
||||
|
||||
// 弹窗距离顶部距离
|
||||
popup_top_height: 0,
|
||||
|
||||
// 账户
|
||||
popup_accounts_status: false,
|
||||
accounts_id: null,
|
||||
accounts_list_index: null,
|
||||
accounts_name: null,
|
||||
accounts_list: [],
|
||||
// 类型
|
||||
popup_recharge_status_status: false,
|
||||
status: null,
|
||||
recharge_status_list_index: null,
|
||||
recharge_status_name: null,
|
||||
recharge_status_list: [],
|
||||
// 网络
|
||||
popup_network_status: false,
|
||||
network_id: null,
|
||||
network_list_index: null,
|
||||
network_name: null,
|
||||
network_list: [],
|
||||
|
||||
data_list: [],
|
||||
data_page_total: 0,
|
||||
data_page: 1,
|
||||
data_is_loading: 0,
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentPopup,
|
||||
componentBottomLine,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: params,
|
||||
accounts_id: params.id || null,
|
||||
});
|
||||
},
|
||||
|
||||
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.setData({
|
||||
data_page: 1,
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
methods: {
|
||||
init(e) {
|
||||
var user = app.globalData.get_user_info(this, 'init');
|
||||
if (user != false) {
|
||||
this.get_data();
|
||||
this.get_data_list();
|
||||
var self = this;
|
||||
var timer = setInterval(function () {
|
||||
if (self.popup_top_height == 0) {
|
||||
self.popup_top_height_computer();
|
||||
} else {
|
||||
clearInterval(timer);
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
},
|
||||
|
||||
// 初始化数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('init', 'user', 'coin'),
|
||||
method: 'POST',
|
||||
data: {},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
this.setData({
|
||||
accounts_list: data.accounts_list || [],
|
||||
recharge_status_list: data.recharge_status_list || [],
|
||||
network_list: data.network_list || [],
|
||||
});
|
||||
if (this.accounts_list.length > 0 && (this.accounts_id || null) != null) {
|
||||
var index = this.accounts_list.findIndex((item) => item.id == this.accounts_id);
|
||||
this.setData({
|
||||
accounts_list_index: index,
|
||||
accounts_id: this.accounts_list[index].id,
|
||||
accounts_name: this.accounts_list[index].platform_name,
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if (app.globalData.is_login_check(res.data, this, 'get_data')) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.stopPullDownRefresh();
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
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 new_data = {
|
||||
accounts_id: this.accounts_id,
|
||||
network_id: this.network_id,
|
||||
status: this.status,
|
||||
page: this.data_page,
|
||||
};
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('index', 'recharge', 'coin'),
|
||||
method: 'POST',
|
||||
data: new_data,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
if (this.data_page > 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
// 数据列表
|
||||
var data = res.data.data;
|
||||
if (this.data_page <= 1) {
|
||||
var temp_data_list = data.data_list || [];
|
||||
} else {
|
||||
var temp_data_list = this.data_list || [];
|
||||
var temp_data = data.data_list;
|
||||
for (var i in temp_data) {
|
||||
temp_data_list.push(temp_data[i]);
|
||||
}
|
||||
}
|
||||
|
||||
this.setData({
|
||||
data_list: temp_data_list,
|
||||
data_total: data.total,
|
||||
data_page_total: data.page_total,
|
||||
data_list_loding_status: temp_data_list.length > 0 ? 3 : 0,
|
||||
data_list_loding_msg: '',
|
||||
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: 2,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
if (this.data_page > 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_is_loading: 0,
|
||||
data_list_loding_msg: this.$t('common.internet_error_tips'),
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 账户打开
|
||||
popup_accounts_open_event() {
|
||||
this.setData({
|
||||
popup_accounts_status: !this.popup_accounts_status,
|
||||
popup_recharge_status_status: false,
|
||||
popup_network_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 账户关闭
|
||||
popup_accounts_close_event() {
|
||||
this.setData({
|
||||
popup_accounts_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 账户选择
|
||||
accounts_list_event(e) {
|
||||
this.setData({
|
||||
accounts_list_index: e.currentTarget.dataset.index,
|
||||
accounts_id: e.currentTarget.dataset.value,
|
||||
accounts_name: e.currentTarget.dataset.name,
|
||||
popup_accounts_status: false,
|
||||
data_page: 1,
|
||||
data_list: [],
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// 类型打开
|
||||
popup_recharge_status_open_event() {
|
||||
this.setData({
|
||||
popup_recharge_status_status: !this.popup_recharge_status_status,
|
||||
popup_accounts_status: false,
|
||||
popup_network_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 类型关闭
|
||||
popup_recharge_status_close_event() {
|
||||
this.setData({
|
||||
popup_recharge_status_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 类型选择
|
||||
recharge_status_list_event(e) {
|
||||
this.setData({
|
||||
recharge_status_list_index: e.currentTarget.dataset.index,
|
||||
status: e.currentTarget.dataset.value,
|
||||
recharge_status_name: e.currentTarget.dataset.name,
|
||||
popup_recharge_status_status: false,
|
||||
data_page: 1,
|
||||
data_list: [],
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// 网络打开
|
||||
popup_network_open_event() {
|
||||
this.setData({
|
||||
popup_network_status: !this.popup_network_status,
|
||||
popup_accounts_status: false,
|
||||
popup_recharge_status_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 网络关闭
|
||||
popup_network_close_event() {
|
||||
this.setData({
|
||||
popup_network_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 网络选择
|
||||
network_list_event(e) {
|
||||
this.setData({
|
||||
network_list_index: e.currentTarget.dataset.index,
|
||||
network_id: e.currentTarget.dataset.value,
|
||||
network_name: e.currentTarget.dataset.name,
|
||||
popup_network_status: false,
|
||||
data_page: 1,
|
||||
data_list: [],
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// 删除
|
||||
recharge_del_event(e) {
|
||||
// 是否再次确认
|
||||
if (e.alert_status != 0 && e.alert_status != 1) {
|
||||
app.globalData.alert({
|
||||
msg: this.$t('recharge-list.recharge-list.l5g8m1'),
|
||||
is_show_cancel: 1,
|
||||
object: this,
|
||||
params: { id: e.currentTarget.dataset.id },
|
||||
method: 'recharge_del_event',
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (e.alert_status == 1) {
|
||||
// 加载loding
|
||||
uni.showLoading({
|
||||
title: this.$t('common.loading_in_text'),
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('delete', 'recharge', 'coin'),
|
||||
method: 'POST',
|
||||
data: { ids: e.id },
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
this.setData({
|
||||
data_page: 1,
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.del_success'), 'success');
|
||||
this.get_data_list(1);
|
||||
} else {
|
||||
if (app.globalData.is_login_check(res.data)) {
|
||||
app.globalData.showToast(this.$t('common.del_fail'));
|
||||
} else {
|
||||
app.globalData.showToast(this.$t('common.sub_error_retry_tips'));
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
// 支付
|
||||
recharge_pay_event(e) {
|
||||
app.globalData.url_open('/pages/plugins/coin/recharge-pay/recharge-pay?id=' + e.currentTarget.dataset.id);
|
||||
},
|
||||
|
||||
// 计算搜索框的高度
|
||||
popup_top_height_computer() {
|
||||
const query = uni.createSelectorQuery();
|
||||
query
|
||||
.select('.nav')
|
||||
.boundingClientRect((res) => {
|
||||
if ((res || null) != null) {
|
||||
// 获取搜索框高度
|
||||
this.setData({
|
||||
popup_top_height: res.height,
|
||||
});
|
||||
}
|
||||
})
|
||||
.exec();
|
||||
},
|
||||
|
||||
// 页面滚动监听
|
||||
scroll_event(e) {
|
||||
uni.$emit('onPageScroll', e.detail);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './recharge-list.css';
|
||||
</style>
|
||||
105
pages/plugins/coin/recharge-pay/recharge-pay.css
Normal file
105
pages/plugins/coin/recharge-pay/recharge-pay.css
Normal file
@@ -0,0 +1,105 @@
|
||||
.coin-dropdown {
|
||||
--height: 72rpx;
|
||||
height: var(--height);
|
||||
line-height: var(--height);
|
||||
padding: 0 52rpx 0 20rpx;
|
||||
background: #F6F6F6;
|
||||
border-radius: 36rpx;
|
||||
width: 168rpx;
|
||||
}
|
||||
|
||||
.coin-dropdown-icon {
|
||||
right: 24rpx;
|
||||
top: 2rpx;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.coin-list-img {
|
||||
--size: 40rpx;
|
||||
width: var(--size);
|
||||
height: var(--size) !important;
|
||||
}
|
||||
|
||||
.coin-num {
|
||||
--height: 72rpx;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.num.input-br {
|
||||
border: 2rpx solid #F6F6F6;
|
||||
}
|
||||
|
||||
.coin-num .num {
|
||||
height: var(--height);
|
||||
line-height: var(--height);
|
||||
padding: 0 20rpx 0 20rpx;
|
||||
border-radius: 36rpx;
|
||||
width: 196rpx;
|
||||
}
|
||||
|
||||
.coin-center-convert {
|
||||
--size: 82rpx;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
margin-top: -54rpx;
|
||||
width: var(--size);
|
||||
height: var(--size);
|
||||
border: 2rpx solid #e1e1e1;
|
||||
border-radius: 50%;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.convert-icon {
|
||||
transition: all 0.5s ease-in-out;
|
||||
}
|
||||
|
||||
.convert_true {
|
||||
transform: rotate3d(1, 0, 0, 180deg);
|
||||
}
|
||||
|
||||
.convert_false {
|
||||
transform: rotate3d(1, 0, 0, 0deg);
|
||||
}
|
||||
|
||||
.convert-btn {
|
||||
background: linear-gradient(107deg, #31B4FC 0%, #0842E2 100%);
|
||||
transition: all 0.3s ease-in-out;
|
||||
}
|
||||
|
||||
.convert-btn:active {
|
||||
background: linear-gradient(107deg, #168ACA 0%, #022A97 100%);
|
||||
}
|
||||
|
||||
.coin-content-list-img {
|
||||
--size: 36rpx;
|
||||
width: var(--size);
|
||||
height: var(--size) !important;
|
||||
}
|
||||
|
||||
.convert-group-row .title {
|
||||
min-width: 140rpx;
|
||||
}
|
||||
|
||||
.cancel-btn,
|
||||
.submit-btn {
|
||||
width: 50%;
|
||||
height: 88rpx;
|
||||
line-height: 88rpx;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.cancel-btn:active,
|
||||
.submit-btn:active {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.cancel-btn {
|
||||
border: 2rpx solid #0079FF;
|
||||
background-color: transparent;
|
||||
color: #0079FF !important;
|
||||
}
|
||||
|
||||
.submit-btn {
|
||||
background: linear-gradient(107deg, #3AB1F3 0%, #3C6BF7 100%);
|
||||
color: #fff !important;
|
||||
}
|
||||
243
pages/plugins/coin/recharge-pay/recharge-pay.vue
Normal file
243
pages/plugins/coin/recharge-pay/recharge-pay.vue
Normal file
@@ -0,0 +1,243 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<scroll-view :scroll-y="true" class="scroll-box" lower-threshold="60" @scroll="scroll_event">
|
||||
<view class="padding-main pr page-bottom-fixed">
|
||||
<view class="padding-lg bg-white radius-md margin-bottom-main">
|
||||
<view class="convert-group-row">
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('recharge-list.recharge-list.6b9399')}}</text>
|
||||
<text class="fw-b">{{ accounts.recharge_no }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('cash-list.cash-list.714g2h')}}</text>
|
||||
<text class="fw-b">{{ accounts.address }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('cash-list.cash-list.23ii8s')}}</text>
|
||||
<text class="fw-b">{{ accounts.network_name }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('recharge-list.recharge-list.epd531')}}</text>
|
||||
<text class="fw-b">{{ accounts.coin }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('cash-list.cash-list.2w20g2')}}</text>
|
||||
<text class="fw-b">{{ accounts.platform_name }}</text>
|
||||
</view>
|
||||
<view class="flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('cash-list.cash-list.2w20g2')}}</text>
|
||||
<text class="fw-b">{{ accounts.add_time }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="padding-main bg-white radius-md margin-bottom-main">
|
||||
<view class="flex-row align-e margin-bottom-main">
|
||||
<text class="fw-b">{{$t('recharge-pay.recharge-pay.lutmsv')}}</text>
|
||||
<text class="cr-grey-c text-size-xs">{{$t('recharge-pay.recharge-pay.1a5vqk')}}</text>
|
||||
</view>
|
||||
<component-upload :propData="image_list" :propMaxNum="10" :propPathType="editor_path_type" @call-back="return_image_event"></component-upload>
|
||||
</view>
|
||||
<view class="padding-main bg-white radius-md margin-bottom-xxxxl">
|
||||
<view class="flex-row align-e margin-bottom-main">
|
||||
<text class="fw-b">{{$t('recharge-pay.recharge-pay.wu49vk')}}</text>
|
||||
</view>
|
||||
<textarea :placeholder="$t('recharge-pay.recharge-pay.95pfkd')" name="pay_note" placeholder-class="cr-base" class="wh-auto bg-white" :value="pay_note" :maxlength="pay_note_length_max" @input="pay_note_event"></textarea>
|
||||
</view>
|
||||
<view class="bottom-fixed" :style="bottom_fixed_style">
|
||||
<view class="bottom-line-exclude">
|
||||
<view class="flex-row align-c">
|
||||
<button type="default" class="item cancel-btn round margin-right-sm" @tap="cancel_event">{{$t('common.cancel')}}</button>
|
||||
<button type="default" class="item submit-btn round margin-left-sm" @tap="submit_event">{{$t('form.form.4yd066')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</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 componentPopup from '@/components/popup/popup';
|
||||
import componentUpload from '@/components/upload/upload';
|
||||
var wallet_static_url = app.globalData.get_static_url('coin', true) + 'app/';
|
||||
// 状态栏高度
|
||||
var bar_height = parseInt(app.globalData.get_system_info('statusBarHeight', 0, true));
|
||||
// #ifdef MP-TOUTIAO
|
||||
bar_height = 0;
|
||||
// #endif
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
wallet_static_url: wallet_static_url,
|
||||
bottom_fixed_style: '',
|
||||
params: null,
|
||||
accounts: {},
|
||||
image_list: [],
|
||||
editor_path_type: '',
|
||||
// 备注
|
||||
pay_note: '',
|
||||
pay_note_length_max: '500',
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentPopup,
|
||||
componentUpload,
|
||||
},
|
||||
|
||||
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.get_data();
|
||||
},
|
||||
methods: {
|
||||
init(e) {
|
||||
var user = app.globalData.get_user_info(this, 'init');
|
||||
if (user != false) {
|
||||
this.get_data();
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('detail', 'recharge', 'coin'),
|
||||
method: 'POST',
|
||||
data: this.params,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
this.setData({
|
||||
editor_path_type: data.editor_path_type || '',
|
||||
accounts: data.data || {},
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: 3,
|
||||
});
|
||||
} 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'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 上传图片回调
|
||||
return_image_event(data) {
|
||||
this.setData({
|
||||
image_list: data,
|
||||
});
|
||||
},
|
||||
|
||||
// 备注
|
||||
pay_note_event(e) {
|
||||
this.setData({
|
||||
pay_note: e.detail.value.trim(),
|
||||
});
|
||||
},
|
||||
|
||||
// 取消
|
||||
cancel_event() {
|
||||
app.globalData.page_back_prev_event();
|
||||
},
|
||||
|
||||
// 提交
|
||||
submit_event() {
|
||||
var new_data = {
|
||||
id: this.params.id,
|
||||
pay_voucher: this.image_list,
|
||||
pay_note: this.pay_note,
|
||||
};
|
||||
// 数据校验
|
||||
var validation = [
|
||||
{ fields: 'pay_voucher', msg: this.$t('recharge-pay.recharge-pay.v5fok8') },
|
||||
{ fields: 'pay_note', msg: this.$t('recharge-pay.recharge-pay.95pfkd') },
|
||||
];
|
||||
if (app.globalData.fields_check(new_data, validation)) {
|
||||
uni.showLoading({
|
||||
title: this.$t('common.processing_in_text'),
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('pay', 'recharge', 'coin'),
|
||||
method: 'POST',
|
||||
data: new_data,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
app.globalData.showToast(res.data.msg, 'success');
|
||||
setTimeout(function () {
|
||||
app.globalData.url_open('/pages/plugins/coin/recharge-list/recharge-list', true);
|
||||
}, 1000);
|
||||
} 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.stopPullDownRefresh();
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 页面滚动监听
|
||||
scroll_event(e) {
|
||||
uni.$emit('onPageScroll', e.detail);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './recharge-pay.css';
|
||||
</style>
|
||||
137
pages/plugins/coin/recharge/recharge.css
Normal file
137
pages/plugins/coin/recharge/recharge.css
Normal file
@@ -0,0 +1,137 @@
|
||||
/*
|
||||
* 顶部
|
||||
*/
|
||||
.recharge-title {
|
||||
background: radial-gradient(60% 70% at 90% 79%, rgba(33, 125, 239, 0.85) 0%, #A6C8F3 100%);
|
||||
padding-top: 130rpx;
|
||||
/* #ifndef H5 */
|
||||
padding-top: calc(var(--status-bar-height) + 5px + 130rpx);
|
||||
/* #endif */
|
||||
}
|
||||
|
||||
.coin-dropdown {
|
||||
--height: 48rpx;
|
||||
display: inline-block;
|
||||
height: var(--height);
|
||||
line-height: var(--height);
|
||||
padding: 0 64rpx 0 32rpx;
|
||||
background: rgba(255, 255, 255, 0.23);
|
||||
border-radius: 12px;
|
||||
}
|
||||
|
||||
.coin-dropdown-icon {
|
||||
right: -36rpx;
|
||||
top: 2rpx;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.recharge-qrcode {
|
||||
background-color: #fff;
|
||||
border-radius: 40rpx;
|
||||
text-align: center;
|
||||
padding: 20rpx;
|
||||
}
|
||||
|
||||
.recharge-qrcode .img {
|
||||
width: 160rpx !important;
|
||||
height: 160rpx !important;
|
||||
}
|
||||
|
||||
/*
|
||||
* 内容
|
||||
*/
|
||||
.recharge-content {
|
||||
margin-top: -32rpx;
|
||||
border-radius: 32rpx 32rpx 0 0;
|
||||
min-height: calc(100vh - 528rpx);
|
||||
/* #ifndef H5 */
|
||||
min-height: calc(100vh - 528rpx - var(--status-bar-height) - 5px);
|
||||
/* #endif */
|
||||
}
|
||||
|
||||
.recharge-content-input-bg {
|
||||
background-color: #fafafc;
|
||||
}
|
||||
|
||||
.recharge-price-item {
|
||||
--size: -10rpx;
|
||||
margin-left: var(--size);
|
||||
margin-right: var(--size);
|
||||
width: calc(100% - var(--size));
|
||||
}
|
||||
|
||||
.recharge-price-list {
|
||||
background: #F5F7F9;
|
||||
border: 2rpx solid #F5F7F9;
|
||||
border-radius: 16rpx;
|
||||
padding: 20rpx 0;
|
||||
margin: 18rpx 10rpx;
|
||||
width: calc((100% / 3) - 24rpx);
|
||||
}
|
||||
|
||||
.recharge-price-badge {
|
||||
background: linear-gradient(107deg, #8A18DF 0%, #8D17DD 100%), #D8D8D8;
|
||||
border-radius: 16rpx 0px 16rpx 0px;
|
||||
padding: 2rpx 20rpx;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: -20rpx;
|
||||
max-width: calc(100% - 20px);
|
||||
}
|
||||
|
||||
.recharge-price-list.active {
|
||||
background: rgba(8, 140, 226, 0.06);
|
||||
border-radius: 8px;
|
||||
border: 1px solid #2FB0FB;
|
||||
}
|
||||
|
||||
.recharge-price-name {
|
||||
font-size: 44rpx;
|
||||
}
|
||||
|
||||
.recharge-price-img {
|
||||
--size: 36rpx;
|
||||
width: var(--size);
|
||||
height: var(--size) !important;
|
||||
}
|
||||
|
||||
.recharge-btn {
|
||||
background: linear-gradient(107deg, #31B4FC 0%, #0842E2 100%);
|
||||
transition: all 0.3s ease-in-out;
|
||||
}
|
||||
|
||||
.recharge-btn:active {
|
||||
background: linear-gradient(107deg, #168ACA 0%, #022A97 100%);
|
||||
}
|
||||
|
||||
.recharge-content-tips .item::before {
|
||||
content: '';
|
||||
width: 12rpx;
|
||||
height: 12rpx;
|
||||
border-radius: 12rpx;
|
||||
background: #30B3FC;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 12rpx;
|
||||
}
|
||||
|
||||
.coin-content-list-img {
|
||||
--size: 28rpx;
|
||||
width: var(--size);
|
||||
height: var(--size) !important;
|
||||
}
|
||||
|
||||
/*
|
||||
* 虚拟币弹窗
|
||||
*/
|
||||
.popup_coin_status_container .scroll-y {
|
||||
height: 40vh;
|
||||
overflow-y: auto;
|
||||
padding-right: 20rpx;
|
||||
}
|
||||
|
||||
.coin-list-img {
|
||||
--size: 40rpx;
|
||||
width: var(--size);
|
||||
height: var(--size) !important;
|
||||
}
|
||||
338
pages/plugins/coin/recharge/recharge.vue
Normal file
338
pages/plugins/coin/recharge/recharge.vue
Normal file
@@ -0,0 +1,338 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<component-nav-back></component-nav-back>
|
||||
<block v-if="accounts_list.length > 0">
|
||||
<scroll-view :scroll-y="true" class="scroll-box" lower-threshold="60" @scroll="scroll_event">
|
||||
<view class="recharge-title flex-col padding-lg">
|
||||
<view v-if="(accounts || mull) != null" class="margin-bottom-xxxl flex-row jc-sb margin-top-xl">
|
||||
<view class="cr-white flex-1 flex-width">
|
||||
<view class="coin-dropdown margin-bottom-main">
|
||||
<view class="flex-row align-c pr" @tap="popup_coin_status_open_event">
|
||||
<image v-if="(accounts.platform_icon || null) != null" :src="accounts.platform_icon" mode="widthFix" class="coin-content-list-img round" />
|
||||
<text class="margin-left-xs">{{ accounts.platform_name }}</text>
|
||||
<view class="coin-dropdown-icon pa padding-left-xxl">
|
||||
<iconfont name="icon-arrow-bottom" size="24rpx" color="#fff"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="text-size-xl fw-b single-text">{{ accounts.normal_coin }}</view>
|
||||
</view>
|
||||
<view class="recharge-qrcode">
|
||||
<block v-if="accounts.platform_data.recharge_qrcode">
|
||||
<image :src="accounts.platform_data.recharge_qrcode" mode="widthFix" class="img margin-right-xs radius dis-block" :data-value="accounts.platform_data.recharge_qrcode" @tap="recharge_qrcode_event" />
|
||||
</block>
|
||||
<block v-else>
|
||||
<iconfont name="icon-qrcode" size="160rpx" color="#f6f6f6"></iconfont>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="recharge-content padding-xxl bg-white">
|
||||
<view class="margin-bottom-xxxl">
|
||||
<view class="margin-bottom-main">{{$t('recharge.recharge.lh6k86')}}</view>
|
||||
<view class="recharge-content-input-bg padding-main border-radius-sm flex-row align-c">
|
||||
<view class="single-text padding-right-sm flex-1 flex-width">{{ accounts.platform_data.recharge_address }}</view>
|
||||
<view :data-value="accounts.platform_data.recharge_address" @tap.stop="text_copy_event">
|
||||
<iconfont name="icon-copy" size="24rpx" color="#999"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="margin-bottom-xxxl">
|
||||
<view class="margin-bottom-main">{{$t('recharge.recharge.e5rblc')}}</view>
|
||||
<block v-if="network_list.length > 0">
|
||||
<picker class="recharge-content-input-bg padding-main border-radius-sm" @change="recharge_event" :value="network_list_index" :range="network_list" range-key="name">
|
||||
<view class="picker arrow-bottom">
|
||||
{{ network_list[network_list_index]['name'] }}
|
||||
</view>
|
||||
</picker>
|
||||
</block>
|
||||
<view v-else class="cr-grey">{{$t('cash.cash.1g49wo')}}</view>
|
||||
</view>
|
||||
<view class="margin-bottom-xxxl">
|
||||
<view v-if="accounts.platform_data.preset_data.length > 0">
|
||||
<view class="margin-bottom-xs">{{$t('recharge.recharge.eb6722')}}</view>
|
||||
<view class="flex-row flex-wrap recharge-price-item margin-bottom-xs">
|
||||
<block v-for="(item, index) in accounts.platform_data.preset_data" :key="index">
|
||||
<view class="recharge-price-list flex-col align-c jc-c pr" :class="preset_data_index == index ? 'active' : ''" :data-index="index" :data-value="item.value" @tap="preset_data_change">
|
||||
<view class="flex-row align-c jc-c">
|
||||
<image :src="wallet_static_url + 'recharge-price.png'" mode="widthFix" class="recharge-price-img round" />
|
||||
<view class="margin-left-xs recharge-price-name">{{ item.value }}</view>
|
||||
</view>
|
||||
<view class="margin-top-sm cr-grey-9 text-size-xs">10000</view>
|
||||
<view v-if="item.tips" class="recharge-price-badge text-size-xss cr-white single-text">{{ item.tips }}</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
<view class="recharge-content-input-bg padding-main border-radius-sm flex-row align-c margin-bottom-xxl">
|
||||
<text>{{$t('recharge.recharge.k1e7hs')}}</text>
|
||||
<view class="padding-left-lg">
|
||||
<input type="digit" name="coin" :value="recharge_num" placeholder-class="text-size-md cr-grey-9" :placeholder="$t('recharge.recharge.0i541i')" @input="recharge_num_change" />
|
||||
</view>
|
||||
</view>
|
||||
<button type="default" class="recharge-btn cr-white round" @tap="recharge_submit">{{$t('recharge.recharge.x27b25')}}</button>
|
||||
</view>
|
||||
<view v-if="accounts.platform_data.recharge_desc.length > 0" class="margin-bottom-xxxl">
|
||||
<view class="margin-bottom-main">{{$t('recharge.recharge.e8n7ul')}}</view>
|
||||
<view class="recharge-content-tips">
|
||||
<view v-for="(item, index) in accounts.platform_data.recharge_desc" :key="index" class="item pr padding-left-xl margin-bottom-sm cr-grey-9 text-size-xs">{{ item }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<!-- 虚拟币下拉框 -->
|
||||
<component-popup :propShow="popup_coin_status" propPosition="bottom" @onclose="popup_coin_status_close_event">
|
||||
<view class="padding-horizontal-main padding-top-main bg-white">
|
||||
<view class="oh">
|
||||
<view class="fr" @tap.stop="popup_coin_status_close_event">
|
||||
<iconfont name="icon-close-o" size="28rpx" color="#999"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
<view class="popup_coin_status_container padding-vertical-main flex-col text-size">
|
||||
<view class="scroll-y">
|
||||
<view v-for="(item, index) in accounts_list" :key="index" class="flex-row jc-sb align-c padding-vertical-main" :class="accounts_list.length == index + 1 ? '' : 'br-b-f9'" :data-value="item" :data-index="index" @tap="coin_checked_event">
|
||||
<view class="flex-row align-c">
|
||||
<image v-if="item.platform_icon" :src="item.platform_icon" mode="widthFix" class="coin-list-img round" />
|
||||
<view class="margin-left-sm text-size-md single-text">{{ item.platform_name }}</view>
|
||||
</view>
|
||||
<view>
|
||||
<iconfont :name="accounts.id == item.id ? 'icon-zhifu-yixuan cr-red' : 'icon-zhifu-weixuan'" size="40rpx"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
</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 componentNavBack from '@/components/nav-back/nav-back';
|
||||
import componentNoData from '@/components/no-data/no-data';
|
||||
import componentPopup from '@/components/popup/popup';
|
||||
var wallet_static_url = app.globalData.get_static_url('coin', true) + 'app/';
|
||||
// 状态栏高度
|
||||
var bar_height = parseInt(app.globalData.get_system_info('statusBarHeight', 0, true));
|
||||
// #ifdef MP-TOUTIAO
|
||||
bar_height = 0;
|
||||
// #endif
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
wallet_static_url: wallet_static_url,
|
||||
status_bar_height: bar_height,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
params: {},
|
||||
|
||||
// 账户
|
||||
accounts: {},
|
||||
// 虚拟币下拉框探弹窗状态
|
||||
popup_coin_status: false,
|
||||
// 虚拟币下拉框list
|
||||
accounts_list: [],
|
||||
// 充币网络
|
||||
network_list_index: 0,
|
||||
network_list: [],
|
||||
// 充值选中下标
|
||||
preset_data_index: null,
|
||||
// 充值数量
|
||||
recharge_num: '',
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNavBack,
|
||||
componentNoData,
|
||||
componentPopup,
|
||||
},
|
||||
|
||||
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.get_data();
|
||||
},
|
||||
methods: {
|
||||
init(e) {
|
||||
var user = app.globalData.get_user_info(this, 'init');
|
||||
if (user != false) {
|
||||
this.get_data();
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('createinfo', 'recharge', 'coin'),
|
||||
method: 'POST',
|
||||
data: {accounts_id : this.accounts.id || this.params.id || null},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
this.setData({
|
||||
accounts: data.accounts || {},
|
||||
accounts_list: data.accounts_list || [],
|
||||
network_list: data.network_list || [],
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: 3,
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
app.globalData.is_login_check(res.data, this, 'get_data');
|
||||
}
|
||||
},
|
||||
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'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 虚拟币切换
|
||||
coin_checked_event(e) {
|
||||
this.setData({
|
||||
accounts: this.accounts_list[e.currentTarget.dataset.index],
|
||||
popup_coin_status: false,
|
||||
});
|
||||
this.get_data();
|
||||
},
|
||||
popup_coin_status_open_event() {
|
||||
this.setData({
|
||||
popup_coin_status: !this.popup_coin_status,
|
||||
});
|
||||
},
|
||||
popup_coin_status_close_event() {
|
||||
this.setData({
|
||||
popup_coin_status: false,
|
||||
});
|
||||
},
|
||||
// 充币网络切换
|
||||
recharge_event(e) {
|
||||
this.setData({
|
||||
network_list_index: parseInt(e.detail.value || 0),
|
||||
});
|
||||
},
|
||||
// 充值币选中
|
||||
recharge_num_change(e) {
|
||||
this.setData({
|
||||
recharge_num: e.detail.value,
|
||||
});
|
||||
},
|
||||
// 其他充值数量
|
||||
preset_data_change(e) {
|
||||
this.setData({
|
||||
preset_data_index: parseInt(e.currentTarget.dataset.index || 0),
|
||||
recharge_num: parseInt(e.currentTarget.dataset.value || 0),
|
||||
});
|
||||
},
|
||||
// 立即充值
|
||||
recharge_submit() {
|
||||
if(this.network_list.length == 0) {
|
||||
app.globalData.showToast(this.$t('cash.cash.en6vsa'));
|
||||
return false;
|
||||
}
|
||||
|
||||
// 表单数据
|
||||
var new_data = {
|
||||
accounts_id: this.accounts.id,
|
||||
network_id: this.network_list[this.network_list_index].id,
|
||||
address: this.accounts.platform_data.recharge_address,
|
||||
coin: this.recharge_num,
|
||||
};
|
||||
// 数据校验
|
||||
var validation = [{ fields: 'coin', msg: this.$t('recharge.recharge.5q02ar') }];
|
||||
|
||||
// 验证提交表单
|
||||
if (app.globalData.fields_check(new_data, validation)) {
|
||||
uni.showLoading({
|
||||
title: this.$t('common.processing_in_text'),
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('create', 'recharge', 'coin'),
|
||||
method: 'POST',
|
||||
data: new_data,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
app.globalData.showToast(res.data.msg, 'success');
|
||||
setTimeout(function () {
|
||||
app.globalData.url_open('/pages/plugins/coin/recharge-list/recharge-list', true);
|
||||
}, 1000);
|
||||
} 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.stopPullDownRefresh();
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
// 页面滚动监听
|
||||
scroll_event(e) {
|
||||
uni.$emit('onPageScroll', e.detail);
|
||||
},
|
||||
|
||||
// 复制文本
|
||||
text_copy_event(e) {
|
||||
app.globalData.text_copy_event(e);
|
||||
},
|
||||
|
||||
// 二维码预览
|
||||
recharge_qrcode_event(e) {
|
||||
app.globalData.image_show_event(e);
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './recharge.css';
|
||||
</style>
|
||||
18
pages/plugins/coin/transaction-list/transaction-list.css
Normal file
18
pages/plugins/coin/transaction-list/transaction-list.css
Normal file
@@ -0,0 +1,18 @@
|
||||
.transaction .nav {
|
||||
z-index: 102;
|
||||
}
|
||||
.scroll-box {
|
||||
height: calc(100vh - 88rpx);
|
||||
}
|
||||
|
||||
.convert-group-row .title {
|
||||
min-width: 140rpx;
|
||||
}
|
||||
|
||||
/*
|
||||
* 钱包弹窗
|
||||
*/
|
||||
.popup_accounts_container .item {
|
||||
background-color: #f4f4f4;
|
||||
border-radius: 30rpx;
|
||||
}
|
||||
537
pages/plugins/coin/transaction-list/transaction-list.vue
Normal file
537
pages/plugins/coin/transaction-list/transaction-list.vue
Normal file
@@ -0,0 +1,537 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view class="transaction">
|
||||
<view class="padding-main bg-white pr nav flex-row oa">
|
||||
<view class="flex-shrink flex-row align-c margin-right-xxxl padding-right-xl pr" @tap="popup_accounts_open_event">
|
||||
<view>{{ accounts_name !== null && accounts_name !== $t('common.all') ? accounts_name : $t('cash-list.cash-list.n74r94') }}</view>
|
||||
<view class="pa right-0"><iconfont :name="popup_accounts_status ? 'icon-arrow-top' : 'icon-arrow-bottom'" size="24rpx"></iconfont></view>
|
||||
</view>
|
||||
<view class="flex-shrink flex-row align-c margin-right-xxxl padding-right-xl pr" @tap="popup_operate_type_open_event">
|
||||
<view>{{ operate_type_name !== null && operate_type_name !== $t('common.all') ? operate_type_name : $t('wallet-log-detail.wallet-log-detail.tdf3wo') }}</view>
|
||||
<view class="pa right-0"><iconfont :name="popup_operate_type_status ? 'icon-arrow-top' : 'icon-arrow-bottom'" size="24rpx"></iconfont></view>
|
||||
</view>
|
||||
<view class="flex-shrink flex-row align-c margin-right-xxxl padding-right-xl pr" @tap="popup_business_type_open_event">
|
||||
<view>{{ business_type_name !== null && business_type_name !== $t('common.all') ? business_type_name : $t('invoice.invoice.l3832z') }}</view>
|
||||
<view class="pa right-0"><iconfont :name="popup_business_type_status ? 'icon-arrow-top' : 'icon-arrow-bottom'" size="24rpx"></iconfont></view>
|
||||
</view>
|
||||
<view class="flex-shrink flex-row align-c padding-right-xl pr" @tap="popup_coin_type_open_event">
|
||||
<view>{{ coin_type_name !== null && coin_type_name !== $t('common.all') ? coin_type_name : $t('transaction-list.transaction-list.cu39n5') }}</view>
|
||||
<view class="pa right-0"><iconfont :name="popup_coin_type_status ? 'icon-arrow-top' : 'icon-arrow-bottom'" size="24rpx"></iconfont></view>
|
||||
</view>
|
||||
</view>
|
||||
<scroll-view :scroll-y="true" class="scroll-box" lower-threshold="60" @scroll="scroll_event">
|
||||
<view class="padding-main">
|
||||
<view v-if="data_list.length > 0">
|
||||
<view v-for="(item, index) in data_list" :key="index" class="padding-main bg-white radius-md margin-bottom-main">
|
||||
<view class="br-b-dashed padding-bottom-main margin-bottom-main flex-row jc-sb align-c">
|
||||
<view>{{ item.business_type_name }}</view>
|
||||
<view class="cr-grey-9">{{ item.add_time }}</view>
|
||||
</view>
|
||||
<view class="convert-group-row">
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('transaction-list.transaction-list.1mf6wj')}}</text>
|
||||
<text class="fw-b warp">{{ item.coin_type_name }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('detail.detail.4w20tq')}}</text>
|
||||
<text class="fw-b warp">{{ item.operate_type_name }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('transaction-list.transaction-list.2w1o1l')}}</text>
|
||||
<text class="fw-b warp">{{ item.operate_coin }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('transaction-list.transaction-list.jgx0cf')}}</text>
|
||||
<text class="fw-b warp">{{ item.original_coin }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('convert-list.convert-list.6347mw')}}</text>
|
||||
<text class="fw-b warp">{{ item.latest_coin }}</text>
|
||||
</view>
|
||||
<view class="flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('transaction-list.transaction-list.7cv11k')}}</text>
|
||||
<text class="fw-b warp">{{ item.msg }}</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>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<!-- 账户 -->
|
||||
<component-popup :propShow="popup_accounts_status" propPosition="top" :propTop="popup_top_height + 'px'" @onclose="popup_accounts_close_event">
|
||||
<view class="padding-vertical-lg">
|
||||
<view class="padding-horizontal-main text-size-xs">{{$t('cash-list.cash-list.s7l616')}}</view>
|
||||
<view class="popup_accounts_container padding-sm flex-row flex-wrap align-c tc text-size-md">
|
||||
<view class="flex-width-half-half">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="accounts_list_index == null ? 'cr-main bg-main-light' : ''" :data-name="$t('common.all')" :data-value="null" :data-index="null" @tap="accounts_list_event">{{$t('common.all')}}</view>
|
||||
</view>
|
||||
<view v-for="(item, index) in accounts_list" class="flex-width-half-half" :key="index">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="accounts_list_index == index ? 'cr-main bg-main-light' : ''" :data-name="item.platform_name" :data-value="item.id" :data-index="index" @tap="accounts_list_event">{{ item.platform_name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tc padding-top-lg br-t" @tap="popup_accounts_close_event">
|
||||
<text class="padding-right-sm">{{ $t('nav-more.nav-more.h9g4b1') }}</text>
|
||||
<iconfont name="icon-arrow-top" color="#ccc"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
<!-- 操作类型 -->
|
||||
<component-popup :propShow="popup_operate_type_status" propPosition="top" :propTop="popup_top_height + 'px'" @onclose="popup_operate_type_close_event">
|
||||
<view class="padding-vertical-lg">
|
||||
<view class="padding-horizontal-main text-size-xs">{{$t('wallet-log-detail.wallet-log-detail.tdf3wo')}}</view>
|
||||
<view class="popup_accounts_container padding-sm flex-row flex-wrap align-c tc text-size-md">
|
||||
<view class="flex-width-half-half">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="operate_type_list_index == null ? 'cr-main bg-main-light' : ''" :data-name="$t('common.all')" :data-value="null" :data-index="null" @tap="operate_type_list_event">{{$t('common.all')}}</view>
|
||||
</view>
|
||||
<view v-for="(item, index) in operate_type_list" class="flex-width-half-half" :key="index">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="operate_type_list_index == index ? 'cr-main bg-main-light' : ''" :data-name="item.name" :data-value="item.value" :data-index="index" @tap="operate_type_list_event">{{ item.name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tc padding-top-lg br-t" @tap="popup_operate_type_close_event">
|
||||
<text class="padding-right-sm">{{ $t('nav-more.nav-more.h9g4b1') }}</text>
|
||||
<iconfont name="icon-arrow-top" color="#ccc"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
<!-- 业务类型 -->
|
||||
<component-popup :propShow="popup_business_type_status" propPosition="top" :propTop="popup_top_height + 'px'" @onclose="popup_business_type_close_event">
|
||||
<view class="padding-vertical-lg">
|
||||
<view class="padding-horizontal-main text-size-xs">{{$t('invoice.invoice.l3832z')}}</view>
|
||||
<view class="popup_accounts_container padding-sm flex-row flex-wrap align-c tc text-size-md">
|
||||
<view class="flex-width-half-half">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="business_type_list_index == null ? 'cr-main bg-main-light' : ''" :data-name="$t('common.all')" :data-value="null" :data-index="null" @tap="business_type_list_event">{{$t('common.all')}}</view>
|
||||
</view>
|
||||
<view v-for="(item, index) in business_type_list" class="flex-width-half-half" :key="index">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="business_type_list_index == index ? 'cr-main bg-main-light' : ''" :data-name="item.name" :data-value="item.value" :data-index="index" @tap="business_type_list_event">{{ item.name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tc padding-top-lg br-t" @tap="popup_business_type_close_event">
|
||||
<text class="padding-right-sm">{{ $t('nav-more.nav-more.h9g4b1') }}</text>
|
||||
<iconfont name="icon-arrow-top" color="#ccc"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
<!-- 币类型 -->
|
||||
<component-popup :propShow="popup_coin_type_status" propPosition="top" :propTop="popup_top_height + 'px'" @onclose="popup_coin_type_close_event">
|
||||
<view class="padding-vertical-lg">
|
||||
<view class="padding-horizontal-main text-size-xs">{{$t('transaction-list.transaction-list.cu39n5')}}</view>
|
||||
<view class="popup_accounts_container padding-sm flex-row flex-wrap align-c tc text-size-md">
|
||||
<view class="flex-width-half-half">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="coin_type_list_index == null ? 'cr-main bg-main-light' : ''" :data-name="$t('common.all')" :data-value="null" :data-index="null" @tap="coin_type_list_event">{{$t('common.all')}}</view>
|
||||
</view>
|
||||
<view v-for="(item, index) in coin_type_list" class="flex-width-half-half" :key="index">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="coin_type_list_index == index ? 'cr-main bg-main-light' : ''" :data-name="item.name" :data-value="item.value" :data-index="index" @tap="coin_type_list_event">{{ item.name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tc padding-top-lg br-t" @tap="popup_coin_type_close_event">
|
||||
<text class="padding-right-sm">{{ $t('nav-more.nav-more.h9g4b1') }}</text>
|
||||
<iconfont name="icon-arrow-top" color="#ccc"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
</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 componentPopup from '@/components/popup/popup';
|
||||
import componentBottomLine from '@/components/bottom-line/bottom-line';
|
||||
var accounts_static_url = app.globalData.get_static_url('coin', true) + 'app/';
|
||||
// 状态栏高度
|
||||
var bar_height = parseInt(app.globalData.get_system_info('statusBarHeight', 0, true));
|
||||
// #ifdef MP-TOUTIAO
|
||||
bar_height = 0;
|
||||
// #endif
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
accounts_static_url: accounts_static_url,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
data_bottom_line_status: false,
|
||||
params: {},
|
||||
|
||||
// 弹窗距离顶部距离
|
||||
popup_top_height: 0,
|
||||
|
||||
// 账户
|
||||
popup_accounts_status: false,
|
||||
accounts_id: null,
|
||||
accounts_list_index: null,
|
||||
accounts_name: null,
|
||||
accounts_list: [],
|
||||
// 操作类型
|
||||
popup_operate_type_status: false,
|
||||
operate_type: null,
|
||||
operate_type_list_index: null,
|
||||
operate_type_name: null,
|
||||
operate_type_list: [],
|
||||
// 业务类型
|
||||
popup_business_type_status: false,
|
||||
business_type: null,
|
||||
business_type_list_index: null,
|
||||
business_type_name: null,
|
||||
business_type_list: [],
|
||||
// 币类型
|
||||
popup_coin_type_status: false,
|
||||
coin_type: null,
|
||||
coin_type_list_index: null,
|
||||
coin_type_name: null,
|
||||
coin_type_list: [],
|
||||
|
||||
data_list: [],
|
||||
data_page_total: 0,
|
||||
data_page: 1,
|
||||
data_is_loading: 0,
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentPopup,
|
||||
componentBottomLine,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: params,
|
||||
accounts_id: params.id || null,
|
||||
});
|
||||
},
|
||||
|
||||
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.setData({
|
||||
data_page: 1,
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
methods: {
|
||||
init(e) {
|
||||
var user = app.globalData.get_user_info(this, 'init');
|
||||
if (user != false) {
|
||||
this.get_data();
|
||||
this.get_data_list();
|
||||
var self = this;
|
||||
var timer = setInterval(function () {
|
||||
if (self.popup_top_height == 0) {
|
||||
self.popup_top_height_computer();
|
||||
} else {
|
||||
clearInterval(timer);
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
},
|
||||
|
||||
// 初始化数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('init', 'user', 'coin'),
|
||||
method: 'POST',
|
||||
data: {},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
this.setData({
|
||||
accounts_list: data.accounts_list || [],
|
||||
operate_type_list: data.log_operate_type_list || [],
|
||||
business_type_list: data.log_business_type_list || [],
|
||||
coin_type_list: data.log_coin_type_list || [],
|
||||
});
|
||||
if (this.accounts_list.length > 0 && (this.accounts_id || null) != null) {
|
||||
var index = this.accounts_list.findIndex((item) => item.id == this.accounts_id);
|
||||
this.setData({
|
||||
accounts_list_index: index,
|
||||
accounts_id: this.accounts_list[index].id,
|
||||
accounts_name: this.accounts_list[index].platform_name,
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if (app.globalData.is_login_check(res.data, this, 'get_data_list')) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.stopPullDownRefresh();
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
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 new_data = {
|
||||
accounts_id: this.accounts_id,
|
||||
business_type: this.business_type,
|
||||
operate_type: this.operate_type,
|
||||
coin_type: this.coin_type,
|
||||
page: this.data_page,
|
||||
};
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('index', 'accountslog', 'coin'),
|
||||
method: 'POST',
|
||||
data: new_data,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
if (this.data_page > 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
// 数据列表
|
||||
var data = res.data.data;
|
||||
if (this.data_page <= 1) {
|
||||
var temp_data_list = data.data_list || [];
|
||||
} else {
|
||||
var temp_data_list = this.data_list || [];
|
||||
var temp_data = data.data_list;
|
||||
for (var i in temp_data) {
|
||||
temp_data_list.push(temp_data[i]);
|
||||
}
|
||||
}
|
||||
|
||||
this.setData({
|
||||
data_list: temp_data_list,
|
||||
data_total: data.total,
|
||||
data_page_total: data.page_total,
|
||||
data_list_loding_status: temp_data_list.length > 0 ? 3 : 0,
|
||||
data_list_loding_msg: '',
|
||||
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: 2,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
if (this.data_page > 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_is_loading: 0,
|
||||
data_list_loding_msg: this.$t('common.internet_error_tips'),
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 账户打开
|
||||
popup_accounts_open_event() {
|
||||
this.setData({
|
||||
popup_accounts_status: !this.popup_accounts_status,
|
||||
popup_operate_type_status: false,
|
||||
popup_business_type_status: false,
|
||||
popup_coin_type_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 账户关闭
|
||||
popup_accounts_close_event() {
|
||||
this.setData({
|
||||
popup_accounts_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 账户选择
|
||||
accounts_list_event(e) {
|
||||
this.setData({
|
||||
accounts_list_index: e.currentTarget.dataset.index,
|
||||
accounts_id: e.currentTarget.dataset.value,
|
||||
accounts_name: e.currentTarget.dataset.name,
|
||||
popup_accounts_status: false,
|
||||
data_page: 1,
|
||||
data_list: [],
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// 操作类型打开
|
||||
popup_operate_type_open_event() {
|
||||
this.setData({
|
||||
popup_operate_type_status: !this.popup_operate_type_status,
|
||||
popup_accounts_status: false,
|
||||
popup_business_type_status: false,
|
||||
popup_coin_type_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 操作类型关闭
|
||||
popup_operate_type_close_event() {
|
||||
this.setData({
|
||||
popup_operate_type_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 操作类型选择
|
||||
operate_type_list_event(e) {
|
||||
this.setData({
|
||||
operate_type_list_index: e.currentTarget.dataset.index,
|
||||
operate_type: e.currentTarget.dataset.value,
|
||||
operate_type_name: e.currentTarget.dataset.name,
|
||||
popup_operate_type_status: false,
|
||||
data_page: 1,
|
||||
data_list: [],
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// 业务类型打开
|
||||
popup_business_type_open_event() {
|
||||
this.setData({
|
||||
popup_business_type_status: !this.popup_business_type_status,
|
||||
popup_accounts_status: false,
|
||||
popup_operate_type_status: false,
|
||||
popup_coin_type_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 业务类型关闭
|
||||
popup_business_type_close_event() {
|
||||
this.setData({
|
||||
popup_business_type_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 业务类型选择
|
||||
business_type_list_event(e) {
|
||||
this.setData({
|
||||
business_type_list_index: e.currentTarget.dataset.index,
|
||||
business_type: e.currentTarget.dataset.value,
|
||||
business_type_name: e.currentTarget.dataset.name,
|
||||
popup_business_type_status: false,
|
||||
data_page: 1,
|
||||
data_list: [],
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// 币类型打开
|
||||
popup_coin_type_open_event() {
|
||||
this.setData({
|
||||
popup_coin_type_status: !this.popup_coin_type_status,
|
||||
popup_accounts_status: false,
|
||||
popup_operate_type_status: false,
|
||||
popup_business_type_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 币类型关闭
|
||||
popup_coin_type_close_event() {
|
||||
this.setData({
|
||||
popup_coin_type_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 币类型选择
|
||||
coin_type_list_event(e) {
|
||||
this.setData({
|
||||
coin_type_list_index: e.currentTarget.dataset.index,
|
||||
coin_type: e.currentTarget.dataset.value,
|
||||
coin_type_name: e.currentTarget.dataset.name,
|
||||
popup_coin_type_status: false,
|
||||
data_page: 1,
|
||||
data_list: [],
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// 计算搜索框的高度
|
||||
popup_top_height_computer() {
|
||||
const query = uni.createSelectorQuery();
|
||||
query
|
||||
.select('.nav')
|
||||
.boundingClientRect((res) => {
|
||||
if ((res || null) != null) {
|
||||
// 获取搜索框高度
|
||||
this.setData({
|
||||
popup_top_height: res.height,
|
||||
});
|
||||
}
|
||||
})
|
||||
.exec();
|
||||
},
|
||||
|
||||
// 页面滚动监听
|
||||
scroll_event(e) {
|
||||
uni.$emit('onPageScroll', e.detail);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './transaction-list.css';
|
||||
</style>
|
||||
18
pages/plugins/coin/transfer-list/transfer-list.css
Normal file
18
pages/plugins/coin/transfer-list/transfer-list.css
Normal file
@@ -0,0 +1,18 @@
|
||||
.transfer-accounts .nav {
|
||||
z-index: 102;
|
||||
}
|
||||
.scroll-box {
|
||||
height: calc(100vh - 88rpx);
|
||||
}
|
||||
|
||||
.convert-group-row .title {
|
||||
min-width: 140rpx;
|
||||
}
|
||||
|
||||
/*
|
||||
* 钱包弹窗
|
||||
*/
|
||||
.popup_accounts_container .item {
|
||||
background-color: #f4f4f4;
|
||||
border-radius: 30rpx;
|
||||
}
|
||||
342
pages/plugins/coin/transfer-list/transfer-list.vue
Normal file
342
pages/plugins/coin/transfer-list/transfer-list.vue
Normal file
@@ -0,0 +1,342 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view class="transfer-accounts">
|
||||
<view class="padding-main bg-white pr nav flex-row oa">
|
||||
<view class="flex-shrink flex-row align-c padding-right-xl pr" @tap="popup_accounts_open_event">
|
||||
<view>{{ accounts_name !== null && accounts_name !== $t('common.all') ? accounts_name : $t('cash-list.cash-list.n74r94') }}</view>
|
||||
<view class="pa right-0"><iconfont :name="popup_accounts_status ? 'icon-arrow-top' : 'icon-arrow-bottom'" size="24rpx"></iconfont></view>
|
||||
</view>
|
||||
</view>
|
||||
<scroll-view :scroll-y="true" class="scroll-box" lower-threshold="60" @scroll="scroll_event" @scrolltolower="scroll_lower">
|
||||
<view class="padding-main">
|
||||
<view v-if="data_list.length > 0">
|
||||
<view v-for="(item, index) in data_list" :key="index" class="padding-main bg-white radius-md margin-bottom-main">
|
||||
<view class="br-b-dashed padding-bottom-main margin-bottom-main flex-row jc-sb align-c">
|
||||
<view>{{$t('user-transfer-detail.user-transfer-detail.x17599')}}</view>
|
||||
<view class="cr-grey-9">{{ item.add_time }}</view>
|
||||
</view>
|
||||
<view class="convert-group-row">
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('transfer-list.transfer-list.69rnx6')}}</text>
|
||||
<text class="fw-b warp">{{ item.transfer_no }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('transfer-list.transfer-list.4aj248')}}</text>
|
||||
<text class="fw-b warp">{{ item.receive_user.username }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('transfer-list.transfer-list.m2r55k')}}</text>
|
||||
<text class="fw-b warp">{{ item.coin }}</text>
|
||||
</view>
|
||||
<view class="flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('transfer-list.transfer-list.9g8lyb')}}</text>
|
||||
<text class="fw-b warp">{{ item.note }}</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>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<!-- 账户 -->
|
||||
<component-popup :propShow="popup_accounts_status" propPosition="top" :propTop="popup_top_height + 'px'" @onclose="popup_accounts_close_event">
|
||||
<view class="padding-vertical-lg">
|
||||
<view class="padding-horizontal-main text-size-xs">{{$t('cash-list.cash-list.s7l616')}}</view>
|
||||
<view class="popup_accounts_container padding-sm flex-row flex-wrap align-c tc text-size-md">
|
||||
<view class="flex-width-half-half">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="accounts_list_index == null ? 'cr-main bg-main-light' : ''" :data-name="$t('common.all')" :data-value="null" :data-index="null" @tap="accounts_list_event">{{$t('common.all')}}</view>
|
||||
</view>
|
||||
<view v-for="(item, index) in accounts_list" class="flex-width-half-half" :key="index">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="accounts_list_index == index ? 'cr-main bg-main-light' : ''" :data-name="item.platform_name" :data-value="item.id" :data-index="index" @tap="accounts_list_event">{{ item.platform_name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tc padding-top-lg br-t" @tap="popup_accounts_close_event">
|
||||
<text class="padding-right-sm">{{ $t('nav-more.nav-more.h9g4b1') }}</text>
|
||||
<iconfont name="icon-arrow-top" color="#ccc"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
</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 componentPopup from '@/components/popup/popup';
|
||||
import componentBottomLine from '@/components/bottom-line/bottom-line';
|
||||
var accounts_static_url = app.globalData.get_static_url('coin', true) + 'app/';
|
||||
// 状态栏高度
|
||||
var bar_height = parseInt(app.globalData.get_system_info('statusBarHeight', 0, true));
|
||||
// #ifdef MP-TOUTIAO
|
||||
bar_height = 0;
|
||||
// #endif
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
accounts_static_url: accounts_static_url,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
data_bottom_line_status: false,
|
||||
params: {},
|
||||
|
||||
// 弹窗距离顶部距离
|
||||
popup_top_height: 0,
|
||||
|
||||
// 账户
|
||||
popup_accounts_status: false,
|
||||
accounts_id: null,
|
||||
accounts_list_index: null,
|
||||
accounts_name: null,
|
||||
accounts_list: [],
|
||||
|
||||
data_list: [],
|
||||
data_page_total: 0,
|
||||
data_page: 1,
|
||||
data_is_loading: 0,
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentPopup,
|
||||
componentBottomLine,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: params,
|
||||
accounts_id: params.id || null,
|
||||
});
|
||||
},
|
||||
|
||||
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.setData({
|
||||
data_page: 1,
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
methods: {
|
||||
init(e) {
|
||||
var user = app.globalData.get_user_info(this, 'init');
|
||||
if (user != false) {
|
||||
this.get_data();
|
||||
this.get_data_list();
|
||||
var self = this;
|
||||
var timer = setInterval(function () {
|
||||
if (self.popup_top_height == 0) {
|
||||
self.popup_top_height_computer();
|
||||
} else {
|
||||
clearInterval(timer);
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
},
|
||||
// 初始化数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('init', 'user', 'coin'),
|
||||
method: 'POST',
|
||||
data: {},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
this.setData({
|
||||
accounts_list: data.accounts_list || [],
|
||||
});
|
||||
if (this.accounts_list.length > 0 && (this.accounts_id || null) != null) {
|
||||
var index = data.accounts_list.findIndex((item) => item.id == this.accounts_id);
|
||||
this.setData({
|
||||
accounts_list_index: index,
|
||||
accounts_id: this.accounts_list[index].id,
|
||||
accounts_name: this.accounts_list[index].platform_name,
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if (app.globalData.is_login_check(res.data, this, 'get_data_list')) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.stopPullDownRefresh();
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
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 new_data = {
|
||||
send_accounts_id: this.accounts_id,
|
||||
page: this.data_page,
|
||||
};
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('index', 'transfer', 'coin'),
|
||||
method: 'POST',
|
||||
data: new_data,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
if (this.data_page > 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
// 数据列表
|
||||
var data = res.data.data;
|
||||
if (this.data_page <= 1) {
|
||||
var temp_data_list = data.data_list || [];
|
||||
} else {
|
||||
var temp_data_list = this.data_list || [];
|
||||
var temp_data = data.data_list;
|
||||
for (var i in temp_data) {
|
||||
temp_data_list.push(temp_data[i]);
|
||||
}
|
||||
}
|
||||
|
||||
this.setData({
|
||||
data_list: temp_data_list,
|
||||
data_total: data.total,
|
||||
data_page_total: data.page_total,
|
||||
data_list_loding_status: temp_data_list.length > 0 ? 3 : 0,
|
||||
data_list_loding_msg: '',
|
||||
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: 2,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
if (this.data_page > 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_is_loading: 0,
|
||||
data_list_loding_msg: this.$t('common.internet_error_tips'),
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 账户打开
|
||||
popup_accounts_open_event() {
|
||||
this.setData({
|
||||
popup_accounts_status: !this.popup_accounts_status,
|
||||
});
|
||||
},
|
||||
|
||||
// 账户关闭
|
||||
popup_accounts_close_event() {
|
||||
this.setData({
|
||||
popup_accounts_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 账户选择
|
||||
accounts_list_event(e) {
|
||||
this.setData({
|
||||
accounts_list_index: e.currentTarget.dataset.index,
|
||||
accounts_id: e.currentTarget.dataset.value,
|
||||
accounts_name: e.currentTarget.dataset.name,
|
||||
popup_accounts_status: false,
|
||||
data_page: 1,
|
||||
data_list: [],
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// 计算搜索框的高度
|
||||
popup_top_height_computer() {
|
||||
const query = uni.createSelectorQuery();
|
||||
query
|
||||
.select('.nav')
|
||||
.boundingClientRect((res) => {
|
||||
if ((res || null) != null) {
|
||||
// 获取搜索框高度
|
||||
this.setData({
|
||||
popup_top_height: res.height,
|
||||
});
|
||||
}
|
||||
})
|
||||
.exec();
|
||||
},
|
||||
|
||||
// 页面滚动监听
|
||||
scroll_event(e) {},
|
||||
|
||||
// 滚动加载
|
||||
scroll_lower(e) {
|
||||
this.get_data_list();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './transfer-list.css';
|
||||
</style>
|
||||
19
pages/plugins/coin/transfer/transfer.css
Normal file
19
pages/plugins/coin/transfer/transfer.css
Normal file
@@ -0,0 +1,19 @@
|
||||
.note {
|
||||
background-color: #fafafc;
|
||||
}
|
||||
|
||||
.accounts-btn,
|
||||
.transfer-btn {
|
||||
background: linear-gradient(107deg, #31B4FC 0%, #0842E2 100%);
|
||||
}
|
||||
|
||||
.accounts-btn,
|
||||
.transfer-btn:active {
|
||||
background: linear-gradient(107deg, #168ACA 0%, #022A97 100%);
|
||||
}
|
||||
|
||||
.coin-content-list-img {
|
||||
--size: 80rpx;
|
||||
width: var(--size);
|
||||
height: var(--size) !important;
|
||||
}
|
||||
260
pages/plugins/coin/transfer/transfer.vue
Normal file
260
pages/plugins/coin/transfer/transfer.vue
Normal file
@@ -0,0 +1,260 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view v-if="data_list_loding_status == 3" class="transfer">
|
||||
<view class="padding-main">
|
||||
<view class="bg-white padding-main radius-md margin-bottom-main">
|
||||
<view class="padding-vertical-sm border-radius-sm flex-row align-c">
|
||||
<view class="flex-row">
|
||||
<image v-if="accounts.platform_icon" :src="accounts.platform_icon" mode="widthFix" class="coin-content-list-img round" />
|
||||
<view class="padding-left-main">
|
||||
<view class="coin-dropdown text-size-md pr margin-bottom-xs flex-row">
|
||||
<text class="cr-666">{{ accounts.platform_name }}</text>
|
||||
</view>
|
||||
<view class="fw-b text-size">{{ accounts.platform_symbol }} {{ accounts.normal_coin }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bg-white padding-main radius-md margin-bottom-main">
|
||||
<view class="padding-vertical-sm flex-row align-c">
|
||||
<iconfont name="icon-scan" size="40rpx" @tap="scancode_event"></iconfont>
|
||||
<view class="padding-left-lg flex-row jc-sb align-c flex-1 flex-width">
|
||||
<view class="flex-1 padding-right-main">
|
||||
<input type="text" name="receive_accounts_key" :value="receive_accounts_key" placeholder-class="text-size-md cr-grey-9" :placeholder="$t('transfer.transfer.1aijp1')" @input="receive_accounts_key_change" />
|
||||
</view>
|
||||
<button type="default" class="accounts-btn text-size-xs cr-white round" @tap="receive_accounts_key_event">{{$t('common.confirm')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bg-white padding-main radius-md margin-bottom-main">
|
||||
<view class="padding-vertical-sm">
|
||||
<text class="text-size fw-b">{{$t('transfer.transfer.b4m5p3')}}</text>
|
||||
<view class="margin-top-xxxxl">
|
||||
<input type="digit" name="coin" :value="coin" class="text-size-xl tc" placeholder-class="cr-grey-9" :placeholder="$t('transfer.transfer.d15853')" @input="coin_change" />
|
||||
<view class="cr-grey-9 tc margin-top-main">{{$t('transfer.transfer.9xe2bl')}}<text class="cr-black fw-b">{{ accounts.platform_symbol }} {{ accounts.default_coin }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="note padding-main radius margin-top-xxxl">
|
||||
<input type="text" name="note" :value="note" placeholder-class="text-size-md cr-grey-9" :placeholder="$t('transfer.transfer.2bwh7h')" @input="note_change" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="padding-main bg-white radius-md">
|
||||
<view class="padding-vertical-sm border-radius-sm flex-row align-c">
|
||||
<text class="text-size fw-b">转账密码</text>
|
||||
<view class="padding-left-lg">
|
||||
<input type="password" name="pay_pwd" :value="pay_pwd" placeholder-class="text-size-md cr-grey-9" placeholder="请输入支付密码" @input="pwd_num_change" />
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="padding-xxxl margin-top-sm">
|
||||
<button type="default" class="transfer-btn cr-white round" @tap="transfer_event">{{$t('transfer.transfer.3i4h4z')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<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 accounts_static_url = app.globalData.get_static_url('coin', true) + 'app/';
|
||||
// 状态栏高度
|
||||
var bar_height = parseInt(app.globalData.get_system_info('statusBarHeight', 0, true));
|
||||
// #ifdef MP-TOUTIAO
|
||||
bar_height = 0;
|
||||
// #endif
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
accounts_static_url: accounts_static_url,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
|
||||
accounts_id: null,
|
||||
receive_accounts_key: null,
|
||||
receive_accounts_id: null,
|
||||
accounts: {},
|
||||
receive_accounts: {},
|
||||
coin: null,
|
||||
note: '',
|
||||
// pay_pwd: '',
|
||||
};
|
||||
},
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
// 设置参数
|
||||
this.setData({
|
||||
accounts_id: params.id,
|
||||
});
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle();
|
||||
|
||||
// 初始数据
|
||||
this.init();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.get_data();
|
||||
},
|
||||
methods: {
|
||||
init(e) {
|
||||
var user = app.globalData.get_user_info(this, 'init');
|
||||
if (user != false) {
|
||||
this.get_data();
|
||||
}
|
||||
},
|
||||
// 初始化数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('createinfo', 'transfer', 'coin'),
|
||||
method: 'POST',
|
||||
data: { accounts_id: this.accounts_id, accounts_key: this.receive_accounts_key },
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
this.setData({
|
||||
accounts: data.accounts || {},
|
||||
receive_accounts: data.receive_accounts || {},
|
||||
receive_accounts_id: data.receive_accounts ? data.receive_accounts.id : null,
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: 3,
|
||||
});
|
||||
} 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'));
|
||||
},
|
||||
});
|
||||
},
|
||||
scancode_event() {
|
||||
// 调用扫码
|
||||
var self = this;
|
||||
uni.scanCode({
|
||||
success: function (res) {
|
||||
self.setData({
|
||||
receive_accounts_key: res.result,
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
// 收款账号
|
||||
receive_accounts_key_change(e) {
|
||||
this.setData({
|
||||
receive_accounts_key: e.detail.value,
|
||||
});
|
||||
},
|
||||
// 确认收款账号
|
||||
receive_accounts_key_event() {
|
||||
this.get_data();
|
||||
},
|
||||
// 转账币
|
||||
coin_change(e) {
|
||||
this.setData({
|
||||
coin: e.detail.value,
|
||||
});
|
||||
},
|
||||
// 备注
|
||||
note_change(e) {
|
||||
this.setData({
|
||||
note: e.detail.value,
|
||||
});
|
||||
},
|
||||
// 转账密码
|
||||
pwd_num_change(e) {
|
||||
this.setData({
|
||||
pwd_num: e.detail.value,
|
||||
});
|
||||
},
|
||||
// 立即转账
|
||||
transfer_event(e) {
|
||||
var new_data = {
|
||||
receive_accounts_id: this.receive_accounts_id,
|
||||
coin: this.coin,
|
||||
note: this.note,
|
||||
// pwd_num: this.pwd_num,
|
||||
};
|
||||
// 数据校验
|
||||
var validation = [
|
||||
{ fields: 'receive_accounts_key', msg: this.$t('transfer.transfer.1aijp1') },
|
||||
{ fields: 'coin', msg: this.$t('transfer.transfer.d15853') },
|
||||
];
|
||||
// 验证提交表单
|
||||
if (app.globalData.fields_check(new_data, validation)) {
|
||||
uni.showLoading({
|
||||
title: this.$t('common.processing_in_text'),
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('create', 'transfer', 'coin'),
|
||||
method: 'POST',
|
||||
data: new_data,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
app.globalData.showToast(res.data.msg, 'success');
|
||||
setTimeout(function () {
|
||||
app.globalData.url_open('/pages/plugins/coin/transfer-list/transfer-list', true);
|
||||
}, 1000);
|
||||
} 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.stopPullDownRefresh();
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './transfer.css';
|
||||
</style>
|
||||
43
pages/plugins/coin/user/user.css
Normal file
43
pages/plugins/coin/user/user.css
Normal file
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* 顶部
|
||||
*/
|
||||
.coin-title {
|
||||
background-size: 100% auto;
|
||||
padding-top: 130rpx;
|
||||
/* #ifndef H5 */
|
||||
padding-top: calc(var(--status-bar-height) + 5px + 130rpx);
|
||||
/* #endif */
|
||||
border-bottom-left-radius: 60rpx;
|
||||
border-bottom-right-radius: 60rpx;
|
||||
}
|
||||
|
||||
.coin-operate-list {
|
||||
--size: 96rpx;
|
||||
width: var(--size);
|
||||
height: var(--size);
|
||||
border-radius: 32rpx;
|
||||
}
|
||||
|
||||
/*
|
||||
* 内容
|
||||
*/
|
||||
.coin-content .coin-item {
|
||||
max-height: calc(100vh - 688rpx);
|
||||
/* #ifndef H5 */
|
||||
max-height: calc(100vh - 688rpx - var(--status-bar-height) - 5px);
|
||||
/* #endif */
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.coin-content-list-img {
|
||||
--size: 80rpx;
|
||||
width: var(--size);
|
||||
height: var(--size) !important;
|
||||
}
|
||||
|
||||
/*
|
||||
* 明细弹窗
|
||||
*/
|
||||
.popup_user_detail_container .item {
|
||||
background: #EFF0F1;
|
||||
}
|
||||
257
pages/plugins/coin/user/user.vue
Normal file
257
pages/plugins/coin/user/user.vue
Normal file
@@ -0,0 +1,257 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<component-nav-back></component-nav-back>
|
||||
<view v-if="(data_base || null) != null">
|
||||
<scroll-view :scroll-y="true" class="scroll-box" lower-threshold="60" @scroll="scroll_event">
|
||||
<view class="coin-title flex-col padding-lg" :style="'background-image:url(' + wallet_static_url + 'user-head-bg.png)'">
|
||||
<view class="margin-bottom-main flex-row jc-sb align-c">
|
||||
<view>
|
||||
<view class="cr-base text-size-md">{{$t('user.user.67p34x')}}</view>
|
||||
<view class="text-size-40 fw-b">{{ is_price_show ? accounts_summary : '***' }}</view>
|
||||
</view>
|
||||
<view @tap="price_change">
|
||||
<iconfont :name="is_price_show ? 'icon-wodeqianbao-eye' : 'icon-eye-half'" size="44rpx"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex-row jc-sb padding-bottom-main">
|
||||
<view v-if="data_base.is_enable_recharge == 1" class="tc text-size-xs" data-value="/pages/plugins/coin/recharge/recharge" @tap="url_event">
|
||||
<view class="coin-operate-list bg-white flex-row align-c jc-c margin-bottom-main">
|
||||
<iconfont name="icon-recharge" size="44rpx" color="#635BFF"></iconfont>
|
||||
</view>
|
||||
<view>{{$t('recharge.recharge.otwkjn')}}</view>
|
||||
</view>
|
||||
<view v-if="data_base.is_enable_convert == 1" class="tc text-size-xs" data-value="/pages/plugins/coin/convert/convert" @tap="url_event">
|
||||
<view class="coin-operate-list bg-white flex-row align-c jc-c margin-bottom-main">
|
||||
<iconfont name="icon-convert-o" size="44rpx" color="#635BFF"></iconfont>
|
||||
</view>
|
||||
<view>{{$t('pages.plugins-coin-convert')}}</view>
|
||||
</view>
|
||||
<view v-if="data_base.is_enable_cash == 1" class="tc text-size-xs" data-value="/pages/plugins/coin/cash/cash" @tap="url_event">
|
||||
<view class="coin-operate-list bg-white flex-row align-c jc-c margin-bottom-main">
|
||||
<iconfont name="icon-cash" size="44rpx" color="#635BFF"></iconfont>
|
||||
</view>
|
||||
<view>{{$t('user.user.8752a4')}}</view>
|
||||
</view>
|
||||
<view class="tc text-size-xs" data-value="/pages/plugins/coin/detail/detail" data-method="true" @tap="url_event">
|
||||
<view class="coin-operate-list bg-white flex-row align-c jc-c margin-bottom-main">
|
||||
<iconfont name="icon-detail" size="44rpx" color="#635BFF"></iconfont>
|
||||
</view>
|
||||
<view>{{$t('pages.plugins-coin-detail')}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="accounts_list.length > 0" class="coin-content padding-lg">
|
||||
<view class="bg-white radius-lg padding-sm">
|
||||
<view class="coin-item padding-main">
|
||||
<view v-for="(item, index) in accounts_list" :key="index" class="flex-row jc-sb align-c" :class="accounts_list.length == index + 1 ? '' : 'br-b-f5 margin-bottom-lg padding-bottom-lg'" :data-value="'/pages/plugins/coin/detail/detail?id=' + item.id" @tap="url_event">
|
||||
<view class="flex-1 flex-width flex-row align-c padding-right-main">
|
||||
<image v-if="item.platform_icon" :src="item.platform_icon" mode="widthFix" class="coin-content-list-img round" />
|
||||
<text class="fw-b single-text margin-left-main">{{ item.platform_name }}</text>
|
||||
</view>
|
||||
<view class="flex-col align-e">
|
||||
<view class="margin-bottom-xss text-size">{{ item.platform_symbol }} {{ item.normal_coin }}</view>
|
||||
<view class="cr-grey-9 text-size-xs">{{ item.default_symbol }} {{ item.default_coin }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data propStatus="0"></component-no-data>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<!-- 明细 -->
|
||||
<component-popup :propShow="popup_user_detail_status" propPosition="bottom" @onclose="popup_user_detail_close_event">
|
||||
<view class="padding-horizontal-main padding-top-main bg-white">
|
||||
<view class="oh">
|
||||
<text class="text-size">{{$t('pages.plugins-coin-detail')}}</text>
|
||||
<view class="fr" @tap.stop="popup_user_detail_close_event">
|
||||
<iconfont name="icon-close-o" size="28rpx" color="#999"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
<view class="popup_user_detail_container padding-vertical-main flex-row flex-wrap align-c tc text-size">
|
||||
<view class="flex-width-half">
|
||||
<view class="item padding-vertical-lg radius margin-sm" data-value="/pages/plugins/coin/recharge-list/recharge-list" @tap="url_event">{{$t('pages.plugins-coin-recharge-list')}}</view>
|
||||
</view>
|
||||
<view class="flex-width-half">
|
||||
<view class="item padding-vertical-lg radius margin-sm" data-value="/pages/plugins/coin/transfer-list/transfer-list" @tap="url_event">{{$t('pages.plugins-coin-transfer-list')}}</view>
|
||||
</view>
|
||||
<view class="flex-width-half">
|
||||
<view class="item padding-vertical-lg radius margin-sm" data-value="/pages/plugins/coin/transaction-list/transaction-list" @tap="url_event">{{$t('pages.plugins-coin-transaction-list')}}</view>
|
||||
</view>
|
||||
<view class="flex-width-half">
|
||||
<view class="item padding-vertical-lg radius margin-sm" data-value="/pages/plugins/coin/cash-list/cash-list" @tap="url_event">{{$t('pages.plugins-coin-cash-list')}}</view>
|
||||
</view>
|
||||
<view class="flex-width-half">
|
||||
<view class="item padding-vertical-lg radius margin-sm" data-value="/pages/plugins/coin/convert-list/convert-list" @tap="url_event">{{$t('pages.plugins-coin-convert-list')}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</component-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 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 componentBottomLine from '@/components/bottom-line/bottom-line';
|
||||
var wallet_static_url = app.globalData.get_static_url('coin', true) + 'app/';
|
||||
// 状态栏高度
|
||||
var bar_height = parseInt(app.globalData.get_system_info('statusBarHeight', 0, true));
|
||||
// #ifdef MP-TOUTIAO
|
||||
bar_height = 0;
|
||||
// #endif
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
wallet_static_url: wallet_static_url,
|
||||
status_bar_height: bar_height,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
data_bottom_line_status: false,
|
||||
|
||||
// 是否显示虚拟币
|
||||
is_price_show: false,
|
||||
data_base: null,
|
||||
// 虚拟币数量
|
||||
accounts_summary: 0,
|
||||
accounts_list: [],
|
||||
// 明细弹窗
|
||||
popup_user_detail_status: false,
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNavBack,
|
||||
componentNoData,
|
||||
componentPopup,
|
||||
componentBottomLine,
|
||||
},
|
||||
|
||||
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.get_data();
|
||||
},
|
||||
methods: {
|
||||
init(e) {
|
||||
var user = app.globalData.get_user_info(this, 'init');
|
||||
if (user != false) {
|
||||
this.get_data();
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('index', 'user', 'coin'),
|
||||
method: 'POST',
|
||||
data: {},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
this.setData({
|
||||
data_base: data.base || null,
|
||||
accounts_list: data.accounts_list || [],
|
||||
accounts_summary: data.accounts_summary || 0,
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: 3,
|
||||
data_bottom_line_status: false,
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
data_bottom_line_status: false,
|
||||
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_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'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 显示隐藏虚拟币
|
||||
price_change() {
|
||||
this.setData({
|
||||
is_price_show: !this.is_price_show,
|
||||
});
|
||||
},
|
||||
|
||||
// 明细弹窗打开
|
||||
popup_user_detail_open_event() {
|
||||
this.setData({
|
||||
popup_user_detail_status: true,
|
||||
});
|
||||
},
|
||||
// 明细弹窗关闭
|
||||
popup_user_detail_close_event(e) {
|
||||
this.setData({
|
||||
popup_user_detail_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 页面滚动监听
|
||||
scroll_event(e) {
|
||||
uni.$emit('onPageScroll', e.detail);
|
||||
},
|
||||
|
||||
// url事件
|
||||
url_event(e) {
|
||||
if (e.currentTarget.dataset.method) {
|
||||
this.popup_user_detail_open_event();
|
||||
} else {
|
||||
app.globalData.url_event(e);
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './user.css';
|
||||
</style>
|
||||
206
pages/plugins/coupon/detail/detail.vue
Normal file
206
pages/plugins/coupon/detail/detail.vue
Normal file
@@ -0,0 +1,206 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view v-if="(data_base || null) != null" class="ht bg-white">
|
||||
<view class="plugins-coupon-container">
|
||||
<view class="coupon-content padding-top-main page-bottom-fixed">
|
||||
<!-- 优惠劵列表 -->
|
||||
<block v-if="(data || null) != null">
|
||||
<component-coupon-card :propData="data" :propStatusType="data.status_type" :propStatusOperableName="data.status_operable_name" propIndex="0" propIsProgress @call-back="coupon_receive_event"></component-coupon-card>
|
||||
</block>
|
||||
<block v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
</block>
|
||||
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottom-fixed">
|
||||
<view class="bottom-line-exclude">
|
||||
<button class="item round cr-main bg-white br-main text-size wh-auto" type="default" hover-class="none" data-value="/pages/plugins/coupon/user/user" @tap="url_event">{{$t('index.index.lk0i6c')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<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';
|
||||
import componentCouponCard from '@/components/coupon-card/coupon-card.vue';
|
||||
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: '',
|
||||
params: {},
|
||||
data: null,
|
||||
data_base: null,
|
||||
// 优惠劵领取
|
||||
temp_coupon_receive_index: null,
|
||||
temp_coupon_receive_value: null,
|
||||
// 自定义分享信息
|
||||
share_info: {},
|
||||
};
|
||||
},
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
componentCouponCard,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: app.globalData.launch_params_handle(params),
|
||||
});
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 数据加载
|
||||
this.get_data();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
},
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.get_data();
|
||||
},
|
||||
methods: {
|
||||
// 获取数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('detail', 'index', 'coupon'),
|
||||
method: 'POST',
|
||||
data: this.params,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
this.setData({
|
||||
data_base: data.base || null,
|
||||
data: data.data || null,
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: 3,
|
||||
data_bottom_line_status: false,
|
||||
});
|
||||
if ((this.data || null) != null) {
|
||||
// 基础自定义分享
|
||||
this.setData({
|
||||
share_info: {
|
||||
title: this.data.name,
|
||||
desc: this.data.desc,
|
||||
path: '/pages/plugins/coupon/detail/detail',
|
||||
query: 'id='+this.data.id
|
||||
},
|
||||
});
|
||||
|
||||
// 导航名称
|
||||
uni.setNavigationBarTitle({
|
||||
title: this.data.name,
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 0,
|
||||
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'),
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
// 优惠劵领取事件
|
||||
coupon_receive_event(index, value) {
|
||||
if (!app.globalData.is_single_page_check()) {
|
||||
return false;
|
||||
}
|
||||
// 参数处理
|
||||
if ((index || null) == null && (value || null) == null) {
|
||||
var index = this.temp_coupon_receive_index;
|
||||
var value = this.temp_coupon_receive_value;
|
||||
} else {
|
||||
this.setData({
|
||||
temp_coupon_receive_index: index,
|
||||
temp_coupon_receive_value: value,
|
||||
});
|
||||
}
|
||||
// 登录校验
|
||||
var user = app.globalData.get_user_info(this, 'coupon_receive_event');
|
||||
if (user != false) {
|
||||
var data = this.data;
|
||||
if (data['is_operable'] != 0) {
|
||||
uni.showLoading({
|
||||
title: this.$t('common.processing_in_text'),
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('receive', 'coupon', 'coupon'),
|
||||
method: 'POST',
|
||||
data: {
|
||||
coupon_id: value,
|
||||
},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
app.globalData.showToast(res.data.msg, 'success');
|
||||
data = res.data.data.coupon;
|
||||
this.setData({
|
||||
data_list: data,
|
||||
});
|
||||
} else {
|
||||
if (app.globalData.is_login_check(res.data, this, 'coupon_receive_event')) {
|
||||
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 scoped>
|
||||
</style>
|
||||
38
pages/plugins/coupon/index/index.css
Normal file
38
pages/plugins/coupon/index/index.css
Normal file
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
* 领券中心
|
||||
*/
|
||||
.plugins-coupon-container {
|
||||
padding-top: 408rpx;
|
||||
height: calc(100vh - 500rpx - var(--status-bar-height) - 5px);
|
||||
/* #ifdef H5 */
|
||||
padding-top: 408rpx;
|
||||
height: calc(100vh - 560rpx);
|
||||
/* #endif */
|
||||
}
|
||||
|
||||
.coupon-content {
|
||||
border-top: 42rpx solid #fff;
|
||||
border-radius: 32rpx 32rpx 0 0;
|
||||
min-height: calc(100% - 42rpx);
|
||||
}
|
||||
|
||||
.coupon-content .item {
|
||||
padding: 0 24rpx 24rpx 24rpx;
|
||||
}
|
||||
|
||||
.popup-btn {
|
||||
border: 2rpx solid #FF6E01;
|
||||
color: #FF6E01;
|
||||
border-radius: 22px;
|
||||
font-size: 32rpx;
|
||||
padding: 20rpx 0;
|
||||
}
|
||||
|
||||
@media screen and (min-width: 960px) {
|
||||
.plugins-coupon-container {
|
||||
/* #ifdef H5 */
|
||||
padding-top: 450px;
|
||||
height: calc(100vh - 525px);
|
||||
/* #endif */
|
||||
}
|
||||
}
|
||||
231
pages/plugins/coupon/index/index.vue
Normal file
231
pages/plugins/coupon/index/index.vue
Normal file
@@ -0,0 +1,231 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<block v-if="(data_base || null) != null">
|
||||
<component-nav-back :propName="data_base.application_name || $t('index.index.p4872s')"></component-nav-back>
|
||||
<view class="pr">
|
||||
<view class="pa top-0 bg-img wh-auto">
|
||||
<image class="wh-auto dis-block" :src="data_base.app_banner_images || coupon_static_url + 'coupon-bg.png'" mode="widthFix" :data-value="data_base.url || ''" @tap="url_event"></image>
|
||||
</view>
|
||||
<view class="plugins-coupon-container">
|
||||
<view class="coupon-content bg-white pr page-bottom-fixed">
|
||||
<!-- 优惠劵列表 -->
|
||||
<view v-if="data_list.length > 0" class="flex-col">
|
||||
<block v-for="(item, index) in data_list" :key="index">
|
||||
<component-coupon-card :propData="item" :propStatusType="item.status_type" :propStatusOperableName="item.status_operable_name" :propIndex="index" propIsProgress @call-back="coupon_receive_event"></component-coupon-card>
|
||||
</block>
|
||||
</view>
|
||||
<block v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
</block>
|
||||
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottom-fixed">
|
||||
<view class="bottom-line-exclude">
|
||||
<button class="item round cr-main bg-white br-main text-size wh-auto" type="default" hover-class="none" data-value="/pages/plugins/coupon/user/user" @tap="url_event">{{$t('index.index.lk0i6c')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</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 componentNavBack from '@/components/nav-back/nav-back';
|
||||
import componentNoData from '@/components/no-data/no-data';
|
||||
import componentBottomLine from '@/components/bottom-line/bottom-line';
|
||||
import componentCouponCard from '@/components/coupon-card/coupon-card.vue';
|
||||
var coupon_static_url = app.globalData.get_static_url('coupon', true);
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
coupon_static_url: coupon_static_url + 'app/',
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
data_list: [],
|
||||
data_base: null,
|
||||
// 优惠劵领取
|
||||
temp_coupon_receive_index: null,
|
||||
temp_coupon_receive_value: null,
|
||||
// 自定义分享信息
|
||||
share_info: {},
|
||||
};
|
||||
},
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNavBack,
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
componentCouponCard,
|
||||
},
|
||||
|
||||
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();
|
||||
}
|
||||
},
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.get_data_list();
|
||||
},
|
||||
methods: {
|
||||
// 获取数据
|
||||
init() {
|
||||
this.get_data_list();
|
||||
},
|
||||
// 获取数据
|
||||
get_data_list() {
|
||||
if (this.data_list.length <= 0) {
|
||||
this.setData({
|
||||
data_list_loding_status: 1,
|
||||
});
|
||||
}
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('index', 'index', 'coupon'),
|
||||
method: 'POST',
|
||||
data: {},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
var status = (data.data || []).length > 0;
|
||||
this.setData({
|
||||
data_base: data.base || null,
|
||||
data_list: data.data || [],
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: status ? 3 : 0,
|
||||
data_bottom_line_status: status,
|
||||
});
|
||||
if ((this.data_base || null) != null) {
|
||||
// 基础自定义分享
|
||||
this.setData({
|
||||
share_info: {
|
||||
title: this.data_base.seo_title || this.data_base.application_name,
|
||||
desc: this.data_base.seo_desc,
|
||||
path: '/pages/plugins/coupon/index/index',
|
||||
},
|
||||
});
|
||||
|
||||
// #ifndef MP-ALIPAY
|
||||
// 导航名称
|
||||
if ((this.data_base.application_name || null) != null) {
|
||||
uni.setNavigationBarTitle({
|
||||
title: this.data_base.application_name,
|
||||
});
|
||||
}
|
||||
// #endif
|
||||
}
|
||||
} 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'),
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
// 优惠劵领取事件
|
||||
coupon_receive_event(index, value) {
|
||||
if (!app.globalData.is_single_page_check()) {
|
||||
return false;
|
||||
}
|
||||
// 参数处理
|
||||
if ((index || null) == null && (value || null) == null) {
|
||||
var index = this.temp_coupon_receive_index;
|
||||
var value = this.temp_coupon_receive_value;
|
||||
} else {
|
||||
this.setData({
|
||||
temp_coupon_receive_index: index,
|
||||
temp_coupon_receive_value: value,
|
||||
});
|
||||
}
|
||||
// 登录校验
|
||||
var user = app.globalData.get_user_info(this, 'coupon_receive_event');
|
||||
if (user != false) {
|
||||
var temp_list = this.data_list;
|
||||
if (temp_list[index]['is_operable'] != 0) {
|
||||
uni.showLoading({
|
||||
title: this.$t('common.processing_in_text'),
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('receive', 'coupon', 'coupon'),
|
||||
method: 'POST',
|
||||
data: {
|
||||
coupon_id: value,
|
||||
},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
app.globalData.showToast(res.data.msg, 'success');
|
||||
temp_list[index] = res.data.data.coupon;
|
||||
this.setData({
|
||||
data_list: temp_list,
|
||||
});
|
||||
} else {
|
||||
if (app.globalData.is_login_check(res.data, this, 'coupon_receive_event')) {
|
||||
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);
|
||||
},
|
||||
|
||||
// 页面滚动监听
|
||||
onPageScroll(res) {
|
||||
uni.$emit('onPageScroll', res);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
@import './index.css';
|
||||
</style>
|
||||
11
pages/plugins/coupon/shop/shop.css
Normal file
11
pages/plugins/coupon/shop/shop.css
Normal file
@@ -0,0 +1,11 @@
|
||||
/**
|
||||
* 领券中心
|
||||
*/
|
||||
.coupon-content .item {
|
||||
padding: 0 24rpx 24rpx 24rpx;
|
||||
}
|
||||
|
||||
.popup-bottom {
|
||||
box-shadow: inset 0px 1px 3px 0px rgba(0, 0, 0, 0.08);
|
||||
z-index: 2;
|
||||
}
|
||||
231
pages/plugins/coupon/shop/shop.vue
Normal file
231
pages/plugins/coupon/shop/shop.vue
Normal file
@@ -0,0 +1,231 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view class="plugins-coupon-container">
|
||||
<!-- 优惠劵列表 -->
|
||||
<view v-if="data_list.length > 0" class="coupon-content bg-white pr padding-top-main page-bottom-fixed">
|
||||
<view class="flex-col">
|
||||
<block v-for="(item, index) in data_list" :key="index">
|
||||
<component-coupon-card :propData="item" :propStatusType="item.status_type" :propStatusOperableName="item.status_operable_name" :propIndex="index" propIsProgress @call-back="coupon_receive_event"></component-coupon-card>
|
||||
</block>
|
||||
</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>
|
||||
</view>
|
||||
<!-- 回到店铺 -->
|
||||
<view v-if="(shop || null) != null" class="popup-bottom bottom-fixed bg-white">
|
||||
<view class="bottom-line-exclude">
|
||||
<button class="bg-white cr-main br-main round dis-block text-size" type="default" hover-class="none" :data-value="shop.url" @tap="shop_event">{{ $t('index.index.i78v36') }}</button>
|
||||
</view>
|
||||
</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 componentCouponCard from '@/components/coupon-card/coupon-card.vue';
|
||||
|
||||
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: '',
|
||||
params: null,
|
||||
data_list: [],
|
||||
data_base: null,
|
||||
shop: null,
|
||||
// 优惠劵领取
|
||||
temp_coupon_receive_index: null,
|
||||
temp_coupon_receive_value: null,
|
||||
// 自定义分享信息
|
||||
share_info: {},
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
componentCouponCard,
|
||||
},
|
||||
|
||||
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.get_data_list();
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 获取数据
|
||||
init() {
|
||||
this.get_data_list();
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data_list() {
|
||||
if (this.data_list.length <= 0) {
|
||||
this.setData({
|
||||
data_list_loding_status: 1,
|
||||
});
|
||||
}
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('shop', 'index', 'coupon'),
|
||||
method: 'POST',
|
||||
data: this.params,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
var status = (data.data || []).length > 0;
|
||||
this.setData({
|
||||
data_base: data.base || null,
|
||||
shop: data.shop || null,
|
||||
data_list: data.data || [],
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: status ? 3 : 0,
|
||||
data_bottom_line_status: status,
|
||||
});
|
||||
|
||||
if ((this.data_base || null) != null) {
|
||||
// 基础自定义分享
|
||||
this.setData({
|
||||
share_info: {
|
||||
title: this.data_base.seo_title || this.data_base.application_name,
|
||||
desc: this.data_base.seo_desc,
|
||||
path: '/pages/plugins/coupon/shop/shop',
|
||||
},
|
||||
});
|
||||
|
||||
// 导航名称
|
||||
if ((this.data_base.shop_application_name || null) != null) {
|
||||
uni.setNavigationBarTitle({
|
||||
title: this.data_base.shop_application_name,
|
||||
});
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
app.globalData.showToast(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'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 优惠劵领取事件
|
||||
coupon_receive_event(index, value) {
|
||||
if (!app.globalData.is_single_page_check()) {
|
||||
return false;
|
||||
}
|
||||
// 参数处理
|
||||
if ((index || null) == null && (value || null) == null) {
|
||||
var index = this.temp_coupon_receive_index;
|
||||
var value = this.temp_coupon_receive_value;
|
||||
} else {
|
||||
this.setData({
|
||||
temp_coupon_receive_index: index,
|
||||
temp_coupon_receive_value: value,
|
||||
});
|
||||
}
|
||||
// 登录校验
|
||||
var user = app.globalData.get_user_info(this, 'coupon_receive_event');
|
||||
if (user != false) {
|
||||
var temp_list = this.data_list;
|
||||
if (temp_list[index]['is_operable'] != 0) {
|
||||
uni.showLoading({
|
||||
title: this.$t('common.processing_in_text'),
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('receive', 'coupon', 'coupon'),
|
||||
method: 'POST',
|
||||
data: {
|
||||
coupon_id: value,
|
||||
},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
app.globalData.showToast(res.data.msg, 'success');
|
||||
temp_list[index] = res.data.data.coupon;
|
||||
this.setData({
|
||||
data_list: temp_list,
|
||||
});
|
||||
} else {
|
||||
if (app.globalData.is_login_check(res.data, this, 'coupon_receive_event')) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// 店铺事件
|
||||
shop_event(e) {
|
||||
var prev_url = app.globalData.prev_page();
|
||||
if (prev_url != null && prev_url.indexOf('pages/plugins/shop/detail/detail') != -1) {
|
||||
uni.navigateBack();
|
||||
} else {
|
||||
app.globalData.url_event(e);
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './shop.css';
|
||||
</style>
|
||||
15
pages/plugins/coupon/user/user.css
Normal file
15
pages/plugins/coupon/user/user.css
Normal file
@@ -0,0 +1,15 @@
|
||||
/*
|
||||
* 导航
|
||||
*/
|
||||
.nav-base .item {
|
||||
width: 33.33%;
|
||||
}
|
||||
|
||||
/*
|
||||
* 数据列表
|
||||
*/
|
||||
.plugins-coupon-container .item,
|
||||
.plugins-coupon-container .v-right,
|
||||
.plugins-coupon-container .v-right .circle {
|
||||
height: 230rpx;
|
||||
}
|
||||
197
pages/plugins/coupon/user/user.vue
Normal file
197
pages/plugins/coupon/user/user.vue
Normal file
@@ -0,0 +1,197 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<!-- 导航 -->
|
||||
<view class="nav-base bg-white">
|
||||
<block v-for="(item, index) in nav_tabs_list" :key="index">
|
||||
<view :class="'item fl tc cr-grey ' + (item.value == nav_tabs_value ? 'cr-main nav-active-line' : '')" :data-index="index" :data-value="item.value" @tap="nav_tabs_event">{{ item.name }} </view>
|
||||
</block>
|
||||
</view>
|
||||
<scroll-view :scroll-y="true" class="scroll-box scroll-box-ece-nav" lower-threshold="60">
|
||||
<!-- 优惠劵列表 -->
|
||||
<view v-if="data_list != null" class="plugins-coupon-container padding-top-main">
|
||||
<!-- 未使用 -->
|
||||
<block v-if="(data_list.not_use || null) != null && data_list.not_use.length > 0 && nav_tabs_value == 'not_use'">
|
||||
<block v-for="(item, index) in data_list.not_use" :key="index">
|
||||
<component-coupon-card :propData="item.coupon" :propStartTime="item.time_start_show_text" :propEndTime="item.time_end_show_text" :propStatusType="item.status_type" :propStatusOperableName="item.status_operable_name" propBg="#f5f5f5"></component-coupon-card>
|
||||
</block>
|
||||
</block>
|
||||
|
||||
<!-- 已使用 -->
|
||||
<block v-if="(data_list.already_use || null) != null && data_list.already_use.length > 0 && nav_tabs_value == 'already_use'">
|
||||
<block v-for="(item, index) in data_list.already_use" :key="index">
|
||||
<component-coupon-card :propData="item.coupon" :propStartTime="item.time_start_show_text" :propEndTime="item.time_end_show_text" :propStatusType="item.status_type" :propStatusOperableName="item.status_operable_name" propBg="#f5f5f5"></component-coupon-card>
|
||||
</block>
|
||||
</block>
|
||||
|
||||
<!-- 已过期 -->
|
||||
<block v-if="(data_list.already_expire || null) != null && data_list.already_expire.length > 0 && nav_tabs_value == 'already_expire'">
|
||||
<block v-for="(item, index) in data_list.already_expire" :key="index">
|
||||
<component-coupon-card :propData="item.coupon" :propStartTime="item.time_start_show_text" :propEndTime="item.time_end_show_text" :propStatusType="item.status_type" :propStatusOperableName="item.status_operable_name" propBg="#f5f5f5"></component-coupon-card>
|
||||
</block>
|
||||
</block>
|
||||
</view>
|
||||
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg" :propUrl="coupon_static_url + 'no-data.png'"></component-no-data>
|
||||
|
||||
<!-- 结尾 -->
|
||||
<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';
|
||||
import componentCouponCard from '@/components/coupon-card/coupon-card.vue';
|
||||
const coupon_static_url = app.globalData.get_static_url('coupon', true);
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
coupon_static_url: coupon_static_url + 'app/',
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
data_list: null,
|
||||
nav_tabs_list: [
|
||||
{
|
||||
name: this.$t('user.user.s3y4ji'),
|
||||
value: 'not_use',
|
||||
},
|
||||
{
|
||||
name: this.$t('user.user.pggs6s'),
|
||||
value: 'already_use',
|
||||
},
|
||||
{
|
||||
name: this.$t('user.user.528t26'),
|
||||
value: 'already_expire',
|
||||
},
|
||||
],
|
||||
nav_tabs_value: 'not_use',
|
||||
// 首页地址
|
||||
home_page_url: app.globalData.app_tabbar_pages()[0],
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
componentCouponCard,
|
||||
},
|
||||
|
||||
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_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,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data_list() {
|
||||
if (this.data_list == null || (this.data_list[this.nav_tabs_value] || null) == null || this.data_list[this.nav_tabs_value].length <= 0) {
|
||||
this.setData({
|
||||
data_list_loding_status: 1,
|
||||
});
|
||||
}
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('index', 'coupon', 'coupon'),
|
||||
method: 'POST',
|
||||
data: {},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
this.setData({
|
||||
data_list: res.data.data || null,
|
||||
data_list_loding_msg: this.$t('user.user.3ks1wi'),
|
||||
});
|
||||
this.data_view_handle();
|
||||
} 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_list')) {
|
||||
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'),
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 数据处理
|
||||
data_view_handle() {
|
||||
if(this.data_list_loding_status != 2) {
|
||||
var status = 0;
|
||||
if (this.data_list != null && (this.data_list[this.nav_tabs_value] || null) != null && this.data_list[this.nav_tabs_value].length > 0) {
|
||||
status = 3;
|
||||
}
|
||||
this.setData({
|
||||
data_list_loding_status: status,
|
||||
data_bottom_line_status: status == 3,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 导航事件
|
||||
nav_tabs_event(e) {
|
||||
this.setData({
|
||||
nav_tabs_value: e.currentTarget.dataset.value,
|
||||
});
|
||||
this.data_view_handle();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './user.css';
|
||||
</style>
|
||||
20
pages/plugins/delivery/logistics/logistics.css
Normal file
20
pages/plugins/delivery/logistics/logistics.css
Normal file
@@ -0,0 +1,20 @@
|
||||
.map-container {
|
||||
height: 100vh;
|
||||
}
|
||||
.team {
|
||||
left: 20rpx;
|
||||
bottom: calc(env(safe-area-inset-bottom) + 20rpx);
|
||||
width: calc(100% - 40rpx);
|
||||
background-color: rgb(255 255 255 / 0.85);
|
||||
}
|
||||
.team .base .avatar {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
}
|
||||
.team .tel {
|
||||
right: 20rpx;
|
||||
top: calc(50% - 27rpx);
|
||||
line-height: 54rpx;
|
||||
height: 54rpx;
|
||||
width: 54rpx;
|
||||
}
|
||||
169
pages/plugins/delivery/logistics/logistics.vue
Normal file
169
pages/plugins/delivery/logistics/logistics.vue
Normal file
@@ -0,0 +1,169 @@
|
||||
<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"
|
||||
:polyline="polyline"
|
||||
></map>
|
||||
<view class="team bs-bb oh pa border-radius-main padding-main">
|
||||
<view class="top pr">
|
||||
<view class="base">
|
||||
<image class="avatar circle br va-m" :src="team.work_photo" mode="aspectFit"></image>
|
||||
<text class="cr-base text-size-sm margin-left-sm">{{team.idcard_name}}</text>
|
||||
</view>
|
||||
<view v-if="(team.user.mobile || null) != null" class="tel circle bg-base br tc cp pa" data-event="tel" :data-value="team.user.mobile" @tap="text_event">
|
||||
<uni-icons type="phone" size="34rpx" color="#fd8008"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
<view class="br-t-dashed margin-top-sm padding-top-sm text-size-sm cr-base">
|
||||
<view>
|
||||
<text>{{$t('logistics.logistics.dxu6ql')}}</text>
|
||||
<text v-if="(start_delivery_time || null) != null">{{start_delivery_time}}</text>
|
||||
<text v-else class="cr-grey-9">{{$t('logistics.logistics.5542tq')}}</text>
|
||||
</view>
|
||||
<view class="margin-top-sm">
|
||||
<text>{{$t('logistics.logistics.895ug2')}}</text>
|
||||
<text v-if="(success_delivery_time || null) != null">{{success_delivery_time}}</text>
|
||||
<text v-else class="cr-grey-9">{{$t('logistics.logistics.76q0ii')}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</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";
|
||||
import componentBottomLine from "@/components/bottom-line/bottom-line";
|
||||
|
||||
var plugins_static_url = app.globalData.get_static_url('delivery', true);
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false,
|
||||
params: {},
|
||||
scale: 10,
|
||||
latitude: 39.909,
|
||||
longitude: 116.39742,
|
||||
markers: [],
|
||||
polyline: [],
|
||||
team: null,
|
||||
start_delivery_time: null,
|
||||
success_delivery_time: null,
|
||||
};
|
||||
},
|
||||
|
||||
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();
|
||||
}
|
||||
},
|
||||
|
||||
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() {
|
||||
this.setData({
|
||||
data_list_loding_status: 1,
|
||||
});
|
||||
// 获取数据
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("logistics", "order", "delivery"),
|
||||
method: "POST",
|
||||
data: this.params,
|
||||
dataType: "json",
|
||||
success: (res) => {
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
this.setData({
|
||||
latitude: data.latitude || 39.909,
|
||||
longitude: data.longitude || 116.39742,
|
||||
markers: data.markers || [],
|
||||
polyline: data.polyline || [],
|
||||
scale: data.scale || 10,
|
||||
team: data.team || null,
|
||||
start_delivery_time: data.start_delivery_time || null,
|
||||
success_delivery_time: data.success_delivery_time || null,
|
||||
data_list_loding_status: 3,
|
||||
data_list_loding_msg: ''
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_list_loding_msg: res.data.msg
|
||||
});
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
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'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 文本事件
|
||||
text_event(e) {
|
||||
app.globalData.text_event_handle(e);
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import "./logistics.css";
|
||||
</style>
|
||||
48
pages/plugins/delivery/order-detail/order-detail.css
Normal file
48
pages/plugins/delivery/order-detail/order-detail.css
Normal file
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* 商品信息
|
||||
*/
|
||||
.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;
|
||||
}
|
||||
|
||||
/**
|
||||
* 图片列表
|
||||
*/
|
||||
.images-list .item-images {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
}
|
||||
.images-list .item-images:not(:last-child) {
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
261
pages/plugins/delivery/order-detail/order-detail.vue
Normal file
261
pages/plugins/delivery/order-detail/order-detail.vue
Normal file
@@ -0,0 +1,261 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view v-if="detail != null">
|
||||
<view class="padding-horizontal-main padding-top-main">
|
||||
<!-- 发货地址 -->
|
||||
<view v-if="(detail.warehouse_address || null) != null" class="bg-white padding-main border-radius-main spacing-mb">
|
||||
<view class="br-b padding-bottom-sm fw-b text-size">{{$t('order.order.jhgfd1')}}</view>
|
||||
<view class="address-base oh margin-top-sm">
|
||||
<text v-if="(detail.warehouse_address.alias || null) != null" class="address-alias round br-main cr-main bg-white margin-right-sm">{{detail.warehouse_address.alias}}</text>
|
||||
<text data-event="copy" :data-value="detail.warehouse_address.name" @tap="text_event">{{detail.warehouse_address.name}}</text>
|
||||
<text class="fr" data-event="tel" :data-value="detail.warehouse_address.tel" @tap="text_event">{{detail.warehouse_address.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.warehouse_address.address_info" @tap="text_event">{{detail.warehouse_address.address_info}}</text>
|
||||
<text v-if="(detail.warehouse_address.lng || 0) != 0 && (detail.warehouse_address.lat || 0) != 0" class="address-map-submit cr-base br round bg-white margin-left-sm text-size-xs" @tap="address_map_event">{{$t('user-order-detail.user-order-detail.7lp6gw')}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="address-divider margin-bottom-sm"></view>
|
||||
</view>
|
||||
|
||||
<!-- 收货地址 -->
|
||||
<view v-if="(detail.user_address || null) != null" class="bg-white padding-main border-radius-main spacing-mb">
|
||||
<view class="br-b padding-bottom-sm fw-b text-size">{{$t('order.order.hbvwq4')}}</view>
|
||||
<view class="address-base oh margin-top-sm">
|
||||
<text v-if="(detail.user_address.alias || null) != null" class="address-alias round br-main cr-main bg-white margin-right-sm">{{detail.user_address.alias}}</text>
|
||||
<text data-event="copy" :data-value="detail.user_address.name" @tap="text_event">{{detail.user_address.name}}</text>
|
||||
<text class="fr" data-event="tel" :data-value="detail.user_address.tel" @tap="text_event">{{detail.user_address.tel}}</text>
|
||||
</view>
|
||||
<view v-if="(detail.user_address.appoint_time || null) != null" class="cr-red margin-top-xs">{{detail.user_address.appoint_time}}</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.user_address.address_info" @tap="text_event">{{detail.user_address.address_info}}</text>
|
||||
<text v-if="(detail.user_address.lng || 0) != 0 && (detail.user_address.lat || 0) != 0" class="address-map-submit cr-base br round bg-white margin-left-sm text-size-xs" @tap="address_map_event">{{$t('user-order-detail.user-order-detail.7lp6gw')}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="address-divider margin-bottom-sm"></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 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-gray">{{item.name}}</view>
|
||||
<view class="content fl br-l padding-left-main">
|
||||
<block v-if="(item.type || null) == 'images-list'">
|
||||
<view v-if="(item.value || null) != null && item.value.length > 0" class="images-list">
|
||||
<block v-for="(iv, ii) in item.value" :key="ii">
|
||||
<image class="item-images radius fl dis-block br padding-xs" :src="iv" mode="aspectFit" :data-ii="ii" @tap="images_list_event"></image>
|
||||
</block>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<block v-if="(item.event || null) == null">
|
||||
<text>{{item.value}}</text>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view data-event="copy" :data-value="item.value" @tap="text_event">{{item.value}}</view>
|
||||
</block>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 商品列表 -->
|
||||
<view v-if="detail.goods_data.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.goods_data" :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-gray">{{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", "delivery"),
|
||||
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.36op8f'), value: data.data.main_order_no || '', event: 'copy' },
|
||||
{ name: this.$t('order-detail.order-detail.ygvc34'), value: data.data.merchant_name || '' },
|
||||
{ name: this.$t('order-detail.order-detail.x3ge6c'), value: data.data.total_price || '' },
|
||||
{ name: this.$t('order-detail.order-detail.8n1f72'), value: data.data.buy_number_count || '' },
|
||||
{ name: this.$t('order-detail.order-detail.2443o1'), value: data.data.status_name || '' },
|
||||
{ name: this.$t('order-detail.order-detail.342sfz'), value: data.data.start_delivery_time || '' },
|
||||
{ name: this.$t('order-detail.order-detail.2dw4gd'), value: data.data.success_delivery_time || '' },
|
||||
{ name: this.$t('order-detail.order-detail.r3bg45'), value: data.data.success_delivery_msg || '' },
|
||||
{ name: this.$t('order-detail.order-detail.521pp4'), value: data.data.success_delivery_images || '', type: 'images-list' },
|
||||
{ name: this.$t('order-detail.order-detail.u745i8'), value: data.data.abnormal_delivery_time || '' },
|
||||
{ name: this.$t('order.order.865029'), value: data.data.reason || '' },
|
||||
{ name: this.$t('order-detail.order-detail.5fq8pr'), 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'));
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 图片列表查看
|
||||
images_list_event(e) {
|
||||
var ii = e.currentTarget.dataset.ii;
|
||||
uni.previewImage({
|
||||
current: this.detail.success_delivery_images[ii],
|
||||
urls: this.detail.success_delivery_images
|
||||
});
|
||||
},
|
||||
|
||||
// 文本事件
|
||||
text_event(e) {
|
||||
app.globalData.text_event_handle(e);
|
||||
},
|
||||
|
||||
// 地图查看
|
||||
address_map_event(e) {
|
||||
if ((this.detail.user_address || null) == null) {
|
||||
app.globalData.showToast(this.$t('user-order-detail.user-order-detail.i876o3'));
|
||||
return false;
|
||||
}
|
||||
|
||||
// 打开地图
|
||||
var data = this.detail.user_address;
|
||||
var name = data.alias || data.name || '';
|
||||
app.globalData.open_location(data.lng, data.lat, name, data.address_info);
|
||||
},
|
||||
|
||||
// url事件
|
||||
url_event(e) {
|
||||
app.globalData.url_event(e);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './order-detail.css';
|
||||
</style>
|
||||
62
pages/plugins/delivery/order/order.css
Normal file
62
pages/plugins/delivery/order/order.css
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* 头部
|
||||
*/
|
||||
.header {
|
||||
height: 160rpx;
|
||||
}
|
||||
.nav-base .item {
|
||||
width: 20%;
|
||||
}
|
||||
.nav-base .item .badge-icon {
|
||||
top: -18rpx;
|
||||
left: calc(50% + 52rpx);
|
||||
z-index: 1;
|
||||
}
|
||||
.nav-search .search-keywords {
|
||||
margin-right: 80rpx;
|
||||
}
|
||||
.nav-search .map-submit {
|
||||
top: 0;
|
||||
right: 20rpx;
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据列表
|
||||
*/
|
||||
.scroll-box {
|
||||
height: calc(100vh - 160rpx);
|
||||
}
|
||||
.data-list .address-info {
|
||||
width: calc(100% - 58rpx);
|
||||
word-wrap: break-word;
|
||||
word-break: break-all;
|
||||
}
|
||||
.data-list .address-info .icon-item {
|
||||
right: 0;
|
||||
top: -6rpx;
|
||||
line-height: 54rpx;
|
||||
height: 54rpx;
|
||||
width: 54rpx;
|
||||
}
|
||||
|
||||
/**
|
||||
* 地图
|
||||
*/
|
||||
.map-container {
|
||||
height: calc(100vh - 160rpx);
|
||||
}
|
||||
.map-container .map-markers-active-data {
|
||||
background-color: rgb(255 255 255 / 0.85);
|
||||
width: calc(100% - 40rpx);
|
||||
left: 20rpx;
|
||||
bottom: 20rpx;
|
||||
line-height: 58rpx;
|
||||
box-shadow: 0 0 20rpx rgba(50,55,58,0.2);
|
||||
}
|
||||
.map-container .map-markers-active-data .map-send-icon {
|
||||
right: 0;
|
||||
top: calc(50% - 22rpx);
|
||||
line-height: 54rpx;
|
||||
height: 54rpx;
|
||||
width: 54rpx;
|
||||
}
|
||||
853
pages/plugins/delivery/order/order.vue
Normal file
853
pages/plugins/delivery/order/order.vue
Normal file
@@ -0,0 +1,853 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view v-if="nav_type_list.length > 0" class="header bg-white">
|
||||
<!-- 导航 -->
|
||||
<view class="nav-base">
|
||||
<block v-for="(item, index) in nav_type_list" :key="index">
|
||||
<view :class="'item fl tc pr ' + (nav_type_index == index ? 'cr-main' : '')" :data-index="index" @tap="nav_event">
|
||||
<text>{{ item.name }}</text>
|
||||
<view class="badge-icon pa">
|
||||
<component-badge :propNumber="item.count || 0"></component-badge>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<!-- 关键字搜索 -->
|
||||
<view class="padding-horizontal-main padding-bottom-main margin-top-xs pr nav-search">
|
||||
<view class="search-keywords">
|
||||
<component-search
|
||||
@onsearch="search_submit_event"
|
||||
:propIsOnEvent="true"
|
||||
:propIsRequired="false"
|
||||
:propPlaceholder="$t('order.order.725882')"
|
||||
propClass="br"
|
||||
: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="map-submit pa" data-event="copy" @tap="map_show_type_event">
|
||||
<uni-icons :type="(show_type == 0) ? 'map' : 'list'" size="56rpx" color="#999"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 列表 -->
|
||||
<scroll-view v-if="show_type == 0" :scroll-y="true" class="scroll-box" @scrolltolower="scroll_lower" lower-threshold="60">
|
||||
<block v-if="data_list.length > 0">
|
||||
<view 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_concise || item.add_time }}</text>
|
||||
<text :class="'fr ' + (item.status == 4 ? 'cr-red' : item.status == 3 ? 'cr-green' : item.status == 2 ? 'cr-main' : 'cr-grey')">{{ item.status_name }}</text>
|
||||
</view>
|
||||
<view class="content margin-top">
|
||||
<view class="oh margin-top-sm">
|
||||
<view class="single-text fl" data-event="copy" :data-value="item.main_order_no" @tap="text_event">
|
||||
<text class="cr-grey">{{$t('order.order.232ygr')}}</text>
|
||||
<text class="cr-base margin-left-sm">{{ item.main_order_no }}</text>
|
||||
</view>
|
||||
<view class="single-text fr" data-event="copy" :data-value="item.main_order_id" @tap="text_event">
|
||||
<text class="cr-grey">{{$t('order.order.71n22h')}}</text>
|
||||
<text class="cr-base margin-left-sm">{{ item.main_order_id }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="(item.warehouse_address || null) != null" class="margin-top">
|
||||
<view class="cr-grey-d tc">{{$t('order.order.jhgfd1')}}</view>
|
||||
<view class="cr-base margin-top-xs">
|
||||
<view>
|
||||
<text data-event="copy" :data-value="item.warehouse_address.name" @tap="text_event">{{item.warehouse_address.name}}</text>
|
||||
<text class="margin-left-xl" data-event="copy" :data-value="item.warehouse_address.tel" @tap="text_event">{{item.warehouse_address.tel}}</text>
|
||||
<text v-if="(item.merchant_name || null) != null" class="fr" data-event="copy" :data-value="item.merchant_name" @tap="text_event">{{item.merchant_name}}</text>
|
||||
</view>
|
||||
<view class="pr margin-top-xs">
|
||||
<view class="address-info">
|
||||
<text class="cr-base" data-event="copy" :data-value="item.warehouse_address.address_info" @tap="text_event">{{ item.warehouse_address.address_info }}</text>
|
||||
<view v-if="(item.warehouse_address.lng || 0) != 0 && (item.warehouse_address.lat || 0) != 0" class="icon-item bg-base circle dis-inline-block tc cp pa" data-type="warehouse_address" :data-index="index" @tap.stop="address_map_event">
|
||||
<uni-icons type="paperplane-filled" size="32rpx" color="#666"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="(item.user_address || null) != null" class="margin-top">
|
||||
<view class="cr-grey-d tc">{{$t('order.order.hbvwq4')}}</view>
|
||||
<view class="cr-base margin-top-xs">
|
||||
<view>
|
||||
<text data-event="copy" :data-value="item.user_address.name" @tap="text_event">{{item.user_address.name}}</text>
|
||||
<text class="margin-left-xl" data-event="copy" :data-value="item.user_address.tel" @tap="text_event">{{item.user_address.tel}}</text>
|
||||
</view>
|
||||
<view v-if="(item.user_address.extraction_contact_name || null) != null || (item.user_address.extraction_contact_tel || null) != null" class="padding-vertical-xs">
|
||||
<text v-if="(item.user_address.extraction_contact_name || null) != null" class="margin-right-xl">{{item.user_address.extraction_contact_name}}</text>
|
||||
<text v-if="(item.user_address.extraction_contact_tel || null) != null">{{item.user_address.extraction_contact_tel}}</text>
|
||||
</view>
|
||||
<view v-if="(item.user_address.appoint_time || null) != null" class="cr-red padding-vertical-xs">{{item.user_address.appoint_time}}</view>
|
||||
<view class="pr margin-top-xs">
|
||||
<view class="address-info">
|
||||
<text class="cr-base" data-event="copy" :data-value="item.user_address.address_info" @tap="text_event">{{ item.user_address.address_info }}</text>
|
||||
<view v-if="(item.user_address.lng || 0) != 0 && (item.user_address.lat || 0) != 0" class="icon-item bg-base circle dis-inline-block tc cp pa" data-type="user_address" :data-index="index" @tap.stop="address_map_event">
|
||||
<uni-icons type="paperplane-filled" size="32rpx" color="#666"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="margin-top-lg padding-top-sm">
|
||||
<text>{{ item.describe }}</text>
|
||||
<text v-if="(item.distance || null) != null" class="fr cr-grey">{{$t('extraction-address.extraction-address.42v8tv')}}{{ item.distance }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-operation tr br-t padding-top-main margin-top-main">
|
||||
<button class="round bg-white br-base cr-base" type="default" size="mini" hover-class="none" :data-value="'/pages/plugins/delivery/order-detail/order-detail?id=' + item.id" @tap="url_event">{{$t('order.order.75ie9c')}}</button>
|
||||
<button v-if="item.status == 1" class="round bg-white br-blue cr-blue" type="default" size="mini" hover-class="none" :data-index="index" @tap="start_delivery_event">{{$t('order.order.021438')}}</button>
|
||||
<button v-if="item.status == 4" class="round bg-white br-main cr-main" type="default" size="mini" hover-class="none" :data-index="index" @tap="start_delivery_event">{{$t('order.order.ip4xo5')}}</button>
|
||||
<block v-if="item.status == 2">
|
||||
<button class="round bg-white br-green cr-green" type="default" size="mini" hover-class="none" :data-index="index" @tap="popup_success_content_event">{{$t('order.order.51q275')}}</button>
|
||||
<button class="round bg-white br-red cr-red" type="default" size="mini" hover-class="none" :data-index="index" @tap="popup_abnormal_content_event">{{$t('order.order.fb6dge')}}</button>
|
||||
</block>
|
||||
</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"></component-no-data>
|
||||
</block>
|
||||
</scroll-view>
|
||||
|
||||
<!-- 地图 -->
|
||||
<view v-if="show_type == 1" class="map-container pr">
|
||||
<block v-if="markers.length > 0">
|
||||
<map class="wh-auto ht-auto"
|
||||
:enable-zoom="true"
|
||||
:enable-scroll="true"
|
||||
:show-location="true"
|
||||
:latitude="markers[0]['latitude'] || latitude"
|
||||
:longitude="markers[0]['longitude'] || longitude"
|
||||
:scale="scale"
|
||||
:markers="markers"
|
||||
@markertap="marker_tap_event"
|
||||
></map>
|
||||
<view v-if="markers_active_data.length > 0" class="map-markers-active-data pa border-radius-main padding-main bs-bb">
|
||||
<block v-for="(item,index) in markers_active_data" :key="index">
|
||||
<view :class="'pr '+(index > 0 ? 'br-t padding-top-sm margin-top-sm' : '')">
|
||||
<view>
|
||||
<text>{{$t('order.order.71n22h')}}:</text>
|
||||
<text class="cp" data-event="copy" :data-value="item.main_order_id" @tap="text_event">{{item.main_order_id}}</text>
|
||||
</view>
|
||||
<view>
|
||||
<text>{{$t('order.order.232ygr')}}:</text>
|
||||
<text class="cp" data-event="copy" :data-value="item.main_order_no" @tap="text_event">{{item.main_order_no}}</text>
|
||||
</view>
|
||||
<view class="single-text">
|
||||
<text>{{$t('order.order.ra8222')}}:</text>
|
||||
<text class="cp" data-event="copy" :data-value="item.user_address.address_info" @tap="text_event">{{ item.user_address.address_info }}</text>
|
||||
</view>
|
||||
<view v-if="(item.user_address.lng || 0) != 0 && (item.user_address.lat || 0) != 0" class="map-send-icon bg-base circle tc cp pa" data-type="map" :data-index="index" @tap.stop="address_map_event">
|
||||
<uni-icons type="paperplane-filled" size="44rpx" color="#666"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data propStatus="0"></component-no-data>
|
||||
</block>
|
||||
</view>
|
||||
|
||||
<!-- 订单完成弹窗 -->
|
||||
<component-popup :propShow="popup_success_content_status" propPosition="bottom" @onclose="popup_success_content_close_event">
|
||||
<view class="padding-horizontal-main padding-top-main bg-white">
|
||||
<view class="close oh">
|
||||
<view class="fr" @tap.stop="popup_success_content_close_event">
|
||||
<iconfont name="icon-close-o" size="28rpx" color="#999"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
<form @submit="form_delivery_success_submit_event" class="form-container">
|
||||
<view class="form-container">
|
||||
<view class="form-gorup">
|
||||
<view class="form-gorup-title">{{$t('form.form.xy87t8')}}</view>
|
||||
<view class="br padding-main radius margin-top">
|
||||
<textarea placeholder-class="cr-grey" class="cr-base margin-0" :placeholder="$t('order.order.q4c8j0')" maxlength="200" :auto-height="true" :value="form_delivery_success_msg_value" @input="form_delivery_success_msg_event"></textarea>
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-gorup form-container-upload oh">
|
||||
<view class="form-gorup-title">{{$t('order.order.46q2z7')}}<text class="form-group-tips-must">*</text><text class="form-group-tips">{{$t('order.order.o11d44')}}{{form_delivery_success_images_max_count}}{{$t('buy.buy.5iuqow')}}</text></view>
|
||||
<view class="form-upload-data oh">
|
||||
<block v-if="form_delivery_success_images_list.length > 0">
|
||||
<view v-for="(item, index) in form_delivery_success_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_delivery_success_images_list || null) == null || form_delivery_success_images_list.length < form_delivery_success_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="form-gorup form-gorup-submit bottom-line-exclude">
|
||||
<button class="bg-main br-main cr-white round text-size" type="default" form-type="submit" hover-class="none">{{$t('order.order.9cvj96')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</form>
|
||||
</view>
|
||||
</component-popup>
|
||||
|
||||
<!-- 订单异常弹窗 -->
|
||||
<component-popup :propShow="popup_abnormal_content_status" propPosition="bottom" @onclose="popup_abnormal_content_close_event">
|
||||
<view class="padding-horizontal-main padding-top-main bg-white">
|
||||
<view class="close oh">
|
||||
<view class="fr" @tap.stop="popup_abnormal_content_close_event">
|
||||
<iconfont name="icon-close-o" size="28rpx" color="#999"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
<form @submit="form_delivery_abnormal_submit_event" class="form-container">
|
||||
<view class="form-container">
|
||||
<view class="form-gorup">
|
||||
<view class="form-gorup-title">{{$t('order.order.865029')}}<text class="form-group-tips-must">*</text></view>
|
||||
<view class="br padding-main radius margin-top">
|
||||
<textarea placeholder-class="cr-grey" class="cr-base margin-0" :placeholder="$t('order.order.g23kyj')" maxlength="200" :auto-height="true" :value="form_delivery_abnormal_msg_value" @input="form_delivery_abnormal_msg_event"></textarea>
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-gorup form-gorup-submit bottom-line-exclude">
|
||||
<button class="bg-red br-red cr-white round text-size" type="default" form-type="submit" hover-class="none">{{$t('order.order.eyir7g')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</form>
|
||||
</view>
|
||||
</component-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 componentBadge from "@/components/badge/badge";
|
||||
import componentPopup from "@/components/popup/popup";
|
||||
import componentSearch from '@/components/search/search';
|
||||
|
||||
var common_static_url = app.globalData.get_static_url("common");
|
||||
var plugins_static_url = app.globalData.get_static_url('delivery', true);
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
common_static_url: common_static_url,
|
||||
plugins_static_url: plugins_static_url,
|
||||
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: [],
|
||||
nav_type_index: 0,
|
||||
latitude: 0,
|
||||
longitude: 0,
|
||||
search_input_keywords_value: "",
|
||||
popup_abnormal_content_status: false,
|
||||
popup_abnormal_data_index: null,
|
||||
form_delivery_abnormal_msg_value: "",
|
||||
popup_success_content_status: false,
|
||||
popup_success_data_index: null,
|
||||
form_delivery_success_msg_value: "",
|
||||
form_delivery_success_images_list: [],
|
||||
form_delivery_success_images_max_count: 30,
|
||||
editor_path_type: "",
|
||||
show_type: 0,
|
||||
scale: 10,
|
||||
markers: [],
|
||||
markers_active_data: []
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
componentBadge,
|
||||
componentPopup,
|
||||
componentSearch
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: params,
|
||||
});
|
||||
this.init();
|
||||
|
||||
// 位置实时监听
|
||||
this.start_location_update();
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle();
|
||||
},
|
||||
|
||||
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,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 位置实时监听
|
||||
start_location_update(e = null) {
|
||||
if (e == null) {
|
||||
app.globalData.start_location_update(0, this, "start_location_update");
|
||||
} else {
|
||||
if ((e.status || 0) == 1) {
|
||||
// 更新当前页面的位置
|
||||
this.setData({
|
||||
latitude: e.lat,
|
||||
longitude: e.lng,
|
||||
});
|
||||
// 位置上报
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("locationreport", "user", "delivery"),
|
||||
method: "POST",
|
||||
data: {
|
||||
lat: e.lat,
|
||||
lng: e.lng,
|
||||
},
|
||||
dataType: "json",
|
||||
});
|
||||
} else {
|
||||
console.log("error", e);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// 位置权限校验回调
|
||||
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_list();
|
||||
},
|
||||
});
|
||||
} 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_list();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data_list(is_mandatory) {
|
||||
// 分页是否还有数据
|
||||
if ((is_mandatory || 0) == 0) {
|
||||
if (this.data_bottom_line_status == true) {
|
||||
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"];
|
||||
// 获取数据
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("index", "order", "delivery"),
|
||||
method: "POST",
|
||||
data: {
|
||||
page: this.data_page,
|
||||
type: type,
|
||||
keywords: this.search_input_keywords_value || "",
|
||||
lat: this.latitude,
|
||||
lng: this.longitude,
|
||||
},
|
||||
dataType: "json",
|
||||
success: (res) => {
|
||||
if(this.data_page > 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
if (res.data.code == 0) {
|
||||
// 数据列表
|
||||
var data = res.data.data;
|
||||
if (this.data_page <= 1) {
|
||||
var temp_data_list = data.data || [];
|
||||
} else {
|
||||
var temp_data_list = this.data_list || [];
|
||||
var temp_data = data.data;
|
||||
for (var i in temp_data) {
|
||||
temp_data_list.push(temp_data[i]);
|
||||
}
|
||||
}
|
||||
|
||||
// 地图标记
|
||||
var temp_markers = [];
|
||||
if(temp_data_list.length > 0) {
|
||||
temp_data_list.forEach((item, index) => {
|
||||
if((item.user_address || null) != null && (item.user_address.lat || 0) != 0 && (item.user_address.lng || 0) != 0) {
|
||||
temp_markers.push({
|
||||
id: index,
|
||||
width: 30,
|
||||
height: 30,
|
||||
latitude: item.user_address.lat,
|
||||
longitude: item.user_address.lng,
|
||||
iconPath: this.plugins_static_url+'order.png'
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
this.setData({
|
||||
editor_path_type: data.editor_path_type || "",
|
||||
nav_type_list: data.nav_type_list || [],
|
||||
markers: temp_markers,
|
||||
data_list: temp_data_list,
|
||||
data_total: data.total,
|
||||
data_page_total: data.page_total,
|
||||
data_list_loding_status: temp_data_list.length > 0 ? 3 : 0,
|
||||
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_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();
|
||||
}
|
||||
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);
|
||||
},
|
||||
|
||||
// 文本事件
|
||||
text_event(e) {
|
||||
app.globalData.text_event_handle(e);
|
||||
},
|
||||
|
||||
// 打开url事件
|
||||
url_event(e) {
|
||||
app.globalData.url_event(e);
|
||||
},
|
||||
|
||||
// 搜索关键字事件
|
||||
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,
|
||||
data_page: 1,
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// icon事件
|
||||
search_icon_event(e) {
|
||||
var self = this;
|
||||
uni.scanCode({
|
||||
success: function (res) {
|
||||
self.setData({
|
||||
search_input_keywords_value: res.result,
|
||||
data_page: 1
|
||||
});
|
||||
self.get_data_list(1);
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 地图查看
|
||||
address_map_event(e) {
|
||||
var index = e.currentTarget.dataset.index;
|
||||
var type = e.currentTarget.dataset.type;
|
||||
if(type == 'map') {
|
||||
this.address_map_handle(this.markers_active_data[index]['user_address']);
|
||||
} else {
|
||||
var temp_data = this.data_list;
|
||||
if ((temp_data[index] || null) == null || (temp_data[index][type] || null) == null) {
|
||||
app.globalData.showToast(this.$t('user-order-detail.user-order-detail.i876o3'));
|
||||
return false;
|
||||
}
|
||||
this.address_map_handle(temp_data[index][type]);
|
||||
}
|
||||
},
|
||||
|
||||
// 地址打开地图
|
||||
address_map_handle(ads) {
|
||||
var name = ads.alias || ads.name || "";
|
||||
app.globalData.open_location(ads.lng, ads.lat, name, ads.address_info);
|
||||
},
|
||||
|
||||
// 订单完成开启弹层
|
||||
popup_success_content_event(e) {
|
||||
this.setData({
|
||||
popup_success_content_status: true,
|
||||
popup_success_data_index: e.currentTarget.dataset.index,
|
||||
form_delivery_success_msg_value: "",
|
||||
form_delivery_success_images_list: []
|
||||
});
|
||||
},
|
||||
|
||||
// 订单完成弹层关闭
|
||||
popup_success_content_close_event(e) {
|
||||
this.setData({
|
||||
popup_success_content_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 订单完成说明输入事件
|
||||
form_delivery_success_msg_event(e) {
|
||||
this.setData({
|
||||
form_delivery_success_msg_value: e.detail.value
|
||||
});
|
||||
},
|
||||
|
||||
// 上传图片预览
|
||||
upload_show_event(e) {
|
||||
uni.previewImage({
|
||||
current: this.form_delivery_success_images_list[e.currentTarget.dataset.index],
|
||||
urls: this.form_delivery_success_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_delivery_success_images_list;
|
||||
list.splice(e.currentTarget.dataset.index, 1);
|
||||
self.setData({
|
||||
form_delivery_success_images_list: list,
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 文件上传
|
||||
file_upload_event(e) {
|
||||
var self = this;
|
||||
uni.chooseImage({
|
||||
count: this.form_delivery_success_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_delivery_success_images_list.length < this.form_delivery_success_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_delivery_success_images_list;
|
||||
list.push(data.data.url);
|
||||
self.setData({
|
||||
form_delivery_success_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);
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 订单异常开启弹层
|
||||
popup_abnormal_content_event(e) {
|
||||
this.setData({
|
||||
popup_abnormal_content_status: true,
|
||||
popup_abnormal_data_index: e.currentTarget.dataset.index,
|
||||
form_delivery_abnormal_msg_value: ""
|
||||
});
|
||||
},
|
||||
|
||||
// 订单异常弹层关闭
|
||||
popup_abnormal_content_close_event(e) {
|
||||
this.setData({
|
||||
popup_abnormal_content_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 订单异常原因输入事件
|
||||
form_delivery_abnormal_msg_event(e) {
|
||||
this.setData({
|
||||
form_delivery_abnormal_msg_value: e.detail.value
|
||||
});
|
||||
},
|
||||
|
||||
// 开始配送
|
||||
start_delivery_event(e) {
|
||||
uni.showModal({
|
||||
title: this.$t('common.warm_tips'),
|
||||
content: this.$t('order.order.s5cpq5'),
|
||||
confirmText: this.$t('common.confirm'),
|
||||
cancelText: this.$t('common.not_yet'),
|
||||
success: (result) => {
|
||||
if (result.confirm) {
|
||||
this.order_status_handle({
|
||||
index: e.currentTarget.dataset.index,
|
||||
new_status: 2,
|
||||
status_name: this.$t('order.order.13j20t'),
|
||||
action: "startdelivery",
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 完成配送表单提交
|
||||
form_delivery_success_submit_event(e) {
|
||||
if(this.form_delivery_success_images_list.length == 0) {
|
||||
app.globalData.showToast(this.$t('order.order.7ltibl'));
|
||||
return false;
|
||||
}
|
||||
this.order_status_handle({
|
||||
index: this.popup_success_data_index,
|
||||
new_status: 3,
|
||||
status_name: this.$t('order.order.c69064'),
|
||||
action: "successdelivery",
|
||||
msg: this.form_delivery_success_msg_value || '',
|
||||
images: this.form_delivery_success_images_list
|
||||
});
|
||||
},
|
||||
|
||||
// 异常表单提交
|
||||
form_delivery_abnormal_submit_event(e) {
|
||||
var msg = this.form_delivery_abnormal_msg_value || null;
|
||||
if (msg == null) {
|
||||
app.globalData.showToast(this.$t('order.order.hun5n3'));
|
||||
} else {
|
||||
this.order_status_handle({
|
||||
index: this.popup_abnormal_data_index,
|
||||
new_status: 4,
|
||||
status_name: this.$t('order.order.fb6dge'),
|
||||
action: "abnormaldelivery",
|
||||
msg: msg,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 订单状态处理
|
||||
order_status_handle(params) {
|
||||
var temp_data = this.data_list;
|
||||
uni.showLoading({
|
||||
title: this.$t('common.processing_in_text'),
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url(params.action, "order", "delivery"),
|
||||
method: "POST",
|
||||
data: {
|
||||
id: temp_data[params.index]["id"],
|
||||
msg: params.msg || "",
|
||||
images: params.images || ""
|
||||
},
|
||||
dataType: "json",
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
var temp_nav = this.nav_type_list;
|
||||
for (var i in temp_nav) {
|
||||
if (temp_nav[i]["value"] == temp_data[params.index]["status"] && (temp_nav[i]["count"] || 0) != 0) {
|
||||
temp_nav[i]["count"] = parseInt(temp_nav[i]["count"]) - 1;
|
||||
}
|
||||
if (temp_nav[i]["value"] == params.new_status) {
|
||||
temp_nav[i]["count"] = parseInt(temp_nav[i]["count"] || 0) + 1;
|
||||
}
|
||||
}
|
||||
temp_data[params.index]["status"] = params.new_status;
|
||||
temp_data[params.index]["status_name"] = params.status_name;
|
||||
this.setData({
|
||||
data_list: temp_data,
|
||||
nav_type_list: temp_nav,
|
||||
popup_success_content_status: false,
|
||||
popup_abnormal_content_status: false
|
||||
});
|
||||
app.globalData.showToast(res.data.msg, "success");
|
||||
} else {
|
||||
if (app.globalData.is_login_check(res.data, this, "order_status_handle", params)) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 展示类型
|
||||
map_show_type_event(e) {
|
||||
this.setData({
|
||||
show_type: this.show_type == 0 ? 1 : 0
|
||||
});
|
||||
},
|
||||
|
||||
// 点击标记点事件
|
||||
marker_tap_event(e) {
|
||||
// 点中数据id
|
||||
var index = e.detail.markerId;
|
||||
// 标记数据
|
||||
var temp_markers = this.markers;
|
||||
for(var i in temp_markers) {
|
||||
if(temp_markers[i]['id'] == index) {
|
||||
temp_markers[i]['iconPath'] = this.plugins_static_url+'order-active.png';
|
||||
} else {
|
||||
temp_markers[i]['iconPath'] = this.plugins_static_url+'order.png';
|
||||
}
|
||||
}
|
||||
// 订单数据、先匹配实际点击的订单
|
||||
var temp = null;
|
||||
var temp_data_list = this.data_list;
|
||||
for(var i in temp_data_list) {
|
||||
if(i == index) {
|
||||
temp = temp_data_list[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
// 再匹配相同坐标的订单
|
||||
var markers_active_data = [];
|
||||
if(temp != null) {
|
||||
for(var i in temp_data_list) {
|
||||
if((temp_data_list[i]['user_address'] || null) != null && (temp_data_list[i]['user_address']['lng'] || 0) != 0 && (temp_data_list[i]['user_address']['lat'] || 0) != 0 && temp.user_address.lng == temp_data_list[i]['user_address']['lng'] && temp.user_address.lat == temp_data_list[i]['user_address']['lat']) {
|
||||
markers_active_data.push(temp_data_list[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
this.setData({
|
||||
markers: temp_markers,
|
||||
markers_active_data: markers_active_data,
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import "./order.css";
|
||||
</style>
|
||||
@@ -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;
|
||||
}
|
||||
605
pages/plugins/distribution/extraction-apply/extraction-apply.vue
Normal file
605
pages/plugins/distribution/extraction-apply/extraction-apply.vue
Normal 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>
|
||||
@@ -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 */
|
||||
}
|
||||
414
pages/plugins/distribution/extraction-order/extraction-order.vue
Normal file
414
pages/plugins/distribution/extraction-order/extraction-order.vue
Normal 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>
|
||||
@@ -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);
|
||||
}
|
||||
@@ -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>
|
||||
7
pages/plugins/distribution/extraction/extraction.css
Normal file
7
pages/plugins/distribution/extraction/extraction.css
Normal file
@@ -0,0 +1,7 @@
|
||||
.alias {
|
||||
padding: 2rpx 10rpx;
|
||||
}
|
||||
.statistics .item {
|
||||
width: 50%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
241
pages/plugins/distribution/extraction/extraction.vue
Normal file
241
pages/plugins/distribution/extraction/extraction.vue
Normal 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>
|
||||
4
pages/plugins/distribution/introduce/introduce.css
Normal file
4
pages/plugins/distribution/introduce/introduce.css
Normal file
@@ -0,0 +1,4 @@
|
||||
.panel-item .level-icon {
|
||||
width: 50rpx;
|
||||
height: 50rpx !important;
|
||||
}
|
||||
177
pages/plugins/distribution/introduce/introduce.vue
Normal file
177
pages/plugins/distribution/introduce/introduce.vue
Normal 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>
|
||||
38
pages/plugins/distribution/map/map.css
Normal file
38
pages/plugins/distribution/map/map.css
Normal 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;
|
||||
}
|
||||
313
pages/plugins/distribution/map/map.vue
Normal file
313
pages/plugins/distribution/map/map.vue
Normal 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>
|
||||
45
pages/plugins/distribution/order-detail/order-detail.css
Normal file
45
pages/plugins/distribution/order-detail/order-detail.css
Normal 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;
|
||||
}
|
||||
219
pages/plugins/distribution/order-detail/order-detail.vue
Normal file
219
pages/plugins/distribution/order-detail/order-detail.vue
Normal 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>
|
||||
14
pages/plugins/distribution/order/order.css
Normal file
14
pages/plugins/distribution/order/order.css
Normal file
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
* 导航
|
||||
*/
|
||||
.nav-base .item {
|
||||
width: 16.66%;
|
||||
}
|
||||
|
||||
/*
|
||||
* 列表
|
||||
*/
|
||||
.data-list .item .base .avatar {
|
||||
width: 40rpx;
|
||||
height: 40rpx !important;
|
||||
}
|
||||
280
pages/plugins/distribution/order/order.vue
Normal file
280
pages/plugins/distribution/order/order.vue
Normal 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>
|
||||
10
pages/plugins/distribution/poster/poster.css
Normal file
10
pages/plugins/distribution/poster/poster.css
Normal 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%;
|
||||
}
|
||||
225
pages/plugins/distribution/poster/poster.vue
Normal file
225
pages/plugins/distribution/poster/poster.vue
Normal 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>
|
||||
140
pages/plugins/distribution/profit-detail/profit-detail.vue
Normal file
140
pages/plugins/distribution/profit-detail/profit-detail.vue
Normal 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>
|
||||
6
pages/plugins/distribution/profit/profit.css
Normal file
6
pages/plugins/distribution/profit/profit.css
Normal file
@@ -0,0 +1,6 @@
|
||||
/*
|
||||
* 导航
|
||||
*/
|
||||
.nav-base .item {
|
||||
width: 20%;
|
||||
}
|
||||
262
pages/plugins/distribution/profit/profit.vue
Normal file
262
pages/plugins/distribution/profit/profit.vue
Normal 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>
|
||||
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
* 导航
|
||||
*/
|
||||
.nav-base .item {
|
||||
width: 33.33%;
|
||||
}
|
||||
|
||||
/*
|
||||
* 列表
|
||||
*/
|
||||
.data-list .item .base .avatar {
|
||||
width: 40rpx;
|
||||
height: 40rpx !important;
|
||||
}
|
||||
276
pages/plugins/distribution/promotion-order/promotion-order.vue
Normal file
276
pages/plugins/distribution/promotion-order/promotion-order.vue
Normal 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>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user