transfer.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. <template>
  2. <view :class="[AppTheme]" id="withdraw" class="all_box">
  3. <view class="block">
  4. <view class="zh">充值金额</view>
  5. <view class="money">
  6. <u--input placeholder="请输入充值金额" fontSize="25" color="#000000" prefixIcon="rmb" v-model="money"
  7. border="bottom" prefixIconStyle="font-size: 20px;color: #909399"></u--input>
  8. </view>
  9. </view>
  10. <view class="tx">
  11. <view class="title">最多上传3张证明汇款成功</view>
  12. <upload @upload="upload" @delteFile="delteFile" :limitnumber="limitnumber" :fileList2="fileList"></upload>
  13. </view>
  14. <view class="save">
  15. <view class="uni-list">
  16. <checkbox-group @change="checkboxChange">
  17. <label class="uni-list-cell uni-list-cell-pd" v-for="item in items" :key="item.value">
  18. <view class="ml36">
  19. <checkbox :value="item.value" :color='primary' :checked="item.checked" />
  20. </view>
  21. <view>{{ item.name }}</view>
  22. </label>
  23. </checkbox-group>
  24. </view>
  25. </view>
  26. <view class="save1 bg-linear-gradient" @click="doSve">提交</view>
  27. </view>
  28. </template>
  29. <script>
  30. import txApi from '@/api/wall/index.js';
  31. import upload from '@/pagesA/components/upload/pretty-uploadFile.vue';
  32. export default {
  33. name: 'Transfer',
  34. data() {
  35. return {
  36. primary:this.$theme.primary,
  37. settingFile:getApp().globalData.siteinfo,
  38. money: 0,
  39. imgList: [],
  40. items: [{
  41. value: 'CN',
  42. name: '确认信息无误'
  43. }],
  44. limitnumber: 3,
  45. fileList:''
  46. };
  47. },
  48. components: {
  49. upload
  50. },
  51. methods: {
  52. checkboxChange: function(e) {
  53. var items = this.items,
  54. values = e.detail.value;
  55. for (var i = 0, lenI = items.length; i < lenI; ++i) {
  56. const item = items[i];
  57. if (values.includes(item.value)) {
  58. this.$set(item, 'checked', true);
  59. } else {
  60. this.$set(item, 'checked', false);
  61. }
  62. }
  63. },
  64. upload(base64) {
  65. if (this.imgList.length < 3) {
  66. txApi.uptransfershot({
  67. img: base64
  68. }).then(res => {
  69. console.log(JSON.stringify(res))
  70. if (res.status == 200) {
  71. this.imgList.push(res.data.path);
  72. }
  73. });
  74. } else {
  75. this.$api.msg('最多上传3张证明');
  76. }
  77. },
  78. delteFile(i) {
  79. this.imgList.splice(i, 1);
  80. console.log(this.imgList);
  81. },
  82. doSve() {
  83. this.$u.throttle(() => {
  84. if (this.imgList.length == 0) {
  85. this.$api.msg('请上传凭证');
  86. return;
  87. }
  88. let thumb_shot = [];
  89. thumb_shot = this.imgList.join(',');
  90. if (!this.items[0].checked) {
  91. this.$api.msg('请勾选信息无误');
  92. return;
  93. }
  94. if (this.money == 0) {
  95. this.$api.msg('金额不能为0');
  96. return;
  97. } else if (isNaN(this.money)) {
  98. this.$api.msg('请填写正确的充值金额');
  99. return;
  100. }
  101. txApi.maketransferorder({
  102. thumb_shot: thumb_shot,
  103. money: this.money
  104. }).then(res => {
  105. if (res.status == 200) {
  106. this.$api.msg(res.msg);
  107. setTimeout(() => {
  108. uni.navigateTo({
  109. url: '/pagesA/pages/mypurse/index'
  110. });
  111. }, 1000);
  112. } else {
  113. this.$api.msg(res.msg);
  114. }
  115. });
  116. });
  117. }
  118. }
  119. };
  120. </script>
  121. <style lang="scss">
  122. page {
  123. background-color: #f2f2f2;
  124. }
  125. #withdraw {
  126. width: 100%;
  127. background-color: #ffffff;
  128. .block {
  129. .zh {
  130. padding: 20rpx;
  131. font-size: 30rpx;
  132. font-family: PingFang SC;
  133. font-weight: bold;
  134. color: #333333;
  135. }
  136. .money {
  137. display: flex;
  138. font-size: 50rpx;
  139. font-family: PingFang SC;
  140. font-weight: bold;
  141. align-items: center;
  142. color: #000000;
  143. margin-bottom: 30rpx;
  144. padding: 20rpx;
  145. input {
  146. margin-left: 5rpx;
  147. font-size: 52rpx;
  148. font-family: PingFang SC;
  149. color: #ff1f1f;
  150. }
  151. }
  152. }
  153. .tx {
  154. width: 100%;
  155. background-color: #ffffff;
  156. padding-bottom: 35rpx;
  157. .title {
  158. font-size: 30rpx;
  159. font-family: PingFang SC;
  160. font-weight: bold;
  161. color: #333333;
  162. padding: 20rpx;
  163. }
  164. }
  165. .btn {
  166. width: 100%;
  167. height: 210rpx;
  168. display: flex;
  169. justify-content: center;
  170. align-items: center;
  171. background-color: #ffffff;
  172. border-top: 20rpx solid #f2f2f2;
  173. .save {
  174. margin: 0 auto;
  175. width: 582rpx;
  176. height: 90rpx;
  177. font-size: 32rpx;
  178. font-family: PingFang SC;
  179. font-weight: 800;
  180. color: #ffffff;
  181. text-align: center;
  182. line-height: 90rpx;
  183. color: #ffffff;
  184. background: #fe5828;
  185. border-radius: 45rpx;
  186. }
  187. }
  188. .save {
  189. background-color: #ffffff;
  190. }
  191. .save1 {
  192. margin: 50rpx auto;
  193. width: 582rpx;
  194. height: 90rpx;
  195. font-size: 32rpx;
  196. font-family: PingFang SC;
  197. font-weight: 800;
  198. color: #ffffff;
  199. text-align: center;
  200. line-height: 90rpx;
  201. color: #ffffff;
  202. // background: $tab-color;
  203. border-radius: 45rpx;
  204. }
  205. .uni-list-cell.uni-list-cell-pd {
  206. display: flex;
  207. align-items: center;
  208. .ml36 {
  209. margin-left: 36rpx;
  210. }
  211. }
  212. }
  213. </style>