areaCode.vue 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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.isNeedAddCountryCode = false;
  48. this.$parent.signupAdd(this.areaCode.id, this.areaCode.type);
  49. }
  50. });
  51. },
  52. cancel() {
  53. this.areacodeShow = false;
  54. this.$parent.isAreaCode = false;
  55. },
  56. },
  57. };
  58. </script>
  59. <style scoped lang="scss">
  60. .select-box {
  61. width: 100%;
  62. .box {
  63. height: 95prx;
  64. line-height: 95rpx;
  65. text-align: center;
  66. font-size: 32rpx;
  67. border-bottom: 1rpx solid #ebebeb;
  68. }
  69. .box-bottom {
  70. border-bottom: none !important;
  71. }
  72. }
  73. </style>