Browse Source

Merge branch '套餐活动' into 莱斯奥/2.5.0

xiaohaizhao 1 year ago
parent
commit
4eab397461

+ 2 - 1
app.json

@@ -56,7 +56,8 @@
         "dispatchBill/sentandback",
         "activity/selectProduct/cart/index",
         "target/index",
-        "favorites/index"
+        "favorites/index",
+        "activity/bindingProduct/index"
       ]
     },
     {

+ 399 - 0
packageA/activity/bindingProduct/index.js

@@ -0,0 +1,399 @@
+import currency from "../../../utils/currency";
+const _Http = getApp().globalData.http,
+  file = require("../../../utils/FormatTheAttachment"),
+  {
+    getItem
+  } = require("../selectProduct/calculatePrice");
+import {
+  getCustomText
+} from "../../../utils/customItemType";
+
+Page({
+  data: {
+    loading: true,
+    params: {}, //请求体
+    result: [], //返回结果
+    idname: "itemid", //idkey
+    showName: "itemname",
+    newPrice: "price",
+    oldPrice: "oldprice",
+    resultList: [],
+    sa_brandid: null,
+    privacyFieldC: [],
+    packageList: [],
+    condition: "",
+    searchList: [],
+    dialogShow: false,
+    submitQty: 1,
+    packagetypemxrows: [],
+    modification: false, //是否为修改套餐数量
+  },
+  onLoad(options) {
+    if (options.params) {
+      let params = JSON.parse(options.params);
+      if (!params.content.pageNumber || !params.content.pageTotal) {
+        params.content.pageNumber = 1;
+        params.content.pageTotal = 1;
+      }
+      _Http.basic({
+        "classname": "sysmanage.develop.optiontype.optiontype",
+        "method": "optiontypeselect",
+        "content": {
+          "typename": "package"
+        }
+      }).then(res => {
+        console.log('套餐分类', res)
+        if (res.msg != '成功') return wx.showToast({
+          title: res.msg,
+          icon: "none"
+        })
+        let packageList = []
+        try {
+          let packagetypemxrows = [];
+
+          if (options.packagetypemxrows) {
+            this.data.packagetypemxrows = JSON.parse(options.packagetypemxrows);
+            packagetypemxrows = this.data.packagetypemxrows.map(v => v.packagetypemx);
+          }
+          packageList = res.data.find(v => v.value == params.content.packagetype).subvalues;
+          if (packagetypemxrows.length != 0) {
+            if (options.butText == '调整套数') {
+              packageList = packagetypemxrows
+              this.setData({
+                "submitQty": this.data.packagetypemxrows[0].packagetypeqty
+              })
+            } else {
+              packageList = packageList.filter(v => !packagetypemxrows.includes(v))
+            }
+          }
+        } catch (error) {
+          console.error("error", error)
+        }
+        let getListPa = "";
+        if (options.getListPa) {
+          getListPa = JSON.parse(options.getListPa);
+          getListPa.content.pageNumber = 1;
+          getListPa.content.pageSize = 9999;
+          getListPa.content.onlyquery = 1;
+          getListPa.content.where = {
+            packagetypemx: ''
+          }
+          delete getListPa.content.pageTotal;
+        }
+        if (packageList.length) params.content.where.packagetypemx = packageList[0]
+        this.setData({
+          params,
+          getListPa,
+          butText: options.butText || '生成订单',
+          packageList
+        });
+        this.getList()
+        this.selectComponent("#ListBox").setHeight(".search", this);
+      })
+      this.setData({
+        params,
+        butText: options.butText || '生成订单'
+      });
+    };
+    try {
+      let privacyFieldC = wx.getStorageSync('auth').wdiscounts.forms.wdiscounts.formcols.map(v => v.title);
+      this.setData({
+        privacyFieldC
+      })
+    } catch (error) {
+      console.error(error)
+    }
+    this.setData({
+      idname: options.idname || this.data.idname
+    });
+  },
+  customization(e) {
+    let {
+      item
+    } = e.target.dataset;
+    this.bindChangeFun();
+    if (item) this.selectComponent("#Custom").onClick(item)
+  },
+  bindChangeFun() {
+    getApp().globalData.customizedProduct = function (item, custom) {
+      item = getItem(getItem(Object.assign(item, custom)), 'newOldPrice', 'oldprice');
+      item.customText = getCustomText(item);
+      return new Promise((resolve) => {
+        let index = this.data.list.findIndex(v => v.itemid == item.itemid),
+          i = this.data.searchList.findIndex(v => v.itemid == item.itemid);
+        item.CompleteCustomization = true;
+        if (index != -1) this.setData({
+          [`list[${index}]`]: item
+        })
+        if (i != -1) this.setData({
+          [`searchList[${i}]`]: item,
+        })
+        resolve(true)
+      })
+    }.bind(this)
+  },
+  async getList(init = false) {
+    //init 用于初始化分页
+    if (init.detail != undefined) init = init.detail;
+    let params = this.data.params;
+    if (init) params.content.pageNumber = 1
+    params.content.pageSize = 9999;
+    if (params.content.pageNumber > params.content.pageTotal) return;
+    let res = {},
+      CompleteCustomization = false,
+      modification = false;
+    if (params.content.where.packagetypemx == '') return this.setData({
+      loading: false
+    })
+    wx.showLoading({
+      title: '加载中...',
+      mask: true
+    })
+    if (this.data.getListPa) {
+      this.data.getListPa.content.where.packagetypemx = params.content.where.packagetypemx;
+      res = await _Http.basic(this.data.getListPa);
+      CompleteCustomization = true;
+      modification = true;
+      if (!res.data.length) {
+        res = await _Http.basic(params);
+        CompleteCustomization = false;
+        modification = false;
+      }
+    } else {
+      res = await _Http.basic(params);
+    }
+    wx.hideLoading()
+    console.log("选择产品列表", res)
+    this.selectComponent('#ListBox').RefreshToComplete();
+    this.selectComponent("#ListBox").setHeight(".search", this);
+    if (res.msg != '成功') return wx.showToast({
+      title: res.msg,
+      icon: "none"
+    })
+    const CNY = num => currency(num, {
+      symbol: "¥",
+      precision: 2
+    }).format();
+    let newPrice = this.data.newPrice,
+      oldPrice = this.data.oldPrice;
+    res.data = res.data.map(value => {
+      if (value.attinfos.length != 0) {
+        value.attinfos = file.fileList(value.attinfos)
+        let image = value.attinfos.find(v => v.fileType == "image");
+        if (image) {
+          try {
+            value.cover = image.subfiles.find(v => v.type == "thumbnail").url;
+          } catch (error) {
+            value.cover = image.url;
+          }
+        }
+      }
+      if (value.islimit == 0) value.groupqty = 0;
+      if (newPrice) value.newPrice = CNY(value[newPrice] || 0);
+      if (oldPrice) value.oldPrice = CNY(value[oldPrice] || 0);
+      //value.orderminqty = value.packageqty || value.orderminqty; 起订量优先取包装数量
+      if (!value.saledqty) value.saledqty = 0;
+      value.maxQty = value.groupqty == 0 ? "" : value.groupqty - value.saledqty; //有限购 设置最高可订购数量
+      value.qty = value.orderminqty;
+      if (value.iscustomsize) {
+        value.customText = getCustomText(value);
+        value.CompleteCustomization = CompleteCustomization;
+      }
+      return value;
+    })
+    this.setData({
+      'params.content.pageNumber': res.pageNumber + 1,
+      'params.content.pageTotal': res.pageTotal,
+      'params.content.total': res.total,
+      modification,
+      list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
+      loading: false
+    })
+    this.handleSearch()
+  },
+  tabsChange(e) {
+    this.setData({
+      "params.content.where.packagetypemx": e.detail.name
+    })
+    try {
+      this.setData({
+        "submitQty": this.data.packagetypemxrows.find(v => v.packagetypemx == e.detail.name).packagetypeqty || 1
+      })
+    } catch (error) {
+
+    }
+    this.getList(true)
+  },
+  changeQtySte({
+    detail
+  }) {
+    if (detail == '-' || detail <= 0) detail = 1;
+    this.setData({
+      submitQty: detail
+    })
+  },
+  /* 提交 */
+  submit() {
+    const customsize = this.data.list.find(v => (v.iscustomsize && !v.CompleteCustomization));
+    let that = this;
+    if (customsize) {
+      return wx.showModal({
+        title: '提示',
+        content: `请先完成"${customsize.itemname}"产品的定制化信息`,
+        // confirmText: "查看产品",
+        showCancel: false,
+        complete: ({
+          confirm
+        }) => {
+          if (confirm) {
+            /* that.setData({
+              condition: customsize.itemname
+            })
+            that.handleSearch() */
+          }
+        }
+      })
+    }
+
+    /* if (this.data.modification) {
+      wx.showModal({
+        title: '提示',
+        content: '您已添加过此套餐,是否需要重新调整套数?',
+        confirmText: '是',
+        cancelText: "否",
+        complete: ({
+          confirm
+        }) => {
+          if (confirm) handle()
+        }
+      })
+    } else {
+      handle()
+    } */
+    handle()
+
+    function handle() {
+      that.setData({
+        dialogShow: true
+      })
+      that.selectComponent("#Dialog").data.beforeClose = (action) => new Promise((resolve) => {
+        if (action == 'cancel') {
+          resolve()
+          that.setData({
+            dialogShow: false
+          })
+          return;
+        }
+        getApp().globalData.handleSelect && getApp().globalData.handleSelect({
+          list: that.data.list.map(v => {
+            v.qty = v.qty * that.data.submitQty;
+            return v
+          })
+        }).then(res => {
+          resolve()
+          that.setData({
+            dialogShow: false
+          })
+        })
+      });
+    }
+
+  },
+  /* 预览图片 */
+  viewImage(e) {
+    const {
+      file
+    } = e.currentTarget.dataset;
+    if (file.length) wx.previewMedia({
+      sources: file.filter(value => ['image', 'vadio'].includes(value.fileType)).map(v => {
+        return {
+          url: v.url,
+          type: v.fileType
+        }
+      }),
+      current: 0,
+      showmenu: true
+    })
+  },
+  /* 开始搜索 */
+  startSearch({
+    detail
+  }) {
+    this.data.condition = detail;
+    this.handleSearch()
+  },
+  /* 取消搜索 */
+  onClear() {
+    this.data.condition = '';
+    this.handleSearch()
+  },
+  handleSearch() {
+    let searchList = this.data.list;
+    if (this.data.condition.length) searchList = searchList.filter(v => {
+      return ['itemname', 'itemno', 'standards', 'model', 'spec'].some(s => {
+        try {
+          return v[s].includes(this.data.condition)
+        } catch (error) {
+          return false
+        }
+      })
+    })
+    this.setData({
+      searchList
+    })
+  },
+  onReady() {
+    this.selectComponent("#ListBox").setHeight(".search", this);
+  },
+  /* 步进器输入框失去焦点 */
+  inputBlur(e) {
+    const {
+      index
+    } = e.currentTarget.dataset;
+    let item = this.data.list[index];
+    let qty = 0;
+    if (item.orderminqty > e.detail.value) {
+      wx.showToast({
+        title: '输入数量低于最低起订量!',
+        icon: "none"
+      })
+      qty = item.orderminqty;
+    } else if (item.orderminqty < e.detail.value) {
+      var currencyRounding = value => currency(value, {
+        increment: item.orderaddqty
+      });
+      qty = currency(currencyRounding(currency(e.detail.value).subtract(item.orderminqty)).format()).add(item.orderminqty).value;
+
+    } else {
+      qty = e.detail.value;
+    }
+    this.setData({
+      [`list[${index}].qty`]: 0
+    });
+    this.setData({
+      [`list[${index}].qty`]: qty
+    });
+    let i = this.data.resultList.findIndex(v => v.itemid == item.itemid);
+    if (i !== -1) this.data.resultList[i].qty = qty;
+  },
+  stepperChange(e) {
+    const {
+      index
+    } = e.currentTarget.dataset;
+    let item = this.data.list[index];
+    if (e.type == 'plus') {
+      item.qty += (item.orderaddqty) - 0
+    } else {
+      item.qty -= item.orderaddqty
+    }
+    this.setData({
+      [`list[${index}]`]: item
+    })
+    let i = this.data.resultList.findIndex(v => v.itemid == item.itemid);
+    if (i !== -1) this.data.resultList[i] = item;
+  },
+  onUnload() {
+    //回收数据
+    getApp().globalData.handleSelect = null;
+  }
+})

+ 9 - 0
packageA/activity/bindingProduct/index.json

@@ -0,0 +1,9 @@
+{
+  "usingComponents": {
+    "van-checkbox": "@vant/weapp/checkbox/index",
+    "van-stepper": "@vant/weapp/stepper/index",
+    "list": "../modules/list/index",
+    "custom": "../../../pages/index/collect/modules/custom",
+    "van-dialog": "@vant/weapp/dialog/index"
+  }
+}

+ 152 - 0
packageA/activity/bindingProduct/index.scss

@@ -0,0 +1,152 @@
+@import "./index.skeleton.wxss";
+
+page {
+	height: 100vh;
+	overflow: hidden;
+}
+
+.total {
+	height: 60rpx;
+	line-height: 60rpx;
+	font-size: 24rpx;
+	font-family: PingFang SC-Regular, PingFang SC;
+	color: #666666;
+	padding-left: 30rpx;
+}
+
+.item-box {
+	position: relative;
+	width: 100vw;
+	background-color: #fff;
+	margin-bottom: 20rpx;
+	padding-bottom: 20rpx;
+	box-sizing: border-box;
+
+	.top {
+		display: flex;
+		padding: 20rpx 30rpx 10rpx;
+		box-sizing: border-box;
+
+		.image {
+			width: 128rpx;
+			height: 128rpx;
+			border-radius: 16rpx;
+			overflow: hidden;
+			margin-right: 20rpx;
+			flex-shrink: 0;
+		}
+
+		.content {
+			flex: 1;
+
+			.title {
+				display: flex;
+				align-items: center;
+				justify-content: space-between;
+				height: 40rpx;
+
+				.line-1 {
+					display: block;
+					width: 500rpx;
+					font-size: 28rpx;
+					font-family: PingFang SC-Semibold, PingFang SC;
+					font-weight: 600;
+					color: #333333;
+				}
+
+				.iconfont {
+					position: absolute;
+					right: 0;
+					top: 20rpx;
+					flex-shrink: 0;
+				}
+			}
+
+			.exp {
+				line-height: 34rpx;
+				font-size: 24rpx;
+				font-family: PingFang SC-Regular, PingFang SC;
+				color: #999999;
+				margin-top: 8rpx;
+			}
+
+		}
+
+	}
+
+	.bottom {
+		display: flex;
+		justify-content: space-between;
+		align-items: center;
+		height: 58rpx;
+		padding: 0 30rpx;
+		box-sizing: border-box;
+		margin-top: 12rpx;
+
+		.check {
+			display: flex;
+			align-items: center;
+			height: 100%;
+			width: 380rpx;
+
+			.label-class {
+				font-size: 24rpx;
+				font-family: PingFang SC-Regular, PingFang SC;
+				color: #999999;
+				margin-left: -6rpx;
+			}
+		}
+
+		.input-class {
+			width: 120rpx;
+		}
+	}
+}
+
+.footer {
+	width: 100vw;
+	min-height: 130rpx;
+	position: fixed;
+	bottom: 0;
+	z-index: 9 !important;
+	display: flex;
+	justify-content: space-between;
+	padding: 0 30rpx;
+	box-sizing: border-box;
+	background-color: #fff;
+	box-shadow: rgba(0, 0, 0, 0.15) 0px 5rpx 15rpx 0px;
+
+	.left {
+		flex: 1;
+		color: #333333;
+		font-size: 28rpx;
+		line-height: 106rpx;
+	}
+
+	.but {
+		width: 230rpx;
+		height: 90rpx;
+		background: #3874F6;
+		border-radius: 16rpx;
+		font-size: 28rpx;
+		font-weight: 600;
+		color: #FFFFFF;
+		margin-top: 10rpx;
+	}
+}
+
+.qty-box {
+	.title {
+		font-weight: bold;
+		text-align: center;
+		padding: 30rpx 20rpx 0;
+	}
+
+	.change-qty-box {
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		padding: 30rpx;
+		box-sizing: border-box;
+	}
+}

+ 237 - 0
packageA/activity/bindingProduct/index.skeleton.wxml

@@ -0,0 +1,237 @@
+<!--
+此文件为开发者工具生成,生成时间: 2024/7/4下午2:01:03
+使用方法:
+在 D:\开发项目\来斯奥E订单\packageA\activity\bindingProduct\index.wxml 引入模板
+
+```
+<import src="index.skeleton.wxml"/>
+<template is="skeleton" wx:if="{{loading}}" />
+```
+
+在 D:\开发项目\来斯奥E订单\packageA\activity\bindingProduct\index.wxss 中引入样式
+```
+@import "./index.skeleton.wxss";
+```
+
+更多详细信息可以参考文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/skeleton.html
+-->
+<template name="skeleton">
+  <view class="sk-container">
+    <view is="miniprogram_npm/@vant/weapp/search/index" class="search">
+      <view class="van-search search-index--van-search " style="background: #ffffff">
+        <view class="van-search__content search-index--van-search__content van-search__content--round search-index--van-search__content--round">
+          <view is="miniprogram_npm/@vant/weapp/field/index" class="van-search__field search-index--van-search__field ">
+            <view is="miniprogram_npm/@vant/weapp/cell/index">
+              <view class="field-index--van-field van-cell cell-index--van-cell van-cell--borderless cell-index--van-cell--borderless sk-pseudo sk-pseudo-circle" hover-class="van-cell--hover hover-class" hover-stay-time="70" style="padding: 5px 10px 5px 0; background-color: transparent;">
+                <view is="miniprogram_npm/@vant/weapp/icon/index" class="van-cell__left-icon-wrap cell-index--van-cell__left-icon-wrap">
+                  <view class="cell-index--van-cell__left-icon van-icon icon-index--van-icon van-icon-search icon-index--van-icon-search sk-pseudo sk-pseudo-circle" style="true"></view>
+                </view>
+                <view class="van-cell__value cell-index--van-cell__value ">
+                  <view class="van-field__body field-index--van-field__body van-field__body--search field-index--van-field__body--search">
+                    <view class="van-field__control field-index--van-field__control sk-image" cursor="-1" maxlength="-1" placeholder="请输入搜索关键词" placeholder-class="van-field__placeholder" placeholder-style="true" selection-end="-1" selection-start="-1" type="search"
+                      value="true"></view>
+                  </view>
+                </view>
+              </view>
+            </view>
+          </view>
+        </view>
+      </view>
+    </view>
+    <view is="miniprogram_npm/@vant/weapp/tabs/index">
+      <view class=" van-tabs tabs-index--van-tabs van-tabs--line tabs-index--van-tabs--line">
+        <view is="miniprogram_npm/@vant/weapp/sticky/index">
+          <view class=" van-sticky sticky-index--van-sticky" style="z-index:1">
+            <view class="van-sticky-wrap sticky-index--van-sticky-wrap" style="z-index:1">
+              <view class="van-tabs__wrap tabs-index--van-tabs__wrap ">
+                <scroll-view class="van-tabs__scroll tabs-index--van-tabs__scroll van-tabs__scroll--line tabs-index--van-tabs__scroll--line" scroll-left="0" style="border-color: var(--assist)">
+                  <view class="van-tabs__nav tabs-index--van-tabs__nav van-tabs__nav--line tabs-index--van-tabs__nav--line " style="true">
+                    <view class="van-tabs__line tabs-index--van-tabs__line" style="width:40px;opacity:1;transform:translateX(45px);-webkit-transform:translateX(45px);background-color:var(--assist);transition-duration:0.3s;-webkit-transition-duration:0.3s"></view>
+                    <view class="  van-ellipsis tabs-index--van-ellipsis van-tab tabs-index--van-tab van-tab--active tabs-index--van-tab--active" data-index="0" style="color:var(--assist)">
+                      <view class="van-ellipsis tabs-index--van-ellipsis sk-transparent sk-text-34-0909-287 sk-text" style="background-position-x: 50%;">
+                        A套餐
+                      </view>
+                    </view>
+                    <view class=" van-ellipsis tabs-index--van-ellipsis van-tab tabs-index--van-tab" data-index="1" style="true">
+                      <view class="van-ellipsis tabs-index--van-ellipsis sk-transparent sk-text-34-0909-622 sk-text" style="background-position-x: 50%;">
+                        B套餐
+                      </view>
+                    </view>
+                    <view class=" van-ellipsis tabs-index--van-ellipsis van-tab tabs-index--van-tab" data-index="2" style="true">
+                      <view class="van-ellipsis tabs-index--van-ellipsis sk-transparent sk-text-34-0909-431 sk-text" style="background-position-x: 50%;">
+                        C套餐
+                      </view>
+                    </view>
+                  </view>
+                </scroll-view>
+              </view>
+            </view>
+          </view>
+        </view>
+        <view class="van-tabs__content tabs-index--van-tabs__content">
+          <view class="van-tabs__track tabs-index--van-tabs__track van-tabs__track tabs-index--van-tabs__track" style="true">
+            <view is="miniprogram_npm/@vant/weapp/tab/index">
+              <view class=" van-tab__pane tab-index--van-tab__pane van-tab__pane--active tab-index--van-tab__pane--active" style="true"></view>
+            </view>
+            <view is="miniprogram_npm/@vant/weapp/tab/index"></view>
+            <view is="miniprogram_npm/@vant/weapp/tab/index"></view>
+          </view>
+        </view>
+      </view>
+    </view>
+    <view is="pages/index/collect/modules/custom" id="Custom">
+      <view is="miniprogram_npm/@vant/weapp/dialog/index" id="5b226dd9--Dialog">
+        <view is="miniprogram_npm/@vant/weapp/popup/index">
+          <view is="miniprogram_npm/@vant/weapp/overlay/index">
+            <view is="miniprogram_npm/@vant/weapp/transition/index"></view>
+          </view>
+        </view>
+      </view>
+    </view>
+    <view style="height: 10px;"></view>
+    <view is="components/Yl_ListBox/index" id="ListBox">
+      <scroll-view scroll-y="true" class="ListBox-index--scroll-view" lower-threshold="300" refresher-enabled="true" style="height: 699px;">
+        <view class="item-box">
+          <view class="top" data-id="148834" data-item="[object Object]">
+            <view class="image">
+              <view is="miniprogram_npm/@vant/weapp/image/index">
+                <view class=" van-image image-index--van-image" style="width:100%;height:100%">
+                  <image class="van-image__img image-index--van-image__img sk-image" mode="aspectFill" lazy-load="true"></image>
+                </view>
+              </view>
+            </view>
+            <view class="content">
+              <view class="title line-1 sk-transparent sk-text-14-2857-951 sk-text">
+                D-FW48G (韵白)
+              </view>
+              <view class="exp sk-transparent sk-text-14-7059-626 sk-text">编号:80902148</view>
+              <view class="exp sk-transparent sk-text-14-7059-43 sk-text">规格: --</view>
+              <view class="exp sk-transparent sk-text-14-7059-479 sk-text">型号: --</view>
+              <view class="exp">
+                <text style="font-size: 12px;font-weight: 600;color: #FF3B30;" class="sk-transparent sk-text-14-7059-350 sk-text">¥98.91</text>
+                <text style="font-size: 10px; text-decoration: line-through transparent; margin-left: 3px;" class="sk-transparent sk-text-20-5882-274 sk-text">¥109.90</text>
+              </view>
+              <view class="exp sk-transparent" data-item="[object Object]" style="color:#085CDF;">
+                长:定制,宽:定制
+                <view is="miniprogram_npm/@vant/weapp/icon/index">
+                  <view class="van-icon icon-index--van-icon van-icon-arrow-down icon-index--van-icon-arrow-down sk-pseudo sk-pseudo-circle" style="true"></view>
+                </view>
+              </view>
+              <view class="exp sk-transparent sk-text-14-7059-714 sk-text">特征码: --</view>
+              <view class="exp sk-transparent sk-text-14-7059-870 sk-text">
+                包装数量:1 (片)
+              </view>
+              <view class="exp sk-transparent sk-text-14-7059-109 sk-text">可购数量:不限购 </view>
+            </view>
+          </view>
+          <view class="bottom">
+            <view class="check" data-item="[object Object]">
+              <view class="label-class sk-transparent sk-text-14-2857-700 sk-text" style="font-size: 13px;">
+                数量:
+              </view>
+            </view>
+            <view is="miniprogram_npm/@vant/weapp/stepper/index" data-index="0" data-iscatch="catch">
+              <view class="van-stepper stepper-index--van-stepper ">
+                <view class="van-stepper__minus stepper-index--van-stepper__minus van-stepper__minus--disabled stepper-index--van-stepper__minus--disabled sk-pseudo sk-pseudo-circle" data-type="minus" hover-class="van-stepper__minus--hover" hover-stay-time="70"
+                  style="true"></view>
+                <view class="input-class van-stepper__input stepper-index--van-stepper__input van-stepper__input--disabled stepper-index--van-stepper__input--disabled sk-image" style="true" type="digit" value="1" disabled="true"></view>
+                <view class="van-stepper__plus stepper-index--van-stepper__plus van-stepper__plus--disabled stepper-index--van-stepper__plus--disabled sk-pseudo sk-pseudo-circle" data-type="plus" hover-class="van-stepper__plus--hover" hover-stay-time="70"
+                  style="true"></view>
+              </view>
+            </view>
+          </view>
+        </view>
+        <view class="item-box">
+          <view class="top" data-id="134081" data-item="[object Object]">
+            <view class="image">
+              <view is="miniprogram_npm/@vant/weapp/image/index">
+                <view class=" van-image image-index--van-image" style="width:100%;height:100%">
+                  <image class="van-image__img image-index--van-image__img sk-image" mode="aspectFill" lazy-load="true"></image>
+                </view>
+              </view>
+            </view>
+            <view class="content">
+              <view class="title line-1 sk-transparent sk-text-14-2857-66 sk-text">
+                DB-QB595P014-01
+              </view>
+              <view class="exp sk-transparent sk-text-14-7059-802 sk-text">编号:80403300</view>
+              <view class="exp sk-transparent sk-text-14-7059-611 sk-text">规格: --</view>
+              <view class="exp sk-transparent sk-text-14-7059-908 sk-text">型号: --</view>
+              <view class="exp">
+                <text style="font-size: 12px;font-weight: 600;color: #FF3B30;" class="sk-transparent sk-text-14-7059-994 sk-text">¥71.55</text>
+                <text style="font-size: 10px; text-decoration: line-through transparent; margin-left: 3px;" class="sk-transparent sk-text-20-5882-949 sk-text">¥79.50</text>
+              </view>
+              <view class="exp sk-transparent" data-item="[object Object]" style="color:#085CDF;">
+                长:定制,宽:定制
+                <view is="miniprogram_npm/@vant/weapp/icon/index">
+                  <view class="van-icon icon-index--van-icon van-icon-arrow-down icon-index--van-icon-arrow-down sk-pseudo sk-pseudo-circle" style="true"></view>
+                </view>
+              </view>
+              <view class="exp sk-transparent sk-text-14-7059-36 sk-text">特征码: --</view>
+              <view class="exp sk-transparent sk-text-14-7059-762 sk-text">
+                包装数量:1 (片)
+              </view>
+              <view class="exp sk-transparent sk-text-14-7059-428 sk-text">可购数量:不限购 </view>
+            </view>
+          </view>
+          <view class="bottom">
+            <view class="check" data-item="[object Object]">
+              <view class="label-class sk-transparent sk-text-14-2857-398 sk-text" style="font-size: 13px;">
+                数量:
+              </view>
+            </view>
+            <view is="miniprogram_npm/@vant/weapp/stepper/index" data-index="1" data-iscatch="catch">
+              <view class="van-stepper stepper-index--van-stepper ">
+                <view class="van-stepper__minus stepper-index--van-stepper__minus van-stepper__minus--disabled stepper-index--van-stepper__minus--disabled sk-pseudo sk-pseudo-circle" data-type="minus" hover-class="van-stepper__minus--hover" hover-stay-time="70"
+                  style="true"></view>
+                <view class="input-class van-stepper__input stepper-index--van-stepper__input van-stepper__input--disabled stepper-index--van-stepper__input--disabled sk-image" style="true" type="digit" value="1" disabled="true"></view>
+                <view class="van-stepper__plus stepper-index--van-stepper__plus van-stepper__plus--disabled stepper-index--van-stepper__plus--disabled sk-pseudo sk-pseudo-circle" data-type="plus" hover-class="van-stepper__plus--hover" hover-stay-time="70"
+                  style="true"></view>
+              </view>
+            </view>
+          </view>
+        </view>
+        <view class="item-box">
+          <view class="top" data-id="134078" data-item="[object Object]">
+            <view class="image">
+              <view is="miniprogram_npm/@vant/weapp/image/index">
+                <view class=" van-image image-index--van-image" style="width:100%;height:100%">
+                  <image class="van-image__img image-index--van-image__img sk-image" mode="aspectFill" lazy-load="true"></image>
+                </view>
+              </view>
+            </view>
+            <view class="content">
+              <view class="title line-1 sk-transparent sk-text-14-2857-186 sk-text">
+                DB-QB1200T014-01
+              </view>
+              <view class="exp sk-transparent sk-text-14-7059-85 sk-text">编号:80403297</view>
+              <view class="exp sk-transparent sk-text-14-7059-788 sk-text">规格: --</view>
+              <view class="exp sk-transparent sk-text-14-7059-867 sk-text">型号: --</view>
+              <view class="exp">
+                <text style="font-size: 12px;font-weight: 600;color: #FF3B30;" class="sk-transparent sk-text-14-7059-336 sk-text">¥76.05</text>
+                <text style="font-size: 10px; text-decoration: line-through transparent; margin-left: 3px;" class="sk-transparent sk-text-20-5882-258 sk-text">¥84.50</text>
+              </view>
+              <view class="exp sk-transparent" data-item="[object Object]" style="color:#085CDF;">
+                长:定制,宽:定制
+                <view is="miniprogram_npm/@vant/weapp/icon/index">
+                  <view class="van-icon icon-index--van-icon van-icon-arrow-down icon-index--van-icon-arrow-down sk-pseudo sk-pseudo-circle" style="true"></view>
+                </view>
+              </view>
+            </view>
+          </view>
+        </view>
+      </scroll-view>
+    </view>
+    <view class="footer">
+      <view class="left sk-transparent sk-text-37-2727-584 sk-text">
+        选择:A套餐
+      </view>
+      <view is="miniprogram_npm/@vant/weapp/button/index">
+        <button app-parameter="true" business-id="true" class="but van-button weapp-button-index--van-button van-button--default weapp-button-index--van-button--default van-button--normal weapp-button-index--van-button--normal sk-button sk-pseudo sk-pseudo-circle"
+          data-detail="null" form-type="true" hover-class="van-button--active hover-class" lang="true" open-type="true" send-message-img="true" send-message-path="true" send-message-title="true" session-from="true" style="true">
+          <view class="van-button__text weapp-button-index--van-button__text sk-transparent sk-text-15-0000-795 sk-text" style="background-position-x: 50%;">生成订单</view>
+        </button>
+      </view>
+    </view>
+  </view>
+</template>

+ 205 - 0
packageA/activity/bindingProduct/index.skeleton.wxss

@@ -0,0 +1,205 @@
+/*
+此文件为开发者工具生成,生成时间: 2024/7/4下午2:01:03
+
+在 D:\开发项目\来斯奥E订单\packageA\activity\bindingProduct\index.wxss 中引入样式
+```
+@import "./index.skeleton.wxss";
+```
+
+更多详细信息可以参考文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/skeleton.html
+*/
+.sk-transparent {
+    color: transparent !important;
+  }
+.sk-text-34-0909-287 {
+    background-image: linear-gradient(transparent 34.0909%, #EEEEEE 0%, #EEEEEE 65.9091%, transparent 0%) !important;
+    background-size: 100% 84.6154rpx;
+    position: relative !important;
+  }
+.sk-text {
+    background-origin: content-box !important;
+    background-clip: content-box !important;
+    background-color: transparent !important;
+    color: transparent !important;
+    background-repeat: repeat-y !important;
+  }
+.sk-text-34-0909-622 {
+    background-image: linear-gradient(transparent 34.0909%, #EEEEEE 0%, #EEEEEE 65.9091%, transparent 0%) !important;
+    background-size: 100% 84.6154rpx;
+    position: relative !important;
+  }
+.sk-text-34-0909-431 {
+    background-image: linear-gradient(transparent 34.0909%, #EEEEEE 0%, #EEEEEE 65.9091%, transparent 0%) !important;
+    background-size: 100% 84.6154rpx;
+    position: relative !important;
+  }
+.sk-text-14-2857-951 {
+    background-image: linear-gradient(transparent 14.2857%, #EEEEEE 0%, #EEEEEE 85.7143%, transparent 0%) !important;
+    background-size: 100% 37.6923rpx;
+    position: relative !important;
+  }
+.sk-text-14-7059-626 {
+    background-image: linear-gradient(transparent 14.7059%, #EEEEEE 0%, #EEEEEE 85.2941%, transparent 0%) !important;
+    background-size: 100% 32.6923rpx;
+    position: relative !important;
+  }
+.sk-text-14-7059-43 {
+    background-image: linear-gradient(transparent 14.7059%, #EEEEEE 0%, #EEEEEE 85.2941%, transparent 0%) !important;
+    background-size: 100% 32.6923rpx;
+    position: relative !important;
+  }
+.sk-text-14-7059-479 {
+    background-image: linear-gradient(transparent 14.7059%, #EEEEEE 0%, #EEEEEE 85.2941%, transparent 0%) !important;
+    background-size: 100% 32.6923rpx;
+    position: relative !important;
+  }
+.sk-text-14-7059-350 {
+    background-image: linear-gradient(transparent 14.7059%, #EEEEEE 0%, #EEEEEE 85.2941%, transparent 0%) !important;
+    background-size: 100% 32.6923rpx;
+    position: relative !important;
+  }
+.sk-text-20-5882-274 {
+    background-image: linear-gradient(transparent 20.5882%, #EEEEEE 0%, #EEEEEE 79.4118%, transparent 0%) !important;
+    background-size: 100% 32.6923rpx;
+    position: relative !important;
+  }
+.sk-text-14-7059-714 {
+    background-image: linear-gradient(transparent 14.7059%, #EEEEEE 0%, #EEEEEE 85.2941%, transparent 0%) !important;
+    background-size: 100% 32.6923rpx;
+    position: relative !important;
+  }
+.sk-text-14-7059-870 {
+    background-image: linear-gradient(transparent 14.7059%, #EEEEEE 0%, #EEEEEE 85.2941%, transparent 0%) !important;
+    background-size: 100% 32.6923rpx;
+    position: relative !important;
+  }
+.sk-text-14-7059-109 {
+    background-image: linear-gradient(transparent 14.7059%, #EEEEEE 0%, #EEEEEE 85.2941%, transparent 0%) !important;
+    background-size: 100% 32.6923rpx;
+    position: relative !important;
+  }
+.sk-text-14-2857-700 {
+    background-image: linear-gradient(transparent 14.2857%, #EEEEEE 0%, #EEEEEE 85.7143%, transparent 0%) !important;
+    background-size: 100% 35.0000rpx;
+    position: relative !important;
+  }
+.sk-text-14-2857-66 {
+    background-image: linear-gradient(transparent 14.2857%, #EEEEEE 0%, #EEEEEE 85.7143%, transparent 0%) !important;
+    background-size: 100% 37.6923rpx;
+    position: relative !important;
+  }
+.sk-text-14-7059-802 {
+    background-image: linear-gradient(transparent 14.7059%, #EEEEEE 0%, #EEEEEE 85.2941%, transparent 0%) !important;
+    background-size: 100% 32.6923rpx;
+    position: relative !important;
+  }
+.sk-text-14-7059-611 {
+    background-image: linear-gradient(transparent 14.7059%, #EEEEEE 0%, #EEEEEE 85.2941%, transparent 0%) !important;
+    background-size: 100% 32.6923rpx;
+    position: relative !important;
+  }
+.sk-text-14-7059-908 {
+    background-image: linear-gradient(transparent 14.7059%, #EEEEEE 0%, #EEEEEE 85.2941%, transparent 0%) !important;
+    background-size: 100% 32.6923rpx;
+    position: relative !important;
+  }
+.sk-text-14-7059-994 {
+    background-image: linear-gradient(transparent 14.7059%, #EEEEEE 0%, #EEEEEE 85.2941%, transparent 0%) !important;
+    background-size: 100% 32.6923rpx;
+    position: relative !important;
+  }
+.sk-text-20-5882-949 {
+    background-image: linear-gradient(transparent 20.5882%, #EEEEEE 0%, #EEEEEE 79.4118%, transparent 0%) !important;
+    background-size: 100% 32.6923rpx;
+    position: relative !important;
+  }
+.sk-text-14-7059-36 {
+    background-image: linear-gradient(transparent 14.7059%, #EEEEEE 0%, #EEEEEE 85.2941%, transparent 0%) !important;
+    background-size: 100% 32.6923rpx;
+    position: relative !important;
+  }
+.sk-text-14-7059-762 {
+    background-image: linear-gradient(transparent 14.7059%, #EEEEEE 0%, #EEEEEE 85.2941%, transparent 0%) !important;
+    background-size: 100% 32.6923rpx;
+    position: relative !important;
+  }
+.sk-text-14-7059-428 {
+    background-image: linear-gradient(transparent 14.7059%, #EEEEEE 0%, #EEEEEE 85.2941%, transparent 0%) !important;
+    background-size: 100% 32.6923rpx;
+    position: relative !important;
+  }
+.sk-text-14-2857-398 {
+    background-image: linear-gradient(transparent 14.2857%, #EEEEEE 0%, #EEEEEE 85.7143%, transparent 0%) !important;
+    background-size: 100% 35.0000rpx;
+    position: relative !important;
+  }
+.sk-text-14-2857-186 {
+    background-image: linear-gradient(transparent 14.2857%, #EEEEEE 0%, #EEEEEE 85.7143%, transparent 0%) !important;
+    background-size: 100% 37.6923rpx;
+    position: relative !important;
+  }
+.sk-text-14-7059-85 {
+    background-image: linear-gradient(transparent 14.7059%, #EEEEEE 0%, #EEEEEE 85.2941%, transparent 0%) !important;
+    background-size: 100% 32.6923rpx;
+    position: relative !important;
+  }
+.sk-text-14-7059-788 {
+    background-image: linear-gradient(transparent 14.7059%, #EEEEEE 0%, #EEEEEE 85.2941%, transparent 0%) !important;
+    background-size: 100% 32.6923rpx;
+    position: relative !important;
+  }
+.sk-text-14-7059-867 {
+    background-image: linear-gradient(transparent 14.7059%, #EEEEEE 0%, #EEEEEE 85.2941%, transparent 0%) !important;
+    background-size: 100% 32.6923rpx;
+    position: relative !important;
+  }
+.sk-text-14-7059-336 {
+    background-image: linear-gradient(transparent 14.7059%, #EEEEEE 0%, #EEEEEE 85.2941%, transparent 0%) !important;
+    background-size: 100% 32.6923rpx;
+    position: relative !important;
+  }
+.sk-text-20-5882-258 {
+    background-image: linear-gradient(transparent 20.5882%, #EEEEEE 0%, #EEEEEE 79.4118%, transparent 0%) !important;
+    background-size: 100% 32.6923rpx;
+    position: relative !important;
+  }
+.sk-text-37-2727-584 {
+    background-image: linear-gradient(transparent 37.2727%, #EEEEEE 0%, #EEEEEE 62.7273%, transparent 0%) !important;
+    background-size: 100% 105.7692rpx;
+    position: relative !important;
+  }
+.sk-text-15-0000-795 {
+    background-image: linear-gradient(transparent 15.0000%, #EEEEEE 0%, #EEEEEE 85.0000%, transparent 0%) !important;
+    background-size: 100% 38.4615rpx;
+    position: relative !important;
+  }
+.sk-button {
+    color: #EFEFEF !important;
+    background: #EFEFEF !important;
+    border: none !important;
+    box-shadow: none !important;
+  }
+.sk-image {
+    background: #EFEFEF !important;
+  }
+.sk-pseudo::before, .sk-pseudo::after {
+      background: #EFEFEF !important;
+      background-image: none !important;
+      color: transparent !important;
+      border-color: transparent !important;
+    }
+.sk-pseudo-rect::before, .sk-pseudo-rect::after {
+      border-radius: 0 !important;
+    }
+.sk-pseudo-circle::before, .sk-pseudo-circle::after {
+      border-radius: 50% !important;
+    }
+.sk-container {
+    position: absolute;
+    left: 0;
+    top: 0;
+    width: 100%;
+    height: 100%;
+    overflow: hidden;
+    background-color: transparent;
+  }

+ 73 - 0
packageA/activity/bindingProduct/index.wxml

@@ -0,0 +1,73 @@
+<import src="./index.skeleton.wxml" />
+<template is="skeleton" wx:if="{{loading}}" />
+
+<van-search class="search" value="{{ condition }}" shape="round" placeholder="请输入搜索关键词" bind:search='startSearch' bind:clear='onClear' />
+<van-tabs wx:if="{{packageList.length}}" active="{{ params.content.where.packagetypemx }}" color='var(--assist)' title-active-color='var(--assist)' bind:change="tabsChange">
+	<van-tab wx:for="{{packageList}}" wx:key="index" title="{{item}}" name='{{item}}' />
+</van-tabs>
+<custom id="Custom" isOldPrice='{{true}}' />
+<view style="height: 20rpx;" />
+<Yl_ListBox id='ListBox' bind:getlist='getList'>
+	<view wx:for="{{searchList}}" wx:key="itemid" class="item-box">
+		<view class="top" data-id="{{item[idname]}}" data-item="{{item}}">
+			<view class="image">
+				<van-image width="100%" height="100%" fit="cover" src="{{item.attinfos[0].subfiles[0].url||item.attinfos[0].url||item.cover||123123}}" use-loading-slot use-error-slot lazy-load>
+					<van-loading slot="loading" type="spinner" size="20" vertical />
+					<text slot="error">暂无图片</text>
+				</van-image>
+			</view>
+			<view class="content">
+				<view class="title line-1">
+					{{item.itemname}}
+				</view>
+				<view class="exp">编号:{{item.itemno}}</view>
+				<view class="exp">规格:{{item.standards ||" --"}}</view>
+				<view class="exp">型号:{{item.model ||" --"}}</view>
+				<view class="exp"><text style="font-size: 24rpx;font-weight: 600;color: #FF3B30;">{{handleHide.verify(item.showPrice||item.newPrice,'列表金额',privacyFieldC)}}</text><text style="font-size: 20rpx; text-decoration:line-through; margin-left: 6rpx;">{{handleHide.verify(item.newOldPrice||item.oldPrice,'列表金额',privacyFieldC)}}</text></view>
+				<view wx:if="{{item.iscustomsize}}" class="exp" data-item="{{item}}" catch:tap="customization" style="color:#085CDF;">
+					{{item.customText}}
+					<van-icon name="arrow-down" />
+				</view>
+				<view class="exp">特征码:{{item.signaturecode ||" --"}}</view>
+				<view class="exp">
+					包装数量:{{item.packageqty}} ({{item.unitname || item.unit}})
+				</view>
+				<view class="exp">可购数量:{{item.groupqty==0?'不限购':(item.groupqty-item.saledqty)<=0?'已售罄':item.maxQty}} </view>
+				</view>
+			</view>
+
+			<view class="bottom">
+				<view class="check" bindtap="changeResults" data-item="{{item}}">
+					<view class="label-class" style="font-size: 26rpx;">
+						数量:
+					</view>
+				</view>
+				<van-stepper value="{{ item.orderminqty }}" min="{{item.orderminqty}}" max="{{item.maxQty||'99999999'}}" disabled="true" step="{{item.orderaddqty||1}}" input-class='input-class' data-index="{{index}}" data-iscatch="catch" catch:minus='stepperChange' catch:plus='stepperChange' catch:blur='inputBlur' />
+			</view>
+		</view>
+		<view style="height: 200rpx;" />
+		<Yl_Empty wx:if="{{searchList.length==0}}" />
+</Yl_ListBox>
+
+<van-dialog id="Dialog" use-slot show="{{ dialogShow }}" asyncClose confirm-button-color='#085CDF' show-cancel-button>
+	<view class="qty-box">
+		<view class="title">
+			{{params.content.where.packagetypemx}}
+		</view>
+		<view class="change-qty-box">
+			购买套数:
+			<van-stepper custom-class='stepper' value="{{ submitQty }}" integer min="1" max="99999999999" step="1" input-width='50px' button-size='30px' bind:change='changeQtySte' />
+		</view>
+	</view>
+</van-dialog>
+
+<!-- 底部 -->
+<view style="height: 130rpx;" />
+<view class="footer">
+	<view class="left">
+		选择:{{params.content.where.packagetypemx}}
+	</view>
+	<van-button custom-class='but' disabled="{{!list.length}}" bind:click="submit">{{butText}}</van-button>
+</view>
+
+<wxs src="/utils/hidePrice.wxs" module="handleHide" />

+ 33 - 14
packageA/activity/detail.js

@@ -172,21 +172,40 @@ Page({
 	},
 	/* 去下单 */
 	clickBut() {
-		wx.navigateTo({
-			url: '/packageA/activity/selectProduct/index?params=' + JSON.stringify({
-				"id": 20230116094803,
-				"version": 1,
-				"content": {
-					nocache: true,
-					sa_brandid: this.data.detail.sa_brandid,
-					sa_promotionid: this.data.sa_promotionid,
-					sa_promotion_itemgroupid: this.data.active,
-					"where": {
-						"condition": ""
+		if (this.data.detail.type == '套餐活动') {
+			wx.navigateTo({
+				url: '/packageA/activity/bindingProduct/index?params=' + JSON.stringify({
+					"id": 20230116094803,
+					"version": 1,
+					"content": {
+						nocache: true,
+						sa_brandid: this.data.detail.sa_brandid,
+						sa_promotionid: this.data.sa_promotionid,
+						sa_promotion_itemgroupid: this.data.active,
+						"where": {
+							"condition": "",
+							packagetypemx: "",
+						}
 					}
-				}
-			}),
-		});
+				}),
+			});
+		} else {
+			wx.navigateTo({
+				url: '/packageA/activity/selectProduct/index?params=' + JSON.stringify({
+					"id": 20230116094803,
+					"version": 1,
+					"content": {
+						nocache: true,
+						sa_brandid: this.data.detail.sa_brandid,
+						sa_promotionid: this.data.sa_promotionid,
+						sa_promotion_itemgroupid: this.data.active,
+						"where": {
+							"condition": ""
+						}
+					}
+				}),
+			});
+		}
 		getApp().globalData.handleSelect = this.creadedOrderForm.bind(this);
 	},
 	creadedOrderForm({

+ 114 - 13
packageA/activity/index.js

@@ -17,12 +17,6 @@ Page({
 	onLoad(options) {
 		this.getList()
 	},
-	/* 处理筛选 */
-	handleFilter({
-		detail
-	}) {
-		console.log(detail)
-	},
 	getList(init = false) {
 		if (init.detail != undefined) init = init.detail;
 		let content = this.data.content;
@@ -47,13 +41,120 @@ Page({
 			})
 		})
 	},
-	/* 	intervalTime(startTime, endTime) {
-			var timestamp = ,
-				startTamp = Date.parse(new Date(startTime)),
-				endTamp = Date.parse(new Date(endTime));
-			return endTamp - timestamp
-		}, */
-	/* 搜索 */
+	onClick({
+		detail
+	}) {
+		console.log(detail)
+		if (detail.type == '套餐活动') {
+			wx.navigateTo({
+				url: '/packageA/activity/bindingProduct/index?params=' + JSON.stringify({
+					"id": 20230116094803,
+					"version": 1,
+					"content": {
+						nocache: true,
+						sa_brandid: detail.sa_brandid,
+						sa_promotionid: detail.sa_promotionid,
+						packagetype: detail.packagetype,
+						"where": {
+							"condition": "",
+							packagetypemx: '',
+						}
+					}
+				}),
+			});
+			getApp().globalData.handleSelect = function ({
+				list
+			}) {
+				return handleSubmit(list)
+			}.bind(this);
+		} else {
+			wx.navigateTo({
+				url: '/packageA/activity/selectProduct/index?params=' + JSON.stringify({
+					"id": 20230116094803,
+					"version": 1,
+					"content": {
+						nocache: true,
+						sa_brandid: detail.sa_brandid,
+						sa_promotionid: detail.sa_promotionid,
+						"where": {
+							"condition": ""
+						}
+					}
+				}),
+			});
+			getApp().globalData.handleSelect = function ({
+				list
+			}) {
+				wx.showModal({
+					title: '提示',
+					content: '是否确定创建促销订单?',
+					complete: ({
+						confirm
+					}) => {
+						if (confirm) handleSubmit(list)
+					}
+				})
+			}.bind(this);
+		}
+
+		function handleSubmit(list) {
+			return new Promise((resolve) => {
+				wx.showLoading({
+					title: '生成中...',
+					mask: true
+				})
+				_Http.basic({
+					"id": 20221128183202,
+					"content": {
+						istool: 0,
+						type: "促销订单",
+						sa_orderid: 0,
+						sa_accountclassid: detail.sa_accountclassid,
+						rec_contactsid: 0,
+						pay_enterpriseid: 0,
+						sa_contractid: 0,
+						sa_projectid: 0,
+						sa_promotionid: detail.sa_promotionid,
+						sa_brandid: detail.sa_brandid, //品牌ID
+						type: "促销订单", //订单类型
+						tradefield: detail.tradefield.join(','), //必选
+						items: list.map(v => {
+							return {
+								sa_orderitemsid: 0,
+								itemid: v.itemid,
+								itemno: v.itemno,
+								qty: v.qty,
+								price: v.price,
+								length: v.length,
+								width: v.width,
+								sa_promotion_itemsid: v.sa_promotion_itemsid,
+								cheek: v.cheek,
+								color: v.color,
+								material: v.material,
+								spec: v.spec,
+								custom: v.custom
+							}
+						})
+					}
+				}).then(res => {
+					wx.hideLoading()
+					console.log("转化促销订单", res)
+					resolve(res.msg == '成功')
+					wx.showToast({
+						title: res.msg != '成功' ? res.msg : '创建成功',
+						icon: "none",
+						mask: res.msg == '成功'
+					});
+					if (res.msg == '成功') setTimeout(() => {
+						wx.redirectTo({
+							url: '/packageA/orderForm/detail?id=' + res.data.sa_orderid,
+						});
+						delete getApp().globalData.handleSelect
+					}, 500)
+				})
+			})
+		}
+	},
 	onSearch({
 		detail
 	}) {

+ 2 - 2
packageA/activity/index.wxml

@@ -6,7 +6,7 @@
 <view class="division" />
 <Yl_ListBox id='ListBox' bind:getlist='getList'>
 	<view style="height: 10rpx;" />
-	<List list="{{list}}" />
+	<List list="{{list}}" bind:onClick="onClick" />
 </Yl_ListBox>
 <!-- 筛选条件 -->
-<Yl_Filtrate id='Filtrate' list="{{filter}}" bind:handle="handleFilter" dateRange='{{false}}' />
+<Yl_Filtrate id='Filtrate' list="{{filter}}" dateRange='{{false}}' />

+ 14 - 0
packageA/activity/modules/list/index.js

@@ -1,7 +1,21 @@
 Component({
+  options: {
+    addGlobalClass: true,
+  },
   properties: {
     list: {
       type: Array
+    },
+    onClick: {
+      type: Function
+    }
+  },
+  methods: {
+    clickItem(e) {
+      const {
+        item
+      } = e.currentTarget.dataset;
+      this.triggerEvent("onClick", item)
     }
   }
 })

+ 2 - 2
packageA/activity/modules/list/index.wxml

@@ -1,4 +1,4 @@
-<navigator class="product" url="/packageA/activity/detail?id={{item.sa_promotionid}}" wx:for="{{list}}" wx:key="sa_promotionid">
+<view class="product" wx:for="{{list}}" wx:key="sa_promotionid" hover-class="navigator-hover" data-item="{{item}}" bind:tap="clickItem">
 	<view class="image-box">
 		<van-image width="100%" wx:if="{{item.attinfos[0]}}" height="100%" fit="cover" src="{{item.attinfos[0].subfiles[0].url||item.attinfos[0].url}}" use-loading-slot use-error-slot lazy-load>
 			<van-loading slot="loading" type="spinner" size="20" vertical />
@@ -27,5 +27,5 @@
 			<van-count-down time="{{ item.surplus }}" format="DD 天 HH 时 mm 分 ss 秒" />
 		</view>
 	</view>
-</navigator>
+</view>
 <Yl_Empty wx:if="{{list.length === 0}}" />

+ 1 - 1
packageA/orderForm/detail.wxml

@@ -65,7 +65,7 @@
 </view>
 <view style="height: 20rpx;" />
 <Yl_FunTabs list='{{tabsList}}' active='{{tabsActive}}' bind:onChenge="tabsChange">
-    <Product slot='产品明细' privacyFieldC='{{privacyFieldC}}' id='Product' disabled="{{detail.status!='新建'}}" sa_order_v='{{detail.sa_order_v}}' bind:returnProductCount='getProductCount' />
+    <Product slot='产品明细' privacyFieldC='{{privacyFieldC}}' packagetypemxrows="{{detail.packagetypemxrows}}" id='Product' disabled="{{detail.status!='新建'}}" packagetype='{{detail.packagetype}}' sa_order_v='{{detail.sa_order_v}}' bind:returnProductCount='getProductCount' />
     <Yl_Attachment slot='附件' id='Yl_Attachment' ownertable="sa_order" ownerid="{{detail.sa_orderid}}" disabled="{{detail.status!='新建'}}" />
     <Progress slot='订单进度' id='Progress' hidePrice='{{hidePrice.hidePrice("订单进度",privacyFieldC)}}' />
     <Consignment slot='出库单' id='Consignment' />

+ 129 - 78
packageA/orderForm/modules/product/index.js

@@ -22,6 +22,13 @@ Component({
         },
         privacyFieldC: {
             type: Array
+        },
+        packagetype: {
+            type: String
+        },
+        packagetypemxrows: {
+            type: Array,
+            value: []
         }
     },
     data: {
@@ -129,7 +136,7 @@ Component({
             let that = this;
             wx.showModal({
                 title: '提示',
-                content: `是否确认删除“${detail.itemname}”?`,
+                content: that.data.packagetype ? '该商品为套餐商品,删除后该套餐下所有商品都会被删除,确认删除吗?' : `是否确认删除“${detail.itemname}”?`,
                 complete: (res) => {
                     if (res.confirm) _Http.basic({
                         "id": 20221109093702,
@@ -145,32 +152,59 @@ Component({
                             title: res.msg,
                             icon: "none"
                         });
-                        that.setData({
-                            list: that.data.list.filter(v => v.sa_orderitemsid != detail.sa_orderitemsid)
-                        });
-                        this.triggerEvent("returnProductCount", this.data.content.total - 1)
-                        this.updateThePrice();
+                        if (that.data.packagetype) {
+                            that.getList(sa_orderid, true)
+                        } else {
+                            that.setData({
+                                list: that.data.list.filter(v => v.sa_orderitemsid != detail.sa_orderitemsid)
+                            });
+                            that.triggerEvent("returnProductCount", that.data.content.total - 1)
+                        }
+                        that.updateThePrice();
                     })
                 }
             })
         },
         /* 去添加产品 */
         addProduct() {
-            let detail = getCurrentPages().find(v => v.__route__ == 'packageA/orderForm/detail').data.detail,
-                id = '';
-            switch (detail.type) {
-                case '促销订单':
-                    id = 20230107182302;
-                    break;
-                case '标准订单':
-                    id = 20221109153502;
-                    break;
-                case '特殊订单':
-                    id = 20221109153502;
-                    break;
-            }
-            wx.navigateTo({
-                url: `${detail.type=='促销订单'?'/packageA/activity/selectProduct/index':'/select/product/index'}?params=${JSON.stringify({
+            if (this.data.packagetype) {
+                wx.navigateTo({
+                    url: '/packageA/activity/bindingProduct/index?params=' + JSON.stringify({
+                        "id": 20230107182302,
+                        "version": 1,
+                        "content": {
+                            nocache: true,
+                            sa_orderid, //订单ID
+                            packagetype: this.data.packagetype,
+                            "where": {
+                                "condition": "",
+                                packagetypemx: "",
+                            }
+                        }
+                    }) + `&butText=添加套餐&packagetypemxrows=${JSON.stringify(this.data.packagetypemxrows)}&getListPa=` + JSON.stringify({
+                        "id": "20221109093902",
+                        content: this.data.content
+                    }),
+                });
+
+                getApp().globalData.handleSelect = this.handleInsert.bind(this);
+
+            } else {
+                let detail = getCurrentPages().find(v => v.__route__ == 'packageA/orderForm/detail').data.detail,
+                    id = '';
+                switch (detail.type) {
+                    case '促销订单':
+                        id = 20230107182302;
+                        break;
+                    case '标准订单':
+                        id = 20221109153502;
+                        break;
+                    case '特殊订单':
+                        id = 20221109153502;
+                        break;
+                }
+                wx.navigateTo({
+                    url: `${detail.type=='促销订单'?'/packageA/activity/selectProduct/index':'/select/product/index'}?params=${JSON.stringify({
 					"id":id,
 					"content": {
 						nocache:true,
@@ -181,16 +215,39 @@ Component({
 						}
 					}
 				})}&butText=添加产品`
+                });
+                this.setData({
+                    type: detail.type
+                })
+                getApp().globalData.handleSelect = this.handleSelect.bind(this);
+            }
+
+        },
+        /* 去修改 */
+        editProduct() {
+            wx.navigateTo({
+                url: '/packageA/activity/bindingProduct/index?params=' + JSON.stringify({
+                    "id": 20230107182302,
+                    "version": 1,
+                    "content": {
+                        nocache: true,
+                        sa_orderid, //订单ID
+                        packagetype: this.data.packagetype,
+                        "where": {
+                            "condition": "",
+                            packagetypemx: "",
+                        }
+                    }
+                }) + `&butText=调整套数&packagetypemxrows=${JSON.stringify(this.data.packagetypemxrows)}&getListPa=` + JSON.stringify({
+                    "id": "20221109093902",
+                    content: this.data.content
+                }),
             });
-            this.setData({
-                type: detail.type
-            })
-            getApp().globalData.handleSelect = this.handleSelect.bind(this);
+            getApp().globalData.handleSelect = this.handleInsert.bind(this);
         },
         /* 处理新增产品 */
         handleSelect(detail) {
             let that = this;
-
             _Http.basic({
                 "id": 2024020201095102,
                 "content": {
@@ -203,7 +260,6 @@ Component({
                     title: res.msg,
                     icon: "none"
                 });
-
                 if (res.data.items.length) {
                     if (res.data.isrepeat) {
                         wx.showModal({
@@ -231,63 +287,58 @@ Component({
                     title: '提示',
                     content: `是否确认添加${detail.result.length}件商品?`,
                     complete: (res) => {
-                        if (res.confirm) _Http.basic({
-                            "id": 20221109093602,
-                            content: {
-                                ...that.data.base,
-                                "items": detail.list.map(v => {
-                                    return {
-                                        sa_orderitemsid: 0,
-                                        "itemid": v.itemid, //商品ID
-                                        "qty": v.qty, //数量
-                                        "width": v.width || 0,
-                                        "length": v.length || 0,
-                                        price: that.data.type == '工具订单' ? v.marketprice : v.contractprice,
-                                        sa_promotion_itemsid: v.sa_promotion_itemsid || 0
-                                    }
-                                })
-                            }
-                        }).then(s => {
-                            console.log('新增产品', s)
-                            wx.showToast({
-                                title: s.msg == '成功' ? '添加成功' : s.msg,
-                                icon: "none"
-                            });
-                            if (s.msg == '成功') setTimeout(() => {
-                                that.getList(sa_orderid, true);
-                                wx.navigateBack();
-                                that.updateThePrice();
-                            }, 300)
-                        })
+                        if (res.confirm) that.handleInsert(detail).bind(that)
                     }
                 });
             }
-
-
         },
+        handleInsert({
+            list
+        }) {
+            return new Promise((resolve) => {
+                _Http.basic({
+                    "id": 20221109093602,
+                    content: {
+                        ...this.data.base,
+                        "items": list.map(v => {
+                            return {
+                                sa_orderitemsid: v.sa_orderitemsid || 0,
+                                itemid: v.itemid, //商品ID
+                                qty: v.qty, //数量
+                                width: v.width || 0,
+                                length: v.length || 0,
+                                cheek: v.cheek,
+                                color: v.color,
+                                material: v.material,
+                                spec: v.spec,
+                                custom: v.custom,
+                                price: this.data.type == '工具订单' ? v.marketprice : v.contractprice,
+                                sa_promotion_itemsid: v.sa_promotion_itemsid || 0
+                            }
+                        })
+                    }
+                }).then(s => {
+                    console.log('新增产品', s)
+                    resolve(s.msg == '成功')
+                    wx.showToast({
+                        title: s.msg == '成功' ? '操作成功' : s.msg,
+                        icon: "none",
+                        mask: s.msg == '成功'
+                    });
+                    if (s.msg == '成功') {
+                        this.getList(sa_orderid, true);
+                        this.updateThePrice();
+                        setTimeout(() => {
+                            wx.navigateBack();
+                        }, 300)
+                    }
+                })
+            })
+        },
+
         /* 使用接口更新总价 */
         updateThePrice() {
-            // _Http.basic({
-            //     "id": 20230105101102,
-            //     "content": {
-            //         sa_orderid
-            //     },
-            // }).then(res => {
-            //     console.log("修改列表总价", res)
-            //     if (res.msg != '成功') return wx.showToast({
-            //         title: `产品总价更新失败`,
-            //         icon: "none"
-            //     });
-            //     let page = getCurrentPages()[getCurrentPages().length - 1];
-            //     if (page) {
-            //         this.setData({
-            //             "detail.amount": CNY(res.data.amount)
-            //         })
-            //         page.setLogisticsMsg();
-            //     }
-            // })
-            let page = getCurrentPages().find(v => v.__route__ == 'packageA/orderForm/detail');
-            page.getDetail();
+            getCurrentPages().find(v => v.__route__ == 'packageA/orderForm/detail').getDetail();
         }
     }
 })

+ 6 - 3
packageA/orderForm/modules/product/index.wxml

@@ -1,9 +1,12 @@
 <view class="head">
   <view class="count">产品明细</view>
-  <view class="expand">
-    <navigator wx:if="{{!disabled}}" url="#" class="but" bindtap="addProduct">
+  <view wx:if="{{!disabled}}" class="expand">
+    <navigator wx:if="{{packagetypemxrows.length}}" style="text-align: center;" url="#" class="but" bindtap="editProduct">
+      调整套数
+    </navigator>
+    <navigator url="#" class="but" bindtap="addProduct">
       <van-icon name="plus" />
     </navigator>
   </view>
 </view>
-<List list='{{list}}' privacyFieldC="{{privacyFieldC}}" disabled='{{disabled}}' bindchangeProduct='changeProduct' binddeleteItem="deleteItem" />
+<List list='{{list}}' packagetype="{{packagetype}}" privacyFieldC="{{privacyFieldC}}" disabled='{{disabled}}' bindchangeProduct='changeProduct' binddeleteItem="deleteItem" />

+ 9 - 23
packageA/orderForm/modules/product/list/index.js

@@ -16,7 +16,10 @@ Component({
 		},
 		privacyFieldC: {
 			type: Array
-		}
+		},
+		packagetype: {
+			type: String
+		},
 	},
 	options: {
 		addGlobalClass: true
@@ -28,7 +31,6 @@ Component({
 				name,
 				index
 			} = e.currentTarget.dataset;
-			console.log(e)
 			if (name == 'qty') {
 				if (data.orderminqty > e.detail.value) {
 					wx.showToast({
@@ -64,27 +66,14 @@ Component({
 				saleprice: data.saleprice,
 				defaultprice: data.defaultprice,
 				sa_promotion_itemsid: data.sa_promotion_itemsid || 0,
+				cheek: data.cheek,
+				color: data.color,
+				material: data.material,
+				spec: data.spec,
+				custom: data.custom,
 				// sa_orderitems_v: data.sa_orderitems_v || "",
 				index
 			})
-			//
-		},
-		changeDate(e) {
-			let {
-				data
-			} = e.currentTarget.dataset;
-			this.triggerEvent("changeProduct", {
-				sa_orderitemsid: data.sa_orderitemsid,
-				itemid: data.itemid,
-				qty: data.qty,
-				remarks: data.remarks,
-				needdate: e.detail.value || "",
-				deliverydate: data.deliverydate || "",
-				price: currency(data.price).value,
-				defaultprice: data.defaultprice,
-				sa_promotion_itemsid: data.sa_promotion_itemsid || 0,
-				// sa_orderitems_v: data.sa_orderitems_v || ""
-			})
 		},
 		deleteProduct(e) {
 			this.triggerEvent("deleteItem", e.currentTarget.dataset.item)
@@ -94,9 +83,6 @@ Component({
 				title: '当前状态不可编辑!',
 				icon: "none"
 			})
-		},
-		customization() {
-
 		}
 	}
 })

+ 1 - 1
packageA/orderForm/modules/product/list/index.wxml

@@ -38,7 +38,7 @@
         <view class="row">
             <view>
                 <view class="label">数量<text wx:if="{{item.auxunit}}">({{item.auxunit}})</text>:</view>
-                <input disabled='{{disabled}}' bindtap="isEdit" class="input" style="width: 180rpx;" type="digit" value="{{item.qty}}" data-index="{{index}}" data-name="qty" data-data="{{item}}" bindblur="onBlur" />
+                <input disabled='{{disabled || packagetype}}' bindtap="isEdit" class="input" style="width: 180rpx;" type="digit" value="{{item.qty}}" data-index="{{index}}" data-name="qty" data-data="{{item}}" bindblur="onBlur" />
             </view>
             <view class="money">
                 金额:<text>{{handleHide.verify(item.showAmount,"产品明细",privacyFieldC)}}元</text>

+ 42 - 0
project.private.config.json

@@ -10,6 +10,48 @@
   "condition": {
     "miniprogram": {
       "list": [
+        {
+          "name": "packageA/orderForm/detail",
+          "pathName": "packageA/orderForm/detail",
+          "query": "id=343043",
+          "launchMode": "default",
+          "scene": null
+        },
+        {
+          "name": "packageA/orderForm/index",
+          "pathName": "packageA/orderForm/index",
+          "query": "",
+          "launchMode": "default",
+          "scene": null
+        },
+        {
+          "name": "套餐订单",
+          "pathName": "packageA/orderForm/detail",
+          "query": "id=343021",
+          "launchMode": "default",
+          "scene": null
+        },
+        {
+          "name": "选择套餐",
+          "pathName": "packageA/activity/bindingProduct/index",
+          "query": "params=%7B%22id%22%3A20230116094803%2C%22version%22%3A1%2C%22content%22%3A%7B%22nocache%22%3Atrue%2C%22sa_brandid%22%3A49%2C%22sa_promotionid%22%3A4127%2C%22where%22%3A%7B%22condition%22%3A%22%22%2C%22packagetypemx%22%3A%22%22%7D%7D%7D",
+          "launchMode": "default",
+          "scene": null
+        },
+        {
+          "name": "促销活动",
+          "pathName": "packageA/activity/index",
+          "query": "",
+          "launchMode": "default",
+          "scene": null
+        },
+        {
+          "name": "套餐活动",
+          "pathName": "packageA/activity/detail",
+          "query": "id=4127",
+          "launchMode": "default",
+          "scene": null
+        },
         {
           "name": "打款凭证",
           "pathName": "packageA/remitVoucher/index",