user.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398
  1. <template>
  2. <view class="page-fill">
  3. <view class="headimg"></view>
  4. <view class="header">
  5. <view v-if="weixinUp" class="face3">
  6. <image :src="avatarUrl" class="face2"></image>
  7. </view>
  8. <view v-if="weixinDown">
  9. <image src="../../static/img/userimg.png" class="face"></image>
  10. </view>
  11. <view class="info-wapper">
  12. <view class="nickname">
  13. {{name}}
  14. </view>
  15. </view>
  16. <view class="tuichu">
  17. <button @tap="bindLogout" class="settings">
  18. <p class="p3">{{$t('user.bindLogout')}}</p>
  19. </button>
  20. </view>
  21. </view>
  22. <view class="">
  23. <uni-list>
  24. <!-- <view v-if="ifForeign">
  25. <view v-if="gid">
  26. <uni-list-item title="优惠码" @click="open()" />
  27. </view>
  28. </view> -->
  29. <view v-if="showRemote">
  30. <!-- <view v-if=""> 远程操作-->
  31. <uni-list-item :title="$t('user.remote')" @click="remote()" />
  32. <!-- </view> -->
  33. </view>
  34. <view v-if="show">
  35. <!-- <view v-if=""> -->
  36. <!-- <uni-list-item title="定时开关炉头" @click="time()" /> -->
  37. <!-- </view> -->
  38. </view>
  39. <view v-if="show">
  40. <uni-list-item :title="$t('user.equipmentname')" @click="updataName()" />
  41. </view>
  42. <view v-if="show">
  43. <uni-list-item :title="$t('user.equipmentlist')" @click="equipmentlist()" />
  44. </view>
  45. <view v-if="ifForeign">
  46. <uni-list-item title="退款" @click="refuse()" />
  47. </view>
  48. <view v-if="noticeShow">
  49. <uni-list-item title="编辑公告" @click="notice()" />
  50. </view>
  51. <view v-if="shenheShow">
  52. <uni-list-item title="审核" @click="examine()" />
  53. </view>
  54. </uni-list>
  55. </view>
  56. <view class="xiugai2">
  57. <button type="primary" @click="trant()" class="xiugai2">
  58. <p class="xiugai3">解除微信绑定</p>
  59. </button>
  60. </view>
  61. </view>
  62. </template>
  63. <script>
  64. import uniList from '@/components/uni-list/uni-list.vue'
  65. import uniListItem from '@/components/uni-list-item/uni-list-item.vue'
  66. import {
  67. mapState,
  68. mapActions,
  69. mapMutations
  70. } from 'vuex'
  71. export default {
  72. components: {
  73. uniList,
  74. uniListItem,
  75. },
  76. data() {
  77. return {
  78. name: '',
  79. show: false,
  80. noticeShow:false,
  81. shenheShow:false,
  82. showRemote: true,
  83. ifForeign: false,
  84. listName: [],
  85. value: null,
  86. id: null,
  87. gid: false,
  88. parm: {
  89. name: null,
  90. id: null
  91. },
  92. showOrNo: null,
  93. avatarUrl: null,
  94. weixinUp: false,
  95. open: '',
  96. weixinDown: true
  97. };
  98. },
  99. onPullDownRefresh() {
  100. setTimeout(function() {
  101. uni.stopPullDownRefresh();
  102. }, 800);
  103. },
  104. onShow() {
  105. uni.setNavigationBarTitle({
  106. title: this.$t('user.title')
  107. });
  108. uni.setTabBarItem({
  109. index: 4,
  110. text: this.$t('tabs.tab5')
  111. });
  112. // uni.startPullDownRefresh();
  113. var globalUser = uni.getStorageSync("globalUser");
  114. var gid = globalUser.id;
  115. var name = globalUser.name;
  116. if (gid != 1) {
  117. this.gid = true;
  118. this.show = true;
  119. if(gid==886){
  120. this.shenheShow = true;
  121. }
  122. }else{
  123. this.noticeShow = true;
  124. }
  125. var ifForeign = globalUser.ifForeign;
  126. if (ifForeign == 0) {
  127. this.ifForeign = true;
  128. }
  129. var token = uni.getStorageSync("token");
  130. if (token.length > 1) {
  131. this.open = globalUser.open;
  132. var name = uni.getStorageSync("name");
  133. this.name = name;
  134. var listName = uni.getStorageSync("listName");
  135. this.listName = listName;
  136. } else {
  137. uni.reLaunch({
  138. url: '../Login/Login',
  139. });
  140. }
  141. if (listName != '' && listName != null) {
  142. var adminId = listName[0].adminId;
  143. if (adminId != '1' && adminId != null) {
  144. this.show = true;
  145. }
  146. }
  147. var newparm = uni.getStorageSync("newparm");
  148. if (newparm.toString().length > 1) {
  149. if (newparm.avatarUrl.length > 1) {
  150. this.avatarUrl = newparm.avatarUrl;
  151. this.weixinUp = true;
  152. this.weixinDown = false;
  153. }
  154. }
  155. },
  156. onLoad() {
  157. },
  158. methods: {
  159. time() {
  160. uni.navigateTo({
  161. url: '../../packageA/pages/user/timeRule',
  162. });
  163. },
  164. remote() {
  165. uni.navigateTo({
  166. url:'../../packageA/pages/remote/remoteList',
  167. });
  168. },
  169. updataName() {
  170. uni.navigateTo({
  171. url: '../../packageA/pages/user/equipmentName',
  172. });
  173. },
  174. equipmentlist() {
  175. uni.navigateTo({
  176. url: '../../packageA/pages/equipmentStatus/equipmentlist',
  177. });
  178. },
  179. refuse(){
  180. uni.navigateTo({
  181. url: '../../packageA/pages/user/refuse',
  182. });
  183. },
  184. notice(){
  185. uni.navigateTo({
  186. url: '../../packageA/pages/user/editor/editor',
  187. });
  188. },
  189. examine(){
  190. uni.navigateTo({
  191. url: '../../packageA/pages/user/examine',
  192. });
  193. },
  194. trant() {
  195. uni.reLaunch({
  196. url: '../WeixinSwicth/WeixinSwicth',
  197. });
  198. },
  199. bindLogout() {
  200. //清楚缓存
  201. uni.clearStorageSync();
  202. uni.reLaunch({
  203. url: '/pages/Login/Login',
  204. });
  205. },
  206. setStyle() {
  207. this.showOrNo = "block";
  208. },
  209. setStyle2() {
  210. this.showOrNo = "none";
  211. },
  212. }
  213. }
  214. </script>
  215. <style>
  216. .page-fill {
  217. width: 100%;
  218. height: 100%;
  219. background: #FFFFFF;
  220. padding-bottom: 100upx;
  221. }
  222. .headimg {
  223. height: 120upx;
  224. background: #206DC3;
  225. width: 750upx;
  226. }
  227. .header {
  228. height: 160upx;
  229. width: 690upx;
  230. background: #FFFFFF;
  231. margin: auto;
  232. padding-top: 50upx;
  233. box-shadow: 0upx -1upx 20upx #D3D3D3;
  234. border-radius: 15upx;
  235. transform: translateY(-90upx);
  236. display: flex;
  237. flex-direction: row;
  238. justify-content: flex-start;
  239. }
  240. .face {
  241. width: 116upx;
  242. height: 116upx;
  243. padding-left: 30upx;
  244. border-radius: 50%;
  245. flex-shrink: 0;
  246. }
  247. .face2 {
  248. width: 120upx;
  249. height: 120upx;
  250. padding-right: 0upx;
  251. border-radius: 50%;
  252. flex-shrink: 0;
  253. }
  254. .face3 {
  255. width: 120upx;
  256. height: 120upx;
  257. padding-left: 30upx;
  258. padding-right: 0upx;
  259. border-radius: 50%;
  260. flex-shrink: 0;
  261. }
  262. .info-wapper {
  263. width: 50%;
  264. margin-left: 30upx;
  265. display: flex;
  266. flex-direction: column;
  267. }
  268. .nickname {
  269. color: #363D44;
  270. font-size: 16px;
  271. font-weight: 600;
  272. padding: 30upx 0upx 0upx 0upx;
  273. font-family: "PingFang-SC-Bold";
  274. }
  275. .set-wapper {
  276. display: flex;
  277. flex-direction: row;
  278. justify-content: flex-end;
  279. width: 15%;
  280. }
  281. .tuichu {
  282. width: 100upx;
  283. height: 64upx;
  284. padding-top: 30upx;
  285. text-align: center;
  286. margin: 0 auto;
  287. }
  288. .settings {
  289. width: 100upx;
  290. height: 64upx;
  291. border-radius: 10upx;
  292. background: #D6101F;
  293. text-align: center;
  294. margin: 0 auto;
  295. }
  296. .p3 {
  297. /* #ifdef H5 */
  298. top: -13%;
  299. /* #endif */
  300. font-size: 32upx;
  301. color: #FFFFFF;
  302. font-weight: bold;
  303. width: 100upx;
  304. height: 64upx;
  305. /* #ifndef H5 */
  306. padding-top: 3upx;
  307. /* #endif */
  308. position: absolute;
  309. /* 水平居中 */
  310. left: 50%;
  311. -webkit-transform: translateX(-50%);
  312. transform: translateX(-50%);
  313. }
  314. .centerY {
  315. position: absolute;
  316. top: 50%;
  317. -webkit-transform: translateY(-50%);
  318. transform: translateY(-50%);
  319. }
  320. .button2 {
  321. padding-right: 60upx;
  322. padding-top: 2upx;
  323. }
  324. .button {
  325. width: 80upx;
  326. height: 60upx;
  327. border-radius: 10upx;
  328. }
  329. .p {
  330. /* #ifdef H5 */
  331. top: -13%;
  332. /* #endif */
  333. width: 80upx;
  334. height: 60upx;
  335. font-size: 30upx;
  336. /* #ifndef H5 */
  337. padding-top: 3upx;
  338. /* #endif */
  339. position: absolute;
  340. /* 水平居中 */
  341. left: 50%;
  342. -webkit-transform: translateX(-50%);
  343. transform: translateX(-50%);
  344. }
  345. .xiugai2 {
  346. width: 100%;
  347. height: 80upx;
  348. font-family: "PingFang-SC-Bold";
  349. font-weight: bold;
  350. margin: auto;
  351. font-size: 50upx;
  352. color: #363D44;
  353. position: fixed;
  354. bottom: 0;
  355. }
  356. .xiugai3 {
  357. height: 80upx;
  358. font-family: "PingFang-SC-Bold";
  359. font-weight: bold;
  360. margin: auto;
  361. font-size: 40upx;
  362. color: #363D44;
  363. }
  364. .body {
  365. background-color: #FFFFFF;
  366. padding: 10upx 10upx 10upx 10upx;
  367. display: flex;
  368. flex-direction: row;
  369. justify-content: flex-start;
  370. }
  371. </style>