Ver Fonte

完成转发页面内容

yuanmingze há 1 mês atrás
pai
commit
e882b61a09

+ 127 - 237
src/pages/information/index.vue

@@ -16,103 +16,79 @@
       <ProductAlbumPanel v-else ref="albumPanelRef" @share="openAlbumShare" />
     </template>
   </view>
-
   <wd-popup
     v-model="sharePopupVisible"
     position="bottom"
     root-portal
     lock-scroll
     :safe-area-inset-bottom="true"
-    custom-style="border-radius: 32rpx 32rpx 0 0;"
+    custom-style="border-radius: 28rpx 28rpx 0 0;"
     @close="resetShareForm"
   >
     <view class="share-popup">
-      <view class="share-popup__hero">
-        <view class="share-popup__hero-icon">
-          <wd-icon name="share-internal" size="38rpx" color="#ffffff" />
-        </view>
-
-        <view class="share-popup__hero-content">
-          <text class="share-popup__title">转发给好友</text>
-          <text class="share-popup__subtitle">选择积分包并补充转发备注</text>
-        </view>
-
-        <view class="share-popup__close" hover-class="share-popup__close--hover" @tap="sharePopupVisible = false">
-          <wd-icon name="close" size="30rpx" color="#667085" />
+      <!-- 标题 -->
+      <view class="share-popup__header">
+        <text class="share-popup__title">转发</text>
+
+        <view
+          class="share-popup__close"
+          hover-class="share-popup__close--hover"
+          @tap="sharePopupVisible = false"
+        >
+          <wd-icon name="close" size="32rpx" color="#8a8f99" />
         </view>
       </view>
 
-      <view class="share-popup__body">
-        <view class="share-popup__notice">
-          <view class="share-popup__notice-icon">
-            <wd-icon name="warning" size="28rpx" color="#e5484d" />
-          </view>
-          <text class="share-popup__notice-text">
-            不能针对非医疗专业人员转发处方药相关宣传信息
-          </text>
-        </view>
+      <!-- 合规提示 -->
+      <view class="share-popup__notice"> 注意:不能针对非医疗专业人员转发处方药相关宣传信息 </view>
 
-        <view class="share-popup__section">
-          <view class="share-popup__section-header">
-            <view>
-              <text class="share-popup__label">选择积分包</text>
-              <text class="share-popup__section-desc">滚动选择本次转发关联的积分包</text>
-            </view>
-            <text class="share-popup__count">{{ sharePackageList.length }} 个可用</text>
-          </view>
-
-          <view class="share-popup__picker-wrap">
-            <wd-picker-view
-              v-model="selectedPackageValues"
-              custom-class="share-package-picker"
-              :columns="sharePackageList"
-              :item-height="48"
-              :visible-item-count="3"
-              value-key="value"
-              label-key="label"
-              @pickstart="sharePickerScrolling = true"
-              @pickend="sharePickerScrolling = false"
-            />
-          </view>
+      <!-- 备注 -->
+      <view class="share-popup__field">
+        <view class="share-popup__label-row">
+          <text class="share-popup__label">转发备注</text>
+          <text class="share-popup__count">{{ shareRemark.length }}/100</text>
         </view>
 
-        <view class="share-popup__section share-popup__section--remark">
-          <view class="share-popup__section-header">
-            <view>
-              <text class="share-popup__label">转发备注</text>
-              <text class="share-popup__section-desc">选填,将随分享链接一并传递</text>
-            </view>
-            <text class="share-popup__remark-count">{{ shareRemark.length }}/100</text>
-          </view>
-
-          <view class="share-popup__input-wrap">
-            <input
-              v-model="shareRemark"
-              class="share-popup__input"
-              type="text"
-              :maxlength="100"
-              :cursor-spacing="150"
-              placeholder="请输入备注内容"
-              placeholder-class="share-popup__placeholder"
-            />
-          </view>
-        </view>
+        <input
+          v-model="shareRemark"
+          class="share-popup__input"
+          type="text"
+          :maxlength="100"
+          :cursor-spacing="150"
+          placeholder="请输入备注内容"
+          placeholder-class="share-popup__placeholder"
+        />
+      </view>
 
