Handy_Cao 3 år sedan
förälder
incheckning
4b38e81d7d
27 ändrade filer med 686 tillägg och 230 borttagningar
  1. BIN
      GuangZuan/miniprogram/images/login_logo.png
  2. 9 5
      GuangZuan/miniprogram/mHome/pages/bond/list/index.ts
  3. 4 4
      GuangZuan/miniprogram/mHome/pages/bond/list/index.wxml
  4. 4 4
      GuangZuan/miniprogram/mHome/pages/bond/payment/index.ts
  5. 4 4
      GuangZuan/miniprogram/mHome/pages/bond/prepayment/index.ts
  6. 4 1
      GuangZuan/miniprogram/mHome/pages/calculator/index.json
  7. 33 10
      GuangZuan/miniprogram/mHome/pages/calculator/index.less
  8. 52 30
      GuangZuan/miniprogram/mHome/pages/calculator/index.ts
  9. 16 8
      GuangZuan/miniprogram/mHome/pages/calculator/index.wxml
  10. 8 4
      GuangZuan/miniprogram/mHome/pages/inspection/list/index.ts
  11. 5 5
      GuangZuan/miniprogram/mHome/pages/inspection/list/index.wxml
  12. 2 2
      GuangZuan/miniprogram/mHome/pages/inspection/payment/index.ts
  13. 3 3
      GuangZuan/miniprogram/mHome/pages/inspection/payment/index.wxml
  14. 4 3
      GuangZuan/miniprogram/mHome/pages/inspection/prepayment/index.ts
  15. 3 3
      GuangZuan/miniprogram/mHome/pages/inspection/prepayment/index.wxml
  16. 348 0
      GuangZuan/miniprogram/mHome/pages/msg/search/index.ts
  17. 2 2
      GuangZuan/miniprogram/mMine/pages/about/about/index.less
  18. 1 3
      GuangZuan/miniprogram/mMine/pages/about/about/index.wxml
  19. 117 110
      GuangZuan/miniprogram/mMine/pages/bank/index.ts
  20. 6 4
      GuangZuan/miniprogram/mMine/pages/bank/index.wxml
  21. 7 1
      GuangZuan/miniprogram/mMine/pages/inoutgold/index.ts
  22. 1 1
      GuangZuan/miniprogram/pages/home/index.less
  23. 1 1
      GuangZuan/miniprogram/pages/login/index.less
  24. 9 9
      GuangZuan/miniprogram/pages/login/index.ts
  25. 2 4
      GuangZuan/miniprogram/pages/login/index.wxml
  26. 13 6
      GuangZuan/miniprogram/services/utils.ts
  27. 28 3
      GuangZuan/miniprogram/utils/websocket/crypto.ts

BIN
GuangZuan/miniprogram/images/login_logo.png


+ 9 - 5
GuangZuan/miniprogram/mHome/pages/bond/list/index.ts

