From e4233b5c4e123c4b79a38d0a9b0c8b60631e1683 Mon Sep 17 00:00:00 2001 From: xuxueyang <xuxy@fengyuntec.com> Date: 星期二, 30 七月 2024 10:40:24 +0800 Subject: [PATCH] update --- sub_pages/customer/trade/list.vue | 39 + pages/home/home.vue | 9 sub_pages/customer/shopping/shopping.vue | 46 + pages/notice/notice.vue | 2 static/common/icon-sc-fill.png | 0 pages/user/address/address.vue | 888 ++++++++++++++++++++++--------------------- sub_pages/customer/trade/detail.vue | 13 pages/home/components/home-price.vue | 5 sub_pages/customer/self/follow.vue | 2 manifest.json | 2 sub_pages/customer/self/collect.vue | 13 sub_pages/customer/shop/shop.vue | 7 sub_pages/customer/shopping/confirm.vue | 38 + sub_pages/customer/trade/trade.vue | 7 pages/notice/list.vue | 15 pages/home/components/home-category.vue | 10 pages/user/supplier-user.vue | 48 +- 17 files changed, 620 insertions(+), 524 deletions(-) diff --git a/manifest.json b/manifest.json index a3c7ecb..651a10c 100644 --- a/manifest.json +++ b/manifest.json @@ -49,7 +49,7 @@ "quickapp" : {}, /* 快应用特有相关 */ "mp-weixin" : { - "appid" : "wx3203fd935a6ffe09", + "appid" : "wx1441324401626290", "setting" : { "urlCheck" : false, "es6" : true, diff --git a/pages/home/components/home-category.vue b/pages/home/components/home-category.vue index 910cc73..8e1e69e 100644 --- a/pages/home/components/home-category.vue +++ b/pages/home/components/home-category.vue @@ -1,7 +1,7 @@ <template> <view class="home-category"> <view class="flex"> - <view class="t1">06-03(今日)第一场交易中</view> + <view class="t1">{{today}}(今日)第一场交易中</view> <view class="t2">当前在售123435扎</view> </view> <view class="m-t-12 flex"> @@ -16,12 +16,7 @@ <script> export default { beforeMount() { - // for (var i = 0; i < 10; i++) { - // this.list.push({ - // 'url': 'https://hmy-flower.oss-cn-shanghai.aliyuncs.com/e2/e2ee2fa7cdef458ba748261305edc57435549b9113807b6fbbfd4bfa456334d.png', - // 'name': '玫瑰' - // }) - // } + this.today = this.$util.toDate(new Date()) this.$http.request('get', '/api/customer/flower/category/tree', {}).then(res => { var data = res.data this.list = [] @@ -45,6 +40,7 @@ data() { return { list: [], + today:'', }; } diff --git a/pages/home/components/home-price.vue b/pages/home/components/home-price.vue index 03bc4c6..22f26e8 100644 --- a/pages/home/components/home-price.vue +++ b/pages/home/components/home-price.vue @@ -1,7 +1,7 @@ <template> <view class="home-price"> <view class="flex t1"> - <view>2024-06-03 09:20:19 花满芫成交均价</view> + <view>{{today}} 花满芫成交均价</view> <!-- <uni-icons class="m-l-a m-r-0" type="right"></uni-icons>--> </view> <view class="items" style="border-top: 2rpx solid #EEEEEE;"> @@ -109,10 +109,11 @@ return { list1: [], list2: [], + today: '' }; }, async mounted() { - + this.today = this.$util.toDateSec(new Date()) const { data } = await this.$http.request('get', '/api/pub/customer/home/category/price/ave', { diff --git a/pages/home/home.vue b/pages/home/home.vue index af3d8c6..539d789 100644 --- a/pages/home/home.vue +++ b/pages/home/home.vue @@ -226,14 +226,15 @@ },2000) //公告 - this.$http.request('get', '/api/announcement/page', { + this.$http.request('get', '/api/pub/announcement/list', { params: { size: 5, - status: 'A' + // status: 'A' } }).then(res => { - if (res.code === 0) { - this.noticeList = (res.data && res.data.records || []) + if (res.code === 0) { + // (res.data && res.data.records || []) + this.noticeList = res.data || [] console.log('this.noticeList', this.noticeList) if (this.noticeList.length > 0) { this.currentNotice = this.noticeList[0] diff --git a/pages/notice/list.vue b/pages/notice/list.vue index 2a12221..9d6f892 100644 --- a/pages/notice/list.vue +++ b/pages/notice/list.vue @@ -1,8 +1,8 @@ <template> <!-- 列表页面 --> <view> - <view class="p15" style="min-height: calc(100vh - 260rpx);"> - <no-data v-if="!list||list.length==0" style="width: 100%;"></no-data> + <view class="p15" style="min-height: calc(100vh - 260rpx);"> + <no-data v-if="!list||list.length==0" style="width: 100%;"></no-data> <view v-for="(item,index) in list" :key="index" class="m-b-24"> <view @click.stop="toDetail(item)" class="notice-item"> <view>{{item.title}}</view> @@ -20,12 +20,14 @@ export default { data() { return { - + query: { + status: 'A' + } } }, onLoad() { // this.list = [{},{}] - this.listApi = '/api/announcement/page' + this.listApi = '/api/pub/announcement/list' this.getList() }, @@ -49,12 +51,13 @@ </script> <style lang="scss" scoped> - .notice-item{ + .notice-item { padding: 20rpx; font-size: 28rpx; font-weight: 600; background-color: #fff; - .time{ + + .time { font-size: 24rpx; color: darkgray; } diff --git a/pages/notice/notice.vue b/pages/notice/notice.vue index fd4e569..f47e930 100644 --- a/pages/notice/notice.vue +++ b/pages/notice/notice.vue @@ -45,7 +45,7 @@ this.$message.showLoading() const { data - } = await this.$http.request('get', '/api/announcement/page/view?id=' + this.id, { + } = await this.$http.request('get', '/api/pub/announcement/page/view?id=' + this.id, { }) diff --git a/pages/user/address/address.vue b/pages/user/address/address.vue index 3766107..9df16bb 100644 --- a/pages/user/address/address.vue +++ b/pages/user/address/address.vue @@ -1,489 +1,507 @@ <template> - <!-- 收获地址列表 --> - <view class="p15 container-address"> - <no-data v-if="!list||list.length==0" style="width: 100%;"></no-data> + <!-- 收货地址列表 --> + <view class="p15 container-address"> + <no-data v-if="!list||list.length==0" style="width: 100%;"></no-data> - <!-- 循环 --> - <view v-for="(item,index) of list" :key="index" class="location-each"> - <view class="flex"> - <view class="container-info"> - <view class="flex"> - <view class="name">{{ item.name || '-' }}</view> - <view class="tel">{{ item.tel || '-' }}</view> - </view> - <view class="address"> - {{ item.address }} - - </view> - </view> - <!-- <view class="h-line"></view> --> - <view class="edit" @click="()=>{ + <!-- 循环 --> + <view v-for="(item,index) of list" :key="index" class="location-each"> + <view class="flex"> + <view class="container-info"> + <view class="flex"> + <view class="name">{{ item.name || '-' }}</view> + <view class="tel">{{ item.tel || '-' }}</view> + </view> + <view class="address"> + {{ item['province'] || '' }}{{ item['city'] && ('/' + item['city']) || '' }}{{ + item['region'] && ('/' + item['region']) || '' + }} + </view> + <view class="address"> + {{ item.address }} + </view> + </view> + <!-- <view class="h-line"></view> --> + <view class="edit" @click="()=>{ this.submitForm = { ...item } openAddressForm() }"> - <uni-icons type="compose" class="icon" color="#666666"></uni-icons> - </view> - </view> - <view class="v-line"></view> - <view class="flex"> - <!-- --> - <view class="flex"> - <view class="radio m-t-2 m-r-10" :class="[item.isDefault?'select':'']" - @click="changeDefaultAddress(item,index)"> + <uni-icons type="compose" class="icon" color="#666666"></uni-icons> + </view> + </view> + <view class="v-line"></view> + <view class="flex"> + <!-- --> + <view class="flex"> + <view class="radio m-t-2 m-r-10" :class="[item.isDefault?'select':'']" + @click="changeDefaultAddress(item,index)"> - </view> - <span class="desc">{{ item.isDefault ? '默认地址:' : '当前地址:' }}{{ item.address || '' }}</span> - <!-- 当前地址/默认地址勾选 --> - </view> - <view class="desc del t-red" @click="deleteAddress(item)"> - 删除 - </view> - <view class="desc del t-green m-l-10" v-if="source==='select'" @click="selectAddress(item)"> - 选择此地址 - </view> - </view> + </view> + <span class="desc">{{ item.isDefault ? '默认地址:' : '当前地址:' }}{{ item.address || '' }}</span> + <!-- 当前地址/默认地址勾选 --> + </view> + <view class="desc del t-red" @click="deleteAddress(item)"> + 删除 + </view> + <view class="desc del t-green m-l-10" v-if="source==='select'" @click="selectAddress(item)"> + 选择此地址 + </view> + </view> - </view> - <view style="height: 92rpx;width: 690rpx;"> - - </view> - <view class="button-green button-fixed-bottom" style="width: 690rpx;line-height: 92rpx;height: 92rpx;" @click=" ()=>{ - delete this.submitForm.id - this.submitForm['name'] = '' - this.submitForm['tel'] = '' - this.submitForm['tel'] = '' - this.submitForm['area'] = '' + </view> + <view style="height: 92rpx;width: 690rpx;"> + + </view> + <view class="button-green button-fixed-bottom" style="width: 690rpx;line-height: 92rpx;height: 92rpx;" + @click="addAddress">添加收货地址 + </view> - openAddressForm() - }">添加收货地址 - </view> - - <uni-popup ref="popup_form" type="top" :mask-click="false"> - <view class="popup-address-form"> - <view class="close-parent"> - {{ submitForm.id ? '新增' : '编辑' }}收货地址 - <uni-icons class="close" type="closeempty" @click="closeAddressForm"></uni-icons> - </view> - <!--收货人、手机号、校区、详细地址 --> - <view class="submit form"> - <view class="form-item"> - <view class="form-item-label require"> - 收货人 - </view> - <view class="form-item-value"> - <input v-model="submitForm.name" placeholder="请输入收货人" class="form-input"></input> - </view> - </view> - <view class="form-item"> - <view class="form-item-label require"> - 收获地址 - </view> - <view class="m-l-a m-r-0 flex " :class="[!dto['province']?'desc-gray':'']"> - <uni-data-picker :area="true" @change="(e)=>{PickArea(submitForm,e)}" placeholder="" - :localdata="regionDataPlus"> - {{ submitForm['province'] || '请选择' }}{{ submitForm['city'] && ('/' + submitForm['city']) || '' }}{{ + <uni-popup ref="popup_form" type="top" :mask-click="false"> + <view class="popup-address-form"> + <view class="close-parent"> + {{ submitForm.id ? '新增' : '编辑' }}收货地址 + <uni-icons class="close" type="closeempty" @click="closeAddressForm"></uni-icons> + </view> + <!--收货人、手机号、校区、详细地址 --> + <view class="submit form"> + <view class="form-item"> + <view class="form-item-label require"> + 收货人 + </view> + <view class="form-item-value"> + <input v-model="submitForm.name" placeholder="请输入收货人" class="form-input"></input> + </view> + </view> + <view class="form-item"> + <view class="form-item-label require"> + 手机号 + </view> + <view class="form-item-value"> + <input v-model="submitForm.tel" placeholder="请输入收货人手机号" class="form-input"></input> + </view> + </view> + <view class="form-item"> + <view class="form-item-label require"> + 收货地址 + </view> + <view class="m-l-a m-r-0 flex " :class="[!dto['province']?'desc-gray':'']"> + <uni-data-picker :area="true" @change="(e)=>{PickArea(submitForm,e)}" placeholder="" + :localdata="regionDataPlus"> + {{ submitForm['province'] || '请选择' }}{{ submitForm['city'] && ('/' + submitForm['city']) || '' }}{{ submitForm['region'] && ('/' + submitForm['region']) || '' }} - </uni-data-picker> - <u-icon class="m-l-a" name="arrow-right"></u-icon> - </view> + </uni-data-picker> + <u-icon class="m-l-a" name="arrow-right"></u-icon> + </view> - <!-- <view class="form-item-value" @click="chooseLocation">--> - <!-- <input v-model="submitForm.room" placeholder="请选择收获地址" disabled class="form-input"></input>--> - <!-- <!– 点击定位 –>--> - <!-- </view>--> - </view> - <view class="form-item"> - <view class="form-item-label require"> - 详细地址 - </view> - <view class="form-item-value"> - <input v-model="submitForm.address" placeholder="请输入详细地址" class="form-input"></input> - </view> - </view> - <view class="form-item"> - <view class="form-item-label"> - 是否默认 - </view> - <view class="form-item-value"> - <radio value="r1" :checked="submitForm.isDefault" - @click="submitForm.isDefault=!submitForm.isDefault" - style="transform:scale(0.6);margin-top: -8rpx;"/> - </view> - </view> - </view> + </view> + <view class="form-item"> + <view class="form-item-label require"> + 详细地址 + </view> + <view class="form-item-value"> + <input v-model="submitForm.address" placeholder="请输入详细地址" class="form-input"></input> - <view class="button-green m-t-15" @click="saveOrUpdateAddress">保存</view> - </view> - </uni-popup> + </view> + </view> + <view class="form-item"> + <view class="form-item-label"> + 是否默认 + </view> + <view class="form-item-value"> + <radio value="r1" :checked="submitForm.isDefault" + @click="submitForm.isDefault=!submitForm.isDefault" + style="transform:scale(0.6);margin-top: -8rpx;" /> + </view> + </view> + </view> - </view> + <view class="button-green m-t-15" @click="saveOrUpdateAddress">保存</view> + </view> + </uni-popup> + + </view> </template> <script> -// import qqmapwx from '@/plugins/qqmap-wx-jssdk.min.js'; -// const lockey = 'VUHBZ-2AMLP-B7AD7-VUQZ7-D4TW5-MFFVN'; //使用在腾讯位置服务申请的key -// const chooseLocation = requirePlugin('chooseLocation'); + // import qqmapwx from '@/plugins/qqmap-wx-jssdk.min.js'; + // const lockey = 'VUHBZ-2AMLP-B7AD7-VUQZ7-D4TW5-MFFVN'; //使用在腾讯位置服务申请的key + // const chooseLocation = requirePlugin('chooseLocation'); -export default { - async onPullDownRefresh() { - this.page.current = 0 - await this.getList() - uni.stopPullDownRefresh() - }, - async onLoad(options) { - // this.list = [{}, {}] - this.source = options.source || '' - this.listApi = '/api/address/list' - await this.getList() + export default { + async onPullDownRefresh() { + this.page.current = 0 + await this.getList() + uni.stopPullDownRefresh() + }, + async onLoad(options) { + // this.list = [{}, {}] + this.source = options.source || '' + this.listApi = '/api/address/list' + await this.getList() - }, - data() { - return { - source: '', - submitForm: { - name: '', - tel: '', - address: '', - isDefault: false, - province: '', - city: '', - region: '', + }, + data() { + return { + source: '', + submitForm: { + name: '', + tel: '', + address: '', + isDefault: false, + province: '', + city: '', + region: '', - }, - regionDataPlus: [], - list:[], - }; - }, - methods: { - PickArea(item, e) { - console.log('PickArea', item, e) - if (e.detail.value) { - this.submitForm.province = '' - this.submitForm.city = '' - this.submitForm.region = '' - if (e.detail.value.length <= 3) { - if (!!e.detail.value[0]) - this.submitForm.province = e.detail.value[0].value - if (!!e.detail.value[1]) - this.submitForm.city = e.detail.value[1].value - if (!!e.detail.value[2]) - this.submitForm.region = e.detail.value[2].value - } else { - //说明有重复的 - var plusnum = e.detail.value.length - 3 - if (!!e.detail.value[plusnum + 0]) - this.submitForm.province = e.detail.value[plusnum + 0].value - if (!!e.detail.value[plusnum + 1]) - this.submitForm.city = e.detail.value[plusnum + 1].value - if (!!e.detail.value[plusnum + 2]) - this.submitForm.region = e.detail.value[plusnum + 2].value - } + }, + regionDataPlus: [], + list: [], + }; + }, + methods: { + addAddress() { + delete this.submitForm.id + this.submitForm['name'] = '' + this.submitForm['tel'] = '' + this.submitForm['address'] = '' + this.submitForm['province'] = '' + this.submitForm['city'] = '' + this.submitForm['region'] = '' + this.submitForm['isDefault'] = false + this.openAddressForm() + }, + PickArea(item, e) { + console.log('PickArea', item, e) + if (e.detail.value) { + this.submitForm.province = '' + this.submitForm.city = '' + this.submitForm.region = '' + if (e.detail.value.length <= 3) { + if (!!e.detail.value[0]) + this.submitForm.province = e.detail.value[0].value + if (!!e.detail.value[1]) + this.submitForm.city = e.detail.value[1].value + if (!!e.detail.value[2]) + this.submitForm.region = e.detail.value[2].value + } else { + //说明有重复的 + var plusnum = e.detail.value.length - 3 + if (!!e.detail.value[plusnum + 0]) + this.submitForm.province = e.detail.value[plusnum + 0].value + if (!!e.detail.value[plusnum + 1]) + this.submitForm.city = e.detail.value[plusnum + 1].value + if (!!e.detail.value[plusnum + 2]) + this.submitForm.region = e.detail.value[plusnum + 2].value + } - this.$forceUpdate() - console.log('submit forn',this.submitForm) - } - }, - async init_area() { - const res = await this.$http.request('get', '/api/pub/china/area/json') - this.regionDataPlus = res.data && JSON.parse(res.data.replaceAll('code', 'value').replaceAll('name', - 'text')) || [] - }, - chooseLocation() { - //前往接口挑选位置 - const qqmapsdk = new qqmapwx({ - // 使用你在腾讯地图应用生成的key - key: lockey - }); + this.$forceUpdate() + console.log('submit forn', this.submitForm) + } + }, + async init_area() { + const res = await this.$http.request('get', '/api/pub/china/area/json') + this.regionDataPlus = res.data && JSON.parse(res.data.replaceAll('code', 'value').replaceAll('name', + 'text')) || [] + }, + chooseLocation() { + //前往接口挑选位置 + const qqmapsdk = new qqmapwx({ + // 使用你在腾讯地图应用生成的key + key: lockey + }); - uni.getLocation({ - type: 'wgs84', - success(res) { - //得到经纬度 - console.log(res); - qqmapsdk.reverseGeocoder({ - location: { - latitude: res.latitude, - longitude: res.longitude - }, - //成功后的回调 - success: (r) => { - // console.log('地址信息', r.result.address_component); - // result: {location: {lat: 31.26249, lng: 120.63212}, address: "江苏省苏州市吴中区太湖东路288号",…} - // ad_info: {nation_code: "156", adcode: "320506", phone_area_code: "0512", city_code: "156320500",…} - // address: "江苏省苏州市吴中区太湖东路288号" - // address_component: {nation: "中国", province: "江苏省", city: "苏州市", district: "吴中区", street: "太湖东路",…} - // address_reference: {,…} - // formatted_addresses: {recommend: "长桥苏州市吴中区人民政府(太湖东路北)", rough: "长桥苏州市吴中区人民政府(太湖东路北)"} - // location: {lat: 31.26249, lng: 120.63212} - // status: 0 - tmp.formcodes['LOC_ONE'][tmp.tmp_picker_lock_index].longitude = r - .result.location.lng - tmp.formcodes['LOC_ONE'][tmp.tmp_picker_lock_index].latitude = r - .result.location.lat - tmp.formcodes['LOC_ONE'][tmp.tmp_picker_lock_index].loc_desc = r - .result.address - tmp.formcodes['LOC_ONE'][tmp.tmp_picker_lock_index]._show = false - tmp.$forceUpdate() - tmp.tmp_picker_lock_index = -1 + uni.getLocation({ + type: 'wgs84', + success(res) { + //得到经纬度 + console.log(res); + qqmapsdk.reverseGeocoder({ + location: { + latitude: res.latitude, + longitude: res.longitude + }, + //成功后的回调 + success: (r) => { + // console.log('地址信息', r.result.address_component); + // result: {location: {lat: 31.26249, lng: 120.63212}, address: "江苏省苏州市吴中区太湖东路288号",…} + // ad_info: {nation_code: "156", adcode: "320506", phone_area_code: "0512", city_code: "156320500",…} + // address: "江苏省苏州市吴中区太湖东路288号" + // address_component: {nation: "中国", province: "江苏省", city: "苏州市", district: "吴中区", street: "太湖东路",…} + // address_reference: {,…} + // formatted_addresses: {recommend: "长桥苏州市吴中区人民政府(太湖东路北)", rough: "长桥苏州市吴中区人民政府(太湖东路北)"} + // location: {lat: 31.26249, lng: 120.63212} + // status: 0 + tmp.formcodes['LOC_ONE'][tmp.tmp_picker_lock_index].longitude = r + .result.location.lng + tmp.formcodes['LOC_ONE'][tmp.tmp_picker_lock_index].latitude = r + .result.location.lat + tmp.formcodes['LOC_ONE'][tmp.tmp_picker_lock_index].loc_desc = r + .result.address + tmp.formcodes['LOC_ONE'][tmp.tmp_picker_lock_index]._show = false + tmp.$forceUpdate() + tmp.tmp_picker_lock_index = -1 - }, - fail: function (res) { - console.log(res); - tmp.tmp_picker_lock_index = -1 - }, - }); - } - }); - }, - async changeDefaultAddress(item, index) { - if (item.isDefault) { - return - } - this.$nextTick(() => { + }, + fail: function(res) { + console.log(res); + tmp.tmp_picker_lock_index = -1 + }, + }); + } + }); + }, + async changeDefaultAddress(item, index) { + if (item.isDefault) { + return + } + this.$nextTick(() => { - this.$message.confirm('确定设置此地址为默认地址吗').then(async res => { - this.$message.showLoading() - var { - code - } = await this.$http.request('post', '/api/address/set/default/'+item.id, { - data:{ - id:item.id - }, - params:{ - id:item.id - } - }) - this.$message.hideLoading() - if (code === 0) { - for (var dto of this.list) { - dto.isDefault = false - } - this.$message.showToast('设置成功') - item.isDefault = true - this.$store.commit('setDefaultAddress', { - ...item - }) + this.$message.confirm('确定设置此地址为默认地址吗').then(async res => { + this.$message.showLoading() + var { + code + } = await this.$http.request('post', '/api/address/set/default/' + item + .id, { + data: { + id: item.id + }, + params: { + id: item.id + } + }) + this.$message.hideLoading() + if (code === 0) { + for (var dto of this.list) { + dto.isDefault = false + } + this.$message.showToast('设置成功') + item.isDefault = true + this.$store.commit('setDefaultAddress', { + ...item + }) - } - }, err => { - this.$nextTick(() => { - this.list[index].defaulted = false - this.$forceUpdate() - console.log('err', err, this.list[index]) - }) + } + }, err => { + this.$nextTick(() => { + this.list[index].isDefault = false + this.$forceUpdate() + console.log('err', err, this.list[index]) + }) - }) - }) - }, - async selectAddress(item) { - await this.$message.confirm('确定选择此地址作为收获地址吗') - //携带,然后返回 - this.$store.commit('setDefaultAddress', { - ...item - }) - this.backpage() - }, - async deleteAddress(item) { - await this.$message.confirm('确定删除此地址吗') - this.$message.showLoading() - var { - code - } = await this.$http.request('get', '/api/address/delete?id=' + item.id, {}) - this.$message.hideLoading() - if (code === 0) { - this.$message.showToast('删除成功') - setTimeout(() => { - this.page.current = 1 - this.getList() - }, 500) - } - }, - async openAddressForm() { - this.init_area() - if (this.submitForm.id) { - this.$message.showLoading() - var { - data - } = await this.$http.request('get', '/api/address/list/detail?id=' + this.submitForm.id, {}) + }) + }) + }, + async selectAddress(item) { + await this.$message.confirm('确定选择此地址作为收货地址吗') + //携带,然后返回 + this.$store.commit('setDefaultAddress', { + ...item + }) + this.backpage() + }, + async deleteAddress(item) { + await this.$message.confirm('确定删除此地址吗') + this.$message.showLoading() + var { + code + } = await this.$http.request('get', '/api/address/delete?id=' + item.id, {}) + this.$message.hideLoading() + if (code === 0) { + this.$message.showToast('删除成功') + if (item.isDefault) { + //要清空地址了 + this.$store.commit('setDefaultAddress', {}) + } + setTimeout(() => { + this.page.current = 1 + this.getList() + }, 500) + } + }, + async openAddressForm() { + this.init_area() + if (this.submitForm.id) { + this.$message.showLoading() + var { + data + } = await this.$http.request('get', '/api/address/list/detail?id=' + this.submitForm.id, {}) - if (data) { - this.submitForm = { - ...this.submitForm, - ...data - } - } - this.$message.hideLoading() - } else { - this.submitForm = { - name: this.currentInfo && this.currentInfo.nickName || '', - tel: this.currentInfo && this.currentInfo.tel || '', - address: '', - isDefault: false, - province: '', - city: '', - region: '', - } - } + if (data) { + this.submitForm = { + ...this.submitForm, + ...data + } + } + this.$message.hideLoading() + } else { + this.submitForm = { + name: this.currentInfo && this.currentInfo.nickName || '', + tel: this.currentInfo && this.currentInfo.tel || '', + address: '', + isDefault: false, + province: '', + city: '', + region: '', + } + } - this.$refs.popup_form.open() + this.$refs.popup_form.open() - }, - closeAddressForm() { - this.$refs.popup_form.close() + }, + closeAddressForm() { + this.$refs.popup_form.close() - }, - async saveOrUpdateAddress() { - if (!this.checkFormValues(this.submitForm, ['tel', 'name', 'address'])) { - this.$message.showToast('字段未填写完整') - return - } - this.$message.showLoading() - const { - code - } = await this.$http.request('post', '/api/address/' + (this.submitForm.id ? 'update' : - 'add'), { - data: this.submitForm - }) - this.$message.hideLoading() - if (code === 0) { - this.$refs.popup_form.close() - this.$message.showToast(this.submitForm.id ? '修改成功' : '新增成功') + }, + async saveOrUpdateAddress() { + if (!this.checkFormValues(this.submitForm, ['tel', 'name', 'address'])) { + this.$message.showToast('字段未填写完整') + return + } + this.$message.showLoading() + const { + code + } = await this.$http.request('post', '/api/address/' + (this.submitForm.id ? 'update' : + 'add'), { + data: this.submitForm + }) + this.$message.hideLoading() + if (code === 0) { + this.$refs.popup_form.close() + this.$message.showToast(this.submitForm.id ? '修改成功' : '新增成功') + let tmp = this + setTimeout(() => { + tmp.page.current = 1 + tmp.refreshList() + }, 300) + } + }, - setTimeout(() => { - this.page.current = 1 - this.getList() - }, 300) - } - }, - - } -} + } + } </script> <style lang="scss" scoped> -.container-address { - .popup-address-form { - background: #FFFFFF; - border-radius: 16rpx; - // width: 690rpx; - height: 882rpx; - margin-top: 120rpx; - margin-left: 30rpx; - margin-right: 30rpx; - padding: 24rpx 36rpx; + .container-address { + .popup-address-form { + background: #FFFFFF; + border-radius: 16rpx; + // width: 690rpx; + height: 882rpx; + margin-top: 120rpx; + margin-left: 30rpx; + margin-right: 30rpx; + padding: 24rpx 36rpx; - .submit { - margin-top: 30rpx; + .submit { + margin-top: 30rpx; - .form-input { - height: 36rpx; - line-height: 36rpx; - } - } - } + .form-input { + height: 36rpx; + line-height: 36rpx; + } + } + } - .location-each { - background: #FFFFFF; - border-radius: 16rpx; - margin-bottom: 24rpx; - padding: 36rpx; + .location-each { + background: #FFFFFF; + border-radius: 16rpx; + margin-bottom: 24rpx; + padding: 36rpx; - .name { - font-size: 32rpx; - color: #000000; - line-height: 44rpx; - text-align: left; - font-style: normal; - } + .name { + font-size: 32rpx; + color: #000000; + line-height: 44rpx; + text-align: left; + font-style: normal; + } - .tel { - font-size: 28rpx; - color: #666666; - line-height: 40rpx; - text-align: left; - font-style: normal; - padding-top: 4rpx; - margin-left: 20rpx; - } + .tel { + font-size: 28rpx; + color: #666666; + line-height: 40rpx; + text-align: left; + font-style: normal; + padding-top: 4rpx; + margin-left: 20rpx; + } - .address { - font-size: 24rpx; - color: #000000; - line-height: 34rpx; - text-align: left; - font-style: normal; - } + .address { + font-size: 24rpx; + color: #000000; + line-height: 34rpx; + text-align: left; + font-style: normal; + } - .desc { - font-size: 24rpx; - color: #666666; - line-height: 34rpx; - text-align: left; - font-style: normal; - } + .desc { + font-size: 24rpx; + color: #666666; + line-height: 34rpx; + text-align: left; + font-style: normal; + } - .del { - // vertical-align: baseline; - margin-left: auto; - margin-right: 6rpx; - margin-top: 4rpx; - } + .del { + // vertical-align: baseline; + margin-left: auto; + margin-right: 6rpx; + margin-top: 4rpx; + } - .container-info { - max-width: 540rpx; - } + .container-info { + max-width: 540rpx; + } - .h-line { - width: 2rpx; - height: 46rpx; - background-color: #EEEEEE; - margin-left: 28rpx; - margin-right: 24rpx; - } + .h-line { + width: 2rpx; + height: 46rpx; + background-color: #EEEEEE; + margin-left: 28rpx; + margin-right: 24rpx; + } - .v-line { - width: 638rpx; - height: 2rpx; - // border: 2rpx solid #EEEEEE; - background-color: #EEEEEE; - margin-top: 24rpx; - margin-bottom: 24rpx; - } + .v-line { + width: 638rpx; + height: 2rpx; + // border: 2rpx solid #EEEEEE; + background-color: #EEEEEE; + margin-top: 24rpx; + margin-bottom: 24rpx; + } - .edit { - // min-width: 80rpx; - width: fit-content; - margin-left: auto; - margin-right: 0rpx; - display: flex; - position: relative; + .edit { + // min-width: 80rpx; + width: fit-content; + margin-left: auto; + margin-right: 0rpx; + display: flex; + position: relative; - .icon { - // margin: 0 auto; - // mar - margin-left: auto; - margin-right: auto; - margin-top: 20rpx; - display: block; + .icon { + // margin: 0 auto; + // mar + margin-left: auto; + margin-right: auto; + margin-top: 20rpx; + display: block; - } - } + } + } - .edit::before { - content: " "; - width: 2rpx; - height: 46rpx; - background-color: #EEEEEE; - position: absolute; - left: -24rpx; - top: 20rpx; - } - } -} + .edit::before { + content: " "; + width: 2rpx; + height: 46rpx; + background-color: #EEEEEE; + position: absolute; + left: -24rpx; + top: 20rpx; + } + } + } </style> \ No newline at end of file diff --git a/pages/user/supplier-user.vue b/pages/user/supplier-user.vue index 9150b88..c0a7541 100644 --- a/pages/user/supplier-user.vue +++ b/pages/user/supplier-user.vue @@ -44,18 +44,20 @@ <!-- getUserProfile --> {{ '点击登陆' }} </view> - <image class="icon-setting" @click="toInfo" - src="../../static/common/icon-setting.png" mode="aspectFit"></image> + <image class="icon-setting" @click="toInfo" src="../../static/common/icon-setting.png" mode="aspectFit"> + </image> </view> <!-- #ifdef PUB_CUSTOMER --> <view class="customer-info-records"> <view class="item"> - <view class="num">{{ tj.collectNum || 0 }}</view> + <view class="num" @click="goto('/sub_pages/customer/self/collect',true)">{{ tj.collectNum || 0 }} + </view> <view class="name">我的收藏</view> </view> <view class="line"></view> <view class="item"> - <view class="num">{{ tj.followNum || 0 }}</view> + <view class="num" @click="goto('/sub_pages/customer/self/follow',true)">{{ tj.followNum || 0 }} + </view> <view class="name">关注店铺</view> </view> <view class="line"></view> @@ -307,25 +309,25 @@ await this.$store.dispatch('getCurrentInfo') uni.stopPullDownRefresh() }, - methods: { - toInfo(){ - var url = '' - if(this.currentInfo.id){ - // #ifdef PUB_CUSTOMER - url = '/sub_pages/customer/customer-info/customer-info' - // #endif - // #ifdef PUB_PARTNER - url = '/sub_pages/partner/partner-info/partner-info' - // #endif - // #ifdef PUB_SUPPLIER - url = '/sub_pages/supplier/supplier-info/supplier-info' - // #endif - if(url){ - uni.navigateTo({ - url:url - }) - } - } + methods: { + toInfo() { + var url = '' + if (this.currentInfo.id) { + // #ifdef PUB_CUSTOMER + url = '/sub_pages/customer/customer-info/customer-info' + // #endif + // #ifdef PUB_PARTNER + url = '/sub_pages/partner/partner-info/partner-info' + // #endif + // #ifdef PUB_SUPPLIER + url = '/sub_pages/supplier/supplier-info/supplier-info' + // #endif + if (url) { + uni.navigateTo({ + url: url + }) + } + } }, getTj() { // /api/supplier/delivery diff --git a/static/common/icon-sc-fill.png b/static/common/icon-sc-fill.png new file mode 100644 index 0000000..bf915c5 --- /dev/null +++ b/static/common/icon-sc-fill.png Binary files differ diff --git a/sub_pages/customer/self/collect.vue b/sub_pages/customer/self/collect.vue index 3a6706f..d5ec579 100644 --- a/sub_pages/customer/self/collect.vue +++ b/sub_pages/customer/self/collect.vue @@ -56,6 +56,12 @@ }, methods: { toDetail(item) { + if(item.status=='UP'){ + + }else{ + this.$message.showToast('已失效,无法查看详情') + return + } uni.navigateTo({ url: `/sub_pages/customer/trade/detail?id=${item.id}` }) @@ -117,7 +123,8 @@ @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)"> + <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"> @@ -137,7 +144,7 @@ <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="button-icons flex m-l-a m-r-0 m-t-20" v-if="dto.status=='UP'"> <view class="m-r-0 gwc" @click.stop="submitShopping(dto)"> + 购物车 </view> @@ -153,6 +160,8 @@ <style lang="scss" scoped> .page-collect { + min-height: 99vh; + .search-container { display: flex; margin: 12rpx 0rpx 20rpx 0rpx; diff --git a/sub_pages/customer/self/follow.vue b/sub_pages/customer/self/follow.vue index 93e1e86..1b9b188 100644 --- a/sub_pages/customer/self/follow.vue +++ b/sub_pages/customer/self/follow.vue @@ -70,6 +70,8 @@ <style lang="scss" scoped> .follow-page { + min-height: 99vh; + .follow-item { padding: 30rpx; background-color: #FFFFFF; diff --git a/sub_pages/customer/shop/shop.vue b/sub_pages/customer/shop/shop.vue index 166571f..8808e70 100644 --- a/sub_pages/customer/shop/shop.vue +++ b/sub_pages/customer/shop/shop.vue @@ -315,6 +315,13 @@ } if (!item.shopnum) { item.shopnum = 0 + } + if (!item.stock) { + item.stock = 0 + } + if (item.shopnum + addnum > item.stock) { + this.$message.showToast('库存不足,无法添加') + return } if (item.shopnum + addnum >= 0) { diff --git a/sub_pages/customer/shopping/confirm.vue b/sub_pages/customer/shopping/confirm.vue index 9bb416c..0827637 100644 --- a/sub_pages/customer/shopping/confirm.vue +++ b/sub_pages/customer/shopping/confirm.vue @@ -37,7 +37,7 @@ value: '' }) }) - if(this.address.id){ + if (this.address.id) { this.loadTransportList() this.cacheAddressId = this.address.id } @@ -74,6 +74,12 @@ this.loadTransportList() this.cacheAddressId = nv.id + } else if (!nv.id) { + //说明id清空了 + if (!this.cacheAddressId) { + transportList = [] + this.cacheAddressId = '' + } } } }, @@ -84,8 +90,11 @@ this.dto.specialNeeds = e.value[0].value }, async loadTransportList() { + if (this.currentInfo.customerDTO && this.currentInfo.customerDTO.partnerId) { + return + } let that = this; - console.log('address', that.address, that.cacheAddressId) + // console.log('address', that.address, that.cacheAddressId) if (that.address && that.address.id && that.cacheAddressId !== that.address.id) { that.$message.showLoading() const { @@ -107,10 +116,15 @@ }, async submitOrder() { console.log('submitOrder', this.dto) - if (!this.dto.transportId) { - this.$message.showToast('请选择配送方式') - return + if (this.currentInfo.customerDTO && this.currentInfo.customerDTO.partnerId) { + + } else { + if (!this.dto.transportId) { + this.$message.showToast('请选择配送方式') + return + } } + if (!this.address.id) { this.$message.showToast('请选择收货地址') return @@ -217,7 +231,8 @@ </view> </view> <!-- 查看商品列表,和选择运费 --> - <view class="br-4 transform-container m-t-12 p10"> + <view class="br-4 transform-container m-t-12 p10" + v-if="!currentInfo.customerDTO||!currentInfo.customerDTO.partnerId"> <view class="title"> <view>运输方式:</view> <view class="flex transform-list flex-wrap-normal"> @@ -451,13 +466,10 @@ .transform-list:nth-child(3n+2) { margin-right: 0; } - - .desc-red{ - - } - .desc{ - - } + + .desc-red {} + + .desc {} } } diff --git a/sub_pages/customer/shopping/shopping.vue b/sub_pages/customer/shopping/shopping.vue index 3ff5488..e9aaf14 100644 --- a/sub_pages/customer/shopping/shopping.vue +++ b/sub_pages/customer/shopping/shopping.vue @@ -1,6 +1,6 @@ <template> <view class="shopping-container"> - <view class="top-title"><span class="t-red">*</span> 苏州市一价全含,市区内包邮派送到店 + <view class="top-title"><span class="t-red">*</span> 花满芫报价已包含打包材料费、交易佣金 </view> <view class="top-desc"> 全程鲜花冷链专线,时效快,损耗小 @@ -29,24 +29,25 @@ <radio :checked="ids.indexOf(dto.id)>=0" @click="changeItem(dto,'flower')"></radio> <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" + <view class="title" @click.stop="toDetail(dto)"><span class="m-r-5" style="display: inline-block;">{{dto.categoryStr||''}}</span><span v-if="dto.levelStr" class="m-r-5" style="display: inline-block;">{{ dto.levelStr || '' }}</span>{{ dto.name || '-' }} </view> - <view class="price"> + <view class="price" @click.stop="toDetail(dto)"> {{ dto.price || '-' }}元/扎 </view> <view class="flex"> - <view class="desc m-t-12 flex"> + <view class="desc flex p-t-5" @click.stop="toDetail(dto)"> <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"> <uni-icons v-if="dto.num&&dto.num>=1" type="minus" size="32" - @click="addnum(dto,-1)"></uni-icons> + @click.stop="addnum(dto,-1)"></uni-icons> <view class="curnums" v-if="dto.num&&dto.num>=1">{{ dto.num }}</view> - <uni-icons type="plus-filled" size="32" @click="addnum(dto,1)"></uni-icons> + <uni-icons type="plus-filled" size="32" + @click.stop="addnum(dto,1)"></uni-icons> </view> </view> </view> @@ -197,7 +198,7 @@ break } } - console.log('this.list',this.list) + console.log('this.list', this.list) } }, @@ -244,6 +245,25 @@ //更换个人的 if (this.ids.indexOf(dto.id) < 0) { this.ids.push(dto.id) + var has = true + + //判断如果都有,那么顶部的按钮也勾选上 + for (var i = 0; i < this.list.length; i++) { + if (this.list[i].supplierId === dto.supplierId) { + for (var j = 0; j < this.list[i].flowerList.length; j++) { + if (this.ids.indexOf(this.list[i].flowerList[j].id) < 0) { + has = false + break + } + } + break + } + } + if (has) { + this.ids.push(dto.supplierId) + + } + } else { this.checkall = false @@ -258,6 +278,13 @@ if (dto.num + addnum >= 0) { } else { + return + } + if (!dto.stock) { + dto.stock = 0 + } + if (dto.num + addnum > dto.stock) { + this.$message.showToast('库存不足,无法添加') return } this.$message.showLoading() @@ -300,6 +327,11 @@ this.list = data || [] } + }, + toDetail(dto) { + uni.navigateTo({ + url: '/sub_pages/customer/trade/detail?id=' + dto.id + }) } } } diff --git a/sub_pages/customer/trade/detail.vue b/sub_pages/customer/trade/detail.vue index 12e11ce..36de112 100644 --- a/sub_pages/customer/trade/detail.vue +++ b/sub_pages/customer/trade/detail.vue @@ -5,14 +5,14 @@ <view class="icon-container"> <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)" + <image v-if="dto.collection" src="../../../static/common/icon-sc-fill.png" @click="collectItem(dto)" class="icon-sc"></image> <!-- <view class="num">12</view>--> </view> <view class="icon-container"> - <image src="../../../static/common/icon-shop.png" @click="submitShopping(dto)" class="icon-shop"> + <image src="../../../static/common/icon-shop.png" @click="toShopping(dto)" class="icon-shop"> </image> </view> @@ -185,6 +185,11 @@ this.$message.hideLoading() + }, + toShopping() { + uni.navigateTo({ + url: '/sub_pages/customer/shopping/shopping' + }) }, openbrand() { uni.navigateTo({ @@ -368,8 +373,8 @@ height: 80rpx; background: rgba(0, 0, 0, 0.42); border-radius: 50%; - display:flex; - + display: flex; + .icon-sc { width: 54rpx; height: 54rpx; diff --git a/sub_pages/customer/trade/list.vue b/sub_pages/customer/trade/list.vue index 37ef47f..74f6d23 100644 --- a/sub_pages/customer/trade/list.vue +++ b/sub_pages/customer/trade/list.vue @@ -13,7 +13,7 @@ <view class="desc"> 颜色:{{categoryInfo.color || '暂无'}} </view> - <!-- <view class="desc"> + <!-- <view class="desc"> 包袋:棉袋 </view> --> </view> @@ -21,8 +21,12 @@ <view class="title">当日均价</view> <view class="price">{{categoryInfo.avePrice||'暂无'}}</view> <view class="flex desc"> - <view class="m-l-a m-r-5">{{categoryInfo.avePriceDifference&&categoryInfo.avePriceDifference>=0?'+':''}}{{categoryInfo.avePriceDifference||0}}</view> - <view class="m-r-a m-l-5">{{categoryInfo.avePriceDifferenceRate&&categoryInfo.avePriceDifferenceRate>=0?'+':''}}{{categoryInfo.avePriceDifferenceRate||0}}%</view> + <view class="m-l-a m-r-5"> + {{categoryInfo.avePriceDifference&&categoryInfo.avePriceDifference>=0?'+':''}}{{categoryInfo.avePriceDifference||0}} + </view> + <view class="m-r-a m-l-5"> + {{categoryInfo.avePriceDifferenceRate&&categoryInfo.avePriceDifferenceRate>=0?'+':''}}{{categoryInfo.avePriceDifferenceRate||0}}% + </view> </view> </view> </view> @@ -55,8 +59,7 @@ <view class="component-shop-item flex" v-for="(item,index) of list" :key="index"> <view class="img" @click.stop="toDetail(item)"> - <image class="img img100" - :src="item.cover"> + <image class="img img100" :src="item.cover"> </image> <view class="level"> {{item.levelStr||''}} @@ -134,12 +137,14 @@ </view> <view class="button-space"></view> <view> - <view class="button-green" style="background-color: #fff;border: 2rpx solid #666; color: #666;width: 200rpx;left: 40rpx;right: unset;" + <view class="button-green" + style="background-color: #fff;border: 2rpx solid #666; color: #666;width: 200rpx;left: 40rpx;right: unset;" @click="closeParamPopAndQuery"> 查询 </view> - - <view class="button-green" style="width: 200rpx;right: 40rpx;left: unset;" @click="closeParamPop">关闭</view> + + <view class="button-green" style="width: 200rpx;right: 40rpx;left: unset;" @click="closeParamPop">关闭 + </view> </view> </view> </uni-popup> @@ -185,9 +190,9 @@ this.query.category = options.categoryId || '' this.query.zoneId = options.zoneId || '' this.query.name = options.name || '' - if(this.query.name){ + if (this.query.name) { uni.setNavigationBarTitle({ - title:'商品列表-'+this.query.name + title: '商品列表-' + this.query.name }) } this.listApi = '/api/customer/flower/list' @@ -289,7 +294,7 @@ }, select_level(e) { this.level_show = false - console.log('select_level',e) + console.log('select_level', e) this.query.levelStr = e.value[0].label this.query.level = e.value[0].value this.refreshList('post') @@ -323,9 +328,17 @@ }) return } - if (!item.shopnum) { - item.shopnum = 0 + if (!item.stock) { + item.stock = 0 + } + if (!item.shopnum) { + item.shopnum = 0 } + if (item.shopnum + addnum > item.stock) { + this.$message.showToast('库存不足,无法添加') + return + } + if (item.shopnum + addnum >= 0) { } else { diff --git a/sub_pages/customer/trade/trade.vue b/sub_pages/customer/trade/trade.vue index 275455e..bffd115 100644 --- a/sub_pages/customer/trade/trade.vue +++ b/sub_pages/customer/trade/trade.vue @@ -47,12 +47,7 @@ <view class="price">¥29.01-30.01</view> <view class="desc">在售14410扎</view> - <!-- <view class="icons flex"> - <uni-icons v-if="item.shopnum&&item.shopnum>=1" type="minus" size="32" - @click="mulnum(item)"></uni-icons> - <view class="curnums" v-if="item.shopnum&&item.shopnum>=1">{{item.shopnum}}</view> - <uni-icons type="plus-filled" size="32" @click="addnum(item)"></uni-icons> - </view> --> + </view> </view> -- Gitblit v1.9.3