商品添加优化

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>
<view class="acea-row row-middle"> <view class="acea-row row-middle">
<view>发票抬头</view> <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> <text class="iconfont icon-xiangyou" @click="callTitle" ></text>
</view> </view>
<view v-show="receipt_title_type == '2'" class="acea-row row-middle"> <view v-show="receipt_title_type == '2'" class="acea-row row-middle">

View File

@ -103,7 +103,7 @@
</view> </view>
</view> </view>
<!-- <gatherBusiness :userInfoData="userInfoData" /> --> <gatherBusiness :userInfoData="userInfoData" />
</view> </view>
<!-- <view class="business com" v-if="userInfoData.mer_info.type_id === 11"> --> <!-- <view class="business com" v-if="userInfoData.mer_info.type_id === 11"> -->
@ -230,7 +230,7 @@
that.userInfoData = res.data; that.userInfoData = res.data;
this.mer_id = res.data.service.mer_id this.mer_id = res.data.service.mer_id
if (!res.data.mer_info) { 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) if (productSelect === undefined && !this.attr.productAttr.length)
productSelect = this.attr.productSelect; productSelect = this.attr.productSelect;
console.log(productSelect);
//0 //0
if (productSelect === undefined) return; if (productSelect === undefined) return;
let stock = productSelect.stock || 0; let stock = productSelect.stock || 0;
@ -904,11 +905,11 @@
this.$set(this.attr.productSelect, "cart_num", stock); this.$set(this.attr.productSelect, "cart_num", stock);
this.$set(this, "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.attr.productSelect, "cart_num", this.storeInfo.once_max_count);
this.$set(this, "cart_num", this.storeInfo.once_max_count); this.$set(this, "cart_num", this.storeInfo.once_max_count);
return this.$util.Tips({ return this.$util.Tips({
title: "单次购买件数不能超过" + this.storeInfo.once_max_count + "件!" title: "单次购买件数不能超过" + productSelect.stock + "件!"
}); });
} }
} else { } else {

View File

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

View File

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

File diff suppressed because it is too large Load Diff

View File

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

View File

@ -203,7 +203,8 @@
</swiper-item> </swiper-item>
</swiper> </swiper>
<scroll-view scroll-y="true" v-if="currentNav === 3" class="video-list" <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"> <block v-for="(item,index) in cateGoods" :key="index">
<view class="goods_item" @click="gogogo(item)"> <view class="goods_item" @click="gogogo(item)">
<image class="goods_img" :src="item.image[0]" mode="aspectFill"></image> <image class="goods_img" :src="item.image[0]" mode="aspectFill"></image>
@ -320,7 +321,7 @@
}, mapGetters(['isLogin', 'uid'])), }, mapGetters(['isLogin', 'uid'])),
data() { data() {
return { return {
isTriggered:false, isTriggered: false,
imgHost: HTTP_REQUEST_URL, imgHost: HTTP_REQUEST_URL,
videoID: 0, videoID: 0,
pinlunNum: 0, pinlunNum: 0,
@ -390,8 +391,8 @@
page: 1, page: 1,
limit: 5 limit: 5
}, },
communityId:'', communityId: '',
Listcount:'', Listcount: '',
loadMore: true, loadMore: true,
} }
}, },
@ -427,6 +428,7 @@
} }
}, },
onLoad(options) { onLoad(options) {
console.log(options);
this.getOptions(options); this.getOptions(options);
this.videoID = options.id; this.videoID = options.id;
this.isUser = options.user == 1 ? true : false; this.isUser = options.user == 1 ? true : false;
@ -516,7 +518,7 @@
} = await graphicLstApi(this.where) } = await graphicLstApi(this.where)
this.cateGoods.push(...data.list) this.cateGoods.push(...data.list)
this.where.page++ this.where.page++
if(data.list.length < this.where.limit){ if (data.list.length < this.where.limit) {
this.loadMore = false this.loadMore = false
} }
}, },
@ -700,7 +702,7 @@
animationfinish(event) { animationfinish(event) {
let that = this let that = this
if (!that.loadVideo || !that.loadMore) return 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 that.loadVideo = false
this.get() this.get()
} }
@ -730,10 +732,10 @@
duration: 2000 duration: 2000
}); });
}) : }) :
videoList({ graphicLstApi({
page: that.page, page: that.page,
limit: that.limit, limit: that.limit,
id: that.videoID category_id: -1
}).then(res => { }).then(res => {
that.videoData(res.data.list) that.videoData(res.data.list)
if (res.data.list.length < that.limit) { if (res.data.list.length < that.limit) {
@ -746,7 +748,7 @@
duration: 2000 duration: 2000
}); });
}) })
that.loadVideo = true that.loadVideo = true
}, },
getFocusList() { getFocusList() {
let that = this; let that = this;

View File

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