wishHelp.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <template>
  2. <view class="page">
  3. <view class="list_info">
  4. <view class="item">
  5. <view class="avator">
  6. <image class="icon" :src="info.image" mode="aspectFill">
  7. </image>
  8. </view>
  9. <view class="tit">
  10. <view class="name">{{info.name}}</view>
  11. <view class="desc" v-if="false">市场价:¥{{info.price}}</view>
  12. </view>
  13. <view class="jindu">
  14. <view class="bord">
  15. <view class="active" :style="'width:' + info.num_bfb + '%;'"></view>
  16. </view>
  17. <text class="tips">{{info.num_bfb}}%</text>
  18. </view>
  19. <view class="title">助力好友</view>
  20. <view class="list_mem">
  21. <view class="mem" v-for="(item,index) in info.mem_list">
  22. <image class="icon" :src="item.avator" mode="aspectFill" />
  23. <text>{{item.nickname}}</text>
  24. </view>
  25. </view>
  26. <view class="btnList">
  27. <view class="btn_submit1" @click="goDetail()">我也要许愿</view>
  28. <view class="btn_submit" @click="goZuli()">助力</view>
  29. </view>
  30. </view>
  31. <view class="blankHeight"></view>
  32. </view>
  33. <DialogBox ref="DialogBox"></DialogBox>
  34. <ToastW3 ref="ToastW3"></ToastW3>
  35. </view>
  36. </template>
  37. <script>
  38. export default {
  39. components: {},
  40. data() {
  41. return {
  42. tab: 1,
  43. scrollTop: 0,
  44. old: {
  45. scrollTop: 0
  46. },
  47. info: {}
  48. }
  49. },
  50. onLoad(parms) {
  51. this.id = parms.id || 16
  52. // setTimeout(function() {
  53. // uni.setNavigationBarColor({
  54. // frontColor: '#ffffff',
  55. // backgroundColor: '#00000000',
  56. // animation: {
  57. // duration: 400,
  58. // timingFunc: 'easeIn'
  59. // }
  60. // })
  61. // }, 200);
  62. },
  63. onShow() {
  64. this.loadData();
  65. },
  66. methods: {
  67. onBack() {},
  68. checkTab(tab) {
  69. this.tab = tab;
  70. // this.loadData();
  71. },
  72. scroll: function(e) {
  73. console.log(e)
  74. this.old.scrollTop = e.detail.scrollTop
  75. },
  76. goDetail() {
  77. uni.navigateTo({
  78. url: '/pages/my/wishDetail?id=' + this.info.id,
  79. })
  80. },
  81. goZuli() {
  82. let that = this;
  83. this.$refs['DialogBox'].confirm({
  84. title: '助力心愿',
  85. content: '是否消耗10M币为TA助力心愿',
  86. DialogType: 'inquiry',
  87. btn1: '否',
  88. btn2: '是',
  89. animation: 0
  90. }).then((res) => {
  91. uni.request({
  92. url: this.$apiHost + "/Wish/helpTA",
  93. data: {
  94. uuid: getApp().globalData.uuid,
  95. myid: this.info.myid
  96. },
  97. header: {
  98. "content-type": "application/json",
  99. 'sign': getApp().globalData.headerSign
  100. },
  101. success: (res) => {
  102. console.log("----", res.data.list);
  103. // uni.showToast({
  104. // title: res.data.str,
  105. // icon: 'none'
  106. // })
  107. that.$refs['ToastW3'].showToast({
  108. title: res.data.str,
  109. animation: 0
  110. });
  111. if (res.data.success == "yes") {
  112. that.loadData()
  113. }
  114. },
  115. complete: (com) => {
  116. uni.hideLoading();
  117. },
  118. });
  119. })
  120. },
  121. loadData() {
  122. uni.request({
  123. url: this.$apiHost + '/Wish/getMyInfo',
  124. data: {
  125. uuid: getApp().globalData.uuid,
  126. id: this.id,
  127. },
  128. header: {
  129. 'content-type': 'application/json',
  130. 'sign': getApp().globalData.headerSign
  131. },
  132. success: (res) => {
  133. console.log("res", res.data)
  134. this.info = res.data.info;
  135. }
  136. });
  137. },
  138. }
  139. }
  140. </script>
  141. <style scoped lang="scss">
  142. @import 'wishHelp.scss';
  143. </style>