intro.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <template>
  2. <view class="ezy-shop-info-page">
  3. <view class="icon-title-navBar-box">
  4. <view class="nav-bar-icon" @click="handleBack"></view>
  5. <text class="nav-bar-title">商品详情</text>
  6. </view>
  7. <view class="shop-info-body">
  8. <view class="img-content-box">
  9. <img :src="imageUrl" alt="" />
  10. </view>
  11. <view class="fx-btn-row">
  12. <view @click="fenxiang" class="fx-btn">
  13. <icon class="fx-icon"></icon>
  14. <view>分享</view>
  15. </view>
  16. <view @click="handleStudy" class="bmxx-btn">立即报名学习</view>
  17. </view>
  18. </view>
  19. <!-- 分享 -->
  20. <SharePopup ref="sharePopup" :type="2" title="商品详情" desc="商品详情"
  21. :image="imageUrl" currentPage="tupian"
  22. @success="handleShareSuccess" @error="handleShareError" />
  23. </view>
  24. </template>
  25. <script setup>
  26. import {
  27. reactive,
  28. ref
  29. } from "vue";
  30. import {
  31. onLoad,
  32. onShow
  33. } from "@dcloudio/uni-app"
  34. import * as shopHttp from "@/api/shop.js"
  35. import {getAppCp1Info} from "@/api/shop";
  36. import SharePopup from "@/components/sharePopUp/index.vue"
  37. import {toast} from "uview-plus";
  38. const imageUrl = ref(null);
  39. const sharePopup = ref(null);
  40. onLoad(() => {
  41. initPage()
  42. })
  43. function initPage() {
  44. shopHttp.getAppCp1Info().then(res => {
  45. imageUrl.value = res.data.image;
  46. })
  47. }
  48. function handleShareError() {
  49. toast('分享失败')
  50. }
  51. function handleShareSuccess() {
  52. toast('分享成功')
  53. }
  54. function fenxiang() {
  55. sharePopup.value.open();
  56. }
  57. function handleStudy() {
  58. uni.navigateTo({
  59. url: '/pages/chanpinShop/cp1/dingdan'
  60. })
  61. }
  62. function handleBack() {
  63. uni.navigateBack()
  64. }
  65. </script>
  66. <style>
  67. </style>