Compare commits
8 Commits
a4580bdd1c
...
75ed724fbb
| Author | SHA1 | Date | |
|---|---|---|---|
| 75ed724fbb | |||
| b5ecab0a03 | |||
| f75f90d34f | |||
| cf562b28b0 | |||
| 33453ab961 | |||
| 65554b043c | |||
| b3c1ab3b8b | |||
| e1000c6b40 |
3
common/api/apiPrve.js
Normal file
3
common/api/apiPrve.js
Normal file
@@ -0,0 +1,3 @@
|
||||
export const urlAccount = '/account'
|
||||
export const urlProduct = '/product'
|
||||
export const urlOrder = '/order'
|
||||
@@ -1,8 +1,7 @@
|
||||
// 引入 request 文件
|
||||
import request from '@/common/api/request.js'
|
||||
const urlAccount = '/account'
|
||||
const urlProduct = '/product'
|
||||
const urlOrder = '/order'
|
||||
|
||||
import {urlAccount,urlProduct,urlOrder} from '@/common/api/apiPrve.js'
|
||||
|
||||
//获取商品列表数据
|
||||
export const APIproductqueryProduct = (data) => {
|
||||
@@ -46,4 +45,13 @@ export const APIminiAppskuinfo = (data) => {
|
||||
method: 'get',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
//获取相关推荐商品
|
||||
export const productRelated = (data) => {
|
||||
return request({
|
||||
url: urlProduct + '/user/product/related/'+data.id,
|
||||
method: 'get',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
@@ -7,33 +7,7 @@ export default async (params) => {
|
||||
let token = uni.cache.get("token") || "";
|
||||
const shopId = uni.cache.get("shopId") * 1;
|
||||
const userInfo = uni.cache.get("userInfo") || {};
|
||||
// #ifdef H5
|
||||
token = "1b5e8baf0cc1492a858a208f113d0971";
|
||||
uni.cache.set('userInfo', {
|
||||
"acQrcodeValidTime": "2026-01-13 13:35:59",
|
||||
"alipayOpenId": "",
|
||||
"birthDay": "",
|
||||
"createTime": "2024-03-13 10:56:40",
|
||||
"distributionAmount": 0,
|
||||
"headImg": "https://thirdwx.qlogo.cn/mmopen/vi_32/POgEwh4mIHO4nibH0KlMECNjjGxQUq24ZEaGT4poC6icRiccVGKSyXwibcPq4BWmiaIGuG1icwxaQX6grC9VemZoJ8rg/132",
|
||||
"id": "36689",
|
||||
"idCard": "",
|
||||
"isAc": 0,
|
||||
"lastLoginTime": "2025-12-24 11:24:12",
|
||||
"nickName": "微信用户",
|
||||
"password": "",
|
||||
"payPwd": "e10adc3949ba59abbe56e057f20f883e",
|
||||
"phone": "",
|
||||
"realName": "",
|
||||
"sex": null,
|
||||
"status": 1,
|
||||
"updateTime": "2025-12-24 11:22:47",
|
||||
"usePayPwd": 0,
|
||||
"wechatAcOpenId": "",
|
||||
"wechatAcQrcode": "http://weixin.qq.com/q/029s5JtP1xfmJ1g_HDxFco",
|
||||
"wechatOpenId": "or1l86yipGvwyfPhrKIAcQuSfAV8"
|
||||
})
|
||||
// #endif
|
||||
|
||||
let header = {
|
||||
version: uni.conf.version,
|
||||
type: uni.getSystemInfoSync().platform,
|
||||
@@ -60,7 +34,10 @@ export default async (params) => {
|
||||
mask: true,
|
||||
});
|
||||
}
|
||||
|
||||
// #ifdef H5
|
||||
uni.cache.set('token', 'b61c8b0f1c9d47ad924e33c48b496ce6')
|
||||
uni.cache.set('userInfo',{"acQrcodeValidTime":"2025-11-17 17:57:16","alipayOpenId":"","birthDay":"2025-10-17","createTime":"2024-07-06 11:30:16","distributionAmount":0,"headImg":"https://thirdwx.qlogo.cn/mmopen/vi_32/POgEwh4mIHO4nibH0KlMECNjjGxQUq24ZEaGT4poC6icRiccVGKSyXwibcPq4BWmiaIGuG1icwxaQX6grC9VemZoJ8rg/132","id":"36434","idCard":"612401199810058031","isAc":0,"lastLoginTime":"2025-12-25 11:41:15","nickName":"微信用户","password":"","payPwd":"e10adc3949ba59abbe56e057f20f883e","phone":"18049104914","realName":"叶明飞","sex":1,"status":1,"updateTime":"2025-12-25 09:41:58","usePayPwd":0,"wechatAcOpenId":"1111","wechatAcQrcode":"","wechatOpenId":"or1l86yipGvwyfPhrKIAcQuSfAV8"})
|
||||
// #endif
|
||||
return new Promise((resolve, reject) => {
|
||||
const timeoutDuration = params.timeout || 10000; // 可以通过 params 传入超时时间,默认 10 秒
|
||||
uni.request({
|
||||
|
||||
@@ -1,17 +1,18 @@
|
||||
// const debug = process.env.NODE_ENV == 'development' ? true : false;
|
||||
const debug = false; // false线上 true本地
|
||||
const debug = true; // false线上 true本地
|
||||
let baseUrl = ''
|
||||
let baseUrlwws = ''
|
||||
|
||||
|
||||
|
||||
|
||||
const version = "100";
|
||||
const autoRemoveCache = {
|
||||
count: 100000,
|
||||
size: 100000,
|
||||
};
|
||||
|
||||
function init(){
|
||||
function init() {
|
||||
if (debug) {
|
||||
baseUrl = 'http://192.168.1.42'
|
||||
baseUrlwws = "ws://192.168.1.42:2348";
|
||||
@@ -20,12 +21,12 @@ function init(){
|
||||
baseUrlwws = "wss://czgeatws.sxczgkj.com/wss";
|
||||
}
|
||||
// #ifdef H5
|
||||
|
||||
|
||||
if (debug) {
|
||||
baseUrl = "/api";
|
||||
baseUrl = "/testApi";
|
||||
baseUrlwws = "http://192.168.1.42:2348";
|
||||
} else {
|
||||
baseUrl = "/prodApi";
|
||||
baseUrl = "/prodApi";
|
||||
baseUrlwws = "https://czgeatws.sxczgkj.com/wss";
|
||||
}
|
||||
// #endif
|
||||
@@ -47,7 +48,7 @@ export const changeEnv = (env) => {
|
||||
let baseUrl = "http://192.168.1.42"
|
||||
let baseUrlwws = "ws://192.168.1.42:2348"
|
||||
// #ifdef H5
|
||||
baseUrl = "/api"
|
||||
baseUrl = "/testApi"
|
||||
baseUrlwws = "http://192.168.1.42:2348"
|
||||
// #endif
|
||||
uni.conf = {
|
||||
|
||||
@@ -40,9 +40,19 @@
|
||||
:nowCarts="nowCarts"
|
||||
:limitDiscount="cartStore.limitTimeDiscount"
|
||||
></orderItemVue> -->
|
||||
<orderItemVue :useVipPrice="useVipPrice" v-if="cartStore.allGoods.length" :nowCarts="cartStore.allGoods"
|
||||
<orderItemVue :useVipPrice="useVipPrice" v-if="nowCarts" :nowCarts="nowCarts"
|
||||
:shopInfo="cartStore.shopInfo" :shopUserInfo="cartStore.shopUserInfo"
|
||||
:limitDiscount="cartStore.limitTimeDiscount"></orderItemVue>
|
||||
|
||||
<view class="u-flex u-row-center u-m-t-16 u-font-28">
|
||||
<view class="u-flex u-col-baseline" @click="showAllGoods=!showAllGoods">
|
||||
<text>{{showAllGoods?'收起':'展开'}}</text>
|
||||
<view class="guodu u-m-l-10 u-m-t-2" :class="{rotate:!showAllGoods}">
|
||||
<up-icon name="arrow-down" size="14"></up-icon>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
<template v-if="listinfo.id&&listinfo.status=='done'">
|
||||
<view class="cell-item" v-if="is_type != 0">
|
||||
@@ -328,7 +338,9 @@
|
||||
import {
|
||||
BigNumber
|
||||
} from "bignumber.js";
|
||||
|
||||
|
||||
|
||||
const showAllGoods=ref(false)
|
||||
let hasCouponCanUse = ref(false);
|
||||
|
||||
const usePoints = ref(false);
|
||||
@@ -852,6 +864,16 @@
|
||||
await getConsumeDiscount();
|
||||
getDiscountActivity();
|
||||
});
|
||||
|
||||
const nowCarts=computed(()=>{
|
||||
if(cartStore.allGoods.length<=0){
|
||||
return []
|
||||
}
|
||||
if(showAllGoods.value){
|
||||
return cartStore.allGoods
|
||||
}
|
||||
return cartStore.allGoods.slice(0,4)
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@@ -1587,4 +1609,11 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
.guodu{
|
||||
transition:all .3s linear;
|
||||
padding-top: 2rpx;
|
||||
}
|
||||
.rotate{
|
||||
transform: rotate(-90deg);
|
||||
}
|
||||
</style>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -52,8 +52,8 @@
|
||||
|
||||
|
||||
<view class="relative">
|
||||
<image @click.stop="getProductImgs(item)" class="panelfiveitemimage" :src="item.coverImg"
|
||||
mode="aspectFill"></image>
|
||||
<image @click.stop="getProductImgs(item)" class="panelfiveitemimage"
|
||||
:src="item.coverImg" mode="aspectFill"></image>
|
||||
<view class="limitDiscount" v-if="showLimitDiscount(item)">
|
||||
限时折扣{{ limitDiscountCountdown }}</view>
|
||||
<!-- <view class="limitDiscount" v-if="item.is_time_discount">
|
||||
@@ -148,8 +148,10 @@
|
||||
@click.stop="clickspecifications(item, index, index1)">
|
||||
<text class="t no-wrap" v-if="item.groupType == '1'">选择套餐</text>
|
||||
<text class="t" v-else>选规格</text>
|
||||
<!-- <text class="dot num"
|
||||
v-if="item.cartNumber > 0">{{ ifcartNumber(item) < 99 ? ifcartNumber(item) : '99+' }}</text> -->
|
||||
<text class="dot num"
|
||||
v-if="item.cartNumber > 0">{{ ifcartNumber(item) < 99 ? ifcartNumber(item) : '99+' }}</text>
|
||||
v-if="returnGoodsImCartNum(item)">{{ returnGoodsImCartNum(item) < 99 ? returnGoodsImCartNum(item) : '99+' }}</text>
|
||||
</view>
|
||||
<view class="Controls" v-else>
|
||||
<view class="btn" v-if="item.cartNumber != '0'">
|
||||
@@ -158,7 +160,10 @@
|
||||
<!-- <view class="btnClick"
|
||||
@tap.stop="$u.throttle(() => singleclick(item, '-'), 500)"></view> -->
|
||||
</view>
|
||||
<text class="num">{{ ifcartNumber(item) }}</text>
|
||||
<!-- <text class="num">{{ ifcartNumber(item) }}</text> -->
|
||||
|
||||
<text class="dot num"
|
||||
v-if="returnGoodsImCartNum(item1)">{{ returnGoodsImCartNum(item1) < 99 ? returnGoodsImCartNum(item1) : '99+' }}</text>
|
||||
<view class="btn">
|
||||
<up-icon name="plus-circle-fill" color="#E9AB7A" size="25"></up-icon>
|
||||
<!-- <view class="btnClick"
|
||||
@@ -197,8 +202,8 @@
|
||||
<view class="goods" @click="clickspecifications(item1, index, index1)"
|
||||
v-for="(item1, index1) in item.productList" :key="item1.id">
|
||||
<view class="relative">
|
||||
<image class="goodsImg" @click.stop="getProductImgs(item1)" v-if="item1.coverImg != null"
|
||||
:lazy-load="true"
|
||||
<image class="goodsImg" @click.stop="getProductImgs(item1)"
|
||||
v-if="item1.coverImg != null" :lazy-load="true"
|
||||
:src="`${item1.coverImg}${!item1.imgLoad ? '?x-oss-process=image/resize,m_lfit,w_150,h_150' : ''}`"
|
||||
mode="aspectFill"></image>
|
||||
<image class="goodsImg"
|
||||
@@ -288,8 +293,11 @@
|
||||
@click.stop="clickspecifications(item1, index, index1)">
|
||||
<text class="t no-wrap" v-if="item1.groupType == '1'">选择套餐</text>
|
||||
<text class="t" v-else>选规格</text>
|
||||
<!-- <text class="dot num"
|
||||
v-if="item1.cartNumber > 0">{{ ifcartNumber(item1) < 99 ? ifcartNumber(item1) : '99+' }}</text> -->
|
||||
|
||||
<text class="dot num"
|
||||
v-if="item1.cartNumber > 0">{{ ifcartNumber(item1) < 99 ? ifcartNumber(item1) : '99+' }}</text>
|
||||
v-if="returnGoodsImCartNum(item1)">{{ returnGoodsImCartNum(item1) < 99 ? returnGoodsImCartNum(item1) : '99+' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="Controls" v-else>
|
||||
@@ -437,9 +445,39 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 推荐搭配 -->
|
||||
<view class="u-m-t-48 u-p-30">
|
||||
<view class="font-bold u-font-32 ">推荐搭配</view>
|
||||
<view class="u-flex recommand-goods">
|
||||
<view class=" item" v-for="(item,index) in 6" :key="index">
|
||||
<up-image width="210rpx" height="210rpx" radius="12rpx"></up-image>
|
||||
<view class="info">
|
||||
<view class="u-line-2 name u-m-t-10 u-font-32 font-500">
|
||||
商品名
|
||||
</view>
|
||||
|
||||
<view class="u-flex u-row-between">
|
||||
<view class="font-bold">
|
||||
<text class="u-font-24">¥</text>
|
||||
<text class="u-font-32">40</text>
|
||||
</view>
|
||||
<view class="btn">
|
||||
<up-icon name="plus-circle-fill" color="#E9AB7A" size="25"></up-icon>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
</scroll-view>
|
||||
<!-- 占位 -->
|
||||
<view style="height: 42rpx;"></view>
|
||||
<view class="shop_bottom">
|
||||
<view class="flex-between">
|
||||
<view class="price price-sku"
|
||||
@@ -536,7 +574,17 @@
|
||||
<Loading :isLoading="!useSocket.isConnected" />
|
||||
<ModalList></ModalList>
|
||||
<recommendGoodsModal v-if="isDataLoaded" @onBuyClick="onBuyClick"></recommendGoodsModal>
|
||||
<goodsModal></goodsModal>
|
||||
|
||||
<view
|
||||
v-for="(item,index) in goodsModalList" :key="index"
|
||||
>
|
||||
<goodsModal :key="index" v-model="item.show" :goods="item.goods" @prveImgs="prveImgs" @close="goodsModalClose(index)"
|
||||
@websocketsendMessage="websocketsendMessage"
|
||||
@modalAdd="modalAdd"
|
||||
:GoodsIDInCartNumMap="GoodsIDInCartNumMap"
|
||||
></goodsModal>
|
||||
</view>
|
||||
|
||||
<xbSwiperPreview :visable="showPrveImg" :imgs="prveImgsList" @update:visable="updateShowPrveImg">
|
||||
</xbSwiperPreview>
|
||||
<!-- 显示选择人数popup -->
|
||||
@@ -594,7 +642,8 @@
|
||||
productminiApphotsquery,
|
||||
APIgroupquery,
|
||||
APIminiAppinfo,
|
||||
APIminiAppskuinfo
|
||||
APIminiAppskuinfo,
|
||||
productRelated
|
||||
} from '@/common/api/product/product.js';
|
||||
|
||||
import {
|
||||
@@ -671,8 +720,8 @@
|
||||
import {
|
||||
useNavbarStore
|
||||
} from '@/stores/navbarStore';
|
||||
|
||||
|
||||
|
||||
|
||||
import {
|
||||
useWebSocket
|
||||
} from '@/stores/carts-websocket.js';
|
||||
@@ -700,6 +749,9 @@
|
||||
import {
|
||||
useCartStore
|
||||
} from '@/stores/order.js';
|
||||
import {
|
||||
computed
|
||||
} from 'vue';
|
||||
const cartStore = useCartStore();
|
||||
/**
|
||||
* store本地存储 end
|
||||
@@ -750,6 +802,8 @@
|
||||
/**
|
||||
* 通用数据合集 start
|
||||
*/
|
||||
const showGoodsModal = ref(false)
|
||||
|
||||
// 门店信息
|
||||
const shopInfo = reactive({});
|
||||
Object.assign(shopInfo, uni.cache.get('shopInfo'));
|
||||
@@ -804,6 +858,35 @@
|
||||
|
||||
|
||||
|
||||
|
||||
// 购物车对应的商品数
|
||||
const GoodsIDInCartNumMap = computed(() => {
|
||||
const map = {}
|
||||
for (let cart of cartStore.carts) {
|
||||
if (map[cart.product_id]) {
|
||||
map[cart.product_id] += cart.number * 1
|
||||
} else {
|
||||
map[cart.product_id] = cart.number * 1
|
||||
}
|
||||
|
||||
}
|
||||
return map
|
||||
})
|
||||
|
||||
/**
|
||||
* 返回购物车对应的商品数量
|
||||
*/
|
||||
function returnGoodsImCartNum(goods) {
|
||||
if(!goods){
|
||||
return 0
|
||||
}
|
||||
if (GoodsIDInCartNumMap.value.hasOwnProperty(goods.id)) {
|
||||
GoodsIDInCartNumMap.value[goods.id]
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
// 获取商品数据
|
||||
const shopProductList = reactive({
|
||||
hots: [],
|
||||
@@ -1269,9 +1352,9 @@
|
||||
//预览图
|
||||
const showPrveImg = ref(false);
|
||||
const prveImgsList = ref([]);
|
||||
|
||||
function updateShowPrveImg(e){
|
||||
showPrveImg.value=e
|
||||
|
||||
function updateShowPrveImg(e) {
|
||||
showPrveImg.value = e
|
||||
}
|
||||
|
||||
function prveImgs(images) {
|
||||
@@ -1285,14 +1368,23 @@
|
||||
}
|
||||
|
||||
async function getProductImgs(item) {
|
||||
console.log('getProductImgs',item)
|
||||
console.log('getProductImgs', item)
|
||||
let res = await APIminiAppinfo(item.id);
|
||||
prveImgs(res.images);
|
||||
}
|
||||
|
||||
const goodsModalList=ref([])
|
||||
|
||||
function goodsModalClose(index){
|
||||
goodsModalList.value.splice(index,1)
|
||||
}
|
||||
function modalAdd(item){
|
||||
clickspecifications(item)
|
||||
}
|
||||
|
||||
//获取多规格数据
|
||||
const clickspecifications = async (item, index, indexs, type) => {
|
||||
console.log('clickspecifications',item);
|
||||
console.log('clickspecifications', item);
|
||||
// 商品类型 single-单规格商品 sku-多规格商品 package-套餐商品 weight-称重商品 coupon-团购券
|
||||
// if (
|
||||
// item.isSoldStock == 1 ||
|
||||
@@ -1305,7 +1397,10 @@
|
||||
// }
|
||||
|
||||
if (item.isSoldStock == 1 || (item.isSaleTime == 0 && !item.isSaleTimeshow)) {
|
||||
return false;
|
||||
return uni.showToast({
|
||||
title:'商品已下架或不在可售时间内',
|
||||
icon:'none'
|
||||
});
|
||||
}
|
||||
|
||||
shopCartNumber.value = 0;
|
||||
@@ -1350,7 +1445,12 @@
|
||||
.filter(([_, value]) => value.length > 0));
|
||||
// 给默认数量
|
||||
specifications.item.amountcartNumber = 0;
|
||||
showShopsku.value = true;
|
||||
// showShopsku.value = true;
|
||||
goodsModalList.value.push({
|
||||
show:true,
|
||||
goods:specifications.item
|
||||
})
|
||||
// showGoodsModal.value=true
|
||||
};
|
||||
// 判断商品是否在可售时间内
|
||||
const isProductAvailable = async (sellDaysStr, startTimeStr, endTimeStr) => {
|
||||
@@ -1586,11 +1686,11 @@
|
||||
|
||||
function cartInit(arr) {
|
||||
const result = []
|
||||
console.log('cartInitArr',arr);
|
||||
console.log('allGoodsArr',allGoodsArr);
|
||||
console.log('cartInitArr', arr);
|
||||
console.log('allGoodsArr', allGoodsArr);
|
||||
cartStore.carts = arr.map(v => {
|
||||
const goods = allGoodsArr.find(g => g.id == v.product_id)
|
||||
const goodsSkuList = goods?goods.skuList : []
|
||||
const goodsSkuList = goods ? goods.skuList : []
|
||||
const findSku = goodsSkuList.find(sku => sku.id == v.sku_id)
|
||||
const memberPrice = findSku ? findSku.memberPrice : 0
|
||||
const is_time_discount = limitUtils.canUseLimitTimeDiscount({
|
||||
@@ -1598,7 +1698,7 @@
|
||||
memberPrice
|
||||
}, cartStore.limitTimeDiscount, shopInfo,
|
||||
shopUserInfo.value, 'product_id');
|
||||
if(!goods){
|
||||
if (!goods) {
|
||||
useSocket.sendMessage({
|
||||
id: v.id,
|
||||
operate_type: "del",
|
||||
@@ -1613,7 +1713,7 @@
|
||||
is_time_discount: is_time_discount ? 1 : 0,
|
||||
memberPrice
|
||||
}
|
||||
}).filter(v=>v)
|
||||
}).filter(v => v)
|
||||
|
||||
for (let cart of arr) {
|
||||
const findItem = cartStore.carts.find(v => v.id == cart.id)
|
||||
@@ -1790,7 +1890,7 @@
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//除去p 每次返回都回执消息
|
||||
await websocketsendMessage({
|
||||
@@ -2084,11 +2184,11 @@
|
||||
}
|
||||
return currentTime >= startTime && currentTime <= endTime;
|
||||
});
|
||||
let allGoodsArr=[]
|
||||
let allGoodsArr = []
|
||||
// 列表请求
|
||||
const productqueryProduct = async () => {
|
||||
cartStore.goodsIsloading = false;
|
||||
allGoodsArr=[]
|
||||
allGoodsArr = []
|
||||
try {
|
||||
shopProductList.hots = await productminiApphotsquery();
|
||||
shopProductList.productInfo = await APIgroupquery();
|
||||
@@ -2106,27 +2206,25 @@
|
||||
//第一步:将所有商品的 cartNumber 初始化为 0
|
||||
shopProductList.productInfo.forEach((group) => {
|
||||
group.productList.forEach(async (product) => {
|
||||
product.cartNumber = 0;
|
||||
product.isSaleTimeshow = await isProductAvailable(product.days, product
|
||||
.startTime, product.endTime);
|
||||
|
||||
allGoodsArr.push(product)
|
||||
|
||||
allGoodsArr.push(product)
|
||||
|
||||
cartStore.setGoodsMap(product.id, product);
|
||||
});
|
||||
});
|
||||
shopProductList.hots.forEach(async (i) => {
|
||||
i.cartNumber = 0;
|
||||
i.isSaleTimeshow = await isProductAvailable(i.days, i.startTime, i.endTime);
|
||||
allGoodsArr.push(i)
|
||||
cartStore.setGoodsMap(i.id, i);
|
||||
});
|
||||
console.log('shopProductList', shopProductList);
|
||||
|
||||
if(cartStore.carts.length>0){
|
||||
|
||||
if (cartStore.carts.length > 0) {
|
||||
cartInit(cartStore.carts)
|
||||
}
|
||||
|
||||
|
||||
cartStore.goodsIsloading = true;
|
||||
scrollTopSize.value = 0;
|
||||
topArr.value = [];
|
||||
@@ -2381,7 +2479,7 @@
|
||||
tableCode: uni.cache.get('tableCode')
|
||||
});
|
||||
oldOrder.value = res;
|
||||
if (res && res.id && shopInfo.registerType == 'after'&&!e.noJump) {
|
||||
if (res && res.id && shopInfo.registerType == 'after' && !e.noJump) {
|
||||
toHistory();
|
||||
return;
|
||||
}
|
||||
@@ -2441,8 +2539,8 @@
|
||||
idKey: 'id'
|
||||
});
|
||||
}
|
||||
|
||||
function watchEmit(){
|
||||
|
||||
function watchEmit() {
|
||||
uni.$off('updateProductIndex')
|
||||
uni.$on('updateProductIndex', function(data) {
|
||||
getNewUserDiscount()
|
||||
@@ -2496,12 +2594,12 @@
|
||||
});
|
||||
if (res && typeof res == 'object') {
|
||||
newUserDiscount.value = res;
|
||||
cartStore.consumeDiscount=res
|
||||
cartStore.newUserDiscount=res.amount
|
||||
}else{
|
||||
cartStore.consumeDiscount = res
|
||||
cartStore.newUserDiscount = res.amount
|
||||
} else {
|
||||
newUserDiscount.value = null;
|
||||
cartStore.consumeDiscount={}
|
||||
cartStore.newUserDiscount=0
|
||||
cartStore.consumeDiscount = {}
|
||||
cartStore.newUserDiscount = 0
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2561,8 +2659,8 @@
|
||||
return 0
|
||||
})
|
||||
const oldOrder = ref(null);
|
||||
|
||||
|
||||
|
||||
|
||||
// 限时折扣
|
||||
async function getLimitDiscount() {
|
||||
const limitRes = await limitTimeDiscountapi.getConfig({
|
||||
@@ -3199,7 +3297,6 @@
|
||||
border-radius: 20rpx;
|
||||
background: #fff;
|
||||
box-sizing: border-box;
|
||||
padding-bottom: 200rpx;
|
||||
|
||||
.positionabsolute {
|
||||
position: absolute;
|
||||
@@ -3234,9 +3331,7 @@
|
||||
border-bottom: 2rpx solid #f0f0f0;
|
||||
}
|
||||
|
||||
.shop_sku_box:last-child {
|
||||
padding-bottom: 140rpx;
|
||||
}
|
||||
|
||||
|
||||
.shop_sku_box {
|
||||
padding: 20rpx;
|
||||
@@ -3322,9 +3417,6 @@
|
||||
padding: 30rpx 28rpx;
|
||||
background-color: #fff;
|
||||
box-shadow: 0rpx -6rpx 14rpx 2rpx rgba(0, 0, 0, 0.1);
|
||||
position: fixed;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
|
||||
.price {
|
||||
display: flex;
|
||||
@@ -3700,4 +3792,31 @@
|
||||
font-size: 12px;
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
|
||||
.recommand-goods {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
margin-top: 24rpx;
|
||||
|
||||
.item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
margin-right: 30rpx;
|
||||
margin-bottom: 30rpx;
|
||||
width: 210rpx;
|
||||
|
||||
&:nth-child(3n) {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.name {
|
||||
height: 84rpx;
|
||||
}
|
||||
|
||||
.info {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -33,11 +33,11 @@ module.exports = defineConfig({
|
||||
],
|
||||
server: {
|
||||
proxy: {
|
||||
'/api': {
|
||||
'/testApi': {
|
||||
// target: 'https://cashier.sxczgkj.com', // 目标服务器地址
|
||||
target: 'http://192.168.1.42/', // 目标服务器地址
|
||||
changeOrigin: true, // 是否更改请求源
|
||||
rewrite: path => path.replace(/^\/api/, '')
|
||||
rewrite: path => path.replace(/^\/testApi/, '')
|
||||
},
|
||||
'/prodApi': {
|
||||
target: 'https://cashier.sxczgkj.com', // 目标服务器地址
|
||||
|
||||
Reference in New Issue
Block a user