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,37 +59,43 @@
</template>
<script setup>
import {
import {
computed,
ref
} from "vue"
import {
toast
} from "../uni_modules/uview-plus";
nextTick,
ref,
const props = defineProps({
} from "vue"
import {
toast
} from "../uni_modules/uview-plus";
import {
onShow
} from '@dcloudio/uni-app';
const foucs1 = ref(null)
const props = defineProps({
show: {
type: Boolean,
default: false
},
})
})
const datas = ref({
const datas = ref({
cart_num: ''
});
const setData = (e) => {
});
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 = () => {
const emit = defineEmits(['close', 'change']);
const close = () => {
emit('close');
}
}
const change = () => {
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) {
@ -98,21 +104,24 @@ const change = () => {
return;
}
emit('change', datas.value);
}
}
const subtotal = computed(() => {
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
})
defineExpose({
setData,
// founcsFn
})
</script>
<style scoped lang="scss">
.good-popup {
.good-popup {
padding: 30rpx;
.head-title {
@ -152,14 +161,14 @@ defineExpose({
flex-shrink: 0;
}
}
}
}
@keyframes disappear {
@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>