index.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. <template>
  2. <view class="container">
  3. <view class="money">
  4. <text class="title">账户余额</text>
  5. <text class="cash">
  6. <text class="cash_tag">¥</text>
  7. <text class="cash_num">{{ info.money }}</text>
  8. </text>
  9. <!-- 小圆圈 -->
  10. <view class="square"></view>
  11. </view>
  12. <!-- 弧度背景 -->
  13. <image class="bg" src="/static/statics/img/user/bg.png"></image>
  14. <!-- 提现金额 -->
  15. <view class="recharge_wrap">
  16. <view class="recharge_title">提现金额</view>
  17. <van-field :value="money" placeholder="请输入提现金额" :border="false" class="field" @input="getChargeMoney" />
  18. </view>
  19. <!-- 充值 -->
  20. <view class="actions">
  21. <view class="logout" @tap="nextFun">立即提现</view>
  22. </view>
  23. </view>
  24. </template>
  25. <script>
  26. let myPro = require('../../../utils/wxRequest.js');
  27. let util = require('../../../utils/util.js');
  28. export default {
  29. data() {
  30. return {
  31. imgUrl: getApp().globalData.imgUrl,
  32. info: null,
  33. money: null
  34. };
  35. }
  36. /**
  37. * 生命周期函数--监听页面加载
  38. */,
  39. onLoad: function (options) {},
  40. /**
  41. * 生命周期函数--监听页面初次渲染完成
  42. */
  43. onReady: function () {},
  44. /**
  45. * 生命周期函数--监听页面显示
  46. */
  47. onShow: function () {
  48. let that = this;
  49. that.getShopInfo();
  50. },
  51. /**
  52. * 生命周期函数--监听页面隐藏
  53. */
  54. onHide: function () {},
  55. /**
  56. * 生命周期函数--监听页面卸载
  57. */
  58. onUnload: function () {},
  59. /**
  60. * 页面相关事件处理函数--监听用户下拉动作
  61. */
  62. onPullDownRefresh: function () {},
  63. /**
  64. * 页面上拉触底事件的处理函数
  65. */
  66. onReachBottom: function () {},
  67. methods: {
  68. /**
  69. * 用户点击右上角分享
  70. */
  71. // 获取个人信息
  72. getShopInfo() {
  73. let that = this;
  74. myPro
  75. .wxRequest('store/info', 'GET', {})
  76. .then((res) => {
  77. that.setData({
  78. info: res.result
  79. });
  80. })
  81. .catch((err) => {
  82. console.log('报错信息', err);
  83. uni.showToast({
  84. title: err,
  85. icon: 'none'
  86. });
  87. });
  88. },
  89. // 获取输入金额
  90. getChargeMoney(event) {
  91. // console.log(event)
  92. let that = this;
  93. that.setData({
  94. money: event.detail
  95. });
  96. },
  97. // 提现
  98. nextFun() {
  99. let that = this;
  100. if (!that.money) {
  101. uni.showToast({
  102. title: '请输入提现金额',
  103. icon: 'none'
  104. });
  105. return;
  106. }
  107. let params = {
  108. money: parseFloat(that.money)
  109. };
  110. myPro
  111. .wxRequest('store/tx/apply', 'POST', params)
  112. .then((res) => {
  113. uni.showToast({
  114. title: res.msg,
  115. icon: 'none'
  116. });
  117. that.goCashOutLog();
  118. })
  119. .catch((err) => {
  120. console.log('报错信息', err);
  121. uni.showToast({
  122. title: err,
  123. icon: 'none'
  124. });
  125. });
  126. },
  127. // 进入提现列表
  128. goCashOutLog() {
  129. uni.navigateTo({
  130. url: '/pages/shopRole/cashoutlog/index?status=0'
  131. });
  132. }
  133. }
  134. };
  135. </script>
  136. <style>
  137. /* pages/recharge/index.wxss */
  138. /* 余额 */
  139. .money {
  140. /* padding-top: 72rpx;
  141. text-align: center; */
  142. width: 100vw;
  143. height: 154rpx;
  144. background: #295c56;
  145. position: relative;
  146. text-align: center;
  147. color: #ffffff;
  148. }
  149. .money .title {
  150. font-size: 26rpx;
  151. /* color:rgba(51,51,51,1); */
  152. }
  153. .cash {
  154. padding-left: 20rpx;
  155. font-size: 48rpx;
  156. /* color:rgba(213,76,67,1); */
  157. }
  158. .cash .cash_tag {
  159. font-size: 30rpx;
  160. }
  161. .cash .cash_num {
  162. padding-left: 4rpx;
  163. }
  164. /* 下一步 */
  165. .actions {
  166. /* position: fixed;
  167. bottom: 48rpx;
  168. width: 100vw; */
  169. width: 100vw;
  170. }
  171. .actions .logout {
  172. width: 690rpx;
  173. height: 90rpx;
  174. background: #295c56;
  175. border-radius: 45rpx;
  176. margin: 0 auto;
  177. font-size: 34rpx;
  178. color: #ffffff;
  179. text-align: center;
  180. line-height: 90rpx;
  181. }
  182. /* 背景上的弧度 */
  183. .bg {
  184. width: 750rpx;
  185. height: 34rpx;
  186. display: block;
  187. }
  188. .square {
  189. content: '';
  190. display: block;
  191. width: 26rpx;
  192. height: 26rpx;
  193. background: rgba(255, 255, 255, 1);
  194. opacity: 0.1;
  195. border-radius: 50%;
  196. position: absolute;
  197. bottom: 120rpx;
  198. right: 120rpx;
  199. }
  200. /* 提现 */
  201. .recharge_wrap {
  202. width: 690rpx;
  203. background: rgba(255, 255, 255, 1);
  204. box-shadow: 0rpx 0rpx 21rpx 0rpx rgba(0, 0, 0, 0.09);
  205. border-radius: 10rpx;
  206. position: relative;
  207. left: 50%;
  208. top: -60rpx;
  209. transform: translateX(-50%);
  210. padding: 50rpx 30rpx;
  211. }
  212. .recharge_title {
  213. font-size: 36rpx;
  214. color: rgba(51, 51, 51, 1);
  215. text-align: center;
  216. }
  217. .recharge {
  218. padding-top: 12rpx;
  219. }
  220. .recharge .card {
  221. width: 200rpx;
  222. height: 122rpx;
  223. background: rgba(255, 255, 255, 1);
  224. border: 1rpx solid rgba(233, 233, 233, 1);
  225. border-radius: 5rpx;
  226. margin-top: 18rpx;
  227. margin-right: 15rpx;
  228. font-size: 36rpx;
  229. color: rgba(213, 76, 67, 1);
  230. text-align: center;
  231. line-height: 122rpx;
  232. }
  233. .recharge .card:nth-of-type(3n) {
  234. margin-right: 0;
  235. }
  236. .recharge .card.active {
  237. background: rgba(255, 244, 244, 1);
  238. border: 1rpx solid rgba(255, 113, 113, 1);
  239. }
  240. /* 选择门店 */
  241. .selecteShop_nr {
  242. display: flex;
  243. justify-content: space-between;
  244. margin-top: 20rpx;
  245. }
  246. .selecteShop_nr .text {
  247. font-size: 28rpx;
  248. }
  249. /* 提现金额 */
  250. .recharge_wrap .van-cell {
  251. padding: 10rpx 0 !important;
  252. line-height: normal !important;
  253. border-bottom: 1rpx solid rgba(0, 0, 0, 0.1);
  254. }
  255. .recharge_wrap .van-field__body {
  256. font-size: 30rpx;
  257. padding-top: 30rpx;
  258. }
  259. </style>