preference.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <template>
  2. <uni-popup ref="popupRef" type="bottom">
  3. <view class="popups-box">
  4. <view class="popups-title">
  5. 偏好设置-合约设置
  6. <text class="close-icon iconfont" @click.stop="close()">&#xeca0;</text>
  7. </view>
  8. <view class="set-hint">
  9. <text class="iconfont">&#xe8ec;</text>
  10. <text>开启订单确认功能后,每次提交订单</text>
  11. </view>
  12. <view class="set-list">
  13. <view class="set-item">
  14. <text class="set-item-text">限价下单二次确认</text>
  15. <u-switch :size="40" v-model="value1" activeColor="#05C175"></u-switch>
  16. </view>
  17. <view class="set-item">
  18. <text class="set-item-text">市价下单二次确认</text>
  19. <u-switch :size="40" v-model="value2" activeColor="#05C175"></u-switch>
  20. </view>
  21. </view>
  22. </view>
  23. </uni-popup>
  24. </template>
  25. <script>
  26. import {
  27. mapGetters
  28. } from 'vuex'
  29. export default {
  30. name: "contract-set",
  31. data() {
  32. return {
  33. contractTop: 0,
  34. value1:'',
  35. value2:''
  36. };
  37. },
  38. computed: {
  39. ...mapGetters([
  40. "navBarHeight"
  41. ])
  42. },
  43. watch: {
  44. navBarHeight: {
  45. handler(newH) {
  46. this.contractTop = newH + uni.upx2px(78)
  47. },
  48. immediate: true
  49. }
  50. },
  51. mounted() {
  52. // this.$refs.popupRef.open()
  53. // this.open()
  54. },
  55. methods: {
  56. open(val) {
  57. this.$nextTick(() => {
  58. this.$refs.popupRef.open();
  59. })
  60. },
  61. close() {
  62. this.$refs.popupRef.close()
  63. },
  64. setInfo(type) {
  65. this.close();
  66. this.$emit('confirm', type)
  67. }
  68. }
  69. }
  70. </script>
  71. <style lang="scss" scoped>
  72. .popups-box {
  73. width: 100%;
  74. background-color: #fff;
  75. border-radius: 40rpx 40rpx 0 0;
  76. .popups-title {
  77. text-align: center;
  78. width: 100%;
  79. height: 100rpx;
  80. line-height: 100rpx;
  81. position: relative;
  82. font-size: 32rpx;
  83. font-weight: bold;
  84. border-radius: 40rpx 40rpx 0 0;
  85. .close-icon {
  86. position: absolute;
  87. right: 30rpx;
  88. top: 50%;
  89. transform: translateY(-50%);
  90. }
  91. }
  92. }
  93. .set-hint{
  94. width: 100%;
  95. padding: 30rpx $pages-padding;
  96. font-size: 24rpx;
  97. color: $Theme-Color;
  98. display: flex;
  99. align-items: center;
  100. .iconfont{
  101. margin-right: 10rpx;
  102. }
  103. }
  104. // <view class="set-item">
  105. // <text class="set-item-text">限价下单二次确认</text>
  106. // <u-switch :size="$createElement(0)"></u-switch>
  107. // </view>
  108. .set-list{
  109. width: 100%;
  110. padding: 0 $pages-padding;
  111. }
  112. .set-item{
  113. display: flex;
  114. justify-content: space-between;
  115. align-items: center;
  116. padding: 40rpx 0;
  117. //
  118. .set-item-text{
  119. font-size: 28rpx;
  120. }
  121. }
  122. </style>