index.wxml 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <view class="container" style="position: relative; height: {{ windowHeight-safeBottom }}px;">
  2. <view class="top-view" style="position: sticky; top: 0; z-index: 999;">
  3. <!-- 导航栏 -->
  4. <van-nav-bar custom-style="background-color: #407DB8">
  5. <van-icon slot="left" name="arrow-left" size="25px" color="#fff" bind:click="backToParent"/>
  6. <text slot="title" style="color: #fff;">钻石价格计算器</text>
  7. </van-nav-bar>
  8. </view>
  9. <!-- 形状 -->
  10. <view class="cell-view zsshape" wx:if="{{ active !== 2 }}">
  11. <text>形状</text>
  12. <view class="content zsshape">
  13. <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>
  14. </view>
  15. </view>
  16. <!-- 颜色 -->
  17. <view class="cell-view zscolor">
  18. <text>颜色</text>
  19. <view class="content zscolor">
  20. <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>
  21. </view>
  22. </view>
  23. <!-- 净度 -->
  24. <view class="cell-view zsclarity">
  25. <text>净度</text>
  26. <view class="content zsclarity">
  27. <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>
  28. </view>
  29. </view>
  30. <!-- 重量 -->
  31. <view class="cell-view weight">
  32. <text>重量</text>
  33. <view class="content weight">
  34. <van-field model:value="{{ weight }}" clearable placeholder="请输入重量" type="number" adjust-position />
  35. </view>
  36. </view>
  37. <!-- 汇率 -->
  38. <view class="cell-view rate">
  39. <text>汇率</text>
  40. <view class="content rate">
  41. <van-field model:value="{{ dayrate }}" clearable placeholder="请输入汇率" type="digit" adjust-position adjust-position />
  42. </view>
  43. </view>
  44. <!-- 折扣 -->
  45. <view class="cell-view discount">
  46. <text>折扣</text>
  47. <view class="content discount">
  48. <!-- 折扣选项 -->
  49. <van-dropdown-menu>
  50. <van-dropdown-item model:value="{{ value }}" options="{{ options }}" />
  51. </van-dropdown-menu>
  52. <!-- 输入框 -->
  53. <van-field model:value="{{ discount }}" clearable placeholder="请输入折扣" type="digit" adjust-position />
  54. </view>
  55. </view>
  56. <!-- result -->
  57. <view class="result">
  58. <view class="result__top">
  59. <text class="value">国际报价:${{ doller }}/ct </text>
  60. <text class="value">¥{{ rmb }}/ct</text>
  61. </view>
  62. <text class="value">美元:{{ disdoller }}</text>
  63. <text class="value">人民币:{{ disrmb }}</text>
  64. </view>
  65. <!-- 底部视图 -->
  66. <view class="buttom_view">
  67. <van-button bind:click="onButtonPressed" block color="linear-gradient(to right, #4bb0ff, #666)" round id="calculate">计算</van-button>
  68. </view>
  69. </view>
  70. <!-- toast -->
  71. <van-toast id="van-toast" />