MrShi
4 天以前 05aec1e9986fbe3e907259bb1a1396f129bd0fa1
mini-program/pages/details/details.vue
@@ -47,10 +47,9 @@
            <view class="card-title-xian"></view>
            <text>擅长领域</text>
         </view>
         <view class="card-list" v-if="item.fieldList && item.fieldList.length > 0">
            <view class="card-list-item" v-for="(child, index) in item.fieldList" :key="index">
               <view class="card-list-item-title">{{child.name}}:</view>
               <view class="card-list-item-text">{{child.remark}}</view>
         <view class="card-list">
            <view class="card-list-item">
               <text v-for="(child, index) in item.fieldList" :key="index">{{child.name}} <template v-if="item.fieldList.length- 1 !== index">、</template></text>
            </view>
         </view>
      </view>
@@ -69,22 +68,27 @@
                  </view>
                  <view class="left-info">{{child.detail}}</view>
               </view>
               <view class="right" v-if="child.fileList && child.fileList.length > 0" @click="yulan(index, child.fileList[0].url)">
               <view class="right" v-if="child.fileList && child.fileList.length > 0" @click="yulan(child.fileList)">
                  <image :src="child.fileList[0].url" mode="widthFix"></image>
                  <view class="right-num">共{{child.fileList.length}}张</view>
               </view>
            </view>
         </view>
      </view>
      <previewImage ref="previewImage" :opacity="1" :circular="true" :imgs="imgs" />
   </view>
</template>
<script>
   import previewImage from '@/components/kxj-previewImage/kxj-previewImage.vue';
   export default {
      components: { previewImage}, //注册插件
      data() {
         return {
            id: null,
            item: null,
            imgs: []
         };
      },
      onLoad(option) {
@@ -92,11 +96,14 @@
         this.getDetails()
      },
      methods: {
         yulan(index, url) {
            uni.previewImage({
               current: url,
               urls: this.item.casesList[index].fileList.map(item => item.url)
            })
         yulan(arr) {
            this.imgs = arr.map(item => item.url)
            this.$refs.previewImage.open(this.imgs[0]);
            // uni.previewImage({
            //    current: url,
            //    urls: this.item.casesList[index].fileList.map(item => item.url),
            //    indicator: 'number'
            // })
         },
         zhankai() {
            this.item.zhankai = !this.item.zhankai
@@ -112,13 +119,16 @@
                     res.data.zhankai = false
                     res.data.contentCopy = res.data.content.substring(0, 30) + '...'
                  }
                  let arr = []
                  res.data.fieldList.forEach(item => {
                     if (item.remark) {
                        arr.push(item)
                     }
                  })
                  res.data.fieldList = arr;
                  // let arr = []
                  // res.data.fieldList.forEach(item => {
                  //    if (item.remark) {
                  //       arr.push(item)
                  //    }
                  // })
                  // res.data.fieldList = arr;
                  if (res.data.casesList) {
                     this.imageUrls = res.data.casesList.map(item => item.url)
                  }
                  this.item = res.data
               }
            })
@@ -243,12 +253,12 @@
                  align-items: center;
                  .item-info-c-item-label {
                     font-weight: 400;
                     font-size: 24rpx;
                     font-size: 26rpx;
                     color: #777777;
                  }
                  .item-info-c-item-val {
                     font-weight: 400;
                     font-size: 24rpx;
                     font-size: 26rpx;
                     color: #333333;
                  }
               }
@@ -257,7 +267,7 @@
               width: 100%;
               line-height: 40rpx;
               font-weight: 400;
               font-size: 24rpx;
               font-size: 26rpx;
               color: #333333;
               margin-top: 20rpx;
               text {
@@ -284,6 +294,7 @@
               margin-right: 12rpx;
            }
            text {
               line-height: 40rpx;
               font-weight: 600;
               font-size: 32rpx;
               color: #222222;
@@ -362,21 +373,17 @@
            width: 100%;
            .card-list-item {
               display: flex;
               flex-direction: column;
               align-items: center;
               flex-wrap: wrap;
               margin-bottom: 30rpx;
               line-height: 40rpx;
               &:last-child {
                  margin: 0 !important;
               }
               .card-list-item-title {
                  font-weight: 500;
               text {
                  font-weight: 400;
                  font-size: 28rpx;
                  color: #333333;
                  margin-bottom: 15rpx;
               }
               .card-list-item-text {
                  font-weight: 400;
                  font-size: 26rpx;
                  color: #666666;
               }
            }
         }