index.wxml 8.65 KB
<!--pages/taocan/index.wxml-->
<wxs src="../../utils/util.wxs" module="util" />
<view class="view flex flex-direction justify-center align-center" style="width: 100vw;height: 100vh;"  wx:if="{{hasLoading}}">
    <view class="flex flex-direction justify-center align-center" wx:if="{{hasLoadTimeout}}">
        <image src="http://nosqn.colorcun.com/timeout.png" style="width: 520rpx;height: 348rpx;"></image>
        <view class="margin-tb-lg txt-28-h">请求超时啦~重试一下看看</view>
        <view class="reflush flex justify-center align-center" bindtap="taocanInit">点击重试</view>
    </view>
    <view wx:else="" class="flex flex-direction justify-center align-center">
        <image src="http://nosqn.colorcun.com/loading.gif" style="width: 40rpx;height: 40rpx;"></image>
        <view class="margin-top bg-white txt-24-h">加载中,请稍后…</view>
    </view>
</view>
<block wx:else="">
    <nav hasHome>
        <view style="top:{{shareTop}}px;height:{{shareHeight}}px;left:{{shareLeft}}px;"
              catchtap="share"
              class="share view flex align-center justify-center bg-white round">
            <view class="icon view"></view>
            <view class="text margin-left-xs">分享</view>
        </view>
    </nav>
    <!--
    <swiper
            display-multiple-items="3"
            class="view margin-left-lg header text-black"
            bindchange="swiperChange"
            current="{{current}}"
            style="height: 80rpx;">
        <block wx:for="{{packs}}" wx:key="*this">
            <swiper-item
                    bindtap="touchTab" data-id="{{item.id}}" data-index="{{index}}"
                    class="swiper-item {{activityId==item.id?'active':''}} flex align-center">
                <view class="txt-32-h text-cut" style="width: 220rpx;height: 56rpx;">
                    <text class="swiper-item-txt">{{item.name}}</text>
                </view>
            </swiper-item>
        </block>
    </swiper>
    -->
    <block wx:if="{{!hasNoSets}}">
        <scroll-view class="view margin-left-lg header text-black"
                     scroll-x="true" bindscroll="scroll" scroll-into-view="PID{{activityId}}"
                     style="width: 100%;white-space: nowrap;height:80rpx;">
            <block wx:for="{{packs}}" wx:key="*this">
                <view id="PID{{item.id}}"
                      bindtap="touchTab" data-id="{{item.id}}" data-index="{{index}}"
                      class="view swiper-item {{activityId==item.id?'active':''}} flex align-center">
                    <view class="txt-32-h swiper-item-txt">
                        {{item.nameSub}}
                    </view>
                </view>
            </block>
        </scroll-view>
        <view class="view" style="padding-bottom: 150rpx;padding-top: 80rpx;">
            <view class="view box margin-lr margin-top-lg margin-bottom-sm padding">
                <view class="view text-xxl text-bold">{{packs[activityId].name}}</view>
                <view class="view flex align-end">
                    <view class="text-orange txt-28-h" style="margin-bottom: 4rpx;">¥</view>
                    <view class="text-orange txt-44-h margin-right-sm text-bold">{{packs[activityId].sale_price}}</view>
                    <view class="huaxian flex align-end">
                        <view class="txt-20-h" style="margin-bottom: 8rpx;">¥</view>
                        <view class="txt-28-h" style="margin-bottom: 4rpx;">{{packs[activityId].market_price}}</view>
                    </view>
                    <view class="view flex text-orange align-end margin-left-sm" wx:if="{{packs[activityId].discount>0}}" >
                        <view class="view tag" style="margin-bottom: 16rpx;"></view>
                        <view class="view margin-left-xs txt-24-h" style="margin-bottom: 10rpx;">{{packs[activityId].discount*10}}折</view>
                    </view>
                </view>
                <view class="view flex align-center txt-28-h margin-bottom labels" style="margin-top: 10rpx;">
                    <view class="view margin-right flex align-center" wx:if="{{packs[activityId]['包间可用']}}">
                        <view class="view icon icon1"></view>
                        <view class="view txt-28-h bg-white">包间可用</view>
                    </view>
                    <view class="view margin-right flex align-center" wx:if="{{packs[activityId]['免预约']}}">
                        <view class="view icon icon2"></view>
                        <view class="view txt-28-h bg-white">免预约</view>
                    </view>
                    <view class="view margin-right flex align-center" wx:if="{{packs[activityId]['随时退']}}">
                        <view class="view icon icon3"></view>
                        <view class="view txt-28-h bg-white">随时退</view>
                    </view>
                </view>
                <image src="{{packs[activityId].detail_url}}" style="width:100%;border-radius: 10rpx;" mode="widthFix"></image>
            </view>
            <view class="view box margin-lr margin-top-sm margin-bottom-sm">
                <view class="txt-30-h padding solid-bottom text-bold">购买须知</view>
                <view class="view padding block">
                    <view class="flex align-center margin-bottom-sm">
                        <view class="dot"></view>
                        <view class="txt-30-h text-bold">有效期</view>
                    </view>
                    <view class="text-df">{{util.unixtoTime(packs[activityId].eff_time_start,'YYYY.MM.DD')}}-{{util.unixtoTime(packs[activityId].eff_time_end,'YYYY.MM.DD HH:II')}}</view>
                </view>
                <view class="view padding block">
                    <view class="flex align-center margin-bottom-sm">
                        <view class="dot"></view>
                        <view class="txt-30-h text-bold">使用时间</view>
                    </view>
                    <view class="text-df">{{packs[activityId].use_time}}</view>
                </view>
                <view class="view padding block padding-bottom-sm">
                    <view class="flex align-center margin-bottom-sm">
                        <view class="dot"></view>
                        <view class="txt-30-h text-bold">使用规则</view>
                    </view>
                    <view class="text-df" wx:if="{{hasShowRule}}">
                        <text style="line-height: 40rpx;">{{packs[activityId].use_notice}}</text>
                    </view>
                    <view class="flex justify-center align-center rule margin-top-sm margin-bottom-sm" bindtap="toggleRule">
                        <view class="txt-28-h">{{hasShowRule?'收起':'展开更多'}}</view>
                        <view class="view icon {{hasShowRule?'show':''}}"></view>
                    </view>
                </view>
            </view>
        </view>
        <view class="view bottom flex align-center justify-between padding-right">
            <view class="view flex justify-center align-center flex-treble ">
                <view class="view flex align-end">
                    <view class="text-orange txt-40-h" style="margin-bottom: 4rpx;">¥</view>
                    <view class="text-orange txt-52-h margin-right-sm text-bold">{{packs[activityId].sale_price}}</view>
                </view>
                <view class="view flex flex-direction justify-center align-start">
                    <view class="view flex text-orange align-center" wx:if="{{packs[activityId].discount>0}}">
                        <view class="view tag"></view>
                        <view class="view margin-left-xs txt-24-h">{{packs[activityId].discount*10}}折</view>
                    </view>
                    <view class="huaxian flex align-end">
                        <view class="txt-24-h" style="margin-bottom: 2rpx;">¥</view>
                        <view class="txt-32-h">{{packs[activityId].market_price}}</view>
                    </view>
                </view>
            </view>
            <view class="flex justify-end" bindtap="createSale">
                <view class="buyButton txt-36-h text-bold flex align-center justify-center bg-blue-blue">立即抢购</view>
            </view>
        </view>
    </block>
    <view wx:else=""
          style="padding-top: 172rpx;"
          class="flex flex-direction justify-start align-center">
        <image src="http://nosqn.colorcun.com/taocan/1%20%2827%29.png"
               style="width: 520rpx;height: 348rpx;"></image>
        <view class="txt-28-h margin-top-lg">该套餐过期啦</view>
    </view>
    <share id="share" pack="{{packs[activityId]}}" wx:if="{{packs[activityId].id}}"></share>
</block>
<menu></menu>
<service></service>