user.vue 7.3 KB

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