...
|
...
|
@@ -37,7 +37,21 @@ Page({ |
|
|
list2: [],
|
|
|
last_page: '',
|
|
|
state: true,
|
|
|
tempHeight: ''
|
|
|
release_state: false,
|
|
|
release_state1: false,
|
|
|
user_id:''
|
|
|
},
|
|
|
|
|
|
goInfo() {
|
|
|
wx.navigateTo({
|
|
|
url: '/pages/index/info/info',
|
|
|
})
|
|
|
},
|
|
|
|
|
|
cancleInfo() {
|
|
|
this.setData({
|
|
|
release_state1: false
|
|
|
})
|
|
|
},
|
|
|
|
|
|
saveImg(e) {
|
...
|
...
|
@@ -70,9 +84,16 @@ Page({ |
|
|
|
|
|
goUserInfo(e) {
|
|
|
var id = e.currentTarget.dataset.id
|
|
|
var user_id = wx.getStorageSync('user_id')
|
|
|
if (id != user_id) {
|
|
|
wx.navigateTo({
|
|
|
url: '/pages/my/userInfo/userInfo?id=' + id,
|
|
|
})
|
|
|
} else {
|
|
|
wx.switchTab({
|
|
|
url: '/pages/my/my',
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
|
|
|
viewImg(e) {
|
...
|
...
|
@@ -81,7 +102,6 @@ Page({ |
|
|
var list = this.data.list
|
|
|
var imgs = list[mindex].img
|
|
|
var current = e.currentTarget.dataset.src
|
|
|
// console.log(imgs)
|
|
|
this.setData({
|
|
|
imgUrl: current,
|
|
|
img_text: e.currentTarget.dataset.text,
|
...
|
...
|
@@ -208,7 +228,7 @@ Page({ |
|
|
}
|
|
|
app.post(url, params, header).then((res) => {
|
|
|
if (res.data.code == 20000) {
|
|
|
var page = parseInt(this.data.page)-1
|
|
|
var page = parseInt(this.data.page) - 1
|
|
|
that.setData({
|
|
|
list: [],
|
|
|
page: page,
|
...
|
...
|
@@ -248,7 +268,6 @@ Page({ |
|
|
'XX-Device-Type': 'wxapp'
|
|
|
}
|
|
|
app.post(url, params, header).then((res) => {
|
|
|
console.log(res)
|
|
|
if (res.data.code == 20000) {
|
|
|
this.setData({
|
|
|
list: [],
|
...
|
...
|
@@ -274,6 +293,7 @@ Page({ |
|
|
classify_state: !(this.data.classify_state)
|
|
|
})
|
|
|
},
|
|
|
|
|
|
cancleClassify() {
|
|
|
this.setData({
|
|
|
classify_state: false
|
...
|
...
|
@@ -293,13 +313,16 @@ Page({ |
|
|
showPoster(e) {
|
|
|
var id = e.currentTarget.dataset.id
|
|
|
var that = this
|
|
|
wx.hideTabBar({})
|
|
|
var index = e.currentTarget.dataset.index
|
|
|
var list = this.data.list
|
|
|
list[index].more_state = false
|
|
|
this.setData({
|
|
|
list: list
|
|
|
})
|
|
|
wx.showToast({
|
|
|
title: '加载中',
|
|
|
icon: 'loading'
|
|
|
})
|
|
|
that.setData({
|
|
|
poster_state: true
|
|
|
icon: 'loading',
|
|
|
duration: 2000
|
|
|
})
|
|
|
this.getPoster(id)
|
|
|
},
|
...
|
...
|
@@ -327,33 +350,27 @@ Page({ |
|
|
'XX-Device-Type': 'wxapp'
|
|
|
}
|
|
|
app.post(url, param, header).then((res) => {
|
|
|
console.log(res)
|
|
|
|
|
|
if (res.data.code == 20000) {
|
|
|
that.setData({
|
|
|
poster: res.data.data.url,
|
|
|
})
|
|
|
setTimeout((res) => {
|
|
|
that.setData({
|
|
|
state: true
|
|
|
poster_state: true
|
|
|
})
|
|
|
wx.hideTabBar({})
|
|
|
})
|
|
|
} else if (res.data.code == 30001) {
|
|
|
wx.showToast({
|
|
|
title: '上传图片才可生成海报',
|
|
|
icon: 'none'
|
|
|
icon: 'none',
|
|
|
duration: 2000
|
|
|
})
|
|
|
setTimeout(function() {
|
|
|
that.setData({
|
|
|
poster_state: false
|
|
|
})
|
|
|
wx.showTabBar({
|
|
|
|
|
|
})
|
|
|
}, 2000)
|
|
|
that.setData({
|
|
|
state: false
|
|
|
})
|
|
|
wx.showTabBar({})
|
|
|
}
|
|
|
|
|
|
})
|
|
|
},
|
|
|
|
...
|
...
|
@@ -379,10 +396,9 @@ Page({ |
|
|
},
|
|
|
|
|
|
releaseInfo() {
|
|
|
if (this.data.tempHeight == '') {
|
|
|
wx.showToast({
|
|
|
title: '请去完善身份信息',
|
|
|
icon: 'none'
|
|
|
if (this.data.release_state) {
|
|
|
this.setData({
|
|
|
release_state1: true
|
|
|
})
|
|
|
} else {
|
|
|
wx.navigateTo({
|
...
|
...
|
@@ -445,10 +461,14 @@ Page({ |
|
|
},
|
|
|
|
|
|
confirmData() {
|
|
|
this.getData()
|
|
|
this.setData({
|
|
|
classify_state: false
|
|
|
classify_state: false,
|
|
|
list:[],
|
|
|
page:1
|
|
|
})
|
|
|
this.getData()
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
getStyle() {
|
...
|
...
|
@@ -490,9 +510,6 @@ Page({ |
|
|
console.log('data', res)
|
|
|
if (res.data.code == 20000) {
|
|
|
var list = this.data.list
|
|
|
// for (var i = 0; i < list.length; i++) {
|
|
|
// list[i].more_state = false
|
|
|
// }
|
|
|
if (res.data.data.list != '') {
|
|
|
that.setData({
|
|
|
list: list.concat(res.data.data.list),
|
...
|
...
|
@@ -526,34 +543,36 @@ Page({ |
|
|
'XX-Device-Type': 'wxapp'
|
|
|
}
|
|
|
app.post(url, params, header).then((res) => {
|
|
|
console.log('userinfo', res)
|
|
|
if (res.data.code == 20000) {
|
|
|
var height = res.data.data.stature
|
|
|
var weight = res.data.data.weight
|
|
|
var sex_index = res.data.data.sex
|
|
|
if (height == null || weight == null) {
|
|
|
this.setData({
|
|
|
// avatar: res.data.data.avatar,
|
|
|
// birthday: birthday,
|
|
|
// constellation: res.data.data.constellation,
|
|
|
// sex_index: sex_index,
|
|
|
// signature: res.data.data.signature,
|
|
|
tempHeight: res.data.data.stature,
|
|
|
// user_name: res.data.data.user_nickname,
|
|
|
// weight: res.data.data.weight,
|
|
|
release_state: true
|
|
|
})
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
},
|
|
|
onLoad: function() {
|
|
|
// this.getData()
|
|
|
this.getStyle()
|
|
|
this.getUserInfo()
|
|
|
this.setData({
|
|
|
user_id:wx.getStorageSync('user_id')
|
|
|
})
|
|
|
},
|
|
|
|
|
|
onShow() {
|
|
|
this.setData({
|
|
|
list: [],
|
|
|
page: 1
|
|
|
page: 1,
|
|
|
user_id: wx.getStorageSync('user_id')
|
|
|
})
|
|
|
this.getData()
|
|
|
this.getUserInfo()
|
|
|
},
|
|
|
|
|
|
onReachBottom: function() {
|
...
|
...
|
|