user.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401
  1. <template>
  2. <view class="container">
  3. <view class="top">
  4. <view class="my">{{$t('home.d4')}}</view>
  5. <view class="userinfo flex">
  6. <view class="flex">
  7. <image class="image margin-r-10" src="../../static/error/missing-face.png" mode="scaleToFill">
  8. </image>
  9. <view class="info">
  10. <view class="infor margin-b-20">v790d7v...v469874561</view>
  11. <image class="in" src="../../static/shouye/huiyuan.png" mode="scaleToFill"></image>
  12. </view>
  13. </view>
  14. <image @click="showY" class="inf" src="../../static/shouye/userinfo.png" mode="scaleToFill"></image>
  15. </view>
  16. </view>
  17. <!-- 余额 -->
  18. <view class="body">
  19. <view v-if="show" class="yue">
  20. <view class="te">
  21. {{$t('user.c1')}}
  22. </view>
  23. <view class="tex">
  24. 12356.00
  25. </view>
  26. <view class="btn flex">
  27. <button class="btn1" @click="navigator"> <text>{{$t('user.a7')}}</text> </button>
  28. <button class="btn1" @click="navigatorT"> <text>{{$t('user.a6')}}</text> </button>
  29. </view>
  30. </view>
  31. <view v-else class="yue1">
  32. <view class="tj">統計表</view>
  33. <view class="tj-item flex ">
  34. <view class="lj">{{$t('user.a4')}}{{$t('user.a7')}}</view>
  35. <view class="ljsu">0.000</view>
  36. </view>
  37. <view class="tj-item flex">
  38. <view class="lj">{{$t('user.a4')}}{{$t('user.a6')}}</view>
  39. <view class="ljsu">0.000</view>
  40. </view>
  41. <view class="tj-item flex">
  42. <view class="lj">{{$t('user.a8')}}</view>
  43. <view class="ljsu">0.000</view>
  44. </view>
  45. <view class="tj-item flex">
  46. <view class="lj">{{$t('user.a9')}}</view>
  47. <view class="ljsu">0.000</view>
  48. </view>
  49. <view class="tj-item flex">
  50. <view class="lj">{{$t('user.a10')}}</view>
  51. <view class="ljsu">0.000</view>
  52. </view>
  53. </view>
  54. <!-- 列表 -->
  55. <view class="gj">
  56. {{$t('user.b1')}}
  57. </view>
  58. <view class="user-list flex" @click="navTo('/pages/user/team')">
  59. <image src="../../static/shouye/yue.png" mode="scaleToFill" class="left-img"></image>
  60. <view class="item-name">
  61. {{$t('user.b2')}}
  62. </view>
  63. <image src="../../static/icon/back.png" mode="scaleToFill" class="right-img"></image>
  64. </view>
  65. <!-- 额外添加 -->
  66. <view class="user-list flex" @click="navTo('/pages/user/shareQrCode')">
  67. <image src="../../static/shouye/money.png" mode="scaleToFill" class="left-img"></image>
  68. <view class="item-name">
  69. {{$t('user.b3')}}
  70. </view>
  71. <image src="../../static/icon/back.png" mode="scaleToFill" class="right-img"></image>
  72. </view>
  73. <!-- 额外添加 -->
  74. <view class="user-list flex" @click="navTo('/pages/tabulation/tabulation')">
  75. <image src="../../static/shouye/liebiao.png" mode="scaleToFill" class="left-img"></image>
  76. <view class="item-name">
  77. {{$t('user.b4')}}
  78. </view>
  79. <image src="../../static/icon/back.png" mode="scaleToFill" class="right-img"></image>
  80. </view>
  81. <view class="user-list flex" @click="navTo('/pages/user/favorites')">
  82. <image src="../../static/shouye/liebiao.png" mode="scaleToFill" class="left-img"></image>
  83. <view class="item-name">
  84. {{$t('user.b5')}}
  85. </view>
  86. <image src="../../static/icon/back.png" mode="scaleToFill" class="right-img"></image>
  87. </view>
  88. <view class="user-list flex" @click="openKf()">
  89. <image src="../../static/shouye/liuyan.png" mode="scaleToFill" class="left-img"></image>
  90. <view class="item-name">
  91. {{$t('user.b6')}}
  92. </view>
  93. <image src="../../static/icon/back.png" mode="scaleToFill" class="right-img"></image>
  94. </view>
  95. <view class="user-list flex" @click="navTo('/pages/transaction/transaction')">
  96. <image src="../../static/shouye/jiaoyi.png" mode="scaleToFill" class="left-img"></image>
  97. <view class="item-name">
  98. {{$t('user.b7')}}
  99. </view>
  100. <image src="../../static/icon/back.png" mode="scaleToFill" class="right-img"></image>
  101. </view>
  102. <view class="user-list flex" @click="navTo('/pages/public/login')">
  103. <image src="../../static/shouye/tuichu.png" mode="scaleToFill" class="left-img"></image>
  104. <view class="item-name">
  105. {{$t('user.b8')}}
  106. </view>
  107. <image src="../../static/icon/back.png" mode="scaleToFill" class="right-img"></image>
  108. </view>
  109. </view>
  110. <taber tab='user'></taber>
  111. </view>
  112. </template>
  113. <script>
  114. import taber from "@/components/footer/footer.vue";
  115. import {
  116. mapState,
  117. mapMutations
  118. } from 'vuex';
  119. import uniList from '@/components/uni-list/uni-list.vue';
  120. import uniListItem from '@/components/uni-list-item/uni-list-item.vue';
  121. import {
  122. orderData,
  123. getUserInfo,
  124. // check,
  125. // getLevelList
  126. } from '@/api/user.js';
  127. import {
  128. saveUrl,
  129. interceptor
  130. } from '@/utils/loginUtils.js';
  131. let startY = 0,
  132. moveY = 0,
  133. pageAtTop = true;
  134. export default {
  135. components: {
  136. // uniList,
  137. // uniListItem,
  138. taber
  139. },
  140. data() {
  141. return {
  142. current: 2,
  143. store_name: '',
  144. achievement: '',
  145. code: '',
  146. levelList: [],
  147. show: true
  148. };
  149. },
  150. onShow() {
  151. // 判断是否已经登录
  152. // if (this.hasLogin) {
  153. // this.loadBaseData();
  154. // }
  155. this.loadBaseData();
  156. },
  157. filters: {
  158. phone(e) {
  159. var subStr1 = e.substr(0, 3);
  160. var subStr2 = e.substr(e.length - 4, 4);
  161. var subStr = subStr1 + '...' + subStr2;
  162. e = subStr;
  163. return e;
  164. }
  165. },
  166. onReady() {
  167. // 初始化获取页面宽度
  168. uni.createSelectorQuery()
  169. .select('.container')
  170. .fields({
  171. size: true
  172. },
  173. data => {
  174. // 计算最多下拉的高度
  175. this.userDowm = Math.floor((data.width / 750) * 185);
  176. // 计算最大触发修改高度事件
  177. this.userMaxDowm = Math.floor((data.width / 750) * 250);
  178. }
  179. )
  180. .exec();
  181. },
  182. computed: {
  183. ...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
  184. },
  185. methods: {
  186. showY() {
  187. this.show = !this.show
  188. },
  189. navigatorT() {
  190. uni.navigateTo({
  191. url: '/pages/withdrawal/withdrawal'
  192. })
  193. },
  194. navigator() {
  195. uni.navigateTo({
  196. url: '/pages/recharge/recharge'
  197. })
  198. },
  199. // 加载初始数据
  200. loadBaseData() {
  201. const obj = this
  202. getUserInfo({})
  203. .then(({
  204. data
  205. }) => {
  206. obj.setUserInfo(data);
  207. })
  208. .catch(e => {
  209. console.log(e);
  210. });
  211. },
  212. /**
  213. * 统一跳转接口,拦截未登录路由
  214. * navigator标签现在默认没有转场动画,所以用view
  215. */
  216. navTo(url) {
  217. console.log(url);
  218. if (!this.hasLogin) {
  219. // 保存地址
  220. saveUrl();
  221. // 登录拦截
  222. interceptor();
  223. } else {
  224. uni.navigateTo({
  225. url
  226. });
  227. }
  228. },
  229. close() {
  230. this.$refs.popuphx.close();
  231. this.code = '';
  232. },
  233. // 打开绑定
  234. open() {
  235. this.$refs.gspass.open();
  236. },
  237. cast() {
  238. set_waiter({
  239. uid: this.id
  240. })
  241. .then(e => {
  242. this.$api.msg('绑定成功');
  243. this.$refs.gspass.close();
  244. this.id = '';
  245. })
  246. .catch(err => {
  247. this.$refs.gspass.close();
  248. this.id = '';
  249. });
  250. },
  251. // cancelpass() {
  252. // this.$refs.gspass.close();
  253. // this.id = '';
  254. // }
  255. }
  256. };
  257. </script>
  258. <style lang="scss">
  259. .container {
  260. height: 100%;
  261. line-height: 1;
  262. }
  263. .top {
  264. height: 327rpx;
  265. background-color: #000000;
  266. padding: 0 45rpx;
  267. .my {
  268. padding-top: 40rpx;
  269. font-size: 48rpx;
  270. font-weight: 500;
  271. color: #FFFFFF;
  272. }
  273. .userinfo {
  274. padding-top: 40rpx;
  275. .image {
  276. width: 125rpx;
  277. height: 125rpx;
  278. }
  279. .info {
  280. .infor {
  281. font-size: 30rpx;
  282. font-weight: 500;
  283. color: #FFFFFF;
  284. }
  285. }
  286. }
  287. }
  288. .in {
  289. width: 128rpx;
  290. height: 45rpx;
  291. }
  292. .inf {
  293. margin-top: 25rpx;
  294. width: 48rpx;
  295. height: 48rpx;
  296. }
  297. // body
  298. .body {
  299. background-color: #191a1f;
  300. padding: 30rpx;
  301. border-top-right-radius: 60rpx;
  302. border-top-left-radius: 60rpx;
  303. color: #FFFFFF;
  304. .yue {
  305. border-radius: 60rpx;
  306. background-color: #000000;
  307. text-align: center;
  308. padding-top: 40rpx;
  309. padding-bottom: 35rpx;
  310. .te {
  311. font-size: 26rpx;
  312. font-weight: 500;
  313. padding-bottom: 30rpx;
  314. }
  315. .tex {
  316. font-size: 48rpx;
  317. font-weight: bold;
  318. padding-bottom: 50rpx;
  319. }
  320. .btn1 {
  321. min-width: 270rpx;
  322. background: #FDB242;
  323. border-radius: 10rpx;
  324. font-size: $font-base;
  325. }
  326. }
  327. .yue1 {
  328. background-color: #000000;
  329. padding: 30rpx;
  330. color: #FFFFFF;
  331. border-radius: 60rpx;
  332. .tj {
  333. font-size: 30rpx;
  334. font-weight: bold;
  335. text-align: center;
  336. }
  337. .tj-item{
  338. padding-top: 26rpx;
  339. font-size: 24rpx;
  340. opacity: 0.65;
  341. }
  342. }
  343. }
  344. .gj {
  345. margin-top: 50rpx;
  346. margin-left: 20rpx;
  347. font-size: 36rpx;
  348. font-weight: bold;
  349. color: #FFFFFF;
  350. padding-bottom: 10rpx;
  351. }
  352. .user-list {
  353. background: #191a1f;
  354. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  355. margin: 0 auto;
  356. padding: 30rpx 25rpx;
  357. border-bottom: 1px solid rgba(240, 240, 240, 0.2);
  358. .left-img {
  359. width: 40rpx;
  360. height: 40rpx;
  361. margin-right: 20rpx;
  362. }
  363. .item-name {
  364. flex-grow: 1;
  365. font-size: 29rpx;
  366. font-weight: bold;
  367. color: #FFF;
  368. }
  369. .right-img {
  370. width: 18rpx;
  371. height: 27rpx;
  372. }
  373. }
  374. </style>