App.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
pages/home/home.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
pages/user/supplier-user.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
sub_pages/customer/self/collect.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
sub_pages/customer/shop/shop.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
sub_pages/customer/shopping/shopping.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
sub_pages/customer/trade/detail.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
sub_pages/customer/trade/trade.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
App.vue
@@ -234,12 +234,19 @@ padding-top: 40rpx; padding-bottom: 40rpx; font-size: var(--title_font_size2); color: #20613D; font-weight: 600; } .title-before-blue:before { content: "|"; color: #3140A2; content: "||"; margin-right: 20rpx; color: #20613D; margin-right: 20rpx; min-width: 20rpx; background-color: #20613D; border-radius: 6rpx; } .blue { @@ -1095,6 +1102,7 @@ line-height: 40rpx; margin-top: 20rpx; } .store-name.t1 { color: #666; } @@ -1106,6 +1114,7 @@ line-height: 34rpx; margin-top: 8rpx; } .store-address.t1 { color: #666; } @@ -1120,6 +1129,7 @@ color: #5B8C71; line-height: 52rpx; text-align: center; margin-top: 30rpx; } .store-sc { @@ -1132,6 +1142,7 @@ color: #FFFFFF; line-height: 64rpx; display: flex; margin-top: 20rpx; .icon-view { // margin-top: 8rpx; pages/home/home.vue
@@ -4,14 +4,20 @@ <!-- 顶部,可能 --> <view class="school" :style="{'padding-top':(StatusBar)+'px' ,height:CustomBar+'rpx','line-height':CustomBar+'rpx' }"> <picker @change="PickerChangeSchool" :value="areaIndex" :range="schools" range-key="name"> <!-- <picker @change="PickerChangeSchool" :value="areaIndex" :range="schools" range-key="name"> <view class="picker flex"> <uni-icons type="location" class="m-r-5" size="18"></uni-icons> <view> {{ areaIndex >= 0 && schools[areaIndex].name ? schools[areaIndex].name : '选择位置' }} </view> </view> </picker> </picker> --> <view class="picker flex" @click.stop="goToAddress"> <uni-icons type="location" class="m-r-5" size="18"></uni-icons> <view> {{ address&&address.id?address.address: '选择地址' }} </view> </view> </view> <view class="search-container m-t-12 flex"> <view class="flex1 input"> @@ -71,6 +77,9 @@ </template> <script> import { mapState } from 'vuex' import homePrice from './components/home-price.vue' import homeBannerImgs from './components/home-banner-imgs.vue' import homeZones from './components/home-zones.vue' @@ -78,6 +87,16 @@ import homeCategory from './components/home-category.vue' export default { computed: { ...mapState({ address: state => { return state.defaultaddress || {} }, currentInfo: state => { return state.currentInfo || {} }, }), }, components: { homeCategory, homePrice, @@ -193,8 +212,19 @@ } else { this.areaIndex = areaIndex } //如果已经登录,加载一下默认地址 let that = this setTimeout(()=>{ if(that.currentInfo.id&&!that.address.id){ that.$http.request('get', '/api/address/default/detail').then(res=>{ if(res.data){ that.$store.commit('setDefaultAddress', {...res.data}) } }) } },2000) //公告 this.$http.request('get', '/api/announcement/page', { params: { @@ -239,6 +269,15 @@ }, methods: { goToAddress() { if (!this.currentInfo.id) { this.$message.showToast('请先前往登录') return } uni.navigateTo({ url: '/pages/user/address/address?source=select' }) }, buttonSearchFlow() { console.log('buttonSearchFlow') uni.navigateTo({ pages/user/supplier-user.vue
@@ -130,11 +130,14 @@ </image> <view>新手帮助</view> </view> <view class="service-icons" @click.stop="$meesage.showToast('敬请期待')"> <!-- <view class="service-icons" @click.stop="$meesage.showToast('敬请期待')"> <image src="../../static/images/customer/service/service-icon-6.png" class="t2 service-icon "> </image> <view>运费详查</view> </view> </view> --> <view class="service-icons"></view> <view class="service-icons"></view> <view class="service-icons"></view> </view> sub_pages/customer/self/collect.vue
@@ -1,64 +1,3 @@ <template> <view class="page-collect p20"> <view class="search-container bg-white flex"> <view class="flex1 input"> <u-input placeholder="请输入花名" v-model="query.name"> <template slot="suffix"> <uni-icons color="#20613D" type="search" size="24" @tap="refreshList"></uni-icons> </template> </u-input> </view> </view> <view class="component-filter-container p10 bg-white"> <view class="flex1" @click.stop="order_show=true"> {{ this.query.columnStr || '排序' }} <image src="../../../static/common/icon-arrow-down.png" class="icon-arrow-down"></image> </view> <view class="flex1" @click.stop="level_show=true"> {{ this.query.levelStr || '级别' }} <image src="../../../static/common/icon-arrow-down.png" class="icon-arrow-down"></image> </view> </view> <no-data v-if="!list||list.length===0" style="width: 100%;"></no-data> <u-picker :show="level_show" @confirm="select_level" keyName="label" :columns="level_columns" @cancel="level_show=false"></u-picker> <u-picker :show="order_show" @confirm="select_order" keyName="label" :columns="order_columns" @cancel="order_show=false"></u-picker> <view class="trade-list-container"> <view class="trade-info-container" v-for="(dto,index) of list" :key="index"> <view class="title"> <view class="level m-r-15">{{ dto.levelStr || '-' }}级</view> <view class=""> {{ dto.name || '-' }} </view> </view> <view class="desc m-t-12"> <view class="m-r-15">已售:{{ dto.sales || 0 }}</view> <view class="m-r-15">剩余:{{ dto.stock || 0 }}</view> <view class=" ">{{ dto.unit || '-' }}支/扎</view> </view> <view class="flex m-t-12"> <view class="price m-r-a"> <span class="num">{{ dto.price || '-' }}</span> 元/扎 </view> <view class="m-l-a m-r-15"> <image src="../../../static/common/icon-kf.png" class="icon-kf m-l-15 img100"></image> </view> <view class="m-r-0 gwc" @click="submitShopping(dto)"> + 购物车 </view> </view> </view> </view> </view> </template> <script> export default { async onPullDownRefresh() { @@ -116,6 +55,11 @@ }) }, methods: { toDetail(item) { uni.navigateTo({ url: `/sub_pages/customer/trade/detail?id=${item.id}` }) }, async submitShopping(dto) { //提交到购物车中 this.$message.showLoading() @@ -140,6 +84,73 @@ } </script> <template> <view class="page-collect " style="background: #E1F0E7;"> <view style="padding-bottom: 0rpx;" class="p20"> <view class="search-container flex"> <view class="flex1 input"> <u-input placeholder="请输入花名" v-model="query.name"> <template slot="suffix"> <uni-icons color="#20613D" type="search" size="24" @tap="refreshList"></uni-icons> </template> </u-input> </view> </view> <view class="component-filter-container p10"> <view class="flex1" @click.stop="order_show=true"> {{ this.query.columnStr || '排序' }} <image src="../../../static/common/icon-arrow-down.png" class="icon-arrow-down"></image> </view> <view class="flex1" @click.stop="level_show=true"> {{ this.query.levelStr || '级别' }} <image src="../../../static/common/icon-arrow-down.png" class="icon-arrow-down"></image> </view> </view> </view> <no-data v-if="!list||list.length===0" style="width: 100%;"></no-data> <u-picker :show="level_show" @confirm="select_level" keyName="label" :columns="level_columns" @cancel="level_show=false"></u-picker> <u-picker :show="order_show" @confirm="select_order" keyName="label" :columns="order_columns" @cancel="order_show=false"></u-picker> <view class="trade-list-container"> <view class="trade-info-container flex" v-for="(dto,index) of list" :key="index" @click.stop="toDetail(dto)"> <image class="img img100 br-4 m-r-10" :src="dto.url||dto.cover"></image> <view class="flex1"> <view class="flex"> <view class="title"> <span class="m-r-5" style="display: inline-block;" v-if="item.categoryStr">{{item.categoryStr||''}}</span> <span v-if="item.levelStr" class="m-r-5" style="display: inline-block;">{{ item.levelStr || '' }}</span> {{ dto.name || '-' }} </view> <view class="price m-l-a m-r-0"> ¥{{ dto.price || '-' }}/扎 </view> </view> <view class="flex"> <view class="desc m-t-12 flex"> <view class="m-r-15">剩余:{{ dto.stock || 0 }}</view> <view class="m-r-15">颜色:{{ dto.color || '-' }}</view> </view> <view class="button-icons flex m-l-a m-r-0 m-t-20"> <view class="m-r-0 gwc" @click.stop="submitShopping(dto)"> + 购物车 </view> </view> </view> </view> </view> </view> </view> </template> <style lang="scss" scoped> .page-collect { .search-container { @@ -162,5 +173,71 @@ line-height: 70rpx !important; } } .trade-info-container { background-color: #fff; border-top-right-radius: 40rpx; border-top-left-radius: 40rpx; padding: 30rpx; overflow: hidden; min-height: calc(100vh - 300rpx); overflow-y: scroll; .img { width: 124rpx; height: 124rpx; } .title { font-weight: 600; font-size: 28rpx; color: #000000; line-height: 40rpx; .level { color: #20613D; } } .price { font-weight: 400; font-size: 28rpx; color: #CF0000; line-height: 40rpx; } .desc { font-weight: 400; font-size: 24rpx; color: #666666; line-height: 34rpx; } .button-icons { //position: absolute; //z-index: 10; line-height: 40rpx; .curnums { margin-left: 10rpx; margin-right: 10rpx; } } .gwc { width: 168rpx; height: 48rpx; border-radius: 30rpx; border: 2rpx solid #20613D; font-size: 24rpx; color: #20613D; line-height: 48rpx; text-align: center; } } } </style> sub_pages/customer/shop/shop.vue
@@ -83,36 +83,40 @@ @click.stop="toDetail(item)"> <view class="img"> <image class="img img100" src="https://hmy-flower.oss-cn-shanghai.aliyuncs.com/ff/fff3027bd0a146478fd1f0aae816a028%E5%BE%AE%E4%BF%A1%E6%88%AA%E5%9B%BE_20240710224139.png"> :src="item.cover" lazy-load> </image> <view class="level"> A级 {{item.levelStr||''}} </view> </view> <view class="m-l-12 info-container flex1"> <view class="title"> 橙色芭比 {{item.name}} <view class="price"> ¥6.60/扎 ¥{{item.price}}/扎 </view> </view> <view class="shop-name"> 牛油果泡泡·白色 {{item.categoryStr}} </view> <view class="other-info flex"> <view class="m-r-15"> 已售:7 已售:{{item.sales || 0}} </view> <view class="m-r-15"> 剩余:13 剩余:{{item.stock || 0}} </view> <view class="m-r-15"> 1支/扎 {{item.unit}} </view> </view> <view class="bottom-buttons flex"> <view class="m-l-0 m-r-a"> <view class="m-r-15"> 颜色:{{item.color||'-'}} </view> </view> <view class="icons flex"> <uni-icons v-if="item.shopnum&&item.shopnum>=1" type="minus" size="32" @click.stop="addnum(item,-1)"></uni-icons> @@ -127,7 +131,10 @@ </view> <view v-if="flg==='1'" class="brand-info-1"> <trade :hidefooter="true"></trade> <trade :hidefooter="true" :catgoryTree="catgoryTree" v-if="catgoryTree" ref="trade"></trade> <!-- // 构建一个分类树 --> <!-- catgoryTree --> </view> <view v-if="flg==='2'" class="brand-info-3"> <view class="title"> @@ -182,18 +189,29 @@ }, ], dto: {}, list: [{}, {}], list: [], id: '', catgoryTree:undefined, } }, onLoad(options) { this.id = options.id || '' // this.page.size = if (this.id) { this.getDetail() } this.listApi = `/api/customer/flower/list` this.query.supplierId = this.id this.getList('post') }, onReachBottom(){ if(this.flg==='0'){ this.getMore('post') } }, methods: { async getDetail() { { this.$message.showLoading() const { code, @@ -208,6 +226,26 @@ } this.$message.hideLoading() } //获取商家下的商品列表 // { // this.$message.showLoading() // const { // code, // data // } = await this.$http.request('post', `/api/customer/flower/list`, { // data: { // supplierId: this.id, // size: 20 // } // }) // if (code === 0) { // this.list = data.records || [] // } // this.$message.hideLoading() // } }, //update 关注 @@ -232,10 +270,35 @@ }, changeTab(flg) { async changeTab(flg) { console.log('changeTab', flg) if('1'===(''+flg)){ if(!this.catgoryTree){ this.$message.showLoading() const { code,data } = await this.$http.request('get', `/api/customer/flower/category/tree`, { data: { supplierId: this.dto.supplierId || this.dto.id }, params: { supplierId: this.dto.supplierId || this.dto.id } }) if (code === 0) { // data 分类树 this.catgoryTree = data || [] let tmp = this this.$nextTick(()=>{ tmp.$refs.trade.refInit(tmp.catgoryTree) }) } this.$message.hideLoading() } } this.flg = ''+flg //如果没有加载数据,需要加载一下 }, buttonSearchFlow() { @@ -304,9 +367,13 @@ padding-left: 20rpx; } } .brand-info-1{ // padding: 40rpx 30rpx; } .brand-info-3 { padding: 40rpx 30rpx; .title { font-weight: 600; font-size: 32rpx; @@ -318,19 +385,18 @@ .form-input { display: flex; border-bottom: 2rpx solid #EEEEEE; line-height: 80rpx; .label { font-weight: 600; font-size: 28rpx; color: #000000; line-height: 40rpx; } .value { font-weight: 400; font-size: 28rpx; color: #666666; line-height: 40rpx; margin-left: auto; margin-right: 0; sub_pages/customer/shopping/shopping.vue
@@ -27,7 +27,7 @@ <u-swipe-action-item :options="options1" @click="(e)=>{clickSwipeButton(dto)}"> <view class="item-each flex"> <radio :checked="ids.indexOf(dto.id)>=0" @click="changeItem(dto,'flower')"></radio> <image class="img img100 m-r-6" :src="dto.url||dto.cover"></image> <image class="img img100 m-r-6 br-4" :src="dto.url||dto.cover"></image> <view class="flex1"> <view class="title"><span class="m-r-5" style="display: inline-block;">{{item.categoryStr||''}}</span><span sub_pages/customer/trade/detail.vue
@@ -3,7 +3,12 @@ <view class="top-img-container"> <image :src="dto.cover" class="top-img" mode="aspectFill"></image> <view class="icon-container"> <image src="../../../static/common/icon-sc.png" @click="collectItem(dto)" class="icon-sc"></image> <image v-if="!dto.collection" src="../../../static/common/icon-sc.png" @click="collectItem(dto)" class="icon-sc"></image> <image v-if="dto.collection" src="../../../static/common/icon-sc.png" @click="collectItem(dto)" class="icon-sc"></image> <!-- <view class="num">12</view>--> </view> <view class="icon-container"> @@ -14,7 +19,7 @@ </view> <view class="trade-info-container"> <view class="title flex"> <view class="level m-r-15">{{ dto.levelStr || '-' }}级</view> <view class="level m-r-15">{{ dto.levelStr || '-' }}</view> <view class=""> {{ dto.name || '-' }} </view> @@ -134,18 +139,24 @@ }, methods: { async collectItem(dto){ await this.$message.confirm('是否添加到收藏') await this.$message.confirm(`是否${dto.collection?'移除':'添加到'}收藏`) this.$message.showLoading() const { code, data } = await this.$http.request('post', '/api/collect/add', { } = await this.$http.request(dto.collection ? "get" : 'post', dto.collection ? '/api/collect/delete' : '/api/collect/add', { data: { flowerId: dto.id }, params: { id: dto.id } }) if (code === 0) { this.$message.showToast('收藏成功') this.$message.showToast('操作成功') dto.collection = !dto.collection this.$forceUpdate() } this.$message.hideLoading() @@ -353,9 +364,11 @@ position: absolute; top: 20rpx; width: 80rpx; left: 40rpx; right: 140rpx; height: 80rpx; background: rgba(0, 0, 0, 0); background: rgba(0, 0, 0, 0.42); border-radius: 50%; display:flex; .icon-sc { width: 54rpx; @@ -386,7 +399,7 @@ } .icon-container:last-child { left: 100rpx; right: 20rpx; } // .icon-container:first-child { sub_pages/customer/trade/trade.vue
@@ -1,5 +1,5 @@ <template> <view class="container-trade" style="min-height: calc(100vh - 20rpx );"> <view class="container-trade" :style="{'min-height':hidefooter?'':'calc(100vh - 20rpx)'}"> <view class="search-container m-t-12 flex" v-if="!(!list||list.length==0)&&true&&!hidefooter"> <view class="flex1 input"> <u-input placeholder="请输入分类名称" v-model="query.name"> @@ -9,7 +9,7 @@ </u-input> </view> </view> <view class="canteen-items" style="min-height: calc(100vh - 160rpx);"> <view class="canteen-items" :style="{'min-height':hidefooter?'':'calc(100vh - 160rpx)'}"> <view v-if="(!list||list.length==0)&&true" style="width: 100%;min-height: 200rpx;"> </view> @@ -59,7 +59,7 @@ </view> </view> <footer-msg <footer-msg v-if="!hidefooter" :more="page.total>0&&page.total>page.current*page.size"></footer-msg> </view> @@ -103,6 +103,7 @@ export default { props: { hidefooter: false, catgoryTree:[], }, data() { return { @@ -143,6 +144,13 @@ }) }, methods: { refInit(catgoryTree){ this.list = catgoryTree || [] if (this.list.length > 0) { this.query.categoryId = this.list[0].id || '' this.currentCategory = this.list[0] || {} } }, async updateParamsAndSearch(){ //todo 设置参数并查询 await this.refreshList()