许静 5 years ago
parent
commit
09e237de64

+ 2
- 2
config/dev.js View File

@@ -9,8 +9,8 @@ module.exports = {
9 9
     // WSS_HOST: '"wss://dev.jinchengjiaye.com"',
10 10
     // HOST: '"https://lt.pawoma.cn"',
11 11
     // WSS_HOST: '"wss://lt.pawoma.cn"',
12
-    HOST: '"http://127.0.0.1:8080"',
13
-    WSS_HOST: '"ws://127.0.0.1:8080"',
12
+    HOST: '"http://192.168.0.84:8080"',
13
+    WSS_HOST: '"ws://192.168.0.84:8080"',
14 14
   },
15 15
   weapp: {},
16 16
   h5: {}

BIN
src/assets/add.png View File


BIN
src/assets/close.png View File


BIN
src/assets/profile.png View File


+ 85
- 21
src/pages/person/profile/index.js View File

@@ -6,6 +6,10 @@ import { uploadFiles } from '@utils/request'
6 6
 
7 7
 import "taro-ui/dist/style/components/image-picker.scss";
8 8
 import "taro-ui/dist/style/components/icon.scss";
9
+const profileBg = require('@assets/profile.png')
10
+const add = require('@assets/add.png')
11
+const img = require('@assets/shop/banner1.jpg')
12
+const closeImg = require('@assets/close.png')
9 13
 
10 14
 // import { connect } from '@tarojs/redux'
11 15
 
@@ -20,6 +24,7 @@ export default class Profile extends Component {
20 24
     files: [],
21 25
     auditStatus: 0,
22 26
     documentVerifyId: '',
27
+    images: []
23 28
 
24 29
   }
25 30
   // 审核状态   0审核中  1审核通过  2审核不通过 3未审核
@@ -57,10 +62,36 @@ export default class Profile extends Component {
57 62
     const filePaths = files.map(x => x.file.path)
58 63
     uploadFiles(filePaths).then((res) => {
59 64
       this.setState({
60
-        files: res.map(x => ({ url: x}))
65
+        files: res.map(x => ({ url: x }))
61 66
       })
62 67
     })
63 68
   }
69
+  // 选择图片
70
+  bindAlbumClick(e) {
71
+    e.stopPropagation()
72
+    Taro.chooseImage({
73
+      count: 6,
74
+      sizeType: ['original', 'compressed'],  //可选择原图或压缩后的图片
75
+      sourceType: ['album', 'camera'], //可选择性开放访问相册、相机
76
+      success: res => {
77
+        uploadFiles(res.tempFilePaths).then(data => {
78
+
79
+          const images = this.state.images.concat(data)
80
+          console.log(images, "data")
81
+          this.setState({
82
+            marginTop: 0,
83
+            messageType: 'image',
84
+            images: images
85
+          }, this.onSendMsg)
86
+        })
87
+      }
88
+    })
89
+  }
90
+  // 删除图片
91
+  deleteImg(inx) {
92
+    console.log(inx, "inx")
93
+  }
94
+
64 95
   onFail(mes) {
65 96
     console.log(mes)
66 97
   }
@@ -77,11 +108,11 @@ export default class Profile extends Component {
77 108
       let imgList = []
78 109
       let fileList = this.state.files
79 110
       fileList.map((item, index) => {
80
-          let newObj = {}
81
-          newObj.img = item.url,
111
+        let newObj = {}
112
+        newObj.img = item.url,
82 113
           newObj.sort = index
83
-          imgList.push(newObj)
84
-        }
114
+        imgList.push(newObj)
115
+      }
85 116
       )
86 117
 
