mirror of
https://gitee.com/zongzhige/shopxo-uniapp.git
synced 2026-06-06 02:38:52 +08:00
1.我的发票
2.我的钱包
This commit is contained in:
25
App.vue
25
App.vue
@ -1571,6 +1571,31 @@
|
||||
});
|
||||
}, 1500);
|
||||
},
|
||||
// 是否站点变灰
|
||||
is_app_mourning() {
|
||||
var is_app = parseInt(this.get_config('plugins_base.mourning.data.is_app', 0));
|
||||
if (is_app == 1) {
|
||||
// 当前时间戳
|
||||
var time_current = Date.parse(new Date());
|
||||
// 开始时间
|
||||
var time_start = this.get_config('plugins_base.mourning.data.time_start') || null;
|
||||
if (time_start != null) {
|
||||
if (Date.parse(new Date(time_start)) > time_current) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// 结束时间
|
||||
var time_end = this.get_config('plugins_base.mourning.data.time_end') || null;
|
||||
if (time_end != null) {
|
||||
if (Date.parse(new Date(time_end)) < time_current) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
||||
// 是否站点变灰
|
||||
is_app_mourning() {
|
||||
var is_app = parseInt(this.get_config('plugins_base.mourning.data.is_app', 0));
|
||||
|
||||
@ -233,11 +233,11 @@ button:before {
|
||||
}
|
||||
|
||||
.z-i {
|
||||
z-index: 1;
|
||||
z-index: 1 !important;
|
||||
}
|
||||
|
||||
.z-i-deep {
|
||||
z-index: 2;
|
||||
z-index: 2 !important;
|
||||
}
|
||||
|
||||
.bs-bb {
|
||||
@ -530,6 +530,10 @@ button:before {
|
||||
border: solid 1px #f5f5f5 !important;
|
||||
}
|
||||
|
||||
.br-grey-9 {
|
||||
border: solid 1px #999999 !important;
|
||||
}
|
||||
|
||||
.br-blue {
|
||||
border: solid 1px #2196F3 !important;
|
||||
}
|
||||
@ -602,10 +606,6 @@ button:before {
|
||||
color: #333 !important;
|
||||
}
|
||||
|
||||
.cr-grey {
|
||||
color: #888 !important;
|
||||
}
|
||||
|
||||
.cr-grey {
|
||||
color: #666 !important;
|
||||
}
|
||||
@ -1538,6 +1538,6 @@ button[disabled].bg-grey {
|
||||
/**
|
||||
* 通知
|
||||
*/
|
||||
.uni-noticebar {
|
||||
.uni-noticebar.margin-0 {
|
||||
padding: 0 !important;
|
||||
}
|
||||
@ -2,109 +2,109 @@
|
||||
* 边线 搭配色、次主色、主色
|
||||
*/
|
||||
.border-color-main-pair {
|
||||
border-color: #795548 !important;
|
||||
border-color: #795548 !important;
|
||||
}
|
||||
|
||||
.border-color-main-light {
|
||||
border-color: #ffebd2 !important;
|
||||
border-color: #ffebd2 !important;
|
||||
}
|
||||
|
||||
.border-color-main {
|
||||
border-color: #f6c133 !important;
|
||||
border-color: #f6c133 !important;
|
||||
}
|
||||
|
||||
/**
|
||||
* 边框 搭配色、次主色、主色
|
||||
*/
|
||||
.br-main-pair {
|
||||
border: 1px solid #795548 !important;
|
||||
border: 1px solid #795548 !important;
|
||||
}
|
||||
|
||||
.br-main-light {
|
||||
border: solid 1px #ffebd2 !important;
|
||||
border: solid 1px #ffebd2 !important;
|
||||
}
|
||||
|
||||
.br-main {
|
||||
border: 1px solid #f6c133 !important;
|
||||
border: 1px solid #f6c133 !important;
|
||||
}
|
||||
|
||||
/**
|
||||
* 虚线边框 搭配色、次主色、主色
|
||||
*/
|
||||
.br-dashed-main-pair {
|
||||
border: dashed 1px #795548 !important;
|
||||
border: dashed 1px #795548 !important;
|
||||
}
|
||||
|
||||
.br-dashed-main-light {
|
||||
border: dashed 1px #ffebd2 !important;
|
||||
border: dashed 1px #ffebd2 !important;
|
||||
}
|
||||
|
||||
.br-dashed-main {
|
||||
border: dashed 1px #f6c133 !important;
|
||||
border: dashed 1px #f6c133 !important;
|
||||
}
|
||||
|
||||
/**
|
||||
* 文本颜色 搭配色、次主色、主色
|
||||
*/
|
||||
.cr-main-pair {
|
||||
color: #795548 !important;
|
||||
color: #795548 !important;
|
||||
}
|
||||
|
||||
.cr-main-light {
|
||||
color: #ffebd2 !important;
|
||||
color: #ffebd2 !important;
|
||||
}
|
||||
|
||||
.cr-main {
|
||||
color: #f6c133 !important;
|
||||
color: #f6c133 !important;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导航伪类背景色
|
||||
*/
|
||||
.nav-active-line::before {
|
||||
background: #f6c133;
|
||||
background: #f6c133;
|
||||
}
|
||||
|
||||
/**
|
||||
* 背景色 搭配色、次主色、主色
|
||||
*/
|
||||
.bg-main-pair {
|
||||
background-color: #795548 !important;
|
||||
background-color: #795548 !important;
|
||||
}
|
||||
|
||||
.bg-main-light {
|
||||
background-color: #ffebd2 !important;
|
||||
background-color: #ffebd2 !important;
|
||||
}
|
||||
|
||||
.bg-main {
|
||||
background-color: #f6c133 !important;
|
||||
background-color: #f6c133 !important;
|
||||
}
|
||||
|
||||
button[disabled].bg-main-pair {
|
||||
background-color: #b5a29c !important;
|
||||
color: #8c766f !important;
|
||||
background-color: #b5a29c !important;
|
||||
color: #8c766f !important;
|
||||
}
|
||||
|
||||
button[disabled].bg-main-light {
|
||||
background-color: #fbebd6 !important;
|
||||
color: #ffcc40 !important;
|
||||
background-color: #fbebd6 !important;
|
||||
color: #ffcc40 !important;
|
||||
}
|
||||
|
||||
button[disabled].bg-main {
|
||||
background-color: #fdd178 !important;
|
||||
color: #fff7e7 !important;
|
||||
background-color: #fdd178 !important;
|
||||
color: #fff7e7 !important;
|
||||
}
|
||||
|
||||
/**
|
||||
* 标题左侧边线
|
||||
*/
|
||||
.title-left-border::before {
|
||||
background: linear-gradient(180deg, #f6c133 0%, #ffebd2 100%);
|
||||
background: linear-gradient(180deg, #f6c133 0%, #ffebd2 100%);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导航菜单左侧边线
|
||||
*/
|
||||
.nav-left-border::before {
|
||||
background: #f6c133;
|
||||
background: #f6c133;
|
||||
}
|
||||
@ -24,8 +24,8 @@
|
||||
<style scoped>
|
||||
/* iconfont.css全局注册需要将src切换成绝对路径 */
|
||||
/* @/static/icon/ */
|
||||
@import url('@/static/icon/iconfont.css');
|
||||
/* @import url('https://at.alicdn.com/t/c/font_4227145_ezq1taohcms.css'); */
|
||||
/* @import url('@/static/icon/iconfont.css'); */
|
||||
@import url('https://at.alicdn.com/t/c/font_4227145_4zljgwpfojt.css');
|
||||
|
||||
.iconfont {
|
||||
display: inline-block;
|
||||
|
||||
240
components/wallet/user-cash/user-cash.vue
Normal file
240
components/wallet/user-cash/user-cash.vue
Normal file
@ -0,0 +1,240 @@
|
||||
<template>
|
||||
<view>
|
||||
<!-- 导航 -->
|
||||
<view class="nav-child flex-row align-c margin-bottom-lg">
|
||||
<block v-for="(item, index) in nav_status_list" :key="index">
|
||||
<view class="item dis-inline-block round bg-grey-e margin-right-main tc" :class="'cr-grey ' + (nav_status_index == index ? 'cr-main bg-main-light' : '')" :data-index="index" @tap="nav_event">{{ item.name }}</view>
|
||||
</block>
|
||||
</view>
|
||||
|
||||
<!-- 列表 -->
|
||||
<view v-if="data_list.length > 0" class="data-list">
|
||||
<view v-for="(item, index) in data_list" :key="index" class="item padding-main border-radius-main oh bg-white spacing-mb">
|
||||
<view class="base oh br-b-dashed padding-bottom-main flex-row jc-sb align-c">
|
||||
<text class="cr-grey-9">{{ item.add_time_time }}</text>
|
||||
<text :class="item.status === 0 ? 'cr-black' : item.status === 1 ? 'cr-grey-c' : 'cr-red'">{{ item.status_name }}</text>
|
||||
</view>
|
||||
<view class="content margin-top">
|
||||
<navigator :url="'/pages/plugins/wallet/user-cash-detail/user-cash-detail?id=' + item.id" hover-class="none">
|
||||
<block v-for="(fv, fi) in content_list" :key="fi">
|
||||
<view class="single-text margin-top-sm">
|
||||
<text class="cr-grey-9 margin-right-main">{{ fv.name }}</text>
|
||||
<text class="fw-b">{{ item[fv.field] }}</text>
|
||||
<text v-if="(fv.unit || null) != null" class="fw-b">{{ fv.unit }}</text>
|
||||
</view>
|
||||
</block>
|
||||
</navigator>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status"></component-no-data>
|
||||
</view>
|
||||
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentNoData from '@/components/no-data/no-data';
|
||||
import componentBottomLine from '@/components/bottom-line/bottom-line';
|
||||
|
||||
export default {
|
||||
props: {
|
||||
propPullDownRefresh: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
propScrollLower: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
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: '全部', value: '-1' },
|
||||
{ name: '未打款', value: '0' },
|
||||
{ name: '已打款', value: '1' },
|
||||
{ name: '打款失败', value: '2' },
|
||||
],
|
||||
nav_status_index: 0,
|
||||
content_list: [
|
||||
{ name: '提现单号', field: 'cash_no' },
|
||||
{ name: '提现金额', field: 'money', unit: '元' },
|
||||
],
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
},
|
||||
created() {
|
||||
this.init();
|
||||
},
|
||||
mounted() {
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle();
|
||||
},
|
||||
watch: {
|
||||
propPullDownRefresh(newVal, oldVal) {
|
||||
if (newVal !== oldVal) {
|
||||
this.setData({
|
||||
data_page: 1,
|
||||
});
|
||||
this.get_data_list(1);
|
||||
}
|
||||
},
|
||||
propScrollLower(newVal, oldVal) {
|
||||
if (newVal !== oldVal) {
|
||||
this.get_data_list();
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
methods: {
|
||||
init() {
|
||||
var user = app.globalData.get_user_info(this, 'init');
|
||||
if (user != false) {
|
||||
// 用户未绑定用户则转到登录页面
|
||||
if (app.globalData.user_is_need_login(user)) {
|
||||
uni.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_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
|
||||
uni.showLoading({
|
||||
title: '加载中...',
|
||||
});
|
||||
|
||||
// 参数
|
||||
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', 'cash', 'wallet'),
|
||||
method: 'POST',
|
||||
data: {
|
||||
page: this.data_page,
|
||||
status: status,
|
||||
is_more: 1,
|
||||
},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
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: () => {
|
||||
uni.hideLoading();
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
app.globalData.showToast('服务器请求出错');
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 导航事件
|
||||
nav_event(e) {
|
||||
this.setData({
|
||||
nav_status_index: e.currentTarget.dataset.index || 0,
|
||||
data_page: 1,
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.nav-detail .nav-child .item {
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
padding: 0 30rpx;
|
||||
min-width: 84rpx;
|
||||
}
|
||||
</style>
|
||||
728
components/wallet/user-recharge/user-recharge.vue
Normal file
728
components/wallet/user-recharge/user-recharge.vue
Normal file
@ -0,0 +1,728 @@
|
||||
<template>
|
||||
<view>
|
||||
<!-- 导航 -->
|
||||
<view class="nav-child flex-row align-c margin-bottom-lg">
|
||||
<block v-for="(item, index) in nav_status_list" :key="index">
|
||||
<view class="item dis-inline-block round bg-grey-e margin-right-main tc" :class="'cr-grey ' + (nav_status_index == index ? 'cr-main bg-main-light' : '')" :data-index="index" @tap="nav_event">{{ item.name }}</view>
|
||||
</block>
|
||||
</view>
|
||||
|
||||
<!-- 列表 -->
|
||||
<view v-if="data_list.length > 0" class="data-list">
|
||||
<view v-for="(item, index) in data_list" :key="index" class="item padding-main border-radius-main oh bg-white spacing-mb">
|
||||
<view class="base oh br-b-dashed padding-bottom-main flex-row jc-sb align-c">
|
||||
<text class="cr-grey-9">{{ item.add_time_time }}</text>
|
||||
<text :class="item.status == 0 ? 'cr-main' : 'cr-grey-c'">{{ item.status_name }}</text>
|
||||
</view>
|
||||
<view class="content margin-top">
|
||||
<navigator :url="'/pages/plugins/wallet/user-recharge-detail/user-recharge-detail?id=' + item.id" hover-class="none">
|
||||
<block v-for="(fv, fi) in content_list" :key="fi">
|
||||
<view class="single-text margin-top-sm">
|
||||
<text class="cr-grey-9 margin-right-main">{{ fv.name }}</text>
|
||||
<text class="fw-b">{{ item[fv.field] }}</text>
|
||||
<text v-if="(fv.unit || null) != null" class="fw-b">{{ fv.unit }}</text>
|
||||
</view>
|
||||
</block>
|
||||
</navigator>
|
||||
</view>
|
||||
<view v-if="item.status == 0" class="item-operation tr margin-top-main">
|
||||
<button class="round bg-white br-grey-9 text-size-md" type="default" size="mini" @tap="delete_event" :data-value="item.id" :data-index="index" hover-class="none">删除</button>
|
||||
<button class="round bg-white cr-main br-main text-size-md" type="default" size="mini" @tap="pay_event" :data-value="item.id" :data-index="index" hover-class="none">去支付</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>
|
||||
|
||||
<!-- 支付二维码展示 -->
|
||||
<component-popup :propShow="popup_view_pay_qrcode_is_show" propPosition="bottom" @onclose="popup_view_pay_qrcode_event_close">
|
||||
<view class="padding-top-xxxl padding-bottom-xxxl padding-left-xxxl padding-right-xxxl tc">
|
||||
<block v-if="(popup_view_pay_data || null) == null || (popup_view_pay_data.qrcode_url || null) == null || (popup_view_pay_data.name || null) == null || (popup_view_pay_data.check_url || null) == null || (popup_view_pay_data.order_no || null) == null">
|
||||
<text class="cr-grey">无支付信息</text>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="fw-b text-size cr-base margin-bottom-sm">{{ popup_view_pay_data.name }}</view>
|
||||
<image :src="popup_view_pay_data.qrcode_url" mode="aspectFit" class="dis-block auto max-w"></image>
|
||||
<view v-if="(popup_view_pay_data.msg || null) != null" class="cr-yellow margin-top-sm">{{ popup_view_pay_data.msg }}</view>
|
||||
<!-- #ifdef H5 -->
|
||||
<view v-if="popup_view_pay_data.pay_url != null" class="margin-top-xl">
|
||||
<a :href="popup_view_pay_data.pay_url" target="_blank" class="dis-inline-block cr-green">尝试点击去支付</a>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
</block>
|
||||
</view>
|
||||
</component-popup>
|
||||
|
||||
<!-- 支付方式 popup -->
|
||||
<component-popup :propShow="is_show_payment_popup" propPosition="bottom" @onclose="payment_popup_event_close">
|
||||
<view v-if="payment_list.length > 0" class="payment-list oh bg-base padding-main">
|
||||
<view class="padding-top-main padding-left-main">
|
||||
<view v-for="(item, index) in payment_list" :key="index" class="item tc fl">
|
||||
<view class="item-content bg-white border-radius-main margin-right-main margin-bottom-main" :data-value="item.id" @tap="popup_payment_event">
|
||||
<image v-if="(item.logo || null) != null" class="icon va-m margin-right-sm" :src="item.logo" mode="widthFix"></image>
|
||||
<text class="va-m">{{ item.name }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else class="padding-top-xxxl padding-bottom-xxxl oh bg-white tc cr-grey">没有支付方式</view>
|
||||
</component-popup>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import base64 from '@/common/js/lib/base64.js';
|
||||
import componentPopup from '@/components/popup/popup';
|
||||
import componentNoData from '@/components/no-data/no-data';
|
||||
import componentBottomLine from '@/components/bottom-line/bottom-line';
|
||||
|
||||
export default {
|
||||
props: {
|
||||
propPullDownRefresh: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
propScrollLower: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
propCurrent: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
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,
|
||||
load_status: 0,
|
||||
is_show_payment_popup: false,
|
||||
payment_list: [],
|
||||
payment_id: 0,
|
||||
temp_pay_value: 0,
|
||||
temp_pay_index: 0,
|
||||
nav_status_list: [
|
||||
{ name: '全部', value: '-1' },
|
||||
{ name: '待支付', value: '0' },
|
||||
{ name: '已支付', value: '1' },
|
||||
],
|
||||
nav_status_index: 0,
|
||||
content_list: [
|
||||
{ name: '充值单号', field: 'recharge_no' },
|
||||
{ name: '充值金额', field: 'money', unit: '元' },
|
||||
{ name: '支付金额', field: 'pay_money', unit: '元' },
|
||||
],
|
||||
// 支付信息
|
||||
popup_view_pay_qrcode_is_show: false,
|
||||
popup_view_pay_data: null,
|
||||
popup_view_pay_timer: null,
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentPopup,
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
},
|
||||
|
||||
created() {
|
||||
this.init();
|
||||
},
|
||||
|
||||
mounted() {
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle();
|
||||
},
|
||||
watch: {
|
||||
propPullDownRefresh(newVal, oldVal) {
|
||||
if (newVal !== oldVal) {
|
||||
this.setData({
|
||||
data_page: 1,
|
||||
});
|
||||
this.get_data_list(1);
|
||||
}
|
||||
},
|
||||
propScrollLower(newVal, oldVal) {
|
||||
if (newVal !== oldVal) {
|
||||
this.get_data_list();
|
||||
}
|
||||
},
|
||||
propCurrent(newVal, oldVal) {
|
||||
if (newVal !== oldVal) {
|
||||
this.setData({
|
||||
nav_status_index: newVal,
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
methods: {
|
||||
init() {
|
||||
var user = app.globalData.get_user_info(this, 'init');
|
||||
if (user != false) {
|
||||
// 用户未绑定用户则转到登录页面
|
||||
if (app.globalData.user_is_need_login(user)) {
|
||||
uni.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_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
|
||||
uni.showLoading({
|
||||
title: '加载中...',
|
||||
});
|
||||
|
||||
// 参数
|
||||
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', 'recharge', 'wallet'),
|
||||
method: 'POST',
|
||||
data: {
|
||||
page: this.data_page,
|
||||
status: order_status,
|
||||
is_more: 1,
|
||||
},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
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;
|
||||
// 下订单支付处理
|
||||
if (this.load_status == 0) {
|
||||
var ck = app.globalData.data.cache_page_pay_key;
|
||||
var pay_data = uni.getStorageSync(ck) || null;
|
||||
if (pay_data != null) {
|
||||
uni.removeStorageSync(ck);
|
||||
this.setData({ payment_id: parseInt(pay_data.payment_id || 0) });
|
||||
for (var i in temp_data_list) {
|
||||
if (pay_data.order_ids == temp_data_list[i]['id']) {
|
||||
if (this.payment_id == 0) {
|
||||
this.setData({
|
||||
is_show_payment_popup: true,
|
||||
temp_pay_value: temp_data_list[i]['id'],
|
||||
temp_pay_index: i,
|
||||
});
|
||||
} else {
|
||||
this.pay_handle(pay_data.order_ids, i);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} 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 || [],
|
||||
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,
|
||||
load_status: 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,
|
||||
load_status: 1,
|
||||
data_list: [],
|
||||
data_bottom_line_status: false,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
load_status: 1,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
if (app.globalData.is_login_check(res.data, this, 'get_data_list')) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
load_status: 1,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
app.globalData.showToast('服务器请求出错');
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 支付
|
||||
pay_event(e) {
|
||||
this.setData({
|
||||
is_show_payment_popup: true,
|
||||
temp_pay_value: e.currentTarget.dataset.value,
|
||||
temp_pay_index: e.currentTarget.dataset.index,
|
||||
});
|
||||
},
|
||||
|
||||
// 支付弹窗关闭
|
||||
payment_popup_event_close(e) {
|
||||
this.setData({
|
||||
is_show_payment_popup: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 支付弹窗发起支付
|
||||
popup_payment_event(e) {
|
||||
var payment_id = e.currentTarget.dataset.value || 0;
|
||||
this.setData({
|
||||
payment_id: payment_id,
|
||||
});
|
||||
this.payment_popup_event_close();
|
||||
this.pay_handle(this.temp_pay_value, this.temp_pay_index);
|
||||
},
|
||||
|
||||
// 支付方法
|
||||
pay_handle(recharge_id, index) {
|
||||
// #ifdef H5
|
||||
// 微信环境判断是否已有web_openid、不存在则不继续执行跳转到插件进行授权
|
||||
if (!app.globalData.is_user_weixin_web_openid(recharge_id, this.payment_id)) {
|
||||
return false;
|
||||
}
|
||||
// #endif
|
||||
|
||||
// 支付方式
|
||||
var payment = null;
|
||||
for (var i in this.payment_list) {
|
||||
if (this.payment_list[i]['id'] == this.payment_id) {
|
||||
payment = this.payment_list[i];
|
||||
}
|
||||
}
|
||||
if (payment == null) {
|
||||
app.globalData.showToast('支付方式有误');
|
||||
return false;
|
||||
}
|
||||
|
||||
// 请求数据
|
||||
var post_data = {
|
||||
recharge_id: recharge_id,
|
||||
payment_id: this.payment_id,
|
||||
};
|
||||
|
||||
// h5自定义重定向地址
|
||||
// #ifdef H5
|
||||
post_data['redirect_url'] = encodeURIComponent(base64.encode(app.globalData.get_page_url(false) + (this.nav_status_index > 0 ? '?status=' + this.nav_status_index : '')));
|
||||
// paypal支付方式使用respond_url返回地址、移除重定向地址
|
||||
if (payment.payment == 'PayPal') {
|
||||
post_data['respond_url'] = post_data['redirect_url'];
|
||||
delete post_data['redirect_url'];
|
||||
}
|
||||
// #endif
|
||||
|
||||
// 请求支付接口
|
||||
uni.showLoading({
|
||||
title: '请求中...',
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('pay', 'recharge', 'wallet'),
|
||||
method: 'POST',
|
||||
data: post_data,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
// #ifdef MP-WEIXIN || MP-ALIPAY || MP-BAIDU || MP-TOUTIAO
|
||||
this.common_pay_handle(this, data, index);
|
||||
// #endif
|
||||
// #ifdef MP-KUAISHOU
|
||||
this.kuaishou_pay_handle(this, data, index);
|
||||
// #endif
|
||||
// #ifdef MP-QQ
|
||||
this.qq_pay_handle(this, data, index);
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
this.h5_pay_handle(this, data, index);
|
||||
// #endif
|
||||
} else {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
app.globalData.showToast('服务器请求出错');
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 快手小程序
|
||||
kuaishou_pay_handle(self, data, index) {
|
||||
uni.pay({
|
||||
orderInfo: data.data,
|
||||
serviceId: '1',
|
||||
success: (res) => {
|
||||
// 数据设置
|
||||
self.order_item_pay_success_handle(index);
|
||||
|
||||
// 跳转支付页面
|
||||
uni.navigateTo({
|
||||
url: '/pages/paytips/paytips?code=9000',
|
||||
});
|
||||
},
|
||||
fail: (res) => {
|
||||
app.globalData.showToast('支付失败');
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 微信、支付宝、百度、头条、QQ
|
||||
common_pay_handle(self, data, index) {
|
||||
uni.requestPayment({
|
||||
// #ifdef MP-ALIPAY || MP-BAIDU || MP-TOUTIAO
|
||||
orderInfo: data.data,
|
||||
// #endif
|
||||
// #ifdef MP-QQ
|
||||
package: data.data,
|
||||
// #endif
|
||||
// #ifdef MP-WEIXIN
|
||||
timeStamp: data.data.timeStamp,
|
||||
nonceStr: data.data.nonceStr,
|
||||
package: data.data.package,
|
||||
signType: data.data.signType,
|
||||
paySign: data.data.paySign,
|
||||
// #endif
|
||||
// #ifdef MP-TOUTIAO
|
||||
service: 5,
|
||||
// #endif
|
||||
success: (res) => {
|
||||
// #ifdef MP-ALIPAY
|
||||
if (res.resultCode != 9000) {
|
||||
app.globalData.showToast(res.memo || '支付失败');
|
||||
return false;
|
||||
}
|
||||
// #endif
|
||||
// #ifdef MP-TOUTIAO
|
||||
if (res.code != 0) {
|
||||
app.globalData.showToast('支付失败');
|
||||
return false;
|
||||
}
|
||||
// #endif
|
||||
|
||||
// 数据设置
|
||||
self.order_item_pay_success_handle(index);
|
||||
|
||||
// 跳转支付页面
|
||||
uni.navigateTo({
|
||||
url: '/pages/paytips/paytips?code=9000',
|
||||
});
|
||||
},
|
||||
fail: (res) => {
|
||||
app.globalData.showToast('支付失败');
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// QQ支付处理
|
||||
qq_pay_handle(self, data, index) {
|
||||
// 是否微信支付
|
||||
if (data.payment.payment == 'Weixin') {
|
||||
uni.requestWxPayment({
|
||||
url: data.data,
|
||||
referer: app.globalData.data.request_url,
|
||||
success: function (res) {
|
||||
app.globalData.alert({ msg: '支付成功后、请不要重复支付、如果订单状态未成功请联系客服处理', is_show_cancel: 0 });
|
||||
self.get_data_list();
|
||||
},
|
||||
fail: function (res) {
|
||||
app.globalData.showToast('支付失败');
|
||||
},
|
||||
});
|
||||
} else {
|
||||
self.common_pay_handle(self, data, index);
|
||||
}
|
||||
},
|
||||
|
||||
// h5支付处理
|
||||
h5_pay_handle(self, data, index) {
|
||||
// 字符串则为跳转地址直接进入
|
||||
if (typeof data.data == 'string') {
|
||||
window.location.href = data.data;
|
||||
} else {
|
||||
var status = false;
|
||||
// 微信jsapi
|
||||
if (data.payment.payment == 'Weixin' && (data.data.appId || null) != null && (data.data.timeStamp || null) != null && (data.data.nonceStr || null) != null && (data.data.package || null) != null && (data.data.signType || null) != null && (data.data.paySign || null) != null) {
|
||||
status = true;
|
||||
function onBridgeReady() {
|
||||
WeixinJSBridge.invoke(
|
||||
'getBrandWCPayRequest',
|
||||
{
|
||||
appId: data.data.appId,
|
||||
timeStamp: data.data.timeStamp,
|
||||
nonceStr: data.data.nonceStr,
|
||||
package: data.data.package,
|
||||
signType: data.data.signType,
|
||||
paySign: data.data.paySign,
|
||||
},
|
||||
function (res) {
|
||||
if (res.err_msg == 'get_brand_wcpay_request:ok') {
|
||||
// 数据设置
|
||||
self.order_item_pay_success_handle(index);
|
||||
|
||||
// 跳转支付页面
|
||||
uni.navigateTo({
|
||||
url: '/pages/paytips/paytips?code=9000',
|
||||
});
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
if (typeof WeixinJSBridge == 'undefined') {
|
||||
if (document.addEventListener) {
|
||||
document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);
|
||||
} else if (document.attachEvent) {
|
||||
document.attachEvent('WeixinJSBridgeReady', onBridgeReady);
|
||||
document.attachEvent('onWeixinJSBridgeReady', onBridgeReady);
|
||||
}
|
||||
} else {
|
||||
onBridgeReady();
|
||||
}
|
||||
}
|
||||
|
||||
// 二维码展示
|
||||
if ((data.data.qrcode_url || null) != null && (data.data.name || null) != null && (data.data.check_url || null) != null && (data.data.order_no || null) != null) {
|
||||
status = true;
|
||||
// 显示支付窗口
|
||||
this.setData({
|
||||
popup_view_pay_data: data.data,
|
||||
popup_view_pay_qrcode_is_show: true,
|
||||
});
|
||||
// 定时校验支付状态
|
||||
var timer = setInterval(function () {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('paycheck', 'recharge', 'wallet'),
|
||||
method: 'POST',
|
||||
data: {
|
||||
order_no: self.popup_view_pay_data.order_no,
|
||||
},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
// 清除定时和支付数据
|
||||
clearInterval(self.popup_view_pay_timer);
|
||||
self.setData({
|
||||
popup_view_pay_data: null,
|
||||
popup_view_pay_qrcode_is_show: false,
|
||||
});
|
||||
|
||||
// 数据设置
|
||||
self.order_item_pay_success_handle(index);
|
||||
|
||||
// 跳转支付页面
|
||||
uni.navigateTo({
|
||||
url: '/pages/paytips/paytips?code=9000',
|
||||
});
|
||||
} else {
|
||||
// -300支付中、其它状态则提示错误
|
||||
if (res.data.code != -300) {
|
||||
clearInterval(self.popup_view_pay_timer);
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
clearInterval(self.popup_view_pay_timer);
|
||||
app.globalData.showToast('服务器请求出错');
|
||||
},
|
||||
});
|
||||
}, 3000);
|
||||
self.setData({
|
||||
popup_view_pay_timer: timer,
|
||||
});
|
||||
}
|
||||
|
||||
// 返回html表单
|
||||
if ((data.data.html || null) != null) {
|
||||
status = true;
|
||||
var div = document.createElement('paydivform');
|
||||
div.innerHTML = data.data.html;
|
||||
document.body.appendChild(div);
|
||||
var fm = document.forms;
|
||||
var fm_len = fm.length;
|
||||
if (fm_len > 0) {
|
||||
fm[fm_len - 1].submit();
|
||||
}
|
||||
}
|
||||
|
||||
// 未匹配到的支付处理方式
|
||||
if (!status) {
|
||||
app.globalData.showToast(data.payment.name + '支付方式还未适配');
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// 支付成功数据设置
|
||||
order_item_pay_success_handle(index) {
|
||||
// 数据设置
|
||||
var temp_data_list = this.data_list;
|
||||
temp_data_list[index]['pay_money'] = temp_data_list[index]['money'];
|
||||
temp_data_list[index]['status'] = 1;
|
||||
temp_data_list[index]['status_name'] = '已支付';
|
||||
this.setData({
|
||||
data_list: temp_data_list,
|
||||
});
|
||||
},
|
||||
|
||||
// 删除
|
||||
delete_event(e) {
|
||||
uni.showModal({
|
||||
title: '温馨提示',
|
||||
content: '删除后不可恢复,确定继续吗?',
|
||||
confirmText: '确认',
|
||||
cancelText: '不了',
|
||||
success: (result) => {
|
||||
if (result.confirm) {
|
||||
// 参数
|
||||
var id = e.currentTarget.dataset.value;
|
||||
var index = e.currentTarget.dataset.index;
|
||||
|
||||
// 加载loding
|
||||
uni.showLoading({
|
||||
title: '处理中...',
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('delete', 'recharge', 'wallet'),
|
||||
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('服务器请求出错');
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 导航事件
|
||||
nav_event(e) {
|
||||
this.setData({
|
||||
nav_status_index: e.currentTarget.dataset.index || 0,
|
||||
data_page: 1,
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// 支付二维码展示窗口事件
|
||||
popup_view_pay_qrcode_event_close(e) {
|
||||
this.setData({
|
||||
popup_view_pay_qrcode_is_show: false,
|
||||
});
|
||||
clearInterval(this.popup_view_pay_timer);
|
||||
},
|
||||
|
||||
// 页面卸载
|
||||
onUnload(e) {
|
||||
clearInterval(this.popup_view_pay_timer);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.nav-detail .nav-child .item {
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
padding: 0 30rpx;
|
||||
min-width: 84rpx;
|
||||
}
|
||||
.payment-list .item {
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
.payment-list .item-content {
|
||||
padding: 20rpx 10rpx;
|
||||
}
|
||||
|
||||
.payment-list .item-content image {
|
||||
width: 50rpx;
|
||||
height: 50rpx !important;
|
||||
}
|
||||
</style>
|
||||
242
components/wallet/wallet-log/wallet-log.vue
Normal file
242
components/wallet/wallet-log/wallet-log.vue
Normal file
@ -0,0 +1,242 @@
|
||||
<template>
|
||||
<view>
|
||||
<!-- 导航 -->
|
||||
<view class="nav-child flex-row align-c margin-bottom-lg">
|
||||
<block v-for="(item, index) in nav_status_list" :key="index">
|
||||
<view class="item dis-inline-block round bg-grey-e margin-right-main tc" :class="'cr-grey ' + (nav_status_index == index ? 'cr-main bg-main-light' : '')" :data-index="index" @tap="nav_event">{{ item.name }}</view>
|
||||
</block>
|
||||
</view>
|
||||
|
||||
<!-- 列表 -->
|
||||
<view v-if="data_list.length > 0" class="data-list">
|
||||
<view v-for="(item, index) in data_list" :key="index" class="item padding-main border-radius-main oh bg-white spacing-mb">
|
||||
<view class="base oh br-b-dashed padding-bottom-main flex-row jc-sb align-c">
|
||||
<text>{{ item.status_name }}</text>
|
||||
<text class="cr-grey-9">{{ item.add_time_time }}</text>
|
||||
</view>
|
||||
<view class="content margin-top-main">
|
||||
<navigator :url="'/pages/plugins/wallet/wallet-log-detail/wallet-log-detail?id=' + item.id" hover-class="none">
|
||||
<block v-for="(fv, fi) in content_list" :key="fi">
|
||||
<view class="single-text margin-top-sm">
|
||||
<text class="cr-grey-9 margin-right-main">{{ fv.name }}:</text>
|
||||
<text class="fw-b">{{ item[fv.field] }}</text>
|
||||
<text v-if="(fv.unit || null) != null" class="fw-b">{{ fv.unit }}</text>
|
||||
</view>
|
||||
</block>
|
||||
</navigator>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status"></component-no-data>
|
||||
</view>
|
||||
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentNoData from '@/components/no-data/no-data';
|
||||
import componentBottomLine from '@/components/bottom-line/bottom-line';
|
||||
|
||||
export default {
|
||||
props: {
|
||||
propPullDownRefresh: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
propScrollLower: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
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_index: 0,
|
||||
nav_status_list: [
|
||||
{ name: '全部', value: '-1' },
|
||||
{ name: '减少', value: '0' },
|
||||
{ name: '增加', value: '1' },
|
||||
],
|
||||
content_list: [
|
||||
{ name: '业务类型', field: 'business_type_name' },
|
||||
{ name: '金额类型', field: 'money_type_name' },
|
||||
{ name: '操作金额', field: 'operation_money', unit: '元' },
|
||||
{ name: '原始金额', field: 'original_money', unit: '元' },
|
||||
{ name: '最新金额', field: 'latest_money', unit: '元' },
|
||||
],
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
},
|
||||
created() {
|
||||
this.init();
|
||||
},
|
||||
mounted() {
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle();
|
||||
},
|
||||
watch: {
|
||||
propPullDownRefresh(newVal, oldVal) {
|
||||
if (newVal !== oldVal) {
|
||||
this.setData({
|
||||
data_page: 1,
|
||||
});
|
||||
this.get_data_list(1);
|
||||
}
|
||||
},
|
||||
propScrollLower(newVal, oldVal) {
|
||||
if (newVal !== oldVal) {
|
||||
this.get_data_list();
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
methods: {
|
||||
init() {
|
||||
var user = app.globalData.get_user_info(this, 'init');
|
||||
if (user != false) {
|
||||
// 用户未绑定用户则转到登录页面
|
||||
if (app.globalData.user_is_need_login(user)) {
|
||||
uni.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_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
|
||||
uni.showLoading({
|
||||
title: '加载中...',
|
||||
});
|
||||
|
||||
// 参数
|
||||
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', 'walletlog', 'wallet'),
|
||||
method: 'POST',
|
||||
data: {
|
||||
page: this.data_page,
|
||||
operation_type: status,
|
||||
is_more: 1,
|
||||
},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
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: () => {
|
||||
uni.hideLoading();
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
app.globalData.showToast('服务器请求出错');
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 导航事件
|
||||
nav_event(e) {
|
||||
this.setData({
|
||||
nav_status_index: e.currentTarget.dataset.index || 0,
|
||||
data_page: 1,
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.nav-detail .nav-child .item {
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
padding: 0 30rpx;
|
||||
min-width: 84rpx;
|
||||
}
|
||||
</style>
|
||||
29
pages.json
29
pages.json
@ -551,13 +551,6 @@
|
||||
"navigationBarTitleText": "余额提现"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "wallet-log/wallet-log",
|
||||
"style": {
|
||||
"enablePullDownRefresh": true,
|
||||
"navigationBarTitleText": "账户明细"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "wallet-log-detail/wallet-log-detail",
|
||||
"style": {
|
||||
@ -565,13 +558,6 @@
|
||||
"navigationBarTitleText": "明细详情"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "user-recharge/user-recharge",
|
||||
"style": {
|
||||
"enablePullDownRefresh": true,
|
||||
"navigationBarTitleText": "充值记录"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "user-recharge-detail/user-recharge-detail",
|
||||
"style": {
|
||||
@ -579,13 +565,6 @@
|
||||
"navigationBarTitleText": "充值详情"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "user-cash/user-cash",
|
||||
"style": {
|
||||
"enablePullDownRefresh": true,
|
||||
"navigationBarTitleText": "提现记录"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "user-cash-detail/user-cash-detail",
|
||||
"style": {
|
||||
@ -657,13 +636,7 @@
|
||||
},
|
||||
{
|
||||
"root": "pages/plugins/invoice",
|
||||
"pages": [{
|
||||
"path": "user/user",
|
||||
"style": {
|
||||
"enablePullDownRefresh": true,
|
||||
"navigationBarTitleText": "我的发票"
|
||||
}
|
||||
},
|
||||
"pages": [
|
||||
{
|
||||
"path": "invoice/invoice",
|
||||
"style": {
|
||||
|
||||
@ -1,6 +1,28 @@
|
||||
/*
|
||||
* 导航
|
||||
*/
|
||||
.nav-base .item {
|
||||
width: 20%;
|
||||
.scroll-box-ece-nav {
|
||||
height: calc(100vh - 312rpx);
|
||||
}
|
||||
|
||||
/*
|
||||
* 发票内容
|
||||
*/
|
||||
.item-operation button {
|
||||
padding: 0 48rpx;
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
}
|
||||
|
||||
/*
|
||||
* 底部按钮
|
||||
*/
|
||||
.submit-container {
|
||||
padding: 42rpx 46rpx;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
.submit-container button {
|
||||
height: 88rpx;
|
||||
line-height: 88rpx;
|
||||
}
|
||||
@ -1,36 +1,45 @@
|
||||
<template>
|
||||
<view>
|
||||
<!-- 公告 -->
|
||||
<view v-if="data_base.length > 0 && data_base" class="padding-horizontal-main padding-vertical-sm bg-white">
|
||||
<uni-notice-bar class="padding-0 margin-0" show-icon scrollable :text="data_base.join('')" background-color="transparent" color="#666" />
|
||||
</view>
|
||||
<!-- 导航 -->
|
||||
<view class="nav-base bg-white">
|
||||
<view class="nav-base bg-white flex-row jc-sa align-c">
|
||||
<block v-for="(item, index) in nav_status_list" :key="index">
|
||||
<view :class="'item fl tc cr-grey ' + (nav_status_index == index ? 'cr-main' : '')" :data-index="index" @tap="nav_event">{{ item.name }}</view>
|
||||
<view :class="'item tc cr-grey ' + (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 class="base oh br-b-dashed padding-bottom-main flex-row jc-sb align-c">
|
||||
<text class="cr-grey-9">{{ item.add_time }}</text>
|
||||
<text class="cr-black" :class="item.status == 0 || item.status == 1 ? 'cr-black' : item.status == 2 ? 'cr-grey-c' : 'cr-red'">{{ item.status_name }}</text>
|
||||
</view>
|
||||
<view class="content margin-top">
|
||||
<view class="content margin-top-main">
|
||||
<navigator :url="'/pages/plugins/invoice/invoice-detail/invoice-detail?id=' + item.id" hover-class="none">
|
||||
<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>
|
||||
<text class="cr-grey-9 margin-right-main">{{ fv.name }}:</text>
|
||||
<text class="cr-black fw-b">{{ item[fv.field] }}</text>
|
||||
<text v-if="(fv.unit || null) != null" class="cr-grey fw-b">{{ fv.unit }}</text>
|
||||
</view>
|
||||
</block>
|
||||
</navigator>
|
||||
</view>
|
||||
<view v-if="item.status == 0 || item.status == 3 || item.status == 4" class="item-operation tr br-t padding-top-main margin-top-main">
|
||||
<button v-if="item.status == 0 || item.status == 3" class="round cr-base bg-white br" type="default" size="mini" @tap="edit_event" :data-value="item.id" hover-class="none">编辑</button>
|
||||
<button class="round cr-red br-red bg-white" type="default" size="mini" @tap="delete_event" :data-value="item.id" :data-index="index" hover-class="none">删除</button>
|
||||
<!-- 0待审核、1待开票、2已开票、3已拒绝, 4已关闭) -->
|
||||
<view v-if="item.status == 0 || item.status == 3 || item.status == 4" class="item-operation tr margin-top-main">
|
||||
<button class="round br-grey-9 bg-white text-size-md" type="default" size="mini" @tap="delete_event" :data-value="item.id" :data-index="index" hover-class="none">删除</button>
|
||||
<button v-if="item.status == 0 || item.status == 3" class="round cr-main br-main bg-white text-size-md" type="default" size="mini" @tap="edit_event" :data-value="item.id" hover-class="none">编辑</button>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottom-fixed bg-white submit-container">
|
||||
<navigator url="/pages/plugins/invoice/order/order" hover-class="none" class="sub-btn">
|
||||
<button class="round cr-main bg-white br-main text-size wh-auto" type="default" hover-class="none">订单开票</button>
|
||||
</navigator>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
@ -43,275 +52,314 @@
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentNoData from "../../../../components/no-data/no-data";
|
||||
import componentBottomLine from "../../../../components/bottom-line/bottom-line";
|
||||
const app = getApp();
|
||||
import componentNoData from '../../../../components/no-data/no-data';
|
||||
import componentBottomLine from '../../../../components/bottom-line/bottom-line';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
data_base: null,
|
||||
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: "全部", value: "-1" },
|
||||
{ name: "待审核", value: "0" },
|
||||
{ name: "待开票", value: "1" },
|
||||
{ name: "已开票", value: "2" },
|
||||
{ name: "已拒绝", value: "3" },
|
||||
],
|
||||
nav_status_index: 0,
|
||||
content_list: [
|
||||
{ name: "业务类型", field: "business_type_name" },
|
||||
{ name: "申请类型", field: "apply_type_name" },
|
||||
{ name: "发票类型", field: "invoice_type_name" },
|
||||
{ name: "发票金额", field: "total_price", unit: "元" },
|
||||
{ name: "发票抬头", field: "invoice_title" },
|
||||
],
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
},
|
||||
props: {},
|
||||
|
||||
onLoad(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,
|
||||
});
|
||||
},
|
||||
|
||||
onShow() {
|
||||
this.init();
|
||||
|
||||
// 分享菜单处理
|
||||
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) {
|
||||
// 用户未绑定用户则转到登录页面
|
||||
if (app.globalData.user_is_need_login(user)) {
|
||||
uni.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_bottom_line_status == true) {
|
||||
uni.stopPullDownRefresh();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// 是否加载中
|
||||
if (this.data_is_loading == 1) {
|
||||
return false;
|
||||
}
|
||||
this.setData({
|
||||
data_is_loading: 1,
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
data_base: [],
|
||||
data_list: [],
|
||||
data_total: 0,
|
||||
data_page_total: 0,
|
||||
data_page: 1,
|
||||
data_list_loding_status: 1,
|
||||
});
|
||||
|
||||
// 加载loding
|
||||
uni.showLoading({
|
||||
title: "加载中...",
|
||||
});
|
||||
|
||||
// 请求数据
|
||||
var data = {
|
||||
page: this.data_page,
|
||||
data_bottom_line_status: false,
|
||||
data_is_loading: 0,
|
||||
params: null,
|
||||
nav_status_list: [],
|
||||
nav_status_index: 0,
|
||||
content_list: [
|
||||
{ name: '业务类型', field: 'business_type_name' },
|
||||
{ name: '申请类型', field: 'apply_type_name' },
|
||||
{ name: '发票类型', field: 'invoice_type_name' },
|
||||
{ name: '发票金额', field: 'total_price', unit: '元' },
|
||||
{ name: '发票抬头', field: 'invoice_title' },
|
||||
],
|
||||
};
|
||||
},
|
||||
|
||||
// 状态
|
||||
var status = (this.nav_status_list[this.nav_status_index] || null) == null ? -1 : this.nav_status_list[this.nav_status_index]["value"];
|
||||
if (status != -1) {
|
||||
data["status"] = status;
|
||||
}
|
||||
components: {
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
},
|
||||
props: {},
|
||||
|
||||
// 获取数据
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("index", "user", "invoice"),
|
||||
method: "POST",
|
||||
data: data,
|
||||
dataType: "json",
|
||||
success: (res) => {
|
||||
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_base: res.data.data.base || null,
|
||||
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);
|
||||
}
|
||||
onLoad(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]['id'] == params.status) {
|
||||
nav_status_index = i;
|
||||
break;
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
app.globalData.showToast("服务器请求出错");
|
||||
},
|
||||
}
|
||||
}
|
||||
this.setData({
|
||||
params: params,
|
||||
nav_status_index: nav_status_index,
|
||||
});
|
||||
},
|
||||
|
||||
// 滚动加载
|
||||
scroll_lower(e) {
|
||||
this.get_data_list();
|
||||
onShow() {
|
||||
// 初始化配置
|
||||
this.init();
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle();
|
||||
},
|
||||
|
||||
// 导航事件
|
||||
nav_event(e) {
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.setData({
|
||||
nav_status_index: e.currentTarget.dataset.index || 0,
|
||||
data_page: 1,
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// 编辑事件
|
||||
edit_event(e) {
|
||||
uni.navigateTo({
|
||||
url: "/pages/plugins/invoice/invoice-saveinfo/invoice-saveinfo?id=" + e.currentTarget.dataset.value,
|
||||
});
|
||||
},
|
||||
|
||||
// 删除
|
||||
delete_event(e) {
|
||||
uni.showModal({
|
||||
title: "温馨提示",
|
||||
content: "删除后不可恢复,确定继续吗?",
|
||||
confirmText: "确认",
|
||||
cancelText: "不了",
|
||||
success: (result) => {
|
||||
if (result.confirm) {
|
||||
// 参数
|
||||
var value = e.currentTarget.dataset.value;
|
||||
var index = e.currentTarget.dataset.index;
|
||||
|
||||
// 加载loding
|
||||
uni.showLoading({
|
||||
title: "处理中...",
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("delete", "user", "invoice"),
|
||||
method: "POST",
|
||||
data: {
|
||||
ids: value,
|
||||
},
|
||||
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,
|
||||
methods: {
|
||||
// 初始化
|
||||
init(e) {
|
||||
var user = app.globalData.get_user_info(this, 'init');
|
||||
if (user != false) {
|
||||
// 用户未绑定用户则转到登录页面
|
||||
if (app.globalData.user_is_need_login(user)) {
|
||||
uni.showModal({
|
||||
title: '温馨提示',
|
||||
content: '绑定手机号码',
|
||||
confirmText: '确认',
|
||||
cancelText: '暂不',
|
||||
success: (result) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (result.confirm) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/login/login?event_callback=init',
|
||||
});
|
||||
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("服务器请求出错");
|
||||
},
|
||||
});
|
||||
} else {
|
||||
this.get_data_base();
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
// 获取公告数据
|
||||
get_data_base() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('center', 'user', 'invoice'),
|
||||
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.invoice_desc || [],
|
||||
nav_status_list: data.nav || [],
|
||||
data_list_loding_status: 0,
|
||||
data_bottom_line_status: false,
|
||||
});
|
||||
this.get_data_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_base')) {
|
||||
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: '服务器请求出错',
|
||||
});
|
||||
app.globalData.showToast('服务器请求出错');
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
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
|
||||
uni.showLoading({
|
||||
title: '加载中...',
|
||||
});
|
||||
|
||||
// 请求数据
|
||||
var data = {
|
||||
page: this.data_page,
|
||||
};
|
||||
|
||||
// 状态
|
||||
var status = (this.nav_status_list[this.nav_status_index] || null) == null ? -1 : this.nav_status_list[this.nav_status_index]['id'];
|
||||
if (status != -1) {
|
||||
data['status'] = status;
|
||||
}
|
||||
|
||||
// 获取数据
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('index', 'user', 'invoice'),
|
||||
method: 'POST',
|
||||
data: data,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
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: () => {
|
||||
uni.hideLoading();
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
app.globalData.showToast('服务器请求出错');
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 滚动加载
|
||||
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);
|
||||
},
|
||||
|
||||
// 编辑事件
|
||||
edit_event(e) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/plugins/invoice/invoice-saveinfo/invoice-saveinfo?id=' + e.currentTarget.dataset.value,
|
||||
});
|
||||
},
|
||||
|
||||
// 删除
|
||||
delete_event(e) {
|
||||
uni.showModal({
|
||||
title: '温馨提示',
|
||||
content: '删除后不可恢复,确定继续吗?',
|
||||
confirmText: '确认',
|
||||
cancelText: '不了',
|
||||
success: (result) => {
|
||||
if (result.confirm) {
|
||||
// 参数
|
||||
var value = e.currentTarget.dataset.value;
|
||||
var index = e.currentTarget.dataset.index;
|
||||
|
||||
// 加载loding
|
||||
uni.showLoading({
|
||||
title: '处理中...',
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('delete', 'user', 'invoice'),
|
||||
method: 'POST',
|
||||
data: {
|
||||
ids: value,
|
||||
},
|
||||
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('服务器请求出错');
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import "./invoice.css";
|
||||
@import './invoice.css';
|
||||
</style>
|
||||
|
||||
@ -10,9 +10,11 @@
|
||||
* 合并按钮
|
||||
*/
|
||||
.invoice-merge-submit {
|
||||
width: 220rpx;
|
||||
height: 70rpx !important;
|
||||
line-height: 74rpx !important;
|
||||
left: calc(50% - 110rpx);
|
||||
bottom: 50rpx;
|
||||
padding: 42rpx 46rpx;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
.invoice-merge-submit button {
|
||||
height: 88rpx;
|
||||
line-height: 88rpx;
|
||||
}
|
||||
@ -4,28 +4,38 @@
|
||||
<view class="data-list">
|
||||
<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="select-icon va-m margin-right-sm" data-type="node" :data-value="item.id" @tap="selected_event" :src="common_static_url + 'select' + (select_ids.indexOf(item.id) != -1 ? '-active' : '') + '-icon.png'" mode="widthFix"></image>
|
||||
<text class="cr-base va-m">{{ item.add_time }}</text>
|
||||
<view class="base oh br-b-dashed padding-bottom-main">
|
||||
<iconfont
|
||||
class="margin-right-sm pr top-md"
|
||||
:name="select_ids.indexOf(item.id) != -1 ? 'icon-zhifu-yixuan' : 'icon-zhifu-weixuan'"
|
||||
size="34rpx"
|
||||
:color="select_ids.indexOf(item.id) != -1 ? '#E22C08' : '#999'"
|
||||
data-type="node"
|
||||
:data-value="item.id"
|
||||
@tap="selected_event"
|
||||
></iconfont>
|
||||
<text class="cr-grey-9 va-m">{{ item.add_time }}</text>
|
||||
</view>
|
||||
<view class="content margin-top">
|
||||
<navigator :url="'/pages/user-order-detail/user-order-detail?id=' + item.id" hover-class="none">
|
||||
<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>
|
||||
<text class="cr-grey-9 margin-right-main">{{ fv.name }}:</text>
|
||||
<text class="fw-b">{{ item[fv.field] }}</text>
|
||||
<text v-if="(fv.unit || null) != null" class="fw-b">{{ fv.unit }}</text>
|
||||
</view>
|
||||
</block>
|
||||
</navigator>
|
||||
</view>
|
||||
<view class="item-operation tr br-t padding-top-main margin-top-main">
|
||||
<button class="round bg-white br cr-base br" type="default" size="mini" hover-class="none" :data-ids="item.id" data-type="item" @tap="invoice_event">开票</button>
|
||||
<view class="item-operation tr margin-top-main">
|
||||
<button class="round bg-white br-grey-9 text-size-md" type="default" size="mini" hover-class="none" :data-ids="item.id" data-type="item" @tap="invoice_event">开票</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 合并开票 -->
|
||||
<button v-if="select_ids.length > 0" class="bottom-fixed invoice-merge-submit bg-green cr-white round" type="default" size="mini" hover-class="none" data-type="all" @tap="invoice_event">合并开票</button>
|
||||
<view class="bottom-fixed bg-white invoice-merge-submit">
|
||||
<button v-if="select_ids.length > 0" class="bg-white cr-main br-main round wh-auto" type="default" size="mini" hover-class="none" data-type="all" @tap="invoice_event">合并开票</button>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
@ -39,217 +49,215 @@
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentNoData from "../../../../components/no-data/no-data";
|
||||
import componentBottomLine from "../../../../components/bottom-line/bottom-line";
|
||||
const app = getApp();
|
||||
import componentNoData from '../../../../components/no-data/no-data';
|
||||
import componentBottomLine from '../../../../components/bottom-line/bottom-line';
|
||||
|
||||
var common_static_url = app.globalData.get_static_url("common");
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
common_static_url: common_static_url,
|
||||
data_base: null,
|
||||
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,
|
||||
select_ids: [],
|
||||
content_list: [
|
||||
{ name: "订单编号", field: "order_no" },
|
||||
{ name: "订单总额", field: "total_price", unit: "元" },
|
||||
{ name: "支付金额", field: "pay_price", unit: "元" },
|
||||
{ name: "订单单价", field: "price", unit: "元" },
|
||||
],
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
},
|
||||
props: {},
|
||||
|
||||
onLoad(params) {
|
||||
this.setData({
|
||||
params: params,
|
||||
});
|
||||
},
|
||||
|
||||
onShow() {
|
||||
this.init();
|
||||
|
||||
// 分享菜单处理
|
||||
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) {
|
||||
// 用户未绑定用户则转到登录页面
|
||||
if (app.globalData.user_is_need_login(user)) {
|
||||
uni.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,
|
||||
});
|
||||
}
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
data_base: null,
|
||||
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,
|
||||
select_ids: [],
|
||||
content_list: [
|
||||
{ name: '订单编号', field: 'order_no' },
|
||||
{ name: '订单总额', field: 'total_price', unit: '元' },
|
||||
{ name: '支付金额', field: 'pay_price', unit: '元' },
|
||||
{ name: '订单单价', field: 'price', unit: '元' },
|
||||
],
|
||||
};
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data_list(is_mandatory) {
|
||||
// 分页是否还有数据
|
||||
if ((is_mandatory || 0) == 0) {
|
||||
if (this.data_bottom_line_status == true) {
|
||||
uni.stopPullDownRefresh();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
components: {
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
},
|
||||
props: {},
|
||||
|
||||
// 是否加载中
|
||||
if (this.data_is_loading == 1) {
|
||||
return false;
|
||||
}
|
||||
onLoad(params) {
|
||||
this.setData({
|
||||
data_is_loading: 1,
|
||||
data_list_loding_status: 1,
|
||||
params: params,
|
||||
});
|
||||
},
|
||||
|
||||
// 加载loding
|
||||
uni.showLoading({
|
||||
title: "加载中...",
|
||||
onShow() {
|
||||
this.init();
|
||||
|
||||
// 分享菜单处理
|
||||
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) {
|
||||
// 用户未绑定用户则转到登录页面
|
||||
if (app.globalData.user_is_need_login(user)) {
|
||||
uni.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,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("index", "order", "invoice"),
|
||||
method: "POST",
|
||||
data: {
|
||||
page: this.data_page,
|
||||
},
|
||||
dataType: "json",
|
||||
success: (res) => {
|
||||
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_base: res.data.data.base || null,
|
||||
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,
|
||||
});
|
||||
get_data_list(is_mandatory) {
|
||||
// 分页是否还有数据
|
||||
if ((is_mandatory || 0) == 0) {
|
||||
if (this.data_bottom_line_status == true) {
|
||||
uni.stopPullDownRefresh();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// 是否还有数据
|
||||
this.setData({
|
||||
data_bottom_line_status: this.data_page > 1 && this.data_page > this.data_page_total,
|
||||
});
|
||||
// 是否加载中
|
||||
if (this.data_is_loading == 1) {
|
||||
return false;
|
||||
}
|
||||
this.setData({
|
||||
data_is_loading: 1,
|
||||
data_list_loding_status: 1,
|
||||
});
|
||||
|
||||
// 加载loding
|
||||
uni.showLoading({
|
||||
title: '加载中...',
|
||||
});
|
||||
|
||||
// 获取数据
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('index', 'order', 'invoice'),
|
||||
method: 'POST',
|
||||
data: {
|
||||
page: this.data_page,
|
||||
},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
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_base: res.data.data.base || null,
|
||||
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_list: [],
|
||||
data_bottom_line_status: false,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
if (app.globalData.is_login_check(res.data, this, 'get_data_list')) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_list_loding_status: 2,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
if (app.globalData.is_login_check(res.data, this, "get_data_list")) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
app.globalData.showToast("服务器请求出错");
|
||||
},
|
||||
});
|
||||
},
|
||||
app.globalData.showToast('服务器请求出错');
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 滚动加载
|
||||
scroll_lower(e) {
|
||||
this.get_data_list();
|
||||
},
|
||||
// 滚动加载
|
||||
scroll_lower(e) {
|
||||
this.get_data_list();
|
||||
},
|
||||
|
||||
// 选择
|
||||
selected_event(e) {
|
||||
var value = e.currentTarget.dataset.value;
|
||||
var temp_select_ids = this.select_ids;
|
||||
var index = temp_select_ids.indexOf(value);
|
||||
if (index == -1) {
|
||||
temp_select_ids.push(value);
|
||||
} else {
|
||||
temp_select_ids.splice(index, 1);
|
||||
}
|
||||
this.setData({
|
||||
select_ids: temp_select_ids,
|
||||
});
|
||||
},
|
||||
|
||||
// 合并开票
|
||||
invoice_event(e) {
|
||||
var type = e.currentTarget.dataset.type || "all";
|
||||
var ids = e.currentTarget.dataset.ids || null;
|
||||
if (type == "all") {
|
||||
if (this.select_ids.length <= 0) {
|
||||
app.globalData.showToast("请先选择数据");
|
||||
return false;
|
||||
// 选择
|
||||
selected_event(e) {
|
||||
var value = e.currentTarget.dataset.value;
|
||||
var temp_select_ids = this.select_ids;
|
||||
var index = temp_select_ids.indexOf(value);
|
||||
if (index == -1) {
|
||||
temp_select_ids.push(value);
|
||||
} else {
|
||||
ids = this.select_ids.join(",");
|
||||
temp_select_ids.splice(index, 1);
|
||||
}
|
||||
} else {
|
||||
if (ids === null) {
|
||||
app.globalData.showToast("元素参数id有误");
|
||||
return false;
|
||||
this.setData({
|
||||
select_ids: temp_select_ids,
|
||||
});
|
||||
},
|
||||
|
||||
// 合并开票
|
||||
invoice_event(e) {
|
||||
var type = e.currentTarget.dataset.type || 'all';
|
||||
var ids = e.currentTarget.dataset.ids || null;
|
||||
if (type == 'all') {
|
||||
if (this.select_ids.length <= 0) {
|
||||
app.globalData.showToast('请先选择数据');
|
||||
return false;
|
||||
} else {
|
||||
ids = this.select_ids.join(',');
|
||||
}
|
||||
} else {
|
||||
if (ids === null) {
|
||||
app.globalData.showToast('元素参数id有误');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: "/pages/plugins/invoice/invoice-saveinfo/invoice-saveinfo?ids=" + ids + "&type=order&is_redirect=1",
|
||||
});
|
||||
uni.navigateTo({
|
||||
url: '/pages/plugins/invoice/invoice-saveinfo/invoice-saveinfo?ids=' + ids + '&type=order&is_redirect=1',
|
||||
});
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import "./order.css";
|
||||
@import './order.css';
|
||||
</style>
|
||||
|
||||
@ -7,16 +7,16 @@
|
||||
<view class="item fl tc padding-main border-radius-main bg-white">
|
||||
<navigator :url="item.url" hover-class="none">
|
||||
<image :src="item.icon" mode="scaleToFill" class="dis-block"></image>
|
||||
<view class="tc cr-base margin-top-lg">{{item.title}}</view>
|
||||
<view class="tc cr-base margin-top-lg">{{ item.title }}</view>
|
||||
</navigator>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
|
||||
|
||||
<!-- 通知 -->
|
||||
<view v-if="(data_base.invoice_desc || null) != null && data_base.invoice_desc.length > 0" class="padding-horizontal-main padding-bottom-main">
|
||||
<view class="notice-content">
|
||||
<view v-for="(item, index) in data_base.invoice_desc" :key="index" class="item">{{item}}</view>
|
||||
<view v-for="(item, index) in data_base.invoice_desc" :key="index" class="item">{{ item }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -28,7 +28,7 @@
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentNoData from "../../../../components/no-data/no-data";
|
||||
import componentNoData from '../../../../components/no-data/no-data';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@ -37,12 +37,12 @@
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
data_base: null,
|
||||
nav_list: []
|
||||
nav_list: [],
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentNoData
|
||||
componentNoData,
|
||||
},
|
||||
props: {},
|
||||
|
||||
@ -62,7 +62,7 @@
|
||||
|
||||
methods: {
|
||||
init(e) {
|
||||
var user = app.globalData.get_user_info(this, "init");
|
||||
var user = app.globalData.get_user_info(this, 'init');
|
||||
if (user != false) {
|
||||
// 用户未绑定用户则转到登录页面
|
||||
if (app.globalData.user_is_need_login(user)) {
|
||||
@ -71,14 +71,14 @@
|
||||
content: '绑定手机号码',
|
||||
confirmText: '确认',
|
||||
cancelText: '暂不',
|
||||
success: result => {
|
||||
success: (result) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (result.confirm) {
|
||||
uni.navigateTo({
|
||||
url: "/pages/login/login?event_callback=init"
|
||||
url: '/pages/login/login?event_callback=init',
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
} else {
|
||||
this.get_data();
|
||||
@ -89,11 +89,11 @@
|
||||
// 获取数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("center", "user", "invoice"),
|
||||
url: app.globalData.get_request_url('center', 'user', 'invoice'),
|
||||
method: 'POST',
|
||||
data: {},
|
||||
dataType: 'json',
|
||||
success: res => {
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
@ -102,13 +102,13 @@
|
||||
nav_list: data.nav_list || [],
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: 0,
|
||||
data_bottom_line_status: false
|
||||
data_bottom_line_status: false,
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: res.data.msg
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
if (app.globalData.is_login_check(res.data, this, 'get_data')) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
@ -120,15 +120,15 @@
|
||||
this.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: '服务器请求出错'
|
||||
data_list_loding_msg: '服务器请求出错',
|
||||
});
|
||||
app.globalData.showToast('服务器请求出错');
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './user.css';
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
<picker name="account_type" @change="select_check_account_event" :value="check_account_value" :range="check_account_list" range-key="msg">
|
||||
<view :class="'picker name ' + (check_account_value == null ? 'cr-grey' : 'cr-base')">
|
||||
<view v-if="check_account_value == null">请选择认证账号</view>
|
||||
<view v-else>{{ check_account_list[check_account_value]["msg"] }}</view>
|
||||
<view v-else>{{ check_account_list[check_account_value]['msg'] }}</view>
|
||||
</view>
|
||||
</picker>
|
||||
</view>
|
||||
@ -64,241 +64,241 @@
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentNoData from "../../../../components/no-data/no-data";
|
||||
const app = getApp();
|
||||
import componentNoData from '../../../../components/no-data/no-data';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
params: null,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: "",
|
||||
data_base: null,
|
||||
user_wallet: null,
|
||||
check_account_list: [],
|
||||
verify_submit_text: "获取验证码",
|
||||
verify_loading: false,
|
||||
verify_disabled: false,
|
||||
form_submit_loading: false,
|
||||
verify_time_total: 60,
|
||||
temp_clear_time: null,
|
||||
check_account_value: null,
|
||||
form_submit_disabled_status: false,
|
||||
is_can_cash: 0,
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentNoData,
|
||||
},
|
||||
props: {},
|
||||
|
||||
onLoad(params) {},
|
||||
|
||||
onShow() {
|
||||
this.init();
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle();
|
||||
},
|
||||
|
||||
methods: {
|
||||
init() {
|
||||
var user = app.globalData.get_user_info(this, "init");
|
||||
if (user != false) {
|
||||
// 用户未绑定用户则转到登录页面
|
||||
if (app.globalData.user_is_need_login(user)) {
|
||||
uni.redirectTo({
|
||||
url: "/pages/login/login?event_callback=init",
|
||||
});
|
||||
return false;
|
||||
} else {
|
||||
// 获取数据
|
||||
this.get_data();
|
||||
}
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
});
|
||||
}
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
params: null,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
data_base: null,
|
||||
user_wallet: null,
|
||||
check_account_list: [],
|
||||
verify_submit_text: '获取验证码',
|
||||
verify_loading: false,
|
||||
verify_disabled: false,
|
||||
form_submit_loading: false,
|
||||
verify_time_total: 60,
|
||||
temp_clear_time: null,
|
||||
check_account_value: null,
|
||||
form_submit_disabled_status: false,
|
||||
is_can_cash: 0,
|
||||
};
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data() {
|
||||
// 加载loding
|
||||
uni.showLoading({
|
||||
title: "加载中...",
|
||||
});
|
||||
this.setData({
|
||||
data_list_loding_status: 1,
|
||||
});
|
||||
components: {
|
||||
componentNoData,
|
||||
},
|
||||
props: {},
|
||||
|
||||
// 获取数据
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("auth", "cash", "wallet"),
|
||||
method: "POST",
|
||||
data: {},
|
||||
dataType: "json",
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
onLoad(params) {},
|
||||
|
||||
onShow() {
|
||||
this.init();
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle();
|
||||
},
|
||||
|
||||
methods: {
|
||||
init() {
|
||||
var user = app.globalData.get_user_info(this, 'init');
|
||||
if (user != false) {
|
||||
// 用户未绑定用户则转到登录页面
|
||||
if (app.globalData.user_is_need_login(user)) {
|
||||
uni.redirectTo({
|
||||
url: '/pages/login/login?event_callback=init',
|
||||
});
|
||||
return false;
|
||||
} else {
|
||||
// 获取数据
|
||||
this.get_data();
|
||||
}
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
});
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
var upd_data = {
|
||||
data_base: data.base || null,
|
||||
user_wallet: data.user_wallet || null,
|
||||
check_account_list: data.check_account_list || [],
|
||||
};
|
||||
if ((upd_data.data_base != null && upd_data.user_wallet != null && (upd_data.data_base.cash_minimum_amount || 0) <= 0) || parseFloat(upd_data.user_wallet.normal_money) >= parseFloat(upd_data.data_base.cash_minimum_amount)) {
|
||||
upd_data["is_can_cash"] = 1;
|
||||
}
|
||||
this.setData(upd_data);
|
||||
} else {
|
||||
if (app.globalData.is_login_check(res.data, this, "get_data")) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
});
|
||||
app.globalData.showToast("服务器请求出错");
|
||||
},
|
||||
});
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
// 身份认证方式事件
|
||||
select_check_account_event(e) {
|
||||
this.setData({
|
||||
check_account_value: e.detail.value || 0,
|
||||
});
|
||||
},
|
||||
|
||||
// 发送验证码
|
||||
verify_send_event() {
|
||||
// 数据验证
|
||||
var self = this;
|
||||
if (self.check_account_value == null) {
|
||||
app.globalData.showToast("请选择认证方式");
|
||||
return false;
|
||||
}
|
||||
|
||||
uni.showLoading({
|
||||
title: "发送中...",
|
||||
});
|
||||
this.setData({
|
||||
verify_submit_text: "发送中",
|
||||
verify_loading: true,
|
||||
verify_disabled: true,
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("verifysend", "cash", "wallet"),
|
||||
method: "POST",
|
||||
data: {
|
||||
account_type: self.check_account_list[self.check_account_value]["field"],
|
||||
},
|
||||
dataType: "json",
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
this.setData({
|
||||
verify_loading: false,
|
||||
});
|
||||
var temp_time = this.verify_time_total;
|
||||
this.temp_clear_time = setInterval(function () {
|
||||
if (temp_time <= 1) {
|
||||
clearInterval(self.temp_clear_time);
|
||||
self.setData({
|
||||
verify_submit_text: "获取验证码",
|
||||
verify_disabled: false,
|
||||
});
|
||||
} else {
|
||||
temp_time--;
|
||||
self.setData({
|
||||
verify_submit_text: "剩余 " + temp_time + " 秒",
|
||||
});
|
||||
}
|
||||
}, 1000);
|
||||
} else {
|
||||
this.setData({
|
||||
verify_submit_text: "获取验证码",
|
||||
verify_loading: false,
|
||||
verify_disabled: false,
|
||||
});
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
this.setData({
|
||||
verify_submit_text: "获取验证码",
|
||||
verify_loading: false,
|
||||
verify_disabled: false,
|
||||
});
|
||||
app.globalData.showToast("服务器请求出错");
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 数据提交
|
||||
form_submit(e) {
|
||||
// 表单数据
|
||||
var form_data = e.detail.value;
|
||||
|
||||
// 数据校验
|
||||
var validation = [
|
||||
{ fields: "account_type", msg: "请选择认证方式", is_can_zero: 1 },
|
||||
{ fields: "verify", msg: "请输入验证码" },
|
||||
];
|
||||
|
||||
// 验证提交表单
|
||||
if (app.globalData.fields_check(form_data, validation)) {
|
||||
form_data["account_type"] = this.check_account_list[this.check_account_value]["field"];
|
||||
this.setData({
|
||||
form_submit_disabled_status: true,
|
||||
});
|
||||
// 获取数据
|
||||
get_data() {
|
||||
// 加载loding
|
||||
uni.showLoading({
|
||||
title: "处理中...",
|
||||
title: '加载中...',
|
||||
});
|
||||
this.setData({
|
||||
data_list_loding_status: 1,
|
||||
});
|
||||
|
||||
// 获取数据
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("verifycheck", "cash", "wallet"),
|
||||
method: "POST",
|
||||
data: form_data,
|
||||
dataType: "json",
|
||||
url: app.globalData.get_request_url('auth', 'cash', 'wallet'),
|
||||
method: 'POST',
|
||||
data: {},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
this.setData({
|
||||
form_submit_disabled_status: false,
|
||||
data_list_loding_status: 0,
|
||||
});
|
||||
if (res.data.code == 0) {
|
||||
uni.redirectTo({
|
||||
url: "/pages/plugins/wallet/cash-create/cash-create",
|
||||
});
|
||||
var data = res.data.data;
|
||||
var upd_data = {
|
||||
data_base: data.base || null,
|
||||
user_wallet: data.user_wallet || null,
|
||||
check_account_list: data.check_account_list || [],
|
||||
};
|
||||
if ((upd_data.data_base != null && upd_data.user_wallet != null && (upd_data.data_base.cash_minimum_amount || 0) <= 0) || parseFloat(upd_data.user_wallet.normal_money) >= parseFloat(upd_data.data_base.cash_minimum_amount)) {
|
||||
upd_data['is_can_cash'] = 1;
|
||||
}
|
||||
this.setData(upd_data);
|
||||
} else {
|
||||
if (app.globalData.is_login_check(res.data)) {
|
||||
if (app.globalData.is_login_check(res.data, this, 'get_data')) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
} else {
|
||||
app.globalData.showToast("提交失败,请重试!");
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
this.setData({
|
||||
form_submit_disabled_status: false,
|
||||
});
|
||||
uni.hideLoading();
|
||||
app.globalData.showToast("服务器请求出错");
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
});
|
||||
app.globalData.showToast('服务器请求出错');
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 身份认证方式事件
|
||||
select_check_account_event(e) {
|
||||
this.setData({
|
||||
check_account_value: e.detail.value || 0,
|
||||
});
|
||||
},
|
||||
|
||||
// 发送验证码
|
||||
verify_send_event() {
|
||||
// 数据验证
|
||||
var self = this;
|
||||
if (self.check_account_value == null) {
|
||||
app.globalData.showToast('请选择认证方式');
|
||||
return false;
|
||||
}
|
||||
|
||||
uni.showLoading({
|
||||
title: '发送中...',
|
||||
});
|
||||
this.setData({
|
||||
verify_submit_text: '发送中',
|
||||
verify_loading: true,
|
||||
verify_disabled: true,
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('verifysend', 'cash', 'wallet'),
|
||||
method: 'POST',
|
||||
data: {
|
||||
account_type: self.check_account_list[self.check_account_value]['field'],
|
||||
},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
this.setData({
|
||||
verify_loading: false,
|
||||
});
|
||||
var temp_time = this.verify_time_total;
|
||||
this.temp_clear_time = setInterval(function () {
|
||||
if (temp_time <= 1) {
|
||||
clearInterval(self.temp_clear_time);
|
||||
self.setData({
|
||||
verify_submit_text: '获取验证码',
|
||||
verify_disabled: false,
|
||||
});
|
||||
} else {
|
||||
temp_time--;
|
||||
self.setData({
|
||||
verify_submit_text: '剩余 ' + temp_time + ' 秒',
|
||||
});
|
||||
}
|
||||
}, 1000);
|
||||
} else {
|
||||
this.setData({
|
||||
verify_submit_text: '获取验证码',
|
||||
verify_loading: false,
|
||||
verify_disabled: false,
|
||||
});
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
this.setData({
|
||||
verify_submit_text: '获取验证码',
|
||||
verify_loading: false,
|
||||
verify_disabled: false,
|
||||
});
|
||||
app.globalData.showToast('服务器请求出错');
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 数据提交
|
||||
form_submit(e) {
|
||||
// 表单数据
|
||||
var form_data = e.detail.value;
|
||||
|
||||
// 数据校验
|
||||
var validation = [
|
||||
{ fields: 'account_type', msg: '请选择认证方式', is_can_zero: 1 },
|
||||
{ fields: 'verify', msg: '请输入验证码' },
|
||||
];
|
||||
|
||||
// 验证提交表单
|
||||
if (app.globalData.fields_check(form_data, validation)) {
|
||||
form_data['account_type'] = this.check_account_list[this.check_account_value]['field'];
|
||||
this.setData({
|
||||
form_submit_disabled_status: true,
|
||||
});
|
||||
uni.showLoading({
|
||||
title: '处理中...',
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('verifycheck', 'cash', 'wallet'),
|
||||
method: 'POST',
|
||||
data: form_data,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
this.setData({
|
||||
form_submit_disabled_status: false,
|
||||
});
|
||||
if (res.data.code == 0) {
|
||||
uni.redirectTo({
|
||||
url: '/pages/plugins/wallet/user/user?status=2',
|
||||
});
|
||||
} else {
|
||||
if (app.globalData.is_login_check(res.data)) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
} else {
|
||||
app.globalData.showToast('提交失败,请重试!');
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
this.setData({
|
||||
form_submit_disabled_status: false,
|
||||
});
|
||||
uni.hideLoading();
|
||||
app.globalData.showToast('服务器请求出错');
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import "./cash-auth.css";
|
||||
@import './cash-auth.css';
|
||||
</style>
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
<view>
|
||||
<view class="form-container padding-main">
|
||||
<view class="form-gorup padding-vertical-main">
|
||||
<input type="digit" name="money" :value="recharge_money_value || ''" placeholder-class="cr-grey" class="cr-base text-size-xxl" placeholder="请输入充值金额" @input="recharge_money_value_input_event" maxlength="6">
|
||||
<input type="digit" name="money" :value="recharge_money_value || ''" placeholder-class="cr-grey" class="cr-base text-size-xxl" placeholder="请输入充值金额" @input="recharge_money_value_input_event" maxlength="6" />
|
||||
</view>
|
||||
<view class="form-gorup form-gorup-submit">
|
||||
<button class="round cr-white bg-main br-main text-size" type="default" hover-class="none" :disabled="form_submit_disabled_status" @tap="form_submit_event">提交</button>
|
||||
@ -21,7 +21,7 @@
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
recharge_money_value: '',
|
||||
form_submit_disabled_status: false
|
||||
form_submit_disabled_status: false,
|
||||
};
|
||||
},
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
onLoad(params) {
|
||||
this.setData({
|
||||
params: params,
|
||||
recharge_money_value: params.money || ''
|
||||
recharge_money_value: params.money || '',
|
||||
});
|
||||
},
|
||||
|
||||
@ -44,23 +44,23 @@
|
||||
|
||||
methods: {
|
||||
init() {
|
||||
var user = app.globalData.get_user_info(this, "init");
|
||||
var user = app.globalData.get_user_info(this, 'init');
|
||||
if (user != false) {
|
||||
// 用户未绑定用户则转到登录页面
|
||||
if (app.globalData.user_is_need_login(user)) {
|
||||
uni.redirectTo({
|
||||
url: "/pages/login/login?event_callback=init"
|
||||
url: '/pages/login/login?event_callback=init',
|
||||
});
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: '请先绑定手机号码'
|
||||
data_list_loding_msg: '请先绑定手机号码',
|
||||
});
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: '请先授权用户信息'
|
||||
data_list_loding_msg: '请先授权用户信息',
|
||||
});
|
||||
}
|
||||
},
|
||||
@ -68,7 +68,7 @@
|
||||
// 充值金额输入事件
|
||||
recharge_money_value_input_event(e) {
|
||||
this.setData({
|
||||
recharge_money_value: e.detail.value || ''
|
||||
recharge_money_value: e.detail.value || '',
|
||||
});
|
||||
},
|
||||
|
||||
@ -81,27 +81,27 @@
|
||||
}
|
||||
|
||||
this.setData({
|
||||
form_submit_disabled_status: true
|
||||
form_submit_disabled_status: true,
|
||||
});
|
||||
uni.showLoading({
|
||||
title: '处理中...'
|
||||
title: '处理中...',
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("create", "recharge", "wallet"),
|
||||
url: app.globalData.get_request_url('create', 'recharge', 'wallet'),
|
||||
method: 'POST',
|
||||
data: {
|
||||
money: this.recharge_money_value
|
||||
money: this.recharge_money_value,
|
||||
},
|
||||
dataType: 'json',
|
||||
success: res => {
|
||||
success: (res) => {
|
||||
this.setData({
|
||||
form_submit_disabled_status: false
|
||||
form_submit_disabled_status: false,
|
||||
});
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
uni.setStorageSync(app.globalData.data.cache_page_pay_key, {order_ids: res.data.data.recharge_id});
|
||||
uni.setStorageSync(app.globalData.data.cache_page_pay_key, { order_ids: res.data.data.recharge_id });
|
||||
uni.redirectTo({
|
||||
url: '/pages/plugins/wallet/user-recharge/user-recharge'
|
||||
url: '/pages/plugins/wallet/user/user?status=1',
|
||||
});
|
||||
} else {
|
||||
if (app.globalData.is_login_check(res.data)) {
|
||||
@ -113,16 +113,16 @@
|
||||
},
|
||||
fail: () => {
|
||||
this.setData({
|
||||
form_submit_disabled_status: false
|
||||
form_submit_disabled_status: false,
|
||||
});
|
||||
uni.hideLoading();
|
||||
app.globalData.showToast('服务器请求出错');
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './recharge.css';
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@ -1,6 +0,0 @@
|
||||
/*
|
||||
* 导航
|
||||
*/
|
||||
.nav-base .item {
|
||||
width: 25%;
|
||||
}
|
||||
@ -1,242 +0,0 @@
|
||||
<template>
|
||||
<view>
|
||||
<!-- 导航 -->
|
||||
<view class="nav-base bg-white">
|
||||
<block v-for="(item, index) in nav_status_list" :key="index">
|
||||
<view :class="'item fl tc cr-grey ' + (nav_status_index == index ? 'cr-main' : '')" :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_time }}</text>
|
||||
<text class="fr cr-main">{{ item.status_name }}</text>
|
||||
</view>
|
||||
<view class="content margin-top">
|
||||
<navigator :url="'/pages/plugins/wallet/user-cash-detail/user-cash-detail?id=' + item.id" hover-class="none">
|
||||
<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>
|
||||
</navigator>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status"></component-no-data>
|
||||
</view>
|
||||
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</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_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: "全部", value: "-1" },
|
||||
{ name: "未打款", value: "0" },
|
||||
{ name: "已打款", value: "1" },
|
||||
{ name: "打款失败", value: "2" },
|
||||
],
|
||||
nav_status_index: 0,
|
||||
content_list: [
|
||||
{ name: "提现单号", field: "cash_no" },
|
||||
{ name: "提现金额", field: "money", unit: "元" },
|
||||
],
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
},
|
||||
props: {},
|
||||
|
||||
onLoad(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_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) {
|
||||
// 用户未绑定用户则转到登录页面
|
||||
if (app.globalData.user_is_need_login(user)) {
|
||||
uni.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_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
|
||||
uni.showLoading({
|
||||
title: "加载中...",
|
||||
});
|
||||
|
||||
// 参数
|
||||
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", "cash", "wallet"),
|
||||
method: "POST",
|
||||
data: {
|
||||
page: this.data_page,
|
||||
status: status,
|
||||
is_more: 1,
|
||||
},
|
||||
dataType: "json",
|
||||
success: (res) => {
|
||||
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: () => {
|
||||
uni.hideLoading();
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
app.globalData.showToast("服务器请求出错");
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 滚动加载
|
||||
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);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import "./user-cash.css";
|
||||
</style>
|
||||
@ -1,20 +0,0 @@
|
||||
/*
|
||||
* 导航
|
||||
*/
|
||||
.nav-base .item {
|
||||
width: 33.33%;
|
||||
}
|
||||
|
||||
/**
|
||||
* 支付方式
|
||||
*/
|
||||
.payment-list .item {
|
||||
width: 50%;
|
||||
}
|
||||
.payment-list .item-content {
|
||||
padding: 20rpx 10rpx;
|
||||
}
|
||||
.payment-list .item-content image {
|
||||
width: 50rpx;
|
||||
height: 50rpx !important;
|
||||
}
|
||||
@ -1,705 +0,0 @@
|
||||
<template>
|
||||
<view>
|
||||
<!-- 导航 -->
|
||||
<view class="nav-base bg-white">
|
||||
<block v-for="(item, index) in nav_status_list" :key="index">
|
||||
<view :class="'item fl tc cr-grey ' + (nav_status_index == index ? 'cr-main' : '')" :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_time }}</text>
|
||||
<text class="fr cr-main">{{ item.status_name }}</text>
|
||||
</view>
|
||||
<view class="content margin-top">
|
||||
<navigator :url="'/pages/plugins/wallet/user-recharge-detail/user-recharge-detail?id=' + item.id" hover-class="none">
|
||||
<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>
|
||||
</navigator>
|
||||
</view>
|
||||
<view v-if="item.status == 0" class="item-operation tr br-t padding-top-main margin-top-main">
|
||||
<button class="round bg-white cr-green br-green" type="default" size="mini" @tap="pay_event" :data-value="item.id" :data-index="index" hover-class="none">支付</button>
|
||||
<button 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">删除</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-popup :propShow="popup_view_pay_qrcode_is_show" propPosition="bottom" @onclose="popup_view_pay_qrcode_event_close">
|
||||
<view class="padding-top-xxxl padding-bottom-xxxl padding-left-xxxl padding-right-xxxl tc">
|
||||
<block v-if="(popup_view_pay_data || null) == null || (popup_view_pay_data.qrcode_url || null) == null || (popup_view_pay_data.name || null) == null || (popup_view_pay_data.check_url || null) == null || (popup_view_pay_data.order_no || null) == null">
|
||||
<text class="cr-grey">无支付信息</text>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="fw-b text-size cr-base margin-bottom-sm">{{ popup_view_pay_data.name }}</view>
|
||||
<image :src="popup_view_pay_data.qrcode_url" mode="aspectFit" class="dis-block auto max-w"></image>
|
||||
<view v-if="(popup_view_pay_data.msg || null) != null" class="cr-yellow margin-top-sm">{{ popup_view_pay_data.msg }}</view>
|
||||
<!-- #ifdef H5 -->
|
||||
<view v-if="popup_view_pay_data.pay_url != null" class="margin-top-xl">
|
||||
<a :href="popup_view_pay_data.pay_url" target="_blank" class="dis-inline-block cr-green">尝试点击去支付</a>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
</block>
|
||||
</view>
|
||||
</component-popup>
|
||||
|
||||
<!-- 支付方式 popup -->
|
||||
<component-popup :propShow="is_show_payment_popup" propPosition="bottom" @onclose="payment_popup_event_close">
|
||||
<view v-if="payment_list.length > 0" class="payment-list oh bg-base padding-main">
|
||||
<view class="padding-top-main padding-left-main">
|
||||
<view v-for="(item, index) in payment_list" :key="index" class="item tc fl">
|
||||
<view class="item-content bg-white border-radius-main margin-right-main margin-bottom-main" :data-value="item.id" @tap="popup_payment_event">
|
||||
<image v-if="(item.logo || null) != null" class="icon va-m margin-right-sm" :src="item.logo" mode="widthFix"></image>
|
||||
<text class="va-m">{{ item.name }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else class="padding-top-xxxl padding-bottom-xxxl oh bg-white tc cr-grey">没有支付方式</view>
|
||||
</component-popup>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import base64 from "../../../../common/js/lib/base64.js";
|
||||
import componentPopup from "../../../../components/popup/popup";
|
||||
import componentNoData from "../../../../components/no-data/no-data";
|
||||
import componentBottomLine from "../../../../components/bottom-line/bottom-line";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
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,
|
||||
load_status: 0,
|
||||
is_show_payment_popup: false,
|
||||
payment_list: [],
|
||||
payment_id: 0,
|
||||
temp_pay_value: 0,
|
||||
temp_pay_index: 0,
|
||||
nav_status_list: [
|
||||
{ name: "全部", value: "-1" },
|
||||
{ name: "待支付", value: "0" },
|
||||
{ name: "已支付", value: "1" },
|
||||
],
|
||||
nav_status_index: 0,
|
||||
content_list: [
|
||||
{ name: "充值单号", field: "recharge_no" },
|
||||
{ name: "充值金额", field: "money", unit: "元" },
|
||||
{ name: "支付金额", field: "pay_money", unit: "元" },
|
||||
],
|
||||
// 支付信息
|
||||
popup_view_pay_qrcode_is_show: false,
|
||||
popup_view_pay_data: null,
|
||||
popup_view_pay_timer: null,
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentPopup,
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
},
|
||||
props: {},
|
||||
|
||||
onLoad(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_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) {
|
||||
// 用户未绑定用户则转到登录页面
|
||||
if (app.globalData.user_is_need_login(user)) {
|
||||
uni.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_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
|
||||
uni.showLoading({
|
||||
title: "加载中...",
|
||||
});
|
||||
|
||||
// 参数
|
||||
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", "recharge", "wallet"),
|
||||
method: "POST",
|
||||
data: {
|
||||
page: this.data_page,
|
||||
status: order_status,
|
||||
is_more: 1,
|
||||
},
|
||||
dataType: "json",
|
||||
success: (res) => {
|
||||
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;
|
||||
// 下订单支付处理
|
||||
if (this.load_status == 0) {
|
||||
var ck = app.globalData.data.cache_page_pay_key;
|
||||
var pay_data = uni.getStorageSync(ck) || null;
|
||||
if (pay_data != null) {
|
||||
uni.removeStorageSync(ck);
|
||||
this.setData({ payment_id: parseInt(pay_data.payment_id || 0) });
|
||||
for (var i in temp_data_list) {
|
||||
if (pay_data.order_ids == temp_data_list[i]["id"]) {
|
||||
if (this.payment_id == 0) {
|
||||
this.setData({
|
||||
is_show_payment_popup: true,
|
||||
temp_pay_value: temp_data_list[i]["id"],
|
||||
temp_pay_index: i,
|
||||
});
|
||||
} else {
|
||||
this.pay_handle(pay_data.order_ids, i);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} 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 || [],
|
||||
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,
|
||||
load_status: 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,
|
||||
load_status: 1,
|
||||
data_list: [],
|
||||
data_bottom_line_status: false,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
load_status: 1,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
if (app.globalData.is_login_check(res.data, this, "get_data_list")) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
load_status: 1,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
app.globalData.showToast("服务器请求出错");
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 滚动加载
|
||||
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,
|
||||
});
|
||||
},
|
||||
|
||||
// 支付弹窗关闭
|
||||
payment_popup_event_close(e) {
|
||||
this.setData({
|
||||
is_show_payment_popup: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 支付弹窗发起支付
|
||||
popup_payment_event(e) {
|
||||
var payment_id = e.currentTarget.dataset.value || 0;
|
||||
this.setData({
|
||||
payment_id: payment_id,
|
||||
});
|
||||
this.payment_popup_event_close();
|
||||
this.pay_handle(this.temp_pay_value, this.temp_pay_index);
|
||||
},
|
||||
|
||||
// 支付方法
|
||||
pay_handle(recharge_id, index) {
|
||||
// #ifdef H5
|
||||
// 微信环境判断是否已有web_openid、不存在则不继续执行跳转到插件进行授权
|
||||
if (!app.globalData.is_user_weixin_web_openid(recharge_id, this.payment_id)) {
|
||||
return false;
|
||||
}
|
||||
// #endif
|
||||
|
||||
// 支付方式
|
||||
var payment = null;
|
||||
for (var i in this.payment_list) {
|
||||
if (this.payment_list[i]["id"] == this.payment_id) {
|
||||
payment = this.payment_list[i];
|
||||
}
|
||||
}
|
||||
if (payment == null) {
|
||||
app.globalData.showToast("支付方式有误");
|
||||
return false;
|
||||
}
|
||||
|
||||
// 请求数据
|
||||
var post_data = {
|
||||
recharge_id: recharge_id,
|
||||
payment_id: this.payment_id,
|
||||
};
|
||||
|
||||
// h5自定义重定向地址
|
||||
// #ifdef H5
|
||||
post_data["redirect_url"] = encodeURIComponent(base64.encode(app.globalData.get_page_url(false) + (this.nav_status_index > 0 ? "?status=" + this.nav_status_index : "")));
|
||||
// paypal支付方式使用respond_url返回地址、移除重定向地址
|
||||
if (payment.payment == "PayPal") {
|
||||
post_data["respond_url"] = post_data["redirect_url"];
|
||||
delete post_data["redirect_url"];
|
||||
}
|
||||
// #endif
|
||||
|
||||
// 请求支付接口
|
||||
uni.showLoading({
|
||||
title: "请求中...",
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("pay", "recharge", "wallet"),
|
||||
method: "POST",
|
||||
data: post_data,
|
||||
dataType: "json",
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
// #ifdef MP-WEIXIN || MP-ALIPAY || MP-BAIDU || MP-TOUTIAO
|
||||
this.common_pay_handle(this, data, index);
|
||||
// #endif
|
||||
// #ifdef MP-KUAISHOU
|
||||
this.kuaishou_pay_handle(this, data, index);
|
||||
// #endif
|
||||
// #ifdef MP-QQ
|
||||
this.qq_pay_handle(this, data, index);
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
this.h5_pay_handle(this, data, index);
|
||||
// #endif
|
||||
} else {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
app.globalData.showToast("服务器请求出错");
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 快手小程序
|
||||
kuaishou_pay_handle(self, data, index) {
|
||||
uni.pay({
|
||||
orderInfo: data.data,
|
||||
serviceId: "1",
|
||||
success: (res) => {
|
||||
// 数据设置
|
||||
self.order_item_pay_success_handle(index);
|
||||
|
||||
// 跳转支付页面
|
||||
uni.navigateTo({
|
||||
url: "/pages/paytips/paytips?code=9000",
|
||||
});
|
||||
},
|
||||
fail: (res) => {
|
||||
app.globalData.showToast("支付失败");
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 微信、支付宝、百度、头条、QQ
|
||||
common_pay_handle(self, data, index) {
|
||||
uni.requestPayment({
|
||||
// #ifdef MP-ALIPAY || MP-BAIDU || MP-TOUTIAO
|
||||
orderInfo: data.data,
|
||||
// #endif
|
||||
// #ifdef MP-QQ
|
||||
package: data.data,
|
||||
// #endif
|
||||
// #ifdef MP-WEIXIN
|
||||
timeStamp: data.data.timeStamp,
|
||||
nonceStr: data.data.nonceStr,
|
||||
package: data.data.package,
|
||||
signType: data.data.signType,
|
||||
paySign: data.data.paySign,
|
||||
// #endif
|
||||
// #ifdef MP-TOUTIAO
|
||||
service: 5,
|
||||
// #endif
|
||||
success: (res) => {
|
||||
// #ifdef MP-ALIPAY
|
||||
if (res.resultCode != 9000) {
|
||||
app.globalData.showToast(res.memo || "支付失败");
|
||||
return false;
|
||||
}
|
||||
// #endif
|
||||
// #ifdef MP-TOUTIAO
|
||||
if (res.code != 0) {
|
||||
app.globalData.showToast("支付失败");
|
||||
return false;
|
||||
}
|
||||
// #endif
|
||||
|
||||
// 数据设置
|
||||
self.order_item_pay_success_handle(index);
|
||||
|
||||
// 跳转支付页面
|
||||
uni.navigateTo({
|
||||
url: "/pages/paytips/paytips?code=9000",
|
||||
});
|
||||
},
|
||||
fail: (res) => {
|
||||
app.globalData.showToast("支付失败");
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// QQ支付处理
|
||||
qq_pay_handle(self, data, index) {
|
||||
// 是否微信支付
|
||||
if (data.payment.payment == "Weixin") {
|
||||
uni.requestWxPayment({
|
||||
url: data.data,
|
||||
referer: app.globalData.data.request_url,
|
||||
success: function (res) {
|
||||
app.globalData.alert({ msg: "支付成功后、请不要重复支付、如果订单状态未成功请联系客服处理", is_show_cancel: 0 });
|
||||
self.get_data_list();
|
||||
},
|
||||
fail: function (res) {
|
||||
app.globalData.showToast("支付失败");
|
||||
},
|
||||
});
|
||||
} else {
|
||||
self.common_pay_handle(self, data, index);
|
||||
}
|
||||
},
|
||||
|
||||
// h5支付处理
|
||||
h5_pay_handle(self, data, index) {
|
||||
// 字符串则为跳转地址直接进入
|
||||
if (typeof data.data == "string") {
|
||||
window.location.href = data.data;
|
||||
} else {
|
||||
var status = false;
|
||||
// 微信jsapi
|
||||
if (data.payment.payment == "Weixin" && (data.data.appId || null) != null && (data.data.timeStamp || null) != null && (data.data.nonceStr || null) != null && (data.data.package || null) != null && (data.data.signType || null) != null && (data.data.paySign || null) != null) {
|
||||
status = true;
|
||||
function onBridgeReady() {
|
||||
WeixinJSBridge.invoke(
|
||||
"getBrandWCPayRequest",
|
||||
{
|
||||
appId: data.data.appId,
|
||||
timeStamp: data.data.timeStamp,
|
||||
nonceStr: data.data.nonceStr,
|
||||
package: data.data.package,
|
||||
signType: data.data.signType,
|
||||
paySign: data.data.paySign,
|
||||
},
|
||||
function (res) {
|
||||
if (res.err_msg == "get_brand_wcpay_request:ok") {
|
||||
// 数据设置
|
||||
self.order_item_pay_success_handle(index);
|
||||
|
||||
// 跳转支付页面
|
||||
uni.navigateTo({
|
||||
url: "/pages/paytips/paytips?code=9000",
|
||||
});
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
if (typeof WeixinJSBridge == "undefined") {
|
||||
if (document.addEventListener) {
|
||||
document.addEventListener("WeixinJSBridgeReady", onBridgeReady, false);
|
||||
} else if (document.attachEvent) {
|
||||
document.attachEvent("WeixinJSBridgeReady", onBridgeReady);
|
||||
document.attachEvent("onWeixinJSBridgeReady", onBridgeReady);
|
||||
}
|
||||
} else {
|
||||
onBridgeReady();
|
||||
}
|
||||
}
|
||||
|
||||
// 二维码展示
|
||||
if ((data.data.qrcode_url || null) != null && (data.data.name || null) != null && (data.data.check_url || null) != null && (data.data.order_no || null) != null) {
|
||||
status = true;
|
||||
// 显示支付窗口
|
||||
this.setData({
|
||||
popup_view_pay_data: data.data,
|
||||
popup_view_pay_qrcode_is_show: true,
|
||||
});
|
||||
// 定时校验支付状态
|
||||
var timer = setInterval(function () {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("paycheck", "recharge", "wallet"),
|
||||
method: "POST",
|
||||
data: {
|
||||
order_no: self.popup_view_pay_data.order_no,
|
||||
},
|
||||
dataType: "json",
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
// 清除定时和支付数据
|
||||
clearInterval(self.popup_view_pay_timer);
|
||||
self.setData({
|
||||
popup_view_pay_data: null,
|
||||
popup_view_pay_qrcode_is_show: false,
|
||||
});
|
||||
|
||||
// 数据设置
|
||||
self.order_item_pay_success_handle(index);
|
||||
|
||||
// 跳转支付页面
|
||||
uni.navigateTo({
|
||||
url: "/pages/paytips/paytips?code=9000",
|
||||
});
|
||||
} else {
|
||||
// -300支付中、其它状态则提示错误
|
||||
if (res.data.code != -300) {
|
||||
clearInterval(self.popup_view_pay_timer);
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
clearInterval(self.popup_view_pay_timer);
|
||||
app.globalData.showToast("服务器请求出错");
|
||||
},
|
||||
});
|
||||
}, 3000);
|
||||
self.setData({
|
||||
popup_view_pay_timer: timer,
|
||||
});
|
||||
}
|
||||
|
||||
// 返回html表单
|
||||
if ((data.data.html || null) != null) {
|
||||
status = true;
|
||||
var div = document.createElement("paydivform");
|
||||
div.innerHTML = data.data.html;
|
||||
document.body.appendChild(div);
|
||||
var fm = document.forms;
|
||||
var fm_len = fm.length;
|
||||
if (fm_len > 0) {
|
||||
fm[fm_len - 1].submit();
|
||||
}
|
||||
}
|
||||
|
||||
// 未匹配到的支付处理方式
|
||||
if (!status) {
|
||||
app.globalData.showToast(data.payment.name + "支付方式还未适配");
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// 支付成功数据设置
|
||||
order_item_pay_success_handle(index) {
|
||||
// 数据设置
|
||||
var temp_data_list = this.data_list;
|
||||
temp_data_list[index]["pay_money"] = temp_data_list[index]["money"];
|
||||
temp_data_list[index]["status"] = 1;
|
||||
temp_data_list[index]["status_name"] = "已支付";
|
||||
this.setData({
|
||||
data_list: temp_data_list,
|
||||
});
|
||||
},
|
||||
|
||||
// 删除
|
||||
delete_event(e) {
|
||||
uni.showModal({
|
||||
title: "温馨提示",
|
||||
content: "删除后不可恢复,确定继续吗?",
|
||||
confirmText: "确认",
|
||||
cancelText: "不了",
|
||||
success: (result) => {
|
||||
if (result.confirm) {
|
||||
// 参数
|
||||
var id = e.currentTarget.dataset.value;
|
||||
var index = e.currentTarget.dataset.index;
|
||||
|
||||
// 加载loding
|
||||
uni.showLoading({
|
||||
title: "处理中...",
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("delete", "recharge", "wallet"),
|
||||
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("服务器请求出错");
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 导航事件
|
||||
nav_event(e) {
|
||||
this.setData({
|
||||
nav_status_index: e.currentTarget.dataset.index || 0,
|
||||
data_page: 1,
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// 支付二维码展示窗口事件
|
||||
popup_view_pay_qrcode_event_close(e) {
|
||||
this.setData({
|
||||
popup_view_pay_qrcode_is_show: false,
|
||||
});
|
||||
clearInterval(this.popup_view_pay_timer);
|
||||
},
|
||||
|
||||
// 页面卸载
|
||||
onUnload(e) {
|
||||
clearInterval(this.popup_view_pay_timer);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import "./user-recharge.css";
|
||||
</style>
|
||||
@ -1,28 +1,69 @@
|
||||
/*
|
||||
* 基础
|
||||
*/
|
||||
.submit-container {
|
||||
right: 20rpx;
|
||||
bottom: 20rpx;
|
||||
.wallet-bg {
|
||||
/* #ifdef H5 || APP */
|
||||
top: -80rpx !important;
|
||||
/* #endif */
|
||||
}
|
||||
|
||||
.scroll-wallet {
|
||||
height: calc(100vh - 172rpx);
|
||||
}
|
||||
|
||||
.wallet-head .content {
|
||||
border-radius: 24rpx;
|
||||
padding: 24rpx;
|
||||
}
|
||||
|
||||
.content-padding-1 {
|
||||
padding: 2rpx;
|
||||
left: -4rpx;
|
||||
right: -4rpx;
|
||||
top: -4rpx;
|
||||
}
|
||||
|
||||
.filter-blur {
|
||||
backdrop-filter: blur(40rpx);
|
||||
}
|
||||
|
||||
.filter-blur-child {
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
filter: blur(0rpx);
|
||||
}
|
||||
|
||||
.effective {
|
||||
font-size: 72rpx;
|
||||
}
|
||||
|
||||
.freeze,
|
||||
.give {
|
||||
font-size: 42rpx;
|
||||
text-shadow: 0px 1px 4px rgba(234, 44, 44, 0.46);
|
||||
}
|
||||
|
||||
/*
|
||||
* 导航
|
||||
*/
|
||||
.nav .item {
|
||||
width: calc(50% - 70rpx);
|
||||
margin-bottom: 20rpx;
|
||||
.nav .active {
|
||||
width: 64px;
|
||||
height: 4px;
|
||||
bottom: 0;
|
||||
}
|
||||
.nav .item:nth-child(2n) {
|
||||
margin-right: 20rpx;
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
.nav .item:nth-child(2n+1) {
|
||||
margin-left: 20rpx;
|
||||
margin-right: 10rpx;
|
||||
/*
|
||||
* 底部按钮
|
||||
*/
|
||||
.submit-container {
|
||||
padding: 42rpx 46rpx;
|
||||
z-index: 0;
|
||||
}
|
||||
.nav .item image {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
margin: 0 auto;
|
||||
|
||||
.submit-container .sub-btn {
|
||||
width: calc(50% - 20rpx);
|
||||
}
|
||||
|
||||
.submit-container button {
|
||||
height: 88rpx;
|
||||
line-height: 88rpx;
|
||||
}
|
||||
@ -1,166 +1,245 @@
|
||||
<template>
|
||||
<view>
|
||||
<view v-if="(data_base || null) != null">
|
||||
<!-- 钱包信息 -->
|
||||
<view class="padding-main">
|
||||
<view class="padding-main border-radius-main bg-white pr">
|
||||
<view class="item oh">
|
||||
<view class="fl cr-base">有效</view>
|
||||
<view class="fl cr-main fw-b single-text margin-left-sm margin-right-sm">{{ user_wallet.normal_money || "0.00" }}</view>
|
||||
<view class="fl cr-grey unit">元</view>
|
||||
<scroll-view :scroll-y="true" class="scroll-box scroll-wallet" @scrolltolower="scroll_lower" lower-threshold="60">
|
||||
<view v-if="(data_base || null) != null" :style="'padding-top:' + (status_bar_height > 0 ? status_bar_height + 5 : 10) + 'px;'">
|
||||
<!-- 头部背景 -->
|
||||
<image :src="wallet_static_url + 'title-bg.png'" mode="widthFix" class="wh-auto pa top-0 left-0 right-0 wallet-bg" />
|
||||
<view class="pr z-i">
|
||||
<!-- 返回 -->
|
||||
<!-- #ifdef MP-WEIXIN || MP-QQ || MP-KUAISHOU || H5 || APP -->
|
||||
<view v-if="is_realstore_top_nav_back == 1" class="nav-back padding-horizontal-main round va-m pr top-sm cr-white" @tap="top_nav_left_back_event">
|
||||
<iconfont name="icon-tongyong-fanhui" size="32rpx"></iconfont>
|
||||
</view>
|
||||
<view class="item oh margin-top-sm">
|
||||
<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-grey unit">元</view>
|
||||
<!-- #endif -->
|
||||
|
||||
<!-- 钱包信息 -->
|
||||
<view class="padding-top-xxxl oh margin-top-main">
|
||||
<view class="wallet-head padding-horizontal-xxxl">
|
||||
<!-- 用户中心公告 -->
|
||||
<view v-if="(data_base.user_center_notice || null) != null && data_base.user_center_notice.length > 0">
|
||||
<uni-notice-bar class="padding-0" show-icon scrollable :text="data_base.user_center_notice.join('')" background-color="transparent" color="#fff" />
|
||||
</view>
|
||||
<view class="content oh cr-white pr filter-blur">
|
||||
<view class="pa content-padding-1 oh filter-blur-child">
|
||||
<image :src="wallet_static_url + 'wallet-bg.png'" mode="widthFix" class="wh-auto" />
|
||||
</view>
|
||||
<view class="pr z-i flex-row jc-c">
|
||||
<view class="flex-1 flex-width">
|
||||
<view>有效(元)</view>
|
||||
<text class="fw-b effective">{{ is_price_show ? user_wallet.normal_money || '0.00' : '***' }}</text>
|
||||
<view class="flex-row jc-sb align-c margin-top-main">
|
||||
<view class="flex-1">
|
||||
<view class="tetx-size-xs">冻结(元)</view>
|
||||
<text class="freeze">{{ is_price_show ? user_wallet.frozen_money || '0.00' : '***' }}</text>
|
||||
</view>
|
||||
<view class="flex-1">
|
||||
<view class="tetx-size-xs">赠送(元)</view>
|
||||
<text class="give">{{ is_price_show ? user_wallet.give_money || '0.00' : '***' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="is-price-show">
|
||||
<iconfont :name="is_price_show ? 'icon-wodeqianbao-eye' : 'icon-wodeqianbao-eyeclo2'" size="44rpx" @tap="price_change"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item oh margin-top-sm">
|
||||
<view class="fl cr-base">赠送</view>
|
||||
<view class="fl cr-base fw-b single-text margin-left-sm margin-right-sm">{{ user_wallet.give_money || "0.00" }}</view>
|
||||
<view class="fl cr-grey unit">元</view>
|
||||
</view>
|
||||
<view class="submit-container pa oh">
|
||||
<navigator v-if="(data_base || null) != null && (data_base.is_enable_recharge || 0) == 1" class="dis-inline" url="/pages/plugins/wallet/recharge/recharge" hover-class="none">
|
||||
<button class="round cr-white bg-green br-green text-size-sm fl" size="mini" type="default" hover-class="none">充值</button>
|
||||
</navigator>
|
||||
<navigator v-if="(data_base || null) != null && (data_base.is_enable_cash || 0) == 1" class="dis-inline" url="/pages/plugins/wallet/cash-auth/cash-auth" hover-class="none">
|
||||
<button class="round cr-white bg-main br-main text-size-sm fl margin-left-lg" size="mini" type="default" hover-class="none">提现</button>
|
||||
</navigator>
|
||||
<view class="padding-main padding-top-xxxl">
|
||||
<!-- 导航 -->
|
||||
<view v-if="nav_list.length > 0" class="nav oh margin-bottom-xl">
|
||||
<view class="flex-row jc-sb align-c">
|
||||
<block v-for="(item, index) in nav_list" :key="index">
|
||||
<view class="text-size fw-b" :data-index="index" @tap="nav_change">
|
||||
<view class="pr dis-inline-block">
|
||||
{{ item.title }}
|
||||
<view v-if="current === index" class="pa active" :style="'background: linear-gradient(90deg, ' + theme_color + ' 0%, rgba(255, 255, 255, 0.27) 100%)'"></view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 明细 -->
|
||||
<view class="nav-detail margin-bottom-lg">
|
||||
<view v-if="current === 0">
|
||||
<component-wallet-log :prop-pull-down-refresh="propPullDownRefresh" :prop-scroll-lower="scroll_lower_bool"></component-wallet-log>
|
||||
</view>
|
||||
<view v-if="current === 1">
|
||||
<component-user-recharge :prop-pull-down-refresh="propPullDownRefresh" :prop-scroll-lower="scroll_lower_bool"></component-user-recharge>
|
||||
</view>
|
||||
<view v-if="current === 2">
|
||||
<component-user-cash :prop-pull-down-refresh="propPullDownRefresh" :prop-scroll-lower="scroll_lower_bool"></component-user-cash>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 导航 -->
|
||||
<view v-if="nav_list.length > 0" class="nav oh">
|
||||
<block v-for="(item, index) in nav_list" :key="index">
|
||||
<view class="item fl tc padding-main border-radius-main bg-white">
|
||||
<navigator :url="item.url" hover-class="none">
|
||||
<image :src="item.icon" mode="scaleToFill" class="dis-block"></image>
|
||||
<view class="tc cr-base margin-top-lg">{{ item.title }}</view>
|
||||
</navigator>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
|
||||
<!-- 通知 -->
|
||||
<view v-if="(data_base.user_center_notice || null) != null && data_base.user_center_notice.length > 0" class="padding-horizontal-main padding-bottom-main">
|
||||
<view class="notice-content">
|
||||
<view v-for="(item, index) in data_base.user_center_notice" :key="index" class="item">{{ item }}</view>
|
||||
<view class="bottom-fixed bg-white submit-container flex-row jc-sb align-c">
|
||||
<navigator v-if="(data_base || null) != null && (data_base.is_enable_recharge || 0) == 1" url="/pages/plugins/wallet/recharge/recharge" hover-class="none" class="sub-btn">
|
||||
<button class="round cr-white bg-main br-main text-size wh-auto" type="default" hover-class="none">充值</button>
|
||||
</navigator>
|
||||
<navigator v-if="(data_base || null) != null && (data_base.is_enable_cash || 0) == 1" url="/pages/plugins/wallet/cash-auth/cash-auth" hover-class="none" class="sub-btn">
|
||||
<button class="round cr-main bg-white br-main text-size wh-auto" type="default" hover-class="none">提现</button>
|
||||
</navigator>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentNoData from "../../../../components/no-data/no-data";
|
||||
const app = getApp();
|
||||
import componentNoData from '@/components/no-data/no-data';
|
||||
import componentBottomLine from '@/components/bottom-line/bottom-line';
|
||||
import componentWalletLog from '@/components/wallet/wallet-log/wallet-log';
|
||||
import componentUserRecharge from '@/components/wallet/user-recharge/user-recharge';
|
||||
import componentUserCash from '@/components/wallet/user-cash/user-cash';
|
||||
var wallet_static_url = app.globalData.get_static_url('wallet', true) + 'app/';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: "",
|
||||
data_base: null,
|
||||
user_wallet: null,
|
||||
nav_list: [],
|
||||
submit_disabled_status: false,
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentNoData,
|
||||
},
|
||||
props: {},
|
||||
|
||||
onLoad(params) {},
|
||||
|
||||
onShow() {
|
||||
this.init();
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle();
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.get_data();
|
||||
},
|
||||
|
||||
methods: {
|
||||
init(e) {
|
||||
var user = app.globalData.get_user_info(this, "init");
|
||||
if (user != false) {
|
||||
// 用户未绑定用户则转到登录页面
|
||||
if (app.globalData.user_is_need_login(user)) {
|
||||
uni.showModal({
|
||||
title: "温馨提示",
|
||||
content: "绑定手机号码",
|
||||
confirmText: "确认",
|
||||
cancelText: "暂不",
|
||||
success: (result) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (result.confirm) {
|
||||
uni.navigateTo({
|
||||
url: "/pages/login/login?event_callback=init",
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
} else {
|
||||
this.get_data();
|
||||
}
|
||||
}
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
wallet_static_url: wallet_static_url,
|
||||
status_bar_height: parseInt(app.globalData.get_system_info('statusBarHeight', 0)),
|
||||
// 顶部导航返回按钮
|
||||
is_realstore_top_nav_back: app.globalData.data.is_realstore_top_nav_back || 0,
|
||||
theme_color: app.globalData.get_theme_color(),
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
data_base: null,
|
||||
user_wallet: null,
|
||||
nav_list: [],
|
||||
submit_disabled_status: false,
|
||||
// 是否显示价格
|
||||
is_price_show: false,
|
||||
// 账户明细
|
||||
current: 0,
|
||||
propPullDownRefresh: false,
|
||||
scroll_lower_bool: false,
|
||||
};
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("index", "user", "wallet"),
|
||||
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_wallet: data.user_wallet || null,
|
||||
nav_list: data.nav_list || [],
|
||||
data_list_loding_msg: "",
|
||||
data_list_loding_status: 0,
|
||||
data_bottom_line_status: false,
|
||||
components: {
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
componentWalletLog,
|
||||
componentUserRecharge,
|
||||
componentUserCash,
|
||||
},
|
||||
props: {},
|
||||
|
||||
onLoad(params) {
|
||||
// 是否指定状态
|
||||
if ((params.status || null) != null) {
|
||||
this.setData({
|
||||
params: params,
|
||||
current: Number(params.status),
|
||||
});
|
||||
}
|
||||
this.init();
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle();
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.get_data();
|
||||
this.setData({
|
||||
propPullDownRefresh: !this.propPullDownRefresh,
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
init(e) {
|
||||
var user = app.globalData.get_user_info(this, 'init');
|
||||
if (user != false) {
|
||||
// 用户未绑定用户则转到登录页面
|
||||
if (app.globalData.user_is_need_login(user)) {
|
||||
uni.showModal({
|
||||
title: '温馨提示',
|
||||
content: '绑定手机号码',
|
||||
confirmText: '确认',
|
||||
cancelText: '暂不',
|
||||
success: (result) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (result.confirm) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/login/login?event_callback=init',
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
} else {
|
||||
this.get_data();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('index', 'user', 'wallet'),
|
||||
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_wallet: data.user_wallet || null,
|
||||
nav_list: data.nav_list || [],
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: 0,
|
||||
data_bottom_line_status: false,
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
if (app.globalData.is_login_check(res.data, this, 'get_data')) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
data_list_loding_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: "服务器请求出错",
|
||||
});
|
||||
app.globalData.showToast("服务器请求出错");
|
||||
},
|
||||
});
|
||||
app.globalData.showToast('服务器请求出错');
|
||||
},
|
||||
});
|
||||
},
|
||||
price_change() {
|
||||
this.setData({
|
||||
is_price_show: !this.is_price_show,
|
||||
});
|
||||
},
|
||||
// 明细导航切换
|
||||
nav_change(e) {
|
||||
this.setData({
|
||||
current: e.currentTarget.dataset.index || 0,
|
||||
});
|
||||
},
|
||||
// 滚动加载
|
||||
scroll_lower(e) {
|
||||
this.setData({
|
||||
scroll_lower_bool: !this.scroll_lower_bool,
|
||||
});
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import "./user.css";
|
||||
@import './user.css';
|
||||
</style>
|
||||
|
||||
@ -1,6 +0,0 @@
|
||||
/*
|
||||
* 导航
|
||||
*/
|
||||
.nav-base .item {
|
||||
width: 33.33%;
|
||||
}
|
||||
@ -1,244 +0,0 @@
|
||||
<template>
|
||||
<view>
|
||||
<!-- 导航 -->
|
||||
<view class="nav-base bg-white">
|
||||
<block v-for="(item, index) in nav_status_list" :key="index">
|
||||
<view :class="'item fl tc cr-grey ' + (nav_status_index == index ? 'cr-main' : '')" :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_time }}</text>
|
||||
<text class="fr cr-main">{{ item.status_name }}</text>
|
||||
</view>
|
||||
<view class="content margin-top">
|
||||
<navigator :url="'/pages/plugins/wallet/wallet-log-detail/wallet-log-detail?id=' + item.id" hover-class="none">
|
||||
<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>
|
||||
</navigator>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status"></component-no-data>
|
||||
</view>
|
||||
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</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_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: "全部", value: "-1" },
|
||||
{ name: "减少", value: "0" },
|
||||
{ name: "增加", value: "1" },
|
||||
],
|
||||
nav_status_index: 0,
|
||||
content_list: [
|
||||
{ name: "业务类型", field: "business_type_name" },
|
||||
{ name: "金额类型", field: "money_type_name" },
|
||||
{ name: "操作金额", field: "operation_money", unit: "元" },
|
||||
{ name: "原始金额", field: "original_money", unit: "元" },
|
||||
{ name: "最新金额", field: "latest_money", unit: "元" },
|
||||
],
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
},
|
||||
props: {},
|
||||
|
||||
onLoad(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_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) {
|
||||
// 用户未绑定用户则转到登录页面
|
||||
if (app.globalData.user_is_need_login(user)) {
|
||||
uni.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_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
|
||||
uni.showLoading({
|
||||
title: "加载中...",
|
||||
});
|
||||
|
||||
// 参数
|
||||
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", "walletlog", "wallet"),
|
||||
method: "POST",
|
||||
data: {
|
||||
page: this.data_page,
|
||||
operation_type: status,
|
||||
is_more: 1,
|
||||
},
|
||||
dataType: "json",
|
||||
success: (res) => {
|
||||
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: () => {
|
||||
uni.hideLoading();
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
app.globalData.showToast("服务器请求出错");
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 滚动加载
|
||||
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);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import "./wallet-log.css";
|
||||
</style>
|
||||
Reference in New Issue
Block a user