diff --git a/manifest.json b/manifest.json index 803c679..b0e635b 100644 --- a/manifest.json +++ b/manifest.json @@ -55,7 +55,10 @@ "urlCheck" : false, "es6" : true }, - "usingComponents" : true + "usingComponents" : true, + "optimization" : { + "subpackages" : true + } }, "mp-alipay" : { "usingComponents" : true diff --git a/pages-home/home/active.vue b/pages-home/home/active.vue index ba9b566..9ccf2d4 100644 --- a/pages-home/home/active.vue +++ b/pages-home/home/active.vue @@ -35,7 +35,7 @@ import VNavigationBar from '@/components/VNavigationBar.vue' import request from "@/utils/request"; import {getUserInfoRequest} from "@/utils/common.js"; -import {getToken,setUserInfo} from '@/utils/auth.js' +import {getToken,setUserInfo,getUserInfo} from '@/utils/auth.js' export default { components: { VNavigationBar, @@ -76,13 +76,25 @@ export default { }) }else{ console.log("已登录") - this.getUserInfos() + if(!getUserInfo()){ + console.log("没有用户信息") + this.getUserInfos() + }else{ + this.customInfo = JSON.parse(getUserInfo()) + this.getActive() + } } }, onLoad(data) { - this.getActive() + }, methods: { + preventKeyboard(e) { + // 阻止键盘弹出 + e.preventDefault(); + // 将焦点移除,这样就不会有键盘弹出 + e.target.blur(); + }, isNumber(value) { return /^\d+(\.\d+)?$/.test(value); }, @@ -108,12 +120,27 @@ export default { }, //获取当前登录用户信息 async getUserInfos() { - await getUserInfoRequest() - await this.getActive() + request({ + url: "/userClient/customer/getUserCustomer", + method: 'get', + params:{} + }).then(res=>{ + if(!res.data){ + uni.reLaunch({ + url: '/pages/my/register' + }) + }else{ + setUserInfo(JSON.stringify(res.data)) + this.customInfo = res.data + this.getActive() + } + }) }, //查询营销活动列表 async getActive() { - this.customInfo = JSON.parse(uni.getStorageSync('customerInfo')) + this.activeList=[] + this.couponList=[] + this.array=[] const data = { cusId: this.customInfo.id } @@ -265,9 +292,7 @@ export default { flex: 1; height: 0; box-sizing: border-box; - padding: 30rpx 0; - margin: 0 32rpx; - + padding: 30rpx 32rpx; display: flex; flex-direction: column; row-gap: 20rpx; diff --git a/pages-order/orderDetail/orderDetail.vue b/pages-order/orderDetail/orderDetail.vue index aa86d42..271929b 100644 --- a/pages-order/orderDetail/orderDetail.vue +++ b/pages-order/orderDetail/orderDetail.vue @@ -93,7 +93,7 @@