index.wxml 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <!--index.wxml-->
  2. <scroll-view class="scrollarea" scroll-y="{{popupShow ? false : true}}" type="list" bindscroll="onScroll" enable-passive="true">
  3. <view class="container">
  4. <view class="goodsSection">
  5. <view class="goodsIntro">
  6. <view class="images">
  7. <block wx:for="{{goodsImgList}}" wx:key="index">
  8. <image mode="widthFix" bind:tap="onPreivewGoodsImg" data-src="{{item}}" src="{{item}}"></image>
  9. </block>
  10. </view>
  11. </view>
  12. </view>
  13. <view class="bottom-sectionBox" style="top: {{top}}px; right: 10px;" bind:touchstart="onTouchStart" catch:touchmove="onTouchMove" bind:touchend="onTouchEnd">
  14. <view class="orders" bind:tap="onOrder"></view>
  15. <view class="btnSection" bind:tap="onBuyShop"></view>
  16. </view>
  17. <view class="popup-section" wx:if="{{popupShow}}">
  18. <view class="popup-mask" bind:tap="onClose"></view>
  19. <view class="popup-container">
  20. <image bind:tap="onClose" src="./images/icon-close.png" class="iconClose"></image>
  21. <view class="product-section">
  22. <view class="product-img">
  23. <image bind:tap="onPreivewGoods" data-src="{{ selected.pic }}" src="{{ selected.pic }}"></image>
  24. </view>
  25. <view class="product-left">
  26. <view class="price-s">
  27. <image wx:if="{{selected.originalPrice + (selectedInstruments.originalPrice || 0) - (selected.salePrice + (selectedInstruments.salePrice || 0)) > 0}}" class="priceImg" src="./images/yhj.png" />
  28. <view class="currentPrice">
  29. <text class="stuff">¥ </text>
  30. <numberDisplay number="{{ selected.salePrice + (selectedInstruments.salePrice || 0) }}" />
  31. <text wx:if="{{selected.originalPrice + (selectedInstruments.originalPrice || 0) - (selected.salePrice + (selectedInstruments.salePrice || 0)) > 0}}" class="originPrice">¥{{ my.formatValue(selected.originalPrice + (selectedInstruments.originalPrice || 0)) }}</text>
  32. </view>
  33. </view>
  34. <view class="current-s">
  35. 当前选中:{{ selected.typeName + (selectedInstruments.name?"+"+selectedInstruments.name:"")}}
  36. </view>
  37. <view wx:if="{{selected.originalPrice + (selectedInstruments.originalPrice || 0) - (selected.salePrice + (selectedInstruments.salePrice || 0)) > 0}}" class="discountCon">已优惠 ¥{{my.formatValue(selected.originalPrice + (selectedInstruments.originalPrice || 0) - (selected.salePrice + (selectedInstruments.salePrice || 0)))}}</view>
  38. </view>
  39. </view>
  40. <view class="memberBox {{isShowMemberInfoTip?'showMemberInfoTip':''}}">
  41. <view wx:if="{{ !memberInfo.id }}" class="memberCon" bind:tap="onMemberInfo">
  42. <image class="memberImg" src="./images/member.png"></image>
  43. <text class="info">请填写会员信息</text>
  44. <image class="chevronImg" src="./images/chevron.png"></image>
  45. </view>
  46. <view wx:else class="memberCon" bind:tap="onMemberInfo">
  47. <view class="memberInfoCon">
  48. <view class="infoCon">
  49. <image class="tip" src="./images/member.png" />
  50. <text class="name">{{memberInfo.name}}</text>
  51. <text class="phone">{{memberInfo.phone}}</text>
  52. </view>
  53. <view class="schoolInfoCon">
  54. <text class="schoolInfo">学校信息</text><text class="schoolInfoDes">{{memberInfo.schoolInfo}}</text>
  55. </view>
  56. </view>
  57. <image class="chevronImg" src="./images/chevron.png"></image>
  58. </view>
  59. </view>
  60. <view class="goodsInfo">
  61. <view class="desc"><text>*</text>会员卡类型</view>
  62. <view class="goodsList">
  63. <view wx:for="{{ list }}" wx:key="index" class="goodsItem {{ item.id == selected.id ? 'selected' : '' }} {{ item.stockNum <= 0 ? 'nosale' : '' }}" bind:tap="onSelectGoods" data-id="{{ item.id }}">
  64. <text class="name">{{ item.typeName }}</text>
  65. <image class="iconSale" wx:if="{{ item.stockNum <= 0 }}" src="./images/nosale.png"></image>
  66. </view>
  67. </view>
  68. <view wx:if="{{ instrumentsList.length > 0 }}" class="desc">乐器套装</view>
  69. <view wx:if="{{ instrumentsList.length > 0 }}" class="goodsList instrumentsList">
  70. <view wx:for="{{ instrumentsList }}" wx:key="index" class="goodsItem instrumentsGoodsItem {{ item.id == selectedInstruments.id ? 'selected' : '' }}" bind:tap="onSelectInstrumentsGoods" data-index="{{ index }}">
  71. <text class="name">{{ item.name }}</text>
  72. <view></view>
  73. <text>{{ "¥" + my.formatValue(item.salePrice) }}</text>
  74. </view>
  75. </view>
  76. </view>
  77. <view class="btnSections"><button type="primary" disabled="{{ isOverSaled }}" bind:tap="onSubmit">立即购买</button></view>
  78. </view>
  79. </view>
  80. <!-- <view class="showMoreContainer {{ !isShowOperation ? '' : 'hide' }}">
  81. <image src="./images/icon-up-scroll.png" class="iconUpScroll" />
  82. </view> -->
  83. </view>
  84. <!-- 客服 -->
  85. <!-- <service wx:if="{{serviceShow}}"></service> -->
  86. </scroll-view>
  87. <wxs module="my">
  88. var formatValue = function (value) {
  89. return parseFloat(value).toFixed(2);
  90. }
  91. module.exports = {
  92. formatValue: formatValue
  93. }
  94. </wxs>