ucenter.vue 6.8 KB

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