my.vue 8.8 KB

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