index.wpy 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  1. <style lang='less'>
  2. page {
  3. height: 100%;
  4. background: #ebf5fa;
  5. }
  6. .percsonal-center {
  7. width: 100%;
  8. height: 100%;
  9. overflow: hidden;
  10. box-sizing: border-box;
  11. position: relative;
  12. .imgst {
  13. width: 100%;
  14. height: 784rpx;
  15. background-color: #ebf5fa;
  16. position: absolute;
  17. top: 0;
  18. left: 0;
  19. z-index: 0;
  20. }
  21. .contain {
  22. padding-top: 240rpx;
  23. position: relative;
  24. z-index: 1;
  25. .head {
  26. display: flex;
  27. align-items: center;
  28. .imgHead {
  29. margin-left: 56rpx;
  30. margin-right: 20rpx;
  31. width: 128rpx;
  32. height: 128rpx;
  33. }
  34. .p-name {
  35. margin-right: 8rpx;
  36. font-family: PingFang SC;
  37. font-size: 44rpx;
  38. font-weight: 600;
  39. line-height: 64rpx;
  40. color: #1b2129;
  41. }
  42. .p-comp {
  43. padding-top: 8rpx;
  44. font-family: PingFang SC;
  45. font-size: 28rpx;
  46. font-weight: 400;
  47. line-height: 44rpx;
  48. color: #626c78;
  49. }
  50. }
  51. .content {
  52. padding: 40rpx;
  53. padding-top: 64rpx;
  54. .card-box {
  55. display: flex;
  56. justify-content: space-between;
  57. padding-bottom: 20rpx;
  58. .little-card {
  59. text-align: center;
  60. width: 326rpx;
  61. height: 200rpx;
  62. padding-top: 36rpx;
  63. border-radius: 40rpx;
  64. box-sizing: border-box;
  65. background: #ffffff;
  66. .little-imgst {
  67. width: 64rpx;
  68. height: 64rpx;
  69. }
  70. .text {
  71. padding-top: 8rpx;
  72. font-family: PingFang SC;
  73. font-size: 32rpx;
  74. font-weight: 400;
  75. line-height: 48rpx;
  76. color: #1b2129;
  77. }
  78. }
  79. .hover-st {
  80. background: #f1f4f6;
  81. }
  82. }
  83. .big-card {
  84. width: 670rpx;
  85. height: 288rpx;
  86. padding: 24rpx 0px 24rpx 0px;
  87. border-radius: 40rpx;
  88. box-sizing: border-box;
  89. background: #ffffff;
  90. .each-row {
  91. width: 100%;
  92. height: 120rpx;
  93. padding-left: 40rpx;
  94. display: flex;
  95. align-items: center;
  96. .each-row-imgst {
  97. width: 48rpx;
  98. height: 48rpx;
  99. margin-right: 24rpx;
  100. }
  101. .each-row-text {
  102. font-family: PingFang SC;
  103. font-size: 32rpx;
  104. font-weight: 400;
  105. line-height: 48rpx;
  106. color: #1b2129;
  107. }
  108. }
  109. .hover-st {
  110. background: #f1f4f6;
  111. }
  112. }
  113. }
  114. }
  115. }
  116. </style>
  117. <!-- 个人中心 -->
  118. <template>
  119. <div class="percsonal-center">
  120. <page-top-bar
  121. iconClickedEmitId="toPage"
  122. @toPage="toPage('/packagesEnv/pages/home/index')"
  123. icon="{{h5Static+'/page-top-bar/return-icon.svg'}}"
  124. ></page-top-bar>
  125. <image
  126. class="imgst"
  127. src="{{h5StaticPath}}/bg-personal.png"
  128. mode="widthFix"
  129. alt
  130. />
  131. <div class="contain">
  132. <div class="head">
  133. <image
  134. class="imgHead"
  135. src="{{userInfo.headImgUrl}}"
  136. />
  137. <div @click="goToPersonalInfo">
  138. <div>
  139. <span class="p-name">{{userInfo.name}}</span>
  140. <image
  141. style="width: 24rpx;height: 24rpx;"
  142. src="{{h5StaticPath}}/icon-arrow-right.svg"
  143. />
  144. </div>
  145. <div class="p-comp">{{ userInfo.companyName }}</div>
  146. </div>
  147. </div>
  148. <div class="content">
  149. <div class="card-box">
  150. <div
  151. hover-class="hover-st"
  152. hover-style-time="100"
  153. class="little-card"
  154. @click="toPage('/packagesEnv/pages/portrait/home')"
  155. >
  156. <image
  157. class="little-imgst"
  158. src="{{h5StaticPath}}/icon-leaf.png"
  159. />
  160. <div class="text">我的习惯</div>
  161. </div>
  162. <div
  163. hover-class="hover-st"
  164. hover-style-time="100"
  165. class="little-card"
  166. @click="handleAdd(true)"
  167. >
  168. <image
  169. class="little-imgst"
  170. src="{{h5StaticPath}}/icon-to-desk.png"
  171. />
  172. <div class="text">添加到桌面</div>
  173. </div>
  174. </div>
  175. <div class="big-card">
  176. <div
  177. hover-class="hover-st"
  178. hover-style-time="100"
  179. v-for="item in arr"
  180. :key="item.icon"
  181. class="each-row"
  182. @click="toPage(item.url)"
  183. >
  184. <image
  185. class="each-row-imgst"
  186. src="{{h5StaticPath}}/{{item.icon}}"
  187. />
  188. <span class="each-row-text">{{item.name}}</span>
  189. </div>
  190. </div>
  191. </div>
  192. </div>
  193. <footer @callPhone="openPhonePanel"></footer>
  194. <custome-service-panel
  195. :show="visiblePhone"
  196. :phone="phone"
  197. @custome-service-close="closePhonePanel"
  198. >
  199. </custome-service-panel>
  200. <add-miniprogram-to-desk-panel
  201. :show="isShowAddminiProgramToDesk"
  202. @component-add-miniprogram-to-desk-panel-close="handleAdd(false)"
  203. :showBottomButton="false"
  204. ></add-miniprogram-to-desk-panel>
  205. </div>
  206. </template>
  207. <script>
  208. import wepy from '@wepy/core'
  209. import config from '@/config'
  210. import { queryUserById } from '../../api/personalCenter'
  211. wepy.page({
  212. components: {},
  213. props: {},
  214. data: {
  215. visiblePhone: false,
  216. phone: '',
  217. userInfo: null,
  218. h5StaticPath: config.h5StaticPath + '/page-personalCenter',
  219. h5Static: config.h5StaticPath,
  220. isShowAddminiProgramToDesk: false,
  221. arr: [
  222. // { name: '问题反馈', icon: 'icon-message.svg', url: '' },
  223. { name: '操作指引', icon: 'icon-guid.svg', url: '/packagesEnv/pages/personalCenter/operating' },
  224. { name: '关于小飒指控', icon: 'icon-tip.svg', url: '/packagesEnv/pages/personalCenter/xiaosa' }
  225. ]
  226. },
  227. onLoad() {
  228. this.getUserInfo()
  229. },
  230. computed: {},
  231. methods: {
  232. getUserInfo() {
  233. queryUserById().then(res => {
  234. this.userInfo = res.data
  235. this.userInfo.headImgUrl = res.data.headImgUrl || `${this.h5StaticPath}/no-person.png`
  236. })
  237. },
  238. openPhonePanel(val) {
  239. this.phone = val
  240. this.visiblePhone = true
  241. },
  242. closePhonePanel(val) {
  243. this.visiblePhone = val
  244. },
  245. handleAdd(val) {
  246. this.isShowAddminiProgramToDesk = val
  247. },
  248. toPage(url) {
  249. wx.navigateTo({
  250. url: url
  251. })
  252. },
  253. goToPersonalInfo() {
  254. wx.navigateTo({
  255. url: '/packagesEnv/pages/personalCenter/personalInfo'
  256. })
  257. }
  258. }
  259. })
  260. </script>
  261. <config>
  262. {
  263. 'navigationBarTitleText': '',
  264. navigationStyle:"custom",
  265. backgroundColor: '#EBF5FA',
  266. usingComponents: {
  267. 'page-top-bar': '~@/components/common/page-top-bar',
  268. 'add-miniprogram-to-desk-panel': './component/add-miniprogram-to-desk-panel',
  269. 'custome-service-panel': './component/custome-service-panel',
  270. 'footer':'./footer'
  271. },
  272. "componentPlaceholder": {
  273. "add-miniprogram-to-desk-panel": "view",
  274. }
  275. }
  276. </config>