my.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335
  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. <view class="name">WEB3.0</view>
  52. </view>
  53. </view>
  54. </view>
  55. <view class="numlist2" style="margin-top: 60rpx;">
  56. <!-- <view class="item" @click="goPage('/pages/my/idcheck')">
  57. <view class="num">
  58. <image class="icon" src="../../static/me/icon_list.png" mode="widthFix" />
  59. <view class="name">身份认证</view>
  60. </view>
  61. </view> -->
  62. <view class="item" v-for="(item,index) in menu_list" @click="goPage(item.path)">
  63. <view class="num">
  64. <image class="icon" :src="item.icon" mode="widthFix" />
  65. <view class="name">{{item.name}}</view>
  66. </view>
  67. </view>
  68. </view>
  69. </view>
  70. <view class="btn_submit" @click="onLogout()">退出登录</view>
  71. <view class="blankHeight"></view>
  72. <view class="blankHeight"></view>
  73. </view>
  74. <!-- 提示框 -->
  75. <DialogBox ref="DialogBox"></DialogBox>
  76. <tabbar-view :tabbars="tabbars" :currentIndex="4" ref="tabbar"></tabbar-view>
  77. </view>
  78. </template>
  79. <script>
  80. import tabbarView from "@/components/tabbar/tabbar.vue";
  81. import pageNavbar from "@/components/page-navbar/page-navbar.vue";
  82. import wWaterfall from "@/components/w-waterfall/w-waterfall.vue";
  83. import tabbar from "@/mixins/tabbar";
  84. export default {
  85. components: {
  86. tabbarView,
  87. },
  88. mixins: [tabbar],
  89. data() {
  90. return {
  91. title: '',
  92. sel: 1,
  93. myinfo: {
  94. nickname: '王思思',
  95. join_name: '注册日期:2024年5月',
  96. num_1: 0,
  97. num_2: 0,
  98. num_3: 0,
  99. num_4: 0,
  100. is_login: 'no',
  101. num_history: 0,
  102. num_collection: 0,
  103. is_web3: 0
  104. },
  105. menu_list: []
  106. }
  107. },
  108. onLoad() {
  109. // if (this.$isWeb3 > 0) {
  110. // this.is_web3 = true;
  111. // } else {
  112. // this.is_web3 = false;
  113. // }
  114. // setTimeout(function() {
  115. // uni.setNavigationBarColor({
  116. // frontColor: '#ffffff',
  117. // backgroundColor: '#00000000',
  118. // animation: {
  119. // duration: 400,
  120. // timingFunc: 'easeIn'
  121. // }
  122. // })
  123. // }, 200);
  124. },
  125. onShow() {
  126. // this.loadAge();
  127. // this.loadData();
  128. // this.loadMenu();
  129. },
  130. methods: {
  131. onBack() {},
  132. chkSel() {
  133. if (this.sel == 1) {
  134. this.sel = 0;
  135. } else {
  136. this.sel = 1;
  137. }
  138. },
  139. goPage(page) {
  140. if (page == 'kefu') {
  141. let that = this;
  142. // #ifdef APP-PLUS
  143. plus.share.getServices(res => {
  144. const wechat = res.find(i => i.id === 'weixin')
  145. if (wechat) {
  146. wechat.openCustomerServiceChat({
  147. corpid: 'wwbc06aa8311b6ac08',
  148. // url: 'https://work.weixin.qq.com/kfid/kfc4b0bcb4038d00a50'
  149. url: that.myinfo.wxkf
  150. }, src => {
  151. console.log("success:")
  152. }, err => {
  153. console.log("error:")
  154. })
  155. } else {
  156. uni.showToast({
  157. title: '没有检测到微信,请先安装',
  158. icon: "error"
  159. });
  160. }
  161. });
  162. // #endif
  163. } else if (page != '') {
  164. uni.navigateTo({
  165. url: page,
  166. })
  167. }
  168. },
  169. loadData() {
  170. console.log({
  171. uuid: getApp().globalData.uuid,
  172. skey: getApp().globalData.skey
  173. });
  174. uni.request({
  175. url: this.$apiHost + '/Web/getinfo',
  176. data: {
  177. uuid: getApp().globalData.uuid,
  178. skey: getApp().globalData.skey
  179. },
  180. header: {
  181. "content-type": "application/json",
  182. 'sign': getApp().globalData.headerSign
  183. },
  184. success: (res) => {
  185. console.log("----:", res.data);
  186. if (res.data.need_login == "yes") {
  187. // getApp().globalData.skey = "";
  188. // getApp().globalData.uuid = "";
  189. uni.removeStorageSync("wapptoken");
  190. uni.redirectTo({
  191. url: '/pages/login/login'
  192. });
  193. return;
  194. }
  195. if (res.data.need_edit == "yes") {
  196. uni.navigateTo({
  197. url: '/pages/my/step'
  198. });
  199. return;
  200. }
  201. if (res.data.avator != "") {
  202. uni.setStorageSync("my_avator", res.data.avator);
  203. } else {
  204. uni.setStorageSync("my_avator", "/static/logo.png");
  205. }
  206. this.myinfo = res.data;
  207. },
  208. complete: (com) => {
  209. // uni.hideLoading();
  210. },
  211. fail: (e) => {
  212. console.log("----e:", e);
  213. }
  214. });
  215. },
  216. loadMenu() {
  217. console.log({
  218. uuid: getApp().globalData.uuid,
  219. skey: getApp().globalData.skey
  220. });
  221. uni.request({
  222. url: this.$apiHost + '/User/getinfo',
  223. data: {
  224. uuid: getApp().globalData.uuid,
  225. skey: getApp().globalData.skey
  226. },
  227. header: {
  228. "content-type": "application/json",
  229. 'sign': getApp().globalData.headerSign
  230. },
  231. success: (res) => {
  232. console.log("----:", res.data);
  233. if (res.data.need_login == "yes") {
  234. // getApp().globalData.skey = "";
  235. // getApp().globalData.uuid = "";
  236. uni.removeStorageSync("wapptoken");
  237. uni.redirectTo({
  238. url: '/pages/login/login'
  239. });
  240. return;
  241. }
  242. this.menu_list = res.data.list01;
  243. },
  244. complete: (com) => {
  245. // uni.hideLoading();
  246. },
  247. fail: (e) => {
  248. console.log("----e:", e);
  249. }
  250. });
  251. },
  252. onLogout() {
  253. let that = this;
  254. this.$refs['DialogBox'].confirm({
  255. title: '提示',
  256. content: '确定退出吗?',
  257. DialogType: 'inquiry',
  258. btn1: '取消',
  259. btn2: '退出',
  260. animation: 0
  261. }).then((res) => {
  262. uni.request({
  263. url: that.$apiHost + '/My/logout',
  264. data: {
  265. uuid: getApp().globalData.uuid,
  266. skey: getApp().globalData.skey
  267. },
  268. header: {
  269. "content-type": "application/json",
  270. 'sign': getApp().globalData.headerSign
  271. },
  272. success: (res) => {
  273. console.log("----:", res.data);
  274. // getApp().globalData.skey = "";
  275. // getApp().globalData.uuid = "";
  276. uni.removeStorageSync("wapptoken");
  277. uni.redirectTo({
  278. url: '/pages/login/login'
  279. })
  280. },
  281. complete: (com) => {
  282. // uni.hideLoading();
  283. },
  284. fail: (e) => {
  285. console.log("----e:", e);
  286. }
  287. });
  288. })
  289. },
  290. loadAge() {
  291. let that = this;
  292. uni.request({
  293. url: this.$apiHost + '/Member/checkAge',
  294. data: {
  295. uuid: getApp().globalData.uuid
  296. },
  297. header: {
  298. "content-type": "application/json",
  299. 'sign': getApp().globalData.headerSign
  300. },
  301. success: (res) => {
  302. console.log("----:", res.data);
  303. if (res.data.need_xiuxi == "yes") {
  304. uni.redirectTo({
  305. url: '/pages/AboutUs/xiuxi'
  306. });
  307. return;
  308. }
  309. if (res.data.need_show_yong == 'yes') {
  310. that.showYong = true;
  311. }
  312. },
  313. complete: (com) => {
  314. // uni.hideLoading();
  315. },
  316. fail: (e) => {
  317. console.log("----e:", e);
  318. }
  319. });
  320. },
  321. }
  322. }
  323. </script>
  324. <style scoped lang="scss">
  325. @import 'my.scss';
  326. </style>