From 73341eba8e313c2aead0476026bc362b8c4be4b1 Mon Sep 17 00:00:00 2001 From: xuxueyang <xuxy@fengyuntec.com> Date: 星期四, 12 九月 2024 16:05:06 +0800 Subject: [PATCH] update 优化 --- sub_pages/customer/self/member-center.vue | 118 +++++++++++--- pages/home/home.vue | 90 +++++++++-- pages/user/user-customer.scss | 3 sub_pages/customer/coupon/good-all.vue | 5 plugins/http.js | 2 App.vue | 7 /dev/null | 0 environments/index.js | 4 sub_pages/customer/coupon/coupon.scss | 6 sub_pages/customer/shopping/confirm.vue | 4 components/banner3d/banner3d.vue | 7 pages/order/order.vue | 3 sub_pages/customer/trade/trade.vue | 160 ++++++++++--------- pages/order/order-detail.vue | 9 sub_pages/customer/coupon/good-self.vue | 39 +++- 15 files changed, 302 insertions(+), 155 deletions(-) diff --git a/App.vue b/App.vue index f240031..d1f355d 100644 --- a/App.vue +++ b/App.vue @@ -5,7 +5,10 @@ import storage from '@/plugins/storage.js' export default { - onLaunch: async function(options) { + onLaunch: async function(options) { + //清除一些缓存 + this.$storage.removeItem('cache_home_show_coupon') + var query = options.q && decodeURIComponent(options.q) || '' var querydto = {} if (query) { @@ -97,7 +100,7 @@ } // #endif - + }, onReady() { diff --git a/components/banner3d/banner3d.vue b/components/banner3d/banner3d.vue index 9b9b0d8..926f03f 100644 --- a/components/banner3d/banner3d.vue +++ b/components/banner3d/banner3d.vue @@ -29,17 +29,17 @@ <view class="line-component" v-if="bannerList[i].point"> <view class="line-bg"> <view class="tip" - :style="{'left':(bannerList[i].point.end&&(bannerList[i].point.current/bannerList[i].point.end)||0).toFixed(2)*100+'%'}"> + :style="{'left':(bannerList[i].point.current<=bannerList[i].point.endPoint)?((bannerList[i].point.endPoint&&(bannerList[i].point.current/bannerList[i].point.endPoint)||0).toFixed(2)*100+'%'):'100%'}"> {{bannerList[i].point.current || 0}} </view> <view class="tip-loc" - :style="{'left':(bannerList[i].point.end&&(bannerList[i].point.current/bannerList[i].point.end)||0).toFixed(2)*100+'%'}"> + :style="{'left':(bannerList[i].point.current<=bannerList[i].point.endPoint)?((bannerList[i].point.endPoint&&(bannerList[i].point.current/bannerList[i].point.endPoint)||0).toFixed(2)*100+'%'):'100%'}"> </view> </view> <view class="desc"> <span - v-if="bannerList[i].point.end">{{bannerList[i].point.current || 0}}/{{bannerList[i].point.end}},升级还需{{bannerList[i].point.end-bannerList[i].point.current}}成长值</span> + v-if="bannerList[i].point.endPoint&&(bannerList[i].point.current<=bannerList[i].point.endPoint)">{{bannerList[i].point.current || 0}}/{{bannerList[i].point.endPoint}},升级还需{{bannerList[i].point.endPoint - bannerList[i].point.current}}成长值</span> <span v-else>当前成长值:{{bannerList[i].point.current || 0}}</span> </view> </view> @@ -115,6 +115,7 @@ that.descIndex = e.mp.detail.current clearTimeout(timer) }, 150) + this.$emit('changeIndex',this.curIndex) }, animationfinish(e) { this.isDescAnimating = false diff --git a/environments/index.js b/environments/index.js index c8a5cf9..a6f20e1 100644 --- a/environments/index.js +++ b/environments/index.js @@ -1,7 +1,7 @@ export default { - httpBaseUri: 'https://www.hmyxianhua.com/flower', - // httpBaseUri: 'http://47.99.58.211/flower', + // httpBaseUri: 'https://www.hmyxianhua.com/flower', + httpBaseUri: 'http://47.99.58.211/flower', // httpBaseUri: 'http://localhost:8080/flower', clientId: '', secret: '', diff --git a/pages/home/home.vue b/pages/home/home.vue index 5bd64bd..1695491 100644 --- a/pages/home/home.vue +++ b/pages/home/home.vue @@ -75,7 +75,38 @@ </view> <common-footer flg="0"></common-footer> - <uni-popup ref="coupon_home" type="bottom" border-radius="10px 10px 0 0">底部弹出 Popup 自定义圆角</uni-popup> + <uni-popup ref="coupon_home" type="center" border-radius="10px 10px 0 0"> + <view class="coupon-container" style="width: 690rpx;"> + <view class="coupont-item all"> + <view class="flex container img100"> + <view class="info-price"> + <view class="price1"> + {{dto_home_coupon.maxDiscountAmount?(`${dto_home_coupon.maxDiscountAmount}折`):(`¥${dto_home_coupon.couponDiscountValue}`)}} + </view> + <view class="price2"> + {{dto_home_coupon.minOrderAmount?(`满¥${dto_home_coupon.minOrderAmount}可用`):'无门槛'}} + </view> + </view> + <view class="info flex1"> + <view class="title"> + {{dto_home_coupon.couponName||'-'}} + </view> + <view class="time" v-if="dto_home_coupon.getEndDate"> + <!-- 领取后{{dto_home_coupon.usageTimeNum||''}}{{dto_home_coupon.usageTimeTypeName||''}}有效 --> + {{dto_home_coupon.getEndDate|| '-'}}前有效 + </view> + <view class="button" @click="getCoupon(dto_home_coupon)"> + 立即领取 + </view> + </view> + </view> + + <view class="tip"> + <span class="t-red">*</span>此券每人限领1张。仅限用于花满芜鲜花交易平台鲜切花花款满额使用,不可与其他优惠同享、不可叠加使用 + </view> + </view> + </view> + </uni-popup> </view> @@ -111,10 +142,10 @@ }, onPullDownRefresh() { // 下拉刷新方法 - this.init() + this.init() this.$message.showLoading() this.init_children() - setTimeout(() => { + setTimeout(() => { this.$message.hideLoading() uni.stopPullDownRefresh() }, 2000) @@ -175,7 +206,8 @@ hide_footer: false, noticeList: [], currentNoticeIndex: 0, - currentNotice: {} + currentNotice: {}, + dto_home_coupon: {} }; }, onShareAppMessage() { @@ -211,6 +243,23 @@ this.init() }, methods: { + async getCoupon(item) { + this.$message.showLoading() + const { + code, + data + } = await this.$http.request('post', '/api/v2/coupon/app/receive', { + data: { + couponId: item.id, + num: 1 + } + }) + if (code == 0) { + this.$refs.coupon_home.close() + + this.$message.showToast('领取成功') + } + }, init_children() { this.$refs.home_top_flow && this.$refs.home_top_flow.init && this.$refs.home_top_flow.init() this.$refs.home_category && this.$refs.home_category.init && this.$refs.home_category.init() @@ -357,18 +406,23 @@ } }) - // let tmp = this - // //首页优惠券 - // this.$http.request('get', '/api/v2/coupon/app' + `/home/list`).then(res => { - // if (res.code == 0) { - // var list = res.data || [] - // var dto = list.length >= 1 ? list[0] : undefined - // if (dto) { - // // 显示弹窗图片 - // tmp.$refs.coupon_home.open() - // } - // } - // }) + let tmp = this + var value = this.$storage.getItem('cache_home_show_coupon') + if (!value || true) { + //首页优惠券 + this.$storage.setItem('cache_home_show_coupon', '1') + this.$http.request('get', '/api/v2/coupon/home/alert').then(res => { + if (res.code == 0) { + var list = res.data || [] + var dto = list.length >= 1 ? list[0] : undefined + if (dto) { + // 显示弹窗图片 + this.dto_home_coupon = dto + tmp.$refs.coupon_home.open() + } + } + }) + } }, clickBanner(item) { @@ -427,4 +481,8 @@ <style lang="scss" scoped> @import "./home.scss"; + + /* #ifdef PUB_CUSTOMER */ + @import "@/sub_pages/customer/coupon/coupon.scss"; + /* #endif */ </style> \ No newline at end of file diff --git a/pages/order/order-detail.vue b/pages/order/order-detail.vue index bc12076..6692025 100644 --- a/pages/order/order-detail.vue +++ b/pages/order/order-detail.vue @@ -200,6 +200,7 @@ tmp.$message.hideLoading() if (code === 0) { tmp.getDetail() + tmp.$store.dispatch('getCurrentInfo') } }, fail(e) { @@ -604,9 +605,9 @@ <view class="label">实际支付:</view> <view class="value">¥{{ dto.paymentAmount || '0' }}</view> </view> - - - <!-- <view class="form-item"> + + + <!-- <view class="form-item"> <view class="label">支付金额:</view> <view class="value">{{ dto.paymentAmount || '-' }}</view> </view> @@ -627,7 +628,7 @@ <view class="label">优惠券:</view> <view class="value">{{ dto.memberCouponName || '-' }}</view> </view> --> - <!-- <view class="form-item"> + <!-- <view class="form-item"> <view class="label">优惠金额:</view> <view class="value">{{ dto.memberCouponAmount || '-' }}</view> </view> --> diff --git a/pages/order/order.vue b/pages/order/order.vue index 0859686..35db184 100644 --- a/pages/order/order.vue +++ b/pages/order/order.vue @@ -155,6 +155,8 @@ tmp.$message.hideLoading() if (code === 0) { tmp.refreshList() + //刷新积分 + tmp.$store.dispatch('getCurrentInfo') } }, fail(e) { @@ -284,6 +286,7 @@ if (code === 0) { // this.$store.dispatch('sign_add', 'order') this.refreshList() + } } break diff --git a/pages/user/user-customer.scss b/pages/user/user-customer.scss index d4fc338..cf7811b 100644 --- a/pages/user/user-customer.scss +++ b/pages/user/user-customer.scss @@ -38,7 +38,8 @@ border-radius: 8rpx; // border: 2rpx solid; // border-image: linear-gradient(180deg, rgba(238, 217, 173, 1), rgba(219, 182, 105, 1)) 2 2; - background-image: url('../../static/images/customer/coupon/coupon-bg-user.png'); + // background-image: url('../../static/images/customer/coupon/coupon-bg-user.png'); + background-image: url('https://hmy-flower.oss-cn-shanghai.aliyuncs.com/69/69b8683eb7084e06a9d7645764a92a4ayJwLQzpZIQ5f7c5070054319d93cf972f05d429ad10c.png'); background-size: 100% 100%; .title{ font-weight: 600; diff --git a/plugins/http.js b/plugins/http.js index f393090..083f90c 100644 --- a/plugins/http.js +++ b/plugins/http.js @@ -52,6 +52,7 @@ dataType: options.dataType ? options.dataType : 'json', data: options.data || null, header, + timeout: 30000, success: async (res) => { if (!options.ignore) { message.hideLoading() @@ -219,6 +220,7 @@ if (!options.ignore) { message.hideLoading() } + message.showToast('网络异常') reject({ data: null, code: 9999, diff --git a/static/images/customer/coupon/coupon-bg-user.png b/static/images/customer/coupon/coupon-bg-user.png deleted file mode 100644 index 7abf9f2..0000000 --- a/static/images/customer/coupon/coupon-bg-user.png +++ /dev/null Binary files differ diff --git a/static/images/customer/coupon/good-top-bg.png b/static/images/customer/coupon/good-top-bg.png deleted file mode 100644 index fdfb444..0000000 --- a/static/images/customer/coupon/good-top-bg.png +++ /dev/null Binary files differ diff --git a/sub_pages/customer/coupon/coupon.scss b/sub_pages/customer/coupon/coupon.scss index 56d4346..535cc84 100644 --- a/sub_pages/customer/coupon/coupon.scss +++ b/sub_pages/customer/coupon/coupon.scss @@ -21,7 +21,7 @@ position: absolute; right: -20rpx; top: 20rpx; - background-image: url('../../../static/images/customer/coupon/coupon-has.png'); + background-image: url('@/static/images/customer/coupon/coupon-has.png'); background-size: 100% 100%; width: 264rpx; height: 264rpx; @@ -31,7 +31,7 @@ position: absolute; right: 10rpx; top: -20rpx; - background-image: url('../../../static/images/customer/coupon/coupon-out.png'); + background-image: url('@/static/images/customer/coupon/coupon-out.png'); background-size: 100% 100%; width: 196rpx; height: 124rpx; @@ -54,7 +54,7 @@ .container { z-index: 2; - background-image: url('../../../static/images/customer/coupon/coupon-bg1.png'); + background-image: url('@/static/images/customer/coupon/coupon-bg1.png'); // width: 722rpx; padding: 16rpx 16rpx 16rpx 0rpx; height: 220rpx; diff --git a/sub_pages/customer/coupon/good-all.vue b/sub_pages/customer/coupon/good-all.vue index 9e36900..1fc2515 100644 --- a/sub_pages/customer/coupon/good-all.vue +++ b/sub_pages/customer/coupon/good-all.vue @@ -48,7 +48,8 @@ <view class="good-container p15 flex"> <view v-for="(item,index) of list" :key="index" class="good-item" @click="toDetail(item)"> - <image class="cover" :src="item.cover" :lazy-load="true" mode="scaleToFill"> + <image class="cover" :src="item.cover" :lazy-load="true" mode="scaleToFill" + :class="[dto.stock===0?'component-stock-zero':'']"> </image> <view class="title"> @@ -209,7 +210,7 @@ <style lang="scss" scoped> @import './coupon.scss'; - + .good-list-container { .good-container { .good-item { diff --git a/sub_pages/customer/coupon/good-self.vue b/sub_pages/customer/coupon/good-self.vue index e336979..5461a47 100644 --- a/sub_pages/customer/coupon/good-self.vue +++ b/sub_pages/customer/coupon/good-self.vue @@ -6,11 +6,11 @@ </top-tabs> </view> <no-data v-if="!list||list.length==0" style="width: 100%;"></no-data> - + <view class="p10"> <view v-for="(item,index) of list" :key="index" class="good-item" :class="[query.status]"> - <view class="flex container img100"> + <view class="flex container img100" @click="selectItem(item)"> <view class="info-price"> <image :lazy-load="true" :src="item.cover" class="cover" mode="scaleToFill"></image> </view> @@ -18,20 +18,20 @@ <view class="title flex"> {{item.name||''}} <!-- <radio :checked="isIngood(item)" @click.stop="updateSelectGood(item)" v-if="source==='shopping'" class="select-coupon"></radio> --> - - <view :style="{ 'margin-right': '20rpx'}" @click.stop="updateSelectGood(item)" - class="component-radio m-l-a" :class="[isIngood(item)?'cur':'']" v-if="source==='shopping'"> - + + <view :style="{ 'margin-right': '20rpx'}" class="component-radio m-l-a" + :class="[isIngood(item)?'cur':'']" v-if="source==='shopping'"> + </view> - + </view> <view class="time word-e"> {{item.description||''}} </view> - <view class="button m-l-a m-r-10" @click="getPointGood(item)" v-if="source!=='shopping'"> + <view class="button m-l-a m-r-10" v-if="source!=='shopping'"> 查看详情 </view> - <!-- <view class="button" @click="updateSelectGood(item)" v-if="source=='shopping'"> + <!-- <view class="button" @click="updateSelectGood(item)" v-if="source=='shopping'"> {{isIngood(item)?'移除':'添加'}} </view> --> </view> @@ -110,6 +110,15 @@ }, methods: { + selectItem(item) { + if (this.srouce === 'shopping') { + //选择 + this.updateSelectGood(item) + } else { + //详情 + this.getPointGood(item) + } + }, isIngood(item) { for (var tmp of this.cache_goods) { if (tmp.id == item.id) { @@ -186,8 +195,10 @@ height: unset; padding: 20rpx; margin-top: 0rpx; + .container { background-color: #fff; + .info-price { .cover { width: 150rpx; @@ -198,6 +209,7 @@ .info { margin-left: 20rpx; position: relative; + .title { font-weight: 600; font-size: 36rpx; @@ -206,13 +218,14 @@ text-align: left; position: relative; margin-top: 20rpx; - .select-coupon{ + + .select-coupon { position: absolute; right: 10rpx; top: -6rpx; } } - + .time { font-weight: 400; font-size: 28rpx; @@ -222,8 +235,8 @@ margin-top: 10rpx; word-break: break-all; } - - + + .button { width: 150rpx; diff --git a/sub_pages/customer/self/member-center.vue b/sub_pages/customer/self/member-center.vue index 1697959..3a8a593 100644 --- a/sub_pages/customer/self/member-center.vue +++ b/sub_pages/customer/self/member-center.vue @@ -3,7 +3,8 @@ <image src="../../../static/images/customer/coupon/member/member-level-bg.png" mode="aspectFit" class="img100 member-level-image"></image> <view class="banner"> - <banner3d ref="banner3d" v-if="init" :banner-list="bannerList" :swiper-config="swiperConfig"></banner3d> + <banner3d @changeIndex="changeIndex" ref="banner3d" v-if="init" :banner-list="bannerList" + :swiper-config="swiperConfig"></banner3d> </view> <view class="p20" style="padding-top: 0rpx;"> <!-- <view class="info bg-white p20"> @@ -29,22 +30,42 @@ <image class="m-auto icon img100 " mode="scaleToFill" src="../../../static/images/customer/coupon/member/icon-member-info-1.png"></image> <view class="desc"> - 积分达到{{currentInfo.customerDTO.userGrowthRecord.currentGrowthValue || '-'}} + <!-- 积分达到{{currentInfo.customerDTO.userGrowthRecord.currentGrowthValue || '-'}} --> + 积分达到{{bannerList[curIndex].point.startPoint || '0'}} </view> </view> <view class="m-t-12 flex1"> <image class="m-auto icon img100" mode="scaleToFill" src="../../../static/images/customer/coupon/member/icon-member-info-2.png"></image> + <!-- createName: "孙凯悦" +createTime: "2024-09-10 14:47:29" +discountAmount: null +discountRatio: 95 +discountType: "ratio" +discountTypeStr: "百分比" +downgradeValue: 30 +endPoint: 15000 +growthValue: 1 +id: 34 +name: "金卡会员7" +startPoint: 10000 +updateTime: "2024-09-12 14:09:19" + --> + + <view class="desc"> - 优惠 - <span v-if="currentInfo.customerDTO.userGrowthRecord.currentDiscountType=='ratio'"> - {{(currentInfo.customerDTO.userGrowthRecord.currentDiscountRatio) || '-'}}%/扎 + 优惠 + <span v-if="bannerList[curIndex].point.discountType=='ratio'"> + <!-- currentInfo.customerDTO.userGrowthRecord.currentDiscountType=='ratio' --> + <!-- {{(currentInfo.customerDTO.userGrowthRecord.currentDiscountRatio) || '-'}}%/扎 --> + {{ ((bannerList[curIndex].point.discountRatio)/10).toFixed(1) || '-'}}折/扎 </span> <span v-else> - {{currentInfo.customerDTO.userGrowthRecord.currentDiscountAmount || '-'}}元/扎 + {{bannerList[curIndex].point.discountAmount || '0'}}元/扎 + <!-- {{currentInfo.customerDTO.userGrowthRecord.currentDiscountAmount || '-'}}元/扎 --> </span> - <!-- serGrowthRecord: {currentMemberLevel: "银卡会员", currentGrowthValue: 4941, currentDiscountType: + <!-- serGrowthRecord: {currentMemberLevel: "银卡会员", currentGrowthValue: 4941, currentDiscountType: "ratio",…} currentDiscountAmount: 0 currentDiscountRatio: 5 @@ -74,7 +95,7 @@ </view> </view> <view class="protocol" @click="goto('/pages/help/content?id=会员协议',false)">会员协议 <uni-icons type="right" - size="16" color="#AD790F"></uni-icons> + size="14" color="#AD790F"></uni-icons> </view> </view> </view> @@ -90,10 +111,39 @@ uni.stopPullDownRefresh() }, methods: { - + changeIndex(index) { + console.log('changeIndex', index, this.bannerList) + this.curIndex = index || 0 + this.$forceUpdate() + } }, async onLoad() { await this.$store.dispatch('getCurrentInfo') + const { + code, + data + } = await this.$http.request('get', '/api/member/list') + if (code == 0 && data && data.records) { + console.log('member-data', data) + //循环赋值吧。用name包含来兼容 + for (var tmp of this.bannerList) { + for (var info of data.records) { + if (info.name && info.name.indexOf(tmp.title) >= 0) { + // 设置value + tmp.point = { + ...info, + current: this.currentInfo.customerDTO.userGrowthRecord + .currentGrowthValue || 0 + } + + break + + } + } + } + } + consumptionAmount: 1 + this.$nextTick(() => { if (this.currentInfo.customerDTO && this.currentInfo.customerDTO.userGrowthRecord && this .currentInfo @@ -118,9 +168,9 @@ var j = -1 for (var tmp of this.bannerList) { j += 1 - tmp.point = { - current: this.currentInfo.customerDTO.userGrowthRecord.currentGrowthValue || 0 - } + // tmp.point = { + // current: this.currentInfo.customerDTO.userGrowthRecord.currentGrowthValue || 0 + // } tmp.currentMsg = '' if (tmp.title === name) { //说明是当前等级,其他待定 @@ -141,22 +191,22 @@ } this.bannerList = newBannerSort - if (this.currentInfo.customerDTO.userGrowthRecord.targetMemberInfos) { - var t = -1 - for (var tmp of this.bannerList) { - t += 1 - for (var k of this.currentInfo.customerDTO.userGrowthRecord.targetMemberInfos) { - if (tmp.title === k.targetMemberLevel) { - console.log('eq', k, tmp) - tmp.point = { - current: this.currentInfo.customerDTO.userGrowthRecord - .currentGrowthValue || 0, - end: k.targetStartPoint || 0, - } - } - } - } - } + // if (this.currentInfo.customerDTO.userGrowthRecord.targetMemberInfos) { + // var t = -1 + // for (var tmp of this.bannerList) { + // t += 1 + // for (var k of this.currentInfo.customerDTO.userGrowthRecord.targetMemberInfos) { + // if (tmp.title === k.targetMemberLevel) { + // console.log('eq', k, tmp) + // tmp.point = { + // current: this.currentInfo.customerDTO.userGrowthRecord + // .currentGrowthValue || 0, + // end: k.targetStartPoint || 0, + // } + // } + // } + // } + // } this.init = true // this.$nextTick(() => { @@ -181,6 +231,7 @@ } }) + }, data() { return { @@ -191,7 +242,7 @@ title: '普通会员', // description: '一万年太久,就现在,给你爱', path: '', - point: undefined, + point: {}, key: '1', }, { bg: 'https://hmy-flower.oss-cn-shanghai.aliyuncs.com/25/2534864ad275400b9e8db4042b87bfeaBv7NbzOZG0ptc7fca5df83dcd97fd02b4027518cc593.png', @@ -200,6 +251,8 @@ // description: '花中樱,鱼乃鲷花中樱,鱼乃鲷', path: '', key: '2', + point: {}, + // currentMsg:'' }, { bg: 'https://hmy-flower.oss-cn-shanghai.aliyuncs.com/4d/4d8ab63e75ca462fa9e3bb480ff2da68ID5KnLIH9DwM23f9a04d99cc1f3306a8655c1eff34bf.png', @@ -208,6 +261,8 @@ // description: '取材自湘西苗族传统的烟熏文化', path: '', key: '3', + point: {}, + }, { bg: 'https://hmy-flower.oss-cn-shanghai.aliyuncs.com/db/db6b0cefdbb949cca9c8da824a5ebdebXsPsk2ROfxZu22f9b09e3feece76753b0df971fdc301.png', picture: 'https://hmy-flower.oss-cn-shanghai.aliyuncs.com/c9/c94d8f444af94b899d1e1593cebb933eDyZyhyoyDxTRaf60a4d692f097e5d790cdb88fae9d0c.png', @@ -215,6 +270,8 @@ // description: '在自己的小世界里,日日好日,夜夜好清宵', path: '', key: '4', + point: {}, + }], swiperConfig: { indicatorDots: true, @@ -226,7 +283,8 @@ circular: true, previousMargin: '58rpx', nextMargin: '58rpx' - } + }, + curIndex: 0, } }, components: { diff --git a/sub_pages/customer/shopping/confirm.vue b/sub_pages/customer/shopping/confirm.vue index 5b1c334..f195c1d 100644 --- a/sub_pages/customer/shopping/confirm.vue +++ b/sub_pages/customer/shopping/confirm.vue @@ -170,7 +170,7 @@ // if (total >= this.cache_coupon.minOrderAmount) { // return this.cache_coupon.couponDiscountValue || 0 // } - + uni.navigateTo({ url: `/sub_pages/customer/coupon/coupon-self?source=shopping&paymoney=${total}` }) @@ -451,7 +451,7 @@ </view> </view> <view class="form-item flex flex-wrap-normal"> - <view class="label">兑换券</view> + <view class="label" style="min-width: 130rpx;">兑换券</view> <view class="m-l-a m-r-0 flex" style="word-break: break-all;" :class="[!dto.goodsRecordIdList||dto.goodsRecordIdList.length==0?'desc-gray':'']" diff --git a/sub_pages/customer/trade/trade.vue b/sub_pages/customer/trade/trade.vue index ea80d4b..75e41e3 100644 --- a/sub_pages/customer/trade/trade.vue +++ b/sub_pages/customer/trade/trade.vue @@ -1,6 +1,6 @@ <template> - <view class="container-trade" :style="{'min-height':hidefooter?'':'calc(100vh - 20rpx)'}"> - <view class="search-container m-t-12 flex" v-if="!hidefooter"> + <view class="container-trade" :style="{'min-height':hidefooter?'':'calc(100vh - 20rpx)','max-height':hidefooter?'':'calc(100vh - 20rpx)'}"> + <view class="search-container m-t-12 flex" v-if="!hidefooter"> <!-- <view class="flex m-r-20"> <view class="m-r-10" style="line-height: 80rpx;" @click="changeSearchType"> {{type=='category'?'按分类':'按店铺'}} @@ -9,9 +9,10 @@ </view> --> <view class="flex m-r-20"> - <um-dropdown width="200rpx" style="line-height: 80rpx;" @change="fnChange" :defaultIndex="def" rangeKey="label" :optionList="typeList"></um-dropdown> + <um-dropdown width="200rpx" style="line-height: 80rpx;" @change="fnChange" :defaultIndex="def" + rangeKey="label" :optionList="typeList"></um-dropdown> </view> - + <view class="flex1 input"> <!-- <u-input :placeholder="type==='category'?'请输入分类名称':'请输入店铺名称'" v-model="query.name" clearable @confirm="buttonSearchFlow" @clear="()=>{ @@ -21,20 +22,21 @@ <uni-icons color="#20613D" type="search" size="24" @click="buttonSearchFlow"></uni-icons> </template> </u-input> --> - <u-input :placeholder="search_home_placeholder" v-model="search_flow" clearable @confirm="buttonSearchFlow" @clear="()=>{ + <u-input :placeholder="search_home_placeholder" v-model="search_flow" clearable + @confirm="buttonSearchFlow" @clear="()=>{ $nextTick(()=>{buttonSearchFlow()}) }"> <!-- <u--text text="http://" slot="prefix" margin="0 3px 0 0" type="tips"></u--text> --> - - + + <template slot="suffix"> <uni-icons color="#20613D" type="search" size="24" @click="buttonSearchFlow"></uni-icons> </template> </u-input> - + </view> </view> - <view class="canteen-items" :style="{'min-height':hidefooter?'':'calc(100vh - 340rpx)'}"> + <view class="canteen-items" :style="{'min-height':hidefooter?'':'calc(100vh - 340rpx)','max-height':hidefooter?'':'calc(100vh - 340rpx)'}"> <view v-if="(!list||list.length==0)&&true" style="width: 100%;min-height: 200rpx;"> </view> @@ -47,43 +49,36 @@ </view> </view> <view class="canteen-item-container"> - <!-- <view class="component-filter-container" style="padding-top: 12rpx;">--> - <!-- <view class="flex1" @click="openParamPop">--> - <!-- 筛选--> - <!-- </view>--> - <!-- <view class="flex1">--> - <!-- 颜色<image src="../../../static/common/icon-arrow-down.png" class="icon-arrow-down"></image>--> - <!-- </view>--> - <!-- <view class="flex1">--> - <!-- 筛选<image src="../../../static/common/icon-arrow-down.png" class="icon-arrow-down"></image>--> - <!-- </view>--> - <!-- </view>--> - <!-- <u-divider></u-divider>--> - <view class="flex"> - <view v-for="(item,index) of listFilter" :key="item.id" class="canteen-item list" - @click.stop="toDetailList(item)"> - <view class="m-r-10"> - <!-- @click.stop="previewImg(item.imageUrl)" --> - <image :src="item.imageUrl" :class="[!item.stock?'':'']" mode="scaleToFill" - class="cover" :lazy-load="true"> - </image> - </view> + <view v-for="(item,index) of listFilter" :key="item.id" + class="canteen-item list flex flex-wrap-normal" @click.stop="toDetailList(item)"> + <view class="m-r-10"> + <image :src="item.imageUrl" :class="[!item.stock?'':'']" mode="scaleToFill" class="cover" + :lazy-load="true"> + </image> + </view> + <view class="flex1"> <view class="cateen_infos list"> - <view class="title">{{item.name}}</view> - + <view class="title flex"> + {{item.name}} + <view class="desc m-l-a m-r-0">在售 {{item.stock||'0'}} 扎</view> + </view> <view class="price"> - <!-- <view>会员价</view> --> - <view>¥{{item.priceLowMember || 0}}-{{item.priceHighMember||0}}</view> - </view> - <!-- <view class="price component-price-old">¥{{item.priceLow || 0}}-{{item.priceHigh||0}}</view> --> - + <view>¥{{item.priceLowMember || 0}}-{{item.priceHighMember||0}}/扎</view> + </view> + <view class="flex info"> + <view class="m-r-15"> + 库存:{{item.stock || 0}} + </view> + <view> + {{item.unit || ''}} + </view> + </view> - <view class="desc">在售 {{item.stock||'0'}} 扎</view> </view> + </view> + </view> - </view> - <view style="padding-bottom:40rpx"> - </view> + <view style="padding-bottom:40rpx"> </view> <footer-msg v-if="!hidefooter" :more="page.total>0&&page.total>page.current*page.size"></footer-msg> @@ -142,8 +137,7 @@ currentCategory: {}, type: 'category', //supplier def: 0, - typeList:[ - { + typeList: [{ label: '按鲜花', value: 'flower', }, @@ -152,7 +146,7 @@ value: 'supplier', }, ], - search_home_placeholder:"请输入花名", + search_home_placeholder: "请输入花名", } @@ -224,23 +218,23 @@ if (this.type == 'flower') { this.search_home_placeholder = '请输入花名' uni.setNavigationBarTitle({ - title: '搜鲜花', - success: function() { - // console.log('标题搜鲜花修改成功'); - } + title: '搜鲜花', + success: function() { + // console.log('标题搜鲜花修改成功'); + } }); - + } else { this.search_home_placeholder = '请输入店铺名' uni.setNavigationBarTitle({ - title: '搜店铺', - success: function() { - // console.log('标题搜店铺修改成功'); - } + title: '搜店铺', + success: function() { + // console.log('标题搜店铺修改成功'); + } }); } }, - + changeSearchType() { if (this.type == 'category') { this.type = 'supplier' @@ -347,7 +341,7 @@ }, toDetailList(item) { //去商品列表页面 - console.log('toDetailList',this.supplierId) + console.log('toDetailList', this.supplierId) uni.navigateTo({ url: `/sub_pages/customer/trade/list?categoryId=${item.id}&supplierId=${this.supplierId||''}` }) @@ -401,7 +395,7 @@ .container-trade { background-color: #FFFFFF; padding-top: 20rpx; - + // overflow-x: scroll; .search-container { margin: 0rpx 30rpx 20rpx 30rpx; } @@ -455,14 +449,15 @@ // margin-left: 30rpx; .canteen-item { - margin: 0 auto; - width: 164rpx; + // margin: 0 auto; + // width: 164rpx; // width: 690rpx; // max-width: 690rpx; - min-height: 266rpx; + // min-height: 266rpx; background: #FFFFFF; - margin-bottom: 44rpx; - max-width: 164rpx; + // margin-bottom: 44rpx; + // max-width: 164rpx; + margin-bottom: 20rpx; .cover { width: 164rpx; @@ -477,12 +472,13 @@ font-size: 28rpx; color: #000000; line-height: 40rpx; - min-height: 80rpx; + // min-height: 50rpx; text-align: center; + // margin-top: 10rpx; } .desc { - margin-top: 8rpx; + // margin-top: 8rpx; font-weight: 400; font-size: 24rpx; color: #6E9F66; @@ -491,6 +487,7 @@ background-color: rgba(202, 229, 214, 0.57); border-radius: 4rpx; text-align: center; + // margin-top: 12rpx; } @@ -499,9 +496,17 @@ font-size: 28rpx; color: #CF0000; line-height: 34rpx; - text-align: center; + text-align: left; + margin-top: 12rpx; } + .info { + font-weight: 400; + font-size: 28rpx; + margin-top: 12rpx; + color: #666666; + line-height: 40rpx; + } @@ -512,23 +517,24 @@ width: 100%; min-height: 300rpx; max-height: calc(100vh - 270rpx); - overflow-y: scroll; + padding-right: 20rpx; + overflow-x: scroll; } - .canteen-item:nth-child(3n+1) { - margin-left: 0rpx; - margin-right: 15rpx; - } + // .canteen-item:nth-child(3n+1) { + // margin-left: 0rpx; + // margin-right: 15rpx; + // } - .canteen-item:nth-child(3n+2) { - margin-left: 15rpx; - margin-right: 15rpx; - } + // .canteen-item:nth-child(3n+2) { + // margin-left: 15rpx; + // margin-right: 15rpx; + // } - .canteen-item:nth-child(3n+3) { - margin-left: 15rpx; - margin-right: 0rpx; - } + // .canteen-item:nth-child(3n+3) { + // margin-left: 15rpx; + // margin-right: 0rpx; + // } } .canteen-footer-shop { -- Gitblit v1.9.3