my.vue 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  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="level" v-if="myinfo.lv">Lv.{{myinfo.lv}}</view>
  14. <view class="siming" v-if="myinfo.is_idcheck > 1">已实名</view>
  15. </view>
  16. <view class="join_date">
  17. {{myinfo.join_name}}
  18. <image src="../../static/me/arrow_right.png" mode="widthFix" />
  19. </view>
  20. </view>
  21. <view class="dashang" @click="chkSel">
  22. <block v-if="false">
  23. <view class="sel" v-if="sel == 1">
  24. <view class="name">关闭<br />打赏</view>
  25. <view class="block"></view>
  26. </view>
  27. <view class="selno" v-else>
  28. <view class="blockGray"></view>
  29. <view class="name">开启<br />打赏</view>
  30. </view>
  31. </block>
  32. </view>
  33. </view>
  34. </view>
  35. <view class="myinfo">
  36. <view class="line"></view>
  37. <view class="numlist">
  38. <view class="item" @click="goPage('/pages/my/recordList?type=GUO')">
  39. <view class="num">
  40. <text style="color:#FF2A95;">{{myinfo.num_gmd}}</text>
  41. <view class="name">我的糖果</view>
  42. </view>
  43. </view>
  44. <view class="item" @click="goPage('/pages/my/recordList?type=GMM')">
  45. <view class="num">
  46. <text>{{myinfo.num_gmm}}</text>
  47. <view class="name">我的M币</view>
  48. </view>
  49. </view>
  50. <view class="item" v-if="myinfo.is_web3 > 0">
  51. <view class="num" @click="goPage('/pages/w3/ucenter')">
  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. <tabbar-view :tabbars="tabbars" :currentIndex="4" ref="tabbar"></tabbar-view>
  78. </view>
  79. </template>
  80. <script>
  81. import tabbarView from "@/components/tabbar/tabbar.vue";
  82. import pageNavbar from "@/components/page-navbar/page-navbar.vue";
  83. import wWaterfall from "@/components/w-waterfall/w-waterfall.vue";
  84. import tabbar from "@/mixins/tabbar";
  85. export default {
  86. components: {
  87. tabbarView,
  88. },
  89. mixins: [tabbar],
  90. data() {
  91. return {
  92. title: '',
  93. sel: 1,
  94. myinfo: {
  95. nickname: '王思思',
  96. join_name: '注册日期:2024年5月',
  97. num_1: 0,
  98. num_2: 0,
  99. num_3: 0,
  100. num_4: 0,
  101. is_login: 'no',
  102. num_history: 0,
  103. num_collection: 0,
  104. is_web3: 0,
  105. lv: 1, // 添加等级字段
  106. },
  107. menu_list: []
  108. }
  109. },
  110. onLoad() {
  111. // if (this.$isWeb3 > 0) {
  112. // this.is_web3 = true;
  113. // } else {
  114. // this.is_web3 = false;
  115. // }
  116. // setTimeout(function() {
  117. // uni.setNavigationBarColor({
  118. // frontColor: '#ffffff',
  119. // backgroundColor: '#00000000',
  120. // animation: {
  121. // duration: 400,
  122. // timingFunc: 'easeIn'
  123. // }
  124. // })
  125. // }, 200);
  126. },
  127. onShow() {
  128. // this.loadAge();
  129. // this.loadData();
  130. // this.loadMenu();
  131. },
  132. methods: {
  133. onBack() {},
  134. chkSel() {
  135. if (this.sel == 1) {
  136. this.sel = 0;
  137. } else {
  138. this.sel = 1;
  139. }
  140. },
  141. goPage(page) {
  142. if (page == 'kefu') {
  143. let that = this;
  144. // #ifdef APP-PLUS
  145. plus.share.getServices(res => {
  146. const wechat = res.find(i => i.id === 'weixin')
  147. if (wechat) {
  148. wechat.openCustomerServiceChat({
  149. corpid: 'wwbc06aa8311b6ac08',
  150. // url: 'https://work.weixin.qq.com/kfid/kfc4b0bcb4038d00a50'
  151. url: that.myinfo.wxkf
  152. }, src => {
  153. console.log("success:")
  154. }, err => {
  155. console.log("error:")
  156. })
  157. } else {
  158. uni.showToast({
  159. title: '没有检测到微信,请先安装',
  160. icon: "error"
  161. });
  162. }
  163. });
  164. // #endif
  165. } else if (page != '') {
  166. uni.navigateTo({
  167. url: page,
  168. })
  169. }
  170. },
  171. loadData() {
  172. console.log({
  173. uuid: getApp().globalData.uuid,
  174. skey: getApp().globalData.skey
  175. });
  176. uni.request({
  177. url: this.$apiHost + '/Web/getinfo',
  178. data: {
  179. uuid: getApp().globalData.uuid,
  180. skey: getApp().globalData.skey
  181. },
  182. header: {
  183. "content-type": "application/json",
  184. 'sign': getApp().globalData.headerSign
  185. },
  186. success: (res) => {
  187. console.log("----:", res.data);
  188. if (res.data.need_login == "yes") {
  189. // getApp().globalData.skey = "";
  190. // getApp().globalData.uuid = "";
  191. uni.removeStorageSync("wapptoken");
  192. uni.redirectTo({
  193. url: '/pages/login/login'
  194. });
  195. return;
  196. }
  197. if (res.data.need_edit == "yes") {
  198. uni.navigateTo({
  199. url: '/pages/my/step'
  200. });
  201. return;
  202. }
  203. if (res.data.avator != "") {
  204. uni.setStorageSync("my_avator", res.data.avator);
  205. } else {
  206. uni.setStorageSync("my_avator", "/static/logo.png");
  207. }
  208. this.myinfo = res.data;
  209. },
  210. complete: (com) => {
  211. // uni.hideLoading();
  212. },
  213. fail: (e) => {
  214. console.log("----e:", e);
  215. }
  216. });
  217. },
  218. loadMenu() {
  219. console.log({
  220. uuid: getApp().globalData.uuid,
  221. skey: getApp().globalData.skey
  222. });
  223. uni.request({
  224. url: this.$apiHost + '/User/getinfo',
  225. data: {
  226. uuid: getApp().globalData.uuid,
  227. skey: getApp().globalData.skey
  228. },
  229. header: {
  230. "content-type": "application/json",
  231. 'sign': getApp().globalData.headerSign
  232. },
  233. success: (res) => {
  234. console.log("----:", res.data);
  235. if (res.data.need_login == "yes") {
  236. // getApp().globalData.skey = "";
  237. // getApp().globalData.uuid = "";
  238. uni.removeStorageSync("wapptoken");
  239. uni.redirectTo({
  240. url: '/pages/login/login'
  241. });
  242. return;
  243. }
  244. this.menu_list = res.data.list01;
  245. },
  246. complete: (com) => {
  247. // uni.hideLoading();
  248. },
  249. fail: (e) => {
  250. console.log("----e:", e);
  251. }
  252. });
  253. },
  254. onLogout() {
  255. let that = this;
  256. this.$refs['DialogBox'].confirm({
  257. title: '提示',
  258. content: '确定退出吗?',
  259. DialogType: 'inquiry',
  260. btn1: '取消',
  261. btn2: '退出',
  262. animation: 0
  263. }).then((res) => {
  264. uni.request({
  265. url: that.$apiHost + '/My/logout',
  266. data: {
  267. uuid: getApp().globalData.uuid,
  268. skey: getApp().globalData.skey
  269. },
  270. header: {
  271. "content-type": "application/json",
  272. 'sign': getApp().globalData.headerSign
  273. },
  274. success: (res) => {
  275. console.log("----:", res.data);
  276. // getApp().globalData.skey = "";
  277. // getApp().globalData.uuid = "";
  278. uni.removeStorageSync("wapptoken");
  279. uni.redirectTo({
  280. url: '/pages/login/login'
  281. })
  282. },
  283. complete: (com) => {
  284. // uni.hideLoading();
  285. },
  286. fail: (e) => {
  287. console.log("----e:", e);
  288. }
  289. });
  290. })
  291. },
  292. loadAge() {
  293. let that = this;
  294. uni.request({
  295. url: this.$apiHost + '/Member/checkAge',
  296. data: {
  297. uuid: getApp().globalData.uuid
  298. },
  299. header: {
  300. "content-type": "application/json",
  301. 'sign': getApp().globalData.headerSign
  302. },
  303. success: (res) => {
  304. console.log("----:", res.data);
  305. if (res.data.need_xiuxi == "yes") {
  306. uni.redirectTo({
  307. url: '/pages/AboutUs/xiuxi'
  308. });
  309. return;
  310. }
  311. if (res.data.need_show_yong == 'yes') {
  312. that.showYong = true;
  313. }
  314. },
  315. complete: (com) => {
  316. // uni.hideLoading();
  317. },
  318. fail: (e) => {
  319. console.log("----e:", e);
  320. }
  321. });
  322. },
  323. }
  324. }
  325. </script>
  326. <style scoped lang="scss">
  327. @import 'my.scss';
  328. </style>