瀏覽代碼

update code

zhuliu 1 年之前
父節點
當前提交
c8a7ada722
共有 40 個文件被更改,包括 979 次插入39 次删除
  1. 3 1
      api/index.js
  2. 12 0
      api/user.js
  3. 4 0
      app.js
  4. 3 1
      app.json
  5. 114 0
      myComponents/floatButton/floatButton.js
  6. 6 0
      myComponents/floatButton/floatButton.json
  7. 15 0
      myComponents/floatButton/floatButton.wxml
  8. 36 0
      myComponents/floatButton/floatButton.wxss
  9. 14 1
      myComponents/navBar/navBar.js
  10. 3 1
      myComponents/product/product.js
  11. 6 4
      pages/hotProduct/hotProduct.js
  12. 2 1
      pages/hotProduct/hotProduct.wxml
  13. 1 0
      pages/index/index.wxss
  14. 1 1
      pages/login/login.js
  15. 1 0
      pages/login/login.wxss
  16. 129 0
      pages/memberCenter/memberCenter.js
  17. 6 0
      pages/memberCenter/memberCenter.json
  18. 35 0
      pages/memberCenter/memberCenter.wxml
  19. 98 0
      pages/memberCenter/memberCenter.wxss
  20. 55 4
      pages/mine/mine.js
  21. 15 3
      pages/mine/mine.wxml
  22. 1 0
      pages/mine/mine.wxss
  23. 2 2
      pages/monitor/monitor.js
  24. 2 2
      pages/myFollow/myFollow.js
  25. 2 2
      pages/myWork/myWork.js
  26. 2 2
      pages/riskAssessment/riskAssessment.js
  27. 1 0
      pages/riskAssessment/riskAssessment.wxss
  28. 2 2
      pages/searchRecords/searchRecords.js
  29. 77 2
      pages/searchResults/searchResults.js
  30. 8 1
      pages/searchResults/searchResults.json
  31. 79 3
      pages/searchResults/searchResults.wxml
  32. 66 1
      pages/searchResults/searchResults.wxss
  33. 68 0
      pages/selectedPatents/selectedPatents.js
  34. 8 0
      pages/selectedPatents/selectedPatents.json
  35. 41 0
      pages/selectedPatents/selectedPatents.wxml
  36. 34 0
      pages/selectedPatents/selectedPatents.wxss
  37. 11 3
      static/iconfont/iconfont.wxss
  38. 二進制
      static/image/unlogin.jpeg
  39. 14 2
      utils/request.js
  40. 2 0
      utils/upload.js

+ 3 - 1
api/index.js

@@ -2,10 +2,12 @@ const search = require('./search')
 const login = require('./login')
 const category = require('./category')
 const product = require('./product')
+const user = require('./user.js')
 
 module.exports={ 
   ...search,
   ...login,
   ...category,
-  ...product
+  ...product,
+  ...user
 }

+ 12 - 0
api/user.js

@@ -0,0 +1,12 @@
+const request = require('../utils/request')
+
+module.exports={ 
+  //查询个人信息
+	selectPerson:(data)=>{
+		return request.post('/xiaoshi-weixinback/account/selectPerson',data)
+  },
+  //修改个人信息
+  editPerson:(data)=>{
+		return request.post('/xiaoshi-weixinback/account/editPerson',data)
+  },
+ }

+ 4 - 0
app.js

