index.wxml 2.4 KB

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