ucenter.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. <template>
  2. <view class="page">
  3. <view class="header">
  4. <view class="bg">
  5. <view class="left">
  6. <view class="user">
  7. <image class="avator" mode="widthFix" :src="myinfo.avator"></image>
  8. <text class="nickname">{{myinfo.nickname}}</text>
  9. <image class="iconV" mode="widthFix" :src="'../../static/w3/w3_icon_'+(myinfo.level+1)+'.png'">
  10. </image>
  11. </view>
  12. <view class="num">{{myinfo.num_gmb}}</view>
  13. <view class="desc">
  14. 可用数量
  15. <image class="arrow" mode="widthFix" src="../../static/w3/wenhao.png"></image>
  16. </view>
  17. </view>
  18. <view class="right">
  19. <image class="icon" mode="widthFix" :src="'../../static/w3/w3_'+(myinfo.level+1)+'.png'"></image>
  20. <view class="desc" @click="goPage('/pages/w3/levRule')">
  21. 查看晋升规则
  22. <image class="arrow" mode="widthFix" src="../../static/me/arrow_right.png"></image>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. <view class="thread"></view>
  28. <view class="sigin">
  29. <view class="btn gray" v-if="myinfo.is_signin > 0">
  30. 已签到
  31. </view>
  32. <view class="btn" v-else @click="goSign">
  33. 签到
  34. </view>
  35. </view>
  36. <view class="thread"></view>
  37. <view class="list_r">
  38. <view class="item1" @click="goPage('/pages/w3/box')"></view>
  39. <view class="item2" @click="goPage('/pages/w3/invite')"></view>
  40. </view>
  41. <view class="list_r">
  42. <view class="item3" @click="goPage('/pages/w3/tran')"></view>
  43. <view class="item4" @click="goPage('/pages/w3/X_bank')"></view>
  44. </view>
  45. <view class="thread"></view>
  46. <view class="thread"></view>
  47. <view class="thread"></view>
  48. <view class="list_item" v-for="(item,index) in list" v-if="index == 0">
  49. <view class="item1">
  50. <text class="left">{{item.name}}</text>
  51. <text class="right">已拓中{{item.num_have}}/{{item.num}}</text>
  52. </view>
  53. <view class="item2">
  54. <view class="left">
  55. <image class="icon" mode="widthFix" :src="'../../static/w3/box/box_'+item.id+'.png'"></image>
  56. <block v-if="item.num_have > 0">
  57. <text class="name">待解锁:{{item.num_sign}}/{{item.num_task}}天</text>
  58. <text class="time">开拓日期:{{item.tdate}}</text>
  59. </block>
  60. </view>
  61. <view class="right">
  62. <view class="content">
  63. 探索需要{{item.num_dui}}个暗物质,可探索获得{{item.num_jkb}}个暗物质,周期{{item.num_limit_day}}
  64. 天,最多可完成{{item.num}}次探索。
  65. </view>
  66. <view class="act">
  67. <block v-if="myinfo.is_idcheck < 1">
  68. <image class="icon" mode="widthFix" src="../../static/w3/tansuo.png" @click="onIdcheck()">
  69. </image>
  70. </block>
  71. <block v-else-if="item.num_have < 1">
  72. <image class="icon" mode="widthFix" src="../../static/w3/tansuo.png" @click="onGetBox()">
  73. </image>
  74. </block>
  75. </view>
  76. </view>
  77. </view>
  78. </view>
  79. <view class="thread2"></view>
  80. <DialogBoxW3 ref="DialogBoxW3"></DialogBoxW3>
  81. </view>
  82. </template>
  83. <script>
  84. export default {
  85. components: {},
  86. data() {
  87. return {
  88. title: '',
  89. myinfo: {},
  90. platDiff: '',
  91. num_people: 0,
  92. num_diamond: 0,
  93. showPop: false,
  94. popFrom: 'bottom',
  95. maskClick: true,
  96. isPlayingState: false,
  97. bg_show: false,
  98. show_sound: false,
  99. swiperIndex: 0,
  100. data_list: [{
  101. "title": "",
  102. "author": "",
  103. "content": "",
  104. "is_show": 1
  105. }],
  106. list: [],
  107. tid: 0,
  108. audio: null,
  109. record_id: 0,
  110. }
  111. },
  112. onLoad() {
  113. let self = this;
  114. },
  115. onShow() {
  116. // uni.hideTabBar({
  117. // animation:false
  118. // })
  119. // this.loadData(1);
  120. // this.showBottomPlayer();
  121. this.loadInfo();
  122. this.loadBoxList();
  123. },
  124. methods: {
  125. goPage(page) {
  126. uni.navigateTo({
  127. url: page,
  128. })
  129. },
  130. loadInfo() {
  131. uni.request({
  132. url: this.$apiHost + '/Web/getinfo',
  133. data: {
  134. uuid: getApp().globalData.uuid
  135. },
  136. header: {
  137. "content-type": "application/json", //自定义请求头信息
  138. },
  139. success: (res) => {
  140. console.log("----:", res.data);
  141. this.myinfo = res.data;
  142. },
  143. complete: (com) => {
  144. // uni.hideLoading();
  145. },
  146. fail: (e) => {
  147. console.log("----e:", e);
  148. }
  149. });
  150. },
  151. loadBoxList() {
  152. let that = this;
  153. uni.request({
  154. url: this.$apiHost + "/Box/getlist", //仅为示例,并非真实接口地址。
  155. data: {
  156. uuid: getApp().globalData.uuid,
  157. tab: 1,
  158. type: 1,
  159. },
  160. header: {
  161. "content-type": "application/json"
  162. },
  163. success: (res) => {
  164. console.log("----", res.data.list);
  165. if (res.data.success == "yes") {
  166. that.list = res.data.list;
  167. }
  168. },
  169. complete: (com) => {
  170. uni.hideLoading();
  171. },
  172. });
  173. },
  174. goSign() {
  175. uni.showLoading({})
  176. let that = this;
  177. uni.request({
  178. url: this.$apiHost + "/My/signin", //仅为示例,并非真实接口地址。
  179. data: {
  180. uuid: getApp().globalData.uuid,
  181. },
  182. header: {
  183. "content-type": "application/json"
  184. },
  185. success: (res) => {
  186. console.log("----", res.data.list);
  187. uni.showToast({
  188. title: res.data.str,
  189. icon: 'none'
  190. });
  191. if (res.data.success == "yes") {
  192. this.loadInfo();
  193. this.loadBoxList();
  194. }
  195. },
  196. complete: (com) => {
  197. uni.hideLoading();
  198. },
  199. });
  200. },
  201. onIdcheck() {
  202. let that = this;
  203. this.$refs['DialogBoxW3'].confirm({
  204. title: '实名',
  205. content: '您未实名,实名后领取50个暗物质开启星际通行证',
  206. DialogType: 'inquiry',
  207. btn1: '',
  208. btn2: '',
  209. animation: 0
  210. }).then((res) => {
  211. uni.navigateTo({
  212. url: '/pages/my/idcheck',
  213. })
  214. })
  215. },
  216. onGetBox() {
  217. let that = this;
  218. this.$refs['DialogBoxW3'].confirm({
  219. title: '探索',
  220. content: '您还没有开通探索卡,快去激活吧!',
  221. DialogType: 'inquiry',
  222. btn1: '',
  223. btn2: '',
  224. animation: 0
  225. }).then((res) => {
  226. uni.navigateTo({
  227. url: '/pages/w3/box',
  228. })
  229. })
  230. }
  231. }
  232. }
  233. </script>
  234. <style scoped lang="scss">
  235. @import 'ucenter.scss';
  236. </style>