mirror of
https://gitee.com/zongzhige/shopxo.git
synced 2024-11-30 10:59:47 +08:00
小程序开发
This commit is contained in:
parent
7a3bfc390e
commit
5e09f5dc8f
@ -63,10 +63,6 @@ App({
|
||||
"coupon": "领劵中心",
|
||||
"user_coupon": "优惠劵",
|
||||
"extraction_address": "自提地址",
|
||||
"membervip": "会员VIP",
|
||||
"membervip_buy": "开通时长",
|
||||
"membervip_order": "开通订单",
|
||||
"membervip_order_detail": "订单详情",
|
||||
},
|
||||
|
||||
// 请求地址
|
||||
|
@ -1,5 +1,6 @@
|
||||
{
|
||||
"pages": ["pages/plugins/membershiplevelvip/user/user",
|
||||
"pages": [
|
||||
"pages/plugins/membershiplevelvip/user/user",
|
||||
"pages/index/index",
|
||||
"pages/goods-category/goods-category",
|
||||
"pages/cart/cart",
|
||||
@ -31,9 +32,10 @@
|
||||
"pages/plugins/coupon/user/user",
|
||||
"pages/plugins/membershiplevelvip/index/index",
|
||||
"pages/plugins/membershiplevelvip/buy/buy",
|
||||
|
||||
"pages/plugins/membershiplevelvip/order/order",
|
||||
"pages/plugins/membershiplevelvip/order-detail/order-detail"
|
||||
"pages/plugins/membershiplevelvip/order-detail/order-detail",
|
||||
"pages/plugins/membershiplevelvip/shouyi-detail/shouyi-detail",
|
||||
"pages/plugins/membershiplevelvip/shouyi/shouyi"
|
||||
],
|
||||
"window": {
|
||||
"navigationBarTitleText": "{{application_title}}",
|
||||
|
@ -16,9 +16,7 @@ Page({
|
||||
this.init();
|
||||
},
|
||||
|
||||
onShow() {
|
||||
wx.setNavigationBarTitle({ title: app.data.common_pages_title.membervip_buy });
|
||||
},
|
||||
onShow() {},
|
||||
|
||||
init() {
|
||||
// 获取数据
|
||||
|
@ -2,5 +2,6 @@
|
||||
"enablePullDownRefresh": true,
|
||||
"navigationBarBackgroundColor": "#1d1611",
|
||||
"backgroundColorTop": "#1d1611",
|
||||
"backgroundColorBottom": "#f5f5f5"
|
||||
"backgroundColorBottom": "#f5f5f5",
|
||||
"navigationBarTitleText": "开通时长"
|
||||
}
|
@ -2,7 +2,7 @@
|
||||
<!-- 导航 -->
|
||||
<scroll-view class="tabs bg-white tc oh" scroll-x="true">
|
||||
<block wx:for="{{data_list}}" wx:key="key">
|
||||
<view class="item {{selected_tabs_index === index ? 'active' : ''}}" bindtap="tabs_event" data-index="{{index}}">{{item.name}}</view>
|
||||
<view class="item cr-888 {{selected_tabs_index === index ? 'active' : ''}}" bindtap="tabs_event" data-index="{{index}}">{{item.name}}</view>
|
||||
</block>
|
||||
</scroll-view>
|
||||
|
||||
|
@ -12,9 +12,7 @@ Page({
|
||||
this.init();
|
||||
},
|
||||
|
||||
onShow() {
|
||||
wx.setNavigationBarTitle({ title: app.data.common_pages_title.membervip });
|
||||
},
|
||||
onShow() {},
|
||||
|
||||
init() {
|
||||
// 获取数据
|
||||
|
@ -1,5 +1,6 @@
|
||||
{
|
||||
"enablePullDownRefresh": true,
|
||||
"navigationBarBackgroundColor": "#1d1611",
|
||||
"backgroundColor": "#1d1611"
|
||||
"backgroundColor": "#1d1611",
|
||||
"navigationBarTitleText": "会员VIP"
|
||||
}
|
@ -16,9 +16,7 @@ Page({
|
||||
this.init();
|
||||
},
|
||||
|
||||
onShow() {
|
||||
wx.setNavigationBarTitle({ title: app.data.common_pages_title.membervip_order_detail });
|
||||
},
|
||||
onShow() {},
|
||||
|
||||
init() {
|
||||
var self = this;
|
||||
@ -43,7 +41,7 @@ Page({
|
||||
detail: data.data,
|
||||
detail_list: [
|
||||
{ name: "订单号", value: data.data.payment_user_order_no || '' },
|
||||
{ name: "开通时长", value: data.data.period_value+' '+data.data.period_unit },
|
||||
{ name: "开通时长", value: data.data.period_value+' '+data.data.period_unit || '' },
|
||||
{ name: "订单状态", value: data.data.status_name || '' },
|
||||
{ name: "结算状态", value: data.data.settlement_status_name || '' },
|
||||
{ name: "类型", value: data.data.type_name || '' },
|
||||
|
@ -1,4 +1,5 @@
|
||||
{
|
||||
"enablePullDownRefresh": true,
|
||||
"navigationBarBackgroundColor": "#1d1611"
|
||||
"navigationBarBackgroundColor": "#1d1611",
|
||||
"navigationBarTitleText": "订单详情"
|
||||
}
|
@ -42,9 +42,7 @@ Page({
|
||||
this.init();
|
||||
},
|
||||
|
||||
onShow() {
|
||||
wx.setNavigationBarTitle({ title: app.data.common_pages_title.membervip_order });
|
||||
},
|
||||
onShow() {},
|
||||
|
||||
init() {
|
||||
var user = app.get_user_info(this, 'init');
|
||||
|
@ -1,6 +1,7 @@
|
||||
{
|
||||
"enablePullDownRefresh": true,
|
||||
"navigationBarBackgroundColor": "#1d1611",
|
||||
"navigationBarTitleText": "订单列表",
|
||||
"usingComponents": {
|
||||
"component-popup": "/components/popup/popup"
|
||||
}
|
||||
|
@ -5,7 +5,7 @@
|
||||
</block>
|
||||
</view>
|
||||
|
||||
<!-- 订单列表 -->
|
||||
<!-- 列表 -->
|
||||
<scroll-view scroll-y="{{true}}" class="scroll-box" bindscrolltolower="scroll_lower" lower-threshold="30">
|
||||
<view class="data-list">
|
||||
<view class="item bg-white spacing-mb" wx:if="{{data_list.length > 0}}" wx:for="{{data_list}}" wx:key="key">
|
||||
|
@ -0,0 +1,86 @@
|
||||
const app = getApp();
|
||||
Page({
|
||||
data: {
|
||||
params: null,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
data_bottom_line_status: false,
|
||||
|
||||
detail: null,
|
||||
detail_list: [],
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
params['id'] = 1;
|
||||
this.setData({ params: params });
|
||||
this.init();
|
||||
},
|
||||
|
||||
onShow() {},
|
||||
|
||||
init() {
|
||||
var self = this;
|
||||
wx.showLoading({ title: "加载中..." });
|
||||
this.setData({
|
||||
data_list_loding_status: 1
|
||||
});
|
||||
|
||||
wx.request({
|
||||
url: app.get_request_url("detail", "profit", "membershiplevelvip"),
|
||||
method: "POST",
|
||||
data: {
|
||||
id: this.data.params.id
|
||||
},
|
||||
dataType: "json",
|
||||
success: res => {
|
||||
wx.hideLoading();
|
||||
wx.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
self.setData({
|
||||
detail: data.data,
|
||||
detail_list: [
|
||||
{ name: "订单金额", value: data.data.total_price || '' },
|
||||
{ name: "返佣金额", value: data.data.profit_price || '' },
|
||||
{ name: "当前级别", value: data.data.level_name || '' },
|
||||
{ name: "结算状态", value: data.data.status_name || '' },
|
||||
{ name: "返佣规则", value: data.data.commission_rules || '' },
|
||||
{ name: "创建时间", value: data.data.add_time_time || '' },
|
||||
{ name: "更新时间", value: data.data.upd_time || '' },
|
||||
],
|
||||
|
||||
data_list_loding_status: 3,
|
||||
data_bottom_line_status: true,
|
||||
data_list_loding_msg: '',
|
||||
});
|
||||
} else {
|
||||
self.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
if (app.is_login_check(res.data, self, 'init')) {
|
||||
app.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
wx.hideLoading();
|
||||
wx.stopPullDownRefresh();
|
||||
self.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_msg: '服务器请求出错',
|
||||
});
|
||||
|
||||
app.showToast("服务器请求出错");
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.init();
|
||||
},
|
||||
|
||||
});
|
@ -0,0 +1,5 @@
|
||||
{
|
||||
"enablePullDownRefresh": true,
|
||||
"navigationBarBackgroundColor": "#1d1611",
|
||||
"navigationBarTitleText": "收益详情"
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
<view wx:if="{{detail != null}}">
|
||||
<view wx:if="{{detail_list.length > 0}}" class="panel-item">
|
||||
<view class="panel-content bg-white">
|
||||
<view wx:for="{{detail_list}}" wx:key="item" class="item br-b oh">
|
||||
<view class="title fl">{{item.name}}</view>
|
||||
<view class="content cr-888 fl br-l">{{item.value}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<import src="/pages/common/bottom_line.wxml" />
|
||||
<template is="bottom_line" data="{{status: data_bottom_line_status}}"></template>
|
||||
</view>
|
||||
|
||||
<view wx:if="{{detail == null}}">
|
||||
<import src="/pages/common/nodata.wxml" />
|
||||
<template is="nodata" data="{{status: data_list_loding_status, msg: data_list_loding_msg}}"></template>
|
||||
|
||||
<view class="nav-back tc wh-auto">
|
||||
<navigator url="/pages/plugins/membershiplevelvip/order/order" open-type="navigateBack" hover-class="none">
|
||||
<button type="default" size="mini" class="cr-888 br" hover-class="none">返回</button>
|
||||
</navigator>
|
||||
</view>
|
||||
</view>
|
@ -0,0 +1,25 @@
|
||||
.panel-item .panel-title {
|
||||
background: #fff;
|
||||
font-weight: bold;
|
||||
padding: 15rpx;
|
||||
border-bottom: 2px solid #eee;
|
||||
font-size: 34rpx;
|
||||
}
|
||||
.panel-item .panel-content .item {
|
||||
padding: 20rpx 0;
|
||||
}
|
||||
.panel-item .panel-content .item:last-child {
|
||||
border: 0;
|
||||
}
|
||||
.panel-item .panel-content .item .title {
|
||||
width: 25%;
|
||||
padding-left: 20rpx;
|
||||
}
|
||||
.panel-item .panel-content .item .content {
|
||||
width: calc(75% - 50rpx);
|
||||
padding-left: 20rpx;
|
||||
min-height: 46rpx;
|
||||
}
|
||||
.panel-item .panel-content .item view {
|
||||
line-height: 46rpx;
|
||||
}
|
@ -0,0 +1,166 @@
|
||||
const app = getApp();
|
||||
Page({
|
||||
data: {
|
||||
data_list: [],
|
||||
data_page_total: 0,
|
||||
data_page: 1,
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false,
|
||||
params: null,
|
||||
nav_status_list: [
|
||||
{ name: "全部", value: "-1" },
|
||||
{ name: "待结算", value: "0" },
|
||||
{ name: "已结算", value: "1" },
|
||||
{ name: "已失效", value: "2" },
|
||||
],
|
||||
nav_status_index: 0,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 是否指定状态
|
||||
var nav_status_index = 0;
|
||||
if ((params.status || null) != null) {
|
||||
for (var i in this.data.nav_status_list) {
|
||||
if (this.data.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() {},
|
||||
|
||||
init() {
|
||||
var user = app.get_user_info(this, 'init');
|
||||
if (user != false) {
|
||||
// 用户未绑定用户则转到登录页面
|
||||
if (app.user_is_need_login(user)) {
|
||||
wx.redirectTo({
|
||||
url: "/pages/login/login?event_callback=init"
|
||||
});
|
||||
return false;
|
||||
} else {
|
||||
// 获取数据
|
||||
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.data_bottom_line_status == true) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// 加载loding
|
||||
wx.showLoading({ title: "加载中..." });
|
||||
this.setData({
|
||||
data_list_loding_status: 1
|
||||
});
|
||||
|
||||
// 参数
|
||||
var status = ((this.data.nav_status_list[this.data.nav_status_index] || null) == null) ? -1 : this.data.nav_status_list[this.data.nav_status_index]['value'];
|
||||
|
||||
// 获取数据
|
||||
wx.request({
|
||||
url: app.get_request_url("index", "profit", "membershiplevelvip"),
|
||||
method: "POST",
|
||||
data: {
|
||||
page: this.data.data_page,
|
||||
status: status,
|
||||
is_more: 1,
|
||||
},
|
||||
dataType: "json",
|
||||
success: res => {
|
||||
wx.hideLoading();
|
||||
wx.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
if (res.data.data.data.length > 0) {
|
||||
if (this.data.data_page <= 1) {
|
||||
var temp_data_list = res.data.data.data;
|
||||
} else {
|
||||
var temp_data_list = this.data.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.data_page + 1,
|
||||
});
|
||||
|
||||
// 是否还有数据
|
||||
if (this.data.data_page > 1 && this.data.data_page > this.data.data_page_total) {
|
||||
this.setData({ data_bottom_line_status: true });
|
||||
} else {
|
||||
this.setData({ data_bottom_line_status: false });
|
||||
}
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_list: [],
|
||||
data_bottom_line_status: false,
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
});
|
||||
if (app.is_login_check(res.data, this, 'get_data_list')) {
|
||||
app.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
wx.hideLoading();
|
||||
wx.stopPullDownRefresh();
|
||||
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
});
|
||||
app.showToast("服务器请求出错");
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.setData({
|
||||
data_page: 1
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// 滚动加载
|
||||
scroll_lower(e) {
|
||||
this.get_data_list();
|
||||
},
|
||||
|
||||
// 导航事件
|
||||
nav_event(e) {
|
||||
this.setData({
|
||||
nav_status_index: e.currentTarget.dataset.index || 0,
|
||||
data_page: 1,
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
});
|
@ -0,0 +1,5 @@
|
||||
{
|
||||
"enablePullDownRefresh": true,
|
||||
"navigationBarBackgroundColor": "#1d1611",
|
||||
"navigationBarTitleText": "收益明细"
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
<!-- 导航 -->
|
||||
<view class="nav">
|
||||
<block wx:for="{{nav_status_list}}" wx:key="key">
|
||||
<view class="item fl tc cr-888 {{nav_status_index == index ? 'active' : ''}}" data-index="{{index}}" bindtap="nav_event">{{item.name}}</view>
|
||||
</block>
|
||||
</view>
|
||||
|
||||
<!-- 列表 -->
|
||||
<scroll-view scroll-y="{{true}}" class="scroll-box" bindscrolltolower="scroll_lower" lower-threshold="30">
|
||||
<view class="data-list">
|
||||
<view class="item bg-white spacing-mb" wx:if="{{data_list.length > 0}}" wx:for="{{data_list}}" wx:key="key">
|
||||
<view class="base oh br-b">
|
||||
<text class="cr-666">{{item.add_time_time}}</text>
|
||||
<text class="fr cr-main">{{item.status_name}}</text>
|
||||
</view>
|
||||
<navigator url="/pages/plugins/membershiplevelvip/shouyi-detail/shouyi-detail?id={{item.id}}" hover-class="none">
|
||||
<view class="content">
|
||||
<view class="multi-text">
|
||||
<text class="title cr-666">订单金额</text>
|
||||
<text class="value">{{item.total_price}}</text>
|
||||
<text class="unit cr-888">元</text>
|
||||
</view>
|
||||
<view class="multi-text">
|
||||
<text class="title cr-666">返佣金额</text>
|
||||
<text class="value">{{item.profit_price}}</text>
|
||||
<text class="unit cr-888">元</text>
|
||||
</view>
|
||||
<view class="multi-text">
|
||||
<text class="title cr-666">当前级别</text>
|
||||
<text class="value">{{item.level_name}}</text>
|
||||
</view>
|
||||
<view class="multi-text">
|
||||
<text class="title cr-666">返佣规则</text>
|
||||
<text class="value">{{item.commission_rules}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</navigator>
|
||||
</view>
|
||||
|
||||
<view wx:if="{{data_list.length == 0}}">
|
||||
<import src="/pages/common/nodata.wxml" />
|
||||
<template is="nodata" data="{{status: data_list_loding_status}}">
|
||||
</template>
|
||||
</view>
|
||||
|
||||
<import src="/pages/common/bottom_line.wxml" />
|
||||
<template is="bottom_line" data="{{status: data_bottom_line_status}}"></template>
|
||||
</view>
|
||||
</scroll-view>
|
@ -0,0 +1,37 @@
|
||||
/*
|
||||
* 导航
|
||||
*/
|
||||
.nav {
|
||||
background: #eee;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
}
|
||||
.nav .item {
|
||||
width: 25%;
|
||||
}
|
||||
.nav .active {
|
||||
color: #1d1611;
|
||||
}
|
||||
|
||||
/*
|
||||
* 列表
|
||||
*/
|
||||
.scroll-box {
|
||||
height: calc(100vh - 80rpx);
|
||||
}
|
||||
.data-list .item .base,
|
||||
.data-list .item .content {
|
||||
padding: 20rpx 10rpx;
|
||||
}
|
||||
.data-list .item .content .multi-text {
|
||||
line-height: 50rpx;
|
||||
}
|
||||
.data-list .item .content .multi-text .title {
|
||||
margin-right: 30rpx;
|
||||
}
|
||||
.data-list .item .content .multi-text .value {
|
||||
font-weight: 500;
|
||||
}
|
||||
.data-list .item .content .multi-text .unit {
|
||||
margin-left: 10rpx;
|
||||
}
|
@ -38,9 +38,7 @@ Page({
|
||||
this.init();
|
||||
},
|
||||
|
||||
onShow() {
|
||||
wx.setNavigationBarTitle({ title: app.data.common_pages_title.membervip });
|
||||
},
|
||||
onShow() {},
|
||||
|
||||
init(e) {
|
||||
var user = app.get_user_info(this, "init"),
|
||||
|
@ -2,5 +2,6 @@
|
||||
"enablePullDownRefresh": true,
|
||||
"navigationBarBackgroundColor": "#1d1611",
|
||||
"backgroundColorTop": "#1d1611",
|
||||
"backgroundColorBottom": "#f5f5f5"
|
||||
"backgroundColorBottom": "#f5f5f5",
|
||||
"navigationBarTitleText": "我的会员"
|
||||
}
|
Loading…
Reference in New Issue
Block a user