This commit is contained in:
sws
2023-09-11 10:01:49 +08:00
parent cc2319dd5c
commit ec07d1c3fe
18 changed files with 2291 additions and 2230 deletions

531
App.vue

File diff suppressed because it is too large Load Diff

View File

@ -6,7 +6,7 @@
<view :class="'padding-main '+(source_type != 'cart' ? 'bottom-line-exclude' : '')">
<uni-swipe-action>
<view v-for="(item, index) in data_list" :key="index" class="oh border-radius-main bg-white spacing-mb">
<uni-swipe-action-item :right-options="swipe_options" @click="swipe_opt_event" @change="swipe_change($event, index)">
<uni-swipe-action-item :right-options="swipe_options" @tap="swipe_opt_event" @change="swipe_change($event, index)">
<view class="flex-row align-c" :class="'cart-goods-item padding-main pr ' + (common_site_type == 1 ? 'cart-exhibition-mode-data' : '')">
<!-- 选择 -->
<view v-if="common_site_type != 1" @tap="selected_event" data-type="node" :data-index="index" class="cart-selected">

View File

@ -1,216 +1,217 @@
<template>
<view>
<view class="countdown" v-if="is_show && !is_end">
<block v-if="propMsecShow">
<view class="time" :style="time_style">{{msec}}</view>
<view class="ds" :style="ds_style">{{propSecondDs}}</view>
</block>
<view class="time" :style="time_style">{{second}}</view>
<view class="ds" :style="ds_style">{{propMinuteDs}}</view>
<view class="time" :style="time_style">{{minute}}</view>
<view class="ds" :style="ds_style">{{propHourDs}}</view>
<view class="time" :style="time_style">{{hour}}</view>
</view>
<view v-if="is_show && is_end" class="timer-title">{{propMsg}}</view>
</view>
<view>
<view class="countdown" v-if="is_show && !is_end">
<block v-if="propMsecShow">
<view class="time" :style="time_style">{{msec}}</view>
<view class="ds" :style="ds_style">{{propSecondDs}}</view>
</block>
<view class="time" :style="time_style">{{second}}</view>
<view class="ds" :style="ds_style">{{propMinuteDs}}</view>
<view class="time" :style="time_style">{{minute}}</view>
<view class="ds" :style="ds_style">{{propHourDs}}</view>
<view class="time" :style="time_style">{{hour}}</view>
</view>
<view v-if="is_show && is_end" class="timer-title">{{propMsg}}</view>
</view>
</template>
<script>
export default {
data() {
return {
hour: '00',
minute: '00',
second: '00',
msec: 0,
is_show: true,
is_end: false,
timer: null,
timers: null,
time_style: '',
ds_style: '',
};
},
components: {},
props: {
propHour: {
type: [String, Number],
default: '00'
},
propMinute: {
type: [String, Number],
default: '00'
},
propSecond: {
type: [String, Number],
default: '00'
},
propEndShow: {
type: Boolean,
default: false
},
propMsecShow: {
type: Boolean,
default: false
},
propMsg: {
type: String,
default: '已结束'
},
propHourDs: {
type: String,
default: ':'
},
propMinuteDs: {
type: String,
default: ':'
},
propSecondDs: {
type: String,
default: ':'
},
propTimePadding: {
type: [Number, String],
default: 0
},
propTimeSize: {
type: [Number, String],
default: 24
},
propTimeBackgroundColor: {
type: String,
default: ''
},
propTimeColor: {
type: String,
default: '#FFF'
},
propTimeWeight: {
type: [Number, String],
default: '400'
},
propDsColor: {
type: String,
default: '#4B5459'
},
propDsSize: {
type: [Number, String],
default: 24
},
propDsWeight: {
type: [Number, String],
default: '400'
}
},
created: function(e) {
// 样式拼接
this.time_style = 'padding: 0 ' + this.propTimePadding + 'rpx;background-color:' + this.propTimeBackgroundColor + ';color:' + this.propTimeColor + ';font-size:' + this.propTimeSize +
'rpx;font-weight:' + this.propTimeWeight;
this.ds_style = 'color:' + this.propDsColor + ';font-size:' + this.propDsSize + 'rpx;font-weight:' + this.propDsWeight;
export default {
data() {
return {
hour: '00',
minute: '00',
second: '00',
msec: 0,
is_show: true,
is_end: false,
timer: null,
timers: null,
};
},
components: {},
props: {
propHour: {
type: [String, Number],
default: '00'
},
propMinute: {
type: [String, Number],
default: '00'
},
propSecond: {
type: [String, Number],
default: '00'
},
propEndShow: {
type: Boolean,
default: false
},
propMsecShow: {
type: Boolean,
default: false
},
propMsg: {
type: String,
default: '已结束'
},
propHourDs: {
type: String,
default: ':'
},
propMinuteDs: {
type: String,
default: ':'
},
propSecondDs: {
type: String,
default: ':'
},
propTimePadding: {
type: [Number, String],
default: 0
},
propTimeSize: {
type: [Number, String],
default: 24
},
propTimeBackgroundColor: {
type: String,
default: 'linear-gradient(180deg, #FF601B 0%, #FE1B33 100%);'
},
propTimeColor: {
type: String,
default: '#FFF'
},
propTimeWeight: {
type: [Number, String],
default: '400'
},
propDsColor: {
type: String,
default: '#4B5459'
},
propDsSize: {
type: [Number, String],
default: 24
},
propDsWeight: {
type: [Number, String],
default: '400'
}
},
computed: {
time_style() {
return 'padding: 0 ' + this.propTimePadding + 'rpx;background-color:' + this.propTimeBackgroundColor + ';color:' + this.propTimeColor + ';font-size:' + this.propTimeSize +
'rpx;font-weight:' + this.propTimeWeight
},
ds_style() {
return 'color:' + this.propDsColor + ';font-size:' + this.propDsSize + 'rpx;font-weight:' + this.propDsWeight
}
},
created: function(e) {
// 参数处理
this.hour = this.propHour;
this.minute = this.propMinute;
this.second = this.propSecond;
// 参数处理
this.hour = this.propHour;
this.minute = this.propMinute;
this.second = this.propSecond;
// 定时处理
this.countdown()
},
// #ifndef VUE2
destroyed() {
clearInterval(this.timer);
clearInterval(this.timers);
},
// #endif
// #ifdef VUE3
unmounted() {
clearInterval(this.timer);
clearInterval(this.timers);
},
// #endif
methods: {
// 倒计时处理
countdown() {
// 销毁之前的任务
clearInterval(this.timer);
clearInterval(this.timers);
// 定时处理
this.countdown()
},
// #ifndef VUE2
destroyed() {
clearInterval(this.timer);
clearInterval(this.timers);
},
// #endif
// #ifdef VUE3
unmounted() {
clearInterval(this.timer);
clearInterval(this.timers);
},
// #endif
methods: {
// 倒计时处理
countdown() {
// 销毁之前的任务
clearInterval(this.timer);
clearInterval(this.timers);
// 秒
var self = this;
var hour = parseInt(self.hour);
var minute = parseInt(self.minute);
var second = parseInt(self.second);
self.timer = setInterval(function() {
if (second <= 0) {
if (minute > 0) {
minute--;
second = 59;
} else if (hour > 0) {
hour--;
minute = 59;
second = 59;
}
} else {
second--;
}
// 秒
var self = this;
var hour = parseInt(self.hour);
var minute = parseInt(self.minute);
var second = parseInt(self.second);
self.timer = setInterval(function() {
if (second <= 0) {
if (minute > 0) {
minute--;
second = 59;
} else if (hour > 0) {
hour--;
minute = 59;
second = 59;
}
} else {
second--;
}
self.hour = hour < 10 ? '0' + hour : hour;
self.minute = minute < 10 ? '0' + minute : minute;
self.second = second < 10 ? '0' + second : second;
if (self.propHour <= 0 && self.propMinute <= 0 && self.propSecond <= 0) {
// 停止时间
clearInterval(self.timer);
clearInterval(self.timers);
self.is_end = true;
self.hour = hour < 10 ? '0' + hour : hour;
self.minute = minute < 10 ? '0' + minute : minute;
self.second = second < 10 ? '0' + second : second;
if (self.propHour <= 0 && self.propMinute <= 0 && self.propSecond <= 0) {
// 停止时间
clearInterval(self.timer);
clearInterval(self.timers);
self.is_end = true;
// 活动已结束、是否结束还展示
if (!self.propEndShow) {
self.is_show = false;
}
}
}, 1000);
// 活动已结束、是否结束还展示
if (!self.propEndShow) {
self.is_show = false;
}
}
}, 1000);
// 毫秒
var count = 0;
self.timers = setInterval(function() {
count++;
self.msec = count;
if (count > 9) {
count = 0;
}
if (!self.is_show) {
clearInterval(self.timers);
}
}, 100);
}
}
};
// 毫秒
var count = 0;
self.timers = setInterval(function() {
count++;
self.msec = count;
if (count > 9) {
count = 0;
}
if (!self.is_show) {
clearInterval(self.timers);
}
}, 100);
}
}
};
</script>
<style>
.countdown {
line-height: 38rpx;
}
.countdown {
line-height: 38rpx;
}
.countdown view {
float: right;
}
.countdown view {
float: right;
}
.countdown .timer-title {
color: #666;
margin-right: 10rpx;
}
.countdown .timer-title {
color: #666;
margin-right: 10rpx;
}
.countdown .time {
padding: 0;
-moz-border-radius: 8rpx;
border-radius: 8rpx;
background: linear-gradient(180deg, #FF601B 0%, #FE1B33 100%);
color: #fff;
min-width: 40rpx;
text-align: center;
}
.countdown .time {
padding: 0;
-moz-border-radius: 8rpx;
border-radius: 8rpx;
color: #fff;
min-width: 40rpx;
text-align: center;
}
.countdown .ds {
color: #4B5459;
padding: 0 8rpx;
}
.countdown .ds {
color: #4B5459;
padding: 0 8rpx;
}
</style>

View File

@ -23,7 +23,7 @@
</view>
<view v-if="propData.is_operable == 1" class="card-type">
<!-- 按钮状态 1-领取2-已领取3-已抢完4-去使用,5-已使用6-已过期 -->
<view v-if="propData.type===1" class="card-btn dis-inline-block cr-white" @click="receive">{{propData.is_operable_name}}</view>
<view v-if="propData.type===1" class="card-btn dis-inline-block cr-white" @tap="receive">{{propData.is_operable_name}}</view>
<view v-else-if="propData.type==2" class="card-btn dis-inline-block cr-red br-red received">{{propData.is_operable_name}}</view>
<view v-else-if="propData.type==3" class="card-btn dis-inline-block cr-white robbed">{{propData.is_operable_name}}</view>
<navigator v-else-if="propData.type==4" :url="home_page_url" open-type="switchTab" hover-class="none">
@ -37,7 +37,7 @@
<view v-else-if="propData.type==6" class="card-image pa top-0 right-0">
<image :src="coupon_static_url + 'coupon-expire.png'" mode="scaleToFill"></image>
</view>
<view v-else @click="receive">暂无type参数</view>
<view v-else @tap="receive">暂无type参数</view>
</view>
</view>
<view class="card-circle-top" :style="{background:`${propBg}`}"></view>

View File

@ -1,5 +1,5 @@
<template>
<text class="iconfont" :class="name" :style="[{color: color},{'font-size':size}]" @click="$emit('click', $event)"></text>
<text class="iconfont" :class="name" :style="[{color: color},{'font-size':size}]" @tap="$emit('click', $event)"></text>
</template>
<script>

View File

@ -1,6 +1,6 @@
<template>
<view>
<view class="more cr-black padding-top-main padding-bottom-sm flex-row flex-warp align-c" @click="open_popup">
<view class="more cr-black padding-top-main padding-bottom-sm flex-row flex-warp align-c" @tap="open_popup">
<text>更多</text>
<iconfont name="icon-fenlei-more"></iconfont>
</view>
@ -11,7 +11,7 @@
<view class="divider-b">
<slot></slot>
</view>
<view class="tc padding-top-lg" @click="quick_close_event">
<view class="tc padding-top-lg" @tap="quick_close_event">
<text class="padding-right-sm">点击收起</text>
<iconfont name="icon-fenlei-top" color="#ccc"></iconfont>
</view>

View File

@ -16,7 +16,7 @@
<swiper-item v-for="(swiperItem,swiperIndex) in item.d" :key="swiperIndex">
<view class="swiper-item">
<view class="flex-row">
<view v-for="(listItem,listIndex) in swiperItem" :key="listIndex" class="flex-1" :class="swiperItem.length > 2 ? '' : 'flex-width-half'" @click="banner_event">
<view v-for="(listItem,listIndex) in swiperItem" :key="listIndex" class="flex-1" :class="swiperItem.length > 2 ? '' : 'flex-width-half'" @tap="banner_event">
<view class="padding-main">
<image src="@/static/images/common/user.png" mode="widthFix" class="wh-auto">
</image>

View File

@ -1,11 +1,11 @@
<template>
<view>
<view class="time-select-content" @click="_dataOpen">
<view class="time-select-content" @tap="_dataOpen">
<slot></slot>
</view>
<view :class="'time-select-popup-mask '+(propIsShow ? 'time-select-popup-show' : '')" @click="_maskClose">
<view :class="'time-select-popup-mask '+(propIsShow ? 'time-select-popup-show' : '')" @tap="_maskClose">
<view class="time-select-popup-content" @click.stop="_stopFunc">
<view class="time-select-close-btn" v-if="propCloseBtn" @click="_closeBtnClose">×</view>
<view class="time-select-close-btn" v-if="propCloseBtn" @tap="_closeBtnClose">×</view>
<view class="time-select-title">
<view v-if="(propTitle || null) != null">{{ propTitle }}</view>
<view v-if="(propSubhead || null) != null">{{ propSubhead }}</view>
@ -13,15 +13,15 @@
<view class="time-select-time-box">
<view class="left_box">
<block v-if="item.timeArr.length > 0" v-for="(item, index) in timeList" :key="item.dateStr">
<view @click="_changeDay(index)" :class="{ active: item.checked }">
<view @tap="_changeDay(index)" :class="{ active: item.checked }">
{{ item.name }}
</view>
</block>
</view>
<view class="right_box">
<view v-if="day_active_index == 0 && (propPlaceholder || null) != null" @click="_changeTime('')" :class="(time_active_index === '' ? 'active' : '')">{{propPlaceholder}}</view>
<view v-if="day_active_index == 0 && (propPlaceholder || null) != null" @tap="_changeTime('')" :class="(time_active_index === '' ? 'active' : '')">{{propPlaceholder}}</view>
<block v-for="(item, index) in activeTimeArr" :key="item.time">
<view @click="_changeTime(index)" :class="{ active: item.checked }">
<view @tap="_changeTime(index)" :class="{ active: item.checked }">
{{ item.time }}{{ propRangeType ? '-' + item.endtime : '' }}
</view>
</block>
@ -459,8 +459,8 @@ export default {
transform: none;
}
.time-select-popup-mask,
.time-select-popup-content {
transition: all 0.25s linear;
.time-select-popup-content {
transition: all 0.25s linear;
}
.time-select-title {
text-align: center;

2088
pages.json

File diff suppressed because it is too large Load Diff

View File

@ -2,21 +2,49 @@
* 秒杀导航
*/
.nav_seckill .item {
width: 176rpx;
padding: 26rpx 0;
width: 176rpx;
padding: 26rpx 0;
opacity: 0.5;
flex-basis: 176rpx;
flex-shrink: 0;
white-space: nowrap;
}
.nav_seckill .item.active {
opacity: 1;
}
.nav_seckill .item .time {
line-height: 50rpx;
line-height: 50rpx;
}
.nav_seckill .item .state {
margin-top: 4rpx;
padding: 0 14rpx;
display: inline-flex;
margin-top: 4rpx;
padding: 0 14rpx;
display: inline-flex;
}
.nav_seckill .item .state.active {
font-size: 22rpx;
background-color: #fff;
.nav_seckill .item.active .state {
font-size: 22rpx;
background-color: #fff;
}
/**
* 规则弹窗
*/
.rule {
padding: 42rpx 26rpx;
max-height: 50vh;
}
.rule .item {
padding-bottom: 100rpx;
max-height: calc(50vh - 164rpx);
}
.rule button {
margin: 20rpx 30rpx 42rpx 30rpx;
height: 80rpx;
line-height: 80rpx;
}

View File

@ -1,198 +1,242 @@
<template>
<view>
<view v-if="(data_base || null) != null" :style="seckill_bg">
<!-- 秒杀时段 -->
<scroll-view :scroll-x="true" :scroll-with-animation="true" :scroll-into-view="'one-nav-item-'+nav_active_index" class="top-nav-scroll">
<view class="nav_seckill flex-row flex-nowrap bg-main cr-white">
<view v-for="(item, index) in periods_list" :key="index" class="item tc cp text-size-xss" :id="'one-nav-item-'+index" :data-index="index" @tap="nav_event">
<view class="time text-size-lg">{{item.name}}</view>
<view class="state text-size-xs round" :class="item.time.status === 1 ? 'active cr-main' : ''">{{item.time.msg}}</view>
</view>
</view>
</scroll-view>
<view class="padding-horizontal-main padding-top-main">
<!-- 公告信息 -->
<view v-if="(data_base.content_notice || null) != null && data_base.content_notice.length > 0" class="spacing-mb">
<view class="notice-content">
<view v-for="(item, index) in data_base.content_notice" :key="index" class="item">{{item}}</view>
</view>
</view>
<view>
<view v-if="(data_base || null) != null" :style="seckill_bg">
<!-- 秒杀时段 -->
<scroll-view :scroll-x="true" :scroll-with-animation="true" :scroll-into-view="'one-nav-item-'+nav_active_index" class="top-nav-scroll wh-auto bg-main">
<view class="nav_seckill flex-row flex-nowrap cr-white">
<view v-for="(item, index) in periods_list" :key="index" class="item tc cp text-size-xss" :class="nav_active_index === index ? 'active' : ''" :id="'one-nav-item-'+index"
:data-index="index" :data-text="item.time.time_first_text" :data-status="item.time.status" @tap="nav_event">
<view class="time text-size-lg">{{item.name}}</view>
<view class="state text-size-xs round" :class="nav_active_index === index ? 'cr-main' : ''">{{item.time.msg}}</view>
</view>
</view>
</scroll-view>
<view class="padding-horizontal-main padding-top-main">
<!-- 基础信息倒计时 -->
<view class="oh spacing-mb flex-row jc-sb align-c">
<view>
<text :class="'va-m text-size-xs fw-b cr-blak '+(is_valid == 1 ? 'cr-base' : 'cr-red')">{{time_first_text}}</text>
<view v-if="is_valid == 1" class="dis-inline-block va-m margin-left-sm">
<component-countdown :propHour="time.hours" :propMinute="time.minutes" :propSecond="time.seconds"
:prop-time-background-color="seckill_status === 1 ? '#E22C08': '#333333'"></component-countdown>
</view>
</view>
<view class="text-size-xs cr-blak">
活动规则
<iconfont v-if="(data_base.content_notice || null) != null && data_base.content_notice.length > 0" name="icon-mendian-kefu" size="26rpx" class="margin-left-xs" color="#999"
@tap="quick_open_event"></iconfont>
</view>
</view>
<!-- 基础信息倒计时 -->
<view class="oh spacing-mb">
<text :class="'va-m '+(is_valid == 1 ? 'cr-base' : 'cr-red')">{{time.msg}}</text>
<view v-if="is_valid == 1" class="dis-inline-block va-m margin-left-sm">
<component-countdown :propHour="time.hours" :propMinute="time.minutes" :propSecond="time.seconds"></component-countdown>
</view>
</view>
<!-- 商品 -->
<view v-if="goods.length > 0">
<component-goods-list :propData="{style_type: 1, goods_list: goods}" :propCurrencySymbol="currency_symbol" propPriceField="seckill_min_price"></component-goods-list>
</view>
<view v-else>
<!-- 提示信息 -->
<component-no-data propStatus="0" propMsg="没有相关商品"></component-no-data>
</view>
</view>
<!-- 商品 -->
<view v-if="goods.length > 0">
<component-goods-list :propData="{style_type: 1, goods_list: goods}" :propCurrencySymbol="currency_symbol" propPriceField="seckill_min_price"></component-goods-list>
</view>
<view v-else>
<!-- 提示信息 -->
<component-no-data propStatus="0" propMsg="没有相关商品"></component-no-data>
</view>
</view>
<!-- 结尾 -->
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
</view>
<view v-else>
<!-- 提示信息 -->
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
</view>
</view>
<!-- 结尾 -->
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
<!-- 弹窗 -->
<component-popup v-if="(data_base.content_notice || null) != null && data_base.content_notice.length > 0" :propShow="popup_status" :propIsBar="propIsBar" propPosition="bottom"
@onclose="quick_close_event">
<view class="rule">
<view class="title cr-black text-size-md fw-b margin-bottom-main tc">活动规则</view>
<scroll-view :scroll-y="true" class="item">
<view v-for="(item, index) in data_base.content_notice" :key="index" class="cr-grey text-size-md">{{item}}</view>
</scroll-view>
<button type="default" class="bg-main cr-white round text-size-md pa bottom-0 left-0 right-0" @tap="quick_open_event">知道了</button>
</view>
</component-popup>
</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 componentCountdown from "../../../../components/countdown/countdown";
import componentNoData from "../../../../components/no-data/no-data";
import componentBottomLine from "../../../../components/bottom-line/bottom-line";
import componentGoodsList from "../../../../components/goods-list/goods-list";
const app = getApp();
import componentCountdown from "../../../../components/countdown/countdown";
import componentNoData from "../../../../components/no-data/no-data";
import componentBottomLine from "../../../../components/bottom-line/bottom-line";
import componentGoodsList from "../../../../components/goods-list/goods-list";
import componentPopup from "../../../../components/popup/popup";
var seckill_static_url = app.globalData.get_static_url('seckill', true);
export default {
data() {
return {
seckill_bg: 'background: url(' + seckill_static_url + 'header-bg.png) top/100% no-repeat;',
data_bottom_line_status: false,
data_list_loding_status: 1,
data_list_loding_msg: '',
currency_symbol: app.globalData.data.currency_symbol,
data_base: null,
// 秒杀时段
periods_list: [],
current: null,
time: null,
goods: [],
is_valid: 0,
// 自定义分享信息
share_info: {},
// nav滚动下标
nav_active_index: 0
};
},
var seckill_static_url = app.globalData.get_static_url('seckill', true);
export default {
data() {
return {
seckill_bg: 'background: url(' + seckill_static_url + 'header-bg.png) top/100% no-repeat;',
data_bottom_line_status: false,
data_list_loding_status: 1,
data_list_loding_msg: '',
currency_symbol: app.globalData.data.currency_symbol,
data_base: null,
// 秒杀时段
periods_list: [],
current: null,
time: null,
goods: [],
is_valid: 0,
// 自定义分享信息
share_info: {},
// nav滚动下标
nav_active_index: 0,
// 规则弹窗
popup_status: false,
propIsBar: false,
// 倒计时标题
time_first_text: '',
// 抢购状态
// status 0未开始, 1进行中(距离结束还有), 2已结束, 3异常错误
seckill_status: 0,
};
},
components: {
componentCountdown,
componentNoData,
componentBottomLine,
componentGoodsList
},
props: {},
components: {
componentCountdown,
componentNoData,
componentBottomLine,
componentGoodsList,
componentPopup
},
props: {},
onLoad() {},
onLoad() {},
onShow() {
// 初始化配置
this.init_config();
onShow() {
// 初始化配置
this.init_config();
// 获取数据
this.get_data();
},
// 获取数据
this.get_data();
},
// 下拉刷新
onPullDownRefresh() {
this.get_data();
},
// 下拉刷新
onPullDownRefresh() {
this.get_data();
},
methods: {
// 初始化配置
init_config(status) {
if ((status || false) == true) {
this.setData({
currency_symbol: app.globalData.get_config('currency_symbol'),
});
} else {
app.globalData.is_config(this, 'init_config');
}
},
methods: {
// 初始化配置
init_config(status) {
if ((status || false) == true) {
this.setData({
currency_symbol: app.globalData.get_config('currency_symbol'),
});
} else {
app.globalData.is_config(this, 'init_config');
}
},
// 获取数据
get_data() {
uni.request({
url: app.globalData.get_request_url("index", "index", "seckill"),
method: 'POST',
data: {},
dataType: 'json',
success: res => {
uni.stopPullDownRefresh();
if (res.data.code == 0) {
var data = res.data.data;
var data_base = data.config || null;
var current = data.current || null;
var time = (current == null) ? null : current.time || null;
var goods = (current == null) ? [] : (current.goods || []);
var is_valid = (time == null) ? 0 : (time.status == 1 ? 1 : 0);
if (goods.length > 0) {
for (var i in goods) {
goods[i]['price_icon'] = (is_valid == 1) ? (current.goods_detail_icon || '秒杀价') : '';
}
}
this.setData({
periods_list: data.periods_list,
data_base: data_base,
current: current,
time: time,
goods: goods,
is_valid: is_valid,
data_list_loding_msg: '',
data_list_loding_status: 0,
data_bottom_line_status: (goods.length > 0)
});
console.log(this.periods_list);
// 获取数据
get_data() {
uni.request({
url: app.globalData.get_request_url("index", "index", "seckill"),
method: 'POST',
data: {},
dataType: 'json',
success: res => {
uni.stopPullDownRefresh();
if (res.data.code == 0) {
var data = res.data.data;
var data_base = data.config || null;
var current = data.current || null;
var time = (current == null) ? null : current.time || null;
var goods = (current == null) ? [] : (current.goods || []);
var is_valid = (time == null) ? 0 : (time.status == 1 ? 1 : 0);
if (goods.length > 0) {
for (var i in goods) {
goods[i]['price_icon'] = (is_valid == 1) ? (current.goods_detail_icon || '秒杀价') : '';
}
}
this.setData({
periods_list: data.periods_list,
data_base: data_base,
current: current,
time: time,
time_first_text: time.time_first_text,
seckill_status: time.status,
goods: goods,
is_valid: is_valid,
data_list_loding_msg: '',
data_list_loding_status: 0,
data_bottom_line_status: (goods.length > 0)
});
if ((this.data_base || null) != null) {
// 基础自定义分享
this.setData({
share_info: {
title: this.data_base.seo_title || this.data_base.application_name,
desc: this.data_base.seo_desc,
path: '/pages/plugins/seckill/index/index',
img: ((this.slider || null) != null && this.slider.length > 0) ? this.slider[0]['images_url'] : ''
}
});
if ((this.data_base || null) != null) {
// 基础自定义分享
this.setData({
share_info: {
title: this.data_base.seo_title || this.data_base.application_name,
desc: this.data_base.seo_desc,
path: '/pages/plugins/seckill/index/index',
img: ((this.slider || null) != null && this.slider.length > 0) ? this.slider[0]['images_url'] : ''
}
});
// 导航名称
if ((this.data_base.application_name || null) != null) {
uni.setNavigationBarTitle({
title: this.data_base.application_name
});
}
}
} else {
this.setData({
data_bottom_line_status: false,
data_list_loding_status: 2,
data_list_loding_msg: res.data.msg
});
}
// 导航名称
if ((this.data_base.application_name || null) != null) {
uni.setNavigationBarTitle({
title: this.data_base.application_name
});
}
}
} else {
this.setData({
data_bottom_line_status: false,
data_list_loding_status: 2,
data_list_loding_msg: res.data.msg
});
}
// 分享菜单处理
app.globalData.page_share_handle(this.share_info);
},
fail: () => {
uni.stopPullDownRefresh();
this.setData({
data_bottom_line_status: false,
data_list_loding_status: 2,
data_list_loding_msg: '服务器请求出错'
});
app.globalData.showToast('服务器请求出错');
}
});
},
nav_event(e) {
let index = e.currentTarget.dataset.index;
this.setData({
nav_active_index: index
});
}
}
};
// 分享菜单处理
app.globalData.page_share_handle(this.share_info);
},
fail: () => {
uni.stopPullDownRefresh();
this.setData({
data_bottom_line_status: false,
data_list_loding_status: 2,
data_list_loding_msg: '服务器请求出错'
});
app.globalData.showToast('服务器请求出错');
}
});
},
nav_event(e) {
let index = e.currentTarget.dataset.index;
let time_first_text = e.currentTarget.dataset.text;
let seckill_status = e.currentTarget.dataset.status;
this.setData({
nav_active_index: index,
time_first_text: time_first_text,
seckill_status: seckill_status,
goods: this.periods_list[index].goods
});
},
// 弹层开启
quick_open_event(e) {
this.setData({
popup_status: true
});
},
// 弹层关闭
quick_close_event(e) {
this.setData({
popup_status: false
});
},
}
};
</script>
<style scoped>
@import './index.css';
@import './index.css';
</style>

View File

@ -1,436 +1,441 @@
<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>
<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">
<iconfont name="icon-qiandao-fenxiang" class="pr top-sm" size="32rpx"></iconfont>
分享
</button>
</view>
<view v-if="(data_base.is_team || 0) == 1 && (user || null) != null && data.user_id != user.id" class="team oh flex-row" @tap="team_event">
<view class="content">
<iconfont name="icon-qiandao-zudui" class="pr top-xs" size="34rpx"></iconfont>
组队
</view>
</view>
</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-else>
立即签到
<iconfont name="icon-qiandao-jiantou" color="#fff" size="32rpx" class="margin-left-sm"></iconfont>
</block>
</view>
</view>
<view class="signin-container">
<view v-if="(data || null) != null">
<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">
<iconfont name="icon-qiandao-fenxiang" class="pr top-sm" size="32rpx"></iconfont>
分享
</button>
</view>
<view v-if="(data_base.is_team || 0) == 1 && (user || null) != null && data.user_id != user.id" class="team oh flex-row" @tap="team_event">
<view class="content">
<iconfont name="icon-qiandao-zudui" class="pr top-xs" size="34rpx"></iconfont>
组队
</view>
</view>
</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-else>
立即签到
<iconfont name="icon-qiandao-jiantou" color="#fff" size="32rpx" class="margin-left-sm"></iconfont>
</block>
</view>
</view>
<view class="padding-horizontal-main padding-bottom-xxxl">
<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}}
</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">
<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>
</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">
<block v-if="col.today">
<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>
<text class="fw-b">今天</text>
</block>
</block>
<block v-else>
<block v-if="col.is_signin">
<iconfont name="icon-qiandao-yixuan" size="48rpx"></iconfont>
</block>
<block v-else>
{{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>
<!-- 判断是组队签到还是个人签到 -->
<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>
<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">
<iconfont name="icon-qiandao-jiantou2"></iconfont>
</navigator>
</view>
</view>
</view>
<view class="padding-horizontal-main padding-bottom-xxxl">
<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}}
</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">
<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>
</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">
<block v-if="col.today">
<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>
<text class="fw-b">今天</text>
</block>
</block>
<block v-else>
<block v-if="col.is_signin">
<iconfont name="icon-qiandao-yixuan" size="48rpx"></iconfont>
</block>
<block v-else>
{{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>
<!-- 判断是组队签到还是个人签到 -->
<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>
<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">
<iconfont name="icon-qiandao-jiantou2"></iconfont>
</navigator>
</view>
</view>
</view>
<!-- 公告信息 -规则说明 -->
<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>
</view>
</view>
</view>
<!-- 公告信息 -规则说明 -->
<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>
</view>
</view>
</view>
<!-- 签到成功提示信息 -->
<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>
<view class="title">签到成功</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>
</view>
<view v-else>
<!-- 提示信息 -->
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
</view>
</view>
<!-- 签到成功提示信息 -->
<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>
<view class="title">签到成功</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>
</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";
var signin_static_url = app.globalData.get_static_url("signin", true) + 'app/';
export default {
data() {
return {
signin_static_url: signin_static_url,
// 首页地址
home_page_url: app.globalData.data.tabbar_pages[0],
data_bottom_line_status: false,
data_list_loding_status: 1,
data_list_loding_msg: '',
currency_symbol: app.globalData.data.currency_symbol,
params: null,
user: null,
data_base: null,
data: null,
team_signin_data: null,
user_signin_data: null,
is_already_coming: 0,
is_success_tips: 0,
coming_integral: 0,
// 自定义分享信息
share_info: {},
// 周数
week: ['日', '一', '二', '三', '四', '五', '六'],
// 年
year: new Date().getFullYear(),
// 月
month: new Date().getMonth() + 1,
// 日
date: new Date().getDate(),
// 日期
calendar: new Date().getFullYear() + '年' + (new Date().getMonth() + 1) + '月' + new Date().getDate() + '日',
// 本月日历总天数
day_count: [],
};
},
const app = getApp();
import componentNoData from "../../../../components/no-data/no-data";
var signin_static_url = app.globalData.get_static_url("signin", true) + 'app/';
export default {
data() {
return {
signin_static_url: signin_static_url,
// 首页地址
home_page_url: app.globalData.data.tabbar_pages[0],
data_bottom_line_status: false,
data_list_loding_status: 1,
data_list_loding_msg: '',
currency_symbol: app.globalData.data.currency_symbol,
params: null,
user: null,
data_base: null,
data: null,
team_signin_data: null,
user_signin_data: null,
is_already_coming: 0,
is_success_tips: 0,
coming_integral: 0,
// 自定义分享信息
share_info: {},
// 周数
week: ['日', '一', '二', '三', '四', '五', '六'],
// 年
year: new Date().getFullYear(),
// 月
month: new Date().getMonth() + 1,
// 日
date: new Date().getDate(),
// 日期
calendar: new Date().getFullYear() + '年' + (new Date().getMonth() + 1) + '月' + new Date().getDate() + '日',
// 本月日历总天数
day_count: [],
};
},
components: {
componentNoData,
},
props: {},
computed: {
days_in_month() {
const date = new Date(this.year, this.month, 0)
return date.getDate()
}
},
components: {
componentNoData,
},
props: {},
computed: {
days_in_month() {
const date = new Date(this.year, this.month, 0)
return date.getDate()
}
},
onLoad(params) {
//params['id'] = 1;
this.setData({
params: params
});
},
onLoad(params) {
//params['id'] = 1;
this.setData({
params: params
});
},
onShow() {
// 用户信息
this.setData({
user: app.globalData.get_user_cache_info()
});
// 获取数据
this.get_data();
// 日历渲染
this.get_calendar();
},
onShow() {
// 用户信息
this.setData({
user: app.globalData.get_user_cache_info()
});
// 获取数据
this.get_data();
// 日历渲染
this.get_calendar();
},
// 下拉刷新
onPullDownRefresh() {
this.get_data();
},
methods: {
// 获取日历数据
get_calendar() {
const first_day = new Date(this.year, this.month - 1, 1).getDay();
const last_day = this.days_in_month;
const days = [];
let day = [];
// 上月计数
const first_day_week = new Date().getDay();
var defore_days = new Date(this.year, this.month, 0).getDate(); //上月天数
for (var i = first_day_week - 1; i > 0; i--) {
// 上个月计数
day.push({
num: defore_days - i,
class: 'cr-grey-c',
today: false,
is_signin: false
});
}
// 本月计数
for (let i = 1; i <= last_day; i++) {
// 判断bool是否存在数组signinHistory中 【 true则表示存在于数组中】
var bool = false;
if (this.user_signin_data) {
bool = this.user_signin_data.history_day.some(item => Number(item) === i);
}
// 获取当天日期
var today = new Date().getDate();
day.push({
num: i,
class: 'cr-black',
today: i === today ? true : false,
is_signin: bool ? true : false
});
if (day.length === 7) {
days.push(day);
day = [];
}
}
// 本月计数
if (day.length > 0) {
for (let i = day.length; i < 7; i++) {
day.push({
num: i,
class: 'cr-grey-c',
today: false,
is_signin: false
});
}
days.push(day);
}
this.day_count = days;
},
// 点击日期
handle_day() {
// 下拉刷新
onPullDownRefresh() {
this.get_data();
},
methods: {
// 获取日历数据
get_calendar() {
const first_day = new Date(this.year, this.month - 1, 1).getDay();
const last_day = this.days_in_month;
const days = [];
let day = [];
// 上月计数
const first_day_week = new Date().getDay();
var defore_days = new Date(this.year, this.month, 0).getDate(); //上月天数
for (var i = first_day_week - 1; i > 0; i--) {
// 上个月计数
day.push({
num: defore_days - i,
class: 'cr-grey-c',
today: false,
is_signin: false
});
}
console.log(first_day_week);
console.log(day);
// 本月计数
for (let i = 1; i <= last_day; i++) {
// 判断bool是否存在数组signinHistory中 【 true则表示存在于数组中】
var bool = false;
if (this.user_signin_data) {
bool = this.user_signin_data.history_day.some(item => Number(item) === i);
}
// 获取当天日期
var today = new Date().getDate();
day.push({
num: i,
class: 'cr-black',
today: i === today ? true : false,
is_signin: bool ? true : false
});
if (day.length === 7) {
days.push(day);
day = [];
}
}
// 本月计数
if (day.length > 0) {
for (let i = day.length; i < 7; i++) {
day.push({
num: i,
class: 'cr-grey-c',
today: false,
is_signin: false
});
}
days.push(day);
}
console.log(days);
this.setData({
day_count: days,
});
},
// 点击日期
handle_day() {
},
// 获取数据
get_data() {
uni.request({
url: app.globalData.get_request_url("detail", "index", "signin"),
method: 'POST',
data: {
id: this.params.id || 0
},
dataType: 'json',
success: res => {
uni.stopPullDownRefresh();
if (res.data.code == 0) {
var data = res.data.data;
this.setData({
data_base: data.base || null,
data: data.data || null,
team_signin_data: data.team_signin_data || null,
user_signin_data: data.user_signin_data || null,
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
});
},
// 获取数据
get_data() {
uni.request({
url: app.globalData.get_request_url("detail", "index", "signin"),
method: 'POST',
data: {
id: this.params.id || 0
},
dataType: 'json',
success: res => {
uni.stopPullDownRefresh();
if (res.data.code == 0) {
var data = res.data.data;
this.setData({
data_base: data.base || null,
data: data.data || null,
team_signin_data: data.team_signin_data || null,
user_signin_data: data.user_signin_data || null,
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
});
if ((this.data || null) != null) {
// 基础自定义分享
this.setData({
share_info: {
title: this.data.seo_title || '签到',
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 || ''
}
});
}
} else {
this.setData({
data_bottom_line_status: false,
data_list_loding_status: 2,
data_list_loding_msg: res.data.msg
});
}
// 分享菜单处理
app.globalData.page_share_handle(this.share_info);
},
fail: () => {
uni.stopPullDownRefresh();
this.setData({
data_bottom_line_status: false,
data_list_loding_status: 2,
data_list_loding_msg: '服务器请求出错'
});
app.globalData.showToast('服务器请求出错');
}
});
},
if ((this.data || null) != null) {
// 基础自定义分享
this.setData({
share_info: {
title: this.data.seo_title || '签到',
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 || ''
}
});
}
} else {
this.setData({
data_bottom_line_status: false,
data_list_loding_status: 2,
data_list_loding_msg: res.data.msg
});
}
// 分享菜单处理
app.globalData.page_share_handle(this.share_info);
},
fail: () => {
uni.stopPullDownRefresh();
this.setData({
data_bottom_line_status: false,
data_list_loding_status: 2,
data_list_loding_msg: '服务器请求出错'
});
app.globalData.showToast('服务器请求出错');
}
});
},
// 初始化
init() {
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 {
return true;
}
}
return false;
},
// 初始化
init() {
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 {
return true;
}
}
return false;
},
// 签到
coming_event(e) {
if (!app.globalData.is_single_page_check()) {
return false;
}
if (this.is_already_coming != 1 && this.init()) {
uni.showLoading({
title: '处理中...'
});
uni.request({
url: app.globalData.get_request_url("coming", "index", "signin"),
method: 'POST',
data: {
id: this.data.id
},
dataType: 'json',
success: res => {
uni.hideLoading();
if (res.data.code == 0) {
this.setData({
is_already_coming: 1,
is_success_tips: 1,
coming_integral: res.data.data
});
this.get_data();
} else {
if (app.globalData.is_login_check(res.data, this, 'team_request')) {
app.globalData.showToast(res.data.msg);
}
}
},
fail: () => {
uni.hideLoading();
app.globalData.showToast('服务器请求出错');
}
});
}
},
// 签到
coming_event(e) {
if (!app.globalData.is_single_page_check()) {
return false;
}
if (this.is_already_coming != 1 && this.init()) {
uni.showLoading({
title: '处理中...'
});
uni.request({
url: app.globalData.get_request_url("coming", "index", "signin"),
method: 'POST',
data: {
id: this.data.id
},
dataType: 'json',
success: res => {
uni.hideLoading();
if (res.data.code == 0) {
this.setData({
is_already_coming: 1,
is_success_tips: 1,
coming_integral: res.data.data
});
this.get_data();
} else {
if (app.globalData.is_login_check(res.data, this, 'team_request')) {
app.globalData.showToast(res.data.msg);
}
}
},
fail: () => {
uni.hideLoading();
app.globalData.showToast('服务器请求出错');
}
});
}
},
// 签到成功提示关闭
coming_success_close_event(e) {
this.setData({
is_success_tips: 0
});
},
// 签到成功提示关闭
coming_success_close_event(e) {
this.setData({
is_success_tips: 0
});
},
// 组队事件
team_event(e) {
if (this.init()) {
uni.showLoading({
title: '处理中...'
});
uni.request({
url: app.globalData.get_request_url("team", "userqrcode", "signin"),
method: 'POST',
data: {},
dataType: 'json',
success: res => {
uni.hideLoading();
if (res.data.code == 0) {
switch (res.data.data.status) {
// 组队成功
case 0:
// 设置签到码id
var temp_params = this.params;
temp_params['id'] = res.data.data.qrcode_id;
this.setData({
params: temp_params
});
// 组队事件
team_event(e) {
if (this.init()) {
uni.showLoading({
title: '处理中...'
});
uni.request({
url: app.globalData.get_request_url("team", "userqrcode", "signin"),
method: 'POST',
data: {},
dataType: 'json',
success: res => {
uni.hideLoading();
if (res.data.code == 0) {
switch (res.data.data.status) {
// 组队成功
case 0:
// 设置签到码id
var temp_params = this.params;
temp_params['id'] = res.data.data.qrcode_id;
this.setData({
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'
});
break;
}
} else {
if (app.globalData.is_login_check(res.data, this, 'team_request')) {
app.globalData.showToast(res.data.msg);
}
}
},
fail: () => {
uni.hideLoading();
app.globalData.showToast('服务器请求出错');
}
});
}
},
// 重新拉取数据
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'
});
break;
}
} else {
if (app.globalData.is_login_check(res.data, this, 'team_request')) {
app.globalData.showToast(res.data.msg);
}
}
},
fail: () => {
uni.hideLoading();
app.globalData.showToast('服务器请求出错');
}
});
}
},
// 打开url
url_event(e) {
app.globalData.url_event(e);
}
}
};
// 打开url
url_event(e) {
app.globalData.url_event(e);
}
}
};
</script>
<style>
@import './index-detail.css';
@import './index-detail.css';
</style>

