v-show恢复为v-if(小程序有Bug)

This commit is contained in:
TOP糯米 2023-02-24 00:33:25 +08:00
parent 2492c6a57a
commit 9fff9b6eb3
11 changed files with 53 additions and 56 deletions

View File

@ -1,5 +1,5 @@
<template> <template>
<view class="login-box" v-show="showLoginModal"> <view class="login-box" v-if="showLoginModal">
<button open-type="getUserInfo" @click="getUserInfo">授权登录</button> <button open-type="getUserInfo" @click="getUserInfo">授权登录</button>
</view> </view>
</template> </template>

View File

@ -15,7 +15,7 @@
</view> </view>
</swiper-item> </swiper-item>
</swiper> </swiper>
<view class="swiper-dots" v-show="indicatorDots"> <view class="swiper-dots" v-if="indicatorDots">
<view <view
class="swiper-dot-item" class="swiper-dot-item"
v-for="(value, key) in list.length" v-for="(value, key) in list.length"

View File

@ -10,24 +10,18 @@
}" }"
> >
<!-- 首页选择地址 --> <!-- 首页选择地址 -->
<view <block v-if="btnType === 'city'">
v-show="btnType === 'city'" <view class="page-index-btn change-city" :style="{ height: header.height + 'px' }" @click="changeCity">
class="page-index-btn change-city" <text class="iconfont icon-31dingwei"></text>
:style="{ height: header.height + 'px' }" <text class="city">成都市</text>
@click="changeCity" </view>
> </block>
<text class="iconfont icon-31dingwei"></text>
<text class="city">成都市</text>
</view>
<!-- 正常返回按钮 --> <!-- 正常返回按钮 -->
<view <block v-if="btnType === 'back'">
v-show="btnType === 'back'" <view class="page-index-btn back" :style="{ height: header.height + 'px' }" @click="onClick">
class="page-index-btn back" <text class="iconfont icon-fanhui"></text>
:style="{ height: header.height + 'px' }" </view>
@click="onClick" </block>
>
<text class="iconfont icon-fanhui"></text>
</view>
<view class="page-title"> <view class="page-title">
<text class="title-text" :style="{ lineHeight: header.height + 'px' }">{{ title }}</text> <text class="title-text" :style="{ lineHeight: header.height + 'px' }">{{ title }}</text>
</view> </view>

View File

@ -1,33 +1,36 @@
<template> <template>
<view class="order-action"> <view class="order-action">
<view <block
v-show=" v-if="
order.state == $models.order.state.NO_PAY || order.state == $models.order.state.NO_PAY ||
order.state == $models.order.state.NO_PRICE || order.state == $models.order.state.NO_PRICE ||
order.state == $models.order.state.NO_SELECT_WORKER order.state == $models.order.state.NO_SELECT_WORKER
" "
class="btn"
@click.stop="cancelOrder"
:class="{ active: true }"
> >
<text>取消订单</text> <view class="btn" @click.stop="cancelOrder" :class="{ active: true }">
</view> <text>取消订单</text>
<view v-show="order.state == $models.order.state.NO_APPRAISE" class="btn" @click.stop="appraiseOrder"> </view>
<text>评价师傅</text> </block>
</view> <block v-if="order.state == $models.order.state.NO_APPRAISE">
<view v-show="order.state == $models.order.state.NO_SERVICE" class="btn" @click.stop="drawbackOrder"> <view class="btn" v-if="false" @click.stop="appraiseOrder">
<text>申请退款</text> <text>评价师傅</text>
</view> </view>
<view v-show="order.state == $models.order.state.ORDER_CLOSE" class="btn" @click.stop="reapplyOrder"> </block>
<text>重新申请</text> <block v-if="order.state == $models.order.state.NO_SERVICE">
</view> <view class="btn" v-if="false" @click.stop="drawbackOrder">
<view <text>申请退款</text>
v-show="order.state == $models.order.state.ORDER_CLOSE || order.state == $models.order.state.ALL_FINISH" </view>
class="del" </block>
@click.stop="delOrder" <block v-if="order.state == $models.order.state.ORDER_CLOSE">
> <view class="btn" v-if="false" @click.stop="reapplyOrder">
<text class="iconfont icon-shanchu"></text> <text>重新申请</text>
</view> </view>
</block>
<block v-if="order.state == $models.order.state.ORDER_CLOSE || order.state == $models.order.state.ALL_FINISH">
<view class="del" v-if="true" @click.stop="delOrder">
<text class="iconfont icon-shanchu"></text>
</view>
</block>
</view> </view>
</template> </template>

View File

@ -1,9 +1,9 @@
<template> <template>
<view class="count-modify" :class="[number > 0 ? 'between' : 'end']"> <view class="count-modify" :class="[number > 0 ? 'between' : 'end']">
<view v-show="number > 0" class="btn sub" @click="sub"> <view v-if="number > 0" class="btn sub" @click="sub">
<text class="iconfont icon-jianhao"></text> <text class="iconfont icon-jianhao"></text>
</view> </view>
<view v-show="number > 0" class="num">{{ number }}</view> <view v-if="number > 0" class="num">{{ number }}</view>
<view class="btn add" @click="add"> <view class="btn add" @click="add">
<text class="iconfont icon-jiahao-"></text> <text class="iconfont icon-jiahao-"></text>
</view> </view>

View File

