zhuliu преди 1 година
родител
ревизия
52ac6ef5e1
променени са 51 файла, в които са добавени 800 реда и са изтрити 177 реда
  1. 4 2
      api/index.js
  2. 7 0
      api/pay.js
  3. 11 2
      api/search.js
  4. 2 1
      app.json
  5. 0 38
      myComponents/bubble/bubble.js
  6. 0 6
      myComponents/bubble/bubble.wxml
  7. 0 24
      myComponents/bubble/bubble.wxss
  8. 68 3
      myComponents/card/card.js
  9. 3 1
      myComponents/card/card.json
  10. 4 2
      myComponents/card/card.wxml
  11. 5 1
      myComponents/floatButton/floatButton.js
  12. 2 1
      myComponents/floatButton/floatButton.json
  13. 5 1
      myComponents/floatButton/floatButton.wxml
  14. 21 2
      myComponents/myInput/myInput.js
  15. 40 0
      myComponents/popover/popover-item.js
  16. 0 0
      myComponents/popover/popover-item.json
  17. 3 0
      myComponents/popover/popover-item.wxml
  18. 14 0
      myComponents/popover/popover-item.wxss
  19. 99 0
      myComponents/popover/popover.js
  20. 4 0
      myComponents/popover/popover.json
  21. 6 0
      myComponents/popover/popover.wxml
  22. 40 0
      myComponents/popover/popover.wxss
  23. 7 2
      myComponents/product/product.js
  24. 3 2
      myComponents/product/product.wxml
  25. 20 13
      pages/form/appeal/appeal.js
  26. 5 2
      pages/form/appeal/appeal.wxml
  27. 15 3
      pages/form/application/application.js
  28. 1 1
      pages/hotProduct/hotProduct.js
  29. 10 7
      pages/memberCenter/memberCenter.js
  30. 3 2
      pages/memberCenter/memberCenter.wxml
  31. 21 6
      pages/memberCenter/memberCenter.wxss
  32. 1 1
      pages/monitor/monitor.js
  33. 1 1
      pages/myFollow/myFollow.js
  34. 68 6
      pages/myWork/myWork.js
  35. 1 1
      pages/myWork/myWork.wxml
  36. 1 1
      pages/riskAssessment/riskAssessment.js
  37. 1 1
      pages/searchRecords/searchRecords.js
  38. 102 7
      pages/searchResults/searchResults.js
  39. 3 2
      pages/searchResults/searchResults.json
  40. 31 14
      pages/searchResults/searchResults.wxml
  41. 11 7
      pages/searchResults/searchResults.wxss
  42. 1 0
      static/svg/A级会员背景图标.svg
  43. 1 0
      static/svg/B级会员背景图标.svg
  44. 1 0
      static/svg/S级会员背景图标.svg
  45. 1 0
      static/svg/会员下载.svg
  46. 1 0
      static/svg/会员权益 (1).svg
  47. 1 0
      static/svg/会员权益.svg
  48. 1 0
      static/svg/会员级别处理.svg
  49. 3 0
      utils/pay.js
  50. 95 5
      utils/request.js
  51. 52 9
      utils/upload.js

+ 4 - 2
api/index.js

@@ -3,7 +3,8 @@ const login = require('./login')
 const category = require('./category')
 const product = require('./product')
 const user = require('./user.js')
-const work = require('./work')
+const work = require('./work.js')
+const pay = require('./pay.js')
 
 function isLogin(){
   var token = wx.getStorageSync('token')
@@ -36,5 +37,6 @@ module.exports={
   ...category,
   ...product,
   ...user,
-  ...work
+  ...work,
+  ...pay
 }

+ 7 - 0
api/pay.js

@@ -0,0 +1,7 @@
+const request = require('../utils/request')
+
+module.exports={ 
+	weixinpay:(data)=>{
+		return request.get('/xiaoshi-weixinback/weixinpay/get',data)
+	}
+ }

+ 11 - 2
api/search.js

@@ -1,7 +1,16 @@
 const request = require('../utils/request')
 
 module.exports={ 
-	search:(data)=>{
-		return request.get('/permission/api/admin/verifyCode',data)
+  //根据关键词获取列表(图片用于排序)接口(有图)
+	getPatentVectorsByImage:(data,file)=>{
+    return request.upload(file,data,'/xiaoshi-weixinback/patent/getPatentVectors')
+  },
+  //根据关键词获取列表(图片用于排序)接口(无图)
+	getPatentVectors:(data)=>{
+    return request.post('/xiaoshi-weixinback/patent/getPatentVectors',data,true,{'content-type': 'application/x-www-form-urlencoded'})
+  },
+  //根据关键词获取列表(图片用于排序)接口
+	getPictureByNo:(data)=>{
+		return request.post('/xiaoshi-weixinback/patent/getPictureByNo',data)
 	}
  }

+ 2 - 1
app.json

@@ -55,7 +55,8 @@
     "navBar": "/myComponents/navBar/navBar",
     "van-empty": "/miniprogram_npm/@vant/weapp/empty/index",
     "wux-image": "/miniprogram_npm/wux-weapp/image/index",
-    "wux-safe-area": "/miniprogram_npm/wux-weapp/safe-area/index"
+    "wux-safe-area": "/miniprogram_npm/wux-weapp/safe-area/index",
+    "van-tag": "/miniprogram_npm/@vant/weapp/tag/index"
   },
   "componentFramework": "glass-easel",
   "sitemapLocation": "sitemap.json",

+ 0 - 38
myComponents/bubble/bubble.js

@@ -1,38 +0,0 @@
-// myComponents/bubble/bubble.js
-Component({  
-  properties: {  
-    // 气泡框显示时的样式  
-    showStyle: {  
-      type: Object,  
-      value: {}  
-    }  
-  },  
-  data: {  
-    // 控制气泡框的显示与隐藏  
-    show: false  
-  },  
-  methods: {  
-    // 显示气泡框  
-    showBubble() {  
-      this.setData({  
-        show: true  
-      });  
-    },  
-    // 隐藏气泡框  
-    hideBubble() {  
-      this.setData({  
-        show: false  
-      });  
-    }  
-  },  
-  lifetimes: {  
-    // 组件加载时设置初始样式  
-    attached() {  
-      const { showStyle } = this.properties;  
-      this.setData({  
-        containerStyle: showStyle.containerStyle || '',  
-        contentStyle: showStyle.contentStyle || ''  
-      });  
-    }  
-  }  
-});

+ 0 - 6
myComponents/bubble/bubble.wxml

@@ -1,6 +0,0 @@
-<!--myComponents/bubble/bubble.wxml-->
-<view class="bubble-container" style="{{containerStyle}}">  
-  <view class="bubble-content" style="{{contentStyle}}">  
-    <slot></slot>  
-  </view>  
-</view>

+ 0 - 24
myComponents/bubble/bubble.wxss

@@ -1,24 +0,0 @@
-/* myComponents/bubble/bubble.wxss */
-.bubble-container {  
-  position: relative;  
-  display: inline-block;  
-}  
-  
-.bubble-content {  
-  position: absolute;  
-  padding: 10px;  
-  border-radius: 10px;  
-  background-color: rgba(255, 255, 255, 0.9);  
-  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);  
-  /* 根据需要添加动画 */  
-  transition: all 0.3s ease-in-out;  
-  /* 初始状态隐藏 */  
-  opacity: 0;  
-  transform: translateY(-10px);  
-}  
-  
-/* 展示时的样式 */  
-.bubble-container.show .bubble-content {  
-  opacity: 1;  
-  transform: translateY(0);  
-}