View File

@ -4,7 +4,7 @@
'uni-calendar-item--before-checked-x':weeks.beforeMultiple,
'uni-calendar-item--multiple': weeks.multiple,
'uni-calendar-item--after-checked-x':weeks.afterMultiple,
}" @click="choiceDate(weeks)" @mouseenter="handleMousemove(weeks)">
}" @tap="choiceDate(weeks)" @mouseenter="handleMousemove(weeks)">
<view class="uni-calendar-item__weeks-box-item" :class="{
'uni-calendar-item--checked':calendar.fullDate === weeks.fullDate && (calendar.userChecked || !checkHover),
'uni-calendar-item--checked-range-text': checkHover,

View File

@ -2,7 +2,7 @@
<view class="uni-calendar" @mouseleave="leaveCale">
<view v-if="!insert && show" class="uni-calendar__mask" :class="{'uni-calendar--mask-show':aniMaskShow}"
@click="maskClick"></view>
@tap="maskClick"></view>
<view v-if="insert || show" class="uni-calendar__content"
:class="{'uni-calendar--fixed':!insert,'uni-calendar--ani-show':aniMaskShow, 'uni-calendar__content-mobile': aniMaskShow}">
@ -21,7 +21,7 @@
<view class="uni-calendar__header-btn uni-calendar--right"></view>
</view>
<view v-if="!insert" class="dialog-close" @click="close">
<view v-if="!insert" class="dialog-close" @tap="close">
<view class="dialog-close-plus" data-id="close"></view>
<view class="dialog-close-plus dialog-close-rotate" data-id="close"></view>
</view>
@ -94,7 +94,7 @@
</view>
<view v-if="!insert" class="uni-date-changed uni-date-btn--ok">
<view class="uni-datetime-picker--btn" @click="confirm">{{confirmText}}</view>
<view class="uni-datetime-picker--btn" @tap="confirm">{{confirmText}}</view>
</view>
</view>
</view>

