areaCode.vue 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <template>
  2. <view class="select-box">
  3. <u-popup v-model="areacodeShow" mode="bottom" @close="cancel">
  4. <view class="box" style="color: #333333; font-size: 28rpxrpx">请选择您的国际区号</view>
  5. <view class="box" style="color: #2c83ff" @click="areacode('86')">大陆+86</view>
  6. <view class="box" style="color: #2c83ff" @click="areacode('852')">香港+852</view>
  7. <view class="box" style="color: #2c83ff" @click="areacode('886')">台湾+886</view>
  8. <view class="box" style="color: #2c83ff" @click="areacode('1')">美国+1</view>
  9. <view class="box" style="color: #2c83ff" @click="areacode('65')">新加坡+65</view>
  10. <view class="box box-bottom" style="color: #a9afb8" @click="cancel">取消</view>
  11. </u-popup>
  12. </view>
  13. </template>
  14. <script>
  15. import { User } from "@/config/api.js";
  16. export default {
  17. watch: {
  18. isAreaCode() {
  19. this.areacodeShow = this.isAreaCode;
  20. },
  21. typesignup() {
  22. this.signupType = this.typesignup;
  23. },
  24. },
  25. data() {
  26. return {
  27. areacodeShow: false,
  28. };
  29. },
  30. props: {
  31. isAreaCode: {
  32. type: Boolean,
  33. default: false,
  34. },
  35. areaCode: {
  36. type: Object,
  37. },
  38. },
  39. methods: {
  40. areacode(num) {
  41. User.countryCcodeAdd({
  42. CountryCode: num,
  43. }).then((res) => {
  44. if (res.Ret == 200) {
  45. this.areacodeShow = false;
  46. this.$parent.isAreaCode = false;
  47. this.$parent.signupAdd(this.areaCode.id, this.areaCode.type);
  48. }
  49. });
  50. },
  51. cancel() {
  52. this.areacodeShow = false;
  53. this.$parent.isAreaCode = false;
  54. },
  55. },
  56. };
  57. </script>
  58. <style scoped lang="scss">
  59. .select-box {
  60. width: 100%;
  61. .box {
  62. height: 95prx;
  63. line-height: 95rpx;
  64. text-align: center;
  65. font-size: 32rpx;
  66. border-bottom: 1rpx solid #ebebeb;
  67. }
  68. .box-bottom {
  69. border-bottom: none !important;
  70. }
  71. }
  72. </style>