diff --git a/pages.json b/pages.json index 48ff9e1..1f79b0e 100644 --- a/pages.json +++ b/pages.json @@ -403,6 +403,30 @@ "style" : { "navigationBarTitleText" : "下单" } + }, + { + "path" : "pointsMall/record", + "style" : { + "navigationBarTitleText" : "积分明细" + } + }, + { + "path" : "rewards/index", + "style" : { + "navigationBarTitleText" : "企业福利-使用中心" + } + }, + { + "path" : "rewards/order", + "style" : { + "navigationBarTitleText" : "企业福利-使用中心" + } + }, + { + "path" : "rewards/exchange", + "style" : { + "navigationBarTitleText" : "企业福利-使用中心" + } } ] diff --git a/pages/user/user.vue b/pages/user/user.vue index fe30396..f44beeb 100644 --- a/pages/user/user.vue +++ b/pages/user/user.vue @@ -20,7 +20,7 @@ - 可用积分:300 + 可用积分:{{userInfo.score||0}} 兑换商品 @@ -79,7 +79,7 @@ - + @@ -218,6 +218,13 @@ isShow: true, webUrl: "https://supplier-h5.sutenong.com", }, + { + src: 'https://static.ticket.sz-trip.com/uploads/20250922/0bfef414c1349797436a78663aac75a3.png', + title: '企业采购核销兑换', + path: '/subPackages/rewards/index', + isShow: true, + }, + { src: 'https://static.ticket.sz-trip.com/shiweisuzhou/images/user/yhxy.png', title: '用户协议', @@ -245,10 +252,19 @@ // },'/api/uservice/user/getMyInfo').then(res => { // this.$store.commit('changeUserInfo', res.data); // }) + this.Post({}, "/api/uservice/user/getMyInfo").then(res => { + if (res.data) { + let info = res.data; + info.token = JSON.parse(uni.getStorageSync('userInfo')).token || this.$store.state.user.userInfo.token + this.$store.commit('changeUserInfo', info) + this.userInfo = info + uni.setStorageSync('isFlag', true) + } + console.log(this.userInfo) + }) + + - this.userInfo = (uni.getStorageSync('userInfo') && JSON.parse(uni.getStorageSync('userInfo'))) || this.$store.state.user.userInfo || {} - console.log(this.userInfo) - uni.setStorageSync('isFlag', true) // this.dfkList = [] // this.nowDateTime = parseInt(new Date().getTime() / 1000) // this.Post({}, "/api/user/userInfo").then((res) => { @@ -416,12 +432,12 @@ getHotList() { this.Post({ - // tag_id: 648, + tag_id: this.envPropObj.use_recommend_tag_id, offset: this.hotList.length, limit: 4, order: "sales_number" - },'/api/product/get_product_by_type').then(res => { - this.hotList = res.data.list + },'/api/product/get_product_by_tag').then(res => { + this.hotList = res.data.list || [] }) }, diff --git a/static/js/CommonFunction.js b/static/js/CommonFunction.js index 1f521fb..712d3bb 100644 --- a/static/js/CommonFunction.js +++ b/static/js/CommonFunction.js @@ -1,6 +1,17 @@ // 获取路径参数 import Vue from "vue"; +// 全局变量 切换测试/正式 +Vue.prototype.envPropObj = { + // 测试环境 + // 我的-为您推荐 标签id + use_recommend_tag_id: 684, + // 积分商城-每日精选 + score_daily_recommend: 679, + // 积分商城-分类-全部 + score_type_all: 680, +} + // 格式化富文本 Vue.prototype.formateRichText = str => { if (!str) return ""; diff --git a/subPackages/order/orderDetail.vue b/subPackages/order/orderDetail.vue index 1553b94..8acca68 100644 --- a/subPackages/order/orderDetail.vue +++ b/subPackages/order/orderDetail.vue @@ -358,6 +358,10 @@ 优惠券:-¥{{info.preference_money / 100}} + + 积分:-{{info.total_score_amount}} + + 实付金额: {{info.paid_money / 100}} diff --git a/subPackages/pointsMall/detail.vue b/subPackages/pointsMall/detail.vue index b4e0e21..c01e16c 100644 --- a/subPackages/pointsMall/detail.vue +++ b/subPackages/pointsMall/detail.vue @@ -28,10 +28,10 @@ - {{ info.price / 100 }} + {{ info.score_price}} /份 - 已售{{info.sales_number || 0}}份 + 已兑{{info.sales || 0}}份 {{ info.title }} {{ info.subtitle }} @@ -67,7 +67,7 @@ 限制:{{info.display_tags.split(',').join(' | ')}} - + 产品详情 @@ -92,26 +92,28 @@ - + - + - 加入购物车 - 立即购买 + + + {{info.score_price}}兑换 + @@ -125,7 +127,7 @@ - {{(sku[productIndex].price||0)/100}} + {{(sku[productIndex].price_text||0)}} 已选择:{{sku[productIndex].sku_name}} @@ -647,7 +649,7 @@ box-shadow: 0rpx 0rpx 16rpx 0rpx rgba(6, 0, 1, 0.1); display: flex; justify-content: space-between; - padding: 30rpx 26rpx 0 ; + padding: 23rpx 26rpx 0 50rpx; .left-box { display: flex; @@ -914,11 +916,11 @@ border-radius: 20rpx 0rpx 0rpx 20rpx; } .right-btn-buy{ - width: 200rpx; - height: 75rpx; - line-height: 75rpx; + width: 467rpx; + height: 87rpx; background: #6A8A27; - border-radius: 0rpx 20rpx 20rpx 0rpx; + border-radius: 20rpx; + line-height: 87rpx; } } .add-cart-icon{ diff --git a/subPackages/pointsMall/index.vue b/subPackages/pointsMall/index.vue index 2e72177..7572b6f 100644 --- a/subPackages/pointsMall/index.vue +++ b/subPackages/pointsMall/index.vue @@ -7,7 +7,7 @@ - 已连签{{cuntinue_days}}天 + 已连签{{continue_days}}天 注:连续签到可获得更多积分,断签后重新累积 @@ -15,15 +15,17 @@ +{{item.score}} - + + + - 积分规则 - 积分明细 + 积分规则 + 积分明细 已签到 @@ -38,7 +40,9 @@ - + @@ -52,11 +56,12 @@ - + + enable-flex scroll-x scroll-with-animation :show-scrollbar="false" + > {{type.name}} @@ -74,7 +79,7 @@ {{item.title}} - 已兑14100件 + 已兑{{item.sales}}件 {{item.score_price}} @@ -93,6 +98,21 @@ +{{todayRecord.score}} + + + + + + + + + + + + + @@ -102,7 +122,7 @@ return { isSign: false, totalScore: 0, - cuntinue_days: 0, + continue_days: 0, // 7日连续签到日期 0-6 lastSign: -1, daySign: [], @@ -110,13 +130,19 @@ JXList: [], + JXPage: 1, typeIndex:0, scrollView: "scroll0", typeList: [ - {name:"分类",id:"680",}, + {name:"分类",id:"",}, ], prodList: [], + + scoreRule: null, + + page: 1, + finish: false, } }, onReady () { @@ -125,12 +151,15 @@ this.getJXList() this.getTypeList() this.getProdListByType() + this.getRule(2) }, methods: { // 签到 signUp () { this.Post({method:"POST"},"/api/user_sign/sign").then(res => { this.$refs.signPop.open() + this.getSignList() + this.getScore() }) }, // 获取签到记录 @@ -141,12 +170,13 @@ let todayRecordIndex = res.data.days.findIndex(day => day.date === today) let todayRecord = res.data.days[todayRecordIndex] this.isSign = todayRecord.is_sign; - this.cuntinue_days = res.data.cuntinue_days; + this.continue_days = res.data.continue_days; this.todayRecord = todayRecord; let startIndex = 0 - if (this.cuntinue_days<=3) { - startIndex = todayRecordIndex - this.cuntinue_days - this.lastSign = this.cuntinue_days-1 + console.log(this.continue_days) + if (this.continue_days<=3) { + startIndex = todayRecordIndex - this.continue_days + this.lastSign = this.continue_days-1 } else { startIndex = 4; this.lastSign = 3 @@ -161,20 +191,30 @@ }) }, + getRule (id) { + this.Post({id: id},"/api/sweepstakes/sweepstakes_act/getActInfo").then(res => { + this.scoreRule = res.data + }) + }, + + // 精选 getJXList(){ this.Post({ - tag_id: 679, - offset: 0, + tag_id: this.envPropObj.score_daily_recommend, + page: this.JXPage, limit: 10, },'/api/score_goods_sku_price/index').then(res => { - this.JXList = res.data.data + this.JXList = [...this.JXList,...res.data.data] + if (res.data.data.length > 0) { + this.JXPage++ + } }) }, // 获取分类 getTypeList () { - this.Post({pid: 680},'/api/product/tag_list').then(res => { + this.Post({pid: this.envPropObj.score_type_all},'/api/product/tag_list').then(res => { this.typeList = [ {name:"全部",id:"",}, ...res.data @@ -189,16 +229,25 @@ this.typeIndex = index; let i = (index-1)>0?(index-1):0; this.scrollView = "scroll"+i; + this.prodList = []; + this.finish = false; + this.page = 1; this.getProdListByType() }, getProdListByType () { this.Post({ tag_id: this.typeList[this.typeIndex].id, - offset: 0, + page: this.page, limit: 10, },'/api/score_goods_sku_price/index').then(res => { - this.prodList = res.data.data + this.prodList = [...this.prodList,...res.data.data] + if (res.data.current_page{ + if (!this.finish) this.getProdListByType() + },1000) + } } @@ -275,6 +329,12 @@ height: 20rpx; background: #FFF0B3; border-radius: 50%; + display: flex; + align-items: center; + justify-content: center; + position: relative; + z-index: 2; + line-height: 0; } &.line0{ width: 55%; @@ -368,10 +428,11 @@ position: relative; } .jx-box{ - padding: 22rpx 0 80rpx; + padding: 22rpx 0; display: flex; flex-wrap: nowrap; overflow-x: auto; + box-sizing: border-box; } .jx-item{ width: 253rpx; @@ -523,4 +584,47 @@ position: absolute; } } + + .rulePop{ + height: 70vh; + box-sizing: border-box; + width: 750rpx; + position: relative; + padding: 60rpx 40rpx 0; + background: white; + + + .btn-box{ + position: fixed; + width: 100%; + bottom: 0; + left: 0; + right: 0; + height: 120rpx; + padding: 20rpx 20rpx 0; + background: #f5f5f5; + .btn{ + width: 100%; + height: 67rpx; + background: linear-gradient(-90deg, #FB2A54, #FF773D); + border-radius: 33rpx; + font-weight: bold; + font-size: 31rpx; + color: #fff; + text-align: center; + line-height: 67rpx; + } + } + + .close-pop{ + width: 34rpx; + height: 34rpx; + top: 20rpx; + right: 20rpx; + position: absolute; + } + .content{ + width: 100%;height: 100%;overflow-y: auto;overflow-x: hidden; + } + } \ No newline at end of file diff --git a/subPackages/pointsMall/order.vue b/subPackages/pointsMall/order.vue index 0cc2842..352659b 100644 --- a/subPackages/pointsMall/order.vue +++ b/subPackages/pointsMall/order.vue @@ -721,6 +721,7 @@ export default { // 预定 order() { let goods = []; + let score_amount = 0; for(let info of this.orderList) { let param = { type: info.pInfo.type, @@ -761,6 +762,8 @@ export default { param.post = info.delivery.id } } + + score_amount+= info.sInfo.buyNum* info.sInfo.score; goods.push(param) } @@ -775,7 +778,10 @@ export default { let data = { product_list: goods, + order_type: "score", + score_amount:score_amount, coupon_id: this.coupon ? this.coupon.id : null, + }; this.Post( diff --git a/subPackages/pointsMall/record.vue b/subPackages/pointsMall/record.vue new file mode 100644 index 0000000..bce2e85 --- /dev/null +++ b/subPackages/pointsMall/record.vue @@ -0,0 +1,277 @@ + + + + + \ No newline at end of file diff --git a/subPackages/pointsMall/searchResult.vue b/subPackages/pointsMall/searchResult.vue index cc49c48..24a1d85 100644 --- a/subPackages/pointsMall/searchResult.vue +++ b/subPackages/pointsMall/searchResult.vue @@ -6,17 +6,10 @@
搜索
- +
- + - + {{item.score_price}} + 兑换 @@ -56,27 +50,11 @@ name: "Search", data() { return { - typeList: [ - {name: '全部', type: ''}, - {name: '游玩', type: 'ticket'}, - {name: '民宿', type: 'hotel'}, - {name: '线路', type: 'line'}, - {name: '农产品', type: 'post'}, - ], - typeIndex: 0, + + page: 1, showMore: true, list: [], keywords: "", - - types: { - 'goods': "商品", - // 'scenic': "景点", - 'article': "文章", - 'activity':'活动' - }, - deliveryMethod: { - "1":"邮寄","2":"自提", "3":"配送" - }, options: {} } }, @@ -86,16 +64,12 @@ this.getList() }, methods: { - setType(index) { - if (this.typeIndex!==index) { - this.typeIndex = index; - this.list = [] - this.getList() - } - }, + search() { this.pushHis(this.keywords); this.list = []; + this.page = 1; + this.showMore = true; this.getList(); }, pushHis(keywords) { @@ -110,28 +84,24 @@ uni.setStorageSync('tz_trip_jf_keyowrds',JSON.stringify(history)) }, gotoDetail(item) { - + uni.navigateTo({ + url:`/subPackages/pointsMall/detail?id=${item.id}&type=score` + }) }, getList() { this.Post({ - name: this.keywords, - offset: this.list.length, - type: this.typeList[this.typeIndex].type, - limit: 10, - lon: uni.getStorageSync('location').lon || '120', - lat: uni.getStorageSync('location').lat || '36', + keyword: this.keywords, + page: this.page, }, '/api/score_goods_sku_price/index').then(res => { console.log(res) let resData = res.data.data || [] - // resData.forEach(v=>{ - // if (v.ext.delivery_method) { - // v.ext.delivery_method_str = this.getDeliveryMethodStr(v.ext.delivery_method) - // } - // }) this.list = [...this.list, ...resData]; this.showMore = true if (res.data.length<10) { this.showMore = false + } else { + this.page++ + this.showMore = true } }) } @@ -189,25 +159,28 @@ .search-list { padding: 26rpx 30rpx; background: #F7F7F7; + display: flex; + justify-content: space-between; + flex-wrap: wrap; } .search-item { - width: 100%; - height: 200rpx; + width: 334.67rpx; + height: 500rpx; background: #FFFFFF; border-radius: 13rpx; display: flex; margin-bottom: 26rpx; + flex-direction: column; .img { - width: 200rpx; - height: 200rpx; - background: #87CD93; - border-radius: 13rpx; + width: 334.67rpx; + height: 334.67rpx; + border-radius: 13rpx 13rpx 0; flex-shrink: 0; } .content { - padding:13rpx 20rpx; + padding:10rpx 12rpx 12rpx; display: flex; flex-direction: column; justify-content: space-between; @@ -220,49 +193,25 @@ color: #000000; width: 100%; } - .distance { - font-family: PingFang SC; - font-weight: 500; - font-size: 24rpx; - color: #666666; - display: flex; - align-items: center; - flex: 1; - width: 100%; - padding-right: 10rpx; - - image{ - width: 26rpx; - height: 26rpx; - flex-shrink: 0; - } - text{ - flex: 1; - width: 1rpx; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - height: 26rpx; - line-height: 26rpx; - } - } - + .price { font-family: PingFang SC; - font-weight: 500; - font-size: 33.33rpx; - color: #C3282E; + font-weight: bold; + font-size: 24rpx; + color: #FB2A54; display: flex; align-items: baseline; } - .price::before{ - content: '¥'; - font-size: 24rpx; - } - .ticlet-price::after{ - content: '起'; - font-size: 24rpx; - color: #999999; + .btn{ + width: 93rpx; + height: 47rpx; + background: #FB2A54; + border-radius: 23rpx; + font-weight: bold; + font-size: 28rpx; + color: #FFFFFF; + text-align: center; + line-height: 47rpx; } } diff --git a/subPackages/rewards/exchange.vue b/subPackages/rewards/exchange.vue new file mode 100644 index 0000000..07f2e19 --- /dev/null +++ b/subPackages/rewards/exchange.vue @@ -0,0 +1,90 @@ + + + + + \ No newline at end of file diff --git a/subPackages/rewards/index.vue b/subPackages/rewards/index.vue new file mode 100644 index 0000000..005b81c --- /dev/null +++ b/subPackages/rewards/index.vue @@ -0,0 +1,199 @@ + + + + + \ No newline at end of file diff --git a/subPackages/rewards/order.vue b/subPackages/rewards/order.vue new file mode 100644 index 0000000..aca50a7 --- /dev/null +++ b/subPackages/rewards/order.vue @@ -0,0 +1,844 @@ + + + + + \ No newline at end of file diff --git a/subPackages/search/result.vue b/subPackages/search/result.vue index ae94cd2..8adde1d 100644 --- a/subPackages/search/result.vue +++ b/subPackages/search/result.vue @@ -16,7 +16,7 @@
- + @@ -29,7 +29,7 @@ - + {{item.ext.address}} @@ -62,6 +62,7 @@ {name: '民宿', type: 'hotel'}, {name: '线路', type: 'line'}, {name: '农产品', type: 'post'}, + {name: '文章', type: 'travels'}, ], typeIndex: 0, showMore: true, @@ -110,7 +111,14 @@ uni.setStorageSync('tz_trip_keyowrds',JSON.stringify(history)) }, gotoDetail(item) { - + console.log(item) + if (item.type == "travels") { + uni.navigateTo({ + url:`/subPackages/letter/detail?id=${item.ext.id}` + }) + return + } + this.gotoDetailByType(item.ext) }, getList() { this.Post({