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.

455 lines
9.1 KiB

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