From 883ca635ebb2df1ccb9e7f6dc19a88c7ad374cb6 Mon Sep 17 00:00:00 2001
From: xuxueyang <xuxy@fengyuntec.com>
Date: 星期日, 21 七月 2024 14:47:00 +0800
Subject: [PATCH] update 部分需求变更
---
pages/login/supplier-login.vue | 14 +++
sub_pages/supplier/supplier-info/supplier-info.vue | 23 +----
sub_pages/supplier/flower-manage/flower-add.vue | 33 +++++--
common/global.scss | 1
pages/login/supplier-reg.vue | 43 ++++++++++
sub_pages/partner/partner-info/partner-info.vue | 97 +++++++++++++++++++-----
6 files changed, 157 insertions(+), 54 deletions(-)
diff --git a/common/global.scss b/common/global.scss
index 0523aa9..6d1fdc5 100644
--- a/common/global.scss
+++ b/common/global.scss
@@ -77,6 +77,7 @@
margin: 0 auto;
margin-top: 160rpx;
height: calc(100vh - 300rpx);
+ overflow-y: scroll;
background-color: #fff;
border-radius: 40rpx 40rpx 0rpx 0rpx;
padding: 26rpx;
diff --git a/pages/login/supplier-login.vue b/pages/login/supplier-login.vue
index 52303aa..5a982d2 100644
--- a/pages/login/supplier-login.vue
+++ b/pages/login/supplier-login.vue
@@ -172,9 +172,19 @@
// uni.switchTab({
// url: '/pages/index/index'
// })
- uni.redirectTo({
- url: '/pages/login/supplier-reg'
+ var addstr = ''
+ // #ifdef PUB_PARTNER
+ addstr = '?source=step'
+ uni.redirectTo({
+ url: '/sub_pages/partner/partner-info/partner-info' + addstr
})
+ // #endif
+ // #ifdef PUB_SUPPLIER
+ uni.redirectTo({
+ url: '/pages/login/supplier-reg'
+ })
+ // #endif
+
},
changeAll(e) {
diff --git a/pages/login/supplier-reg.vue b/pages/login/supplier-reg.vue
index 5068173..f00fa03 100644
--- a/pages/login/supplier-reg.vue
+++ b/pages/login/supplier-reg.vue
@@ -85,6 +85,7 @@
getCodeisWaiting: false,
Timer: undefined,
protocal: false,
+ source: '',
// #ifdef PUB_SUPPLIER
apitype: 'supplier',
// #endif
@@ -93,6 +94,9 @@
// #endif
};
+ },
+ onLoad(options) {
+ this.source = options.source || ''
},
methods: {
toProtocol() {
@@ -230,9 +234,42 @@
title: '注册成功!',
icon: 'none'
});
- setTimeout(() => {
- this.toLogin()
- }, 1000);
+ if (this.source == 'step') {
+ // cache_partner_info
+ var tjson = this.$storage.getItem('cache_partner_info')
+ if (tjson) {
+ var dto = JSON.parse(tjson)
+ {
+
+ this.$message.showLoading()
+ const re = await this.$http.request('post', '/api/partner/addOrUpdate', {
+ data: dto
+ })
+ this.$message.hideLoading()
+ if (re.code == 2000 || re.code == 0) {
+ this.toLogin()
+ } else {
+ this.$message.showToast('合伙人信息失效,请登录后重新填写提交审核')
+ setTimeout(() => {
+ this.toLogin()
+ }, 1000);
+ }
+ }
+ }
+
+ }else{
+ this.$message.showToast('合伙人信息失效,请登录后重新填写提交审核')
+ setTimeout(() => {
+ this.toLogin()
+ }, 1000);
+ }
+
+ } else {
+ setTimeout(() => {
+ this.toLogin()
+ }, 1000);
+ }
+
} else {
// uni.showToast({
diff --git a/sub_pages/partner/partner-info/partner-info.vue b/sub_pages/partner/partner-info/partner-info.vue
index efa38ec..f4e5bf0 100644
--- a/sub_pages/partner/partner-info/partner-info.vue
+++ b/sub_pages/partner/partner-info/partner-info.vue
@@ -17,7 +17,17 @@
</view>
</view>
-
+ <view class="form-item before-line">
+ <view class="label required">集货站</view>
+ <view class="m-l-a m-r-0 flex " :class="[!dto.stationId?'desc-gray':'']" @click="()=>{
+ if(!id){
+ show_select_station=true
+ }
+ }">
+ <view>{{dto.stationName || '请选择'}}</view>
+ <u-icon class="m-l-a" name="arrow-right"></u-icon>
+ </view>
+ </view>
<view class="form-item before-line">
<view class="label required">地区</view>
@@ -65,7 +75,7 @@
<view class="button-green-1 m-t-20 button-fixed-bottom before-line " @click="submit">
- 提交审核
+ {{source==='step'?'下一步':'提交审核'}}
</view>
</view>
@@ -73,6 +83,8 @@
<view style="min-height: 200rpx;">
</view>
+ <u-picker @confirm="select_station" keyName="name" @cancel="show_select_station=false"
+ :show="show_select_station" :columns="columns_station"></u-picker>
</view>
@@ -91,11 +103,14 @@
return {
id: '',
refresh: false,
+ source: '',
api: '',
dto: {
idCards: [],
address: '',
id: '',
+ stationId: '',
+ stationName: '',
userId: '',
name: '',
contactTel: '',
@@ -114,6 +129,10 @@
key: 'contactTel'
},
{
+ name: '集货站',
+ key: 'stationId'
+ },
+ {
name: '地区',
key: 'province'
},
@@ -123,21 +142,47 @@
},
],
regionDataPlus: [],
+ show_select_station:false,
+ columns_station:[],
}
},
onLoad(options) {
+ this.source = options.source || ''
+ this.$http.request('get', '/api/station/list', {
+ params: {}
+ }).then(res => {
+ var data = res.data
+ this.columns_station = [data || []]
+ })
if (options.id) {
this.id = options.id
this.getDetail()
} else {
- this.getCurrentInfo()
+ //判断是不是来自登录步骤,是等话需要从缓存里面拿信息
+ if (this.source == 'step') {
+ var tjson = this.$storage.getItem('cache_partner_info')
+ if (tjson) {
+ this.dto = {
+ ...this.dto,
+ ...JSON.parse(tjson)
+ }
+ }
+ } else {
+ this.getCurrentInfo()
+ }
this.init_area()
}
+
},
methods: {
+ select_station(e) {
+ this.show_select_station = false
+ this.dto.stationName = e.value[0].name
+ this.dto.stationId = e.value[0].id
+ },
PickArea(item, e) {
console.log('PickArea', item, e)
if (e.detail.value) {
@@ -248,29 +293,41 @@
}
await this.$message.confirm(`是否确定提交/修改信息`)
+ if (this.source === 'step') {
+ //先保存下来,进入下一步,然后注册成功后再保存
+ this.$storage.setItem("cache_partner_info", JSON.stringify({
+ ...this.dto
+ }))
- var dto = {
- ...this.dto,
- }
- this.$message.showLoading()
- const re = await this.$http.request('post', '/api/partner/addOrUpdate', {
- 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')
+ uni.redirectTo({
+ url: '/pages/login/supplier-reg?source=step'
+ })
- this.backpage()
} else {
- console.log('error re', re)
- if (re.code === 30000 && Array.isArray(re.msg)) {
- this.$message.showToast('字段未填写完整')
+ var dto = {
+ ...this.dto,
+ }
+ this.$message.showLoading()
+ const re = await this.$http.request('post', '/api/partner/addOrUpdate', {
+ 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) {
diff --git a/sub_pages/supplier/flower-manage/flower-add.vue b/sub_pages/supplier/flower-manage/flower-add.vue
index 2093dca..e1cedd5 100644
--- a/sub_pages/supplier/flower-manage/flower-add.vue
+++ b/sub_pages/supplier/flower-manage/flower-add.vue
@@ -95,6 +95,16 @@
</view>
</view>
<view class="line-gray-big"></view>
+ <view class="form-item before-line">
+ <view class="label required">商品等级</view>
+ <view class="m-l-a m-r-0 flex " :class="[!dto.level?'desc-gray':'']" @click="()=>{
+ show_select_level=true
+ }">
+ <view>{{dto.levelStr||dto.level || '请选择'}}</view>
+ <u-icon class="m-l-a" name="arrow-right"></u-icon>
+ </view>
+
+ </view>
<view class="form-item before-line">
@@ -134,16 +144,6 @@
</view>
<view class="line-gray-big"></view>
- <view class="form-item before-line">
- <view class="label required">商品等级</view>
- <view class="m-l-a m-r-0 flex " :class="[!dto.level?'desc-gray':'']" @click="()=>{
- show_select_level=true
- }">
- <view>{{dto.levelStr||dto.level || '请选择'}}</view>
- <u-icon class="m-l-a" name="arrow-right"></u-icon>
- </view>
-
- </view>
<view class="form-item before-line">
@@ -159,6 +159,18 @@
<view v-if="dto.video">
<video :src="dto.video" style="display: block;margin: 0 auto;"></video>
</view>
+ <view class="form-item ">
+ <view class="label required">商品描述</view>
+ <view class="m-l-a m-r-0 flex">
+ <!-- <u-input type="textarea" v-model="dto.description" placeholder="请输入商品描述" type="number"
+ ></u-input> -->
+ <u--textarea v-model="dto.description" style="margin-top: 16px;text-align: right;"
+ placeholder="请输入商品描述"></u--textarea>
+
+ </view>
+ </view>
+
+
<view style="min-height: 200rpx;">
@@ -228,6 +240,7 @@
price: '',
stock: '',
params: [], //id,value
+ description: '',
},
requireFields: [{
name: '商品分类',
diff --git a/sub_pages/supplier/supplier-info/supplier-info.vue b/sub_pages/supplier/supplier-info/supplier-info.vue
index c4a3c95..67e3878 100644
--- a/sub_pages/supplier/supplier-info/supplier-info.vue
+++ b/sub_pages/supplier/supplier-info/supplier-info.vue
@@ -72,14 +72,6 @@
<view>{{dto.stationName || '请选择'}}</view>
<u-icon class="m-l-a" name="arrow-right"></u-icon>
</view>
- <!-- <view class="m-l-a m-r-0 flex " :class="[!dto.stationId?'desc-gray':'']">
- <uni-data-picker @change="(e)=>{PickData('stationId','stationStr',e)}" placeholder="请选择"
- :localdata="columns_station">
- {{dto.typeStr || '请选择'}}
- </uni-data-picker>
- <u-icon class="m-l-a" name="arrow-right"></u-icon>
- </view> -->
-
</view>
<view class="form-item before-line">
<view class="label required">地区</view>
@@ -291,13 +283,6 @@
}).then(res => {
var data = res.data
this.columns_station = [data || []]
- // this.columns_station = (data || []).map(item => {
- // return {
- // ...item,
- // code: item.id,
- // text: item.name,
- // }
- // })
})
//类型和集火站
this.$http.request('get', '/api/supplier/type/list', {
@@ -509,10 +494,10 @@
tempFiles
}) {
if (errMsg === 'chooseImage:ok') {
- // console.log(tempFiles[0])
- if (tempFiles[0].size > 1024 * 1024 * 5) {
- that.$message.confirm('图片最多支持5M大小,超出大小限制')
- return
+ // 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 => {
--
Gitblit v1.9.3