|
@@ -39,6 +39,9 @@ import recommend from '@/components/recommend'
|
|
|
import { HTTP_REQUEST_URL_IMG } from "@/config/app";
|
|
import { HTTP_REQUEST_URL_IMG } from "@/config/app";
|
|
|
// 获取实时金价
|
|
// 获取实时金价
|
|
|
import useRealGoldPrice from "@/hooks/useRealGoldPrice";
|
|
import useRealGoldPrice from "@/hooks/useRealGoldPrice";
|
|
|
|
|
+import { useAppStore } from "@/stores/app";
|
|
|
|
|
+
|
|
|
|
|
+const appStore = useAppStore();
|
|
|
|
|
|
|
|
// 响应式数据
|
|
// 响应式数据
|
|
|
const hostProduct = ref([])
|
|
const hostProduct = ref([])
|
|
@@ -55,6 +58,7 @@ const hotPage = ref(1)
|
|
|
const isScroll = ref(true)
|
|
const isScroll = ref(true)
|
|
|
const isbastList = ref(false)
|
|
const isbastList = ref(false)
|
|
|
const query = ref({})
|
|
const query = ref({})
|
|
|
|
|
+const merchantId = ref('')
|
|
|
// 实时价格处理
|
|
// 实时价格处理
|
|
|
const {
|
|
const {
|
|
|
realGoldprice, // 黄金实时销售价(基础)
|
|
realGoldprice, // 黄金实时销售价(基础)
|
|
@@ -76,10 +80,8 @@ const calculatedProducts = computed(() => {
|
|
|
|
|
|
|
|
const totalLaborCost = Number(product.totalLaborCost);
|
|
const totalLaborCost = Number(product.totalLaborCost);
|
|
|
const additionalAmount = Number(product.additionalAmount);
|
|
const additionalAmount = Number(product.additionalAmount);
|
|
|
- console.log(totalLaborCost)
|
|
|
|
|
- console.log(additionalAmount)
|
|
|
|
|
const totalPrice = (totalLaborCost+additionalAmount).toFixed(2);
|
|
const totalPrice = (totalLaborCost+additionalAmount).toFixed(2);
|
|
|
- console.log('totalPrice',totalPrice)
|
|
|
|
|
|
|
+
|
|
|
return {
|
|
return {
|
|
|
...product,
|
|
...product,
|
|
|
calculatedTotal: formattedTotal, // 新增计算结果字段
|
|
calculatedTotal: formattedTotal, // 新增计算结果字段
|
|
@@ -104,7 +106,8 @@ function getProductList() {
|
|
|
...query.value,
|
|
...query.value,
|
|
|
keyword: searchValue.value,
|
|
keyword: searchValue.value,
|
|
|
page: page.value,
|
|
page: page.value,
|
|
|
- limit: limit.value
|
|
|
|
|
|
|
+ limit: limit.value,
|
|
|
|
|
+ merchantId:merchantId.value,
|
|
|
}).then(res => {
|
|
}).then(res => {
|
|
|
const list = res.data.list
|
|
const list = res.data.list
|
|
|
const isLoadend = list.length < limit.value
|
|
const isLoadend = list.length < limit.value
|
|
@@ -164,10 +167,12 @@ function searchBut() {
|
|
|
// 生命周期
|
|
// 生命周期
|
|
|
onShow(() => {
|
|
onShow(() => {
|
|
|
getRoutineHotSearch()
|
|
getRoutineHotSearch()
|
|
|
- getHostProduct()
|
|
|
|
|
|
|
+ getHostProduct();
|
|
|
|
|
+
|
|
|
})
|
|
})
|
|
|
onLoad((options)=>{
|
|
onLoad((options)=>{
|
|
|
query.value = options || {};
|
|
query.value = options || {};
|
|
|
|
|
+ merchantId.value = appStore.merchantId||appStore.userInfo?.merchant?.id||'';
|
|
|
if(options && options.cid){
|
|
if(options && options.cid){
|
|
|
getProductList()
|
|
getProductList()
|
|
|
}
|
|
}
|