Compare commits
2 Commits
699974b918
...
0ef83a8e79
Author | SHA1 | Date |
---|---|---|
|
0ef83a8e79 | |
|
47fcd00bd2 |
|
@ -1,13 +1,8 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="component text-center">
|
<view class="component text-center">
|
||||||
<view class="component-title">蛋黄酥</view>
|
<view class="component-title">{{name}}</view>
|
||||||
<view class="component-code">
|
<view class="component-code">
|
||||||
<tki-barcode
|
<tki-barcode ref="barcode" onval :val="code" :load-make="true" :opations="barOpations" />
|
||||||
ref="barcode"
|
|
||||||
onval
|
|
||||||
:val="code"
|
|
||||||
:load-make="true"
|
|
||||||
:opations="barOpations"/>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="example">{{code}}</view>
|
<view class="example">{{code}}</view>
|
||||||
<!-- <view class="component-qr">
|
<!-- <view class="component-qr">
|
||||||
|
@ -37,6 +32,7 @@
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
name: '',
|
||||||
code: '',
|
code: '',
|
||||||
barOpations: {
|
barOpations: {
|
||||||
height: 150,
|
height: 150,
|
||||||
|
@ -45,8 +41,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init () {
|
init(val) {
|
||||||
this.code = '0000000000000' // 生成一维码和二维码
|
this.name = val.name;
|
||||||
|
this.code = val.code // 生成一维码和二维码
|
||||||
// setTimeout(() => {
|
// setTimeout(() => {
|
||||||
// this.code = '0987654321' // 5 秒后刷新一维码和二维码
|
// this.code = '0987654321' // 5 秒后刷新一维码和二维码
|
||||||
// }, 5000)
|
// }, 5000)
|
||||||
|
@ -65,6 +62,7 @@
|
||||||
flex: 1;
|
flex: 1;
|
||||||
margin: 32rpx;
|
margin: 32rpx;
|
||||||
padding: 64rpx 32rpx;
|
padding: 64rpx 32rpx;
|
||||||
|
|
||||||
&-title {
|
&-title {
|
||||||
max-height: 112rpx;
|
max-height: 112rpx;
|
||||||
font-size: 40rpx;
|
font-size: 40rpx;
|
||||||
|
@ -72,14 +70,17 @@
|
||||||
line-height: 56rpx;
|
line-height: 56rpx;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
&-code {
|
&-code {
|
||||||
height: 150rpx;
|
height: 150rpx;
|
||||||
margin: 32rpx 32rpx 0;
|
margin: 32rpx 32rpx 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
&-qr {
|
&-qr {
|
||||||
height: 250rpx;
|
height: 250rpx;
|
||||||
margin-top: 36rpx;
|
margin-top: 36rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.coupon-no-view {
|
.coupon-no-view {
|
||||||
margin: 0 18rpx;
|
margin: 0 18rpx;
|
||||||
height: 76rpx;
|
height: 76rpx;
|
||||||
|
@ -89,26 +90,32 @@
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 0 24rpx;
|
padding: 0 24rpx;
|
||||||
margin-top: 36rpx;
|
margin-top: 36rpx;
|
||||||
|
|
||||||
text {
|
text {
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
|
|
||||||
&:first-child {
|
&:first-child {
|
||||||
color: #999999;
|
color: #999999;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.coupon-no {
|
.coupon-no {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.component-title{
|
|
||||||
|
.component-title {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 34rpx;
|
font-size: 34rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.example {
|
.example {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
letter-spacing: 12rpx; /* 设置字符间距 */
|
letter-spacing: 12rpx;
|
||||||
|
/* 设置字符间距 */
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
}
|
}
|
||||||
|
|
|
@ -230,7 +230,7 @@
|
||||||
product_attr_unique: this.sku[this.changeSkuKey].unique,
|
product_attr_unique: this.sku[this.changeSkuKey].unique,
|
||||||
product_id: this.datas.product_id,
|
product_id: this.datas.product_id,
|
||||||
product_type: this.datas.product_type,
|
product_type: this.datas.product_type,
|
||||||
source: this.source||13, // 13-供货采购
|
source: this.source||11, // 11-供货采购
|
||||||
spread_id: "",
|
spread_id: "",
|
||||||
}
|
}
|
||||||
let that = this
|
let that = this
|
||||||
|
|
2
main.js
2
main.js
|
@ -18,9 +18,11 @@ import {
|
||||||
import skeleton from './components/skeleton/index.vue'
|
import skeleton from './components/skeleton/index.vue'
|
||||||
import BaseMoney from './components/BaseMoney.vue';
|
import BaseMoney from './components/BaseMoney.vue';
|
||||||
import uView from '@/uni_modules/uview-ui'
|
import uView from '@/uni_modules/uview-ui'
|
||||||
|
import barcode from "@/components/barcode.vue"
|
||||||
Vue.use(uView)
|
Vue.use(uView)
|
||||||
Vue.component('skeleton', skeleton)
|
Vue.component('skeleton', skeleton)
|
||||||
Vue.component('BaseMoney', BaseMoney)
|
Vue.component('BaseMoney', BaseMoney)
|
||||||
|
Vue.component('barcode', barcode)
|
||||||
Vue.prototype.$util = util;
|
Vue.prototype.$util = util;
|
||||||
Vue.prototype.$Cache = Cache;
|
Vue.prototype.$Cache = Cache;
|
||||||
Vue.prototype.$procure_price = (item)=>{
|
Vue.prototype.$procure_price = (item)=>{
|
||||||
|
|
|
@ -45,6 +45,9 @@
|
||||||
{{ item.cart_info.product.store_name }}
|
{{ item.cart_info.product.store_name }}
|
||||||
</view>
|
</view>
|
||||||
<view class="attr">{{ item.cart_info.product.suk }}</view>
|
<view class="attr">{{ item.cart_info.product.suk }}</view>
|
||||||
|
<view class="attr" @click.stop="showBarCode(item.cart_info.productAttr.product)" v-if="item.cart_info.productAttr.product&&item.cart_info.productAttr.product.bar_code">
|
||||||
|
商品条码: {{ item.cart_info.productAttr.product.bar_code }}
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="money">
|
<view class="money">
|
||||||
|
@ -52,7 +55,7 @@
|
||||||
<view class="num">x{{ item.product_num }}
|
<view class="num">x{{ item.product_num }}
|
||||||
<text class="font-color refund_num" v-if="item.product_num-item.refund_num>0">(-{{item.product_num-item.refund_num}})</text>
|
<text class="font-color refund_num" v-if="item.product_num-item.refund_num>0">(-{{item.product_num-item.refund_num}})</text>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="orderInfo.order_type == 0" class="y-money">¥{{ item.cart_info.productAttr.ot_price }}</view>
|
<!-- <view v-if="orderInfo.order_type == 0" class="y-money">¥{{ item.cart_info.productAttr.ot_price }}</view> -->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</navigator>
|
</navigator>
|
||||||
|
@ -182,6 +185,9 @@
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</u-popup>
|
</u-popup>
|
||||||
|
<view class="bar-code" v-show="showBar" @click="showBar=false">
|
||||||
|
<barcode ref="code"></barcode>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
@ -218,6 +224,7 @@
|
||||||
props: {},
|
props: {},
|
||||||
data: function() {
|
data: function() {
|
||||||
return {
|
return {
|
||||||
|
showBar: false,
|
||||||
order: false,
|
order: false,
|
||||||
change: false,
|
change: false,
|
||||||
order_id: "",
|
order_id: "",
|
||||||
|
@ -273,7 +280,13 @@
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
showBarCode(val){
|
||||||
|
this.showBar = true
|
||||||
|
this.$refs['code'].init({
|
||||||
|
name: val.store_name,
|
||||||
|
code: val.bar_code
|
||||||
|
});
|
||||||
|
},
|
||||||
//收件码
|
//收件码
|
||||||
toPostagequ(item){
|
toPostagequ(item){
|
||||||
this.popUpShow = true
|
this.popUpShow = true
|
||||||
|
@ -987,4 +1000,17 @@
|
||||||
.public-total .money {
|
.public-total .money {
|
||||||
color: #ff4c3c;
|
color: #ff4c3c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.bar-code{
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
z-index: 999999;
|
||||||
|
width: 100vw;
|
||||||
|
height: 100vh;
|
||||||
|
background-color: rgba(0,0,0,0.2);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -45,6 +45,9 @@
|
||||||
{{ item.cart_info.product.store_name }}
|
{{ item.cart_info.product.store_name }}
|
||||||
</view>
|
</view>
|
||||||
<view class="attr">{{ item.cart_info.product.suk }}</view>
|
<view class="attr">{{ item.cart_info.product.suk }}</view>
|
||||||
|
<view class="attr" @click.stop="showBarCode(item.cart_info.productAttr.product)" v-if="item.cart_info.productAttr.product&&item.cart_info.productAttr.product.bar_code">
|
||||||
|
商品条码: {{ item.cart_info.productAttr.product.bar_code }}
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="money">
|
<view class="money">
|
||||||
|
@ -52,7 +55,7 @@
|
||||||
<view class="num">x{{ item.product_num }}
|
<view class="num">x{{ item.product_num }}
|
||||||
<text class="font-color refund_num" v-if="item.product_num-item.refund_num>0">(-{{item.product_num-item.refund_num}})</text>
|
<text class="font-color refund_num" v-if="item.product_num-item.refund_num>0">(-{{item.product_num-item.refund_num}})</text>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="orderInfo.order_type == 0" class="y-money">¥{{ item.cart_info.productAttr.ot_price }}</view>
|
<!-- <view v-if="orderInfo.order_type == 0" class="y-money">¥{{ item.cart_info.productAttr.ot_price }}</view> -->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</navigator>
|
</navigator>
|
||||||
|
@ -182,6 +185,9 @@
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</u-popup>
|
</u-popup>
|
||||||
|
<view class="bar-code" v-show="showBar" @click="showBar=false">
|
||||||
|
<barcode ref="code"></barcode>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
@ -219,6 +225,7 @@
|
||||||
props: {},
|
props: {},
|
||||||
data: function() {
|
data: function() {
|
||||||
return {
|
return {
|
||||||
|
showBar: false,
|
||||||
order: false,
|
order: false,
|
||||||
change: false,
|
change: false,
|
||||||
order_id: "",
|
order_id: "",
|
||||||
|
@ -274,7 +281,13 @@
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
showBarCode(val){
|
||||||
|
this.showBar = true
|
||||||
|
this.$refs['code'].init({
|
||||||
|
name: val.store_name,
|
||||||
|
code: val.bar_code
|
||||||
|
});
|
||||||
|
},
|
||||||
//收件码
|
//收件码
|
||||||
toPostagequ(item){
|
toPostagequ(item){
|
||||||
this.popUpShow = true
|
this.popUpShow = true
|
||||||
|
@ -988,4 +1001,16 @@
|
||||||
.public-total .money {
|
.public-total .money {
|
||||||
color: #ff4c3c;
|
color: #ff4c3c;
|
||||||
}
|
}
|
||||||
|
.bar-code{
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
z-index: 999999;
|
||||||
|
width: 100vw;
|
||||||
|
height: 100vh;
|
||||||
|
background-color: rgba(0,0,0,0.2);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -119,6 +119,9 @@
|
||||||
<view class="attr" v-if="val.cart_info.productAttr.sku">
|
<view class="attr" v-if="val.cart_info.productAttr.sku">
|
||||||
{{ val.cart_info.productAttr.sku }}
|
{{ val.cart_info.productAttr.sku }}
|
||||||
</view>
|
</view>
|
||||||
|
<view class="attr" @click.stop="showBarCode(val.cart_info.productAttr.product)" v-if="val.cart_info.productAttr.product&&val.cart_info.productAttr.product.bar_code">
|
||||||
|
商品条码: {{ val.cart_info.productAttr.product.bar_code }}
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="money">
|
<view class="money">
|
||||||
|
@ -214,7 +217,9 @@
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</u-popup>
|
</u-popup>
|
||||||
|
<view class="bar-code" v-show="showBar" @click="showBar=false">
|
||||||
|
<barcode ref="code"></barcode>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -254,6 +259,7 @@
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
showBar: false,
|
||||||
current: "",
|
current: "",
|
||||||
change: false,
|
change: false,
|
||||||
refundMark: false,
|
refundMark: false,
|
||||||
|
@ -304,6 +310,13 @@
|
||||||
popUpClose() {
|
popUpClose() {
|
||||||
this.popUpShow = false
|
this.popUpShow = false
|
||||||
|
|
||||||
|
},
|
||||||
|
showBarCode(val){
|
||||||
|
this.showBar = true
|
||||||
|
this.$refs['code'].init({
|
||||||
|
name: val.store_name,
|
||||||
|
code: val.bar_code
|
||||||
|
});
|
||||||
},
|
},
|
||||||
//同意先货后款订单
|
//同意先货后款订单
|
||||||
tongyi(id, number) {
|
tongyi(id, number) {
|
||||||
|
@ -1003,4 +1016,16 @@
|
||||||
flex: 1;
|
flex: 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.bar-code{
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
z-index: 999999;
|
||||||
|
width: 100vw;
|
||||||
|
height: 100vh;
|
||||||
|
background-color: rgba(0,0,0,0.2);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
|
@ -119,7 +119,7 @@
|
||||||
<view class="attr" v-if="val.cart_info.productAttr.sku">
|
<view class="attr" v-if="val.cart_info.productAttr.sku">
|
||||||
{{ val.cart_info.productAttr.sku }}
|
{{ val.cart_info.productAttr.sku }}
|
||||||
</view>
|
</view>
|
||||||
<view class="attr" v-if="val.cart_info.productAttr.product&&val.cart_info.productAttr.product.bar_code">
|
<view class="attr" @click.stop="showBarCode(val.cart_info.productAttr.product)" v-if="val.cart_info.productAttr.product&&val.cart_info.productAttr.product.bar_code">
|
||||||
商品条码: {{ val.cart_info.productAttr.product.bar_code }}
|
商品条码: {{ val.cart_info.productAttr.product.bar_code }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -217,7 +217,7 @@
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</u-popup>
|
</u-popup>
|
||||||
<view class="bar-code" v-show="showBar">
|
<view class="bar-code" v-show="showBar" @click="showBar=false">
|
||||||
<barcode ref="code"></barcode>
|
<barcode ref="code"></barcode>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -246,7 +246,6 @@
|
||||||
postconfirm,
|
postconfirm,
|
||||||
logisticsCode
|
logisticsCode
|
||||||
} from "@/api/admin";
|
} from "@/api/admin";
|
||||||
import barcode from "@/components/barcode.vue"
|
|
||||||
import Loading from '@/components/Loading/index'
|
import Loading from '@/components/Loading/index'
|
||||||
import PriceChange from '@/components/PriceChange/index'
|
import PriceChange from '@/components/PriceChange/index'
|
||||||
import {
|
import {
|
||||||
|
@ -257,7 +256,6 @@
|
||||||
components: {
|
components: {
|
||||||
Loading,
|
Loading,
|
||||||
PriceChange,
|
PriceChange,
|
||||||
barcode
|
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -304,9 +302,6 @@
|
||||||
if(option.pay_time){
|
if(option.pay_time){
|
||||||
this.where.pay_time = option.pay_time;
|
this.where.pay_time = option.pay_time;
|
||||||
}
|
}
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs['code'].init()
|
|
||||||
})
|
|
||||||
this.getIndex();
|
this.getIndex();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -314,6 +309,13 @@
|
||||||
popUpClose() {
|
popUpClose() {
|
||||||
this.popUpShow = false
|
this.popUpShow = false
|
||||||
|
|
||||||
|
},
|
||||||
|
showBarCode(val){
|
||||||
|
this.showBar = true
|
||||||
|
this.$refs['code'].init({
|
||||||
|
name: val.store_name,
|
||||||
|
code: val.bar_code
|
||||||
|
});
|
||||||
},
|
},
|
||||||
//同意先货后款订单
|
//同意先货后款订单
|
||||||
tongyi(id, number) {
|
tongyi(id, number) {
|
||||||
|
|
|
@ -773,7 +773,7 @@
|
||||||
cartFn() {
|
cartFn() {
|
||||||
getCartList({
|
getCartList({
|
||||||
product_type: 98,
|
product_type: 98,
|
||||||
source: 13
|
source: 11
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
this.totalMoney = 0
|
this.totalMoney = 0
|
||||||
this.cartList = res.data.list
|
this.cartList = res.data.list
|
||||||
|
@ -786,7 +786,7 @@
|
||||||
})
|
})
|
||||||
getCartCounts({
|
getCartCounts({
|
||||||
product_type: 98,
|
product_type: 98,
|
||||||
source: 13
|
source: 11
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
this.goodsNum = res.data[0].count
|
this.goodsNum = res.data[0].count
|
||||||
})
|
})
|
||||||
|
|
|
@ -81,7 +81,8 @@
|
||||||
import {
|
import {
|
||||||
getStoreGoods,
|
getStoreGoods,
|
||||||
getProductDetail,
|
getProductDetail,
|
||||||
postCartAdd
|
postCartAdd,
|
||||||
|
getStoreDetail,
|
||||||
} from '@/api/store.js'
|
} from '@/api/store.js'
|
||||||
import { Toast } from '@/libs/uniApi'
|
import { Toast } from '@/libs/uniApi'
|
||||||
import goodsPopup from '../cpns/goodsPopup.vue'
|
import goodsPopup from '../cpns/goodsPopup.vue'
|
||||||
|
@ -140,6 +141,7 @@
|
||||||
},
|
},
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
this.id = e.id
|
this.id = e.id
|
||||||
|
this.initStore()
|
||||||
this.getStoreGoodsList()
|
this.getStoreGoodsList()
|
||||||
|
|
||||||
// getStoreGoods(e.id, this.infoData).then(res => {
|
// getStoreGoods(e.id, this.infoData).then(res => {
|
||||||
|
@ -148,6 +150,13 @@
|
||||||
},
|
},
|
||||||
onShow() {},
|
onShow() {},
|
||||||
methods: {
|
methods: {
|
||||||
|
initStore(){
|
||||||
|
getStoreDetail(this.id).then(res=>{
|
||||||
|
console.log(res);
|
||||||
|
}).catch(e=>{
|
||||||
|
console.log(e);
|
||||||
|
})
|
||||||
|
},
|
||||||
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)
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
<text v-if="!item.allCheck" class="iconfont icon-weixuanzhong"></text>
|
<text v-if="!item.allCheck" class="iconfont icon-weixuanzhong"></text>
|
||||||
<text v-else class="iconfont icon-xuanzhong1"></text>
|
<text v-else class="iconfont icon-xuanzhong1"></text>
|
||||||
</view>
|
</view>
|
||||||
<navigator :url="hide_mer_status == 0 ? '/pages/store/home/index?id='+item.mer_id : '#'" class="info">
|
<navigator :url="hide_mer_status == 0 ? '/pages/nongKe/supply_chain/merchant?id='+item.mer_id : '#'" oldurl="/pages/store/home/index?id=" class="info">
|
||||||
<text class="iconfont icon-shangjiadingdan"></text>
|
<text class="iconfont icon-shangjiadingdan"></text>
|
||||||
<view class="name">{{item.mer_name}}</view>
|
<view class="name">{{item.mer_name}}</view>
|
||||||
<text class="iconfont icon-xiangyou"></text>
|
<text class="iconfont icon-xiangyou"></text>
|
||||||
|
@ -680,7 +680,7 @@
|
||||||
},
|
},
|
||||||
getCartNum: function() {
|
getCartNum: function() {
|
||||||
let that = this;
|
let that = this;
|
||||||
getCartCounts({ product_type: 98 }).then(res => {
|
getCartCounts({ product_type: 98, source: 11 }).then(res => {
|
||||||
// console.log(res);
|
// console.log(res);
|
||||||
that.cartTotalCount = res.data[0].count || 0;
|
that.cartTotalCount = res.data[0].count || 0;
|
||||||
});
|
});
|
||||||
|
@ -688,7 +688,7 @@
|
||||||
// 购物车列表
|
// 购物车列表
|
||||||
getCartList: function(isChange) {
|
getCartList: function(isChange) {
|
||||||
let that = this;
|
let that = this;
|
||||||
getCartList({ product_type: 98 }).then(res => {
|
getCartList({ product_type: 98, source: 11 }).then(res => {
|
||||||
this.type_id=res.data?.list[0]?.type_id||[]
|
this.type_id=res.data?.list[0]?.type_id||[]
|
||||||
res.data.list.forEach((item, index) => {
|
res.data.list.forEach((item, index) => {
|
||||||
item.allCheck = true
|
item.allCheck = true
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
<text v-if="!item.allCheck" class="iconfont icon-weixuanzhong"></text>
|
<text v-if="!item.allCheck" class="iconfont icon-weixuanzhong"></text>
|
||||||
<text v-else class="iconfont icon-xuanzhong1"></text>
|
<text v-else class="iconfont icon-xuanzhong1"></text>
|
||||||
</view>
|
</view>
|
||||||
<navigator :url="hide_mer_status == 0 ? '/pages/store/home/index?id='+item.mer_id : '#'" class="info">
|
<navigator :url="hide_mer_status == 0 ? '/pages/nongKe/supply_chain/merchant?id='+item.mer_id : '#'" class="info">
|
||||||
<text class="iconfont icon-shangjiadingdan"></text>
|
<text class="iconfont icon-shangjiadingdan"></text>
|
||||||
<view class="name">{{item.mer_name}}</view>
|
<view class="name">{{item.mer_name}}</view>
|
||||||
<text class="iconfont icon-xiangyou"></text>
|
<text class="iconfont icon-xiangyou"></text>
|
||||||
|
@ -680,7 +680,7 @@
|
||||||
},
|
},
|
||||||
getCartNum: function() {
|
getCartNum: function() {
|
||||||
let that = this;
|
let that = this;
|
||||||
getCartCounts({ product_type: 98, source: 13 }).then(res => {
|
getCartCounts({ product_type: 98, source: 11 }).then(res => {
|
||||||
// console.log(res);
|
// console.log(res);
|
||||||
that.cartTotalCount = res.data[0].count || 0;
|
that.cartTotalCount = res.data[0].count || 0;
|
||||||
});
|
});
|
||||||
|
@ -688,7 +688,7 @@
|
||||||
// 购物车列表
|
// 购物车列表
|
||||||
getCartList: function(isChange) {
|
getCartList: function(isChange) {
|
||||||
let that = this;
|
let that = this;
|
||||||
getCartList({ product_type: 98, source: 13 }).then(res => {
|
getCartList({ product_type: 98, source: 11 }).then(res => {
|
||||||
this.type_id=res.data?.list[0]?.type_id||[]
|
this.type_id=res.data?.list[0]?.type_id||[]
|
||||||
res.data.list.forEach((item, index) => {
|
res.data.list.forEach((item, index) => {
|
||||||
item.allCheck = true
|
item.allCheck = true
|
||||||
|
|
|
@ -104,11 +104,11 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<u-modal :show="showSpecType" title="温馨提示" content="切换后商品原有规格将失效,是否继续?"
|
<u-modal :show="showSpecType" title="温馨提示" content="切换后商品原有规格将失效,是否继续?" show-cancel-button confirm-text="继续"
|
||||||
show-cancel-button confirm-text="继续" @confirm="changeSpecType2" @cancel="showSpecType=false"
|
@confirm="changeSpecType2" @cancel="showSpecType=false"></u-modal>
|
||||||
></u-modal>
|
|
||||||
</picker>
|
</picker>
|
||||||
<priceComponent v-if="setFormData.spec_type==0" :datas="setFormData.attrValue[0]" ref="priceRef" :product_id="product_id" :bar_code="code" @updateCode="updateCode">
|
<priceComponent v-if="setFormData.spec_type==0" :datas="setFormData.attrValue[0]" ref="priceRef"
|
||||||
|
:product_id="product_id" :bar_code="code" @updateCode="updateCode">
|
||||||
</priceComponent>
|
</priceComponent>
|
||||||
<view v-else class="popup_group" style="margin-top: 0;border-top: 1rpx solid #eeeeee;">
|
<view v-else class="popup_group" style="margin-top: 0;border-top: 1rpx solid #eeeeee;">
|
||||||
<view class="popup_group_item" @click="navToSpecGood()">
|
<view class="popup_group_item" @click="navToSpecGood()">
|
||||||
|
@ -278,14 +278,14 @@
|
||||||
this.showCommodity = true;;
|
this.showCommodity = true;;
|
||||||
this.initData();
|
this.initData();
|
||||||
this.initClasiffy();
|
this.initClasiffy();
|
||||||
if(this.import==1){
|
if (this.import == 1) {
|
||||||
this.getOpenerEventChannel().once('importAttrValue', (e) => {
|
this.getOpenerEventChannel().once('importAttrValue', (e) => {
|
||||||
this.attrValue = e.attrValue;
|
this.attrValue = e.attrValue;
|
||||||
uni.setStorageSync('attrValue', JSON.stringify(e.attrValue));
|
uni.setStorageSync('attrValue', JSON.stringify(e.attrValue));
|
||||||
this.attr = e.attr;
|
this.attr = e.attr;
|
||||||
uni.setStorageSync('attr', JSON.stringify(e.attr));
|
uni.setStorageSync('attr', JSON.stringify(e.attr));
|
||||||
this.setFormData = Object.assign({}, this.setFormData, e);
|
this.setFormData = Object.assign({}, this.setFormData, e);
|
||||||
this.$nextTick(()=>{
|
this.$nextTick(() => {
|
||||||
this.$refs.commodityRef?.setDatas({
|
this.$refs.commodityRef?.setDatas({
|
||||||
addGoodsSecoundData: {
|
addGoodsSecoundData: {
|
||||||
is_good: this.setFormData.is_good, // 是否推荐
|
is_good: this.setFormData.is_good, // 是否推荐
|
||||||
|
@ -301,8 +301,7 @@
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
} else if (this.product_id) {
|
||||||
else if(this.product_id){
|
|
||||||
this.initDataEditData();
|
this.initDataEditData();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -402,8 +401,10 @@
|
||||||
item => item
|
item => item
|
||||||
.category && item.category.cate_name).join(',') : '';
|
.category && item.category.cate_name).join(',') : '';
|
||||||
this.setFormData.brand_name = editGoodsDetils.brand ? editGoodsDetils.brand.brand_name : '';
|
this.setFormData.brand_name = editGoodsDetils.brand ? editGoodsDetils.brand.brand_name : '';
|
||||||
if(typeof res.data.content == 'string')res.data.content = JSON.parse(res.data.content);
|
if (res.data.content && typeof res.data.content == 'string') res.data.content = JSON.parse(res.data
|
||||||
|
.content);
|
||||||
//向组件注入数据
|
//向组件注入数据
|
||||||
|
this.$nextTick(() => {
|
||||||
this.$refs.commodityRef.setDatas({
|
this.$refs.commodityRef.setDatas({
|
||||||
addGoodsSecoundData: {
|
addGoodsSecoundData: {
|
||||||
is_good: res.data.is_good, // 是否推荐
|
is_good: res.data.is_good, // 是否推荐
|
||||||
|
@ -421,6 +422,7 @@
|
||||||
if (this.setFormData.spec_type == 0) {
|
if (this.setFormData.spec_type == 0) {
|
||||||
this.$refs.priceRef.setDatas(res.data.attrValue[0]);
|
this.$refs.priceRef.setDatas(res.data.attrValue[0]);
|
||||||
}
|
}
|
||||||
|
})
|
||||||
editGoodsDetils.temp && (this.setFormData.tempName = editGoodsDetils.temp.name);
|
editGoodsDetils.temp && (this.setFormData.tempName = editGoodsDetils.temp.name);
|
||||||
hideLoading();
|
hideLoading();
|
||||||
|
|
||||||
|
@ -432,20 +434,20 @@
|
||||||
},
|
},
|
||||||
initData() {
|
initData() {
|
||||||
// 获取品牌
|
// 获取品牌
|
||||||
categoryBrandlist(this.merId).then((res)=>{
|
categoryBrandlist(this.merId).then((res) => {
|
||||||
this.brand = res.data;
|
this.brand = res.data;
|
||||||
}).catch(e=>{
|
}).catch(e => {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
});
|
});
|
||||||
// 获取平台分类
|
// 获取平台分类
|
||||||
categoryList(this.merId).then((res)=>{
|
categoryList(this.merId).then((res) => {
|
||||||
res.data.forEach((item1) => {
|
res.data.forEach((item1) => {
|
||||||
item1.children.forEach((item2) => {
|
item1.children.forEach((item2) => {
|
||||||
item2.children = null;
|
item2.children = null;
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
this.platformClassificationData = res.data;
|
this.platformClassificationData = res.data;
|
||||||
}).catch(e=>{
|
}).catch(e => {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -600,7 +602,7 @@
|
||||||
// return console.log('商品规格', this.setFormData.attr);
|
// return console.log('商品规格', this.setFormData.attr);
|
||||||
console.log('是否推荐', this.$refs.commodityRef.addGoodsSecoundData);
|
console.log('是否推荐', this.$refs.commodityRef.addGoodsSecoundData);
|
||||||
console.log('商品详情', this.$refs.commodityRef.goodsDis, this.$refs.commodityRef.store_name);
|
console.log('商品详情', this.$refs.commodityRef.goodsDis, this.$refs.commodityRef.store_name);
|
||||||
if(this.setFormData.spec_type==0){
|
if (this.setFormData.spec_type == 0) {
|
||||||
console.log('价格库存', this.$refs.priceRef.singleSpecification);
|
console.log('价格库存', this.$refs.priceRef.singleSpecification);
|
||||||
}
|
}
|
||||||
let postData = {
|
let postData = {
|
||||||
|
@ -612,27 +614,27 @@
|
||||||
},
|
},
|
||||||
video_link: this.$refs.commodityRef.addGoodsSecoundData.video_link,
|
video_link: this.$refs.commodityRef.addGoodsSecoundData.video_link,
|
||||||
};
|
};
|
||||||
if(this.setFormData.spec_type==0){
|
if (this.setFormData.spec_type == 0) {
|
||||||
postData.attrValue = [this.$refs.priceRef.singleSpecification];
|
postData.attrValue = [this.$refs.priceRef.singleSpecification];
|
||||||
}else postData.attrValue = this.setFormData.attrValue;
|
} else postData.attrValue = this.setFormData.attrValue;
|
||||||
postData.stock = postData.attrValue[0]?.stock||0;
|
postData.stock = postData.attrValue[0]?.stock || 0;
|
||||||
if(!postData.store_name||postData.store_name?.trim().length<=0)return Toast('请输入商品名称');
|
if (!postData.store_name || postData.store_name?.trim().length <= 0) return Toast('请输入商品名称');
|
||||||
if(!postData.imageList||postData.imageList?.length<2)return Toast('请上传2张以上商品图片');
|
if (!postData.imageList || postData.imageList?.length < 2) return Toast('请上传2张以上商品图片');
|
||||||
if(!postData.cate_name||postData.cate_name?.trim().length<=0)return Toast('请选择平台分类');
|
if (!postData.cate_name || postData.cate_name?.trim().length <= 0) return Toast('请选择平台分类');
|
||||||
if(!postData.unit_name||postData.unit_name?.trim().length<=0)return Toast('请输入商品单位');
|
if (!postData.unit_name || postData.unit_name?.trim().length <= 0) return Toast('请输入商品单位');
|
||||||
let userInfo = this.$store.state.app.userInfo;
|
let userInfo = this.$store.state.app.userInfo;
|
||||||
if(typeof userInfo == 'string')userInfo= JSON.parse(userInfo);
|
if (typeof userInfo == 'string') userInfo = JSON.parse(userInfo);
|
||||||
let showFlag = '';
|
let showFlag = '';
|
||||||
postData.attrValue.forEach(t=>{
|
postData.attrValue.forEach(t => {
|
||||||
if(userInfo?.mer_info?.type_code=="TypeSupplyChain" && (!t.procure_price||+t.procure_price<=0) ){
|
if (userInfo?.mer_info?.type_code == "TypeSupplyChain" && (!t.procure_price || +t.procure_price <= 0)) {
|
||||||
showFlag = '批发价不能小于0'
|
showFlag = '批发价不能小于0'
|
||||||
}
|
}
|
||||||
if(!t.price||+t.price<=0) showFlag = '零售价不能小于0';
|
if (!t.price || +t.price <= 0) showFlag = '零售价不能小于0';
|
||||||
if(!t.stock||+t.stock<=0) showFlag = '库存不能小于0';
|
if (!t.stock || +t.stock <= 0) showFlag = '库存不能小于0';
|
||||||
if(!t.cost||+t.cost<=0) showFlag = '成本价不能小于0';
|
if (!t.cost || +t.cost <= 0) showFlag = '成本价不能小于0';
|
||||||
})
|
})
|
||||||
if(showFlag) {
|
if (showFlag) {
|
||||||
if(this.setFormData.spec_type==1) showFlag+=', 请点击设置多规格设置';
|
if (this.setFormData.spec_type == 1) showFlag += ', 请点击设置多规格设置';
|
||||||
return Toast(showFlag);
|
return Toast(showFlag);
|
||||||
}
|
}
|
||||||
Loading();
|
Loading();
|
||||||
|
@ -659,11 +661,10 @@
|
||||||
Modal('提交成功', '点击确定,返回商品管理', {
|
Modal('提交成功', '点击确定,返回商品管理', {
|
||||||
showCancel: false,
|
showCancel: false,
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
if(this.import==1){
|
if (this.import == 1) {
|
||||||
uni.$emit('importAttrValueOK', this.setFormData.import_id);
|
uni.$emit('importAttrValueOK', this.setFormData.import_id);
|
||||||
uni.navigateBack();
|
uni.navigateBack();
|
||||||
}
|
} else uni.redirectTo({
|
||||||
else uni.redirectTo({
|
|
||||||
url: '/pages/product/goodsOnSale/index?mer_id=' + this.merId
|
url: '/pages/product/goodsOnSale/index?mer_id=' + this.merId
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
@ -674,30 +675,30 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 选择规格
|
// 选择规格
|
||||||
changeSpecType(e){
|
changeSpecType(e) {
|
||||||
if(this.setFormData.spec_type!=e.detail.value){
|
if (this.setFormData.spec_type != e.detail.value) {
|
||||||
this.showSpecType = true;
|
this.showSpecType = true;
|
||||||
}
|
}
|
||||||
this.spec_type = e.detail.value;
|
this.spec_type = e.detail.value;
|
||||||
},
|
},
|
||||||
// 二次确认
|
// 二次确认
|
||||||
changeSpecType2(){
|
changeSpecType2() {
|
||||||
this.showSpecType = false;
|
this.showSpecType = false;
|
||||||
this.setFormData.spec_type = this.spec_type + '';
|
this.setFormData.spec_type = this.spec_type + '';
|
||||||
this.setFormData.attrValue = [];
|
this.setFormData.attrValue = [];
|
||||||
this.setFormData.attr = [];
|
this.setFormData.attr = [];
|
||||||
},
|
},
|
||||||
// 跳转多规格页面
|
// 跳转多规格页面
|
||||||
navToSpecGood(){
|
navToSpecGood() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url:'/pages/product/addGood/specGood?product_id=' + this.product_id,
|
url: '/pages/product/addGood/specGood?product_id=' + this.product_id,
|
||||||
success: (e) => {
|
success: (e) => {
|
||||||
// console.log(this.setFormData.attrValue, e);
|
// console.log(this.setFormData.attrValue, e);
|
||||||
e.eventChannel.emit('updateAttrValue', {
|
e.eventChannel.emit('updateAttrValue', {
|
||||||
attrValue: JSON.parse(JSON.stringify(this.setFormData.attrValue)),
|
attrValue: JSON.parse(JSON.stringify(this.setFormData.attrValue)),
|
||||||
attr: JSON.parse(JSON.stringify(this.setFormData.attr))
|
attr: JSON.parse(JSON.stringify(this.setFormData.attr))
|
||||||
});
|
});
|
||||||
uni.$once('updateSpecType', (e)=>{
|
uni.$once('updateSpecType', (e) => {
|
||||||
this.setFormData.attrValue = JSON.parse(JSON.stringify(e.attrValue));
|
this.setFormData.attrValue = JSON.parse(JSON.stringify(e.attrValue));
|
||||||
this.setFormData.attr = JSON.parse(JSON.stringify(e.attr));
|
this.setFormData.attr = JSON.parse(JSON.stringify(e.attr));
|
||||||
})
|
})
|
||||||
|
|
|
@ -165,7 +165,8 @@
|
||||||
else this.formList.splice(len-1, this.formList.length);
|
else this.formList.splice(len-1, this.formList.length);
|
||||||
},
|
},
|
||||||
setDatas(data){
|
setDatas(data){
|
||||||
this.singleSpecification = data;
|
console.log('收到', data);
|
||||||
|
this.singleSpecification = {...data};
|
||||||
},
|
},
|
||||||
input(val) {
|
input(val) {
|
||||||
this.singleSpecification = val
|
this.singleSpecification = val
|
||||||
|
|
|
@ -525,7 +525,7 @@
|
||||||
goMall(item) {
|
goMall(item) {
|
||||||
if (this.hide_mer_status == 0) {
|
if (this.hide_mer_status == 0) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/store/home/index?id=' + item.mer_id
|
url: '/pages/nongKe/supply_chain/merchant?id=' + item.mer_id
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue