index-my.vue 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365
  1. <template>
  2. <view class="index-my">
  3. <custom-nav ref="ltm" :title="title" transparent="transparent" noback="noback"></custom-nav>
  4. <navigator class="login-reg" v-if="!logged" url="../../pages/login-reg/login-reg"></navigator>
  5. <view class="content tabbar">
  6. <view class="area info">
  7. <image class="bg" src="../../static/index/my/my-bg.png" mode=""></image>
  8. <view class="userinfo">
  9. <view class="headpic">
  10. <image v-if="logged" class="head" :src="userinfo.avatar"></image>
  11. <image v-else class="head" src="../../static/index/my/defaultimg.png"></image>
  12. <image v-if="userinfo.store" class="medal" src="../../static/index/my/medal.png"></image>
  13. </view>
  14. <view class="center">
  15. <view class="top">
  16. <text class="username">{{ logged ? userinfo.nickname : '请登录' }}</text>
  17. <text v-if="logged" class="level-name"><text class="cuIcon-crownfill"></text>{{ userinfo.level }}</text>
  18. </view>
  19. <view class="bot" v-if="logged">
  20. <text class="userid">ID:{{ userinfo.uuid || '' }}</text>
  21. </view>
  22. </view>
  23. <navigator class="editinfo" :url="'../../pages/person-card/person-card?id=' + userinfo.id + '&self=1'">
  24. <text>我的名片</text>
  25. <text class="cuIcon-right"></text>
  26. </navigator>
  27. </view>
  28. <view class="numinfo">
  29. <navigator url="../../pages/my-order/my-order?type=1" class="numitem">
  30. <text class="num">{{ userinfo.order_num1 || 0 }}</text>
  31. <text class="numname">待审核</text>
  32. </navigator>
  33. <navigator url="../../pages/my-order/my-order?type=2" class="numitem">
  34. <text class="num">{{ userinfo.order_num2 || 0 }}</text>
  35. <text class="numname">待审核</text>
  36. </navigator>
  37. <navigator url="../../pages/my-order/my-order?type=3" class="numitem">
  38. <text class="num">{{ userinfo.order_num3 || 0 }}</text>
  39. <text class="numname">待收货</text>
  40. </navigator>
  41. <navigator url="../../pages/my-order/my-order?type=4" class="numitem">
  42. <text class="num">{{ userinfo.order_num4 || 0 }}</text>
  43. <text class="numname">已完成</text>
  44. </navigator>
  45. </view>
  46. </view>
  47. <navigator url="../money-running/money-running" class="money">
  48. <view class="left">账户余额:<text class="basecolor">¥{{ money | numDot }}</text></view>
  49. <view class="right">详情 <text class="cuIcon-right"></text></view>
  50. </navigator>
  51. <!-- <navigator url="../../pages/proxy-updata/proxy-updata" class="card">
  52. <image src="../../static/index/my/user-up.png"></image>
  53. </navigator> -->
  54. <!-- <view class="area active">
  55. <view class="active-item" v-for="(item, index) in activeList" :url="item.url" :key="index" @tap="toActive(index)">
  56. <image :src="item.image"></image>
  57. <text>{{ item.name }}</text>
  58. </view>
  59. </view> -->
  60. <view class="area appfun">
  61. <navigator class="app-item" v-for="(item, index) in appfunList" :url="item.url" :key="index">
  62. <image :src="item.image"></image>
  63. <text class="itemname">{{ item.name }}</text>
  64. <text class="cuIcon-right"></text>
  65. <text v-if="index === 0 && messageNum" class="num">{{ messageNum }}</text>
  66. </navigator>
  67. </view>
  68. <!-- <view class="area systemset">
  69. <navigator class="app-item" url="../../pages/system-set/system-set">
  70. <image src="../../static/index/my/set.png"></image>
  71. <text class="itemname">系统设置</text>
  72. <text class="cuIcon-right"></text>
  73. </navigator> -->
  74. </view>
  75. </view>
  76. </view>
  77. </template>
  78. <script>
  79. import { _API_GetUserStatus, _API_GetUserInfo, _API_ConfireLevel } from '@/apis/user.js'
  80. export default {
  81. data() {
  82. return {
  83. title: '我的',
  84. activeList: [
  85. {
  86. name: '争霸赛',
  87. image: '../../static/index/my/zhengbasai.png'
  88. },
  89. {
  90. name: '线下沙龙',
  91. image: '../../static/index/my/shalong.png'
  92. },
  93. {
  94. name: '密训营',
  95. image: '../../static/index/my/mixun.png'
  96. }
  97. ],
  98. appfunList: [
  99. // {
  100. // name: '消息通知',
  101. // url: '../../pages/notify-msg/notify-msg',
  102. // image: '../../static/index/my/message.png'
  103. // },
  104. {
  105. name: '地址管理',
  106. url: '../../pages/address-manage/address-manage',
  107. image: '../../static/index/my/address.png'
  108. },
  109. {
  110. name: '安全管理',
  111. url: '../../pages/safe-manage/safe-manage',
  112. image: '../../static/index/my/safe.png'
  113. },
  114. {
  115. name: '我的授权',
  116. url: '../../pages/auth-card/auth-card',
  117. image: '../../static/index/my/auth.png'
  118. },
  119. {
  120. name: '如何使用',
  121. url: '../../pages/help-use/help-use',
  122. image: '../../static/index/my/help.png'
  123. }
  124. ]
  125. }
  126. },
  127. onPullDownRefresh() {
  128. uni.$emit('INIT')
  129. },
  130. onShow() {
  131. if (this.$store.getters['cart/shopcarNum']) {
  132. uni.setTabBarBadge({ index: 1, text: this.$store.getters['cart/shopcarNum'] + '' })
  133. } else {
  134. uni.removeTabBarBadge({ index: 1 })
  135. }
  136. },
  137. computed: {
  138. userinfo() { return this.$store.state.userinfo },
  139. logged() { return this.$store.state.app.token ? true : false },
  140. messageNum() { return this.$store.getters['message/messageNum'] },
  141. money() { return this.$store.state.userinfo.money }
  142. },
  143. methods: {
  144. toActive(index) {
  145. if (index === 0) {
  146. // uni.showLoading({ mask: true })
  147. // plus.share.getServices(list => {
  148. // try{
  149. // list.find(e => e.id === 'weixin').launchMiniProgram({ id:'gh_ccc3d7c5cbe0' })
  150. // uni.hideLoading()
  151. // }catch(e){
  152. // uni.toast('唤起争霸赛小程序失败,请手动打开')
  153. // uni.hideLoading()
  154. // }
  155. // }, e => {
  156. // uni.toast('获取分享服务列表失败,请手动打开小程序')
  157. // })
  158. } else {
  159. uni.toast('暂未开放')
  160. }
  161. }
  162. }
  163. }
  164. </script>
  165. <style lang="scss" scoped>
  166. .index-my {
  167. @include page();
  168. border-top: none;
  169. .login-reg {
  170. top: 0;
  171. left: 0;
  172. right: 0;
  173. z-index: 2;
  174. position: absolute;
  175. background: transparent;
  176. bottom: $app-tabbar-height;
  177. }
  178. .content {
  179. .card {
  180. left: 50%;
  181. top: 410rpx;
  182. height: 90rpx;
  183. width: 690rpx;
  184. position: absolute;
  185. transform: translateX(-50%);
  186. image {
  187. width: 100%;
  188. height: 100%;
  189. }
  190. }
  191. .money {
  192. height: 148rpx;
  193. padding: 0 30rpx;
  194. background: #FFFFFF;
  195. margin-top: 10rpx;
  196. box-sizing: border-box;
  197. @include flex();
  198. justify-content: space-between;
  199. font-size: 32rpx;
  200. > .left {
  201. .basecolor {
  202. font-size: 54rpx;
  203. }
  204. }
  205. .right {
  206. color: #B7B7B7;
  207. }
  208. }
  209. .area {
  210. background: #FFFFFF;
  211. &.info {
  212. height: 437rpx;
  213. position: relative;
  214. .bg {
  215. z-index: 0;
  216. width: 100%;
  217. height: 100%;
  218. position: absolute;
  219. }
  220. .userinfo {
  221. top: 158rpx;
  222. width: 100%;
  223. display: flex;
  224. height: 100rpx;
  225. padding: 0 30rpx;
  226. position: absolute;
  227. box-sizing: border-box;
  228. .headpic {
  229. height: 100%;
  230. width: 100rpx;
  231. position: relative;
  232. .head {
  233. width: 100%;
  234. height: 100%;
  235. border-radius: 50%;
  236. }
  237. .medal {
  238. right: -10rpx;
  239. bottom: -20rpx;
  240. width: 50rpx;
  241. height: 60rpx;
  242. position: absolute;
  243. }
  244. }
  245. .center {
  246. @include flex(column);
  247. flex: 1;
  248. height: 100%;
  249. margin: 0 16rpx;
  250. .top, .bot {
  251. flex: 1;
  252. width: 100%;
  253. display: flex;
  254. align-items: center;
  255. .username {
  256. font-size: 32rpx;
  257. margin-right: 16rpx;
  258. max-width: calc(100% - 130rpx);
  259. }
  260. .userid {
  261. color: #666666;
  262. font-size: 24rpx;
  263. margin-right: 26rpx;
  264. }
  265. .realname-img {
  266. width: 34rpx;
  267. height: 26rpx;
  268. margin-right: 10rpx;
  269. }
  270. .realname-text {
  271. color: #666666;
  272. font-size: 24rpx;
  273. &.noreal {
  274. color: $app-base-color;
  275. }
  276. }
  277. }
  278. }
  279. .editinfo {
  280. @include flex();
  281. height: 100%;
  282. width: 150rpx;
  283. font-size: 26rpx;
  284. .cuIcon-right {
  285. margin-left: 6rpx;
  286. }
  287. }
  288. }
  289. .numinfo {
  290. @include flex();
  291. bottom: 0;
  292. width: 100%;
  293. height: 140rpx;
  294. position: absolute;
  295. box-shadow: 0px -1px 5px 0px rgba(126,126,126,0.11);
  296. background: linear-gradient(0deg,rgba(255,255,255,1) 0%, rgba(255,255,255,0.2) 100%);
  297. .numitem {
  298. flex: 1;
  299. height: 100%;
  300. @include flex(column);
  301. .num {
  302. font-size: 36rpx;
  303. color: #7B5533;
  304. margin-top: 12rpx 0 26rpx;
  305. }
  306. .numname {
  307. font-size: 26rpx;
  308. }
  309. }
  310. }
  311. }
  312. &.active {
  313. height: 180rpx;
  314. margin-top: 74rpx;
  315. display: flex;
  316. .active-item {
  317. @include flex(column);
  318. flex: 1;
  319. height: 100%;
  320. image {
  321. width: 88rpx;
  322. height: 88rpx;
  323. margin-top: 24rpx;
  324. }
  325. text {
  326. font-size: 26rpx;
  327. margin-top: 16rpx;
  328. }
  329. }
  330. }
  331. &.appfun, &.systemset {
  332. margin-top: 10rpx;
  333. background: $app-base-bg;
  334. navigator {
  335. position: relative;
  336. image {
  337. width: 38rpx;
  338. height: 38rpx;
  339. }
  340. .itemname {
  341. flex: 1;
  342. margin-left: 16rpx;
  343. }
  344. .num {
  345. @include flex();
  346. top: 50%;
  347. right: 66rpx;
  348. width: 30rpx;
  349. height: 30rpx;
  350. color: #FFFFFF;
  351. font-size: 24rpx;
  352. position: absolute;
  353. border-radius: 50%;
  354. background: #FF0000;
  355. transform: translateY(-50%);
  356. }
  357. }
  358. }
  359. }
  360. }
  361. }
  362. </style>