From 76b7a565a310d1376f814f9960e84b6e047bd4a9 Mon Sep 17 00:00:00 2001 From: "tianyi@bogon" Date: Tue, 24 Oct 2023 17:33:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=80=E5=8D=95=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/billing/changeGoods.vue | 4 +- pages/billing/changeGoods1.vue | 251 +++++++++++++++++++----------- pages/index/peopleList.vue | 116 +++++++------- pages/inventory/addGoods.vue | 5 +- pages/inventory/goodsList1.vue | 225 ++++++++++++++------------ pages/inventory/inventory.vue | 120 +++++++------- pages/staff/addStaff/addStaff.vue | 51 +++--- pages/staff/staff.vue | 24 +-- 8 files changed, 447 insertions(+), 349 deletions(-) diff --git a/pages/billing/changeGoods.vue b/pages/billing/changeGoods.vue index 6a1f7c8..e7a97d4 100644 --- a/pages/billing/changeGoods.vue +++ b/pages/billing/changeGoods.vue @@ -74,7 +74,9 @@ }, onLoad(options) { this.goodsDetail = JSON.parse(decodeURIComponent(options.info)) - let newObj = JSON.parse(this.goodsDetail.attributeList) + let newObj = JSON.parse(this.goodsDetail.attributeList) + console.log("1111") + console.log(newObj) let newArr = [] for (let val in newObj) { let valueObj = []; diff --git a/pages/billing/changeGoods1.vue b/pages/billing/changeGoods1.vue index 378d4fd..d0a0166 100644 --- a/pages/billing/changeGoods1.vue +++ b/pages/billing/changeGoods1.vue @@ -12,7 +12,7 @@ - + @@ -38,11 +38,11 @@ - + @@ -53,7 +53,7 @@ 已选择 {{ info }} + class="uni-tab__dot">{{carList.length}} 选好了 @@ -68,43 +68,44 @@ - 创意小众单肩包 - QS2023101001 + {{goodsDetail.productName}} + + {{goodsDetail.barcode}} - ¥0.00 - + ¥{{goodsDetail.price}} + 临时改价
    - -
  • +
  • - 男装 + {{items.name}} - - - 男装 + + + {{itemTag.value}}
- + - 女装 - S码 - 黄色 + {{item.name}} - + - + - 2 款 9 件 - ¥2952.00 + {{item.num}} 件 + ¥{{item.num * item.price}} - 选好了 + 选好了 @@ -113,84 +114,46 @@ + @confirm="changePrice"> - - - - - - 创意小众单肩包 - QS2023101001 - - ¥0.00 - - - - - + - - - - - - - - - 女装 - S码 - 黄色 + + + + - - - - - - - - - 创意小众单肩包 - QS2023101001 - - ¥0.00 - - - + + {{item.productName}} + {{item.productSn}} + + ¥{{item.price}} + + + + - - - - - - - - - - 女装 - S码 - 黄色 - - - - - - - - - 女装 - S码 - 黄色 + + + + + + + 女装 + S码 + 黄色 + + - + 2 款 9 件 @@ -218,7 +181,11 @@ searchName: '', //搜索框输入值 shopId: '', //店铺id, checkbox: [], //需要分享的商品id - numberValue: 0, + temporaryNum: 0, + goodsDetail: [], + attrNameList: [], + temporaryList: [], + carList: [] } }, onLoad() { @@ -243,14 +210,45 @@ } else {} }).catch((res) => {}) }, + attrNameChange(index, index1) { + this.goodsDetail.attributeList[index].value.forEach(item => { + item.isChecked = false; + }) + this.goodsDetail.attributeList[index].isChecked = true; + this.goodsDetail.attributeList[index].value[index1].isChecked = true; + console.log(this.goodsDetail) + var name = ''; + for (var i = 0; i < this.goodsDetail.attributeList.length; i++) { + for (var m = 0, Ien = this.goodsDetail.attributeList[i].value; m < Ien.length; m++) { + console.log(Ien[m]) + if (Ien[m].isChecked == true) { + name += Ien[m].value + } + } + } + this.temporaryList = [{ + id: this.goodsDetail.id, + barcode: this.goodsDetail.barcode, + price: this.goodsDetail.price, + name: name, + num: this.temporaryNum, + productName: this.goodsDetail.productName, + productSn: this.goodsDetail.productSn + }] + }, + temporaryChange(val) { + console.log(val) + this.temporaryList[0].num = val + + }, //点击分类获取商品列表 getShareList(id) { this.tui.request("/app/product/getShareList", "POST", { shopId: '002', - // categoryId:id || '1695090289036890112', - categoryId: '1695090289036890112', - // supplierName:this.searchName || '测试', - supplierName: '测试', + categoryId: id, + // categoryId: '1695090289036890112', + supplierName: this.searchName, + // supplierName: '测试', pageNum: this.pageNum, pageSize: '10' }, false, true).then((res) => { @@ -264,13 +262,15 @@ change(e) { console.log('当前模式:' + e.type + ',状态:' + e.show); }, - //弹出商品规格选择 - toggle(type) { + //弹出购物车或者商品规格选择弹窗 + toggle(type, item) { + this.type = type // open 方法传入参数 等同在 uni-popup 组件上绑定 type属性 if (type == 'carPopup') { this.$refs.carPopup.open('bottom') } else { + this.checkGoods(item); this.$refs.popup.open('bottom') } @@ -282,6 +282,34 @@ // icon: 'none' // }) // }, + //选择商品查询商品规格 + checkGoods(item) { + this.goodsDetail = item + if (typeof(this.goodsDetail.attributeList) == 'string') { + let newObj = JSON.parse(this.goodsDetail.attributeList) + let newArr = [] + for (let val in newObj) { + let valueObj = []; + for (var i = 0; i < newObj[val].length; i++) { + valueObj.push({ + value: newObj[val][i], + isChecked: false + }) + this.attrNameList.push({ + value: newObj[val][i], + name: val, + isChecked: false + }) + } + newArr.push({ + name: val, + value: valueObj + }) + } + this.goodsDetail.attributeList = newArr; + } + + }, //底部右侧两个分享按钮 buttonClick(e) { @@ -343,6 +371,20 @@ inputDialogToggle() { this.$refs.inputDialog.open() }, + //临时改价 + changePrice(val) { + this.goodsDetail.price = this.temporaryList[0].price = val + }, + //弹窗选择规格后,点击弹窗中选好了按钮 + temporaryCheck() { + this.carList.push(this.temporaryList[0]); + this.$refs.popup.close() + // for (var i =0;i @@ -636,4 +678,23 @@ border-radius: 70rpx; } } + + .attrs { + text { + display: inline-block; + border: 1px solid #5fd9ee; + margin: 20rpx; + background-color: #fff; + color: #5fd9ee; + width: 100rpx; + line-height: 70rpx; + height: 70rpx; + text-align: center; + } + + .checkedText { + background-color: $u-primary; + color: #fff; + } + } \ No newline at end of file diff --git a/pages/index/peopleList.vue b/pages/index/peopleList.vue index f6754f7..e77618f 100644 --- a/pages/index/peopleList.vue +++ b/pages/index/peopleList.vue @@ -1,30 +1,31 @@