@@ -12,6 +12,8 @@ App({
     const systemInfo = wx.getSystemInfoSync();
     // 胶囊按钮位置信息
     const menuButtonInfo = wx.getMenuButtonBoundingClientRect();
+    that.globalData.windowWidth = systemInfo.windowWidth
+    that.globalData.windowHeight = systemInfo.windowHeight
     // 导航栏高度 = 状态栏高度 + 44
     that.globalData.navBarHeight = systemInfo.statusBarHeight + 44;
     that.globalData.menuRight = systemInfo.screenWidth - menuButtonInfo.right;
@@ -26,6 +28,8 @@ App({
     menuTop: 0, // 胶囊距顶部间距
     menuHeight: 0, // 胶囊高度(自定义内容可与胶囊高度保证一致)
     menuWidth:0,
+    windowHeight:0,
+    windowWidth:0,
     imghttp:'http://192.168.1.7:8801/'
   }
 })

+ 3 - 1
app.json

@@ -15,7 +15,9 @@
     "pages/form/appeal/appeal",
     "pages/form/riskAssessment/riskAssessment",
     "pages/searchResults/searchResults",
-    "pages/successReminder/successReminder"
+    "pages/successReminder/successReminder",
+    "pages/selectedPatents/selectedPatents",
+    "pages/memberCenter/memberCenter"
   ],
   "tabBar": {
     "list": [

+ 114 - 0
myComponents/floatButton/floatButton.js

@@ -0,0 +1,114 @@
+// myComponents/floatButton/floatButton.js
+const App = getApp()
+Component({
+
+  /**
+   * 组件的属性列表
+   */
+  properties: {
+    count:{
+      type:Number,
+      value:0
+    },
+    icon:{
+      type:String,
+      value:'myIcon14'
+    },
+    position:{
+      type:String,
+      value:'left'
+    },
+    max:{
+      type:Number,
+      value:99
+    }
+  },
+
+  /**
+   * 组件的初始数据
+   */
+  data: {
+    top:80,
+    left:0,
+    windowHeight:App.globalData.windowHeight,
+    windowWidth:App.globalData.windowWidth,
+    startX: 0, // 触摸开始时的 X 坐标  
+    startY: 0, // 触摸开始时的 Y 坐标  
+    isDragging: false, // 是否正在拖动  
+  },
+
+  /**
+   * 组件的方法列表
+   */
+  methods: {
+    //改变位置
+    changePosition(){
+      var left = 0
+      if(this.properties.position == 'left'){
+        left = 0
+      }else{
+        left = parseInt(this.data.windowWidth) - 100
+      }
+      this.setData(
+        {
+          left:left
+        }
+      )
+    },
+    onButtonTouchStart: function(e) {  
+      this.setData({  
+        startX: e.touches[0].clientX,  
+        startY: e.touches[0].clientY,  
+        isDragging: true,  
+      });  
+    },  
+      
+    onButtonMove: function(e) {  
+      if (!this.data.isDragging) return;
+      // const deltaX = e.touches[0].clientX - this.data.startX;  
+      const deltaY = e.touches[0].clientY - this.data.startY; 
+      // let  newLeft;  
+      let  newTop; 
+      if(this.data.buttonStyle){
+        //  newLeft = parseInt(this.data.left) + deltaX;  
+         newTop = parseInt(this.data.top) + deltaY;   
+      }else{
+        // newLeft = this.data.startX;  
+        newTop = this.data.startY; 
+      }
+      newTop = newTop<50?50:newTop
+      newTop = newTop>this.data.windowHeight?this.data.windowHeight:newTop
+      // console.log(newLeft,newTop)
+
+      this.setData({  
+        // buttonStyle: `left:  ${newleft}px; top: ${newTop}px;`,
+        top:newTop,
+        // left:newLeft,  
+        startX: e.touches[0].clientX,  
+        startY: e.touches[0].clientY,  
+      });  
+    },  
+      
+    onButtonTouchEnd: function() {  
+      this.setData({  
+        isDragging: false,  
+      });  
+    }, 
+  },
+  lifetimes: {  
+    // 在组件实例进入页面节点树时执行  
+    attached: function () {  
+      // 初始化操作  
+      // console.log('组件初始化');  
+      this.changePosition()
+      // ...  
+    },  
+    // 在组件实例被移除出页面节点树时执行  
+    detached: function () {  
+      // 清理工作  
+      console.log('组件销毁');  
+      // ...  
+    },  
+    // ...  
+  }
+})

+ 6 - 0
myComponents/floatButton/floatButton.json

@@ -0,0 +1,6 @@
+{
+  "component": true,
+  "usingComponents": {
+    "wux-badge": "/miniprogram_npm/wux-weapp/badge/index"
+  }
+}

+ 15 - 0
myComponents/floatButton/floatButton.wxml

@@ -0,0 +1,15 @@
+<!--myComponents/floatButton/floatButton.wxml-->
+<view wx:if="{{count>0}}" class="float-btn-container" style="top:{{top}}px;left: {{left}};" catchtouchmove="onButtonMove" catchtouchstart="onButtonTouchStart" catchtouchend="onButtonTouchEnd"> 
+
+    <!-- 按钮内容,比如图标或文字 -->  
+    <!-- <wux-badge count="{{10}}">
+      <text class="iconfont {{icon}}"></text>  
+    </wux-badge> -->
+    <view class="badge">
+      <view class="iconfont {{icon}}"></view>
+      <view class="count">
+        <text wx:if="{{count>=max}}" class="num">{{count - 1}}+</text>
+        <text wx:else>{{count}}</text>
+      </view>
+    </view>
+</view>

+ 36 - 0
myComponents/floatButton/floatButton.wxss

@@ -0,0 +1,36 @@
+/* myComponents/floatButton/floatButton.wxss */
+@import "/static/iconfont/iconfont.wxss";
+.float-btn-container {  
+  position: fixed;  
+  width: 100rpx;  
+  height: 100rpx;  
+  line-height: 100rpx;
+  margin: auto;
+  /* top: 280px;  
+  left: 0;   */
+  z-index: 999; /* 确保按钮在其他内容之上 */  
+  overflow: hidden; /* 防止拖动时页面滚动 */  
+} 
+
+.badge{
+  position: relative;
+}
+.count{
+  font-size: 12px;
+  padding: 0 10rpx;
+  color: white;
+  background-color: red;
+  min-width: 18px;
+  height: 18px;
+  text-align: center;
+  line-height: 18px;
+  border-radius: 50%;
+  position:absolute;
+  left: 10px;
+  top: 2px;
+  
+}
+
+.iconfont{
+  font-size: 60rpx;
+}

+ 14 - 1
myComponents/navBar/navBar.js

@@ -35,10 +35,23 @@ Component({
     clickBack(){
       var pages = getCurrentPages()
       if (pages.length >= 2) {
+        if(pages[pages.length-2].route == "pages/mine/mine" && pages[pages.length-1].route == "pages/login/login"){
+          
+          // if(pages.length == 2){
+          //   wx.switchTab({
+          //     url: '/pages/index/index'
+          //   });
+          // }else{
+            wx.navigateBack({
+              delta: 2
+            })
+          // }
+        }else{
           wx.navigateBack()
+        }
       } else {
           wx.switchTab({
-              url: pages[0].route
+              url: '/pages/index/index'
           });
       }
   },

+ 3 - 1
myComponents/product/product.js

@@ -75,7 +75,9 @@ Component({
     },
     //查看爆款产品专利
     checkMessage(){
-
+      wx.navigateTo({
+        url: '/pages/searchResults/searchResults',
+      })
     },
   },
    /**  

+ 6 - 4
pages/hotProduct/hotProduct.js

@@ -23,21 +23,21 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad(options) {
-    this.init()
+    
   },
 
   /**
    * 生命周期函数--监听页面初次渲染完成
    */
   onReady() {
-
+    this.init()
   },
 
   /**
    * 生命周期函数--监听页面显示
    */
   onShow() {
-
+    
   },
 
 
@@ -83,7 +83,9 @@ Page({
             }
           )
         }
-        $stopWuxRefresher()
+        setTimeout(() => {
+          $stopWuxRefresher()
+        }, 1000)
       }
     })
     