+ 68 - 3
myComponents/card/card.js

@@ -10,20 +10,85 @@ Component({
     edit:{
       type:Boolean,
       value:true
-    }
+    },
+    menu:{
+      type:Array,
+      value:[]
+    },
+    data:null,
+    index:null
   },
 
   /**
    * 组件的初始数据
    */
   data: {
-
+    popover:null
   },
 
   /**
    * 组件的方法列表
    */
   methods: {
+    onTap: function (e) {
+      if(this.data.menu.length == 0){
+        return false
+      }
+      console.log(e)
+      console.log(this.data.popover)
+      // 获取按钮元素的坐标信息
+      var id =  e.currentTarget.id // 或者 e.target.id 获取点击元素的 ID 值
+      const query = wx.createSelectorQuery().in(this); 
+     var that = this
+      query.select('#'+id).boundingClientRect(function(res) { 
+        // console.log(res.id);      // 节点的ID  
+        // console.log(res.dataset); // 节点的dataset  
+        // console.log(res.left);    // 节点的左边界坐标  
+        // console.log(res.right);   // 节点的右边界坐标  
+        // console.log(res.top);     // 节点的上边界坐标  
+        // console.log(res.bottom);  // 节点的下边界坐标  
+        // console.log(res.width);   // 节点的宽度  
+        // console.log(res.height);  // 节点的高度  
+        that.data.popover.onDisplay(res);
+      }).exec();
+    },
 
-  }
+    // 响应popover组件中的子元素点击事件
+    onClickA: function (e) {
+      const item = e.currentTarget.dataset.item
+      item.data = this.properties.data
+      item.index = this.properties.index
+      // wx.showToast({
+      //   title: '你点击了A',
+      //   icon: 'none'
+      // });
+      // 调用自定义组件 popover 中的 onHide 方法
+      this.data.popover.onHide();
+      this.triggerEvent('value',item)
+    }
+  },
+   /**  
+   * 组件的生命周期函数列表  
+   */  
+  lifetimes: {  
+    // 在组件实例进入页面节点树时执行  
+    attached: function () {  
+      // 初始化操作
+      this.setData(
+        {
+          popover:this.selectComponent('#popover')
+        }
+      )  
+      // this.data.popover = this.selectComponent('#popover')
+      console.log(this.data.popover)
+      // ...  
+    },  
+    // 在组件实例被移除出页面节点树时执行  
+    detached: function () {  
+      // 清理工作  
+      console.log('组件销毁');  
+      // ...  
+    },  
+    // ...  
+  }, 
 })

+ 3 - 1
myComponents/card/card.json

@@ -2,6 +2,8 @@
   "component": true,
   "usingComponents": {
     "van-icon": "/miniprogram_npm/@vant/weapp/icon/index",
-    "wux-popover":"/miniprogram_npm/wux-weapp/popover/index"
+    "wux-popover":"/miniprogram_npm/wux-weapp/popover/index",
+    "myPopover":"/myComponents/popover/popover",
+    "myPopover-item":"/myComponents/popover/popover-item"
   }
 }

+ 4 - 2
myComponents/card/card.wxml

@@ -1,5 +1,8 @@
 <!--myComponents/card/card.wxml-->
 <view class="myCard">
+  <myPopover id='popover' wx:if="{{menu.length>0}}">
+    <myPopover-item wx:for="{{menu}}" data-item="{{item}}" bindtap='onClickA' hasline>{{item.label}}</myPopover-item>
+  </myPopover>
   <view class="head">
     <view class="head_left">
       <slot name="head_left"></slot>
@@ -9,8 +12,7 @@
         <slot name="head_right"></slot>
       </view>
       <view class="eidt" wx:if="{{edit}}" >
-        <van-icon name="ellipsis" />
-     
+        <van-icon name="ellipsis" id='button' bindtap='onTap'/>
       </view>
     </view>
   </view>

+ 5 - 1
myComponents/floatButton/floatButton.js

