推拿小程序前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

85 lines
1.6 KiB

3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
  1. <template>
  2. <view class="page">
  3. <navbar title="联系我们" leftClick @leftClick="$utils.navigateBack" />
  4. <!-- todo: check -->
  5. <view class="box">
  6. <view v-if="configList.wx_image">
  7. <image :src="configList.wx_image" mode="aspectFill"></image>
  8. <view class="uni-color-btn" @click="saveImage(configList.wx_image)">
  9. 保存二维码
  10. </view>
  11. </view>
  12. <view v-if="configList.config_phone">
  13. 全国联系电话{{ configList.config_phone }}
  14. <view class="uni-color-btn" @click="onCall(configList.config_phone)">
  15. 拨打电话
  16. </view>
  17. </view>
  18. </view>
  19. </view>
  20. </template>
  21. <script>
  22. export default {
  23. data() {
  24. return {
  25. }
  26. },
  27. methods: {
  28. // 拨打电话
  29. onCall(phoneNumber) {
  30. uni.makePhoneCall({
  31. phoneNumber,
  32. success() {
  33. console.log('安卓拨打成功');
  34. },
  35. fail() {
  36. console.log('安卓拨打失败');
  37. }
  38. })
  39. },
  40. saveImage(image){
  41. /* 获取图片的信息 */
  42. uni.getImageInfo({
  43. src: image,
  44. success: function(image) {
  45. /* 保存图片到手机相册 */
  46. uni.saveImageToPhotosAlbum({
  47. filePath: image.path,
  48. success: function() {
  49. uni.showModal({
  50. title: '保存成功',
  51. content: '图片已成功保存到相册',
  52. showCancel: false
  53. });
  54. },
  55. complete(res) {
  56. console.log(res);
  57. }
  58. });
  59. }
  60. });
  61. },
  62. }
  63. }
  64. </script>
  65. <style scoped lang="scss">
  66. .page{
  67. .box{
  68. display: flex;
  69. justify-content: center;
  70. align-items: center;
  71. height: 70vh;
  72. flex-direction: column;
  73. gap: 40rpx;
  74. image{
  75. width: 400rpx;
  76. height: 400rpx;
  77. }
  78. }
  79. }
  80. </style>