mirror of
https://gitee.com/zongzhige/shopxo-uniapp.git
synced 2026-06-06 02:38:52 +08:00
充值卡
This commit is contained in:
14
lang/en.json
14
lang/en.json
@ -203,7 +203,9 @@
|
||||
"plugins-coin-cash-list": "Withdrawal details",
|
||||
"plugins-coin-convert-list": "Conversion details",
|
||||
"plugins-coin-recharge-list": "Recharge details",
|
||||
"plugins-antifakecode-index": "Authentic inquiry"
|
||||
"plugins-antifakecode-index": "Authentic inquiry",
|
||||
"plugins-rechargecard-index": "My recharge card",
|
||||
"plugins-rechargecard-form": "Recharge card redemption"
|
||||
},
|
||||
"login": {
|
||||
"login": {
|
||||
@ -1849,5 +1851,13 @@
|
||||
"yyjemb": "Anonymous or not",
|
||||
"0nhrj0": "Comment content"
|
||||
}
|
||||
}
|
||||
},
|
||||
"rechargecard-index": {
|
||||
"rechargecard-index": {
|
||||
"hfg2fg": "Cami",
|
||||
"8uhyui": "Recharge time",
|
||||
"8tfgh2": "Recharge card redemption",
|
||||
"fu3rf1": "Please enter the card password"
|
||||
}
|
||||
}
|
||||
}
|
||||
14
lang/zh.json
14
lang/zh.json
@ -202,7 +202,9 @@
|
||||
"plugins-coin-convert-list": "转换明细",
|
||||
"plugins-coin-recharge-list": "充值明细",
|
||||
"plugins-coin-collection": "收款",
|
||||
"plugins-antifakecode-index": "正品查询"
|
||||
"plugins-antifakecode-index": "正品查询",
|
||||
"plugins-rechargecard-index": "我的充值卡",
|
||||
"plugins-rechargecard-form": "充值卡兑换"
|
||||
},
|
||||
"login": {
|
||||
"login": {
|
||||
@ -1834,5 +1836,13 @@
|
||||
"yyjemb": "是否匿名",
|
||||
"0nhrj0": "评论内容"
|
||||
}
|
||||
}
|
||||
},
|
||||
"rechargecard-index": {
|
||||
"rechargecard-index": {
|
||||
"hfg2fg": "卡密",
|
||||
"8uhyui": "充值时间",
|
||||
"8tfgh2": "充值卡兑换",
|
||||
"fu3rf1": "请输入卡密"
|
||||
}
|
||||
}
|
||||
}
|
||||
19
pages.json
19
pages.json
@ -1576,6 +1576,25 @@
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"root": "pages/plugins/rechargecard",
|
||||
"pages": [
|
||||
{
|
||||
"path": "index/index",
|
||||
"style": {
|
||||
"enablePullDownRefresh": true,
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "form/form",
|
||||
"style": {
|
||||
"enablePullDownRefresh": false,
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"preloadRule": {
|
||||
|
||||
@ -12,12 +12,4 @@
|
||||
padding: 0 48rpx;
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
}
|
||||
|
||||
/*
|
||||
* 底部按钮
|
||||
*/
|
||||
.submit-container button {
|
||||
height: 88rpx;
|
||||
line-height: 88rpx;
|
||||
}
|
||||
117
pages/plugins/rechargecard/form/form.vue
Normal file
117
pages/plugins/rechargecard/form/form.vue
Normal file
@ -0,0 +1,117 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view class="padding-main">
|
||||
<block v-if="data_list_loding_status == 3">
|
||||
<form @submit="form_submit" class="form-container">
|
||||
<view class="border-radius-main bg-white padding-main padding-bottom-xxxxl spacing-mb">
|
||||
<view class="title fw-b text-size margin-bottom-xxxl padding-bottom-xl">{{$t('rechargecard-index.rechargecard-index.hfg2fg')}}</view>
|
||||
<input name="secret_key" type="text" class="text-size-xl tc margin-bottom-sm" :placeholder="$t('rechargecard-index.rechargecard-index.fu3rf1')" placeholder-class="cr-grey-c" />
|
||||
</view>
|
||||
<view class="padding-main">
|
||||
<button type="default" form-type="submit" hover-class="none" size="mini" class="br-main bg-main cr-white round buy-submit text-size dis-block" :disabled="form_submit_loading">{{$t('common.confirm')}}</button>
|
||||
</view>
|
||||
</form>
|
||||
</block>
|
||||
<block v-else>
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentNoData from '@/components/no-data/no-data';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
form_submit_loading: false
|
||||
};
|
||||
},
|
||||
components: {
|
||||
componentNoData,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 加载数据
|
||||
this.init();
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
},
|
||||
|
||||
methods: {
|
||||
init() {
|
||||
var user = app.globalData.get_user_info(this, 'init');
|
||||
if (user == false) {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_list_loding_msg: this.$t('setup.setup.nwt4o1'),
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 3,
|
||||
data_list_loding_msg: '',
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 转账表单提交
|
||||
form_submit(e) {
|
||||
var validation = [
|
||||
{ fields: 'secret_key', msg: this.$t('rechargecard-index.rechargecard-index.fu3rf1') }
|
||||
];
|
||||
if (app.globalData.fields_check(e.detail.value, validation)) {
|
||||
uni.showLoading({
|
||||
title: this.$t('common.processing_in_text'),
|
||||
});
|
||||
this.setData({
|
||||
form_submit_loading: true
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('exchange', 'index', 'rechargecard'),
|
||||
method: 'POST',
|
||||
data: e.detail.value,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
app.globalData.showToast(res.data.msg, 'success');
|
||||
var self = this;
|
||||
setTimeout(function() {
|
||||
self.setData({
|
||||
form_submit_loading: false
|
||||
});
|
||||
uni.navigateBack();
|
||||
}, 1500);
|
||||
} else {
|
||||
if (app.globalData.is_login_check(res.data, this, 'form_submit', e)) {
|
||||
this.setData({
|
||||
form_submit_loading: false
|
||||
});
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
this.setData({
|
||||
form_submit_loading: false
|
||||
});
|
||||
uni.hideLoading();
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
216
pages/plugins/rechargecard/index/index.vue
Normal file
216
pages/plugins/rechargecard/index/index.vue
Normal file
@ -0,0 +1,216 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<scroll-view :scroll-y="true" class="scroll-box" @scrolltolower="scroll_lower" lower-threshold="60">
|
||||
<view class="page-bottom-fixed">
|
||||
<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="content margin-top-main">
|
||||
<view v-for="(fv, fi) in content_list" :key="fi">
|
||||
<view class="single-text margin-top-xs">
|
||||
<text class="cr-grey-9 margin-right-main">{{ fv.name }}:</text>
|
||||
<text class="cr-black">{{ item[fv.field] }}</text>
|
||||
<text v-if="(fv.unit || null) != null" class="cr-grey">{{ fv.unit }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status"></component-no-data>
|
||||
</view>
|
||||
|
||||
<!-- 兑换卡密 -->
|
||||
<view class="bottom-fixed">
|
||||
<view class="bottom-line-exclude">
|
||||
<button data-value="/pages/plugins/rechargecard/form/form" @tap="url_event" class="round cr-main bg-white br-main text-size wh-auto sub-btn" type="default" hover-class="none">{{$t('rechargecard-index.rechargecard-index.8tfgh2')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</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 {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
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,
|
||||
content_list: [
|
||||
{ name: this.$t('rechargecard-index.rechargecard-index.hfg2fg'), field: 'secret_key' },
|
||||
{ name: this.$t('recharge.recharge.qbw1x2'), field: 'money' },
|
||||
{ name: this.$t('rechargecard-index.rechargecard-index.8uhyui'), field: 'recharge_time' },
|
||||
{ name: this.$t('profit-detail.profit-detail.b7v892'), field: 'add_time' },
|
||||
{ name: this.$t('order-detail.order-detail.21ift9'), field: 'upd_time' },
|
||||
],
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
},
|
||||
props: {},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 参数
|
||||
this.setData({
|
||||
params: params
|
||||
});
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle();
|
||||
|
||||
// 初始化配置
|
||||
this.init();
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.setData({
|
||||
data_page: 1,
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 初始化
|
||||
init(e) {
|
||||
var user = app.globalData.get_user_info(this, 'init');
|
||||
if (user != false) {
|
||||
this.setData({
|
||||
data_page: 1,
|
||||
});
|
||||
this.get_data_list(1);
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data_list(is_mandatory) {
|
||||
// 分页是否还有数据
|
||||
if ((is_mandatory || 0) == 0) {
|
||||
if (this.data_bottom_line_status == true) {
|
||||
uni.stopPullDownRefresh();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// 是否加载中
|
||||
if (this.data_is_loading == 1) {
|
||||
return false;
|
||||
}
|
||||
this.setData({
|
||||
data_is_loading: 1,
|
||||
data_list_loding_status: 1,
|
||||
});
|
||||
|
||||
// 加载loding
|
||||
if(this.data_page > 1) {
|
||||
uni.showLoading({
|
||||
title: this.$t('common.loading_in_text'),
|
||||
});
|
||||
}
|
||||
|
||||
// 获取数据
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('index', 'index', 'rechargecard'),
|
||||
method: 'POST',
|
||||
data: {page: this.data_page},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
if(this.data_page > 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
if (res.data.data.data_list.length > 0) {
|
||||
if (this.data_page <= 1) {
|
||||
var temp_data_list = res.data.data.data_list;
|
||||
} else {
|
||||
var temp_data_list = this.data_list || [];
|
||||
var temp_data = res.data.data.data_list;
|
||||
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_bottom_line_status: false,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
if (app.globalData.is_login_check(res.data, this, 'get_data_list')) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
if(this.data_page > 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 滚动加载
|
||||
scroll_lower(e) {
|
||||
this.get_data_list();
|
||||
},
|
||||
|
||||
// url事件
|
||||
url_event(e) {
|
||||
app.globalData.url_event(e);
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
@ -1,4 +1,3 @@
|
||||
<!-- 转账支付页 -->
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view class="padding-main">
|
||||
@ -183,7 +182,7 @@
|
||||
if (res.data.code == 0) {
|
||||
app.globalData.url_open('/pages/plugins/wallet/user/user?type=3', true);
|
||||
} else {
|
||||
if (app.globalData.is_login_check(res.data, this, 'form_submit')) {
|
||||
if (app.globalData.is_login_check(res.data, this, 'form_submit', e)) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user