完善签到

This commit is contained in:
2025-05-07 17:42:12 +08:00
parent 6b5c475dd1
commit 35967a152c
184 changed files with 2678 additions and 1440 deletions

View File

@ -97,56 +97,10 @@ __webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "recyclableRender", function() { return recyclableRender; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "components", function() { return components; });
var components
try {
components = {
uImage: function () {
return __webpack_require__.e(/*! import() | components/uview-ui/components/u-image/u-image */ "components/uview-ui/components/u-image/u-image").then(__webpack_require__.bind(null, /*! @/components/uview-ui/components/u-image/u-image.vue */ 348))
},
uButton: function () {
return __webpack_require__.e(/*! import() | components/uview-ui/components/u-button/u-button */ "components/uview-ui/components/u-button/u-button").then(__webpack_require__.bind(null, /*! @/components/uview-ui/components/u-button/u-button.vue */ 334))
},
}
} catch (e) {
if (
e.message.indexOf("Cannot find module") !== -1 &&
e.message.indexOf(".vue") !== -1
) {
console.error(e.message)
console.error("1. 排查组件名称拼写是否正确")
console.error(
"2. 排查组件是否符合 easycom 规范文档https://uniapp.dcloud.net.cn/collocation/pages?id=easycom"
)
console.error(
"3. 若组件不符合 easycom 规范,需手动引入,并在 components 中注册该组件"
)
} else {
throw e
}
}
var render = function () {
var _vm = this
var _h = _vm.$createElement
var _c = _vm._self._c || _h
var a0 = {
color: _vm.themeColor,
border: "1px solid " + _vm.themeColor,
width: "120rpx",
height: "60rpx",
fontSize: "28rpx",
}
_vm.$mp.data = Object.assign(
{},
{
$root: {
a0: a0,
},
}
)
}
var recyclableRender = false
var render = function () {}
var staticRenderFns = []
render._withStripped = true
var recyclableRender
var components
@ -182,6 +136,8 @@ Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _user = __webpack_require__(/*! @/api/user */ 34);
var _tools = __webpack_require__(/*! @/utils/tools.js */ 41);
//
//
//
@ -271,7 +227,122 @@ exports.default = void 0;
//
//
//
var _default = {};
//
//
//
//
//
//
//
//
var _default = {
data: function data() {
return {
// 积分
integral: 0,
avatar: "",
signList: [],
showPop: false,
canSign: 0,
addIntegral: 0,
addGrowth: 0,
signDays: 0,
makeInegral: [],
weekDay: 1
};
},
onLoad: function onLoad() {
this.userSignFun = (0, _tools.trottle)(this.userSignFun, 1000, this);
},
onShow: function onShow() {
this.getSignListFun();
},
methods: {
// 获取签到数据
getSignListFun: function getSignListFun() {
var _this = this;
(0, _user.getSignList)().then(function (res) {
if (res.code == 1) {
var sign_list = res.data.sign_list;
console.log("sign_list>>>", sign_list);
_this.signList = sign_list;
_this.integral = res.data.user.user_integral;
_this.canSign = res.data.user.today_sign;
_this.signDays = res.data.user.days;
_this.weekDay = res.data.user.week_day;
_this.makeInegral = res.data.make_inegral;
}
});
},
// 用户开始签到
userSignFun: function userSignFun() {
var _this2 = this;
if (this.canSign == 1) {
return;
}
(0, _user.userSign)().then(function (res) {
if (res.code == 1) {
var _res$data = res.data,
days = _res$data.days,
growth = _res$data.growth,
integral = _res$data.integral;
_this2.addIntegral = integral;
_this2.signDays = days;
_this2.getSignListFun();
}
});
}
},
computed: {
// 处理签到图片显示
signinCurrent: function signinCurrent() {
var _this3 = this;
return function (item) {
// 如果签到天数为0的话,也指向第一天的高亮图片
var day = _this3.signDays || 1;
if (day == item.days && _this3.canSign == 0) {
// 当天日期
return "".concat(_this3.cloudPath, "img/icon_signin_white.png");
} else if (item.status == 0) {
// 未签到
return "".concat(_this3.cloudPath, "img/icon_signin_gray.png");
} else if (item.status == 1) {
// 已签到
return "".concat(_this3.cloudPath, "img/icon_signin_blue.png");
}
};
},
// 处理签到class显示
getDayActive: function getDayActive() {
var _this4 = this;
return function (item) {
var obj = {
'sigin-day': true,
'column-center': true
};
// 如果签到天数为0的话,也指向第一天的高亮样式
var day = _this4.signDays || 1;
if (day == item.days && _this4.canSign == 0) {
// 当天日期
return Object.assign(obj, {
'last': true
});
} else if (item.status == 0) {
// 未签到
return Object.assign(obj, {
'expire': true
});
} else if (item.status == 1) {
// 已签到
return Object.assign(obj, {
'normal': true
});
}
};
}
}
};
exports.default = _default;
/***/ }),