正在显示
13 个修改的文件
包含
342 行增加
和
99 行删除
@@ -5,7 +5,8 @@ Page({ | @@ -5,7 +5,8 @@ Page({ | ||
5 | * 页面的初始数据 | 5 | * 页面的初始数据 |
6 | */ | 6 | */ |
7 | data: { | 7 | data: { |
8 | - max: 100 | 8 | + max: 100, |
9 | + index:'', | ||
9 | }, | 10 | }, |
10 | 11 | ||
11 | getText(e) { | 12 | getText(e) { |
@@ -20,17 +21,23 @@ Page({ | @@ -20,17 +21,23 @@ Page({ | ||
20 | }); | 21 | }); |
21 | }, | 22 | }, |
22 | 23 | ||
23 | - goCheck(){ | 24 | + goCheck(e){ |
24 | wx.navigateTo({ | 25 | wx.navigateTo({ |
25 | - url: '/pages/index/check/check', | 26 | + url: '/pages/index/release/release?index='+this.data.index, |
26 | }) | 27 | }) |
28 | + | ||
29 | + // wx.navigateTo({ | ||
30 | + // url: '/pages/index/check/check', | ||
31 | + // }) | ||
27 | }, | 32 | }, |
28 | 33 | ||
29 | /** | 34 | /** |
30 | * 生命周期函数--监听页面加载 | 35 | * 生命周期函数--监听页面加载 |
31 | */ | 36 | */ |
32 | onLoad: function(options) { | 37 | onLoad: function(options) { |
33 | - | 38 | + this.setData({ |
39 | + index:options.index | ||
40 | + }) | ||
34 | }, | 41 | }, |
35 | 42 | ||
36 | /** | 43 | /** |
1 | // pages/index/fans/fans.js | 1 | // pages/index/fans/fans.js |
2 | +const app=getApp() | ||
2 | Page({ | 3 | Page({ |
3 | 4 | ||
4 | /** | 5 | /** |
5 | * 页面的初始数据 | 6 | * 页面的初始数据 |
6 | */ | 7 | */ |
7 | data: { | 8 | data: { |
8 | - | 9 | + status:'' |
10 | + }, | ||
11 | + | ||
12 | + getData() { | ||
13 | + let url = '/home/index/checkFans' | ||
14 | + let params = { | ||
15 | + status: this.data.status | ||
16 | + } | ||
17 | + let header = { | ||
18 | + "XX-Token": wx.getStorageSync('token'), | ||
19 | + 'XX-Device-Type': 'wxapp' | ||
20 | + } | ||
21 | + app.post(url, params, header).then((res) => { | ||
22 | + console.log(res) | ||
23 | + if (res.data.code == 20000) { | ||
24 | + | ||
25 | + } | ||
26 | + | ||
27 | + }) | ||
9 | }, | 28 | }, |
10 | 29 | ||
11 | /** | 30 | /** |
12 | * 生命周期函数--监听页面加载 | 31 | * 生命周期函数--监听页面加载 |
13 | */ | 32 | */ |
14 | onLoad: function (options) { | 33 | onLoad: function (options) { |
15 | - | 34 | + options.status?(this.getData()):'' |
16 | }, | 35 | }, |
17 | 36 | ||
18 | /** | 37 | /** |
@@ -31,10 +31,11 @@ Page({ | @@ -31,10 +31,11 @@ Page({ | ||
31 | order: 1, | 31 | order: 1, |
32 | poster_list: [], | 32 | poster_list: [], |
33 | 33 | ||
34 | - | ||
35 | - cardPath: 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1534766809331&di=012cc4ad15d457ffa55c6537503eb84a&imgtype=0&src=http%3A%2F%2Fpicture.5068.com%2Fallimg%2F121120%2F4-1211201G920.jpg', | ||
36 | - headPath: 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1534765039080&di=1e81a596bc89cd54db55c0dbc7c4bb87&imgtype=0&src=http%3A%2F%2Fimg3.100bt.com%2Fupload%2Fttq%2F20140529%2F1401337844678_middle.png', | ||
37 | - sendName: '文字描述描述文字' | 34 | + // https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1534766809331&di=012cc4ad15d457ffa55c6537503eb84a&imgtype=0&src=http%3A%2F%2Fpicture.5068.com%2Fallimg%2F121120%2F4-1211201G920.jpg |
35 | + cardPath: '', | ||
36 | + headPath: '', | ||
37 | + // https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1534765039080&di=1e81a596bc89cd54db55c0dbc7c4bb87&imgtype=0&src=http%3A%2F%2Fimg3.100bt.com%2Fupload%2Fttq%2F20140529%2F1401337844678_middle.png | ||
38 | + sendName: '' | ||
38 | 39 | ||
39 | 40 | ||
40 | }, | 41 | }, |
@@ -229,10 +230,10 @@ Page({ | @@ -229,10 +230,10 @@ Page({ | ||
229 | console.log(res) | 230 | console.log(res) |
230 | if (res.data.code == 20000) { | 231 | if (res.data.code == 20000) { |
231 | this.setData({ | 232 | this.setData({ |
232 | - poster_list: res.data.data, | ||
233 | - // cardPath: res.data.data.img, | ||
234 | - // headPath: res.data.data.img, | ||
235 | - // sendName: res.data.data.text, | 233 | + // poster_list: res.data.data, |
234 | + cardPath: 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1534766809331&di=012cc4ad15d457ffa55c6537503eb84a&imgtype=0&src=http%3A%2F%2Fpicture.5068.com%2Fallimg%2F121120%2F4-1211201G920.jpg', | ||
235 | + headPath: res.data.data.img, | ||
236 | + sendName: res.data.data.text, | ||
236 | }) | 237 | }) |
237 | } | 238 | } |
238 | }) | 239 | }) |
@@ -406,6 +407,7 @@ Page({ | @@ -406,6 +407,7 @@ Page({ | ||
406 | 407 | ||
407 | //画图 | 408 | //画图 |
408 | drawCanvas: function() { | 409 | drawCanvas: function() { |
410 | + console.log(this.data.cardPath,'aa') | ||
409 | this.setData({ | 411 | this.setData({ |
410 | cardPath: this.data.cardPath, | 412 | cardPath: this.data.cardPath, |
411 | headPath: this.data.headPath, | 413 | headPath: this.data.headPath, |
@@ -11,6 +11,8 @@ Page({ | @@ -11,6 +11,8 @@ Page({ | ||
11 | mask_state: false, | 11 | mask_state: false, |
12 | sex_array: ['男', '女'], | 12 | sex_array: ['男', '女'], |
13 | sex_index: -1, | 13 | sex_index: -1, |
14 | + birthday:'', | ||
15 | + constellation: ['白羊座', '金牛座', '双子座', '巨蟹座', '狮子座', '处女座', '天秤座', '天蝎座', '射手座', '摩羯座', '水瓶座','双鱼座'], | ||
14 | }, | 16 | }, |
15 | 17 | ||
16 | //选择性别 | 18 | //选择性别 |
@@ -21,24 +23,27 @@ Page({ | @@ -21,24 +23,27 @@ Page({ | ||
21 | }) | 23 | }) |
22 | }, | 24 | }, |
23 | 25 | ||
24 | - getText(e) { | ||
25 | - var content = e.detail.value | ||
26 | - var len = content.length | ||
27 | - if (len > this.data.max) return; | 26 | + |
27 | + setTime(e) { | ||
28 | this.setData({ | 28 | this.setData({ |
29 | - current_num: len | 29 | + birthday: e.detail.value |
30 | }) | 30 | }) |
31 | }, | 31 | }, |
32 | + | ||
33 | + | ||
34 | + | ||
32 | showMask() { | 35 | showMask() { |
33 | this.setData({ | 36 | this.setData({ |
34 | mask_state: true | 37 | mask_state: true |
35 | }) | 38 | }) |
36 | }, | 39 | }, |
40 | + | ||
37 | cancleMak() { | 41 | cancleMak() { |
38 | this.setData({ | 42 | this.setData({ |
39 | mask_state: false | 43 | mask_state: false |
40 | }) | 44 | }) |
41 | }, | 45 | }, |
46 | + | ||
42 | chooseImg() { //这里是选取图片的方法 | 47 | chooseImg() { //这里是选取图片的方法 |
43 | var that = this; | 48 | var that = this; |
44 | wx.chooseImage({ | 49 | wx.chooseImage({ |
@@ -50,24 +55,20 @@ Page({ | @@ -50,24 +55,20 @@ Page({ | ||
50 | 'XX-Device-Type': 'wxapp' | 55 | 'XX-Device-Type': 'wxapp' |
51 | } | 56 | } |
52 | wx.uploadFile({ | 57 | wx.uploadFile({ |
53 | - url: 'http://fashion.w.bronet.cn/api/user/upload/upload', //仅为示例,非真实的接口地址 | 58 | + url: 'http://fashion.w.bronet.cn/user/upload/upload', //仅为示例,非真实的接口地址 |
54 | filePath: tempFilePaths[0], | 59 | filePath: tempFilePaths[0], |
55 | - name: 'picurl', | 60 | + name: 'file', |
56 | header: header, | 61 | header: header, |
57 | formData: { | 62 | formData: { |
58 | - // file | 63 | + file: tempFilePaths[0] |
59 | }, | 64 | }, |
60 | success: function(res) { | 65 | success: function(res) { |
61 | console.log(res) | 66 | console.log(res) |
62 | - // var data = JSON.parse(res.data); | ||
63 | - // var picurl = data.data.picurl; | ||
64 | - // picurl = picurl.indexOf('http') != '-1' ? picurl : "http://" + picurl | ||
65 | - // var list = that.data.list | ||
66 | - // list.picurl = picurl | ||
67 | - // that.setData({ | ||
68 | - // hasimg: picurl, | ||
69 | - // list: list | ||
70 | - // }) | 67 | + var data = JSON.parse(res.data) |
68 | + var avatar = data.data.url; | ||
69 | + that.setData({ | ||
70 | + avatar: avatar, | ||
71 | + }) | ||
71 | } | 72 | } |
72 | }) | 73 | }) |
73 | } | 74 | } |
@@ -85,11 +86,13 @@ Page({ | @@ -85,11 +86,13 @@ Page({ | ||
85 | console.log(res) | 86 | console.log(res) |
86 | if (res.data.code == 20000) { | 87 | if (res.data.code == 20000) { |
87 | var sex = res.data.data.sex | 88 | var sex = res.data.data.sex |
89 | + var sex_index = this.data.sex_index | ||
90 | + sex_index = sex - 1 | ||
88 | this.setData({ | 91 | this.setData({ |
89 | avatar: res.data.data.avatar, | 92 | avatar: res.data.data.avatar, |
90 | birthday: res.data.data.birthday, | 93 | birthday: res.data.data.birthday, |
91 | constellation: res.data.data.constellation, | 94 | constellation: res.data.data.constellation, |
92 | - sex: sex, | 95 | + sex_index: sex_index, |
93 | signature: res.data.data.signature, | 96 | signature: res.data.data.signature, |
94 | stature: res.data.data.stature, | 97 | stature: res.data.data.stature, |
95 | user_name: res.data.data.user_nickname, | 98 | user_name: res.data.data.user_nickname, |
@@ -29,7 +29,7 @@ | @@ -29,7 +29,7 @@ | ||
29 | </view> | 29 | </view> |
30 | <view class='list_input'> | 30 | <view class='list_input'> |
31 | <picker class='chassify_picker' range='{{sex_array}}' value='{{sex_index}}' bindchange='setSex'> | 31 | <picker class='chassify_picker' range='{{sex_array}}' value='{{sex_index}}' bindchange='setSex'> |
32 | - <input placeholder='请选择' value='{{sex}}' disabled='true'></input> | 32 | + <input placeholder='请选择' value='{{sex_array[sex_index]}}' disabled='true'></input> |
33 | </picker> | 33 | </picker> |
34 | <view class='iconfont icon-fanhui'></view> | 34 | <view class='iconfont icon-fanhui'></view> |
35 | </view> | 35 | </view> |
@@ -39,8 +39,8 @@ | @@ -39,8 +39,8 @@ | ||
39 | <text>出生日期</text> | 39 | <text>出生日期</text> |
40 | </view> | 40 | </view> |
41 | <view class='list_input'> | 41 | <view class='list_input'> |
42 | - <picker mode='date' bindchange='selectTime'> | ||
43 | - <input type='text' placeholder='未选择' name='end_time' value='{{end_time}}' disabled='true'></input> | 42 | + <picker mode='date' bindchange='setTime'> |
43 | + <input type='text' placeholder='未选择' value='{{birthday}}' disabled='true'></input> | ||
44 | </picker> | 44 | </picker> |
45 | <view class='iconfont icon-fanhui'></view> | 45 | <view class='iconfont icon-fanhui'></view> |
46 | </view> | 46 | </view> |
@@ -58,7 +58,6 @@ | @@ -58,7 +58,6 @@ | ||
58 | </view> | 58 | </view> |
59 | </view> | 59 | </view> |
60 | <view class='content_item'> | 60 | <view class='content_item'> |
61 | - | ||
62 | <view class='item_list'> | 61 | <view class='item_list'> |
63 | <view class='list_title'> | 62 | <view class='list_title'> |
64 | <text>身高</text> | 63 | <text>身高</text> |
1 | // pages/index/message/message.js | 1 | // pages/index/message/message.js |
2 | +const app = getApp() | ||
2 | Page({ | 3 | Page({ |
3 | 4 | ||
4 | /** | 5 | /** |
5 | * 页面的初始数据 | 6 | * 页面的初始数据 |
6 | */ | 7 | */ |
7 | data: { | 8 | data: { |
8 | - state:1 | 9 | + status: 1, |
10 | + page: 1 | ||
9 | }, | 11 | }, |
10 | 12 | ||
11 | readState(e) { | 13 | readState(e) { |
12 | var status = e.currentTarget.dataset.status | 14 | var status = e.currentTarget.dataset.status |
13 | this.setData({ | 15 | this.setData({ |
14 | - state: status | 16 | + status: status |
15 | }) | 17 | }) |
18 | + if(status!=3){ | ||
19 | + this.getData() | ||
20 | + }else{ | ||
21 | + this.getData2() | ||
22 | + } | ||
23 | + }, | ||
24 | + | ||
25 | + getData() { | ||
26 | + let url = '/home/index/checkNews' | ||
27 | + let params = { | ||
28 | + status: this.data.status, | ||
29 | + page: this.data.page | ||
30 | + } | ||
31 | + let header = { | ||
32 | + "XX-Token": wx.getStorageSync('token'), | ||
33 | + 'XX-Device-Type': 'wxapp' | ||
34 | + } | ||
35 | + app.post(url, params, header).then((res) => { | ||
36 | + console.log(res) | ||
37 | + if (res.data.code == 20000) { | ||
38 | + this.setData({ | ||
39 | + current_page: res.data.data.list.current_page, | ||
40 | + list: res.data.data.list.current_page, | ||
41 | + last_page: res.data.data.list.last_page, | ||
42 | + per_page: res.data.data.list.per_page, | ||
43 | + total: res.data.data.list.total | ||
44 | + }) | ||
45 | + } | ||
46 | + }) | ||
47 | + }, | ||
16 | 48 | ||
49 | + getData2() { | ||
50 | + let url = '/home/index/checkFashion' | ||
51 | + let params = { | ||
52 | + page: this.data.page | ||
53 | + } | ||
54 | + let header = { | ||
55 | + "XX-Token": wx.getStorageSync('token'), | ||
56 | + 'XX-Device-Type': 'wxapp' | ||
57 | + } | ||
58 | + app.post(url, params, header).then((res) => { | ||
59 | + console.log(res) | ||
60 | + if (res.data.code == 20000) { | ||
61 | + | ||
62 | + } | ||
63 | + | ||
64 | + }) | ||
17 | }, | 65 | }, |
18 | 66 | ||
67 | + | ||
19 | /** | 68 | /** |
20 | * 生命周期函数--监听页面加载 | 69 | * 生命周期函数--监听页面加载 |
21 | */ | 70 | */ |
22 | onLoad: function(options) { | 71 | onLoad: function(options) { |
23 | - | 72 | + this.getData() |
73 | + this.getData2() | ||
24 | }, | 74 | }, |
25 | 75 | ||
26 | /** | 76 | /** |
1 | <!--pages/index/message/message.wxml--> | 1 | <!--pages/index/message/message.wxml--> |
2 | <view class='banner_box'> | 2 | <view class='banner_box'> |
3 | - <view class="label {{state==1?'active':''}}" bindtap='readState' data-status='1'>评论消息</view> | ||
4 | - <view class="label {{state==2?'active':''}}" bindtap='readState' data-status='2'>点赞消息</view> | ||
5 | - <view class="label {{state==3?'active':''}}" bindtap='readState' data-status='3'>审核消息</view> | 3 | + <view class="label {{status==1?'active':''}}" bindtap='readState' data-status='1'>评论消息</view> |
4 | + <view class="label {{status==2?'active':''}}" bindtap='readState' data-status='2'>点赞消息</view> | ||
5 | + <view class="label {{status ==3?'active':''}}" bindtap='readState' data-status='3'>审核消息</view> | ||
6 | </view> | 6 | </view> |
7 | <view class='content_box'> | 7 | <view class='content_box'> |
8 | - <view class='item_list'> | ||
9 | - <view class='list_left'> | ||
10 | - <image class='head_img' src='/images/img3.png'></image> | ||
11 | - <view> | ||
12 | - <view class='user_name'>Rose | ローズ</view> | 8 | + <block wx:if='{{status==1}}'> |
9 | + <view class='item_list'> | ||
10 | + <view class='list_left'> | ||
11 | + <image class='head_img' src='/images/img3.png'></image> | ||
13 | <view> | 12 | <view> |
14 | - <text>评论了你的</text> | ||
15 | - <text class='list_hint'>今日打卡</text> | 13 | + <view class='user_name'>Rose | ローズ</view> |
14 | + <view> | ||
15 | + <text>评论了你的</text> | ||
16 | + <text class='list_hint'>今日打卡</text> | ||
17 | + </view> | ||
16 | </view> | 18 | </view> |
17 | </view> | 19 | </view> |
20 | + <view class='point'></view> | ||
18 | </view> | 21 | </view> |
19 | - <view class='point'></view> | ||
20 | - </view> | ||
21 | - <view class='item_list'> | ||
22 | - <view class='list_left'> | ||
23 | - <view> | ||
24 | - <view class='user_name' style='font-weight:normal;'> | ||
25 | - <text>Rose | ローズ您好,您发布的今日打卡审核</text> | ||
26 | - <text class='list_hint2'>未通过</text> | 22 | + </block> |
23 | + <block wx:if='{{status==2}}'> | ||
24 | + <view class='item_list'> | ||
25 | + <view class='list_left'> | ||
26 | + <image class='head_img' src='/images/img3.png'></image> | ||
27 | + <view> | ||
28 | + <view class='user_name'>Rose | ローズ</view> | ||
29 | + <view> | ||
30 | + <text>评论了你的</text> | ||
31 | + <text class='list_hint'>今日打卡</text> | ||
32 | + </view> | ||
33 | + </view> | ||
34 | + </view> | ||
35 | + <view class='point'></view> | ||
36 | + </view> | ||
37 | + </block> | ||
38 | + <block wx:if='{{status==3}}'> | ||
39 | + <view class='item_list'> | ||
40 | + <view class='list_left'> | ||
41 | + <view> | ||
42 | + <view class='user_name' style='font-weight:normal;'> | ||
43 | + <text>Rose | ローズ您好,您发布的今日打卡审核</text> | ||
44 | + <text class='list_hint2'>未通过</text> | ||
45 | + </view> | ||
46 | + <view>原因:发布内容有歧义</view> | ||
47 | + <view>2018-11-22 14:00</view> | ||
27 | </view> | 48 | </view> |
28 | - <view>原因:发布内容有歧义</view> | ||
29 | - <view>2018-11-22 14:00</view> | ||
30 | </view> | 49 | </view> |
31 | </view> | 50 | </view> |
32 | - </view> | 51 | + </block> |
33 | </view> | 52 | </view> |
1 | // pages/index/release/release.js | 1 | // pages/index/release/release.js |
2 | +const app=getApp() | ||
2 | Page({ | 3 | Page({ |
3 | - | ||
4 | /** | 4 | /** |
5 | * 页面的初始数据 | 5 | * 页面的初始数据 |
6 | */ | 6 | */ |
@@ -23,13 +23,16 @@ Page({ | @@ -23,13 +23,16 @@ Page({ | ||
23 | relsese_state: false | 23 | relsese_state: false |
24 | }, ], | 24 | }, ], |
25 | more_state:false, | 25 | more_state:false, |
26 | - images:['/images/img3.png'] | 26 | + images:[], |
27 | + styles:[], | ||
28 | + title:'', | ||
29 | + text:'', | ||
27 | }, | 30 | }, |
28 | 31 | ||
29 | - getText(e) { | 32 | + setTitle(e) { |
30 | var content = e.detail.value; | 33 | var content = e.detail.value; |
31 | this.setData({ | 34 | this.setData({ |
32 | - content: content | 35 | + title: content |
33 | }) | 36 | }) |
34 | var len = parseInt(content.length); | 37 | var len = parseInt(content.length); |
35 | if (len > this.data.max) return; | 38 | if (len > this.data.max) return; |
@@ -37,22 +40,44 @@ Page({ | @@ -37,22 +40,44 @@ Page({ | ||
37 | currentWordNumber: len //当前字数 | 40 | currentWordNumber: len //当前字数 |
38 | }); | 41 | }); |
39 | }, | 42 | }, |
40 | - textContent(e) { | 43 | + |
44 | + setText(e) { | ||
41 | var content = e.detail.value | 45 | var content = e.detail.value |
42 | var len = content.length | 46 | var len = content.length |
43 | if (len > this.data.max2) return; | 47 | if (len > this.data.max2) return; |
44 | this.setData({ | 48 | this.setData({ |
45 | - number: len | 49 | + number: len, |
50 | + text:content | ||
46 | }) | 51 | }) |
47 | }, | 52 | }, |
53 | + | ||
48 | //分类 | 54 | //分类 |
49 | setClassify(e) { | 55 | setClassify(e) { |
50 | - const self = this; | ||
51 | - const current = e.currentTarget.dataset.index; | ||
52 | - self.setData({ | ||
53 | - current: current | ||
54 | - }); | 56 | + var index=e.currentTarget.dataset.index |
57 | + var classify=this.data.classify | ||
58 | + classify[index].state=!(classify[index].state) | ||
59 | + this.setData({ | ||
60 | + classify:classify | ||
61 | + }) | ||
62 | + }, | ||
63 | + | ||
64 | + getStyle() { | ||
65 | + let that = this; | ||
66 | + let url = '/home/index/styles'; | ||
67 | + let param = {} | ||
68 | + app.post(url, param).then((res) => { | ||
69 | + if (res.data.code == 20000) { | ||
70 | + var classify = res.data.data.list | ||
71 | + for(var i=0;i<classify.length;i++){ | ||
72 | + classify[i].state=false | ||
73 | + } | ||
74 | + that.setData({ | ||
75 | + classify: classify, | ||
76 | + }) | ||
77 | + } | ||
78 | + }) | ||
55 | }, | 79 | }, |
80 | + | ||
56 | //选择发布时间 | 81 | //选择发布时间 |
57 | selectTime(e) { | 82 | selectTime(e) { |
58 | const self = this; | 83 | const self = this; |
@@ -61,6 +86,7 @@ Page({ | @@ -61,6 +86,7 @@ Page({ | ||
61 | currentTime: current | 86 | currentTime: current |
62 | }); | 87 | }); |
63 | }, | 88 | }, |
89 | + | ||
64 | //选择时间 | 90 | //选择时间 |
65 | setTime(e) { | 91 | setTime(e) { |
66 | const index = e.currentTarget.dataset.index; | 92 | const index = e.currentTarget.dataset.index; |
@@ -70,16 +96,19 @@ Page({ | @@ -70,16 +96,19 @@ Page({ | ||
70 | release_time2: release_time2 | 96 | release_time2: release_time2 |
71 | }) | 97 | }) |
72 | }, | 98 | }, |
99 | + | ||
73 | showMask() { | 100 | showMask() { |
74 | this.setData({ | 101 | this.setData({ |
75 | relsese_state: true | 102 | relsese_state: true |
76 | }) | 103 | }) |
77 | }, | 104 | }, |
105 | + | ||
78 | cancleMask() { | 106 | cancleMask() { |
79 | this.setData({ | 107 | this.setData({ |
80 | relsese_state: false | 108 | relsese_state: false |
81 | }) | 109 | }) |
82 | }, | 110 | }, |
111 | + | ||
83 | //上传图片 | 112 | //上传图片 |
84 | choose(e) { //这里是选取图片的方法 | 113 | choose(e) { //这里是选取图片的方法 |
85 | let that = this; | 114 | let that = this; |
@@ -95,11 +124,10 @@ Page({ | @@ -95,11 +124,10 @@ Page({ | ||
95 | mask: true, | 124 | mask: true, |
96 | duration: 10000 | 125 | duration: 10000 |
97 | }) | 126 | }) |
98 | - let token = wx.getStorageSync('token'); | ||
99 | let uploadImgCount = 0; | 127 | let uploadImgCount = 0; |
100 | for (let i = 0, h = tempFilePaths.length; i < h; i++) { | 128 | for (let i = 0, h = tempFilePaths.length; i < h; i++) { |
101 | wx.uploadFile({ | 129 | wx.uploadFile({ |
102 | - url: 'https://www.magipocket.com/api/home/home/upload', | 130 | + url: 'http://fashion.w.bronet.cn/user/upload/upload', |
103 | filePath: tempFilePaths[i], | 131 | filePath: tempFilePaths[i], |
104 | name: 'file', | 132 | name: 'file', |
105 | formData: { | 133 | formData: { |
@@ -107,22 +135,21 @@ Page({ | @@ -107,22 +135,21 @@ Page({ | ||
107 | }, | 135 | }, |
108 | header: { | 136 | header: { |
109 | 'content-type': 'application/x-www-form-urlencoded', | 137 | 'content-type': 'application/x-www-form-urlencoded', |
110 | - 'XX-Token': token, | 138 | + 'XX-Token': wx.getStorageSync('token'), |
111 | 'XX-Device-Type': 'wxapp', | 139 | 'XX-Device-Type': 'wxapp', |
112 | }, | 140 | }, |
113 | success: function(res) { | 141 | success: function(res) { |
142 | + console.log(res) | ||
114 | uploadImgCount++; | 143 | uploadImgCount++; |
115 | let data = JSON.parse(res.data); | 144 | let data = JSON.parse(res.data); |
116 | - // console.log('data',data); | ||
117 | if (data.code == 20000) { | 145 | if (data.code == 20000) { |
118 | //服务器返回格式: { "Catalog": "testFolder", "FileName": "1.jpg", "Url": "https://test.com/1.jpg" } | 146 | //服务器返回格式: { "Catalog": "testFolder", "FileName": "1.jpg", "Url": "https://test.com/1.jpg" } |
119 | let images = that.data.images; | 147 | let images = that.data.images; |
120 | - | ||
121 | - images.push(data.msg); | 148 | + images.push(data.data); |
122 | that.setData({ | 149 | that.setData({ |
123 | images: images | 150 | images: images |
124 | }); | 151 | }); |
125 | - // console.log(images) | 152 | + console.log(images) |
126 | //如果是最后一张,则隐藏等待中 | 153 | //如果是最后一张,则隐藏等待中 |
127 | if (uploadImgCount == tempFilePaths.length) { | 154 | if (uploadImgCount == tempFilePaths.length) { |
128 | wx.hideToast(); | 155 | wx.hideToast(); |
@@ -151,6 +178,7 @@ Page({ | @@ -151,6 +178,7 @@ Page({ | ||
151 | } | 178 | } |
152 | }); | 179 | }); |
153 | }, | 180 | }, |
181 | + | ||
154 | // 删除图片 | 182 | // 删除图片 |
155 | deleteImg(e) { | 183 | deleteImg(e) { |
156 | var imgs = this.data.images; | 184 | var imgs = this.data.images; |
@@ -170,21 +198,69 @@ Page({ | @@ -170,21 +198,69 @@ Page({ | ||
170 | urls: imgs | 198 | urls: imgs |
171 | }) | 199 | }) |
172 | }, | 200 | }, |
173 | - goEdit(){ | 201 | + |
202 | + goEdit(e){ | ||
203 | + var index=e.currentTarget.dataset.index | ||
174 | wx.navigateTo({ | 204 | wx.navigateTo({ |
175 | - url: '/pages/index/brief/brief', | 205 | + url: '/pages/index/brief/brief?index='+index, |
176 | }) | 206 | }) |
177 | }, | 207 | }, |
208 | + | ||
178 | showMore(){ | 209 | showMore(){ |
179 | this.setData({ | 210 | this.setData({ |
180 | more_state:!(this.data.more_state) | 211 | more_state:!(this.data.more_state) |
181 | }) | 212 | }) |
182 | }, | 213 | }, |
214 | + | ||
215 | + setOpen(e){ | ||
216 | + this.setData({ | ||
217 | + open:e.currentTarget.dataset.open | ||
218 | + }) | ||
219 | + }, | ||
220 | + | ||
221 | + tempClassify(){ | ||
222 | + var classify = this.data.classify | ||
223 | + var styles=[] | ||
224 | + for (var i = 0; i < classify.length; i++) { | ||
225 | + if (classify[i].state){ | ||
226 | + styles.push(classify[i].id) | ||
227 | + } | ||
228 | + } | ||
229 | + this.setData({ | ||
230 | + styles:styles | ||
231 | + }) | ||
232 | + }, | ||
233 | + | ||
234 | + submitInfo(){ | ||
235 | + this.tempClassify() | ||
236 | + let url = '/home/index/fashion' | ||
237 | + let params = { | ||
238 | + list_id: this.data.list_id, | ||
239 | + title: this.data.title, | ||
240 | + text: this.data.text, | ||
241 | + styles: this.data.styles, | ||
242 | + open_time: this.data.open_time, | ||
243 | + open: this.data.open, | ||
244 | + img: this.data.img | ||
245 | + } | ||
246 | + let header = { | ||
247 | + "XX-Token": wx.getStorageSync('token'), | ||
248 | + 'XX-Device-Type': 'wxapp' | ||
249 | + } | ||
250 | + app.post(url, params, header).then((res) => { | ||
251 | + console.log(res) | ||
252 | + if (res.data.code == 20000) { | ||
253 | + | ||
254 | + } | ||
255 | + | ||
256 | + }) | ||
257 | + }, | ||
258 | + | ||
183 | /** | 259 | /** |
184 | * 生命周期函数--监听页面加载 | 260 | * 生命周期函数--监听页面加载 |
185 | */ | 261 | */ |
186 | onLoad: function(options) { | 262 | onLoad: function(options) { |
187 | - | 263 | + this.getStyle() |
188 | }, | 264 | }, |
189 | 265 | ||
190 | /** | 266 | /** |
@@ -2,12 +2,12 @@ | @@ -2,12 +2,12 @@ | ||
2 | <view class='banner_box'> | 2 | <view class='banner_box'> |
3 | <view class='type_box' bindtap="showPicker"> | 3 | <view class='type_box' bindtap="showPicker"> |
4 | <view> | 4 | <view> |
5 | - <input placeholder='标题' bindinput='getText'></input> | 5 | + <input placeholder='标题' value='{{title}}' bindinput='setTitle'></input> |
6 | </view> | 6 | </view> |
7 | <text class="currentWordNumber">{{currentWordNumber|0}}/{{max}}</text> | 7 | <text class="currentWordNumber">{{currentWordNumber|0}}/{{max}}</text> |
8 | </view> | 8 | </view> |
9 | <view class='textarea_box'> | 9 | <view class='textarea_box'> |
10 | - <textarea class='textarea' placeholder='同大家分享一下你的穿搭秘籍吧~' maxlength='{{max2}}' value='{{textareavalue}}' bindinput='textContent'> | 10 | + <textarea class='textarea' placeholder='同大家分享一下你的穿搭秘籍吧~' maxlength='{{max2}}' value='{{text}}' bindinput='setText'> |
11 | <text class="number">{{number|0}}/{{max2}}</text> | 11 | <text class="number">{{number|0}}/{{max2}}</text> |
12 | </textarea> | 12 | </textarea> |
13 | </view> | 13 | </view> |
@@ -16,9 +16,9 @@ | @@ -16,9 +16,9 @@ | ||
16 | <view class='upload_img'> | 16 | <view class='upload_img'> |
17 | <view class='icon_box'> | 17 | <view class='icon_box'> |
18 | <view class='iconfont icon-jian' catchtap="deleteImg" data-index="{{index}}"></view> | 18 | <view class='iconfont icon-jian' catchtap="deleteImg" data-index="{{index}}"></view> |
19 | - <view class="edit_label" catchtap="goEdit">编辑</view> | 19 | + <view class="edit_label" catchtap="goEdit" data-index="{{index}}">编辑</view> |
20 | </view> | 20 | </view> |
21 | - <image src='{{image}}' data-index="{{index}}" mode="aspectFill" bindtap="previewImg"></image> | 21 | + <image src='{{image.url}}' data-index="{{index}}" mode="aspectFill" bindtap="previewImg"></image> |
22 | </view> | 22 | </view> |
23 | </block> | 23 | </block> |
24 | <view class='upload_img' bindtap="choose"> | 24 | <view class='upload_img' bindtap="choose"> |
@@ -30,20 +30,21 @@ | @@ -30,20 +30,21 @@ | ||
30 | <view class='hint_label more_box'> | 30 | <view class='hint_label more_box'> |
31 | <text catchtap='showMore'>公开</text> | 31 | <text catchtap='showMore'>公开</text> |
32 | <view class='more_label_box' wx:if='{{more_state}}'> | 32 | <view class='more_label_box' wx:if='{{more_state}}'> |
33 | - <view class='more_item' bindtap='showPoster'> | ||
34 | - <!-- <text class='iconfont icon-haibao more'></text> --> | 33 | + <view class='more_item' bindtap='setOpen' data-open='1'> |
35 | <text>公开</text> | 34 | <text>公开</text> |
36 | </view> | 35 | </view> |
37 | <view class='more_line'></view> | 36 | <view class='more_line'></view> |
38 | - <view class='more_item' catchtap='complain'> | ||
39 | - <!-- <text class='iconfont icon-jubao more'></text> --> | 37 | + <view class='more_item' catchtap='setOpen' data-open='3'> |
40 | <text>仅自己可见</text> | 38 | <text>仅自己可见</text> |
41 | </view> | 39 | </view> |
42 | <view class='more_line'></view> | 40 | <view class='more_line'></view> |
43 | - <view class='more_item' catchtap='complain'> | ||
44 | - <!-- <text class='iconfont icon-jubao more'></text> --> | 41 | + <view class='more_item' catchtap='setOpen' data-open='2'> |
45 | <text>粉丝可见</text> | 42 | <text>粉丝可见</text> |
46 | </view> | 43 | </view> |
44 | + <view class='more_line'></view> | ||
45 | + <view class='more_item' catchtap='setOpen' data-open='4'> | ||
46 | + <text>草稿箱</text> | ||
47 | + </view> | ||
47 | </view> | 48 | </view> |
48 | </view> | 49 | </view> |
49 | </view> | 50 | </view> |
@@ -53,7 +54,7 @@ | @@ -53,7 +54,7 @@ | ||
53 | <view class='tab_box'> | 54 | <view class='tab_box'> |
54 | <scroll-view scroll-x> | 55 | <scroll-view scroll-x> |
55 | <text class='classify_title'>风格</text> | 56 | <text class='classify_title'>风格</text> |
56 | - <view class="tab_item {{current==index?'bgc-active':''}}" wx:for='{{classify}}' wx:key='index' data-index="{{index}}" bindtap="setClassify">11</view> | 57 | + <view class="tab_item {{item.state?'bgc-active':''}}" wx:for='{{classify}}' wx:key='index' data-index="{{index}}" bindtap="setClassify">{{item.name}}</view> |
57 | </scroll-view> | 58 | </scroll-view> |
58 | </view> | 59 | </view> |
59 | <view class='bottom_box'> | 60 | <view class='bottom_box'> |
1 | // pages/index/search/search.js | 1 | // pages/index/search/search.js |
2 | +const app=getApp() | ||
2 | Page({ | 3 | Page({ |
3 | 4 | ||
4 | /** | 5 | /** |
@@ -7,8 +8,10 @@ Page({ | @@ -7,8 +8,10 @@ Page({ | ||
7 | data: { | 8 | data: { |
8 | searchHistory:['111','222'], | 9 | searchHistory:['111','222'], |
9 | imgs: ['/images/img3.png', '/images/img3.png', '/images/img3.png'], | 10 | imgs: ['/images/img3.png', '/images/img3.png', '/images/img3.png'], |
10 | - more_state:false | 11 | + more_state:false, |
12 | + list:[] | ||
11 | }, | 13 | }, |
14 | + | ||
12 | previewImg(e) { | 15 | previewImg(e) { |
13 | const current = e.currentTarget.dataset.index; | 16 | const current = e.currentTarget.dataset.index; |
14 | var imgs = this.data.imgs; | 17 | var imgs = this.data.imgs; |
@@ -17,21 +20,59 @@ Page({ | @@ -17,21 +20,59 @@ Page({ | ||
17 | urls: imgs | 20 | urls: imgs |
18 | }) | 21 | }) |
19 | }, | 22 | }, |
23 | + | ||
20 | showMore() { | 24 | showMore() { |
21 | this.setData({ | 25 | this.setData({ |
22 | more_state: !(this.data.more_state) | 26 | more_state: !(this.data.more_state) |
23 | }) | 27 | }) |
24 | }, | 28 | }, |
29 | + | ||
25 | complain() { | 30 | complain() { |
26 | wx.navigateTo({ | 31 | wx.navigateTo({ |
27 | url: '/pages/index/comment/comment', | 32 | url: '/pages/index/comment/comment', |
28 | }) | 33 | }) |
29 | }, | 34 | }, |
35 | + | ||
36 | + getData() { | ||
37 | + let url = '/home/index/history' | ||
38 | + let params = { } | ||
39 | + let header = { | ||
40 | + "XX-Token": wx.getStorageSync('token'), | ||
41 | + 'XX-Device-Type': 'wxapp' | ||
42 | + } | ||
43 | + app.post(url, params, header).then((res) => { | ||
44 | + console.log(res) | ||
45 | + if (res.data.code == 20000) { | ||
46 | + this.setData({ | ||
47 | + list:res.data.data.list | ||
48 | + }) | ||
49 | + } | ||
50 | + | ||
51 | + }) | ||
52 | + }, | ||
53 | + | ||
54 | + clearHistory(){ | ||
55 | + let url = '/home/index/historyDelete' | ||
56 | + let params = {} | ||
57 | + let header = { | ||
58 | + "XX-Token": wx.getStorageSync('token'), | ||
59 | + 'XX-Device-Type': 'wxapp' | ||
60 | + } | ||
61 | + app.post(url, params, header).then((res) => { | ||
62 | + console.log(res) | ||
63 | + if (res.data.code == 20000) { | ||
64 | + | ||
65 | + } | ||
66 | + | ||
67 | + }) | ||
68 | + }, | ||
69 | + | ||
70 | + | ||
30 | /** | 71 | /** |
31 | * 生命周期函数--监听页面加载 | 72 | * 生命周期函数--监听页面加载 |
32 | */ | 73 | */ |
33 | onLoad: function (options) { | 74 | onLoad: function (options) { |
34 | - | 75 | + this.getData() |
35 | }, | 76 | }, |
36 | 77 | ||
37 | /** | 78 | /** |
1 | // pages/my/draft/draft.js | 1 | // pages/my/draft/draft.js |
2 | +const app=getApp() | ||
2 | Page({ | 3 | Page({ |
3 | 4 | ||
4 | /** | 5 | /** |
5 | * 页面的初始数据 | 6 | * 页面的初始数据 |
6 | */ | 7 | */ |
7 | data: { | 8 | data: { |
9 | + list:'' | ||
10 | + }, | ||
8 | 11 | ||
12 | + getData() { | ||
13 | + let url = '/home/index/drafts' | ||
14 | + let params = {} | ||
15 | + let header = { | ||
16 | + "XX-Token": wx.getStorageSync('token'), | ||
17 | + 'XX-Device-Type': 'wxapp' | ||
18 | + } | ||
19 | + app.post(url, params, header).then((res) => { | ||
20 | + console.log(res) | ||
21 | + if(res.data.code==20000){ | ||
22 | + this.setData({ | ||
23 | + list:res.data.data.list | ||
24 | + }) | ||
25 | + } | ||
26 | + | ||
27 | + }) | ||
9 | }, | 28 | }, |
10 | 29 | ||
11 | /** | 30 | /** |
12 | * 生命周期函数--监听页面加载 | 31 | * 生命周期函数--监听页面加载 |
13 | */ | 32 | */ |
14 | onLoad: function (options) { | 33 | onLoad: function (options) { |
15 | - | 34 | + this.getData() |
16 | }, | 35 | }, |
17 | 36 | ||
18 | /** | 37 | /** |
@@ -13,6 +13,7 @@ Page({ | @@ -13,6 +13,7 @@ Page({ | ||
13 | look: 0, | 13 | look: 0, |
14 | look_type: '' | 14 | look_type: '' |
15 | }, | 15 | }, |
16 | + | ||
16 | cancleMask() { | 17 | cancleMask() { |
17 | this.setData({ | 18 | this.setData({ |
18 | mask_state: false | 19 | mask_state: false |
@@ -23,26 +24,32 @@ Page({ | @@ -23,26 +24,32 @@ Page({ | ||
23 | url: '/pages/index/info/info', | 24 | url: '/pages/index/info/info', |
24 | }) | 25 | }) |
25 | }, | 26 | }, |
27 | + | ||
26 | showMore() { | 28 | showMore() { |
27 | this.setData({ | 29 | this.setData({ |
28 | more_state: !(this.data.more_state) | 30 | more_state: !(this.data.more_state) |
29 | }) | 31 | }) |
30 | }, | 32 | }, |
33 | + | ||
31 | goBox() { | 34 | goBox() { |
32 | wx.navigateTo({ | 35 | wx.navigateTo({ |
33 | url: '/pages/my/draft/draft', | 36 | url: '/pages/my/draft/draft', |
34 | }) | 37 | }) |
35 | }, | 38 | }, |
36 | - goList() { | 39 | + |
40 | + goList(e) { | ||
41 | + var status=e.currentTarget.dataset.status | ||
37 | wx.navigateTo({ | 42 | wx.navigateTo({ |
38 | - url: '/pages/index/fans/fans', | 43 | + url: '/pages/index/fans/fans?status=' + status, |
39 | }) | 44 | }) |
40 | }, | 45 | }, |
46 | + | ||
41 | goMessage(){ | 47 | goMessage(){ |
42 | wx.navigateTo({ | 48 | wx.navigateTo({ |
43 | url: '/pages/index/message/message', | 49 | url: '/pages/index/message/message', |
44 | }) | 50 | }) |
45 | }, | 51 | }, |
52 | + | ||
46 | chargeTime(e) { | 53 | chargeTime(e) { |
47 | var current = e.currentTarget.dataset.current | 54 | var current = e.currentTarget.dataset.current |
48 | var tab_current = this.data.tab_current | 55 | var tab_current = this.data.tab_current |
@@ -18,11 +18,11 @@ | @@ -18,11 +18,11 @@ | ||
18 | <view class='user_name'>{{user_nickname}}</view> | 18 | <view class='user_name'>{{user_nickname}}</view> |
19 | <view class='user_brief'>{{signature}}</view> | 19 | <view class='user_brief'>{{signature}}</view> |
20 | <view class='banner_info' style='padding:0 50rpx;'> | 20 | <view class='banner_info' style='padding:0 50rpx;'> |
21 | - <view bindtap='goList'> | 21 | + <view bindtap='goList' data-status='2'> |
22 | <text class='' style='color:#999;'>粉丝</text> | 22 | <text class='' style='color:#999;'>粉丝</text> |
23 | <text class='user_num'>{{fans_num}}</text> | 23 | <text class='user_num'>{{fans_num}}</text> |
24 | </view> | 24 | </view> |
25 | - <view bindtap='goList'> | 25 | + <view bindtap='goList' data-status='1'> |
26 | <text class='' style='color:#999;'>关注</text> | 26 | <text class='' style='color:#999;'>关注</text> |
27 | <text class='user_num'>{{host_num}}</text> | 27 | <text class='user_num'>{{host_num}}</text> |
28 | </view> | 28 | </view> |
-
请 注册 或 登录 后发表评论