wallet.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. <template>
  2. <view>
  3. <!-- #ifdef H5 -->
  4. <view class="top" style="position: fixed;top: 0;width: 100%;">
  5. <!-- #endif -->
  6. <!-- #ifdef MP-WEIXIN -->
  7. <view class="top" style="position: fixed;top: 0;width: 100%;">
  8. <!-- #endif -->
  9. <!-- #ifdef APP-PLUS -->
  10. <view class="top" style="position: fixed;top: 0rpx;width: 100%;">
  11. <!-- #endif -->
  12. <view class="headbg">
  13. <view class="flex align-end justify-between" style="padding:60rpx 60rpx 0rpx 60rpx">
  14. <view>
  15. <view class="text-lg ">当前钻石</view>
  16. <view class="margin-top">
  17. <text class="text-bold margin-right-xs"
  18. style="font-size: 68upx;">{{money?money:'0'}}</text>
  19. <image src="../static/jifen.png" style="width: 32upx;height: 34upx;"></image>
  20. </view>
  21. </view>
  22. <view class="">
  23. <view class="btns" @click="gotoChat()">申请退款 <u-icon
  24. style="margin-left: 10rpx;padding-top: 5rpx;" name="play-right-fill"
  25. color="#ffffff" size="24"></u-icon></view>
  26. <view class="btn" @click="chongzhi()">钻石充值</view>
  27. </view>
  28. </view>
  29. <view class="btns justify-between" style="font-size: 28rpx;padding:20rpx 60rpx 20rpx 60rpx">
  30. <view class="">
  31. <!-- 定制化抵扣积分:{{customizationMoney}}
  32. <u-icon @click.native="show = true" style="margin-left: 10rpx;padding-top: 5rpx;" name="question-circle-fill" color="#ffffff" size="34"></u-icon> -->
  33. </view>
  34. <view class="" v-if="weekMember!=1">
  35. <view class="btn" @click="gotoZhouka">开通会员</view>
  36. </view>
  37. </view>
  38. </view>
  39. <view class="flex align-center padding" style="background-color: #ffffff;">
  40. <view style="width: 6upx;height: 32upx;background: #00DD9A;"></view>
  41. <view class="margin-left-xs">钻石明细</view>
  42. </view>
  43. <view style="width: 100%;height: 1upx;background: #F2F2F2;"></view>
  44. </view>
  45. <!-- #ifdef H5 -->
  46. <view class="" style="width: 100%;margin-top: 450rpx;">
  47. <!-- #endif -->
  48. <!-- #ifdef APP-PLUS -->
  49. <view class="" style="width: 100%;margin-top: 450rpx;">
  50. <!-- #endif -->
  51. <!-- #ifdef MP-WEIXIN -->
  52. <view class="" style="width: 100%;margin-top: 450rpx;">
  53. <!-- #endif -->
  54. <view class="margin-lr margin-top" v-for="(item,index) in list" :key="index"
  55. style="border-bottom: 1rpx solid #F2F2F2;padding-bottom: 10rpx;">
  56. <view class="flex align-center justify-between">
  57. <view>
  58. <view class="" style="color: #000;">{{item.title}}</view>
  59. <view style="color: #999999;" class="text-sm margin-top-sm">{{item.createTime}}
  60. </view>
  61. </view>
  62. <view class="flex align-center">
  63. <view style="font-size: 44upx;" v-if="item.type == 2">-</view>
  64. <view style="font-size: 44upx;" v-else>+</view>
  65. <view class="text-bold" style="font-size: 38upx;">{{item.money}}</view>
  66. </view>
  67. </view>
  68. </view>
  69. <empty v-if="list.length==0" />
  70. </view>
  71. <u-modal v-model="show" :content="content"></u-modal>
  72. </view>
  73. </template>
  74. <script>
  75. import empty from '@/components/empty.vue'
  76. export default {
  77. components: {
  78. empty
  79. },
  80. data() {
  81. return {
  82. content: '定制化抵扣积分可用于抵扣发布项目',
  83. show: false,
  84. money: '',
  85. page: 1,
  86. limit: 10,
  87. list: [],
  88. count: 0,
  89. customizationMoney: 0,
  90. weekMember: '',
  91. }
  92. },
  93. onLoad() {
  94. this.getMyMoney()
  95. this.getmoneyList()
  96. this.weekMember = uni.getStorageSync('weekMember')
  97. },
  98. onShow() {
  99. this.page = 1
  100. this.getMyMoney()
  101. this.getmoneyList();
  102. },
  103. methods: {
  104. gotoZhouka() {
  105. uni.navigateTo({
  106. url: '/my/vip/index'
  107. })
  108. },
  109. gotoChat() {
  110. let that = this
  111. uni.showModal({
  112. title: '提示',
  113. content: '联系客服后1-7个工作日内退回',
  114. confirmText: '联系客服',
  115. complete(ret) {
  116. if (ret.confirm) {
  117. // #ifdef MP-WEIXIN
  118. wx.openCustomerServiceChat({
  119. extInfo: {
  120. url: that.$queue.getData('kefuq')
  121. },
  122. corpId: that.$queue.getData('kefuAppidq'),
  123. success(res) {
  124. console.log(res)
  125. },
  126. })
  127. // #endif
  128. // #ifdef H5
  129. window.location.href = that.$queue.getData('kefuq');
  130. // #endif
  131. // #ifdef APP
  132. let kefu = that.$queue.getData('kefuq')
  133. console.log(kefu)
  134. plus.runtime.openURL(kefu, function(res) {});
  135. // #endif
  136. // uni.navigateTo({
  137. // url:'/my/setting/chat'
  138. // })
  139. }
  140. }
  141. })
  142. },
  143. getMyMoney() {
  144. this.$Request.get("/app/userMoney/selectMyMoney").then(res => {
  145. if (res.code == 0) {
  146. this.money = res.data.money
  147. this.customizationMoney = res.data.customizationMoney
  148. }
  149. })
  150. },
  151. chongzhi() {
  152. uni.navigateTo({
  153. url: '/my/wallet/index'
  154. })
  155. },
  156. getmoneyList() {
  157. let data = {
  158. page: this.page,
  159. limit: this.limit,
  160. classify: 1
  161. }
  162. this.$Request.get("/app/userMoney/balanceDetailed", data).then(res => {
  163. if (res.code == 0) {
  164. if (this.page == 1) {
  165. this.list = res.data.records
  166. } else {
  167. res.data.records.forEach(d => {
  168. this.list.push(d);
  169. });
  170. }
  171. this.count = res.data.totalCount
  172. } else {
  173. console.log(res.msg)
  174. }
  175. uni.stopPullDownRefresh();
  176. })
  177. }
  178. },
  179. onReachBottom: function() {
  180. if (this.list.length == this.count) {
  181. uni.showToast({
  182. title: '已经到底了~',
  183. icon: 'none'
  184. })
  185. } else {
  186. this.page = this.page + 1;
  187. this.getmoneyList()
  188. }
  189. },
  190. onPullDownRefresh: function() {
  191. this.page = 1;
  192. this.getmoneyList()
  193. },
  194. }
  195. </script>
  196. <style lang="less">
  197. page {
  198. background: #ffffff;
  199. }
  200. .headbg {
  201. background: #00DD9A;
  202. color: #ffffff;
  203. }
  204. .btn {
  205. width: 180rpx;
  206. height: 70rpx;
  207. background: #FFFFFF;
  208. border-radius: 35rpx;
  209. color: #00B88F;
  210. font-size: 28rpx;
  211. font-weight: 500;
  212. display: flex;
  213. justify-content: center;
  214. align-items: center;
  215. float: right;
  216. }
  217. .btns {
  218. padding-left: 70rpx;
  219. padding-bottom: 30rpx;
  220. padding-top: 30rpx;
  221. display: flex;
  222. align-items: center;
  223. }
  224. </style>