fix: 签到文案样式修改

pull/8/head
kele 2023-03-31 18:20:50 +08:00
parent 77e224afc2
commit 2ecf86f486
1 changed files with 403 additions and 433 deletions

View File

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