+ 2 - 1
pages/hotProduct/hotProduct.wxml

@@ -24,8 +24,9 @@
       <text>黑名单</text>
     </view>
   </view>
-  <scroll-view type="list" scroll-y class="main">
+  <scroll-view wx:if="{{tableData.length>0}}" type="list" scroll-y class="main">
     <myProduct tableData="{{tableData}}" total="{{total}}" loading="{{loading}}" bindloadMore="loadMore"></myProduct>
   </scroll-view>
+  <van-empty wx:else description="暂无数据" />
 </view>
 </wux-refresher>

+ 1 - 0
pages/index/index.wxss

@@ -16,6 +16,7 @@ page {
   width: 200rpx;
   height: 100rpx;
   margin: auto;
+  object-fit: cover;
 }
 .title{
   text-align: center;

+ 1 - 1
pages/login/login.js

@@ -196,8 +196,8 @@ Page({
   },
   //登录后操作
   isLogin({token,id,isFirst,phone}){
-    wx.navigateBack()
     wx.setStorageSync('token',token)
+    wx.navigateBack()
   },
   //跳转到注册界面
   register(){

+ 1 - 0
pages/login/login.wxss

@@ -9,6 +9,7 @@
   width: 200rpx;
   height: 100rpx;
   margin: auto;
+  object-fit: cover;
 }
 .foot_btn{
   margin-top: 20rpx;

+ 129 - 0
pages/memberCenter/memberCenter.js

@@ -0,0 +1,129 @@
+// pages/memberCenter/memberCenter.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    equity:[
+      {
+        icon:'',
+        label:'权益一'
+      },
+      {
+        icon:'',
+        label:'权益二'
+      },
+      {
+        icon:'',
+        label:'权益三'
+      },
+      {
+        icon:'',
+        label:'权益四'
+      },
+    ],
+    grades:[
+      {
+        background:'',
+        grade:'B级会员',
+        money:'365'
+      },
+      {
+        background:'',
+        grade:'A级会员',
+        money:'520'
+      },
+      {
+        background:'',
+        grade:'S级会员',
+        money:'888'
+      },
+    ]
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+
+  },
+
+  /**
+   * 页面功能
+   */
+  //开通会员
+  openVip(){
+    wx.requestVirtualPayment({
+      signData: JSON.stringify({
+        offerId: '123',
+        buyQuantity: 1,
+        env: 0,
+        currencyType: 'CNY',
+        productId: 'testproductId',
+        goodsPrice: 10,
+        outTradeNo: 'xxxxxx',
+        attach: 'testdata',
+      }),
+      paySig: 'd0b8bbccbe109b11549bcfd6602b08711f46600965253a949cd6a2b895152f9d',
+      signature: 'd0b8bbccbe109b11549bcfd6602b08711f46600965253a949cd6a2b895152f9d',
+      mode: 'short_series_goods',
+      success(res) {
+        console.log('requestVirtualPayment success', res)
+      },
+      fail({ errMsg, errCode }) {
+        console.error(errMsg, errCode)
+      },
+    })
+  },
+
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+
+  }
+})

