珠宝小程序前端代码
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.

88 lines
1.6 KiB

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