app-cash-model.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. <template>
  2. <view>
  3. <app-model v-model="display" type="3">
  4. <view slot="title">{{title}}</view>
  5. <view slot="content">
  6. <view class="dir-top-nowrap">
  7. <view class="cash-type-item dir-left-nowrap cross-center" v-if="isAuto">
  8. <image class="icon" src="/static/image/icon/cash/icon-auto.png"></image>
  9. <view class="dir-left-nowrap box-grow-1 cash-type-box cross-center"
  10. @click="payTypeChange(`auto`)">
  11. <!-- #ifdef MP-WEIXIN -->
  12. <view class="box-grow-1 cross-center">微信零钱</view>
  13. <!-- #endif -->
  14. <!-- #ifdef MP-ALIPAY -->
  15. <view class="box-grow-1 cross-center">支付宝余额</view>
  16. <!-- #endif -->
  17. <!-- #ifndef MP-WEIXIN || MP-ALIPAY -->
  18. <view class="box-grow-1 cross-center">自动</view>
  19. <!-- #endif -->
  20. <view class="cross-center">
  21. <view v-if="payType === `auto`" class="radio-single-active"></view>
  22. <view v-else class="radio-single"></view>
  23. </view>
  24. </view>
  25. </view>
  26. <view class="cash-type-item dir-left-nowrap cross-center" v-if="isWx">
  27. <image class="icon" src="/static/image/icon/cash/icon-wechat.png"></image>
  28. <view class="dir-left-nowrap cross-center box-grow-1 cash-type-box"
  29. @click="payTypeChange(`wx`)">
  30. <view class="box-grow-1">微信线下打款</view>
  31. <view class="box-grow-0">
  32. <view v-if="payType === `wx`" class="radio-single-active"></view>
  33. <view v-else class="radio-single"></view>
  34. </view>
  35. </view>
  36. </view>
  37. <view class="cash-type-item dir-left-nowrap cross-center" v-if="isAlipay">
  38. <image class="icon" src="/static/image/icon/cash/icon-alipay.png"></image>
  39. <view class="dir-left-nowrap cross-center box-grow-1 cash-type-box"
  40. @click="payTypeChange(`alipay`)">
  41. <view class="box-grow-1">支付宝线下打款</view>
  42. <view class="box-grow-0">
  43. <view v-if="payType === `alipay`" class="radio-single-active"></view>
  44. <view v-else class="radio-single"></view>
  45. </view>
  46. </view>
  47. </view>
  48. <view class="cash-type-item dir-left-nowrap cross-center" v-if="isBank">
  49. <image class="icon" src="/static/image/icon/cash/icon-bank.png"></image>
  50. <view class="dir-left-nowrap cross-center box-grow-1 cash-type-box"
  51. @click="payTypeChange(`bank`)">
  52. <view class="box-grow-1">银联线下打款</view>
  53. <view class="box-grow-0">
  54. <view v-if="payType === `bank`" class="radio-single-active"></view>
  55. <view v-else class="radio-single"></view>
  56. </view>
  57. </view>
  58. </view>
  59. <view class="cash-type-item dir-left-nowrap cross-center" v-if="isBalance">
  60. <image class="icon" src="/static/image/icon/cash/icon-balance.png"></image>
  61. <view class="dir-left-nowrap cross-center box-grow-1 cash-type-box"
  62. @click="payTypeChange(`balance`)">
  63. <view class="box-grow-1">商城余额</view>
  64. <view class="box-grow-0">
  65. <view v-if="payType === `balance`" class="radio-single-active"></view>
  66. <view v-else class="radio-single"></view>
  67. </view>
  68. </view>
  69. </view>
  70. </view>
  71. </view>
  72. </app-model>
  73. </view>
  74. </template>
  75. <script>
  76. import appModel from '../../basic-component/app-model/app-model.vue';
  77. export default {
  78. name: "app-cash-model",
  79. components: {appModel},
  80. props: {
  81. title: {
  82. type: String,
  83. default() {
  84. return '提现方式';
  85. }
  86. },
  87. payType: String,
  88. /* balance bank alipay wx auto*/
  89. isAuto: {
  90. type: Boolean,
  91. default() {
  92. return false
  93. }
  94. },
  95. isWx: {
  96. type: Boolean,
  97. default() {
  98. return false
  99. }
  100. },
  101. isAlipay: {
  102. type: Boolean,
  103. default() {
  104. return false
  105. }
  106. },
  107. isBank: {
  108. type: Boolean,
  109. default() {
  110. return false
  111. }
  112. },
  113. isBalance: {
  114. type: Boolean,
  115. default() {
  116. return false
  117. }
  118. },
  119. value: {
  120. type: Boolean,
  121. default() {
  122. return false
  123. }
  124. },
  125. },
  126. data() {
  127. return {
  128. display: this.value
  129. }
  130. },
  131. watch: {
  132. value: function (value) {
  133. this.display = value;
  134. },
  135. display: function (value) {
  136. this.$emit('input', value);
  137. }
  138. },
  139. computed: {},
  140. methods: {
  141. payTypeChange(pay_type) {
  142. // this.payType = pay_type;
  143. this.$emit('change', pay_type);
  144. this.display = false;
  145. },
  146. }
  147. }
  148. </script>
  149. <style scoped lang="scss">
  150. .cash-type-item {
  151. height: #{120rpx};
  152. padding-left: #{32rpx};
  153. > view {
  154. height: 100%;
  155. }
  156. .cash-type-box {
  157. border-bottom: 1px solid #E2E2E2;
  158. padding-right: #{32rpx};
  159. .radio-single {
  160. width: #{40rpx};
  161. height: #{40rpx};
  162. border-radius: 50%;
  163. background-color: white;
  164. border: #{1rpx} solid #e2e2e2;
  165. }
  166. .radio-single-active {
  167. width: #{40rpx};
  168. height: #{40rpx};
  169. border-radius: 50%;
  170. background-repeat: repeat;
  171. background-size: 100% 100%;
  172. background-image: url("../../../static/image/icon/icon-checkbox-checked-a.png");
  173. }
  174. }
  175. .icon {
  176. height: #{40rpx};
  177. width: #{40rpx};
  178. margin-right: #{16rpx};
  179. display: flex;
  180. justify-content: center;
  181. }
  182. }
  183. </style>