From 09661b8b0be2e60f0d8e9e33bf28b7f6dcef6174 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AD=8F=E5=95=BE?= <1144797966@qq.com> Date: Fri, 10 May 2024 09:40:06 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/listitem.vue | 29 ++- manifest.json | 215 ++++++++-------- pages.json | 2 +- pages/index/components/advertisement.vue | 4 +- pages/index/components/category.vue | 116 +++++++++ pages/index/components/todaylist.vue | 4 +- pages/index/drinks.vue | 315 ++++++++++++++--------- pages/index/hotlist.vue | 6 +- pages/index/index.vue | 29 ++- pages/index/jtoday.vue | 63 ++--- pages/product/generalstore.vue | 4 +- pages/product/index.vue | 170 ++++++++++-- pages/user/user.vue | 47 +++- 13 files changed, 707 insertions(+), 297 deletions(-) create mode 100644 pages/index/components/category.vue diff --git a/components/listitem.vue b/components/listitem.vue index 1476d19..93797f4 100644 --- a/components/listitem.vue +++ b/components/listitem.vue @@ -5,29 +5,29 @@ 精选推荐 - - + + - 库迪咖啡|全场饮品任选券|多店美团可用 + {{item.shopName}}|{{item.productName}} + :src="item.image" mode="aspectFill"> - 2.5km + {{item.distances}}km - 已售192.9万 + 已售{{item.realSalesNumber}} - 券后¥7.22 + 券后¥{{item.salePrice}} - 3.2折 + {{item.discount}}折 @@ -41,9 +41,11 @@ return {}; }, props: { - title: { - type: String, - default: '' + list: { + type: Array, + default () { + return [] + } }, opacity: { type: Boolean, @@ -60,6 +62,11 @@ }, }, methods: { + clickproduct(item) { + uni.pro.navigateTo('product/index', { + id:item.id + }) + }, clicknavigateBack() { uni.navigateBack() } diff --git a/manifest.json b/manifest.json index a66610a..4b6f8c1 100644 --- a/manifest.json +++ b/manifest.json @@ -1,106 +1,111 @@ { - "name" : "cashier_weapp", - "appid" : "__UNI__8092421", - "description" : "", - "versionName" : "1.0.0", - "versionCode" : "100", - "transformPx" : false, - /* 5+App特有相关 */ - "app-plus" : { - "usingComponents" : true, - "nvueStyleCompiler" : "uni-app", - "compilerVersion" : 3, - "splashscreen" : { - "alwaysShowBeforeRender" : true, - "waiting" : true, - "autoclose" : true, - "delay" : 0 - }, - /* 模块配置 */ - "modules" : { - "Barcode" : {} - }, - /* 应用发布信息 */ - "distribute" : { - /* android打包配置 */ - "android" : { - "permissions" : [ - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "" - ] - }, - /* ios打包配置 */ - "ios" : { - "dSYMs" : false - }, - /* SDK配置 */ - "sdkConfigs" : { - "ad" : {} - } - } - }, - /* 快应用特有相关 */ - "quickapp" : {}, - /* 小程序特有相关 */ - "mp-weixin" : { - "appid" : "wxd88fffa983758a30", - "setting" : { - "urlCheck" : false, - "minified" : true, - "es6" : true, - "postcss" : true - }, - "usingComponents" : true, - "libVersion" : "latest", - "requiredPrivateInfos" : [ "getLocation", "onLocationChange", "chooseLocation", "chooseAddress" ] - }, - "h5" : { - "devServer" : { - "https" : false, - "disableHostCheck" : false, - "proxy" : { - "/api" : { - "target" : "https://wxcashiertest.sxczgkj.cn/cashierService", - // "target" : "https://ky.sxczgkj.cn", - "ws" : false, - "changeOrigin" : true, //是否跨域 - "secure" : false, // 设置支持https协议的代理 - "pathRewrite" : { - "^/api" : "" //需要rewrite重写的, - } - } - } - }, - "template" : "template.h5.html", - "router" : { - "mode" : "history", - "base" : "/h5/" - } - }, - "mp-alipay" : { - "usingComponents" : true - }, - "mp-baidu" : { - "usingComponents" : true - }, - "mp-toutiao" : { - "usingComponents" : true - }, - "uniStatistics" : { - "enable" : false - }, - "vueVersion" : "2" -} + "name": "cashier_weapp", + "appid": "__UNI__8092421", + "description": "", + "versionName": "1.0.0", + "versionCode": "100", + "transformPx": false, + /* 5+App特有相关 */ + "app-plus": { + "usingComponents": true, + "nvueStyleCompiler": "uni-app", + "compilerVersion": 3, + "splashscreen": { + "alwaysShowBeforeRender": true, + "waiting": true, + "autoclose": true, + "delay": 0 + }, + /* 模块配置 */ + "modules": { + "Barcode": {} + }, + /* 应用发布信息 */ + "distribute": { + /* android打包配置 */ + "android": { + "permissions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + /* ios打包配置 */ + "ios": { + "dSYMs": false + }, + /* SDK配置 */ + "sdkConfigs": { + "ad": {} + } + } + }, + /* 快应用特有相关 */ + "quickapp": {}, + /* 小程序特有相关 */ + "mp-weixin": { + "appid": "wxd88fffa983758a30", + "setting": { + "urlCheck": false, + "minified": true, + "es6": true, + "postcss": true + }, + "usingComponents": true, + "libVersion": "latest", + "permission": { + "scope.userLocation": { + "desc": "你的位置信息将用于小程序位置接口的效果展示" + } + }, + "requiredPrivateInfos": ["getLocation", "onLocationChange", "chooseLocation", "chooseAddress"] + }, + "h5": { + "devServer": { + "https": false, + "disableHostCheck": false, + "proxy": { + "/api": { + "target": "https://wxcashiertest.sxczgkj.cn/cashierService", + // "target" : "https://ky.sxczgkj.cn", + "ws": false, + "changeOrigin": true, //是否跨域 + "secure": false, // 设置支持https协议的代理 + "pathRewrite": { + "^/api": "" //需要rewrite重写的, + } + } + } + }, + "template": "template.h5.html", + "router": { + "mode": "history", + "base": "/h5/" + } + }, + "mp-alipay": { + "usingComponents": true + }, + "mp-baidu": { + "usingComponents": true + }, + "mp-toutiao": { + "usingComponents": true + }, + "uniStatistics": { + "enable": false + }, + "vueVersion": "2" +} \ No newline at end of file diff --git a/pages.json b/pages.json index 839ec9e..9b27077 100644 --- a/pages.json +++ b/pages.json @@ -202,7 +202,7 @@ } }, { - "path" : "pages/order/order_groupdetail", + "path": "pages/order/order_groupdetail", "style": { "navigationBarTitleText": "订单详情" } diff --git a/pages/index/components/advertisement.vue b/pages/index/components/advertisement.vue index 62b9bcd..b22a0e4 100644 --- a/pages/index/components/advertisement.vue +++ b/pages/index/components/advertisement.vue @@ -73,7 +73,7 @@ }, watch: { timersetnteritem(newVal, oldVal) { - console.log(newVal, oldVal) + // console.log(newVal, oldVal) if (newVal == 1) { clearTimeout(this.timersetInterval); this.timersetInterval = null; @@ -99,7 +99,7 @@ endMove(e) { // this.itemStyless = [] var newList = JSON.parse(JSON.stringify(this.itemStyle)) - console.log(newList) + // console.log(newList) // if ((e.changedTouches[0].pageX - this.slideNote.x) < 0) { // 向左滑动 var last = [newList.pop()] diff --git a/pages/index/components/category.vue b/pages/index/components/category.vue new file mode 100644 index 0000000..2d76607 --- /dev/null +++ b/pages/index/components/category.vue @@ -0,0 +1,116 @@ + + + + + \ No newline at end of file diff --git a/pages/index/components/todaylist.vue b/pages/index/components/todaylist.vue index 321634f..acadce1 100644 --- a/pages/index/components/todaylist.vue +++ b/pages/index/components/todaylist.vue @@ -102,7 +102,9 @@ }, methods:{ clickproduct(item){ - uni.pro.navigateTo('product/index',item) + uni.pro.navigateTo('product/index',{ + id:item.id + }) }, jrtoday(e){ if(e == 0){ diff --git a/pages/index/drinks.vue b/pages/index/drinks.vue index 8a5894b..c988765 100644 --- a/pages/index/drinks.vue +++ b/pages/index/drinks.vue @@ -1,17 +1,17 @@ @@ -125,16 +123,9 @@ customheighttop: '', //top高度 isFixedTop: false, Topdistance: 3000, //吸顶初始距离 - listbox: [{ - name: '全部' - }, - { - name: '美食正餐' - }, - { - name: '饮品小吃' - } - ], + list: [], + toplist: {}, + listbox: [], form: { address: '', //地址 type: '', //品类 @@ -158,17 +149,92 @@ this.isFixedTop = false } }, - onLoad() { + onLoad(e) { + this.type = e.value + this.distiricttopCommon() setTimeout(() => { this.GetTop() }, 1000) }, + onShow() { + this.init_fn() + }, computed: { HeighT() { //手机类型的尺寸 return this.$store.getters.is_BarHeight }, }, methods: { + clickproduct(item){ + uni.pro.navigateTo('product/index',{ + id:item.id + }) + }, + init_fn() { + this.list = [] + this.form = { + address: uni.cache.get('getLocationstorage').address, //地址 + lng: uni.cache.get('getLocationstorage').lng, + lat: uni.cache.get('getLocationstorage').lat, + type:this.type, //品类 + orderBy:0, //0.今日上新 1.离我最近 2.销量优先 3.价格优先 4.热榜推荐 + other: '', //附近1KM 1选中 0不选中 + page: 1, //页数 + size: 10, //页容量 + dateType: 1, + status: 'loadmore' + } + this.onLoadlist() + }, + async distiricttopCommon(e) { + let res = await this.api.distiricttopCommon({ + type: this.type, //团购卷品类Id/subShop-预约到店 + orderBy: '' + }) + if (res.code == 0) { + this.toplist = res.data.carousel[0] + this.listbox = res.data.menu + } + }, + async onLoadlist() { + try { + let res = await this.api.indexlist(this.form) + var dates = new Date().getTime(); + res.data.list.forEach((item, index) => { + var leftTime = item.endTime - dates; //计算两日期之间相差的毫秒数 + if (leftTime >= 0) { + let d = Math.floor(leftTime / 1000 / 60 / 60 / 24); + let h = Math.floor(leftTime / 1000 / 60 / 60 % 24); + let m = Math.floor(leftTime / 1000 / 60 % 60); + let s = Math.floor(leftTime / 1000 % 60); + item.end_times = { + d: d, + h: h, + m: m, + s: s + } + } else { + item.end_times = 0 + } + }) + if (res.data.pages < this.form.page) { + this.form.status = 'nomore' + return false; + } else { + this.form.status = 'loading'; + this.form.page = ++this.form.page; + setTimeout(() => { + this.list = [...this.list, ...res.data.list]; + this.form.status = 'loading'; + if (res.data.pageNum == res.data.pages) { + this.form.status = 'nomore'; + } else { + this.form.status = 'loading'; + } + }, 500) + } + } catch (e) {} + }, //G滚动底部 loadMore(e) { console.log(e) @@ -218,15 +284,17 @@ width: 100%; height: 492rpx; position: relative; + .onecontentimage { position: absolute; width: 100%; height: 100%; top: 0; } + .after { position: absolute; - bottom:32rpx; + bottom: 32rpx; right: 0; width: 40rpx; height: 40rpx; @@ -234,6 +302,7 @@ text-align: center; background-image: radial-gradient(160rpx at 0px 0px, rgba(0, 0, 0, 0) 40rpx, #fff 40rpx); } + .onecontentabsolute { position: absolute; width: 100%; @@ -475,74 +544,90 @@ } .indexboxitemleftthere { - position: relative; - margin-top: 30rpx; - padding-left: 16rpx; - width: 100%; - height: 88rpx; - background: url(https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/qinggou.png) no-repeat; - background-size: 100% 100%; - - .indexboxitemleftthereabsolute { - position: absolute; - top: 14rpx; - right: 12rpx; - font-family: Source Han Sans CN, Source Han Sans CN; - font-weight: bold; - font-size: 24rpx; - color: #FFFFFF; - } - - .indexboxitemlefttheretext { - .indexboxitemlefttheretextone { - text { - font-family: SourceHanSansCN-Bold, SourceHanSansCN-Bold; - font-weight: normal; - color: #FF5053; - } - - text:nth-child(2) { - font-weight: bold; - font-size: 34rpx; - } - - text:nth-child(1) { - font-size: 24rpx; - } - } - - .indexboxitemlefttheretexttow { - margin-left: 12rpx; - font-size: 20rpx; - font-family: SourceHanSansCN-Regular, SourceHanSansCN-Regular; - font-weight: normal; - color: #999999; - text-decoration: line-through; - } - } - - .indexboxitemleftthere_countdown { - width: 100%; - padding-right: 7rpx; - - .indexboxitemleftthere_countdowntext { + position: relative; + margin-top: 30rpx; + padding-left: 16rpx; + width: 100%; + background: url(https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/qinggou.png) no-repeat; + background-size: 100% 100%; + + .indexboxitemleftthereabsolute { + position: absolute; + top: 14rpx; + right: 12rpx; + font-family: Source Han Sans CN, Source Han Sans CN; + font-weight: bold; + font-size: 24rpx; + color: #FFFFFF; + } + + .indexboxitemlefttheretext { + // width: 100%; + margin-top: 12rpx; + align-items: flex-end; + + .fivecontent_item_boxitemlefthere_one { + align-items: flex-end; + + .flex_startone { font-family: Source Han Sans CN, Source Han Sans CN; - font-weight: 400; - font-size: 24rpx; - color: #999999; - } - - .indexboxitemleftthere_countdowntexts { - font-family: Roboto, Roboto; - font-weight: 400; - color: #333333; - font-family: Source Han Sans CN, Source Han Sans CN; - font-weight: bold; + font-weight: 500; font-size: 16rpx; - color: #FFFFFF; + color: #FF7127; } + + .flex_starttow { + font-family: Source Han Sans CN, Source Han Sans CN; + font-weight: 500; + font-size: 24rpx; + color: #FF7127; + } + } + + .fivecontent_item_boxitemlefthere_tow { + margin-left: 4rpx; + padding: 2rpx 10rpx; + border-radius: 4rpx 4rpx 4rpx 4rpx; + border: 2rpx solid #FF7127; + font-family: Source Han Sans CN, Source Han Sans CN; + font-weight: 500; + font-size: 16rpx; + color: #FF7127; + } + + .fivecontent_item_boxitemlefthere_there { + margin-left: 6rpx; + font-family: Source Han Sans CN, Source Han Sans CN; + font-weight: 400; + font-size: 16rpx; + color: #999999; + text-decoration-line: line-through; } } + + .indexboxitemleftthere_countdown { + width: 100%; + padding-right: 7rpx; + margin-top: 2rpx; + .indexboxitemleftthere_countdowntext { + font-family: Source Han Sans CN, Source Han Sans CN; + font-weight: 400; + font-size: 24rpx; + color: #999999; + padding-bottom: 8rpx; + } + + .indexboxitemleftthere_countdowntexts { + font-family: Roboto, Roboto; + font-weight: 400; + color: #333333; + font-family: Source Han Sans CN, Source Han Sans CN; + font-weight: bold; + font-size: 16rpx; + color: #FFFFFF; + } + } + } } } } diff --git a/pages/index/hotlist.vue b/pages/index/hotlist.vue index 0e1b8d1..124f88a 100644 --- a/pages/index/hotlist.vue +++ b/pages/index/hotlist.vue @@ -38,7 +38,7 @@ 热销TOP.{{index + 1}}热销热销热销热销热销热销热销热销热销热销热销热销热销已抢{{item.realSalesNumber}}份 + class="fivecontent_item_boxitemleftone_o">热销TOP.{{index + 1}}{{item.productName}}份 @@ -232,7 +232,9 @@ } }, clickproduct(item) { - uni.pro.navigateTo('product/index', item) + uni.pro.navigateTo('product/index', { + id:item.id + }) }, async onLoadlist() { try { diff --git a/pages/index/index.vue b/pages/index/index.vue index 6e528c4..66b6865 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -294,23 +294,23 @@ uni.getLocation({ type: 'wgs84', success: (res) => { - console.log(res, '获取距离') + // console.log(res, '获取距离') // this.lng = res.longitude // this.lat = res.latitude - // this.positionindex() + // // 测试 + let datastorage = { + address: '西安市', //地址 + lng: res.longitude, + lat: res.latitude, + } + uni.cache.set('getLocationstorage', datastorage); }, fail: (err) => { // this.positionindex() console.log(err, '获取错误') } }); - // 测试 - let datastorage = { - address: '西安市', //地址 - lng: '108.949158', - lat: '34.301731', - } - uni.cache.set('getLocationstorage', datastorage); + setTimeout(() => { this.GetTop() }, 1000) @@ -335,7 +335,9 @@ uni.pro.navigateTo('index/uindexlist') }, fivecontentclick(item) { - uni.pro.navigateTo('product/index', item) + uni.pro.navigateTo('product/index',{ + id:item.id + }) }, updateCity(data) { thiss.list[data].end_times = 0; @@ -357,7 +359,6 @@ }) }, changeParentValue(newValue) { - console.log(newValue) this.itemStyle = newValue }, getStyle(e) { @@ -786,7 +787,7 @@ .fivecontent_item_boxitemleft { margin-left: 24rpx; - flex: auto; + flex: 1; .fivecontent_item_boxitemleftone { width: 100%; @@ -799,6 +800,10 @@ } view { + width: 300rpx; + overflow: hidden; + text-overflow: ellipsis; + white-space:nowrap; //溢出不换行white-space:nowrap; //溢出不换行 font-family: Source Han Sans CN, Source Han Sans CN; font-weight: 500; font-size: 28rpx; diff --git a/pages/index/jtoday.vue b/pages/index/jtoday.vue index 7376d49..289dc2e 100644 --- a/pages/index/jtoday.vue +++ b/pages/index/jtoday.vue @@ -73,14 +73,14 @@ 共省{{item.save}}元 - - + + - + @@ -108,9 +108,9 @@ list: [], toplist: {}, form: { - address: '西安市', //地址 - lng: '108.949158', - lat: '34.301731', + address: uni.cache.get('getLocationstorage').address, //地址 + lng: uni.cache.get('getLocationstorage').lng, + lat: uni.cache.get('getLocationstorage').lat, type: '', //品类 orderBy: 0, //1.理我最近 2.销量优先 3.价格优先 other: '', //附近1KM 1选中 0不选中 @@ -128,7 +128,7 @@ } }, onLoad(e) { - this.distiricttopCommon() + this.distiricttopCommon() }, onShow() { this.onLoadlist() @@ -144,15 +144,17 @@ this.toplist = res.data.carousel[0] } }, - clickproduct(item){ - uni.pro.navigateTo('product/index',item) + clickproduct(item) { + uni.pro.navigateTo('product/index',{ + id:item.id + }) }, async onLoadlist() { try { this.form = { - address: '西安市', //地址 - lng: '108.949158', - lat: '34.301731', + address: uni.cache.get('getLocationstorage').address, //地址 + lng: uni.cache.get('getLocationstorage').lng, + lat: uni.cache.get('getLocationstorage').lat, type: '', //团购卷品类Id distanceInKm: '', //默认10 以经纬度为中心 多大范围以内 单位km orderBy: 0, //0.今日上新 1.离我最近 2.销量优先/热榜推荐 3.价格优先 @@ -365,8 +367,8 @@ color: #333333; } } - - + + .flexstartboxfttow { .fivecontent_item_boxitemlefttow { margin-left: 16rpx; @@ -375,7 +377,7 @@ padding: 4rpx 10rpx; background: #FFF9E1; border-radius: 4rpx 4rpx 4rpx 4rpx; - + .fivecontent_item_boxitemlefttowtext { margin-left: 6rpx; font-family: Source Han Sans CN, Source Han Sans CN; @@ -383,13 +385,13 @@ font-size: 16rpx; color: #F9A511; } - + .fivecontent_item_boxitemlefttowimage { width: 10.82rpx; height: 14.06rpx; } } - + .fivecontent_item_boxitemlefttow:nth-child(1) { margin-left: 0; background: #FFD6D7; @@ -410,7 +412,7 @@ width: 100%; background: url(https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/qinggou.png) no-repeat; background-size: 100% 100%; - + .indexboxitemleftthereabsolute { position: absolute; top: 14rpx; @@ -420,22 +422,22 @@ font-size: 24rpx; color: #FFFFFF; } - + .indexboxitemlefttheretext { // width: 100%; margin-top: 12rpx; align-items: flex-end; - + .fivecontent_item_boxitemlefthere_one { align-items: flex-end; - + .flex_startone { font-family: Source Han Sans CN, Source Han Sans CN; font-weight: 500; font-size: 16rpx; color: #FF7127; } - + .flex_starttow { font-family: Source Han Sans CN, Source Han Sans CN; font-weight: 500; @@ -443,7 +445,7 @@ color: #FF7127; } } - + .fivecontent_item_boxitemlefthere_tow { margin-left: 4rpx; padding: 2rpx 10rpx; @@ -454,7 +456,7 @@ font-size: 16rpx; color: #FF7127; } - + .fivecontent_item_boxitemlefthere_there { margin-left: 6rpx; font-family: Source Han Sans CN, Source Han Sans CN; @@ -464,11 +466,12 @@ text-decoration-line: line-through; } } - + .indexboxitemleftthere_countdown { width: 100%; padding-right: 7rpx; margin-top: 2rpx; + .indexboxitemleftthere_countdowntext { font-family: Source Han Sans CN, Source Han Sans CN; font-weight: 400; @@ -476,7 +479,7 @@ color: #999999; padding-bottom: 8rpx; } - + .indexboxitemleftthere_countdowntexts { font-family: Roboto, Roboto; font-weight: 400; diff --git a/pages/product/generalstore.vue b/pages/product/generalstore.vue index 27ff83c..54b78c9 100644 --- a/pages/product/generalstore.vue +++ b/pages/product/generalstore.vue @@ -60,7 +60,9 @@ } }, clickproduct(item) { - uni.pro.navigateTo('product/index', item) + uni.pro.navigateTo('product/index',{ + id:item.id + }) }, } }; diff --git a/pages/product/index.vue b/pages/product/index.vue index 5416fcc..64cfec1 100644 --- a/pages/product/index.vue +++ b/pages/product/index.vue @@ -88,7 +88,8 @@ {{item1.name}} - + {{item2.name}} @@ -102,7 +103,7 @@ - + @@ -171,6 +172,36 @@ + + + + + + + + + + 首页 + + + + 客服 + + + + + + 立即购买 + + + + + +