+ 6 - 0
pages/memberCenter/memberCenter.json

@@ -0,0 +1,6 @@
+{
+  "navigationStyle": "custom",
+  "usingComponents": {
+    "wux-avatar":"/miniprogram_npm/wux-weapp/avatar/index"
+  }
+}

+ 35 - 0
pages/memberCenter/memberCenter.wxml

@@ -0,0 +1,35 @@
+<!--pages/memberCenter/memberCenter.wxml-->
+<navBar></navBar>
+<view class="memberCenter">
+  <view class="headTitle">会员中心</view>
+  <view class="content">
+    <view class="userinfo">
+      <view class="left">
+        <wux-avatar size="large" src="/static/image/logo-3.png"></wux-avatar>
+        <view class="message">
+          <view class="name">昵称</view>
+          <view class="description">请选择您要开通的会员等级</view>
+        </view>
+      </view>
+      <view class="type"> <text class="iconfont myIconrenyuan icon"></text> 普通会员</view>
+    </view>
+    <view class="equity">
+      <view class="equity_item" wx:for="{{equity}}" wx:key="index">
+        <view class="equity_item_icon iconfont {{item.icon}}"></view>
+        <view class="equity_item_lable">{{item.label}}</view>
+      </view>
+    </view>
+    <view class="grades">
+      <view class="grades_item" wx:for="{{grades}}" wx:key="index">
+        <view class="grades_item_label">{{item.grade}}</view>
+        <view class="money">¥<text class="money_value">{{item.money}}</text>/年</view>
+      </view>
+    </view>
+    <view class="headTitle" bind:tap="openVip">立即开通</view>
+    <view class="equityDetails">
+      <view class="equityDetails_title">会员权益说明</view>
+      <view class="equityDetails_content"></view>
+    </view>
+  </view>
+  
+</view>

+ 98 - 0
pages/memberCenter/memberCenter.wxss

@@ -0,0 +1,98 @@
+/* pages/memberCenter/memberCenter.wxss */
+.memberCenter{
+  padding: 0 30rpx;
+}
+.content{
+  margin-top: 15rpx;
+  height: 1000rpx;
+}
+.userinfo{
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+}
+.left{
+  display: flex;
+  align-items: center;
+}
+.message{
+  margin-left: 15rpx;
+}
+.name{
+  font-size: 35rpx;
+  font-weight: bolder;
+}
+.description{
+  font-size: 25rpx;
+}
+.type{
+  width: 170rpx;
+  font-size: 30rpx;
+  color: #ffffff;
+  /* font-weight: bold; */
+  border-radius: 50rpx;
+  background-color: var(--themeColor);
+}
+.icon{
+  font-size: 25rpx;
+  margin-left: 8rpx;
+  background-color: #ffffff;
+  border-radius: 50%;
+  padding: 4rpx;
+}
+
+.equity{
+  margin-top: 15rpx;
+  padding: 20rpx;
+  background-color: var(--themeColor);
+  border-radius: 10rpx;
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+}
+.equity_item{
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  color: #ffcc00;
+}
+
+.grades{
+  margin: 20rpx 0;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  background-color: var(--themeColor);
+}
+.grades_item{
+  border-radius: 10rpx;
+  color: #ffcc00;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  padding: 15rpx;
+}
+.grades_item_label{
+  font-size: 45rpx;
+  line-height: 2rem;
+}
+.money{
+  font-size: 25rpx;
+}
+.money_value{
+  font-size: 55rpx;
+}
+
+.equityDetails{
+  margin-top: 20rpx;
+}
+.equityDetails_title{
+  text-align: end;
+  font-weight: 500;
+}
+.equityDetails_content{
+  margin: 20rpx 0;
+}
+
+
+