-        <button
-          class="share-popup__confirm"
-          hover-class="share-popup__confirm--hover"
-          open-type="share"
-          :disabled="!canSubmitShare"
-          :data-title="shareTarget?.title || ''"
-          :data-id="shareTarget?.id || ''"
-          :data-active-tab="shareTarget?.type || activeTab"
-          :data-package-id="selectedPackage?.value || ''"
-          :data-remark="shareRemark"
-        >
-          <wd-icon name="share-internal" size="30rpx" color="#ffffff" />
-          <text>确认转发</text>
-        </button>
+      <!-- 积分包 -->
+      <view class="share-popup__field">
+        <text class="share-popup__label">选择积分包</text>
+
+        <view class="share-popup__picker">
+          <wd-picker-view
+            v-model="selectedPackageValues"
+            :columns="sharePackageList"
+            :visible-item-count="3"
+            @pickstart="sharePickerScrolling = true"
+            @pickend="sharePickerScrolling = false"
+          />
+        </view>
       </view>
+
+      <!-- 转发按钮 -->
+      <button
+        class="share-popup__confirm"
+        hover-class="share-popup__confirm--hover"
+        open-type="share"
+        :disabled="!canSubmitShare"
+        :data-title="shareTarget?.title || ''"
+        :data-id="shareTarget?.id || ''"
+        :data-active-tab="shareTarget?.type || activeTab"
+        :data-package-id="selectedPackage?.value || ''"
+        :data-remark="shareRemark"
+      >
+        确认转发
+      </button>
     </view>
   </wd-popup>
 </template>
