zhuliu 1 vuosi sitten
vanhempi
commit
8c458b0645
50 muutettua tiedostoa jossa 1536 lisäystä ja 76 poistoa
  1. 16 0
      api/category.js
  2. 5 1
      api/index.js
  3. 24 0
      api/login.js
  4. 1 1
      api/search.js
  5. 19 7
      app.js
  6. 4 2
      app.json
  7. 14 1
      app.wxss
  8. 1 1
      miniprogram_npm/wux-weapp/toptips/index.wxss
  9. 66 0
      myComponents/dialog/dialog.js
  10. 4 0
      myComponents/dialog/dialog.json
  11. 14 0
      myComponents/dialog/dialog.wxml
  12. 95 0
      myComponents/dialog/dialog.wxss
  13. 19 2
      myComponents/myInput/myInput.js
  14. 3 1
      myComponents/myInput/myInput.wxml
  15. 54 0
      myComponents/navBar/navBar.js
  16. 4 0
      myComponents/navBar/navBar.json
  17. 28 0
      myComponents/navBar/navBar.wxml
  18. 41 0
      myComponents/navBar/navBar.wxss
  19. 83 0
      myComponents/product/product.js
  20. 6 0
      myComponents/product/product.json
  21. 41 0
      myComponents/product/product.wxml
  22. 67 0
      myComponents/product/product.wxss
  23. 59 0
      myComponents/tabBar/tabBar.js
  24. 9 0
      myComponents/tabBar/tabBar.json
  25. 15 0
      myComponents/tabBar/tabBar.wxml
  26. 2 0
      myComponents/tabBar/tabBar.wxss
  27. 18 21
      pages/index/index.js
  28. 3 1
      pages/index/index.json
  29. 2 2
      pages/index/index.wxml
  30. 3 3
      pages/index/index.wxss
  31. 203 1
      pages/login/login.js
  32. 10 1
      pages/login/login.json
  33. 30 18
      pages/login/login.wxml
  34. 19 1
      pages/login/login.wxss
  35. 1 0
      pages/logs/logs.json
  36. 10 1
      pages/mine/mine.js
  37. 7 1
      pages/mine/mine.json
  38. 44 1
      pages/mine/mine.wxml
  39. 91 1
      pages/mine/mine.wxss
  40. 137 0
      pages/register/register.js
  41. 7 0
      pages/register/register.json
  42. 27 0
      pages/register/register.wxml
  43. 15 0
      pages/register/register.wxss
  44. 111 0
      pages/riskAssessment/riskAssessment.js
  45. 7 0
      pages/riskAssessment/riskAssessment.json
  46. 17 0
      pages/riskAssessment/riskAssessment.wxml
  47. 14 0
      pages/riskAssessment/riskAssessment.wxss
  48. 47 2
      static/iconfont/iconfont.wxss
  49. BIN
      static/image/loading.gif
  50. 19 6
      utils/request.js

+ 16 - 0
api/category.js

@@ -0,0 +1,16 @@
+const request = require('../utils/request')
+
+module.exports={ 
+  //查询产品类别
+	queryCategory:(data)=>{
+		return request.post('/xiaoshi-weixinback/productCategory/queryCategory')
+  },
+  //关注产品类别
+  queryCategory:(data)=>{
+		return request.post('/xiaoshi-weixinback/productCategory/concernCategory')
+  },
+  //查询爆款产品
+  queryHotProduct:(data)=>{
+		return request.post('/xiaoshi-weixinback/product/queryHotProduct')
+	},
+ }

+ 5 - 1
api/index.js

@@ -1,5 +1,9 @@
 const search = require('./search')
+const login = require('./login')
+const category = require('./category')
 
 module.exports={ 
-	...search
+  ...search,
+  ...login,
+  ...category
 }

+ 24 - 0
api/login.js

@@ -0,0 +1,24 @@
+const request = require('../utils/request')
+
+module.exports={
+  //根据手机号登录 
+	loginByPhone:(data)=>{
+		return request.post('/xiaoshi-weixinback/account/loginByPhone',data)
+  },
+  //微信一键登录
+  loginByWeChat:(data)=>{
+		return request.post('/xiaoshi-weixinback/account/loginByWeChat',data)
+  },
+  //发送验证码
+  sendCode:(data)=>{
+		return request.post('/xiaoshi-weixinback/account/sendCode',data)
+  },
+  //获取检验码
+  verifyCode:(data)=>{
+		return request.post('/xiaoshi-weixinback/account/verifyCode',data)
+  },
+  //退出登录接口
+  logout:(data)=>{
+		return request.post('/xiaoshi-weixinback/account/logout',data)
+	},
+}

+ 1 - 1
api/search.js

@@ -2,6 +2,6 @@ const request = require('../utils/request')
 
 module.exports={ 
 	search:(data)=>{
-		return request.get('/api/admin/verifyCode')
+		return request.get('/permission/api/admin/verifyCode')
 	}
  }

+ 19 - 7
app.js

@@ -6,14 +6,26 @@ App({
     logs.unshift(Date.now())
     wx.setStorageSync('logs', logs)
 
-    // 登录
-    wx.login({
-      success: res => {
-        // 发送 res.code 到后台换取 openId, sessionKey, unionId
-      }
-    })
+    //获取顶部navBar的信息
+    const that = this;
+    // 获取系统信息
+    const systemInfo = wx.getSystemInfoSync();
+    // 胶囊按钮位置信息
+    const menuButtonInfo = wx.getMenuButtonBoundingClientRect();
+    // 导航栏高度 = 状态栏高度 + 44
+    that.globalData.navBarHeight = systemInfo.statusBarHeight + 44;
+    that.globalData.menuRight = systemInfo.screenWidth - menuButtonInfo.right;
+    that.globalData.menuTop = menuButtonInfo.top;
+    that.globalData.menuHeight = menuButtonInfo.height;
+    that.globalData.menuWidth = menuButtonInfo.width;
   },
   globalData: {
-    userInfo: null
+    userInfo: null,
+    navBarHeight: 0, // 导航栏高度
+    menuRight: 0, // 胶囊距右方间距(方保持左、右间距一致)
+    menuTop: 0, // 胶囊距顶部间距
+    menuHeight: 0, // 胶囊高度(自定义内容可与胶囊高度保证一致)
+    menuWidth:0,
+    imghttp:'http://192.168.1.7:8801/'
   }
 })

+ 4 - 2
app.json

