phone.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  1. <template>
  2. <view class="center">
  3. <view class="status_bar"><!-- 这里是状态栏 --></view>
  4. <view class="content-money">
  5. <view class="body-title">
  6. <view class="goback-box" @click="toBack"><image class="goback" src="../../static/icon/fanhui.png" mode=""></image></view>
  7. <view class="header">充值中心</view>
  8. </view>
  9. <view class="content-bg"></view>
  10. <view class="phone">
  11. <view class="phone-title">充值号码</view>
  12. <view class="input"><input type="text" value="phone" v-model="phone" placeholder="请输入充值号码" placeholder-class="input" /></view>
  13. </view>
  14. </view>
  15. <view class="main-box">
  16. <view class="main-title">请选择充值套餐</view>
  17. <view class="main">
  18. <view class="main-item" v-for="(item, index) in moneyList" :class="{ current: money === item.price }" :key="index" @click="change(item.price)">
  19. <view class="num">
  20. {{ item.money }}
  21. <text>元</text>
  22. </view>
  23. <view class="yuan">售价{{ item.price }}元</view>
  24. </view>
  25. </view>
  26. <view class="zj">
  27. <view class="zj-left">
  28. 应付金额
  29. </view>
  30. <view class="zj-right">
  31. ¥{{money}}元
  32. </view>
  33. </view>
  34. </view>
  35. <view class="explain">
  36. <view class="explain-left">
  37. 充值说明
  38. </view>
  39. <view class="explain-right">
  40. </view>
  41. </view>
  42. <view class="btn">
  43. 立即充值
  44. </view>
  45. </view>
  46. </template>
  47. <script>
  48. export default {
  49. data() {
  50. return {
  51. phone: '',
  52. money: 9.9,
  53. moneyList: [
  54. {
  55. money: 10,
  56. price: 9.9
  57. },
  58. {
  59. money: 20,
  60. price: 19.9
  61. },
  62. {
  63. money: 30,
  64. price: 29.9
  65. },
  66. {
  67. money: 50,
  68. price: 49.9
  69. },
  70. {
  71. money: 100,
  72. price: 99.9
  73. },
  74. {
  75. money: 200,
  76. price: 199.9
  77. },
  78. {
  79. money: 300,
  80. price: 299.9
  81. },
  82. {
  83. money: 500,
  84. price: 499.9
  85. },
  86. {
  87. money: 1000,
  88. price: 999.9
  89. }
  90. ]
  91. };
  92. },
  93. methods: {
  94. // 点击返回 我的页面
  95. toBack() {
  96. uni.navigateBack({});
  97. },
  98. change(money){
  99. this.money = money
  100. }
  101. }
  102. };
  103. </script>
  104. <style lang="scss">
  105. page,.center {
  106. background: #f1f1f1;
  107. height: 100%;
  108. padding-bottom: 30rpx;
  109. }
  110. .status_bar {
  111. height: var(--status-bar-height);
  112. width: 100%;
  113. }
  114. .content-money {
  115. padding-bottom: 30rpx;
  116. position: relative;
  117. height: 520rpx;
  118. .content-bg {
  119. position: absolute;
  120. top: 0;
  121. left: 0;
  122. right: 0;
  123. width: 750rpx;
  124. height: 520rpx;
  125. background: linear-gradient(30deg, #2e58ff, #33eeff);
  126. border-bottom-right-radius: 35%;
  127. border-bottom-left-radius: 35%;
  128. }
  129. .body-title {
  130. height: 80rpx;
  131. text-align: center;
  132. font-size: 35rpx;
  133. position: relative;
  134. .header {
  135. position: absolute;
  136. left: 0;
  137. top: 0;
  138. width: 100%;
  139. font-size: 36rpx;
  140. font-family: PingFang SC;
  141. font-weight: bold;
  142. color: #fffeff;
  143. height: 80rpx;
  144. font-size: 36rpx;
  145. font-weight: 700;
  146. z-index: 9;
  147. display: flex;
  148. justify-content: center;
  149. align-items: center;
  150. }
  151. .goback-box {
  152. position: absolute;
  153. left: 18rpx;
  154. top: 0;
  155. height: 80rpx;
  156. display: flex;
  157. align-items: center;
  158. }
  159. .goback {
  160. z-index: 100;
  161. width: 34rpx;
  162. height: 34rpx;
  163. }
  164. }
  165. }
  166. .phone {
  167. position: relative;
  168. z-index: 10;
  169. padding: 50rpx 27rpx 0;
  170. .phone-title {
  171. font-size: 26rpx;
  172. font-family: PingFang SC;
  173. font-weight: bold;
  174. color: #ffffff;
  175. }
  176. .input {
  177. font-size: 28rpx;
  178. font-family: PingFang SC;
  179. font-weight: bold;
  180. color: #ffffff;
  181. margin-top: 20rpx;
  182. padding-bottom: 20rpx;
  183. border-bottom: 1px solid #e5e5e5;
  184. }
  185. }
  186. .main-box {
  187. position: relative;
  188. z-index: 10;
  189. width: 694rpx;
  190. background: #ffffff;
  191. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  192. border-radius: 20rpx;
  193. margin: -200rpx auto 0;
  194. padding: 30rpx;
  195. .main-title {
  196. font-size: 28rpx;
  197. font-family: PingFang SC;
  198. font-weight: bold;
  199. color: #010101;
  200. }
  201. .main {
  202. padding-top: 14rpx;
  203. display: flex;
  204. justify-content: space-between;
  205. flex-wrap: wrap;
  206. align-items: center;
  207. .current {
  208. background: linear-gradient(0deg, #2e58ff, #32c6ff) !important;
  209. .num,.yuan{
  210. color: #FFFFFF !important;
  211. }
  212. }
  213. .main-item {
  214. margin-top: 14rpx;
  215. line-height: 1;
  216. width: 204rpx;
  217. height: 130rpx;
  218. background: #d6e9ff;
  219. border-radius: 7rpx;
  220. display: flex;
  221. flex-direction: column;
  222. justify-content: center;
  223. align-items: center;
  224. .num {
  225. font-size: 36rpx;
  226. font-family: PingFang SC;
  227. font-weight: bold;
  228. color: #2e58ff;
  229. text {
  230. display: inline-block;
  231. padding-left: 8rpx;
  232. font-size: 26rpx;
  233. }
  234. }
  235. .yuan {
  236. margin-top: 18rpx;
  237. font-size: 20rpx;
  238. font-family: PingFang SC;
  239. font-weight: bold;
  240. color: #999999;
  241. }
  242. }
  243. }
  244. .zj {
  245. margin-top: 26rpx;
  246. display: flex;
  247. justify-content: space-between;
  248. align-items: center;
  249. .zj-left {
  250. font-size: 28rpx;
  251. font-family: PingFang SC;
  252. font-weight: bold;
  253. color: #333333;
  254. }
  255. .zj-right {
  256. font-size: 28rpx;
  257. font-family: PingFang SC;
  258. font-weight: bold;
  259. color: #FF0000;
  260. }
  261. }
  262. }
  263. .explain {
  264. margin: 20rpx auto 0;
  265. padding: 24rpx 28rpx;
  266. display: flex;
  267. align-items: center;
  268. justify-content: space-between;
  269. width: 694rpx;
  270. background: #FFFFFF;
  271. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  272. border-radius: 20rpx;
  273. .explain-left {
  274. font-size: 28rpx;
  275. font-family: PingFang SC;
  276. font-weight: bold;
  277. color: #333333;
  278. }
  279. .explain-right {
  280. position: relative;
  281. bottom: 14rpx;
  282. right: 28rpx;
  283. }
  284. .explain-right:after,.explain-right:before {
  285. border: 12rpx solid transparent;
  286. border-left: 12rpx solid #fff;
  287. width: 0;
  288. height: 0;
  289. position: absolute;
  290. top: 0;
  291. right: -20px;
  292. content: ' ';
  293. }
  294. .explain-right:before {
  295. border-left-color: #333333;
  296. right: -21px;
  297. }
  298. }
  299. .btn {
  300. margin: 200rpx auto 0;
  301. width: 696rpx;
  302. height: 84rpx;
  303. background: linear-gradient(0deg, #2E58FF, #32C6FF);
  304. border-radius: 42rpx;
  305. text-align: center;
  306. line-height: 84rpx;
  307. font-size: 32rpx;
  308. font-family: PingFang SC;
  309. font-weight: bold;
  310. color: #FFFFFF;
  311. }
  312. </style>