From 0596468486fe5aa156b6c6dee5d916a00d173c35 Mon Sep 17 00:00:00 2001 From: Vinjor Date: Fri, 27 Sep 2024 19:31:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=82=E5=8A=A0=E6=B4=BB=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/VNavigationBar.vue | 4 +- config.js | 2 +- pages/home/active.vue | 247 ++++++++---------- pages/my/register.vue | 8 +- uni_modules/uni-icons/changelog.md | 26 -- .../components/uni-icons/uni-icons.vue | 49 +--- .../components/uni-icons/uniicons.css | 65 +++-- .../components/uni-icons/uniicons.ttf | Bin 35824 -> 35760 bytes uni_modules/uni-icons/package.json | 29 +- uni_modules/uni-popup/changelog.md | 22 -- .../uni-popup-dialog/uni-popup-dialog.vue | 98 ++----- .../uni-popup-share/uni-popup-share.vue | 2 +- .../components/uni-popup/uni-popup.vue | 68 ++--- uni_modules/uni-popup/package.json | 5 +- utils/common.js | 2 +- 15 files changed, 220 insertions(+), 407 deletions(-) diff --git a/components/VNavigationBar.vue b/components/VNavigationBar.vue index 9f4aebc..94fc5be 100644 --- a/components/VNavigationBar.vue +++ b/components/VNavigationBar.vue @@ -20,7 +20,7 @@ - + @@ -109,4 +109,4 @@ font-weight: bold; } } - \ No newline at end of file + diff --git a/config.js b/config.js index 32be26b..c727c99 100644 --- a/config.js +++ b/config.js @@ -1,7 +1,7 @@ // 应用全局配置 module.exports = { // baseUrl: 'https://www.nuoyunr.com', - baseUrl: 'http://127.0.0.1:48080', + baseUrl: 'http://192.168.1.4:48080', imagesUrl: 'http://shequ.0315e.com/static/images/pages/', baseImageUrl: 'https://www.nuoyunr.com/minio/', wsUrl: 'wss://www.nuoyunr.com', diff --git a/pages/home/active.vue b/pages/home/active.vue index 558f730..630394c 100644 --- a/pages/home/active.vue +++ b/pages/home/active.vue @@ -3,15 +3,26 @@ - - - - {{ item.name }} - {{ item.remark }} + + {{ item.remark }} + + + + + + + + + + + + 输入内容:{{ value }} + - + @@ -27,9 +38,15 @@ export default { }, data() { return { - + value:"", + index:0, + array:[], + couponList:[], + orderInfo:{}, customInfo: {}, activeList: [], + //开卡有礼活动id + kkylActId:"", tabList: [{ value: 0, title: '礼包券' @@ -51,22 +68,29 @@ export default { console.log("已登录") this.getUserInfos() } - this.customInfo = JSON.parse(uni.getStorageSync('customerInfo')) - this.getActive() }, onLoad(data) { this.getActive() }, methods: { + inputDialogToggle(){ + + }, + bindPickerChange(e){ + this.index = e.detail.value + console.log("index",this.index) + this.joinKkylAct() + }, //获取当前登录用户信息 async getUserInfos() { - getUserInfoRequest() + await getUserInfoRequest() + await this.getActive() }, //查询营销活动列表 async getActive() { - let customInfo = JSON.parse(uni.getStorageSync('customerInfo')) + this.customInfo = JSON.parse(uni.getStorageSync('customerInfo')) const data = { - cusId: customInfo.id + cusId: this.customInfo.id } await request({ url: '/userClient/customer/activeList', @@ -74,11 +98,75 @@ export default { params:data }).then((res) => { this.activeList = res.data + for(var i = 0; i < this.activeList.length; i++) { + if(this.activeList[i].type=="kkyl"){ + this.kkylActId = this.activeList[i].id + request({ + url: "/userClient/customer/getActive", + method: "get", + params:{id:this.activeList[i].id} + }).then((res) => { + if(res.data.hasOwnProperty("couponList")&&res.data.couponList.length>0){ + this.couponList = res.data.couponList + for(var i = 0; i < res.data.couponList.length; i++) { + var coupon = res.data.couponList[i] + this.array.push(coupon.name+"("+coupon.amount+")") + } + this.$forceUpdate() + } + }) + } + } }) - } + }, + /** + * 参加活动 + * @param item + * @returns {Promise} + */ + async joinAct(item){ + let dataObj = {} + let url = "" + let method = "POST" + if(item.type == 'zcyl'){ + //注册有礼 + dataObj.cusId = this.customInfo.id + dataObj.activeId = item.id + url = "/userClient/customer/attendActive" + await request({ + url: url, + method: method, + data:dataObj + }).then((res) => { + console.log(res); + this.orderInfo = res.data + }) + }else if(item.type == 'kkyl'){ + //开卡有礼 - //参与营销活动 + } + + }, + /** + * 参加开卡有礼活动 + * @returns {Promise} + */ + async joinKkylAct(){ + let dataObj = {} + dataObj.cusId = this.customInfo.id + dataObj.activeId = this.kkylActId + dataObj.accountType='01' + dataObj.selectCoupon=[this.couponList[this.index]] + await request({ + url: "/userClient/customer/attendActive", + method: "POST", + data:dataObj + }).then((res) => { + console.log(res); + this.orderInfo = res.data + }) + } } @@ -106,138 +194,7 @@ export default { overflow: auto; - - .cardItem { - background: #FFFFFF; - border-radius: 16 rpx 16 rpx 16 rpx 16 rpx; - padding: 30 rpx; - } - - .cardItemTop { - display: flex; - align-items: center; - column-gap: 16 rpx; - padding-bottom: 32 rpx; - border-bottom: 1px solid #ddd; - } - - .cardImg { - width: 136 rpx; - height: 100 rpx; - background-color: #efefef; - - display: flex; - align-items: center; - justify-content: center; - - position: relative; - - .cardImgText { - color: #fff; - font-size: 24 rpx; - position: relative; - z-index: 2; - } - - .cardImgBg { - position: absolute; - width: 100%; - height: 100%; - top: 0; - left: 0; - z-index: 1; - } - } - - .cardInfo { - flex: 1; - width: 0; - display: flex; - flex-direction: column; - justify-content: space-between; - - padding: 6 rpx 0; - - .cardName { - font-size: 32 rpx; - color: #333333; - } - - .cardEndDate { - font-size: 24 rpx; - color: #999999; - } - } - - .cardInfoRight { - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - font-size: 24 rpx; - color: #FC4D4A; - - .cardNumValue { - font-size: 64 rpx; - } - - .cardLabel { - color: #999999; - } - } - } - - .cardItemBottom { - display: flex; - align-items: center; - justify-content: space-between; - padding: 30 rpx 0 0; - - .useSm { - font-size: 24 rpx; - color: #999999; - } - - .useBtn { - width: 144 rpx; - height: 60 rpx; - border-radius: 30 rpx 30 rpx 30 rpx 30 rpx; - border: 1 rpx solid #FC4D4A; - font-size: 28 rpx; - color: #FC4D4A; - display: flex; - align-items: center; - justify-content: center; - } } } -.tabbar { - background-color: #fff; - display: flex; - align-items: center; - - .tabItem { - flex: 1; - width: 0; - - display: flex; - justify-content: center; - padding: 30 rpx 0; - - position: relative; - } - - .activeLine { - width: 52 rpx; - height: 8 rpx; - background: #009EDA; - border-radius: 4 rpx 4 rpx 4 rpx 4 rpx; - - position: absolute; - left: 50%; - bottom: 2 rpx; - transform: translate(-50%, 0); - } -} diff --git a/pages/my/register.vue b/pages/my/register.vue index 6bc54e6..fa3d976 100644 --- a/pages/my/register.vue +++ b/pages/my/register.vue @@ -61,6 +61,7 @@ -