Merge branch 'pre-release' of https://gitea.lihaink.cn/mkm/shop-applet into pre-release

This commit is contained in:
luofei 2024-05-16 11:44:47 +08:00
commit c4e545d92d
4 changed files with 30 additions and 58 deletions

View File

@ -1,16 +1,20 @@
{ // launch.json configurations app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
// launchtypelocalremote, localremote
"version": "0.0",
"configurations": [{
"app-plus" :
{
"launchtype" : "local"
},
"default" :
{
"launchtype" : "local"
},
"type" : "uniCloud"
}
{
// launch.json configurations app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
// launchtypelocalremote, localremote
"version" : "0.0",
"configurations" : [
{
"app-plus" : {
"launchtype" : "local"
},
"default" : {
"launchtype" : "local"
},
"type" : "uniCloud"
},
{
"playground" : "custom",
"type" : "uni-app:app-android"
}
]
}

View File

@ -322,32 +322,10 @@
},
addGoods(item = {}) {
item = (JSON.stringify(item));
console.log(item)
uni.navigateTo({
url: `/pages/product/addGoodDetail/addGoodDetail?mer_id=${this.mer_id}&&goodsInfo=${item}`
})
return
// if(this.isNullImage(item.image)||
// ( this.isNullImage(item.slider_image[0]) && this.isNullImage(item.slider_image[1]) && this.isNullImage(item.slider_image[2]) )){
// return Toast('');
// }
// if(item.update) return Toast('');
this.putGoods.id = item.id;
this.putGoods.price = '';
this.putGoods.stock = '';
this.putGoods.store_name = item.store_name;
Object.keys(this.showPutGoodsInput).forEach((key) => {
if (item[key] == null || item[key] == undefined || item[key] == '') {
this.showPutGoodsInput[key] = true;
this.putGoods[key] = '';
} else {
this.showPutGoodsInput[key] = false;
this.putGoods[key] = item[key];
}
})
this.initShop(item);
// this.addGoodsShow = true
// this.item = item
},
initShop(item) {
if (item.spec == '' || item.spec == undefined || item.spec == null) {

View File

@ -540,7 +540,6 @@
}
},
choseMedia(e) {
console.log(e.value)
this.show = false
if (e.value[0] == '图片') {
this.handleChooseImage()
@ -640,12 +639,7 @@
this.sets = true
}
})
},
sexSelect(e) {
this.model1.userInfo.sex = e.name
this.$refs.uForm.validateField('userInfo.sex')
@ -656,16 +650,12 @@
})
},
back() {
// console.log('show')
this.go = false
uni.navigateBack()
},
showlayFn() {
uni.navigateBack()
},
// submit() {
// console.log(this.formData)
// },
getAttr(object) {
this.formData.product_attribute = object
},
@ -722,11 +712,9 @@
})
},
submit() {
console.log(this.formData)
this.$refs.formData.validate().then(res => {
this.handAdd()
}).catch(errors => {
// console.log(errors)
uni.$u.toast(errors[0].message)
})
@ -756,14 +744,13 @@
console.log(goods)
this.formData.store_name = goods.store_name
this.formData.imageList = [goods.image, ...goods.slider_image]
console.log(this.formData)
this.formData.attrValue[0].bar_code = goods.bar_code
}
}
},
onLoad(option) {
// let that = this
this.initFormData(option)
this.showSet = option.showSet ? JSON.parse(option.showSet) : this.showSet
this.isSet2()
@ -773,7 +760,6 @@
return item.value == this.formData.delivery_free[0]
})
}
if (option.product_id) {
this.formData.product_id = option.product_id
this.mode = 'edit'
@ -792,13 +778,9 @@
return item.value == this.formData.delivery_free[0]
})
}
console.log(this.formData, 'formDATA')
})
}
console.log(JSON.parse(option.formData))
},
onBackPress: function(e) {
this.showlay = true

View File

@ -58,8 +58,7 @@
</view>
<u-line direction="row" style="margin: 25rpx 0;" color="#ECECEC"></u-line>
<view class="card-li">
<view style="display: flex;color: #777777;"
@click="attrValue.splice(index,1),formData.attr.splice(index,1)">
<view style="display: flex;color: #777777;" @click="delFn(index)">
<u-icon name="trash" style='margin-right: 8rpx;'></u-icon>
</view>
<view class="" style="display: flex;align-items: center;">
@ -176,6 +175,16 @@
}
},
methods: {
delFn(index) {
if (this.attrValue.length == 1) {
return this.$util.Tips({
title: "最少保留一个规格"
})
}
this.attrValue.splice(index, 1)
this.formData.attr.splice(index, 1)
},
choseAttr(name) {
this.isWhose ?
this.attrValue[this.unitIndex].wholesale_unit_name = name :
@ -268,7 +277,6 @@
item.is_use = item.is_use ? '0' : '1'
})
let that = this
console.log(this.formData.attrValue)
this.formData.spec_type = this.formData.attrValue.length > 1 ? '1' : '0'
uni.redirectTo({
url: `/pages/product/addGoodDetail/addGoodDetail?mer_id=${that.mer_id}&&formData=${JSON.stringify(that.formData) }&&showSet=${true}`