index.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731
  1. <!-- 登录注册 -->
  2. <template>
  3. <view class="index">
  4. <view class="index-back" style="position: fixed;top: 0;left: 0;right: 0;">
  5. <!-- <u-navbar :background="bg" back-icon-color="#fff" :is-fixed="false">
  6. </u-navbar> -->
  7. <image src="../../static/image/common/grade-left.png" mode="" @click="back()"></image>
  8. </view>
  9. <!-- <downloadHead v-if="show1"></downloadHead> -->
  10. <!-- <image @click="back()" src="../../static/image/live/grade-left.png" class="back" mode=""></image> -->
  11. <!-- 手机号登录 -->
  12. <view style="width:100%;display:flex;justify-content: center;align-items: center;margin-top:160rpx;">
  13. <image src="../../static/image/login/newlogo.png" style="width:310rpx;height:174rpx"></image>
  14. </view>
  15. <view class="" style="width:inherit;margin-top: 0rpx;">
  16. <view class="login" v-if="type==1&&current==0">
  17. <view class="">
  18. <u-tabs :list="tabList" @click="change" :current="current" lineHeight="4" lineWidth="100rpx"
  19. lineColor="#DC3C23" :activeStyle="{color:'#DC3C23',fontSize:'32rpx',fontWeight:'Bold'}"
  20. :inactiveStyle="{color:'#fff',fontSize:'32rpx'}
  21. "></u-tabs>
  22. <!-- <u-tabs :list="tabList" bg-color="" inactive-color="#B3B4B7" bar-width="120" :is-scroll="false" gutter="400" font-size="32" active-color="#DC3C23" :current="current" @change="change"></u-tabs> -->
  23. </view>
  24. <!-- <view class="input flex-start" style="background:#ffffff;border-radius: 5rpx;" @click="toSelcet()">
  25. <view style="margin-left: 15px;" v-if="searchname!=''">{{searchname}}(+{{searchcode}})</view>
  26. <view style="margin-left: 15px;" v-if="searchname==''">Select your area code </view>
  27. </view> -->
  28. <view class="input flex-start" style="background:#ffffff;border-radius: 5rpx;color: #000000"
  29. @click="poupuu()">
  30. <view style="margin-left: 15px;">
  31. <image :src="thumbnail" style="width: 40px;height: 30px;"></image>
  32. <view v-if="country_code" style="position: relative;top: -10px;right: -8px;display: inline-block;">
  33. {{searchname}}({{country_code}})</view>
  34. </view>
  35. </view>
  36. <view class="input flex-start" style="background:#ffffff;border-radius: 5rpx;">
  37. <!-- <view class="flex-center" @click="region = true">
  38. <image style="width:25rpx;height: 36rpx;margin-left:30rpx;margin-right:10rpx;"
  39. src="../../static/image/login/phone.png" mode=""></image>
  40. <text style="color:#111111">{{from.code1}}</text>
  41. <image style="width:22rpx;height: 12rpx;margin-left:16rpx" src="../../static/image/login/nd.png"
  42. mode=""></image>
  43. </view> -->
  44. <view class="flex-center">
  45. <image style="width:25rpx;height: 36rpx;margin-left:30rpx;margin-right:10rpx;"
  46. src="../../static/image/login/phone.png" mode=""></image>
  47. <u--input border="surround" v-model="from.code1" @change="toSelcetChange"
  48. style="color:#000000 !important;width:50px;border: 0px;" placeholder-style="color:#A0A4A7"
  49. customStyle="padding:0px !important;"></u--input>
  50. </view>
  51. <input type="text" value="" placeholder-style="color:#A0A4A7" v-model="from.mobile"
  52. :placeholder="$t('common.inputPhone')" style="color:#000000 !important;" />
  53. </view>
  54. <view class="input flex-start" style="background:#ffffff;border-radius: 5rpx;">
  55. <view class=" flex-center">
  56. <image style="width:32rpx;height: 36rpx;margin-left:30rpx;"
  57. src="../../static/image/login/code.png" mode="">
  58. </image>
  59. <!-- <div style="width:22rpx;height:36rpx;border-right:1rpx solid #a0a4a7;margin-left:60rpx;"></div> -->
  60. </view>
  61. <input type="text" value="" v-model="from.code" placeholder-style="color:#A0A4A7"
  62. placeholder="Verifcation code" style="color:#000000 !important;" />
  63. <text @tap="getCode(3)" style="margin-right:20rpx;">{{tips}}</text>
  64. </view>
  65. <view class="btn" :class="{'btn-active':from.code != 0 }" @click="submit(1)"
  66. style="background:#DC3C23 !important;">
  67. {{$t('login.login')}}
  68. </view>
  69. </view>
  70. <!-- 密码登录 -->
  71. <view class="passlogin" v-if="type==1&&current==1">
  72. <view class="">
  73. <!-- <u-tabs :list="tabList" bg-color="" inactive-color="#B3B4B7" bar-width="120" :is-scroll="false" gutter="400" font-size="32" active-color="#DC3C23" :current="current" @change="change"></u-tabs> -->
  74. <view class="">
  75. <u-tabs :list="tabList" @click="change" lineHeight="4" lineWidth="100rpx" :current="current"
  76. lineColor="#DC3C23" :activeStyle="{color:'#DC3C23',fontSize:'32rpx',fontWeight:'Bold'}"
  77. :inactiveStyle="{color:'#fff',fontSize:'32rpx'}
  78. "></u-tabs>
  79. <!-- <u-tabs :list="tabList" bg-color="" inactive-color="#B3B4B7" bar-width="120" :is-scroll="false" gutter="400" font-size="32" active-color="#DC3C23" :current="current" @change="change"></u-tabs> -->
  80. </view>
  81. </view>
  82. <view class="input flex-start" style="background:#ffffff;border-radius: 5rpx;color: #000000"
  83. @click="poupuu()">
  84. <view style="margin-left: 15px;">
  85. <image :src="thumbnail" style="width: 40px;height: 30px;"></image>
  86. <view style="position: relative;top: -10px;right: -8px;display: inline-block;">
  87. {{searchname}}({{country_code}})</view>
  88. </view>
  89. </view>
  90. <view class="input flex-start" style="background:#ffffff;border-radius: 5rpx;">
  91. <!-- <view class="flex-center" @click="region=!region">
  92. <image style="width:25rpx;height: 36rpx;margin-left:30rpx;margin-right:10rpx;"
  93. src="../../static/image/login/phone.png" mode=""></image>
  94. <text style="color:#111111">{{from.code1}}</text>
  95. <image style="width:22rpx;height: 12rpx;margin-left:16rpx"
  96. src="../../static/image/login/nd.png" mode=""></image>
  97. <!-- <image style="width:22rpx;height: 12rpx;margin-left:16rpx"
  98. src="../../static/image/login/login2.png" mode=""></image> -->
  99. <!-- </view> -->
  100. <view class="flex-center">
  101. <image style="width:25rpx;height: 36rpx;margin-left:30rpx;margin-right:10rpx;"
  102. src="../../static/image/login/phone.png" mode=""></image>
  103. <u--input border="surround" v-model="from.code1" @change="toSelcetChange"
  104. style="color:#000000 !important;width:50px;border: 0px;" placeholder-style="color:#A0A4A7"
  105. customStyle="padding:0px !important;"></u--input>
  106. </view>
  107. <input v-model="from.mobile" type="text" value="" placeholder-style="color:#A0A4A7"
  108. :placeholder="$t('common.inputPhone')" style="color:#000000 !important;" />
  109. </view>
  110. <view class="input flex-start inputCss" style="background:#ffffff;border-radius: 5rpx;">
  111. <view class="flex-center">
  112. <image style="width:32rpx;height: 36rpx;margin-left:30rpx;"
  113. src="../../static/image/login/pwd.png" mode="">
  114. </image>
  115. </view>
  116. <u--input class="inp" border="none" color="#000000" :placeholder="$t('common.inputPw')"
  117. v-model="from.password" :type="pwshow?'text':'password'" style="padding-left: 20rpx;"
  118. placeholder-style="color: #A0A4A7">
  119. <image slot="suffix" @click="pwshow = !pwshow"
  120. style="width: 36rpx;height: 24rpx;margin-right:20rpx;"
  121. :src="!pwshow?'/static/image/login/hide.png':'/static/image/login/show.png'"
  122. mode="aspectFill">
  123. </image>
  124. </u--input>
  125. <!-- <input type="text" value="" v-model="from.password" placeholder-style="color:white" placeholder="请输入密码" /> -->
  126. <!-- <image style="width: 36rpx;height: 24rpx;" src="../../static/image/login/login3.png" mode=""></image> -->
  127. </view>
  128. <view class="btn" :class="{'btn-active':from.password != 0 }" @click="submit(2)"
  129. style="background:#DC3C23 !important;">
  130. {{$t('login.login')}}
  131. </view>
  132. </view>
  133. <!-- w忘记密码 -->
  134. <view class="regit" v-if="type==2">
  135. <view class="">
  136. <view class="">
  137. <u-tabs :list="tabList" @click="change" lineHeight="4" lineWidth="100rpx" lineColor="#DC3C23"
  138. :activeStyle="{color:'#DC3C23',fontSize:'32rpx',fontWeight:'Bold'}" :inactiveStyle="{color:'#fff',fontSize:'32rpx'}
  139. "></u-tabs>
  140. <!-- <u-tabs :list="tabList" bg-color="" inactive-color="#B3B4B7" bar-width="120" :is-scroll="false" gutter="400" font-size="32" active-color="#DC3C23" :current="current" @change="change"></u-tabs> -->
  141. </view>
  142. <!-- <u-tabs :list="tabList" bg-color="" inactive-color="#B3B4B7" bar-width="120" :is-scroll="false" gutter="400" font-size="32" active-color="#DC3C23" :current="current" @change="change"></u-tabs> -->
  143. </view>
  144. <view class="input flex-start" style="background:#ffffff;border-radius: 5rpx;color: #000000"
  145. @click="poupuu()">
  146. <view style="margin-left: 15px;">
  147. <image :src="thumbnail" style="width: 40px;height: 30px;"></image>
  148. <view style="position: relative;top: -10px;right: -8px;display: inline-block;">
  149. {{searchname}}({{country_code}})</view>
  150. </view>
  151. </view>
  152. <view class="input flex-start" style="background:#ffffff;border-radius: 5rpx;">
  153. <!-- <text style="color:white">{{from.code1}}</text>
  154. <image style="width:22rpx;height: 12rpx;margin-left:16rpx"
  155. src="../../static/image/login/login2.png" mode=""></image> -->
  156. <!-- <image style="width:25rpx;height: 36rpx;margin-left:30rpx;margin-right:10rpx;"
  157. src="../../static/image/login/phone.png" mode=""></image>
  158. <text style="color:#111111">{{from.code1}}</text>
  159. <image style="width:22rpx;height: 12rpx;margin-left:16rpx" src="../../static/image/login/nd.png"
  160. mode=""></image> -->
  161. <view class="flex-center">
  162. <image style="width:25rpx;height: 36rpx;margin-left:30rpx;margin-right:10rpx;"
  163. src="../../static/image/login/phone.png" mode=""></image>
  164. <u--input border="surround" v-model="from.code1" @change="toSelcetChange"
  165. style="color:#000000 !important;width:50px;border: 0px;" placeholder-style="color:#A0A4A7"
  166. customStyle="padding:0px !important;"></u--input>
  167. </view>
  168. <input type="text" value="" v-model="from.mobile" placeholder-style="color:#A0A4A7"
  169. :placeholder="$t('common.inputPhone')" style="color:#000000 !important;" />
  170. </view>
  171. <view class="input flex-start" style="background:#ffffff;border-radius: 5rpx;">
  172. <view class="flex-center">
  173. <!-- <image style="width:32rpx;height: 36rpx;" src="../../static/image/login/login4.png" mode="">
  174. </image> -->
  175. <image style="width:32rpx;height: 36rpx;margin-left:30rpx;"
  176. src="../../static/image/login/code.png" mode="">
  177. </image>
  178. </view>
  179. <input type="text" value="" placeholder-style="color:#A0A4A7" v-model="from.code"
  180. placeholder="Verifcation code" style="color:#000000 !important;" />
  181. <text @tap="getCode(2)" style="margin-right:20rpx;">{{tips}}</text>
  182. </view>
  183. <view class="input flex-start inputCss" style="background:#ffffff;border-radius: 5rpx;">
  184. <u--input class="inp" border="none" color="#000000" :placeholder="$t('common.inputPw')"
  185. v-model="from.password" :type="pwshow?'text':'password'" style="padding-left: 30rpx;"
  186. placeholder-style="color: #a0a4a7">
  187. <image slot="suffix" @click="pwshow = !pwshow"
  188. style="width: 36rpx;height: 24rpx;margin-right:20rpx;"
  189. :src="!pwshow?'/static/image/login/hide.png':'/static/image/login/show.png'"
  190. mode="aspectFill">
  191. </image>
  192. </u--input>
  193. </view>
  194. <view class="input flex-start inputCss" style="background:#ffffff;border-radius: 5rpx;">
  195. <u--input class="inp" border="none" color="#000000" :placeholder="$t('login.reEnter')"
  196. v-model="password1" :type="pwshow1?'text':'password'" style="padding-left: 30rpx;"
  197. placeholder-style="color: #A0A4A7">
  198. <image slot="suffix" @click="pwshow1 = !pwshow1"
  199. style="width: 36rpx;height: 24rpx;margin-right:20rpx;"
  200. :src="!pwshow1?'/static/image/login/hide.png':'/static/image/login/show.png'"
  201. mode="aspectFill">
  202. </image>
  203. </u--input>
  204. </view>
  205. <!-- <view class="input flex-start inputCss">
  206. <u--input class="inp" v-model="from.password" type="password" style="padding-left: 20rpx;" :password-icon="true" placeholder-style="color: #fff" />
  207. </view> -->
  208. <view class="btn" :class="{'btn-active':from.password != 0 }" @click="submit(3)"
  209. style="background:#DC3C23 !important;">
  210. {{$t('login.forgetBtn')}}
  211. </view>
  212. </view>
  213. <!-- ''''''''''''''''''''''''注册 -->
  214. <view class="regit" v-if="type==3">
  215. <view class="">
  216. <view class="">
  217. <u-tabs :list="[{name:$t('login.registertips')}]" @click="change" lineHeight="4"
  218. lineWidth="100rpx" lineColor="#DC3C23"
  219. :activeStyle="{color:'#DC3C23',fontSize:'32rpx',fontWeight:'Bold'}" :inactiveStyle="{color:'#fff',fontSize:'32rpx'}
  220. "></u-tabs>
  221. <!-- <u-tabs :list="tabList" bg-color="" inactive-color="#B3B4B7" bar-width="120" :is-scroll="false" gutter="400" font-size="32" active-color="#DC3C23" :current="current" @change="change"></u-tabs> -->
  222. </view>
  223. <!-- <u-tabs :list="tabList" bg-color="" inactive-color="#B3B4B7" bar-width="120" :is-scroll="false" gutter="400" font-size="32" active-color="#DC3C23" :current="current" @change="change"></u-tabs> -->
  224. </view>
  225. <view class="input flex-start" style="background:#ffffff;border-radius: 5rpx;">
  226. <view class=" flex-center" @click="poupuu">
  227. <image style="width:25rpx;height: 36rpx;margin-left:30rpx;margin-right:10rpx;"
  228. src="../../static/image/login/phone.png" mode=""></image>
  229. <text style="color:#111111">{{from.code1}}</text>
  230. <image style="width:22rpx;height: 12rpx;margin-left:16rpx" src="../../static/image/login/nd.png"
  231. mode=""></image>
  232. </view>
  233. <input type="text" value="" v-model="from.mobile" placeholder-style="color:#a0a4a7"
  234. :placeholder="$t('common.inputPhone')" style="color:#000000 !important;" />
  235. </view>
  236. <view class="input flex-start" style="background:#ffffff;border-radius: 5rpx;">
  237. <view class=" flex-center">
  238. <image style="width:32rpx;height: 36rpx;margin-left:30rpx;"
  239. src="../../static/image/login/code.png" mode="">
  240. </image>
  241. </view>
  242. <input type="text" value="" v-model="from.code" placeholder-style="color:#a0a4a7"
  243. placeholder="Verifcation code" style="color:#000000 !important;" />
  244. <text @tap="getCode(1)" style="margin-right:20rpx;">{{tips}}</text>
  245. </view>
  246. <view class="input flex-start inputCss" style="background:#ffffff;border-radius: 5rpx;">
  247. <u--input class="inp" border="none" color="#000000" :placeholder="$t('common.inputPw')"
  248. v-model="from.password" :type="pwshow?'text':'password'" style="padding-left: 20rpx;"
  249. placeholder-style="color: #A0A4A7">
  250. <image slot="suffix" @click="pwshow = !pwshow"
  251. style="width: 36rpx;height: 24rpx;margin-right:20rpx;"
  252. :src="!pwshow?'/static/image/login/hide.png':'/static/image/login/show.png'"
  253. mode="aspectFill">
  254. </image>
  255. </u--input>
  256. </view>
  257. <!-- <view class="input flex-start">
  258. <input type="text" value="" placeholder-style="color:white" placeholder="请重新输入密码" />
  259. </view> -->
  260. <view class="btn" :class="{'btn-active':from.password != 0 }" @click="submit(4)"
  261. style="background:#DC3C23 !important;">
  262. {{$t('login.register')}}
  263. </view>
  264. </view>
  265. <!-- <view class="btn-tab flex" v-if="type==1">
  266. <text style="color: #DC3C23;"
  267. @click="type=3,tabList=[{name:$t('login.register')},{}]">{{$t('login.registertips')}}</text>
  268. <text @click="type=2,tabList=[{name:$t('login.forget')},{}]">{{$t('login.forget')}}?</text>
  269. </view> -->
  270. </view>
  271. <view v-if="type==1">
  272. <!-- <view class="btn" @click="type=3,tabList=[{name:$t('login.register')},{}]"
  273. style="margin-top:60rpx;color:#DC3C23 !important;border:1rpx solid #DC3C23;background:transparent !important;">
  274. {{$t('login.registertips')}}
  275. </view> -->
  276. <view style="display: flex;justify-content: center;margin-top:80rpx;">
  277. <text @click="type=2,tabList=[{name:$t('login.forget')},{}]"
  278. style="color:#DC3C23;">{{$t('login.forget')}}</text>
  279. </view>
  280. </view>
  281. <view class="flex-center agree">
  282. <image :src="!isAgree?'/static/image/match/match_notselected.png':'/static/image/login/select.png'" mode=""
  283. @click="isAgree = !isAgree "></image>
  284. <view class="flex-start">
  285. I read and agree <text @click="$toUrl('./agreement?type=1')">UserService Agreement</text> and <text
  286. @click="$toUrl('./agreement?type=2')">Privacy Pollcy</text>
  287. </view>
  288. </view>
  289. <!-- 倒计时插件 -->
  290. <u-code :seconds="seconds" :startText="$t('login.getCode')" ref="uCode" @change="codeChange"
  291. :endText="$t('login.getCode')" changeText="Xs"></u-code>
  292. <!-- <u-verification-code @change="codeChange" :seconds="seconds" ref="uCode" ></u-verification-code> -->
  293. <!-- <u-picker v-model="region" mode="time"></u-picker> -->
  294. <!-- <u-picker itemHeight="60" :closeOnClickOverlay="true" :cancelText="$t('news.cancel')"
  295. :confirmText="$t('news.confirm')" mode="selector" @close="region=false" :columns="countryCode"
  296. @cancel="region=false" @confirm="regionConfirm" :show="region" keyName="nameCode" :default-selector="[0]">
  297. </u-picker> -->
  298. <view>
  299. <u-overlay :show="region" @close="close" @open="open" :closeable='region'>
  300. <view class="list"
  301. style="height: 90vh;background: #fff;width: 90%; margin: 0 auto; margin-top: 50px; border-radius: 20px; overflow-y: auto;">
  302. <view class="flex header-box">
  303. <text class="size24 c6"></text>
  304. <image src="../../static/image/match/close_ico.png" mode="heightFix" class="close-icon"
  305. @click="close"></image>
  306. </view>
  307. <u--input placeholder="Search your area code" prefixIcon="search" @change="searchcodeLogin"
  308. color="#333" border="none" v-model="searchValue" fontSize="28rpx"
  309. :customStyle="{borderRadius:'50px',padding:'4px 12px',background:'#F5F5F5',margin:'20px'}"
  310. prefixIconStyle="font-size: 30px;color:#999"></u--input>
  311. <view class="li font28 flex" v-for="(item,index) in tournamentList" :key="index"
  312. @click="checkboxChange(item,index)" style=" padding:20px;">
  313. <view>
  314. <image :src="item.thumbnail" style="width: 50px;height: 30px;"></image>
  315. <text
  316. style="position: relative;top: -10px;right: -8px;">{{item.name}}({{item.country_code}})</text>
  317. </view>
  318. <text>+{{item.code}}</text>
  319. </view>
  320. </view>
  321. <!-- <view v-for="(item,index) in countryCode[0]">
  322. <text>{{item.name}}</text>
  323. </view> -->
  324. </u-overlay>
  325. </view>
  326. </view>
  327. </template>
  328. <script>
  329. export default {
  330. data() {
  331. return {
  332. type: 1,
  333. current: 0,
  334. searchValue: '',
  335. seconds: 60,
  336. isAgree: true,
  337. pwshow: false,
  338. pwshow1: false,
  339. searchcode: '',
  340. thumbnail: '',
  341. searchname: '',
  342. custom: {
  343. 'padding': '20px'
  344. },
  345. region: false,
  346. tabList: [{
  347. name: this.$t('login.Number')
  348. },
  349. {
  350. name: this.$t('login.Password')
  351. }
  352. ],
  353. tips: 'get code', //验证码倒计时
  354. password1: '',
  355. country_code: '',
  356. from: {
  357. mobile: '',
  358. password: '',
  359. code1: '+91',
  360. code: '',
  361. device_type: 'H5'
  362. },
  363. timer: null,
  364. tournamentList: [],
  365. bg: {
  366. backgroundColor: 'transparent'
  367. },
  368. countryCode: [], //区号
  369. }
  370. },
  371. onUnload() {
  372. clearInterval(this.timer)
  373. },
  374. computed: {
  375. system() {
  376. return this.$store.state.system
  377. },
  378. show1: {
  379. get() {
  380. return this.$store.state.show
  381. },
  382. set() {
  383. // this.$store.state.info.midMask = !this.$store.state.info.midMask
  384. }
  385. }
  386. },
  387. watch: {
  388. type(e) {
  389. if (e == 2 || e == 3) {
  390. this.current = 0
  391. }
  392. },
  393. // region(e) {
  394. // if (e) {
  395. // this.countryCode = []
  396. // }
  397. // }
  398. },
  399. mounted() {
  400. this.getCountryCode()
  401. this.get_cricket_tournament('')
  402. },
  403. methods: {
  404. poupuu() {
  405. this.region = !this.region
  406. this.get_cricket_tournament('')
  407. },
  408. open() {
  409. // console.log('open');
  410. },
  411. close() {
  412. console.log('close')
  413. this.region = false
  414. // console.log('close');
  415. },
  416. back() {
  417. console.log(3);
  418. },
  419. toSelcet() {
  420. this.$toUrl('./selcetcode')
  421. },
  422. toSelcetChange() {
  423. let value = (this.from.code1).slice(1)
  424. setTimeout(() => {
  425. this.get_cricket_tournament(value)
  426. }, 500)
  427. },
  428. searchcodeLogin() {
  429. this.get_cricket_tournament(this.searchValue)
  430. },
  431. checkboxChange(item, index) {
  432. this.region = false
  433. this.searchcode = item.code
  434. this.searchname = item.name
  435. this.countryCode = item.countryCode
  436. this.from.code1 = '+' + item.code
  437. },
  438. get_cricket_tournament(value) {
  439. uni.$u.http.post(`/api/universal/getHot?code=${value}`, {}).then(res => {
  440. console.log(res)
  441. this.tournamentList = res.CountryCode
  442. this.searchcode = res.CountryCode[0].code
  443. this.searchname = res.CountryCode[0].name
  444. this.country_code = res.CountryCode[0].country_code
  445. this.thumbnail = res.CountryCode[0].thumbnail
  446. console.log(this.tournamentList, 1)
  447. }).catch(res => {})
  448. },
  449. // 提交表单
  450. submit(type) { //1注册 ,2登录 , 3忘记密码
  451. gtag('event', 'login_H5', {
  452. 'login_H5': '0'
  453. });
  454. uni.showLoading({
  455. title: this.$t('common.lab')
  456. })
  457. if (!this.isAgree) return uni.$u.toast('Please agree to the User Agreement and Privacy Policy');
  458. if (!this.from.mobile) return uni.$u.toast('Please enter your phone number');
  459. if (type == 2 && !this.from.password) return uni.$u.toast('Please enter your password');
  460. if (type == 1 && !this.from.code) return uni.$u.toast('Please enter the verification code');
  461. // if(type == 3 || type == 4 && !this.from.code) return uni.$u.toast('Please enter the verification code');
  462. // if(type == 3 || type == 4 && !this.from.password) return uni.$u.toast('Please enter your password');
  463. let that = this;
  464. let obj = JSON.parse(JSON.stringify(this.from))
  465. obj.mobile = (this.from.code1).slice(1) + '-' + this.from.mobile
  466. if (type == 1 || type == 2) { //登录
  467. if (type == 2) {
  468. obj.code = ''
  469. }
  470. uni.$u.http.get('/api/user/login', {
  471. params: obj
  472. }).then(res => {
  473. this.$store.state.info = res;
  474. this.$store.state.isLogin = 1;
  475. uni.setStorage({
  476. key: 'information',
  477. data: res
  478. })
  479. // this.$store.dispatch('logout','')
  480. uni.hideLoading()
  481. // setTimeout(res=>{
  482. this.$store.dispatch('loginTim', res);
  483. // },200)
  484. uni.reLaunch({
  485. url: '/'
  486. })
  487. this.$store.dispatch('getQiNiu')
  488. })
  489. }
  490. if (type == 3) { //忘记密码
  491. if (this.password1 != this.from.password) {
  492. return this.$toast(this.$t('login.pwErr'))
  493. }
  494. uni.$u.http.get('/api/user/forgotPassword', {
  495. params: this.from
  496. }).then(res => {
  497. uni.showToast({
  498. title: this.$t('login.lab13'),
  499. icon: "success"
  500. })
  501. that.from.code = ''
  502. that.from.password = ''
  503. that.back();
  504. uni.hideLoading();
  505. })
  506. }
  507. if (type == 4) { //注册
  508. uni.$u.http.get('/api/user/registered', {
  509. params: that.from
  510. }).then(res => {
  511. uni.showToast({
  512. title: this.$t('login.lab13'),
  513. icon: "success"
  514. })
  515. that.from.code = ''
  516. that.from.password = ''
  517. that.back();
  518. uni.hideLoading()
  519. })
  520. }
  521. this.$refs.uCode.reset();
  522. },
  523. // 获取验证码
  524. getCode(code) {
  525. let mobile = (this.from.code1).slice(1) + '-' + this.from.mobile
  526. if (!this.from.mobile) return uni.$u.toast('The cell phone number is empty');
  527. if (this.$refs.uCode.canGetCode) {
  528. console.log(11)
  529. uni.$u.http.get('/api/user/getCode', {
  530. params: {
  531. type: code,
  532. mobile: mobile
  533. }
  534. }).then(res => {
  535. uni.$u.toast(this.$t('login.lab13'));
  536. this.$refs.uCode.start();
  537. })
  538. } else {
  539. uni.$u.toast(this.$t('common.lab3'));
  540. }
  541. },
  542. codeChange(text) {
  543. this.tips = text;
  544. },
  545. //获取国家区号
  546. getCountryCode() {
  547. let arr = {};
  548. if (JSON.stringify(this.system) == '{}') {
  549. arr = JSON.parse(localStorage.getItem('system')) || {}
  550. } else {
  551. arr = this.system
  552. }
  553. if (JSON.stringify(arr) == '{}') {
  554. this.timer = setInterval(res => {
  555. this.getCountryCode()
  556. }, 1000)
  557. return
  558. } else {
  559. clearInterval(this.timer)
  560. }
  561. arr.CountryCode.forEach(item => {
  562. item.nameCode = '+' + item.code + ' ' + item.name
  563. })
  564. this.countryCode.push(arr.CountryCode)
  565. console.log(this.countryCode);
  566. },
  567. change(e) {
  568. this.current = e.index
  569. },
  570. // 地区选中回调
  571. regionConfirm(e) {
  572. this.region = false;
  573. this.from.code1 = '+' + e.value[0].code
  574. },
  575. back() {
  576. if (this.type == 1) {
  577. uni.$u.route({
  578. type: 'back'
  579. })
  580. } else {
  581. this.type = 1
  582. this.tabList = [{
  583. name: this.$t('login.Number')
  584. },
  585. {
  586. name: this.$t('login.Password')
  587. }
  588. ]
  589. }
  590. }
  591. }
  592. }
  593. </script>
  594. <style lang="scss" scoped>
  595. .header-box {
  596. padding: 11rpx 33rpx;
  597. .close-icon {
  598. width: 44rpx;
  599. height: 44rpx;
  600. }
  601. }
  602. .index {
  603. overflow: hidden;
  604. padding: 0 48rpx;
  605. min-height: 100vh;
  606. background: url(../../static/image/login/newbg.jpg)center top / 100% 100% no-repeat;
  607. .index-back {
  608. image {
  609. width: 50rpx;
  610. height: 50rpx;
  611. margin: 40rpx;
  612. }
  613. }
  614. }
  615. .agree {
  616. color: #fff;
  617. width: 100vw;
  618. text-align: center;
  619. transform: translateX(-6%);
  620. margin-top: 150rpx;
  621. font-size: 24rpx;
  622. image {
  623. width: 40rpx;
  624. height: 40rpx;
  625. margin-right: 10rpx;
  626. }
  627. text {
  628. color: rgb(220, 60, 35);
  629. }
  630. }
  631. .back {
  632. width: 40rpx;
  633. height: 40rpx;
  634. margin-top: 16rpx;
  635. }
  636. .input {
  637. padding: 28rpx 0;
  638. margin-top: 52rpx;
  639. .input-left {
  640. color: #fff;
  641. width: 130rpx;
  642. border-right: 2rpx solid #fff;
  643. }
  644. input {
  645. flex: 1;
  646. color: #fff;
  647. font-size: 30rpx;
  648. margin-left: 32rpx;
  649. }
  650. text {
  651. color: #DC3C23;
  652. font-size: 28rpx;
  653. }
  654. border-bottom: 2rpx solid #FFF;
  655. }
  656. .btn {
  657. color: #fff;
  658. text-align: center;
  659. font-size: 36rpx;
  660. padding: 28rpx 0;
  661. border-radius: 100rpx;
  662. // opacity: 0.3;
  663. margin-top: 96rpx;
  664. background-color: rgba(255, 255, 255, 0.7);
  665. }
  666. .btn-tab {
  667. color: #fff;
  668. font-size: 30rpx;
  669. margin-top: 66rpx;
  670. }
  671. .btn-active {
  672. background: linear-gradient(90deg, #FFDFAB 0%, #DC3C23 100%);
  673. }
  674. .inputCss {
  675. /deep/ .inp {
  676. .u--input__input {
  677. color: #fff !important; //颜色在这里
  678. }
  679. // .u--input__right-icon__item {
  680. // margin-top: 16rpx;
  681. // }
  682. }
  683. }
  684. </style>