李双庆 1 year ago
parent
commit
1b405da38e
  1. 15
      api/agreement.js
  2. 34
      api/member.js
  3. 27
      pages/common/privacy_agreement.vue
  4. 31
      pages/student/my/my.vue

15
api/agreement.js

@ -0,0 +1,15 @@
import http from '../common/axios.js'
//获取学员信息
function userAgreement(data) {
let url = '/agreement/'+data
return http.get(url,data).then(res => {
return res;
})
}
export default {
userAgreement,
}

34
api/member.js

@ -17,7 +17,41 @@ function login(data) {
} }
//获取学员信息
function member(data) {
let url = '/member/member'
return http.get(url,data).then(res => {
return res;
})
}
export default { export default {
login, login,
medication_login, medication_login,
member,
} }

27
pages/common/privacy_agreement.vue

@ -5,6 +5,7 @@
</template> </template>
<script> <script>
import agreement from '@/api/agreement.js';
export default { export default {
data() { data() {
return { return {
@ -20,14 +21,26 @@
// //
init(type) { init(type) {
if (type == 1) { if (type == 1) {
// //
this.text = '用户协议用户协议用户协议用户协议用户协议用户协议用户协议用户协议用户协议用户协议用户协议用户协议用户协议用户协议用户协议用户协议用户协议用户协议用户协议用户协议用户协议用户协议用户协议用户协议' agreement.userAgreement('service').then(res => {
uni.setNavigationBarTitle({ if(res.code == 1){
title: '用户协议' this.text = res.data.content
}); }else{
this.text = ''
}
})
uni.setNavigationBarTitle({
title: '用户协议'
});
} else if (type == 2) { } else if (type == 2) {
// //
this.text = '隐私策略隐私策略隐私策略隐私策略隐私策略隐私策略隐私策略隐私策略隐私策略隐私策略隐私策略隐私策略隐私策略隐私策略隐私策略隐私策略隐私策略隐私策略隐私策略隐私策略隐私策略隐私策略隐私策略隐私策略' agreement.userAgreement('privacy').then(res => {
if(res.code == 1){
this.text = res.data.content
}else{
this.text = ''
}
})
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: '隐私策略' title: '隐私策略'
}); });

31
pages/student/my/my.vue

@ -2,7 +2,7 @@
<template> <template>
<view class="main_box"> <view class="main_box">
<view class="navbar_section"> <view class="navbar_section">
<view class="title">我的</view> <view class="title">我的</view>
</view> </view>
<view style="background:#29D3B4;"> <view style="background:#29D3B4;">
<!--用户信息--> <!--用户信息-->
@ -10,7 +10,7 @@
<view class="box"> <view class="box">
<view class="left" @click="personal_data"> <view class="left" @click="personal_data">
<image class="pic" src="http://www.firstui.cn:4000/vipdoc/img/img_logo.png"></image> <image class="pic" src="http://www.firstui.cn:4000/vipdoc/img/img_logo.png"></image>
<view class="name">包子皮</view> <view class="name">{{member_info.name}}</view>
</view> </view>
<view class="right" @click="setup"> <view class="right" @click="setup">
<image src="@/static/images/index/setup.png" style="width: 50rpx;height: 50rpx;"></image> <image src="@/static/images/index/setup.png" style="width: 50rpx;height: 50rpx;"></image>
@ -85,18 +85,30 @@
<script> <script>
import AQTabber from "@/components/AQ/AQTabber.vue" import AQTabber from "@/components/AQ/AQTabber.vue"
// import user from '@/api/user.js'; import member from '@/api/member.js';
export default { export default {
components: { components: {
AQTabber, AQTabber,
}, },
data() { data() {
return { return {
member_info: [],
} }
}, },
onLoad() {}, onLoad() {
this.member_init();
},
methods: { methods: {
//
member_init() {
member.member().then(res => {
if(res.code == 1){
this.member_info = res.data
}else{
this.member_info = []
}
})
},
// //
setup(item) { setup(item) {
uni.navigateTo({ uni.navigateTo({
@ -104,25 +116,25 @@
}) })
}, },
// //
feedback(){ feedback() {
uni.navigateTo({ uni.navigateTo({
url: '/pages/common/feedback' url: '/pages/common/feedback'
}) })
}, },
// //
lesson_consumption(){ lesson_consumption() {
uni.navigateTo({ uni.navigateTo({
url: '/pages/student/my/lesson_consumption' url: '/pages/student/my/lesson_consumption'
}) })
}, },
// //
my_members(){ my_members() {
uni.navigateTo({ uni.navigateTo({
url: '/pages/student/my/my_members' url: '/pages/student/my/my_members'
}) })
}, },
// //
personal_data(){ personal_data() {
uni.navigateTo({ uni.navigateTo({
url: '/pages/student/my/personal_data' url: '/pages/student/my/personal_data'
}) })
@ -280,6 +292,7 @@
padding: 6rpx 24rpx; padding: 6rpx 24rpx;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.item { .item {
padding: 35rpx 78rpx; padding: 35rpx 78rpx;
border-top: 1px solid #F2F2F2; border-top: 1px solid #F2F2F2;

Loading…
Cancel
Save