selcetcode.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <template>
  2. <view>
  3. <u--input placeholder="Search your area code" prefixIcon="search" @change="searchCode" color="#333"
  4. border="none" v-model="value" fontSize="28rpx"
  5. :customStyle="{borderRadius:'50px',padding:'4px 12px',background:'#F5F5F5'}"
  6. prefixIconStyle="font-size: 30px;color:#999"></u--input>
  7. <vue-country-intl v-model="countryCode"></vue-country-intl>
  8. <country-code-selector :countryCode.sync="value"></country-code-selector>
  9. <view class="list">
  10. <view class="li font28 flex" v-for="(item,index) in tournamentList" :key="index"
  11. @click="checkboxChange(item,index)">
  12. <text style="width: 100%;height: 30px;margin-top: 20px;text-align: center;" @click="toLogin(item)">{{item.name}}(+{{item.code}})</text>
  13. </view>
  14. </view>
  15. </view>
  16. </template>
  17. <script>
  18. export default {
  19. data() {
  20. return {
  21. value: '',
  22. tournamentList: [],
  23. countryCode:'',
  24. }
  25. },
  26. methods: {
  27. get_cricket_tournament(value) {
  28. uni.$u.http.post(`/api/universal/getHot?code=${value}`, {}).then(res => {
  29. console.log(res)
  30. this.tournamentList = res.CountryCode
  31. console.log(this.tournamentList,1)
  32. }).catch(res => {})
  33. },
  34. searchCode() {
  35. this.get_cricket_tournament(this.value)
  36. },
  37. toLogin(item){
  38. this.$toUrl('./index?code='+item.code+'&name='+item.name+'&thumbnail='+item.thumbnail+'&country_code='+item.country_code)
  39. }
  40. }
  41. }
  42. </script>
  43. <style>
  44. </style>