Handy_Cao 2 years ago
parent
commit
d6baca7c8d

+ 8 - 0
GuangZuan/miniprogram/mHome/pages/presell/detail/index.ts

@@ -5,7 +5,15 @@ Page({
    * 页面的初始数据
    */
   data: {
+    navTitle: '预售详情'
+  },
 
+   /**
+   * 返回上层视图
+   */
+  backToParent() {
+    /// 返回上层视图
+    wx.navigateBack()
   },
 
   /**

+ 8 - 1
GuangZuan/miniprogram/mHome/pages/presell/detail/index.wxml

@@ -1,2 +1,9 @@
 <!--mHome/pages/presell/detail/index.wxml-->
-<text>mHome/pages/presell/detail/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;">{{ navTitle }}</text>
+  </van-nav-bar>
+
+</view>

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

@@ -1,4 +1,7 @@
 {
-  "usingComponents": {},
+  "usingComponents": {
+    "van-radio": "@vant/weapp/radio/index",
+    "van-radio-group": "@vant/weapp/radio-group/index"
+  },
   "navigationBarTitleText": "预售大厅"
 }

+ 18 - 1
GuangZuan/miniprogram/mHome/pages/presell/list/index.less

@@ -1 +1,18 @@
-/* mHome/pages/presell/list/index.wxss */
+/* mHome/pages/presell/list/index.wxss */
+.tab-view {
+  display: flex;
+  flex-direction: column;
+
+  .filter-view {
+    display: flex;
+    flex-direction: row;
+    justify-content: space-between;
+    align-items: center;
+    align-content: center;
+    padding: 0px 10px;
+
+    van-tabs {
+      width: 100%;
+    }
+  }
+}

+ 43 - 3
GuangZuan/miniprogram/mHome/pages/presell/list/index.ts

@@ -19,6 +19,12 @@ Page({
       windowHeight: getApp().globalData.windowHeight,
       /// tabs
       tabs: [{id: 1, name: '预售大厅'}, {id: 2, name: '我的预售'}, {id: 3, name: '我参与的预售'}],
+      /// subtabs
+      subtabs: [{id: 1, name: '执行中'}, {id: 2, name: '未开始'}],
+      /// 类别
+      active: 0,
+      /// 状态
+      status: 1,
       /// 是否空数据
       isEmpty: false,
       /// 预售大厅/我的预售/集采大厅/我的集采 列表查询
@@ -117,7 +123,6 @@ Page({
               /// 显示数据
               values: res.data.map(obj => {
                 return {
-                  wrstandardname: isnullstr(obj.wrstandardname),
                   customername: isnullstr(obj.customername),
                   tradeamount: obj.tradeamount.toFixed(2),
                   status: obj.status,
@@ -150,10 +155,45 @@ Page({
   },
 
   /**
+   * 预售申请
+   */ 
+  addPreSell() {
+    wx.navigateTo({
+      url: '/mHome/pages/presell/new/index'
+    })
+  },
+
+  /**
+   * 预售申请
+   */
+  onTabChange(e: any) {
+    /// 重置状态
+    this.setData({ status: 1, active: e.detail.index })
+    if (e.target.id === "category") {
+      /// 数据重置
+      switch (e.detail.index) {
+        case 0: /// 预售大厅
+          this.setData({ subtabs: [{id: 1, name: '执行中'}, {id: 2, name: '未开始'}] })
+          break;
+        case 1: /// 我的预售
+          this.setData({ subtabs: [{id: 1, name: '执行中'}, {id: 2, name: '未开始'}, {id: 3, name: '已结束'}] })
+          break;
+        default: /// 我参与的预售
+          this.setData({ subtabs: [{id: 1, name: '预售中'}, {id: 2, name: '执行中'}, {id: 3, name: '已完成'}] })
+          break;
+      }
+      
+    } else {
+      this.setData({ status: e.detail.index+1 })
+    }
+    this.data.active != 2 ?  this.queryGZPreSell(this.data.status) : this.queryGZMyTradingPreSell(this.data.status)
+  },
+
+  /**
    * 生命周期函数--监听页面加载
    */
   onLoad() {
-
+    this.data.active != 2 ?  this.queryGZPreSell(this.data.status) : this.queryGZMyTradingPreSell(this.data.status)
   },
 
   /**
@@ -188,7 +228,7 @@ Page({
    * 页面相关事件处理函数--监听用户下拉动作
    */
   onPullDownRefresh() {
-
+    this.data.active != 2 ?  this.queryGZPreSell(this.data.status) : this.queryGZMyTradingPreSell(this.data.status)
   },
 
   /**

+ 12 - 7
GuangZuan/miniprogram/mHome/pages/presell/list/index.wxml

@@ -6,14 +6,19 @@
     <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 class="tab-view" style="position: sticky; top: 0; z-index: 999;">
+    <!-- tabs -->
+    <van-tabs id="category" active="{{ active }}" 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 class="filter-view">
+      <van-tabs id="subCategory" active="{{ status-1 }}" bind:change="onTabChange" line-height="0px"	title-inactive-color="#333" title-active-color="#DC203D">
+        <van-tab wx:for="{{ subtabs }}" wx:for-item="itm" wx:key="id" id="{{ itm.id }}" title="{{ itm.name }}"/>
+      </van-tabs>
+      <van-icon name="add-o" size="25px" color="#387BDC" bind:click="addPreSell"/>
+    </view>
+  </view> 
 </view>
 
 <!-- empty -->

+ 9 - 1
GuangZuan/miniprogram/mHome/pages/presell/new/index.json

@@ -1,3 +1,11 @@
 {
-  "usingComponents": {}
+  "usingComponents": {
+    "van-dropdown-menu": "@vant/weapp/dropdown-menu/index",
+  "van-dropdown-item": "@vant/weapp/dropdown-item/index",
+    "van-picker": "@vant/weapp/picker/index",
+    "van-uploader": "@vant/weapp/uploader/index",
+    "van-calendar": "@vant/weapp/calendar/index",
+    "van-popup": "@vant/weapp/popup/index"
+  },
+  "navigationStyle": "custom"
 }

+ 141 - 1
GuangZuan/miniprogram/mHome/pages/presell/new/index.less

@@ -1 +1,141 @@
-/* mHome/pages/presell/new/index.wxss */
+/* mHome/pages/presell/new/index.wxss */
+
+.container {
+
+  .sub-title {
+    font-size: 20px;
+    color: #333;
+    text-align: left;
+    font-weight: bold;
+  }
+
+  .cell-item {
+    display: flex;
+    flex-direction: row;
+    justify-content: space-between;
+    align-content: center;
+    align-items: center;
+    
+    .unit {
+      font-size: 14px;
+      color: #666;
+      padding-right: 10px;
+    }
+  }
+
+  .prestyle {
+    display: flex;
+    flex-direction: row;
+    align-items: center;
+    align-content: center;
+    justify-content: center;
+    width: 100%;
+    padding-left: 10px;
+
+    .content__item__step {
+      display: flex;
+      flex-direction: row;
+      justify-content: start;
+      align-items: center;
+      align-content: center;
+      width: 100%;
+
+      &__item {
+        display: flex;
+        flex-direction: column;
+        align-items: center;
+        align-content: center;
+        margin-bottom: 5px;
+
+        text {
+          font-size: 12px;
+          padding: 2.5px 5px;
+          text-align: center;
+        }
+      }
+    }
+
+    .plantmp {
+      color: #333;
+      font-size: 14px;
+      width: 100%;
+      height: 30px;
+    }
+  }
+
+  .credentials-info {
+    display: flex;
+    flex-direction: row;
+    justify-content: start;
+    align-content: center;
+    align-items: center;
+    margin-bottom: 10px;
+    width: 95%;
+
+    text:nth-child(1) {
+      width: 80px;
+      color: #333;
+      font-size: 14px;
+    }
+
+    text:nth-child(2) {
+      width: 100%;
+      color: #333;
+      font-size: 14px;
+      margin-left: 15px;
+    }
+
+    textarea {
+      border: 1px solid #f0f0f0;
+      border-radius: 10px;
+      color: #333;
+      padding: 10px;
+      margin-right: 5px;
+      font-size: 14px;
+    }
+
+    .credentials-top-view {
+      display: flex;
+      flex-direction: column;
+      width: 80%;
+      height: 120px;
+      border-radius: 10px;
+
+      .value {
+        width: 100%;
+        height: 30px;
+        color: #888;
+      }
+
+      .upload {
+        padding-top: 10px 0px 0px 0px;
+        display: flex;
+        justify-content: left;
+        align-items: center;
+      }
+    }
+  }
+
+  .way-view {
+    display: flex;
+    flex-direction: row;
+    justify-content: flex-start;
+    align-items: center;
+    align-content: center;
+
+    &__title {
+      width: 105px;
+    }
+  }
+
+  .button-view {
+    display: flex;
+    justify-content: space-between;
+    margin: 10px 10px 10px 10px;
+  
+    van-button {
+      width: 48%;
+      height: 40px;
+    }
+  }
+}

+ 152 - 2
GuangZuan/miniprogram/mHome/pages/presell/new/index.ts

@@ -1,18 +1,168 @@
-// mHome/pages/presell/new/index.ts
+import { queryPermancePlanTmp } from "../../../../services/api/orders/index"
+import { marketid } from "../../../../services/utils"
+import { hideLoading, showLoading, showToast } from "../../../../utils/message/index"
+import services from "../../../../services/index"
+import { formatDate } from "../../../../utils/util"
+
 Page({
 
   /**
    * 页面的初始数据
    */
   data: {
+    /// 底部安全区域
+    safeBottom: getApp().globalData.safeBottom,
+    /// 履约模板信息
+    tmps: <GuangZuan.PermancePlanTmp[]>[],
+    /// 选中履约模板
+    tmp: <GuangZuan.PermancePlanTmp>({}),
+    /// 是否显示
+    show: false,
+    /// 是否显示日历
+    showCal: false,
+    /// 颜色
+    tcolors: ['rebeccapurple', 'green', 'hotpink', 'orange', 'darkgoldenrod'],
+    /// 最小日期
+    minDate: new Date(2010, 10, 1).getTime(),
+    /// 是否开始日期
+    isstart: true,
+    /// 开始日期
+    startdate: formatDate(new Date()),
+    /// 结束日期
+    enddate: formatDate(new Date()),
+    /// 文件上传列表
+    fileList: [],
+    /// 上传的文件路径
+    filePath: '',
+    /// 生产方式条件
+    options: [{ text: 'HPHT', value: 0 }, { text: 'CVD', value: 1 }],
+    /// 生产方式
+    way: 0
+  },
+
+   /**
+   * 返回上层视图
+   */
+  backToParent() {
+    /// 返回上层视图
+    wx.navigateBack()
+  },
+
+   /**
+   * 按钮点击响应事件
+   */
+  onButtonClick(e: any) {
+    switch (e.target.id) {
+      case 'startdate':  /// 开始日期
+        this.setData({ showCal: true, isstart: true })
+        break;
+      case 'enddate':   /// 结束日期
+        this.setData({ showCal: true, isstart: false })
+        break
+      default:
+        break;
+    }
+  },
+
+  /// 日期确定触发
+  onConfirm(e: any) {
+    this.setData({ showCal: false })
+    /// 开始日期
+    if (this.data.isstart) {
+      this.setData({
+        startdate: formatDate(e.detail)
+      })
+    } else {
+      this.setData({
+        enddate: formatDate(e.detail)
+      })
+    }
+  },
+
+  /// 日期关闭触发
+  onCloseCal() {
+    this.setData({ showCal: false })
+  },
 
+  /// 显示履约模板
+  showPlanTmps() {
+    this.setData({ show: true })
+  },
+
+  /// 关闭
+  onClose() {
+    this.setData({ show: false })
+  },
+
+  onSelect(e: any) {
+    /// 默认显示项
+    const { index } = e.detail;
+    this.setData({ tmp: this.data.tmps[index], show: false })
+  },
+
+  /// 删除图片
+  deleteImage(e: any) {
+    const {index} = e.detail.index
+    // 上传完成需要更新 fileList
+    const { fileList = [] } = this.data;
+    fileList.splice(index, 1)
+    this.setData({ fileList });
+  },
+
+  /// 照片上传
+  afterRead(e: any) {
+    const { file } = e.detail;
+    // 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
+    wx.uploadFile({
+      url: services.config.uploadUrl,
+      filePath: file.url,
+      name: 'file',
+      formData: { user: 'test' },
+      success: (res) => {
+        if (res.statusCode != 200) {
+          showToast('图片上传失败,原因:'+res.errMsg)
+          return
+        }
+        // 上传完成需要更新 fileList
+        const { fileList = [] } = this.data;
+        fileList.push({ ...file, url: res.data});
+        this.setData({ fileList });
+        /// 设置文件路径
+        this.setData({ filePath: JSON.parse(res.data)[0].filePath })
+      },
+    });
+  },
+
+  /// 获取履约模板信息
+  queryPermancePlanTmp() {
+    /// showLoading
+    showLoading(() => {
+      queryPermancePlanTmp({
+        data: {
+          marketid: marketid()
+        },
+        success: (res) => {
+          /// 获取数据
+          this.setData({ 
+            tmps: res.data,
+            tmp: res.data[0],
+            actions: res.data.map(obj => { return obj.templatename })
+           })
+        },
+        complete: () => {
+          /// hideLoading
+          hideLoading()
+        }
+      })
+    })
   },
 
   /**
    * 生命周期函数--监听页面加载
    */
   onLoad() {
-
+    /// 获取履约模板信息
+    this.queryPermancePlanTmp()
   },
 
   /**

+ 102 - 1
GuangZuan/miniprogram/mHome/pages/presell/new/index.wxml

@@ -1,2 +1,103 @@
 <!--mHome/pages/presell/new/index.wxml-->
-<text>mHome/pages/presell/new/index.wxml</text>
+<view class="container" style="padding-bottom: {{ safeBottom }}px;">
+  <view class="nav-view" style="position: sticky; top: 0; z-index: 999;">
+    <!-- 导航栏 -->
+    <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>
+  </view>
+  
+  <van-cell-group>
+    <van-cell><view solt="title" class="sub-title">预售信息</view></van-cell>
+    <view class="cell-item">
+      <van-field label="商品名称:" size="large" required clearable value="{{ zscolor }}" placeholder="请输入商品名称" border="{{ false }}" bind:change="onChange" />
+    </view>
+    <view class="cell-item">
+      <van-field label="预售总量:" size="large" required clearable value="{{ zsclarity }}" placeholder="请输入预售总量" border="{{ false }}" bind:change="onChange" />
+      <view class="unit">(克拉)</view>
+    </view>
+    <view class="cell-item">
+      <van-field label="预售价格:" size="large" required clearable value="{{ zssize }}" placeholder="请输入预售价格" border="{{ false }}" bind:change="onChange" />
+      <view class="unit">(元/克拉)</view>
+    </view>
+    <view class="cell-item">
+      <van-field label="最小采购单位:" size="large" required clearable value="{{ zscolor }}" placeholder="请输入最小采购单位" border="{{ false }}" bind:change="onChange" />
+      <view class="unit">(克拉)</view>
+    </view>
+    <view class="cell-item">
+      <van-field label="最大采购单位:" size="large" required clearable value="{{ zscolor }}" placeholder="请输入最大采购单位" border="{{ false }}" bind:change="onChange" />
+      <view class="unit">(克拉)</view>
+    </view>
+    <view class="cell-item">
+      <van-field label="最低成团量:" size="large" required clearable value="{{ zscolor }}" placeholder="请输入最低成团量" border="{{ false }}" bind:change="onChange" />
+      <view class="unit">(克拉)</view>
+    </view>
+    <view class="cell-item">
+      <van-field label="采购保证金比例:" size="large" required readonly clearable value="{{ zscolor }}" placeholder="请输入采购保证金比例" border="{{ false }}" bind:change="onChange" />
+      <view class="unit">%</view>
+    </view>
+    <view class="cell-item">
+      <van-field id="startdate" label="开始日期:" size="large" required readonly clearable value="{{ startdate }}" placeholder="请选择开始日期" border="{{ false }}" bind:click-input	="onButtonClick" />
+    </view>
+    <view class="cell-item">
+      <van-field id="enddate" label="结束日期:" size="large" required readonly clearable value="{{ enddate }}" placeholder="请选择结束日期" border="{{ false }}" bind:click-input	="onButtonClick" />
+    </view>
+    <view class="cell-item">
+      <van-field label="履约方式:" size="large" required readonly clearable value="{{ tmp.templatename }}" border="{{ false }}" bind:click-input="showPlanTmps" />
+      <view class="unit"><van-icon name="arrow"></van-icon></view>
+    </view>
+    <view class="content prestyle">
+      <view class="content__item__step">
+        <view class="content__item__step__item" wx:for="{{ tmp.LstStep }}" wx:for-item="itm" wx:for-index="idx" wx:key="idx"> 
+          <text style="background-color: {{ tcolors[idx] }}; color: white;">{{ itm.stepinfo }}</text>
+          <text>{{ itm.stepdate }}</text>
+        </view>
+      </view>
+    </view>
+  </van-cell-group>
+
+  <van-cell-group>
+    <van-cell><view solt="title" class="sub-title">钻石参考信息</view></van-cell>
+    <van-field label="颜色:" size="large" clearable value="{{ zscolor }}" placeholder="请输入颜色" border="{{ false }}" bind:change="onChange" />
+    <van-field label="净度:" size="large" clearable value="{{ zsclarity }}" placeholder="请输入净度" border="{{ false }}" bind:change="onChange" />
+    <van-field label="尺寸:" size="large" clearable value="{{ zssize }}" placeholder="请输入尺寸" border="{{ false }}" bind:change="onChange" />
+    <van-field label="成品率:" size="large" clearable value="{{ zscolor }}" placeholder="请输入成品率" border="{{ false }}" bind:change="onChange" />
+    <van-field label="重量描述:" size="large" clearable value="{{ zscolor }}" placeholder="请输入重量描述" border="{{ false }}" bind:change="onChange" />
+    <van-field label="数量描述:" size="large" clearable value="{{ zscolor }}" placeholder="请输入数量描述" border="{{ false }}" bind:change="onChange" />
+    <van-field label="生产方式:" size="large" readonly clearable value="{{ zscolor }}" placeholder="请选择生产方式" border="{{ false }}" bind:change="onChange" />
+    <van-cell size="large">
+      <view solt="title" class="way-view">
+        <view class="way-view__title" style="font-size: 16px; color: #666; text-align: left;">生产方式:</view>
+        <van-dropdown-menu>
+          <van-dropdown-item value="{{ way }}" options="{{ options }}" />
+        </van-dropdown-menu>
+      </view>
+    </van-cell>
+    <!-- 凭证 -->
+    <view class="credentials-info" style="padding-top: 10px;">
+      <text style="padding-left: 15px; font-size: 15px; width: 130px;">*附件</text>
+      <view class="credentials-top-view">
+        <text class="value">请上传相关图片</text>
+        <!-- 凭证图片 -->
+        <view class="upload"><van-uploader max-count="6" deletable="{{ true }}" file-list="{{ fileList }}" bind:after-read="afterRead" bind:delete="deleteImage" /></view> 
+      </view>
+    </view>
+    <van-field label="备注:" size="large" type="textarea" autosize maxlength="200" clearable value="{{ zscolor }}" placeholder="请选择请输入备注信息" border="{{ false }}" bind:change="onChange" />
+  </van-cell-group>
+
+  <!-- 操作按钮 -->
+  <view class="button-view">
+    <van-button custom-class="cancel" round bind:click="backToParent" block color="linear-gradient(to right, #999, #aaa)">取消</van-button>
+    <van-button custom-class="submit" round bind:click="onButtonClick" block color="linear-gradient(to right, #4bb0ff, #D91D34)">提交申请</van-button>
+  </view>
+</view>
+
+<!-- toast -->
+<van-toast id="van-toast"/>
+<!-- 履约模板 -->
+<van-popup show="{{ show }}" position="bottom" custom-style="height: 30%"  bind:click-overlay="onClose">
+  <van-picker show-toolbar bind:confirm="onSelect" bind:cancel="onClose" columns="{{ actions }}" title="请选择履约模板" />
+</van-popup>
+<!-- 选择日期 -->  
+<van-calendar show="{{ showCal }}" min-date="{{ minDate }}" bind:close="onCloseCal" bind:confirm="onConfirm" />

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

@@ -5,7 +5,15 @@ Page({
    * 页面的初始数据
    */
   data: {
+    navTitle: '集采详情'
+  },
 
+   /**
+   * 返回上层视图
+   */
+  backToParent() {
+    /// 返回上层视图
+    wx.navigateBack()
   },
 
   /**

+ 7 - 1
GuangZuan/miniprogram/mHome/pages/purchase/detail/index.wxml

@@ -1,2 +1,8 @@
 <!--mHome/pages/purchase/detail/index.wxml-->
-<text>mHome/pages/purchase/detail/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;">{{ navTitle }}</text>
+  </van-nav-bar>
+</view>

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

@@ -1 +1,21 @@
-/* mHome/pages/purchase/list/index.wxss */
+/* mHome/pages/purchase/list/index.wxss */
+
+.container {
+  .tab-view {
+    display: flex;
+    flex-direction: column;
+  
+    .filter-view {
+      display: flex;
+      flex-direction: row;
+      justify-content: space-between;
+      align-items: center;
+      align-content: center;
+      padding: 0px 10px;
+  
+      van-tabs {
+        width: 100%;
+      }
+    }
+  }
+}

+ 42 - 3
GuangZuan/miniprogram/mHome/pages/purchase/list/index.ts

@@ -19,6 +19,12 @@ Page({
       windowHeight: getApp().globalData.windowHeight,
       /// tabs
       tabs: [{id: 1, name: '集采大厅'}, {id: 2, name: '我的集采'}, {id: 3, name: '我参与的集采'}],
+      /// subtabs
+      subtabs: [{id: 1, name: '执行中'}, {id: 2, name: '未开始'}],
+      /// 类别
+      active: 0,
+      /// 状态
+      status: 1,
       /// 是否空数据
       isEmpty: false,
       /// 预售大厅/我的预售/集采大厅/我的集采 列表查询
@@ -117,7 +123,6 @@ Page({
               /// 显示数据
               values: res.data.map(obj => {
                 return {
-                  wrstandardname: isnullstr(obj.wrstandardname),
                   customername: isnullstr(obj.customername),
                   tradeamount: obj.tradeamount.toFixed(2),
                   status: obj.status,
@@ -150,10 +155,44 @@ Page({
   },
 
   /**
+   * 集采申请
+   */ 
+  addPurchase() {
+    wx.navigateTo({
+      url: '/mHome/pages/purchase/new/index'
+    })
+  },
+
+  /**
+   * 预售申请
+   */
+  onTabChange(e: any) {
+    if (e.target.id === "category") {
+      /// 重置状态
+      this.setData({ status: 1, active: e.detail.index })
+      /// 数据重置
+      switch (e.detail.index) {
+        case 0: /// 预售大厅
+          this.setData({ subtabs: [{id: 1, name: '执行中'}, {id: 2, name: '未开始'}] })
+          break;
+        case 1: /// 我的预售
+          this.setData({ subtabs: [{id: 1, name: '执行中'}, {id: 2, name: '未开始'}, {id: 3, name: '已结束'}] })
+          break;
+        default: /// 我参与的预售
+          this.setData({ subtabs: [{id: 1, name: '预售中'}, {id: 2, name: '执行中'}, {id: 3, name: '已完成'}] })
+          break;
+      }
+    } else {
+      this.setData({ status: e.detail.index+1 })
+    }
+    this.data.active != 2 ?  this.queryGZPreSell(this.data.status) : this.queryGZMyTradingPreSell(this.data.status)
+  },
+
+  /**
    * 生命周期函数--监听页面加载
    */
   onLoad() {
-
+    this.data.active != 2 ?  this.queryGZPreSell(this.data.status) : this.queryGZMyTradingPreSell(this.data.status)
   },
 
   /**
@@ -188,7 +227,7 @@ Page({
    * 页面相关事件处理函数--监听用户下拉动作
    */
   onPullDownRefresh() {
-
+    this.data.active != 2 ?  this.queryGZPreSell(this.data.status) : this.queryGZMyTradingPreSell(this.data.status)
   },
 
   /**

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

@@ -6,10 +6,19 @@
     <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 class="tab-view" style="position: sticky; top: 0; z-index: 999;">
+    <!-- tabs -->
+    <van-tabs id="category" active="{{ active }}" 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 class="filter-view">
+      <van-tabs id="subCategory" active="{{ status-1 }}" bind:change="onTabChange" line-height="0px"	title-inactive-color="#333" title-active-color="#DC203D">
+        <van-tab wx:for="{{ subtabs }}" wx:for-item="itm" wx:key="id" id="{{ itm.id }}" title="{{ itm.name }}"/>
+      </van-tabs>
+      <van-icon name="add-o" size="25px" color="#387BDC" bind:click="addPreSell"/>
+    </view>
+  </view> 
 </view>
 
 <!-- empty -->

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

@@ -8,6 +8,14 @@ Page({
 
   },
 
+   /**
+   * 返回上层视图
+   */
+  backToParent() {
+    /// 返回上层视图
+    wx.navigateBack()
+  },
+
   /**
    * 生命周期函数--监听页面加载
    */

+ 8 - 1
GuangZuan/miniprogram/mHome/pages/purchase/new/index.wxml

@@ -1,2 +1,9 @@
 <!--mHome/pages/purchase/new/index.wxml-->
-<text>mHome/pages/purchase/new/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>
+
+</view>

+ 1 - 1
GuangZuan/miniprogram/mMine/pages/invoice/list/index.less

@@ -34,7 +34,7 @@
 
   text {
     color: #333;
-    font-size: 16px;
+    font-size: 13px;
     text-align: left;
   }
 }

+ 6 - 6
GuangZuan/miniprogram/mMine/pages/myperformance/breach/index.wxml

@@ -19,13 +19,13 @@
 
   <!-- 凭证 -->
   <view class="credentials-info">
-      <text>*附件</text>
-      <view class="credentials-top-view">
-        <text class="value">请上传相关截图</text>
-        <!-- 凭证图片 -->
-        <view class="upload"><van-uploader max-count="1" deletable="{{true}}" file-list="{{ fileList }}" bind:after-read="afterRead" bind:delete="deleteImage" /></view> 
-      </view>
+    <text>*附件</text>
+    <view class="credentials-top-view">
+      <text class="value">请上传相关截图</text>
+      <!-- 凭证图片 -->
+      <view class="upload"><van-uploader max-count="1" deletable="{{ true }}" file-list="{{ fileList }}" bind:after-read="afterRead" bind:delete="deleteImage" /></view> 
     </view>
+  </view>
 
   <!-- 按钮 -->
   <view class="button-view">

+ 5 - 8
GuangZuan/miniprogram/pages/trade/index.ts

@@ -24,16 +24,15 @@ Page({
     /// tabs
     tabs: [{id: 1, name: '出售大厅'}, {id: 2, name: '求购大厅'}],
     /// 功能菜单
-    menus: [{id: "listing-buy", icon: appConfig.imgUrl+'trade-listingbuy', title: '求购', path: '/mTrade/pages/listingbuy/index'}, 
+    menus: [{id: "listing-buy",  icon: appConfig.imgUrl+'trade-listingbuy',  title: '求购', path: '/mTrade/pages/listingbuy/index'}, 
             {id: "listing-sell", icon: appConfig.imgUrl+'trade-listingsell', title: '出售', path: '/mTrade/pages/listingsell/index'},
-            {id: "search", icon: appConfig.imgUrl+'trade-search', title: '筛选', path: '/mHome/pages/search/index'}],
+            {id: "search",       icon: appConfig.imgUrl+'trade-search',      title: '筛选', path: '/mHome/pages/search/index'}],
     /// tab索引
     active: 0,
     /// 钻石分类
-    categorys: [{ text: '分类', value: 0 },
-                { text: '单颗裸钻', value: 2 },
+    categorys: [{ text: '单颗裸钻', value: 2 },
                 { text: '单颗彩钻', value: 5 }],
-    category: 0,
+    category: 2,
     /// 钻石形状
     shapes: [{ value: 0, text: '形状' }],
     shape: 0,
@@ -100,9 +99,7 @@ Page({
         })
         break;
       case 'delisting':     /// 摘牌
-        wx.navigateTo({
-          url: '/mTrade/pages/delistingsell/index?item='+JSON.stringify(this.data.askOrders[index])
-        })
+        wx.navigateTo({ url: '/mTrade/pages/delistingsell/index?item='+JSON.stringify(this.data.askOrders[index])})
         break;
       case 'listing-buy':  /// 我要求购
         wx.navigateTo({ url: '/mTrade/pages/listingbuy/index' })

+ 13 - 1
GuangZuan/project.private.config.json

@@ -6,5 +6,17 @@
     "urlCheck": false
   },
   "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
-  "condition": {}
+  "condition": {
+    "miniprogram": {
+      "list": [
+        {
+          "name": "预售申请",
+          "pathName": "mHome/pages/presell/new/index",
+          "query": "",
+          "launchMode": "default",
+          "scene": null
+        }
+      ]
+    }
+  }
 }