|
@@ -39,22 +39,38 @@ Page({
|
|
// text: '扫一扫'
|
|
// text: '扫一扫'
|
|
// },
|
|
// },
|
|
],
|
|
],
|
|
- // grids2: [{
|
|
|
|
- // image: 'cart',
|
|
|
|
- // text: '我的购物车'
|
|
|
|
- // }, {
|
|
|
|
- // image: 'help',
|
|
|
|
- // text: '帮助中心'
|
|
|
|
- // }, {
|
|
|
|
- // image: 'address',
|
|
|
|
- // text: '地址管理'
|
|
|
|
- // }, {
|
|
|
|
- // image: 'order',
|
|
|
|
- // text: '我的订单'
|
|
|
|
- // }, {
|
|
|
|
- // image: 'customer-service',
|
|
|
|
- // text: '联系客服'
|
|
|
|
- // }, ],
|
|
|
|
|
|
+ grids2: [{
|
|
|
|
+ image: 'order',
|
|
|
|
+ text: '我的订单'
|
|
|
|
+ }, {
|
|
|
|
+ image: 'user',
|
|
|
|
+ text: '好友列表'
|
|
|
|
+ }, {
|
|
|
|
+ image: 'help',
|
|
|
|
+ text: '帮助中心'
|
|
|
|
+ }, {
|
|
|
|
+ image: 'add',
|
|
|
|
+ text: '邀请好友'
|
|
|
|
+ }, {
|
|
|
|
+ image: 'to-top',
|
|
|
|
+ text: '手动同步订单'
|
|
|
|
+ }, {
|
|
|
|
+ image: 'customer-service',
|
|
|
|
+ text: '联系客服'
|
|
|
|
+ }, {
|
|
|
|
+ image: 'setting',
|
|
|
|
+ text: '设置'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ image: 'success',
|
|
|
|
+ text: '提现'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ image: 'phone',
|
|
|
|
+ text: '管理员'
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+],
|
|
motto: 'Hello World',
|
|
motto: 'Hello World',
|
|
userInfo: {},
|
|
userInfo: {},
|
|
hasUserInfo: false,
|
|
hasUserInfo: false,
|
|
@@ -69,6 +85,11 @@ Page({
|
|
})
|
|
})
|
|
},
|
|
},
|
|
onLoad() {
|
|
onLoad() {
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ onShow() {
|
|
var that = this
|
|
var that = this
|
|
var opneId = wx.getStorageSync('openId')
|
|
var opneId = wx.getStorageSync('openId')
|
|
var nickName = wx.getStorageSync('nickName')
|
|
var nickName = wx.getStorageSync('nickName')
|
|
@@ -96,7 +117,7 @@ Page({
|
|
})
|
|
})
|
|
|
|
|
|
console.log(nickName)
|
|
console.log(nickName)
|
|
- if (nickName == ''){
|
|
|
|
|
|
+ // if (nickName == ''){
|
|
wx.request( {
|
|
wx.request( {
|
|
url: link + "/v1/user/open.id/get",
|
|
url: link + "/v1/user/open.id/get",
|
|
header: {
|
|
header: {
|
|
@@ -108,18 +129,23 @@ Page({
|
|
console.log(res)
|
|
console.log(res)
|
|
wx.setStorageSync('nickName', res.data.data.user.nickName)
|
|
wx.setStorageSync('nickName', res.data.data.user.nickName)
|
|
wx.setStorageSync('userId', res.data.data.user.id)
|
|
wx.setStorageSync('userId', res.data.data.user.id)
|
|
|
|
+ var admin = false
|
|
|
|
+ if (res.data.data.user.admin >= 1){
|
|
|
|
+ admin = true
|
|
|
|
+ }
|
|
that.setData({
|
|
that.setData({
|
|
- userId: res.data.data.user.id
|
|
|
|
|
|
+ userId: res.data.data.user.id,
|
|
|
|
+ admin:admin
|
|
})
|
|
})
|
|
}
|
|
}
|
|
})
|
|
})
|
|
- } else{
|
|
|
|
- var userId = wx.getStorageSync('userId')
|
|
|
|
- console.log(userId)
|
|
|
|
- that.setData({
|
|
|
|
- userId: userId
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
|
|
+ // } else{
|
|
|
|
+ // var userId = wx.getStorageSync('userId')
|
|
|
|
+ // console.log(userId)
|
|
|
|
+ // that.setData({
|
|
|
|
+ // userId: userId
|
|
|
|
+ // })
|
|
|
|
+ // }
|
|
|
|
|
|
|
|
|
|
},
|
|
},
|
|
@@ -168,10 +194,9 @@ Page({
|
|
|
|
|
|
}
|
|
}
|
|
else if (e.detail.cell.text == "提现") {
|
|
else if (e.detail.cell.text == "提现") {
|
|
- wx.showToast({
|
|
|
|
- title: "结算金额:0元",
|
|
|
|
- icon: 'none'
|
|
|
|
- });
|
|
|
|
|
|
+ wx.navigateTo({
|
|
|
|
+ url:"/pages/trans/trans"
|
|
|
|
+ })
|
|
|
|
|
|
} else if (e.detail.cell.text == "邀请好友"){
|
|
} else if (e.detail.cell.text == "邀请好友"){
|
|
console.log('邀请好友')
|
|
console.log('邀请好友')
|
|
@@ -182,9 +207,7 @@ Page({
|
|
wx.navigateTo({
|
|
wx.navigateTo({
|
|
url:"/pages/friends-list/friends-list"
|
|
url:"/pages/friends-list/friends-list"
|
|
})
|
|
})
|
|
- }
|
|
|
|
-
|
|
|
|
- else {
|
|
|
|
|
|
+ } else {
|
|
wx.showToast({
|
|
wx.showToast({
|
|
title: "功能开发中...",
|
|
title: "功能开发中...",
|
|
icon: 'none'
|
|
icon: 'none'
|