+ 55 - 4
pages/mine/mine.js

@@ -41,14 +41,16 @@ Page({
         icon:'myIconmonitor',
         page:'/pages/monitor/monitor'
       },
-    ]
+    ],
+    isLogin:false,
+    userinfo:{}
   },
 
   /**
    * 生命周期函数--监听页面加载
    */
   onLoad(options) {
-
+    this.getUserinfo()
   },
 
   /**
@@ -62,18 +64,67 @@ Page({
    * 生命周期函数--监听页面显示
    */
   onShow() {
-
+    
   },
 
 
   /**
    * 页面功能
    */
+  //获取用户信息
+  getUserinfo(){
+    api.selectPerson().then(res=>{
+      if(res.code == 200){
+        this.setData(
+          {
+            isLogin:true,
+            userinfo:res.data
+          }
+        )
+      }
+    }).catch(error=>{
+
+      this.setData(
+        {
+          isLogin:false
+        }
+      )
+    })
+  },
+  //登录
+  login(){
+    wx.navigateTo({
+      url: '/pages/login/login',
+    })
+  },
   //点击菜单
   clickMenu(e){
     var page = e.currentTarget.dataset.page
+    var login = e.currentTarget.dataset.login
+    if(login){
+      wx.navigateTo({
+        url: page,
+      })
+    }else{
+      var token = wx.setStorageSync('token')
+      if(token){
+        wx.navigateTo({
+          url: page,
+        })
+      }else{
+        wx.showToast({
+            title: '请先登录',
+            icon: 'error',
+            duration: 2000
+          })
+      }
+    }
+    
+  },
+  //开通会员
+  openVIP(){
     wx.navigateTo({
-      url: page,
+      url: '/pages/memberCenter/memberCenter',
     })
   },
 

+ 15 - 3
pages/mine/mine.wxml

@@ -1,7 +1,7 @@
 <!--pages/mine/mine.wxml-->
 <van-notify id="van-notify" />
 <view class="mine">
-  <view class="head flex">
+  <view class="head flex" wx:if="{{isLogin}}">
     <view class="flex">
       <wux-avatar size="large" src="/static/image/logo-3.png"></wux-avatar>
       <view class="message">
@@ -9,11 +9,23 @@
         <view class="type"> <text class="iconfont myIconrenyuan icon"></text> 普通会员</view>
       </view>
     </view>
-    <view class="right">
+    <view class="right" bind:tap="openVIP">
       <text class="VIP">VIP</text>
       <text class="VIP_name">会员中心</text>
     </view>
   </view>
+  <view class="head flex" wx:else>
+    <view class="flex">
+      <wux-avatar size="large" src="/static/image/unlogin.jpeg"></wux-avatar>
+      <view class="message">
+        <view class="name">未登录</view>
+        <!-- <view> </view> -->
+      </view>
+    </view>
+    <view class="right" bind:tap="login">
+      立即登录
+    </view>
+  </view>
   <wux-divider wux-class="line" show-text="{{ false }}" />
   <view class="menu_icon">
     <view class="menu_icon_item" wx:for="{{menu2}}" data-page="{{item.page}}" bind:tap="clickMenu">
@@ -27,7 +39,7 @@
         <view class="menu_list_lable">{{ item.label }}</view>
         <view class="menu_list_icon"> > </view>
       </view> -->
-      <van-cell custom-class='vanCell' wx:for="{{menu1}}" title="{{item.label}}" is-link data-page="{{item.page}}" bind:click="clickMenu">
+      <van-cell custom-class='vanCell' wx:for="{{menu1}}" title="{{item.label}}" is-link data-page="{{item.page}}" data-login="{{true}}" bind:click="clickMenu">
         <van-icon slot="right-icon" name="arrow" color="green" />
       </van-cell>
   </view>

+ 1 - 0
pages/mine/mine.wxss

@@ -38,6 +38,7 @@
   border-radius: 15rpx;
   padding: 15rpx;
   font-size: 35rpx;
