From 4fa9de1f4630ea54265c90acff7a255c857ed61d Mon Sep 17 00:00:00 2001 From: xuechunyuan <17853500702@163.com> Date: Wed, 23 Aug 2023 13:26:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=88=E6=9D=83=E9=80=BB=E8=BE=91=E4=BC=98?= =?UTF-8?q?=E5=8C=96=EF=BC=9B=E5=A2=9E=E5=8A=A0=E7=A1=AE=E8=AE=A4=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 2 +- pages.json | 16 + pages/pages_zhentou/homePage/homePage.vue | 85 +--- pages/pages_zhentou/myPage/myPage.vue | 23 +- pages/pages_zhentou/order/confirmOrder.vue | 441 +++++++++++++++++++++ pages/pages_zhentou/order/order.vue | 10 +- static/image/icon_jian.png | Bin 0 -> 1086 bytes static/image/icon_jian01.png | Bin 0 -> 1149 bytes static/image/icon_plus.png | Bin 0 -> 1235 bytes 9 files changed, 486 insertions(+), 91 deletions(-) create mode 100644 pages/pages_zhentou/order/confirmOrder.vue create mode 100644 static/image/icon_jian.png create mode 100644 static/image/icon_jian01.png create mode 100644 static/image/icon_plus.png diff --git a/App.vue b/App.vue index 0a2329f..e8037f9 100644 --- a/App.vue +++ b/App.vue @@ -62,6 +62,7 @@ test: '', // baseUrl: "http://192.168.3.32:80", baseUrl: "http://192.168.1.106:80", + // baseUrl: "http://47.104.224.41:80",//测试环境 imgPrefix: "http://47.104.224.41:9000/etriphome/appresource/image/", //图片资源 }, methods: { @@ -76,7 +77,6 @@ if (res.data.code == 200) { if (JSON.stringify(res.data.data) != '{}') { uni.setStorageSync('userInfo', JSON.stringify(res.data.data)); - uni.setStorageSync('phone', res.data.data.phone); this.doLogin(res.data.data.username, res.data.data.phone); } } else { diff --git a/pages.json b/pages.json index 0a10765..1081376 100644 --- a/pages.json +++ b/pages.json @@ -158,6 +158,22 @@ } } } + }, + { + "path": "pages/pages_zhentou/order/confirmOrder", + "style": { + "navigationBarTitleText": "提交订单", + "app-plus": { + "titleNView": { + // "buttons": [{ + // "text": "\ue534", + // "fontSrc": "/static/uni.ttf", + // "fontSize": "22px", + // "color": "#FFFFFF" + // }] + } + } + } } ], // "subPackages": [{ diff --git a/pages/pages_zhentou/homePage/homePage.vue b/pages/pages_zhentou/homePage/homePage.vue index b866a50..0daef41 100644 --- a/pages/pages_zhentou/homePage/homePage.vue +++ b/pages/pages_zhentou/homePage/homePage.vue @@ -14,8 +14,7 @@ - 立即定制 - 立即定制 立即定制 @@ -27,26 +26,19 @@ data() { return { userInfo: {}, - hasUserInfo: false, - canIUseGetUserProfile: false, phone: '', hasPhone: false, bgSrc: '', //背景图片 } }, onShow() { - if (wx.getUserProfile) { - this.canIUseGetUserProfile = true; - } - let phone = uni.getStorageSync('phone'); let userInfo = uni.getStorageSync('userInfo'); - if (phone) { - this.phone = phone; - this.hasPhone = true; - } if (userInfo) { this.userInfo = JSON.parse(userInfo); - this.hasUserInfo = true; + if(this.userInfo.phone) { + this.phone = this.userInfo.phone; + this.hasPhone = true; + } } //商品信息 if (this.bgSrc == '') { @@ -57,7 +49,7 @@ //商品信息 queryGoodsInfo() { uni.request({ - url: 'http://192.168.1.106:80/blade-system/dict-biz/get-goods-info', + url: getApp().globalData.baseUrl + '/blade-system/dict-biz/get-goods-info', method: 'GET', success: (res) => { if (JSON.stringify(res.data.data) !== '{}') { @@ -71,46 +63,8 @@ // 点击定制 clickCustom() { console.log('点击定制'); - uni.request({ - url: getApp().globalData.baseUrl + '/blade-desk/order/save', - method: 'POST', - data: { - buyerId: this.userInfo.id, - buyerName: this.userInfo.username, - buyerPhone: this.phone - }, - header: { - 'Blade-Auth': 'bearer ' + uni.getStorageSync('token') - }, - success: (res) => { - if (res.data.code == 200) { - console.log('下单成功'); - uni.navigateTo({ - url: '/pages/pages_zhentou/order/order' - }) - } else if (res.data.code == 401) { - this.doLogin(); - } else if (res.data.code == 1001) { - uni.showModal({ - title: '提示', - content: res.data.msg, - success: (res2) => { - if (res2.confirm) { - uni.navigateTo({ - url: '/pages/pages_zhentou/order/order' - }) - } else if (res.cancel) { - console.log('用户点击取消'); - } - } - }); - } else { - uni.showToast({ - title: res.data.msg, - icon: 'none' - }) - } - } + uni.navigateTo({ + url: '/pages/pages_zhentou/order/confirmOrder' }) }, // 跳转到我的页面 @@ -121,33 +75,10 @@ }, // 填写表单 addForm() { - // console.log('跳转页面') - // uni.navigateTo({ - // url: '/pages/pages_zhentou//form/form' - // }); uni.switchTab({ url: '/pages/pages_zhentou/form/form' }); }, - //用户信息 - getUserProfile() { - uni.getUserProfile({ - lang: 'zh_CN', - desc: '获取微信用户的昵称和头像', - success: (res) => { - console.log(res) - this.userInfo = res.userInfo; - this.hasUserInfo = true; - if (this.phone) { - //如果手机号存在直接调取保存 - this.doSave(); - } - }, - fail: (err) => { - console.log(err) - } - }) - }, //获取手机号 getPhoneNumber(e) { console.log(e, '获取手机号授权') diff --git a/pages/pages_zhentou/myPage/myPage.vue b/pages/pages_zhentou/myPage/myPage.vue index fa3dfcc..6244c50 100644 --- a/pages/pages_zhentou/myPage/myPage.vue +++ b/pages/pages_zhentou/myPage/myPage.vue @@ -1,8 +1,11 @@ - - {{userInfo.username}} + + + + {{userInfo.username}} + 用户功能 @@ -23,7 +26,7 @@ - 售货服务 + 售后服务 @@ -35,20 +38,24 @@ export default { data() { return { - userInfo: {} + userInfo: { + username: '', + avatar: '' + } } }, onShow() { let userInfo = uni.getStorageSync('userInfo'); if (userInfo) { this.userInfo = JSON.parse(userInfo); - if(this.userInfo.id == undefined) { - this.userInfo.avatar = this.userInfo.avatarUrl; - this.userInfo.username = this.userInfo.nickName; - } } }, methods: { + //获取头像 + chooseavatar() { + const { avatarUrl } = e.detail + this.userInfo.avatar = avatarUrl; + }, returnOrder(){ uni.navigateTo({ url:"/pages/pages_zhentou/order/order" diff --git a/pages/pages_zhentou/order/confirmOrder.vue b/pages/pages_zhentou/order/confirmOrder.vue new file mode 100644 index 0000000..5c1d487 --- /dev/null +++ b/pages/pages_zhentou/order/confirmOrder.vue @@ -0,0 +1,441 @@ + + + + + + 默认 + 山东省青岛市市北区 + + 大港街道大港三路8号铁路住宅小区6号楼6单元666室 + 请填写收货地址 + + 1d + 15612345678 + + + + + + + + 壹人壹枕 + + + + + + + {{goodsInfo.goodsName}} + + 共{{orderInfo.goodsNum}}件 + + ¥{{goodsInfo.price}} + + + + + + 购买数量 + + + + {{orderInfo.goodsNum}} + + + + + + + + + 共计 + + ¥ + {{totalPrice}} + + + 立即支付 + + + + + + + \ No newline at end of file diff --git a/pages/pages_zhentou/order/order.vue b/pages/pages_zhentou/order/order.vue index 3908168..6d5502c 100644 --- a/pages/pages_zhentou/order/order.vue +++ b/pages/pages_zhentou/order/order.vue @@ -1,11 +1,11 @@ - 全部 - 待付款 - 待发货 - 待收货 - 已完成 + 全部 + 待付款 + 待发货 + 待收货 + 已完成 diff --git a/static/image/icon_jian.png b/static/image/icon_jian.png new file mode 100644 index 0000000000000000000000000000000000000000..3709519362cdab647b75824d16223811cbc8abbd GIT binary patch literal 1086 zcmV-E1i|}>P)Px&_(?=TRCr$PoX=}qRTRh1H|pFQ0>%nO3Z=GjVGCv})P>Tu?Y7cQUAU+U{#c0C zf50CVL=G@*(+dAU?lHU z)pGzI7}P526o=%uF~%dk9t`V%k-Sw^zXEWuPDKuStt7vWF&+Z&@7mbwfT`-~>o4wu zUPB$@y%%HbdP(X6rmFde@7A%hA+Gs}7-Ke3>*@d_c~?s5l8D41Ca+`YB7`slV6h9B zAH@y#^353IvmIbXQS1ZolZf0>M+;Q2=8nr+N3tl2j{rPcLE<{6XgvU0z*O}|5xKX{ z)l{(dxftVqq?GoP{Goz`wNC-yKn8Y_;iy? zYF|wS1(5tQ1G@y^?h5jaLW()4s)|S$g=#9O;YtR^3KES>3I}G~N(bh^j0B8wcbEe+ z5-`f$VGhhlz$kZzIWQvuqud?lz>EZpa(9>mGZHY$-C+*Q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pVBOb{cj>7B&6-C%M#yyeLbx%+ePD((qpfRKw_*{iSN#>U1|^RA0= zuQ5CkqqlweG#@{Piaq!Di*}q)a=quzcJTFKW8?j0&9^=zyWU~0P3GhNY2eDoxqFVdQ&MBb@ E07Gyiwg3PC literal 0 HcmV?d00001 diff --git a/static/image/icon_plus.png b/static/image/icon_plus.png new file mode 100644 index 0000000000000000000000000000000000000000..2822fec822155e21f7331bfda8a75d2801defd2b GIT binary patch literal 1235 zcmeAS@N?(olHy`uVBq!ia0vp^J|N7&1|*M957Y)yjKx9jP7LeL$-HD>VCnUAaSW-5 zdpjq(LpoLD`2X}tzPesjjfnTvFUVd|ieNR-_S@(Ooq!pw*q>)(GZ8SDzfW0_K?i^`_WezshpDk{NLvEVb)1|A)`^9&r^8Dy;c<1@Ke<5_~Uqif{21GY6lKXpLe*9;iB@| zr;8Xq_fIi9%k5IK|3QG#gs(Ew*e_bC?(A4MQMP|`L4f*&(gWLidK3SiJ9VG++#ee~ zS^IT%i}|#7^WCTw7T!_({@$l8b61B?v@Te1SmMfMZiCV=*QE@?3A0#Co<1^QT;}Nz ztjC9sdrz?aZt)`)GdZgzmQ%i+UO(TmxqI>3zk7TeGUe16)edN}RHb?5*%h&rzrDS@ z^3AlTubmWsG##9EsfMl9=I}j+2fDp z92IezYy4f0{Bb+7>DYAHZQ0k&B-+BKYU@h8l2&@3F2@sj?fz3U9?8o!b35bS1v8t@ zEjt-IZv~Ie_GI@B0z7e3cK-`~^DHAVFb-vX4g}jU%d^d zs;Aj4I)30ib8)fq!p-T=!~CM7eyvq-IwRlC`#5s#w7RR7Zz}F&@B0=fZ(>w5@ciT(Lk z$lzZ6cV)v&@s6L$`(N*qoi*>@V$l_C+eKG3Zp(a^xJbRD(wup=!
壹人壹枕
{{goodsInfo.goodsName}}
+ 共{{orderInfo.goodsNum}}件 + + ¥{{goodsInfo.price}} + +
全部
待付款
待发货
待收货
已完成