Handy_Cao 2 år sedan
förälder
incheckning
1f8d7141da

+ 4 - 1
GuangZuan/miniprogram/app.json

@@ -55,7 +55,10 @@
         "pages/bond/prepayment/index",
         "pages/presell/list/index",
         "pages/presell/detail/index",
-        "pages/presell/new/index"
+        "pages/presell/new/index",
+        "pages/purchase/list/index",
+        "pages/purchase/detail/index",
+        "pages/purchase/new/index"
       ]
     },
     {

+ 2 - 1
GuangZuan/miniprogram/mHome/pages/presell/list/index.json

@@ -1,3 +1,4 @@
 {
-  "usingComponents": {}
+  "usingComponents": {},
+  "navigationBarTitleText": "预售大厅"
 }

+ 143 - 2
GuangZuan/miniprogram/mHome/pages/presell/list/index.ts

@@ -1,11 +1,152 @@
-// mHome/pages/presell/list/index.ts
+import { queryGZMyTradingPreSell, queryGZPreSell } from "../../../../services/api/orders/index"
+import { getEnumdicValue, marketid, userid } from "../../../../services/utils"
+import { hideLoading, showLoading } from "../../../../utils/message/index"
+import { isnullstr } from "../../../../utils/util"
+
 Page({
 
   /**
    * 页面的初始数据
    */
-  data: {
+    data: {
+      /// 状态栏高度
+      statusBarHeight: getApp().globalData.statusBarHeight,
+      /// 导航栏高度
+      navHeight: getApp().globalData.navHeight,
+      /// 底部安全区域
+      safeBottom: getApp().globalData.safeBottom,
+      /// 窗口高度
+      windowHeight: getApp().globalData.windowHeight,
+      /// tabs
+      tabs: [{id: 1, name: '预售大厅'}, {id: 2, name: '我的预售'}, {id: 3, name: '我参与的预售'}],
+      /// 是否空数据
+      isEmpty: false,
+      /// 预售大厅/我的预售/集采大厅/我的集采 列表查询
+      perSells: <GuangZuan.GZPreSell[]>[{}],
+      /// 我参与的预售(预售中\执行中)\我参与的集采(集采中\执行中) 列表查询
+      myTradingPreSells: <GuangZuan.GZMyTradingPreSell[]>[{}],
+      /// 显示数据信息
+      values: [{}]
+  },
+
+  /**
+   * 预售大厅/我的预售/集采大厅/我的集采 列表查询
+   * 预售状态 - 1:未开始 2:进行中 3:已结束 4:已关闭 5:处理中 6::处理失败 7:已完成
+   */
+  queryGZPreSell(presalestatus: number) {
+    /// loding
+    showLoading(()=>{
+      /// 数据查询请求
+      queryGZPreSell({
+        data: {
+          presalestatus: presalestatus,
+          marketid: marketid()
+        },
+        success: (res) => {
+          /// 请求失败
+          if (res.code != 200) {
+            /// 加载失败
+            hideLoading(()=>{}, '请求失败,原因:'+res.msg)
+            return
+          }
+          hideLoading(()=>{
+            /// 设置数据
+            this.setData({
+              /// 设置列头
+              perSells: res.data,
+              /// 数据是否为空
+              isEmpty: res.data.length === 0,
+              values: res.data.map(obj => {
+                return {
+                  wrstandardname: isnullstr(obj.wrstandardname),
+                  customername: isnullstr(obj.customername),
+                  status: getEnumdicValue('WRPresaleStatus', obj.presalestatus),
+                  startdate: isnullstr(obj.startdate),
+                  enddate: isnullstr(obj.enddate),
+                  minsuccessqty: obj.minsuccessqty.toFixed(0),
+                  minbuyqty: obj.minbuyqty.toFixed(0),
+                  maxbuyqty: obj.maxbuyqty.toFixed(0),
+                  presaleqty: obj.presaleqty.toFixed(0)+'克拉',
+                  buymarginvalue: (obj.buymarginvalue*100).toFixed(2)+'%',
+                  surplusqty: (obj.presaleqty-obj.placeqty).toFixed(0),
+                  price: '¥'+obj.lastprice.toFixed(2)+'(元/克拉)'
+                }
+              })
+            })
+          })
+        },
+        fail: (emsg) => {
+          hideLoading(()=>{}, emsg)
+        },
+        complete: () => { 
+          /// 停止下拉刷新
+          wx.stopPullDownRefresh()
+        }
+      })
+    }, '加载中....')
+  },
+
+  /**
+   * 我参与的预售(预售中\执行中)\我参与的集采(集采中\执行中) 列表查询
+   * 状态 1:预售中\集采中 2:执行中 3:已完成
+   */
+  queryGZMyTradingPreSell(status: number) {
+    /// loding
+    showLoading(()=>{
+      /// 数据查询请求
+      queryGZMyTradingPreSell({
+        data: {
+          userid: userid(),
+          marketid: marketid(),
+          status: status
+        },
+        success: (res) => {
+          /// 请求失败
+          if (res.code != 200) {
+            /// 加载失败
+            hideLoading(()=>{}, '请求失败,原因:'+res.msg)
+            return
+          }
+          hideLoading(()=>{
+            /// 设置数据
+            this.setData({
+              /// 设置列头
+              myTradingPreSells: res.data,
+              /// 数据是否为空
+              isEmpty: res.data.length === 0,
+              /// 显示数据
+              values: res.data.map(obj => {
+                return {
+                  wrstandardname: isnullstr(obj.wrstandardname),
+                  customername: isnullstr(obj.customername),
+                  tradeamount: obj.tradeamount.toFixed(2),
+                  status: obj.status,
+                  ordertime: isnullstr(obj.ordertime),
+                  freezemargin: obj.freezemargin.toFixed(2),
+                  marginvalue: (obj.marginvalue*100).toFixed(2)+'%',
+                  tradeprice: '¥'+obj.tradeprice.toFixed(2)+'(元/克拉)'
+                }
+              })
+            })
+          })
+        },
+        fail: (emsg) => {
+          hideLoading(()=>{}, emsg)
+        },
+        complete: () => { 
+          /// 停止下拉刷新
+          wx.stopPullDownRefresh()
+        }
+      })
+    }, '加载中....')
+  },
 
+  /**
+   * 返回上层视图
+   */
+  backToParent() {
+    /// 返回上层视图
+    wx.navigateBack()
   },
 
   /**

+ 21 - 1
GuangZuan/miniprogram/mHome/pages/presell/list/index.wxml

@@ -1,2 +1,22 @@
 <!--mHome/pages/presell/list/index.wxml-->
-<text>mHome/pages/presell/list/index.wxml</text>
+<view class="container">
+  <!-- 导航栏 -->
+  <van-nav-bar custom-style="background-color: #407DB8">
+    <van-icon slot="left" name="arrow-left" size="25px" color="#fff" bind:click="backToParent"/>
+    <text slot="title" style="color: #fff;">预售大厅</text>
+  </van-nav-bar>
+
+  <!-- tabs -->
+  <van-tabs swipeable bind:change="onTabChange" color="#2270D9" line-width="20px" title-inactive-color="#333" title-active-color="#407DB8">
+    <van-tab wx:for="{{ tabs }}" wx:for-item="itm" wx:key="id" id="{{ itm.id }}" title="{{ itm.name }}"/>
+  </van-tabs> 
+
+  <!-- 预售大厅/我的预售 -->
+  <van-swipe-cell>
+  </van-swipe-cell>
+</view>
+
+<!-- empty -->
+<van-empty wx:if="{{ isEmpty }}" class="custom-image" description="无数据"/>
+
+

+ 3 - 0
GuangZuan/miniprogram/mHome/pages/purchase/detail/index.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 1 - 0
GuangZuan/miniprogram/mHome/pages/purchase/detail/index.less

@@ -0,0 +1 @@
+/* mHome/pages/purchase/detail/index.wxss */

+ 66 - 0
GuangZuan/miniprogram/mHome/pages/purchase/detail/index.ts

@@ -0,0 +1,66 @@
+// mHome/pages/purchase/detail/index.ts
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+
+  }
+})

+ 2 - 0
GuangZuan/miniprogram/mHome/pages/purchase/detail/index.wxml

@@ -0,0 +1,2 @@
+<!--mHome/pages/purchase/detail/index.wxml-->
+<text>mHome/pages/purchase/detail/index.wxml</text>

+ 4 - 0
GuangZuan/miniprogram/mHome/pages/purchase/list/index.json

@@ -0,0 +1,4 @@
+{
+  "usingComponents": {},
+  "navigationBarTitleText": "集采交易"
+}

+ 1 - 0
GuangZuan/miniprogram/mHome/pages/purchase/list/index.less

@@ -0,0 +1 @@
+/* mHome/pages/purchase/list/index.wxss */

+ 207 - 0
GuangZuan/miniprogram/mHome/pages/purchase/list/index.ts

@@ -0,0 +1,207 @@
+import { queryGZMyTradingPreSell, queryGZPreSell } from "../../../../services/api/orders/index"
+import { marketid, userid } from "../../../../services/utils"
+import { hideLoading, showLoading } from "../../../../utils/message/index"
+import { isnullstr } from "../../../../utils/util"
+
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+      /// 状态栏高度
+      statusBarHeight: getApp().globalData.statusBarHeight,
+      /// 导航栏高度
+      navHeight: getApp().globalData.navHeight,
+      /// 底部安全区域
+      safeBottom: getApp().globalData.safeBottom,
+      /// 窗口高度
+      windowHeight: getApp().globalData.windowHeight,
+      /// tabs
+      tabs: [{id: 1, name: '集采大厅'}, {id: 2, name: '我的集采'}, {id: 3, name: '我参与的集采'}],
+      /// 是否空数据
+    isEmpty: false,
+    /// 预售大厅/我的预售/集采大厅/我的集采 列表查询
+    perSells: <GuangZuan.GZPreSell[]>[{}],
+    /// 我参与的预售(预售中\执行中)\我参与的集采(集采中\执行中) 列表查询
+    myTradingPreSells: <GuangZuan.GZMyTradingPreSell[]>[{}],
+    /// 显示数据信息
+    values: [{}]
+  },
+
+  /**
+   * 预售大厅/我的预售/集采大厅/我的集采 列表查询
+   * 预售状态 - 1:未开始 2:进行中 3:已结束 4:已关闭 5:处理中 6::处理失败 7:已完成
+   */
+  queryGZPreSell(presalestatus: number) {
+    /// loding
+    showLoading(()=>{
+      /// 数据查询请求
+      queryGZPreSell({
+        data: {
+          presalestatus: presalestatus,
+          marketid: marketid()
+        },
+        success: (res) => {
+          /// 请求失败
+          if (res.code != 200) {
+            /// 加载失败
+            hideLoading(()=>{}, '请求失败,原因:'+res.msg)
+            return
+          }
+          hideLoading(()=>{
+            /// 设置数据
+            this.setData({
+              /// 设置列头
+              perSells: res.data,
+              /// 数据是否为空
+              isEmpty: res.data.length === 0,
+              values: res.data.map(obj => {
+                return {
+                  wrstandardname: isnullstr(obj.wrstandardname),
+                  customername: isnullstr(obj.customername),
+                  status: getEnumdicValue('WRPresaleStatus', obj.presalestatus),
+                  startdate: isnullstr(obj.startdate),
+                  enddate: isnullstr(obj.enddate),
+                  minsuccessqty: obj.minsuccessqty.toFixed(0),
+                  minbuyqty: obj.minbuyqty.toFixed(0),
+                  maxbuyqty: obj.maxbuyqty.toFixed(0),
+                  presaleqty: obj.presaleqty.toFixed(0)+'克拉',
+                  buymarginvalue: (obj.buymarginvalue*100).toFixed(2)+'%',
+                  surplusqty: (obj.presaleqty-obj.placeqty).toFixed(0),
+                  price: '¥'+obj.lastprice.toFixed(2)+'(元/克拉)'
+                }
+              })
+            })
+          })
+        },
+        fail: (emsg) => {
+          hideLoading(()=>{}, emsg)
+        },
+        complete: () => { 
+          /// 停止下拉刷新
+          wx.stopPullDownRefresh()
+        }
+      })
+    }, '加载中....')
+  },
+
+  /**
+   * 我参与的预售(预售中\执行中)\我参与的集采(集采中\执行中) 列表查询
+   * 状态 1:预售中\集采中 2:执行中 3:已完成
+   */
+  queryGZMyTradingPreSell(status: number) {
+    /// loding
+    showLoading(()=>{
+      /// 数据查询请求
+      queryGZMyTradingPreSell({
+        data: {
+          userid: userid(),
+          marketid: marketid(),
+          status: status
+        },
+        success: (res) => {
+          /// 请求失败
+          if (res.code != 200) {
+            /// 加载失败
+            hideLoading(()=>{}, '请求失败,原因:'+res.msg)
+            return
+          }
+          hideLoading(()=>{
+            /// 设置数据
+            this.setData({
+              /// 设置列头
+              myTradingPreSells: res.data,
+              /// 数据是否为空
+              isEmpty: res.data.length === 0,
+              /// 显示数据
+              values: res.data.map(obj => {
+                return {
+                  wrstandardname: isnullstr(obj.wrstandardname),
+                  customername: isnullstr(obj.customername),
+                  tradeamount: obj.tradeamount.toFixed(2),
+                  status: obj.status,
+                  ordertime: isnullstr(obj.ordertime),
+                  freezemargin: obj.freezemargin.toFixed(2),
+                  marginvalue: (obj.marginvalue*100).toFixed(2)+'%',
+                  tradeprice: '¥'+obj.tradeprice.toFixed(2)+'(元/克拉)'
+                }
+              })
+            })
+          })
+        },
+        fail: (emsg) => {
+          hideLoading(()=>{}, emsg)
+        },
+        complete: () => { 
+          /// 停止下拉刷新
+          wx.stopPullDownRefresh()
+        }
+      })
+    }, '加载中....')
+  },
+
+  /**
+   * 返回上层视图
+   */
+  backToParent() {
+    /// 返回上层视图
+    wx.navigateBack()
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+
+  }
+})

