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/ {
// launch.json configurations app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
// launchtypelocalremote, localremote // launchtypelocalremote, localremote
"version": "0.0", "version" : "0.0",
"configurations": [{ "configurations" : [
"app-plus" :
{ {
"app-plus" : {
"launchtype" : "local" "launchtype" : "local"
}, },
"default" : "default" : {
{
"launchtype" : "local" "launchtype" : "local"
}, },
"type" : "uniCloud" "type" : "uniCloud"
},
{
"playground" : "custom",
"type" : "uni-app:app-android"
} }
] ]
} }

View File

@ -322,32 +322,10 @@
}, },
addGoods(item = {}) { addGoods(item = {}) {
item = (JSON.stringify(item)); item = (JSON.stringify(item));
console.log(item)
uni.navigateTo({ uni.navigateTo({
url: `/pages/product/addGoodDetail/addGoodDetail?mer_id=${this.mer_id}&&goodsInfo=${item}` url: `/pages/product/addGoodDetail/addGoodDetail?mer_id=${this.mer_id}&&goodsInfo=${item}`
}) })
return 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) { initShop(item) {
if (item.spec == '' || item.spec == undefined || item.spec == null) { if (item.spec == '' || item.spec == undefined || item.spec == null) {

View File

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

View File

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