提交 00745363 编写于 作者: G gongfuxiang

会员开发

上级 8480a64b
......@@ -220,10 +220,6 @@
"path": "pages/plugins/membershiplevelvip/index/index",
"style": {
"enablePullDownRefresh": true,
"navigationBarBackgroundColor": "#1d1611",
"backgroundColorTop": "#1d1611",
"backgroundColorBottom": "#f5f5f5",
"backgroundTextStyle": "light",
"navigationBarTitleText": "会员VIP"
}
},
......@@ -231,21 +227,13 @@
"path": "pages/plugins/membershiplevelvip/buy/buy",
"style": {
"enablePullDownRefresh": true,
"navigationBarBackgroundColor": "#1d1611",
"backgroundColorTop": "#1d1611",
"backgroundColorBottom": "#f5f5f5",
"backgroundTextStyle": "light",
"navigationBarTitleText": "开通时长"
"navigationBarTitleText": "开通会员"
}
},
{
"path": "pages/plugins/membershiplevelvip/user/user",
"style": {
"enablePullDownRefresh": true,
"navigationBarBackgroundColor": "#1d1611",
"backgroundColorTop": "#1d1611",
"backgroundColorBottom": "#f5f5f5",
"backgroundTextStyle": "light",
"navigationBarTitleText": "我的会员"
}
},
......@@ -253,10 +241,6 @@
"path": "pages/plugins/membershiplevelvip/order/order",
"style": {
"enablePullDownRefresh": true,
"navigationBarBackgroundColor": "#1d1611",
"backgroundColorTop": "#1d1611",
"backgroundColorBottom": "#f5f5f5",
"backgroundTextStyle": "light",
"navigationBarTitleText": "订单列表"
}
},
......@@ -264,10 +248,6 @@
"path": "pages/plugins/membershiplevelvip/order-detail/order-detail",
"style": {
"enablePullDownRefresh": true,
"navigationBarBackgroundColor": "#1d1611",
"backgroundColorTop": "#1d1611",
"backgroundColorBottom": "#f5f5f5",
"backgroundTextStyle": "light",
"navigationBarTitleText": "订单详情"
}
},
......@@ -275,10 +255,6 @@
"path": "pages/plugins/membershiplevelvip/profit/profit",
"style": {
"enablePullDownRefresh": true,
"navigationBarBackgroundColor": "#1d1611",
"backgroundColorTop": "#1d1611",
"backgroundColorBottom": "#f5f5f5",
"backgroundTextStyle": "light",
"navigationBarTitleText": "收益明细"
}
},
......@@ -286,10 +262,6 @@
"path": "pages/plugins/membershiplevelvip/profit-detail/profit-detail",
"style": {
"enablePullDownRefresh": true,
"navigationBarBackgroundColor": "#1d1611",
"backgroundColorTop": "#1d1611",
"backgroundColorBottom": "#f5f5f5",
"backgroundTextStyle": "light",
"navigationBarTitleText": "收益详情"
}
},
......@@ -297,10 +269,6 @@
"path": "pages/plugins/membershiplevelvip/statistics/statistics",
"style": {
"enablePullDownRefresh": true,
"navigationBarBackgroundColor": "#1d1611",
"backgroundColorTop": "#1d1611",
"backgroundColorBottom": "#f5f5f5",
"backgroundTextStyle": "light",
"navigationBarTitleText": "数据统计"
}
},
......@@ -308,10 +276,6 @@
"path": "pages/plugins/membershiplevelvip/poster/poster",
"style": {
"enablePullDownRefresh": true,
"navigationBarBackgroundColor": "#1d1611",
"backgroundColorTop": "#1d1611",
"backgroundColorBottom": "#f5f5f5",
"backgroundTextStyle": "light",
"navigationBarTitleText": "推广返利"
}
},
......@@ -319,10 +283,6 @@
"path": "pages/plugins/membershiplevelvip/team/team",
"style": {
"enablePullDownRefresh": true,
"navigationBarBackgroundColor": "#1d1611",
"backgroundColorTop": "#1d1611",
"backgroundColorBottom": "#f5f5f5",
"backgroundTextStyle": "light",
"navigationBarTitleText": "我的团队"
}
},
......
/**
* common
*/
.page {
padding-bottom: 120rpx;
}
/**
* 导航
*/
.nav {
height: 80rpx;
line-height: 80rpx;
}
/**
* 内容
*/
.data-list .item {
border: 1px solid #fff;
}
.data-list .item .number {
width: calc(40% - 40rpx);
}
.data-list .item .price {
width: calc(60% - 40rpx)
}
\ No newline at end of file
<template>
<view>
<view v-if="(data_list || null) != null && data_list.length > 0" class="page">
<!-- 导航 -->
<scroll-view class="tabs bg-white tc oh" scroll-x="true">
<block v-for="(item, index) in data_list" :key="index">
<view :class="'item cr-gray ' + (selected_tabs_index === index ? 'active' : '')" @tap="tabs_event" :data-index="index">{{item.name}}</view>
</block>
</scroll-view>
<!-- 内容 -->
<view class="content spacing-mt">
<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">
<block v-for="(rules, index2) in item.pay_period_rules" :key="index2">
<view :class="'item oh tc bg-white ' + (selected_content_index === index ? 'active' : '')" @tap="content_event" :data-index="index">
<view class="fl number single-text">
<text v-if="(rules.number || null) == null" class="value">终身</text>
<text v-else class="value">{{rules.value}}</text>
<text v-if="(rules.unit || null) != null" class="unit">{{rules.unit}}</text>
</view>
<view class="fr price bg-white single-text">
<text class="symbol">¥</text>
<text class="value">{{rules.price}}</text>
<text class="unit"></text>
</view>
<template>
<view>
<view v-if="(data_base || null) != null">
<view v-if="(data_list || null) != null && data_list.length > 0" class="page">
<!-- 导航 -->
<scroll-view class="nav scroll-view-horizontal bg-white tc oh" 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-gray ' + (selected_tabs_index === index ? 'cr-main' : '')" @tap="tabs_event" :data-index="index">{{item.name}}</view>
</block>
</scroll-view>
<!-- 内容 -->
<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 padding-horizontal-main padding-top-main">
<block v-for="(rules, index2) in item.pay_period_rules" :key="index2">
<view :class="'item padding-main border-radius-main bg-white oh tc spacing-mb ' + (selected_content_index === index ? 'border-color-main' : '')" @tap="content_event" :data-index="index">
<view class="fl number single-text">
<text class="fw-b cr-base text-size">{{((rules.number || null) == null) ? '终身' : rules.value}}</text>
<text v-if="(rules.unit || null) != null" class="cr-grey margin-left-sm">{{rules.unit}}</text>
</view>
<view class="fr price bg-white single-text">
<text class="cr-main">¥</text>
<text class=" fw-b cr-main text-size-lg">{{rules.price}}</text>
<text class="cr-grey margin-left-sm"></text>
</view>
</view>
</block>
<view class="submit-fixed">
<button class="bg-main br-main cr-white round text-size margin-horizontal-main margin-bottom-main" type="default" hover-class="none" @tap="submit_event" :disabled="submit_disabled_status">确认支付</button>
</view>
</view>
<!-- 结尾 -->
<component-bottom-line :prop-status="true"></component-bottom-line>
</block>
<block v-else>
<!-- 提示信息 -->
<component-no-data prop-status="0" prop-msg="购买时长未配置"></component-no-data>
</block>
</block>
</block>
</view>
<view v-else>
<!-- 提示信息 -->
<component-no-data prop-status="0" prop-msg="未配置会员等级"></component-no-data>
</view>
</block>
<!--<import src="/pages/common/bottom_line.wxml"></import>-->
<block data-type="template" data-is="bottom_line" data-attr="status: true">
<view v-if="(status || false)" class="data-bottom-line">
<view class="left fl"></view>
<view class="msg fl">我是有底线的</view>
<view class="right fr"></view>
</view>
</block>
<button class="submit-fixed submit-bottom" type="default" hover-class="none" @tap="submit_event" :disabled="submit_disabled_status">确认支付</button>
</block>
<block v-else>
<!--<import src="/pages/common/nodata.wxml"></import>-->
<block data-type="template" data-is="nodata" data-attr="status: 0, msg: '购买时长未配置'">
<!-- 1 加载中 -->
<view v-if="0 == 1" class="no-data-loding tc">
<text>加载中...</text>
</view>
<!-- 2 处理错误 -->
<view v-else-if="0 == 2" class="no-data-box tc">
<image src="/static/images/error.png" mode="widthFix"></image>
<view class="no-data-tips">{{msg || '处理错误'}}</view>
</view>
<!-- 0 默认没有数据 -->
<view v-else-if="0 == 0" class="no-data-box tc">
<image src="/static/images/empty.png" mode="widthFix"></image>
<view class="no-data-tips">{{msg || '没有相关数据'}}</view>
</view>
</block>
</block>
</block>
</block>
</view>
</view>
<view v-else>
<!--<import src="/pages/common/nodata.wxml"></import>-->
<block data-type="template" data-is="nodata" data-attr="status: 0, msg: '未配置会员等级'">
<!-- 1 加载中 -->
<view v-if="0 == 1" class="no-data-loding tc">
<text>加载中...</text>
</view>
<!-- 2 处理错误 -->
<view v-else-if="0 == 2" class="no-data-box tc">
<image src="/static/images/error.png" mode="widthFix"></image>
<view class="no-data-tips">{{msg || '处理错误'}}</view>
</view>
<!-- 0 默认没有数据 -->
<view v-else-if="0 == 0" class="no-data-box tc">
<image src="/static/images/empty.png" mode="widthFix"></image>
<view class="no-data-tips">{{msg || '没有相关数据'}}</view>
</view>
</block>
</view>
</view>
</template>
<script>
const app = getApp();
export default {
data() {
return {
data_bottom_line_status: false,
data_list_loding_status: 1,
data_list_loding_msg: '',
data_list: [],
data_base: null,
selected_tabs_index: 0,
selected_content_index: null,
submit_disabled_status: false
};
},
components: {},
props: {},
onLoad(params) {
this.init();
},
onShow() {},
// 下拉刷新
onPullDownRefresh() {
this.get_data_list();
},
methods: {
init() {
// 获取数据
this.get_data_list();
},
// 获取数据
get_data_list() {
var self = this;
uni.showLoading({
title: "加载中..."
});
if (self.data_list.length <= 0) {
self.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.hideLoading();
uni.stopPullDownRefresh();
if (res.data.code == 0) {
var data = res.data.data;
var status = (data.data || []).length > 0;
self.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
});
} else {
self.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, self, 'get_data_list')) {
app.globalData.showToast(res.data.msg);
}
}
},
fail: () => {
uni.hideLoading();
uni.stopPullDownRefresh();
self.setData({
data_bottom_line_status: false,
data_list_loding_status: 2,
data_list_loding_msg: '服务器请求出错'
});
app.globalData.showToast("服务器请求出错");
}
});
},
// tabs事件
tabs_event(e) {
this.setData({
selected_tabs_index: e.currentTarget.dataset.index || 0,
selected_content_index: null
});
},
// 时长事件
content_event(e) {
this.setData({
selected_content_index: e.currentTarget.dataset.index || 0
});
},
// 确认支付事件
submit_event(e) {
if (this.selected_tabs_index < 0 || this.selected_content_index === null) {
app.globalData.showToast('请选择开通时长');
return false;
} // 请求参数
var item = this.data_list[this.selected_tabs_index] || null;
if (item == null) {
app.globalData.showToast('开通时长有误');
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('开通时长有误');
return false;
} // 请求生成支付订单
var self = this;
self.setData({
submit_disabled_status: true
});
uni.showLoading({
title: "处理中..."
});
uni.request({
url: app.globalData.get_request_url("create", "buy", "membershiplevelvip"),
method: "POST",
data: {
"opening": item['id'] + '-' + rules['number']
},
dataType: "json",
header: {
'content-type': 'application/x-www-form-urlencoded'
},
success: res => {
uni.hideLoading();
self.setData({
submit_disabled_status: false
});
if (res.data.code == 0) {
// 进入以后会员中心并发起支付
uni.redirectTo({
url: '/pages/plugins/membershiplevelvip/order/order?is_pay=1&order_id=' + res.data.data.id
});
} else {
if (app.globalData.is_login_check(res.data, self, 'submit_event')) {
app.globalData.showToast(res.data.msg);
}
}
},
fail: () => {
self.setData({
submit_disabled_status: false
});
uni.hideLoading();
app.globalData.showToast("服务器请求出错");
}
});
}
}
};
</script>
<style>
/**
* common
*/
.page {
padding-bottom: 100rpx;
}
/**
* tabs
*/
.tabs {
width: 100%;
height: 80rpx;
white-space: nowrap;
box-sizing: border-box;
}
.tabs .item {
padding: 20rpx 30rpx;
border-bottom: 3px solid #f0f0f0;
display: inline-block;
position: relative;
}
.tabs .active {
border-bottom: 3px solid #1d1611;
color: #1d1611;
}
/**
* content
*/
.content .item {
cursor: pointer;
border: 1px solid #D6D6D6;
margin: 0 20rpx 30rpx 20rpx;
}
.content .item .number {
background: #f2f2f2;
width: calc(40% - 40rpx);
}
.content .item .price {
width: calc(60% - 40rpx)
}
.content .item .number,
.content .item .price {
padding: 20rpx;
}
.content .item .number .value {
color: #666;
}
.content .item .price .value,
.content .item .price .symbol {
color: #1d1611;
}
.content .item .value {
font-size: 38rpx;
}
.content .item .unit {
color: #888;
margin-left: 10rpx;
}
.content .active {
border-color: #1d1611;
box-shadow: 0px 0 0px 1px #1d1611
}
.content .submit-bottom {
background: #f9d681 !important;
color: #351d06 !important;
}
</view>
<view v-else>
<!-- 提示信息 -->
<component-no-data :prop-status="data_list_loding_status" :prop-msg="data_list_loding_msg"></component-no-data>
</view>
</view>
</template>
<script>
const app = getApp();
import componentNoData from "../../../../components/no-data/no-data";
import componentBottomLine from "../../../../components/bottom-line/bottom-line";
export default {
data() {
return {
data_bottom_line_status: false,
data_list_loding_status: 1,
data_list_loding_msg: '',
data_list: [],
data_base: null,
selected_tabs_index: 0,
selected_content_index: null,
submit_disabled_status: false
};
},
components: {
componentNoData,
componentBottomLine
},
props: {},
onLoad(params) {
this.init();
},
onShow() {},
// 下拉刷新
onPullDownRefresh() {
this.get_data_list();
},
methods: {
init() {
// 获取数据
this.get_data_list();
},
// 获取数据
get_data_list() {
uni.showLoading({
title: "加载中..."
});
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.hideLoading();
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
});
} 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.hideLoading();
uni.stopPullDownRefresh();
this.setData({
data_bottom_line_status: false,
data_list_loding_status: 2,
data_list_loding_msg: '服务器请求出错'
});
app.globalData.showToast("服务器请求出错");
}
});
},
// tabs事件
tabs_event(e) {
this.setData({
selected_tabs_index: e.currentTarget.dataset.index || 0,
selected_content_index: null
});
},
// 时长事件
content_event(e) {
this.setData({
selected_content_index: e.currentTarget.dataset.index || 0
});
},
// 确认支付事件
submit_event(e) {
if (this.selected_tabs_index < 0 || this.selected_content_index === null) {
app.globalData.showToast('请选择开通时长');
return false;
}
// 请求参数
var item = this.data_list[this.selected_tabs_index] || null;
if (item == null) {
app.globalData.showToast('开通时长有误');
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('开通时长有误');
return false;
}
// 请求生成支付订单
this.setData({
submit_disabled_status: true
});
uni.showLoading({
title: "处理中..."
});
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) {
// 进入以后会员中心并发起支付
uni.redirectTo({
url: '/pages/plugins/membershiplevelvip/order/order?is_pay=1&order_id=' + 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("服务器请求出错");
}
});
}
}
};
</script>
<style>
@import './buy.css';
</style>
\ No newline at end of file
/**
* banner
*/
.banner {
background-color: #1d1611;
background-position: center center;
background-repeat: no-repeat;
background-size: auto 100%;
height: 1000rpx;
}
.banner-title {
color: #f9d681;
}
.banner-buy {
border: 1rpx solid #f9d681;
background-color: #f9d681 !important;
color: #351d06 !important;
width: 280rpx;
height: 80rpx;
line-height: 80rpx !important;
}
/**
* 等级介绍
*/
.data-list .item {
width: calc(50% - 70rpx);
margin-bottom: 20rpx;
}
.data-list .item:nth-child(2n) {
margin-right: 20rpx;
margin-left: 10rpx;
}
.data-list .item:nth-child(2n+1) {
margin-left: 20rpx;
margin-right: 10rpx;
}
.data-list .item image {
width: 160rpx;
height: 160rpx !important;
}
\ No newline at end of file
<template>
<view>
<view v-if="(data_base || null) != null" class="banner tc" :style="'background-image: url(' + data_base.banner_bg_images + ');'">
<!-- banner -->
<view v-if="(data_base.banner_top_title || null) != null" class="single-text banner-title">
{{data_base.banner_top_title}}
</view>
<view class="submit">
<navigator url="/pages/plugins/membershiplevelvip/buy/buy" hover-class="none">
<button size="mini" type="default" hover-class="none">
{{data_base.banner_middle_name || '开通会员'}}
</button>
</navigator>
</view>
<!-- 数据列表 -->
<view v-if="(data_list || null) != null && data_list.length > 0" class="data-list">
<view v-for="(item, index) in data_list" :key="index" class="item fl">
<view class="content">
<view class="title single-text">{{item.name}}</view>
<view class="desc multi-text">{{item.desc}}</view>
<image :src="item.images_url" mode="scaleToFill" class="dis-block"></image>
</view>
</view>
</view>
</view>
<view v-if="(data_base.banner_bottom_content || null) != null" class="bg-white rich-text">
<rich-text :nodes="data_base.banner_bottom_content"></rich-text>
</view>
<view v-if="(data_base || null) == null && (data_list || null) == null && data_list.length <= 0">
<!--<import src="/pages/common/nodata.wxml"></import>-->
<block data-type="template" data-is="nodata" data-attr="status: data_list_loding_status, msg: data_list_loding_msg">
<!-- 1 加载中 -->
<view v-if="0 == 1" class="no-data-loding tc">
<text>加载中...</text>
</view>
<!-- 2 处理错误 -->
<view v-else-if="0 == 2" class="no-data-box tc">
<image src="/static/images/error.png" mode="widthFix"></image>
<view class="no-data-tips">{{msg || '处理错误'}}</view>
</view>
<!-- 0 默认没有数据 -->
<view v-else-if="0 == 0" class="no-data-box tc">
<image src="/static/images/empty.png" mode="widthFix"></image>
<view class="no-data-tips">{{msg || '没有相关数据'}}</view>
</view>
</block>
</view>
<!--<import src="/pages/common/bottom_line.wxml"></import>-->
<block data-type="template" data-is="bottom_line" data-attr="status: data_bottom_line_status">
<view v-if="(status || false)" class="data-bottom-line">
<view class="left fl"></view>
<view class="msg fl">我是有底线的</view>
<view class="right fr"></view>
</view>
</block>
</view>
</template>
<view>
<view v-if="(data_base || null) != null">
<view class="banner tc oh pr wh-auto" :style="'background-image: url(' + data_base.banner_bg_images + ');'">
<!-- 标题 -->
<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>
<!-- 购买按钮 -->
<navigator url="/pages/plugins/membershiplevelvip/buy/buy" hover-class="none" class="dis-inline">
<button class="banner-buy text-size fw-b round margin-top-xxxl" type="default" size="mini" hover-class="none">
{{data_base.banner_middle_name || '开通会员'}}
</button>
</navigator>
<!-- 数据列表 -->
<view v-if="(data_list || null) != null && data_list.length > 0" class="data-list oh margin-top-xxxl">
<block v-for="(item, index) in data_list" :key="index" class="item fl">
<view class="item fl tc padding-main border-radius-main bg-white">
<view class="single-text cr-base text-size fw-b">{{item.name}}</view>
<view class="multi-text cr-grey margin-top-sm">{{item.desc}}</view>
<image class="dis-block auto margin-top-sm" :src="item.images_url" mode="scaleToFill"></image>
</view>
</block>
</view>
</view>
<!-- 富文本 -->
<view v-if="(data_base.banner_bottom_content || null) != null" class="padding-main spacing-mt">
<view class="border-radius-main bg-white">
<rich-text :nodes="data_base.banner_bottom_content"></rich-text>
</view>
</view>
</view>
<view v-else>
<!-- 提示信息 -->
<component-no-data :prop-status="data_list_loding_status" :prop-msg="data_list_loding_msg"></component-no-data>
</view>
<!-- 结尾 -->
<component-bottom-line :prop-status="data_bottom_line_status"></component-bottom-line>
</view>
</template>
<script>
const app = getApp();
const app = getApp();
import componentNoData from "../../../../components/no-data/no-data";
import componentBottomLine from "../../../../components/bottom-line/bottom-line";
export default {
data() {
return {
data_bottom_line_status: false,
data_list_loding_status: 1,
data_list_loding_msg: '',
data_list: [],
data_base: null
};
},
components: {},
props: {},
onLoad(params) {
this.init(); // 显示分享菜单
app.globalData.show_share_menu();
},
onShow() {},
// 下拉刷新
onPullDownRefresh() {
this.get_data_list();
},
// 自定义分享
onShareAppMessage() {
var user_id = app.globalData.get_user_cache_info('id', 0) || 0;
var name = (this.data_base || null) != null && (this.data_base.application_name || null) != null ? this.data_base.application_name : app.globalData.data.application_title;
return {
title: name,
desc: app.globalData.data.application_describe,
path: '/pages/index/index?referrer=' + user_id
};
},
// 分享朋友圈
onShareTimeline() {
var user_id = app.globalData.get_user_cache_info('id', 0) || 0;
var name = (this.data_base || null) != null && (this.data_base.application_name || null) != null ? this.data_base.application_name : app.globalData.data.application_title;
return {
title: name,
query: 'referrer=' + user_id
};
},
methods: {
init() {
// 获取数据
this.get_data_list();
},
// 获取数据
get_data_list() {
var self = this;
uni.showLoading({
title: "加载中..."
});
if (self.data_list.length <= 0) {
self.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.hideLoading();
uni.stopPullDownRefresh();
if (res.data.code == 0) {
var data = res.data.data;
self.setData({
data_base: data.base || null,
data_list: data.data || [],
data_list_loding_msg: '',
data_list_loding_status: 0,
data_bottom_line_status: true
}); // 导航名称
if ((data.base || null) != null && (data.base.application_name || null) != null) {
uni.setNavigationBarTitle({
title: data.base.application_name
});
}
} else {
self.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, self, 'get_data_list')) {
app.globalData.showToast(res.data.msg);
}
}
},
fail: () => {
uni.hideLoading();
uni.stopPullDownRefresh();
self.setData({
data_bottom_line_status: false,
data_list_loding_status: 2,
data_list_loding_msg: '服务器请求出错'
});
app.globalData.showToast("服务器请求出错");
}
});
}
export default {
data() {
return {
data_bottom_line_status: false,
data_list_loding_status: 1,
data_list_loding_msg: '',
data_list: [],
data_base: null
};
},
components: {
componentNoData,
componentBottomLine
},
props: {},
onLoad(params) {
this.init();
}
};
// 显示分享菜单
app.globalData.show_share_menu();
},
onShow() {},
// 下拉刷新
onPullDownRefresh() {
this.get_data_list();
},
// 自定义分享
onShareAppMessage() {
var user_id = app.globalData.get_user_cache_info('id', 0) || 0;
var name = (this.data_base || null) != null && (this.data_base.application_name || null) != null ? this.data_base.application_name : app.globalData.data.application_title;
return {
title: name,
desc: app.globalData.data.application_describe,
path: '/pages/index/index?referrer=' + user_id
};
},
// 分享朋友圈
onShareTimeline() {
var user_id = app.globalData.get_user_cache_info('id', 0) || 0;
var name = (this.data_base || null) != null && (this.data_base.application_name || null) != null ? this.data_base.application_name : app.globalData.data.application_title;
return {
title: name,
query: 'referrer=' + user_id
};
},
methods: {
init() {
// 获取数据
this.get_data_list();
},
// 获取数据
get_data_list() {
var self = this;
uni.showLoading({
title: "加载中..."
});
if (self.data_list.length <= 0) {
self.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.hideLoading();
uni.stopPullDownRefresh();
if (res.data.code == 0) {
var data = res.data.data;
self.setData({
data_base: data.base || null,
data_list: data.data || [],
data_list_loding_msg: '',
data_list_loding_status: 0,
data_bottom_line_status: true
});
// 导航名称
if ((data.base || null) != null && (data.base.application_name || null) != null) {
uni.setNavigationBarTitle({
title: data.base.application_name
});
}
} else {
self.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, self, 'get_data_list')) {
app.globalData.showToast(res.data.msg);
}
}
},
fail: () => {
uni.hideLoading();
uni.stopPullDownRefresh();
self.setData({
data_bottom_line_status: false,
data_list_loding_status: 2,
data_list_loding_msg: '服务器请求出错'
});
app.globalData.showToast("服务器请求出错");
}
});
}
}
};
</script>
<style>
/**
* banner
*/
.banner {
background-color: #1d1611;
background-position: center center;
background-repeat: no-repeat;
background-size: auto 100%;
position: relative;
height: 1110rpx;
width: 100%;
overflow: hidden;
}
.banner .banner-title {
font-size: 60rpx;
margin-top: 50rpx;
color: #f9d681;
height: 68rpx;
overflow: hidden;
}
.banner .submit {
margin-top: 60rpx;
}
.banner .submit button {
border: 1rpx solid #f9d681;
background-color: #f9d681;
color: #351d06;
width: 320rpx;
height: 80rpx;
line-height: 80rpx;
font-size: 36rpx;
border-radius: 50rpx;
font-weight: 500;
}
/**
* 等级介绍
*/
.data-list {
margin-top: 40rpx;
}
.data-list .item {
padding: 15rpx;
width: calc(50% - 30rpx);
}
.data-list .item .content {
overflow: hidden;
border-radius: 8rpx;
background-color: #fff;
padding: 30rpx 10rpx;
}
.data-list .item .content .title {
height: 36rpx;
line-height: 36rpx;
font-size: 36rpx;
color: #333;
}
.data-list .item .content .desc {
height: 76rpx;
line-height: 38rpx;
font-size: 30rpx;
color: #999;
}
.data-list .item .content .title,
.data-list .item .content .desc {
margin-bottom: 15rpx;
}
.data-list .item .content image {
max-width: 160rpx;
max-height: 160rpx;
margin:0 auto;
}
/**
* 富文本
*/
.rich-text {
padding: 20rpx 10rpx;
}
@import './index.css';
</style>
\ No newline at end of file
/*
* 头部
*/
.head-box {
background-color: #3e2a1c;
}
.head-item {
width: 260rpx;
}
.head-item .avatar,
.head-item .avatar image {
width: 130rpx;
height: 130rpx !important;
margin: 0 auto;
}
.head-base {
width: calc(100% - 270rpx);
}
.head-base .level-icon {
width: 35rpx;
height: 35rpx !important;
}
.head-base .level-name {
color: #e4cb96;
}
.head-base .submit-buy {
font-size: 26rpx;
height: 55rpx;
line-height: 55rpx;
border: 1px solid #f9d681;
background-color: #f9d681;
color: #351d06;
right: 20rpx;
bottom: 20rpx;
padding: 0 20rpx;
}
/*
* 导航
*/
.nav .item {
width: calc(50% - 70rpx);
margin-bottom: 20rpx;
}
.nav .item:nth-child(2n) {
margin-right: 20rpx;
margin-left: 10rpx;
}
.nav .item:nth-child(2n+1) {
margin-left: 20rpx;
margin-right: 10rpx;
}
.nav .item image {
width: 80rpx;
height: 80rpx;
margin: 0 auto;
}
/*
* 提示信息
*/
.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;
}
\ No newline at end of file
......@@ -9,7 +9,7 @@
<view class="fl cr-gray unit"></view>
</view>
<view class="item oh margin-top-sm">
<view class="fl cr-bas">冻结</view>
<view class="fl cr-base">冻结</view>
<view class="fl cr-red fw-b single-text margin-left-sm margin-right-sm">{{user_wallet.frozen_money || '0.00'}}</view>
<view class="fl cr-gray unit"></view>
</view>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册