index.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444
  1. <template>
  2. <view>
  3. <view class="user-info">
  4. <view class="left justify-start align-center">
  5. <!-- <view class="head-img">
  6. <image :src="user.avatar==null?'/static/images/detault_head.jpg':user.avatar" mode="aspectFill"></image>
  7. </view> -->
  8. <u-avatar :src="avatar" ></u-avatar>
  9. <view class="name-phone ml20">
  10. <view class="name">{{user.nickname?user.nickname:"游客01"}}</view>
  11. <!-- <view class="phone" v-if="user.phone!=''">{{utils.parsePhone(user.phone)}}</view> -->
  12. </view>
  13. </view>
  14. <view class="right">
  15. </view>
  16. </view>
  17. <view class="p20" style="margin-top: 40rpx" v-if="isOpen">
  18. <!-- <view class="p20" style="margin-top: 40rpx"> -->
  19. <view class="menu-box" style="margin-top: -40rpx">
  20. <view class="title-box">
  21. <image class="icon" :src="imgPath + '/app/manergevip/chang.png'"></image>
  22. <view class="title">常用功能</view>
  23. </view>
  24. <view class="line"></view>
  25. <view class="menus">
  26. <view class="menu-item" @click="navTo()">
  27. <image :src="imgPath + '/app/manergevip/chang.png'"></image>
  28. <view class="m-name">管理工具</view>
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. <view class="func-box" style="margin-top: 20rpx;">
  34. <view class="func-left-box btn-w">
  35. <button plain class="btn-ww" openType="share">
  36. <image src="/static/images/share.png"></image>
  37. <text>我要分享</text>
  38. </button>
  39. </view>
  40. <view class="rightArrow-box">
  41. <text></text>
  42. <image src="/static/images/rightArrow.png"></image>
  43. </view>
  44. </view>
  45. <view @tap="clearCache" class="func-box">
  46. <view class="func-left-box">
  47. <image src="/static/images/delete.png"></image>
  48. <text>清除缓存</text>
  49. </view>
  50. <view class="rightArrow-box">
  51. <image src="/static/images/rightArrow.png"></image>
  52. </view>
  53. </view>
  54. <view class="func-box bs" data-url="support">
  55. <view class="func-left-box">
  56. <image src="/static/images/about.png"></image>
  57. <text>关于</text>
  58. </view>
  59. <view class="rightArrow-box">
  60. <text>版本号 v{{ version }}</text>
  61. </view>
  62. </view>
  63. </view>
  64. </template>
  65. <script>
  66. import {queryIsTownOn} from "@/api/class.js";
  67. export default {
  68. data() {
  69. return {
  70. avatar:'',
  71. show:false,
  72. title:'提示',
  73. content:'确认退出吗?',
  74. usertoken:'',
  75. version:"1.0",
  76. isOpen:true
  77. }
  78. },
  79. computed: {
  80. imgPath() {
  81. return this.$store.state.imgpath
  82. }
  83. },
  84. mounted() {
  85. this.getCheckAppId();
  86. },
  87. onLoad() {
  88. const accountInfo = wx.getAccountInfoSync();
  89. this.version = accountInfo.miniProgram.version ;
  90. },
  91. methods: {
  92. openH5(type){
  93. uni.navigateTo({
  94. url:"/pages/user/userAgreement?type="+type
  95. })
  96. },
  97. clearCache: function () {
  98. uni.clearStorage();
  99. uni.showToast({
  100. title: '清理成功',
  101. icon: 'none',
  102. duration: 2000
  103. });
  104. },
  105. getCheckAppId() {
  106. console.error('获取AppID', uni.getAccountInfoSync());
  107. try {
  108. const accountInfo = uni.getAccountInfoSync();
  109. if(accountInfo && accountInfo.miniProgram) {
  110. let appId=accountInfo.miniProgram.appId;
  111. this.queryIsTownOn(appId)
  112. }
  113. } catch(e) {
  114. console.error('获取AppID失败', e);
  115. }
  116. },
  117. queryIsTownOn(appId){
  118. queryIsTownOn({"appId":appId}).then(res=>{
  119. if(res.date=="001"){
  120. this.isOpen=true;
  121. }else{
  122. //this.isOpen=false;
  123. }
  124. });
  125. },
  126. navTo(urls){
  127. if(!uni.getStorageSync('ManageToken')){
  128. uni.navigateTo({
  129. url:'/pages_manage/login'
  130. })
  131. }else{
  132. uni.navigateTo({
  133. url:'/pages_manage/index'
  134. })
  135. }
  136. },
  137. goToCourse(){
  138. uni.navigateTo({
  139. url:'/pages_course/video'
  140. })
  141. }
  142. }
  143. }
  144. </script>
  145. <style lang="scss" scoped>
  146. .menu-box {
  147. box-shadow: 0px 0px 5px 2px rgba(0, 0, 0, 0.05);
  148. width: 100%;
  149. margin-top: 30rpx;
  150. padding: 30rpx;
  151. background-color: #fff;
  152. border-radius: 15rpx;
  153. .title-box {
  154. display: flex;
  155. align-items: center;
  156. justify-content: flex-start;
  157. .icon {
  158. width: 40rpx;
  159. height: 40rpx;
  160. }
  161. .title {
  162. margin-left: 10rpx;
  163. font-size: 28rpx;
  164. font-family: PingFang SC;
  165. color: #111;
  166. }
  167. }
  168. .line {
  169. margin-top: 15rpx;
  170. height: 0.5rpx;
  171. width: 100%;
  172. background-color: #efefef;
  173. }
  174. .menus {
  175. margin-top: 30rpx;
  176. display: flex;
  177. align-items: center;
  178. justify-content: flex-start;
  179. flex-wrap: wrap;
  180. }
  181. .menu-item {
  182. display: flex;
  183. flex-direction: column;
  184. align-items: center;
  185. justify-content: center;
  186. width: 25%;
  187. margin-bottom: 20rpx;
  188. image {
  189. width: 60rpx;
  190. height: 60rpx;
  191. }
  192. .m-name {
  193. margin-top: 10rpx;
  194. font-size: 24rpx;
  195. font-family: PingFang SC;
  196. color: #111;
  197. }
  198. }
  199. }
  200. .user-info{
  201. padding: 40upx 30upx 0 30upx;
  202. display: flex;
  203. align-items: center;
  204. justify-content: space-between;
  205. .left{
  206. position: relative;
  207. display: flex;
  208. .head-img{
  209. width: 120upx;
  210. height: 120upx;
  211. border-radius: 50%;
  212. overflow: hidden;
  213. margin-right: 30upx;
  214. border: 4upx solid #FFFFFF;
  215. box-shadow: 0px 5px 15px 2px rgba(0,0,0,0.1);
  216. image{
  217. width: 100%;
  218. height: 100%;
  219. }
  220. }
  221. .name-phone{
  222. // padding-top: 15upx;
  223. .name{
  224. font-size: 40upx;
  225. font-family: PingFang SC;
  226. font-weight: bold;
  227. color: #111111;
  228. line-height: 1;
  229. }
  230. .phone{
  231. font-size: 28upx;
  232. font-family: PingFang SC;
  233. font-weight: 500;
  234. color: #666666;
  235. line-height: 1;
  236. margin-top: 30upx;
  237. }
  238. }
  239. }
  240. .right{
  241. display: flex;
  242. align-items: center;
  243. justify-content: center;
  244. .msg-box{
  245. margin-left: 10upx;
  246. width: 44upx;
  247. height: 44upx;
  248. image{
  249. width: 100%;
  250. height: 100%;
  251. }
  252. }
  253. .set{
  254. width: 44upx;
  255. height: 44upx;
  256. image{
  257. width: 100%;
  258. height: 100%;
  259. }
  260. }
  261. }
  262. }
  263. .used-tools{
  264. box-sizing: border-box;
  265. background: #FFFFFF;
  266. border-radius: 16upx;
  267. padding: 40upx 30upx;
  268. .title{
  269. font-size: 34upx;
  270. font-family: PingFang SC;
  271. font-weight: bold;
  272. color: #222222;
  273. line-height: 1;
  274. }
  275. .tools-list{
  276. margin-top: 50upx;
  277. display: flex;
  278. flex-wrap: wrap;
  279. width: 100%;
  280. .item{
  281. box-sizing: border-box;
  282. width: 25%;
  283. display: flex;
  284. flex-direction: column;
  285. align-items: center;
  286. justify-content: center;
  287. margin-bottom: 50upx;
  288. position: relative;
  289. image{
  290. width: 50upx;
  291. height: 50upx;
  292. }
  293. .text{
  294. font-size: 24upx;
  295. font-family: PingFang SC;
  296. font-weight: 500;
  297. color: #111111;
  298. line-height: 1;
  299. margin-top: 10upx;
  300. }
  301. .contact-btn{
  302. display: inline-block;
  303. position: absolute;
  304. top: 0;
  305. left: 0;
  306. width: 100%;
  307. height: 100%;
  308. opacity: 0;
  309. }
  310. }
  311. }
  312. }
  313. .func-box {
  314. box-sizing: border-box;
  315. width: 100%;
  316. padding: 30rpx 25rpx;
  317. background-color: #fff;
  318. }
  319. .func-box,
  320. .rightArrow-box {
  321. display: flex;
  322. flex-direction: row;
  323. justify-content: space-between;
  324. align-items: center;
  325. }
  326. .rightArrow-box image {
  327. width: 35rpx;
  328. height: 35rpx;
  329. }
  330. .rightArrow-box text {
  331. font-size: 26rpx;
  332. color: #5f5f5f;
  333. margin-right: 10rpx;
  334. }
  335. .func-left-box {
  336. display: flex;
  337. flex-direction: row;
  338. justify-content: space-between;
  339. align-items: center;
  340. padding: 0rpx;
  341. margin: 0rpx;
  342. height: 40rpx;
  343. }
  344. .func-left-box image {
  345. width: 35rpx;
  346. height: 35rpx;
  347. }
  348. .func-left-box text {
  349. font-size: 30rpx;
  350. color: #1b1b1b;
  351. margin-left: 20rpx;
  352. }
  353. .func-left-box button {
  354. border: none;
  355. background-color: #fff;
  356. display: flex;
  357. justify-content: center;
  358. align-items: center;
  359. padding: 0rpx;
  360. margin: 0rpx;
  361. }
  362. .btn-w {
  363. width: 80vw;
  364. }
  365. .btn-ww {
  366. width: 100%;
  367. text-align: left;
  368. display: flex !important;
  369. justify-content: flex-start !important;
  370. }
  371. .admin {
  372. background-color: #fff;
  373. box-shadow: 0rpx 2rpx 4rpx 0rpx rgba(0, 0, 0, 0.05);
  374. }
  375. .welcome {
  376. padding: 20rpx 25rpx;
  377. font-size: 26rpx;
  378. color: #1b1b1b;
  379. border-bottom: 1rpx solid #d6eaf7;
  380. }
  381. .func,
  382. .welcome {
  383. width: 100%;
  384. box-sizing: border-box;
  385. }
  386. .func {
  387. padding: 25rpx;
  388. display: flex;
  389. justify-content: flex-start;
  390. align-items: center;
  391. }
  392. .func-item {
  393. width: 25%;
  394. box-sizing: border-box;
  395. }
  396. .num {
  397. font-size: 40rpx;
  398. font-weight: 700;
  399. color: #3452e5;
  400. }
  401. .name,
  402. .num {
  403. width: 100%;
  404. text-align: center;
  405. }
  406. .name {
  407. margin-top: 10rpx;
  408. font-size: 26rpx;
  409. }
  410. .line {
  411. width: 100%;
  412. height: 20rpx;
  413. background-color: #f3f4f6;
  414. }
  415. .bs {
  416. box-shadow: 0rpx 2rpx 4rpx 0rpx rgba(0, 0, 0, 0.05);
  417. }
  418. </style>