耀实惠小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

282 lines
5.9 KiB

2 years ago
  1. <template>
  2. <view class="wallte">
  3. <text class="title">钱包余额</text>
  4. <view class="money_num">
  5. <text></text>
  6. <text class="num">{{user_info.wallet}}</text>
  7. </view>
  8. <view class="grid">
  9. <text class="title">提现到微信零钱</text>
  10. <view class="input_box">
  11. <text class="text_icon"></text>
  12. <input type="number" v-model="money" />
  13. <text class="withdraw_deposit" @click="allMoney">全部提现</text>
  14. </view>
  15. <text class="info_text">提现手续费为10%</text>
  16. </view>
  17. <view class="info flex align-center justify-between">
  18. <view>
  19. <text class="dit">·</text>
  20. <text>预计24小时到账</text>
  21. </view>
  22. <view class="theme-color" @click="toInfo">余额明细</view>
  23. </view>
  24. <view class="flex p-l-50">
  25. <text class="dit font-48" style="color: #FF0000;">·</text>
  26. <text class="flex " style="color: #FF0000;">温馨提示如果要将兑购金提现请您联系客服</text>
  27. </view>
  28. <button class="btn_money" @click="addMoney">立即提现</button>
  29. <view class="buttom_btn">
  30. <text class="title">联系我们</text>
  31. <view class="card">
  32. <!-- <image @click="toWechat" :src="img_url+'leave_word/wechat.png'" mode=""></image>
  33. <image @click="toPhone" :src="img_url+'leave_word/phone.png'" mode=""></image> -->
  34. <view class="card-image" @click="handleClick(item.key)" v-for="(item,index) in contactList"
  35. :key="item.key">
  36. <button v-if="index == 0" open-type="contact" bindcontact="handleContact" session-from="sessionFrom"
  37. class="w-330 p-0" style="height: 82%;">
  38. <image class="w-330" :src="item.img" mode="widthFix"></image>
  39. </button>
  40. <button v-if="index == 1" @click="call('15388981678')" class="w-330 p-0 " style="height: 82%;">
  41. <image class="w-330" :src="item.img" mode="widthFix"></image>
  42. </button>
  43. </view>
  44. </view>
  45. </view>
  46. </view>
  47. </template>
  48. <script>
  49. import { IMG_URL } from '@/env.js'
  50. export default {
  51. data() {
  52. return {
  53. money: null,
  54. showMoney: '0',
  55. user_info: {},
  56. type: 0,
  57. contactList: [
  58. {key: 'wechat', img: `${IMG_URL}leave_word/wechat.png`},
  59. {key: 'phone', img: `${IMG_URL}leave_word/phone.png`},
  60. ],
  61. }
  62. },
  63. onLoad(options) {
  64. this.type = options.type
  65. this.getUserInfo()
  66. },
  67. methods: {
  68. call(phone) {
  69. uni.makePhoneCall({
  70. phoneNumber: phone,
  71. success(res) {
  72. },
  73. fail(err) {
  74. }
  75. })
  76. },
  77. toInfo() {
  78. uni.navigateTo({
  79. // let url = key === 'money' ? '/pagesA/my_other_list/webmaster/reward_centers/index2?type=2' : '/pagesA/my_other_list/webmaster/reward_centers/index3?type=1'
  80. url: '/pagesA/my_other_list/webmaster/reward_centers/index2?title=余额明细&type=' + 2
  81. })
  82. },
  83. // 全部提现
  84. allMoney() {
  85. this.money = this.user_info.wallet
  86. },
  87. getUserInfo() {
  88. uni.showLoading();
  89. const that = this
  90. this.$api('getUserInfo', {
  91. money: this.money
  92. }).then(res => {
  93. let {
  94. code,
  95. result,
  96. message
  97. } = res;
  98. if (code == 200) {
  99. // that.$Toast(message);
  100. this.user_info = {
  101. ...result.account,
  102. ...result.userInfo
  103. }
  104. } else {
  105. that.$Toast(message);
  106. }
  107. uni.hideLoading();
  108. }).catch(err => {
  109. uni.hideLoading();
  110. that.$Toast(err.message);
  111. })
  112. },
  113. // 立即体现
  114. addMoney() {
  115. uni.showLoading();
  116. const that = this
  117. this.$api('getStationMoney', {
  118. money: this.money
  119. }).then(res => {
  120. let {
  121. code,
  122. result,
  123. message
  124. } = res;
  125. if (code == 200) {
  126. that.$Toast(result)
  127. that.user_info.wallet = 0
  128. } else {
  129. that.$Toast(message);
  130. }
  131. this.getUserInfo();
  132. uni.hideLoading();
  133. }).catch(err => {
  134. uni.hideLoading();
  135. that.$Toast(err.message);
  136. })
  137. },
  138. handleClick (key) {
  139. // 电话咨询
  140. if (key === 'phone') {
  141. } else { // 微信留言
  142. }
  143. }
  144. }
  145. }
  146. </script>
  147. <style lang="scss">
  148. .wallte {
  149. display: flex;
  150. flex-direction: column;
  151. text-align: center;
  152. .money_num {
  153. padding-top: 44rpx;
  154. padding-bottom: 40rpx;
  155. color: #DB0618;
  156. .num {
  157. font-size: 62rpx;
  158. }
  159. }
  160. .grid {
  161. width: 689rpx;
  162. height: 300rpx;
  163. margin: 0 auto;
  164. border-radius: 26rpx;
  165. padding-top: 23rpx;
  166. box-sizing: border-box;
  167. background-color: #F5F5F5;
  168. .title {
  169. font-size: 30rpx;
  170. font-weight: bold;
  171. }
  172. .input_box {
  173. width: 669rpx;
  174. margin-top: 78rpx;
  175. margin-bottom: 33rpx;
  176. display: flex;
  177. justify-content: flex-start;
  178. border-bottom: 1px solid #B5B0B0;
  179. .text_icon {
  180. color: #707070;
  181. font-size: 35rpx;
  182. font-weight: bold;
  183. }
  184. .withdraw_deposit {
  185. font-size: 26rpx;
  186. padding-right: 35rpx;
  187. color: #01AEEA;
  188. }
  189. input {
  190. flex: 1;
  191. text-align: left;
  192. font-size: 35rpx;
  193. }
  194. }
  195. .info_text {
  196. display: flex;
  197. justify-content: flex-start;
  198. margin-left: 28rpx;
  199. font-size: 26rpx;
  200. color: #707070;
  201. }
  202. }
  203. .info {
  204. display: flex;
  205. margin-top: 28rpx;
  206. padding: 0 50rpx;
  207. color: #707070;
  208. }
  209. .dit {
  210. font-size: 48rpx;
  211. font-weight: bold;
  212. line-height: 40rpx;
  213. padding-right: 20rpx;
  214. }
  215. }
  216. .title {
  217. padding-top: 60rpx;
  218. font-size: 32rpx;
  219. }
  220. .money_num {}
  221. .btn_money {
  222. width: 668rpx;
  223. height: 88rpx;
  224. font-size: 34rpx;
  225. line-height: 88rpx;
  226. // position: fixed;
  227. // left: 45rpx;
  228. // bottom: 66rpx;
  229. margin-top: 120rpx;
  230. background-color: #01AEEA;
  231. color: #fff;
  232. border-radius: 38rpx;
  233. }
  234. .buttom_btn{
  235. display: flex;
  236. flex-direction: column;
  237. align-items: flex-start;
  238. .title{
  239. display: inline-block;
  240. font-size: 32rpx;
  241. color: #000;
  242. margin-top: 74rpx;
  243. margin-left: 42rpx;
  244. }
  245. .card{
  246. width: 100%;
  247. margin-top: 48rpx;
  248. box-sizing: border-box;
  249. padding-left: 25rpx;
  250. padding-right: 25rpx;
  251. display: flex;
  252. justify-content: space-between !important;
  253. &-image{
  254. width: 330rpx;
  255. border-radius: 12rpx;
  256. }
  257. }
  258. }
  259. </style>