From 7a89892d6ac9c181febed610b62f1aeb8145099b Mon Sep 17 00:00:00 2001 From: xuxueyang <xuxy@fengyuntec.com> Date: 星期六, 03 八月 2024 06:58:48 +0800 Subject: [PATCH] update --- sub_pages/supplier/supplier-info/supplier-info.vue | 4 pages/home/components/home-search.vue | 17 ++ pages/home/home.vue | 9 sub_pages/partner/delivery/station-delivery.vue | 2 sub_pages/supplier/supplier-info/supplier-info-update.vue | 336 ++++++++++++++++++++++++++++++++++++++++++++++++ sub_pages/partner/delivery/delivery.vue | 11 + pages.json | 6 sub_pages/customer/trade/trade.vue | 2 pages/user/supplier-user.vue | 11 + 9 files changed, 384 insertions(+), 14 deletions(-) diff --git a/pages.json b/pages.json index e292dca..3b2fb96 100644 --- a/pages.json +++ b/pages.json @@ -158,6 +158,12 @@ ,{ "path": "supplier-info/supplier-info", "style": { + "navigationBarTitleText": "店铺信息维护", + "enablePullDownRefresh": false + } + },{ + "path": "supplier-info/supplier-info-update", + "style": { "navigationBarTitleText": "信息维护", "enablePullDownRefresh": false } diff --git a/pages/home/components/home-search.vue b/pages/home/components/home-search.vue index aaa32e2..145c14e 100644 --- a/pages/home/components/home-search.vue +++ b/pages/home/components/home-search.vue @@ -8,9 +8,15 @@ </template> </u-input> </view> + </view> <view class="m-t-12"> - <view class="title">搜索历史</view> + <view class="title flex"> + <view class="m-l-0 m-r-a">搜索历史</view> + <view class="bg-white desc-gray text-center m-l-a m-r-0" @click.stop="clearHistory"> + 一键清空 + </view> + </view> <view class="m-t-12 flex flex-wrap-normal history-item-list"> <view class="history-item" v-for="item of history" :key="item" @click="searchBy(item)"> {{item}} @@ -37,16 +43,25 @@ }, methods: { buttonSearchFlow() { + var name = this.search_flow if (this.history.indexOf(name) >= 0) { this.history.splice(this.history.indexOf(name), 1) } this.history.unshift(name) + if (this.history.length >= 10) { + this.history.splice(this.history.length - 1, 1) + } console.log('buttonSearchFlow') uni.navigateTo({ url: '/sub_pages/customer/trade/list?name=' + this.search_flow }) }, + async clearHistory() { + await this.$message.confirm('是否清空历史记录') + this.history = [] + this.$storage.setItem("cache_home_search", JSON.stringify(this.history)) + }, searchBy(name) { if (this.history.indexOf(name) >= 0) { this.history.splice(this.history.indexOf(name), 1) diff --git a/pages/home/home.vue b/pages/home/home.vue index 7e40797..900bce8 100644 --- a/pages/home/home.vue +++ b/pages/home/home.vue @@ -19,11 +19,12 @@ </view> </view> </view> - <view class="search-container m-t-12 flex"> + <view class="search-container m-t-12 flex" @click="goto('/pages/home/components/home-search',false)"> <view class="flex1 input"> - <u-input placeholder="请输入花名" v-model="search_flow"> - <template slot="suffix"> - <uni-icons color="#20613D" type="search" size="24" @click="buttonSearchFlow"></uni-icons> + <u-input placeholder="请输入花名" disabled v-model="search_flow"> + <template slot="suffix"> + <!-- @click="buttonSearchFlow" --> + <uni-icons color="#20613D" type="search" size="24" ></uni-icons> </template> </u-input> </view> diff --git a/pages/user/supplier-user.vue b/pages/user/supplier-user.vue index c9da5b7..f6eb393 100644 --- a/pages/user/supplier-user.vue +++ b/pages/user/supplier-user.vue @@ -180,7 +180,7 @@ <uni-icons type="right"></uni-icons> </view> </view> - <!-- <view class="user-util m-t-12 flex" v-if="selftype==='partner'" + <!-- <view class="user-util m-t-12 flex" v-if="selftype==='partner'" @click="goto('/sub_pages/partner/partner-info/partner-code-v2',true)"> <view class="title">测试二维码</view> <view class="right-icon"> @@ -198,7 +198,14 @@ </view> </view> <!-- #endif --> - + <view class="user-util m-t-12 flex" + v-if="selftype==='supplier'&¤tInfo&¤tInfo.id&¤tInfo.supplierDTO&¤tInfo.supplierDTO.status==='P'" + @click="goto('/sub_pages/supplier/supplier-info/supplier-info-update',true)"> + <view class="title">信息维护</view> + <view class="right-icon"> + <uni-icons type="right"></uni-icons> + </view> + </view> <view class="user-util m-t-12 flex" v-if="selftype==='supplier'" @click="goto('/sub_pages/supplier/supplier-info/supplier-info',true)"> <view class="title">店铺信息</view> diff --git a/sub_pages/customer/trade/trade.vue b/sub_pages/customer/trade/trade.vue index 61d8823..0473b66 100644 --- a/sub_pages/customer/trade/trade.vue +++ b/sub_pages/customer/trade/trade.vue @@ -46,7 +46,7 @@ <view class="cateen_infos list"> <view class="title">{{item.name}}</view> <view class="price">¥{{item.priceLow || 0}}-{{item.priceHigh||0}}</view> - <view class="desc">在售 {{item.stock||'0'}} 扎</view> + <view class="desc" v-if="item.stock">在售 {{item.stock||'0'}} 扎</view> </view> diff --git a/sub_pages/partner/delivery/delivery.vue b/sub_pages/partner/delivery/delivery.vue index a2ae2d3..1721d5d 100644 --- a/sub_pages/partner/delivery/delivery.vue +++ b/sub_pages/partner/delivery/delivery.vue @@ -117,19 +117,24 @@ </template> </u-input> </view> + <view class="component-filter-container p10 bg-white m-l-10"> + <view class="flex1" @click="show_select_status=true"> + 配送单状态:{{ query.statusStr || '全部' }} + <image src="../../../static/common/icon-arrow-down.png" class="icon-arrow-down"></image> + </view> + </view> </view> - <view class="component-filter-container p20 bg-white"> + <!-- <view class="component-filter-container p20 bg-white"> <view class="flex1" @click="show_select_status=true"> 配送单状态:{{ query.statusStr || '全部' }} <image src="../../../static/common/icon-arrow-down.png" class="icon-arrow-down"></image> </view> - <!-- @click="show_select_station=true" --> <view class="flex1"> 集货站:{{ query.stationName || '全部' }} <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> <view v-for="(item,index) in list" :key="index" class="m-b-24"> diff --git a/sub_pages/partner/delivery/station-delivery.vue b/sub_pages/partner/delivery/station-delivery.vue index 574bb7e..d1289dc 100644 --- a/sub_pages/partner/delivery/station-delivery.vue +++ b/sub_pages/partner/delivery/station-delivery.vue @@ -39,7 +39,7 @@ toDetail(item) { uni.navigateTo({ - url: `/sub_pages/partner/delivery/delivery-detail?stationId=${item.stationId}&stationName=${item.name}` + url: `/sub_pages/partner/delivery/delivery?stationId=${item.stationId}&stationName=${item.name}` }) }, } diff --git a/sub_pages/supplier/supplier-info/supplier-info-update.vue b/sub_pages/supplier/supplier-info/supplier-info-update.vue new file mode 100644 index 0000000..e76b144 --- /dev/null +++ b/sub_pages/supplier/supplier-info/supplier-info-update.vue @@ -0,0 +1,336 @@ +<template> + <view class="container-page"> + <view> + <view class="form-item "> + <view class="label required">店铺名称</view> + <view class="m-l-a m-r-0 flex"> + <input v-model="dto.name" placeholder="请输入店铺名称" style="margin-top: 16px;text-align: right;"></input> + + </view> + </view> + <view class="form-item bottom-border-no"> + <view class="label required" style="width: 360rpx;min-width: 360rpx;font-size: 28rpx;">店铺头像(推荐80*80px)</view> + <view class="m-l-a m-r-0 flex m-t-20 m-b-20"> + <view class="component-button-upload" @click="uploadIcon('cover')"> + + </view> + </view> + </view> + <view v-if="dto.cover"> + <view class="flex p20 form-item bottom-border-no" style="padding-top: 0rpx;padding-bottom: 10rpx"> + <view class="m-r-10 "> + <image class="banner-img" :src="dto.cover" @click.stop="previewImg(dto.cover)"> + + </image> + <view class="t-red text-center" @click.stop="deleteImg('cover','')">删除</view> + </view> + </view> + </view> + <u-divider></u-divider> + + + + <view class="form-item before-line"> + <view class="label required">店铺简介</view> + </view> + <view class="flex"> + <u--textarea v-model="dto.description" placeholder="请输入店铺简介"></u--textarea> + </view> + + + + + + + <view class="button-green-1 m-t-20 button-fixed-bottom before-line " @click="submit"> + 更改信息 + </view> + + + + </view> + + <view style="min-height: 200rpx;"> + + </view> + + + </view> +</template> + +<script> + export default { + + + + data() { + return { + id: '', + refresh: false, + api: '', + dto: { + id: '', + pictures: [], + idCards: [], + cover: '', + idcardType: '1', + description: '', + address: '', + stationId: '', + stationName: '', + id: '', + userId: '', + name: '', + typeId: '', + typeName: '', + contactName: '', + contactTel: '', + province: '', + city: '', + region: '', + }, + requireFields: [{ + name: '店铺名称', + key: 'name' + }, + { + name: '店铺头像', + key: 'cover' + }, + + { + name: '店铺简介', + key: 'description' + } + ], + } + + }, + + + onLoad() { + + this.getCurrentInfo() + + + }, + + methods: { + + + async getCurrentInfo() { + this.$message.showLoading() + const { + code, + data + } = await this.$http.request('get', "/api/current/supplier", {}) + if (code == 0) { + this.dto = { + ...data, + + } + if (!this.dto.pictures) { + this.dto.pictures = [] + } else if (typeof this.dto.pictures == 'string') { + this.dto.pictures = JSON.parse(this.dto.pictures) + } + if (!this.dto.idCards) { + this.dto.idCards = [] + } else if (typeof this.dto.idCards == 'string') { + this.dto.idCards = JSON.parse(this.dto.idCards) + } + if (!this.dto.idcardType) { + this.dto.idcardType = '1' + } + this.dto.userId = this.currentInfo.id + + } + + this.$message.hideLoading() + }, + + async submit() { + for (var field of this.requireFields) { + if (!this.dto[field.key]) { + this.$message.showToast(`${field.name}信息未填写`) + return + } + } + + + + await this.$message.confirm(`是否确定修改店铺部分信息`) + + + var dto = { + ...this.dto, + } + this.$message.showLoading() + const re = await this.$http.request('post', '/api/supplier/update/info', { + data: dto + }) + this.$message.hideLoading() + if (re.code == 2000 || re.code == 0) { + this.$message.showToast('操作成功') + //需要标记加一下 + this.$store.dispatch('sign_add', 'info'); + this.$store.dispatch('getCurrentInfo') + + this.backpage() + } else { + console.log('error re', re) + if (re.code === 30000 && Array.isArray(re.msg)) { + this.$message.showToast('字段未填写完整') + + } + } + }, + + async deleteImg(key, index) { + await this.$message.confirm('是否确认删除此图片') + if (Array.isArray(this.dto[key])) { + this.dto[key].splice(index, 1) + + } else { + this.dto[key] = '' + } + this.$forceUpdate() + }, + uploadIcon(key) { + const that = this + uni.chooseImage({ + count: 1, // 最多可以选择的图片张数,默认9 + sizeType: ['original', 'compressed'], //original 原图,compressed 压缩图,默认二者都有 + sourceType: ['camera', 'album'], //album 从相册选图,camera 使用相机,默认二者都有。如需直接开相机或直接选相册,请只使用一个选项 + success: function({ + errMsg, + tempFiles + }) { + if (errMsg === 'chooseImage:ok') { + // console.log(tempFiles[0]) + if (tempFiles[0].size > 1024 * 1024 * 5) { + that.$message.confirm('图片最多支持5M大小,超出大小限制') + return + } + that.$message.showLoading() + that.$http.upload(tempFiles[0].path).then(async res => { + var pic = res.data && res.data.length > 0 && res.data[ + 0] || {} + that.$message.hideLoading() + if (Array.isArray(that.dto[key])) { + that.dto[key].push(pic || '') + + } else { + that.dto[key] = (pic || {}).url || '' + + } + that.$forceUpdate() + }).catch(res => { + that.$message.hideLoading() + + }) + } + } + }) + }, + + }, + + } +</script> + +<style lang="scss" scoped> + .banner-img { + width: 96rpx; + height: 96rpx; + border-radius: 4rpx; + border: 2rpx dashed #CECECE; + } + + .form-item { + // padding: 40rpx; + border-bottom: 2rpx solid #F3F3F3; + display: flex; + // height: 100px; + + .label { + width: 300rpx; + line-height: 60px; + + } + + .flex { + line-height: 60px; + + .flex1 { + flex: 1; + text-align: center; + color: var(--selfblue) + } + + + } + } + + .form-item.bottom-border-no { + border-bottom: none; + } + + .container-page { + padding: 40rpx; + background-color: #FFFFFF; + // min-height: calc(100vh - 80rpx); + min-height: 100vh; + } + + .style { + width: fit-content; + margin: 0 auto; + line-height: 64rpx; + border-radius: 8rpx; + padding-left: 20rpx; + padding-right: 20rpx; + // padding-top: 5rpx; + // padding-bottom: 5rpx; + border: 2rpx solid var(--selfblue); + background-color: var(--selfbluebg); + min-width: 100rpx; + } + + + .style-1 { + border: 1px solid rgb(122, 187, 255); + border: 1px solid #409EFF; + color: #409EFF; + background-color: rgb(240, 247, 255); + } + + .style-2 { + border: 1px solid rgb(255, 184, 78); + border: 1px solid #FE9044; + color: #FE9044; + background-color: rgb(255, 247, 235); + } + + .style-3 { + border: 1px solid #19be6b; + color: #19be6b; + background-color: rgb(231, 244, 238); + } + + .style-4 { + border: 1px solid #F56c6c; + color: #F56c6c; + background-color: rgb(254, 243, 243); + } + + /deep/ { + .evan-radio-group { + display: flex; + } + + .evan-radio { + margin-right: 12rpx; + } + } +</style> \ No newline at end of file diff --git a/sub_pages/supplier/supplier-info/supplier-info.vue b/sub_pages/supplier/supplier-info/supplier-info.vue index fe588df..2427a8c 100644 --- a/sub_pages/supplier/supplier-info/supplier-info.vue +++ b/sub_pages/supplier/supplier-info/supplier-info.vue @@ -27,7 +27,7 @@ </view> </view> <view class="form-item bottom-border-no"> - <view class="label required" style="width: 360rpx;">店铺头像(推荐80*80px)</view> + <view class="label required" style="width: 360rpx;min-width: 360rpx;font-size: 28rpx;">店铺头像(推荐80*80px)</view> <view class="m-l-a m-r-0 flex m-t-20 m-b-20"> <view class="component-button-upload" @click="uploadIcon('cover')"> @@ -179,7 +179,7 @@ <view class="button-green-1 m-t-20 button-fixed-bottom before-line " style="font-size: 22rpx;" v-if="currentInfo.supplierDTO&¤tInfo.supplierDTO.status==='P'"> - 审核已通过,若修改信息请联系客服 + 审核已通过,部分信息请前往个人资料修改 </view> <view class="button-green-1 m-t-20 button-fixed-bottom before-line " v-else @click="submit"> -- Gitblit v1.9.3