app-cash-model.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  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" :class="theme + '-m-back ' + theme"></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" :class="theme + '-m-back ' + theme"></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" :class="theme + '-m-back ' + theme"></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" :class="theme + '-m-back ' + theme"></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" :class="theme + '-m-back ' + theme"></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. theme: {
  126. type: String,
  127. default() {
  128. return 'a'
  129. }
  130. }
  131. },
  132. data() {
  133. return {
  134. display: this.value
  135. }
  136. },
  137. watch: {
  138. value: function (value) {
  139. this.display = value;
  140. },
  141. display: function (value) {
  142. this.$emit('input', value);
  143. }
  144. },
  145. computed: {},
  146. methods: {
  147. payTypeChange(pay_type) {
  148. // this.payType = pay_type;
  149. this.$emit('change', pay_type);
  150. this.display = false;
  151. },
  152. }
  153. }
  154. </script>
  155. <style scoped lang="scss">
  156. .cash-type-item {
  157. height: #{120rpx};
  158. padding-left: #{32rpx};
  159. > view {
  160. height: 100%;
  161. }
  162. .cash-type-box {
  163. border-bottom: 1px solid #E2E2E2;
  164. padding-right: #{32rpx};
  165. .radio-single {
  166. width: #{40rpx};
  167. height: #{40rpx};
  168. border-radius: 50%;
  169. background-color: white;
  170. border: #{1rpx} solid #e2e2e2;
  171. }
  172. .radio-single-active {
  173. width: #{40rpx};
  174. height: #{40rpx};
  175. border-radius: 50%;
  176. background-repeat: repeat;
  177. background-size: 100% 100%;
  178. background-image: url("../../../static/image/icon/yes-radio.png");
  179. }
  180. }
  181. .icon {
  182. height: #{40rpx};
  183. width: #{40rpx};
  184. margin-right: #{16rpx};
  185. display: flex;
  186. justify-content: center;
  187. }
  188. }
  189. </style>