Compare commits
2 Commits
c41e3faacd
...
04b40ebb48
Author | SHA1 | Date |
---|---|---|
weipengfei | 04b40ebb48 | |
weipengfei | fcc6a0faa9 |
|
@ -151,6 +151,11 @@
|
||||||
},
|
},
|
||||||
// 输入购买数量
|
// 输入购买数量
|
||||||
inputCartNum(e) {
|
inputCartNum(e) {
|
||||||
|
if(/\D/.test(this.cart_num+'')){
|
||||||
|
return this.$nextTick(()=>{
|
||||||
|
this.cart_num = this.cart_num.replace(/\D/g, '');
|
||||||
|
})
|
||||||
|
}
|
||||||
if(this.sku){
|
if(this.sku){
|
||||||
if (+e.detail.value > this.sku[this.changeSkuKey].stock) {
|
if (+e.detail.value > this.sku[this.changeSkuKey].stock) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
|
|
|
@ -9,8 +9,8 @@ let httpApiThree
|
||||||
let wsApi
|
let wsApi
|
||||||
|
|
||||||
// 在打包之前请检查当前环境是否正确
|
// 在打包之前请检查当前环境是否正确
|
||||||
// const env = 'dev'; // 开发
|
const env = 'dev'; // 开发
|
||||||
const env = 'prod'; // 生产
|
// const env = 'prod'; // 生产
|
||||||
// const env = 'prew'; // 预上线
|
// const env = 'prew'; // 预上线
|
||||||
|
|
||||||
switch (env) {
|
switch (env) {
|
||||||
|
|
|
@ -205,7 +205,8 @@
|
||||||
props: {},
|
props: {},
|
||||||
data: function() {
|
data: function() {
|
||||||
return {
|
return {
|
||||||
types: [{
|
types: [
|
||||||
|
{
|
||||||
type: 1,
|
type: 1,
|
||||||
title: "发货"
|
title: "发货"
|
||||||
},
|
},
|
||||||
|
@ -235,6 +236,7 @@
|
||||||
delivery: {
|
delivery: {
|
||||||
user: {}
|
user: {}
|
||||||
},
|
},
|
||||||
|
mer_info: {},
|
||||||
logistics: [],
|
logistics: [],
|
||||||
delivery_type: 1,
|
delivery_type: 1,
|
||||||
delivery_name: "",
|
delivery_name: "",
|
||||||
|
@ -278,6 +280,15 @@
|
||||||
},
|
},
|
||||||
computed: mapGetters(['viewColor']),
|
computed: mapGetters(['viewColor']),
|
||||||
onLoad: function(option) {
|
onLoad: function(option) {
|
||||||
|
let userInfo = this.$store.state.app.userInfo;
|
||||||
|
if(typeof userInfo == 'string') userInfo = JSON.parse(userInfo);
|
||||||
|
this.mer_info = userInfo.mer_info;
|
||||||
|
if(this.mer_info.type_code == "TypeSupplyChain"){
|
||||||
|
this.types = this.types.filter(item=>{
|
||||||
|
return item.type==2;
|
||||||
|
})
|
||||||
|
this.delivery_type = 2;
|
||||||
|
}
|
||||||
this.order_id = option.id;
|
this.order_id = option.id;
|
||||||
this.merId = option.merId
|
this.merId = option.merId
|
||||||
this.getIndex();
|
this.getIndex();
|
||||||
|
|
|
@ -41,10 +41,10 @@
|
||||||
</block>
|
</block>
|
||||||
<u-loadmore :status="status" :loading-text="loadingText" :loadmore-text="loadmoreText" :nomore-text="nomoreText" />
|
<u-loadmore :status="status" :loading-text="loadingText" :loadmore-text="loadmoreText" :nomore-text="nomoreText" />
|
||||||
|
|
||||||
<navigator class="bottom_purchase" url="./shopping_trolley_a" open-type="navigate">采购清单</navigator>
|
<navigator class="bottom_purchase" url="./shopping_trolley_a" open-type="navigate">采购清单<text v-if="goodsNum">{{goodsNum}}</text></navigator>
|
||||||
|
|
||||||
<goodsPopup :goodsStatu="isPopupShow" @colses="isPopupShow=false" :goods_info="goodsInfo"></goodsPopup>
|
<goodsPopup :goodsStatu="isPopupShow" @colses="isPopupShow=false" :goods_info="goodsInfo"></goodsPopup>
|
||||||
<shortPopup ref="shortPopupRef" ></shortPopup>
|
<shortPopup ref="shortPopupRef"></shortPopup>
|
||||||
<u-popup :show="show" @close="close">
|
<u-popup :show="show" @close="close">
|
||||||
<view>
|
<view>
|
||||||
<h3 style=" margin: 15px 5px 5px 24px;">颜色规格</h3>
|
<h3 style=" margin: 15px 5px 5px 24px;">颜色规格</h3>
|
||||||
|
@ -89,6 +89,9 @@
|
||||||
import {
|
import {
|
||||||
changeCartNum
|
changeCartNum
|
||||||
} from '@/api/order.js';
|
} from '@/api/order.js';
|
||||||
|
import {
|
||||||
|
getCartCounts
|
||||||
|
} from '@/api/requesta.js';
|
||||||
import shortPopup from "@/components/shortPopup.vue"
|
import shortPopup from "@/components/shortPopup.vue"
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
@ -136,7 +139,8 @@
|
||||||
cart_num: 0
|
cart_num: 0
|
||||||
}],
|
}],
|
||||||
goodsLite: {},
|
goodsLite: {},
|
||||||
goodsindexL: ''
|
goodsindexL: '',
|
||||||
|
goodsNum: 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
|
@ -148,7 +152,9 @@
|
||||||
// this.list = res.data.list
|
// this.list = res.data.list
|
||||||
// })
|
// })
|
||||||
},
|
},
|
||||||
onShow() {},
|
onShow() {
|
||||||
|
this.cartFn()
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
initStore(){
|
initStore(){
|
||||||
getStoreDetail(this.id).then(res=>{
|
getStoreDetail(this.id).then(res=>{
|
||||||
|
@ -157,6 +163,15 @@
|
||||||
console.log(e);
|
console.log(e);
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
// 购物车信息
|
||||||
|
cartFn() {
|
||||||
|
getCartCounts({
|
||||||
|
product_type: 98,
|
||||||
|
source: 11
|
||||||
|
}).then(res => {
|
||||||
|
this.goodsNum = res.data[0].count
|
||||||
|
})
|
||||||
|
},
|
||||||
async searchBtn() {
|
async searchBtn() {
|
||||||
this.infoData.page = 1
|
this.infoData.page = 1
|
||||||
const res = await getStoreGoods(this.id, this.infoData)
|
const res = await getStoreGoods(this.id, this.infoData)
|
||||||
|
@ -258,7 +273,7 @@
|
||||||
* 跳转到产品详情
|
* 跳转到产品详情
|
||||||
*/
|
*/
|
||||||
navToGoodsDetails(item){
|
navToGoodsDetails(item){
|
||||||
this.$refs.shortPopupRef.setDatas(item);
|
this.$refs.shortPopupRef.setDatas(item, this.goodsNum);
|
||||||
this.$refs.shortPopupRef.open();
|
this.$refs.shortPopupRef.open();
|
||||||
// uni.navigateTo({
|
// uni.navigateTo({
|
||||||
// url: `/pages/goods_details/index?id=${item.product_id}&referer=`
|
// url: `/pages/goods_details/index?id=${item.product_id}&referer=`
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
<!-- <navigator v-for="goods in item.list" :key="goods.cart_id"
|
<!-- <navigator v-for="goods in item.list" :key="goods.cart_id"
|
||||||
:url='"/pages/goods_details/index?id="+goods.product.product_id' hover-class='none'
|
:url='"/pages/goods_details/index?id="+goods.product.product_id' hover-class='none'
|
||||||
class='picTxt acea-row'> -->
|
class='picTxt acea-row'> -->
|
||||||
<navigator v-for="goods in item.list" :key="goods.cart_id" url='' hover-class='none'
|
<navigator v-for="goods in item.list" :key="goods.cart_id" url='#' hover-class='none'
|
||||||
class='picTxt acea-row'>
|
class='picTxt acea-row'>
|
||||||
<view class="checkbox" @click.stop="goodsCheck(goods,index)">
|
<view class="checkbox" @click.stop="goodsCheck(goods,index)">
|
||||||
<text v-if="!goods.check" class="iconfont icon-weixuanzhong"></text>
|
<text v-if="!goods.check" class="iconfont icon-weixuanzhong"></text>
|
||||||
|
@ -65,8 +65,10 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class='carnum acea-row row-center-wrapper'>
|
<view class='carnum acea-row row-center-wrapper'>
|
||||||
<view class="reduce" :class="goods.numSub ? 'on' : ''" @click.stop='subCart(goods)'>-</view>
|
<view class="reduce" :class="goods.numSub || (goods.cart_num <= goods.product.once_min_count) ? 'on' : ''" @click.stop='subCart(goods)'>-</view>
|
||||||
<view class='num'>{{goods.cart_num}}</view>
|
<view class='num' >
|
||||||
|
<input style="width: 80rpx;" :min="1" :max="50" v-model="goods.cart_num" @blur="inputCartNum(goods)" @input="inputNum(goods)"/>
|
||||||
|
</view>
|
||||||
<view class="plus" :class="goods.numAdd ? 'on' : ''" @click.stop='addCart(goods)'>+</view>
|
<view class="plus" :class="goods.numAdd ? 'on' : ''" @click.stop='addCart(goods)'>+</view>
|
||||||
</view>
|
</view>
|
||||||
</navigator>
|
</navigator>
|
||||||
|
@ -582,14 +584,21 @@
|
||||||
},
|
},
|
||||||
// 立即下单
|
// 立即下单
|
||||||
subOrder: function(event) {
|
subOrder: function(event) {
|
||||||
let selectValue = []
|
let selectValue = [];
|
||||||
|
let stockFlag = false;
|
||||||
this.cartList.valid.forEach(el => {
|
this.cartList.valid.forEach(el => {
|
||||||
el.list.forEach(goods => {
|
el.list.forEach(goods => {
|
||||||
if (goods.check) {
|
if (goods.check) {
|
||||||
selectValue.push(goods.cart_id)
|
selectValue.push(goods.cart_id)
|
||||||
}
|
}
|
||||||
|
if (goods.cart_num > goods.attrValue[0].stock){
|
||||||
|
stockFlag = true;
|
||||||
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
if(stockFlag){
|
||||||
|
return Toast('库存不足!');
|
||||||
|
}
|
||||||
if (selectValue.length > 0) {
|
if (selectValue.length > 0) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/users/order_confirm/index?product_type=98&cartId=${selectValue.join(',')}&type_id=12`
|
url: `/pages/users/order_confirm/index?product_type=98&cartId=${selectValue.join(',')}&type_id=12`
|
||||||
|
@ -656,6 +665,7 @@
|
||||||
// 购物车递减
|
// 购物车递减
|
||||||
subCart(goods) {
|
subCart(goods) {
|
||||||
let status = false;
|
let status = false;
|
||||||
|
if ((goods.cart_num <= goods.product.once_min_count)) return Toast(`${goods.product.once_min_count}件起购哦`);
|
||||||
if (goods.cart_num < 1) status = true;
|
if (goods.cart_num < 1) status = true;
|
||||||
if (goods.cart_num <= 1) {
|
if (goods.cart_num <= 1) {
|
||||||
goods.cart_num = 1;
|
goods.cart_num = 1;
|
||||||
|
@ -684,6 +694,70 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
inputNum(goods){
|
||||||
|
if(/\D/.test(goods.cart_num+'')){
|
||||||
|
return this.$nextTick(()=>{
|
||||||
|
goods.cart_num = goods.cart_num.replace(/\D/g, '');
|
||||||
|
})
|
||||||
|
}
|
||||||
|
let cart_num = Number(goods.cart_num);
|
||||||
|
if(cart_num>+goods.productAttr.stock) {
|
||||||
|
this.$nextTick(()=>{
|
||||||
|
goods.cart_num = goods.productAttr.stock;
|
||||||
|
this.cartAllCheck('goodsCheck')
|
||||||
|
})
|
||||||
|
}
|
||||||
|
else this.cartAllCheck('goodsCheck')
|
||||||
|
// if(cart_num<+goods.product.once_min_count||goods<1) {
|
||||||
|
// this.$nextTick(()=>{
|
||||||
|
// goods.cart_num = goods.product.once_min_count;
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
},
|
||||||
|
// 输入框失去焦点
|
||||||
|
inputCartNum(goods){
|
||||||
|
let status = false;
|
||||||
|
if(!goods.cart_num){
|
||||||
|
goods.product.once_min_count ? goods.cart_num = goods.product.once_min_count : goods.cart_num = 1;
|
||||||
|
return this.updateCartNum(goods);
|
||||||
|
}
|
||||||
|
if (goods.cart_num <= goods.product.once_min_count) {
|
||||||
|
goods.cart_num = goods.product.once_min_count;
|
||||||
|
this.updateCartNum(goods);
|
||||||
|
return Toast(`${goods.product.once_min_count}件起购哦`);
|
||||||
|
}
|
||||||
|
if (goods.cart_num < 1) status = true;
|
||||||
|
if (goods.cart_num <= 1) {
|
||||||
|
goods.cart_num = 1;
|
||||||
|
goods.numSub = true;
|
||||||
|
status = true;
|
||||||
|
} else {
|
||||||
|
if (false == status) {
|
||||||
|
this.updateCartNum(goods);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
updateCartNum(goods){
|
||||||
|
changeCartNum(goods.cart_id, {
|
||||||
|
cart_num: goods.cart_num
|
||||||
|
}).then(res => {
|
||||||
|
goods.numSub = false;
|
||||||
|
goods.numAdd = false;
|
||||||
|
if (goods.cart_num <= 1) {
|
||||||
|
goods.numSub = true;
|
||||||
|
}
|
||||||
|
this.cartAllCheck('goodsCheck')
|
||||||
|
}).catch(error => {
|
||||||
|
this.$util.Tips({
|
||||||
|
title: error
|
||||||
|
});
|
||||||
|
this.$nextTick(()=>{
|
||||||
|
goods.cart_num = goods.productAttr.stock;
|
||||||
|
goods.numAdd = true;
|
||||||
|
this.cartAllCheck('goodsCheck')
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
getCartNum: function() {
|
getCartNum: function() {
|
||||||
let that = this;
|
let that = this;
|
||||||
getCartCounts({ product_type: 98, source: 11 }).then(res => {
|
getCartCounts({ product_type: 98, source: 11 }).then(res => {
|
||||||
|
@ -776,12 +850,12 @@
|
||||||
el.list.forEach(e => {
|
el.list.forEach(e => {
|
||||||
if (e.check) {
|
if (e.check) {
|
||||||
totalMoney = this.$util.$h.Add(totalMoney, this.$util.$h.Mul(e.productAttr.procure_price, e.cart_num))
|
totalMoney = this.$util.$h.Add(totalMoney, this.$util.$h.Mul(e.productAttr.procure_price, e.cart_num))
|
||||||
totalNum += e.cart_num
|
totalNum += +e.cart_num
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
this.cartCount = totalNum
|
this.cartCount = totalNum
|
||||||
this.selectCountPrice = totalMoney
|
this.selectCountPrice = totalMoney > 0 ? totalMoney : '0.00'
|
||||||
// 全选
|
// 全选
|
||||||
this.isAllSelect = allArr.length == this.cartList.valid.length ? true : false
|
this.isAllSelect = allArr.length == this.cartList.valid.length ? true : false
|
||||||
},
|
},
|
||||||
|
|
|
@ -59,8 +59,10 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class='carnum acea-row row-center-wrapper'>
|
<view class='carnum acea-row row-center-wrapper'>
|
||||||
<view class="reduce" :class="goods.numSub || goods.cart_num <= goods.product.once_min_count ? 'on' : ''" @click.stop='subCart(goods)'>-</view>
|
<view class="reduce" :class="goods.numSub || (goods.cart_num <= goods.product.once_min_count) ? 'on' : ''" @click.stop='subCart(goods)'>-</view>
|
||||||
<view class='num'>{{goods.cart_num}}</view>
|
<view class='num' >
|
||||||
|
<input style="width: 80rpx;" v-model="goods.cart_num" @blur="inputCartNum(goods)" @input="inputNum(goods)"/>
|
||||||
|
</view>
|
||||||
<view class="plus" :class="goods.numAdd ? 'on' : ''" @click.stop='addCart(goods)'>+</view>
|
<view class="plus" :class="goods.numAdd ? 'on' : ''" @click.stop='addCart(goods)'>+</view>
|
||||||
</view>
|
</view>
|
||||||
</navigator>
|
</navigator>
|
||||||
|
@ -650,7 +652,7 @@
|
||||||
// 购物车递减
|
// 购物车递减
|
||||||
subCart(goods) {
|
subCart(goods) {
|
||||||
let status = false;
|
let status = false;
|
||||||
if (goods.cart_num <= goods.product.once_min_count) return Toast(`${goods.product.once_min_count}件起购哦`);
|
if ((goods.cart_num <= goods.product.once_min_count)) return Toast(`${goods.product.once_min_count}件起购哦`);
|
||||||
if (goods.cart_num < 1) status = true;
|
if (goods.cart_num < 1) status = true;
|
||||||
if (goods.cart_num <= 1) {
|
if (goods.cart_num <= 1) {
|
||||||
goods.cart_num = 1;
|
goods.cart_num = 1;
|
||||||
|
@ -679,6 +681,70 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
inputNum(goods){
|
||||||
|
if(/\D/.test(goods.cart_num+'')){
|
||||||
|
return this.$nextTick(()=>{
|
||||||
|
goods.cart_num = goods.cart_num.replace(/\D/g, '');
|
||||||
|
})
|
||||||
|
}
|
||||||
|
let cart_num = Number(goods.cart_num);
|
||||||
|
if(cart_num>+goods.productAttr.stock) {
|
||||||
|
this.$nextTick(()=>{
|
||||||
|
goods.cart_num = goods.productAttr.stock;
|
||||||
|
this.cartAllCheck('goodsCheck')
|
||||||
|
})
|
||||||
|
}
|
||||||
|
else this.cartAllCheck('goodsCheck')
|
||||||
|
// if(cart_num<+goods.product.once_min_count||goods<1) {
|
||||||
|
// this.$nextTick(()=>{
|
||||||
|
// goods.cart_num = goods.product.once_min_count;
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
},
|
||||||
|
// 输入框失去焦点
|
||||||
|
inputCartNum(goods){
|
||||||
|
let status = false;
|
||||||
|
if(!goods.cart_num){
|
||||||
|
goods.product.once_min_count ? goods.cart_num = goods.product.once_min_count : goods.cart_num = 1;
|
||||||
|
return this.updateCartNum(goods);
|
||||||
|
}
|
||||||
|
if (goods.cart_num <= goods.product.once_min_count) {
|
||||||
|
goods.cart_num = goods.product.once_min_count;
|
||||||
|
this.updateCartNum(goods);
|
||||||
|
return Toast(`${goods.product.once_min_count}件起购哦`);
|
||||||
|
}
|
||||||
|
if (goods.cart_num < 1) status = true;
|
||||||
|
if (goods.cart_num <= 1) {
|
||||||
|
goods.cart_num = 1;
|
||||||
|
goods.numSub = true;
|
||||||
|
status = true;
|
||||||
|
} else {
|
||||||
|
if (false == status) {
|
||||||
|
this.updateCartNum(goods);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
updateCartNum(goods){
|
||||||
|
changeCartNum(goods.cart_id, {
|
||||||
|
cart_num: goods.cart_num
|
||||||
|
}).then(res => {
|
||||||
|
goods.numSub = false;
|
||||||
|
goods.numAdd = false;
|
||||||
|
if (goods.cart_num <= 1) {
|
||||||
|
goods.numSub = true;
|
||||||
|
}
|
||||||
|
this.cartAllCheck('goodsCheck')
|
||||||
|
}).catch(error => {
|
||||||
|
this.$util.Tips({
|
||||||
|
title: error
|
||||||
|
});
|
||||||
|
this.$nextTick(()=>{
|
||||||
|
goods.cart_num = goods.productAttr.stock;
|
||||||
|
goods.numAdd = true;
|
||||||
|
this.cartAllCheck('goodsCheck')
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
getCartNum: function() {
|
getCartNum: function() {
|
||||||
let that = this;
|
let that = this;
|
||||||
getCartCounts({ product_type: 98, source: 11 }).then(res => {
|
getCartCounts({ product_type: 98, source: 11 }).then(res => {
|
||||||
|
@ -771,12 +837,12 @@
|
||||||
el.list.forEach(e => {
|
el.list.forEach(e => {
|
||||||
if (e.check) {
|
if (e.check) {
|
||||||
totalMoney = this.$util.$h.Add(totalMoney, this.$util.$h.Mul(e.productAttr.procure_price, e.cart_num))
|
totalMoney = this.$util.$h.Add(totalMoney, this.$util.$h.Mul(e.productAttr.procure_price, e.cart_num))
|
||||||
totalNum += e.cart_num
|
totalNum += +e.cart_num
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
this.cartCount = totalNum
|
this.cartCount = totalNum
|
||||||
this.selectCountPrice = totalMoney
|
this.selectCountPrice = totalMoney > 0 ? totalMoney : '0.00'
|
||||||
// 全选
|
// 全选
|
||||||
this.isAllSelect = allArr.length == this.cartList.valid.length ? true : false
|
this.isAllSelect = allArr.length == this.cartList.valid.length ? true : false
|
||||||
},
|
},
|
||||||
|
|
|
@ -59,8 +59,10 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class='carnum acea-row row-center-wrapper'>
|
<view class='carnum acea-row row-center-wrapper'>
|
||||||
<view class="reduce" :class="goods.numSub || goods.cart_num <= goods.product.once_min_count ? 'on' : ''" @click.stop='subCart(goods)'>-</view>
|
<view class="reduce" :class="goods.numSub || (goods.cart_num <= goods.product.once_min_count) ? 'on' : ''" @click.stop='subCart(goods)'>-</view>
|
||||||
<view class='num'>{{goods.cart_num}}</view>
|
<view class='num' >
|
||||||
|
<input style="width: 80rpx;" v-model="goods.cart_num" @blur="inputCartNum(goods)" @input="inputNum(goods)"/>
|
||||||
|
</view>
|
||||||
<view class="plus" :class="goods.numAdd ? 'on' : ''" @click.stop='addCart(goods)'>+</view>
|
<view class="plus" :class="goods.numAdd ? 'on' : ''" @click.stop='addCart(goods)'>+</view>
|
||||||
</view>
|
</view>
|
||||||
</navigator>
|
</navigator>
|
||||||
|
@ -652,7 +654,7 @@
|
||||||
// 购物车递减
|
// 购物车递减
|
||||||
subCart(goods) {
|
subCart(goods) {
|
||||||
let status = false;
|
let status = false;
|
||||||
if (goods.cart_num <= goods.product.once_min_count) return Toast(`${goods.product.once_min_count}件起购哦`);
|
if ((goods.cart_num <= goods.product.once_min_count)) return Toast(`${goods.product.once_min_count}件起购哦`);
|
||||||
if (goods.cart_num < 1) status = true;
|
if (goods.cart_num < 1) status = true;
|
||||||
if (goods.cart_num <= 1) {
|
if (goods.cart_num <= 1) {
|
||||||
goods.cart_num = 1;
|
goods.cart_num = 1;
|
||||||
|
@ -681,6 +683,70 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
inputNum(goods){
|
||||||
|
if(/\D/.test(goods.cart_num+'')){
|
||||||
|
return this.$nextTick(()=>{
|
||||||
|
goods.cart_num = goods.cart_num.replace(/\D/g, '');
|
||||||
|
})
|
||||||
|
}
|
||||||
|
let cart_num = Number(goods.cart_num);
|
||||||
|
if(cart_num>+goods.productAttr.stock) {
|
||||||
|
this.$nextTick(()=>{
|
||||||
|
goods.cart_num = goods.productAttr.stock;
|
||||||
|
this.cartAllCheck('goodsCheck')
|
||||||
|
})
|
||||||
|
}
|
||||||
|
else this.cartAllCheck('goodsCheck')
|
||||||
|
// if(cart_num<+goods.product.once_min_count||goods<1) {
|
||||||
|
// this.$nextTick(()=>{
|
||||||
|
// goods.cart_num = goods.product.once_min_count;
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
},
|
||||||
|
// 输入框失去焦点
|
||||||
|
inputCartNum(goods){
|
||||||
|
let status = false;
|
||||||
|
if(!goods.cart_num){
|
||||||
|
goods.product.once_min_count ? goods.cart_num = goods.product.once_min_count : goods.cart_num = 1;
|
||||||
|
return this.updateCartNum(goods);
|
||||||
|
}
|
||||||
|
if (goods.cart_num <= goods.product.once_min_count) {
|
||||||
|
goods.cart_num = goods.product.once_min_count;
|
||||||
|
this.updateCartNum(goods);
|
||||||
|
return Toast(`${goods.product.once_min_count}件起购哦`);
|
||||||
|
}
|
||||||
|
if (goods.cart_num < 1) status = true;
|
||||||
|
if (goods.cart_num <= 1) {
|
||||||
|
goods.cart_num = 1;
|
||||||
|
goods.numSub = true;
|
||||||
|
status = true;
|
||||||
|
} else {
|
||||||
|
if (false == status) {
|
||||||
|
this.updateCartNum(goods);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
updateCartNum(goods){
|
||||||
|
changeCartNum(goods.cart_id, {
|
||||||
|
cart_num: goods.cart_num
|
||||||
|
}).then(res => {
|
||||||
|
goods.numSub = false;
|
||||||
|
goods.numAdd = false;
|
||||||
|
if (goods.cart_num <= 1) {
|
||||||
|
goods.numSub = true;
|
||||||
|
}
|
||||||
|
this.cartAllCheck('goodsCheck')
|
||||||
|
}).catch(error => {
|
||||||
|
this.$util.Tips({
|
||||||
|
title: error
|
||||||
|
});
|
||||||
|
this.$nextTick(()=>{
|
||||||
|
goods.cart_num = goods.productAttr.stock;
|
||||||
|
goods.numAdd = true;
|
||||||
|
this.cartAllCheck('goodsCheck')
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
getCartNum: function() {
|
getCartNum: function() {
|
||||||
let that = this;
|
let that = this;
|
||||||
getCartCounts({
|
getCartCounts({
|
||||||
|
@ -779,12 +845,12 @@
|
||||||
el.list.forEach(e => {
|
el.list.forEach(e => {
|
||||||
if (e.check) {
|
if (e.check) {
|
||||||
totalMoney = this.$util.$h.Add(totalMoney, this.$util.$h.Mul(e.productAttr.procure_price, e.cart_num))
|
totalMoney = this.$util.$h.Add(totalMoney, this.$util.$h.Mul(e.productAttr.procure_price, e.cart_num))
|
||||||
totalNum += e.cart_num
|
totalNum += +e.cart_num
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
this.cartCount = totalNum
|
this.cartCount = totalNum
|
||||||
this.selectCountPrice = totalMoney
|
this.selectCountPrice = totalMoney > 0 ? totalMoney : '0.00'
|
||||||
// 全选
|
// 全选
|
||||||
this.isAllSelect = allArr.length == this.cartList.valid.length ? true : false
|
this.isAllSelect = allArr.length == this.cartList.valid.length ? true : false
|
||||||
},
|
},
|
||||||
|
|
|
@ -306,7 +306,7 @@
|
||||||
<view class="content-clip"></view>
|
<view class="content-clip"></view>
|
||||||
<view class='footer acea-row row-right row-middle' v-if="isGoodsReturn==false">
|
<view class='footer acea-row row-right row-middle' v-if="isGoodsReturn==false">
|
||||||
<!-- <view class='bnt cancel' @click="cancelSales">取消售后</view> -->
|
<!-- <view class='bnt cancel' @click="cancelSales">取消售后</view> -->
|
||||||
<!-- <view v-if="!orderInfo.receipt && !isGoodsReturn" class='bnt cancel' @click="applyInvoice">申请开票</view> -->
|
<view v-if="!orderInfo.receipt && !isGoodsReturn" class='bnt cancel' @click="applyInvoice">申请开票</view>
|
||||||
<view v-if="orderInfo.activity_type == 2 && (orderInfo.status == 10 || orderInfo.status == 11)"
|
<view v-if="orderInfo.activity_type == 2 && (orderInfo.status == 10 || orderInfo.status == 11)"
|
||||||
class=" acea-row row-right row-middle">
|
class=" acea-row row-right row-middle">
|
||||||
<view v-if="orderInfo.presellOrder.activeStatus == 0" class='bnt b-color btn_auto'>
|
<view v-if="orderInfo.presellOrder.activeStatus == 0" class='bnt b-color btn_auto'>
|
||||||
|
|
|
@ -150,6 +150,13 @@
|
||||||
placeholder="填写关键字" /></view>
|
placeholder="填写关键字" /></view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="input_content">
|
||||||
|
<view class="input_content_keyword">
|
||||||
|
<view class="input_content_keyword_label">最少购买件数</view>
|
||||||
|
<view class="input_content_keyword_value"><input v-model="setFormData.once_min_count" type="number" value=""
|
||||||
|
placeholder="不限量" /></view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
<view class="radio">
|
<view class="radio">
|
||||||
<view class="radio_label ">送货方式</view>
|
<view class="radio_label ">送货方式</view>
|
||||||
<checkbox-group class="select_group flex_start">
|
<checkbox-group class="select_group flex_start">
|
||||||
|
@ -242,7 +249,8 @@
|
||||||
delivery_way: [1, 2], // 配送方式 1 到店核销 2 快递配送
|
delivery_way: [1, 2], // 配送方式 1 到店核销 2 快递配送
|
||||||
delivery_free: '1', // 是否包邮 0不包邮 1包邮
|
delivery_free: '1', // 是否包邮 0不包邮 1包邮
|
||||||
temp_id: '', // 运费模板ID
|
temp_id: '', // 运费模板ID
|
||||||
tempName: '' // 运费模板名称
|
tempName: '' ,// 运费模板名称
|
||||||
|
once_min_count: '', //最少购买件数
|
||||||
},
|
},
|
||||||
platformClassificationData: [], // 平台分类数据
|
platformClassificationData: [], // 平台分类数据
|
||||||
merchantClassification: [], // 店铺分类
|
merchantClassification: [], // 店铺分类
|
||||||
|
@ -382,7 +390,8 @@
|
||||||
delivery_way: [], // 配送方式 1 到店核销 2 快递配送
|
delivery_way: [], // 配送方式 1 到店核销 2 快递配送
|
||||||
delivery_free: '0', // 是否包邮 0不包邮 1包邮
|
delivery_free: '0', // 是否包邮 0不包邮 1包邮
|
||||||
temp_id: '', // 运费模板ID
|
temp_id: '', // 运费模板ID
|
||||||
tempName: '' // 运费模板名称
|
tempName: '' ,// 运费模板名称
|
||||||
|
once_min_count: '', //最小购买数量
|
||||||
};
|
};
|
||||||
productDetail(this.merId, this.product_id).then(async (res) => {
|
productDetail(this.merId, this.product_id).then(async (res) => {
|
||||||
this.showCommodity = true;
|
this.showCommodity = true;
|
||||||
|
@ -403,6 +412,7 @@
|
||||||
this.setFormData.brand_name = editGoodsDetils.brand ? editGoodsDetils.brand.brand_name : '';
|
this.setFormData.brand_name = editGoodsDetils.brand ? editGoodsDetils.brand.brand_name : '';
|
||||||
if (res.data.content && typeof res.data.content == 'string') res.data.content = JSON.parse(res.data
|
if (res.data.content && typeof res.data.content == 'string') res.data.content = JSON.parse(res.data
|
||||||
.content);
|
.content);
|
||||||
|
this.setFormData.once_min_count <= 0 ? this.setFormData.once_min_count = '' : null;
|
||||||
//向组件注入数据
|
//向组件注入数据
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.commodityRef.setDatas({
|
this.$refs.commodityRef.setDatas({
|
||||||
|
|
|
@ -261,8 +261,8 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class='bottom acea-row row-right row-middle'>
|
<view class='bottom acea-row row-right row-middle'>
|
||||||
<!-- <view v-if="!item.receipt && item.status != -1" class='bnt cancelBnt'
|
<view v-if="!item.receipt && item.status != -1" class='bnt cancelBnt'
|
||||||
@click.stop='applyInvoice(item.order_id)'>申请开票</view> -->
|
@click.stop='applyInvoice(item.order_id)'>申请开票</view>
|
||||||
<block v-if="item.order_status==2">
|
<block v-if="item.order_status==2">
|
||||||
<view class='bnt b-color' @click='consignment(item.order_id)'>去发货</view>
|
<view class='bnt b-color' @click='consignment(item.order_id)'>去发货</view>
|
||||||
</block>
|
</block>
|
||||||
|
|
|
@ -260,8 +260,8 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class='bottom acea-row row-right row-middle'>
|
<view class='bottom acea-row row-right row-middle'>
|
||||||
<!-- <view v-if="!item.receipt && item.status != -1" class='bnt cancelBnt'
|
<view v-if="!item.receipt && item.status != -1 && (item.status != 0)" class='bnt cancelBnt'
|
||||||
@click.stop='applyInvoice(item.order_id)'>申请开票</view> -->
|
@click.stop='applyInvoice(item.order_id)'>申请开票</view>
|
||||||
<block v-if="item.status == 0 || item.status == 9 || item.status == -1">
|
<block v-if="item.status == 0 || item.status == 9 || item.status == -1">
|
||||||
<view class='bnt b-color' @click='goOrderDetails(item.order_id, item)'>查看详情</view>
|
<view class='bnt b-color' @click='goOrderDetails(item.order_id, item)'>查看详情</view>
|
||||||
</block>
|
</block>
|
||||||
|
|
Loading…
Reference in New Issue