my.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  1. <template>
  2. <view class="page">
  3. <view class="topBody">
  4. <view class="header">
  5. <view class="infoBg">
  6. <view class="left" @click="goPage('/pages/my/editInfo')">
  7. <image class="img" mode="aspectFill" :src="myinfo.avator"></image>
  8. </view>
  9. <view class="right" @click="goPage('/pages/my/editInfo')">
  10. <view class="nickname">
  11. <text>{{myinfo.nickname}}</text>
  12. <image src="../../static/me/icon_vip.png" mode="widthFix" v-if="myinfo.is_vip > 0" />
  13. <view class="siming" v-if="myinfo.is_idcheck > 1">已实名</view>
  14. </view>
  15. <view class="join_date">
  16. {{myinfo.join_name}}
  17. <image src="../../static/me/arrow_right.png" mode="widthFix" />
  18. </view>
  19. </view>
  20. <view class="dashang" @click="chkSel">
  21. <block v-if="false">
  22. <view class="sel" v-if="sel == 1">
  23. <view class="name">关闭<br />打赏</view>
  24. <view class="block"></view>
  25. </view>
  26. <view class="selno" v-else>
  27. <view class="blockGray"></view>
  28. <view class="name">开启<br />打赏</view>
  29. </view>
  30. </block>
  31. </view>
  32. </view>
  33. </view>
  34. <view class="myinfo">
  35. <view class="line"></view>
  36. <view class="numlist">
  37. <view class="item" @click="goPage('/pages/my/recordList?type=GUO')">
  38. <view class="num">
  39. <text style="color:#FF2A95;">{{myinfo.num_gmd}}</text>
  40. <view class="name">我的糖果</view>
  41. </view>
  42. </view>
  43. <view class="item" @click="goPage('/pages/my/recordList?type=GMM')">
  44. <view class="num">
  45. <text>{{myinfo.num_gmm}}</text>
  46. <view class="name">我的M币</view>
  47. </view>
  48. </view>
  49. <view class="item" v-if="myinfo.is_web3 > 0">
  50. <view class="num" @click="goPage('/pages/w3/ucenter')">
  51. <image src="../../static/me/web3.0.png" mode="widthFix" />
  52. <view class="name">WEB3.0</view>
  53. </view>
  54. </view>
  55. </view>
  56. <view class="numlist2" style="margin-top: 60rpx;">
  57. <!-- <view class="item" @click="goPage('/pages/my/idcheck')">
  58. <view class="num">
  59. <image class="icon" src="../../static/me/icon_list.png" mode="widthFix" />
  60. <view class="name">身份认证</view>
  61. </view>
  62. </view> -->
  63. <view class="item" v-for="(item,index) in menu_list" @click="goPage(item.path)">
  64. <view class="num">
  65. <image class="icon" :src="item.icon" mode="widthFix" />
  66. <view class="name">{{item.name}}</view>
  67. </view>
  68. </view>
  69. </view>
  70. </view>
  71. <view class="btn_submit" @click="onLogout()">退出登录</view>
  72. <view class="blankHeight"></view>
  73. <view class="blankHeight"></view>
  74. </view>
  75. <!-- 提示框 -->
  76. <DialogBox ref="DialogBox"></DialogBox>
  77. </view>
  78. </template>
  79. <script>
  80. export default {
  81. components: {},
  82. data() {
  83. return {
  84. title: '',
  85. sel: 1,
  86. myinfo: {
  87. nickname: '王思思',
  88. join_name: '注册日期:2024年5月',
  89. num_1: 0,
  90. num_2: 0,
  91. num_3: 0,
  92. num_4: 0,
  93. is_login: 'no',
  94. num_history: 0,
  95. num_collection: 0,
  96. is_web3: 0
  97. },
  98. menu_list: []
  99. }
  100. },
  101. onLoad() {
  102. // if (this.$isWeb3 > 0) {
  103. // this.is_web3 = true;
  104. // } else {
  105. // this.is_web3 = false;
  106. // }
  107. // setTimeout(function() {
  108. // uni.setNavigationBarColor({
  109. // frontColor: '#ffffff',
  110. // backgroundColor: '#00000000',
  111. // animation: {
  112. // duration: 400,
  113. // timingFunc: 'easeIn'
  114. // }
  115. // })
  116. // }, 200);
  117. },
  118. onShow() {
  119. this.loadData();
  120. this.loadMenu();
  121. },
  122. methods: {
  123. onBack() {},
  124. chkSel() {
  125. if (this.sel == 1) {
  126. this.sel = 0;
  127. } else {
  128. this.sel = 1;
  129. }
  130. },
  131. goPage(page) {
  132. if (page == 'kefu') {
  133. let that = this;
  134. // #ifdef APP-PLUS
  135. plus.share.getServices(res => {
  136. const wechat = res.find(i => i.id === 'weixin')
  137. if (wechat) {
  138. wechat.openCustomerServiceChat({
  139. corpid: 'wwbc06aa8311b6ac08',
  140. // url: 'https://work.weixin.qq.com/kfid/kfc4b0bcb4038d00a50'
  141. url: that.myinfo.wxkf
  142. }, src => {
  143. console.log("success:")
  144. }, err => {
  145. console.log("error:")
  146. })
  147. } else {
  148. uni.showToast({
  149. title: '没有检测到微信,请先安装',
  150. icon: "error"
  151. });
  152. }
  153. });
  154. // #endif
  155. } else if (page != '') {
  156. uni.navigateTo({
  157. url: page,
  158. })
  159. }
  160. },
  161. loadData() {
  162. console.log({
  163. uuid: getApp().globalData.uuid,
  164. skey: getApp().globalData.skey
  165. });
  166. uni.request({
  167. url: this.$apiHost + '/Web/getinfo',
  168. data: {
  169. uuid: getApp().globalData.uuid,
  170. skey: getApp().globalData.skey
  171. },
  172. header: {
  173. "content-type": "application/json",
  174. 'sign': getApp().globalData.headerSign
  175. },
  176. success: (res) => {
  177. console.log("----:", res.data);
  178. if (res.data.need_login == "yes") {
  179. // getApp().globalData.skey = "";
  180. // getApp().globalData.uuid = "";
  181. uni.removeStorageSync("wapptoken");
  182. uni.redirectTo({
  183. url: '/pages/login/login'
  184. });
  185. return;
  186. }
  187. if (res.data.need_edit == "yes") {
  188. uni.navigateTo({
  189. url: '/pages/my/step'
  190. });
  191. return;
  192. }
  193. this.myinfo = res.data;
  194. },
  195. complete: (com) => {
  196. // uni.hideLoading();
  197. },
  198. fail: (e) => {
  199. console.log("----e:", e);
  200. }
  201. });
  202. },
  203. loadMenu() {
  204. console.log({
  205. uuid: getApp().globalData.uuid,
  206. skey: getApp().globalData.skey
  207. });
  208. uni.request({
  209. url: this.$apiHost + '/User/getinfo',
  210. data: {
  211. uuid: getApp().globalData.uuid,
  212. skey: getApp().globalData.skey
  213. },
  214. header: {
  215. "content-type": "application/json",
  216. 'sign': getApp().globalData.headerSign
  217. },
  218. success: (res) => {
  219. console.log("----:", res.data);
  220. if (res.data.need_login == "yes") {
  221. // getApp().globalData.skey = "";
  222. // getApp().globalData.uuid = "";
  223. uni.removeStorageSync("wapptoken");
  224. uni.redirectTo({
  225. url: '/pages/login/login'
  226. });
  227. return;
  228. }
  229. this.menu_list = res.data.list01;
  230. },
  231. complete: (com) => {
  232. // uni.hideLoading();
  233. },
  234. fail: (e) => {
  235. console.log("----e:", e);
  236. }
  237. });
  238. },
  239. onLogout() {
  240. let that = this;
  241. this.$refs['DialogBox'].confirm({
  242. title: '提示',
  243. content: '确定退出吗?',
  244. DialogType: 'inquiry',
  245. btn1: '取消',
  246. btn2: '退出',
  247. animation: 0
  248. }).then((res) => {
  249. uni.request({
  250. url: that.$apiHost + '/My/logout',
  251. data: {
  252. uuid: getApp().globalData.uuid,
  253. skey: getApp().globalData.skey
  254. },
  255. header: {
  256. "content-type": "application/json",
  257. 'sign': getApp().globalData.headerSign
  258. },
  259. success: (res) => {
  260. console.log("----:", res.data);
  261. // getApp().globalData.skey = "";
  262. // getApp().globalData.uuid = "";
  263. uni.removeStorageSync("wapptoken");
  264. uni.redirectTo({
  265. url: '/pages/login/login'
  266. })
  267. },
  268. complete: (com) => {
  269. // uni.hideLoading();
  270. },
  271. fail: (e) => {
  272. console.log("----e:", e);
  273. }
  274. });
  275. })
  276. },
  277. }
  278. }
  279. </script>
  280. <style scoped lang="scss">
  281. @import 'my.scss';
  282. </style>