index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412
  1. <template>
  2. <view class="content-wrap">
  3. <view class="head-wrap">
  4. <view class="content-info">
  5. <!-- 轮播图 -->
  6. <view class="head-bg">
  7. <u-swiper :list="bannerList" :height="340"></u-swiper>
  8. </view>
  9. <view class="content">
  10. <!-- 用户信息 -->
  11. <view @click="perfectUserInfo()" class="user-info">
  12. <view class="user-head">
  13. <image v-if="userInfo.selfPhotoUrl" :src="userInfo.selfPhotoUrl" mode=""></image>
  14. <image v-else src="../../static/logo.png" mode=""></image>
  15. </view>
  16. <view class="h-content">
  17. <view class="user-name">
  18. <text>HI,亲爱的{{ userInfo.ncikName }}</text>
  19. </view>
  20. <view class="user-desc">
  21. <view class="h-text">
  22. <text>你当前的个人资料尚不完善</text>
  23. <text>去完善</text>
  24. </view>
  25. <view class="h-arrow">
  26. <u-icon name="arrow-right" color="#333333" size="16"></u-icon>
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. <view class="balance-info">
  32. <view class="balance-name">
  33. <text>我的资产</text>
  34. </view>
  35. <view class="h-content">
  36. <view class="button-wrap">
  37. <view @click="gotoRechargeService()" class="btn">
  38. <view class="icon">
  39. <u-icon name="/static/me/u701.png" color="red" size="30"></u-icon>
  40. </view>
  41. <view class="h-name">
  42. <view class="name">
  43. 余额
  44. </view>
  45. <view class="num">
  46. ¥{{ userInfo.balance }}
  47. </view>
  48. </view>
  49. </view>
  50. </view>
  51. <view class="button-wrap">
  52. <view @click="gotoIntgral" class="btn">
  53. <view class="icon">
  54. <u-icon name="/static/me/u680.png" color="red" size="30"></u-icon>
  55. </view>
  56. <view class="h-name">
  57. <view class="name">
  58. 积分
  59. </view>
  60. <view class="num">
  61. {{ userInfo.integral }}
  62. </view>
  63. </view>
  64. </view>
  65. </view>
  66. <view class="button-wrap">
  67. <view @click="gotoCoupon" class="btn">
  68. <view class="icon">
  69. <u-icon name="/static/me/u687.png" color="red" size="30"></u-icon>
  70. </view>
  71. <view class="h-name">
  72. <view class="name">
  73. 优惠券
  74. </view>
  75. <view class="num">
  76. {{ userInfo.coupon }}
  77. </view>
  78. </view>
  79. </view>
  80. </view>
  81. <view class="button-wrap">
  82. <view class="btn">
  83. <view class="icon">
  84. <u-icon name="/static/me/u694.png" color="red" size="30"></u-icon>
  85. </view>
  86. <view class="h-name">
  87. <view class="name">
  88. 电子币
  89. </view>
  90. <view class="num">
  91. {{ userInfo.electronicCurrency }}
  92. </view>
  93. </view>
  94. </view>
  95. </view>
  96. </view>
  97. </view>
  98. <view class="nav-bar">
  99. <view class="nav-content">
  100. <view class="nav-info">
  101. <view class="logo">
  102. <image src="../../static/me/u1796.png" mode=""></image>
  103. </view>
  104. <view class="nav-desc">
  105. <view class="nav-name">
  106. <view class="">贡献奖励记录</view>
  107. </view>
  108. <view class="change-store"></view>
  109. </view>
  110. <view class="arrow-right">
  111. <u-icon name="arrow-right" color="#666" size="18"></u-icon>
  112. <!-- <image src="../../static/index/u10.png" mode=""></image> -->
  113. </view>
  114. </view>
  115. </view>
  116. <view class="custom-line"></view>
  117. <view @click="gotoRealNameAuth()" class="nav-content">
  118. <view class="nav-info">
  119. <view class="logo">
  120. <image src="../../static/me/u1803.png" mode=""></image>
  121. </view>
  122. <view class="nav-desc">
  123. <view class="nav-name">
  124. <view class="">实名认证</view>
  125. </view>
  126. <view class="change-store">
  127. <text v-if="userInfo.isAttestation">已认证</text>
  128. <text v-else>未实名认证,去认证</text>
  129. </view>
  130. </view>
  131. <view class="arrow-right">
  132. <u-icon name="arrow-right" color="#666" size="18"></u-icon>
  133. <!-- <image src="../../static/index/u10.png" mode=""></image> -->
  134. </view>
  135. </view>
  136. </view>
  137. <view class="custom-line"></view>
  138. <view @click="gotoServiceObjectMgt()" class="nav-content">
  139. <view class="nav-info">
  140. <view class="logo">
  141. <image src="../../static/me/u1812.png" mode=""></image>
  142. </view>
  143. <view class="nav-desc">
  144. <view class="nav-name">
  145. <view class="">服务对象管理</view>
  146. </view>
  147. <view class="change-store"></view>
  148. </view>
  149. <view class="arrow-right">
  150. <u-icon name="arrow-right" color="#666" size="18"></u-icon>
  151. <!-- <image src="../../static/index/u10.png" mode=""></image> -->
  152. </view>
  153. </view>
  154. </view>
  155. <view class="custom-line"></view>
  156. <view class="nav-content">
  157. <view @click="gotoSystemSwitch()" class="nav-info">
  158. <view class="logo">
  159. <image src="../../static/me/u1833.png" mode=""></image>
  160. </view>
  161. <view class="nav-desc">
  162. <view class="nav-name">
  163. <view class="">新老系统切换</view>
  164. </view>
  165. <view class="change-store"></view>
  166. </view>
  167. <view class="arrow-right">
  168. <u-icon name="arrow-right" color="#666" size="18"></u-icon>
  169. <!-- <image src="../../static/index/u10.png" mode=""></image> -->
  170. </view>
  171. </view>
  172. </view>
  173. <view class="custom-line"></view>
  174. <view @click="gotoRechargeService()" class="nav-content">
  175. <view class="nav-info">
  176. <view class="logo">
  177. <image src="../../static/me/u826.png" mode=""></image>
  178. </view>
  179. <view class="nav-desc">
  180. <view class="nav-name">
  181. <view class="">储值服务</view>
  182. </view>
  183. <view class="change-store"></view>
  184. </view>
  185. <view class="arrow-right">
  186. <u-icon name="arrow-right" color="#666" size="18"></u-icon>
  187. <!-- <image src="../../static/index/u10.png" mode=""></image> -->
  188. </view>
  189. </view>
  190. </view>
  191. </view>
  192. <view class="nav-bar">
  193. <view @click="aboutOur()" class="nav-content">
  194. <view class="nav-info">
  195. <view class="logo">
  196. <image src="../../static/me/u1829.png" mode=""></image>
  197. </view>
  198. <view class="nav-desc">
  199. <view class="nav-name">
  200. <view class="">关于我们</view>
  201. </view>
  202. <view class="change-store"></view>
  203. </view>
  204. <view class="arrow-right">
  205. <u-icon name="arrow-right" color="#666" size="18"></u-icon>
  206. <!-- <image src="../../static/index/u10.png" mode=""></image> -->
  207. </view>
  208. </view>
  209. </view>
  210. <view class="custom-line"></view>
  211. <view @click="perfectUserInfo()" class="nav-content">
  212. <view class="nav-info">
  213. <view class="logo">
  214. <image src="../../static/me/u10.png" mode=""></image>
  215. </view>
  216. <view class="nav-desc">
  217. <view class="nav-name">
  218. <view class="">个人信息</view>
  219. </view>
  220. <view class="change-store"></view>
  221. </view>
  222. <view class="arrow-right">
  223. <u-icon name="arrow-right" color="#666" size="18"></u-icon>
  224. <!-- <image src="../../static/index/u10.png" mode=""></image> -->
  225. </view>
  226. </view>
  227. </view>
  228. <view class="custom-line"></view>
  229. <view @click="gotoSetting()" class="nav-content">
  230. <view class="nav-info">
  231. <view class="logo">
  232. <image src="../../static/me/u101.png" mode=""></image>
  233. </view>
  234. <view class="nav-desc">
  235. <view class="nav-name">
  236. <view class="">设置</view>
  237. </view>
  238. <view class="change-store"></view>
  239. </view>
  240. <view class="arrow-right">
  241. <u-icon name="arrow-right" color="#666" size="18"></u-icon>
  242. <!-- <image src="../../static/index/u10.png" mode=""></image> -->
  243. </view>
  244. </view>
  245. </view>
  246. </view>
  247. </view>
  248. </view>
  249. </view>
  250. <view class="tabBarLineHeight"></view>
  251. <view class="tabBarView">
  252. <tab-bar :tabIndex="tabIndex"></tab-bar>
  253. </view>
  254. </view>
  255. </template>
  256. <script >
  257. import tabBar from "../../components/tabBar/tabBar";
  258. export default {
  259. components: {
  260. tabBar
  261. },
  262. data() {
  263. return {
  264. title: 'Hello',
  265. tabIndex: 4,
  266. bannerList: [
  267. '/static/me/u655.png',
  268. ],
  269. userInfo: {
  270. selfPhotoUrl: null
  271. }
  272. }
  273. },
  274. mounted() {
  275. this.pageTop();
  276. // 用户信息
  277. try {
  278. const value = uni.getStorageSync('userInfo');
  279. if (value) {
  280. this.userInfo = value
  281. }
  282. } catch (e) {
  283. // error
  284. }
  285. console.log(this.userInfo, '11111111111111111111111');
  286. },
  287. // 分享到朋友圈
  288. onShareTimeline() { },
  289. // 分享到用户
  290. onShareAppMessage(OBJECT) { },
  291. onLoad() { },
  292. methods: {
  293. // 页面内容置顶
  294. pageTop() {
  295. uni.pageScrollTo({
  296. scrollTop: 0,
  297. duration: 100, // scroll animation duration in milliseconds
  298. success: function () {
  299. console.log('Scrolled to the top successfully');
  300. },
  301. fail: function (err) {
  302. console.log('Failed to scroll to the top', err);
  303. }
  304. });
  305. },
  306. // 保存微信用户信息
  307. saveWechatUserInfo() {
  308. let that = this;
  309. // 保存用户信息
  310. saveWechatUser(null, { data: this.userInfo }).then((res) => {
  311. console.log(res.data);
  312. }).catch(() => {
  313. uni.showToast({
  314. title: "操作失败"
  315. })
  316. })
  317. },
  318. // 积分详细页面
  319. gotoIntgral() {
  320. uni.$u.route({
  321. url: '/pages/integral/integral',
  322. params: {
  323. name: 'lisa'
  324. }
  325. })
  326. },
  327. /* 用户信息 */
  328. perfectUserInfo() {
  329. uni.navigateTo({
  330. url: '/pages/me/user-info',
  331. params: {
  332. name: 'lisa'
  333. }
  334. })
  335. },
  336. // 关于我们
  337. aboutOur() {
  338. uni.navigateTo({
  339. url: '/pages/me/about-our',
  340. params: {
  341. name: 'lisa'
  342. }
  343. })
  344. },
  345. // 设置
  346. gotoSetting() {
  347. uni.navigateTo({
  348. url: '/pages/setting/setting',
  349. params: {
  350. name: 'lisa'
  351. }
  352. })
  353. },
  354. // 服务对象管理
  355. gotoServiceObjectMgt() {
  356. uni.navigateTo({
  357. url: '/pages/me/service-object-mgt',
  358. params: {
  359. name: 'lisa'
  360. }
  361. })
  362. },
  363. // 储值服务
  364. gotoRechargeService() {
  365. uni.navigateTo({
  366. url: '/myPages/recharge/index'
  367. })
  368. },
  369. // 去实名认证
  370. gotoRealNameAuth() {
  371. let that = this;
  372. console.log(that.userInfo.id)
  373. uni.navigateTo({
  374. url: '/pages/me/real-name-auth',
  375. })
  376. },
  377. // 去优惠劵页面
  378. gotoCoupon() {
  379. uni.navigateTo({
  380. url: '/myPages/coupon/index',
  381. })
  382. },
  383. // 去新老系统切换
  384. gotoSystemSwitch() {
  385. if (this.$isDataEmpty(this.userInfo.createWay)) {
  386. uni.navigateTo({
  387. url: '/pages/system/system-switch',
  388. params: {}
  389. })
  390. }
  391. if (this.userInfo.createWay == 1) { // 判断是否同步过老系统
  392. uni.showToast({
  393. title: "你已经同步过,无需重复操作"
  394. })
  395. }
  396. },
  397. }
  398. }
  399. </script>
  400. <style scoped lang="scss" >
  401. @import '/common/css/common.css';
  402. @import './index.rpx.scss';
  403. </style>