@ -1,6 +1,6 @@
<template> <template>
<view class="loadmore"> <view class="loadmore">
<view class="text" v-show="!hasMore" @click="loadmore"> <view class="text" v-if="!hasMore" @click="loadmore">
<text>我已经到底了~</text> <text>我已经到底了~</text>
</view> </view>
</view> </view>

View File

@ -1,5 +1,5 @@
<template> <template>
<view class="modal-container" v-show="show"> <view class="modal-container" v-if="show">
<view class="modal-mask" @click="close"></view> <view class="modal-mask" @click="close"></view>
<view class="modal-content" :style="{ width: width }"> <view class="modal-content" :style="{ width: width }">
<view class="modal-title"> <view class="modal-title">

View File

@ -2,7 +2,7 @@
<view class="worker-item"> <view class="worker-item">
<view class="head"> <view class="head">
<image class="cover" :src="data.cover" mode="aspectFill" /> <image class="cover" :src="data.cover" mode="aspectFill" />
<text v-show="showPrice" class="price">¥ {{ data.price }}</text> <text v-if="showPrice" class="price">¥ {{ data.price }}</text>
</view> </view>
<view class="desc"> <view class="desc">
<view class="name"> <view class="name">

View File

@ -3,13 +3,13 @@
<view class="address-group"> <view class="address-group">
<view class="address-item" v-for="(item, index) in list" :key="index"> <view class="address-item" v-for="(item, index) in list" :key="index">
<view class="address-box" @click="selectAddress(item)" @longpress="deleteAddress(item.id, index)"> <view class="address-box" @click="selectAddress(item)" @longpress="deleteAddress(item.id, index)">
<view v-show="openType == 'choose'" class="checkbox"> <view v-if="openType == 'choose'" class="checkbox">
<widget-check-box :size="52" :checked="chooseAddressId == item.id" /> <widget-check-box :size="52" :checked="chooseAddressId == item.id" />
</view> </view>
<view class="item-box"> <view class="item-box">
<view class="address-text limit-line clamp-1"> <view class="address-text limit-line clamp-1">
<text v-show="item.isDefault" class="default-icon">默认</text> <text v-if="item.isDefault" class="default-icon">默认</text
<text class="text">{{ item.address }}</text> ><text class="text">{{ item.address }}</text>
</view> </view>
<view class="address-detail limit-line clamp-1"> <view class="address-detail limit-line clamp-1">
<text>{{ item.detail }}</text> <text>{{ item.detail }}</text>

View File

@ -11,7 +11,7 @@
<text class="text active">发布需求</text> <text class="text active">发布需求</text>
<text class="text normal"> 多位师傅报价/议价 选择师傅 师傅上门 </text> <text class="text normal"> 多位师傅报价/议价 选择师傅 师傅上门 </text>
</view> </view>
<view class="demand-container step-1" v-show="step == 1"> <view class="demand-container step-1" v-if="step == 1">
<view class="tips-container"> <view class="tips-container">
<widget-tips <widget-tips
backgroundColor="unset" backgroundColor="unset"
@ -94,7 +94,7 @@
<view class="btn" @click="toStep(2)">下一步</view> <view class="btn" @click="toStep(2)">下一步</view>
</view> </view>
</view> </view>
<view class="demand-container step-2" v-show="step == 2"> <view class="demand-container step-2" v-if="step == 2">
<view class="tips-container"> <view class="tips-container">
<widget-tips backgroundColor="unset" textColor="#FFA800" text="选择上门时间,请确保货物在该时间段之前到家" /> <widget-tips backgroundColor="unset" textColor="#FFA800" text="选择上门时间,请确保货物在该时间段之前到家" />
</view> </view>
@ -145,7 +145,7 @@
</view> </view>
</view> </view>
<view class="form-container ext-box"> <view class="form-container ext-box">
<view v-show="type == 2" class="custom-price"> <view v-if="type == 2" class="custom-price">
<view class="title-box"> <view class="title-box">
<text>需求价格</text> <text>需求价格</text>
<text class="desc"> 请勿填写过低价格避免无师傅接单 </text> <text class="desc"> 请勿填写过低价格避免无师傅接单 </text>
@ -162,10 +162,10 @@
</view> </view>
<view class="bottom-components" :style="{ bottom: config.safeAreaInsets.bottom + 'px' }"> <view class="bottom-components" :style="{ bottom: config.safeAreaInsets.bottom + 'px' }">
<text class="price">¥ {{ parsePrice(total) }}</text> <text class="price">¥ {{ parsePrice(total) }}</text>
<view v-show="type == 1" class="btn" @click="submit"> <view v-if="type == 1" class="btn" @click="submit">
<div class="text">立即发布</div> <div class="text">立即发布</div>
</view> </view>
<view v-show="type == 2" class="btn" @click="pay"> <view v-if="type == 2" class="btn" @click="pay">
<div class="text">去支付</div> <div class="text">去支付</div>
</view> </view>
</view> </view>

View File

@ -61,7 +61,7 @@
</view> </view>
</swiper-item> </swiper-item>
</swiper> </swiper>
<view class="bottom-components" v-show="tabIndex == 0" :style="{ bottom: config.safeAreaInsets.bottom + 'px' }"> <view class="bottom-components" v-if="tabIndex == 0" :style="{ bottom: config.safeAreaInsets.bottom + 'px' }">
<view class="price"> <view class="price">
<text class="text">¥306.00</text> <text class="text">¥306.00</text>
</view> </view>