You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

458 lines
9.2 KiB

8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
  1. <!-- 首页 -->
  2. <template>
  3. <view class="home bx">
  4. <!-- 首页顶部 -->
  5. <view class="home-top content">
  6. <view class="menu-icon">
  7. <!-- <image src="@/static/home/menu.png" mode="aspectFit"></image> -->
  8. </view>
  9. <view class="logo">
  10. Tiktok
  11. </view>
  12. <view class="sign">
  13. <image @click="toSignin" src="../../static/home/sign.png" mode="widthFix"></image>
  14. </view>
  15. </view>
  16. <!-- 通知 -->
  17. <view class="notification">
  18. <u-notice-bar :text="notification[notificationType[$i18n.locale]] || ''" bgColor="#000"
  19. color="white"></u-notice-bar>
  20. </view>
  21. <!-- 用户信息 -->
  22. <view class="user-info content">
  23. <view class="user-name">{{ userInfo.account }}</view>
  24. <view class="member-image">
  25. <image :src="vipInfo.icon" mode="aspectFit"></image>
  26. </view>
  27. </view>
  28. <!-- 菜单列表 -->
  29. <view class="menu-list content">
  30. <view v-for="(item,index) in onList" :key="index" @click="clickMenu(index)" class="menu-item">
  31. <image :src="item.icon" mode="aspectFit"></image>
  32. <view class="menu-descript">{{ $t(`page.home.${menuTitles[index]}`) }}</view>
  33. </view>
  34. </view>
  35. <!-- 虚拟滚动 -->
  36. <virtualScroll></virtualScroll>
  37. <virtualScroll1></virtualScroll1>
  38. <!-- 会员等级信息 -->
  39. <view class="member-list content">
  40. <view class="member-item" v-for="(item, index) in vipList" :key="index">
  41. <view class="status-icon">
  42. <view v-if="item.current" class="current">current</view>
  43. <uni-icons v-else type="locked" size="20" color="#000"></uni-icons>
  44. </view>
  45. <view class="img-box">
  46. <image :src="item.icon" mode="aspectFit"></image>
  47. </view>
  48. <view class="menber-descript">{{ item.title }}</view>
  49. <!-- 权益列表 -->
  50. <view class="equity-list">
  51. <view class="equity-item">
  52. <!-- Receive a set of 40 apps data tasks -->
  53. {{ $t('page.home.equity_item_1', [item.num]) }}
  54. </view>
  55. <view class="equity-item">
  56. {{ $t('page.home.equity_item_2', [item.percentage]) }}
  57. </view>
  58. <view class="equity-item">
  59. {{ $t('page.home.equity_item_3', [item.price]) }}
  60. </view>
  61. </view>
  62. </view>
  63. </view>
  64. <!-- 协议列表 -->
  65. <view class="agreement-list">
  66. <view v-for="(item,index) in outList" :key="index" @click="toinstructions(index)" class="agreement-item">
  67. <image :src="item.icon" mode="aspectFit"></image>
  68. <view class="agreement-descript">{{ $t(`page.home.${agreementTitles[index]}`) }}</view>
  69. </view>
  70. </view>
  71. <sTabbar select="0" />
  72. <!-- 客服列表 -->
  73. <serviceList :show="showService" :serverList="serverList" @close="closeServiceList"></serviceList>
  74. <!-- 弹窗 -->
  75. <popUpWindow :show="showPopUp" @close="closePopUp"></popUpWindow>
  76. </view>
  77. </template>
  78. <script>
  79. import sTabbar from '@/components/base/tabBar.vue'
  80. import serviceList from '@/components/serviceList/serviceList.vue'
  81. import popUpWindow from '../../components/popUpWindow/popUpWindow.vue'
  82. import virtualScroll from '../../components/virtualScroll/virtualScroll.vue'
  83. import virtualScroll1 from '../../components/virtualScroll1/virtualScroll1.vue'
  84. export default {
  85. components: {
  86. sTabbar,
  87. serviceList,
  88. popUpWindow,
  89. virtualScroll,
  90. virtualScroll1
  91. },
  92. data() {
  93. return {
  94. notification: {},
  95. showService: false,
  96. menuTitles: ['CustomerService', 'Certifcate', 'Deposit', 'Withdraw'],
  97. agreementTitles: ['agreement_item_1', 'agreement_item_2', 'agreement_item_3', 'agreement_item_4'],
  98. serverList: [],
  99. onList: [],
  100. outList: [],
  101. vipList: [],
  102. userInfo: {},
  103. vipInfo: {},
  104. notificationType: {
  105. en: 'keyEnglish',
  106. es: "keySpanish",
  107. zh: "keyChinese",
  108. ar : "keyA",
  109. fr : "keyF",
  110. ru : "keyE"
  111. },
  112. showPopUp : uni.getStorageSync('clickPopUp') ? false : true
  113. }
  114. },
  115. onShow() {
  116. this.getIndexIcon()
  117. this.getNotice()
  118. this.getUserInfo()
  119. this.forgetPass()
  120. },
  121. methods: {
  122. //跳转证书页面
  123. toCertificate() {
  124. uni.navigateTo({
  125. url: `/pages/instructions/instructions?index=1&type=onList`
  126. })
  127. },
  128. //跳转充值页面
  129. toPurse() {
  130. uni.navigateTo({
  131. url: '/pages/purse/purse?type=1'
  132. })
  133. },
  134. //跳转提现页面
  135. toWithdraw() {
  136. uni.navigateTo({
  137. url: '/pages/withdraw/withdraw?type=1'
  138. })
  139. },
  140. //显示客服列表
  141. revealServiceList() {
  142. this.showService = true;
  143. },
  144. //关闭客服列表
  145. closeServiceList() {
  146. this.showService = false;
  147. },
  148. //跳转说明页面(六合一)
  149. toinstructions(index) {
  150. this.$play()
  151. uni.navigateTo({
  152. url: `/pages/instructions/instructions?index=${index}`
  153. })
  154. },
  155. //获取首页图标
  156. getIndexIcon() {
  157. this.request('indexIcon').then(res => {
  158. if (res.code == 200) {
  159. this.onList = res.result.onList;
  160. this.outList = res.result.outList;
  161. }
  162. })
  163. },
  164. //获取vip套餐
  165. getVipShop() {
  166. this.request('vipShop').then(res => {
  167. if (res.code == 200) {
  168. res.result.forEach(item => {
  169. if (this.vipInfo && item.id == this.vipInfo.id) {
  170. item.current = true
  171. }
  172. })
  173. this.vipList = res.result
  174. }
  175. })
  176. },
  177. //获取通知
  178. getNotice() {
  179. this.request('indexNotice').then(res => {
  180. if (res.code == 200) {
  181. this.notification = res.result
  182. }
  183. })
  184. },
  185. //用户点击菜单
  186. clickMenu(index) {
  187. this.$play()
  188. if (index == 0) {
  189. this.revealServiceList()
  190. }
  191. if (index == 1) {
  192. this.toCertificate()
  193. }
  194. if (index == 2) {
  195. this.toPurse()
  196. }
  197. if (index == 3) {
  198. this.toWithdraw()
  199. }
  200. },
  201. //获取用户信息
  202. getUserInfo() {
  203. this.request('userInfo').then(res => {
  204. if (res.code == 200) {
  205. this.userInfo = res.result.userInfo
  206. this.vipInfo = res.result.vip
  207. this.getVipShop()
  208. }
  209. })
  210. },
  211. //忘记密码(获取客服列表)
  212. forgetPass() {
  213. this.request('forgetPass').then(res => {
  214. if (res.code == 200) {
  215. this.serverList = res.result
  216. }
  217. })
  218. },
  219. //跳转签到页面
  220. toSignin() {
  221. this.$play()
  222. uni.navigateTo({
  223. url: '/pages/signIn/signIn'
  224. })
  225. },
  226. //关闭弹框
  227. closePopUp(){
  228. this.showPopUp = false
  229. }
  230. }
  231. }
  232. </script>
  233. <style lang="scss" scoped>
  234. .home {
  235. width: 750rpx;
  236. min-height: 100vh;
  237. margin: 0 auto;
  238. background-size: 100%;
  239. background-repeat: no-repeat;
  240. padding-bottom: 200rpx;
  241. .content {
  242. width: 96%;
  243. margin: 0 auto;
  244. }
  245. .home-top {
  246. display: flex;
  247. justify-content: space-between;
  248. align-items: center;
  249. height: 60rpx;
  250. padding: 20rpx 0rpx;
  251. .menu-icon {
  252. image {
  253. width: 50rpx;
  254. height: 50rpx;
  255. }
  256. }
  257. .logo {
  258. color: uni-bg-color-app;
  259. font-weight: bold;
  260. font-size: 32rpx;
  261. }
  262. .sign {
  263. image {
  264. width: 60rpx;
  265. }
  266. }
  267. }
  268. .user-info {
  269. display: flex;
  270. flex-direction: column;
  271. align-items: center;
  272. margin: 20rpx 0rpx;
  273. .user-name {
  274. font-size: 34rpx;
  275. }
  276. .member-image {
  277. image {
  278. width: 150rpx;
  279. height: 110rpx;
  280. }
  281. }
  282. }
  283. .menu-list,
  284. .agreement-list {
  285. display: flex;
  286. flex-wrap: wrap;
  287. justify-content: space-around;
  288. text-align: center;
  289. .menu-item,
  290. .agreement-item {
  291. display: flex;
  292. flex-direction: column;
  293. align-items: center;
  294. width: calc(25% - 20px);
  295. flex-shrink: 0;
  296. image {
  297. width: 110rpx;
  298. height: 110rpx;
  299. }
  300. .menu-descript {
  301. box-sizing: border-box;
  302. width: 100%;
  303. text-align: center;
  304. word-break: break-all;
  305. font-size: 24rpx;
  306. margin: 10rpx 0rpx;
  307. padding: 0rpx 12rpx;
  308. }
  309. }
  310. .agreement-item {
  311. font-size: 19rpx;
  312. image {
  313. width: 90rpx;
  314. height: 90rpx;
  315. }
  316. }
  317. }
  318. .agreement-list {
  319. padding-bottom: 40rpx;
  320. }
  321. .member-list {
  322. display: flex;
  323. flex-wrap: wrap;
  324. justify-content: space-between;
  325. margin: 20rpx auto;
  326. .member-item {
  327. position: relative;
  328. box-sizing: border-box;
  329. padding: 15rpx;
  330. width: calc(50% - 10rpx);
  331. border-radius: 10rpx;
  332. border: 1px solid #00000080;
  333. margin-bottom: 25rpx;
  334. .status-icon {
  335. box-sizing: border-box;
  336. position: absolute;
  337. width: 100%;
  338. display: flex;
  339. justify-content: flex-end;
  340. padding: 0rpx 20rpx;
  341. .current {
  342. display: flex;
  343. align-items: center;
  344. justify-content: center;
  345. width: 120rpx;
  346. background-image: url('@/static/home/current.png');
  347. background-size: 100%;
  348. background-repeat: no-repeat;
  349. color: black;
  350. font-size: 25rpx;
  351. }
  352. }
  353. .img-box {
  354. display: flex;
  355. justify-content: center;
  356. width: 150rpx;
  357. height: 110rpx;
  358. overflow: hidden;
  359. margin: 20rpx auto;
  360. image {
  361. width: 150rpx;
  362. height: 110rpx;
  363. }
  364. }
  365. .menber-descript {
  366. text-align: center;
  367. color: $uni-bg-color-app;
  368. font-size: 28rpx;
  369. margin-bottom: 10rpx;
  370. }
  371. .equity-list {
  372. // color: white;
  373. font-size: 20rpx;
  374. padding-bottom: 40rpx;
  375. .equity-item {
  376. padding-left: 15rpx;
  377. position: relative;
  378. word-break: break-all;
  379. &::before {
  380. position: absolute;
  381. left: 0;
  382. top: 10rpx;
  383. content: '';
  384. width: 5rpx;
  385. height: 5rpx;
  386. background: white;
  387. border-radius: 50%;
  388. }
  389. }
  390. }
  391. }
  392. }
  393. }
  394. </style>