index.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. <template>
  2. <div
  3. id="index_login_container"
  4. >
  5. <div class="cover_whole">
  6. <!-- 填写表框 -->
  7. <div class="cover_input">
  8. <span class="title">联名邀请,免费测评专注力</span>
  9. <input
  10. placeholder='请输入学校名称'
  11. v-model="school"
  12. placeholder-style="font-size: 28rpx;color: #B0784F;"/>
  13. <input
  14. placeholder='请输入学生'
  15. v-model="student"
  16. placeholder-style="font-size: 28rpx;color: #B0784F;"/>
  17. <button class="cu-btn btn" @click="joint_test">免费测评</button>
  18. </div>
  19. <!-- 滚动 -->
  20. <div class="cover_scroll">
  21. <swiper
  22. class="swiper"
  23. easing-function="linear"
  24. :circular="circular"
  25. :indicator-dots="indicatorDots"
  26. :autoplay="autoplay"
  27. :interval="interval"
  28. :duration="duration"
  29. :vertical="vertical"
  30. >
  31. <block v-for="(item,index) in scroll_list" :key="index">
  32. <swiper-item class="swiper-item"><div class="item">{{ item.school }} {{item.name}} 已联名</div></swiper-item>
  33. </block>
  34. </swiper>
  35. </div>
  36. </div>
  37. <!-- 弹窗 -->
  38. <van-popup
  39. :show="show"
  40. @close="close_pop"
  41. :close-on-click-overlay="true"
  42. custom-class="pop"
  43. overlay
  44. z-index="99"
  45. >
  46. <img class="cover_pop" show-menu-by-longpress="true" src="https://img.shuimuai.com/success_joint.png"/>
  47. </van-popup>
  48. </div>
  49. </template>
  50. <script>
  51. import { addJoint, getJoint } from "../../requests/competition"
  52. import Toast from "../../../static/vant/toast/toast";
  53. var $this;
  54. export default {
  55. name: "scan_container",
  56. data() {
  57. return {
  58. show: false,
  59. school:'',
  60. student: '',
  61. scroll_list:[],
  62. // 轮播配置
  63. indicatorDots: false,
  64. autoplay: true,
  65. interval: 1800,
  66. duration: 1800,
  67. vertical: true,
  68. circular: true,
  69. };
  70. },
  71. methods: {
  72. joint_test(){
  73. let $joint = {
  74. phone: wx.getStorageSync("phone"),
  75. school: $this.school,
  76. name: $this.student
  77. }
  78. addJoint($joint).then((res) => {
  79. console.log("联名",res)
  80. let $res = res.data;
  81. if ($res.code == 0) {
  82. $this.show = true
  83. $this.school = ''
  84. $this.student = ''
  85. }else if($res.code == 1012){
  86. wx.showToast({
  87. title:'请先登录',
  88. icon: "error"
  89. })
  90. }else{
  91. wx.showToast({
  92. title: $res.errmsg,
  93. icon: "error"
  94. })
  95. }
  96. }).catch((err)=>{
  97. console.log("错误",err)
  98. })
  99. },
  100. close_pop() {
  101. $this.show = false;
  102. },
  103. },
  104. mounted() {
  105. getJoint().then((res) => {
  106. console.log("已联名",res)
  107. let $res = res.data;
  108. if ($res.code == 0) {
  109. $this.scroll_list = $res.data
  110. }else{
  111. console.log("获取不到已联名",err)
  112. }
  113. }).catch((err)=>{
  114. console.log("错误",err)
  115. })
  116. },
  117. created() {
  118. $this = this;
  119. },
  120. onUnload(){
  121. $this.show = false;
  122. $this.school = ''
  123. $this.student = ''
  124. }
  125. };
  126. </script>
  127. <style scoped>
  128. #index_login_container {
  129. background-color: #040312;
  130. }
  131. .cover_whole {
  132. background: url("https://img.shuimuai.com/bg_joint_2.png");
  133. width: 100%;
  134. height: 4586px;
  135. background-size: 100% 100%;
  136. background-position: center;
  137. display: flex;
  138. align-items: center;
  139. box-sizing: border-box;
  140. flex-direction: column;
  141. padding-top: 784rpx;
  142. font-family: Alibaba PuHuiTi;
  143. font-weight: 400;
  144. }
  145. .cover_input{
  146. background: url("https://img.shuimuai.com/bg_input.png");
  147. background-size: 100% 100%;
  148. background-position: center;
  149. width: 650rpx;
  150. height: 517rpx;
  151. margin-left: 7px;
  152. display: flex;
  153. align-items: center;
  154. box-sizing: border-box;
  155. flex-direction: column;
  156. justify-content:space-around;
  157. padding: 20px 0 28px
  158. }
  159. .cover_scroll{
  160. background: url("https://img.shuimuai.com/bg_scroll.png");
  161. background-size: 100% 100%;
  162. background-position: center;
  163. width: 634rpx;
  164. height: 111rpx;
  165. margin-top: 88rpx;
  166. padding: 14rpx;
  167. }
  168. .item{
  169. font-size: 24rpx;
  170. color: #FFF1D7;
  171. display: flex;
  172. align-items: center;
  173. box-sizing: border-box;
  174. flex-direction: column;
  175. }
  176. .title{
  177. font-size: 32rpx;
  178. color: #FFAF74;
  179. letter-spacing:5px
  180. }
  181. .btn{
  182. width: 502rpx;
  183. height: 80rpx;
  184. background: linear-gradient(180deg, #FFE8C0 0%, #E19C6A 100%);
  185. border-radius: 40rpx;
  186. font-size: 30rpx;
  187. font-weight: 500;
  188. color: #9A4720;
  189. letter-spacing:5px
  190. }
  191. input{
  192. width: 502rpx;
  193. height: 80rpx;
  194. background: #4A3843;
  195. border: 2px solid #FFAF74;
  196. border-radius: 40rpx;
  197. padding-left: 41rpx;
  198. color: white
  199. }
  200. .cover_pop{
  201. width: 493rpx;
  202. height: 662rpx;
  203. }
  204. </style>
  205. <style>
  206. .pop {
  207. background-color: rgba(255, 255, 255, 0) !important;
  208. }
  209. .swiper{
  210. height:87rpx !important;
  211. }
  212. /* .swiper-item{
  213. height:90rpx !important;
  214. } */
  215. </style>