View File

@ -1,6 +1,6 @@
<template>
<view class="uni-datetime-picker">
<view @click="initTimePicker">
<view @tap="initTimePicker">
<slot>
<view class="uni-datetime-picker-timebox-pointer"
:class="{'uni-datetime-picker-disabled': disabled, 'uni-datetime-picker-timebox': border}">
@ -11,7 +11,7 @@
</view>
</slot>
</view>
<view v-if="visible" id="mask" class="uni-datetime-picker-mask" @click="tiggerTimePicker"></view>
<view v-if="visible" id="mask" class="uni-datetime-picker-mask" @tap="tiggerTimePicker"></view>
<view v-if="visible" class="uni-datetime-picker-popup" :class="[dateShow && timeShow ? '' : 'fix-nvue-height']"
:style="fixNvueBug">
<view class="uni-title">
@ -64,14 +64,14 @@
<text v-if="!hideSecond" class="uni-datetime-picker-sign sign-right">:</text>
</view>
<view class="uni-datetime-picker-btn">
<view @click="clearTime">
<view @tap="clearTime">
<text class="uni-datetime-picker-btn-text">{{clearText}}</text>
</view>
<view class="uni-datetime-picker-btn-group">
<view class="uni-datetime-picker-cancel" @click="tiggerTimePicker">
<view class="uni-datetime-picker-cancel" @tap="tiggerTimePicker">
<text class="uni-datetime-picker-btn-text">{{cancelText}}</text>
</view>
<view @click="setTime">
<view @tap="setTime">
<text class="uni-datetime-picker-btn-text">{{okText}}</text>
</view>
</view>