+  color: #ffffff;
 }
 .VIP{
   background-color: rgb(255 246 0);

+ 2 - 2
pages/monitor/monitor.js

@@ -19,14 +19,14 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad(options) {
-    this.init()
+    
   },
 
   /**
    * 生命周期函数--监听页面初次渲染完成
    */
   onReady() {
-
+    this.init()
   },
 
   /**

+ 2 - 2
pages/myFollow/myFollow.js

@@ -46,14 +46,14 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad(options) {
-    this.init()
+    
   },
 
   /**
    * 生命周期函数--监听页面初次渲染完成
    */
   onReady() {
-
+    this.init()
   },
 
   /**

+ 2 - 2
pages/myWork/myWork.js

@@ -22,14 +22,14 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad(options) {
-    this.init()
+    
   },
 
   /**
    * 生命周期函数--监听页面初次渲染完成
    */
   onReady() {
-
+    this.init()
   },
 
   /**

+ 2 - 2
pages/riskAssessment/riskAssessment.js

@@ -15,14 +15,14 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad(options) {
-    this.init()
+    
   },
 
   /**
    * 生命周期函数--监听页面初次渲染完成
    */
   onReady() {
-    
+    this.init()
   },
 
   /**

+ 1 - 0
pages/riskAssessment/riskAssessment.wxss

@@ -10,5 +10,6 @@
   width: 200rpx;
   height: 100rpx;
   margin: auto;
+  object-fit: cover;
 }
 

+ 2 - 2
pages/searchRecords/searchRecords.js

@@ -22,14 +22,14 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad(options) {
-    this.init()
+    
   },
 
   /**
    * 生命周期函数--监听页面初次渲染完成
    */
   onReady() {
-
+    this.init()
   },
 
   /**

+ 77 - 2
pages/searchResults/searchResults.js

@@ -1,11 +1,22 @@
 // pages/searchResults/searchResults.js
+const app = getApp()
+import { $startWuxRefresher, $stopWuxRefresher,$stopWuxLoader} from '../../miniprogram_npm/wux-weapp/index'
 Page({
 
   /**
    * 页面的初始数据
    */
   data: {
-
+    product:{},
+    imgHttp:app.globalData.imgHttp,
+    queryParams:{
+      current:1,
+      size:10
+    },
+    total:0,
+    loading:false,
+    tableData:[],
+    keyword:''
   },
 
   /**
@@ -19,7 +30,7 @@ Page({
    * 生命周期函数--监听页面初次渲染完成
    */
   onReady() {
-
+    this.init()
   },
 
   /**
@@ -30,6 +41,70 @@ Page({
   },
 
   /**
+   * 页面功能
+   */
+  //初始化加载
+  init(){
+    var params = {
+      current:1,
+      size:10
+    }
+    this.setData(
+      {
+        queryParams:params,
+        total:0,
+        tableData:[]
+      }
+    )
+    // this.getSearchRecords()
+  },
+  //下拉
+  onPulling() {
+    console.log('onPulling')
+  },
+  //下拉刷新
+  onRefresh() {
+    console.log('onRefresh')
+    this.init()
+  },
+  //查看图片
+  previewImage(e) {
+    const { current,imglist } = e.currentTarget.dataset
+    var imgs = []
+    for(var i =0;i<imglist.length;i++){
+      imgs.push(this.data.imgHttp + imglist[i].guid)
+    }
+    current = this.data.imgHttp + current
+    wx.previewImage({
+      current,
+      urls:imgs,
+    })
+  },
+  //修改输入的关键词
+  changeKeyword(e){
+    this.setData(
+      {
+        keyword:e.detail
+      }
+    )
+  },
+  //点击输入框内部图标
+  clickInnerIcon(e){
+    // console.log(e)
+  },
+  //点击搜索按钮
+  search(e){
+    // console.log(e)
+  },
+  //一键导出
+  export(e){
+    wx.navigateTo({
+      url: '/pages/selectedPatents/selectedPatents',
+    })
+  },
+
+
+  /**
    * 生命周期函数--监听页面隐藏
    */
   onHide() {

+ 8 - 1
pages/searchResults/searchResults.json

@@ -1,3 +1,10 @@
 {
-  "usingComponents": {}
+  "navigationStyle": "custom",
+  "usingComponents": {
+    "navBar": "/myComponents/navBar/navBar",
+    "myCard":"/myComponents/card/card",
+    "van-divider": "/miniprogram_npm/@vant/weapp/divider/index",
+    "van-radio": "/miniprogram_npm/@vant/weapp/radio/index",
+    "myFloatButton":"/myComponents/floatButton/floatButton"
+  }
 }

+ 79 - 3
pages/searchResults/searchResults.wxml

@@ -1,4 +1,80 @@
 <!--pages/searchResults/searchResults.wxml-->
-<view>
-  <view></view>
-</view>
+<navBar></navBar>
+<van-notify id="van-notify" />
+<myFloatButton count="{{10}}"></myFloatButton>
+<wux-refresher
+  id="wux-refresher"
+  bind:pulling="onPulling"
+  bind:refresh="onRefresh"
+  scrollTop="{{scrollTop}}"
+>
+<scroll-view scroll-y class="searchResults">
+  <view class="head">
+    <view class="img">
+      <image class="img" src="/static/image/logo-3.png" mode=""/>
+    </view>
+    <view>
+      <myInput value="{{keyword}}" placeholder="请输入产品相关关键词" bindchange="changeKeyword" bindsearch="search" bindclickInnerIcon="clickInnerIcon"></myInput>
+    </view>
+  </view>
+  <view class="product">
+    <view class="product_head">
+      <view class="product_text">检索内容</view>
+      <view class="product_icon">
+        <view class="iconfont myIconguanzhu" data-index="{{index}}" bind:tap="open"></view>
+        <view class="iconfont myIconmonitor" data-index="{{index}}" bind:tap="control"></view>
+      </view>
+    </view>
+    <view>
+      <swiper class="swiper" autoplay="{{true}}" interval="{{3000}}"  duration="{{500}}" indicator-dots="{{false}}">  
+        <block wx:if="{{product.systemFileList && product.systemFileList.length>0}}">  
+          <swiper-item wx:for="{{product.systemFileList}}" wx:for-item="img" wx:key="*this">  
+            <image src="{{imgHttp+img.guid}}" class="slide-image" />  
+            <!-- <image src="{{imgHttp+img.guid}}" class="slide-image" data-current="{{img}}" data-imgList="{{item.systemFileList}}" bindtap="previewImage"/>   -->
+          </swiper-item>  
+        </block>  
+        <swiper-item wx:else>
+          <image  class="slide-image" src="/static/image/empty.gif" mode=""/>
+        </swiper-item>
+      </swiper>
+    </view>
+  </view>
+  <van-divider 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>
+        <view class="content_head_result_btn" bind:tap="export">
+          一键导出
+        </view>
+      </view>
+    </view>
+    <view class="content_result">
+      <block wx:for="{{tableData}}" wx:key="index">
+        <myCard edit="{{false}}">
+          <view slot="head_left">
+            {{index}}{{item.name}}
+          </view>
+          <view slot="head_right">
+            <van-radio name="2"></van-radio>
+          </view>
+          <view>
+            <swiper indicator-dots="{{true}}"
+            autoplay="{{true}}" interval="{{2000}}" duration="{{500}}">
+            <block wx:for="{{item.systemFileList}}" wx:for-item="img" wx:key="*this">
+              <swiper-item>
+                <image src="{{imgHttp+img.guid}}" class="slide-image" data-current="{{img}}" data-imgList="{{item.systemFileList}}" bindtap="previewImage"/>  
+              </swiper-item>
+            </block>
+          </swiper>
+          <view>
+            专利权人:
+          </view>
+          </view>
+        </myCard>
+      </block>
+    </view>
+  </view>
+</scroll-view>
+</wux-refresher>

+ 66 - 1
pages/searchResults/searchResults.wxss

@@ -1 +1,66 @@
-/* pages/searchResults/searchResults.wxss */
+/* pages/searchResults/searchResults.wxss */
+@import "/static/iconfont/iconfont.wxss";
+.swiper{
+  height: 200rpx;
+}
+.slide-image {  
+  width: 100%;  
+  height: 180rpx;  
+}
+.searchResults{
+  height: 99vh;
+  margin-top: 10px;
+  width: calc(100% - 60rpx);
+  padding: 0 30rpx;
+}
+.head{
+  display: flex;
+  align-items: center;
+}
+.img{
+  width: 200rpx;
+  height: 100rpx;
+  margin: auto;
+  object-fit: cover;
+}
+
+.product_head{
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+}
+.product_text{
+  color: #4695e5;
+  font-size: 30rpx;
+}
+.product_icon{
+  display: flex;
+  align-items: center;
+}
+.iconfont{
+  margin-left: 10rpx;
+}
+
+.content_head{
+  font-size: 30rpx;
+}
+.content_head_description{
+  text-align: end;
+  color: red;
+}
+.content_head_result{
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+}
+.content_head_result_description{
+  font-size: 25rpx;
+}
+.content_head_result_btn{
+  width: 150rpx;
+  padding: 15rpx;
+  background-color: var(--themeColor);
+  border-radius: 15rpx;
+  text-align: center;
+  color: #ffffff;
+}

+ 68 - 0
pages/selectedPatents/selectedPatents.js

@@ -0,0 +1,68 @@
+// pages/selectedPatents/selectedPatents.js
+const app = getApp()
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    imgHttp:app.globalData.imgHttp,
+    tableData:[],
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+
+  }
+})

