calculator.wxml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <!--mHome/pages/calculator/calculator.wxml-->
  2. <!-- 导航栏 -->
  3. <van-nav-bar custom-style="background-color: #E92020">
  4. <van-icon slot="left" name="arrow-left" size="25px" color="white" bind:click="backToParent"/>
  5. <text slot="title" style="color: white;">钻石价格计算器</text>
  6. </van-nav-bar>
  7. <view class="container" style="position: relative; height: {{windowHeight-safeBottom}}px;">
  8. <!-- 形状 -->
  9. <view class="cell-view zsshape" wx:if="{{active !== 2}}">
  10. <text>形状</text>
  11. <view class="content zsshape">
  12. <button wx:for="{{zsshapes}}" wx:for-item="itm" wx:for-index="idx" class="{{itm.isCheck ? 'active' : ''}}" id="zsshape {{itm.id}}" wx:key="id" bindtap="onButtonPressed">{{itm.name}}</button>
  13. </view>
  14. </view>
  15. <!-- 颜色 -->
  16. <view class="cell-view zscolor">
  17. <text>颜色</text>
  18. <view class="content zscolor">
  19. <button wx:for="{{zscolors}}" wx:for-item="itm" wx:for-index="idx" wx:key="id" class="{{itm.isCheck ? 'active' : ''}}" id="zscolor {{itm.id}}" bindtap="onButtonPressed">{{itm.name}}</button>
  20. </view>
  21. </view>
  22. <!-- 净度 -->
  23. <view class="cell-view zsclarity">
  24. <text>净度</text>
  25. <view class="content zsclarity">
  26. <button wx:for="{{zsclaritys}}" wx:for-item="itm" wx:for-index="idx" wx:key="id" class="{{itm.isCheck ? 'active' : ''}}" id="zsclarity {{itm.id}}" bindtap="onButtonPressed">{{itm.name}}</button>
  27. </view>
  28. </view>
  29. <!-- 重量 -->
  30. <view class="cell-view weight">
  31. <text>重量</text>
  32. <view class="content weight">
  33. <van-field model:value="{{ weight }}" clearable placeholder="请输入重量" type="number" border="{{ false }}"/>
  34. </view>
  35. </view>
  36. <!-- 汇率 -->
  37. <view class="cell-view rate">
  38. <text>汇率</text>
  39. <view class="content rate">
  40. <van-field model:value="{{ dayrate }}" clearable placeholder="请输入汇率" type="number" border="{{ false }}"/>
  41. </view>
  42. </view>
  43. <!-- 折扣 -->
  44. <view class="cell-view discount">
  45. <text>折扣</text>
  46. <view class="content discount">
  47. <van-field model:value="{{ discount }}" clearable placeholder="请输入折扣" type="number" border="{{ false }}"/>
  48. </view>
  49. </view>
  50. <!-- 底部视图 -->
  51. <view class="buttom_view">
  52. <button bindtap="onButtonPressed" id="calculate">计算</button>
  53. </view>
  54. <!-- result -->
  55. <view class="cell-view result">
  56. <view class="content result">
  57. <text>{{result}}</text>
  58. </view>
  59. </view>
  60. </view>
  61. <!-- toast -->
  62. <van-toast id="van-toast" />