View File

@ -1,6 +1,6 @@
<template>
<view class="uni-date">
<view class="uni-date-editor" @click="show">
<view class="uni-date-editor" @tap="show">
<slot>
<view class="uni-date-editor--x" :class="{'uni-date-editor--x__disabled': disabled,'uni-date-x--border': border}">
<view v-if="!isRange" class="uni-date-x uni-date-single">
@ -20,7 +20,7 @@
</slot>
</view>
<view v-show="pickerVisible" class="uni-date-mask--pc" @click="close"></view>
<view v-show="pickerVisible" class="uni-date-mask--pc" @tap="close"></view>
<view v-if="!isPhone" v-show="pickerVisible" ref="datePicker" class="uni-date-picker__container">
<view v-if="!isRange" class="uni-date-single--x" :style="pickerPositionStyle">
@ -43,7 +43,7 @@
style="padding: 0 8px;" />
<view v-if="hasTime" class="popup-x-footer">
<text class="confirm-text" @click="confirmSingleChange">{{okText}}</text>
<text class="confirm-text" @tap="confirmSingleChange">{{okText}}</text>
</view>
</view>
@ -87,8 +87,8 @@
</view>
<view v-if="hasTime" class="popup-x-footer">
<text @click="clear">{{clearText}}</text>
<text class="confirm-text" @click="confirmRangeChange">{{okText}}</text>
<text @tap="clear">{{clearText}}</text>
<text class="confirm-text" @tap="confirmRangeChange">{{okText}}</text>
</view>
</view>
</view>
@ -240,14 +240,14 @@
hideSecond: {
type: [Boolean],
default: false
},
showFirstIcon: {
type: [Boolean],
default: true
},
placeholderClass: {
type: String,
default: ''
},
showFirstIcon: {
type: [Boolean],
default: true
},
placeholderClass: {
type: String,
default: ''
},
defaultValue: {
type: [String, Object, Array],
@ -865,7 +865,7 @@
.uni-date__x-input {
width: auto;
height: 35px;
height: 35px;
padding: 0 5px;
/* #ifndef MP */
padding-left: 5px;

View File

@ -1,17 +1,17 @@
<template>
<!-- #ifdef APP-NVUE -->
<text :style="{ color: color, 'font-size': iconSize }" class="uni-icons" @click="_onClick">{{unicode}}</text>
<!-- #endif -->
<!-- #ifndef APP-NVUE -->
<text :style="{ color: color, 'font-size': iconSize }" class="uni-icons" :class="['uniui-'+type,customPrefix,customPrefix?type:'']" @click="_onClick"></text>
<template>
<!-- #ifdef APP-NVUE -->
<text :style="{ color: color, 'font-size': iconSize }" class="uni-icons" @tap="_onClick">{{unicode}}</text>
<!-- #endif -->
<!-- #ifndef APP-NVUE -->
<text :style="{ color: color, 'font-size': iconSize }" class="uni-icons" :class="['uniui-'+type,customPrefix,customPrefix?type:'']" @tap="_onClick"></text>
<!-- #endif -->
</template>
<script>
import icons from './icons.js';
const getVal = (val) => {
const reg = /^[0-9]*$/g
return (typeof val === 'number' || reg.test(val) )? val + 'px' : val;
import icons from './icons.js';
const getVal = (val) => {
const reg = /^[0-9]*$/g
return (typeof val === 'number' || reg.test(val) )? val + 'px' : val;
}
// #ifdef APP-NVUE
var domModule = weex.requireModule('dom');
@ -28,8 +28,8 @@
* @tutorial https://ext.dcloud.net.cn/plugin?id=28
* @property {Number} size 图标大小
* @property {String} type 图标图案,参考示例
* @property {String} color 图标颜色
* @property {String} customPrefix 自定义图标
* @property {String} color 图标颜色
* @property {String} customPrefix 自定义图标
* @event {Function} click 点击 Icon 触发事件
*/
export default {
@ -47,28 +47,28 @@
size: {
type: [Number, String],
default: 16
},
customPrefix:{
type: String,
default: ''
},
customPrefix:{
type: String,
default: ''
}
},
data() {
return {
icons: icons.glyphs
}
},
computed:{
unicode(){
let code = this.icons.find(v=>v.font_class === this.type)
if(code){
return unescape(`%u${code.unicode}`)
}
return ''
},
iconSize(){
return getVal(this.size)
}
},
computed:{
unicode(){
let code = this.icons.find(v=>v.font_class === this.type)
if(code){
return unescape(`%u${code.unicode}`)
}
return ''
},
iconSize(){
return getVal(this.size)
}
},
methods: {
_onClick() {
@ -78,19 +78,19 @@
}
</script>
<style lang="scss">
/* #ifndef APP-NVUE */
<style lang="scss">
/* #ifndef APP-NVUE */
@import './uniicons.css';
@font-face {
font-family: uniicons;
src: url('./uniicons.ttf') format('truetype');
}
/* #endif */
/* #endif */
.uni-icons {
font-family: uniicons;
text-decoration: none;
text-align: center;
}
</style>
</style>

View File

@ -2,17 +2,17 @@
<view class="uni-swiper__warp">
<slot />
<view v-if="mode === 'default'" :style="{'bottom':dots.bottom + 'px'}" class="uni-swiper__dots-box" key='default'>
<view v-for="(item,index) in info" @click="clickItem(index)" :style="{
<view v-for="(item,index) in info" @tap="clickItem(index)" :style="{
'width': (index === current? dots.width*2:dots.width ) + 'px','height':dots.width/2 +'px' ,'background-color':index !== current?dots.backgroundColor:dots.selectedBackgroundColor,'border-radius':'0px'}"
:key="index" class="uni-swiper__dots-item uni-swiper__dots-bar" />
</view>
<view v-if="mode === 'dot'" :style="{'bottom':dots.bottom + 'px'}" class="uni-swiper__dots-box" key='dot'>
<view v-for="(item,index) in info" @click="clickItem(index)" :style="{
<view v-for="(item,index) in info" @tap="clickItem(index)" :style="{
'width': dots.width + 'px','height':dots.height +'px' ,'background-color':index !== current?dots.backgroundColor:dots.selectedBackgroundColor,'border':index !==current ? dots.border:dots.selectedBorder}"
:key="index" class="uni-swiper__dots-item" />
</view>
<view v-if="mode === 'round'" :style="{'bottom':dots.bottom + 'px'}" class="uni-swiper__dots-box" key='round'>
<view v-for="(item,index) in info" @click="clickItem(index)" :class="[index === current&&'uni-swiper__dots-long']" :style="{
<view v-for="(item,index) in info" @tap="clickItem(index)" :class="[index === current&&'uni-swiper__dots-long']" :style="{
'width':(index === current? dots.width*3:dots.width ) + 'px','height':dots.height +'px' ,'background-color':index !== current?dots.backgroundColor:dots.selectedBackgroundColor,'border':index !==current ? dots.border:dots.selectedBorder}"
:key="index" class="uni-swiper__dots-item " />
</view>
@ -20,30 +20,30 @@
<text :style="{'color':dotsStyles.color}" class="uni-swiper__dots-nav-item">{{ (current+1)+"/"+info.length +' ' +info[current][field] }}</text>
</view>
<view v-if="mode === 'indexes'" key='indexes' :style="{'bottom':dots.bottom + 'px'}" class="uni-swiper__dots-box">
<view v-for="(item,index) in info" @click="clickItem(index)" :style="{
<view v-for="(item,index) in info" @tap="clickItem(index)" :style="{
'width':dots.width + 'px','height':dots.height +'px' ,'color':index === current?dots.selectedColor:dots.color,'background-color':index !== current?dots.backgroundColor:dots.selectedBackgroundColor,'border':index !==current ? dots.border:dots.selectedBorder}"
:key="index" class="uni-swiper__dots-item uni-swiper__dots-indexes"><text class="uni-swiper__dots-indexes-text">{{ index+1 }}</text></view>
</view>
</view>
</template>
<script>
/**
* SwiperDod 轮播图指示点
* @description 自定义轮播图指示点
* @tutorial https://ext.dcloud.net.cn/plugin?id=284
* @property {Number} current 当前指示点索引,必须是通过 `swiper` 的 `change` 事件获取到的 `e.detail.current`
* @property {String} mode = [default|round|nav|indexes] 指示点的类型
* @value defualt 默认指示点
* @value round 圆形指示点
* @value nav 条形指示点
* @value indexes 索引指示点
* @property {String} field mode 为 nav 时显示的内容字段mode = nav 时必填)
* @property {String} info 轮播图的数据,通过数组长度决定指示点个数
* @property {Object} dotsStyles 指示点样式
* @event {Function} clickItem 组件触发点击事件时触发e={currentIndex}
*/
<script>
/**
* SwiperDod 轮播图指示点
* @description 自定义轮播图指示点
* @tutorial https://ext.dcloud.net.cn/plugin?id=284
* @property {Number} current 当前指示点索引,必须是通过 `swiper` 的 `change` 事件获取到的 `e.detail.current`
* @property {String} mode = [default|round|nav|indexes] 指示点的类型
* @value defualt 默认指示点
* @value round 圆形指示点
* @value nav 条形指示点
* @value indexes 索引指示点
* @property {String} field mode 为 nav 时显示的内容字段mode = nav 时必填)
* @property {String} info 轮播图的数据,通过数组长度决定指示点个数
* @property {Object} dotsStyles 指示点样式
* @event {Function} clickItem 组件触发点击事件时触发e={currentIndex}
*/
export default {
name: 'UniSwiperDot',
@ -111,11 +111,11 @@
this.dots.height = 12
}
this.dots = Object.assign(this.dots, this.dotsStyles)
},
methods: {
clickItem(index) {
this.$emit('clickItem', index)
}
},
methods: {
clickItem(index) {
this.$emit('clickItem', index)
}
}
}
</script>
@ -149,15 +149,15 @@
width: 8px;
border-radius: 100px;
margin-left: 6px;
background-color: rgba(0, 0, 0, 0.4);
/* #ifndef APP-NVUE */
cursor: pointer;
/* #endif */
/* #ifdef H5 */
// border-width: 5px 0;
// border-style: solid;
// border-color: transparent;
// background-clip: padding-box;
background-color: rgba(0, 0, 0, 0.4);
/* #ifndef APP-NVUE */
cursor: pointer;
/* #endif */
/* #ifdef H5 */
// border-width: 5px 0;
// border-style: solid;
// border-color: transparent;
// background-clip: padding-box;
/* #endif */
// transition: width 0.2s linear; 不要取消注释,不然会不能变色
}
@ -180,7 +180,7 @@
.uni-swiper__dots-nav {
bottom: 0px;
// height: 26px;
// height: 26px;
padding: 8px 0;
/* #ifndef APP-NVUE */
display: flex;
@ -212,7 +212,7 @@
.uni-swiper__dots-indexes-text {
color: #fff;
font-size: 12px;
font-size: 12px;
line-height: 14px;
}
</style>
</style>