detail.vue 7.41 KB
Newer Older
DongRuifen's avatar
DongRuifen committed
1 2 3
<template>
  <view class="whole">

DongRuifen's avatar
DongRuifen committed
4 5
    <view class="back" :style="topHeight==0?'':{'padding-top':resultpx}">
     <!-- <view class="back"> -->
李星剑's avatar
李星剑 committed
6
      <view class="u-flex">
DongRuifen's avatar
DongRuifen committed
7
        <u-navbar :is-back="true" :background="{ backgroundColor: '#F5F5F5' }" title="面料详情">
李星剑's avatar
李星剑 committed
8 9 10
          <template v-slot:right>
            <view class="nav-nav" @click="edit()">编辑</view>
          </template>
DongRuifen's avatar
DongRuifen committed
11 12 13

        </u-navbar>
      </view>
DongRuifen's avatar
DongRuifen committed
14 15
      <view
        :class="fabricObj.materialPictureVOList!=undefined&&fabricObj.materialPictureVOList.length>4?'back-two':'back-back'">
DongRuifen's avatar
DongRuifen committed
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
        <view class="row" style="color:#F5B674"> {{fabricObj.materialName}}
        </view>
        <view class="row" style="color:#fff">
          <view v-for="item,index in dataList" :key="index">
            <view v-if="item.id==fabricObj.category">{{item.name}}</view>
          </view>|{{fabricObj.clothWidth}}cm|{{fabricObj.component}}
        </view>
        <view style="display:flex;flex-wrap: wrap;">
          <view class="row" v-for="item,index in fabricObj.materialPictureVOList" :key="index"
            style="margin-right:30rpx">
            <view @click="previewImage(`${imgUrl}${item.fileCode}`)">
              <image :src="`${imgUrl}${item.fileCode}`" mode="aspectFill"
                style="width:120rpx;height:120rpx;display:flex">
              </image>
            </view>
          </view>
        </view>
      </view>
    </view>
DongRuifen's avatar
DongRuifen committed
35 36 37
    <view class="whole-whole">
      <view
        :class="fabricObj.materialPictureVOList!=undefined&&fabricObj.materialPictureVOList.length>4?'body-two':'body'">
DongRuifen's avatar
DongRuifen committed
38 39 40
        <view class="font"><strong>已上架款式</strong></view>
        <view class="item" v-for="itemTab,indexTab in tableList" :key="indexTab">
          <view class="item-left">
DongRuifen's avatar
DongRuifen committed
41 42
            <view @click="previewImage(`${imgUrl}${itemTab.effectPictureCode}`)">
              <image class="item-img" :src="`${imgUrl}${itemTab.effectPictureCode}`" mode="aspectFill">
DongRuifen's avatar
DongRuifen committed
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
              </image>
            </view>
            <!-- <image class="item-img" src="../../static/images/home/1@2x.png" mode=""></image> -->
          </view>
          <view class="item-right">
            <view class="right-one">{{itemTab.styleTag}}</view>
            <view class="right-two">
              <view class="two-left">款号</view>
              <view class="two-right">{{itemTab.styleCode}}</view>
            </view>
            <view class="right-two">
              <view class="two-left">品类</view>
              <view class="two-right" v-for="itemId,indexId in dataList" :key="indexId">
                <view v-if="itemId.id==itemTab.categoryId">{{itemId.name}}</view>
              </view>
            </view>
            <!-- <view>
              <u-tag :text="itemTab.styleTag" bg-color="#f6f3ef" border-color="#f6f3ef" size="mini" color="#AF8D66"
                type="success" />
            </view> -->
            <view v-for="itemTagVo,indexTagVo in itemTab.styleLibraryTagVOList" :key="indexTagVo">
              <u-tag v-if="!itemTagVo.isDeleted" :text="itemTagVo.materialTagName" bg-color="#f6f3ef"
                border-color="#f6f3ef" size="mini" color="#AF8D66" type="success" />
            </view>
          </view>
        </view>

      </view>
    </view>
  </view>
</template>

