From 28e2bc7e92c1634eaf79fcc76d08b7012bdf6957 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E8=B1=AA?= <781521347@qq.com>
Date: Thu, 4 Nov 2021 18:49:56 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AE=A4=E8=AF=81=E6=8E=A5?=
=?UTF-8?q?=E5=8F=A3=E4=BF=AE=E6=94=B9=EF=BC=8C=E4=B8=8A=E4=BC=A0=E5=95=86?=
=?UTF-8?q?=E5=93=81=E4=BC=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
App.vue | 7 +-
pages/life/addGoods/index.vue | 354 +++++++++++++++-------
pages/life/index.vue | 7 +-
pages/release/companyAuth/index.vue | 1 +
pages/release/perfectPersonInfo/index.vue | 58 +---
pages/release/personAuth/index.vue | 19 --
pages/user/goodsManage/index.vue | 5 +
static/images/batch-icon.png | Bin 0 -> 569 bytes
8 files changed, 253 insertions(+), 198 deletions(-)
create mode 100644 static/images/batch-icon.png
diff --git a/App.vue b/App.vue
index 7eba616..3783774 100644
--- a/App.vue
+++ b/App.vue
@@ -27,9 +27,8 @@ export default {
},
onShow(e) {
-
this.globalData.scene = e.scene
- console.log(this.globalData.scene,'this.globalData.scene')
+ // console.log(this.globalData.scene,'this.globalData.scene')
//隐藏系统tabbar
uni.hideTabBar();
var query = {};
@@ -47,12 +46,12 @@ export default {
query = JSON.parse("{" + urlSpread + "}");
}
- console.log('query1', query);
+ // console.log('query1', query);
this.globalData.inviterId = query.id;
}
} else {
query = e.query;
- console.log('query2', query);
+ // console.log('query2', query);
this.globalData.inviterId = query.id;
}
},
diff --git a/pages/life/addGoods/index.vue b/pages/life/addGoods/index.vue
index 66cc27d..303e18c 100644
--- a/pages/life/addGoods/index.vue
+++ b/pages/life/addGoods/index.vue
@@ -40,37 +40,6 @@
-
-
规格设置
@@ -86,32 +55,29 @@
×
-
-
-
-
- 价格*
-
-
-
- 库存*
-
-
-
-
{{batchData.titleStr}}
- 库存
- 价格
+
+
+ 批量修改
+
-
-
- {{i.sku.split(',').reverse().join('/')}}
-
-
+
+
+
+
+ {{i.sku.split(',').reverse().join('/')}}
+
+
+
+ 售价¥{{i.price}}
+ 库存{{i.stock}}
+
+
+
@@ -128,10 +94,10 @@
@@ -139,6 +105,26 @@
提交
+
+
+ {{attrValTitle}}
+
+ 售价(¥)
+
+
+
+ 原价(¥)
+
+
+
+ 库存
+
+
+
+ 取消
+ 确定
+
+
@@ -182,21 +168,55 @@
{
pic: '', //"规格图片 --可选",
price: '', //"价格 元",
- ot_orice: '', //"市场价格 --可选",
+ ot_price: '', //"市场价格 --可选",
stock: '', //"库存",
weight: '', //"重量 --可选",
volume: '', //"体积 --可选"
}
],
+ price: '',
+ ot_price: '',
+ stock:'',
+ isShow: 0,
+ spec_type: 0,
items: [],
- attrArr:[],
+ attrArr:[{
+ value: '规格',
+ detail:['默认']
+ }],
attr:{},
state: 0,
maskShow: false,
addOptionsDialog: false,
infinite: false,
- batchData: {titleStr: '',priceArr: []},
+ batchData: {
+ titleStr: '规格',
+ priceArr: [
+ {
+ bar_code: "",
+ brokerage: 0,
+ brokerage_two: 0,
+ cost: 0,
+ integral: 0,
+ ot_price: 0,
+ pic: "",
+ pink_price: 0,
+ pink_stock: 0,
+ price: 0,
+ seckill_price: 0,
+ seckill_stock: 0,
+ sku: "默认",
+ stock: 0,
+ value1: "",
+ volume: 0,
+ weight: 0,
+ }
+ ],
+ },
editattr: false,
+ idx: null,
+ showAttrVal: false,
+ attrValTitle: ''
}
},
@@ -214,20 +234,16 @@
this.description = info.description
this.store_name = info.store_name
this.items = info.items
- if(info.attrs){
- this.$set(this.batchData,'priceArr',info.attrs)
- this.attrArr = info.items
- let strArr = info.items.map(item=>{
- return item.value
- })
- console.log(strArr)
- this.$set(this.batchData,'titleStr',strArr.join('/'))
- } else{
- this.attrs[0].price = info.price
- this.attrs[0].stock = info.stock
- }
+ this.attrArr = info.items
+ this.spec_type = 1
+ this.isShow = info.is_show
+ let strArr = info.items.map(item=>{
+ return item.value
+ })
+ this.getFormatAttr()
})
} else{
+ this.spec_type = 0
console.log('新增')
}
},
@@ -236,8 +252,9 @@
var imgurls = []
chooseImages((imgs)=>{
imgurls.push(imgs)
+ this.slider_image = imgurls
})
- this.slider_image = imgurls
+
},
uploadImg(idx){
chooseImage((img)=>{
@@ -248,11 +265,6 @@
}
})
},
- uploadSkuImg(idx){
- chooseImage((img)=>{
- this.$set(this.attrs,idx,{pic: img})
- })
- },
toGoodsDetails(){
uni.navigateTo({
url: '/pages/life/goodsDetails/index?desc='+encodeURIComponent(this.description)
@@ -265,10 +277,7 @@
},
//添加属性按钮
addAttr(){
- let j = {
- value: '',
- detail:['']
- }
+ let j = { value: '', detail:[''] }
this.attr = j
this.editattr = false; //添加新属性时是否编辑attr切换成FALSE
this.maskShow = true;
@@ -364,47 +373,69 @@
let allArr = cartesianProductOf(...tmp)
return allArr
},
- // 批量设置价格库存
- changePrice(e){
- const price = e.detail.value
- if(this.batchData.priceArr && this.batchData.priceArr.length > 0){
- this.batchData.priceArr.forEach((item,i)=>{
- item.price = price
- })
+
+ //上传规格图片
+ uploadAttrImg(idx){
+ chooseImage((img)=>{
+ this.batchData.priceArr[idx].pic= img
+ })
+ },
+ //设置规格属性值
+ setAttrVal(idx,type){
+ if(type == 0){
+ this.idx = idx
+ this.price= this.batchData.priceArr[idx].price
+ this.ot_price= this.batchData.priceArr[idx].ot_price
+ this.stock= this.batchData.priceArr[idx].stock
+ this.attrValTitle = this.batchData.priceArr[idx].sku.split(',').reverse().join('/')
+ } else{
+ this.attrValTitle = '批量修改规格'
}
- this.attrs[0].price = price
- // console.log(this.batchData.priceArr,'this.batchData.priceArr')
+
+ this.showAttrVal= true
},
- changeStock(e){
- const stock = e.detail.value
- if(this.batchData.priceArr && this.batchData.priceArr.length > 0){
- this.batchData.priceArr.forEach((item,i)=>{
- item.stock = stock
+ cancelClick(){
+ this.idx = null
+ this.showAttrVal= false
+ },
+ submitClick(){
+ const idx = this.idx
+ console.log(this.price,this.ot_price,this.stock)
+ if(this.stock == 0){
+ return this.alertMessage('商品库存不能为0')
+ }
+ if(this.attrValTitle == '批量修改规格'){
+ this.batchData.priceArr.forEach((item)=>{
+ item.price = this.price
+ item.ot_price = this.ot_price
+ item.stock = this.stock
})
- }
- this.attrs[0].stock = stock
+ } else{
+ this.$set(this.batchData.priceArr[idx],'price',this.price)
+ this.$set(this.batchData.priceArr[idx],'ot_price',this.ot_price)
+ this.$set(this.batchData.priceArr[idx],'stock',this.stock)
+ // this.batchData.priceArr[idx].price= this.price
+ // this.batchData.priceArr[idx].ot_price= this.ot_price
+ // this.batchData.priceArr[idx].stock= this.stock
+ }
+ this.showAttrVal= false
+ },
+ radioChange(e){
+ this.isShow= e.detail.value
},
submit(){
// console.log(this.batchData)
- var arrtsArr = []
- if(this.batchData.priceArr && this.batchData.priceArr[0].price != ''){
- arrtsArr = this.batchData.priceArr
- } else{
- arrtsArr = this.attrs
- }
let form = {
store_name: this.store_name,
unit_name: this.unit_name,
image: this.slider_image[0], //主图
slider_image: this.slider_image , // 轮播图
description: this.description, //商品详情富文本
- tempId: this.tempId, //运费方案
- attrs: arrtsArr,
- state: this.state,
- items: this.items,
- spec_type: arrtsArr.length > 1 ? 1 : 0 //单规格,多规格
+ temp_id: this.tempId, //运费方案
+ attrs: this.batchData.priceArr,
+ isShow: this.isShow,
+ items: this.items
}
- console.log(form)
if(form.store_name == ''){
this.alertMessage('请填写商品名称')
return
@@ -419,16 +450,18 @@
return
}
form.attrs.forEach((item,index)=>{
- if(item.price == ''){
+ if(item.price == '' || item.price == 0){
this.alertMessage('请商品规格价格')
return
- } else if(item.stock == ''){
- this.alertMessage('请商品规格库存')
+ } else if(item.stock == '' || item.stock == 0){
+ this.alertMessage('库存不能为0')
return
}
})
if(this.id != ''){
form.id = this.id
+ form.spec_type = this.spec_type
+ console.log(form)
editProduct(form).then((res)=>{
if(res.success){
uni.showToast({
@@ -448,6 +481,8 @@
}
})
} else{
+ form.spec_type = this.batchData.priceArr.length > 1 ? 1 : 0
+ console.log(form)
addProduct(form).then((res)=>{
if(res.success){
uni.showToast({
@@ -603,6 +638,7 @@
padding: 32rpx;
font-size: 28rpx;
font-weight: 500;
+ margin-bottom: 12rpx;
image{
width: 24rpx;
height: 24rpx;
@@ -682,14 +718,46 @@
width: 19%;
text-align: center;
}
+ .batch{
+ font-size: 24rpx;
+ color: #000;
+ image{
+ width: 24rpx;
+ height: 26rpx;
+ margin-right: 10rpx;
+ }
+ }
}
.box-b{
- margin-top: 6rpx;
- .name{
+ width: 100%;
+ height: 100rpx;
+ background: #FFFFFF;
+ border: 2rpx solid #C0C0C0;
+ border-radius: 8rpx;
+ margin-top: 22rpx;
+ padding: 0 20rpx;
+ .box-b-l{
width: 60%;
+ .name{
+ width: calc(100% - 90rpx);
+ }
+ .attrImg{
+ width: 70rpx;
+ height: 70rpx;
+ border-radius: 8rpx;
+ margin-right: 16rpx;
+ }
}
- .w15{
- width: 19%;
+ .box-b-r{
+ font-size: 24rpx;
+ color: #FF0000;
+ font-weight: 500;
+ margin-right: 14rpx;
+ }
+ .arrow{
+ width: 24rpx;
+ height: 24rpx;
+ transform: rotate(90deg);
}
.inp-box{
text-align: center;
@@ -703,6 +771,62 @@
}
}
}
+ .set-attr-val{
+ width: 100%;
+ padding: 0 40rpx 90rpx;
+ border-radius: 60rpx 60rpx 0px 0px;
+ background:#fff;
+ box-shadow: 0px 6rpx 12rpx rgba(0, 0, 0, 0.2);
+ position: fixed;
+ left: 0;
+ bottom: -999rpx;
+ transition: bottom .2s ease ;
+ &.isShow{
+ bottom: 0;
+ }
+ .title{
+ font-size: 44rpx;
+ color: #343434;
+ text-align: center;
+ padding: 44rpx 0;
+ }
+ .inp-box{
+ display: flex;
+ align-items: center;
+ width: 100%;
+ height: 72rpx;
+ background: #F1F1F1;
+ border-radius: 8rpx;
+ padding: 0 40rpx;
+ font-size: 32rpx;
+ color: #000;
+ margin-bottom: 28rpx;
+ text{
+ width: 200rpx;
+ display: inline-block;
+ }
+ }
+ .btn-box{
+ display: flex;
+ justify-content: space-around;
+ view{
+ width: 230rpx;
+ height: 80rpx;
+ text-align: center;
+ line-height: 80rpx;
+ background: #E9E9E9;
+ border-radius: 40rpx;
+ font-size: 38rpx;
+ color: #fff;
+ }
+ .cancel-btn{
+ bakcground:#E9E9E9
+ }
+ .submit-btn{
+ background: linear-gradient(134deg, #FFA782 0%, #FF6D31 100%);
+ }
+ }
+ }
//弹出层
.mask-box{
width: 100%;
@@ -730,7 +854,7 @@
}
.a-name{
width: 560rpx;
- height: 104rpx;
+ // height: 104rpx;
background: #F7F7F7;
border-radius: 12rpx;
padding: 30rpx;
@@ -745,7 +869,7 @@
width: 80%;
}
.o-item-box{
- height: 56rpx;
+ height: 74rpx;
padding-bottom: 10rpx;
margin-bottom: 10rpx;
border-bottom: 2rpx solid #ececec;
diff --git a/pages/life/index.vue b/pages/life/index.vue
index 97028c2..8859db7 100644
--- a/pages/life/index.vue
+++ b/pages/life/index.vue
@@ -18,7 +18,7 @@
-
+
全部商品
@@ -278,6 +278,7 @@ export default {
line-height: 108rpx;
padding-left: 30rpx;
margin-bottom: 30rpx;
+ padding-top: 190rpx;
.scroll-view_H{
white-space: nowrap;
width: 100%;
@@ -310,7 +311,7 @@ export default {
.warter-box{
width: 100%;
- padding: 0 0 190rpx 24rpx;
+ padding: 92rpx 0 190rpx 24rpx;
.u-waterfall {
width: 100%;
display: flex;
diff --git a/pages/release/companyAuth/index.vue b/pages/release/companyAuth/index.vue
index b809c56..12c98cf 100644
--- a/pages/release/companyAuth/index.vue
+++ b/pages/release/companyAuth/index.vue
@@ -226,6 +226,7 @@
this.form.enterpriseName = authInfo.enterpriseName;
this.form.authorizationPath = authInfo.authorizationPath || '';
this.form.isLegalPerson = 0;
+ this.isEdit = true
}
},
methods: {
diff --git a/pages/release/perfectPersonInfo/index.vue b/pages/release/perfectPersonInfo/index.vue
index 261c88f..55705cd 100644
--- a/pages/release/perfectPersonInfo/index.vue
+++ b/pages/release/perfectPersonInfo/index.vue
@@ -117,37 +117,6 @@ export default {
this.getEnterpriseInfo();
}
},
-
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady: function () {},
-
- /**
- * 生命周期函数--监听页面显示
- */
- onShow: function () {},
-
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide: function () {},
-
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload: function () {},
-
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh: function () {},
-
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom: function () {},
-
/**
* 用户点击右上角分享
*/
@@ -182,9 +151,6 @@ export default {
},
timeChange(e) {
- this.setData({//['form.establishmentTime']: e.detail.value
- });
- //try fix
this.form.establishmentTime = e.detail.value;
},
@@ -193,33 +159,14 @@ export default {
app.http('GET', 'Enterprise/getEnterpriseInfo').then(res => {
if (res.data.success) {
let data = res.data.data;
- this.setData({//['form.enterpriseScale']: data.enterpriseScale
- //['form.enterpriseAddress']: data.enterpriseAddress
- //['form.businessNature']: data.businessNature
- //['form.establishmentTime']: data.establishmentTime
- //['form.latitude']: data.latitude
- //['form.longitude']: data.longitude
- //['form.enterprisePhone']: data.enterprisePhone
- //['form.resourceIntroduction']: data.resourceIntroduction
- //['form.imgPaths']: data.imgPaths
- });
- //try fix
this.form.imgPaths = data.imgPaths;
- //try fix
this.form.resourceIntroduction = data.resourceIntroduction;
- //try fix
this.form.enterprisePhone = data.enterprisePhone;
- //try fix
this.form.longitude = data.longitude;
- //try fix
this.form.latitude = data.latitude;
- //try fix
this.form.establishmentTime = data.establishmentTime;
- //try fix
this.form.businessNature = data.businessNature;
- //try fix
this.form.enterpriseAddress = data.enterpriseAddress;
- //try fix
this.form.enterpriseScale = data.enterpriseScale;
}
});
@@ -276,13 +223,10 @@ export default {
},
resourcesChange(e) {
- // console.log(e)
let idx = Number(e.detail.value);
- this.setData({//['form.industryId']: this.data.resourcesList[idx].id
-
+ this.setData({
resourcesIdx: idx,
});
- //try fix
this.form.industryId = this.resourcesList[idx].id;
},
diff --git a/pages/release/personAuth/index.vue b/pages/release/personAuth/index.vue
index 8581a97..8cb21ce 100644
--- a/pages/release/personAuth/index.vue
+++ b/pages/release/personAuth/index.vue
@@ -74,33 +74,14 @@ export default {
onLoad: function (options) {
if (options.authInfo) {
let authInfo = JSON.parse(decodeURIComponent(options.authInfo));
- this.setData({
- //['form.legalPersonName']: authInfo.legalPersonName
- //['form.legalPhone']: authInfo.legalPhone || ''
- //['form.legalPersonIdcard']: authInfo.legalPersonIdcard
- //['form.idcardPicFront']: authInfo.idcardPicFront
- //['form.idcardPicBehind']: authInfo.idcardPicBehind
- //['form.idcardPicHold']: authInfo.idcardPicHold
- //['form.id']: authInfo.id
- //['form.authorizationType']: 2
- // isEdit: true,
- });
this.isEdit = true,
- //try fix
this.form.authorizationType = 2;
- //try fix
this.form.id = authInfo.id;
- //try fix
this.form.idcardPicHold = authInfo.idcardPicHold;
- //try fix
this.form.idcardPicBehind = authInfo.idcardPicBehind;
- //try fix
this.form.idcardPicFront = authInfo.idcardPicFront;
- //try fix
this.form.legalPersonIdcard = authInfo.legalPersonIdcard;
- //try fix
this.form.legalPhone = authInfo.legalPhone || '';
- //try fix
this.form.legalPersonName = authInfo.legalPersonName;
}
},
diff --git a/pages/user/goodsManage/index.vue b/pages/user/goodsManage/index.vue
index 8310eef..0ff4540 100644
--- a/pages/user/goodsManage/index.vue
+++ b/pages/user/goodsManage/index.vue
@@ -117,6 +117,11 @@
title: res.msg
})
this.changeType(this.type)
+ } else{
+ uni.showToast({
+ title: res.msg,
+ icon: 'none'
+ })
}
})
},
diff --git a/static/images/batch-icon.png b/static/images/batch-icon.png
new file mode 100644
index 0000000000000000000000000000000000000000..29b125a04a157b9f47700a157ed7a71d95d86bc1
GIT binary patch
literal 569
zcmV-90>=G`P)Px$^GQTOR7gv;*2}AoQ547V&pG6hO9xTHaTqa@WTeDQ%3omM7G+>yh!To2RWg!W
z445f0qZphsKuXFb&)#c&_qzPne)?3eejLXpOs+Yb-~NC-
zeKkgN@e1$oxFui(-q!(!@C@g$y(Qow2Acv-V@pfG2xbLfJZ7T^wgAJph}|WCQAED;
zYi0Nhr`vE46AKQF!wh`I=MumpY{c{2{tiqCz{?0F-Lz#E3}6`!V}H*0N)PZeL6*1m
zj#apfQ`nlbUxNOK;8zN7Q3t>pTt`t8?8B5MfT+z6d@r~_6(HJlejOl`95=a_Qjup=
z0YX1Rb%1$E!8fqJWdw}?JtYTV?Y{y{P2vlGgDE|?uptBZlC;q}MU!w6i<7e`aJ26y
zJjejf;sja)A|*Ewpjc7lnfQi}8Nh9<>jH?;5I63PjTqOLa2LBWfVX(k1(2`fe<^Yn
z(iCu}U{pNC!a5x^1zg3ET=HsNk*L$JogrD00000NkvXX
Hu0mjf;sx@2
literal 0
HcmV?d00001