87 118
       const payload = {
@@ -91,7 +122,7 @@ export default class Profile extends Component {
91 122
 
92 123
       editDocumentVerify(payload).then(res => {
93 124
         this.setState({
94
-          files: res.imgList.map(x => ({url: x.img})),
125
+          files: res.imgList.map(x => ({ url: x.img })),
95 126
           auditStatus: res.verifyStatus
96 127
         })
97 128
         Taro.showToast({ icon: 'none', title: '提交成功' });
@@ -113,7 +144,7 @@ export default class Profile extends Component {
113 144
 
114 145
       commitDocumentVerify(imgList).then(res => {
115 146
         this.setState({
116
-          files: res.imgList.map(x => ({url: x.img})),
147
+          files: res.imgList.map(x => ({ url: x.img })),
117 148
           auditStatus: res.verifyStatus
118 149
         })
119 150
         Taro.showToast({ icon: 'none', title: '提交成功' });
@@ -127,21 +158,53 @@ export default class Profile extends Component {
127 158
 
128 159
 
129 160
   render() {
130
-
161
+    const { images } = this.state
131 162
 
132 163
     return (
133
-      <View className="profile-page">
134
-        <View className="tip">
135
-          建议上传相关购房资格等相关资料,最多上传8张,
136
-        </View>
137
-        <View className="tip">
138
-          审核通过后将获取更多积分、兑换好礼~
139
-        </View>
140
-        {this.state.auditStatus == 1 &&
164
+      <View className="profile-page" style={`background: url(${profileBg}) no-repeat top;background-size: 100% 100%;`}>
165
+
166
+        {/* {this.state.auditStatus == 1 &&
141 167
           <View className="commit-text" >审核通过,快去查看积分吧~</View>
168
+        } */}
169
+        {!images.length &&
170
+          <View className="up-images">
171
+
172
+            <View style="margin-bottom:18px" className="up-btn" onClick={this.bindAlbumClick}>
173
+              <Image className="add-img" src={add} />
174
+              上传资料
175
+            </View>
176
+            <View className="tip">
177
+              建议上传相关购房资格等相关资料,审核
178
+          </View>
179
+            <View className="tip">
180
+              通过后将获取更多积分、兑换好礼~
181
+          </View>
182
+          </View>
142 183
         }
143
-
144
-        <AtImagePicker
184
+        {images.length &&
185
+          <View>
186
+            <View style="padding:10px 20px">
187
+              <View className="up-btn" onClick={this.bindAlbumClick}>
188
+                <Image className="add-img" src={add} />
189
+                上传资料
190
+              </View>
191
+            </View>
192
+            <View className="image-box">
193
+              {
194
+                images.map((item, index) => {
195
+                  return (
196
+                    <View className="image-con">
197
+                      <Image className="close-btn" src={closeImg} onClick={this.deleteImg} />
198
+                      <Image className="img" src={item} />
199
+                    </View>
200
+                  )
201
+                })
202
+              }
203
+
204
+            </View>
205
+          </View>
206
+        }
207
+        {/* <AtImagePicker
145 208
           showAddBtn={(this.state.files.length < 8 && this.state.auditStatus == 2) || (this.state.auditStatus == 3 && this.state.files.length < 8)}
146 209
           length={2}
147 210
           mode="scaleToFill"
@@ -149,8 +212,9 @@ export default class Profile extends Component {
149 212
           onChange={this.onChange.bind(this)}
150 213
           onFail={this.onFail.bind(this)}
151 214
           onImageClick={this.onImageClick.bind(this)}
152
-        />
153
-        {this.state.auditStatus == 2 &&
215
+        /> */}
216
+
217
+        {/* {this.state.auditStatus == 2 &&
154 218
           <View className="commit-text" >审核未通过,请重新提交!</View>
155 219
         }
156 220
 
@@ -159,7 +223,7 @@ export default class Profile extends Component {
159 223
         }
160 224
         {this.state.auditStatus == 0 &&
161 225
           <View className="commit-text" >审核中</View>
162
-        }
226
+        } */}
163 227
 
164 228
       </View>
165 229
     )

+ 60
- 7
src/pages/person/profile/index.scss View File

@@ -1,13 +1,66 @@
1
+@import "@styles/theme.scss";
2
+
1 3
 .profile-page{
2
-  padding: 20px 40px;
4
+  background-color: #f4f4f4;
3 5
   height: 100vh;
4
-  width: 100vw;
5
-  
6
-  .tip{
7
-    font-size:24px;
8
-    color:#c8c8c8;
6
+
7
+  .up-btn{
8
+    width: 670px;
9
+    height: 220px;
10
+    background-color: #fff;
11
+    border: 1px solid #E8E8E8;
12
+    border-radius: 12px;
9 13
     text-align: center;
10
-    margin-bottom: 10px;
14
+    color: $primary-color;
15
+    margin: 0 auto;
16
+    .add-img{
17
+      width: 72px;
18
+      height: 72px;
19
+      margin: 42px auto 20px auto;
20
+      display: block;
21
+
22
+    }
23
+    }
24
+  .up-images{
25
+    width: 100%;
26
+    padding: 0 40px;
27
+    position: absolute;
28
+    top: 36%;
29
+    left: 0;
30
+    .tip{
31
+      font-size:28px;
32
+      color:#999;
33
+      text-align: center;
34
+      margin-bottom: 8px;
35
+      }
36
+  }
37
+  .image-box{
38
+    display: flex;
39
+    flex-wrap: wrap;
40
+    align-content: flex-start;
41
+    justify-content: space-between;
42
+    padding: 20px 25px;
43
+
44
+    .image-con {
45
+      flex: 0 0 50%;
46
+      height: 316px;
47
+      box-sizing: border-box;
48
+      margin-bottom: 42px;
49
+      position: relative;
50
+      .close-btn{
51
+        position: absolute;
52
+        width: 76px;
53
+        height: 48px;
54
+        right: 19px;
55
+        top:0;
56
+      }
57
+      .img{
58
+        width: 316px;
59
+        height: 316px;
60
+        border-radius: 12px;
61
+        margin: 0 17px;
62
+      }
63
+    }
11 64
   }
12 65
   .commit-btn{
13 66
     width:360px;

+ 29
- 29
src/pages/shop/index.js View File

@@ -214,12 +214,11 @@ export default class Shop extends Component {
214 214
     return (
215 215
 
216 216
 
217
+      <View>
217 218
 
218
-      <View className="list__wrap">
219 219
         {
220
-
221 220
           goodsBuilding && goodsBuilding.length < 2 &&
222
-          <View>
221
+          <View className="list__wrap">
223 222
             <View className="hot_title">热门商品</View>
224 223
             {
225 224
               goodsList.map(item => (
@@ -241,35 +240,36 @@ export default class Shop extends Component {
241 240
         }
242 241
         {
243 242
           goodsBuilding && goodsBuilding.length >= 2 &&
244
-          <AtTabs scroll tabDirection='horizontal' current={current} tabList={goodsBuilding} onClick={this.handleClick.bind(this)}>
245
-
246
-            {goodsBuilding.map((l_item, index) => (
247
-
248
-              <AtTabsPane current={current} index={index} >
249
-                <View>
250
-                  {
251
-                    goodsList.map(item => (
252
-                      <View className="item" key={item.goodsId} onClick={this.onViewDetail.bind(this, item)}>
253
-                        <Image className="item__img" src={item.imgUrl} />
254
-                        <View className="item__title">{item.goodsName}</View>
255
-                        <View className="item__des">
256
-                          <View>
257
-                            剩余数量{item.inventory}
258
-                          </View>
259
-                          <View >
260
-                            <Text className="item__jifen">{item.pointPrice}</Text>积分
243
+          <View className="list__wrap">
244
+            <AtTabs scroll tabDirection='horizontal' current={current} tabList={goodsBuilding} onClick={this.handleClick.bind(this)}>
245
+
246
+              {goodsBuilding.map((l_item, index) => (
247
+                <AtTabsPane current={current} key={index} index={index} >
248
+                  <View>
249
+                    {
250
+                      goodsList.map(item => (
251
+                        <View className="item" key={item.goodsId} onClick={this.onViewDetail.bind(this, item)}>
252
+                          <Image className="item__img" src={item.imgUrl} />
253
+                          <View className="item__title">{item.goodsName}</View>
254
+                          <View className="item__des">
255
+                            <View>
256
+                              剩余数量{item.inventory}
257
+                            </View>
258
+                            <View >
259
+                              <Text className="item__jifen">{item.pointPrice}</Text>积分
261 260
                 </View>
262
-                        </View>
261
+                          </View>
263 262
 
264
-                      </View>
265
-                    ))
266
-                  }
263
+                        </View>
264
+                      ))
265
+                    }
267 266
 
268
-                </View>
269
-              </AtTabsPane>
270
-            ))
271
-            }
272
-          </AtTabs>
267
+                  </View>
268
+                </AtTabsPane>
269
+              ))
270
+              }
271
+            </AtTabs>
272
+          </View>
273 273
         }
274 274
       </View>
275 275