+ 17 - 0
GuangZuan/miniprogram/mHome/pages/purchase/list/index.wxml

@@ -0,0 +1,17 @@
+<!--mHome/pages/purchase/list/index.wxml-->
+<view class="container">
+  <!-- 导航栏 -->
+  <van-nav-bar custom-style="background-color: #407DB8">
+    <van-icon slot="left" name="arrow-left" size="25px" color="#fff" bind:click="backToParent"/>
+    <text slot="title" style="color: #fff;">集采交易</text>
+  </van-nav-bar>
+
+  <!-- tabs -->
+  <van-tabs swipeable bind:change="onTabChange" color="#2270D9" line-width="20px" title-inactive-color="#333" title-active-color="#407DB8">
+    <van-tab wx:for="{{ tabs }}" wx:for-item="itm" wx:key="id" id="{{ itm.id }}" title="{{ itm.name }}"/>
+  </van-tabs> 
+</view>
+
+<!-- empty -->
+<van-empty wx:if="{{ isEmpty }}" class="custom-image" description="无数据"/>
+

+ 3 - 0
GuangZuan/miniprogram/mHome/pages/purchase/new/index.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 1 - 0
GuangZuan/miniprogram/mHome/pages/purchase/new/index.less

@@ -0,0 +1 @@
+/* mHome/pages/purchase/new/index.wxss */

