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

View File

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

View File

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

View File

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

View File

@ -16,7 +16,7 @@
<up-button @click="weixinLogin" color="#20B128" size="large"><up-icon name="weixin-fill" <up-button @click="weixinLogin" color="#20B128" size="large"><up-icon name="weixin-fill"
color="#fff" size="28"></up-icon></up-button> color="#fff" size="28"></up-icon></up-button>
</view> </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 <up-button @click="navgo('/pages/login/test')" color="#20B128" size="large"><up-icon
name="account-fill" color="#fff" size="28"></up-icon></up-button> name="account-fill" color="#fff" size="28"></up-icon></up-button>
</view> </view>