230320a303 1 year ago
parent
commit
37892a9e09

+ 12 - 0
src/app.scss

@@ -112,3 +112,15 @@ pendant {
   width: 10px;
   height: 10px;
 }
+
+
+.g-view-btn {
+  padding: 0;
+  margin: 0;
+  border: none;
+  outline: none;
+  background: transparent;
+  border-radius: 0;
+  box-shadow: none;
+  display: inline-block;
+}

BIN
src/assets/img/icon_hp_v.png


+ 59 - 5
src/pagesMore/center/userEdit.jsx

@@ -127,6 +127,48 @@ class Index extends Component {
     })
   }
 
+
+  onChooseAvatar(e) {
+    const that = this
+    const { avatarUrl } = e.detail
+    let token = Taro.getStorageSync('APP_token')
+    let { imgArr } = this.state
+    Taro.uploadFile({
+      url: `https://api.honglouplus.com/api/upload/cloud`,
+      filePath: avatarUrl,
+      name: 'upload',
+      formData: {
+        'token': token
+      },
+      success (res){
+        const msg = res.data || ''
+        const key = CJ.enc.Utf8.parse(HLKEY)
+        const bytes = CJ.AES.decrypt(msg, key, {
+          mode: CJ.mode.ECB,
+          padding: CJ.pad.Pkcs7
+        })
+        const originalText = bytes.toString(CJ.enc.Utf8)
+        const cData = JSON.parse(originalText)
+        const curImg = cData.data.url || ''
+        imgArr.push(curImg)
+        that.setState({
+          imgArr
+        })
+      }
+    })
+  }
+  nicknameChange (e) {
+    const v = e.detail.value || ''
+    if (v) {
+      let { formObj } = this.state
+      formObj.nickname = v
+      this.setState({
+        formObj
+      })
+    }
+  }
+
+
   render () {
     let { formObj } = this.state
     const dictData = Taro.getStorageSync('dictData')
@@ -142,25 +184,37 @@ class Index extends Component {
     })
     return (
       <View className="l-box">
-        <View className="l-floor-pos2">
+        {/* <button class="sc-img g-view-btn" open-type="chooseAvatar" @chooseavatar="onChooseAvatar">
+				<image class="i" :src="curObj.avatarUrl || defaultAvatarUrl" mode="aspectFill"></image>
+			</button>
+			<input type="nickname" class="sc-name" v-model="curObj.nickname" placeholder="微信用户" @change="nicknameChange"/> */}
+        {/* <View className="l-floor-pos2">
           <LFormGroup
             val={formObj.nickname}
             valStr="nickname"
             keyStr="展示昵称"
             bc={this.baseFormChange.bind(this)}
           />
+        </View> */}
+        <View className="scoped-box">
+          <View className="sb-title">展示昵称:
+            <Input type="nickname" className="r-i" value={formObj.nickname} placeholder="微信用户" onChange={this.nicknameChange.bind(this)}/>
+          </View>
         </View>
         <View className="scoped-box">
-          <View className="sb-title">展示头像
+          <View className="sb-title">展示头像:
           </View>
           <View className="scoped-img">
             {imgItems}
             {
               imgArr.length < 1
               &&
-              <View className="si-op" onClick={this.addImg.bind(this)}>
-                <Image src={addIcon} className="img"/>
-              </View>
+              // <View className="si-op" onClick={this.addImg.bind(this)}>
+              //   <Image src={addIcon} className="img"/>
+              // </View>
+              <Button className="si-op g-view-btn" open-type="chooseAvatar" onChooseavatar={this.onChooseAvatar.bind(this)}>
+                <Image className="img" src={addIcon} mode="aspectFill"></Image>
+              </Button>
             }
           </View>
         </View>

+ 13 - 3
src/pagesMore/center/userEdit.scss

@@ -1,9 +1,10 @@
 @import '@css/mixin.scss';
 .scoped-box {
   padding: 20px;
+  border-bottom: 1PX solid #f2f2f2;
   .sb-title {
-    font-size: 30px;
-    color: #333;
+    font-size: 28px;
+    color: #666;
     padding-bottom: 20px;
     font-weight: bold;
     padding-left: 10px;
@@ -13,6 +14,15 @@
       color: #999;
       font-weight: normal;
     }
+    .r-i {
+      width: 300px;
+      display: inline-block;
+      vertical-align: middle;
+      padding-left: 20rpx;
+      color: #333;
+      font-size: 28px;
+      padding-bottom: 6px;
+    }
   }
 }
 .at-textarea {
@@ -32,7 +42,7 @@
     margin-right: 30px;
     margin-bottom: 30px;
     position: relative;
-    border: 1PX solid #f2f2f2;
+    box-sizing: border-box;
     .img {
       width: 200px;
       height: 200px;

+ 1 - 1
src/pagesRoom/dtl.jsx

@@ -129,7 +129,7 @@ class Index extends Component {
         </Swiper>
         <View className="dh-count">
           <View className="bg"></View>
-          <View className="num">{curImgIndex + 1}/{imgArr.length + (curObj.video ? 1 : 0)}</View>
+          <View className="num">{curImgIndex + 1}-{imgArr.length + (curObj.video ? 1 : 0)}</View>
         </View>
       </View>
     )

+ 2 - 1
src/pagesRoom/dtl.scss

@@ -20,7 +20,8 @@ page {
   }
   .dh-count {
     position: absolute;
-    right: 20px;
+    right: 50%;
+    margin-right: -45rpx;
     bottom: 20px;
     width: 90px;
     height: 40px;

+ 10 - 0
src/pagesRoom/list.jsx

@@ -528,6 +528,7 @@ class Index extends Component {
       } else {
         isListEmpty = false
       }
+      console.log(dataList)
       this.setState({
         dataList,
         isListEnd,
@@ -551,6 +552,7 @@ class Index extends Component {
 
   renderList () {
     const { dataList, isListEnd, isListLoading, isListEmpty } = this.state
+    const hpV = require('@img/icon_hp_v.png')
     const itemsList = dataList.map((item, index) => {
       let FHstr = '未知楼层'
       if (item.floor) {
@@ -575,6 +577,14 @@ class Index extends Component {
       return (
         <View className="lhl-item col-1" key={index} onClick={this.linkHandle.bind(this, item)}>
           <View className="lhl-img">
+            {
+              item.video
+              ?
+              <View className="vr-icon">
+                <Image src={hpV} className="i i1" />
+              </View>
+              : ''
+            }
             <Image src={item.pri_image + '_xs'} className="img" />
           </View>
           <View className="lhl-info">

+ 7 - 0
src/pagesRoom/list.scss

@@ -22,3 +22,10 @@
   width: 300px;
 }
 
+
+.l-house-list .lhl-img {
+  height: 170rpx;
+  .img {
+    height: 170rpx;
+  }
+}