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.

457 lines
9.2 KiB

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