+ 8 - 0
pages/selectedPatents/selectedPatents.json

@@ -0,0 +1,8 @@
+{
+  "navigationStyle": "custom",
+  "usingComponents": {
+    "navBar": "/myComponents/navBar/navBar",
+    "myCard":"/myComponents/card/card",
+    "myFloatButton":"/myComponents/floatButton/floatButton"
+  }
+}

+ 41 - 0
pages/selectedPatents/selectedPatents.wxml

@@ -0,0 +1,41 @@
+<!--pages/selectedPatents/selectedPatents.wxml-->
+<navBar></navBar>
+<van-notify id="van-notify" />
+
+<view class="selectedPatents">
+  <view class="head">
+    <view>
+      <text class="head_text">已选择专利</text>
+    </view>
+    <view></view>
+  </view>
+  <scroll-view scroll-y class="content">
+    <block wx:for="{{tableData}}" wx:key="index">
+        <myCard edit="{{false}}">
+          <view slot="head_left">
+            {{index}}{{item.name}}
+          </view>
+          <view slot="head_right">
+            <!-- <van-radio name="2"></van-radio> -->
+          </view>
+          <view>
+            <swiper indicator-dots="{{true}}"
+            autoplay="{{true}}" interval="{{2000}}" duration="{{500}}">
+            <block wx:for="{{item.systemFileList}}" wx:for-item="img" wx:key="*this">
+              <swiper-item>
+                <image src="{{imgHttp+img.guid}}" class="slide-image" data-current="{{img}}" data-imgList="{{item.systemFileList}}" bindtap="previewImage"/>  
+              </swiper-item>
+            </block>
+          </swiper>
+          <view>
+            专利权人:
+          </view>
+          </view>
+        </myCard>
+      </block>
+  </scroll-view>
+  <view class="foot">
+    <view class="foot_btn">人工服务</view>
+    <view class="foot_btn">导出专利</view>
+  </view>
+</view>