@@ -28,7 +28,7 @@ Component({
    * 组件的初始数据
    */
   data: {
-    top:80,
+    top:450,
     left:0,
     windowHeight:App.globalData.windowHeight,
     windowWidth:App.globalData.windowWidth,
@@ -94,6 +94,10 @@ Component({
         isDragging: false,  
       });  
     }, 
+
+    click(e){
+      this.triggerEvent('click')
+    }
   },
   lifetimes: {  
     // 在组件实例进入页面节点树时执行  

+ 2 - 1
myComponents/floatButton/floatButton.json

@@ -1,6 +1,7 @@
 {
   "component": true,
   "usingComponents": {
-    "wux-badge": "/miniprogram_npm/wux-weapp/badge/index"
+    "wux-badge": "/miniprogram_npm/wux-weapp/badge/index",
+    "van-tag": "/miniprogram_npm/@vant/weapp/tag/index"
   }
 }

+ 5 - 1
myComponents/floatButton/floatButton.wxml

@@ -1,5 +1,5 @@
 <!--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"> 
+<view wx:if="{{count>0}}" class="float-btn-container" style="top:{{top}}px;left: {{left}};" catchtouchmove="onButtonMove" catchtouchstart="onButtonTouchStart" catchtouchend="onButtonTouchEnd" catch:tap="click"> 
 
     <!-- 按钮内容,比如图标或文字 -->  
     <!-- <wux-badge count="{{10}}">
@@ -11,5 +11,9 @@
         <text wx:if="{{count>=max}}" class="num">{{count - 1}}+</text>
         <text wx:else>{{count}}</text>
       </view>
+      <!-- <van-tag round color="#3f395c" class="count">
+        <text wx:if="{{count>=max}}" class="num">{{count - 1}}+</text>
+        <text wx:else>{{count}}</text>
+      </van-tag> -->
     </view>
 </view>

+ 21 - 2
myComponents/myInput/myInput.js

@@ -1,5 +1,5 @@
 // myComponents/myInput/myInput.js
-
+const api = require('../../api/index')
 Component({
   options: {
     multipleSlots: true // 在组件定义时的选项中启用多slot支持
@@ -19,6 +19,10 @@ Component({
     showEdit:{
       type:Boolean,
       value:true
+    },
+    ownner:{
+      type:Boolean,
+      value:true
     }
   },
   // 监听传入的变量,当传入的值发生变化时,触发方法
@@ -68,6 +72,22 @@ methods:{
     this.triggerEvent('clickInnerIcon',1)
   },
   buttonClick(e){
+    if(this.properties.ownner){
+      var isLogin = api.isLogin()
+      if(!isLogin){
+        return false
+      }
+      var params = {
+        key:this.data.content
+      }
+      if(this.data.fileList && this.data.fileList.length>0){
+        params.filePath = this.data.fileList[0].url
+      }
+      var product = JSON.stringify(params)
+      wx.navigateTo({
+        url: '/pages/searchResults/searchResults?type=0&product='+encodeURIComponent(product),
+      })
+    }
     // console.log(e,this.properties.value)
     this.triggerEvent('search',1)
   },
@@ -79,7 +99,6 @@ methods:{
         status: 'done',
         url: e.detail.tempFiles[0].tempFilePath,
       }]
-  
       this.setData({ fileList:data })
     }
   },

+ 40 - 0
myComponents/popover/popover-item.js

@@ -0,0 +1,40 @@
+
+Component({
+  relations: {
+    './popover': {
+      type: 'parent'
+    }
+  },
+  /**
+   * 组件的属性列表
+   */
+  properties: {
+    // 是否有底线
+    hasline: {
+      type: Boolean,
+      value: false
+    }
+  },
+
+  /**
+   * 组件的初始数据
+   */
+  data: {
+    // 每项的高度
+    height: 40
+  },
+
+  /**
+   * 组件的方法列表
+   */
+  methods: {
+    onClick: function() {
+      let { index } = this.properties;
+      let eventDetail = {
+        index: index
+      };
+      let eventOption = {};
+      this.triggerEvent('tap', eventDetail, eventOption);
+    }
+  }
+})

myComponents/bubble/bubble.json → myComponents/popover/popover-item.json


+ 3 - 0
myComponents/popover/popover-item.wxml

@@ -0,0 +1,3 @@
+<view class='popover-item {{hasline ? "underline" : ""}}' hover-class='popover-item-hover' catchtap='onClick' style='height:{{height}}px;line-height:{{height}}px;'>
+  <slot/>
+</view>

+ 14 - 0
myComponents/popover/popover-item.wxss

@@ -0,0 +1,14 @@
+.popover-item {
+  width: 100%;
+  font-size: 14px;
+  text-align: center;
+  white-space: nowrap;
+  overflow: hidden;
+  text-overflow: ellipsis;
+}
+.popover-item-hover {
+  background-color: #EEE;
+}
+.underline{
+  border-bottom:1px #EEE solid;
+}

+ 99 - 0
myComponents/popover/popover.js

@@ -0,0 +1,99 @@
+const { windowWidth, windowHeight } = wx.getSystemInfoSync();
+
+// 三角形箭头的高度
+const trangleHeight = 12;
+
+Component({
+  relations: {
+    './popover-item': {
+      type: 'child'
+    }
+  },
+
+  data: {
+    // 当前显隐状态
+    visible: false,
+    // popover 宽
+    pw: 100,
+    // popover 高
+    ph: 120,
+    // popover 距左距离
+    px: 0,
+    // popover 距上距离
+    py: 0,
+    // 垂直方向 top/bottom
+    vertical: '',
+    // 水平方向 left/center/right
+    align: ''
+  },
+
+  methods: {
+    onDisplay: function(e) {
+      let self = this;
+
+      if (self.last && self.last === e.id) {
+        self.setData({
+          visible: !self.data.visible
+        });
+      } else {
+        wx.createSelectorQuery().selectViewport().scrollOffset(view => {
+          let { pw, ph, px, py, vertical, align } = self.data;
+
+          let pOverW = (pw - e.width) / 2;
+
+          let offsetL = e.left,
+            offsetR = windowWidth - e.right,
+            offsetB = windowHeight - e.bottom;
+
+          if (offsetL >= pOverW && offsetR >= pOverW) {
+            align = 'center';
+            px = e.left - pOverW;
+          } else if (offsetL > pOverW && offsetR < pOverW) {
+            align = 'left';
+            px = windowWidth - (offsetR + pw);
+            // 如果向右贴边了,设置一点距离
+            if ((windowWidth - pw) == px) px -= 5;
+          } else if (offsetL < pOverW && offsetR > pOverW) {
+            align = 'right';
+            px = e.left;
+            // 如果向左贴边了,设置一点距离
+            if (px == 0) px += 5;
+          }
+
+          if (offsetB >= (ph + trangleHeight)) {
+            vertical = 'bottom';
+            py = view.scrollTop + e.bottom + trangleHeight;
+          } else {
+            vertical = 'top';
+            py = view.scrollTop + e.top - ph - trangleHeight;
+          }
+
+          self.setData({
+            visible: true,
+            px: px,
+            py: py,
+            ph: self.getItemsHeight(),
+            vertical: vertical,
+            align: align
+          });
+        }).exec();
+      }
+      // 记录上一次点击的元素
+      self.last = e.id;
+    },
+    onHide: function() {
+      this.setData({
+        visible: false
+      });
+    },
+    // 获取所有子元素
+    getItems: function() {
+      return this.getRelationNodes('./popover-item');
+    },
+    // 获取所有子元素的总高度
+    getItemsHeight() {
+      return this.getItems().map(item => item.data.height).reduce((a, b) => a + b, 0);
+    }
+  }
+
+})

+ 4 - 0
myComponents/popover/popover.json

@@ -0,0 +1,4 @@
+{
+  "component": true,
+  "usingComponents": {}
+}

+ 6 - 0
myComponents/popover/popover.wxml

@@ -0,0 +1,6 @@
+<view
+  wx:if='{{visible}}'
+  class='popover-view {{vertical}} {{align}}'
+  style='width:{{pw}}px;height:{{ph}}px;left:{{px}}px;top:{{py-130}}px;'>
+  <slot />
+</view>

+ 40 - 0
myComponents/popover/popover.wxss

@@ -0,0 +1,40 @@
+.popover-view {
+  position: absolute;
+  background-color: white;
+  box-shadow: 0 0 2px 2px #ddd;
+  border-radius: 6rpx;
+}
+/* 实现三角形 */
+.popover-view::before {
+  position: absolute;
+  display: inline-block;
+  width: 0;
+  height: 0px;
+  content: '';
+  border-style: solid;
+  border-width: 6px;
+  border-color: #fff #fff transparent transparent;
+  box-shadow: 2px -2px 2px #ddd;
+}
+/* 上 */
+.popover-view.top::before {
+  bottom: -6px;
+  transform: rotate(135deg);
+}
+/* 下 */
+.popover-view.bottom::before {
+  top: -6px;
+  transform: rotate(-45deg);
+}
+/* 左 */
+.popover-view.left::before {
+  right: 20px;
+}
+/* 中 */
+.popover-view.center::before {
+  left: 47px;
+}
+/* 右 */
+.popover-view.right::before {
+  left: 20px;
+}

+ 7 - 2
myComponents/product/product.js

@@ -75,13 +75,18 @@ Component({
       this.triggerEvent('loadMore')
     },
     //查看爆款产品专利
-    checkMessage(){
+    checkMessage(e){
       var key = api.isLogin()
       if(!key){
         return false
       }
+      var data = e.currentTarget.dataset.item
+      var product = '{}'
+      if(data){
+        product = JSON.stringify(data)
+      }
       wx.navigateTo({
-        url: '/pages/searchResults/searchResults',
+        url: '/pages/searchResults/searchResults?type=1&product='+encodeURIComponent(product),
       })
     },
   },

+ 3 - 2
myComponents/product/product.wxml

@@ -1,6 +1,6 @@
 <!--myComponents/product/product.wxml-->
 <view class="product_content">
-  <view class="product_item" wx:for="{{tableData}}" wx:for-index="index" wx:key="index" bind:tap="checkMessage">
+  <view class="product_item" wx:for="{{tableData}}" wx:for-index="index" wx:key="index" data-item="{{item}}" bind:tap="checkMessage">
     <swiper class="swiper" autoplay="{{true}}" interval="{{3000}}"  duration="{{500}}" indicator-dots="{{false}}">  
       <block wx:if="{{item.systemFileList.length>0}}">  
         <swiper-item wx:for="{{item.systemFileList}}" wx:for-item="img" wx:key="*this">  
@@ -10,7 +10,8 @@
         </swiper-item>  
       </block>  
       <swiper-item wx:else>
-        <image  class="slide-image" src="/static/image/empty.gif" mode=""/>
+        <!-- <image  class="slide-image" src="/static/image/empty.gif" mode=""/> -->
+        <view class="slide-image" style="background-image: url('/static/image/empty.gif')"></view>
       </swiper-item>
     </swiper>
     <view class="flex">

+ 20 - 13
pages/form/appeal/appeal.js

@@ -19,6 +19,7 @@ Page({
       ifTalked:true
     },
     labelWidth:350,
+    imageUrl:'',
     //站点
     countrys:[
       { text: '美国站', value: '美国站' },
@@ -83,19 +84,25 @@ Page({
     return Promise.resolve()
   },
   //上传文件
-  uploadFile(){
-    const that = this;  
-    wx.chooseMessageFile({  
-      count: 1, // 默认9,表示一次最多可以选择的文件个数  
-      type: 'file', // 可以指定是文件  
-      success(res) {  
-        // 返回选定文件的本地文件路径列表,tempFilePath可以作为文件上传的标识  
-        const tempFilePaths = res.tempFilePaths[0];  
-        upload(tempFilePaths).then(res=>{
-          console.log(res)
-        })
-      }  
-    }); 
+  beforeUpload(e){
+    if(e.detail.errMsg=="chooseMedia:ok"){
+      // var data = [{
+      //   status: 'done',
+      //   url: e.detail.tempFiles[0].tempFilePath,
+      // }]
+      this.setData({ imageUrl:e.detail.tempFiles[0].tempFilePath })
+      upload.upload(tempFilePaths).then(res=>{
+        if(res.code == 200){
+          var arr = []
+          arr.push(res.data[0])
+          this.setData(
+            {
+              ["form.fileGuids"]:arr
+            }
+          )
+        }
+      })
+    }
   },
   //输入备注
   changRemark(e){

+ 5 - 2
pages/form/appeal/appeal.wxml

@@ -72,14 +72,17 @@
             被投诉截图
           </view>
           <wux-upload
+            max='1'
             listType="picture-card"
-            showUploadList="{{ false }}"
-            url="https://www.skyvow.cn/api/common/file"
+            controlled
+            uploaded="false"
+            bind:before="beforeUpload"
             bind:change="onChange"
             bind:success="onSuccess"
             bind:fail="onFail"
             bind:complete="onComplete"
             bind:preview="onPreview"
+            bind:remove="onRemove"
           >
             <image src="{{ imageUrl }}" wx:if="{{ imageUrl }}" />
             <text wx:else>Upload</text>

+ 15 - 3
pages/form/application/application.js

@@ -81,10 +81,22 @@ Page({
       count: 1, // 默认9,表示一次最多可以选择的文件个数  
       type: 'file', // 可以指定是文件  
       success(res) {  
+        console.log(res)
         // 返回选定文件的本地文件路径列表,tempFilePath可以作为文件上传的标识  
-        const tempFilePaths = res.tempFilePaths[0];  
-        upload(tempFilePaths).then(res=>{
-          console.log(res)
+        const tempFilePaths = res.tempFiles[0].path;  
+        upload.upload(tempFilePaths).then(res=>{
+          if(res.code == 200){
+            var arr = this.data.form.fileGuids
+            if(!arr){
+              arr = []
+            }
+            arr.push(res.data[0])
+            this.setData(
+              {
+                ["form.fileGuids"]:arr
+              }
+            )
+          }
         })
       }  
     }); 

+ 1 - 1
pages/hotProduct/hotProduct.js

@@ -16,7 +16,7 @@ Page({
     },
     total:25,
     loading:false,
-    scrollTop: 10,
+    scrollTop: 0,
   },
 
   /**

+ 10 - 7
pages/memberCenter/memberCenter.js

@@ -7,35 +7,38 @@ Page({
   data: {
     equity:[
       {
-        icon:'',
+        icon:'/static/svg/会员下载.svg',
         label:'权益一'
       },
       {
-        icon:'',
+        icon:'/static/svg/会员权益 (1).svg',
         label:'权益二'
       },
       {
-        icon:'',
+        icon:'/static/svg/会员权益.svg',
         label:'权益三'
       },
       {
-        icon:'',
+        icon:'/static/svg/会员级别处理.svg',
         label:'权益四'
       },
     ],
     grades:[
       {
-        background:'',
+        background_icon:'/static/svg/B级会员背景图标.svg',
+        background_color:'#3f395c',
         grade:'B级会员',
         money:'365'
       },
       {
-        background:'',
+        background_icon:'/static/svg/A级会员背景图标.svg',
+        background_color:'#ff0101',
         grade:'A级会员',
         money:'520'
       },
       {
-        background:'',
+        background_icon:'/static/svg/S级会员背景图标.svg',
+        background_color:'#000000',
         grade:'S级会员',
         money:'888'
       },

+ 3 - 2
pages/memberCenter/memberCenter.wxml

@@ -15,12 +15,13 @@
     </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_icon iconfont {{item.icon}}"></view> -->
+        <view class="equity_item_icon backGroundImage" style="background-image: url('{{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 backGroundImage" wx:for="{{grades}}" wx:key="index" style="background-image: url('{{item.background_icon}}');background-color: {{item.background_color}};">
         <view class="grades_item_label">{{item.grade}}</view>
         <view class="money">¥<text class="money_value">{{item.money}}</text>/年</view>
       </view>

+ 21 - 6
pages/memberCenter/memberCenter.wxss

@@ -47,7 +47,7 @@
   background-color: var(--themeColor);
   border-radius: 10rpx;
   display: flex;
-  justify-content: space-between;
+  justify-content: space-around;
   align-items: center;
 }
 .equity_item{
@@ -56,31 +56,46 @@
   align-items: center;
   color: #ffcc00;
 }
-
+.equity_item_icon{
+  width: 80rpx;
+  height: 80rpx;
+  margin-bottom: 15rpx;
+}
 .grades{
   margin: 20rpx 0;
   display: flex;
   align-items: center;
   justify-content: space-between;
-  background-color: var(--themeColor);
+  /* background-color: var(--themeColor); */
+}
+.backGroundImage{
+  
+  background-size:contain; /* 图片覆盖整个容器,可能部分图片不可见 */  
+  background-position: center; /* 图片居中显示 */  
+  background-repeat: no-repeat; /* 图片不重复 */  
 }
 .grades_item{
   border-radius: 10rpx;
   color: #ffcc00;
+  font-weight: bold;
+  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
   display: flex;
   flex-direction: column;
   align-items: center;
-  padding: 15rpx;
+  margin: 10rpx;
+  padding: 10rpx;
+  width: 100%;
+  height: 100%;
 }
 .grades_item_label{
-  font-size: 45rpx;
+  font-size: 40rpx;
   line-height: 2rem;
 }
 .money{
   font-size: 25rpx;
 }
 .money_value{
-  font-size: 55rpx;
+  font-size: 50rpx;
 }
 
 .equityDetails{

+ 1 - 1
pages/monitor/monitor.js

@@ -13,7 +13,7 @@ Page({
       size:10
     },
     total:0,
-    scrollTop: 10,
+    scrollTop: 0,
   },
 
   /**

+ 1 - 1
pages/myFollow/myFollow.js

@@ -40,7 +40,7 @@ Page({
       },
     ],
     checked:[],
-    scrollTop: 10,
+    scrollTop: 0,
   },
 
   /**

+ 68 - 6
pages/myWork/myWork.js

@@ -16,12 +16,12 @@ Page({
     total:0,
     loading:false,
     imgHttp:app.globalData.imghttp,
-    scrollTop: 10,
+    scrollTop: 0,
     ticketTypeFiled:{
-      '1':'ticketFillInAddDTO',
-      '2':'protectionAddDTO',
-      '3':'respondingAddDTO',
-      '4':'ticketPatentApplyAddDTO'
+      '1':'ticketFillInVO',
+      '2':'ticketRightsProtectionVO',
+      '3':'ticketLitigationRespondingVO',
+      '4':'ticketPatentApplyVO'
     },
     ticketTypes:{
       '1':'我要查风险',
@@ -35,7 +35,25 @@ Page({
       '3':'正在处理中',
       '4':'完成',
       '5':'取消'
-    }
+    },
+    //操作栏位
+    menu:[
+      {
+        label:'支付',
+        method:'payMoney',
+        icon:''
+      },
+      {
+        label:'确认',
+        method:'confirm',
+        icon:''
+      },
+      {
+        label:'取消',
+        method:'cancel',
+        icon:''
+      },
+    ]
   },
 
   /**
@@ -125,6 +143,50 @@ Page({
     )
     this.getMyWork()
   },
+  //菜单点击
+  clickMenu(e){
+    console.log(e)
+    var data = e.detail
+    this[data.method](data.data,data.index)
+  },
+  //支付
+  payMoney(data,index){
+    console.log(data)
+  },
+  //取消5
+  cancel(data,index){
+    var params = {
+      id:data.id,
+      process:5
+    }
+    api.updateTicketProcess(params).then(res=>{
+      if(res.code == 200){
+        this.setData(
+          {
+            ["tableData["+index+"].ticketProgress"]:5
+          }
+        )
+      }
+    })
+   
+  },
+  //确认4
+  confirm(data,index){
+    var params = {
+      id:data.id,
+      process:4
+    }
+    api.updateTicketProcess(params).then(res=>{
+      if(res.code == 200){
+        this.setData(
+          {
+            ["tableData["+index+"].ticketProgress"]:4
+          }
+        )
+      }
+    })
+  },
+
 
   /**
    * 生命周期函数--监听页面隐藏

+ 1 - 1
pages/myWork/myWork.wxml

@@ -14,7 +14,7 @@
   </view>
   <scroll-view wx:if="{{tableData.length>0}}" type="list" scroll-y class="main">
     <block wx:for="{{tableData}}" wx:for-item="item" wx:key="index">
-      <myCard>
+      <myCard menu="{{menu}}" data="{{item}}" index="{{index}}" edit="{{(item.ticketProgress == 4 || item.ticketProgress == 5)?false:true}}" bindvalue='clickMenu'>
         <view slot="head_left" class="head_left">
           {{index + 1}}. {{ticketTypes[item.ticketType]}}-工单
         </view>

+ 1 - 1
pages/riskAssessment/riskAssessment.js

@@ -9,7 +9,7 @@ Page({
   data: {
     tableData:[],
     keyword:'',
-    scrollTop: 10,
+    scrollTop: 0,
   },
 
   /**

+ 1 - 1
pages/searchRecords/searchRecords.js

@@ -16,7 +16,7 @@ Page({
     total:0,
     loading:false,
     imgHttp:app.globalData.imghttp,
-    scrollTop: 10,
+    scrollTop: 0,
   },
 
   /**

+ 102 - 7
pages/searchResults/searchResults.js

@@ -1,5 +1,6 @@
 // pages/searchResults/searchResults.js
 const app = getApp()
+const api = require('../../api/index')
 import { $startWuxRefresher, $stopWuxRefresher,$stopWuxLoader} from '../../miniprogram_npm/wux-weapp/index'
 Page({
 
@@ -7,7 +8,6 @@ Page({
    * 页面的初始数据
    */
   data: {
-    product:{},
     imgHttp:app.globalData.imghttp,
     queryParams:{
       current:1,
@@ -17,21 +17,29 @@ Page({
     loading:false,
     tableData:[],
     keyword:'',
-    scrollTop:10
+    scrollTop: 0,
+    searchType:1,//检索类型
+    product:{},//产品信息
+    patentNoList:[],
   },
 
   /**
    * 生命周期函数--监听页面加载
    */
   onLoad(options) {
-
+    this.setData(
+      {
+        searchType:options.type,
+        product:JSON.parse(decodeURIComponent(options.product))
+      }
+    )
+    this.init()
   },
 
   /**
    * 生命周期函数--监听页面初次渲染完成
    */
   onReady() {
-    this.init()
   },
 
   /**
@@ -54,10 +62,11 @@ Page({
       {
         queryParams:params,
         total:0,
-        tableData:[]
+        tableData:[],
+        patentNoList:[]
       }
     )
-    // this.getSearchRecords()
+    this.getPatentVectors()
   },
   //下拉
   onPulling() {
@@ -70,7 +79,8 @@ Page({
   },
   //查看图片
   previewImage(e) {
-    const { current,imglist } = e.currentTarget.dataset
+    console.log(e)
+    var { current,imglist } = e.currentTarget.dataset
     var imgs = []
     for(var i =0;i<imglist.length;i++){
       imgs.push(this.data.imgHttp + imglist[i].guid)
@@ -104,6 +114,91 @@ Page({
     })
   },
 
+  //查询产品相关专利
+  getPatentVectors(){
+    console.log(this.data.product)
+    var params = {
+      pageNum:this.data.queryParams.current,
+      pageSize:this.data.queryParams.size
+    }
+    if(this.data.product.id){
+      params.productId = this.data.product.id
+    }else{
+      params.key = this.data.product.key
+      params.description = this.data.product.description
+    }
+    var vectorDTO = JSON.stringify(params)
+    var url = 'getPatentVectors'
+    var data = {
+      vectorDTO:vectorDTO
+    }
+    if(this.data.product.filePath){
+      url = "getPatentVectorsByImage"
+    }
+    api[url](data,this.data.product.filePath).then(res=>{
+      if(res.code == 200){
+        console.log(res)
+        var len1 = this.data.tableData.length
+        var len = len1>0?len1-1: 0
+        
+        this.setData(
+          {
+            tableData:this.data.tableData.concat(res.data.data),
+            total:res.data.total
+          }
+        )
+        for(let i = 0;i<res.data.data.length;i++){
+          this.getPictureByNo(res.data.data[i],len)
+          len += 1 
+        }
+        // res.data.data(item=>{
+        //   this.getPictureByNo(item,len)
+        //   len += 1 
+        // })
+      }
+    })
+  },
+  //根据专利号获取相关图片
+  getPictureByNo(data,index){
+    var params = {
+      appNo:data.appNo
+    }
+    api.getPictureByNo(params).then(res=>{
+      if(res.code == 200){
+        this.setData(
+          {
+            ["tableData["+index+"].imageList"]:res.data
+          }
+        )
+      }
+    })
+  },
+  //加载更多
+  loadMore(){
+    var current = this.data.queryParams.current
+    this.setData(
+      {
+        ['queryParams.current']:current+1
+      }
+    )
+    this.getPatentVectors()
+  },
+  //选择专利
+  changePatentNoList(event) {
+    console.log(event)
+    this.setData({
+      patentNoList: event.detail,
+    });
+  },
+
+  onchange(e){
+    console.log(1)
+  },
+
+  //查看已选择的专利
+  clickButton(e){
+
+  },
 
   /**
    * 生命周期函数--监听页面隐藏

+ 3 - 2
pages/searchResults/searchResults.json

@@ -4,7 +4,8 @@
     "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"
+    "myFloatButton":"/myComponents/floatButton/floatButton",
+    "van-checkbox": "/miniprogram_npm/@vant/weapp/checkbox/index",
+  "van-checkbox-group": "/miniprogram_npm/@vant/weapp/checkbox-group/index"
   }
 }

+ 31 - 14
pages/searchResults/searchResults.wxml

@@ -1,7 +1,7 @@
 <!--pages/searchResults/searchResults.wxml-->
 <navBar></navBar>
 <van-notify id="van-notify" />
-<myFloatButton count="{{10}}"></myFloatButton>
+<myFloatButton count="{{patentNoList.length}}" bind:click="clickButton"></myFloatButton>
 <wux-refresher
   id="wux-refresher"
   bind:pulling="onPulling"
@@ -19,7 +19,7 @@
   </view>
   <view class="product">
     <view class="product_head">
-      <view class="product_text">检索内容</view>
+      <view class="product_text"> <text wx:if="{{product.name}}">产品名称:{{product.name}}</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>
@@ -27,19 +27,28 @@
     </view>
     <view>
       <swiper class="swiper" autoplay="{{true}}" interval="{{3000}}"  duration="{{500}}" indicator-dots="{{false}}">  
-        <block wx:if="{{product.systemFileList && product.systemFileList.length>0}}">  
+        <block wx:if="{{searchType == 1 && 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" />   -->
+            <view class="slide-image" style="background-image: url('{{imgHttp+img.guid}}')"></view>
             <!-- <image src="{{imgHttp+img.guid}}" class="slide-image" data-current="{{img}}" data-imgList="{{item.systemFileList}}" bindtap="previewImage"/>   -->
           </swiper-item>  
-        </block>  
+        </block> 
+        <swiper-item wx:elif="{{searchType == 0 && product.filePath}}">
+          <!-- <image  class="slide-image" src="/static/image/empty.gif" mode=""/> -->
+          <view class="slide-image" style="background-image: url('{{product.filePath}}')"></view>
+        </swiper-item>
         <swiper-item wx:else>
-          <image  class="slide-image" src="/static/image/empty.gif" mode=""/>
+          <!-- <image  class="slide-image" src="/static/image/empty.gif" mode=""/> -->
+          <view class="slide-image" style="background-image: url('/static/image/empty.gif')"></view>
         </swiper-item>
       </swiper>
     </view>
+    <view class="product_text" wx:if="{{product.key}}">
+        检索内容:{{product.key}}
+      </view>
   </view>
-  <van-divider dashed />
+  <van-divider customStyle=" border-color: #6b6b6b;" dashed />
   <view class="content">
     <view class="content_head">
       <view class="content_head_description">注:非会员可选择100条</view>
@@ -50,31 +59,39 @@
         </view>
       </view>
     </view>
-    <view class="content_result">
+    <view class="content_result" wx:if="{{tableData.length>0}}">
       <block wx:for="{{tableData}}" wx:key="index">
         <myCard edit="{{false}}">
           <view slot="head_left">
-            {{index}}{{item.name}}
+            <van-tag round color="#3f395c">{{index+ 1}}</van-tag>  专利号:{{item.appNo}}
           </view>
           <view slot="head_right">
-            <van-radio name="2"></van-radio>
+            <van-checkbox-group value="{{ patentNoList }}" data-item="{{item}}" bind:change="changePatentNoList">
+              <van-checkbox name="{{item.appNo}}" bind:tap="onchange"></van-checkbox>
+            </van-checkbox-group>
           </view>
           <view>
             <swiper indicator-dots="{{true}}"
             autoplay="{{true}}" interval="{{2000}}" duration="{{500}}">
-            <block wx:for="{{item.systemFileList}}" wx:for-item="img" wx:key="*this">
+            <block wx:if="{{item.imageList && item.imageList.length>0}}" wx:for="{{item.imageList}}" wx:for-item="img" wx:key="index">
               <swiper-item>
-                <image src="{{imgHttp+img.guid}}" class="slide-image" data-current="{{img}}" data-imgList="{{item.systemFileList}}" bindtap="previewImage"/>  
+                <view style="background-image: url('{{imgHttp+img.guid}}')" class="slide-image" data-current="{{img}}" data-imgList="{{item.imageList}}" bind:tap="previewImage"></view>  
               </swiper-item>
             </block>
           </swiper>
-          <view>
-            专利权人:
+          <view wx:if="{{item.rightHolder && item.rightHolder.length>0}}">
+            专利权人:{{item.rightHolder[0].name}}
           </view>
           </view>
         </myCard>
       </block>
+      <view class="loadData" wx:if="{{total && tableData.length>0}}">
+        <view wx:if="{{total>tableData.length}}" bind:tap="loadMore">加载更多</view>
+        <wux-spin wux-class="spin" size="small" wx:elif="{{loading}}"/>
+        <view wx:elif="total>10">没有更多了</view>
+      </view>
     </view>
+    <van-empty wx:else description="暂无数据" />
   </view>
 </scroll-view>
 </wux-refresher>

+ 11 - 7
pages/searchResults/searchResults.wxss

@@ -5,11 +5,14 @@
 }
 .slide-image {  
   width: 100%;  
-  height: 180rpx;  
+  height: 100%;  
+  background-size:contain; /* 图片覆盖整个容器,可能部分图片不可见 */  
+  background-position: center; /* 图片居中显示 */  
+  background-repeat: no-repeat; /* 图片不重复 */  
 }
 .searchResults{
-  height: 99vh;
-  margin-top: 10px;
+  height: calc(100vh - 200rpx);
+  margin: 10px 0 ;
   width: calc(100% - 60rpx);
   padding: 0 30rpx;
 }
@@ -18,12 +21,13 @@
   align-items: center;
 }
 .img{
-  width: 200rpx;
-  height: 100rpx;
+  width: 140rpx;
+  height: 70rpx;
   margin: auto;
-  object-fit: cover;
 }
-
+.product{
+  margin-top: 15rpx;
+}
 .product_head{
   display: flex;
   justify-content: space-between;

Файловите разлики са ограничени, защото са твърде много
+ 1 - 0
static/svg/A级会员背景图标.svg


Файловите разлики са ограничени, защото са твърде много
+ 1 - 0
static/svg/B级会员背景图标.svg


Файловите разлики са ограничени, защото са твърде много
+ 1 - 0
static/svg/S级会员背景图标.svg


Файловите разлики са ограничени, защото са твърде много
+ 1 - 0
static/svg/会员下载.svg


Файловите разлики са ограничени, защото са твърде много
+ 1 - 0
static/svg/会员权益 (1).svg


Файловите разлики са ограничени, защото са твърде много
+ 1 - 0
static/svg/会员权益.svg


Файловите разлики са ограничени, защото са твърде много
+ 1 - 0
static/svg/会员级别处理.svg


+ 3 - 0
utils/pay.js

@@ -0,0 +1,3 @@
+function payMoney(){
+  
+}

+ 95 - 5
utils/request.js

@@ -5,12 +5,11 @@ import { $startWuxRefresher, $stopWuxRefresher,$stopWuxLoader} from '../miniprog
 
 // 配置项  
 const config = {  
-  // baseURL: 'http://192.168.1.2:8901', // 基础URL  
-  baseURL: 'https://www.xsip.cn', // 基础URL  
+  baseURL: 'http://192.168.1.2:8901', // 基础URL  
+  // baseURL: 'https://www.xsip.cn', // 基础URL  
   timeout: 30000, // 超时时间(单位ms)  
   header: {  
     'content-type': 'application/json', // 默认请求头  
-    
     // 其他全局请求头...  
   },  
   // 其他全局配置...  
@@ -25,7 +24,8 @@ function request(url, method = 'GET', data = {}, header = {},isLogin=true) {
     }
     var pages = getCurrentPages()
     var route = pages[pages.length - 1]?.route
-    if(config.tabbar.indexOf(route)==-1){
+    console.log(config.tabbar,route)
+    if(route && config.tabbar.indexOf(route)==-1){
       obj.top = "90"
     }
     wx.request({  
@@ -64,7 +64,11 @@ function request(url, method = 'GET', data = {}, header = {},isLogin=true) {
           //   icon: 'error',
           //   duration: 2000
           // })
-          Notify(obj)
+          console.log(obj)
+          if(obj.message){
+            Notify(obj)
+          }
+          
           reject(res.data.message || '未知错误');  
         }  
         if($stopWuxRefresher()){
@@ -84,15 +88,101 @@ function request(url, method = 'GET', data = {}, header = {},isLogin=true) {
         // Notify({ type: 'danger', message: '请求失败',top:'90' });
         Notify(obj)
         reject(error);  
+        if($stopWuxRefresher()){
+          $stopWuxRefresher()
+        }
       },  
     });  
   });  
 }  
   
+function upload(url="/fileManager/uploadNormalFile", path = '', header = {},formData={}) {  
+  return new Promise((resolve, reject) => {  
+    var obj = {
+      type: 'danger'
+    }
+    var pages = getCurrentPages()
+    var route = pages[pages.length - 1]?.route
+    console.log(config.tabbar,route)
+    if(route && config.tabbar.indexOf(route)==-1){
+      obj.top = "90"
+    }
+    wx.uploadFile({  
+      url: config.baseURL + url, //仅为示例,非真实的接口地址
+      filePath: path,
+      name: 'multipartFile',
+      formData: formData,  
+      header: {  
+        ...config.header,  
+        ...header,  
+        "Cookie": "token="+wx.getStorageSync('token')
+      },  
+      timeout: config.timeout,  
+      success: function(res){  
+        if(res.data){
+          res.data = JSON.parse(res.data)
+        }
+        // 根据业务逻辑处理成功响应  
+        if (res.data && res.data.code === 200) { // 假设服务器返回code为200表示成功 
+          resolve(res.data);  
+        } else {  
+          switch(res.data.code){
+            case 401:
+              if(isLogin){
+                // Notify({ type: 'danger', message: '未登录',top:'90' });
+                obj.message = '未登录'
+                wx.navigateTo({
+                  url: '/pages/login/login',
+                })
+              }
+              wx.setStorageSync('token', '')
+              break;
+            default:
+              obj.message = '请求失败'
+              // Notify({ type: 'danger', message: '请求失败',top:'90' });
+             
+          }
+          // wx.showToast({
+          //   title: '请求失败',
+          //   icon: 'error',
+          //   duration: 2000
+          // })
+          console.log(obj)
+          if(obj.message){
+            Notify(obj)
+          }
+          
+          reject(res.data.message || '未知错误');  
+        }  
+        if($stopWuxRefresher()){
+          $stopWuxRefresher()
+        }
+      },  
+      fail: function(error) { 
+        console.log(error) 
+        
+        // 处理请求失败 
+        // wx.showToast({
+        //   title: '请求失败',
+        //   icon: 'error',
+        //   duration: 2000
+        // })
+        obj.message = '请求失败'
+        // Notify({ type: 'danger', message: '请求失败',top:'90' });
+        Notify(obj)
+        reject(error);  
+      },  
+    });  
+  });  
+}  
+
+
+
 // 导出请求方法  
 module.exports = {  
   get: (url, data,isLogin, header) => request(url, 'GET', data, header,isLogin),  
   post: (url, data,isLogin, header) => request(url, 'POST', data, header,isLogin),  
   // 可以继续添加其他方法,如put, delete等  
   // ...  
+  upload: ( path,formData,url, header) => upload(url, path, header,formData), 
 };

+ 52 - 9
utils/upload.js

@@ -1,43 +1,84 @@
 // 配置项  
+import Notify from '../miniprogram_npm/@vant/weapp/notify/notify';
+import { $startWuxRefresher, $stopWuxRefresher,$stopWuxLoader} from '../miniprogram_npm/wux-weapp/index';
 const token = wx.getStorageSync('token')
 const config = {  
-  // baseURL: 'http://192.168.1.6:8801', // 基础URL 
-  baseURL: 'https://www.xsip.cn', // 基础URL   
+  baseURL: 'http://192.168.1.6:8802', // 基础URL 
+  // baseURL: 'https://www.xsip.cn', // 基础URL   
   timeout: 30000, // 超时时间(单位ms)  
   header: {  
     'content-type': 'application/json', // 默认请求头  
-    "token":token
-    // 其他全局请求头...  
+    // 其他全局请求头... 
+   
   },  
   // 其他全局配置...  
+  tabbar:["pages/index/index","pages/hotProduct/hotProduct","pages/mine/mine"] 
 };  
 // 封装请求方法  
 function upload(url="/fileManager/uploadNormalFile", path = '', header = {},formData={}) {  
   return new Promise((resolve, reject) => {  
-
+    var obj = {
+      type: 'danger'
+    }
+    var pages = getCurrentPages()
+    var route = pages[pages.length - 1]?.route
+    console.log(config.tabbar,route)
+    if(route && config.tabbar.indexOf(route)==-1){
+      obj.top = "90"
+    }
     wx.uploadFile({  
       url: config.baseURL + url, //仅为示例,非真实的接口地址
       filePath: path,
-      name: 'file',
-      formData: formData,  
+      name: 'files',
+      formData: {
+        sourceId:5,
+        ...formData
+      },  
       header: {  
         ...config.header,  
         ...header,  
+        "Cookie": "token="+wx.getStorageSync('token')
       },  
       timeout: config.timeout,  
       success: function(res){  
+        if(res.data){
+          res.data = JSON.parse(res.data)
+        }
         // 根据业务逻辑处理成功响应  
         if (res.data && res.data.code === 200) { // 假设服务器返回code为200表示成功 
           resolve(res.data);  
         } else {  
+          switch(res.data.code){
+            case 401:
+              if(isLogin){
+                // Notify({ type: 'danger', message: '未登录',top:'90' });
+                obj.message = '未登录'
+                wx.navigateTo({
+                  url: '/pages/login/login',
+                })
+              }
+              wx.setStorageSync('token', '')
+              break;
+            default:
+              obj.message = '请求失败'
+              // Notify({ type: 'danger', message: '请求失败',top:'90' });
+             
+          }
           // wx.showToast({
           //   title: '请求失败',
           //   icon: 'error',
           //   duration: 2000
           // })
-          Notify({ type: 'danger', message: '上传失败' });
+          console.log(obj)
+          if(obj.message){
+            Notify(obj)
+          }
+          
           reject(res.data.message || '未知错误');  
         }  
+        if($stopWuxRefresher()){
+          $stopWuxRefresher()
+        }
       },  
       fail: function(error) { 
         console.log(error) 
@@ -48,7 +89,9 @@ function upload(url="/fileManager/uploadNormalFile", path = '', header = {},form
         //   icon: 'error',
         //   duration: 2000
         // })
-        Notify({ type: 'danger', message: '上传失败' });
+        obj.message = '请求失败'
+        // Notify({ type: 'danger', message: '请求失败',top:'90' });
+        Notify(obj)
         reject(error);  
       },  
     });