@@ -1,11 +1,13 @@
 {
-
   "pages": [
     "pages/index/index",
     "pages/logs/logs",
     "pages/mine/mine",
-    "pages/login/login"
+    "pages/login/login",
+    "pages/riskAssessment/riskAssessment",
+    "pages/register/register"
   ],
+ 
   "tabBar": {
     "list": [
       {

+ 14 - 1
app.wxss

@@ -7,9 +7,22 @@
   flex-direction: column;
   align-items: center;
   justify-content: space-between;
-  padding: 200rpx 0;
+  padding: 200rpx 50rpx;
   box-sizing: border-box;
 } 
+.appscrollarea {
+  flex: 1;
+  overflow-y: hidden;
+  height: 100vh;
+  box-sizing: border-box;
+}
+.padding_50{
+  padding:50rpx;
+}
 page {
 	--themeColor: #316192;
 }
+
+button[type=primary]{
+  background-color: var(--themeColor);
+}

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1 - 1
miniprogram_npm/wux-weapp/toptips/index.wxss


+ 66 - 0
myComponents/dialog/dialog.js

@@ -0,0 +1,66 @@
+// myComponents/dialog/dialog.js
+Component({
+
+  options: {
+      multipleSlots: true // 在组件定义时的选项中启用多slot支持
+  },
+
+  /**
+   * 组件的属性列表
+   */
+  properties: {
+      // 弹窗标题
+      title: {            // 属性名
+          type: String,     // 类型(必填),目前接受的类型包括:String, Number, Boolean, Object, Array, null(表示任意类型)
+          value: '标题'     // 属性初始值(可选),如果未指定则会根据类型选择一个
+      },
+      // 弹窗内容
+      content: {
+          type: String,
+          value: '弹窗内容'
+      },
+      // 弹窗取消按钮文字
+      cancelText: {
+          type: String,
+          value: '取消'
+      },
+      // 弹窗确认按钮文字
+      confirmText: {
+          type: String,
+          value: '确定'
+      },
+      // 是否显示Dialog
+      isShown: {
+          type: Boolean,
+          value: false
+      }
+  },
+
+  /**
+   * 私有数据,组件的初始数据
+   * 组件的初始数据
+   */
+  data: {
+      // 弹窗显示控制
+      // isShow: false
+  },
+
+  /**
+   * 组件的方法列表
+   * 
+   */
+  methods: {  
+      /*
+      * 内部私有方法建议以下划线开头
+      * triggerEvent 用于触发事件
+      */
+      _cancelEvent() {
+          //触发取消回调
+          this.triggerEvent("cancel")
+      },
+      _confirmEvent() {
+          //触发成功回调
+          this.triggerEvent("confirm");   //confirmEvent由调用方声明和定义,在调用方 bind:confirmEvent 来声明,在js中定义函数
+      }
+  }
+})

+ 4 - 0
myComponents/dialog/dialog.json

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

+ 14 - 0
myComponents/dialog/dialog.wxml

@@ -0,0 +1,14 @@
+<!--myComponents/dialog/dialog.wxml-->
+<view class='wx_dialog_container' hidden="{{!isShown}}">
+    <view class='wx-mask'></view>
+    <view class='wx-dialog'>
+        <view class='wx-dialog-title'>{{ title }}</view>
+        <view class='wx-dialog-content'>
+          <slot></slot>
+        </view>
+        <view class='wx-dialog-footer'>
+            <view class='wx-dialog-btn' catchtap='_cancelEvent'>{{ cancelText }}</view>
+            <view class='wx-dialog-btn' catchtap='_confirmEvent'>{{ confirmText }}</view>
+        </view>
+    </view>
+</view>

+ 95 - 0
myComponents/dialog/dialog.wxss

@@ -0,0 +1,95 @@
+/* myComponents/dialog/dialog.wxss */
+
+.wx-mask {
+  position: fixed;
+  z-index: 1000;
+  top: 0;
+  right: 0;
+  left: 0;
+  bottom: 0;
+  background: rgba(0, 0, 0, 0.3);
+}
+
+.wx-dialog {
+  position: fixed;
+  z-index: 5000;
+  width: 80%;
+  max-width: 600rpx;
+  top: 50%;
+  left: 50%;
+  -webkit-transform: translate(-50%, -50%);
+  transform: translate(-50%, -50%);
+  background-color: #fff;
+  text-align: center;
+  border-radius: 3px;
+  overflow: hidden;
+}
+
+.wx-dialog-title {
+  font-size: 18px;
+  padding: 15px 15px 5px;
+}
+
+.wx-dialog-content {
+  padding: 15px 15px 5px;
+  min-height: 40px;
+  font-size: 16px;
+  line-height: 1.3;
+  word-wrap: break-word;
+  word-break: break-all;
+  color: #999;
+}
+
+.wx-dialog-footer {
+  display: flex;
+  align-items: center;
+  position: relative;
+  line-height: 45px;
+  font-size: 17px;
+}
+
+.wx-dialog-footer::before {
+  content: '';
+  position: absolute;
+  left: 0;
+  top: 0;
+  right: 0;
+  height: 1px;
+  border-top: 1px solid #d5d5d6;
+  color: #d5d5d6;
+  -webkit-transform-origin: 0 0;
+  transform-origin: 0 0;
+  -webkit-transform: scaleY(0.5);
+  transform: scaleY(0.5);
+}
+
+.wx-dialog-btn {
+  display: block;
+  -webkit-flex: 1;
+  flex: 1;
+  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
+  position: relative;
+}
+
+.wx-dialog-footer .wx-dialog-btn:nth-of-type(1) {
+  color: #353535;
+}
+
+.wx-dialog-footer .wx-dialog-btn:nth-of-type(2) {
+  color: #3cc51f;
+}
+
+.wx-dialog-footer .wx-dialog-btn:nth-of-type(2):after {
+  content: " ";
+  position: absolute;
+  left: 0;
+  top: 0;
+  width: 1px;
+  bottom: 0;
+  border-left: 1px solid #d5d5d6;
+  color: #d5d5d6;
+  -webkit-transform-origin: 0 0;
+  transform-origin: 0 0;
+  -webkit-transform: scaleX(0.5);
+  transform: scaleX(0.5);
+}

+ 19 - 2
myComponents/myInput/myInput.js

@@ -72,8 +72,16 @@ methods:{
     this.triggerEvent('search',1)
   },
   //图片上传
-  afterRead(e){
-    console.log(e)
+  beforeUpload(e){
+    console.log(e.detail)
+    if(e.detail.errMsg=="chooseMedia:ok"){
+      var data = [{
+        status: 'done',
+        url: e.detail.tempFiles[0].tempFilePath,
+      }]
+  
+      this.setData({ fileList:data })
+    }
   },
   onChange(e) {
     console.log('1', e)
@@ -92,6 +100,15 @@ methods:{
     // Controlled state should set fileList
     this.setData({ fileList })
   },
+  //预览
+  onPreview(e) {
+    console.log('onPreview', e)
+    const { file, fileList } = e.detail
+    wx.previewImage({
+      current: file.url,
+      urls: fileList.map((n) => n.url),
+    })
+  },
 },
   /**  
    * 组件的生命周期函数列表  

+ 3 - 1
myComponents/myInput/myInput.wxml

@@ -27,11 +27,13 @@
 <view wx:if="{{showEdit && show}}" class="editBox">
     <view class="upload">
       <wux-upload
+      max='1'
       listType="picture-card"
       fileList="{{ fileList }}"
       controlled
       uploaded="false"
-      bind:change="afterRead"
+      bind:before="beforeUpload"
+      bind:change="onChange"
       bind:success="onSuccess"
       bind:fail="onFail"
       bind:complete="onComplete"

+ 54 - 0
myComponents/navBar/navBar.js

@@ -0,0 +1,54 @@
+// components/navBar/navBar.js
+const app = getApp()
+Component({
+  properties: {
+    title: {
+      type: String,
+      value: '跨境电商专利小助手'
+    },
+    control: {
+        type: Boolean,
+        value: true,
+    },
+    bgcolor: {
+        type: String,
+        value: "",
+    },
+    color: {
+        type: String,
+        value: "",
+    }
+  },
+  data: {
+    opacity: 0,
+    navBarHeight: app.globalData.navBarHeight,
+    menuRight: app.globalData.menuRight,
+    menuTop: app.globalData.menuTop,
+    menuHeight: app.globalData.menuHeight,
+    menuWidth: app.globalData.menuWidth,
+  },
+  attached: function () {
+ 
+  },
+  methods: {
+    //返回
+    clickBack(){
+      var pages = getCurrentPages()
+      if (pages.length >= 2) {
+          wx.navigateBack()
+      } else {
+          wx.switchTab({
+              url: pages[0].route
+          });
+      }
+  },
+  // 胶囊--首页
+   clickHome() {
+      wx.switchTab({
+          url: "/pages/index/index"
+      });
+  }
+
+ 
+  }
+})

+ 4 - 0
myComponents/navBar/navBar.json

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

+ 28 - 0
myComponents/navBar/navBar.wxml

@@ -0,0 +1,28 @@
+<!--myComponents/navBar/navBar.wxml-->
+<!-- 自定义顶部栏 -->
+
+
+
+	<view class="uni-pages">
+         <!-- 自定义背景色,支持渐变色 -->
+		<view class="navigation" style="background:{{bgcolor}}">
+             <!-- 自适应不同的手机机型,导航顶部留白部分 -->
+			<view class="nav--bar-top" style="height:{{menuTop}}px"></view>
+			<view class="nav-bar-inner">
+                 <!-- 导航左边部分,是否显示操作胶囊 -->
+				<view class="image-box" wx:if="{{control}}"	style=" height:{{menuHeight}}px;width:{{menuWidth - 20}}px">
+          <view class="image iconfont myIconfanhui" style="font-size: 55rpx;" bind:tap="clickBack"></view>
+					<view class="line"></view>
+          <view class="image iconfont myIconzhuye1" bind:tap="clickHome"></view>
+				</view>
+				<view class="base-box" 
+                     style="height:{{menuHeight}}px;width:{{menuWidth}}px" wx:else></view>
+                <!-- 中间文字部分,可设置字体颜色 -->
+				<view class="title" style="color:{{color}}">{{title}}</view>
+                <!-- 右边部分,占据小程序系统胶囊位置 -->
+				<view class="base-box" style="height:{{menuHeight}}px;width:{{menuWidth}}px"></view>
+			</view>
+            <!-- 设置胶囊离内容距离 -->
+			<view class="nav-bar-buttom" style="height: 8px;"></view>
+		</view>
+	</view>

+ 41 - 0
myComponents/navBar/navBar.wxss

@@ -0,0 +1,41 @@
+/* myComponents/navBar/navBar.wxss */
+@import "/static/iconfont/iconfont.wxss";
+.uni-pages{
+  background-color: #ffffff;
+}
+.nav-bar-inner {
+  height: 32px;
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  padding: 0 8px;
+ 
+}
+.image-box {
+  display: flex;
+  justify-content: space-around;
+  align-items: center;
+  border: 1px solid #efefef;
+  border-radius: 16px;
+  background-color: rgba(#fff, 0.6);
+}
+.line {
+  width: 1px;
+  height: 26px;
+  background-color: rgba(#fff, 0.3);
+}
+.image {
+  width: 22px;
+  height: 22px;
+}
+.title {
+  color: #000;
+  font-weight: 500;
+  font-size: 28rpx;
+  white-space: nowrap; /* 防止文本换行 */  
+  overflow: hidden; /* 隐藏超出容器的文本 */  
+  text-overflow: ellipsis; /* 显示省略号来表示文本被截断 */ 
+}
+.nav-bar-buttom {
+  height: 10rpx;
+}

+ 83 - 0
myComponents/product/product.js

@@ -0,0 +1,83 @@
+// myComponents/product/product.js
+const app = getApp()
+Component({
+
+  /**
+   * 组件的属性列表
+   */
+  properties: {
+    tableData:{
+      type:Array,
+      value:[],
+      observers:function(val){
+        console.log(val)
+      }
+    }
+  },
+
+  /**
+   * 组件的初始数据
+   */
+  data: {
+    imgHttp:app.globalData.imgHttp
+  },
+
+  /**
+   * 组件的方法列表
+   */
+  methods: {
+    //查看图片
+    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,
+      })
+    },
+    //打开关注类型
+    open(e){
+      var index = e.currentTarget.dataset.index
+      this.setData({
+        ['tableData['+ index + '].show'] : true
+      })
+    },
+    //关闭关注类型
+    cancel(e){
+      var index = e.currentTarget.dataset.index
+      this.setData({
+        ['tableData['+ index + '].show'] : false
+      })
+    },
+    //关注
+    attention(e){
+      var {type,index} = e.currentTarget.dataset
+    },
+    //监控
+    control(e){
+      var index = e.currentTarget.dataset.index
+    }
+  },
+   /**  
+   * 组件的生命周期函数列表  
+   */  
+  lifetimes: {  
+    // 在组件实例进入页面节点树时执行  
+    attached: function () {  
+      // 初始化操作  
+      console.log(this.properties.tableData);  
+      // ...  
+    },  
+    // 在组件实例被移除出页面节点树时执行  
+    detached: function () {  
+      // 清理工作  
+      console.log('组件销毁');  
+      // ...  
+    },  
+    // ...  
+  },  
+})

+ 6 - 0
myComponents/product/product.json

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

+ 41 - 0
myComponents/product/product.wxml

@@ -0,0 +1,41 @@
+<!--myComponents/product/product.wxml-->
+<view class="product_content">
+  <view class="product_item" wx:for="{{tableData}}" wx:for-index="index" wx:key="index">
+    <swiper class="swiper" autoplay="{{true}}" interval="{{3000}}"  duration="{{500}}" indicator-dots="{{false}}">  
+      <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 class="flex">
+      <view>
+        {{index + 1}}.{{item.name}}
+      </view>
+      <view class="icon">
+        <view class="iconfont myIconmonitor" data-index="{{index}}" bind:tap="control"></view>
+        <view class="iconfont myIconguanzhu" data-index="{{index}}" bind:tap="open"></view>
+      </view>
+    </view>
+    <view class="product_operate" wx-if="{{item.show}}">
+      <view class="cancel" data-index="{{index}}" bind:tap="cancel">×</view>
+      <view class="grids"  bordered="{{ false }}">
+        <view class="grid" data-type="1" data-index="{{index}}" bind:tap="attention">
+          <view class="iconfont myIconanquanbangzhu operate_icon"></view>
+          <view class="operate_text">白名单</view>
+        </view>
+        <view class="line"></view>
+        <view class="grid" data-type="1" data-index="{{index}}" bind:tap="attention">
+          <view class="iconfont myIcongroup43 operate_icon"></view>
+          <view class="operate_text">灰名单</view>
+        </view>
+        <view class="line"></view>
+        <view class="grid" data-type="1" data-index="{{index}}" bind:tap="attention">
+          <view class="iconfont myIconicon-test operate_icon"></view>
+          <view class="operate_text">黑名单</view>
+        </view>
+      </view>
+    </view>
+    
+  </view>
+</view>

+ 67 - 0
myComponents/product/product.wxss

@@ -0,0 +1,67 @@
+/* myComponents/product/product.wxss */
+@import "/static/iconfont/iconfont.wxss";
+.swiper{
+  height: 200rpx;
+}
+.slide-image {  
+  width: 100%;  
+  height: 180rpx;  
+}
+
+.flex{
+  width: 100%;  
+  display: flex;
+  justify-content: space-between;
+}
+.icon{ 
+  display: flex;
+}
+.product_content{
+  display: flex;
+  flex-wrap: wrap;
+}
+.product_item{
+  width: 45%;
+  margin: 10rpx 2.5%;
+  position: relative;
+}
+.product_operate{
+  background-color: rgb(230 230 230);
+  width: 100%;
+  height: 200rpx;
+  position: absolute;
+  top: 0;
+  left: 0;
+}
+.cancel{
+  height: auto;
+  position: absolute;
+  right: 10rpx;
+  top: 5rpx;
+}
+.grids{
+  background-color: rgb(230 230 230);
+  height:180rpx;
+  display: flex;
+  justify-content: space-around;
+  align-items: center;
+}
+.grid{
+  /* height: 100%; */
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+}
+
+.line{
+  width: 1px !important;
+  height: 70rpx;
+  background-color: rgb(113 109 133);
+  float: right;
+}
+.operate_text{
+  font-size: 20rpx;
+}
+.operate_icon{
+  margin-bottom: 10rpx;
+}

+ 59 - 0
myComponents/tabBar/tabBar.js

@@ -0,0 +1,59 @@
+// myComponents/tabBar/tabBar.js
+Component({
+
+  /**
+   * 组件的属性列表
+   */
+  properties: {
+    page:{
+      type:String,
+      value:'/pages/index/index',
+      observers:function(val){
+        this.changeTab(val)
+      }
+    }
+  },
+
+  /**
+   * 组件的初始数据
+   */
+  data: {
+    current:'/pages/index/inde'
+  },
+ /**  
+   * 组件的生命周期函数列表  
+   */  
+  lifetimes: {  
+    // 在组件实例进入页面节点树时执行  
+    attached: function () {  
+      // 初始化操作  
+      // console.log('组件初始化');  
+      this.changeTab(this.properties.page)
+      // ...  
+    },  
+    // 在组件实例被移除出页面节点树时执行  
+    detached: function () {  
+      // 清理工作  
+      // console.log('组件销毁');  
+      // ...  
+    },  
+    // ...  
+  },  
+  /**
+   * 组件的方法列表
+   */
+  methods: {
+    changeTab(key){
+      this.setData({
+        current:key,
+      })
+    },
+    onChange(e) {
+      console.log('onChange', e)
+      this.changeTab(e.detail.key)
+      wx.switchTab({
+        url: e.detail.key
+      })
+    }
+  }
+})

+ 9 - 0
myComponents/tabBar/tabBar.json

@@ -0,0 +1,9 @@
+{
+  "component": true,
+  "usingComponents": {
+    "wux-icon": "/miniprogram_npm/wux-weapp/icon",
+    "wux-badge": "/miniprogram_npm/wux-weapp/badge",
+    "wux-tabbar": "/miniprogram_npm/wux-weapp/tabbar",
+    "wux-tabbar-item": "/miniprogram_npm/wux-weapp/tabbar-item"
+  }
+}

+ 15 - 0
myComponents/tabBar/tabBar.wxml

@@ -0,0 +1,15 @@
+<!--myComponents/tabBar/tabBar.wxml-->
+<wux-tabbar defaultCurrent="{{current}}" position="bottom" bind:change="onChange">
+      <wux-tabbar-item key="/pages/index/index" title="主页">
+        <view class="iconfont myIconzhuye" slot="icon-on"></view>
+        <view class="iconfont myIconzhuye" slot="icon-off"></view>
+      </wux-tabbar-item>
+      <wux-tabbar-item key="/pages/logs/logs" title="爆品专利数据库">
+        <view class="iconfont myIcondajiaduzaimai" slot="icon-on"></view>
+        <view class="iconfont myIcondajiaduzaimai" slot="icon-off"></view>
+      </wux-tabbar-item>
+      <wux-tabbar-item key="/pages/mine/mine" title="我的">
+        <view class="iconfont myIconwode" slot="icon-on"></view>
+        <view class="iconfont myIconwode" slot="icon-off"></view>
+      </wux-tabbar-item>
+    </wux-tabbar>

+ 2 - 0
myComponents/tabBar/tabBar.wxss

@@ -0,0 +1,2 @@
+/* myComponents/tabBar/tabBar.wxss */
+@import "/static/iconfont/iconfont.wxss";

+ 18 - 21
pages/index/index.js

@@ -1,4 +1,4 @@
-const api = require("../../api/index")
+const api = require("../../api/index.js")
 
 // index.js
 const defaultAvatarUrl = 'https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0'
@@ -18,22 +18,22 @@ Page({
       {
         type:'1',
         label:'我要查风险',
-        color:'blue'
+        color:'#4095e5'
       },
       {
         type:'2',
         label:'我要申诉',
-        color:'rgb(252 202 0)'
+        color:'#fcca00'
       },
       {
         type:'3',
         label:'我要维权',
-        color:'red'
+        color:'#bd3124'
       },
       {
         type:'4',
         label:'我要申请',
-        color:'#7232dd'
+        color:'#000a7b'
       }
     ]
   },
@@ -46,9 +46,13 @@ Page({
    
   },
   onLoad(){
-   api.search().then(res=>{
-     console.log(res)
-   })
+    // wx.navigateTo({
+    //   url: '/pages/login/login',
+    // })
+  //  api.search().then(res=>{
+  //    console.log(res)
+  //  })
+   
   },
   
   //修改输入的关键词
@@ -77,6 +81,11 @@ Page({
     console.log(e)
     var type = e.currentTarget.dataset.type
     console.log(type)
+    if(type == 1){
+      wx.navigateTo({
+        url:'/pages/riskAssessment/riskAssessment'
+      })
+    }
   },
   onChooseAvatar(e) {
     const { avatarUrl } = e.detail
@@ -94,17 +103,5 @@ Page({
       hasUserInfo: nickName && avatarUrl && avatarUrl !== defaultAvatarUrl,
     })
   },
-  getUserProfile(e) {
-    // 推荐使用wx.getUserProfile获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认,开发者妥善保管用户快速填写的头像昵称,避免重复弹窗
-    wx.getUserProfile({
-      desc: '展示用户信息', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
-      success: (res) => {
-        console.log(res)
-        this.setData({
-          userInfo: res.userInfo,
-          hasUserInfo: true
-        })
-      }
-    })
-  },
+  
 })

+ 3 - 1
pages/index/index.json

@@ -1,5 +1,7 @@
 {
+  "navigationBarTitleText":"",
   "usingComponents":{
-    "form-item":"/myComponents/formItem/formItem"
+    "form-item":"/myComponents/formItem/formItem",
+    "tabBar":"/myComponents/tabBar/tabBar"
   }
 }

+ 2 - 2
pages/index/index.wxml

@@ -6,7 +6,7 @@
         <image class="img" src="/static/image/logo-3.png" mode=""/>
       </view>
       <view class="title">
-        专利一站式解决系统
+        跨境电商专利小助手
       </view>
       <myInput value="{{keyword}}" placeholder="请输入产品相关关键词" bindchange="changeKeyword" bindsearch="search" bindclickInnerIcon="clickInnerIcon"></myInput>
     </view>
@@ -16,5 +16,5 @@
       </block>
     </view>
   </view>
-  
+ 
 </scroll-view>

+ 3 - 3
pages/index/index.wxss

@@ -19,7 +19,7 @@ page {
 }
 .title{
   text-align: center;
-  margin: 10rpx 0;
+  margin: 20rpx 0;
 }
 .btns{
   display: flex;
@@ -28,9 +28,9 @@ page {
   margin-top: 20rpx;
 }
 .btn{
-  width: 250rpx;
+  width: 350rpx;
   height: 50rpx;
-  margin: 20rpx 0 ;
+  margin: 30rpx 0 ;
 }
 .result_content{
   height: 50rpx;

+ 203 - 1
pages/login/login.js

@@ -1,11 +1,23 @@
 // pages/login/login.js
+import { $wuxCountDown, $wuxForm,$wuxToptips} from '../../miniprogram_npm/wux-weapp/index'
+const api = require('../../api/index')
 Page({
 
   /**
    * 页面的初始数据
    */
   data: {
-
+    layout: 'horizontal',
+    validateMessages: {
+        required: '%s 字段为必填',
+    },
+    loginMessage:{
+      phone:'',
+      code:'',
+      checkCode:''
+    },
+    showDialog:false,
+    imgURL:null,
   },
 
   /**
@@ -29,6 +41,196 @@ Page({
 
   },
 
+
+  /**
+   * 页面方法集合
+   */
+  //表单栏位值发生变化时
+  onValuesChange(e) {
+    console.log(e)
+    const { changedValues, allValues } = e.detail
+    // this.setValues(changedValues)
+    Object.keys(changedValues).forEach((field) => {
+      this.setData({
+          ['loginMessage.'+field]: changedValues[field],
+      })
+    })
+    console.log('onValuesChange \n', changedValues, allValues)
+  },
+  //获取手机号并打开弹窗
+  onSendCode(){
+    var value = this.data.loginMessage.phone
+    if(!value){
+      $wuxToptips().error({
+        hidden: false,
+        text: '请输入手机号',
+        duration: 3000,
+        success() {},
+      })
+      return
+    }
+    const isTel = (value) => /^1[34578]\d{9}$/.test(value)
+    if(!isTel(value)){
+      $wuxToptips().error({
+        hidden: false,
+        text: '手机号格式不正确',
+        duration: 3000,
+        success() {},
+      })
+      return 
+    }
+    this.changeVerifyCode()
+  },
+  //获取输入的校验码
+  changeInput(e) {
+    this.setData({
+      ['loginMessage.checkCode']: e.detail.value,
+    })
+  },
+  //关闭弹窗
+  closeDialog(){
+    this.setData(
+      {
+        showDialog:false
+      }
+    )
+  },
+  //获取验证码
+  getCheckCode(){
+    if (this.c2 && this.c2.interval) return !1
+    var data = {
+      phoneNum:this.data.loginMessage.phone,
+      checkCode:this.data.loginMessage.checkCode
+    }
+    api.sendCode(data).then(res=>{
+      if(res.code == 200){
+        this.CountDown()
+        this.closeDialog()
+      }
+    }).catch(error=>{
+        console.log(error)
+      // $wuxToptips().error({
+      //   hidden: false,
+      //   text: '获取验证码失败',
+      //   duration: 3000,
+      //   success() {},
+      // })
+    })
+  },
+  //获取校验码
+  changeVerifyCode(){
+    var data = {
+      phoneNum:this.data.loginMessage.phone
+    }
+    api.verifyCode(data).then(res=>{
+      if(res.code == 200){
+        console.log(res)
+        this.setData(
+          {
+            imgURL:res.data.captcha,
+            showDialog:true
+          }
+        )
+      }
+    }).catch(error=>{
+
+    })
+  },
+  //倒计时
+  CountDown(phoneCode='1234'){
+    this.c2 = new $wuxCountDown({
+      date: +new Date() + 60000,
+      onEnd() {
+        this.setData({
+          c2: '重新获取验证码',
+        })
+      },
+      render(date) {
+        const sec = this.leadingZeros(date.sec, 2) + ' 秒 '
+        date.sec !== 0 &&
+          this.setData({
+            c2: sec,
+          })
+      },
+    })
+  },
+  //手机号校验
+  checkPhone(rule, value){
+    if(!value){
+      return Promise.reject(new Error('手机号不能为空!'))
+    }
+    const isTel = (value) => /^1[34578]\d{9}$/.test(value)
+    if(!isTel(value)){
+      return Promise.reject(new Error('手机号输入错误!'))
+    }
+    return Promise.resolve()
+  },
+  //验证码校验
+  checkCode(rule, value){
+    if(!value){
+      return Promise.reject(new Error('验证码不能为空!'))
+    }
+    return Promise.resolve()
+  },
+  //登录
+  onSubmit(){
+    console.log(this.data.loginMessage)
+    const { validateFields } = $wuxForm()
+
+    validateFields((err, values) => {
+        if (!err) {
+            var data = {
+              phoneNum:this.data.loginMessage.phone,
+              phoneCode:this.data.loginMessage.code
+            }
+            api.loginByPhone(data).then(res=>{
+              console.log(res)
+              if(res.code == 200){
+                this.isLogin(res.data)
+              }
+            }).catch(error=>{
+
+            })
+        }
+    })
+  },
+  //登录后操作
+  isLogin({token,id,isFirst,phone}){
+    wx.navigateBack()
+    wx.setStorageSync('token',token)
+  },
+  //跳转到注册界面
+  register(){
+    wx.navigateTo({
+      url: '/pages/register/register',
+    })
+  },
+  //微信一键登录
+  fastLogin(e){
+      if (e.detail.errMsg === 'getPhoneNumber:ok') {  
+        // 用户同意授权,获取加密信息  
+        const encryptedData = e.detail.encryptedData;  
+        const iv = e.detail.iv;  
+        const code = e.detail.code
+        // 将 encryptedData 和 iv 发送到后端服务器 
+        var data= {  
+          encryptedData: encryptedData,  
+          iv: iv,
+          code:code
+        }
+        api.loginByWeChat(data).then(res=>{
+          if(res.code == 200){
+            this.isLogin(res.data)
+          }
+        }).catch(error=>{
+
+        })
+         
+      } else if (e.detail.errMsg === 'getPhoneNumber:fail') {  
+        // 用户拒绝授权  
+        console.log('获取手机号失败');  
+      }  
+  },
   /**
    * 生命周期函数--监听页面隐藏
    */

+ 10 - 1
pages/login/login.json

@@ -1,3 +1,12 @@
 {
-  "usingComponents": {}
+  "navigationStyle": "custom",
+  "usingComponents": {
+    "wux-form": "/miniprogram_npm/wux-weapp/form",
+    "wux-field":"/miniprogram_npm/wux-weapp/field/index",
+    "wux-input":"/miniprogram_npm/wux-weapp/input/index",
+    "navBar": "/myComponents/navBar/navBar",
+    "wux-toptips": "/miniprogram_npm/wux-weapp/toptips/index",
+    "wux-dialog": "/miniprogram_npm/wux-weapp/dialog/index",
+    "myDialog":"/myComponents/dialog/dialog"
+  }
 }

+ 30 - 18
pages/login/login.wxml

@@ -1,26 +1,38 @@
 <!--pages/login/login.wxml-->
-<view>
-	<view>
+<navBar backType="editLaw"></navBar>
+<wux-toptips id="wux-toptips" />
+<myDialog isShown="{{showDialog}}" title="检验码" bindcancel="closeDialog" bindconfirm="getCheckCode">
+  <view>
+    <wux-input bind:change="changeInput" placeholder="请输入校验码">
+      <view slot="footer" style="margin-left: 5px;">
+        <image src="{{imgURL}}" style="height: 70rpx;width: 180rpx;" bind:tap="changeVerifyCode" mode=""/>
+      </view>
+    </wux-input>
+  </view>
+</myDialog>
+<view class="container">
+	<view class="logo">
 		<image class="img" src="/static/image/logo-3.png" mode=""/>
 	</view>
 
 	<view>
-		<form catchsubmit="formSubmit" catchreset="formReset">
-      <view class="page-section">
-        <view class="page-section-title">input</view>
-        <view class="weui-cells weui-cells_after-title">
-          <view class="weui-cell weui-cell_input">
-            <view class="weui-cell__bd" style="margin: 30rpx 0" >
-              <input class="weui-input" name="input" placeholder="这是一个输入框" />
-            </view>
-          </view>
-        </view>
-      </view>
-
-      <view class="btn-area">
-        <button style="margin: 30rpx 0" type="primary" formType="submit">Submit</button>
-        <button style="margin: 30rpx 0" formType="reset">Reset</button>
+    <wux-form
+      id="wux-form"
+      layout="{{ layout }}"
+      validateMessages="{{ validateMessages }}"
+      bind:change="onValuesChange"
+    >
+      <wux-field name="phone" label="手机号" initialValue="{{''}}" rules="{{ [{ required: true },{validator:'checkPhone'} ] }}">
+        <wux-input maxlength="11" placeholder="请输入手机号" />
+      </wux-field>
+      <wux-field name="code" label="验证码" rules="{{ [{ required: true, message: '请输入验证码' }] }}">
+        <wux-input placeholder="请输入验证码" />
+        <view slot="extra" style="color: #387ef5; padding-left: 12px;" bind:tap="onSendCode">{{ c2 || '发送验证码'}}</view>
+      </wux-field>
+      <view slot="footer" class="btn-area btn-area_auto">
+        <button type="primary" bindtap="onSubmit">登录 / 注册</button>
+        <button type="primary" open-type="getPhoneNumber" bindgetphonenumber="fastLogin" style="margin-top:20rpx">微信一键登录</button>
       </view>
-    </form>
+    </wux-form>
 	</view>
 </view>

+ 19 - 1
pages/login/login.wxss

@@ -1 +1,19 @@
-/* pages/login/login.wxss */
+/* pages/login/login.wxss */
+.logo{
+  width: 200rpx;
+  height: 100rpx;
+  /* margin: auto; */
+  margin-bottom: 50rpx;
+}
+.img{
+  width: 200rpx;
+  height: 100rpx;
+  margin: auto;
+}
+.foot_btn{
+  margin-top: 20rpx;
+  font-size: 30rpx;
+  color: rgba(64,149,229,1);
+  display: flex;
+  justify-content: space-between;
+}

+ 1 - 0
pages/logs/logs.json

@@ -1,4 +1,5 @@
 {
   "usingComponents": {
+    
   }
 }

+ 10 - 1
pages/mine/mine.js

@@ -5,7 +5,16 @@ Page({
    * 页面的初始数据
    */
   data: {
-
+    menu1:[
+      {
+        label:'关注微信公众号',
+        type:'1'
+      },
+      {
+        label:'帮助与反馈',
+        type:'2'
+      },
+    ]
   },
 
   /**

+ 7 - 1
pages/mine/mine.json

@@ -1,3 +1,9 @@
 {
-  "usingComponents": {}
+  "usingComponents": {
+    "wux-divider": "/miniprogram_npm/wux-weapp/divider/index",
+    "wux-avatar":"/miniprogram_npm/wux-weapp/avatar/index",
+    "van-cell": "/miniprogram_npm/@vant/weapp/cell/index",
+    "van-cell-group": "/miniprogram_npm/@vant/weapp/cell-group/index",
+    "van-icon":"/miniprogram_npm/@vant/weapp/icon/index"
+  }
 }

+ 44 - 1
pages/mine/mine.wxml

@@ -1,2 +1,45 @@
 <!--pages/mine/mine.wxml-->
-<text>pages/mine/mine.wxml</text>
+<view class="mine">
+  <view class="head flex">
+    <view class="flex">
+      <wux-avatar size="large" src="/static/image/logo-3.png"></wux-avatar>
+      <view class="message">
+        <view class="name">小世科技有限公司</view>
+        <view class="type"> <text class="iconfont myIconrenyuan icon"></text> 普通会员</view>
+      </view>
+    </view>
+    <view class="right">
+      <text class="VIP">VIP</text>
+      <text class="VIP_name">会员中心</text>
+    </view>
+  </view>
+  <wux-divider wux-class="line" show-text="{{ false }}" />
+  <view class="menu_icon">
+    <view class="menu_icon_item">
+      <view class="iconfont myIconguanzhu menu_icon_size"></view>
+      <view>我的关注</view>
+    </view>
+    <view class="menu_icon_item">
+      <view class="iconfont myIconguanzhu menu_icon_size"></view>
+      <view>检索记录</view>
+    </view>
+    <view class="menu_icon_item">
+      <view class="iconfont myIconguanzhu menu_icon_size"></view>
+      <view>工单记录</view>
+    </view>
+    <view class="menu_icon_item">
+      <view class="iconfont myIconmonitor menu_icon_size"></view>
+      <view>监控</view>
+    </view>
+  </view>
+  <wux-divider wux-class="line" show-text="{{ false }}" />
+  <view class="menu_list">
+      <!-- <view class="menu_list_item" wx:for="{{menu1}}">
+        <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 bind:click="">
+        <van-icon slot="right-icon" name="arrow" color="green" />
+      </van-cell>
+  </view>
+</view>

+ 91 - 1
pages/mine/mine.wxss

@@ -1 +1,91 @@
-/* pages/mine/mine.wxss */
+/* pages/mine/mine.wxss */
+.mine{
+  padding: 0 20rpx;
+}
+.flex{
+  display: flex;
+  align-items: center;
+}
+.head{
+  margin-top: 15rpx;
+  justify-content: space-between;
+}
+.message{
+  margin-left: 15rpx;
+}
+.name{
+  font-size: 35rpx;
+  font-weight: bolder;
+}
+.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;
+}
+.right{
+  background-color: rgb(63 57 92);
+  border-radius: 15rpx;
+  padding: 15rpx;
+  font-size: 35rpx;
+}
+.VIP{
+  background-color: rgb(255 246 0);
+  color: rgb(63 57 92);
+  padding: 5rpx;
+  border-radius: 10rpx;
+  font-weight: bolder;
+}
+.VIP_name{
+  color: rgb(255 246 0);
+  font-weight: bolder;
+  margin-left: 10rpx;
+}
+
+.menu_icon{
+  padding: 0 20rpx;
+  display: flex;
+  justify-content: space-between;
+  color: var(--themeColor);
+}
+.menu_icon_item{
+  font-weight: bold;
+  display: flex;
+  align-items: center;
+  flex-direction: column;
+}
+.menu_icon_item:active{
+  background-color: #f2f3f5;
+}
+.menu_icon_size{
+  font-weight: normal;
+  font-size: 100rpx;
+  color: var(--themeColor);
+}
+.menu_list_item{
+  color: var(--themeColor);
+  font-weight: bolder;
+  display: flex;
+  justify-content: space-between;
+  padding: 30rpx 15rpx;
+  border-bottom: 1px solid var(--themeColor);
+}
+
+.line{
+  border-top: 2rpx solid var(--themeColor) !important;
+}
+.vanCell{
+  padding:30rpx 15rpx !important;
+  color: var(--themeColor) !important;
+  border-bottom: 1px solid var(--themeColor);
+}

+ 137 - 0
pages/register/register.js

@@ -0,0 +1,137 @@
+// pages/register/register.js
+import { $wuxCountDown, $wuxForm } from '../../miniprogram_npm/wux-weapp/index'
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    layout: 'horizontal',
+    validateMessages: {
+        required: '%s 字段为必填',
+    },
+    registerMessage:{
+      phone:'',
+    }
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+
+  },
+
+
+  /**
+   * 页面方法集合
+   */
+  //表单栏位值发生变化时
+  onValuesChange(e) {
+    console.log(e)
+    const { changedValues, allValues } = e.detail
+    // this.setValues(changedValues)
+    Object.keys(changedValues).forEach((field) => {
+      this.setData({
+          ['loginMessage['+field+']']: changedValues[field],
+      })
+    })
+    console.log('onValuesChange \n', changedValues, allValues)
+  },
+  //发送验证码
+  onSendCode(){
+    if (this.c2 && this.c2.interval) return !1
+    this.c2 = new $wuxCountDown({
+      date: +new Date() + 60000,
+      onEnd() {
+        this.setData({
+          c2: '重新获取验证码',
+        })
+      },
+      render(date) {
+        const sec = this.leadingZeros(date.sec, 2) + ' 秒 '
+        date.sec !== 0 &&
+          this.setData({
+            c2: sec,
+          })
+      },
+    })
+    wx.showModal({
+      content: `【WuxUI】验证码:123456,有效期5分钟,请勿泄露。`,
+      showCancel: !1,
+    })
+  },
+  //手机号校验
+  checkPhone(rule, value){
+    if(!value){
+      return Promise.reject(new Error('手机号不能为空!'))
+    }
+    const isTel = (value) => /^1[34578]\d{9}$/.test(value)
+    if(!isTel(value)){
+      return Promise.reject(new Error('手机号输入错误!'))
+    }
+  },
+  //注册
+  onSubmit(){
+    const { validateFields } = $wuxForm()
+    validateFields((err, values) => {
+        if (!err) {
+            wx.showModal({
+                content: JSON.stringify(values, null, 2),
+                showCancel: !1,
+            })
+            console.log('Received values of form: ', values);
+        }
+    })
+  },
+
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+
+  }
+})

+ 7 - 0
pages/register/register.json

@@ -0,0 +1,7 @@
+{
+  "usingComponents": {
+    "wux-form": "/miniprogram_npm/wux-weapp/form",
+    "wux-field":"/miniprogram_npm/wux-weapp/field/index",
+    "wux-input":"/miniprogram_npm/wux-weapp/input/index"
+  }
+}

+ 27 - 0
pages/register/register.wxml

@@ -0,0 +1,27 @@
+<!--pages/register/register.wxml-->
+<view class="container">
+  <view class="title">注册</view>
+  <wux-form
+    id="wux-form"
+    layout="{{ layout }}"
+    validateMessages="{{ validateMessages }}"
+    bind:change="onValuesChange"
+  >
+    <wux-field name="phone" label="手机号" initialValue="{{''}}" rules="{{ [{ required: true,message:'' },{ validator: 'checkPhone' } ] }}">
+      <wux-input maxlength="11" placeholder="请输入手机号" />
+    </wux-field>
+    <wux-field name="code" label="验证码" rules="{{ [{ required: true, message: '验证码不能为空' }] }}">
+        <wux-input placeholder="请输入验证码" />
+        <view slot="extra" style="color: #387ef5; padding-left: 12px;" bind:tap="onSendCode">{{ c2 || '发送验证码'}}</view>
+    </wux-field>
+    <wux-field name="name" label="用户名">
+        <wux-input placeholder="请输入用户名" />
+    </wux-field>
+    <wux-field name="email" label="邮箱" rules="{{ [{ required: false },{type:'email',message:'邮箱格式错误'}] }}">
+        <wux-input placeholder="请输入邮箱" />
+    </wux-field>
+    <view slot="footer" class="btn-area btn-area_auto">
+        <button type="primary" bindtap="onSubmit">注册</button>
+      </view>
+  </wux-form>
+</view>

+ 15 - 0
pages/register/register.wxss

@@ -0,0 +1,15 @@
+/* pages/register/register.wxss */
+.title{
+  width: 95%;
+  height: 46px;
+  text-align: center;
+  color: #ffffff;
+  line-height: 46px;
+  margin-bottom: 20rpx;
+  /* padding: 20rpx 0; */
+  font-size: 50rpx;
+  font-weight: bolder;
+  border: 1rpx solid var(--themeColor);
+  border-radius: 15rpx;
+  background-color: var(--themeColor);
+}

+ 111 - 0
pages/riskAssessment/riskAssessment.js

@@ -0,0 +1,111 @@
+// pages/riskAssessment/riskAssessment.js
+const api = require('../../api/index')
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    tableData:[],
+    keyword:''
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+    this.getProductList()
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+    
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+
+  },
+
+  /**
+   * 页面功能实现的区域
+   */
+  //获取爆款产品
+  getProductList(){
+    console.log(1)
+    var data = [
+      {
+        label:'产品1',
+        imgUrls:[
+          "/static/image/logo-3.png",
+          "/static/image/主页.png"
+        ]
+      },
+      {
+        label:'产品2',
+        imgUrls:[
+          "/static/image/logo-3.png",
+        ]
+      },
+      {
+        label:'产品2',
+        imgUrls:[
+          "/static/image/logo-3.png",
+        ]
+      },
+    ]
+    var params = {
+      current:1,
+      size:6
+    }
+    api.queryHotProduct(params).then(res=>{
+      if(res.code == 200){
+        this.setData(
+          {
+            tableData:res.data.data
+          }
+        )
+      }
+    })
+    
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+
+  }
+})

+ 7 - 0
pages/riskAssessment/riskAssessment.json

@@ -0,0 +1,7 @@
+{
+  "navigationStyle": "custom",
+  "usingComponents": {
+    "navBar": "/myComponents/navBar/navBar",
+    "myProduct":"/myComponents/product/product"
+  }
+}

+ 17 - 0
pages/riskAssessment/riskAssessment.wxml

@@ -0,0 +1,17 @@
+<!--pages/riskAssessment/riskAssessment.wxml-->
+<navBar backType="editLaw"></navBar>
+<scroll-view class="appscrollarea" scroll-y >
+<view class="padding_50 content">
+  <view class="head">
+    <view class="img">
+      <image class="img" src="/static/image/logo-3.png" mode=""/>
+    </view>
+  </view>
+  <view class="search">
+    <myInput value="{{keyword}}" placeholder="请输入产品相关关键词" bindchange="changeKeyword" bindsearch="search" bindclickInnerIcon="clickInnerIcon"></myInput>
+  </view>
+  <view class="main">
+    <myProduct tableData="{{tableData}}"></myProduct>
+  </view>
+</view>
+</scroll-view>

+ 14 - 0
pages/riskAssessment/riskAssessment.wxss

@@ -0,0 +1,14 @@
+/* pages/riskAssessment/riskAssessment.wxss */
+.content{
+  padding: 0 20rpx;
+  margin-top: 50rpx;
+}
+.head{
+  margin-bottom: 20rpx;
+}
+.img{
+  width: 200rpx;
+  height: 100rpx;
+  margin: auto;
+}
+

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 47 - 2
static/iconfont/iconfont.wxss


BIN
static/image/loading.gif


+ 19 - 6
utils/request.js

@@ -1,9 +1,9 @@
 // request.js  
-  
+import {$wuxToptips} from '../miniprogram_npm/wux-weapp/index'
 // 配置项  
 const config = {  
-  baseURL: 'http://139.224.24.90:8880', // 基础URL  
-  timeout: 10000, // 超时时间(单位ms)  
+  baseURL: 'http://192.168.1.17:8901', // 基础URL  
+  timeout: 30000, // 超时时间(单位ms)  
   header: {  
     'content-type': 'application/json', // 默认请求头  
     // 其他全局请求头...  
@@ -23,16 +23,29 @@ function request(url, method = 'GET', data = {}, header = {}) {
         ...header,  
       },  
       timeout: config.timeout,  
-      success: (res) => {  
+      success: function(res){  
         // 根据业务逻辑处理成功响应  
         if (res.data && res.data.code === 200) { // 假设服务器返回code为200表示成功  
           resolve(res.data);  
         } else {  
+          wx.showToast({
+            title: '请求失败',
+            icon: 'error',
+            duration: 2000
+          })
+      
           reject(res.data.message || '未知错误');  
         }  
       },  
-      fail: (error) => {  
-        // 处理请求失败  
+      fail: function(error) { 
+        console.log(error) 
+        
+        // 处理请求失败 
+        wx.showToast({
+          title: '请求失败',
+          icon: 'error',
+          duration: 2000
+        })
         reject(error);  
       },  
     });