<template>
  <v-header scroll title="发布评价" backgroundColor="#fff">
    <view class="order-comment-screen flex">
      <view
        v-for="(item,index) in inputShopData"
        :key="index"
      >
        <view class="order-comment-padding order-comment-shop">
          <layout-ui-shop-item :item="item" :number="true"></layout-ui-shop-item>
        </view>
        <view class="order-comment-margin"></view>
        <view
            v-for="(cItem,cIndex) in item.inputData"
            :key="cIndex"
        >
          <view v-if="cItem.component==='rate'" class="order-comment-padding order-comment-rate row aCenter">
            <view class="comment-rate-label">{{cItem.label}}</view>
            <uni-rate type="comment" :margin="5" v-model="cItem.value"></uni-rate>
          </view>
          <view v-else-if="cItem.component === 'textarea'" class="order-comment-padding order-comment-textarea-wrap">
          <textarea class="order-comment-textarea" placeholder-class="comment-textarea-placeholder"
                    :placeholder="cItem.placeholder"
                    v-model="cItem.value"
                    :maxlength="cItem.maxLength"
          ></textarea>
          </view>
          <view v-else-if="cItem.component==='upload'" class="order-comment-padding">
            <upload
                v-model="cItem.value"
                :max="cItem.max"
            ></upload>
          </view>

        </view>
      </view>


      <view class="flex-all-1"></view>

      <view class="center comment-button-group">
        <view @click="submit" class="comment-button center">发布</view>
      </view>

    </view>
  </v-header>
</template>

<script>
import vHeader from '@/components/v-header/main';
import layoutUiShopItem from '@/layout/layout-ui-shop-item/main';
import uniRate from '@/components/uni-rate/uni-rate';
import upload from '@/components/upload/main';
import mixins from './mixins/index';
export default {
  name: "order-comment",

  mixins,

  components:{
    vHeader,
    layoutUiShopItem,
    uniRate,
    upload
  }
}
</script>

<style lang="scss" src="./style.scss">

</style>