custom-hot-zone.component.html 8.02 KB
Newer Older
范雪寒's avatar
范雪寒 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
<div class="p-image-children-editor">

  <h5 style="margin-left: 2.5%;"> preview: </h5>

  <div class="preview-box" #wrap>
    <canvas id="canvas" #canvas></canvas>
  </div>

  <div nz-row nzType="flex" nzAlign="middle">
    <div nz-col nzSpan="5" nzOffset="1">

      <h5> add background: </h5>

      <div class="bg-box">
        <app-upload-image-with-preview
          [picUrl]="bgItem?.url"
          (imageUploaded)="onBackgroundUploadSuccess($event)">
        </app-upload-image-with-preview>
      </div>
    </div>

    <div nz-col nzSpan="5" nzOffset="1" class="img-box"
         *ngFor="let it of hotZoneArr; let i = index">

      <div
        style="margin: auto; padding: 5px;  margin-top: 30px; width:90%; border: 2px dashed #ddd; border-radius: 10px">
        <span style="margin-left: 40%;"> item-{{i + 1}}
        </span>
        <button style="float: right;" nz-button nzType="danger" nzSize="small" (click)="deleteBtnClick(i)">
          X
        </button>

        <nz-divider style="margin-top: 10px;"></nz-divider>

Li Mingzhe's avatar
Li Mingzhe committed
35
        <div style="margin-top: -20px; margin-bottom: 5px; width: 100%;">
范雪寒's avatar
范雪寒 committed
36

Li Mingzhe's avatar
Li Mingzhe committed
37 38 39 40 41 42
          <div *ngIf="customTypeGroupArr">
            <nz-radio-group [ngModel]="it.gIdx" (ngModelChange)="customRadioChange($event, it)"  style="display: flex; align-items: center; justify-content: center; flex-wrap: wrap;">
              <div *ngFor="let group of customTypeGroupArr; let gIdx = index" style="display: flex; ">
                <label nz-radio nzValue="{{gIdx}}">{{group.name}}</label>
              </div>
            </nz-radio-group>
范雪寒's avatar
范雪寒 committed
43

Li Mingzhe's avatar
Li Mingzhe committed
44 45 46 47 48 49 50 51 52 53 54
          </div>

          <!-- <div *ngIf="!customTypeGroupArr">
            <nz-radio-group [ngModel]="it.itemType" (ngModelChange)="radioChange($event, it)"  style="display: flex; align-items: center; justify-content: center">

              <label *ngIf="isHasRect" nz-radio nzValue="rect">矩形</label>
              <label *ngIf="isHasPic" nz-radio nzValue="pic">图片</label>
              <label *ngIf="isHasText" nz-radio nzValue="text">文本</label>

            </nz-radio-group>
          </div> -->
范雪寒's avatar
范雪寒 committed
55 56 57

        </div>

Li Mingzhe's avatar
Li Mingzhe committed
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 83 84 85 86 87
        <div *ngIf="customTypeGroupArr && customTypeGroupArr[it.gIdx]">

          <div *ngIf="customTypeGroupArr[it.gIdx].pic">
            <app-upload-image-with-preview
              [picUrl]="it?.pic_url"
              (imageUploaded)="onItemImgUploadSuccess($event, it)">
            </app-upload-image-with-preview>
          </div>

          <div *ngIf="customTypeGroupArr[it.gIdx].text" style="margin-top: 5px">
            <input type="text" nz-input [(ngModel)]="it.text" (blur)="saveText(it)">
          </div>

          <div *ngIf="customTypeGroupArr[it.gIdx].anima" align="center" style="margin-top: 5px">
            <button nz-button (click)="setAnimaBtnClick(i)" >
              <i nz-icon nzType="tool" nzTheme="outline"></i>
              配置龙骨动画
            </button>
          </div>

     

          <div *ngIf="customTypeGroupArr[it.gIdx].audio" style="display: flex;align-items: center; margin-top: 5px">
            <app-audio-recorder
              style="margin: auto"
              [audioUrl]="it.audio_url"
              (audioUploaded)="onItemAudioUploadSuccess($event, it)"
            ></app-audio-recorder>
          </div>

范雪寒's avatar
范雪寒 committed
88 89
        </div>

Li Mingzhe's avatar
Li Mingzhe committed
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122
        <!-- <div *ngIf="!customTypeGroupArr">

          <div *ngIf="it.itemType == 'pic'">
            <app-upload-image-with-preview
              [picUrl]="it?.pic_url"
              (imageUploaded)="onItemImgUploadSuccess($event, it)">
            </app-upload-image-with-preview>
          </div>

          <div *ngIf="it.itemType == 'text'">
            <input type="text" nz-input [(ngModel)]="it.text" (blur)="saveText(it)">
          </div>

          <div *ngIf="isHasAudio"
               style="width: 100%; margin-top: 5px; display: flex; align-items: center; justify-items: center;">
            <app-audio-recorder
              style="margin: auto"
              [audioUrl]="it.audio_url"
              (audioUploaded)="onItemAudioUploadSuccess($event, it)"
            ></app-audio-recorder>
          </div>

          <div *ngIf="it.itemType == 'rect' && isHasAnima" align="center" style="margin-bottom: 5px">
            <button nz-button (click)="setAnimaBtnClick(i)" >
              <i nz-icon nzType="tool" nzTheme="outline"></i>
              配置龙骨动画
            </button>
          </div>

        </div> -->



