intro.vue 1.4 KB

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