From 7b3b0c9ade31f64ecec26986378874ca236b1e14 Mon Sep 17 00:00:00 2001 From: lion <120344285@qq.com> Date: Mon, 23 Oct 2023 15:56:15 +0800 Subject: [PATCH] up --- config.js | 2 +- package.json | 1 - .../pages/shopDetail/shopDetail.vue | 21 +- .../packageBuy/pages/shopList/shopList.vue | 38 ++- pages/active/detail.vue | 181 ++++++++++----- pages/home/home.vue | 95 +++++++- uni_modules/uv-scroll-list/changelog.md | 8 + .../components/uv-scroll-list/nvue.js | 29 +++ .../components/uv-scroll-list/other.js | 0 .../components/uv-scroll-list/props.js | 35 +++ .../components/uv-scroll-list/scrollWxs.wxs | 50 ++++ .../uv-scroll-list/uv-scroll-list.vue | 217 ++++++++++++++++++ uni_modules/uv-scroll-list/package.json | 87 +++++++ uni_modules/uv-scroll-list/readme.md | 19 ++ 14 files changed, 703 insertions(+), 80 deletions(-) create mode 100644 uni_modules/uv-scroll-list/changelog.md create mode 100644 uni_modules/uv-scroll-list/components/uv-scroll-list/nvue.js create mode 100644 uni_modules/uv-scroll-list/components/uv-scroll-list/other.js create mode 100644 uni_modules/uv-scroll-list/components/uv-scroll-list/props.js create mode 100644 uni_modules/uv-scroll-list/components/uv-scroll-list/scrollWxs.wxs create mode 100644 uni_modules/uv-scroll-list/components/uv-scroll-list/uv-scroll-list.vue create mode 100644 uni_modules/uv-scroll-list/package.json create mode 100644 uni_modules/uv-scroll-list/readme.md diff --git a/config.js b/config.js index 76bbd47..b5a321e 100644 --- a/config.js +++ b/config.js @@ -1,7 +1,7 @@ export const appConfig = { appId: 'wx9b4762770771d98a', //孕育邦 //appId:"wx3dc65ce9b588727a",//孕育咨询 - //baseUrl: 'http://yunyubang.localhost.com', + // baseUrl: 'http://yunyubang.localhost.com', baseUrl:'https://yunyubang.ali251.langye.net',// 'https://yunyubang2021.langye.net', //孕育邦 // baseUrl: 'https://yybtest.ali251.langye.net', diff --git a/package.json b/package.json index f364f15..fb27f33 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,6 @@ "select" ], "dependencies": { - "uview": "^0.1.0", "uview-ui": "^1.8.4" } } diff --git a/packages/packageBuy/pages/shopDetail/shopDetail.vue b/packages/packageBuy/pages/shopDetail/shopDetail.vue index 1524a4a..a5d33a6 100644 --- a/packages/packageBuy/pages/shopDetail/shopDetail.vue +++ b/packages/packageBuy/pages/shopDetail/shopDetail.vue @@ -119,8 +119,9 @@ 客服 - - 立即购买 + + {{buyName}} + {{buyName}} @@ -246,7 +247,8 @@ showPass: false, info: {}, viewCounts:'', - dataList: [], + dataList: [], + buyName:'', form: { product_type: "product", product_id: "", @@ -894,15 +896,17 @@ }) }, loadInfo: function() { - this.loadView(); + this.loadView(); + let that = this weixin.request({ api: '/api/member/get-product/' + this.id, method: 'GET', utilSuccess: r => { //r.data.poster = this.baseUrl + r.data.poster; - this.info = r.data; - this.info.poster = (weixin.isNull(this.info.poster) ? "../../static/750x500.jpg" : - this.info.poster_url) + that.info = r.data; + that.info.poster = (weixin.isNull(that.info.poster) ? "../../static/750x500.jpg" : + that.info.poster_url) + that.buyName = that.info.state=='active'?'立即购买':'已下架' }, utilFail: r => { console.log(r); @@ -1094,6 +1098,9 @@ text-align: center; line-height: 72rpx; color: #fff; + } + .buyNoBtn{ + background: linear-gradient(90deg, #ddd 0%, #ddd 100%); } } diff --git a/packages/packageBuy/pages/shopList/shopList.vue b/packages/packageBuy/pages/shopList/shopList.vue index ffa4f62..0b0d574 100644 --- a/packages/packageBuy/pages/shopList/shopList.vue +++ b/packages/packageBuy/pages/shopList/shopList.vue @@ -17,13 +17,17 @@ - - + + + + + @@ -83,7 +87,15 @@ dataList: [], currentPage: 1, product_type_id: 0, - isLoading: false + isLoading: false, + current:0, + tablist:[{ + name: '当前产品', + idx: 0 + }, { + name: '往期回顾', + idx: 1 + }] } }, @@ -165,6 +177,13 @@ uni.navigateTo({ url: "../shopDetail/shopDetail?id=" + id }) + }, + activeChange(e) { + let that = this + that.current = e; + that.dataList = [] + + this.loadPage(1); }, loadPage: function(page) { uni.hideKeyboard() @@ -180,7 +199,8 @@ keyword: that.keyword, product_type_id: that.product_type_id, sort_name:'sortnumber', - sort_type:"ASC" + sort_type:"ASC", + previous:that.tablist[that.current].idx }, utilSuccess: function(r) { var res = r.data.data; diff --git a/pages/active/detail.vue b/pages/active/detail.vue index bcc61fc..12da591 100644 --- a/pages/active/detail.vue +++ b/pages/active/detail.vue @@ -368,8 +368,9 @@ - @@ -480,7 +481,7 @@ illustration:'', showUser: false, showPhone: false, - + isType3:false } }, onShareAppMessage() { @@ -788,55 +789,123 @@ if (r.data.status === 1) { uni.getImageInfo({ src: this.baseUrl + r.data.data, // 二维码 - success: res => { - var ctx = uni.createCanvasContext('firstCanvas') - var w = SCREEN_WIDTH * 0.9; - var h = this. shareHeight* this.scare; - ctx.drawImage('../../static/bg_haibao1.png', 0, 40, - w, h*.9); - console.log("this.poster",this.poster) - ctx.drawImage(this.poster, 11, 51, - w-22, (h+5) * 0.3); - - - ctx.font = "16rpx bold"; - // 设置颜色 - ctx.fillStyle = "#000"; - // 绘制文字(参数:要写的字,x坐标,y坐标) - let active_title = this.info.template == '新' ? '课程' : '活动' - // ctx.fillText(active_title, w*0.1, (h + 50) * 0.6 + 20); - - ctx.font = "14rpx bold"; - // 设置颜色 - ctx.fillStyle = "#333"; + success: res => { + if(this.info.active_type_id==3){ + this.isType3 = false + var ctx = uni.createCanvasContext('firstCanvas') + var w = SCREEN_WIDTH * 0.9; + var h = this.shareHeight * this.scare; + console.log(1) + ctx.drawImage('../../static/bg_haibao@2x.jpg', 0, 0, + w, h + ); + ctx.drawImage('../../static/bg_haibao2.png', 20, 30 + 40, + w - + 40, h - 100); + + ctx.drawImage(this.poster, 20, 30 + 40, + w - + 40, (h - 60 - 60) * 0.5); + ctx.font = "22rpx bold"; + // 设置颜色 + ctx.fillStyle = "#fff"; + // 绘制文字(参数:要写的字,x坐标,y坐标) + ctx.fillText(this.info.active_name, 20, 50); + + ctx.font = "16rpx bold"; + // 设置颜色 + ctx.fillStyle = "#000"; + // 绘制文字(参数:要写的字,x坐标,y坐标) + ctx.fillText("活动", 40, (h + 50) * 0.5 + 20); + + ctx.font = "14rpx bold"; + // 设置颜色 + ctx.fillStyle = "#3377b7"; + // 绘制文字(参数:要写的字,x坐标,y坐标) + + let packagesFirst = this.info + let address1 = this.info.address.length>16?this.info.address.substring(0,16):this.info.address + let address2 = this.info.address.length>16?this.info.address.substring(16,this.info.address.length-1):'' + let active_name1 = this.info.active_name.length>17?this.info.active_name.substring(0,17):this.info.active_name + let active_name2 = this.info.active_name.length>17?this.info.active_name.substring(17,this.info.active_name.length-1):'' + ctx.fillText("" + active_name1, 40, (h + 50) * 0.5 + 50); + ctx.fillText("" + active_name2, 40, (h + 50) * 0.5 + 70); + ctx.fillText("活动时间:" + this.info.apply_start, 40, (h + 50) * 0.5 + 120); + ctx.fillText("活动地点:" + address1, 40, (h + 50) * 0.5 + 140); + ctx.fillText("" + address2, 40, (h + 50) * 0.5 + 160); + let user_info = uni.getStorageSync("user_info_yunyuhui"); + + let userProfile = uni.getStorageSync('user_profile'); + + var img = this.imgAvatar; + uni.getImageInfo({ + src: userProfile.avatarUrl, // 头像 + success: rlogo => { + img = rlogo.path; + + } + }); + // that.circleImg(ctx, + // img, + // 40, h - 50 - w * 0.15, + // w * 0.15 / 2); + + ctx.font = "12rpx normal"; + // 设置颜色 + ctx.fillStyle = "#000"; + // 绘制文字(参数:要写的字,x坐标,y坐标) + // if (!weixin.isNull(user_info.name)) + // ctx.fillText(user_info.name, + // 40, h - 40); + // else + // ctx.fillText("", + // 40, h - 40); + + + this.circleImg(ctx, res.path, w - 40 - w * 0.2, h - 40 - + w * + 0.2, w * 0.2 / 2); + + }else{ + this.isType3 = true + var ctx = uni.createCanvasContext('firstCanvas') + var w = SCREEN_WIDTH * 0.9; + var h = this. shareHeight* this.scare; + ctx.drawImage('../../static/bg_haibao1.png', 0, 0, + w, h*.89+10); + console.log("this.poster",this.poster) + ctx.drawImage(this.poster, 11, 11, + w-22, (h+5) * 0.3); + ctx.font = "16rpx bold"; + // 设置颜色 + ctx.fillStyle = "#000"; + // 绘制文字(参数:要写的字,x坐标,y坐标) + let active_title = this.info.template == '新' ? '课程' : '活动' + ctx.font = "14rpx bold"; + // 设置颜色 + ctx.fillStyle = "#333"; + + // 绘制文字(参数:要写的字,x坐标,y坐标) + + let packagesFirst = this.info + + let lecturer = this.info.lecturer?this.info.lecturer:'' + // let lecturer = '王一档' + ctx.fillText(this.info.start_date + ' ' + + this.info.start_time, w*0.1+15, (h - 50) * 0.5+10); + + let address = this.info.address.length > 17? this.info + .address.substring(0, 17) : this.info.address + let address1 = this.info.address.length > 17 ? this.info + .address.substring(17,this.info.address.length) : '' + + ctx.fillText(address, w*0.1+15, (h - 50) * 0.6 + 20); + ctx.fillText(address1, w*0.1+15, (h - 50) * 0.6 + 40); + ctx.fillText(lecturer, w*0.1+15, (h - 50) * 0.6 + 100); + this.circleImg(ctx, res.path, w - 20 - w * 0.2, h - 10 -w *0.4, w * 0.2 / 2); + + } - // 绘制文字(参数:要写的字,x坐标,y坐标) - - let packagesFirst = this.info - let active_time = this.info.template == '新' ? '时间:' : - '时间:' - let active_add = this.info.template == '新' ? '地点:' : - '地点:' - let active_name = this.info.active_name.length > 17 ? this - .info.active_name.substring(0, 17) : this.info - .active_name - let active_name1 = this.info.active_name.length > 17 ? this - .info.active_name.substring(17, this.info.active_name - .length) : '' - let lecturer = this.info.lecturer?this.info.lecturer:'' - - ctx.fillText(this.info.start_date + ' ' + - this.info.start_time, w*0.1+15, (h - 50) * 0.6); - let address = this.info.address.length > 17? this.info - .address.substring(0, 17) : this.info.address - let address1 = this.info.address.length > 17 ? this.info - .address.substring(17,this.info.address.length) : '' - - ctx.fillText(address, w*0.1+15, (h - 50) * 0.6 + 60); - ctx.fillText(address1, w*0.1+15, (h - 50) * 0.6 + 80); - ctx.fillText(lecturer, w*0.1+15, (h - 50) * 0.6 + 140); - this.circleImg(ctx, res.path, w - 20 - w * 0.2, h - 10 -w *0.3, w * 0.2 / 2); - ctx.draw(), // r: 半径 setTimeout(() => { @@ -1139,6 +1208,13 @@ min-height: 150px !important; margin: 20px auto; height:auto!important + } + .yuezi{ + width:90%;margin-left:5%;position: absolute; + } + .other{ + width:90%;margin-left:5%;position: absolute; + height:540px!important } - \ No newline at end of file diff --git a/uni_modules/uv-scroll-list/package.json b/uni_modules/uv-scroll-list/package.json new file mode 100644 index 0000000..6e79eec --- /dev/null +++ b/uni_modules/uv-scroll-list/package.json @@ -0,0 +1,87 @@ +{ + "id": "uv-scroll-list", + "displayName": "uv-scroll-list 横向滚动列表 全面兼容vue3+2、app、h5、小程序等多端", + "version": "1.0.3", + "description": "该组件一般用于同时展示多个商品、分类的场景,也可以完成左右滑动的列表,往往数量不确定,数量较多支持左右滚动。灵活配置,开箱即用。", + "keywords": [ + "uv-scroll-list", + "uvui", + "uv-ui", + "横向滚动列表", + "scroll-view" + ], + "repository": "", + "engines": { + "HBuilderX": "^3.1.0" + }, + "dcloudext": { + "type": "component-vue", + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "无", + "data": "无", + "permissions": "无" + }, + "npmurl": "" + }, + "uni_modules": { + "dependencies": [ + "uv-ui-tools" + ], + "encrypt": [], + "platforms": { + "cloud": { + "tcb": "y", + "aliyun": "y" + }, + "client": { + "Vue": { + "vue2": "y", + "vue3": "y" + }, + "App": { + "app-vue": "y", + "app-nvue": "y" + }, + "H5-mobile": { + "Safari": "y", + "Android Browser": "y", + "微信浏览器(Android)": "y", + "QQ浏览器(Android)": "y" + }, + "H5-pc": { + "Chrome": "y", + "IE": "y", + "Edge": "y", + "Firefox": "y", + "Safari": "y" + }, + "小程序": { + "微信": "y", + "阿里": "y", + "百度": "y", + "字节跳动": "y", + "QQ": "y", + "钉钉": "u", + "快手": "u", + "飞书": "u", + "京东": "u" + }, + "快应用": { + "华为": "u", + "联盟": "u" + } + } + } + } +} \ No newline at end of file diff --git a/uni_modules/uv-scroll-list/readme.md b/uni_modules/uv-scroll-list/readme.md new file mode 100644 index 0000000..b0cdd4c --- /dev/null +++ b/uni_modules/uv-scroll-list/readme.md @@ -0,0 +1,19 @@ +## ScrollList 横向滚动列表 + +> **组件名:uv-scroll-list** + +该组件一般用于同时展示多个商品、分类的场景,也可以完成左右滑动的列表,往往数量不确定,数量较多支持左右滚动。灵活配置,开箱即用。 + +# 查看文档 + +## [下载完整示例项目](https://ext.dcloud.net.cn/plugin?name=uv-ui) (请不要 下载插件ZIP) + +### [更多插件,请关注uv-ui组件库](https://ext.dcloud.net.cn/plugin?name=uv-ui) + + + +![image](https://mp-a667b617-c5f1-4a2d-9a54-683a67cff588.cdn.bspapp.com/uv-ui/banner.png) + + + +#### 如使用过程中有任何问题反馈,或者您对uv-ui有一些好的建议,欢迎加入uv-ui官方交流群:官方QQ群 \ No newline at end of file