|
@@ -12,11 +12,11 @@
|
|
<view class="container-wrap">
|
|
<view class="container-wrap">
|
|
|
|
|
|
<view class="head">
|
|
<view class="head">
|
|
- <image src="../../../static/avatar.png" class="avatar" mode="aspectFill"></image>
|
|
|
|
|
|
+ <image :src="info.headimg" class="avatar" mode="aspectFill"></image>
|
|
<view class="head-sidebar">
|
|
<view class="head-sidebar">
|
|
<view class="head-column">
|
|
<view class="head-column">
|
|
<view class="user-name">
|
|
<view class="user-name">
|
|
- 真的灰常郝
|
|
|
|
|
|
+ {{info.name}}
|
|
</view>
|
|
</view>
|
|
<view class="tag">
|
|
<view class="tag">
|
|
<image src="../../../static/bg-5.png" class="tag-bg" mode=""></image>
|
|
<image src="../../../static/bg-5.png" class="tag-bg" mode=""></image>
|
|
@@ -28,7 +28,7 @@
|
|
</view>
|
|
</view>
|
|
<view class="right-tag">
|
|
<view class="right-tag">
|
|
<image src="../../../static/icon-9.png" mode=""></image>
|
|
<image src="../../../static/icon-9.png" mode=""></image>
|
|
- <text>800</text>积分
|
|
|
|
|
|
+ <text>{{info.wallet.integral}}</text>积分
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -36,57 +36,21 @@
|
|
<view class="sign-in-module">
|
|
<view class="sign-in-module">
|
|
<view class="date-box">
|
|
<view class="date-box">
|
|
<view class="big-num">
|
|
<view class="big-num">
|
|
- 06
|
|
|
|
|
|
+ {{toDay.d}}
|
|
</view>
|
|
</view>
|
|
<view class="date-column">
|
|
<view class="date-column">
|
|
- <view class="week-name">周三</view>
|
|
|
|
- <view class="date-msg">三月2019</view>
|
|
|
|
|
|
+ <view class="week-name">{{toDay.w}}</view>
|
|
|
|
+ <view class="date-msg">{{toDay.m}}{{toDay.y}}</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
|
|
<view class="bar">
|
|
<view class="bar">
|
|
<view class="steps">
|
|
<view class="steps">
|
|
- <view class="steps-li">
|
|
|
|
- <view class="step-content">
|
|
|
|
- <view class="sub_title">1天</view>
|
|
|
|
- <view class="step-num"></view>
|
|
|
|
- </view>
|
|
|
|
- </view>
|
|
|
|
- <view class="steps-li active">
|
|
|
|
- <view class="step-content">
|
|
|
|
- <view class="sub_title">2天</view>
|
|
|
|
- <view class="step-num"></view>
|
|
|
|
- </view>
|
|
|
|
- </view>
|
|
|
|
- <view class="steps-li active">
|
|
|
|
- <view class="step-content">
|
|
|
|
- <view class="sub_title">3天</view>
|
|
|
|
- <view class="step-num"></view>
|
|
|
|
- </view>
|
|
|
|
- </view>
|
|
|
|
- <view class="steps-li">
|
|
|
|
- <view class="step-content">
|
|
|
|
- <view class="sub_title">4天</view>
|
|
|
|
- <view class="step-num"></view>
|
|
|
|
- </view>
|
|
|
|
- </view>
|
|
|
|
- <view class="steps-li">
|
|
|
|
- <view class="step-content">
|
|
|
|
- <view class="sub_title">5天</view>
|
|
|
|
- <view class="step-num"></view>
|
|
|
|
- </view>
|
|
|
|
- </view>
|
|
|
|
- <view class="steps-li">
|
|
|
|
- <view class="step-content">
|
|
|
|
- <view class="sub_title">6天</view>
|
|
|
|
- <view class="step-num"></view>
|
|
|
|
- </view>
|
|
|
|
- </view>
|
|
|
|
- <view class="steps-li">
|
|
|
|
- <view class="step-content">
|
|
|
|
- <view class="sub_title">7天</view>
|
|
|
|
- <view class="step-num">
|
|
|
|
- <image src="../../../static/icon-12.png" mode="widthFix" class="repair"></image>
|
|
|
|
|
|
+ <view class="steps-li" v-for="(item) in 7">
|
|
|
|
+ <view class="step-content" :class="{active: item <= signInfo.sign_num % 7}">
|
|
|
|
+ <view class="sub_title">{{item}}天</view>
|
|
|
|
+ <view class="step-num">
|
|
|
|
+ <image v-if="item == 7" src="../../../static/icon-12.png" mode="widthFix" class="repair"></image>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -94,9 +58,8 @@
|
|
</view>
|
|
</view>
|
|
|
|
|
|
<view class="btn-box">
|
|
<view class="btn-box">
|
|
- <button type="default" @tap="showIntegral">立即签到</button>
|
|
|
|
- <!-- 已签到显示 -->
|
|
|
|
- <!-- <button type="default" class="gray-bg">立即签到</button> -->
|
|
|
|
|
|
+ <button v-if="!isSign" type="default" @tap="userSign()">立即签到</button>
|
|
|
|
+ <button v-else type="default" class="gray-bg">立即签到</button>
|
|
</view>
|
|
</view>
|
|
<view class="sign-in-msg">
|
|
<view class="sign-in-msg">
|
|
连续签到7天可以获得一张补签卡
|
|
连续签到7天可以获得一张补签卡
|
|
@@ -107,17 +70,17 @@
|
|
<view class="supplementary-signature">
|
|
<view class="supplementary-signature">
|
|
<view class="supplementary-signature-sidebar">
|
|
<view class="supplementary-signature-sidebar">
|
|
<image src="../../../static/icon-11.png" mode="widthFix"></image>
|
|
<image src="../../../static/icon-11.png" mode="widthFix"></image>
|
|
- <text>补签卡1张</text>
|
|
|
|
|
|
+ <text>补签卡{{signInfo.sign_card}}张</text>
|
|
</view>
|
|
</view>
|
|
- <button type="default" class="small-btn" @tap="showSupplementaryCard">去补签</button>
|
|
|
|
|
|
+ <button type="default" class="small-btn" @tap="retroactive()">去补签</button>
|
|
</view>
|
|
</view>
|
|
|
|
|
|
<view class="sign-in-rules">
|
|
<view class="sign-in-rules">
|
|
<view class="sign-in-rules-label">签到规则:</view>
|
|
<view class="sign-in-rules-label">签到规则:</view>
|
|
<view class="sign-in-rules-msg">
|
|
<view class="sign-in-rules-msg">
|
|
- 1.每日签到获得1个积分;
|
|
|
|
- 2.连续签到2天获得2积分;
|
|
|
|
- 3.连续签到3天获得3积分;
|
|
|
|
|
|
+ 1.每日签到获得1个积分;<br/>
|
|
|
|
+ 2.连续签到2天获得2积分;<br/>
|
|
|
|
+ 3.连续签到3天获得3积分;<br/>
|
|
4.连续签到7天可以获得一张补签卡。
|
|
4.连续签到7天可以获得一张补签卡。
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -126,7 +89,7 @@
|
|
|
|
|
|
<!-- 补签卡弹窗 -->
|
|
<!-- 补签卡弹窗 -->
|
|
<view v-show="isShowSupplementaryCard">
|
|
<view v-show="isShowSupplementaryCard">
|
|
- <view class="mask" @tap="closeSupplementaryCard"></view>
|
|
|
|
|
|
+ <view class="mask"></view>
|
|
<view class="window-wrap">
|
|
<view class="window-wrap">
|
|
<view class="window">
|
|
<view class="window">
|
|
<image src="../../../static/bg-16.png" class="window-bg" mode=""></image>
|
|
<image src="../../../static/bg-16.png" class="window-bg" mode=""></image>
|
|
@@ -134,10 +97,10 @@
|
|
<image src="../../../static/icon-11.png" class="window-icon" mode="widthFix"></image>
|
|
<image src="../../../static/icon-11.png" class="window-icon" mode="widthFix"></image>
|
|
<text class="window-msg">恭喜您连续签到七天</text>
|
|
<text class="window-msg">恭喜您连续签到七天</text>
|
|
<text class="window-msg">获得1张补签卡</text>
|
|
<text class="window-msg">获得1张补签卡</text>
|
|
- <button type="default" class="window-btn">签到成功</button>
|
|
|
|
|
|
+ <button type="default" class="window-btn" @tap="closeSupplementaryCard">签到成功</button>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
- <button type="default" class="close-btn">
|
|
|
|
|
|
+ <button type="default" class="close-btn" @tap="closeSupplementaryCard">
|
|
<image src="../../../static/close-icon.png" mode="widthFix"></image>
|
|
<image src="../../../static/close-icon.png" mode="widthFix"></image>
|
|
</button>
|
|
</button>
|
|
</view>
|
|
</view>
|
|
@@ -147,21 +110,21 @@
|
|
|
|
|
|
<!-- 积分弹窗 -->
|
|
<!-- 积分弹窗 -->
|
|
<view v-show="isShowIntegral">
|
|
<view v-show="isShowIntegral">
|
|
- <view class="mask" @tap="closeIntegral"></view>
|
|
|
|
|
|
+ <view class="mask"></view>
|
|
<view class="window-wrap">
|
|
<view class="window-wrap">
|
|
<view class="window">
|
|
<view class="window">
|
|
<image src="../../../static/bg-16.png" class="window-bg" mode=""></image>
|
|
<image src="../../../static/bg-16.png" class="window-bg" mode=""></image>
|
|
<view class="window-container">
|
|
<view class="window-container">
|
|
<view class="window-title">
|
|
<view class="window-title">
|
|
<image src="../../../static/left-icon.png" mode="widthFix"></image>
|
|
<image src="../../../static/left-icon.png" mode="widthFix"></image>
|
|
- 获得<text>1</text>积分
|
|
|
|
|
|
+ 获得<text>{{signResult.integral}}</text>积分
|
|
<image src="../../../static/right-icon.png" mode="widthFix"></image>
|
|
<image src="../../../static/right-icon.png" mode="widthFix"></image>
|
|
</view>
|
|
</view>
|
|
<text class="sign-in-row">明天签到可得<text>2</text>积分</text>
|
|
<text class="sign-in-row">明天签到可得<text>2</text>积分</text>
|
|
- <button type="default" class="window-btn">知道了</button>
|
|
|
|
|
|
+ <button type="default" class="window-btn" @tap="closeIntegral">知道了</button>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
- <button type="default" class="close-btn">
|
|
|
|
|
|
+ <button type="default" class="close-btn" @tap="closeIntegral">
|
|
<image src="../../../static/close-icon.png" mode="widthFix"></image>
|
|
<image src="../../../static/close-icon.png" mode="widthFix"></image>
|
|
</button>
|
|
</button>
|
|
</view>
|
|
</view>
|
|
@@ -171,8 +134,18 @@
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
-<script>
|
|
|
|
- import HeaderViewBar from '../../../components/header-view-bar/header-view-bar.vue';
|
|
|
|
|
|
+<script>
|
|
|
|
+ import {
|
|
|
|
+ signCheckSign,
|
|
|
|
+ signGetContinuousSign,
|
|
|
|
+ signGetSignCard,
|
|
|
|
+ signGetSignList,
|
|
|
|
+ signRetroactive,
|
|
|
|
+ signUserSign,
|
|
|
|
+ } from '../../../common/service.js';
|
|
|
|
+ import HeaderViewBar from '../../../components/header-view-bar/header-view-bar.vue';
|
|
|
|
+ import dayjs from '../../../common/utils/dayjs.min.js';
|
|
|
|
+ import { numToChinese } from '../../../common/utils/util.js';
|
|
export default {
|
|
export default {
|
|
components: {
|
|
components: {
|
|
HeaderViewBar,
|
|
HeaderViewBar,
|
|
@@ -184,15 +157,138 @@
|
|
//补签卡弹窗
|
|
//补签卡弹窗
|
|
isShowSupplementaryCard: false,
|
|
isShowSupplementaryCard: false,
|
|
//积分弹窗
|
|
//积分弹窗
|
|
- isShowIntegral: false,
|
|
|
|
|
|
+ isShowIntegral: false,
|
|
|
|
+
|
|
|
|
+ toDay: {
|
|
|
|
+ y: '',
|
|
|
|
+ m: '',
|
|
|
|
+ d: '',
|
|
|
|
+ w: '',
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ isSign: false, // 是否签到 true 是 false 否
|
|
|
|
+ signInfo: {
|
|
|
|
+ is_sign: 0, // 当天是否签到(0签到,1已签到)
|
|
|
|
+ sign_num: 0, // 连续签到天数
|
|
|
|
+ sign_card: 0, // 补签卡数量
|
|
|
|
+ },
|
|
|
|
+ signResult: {
|
|
|
|
+ sign_crystal: '', // 明信片
|
|
|
|
+ integral: 0, // 签到获得积分数
|
|
|
|
+ sign_num: 0, // 连续签到天数
|
|
|
|
+ },
|
|
|
|
+ info: {
|
|
|
|
+ wallet: {},
|
|
|
|
+ },
|
|
}
|
|
}
|
|
- },
|
|
|
|
- onShow() {
|
|
|
|
|
|
+ },
|
|
|
|
+ onLoad() {
|
|
|
|
+ this.info = uni.getStorageSync('USER_INFO') || {};
|
|
|
|
+ },
|
|
|
|
+ onShow() {
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
this.headerHeight = this.$refs['HeaderViewBar'].getHeaderStyle().headerHeight;
|
|
this.headerHeight = this.$refs['HeaderViewBar'].getHeaderStyle().headerHeight;
|
|
- }, 20);
|
|
|
|
|
|
+ }, 20);
|
|
|
|
+
|
|
|
|
+ const day = dayjs();
|
|
|
|
+ this.toDay = {
|
|
|
|
+ y: day.format('YYYY'),
|
|
|
|
+ m: numToChinese(day.month() + 1) + '月',
|
|
|
|
+ d: day.format('DD'),
|
|
|
|
+ w: day.day() == 0 ? '周日' : '周' + numToChinese(day.day()),
|
|
|
|
+ };
|
|
|
|
+ this.checkSign();
|
|
|
|
+ this.getContinuousSign();
|
|
},
|
|
},
|
|
- methods: {
|
|
|
|
|
|
+ methods: {
|
|
|
|
+ // 签到
|
|
|
|
+ userSign() {
|
|
|
|
+ signUserSign({
|
|
|
|
+ success: ({code, data, msg}) => {
|
|
|
|
+ if (code == 1) {
|
|
|
|
+ this.signResult = data;
|
|
|
|
+ if (data.sign_num % 7 == 0) {
|
|
|
|
+ this.getSignCard();
|
|
|
|
+ } else {
|
|
|
|
+ this.showIntegral();
|
|
|
|
+ }
|
|
|
|
+ this.checkSign();
|
|
|
|
+ this.getContinuousSign();
|
|
|
|
+ } else {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ icon: 'none',
|
|
|
|
+ title: msg,
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ // 获取补签卡
|
|
|
|
+ getSignCard() {
|
|
|
|
+ signGetSignCard({
|
|
|
|
+ success: ({code, data, msg}) => {
|
|
|
|
+ if (code == 1) {
|
|
|
|
+ this.showSupplementaryCard();
|
|
|
|
+ } else {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ icon: 'none',
|
|
|
|
+ title: msg,
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ // 补签
|
|
|
|
+ retroactive() {
|
|
|
|
+ signRetroactive({
|
|
|
|
+ success: ({code, data, msg}) => {
|
|
|
|
+ if (code == 1) {
|
|
|
|
+ if (data.sign_num % 7 == 0) {
|
|
|
|
+ this.getSignCard();
|
|
|
|
+ } else {
|
|
|
|
+ this.showIntegral();
|
|
|
|
+ }
|
|
|
|
+ this.checkSign();
|
|
|
|
+ this.getContinuousSign();
|
|
|
|
+ } else {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ icon: 'none',
|
|
|
|
+ title: msg,
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ // 获取签到天数
|
|
|
|
+ getContinuousSign() {
|
|
|
|
+ signGetContinuousSign({
|
|
|
|
+ success: ({code, data, msg}) => {
|
|
|
|
+ if (code == 1) {
|
|
|
|
+ this.signInfo = data;
|
|
|
|
+ } else {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ icon: 'none',
|
|
|
|
+ title: msg,
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ // 判断今天是否签到
|
|
|
|
+ checkSign() {
|
|
|
|
+ signCheckSign({
|
|
|
|
+ success: ({code, data, msg}) => {
|
|
|
|
+ if (code == 1) {
|
|
|
|
+ this.isSign = data.is_sign == 1;
|
|
|
|
+ } else {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ icon: 'none',
|
|
|
|
+ title: msg,
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+ },
|
|
//返回上一页
|
|
//返回上一页
|
|
back() {
|
|
back() {
|
|
uni.navigateBack({
|
|
uni.navigateBack({
|