@@ -230,8 +206,6 @@ const showBlacklistWarning = (): boolean => {
 }
 
 const openArticleShare = async (item: ArticleItem): Promise<void> => {
-  console.log('qaq openArticleShare')
-
   await openShare({
     id: String(item.id),
     title: item.title,
@@ -403,225 +377,142 @@ onShareAppMessage((res) => {
 .share-popup {
   box-sizing: border-box;
   width: 100%;
-  overflow: hidden;
-  padding-bottom: max(24rpx, env(safe-area-inset-bottom));
-  background: #ffffff;
+  padding: 32rpx 32rpx max(24rpx, env(safe-area-inset-bottom));
+  background: #fff;
 }
 
-.share-popup__hero {
-  position: relative;
-  display: flex;
-  align-items: center;
-  padding: 34rpx 88rpx 30rpx 32rpx;
-  background:
-    radial-gradient(circle at 86% 0%, rgba(82, 179, 255, 0.18) 0, transparent 42%),
-    linear-gradient(135deg, #eef8ff 0%, #f8fbff 54%, #ffffff 100%);
-  border-bottom: 1rpx solid rgba(47, 139, 230, 0.08);
-}
+/* -------------------------------------------------------------------------- */
+/* Header */
+/* -------------------------------------------------------------------------- */
 
-.share-popup__hero-icon {
+.share-popup__header {
+  position: relative;
   display: flex;
-  flex-shrink: 0;
   align-items: center;
-  justify-content: center;
-  width: 76rpx;
-  height: 76rpx;
-  margin-right: 22rpx;
-  background: linear-gradient(135deg, #54b9ff 0%, #267fe8 100%);
-  border-radius: 24rpx;
-  box-shadow: 0 12rpx 28rpx rgba(47, 139, 230, 0.25);
-}
-
-.share-popup__hero-content {
-  display: flex;
-  flex-direction: column;
-  min-width: 0;
+  min-height: 56rpx;
+  margin-bottom: 28rpx;
 }
 
 .share-popup__title {
-  color: #172033;
-  font-size: 36rpx;
-  font-weight: 700;
-  line-height: 50rpx;
-}
-
-.share-popup__subtitle {
-  margin-top: 4rpx;
-  color: #7b8798;
-  font-size: 24rpx;
-  line-height: 34rpx;
+  color: #1f2329;
+  font-size: 34rpx;
+  font-weight: 600;
+  line-height: 48rpx;
 }
 
 .share-popup__close {
   position: absolute;
-  top: 28rpx;
-  right: 28rpx;
+  top: 0;
+  right: 0;
   display: flex;
   align-items: center;
   justify-content: center;
   width: 56rpx;
   height: 56rpx;
-  background: rgba(255, 255, 255, 0.8);
-  border: 1rpx solid rgba(102, 112, 133, 0.1);
-  border-radius: 50%;
 }
 
 .share-popup__close--hover {
-  opacity: 0.72;
+  opacity: 0.6;
 }
 
-.share-popup__body {
-  padding: 24rpx 28rpx 8rpx;
-}
+/* -------------------------------------------------------------------------- */
+/* 合规提示 */
+/* -------------------------------------------------------------------------- */
 
 .share-popup__notice {
-  display: flex;
-  align-items: flex-start;
+  box-sizing: border-box;
+  width: 100%;
   padding: 18rpx 20rpx;
-  background: linear-gradient(135deg, #fff5f5 0%, #fff9f8 100%);
-  border: 1rpx solid rgba(229, 72, 77, 0.12);
-  border-radius: 16rpx;
-}
-
-.share-popup__notice-icon {
-  display: flex;
-  flex-shrink: 0;
-  align-items: center;
-  justify-content: center;
-  margin: 2rpx 12rpx 0 0;
-}
-
-.share-popup__notice-text {
-  color: #c74449;
+  margin-bottom: 32rpx;
+  color: #d54941;
   font-size: 24rpx;
   line-height: 36rpx;
+  background: #fff5f5;
+  border-radius: 12rpx;
 }
 
-.share-popup__section {
-  margin-top: 24rpx;
-  padding: 22rpx 22rpx 18rpx;
-  background: #ffffff;
-  border: 1rpx solid #e9eef5;
-  border-radius: 22rpx;
-  box-shadow: 0 8rpx 26rpx rgba(31, 45, 61, 0.045);
-}
+/* -------------------------------------------------------------------------- */
+/* 表单 */
+/* -------------------------------------------------------------------------- */
 
-.share-popup__section--remark {
-  padding-bottom: 22rpx;
+.share-popup__field {
+  margin-bottom: 32rpx;
 }
 
-.share-popup__section-header {
+.share-popup__label-row {
   display: flex;
-  align-items: flex-start;
+  align-items: center;
   justify-content: space-between;
-  gap: 20rpx;
-}
-
-.share-popup__label,
-.share-popup__section-desc {
-  display: block;
 }
 
 .share-popup__label {
-  color: #263246;
-  font-size: 29rpx;
-  font-weight: 650;
+  display: block;
+  margin-bottom: 16rpx;
+  color: #1f2329;
+  font-size: 28rpx;
+  font-weight: 600;
   line-height: 40rpx;
 }
 
-.share-popup__section-desc {
-  margin-top: 2rpx;
-  color: #98a2b3;
-  font-size: 22rpx;
-  line-height: 32rpx;
+.share-popup__label-row .share-popup__label {
+  margin-bottom: 16rpx;
 }
 
 .share-popup__count {
-  flex-shrink: 0;
-  padding: 6rpx 14rpx;
-  color: #2f8be6;
+  margin-bottom: 16rpx;
+  color: #a0a5ad;
   font-size: 22rpx;
-  line-height: 30rpx;
-  background: #edf7ff;
-  border-radius: 999rpx;
-}
-
-.share-popup__picker-wrap {
-  position: relative;
-  margin-top: 14rpx;
-  overflow: hidden;
-  background: linear-gradient(180deg, #fbfdff 0%, #f5f9fd 100%);
-  border: 1rpx solid #edf2f7;
-  border-radius: 16rpx;
-}
-
-:deep(.share-package-picker) {
-  --wot-picker-view-bg: transparent;
-  --wot-picker-view-padding: 0 12rpx;
-  --wot-picker-view-mask-start-color: rgba(248, 251, 254, 0.96);
-  --wot-picker-view-mask-end-color: rgba(248, 251, 254, 0.2);
-  --wot-picker-view-column-item-height: 48px;
-  --wot-picker-view-column-item-font-size: 28rpx;
-  --wot-picker-view-column-item-color: #7d899a;
-  --wot-picker-view-column-item-font-weight-active: 650;
-  --wot-picker-view-roller-bg: rgba(47, 139, 230, 0.1);
-  --wot-picker-view-roller-border-radius: 14rpx;
+  line-height: 40rpx;
 }
 
-:deep(.share-package-picker .wd-picker-view__column-item--active) {
-  color: #237fd7;
-}
+/* -------------------------------------------------------------------------- */
+/* 积分包 Picker */
+/* -------------------------------------------------------------------------- */
 
-.share-popup__remark-count {
-  flex-shrink: 0;
-  padding-top: 8rpx;
-  color: #a3acba;
-  font-size: 22rpx;
-  line-height: 30rpx;
+.share-popup__picker {
+  overflow: hidden;
+  border-radius: 12rpx;
 }
 
-.share-popup__input-wrap {
-  box-sizing: border-box;
-  display: flex;
-  align-items: center;
-  width: 100%;
-  height: 78rpx;
-  padding: 0 22rpx;
-  margin-top: 16rpx;
-  background: #f8fafc;
-  border: 1rpx solid #e7ecf2;
-  border-radius: 14rpx;
-}
+/* -------------------------------------------------------------------------- */
+/* 备注 */
+/* -------------------------------------------------------------------------- */
 
 .share-popup__input {
+  box-sizing: border-box;
   width: 100%;
-  height: 74rpx;
-  color: #263246;
-  font-size: 27rpx;
-  line-height: 74rpx;
+  height: 80rpx;
+  padding: 0 24rpx;
+  color: #1f2329;
+  font-size: 28rpx;
+  line-height: 80rpx;
+  background: #f7f8fa;
+  border-radius: 12rpx;
 }
 
 .share-popup__placeholder {
-  color: #b0b8c4;
+  color: #b5b8be;
 }
 
+/* -------------------------------------------------------------------------- */
+/* Button */
+/* -------------------------------------------------------------------------- */
+
 .share-popup__confirm {
   display: flex;
   align-items: center;
   justify-content: center;
-  gap: 12rpx;
   width: 100%;
   height: 88rpx;
   padding: 0;
-  margin: 26rpx 0 0;
-  color: #ffffff;
+  margin: 8rpx 0 0;
+  color: #fff;
   font-size: 30rpx;
   font-weight: 600;
   line-height: 88rpx;
-  background: linear-gradient(135deg, #53b7fb 0%, #2f8be6 58%, #2477d8 100%);
+  background: #1989fa;
   border: 0;
-  border-radius: 18rpx;
-  box-shadow: 0 12rpx 28rpx rgba(47, 139, 230, 0.24);
+  border-radius: 14rpx;
 }
 
 .share-popup__confirm::after {
@@ -629,12 +520,11 @@ onShareAppMessage((res) => {
 }
 
 .share-popup__confirm--hover {
-  opacity: 0.86;
+  opacity: 0.85;
 }
 
 .share-popup__confirm[disabled] {
-  color: rgba(255, 255, 255, 0.82);
-  background: linear-gradient(135deg, #b9c8d6 0%, #a9bac9 100%);
-  box-shadow: none;
+  color: #fff;
+  background: #b8d8f8;
 }
 </style>

+ 2 - 2
src/services/modules/information/index.ts

@@ -56,9 +56,9 @@ export const getPackageListByTaskTypeAndAlbumIdApi = (type: string, albumId: str
 }
 
 export const shareArticleByIdApi = (params: ShareArticleRequest) => {
-  return http.get<unknown>(`/admin/api/shareArticleById`, params)
+  return http.get<ArticleItem>(`/admin/api/shareArticleById`, params)
 }
 
 export const shareAlbumByIdApi = (params: ShareAlbumRequest) => {
-  return http.get<unknown>(`/admin/api/shareAlbumById`, params)
+  return http.get<AlbumPageNewItem>(`/admin/api/shareAlbumById`, params)
 }

+ 4 - 8
src/services/request/index.ts

@@ -73,8 +73,7 @@ export function request<T = any>(config: RequestConfig): Promise<ApiResponse<T>>
 
         if (!config.silent) {
           uni.showModal({
-            title: '提示',
-            content: getErrorMessage(body),
+            title: getErrorMessage(body),
             showCancel: false,
           })
         }
@@ -85,8 +84,7 @@ export function request<T = any>(config: RequestConfig): Promise<ApiResponse<T>>
       fail(err) {
         if (!config.silent) {
           uni.showModal({
-            title: '提示',
-            content: (err as any)?.errMsg || '网络异常,请稍后再试',
+            title: (err as any)?.errMsg || '网络异常,请稍后再试',
             showCancel: false,
           })
         }
@@ -134,8 +132,7 @@ export function requestRaw<T = any>(config: RequestConfig): Promise<T> {
 
         if (!config.silent) {
           uni.showModal({
-            title: '提示',
-            content: getErrorMessage(res.data as any),
+            title: getErrorMessage(res.data as any),
             showCancel: false,
           })
         }
@@ -146,8 +143,7 @@ export function requestRaw<T = any>(config: RequestConfig): Promise<T> {
       fail(err) {
         if (!config.silent) {
           uni.showModal({
-            title: '提示',
-            content: (err as any)?.errMsg || '网络异常,请稍后再试',
+            title: (err as any)?.errMsg || '网络异常,请稍后再试',
             showCancel: false,
           })
         }

+ 1 - 1
src/services/request/utils.ts

@@ -48,7 +48,7 @@ export function resolveUrl(url: string) {
 }
 
 export function isWhiteList(url: string) {
-  return ['/auth/oauth/token'].some((item) => url.includes(item))
+  return [].some((item) => url.includes(item))
 }
 
 export function buildHeaders(url: string, extraHeader?: UniApp.RequestOptions['header']) {