diff --git a/api/login.js b/api/login.js index f413ba8..af9a1a0 100644 --- a/api/login.js +++ b/api/login.js @@ -14,6 +14,16 @@ export function resetByMobile(params) { }); } + +//获取自动发券 +export function getAutoCoup(){ + return http.request({ + url:`/promotion/coupon/activity`, + method:"GET", + needToken: true, + }); +} + /** * 账号密码登陆 * @params password diff --git a/pages/passport/login.vue b/pages/passport/login.vue index 27328b7..7029dff 100644 --- a/pages/passport/login.vue +++ b/pages/passport/login.vue @@ -564,6 +564,7 @@ */ storage.setUserInfo(user.data.result); storage.setHasLogin(true); + storage.setAutoCp(0) // 登录成功 uni.showToast({ title: "登录成功!", diff --git a/pages/tabbar/home/index.vue b/pages/tabbar/home/index.vue index ea9406e..6d693ca 100644 --- a/pages/tabbar/home/index.vue +++ b/pages/tabbar/home/index.vue @@ -14,6 +14,14 @@ export default { backgroundColor: "#fff", }, }; + }, + onShow(){ + setTimeout(()=>{ + this.$refs.tpl.firstGetAuto(); + },1000) + }, + methods: { + }, onReachBottom(){ // 给子级监听触底加载 diff --git a/pages/tabbar/home/views.vue b/pages/tabbar/home/views.vue index e5b93b4..115be6f 100644 --- a/pages/tabbar/home/views.vue +++ b/pages/tabbar/home/views.vue @@ -1,5 +1,37 @@