user.vue 7.7 KB

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