index.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. <template>
  2. <page-meta :page-style="`overflow:${showContactPopup ? 'hidden' : 'visible'};`" />
  3. <view class="detail-page">
  4. <template v-if="currentDetail">
  5. <image
  6. class="detail-image"
  7. :class="{ 'has-fixed-action': currentDetail.buttonText }"
  8. :src="currentDetail.detailImage"
  9. :show-menu-by-longpress="true"
  10. mode="widthFix"
  11. />
  12. <view v-if="currentDetail.buttonText" class="fixed-action">
  13. <view class="action-button" @tap="showInfo">
  14. {{ currentDetail.buttonText }}
  15. </view>
  16. </view>
  17. </template>
  18. <view v-else class="empty-state">
  19. <text class="empty-title">暂无详情内容</text>
  20. <text class="empty-desc">当前轮播图详情不存在或参数异常</text>
  21. </view>
  22. <wd-popup
  23. v-model="showContactPopup"
  24. position="bottom"
  25. closable
  26. lock-scroll
  27. safe-area-inset-bottom
  28. custom-style="border-radius: 32rpx 32rpx 0 0;"
  29. >
  30. <view class="info-content">
  31. <view class="popup-handle" />
  32. <view class="info-title">联系方式</view>
  33. <view class="info-tips">可添加企业微信详细沟通</view>
  34. <view class="qrcode-card">
  35. <image
  36. src="https://yy-cloud-oss.oss-cn-beijing.aliyuncs.com/img/banner-ercode.jpg"
  37. class="er-code"
  38. :show-menu-by-longpress="true"
  39. mode="aspectFit"
  40. />
  41. </view>
  42. <view class="qrcode-tip">长按二维码保存或识别</view>
  43. </view>
  44. </wd-popup>
  45. </view>
  46. </template>
  47. <script setup>
  48. import { computed, ref } from 'vue'
  49. import { onLoad } from '@dcloudio/uni-app'
  50. const detailId = ref('')
  51. const showContactPopup = ref(false)
  52. const detailList = [
  53. {
  54. id: 'banner-consult',
  55. title: '点击咨询',
  56. detailImage: 'https://yy-cloud-oss.oss-cn-beijing.aliyuncs.com/img/banner01Detail.png',
  57. buttonText: '点击咨询',
  58. },
  59. {
  60. id: 'signup-consult',
  61. title: '报名咨询',
  62. detailImage: 'https://yy-cloud-oss.oss-cn-beijing.aliyuncs.com/img/banner03Detail.jpg',
  63. buttonText: '报名咨询',
  64. },
  65. {
  66. id: 'ad-20230504',
  67. title: '广告详情',
  68. detailImage: 'https://yy-cloud-oss.oss-cn-beijing.aliyuncs.com/img/ad20230504001.jpeg',
  69. },
  70. {
  71. id: 'academic-agent',
  72. title: '学术推广代理服务商',
  73. detailImage: 'https://yy-cloud-oss.oss-cn-beijing.aliyuncs.com/img/ad20250317.png',
  74. },
  75. {
  76. id: 'tianshan-snow-lotus-cover-1',
  77. title: '天山雪莲单方制剂',
  78. detailImage:
  79. 'https://yy-cloud-oss-public.oss-cn-beijing.aliyuncs.com/template/tianshanian-ad-conent1.jpg',
  80. },
  81. {
  82. id: 'tianshan-snow-lotus-cover-2',
  83. title: '天山雪莲推广图',
  84. detailImage:
  85. 'https://yy-cloud-oss-public.oss-cn-beijing.aliyuncs.com/template/tianshanian-ad-conent2.jpg',
  86. },
  87. {
  88. id: 'jianping-jinxing',
  89. title: '健脾金杏',
  90. detailImage:
  91. 'https://yy-cloud-oss-public.oss-cn-beijing.aliyuncs.com/image/jianpingjinxing.png',
  92. },
  93. ]
  94. const currentDetail = computed(() => {
  95. return detailList.find((item) => item.id === detailId.value)
  96. })
  97. const showInfo = () => {
  98. showContactPopup.value = true
  99. }
  100. onLoad((options) => {
  101. detailId.value = decodeURIComponent(options?.id || '')
  102. })
  103. </script>
  104. <style scoped lang="scss">
  105. .detail-page {
  106. min-height: 100vh;
  107. background: #f7f8fa;
  108. }
  109. .detail-image {
  110. width: 750rpx;
  111. display: block;
  112. background: #fff;
  113. }
  114. .has-fixed-action {
  115. padding-bottom: 170rpx;
  116. }
  117. .fixed-action {
  118. position: fixed;
  119. left: 0;
  120. right: 0;
  121. bottom: 0;
  122. z-index: 20;
  123. box-sizing: border-box;
  124. padding: 22rpx 30rpx calc(22rpx + env(safe-area-inset-bottom));
  125. background: rgba(255, 255, 255, 0.96);
  126. box-shadow: 0 -8rpx 28rpx rgba(0, 0, 0, 0.08);
  127. backdrop-filter: blur(12rpx);
  128. }
  129. .action-button {
  130. height: 88rpx;
  131. display: flex;
  132. align-items: center;
  133. justify-content: center;
  134. border-radius: 999rpx;
  135. background: linear-gradient(135deg, #4db7ff 0%, #248cff 100%);
  136. box-shadow: 0 12rpx 26rpx rgba(36, 140, 255, 0.28);
  137. font-size: 32rpx;
  138. font-weight: 600;
  139. color: #fff;
  140. }
  141. .info-content {
  142. box-sizing: border-box;
  143. min-height: 560rpx;
  144. padding: 24rpx 40rpx 52rpx;
  145. display: flex;
  146. flex-direction: column;
  147. align-items: center;
  148. background: #fff;
  149. border-radius: 32rpx 32rpx 0 0;
  150. }
  151. .popup-handle {
  152. width: 72rpx;
  153. height: 8rpx;
  154. border-radius: 999rpx;
  155. background: #e5e5e5;
  156. }
  157. .info-title {
  158. margin-top: 38rpx;
  159. font-size: 38rpx;
  160. font-weight: 700;
  161. color: #222;
  162. }
  163. .info-tips {
  164. margin-top: 20rpx;
  165. font-size: 26rpx;
  166. color: #777;
  167. }
  168. .qrcode-card {
  169. margin-top: 34rpx;
  170. width: 392rpx;
  171. height: 392rpx;
  172. box-sizing: border-box;
  173. padding: 16rpx;
  174. border-radius: 28rpx;
  175. background: #fff;
  176. box-shadow:
  177. 0 16rpx 42rpx rgba(0, 0, 0, 0.08),
  178. inset 0 0 0 1rpx #f0f0f0;
  179. }
  180. .er-code {
  181. width: 360rpx;
  182. height: 360rpx;
  183. display: block;
  184. border-radius: 18rpx;
  185. }
  186. .qrcode-tip {
  187. margin-top: 22rpx;
  188. font-size: 24rpx;
  189. color: #aaa;
  190. }
  191. .empty-state {
  192. min-height: 100vh;
  193. box-sizing: border-box;
  194. padding-top: 260rpx;
  195. display: flex;
  196. flex-direction: column;
  197. align-items: center;
  198. background: #fff;
  199. }
  200. .empty-title {
  201. font-size: 32rpx;
  202. font-weight: 600;
  203. color: #333;
  204. }
  205. .empty-desc {
  206. margin-top: 16rpx;
  207. font-size: 26rpx;
  208. color: #999;
  209. }
  210. </style>