changeInfo.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <template>
  2. <view>
  3. <view class="chance u-f">
  4. 当前剩余<view class="num">'{{num}}'</view>次修改信息的机会
  5. </view>
  6. <picker :range="address" @change="provinceChange">
  7. <view class="u-s">
  8. <input type="text" v-model="addre"/><view class="icon iconfont icon-down-fill"></view>
  9. </view>
  10. </picker>
  11. <picker :range="subject" @change="subjectChange">
  12. <view class="u-s">
  13. <input type="text" v-model="sub"/><view class="icon iconfont icon-down-fill"></view>
  14. </view>
  15. </picker>
  16. <view class="u-s">
  17. <input type="text" v-model="sco" /><view class="icon1">分数</view>
  18. </view>
  19. <view class="u-s">
  20. <input type="text" v-model="number"/><view class="icon1">位次</view>
  21. </view>
  22. <input type="text" value="确定" class="btn" @tap="goIndex"/>
  23. </view>
  24. </template>
  25. <script>
  26. export default {
  27. data() {
  28. return {
  29. "num":getApp().globalData.global_num,
  30. "address":["山东","北京"],
  31. "addre":getApp().globalData.global_addre,
  32. "sco":getApp().globalData.global_sco,
  33. "subject":["文科","理科"],
  34. "sub":getApp().globalData.global_sub,
  35. "number":"1000"
  36. }
  37. },
  38. methods: {
  39. subjectChange(e){
  40. let m=e.detail.value;
  41. getApp().globalData.global_sub=this.subject[m];
  42. this.sub=getApp().globalData.global_sub
  43. },
  44. provinceChange(e){
  45. let m=e.detail.value;
  46. getApp().globalData.global_addre=this.address[m];
  47. this.addre=getApp().globalData.global_addre;
  48. },
  49. goIndex(){
  50. if(this.num>0){
  51. uni.navigateBack({
  52. delta:1,
  53. });
  54. getApp().globalData.global_num--;
  55. this.num=getApp().globalData.global_num;
  56. getApp().globalData.global_sco=this.sco;
  57. }else{
  58. uni.showToast({
  59. "title":"超过最大修改次数了",
  60. "icon":"none"
  61. })
  62. }
  63. }
  64. }
  65. }
  66. </script>
  67. <style scoped>
  68. .u-f{
  69. display: flex;
  70. justify-content: center;
  71. align-items: center;
  72. }
  73. .u-s{
  74. display: flex;
  75. justify-content: space-between;
  76. align-items: center;
  77. }
  78. .chance{
  79. margin-top: 70upx;
  80. margin-bottom: 30upx;
  81. font-size: 35upx;
  82. color: #999999;
  83. }
  84. .chance .num{
  85. color: #DD524D;
  86. }
  87. input{
  88. width: 80%;
  89. height: 100upx;
  90. margin: 15upx auto;
  91. background:#E7E7E7;
  92. border-radius: 35upx;
  93. position: relative;
  94. padding-left: 40upx;
  95. }
  96. .icon , .icon1{
  97. position: absolute;
  98. right: 100upx;
  99. color: #999999;
  100. font-size: 20upx;
  101. }
  102. .btn{
  103. background: #FF0000;
  104. color: white;
  105. text-align: center;
  106. }
  107. .icon1{
  108. font-size: 30upx;
  109. }
  110. </style>