修改主题
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
<view class="register absolute">
|
||||
<view class="shading">
|
||||
<view class="pictrue acea-row row-center-wrapper">
|
||||
<image src="@/assets/images/logo.png" />
|
||||
<image src="@/static/images/logo.png" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="whiteBg" v-if="formItem === 1">
|
||||
@ -136,7 +136,7 @@
|
||||
current: 0,
|
||||
account: "",
|
||||
password: "",
|
||||
captcha: "",
|
||||
captcha: "",
|
||||
inviteCode:"",
|
||||
formItem: 1,
|
||||
type: "login"
|
||||
@ -338,4 +338,4 @@
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
</script>
|
||||
|
@ -33,7 +33,7 @@
|
||||
<image :src="item.avatar" />
|
||||
</view>-->
|
||||
<image
|
||||
:src="$VUE_APP_RESOURCES_URL+'/images/alter.png'"
|
||||
src="@/static/images/alter.png"
|
||||
class="alter"
|
||||
v-if="item.uid === userInfo.uid"
|
||||
/>
|
||||
|
@ -2,7 +2,7 @@
|
||||
<view class="register absolute">
|
||||
<view class="shading">
|
||||
<view class="pictrue acea-row row-center-wrapper">
|
||||
<image src="@/assets/images/logo.png" />
|
||||
<image src="@/static/images/logo.png" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="whiteBg">
|
||||
|
@ -2,7 +2,7 @@
|
||||
<view class="register absolute">
|
||||
<view class="shading">
|
||||
<view class="pictrue acea-row row-center-wrapper">
|
||||
<image src="@/assets/images/logo.png" />
|
||||
<image src="@/static/images/logo.png" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="whiteBg">
|
||||
|
@ -55,35 +55,35 @@
|
||||
<view class="orderState acea-row row-middle">
|
||||
<view @click="goMyOrder(0)" class="item">
|
||||
<view class="pictrue">
|
||||
<image :src="$VUE_APP_RESOURCES_URL + '/images/dfk.png'" />
|
||||
<image src="@/static/images/dfk.png" />
|
||||
<text class="order-status-num" v-if="userInfo.orderStatusNum.unpaidCount > 0">{{ userInfo.orderStatusNum.unpaidCount }}</text>
|
||||
</view>
|
||||
<view>待付款</view>
|
||||
</view>
|
||||
<view @click="goMyOrder(1)" class="item">
|
||||
<view class="pictrue">
|
||||
<image :src="$VUE_APP_RESOURCES_URL+'/images/dfh.png'" />
|
||||
<image src="@/static/images/dfh.png" />
|
||||
<text class="order-status-num" v-if="userInfo.orderStatusNum.unshippedCount > 0">{{ userInfo.orderStatusNum.unshippedCount }}</text>
|
||||
</view>
|
||||
<view>待发货</view>
|
||||
</view>
|
||||
<view @click="goMyOrder(2)" class="item">
|
||||
<view class="pictrue">
|
||||
<image :src="$VUE_APP_RESOURCES_URL+'/images/dsh.png'" />
|
||||
<image src="@/static/images/dsh.png" />
|
||||
<text class="order-status-num" v-if="userInfo.orderStatusNum.receivedCount > 0">{{ userInfo.orderStatusNum.receivedCount }}</text>
|
||||
</view>
|
||||
<text>待收货</text>
|
||||
</view>
|
||||
<view @click="goMyOrder(3)" class="item">
|
||||
<view class="pictrue">
|
||||
<image :src="$VUE_APP_RESOURCES_URL+'/images/dpj.png'" />
|
||||
<image src="@/static/images/dpj.png" />
|
||||
<text class="order-status-num" v-if="userInfo.orderStatusNum.evaluatedCount > 0">{{ userInfo.orderStatusNum.evaluatedCount }}</text>
|
||||
</view>
|
||||
<text>待评价</text>
|
||||
</view>
|
||||
<view @click="goReturnList()" class="item">
|
||||
<view class="pictrue">
|
||||
<image :src="$VUE_APP_RESOURCES_URL+'/images/sh.png'" />
|
||||
<image src="@/static/images/sh.png" />
|
||||
<text class="order-status-num" v-if="userInfo.orderStatusNum.refundCount > 0">{{ userInfo.orderStatusNum.refundCount }}</text>
|
||||
</view>
|
||||
<text>售后/退款</text>
|
||||
@ -110,7 +110,7 @@
|
||||
<!--@click="changeswitch(true)"-->
|
||||
<!--v-if="userInfo.phone && isWeixin"-->
|
||||
<!-->-->
|
||||
<!--<view class="pictrue"><image :src="$VUE_APP_RESOURCES_URL+'/images/switch.png'" /></view>-->
|
||||
<!--<view class="pictrue"><image src="@/static/images/switch.png" /></view>-->
|
||||
<!--<view>账号切换</!--<view>-->
|
||||
<!--</!--<view>-->
|
||||
<!-- </view>
|
||||
|
@ -20,13 +20,13 @@
|
||||
<view class="nav acea-row row-middle">
|
||||
<view class="item" @click="goUserBill(0)">
|
||||
<view class="pictrue">
|
||||
<image :src="$VUE_APP_RESOURCES_URL+'/images/record1.png'" />
|
||||
<image src="@/static/images/record1.png" />
|
||||
</view>
|
||||
<view>账单记录</view>
|
||||
</view>
|
||||
<view class="item" @click="goUserBill(1)">
|
||||
<view class="pictrue">
|
||||
<image :src="$VUE_APP_RESOURCES_URL+'/images/record2.png'" />
|
||||
<image src="@/static/images/record2.png" />
|
||||
</view>
|
||||
<view>消费记录</view>
|
||||
</view>
|
||||
|
@ -66,7 +66,7 @@
|
||||
<Recommend></Recommend>
|
||||
<view class="growthValue" :class="growthValue === false ? 'on' : ''">
|
||||
<view class="pictrue">
|
||||
<image :src="$VUE_APP_RESOURCES_URL+'/images/value.jpg'" />
|
||||
<image src="@/static/images/value.jpg" />
|
||||
<text class="iconfont icon-guanbi3" @click="growthTap"></text>
|
||||
</view>
|
||||
<view class="conter">{{ illustrate }}</view>
|
||||
|
@ -5,7 +5,7 @@
|
||||
ref="container"
|
||||
>
|
||||
<view class="line" v-if="addressList.length > 0">
|
||||
<image :src="$VUE_APP_RESOURCES_URL+'/images/line.jpg'" />
|
||||
<image src="@/static/images/line.jpg" />
|
||||
</view>
|
||||
<view class="item" v-for="(item, addressListIndex) in addressList" :key="addressListIndex">
|
||||
<view class="address">
|
||||
@ -53,7 +53,7 @@
|
||||
<Loading :loaded="loadend" :loading="loading"></Loading>
|
||||
<view class="noCommodity" v-if="addressList.length < 1 && page > 1">
|
||||
<view class="noPictrue">
|
||||
<image :src="$VUE_APP_RESOURCES_URL+'/images/noAddress.png'" class="image" />
|
||||
<image src="@/static/images/noAddress.png" class="image" />
|
||||
</view>
|
||||
</view>
|
||||
<view style="height:100rpx;"></view>
|
||||
|
@ -30,7 +30,7 @@
|
||||
<!--暂无优惠券-->
|
||||
<view class="noCommodity" v-if="couponsList.length === 0 && page > 1">
|
||||
<view class="noPictrue">
|
||||
<image :src="$VUE_APP_RESOURCES_URL+'/images/noCoupon.png'" class="image" />
|
||||
<image src="@/static/images/noCoupon.png" class="image" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -26,7 +26,7 @@
|
||||
v-if="couponsList.length === 0 && loading === true"
|
||||
>
|
||||
<view class="noPictrue">
|
||||
<image :src="$VUE_APP_RESOURCES_URL+'/images/noCoupon.png'" class="image" />
|
||||
<image src="@/static/images/noCoupon.png" class="image" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<view class="cash-audit">
|
||||
<view class="pictrue">
|
||||
<image :src="$VUE_APP_RESOURCES_URL+'/images/examine.png'" />
|
||||
<image src="@/static/images/examine.png" />
|
||||
</view>
|
||||
<view class="tip">提现申请已提交,等待人工审核</view>
|
||||
<view class="time">{{ time }}</view>
|
||||
|
@ -34,21 +34,21 @@
|
||||
<view class="sortNav acea-row row-middle" :class="fixedState === true ? 'on' : ''">
|
||||
<view class="sortItem" @click="sort('childCount')">
|
||||
团队排序
|
||||
<image :src="$VUE_APP_RESOURCES_URL+'/images/sort1.png'" v-if="childCount == 1" />
|
||||
<image :src="$VUE_APP_RESOURCES_URL+'/images/sort2.png'" v-if="childCount == 2" />
|
||||
<image :src="$VUE_APP_RESOURCES_URL+'/images/sort3.png'" v-if="childCount == 3" />
|
||||
<image src="@/static/images/sort1.png" v-if="childCount == 1" />
|
||||
<image src="@/static/images/sort2.png" v-if="childCount == 2" />
|
||||
<image src="@/static/images/sort3.png" v-if="childCount == 3" />
|
||||
</view>
|
||||
<view class="sortItem" @click="sort('numberCount')">
|
||||
金额排序
|
||||
<image :src="$VUE_APP_RESOURCES_URL+'/images/sort1.png'" v-if="numberCount == 1" />
|
||||
<image :src="$VUE_APP_RESOURCES_URL+'/images/sort2.png'" v-if="numberCount == 2" />
|
||||
<image :src="$VUE_APP_RESOURCES_URL+'/images/sort3.png'" v-if="numberCount == 3" />
|
||||
<image src="@/static/images/sort1.png" v-if="numberCount == 1" />
|
||||
<image src="@/static/images/sort2.png" v-if="numberCount == 2" />
|
||||
<image src="@/static/images/sort3.png" v-if="numberCount == 3" />
|
||||
</view>
|
||||
<view class="sortItem" @click="sort('orderCount')">
|
||||
订单排序
|
||||
<image :src="$VUE_APP_RESOURCES_URL+'/images/sort1.png'" v-if="orderCount == 1" />
|
||||
<image :src="$VUE_APP_RESOURCES_URL+'/images/sort2.png'" v-if="orderCount == 2" />
|
||||
<image :src="$VUE_APP_RESOURCES_URL+'/images/sort3.png'" v-if="orderCount == 3" />
|
||||
<image src="@/static/images/sort1.png" v-if="orderCount == 1" />
|
||||
<image src="@/static/images/sort2.png" v-if="orderCount == 2" />
|
||||
<image src="@/static/images/sort3.png" v-if="orderCount == 3" />
|
||||
</view>
|
||||
</view>
|
||||
<view :class="fixedState === true ? 'sortList' : ''">
|
||||
|
@ -43,18 +43,18 @@
|
||||
:key="listIndex"
|
||||
>
|
||||
<view>
|
||||
<view class="state">{{ item.title }}</view>
|
||||
<text class="state">{{ item.title }}</text>
|
||||
<view>
|
||||
<data-format :date="item.addTime"></data-format>
|
||||
</view>
|
||||
</view>
|
||||
<view class="num" v-if="item.pm == 1">+{{ item.number }}</view>
|
||||
<view class="num font-color-red" v-if="item.pm == 0">-{{ item.number }}</view>
|
||||
<text class="num" v-if="item.pm == 1">+{{ item.number }}</text>
|
||||
<text class="num font-color-red" v-if="item.pm == 0">-{{ item.number }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<!--<view class="list2" :hidden="current !== 1">-->
|
||||
<!--<view class="item acea-row row-between-wrapper" @click="goHome()">-->
|
||||
<!--<view class="pictrue"><image :src="$VUE_APP_RESOURCES_URL+'/images/score.png'" /></view>-->
|
||||
<!--<view class="pictrue"><image src="@/static/images/score.png" /></view>-->
|
||||
<!--<view class="name">购买商品可获得积分奖励</view>-->
|
||||
<!--<view class="earn">赚积分</view>-->
|
||||
<!--</view>-->
|
||||
@ -62,7 +62,7 @@
|
||||
<!--class="item acea-row row-between-wrapper"-->
|
||||
<!--@click="goSignIn()"-->
|
||||
<!-->-->
|
||||
<!--<view class="pictrue"><image :src="$VUE_APP_RESOURCES_URL+'/images/score.png'" /></view>-->
|
||||
<!--<view class="pictrue"><image src="@/static/images/score.png" /></view>-->
|
||||
<!--<view class="name">每日签到可获得积分奖励</view>-->
|
||||
<!--<view class="earn">赚积分</view>-->
|
||||
<!--</view>-->
|
||||
@ -131,7 +131,8 @@ export default {
|
||||
that.loaded = res.data.length < that.where.limit;
|
||||
that.loadTitle = that.loaded ? "人家是有底线的" : "上拉加载更多";
|
||||
that.where.page = that.where.page + 1;
|
||||
that.list.push.apply(that.list, res.data);
|
||||
that.list.push.apply(that.list, res.data);
|
||||
console.log(that.list)
|
||||
},
|
||||
err => {
|
||||
uni.showToast({
|
||||
|
@ -1,211 +1,183 @@
|
||||
<template>
|
||||
<view class="sign">
|
||||
<view class="header bg-color-red">
|
||||
<view class="headerCon acea-row row-between-wrapper">
|
||||
<view class="left acea-row row-between-wrapper">
|
||||
<view class="pictrue">
|
||||
<image :src="userInfo.avatar" />
|
||||
</view>
|
||||
<view class="text">
|
||||
<view class="line1">{{ userInfo.nickname }}</view>
|
||||
<view class="integral acea-row">
|
||||
<text>积分: {{ userInfo.integral }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view @click="goSignRecord()" class="right acea-row row-middle">
|
||||
<view class="iconfont icon-caidan"></view>
|
||||
<view>明细</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="wrapper">
|
||||
<view class="list acea-row row-between-wrapper">
|
||||
<view
|
||||
class="item"
|
||||
v-for="(item, signSystemListIndex) in signSystemList"
|
||||
:key="signSystemListIndex"
|
||||
>
|
||||
<view
|
||||
:class="signSystemListIndex + 1 === signSystemList.length ? 'rewardTxt' : ''"
|
||||
>{{ item.day }}</view>
|
||||
<view
|
||||
class="venus"
|
||||
:class="
|
||||
(signSystemListIndex + 1 === signSystemList.length ? 'reward' : '') +
|
||||
' ' +
|
||||
(sign_index >= signSystemListIndex + 1 ? 'venusSelect' : '')
|
||||
"
|
||||
></view>
|
||||
<view
|
||||
class="num"
|
||||
:class="sign_index >= signSystemListIndex + 1 ? 'on' : ''"
|
||||
>+{{ item.signNum }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<!--加在 but 上 on 为已签到-->
|
||||
<view
|
||||
class="but bg-color-red"
|
||||
:class="userInfo.is_day_sgin ? 'on' : ''"
|
||||
@click="goSign"
|
||||
>{{ userInfo.isDaySign ? "已签到" : "立即签到" }}</view>
|
||||
<view class="lock"></view>
|
||||
</view>
|
||||
<view class="wrapper wrapper2">
|
||||
<view class="tip">已累计签到</view>
|
||||
<view class="list2 acea-row row-center row-bottom">
|
||||
<view
|
||||
class="item"
|
||||
v-for="(item, signCountIndex) in signCount"
|
||||
:key="signCountIndex"
|
||||
>{{ item || 0 }}</view>
|
||||
<view class="data">天</view>
|
||||
</view>
|
||||
<view class="tip2">据说连续签到第{{ day }}天可获得超额积分,一定要坚持签到哦~~~</view>
|
||||
<view class="list3">
|
||||
<view
|
||||
class="item acea-row row-between-wrapper"
|
||||
v-for="(item, signListIndex) in signList"
|
||||
:key="signListIndex"
|
||||
>
|
||||
<view>
|
||||
<view class="name line1">{{ item.title }}</view>
|
||||
<view class="data">{{ item.addTime }}</view>
|
||||
</view>
|
||||
<view class="num font-color-red">+{{ item.number }}</view>
|
||||
</view>
|
||||
<view
|
||||
@click="goSignRecord()"
|
||||
class="Loads acea-row row-center-wrapper"
|
||||
v-if="signList.length > 0"
|
||||
>
|
||||
点击加载更多
|
||||
<view class="iconfont icon-xiangyou acea-row row-center-wrapper"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="signTip acea-row row-center-wrapper" :class="active === true ? 'on' : ''">
|
||||
<view class="signTipLight loadingpic">
|
||||
<image :src="$VUE_APP_RESOURCES_URL+'/images/light.png'" />
|
||||
</view>
|
||||
<view class="signTipCon">
|
||||
<view class="state">签到成功</view>
|
||||
<view class="integral">获得{{ integral }}积分</view>
|
||||
<view class="signTipBnt" @click="close">好的</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="mask" @touchmove.prevent :hidden="active === false"></view>
|
||||
</view>
|
||||
<view class="sign">
|
||||
<view class="header bg-color-red">
|
||||
<view class="headerCon acea-row row-between-wrapper">
|
||||
<view class="left acea-row row-between-wrapper">
|
||||
<view class="pictrue">
|
||||
<image :src="userInfo.avatar" />
|
||||
</view>
|
||||
<view class="text">
|
||||
<view class="line1">{{ userInfo.nickname }}</view>
|
||||
<view class="integral acea-row">
|
||||
<text>积分: {{ userInfo.integral }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view @click="goSignRecord()" class="right acea-row row-middle">
|
||||
<view class="iconfont icon-caidan"></view>
|
||||
<view>明细</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="wrapper">
|
||||
<view class="list acea-row row-between-wrapper">
|
||||
<view class="item" v-for="(item, signSystemListIndex) in signSystemList" :key="signSystemListIndex">
|
||||
<view :class="signSystemListIndex + 1 === signSystemList.length ? 'rewardTxt' : ''">{{ item.day }}</view>
|
||||
<view class="venus" :class=" (signSystemListIndex + 1 === signSystemList.length ? 'reward' : '') +' ' + (sign_index >= signSystemListIndex + 1 ? 'venusSelect' : '')"></view>
|
||||
<view class="num" :class="sign_index >= signSystemListIndex + 1 ? 'on' : ''">+{{ item.sign_num }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<!--加在 but 上 on 为已签到-->
|
||||
<view class="but bg-color-red" :class="userInfo.is_day_sgin ? 'on' : ''" @click="goSign">{{ userInfo.isDaySign ? "已签到" : "立即签到" }}</view>
|
||||
<view class="lock"></view>
|
||||
</view>
|
||||
<view class="wrapper wrapper2">
|
||||
<view class="tip">已累计签到</view>
|
||||
<view class="list2 acea-row row-center row-bottom">
|
||||
<view class="item" v-for="(item, signCountIndex) in signCount" :key="signCountIndex">{{ item || 0 }}</view>
|
||||
<view class="data">天</view>
|
||||
</view>
|
||||
<view class="tip2">据说连续签到第{{ day }}天可获得超额积分,一定要坚持签到哦~~~</view>
|
||||
<view class="list3">
|
||||
<view class="item acea-row row-between-wrapper" v-for="(item, signListIndex) in signList" :key="signListIndex">
|
||||
<view>
|
||||
<view class="name line1">{{ item.title }}</view>
|
||||
<view class="data">{{ item.addTime }}</view>
|
||||
</view>
|
||||
<view class="num font-color-red">+{{ item.number }}</view>
|
||||
</view>
|
||||
<view @click="goSignRecord()" class="Loads acea-row row-center-wrapper" v-if="signList.length > 0">
|
||||
点击加载更多
|
||||
<view class="iconfont icon-xiangyou acea-row row-center-wrapper"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="signTip acea-row row-center-wrapper" :class="active === true ? 'on' : ''">
|
||||
<view class="signTipLight loadingpic">
|
||||
<image src="@/static/images/light.png" />
|
||||
</view>
|
||||
<view class="signTipCon">
|
||||
<view class="state">签到成功</view>
|
||||
<view class="integral">获得{{ integral }}积分</view>
|
||||
<view class="signTipBnt" @click="close">好的</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="mask" @touchmove.prevent :hidden="active === false"></view>
|
||||
</view>
|
||||
</template>
|
||||
<style scoped lang="less">
|
||||
.Loads .iconfont {
|
||||
font-size: 0.25*100rpx;
|
||||
margin: 0.02*100rpx 0 0 0.1*100rpx;
|
||||
}
|
||||
.Loads .iconfont {
|
||||
font-size: 0.25*100rpx;
|
||||
margin: 0.02*100rpx 0 0 0.1*100rpx;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
import {
|
||||
postSignUser,
|
||||
getSignConfig,
|
||||
postSignIntegral,
|
||||
getSignList
|
||||
} from "@/api/user";
|
||||
import { add } from "@/utils/bc";
|
||||
import {
|
||||
postSignUser,
|
||||
getSignConfig,
|
||||
postSignIntegral,
|
||||
getSignList
|
||||
} from "@/api/user";
|
||||
import {
|
||||
add
|
||||
} from "@/utils/bc";
|
||||
|
||||
export default {
|
||||
name: "Sign",
|
||||
components: {},
|
||||
props: {},
|
||||
data: function() {
|
||||
return {
|
||||
userInfo: {},
|
||||
integral: 0,
|
||||
signCount: [],
|
||||
sign_index: 0,
|
||||
signSystemList: [],
|
||||
signList: [],
|
||||
page: 1,
|
||||
limit: 3,
|
||||
active: false,
|
||||
day: ""
|
||||
};
|
||||
},
|
||||
mounted: function() {
|
||||
this.signUser();
|
||||
this.signConfig();
|
||||
this.getSignList();
|
||||
},
|
||||
methods: {
|
||||
goSignRecord() {
|
||||
this.$yrouter.push("/pages/user/signIn/SignRecord/index");
|
||||
},
|
||||
// js给数字补0;num:需要补0的数字,length:长度(补到多少位);
|
||||
PrefixInteger: function(num, length) {
|
||||
return (Array(length).join("0") + num).slice(-length).split("");
|
||||
},
|
||||
//数字转中文
|
||||
Rp: function(n) {
|
||||
var cnum = ["零", "一", "二", "三", "四", "五", "六", "七", "八", "九"];
|
||||
var s = "";
|
||||
n = "" + n; // 数字转为字符串
|
||||
for (var i = 0; i < n.length; i++) {
|
||||
s += cnum[parseInt(n.charAt(i))];
|
||||
}
|
||||
return s;
|
||||
},
|
||||
// 获取用户信息
|
||||
signUser: function() {
|
||||
let that = this;
|
||||
postSignUser({ sign: 1 }).then(res => {
|
||||
res.data.integral = parseInt(res.data.integral);
|
||||
var sumSginDay = res.data.sumSignDay;
|
||||
that.userInfo = res.data;
|
||||
that.signCount = that.PrefixInteger(sumSginDay, 4);
|
||||
that.sign_index = parseInt(res.data.signNum);
|
||||
});
|
||||
},
|
||||
// 签到配置
|
||||
signConfig: function() {
|
||||
let that = this;
|
||||
getSignConfig().then(res => {
|
||||
that.signSystemList = res.data;
|
||||
that.day = that.Rp(that.signSystemList.length);
|
||||
});
|
||||
},
|
||||
// 用户签到
|
||||
goSign: function() {
|
||||
let that = this,
|
||||
sumSginDay = that.userInfo.sumSignDay;
|
||||
if (that.userInfo.is_day_sgin){
|
||||
uni.showToast({
|
||||
title: "您今日已签到!",
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
return
|
||||
}
|
||||
postSignIntegral().then(res => {
|
||||
that.active = true;
|
||||
that.integral = res.data.integral;
|
||||
let sign_index = parseInt(that.sign_index + 1);
|
||||
that.sign_index =
|
||||
sign_index > that.signSystemList.length ? 1 : sign_index;
|
||||
that.signCount = that.PrefixInteger(sumSginDay + 1, 4);
|
||||
that.userInfo.is_day_sgin = true;
|
||||
that.userInfo.integral = add(that.userInfo.integral, res.data.integral);
|
||||
that.getSignList();
|
||||
});
|
||||
},
|
||||
// 获取签到列表;
|
||||
getSignList: function() {
|
||||
let that = this;
|
||||
getSignList(that.page, that.limit).then(res => {
|
||||
that.signList = res.data;
|
||||
});
|
||||
},
|
||||
close: function() {
|
||||
this.active = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
export default {
|
||||
name: "Sign",
|
||||
components: {},
|
||||
props: {},
|
||||
data: function() {
|
||||
return {
|
||||
userInfo: {},
|
||||
integral: 0,
|
||||
signCount: [],
|
||||
sign_index: 0,
|
||||
signSystemList: [],
|
||||
signList: [],
|
||||
page: 1,
|
||||
limit: 3,
|
||||
active: false,
|
||||
day: ""
|
||||
};
|
||||
},
|
||||
mounted: function() {
|
||||
this.signUser();
|
||||
this.signConfig();
|
||||
this.getSignList();
|
||||
},
|
||||
methods: {
|
||||
goSignRecord() {
|
||||
this.$yrouter.push("/pages/user/signIn/SignRecord/index");
|
||||
},
|
||||
// js给数字补0;num:需要补0的数字,length:长度(补到多少位);
|
||||
PrefixInteger: function(num, length) {
|
||||
return (Array(length).join("0") + num).slice(-length).split("");
|
||||
},
|
||||
//数字转中文
|
||||
Rp: function(n) {
|
||||
var cnum = ["零", "一", "二", "三", "四", "五", "六", "七", "八", "九"];
|
||||
var s = "";
|
||||
n = "" + n; // 数字转为字符串
|
||||
for (var i = 0; i < n.length; i++) {
|
||||
s += cnum[parseInt(n.charAt(i))];
|
||||
}
|
||||
return s;
|
||||
},
|
||||
// 获取用户信息
|
||||
signUser: function() {
|
||||
let that = this;
|
||||
postSignUser({
|
||||
sign: 1
|
||||
}).then(res => {
|
||||
res.data.integral = parseInt(res.data.integral);
|
||||
var sumSginDay = res.data.sumSignDay;
|
||||
that.userInfo = res.data;
|
||||
that.signCount = that.PrefixInteger(sumSginDay, 4);
|
||||
that.sign_index = parseInt(res.data.signNum);
|
||||
});
|
||||
},
|
||||
// 签到配置
|
||||
signConfig: function() {
|
||||
let that = this;
|
||||
getSignConfig().then(res => {
|
||||
that.signSystemList = res.data;
|
||||
that.day = that.Rp(that.signSystemList.length);
|
||||
});
|
||||
},
|
||||
// 用户签到
|
||||
goSign: function() {
|
||||
let that = this,
|
||||
sumSginDay = that.userInfo.sumSignDay;
|
||||
if (that.userInfo.is_day_sgin) {
|
||||
uni.showToast({
|
||||
title: "您今日已签到!",
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
return
|
||||
}
|
||||
postSignIntegral().then(res => {
|
||||
that.active = true;
|
||||
that.integral = res.data.integral;
|
||||
let sign_index = parseInt(that.sign_index + 1);
|
||||
that.sign_index =
|
||||
sign_index > that.signSystemList.length ? 1 : sign_index;
|
||||
that.signCount = that.PrefixInteger(sumSginDay + 1, 4);
|
||||
that.userInfo.is_day_sgin = true;
|
||||
that.userInfo.integral = add(that.userInfo.integral, res.data.integral);
|
||||
that.getSignList();
|
||||
});
|
||||
},
|
||||
// 获取签到列表;
|
||||
getSignList: function() {
|
||||
let that = this;
|
||||
getSignList(that.page, that.limit).then(res => {
|
||||
that.signList = res.data;
|
||||
});
|
||||
},
|
||||
close: function() {
|
||||
this.active = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user