wishDetail.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  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. <block v-if="info.myid > 0">
  20. <view class="title">助力好友</view>
  21. <view class="list_mem">
  22. <view class="mem" v-for="(item,index) in info.mem_list">
  23. <image class="icon" :src="item.avator" mode="aspectFill" />
  24. <text>{{item.nickname}}</text>
  25. </view>
  26. </view>
  27. <view class="title">助力记录</view>
  28. <view class="list_record">
  29. <view class="record" v-for="(item,index) in info.mem_list">
  30. <view class="left">
  31. <image class="icon" :src="item.avator" mode="aspectFill" />
  32. <text>{{item.nickname}}</text>
  33. </view>
  34. <text class="right">{{item.create_time}}</text>
  35. </view>
  36. </view>
  37. </block>
  38. <block v-else>
  39. <view class="btn_submit" @click="JoinIt(info)">加入心愿</view>
  40. <view class="title">许愿动态</view>
  41. <view class="list_record">
  42. <view class="record" v-for="(item,index) in info.mem_list">
  43. <view class="left">
  44. <image class="icon" :src="item.avator" mode="aspectFill" />
  45. <text>{{item.nickname}}</text>
  46. </view>
  47. <text class="right">{{item.create_time}}</text>
  48. </view>
  49. </view>
  50. </block>
  51. </view>
  52. <view class="blankHeight"></view>
  53. </view>
  54. <DialogBoxW3 ref="DialogBoxW3"></DialogBoxW3>
  55. <ToastW3 ref="ToastW3"></ToastW3>
  56. </view>
  57. </template>
  58. <script>
  59. export default {
  60. components: {},
  61. data() {
  62. return {
  63. tab: 1,
  64. scrollTop: 0,
  65. old: {
  66. scrollTop: 0
  67. },
  68. info: {}
  69. }
  70. },
  71. onLoad(parms) {
  72. this.id = parms.id || 11
  73. // setTimeout(function() {
  74. // uni.setNavigationBarColor({
  75. // frontColor: '#ffffff',
  76. // backgroundColor: '#00000000',
  77. // animation: {
  78. // duration: 400,
  79. // timingFunc: 'easeIn'
  80. // }
  81. // })
  82. // }, 200);
  83. },
  84. onShow() {
  85. this.loadData();
  86. },
  87. methods: {
  88. onBack() {},
  89. checkTab(tab) {
  90. this.tab = tab;
  91. // this.loadData();
  92. },
  93. scroll: function(e) {
  94. console.log(e)
  95. this.old.scrollTop = e.detail.scrollTop
  96. },
  97. loadData() {
  98. uni.request({
  99. url: this.$apiHost + '/Wish/getInfo',
  100. data: {
  101. uuid: getApp().globalData.uuid,
  102. id: this.id,
  103. },
  104. header: {
  105. 'content-type': 'application/json'
  106. },
  107. success: (res) => {
  108. console.log("res", res.data)
  109. this.info = res.data.info;
  110. }
  111. });
  112. },
  113. JoinIt(item) {
  114. let that = this;
  115. this.$refs['DialogBoxW3'].confirm({
  116. title: '加入心愿',
  117. content: '是否确定加入心愿',
  118. DialogType: 'inquiry',
  119. btn1: '',
  120. btn2: '',
  121. animation: 0
  122. }).then((res) => {
  123. uni.request({
  124. url: this.$apiHost + "/Wish/joinit",
  125. data: {
  126. uuid: getApp().globalData.uuid,
  127. id: item.id
  128. },
  129. header: {
  130. "content-type": "application/json"
  131. },
  132. success: (res) => {
  133. console.log("----", res.data.list);
  134. // uni.showToast({
  135. // title: res.data.str,
  136. // icon: 'none'
  137. // })
  138. that.$refs['ToastW3'].showToast({
  139. title: res.data.str,
  140. animation: 0
  141. });
  142. if (res.data.success == "yes") {
  143. that.loadData()
  144. }
  145. },
  146. complete: (com) => {
  147. uni.hideLoading();
  148. },
  149. });
  150. })
  151. }
  152. }
  153. }
  154. </script>
  155. <style scoped lang="scss">
  156. @import 'wishDetail.scss';
  157. </style>