Commit d70138baba3050e30b2dec8c86284f361e1a6bc4
1 parent
ad77b609
会员中心优惠券显示条形码
Showing
3 changed files
with
15 additions
and
68 deletions
pages/user/coupons/coupons.js
pages/user/coupons/coupons.wxml
| ... | ... | @@ -166,13 +166,17 @@ |
| 166 | 166 | </block> |
| 167 | 167 | </view> |
| 168 | 168 | <view class="pdt20 c-fe0000"><text class="rmb fs80" wx:if="{{details[useIndex].isby != 1}}">{{filter.getNum(details[useIndex].Sum)}}</text></view> |
| 169 | - <!-- <img src="" alt="" class="img-qr"/> --> | |
| 169 | + <!-- 条形码 --> | |
| 170 | + <view class="bar-container"> | |
| 171 | + <canvas class="barcode" canvas-id="barcode"/> | |
| 172 | + <view class="pdt20 fs26" wx:if="{{details[useIndex].CashRepNo}}">{{details[useIndex].CashRepNo}}</view> | |
| 173 | + <view class="pdt20 fs26" wx:else>{{details[useIndex].no}}</view> | |
| 174 | + </view> | |
| 175 | + <!-- 二维码 --> | |
| 170 | 176 | <view class="qr-container"> |
| 171 | 177 | <canvas class="qrcode" canvas-id="qrcode"/> |
| 172 | 178 | </view> |
| 173 | - <view class="pdt20 pdb10 fs26" wx:if="{{details[useIndex].CashRepNo}}">{{details[useIndex].CashRepNo}}</view> | |
| 174 | - <view class="pdt20 pdb10 fs26" wx:else>{{details[useIndex].no}}</view> | |
| 175 | - <view class="pdv30 c-7b fs26 bdt"> | |
| 179 | + <view class="pdb30 c-7b fs26 bdt"> | |
| 176 | 180 | <text wx:if="{{details[useIndex].ValidDate}}" class="ellipsis-1x">有效期:{{details[useIndex].BeginDate==null ? " " : time.replace_time2(details[useIndex].BeginDate)}} 至 {{time.replace_time2(details[useIndex].ValidDate)}}</text> |
| 177 | 181 | <text wx:elif="{{details[useIndex].use_end_time}}" class="ellipsis-1x">有效期:{{details[useIndex].use_start_time==null ? " " : time.format_time(details[useIndex].use_start_time)}} 至 {{time.format_time(details[useIndex].use_end_time)}}</text> |
| 178 | 182 | <text wx:else>有效期:不限</text> |
| ... | ... | @@ -181,62 +185,5 @@ |
| 181 | 185 | </view> |
| 182 | 186 | |
| 183 | 187 | |
| 184 | -<!-- <block wx:for="{{details}}" wx:for-index="idx" wx:for-item="detail"> | |
| 185 | - | |
| 186 | - <block wx:if="{{detail.isby}}"> --> | |
| 187 | - <!-- 判断有没有数据有显示没有不显示 --> | |
| 188 | - <!-- <view class="data" data-cashrepno='{{detail.no}}' bindtap='click'> | |
| 189 | - <view class="code_rim"> | |
| 190 | - <canvas class="code" canvas-id="qrcode{{idx}}" /> | |
| 191 | - <view class="code_val">{{detail.no}}</view> | |
| 192 | - </view> | |
| 193 | - | |
| 194 | - <view class="moneys">包邮券</view> | |
| 195 | - <view class="car-rim"> | |
| 196 | - <view class="text">微券来源: 微信商城</view> | |
| 197 | - <view wx:if="{{detail.use_end_time!=null}}"> --> | |
| 198 | - <!-- 不指定格式则默认输出:yyyy-MM-dd hh:mm:ss 格式 --> | |
| 199 | - <!-- <view class="text">有效期: | |
| 200 | - {{detail.use_start_time==null?" " : time.format_time(detail.use_start_time)}} | |
| 201 | - 至 {{ time.format_time(detail.use_end_time)}}</view> | |
| 202 | - </view> | |
| 203 | - <view wx:else> | |
| 204 | - <view class="text">有效期: 不限</view> | |
| 205 | - </view> | |
| 206 | - <view class="textss">使用说明: 包邮券,全场通用,满 {{detail.condition}}元使用{{detail.title?",不包邮地区:"+detail.title:""}} | |
| 207 | - </view> | |
| 208 | - </view> | |
| 209 | - </view> | |
| 210 | - | |
| 211 | - | |
| 212 | - | |
| 213 | - </block> | |
| 214 | - <block wx:else> --> | |
| 215 | - <!-- 判断有没有数据有显示没有不显示 --> | |
| 216 | - <!-- <view class="data" data-cashrepno='{{detail.CashRepNo}}' bindtap='click'> | |
| 217 | - <view class="code_rim"> | |
| 218 | - <canvas class="code" canvas-id="qrcode{{idx}}" /> | |
| 219 | - <view class="code_val">{{detail.CashRepNo}}</view> | |
| 220 | - </view> | |
| 221 | - | |
| 222 | - <view class="moneys">{{filter.getNum(detail.Sum)}}元微券</view> | |
| 223 | - <view class="car-rim"> | |
| 224 | - <view class="text"> | |
| 225 | - 微券来源: {{detail.SendMan==null?'线下发放':detail.SendMan==''?"线下发放":detail.SendMan}}</view> | |
| 226 | - <view wx:if="{{detail.ValidDate!=null}}"> --> | |
| 227 | - <!-- 不指定格式则默认输出:yyyy-MM-dd hh:mm:ss 格式 --> | |
| 228 | - <!-- <view class="text">有效期: | |
| 229 | - {{detail.BeginDate==null?" " : time.replace_time2(detail.BeginDate)}} | |
| 230 | - 至 {{ time.replace_time2(detail.ValidDate)}}</view> | |
| 231 | - </view> | |
| 232 | - <view wx:else> | |
| 233 | - <view class="text">有效期: 不限</view> | |
| 234 | - </view> | |
| 235 | - <view wx:if="{{detail.Remark1}}" class="textss"> {{filter.getNum(detail.Sum)}}元优惠券,{{(detail.UseObjectID==null || detail.UseObjectID=='')?"全场通用":"仅限"+(detail.UseObjectName)+"使用"}},满 {{detail.BuySum==null || detail.BuySum==''?filter.getNum(0):filter.getNum(detail.BuySum)}}元使用 {{detail.region_list_name==null || detail.region_list_name==''?"":",不包邮地区:"+region_list_name}};{{detail.Remark}}</view> | |
| 236 | - <view wx:else class="textss">使用说明: {{filter.getNum(detail.Sum)}}元优惠券,{{(detail.UseObjectID==null || detail.UseObjectID=='')?"全场通用":"仅限"+(detail.UseObjectName)+"使用"}},满 {{detail.BuySum==null || detail.BuySum==''?filter.getNum(0):filter.getNum(detail.BuySum)}}元使用 {{detail.region_list_name==null || detail.region_list_name==''?"":",不包邮地区:"+region_list_name}} | |
| 237 | - </view> | |
| 238 | - </view> | |
| 239 | - </view> | |
| 240 | - </block> | |
| 241 | -</block> --> | |
| 188 | + | |
| 242 | 189 | ... | ... |
pages/user/coupons/coupons.wxss
| ... | ... | @@ -322,12 +322,12 @@ color:#999999; |
| 322 | 322 | font-family:'SimHei',Arial; |
| 323 | 323 | } |
| 324 | 324 | /* 点击条形 */ |
| 325 | +.bar-container { | |
| 326 | + padding: 20rpx; | |
| 327 | +} | |
| 325 | 328 | .barcode { |
| 326 | - height: 320rpx; | |
| 327 | - flex-direction: column; | |
| 328 | - justify-content: center; | |
| 329 | - align-items: center; | |
| 330 | - margin-left: 30rpx; | |
| 329 | + width: 100%; | |
| 330 | + height: 100rpx; | |
| 331 | 331 | } |
| 332 | 332 | /* 二维码边框*/ |
| 333 | 333 | .qrcode_rim { | ... | ... |