diff --git a/api/integral.js b/api/integral.js new file mode 100644 index 0000000..8c7660e --- /dev/null +++ b/api/integral.js @@ -0,0 +1,18 @@ +import request from '@/utils/request' + +export default { + + getByPage(data) { + return request({ + url: '/oil-finance/oilCustomerIntegralRecord/getByPage', + method: 'post', + data: data + }) + }, + getByCustomerId(customerId) { + return request({ + url: `/oil-finance/oilCustomerIntegralAccount/getByCustomerId/${customerId}`, + method: 'get' + }) + }, +} diff --git a/pages.json b/pages.json index 9402493..9d855c1 100644 --- a/pages.json +++ b/pages.json @@ -34,10 +34,14 @@ "style": { "navigationBarTitleText": "星油云" // "enablePullDownRefresh": true } - } - - - , { + }, + { + "path": "pages/tabbar/user/integralRecord", + "style": { + "navigationBarTitleText": "" + } + }, + { "path": "pages/tabbar/qrCenter/qrCenter", "style": { "navigationBarTitleText": "", diff --git a/pages/tabbar/user/integralRecord.vue b/pages/tabbar/user/integralRecord.vue new file mode 100644 index 0000000..ef868ec --- /dev/null +++ b/pages/tabbar/user/integralRecord.vue @@ -0,0 +1,167 @@ + + + + + diff --git a/pages/tabbar/user/user.vue b/pages/tabbar/user/user.vue index 6a81ace..35c67f4 100644 --- a/pages/tabbar/user/user.vue +++ b/pages/tabbar/user/user.vue @@ -109,24 +109,35 @@ - + + + + 我的积分 + + + + + + {{balance}} + + + - + 专属客服 - + - - + 关于我们 @@ -143,6 +154,7 @@ import oilSiteApi from '@/api/oil-site.js' import SwitchEnterprises from '@/components/SwitchEnterprises.vue' import accountApi from '@/api/account.js' + import integralServe from '@/api/integral.js' export default { components: { SwitchEnterprises @@ -163,7 +175,8 @@ isCompany: uni.getStorageSync('accountStatus'), user: uni.getStorageSync('user'), wxInfo: uni.getStorageSync('wxInfo'), - userTotal: {} + userTotal: {}, + balance: '' }; }, onShow() { @@ -171,8 +184,21 @@ this.getAuthInfo() this.getAmount(); this.upadteCompanyCard() + this.getByCustomerId() }, methods: { + goIntegral() { + uni.navigateTo({ + url: './integralRecord' + }) + }, + getByCustomerId() { + integralServe.getByCustomerId(this.user.id).then(res => { + if (res.code === 20000) { + this.balance = res.data.balance + } + }) + }, logout() { this.isSwitchEnterprises = false },