<script>
  import utils from "../../mixins/utils"
  export default {
    mixins: [utils],
    data() {
      return {
        imgUrl: this.$IMG_URL,
        id: "",
DongRuifen's avatar
DongRuifen committed
83 84 85
        topHeight: null,
        heightpx: null,
        resultpx:"",
DongRuifen's avatar
DongRuifen committed
86 87 88 89 90 91 92 93
        fabricObj: {},
        tableList: [],
        dataList: [],
      };
    },
    watch: {
      id: {
        handler() {
李星剑's avatar
李星剑 committed
94 95
          // this.materialDetail()
          // this.detail()
DongRuifen's avatar
DongRuifen committed
96 97 98
        }
      }
    },
DongRuifen's avatar
DongRuifen committed
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113
    computed: {
      // heightpx() {

      //   return uni.upx2px(100) + 'px'
      // },
      // topHeight() {
      //   uni.getSystemInfo({
      //     success: (result) => {
      //       // this.topHeight = result.safeArea.top
      //       console.log(result.safeArea.top, "result.safeArea.top")
      //       return result.safeArea.top + 'px'
      //     }
      //   })
      // }
    },
DongRuifen's avatar
DongRuifen committed
114 115 116 117 118 119 120 121 122 123 124 125 126 127
    onLoad(option) {
      this.id = option.id
      this.materialDetail()
      this.detail()
      this.$http("category.query", {}).then(res => {
        let {
          code,
          data
        } = res;
        if (code === 200) {
          this.dataList = data;

        }
      })
DongRuifen's avatar
DongRuifen committed
128 129 130 131 132 133 134 135 136 137 138
      console.log(uni.upx2px(100), )
      uni.getSystemInfo({
        success: (result) => {
          this.topHeight = result.safeArea.top
          console.log(result.safeArea.top, "result.safeArea.top")

        }
      })
      this.heightpx = uni.upx2px(100)
      this.resultpx=(this.heightpx-this.topHeight)+'px'
      console.log(this.resultpx,"this.resultpx")
DongRuifen's avatar
DongRuifen committed
139 140 141 142 143 144
    },
    onShow() {
      this.id = this.$route.query.id
      this.materialDetail()
      this.detail()
    },
李星剑's avatar
李星剑 committed
145 146 147 148 149
    // created() {
    //   this.materialDetail()
    //   this.detail()
    //   this.id = this.$route.query.id
    // },
DongRuifen's avatar
DongRuifen committed
150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173
    methods: {
      materialDetail() {
        this.$http('materialinfo.getMaterialById', this.id).then(res => {
          let {
            code,
            data
          } = res;
          if (code === 200) {
            this.fabricObj = data;
          }
        });
      },
      detail() {
        this.$http('modelingtask.materialDetail', this.id).then(res => {
          let {
            code,
            data
          } = res;
          if (code === 200) {
            this.tableList = data.styleLibraryTaskItemVOList;
          }
        });
      },
      edit() {
李星剑's avatar
李星剑 committed
174
        this.$Router.push({
DongRuifen's avatar
DongRuifen committed
175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232
          path: "/pages/home/editFabric",
          query: {
            id: this.id
          }
        })
      }
    }
  }
</script>

<style lang="scss" scoped>
  .whole {
    // padding: 0 30rpx;
    background: #f5f5f5;

    .back {
      background: url(../../static/images/home/backimg.png) no-repeat;
      background-size: 100% 100%;
      height: 580rpx;
      padding: 0 30rpx;
      padding-top: 100rpx;

      .nav-nav {
        display: flex;
        justify-content: end;
        margin-right: 40rpx;
        width: 100%;
      }

      .back-two {
        background: #3b342f;
        height: 410rpx;
        padding: 30rpx 30rpx;
        opacity: 0.8;
      }

      .back-back {
        background: #3b342f;
        height: 340rpx;
        padding: 30rpx 30rpx;
        opacity: 0.8;
        // margin-top: 80rpx;


      }
    }

    .row {
      display: flex;
      margin-bottom: 18rpx;

      .img {
        width: 60px;
        height: 60px;
        margin-right: 30rpx;
      }
    }

DongRuifen's avatar
DongRuifen committed
233
    .whole-whole {
DongRuifen's avatar
DongRuifen committed
234 235 236 237 238 239 240 241 242

      padding: 0 30rpx;

      .body {
        background: #ffffff;
        border-radius: 4px;
        padding: 30rpx;
        margin-top: -60rpx;
      }
DongRuifen's avatar
DongRuifen committed
243 244

      .body-two {
DongRuifen's avatar
DongRuifen committed
245 246 247
        background: #ffffff;
        border-radius: 4px;
        padding: 30rpx;
DongRuifen's avatar
DongRuifen committed
248
        // margin-top: -20rpx;
DongRuifen's avatar
DongRuifen committed
249 250
      }

DongRuifen's avatar
DongRuifen committed
251 252 253
      .font {
        padding-bottom: 30rpx;
      }
DongRuifen's avatar
DongRuifen committed
254

DongRuifen's avatar
DongRuifen committed
255 256 257 258 259 260
      .item {
        padding-bottom: 30rpx;
        display: flex;

        .item-left {
          margin-right: 20rpx;
DongRuifen's avatar
DongRuifen committed
261

DongRuifen's avatar
DongRuifen committed
262 263 264
          .item-img {
            width: 80px;
            height: 80px;
DongRuifen's avatar
DongRuifen committed
265 266
          }
        }
DongRuifen's avatar
DongRuifen committed
267
      }
DongRuifen's avatar
DongRuifen committed
268

DongRuifen's avatar
DongRuifen committed
269 270 271
      .item:last-child {
        padding-bottom: 0px;
      }
DongRuifen's avatar
DongRuifen committed
272

DongRuifen's avatar
DongRuifen committed
273 274 275 276
      .item-right {
        .right-one {
          font-weight: bold;
        }
DongRuifen's avatar
DongRuifen committed
277

DongRuifen's avatar
DongRuifen committed
278 279 280
        .right-two {
          display: flex;
          color: rgba(0, 0, 0, 0.40);
DongRuifen's avatar
DongRuifen committed
281

DongRuifen's avatar
DongRuifen committed
282 283
          .two-left {
            margin-right: 40rpx;
DongRuifen's avatar
DongRuifen committed
284 285
          }
        }
DongRuifen's avatar
DongRuifen committed
286
      }
李星剑's avatar
李星剑 committed
287

DongRuifen's avatar
DongRuifen committed
288 289
    }
  }
DongRuifen's avatar
DongRuifen committed
290
</style>