Commit 9aaa5146 by 梁建民

js

parent 5ed7c6a8
...@@ -37,6 +37,7 @@ function addMember(id) { ...@@ -37,6 +37,7 @@ function addMember(id) {
App({ App({
globalData: { globalData: {
unReadMessageNum: 0, unReadMessageNum: 0,
token:wx.getStorageSync('access_token'),
isIPX: false //是否为iphone X isIPX: false //是否为iphone X
}, },
conn: { conn: {
...@@ -67,9 +68,9 @@ App({ ...@@ -67,9 +68,9 @@ App({
success(res) { success(res) {
if(res.data){ if(res.data){
wx.switchTab({ // wx.switchTab({
url: '/pages/tab/home/home' // url: '/pages/tab/home/home'
}); // });
} }
} }
...@@ -81,9 +82,9 @@ App({ ...@@ -81,9 +82,9 @@ App({
success(res) { success(res) {
if (res.authSetting['scope.userInfo']) { if (res.authSetting['scope.userInfo']) {
// 已经授权 // 已经授权
wx.switchTab({ // wx.switchTab({
url: '/pages/tab/home/home' // url: '/pages/tab/home/home'
}) // })
} }
} }
}) })
......
// pages/tab/me/me.js const http = require('../../../utils/util.js');
import {
apis
} from '../../../utils/api.js';
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
isShow:false isShow: false,
userInfo:{
avatar:'',
mobile:''
},
business: {
goods: '',
inquiry: '',
offer: ''
}
}, },
/** /**
...@@ -13,6 +26,27 @@ Page({ ...@@ -13,6 +26,27 @@ Page({
*/ */
onLoad: function (options) { 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({ ...@@ -62,5 +96,17 @@ Page({
*/ */
onShareAppMessage: function () { 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="mine" hover-class="none" hover-stop-propagation="false">
<view class="head row verCenter"> <view class="head row verCenter">
<view class="pic"> <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>
<view class="text"> <view class="text">
<text class="t1">深圳市猎芯科技有限公司</text> <text class="t1">深圳市猎芯科技有限公司</text>
...@@ -20,15 +20,15 @@ ...@@ -20,15 +20,15 @@
</view> </view>
<view class="tab-bar row verCenter rowCenter"> <view class="tab-bar row verCenter rowCenter">
<view class="wrap"> <view class="wrap">
<text class="t1">513</text> <text class="t1">{{business.goods}}</text>
<text class="t2">商品</text> <text class="t2">商品</text>
</view> </view>
<view class="wrap"> <view class="wrap">
<text class="t1">53</text> <text class="t1">{{business.inquiry}}</text>
<text class="t2">询价</text> <text class="t2">询价</text>
</view> </view>
<view class="wrap"> <view class="wrap">
<text class="t1">513</text> <text class="t1">{{business.offer}}</text>
<text class="t2">报价</text> <text class="t2">报价</text>
</view> </view>
</view> </view>
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
<text class="t1">注册手机号</text> <text class="t1">注册手机号</text>
</view> </view>
<view> <view>
<text class="t2">15012479484</text> <text class="t2">{{userInfo.mobile}}</text>
</view> </view>
</view> </view>
<view class="boxsiz bar row bothSide verCenter"> <view class="boxsiz bar row bothSide verCenter">
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
</view> </view>
</view> </view>
<view class="hr"></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> <view>
<text class="icon iconfont iconiconcaiseshouye"></text> <text class="icon iconfont iconiconcaiseshouye"></text>
<text class="t1">设置</text> <text class="t1">设置</text>
......
...@@ -48,12 +48,12 @@ ...@@ -48,12 +48,12 @@
"list": [] "list": []
}, },
"miniprogram": { "miniprogram": {
"current": 2, "current": 0,
"list": [ "list": [
{ {
"id": -1, "id": 0,
"name": "pages/detail/chat/index", "name": "pages/person/login/index",
"pathName": "pages/detail/chat/index", "pathName": "pages/person/login/index",
"query": "", "query": "",
"scene": null "scene": null
}, },
...@@ -66,9 +66,9 @@ ...@@ -66,9 +66,9 @@
}, },
{ {
"id": 2, "id": 2,
"name": "pages/list/xj/index", "name": "pages/tab/me/me",
"pathName": "pages/list/xj/index", "pathName": "pages/tab/me/me",
"query": "inquiryItemsId=156327106368454", "query": "",
"scene": null "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