Selaa lähdekoodia

优化产品详情界面

zhuliu 1 vuosi sitten
vanhempi
commit
1b655f0840

+ 0 - 1
api/common.js

@@ -3,7 +3,6 @@ module.exports={
   //是否登录
   isLogin:(data)=>{
     var token = wx.getStorageSync('token')
-    console.log(token)
     if(token){
       return true
     }

+ 1 - 1
pages/hotProduct/hotProduct.wxml

@@ -36,7 +36,7 @@
       <text>灰名单</text>
     </view>
   </view>
-  <my-scroll-view  triggered="{{triggered}}" load="{{load}}" hasMore="{{hasMore}}" bindonRefresh="onRefresh" bindloadMore="loadMore" customStyle="height: calc(100vh - 260rpx)">
+  <my-scroll-view  triggered="{{triggered}}" load="{{load}}" hasMore="{{hasMore}}" bindonRefresh="onRefresh" bindloadMore="loadMore" customStyle="height: calc(100vh - 280rpx)">
     <myProduct wx:if="{{tableData.length>0}}"  tableData="{{tableData}}" id="myProduct" bindshowPopup="openPopup" bindhiddenPopup="closePopup"></myProduct>
     <van-empty wx:else description="暂无数据" />
   </my-scroll-view>

+ 12 - 0
pages/productDetail/productDetail.js

@@ -60,6 +60,18 @@ Page({
       }
     })
   },
+  //复制URL
+  copyURL(){
+    wx.setClipboardData({
+      data: this.data.product.amazonLink,
+      success (res) {
+        wx.showToast({
+          title: '已复制',
+          icon:'none'
+        })
+      }
+    })
+  },
 
 
 

+ 6 - 1
pages/productDetail/productDetail.wxml

@@ -2,7 +2,9 @@
 <view class="productDetail">
   <view>
     <my-form-item wx:if="{{product.name}}" label="产品名称" border="{{false}}" customStyle="{{customStyle}}" labelWidth="{{labelWidth}}" labelPosition="{{labelPosition}}">
-        <view class="form_item"><text user-select="false">{{product.name}}</text></view>
+        <view class="form_item">
+          <text user-select="false">{{product.name}} </text> 
+        </view>
     </my-form-item>
   </view>
   <view>
@@ -27,4 +29,7 @@
       </my-form-item>
     </view>
   </view>
+</view>
+<view wx:if="{{product.amazonLink}}" style="padding:0 20rpx">
+ <span style="font-weight: bold;">注:</span> 产品的详细信息可以点击<span class="link" catch:tap="copyURL">复制链接</span>到浏览器中查看
 </view>

+ 7 - 7
pages/searchResults/searchResults.js

@@ -140,16 +140,16 @@ Page({
   },
   toURL(){
     console.log(2)
-    // if(this.data.searchType == 1 && this.data.product.id){
-    //   wx.navigateTo({
-    //     url: '/pages/productDetail/productDetail?productId='+this.data.product.id,
-    //   })
-    // }
-    if(this.data.product.amazonLink){
+    if(this.data.searchType == 1 && this.data.product.id){
       wx.navigateTo({
-        url: '/pages/webView/webView?src='+this.data.product.amazonLink,
+        url: '/pages/productDetail/productDetail?productId='+this.data.product.id,
       })
     }
+    // if(this.data.product.amazonLink){
+    //   wx.navigateTo({
+    //     url: '/pages/webView/webView?src='+this.data.product.amazonLink,
+    //   })
+    // }
     
   
   },

+ 8 - 8
pages/searchResults/searchResults.wxml

@@ -62,7 +62,7 @@
   <view class="product">
     <view class="product_head">
       <view class="product_text" bind:tap="toURL"> 
-        <wux-ellipsis wx:if="{{product.name}}" defaultExpanded="{{false}}" expandText="展开" collapseText="收起" wux-class="ellipsis" class="head_left_title"  direction="end" content="产品名称:{{ product.name }}"/>
+        <wux-ellipsis wx:if="{{product.name}}"  wux-class="ellipsis" class="head_left_title"  direction="end" content="产品名称:{{ product.name }}"/>
       <!-- <text wx:if="{{product.name}}">产品名称:{{product.name}}</text> -->
       </view>
 
@@ -98,16 +98,16 @@
   </view>
   <van-divider customStyle=" border-color: #6b6b6b;" dashed />
   <view class="content">
-    <view class="content_head">
-      <view class="content_head_description">注:非会员可选择100条</view>
-      <view class="content_head_result">
-        <view class="content_head_result_description">
+    <view class="content_head_result">
+        <view class="">
           以下是您的检索结果
           <van-icon name="question" bind:tap="openDialog2"/>
         </view>
-        <!-- <view class="content_head_result_btn" bind:tap="export">
-          一键导出
-        </view> -->
+    </view>
+    <view class="content_head" style="margin-top: 10px;">
+      <view class="content_head_description content_head_result_description">注:非会员可选择100条</view>
+      <view class="content_head_result content_head_result_description">
+        检索到 <span style="color: red;font-weight: bold;">{{total}}</span> 件专利
       </view>
     </view>
     <view class="content_result" wx:if="{{tableData.length>0}}">

+ 16 - 2
utils/request.js

@@ -1,6 +1,5 @@
 // request.js  
 import Notify from '../miniprogram_npm/@vant/weapp/notify/notify';
-import {  $stopWuxRefresher} from '../miniprogram_npm/wux-weapp/index';
 
 // 配置项  
 const config = {  
@@ -28,7 +27,6 @@ function getPages(){
   }
   var pages = getCurrentPages()
   var route = pages[pages.length - 1]?.route
-  console.log(config.tabbar,route)
   if(route && config.tabbar.indexOf(route)==-1){
     obj.top = wx.getStorageSync('height')
   }
@@ -75,6 +73,22 @@ function request(url, method = 'GET', data = {}, header = {},isLogin=true) {
               }
               wx.setStorageSync('token', '')
               break;
+            case 606:
+              
+            case 607:
+              wx.showModal({
+                title: '',
+                content: '前往会员中心开通会员或购买权益',
+                complete: (res) => {
+                  if (res.cancel) {}
+                  if (res.confirm) {
+                    wx.navigateTo({
+                      url: '/pages/memberCenter/memberCenter',
+                    })
+                  }
+                }
+              })
+              break;
             default:
               // obj.message = '请求失败'
               obj.message = res.data.message