mirror of
https://gitee.com/zongzhige/shopxo-uniapp.git
synced 2026-06-06 02:38:52 +08:00
1.我的签到
This commit is contained in:
13
App.vue
13
App.vue
@ -1825,6 +1825,19 @@
|
||||
}
|
||||
});
|
||||
},
|
||||
// 更新url参数
|
||||
updateQueryStringParameter(uri, key, value) {
|
||||
if (!value) {
|
||||
return uri;
|
||||
}
|
||||
var re = new RegExp('([?&])' + key + '=.*?(&|$)', 'i');
|
||||
var separator = uri.indexOf('?') !== -1 ? '&' : '?';
|
||||
if (uri.match(re)) {
|
||||
return uri.replace(re, '$1' + key + '=' + value + '$2');
|
||||
} else {
|
||||
return uri + separator + key + '=' + value;
|
||||
}
|
||||
},
|
||||
},
|
||||
// 初始化完成时触发(全局只触发一次)
|
||||
onLaunch(params) {},
|
||||
|
||||
@ -1538,6 +1538,7 @@ button[disabled].bg-grey {
|
||||
/**
|
||||
* 通知
|
||||
*/
|
||||
.uni-noticebar.margin-0 {
|
||||
.uni-noticebar {
|
||||
padding: 0 !important;
|
||||
margin: 0 !important;
|
||||
}
|
||||
@ -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_4zljgwpfojt.css');
|
||||
@import url('@/static/icon/iconfont.css');
|
||||
/* @import url('https://at.alicdn.com/t/c/font_4227145_4zljgwpfojt.css'); */
|
||||
|
||||
.iconfont {
|
||||
display: inline-block;
|
||||
|
||||
@ -41,155 +41,154 @@
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
var common_static_url = app.globalData.get_static_url("common");
|
||||
import componentPopup from "../../components/popup/popup";
|
||||
import componentUserBase from "../../components/user-base/user-base";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
common_static_url: common_static_url,
|
||||
popup_status: false,
|
||||
is_goods_poster: 0,
|
||||
goods_id: 0,
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentPopup,
|
||||
componentUserBase,
|
||||
},
|
||||
|
||||
created: function () {},
|
||||
|
||||
methods: {
|
||||
// 初始配置
|
||||
init(config = {}) {
|
||||
if (!app.globalData.is_single_page_check()) {
|
||||
return false;
|
||||
}
|
||||
this.setData({
|
||||
popup_status: config.status == undefined ? true : config.status,
|
||||
is_goods_poster: config.is_goods_poster || 0,
|
||||
goods_id: config.goods_id || 0,
|
||||
});
|
||||
|
||||
// 用户头像和昵称设置提示
|
||||
if ((this.$refs.user_base || null) != null) {
|
||||
this.$refs.user_base.init("share");
|
||||
}
|
||||
},
|
||||
|
||||
// 弹层关闭
|
||||
popup_close_event(e) {
|
||||
this.setData({
|
||||
const app = getApp();
|
||||
var common_static_url = app.globalData.get_static_url('common');
|
||||
import componentPopup from '../../components/popup/popup';
|
||||
import componentUserBase from '../../components/user-base/user-base';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
common_static_url: common_static_url,
|
||||
popup_status: false,
|
||||
});
|
||||
is_goods_poster: 0,
|
||||
goods_id: 0,
|
||||
};
|
||||
},
|
||||
|
||||
// h5分享
|
||||
share_h5_event() {
|
||||
app.globalData.text_copy_event(app.globalData.get_page_url());
|
||||
components: {
|
||||
componentPopup,
|
||||
componentUserBase,
|
||||
},
|
||||
|
||||
// 基础分享事件
|
||||
share_base_event() {
|
||||
this.setData({
|
||||
popup_status: false,
|
||||
});
|
||||
uni.pageScrollTo({
|
||||
scrollTop: 0,
|
||||
duration: 300,
|
||||
complete: (res) => {
|
||||
setTimeout(function () {
|
||||
uni.showShareMenu();
|
||||
}, 500);
|
||||
},
|
||||
});
|
||||
},
|
||||
created: function () {},
|
||||
|
||||
// 商品海报分享
|
||||
poster_event() {
|
||||
var user = app.globalData.get_user_info(this, "poster_event");
|
||||
if (user != false) {
|
||||
// 用户未绑定用户则转到登录页面
|
||||
if (app.globalData.user_is_need_login(user)) {
|
||||
uni.navigateTo({
|
||||
url: "/pages/login/login?event_callback=poster_event",
|
||||
});
|
||||
methods: {
|
||||
// 初始配置
|
||||
init(config = {}) {
|
||||
if (!app.globalData.is_single_page_check()) {
|
||||
return false;
|
||||
} else {
|
||||
uni.showLoading({
|
||||
title: "生成中...",
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("goodsposter", "distribution", "distribution"),
|
||||
method: "POST",
|
||||
data: { goods_id: this.goods_id },
|
||||
dataType: "json",
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
|
||||
if (res.data.code == 0) {
|
||||
uni.previewImage({
|
||||
current: res.data.data,
|
||||
urls: [res.data.data],
|
||||
});
|
||||
} else {
|
||||
if (app.globalData.is_login_check(res.data, this, "poster_event")) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
app.globalData.showToast("服务器请求出错");
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
this.setData({
|
||||
popup_status: config.status == undefined ? true : config.status,
|
||||
is_goods_poster: config.is_goods_poster || 0,
|
||||
goods_id: config.goods_id || 0,
|
||||
});
|
||||
|
||||
// 用户头像和昵称设置提示
|
||||
if ((this.$refs.user_base || null) != null) {
|
||||
this.$refs.user_base.init('share');
|
||||
}
|
||||
},
|
||||
|
||||
// 弹层关闭
|
||||
popup_close_event(e) {
|
||||
this.setData({
|
||||
popup_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// h5分享
|
||||
share_h5_event() {
|
||||
app.globalData.text_copy_event(app.globalData.get_page_url());
|
||||
},
|
||||
|
||||
// 基础分享事件
|
||||
share_base_event() {
|
||||
this.setData({
|
||||
popup_status: false,
|
||||
});
|
||||
uni.pageScrollTo({
|
||||
scrollTop: 0,
|
||||
duration: 300,
|
||||
complete: (res) => {
|
||||
setTimeout(function () {
|
||||
uni.showShareMenu();
|
||||
}, 500);
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 商品海报分享
|
||||
poster_event() {
|
||||
var user = app.globalData.get_user_info(this, 'poster_event');
|
||||
if (user != false) {
|
||||
// 用户未绑定用户则转到登录页面
|
||||
if (app.globalData.user_is_need_login(user)) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/login/login?event_callback=poster_event',
|
||||
});
|
||||
return false;
|
||||
} else {
|
||||
uni.showLoading({
|
||||
title: '生成中...',
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('goodsposter', 'distribution', 'distribution'),
|
||||
method: 'POST',
|
||||
data: { goods_id: this.goods_id },
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
|
||||
if (res.data.code == 0) {
|
||||
uni.previewImage({
|
||||
current: res.data.data,
|
||||
urls: [res.data.data],
|
||||
});
|
||||
} else {
|
||||
if (app.globalData.is_login_check(res.data, this, 'poster_event')) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
app.globalData.showToast('服务器请求出错');
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
.share-popup {
|
||||
padding: 20rpx 10rpx 0 10rpx;
|
||||
position: relative;
|
||||
}
|
||||
.share-popup .close {
|
||||
position: absolute;
|
||||
top: 20rpx;
|
||||
right: 20rpx;
|
||||
z-index: 2;
|
||||
}
|
||||
.share-popup-content {
|
||||
padding: 0 20rpx;
|
||||
margin-top: 40rpx;
|
||||
text-align: left;
|
||||
}
|
||||
.share-popup-content .share-items {
|
||||
padding: 30rpx 0;
|
||||
min-height: 85rpx;
|
||||
}
|
||||
.share-popup-content .share-items:not(:first-child) {
|
||||
border-top: 1px solid #f0f0f0;
|
||||
}
|
||||
.share-popup-content .share-items button {
|
||||
background: transparent;
|
||||
padding: 0;
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
margin: 0;
|
||||
}
|
||||
.share-popup-content .share-items image {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
vertical-align: middle;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
.share-popup-content .share-items .single-text {
|
||||
width: calc(100% - 100rpx);
|
||||
line-height: 85rpx;
|
||||
}
|
||||
.share-popup {
|
||||
padding: 20rpx 10rpx 0 10rpx;
|
||||
position: relative;
|
||||
}
|
||||
.share-popup .close {
|
||||
position: absolute;
|
||||
top: 20rpx;
|
||||
right: 20rpx;
|
||||
z-index: 2;
|
||||
}
|
||||
.share-popup-content {
|
||||
padding: 0 20rpx;
|
||||
text-align: left;
|
||||
}
|
||||
.share-popup-content .share-items {
|
||||
padding: 30rpx 0;
|
||||
min-height: 85rpx;
|
||||
}
|
||||
.share-popup-content .share-items:not(:first-child) {
|
||||
border-top: 1px solid #f0f0f0;
|
||||
}
|
||||
.share-popup-content .share-items button {
|
||||
background: transparent;
|
||||
padding: 0;
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
margin: 0;
|
||||
}
|
||||
.share-popup-content .share-items image {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
vertical-align: middle;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
.share-popup-content .share-items .single-text {
|
||||
width: calc(100% - 100rpx);
|
||||
line-height: 85rpx;
|
||||
}
|
||||
</style>
|
||||
|
||||
259
components/signin/user-qrcode/user-qrcode.vue
Normal file
259
components/signin/user-qrcode/user-qrcode.vue
Normal file
@ -0,0 +1,259 @@
|
||||
<template>
|
||||
<view>
|
||||
<scroll-view :scroll-y="true" class="scroll-box" @scrolltolower="scroll_lower" lower-threshold="60">
|
||||
<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-dashed padding-bottom-main flex-row jc-sb align-c">
|
||||
<text class="cr-grey-9">{{ item.add_time }}</text>
|
||||
<text>{{ item.is_enable_name }}</text>
|
||||
</view>
|
||||
<view class="content margin-top">
|
||||
<navigator :url="'/pages/plugins/signin/user-qrcode-detail/user-qrcode-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-9 margin-right-xl">{{ 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 margin-top-main">
|
||||
<button class="round bg-white br-grey-9 text-size-md" type="default" size="mini" hover-class="none" :data-value="item.id" @tap="show_event">签到</button>
|
||||
<button v-if="(data_base.is_team_show_coming_user || 0) == 1" class="round bg-white cr-main br-main text-size-md" type="default" size="mini" hover-class="none" :data-value="item.id" @tap="coming_event">用户</button>
|
||||
<button class="round bg-white cr-main br-main text-size-md" type="default" size="mini" hover-class="none" :data-value="item.id" @tap="edit_event">编辑</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status"></component-no-data>
|
||||
<!-- 组队 -->
|
||||
<view v-if="(data_base || null) != null && (data_base.is_team || 0) == 1" class="bottom-fixed user-team-container bg-white">
|
||||
<button class="cr-white bg-green br-green text-size auto round" type="default" hover-class="none" @tap="team_event">组队签到</button>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</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 {
|
||||
props: {
|
||||
propPullDownRefresh: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
propScrollLower: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false,
|
||||
data_is_loading: 0,
|
||||
data_base: null,
|
||||
data_list: [],
|
||||
data_total: 0,
|
||||
data_page_total: 0,
|
||||
data_page: 1,
|
||||
content_list: [
|
||||
{ name: '邀请人奖励', field: 'reward_master', unit: '积分' },
|
||||
{ name: '受邀人奖励', field: 'reward_invitee', 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: '加载中...',
|
||||
});
|
||||
|
||||
// 获取数据
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('index', 'userqrcode', 'signin'),
|
||||
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_base: res.data.data.base || null,
|
||||
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('服务器请求出错');
|
||||
},
|
||||
});
|
||||
},
|
||||
// 查看详情
|
||||
show_event(e) {
|
||||
var value = e.currentTarget.dataset.value;
|
||||
uni.navigateTo({
|
||||
url: '/pages/plugins/signin/index-detail/index-detail?id=' + value,
|
||||
});
|
||||
},
|
||||
|
||||
// 签到用户
|
||||
coming_event(e) {
|
||||
var value = e.currentTarget.dataset.value;
|
||||
uni.navigateTo({
|
||||
url: '/pages/plugins/signin/user-coming-list/user-coming-list?id=' + value,
|
||||
});
|
||||
},
|
||||
|
||||
// 编辑
|
||||
edit_event(e) {
|
||||
var value = e.currentTarget.dataset.value;
|
||||
uni.navigateTo({
|
||||
url: '/pages/plugins/signin/user-qrcode-saveinfo/user-qrcode-saveinfo?id=' + value,
|
||||
});
|
||||
},
|
||||
|
||||
// 组队签到
|
||||
team_event(e) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/plugins/signin/user-qrcode-saveinfo/user-qrcode-saveinfo',
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.scroll-box {
|
||||
height: calc(100vh - 144rpx);
|
||||
}
|
||||
.user-team-container {
|
||||
padding: 42rpx 90rpx;
|
||||
}
|
||||
.user-team-container button {
|
||||
height: 88rpx;
|
||||
line-height: 88rpx;
|
||||
}
|
||||
</style>
|
||||
203
components/signin/user-signin/user-signin.vue
Normal file
203
components/signin/user-signin/user-signin.vue
Normal file
@ -0,0 +1,203 @@
|
||||
<template>
|
||||
<view>
|
||||
<scroll-view :scroll-y="true" class="scroll-box" @scrolltolower="scroll_lower" lower-threshold="60">
|
||||
<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">
|
||||
<block v-for="(fv, fi) in content_list" :key="fi">
|
||||
<view class="single-text margin-top-xs" :class="fi === 0 ? 'fw-b cr-black' : 'cr-grey-9'">
|
||||
<text class="margin-right-sm">{{ fv.name }}</text>
|
||||
<text>{{ item[fv.field] }}</text>
|
||||
<text v-if="(fv.unit || null) != null">{{ fv.unit }}</text>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
<view wx: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>
|
||||
</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 {
|
||||
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,
|
||||
content_list: [
|
||||
{ name: '奖励积分', field: 'integral' },
|
||||
{ name: '签到时间', field: 'add_time' },
|
||||
],
|
||||
};
|
||||
},
|
||||
|
||||
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: '加载中...',
|
||||
});
|
||||
|
||||
// 获取数据
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('index', 'usersignin', 'signin'),
|
||||
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_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('服务器请求出错');
|
||||
},
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.scroll-box {
|
||||
height: calc(100vh - 144rpx);
|
||||
}
|
||||
</style>
|
||||
@ -231,7 +231,7 @@
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.nav-detail .nav-child .item {
|
||||
.nav-child .item {
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
padding: 0 30rpx;
|
||||
|
||||
@ -707,7 +707,7 @@
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.nav-detail .nav-child .item {
|
||||
.nav-child .item {
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
padding: 0 30rpx;
|
||||
|
||||
@ -233,7 +233,7 @@
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.nav-detail .nav-child .item {
|
||||
.nav-child .item {
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
padding: 0 30rpx;
|
||||
|
||||
31
pages.json
31
pages.json
@ -526,6 +526,9 @@
|
||||
"pages": [{
|
||||
"path": "user/user",
|
||||
"style": {
|
||||
// #ifdef MP-WEIXIN || MP-BAIDU || MP-QQ || MP-KUAISHOU || H5 || APP
|
||||
"navigationStyle": "custom",
|
||||
// #endif
|
||||
"enablePullDownRefresh": true,
|
||||
"navigationBarTitleText": "我的钱包"
|
||||
}
|
||||
@ -683,20 +686,20 @@
|
||||
"navigationBarTitleText": "签到"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "user-signin/user-signin",
|
||||
"style": {
|
||||
"enablePullDownRefresh": true,
|
||||
"navigationBarTitleText": "我的签到"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "user-qrcode/user-qrcode",
|
||||
"style": {
|
||||
"enablePullDownRefresh": true,
|
||||
"navigationBarTitleText": "签到码管理"
|
||||
}
|
||||
},
|
||||
// {
|
||||
// "path": "user-signin/user-signin",
|
||||
// "style": {
|
||||
// "enablePullDownRefresh": true,
|
||||
// "navigationBarTitleText": "我的签到"
|
||||
// }
|
||||
// },
|
||||
// {
|
||||
// "path": "user-qrcode/user-qrcode",
|
||||
// "style": {
|
||||
// "enablePullDownRefresh": true,
|
||||
// "navigationBarTitleText": "签到码管理"
|
||||
// }
|
||||
// },
|
||||
{
|
||||
"path": "user-qrcode-detail/user-qrcode-detail",
|
||||
"style": {
|
||||
|
||||
@ -40,7 +40,7 @@
|
||||
}
|
||||
|
||||
.superior-item {
|
||||
background: #FF8273;
|
||||
background: rgba(255, 72, 110, 0.51);
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
padding: 0 24rpx;
|
||||
@ -80,8 +80,7 @@
|
||||
/*
|
||||
* 导航
|
||||
*/
|
||||
|
||||
.nav {
|
||||
.nav.nav-bottom {
|
||||
padding-bottom: 150rpx;
|
||||
}
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
<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">
|
||||
<view v-if="is_realstore_top_nav_back == 1" class="nav-back padding-horizontal-main padding-top-sm round va-m pr top-sm cr-white" @tap="top_nav_left_back_event">
|
||||
<iconfont name="icon-tongyong-fanhui" size="32rpx"></iconfont>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
@ -29,7 +29,7 @@
|
||||
<block v-if="(data_base || null) != null && (data_base.is_enable_self_extraction || 0) == 1">
|
||||
<navigator url="/pages/plugins/distribution/extraction/extraction" hover-class="none">
|
||||
<button class="text-size-xs cr-white" size="mini" type="default" hover-class="none">
|
||||
{{ (extraction || null) == null ? "申请" : "" }}取货点
|
||||
{{ (extraction || null) == null ? '申请' : '' }}取货点
|
||||
<iconfont name="icon-qiandao-jiantou2" size="18rpx" color="#fff" class="pa"></iconfont>
|
||||
</button>
|
||||
</navigator>
|
||||
@ -39,9 +39,9 @@
|
||||
</view>
|
||||
|
||||
<!-- 会员中心通知 -->
|
||||
<view v-if="(user_level || null) != null && (data_base.user_center_notice || null) != null && data_base.user_center_notice.length > 0" class="padding-horizontal-main">
|
||||
<view v-if="(user_level || null) != null && (data_base.user_center_notice || null) != null && data_base.user_center_notice.length > 0" class="padding-horizontal-main padding-bottom-main">
|
||||
<view :class="(superior || null) != null ? 'padding-horizontal-main margin-horizontal-xs' : ''">
|
||||
<uni-notice-bar class="padding-0" show-icon scrollable :text="data_base.user_center_notice.join('')" background-color="transparent" color="#fff" />
|
||||
<uni-notice-bar show-icon scrollable :text="data_base.user_center_notice.join('')" background-color="transparent" color="#fff" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@ -122,7 +122,7 @@
|
||||
</view>
|
||||
|
||||
<!-- 导航 -->
|
||||
<view v-if="nav_list.length > 0" class="nav oh flex-row flex-warp padding-sm">
|
||||
<view v-if="nav_list.length > 0" class="nav oh flex-row flex-warp padding-sm" :class="(profit_ladder || null) != null ? 'padding-bottom-main' : 'nav-bottom'">
|
||||
<block v-for="(item, index) in nav_list" :key="index">
|
||||
<view class="flex-width-half">
|
||||
<view class="item bg-white border-radius-main margin-sm">
|
||||
@ -200,287 +200,287 @@
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentNoData from "../../../../components/no-data/no-data";
|
||||
import componentPopup from "../../../../components/popup/popup";
|
||||
var currency_symbol = app.globalData.currency_symbol();
|
||||
var distribution_static_url = app.globalData.get_static_url("distribution", true) + "app/";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
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,
|
||||
distribution_static_url: distribution_static_url,
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: "",
|
||||
currency_symbol: currency_symbol,
|
||||
avatar: app.globalData.data.default_user_head_src,
|
||||
nickname: "用户名",
|
||||
data_base: null,
|
||||
user_level: null,
|
||||
extraction: null,
|
||||
superior: null,
|
||||
profit_ladder: null,
|
||||
nav_list: [],
|
||||
time_data: null,
|
||||
base_data: null,
|
||||
user_promotion_data: null,
|
||||
profit_data: null,
|
||||
stats_user_promotion_data_list: [],
|
||||
stats_base_data_list: [],
|
||||
stats_base_data_list_children: [],
|
||||
stats_profit_data_list: [],
|
||||
popup_time_status: false,
|
||||
form_submit_disabled_status: false,
|
||||
popup_time_value: { name: "自定义", start: "", end: "", index: "" },
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentNoData,
|
||||
componentPopup,
|
||||
},
|
||||
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",
|
||||
});
|
||||
}
|
||||
this.set_user_base(user);
|
||||
},
|
||||
});
|
||||
} else {
|
||||
this.set_user_base(user);
|
||||
this.get_data();
|
||||
}
|
||||
}
|
||||
const app = getApp();
|
||||
import componentNoData from '../../../../components/no-data/no-data';
|
||||
import componentPopup from '../../../../components/popup/popup';
|
||||
var currency_symbol = app.globalData.currency_symbol();
|
||||
var distribution_static_url = app.globalData.get_static_url('distribution', true) + 'app/';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
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,
|
||||
distribution_static_url: distribution_static_url,
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
currency_symbol: currency_symbol,
|
||||
avatar: app.globalData.data.default_user_head_src,
|
||||
nickname: '用户名',
|
||||
data_base: null,
|
||||
user_level: null,
|
||||
extraction: null,
|
||||
superior: null,
|
||||
profit_ladder: null,
|
||||
nav_list: [],
|
||||
time_data: null,
|
||||
base_data: null,
|
||||
user_promotion_data: null,
|
||||
profit_data: null,
|
||||
stats_user_promotion_data_list: [],
|
||||
stats_base_data_list: [],
|
||||
stats_base_data_list_children: [],
|
||||
stats_profit_data_list: [],
|
||||
popup_time_status: false,
|
||||
form_submit_disabled_status: false,
|
||||
popup_time_value: { name: '自定义', start: '', end: '', index: '' },
|
||||
};
|
||||
},
|
||||
|
||||
// 设置用户基础信息
|
||||
set_user_base(user) {
|
||||
if ((user.avatar || null) != null) {
|
||||
this.setData({ avatar: user.avatar });
|
||||
}
|
||||
if ((user.user_name_view || null) != null) {
|
||||
this.setData({ nickname: user.user_name_view });
|
||||
}
|
||||
components: {
|
||||
componentNoData,
|
||||
componentPopup,
|
||||
},
|
||||
props: {},
|
||||
|
||||
onLoad(params) {},
|
||||
|
||||
onShow() {
|
||||
this.init();
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle();
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("index", "user", "distribution"),
|
||||
method: "POST",
|
||||
data: {},
|
||||
dataType: "json",
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
// 选择时间处理
|
||||
var time_data = data.time_data || null;
|
||||
var temp_value = this.popup_time_value;
|
||||
if (time_data != null) {
|
||||
var temp = time_data[data.default_day];
|
||||
temp_value.start = temp.start;
|
||||
temp_value.end = temp.end;
|
||||
temp_value.name = temp.name;
|
||||
}
|
||||
this.setData({
|
||||
data_base: data.base || null,
|
||||
user_level: data.user_level || null,
|
||||
extraction: data.extraction || null,
|
||||
superior: data.superior || null,
|
||||
profit_ladder: data.profit_ladder || null,
|
||||
nav_list: data.nav_list || [],
|
||||
time_data: time_data,
|
||||
stats_user_promotion_data_list: data.stats_user_promotion_data_list || [],
|
||||
stats_base_data_list: data.stats_base_data_list || [],
|
||||
stats_base_data_list_children: app.globalData.group_arry(data.stats_base_data_list, 2) || [],
|
||||
stats_profit_data_list: data.stats_profit_data_list || [],
|
||||
popup_time_value: temp_value,
|
||||
data_list_loding_msg: "",
|
||||
data_list_loding_status: 0,
|
||||
data_bottom_line_status: false,
|
||||
// 下拉刷新
|
||||
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',
|
||||
});
|
||||
}
|
||||
this.set_user_base(user);
|
||||
},
|
||||
});
|
||||
} else {
|
||||
this.set_user_base(user);
|
||||
this.get_data();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// 设置用户基础信息
|
||||
set_user_base(user) {
|
||||
if ((user.avatar || null) != null) {
|
||||
this.setData({ avatar: user.avatar });
|
||||
}
|
||||
if ((user.user_name_view || null) != null) {
|
||||
this.setData({ nickname: user.user_name_view });
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('index', 'user', 'distribution'),
|
||||
method: 'POST',
|
||||
data: {},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
// 选择时间处理
|
||||
var time_data = data.time_data || null;
|
||||
var temp_value = this.popup_time_value;
|
||||
if (time_data != null) {
|
||||
var temp = time_data[data.default_day];
|
||||
temp_value.start = temp.start;
|
||||
temp_value.end = temp.end;
|
||||
temp_value.name = temp.name;
|
||||
}
|
||||
this.setData({
|
||||
data_base: data.base || null,
|
||||
user_level: data.user_level || null,
|
||||
extraction: data.extraction || null,
|
||||
superior: data.superior || null,
|
||||
profit_ladder: data.profit_ladder || null,
|
||||
nav_list: data.nav_list || [],
|
||||
time_data: time_data,
|
||||
stats_user_promotion_data_list: data.stats_user_promotion_data_list || [],
|
||||
stats_base_data_list: data.stats_base_data_list || [],
|
||||
stats_base_data_list_children: app.globalData.group_arry(data.stats_base_data_list, 2) || [],
|
||||
stats_profit_data_list: data.stats_profit_data_list || [],
|
||||
popup_time_value: temp_value,
|
||||
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("服务器请求出错");
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 头像查看
|
||||
preview_event() {
|
||||
if (app.globalData.data.default_user_head_src != this.avatar) {
|
||||
uni.previewImage({
|
||||
current: this.avatar,
|
||||
urls: [this.avatar],
|
||||
app.globalData.showToast('服务器请求出错');
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
// 头像加载错误
|
||||
user_avatar_error(e) {
|
||||
this.setData({
|
||||
avatar: app.globalData.data.default_user_head_src,
|
||||
});
|
||||
},
|
||||
// 头像查看
|
||||
preview_event() {
|
||||
if (app.globalData.data.default_user_head_src != this.avatar) {
|
||||
uni.previewImage({
|
||||
current: this.avatar,
|
||||
urls: [this.avatar],
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 时间选择开启弹层
|
||||
popup_time_event(e) {
|
||||
this.setData({
|
||||
popup_time_status: true,
|
||||
});
|
||||
},
|
||||
// 头像加载错误
|
||||
user_avatar_error(e) {
|
||||
this.setData({
|
||||
avatar: app.globalData.data.default_user_head_src,
|
||||
});
|
||||
},
|
||||
|
||||
// 时间选择关闭弹层
|
||||
popup_time_close_event(e) {
|
||||
this.setData({
|
||||
popup_time_status: false,
|
||||
});
|
||||
},
|
||||
// 时间选择开启弹层
|
||||
popup_time_event(e) {
|
||||
this.setData({
|
||||
popup_time_status: true,
|
||||
});
|
||||
},
|
||||
|
||||
// 时间快捷选择
|
||||
quit_time_event(e) {
|
||||
var index = e.currentTarget.dataset.index;
|
||||
var item = this.time_data[index];
|
||||
var temp_value = this.popup_time_value;
|
||||
temp_value.start = item.start;
|
||||
temp_value.end = item.end;
|
||||
temp_value.index = index;
|
||||
this.setData({
|
||||
popup_time_value: temp_value,
|
||||
});
|
||||
},
|
||||
// 时间选择关闭弹层
|
||||
popup_time_close_event(e) {
|
||||
this.setData({
|
||||
popup_time_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 自定义开始时间事件
|
||||
time_start_change_event(e) {
|
||||
var temp_value = this.popup_time_value;
|
||||
temp_value.start = e;
|
||||
temp_value.index = "";
|
||||
this.setData({
|
||||
popup_time_value: temp_value,
|
||||
});
|
||||
},
|
||||
// 时间快捷选择
|
||||
quit_time_event(e) {
|
||||
var index = e.currentTarget.dataset.index;
|
||||
var item = this.time_data[index];
|
||||
var temp_value = this.popup_time_value;
|
||||
temp_value.start = item.start;
|
||||
temp_value.end = item.end;
|
||||
temp_value.index = index;
|
||||
this.setData({
|
||||
popup_time_value: temp_value,
|
||||
});
|
||||
},
|
||||
|
||||
// 自定义结束时间事件
|
||||
time_end_change_event(e) {
|
||||
var temp_value = this.popup_time_value;
|
||||
temp_value.end = e;
|
||||
temp_value.index = "";
|
||||
this.setData({
|
||||
popup_time_value: temp_value,
|
||||
});
|
||||
},
|
||||
// 自定义开始时间事件
|
||||
time_start_change_event(e) {
|
||||
var temp_value = this.popup_time_value;
|
||||
temp_value.start = e;
|
||||
temp_value.index = '';
|
||||
this.setData({
|
||||
popup_time_value: temp_value,
|
||||
});
|
||||
},
|
||||
|
||||
// 数据提交
|
||||
form_submit(e) {
|
||||
this.setData({
|
||||
form_submit_disabled_status: true,
|
||||
});
|
||||
uni.showLoading({
|
||||
title: "查询中...",
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("stats", "user", "distribution"),
|
||||
method: "POST",
|
||||
data: this.popup_time_value,
|
||||
dataType: "json",
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
var temp_value = this.popup_time_value;
|
||||
temp_value.name = (temp_value.index || null) == null ? ((temp_value.start || null) == null && (temp_value.end || null) == null ? "全部" : "自定义") : this.time_data[temp_value.index]["name"];
|
||||
this.setData({
|
||||
popup_time_status: false,
|
||||
form_submit_disabled_status: false,
|
||||
stats_user_promotion_data_list: data.stats_user_promotion_data_list || [],
|
||||
stats_base_data_list: data.stats_base_data_list || [],
|
||||
stats_base_data_list_children: app.globalData.group_arry(data.stats_base_data_list, 2) || [],
|
||||
popup_time_value: temp_value,
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
form_submit_disabled_status: false,
|
||||
});
|
||||
if (app.globalData.is_login_check(res.data)) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
// 自定义结束时间事件
|
||||
time_end_change_event(e) {
|
||||
var temp_value = this.popup_time_value;
|
||||
temp_value.end = e;
|
||||
temp_value.index = '';
|
||||
this.setData({
|
||||
popup_time_value: temp_value,
|
||||
});
|
||||
},
|
||||
|
||||
// 数据提交
|
||||
form_submit(e) {
|
||||
this.setData({
|
||||
form_submit_disabled_status: true,
|
||||
});
|
||||
uni.showLoading({
|
||||
title: '查询中...',
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('stats', 'user', 'distribution'),
|
||||
method: 'POST',
|
||||
data: this.popup_time_value,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
var temp_value = this.popup_time_value;
|
||||
temp_value.name = (temp_value.index || null) == null ? ((temp_value.start || null) == null && (temp_value.end || null) == null ? '全部' : '自定义') : this.time_data[temp_value.index]['name'];
|
||||
this.setData({
|
||||
popup_time_status: false,
|
||||
form_submit_disabled_status: false,
|
||||
stats_user_promotion_data_list: data.stats_user_promotion_data_list || [],
|
||||
stats_base_data_list: data.stats_base_data_list || [],
|
||||
stats_base_data_list_children: app.globalData.group_arry(data.stats_base_data_list, 2) || [],
|
||||
popup_time_value: temp_value,
|
||||
});
|
||||
} else {
|
||||
app.globalData.showToast("提交失败,请重试!");
|
||||
this.setData({
|
||||
form_submit_disabled_status: false,
|
||||
});
|
||||
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("服务器请求出错");
|
||||
},
|
||||
});
|
||||
},
|
||||
// 顶部返回操作
|
||||
top_nav_left_back_event(e) {
|
||||
var pages = getCurrentPages();
|
||||
if (pages.length <= 1) {
|
||||
uni.switchTab({
|
||||
url: app.globalData.data.tabbar_pages[0],
|
||||
},
|
||||
fail: () => {
|
||||
this.setData({
|
||||
form_submit_disabled_status: false,
|
||||
});
|
||||
uni.hideLoading();
|
||||
app.globalData.showToast('服务器请求出错');
|
||||
},
|
||||
});
|
||||
} else {
|
||||
uni.navigateBack();
|
||||
}
|
||||
},
|
||||
// 顶部返回操作
|
||||
top_nav_left_back_event(e) {
|
||||
var pages = getCurrentPages();
|
||||
if (pages.length <= 1) {
|
||||
uni.switchTab({
|
||||
url: app.globalData.data.tabbar_pages[0],
|
||||
});
|
||||
} else {
|
||||
uni.navigateBack();
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import "./user.css";
|
||||
@import './user.css';
|
||||
</style>
|
||||
|
||||
@ -161,6 +161,7 @@
|
||||
nav_status_list: data.nav || [],
|
||||
data_list_loding_status: 0,
|
||||
data_bottom_line_status: false,
|
||||
data_page: 1,
|
||||
});
|
||||
this.get_data_list();
|
||||
} else {
|
||||
|
||||
@ -1,20 +0,0 @@
|
||||
/*
|
||||
* 导航
|
||||
*/
|
||||
.nav .item {
|
||||
width: calc(50% - 70rpx);
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
.nav .item:nth-child(2n) {
|
||||
margin-right: 20rpx;
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
.nav .item:nth-child(2n+1) {
|
||||
margin-left: 20rpx;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
.nav .item image {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
margin: 0 auto;
|
||||
}
|
||||
@ -1,134 +0,0 @@
|
||||
<template>
|
||||
<view>
|
||||
<view v-if="(data_base || null) != null">
|
||||
<!-- 导航 -->
|
||||
<view v-if="nav_list.length > 0" class="nav oh padding-top-main">
|
||||
<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.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>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentNoData from '../../../../components/no-data/no-data';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
data_base: null,
|
||||
nav_list: [],
|
||||
};
|
||||
},
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data() {
|
||||
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 || 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: '服务器请求出错',
|
||||
});
|
||||
app.globalData.showToast('服务器请求出错');
|
||||
},
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './user.css';
|
||||
</style>
|
||||
@ -24,7 +24,7 @@
|
||||
/* height: 52rpx;
|
||||
line-height: 52rpx; */
|
||||
padding: 0 44rpx 0 24rpx;
|
||||
background: rgba(0, 0, 0, 0.15);
|
||||
background-color: rgba(0, 0, 0, 0.15) !important;
|
||||
border-radius: 200rpx 0 0 200rpx;
|
||||
}
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
<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" @tap="top_nav_left_back_event">
|
||||
<view v-if="is_realstore_top_nav_back == 1" class="nav-back padding-horizontal-main padding-top-sm round va-m pr top-sm" @tap="top_nav_left_back_event">
|
||||
<iconfont name="icon-tongyong-fanhui" size="32rpx"></iconfont>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
@ -176,211 +176,210 @@
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentNoData from "../../../../components/no-data/no-data";
|
||||
var membershiplevelvip_static_url = app.globalData.get_static_url("membershiplevelvip", true) + "app/";
|
||||
const app = getApp();
|
||||
import componentNoData from '../../../../components/no-data/no-data';
|
||||
var membershiplevelvip_static_url = app.globalData.get_static_url('membershiplevelvip', true) + 'app/';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
membershiplevelvip_static_url: membershiplevelvip_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,
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: "",
|
||||
data_base: null,
|
||||
user_vip: null,
|
||||
nav_list: [],
|
||||
avatar: app.globalData.data.default_user_head_src,
|
||||
nickname: "用户名",
|
||||
submit_disabled_status: false,
|
||||
// 推广客户,反力概况
|
||||
statistics_data: null,
|
||||
};
|
||||
},
|
||||
|
||||
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",
|
||||
});
|
||||
}
|
||||
this.set_user_base(user);
|
||||
},
|
||||
});
|
||||
} else {
|
||||
this.set_user_base(user);
|
||||
this.get_data();
|
||||
}
|
||||
}
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
membershiplevelvip_static_url: membershiplevelvip_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,
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
data_base: null,
|
||||
user_vip: null,
|
||||
nav_list: [],
|
||||
avatar: app.globalData.data.default_user_head_src,
|
||||
nickname: '用户名',
|
||||
submit_disabled_status: false,
|
||||
// 推广客户,反力概况
|
||||
statistics_data: null,
|
||||
};
|
||||
},
|
||||
// 设置用户基础信息
|
||||
set_user_base(user) {
|
||||
if ((user.avatar || null) != null) {
|
||||
this.setData({ avatar: user.avatar });
|
||||
}
|
||||
if ((user.user_name_view || null) != null) {
|
||||
this.setData({ nickname: user.user_name_view });
|
||||
}
|
||||
|
||||
components: {
|
||||
componentNoData,
|
||||
},
|
||||
// 获取数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("index", "vip", "membershiplevelvip"),
|
||||
method: "POST",
|
||||
data: {},
|
||||
dataType: "json",
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
console.log(res.data.data);
|
||||
var data = res.data.data;
|
||||
this.setData({
|
||||
data_base: data.base || null,
|
||||
user_vip: data.user_vip || null,
|
||||
nav_list: data.nav_list || [],
|
||||
data_list_loding_msg: "",
|
||||
data_list_loding_status: 0,
|
||||
data_bottom_line_status: false,
|
||||
statistics_data: data.statistics_data || null,
|
||||
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',
|
||||
});
|
||||
}
|
||||
this.set_user_base(user);
|
||||
},
|
||||
});
|
||||
} else {
|
||||
this.set_user_base(user);
|
||||
this.get_data();
|
||||
}
|
||||
}
|
||||
},
|
||||
// 设置用户基础信息
|
||||
set_user_base(user) {
|
||||
if ((user.avatar || null) != null) {
|
||||
this.setData({ avatar: user.avatar });
|
||||
}
|
||||
if ((user.user_name_view || null) != null) {
|
||||
this.setData({ nickname: user.user_name_view });
|
||||
}
|
||||
},
|
||||
// 获取数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('index', 'vip', 'membershiplevelvip'),
|
||||
method: 'POST',
|
||||
data: {},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
this.setData({
|
||||
data_base: data.base || null,
|
||||
user_vip: data.user_vip || null,
|
||||
nav_list: data.nav_list || [],
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: 0,
|
||||
data_bottom_line_status: false,
|
||||
statistics_data: data.statistics_data || null,
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
if (app.globalData.is_login_check(res.data, this, 'get_data')) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: 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('服务器请求出错');
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 头像查看
|
||||
preview_event() {
|
||||
if (app.globalData.data.default_user_head_src != this.avatar) {
|
||||
uni.previewImage({
|
||||
current: this.avatar,
|
||||
urls: [this.avatar],
|
||||
});
|
||||
app.globalData.showToast("服务器请求出错");
|
||||
},
|
||||
});
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
// 头像查看
|
||||
preview_event() {
|
||||
if (app.globalData.data.default_user_head_src != this.avatar) {
|
||||
uni.previewImage({
|
||||
current: this.avatar,
|
||||
urls: [this.avatar],
|
||||
// 头像加载错误
|
||||
user_avatar_error(e) {
|
||||
this.setData({
|
||||
avatar: app.globalData.data.default_user_head_src,
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
// 头像加载错误
|
||||
user_avatar_error(e) {
|
||||
this.setData({
|
||||
avatar: app.globalData.data.default_user_head_src,
|
||||
});
|
||||
},
|
||||
|
||||
// 连续开通会员事件
|
||||
uservip_renew_event(e) {
|
||||
var self = this;
|
||||
uni.showModal({
|
||||
title: "温馨提示",
|
||||
content: "按照原时长和费用续费,确定继续吗?",
|
||||
confirmText: "确认",
|
||||
cancelText: "暂不",
|
||||
success: (result) => {
|
||||
if (result.confirm) {
|
||||
// 请求生成支付订单
|
||||
self.setData({
|
||||
submit_disabled_status: true,
|
||||
});
|
||||
uni.showLoading({
|
||||
title: "处理中...",
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("renew", "buy", "membershiplevelvip"),
|
||||
method: "POST",
|
||||
data: {},
|
||||
dataType: "json",
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
self.setData({
|
||||
submit_disabled_status: false,
|
||||
});
|
||||
if (res.data.code == 0) {
|
||||
uni.setStorageSync(app.globalData.data.cache_page_pay_key, res.data.data.id);
|
||||
uni.redirectTo({
|
||||
url: "/pages/plugins/membershiplevelvip/order/order",
|
||||
// 连续开通会员事件
|
||||
uservip_renew_event(e) {
|
||||
var self = this;
|
||||
uni.showModal({
|
||||
title: '温馨提示',
|
||||
content: '按照原时长和费用续费,确定继续吗?',
|
||||
confirmText: '确认',
|
||||
cancelText: '暂不',
|
||||
success: (result) => {
|
||||
if (result.confirm) {
|
||||
// 请求生成支付订单
|
||||
self.setData({
|
||||
submit_disabled_status: true,
|
||||
});
|
||||
uni.showLoading({
|
||||
title: '处理中...',
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('renew', 'buy', 'membershiplevelvip'),
|
||||
method: 'POST',
|
||||
data: {},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
self.setData({
|
||||
submit_disabled_status: false,
|
||||
});
|
||||
} else {
|
||||
if (app.globalData.is_login_check(res.data, self, "uservip_renew_event")) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
if (res.data.code == 0) {
|
||||
uni.setStorageSync(app.globalData.data.cache_page_pay_key, res.data.data.id);
|
||||
uni.redirectTo({
|
||||
url: '/pages/plugins/membershiplevelvip/order/order',
|
||||
});
|
||||
} else {
|
||||
if (app.globalData.is_login_check(res.data, self, 'uservip_renew_event')) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
self.setData({
|
||||
submit_disabled_status: false,
|
||||
});
|
||||
uni.hideLoading();
|
||||
app.globalData.showToast("服务器请求出错");
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
// 顶部返回操作
|
||||
top_nav_left_back_event(e) {
|
||||
var pages = getCurrentPages();
|
||||
if (pages.length <= 1) {
|
||||
uni.switchTab({
|
||||
url: app.globalData.data.tabbar_pages[0],
|
||||
},
|
||||
fail: () => {
|
||||
self.setData({
|
||||
submit_disabled_status: false,
|
||||
});
|
||||
uni.hideLoading();
|
||||
app.globalData.showToast('服务器请求出错');
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
} else {
|
||||
uni.navigateBack();
|
||||
}
|
||||
},
|
||||
// 顶部返回操作
|
||||
top_nav_left_back_event(e) {
|
||||
var pages = getCurrentPages();
|
||||
if (pages.length <= 1) {
|
||||
uni.switchTab({
|
||||
url: app.globalData.data.tabbar_pages[0],
|
||||
});
|
||||
} else {
|
||||
uni.navigateBack();
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import "./user.css";
|
||||
<style scoped>
|
||||
@import './user.css';
|
||||
</style>
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
<template>
|
||||
<view class="signin-container">
|
||||
<view v-if="(data || null) != null">
|
||||
<image :src="signin_static_url+'signin-bg.png'" mode="widthFix" class="signin-bg"></image>
|
||||
<image :src="signin_static_url + 'signin-bg.png'" mode="widthFix" class="signin-bg"></image>
|
||||
<view class="signin-opration-group pa right-0 flex-col cr-white">
|
||||
<view v-if="(data_base.is_share || 0) == 1" class="share oh flex-row">
|
||||
<button class="content" open-type="share">
|
||||
<button class="content" open-type="share" @tap="share_event">
|
||||
<iconfont name="icon-qiandao-fenxiang" class="pr top-sm" size="32rpx"></iconfont>
|
||||
分享
|
||||
</button>
|
||||
@ -18,9 +18,7 @@
|
||||
</view>
|
||||
<view class="signin-btn pa left-0 right-0 tc">
|
||||
<view class="content cr-white" @tap="coming_event">
|
||||
<block v-if="is_already_coming == 1">
|
||||
已签到
|
||||
</block>
|
||||
<block v-if="is_already_coming == 1"> 已签到 </block>
|
||||
<block v-else>
|
||||
立即签到
|
||||
<iconfont name="icon-qiandao-jiantou" color="#fff" size="32rpx" class="margin-left-sm"></iconfont>
|
||||
@ -32,25 +30,25 @@
|
||||
<view class="signin-calendar spacing-mb">
|
||||
<view class="calendar-title flex-row align-c jc-sb">
|
||||
<view class="title-left fw-b text-size">
|
||||
{{calendar}}
|
||||
{{ calendar }}
|
||||
</view>
|
||||
<view class="title-right text-size-md">
|
||||
<navigator v-if="(data_base.is_user_menu || 0) == 1" url="/pages/plugins/signin/user-signin/user-signin" hover-class="none">
|
||||
<navigator v-if="(data_base.is_user_menu || 0) == 1" url="/pages/plugins/signin/user/user" hover-class="none">
|
||||
<iconfont name="icon-qiandao-wdqd margin-right-sm pr top-sm" size="32rpx"></iconfont>
|
||||
我的签到
|
||||
</navigator>
|
||||
</view>
|
||||
</view>
|
||||
<view class="calendar-week flex-row align-c jc-sa padding-horizontal-main">
|
||||
<view v-for="(item,index) in week" :key="index">
|
||||
{{item}}
|
||||
<view v-for="(item, index) in week" :key="index">
|
||||
{{ item }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="calendar-days padding-horizontal-main bg-white spacing-mb">
|
||||
<view class="item flex-row jc-sa align-c" v-for="(row,rowIndex) in day_count" :key="rowIndex">
|
||||
<view v-for="(col,colIndex) in row" class="list tc" :class="col.class" :key="colIndex">
|
||||
<view class="item flex-row jc-sa align-c" v-for="(row, rowIndex) in day_count" :key="rowIndex">
|
||||
<view v-for="(col, colIndex) in row" class="list tc" :class="col.class" :key="colIndex">
|
||||
<block v-if="col.today">
|
||||
<block v-if="user_signin_data && user_signin_data.current_day===1">
|
||||
<block v-if="user_signin_data && user_signin_data.current_day === 1">
|
||||
<iconfont name="icon-qiandao-yixuan" color="#E22C08" size="48rpx"></iconfont>
|
||||
</block>
|
||||
<block v-else>
|
||||
@ -59,29 +57,29 @@
|
||||
</block>
|
||||
<block v-else>
|
||||
<!-- 判断bool是否存在数组signinHistory中 【 true则表示存在于数组中】 -->
|
||||
<block v-if="user_signin_data.history_day.some(item => Number(item) === col.num)">
|
||||
<block v-if="user_signin_data.history_day.some((item) => Number(item) === col.num)">
|
||||
<iconfont name="icon-qiandao-yixuan" size="48rpx" color="#ccc"></iconfont>
|
||||
</block>
|
||||
<block v-else>
|
||||
{{col.num}}
|
||||
{{ col.num }}
|
||||
</block>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="(user || null) !== null" class="calendar-foot pr">
|
||||
<image :src="signin_static_url+'calendar-link.png'" mode="widthFix" class="calendar-link-left"></image>
|
||||
<image :src="signin_static_url+'calendar-link.png'" mode="widthFix" class="calendar-link-right"></image>
|
||||
<image :src="signin_static_url + 'calendar-link.png'" mode="widthFix" class="calendar-link-left"></image>
|
||||
<image :src="signin_static_url + 'calendar-link.png'" mode="widthFix" class="calendar-link-right"></image>
|
||||
<!-- 判断是组队签到还是个人签到 -->
|
||||
<view v-if="(team_signin_data || null) != null && user.id == data.user_id" class="content bg-white flex-row jc-sb align-c">
|
||||
<text class="fw-b">今日{{team_signin_data.day}}人签到,共{{team_signin_data.total}}人</text>
|
||||
<text class="fw-b">今日{{ team_signin_data.day }}人签到,共{{ team_signin_data.total }}人</text>
|
||||
<navigator v-if="(data_base.is_team_show_coming_user || 0) == 1" :url="'/pages/plugins/signin/user-coming-list/user-coming-list?id=' + data.id" hover-class="none">
|
||||
<iconfont name="icon-qiandao-jiantou2"></iconfont>
|
||||
</navigator>
|
||||
</view>
|
||||
<view v-else class="content bg-white flex-row jc-sb align-c">
|
||||
<text class="fw-b">今日已签到,获得{{user_signin_data.integral}}积分,共{{user_signin_data.total}}次</text>
|
||||
<navigator v-if="(data_base.is_user_menu || 0) == 1" url="/pages/plugins/signin/user-signin/user-signin" hover-class="none">
|
||||
<text class="fw-b">今日已签到,获得{{ user_signin_data.integral }}积分,共{{ user_signin_data.total }}次</text>
|
||||
<navigator v-if="(data_base.is_user_menu || 0) == 1" url="/pages/plugins/signin/user/user" hover-class="none">
|
||||
<iconfont name="icon-qiandao-jiantou2"></iconfont>
|
||||
</navigator>
|
||||
</view>
|
||||
@ -92,7 +90,7 @@
|
||||
<view v-if="(data_base.signin_desc || null) != null && data_base.signin_desc.length > 0" class="notice-content border-radius-main text-size-md">
|
||||
<view class="title fw-b">规则说明</view>
|
||||
<view class="content">
|
||||
<block v-for="(item, index) in data_base.signin_desc" :key="index">{{item}}</block>
|
||||
<block v-for="(item, index) in data_base.signin_desc" :key="index">{{ item }}</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -100,15 +98,18 @@
|
||||
<!-- 签到成功提示信息 -->
|
||||
<view v-if="is_success_tips == 1" class="coming-tips-container">
|
||||
<view class="coming-content tc pr">
|
||||
<image :src="signin_static_url+'signin-popup-title.png'" class="pa" mode="widthFix"></image>
|
||||
<image :src="signin_static_url + 'signin-popup-title.png'" class="pa" mode="widthFix"></image>
|
||||
<view class="title">签到成功</view>
|
||||
<view class="desc">恭喜您获得 <text>{{coming_integral}}</text> 积分</view>
|
||||
<view class="desc"
|
||||
>恭喜您获得 <text>{{ coming_integral }}</text> 积分</view
|
||||
>
|
||||
<view class="use-btn text-size fw-b cr-white" :data-value="home_page_url" @tap="url_event">立即使用</view>
|
||||
<view class="close-sub pa cr-white" @tap="coming_success_close_event">
|
||||
<iconfont name="icon-qiandao-tancguanbi" size="60rpx"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<component-share-popup ref="share"></component-share-popup>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
@ -118,8 +119,9 @@
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentNoData from "../../../../components/no-data/no-data";
|
||||
var signin_static_url = app.globalData.get_static_url("signin", true) + 'app/';
|
||||
import componentNoData from '../../../../components/no-data/no-data';
|
||||
import componentSharePopup from '../../../../components/share-popup/share-popup';
|
||||
var signin_static_url = app.globalData.get_static_url('signin', true) + 'app/';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@ -158,26 +160,27 @@
|
||||
|
||||
components: {
|
||||
componentNoData,
|
||||
componentSharePopup,
|
||||
},
|
||||
props: {},
|
||||
computed: {
|
||||
days_in_month() {
|
||||
const date = new Date(this.year, this.month, 0)
|
||||
return date.getDate()
|
||||
}
|
||||
const date = new Date(this.year, this.month, 0);
|
||||
return date.getDate();
|
||||
},
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
//params['id'] = 1;
|
||||
this.setData({
|
||||
params: params
|
||||
params: params,
|
||||
});
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 用户信息
|
||||
this.setData({
|
||||
user: app.globalData.get_user_cache_info()
|
||||
user: app.globalData.get_user_cache_info(),
|
||||
});
|
||||
// 获取数据
|
||||
this.get_data();
|
||||
@ -207,7 +210,7 @@
|
||||
day.push({
|
||||
num: defore_days - i,
|
||||
class: 'cr-grey-c',
|
||||
today: false
|
||||
today: false,
|
||||
});
|
||||
}
|
||||
// 本月计数
|
||||
@ -217,7 +220,7 @@
|
||||
day.push({
|
||||
num: i,
|
||||
class: 'cr-black',
|
||||
today: i === today ? true : false
|
||||
today: i === today ? true : false,
|
||||
});
|
||||
if (day.length === 7) {
|
||||
days.push(day);
|
||||
@ -230,7 +233,7 @@
|
||||
day.push({
|
||||
num: i,
|
||||
class: 'cr-grey-c',
|
||||
today: false
|
||||
today: false,
|
||||
});
|
||||
}
|
||||
days.push(day);
|
||||
@ -240,19 +243,17 @@
|
||||
});
|
||||
},
|
||||
// 点击日期
|
||||
handle_day() {
|
||||
|
||||
},
|
||||
handle_day() {},
|
||||
// 获取数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("detail", "index", "signin"),
|
||||
url: app.globalData.get_request_url('detail', 'index', 'signin'),
|
||||
method: 'POST',
|
||||
data: {
|
||||
id: this.params.id || 0
|
||||
id: this.params.id || 0,
|
||||
},
|
||||
dataType: 'json',
|
||||
success: res => {
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
@ -264,7 +265,7 @@
|
||||
is_already_coming: (data.user_signin_data || null) != null && (data.user_signin_data.current_day || 0) == 1 ? 1 : 0,
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: 0,
|
||||
data_bottom_line_status: true
|
||||
data_bottom_line_status: true,
|
||||
});
|
||||
|
||||
if ((this.data || null) != null) {
|
||||
@ -275,15 +276,15 @@
|
||||
desc: this.data.seo_desc,
|
||||
path: '/pages/plugins/signin/index-detail/index-detail',
|
||||
query: 'id=' + this.data.id,
|
||||
img: this.data.bg_images || this.data.logo || ''
|
||||
}
|
||||
img: this.data.bg_images || this.data.logo || '',
|
||||
},
|
||||
});
|
||||
}
|
||||
} 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,
|
||||
});
|
||||
}
|
||||
// 分享菜单处理
|
||||
@ -294,16 +295,16 @@
|
||||
this.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: '服务器请求出错'
|
||||
data_list_loding_msg: '服务器请求出错',
|
||||
});
|
||||
app.globalData.showToast('服务器请求出错');
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 初始化
|
||||
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)) {
|
||||
@ -312,14 +313,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 {
|
||||
return true;
|
||||
@ -335,22 +336,22 @@
|
||||
}
|
||||
if (this.is_already_coming != 1 && this.init()) {
|
||||
uni.showLoading({
|
||||
title: '处理中...'
|
||||
title: '处理中...',
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("coming", "index", "signin"),
|
||||
url: app.globalData.get_request_url('coming', 'index', 'signin'),
|
||||
method: 'POST',
|
||||
data: {
|
||||
id: this.data.id
|
||||
id: this.data.id,
|
||||
},
|
||||
dataType: 'json',
|
||||
success: res => {
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
this.setData({
|
||||
is_already_coming: 1,
|
||||
is_success_tips: 1,
|
||||
coming_integral: res.data.data
|
||||
coming_integral: res.data.data,
|
||||
});
|
||||
this.get_data();
|
||||
} else {
|
||||
@ -362,7 +363,7 @@
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
app.globalData.showToast('服务器请求出错');
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
@ -370,7 +371,7 @@
|
||||
// 签到成功提示关闭
|
||||
coming_success_close_event(e) {
|
||||
this.setData({
|
||||
is_success_tips: 0
|
||||
is_success_tips: 0,
|
||||
});
|
||||
},
|
||||
|
||||
@ -378,14 +379,14 @@
|
||||
team_event(e) {
|
||||
if (this.init()) {
|
||||
uni.showLoading({
|
||||
title: '处理中...'
|
||||
title: '处理中...',
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("team", "userqrcode", "signin"),
|
||||
url: app.globalData.get_request_url('team', 'userqrcode', 'signin'),
|
||||
method: 'POST',
|
||||
data: {},
|
||||
dataType: 'json',
|
||||
success: res => {
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
switch (res.data.data.status) {
|
||||
@ -395,16 +396,16 @@
|
||||
var temp_params = this.params;
|
||||
temp_params['id'] = res.data.data.qrcode_id;
|
||||
this.setData({
|
||||
params: temp_params
|
||||
params: temp_params,
|
||||
});
|
||||
|
||||
// 重新拉取数据
|
||||
this.get_data();
|
||||
break;
|
||||
// 需要填写联系人信息
|
||||
// 需要填写联系人信息
|
||||
case 1:
|
||||
uni.navigateTo({
|
||||
url: '/pages/plugins/signin/user-qrcode-saveinfo/user-qrcode-saveinfo?id=' + res.data.data.qrcode_id + '&is_team=1'
|
||||
url: '/pages/plugins/signin/user-qrcode-saveinfo/user-qrcode-saveinfo?id=' + res.data.data.qrcode_id + '&is_team=1',
|
||||
});
|
||||
break;
|
||||
}
|
||||
@ -417,7 +418,7 @@
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
app.globalData.showToast('服务器请求出错');
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
@ -425,10 +426,16 @@
|
||||
// 打开url
|
||||
url_event(e) {
|
||||
app.globalData.url_event(e);
|
||||
}
|
||||
}
|
||||
},
|
||||
// 分享开启弹层
|
||||
share_event(e) {
|
||||
if ((this.$refs.share || null) != null) {
|
||||
this.$refs.share.init();
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './index-detail.css';
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@ -1,6 +0,0 @@
|
||||
/*
|
||||
* 组队签到
|
||||
*/
|
||||
.user-team-container {
|
||||
padding-top: 35%;
|
||||
}
|
||||
@ -1,250 +0,0 @@
|
||||
<template>
|
||||
<view>
|
||||
<scroll-view :scroll-y="true" class="scroll-box" @scrolltolower="scroll_lower" lower-threshold="60">
|
||||
<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">
|
||||
<text class="cr-base">{{ item.add_time }}</text>
|
||||
<text class="fr cr-main">{{ item.is_enable_name }}</text>
|
||||
</view>
|
||||
<view class="content margin-top">
|
||||
<navigator :url="'/pages/plugins/signin/user-qrcode-detail/user-qrcode-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 class="item-operation tr br-t padding-top-main margin-top-main">
|
||||
<button class="round bg-white cr-base br" type="default" size="mini" hover-class="none" :data-value="item.id" @tap="show_event">签到</button>
|
||||
<button v-if="(data_base.is_team_show_coming_user || 0) == 1" class="round bg-white cr-main br-main" type="default" size="mini" hover-class="none" :data-value="item.id" @tap="coming_event">用户</button>
|
||||
<button class="round bg-white cr-green br-green" type="default" size="mini" hover-class="none" :data-value="item.id" @tap="edit_event">编辑</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:else>
|
||||
<view v-if="(data_base || null) != null && (data_base.is_team || 0) == 1" class="user-team-container padding-horizontal-main tc">
|
||||
<button class="cr-white bg-green br-green text-size auto round" type="default" hover-class="none" @tap="team_event">组队签到</button>
|
||||
<view class="cr-base margin-top-xxxl">组队分享让更多人参与签到、获得更多积分奖励</view>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status"></component-no-data>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</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 {
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false,
|
||||
data_is_loading: 0,
|
||||
params: null,
|
||||
data_base: null,
|
||||
data_list: [],
|
||||
data_total: 0,
|
||||
data_page_total: 0,
|
||||
data_page: 1,
|
||||
content_list: [
|
||||
{ name: "邀请人奖励", field: "reward_master", unit: "积分" },
|
||||
{ name: "受邀人奖励", field: "reward_invitee", 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,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
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: "加载中...",
|
||||
});
|
||||
|
||||
// 获取数据
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("index", "userqrcode", "signin"),
|
||||
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_base: res.data.data.base || null,
|
||||
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();
|
||||
},
|
||||
|
||||
// 查看详情
|
||||
show_event(e) {
|
||||
var value = e.currentTarget.dataset.value;
|
||||
uni.navigateTo({
|
||||
url: "/pages/plugins/signin/index-detail/index-detail?id=" + value,
|
||||
});
|
||||
},
|
||||
|
||||
// 签到用户
|
||||
coming_event(e) {
|
||||
var value = e.currentTarget.dataset.value;
|
||||
uni.navigateTo({
|
||||
url: "/pages/plugins/signin/user-coming-list/user-coming-list?id=" + value,
|
||||
});
|
||||
},
|
||||
|
||||
// 编辑
|
||||
edit_event(e) {
|
||||
var value = e.currentTarget.dataset.value;
|
||||
uni.navigateTo({
|
||||
url: "/pages/plugins/signin/user-qrcode-saveinfo/user-qrcode-saveinfo?id=" + value,
|
||||
});
|
||||
},
|
||||
|
||||
// 组队签到
|
||||
team_event(e) {
|
||||
uni.navigateTo({
|
||||
url: "/pages/plugins/signin/user-qrcode-saveinfo/user-qrcode-saveinfo",
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import "./user-qrcode.css";
|
||||
</style>
|
||||
@ -1,194 +0,0 @@
|
||||
<template>
|
||||
<view>
|
||||
<scroll-view :scroll-y="true" class="scroll-box" @scrolltolower="scroll_lower" lower-threshold="60">
|
||||
<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">
|
||||
<block v-for="(fv, fi) in content_list" :key="fi">
|
||||
<view class="single-text margin-top-xs">
|
||||
<text class="cr-grey margin-right-xl">{{ fv.name }}</text>
|
||||
<text class="cr-base">{{ item[fv.field] }}</text>
|
||||
<text v-if="(fv.unit || null) != null" class="cr-grey">{{ fv.unit }}</text>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
<view wx: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>
|
||||
</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,
|
||||
content_list: [
|
||||
{ name: "奖励积分", field: "integral" },
|
||||
{ name: "签到时间", field: "add_time" },
|
||||
],
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
},
|
||||
props: {},
|
||||
|
||||
onLoad(params) {
|
||||
this.setData({
|
||||
params: params,
|
||||
});
|
||||
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: "加载中...",
|
||||
});
|
||||
|
||||
// 获取数据
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("index", "usersignin", "signin"),
|
||||
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_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();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style></style>
|
||||
@ -2,19 +2,6 @@
|
||||
* 导航
|
||||
*/
|
||||
.nav .item {
|
||||
width: calc(50% - 70rpx);
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
.nav .item:nth-child(2n) {
|
||||
margin-right: 20rpx;
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
.nav .item:nth-child(2n+1) {
|
||||
margin-left: 20rpx;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
.nav .item image {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
margin: 0 auto;
|
||||
height: 74rpx;
|
||||
line-height: 74rpx;
|
||||
}
|
||||
@ -1,22 +1,29 @@
|
||||
<template>
|
||||
<view>
|
||||
<view v-if="(data_base || null) != null">
|
||||
<!-- 导航 -->
|
||||
<view v-if="nav_list.length > 0" class="nav oh padding-top-main">
|
||||
<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 v-if="(data_base.signin_desc || null) != null && data_base.signin_desc.length > 0" class="padding-horizontal-main padding-vertical-sm bg-white">
|
||||
<uni-notice-bar class="padding-0 margin-0" show-icon scrollable :text="data_base.signin_desc.join('')" background-color="transparent" color="#666" />
|
||||
</view>
|
||||
|
||||
<!-- 通知 -->
|
||||
<view v-if="(data_base.signin_desc || null) != null && data_base.signin_desc.length > 0" class="padding-horizontal-main padding-bottom-main">
|
||||
<view class="notice-content">
|
||||
<view v-for="(item, index) in data_base.signin_desc" :key="index" class="item">{{item}}</view>
|
||||
<!-- 导航 -->
|
||||
<view v-if="nav_list.length > 0" class="nav oh bg-white">
|
||||
<view class="flex-row jc-sa align-c">
|
||||
<block v-for="(item, index) in nav_list" :key="index">
|
||||
<view class="item text-size-md" :data-index="index" @tap="nav_change">
|
||||
<view class="pr" :class="current === index ? 'cr-main nav-active-line fw-b' : ''">
|
||||
{{ item.title }}
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 明细 -->
|
||||
<view class="nav-detail margin-bottom-lg">
|
||||
<view v-if="current === 0">
|
||||
<component-user-signin :prop-pull-down-refresh="propPullDownRefresh" :prop-scroll-lower="scroll_lower_bool"></component-user-signin>
|
||||
</view>
|
||||
<view v-if="current === 1">
|
||||
<component-user-qrcode :prop-pull-down-refresh="propPullDownRefresh" :prop-scroll-lower="scroll_lower_bool"></component-user-qrcode>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -28,7 +35,9 @@
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentNoData from "../../../../components/no-data/no-data";
|
||||
import componentNoData from '@/components/no-data/no-data';
|
||||
import componentUserSignin from '@/components/signin/user-signin/user-signin';
|
||||
import componentUserQrcode from '@/components/signin/user-qrcode/user-qrcode';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@ -37,16 +46,32 @@
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
data_base: null,
|
||||
nav_list: []
|
||||
nav_list: [],
|
||||
// 钱包明细
|
||||
params: null,
|
||||
current: 0,
|
||||
propPullDownRefresh: false,
|
||||
scroll_lower_bool: false,
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentNoData
|
||||
componentNoData,
|
||||
componentUserSignin,
|
||||
componentUserQrcode,
|
||||
},
|
||||
props: {},
|
||||
|
||||
onLoad(params) {},
|
||||
onLoad(params) {
|
||||
// 是否指定状态
|
||||
if ((params.type || null) != null) {
|
||||
this.setData({
|
||||
params: params,
|
||||
current: Number(params.type),
|
||||
});
|
||||
}
|
||||
this.init();
|
||||
},
|
||||
|
||||
onShow() {
|
||||
this.init();
|
||||
@ -58,11 +83,14 @@
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.get_data();
|
||||
this.setData({
|
||||
propPullDownRefresh: !this.propPullDownRefresh,
|
||||
});
|
||||
},
|
||||
|
||||
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 +99,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 +117,11 @@
|
||||
// 获取数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("center", "user", "signin"),
|
||||
url: app.globalData.get_request_url('center', 'user', 'signin'),
|
||||
method: 'POST',
|
||||
data: {},
|
||||
dataType: 'json',
|
||||
success: res => {
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
@ -102,13 +130,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 +148,30 @@
|
||||
this.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: '服务器请求出错'
|
||||
data_list_loding_msg: '服务器请求出错',
|
||||
});
|
||||
app.globalData.showToast('服务器请求出错');
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
// 明细导航切换
|
||||
nav_change(e) {
|
||||
this.setData({
|
||||
current: e.currentTarget.dataset.index || 0,
|
||||
});
|
||||
var newurl = app.globalData.updateQueryStringParameter(window.location.href.split('?')[0], 'type', e.currentTarget.dataset.index + '');
|
||||
//向当前url添加参数,没有历史记录
|
||||
window.history.replaceState({ path: newurl }, '', newurl);
|
||||
},
|
||||
// 滚动加载
|
||||
scroll_lower(e) {
|
||||
this.setData({
|
||||
scroll_lower_bool: !this.scroll_lower_bool,
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
<style scoped>
|
||||
@import './user.css';
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@ -276,7 +276,7 @@
|
||||
});
|
||||
if (res.data.code == 0) {
|
||||
uni.redirectTo({
|
||||
url: '/pages/plugins/wallet/user/user?status=2',
|
||||
url: '/pages/plugins/wallet/user/user?type=2',
|
||||
});
|
||||
} else {
|
||||
if (app.globalData.is_login_check(res.data)) {
|
||||
|
||||
@ -101,7 +101,7 @@
|
||||
if (res.data.code == 0) {
|
||||
uni.setStorageSync(app.globalData.data.cache_page_pay_key, { order_ids: res.data.data.recharge_id });
|
||||
uni.redirectTo({
|
||||
url: '/pages/plugins/wallet/user/user?status=1',
|
||||
url: '/pages/plugins/wallet/user/user?type=1',
|
||||
});
|
||||
} else {
|
||||
if (app.globalData.is_login_check(res.data)) {
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
<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">
|
||||
<view v-if="is_realstore_top_nav_back == 1" class="nav-back padding-horizontal-main padding-top-sm round va-m pr top-sm cr-white" @tap="top_nav_left_back_event">
|
||||
<iconfont name="icon-tongyong-fanhui" size="32rpx"></iconfont>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
@ -115,6 +115,7 @@
|
||||
// 是否显示价格
|
||||
is_price_show: false,
|
||||
// 账户明细
|
||||
params: null,
|
||||
current: 0,
|
||||
propPullDownRefresh: false,
|
||||
scroll_lower_bool: false,
|
||||
@ -132,10 +133,10 @@
|
||||
|
||||
onLoad(params) {
|
||||
// 是否指定状态
|
||||
if ((params.status || null) != null) {
|
||||
if ((params.type || null) != null) {
|
||||
this.setData({
|
||||
params: params,
|
||||
current: Number(params.status),
|
||||
current: Number(params.type),
|
||||
});
|
||||
}
|
||||
this.init();
|
||||
@ -230,6 +231,9 @@
|
||||
this.setData({
|
||||
current: e.currentTarget.dataset.index || 0,
|
||||
});
|
||||
var newurl = app.globalData.updateQueryStringParameter(window.location.href.split('?')[0], 'type', e.currentTarget.dataset.index + '');
|
||||
//向当前url添加参数,没有历史记录
|
||||
window.history.replaceState({ path: newurl }, '', newurl);
|
||||
},
|
||||
// 滚动加载
|
||||
scroll_lower(e) {
|
||||
@ -237,9 +241,20 @@
|
||||
scroll_lower_bool: !this.scroll_lower_bool,
|
||||
});
|
||||
},
|
||||
// 顶部返回操作
|
||||
top_nav_left_back_event(e) {
|
||||
var pages = getCurrentPages();
|
||||
if (pages.length <= 1) {
|
||||
uni.switchTab({
|
||||
url: app.globalData.data.tabbar_pages[0],
|
||||
});
|
||||
} else {
|
||||
uni.navigateBack();
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
<style scoped>
|
||||
@import './user.css';
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user