my.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338
  1. <template>
  2. <view class="page">
  3. <view class="topBody">
  4. <view class="header">
  5. <view class="topBg"></view>
  6. <view class="top_num">
  7. <view class="num_1">
  8. <text>M币</text>
  9. <text>{{myinfo.num_gmd}}</text>
  10. </view>
  11. <view class="num_2">
  12. <text>彩豆</text>
  13. <text>{{myinfo.num_gmd}}</text>
  14. </view>
  15. </view>
  16. <view class="infoBg">
  17. <view class="top_row">
  18. <view class="left" @click="goPage('/pages/my/editInfo')">
  19. <image class="img" mode="aspectFill" :src="myinfo.avator"></image>
  20. </view>
  21. <view class="right" @click="goPage('/pages/my/editInfo')">
  22. <view class="nickname">
  23. <text>{{myinfo.nickname}}</text>
  24. <image src="../../static/icon/man.png" mode="widthFix" v-if="myinfo.sex_id == 1" />
  25. <image src="../../static/icon/man.png" mode="widthFix" v-else-if="myinfo.sex_id == 2" />
  26. <view class="level">Lv{{myinfo.my_level}}</view>
  27. </view>
  28. <view class="tags_list">
  29. <block v-for="(item,index) in aihao_tags">
  30. <uni-tag class="tag" type="primary" :inverted="false" :text="item" size="mini" />
  31. </block>
  32. </view>
  33. </view>
  34. </view>
  35. <view class="bottom_row">
  36. <view class="intro_row">
  37. <block v-if="myinfo.content == ''">
  38. <text class="intro_text">添加简介</text>
  39. <image src="../../static/icon/add.png" mode="widthFix" class="add_icon" />
  40. </block>
  41. <block v-else>
  42. <text class="intro_text">{{myinfo.content}}</text>
  43. </block>
  44. </view>
  45. <view class="follow_info">
  46. <text class="num">{{myinfo.num_attention}}</text>
  47. <text class="label">关注</text>
  48. <text class="separator"></text>
  49. <text class="num">{{myinfo.num_fans}}</text>
  50. <text class="label">粉丝</text>
  51. <text class="separator"></text>
  52. <text class="num">{{myinfo.num_like}}</text>
  53. <text class="label">获赞</text>
  54. </view>
  55. </view>
  56. </view>
  57. </view>
  58. <view class="whiteItem">
  59. <view class="btn">开启专属会员权益</view>
  60. </view>
  61. <view class="myinfo">
  62. <view class="line"></view>
  63. <view class="tablist">
  64. <view class="item" :class="{ active: activeTab === 0 }" @click="switchTab(0)">
  65. <view class="name">我的作品</view>
  66. </view>
  67. <view class="item" :class="{ active: activeTab === 1 }" @click="switchTab(1)">
  68. <view class="name">生成中</view>
  69. </view>
  70. </view>
  71. <view class="numlist2" style="margin-top: 60rpx;">
  72. <view class="item" v-for="(item,index) in data_list">
  73. <view class="num">
  74. <image class="icon" :src="item.url" mode="widthFix" />
  75. <view class="name">作品1号</view>
  76. </view>
  77. </view>
  78. </view>
  79. </view>
  80. <view class="blankHeight"></view>
  81. <view class="blankHeight"></view>
  82. </view>
  83. <!-- 提示框 -->
  84. <DialogBox ref="DialogBox"></DialogBox>
  85. <tabbar-view :tabbars="tabbars" :currentIndex="4" ref="tabbar"></tabbar-view>
  86. </view>
  87. </template>
  88. <script>
  89. import tabbarView from "@/components/tabbar/tabbar.vue";
  90. import tabbar from "@/mixins/tabbar";
  91. export default {
  92. components: {
  93. tabbarView,
  94. },
  95. mixins: [tabbar],
  96. data() {
  97. return {
  98. title: '',
  99. sel: 1,
  100. myinfo: {
  101. avator: '../../static/logo.png',
  102. nickname: '王思思',
  103. join_name: '注册日期:2024年5月',
  104. num_1: 0,
  105. num_2: 0,
  106. num_3: 0,
  107. num_4: 0,
  108. is_login: 'no',
  109. num_history: 0,
  110. num_collection: 0,
  111. },
  112. aihao_tags: [],
  113. menu_list: [],
  114. data_list: [{
  115. url: 'https://e.zhichao.art/AI_images/a_1112_10.png',
  116. },
  117. {
  118. url: 'https://e.zhichao.art/AI_images/a_1112_108.png',
  119. },
  120. {
  121. url: 'https://e.zhichao.art/AI_images/a_1112_113.png',
  122. },
  123. {
  124. url: 'https://e.zhichao.art/AI_images/a_1112_13.png',
  125. },
  126. {
  127. url: 'https://e.zhichao.art/AI_images/a_1112_137.png',
  128. },
  129. {
  130. url: 'https://e.zhichao.art/AI_images/a_1112_141.png',
  131. },
  132. {
  133. url: 'https://e.zhichao.art/AI_images/a_1114__562.png',
  134. },
  135. {
  136. url: 'https://e.zhichao.art/AI_images/a_1114__568.png',
  137. },
  138. {
  139. url: 'https://e.zhichao.art/AI_images/a_1114__569.png',
  140. },
  141. {
  142. url: 'https://e.zhichao.art/AI_images/a_1114__570.png',
  143. },
  144. {
  145. url: 'https://e.zhichao.art/AI_images/a_1114__571.png',
  146. },
  147. {
  148. url: 'https://e.zhichao.art/AI_images/a_1114__575.png',
  149. },
  150. ],
  151. activeTab: 0
  152. }
  153. },
  154. onLoad() {
  155. // setTimeout(function() {
  156. // uni.setNavigationBarColor({
  157. // frontColor: '#ffffff',
  158. // backgroundColor: '#00000000',
  159. // animation: {
  160. // duration: 400,
  161. // timingFunc: 'easeIn'
  162. // }
  163. // })
  164. // }, 200);
  165. },
  166. onShow() {
  167. // this.loadAge();
  168. // this.loadData();
  169. // this.loadMenu();
  170. this.loadInfo();
  171. },
  172. methods: {
  173. onBack() {},
  174. chkSel() {
  175. if (this.sel == 1) {
  176. this.sel = 0;
  177. } else {
  178. this.sel = 1;
  179. }
  180. },
  181. goPage(page) {
  182. if (page == 'kefu') {
  183. let that = this;
  184. // #ifdef APP-PLUS
  185. plus.share.getServices(res => {
  186. const wechat = res.find(i => i.id === 'weixin')
  187. if (wechat) {
  188. wechat.openCustomerServiceChat({
  189. corpid: 'wwbc06aa8311b6ac08',
  190. // url: 'https://work.weixin.qq.com/kfid/kfc4b0bcb4038d00a50'
  191. url: that.myinfo.wxkf
  192. }, src => {
  193. console.log("success:")
  194. }, err => {
  195. console.log("error:")
  196. })
  197. } else {
  198. uni.showToast({
  199. title: '没有检测到微信,请先安装',
  200. icon: "error"
  201. });
  202. }
  203. });
  204. // #endif
  205. } else if (page != '') {
  206. uni.navigateTo({
  207. url: page,
  208. })
  209. }
  210. },
  211. loadInfo() {
  212. console.log({
  213. uuid: getApp().globalData.uuid,
  214. skey: getApp().globalData.skey
  215. });
  216. uni.request({
  217. url: this.$apiHost + '/User/getinfo',
  218. data: {
  219. uuid: getApp().globalData.uuid,
  220. skey: getApp().globalData.skey
  221. },
  222. header: {
  223. "content-type": "application/json",
  224. 'sign': getApp().globalData.headerSign
  225. },
  226. success: (res) => {
  227. console.log("----:", res.data);
  228. if (res.data.need_login == "yes") {
  229. // getApp().globalData.skey = "";
  230. // getApp().globalData.uuid = "";
  231. // uni.removeStorageSync("wapptoken");
  232. // uni.redirectTo({
  233. // url: '/pages/login/login'
  234. // });
  235. // return;
  236. }
  237. if (res.data.aihao) {
  238. this.aihao_tags = res.data.aihao.split(",");
  239. }
  240. this.myinfo = res.data;
  241. },
  242. complete: (com) => {
  243. // uni.hideLoading();
  244. },
  245. fail: (e) => {
  246. console.log("----e:", e);
  247. }
  248. });
  249. },
  250. onLogout() {
  251. let that = this;
  252. this.$refs['DialogBox'].confirm({
  253. title: '提示',
  254. content: '确定退出吗?',
  255. DialogType: 'inquiry',
  256. btn1: '取消',
  257. btn2: '退出',
  258. animation: 0
  259. }).then((res) => {
  260. uni.request({
  261. url: that.$apiHost + '/My/logout',
  262. data: {
  263. uuid: getApp().globalData.uuid,
  264. skey: getApp().globalData.skey
  265. },
  266. header: {
  267. "content-type": "application/json",
  268. 'sign': getApp().globalData.headerSign
  269. },
  270. success: (res) => {
  271. console.log("----:", res.data);
  272. // getApp().globalData.skey = "";
  273. // getApp().globalData.uuid = "";
  274. uni.removeStorageSync("wapptoken");
  275. uni.redirectTo({
  276. url: '/pages/login/login'
  277. })
  278. },
  279. complete: (com) => {
  280. // uni.hideLoading();
  281. },
  282. fail: (e) => {
  283. console.log("----e:", e);
  284. }
  285. });
  286. })
  287. },
  288. switchTab(index) {
  289. this.activeTab = index;
  290. this.loadData();
  291. },
  292. loadData() {
  293. console.log({
  294. uuid: getApp().globalData.uuid,
  295. skey: getApp().globalData.skey
  296. });
  297. uni.request({
  298. url: this.$apiHost + '/My/getdata',
  299. data: {
  300. uuid: getApp().globalData.uuid,
  301. skey: getApp().globalData.skey
  302. },
  303. header: {
  304. "content-type": "application/json",
  305. 'sign': getApp().globalData.headerSign
  306. },
  307. success: (res) => {
  308. console.log("----:", res.data);
  309. if (res.data.success == 'yes') {
  310. }
  311. // this.myinfo = res.data;
  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>