范雪寒's avatar
范雪寒 committed
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146
      </div>

    </div>


    <div nz-col nzSpan="5" nzOffset="1">

      <div class="bg-box">
        <button nz-button nzType="dashed" (click)="addBtnClick()"
                class="add-btn">
          <i nz-icon nzType="plus-circle" nzTheme="outline"></i>
          <!--Add Image-->
          Add hot zone
        </button>
      </div>

    </div>
  </div>


  <nz-divider></nz-divider>

  <div class="save-box">

Li Mingzhe's avatar
Li Mingzhe committed
147
    <button style="margin-left: 200px" class="save-btn" nz-button nzType="primary" [nzSize]="'large'" nzShape="round"
范雪寒's avatar
范雪寒 committed
148 149 150 151 152
            (click)="saveClick()" >
      <i nz-icon nzType="save"></i>
      Save
    </button>

Li Mingzhe's avatar
Li Mingzhe committed
153
    <div *ngIf="isCopyData" style="height: 40px; display: flex; justify-items: center;" >
Li Mingzhe's avatar
Li Mingzhe committed
154 155 156 157 158 159 160 161 162 163 164 165 166

      <label style="margin-left: 40px" nz-checkbox [(ngModel)]="bgItem.isShowDebugLine">显示辅助框</label>

      <button style="margin-left: 20px; margin-top: -5px" nz-button (click)="copyHotZoneData()"> 复制基础数据 </button>
      <div style="margin-left: 10px; margin-top: -5px" >

        <span>粘贴数据: </span>
        <input style="width: 100px;" type="text" nz-input [(ngModel)]="pasteData" >
        <button style="margin-left: 5px;" nz-button [disabled]="pasteData==''" nzType="primary" (click)="importData()">导入</button>

      </div>


Li Mingzhe's avatar
Li Mingzhe committed
167
    </div>
Li Mingzhe's avatar
Li Mingzhe committed
168 169


范雪寒's avatar
范雪寒 committed
170 171 172 173 174 175 176 177 178
  </div>


</div>


<label style="opacity: 0; position: absolute; top: 0px; font-family: 'BRLNSR_1'">1</label>


Li Mingzhe's avatar
Li Mingzhe committed
179
<!--龙骨面板-->
Li Mingzhe's avatar
Li Mingzhe committed
180
<nz-modal [(nzVisible)]="animaPanelVisible" nzTitle="配置资源文件"   (nzAfterClose)="closeAfterPanel()" (nzOnCancel)="animaPanelCancel()" (nzOnOk)="animaPanelOk()" nzOkText="保存">
Li Mingzhe's avatar
Li Mingzhe committed
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

  <div class="anima-upload-btn">
    <span style="margin-right: 10px">上传 ske_json 文件: </span>
    <nz-upload [nzShowUploadList]="false"
               nzAccept="application/json"
               [nzAction]="uploadUrl"
               [nzData]="uploadData"
               (nzChange)="skeJsonHandleChange($event)">
      <button nz-button><i nz-icon nzType="upload"></i><span>Upload</span></button>
    </nz-upload>
    <i *ngIf="isSkeJsonLoading" style="margin-left: 10px;" nz-icon [nzType]="'loading'"></i>
    <span *ngIf="skeJsonData['name']" style="margin-left: 10px"><u> {{skeJsonData['name']}} </u></span>
  </div>

  <div class="anima-upload-btn">
    <span style="margin-right: 10px">上传 tex_json 文件: </span>
    <nz-upload [nzShowUploadList]="false"
               nzAccept="application/json"
               [nzAction]="uploadUrl"
               [nzData]="uploadData"
               (nzChange)="texJsonHandleChange($event)">
      <button nz-button><i nz-icon nzType="upload"></i><span>Upload</span></button>
    </nz-upload>
    <i *ngIf="isTexJsonLoading" style="margin-left: 10px;" nz-icon [nzType]="'loading'"></i>
    <span *ngIf="texJsonData['name']" style="margin-left: 10px"><u> {{texJsonData['name']}} </u></span>
  </div>

  <div class="anima-upload-btn">
    <span style="margin-right: 10px">上传 tex_png 文件: </span>
    <nz-upload [nzShowUploadList]="false"
               nzAccept = "image/*"
               [nzAction]="uploadUrl"
               [nzData]="uploadData"
               (nzChange)="texPngHandleChange($event)">
      <button nz-button><i nz-icon nzType="upload"></i><span>Upload</span></button>
    </nz-upload>
    <i *ngIf="isTexPngLoading" style="margin-left: 10px;" nz-icon [nzType]="'loading'"></i>
    <span *ngIf="texPngData['name']" style="margin-left: 10px"><u> {{texPngData['name']}} </u></span>
  </div>

  <div class="anima-upload-btn" *ngIf="customTypeGroupArr && customTypeGroupArr[curDragonBoneGIdx] && customTypeGroupArr[curDragonBoneGIdx].animaNames">
    提示:需包含以下动画: {{customTypeGroupArr[curDragonBoneGIdx].animaNames.toString()}}
  </div>

</nz-modal>