特易招,招聘小程序
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.

114 lines
1.8 KiB

7 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
7 months ago
5 months ago
5 months ago
5 months ago
5 months ago
7 months ago
5 months ago
7 months ago
5 months ago
7 months ago
5 months ago
7 months ago
5 months ago
7 months ago
  1. <template>
  2. <view class="page">
  3. <navbar
  4. title="兑换码"
  5. leftClick
  6. @leftClick="$utils.navigateBack"
  7. />
  8. <view class="input">
  9. <input type="text" v-model="form.code"
  10. placeholder="请输入兑换码"/>
  11. <view class="btn" @click="useExchange()">
  12. 兑换
  13. </view>
  14. </view>
  15. <view class="list">
  16. <view class="item"
  17. v-for="(item, index) in listInfo"
  18. :key="index">
  19. <view class="title">
  20. {{item.question}}
  21. </view>
  22. <view class="info">
  23. {{item.answer}}
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. </template>
  29. <script>
  30. export default {
  31. data() {
  32. return {
  33. form : {
  34. code:'',
  35. },
  36. listInfo:[]
  37. }
  38. },
  39. onShow() {
  40. this.queryExchangeList();
  41. },
  42. methods: {
  43. queryExchangeList(){
  44. this.$api('queryExchangeList',{}, res =>{
  45. if(res.code == 200){
  46. this.listInfo = res.result.records;
  47. }
  48. })
  49. },
  50. useExchange(){
  51. if(this.$utils.verificationAll(this.form,{
  52. code:'请输入兑换码'
  53. })) {
  54. return
  55. }
  56. this.$api('useExchange',this.form, res =>{
  57. if(res.code == 200){
  58. uni.showToast({
  59. title:'兑换成功',
  60. icon: 'none'
  61. })
  62. }
  63. })
  64. },
  65. },
  66. }
  67. </script>
  68. <style scoped lang="scss">
  69. .page{
  70. .input{
  71. display: flex;
  72. width: 690rpx;
  73. margin: 30rpx;
  74. margin-top: 80rpx;
  75. input{
  76. height: 50rpx;
  77. padding: 10rpx 20rpx;
  78. flex: 1;
  79. border: 1px solid $uni-color;
  80. border-radius: 15rpx;
  81. margin-right: 20rpx;
  82. background-color: #fff;
  83. }
  84. .btn{
  85. width: 100rpx;
  86. height: 70rpx;
  87. text-align: center;
  88. line-height: 70rpx;
  89. background-color: $uni-color;
  90. color: #fff;
  91. border-radius: 15rpx;
  92. }
  93. }
  94. .list{
  95. margin: 30rpx;
  96. .item{
  97. margin: 30rpx 0;
  98. .title{
  99. margin-bottom: 10rpx;
  100. }
  101. .info{
  102. color: #f40;
  103. }
  104. }
  105. }
  106. }
  107. </style>