help.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <template>
  2. <u-popup v-model="show" :mask-close-able="false" mode="center" border-radius="14" width="90%" height="auto" :closeable="true">
  3. <view class="u-popup">
  4. <view class="tttt" style="font-weight: bolder;">拨打求助电话</view>
  5. <view style="text-align: center;"><image src="../static/help.jpg" mode="widthFix" class="pic"></image></view>
  6. <view class="help">
  7. <text class="icon">&#xe94d;</text>
  8. <text>求助电话:{{ aboutUs.helpPhone }}</text>
  9. </view>
  10. <view class="tk">
  11. <view class="vvv">1,当你或者你的亲人景区不慎走失</view>
  12. <view class="vvv">2,你在谢通门遇到困难</view>
  13. </view>
  14. <button class="btn" @click="call()" v-if="user.mobile&&user.mobile.length > 0">拨打电话</button>
  15. <button class="btn" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber" v-else>获取手机号并拨打</button>
  16. </view>
  17. </u-popup>
  18. </template>
  19. <script>
  20. export default {
  21. data() {
  22. return {
  23. show: false,
  24. aboutUs: {},
  25. user: {}
  26. };
  27. },
  28. onLoad() {},
  29. methods: {
  30. init(show = true) {
  31. if (!this.$hasLogin()) {
  32. uni.showModal({
  33. title: '提示',
  34. content: '您还未登陆,请先登陆!',
  35. success: res => {
  36. if (res.confirm) {
  37. uni.navigateTo({
  38. url: '/pages/user/login'
  39. });
  40. }
  41. }
  42. });
  43. return;
  44. }
  45. this.show = show;
  46. this.aboutUs = uni.getStorageSync('aboutUs');
  47. this.user = this.$getUser();
  48. },
  49. call() {
  50. this.$http.call(this.aboutUs);
  51. },
  52. // 绑定用户手机号
  53. getPhoneNumber(e) {
  54. let item = {};
  55. uni.login({
  56. provider: 'weixin',
  57. success: res => {
  58. this.disabled = false;
  59. item.code = res.code;
  60. item.encryptedData = e.target.encryptedData;
  61. item.iv = e.target.iv;
  62. this.$http.request({
  63. url: this.$http.urls.bindWxMobile,
  64. data: item,
  65. method: 'POST',
  66. success: r => {
  67. this.user.mobile = r.data.data.mobile;
  68. uni.setStorageSync('user', this.user);
  69. this.$forceUpdate();
  70. this.$http.call(this.aboutUs);
  71. }
  72. });
  73. }
  74. });
  75. }
  76. }
  77. };
  78. </script>
  79. <style lang="scss" scoped>
  80. .u-popup {
  81. overflow: hidden;
  82. }
  83. .pic {
  84. border-radius: 7px;
  85. width: 50%;
  86. margin: 0 auto;
  87. }
  88. .help {
  89. border-radius: 5px;
  90. padding: 10px;
  91. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  92. margin: 10px 0px 5px 0px;
  93. color: #626262;
  94. font-size:15px;
  95. .icon {
  96. padding-right: 3px;
  97. font-weight: bold;
  98. }
  99. }
  100. .tk {
  101. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  102. background-color: white;
  103. color: #626262;
  104. margin-top: 10px;
  105. .vvv {
  106. padding: 5px 5px 5px 5px;
  107. font-size: 13px;
  108. }
  109. }
  110. .btn {
  111. margin-top: 20px !important;
  112. }
  113. </style>