diff --git a/common/js/api.js b/common/js/api.js index e066182..00b6173 100644 --- a/common/js/api.js +++ b/common/js/api.js @@ -93,7 +93,7 @@ export default { return uni.api.get("/order/findWiningUser", data); }, indexlist(data) { //商品列表(今日上新/热榜/咖啡饮品) - return uni.api.get("/distirict/productCate", data); + return uni.api.get("/distirict/productCate", data,false); }, productproductInfo(data) { //商品详情 return uni.api.get("/product/productInfo", data); @@ -101,4 +101,7 @@ export default { distirictcomShopList(data) { //通用门店列表 return uni.api.get("/distirict/comShopList", data); }, + loginOut(data) { //退出登录 + return uni.api.post("/loginOut", data); + }, } \ No newline at end of file diff --git a/pages/index/hotlist.vue b/pages/index/hotlist.vue index 680fd8d..0e1b8d1 100644 --- a/pages/index/hotlist.vue +++ b/pages/index/hotlist.vue @@ -12,7 +12,7 @@ + v-for="(item,index) in listbox" :key="index" @click="towcontentclick(item,index)"> {{item.name}} @@ -22,7 +22,7 @@ + v-for="(item,index) in xitembtitem" :key="index" @click="clickxitembtitemindex(item,index)"> {{item.name}} @@ -37,12 +37,38 @@ - 热销TOP.{{index + 1}}热销热销热销热销热销热销热销热销热销热销热销热销热销已抢{{item.realSalesNumber}}份 + 热销TOP.{{index + 1}}热销热销热销热销热销热销热销热销热销热销热销热销热销已抢{{item.realSalesNumber}}份 + - {{item.productName}} + + + + {{item.productName}} + + {{item.distances}}km + + + + 券后 + ¥{{item.salePrice}} + + + {{item.discount || ''}}折 + + + ¥{{item.originPrice}} + + + + + 已抢{{item.realSalesNumber}}份 + + 马上抢 + @@ -85,22 +111,17 @@ } ], xitembtitemindex: 0, + xitembtitem: [{ - name: '2小时销量飙升榜' + name: '2小时销量飙升榜', + dateType: 1 }, { - name: '今日热榜' + name: '今日热榜', + dateType: 0 } ], - form: { - address: '', //地址 - type: '', //品类 - orderBy: '', //1.理我最近 2.销量优先 3.价格优先 - distance: '', //附近1KM 1选中 0不选中 - page: 1, //页数 - size: 10, //页容量 - status: 'loadmore' - }, + form: {}, }; }, onPageScroll(e) { @@ -117,11 +138,14 @@ }, onLoad() { this.distiricttopCommon() - this.onLoadlist() + setTimeout(() => { this.GetTop() }, 1000) }, + onShow() { + this.init_fn() + }, computed: { HeighT() { //手机类型的尺寸 return this.$store.getters.is_BarHeight @@ -129,11 +153,40 @@ }, methods: { //飙升榜 - clickxitembtitemindex(index) { + clickxitembtitemindex(item, index) { this.xitembtitemindex = index + this.list = [] + this.form.dateType = item.dateType + this.form.page = 1 + this.form.size = 10 + this.form.status = 'loadmore' + this.onLoadlist() }, - towcontentclick(index) { + towcontentclick(item, index) { this.towcontentclickindex = index + this.list = [] + this.form.type = item.description + this.form.page = 1 + this.form.size = 10 + this.form.status = 'loadmore' + this.onLoadlist() + }, + // 下面初始数据 + 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: '', //品类 + orderBy: 4, //0.今日上新 1.离我最近 2.销量优先 3.价格优先 4.热榜推荐 + other: '', //附近1KM 1选中 0不选中 + page: 1, //页数 + size: 10, //页容量 + dateType: 1, + status: 'loadmore' + } + this.onLoadlist() }, //G滚动底部 loadMore(e) { @@ -170,7 +223,7 @@ async distiricttopCommon() { let res = await this.api.distiricttopCommon({ type: '', //团购卷品类Id/subShop-预约到店 - orderBy: 2 + orderBy: 4 }) console.log(res.data) if (res.code == 0) { @@ -183,43 +236,9 @@ }, async onLoadlist() { try { - this.form = { - address: uni.cache.get('getLocationstorage').address, //地址 - lng: uni.cache.get('getLocationstorage').lng, - lat: uni.cache.get('getLocationstorage').lat, - type: '', //团购卷品类Id - distanceInKm: '', //默认10 以经纬度为中心 多大范围以内 单位km - orderBy: 2, //0.今日上新 1.离我最近 2.销量优先/热榜推荐 3.价格优先 - page: 1, //页数 - size: 10, //页容量 - status: 'loadmore', - - } 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 - } - }) - console.log(res.data.list) if (res.data.pages < this.form.page) { this.form.status = 'nomore' - // if (res.data.pageNum == 1) { - // this.is_end = true - // } return false; } else { this.form.status = 'loading'; @@ -394,8 +413,8 @@ .fivecontent_item_boxitem { image { - width: 192rpx; - height: 192rpx; + width: 208rpx; + height: 208rpx; border-radius: 12rpx; } @@ -403,35 +422,137 @@ margin-left: 24rpx; flex: 1; justify-content: flex-start; - height: 192rpx; + position: relative; .fivecontent_item_boxitemleftone { width: 100%; - .fivecontent_item_boxitemleftone_t{ - .fivecontent_item_boxitemleftone_o{ - margin-right:10rpx ; + + .fivecontent_item_boxitemleftone_t { + .fivecontent_item_boxitemleftone_o { + margin-right: 10rpx; display: inline-block; font-family: Roboto, Roboto; font-weight: 500; font-size: 16rpx; color: #FFFFFF; - padding: 2rpx 6rpx ; + padding: 2rpx 6rpx; text-align: center; - background: linear-gradient( 116deg, #FF9D2B 0%, #FF4805 100%); + background: linear-gradient(116deg, #FF9D2B 0%, #FF4805 100%); border-radius: 4rpx 4rpx 4rpx 4rpx; } - font-family: Source Han Sans CN, Source Han Sans CN; + + font-family: Source Han Sans CN, + Source Han Sans CN; font-weight: 400; font-size: 28rpx; color: #333333; - overflow:hidden; + overflow:hidden; text-overflow:ellipsis; - display:-webkit-box; + display:-webkit-box; -webkit-box-orient:vertical; - -webkit-line-clamp:2; + -webkit-line-clamp:2; } } - .fivecontent_item_boxitemlefttow{ - + + .fivecontent_item_boxitemlefttow { + width: 100%; + margin-top: 14rpx; + + .fivecontent_item_boxitemlefttow_o { + image { + width: 24rpx; + height: 24rpx; + } + + view { + margin-left: 10rpx; + font-family: Source Han Sans CN, Source Han Sans CN; + font-weight: 400; + font-size: 24rpx; + color: #999999; + } + } + + .fivecontent_item_boxitemlefttow_t { + font-family: Source Han Sans CN, Source Han Sans CN; + font-weight: 400; + font-size: 24rpx; + color: #999999; + } + } + + .fivecontent_item_boxitemlefthere { + 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; + 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; + } + } + + .fivecontent_item_boxitemlefour { + margin-top: 12rpx; + background: #FFEEE9; + border-radius: 4rpx 4rpx 4rpx 4rpx; + padding: 4rpx 12rpx; + + image { + width: 10.82rpx; + height: 14.06rpx; + } + + text { + font-family: Source Han Sans CN, Source Han Sans CN; + font-weight: 500; + font-size: 16rpx; + color: #FF5053; + } + } + .fivecontent_item_boxitemlefive{ + position: absolute; + padding: 8rpx 12rpx; + background: #FEE06A; + bottom: 32rpx; + right: 0; + border-radius: 24rpx 24rpx 24rpx 24rpx; + font-family: Source Han Sans CN, Source Han Sans CN; + font-weight: bold; + font-size: 24rpx; + color: #333333; } } } diff --git a/pages/index/index.vue b/pages/index/index.vue index 1014ed1..6e528c4 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -109,14 +109,16 @@ 马上抢 - - ¥ - {{item.salePrice}} + + 到手 + ¥{{item.salePrice}} - - ¥{{item.discount}} + + {{item.discount || ''}}折 + + + ¥{{item.originPrice}} - 共省{{item.save}}元 @@ -394,7 +396,7 @@ init_fn() { this.homelist = [] this.form = { - address:uni.cache.get('getLocationstorage').address, //地址 + address: uni.cache.get('getLocationstorage').address, //地址 lng: uni.cache.get('getLocationstorage').lng, lat: uni.cache.get('getLocationstorage').lat, type: '', //品类 @@ -429,9 +431,6 @@ }) if (res.data.pages < this.form.page) { this.form.status = 'nomore' - // if (res.data.pageNum == 1) { - // this.is_end = true - // } return false; } else { this.form.status = 'loading'; @@ -843,7 +842,6 @@ 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%; @@ -858,42 +856,59 @@ } .indexboxitemlefttheretext { - .indexboxitemlefttheretextone { - text { - font-family: SourceHanSansCN-Bold, SourceHanSansCN-Bold; - font-weight: normal; - color: #FF5053; + // 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; } - text:nth-child(2) { - font-weight: bold; - font-size: 34rpx; - } - - text:nth-child(1) { + .flex_starttow { + font-family: Source Han Sans CN, Source Han Sans CN; + font-weight: 500; font-size: 24rpx; + color: #FF7127; } } - .indexboxitemlefttheretexttow { - margin-left: 12rpx; - font-size: 20rpx; - font-family: SourceHanSansCN-Regular, SourceHanSansCN-Regular; - font-weight: normal; + .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-through; + 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 { diff --git a/pages/index/jtoday.vue b/pages/index/jtoday.vue index 221840f..7376d49 100644 --- a/pages/index/jtoday.vue +++ b/pages/index/jtoday.vue @@ -7,7 +7,7 @@ - + 订阅提醒 @@ -59,26 +59,28 @@ 马上抢 - - ¥ - {{item.salePrice}} + + 到手 + ¥{{item.salePrice}} - - ¥{{item.discount}} + + {{item.discount || ''}}折 + + + ¥{{item.originPrice}} - 共省{{item.save}}元 - - + + - + @@ -406,10 +408,9 @@ 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; @@ -419,46 +420,63 @@ font-size: 24rpx; color: #FFFFFF; } - + .indexboxitemlefttheretext { - .indexboxitemlefttheretextone { - text { - font-family: SourceHanSansCN-Bold, SourceHanSansCN-Bold; - font-weight: normal; - color: #FF5053; + // 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; } - - text:nth-child(2) { - font-weight: bold; - font-size: 34rpx; - } - - text:nth-child(1) { + + .flex_starttow { + font-family: Source Han Sans CN, Source Han Sans CN; + font-weight: 500; font-size: 24rpx; + color: #FF7127; } } - - .indexboxitemlefttheretexttow { - margin-left: 12rpx; - font-size: 20rpx; - font-family: SourceHanSansCN-Regular, SourceHanSansCN-Regular; - font-weight: normal; + + .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-through; + 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; diff --git a/pages/product/index.vue b/pages/product/index.vue index 7904bba..5416fcc 100644 --- a/pages/product/index.vue +++ b/pages/product/index.vue @@ -258,7 +258,7 @@ 价格说明 - + @@ -302,7 +302,7 @@ return { titlename: '详情', opacity: false, - showpopup: true, + showpopup: false, indexform: {}, listdata: { diff --git a/pages/user/user.vue b/pages/user/user.vue index 7ad8206..a0d85ef 100644 --- a/pages/user/user.vue +++ b/pages/user/user.vue @@ -2,11 +2,12 @@