青蛙卖大米小程序2024-11-24
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.

86 lines
1.6 KiB

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