|
@@ -4,11 +4,12 @@
|
|
<tabBar :tabBarList="tabBarList" :routePath="routePath" @onTabBar="onTabBar" />
|
|
<tabBar :tabBarList="tabBarList" :routePath="routePath" @onTabBar="onTabBar" />
|
|
|
|
|
|
|
|
|
|
- <view class="topBox">
|
|
|
|
|
|
+ <view class="topBox" :style="{'background-image':`url(${picBase+'my_bg.png'})`}">
|
|
<view class="userBox">
|
|
<view class="userBox">
|
|
- <image class="avatar" @click="toUserInfo" :src="!userInfo?picBase+'defaultAvatar.png':userInfo.avatar" mode=""></image>
|
|
|
|
|
|
+ <image class="avatar" @click="toUserInfo"
|
|
|
|
+ :src="!userInfo.avatar?picBase+'defaultAvatar.png':userInfo.avatar" mode=""></image>
|
|
<view class="nickname" @click="toUserInfo" v-if="userInfo">
|
|
<view class="nickname" @click="toUserInfo" v-if="userInfo">
|
|
- {{!userInfo.name?'默认用户':userInfo.name}}
|
|
|
|
|
|
+ {{!userInfo.name?'默认用户':userInfo.name}}
|
|
</view>
|
|
</view>
|
|
<view class="nickname" @click="login" v-else>
|
|
<view class="nickname" @click="login" v-else>
|
|
立即登录
|
|
立即登录
|
|
@@ -16,10 +17,10 @@
|
|
<image class="icon" @click="toUserInfo" :src="picBase+'edit.png'" mode="" v-if="userInfo"></image>
|
|
<image class="icon" @click="toUserInfo" :src="picBase+'edit.png'" mode="" v-if="userInfo"></image>
|
|
</view>
|
|
</view>
|
|
|
|
|
|
- <view class="infoBox">
|
|
|
|
|
|
+ <view class="infoBox" :style="{'background-image':`url(${picBase+'user_bg.png'})`}">
|
|
<view class="left">
|
|
<view class="left">
|
|
- <image class="icon" :src="picBase+'edit.png'" mode=""></image>
|
|
|
|
- 当前剩余次数:2
|
|
|
|
|
|
+ <image class="icon" :src="picBase+'charge_yibiao.png'" mode=""></image>
|
|
|
|
+ 当前剩余次数:{{userInfo.diamond?userInfo.diamond:0}}
|
|
</view>
|
|
</view>
|
|
|
|
|
|
<view class="btn" @click="toCharge">
|
|
<view class="btn" @click="toCharge">
|
|
@@ -29,10 +30,10 @@
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
|
|
- <view class="contentBox">
|
|
|
|
|
|
+ <view class="contentBox" :style="{'background-image':`url(${picBase+'my_b_bg.png'})`}">
|
|
<view class="tabBox">
|
|
<view class="tabBox">
|
|
<view class="item" @click="toHuibenJilu">
|
|
<view class="item" @click="toHuibenJilu">
|
|
- <image class="icon" :src="picBase+'edit.png'" mode=""></image>
|
|
|
|
|
|
+ <image class="icon" :src="picBase+'my_hbjl.png'" mode=""></image>
|
|
<view class="right">
|
|
<view class="right">
|
|
<view class="t1">
|
|
<view class="t1">
|
|
绘本记录
|
|
绘本记录
|
|
@@ -44,7 +45,7 @@
|
|
</view>
|
|
</view>
|
|
|
|
|
|
<view class="item" @click="toTuguangDashi">
|
|
<view class="item" @click="toTuguangDashi">
|
|
- <image class="icon" :src="picBase+'edit.png'" mode=""></image>
|
|
|
|
|
|
+ <image class="icon" :src="picBase+'my_tgds.png'" mode=""></image>
|
|
<view class="right">
|
|
<view class="right">
|
|
<view class="t1">
|
|
<view class="t1">
|
|
推广大使
|
|
推广大使
|
|
@@ -59,10 +60,10 @@
|
|
<view class="serListBox">
|
|
<view class="serListBox">
|
|
<view class="item" v-for="(item,index) in serList" @click="toPage(index)">
|
|
<view class="item" v-for="(item,index) in serList" @click="toPage(index)">
|
|
<view class="left">
|
|
<view class="left">
|
|
- <image class="icon" src="../../static/other/edit.png" mode=""></image>
|
|
|
|
|
|
+ <image class="icon" :src="item.icon" mode=""></image>
|
|
{{item.name}}
|
|
{{item.name}}
|
|
</view>
|
|
</view>
|
|
- <image class="icon_r" src="../../static/other/arrR.png" mode=""></image>
|
|
|
|
|
|
+ <image class="icon_r" :src="picBase+'arrR.png'" mode=""></image>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -70,23 +71,27 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+ // import navBar from '@/components/navBar/index.vue'
|
|
|
|
+
|
|
import {
|
|
import {
|
|
|
|
+ getUserInfo,
|
|
login,
|
|
login,
|
|
- getUserInfo
|
|
|
|
|
|
+ addTeam
|
|
} from '@/api/index/index.js'
|
|
} from '@/api/index/index.js'
|
|
- // import navBar from '@/components/navBar/index.vue'
|
|
|
|
export default {
|
|
export default {
|
|
// components: {
|
|
// components: {
|
|
// navBar
|
|
// navBar
|
|
// },
|
|
// },
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
- userInfo:null,
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+ userInfo: null,
|
|
|
|
+
|
|
|
|
+
|
|
picBase: this.$picBase,
|
|
picBase: this.$picBase,
|
|
- navImg: require('@/static/other/logo.png'),
|
|
|
|
- tabBarList: [{
|
|
|
|
|
|
+ navImg: this.$picBase + 'logo.png',
|
|
|
|
+ tabBarList: [
|
|
|
|
+
|
|
|
|
+ {
|
|
"pagePath": "pages/index/index",
|
|
"pagePath": "pages/index/index",
|
|
"iconPath": "../../static/tabbar/index.png",
|
|
"iconPath": "../../static/tabbar/index.png",
|
|
"selectedIconPath": "../../static/tabbar/index_a.png",
|
|
"selectedIconPath": "../../static/tabbar/index_a.png",
|
|
@@ -104,25 +109,31 @@
|
|
|
|
|
|
|
|
|
|
serList: [{
|
|
serList: [{
|
|
|
|
+ name: '推广中心',
|
|
|
|
+ icon: this.$picBase + 'my_jl.png',
|
|
|
|
+ },
|
|
|
|
+ {
|
|
name: '推荐奖励',
|
|
name: '推荐奖励',
|
|
- icon: this.$picBase + 'edit.png',
|
|
|
|
|
|
+ icon: this.$picBase + 'my_jl.png',
|
|
},
|
|
},
|
|
{
|
|
{
|
|
name: '消费记录',
|
|
name: '消费记录',
|
|
- icon: this.$picBase + 'edit.png',
|
|
|
|
|
|
+ icon: this.$picBase + 'my_xfjl.png',
|
|
},
|
|
},
|
|
{
|
|
{
|
|
name: '客服中心',
|
|
name: '客服中心',
|
|
- icon: this.$picBase + 'edit.png',
|
|
|
|
|
|
+ icon: this.$picBase + 'my_kfzx.png',
|
|
},
|
|
},
|
|
{
|
|
{
|
|
name: '关于我们',
|
|
name: '关于我们',
|
|
- icon: this.$picBase + 'edit.png',
|
|
|
|
|
|
+ icon: this.$picBase + 'my_gywm.png',
|
|
},
|
|
},
|
|
]
|
|
]
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onLoad() {
|
|
onLoad() {
|
|
|
|
+
|
|
|
|
+ // console.log(this.picBase + 'defaultAvatar.png');
|
|
uni.hideTabBar()
|
|
uni.hideTabBar()
|
|
let routes = getCurrentPages(); // 获取当前打开过的页面路由数组
|
|
let routes = getCurrentPages(); // 获取当前打开过的页面路由数组
|
|
let curRoute = routes[routes.length - 1].route // 获取当前页面路由,也就是最后一个打开的页面路由
|
|
let curRoute = routes[routes.length - 1].route // 获取当前页面路由,也就是最后一个打开的页面路由
|
|
@@ -130,22 +141,32 @@
|
|
console.log('routePath', this.routePath);
|
|
console.log('routePath', this.routePath);
|
|
|
|
|
|
},
|
|
},
|
|
- async onShow(){
|
|
|
|
-
|
|
|
|
- if(uni.getStorageSync('token')){
|
|
|
|
|
|
+ async onShow() {
|
|
|
|
+
|
|
|
|
+ if (uni.getStorageSync('token')) {
|
|
this.getUserInfo()
|
|
this.getUserInfo()
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ async addTeam(p) {
|
|
|
|
+ let res1 = await addTeam(p)
|
|
|
|
+ console.log('我的-加入团队返回值--------2', res1);
|
|
|
|
+ if (res1.code == 0) {
|
|
|
|
+ console.log('我的--加入团队成功--------------------------------');
|
|
|
|
+ } else {
|
|
|
|
+ this.$toast(res1.message)
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+
|
|
async getUserInfo() {
|
|
async getUserInfo() {
|
|
let res1 = await getUserInfo()
|
|
let res1 = await getUserInfo()
|
|
console.log('用户信息返回值--------', res1);
|
|
console.log('用户信息返回值--------', res1);
|
|
if (res1.code == 0) {
|
|
if (res1.code == 0) {
|
|
uni.setStorageSync('userInfo', res1.data)
|
|
uni.setStorageSync('userInfo', res1.data)
|
|
- this.userInfo=res1.data
|
|
|
|
|
|
+ this.userInfo = res1.data
|
|
} else {
|
|
} else {
|
|
- this.$toast(res1.message)
|
|
|
|
|
|
+ this.$toast(res1.message)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
login() {
|
|
login() {
|
|
@@ -159,16 +180,24 @@
|
|
if (res.errMsg == 'login:ok') {
|
|
if (res.errMsg == 'login:ok') {
|
|
let parmas = {
|
|
let parmas = {
|
|
code: res.code,
|
|
code: res.code,
|
|
|
|
+ helpId: uni.getStorageSync('inviteInfo') ? uni.getStorageSync(
|
|
|
|
+ 'inviteInfo') : ''
|
|
}
|
|
}
|
|
console.log('登录所传的parmas参数:', parmas);
|
|
console.log('登录所传的parmas参数:', parmas);
|
|
let res1 = await login(parmas)
|
|
let res1 = await login(parmas)
|
|
-
|
|
|
|
|
|
+
|
|
console.log('登录返回值--------', res1);
|
|
console.log('登录返回值--------', res1);
|
|
if (res1.code == 0) {
|
|
if (res1.code == 0) {
|
|
|
|
+ // 处理加入团队逻辑
|
|
|
|
+ // _this.addTeam({
|
|
|
|
+ // id: uni.getStorageSync('inviteInfo')
|
|
|
|
+ // })
|
|
|
|
+
|
|
|
|
+
|
|
uni.hideLoading()
|
|
uni.hideLoading()
|
|
uni.setStorageSync('token', res1.data.token)
|
|
uni.setStorageSync('token', res1.data.token)
|
|
uni.setStorageSync('userInfo', res1.data.user_info)
|
|
uni.setStorageSync('userInfo', res1.data.user_info)
|
|
- _this.userInfo=res1.data.user_info
|
|
|
|
|
|
+ _this.userInfo = res1.data.user_info
|
|
_this.$toast('登录成功')
|
|
_this.$toast('登录成功')
|
|
// setTimeout(() => {
|
|
// setTimeout(() => {
|
|
// uni.reLaunch({
|
|
// uni.reLaunch({
|
|
@@ -177,7 +206,7 @@
|
|
// }, 1500)
|
|
// }, 1500)
|
|
} else {
|
|
} else {
|
|
uni.hideLoading()
|
|
uni.hideLoading()
|
|
- _this.$toast(res1.message)
|
|
|
|
|
|
+ _this.$toast(res1.message)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -185,21 +214,48 @@
|
|
},
|
|
},
|
|
toPage(i) {
|
|
toPage(i) {
|
|
if (i == 0) {
|
|
if (i == 0) {
|
|
|
|
+ if (!uni.getStorageSync('token')) {
|
|
|
|
+ return this.$toast('请登录后操作')
|
|
|
|
+ }
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
- url: '/pages/my/jiangli/index'
|
|
|
|
|
|
+ url: '/pages/my/pubCenter/index'
|
|
})
|
|
})
|
|
} else if (i == 1) {
|
|
} else if (i == 1) {
|
|
|
|
+ if (!uni.getStorageSync('token')) {
|
|
|
|
+ return this.$toast('请登录后操作')
|
|
|
|
+ }
|
|
|
|
+ uni.navigateTo({
|
|
|
|
+ url: '/pages/my/jiangli/index'
|
|
|
|
+ })
|
|
|
|
+ } else if (i == 2) {
|
|
|
|
+ if (!uni.getStorageSync('token')) {
|
|
|
|
+ return this.$toast('请登录后操作')
|
|
|
|
+ }
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
url: '/pages/my/myRecord/index?tabIndex=1'
|
|
url: '/pages/my/myRecord/index?tabIndex=1'
|
|
})
|
|
})
|
|
|
|
+ } else if (i == 3) {
|
|
|
|
+ uni.navigateTo({
|
|
|
|
+ url: '/pages/my/kefu/index'
|
|
|
|
+ })
|
|
|
|
+ } else if (i == 4) {
|
|
|
|
+ uni.navigateTo({
|
|
|
|
+ url: '/pages/my/aboutUs/index'
|
|
|
|
+ })
|
|
}
|
|
}
|
|
},
|
|
},
|
|
toTuguangDashi() {
|
|
toTuguangDashi() {
|
|
|
|
+ if (!uni.getStorageSync('token')) {
|
|
|
|
+ return this.$toast('请登录后操作')
|
|
|
|
+ }
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
url: '/pages/my/tuiguangDashi/index'
|
|
url: '/pages/my/tuiguangDashi/index'
|
|
})
|
|
})
|
|
},
|
|
},
|
|
toTuguangCenter() {
|
|
toTuguangCenter() {
|
|
|
|
+ if (!uni.getStorageSync('token')) {
|
|
|
|
+ return this.$toast('请登录后操作')
|
|
|
|
+ }
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
url: '/pages/my/pubCenter/index'
|
|
url: '/pages/my/pubCenter/index'
|
|
})
|
|
})
|
|
@@ -212,16 +268,25 @@
|
|
},
|
|
},
|
|
|
|
|
|
toCharge() {
|
|
toCharge() {
|
|
|
|
+ if (!uni.getStorageSync('token')) {
|
|
|
|
+ return this.$toast('请登录后操作')
|
|
|
|
+ }
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
url: '/pages/my/charge/index'
|
|
url: '/pages/my/charge/index'
|
|
})
|
|
})
|
|
},
|
|
},
|
|
toHuibenJilu() {
|
|
toHuibenJilu() {
|
|
|
|
+ if (!uni.getStorageSync('token')) {
|
|
|
|
+ return this.$toast('请登录后操作')
|
|
|
|
+ }
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
url: '/pages/my/huiBen_record/index'
|
|
url: '/pages/my/huiBen_record/index'
|
|
})
|
|
})
|
|
},
|
|
},
|
|
toUserInfo() {
|
|
toUserInfo() {
|
|
|
|
+ if (!uni.getStorageSync('token')) {
|
|
|
|
+ return this.$toast('请登录后操作')
|
|
|
|
+ }
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
url: '/pages/my/userInfo/index'
|
|
url: '/pages/my/userInfo/index'
|
|
})
|
|
})
|