user.vue 7.3 KB

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