Commit 14c25d3b authored by 罗超's avatar 罗超

Merge branch 'master' of http://gitlab.oytour.com/viitto/mallapp

parents f2954b96 2190ac56
...@@ -2,15 +2,25 @@ ...@@ -2,15 +2,25 @@
"easycom": { "easycom": {
"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue" "^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
}, },
"pages": [{ "pages": [
{
"path": "pages/index/index"
},
{
"path": "pages/user-center/user-center"
},
{
"path": "pages/cart/cart"
},
{
"path": "pages/cats/cats"
},
{
"path": "pages/goods/goods" "path": "pages/goods/goods"
}, },
{
"path": "pages/cats/cats"
},
{
"path": "pages/index/index"
},
{ {
"path": "pages/webbox/webbox" "path": "pages/webbox/webbox"
}, },
......
This diff is collapsed.
<template>
<view>购物车</view>
</template>
<script>
</script>
<style>
</style>
<template>
<view>个人中心</view>
</template>
<script>
</script>
<style>
</style>
<template>
<view class="userStyle" v-if="!isloading">
<view class="userBox"></view>
<image :src='meueData.user_center.style_bg_pic_url' class="imgbg">
<!-- <image :src='user_info.avatar' class="headimg"></image> -->
<!-- <view style="width: 140rpx;height: 140rpx;background: #007AFF;"></view> -->
</image>
<tabbars></tabbars>
</view>
</template>
<script>
import tabbars from "@/components/tabbar/index";
export default{
data(){
return{
isloading: true,
pageTitle: "用户中心",
navHeight: 0,
contentHeight:0,
cstyle:{},
meueData:{},//菜单
user_info:{},//个人信息
bottommargin:0,
listbottom:0,
}
},
components:{
tabbars
},
onLoad() {
this.navHeight = this.$navHeight - 2;
this.cstyle = uni.getStorageSync("basedata")
? uni.getStorageSync("basedata").cat_style
: [];
if (this.cstyle.cat_style == "4") {
}
},
mounted(){
let currentPages = getCurrentPages();
let c = this.$uiConfig.is_bang ? 80 : 52;
this.bottommargin = (c-2)+'px';
this.listbottom = (c-2+50)+'px';
this.contentHeight = this.$utils.calcContentHeight(c);
let u = "/" + currentPages[currentPages.length - 1].route;
let pages = wx.getStorageSync("basedata")
? wx.getStorageSync("basedata").bar_title
: [];
console.log(wx.getStorageSync("basedata"))
console.log(u)
pages.forEach((x) => {
if (x.value == u) {
this.pageTitle = x.new_name ? x.new_name : x.name;
}
});
this.userinfo()
this.getmeue()
},
methods:{
goHome() {
uni.redirectTo({ url: "/pages/index/main" });
},
userinfo() {
uni.showNavigationBarLoading();
this.request(
{
url: "",
header:{
'X-Access-Token': 'Tc8G75W5llGY_UPwlHBscYEPs1a32cDJ',
'X-App-Platform': 'wxapp',
'X-App-Version':'4.2.47',
'X-Form-Id-List': JSON.stringify([]),
'X-Requested-With': 'XMLHttpRequest',
'X-User-Id': 21269
},
data: {
r: "api/user/user-info",
},
},
(res) => {
uni.hideNavigationBarLoading()
this.isloading = false;
console.log(res)
}
);
},
getmeue(){
uni.showNavigationBarLoading();
this.request(
{
url: "",
header:{
'X-Access-Token': 'Tc8G75W5llGY_UPwlHBscYEPs1a32cDJ',
'X-App-Platform': 'wxapp',
'X-App-Version':'4.2.47',
'X-Form-Id-List': JSON.stringify([]),
'X-Requested-With': 'XMLHttpRequest',
'X-User-Id': 21269
},
data: {
r: "api/user/config",
},
},
(res) => {
uni.hideNavigationBarLoading()
this.isloading = false;
console.log(res.data)
this.meueData = res.data.config;
this.user_info = res.data.user_info;
}
);
}
}
}
</script>
<style>
.userStyle .userBox{
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
}
.userStyle .imgbg{
width: 100%;
height: 330rpx;
position: relative;
display: flex;
flex-direction: row;
align-items: center;
}
.userStyle .headimg{
width: 140rpx;
height: 140rpx;
border-radius: 50%;
margin-left: 60rpx;
}
</style>
...@@ -5,7 +5,7 @@ export default { ...@@ -5,7 +5,7 @@ export default {
Vue.prototype.request = function(param, success, failed) { Vue.prototype.request = function(param, success, failed) {
//网络请求 //网络请求
uni.request({ uni.request({
url: this.host + param.url, url: this.host + "&r="+ param.data.r,
method: param.method || "GET", method: param.method || "GET",
header: param.header || { header: param.header || {
'content-type': "application/json" 'content-type': "application/json"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment