adolescent.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. <template>
  2. <view>
  3. <PageHeader title="" class="PageHeader">
  4. <template v-slot:center>
  5. 青少年模式
  6. </template>
  7. </PageHeader>
  8. <view class="content-box">
  9. <view class="umbrella-box">
  10. <image class="umbrella" src="../../static/me/qingshaonianmoshi.png"></image>
  11. </view>
  12. <view class="textBox">
  13. <view class="teenageMode">
  14. <view class="title">
  15. 青少年模式
  16. <view class="switchMode "
  17. v-if="youngModeInfo.is_open_young == 0 || youngModeInfo.is_open_young == -1">
  18. 未开启</view>
  19. <view class="switchMode active" v-else>已开启</view>
  20. </view>
  21. <view class="prompt">
  22. 此模式下部分功能无法使用,且会带来以下限制
  23. </view>
  24. </view>
  25. <view class="textList">
  26. <view class="textItem"><span>·</span>青少年模式下,将不支持充值、订阅会员功能</view>
  27. <view class="textItem"><span>·</span>每日22时至次日8时,期间无法使用本应</view>
  28. <view class="textItem"><span>·</span>未成年人每日可使用40分</view>
  29. </view>
  30. </view>
  31. <view class="bottm-box">
  32. <view class="button" @click="goSetpossWord(1)" v-if="youngModeInfo.has_password == false">设置密码</view>
  33. <view class="button" @click="goSetpossWord(4)" v-else-if="youngModeInfo.is_open_young == 0 || youngModeInfo.is_open_young == -1">开启青少年模式</view>
  34. <view class="button" @click="goSetpossWord(4)" v-else-if="youngModeInfo.is_open_young == 1">关闭青少年模式</view>
  35. <view class="setPassword" @click="goSetpossWord(2)" v-if="youngModeInfo.has_password">修改密码</view>
  36. </view>
  37. </view>
  38. </view>
  39. </template>
  40. <script>
  41. export default {
  42. data() {
  43. return {
  44. youngModeInfo: {
  45. has_password: false, //是否有密码
  46. is_open_young: -1, //是否开启青少年模式
  47. str: ""
  48. }
  49. }
  50. },
  51. onLoad() {
  52. },
  53. onShow(){
  54. this.getYoungModeInfo();
  55. },
  56. methods: {
  57. getYoungModeInfo() {
  58. uni.request({
  59. url: this.$apiHost + '/Young/getYoungModeInfo',
  60. data: {
  61. uuid: getApp().globalData.uuid,
  62. skey: getApp().globalData.skey,
  63. },
  64. header: {
  65. "content-type": "application/json",
  66. 'sign': getApp().globalData.headerSign
  67. },
  68. success: (res) => {
  69. console.log("数据", res.data);
  70. this.youngModeInfo = res.data;
  71. },
  72. complete: () => { },
  73. fail: (e) => { }
  74. });
  75. },
  76. goSetpossWord(state) {
  77. uni.navigateTo({
  78. url: "/pages/my/teenagePassword?state=" + state+"&is_open_young="+this.youngModeInfo.is_open_young,
  79. })
  80. }
  81. }
  82. }
  83. </script>
  84. <style lang="scss">
  85. page {
  86. background: url("../../static/me/wd_bg_bianjiziliao.png") top center/ 100% auto no-repeat,
  87. #f2f6f2;
  88. font-family: 'PingFang SC-Medium';
  89. }
  90. .PageHeader {
  91. background: url("../../static/me/wd_bg_bianjiziliao.png") center top / 100% auto no-repeat,
  92. #f2f6f2;
  93. background-position-y: -var(--status-bar-height);
  94. }
  95. .content-box {
  96. padding-top: calc(210rpx + var(--status-bar-height));
  97. .umbrella-box {
  98. padding-bottom: 96rpx;
  99. display: flex;
  100. align-items: center;
  101. justify-content: center;
  102. .umbrella {
  103. width: 364rpx;
  104. height: 364rpx;
  105. }
  106. }
  107. .textBox {
  108. padding: 0 40rpx;
  109. .teenageMode {
  110. display: flex;
  111. align-items: center;
  112. justify-content: center;
  113. flex-direction: column;
  114. .title {
  115. display: flex;
  116. align-items: center;
  117. justify-content: center;
  118. font-weight: 400;
  119. font-size: 36rpx;
  120. font-family: 'PingFang SC-Bold';
  121. color: #1F1F1F;
  122. position: relative;
  123. left: 0;
  124. top: 0;
  125. .switchMode {
  126. position: absolute;
  127. right: -95rpx;
  128. top: 50%;
  129. transform: translateY(-50%);
  130. width: 80rpx;
  131. height: 36rpx;
  132. font-weight: 400;
  133. font-size: 20rpx;
  134. color: #999999;
  135. background: url(../../static/me/text-bg.png) center top / 100% auto no-repeat;
  136. display: flex;
  137. align-items: center;
  138. justify-content: center;
  139. &.active {
  140. background: url(../../static/me/text-bg-active.png) center top / 100% auto no-repeat;
  141. color: #8BB849;
  142. }
  143. }
  144. }
  145. .prompt {
  146. font-weight: 400;
  147. font-size: 24rpx;
  148. color: #999999;
  149. padding-top: 18rpx;
  150. padding-bottom: 54rpx;
  151. }
  152. }
  153. .textList {
  154. line-height: 2.5;
  155. font-weight: 400;
  156. font-size: 28rpx;
  157. color: #1F1F1F;
  158. .textItem {
  159. display: flex;
  160. align-items: center;
  161. span {
  162. display: inline-block;
  163. padding-right: 15rpx;
  164. font-size: 56rpx;
  165. line-height: 0;
  166. font-weight: 700;
  167. }
  168. }
  169. }
  170. }
  171. .bottm-box {
  172. padding: 0 62rpx;
  173. margin-top: 150rpx;
  174. padding-bottom: 100rpx;
  175. .button {
  176. font-weight: 400;
  177. font-size: 32rpx;
  178. color: #FFFFFF;
  179. background: #1F1F1F;
  180. border-radius: 58rpx;
  181. padding: 22rpx 0;
  182. display: flex;
  183. align-items: center;
  184. justify-content: center;
  185. }
  186. .setPassword {
  187. text-align: center;
  188. color: #0084FF;
  189. font-weight: 400;
  190. font-size: 28rpx;
  191. color: #0084FF;
  192. padding-top: 24rpx;
  193. }
  194. }
  195. }
  196. </style>