use.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <template>
  2. <view class="pages">
  3. <view class="hold-status-bar"><!-- 占据了状态栏位置 --></view>
  4. <view class="custom-nav">
  5. <view class="custom-nav-left" @click="$api.goback"><text class="iconfont icon-jiantou"></text></view>
  6. <view class="custom-nav-center"></view>
  7. </view>
  8. <view class="top-img"><image :src="$getimg + 'use-bg-s1.png'" class="img" mode="widthFix"></image></view>
  9. <view class="use-wrap" :class="{shortscreen:!isheight}">
  10. <view class="use-wrap-header">
  11. <view class="til">价值实现</view>
  12. <view class="subtil" @click="useClick">
  13. <text>关于价值实现</text>
  14. <text class="iconfont icon-jiantou"></text>
  15. </view>
  16. </view>
  17. <view class="use-item" @click="lvyue">
  18. <image :src="$getimg + 'icon-lvyue.png'" class="use-item-img" mode="scaleToFill"></image>
  19. <view class="use-item-til">碳履约</view>
  20. <view class="use-item-subtil">(仅履约企业)</view>
  21. </view>
  22. <view class="use-item" @click="zhonghe">
  23. <image :src="$getimg + 'icon-zhonghe.png'" class="use-item-img" mode="scaleToFill"></image>
  24. <view class="use-item-til">企业碳中和</view>
  25. </view>
  26. <view class="use-item" @click="huodong">
  27. <image :src="$getimg + 'icon-tanpuhui.png'" class="use-item-img" mode="scaleToFill"></image>
  28. <view class="use-item-til">大型活动碳中和</view>
  29. </view>
  30. <view class="use-item" @click="shangcheng">
  31. <image :src="$getimg + 'icon-huodong.png'" class="use-item-img" mode="scaleToFill"></image>
  32. <view class="use-item-til">普惠商城</view>
  33. </view>
  34. </view>
  35. <!-- 自定义tabBar -->
  36. <!-- <hans-tabber :list="list" style="position:fixed;bottom:0;width:100%;left:0;right:0;" @tabChange="tabChange"></hans-tabber> -->
  37. </view>
  38. </template>
  39. <script>
  40. import hansTabber from '../../components/hans-tabbar/hans-tabbar.vue';
  41. export default {
  42. components: {
  43. hansTabber
  44. },
  45. data() {
  46. return {
  47. list: [
  48. {
  49. text: '首页',
  50. iconPath: '/static/img/icon_home.png',
  51. selectedIconPath: '/static/img/icon_home_active.png'
  52. },
  53. {
  54. text: '价值实现',
  55. iconPath: '/static/img/icon_use.png',
  56. selectedIconPath: '/static/img/icon_use_active.png'
  57. },
  58. {
  59. text: '我的信息',
  60. iconPath: '/static/img/icon_usercenter.png',
  61. selectedIconPath: '/static/img/icon_usercenter_active.png'
  62. }
  63. ],
  64. $getimg: this.$getimg,
  65. token: '',
  66. params: {},
  67. isheight:false,
  68. };
  69. },
  70. onShow() {
  71. let self = this;
  72. //判断用户类别
  73. // uni.getStorage({
  74. // key: 'userInfo',
  75. // success: function(res) {
  76. // console.log('userInfo customerType', res.data.customerType);
  77. // if (res.data.customerType == '1') {
  78. // console.log('个人用户');
  79. // self.$api.href('/pages/mall/mall');
  80. // }
  81. // }
  82. // });
  83. },
  84. onLoad() {
  85. let self = this;
  86. uni.getSystemInfo({
  87. success: function (res) {
  88. console.log('getSystemInfo',res);
  89. let windowscale = res.windowHeight/res.screenWidth;//屏幕高宽比
  90. if(res.screenHeight>800){
  91. self.isheight = true;
  92. }
  93. }
  94. });
  95. },
  96. methods: {
  97. lvyue() {
  98. this.checkReject();
  99. },
  100. zhonghe() {
  101. this.checkReject();
  102. },
  103. huodong() {
  104. this.checkReject();
  105. },
  106. useClick() {
  107. this.$api.href('/pages/usercenter/question/question');
  108. // this.$api.msg('稍后展示')
  109. },
  110. shangcheng(){
  111. this.checkReject();
  112. },
  113. tabChange(index) {
  114. console.log(index);
  115. switch (index) {
  116. case 0:
  117. uni.switchTab({
  118. url: '../index/index'
  119. });
  120. break;
  121. case 1:
  122. return;
  123. break;
  124. case 2:
  125. uni.switchTab({
  126. url: '../usercenter/usercenter'
  127. });
  128. break;
  129. default:
  130. return;
  131. }
  132. },
  133. checkReject(){
  134. if(!this.$store.state.hasLogin){
  135. this.$api.msg('请先登录');
  136. setTimeout(i=>{
  137. uni.navigateTo({
  138. url: '/pages/login/loginType',
  139. fail:function(err){
  140. console.log(err)
  141. }
  142. });
  143. },2000);
  144. return;
  145. }else{
  146. this.$api.msg('你没有权限使用该功能!');
  147. };
  148. }
  149. }
  150. };
  151. </script>
  152. <style>
  153. @import url('./use.css');
  154. </style>