index.wxml 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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" adjust-position />
  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="digit" adjust-position adjust-position />
  40. </view>
  41. </view>
  42. <!-- 折扣 -->
  43. <view class="cell-view discount">
  44. <text>折扣</text>
  45. <view class="content discount">
  46. <!-- 折扣选项 -->
  47. <van-dropdown-menu>
  48. <van-dropdown-item model:value="{{ value }}" options="{{ options }}" />
  49. </van-dropdown-menu>
  50. <!-- 输入框 -->
  51. <van-field model:value="{{ discount }}" clearable placeholder="请输入折扣" type="digit" adjust-position />
  52. </view>
  53. </view>
  54. <!-- result -->
  55. <view class="result">
  56. <view class="result__top">
  57. <text class="value">国际报价:${{ doller }}/ct </text>
  58. <text class="value">¥{{ rmb }}/ct</text>
  59. </view>
  60. <text class="value">美元:{{ disdoller }}</text>
  61. <text class="value">人民币:{{ disrmb }}</text>
  62. </view>
  63. <!-- 底部视图 -->
  64. <view class="buttom_view">
  65. <van-button bind:click="onButtonPressed" block color="linear-gradient(to right, #4bb0ff, #666)" round id="calculate">计算</van-button>
  66. </view>
  67. </view>
  68. <!-- toast -->
  69. <van-toast id="van-toast" />