From 8eb3fcdfec411c8e6555c939cd40789c511194fa Mon Sep 17 00:00:00 2001 From: chenkainan Date: Wed, 28 Aug 2024 15:05:24 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- compoents/waterList.vue | 156 --------- pages.json | 36 +++ pages/index/index.vue | 5 - pages/user/user.vue | 6 +- static/js/CommonFunction.js | 27 +- subPackages/food/foodDetail.vue | 6 +- subPackages/user/collect.vue | 122 +++++++ subPackages/user/coupon.vue | 494 +++++++++++++++++++++++++++++ subPackages/user/myAddressAdd.vue | 386 ++++++++++++++++++++++ subPackages/user/myContactsAdd.vue | 247 +++++++++++++++ subPackages/user/privacy.vue | 58 ++++ subPackages/user/privacyInfo.vue | 30 ++ subPackages/user/profile.vue | 6 +- subPackages/user/travelerList.vue | 278 +++++++++++++++- 14 files changed, 1673 insertions(+), 184 deletions(-) delete mode 100644 compoents/waterList.vue create mode 100644 subPackages/user/collect.vue create mode 100644 subPackages/user/coupon.vue create mode 100644 subPackages/user/myAddressAdd.vue create mode 100644 subPackages/user/myContactsAdd.vue create mode 100644 subPackages/user/privacy.vue create mode 100644 subPackages/user/privacyInfo.vue diff --git a/compoents/waterList.vue b/compoents/waterList.vue deleted file mode 100644 index 0c93772..0000000 --- a/compoents/waterList.vue +++ /dev/null @@ -1,156 +0,0 @@ - - - - - \ No newline at end of file diff --git a/pages.json b/pages.json index e687bc9..ece37bc 100644 --- a/pages.json +++ b/pages.json @@ -143,6 +143,42 @@ "style": { "navigationBarTitleText": "订单填写" } + }, + { + "path": "user/myContactsAdd", + "style": { + "navigationBarTitleText": "联系人信息" + } + }, + { + "path": "user/myAddressAdd", + "style": { + "navigationBarTitleText": "收货地址" + } + }, + { + "path" : "user/privacy", + "style" : { + "navigationBarTitleText" : "隐私管理" + } + }, + { + "path" : "user/privacyInfo", + "style" : { + "navigationBarTitleText" : "详情" + } + }, + { + "path" : "user/coupon", + "style" : { + "navigationBarTitleText" : "优惠券" + } + }, + { + "path" : "user/collect", + "style" : { + "navigationBarTitleText" : "个人收藏" + } } ] }], diff --git a/pages/index/index.vue b/pages/index/index.vue index 3cedde0..7316443 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -147,12 +147,7 @@ + + \ No newline at end of file diff --git a/subPackages/user/coupon.vue b/subPackages/user/coupon.vue new file mode 100644 index 0000000..d95142d --- /dev/null +++ b/subPackages/user/coupon.vue @@ -0,0 +1,494 @@ + + + + + diff --git a/subPackages/user/myAddressAdd.vue b/subPackages/user/myAddressAdd.vue new file mode 100644 index 0000000..5a6d069 --- /dev/null +++ b/subPackages/user/myAddressAdd.vue @@ -0,0 +1,386 @@ + + + + + diff --git a/subPackages/user/myContactsAdd.vue b/subPackages/user/myContactsAdd.vue new file mode 100644 index 0000000..6f59dd4 --- /dev/null +++ b/subPackages/user/myContactsAdd.vue @@ -0,0 +1,247 @@ + + + + + diff --git a/subPackages/user/privacy.vue b/subPackages/user/privacy.vue new file mode 100644 index 0000000..b094b3a --- /dev/null +++ b/subPackages/user/privacy.vue @@ -0,0 +1,58 @@ + + + + \ No newline at end of file diff --git a/subPackages/user/privacyInfo.vue b/subPackages/user/privacyInfo.vue new file mode 100644 index 0000000..84bcba7 --- /dev/null +++ b/subPackages/user/privacyInfo.vue @@ -0,0 +1,30 @@ + + + + + diff --git a/subPackages/user/profile.vue b/subPackages/user/profile.vue index 17de9b1..ea8ae9c 100644 --- a/subPackages/user/profile.vue +++ b/subPackages/user/profile.vue @@ -17,7 +17,7 @@ @@ -198,7 +198,7 @@ birthday: this.birthday }, '/api/user/profile').then(res => { console.log(res) - if (res.code == 200) { + if (res.code == 1) { uni.showModal({ title: '提示', content: res.msg, @@ -339,7 +339,7 @@ font-size: 30rpx; width: 697rpx; height: 80rpx; - background: linear-gradient(90deg, #F84A56, #FF9834); + background: linear-gradient(90deg, #9EE4FE, #7FD491); border-radius: 40rpx; line-height: 80rpx; color: #FFFFFF; diff --git a/subPackages/user/travelerList.vue b/subPackages/user/travelerList.vue index 8f5c7eb..ded3ab9 100644 --- a/subPackages/user/travelerList.vue +++ b/subPackages/user/travelerList.vue @@ -10,10 +10,88 @@ - + + + + + + + {{item.name}} + + + {{item.tel}} + + + + + {{item.document_type_text}}: + + + {{item.id_number}} + + + + + + + + + + 默认出行人 + + + + + 修改 + + + 删除 + + + + + + + + + + + + {{item.name}} + + + {{item.tel}} + 默认 + + + + + 收货地址: + + + {{item.address}} + + + + + + 修改 + + + 删除 + + + + + + + {{showType ? '添加联系人' : '添加出行人'}} + + @@ -22,21 +100,72 @@ name: "travelerList", data() { return { - showType: 0 + showType: 0, + travelList: [], + addressList: [] }; }, onShow() { - this.$nextTick(()=>{ - this.init() - }) + this.init() }, methods: { init () { - if (this.showType === 0 && this.$refs.travelListVueRef) { - this.$refs.travelListVueRef.getList() - } else if (this.showType === 1 && this.$refs.selfPickupVueRef) { - this.$refs.selfPickupVueRef.getList() + // 出行人信息 + this.Post({}, "/api/user/contactList").then(res => { + if (res) this.travelList = res.data + }) + + // 收货地址 + this.Post({}, '/api/user/consigneeList').then(res => { + if(res) this.addressList = res.data + }) + }, + delet(item) { + let that = this + uni.showModal({ + title: '提示', + content: '确定要删除该出行人吗?', + success: function(res) { + if (res.confirm) { + that.Post({ + id: item.id + }, "/api/user/delDetail").then(res => { + if (res) { + uni.showToast({ + icon: "none", + title: res.msg + }) + } + that.getList() + }) + } else if (res.cancel) { + console.log('用户点击取消'); + } + } + }); + }, + defaultC(item) { + this.Post({ + id: item.id, + is_default: 1 + }, "/api/user/editContact").then(res => { + if (res.code == 1) { + this.travelList.forEach(i => i.is_default = 0) + item.is_default = !item.is_default + } + }) + }, + // 修改出行人信息 + edit(id){ + let url = '' + if(this.showType) { + url = '/subPackages/user/myAddressAdd?id='+id + }else { + url = "/subPackages/user/myContactsAdd?type=edit&id="+id } + uni.navigateTo({ + url: url + }); } } } @@ -48,7 +177,9 @@ background: #F7F7F7; height: 100vh; overflow-x: hidden; + padding-bottom: 200rpx; } + .cancat-nav{ width: 100%; display: flex; @@ -69,9 +200,130 @@ background: #71B580; } } - .concat-detail{ - flex: 1; - height: 10rpx; - overflow: hidden; + + .item { + width: 697rpx; + background: #FFFFFF; + border-radius: 13rpx; + margin: 0 auto; + margin-bottom: 28rpx; + padding: 26rpx; + + .name, + .idcard { + display: flex; + font-size: 31rpx; + font-weight: bold; + color: #333333; + + } + + .name { + view:last-child { + margin-left: 40rpx; + } + + span { + padding: 3rpx 9rpx; + background: #71B580; + border-radius: 7rpx; + font-weight: bold; + font-size: 24rpx; + color: #FFFFFF; + margin-left: 15rpx; + } + } + + .idcard { + margin-top: 26rpx; + + view:last-child { + margin-left: 14rpx; + font-weight: 400; + max-width: 492rpx; + + } + } + + .item-btn { + display: flex; + align-items: center; + justify-content: space-between; + margin-top: 40rpx; + + .choice { + display: flex; + align-items: center; + + view:last-child { + margin-left: 20rpx; + + font-size: 27rpx; + + font-weight: 500; + color: #333333; + } + + image { + width: 40rpx; + height: 40rpx; + } + + .yuan { + width: 40rpx; + height: 40rpx; + background: rgba(255, 200, 37, 0); + border: 1rpx solid #999999; + border-radius: 20rpx; + } + } + + .btn-list { + display: flex; + align-items: center; + + view { + width: 134rpx; + height: 54rpx; + background: #FFFFFF; + border: 1px solid #999999; + border-radius: 27rpx; + + + font-size: 27rpx; + font-weight: 500; + color: #333333; + line-height: 52rpx; + text-align: center; + } + + view:last-child { + margin-left: 14rpx; + } + } + } + } + + .btn-box { + position: fixed; + bottom: 0; + left: 0; + width: 100%; + height: 200rpx; + background-color: #fff; + + .btn { + width: 697rpx; + line-height: 80rpx; + background: linear-gradient(90deg, #9EE4FE, #7FD491); + border-radius: 37rpx; + font-weight: 500; + font-size: 36rpx; + color: #000000; + text-align: center; + position: fixed; + bottom: 53rpx; + left: 26.67rpx; + } } From c47176e739075d2fd00612062fdf3a3266ca328f Mon Sep 17 00:00:00 2001 From: shaojing <2901156235@qq.com> Date: Fri, 30 Aug 2024 09:47:04 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=A5=97=E9=A4=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manifest.json | 2 +- subPackages/food/foodDetail.vue | 3 +- subPackages/food/taocanDetail.vue | 178 +++++++++++++++++++++++++++++- 3 files changed, 176 insertions(+), 7 deletions(-) diff --git a/manifest.json b/manifest.json index 98332f7..63cd4f0 100644 --- a/manifest.json +++ b/manifest.json @@ -50,7 +50,7 @@ "quickapp" : {}, /* 小程序特有相关 */ "mp-weixin" : { - "appid" : "", + "appid" : "wxb8f15afe2765976d", "setting" : { "urlCheck" : false }, diff --git a/subPackages/food/foodDetail.vue b/subPackages/food/foodDetail.vue index a027d8f..d506b9a 100644 --- a/subPackages/food/foodDetail.vue +++ b/subPackages/food/foodDetail.vue @@ -152,7 +152,8 @@ url: '/subPackages/food/foodOrder' }); }, - taocanDetail() { + taocanDetail(item) { + this.$store.commit('changeFoodInfo', item); uni.navigateTo({ url: '/subPackages/food/taocanDetail' }); diff --git a/subPackages/food/taocanDetail.vue b/subPackages/food/taocanDetail.vue index 8183fd0..77b599e 100644 --- a/subPackages/food/taocanDetail.vue +++ b/subPackages/food/taocanDetail.vue @@ -1,6 +1,33 @@ @@ -8,15 +35,156 @@ export default { data() { return { - + info:"", + allprice: 0, } }, + onLoad() { + this.info = this.$store.state.user.foodInfo + console.log(this.info); + }, methods: { - + order() { + uni.navigateTo({ + url: '/subPackages/food/foodOrder' + }); + }, } } -