源文件
This commit is contained in:
64
pages/plugins/membershiplevelvip/buy/buy.css
Normal file
64
pages/plugins/membershiplevelvip/buy/buy.css
Normal file
@@ -0,0 +1,64 @@
|
||||
/**
|
||||
* 导航
|
||||
*/
|
||||
.nav {
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
}
|
||||
|
||||
.nav.average-1 .item {
|
||||
width: calc(100% - 80rpx);
|
||||
}
|
||||
|
||||
.nav.average-2 .item {
|
||||
width: calc(50% - 80rpx);
|
||||
}
|
||||
|
||||
.nav.average-3 .item {
|
||||
width: calc((100% / 3) - 80rpx);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分割线
|
||||
*/
|
||||
.divider::before,
|
||||
.divider::after {
|
||||
content: '';
|
||||
width: 100rpx;
|
||||
height: 2rpx;
|
||||
background: #333333;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
|
||||
.divider::before {
|
||||
left: -120rpx;
|
||||
}
|
||||
|
||||
.divider::after {
|
||||
right: -120rpx;
|
||||
}
|
||||
|
||||
/**
|
||||
* 内容
|
||||
*/
|
||||
.data-list .list {
|
||||
width: calc((100% / 3) - 24rpx);
|
||||
}
|
||||
|
||||
.data-list .list .item {
|
||||
background: #F7F7F7;
|
||||
border-radius: 8px 40px 8px 8px;
|
||||
padding: 50rpx 32rpx 20rpx 32rpx;
|
||||
border: 1px solid #F7F7F7;
|
||||
}
|
||||
|
||||
.data-list .list .item.active {
|
||||
border-color: #F1513C;
|
||||
background-color: #FEF0E8;
|
||||
}
|
||||
|
||||
.data-list .list .item .price {
|
||||
margin-top: 16rpx;
|
||||
}
|
||||
312
pages/plugins/membershiplevelvip/buy/buy.vue
Normal file
312
pages/plugins/membershiplevelvip/buy/buy.vue
Normal file
@@ -0,0 +1,312 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<block v-if="(data_base || null) != null">
|
||||
<view v-if="(data_list || null) != null && data_list.length > 0" class="page-bottom-fixed">
|
||||
<!-- 导航 -->
|
||||
<scroll-view class="nav scroll-view-horizontal bg-white oh tc" :class="data_list.length < 4 ? 'average-' + data_list.length : ''" scroll-x="true">
|
||||
<block v-for="(item, index) in data_list" :key="index">
|
||||
<view :class="'item dis-inline-block padding-left-xxl padding-right-xxl cr-black ' + (selected_tabs_index === index ? 'cr-main nav-active-line' : '')" @tap="tabs_event" :data-index="index">
|
||||
{{ item.name }}
|
||||
</view>
|
||||
</block>
|
||||
</scroll-view>
|
||||
<!-- 分割线 -->
|
||||
<view class="tc margin-top-xxl spacing-mb">
|
||||
<text class="divider pr">{{$t('buy.buy.g7dk3f')}}</text>
|
||||
</view>
|
||||
<!-- 内容 -->
|
||||
<view class="vip-content bg-white padding-vertical-main padding-horizontal-sm spacing-mb">
|
||||
<block v-for="(item, index) in data_list" :key="index">
|
||||
<block v-if="selected_tabs_index == index">
|
||||
<block v-if="(item.pay_period_rules || null) != null">
|
||||
<view class="data-list flex-row flex-wrap align-c">
|
||||
<block v-for="(rules, ri) in item.pay_period_rules" :key="ri">
|
||||
<view class="list padding-sm oh" @tap="content_event" :data-index="ri" :data-value="currency_symbol + rules.price + '/' + ((rules.number || null) == null ? $t('buy.buy.b3dyo7') : rules.value + rules.unit)">
|
||||
<view class="item flex-col" :class="selected_content_index === ri ? 'active' : ''">
|
||||
<view class="number single-text text-size-lg">
|
||||
<text class="fw-b">{{ (rules.number || null) == null ? $t('buy.buy.b3dyo7') : rules.value }}</text>
|
||||
<text v-if="(rules.unit || null) != null" class="margin-left-sm">{{ rules.unit }}</text>
|
||||
</view>
|
||||
<view v-if="(rules.desc || null) != null" class="desc margin-top-sm">{{ rules.desc }}</view>
|
||||
<view class="price flex-row align-s">
|
||||
<text class="cr-red text-size-md pr top-lg margin-right-xs">{{ currency_symbol }}</text>
|
||||
<text class="fw-b cr-red text-size-xl single-text">{{ rules.price }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<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" hover-class="none" @tap="submit_event" :disabled="submit_disabled_status">{{$t('buy.buy.0s1k23')}}{{ selected_tabs_value }}</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data propStatus="0" :propMsg="$t('buy.buy.5lr84j')"></component-no-data>
|
||||
</block>
|
||||
</block>
|
||||
</block>
|
||||
</view>
|
||||
<view class="all-order flex-row jc-sb align-c padding-main bg-white spacing-mb" data-value="/pages/plugins/membershiplevelvip/order/order" @tap="url_event">
|
||||
<view> <iconfont name="icon-kaitonghuiy-dingdan" propClass="margin-right-sm" color="#666"></iconfont>{{$t('buy.buy.ntm2z5')}}</view>
|
||||
<iconfont name="icon-arrow-right" size="24rpx" color="#666"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data propStatus="0" :propMsg="$t('buy.buy.5x86n3')"></component-no-data>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
</block>
|
||||
<!-- 支付组件 -->
|
||||
<component-payment
|
||||
:propPayUrl="pay_url"
|
||||
:propQrcodeUrl="qrcode_url"
|
||||
propPayDataKey="id"
|
||||
:propPaymentList="payment_list"
|
||||
:propTempPayValue="temp_pay_value"
|
||||
:propTempPayIndex="temp_pay_index"
|
||||
:propPaymentId="payment_id"
|
||||
:propDefaultPaymentId="default_payment_id"
|
||||
:propPayPrice="pay_price"
|
||||
:propIsRedirectTo="true"
|
||||
:propToFailPage="to_fail_page"
|
||||
:propToAppointPage="to_appoint_page"
|
||||
:propIsShowPayment="is_show_payment_popup"
|
||||
@close-payment-popup="payment_popup_event_close"
|
||||
></component-payment>
|
||||
|
||||
<!-- 公共 -->
|
||||
<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 componentPayment from '@/components/payment/payment';
|
||||
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: '',
|
||||
bottom_fixed_style: '',
|
||||
data_list: [],
|
||||
data_base: null,
|
||||
selected_tabs_index: 0,
|
||||
selected_tabs_value: '',
|
||||
selected_content_index: null,
|
||||
submit_disabled_status: false,
|
||||
currency_symbol: app.globalData.currency_symbol(),
|
||||
// 支付弹窗参数
|
||||
pay_url: '',
|
||||
qrcode_url: '',
|
||||
payment_list: [],
|
||||
temp_pay_value: '',
|
||||
temp_pay_index: 0,
|
||||
payment_id: 0,
|
||||
default_payment_id: 0,
|
||||
is_show_payment_popup: false,
|
||||
pay_price: 0,
|
||||
// 支付失败跳转的页面
|
||||
to_fail_page: '/pages/plugins/membershiplevelvip/order/order',
|
||||
// 现金--跳转指定页面
|
||||
to_appoint_page: '/pages/plugins/membershiplevelvip/order/order',
|
||||
};
|
||||
},
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentPayment
|
||||
},
|
||||
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_list();
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
var user = app.globalData.get_user_info(this, 'init');
|
||||
if (user != false) {
|
||||
this.setData({
|
||||
pay_url: app.globalData.get_request_url('pay', 'buy', 'membershiplevelvip'),
|
||||
qrcode_url: app.globalData.get_request_url('paycheck', 'buy', 'membershiplevelvip'),
|
||||
});
|
||||
// 获取数据
|
||||
this.get_data_list();
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_bottom_line_status: false,
|
||||
});
|
||||
}
|
||||
},
|
||||
// 获取数据
|
||||
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', 'buy', 'membershiplevelvip'),
|
||||
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 || [],
|
||||
default_payment_id: data.default_payment_id || 0,
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: status ? 3 : 0,
|
||||
data_bottom_line_status: status,
|
||||
payment_list: data.payment_list,
|
||||
});
|
||||
} 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'),
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
// tabs事件
|
||||
tabs_event(e) {
|
||||
this.setData({
|
||||
selected_tabs_index: e.currentTarget.dataset.index || 0,
|
||||
selected_content_index: null,
|
||||
selected_tabs_value: '',
|
||||
temp_pay_index: 0,
|
||||
});
|
||||
},
|
||||
// 时长事件
|
||||
content_event(e) {
|
||||
this.setData({
|
||||
selected_content_index: e.currentTarget.dataset.index || 0,
|
||||
selected_tabs_value: e.currentTarget.dataset.value || '',
|
||||
temp_pay_index: e.currentTarget.dataset.index,
|
||||
});
|
||||
},
|
||||
// 确认支付事件
|
||||
submit_event(e) {
|
||||
if (this.selected_tabs_index < 0 || this.selected_content_index === null) {
|
||||
app.globalData.showToast(this.$t('buy.buy.bmueac'));
|
||||
return false;
|
||||
}
|
||||
// 请求参数
|
||||
var item = this.data_list[this.selected_tabs_index] || null;
|
||||
if (item == null) {
|
||||
app.globalData.showToast(this.$t('buy.buy.64ml60'));
|
||||
return false;
|
||||
}
|
||||
var rules = (item['pay_period_rules'] || null) == null ? null : item['pay_period_rules'][this.selected_content_index] || null;
|
||||
if (rules == null) {
|
||||
app.globalData.showToast(this.$t('buy.buy.64ml60'));
|
||||
return false;
|
||||
}
|
||||
// 请求生成支付订单
|
||||
this.setData({
|
||||
submit_disabled_status: true,
|
||||
});
|
||||
uni.showLoading({
|
||||
title: this.$t('common.processing_in_text'),
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('create', 'buy', 'membershiplevelvip'),
|
||||
method: 'POST',
|
||||
data: {
|
||||
opening: item['id'] + '-' + rules['number'],
|
||||
},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
this.setData({
|
||||
submit_disabled_status: false,
|
||||
});
|
||||
if (res.data.code == 0) {
|
||||
this.setData({
|
||||
is_show_payment_popup: this.is_show_payment_popup ? false : true,
|
||||
temp_pay_value: res.data.data.id,
|
||||
pay_price: res.data.data.price,
|
||||
payment_id: res.data.data.payment_user_id,
|
||||
});
|
||||
uni.setStorageSync(app.globalData.data.cache_page_pay_key, {
|
||||
order_ids: res.data.data.id,
|
||||
});
|
||||
} else {
|
||||
if (app.globalData.is_login_check(res.data, this, 'submit_event')) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
this.setData({
|
||||
submit_disabled_status: false,
|
||||
});
|
||||
uni.hideLoading();
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 打开url
|
||||
url_event(e) {
|
||||
app.globalData.url_event(e);
|
||||
},
|
||||
|
||||
// 支付窗口关闭
|
||||
payment_popup_event_close() {
|
||||
this.setData({
|
||||
is_show_payment_popup: false,
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
@import './buy.css';
|
||||
</style>
|
||||
50
pages/plugins/membershiplevelvip/index/index.css
Normal file
50
pages/plugins/membershiplevelvip/index/index.css
Normal file
@@ -0,0 +1,50 @@
|
||||
/**
|
||||
* banner
|
||||
*/
|
||||
.vip-bg {
|
||||
width: calc(100% + 8rpx);
|
||||
margin: 0 -4rpx;
|
||||
}
|
||||
|
||||
.banner .title-img {
|
||||
width: 476rpx;
|
||||
margin-top: 64rpx;
|
||||
}
|
||||
|
||||
.banner-title {
|
||||
color: #f9d681;
|
||||
}
|
||||
|
||||
.banner-buy {
|
||||
background-size: 100%;
|
||||
background-color: transparent;
|
||||
border: 0;
|
||||
color: #88651F !important;
|
||||
width: 308rpx;
|
||||
height: 94rpx;
|
||||
line-height: 94rpx !important;
|
||||
font-size: 44rpx;
|
||||
box-sizing: content-box;
|
||||
}
|
||||
|
||||
/**
|
||||
* 等级介绍
|
||||
*/
|
||||
.head-top {
|
||||
padding-top: calc(94rpx + var(--status-bar-height) + 5px);
|
||||
/* #ifdef H5 */
|
||||
padding-top: 94rpx;
|
||||
/* #endif */
|
||||
}
|
||||
|
||||
.data-list .item {
|
||||
width: calc(100% / 3);
|
||||
margin-bottom: 20rpx;
|
||||
color: #88651F;
|
||||
padding: 0 20rpx;
|
||||
}
|
||||
|
||||
.data-list .item image {
|
||||
width: 130rpx;
|
||||
height: 130rpx !important;
|
||||
}
|
||||
181
pages/plugins/membershiplevelvip/index/index.vue
Normal file
181
pages/plugins/membershiplevelvip/index/index.vue
Normal file
@@ -0,0 +1,181 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<component-nav-back></component-nav-back>
|
||||
<view v-if="(data_base || null) != null" class="bg-white">
|
||||
<view class="pr wh-auto oh">
|
||||
<image :src="membership_level_vip + 'bg.png'" mode="widthFix" class="vip-bg"></image>
|
||||
<view class="banner oh pa top-0 pa-w wh-auto head-top">
|
||||
<view class="tc">
|
||||
<image :src="membership_level_vip + 'title.png'" mode="widthFix" class="title-img"></image>
|
||||
<!-- 标题 -->
|
||||
<view v-if="(data_base.banner_top_title || null) != null" class="banner-title single-text text-size-lg margin-top-xxxl"> {{ data_base.banner_top_title }} </view>
|
||||
<!-- 购买按钮 -->
|
||||
<button data-value="/pages/plugins/membershiplevelvip/buy/buy" @tap="url_event" class="banner-buy fw-b round auto margin-top-xxxl" hover-class="none" :style="join_vip_btn">
|
||||
{{ data_base.banner_middle_name || $t('index.index.tbo22p') }}
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 介绍列表 -->
|
||||
<view v-if="(introduce_data || null) != null && introduce_data.length > 0" class="data-list oh flex-row jc-sa align-c">
|
||||
<block v-for="(item, index) in introduce_data" :key="index">
|
||||
<view class="item tc bg-white">
|
||||
<image class="dis-block auto" :src="item.images_url" mode="scaleToFill"></image>
|
||||
<view class="single-text text-size margin-top-main">{{ item.name }}</view>
|
||||
<view class="multi-text cr-grey-c text-size-xs margin-top-xs">{{ item.desc }}</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<!-- 富文本 -->
|
||||
<view v-if="(data_base.banner_bottom_content || null) != null" class="padding-main spacing-mt">
|
||||
<view class="border-radius-main bg-white oh">
|
||||
<mp-html :content="data_base.banner_bottom_content" />
|
||||
</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 componentNavBack from '@/components/nav-back/nav-back';
|
||||
import componentNoData from '@/components/no-data/no-data';
|
||||
import componentBottomLine from '@/components/bottom-line/bottom-line';
|
||||
let membership_level_vip = app.globalData.get_static_url('membershiplevelvip', true);
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
membership_level_vip: membership_level_vip + 'app/',
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
introduce_data: [],
|
||||
data_base: null,
|
||||
default_images_data: null,
|
||||
// 自定义分享信息
|
||||
share_info: {},
|
||||
join_vip_btn: 'background-image: url(' + membership_level_vip + 'app/join-vip-btn.png) !important;',
|
||||
};
|
||||
},
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNavBack,
|
||||
componentNoData,
|
||||
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();
|
||||
}
|
||||
},
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.get_data();
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
// 获取数据
|
||||
this.get_data();
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data() {
|
||||
if (this.introduce_data.length <= 0) {
|
||||
this.setData({
|
||||
data_list_loding_status: 1,
|
||||
});
|
||||
}
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('index', 'index', 'membershiplevelvip'),
|
||||
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,
|
||||
default_images_data: data.default_images_data || null,
|
||||
introduce_data: data.introduce_data || [],
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: 0,
|
||||
data_bottom_line_status: true,
|
||||
});
|
||||
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/membershiplevelvip/index/index',
|
||||
img: this.default_images_data.default_bg_images || this.default_images_data.default_logo || '',
|
||||
},
|
||||
});
|
||||
|
||||
// #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'),
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 页面滚动监听
|
||||
onPageScroll(res) {
|
||||
uni.$emit('onPageScroll', res);
|
||||
},
|
||||
|
||||
// url事件
|
||||
url_event(e) {
|
||||
app.globalData.url_event(e);
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './index.css';
|
||||
</style>
|
||||
12
pages/plugins/membershiplevelvip/member-code/member-code.css
Normal file
12
pages/plugins/membershiplevelvip/member-code/member-code.css
Normal file
@@ -0,0 +1,12 @@
|
||||
.brcode {
|
||||
width: 660rpx;
|
||||
padding-top: 60rpx;
|
||||
}
|
||||
.qrcode {
|
||||
width: 450rpx;
|
||||
margin-top: 60rpx;
|
||||
padding: 50rpx;
|
||||
}
|
||||
.bottom-fixed .btn {
|
||||
width: 50%;
|
||||
}
|
||||
190
pages/plugins/membershiplevelvip/member-code/member-code.vue
Normal file
190
pages/plugins/membershiplevelvip/member-code/member-code.vue
Normal file
@@ -0,0 +1,190 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view class="scroll-box bg-white">
|
||||
<!-- 主体内容 -->
|
||||
<block v-if="data_list_loding_status == 3">
|
||||
<!-- 条码 -->
|
||||
<view class="brcode auto">
|
||||
<w-barcode :options="barcode"></w-barcode>
|
||||
<view class="fw-b tc margin-top text-size-lg">{{ member_code }}</view>
|
||||
</view>
|
||||
|
||||
<!-- 二维码 -->
|
||||
<view class="qrcode auto br radius">
|
||||
<w-qrcode :options="qrcode"></w-qrcode>
|
||||
</view>
|
||||
|
||||
<!-- 提示信息 -->
|
||||
<view class="cr-grey tc margin-top-xxxl">{{$t('member-code.member-code.oc4x18')}}</view>
|
||||
|
||||
<!-- 导航 -->
|
||||
<view v-if="(plugins_wallet || null) != null" class="bottom-fixed" :style="bottom_fixed_style">
|
||||
<view class="bottom-line-exclude">
|
||||
<view class="bg-white br-grey-d round oh">
|
||||
<button type="default" class="btn bg-main cr-white round text-size fl br-0" size="mini">{{$t('member-code.member-code.26bu38')}}</button>
|
||||
<button type="default" class="btn bg-white round text-size fr br-0" size="mini" :data-value="'/pages/plugins/wallet/payment-code/payment-code?screen_brightness_value=' + screen_brightness_value" data-redirect="1" @tap="url_event">{{$t('member-code.member-code.x58gqu')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
|
||||
<!-- 错误提示 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
<view v-if="is_to_login == 1" class="margin-top-lg tc">
|
||||
<button type="default" class="bg-main br-main cr-white" size="mini" data-value="/pages/login/login" @tap="url_event">{{$t('member-code.member-code.yj6g3a')}}</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";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
bottom_fixed_style: '',
|
||||
is_to_login: 0,
|
||||
screen_brightness_value: 0,
|
||||
plugins_wallet: null,
|
||||
user: null,
|
||||
member_code: '',
|
||||
barcode: {
|
||||
width: 660,
|
||||
height: 120,
|
||||
code: '',
|
||||
},
|
||||
qrcode: {
|
||||
code: '',
|
||||
size: 450,
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
},
|
||||
|
||||
// 页面加载初始化
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 获取屏幕亮度
|
||||
// #ifndef H5
|
||||
var self = this;
|
||||
if ((params || null) != null && (params.screen_brightness_value || null) == null) {
|
||||
uni.getScreenBrightness({
|
||||
success: function (res) {
|
||||
self.setData({
|
||||
screen_brightness_value: res.value,
|
||||
});
|
||||
},
|
||||
});
|
||||
} else {
|
||||
self.setData({
|
||||
screen_brightness_value: params.screen_brightness_value,
|
||||
});
|
||||
}
|
||||
// #endif
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 数据加载
|
||||
this.init();
|
||||
|
||||
// 初始化配置
|
||||
this.init_config();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 初始化配置
|
||||
init_config(status) {
|
||||
if ((status || false) == true) {
|
||||
this.setData({
|
||||
plugins_wallet: app.globalData.get_config("plugins_base.wallet", null),
|
||||
});
|
||||
} else {
|
||||
app.globalData.is_config(this, "init_config");
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
init() {
|
||||
var user = app.globalData.get_user_info(this, "init");
|
||||
if (user != false) {
|
||||
if ((user.number_code || null) != null) {
|
||||
// 会员码数据
|
||||
var barcode = this.barcode;
|
||||
var qrcode = this.qrcode;
|
||||
barcode["code"] = user.number_code;
|
||||
qrcode["code"] = user.number_code;
|
||||
this.setData({
|
||||
data_list_loding_status: 3,
|
||||
is_to_login: 0,
|
||||
user: user,
|
||||
barcode: barcode,
|
||||
qrcode: qrcode,
|
||||
member_code: user.number_code,
|
||||
});
|
||||
|
||||
// #ifndef H5
|
||||
// 设置屏幕亮度
|
||||
uni.setScreenBrightness({
|
||||
value: 1,
|
||||
});
|
||||
// #endif
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_list_loding_msg: this.$t('member-code.member-code.kx4yk8'),
|
||||
is_to_login: 0,
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_list_loding_msg: this.$t('setup.setup.nwt4o1'),
|
||||
is_to_login: 1,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// url事件
|
||||
url_event(e) {
|
||||
app.globalData.url_event(e);
|
||||
},
|
||||
},
|
||||
|
||||
// 页面销毁时执行
|
||||
onUnload: function () {
|
||||
// #ifndef H5
|
||||
// 恢复屏幕原始亮度
|
||||
if (this.screen_brightness_value > 0) {
|
||||
uni.setScreenBrightness({
|
||||
value: this.screen_brightness_value,
|
||||
});
|
||||
}
|
||||
// #endif
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import "./member-code.css";
|
||||
</style>
|
||||
140
pages/plugins/membershiplevelvip/order-detail/order-detail.vue
Normal file
140
pages/plugins/membershiplevelvip/order-detail/order-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", "order", "membershiplevelvip"),
|
||||
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.payment_user_order_no || "" },
|
||||
{ name: this.$t('order.order.vjfki8'), value: data.data.period_value + " " + data.data.period_unit || "" },
|
||||
{ name: this.$t('user-order-detail.user-order-detail.yxwu8n'), value: data.data.status_name || "" },
|
||||
{ name: this.$t('profit-detail.profit-detail.kn8yye'), value: data.data.settlement_status_name || "" },
|
||||
{ name: this.$t('order-detail.order-detail.rn4hhi'), value: data.data.type_name || "" },
|
||||
{ name: this.$t('order-detail.order-detail.x3ge6c'), value: data.data.price || "" },
|
||||
{ name: this.$t('user-order-detail.user-order-detail.516tlr'), value: data.data.pay_price <= 0 ? "" : data.data.pay_price || "" },
|
||||
{ name: this.$t('user-order-detail.user-order-detail.0e1sfs'), value: data.data.payment_name || "" },
|
||||
{ name: this.$t('user-order-detail.user-order-detail.h2c78h'), 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/membershiplevelvip/order/order.css
Normal file
6
pages/plugins/membershiplevelvip/order/order.css
Normal file
@@ -0,0 +1,6 @@
|
||||
/*
|
||||
* 导航
|
||||
*/
|
||||
.nav-base .item {
|
||||
width: 20%;
|
||||
}
|
||||
472
pages/plugins/membershiplevelvip/order/order.vue
Normal file
472
pages/plugins/membershiplevelvip/order/order.vue
Normal file
@@ -0,0 +1,472 @@
|
||||
<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 nav-active-line' : '')" :data-index="index" @tap="nav_event">{{ item.name }}</view>
|
||||
</block>
|
||||
</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/membershiplevelvip/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>
|
||||
<text v-if="(item[fv.unit_field] || null) != null" class="cr-grey">{{ item[fv.unit_field] }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="item.status == 0 || item.status == 2 || item.status == 3" class="item-operation tr br-t padding-top-main margin-top-main">
|
||||
<button v-if="item.status == 0" class="round bg-white cr-green br-green" type="default" size="mini" @tap="pay_event" :data-value="item.id" :data-price="item.price" :data-index="index" :data-payment="item.payment_id" hover-class="none">{{$t('order.order.1i873j')}}</button>
|
||||
<button v-if="item.status == 0" class="round bg-white cr-yellow br-yellow" type="default" size="mini" @tap="cancel_event" :data-value="item.id" :data-index="index" hover-class="none">{{$t('common.cancel')}}</button>
|
||||
<button v-if="item.status == 2 || item.status == 3" class="round bg-white cr-red br-red" type="default" size="mini" @tap="delete_event" :data-value="item.id" :data-index="index" hover-class="none">{{$t('common.del')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status"></component-no-data>
|
||||
</view>
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</scroll-view>
|
||||
<component-payment
|
||||
ref="payment"
|
||||
:propPayUrl="pay_url"
|
||||
:propQrcodeUrl="qrcode_url"
|
||||
propPayDataKey="id"
|
||||
:propPaymentList="payment_list"
|
||||
:propTempPayValue="temp_pay_value"
|
||||
:propTempPayIndex="temp_pay_index"
|
||||
:propPaymentId="payment_id"
|
||||
:propDefaultPaymentId="default_payment_id"
|
||||
:propPayPrice="pay_price"
|
||||
:propIsShowPayment="is_show_payment_popup"
|
||||
@close-payment-popup="payment_popup_event_close"
|
||||
@pay-success="order_item_pay_success_handle"
|
||||
:propNavDtatusIndex="nav_status_index"
|
||||
@reset-event="reset_event"
|
||||
></component-payment>
|
||||
|
||||
<!-- 公共 -->
|
||||
<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 componentPayment from '@/components/payment/payment';
|
||||
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,
|
||||
// 支付弹窗参数
|
||||
pay_url: '',
|
||||
qrcode_url: '',
|
||||
payment_list: [],
|
||||
temp_pay_value: '',
|
||||
temp_pay_index: 0,
|
||||
payment_id: 0,
|
||||
default_payment_id: 0,
|
||||
is_show_payment_popup: false,
|
||||
pay_price: 0,
|
||||
nav_status_list: [
|
||||
{
|
||||
name: this.$t('common.all'),
|
||||
value: '-1',
|
||||
},
|
||||
{
|
||||
name: this.$t('order.order.pjb15r'),
|
||||
value: '0',
|
||||
},
|
||||
{
|
||||
name: this.$t('order.order.s8g966'),
|
||||
value: '1',
|
||||
},
|
||||
{
|
||||
name: this.$t('order.order.1k98tk'),
|
||||
value: '2',
|
||||
},
|
||||
{
|
||||
name: this.$t('order.order.6390gk'),
|
||||
value: '3',
|
||||
},
|
||||
],
|
||||
nav_status_index: 0,
|
||||
content_list: [
|
||||
{
|
||||
name: this.$t('order.order.vvxct1'),
|
||||
field: 'payment_user_order_no',
|
||||
},
|
||||
{
|
||||
name: this.$t('order.order.vjfki8'),
|
||||
field: 'period_value',
|
||||
unit_field: 'period_unit',
|
||||
},
|
||||
{
|
||||
name: this.$t('order-detail.order-detail.x3ge6c'),
|
||||
field: 'price',
|
||||
},
|
||||
{
|
||||
name: this.$t('user-order-detail.user-order-detail.516tlr'),
|
||||
field: 'pay_price',
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
components: {
|
||||
componentCommon,
|
||||
componentPayment,
|
||||
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.setData({
|
||||
pay_url: app.globalData.get_request_url('pay', 'buy', 'membershiplevelvip'),
|
||||
qrcode_url: app.globalData.get_request_url('paycheck', 'buy', 'membershiplevelvip'),
|
||||
});
|
||||
// 获取数据
|
||||
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', 'membershiplevelvip'),
|
||||
method: 'POST',
|
||||
data: {
|
||||
page: this.data_page,
|
||||
status: order_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({
|
||||
payment_list: res.data.data.payment_list || [],
|
||||
default_payment_id: res.data.data.default_payment_id || 0,
|
||||
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,
|
||||
});
|
||||
|
||||
// 下订单支付处理
|
||||
var key = app.globalData.data.cache_page_pay_key;
|
||||
var pay_data = uni.getStorageSync(key) || null;
|
||||
if (pay_data != null && (pay_data.order_ids || null) != null && (pay_data.payment_id || null) != null) {
|
||||
uni.removeStorageSync(key);
|
||||
this.setData({
|
||||
temp_pay_value: pay_data.order_ids,
|
||||
payment_id: pay_data.payment_id,
|
||||
});
|
||||
if ((this.$refs.payment || null) != null) {
|
||||
this.$refs.payment.pay_handle(pay_data.order_ids, pay_data.payment_id, this.payment_list);
|
||||
}
|
||||
}
|
||||
} 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();
|
||||
},
|
||||
|
||||
// 支付
|
||||
pay_event(e) {
|
||||
this.setData({
|
||||
is_show_payment_popup: true,
|
||||
temp_pay_value: e.currentTarget.dataset.value,
|
||||
temp_pay_index: e.currentTarget.dataset.index,
|
||||
pay_price: e.currentTarget.dataset.price,
|
||||
payment_id: e.currentTarget.dataset.payment || '',
|
||||
});
|
||||
},
|
||||
|
||||
// 支付弹窗关闭
|
||||
payment_popup_event_close(e) {
|
||||
this.setData({
|
||||
is_show_payment_popup: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 重置列表数据
|
||||
reset_event() {
|
||||
this.get_data_list();
|
||||
},
|
||||
|
||||
// 支付成功数据设置
|
||||
order_item_pay_success_handle(data) {
|
||||
var order_ids_arr = data.order_id.toString().split(',');
|
||||
var temp_data_list = this.data_list;
|
||||
for (var i in temp_data_list) {
|
||||
if (order_ids_arr.indexOf(temp_data_list[i]['id'].toString()) != -1) {
|
||||
temp_data_list[i]['pay_price'] = temp_data_list[i]['price'];
|
||||
temp_data_list[i]['status'] = 1;
|
||||
temp_data_list[i]['status_name'] = this.$t('order.order.s8g966');
|
||||
}
|
||||
}
|
||||
this.setData({
|
||||
data_list: temp_data_list,
|
||||
});
|
||||
},
|
||||
|
||||
// 取消
|
||||
cancel_event(e) {
|
||||
uni.showModal({
|
||||
title: this.$t('common.warm_tips'),
|
||||
content: this.$t('order.order.pn78ns'),
|
||||
confirmText: this.$t('common.confirm'),
|
||||
cancelText: this.$t('recommend-list.recommend-list.w9460o'),
|
||||
success: (result) => {
|
||||
if (result.confirm) {
|
||||
// 参数
|
||||
var id = e.currentTarget.dataset.value;
|
||||
var index = e.currentTarget.dataset.index;
|
||||
// 加载loding
|
||||
uni.showLoading({
|
||||
title: this.$t('common.processing_in_text'),
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('cancel', 'order', 'membershiplevelvip'),
|
||||
method: 'POST',
|
||||
data: {
|
||||
id: id,
|
||||
},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
var temp_data_list = this.data_list;
|
||||
temp_data_list[index]['status'] = 2;
|
||||
temp_data_list[index]['status_name'] = this.$t('order.order.1k98tk');
|
||||
this.setData({
|
||||
data_list: temp_data_list,
|
||||
});
|
||||
app.globalData.showToast(res.data.msg, 'success');
|
||||
} else {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 删除
|
||||
delete_event(e) {
|
||||
uni.showModal({
|
||||
title: this.$t('common.warm_tips'),
|
||||
content: this.$t('recommend-list.recommend-list.54d418'),
|
||||
confirmText: this.$t('common.confirm'),
|
||||
cancelText: this.$t('recommend-list.recommend-list.w9460o'),
|
||||
success: (result) => {
|
||||
if (result.confirm) {
|
||||
// 参数
|
||||
var id = e.currentTarget.dataset.value;
|
||||
var index = e.currentTarget.dataset.index;
|
||||
// 加载loding
|
||||
uni.showLoading({
|
||||
title: this.$t('common.processing_in_text'),
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('delete', 'order', 'membershiplevelvip'),
|
||||
method: 'POST',
|
||||
data: {
|
||||
id: id,
|
||||
},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
var temp_data_list = this.data_list;
|
||||
temp_data_list.splice(index, 1);
|
||||
this.setData({
|
||||
data_list: temp_data_list,
|
||||
});
|
||||
if (temp_data_list.length == 0) {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_bottom_line_status: false,
|
||||
});
|
||||
}
|
||||
app.globalData.showToast(res.data.msg, 'success');
|
||||
} else {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 导航事件
|
||||
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 './order.css';
|
||||
</style>
|
||||
7
pages/plugins/membershiplevelvip/poster/poster.css
Normal file
7
pages/plugins/membershiplevelvip/poster/poster.css
Normal file
@@ -0,0 +1,7 @@
|
||||
.share .title {
|
||||
border-style: solid;
|
||||
border-width: 0 0 0 3px;
|
||||
}
|
||||
.submit-double button {
|
||||
width: 48%;
|
||||
}
|
||||
162
pages/plugins/membershiplevelvip/poster/poster.vue
Normal file
162
pages/plugins/membershiplevelvip/poster/poster.vue
Normal file
@@ -0,0 +1,162 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view v-if="user_share_qrode != null || user_share_url != null" class="padding-main">
|
||||
<!-- 二维码 -->
|
||||
<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>
|
||||
</view>
|
||||
<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_loding_status: 1,
|
||||
data_list_loding_msg: this.$t('common.loading_in_text'),
|
||||
data_bottom_line_status: false,
|
||||
user_share_qrode: null,
|
||||
user_share_url: null,
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
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.init();
|
||||
},
|
||||
|
||||
methods: {
|
||||
init() {
|
||||
this.setData({
|
||||
data_list_loding_status: 1,
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("index", "poster", "membershiplevelvip"),
|
||||
method: "POST",
|
||||
data: {},
|
||||
dataType: "json",
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
this.setData({
|
||||
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_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'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 图片查看事件
|
||||
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);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import "./poster.css";
|
||||
</style>
|
||||
137
pages/plugins/membershiplevelvip/profit-detail/profit-detail.vue
Normal file
137
pages/plugins/membershiplevelvip/profit-detail/profit-detail.vue
Normal file
@@ -0,0 +1,137 @@
|
||||
<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", "membershiplevelvip"),
|
||||
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('profit.profit.7y47sb'), 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('profit-detail.profit-detail.3jg81h'), value: data.data.commission_rules || "" },
|
||||
{ name: this.$t('user-order-detail.user-order-detail.h2c78h'), 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/membershiplevelvip/profit/profit.css
Normal file
6
pages/plugins/membershiplevelvip/profit/profit.css
Normal file
@@ -0,0 +1,6 @@
|
||||
/*
|
||||
* 导航
|
||||
*/
|
||||
.nav-base .item {
|
||||
width: 25%;
|
||||
}
|
||||
260
pages/plugins/membershiplevelvip/profit/profit.vue
Normal file
260
pages/plugins/membershiplevelvip/profit/profit.vue
Normal file
@@ -0,0 +1,260 @@
|
||||
<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' : '')" :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/membershiplevelvip/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.67o785'), value: "0" },
|
||||
{ name: this.$t('profit.profit.l5knxu'), value: "1" },
|
||||
{ name: this.$t('detail.detail.32171c'), value: "2" },
|
||||
],
|
||||
nav_status_index: 0,
|
||||
content_list: [
|
||||
{ name: this.$t('order-detail.order-detail.x3ge6c'), field: "total_price" },
|
||||
{ name: this.$t('profit.profit.7y47sb'), 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", "membershiplevelvip"),
|
||||
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>
|
||||
7
pages/plugins/membershiplevelvip/team/team.css
Normal file
7
pages/plugins/membershiplevelvip/team/team.css
Normal file
@@ -0,0 +1,7 @@
|
||||
/*
|
||||
* 列表
|
||||
*/
|
||||
.data-list .item .base .avatar {
|
||||
width: 40rpx;
|
||||
height: 40rpx !important;
|
||||
}
|
||||
231
pages/plugins/membershiplevelvip/team/team.vue
Normal file
231
pages/plugins/membershiplevelvip/team/team.vue
Normal file
@@ -0,0 +1,231 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<scroll-view :scroll-y="true" class="scroll-box" @scrolltolower="scroll_lower" lower-threshold="60">
|
||||
<view v-if="data_list.length > 0" class="data-list padding-horizontal-main padding-top-main">
|
||||
<view v-for="(item, index) in data_list" :key="index" class="item padding-main border-radius-main oh bg-white spacing-mb">
|
||||
<view class="base oh br-b padding-bottom-main">
|
||||
<image class="avatar dis-block fl circle" :src="item.avatar" mode="widthFix" @tap="avatar_event" :data-value="item.avatar"></image>
|
||||
<text class="cr-base margin-left-sm">{{ item.user_name_view || "" }}</text>
|
||||
<text class="cr-base fr">{{ item.add_time }}</text>
|
||||
</view>
|
||||
<view class="content margin-top">
|
||||
<block v-for="(fv, fi) in content_list" :key="fi">
|
||||
<view class="single-text margin-top-xs">
|
||||
<text class="cr-grey margin-right-xl">{{ fv.name }}</text>
|
||||
<text class="cr-base">{{ item[fv.field] }}</text>
|
||||
<text v-if="(fv.unit || null) != null" class="cr-grey">{{ fv.unit }}</text>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status"></component-no-data>
|
||||
</view>
|
||||
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</scroll-view>
|
||||
|
||||
<!-- 公共 -->
|
||||
<component-common ref="common"></component-common>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentCommon from '@/components/common/common';
|
||||
import componentNoData from "@/components/no-data/no-data";
|
||||
import componentBottomLine from "@/components/bottom-line/bottom-line";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
data_list: [],
|
||||
data_total: 0,
|
||||
data_page_total: 0,
|
||||
data_page: 1,
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false,
|
||||
data_is_loading: 0,
|
||||
params: null,
|
||||
content_list: [
|
||||
{ name: this.$t('promotion-user.promotion-user.32bf15'), field: "order_total" },
|
||||
{ name: this.$t('promotion-user.promotion-user.8n4tr3'), field: "find_order_total" },
|
||||
{ name: this.$t('promotion-user.promotion-user.3l1187'), field: "referrer_count" },
|
||||
{ name: this.$t('team.team.6h2l64'), field: "add_time" },
|
||||
],
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: params,
|
||||
});
|
||||
this.init();
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 公共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", "team", "membershiplevelvip"),
|
||||
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 (res.data.data.data.length > 0) {
|
||||
if (this.data_page <= 1) {
|
||||
var temp_data_list = res.data.data.data;
|
||||
} else {
|
||||
var temp_data_list = this.data_list || [];
|
||||
var temp_data = res.data.data.data;
|
||||
for (var i in temp_data) {
|
||||
temp_data_list.push(temp_data[i]);
|
||||
}
|
||||
}
|
||||
|
||||
this.setData({
|
||||
data_list: temp_data_list,
|
||||
data_total: res.data.data.total,
|
||||
data_page_total: res.data.data.page_total,
|
||||
data_list_loding_status: 3,
|
||||
data_page: this.data_page + 1,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
|
||||
// 是否还有数据
|
||||
this.setData({
|
||||
data_bottom_line_status: this.data_page > 1 && this.data_page > this.data_page_total,
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_list: [],
|
||||
data_bottom_line_status: false,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
if (app.globalData.is_login_check(res.data, this, "get_data_list")) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
if(this.data_page > 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 滚动加载
|
||||
scroll_lower(e) {
|
||||
this.get_data_list();
|
||||
},
|
||||
|
||||
// 头像查看
|
||||
avatar_event(e) {
|
||||
var value = e.currentTarget.dataset.value || null;
|
||||
if (value != null) {
|
||||
uni.previewImage({
|
||||
current: value,
|
||||
urls: [value],
|
||||
});
|
||||
} else {
|
||||
app.globalData.showToast(this.$t('order.order.p3scy0'));
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import "./team.css";
|
||||
</style>
|
||||
104
pages/plugins/membershiplevelvip/user/user.css
Normal file
104
pages/plugins/membershiplevelvip/user/user.css
Normal file
@@ -0,0 +1,104 @@
|
||||
/*
|
||||
* 头部
|
||||
*/
|
||||
.head-item image {
|
||||
width: 116rpx;
|
||||
height: 116rpx !important;
|
||||
}
|
||||
|
||||
.head-base .level-icon {
|
||||
width: 30rpx;
|
||||
height: 30rpx !important;
|
||||
left: 16rpx;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
|
||||
.vip-btn {
|
||||
right: 0;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
|
||||
.submit-buy {
|
||||
/* height: 52rpx;
|
||||
line-height: 52rpx; */
|
||||
padding: 0 44rpx 0 24rpx;
|
||||
background-color: rgba(0, 0, 0, 0.15) !important;
|
||||
border-radius: 200rpx 0 0 200rpx;
|
||||
}
|
||||
|
||||
.submit-buy .right-icon {
|
||||
top: 64%;
|
||||
/* #ifdef H5 */
|
||||
top: 50%;
|
||||
/* #endif */
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
|
||||
.vip-badge {
|
||||
height: 44rpx;
|
||||
line-height: 44rpx;
|
||||
padding: 0 16rpx 0 51rpx;
|
||||
color: #FFAF36;
|
||||
}
|
||||
|
||||
/*
|
||||
* 推广客户
|
||||
*/
|
||||
.promotion .item {
|
||||
padding: 28rpx 20rpx;
|
||||
}
|
||||
|
||||
.promotion .item:first-child {
|
||||
background-color: #EAFEF7;
|
||||
}
|
||||
|
||||
.promotion .item:last-child {
|
||||
background-color: #EBF7FF;
|
||||
}
|
||||
|
||||
.promotion .item .num {
|
||||
font-size: 48rpx;
|
||||
}
|
||||
|
||||
.promotion image {
|
||||
width: 68rpx;
|
||||
height: 68rpx !important;
|
||||
}
|
||||
|
||||
.rebate .item .price {
|
||||
font-size: 44rpx;
|
||||
}
|
||||
|
||||
/*
|
||||
* 导航
|
||||
*/
|
||||
.nav .item {
|
||||
padding: 32rpx 20rpx;
|
||||
}
|
||||
|
||||
.nav .item image {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
}
|
||||
|
||||
/*
|
||||
* 提示信息
|
||||
*/
|
||||
.tips-container .tips-item {
|
||||
padding: 0 10rpx;
|
||||
}
|
||||
|
||||
.tips-container .not-opening-vip-desc {
|
||||
background: #def2fd;
|
||||
border: 1px solid #cfeeff;
|
||||
color: #1490d2;
|
||||
padding: 10rpx;
|
||||
font-size: 26rpx;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.uni-noticebar {
|
||||
margin: 0 !important;
|
||||
}
|
||||
359
pages/plugins/membershiplevelvip/user/user.vue
Normal file
359
pages/plugins/membershiplevelvip/user/user.vue
Normal file
@@ -0,0 +1,359 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<component-nav-back propColor="#333"></component-nav-back>
|
||||
<view v-if="(data_base || null) != null" class="weixin-nav-padding-top">
|
||||
<view class="padding-top-xxxl">
|
||||
<!-- 头部背景 -->
|
||||
<image :src="membershiplevelvip_static_url + 'title-bg.png'" mode="widthFix" class="pa top-0 bg-img wh-auto" />
|
||||
<view class="pr padding-top-main">
|
||||
<view class="padding-top-xxxl oh">
|
||||
<!-- 头部 -->
|
||||
<view class="head-box padding-main oh pr">
|
||||
<view class="head-item flex-row align-c">
|
||||
<image class="dis-block circle" @tap="preview_event" @error="user_avatar_error" :src="avatar" mode="widthFix"></image>
|
||||
<view class="head-name padding-left-main">
|
||||
<text class="text-size cr-black fw-b">{{ nickname }}</text>
|
||||
<view class="head-base margin-top-sm">
|
||||
<!-- 已开通会员 -->
|
||||
<block v-if="(user_vip || null) != null">
|
||||
<!-- 付费购买 -->
|
||||
<block v-if="(user_vip.user_vip_model || null) == 'pay'">
|
||||
<view v-if="(user_vip || null) != null" class="single-text vip-badge round bg-black pr text-size-xss">
|
||||
<image v-if="(user_vip.icon || null) != null" class="level-icon pa" :src="user_vip.icon" mode="widthFix"></image>
|
||||
<text v-if="(user_vip.name || null) != null">{{ user_vip.level_name }}</text>
|
||||
<!-- 判断会员永久 -->
|
||||
<block v-if="(user_vip.is_permanent || 0) == 1">
|
||||
<text class="padding-horizontal-xs">|</text>
|
||||
<text>{{ user_vip.permanent_value }}{{ user_vip.permanent_unit }}</text>
|
||||
</block>
|
||||
<block v-else>
|
||||
<block v-if="(user_vip.surplus_time_number || 0) !== 0">
|
||||
<text class="padding-horizontal-xs">|</text>
|
||||
<text>{{ user_vip.surplus_time_number }}{{ user_vip.surplus_time_unit }}</text>
|
||||
</block>
|
||||
</block>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view v-if="(user_vip || null) != null" class="single-text vip-badge round bg-black pr text-size-xss">
|
||||
<image v-if="(user_vip.icon || null) != null" class="level-icon pa" :src="user_vip.icon" mode="widthFix"></image>
|
||||
<text v-if="(user_vip.name || null) != null">{{ user_vip.level_name }}</text>
|
||||
</view>
|
||||
</block>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 已开通会员 -->
|
||||
<view class="pa vip-btn flex-row align-c">
|
||||
<text data-value="/pages/plugins/membershiplevelvip/member-code/member-code" @tap="url_event" class="cp">
|
||||
<iconfont name="icon-qrcode" size="44rpx" color="#fff" propClass="padding-right-main pr bottom-md"></iconfont>
|
||||
</text>
|
||||
<block v-if="(user_vip || null) != null">
|
||||
<!-- 判断会员永久 -->
|
||||
<block v-if="(user_vip.is_permanent || 0) !== 1">
|
||||
<!-- 会员已过期或未开通 -->
|
||||
<block v-if="(user_vip.surplus_time_number || 0) == 0">
|
||||
<button v-if="(data_base.is_user_buy || null) == 1" data-value="/pages/plugins/membershiplevelvip/buy/buy" @tap="url_event" class="submit-buy cr-white pr" type="default" size="mini" hover-class="none">{{$t('user.user.n4orgk')}}<iconfont name="icon-arrow-right" size="18rpx" propClass="pa right-icon"></iconfont></button>
|
||||
</block>
|
||||
<block v-else>
|
||||
<block v-if="(user_vip.is_supported_renew || null) == null || user_vip.is_supported_renew != 1">
|
||||
<block v-if="(data_base.is_supported_renew_old_order || null) == 1">
|
||||
<button size="mini" type="default" hover-class="none" class="submit-buy cr-white pr" @tap="uservip_renew_event" :disabled="submit_disabled_status">{{$t('user.user.k614v7')}}<iconfont name="icon-arrow-right" size="18rpx" propClass="pa right-icon"></iconfont>
|
||||
</button>
|
||||
</block>
|
||||
<block v-else>
|
||||
<block v-if="(data_base || null) != null && (data_base.is_user_buy || 0) == 1">
|
||||
<button data-value="/pages/plugins/membershiplevelvip/buy/buy" @tap="url_event" class="submit-buy cr-white pr" type="default" size="mini" hover-class="none">{{$t('user.user.65cc6z')}}<iconfont name="icon-arrow-right" size="18rpx" propClass="pa right-icon"></iconfont></button>
|
||||
</block>
|
||||
</block>
|
||||
</block>
|
||||
</block>
|
||||
</block>
|
||||
</block>
|
||||
<!-- 未开通会员 -->
|
||||
<block v-else>
|
||||
<block v-if="(data_base || null) != null && (data_base.is_user_buy || 0) == 1">
|
||||
<button data-value="/pages/plugins/membershiplevelvip/buy/buy" @tap="url_event" class="submit-buy cr-white pr" type="default" size="mini" hover-class="none">{{$t('user.user.n4orgk')}}<iconfont name="icon-arrow-right" size="18rpx" propClass="pa right-icon"></iconfont></button>
|
||||
</block>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 会员中心通知 -->
|
||||
<view v-if="(user_vip || null) != null && (data_base.user_vip_center_notice || null) != null && data_base.user_vip_center_notice.length > 0" class="padding-horizontal-main">
|
||||
<uni-notice-bar class="padding-0 margin-0" show-icon scrollable :text="data_base.user_vip_center_notice.join('')" background-color="transparent" color="#666" />
|
||||
</view>
|
||||
|
||||
<view v-if="statistics_data !== null" class="padding-horizontal-main spacing-mt">
|
||||
<!-- 推广客户 -->
|
||||
<view class="promotion padding-sm border-radius-main bg-white pr spacing-mb">
|
||||
<view class="title-left-border text-size fw-b padding-vertical-sm padding-horizontal-main margin-left-sm">{{$t('user.user.76dcx6')}}</view>
|
||||
<view class="flex-row jc-sa align-c">
|
||||
<block v-for="(item, index) in statistics_data.user_total" :key="index">
|
||||
<view class="flex-width-half">
|
||||
<view class="item border-radius-main margin-sm flex-row jc-c align-c">
|
||||
<image :src="item.icon" mode="widthFix" class="circle" />
|
||||
<view class="flex-1 flex-width padding-left-main">
|
||||
<view class="single-text margin-top-sm">
|
||||
<text class="num fw-b">{{ item.value }}</text>
|
||||
<text class="cr-grey-9 text-size-xs">{{$t('user.user.rjye50')}}</text>
|
||||
</view>
|
||||
<view class="cr-base text-size-xs single-text">{{ item.name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 返利概况 -->
|
||||
<view class="rebate profit-container padding-main border-radius-main bg-white">
|
||||
<view class="title-left-border text-size fw-b padding-vertical-sm padding-horizontal-main margin-left-sm">{{$t('user.user.981200')}}</view>
|
||||
<view class="oh tc flex-row jc-sa align-c">
|
||||
<block v-for="(item, index) in statistics_data.user_profit" :key="index">
|
||||
<view class="item padding-main flex-1" :class="index + 1 === statistics_data.user_profit.length ? '' : 'divider-r-f5'">
|
||||
<view class="single-text">
|
||||
<text>
|
||||
{{ item.first }}
|
||||
</text>
|
||||
<text class="fw-b price">
|
||||
{{ item.value }}
|
||||
</text>
|
||||
</view>
|
||||
<view class="cr-base text-size-xs margin-top-xs">{{ item.name }}</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 导航 -->
|
||||
<view v-if="nav_list.length > 0" class="nav oh flex-row flex-wrap padding-sm">
|
||||
<block v-for="(item, index) in nav_list" :key="index">
|
||||
<view class="flex-width-half">
|
||||
<view class="item bg-white border-radius-main margin-sm">
|
||||
<view :data-value="item.url" @tap="url_event" class="flex-row align-c cp">
|
||||
<image :src="item.icon" mode="scaleToFill" class="dis-block"></image>
|
||||
<view class="padding-left-main text-size fw-b flex-1 flex-width single-text">{{ item.title }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<!-- 会员中心通知 -->
|
||||
<view v-if="(data_base.not_opening_vip_desc || null) != null && data_base.not_opening_vip_desc.length > 0" class="padding-horizontal-main padding-bottom-lg">
|
||||
<uni-notice-bar class="padding-0" show-icon scrollable :text="data_base.not_opening_vip_desc.join('')" background-color="transparent" color="#666" />
|
||||
</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 componentNavBack from '@/components/nav-back/nav-back';
|
||||
import componentNoData from '@/components/no-data/no-data';
|
||||
var membershiplevelvip_static_url = app.globalData.get_static_url('membershiplevelvip', true) + 'app/';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
membershiplevelvip_static_url: membershiplevelvip_static_url,
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
data_base: null,
|
||||
user_vip: null,
|
||||
nav_list: [],
|
||||
avatar: app.globalData.data.default_user_head_src,
|
||||
nickname: this.$t('login.login.6yfr9g'),
|
||||
submit_disabled_status: false,
|
||||
// 推广客户,反力概况
|
||||
statistics_data: null,
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNavBack,
|
||||
componentNoData,
|
||||
},
|
||||
|
||||
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(e) {
|
||||
var user = app.globalData.get_user_info(this, 'init');
|
||||
if (user != false) {
|
||||
this.get_data();
|
||||
this.set_user_base(user);
|
||||
}
|
||||
},
|
||||
// 设置用户基础信息
|
||||
set_user_base(user) {
|
||||
if ((user.avatar || null) != null) {
|
||||
this.setData({ avatar: user.avatar });
|
||||
}
|
||||
if ((user.user_name_view || null) != null) {
|
||||
this.setData({ nickname: user.user_name_view });
|
||||
}
|
||||
},
|
||||
// 获取数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('index', 'vip', 'membershiplevelvip'),
|
||||
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,
|
||||
user_vip: data.user_vip || null,
|
||||
nav_list: data.nav_list || [],
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: 0,
|
||||
data_bottom_line_status: false,
|
||||
statistics_data: data.statistics_data || null,
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
if (app.globalData.is_login_check(res.data, this, 'get_data')) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: this.$t('common.internet_error_tips'),
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 头像查看
|
||||
preview_event() {
|
||||
if (app.globalData.data.default_user_head_src != this.avatar) {
|
||||
uni.previewImage({
|
||||
current: this.avatar,
|
||||
urls: [this.avatar],
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 头像加载错误
|
||||
user_avatar_error(e) {
|
||||
this.setData({
|
||||
avatar: app.globalData.data.default_user_head_src,
|
||||
});
|
||||
},
|
||||
|
||||
// 连续开通会员事件
|
||||
uservip_renew_event(e) {
|
||||
var self = this;
|
||||
uni.showModal({
|
||||
title: this.$t('common.warm_tips'),
|
||||
content: this.$t('user.user.95s1ez'),
|
||||
confirmText: this.$t('common.confirm'),
|
||||
cancelText: this.$t('common.not_yet'),
|
||||
success: (result) => {
|
||||
if (result.confirm) {
|
||||
// 请求生成支付订单
|
||||
self.setData({
|
||||
submit_disabled_status: true,
|
||||
});
|
||||
uni.showLoading({
|
||||
title: this.$t('common.processing_in_text'),
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('renew', 'buy', 'membershiplevelvip'),
|
||||
method: 'POST',
|
||||
data: {},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
self.setData({
|
||||
submit_disabled_status: false,
|
||||
});
|
||||
if (res.data.code == 0) {
|
||||
uni.setStorageSync(app.globalData.data.cache_page_pay_key, res.data.data.id);
|
||||
app.globalData.url_open('/pages/plugins/membershiplevelvip/order/order', true);
|
||||
} else {
|
||||
if (app.globalData.is_login_check(res.data, self, 'uservip_renew_event')) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
self.setData({
|
||||
submit_disabled_status: false,
|
||||
});
|
||||
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 './user.css';
|
||||
</style>
|
||||
Reference in New Issue
Block a user