From be59c244151456bf16af1a866db9ef7e23c887e6 Mon Sep 17 00:00:00 2001 From: zmj <1493694146@qq.com> Date: Tue, 11 Jun 2024 15:12:49 +0800 Subject: [PATCH] add --- components/goodPopup.vue | 2 +- config/app.js | 8 +- pages/cart/cart.vue | 14 +- pages/index/index.vue | 8 +- pagesOrder/addressList/addressList.vue | 320 +++++++++--------- pagesOrder/detail/detail.vue | 16 +- pagesOrder/order/component/good.vue | 23 +- pagesOrder/order/order.vue | 4 +- pagesOrder/settle/settle.vue | 69 ++-- uni_modules/wmf-code/README.md | 84 +++++ uni_modules/wmf-code/changelog.md | 108 ++++++ uni_modules/wmf-code/common/helper.js | 105 ++++++ .../components/w-barcode/w-barcode.vue | 204 +++++++++++ .../wmf-code/components/w-qrcode/w-qrcode.vue | 175 ++++++++++ uni_modules/wmf-code/js_sdk/index.js | 1 + uni_modules/wmf-code/package.json | 77 +++++ 16 files changed, 986 insertions(+), 232 deletions(-) create mode 100644 uni_modules/wmf-code/README.md create mode 100644 uni_modules/wmf-code/changelog.md create mode 100644 uni_modules/wmf-code/common/helper.js create mode 100644 uni_modules/wmf-code/components/w-barcode/w-barcode.vue create mode 100644 uni_modules/wmf-code/components/w-qrcode/w-qrcode.vue create mode 100644 uni_modules/wmf-code/js_sdk/index.js create mode 100644 uni_modules/wmf-code/package.json diff --git a/components/goodPopup.vue b/components/goodPopup.vue index ab36636..9e1307c 100644 --- a/components/goodPopup.vue +++ b/components/goodPopup.vue @@ -89,7 +89,7 @@ const subtotal = computed(() => { let num = +datas.value.cart_num || 0; - let sell = +datas.value.price; + let sell = +datas.value.sell || datas.value.price; return Math.ceil(num * sell * 100) / 100 }) diff --git a/config/app.js b/config/app.js index 1bc1012..85facca 100644 --- a/config/app.js +++ b/config/app.js @@ -1,15 +1,19 @@ let BASE_URL import store from "@/store/user.js" // 环境 -let env = "dev" +// let env = "dev" +let env = "prod" // let env = "liu"; switch (env) { + case 'dev': + BASE_URL = 'https://test-multi-store.lihaink.cn'; + break; case 'liu': BASE_URL = 'http://192.168.1.201:8545'; break; default: - BASE_URL = 'https://test-multi-store.lihaink.cn'; + BASE_URL = 'https://multi-store.lihaink.cn'; } let HTTP_REQUEST_URL diff --git a/pages/cart/cart.vue b/pages/cart/cart.vue index 233c4e8..e68d88b 100644 --- a/pages/cart/cart.vue +++ b/pages/cart/cart.vue @@ -142,6 +142,11 @@ import goodPopup from "@/components/goodPopup.vue" import useCartStore from "@/store/cart.js" + // 用户选择的门店信息 + let STORE_INFO = uni.getStorageSync('STORE_INFO'); + if (STORE_INFO) + STORE_INFO = JSON.parse(STORE_INFO) + const cartStore = useCartStore(); // 创建响应式数据 @@ -197,7 +202,9 @@ const addCart = (id, cart_num) => { //加入购物车 cartCreateApi({ cart_num: +cart_num, - goods_id: id + product_id: id, + store_id: 1 + // store_id: }).then(res => { getcartList(); }) @@ -216,7 +223,7 @@ }; const changeGood = (data) => { // 确定选择商品重量 showGoodPopup.value = false; - addCart(data.goods_id || data.id, data.cart_num); + addCart(data.product_id, data.cart_num); } const cartList = ref([]); @@ -342,7 +349,8 @@ position: relative; .total { - padding: 0 20rpx; + margin-top: 10rpx; + padding: 0 40rpx; display: flex; justify-content: space-between; position: fixed; diff --git a/pages/index/index.vue b/pages/index/index.vue index 09c9242..f24929d 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -5,7 +5,6 @@ 惠农批发 - {{STORE_INFO.name}} @@ -127,11 +126,11 @@ - ¥{{item.price}} + ¥{{item.price}} - + @@ -333,7 +332,8 @@ pid: pid, page_no: page_no, page_size: 30, - three: three + three: three, + store_id: STORE_INFO.id || '' // 店铺id,用于获取店铺分类列表,如果为空则获取全部分类列表,否则获取店铺分类列表。 }).then(res => { if (pid == 0) { // 加载一级分类时设置全部分类 if (!res.data?.lists?.length) return; diff --git a/pagesOrder/addressList/addressList.vue b/pagesOrder/addressList/addressList.vue index fe29e53..e89a05f 100644 --- a/pagesOrder/addressList/addressList.vue +++ b/pagesOrder/addressList/addressList.vue @@ -1,185 +1,195 @@ \ No newline at end of file diff --git a/pagesOrder/detail/detail.vue b/pagesOrder/detail/detail.vue index 1553b10..6688f56 100644 --- a/pagesOrder/detail/detail.vue +++ b/pagesOrder/detail/detail.vue @@ -82,7 +82,8 @@ - + + 核销码 {{datas.verify_code}} @@ -188,13 +189,14 @@ } from "@dcloudio/uni-app"; import { nextTick, - ref + ref, + reactive } from "vue"; import addressPopup from "@/components/addressPopup.vue"; import orderCanclePopup from "@/components/orderCanclePopup.vue"; import shopListPopupVue from "@/components/shopListPopup.vue"; import modal from "@/components/modal.vue"; - import QRCode from "@/uni_modules/uview-plus/components/u-qrcode/u-qrcode.vue"; + // import QRCode from "@/uni_modules/uview-plus/components/u-qrcode/u-qrcode.vue"; import { orderDetailApi, cancelOrderApi, @@ -210,6 +212,12 @@ const showCancel = ref(false); const showTake = ref(false); + const options = reactive({ + width: 670, // 宽度 单位rpx + height: 100, // 高度 单位rpx + code: '', // 生成条形码的值 + }, ) + const submitCancel = (e) => { showCancel.value = false; cancelOrderApi({ @@ -235,6 +243,8 @@ }).then(res => { datas.value = res.data; + options.code = datas.value.verify_code; // 生成条形码的值 + shopInfo.value = res.data.store_info; if (addressList.value.length > 0 && res.data.paid) { addressInfo.value = addressList.value.find(item => item.address_id == res.data.address_id); diff --git a/pagesOrder/order/component/good.vue b/pagesOrder/order/component/good.vue index 5db7da1..8285294 100644 --- a/pagesOrder/order/component/good.vue +++ b/pagesOrder/order/component/good.vue @@ -6,36 +6,35 @@ 待付款 - 待收货 - 待收货 + 待核销 + 待核销 已完成 - - + + - - + + {{item.store_name}} - + ¥{{item.price}} - - + + {{item.unit_name}} - + x{{item.cart_num}} - - diff --git a/pagesOrder/order/order.vue b/pagesOrder/order/order.vue index d8d2862..f46f10c 100644 --- a/pagesOrder/order/order.vue +++ b/pagesOrder/order/order.vue @@ -267,7 +267,7 @@ order_id: e.id, address_id: e.address_id, mer_id: e.merchant, - pay_type: 7 + pay_type: e.pay_type }).then(res => { if (!res.data?.nonceStr) return uni.$u.toast('支付失败!'); uni.requestPayment({ @@ -291,7 +291,7 @@ } }) }).catch(err => { - uni.$u.toast('网络错误') + uni.$u.toast(err.msg || '网络错误') }) } diff --git a/pagesOrder/settle/settle.vue b/pagesOrder/settle/settle.vue index 4c1ff20..2f98944 100644 --- a/pagesOrder/settle/settle.vue +++ b/pagesOrder/settle/settle.vue @@ -1,46 +1,8 @@