This commit is contained in:
zmj 2024-06-22 21:11:18 +08:00
parent a75f9284f8
commit dc37c653b4
5 changed files with 109 additions and 94 deletions

View File

@ -31,15 +31,15 @@
<view v-if="datas.is_bulk" class="row">
<view>购买重量<text style="color: #F55726;">*</text></view>
<view style="flex: 1;">
<up-input v-model="datas.cart_num" :cursorSpacing='120' type="digit" border="none" placeholder="请输入购买重量"
inputAlign="right"></up-input>
<up-input v-model="datas.cart_num" :cursorSpacing='120' type="digit" border="none"
placeholder="请输入购买重量" inputAlign="right"></up-input>
</view>
</view>
<view v-else class="row">
<view>购买数量<text style="color: #F55726;">*</text></view>
<view style="flex: 1;">
<up-input v-model="datas.cart_num" :cursorSpacing='120' type="digit" border="none" placeholder="请输入购买数量"
inputAlign="right">
<up-input ref='foucs1' v-model="datas.cart_num" :cursorSpacing='120' type="digit" border="none"
placeholder="请输入购买数量" inputAlign="right">
<template #suffix>
<span style="color: #20b128;">{{ datas.unit_name }}</span>
</template>
@ -59,107 +59,116 @@
</template>
<script setup>
import {
computed,
ref
} from "vue"
import {
toast
} from "../uni_modules/uview-plus";
import {
computed,
nextTick,
ref,
const props = defineProps({
show: {
type: Boolean,
default: false
},
})
} from "vue"
import {
toast
} from "../uni_modules/uview-plus";
import {
onShow
} from '@dcloudio/uni-app';
const datas = ref({
cart_num: ''
});
const setData = (e) => {
datas.value = e;
if (Number(e.batch) > 0) datas.value.cart_num = e.batch;
else datas.value.cart_num = '';
const foucs1 = ref(null)
const props = defineProps({
show: {
type: Boolean,
default: false
},
})
}
const datas = ref({
cart_num: ''
});
const setData = (e) => {
datas.value = e;
if (Number(e.batch) > 0) datas.value.cart_num = e.batch;
else datas.value.cart_num = '';
const emit = defineEmits(['close', 'change']);
const close = () => {
emit('close');
}
const change = () => {
if (+datas.value.cart_num < +datas.value.batch) return uni.$u.toast(
`购买数量不能小于${datas.value.batch}${datas.value.unit_name}`);
if (subtotal.value <= 0) {
uni.$u.toast('金额不可小于等于0');
datas.value.cart_num = '';
return;
}
emit('change', datas.value);
}
const subtotal = computed(() => {
let num = +datas.value.cart_num || 0;
let sell = +datas.value.sell || +datas.value.price;
return Number(num * sell * 100 / 100).toFixed(2)
})
const emit = defineEmits(['close', 'change']);
const close = () => {
emit('close');
}
defineExpose({
setData
})
const change = () => {
if (+datas.value.cart_num < +datas.value.batch) return uni.$u.toast(
`购买数量不能小于${datas.value.batch}${datas.value.unit_name}`);
if (subtotal.value <= 0) {
uni.$u.toast('金额不可小于等于0');
datas.value.cart_num = '';
return;
}
emit('change', datas.value);
}
const subtotal = computed(() => {
let num = +datas.value.cart_num || 0;
let sell = +datas.value.sell || +datas.value.price;
return Number(num * sell * 100 / 100).toFixed(2)
})
defineExpose({
setData,
// founcsFn
})
</script>
<style scoped lang="scss">
.good-popup {
padding: 30rpx;
.good-popup {
padding: 30rpx;
.head-title {
font-weight: bold;
text-align: center;
margin-bottom: 20rpx;
}
.row {
display: flex;
align-items: center;
justify-content: space-between;
padding-bottom: 20rpx;
border-bottom: 1rpx solid #f6f6f6;
margin-bottom: 20rpx;
&:last-child {
border-bottom: none;
margin-bottom: 0;
.head-title {
font-weight: bold;
text-align: center;
margin-bottom: 20rpx;
}
.content {
.top {
display: flex;
.row {
display: flex;
align-items: center;
justify-content: space-between;
padding-bottom: 20rpx;
border-bottom: 1rpx solid #f6f6f6;
margin-bottom: 20rpx;
view {
margin-right: 20rpx;
}
&:last-child {
border-bottom: none;
margin-bottom: 0;
}
.bottom {}
}
.content {
.top {
display: flex;
image {
width: 40rpx;
height: 40rpx;
flex-shrink: 0;
view {
margin-right: 20rpx;
}
}
.bottom {}
}
image {
width: 40rpx;
height: 40rpx;
flex-shrink: 0;
}
}
}
}
@keyframes disappear {
to {
opacity: 0;
/* 渐隐 */
transform: scale(0);
/* 缩小 */
@keyframes disappear {
to {
opacity: 0;
/* 渐隐 */
transform: scale(0);
/* 缩小 */
}
}
}
</style>

View File

@ -1,8 +1,8 @@
let BASE_URL
import store from "@/store/user.js"
// 环境
let env = "dev"
// let env = "prod"
// let env = "dev"
let env = "prod"
// let env = "liu";
switch (env) {

View File

@ -82,7 +82,7 @@
<view class="vip-card">
<text>当前已开通</text>
<up-count-to :startVal="0" :endVal="count"></up-count-to>
<text>{{Role==1?'行业会员':'商户'}}会员</text>
<text>{{Role==1?'行业会员':'商户'}}</text>
</view>
<view class="table">
@ -160,8 +160,8 @@
</view>
</view>
</up-popup>
<up-picker :show="showPop1" :columns="columns" @confirm='conformRole' @close="showPop1=false" @open="showPop1=true"
keyName='label_name' confirmColor='#33B83A'></up-picker>
<up-picker :show="showPop1" :columns="columns" @confirm='conformRole' @cancel='showPop1=false'
@close="showPop1=false" @open="showPop1=true" keyName='label_name' confirmColor='#33B83A'></up-picker>
</template>
<script setup>

View File

@ -370,7 +370,8 @@
name: '',
order: '',
store_name: '',
store_id: STORE_INFO.id
// store_id: 23
store_id: 4
})
const loading = ref(true);
@ -386,6 +387,8 @@
if (class_all) class_id = ""; //
if (loadmore) where.value.page_no++;
else where.value.page_no = 1;
// where.value.store_id = 23
where.value.store_id = 4
goodListApi({
...where.value,
class_all: class_all,
@ -522,8 +525,10 @@
const openGoodPopup = (item) => { // /
goodData.value = item;
goodRef.value.setData(item);
// goodRef.value.founcsFn();
showGoodPopup.value = true;
//访
productLogApi({
product_id: item.product_id,
@ -607,7 +612,8 @@
if (opt.id) {
where.value.store_id = opt.id;
const info = await shopDetailApi({
store_id: opt.id
store_id: 4
// store_id: 23
});
//
if (opt.spread_uid) {

View File

@ -16,7 +16,7 @@
<up-button @click="weixinLogin" color="#20B128" size="large"><up-icon name="weixin-fill"
color="#fff" size="28"></up-icon></up-button>
</view>
<view class="btn" v-if="config.ENV=='dev'">
<view class="btn">
<up-button @click="navgo('/pages/login/test')" color="#20B128" size="large"><up-icon
name="account-fill" color="#fff" size="28"></up-icon></up-button>
</view>