<template name="sharePosterTemplate">
    <view class="scroll-view-box {{ total < 5 ? 'large' : 'normal' }}">
        <view
                wx:for="{{ data }}"
                wx:for-index="index"
                wx:key="id"
                data-poster="{{ item }}"
                class="list {{[item.id === currentId ? 'active' : '', total < 5 ? 'large' : 'normal']}}"
                catch:tap="selectListItem"
        >
            <view class="child">
                <image class="preview-img" src="{{ item.poster_url }}"></image>
                <image wx:if="{{ item.id === currentId }}" class="selected" src="https://commonresource-1252524126.cdn.xiaoeknow.com/image/l1vwbovl0ok1.png"></image>
            </view>
        </view>
    </view>
</template>

<view class="share-wrapper" catch:tap>
    <view class="wrapper" wx:if="{{ showShareWrapper }}">
        <view class="left-panel">
            <view class="content">
                <canvas class="canvasPosition"  type="2d" style="width: 1344px; height:750px;"  id='customCanvas'></canvas>
                <view class="close"  catchtap="closeSharePoster">
                    <image src="https://commonresource-1252524126.cdn.xiaoeknow.com/image/l1vwbove0js3.png" />
                </view>
                <view class="share-big-picture">
                    <view class="preview-img">
                        <image lazy-load="true" class="posterContent {{ previewDomClass }}" src="{{currentPosterUrl}}" show-menu-by-longpress="true" alt="" bindlongpress="longPress"></image>
                        <view wx:if="{{ showSwitchText }}" class="switch-text" catchtap="switchPosterText">
                            <image src="https://commonresource-1252524126.cdn.xiaoeknow.com/image/l28nnpwd0cg2.svg"></image>
                            <text>切换励志语录</text>
                        </view>
                    </view>
                    <view class="save">
                        <image src="https://commonresource-1252524126.cdn.xiaoeknow.com/image/l1vwbown0w27.png"></image>
                        <text>长按上方图片保存并分享</text>
                    </view>
                </view>
            </view>
        </view>
        <view class="right-panel">
            <view class="content">
                <view class="detail" wx:if="{{ posterList.length > 1 }}">
                    <view class="list-view" wx:for="{{ twoDimensionalPosterList }}">
                        <template is="sharePosterTemplate" data="{{ data: item, total: posterList.length, currentId }}"></template>
                    </view>
                </view>

                <view class="operations {{ posterList.length === 1 ? 'once-share-poster' : '' }}">
                    <view wx:for="{{ shareTypeList }}"
                          class="btn {{ item.type === 'empty' ? 'empty' : '' }}"
                          catchtap="{{ item.func }}"
                    >
                        <button open-type="{{ item.type }}" wx:if="{{ !(isTeacher && item.type === 'shareCircle') }}">
                            <view class="icon-box" wx:if="{{ item.icon }}">
                                <view class="opacity"></view>
                                <image class="icon" src="{{ shareListIconBaseUrl + item.icon+'.png' }}"></image>
                            </view>
                            <view class="label">{{ item.name }}</view>
                        </button>
                    </view>
                </view>
            </view>
        </view>
    </view>

    <SettingModal wx:if="{{isShowSettingModal}}" bindclose="closeModal" bindconfirm="confirmModal"/>
    <UnauthorizedModal wx:if="{{isShowUnauthorizedModal}}" bindclose="closeUnauthorizedModal"/>
    <ShareCircleTip wx:if="{{isShowShareCircleTip}}" bindclose="closeShareTip"/>
    <ShareTextPopup recommendInfo="{{recommendInfo}}" recommendPopupVisible="{{recommendPopupVisible}}"  wx:if="{{recommendInfo.length!=0}}" bind:changePopupVisible="changePopupVisible"></ShareTextPopup>

</view>
