fix: 签到文案样式修改
parent
77e224afc2
commit
2ecf86f486
|
|
@ -17,30 +17,20 @@
|
||||||
<!-- 切换年月 -->
|
<!-- 切换年月 -->
|
||||||
<view class="bar ss-flex ss-col-center ss-row-center">
|
<view class="bar ss-flex ss-col-center ss-row-center">
|
||||||
<view class="previous" @tap="handleCalendar(0)"><text class="cicon-back"></text></view>
|
<view class="previous" @tap="handleCalendar(0)"><text class="cicon-back"></text></view>
|
||||||
<view class="date ss-m-x-20"
|
<view class="date ss-m-x-20">{{ state.cur_year || '--' }} 年 {{ state.cur_month || '--' }} 月</view>
|
||||||
>{{ state.cur_year || '--' }} 年 {{ state.cur_month || '--' }} 月</view
|
|
||||||
>
|
|
||||||
<view class="next" @tap="handleCalendar(1)"><text class="cicon-forward"></text></view>
|
<view class="next" @tap="handleCalendar(1)"><text class="cicon-forward"></text></view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 显示星期 -->
|
<!-- 显示星期 -->
|
||||||
<view class="week ss-flex">
|
<view class="week ss-flex">
|
||||||
<view
|
<view class="week-item ss-flex ss-row-center" v-for="(item, index) in state.weeks_ch" :key="index">
|
||||||
class="week-item ss-flex ss-row-center"
|
|
||||||
v-for="(item, index) in state.weeks_ch"
|
|
||||||
:key="index"
|
|
||||||
>
|
|
||||||
{{ item.title }}
|
{{ item.title }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 日历表 -->
|
<!-- 日历表 -->
|
||||||
<view class="myDateTable">
|
<view class="myDateTable">
|
||||||
<view
|
<view v-for="(item, j) in state.data.days" :key="j" class="dateCell ss-flex ss-row-center ss-col-center">
|
||||||
v-for="(item, j) in state.data.days"
|
|
||||||
:key="j"
|
|
||||||
class="dateCell ss-flex ss-row-center ss-col-center"
|
|
||||||
>
|
|
||||||
<!-- 空格 -->
|
<!-- 空格 -->
|
||||||
<view class="ss-flex ss-row-center ss-col-center">
|
<view class="ss-flex ss-row-center ss-col-center">
|
||||||
<text :decode="true"> </text>
|
<text :decode="true"> </text>
|
||||||
|
|
@ -49,25 +39,16 @@
|
||||||
<!-- 已签到日期 -->
|
<!-- 已签到日期 -->
|
||||||
<view v-if="item.is_sign" class="is-sign ss-flex ss-row-center">
|
<view v-if="item.is_sign" class="is-sign ss-flex ss-row-center">
|
||||||
<view class="is-sign-num">{{ item.day < 10 ? '0' + item.day : item.day }}</view>
|
<view class="is-sign-num">{{ item.day < 10 ? '0' + item.day : item.day }}</view>
|
||||||
<image
|
<image class="is-sign-image" :src="sheep.$url.static('/static/img/shop/app/correct.png')">
|
||||||
class="is-sign-image"
|
|
||||||
:src="sheep.$url.static('/static/img/shop/app/correct.png')"
|
|
||||||
>
|
|
||||||
</image>
|
</image>
|
||||||
</view>
|
</view>
|
||||||
<!-- 未签到日期 -->
|
<!-- 未签到日期 -->
|
||||||
<view
|
<view class="is-sign ss-flex ss-row-center" v-if="item.is_replenish == 1"
|
||||||
class="is-sign ss-flex ss-row-center"
|
@tap="onShowRetroactive(item.date)">
|
||||||
v-if="item.is_replenish == 1"
|
|
||||||
@tap="onShowRetroactive(item.date)"
|
|
||||||
>
|
|
||||||
<view class="cell-num">{{ item.day < 10 ? '0' + item.day : item.day }}</view>
|
<view class="cell-num">{{ item.day < 10 ? '0' + item.day : item.day }}</view>
|
||||||
<text class="cicon-title"></text>
|
<text class="cicon-title"></text>
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view class="is-sign ss-flex ss-row-center" v-if="item.is_replenish == 0 && !item.is_sign">
|
||||||
class="is-sign ss-flex ss-row-center"
|
|
||||||
v-if="item.is_replenish == 0 && !item.is_sign"
|
|
||||||
>
|
|
||||||
<view class="cell-num">{{ item.day < 10 ? '0' + item.day : item.day }}</view>
|
<view class="cell-num">{{ item.day < 10 ? '0' + item.day : item.day }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -75,12 +56,8 @@
|
||||||
|
|
||||||
<!-- 签到按钮 -->
|
<!-- 签到按钮 -->
|
||||||
<view class="ss-flex ss-col-center ss-row-center sign-box ss-m-y-40">
|
<view class="ss-flex ss-col-center ss-row-center sign-box ss-m-y-40">
|
||||||
<button class="ss-reset-button sign-btn" v-if="state.isSign === 0" @tap="onSign"
|
<button class="ss-reset-button sign-btn" v-if="state.isSign === 0" @tap="onSign">签到</button>
|
||||||
>签到</button
|
<button class="ss-reset-button already-btn" v-if="state.isSign === 1" disabled>已签到</button>
|
||||||
>
|
|
||||||
<button class="ss-reset-button already-btn" v-if="state.isSign === 1" disabled
|
|
||||||
>已签到</button
|
|
||||||
>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -94,24 +71,19 @@
|
||||||
</text>
|
</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="activity-des" v-if="state.data.rules.discounts?.length > 0">
|
<view class="activity-des" v-if="state.data.rules.discounts?.length > 0">
|
||||||
2、
|
2、<text class="" v-for="i in state.data.rules.discounts" :key="i">
|
||||||
<text class="" v-for="i in state.data.rules.discounts" :key="i">
|
|
||||||
连续签到 {{ i.full }} 天,奖励 {{ i.value }} 积分;
|
连续签到 {{ i.full }} 天,奖励 {{ i.value }} 积分;
|
||||||
</text>
|
</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="activity-des" v-if="state.data.rules.is_replenish == '1'">
|
<view class="activity-des" v-if="state.data.rules.is_replenish == '1'">
|
||||||
{{ state.data.rules.discounts?.length > 0 ? '3' : '2' }}、 用户在
|
{{ state.data.rules.discounts?.length > 0 ? '3' : '2' }}、用户在
|
||||||
{{ state.data.rules.replenish_limit }} 天内,可补签
|
{{ state.data.rules.replenish_limit }} 天内,可补签
|
||||||
{{ state.data.rules.replenish_days }} 天,每次补签消耗
|
{{ state.data.rules.replenish_days }} 天,每次补签消耗
|
||||||
{{ state.data.rules.replenish_num }}积分
|
{{ state.data.rules.replenish_num }}积分
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<s-empty
|
<s-empty v-else-if="!state.data && !state.loading" icon="/static/data-empty.png" text="签到活动还未开始">
|
||||||
v-else-if="!state.data && !state.loading"
|
|
||||||
icon="/static/data-empty.png"
|
|
||||||
text="签到活动还未开始"
|
|
||||||
>
|
|
||||||
</s-empty>
|
</s-empty>
|
||||||
<su-popup :show="state.showModel" type="center" round="10" :isMaskClick="false">
|
<su-popup :show="state.showModel" type="center" round="10" :isMaskClick="false">
|
||||||
<view class="model-box ss-flex-col">
|
<view class="model-box ss-flex-col">
|
||||||
|
|
@ -142,9 +114,7 @@
|
||||||
<view class="model-bg ss-flex-col ss-col-center ss-row-right">
|
<view class="model-bg ss-flex-col ss-col-center ss-row-right">
|
||||||
<view class="title ss-m-b-64">确认补签</view>
|
<view class="title ss-m-b-64">确认补签</view>
|
||||||
<view class="ss-m-b-40 ss-flex">
|
<view class="ss-m-b-40 ss-flex">
|
||||||
<button class="ss-reset-button cancel-btn" @tap="state.showRetroactive = false"
|
<button class="ss-reset-button cancel-btn" @tap="state.showRetroactive = false">取消</button>
|
||||||
>取消</button
|
|
||||||
>
|
|
||||||
<button class="ss-reset-button confirm-btn" @tap="onRetroactive">确认</button>
|
<button class="ss-reset-button confirm-btn" @tap="onRetroactive">确认</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -154,13 +124,13 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import sheep from '@/sheep';
|
import sheep from '@/sheep';
|
||||||
import { onLoad, onReady } from '@dcloudio/uni-app';
|
import { onLoad, onReady } from '@dcloudio/uni-app';
|
||||||
import { computed, reactive } from 'vue';
|
import { computed, reactive } from 'vue';
|
||||||
|
|
||||||
const headerBg = sheep.$url.css('/static/img/shop/app/sign.png');
|
const headerBg = sheep.$url.css('/static/img/shop/app/sign.png');
|
||||||
|
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
data: {
|
data: {
|
||||||
days: [], //日历
|
days: [], //日历
|
||||||
rules: {}, //规则
|
rules: {}, //规则
|
||||||
|
|
@ -205,27 +175,27 @@
|
||||||
date: '', //补签选中日期
|
date: '', //补签选中日期
|
||||||
isSign: 0, //今天是否签到
|
isSign: 0, //今天是否签到
|
||||||
loading: true,
|
loading: true,
|
||||||
});
|
});
|
||||||
async function onSign() {
|
async function onSign() {
|
||||||
const { error, data } = await sheep.$api.activity.signAdd();
|
const { error, data } = await sheep.$api.activity.signAdd();
|
||||||
if (error === 0) {
|
if (error === 0) {
|
||||||
state.showModel = true;
|
state.showModel = true;
|
||||||
state.signin = data;
|
state.signin = data;
|
||||||
// getData();
|
// getData();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function onShowRetroactive(e) {
|
function onShowRetroactive(e) {
|
||||||
state.showRetroactive = true;
|
state.showRetroactive = true;
|
||||||
state.date = e;
|
state.date = e;
|
||||||
}
|
}
|
||||||
//签到确认刷新页面
|
//签到确认刷新页面
|
||||||
function onConfirm() {
|
function onConfirm() {
|
||||||
state.showModel = false;
|
state.showModel = false;
|
||||||
getData();
|
getData();
|
||||||
}
|
}
|
||||||
//补签
|
//补签
|
||||||
async function onRetroactive() {
|
async function onRetroactive() {
|
||||||
const { error, data } = await sheep.$api.activity.replenish({
|
const { error, data } = await sheep.$api.activity.replenish({
|
||||||
date: state.date,
|
date: state.date,
|
||||||
});
|
});
|
||||||
|
|
@ -233,9 +203,9 @@
|
||||||
state.showRetroactive = false;
|
state.showRetroactive = false;
|
||||||
getData();
|
getData();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getData(mouth) {
|
async function getData(mouth) {
|
||||||
const { error, data } = await sheep.$api.activity.signList(mouth);
|
const { error, data } = await sheep.$api.activity.signList(mouth);
|
||||||
if (error === 0) {
|
if (error === 0) {
|
||||||
state.data = data;
|
state.data = data;
|
||||||
|
|
@ -268,14 +238,14 @@
|
||||||
}
|
}
|
||||||
state.continue_days = data.continue_days;
|
state.continue_days = data.continue_days;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onReady(() => {
|
onReady(() => {
|
||||||
getData();
|
getData();
|
||||||
});
|
});
|
||||||
|
|
||||||
// 切换控制年月,上一个月,下一个月
|
// 切换控制年月,上一个月,下一个月
|
||||||
const handleCalendar = (type) => {
|
const handleCalendar = (type) => {
|
||||||
const cur_year = parseInt(state.cur_year);
|
const cur_year = parseInt(state.cur_year);
|
||||||
const cur_month = parseInt(state.cur_month);
|
const cur_month = parseInt(state.cur_month);
|
||||||
var newMonth;
|
var newMonth;
|
||||||
|
|
@ -301,16 +271,16 @@
|
||||||
getData({
|
getData({
|
||||||
month: newYear + '-' + newMonth,
|
month: newYear + '-' + newMonth,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.header-box {
|
.header-box {
|
||||||
border-top: 2rpx solid rgba(#dfdfdf, 0.5);
|
border-top: 2rpx solid rgba(#dfdfdf, 0.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 日历
|
// 日历
|
||||||
.calendar {
|
.calendar {
|
||||||
background: #fff;
|
background: #fff;
|
||||||
|
|
||||||
.sign-everyday {
|
.sign-everyday {
|
||||||
|
|
@ -389,9 +359,9 @@
|
||||||
color: rgba(51, 51, 51, 1);
|
color: rgba(51, 51, 51, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.is-sign {
|
.is-sign {
|
||||||
width: 48rpx;
|
width: 48rpx;
|
||||||
height: 48rpx;
|
height: 48rpx;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
@ -410,26 +380,26 @@
|
||||||
width: 48rpx;
|
width: 48rpx;
|
||||||
height: 48rpx;
|
height: 48rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.cell-num {
|
.cell-num {
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
font-family: OPPOSANS;
|
font-family: OPPOSANS;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
color: #333333;
|
color: #333333;
|
||||||
line-height: normal;
|
line-height: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cicon-title {
|
.cicon-title {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: -10rpx;
|
right: -10rpx;
|
||||||
top: -6rpx;
|
top: -6rpx;
|
||||||
font-size: 20rpx;
|
font-size: 20rpx;
|
||||||
color: red;
|
color: red;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 签到按钮
|
// 签到按钮
|
||||||
.sign-box {
|
.sign-box {
|
||||||
height: 140rpx;
|
height: 140rpx;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
|
|
@ -451,9 +421,9 @@
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.model-box {
|
.model-box {
|
||||||
width: 520rpx;
|
width: 520rpx;
|
||||||
// height: 590rpx;
|
// height: 590rpx;
|
||||||
background: linear-gradient(177deg, #ff6000 0%, #fe832a 100%);
|
background: linear-gradient(177deg, #ff6000 0%, #fe832a 100%);
|
||||||
|
|
@ -523,20 +493,20 @@
|
||||||
line-height: normal;
|
line-height: normal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//签到说明
|
//签到说明
|
||||||
.activity-title {
|
.activity-title {
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
color: #333333;
|
color: #333333;
|
||||||
line-height: normal;
|
line-height: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
.activity-des {
|
.activity-des {
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
color: #666666;
|
color: #666666;
|
||||||
line-height: 40rpx;
|
line-height: 40rpx;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue