index.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510
  1. <template>
  2. <!-- <view class="mine-container" :style="'background: url('+this.imgUrl+'/index/mingbg.png) no-repeat 100% 100%;height:'+windowHeight+'px;background-position: 0 0;background-size: 100% 100%;'">
  3. <view style="position: fixed;right: 10px;z-index: 999999;top:30px" @click="changeLocale">
  4. {{ $t('login.language') }}:{{localeConfig[locale]}}<uni-icons type="gear" size="15"></uni-icons>
  5. </view> -->
  6. <view class="mine-container">
  7. <view style=" margin-top: -1vh;
  8. place-items: center;
  9. display: flex;
  10. flex-direction: row;
  11. justify-content: space-around;
  12. height: 7vh;
  13. width: 100vw;
  14. background-color: #25282A;">
  15. <image style="height: 3vh;width: 35vw;margin-left: 25vw;"
  16. src="../../static/images/new/starts/login/backImg2.png"></image>
  17. <text @click="clickRight()" style="font-size: 15px;font-weight: bold;z-index: 9999;height: 3vh;"><uni-icons
  18. v-show="!show" style="color: #ffffff;" size="30" type="more-filled"></uni-icons><uni-icons size="30"
  19. v-show="show" style="color: #57B03D;" type="more-filled"></uni-icons></text>
  20. <!-- <view >
  21. <u-popup :show="show" mode="right" customStyle="top:14vh;" :overlayOpacity="0" :closeOnClickOverlay="true" :zIndex="1" ref="showRight" :overlay="false" >
  22. </u-popup>
  23. </view> -->
  24. </view>
  25. <view style=";margin-top: 0vh;position: relative;" v-if="show">
  26. <view style="width: 100vw;height: 70vh;background: black;" v-if="aboutShow==false && helpShow==false">
  27. <scroll-view style="background: linear-gradient(#161616, #000000);font-size: 20px;" scroll-y="true">
  28. <view class="prop-item" @click="handleLogout()">
  29. <!-- <view class="prop-item-image">
  30. <image :src="imgUrl+'/logout.png'" style="width: 30%;height:100%;" />
  31. </view> -->
  32. <view class="prop-item-right">{{i18('退出登录')}}</view>
  33. <view class="prop-item-left">
  34. <!-- <uni-icons type="forward" color="lightgray" size="16"></uni-icons> -->
  35. </view>
  36. </view>
  37. <u-divider />
  38. <view class="prop-item" @click="skipPage(3)">
  39. <!-- <view class="prop-item-image">
  40. <image :src="imgUrl+'/logout.png'" style="width: 30%;height:100%;" />
  41. </view> -->
  42. <view class="prop-item-right">{{i18('关于我们')}}</view>
  43. <view class="prop-item-left">
  44. <!-- <uni-icons type="forward" color="lightgray" size="16"></uni-icons> -->
  45. </view>
  46. </view>
  47. <u-divider />
  48. <view class="prop-item" @click="skipPage(4)">
  49. <!-- <view class="prop-item-image">
  50. <image :src="imgUrl+'/logout.png'" style="width: 30%;height:100%;" />
  51. </view> -->
  52. <view class="prop-item-right">{{i18('帮助')}}</view>
  53. <view class="prop-item-left">
  54. <!-- <uni-icons type="forward" color="lightgray" size="16"></uni-icons> -->
  55. </view>
  56. </view>
  57. <u-divider />
  58. </scroll-view>
  59. <view style="position: absolute;bottom: 0;left:5px;color: #b8b8bb">Version:1.10</view>
  60. <view @click="handleToEditInfo" style="position: absolute;bottom: 0 ;right: 5px;color: #b8b8bb">Delete Account</view>
  61. </view>
  62. <view v-if="aboutShow==true && show==true && helpShow==false" style="width: 100vw;">
  63. <scroll-view style="background: linear-gradient(#161616, #000000);font-size: 16px;color: aliceblue;"
  64. scroll-y="true">
  65. <!-- 关于我们 -->
  66. <view class="textMsg">
  67. <view style="font-size: 20px;font-weight:bold; margin-bottom: 3vh;">About Us</view>
  68. <view style="font-size: 18px;font-weight:bold">Welcome to techtron®</view>
  69. <view style="color: #d8d8d8;">we combine passion, drive and intellect
  70. </view><view style="color: #d8d8d8;">with market leading research and
  71. </view><view style="color: #d8d8d8;;margin-bottom: 2vh;">cutting-edge technology.</view>
  72. <view style="color: #d8d8d8">We innovate and deliver premium quality
  73. </view><view style="color: #d8d8d8;">products that excite, inspire and challenge
  74. </view><view style="color: #d8d8d8;margin-bottom: 2vh;">the sector.</view>
  75. <view style="font-size: 18px;font-weight:bold;">We are focused on reducing our</view>
  76. <view style="font-size: 18px;font-weight:bold;">environmental impact, whilst improving</view>
  77. <view style="font-size: 18px;font-weight:bold;">the Health & Wellbeing of our</view>
  78. <view style="font-size: 18px;font-weight:bold;margin-bottom: 2vh;">customers.</view>
  79. </view>
  80. </scroll-view>
  81. </view>
  82. <view v-if="helpShow==true&& show==true && aboutShow==false" style="width: 100vw;">
  83. <scroll-view style="background: linear-gradient(#161616, #000000);font-size: 16px;color: aliceblue;"
  84. scroll-y="true">
  85. <!-- 帮助 -->
  86. <view class="textMsg">
  87. <view style="margin-bottom: 3vh;font-size: 20px;font-weight:bold;">Help</view>
  88. <view style="color: #d8d8d8;">Visit the<span style=" font-weight: 600;color: aliceblue;margin: 0 4px;"> techtron® </span> website
  89. </view><view style="color: #d8d8d8;">where you will find product user manuals,
  90. informative blogs, video guides and a
  91. </view><view style="color: #d8d8d8;">questions and answers section regarding
  92. </view><view style="color: #d8d8d8;">the most common issues. If you cannot
  93. </view><view style="color: #d8d8d8;">resolve your problem here, e-mail our
  94. </view><view style="color: #d8d8d8;">customer services on the techtron® website
  95. </view><view style="color: #d8d8d8;margin-bottom: 2vh;">customer contact page.</view>
  96. <view style="font-size: 18px;font-weight:bold;">www.techtron.co</view>
  97. </view>
  98. </scroll-view>
  99. </view>
  100. </view>
  101. <!-- <u-divider style="margin-top: 15vh;border-width: 5px;"></u-divider> -->
  102. <view style=";margin-top: 10vh;" v-else>
  103. <view
  104. style=";margin-top: 10vh;justify-content: center;align-items: center;justify-content: center;display: grid;align-content: center;justify-items: center;line-height: 50px;">
  105. <image :src="avatar" class="cu-avatar xl round" mode="widthFix" style="margin-top: 5vh;">
  106. <!-- <image v-if="avatar" :src="avatar" class="cu-avatar xl round" mode="widthFix"> -->
  107. <!--</image>
  108. <view >
  109. <image style="width: 40rpx;height: 40rpx;" src="../../static/images/new/starts/mine/start_light.png"></image>
  110. <image style="width: 40rpx;height: 40rpx;" src="../../static/images/new/starts/mine/start_light.png"></image>
  111. <image style="width: 40rpx;height: 40rpx;" src="../../static/images/new/starts/mine/start_light.png"></image>
  112. <image style="width: 40rpx;height: 40rpx;" src="../../static/images/new/starts/mine/start_light.png"></image>
  113. <image style="width: 40rpx;height: 40rpx;" src="../../static/images/new/starts/mine/start.png"></image>
  114. </view> -->
  115. <view style="color: #d0d0d0;font-weight: bold;font-size: 15px;">
  116. {{ name }}
  117. </view>
  118. </view>
  119. <view class="menu-list" style="width: 100vw;line-height: 40px;">
  120. <u-divider style=";width: 100vw;" />
  121. <view class="list-cell list-cell-arrow" @click="handleToEditInfo">
  122. <view class="menu-item-box">
  123. <image :src="this.imgUrl+'/mine/symbol.png'" style="width: 18px;height: 18px;"></image>
  124. <view class="menu-text"> {{ i18('账户设置')}}</view>
  125. </view>
  126. </view>
  127. <view class="list-cell list-cell-arrow" @click="handleAbout">
  128. <view class="menu-item-box">
  129. <image :src="this.imgUrl+'/mine/record.png'" style="width: 18px;height: 18px;"></image>
  130. <view class="menu-text">{{ i18('充电记录')}}</view>
  131. </view>
  132. </view>
  133. <view class="list-cell list-cell-arrow" @click="handleToSetting">
  134. <view class="menu-item-box">
  135. <image :src="this.imgUrl+'/mine/symbol (1).png'" style="width: 18px;height: 18px;"></image>
  136. <view class="menu-text">{{ i18('预约记录')}}</view>
  137. </view>
  138. </view>
  139. </view>
  140. </view>
  141. <view
  142. style="position:fixed;bottom:10px;display: flex;align-items: center;justify-content: center;text-align: center;left:0px;right:0px;">
  143. <!-- <image style="height: 3vh;width: 35vw;position: absolute;bottom: 13vh;left: 32.5vw;" src="../../static/images/new/starts/login/backImg2.png"></image> -->
  144. <view @click="skipPage(0)" style="margin:0px 10px;">
  145. <image src="@/static/images/new/starts/tabbar/one_off.png"
  146. style="width: 60px;height: 60px;margin: 2vh 0.2vh;"></image>
  147. </view>
  148. <view @click="skipPage(1)" style="margin:0px 10px;">
  149. <image src="@/static/images/new/starts/tabbar/two_off.png"
  150. style="width: 60px;height: 60px;margin: 2vh 0.2vh;"></image>
  151. </view>
  152. <view @click="skipPage(2)" style="margin:0px 10px;">
  153. <image src="@/static/images/new/starts/tabbar/three_on.png"
  154. style="width: 60px;height: 60px;margin: 2vh 0.2vh;"></image>
  155. </view>
  156. </view>
  157. <!--顶部个人信息栏-->
  158. <!-- <view class="header-section">
  159. <view class="flex padding justify-between">
  160. <view class="flex align-center">
  161. <view v-if="!avatar" class="cu-avatar xl round bg-white">
  162. <view class="iconfont icon-people text-gray icon"></view>
  163. </view>
  164. <image v-if="avatar" @click="handleToAvatar" :src="avatar" class="cu-avatar xl round" mode="widthFix">
  165. </image>
  166. <view v-if="!name" @click="handleToLogin" class="login-tip">
  167. {{ i18('点击登录')}}
  168. </view>
  169. <view v-if="name" @click="handleToInfo" class="user-info">
  170. <view class="u_title" style="color: #8E8E8E">
  171. {{ i18('你好')}}!
  172. </view>
  173. <view class="u_title">
  174. {{ name }}
  175. </view>
  176. </view>
  177. </view>
  178. </view>
  179. </view>
  180. <view class="menu-list">
  181. <view class="list-cell list-cell-arrow" @click="handleToEditInfo">
  182. <view class="menu-item-box">
  183. <image :src="this.imgUrl+'/index/settingicon.png'" style="width: 18px;height: 18px;margin-right:5px"></image>
  184. <view class="menu-text"> {{ i18('账户设置')}}</view>
  185. </view>
  186. </view>
  187. <view class="list-cell list-cell-arrow" @click="handleAbout">
  188. <view class="menu-item-box">
  189. <image :src="this.imgUrl+'/index/chargeicon.png'" style="width: 18px;height: 18px;margin-right:5px"></image>
  190. <view class="menu-text">{{ i18('充电记录')}}</view>
  191. </view>
  192. </view>
  193. <view class="list-cell list-cell-arrow" @click="handleToSetting">
  194. <view class="menu-item-box">
  195. <image :src="this.imgUrl+'/index/planicon.png'" style="width: 18px;height: 18px;margin-right:5px"></image>
  196. <view class="menu-text">{{ i18('预约记录')}}</view>
  197. </view>
  198. </view>
  199. </view> -->
  200. <u-picker @cancel="cancelLocale" :confirmText="i18('确认')" :cancelText="i18('取消')" :show="showLocale"
  201. keyName="label" :columns="localeList" @confirm="changeLanguage"></u-picker>
  202. </view>
  203. </template>
  204. <script>
  205. import storage from '@/utils/storage'
  206. import i18 from '@/utils/i18.js'
  207. export default {
  208. data() {
  209. return {
  210. showLocale: false,
  211. locale: "",
  212. localeList: [
  213. [{
  214. "label": "简体中文",
  215. "id": "zh-Hans"
  216. }, {
  217. "label": "英文",
  218. "id": "en"
  219. }]
  220. ],
  221. localeConfig: {
  222. "zh-Hans": "简体中文",
  223. "en": "英文"
  224. },
  225. name: this.$store.state.user.name,
  226. version: getApp().globalData.config.appInfo.version,
  227. imgUrl: getApp().globalData.config.imgUrl,
  228. clickRightTag: 0,
  229. show: false,
  230. aboutShow: false,
  231. helpShow: false
  232. }
  233. },
  234. computed: {
  235. avatar() {
  236. console.log(JSON.stringify(this.$store.state.user))
  237. if (this.$store.state.user.avatar == null || this.$store.state.user.avatar == '') {
  238. return getApp().globalData.config.imgUrl + "/index/user.png"
  239. } else {
  240. return this.$store.state.user.avatar
  241. }
  242. },
  243. windowHeight() {
  244. return uni.getSystemInfoSync().windowHeight - 50
  245. }
  246. },
  247. onLoad() {
  248. this.setLocale();
  249. },
  250. onShow() {
  251. // uni.setNavigationBarTitle({
  252. // title: this.$t('page.mine')
  253. // })
  254. },
  255. methods: {
  256. skipPage(type) {
  257. if (type == 0) {
  258. uni.reLaunch({
  259. url: '/pages/index'
  260. })
  261. } else if (type == 1) {
  262. uni.reLaunch({
  263. url: '/pages/weitiandi/deviceList'
  264. })
  265. } else if (type == 2) {
  266. uni.reLaunch({
  267. url: '/pages/mine/index'
  268. })
  269. } else if (type == 3) {
  270. //关于我们
  271. this.aboutShow = true;
  272. } else if (type == 4) {
  273. //帮助
  274. this.helpShow = true
  275. }
  276. },
  277. skip() {
  278. this.$modal.showToast("功能开发中..");
  279. },
  280. handleLogout() {
  281. this.$modal.confirm('确定注销并退出系统吗?').then(() => {
  282. this.$store.dispatch('LogOut').then(() => {
  283. uni.setStorageSync("loginInfo", '');
  284. this.$tab.reLaunch('/pages/index')
  285. })
  286. })
  287. },
  288. changeDrawer(event) {
  289. if (event) {
  290. // 抽屉打开时的逻辑
  291. this.clickRightTag = 1
  292. } else {
  293. // 抽屉关闭时的逻辑
  294. this.clickRightTag = 0
  295. }
  296. },
  297. //自定义头右操作函数
  298. clickRight() {
  299. //打开抽屉
  300. this.show = !this.show
  301. this.aboutShow = false,
  302. this.helpShow = false
  303. // if (this.clickRightTag == 0) {
  304. // this.$refs.showRight.open();
  305. // this.clickRightTag = 1
  306. // } else {
  307. // this.$refs.showRight.close()
  308. // this.clickRightTag = 0
  309. // }
  310. },
  311. cancelLocale() {
  312. this.showLocale = false;
  313. },
  314. changeLanguage(e) {
  315. this.showLocale = false;
  316. console.log(e.value[0].id)
  317. uni.setLocale(e.value[0].id);
  318. },
  319. changeLocale() {
  320. this.showLocale = true;
  321. },
  322. setLocale() {
  323. this.locale = uni.getLocale()
  324. if (this.locale == "en") {
  325. this.localeList = [
  326. [{
  327. "label": "Chinese",
  328. "id": "zh-Hans"
  329. }, {
  330. "label": "English",
  331. "id": "en"
  332. }]
  333. ];
  334. this.localeConfig = {
  335. "zh-Hans": "Chinese",
  336. "en": "English"
  337. };
  338. } else if (this.locale == "zh-Hans") {
  339. this.localeList = [
  340. [{
  341. "label": "简体中文",
  342. "id": "zh-Hans"
  343. }, {
  344. "label": "英文",
  345. "id": "en"
  346. }]
  347. ];
  348. this.localeConfig = {
  349. "zh-Hans": "简体中文",
  350. "en": "英文"
  351. };
  352. }
  353. },
  354. i18(text) {
  355. return i18(text)
  356. },
  357. handleToEditInfo() {
  358. this.$tab.navigateTo('/pages/mine/pwd/index')
  359. },
  360. handleToSetting() {
  361. this.$tab.navigateTo('/pages/weitiandi/device/planrecord')
  362. },
  363. handleToLogin() {
  364. this.$tab.reLaunch('/pages/login')
  365. },
  366. handleAbout() {
  367. this.$tab.navigateTo('/pages/weitiandi/device/chargerecord')
  368. },
  369. }
  370. }
  371. </script>
  372. <style lang="scss">
  373. page {
  374. // background-color: #000000;
  375. background-color: #000000;
  376. background-image: url('../../static/images/new/starts/bg2.jpg');
  377. background-size: cover;
  378. background-repeat: no-repeat;
  379. }
  380. .mine-container {
  381. // width: 100%;
  382. // height: 102vh;
  383. .header-section {
  384. padding: 15px 15px 45px 15px;
  385. color: white;
  386. .login-tip {
  387. font-size: 18px;
  388. margin-left: 10px;
  389. }
  390. .cu-avatar {
  391. border: 2px solid #eaeaea;
  392. .icon {
  393. font-size: 40px;
  394. }
  395. }
  396. .user-info {
  397. margin-left: 15px;
  398. .u_title {
  399. font-size: 18px;
  400. line-height: 30px;
  401. color: #000000;
  402. }
  403. }
  404. }
  405. .content-section {
  406. position: relative;
  407. top: -50px;
  408. .mine-actions {
  409. margin: 15px 15px;
  410. padding: 20px 0px;
  411. border-radius: 8px;
  412. .action-item {
  413. .icon {
  414. font-size: 28px;
  415. }
  416. .text {
  417. display: block;
  418. font-size: 13px;
  419. margin: 8px 0px;
  420. }
  421. }
  422. }
  423. }
  424. }
  425. .menu-list {
  426. box-shadow: 0px 2px 24px 0px rgba(0, 0, 0, 0.1);
  427. border-radius: 20px;
  428. margin: 0 0 0 0;
  429. }
  430. .list-cell {
  431. // padding: 17px 15px;
  432. background-color: #000000;
  433. }
  434. .menu-text {
  435. color: #ffffff
  436. }
  437. .header {
  438. position: relative;
  439. padding-top: 4vh;
  440. }
  441. .prop-item {
  442. position: relative;
  443. display: flex;
  444. flex-direction: row;
  445. height: 40px;
  446. line-height: 40px;
  447. margin: 10px 20rpx;
  448. }
  449. .prop-item-left {
  450. color: #BCBCBF;
  451. ;
  452. width: 30%;
  453. font-size: 14px;
  454. //margin-left: 36px;
  455. }
  456. .prop-item-image {
  457. width: 15px;
  458. height: 15px;
  459. position: absolute;
  460. left: 2vw;
  461. top: 0.5vh;
  462. }
  463. .prop-item-right {
  464. position: absolute;
  465. right: 10rpx;
  466. top: 5rpx;
  467. color: #BCBCBF;
  468. }
  469. .textMsg {
  470. width: 88vw;
  471. text-align: center;
  472. margin: 10vh auto;
  473. line-height: 2.5vh;
  474. }
  475. </style>