商品添加优化

This commit is contained in:
THK3121 2023-06-06 18:06:22 +08:00
parent 9d9762bd80
commit 0d2438ccff
9 changed files with 865 additions and 810 deletions

View File

@ -26,7 +26,8 @@
</view>
<view class="acea-row row-middle">
<view>发票抬头</view>
<input name="receipt_title" :value="receipt_title" :maxlength="20" placeholder="需要开具发票的企业名称"/>
<input v-if="receipt_title_type == 1" name="receipt_title" :value="receipt_title" :maxlength="20" placeholder="需要开具发票的姓名"/>
<input v-else name="receipt_title" :value="receipt_title" :maxlength="20" placeholder="需要开具发票的企业名称"/>
<text class="iconfont icon-xiangyou" @click="callTitle" ></text>
</view>
<view v-show="receipt_title_type == '2'" class="acea-row row-middle">

View File

@ -103,7 +103,7 @@
</view>
</view>
<!-- <gatherBusiness :userInfoData="userInfoData" /> -->
<gatherBusiness :userInfoData="userInfoData" />
</view>
<!-- <view class="business com" v-if="userInfoData.mer_info.type_id === 11"> -->
@ -230,7 +230,7 @@
that.userInfoData = res.data;
this.mer_id = res.data.service.mer_id
if (!res.data.mer_info) {
that.$set(this, 'jurisdiction', true);
that.$set(this, 'jurisdiction', false);
}
});
}

View File

