xiabx 5 лет назад
Родитель
Сommit
b1966ec5a5
2 измененных файлов с 22 добавлено и 3 удалено
  1. 4 0
      src/api/index.js
  2. 18 3
      src/components/sign/index.ux

+ 4 - 0
src/api/index.js

@@ -91,3 +91,7 @@ export const userBind = (params) => {
   return fly.post(`/user/bindPhone`,params);
 };
 
+//用户签到
+export const userSign = () => {
+  return fly.get(`/sign`);
+};

+ 18 - 3
src/components/sign/index.ux

@@ -16,7 +16,8 @@
 	</div>
 </template>
 <script>
-// 子组件
+import { userSign } from "../../api/index";
+
 export default {
 	data: {
 		signList: [
@@ -27,10 +28,24 @@ export default {
 			{ day: 5, iconType: 'coin', fee: 50 },
 			{ day: 6, iconType: 'coin', fee: 50 },
 			{ day: 7, iconType: 'gift', fee: 150 },
-		]
+		],
+		signData:{
+			days:0,
+			fee:0
+		}
 	},
 	onInit() {
-
+		this.sign();
+	},
+	async sign() {
+		console.log(this.signList,'dddd')
+		let res =	await userSign();
+		this.signData=res;
+		this.signList.forEach(item => {
+			if(item.day<=res.days){
+				item.iconType='checked';
+			}
+		});
 	},
 	setSignPop() {
 		this.$dispatch('dispathEvt')