Commit 9aaa5146 by 梁建民

js

parent 5ed7c6a8
......@@ -37,6 +37,7 @@ function addMember(id) {
App({
globalData: {
unReadMessageNum: 0,
token:wx.getStorageSync('access_token'),
isIPX: false //是否为iphone X
},
conn: {
......@@ -67,9 +68,9 @@ App({
success(res) {
if(res.data){
wx.switchTab({
url: '/pages/tab/home/home'
});
// wx.switchTab({
// url: '/pages/tab/home/home'
// });
}
}
......@@ -81,9 +82,9 @@ App({
success(res) {
if (res.authSetting['scope.userInfo']) {
// 已经授权
wx.switchTab({
url: '/pages/tab/home/home'
})
// wx.switchTab({
// url: '/pages/tab/home/home'
// })
}
}
})
......
// pages/tab/me/me.js
const http = require('../../../utils/util.js');
import {
apis
} from '../../../utils/api.js';
Page({
/**
* 页面的初始数据
*/
data: {
isShow:false
isShow: false,
userInfo:{
avatar:'',
mobile:''
},
business: {
goods: '',
inquiry: '',
offer: ''
}
},
/**
......@@ -13,6 +26,27 @@ Page({
*/
onLoad: function (options) {
//获取数量统计
http.getData(apis.countBusiness, 'GET', {
token: wx.getStorageSync('access_token')
}, (res) => {
if (res.errcode === 0) {
this.setData({
business: res.data
});
}
}, true);
http.getData(apis.userInfo, 'GET', {
token: wx.getStorageSync('access_token')
}, (res) => {
if (res.errcode === 0) {
this.setData({
userInfo: res.data
});
}
}, true);
},
/**
......@@ -62,5 +96,17 @@ Page({
*/
onShareAppMessage: function () {
},
/**
* 跳转地址
*/
toUrl: function (e) {
if (e.target.dataset.url) {
wx.navigateTo({
url: e.target.dataset.url
})
}
}
})
\ No newline at end of file
<view class="mine" hover-class="none" hover-stop-propagation="false">
<view class="head row verCenter">
<view class="pic">
<cover-image class="im" src="/res/images/imgs/test.jpg"></cover-image>
<cover-image class="im" src="{{userInfo.avatar ? userInfo.avatar:'/res/images/imgs/default.png'}}"></cover-image>
</view>
<view class="text">
<text class="t1">深圳市猎芯科技有限公司</text>
......@@ -20,15 +20,15 @@
</view>
<view class="tab-bar row verCenter rowCenter">
<view class="wrap">
<text class="t1">513</text>
<text class="t1">{{business.goods}}</text>
<text class="t2">商品</text>
</view>
<view class="wrap">
<text class="t1">53</text>
<text class="t1">{{business.inquiry}}</text>
<text class="t2">询价</text>
</view>
<view class="wrap">
<text class="t1">513</text>
<text class="t1">{{business.offer}}</text>
<text class="t2">报价</text>
</view>
</view>
......@@ -54,7 +54,7 @@
<text class="t1">注册手机号</text>
</view>
<view>
<text class="t2">15012479484</text>
<text class="t2">{{userInfo.mobile}}</text>
</view>
</view>
<view class="boxsiz bar row bothSide verCenter">
......@@ -68,7 +68,7 @@
</view>
</view>
<view class="hr"></view>
<view class="boxsiz bar row bothSide verCenter bor">
<view class="boxsiz bar row bothSide verCenter bor" data-url="/pages/person/setting/index" bind:tap="toUrl">
<view>
<text class="icon iconfont iconiconcaiseshouye"></text>
<text class="t1">设置</text>
......
......@@ -48,12 +48,12 @@
"list": []
},
"miniprogram": {
"current": 2,
"current": 0,
"list": [
{
"id": -1,
"name": "pages/detail/chat/index",
"pathName": "pages/detail/chat/index",
"id": 0,
"name": "pages/person/login/index",
"pathName": "pages/person/login/index",
"query": "",
"scene": null
},
......@@ -66,9 +66,9 @@
},
{
"id": 2,
"name": "pages/list/xj/index",
"pathName": "pages/list/xj/index",
"query": "inquiryItemsId=156327106368454",
"name": "pages/tab/me/me",
"pathName": "pages/tab/me/me",
"query": "",
"scene": null
},
{
......
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 sign in to comment