@@ -25,10 +25,8 @@ Page({
     isEmpty: true,
     /// 数据信息
     bonds: <GuangZuan.GZBSFWOrder[]>[],
-    /// 左滑宽度
-    width: 100,
     /// 显示的值
-    values: [{ up: [''], mid: [''], dwn: [''] }]
+    values: [{ up: [''], mid: [''], dwn: [''], width: 100 }]
   },
 
   /**
@@ -102,6 +100,11 @@ Page({
               bonds: res.data,
               /// 显示的值
               values: res.data.map(obj => {
+                /// 宽度设置
+                var width = 50.0
+                if (obj.gzbsstatus === 4 || obj.gzbsstatus === 11) {
+                  width = 100.0
+                }
                 return {up: [obj.totalnetweigthct.toString()+' | '+ 
                             obj.totalnetweightgm.toString()+' | '+
                             obj.totalgrossweightgm.toString(),
@@ -109,8 +112,9 @@ Page({
                         mid:[obj.totalamount.toString(), 
                             obj.priceper.toString(), 
                             getExecutestatus(obj.executestatus)],
-                        dwn: [obj.contentrange.toString()+' | '+ '--',
-                              '']}
+                        dwn: [isnullstr(obj.contentrange.toString())+' | '+ '--',
+                              ''],
+                        width: width}
               }),
               isEmpty: res.data.length === 0
             })

+ 4 - 4
GuangZuan/miniprogram/mHome/pages/bond/list/index.wxml

@@ -30,16 +30,16 @@
 <!-- 内容滚动视图 --> 
 <scroll-view class="content-view" style="padding-bottom: {{safeBottom+48}}px;">
   <!-- 数据 --> 
-  <van-swipe-cell wx:for="{{values}}" wx:for-item="itm" wx:for-index="idx" right-width="{{ width }}" wx:key="orderid">
+  <van-swipe-cell wx:for="{{values}}" wx:for-item="itm" wx:for-index="idx" right-width="{{ itm.width }}" wx:key="orderid">
     <view class="item-view">
       <view class="item-view-up">
-        <text wx:for="{{itm.up}}" wx:for-item="data" wx:for-index="idx" wx:key="idx">{{data}}</text>
+        <text wx:for="{{ itm.up }}" wx:for-item="data" wx:for-index="idx" wx:key="idx">{{data}}</text>
       </view>
       <view class="item-view-mid">
-        <text wx:for="{{itm.mid}}" wx:for-item="data" wx:for-index="idx" wx:key="idx">{{data}}</text>
+        <text wx:for="{{ itm.mid }}" wx:for-item="data" wx:for-index="idx" wx:key="idx">{{ data }}</text>
       </view>
       <view class="item-view-dwn">
-        <text wx:for="{{itm.dwn}}" wx:for-item="data" wx:for-index="idx" wx:key="idx">{{data}}</text>
+        <text wx:for="{{ itm.dwn }}" wx:for-item="data" wx:for-index="idx" wx:key="idx">{{ data }}</text>
       </view>
     </view>
     <!-- 取消收藏 --> 

+ 4 - 4
GuangZuan/miniprogram/mHome/pages/bond/payment/index.ts

@@ -34,7 +34,7 @@ Page({
       /// 发送查询请求
       queryFworderoperate({
         data: {
-          orderid: this.data.order.orderid.toString(),
+          orderid: this.data.order.ordersn,
           status: this.data.order.gzbsstatus
         },
         success: (res) => {
@@ -65,9 +65,9 @@ Page({
           UserID: userid(),
           OperateID: loginid(),
           ClientType: clientType,
-          ClientSerialNo: timetample().toString,
-          OperateAccount: loginCode(),
-          OrderID: this.data.order.orderid,
+          ClientSerialNo: timetample().toString(),
+          OperateAccount: loginCode().toString(),
+          OrderID: this.data.order.ordersn,
           OperateType: 4,
           Header: protoHeader(FunCode.BSFWMemberOperateReq, 66201)
         })

+ 4 - 4
GuangZuan/miniprogram/mHome/pages/bond/prepayment/index.ts

@@ -34,7 +34,7 @@ Page({
       /// 发送查询请求
       queryFworderoperate({
         data: {
-          orderid: this.data.order.orderid.toString(),
+          orderid: this.data.order.ordersn,
           status: this.data.order.gzbsstatus
         },
         success: (res) => {
@@ -65,9 +65,9 @@ Page({
           UserID: userid(),
           OperateID: loginid(),
           ClientType: clientType,
-          ClientSerialNo: timetample().toString,
-          OperateAccount: loginCode(),
-          OrderID: this.data.order.orderid,
+          ClientSerialNo: timetample().toString(),
+          OperateAccount: loginCode().toString(),
+          OrderID: this.data.order.ordersn,
           OperateType: 3,
           Header: protoHeader(FunCode.BSFWMemberOperateReq, 66201)
         })

+ 4 - 1
GuangZuan/miniprogram/mHome/pages/calculator/index.json

@@ -1,5 +1,8 @@
 {
-  "usingComponents": {},
+  "usingComponents": {
+    "van-dropdown-menu": "@vant/weapp/dropdown-menu/index",
+    "van-dropdown-item": "@vant/weapp/dropdown-item/index"
+  },
   "navigationBarTitleText": "钻石价格计算器",
   "enablePullDownRefresh": false
 }

+ 33 - 10
GuangZuan/miniprogram/mHome/pages/calculator/index.less

@@ -7,7 +7,7 @@
     display: flex;
     border-bottom: 1px solid #f0f0f0;
     align-items: center;
-    margin: 0px 10px;
+    margin: 5px 10px;
   
     text {
       width: 90px;
@@ -61,24 +61,47 @@
     text-align: center;
   }
   
-  .zsshape, .weight, .rate, .discount, .result {
+  .zsshape, .weight, .rate, .discount {
     height: 50px
   }
-
-  .zsclarity, .zscolor {
-    height: 130px;
-  }
   
   .buttom_view {
     display: flex;
     flex-direction: row;
-    justify-content: space-between;
+    justify-content: center;
     margin-top: 20px;
+    width: 95%;
+    align-content: center;
+    align-items: center;
   
-    button {
-      width: 95%;
+    van-button {
+      width: 90%;
       color: white;
-      background-color: red;
     }
   }  
+
+  .result {
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+    align-content: center;
+    width: 95%1;
+
+    &__top {
+      display: flex;
+      flex-direction: row;
+      justify-content: space-between;
+      align-items: center;
+      align-content: center;
+      width: 95%;
+    }
+
+    .value {
+      font-size: 28rpx;
+      color: #333;
+      text-align: left;
+      padding: 5px 0px;
+      width: 95%;
+    }
+  }
 }

+ 52 - 30
GuangZuan/miniprogram/mHome/pages/calculator/index.ts

@@ -1,4 +1,5 @@
 import { priceCalc } from "../../../services/api/orders/index"
+import { getEnumList } from "../../../services/utils"
 import { hideLoading, showLoading } from "../../../utils/message/index"
 
 // mHome/pages/calculator/index.ts
@@ -20,29 +21,11 @@ Page({
     /// 当前日期
     date: Date(),
     /// 颜色
-    zscolors: [{id: 1, name: 'D', isCheck: true}, 
-               {id: 2, name: 'E', isCheck: false}, 
-               {id: 3, name: 'F', isCheck: false}, 
-               {id: 4, name: 'G', isCheck: false}, 
-               {id: 5, name: 'H', isCheck: false}, 
-               {id: 6, name: 'I', isCheck: false}, 
-               {id: 7, name: 'J', isCheck: false}, 
-               {id: 8, name: 'K', isCheck: false}, 
-               {id: 9, name: 'L', isCheck: false}],
+    zscolors: [ {id: 1, name: 'D', isCheck: true} ],
     /// 选中形状
     zscolor: 'D',
     /// 净度
-    zsclaritys: [{id: 1, name: 'IF', isCheck: true}, 
-                 {id: 2, name: 'VVS1', isCheck: false}, 
-                 {id: 3, name: 'VVS2', isCheck: false}, 
-                 {id: 4, name: 'VS1', isCheck: false}, 
-                 {id: 5, name: 'VS2', isCheck: false}, 
-                 {id: 6, name: 'SL1', isCheck: false}, 
-                 {id: 7, name: 'SL2', isCheck: false},  
-                 {id: 8, name: 'SL3', isCheck: false},
-                 {id: 9, name: 'I1', isCheck: false},
-                 {id: 10, name: 'I2', isCheck: false},
-                 {id: 11, name: 'I3', isCheck: false}],
+    zsclaritys: [ {id: 1, name: 'IF', isCheck: true} ],
     /// 选中净度
     zsclarity: 'IF',
     /// 重量
@@ -50,32 +33,59 @@ Page({
     /// 汇率
     dayrate: 1.0,
     /// 折扣
-    discount: 10.0,
+    discount: 0.0,
+    /// 国际报价
+    doller: '0.0',
+    /// 国际人民币报价
+    rmb: '0.0',
     /// 美元
-    doller: 0.0,
+    disdoller: '0.0',
     /// 人民币
-    rmb: 0.0,
+    disrmb: '0.0',
     /// 克拉单价
     unitPrice: 0.0,
+    /// 选项
+    options: [
+      { text: '-', value: 0 },
+      { text: '+', value: 1 }
+    ],
+    /// 选项值
+    value: 0
   },
 
   /// 钻石价格计算器
   priceCalc() {
     /// showLoding....
     showLoading(()=>{
+      /// 折扣
+      const discount = Number((this.data.value === 0 ? '-' : '+')+this.data.discount.toString())/100
+      const rate = Number(this.data.dayrate)
+      const weight = Number(this.data.weight)
       /// 进行查询
       priceCalc({
         data: {
           zsshape: this.data.zsshape,
-          zscolor: 'D',
+          zscolor: this.data.zscolor,
           zsclarity: this.data.zsclarity,
-          weight: this.data.weight,
-          rate: this.data.dayrate,
-          discount: this.data.discount
+          weight: weight,
+          rate: 1.0
         },
         /// 查询成功
-        success: () => {
-          hideLoading(()=>{})
+        success: (res) => {
+          if (res.code != 200) {
+            hideLoading(()=>{}, '查询失败', 'error')
+            return
+          }
+          hideLoading(()=>{
+            const dollar  = Number(res.data[0].dollar)
+            console.log(dollar)
+            this.setData({
+              doller: dollar.toFixed(2),
+              rmb: (dollar*rate).toFixed(2),
+              disdoller: (dollar*(1+discount)*weight).toFixed(2),
+              disrmb: (dollar*(1+discount)*weight*rate).toFixed(2)
+            })
+          })
         },
         /// 查询失败
         fail: (emsg) => {
@@ -153,7 +163,19 @@ Page({
   /**
    * 生命周期函数--监听页面加载
    */
-  onLoad() {},
+  onLoad() {
+    /// 显示默认数据
+    this.setData({
+      /// 颜色
+      zscolors: getEnumList('ZSColorType').map(obj => {
+        return { id: obj.enumitemname, name: obj.enumdicname, isCheck: false }
+      }),
+      /// 净度
+      zsclaritys: getEnumList('ZSClarityType').map(obj => {
+        return { id: obj.enumitemname, name: obj.enumdicname, isCheck: false }
+      }),
+    })
+  },
 
   /**
    * 生命周期函数--监听页面初次渲染完成

+ 16 - 8
GuangZuan/miniprogram/mHome/pages/calculator/index.wxml

@@ -49,20 +49,28 @@
   <view class="cell-view discount"> 
     <text>折扣</text>
     <view class="content discount">
+      <!-- 折扣选项 -->
+      <van-dropdown-menu>
+        <van-dropdown-item model:value="{{ value }}" options="{{ options }}" />
+      </van-dropdown-menu>
+       <!-- 输入框 -->
       <van-field model:value="{{ discount }}" clearable placeholder="请输入折扣" type="digit" adjust-position />
     </view>
   </view>
 
-  <!--  底部视图  -->
-  <view class="buttom_view">
-    <button bindtap="onButtonPressed" id="calculate">计算</button>
-  </view>
-
   <!-- result -->
-  <view class="cell-view result"> 
-    <view class="content result">
-      <text>{{result}}</text>
+  <view class="result">
+    <view class="result__top">
+      <text class="value">国际报价:${{ doller }}/ct </text>
+      <text class="value">¥{{ rmb }}/ct</text>
     </view>
+    <text class="value">美元:{{ disdoller }}</text>
+    <text class="value">人民币:{{ disrmb }}</text>
+  </view>
+
+  <!--  底部视图  -->
+  <view class="buttom_view">
+    <van-button bind:click="onButtonPressed" block color="linear-gradient(to right, #4bb0ff, #666)" round id="calculate">计算</van-button>
   </view>
 </view>
 

+ 8 - 4
GuangZuan/miniprogram/mHome/pages/inspection/list/index.ts

@@ -24,9 +24,7 @@ Page({
     /// 数据信息
     orders: <GuangZuan.GZCJJCOrder[]>[],
     /// 显示的值
-    values: [{ up: [''], dwn: [''] }],
-    /// 左滑宽度
-    width: 100,
+    values: [{ up: [''], dwn: [''], width: 100 }],
   },
 
   /**
@@ -111,13 +109,19 @@ Page({
               orders: res.data,
               /// 显示的值
               values: res.data.map(obj => {
+                /// 宽度设置
+                var width = 50.0
+                if (obj.gzcjstatus === 1 || obj.gzcjstatus === 22 || obj.gzcjstatus === 2 || obj.gzcjstatus === 8 || obj.gzcjstatus === 10 || obj.gzcjstatus === 13) {
+                  width = 100.0
+                }
                 return {up: [obj.gzcjcategorytypedisplay, 
                             obj.gzcjaccount, 
                             isnullstr(obj.orderno)], 
                         dwn: [obj.totalnumber.toString()+'(粒)'+' | '+
                               obj.totalgrossweight.toString()+'(ct)'+' | '+
                               obj.totalweightgm.toString()+'(USD)',
-                              getExecutestatus(obj.executestatus)]}
+                              getExecutestatus(obj.executestatus)],
+                         width: width }
               }),
               isEmpty: res.data.length === 0
             })

+ 5 - 5
GuangZuan/miniprogram/mHome/pages/inspection/list/index.wxml

@@ -16,10 +16,10 @@
   <!-- 列头 --> 
   <view class="title-view">
     <view class="title-view-up">
-      <text wx:for="{{titles[0]}}" wx:for-item="itm" wx:for-index="idx" wx:key="idx">{{itm}}</text>
+      <text wx:for="{{ titles[0] }}" wx:for-item="itm" wx:for-index="idx" wx:key="idx">{{itm}}</text>
     </view>
     <view class="title-view-dwn">
-      <text wx:for="{{titles[1]}}" wx:for-item="itm" wx:for-index="idx" wx:key="idx">{{itm}}</text>
+      <text wx:for="{{ titles[1] }}" wx:for-item="itm" wx:for-index="idx" wx:key="idx">{{itm}}</text>
     </view>
   </view>
 </view>
@@ -27,13 +27,13 @@
 <!-- 内容滚动视图 --> 
 <scroll-view class="content-view" style="padding-bottom: {{safeBottom+48}}px;">
   <!-- 数据 --> 
-  <van-swipe-cell wx:for="{{values}}" wx:for-item="itm" wx:for-index="idx" wx:key="orderid" right-width="{{ width }}" id="{{idx}}">
+  <van-swipe-cell wx:for="{{ values }}" wx:for-item="itm" wx:for-index="idx" wx:key="orderid" right-width="{{ itm.width }}" id="{{ idx }}">
     <view class="item-view">
       <view class="item-view-up">
-        <text wx:for="{{itm.up}}" wx:for-item="data" wx:for-index="idx" wx:key="idx">{{data}}</text>
+        <text wx:for="{{ itm.up }}" wx:for-item="data" wx:for-index="idx" wx:key="idx">{{ data }}</text>
       </view>
       <view class="item-view-dwn">
-        <text wx:for="{{itm.dwn}}" wx:for-item="data" wx:for-index="idx" wx:key="idx">{{data}}</text>
+        <text wx:for="{{ itm.dwn }}" wx:for-item="data" wx:for-index="idx" wx:key="idx">{{ data }}</text>
       </view>
     </view>
     <!-- 取消收藏 --> 

+ 2 - 2
GuangZuan/miniprogram/mHome/pages/inspection/payment/index.ts

@@ -34,7 +34,7 @@ Page({
       /// 发送查询请求
       queryGzcjjcorderoperate({
         data: {
-          orderid: this.data.order.orderid.toString(),
+          orderid: this.data.order.orderidstr,
           status: this.data.order.gzcjstatus
         },
         success: (res) => {
@@ -65,7 +65,7 @@ Page({
           OperateID: loginid(),
           ClientType: clientType,
           ClientSerialNo: timetample().toString,
-          OperateAccount: loginCode(),
+          OperateAccount: loginCode().toString(),
           OrderID: this.data.order.orderidstr,
           OperateType: 5,
           Header: protoHeader(FunCode.CJJCMemberOperateReq, 66201)

+ 3 - 3
GuangZuan/miniprogram/mHome/pages/inspection/payment/index.wxml

@@ -2,9 +2,9 @@
   <!-- top-view -->
   <view class="top-view">
     <!-- 导航栏 -->
-    <van-nav-bar custom-style="background-color: #E92020">
-      <van-icon slot="left" name="arrow-left" size="25px" color="white" bind:click="backToParent"/>
-      <text slot="title" style="color: white;">确认付款</text>
+    <van-nav-bar custom-style="background-color: #fff">
+      <van-icon slot="left" name="arrow-left" size="25px" color="#333" bind:click="backToParent"/>
+      <text slot="title" style="color: #333;">确认付款</text>
     </van-nav-bar>
   </view>
 

+ 4 - 3
GuangZuan/miniprogram/mHome/pages/inspection/prepayment/index.ts

@@ -34,7 +34,7 @@ Page({
       /// 发送查询请求
       queryGzcjjcorderoperate({
         data: {
-          orderid: this.data.order.orderid.toString(),
+          orderid: this.data.order.orderidstr,
           status: this.data.order.gzcjstatus
         },
         success: (res) => {
@@ -56,8 +56,9 @@ Page({
    * 出境检测操作请求
    */
   doCJJCOperator() {
-    /// loding.....
+    /// showModel
     showModel(() => {
+      /// showLoading
       showLoading(()=>{
         /// 参数信息
         const info = JSON.stringify({
@@ -65,7 +66,7 @@ Page({
           OperateID: loginid(),
           ClientType: clientType,
           ClientSerialNo: timetample().toString,
-          OperateAccount: loginCode(),
+          OperateAccount: loginCode().toString(),
           OrderID: this.data.order.orderidstr,
           OperateType: 4,
           Header: protoHeader(FunCode.CJJCMemberOperateReq, 66201)

+ 3 - 3
GuangZuan/miniprogram/mHome/pages/inspection/prepayment/index.wxml

@@ -2,9 +2,9 @@
   <!-- top-view -->
   <view class="top-view">
     <!-- 导航栏 -->
-    <van-nav-bar custom-style="background-color: #E92020">
-      <van-icon slot="left" name="arrow-left" size="25px" color="white" bind:click="backToParent"/>
-      <text slot="title" style="color: white;">确认预付款</text>
+    <van-nav-bar custom-style="background-color: #fff">
+      <van-icon slot="left" name="arrow-left" size="25px" color="#333" bind:click="backToParent"/>
+      <text slot="title" style="color: #333;">确认预付款</text>
     </van-nav-bar>
   </view>
 

+ 348 - 0
GuangZuan/miniprogram/mHome/pages/msg/search/index.ts

@@ -0,0 +1,348 @@
+import { getEnumList } from "../../../../services/utils"
+
+// pages/search/index.ts
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    /// 底部安全区域
+    safeBottom: getApp().globalData.safeBottom,
+    /// tabs
+    tabs: [{id: 2, name: '单颗裸钻'}, {id: 5, name: '单颗彩钻'}],
+    /// tab索引
+    active: 0,
+    /// 形状
+    shapes: [{ id: 1, name: '圆明亮形', isCheck: true }],
+    /// 选中形状         
+    shape: ['1'],
+    /// 颜色
+    colors: [{id: 1, name: 'D', isCheck: true}],
+    /// 选中形状
+    color: [1],
+    /// 净度
+    neatness: [{ id: 1, name: 'FL', isCheck: true }],
+    /// 选中净度
+    neatnes: 1,
+    /// 切工 
+    qiegongs: [{ id: 1, name: 'EX', isCheck: true }],
+    /// 选中切工
+    qiegong: 1,
+    /// 对称
+    duichengs: [{ id: 1, name: 'EX', isCheck: true }],
+    duicheng: 1,
+    /// 抛光
+    paoguangs: [{ id: 1, name: 'EX', isCheck: true }],
+    paoguang: 1,
+    /// 莹光
+    yingguangs: [{ id: 1, name: '无', isCheck: true }],
+    /// 选中莹光
+    yingguang: 1,
+    /// 证书
+    certificates: [{ id: 1, name: 'GIA', isCheck: true }],
+    /// 选中证书
+    certificate: 1,
+    /// 币种
+    currencys: [{id: 1, name: '人民币(¥)', isCheck: true}, 
+                {id: 2, name: '美元($)', isCheck: false}],
+    currency: 1,
+    /// 最小重量
+    minweight: 0.00,
+    /// 最大重量
+    maxweight: 0.00
+  },
+
+  /**
+   * tab触发事件
+   */
+  onTabChange(e: any) {
+    /// 设置激活项
+    this.setData({ active: e.detail.index })
+  },
+
+  /**
+   * 返回上层视图
+   */
+  backToParent() {
+    /// 返回上层视图
+    wx.navigateBack()
+  },
+
+  /// 按钮点击事件
+  onButtonPressed(e: any) {
+    /// 数据拼接
+    const ids = (<string> e.target.id).split(' ')
+    const id = (<string> e.target.id).split(' ')[0]
+    const index = <number> <unknown>ids[1]
+
+    switch (id) {
+      case 'shape':   /// 形状
+        this.setData({ shapes: this.data.shapes.map(item => {
+          if (item.id == index) { item.isCheck = !item.isCheck } 
+          return item
+        }) })
+        /// 赋值
+        this.setData({ shape: this.data.shapes.map(item => {
+          return item.id.toString()
+        }) })
+        break;
+      case 'currency': 
+        this.setData({ currencys: this.data.currencys.map(item => {
+          if (item.id == index) {
+            item.isCheck = true
+            /// 赋值
+            this.setData({ currency: item.id })
+          } else {
+            item.isCheck = false
+          }
+          return item
+        }) })
+        break;
+      case 'color':   /// 颜色
+        this.setData({ colors: this.data.colors.map(item => {
+          if (item.id == index) { item.isCheck = !item.isCheck } 
+          return item
+        }) })
+        /// 赋值
+        this.setData({ color: this.data.colors.map(item => { return item.id }) })
+        break;
+      case 'neatness':   /// 净度
+        this.setData({ neatness: this.data.neatness.map(item => {
+          if (item.id == index) {
+            item.isCheck = true
+            /// 赋值
+            this.setData({ neatnes: item.id })
+          } else {
+            item.isCheck = false
+          }
+          return item
+        }) })
+        break;
+      case 'qiegong':   /// 切工
+        this.setData({ qiegongs: this.data.qiegongs.map(item => {
+          if (item.id == index) {
+            item.isCheck = true
+            /// 赋值
+            this.setData({ qiegong: item.id })
+          } else {
+            item.isCheck = false
+          }
+          return item
+        }) })
+        break;
+      case 'duicheng':   /// 对称
+        this.setData({ duichengs: this.data.duichengs.map(item => {
+          if (item.id == index) {
+            item.isCheck = true
+            /// 赋值
+            this.setData({ duicheng: item.id })
+          } else {
+            item.isCheck = false
+          }
+          return item
+        }) })
+        break;
+      case 'polishing':   /// 抛光
+        this.setData({ paoguangs: this.data.paoguangs.map(item => {
+          if (item.id == index) {
+            item.isCheck = true
+            /// 赋值
+            this.setData({ polishing: item.id })
+          } else {
+            item.isCheck = false
+          }
+          return item
+        }) })
+        break;
+      case 'yingguang':   /// 荧光
+        this.setData({ yingguangs: this.data.yingguangs.map(item => {
+          if (item.id == index) {
+            item.isCheck = true
+            /// 赋值
+            this.setData({ yingguang: item.id })
+          } else {
+            item.isCheck = false
+          }
+          return item
+        }) })
+        break;
+      case 'certificate':   /// 证书
+        this.setData({ certificates: this.data.certificates.map(item => {
+          if (item.id == index) {
+            item.isCheck = true
+            /// 赋值
+            this.setData({ certificate: item.id })
+          } else {
+            item.isCheck = false
+          }
+          return item
+        }) })
+        break;
+      case 'search':   /// 搜索
+        /// 搜索页面跳转
+        this.goToSearch()
+        break;
+      case 'clear': break;
+      default: break;
+    }
+  },
+
+  /// 重量范围值更改
+  syncNumRange(e: any) {
+    this.setData({
+      minweight: e.detail.value[0],
+      maxweight: e.detail.value[1],
+    })
+  },
+
+  /// 搜索页面跳转
+  goToSearch() {
+    /// 数据拼接
+    const info = {
+      category: this.data.tabs[this.data.active].id,
+      zsshapetype: this.data.shape,
+      zsclaritytype: this.data.neatnes,
+      zscuttype: this.data.qiegong,
+      zssymmetrytype: this.data.duicheng,
+      zspolishtype: this.data.paoguang,
+      zsfluorescencetype: this.data.yingguang,
+      zscurrencytype: this.data.currency,
+      zscerttype: this.data.certificate,
+      zscolortype: this.data.color,
+      weight1: this.data.minweight,
+      weight2: this.data.maxweight
+    }
+    /// 页面跳转
+    wx.switchTab({ 
+      url: '/pages/trade/index',
+      /// 加载成功
+      success: () => {
+        /// 缓存数据
+        wx.setStorageSync('TradeParams', JSON.stringify(info))
+      }
+    })
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad() {
+    
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+    /// 显示默认数据
+    this.setData({
+      /// 形状
+      shapes: getEnumList('ZSShapeType').map(obj => {
+        return {
+          id: obj.enumitemname,
+          name: obj.enumdicname,
+          isCheck: false
+        }
+      }),
+      /// 颜色
+      colors: getEnumList('ZSColorType').map(obj => {
+        return {
+          id: obj.enumitemname,
+          name: obj.enumdicname,
+          isCheck: false
+        }
+      }),
+      /// 净度
+      neatness: getEnumList('ZSClarityType').map(obj => {
+        return {
+          id: obj.enumitemname,
+          name: obj.enumdicname,
+          isCheck: false
+        }
+      }),
+      /// 切工
+      qiegongs: getEnumList('ZSCutType').map(obj => {
+        return {
+          id: obj.enumitemname,
+          name: obj.enumdicname,
+          isCheck: false
+        }
+      }),
+      /// 对称
+      duichengs: getEnumList('ZSSymmetryType').map(obj => {
+        return {
+          id: obj.enumitemname,
+          name: obj.enumdicname,
+          isCheck: false
+        }
+      }),
+      /// 抛光
+      paoguangs: getEnumList('ZSPolishType').map(obj => {
+        return {
+          id: obj.enumitemname,
+          name: obj.enumdicname,
+          isCheck: false
+        }
+      }),
+      /// 荧光
+      yingguangs: getEnumList('ZSFluorescenceType').map(obj => {
+        return {
+          id: obj.enumitemname,
+          name: obj.enumdicname,
+          isCheck: false
+        }
+      }),
+      /// 证书
+      certificates: getEnumList('ZSCertType').map(obj => {
+        return {
+          id: obj.enumitemname,
+          name: obj.enumdicname,
+          isCheck: false
+        }
+      }),
+    })
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+    
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+
+  }
+})

+ 2 - 2
GuangZuan/miniprogram/mMine/pages/about/about/index.less

@@ -4,8 +4,8 @@
   align-items: center;
   align-content: center;
 
-  van-image {
-    margin-top: 15%;
+  .logo {
+    margin-top: 10%;
     margin-bottom: 20px;
   }
 }

+ 1 - 3
GuangZuan/miniprogram/mMine/pages/about/about/index.wxml

@@ -9,9 +9,7 @@
 
 <view class="container" style="margin-bottom: 20px;">
   <!--  logo图片  -->
-  <van-image width="100" height="100" lazy-load radius="10px" src="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fp6.itc.cn%2Fimages01%2F20201013%2F4742c373ba044538a0b9dc0dec93f5b8.jpeg&refer=http%3A%2F%2Fp6.itc.cn&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1662619772&t=af033b0c014ea50ff71b10a28c332b60">
-    <van-loading slot="loading" type="spinner" size="20" vertical />
-  </van-image>
+  <image class="logo" width="60%" mode="widthFix" src="../../../../images/login_logo.png" />
   <text style="color: #666; font-size: 14px;">版本号:{{version}}</text>
 </view>
 

+ 117 - 110
GuangZuan/miniprogram/mMine/pages/bank/index.ts

@@ -2,9 +2,9 @@ import { FunCode } from "../../../constants/enum/funcode"
 import Toast from "../../../miniprogram_npm/@vant/weapp/toast/toast"
 import { queryBankAccountSign, queryCusBankSignBank } from "../../../services/api/account/index"
 import { sendMsgToMQ } from "../../../services/api/common/index"
-import { accountid, getErrorMsg, isEncrypted, loginQuery, protoHeader, timetample, userid } from "../../../services/utils"
+import { accountid, getEnumdicValue, getErrorMsg, isEncrypted, loginQuery, protoHeader, timetample, userid } from "../../../services/utils"
 import { hideLoading, showLoading, showModel } from "../../../utils/message/index"
-import { encryptBody } from "../../../utils/websocket/crypto"
+import { decryptAES, encryptBody } from "../../../utils/websocket/crypto"
 
 Page({
 
@@ -31,7 +31,9 @@ Page({
     /// 托管银行信息
     cusBankInfo: <GuangZuan.CusBankInfo>{},
     /// 签约账户信息
-    bankAccountSign: <GuangZuan.BankAccountSign>{}
+    bankAccountSign: <GuangZuan.BankAccountSign>{},
+    /// 签约状态
+    signStatus: ''
   },
 
    /**
@@ -63,6 +65,24 @@ Page({
   },
 
   /**
+   * 按钮点击响应事件
+   */
+  onButtonPressed(e: any) {
+    switch (e.currentTarget.id) {
+      case 'submit':   /// 签约提交
+        this.doBankAccountSign()
+        break;
+      case 'cancel':  /// 解约请求
+        showModel(() => {
+          this.doCancelBankAccountSign()
+        }, '提示', '确定要申请解约吗?')
+        break
+      default:
+        break;
+    }
+  },
+
+  /**
    * showBankInfos
    */
   showBankInfos() {
@@ -127,126 +147,117 @@ Page({
             this.setData({ 
               bankAccountSign: sign,
               bankName: sign.bankname,
-              bankNo: sign.cardno,
+              bankNo: sign.bankaccountno,
               accountName: sign.bankaccountname,
               branchBankName: sign.branchbankname,
+              signStatus: getEnumdicValue('signstatus', sign.signstatus),
               bankInfo: this.data.bankInfos.filter(obj => {
                 return obj.bankid === sign.bankid
               })[0],
             })
           })
         },
-        fail: (emsg) => {
-          hideLoading(()=>{}, emsg, 'error')
-        }
+        fail: (emsg) => { hideLoading(()=>{}, emsg, 'error') }
       })
     })
   },
 
   /**
-   * 按钮点击响应事件
-   */
-  onButtonPressed(e: any) {
-    switch (e.currentTarget.id) {
-      case 'submit':   /// 签约提交
-        showModel(() => {
-          this.doBankAccountSign()
-        }, '提示', '确定要申请签约吗?')
-        break;
-      case 'cancel':  /// 解约请求
-        showModel(() => {
-          this.doCancelBankAccountSign()
-        }, '提示', '确定要申请解约吗?')
-        break
-      default:
-        break;
-    }
-  },
-
-  /**
    * 签约请求
    */
   doBankAccountSign() {
     /// 合规性校验
     if (!this.check()) { return }
-    /// loading
-    showLoading(()=>{
-      /// 用户信息
-      const userinfo = loginQuery().userInfo
-      /// 银行卡号
-      const bankid = this.data.bankAccountSign ? this.data.bankAccountSign.bankid : this.data.bankInfo.bankid
-      /// 参数信息
-      const info = JSON.stringify({ 
-        /// 扩展信息(JSON串,参考配置要求进行填充)
-        extend_info: JSON.stringify({ "sex" : 1 }),
-        /// 交易所业务日期
-        TradeDate: this.data.cusBankInfo.tradedate,
-        /// 账户类型[1-对私;2-对公]
-        AccountType: 1,
-        /// 币种
-        Currency: this.data.cusBankInfo.currency,
-        /// 是否强制[0-否;1-是]强制,只更新中心签约信息,不发送银行。用于银行信息不一致的情况
-        IsForce: 0,
-        /// 授权代理人证件类型
-        AgentCertType: 0,
-        /// 变更类型[1-增加;2-修改;4-绑卡;
-        OperateType: this.data.bankAccountSign ? 2 : 1,
-        /// 银行卡类型
-        BankCardType: 0,
-        /// 银行账户类型
-        BankAccountType: 1,
-        /// 客户名称
-        AccountName: this.data.accountName,
-        /// 银行账户名称
-        BankAccountName: this.data.accountName,
-        /// 银行账户
-        BankAccountNo: this.data.bankNo,
-        /// 开户支行名称
-        OpenBankName: this.data.branchBankName,
-        /// 银行卡行号
-        OpenBankAccId: bankid,
-        /// 托管银行编号
-        CusBankID: this.data.cusBankInfo.cusbankid,
-        /// 开户行名称
-        ExBankName: this.data.bankName,
-        /// 账户
-        AccountCode: accountid().toString(),
-        /// 外部操作流水号
-        ExtOperatorID: timetample(),
-        /// 证件号码
-        CertID: userinfo.cardnum,
-        /// 证件类型
-        CertType: userinfo.cardtypeid.toString(),
-        /// 头部
-        Header: protoHeader(FunCode.T2bBankSignReq)  
-      })
-      
-      /// 发送请求
-      sendMsgToMQ({
-        data: {
-          funCodeReq: FunCode.T2bBankSignReq,
-          funCodeRsp: FunCode.T2bBankSignRsp,
-          isEncrypted: isEncrypted(),
-          data: encryptBody(info)
-        },
-        success: (res) => {
-          /// 解析对象
-          const data = JSON.parse(res.data.data)
-          if (data.RetCode != 0) {
-            hideLoading(() => {}, getErrorMsg(data.RetCode), 'error')
-            return
-          }
-          /// 请求成功
-          hideLoading(()=>{
-            /// 返回上层视图
-            wx.navigateBack()
-          }, '签约请求成功', 'success')
-        }, 
-        fail: (emsg) => {
-          hideLoading(()=>{}, emsg, 'error')
+
+    const { cusbankid } = this.data.bankAccountSign
+    const operateType = cusbankid != undefined ? 2 : 1
+    const msg = operateType === 1 ? '签约请求' : '签约修改'
+
+    /// showModel
+    showModel(() => {
+        /// loading
+      showLoading(()=>{
+        /// 用户信息
+        const userinfo = loginQuery().userInfo
+        /// 银行卡号
+        const bankid = cusbankid != undefined ? this.data.bankAccountSign.bankid : this.data.bankInfo.bankid
+        /// 数据信息
+        const data = {
+          /// 账户类型[1-对私;2-对公]
+          AccountType: 1,
+          /// 是否强制[0-否;1-是]强制,只更新中心签约信息,不发送银行。用于银行信息不一致的情况
+          IsForce: 0,
+          /// 授权代理人证件类型
+          AgentCertType: 0,
+          /// 银行卡类型
+          BankCardType: 0,
+          /// 银行账户类型
+          BankAccountType: 1,
+          /// 账户
+          AccountCode: accountid().toString(),
+          /// 外部操作流水号
+          ExtOperatorID: timetample(),
+          /// 扩展信息(JSON串,参考配置要求进行填充)
+          extend_info: JSON.stringify({ "sex" : 1 }),
+          /// 头部
+          Header: protoHeader(FunCode.T2bBankSignReq)  
         }
-      })
-    }, '操作请求中.....')
+        /// 参数信息
+        const info = JSON.stringify({ 
+          /// 交易所业务日期
+          TradeDate: this.data.cusBankInfo.tradedate,
+          /// 币种
+          Currency: this.data.cusBankInfo.currency,
+          /// 变更类型[1-增加;2-修改;4-绑卡;
+          OperateType: operateType,
+          /// 客户名称
+          AccountName: this.data.accountName,
+          /// 银行账户名称
+          BankAccountName: this.data.accountName,
+          /// 银行账户
+          BankAccountNo: this.data.bankNo,
+          /// 开户支行名称
+          OpenBankName: this.data.branchBankName,
+          /// 银行卡行号
+          OpenBankAccId: bankid,
+          /// 托管银行编号
+          CusBankID: this.data.cusBankInfo.cusbankid,
+          /// 开户行名称
+          ExBankName: this.data.bankName,
+          /// 证件号码
+          CertID: decryptAES(userinfo.cardnum),
+          /// 证件类型
+          CertType: userinfo.cardtypeid.toString(),
+          /// 数据信息
+          ...data
+        })
+        /// 发送请求
+        sendMsgToMQ({
+          data: {
+            funCodeReq: FunCode.T2bBankSignReq,
+            funCodeRsp: FunCode.T2bBankSignRsp,
+            isEncrypted: isEncrypted(),
+            data: encryptBody(info)
+          },
+          success: (res) => {
+            /// 解析对象
+            const data = JSON.parse(res.data.data)
+            if (data.Status != 0) {
+              hideLoading(() => {}, getErrorMsg(data.Status), 'error')
+              return
+            }
+            /// 请求成功
+            hideLoading(()=>{
+              /// 返回上层视图
+              wx.navigateBack()
+            }, msg+'成功', 'success')
+          }, 
+          fail: (emsg) => {
+            hideLoading(()=>{}, emsg, 'error')
+          }
+        })
+      }, msg+'中.....')  
+    }, '提示', '确定要'+msg+'?')
   },
 
   /**
@@ -321,12 +332,6 @@ Page({
       return false
     }
 
-    /// 请输入姓名!
-    if (this.data.accountName.length === 0) {
-      Toast({message: '请输入姓名!'})
-      return false
-    }
-
     /// 请输入支行名称!
     if (this.data.branchBankName.length === 0) {
       Toast({message: '请输入支行名称!'})
@@ -343,6 +348,8 @@ Page({
     this.queryCusBankInfo()
     /// 查询账户已签约信息 
     this.queryBankAccountSign()
+    /// 账户名称
+    this.setData({ accountName: loginQuery().userInfo.customername })
   },
 
   /**

+ 6 - 4
GuangZuan/miniprogram/mMine/pages/bank/index.wxml

@@ -2,7 +2,7 @@
   <!-- 导航栏 -->
   <van-nav-bar custom-style="background-color: #fff">
     <van-icon slot="left" name="arrow-left" size="25px" color="#333" bind:click="backToParent"/>
-    <text slot="title" style="color: #333;">添加签约账户</text>
+    <text slot="title" style="color: #333;"> {{ bankAccountSign.cusbankid ? '修改签约账户' : '添加签约账户' }}</text>
   </van-nav-bar>
 </view>
 
@@ -14,15 +14,17 @@
   <!-- 银行卡号 -->
   <van-field model:value="{{ bankNo }}" adjust-position type="number" label="银行卡号" required clearable placeholder="请输入银行卡号"/>
   <!-- 姓名 -->
-  <van-field model:value="{{ accountName }}" adjust-position label="姓名" required clearable placeholder="请输入姓名"/>
+  <van-field model:value="{{ accountName }}" adjust-position label="姓名" readonly placeholder="请输入姓名"/>
   <!-- 支行名称 -->
   <van-field model:value="{{ branchBankName }}" adjust-position label="支行名称" required clearable placeholder="请填写开户支行名称"/>
+  <!-- 支行名称 -->
+  <van-field wx:if="{{ signStatus != '' }}" model:value="{{ signStatus }}" label="签约状态" readonly />
 </van-cell-group>
 
 <!-- 按钮 -->
 <view class="button-view">
-  <van-button custom-class="submit" id="submit" round color="linear-gradient(to right, #4bb0ff, #6149f6)" block bind:click="onButtonPressed">提交</van-button>
-  <van-button wx:if="{{ bankAccountSign }}" custom-class="cancel" id="cancel" round color="linear-gradient(to right, #4bb0ff, #D91D34)" block bind:click="onButtonPressed">解约</van-button>
+  <van-button custom-class="submit" id="submit" round color="linear-gradient(to right, #4bb0ff, #6149f6)" block bind:click="onButtonPressed">{{ bankAccountSign.cusbankid ? '修改' : '添加'}}</van-button>
+  <van-button wx:if="{{ bankAccountSign.signstatus === 4 }}" custom-class="cancel" id="cancel" round color="linear-gradient(to right, #4bb0ff, #D91D34)" block bind:click="onButtonPressed">解约</van-button>
 </view>
 
 <!-- 选择开户行 -->

+ 7 - 1
GuangZuan/miniprogram/mMine/pages/inoutgold/index.ts

@@ -7,6 +7,7 @@ import { accountid, getErrorMsg, isEncrypted, loginQuery, protoHeader, timetampl
 import { formatDate, isnullstr } from "../../../utils/util"
 import { hideLoading, showLoading, showModel } from "../../../utils/message/index"
 import { encryptBody } from "../../../utils/websocket/crypto"
+import { v4 } from "../../../utils/uuid/index"
 
 Page({
 
@@ -159,7 +160,8 @@ Page({
         /// uint32 查询位掩码
         QueryBitMask: 2,
         /// uint64 查询资金账号
-        AccountId: accountid(),
+        AccountId: accountid().toString(),
+        OrderId: timetample().toString()
       })
       /// 发送请求
       sendMsgToMQ({
@@ -176,6 +178,10 @@ Page({
             hideLoading(() => {}, getErrorMsg(data.RetCode), 'error')
             return
           }
+          hideLoading(() => {
+            /// 可出金额
+            this.setData({ enableOutAmount: data.AvailableOutMoney })
+          }, '请求成功', 'success')
         }, 
         fail: (emsg) => {
           hideLoading(()=>{}, emsg, 'error')

+ 1 - 1
GuangZuan/miniprogram/pages/home/index.less

@@ -157,7 +157,7 @@
 
 .certsearch {
   right: 5px; 
-  bottom: 18%;
+  bottom: 16%;
 }
 
 .calculator {

+ 1 - 1
GuangZuan/miniprogram/pages/login/index.less

@@ -4,7 +4,7 @@ Page {
   align-items: center;
   align-content: center;
 
-  van-image {
+  .logo {
     margin-top: 15%;
     margin-bottom: 20px;
   }

+ 9 - 9
GuangZuan/miniprogram/pages/login/index.ts

@@ -1,9 +1,8 @@
 import { login, loginQuery } from '../../services/api/account/index'
 import { appConfig } from '../../config/index'
-import { getDivisions, loginid, setAllEnums, setAllErrors, taAccounts } from '../../services/utils'
-import Toast from '../../miniprogram_npm/@vant/weapp/toast/toast'
+import { getDivisions, getLoginCode, loginid, setAllEnums, setAllErrors, setLoginCode, taAccounts } from '../../services/utils'
 import { getAllEnums, queryErrorInfos } from '../../services/api/common/index'
-import { hideLoading, showLoading } from '../../utils/message/index'
+import { hideLoading, showLoading, showToast } from '../../utils/message/index'
 import { encryptBody } from '../../utils/websocket/crypto'
 
 Page({
@@ -15,9 +14,9 @@ Page({
     /// 底部安全区域
     safeBottom: getApp().globalData.safeBottom,
     /// 姓名
-    username: '110000000001',
+    username: '',
     /// 密码
-    pwd: '123456',
+    pwd: '',
     /// 版本号
     version: appConfig.version,
     /// 是否loding
@@ -30,13 +29,13 @@ Page({
   check(): boolean {
     /// 请输入用户名
     if (this.data.username.length == 0) {
-      Toast('请输入用户名!')
+      showToast('请输入用户名!')
       return false
     }
 
     /// 请输入密码并且大于6位数!
     if (this.data.pwd.length < 6) {
-      Toast('请输入密码并且大于6位数!')
+      showToast('请输入密码并且大于6位数!')
       return false
     }
     return true
@@ -69,7 +68,8 @@ Page({
               this.setData({ isLoding: false }) 
               return 
             }
-
+            /// 设置登录账号
+            setLoginCode(this.data.username)
             /// 存储token以及loginId、userId
             wx.setStorageSync('Authorization', res.data.token)
             wx.setStorageSync('LoginID', res.data.loginId)
@@ -158,7 +158,7 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad() {
-    
+    this.setData({ username: getLoginCode() })
   },
 
   /**

+ 2 - 4
GuangZuan/miniprogram/pages/login/index.wxml

@@ -1,7 +1,5 @@
 <!--  logo图片  -->
-<van-image width="100" height="100" lazy-load radius="10px" src="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fp6.itc.cn%2Fimages01%2F20201013%2F4742c373ba044538a0b9dc0dec93f5b8.jpeg&refer=http%3A%2F%2Fp6.itc.cn&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1662619772&t=af033b0c014ea50ff71b10a28c332b60">
-  <van-loading slot="loading" type="spinner" size="20" vertical />
-</van-image>
+<image class="logo" style="width: 60%;" mode="widthFix" src="../../images/login_logo.png" />
 
 <!--  用户名  用户密码 -->
 <van-cell-group>
@@ -18,7 +16,7 @@
 <van-button loading="{{isLoding}}" round color="linear-gradient(to right, #FF7252, #55A154)" block style="width: 90%; padding-top: 5px;" loading-text="登录中..." bind:click="onLogin">登录</van-button>
 
 <!--  版权信息  -->
-<van-divider contentPosition="center" textColor="#1989fa" style="position: absolute; bottom: {{safeBottom+20}}px;" customStyle="color: #1989fa; border-color: #1989fa; font-size: 10px;">Copyright 2022 GuangZuan. ALL Right Reserved.版本号V{{version}}
+<van-divider contentPosition="center" textColor="#1989fa" style="position: absolute; bottom: {{ safeBottom+20 }}px;" customStyle="color: #1989fa; border-color: #1989fa; font-size: 10px;">Copyright 2022 GuangZuan. ALL Right Reserved.版本号V{{version}}
 </van-divider>
 
 <!-- toast -->

+ 13 - 6
GuangZuan/miniprogram/services/utils.ts

@@ -267,17 +267,15 @@ export function getEnumList(enumdiccode: string): GuangZuan.AllEnums[] {
 }
 
 /// 获取对应枚举的值
-export function getEnumdicValue(enumdiccode: string, enumdicname: string): number {
+export function getEnumdicValue(enumdiccode: string, enumitemname: number): string {
   const objs = getEnumList(enumdiccode)
   if (objs.length != 0) {
     const enums = objs.filter(obj => {
-      return obj.enumdicname === enumdicname
+      return obj.enumitemname === enumitemname
     })
-    return enums.filter(obj => {
-      return obj.enumdicname === enumdicname
-    })[0].enumitemname
+    return enums[0].enumdicname
   }
-  return 0
+  return ''
 }
 
 /// 缓存所有的错误码信息
@@ -294,4 +292,13 @@ export function getErrorMsg(retcode: number): string {
   return errors.filter(obj => {
     return retcode.toString() === obj.errorcode
   })[0].description
+}
+
+/// 设置登录账号
+export function setLoginCode(code: string) {
+  wx.setStorageSync('loginCode', code)
+}
+
+export function getLoginCode(): string {
+  return wx.getStorageSync('loginCode')
 }

+ 28 - 3
GuangZuan/miniprogram/utils/websocket/crypto.ts

@@ -9,6 +9,8 @@ const macKeyLeft: CryptoJS.lib.WordArray = CryptoJS.enc.Hex.parse('B0FB83E39A5EB
 const macKeyRight: CryptoJS.lib.WordArray = CryptoJS.enc.Hex.parse('BE471362A58393FF');
 /** MAC检验向量 */
 const iv = new Uint8Array([0xd9, 0x51, 0xdb, 0xe0, 0x37, 0xc8, 0x23, 0x25]);
+/** Phone AES密钥 */
+const phoneaeskey = '0d299ce2d4105282f7471074cb0f9f9d';
 
 const aesOption = {
     mode: CryptoJS.mode.ECB,
@@ -192,6 +194,29 @@ export function Uint8ArrayToString(fileData: Uint8Array){
 export const encryptBody = (json: string, ec: boolean=isEncrypted()) => {
   const data = toUint8Array(json)
   const encrypt = encrypt50(data)
-  const base =  CryptoJS.enc.Base64.stringify(uint8ArrayToWordArray(encrypt!))
-  return ec ? base : json
-}
+  /// 如果为空
+  if (encrypt) {
+    const base =  CryptoJS.enc.Base64.stringify(uint8ArrayToWordArray(encrypt))
+    return ec ? base : json
+  }
+  return json
+}
+
+/**
+ * AES数据解密方法
+ * @param encryptData 密文
+ * @param size 明文长度
+ */
+export const decryptAES = (value: string): string | undefined => {
+  const ciphertext = hexStringToUint8Array(value);
+  const key = hexStringToUint8Array(phoneaeskey);
+
+  const cipherParams = CryptoJS.lib.CipherParams.create({
+      ciphertext: uint8ArrayToWordArray(ciphertext),
+  });
+
+  const decrytped = CryptoJS.AES.decrypt(cipherParams, uint8ArrayToWordArray(key), aesOption);
+  const h = wordArrayToUint8Array(decrytped).subarray(0, decrytped.sigBytes);
+  const result = new TextDecoder().decode(h);
+  return result;
+}