+ 34 - 0
pages/selectedPatents/selectedPatents.wxss

@@ -0,0 +1,34 @@
+/* pages/selectedPatents/selectedPatents.wxss */
+.selectedPatents{
+  /* height: 100vh; */
+  padding: 0 30rpx;
+}
+.head{
+  display: flex;
+  justify-content: space-between;
+}
+.head_text{
+  font-weight: bold;
+}
+
+.content{
+  border: 2px solid var(--themeColor);
+  border-radius: 10rpx;
+  height: 1000rpx;
+  margin: 10rpx 0;
+}
+
+.foot{
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+}
+
+.foot_btn{
+  width: 180rpx;
+  text-align: center;
+  padding: 15rpx 20rpx;
+  background-color: var(--themeColor);
+  color: #ffffff;
+  border-radius: 15rpx;
+}

File diff suppressed because it is too large
+ 11 - 3
static/iconfont/iconfont.wxss


二進制
static/image/unlogin.jpeg


+ 14 - 2
utils/request.js

@@ -4,11 +4,13 @@ import Notify from '../miniprogram_npm/@vant/weapp/notify/notify';
 
 
 // 配置项  
+const token = wx.getStorageSync('token')
 const config = {  
-  baseURL: 'http://192.168.1.6:8901', // 基础URL  
+  baseURL: 'http://192.168.1.16:8901', // 基础URL  
   timeout: 30000, // 超时时间(单位ms)  
   header: {  
     'content-type': 'application/json', // 默认请求头  
+    "token":token
     // 其他全局请求头...  
   },  
   // 其他全局配置...  
@@ -31,12 +33,22 @@ function request(url, method = 'GET', data = {}, header = {}) {
         if (res.data && res.data.code === 200) { // 假设服务器返回code为200表示成功 
           resolve(res.data);  
         } else {  
+          switch(res.data.code){
+            case 401:
+              Notify({ type: 'danger', message: '未登录' });
+              wx.navigateTo({
+                url: '/pages/login/login',
+              })
+              break;
+            default:
+              Notify({ type: 'danger', message: '请求失败' });
+             
+          }
           // wx.showToast({
           //   title: '请求失败',
           //   icon: 'error',
           //   duration: 2000
           // })
-          Notify({ type: 'danger', message: '请求失败' });
           reject(res.data.message || '未知错误');  
         }  
       },  

+ 2 - 0
utils/upload.js

@@ -1,9 +1,11 @@
 // 配置项  
+const token = wx.getStorageSync('token')
 const config = {  
   baseURL: 'http://192.168.1.6:8801', // 基础URL  
   timeout: 30000, // 超时时间(单位ms)  
   header: {  
     'content-type': 'application/json', // 默认请求头  
+    "token":token
     // 其他全局请求头...  
   },  
   // 其他全局配置...