+ 66 - 0
GuangZuan/miniprogram/mHome/pages/purchase/new/index.ts

@@ -0,0 +1,66 @@
+// mHome/pages/purchase/new/index.ts
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+
+  }
+})

+ 2 - 0
GuangZuan/miniprogram/mHome/pages/purchase/new/index.wxml

@@ -0,0 +1,2 @@
+<!--mHome/pages/purchase/new/index.wxml-->
+<text>mHome/pages/purchase/new/index.wxml</text>

+ 2 - 2
GuangZuan/miniprogram/pages/home/index.ts

@@ -24,8 +24,8 @@ Page({
             {id: 3,  icon: 'home-cjjc',  title: '出境检测',   path: '/mHome/pages/inspection/list/index'}, 
             {id: 4,  icon: 'home-bsfw',  title: '保税服务',   path: '/mHome/pages/bond/list/index'}, 
             {id: 5,  icon: 'home-jjjy',  title: '竞价交易',   path: ''}, 
-            {id: 6, icon: 'home-cnys',  title: '预售大厅',   path: ''}, 
-            {id: 7, icon: 'home-jcjy',  title: '集采交易',   path: ''}, 
+            {id: 6, icon: 'home-cnys',  title: '预售大厅',   path: '/mHome/pages/presell/list/index'}, 
+            {id: 7, icon: 'home-jcjy',  title: '集采交易',   path: '/mHome/pages/purchase/list/index'}, 
             {id: 8,  icon: 'home-zsss',  title: '钻石搜索',   path: '/mHome/pages/search/index'}, 
             {id: 9,  icon: 'home-jsq',   title: '钻石计算器', path: '/mHome/pages/calculator/index'}, 
             {id: 10,  icon: 'home-zscx',  title: '证书查询',   path: '/mHome/pages/cerserach/index'}],

+ 15 - 0
GuangZuan/miniprogram/services/api/orders/index.ts

@@ -147,6 +147,21 @@ export function queryBScOutOrderDetailatt(params: HttpRequest<{req: GuangZuan.BS
   return httpRequest(service.config.goCommonSearchUrl+'/Guangzuan/QueryBScOutOrderDetailatt', 'GET', params)
 }
 
+/* 我的预售认购列表查询 */
+export function queryGZMyPresell(params: HttpRequest<{req: GuangZuan.GZMyPreSellReq, rsp: GuangZuan.GZMyPreSell[]}>) {
+  return httpRequest(service.config.goCommonSearchUrl+'/Guangzuan/QueryGZMyPresell', 'GET', params)
+}
+
+/* 我参与的预售(预售中\执行中)\我参与的集采(集采中\执行中) 列表查询 */
+export function queryGZMyTradingPreSell(params: HttpRequest<{req: GuangZuan.GZMyTradingPreSellReq, rsp: GuangZuan.GZMyTradingPreSell[]}>) {
+  return httpRequest(service.config.goCommonSearchUrl+'/Guangzuan/QueryGZMyTradingPreSell', 'GET', params)
+}
+
+/* 预售大厅/我的预售/集采大厅/我的集采 列表查询 */
+export function queryGZPreSell(params: HttpRequest<{req: GuangZuan.GZPreSellReq, rsp: GuangZuan.GZPreSell[]}>) {
+  return httpRequest(service.config.goCommonSearchUrl+'/Guangzuan/QueryGZPreSell', 'GET', params)
+}
+
 
 
 

+ 23 - 5
GuangZuan/typings/types/model/order.d.ts

@@ -2827,7 +2827,7 @@ declare namespace GuangZuan {
   }
 
   /// 我的预售列表查询
-  interface GZMySellReq {
+  interface GZMyPreSellReq {
     /// 预售申请ID
     presaleapplyid: number	
     /// 页码
@@ -2837,7 +2837,7 @@ declare namespace GuangZuan {
   }
 
   /// 我的预售列表查询
-  interface GZMyTradingPreSell {
+  interface GZMyPreSell {
     /// 企业名称(认购方)
     customername: string	
     /// 冻结保证金
@@ -2874,7 +2874,13 @@ declare namespace GuangZuan {
     bannerpicurl: string
     /// 中签基数
     baseqty: number
-    /// 企业名称(预售方)
+    /// 采购保证金方式
+    buymarginalgorithm: number
+    /// 采购保证金值
+    buymarginvalue: number
+    /// 创建时间\申请时间
+    createtime: string
+    /// 企业名称(预售方\卖方)
     customername: string
     /// 现货品种ID
     deliverygoodsid: number
@@ -2898,13 +2904,19 @@ declare namespace GuangZuan {
     maxbuyqty: number
     /// 单人最大中签量 - 作废
     maxluckyqty: number
+    /// 最小采购单位
+    minbuyqty: number
+    /// 最低成团量
+    minsuccessqty: number
+    /// 履约模板ID
+    performancetemplateid: string
     /// 详情图片(逗号分隔)
     pictureurls: string
     /// 已配售量
     placeqty: number
     /// 预售申请ID(184+Unix秒时间戳(10位)+xxxxxx)
     presaleapplyid: string
-    /// 预售总量
+    /// 预售总量\预售数量
     presaleqty: number
     /// 预售状态 - 1:未开始 2:进行中 3:已结束 4:已关闭 5:处理中 6::处理失败 7:已完成
     presalestatus: number
@@ -2914,6 +2926,10 @@ declare namespace GuangZuan {
     remark: string
     /// 发行方资金账户ID
     sellaccountid: number
+    /// 卖方保证金方式
+    sellmarginalgorithm: number
+    /// 卖方保证金值
+    sellmarginvalue: number
     /// 发行方用户ID
     selluserid: number
     /// 发行方卖委托单ID
@@ -2928,9 +2944,11 @@ declare namespace GuangZuan {
     thumurls: string
     /// 交易日
     tradedate: string
+    /// 成交数量(已预售数量)
+    tradeqty: number
     /// 单位ID
     unitid: number
-    /// 商品单价
+    /// 商品单价\预售价格
     unitprice: number
     /// 仓库ID
     warehouseid: number