index.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438
  1. <template>
  2. <view>
  3. <view class="user-info">
  4. <view class="left justify-start align-center" @click="openPersonInfo()">
  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:false
  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. }
  138. }
  139. </script>
  140. <style lang="scss" scoped>
  141. .menu-box {
  142. box-shadow: 0px 0px 5px 2px rgba(0, 0, 0, 0.05);
  143. width: 100%;
  144. margin-top: 30rpx;
  145. padding: 30rpx;
  146. background-color: #fff;
  147. border-radius: 15rpx;
  148. .title-box {
  149. display: flex;
  150. align-items: center;
  151. justify-content: flex-start;
  152. .icon {
  153. width: 40rpx;
  154. height: 40rpx;
  155. }
  156. .title {
  157. margin-left: 10rpx;
  158. font-size: 28rpx;
  159. font-family: PingFang SC;
  160. color: #111;
  161. }
  162. }
  163. .line {
  164. margin-top: 15rpx;
  165. height: 0.5rpx;
  166. width: 100%;
  167. background-color: #efefef;
  168. }
  169. .menus {
  170. margin-top: 30rpx;
  171. display: flex;
  172. align-items: center;
  173. justify-content: flex-start;
  174. flex-wrap: wrap;
  175. }
  176. .menu-item {
  177. display: flex;
  178. flex-direction: column;
  179. align-items: center;
  180. justify-content: center;
  181. width: 25%;
  182. margin-bottom: 20rpx;
  183. image {
  184. width: 60rpx;
  185. height: 60rpx;
  186. }
  187. .m-name {
  188. margin-top: 10rpx;
  189. font-size: 24rpx;
  190. font-family: PingFang SC;
  191. color: #111;
  192. }
  193. }
  194. }
  195. .user-info{
  196. padding: 40upx 30upx 0 30upx;
  197. display: flex;
  198. align-items: center;
  199. justify-content: space-between;
  200. .left{
  201. position: relative;
  202. display: flex;
  203. .head-img{
  204. width: 120upx;
  205. height: 120upx;
  206. border-radius: 50%;
  207. overflow: hidden;
  208. margin-right: 30upx;
  209. border: 4upx solid #FFFFFF;
  210. box-shadow: 0px 5px 15px 2px rgba(0,0,0,0.1);
  211. image{
  212. width: 100%;
  213. height: 100%;
  214. }
  215. }
  216. .name-phone{
  217. // padding-top: 15upx;
  218. .name{
  219. font-size: 40upx;
  220. font-family: PingFang SC;
  221. font-weight: bold;
  222. color: #111111;
  223. line-height: 1;
  224. }
  225. .phone{
  226. font-size: 28upx;
  227. font-family: PingFang SC;
  228. font-weight: 500;
  229. color: #666666;
  230. line-height: 1;
  231. margin-top: 30upx;
  232. }
  233. }
  234. }
  235. .right{
  236. display: flex;
  237. align-items: center;
  238. justify-content: center;
  239. .msg-box{
  240. margin-left: 10upx;
  241. width: 44upx;
  242. height: 44upx;
  243. image{
  244. width: 100%;
  245. height: 100%;
  246. }
  247. }
  248. .set{
  249. width: 44upx;
  250. height: 44upx;
  251. image{
  252. width: 100%;
  253. height: 100%;
  254. }
  255. }
  256. }
  257. }
  258. .used-tools{
  259. box-sizing: border-box;
  260. background: #FFFFFF;
  261. border-radius: 16upx;
  262. padding: 40upx 30upx;
  263. .title{
  264. font-size: 34upx;
  265. font-family: PingFang SC;
  266. font-weight: bold;
  267. color: #222222;
  268. line-height: 1;
  269. }
  270. .tools-list{
  271. margin-top: 50upx;
  272. display: flex;
  273. flex-wrap: wrap;
  274. width: 100%;
  275. .item{
  276. box-sizing: border-box;
  277. width: 25%;
  278. display: flex;
  279. flex-direction: column;
  280. align-items: center;
  281. justify-content: center;
  282. margin-bottom: 50upx;
  283. position: relative;
  284. image{
  285. width: 50upx;
  286. height: 50upx;
  287. }
  288. .text{
  289. font-size: 24upx;
  290. font-family: PingFang SC;
  291. font-weight: 500;
  292. color: #111111;
  293. line-height: 1;
  294. margin-top: 10upx;
  295. }
  296. .contact-btn{
  297. display: inline-block;
  298. position: absolute;
  299. top: 0;
  300. left: 0;
  301. width: 100%;
  302. height: 100%;
  303. opacity: 0;
  304. }
  305. }
  306. }
  307. }
  308. .func-box {
  309. box-sizing: border-box;
  310. width: 100%;
  311. padding: 30rpx 25rpx;
  312. background-color: #fff;
  313. }
  314. .func-box,
  315. .rightArrow-box {
  316. display: flex;
  317. flex-direction: row;
  318. justify-content: space-between;
  319. align-items: center;
  320. }
  321. .rightArrow-box image {
  322. width: 35rpx;
  323. height: 35rpx;
  324. }
  325. .rightArrow-box text {
  326. font-size: 26rpx;
  327. color: #5f5f5f;
  328. margin-right: 10rpx;
  329. }
  330. .func-left-box {
  331. display: flex;
  332. flex-direction: row;
  333. justify-content: space-between;
  334. align-items: center;
  335. padding: 0rpx;
  336. margin: 0rpx;
  337. height: 40rpx;
  338. }
  339. .func-left-box image {
  340. width: 35rpx;
  341. height: 35rpx;
  342. }
  343. .func-left-box text {
  344. font-size: 30rpx;
  345. color: #1b1b1b;
  346. margin-left: 20rpx;
  347. }
  348. .func-left-box button {
  349. border: none;
  350. background-color: #fff;
  351. display: flex;
  352. justify-content: center;
  353. align-items: center;
  354. padding: 0rpx;
  355. margin: 0rpx;
  356. }
  357. .btn-w {
  358. width: 80vw;
  359. }
  360. .btn-ww {
  361. width: 100%;
  362. text-align: left;
  363. display: flex !important;
  364. justify-content: flex-start !important;
  365. }
  366. .admin {
  367. background-color: #fff;
  368. box-shadow: 0rpx 2rpx 4rpx 0rpx rgba(0, 0, 0, 0.05);
  369. }
  370. .welcome {
  371. padding: 20rpx 25rpx;
  372. font-size: 26rpx;
  373. color: #1b1b1b;
  374. border-bottom: 1rpx solid #d6eaf7;
  375. }
  376. .func,
  377. .welcome {
  378. width: 100%;
  379. box-sizing: border-box;
  380. }
  381. .func {
  382. padding: 25rpx;
  383. display: flex;
  384. justify-content: flex-start;
  385. align-items: center;
  386. }
  387. .func-item {
  388. width: 25%;
  389. box-sizing: border-box;
  390. }
  391. .num {
  392. font-size: 40rpx;
  393. font-weight: 700;
  394. color: #3452e5;
  395. }
  396. .name,
  397. .num {
  398. width: 100%;
  399. text-align: center;
  400. }
  401. .name {
  402. margin-top: 10rpx;
  403. font-size: 26rpx;
  404. }
  405. .line {
  406. width: 100%;
  407. height: 20rpx;
  408. background-color: #f3f4f6;
  409. }
  410. .bs {
  411. box-shadow: 0rpx 2rpx 4rpx 0rpx rgba(0, 0, 0, 0.05);
  412. }
  413. </style>