@ -894,6 +894,7 @@
//,
if (productSelect === undefined && !this.attr.productAttr.length)
productSelect = this.attr.productSelect;
console.log(productSelect);
//0
if (productSelect === undefined) return;
let stock = productSelect.stock || 0;
@ -904,11 +905,11 @@
this.$set(this.attr.productSelect, "cart_num", stock);
this.$set(this, "cart_num", stock);
}
if (num.cart_num > this.storeInfo.once_max_count && this.storeInfo.once_max_count != 0) {
if (num.cart_num > productSelect.stock) {
this.$set(this.attr.productSelect, "cart_num", this.storeInfo.once_max_count);
this.$set(this, "cart_num", this.storeInfo.once_max_count);
return this.$util.Tips({
title: "单次购买件数不能超过" + this.storeInfo.once_max_count + "件!"
title: "单次购买件数不能超过" + productSelect.stock + "件!"
});
}
} else {

View File

@ -47,12 +47,12 @@
};
},
onLoad() {
},
methods: {
addor(item, index) {
this.info.num += item;
if (this.info.num <= 0) {
console.log(goods_info);
this.info.num = 1;
}
},

View File

@ -183,7 +183,7 @@
if (type === 1) {
if (this.stype == 1) {
uni.navigateTo({
url: '/pages/product/addGoods/index'
url: `/pages/product/addGoods/index?mer_id=${this.mer_id}`
});
return;
}

View File

@ -9,8 +9,8 @@
placeholder-class="inputPlaceHolder" />
</view>
<view class="input_content_textarea">
<textarea v-model="setFormData.store_name" placeholder="请输入商品名称" placeholder-class="placeholderStyle"
maxlength="60" />
<textarea v-model="setFormData.store_name" placeholder="请输入商品名称"
placeholder-class="placeholderStyle" maxlength="60" />
<view>
<text v-if="setFormData.store_name">{{ setFormData.store_name.length }}</text>
<text v-else>0</text>
@ -20,13 +20,15 @@
<view class="photo_count">
<text class="photo_size">建议图片尺寸为750*750px</text>
<view class="input_content_photo">
<view class="input_content_photo_adPh" v-for="(item, index) in setFormData.imageList" :key="index">
<view class="input_content_photo_adPh" v-for="(item, index) in setFormData.imageList"
:key="index">
<image :src="item" class="myimg2 photos"></image>
<view class="input_content_photo_adPh_jiao" @click="deleteImage(index)">
<image src="../static/images/close.png" mode=""></image>
</view>
</view>
<view v-if="setFormData.imageList.length < 9" class="input_content_photo_adPh addBtn" @click="clk">
<view v-if="setFormData.imageList.length < 9" class="input_content_photo_adPh addBtn"
@click="clk">
<view>
<image src="../static/images/creamer.png" mode="widthFix"></image>
</view>
@ -137,7 +139,8 @@
<view><span class="iconfont">&#xe6bd;</span></view>
</view>
</view>
<view class="popup_group_item" @click="setSpecifica" v-if="setFormData.spec_type == 1 && setFormData.specifica">
<view class="popup_group_item" @click="setSpecifica"
v-if="setFormData.spec_type == 1 && setFormData.specifica">
<view class="popup_group_item_label">价格设置</view>
<view class="popup_group_item_value">
<view class="popup_group_item_message">
@ -167,18 +170,20 @@
<view class="popup_group_item_label">是否包邮</view>
<view class="popup_group_item_value">
<view class="popup_group_item_message">
<switch :checked="setFormData.delivery_free == '1'" color="#E93323" style="transform:scale(0.8)"
@change="deliveryFreeChange" />
<switch :checked="setFormData.delivery_free == '1'" color="#E93323"
style="transform:scale(0.8)" @change="deliveryFreeChange" />
</view>
</view>
</view>
<view class="popup_group_item" v-if="setFormData.delivery_way.includes('2') && setFormData.delivery_free == 0"
<view class="popup_group_item"
v-if="setFormData.delivery_way.includes('2') && setFormData.delivery_free == 0"
@click="tempIdSelect">
<view class="popup_group_item_label">运费模板</view>
<view class="popup_group_item_value">
<view class="popup_group_item_message">
<span v-if="setFormData.tempName" class="popup_group_item_message_value">{{ setFormData.tempName }}</span>
<span v-if="setFormData.tempName"
class="popup_group_item_message_value">{{ setFormData.tempName }}</span>
<span v-else>请选择运费模板</span>
</view>
<view><span class="iconfont">&#xe6bd;</span></view>
@ -215,11 +220,13 @@
<uni-popup ref="tempId" type="bottom">
<linkage-assembly selectProductTitle="选择运费模板" :form="setFormData" :classifiedData="classified['temp_id']"
:selectProductItem="productItem" :mer_id="merId" @getLinkageData="getTempIdData" @multipleList="multipleList"
@close="$refs.tempId.close()" @scrolltolower="scrolltolower"></linkage-assembly>
:selectProductItem="productItem" :mer_id="merId" @getLinkageData="getTempIdData"
@multipleList="multipleList" @close="$refs.tempId.close()"
@scrolltolower="scrolltolower"></linkage-assembly>
</uni-popup>
<uni-popup ref="attr" type="bottom">
<attr @close="$refs.attr.close()" :mer_id="merId" :attrList="classified['attr']" @selectAttr="selectAttr"></attr>
<attr @close="$refs.attr.close()" :mer_id="merId" :attrList="classified['attr']" @selectAttr="selectAttr">
</attr>
</uni-popup>
<avatar @upload="doUpload" @getName="getImgName" quality="1" ref="avatar" selWidth="250upx" selHeight="250upx">
</avatar>
@ -254,7 +261,10 @@
import storeClassification from '../components/store_classification.vue';
import secound from './secound.vue';
import avatar from "@/components/yq-avatar/yq-avatar.vue";
import { TOKENNAME, HTTP_REQUEST_URL } from '@/config/app.js';
import {
TOKENNAME,
HTTP_REQUEST_URL
} from '@/config/app.js';
import store from '@/store';
export default {
components: {
@ -383,6 +393,7 @@
};
},
onLoad(opt) {
console.log(opt);
this.merId = Number(opt.mer_id);
this.product_id = opt.product_id;
if (opt.code) {
@ -396,6 +407,7 @@
}
},
onShow() {
this.setFormData.store_name = ''
this.setFormData.setSpecificaValue = '';
this.setFormData.setSpecificaValue2 = '';
if (getStorage('singleSpecification')) {
@ -413,7 +425,12 @@
}
this.initClasiffy();
},
beforeDestroy() {
console.log('123');
uni.removeStorage({
key: 'addGoodsFormData'
});
},
watch: {
setFormData: {
handler(val) {
@ -455,15 +472,26 @@
that.deliveryType = res.data.delivery_way.map(String);
if (!that.product_id) that.setFormData.delivery_way = that.deliveryType;
if (that.deliveryType.length == 2) {
that.deliveryFreeList = [
{ value: '1', name: '到店核销' },
{ value: '2', name: '快递配送' }
that.deliveryFreeList = [{
value: '1',
name: '到店核销'
},
{
value: '2',
name: '快递配送'
}
]
} else {
if (that.deliveryType.length == 1 && that.deliveryType[0] == '1') {
that.deliveryFreeList = [{ value: '1', name: '到店核销' }]
that.deliveryFreeList = [{
value: '1',
name: '到店核销'
}]
} else {
that.deliveryFreeList = [{ value: '2', name: '快递配送' }]
that.deliveryFreeList = [{
value: '2',
name: '快递配送'
}]
}
}
},
@ -513,11 +541,13 @@
this.setFormData[item] = editGoodsDetils[item];
});
this.setFormData.product_id = this.product_id;
this.setFormData.imageList = [...(this.setFormData.image ? [this.setFormData.image] : []), ...this
this.setFormData.imageList = [...(this.setFormData.image ? [this.setFormData.image] : []), ...
this
.setFormData.slider_image
];
this.setFormData.cate_name = editGoodsDetils.storeCategory.cate_name; //
this.setFormData.mer_cate_name = editGoodsDetils.merCateId ? editGoodsDetils.merCateId.map(item => item
this.setFormData.mer_cate_name = editGoodsDetils.merCateId ? editGoodsDetils.merCateId.map(
item => item
.category && item.category.cate_name).join(',') : '';
this.setFormData.brand_name = editGoodsDetils.brand ? editGoodsDetils.brand.brand_name : '';
//
@ -551,7 +581,11 @@
},
clk() {
let avatar = this.$refs.avatar;
avatar.fChooseImg(1, { selWidth: '350upx', selHeight: '350upx', inner: true });
avatar.fChooseImg(1, {
selWidth: '350upx',
selHeight: '350upx',
inner: true
});
},
doUpload(rsp) {
let that = this
@ -649,7 +683,10 @@
id = item.value;
});
// str = str.slice(0, str.length - 1);
return { str, id };
return {
str,
id
};
},
//
@ -668,7 +705,10 @@
},
//
selectSpecification() {
attrList(this.merId, { page: 1, limit: 10000 }).then(res => {
attrList(this.merId, {
page: 1,
limit: 10000
}).then(res => {
if (res.data.list.length < 1) return Toast('暂无规格可选');
this.specificationClassification = res.data.list;
this.classified['attr'] = this.specificationClassification;
@ -769,7 +809,9 @@
},
//
setGoodsTemp() {
navigateTo(1, '/pages/product/addGoods/freightTemplate', { mer_id: this.merId });
navigateTo(1, '/pages/product/addGoods/freightTemplate', {
mer_id: this.merId
});
},
//
@ -783,7 +825,9 @@
mer_cate_id: '请选择店铺分类', //
unit_name: '请输入商品单位', //
};
console.log({ ...this.setFormData })
console.log({
...this.setFormData
})
Object.keys(requireData).some(item => {
if (!this.setFormData[item]) {
Toast(requireData[item]);

View File

@ -105,6 +105,7 @@
}
},
watch: {
singleSpecification: {
handler(val) {
@ -125,6 +126,12 @@
})
}
},
// beforeDestroy() {
// console.log('123');
// uni.removeStorage({
// key: 'singleSpecification'
// });
// },
methods: {
selectMoreThan() {
this.formList = this.formList.concat(this.moreThanList);

View File

@ -203,7 +203,8 @@
</swiper-item>
</swiper>
<scroll-view scroll-y="true" v-if="currentNav === 3" class="video-list"
:style="'width: '+ windowWidth +'px; height: '+ windowHeight +'px;'" :refresher-triggered="isTriggered" @scrolltolower="getGoods()" >
:style="'width: '+ windowWidth +'px; height: '+ windowHeight +'px;'" :refresher-triggered="isTriggered"
@scrolltolower="getGoods()">
<block v-for="(item,index) in cateGoods" :key="index">
<view class="goods_item" @click="gogogo(item)">
<image class="goods_img" :src="item.image[0]" mode="aspectFill"></image>
@ -427,6 +428,7 @@
}
},
onLoad(options) {
console.log(options);
this.getOptions(options);
this.videoID = options.id;
this.isUser = options.user == 1 ? true : false;
@ -700,7 +702,7 @@
animationfinish(event) {
let that = this
if (!that.loadVideo || !that.loadMore) return
if (this.k == this.dataList.length - 1 && this.currentNav === 1) {
if (this.k == this.dataList.length - 1 && this.currentNav == 1) {
that.loadVideo = false
this.get()
}
@ -730,10 +732,10 @@
duration: 2000
});
}) :
videoList({
graphicLstApi({
page: that.page,
limit: that.limit,
id: that.videoID
category_id: -1
}).then(res => {
that.videoData(res.data.list)
if (res.data.list.length < that.limit) {

View File

@ -331,11 +331,11 @@
<style lang="scss">
page{background: #ffffff;}
.history{
margin-bottom: 96rpx;
margin-bottom: 100rpx;
.history_count{
padding: 0 30rpx 0;
padding: 0 30rpx calc(0rpx+ constant(safe-area-inset-bottom)); /// IOS<11.2/
padding: 0 30rpx calc(0rpx + env(safe-area-inset-bottom)); /// IOS>11.2/
padding: 0 30rpx calc(100rpx + env(safe-area-inset-bottom)); /// IOS>11.2/
}
.history_header{
justify-content: space-between;