230320a303 1 tahun lalu
induk
melakukan
dca6ddf143
2 mengubah file dengan 22 tambahan dan 2 penghapusan
  1. 2 0
      src/pagesMore/center/uploadRoom2.jsx
  2. 20 2
      src/pagesRoom/dtl.jsx

+ 2 - 0
src/pagesMore/center/uploadRoom2.jsx

@@ -87,6 +87,7 @@ class Index extends Component {
             house_img: cObj.house_img || '',
             position: cObj.position || '',
             floor_price: cObj.floor_price || '',
+            video: cObj.video || '',
           },
           imgArr: (cObj.images && cObj.images.length > 0) ? cObj.images.split(',') : [],
           addr1: addr[0],
@@ -161,6 +162,7 @@ class Index extends Component {
       house_img: formObj.house_img,
       position: formObj.position,
       floor_price: formObj.floor_price,
+      video: formObj.video || '',
       images: imgArr.join(','),
     }
     if (pStr === 'is_sold') {

+ 20 - 2
src/pagesRoom/dtl.jsx

@@ -47,7 +47,6 @@ class Index extends Component {
   getDtl = () => {
     const { curId } = this.state
     Taro.api.room.apieshousedetail({id: curId}).then(res => {
-      // console.log(res)
       Taro.setNavigationBarTitle({
         title: res.title || '房源详情'
       })
@@ -97,6 +96,25 @@ class Index extends Component {
           current={curImgIndex}
           onChange={this.headerImgChange.bind(this)}
           className='dh-swiper'>
+            {
+              curObj.video
+              ?
+              <SwiperItem>
+                <View className='dh-item'>
+                  <Video
+                    className="img"
+                    src={curObj.video}
+                    controls={true}
+                    autoplay={false}
+                    initialTime='0'
+                    id='video'
+                    loop={false}
+                    muted={false}
+                  />
+                </View>
+              </SwiperItem>
+              : ''
+            }
             {
               imgArr.map((item, index) => {
                 return (
@@ -111,7 +129,7 @@ class Index extends Component {
         </Swiper>
         <View className="dh-count">
           <View className="bg"></View>
-          <View className="num">{curImgIndex + 1}/{imgArr.length}</View>
+          <View className="num">{curImgIndex + 1}/{imgArr.length + (curObj.video ? 1 : 0)}</View>
         </View>
       </View>
     )