瀏覽代碼

签到页优化

zaijin 2 年之前
父節點
當前提交
a47d2074d3
共有 2 個文件被更改,包括 17 次插入9 次删除
  1. 1 0
      h5_web/components/clock-learn/index.vue
  2. 16 9
      h5_web/pages/offlineSignin/offlineSignin.vue

+ 1 - 0
h5_web/components/clock-learn/index.vue

@@ -67,6 +67,7 @@
 					hours = hours - 12;
 					this.apm = 'PM'
 				}
+				hours = hours >= 10 ? hours : ('0' + hours);
 				let minutes = date.getMinutes().toString();
 				minutes = minutes >= 10 ? minutes : ('0' + minutes);
 				let seconds = date.getSeconds().toString();

+ 16 - 9
h5_web/pages/offlineSignin/offlineSignin.vue

@@ -81,16 +81,23 @@
 					})
 					.then(res => {
 						if (res.code === 200) {
-							this.$refs.uToast.show({
-								title: res.msg || '签到成功!',
-								type: 'success',
-								duration: 3000
+							// this.$refs.uToast.show({
+							// 	title: res.msg || '签到成功!',
+							// 	type: 'success',
+							// 	duration: 3000
+							// });
+							uni.showModal({
+								title: '提示',
+								content: `${res.msg || '签到成功'}, 是否返回首页?`,
+								showCancel: false,
+								success: function(res) {
+									if (res.confirm) {
+										uni.switchTab({
+											url: '/pages/index/index'
+										})
+									}
+								}
 							});
-							setTimeout(() => {
-								uni.switchTab({
-									url: '/pages/index/index'
-								})
-							}, 3000)
 						} else {
 							this.$refs.uToast.show({
 								title: '签到失败!' + res.msg,