leDouQuery.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <template>
  2. <view class="query-content">
  3. <view class="query-input">
  4. <u-input v-model="queryWord" :border="true" :maxlength="11" placeholder="请输入完整手机号码查询" type="number"/>
  5. <view class="query-button">
  6. <u-button shape="circle" @click="queryData" type="primary">查询</u-button>
  7. </view>
  8. </view>
  9. <view class="query-result">
  10. <u-gap height="20" bg-color="#f8f8f8"></u-gap>
  11. <view class="result-list" v-if="result">
  12. <view class="result-title">
  13. <view>
  14. <u-icon name="account-fill" color="#666" size="28"></u-icon>
  15. <text>{{result.customerRoleDictValue}}</text>
  16. </view>
  17. <view v-if="result.customerRole == 1 && result.state == 1">
  18. <u-button @click="hexiao" type="warning" size="mini">乐豆核销</u-button>
  19. </view>
  20. </view>
  21. <view class="result-info">
  22. <u-cell-group>
  23. <u-cell-item :arrow="false" title="注册时间" :value="result.registerTime"></u-cell-item>
  24. <u-cell-item :arrow="false" title="用户手机" :value="result.mobile"></u-cell-item>
  25. <u-cell-item :arrow="false" title="乐豆余额" :value-style="{color:'red'}" :value="result.currentGold||'0'">
  26. </u-cell-item>
  27. </u-cell-group>
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. </template>
  33. <script>
  34. import { queryldByMobile } from '@/api/officialPartnerGoldLog.js'
  35. export default{
  36. data() {
  37. return {
  38. queryWord: '',
  39. result: null
  40. }
  41. },
  42. methods: {
  43. queryData(){
  44. if(this.queryWord.length == 11){
  45. queryldByMobile({mobile:this.queryWord}).then(res => {
  46. console.log(res)
  47. if(res.status == 200){
  48. this.result = res.data
  49. }else{
  50. this.result = null
  51. }
  52. })
  53. }else{
  54. uni.showToast({
  55. icon: 'none',
  56. title: '请输入完整的手机号'
  57. })
  58. }
  59. },
  60. hexiao() {
  61. if(this.result.currentGold>0){
  62. uni.navigateTo({
  63. url: "/pages/ledouHexiao/ledouHexiao?item="+ encodeURIComponent(JSON.stringify(this.result))
  64. })
  65. }else{
  66. uni.showToast({
  67. icon: 'none',
  68. title: '此用户的乐豆余额为0'
  69. })
  70. }
  71. }
  72. },
  73. }
  74. </script>
  75. <style lang="less">
  76. .query-content{
  77. width: 100%;
  78. display: flex;
  79. flex-direction: column;
  80. .query-input{
  81. padding: 20rpx 60rpx;
  82. background: #FFFFFF;
  83. }
  84. .query-button{
  85. padding: 20rpx 0;
  86. }
  87. .query-result{
  88. flex-grow: 1;
  89. }
  90. .result-title{
  91. display: flex;
  92. align-items: center;
  93. justify-content: space-between;
  94. background: #fff;
  95. padding: 25rpx 30rpx;
  96. border-bottom: 1rpx solid #eee;
  97. }
  98. }
  99. </style>