diff --git a/config/app.js b/config/app.js index a1d384d..b99f537 100644 --- a/config/app.js +++ b/config/app.js @@ -1,12 +1,14 @@ let BASE_URL import store from "@/store/user.js" // 环境 -// let env = "dev" -let env = "prod" +let env = "dev" +// let env = "test" +// let env = "prod" switch(env){ - case 'prod': BASE_URL = 'https://ceshi-erp.lihaink.cn';break; - default: BASE_URL = 'http://192.168.1.22:8787'; + case 'prod': BASE_URL = 'https://erp.lihaink.cn';break; + case 'test': BASE_URL = 'https://ceshi-erp.lihaink.cn';break; + default: BASE_URL = 'http://192.168.1.22:8546'; } let HTTP_REQUEST_URL diff --git a/pages/login/login.vue b/pages/login/login.vue index a0ebc1e..868721e 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -14,8 +14,10 @@ - 微信快捷登录 + 使用短信验证登录 @@ -79,14 +81,19 @@ uni.showLoading({ title: '登录中' }) + // return console.log(phoneRef.value) ; uni.login({ provider: 'weixin', success: (res) => { + return console.log(res); userLoginWeixinApi({ code: res.code }).then(res=>{ userStore.setUserInfo(res.data); userStore.setToken(res.data.token); + if(!res.data.mobile) { + return console.log("====="); + } uni.hideLoading(); if(!res.data.supplier) uni.reLaunch({ url: '/pages/index/index' @@ -101,6 +108,7 @@ }) } + const phoneRef = ref(null) const getPhoneNumber = (e) => { console.log(e); } diff --git a/pagesOrder/detail/detail.vue b/pagesOrder/detail/detail.vue index eb27124..f0ca8ed 100644 --- a/pagesOrder/detail/detail.vue +++ b/pagesOrder/detail/detail.vue @@ -19,17 +19,19 @@ :customStyle="{color:'#666666'}">修改 - - + + + + - 黄牛肉20kg - ¥10.00 + {{item.class_name}} + ¥{{item.sell}} - 我不吃牛肉 - x5 + 数量 + x{{item.nums}} @@ -38,9 +40,9 @@ - - 商品总价 共计5件商品 - ¥50.00 + + 商品总价 共计{{datas.goods_list.length}}款商品 + ¥{{c_price(datas.total, 0)}}.{{c_price(datas.total, 1)}} 运费 @@ -48,24 +50,25 @@ 需付款 - ¥50.00 + ¥{{c_price(datas.total, 0)}}.{{c_price(datas.total, 1)}} 订单信息 订单编号 - - wxo13546486484784555 | 复制 + + {{datas.number}} | 复制 下单时间 - 2024-04-25 15:00:00 + {{datas.create_time}} 支付状态 - 待支付 + 已支付 + 待支付 @@ -73,7 +76,7 @@ 取消订单 - 立即支付 ¥50.00 + 立即支付 ¥{{datas.total}} @@ -122,15 +125,26 @@ const datas = ref({}) const getDetails = ()=>{ - orderDetailApi().then(res=>{ - + orderDetailApi({ + order_id: datas.value.id + }).then(res=>{ + datas.value = res.data; }) } + + const c_price = (price, index=0)=>{ + price = price + ''; + return price.split('.')[index] || (index ? '00' : '0'); + } onLoad((option) => { uni.setNavigationBarTitle({ title: option.type == 1 ? '等待付款' : '订单详情' }) + if(option.id) { + datas.value.id = option.id; + getDetails() + } }) @@ -190,6 +204,8 @@ width: 160rpx; height: 160rpx; margin-right: 20rpx; + border-radius: 14rpx; + overflow: hidden; } .body-content { diff --git a/unpackage/dist/dev/mp-weixin/pages/login/login.js b/unpackage/dist/dev/mp-weixin/pages/login/login.js index c352dec..7e6a7a3 100644 --- a/unpackage/dist/dev/mp-weixin/pages/login/login.js +++ b/unpackage/dist/dev/mp-weixin/pages/login/login.js @@ -26,7 +26,7 @@ if (!Math) { const _sfc_main = { __name: "login", setup(__props) { - const userStore = store_user.useUserStore(); + store_user.useUserStore(); const showWeixin = common_vendor.ref(true); const isAgree = common_vendor.ref(false); const weixinLogin = () => { @@ -38,19 +38,7 @@ const _sfc_main = { common_vendor.index.login({ provider: "weixin", success: (res) => { - api_user.userLoginWeixinApi({ - code: res.code - }).then((res2) => { - userStore.setUserInfo(res2.data); - userStore.setToken(res2.data.token); - common_vendor.index.hideLoading(); - if (!res2.data.supplier) - common_vendor.index.reLaunch({ - url: "/pages/index/index" - }); - else - common_vendor.index.$u.toast("功能开发中"); - }); + return console.log(res); }, fail: (err) => { console.log(err); @@ -58,6 +46,7 @@ const _sfc_main = { } }); }; + common_vendor.ref(null); const loginForm = common_vendor.ref({ phone: "15366662222", code: "" @@ -130,7 +119,6 @@ const _sfc_main = { }), e: common_vendor.o(weixinLogin), f: common_vendor.p({ - ["open-type"]: "getPhoneNumber", color: "#20B128", size: "large" }), diff --git a/unpackage/dist/dev/mp-weixin/pagesOrder/detail/detail.js b/unpackage/dist/dev/mp-weixin/pagesOrder/detail/detail.js index 6a988da..d22991b 100644 --- a/unpackage/dist/dev/mp-weixin/pagesOrder/detail/detail.js +++ b/unpackage/dist/dev/mp-weixin/pagesOrder/detail/detail.js @@ -2,22 +2,25 @@ const common_vendor = require("../../common/vendor.js"); const common_assets = require("../../common/assets.js"); const dict_cancelDict = require("../../dict/cancelDict.js"); +const api_order = require("../../api/order.js"); require("../../utils/request.js"); require("../../config/app.js"); require("../../store/user.js"); if (!Array) { const _easycom_up_icon2 = common_vendor.resolveComponent("up-icon"); const _easycom_up_button2 = common_vendor.resolveComponent("up-button"); + const _easycom_up_image2 = common_vendor.resolveComponent("up-image"); const _easycom_up_copy2 = common_vendor.resolveComponent("up-copy"); const _easycom_up_popup2 = common_vendor.resolveComponent("up-popup"); - (_easycom_up_icon2 + _easycom_up_button2 + _easycom_up_copy2 + _easycom_up_popup2)(); + (_easycom_up_icon2 + _easycom_up_button2 + _easycom_up_image2 + _easycom_up_copy2 + _easycom_up_popup2)(); } const _easycom_up_icon = () => "../../uni_modules/uview-plus/components/u-icon/u-icon.js"; const _easycom_up_button = () => "../../uni_modules/uview-plus/components/u-button/u-button.js"; +const _easycom_up_image = () => "../../uni_modules/uview-plus/components/u-image/u-image.js"; const _easycom_up_copy = () => "../../uni_modules/uview-plus/components/u-copy/u-copy.js"; const _easycom_up_popup = () => "../../uni_modules/uview-plus/components/u-popup/u-popup.js"; if (!Math) { - (_easycom_up_icon + _easycom_up_button + _easycom_up_copy + _easycom_up_popup + addressPopup + modal)(); + (_easycom_up_icon + _easycom_up_button + _easycom_up_image + _easycom_up_copy + _easycom_up_popup + addressPopup + modal)(); } const addressPopup = () => "../../components/addressPopup.js"; const modal = () => "../../components/modal.js"; @@ -39,14 +42,29 @@ const _sfc_main = { showAddress.value = false; console.log(e); }; - common_vendor.ref({}); + const datas = common_vendor.ref({}); + const getDetails = () => { + api_order.orderDetailApi({ + order_id: datas.value.id + }).then((res) => { + datas.value = res.data; + }); + }; + const c_price = (price, index = 0) => { + price = price + ""; + return price.split(".")[index] || (index ? "00" : "0"); + }; common_vendor.onLoad((option) => { common_vendor.index.setNavigationBarTitle({ title: option.type == 1 ? "等待付款" : "订单详情" }); + if (option.id) { + datas.value.id = option.id; + getDetails(); + } }); return (_ctx, _cache) => { - return { + return common_vendor.e({ a: common_vendor.p({ name: "map" }), @@ -59,15 +77,41 @@ const _sfc_main = { color: "#666666" } }), - d: common_vendor.p({ - content: "wxo13546486484784555" + d: common_vendor.f(datas.value.goods_list, (item, index, i0) => { + return { + a: "666b5ad0-2-" + i0, + b: common_vendor.p({ + src: item.imgs, + width: "160rpx", + height: "160rpx" + }), + c: common_vendor.t(item.class_name), + d: common_vendor.t(item.sell), + e: common_vendor.t(item.nums) + }; }), - e: common_vendor.o(($event) => showCancel.value = true), - f: common_vendor.p({ + e: datas.value.goods_list + }, datas.value.goods_list ? { + f: common_vendor.t(datas.value.goods_list.length), + g: common_vendor.t(c_price(datas.value.total, 0)), + h: common_vendor.t(c_price(datas.value.total, 1)) + } : {}, { + i: common_vendor.t(c_price(datas.value.total, 0)), + j: common_vendor.t(c_price(datas.value.total, 1)), + k: common_vendor.t(datas.value.number), + l: common_vendor.p({ + content: datas.value.number + }), + m: common_vendor.t(datas.value.create_time), + n: datas.value.paid + }, datas.value.paid ? {} : {}, { + o: common_vendor.o(($event) => showCancel.value = true), + p: common_vendor.t(datas.value.total), + q: common_vendor.p({ color: "#20B128", shape: "circle" }), - g: common_vendor.f(common_vendor.unref(dict_cancelDict.list), (item, index, i0) => { + r: common_vendor.f(common_vendor.unref(dict_cancelDict.list), (item, index, i0) => { return common_vendor.e({ a: common_vendor.t(item.name), b: cancelType.value == item.value @@ -80,27 +124,27 @@ const _sfc_main = { f: common_vendor.o(($event) => cancelType.value = item.value, item.value) }); }), - h: common_vendor.o(submitCancel), - i: common_vendor.p({ + s: common_vendor.o(submitCancel), + t: common_vendor.p({ color: "#20B128", shape: "circle" }), - j: common_vendor.o(($event) => showCancel.value = false), - k: common_vendor.p({ + v: common_vendor.o(($event) => showCancel.value = false), + w: common_vendor.p({ show: showCancel.value, closeable: true, round: "10" }), - l: common_vendor.o(($event) => showAddress.value = false), - m: common_vendor.o(changeAddress), - n: common_vendor.p({ + x: common_vendor.o(($event) => showAddress.value = false), + y: common_vendor.o(changeAddress), + z: common_vendor.p({ show: showAddress.value }), - o: common_vendor.p({ + A: common_vendor.p({ show: false, content: "您还没有添加收货地址,请点击添加" }) - }; + }); }; } }; diff --git a/unpackage/dist/dev/mp-weixin/pagesOrder/detail/detail.json b/unpackage/dist/dev/mp-weixin/pagesOrder/detail/detail.json index cb0624c..c1b31a6 100644 --- a/unpackage/dist/dev/mp-weixin/pagesOrder/detail/detail.json +++ b/unpackage/dist/dev/mp-weixin/pagesOrder/detail/detail.json @@ -4,6 +4,7 @@ "usingComponents": { "up-icon": "../../uni_modules/uview-plus/components/u-icon/u-icon", "up-button": "../../uni_modules/uview-plus/components/u-button/u-button", + "up-image": "../../uni_modules/uview-plus/components/u-image/u-image", "up-copy": "../../uni_modules/uview-plus/components/u-copy/u-copy", "up-popup": "../../uni_modules/uview-plus/components/u-popup/u-popup", "address-popup": "../../components/addressPopup", diff --git a/unpackage/dist/dev/mp-weixin/pagesOrder/detail/detail.wxml b/unpackage/dist/dev/mp-weixin/pagesOrder/detail/detail.wxml index 7868ed4..294e833 100644 --- a/unpackage/dist/dev/mp-weixin/pagesOrder/detail/detail.wxml +++ b/unpackage/dist/dev/mp-weixin/pagesOrder/detail/detail.wxml @@ -1 +1 @@ - 还剩00:28:36订单自动取消 小王155****9999 四川泸州市龙马潭区莲花池街道商业街1号 修改黄牛肉20kg¥10.00我不吃牛肉x5 预计48小时发货 商品总价 共计5件商品¥50.00运费¥0.00需付款¥50.00订单信息订单编号wxo13546486484784555 | 复制下单时间2024-04-25 15:00:00支付状态待支付取消订单立即支付 ¥50.00订单取消{{item.a}}提交 \ No newline at end of file + 还剩00:28:36订单自动取消 小王155****9999 四川泸州市龙马潭区莲花池街道商业街1号 修改{{item.c}}¥{{item.d}}数量x{{item.e}} 预计48小时发货 商品总价 共计{{f}}款商品¥{{g}}.{{h}}运费¥0.00需付款¥{{i}}.{{j}}订单信息订单编号{{k}} | 复制下单时间{{m}}支付状态已支付待支付取消订单立即支付 ¥{{p}}订单取消{{item.a}}提交 \ No newline at end of file diff --git a/unpackage/dist/dev/mp-weixin/pagesOrder/detail/detail.wxss b/unpackage/dist/dev/mp-weixin/pagesOrder/detail/detail.wxss index 37b9be5..e7bf5eb 100644 --- a/unpackage/dist/dev/mp-weixin/pagesOrder/detail/detail.wxss +++ b/unpackage/dist/dev/mp-weixin/pagesOrder/detail/detail.wxss @@ -70,6 +70,8 @@ width: 160rpx; height: 160rpx; margin-right: 20rpx; + border-radius: 14rpx; + overflow: hidden; } .m-good .body-content { width: 490rpx;