删除商品 查询商品一键上传页面逻辑处理

version/0412
fanfan 1 year ago
parent 13f0581736
commit e07618f8a4
  1. 4
      api/address.js
  2. 1
      pages/invoice/index.vue
  3. 12
      pages/news/goods/batchdel.vue
  4. 494
      pages/news/goods/classify.vue
  5. 344
      pages/news/goods/list.vue
  6. 745
      pages/news/goods/oneGrounding.vue
  7. 139
      pages/news/park/addressEdit.vue
  8. 66
      pages/news1/MerchantSettlement.vue
  9. 867
      pages/news1/feedback.vue
  10. 4
      pages/news1/setting.vue
  11. 25
      pages/news3/ManualEntry.vue

@ -51,3 +51,7 @@ export const remove = (addressId) => {
export const analysis = (content) => { export const analysis = (content) => {
return request.get(api.analysis, { content }) return request.get(api.analysis, { content })
} }
// 省市区
export const province = (param) => {
return request.get('region/tree', param)
}

@ -29,7 +29,6 @@
<view class="invoice-fd" @click="onAddInvoice"> <view class="invoice-fd" @click="onAddInvoice">
<text>+</text>添加发票抬头 <text>+</text>添加发票抬头
</view> </view>
<view v-if="!invoicList.length">暂无相关信息</view>
</view> </view>
</template> </template>

@ -117,6 +117,14 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
::v-deep .u-input,
::v-deep .u-content {
background-color: #fff !important;
}
::v-deep .u-search {
width: 640rpx !important;
}
.goods{ .goods{
padding: 0 0 130rpx; padding: 0 0 130rpx;
overflow: hidden; overflow: hidden;
@ -153,7 +161,7 @@
box-sizing: border-box; box-sizing: border-box;
display: flex; display: flex;
align-items: center; align-items: center;
background: #F3F3F3; background: #fff;
border-radius: 60rpx; border-radius: 60rpx;
image{ image{
width: 28rpx; width: 28rpx;
@ -239,7 +247,7 @@
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
margin-top: 10rpx; margin-top: 20rpx;
.price{ .price{
font-size: 32rpx; font-size: 32rpx;
font-weight: 400; font-weight: 400;

@ -2,204 +2,290 @@
<view class="goods"> <view class="goods">
<view class="goods-hd"> <view class="goods-hd">
<view class="item"> <view class="item">
<view class="a">分类名称</view> <view class="a">商品名称<text>*</text></view>
<view class="b" @click="openPage(1)"> <view class="b">
<view class="select">请选择分类名称<u-icon name="arrow-right"></u-icon></view> <input type="text" v-model="form.goods_name" placeholder="请输入商品名称" />
</view> </view>
</view> </view>
<view class="item"> <view class="item">
<view class="a">商品分类</view> <view class="a">商品分类<text>*</text></view>
<view class="b"> <view class="b" style="width: 350rpx;height: 40rpx;text-align: right;" >
<view class="select select-on">顶级分类</view> <picker @change="changeMode" mode="selector" placeholder="请选择分类" style="width: 350rpx;height: 40rpx;" range-key="text" :value="index" :range="modeList">
{{form.goods_class}}</picker>
</view> </view>
</view> </view>
<view class="items"> <view class="itemImg">
<view class="a">分类照片<text>*</text></view> <view class="a">分类照片<text>*</text></view>
<view class="c"> <view class="c">
<u-upload :action="action" width="180" height="180" :file-list="fileList" :custom-btn="true" max-count="8"> <u-upload :action="action" :header="header" @on-uploaded="success" width="180" height="180"
:file-list="fileList" :custom-btn="true" max-count="6">
<template v-slot:addBtn> <template v-slot:addBtn>
<view class="slot-btn" hover-class="slot-btn__hover" hover-stay-time="150"> <view class="slot-btn" hover-class="slot-btn__hover" hover-stay-time="150">
<image src="/static/news/icon-upload.png"></image> <image :src="$picUrl+'/static/news/icon-upload.png'"></image>
<view class="1">上传图片</view> <view class="1">上传图片</view>
<view class="l">1/8</view>
</view> </view>
</template> </template>
</u-upload> </u-upload>
</view> </view>
</view> </view>
<view class="items"> <view class="item-status">
<view class="a" style="justify-content: space-between;">状态<u-switch v-model="checked" active-color="#55BD6A" ></u-switch></view> <view class="item" style="border: none;padding-top: 0;">
<view class="b"> <view class="a">状态</view>
<view class="b">
<u-switch v-model="form.checked" active-color="#55BD6A"></u-switch>
</view>
</view>
<view class="c">
用户端是否显示 用户端是否显示
</view> </view>
</view> </view>
<view class="items"> <view class="item">
<view class="a">排序<text>*</text><view class="input"><input type="text" placeholder="数字越小越靠前"/></view></view> <view class="a">排序<text>*</text></view>
<view class="d">1</view> <view class="b">
<input type="number" v-model="form.goods_sort" placeholder="请输入排序" />
</view>
</view> </view>
</view> </view>
<view class="goods-fd"> <view class="goods-fd">
<view class="btn">确认</view> <view class="btn" @click="onSubmit">确认</view>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import Config from '@/core/config'
export default { export default {
data() { data() {
return { return {
fileList: [ fileList: [],
{ form: {
url: 'http://pics.sc.chinaz.com/files/pic/pic9/201912/hpic1886.jpg', image_id: [],
} goods_type: '',
], goods_class: '',
isShow: false, checked: false,
checked: false, goods_sort: '',
goods_name:'',
},
modeList: [{
text: '店内现货',
id: 0,
}, {
text: '仓库发货',
id: 1,
}],
value: "", value: "",
popupType: 1, action: '',
tabLIndex: 0, header: '',
tabRIndex: 0,
tabMIndex: 0,
tabMIndex1: 0
}; };
}, },
onReady() {
this.action = (Config.get('apiUrl') + 'upload/image').replace("index.php?s=/", "")
this.header = {
'Storeid': uni.getStorageSync('Store').storeInfo.store_id,
'Access-Token': uni.getStorageSync('AccessToken'),
'platform': "MP-WEIXIN",
}
},
methods: { methods: {
openPage(i){ //
if(i<= 3){ async onSubmit() {
this.isShow = true; const that = this;
this.popupType=i if (!that.form.goods_name) {
}else if(i == 4){ return that.$toast('请输入商品名称')
uni.navigateTo({ }
url: "/pages/news/goods/classification" if (!that.form.goods_class) {
return that.$toast('请选择商品分类')
}
if (!that.form.image_id) {
return that.$toast('请上传分类图片')
}
if (!that.form.goods_sort) {
return that.$toast('请输入商品排序')
}
let {
status,
message,
data
} = await newFunApi.addTransfer(that.form);
if (status == 200) {
uni.showToast({
title: "录入成功"
}) })
setTimeout(function() {
uni.$emit('refreshData');
uni.navigateBack({
delta: 1
})
}, 2000);
} }
}, },
tabLItem(i){ //
this.tabLIndex = i changeMode(e) {
console.log(this.tabLIndex) this.form.goods_class = this.modeList[e.detail.value].text;
this.form.goods_type = this.modeList[e.detail.value].id;
}, },
tabRItem(i){ //
this.tabRIndex = i success(list) {
console.log(this.tabRIndex) if (list.length > 0) {
}, const {
tabMItem(i){ response
this.tabMIndex = i } = list[0];
console.log(this.tabMIndex) if (response.status == 200) {
}, uni.showToast({
tabMItem1(i){ title: "上传成功"
this.tabMIndex1 = i })
console.log(this.tabMIndex1) let idList = []
list.forEach(item => {
idList.push(item.response.data.fileInfo.file_id)
});
this.form.image_id = idList.join(',');
}
}
}, },
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.goods{ .goods {
padding: 0 0 130rpx; padding: 0 0 20rpx;
overflow: hidden;
&-hd{
background-color: #fff;
padding: 0 25rpx 0;
overflow: hidden; overflow: hidden;
margin-bottom: 20rpx;
.item{ .c {
padding: 20rpx 30rpx; padding-top: 20rpx;
line-height: 50rpx; overflow: hidden;
font-size: 28rpx;
color: #212121; .slot-btn {
display: flex; width: 180rpx;
align-items: center; height: 180rpx;
justify-content: space-between; background: #F6F6F6;
border-bottom: 1px solid #F7F7F7; border-radius: 10rpx;
.a{ border: 1px solid #C0C0C0;
text{ text-align: center;
font-size: 28rpx;
font-weight: 500;
color: #6D6D6D;
.l {
line-height: 30rpx;
}
image {
width: 50rpx;
height: 50rpx;
display: block;
margin: 0 auto;
margin-top: 30rpx;
}
}
}
&-hd {
margin-top: 12rpx;
background-color: #fff;
padding: 0 36rpx 0;
overflow: hidden;
.itemImg {
padding: 25rpx 10rpx;
border-bottom: 1px solid #F7F7F7;
text {
color: #F34A40; color: #F34A40;
margin-left: 5rpx; margin-left: 5rpx;
} }
} }
.b{
.item-status {
padding: 25rpx 10rpx;
border-bottom: 1px solid #F7F7F7;
.c {
font-family: PingFang SC, PingFang SC;
font-weight: 400;
font-size: 24rpx;
color: #C7C7C7;
line-height: 28rpx;
text-align: left;
font-style: normal;
text-transform: none;
}
}
.item {
padding: 25rpx 10rpx;
line-height: 50rpx;
font-size: 28rpx; font-size: 28rpx;
color: #212121; color: #212121;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: flex-end; justify-content: space-between;
flex: 1; border-bottom: 1px solid #F7F7F7;
input{
font-size: 28rpx; .a {
color: #212121; text {
flex: 1; color: #F34A40;
line-height: 50rpx; margin-left: 5rpx;
}
}
.b {
font-size: 28rpx; font-size: 28rpx;
color: #212121; color: #212121;
text-align: right;
margin-right: 10rpx;
}
.select{
width: 100%;
display: flex; display: flex;
align-items: center; align-items: center;
color: #C7C7C7;
justify-content: flex-end; input {
&-on{ font-size: 28rpx;
color: #212121;
flex: 1;
line-height: 50rpx;
font-size: 28rpx;
color: #212121; color: #212121;
text-align: right;
margin-right: 10rpx;
}
.select {
color: #C7C7C7;
&-on {
color: #212121;
}
} }
} }
} }
} }
.items{
padding: 20rpx 30rpx; &-bd {
line-height: 50rpx; background-color: #fff;
font-size: 28rpx; padding: 60rpx;
color: #212121; overflow: hidden;
border-bottom: 1px solid #F7F7F7;
position: relative; .l {
.a{ height: 260rpx;
flex: 1; display: flex;
align-items: center;
justify-content: center;
.a {
height: 100%;
width: 100rpx;
display: flex; display: flex;
align-items: center; align-items: center;
input{ justify-content: center;
flex: 1;
font-size: 26rpx;
color: #212121;
line-height: 50rpx;
margin-left: 20rpx;
}
text{
color: #F34A40;
margin-left: 5rpx;
}
.select{
flex: 1;
}
.tip{
margin-left: 15rpx;
font-size: 24rpx;
font-weight: 500;
color: #9F9F9F;
}
}
.b{
padding-top: 10rpx;
font-size: 24rpx;
font-weight: 400;
color: #C7C7C7;
}
.d{
position: absolute;
right: 20rpx;
top: 20rpx;
z-index: 2;
font-size: 28rpx;
font-weight: 400;
color: #212121;
} }
.c{
padding-top: 20rpx; .b {
overflow: hidden; width: 260rpx;
.slot-btn{ height: 260rpx;
width: 180rpx;
height: 180rpx; .slot-btn {
width: 260rpx;
height: 260rpx;
background: #F6F6F6; background: #F6F6F6;
border-radius: 10rpx; border-radius: 10rpx;
border: 1px solid #C0C0C0; border: 1px solid #C0C0C0;
@ -207,128 +293,46 @@
font-size: 28rpx; font-size: 28rpx;
font-weight: 500; font-weight: 500;
color: #6D6D6D; color: #6D6D6D;
.l{
line-height: 30rpx; image {
}
image{
width: 50rpx; width: 50rpx;
height: 50rpx; height: 50rpx;
display: block; margin-top: 80rpx;
margin: 0 auto; margin-bottom: 20rpx;
margin-top: 30rpx;
} }
} }
} }
} }
} .t {
&-fd{ text-align: center;
width: 100%; margin-top: 20rpx;
position: fixed; font-size: 32rpx;
left: 0; font-weight: 400;
bottom: 0; color: #2D2D2D;
padding: 30rpx;
z-index: 99;
background-color: #fafafa;
box-sizing: border-box;
.btn{
width: 630rpx;
line-height: 88rpx;
background: #F34A40;
border-radius: 88rpx;
text-align: center;
font-size: 28rpx;
font-weight: 500;
color: #FFFFFF;
}
}
&-classify{
width: 100%;
overflow: hidden;
&-hd{
padding: 30rpx 60rpx;
position: relative;
font-size: 32rpx;
font-weight: 500;
color: #303030;
text-align: center;
.a{
display: flex;
align-items: center;
font-size: 28rpx;
font-weight: 500;
color: #FF624F;
position: absolute;
top: 30rpx;
left: 40rpx;
z-index: 2;
} }
} }
&-bd{
overflow: hidden; &-fd {
display: flex; width: 100%;
align-items: flex-start; position: fixed;
.l{ left: 0;
width: 210rpx; bottom: 0;
height: 560rpx; padding: 30rpx;
background-color: #F7F8FA; background-color: #fafafa;
.item{ box-sizing: border-box;
text-overflow: ellipsis;
overflow: hidden; .btn {
height: 70rpx; width: 630rpx;
font-size: 28rpx; line-height: 88rpx;
font-weight: 400; background: #F34A40;
color: #303030; border-radius: 88rpx;
white-space: nowrap;
line-height: 70rpx;
padding-left: 30rpx;
box-sizing: border-box;
&-on{
background-color: #fff;
font-weight: 500;
}
}
}
.m{
width: 100%;
text-align: center; text-align: center;
max-height: 560rpx; font-size: 28rpx;
.item{ font-weight: 500;
text-overflow: ellipsis; color: #FFFFFF;
overflow: hidden; margin: auto;
height: 70rpx;
font-size: 28rpx;
font-weight: 400;
color: #303030;
white-space: nowrap;
line-height: 70rpx;
padding-left: 80rpx;
box-sizing: border-box;
&-on{
color: #FF624F;
}
}
}
.r{
width: 540rpx;
height: 560rpx;
.item{
text-overflow: ellipsis;
overflow: hidden;
height: 70rpx;
font-size: 28rpx;
font-weight: 400;
color: #303030;
white-space: nowrap;
line-height: 70rpx;
padding-left: 80rpx;
box-sizing: border-box;
&-on{
color: #FF624F;
}
}
} }
} }
} }
}
</style> </style>

@ -1,11 +1,10 @@
<template> <template>
<view class="goods"> <view class="goods">
<view class="search"> <view class="search">
<view class="box"> <view class="box">
<!-- <image src="/static/news/icon-search.png" @click="getList()"></image> <u-search height="50" @search="getListAfter" @custom="getListAfter" placeholder="商品名称/编码"
<input v-model="keyword" type="search" placeholder="商品名称/编码" /> --> v-model="keyword"></u-search>
<u-search height="50" @search="getListAfter" @custom="getListAfter" placeholder="商品名称/编码" v-model="keyword"></u-search> </view>
</view>
</view> </view>
<view class="goods-bd"> <view class="goods-bd">
<view class="li" v-for="(i,index) in list" :key="index"> <view class="li" v-for="(i,index) in list" :key="index">
@ -36,7 +35,7 @@
</template> </template>
<script> <script>
import * as newFunApi from '@/api/newFun' import * as newFunApi from '@/api/newFun'
export default { export default {
data() { data() {
return { return {
@ -50,13 +49,13 @@
this.getList(); this.getList();
}, },
onReachBottom() { onReachBottom() {
if(this.list.length <= this.total){ if (this.list.length <= this.total) {
this.pageNum ++; this.pageNum++;
this.getList(); this.getList();
} }
}, },
methods: { methods: {
getListAfter(){ getListAfter() {
this.list = []; this.list = [];
this.getList() this.getList()
}, },
@ -65,15 +64,19 @@
*/ */
async getList() { async getList() {
uni.showLoading({ uni.showLoading({
title:"加载中" title: "加载中"
}) })
let {status, message, data} = await newFunApi.storeKeeperList({ let {
status,
message,
data
} = await newFunApi.storeKeeperList({
goodsNo: "", goodsNo: "",
page: this.pageNum, page: this.pageNum,
listType: "all", listType: "all",
goodsName: this.keyword goodsName: this.keyword
}); });
if(status == 200){ if (status == 200) {
uni.hideLoading(); uni.hideLoading();
this.list = this.list.concat(data.list.data) this.list = this.list.concat(data.list.data)
this.total = data.list.total this.total = data.list.total
@ -84,175 +87,212 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.goods{ ::v-deep .u-input,
padding: 0 0 130rpx; ::v-deep .u-content {
overflow: hidden; background-color: #fff !important;
&-fd{ }
width: 100%;
padding: 20rpx; ::v-deep .u-search {
width: 640rpx !important;
}
.goods {
padding: 0 0 130rpx;
overflow: hidden; overflow: hidden;
display: flex;
align-items: center; &-fd {
justify-content: center; width: 100%;
box-sizing: border-box; padding: 20rpx;
position: fixed; overflow: hidden;
left: 0;
bottom: 0;
z-index: 999;
background-color: #fff;
.a{
margin-right: 20rpx;
font-size: 28rpx;
font-weight: 400;
color: #313131;
display: flex; display: flex;
align-items: center; align-items: center;
image{ justify-content: center;
width: 40rpx;
height: 40rpx;
margin-right: 10rpx;
}
}
.b{
text{
color: #ED2B00;
padding: 0 10rpx;
}
font-size: 28rpx;
font-weight: 400;
color: #A2A2A2;
margin-right: 20rpx;
}
.c{
width: 408rpx;
line-height: 80rpx;
background: #FF564A;
border-radius: 80rpx;
text-align: center;
font-size: 28rpx;
font-weight: 500;
color: #FFFFFF;
}
}
.search{
width: 750rpx;
padding: 35rpx;
box-sizing: border-box;
.box{
padding: 15rpx 25rpx;
box-sizing: border-box; box-sizing: border-box;
display: flex; position: fixed;
align-items: center; left: 0;
background: #F3F3F3; bottom: 0;
border-radius: 60rpx; z-index: 999;
image{ background-color: #fff;
width: 28rpx;
height: 28rpx; .a {
margin-right: 22rpx; margin-right: 20rpx;
}
input{
flex: 1;
font-size: 28rpx; font-size: 28rpx;
line-height: 30rpx; font-weight: 400;
color: #313131;
display: flex;
align-items: center;
image {
width: 40rpx;
height: 40rpx;
margin-right: 10rpx;
}
} }
}
} .b {
&-bd{ text {
padding: 0 30rpx; color: #ED2B00;
overflow: hidden; padding: 0 10rpx;
.a{ }
padding: 15rpx 0;
display: flex;
align-items: center;
justify-content: space-between;
.status{
font-size: 28rpx; font-size: 28rpx;
font-weight: 400; font-weight: 400;
color: #B6B6B6; color: #A2A2A2;
margin-right: 20rpx;
} }
.btn{
width: 148rpx; .c {
line-height: 64rpx; width: 408rpx;
background: #FFFFFF; line-height: 80rpx;
border-radius: 64rpx; background: #FF564A;
border-radius: 80rpx;
text-align: center; text-align: center;
border: 1px solid #F55349;
font-size: 28rpx; font-size: 28rpx;
font-weight: 400; font-weight: 500;
color: #F55349; color: #FFFFFF;
} }
} }
.li{
overflow: hidden; .search {
background-color: #fff; width: 750rpx;
padding: 0 30rpx; padding: 35rpx;
margin-top: 15rpx; box-sizing: border-box;
&:first-child{
margin-top: 0; .box {
padding: 15rpx 25rpx;
box-sizing: border-box;
display: flex;
align-items: center;
background: #fff;
border-radius: 60rpx;
justify-content: space-between;
image {
width: 28rpx;
height: 28rpx;
margin-right: 22rpx;
}
input {
flex: 1;
font-size: 28rpx;
line-height: 30rpx;
}
} }
.item{ }
padding: 20rpx 0;
overflow: hidden; &-bd {
padding: 0 30rpx;
overflow: hidden;
.a {
padding: 15rpx 0;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
border-bottom: 1px solid #EFEFEF;
.select{ .status {
width: 40rpx; font-size: 28rpx;
height: 40rpx; font-weight: 400;
margin-right: 20rpx; color: #B6B6B6;
image{
width: 100%;
height: 100%;
}
} }
.pic{
width: 160rpx; .btn {
height: 160rpx; width: 148rpx;
margin-right: 20rpx; line-height: 64rpx;
image{ background: #FFFFFF;
width: 100%; border-radius: 64rpx;
height: 100%; text-align: center;
} border: 1px solid #F55349;
font-size: 28rpx;
font-weight: 400;
color: #F55349;
} }
.info{ }
flex: 1;
max-width: 400rpx; .li {
margin-right: 20rpx; overflow: hidden;
.title{ background-color: #fff;
font-size: 28rpx; padding: 0 30rpx;
font-weight: 400; margin-top: 15rpx;
color: #000000;
white-space: nowrap; &:first-child {
overflow: hidden; margin-top: 0;
text-overflow: ellipsis; }
.item {
padding: 20rpx 0;
overflow: hidden;
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid #EFEFEF;
.select {
width: 40rpx;
height: 40rpx;
margin-right: 20rpx;
image {
width: 100%;
height: 100%;
}
} }
.sku{
line-height: 48rpx; .pic {
margin-top: 10rpx; width: 160rpx;
font-size: 28rpx; height: 160rpx;
font-weight: 400; margin-right: 20rpx;
color: #7C7C7C;
image {
width: 100%;
height: 100%;
}
} }
.fd{
display: flex; .info {
align-items: center; flex: 1;
justify-content: space-between; max-width: 400rpx;
margin-top: 10rpx; margin-right: 20rpx;
.price{
font-size: 32rpx; .title {
font-size: 28rpx;
font-weight: 400; font-weight: 400;
color: #ED2B00; color: #000000;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
} }
.kc{
.sku {
line-height: 48rpx;
margin-top: 10rpx;
font-size: 28rpx; font-size: 28rpx;
font-weight: 400; font-weight: 400;
color: #B6B6B6; color: #7C7C7C;
}
.fd {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 20rpx;
.price {
font-size: 32rpx;
font-weight: 400;
color: #ED2B00;
}
.kc {
font-size: 28rpx;
font-weight: 400;
color: #B6B6B6;
}
} }
} }
} }
} }
} }
} }
}
</style> </style>

@ -1,29 +1,33 @@
<template> <template>
<view class="goods"> <view class="goods">
<view class="goods-top"> <!-- <view class="goods-top">
<input type="text" placeholder="输入SKU直接导入获取商品信息"/> <input type="textarea" v-model="content" placeholder="输入SKU直接导入获取商品信息" />
<view class="btn">一键获取</view> <view class="btn" :style="{'opacity': content?1:0.6 }" @click="onClickAccess">一键获取</view>
</view> </view> -->
<view class="goods-hd"> <view class="goods-hd">
<view class="item"> <view class="item">
<view class="a">商品名称<text>*</text></view> <view class="a">商品名称<text>*</text></view>
<view class="b"> <view class="b">
<input type="text" placeholder="请输入商品价格,最低0.1元" /> <input type="text" v-model="from.goods_name" placeholder="请输入商品价格,最低0.1元" />
</view> </view>
</view> </view>
<view class="item"> <view class="item">
<view class="a">商品分类</view> <view class="a">商品分类</view>
<view class="b" @click="openPage(1)"> <view class="b" @click="openPage(1)">
<view class="select">请选择商品分类<u-icon name="arrow-right"></u-icon></view> <view class="select">请选择商品分类<u-icon name="arrow-right"></u-icon>
</view>
</view> </view>
</view> </view>
<view class="items"> <view class="items">
<view class="a">商品照片<text>*</text><view class="tip">最多上传100张</view></view> <view class="a">商品照片<text>*</text>
<view class="tip">最多上传100张</view>
</view>
<view class="c"> <view class="c">
<u-upload :action="action" width="180" height="180" :file-list="fileList" :custom-btn="true" max-count="5"> <u-upload :action="action" :header="header" @on-uploaded="goosSuccess" @on-remove="goodsRemove"
width="180" height="180" :file-list="goodsImageList" :custom-btn="true" max-count="100">
<template v-slot:addBtn> <template v-slot:addBtn>
<view class="slot-btn" hover-class="slot-btn__hover" hover-stay-time="150"> <view class="slot-btn" hover-class="slot-btn__hover" hover-stay-time="150">
<image src="/static/news/icon-upload.png"></image> <image :src="$picUrl+'/static/news/icon-upload.png'"></image>
<view class="1">上传图片</view> <view class="1">上传图片</view>
</view> </view>
</template> </template>
@ -31,12 +35,17 @@
</view> </view>
</view> </view>
<view class="items"> <view class="items">
<view class="a">商品详情<text>*</text><view class="input"><input type="text" placeholder="可输入商品的详细描述"/></view></view> <view class="a" style="align-items: flex-start">商品详情<text>*</text>
<view class="input">
<textarea placeholder="可输入商品的详细描述" v-model="from.goods_details" class="t"></textarea>
</view>
</view>
<view class="c"> <view class="c">
<u-upload :action="action" width="180" height="180" :file-list="fileList" :custom-btn="true" max-count="5"> <u-upload :action="action" :header="header" @on-uploaded="detailSuccess" @on-remove="detailsRemove"
width="180" height="180" :file-list="goodsDetailImageList" :custom-btn="true" max-count="6">
<template v-slot:addBtn> <template v-slot:addBtn>
<view class="slot-btn" hover-class="slot-btn__hover" hover-stay-time="150"> <view class="slot-btn" hover-class="slot-btn__hover" hover-stay-time="150">
<image src="/static/news/icon-upload.png"></image> <image :src="$picUrl+'/static/news/icon-upload.png'"></image>
<view class="1">上传图片</view> <view class="1">上传图片</view>
</view> </view>
</template> </template>
@ -46,10 +55,11 @@
<view class="items"> <view class="items">
<view class="a">商品素材<text>*</text></view> <view class="a">商品素材<text>*</text></view>
<view class="c"> <view class="c">
<u-upload :action="action" width="180" height="180" :file-list="fileList" :custom-btn="true" max-count="5"> <u-upload :action="action" :header="header" @on-uploaded="sourceSuccess" @on-remove="sourceRemove"
width="180" height="180" :file-list="goodSourceImageList" :custom-btn="true" max-count="6">
<template v-slot:addBtn> <template v-slot:addBtn>
<view class="slot-btn" hover-class="slot-btn__hover" hover-stay-time="150"> <view class="slot-btn" hover-class="slot-btn__hover" hover-stay-time="150">
<image src="/static/news/icon-upload.png"></image> <image :src="$picUrl+'/static/news/icon-upload.png'"></image>
<view class="1">上传图片</view> <view class="1">上传图片</view>
</view> </view>
</template> </template>
@ -59,7 +69,9 @@
</view> </view>
<view class="goods-hd"> <view class="goods-hd">
<view class="items"> <view class="items">
<view class="a" style="justify-content: space-between;">多规格<u-switch v-model="checked" active-color="#55BD6A" ></u-switch></view> <view class="a" style="justify-content: space-between;">多规格<u-switch v-model="skuchecked"
active-color="#55BD6A"></u-switch>
</view>
<view class="b"> <view class="b">
最多添加3个商品规格组生成SKU数量不能超出50个 最多添加3个商品规格组生成SKU数量不能超出50个
</view> </view>
@ -67,89 +79,111 @@
<view class="item"> <view class="item">
<view class="a">商品价格<text>*</text></view> <view class="a">商品价格<text>*</text></view>
<view class="b"> <view class="b">
<input type="text" placeholder="请输入商品价格,最低0.1元" /> <input type="text" @input="keyGoodsPrice" v-model="from.goods_price"
placeholder="请输入商品价格,最低0.1元" />
</view> </view>
</view> </view>
<view class="item"> <view class="item">
<view class="a">商品原价</view> <view class="a">商品原价</view>
<view class="b"> <view class="b">
<input type="text" placeholder="请输入商品划线价格" /> <input type="text" @input="keyOriginalPrice" v-model="from.goods_original_price"
placeholder="请输入商品划线价格" />
</view> </view>
</view> </view>
<view class="item"> <view class="item">
<view class="a">商品库存<text>*</text></view> <view class="a">商品库存<text>*</text></view>
<view class="b"> <view class="b">
<input type="number" placeholder="请输入商品库存" /> <input type="number" v-model="from.goods_stock" placeholder="请输入商品库存" />
</view> </view>
</view> </view>
<view class="item"> <view class="item">
<view class="a">商品重量<text>*</text></view> <view class="a">商品重量<text>*</text></view>
<view class="b"> <view class="b">
<input type="text" placeholder="请输入商品重量" />kg <input type="text" v-model="from.goods_weight" placeholder="请输入商品重量" />kg
</view> </view>
</view> </view>
</view> </view>
<view class="goods-hd"> <view class="goods-hd">
<view class="item"> <view class="item">
<view class="a">配送方式<text>*</text></view> <view class="a">配送方式<text>*</text></view>
<view class="b" @click="openPage(2)"> <view class="b" style="width: 350rpx;height: 40rpx;text-align: right;">
<view class="select">请选择配送方式<u-icon name="arrow-right"></u-icon></view> <picker @change="changeDelivery" mode="selector" placeholder="请选择配送方式"
style="width: 350rpx;height: 40rpx;" range-key="text" :value="index" :range="deliveryList">
<text :style="{color: from.delivery_name? '#303030' : '#C7C7C7'}">
{{from.delivery_name?from.delivery_name:'请选择配送方式'}}</text>
<u-icon name="arrow-right" color="#C7C7C7"></u-icon>
</picker>
</view> </view>
</view> </view>
<view class="item"> <view class="item">
<view class="a">运费模版<text>*</text></view> <view class="a">运费模版<text>*</text></view>
<view class="b" @click="openPage(3)"> <view class="b" style="width: 350rpx;height: 40rpx;text-align: right;">
<view class="select">全国包邮除偏远地区<u-icon name="arrow-right"></u-icon></view> <picker @change="changeDeliveryTemplate" mode="selector" placeholder="请选择运费模版"
style="width: 350rpx;height: 40rpx;" range-key="text" :value="index" :range="deliveryTemplate">
<text :style="{color: from.template_name? '#303030' : '#C7C7C7'}">
{{from.template_name?from.template_name:'请选择运费模版'}}</text>
<u-icon name="arrow-right" color="#C7C7C7"></u-icon>
</picker>
</view> </view>
</view> </view>
<view class="item"> <view class="item">
<view class="a">销售状态<text>*</text></view> <view class="a">销售状态<text>*</text></view>
<view class="b"> <view class="b">
<u-switch v-model="checked" active-color="#F34A40" ></u-switch> <u-switch v-model="salesChecked" active-color="#F34A40"></u-switch>
</view> </view>
</view> </view>
</view> </view>
<view class="goods-fd"> <view class="goods-fd">
<view class="btn">确认</view> <view class="btn" @click="onSubmit">确认</view>
</view> </view>
<u-popup v-model="isShow" mode="bottom" border-radius="12" mask-close-able="false" closeable> <u-popup v-model="isShow" mode="bottom" border-radius="12" mask-close-able="false" closeable>
<view class="goods-classify" v-if="popupType == 1"> <view class="goods-classify">
<view class="goods-classify-hd"> <view class="goods-classify-hd">
<view class="a" @click="openPage(4)"><u-icon name="plus"></u-icon></view> <view class="a" @click="openPage(2)">
<u-icon name="plus"></u-icon>
</view>
商品分类 商品分类
</view> </view>
<view class="goods-classify-bd"> <view class="goods-classify-bd">
<scroll-view scroll-y class="l"> <scroll-view scroll-y class="l">
<view class="item" @click="tabLItem(0)"><view :class="tabLIndex == 0?'item-on':''">数码</view></view> <view class="item" @click="tabLItem(0)">
<view class="item" @click="tabLItem(1)"><view :class="tabLIndex == 0?'item-on':''">食品</view></view> <view :class="tabLIndex == 0?'item-on':''">数码</view>
<view class="item" @click="tabLItem(2)"><view :class="tabLIndex == 0?'item-on':''">服饰鞋包</view></view> </view>
<view class="item" @click="tabLItem(3)"><view :class="tabLIndex == 0?'item-on':''">家居百货</view></view> <view class="item" @click="tabLItem(1)">
<view class="item" @click="tabLItem(4)"><view :class="tabLIndex == 0?'item-on':''">美妆/个户</view></view> <view :class="tabLIndex == 0?'item-on':''">食品</view>
<view class="item" @click="tabLItem(5)"><view :class="tabLIndex == 0?'item-on':''">家居百货</view></view> </view>
<view class="item" @click="tabLItem(6)"><view :class="tabLIndex == 0?'item-on':''">美妆/个户</view></view> <view class="item" @click="tabLItem(2)">
<view class="item" @click="tabLItem(7)"><view :class="tabLIndex == 0?'item-on':''">食品</view></view> <view :class="tabLIndex == 0?'item-on':''">服饰鞋包</view>
<view class="item" @click="tabLItem(8)"><view :class="tabLIndex == 0?'item-on':''">服饰鞋包</view></view> </view>
<view class="item" @click="tabLItem(9)"><view :class="tabLIndex == 0?'item-on':''">家居百货</view></view> <view class="item" @click="tabLItem(3)">
<view class="item" @click="tabLItem(10)"><view :class="tabLIndex == 0?'item-on':''">美妆/个户</view></view> <view :class="tabLIndex == 0?'item-on':''">家居百货</view>
</view>
<view class="item" @click="tabLItem(4)">
<view :class="tabLIndex == 0?'item-on':''">美妆/个户</view>
</view>
<view class="item" @click="tabLItem(5)">
<view :class="tabLIndex == 0?'item-on':''">家居百货</view>
</view>
<view class="item" @click="tabLItem(6)">
<view :class="tabLIndex == 0?'item-on':''">美妆/个户</view>
</view>
<view class="item" @click="tabLItem(7)">
<view :class="tabLIndex == 0?'item-on':''">食品</view>
</view>
<view class="item" @click="tabLItem(8)">
<view :class="tabLIndex == 0?'item-on':''">服饰鞋包</view>
</view>
<view class="item" @click="tabLItem(9)">
<view :class="tabLIndex == 0?'item-on':''">家居百货</view>
</view>
<view class="item" @click="tabLItem(10)">
<view :class="tabLIndex == 0?'item-on':''">美妆/个户</view>
</view>
</scroll-view> </scroll-view>
<scroll-view scroll-y class="r"> <scroll-view scroll-y class="r">
<view class="item" v-for="(a,i) in 10" @click="tabRItem(i)"><view :class="tabRIndex == i?'item-on':''">水产肉类/新鲜水果</view></view> <view class="item" v-for="(a,i) in 10" @click="tabRItem(i)">
</scroll-view> <view :class="tabRIndex == i?'item-on':''">水产肉类/新鲜水果</view>
</view> </view>
</view>
<view class="goods-classify" v-if="popupType == 2">
<view class="goods-classify-hd">配送方式</view>
<view class="goods-classify-bd">
<scroll-view scroll-y class="m">
<view class="item" v-for="(a,i) in 10" @click="tabMItem(i)"><view :class="tabMIndex == i?'item-on':''">物流</view></view>
</scroll-view>
</view>
</view>
<view class="goods-classify" v-if="popupType == 3">
<view class="goods-classify-hd">运费模板</view>
<view class="goods-classify-bd">
<scroll-view scroll-y class="m">
<view class="item" v-for="(a,i) in 2" @click="tabMItem1(i)"><view :class="tabMIndex1 == i?'item-on':''">物流</view></view>
</scroll-view> </scroll-view>
</view> </view>
</view> </view>
@ -158,173 +192,367 @@
</template> </template>
<script> <script>
import Config from '@/core/config'
import * as newFunApi from '@/api/newFun'
export default { export default {
data() { data() {
return { return {
fileList: [ from: {
{ goods_name: '',
url: 'http://pics.sc.chinaz.com/files/pic/pic9/201912/hpic1886.jpg', goods_class: '',
} goods_image_id: '',
], details_image_id: '',
source_image_id: '',
goods_details: '',
goods_price: '',
goods_original_price: '',
goods_stock: '',
goods_weight: '',
delivery_id: '',
delivery_name: '',
template_name: '',
template_id: '',
},
content: '',
skuchecked: false,
salesChecked: false,
goodSourceImageList: [],
goodsDetailImageList: [],
goodsImageList: [],
deliveryTemplate: [{
text: '南京市',
id: 0
}, {
text: '西藏',
id: 1
}],
deliveryList: [{
text: '物流',
id: 0
}, {
text: '送货上门',
id: 1
}],
isShow: false, isShow: false,
checked: false,
value: "", value: "",
popupType: 1,
tabLIndex: 0, tabLIndex: 0,
tabRIndex: 0, tabRIndex: 0,
tabMIndex: 0, action: '',
tabMIndex1: 0 header: '',
}; };
}, },
onReady() {
this.action = (Config.get('apiUrl') + 'upload/image').replace("index.php?s=/", "")
this.header = {
'Storeid': uni.getStorageSync('Store').storeInfo.store_id,
'Access-Token': uni.getStorageSync('AccessToken'),
'platform': "MP-WEIXIN",
}
},
methods: { methods: {
openPage(i){ //
if(i<= 3){ async onSubmit() {
const that = this;
console.log(that.from)
return
if (!that.from.goods_name) {
return that.$toast('请输入商品名称')
}
let {
status,
message,
data
} = await newFunApi.addTransfer(that.form);
if (status == 200) {
uni.showToast({
title: "上架成功"
})
setTimeout(function() {
uni.$emit('refreshData');
uni.navigateBack({
delta: 1
})
}, 2000);
}
},
//
keyOriginalPrice(e) {
if (Number(e.detail.value) == 0 || Number(e.detail.value) < 0) {
this.from.goods_original_price = ''
return this.$toast('商品价不能低于0.1元')
}
this.from.goods_original_price = this.blurAmount(e.detail.value)
},
//
keyGoodsPrice(e) {
if (Number(e.detail.value) == 0 || Number(e.detail.value) < 0) {
this.from.goods_price = ''
return this.$toast('商品价不能低于0.1元')
}
this.from.goods_price = this.blurAmount(e.detail.value)
},
//
blurAmount(amount) {
let num = null
num = amount.replace(new RegExp('^(\\d+\\.\\d{2}).+'), '$1')
const startPoint = /^\./g
if (startPoint.test(num)) {
num = amount.replace(startPoint, '0.')
}
if (num && !num.includes('.') && num !== '0') {
num = +num
}
const morePoint = /\.+(\d*|\.+)\./g
if (morePoint.test(num)) {
num = amount
.replace(/\.{2,}/g, ".")
.replace(".", "$#$")
.replace(/\./g, "")
.replace("$#$", ".")
}
return num
},
//
changeDelivery(e) {
this.from.delivery_name = this.deliveryList[e.detail.value].text;
this.from.delivery_id = this.deliveryList[e.detail.value].id;
},
//
changeDeliveryTemplate(e) {
this.from.template_name = this.deliveryTemplate[e.detail.value].text;
this.from.template_id = this.deliveryTemplate[e.detail.value].id;
},
//
onClickAccess() {
},
//
goosSuccess(list) {
if (list.length > 0) {
const {
response
} = list[0];
if (response.status == 200) {
uni.showToast({
title: "上传成功"
})
this.from.goods_image_id = this.handleRemove('', list)
}
}
},
//
detailSuccess(list) {
if (list.length > 0) {
const {
response
} = list[0];
if (response.status == 200) {
uni.showToast({
title: "上传成功"
})
this.from.details_image_id = this.handleRemove('', list)
}
}
},
//
sourceSuccess(list) {
if (list.length > 0) {
const {
response
} = list[0];
if (response.status == 200) {
uni.showToast({
title: "上传成功"
})
this.from.source_image_id = this.handleRemove('', list)
}
}
},
goodsRemove: function(file, fileList) {
this.from.goods_image_id = this.handleRemove(file, fileList)
},
detailsRemove: function(file, fileList) {
this.from.details_image_id = this.handleRemove(file, fileList)
},
sourceRemove: function(file, fileList) {
this.from.source_image_id = this.handleRemove(file, fileList)
},
handleRemove: function(file, fileList) {
console.log(file, fileList)
let idList = []
fileList.forEach(item => {
idList.push(item.response.data.fileInfo.file_id)
});
return idList.join(',')
},
openPage(i) {
if (i == 1) {
this.isShow = true; this.isShow = true;
this.popupType=i } else if (i == 2) {
}else if(i == 4){ this.isShow = false;
uni.navigateTo({ uni.navigateTo({
url: "/pages/news/goods/classification" url: "/pages/news/goods/classify"
}) })
} }
}, },
tabLItem(i){ tabLItem(i) {
this.tabLIndex = i this.tabLIndex = i
console.log(this.tabLIndex) console.log(this.tabLIndex)
}, },
tabRItem(i){ tabRItem(i) {
this.tabRIndex = i this.tabRIndex = i
console.log(this.tabRIndex) console.log(this.tabRIndex)
}, }
tabMItem(i){
this.tabMIndex = i
console.log(this.tabMIndex)
},
tabMItem1(i){
this.tabMIndex1 = i
console.log(this.tabMIndex1)
},
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.goods{ .goods {
padding: 0 0 130rpx; padding: 0 0 130rpx;
overflow: hidden;
&-top{
background-color: #fff;
padding: 40rpx 25rpx;
overflow: hidden; overflow: hidden;
margin-bottom: 20rpx; margin-top: 12rpx;
input{
display: block; &-top {
line-height: 60rpx; background-color: #fff;
font-size: 28rpx; padding: 40rpx 25rpx;
color: #212121; overflow: hidden;
} margin-bottom: 20rpx;
.btn{
width: 158rpx; input {
line-height: 50rpx; display: block;
background: #FFB8B3; line-height: 60rpx;
border-radius: 50rpx; font-size: 28rpx;
text-align: center; color: #212121;
font-size: 24rpx; }
font-weight: 500;
color: #FFFFFF; .btn {
float: right; width: 158rpx;
line-height: 50rpx;
background: #FF5050;
border-radius: 50rpx;
text-align: center;
font-size: 24rpx;
font-weight: 500;
color: #FFFFFF;
float: right;
}
}
&-hd{
background-color: #fff;
padding: 0 25rpx 0;
overflow: hidden;
margin-bottom: 20rpx;
.item{
padding: 20rpx 30rpx;
line-height: 50rpx;
font-size: 28rpx;
color: #212121;
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid #F7F7F7;
.a{
text{
color: #F34A40;
margin-left: 5rpx;
}
} }
.b{ }
&-hd {
background-color: #fff;
padding: 0 25rpx 0;
overflow: hidden;
margin-bottom: 20rpx;
.item {
padding: 20rpx 30rpx;
line-height: 50rpx;
font-size: 28rpx; font-size: 28rpx;
color: #212121; color: #212121;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: flex-end; justify-content: space-between;
flex: 1; border-bottom: 1px solid #F7F7F7;
input{
font-size: 28rpx; .a {
color: #212121; text {
flex: 1; color: #F34A40;
line-height: 50rpx; margin-left: 5rpx;
}
}
.b {
font-size: 28rpx; font-size: 28rpx;
color: #212121; color: #212121;
text-align: right;
margin-right: 10rpx;
}
.select{
width: 100%;
display: flex; display: flex;
align-items: center; align-items: center;
color: #C7C7C7;
justify-content: flex-end; justify-content: flex-end;
&-on{ flex: 1;
color: #212121;
input {
font-size: 28rpx;
color: #6D6D6D;
flex: 1;
line-height: 50rpx;
font-size: 28rpx;
text-align: right;
margin-right: 10rpx;
}
.select {
width: 100%;
display: flex;
align-items: center;
color: #C7C7C7;
justify-content: flex-end;
&-on {
color: #212121;
}
} }
} }
} }
}
.items{ .items {
padding: 20rpx 30rpx; padding: 20rpx 30rpx;
line-height: 50rpx; line-height: 50rpx;
font-size: 28rpx; font-size: 28rpx;
color: #212121; color: #212121;
border-bottom: 1px solid #F7F7F7; border-bottom: 1px solid #F7F7F7;
.a{
.t {
width: 480rpx;
height: 40rpx;
padding-left: 30rpx;
font-size: 28rpx;
color: #212121;
margin-top: 5rpx;
}
.a {
flex: 1; flex: 1;
display: flex; display: flex;
align-items: center; align-items: center;
input{
input {
flex: 1; flex: 1;
font-size: 26rpx; font-size: 26rpx;
color: #212121; color: #212121;
line-height: 50rpx; line-height: 50rpx;
margin-left: 20rpx; margin-left: 20rpx;
} }
text{
text {
color: #F34A40; color: #F34A40;
margin-left: 5rpx; margin-left: 5rpx;
} }
.select{
.select {
flex: 1; flex: 1;
} }
.tip{
.tip {
margin-left: 15rpx; margin-left: 15rpx;
font-size: 24rpx; font-size: 24rpx;
font-weight: 500; font-weight: 500;
color: #9F9F9F; color: #9F9F9F;
} }
} }
.b{
.b {
padding-top: 20rpx; padding-top: 20rpx;
font-size: 24rpx; font-size: 24rpx;
font-weight: 400; font-weight: 400;
color: #C7C7C7; color: #C7C7C7;
} }
.c{
.c {
padding-top: 20rpx; padding-top: 20rpx;
overflow: hidden; overflow: hidden;
.slot-btn{
.slot-btn {
width: 180rpx; width: 180rpx;
height: 180rpx; height: 180rpx;
background: #F6F6F6; background: #F6F6F6;
@ -334,7 +562,8 @@
font-size: 28rpx; font-size: 28rpx;
font-weight: 500; font-weight: 500;
color: #6D6D6D; color: #6D6D6D;
image{
image {
width: 50rpx; width: 50rpx;
height: 50rpx; height: 50rpx;
margin-top: 30rpx; margin-top: 30rpx;
@ -343,114 +572,140 @@
} }
} }
}
&-fd{
width: 100%;
position: fixed;
left: 0;
bottom: 0;
padding: 30rpx;
z-index: 99;
background-color: #fafafa;
box-sizing: border-box;
.btn{
width: 630rpx;
line-height: 88rpx;
background: #F34A40;
border-radius: 88rpx;
text-align: center;
font-size: 28rpx;
font-weight: 500;
color: #FFFFFF;
} }
}
&-classify{ &-fd {
width: 100%; width: 100%;
overflow: hidden; position: fixed;
&-hd{ left: 0;
padding: 30rpx 60rpx; bottom: 0;
position: relative; padding: 30rpx;
font-size: 32rpx; z-index: 99;
font-weight: 500; background-color: #fafafa;
color: #303030; box-sizing: border-box;
text-align: center;
.a{ .btn {
display: flex; width: 630rpx;
align-items: center; line-height: 88rpx;
background: #F34A40;
border-radius: 88rpx;
text-align: center;
font-size: 28rpx; font-size: 28rpx;
font-weight: 500; font-weight: 500;
color: #FF624F; color: #FFFFFF;
position: absolute;
top: 30rpx;
left: 40rpx;
z-index: 2;
} }
} }
&-bd{
&-classify {
width: 100%;
overflow: hidden; overflow: hidden;
display: flex;
align-items: flex-start; &-hd {
.l{ padding: 30rpx 60rpx;
width: 210rpx; position: relative;
height: 560rpx; font-size: 32rpx;
background-color: #F7F8FA; font-weight: 500;
.item{ color: #303030;
text-overflow: ellipsis; text-align: center;
overflow: hidden;
height: 70rpx; .a {
display: flex;
align-items: center;
font-size: 28rpx; font-size: 28rpx;
font-weight: 400; font-weight: 500;
color: #303030; color: #FF624F;
white-space: nowrap; position: absolute;
line-height: 70rpx; top: 30rpx;
padding-left: 30rpx; left: 40rpx;
box-sizing: border-box; z-index: 2;
&-on{
background-color: #fff;
font-weight: 500;
}
} }
} }
.m{
width: 100%; &-bd {
text-align: center; overflow: hidden;
max-height: 560rpx; display: flex;
.item{ align-items: flex-start;
text-overflow: ellipsis;
overflow: hidden; .l {
height: 70rpx; width: 210rpx;
font-size: 28rpx; height: 560rpx;
font-weight: 400; background-color: #fff;
color: #303030;
white-space: nowrap; .item {
line-height: 70rpx; text-overflow: ellipsis;
padding-left: 80rpx; overflow: hidden;
box-sizing: border-box; height: 80rpx;
&-on{ font-size: 28rpx;
color: #FF624F; font-weight: 400;
color: #303030;
white-space: nowrap;
line-height: 80rpx;
padding-left: 30rpx;
box-sizing: border-box;
&-on {
background-color: #fff;
font-weight: 500;
}
} }
} }
}
.r{ .m {
width: 540rpx; width: 100%;
height: 560rpx; text-align: center;
.item{ max-height: 560rpx;
text-overflow: ellipsis;
overflow: hidden; .item {
height: 70rpx; text-overflow: ellipsis;
font-size: 28rpx; overflow: hidden;
font-weight: 400; height: 70rpx;
color: #303030; font-size: 28rpx;
white-space: nowrap; font-weight: 400;
line-height: 70rpx; color: #303030;
padding-left: 80rpx; white-space: nowrap;
box-sizing: border-box; line-height: 70rpx;
&-on{ box-sizing: border-box;
color: #FF624F;
&-on {
color: #FF624F;
}
}
}
.r {
width: 540rpx;
height: 560rpx;
.item {
text-overflow: ellipsis;
overflow: hidden;
height: 80rpx;
font-size: 28rpx;
font-weight: 400;
color: #303030;
white-space: nowrap;
line-height: 80rpx;
padding-left: 80rpx;
box-sizing: border-box;
&-on {
color: #FF624F;
}
} }
} }
} }
} }
} }
}
::v-deep .u-list-item {
margin: 10rpx 20rpx 10rpx 0 !important;
}
::v-deep .uni-textarea {
max-height: 100rpx !important;
}
::v-deep .uni-input-placeholder {
color: #C7C7C7 !important;
}
</style> </style>

@ -16,9 +16,12 @@
<view class="item"> <view class="item">
<view class="a">所属城市</view> <view class="a">所属城市</view>
<view class="b"> <view class="b">
<picker mode="region" :value="form.region" @change="bindCityChange"> <picker mode="multiSelector" @change="multiChange" @columnchange="columnChange"
<view class="select">{{cityInfo.province}}{{cityInfo.city}}{{cityInfo.area}}<u-icon value="{{multiIndex}}" :range="multiArray" range-key="name">
name="arrow-right"></u-icon></view> <view class="pbox">
{{cityInfo?cityInfo.province+cityInfo.city+cityInfo.area:'请选择省市区'}}
<u-icon name="arrow-right"></u-icon>
</view>
</picker> </picker>
</view> </view>
</view> </view>
@ -32,8 +35,8 @@
<view class="addressList-bd" v-if="type=='edit'"> <view class="addressList-bd" v-if="type=='edit'">
<view class="a">设为默认收货地址</view> <view class="a">设为默认收货地址</view>
<view class="b"> <view class="b">
<u-switch v-model="checked" active-color="#55BD6A" inactive-color="#eee" <u-switch v-model="checked" active-color="#55BD6A" inactive-color="#eee" @change="setDefault">
@change="setDefault"></u-switch> </u-switch>
</view> </view>
</view> </view>
<view class="addressList-fd"> <view class="addressList-fd">
@ -49,8 +52,6 @@
data() { data() {
return { return {
type: 'add', type: 'add',
array: [],
index: 0,
checked: false, checked: false,
value: "", value: "",
cityInfo: { cityInfo: {
@ -67,12 +68,15 @@
}, },
addressDetail: null, addressDetail: null,
addressId: '', addressId: '',
multiIndex: [0, 0, 0],
multiArray: [],
multiData: []
}; };
}, },
onLoad(optios) { onLoad(optios) {
console.log(JSON.parse(optios.addressDetail))
if (optios.addressDetail) { if (optios.addressDetail) {
this.type = 'edit' this.type = 'edit'
this.addressDetail = JSON.parse(optios.addressDetail); this.addressDetail = JSON.parse(optios.addressDetail);
this.addressId = this.addressDetail.address_id this.addressId = this.addressDetail.address_id
this.cityInfo.province = this.addressDetail.region.province; this.cityInfo.province = this.addressDetail.region.province;
@ -92,21 +96,62 @@
}]; }];
this.form.detail = this.addressDetail.detail; this.form.detail = this.addressDetail.detail;
} }
this.getProvinceAll()
}, },
methods: { methods: {
async getProvinceAll() {
let {
status,
message,
data
} = await AddressApi.province();
if (status == 200) {
this.multiData = data.list;
var multiIndex = this.multiIndex;
this.multiArray = [
this.multiData,
this.multiData[0].children,
this.multiData[0].children[0].children
]
}
},
//
multiChange: function(e) {
// console.log(e);
var _this = this;
var multiIndex = e.detail.value;
console.log(multiIndex);
this.multiIndex = multiIndex;
},
//
columnChange: function(e) {
// console.log(e);
var _this = this;
var multiData = _this.multiData;
var multiIndex = _this.multiIndex;
var columnIndex = e.detail.column;
var columnValue = e.detail.value;
multiIndex[columnIndex] = columnValue;
this.multiArray = [
multiData,
multiData[multiIndex[0]].children,
multiData[multiIndex[0]].children[multiIndex[1]].children,]
},
bindCityChange(e) { bindCityChange(e) {
this.cityInfo.province = e.detail.value[0]; this.cityInfo.province = e.detail.value[0];
this.cityInfo.city = e.detail.value[1]; this.cityInfo.city = e.detail.value[1];
this.cityInfo.area = e.detail.value[2]; this.cityInfo.area = e.detail.value[2];
this.form.region = e.detail.code; this.form.region = e.detail.id;
this.form.region = [{ this.form.region = [{
value: e.detail.code[0], value: e.detail.id[0],
label: e.detail.value[0] label: e.detail.value[0]
}, { }, {
value: e.detail.code[1], value: e.detail.id[1],
label: e.detail.value[1] label: e.detail.value[1]
}, { }, {
value: e.detail.code[2], value: e.detail.id[2],
label: e.detail.value[2] label: e.detail.value[2]
}]; }];
}, },
@ -121,6 +166,9 @@
} }
if (that.form.region == []) { if (that.form.region == []) {
return that.$toast('请选择所属地市') return that.$toast('请选择所属地市')
}
let parame = {
} }
AddressApi.add(that.form) AddressApi.add(that.form)
.then(result => { .then(result => {
@ -146,8 +194,9 @@
if (that.form.region == []) { if (that.form.region == []) {
return that.$toast('请选择所属地市') return that.$toast('请选择所属地市')
} }
AddressApi.edit(that.form) AddressApi.edit(that.addressId, that.form)
.then(result => { .then(result => {
return
that.$toast(result.message) that.$toast(result.message)
setTimeout(() => { setTimeout(() => {
uni.navigateBack() uni.navigateBack()
@ -275,4 +324,68 @@
} }
} }
} }
.list {
// border-bottom: 1rpx solid #eee;
padding: 0 0 0 18rpx;
box-sizing: border-box;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
position: relative;
.picker {
height: 92rpx;
width: 33%;
.pbox {
width: 100%;
height: 92rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
color: #808080;
view {
width: 100%;
text-align: right;
}
.icon-you {
font-size: 28rpx;
}
}
.pbox_hover {
color: #383838;
}
}
.name {
width: 168rpx;
font-size: 32rpx;
color: #383838;
}
.icon-you {
font-size: 28rpx;
color: #999999;
}
.input {
flex: 1;
height: 100%;
line-height: 92rpx;
color: #9080A1;
}
.textarea {
flex: 1;
height: 100%;
color: #A9A9A9;
}
}
</style> </style>

@ -342,61 +342,101 @@ export default {
}) })
.finally() .finally()
}, },
onShowToast(t) {
uni.showToast({
title: t,
icon: 'none',
duration: 2000
})
},
sureSubmit() { sureSubmit() {
let tip_title = null let tip_title = null
if (!this.form.store_name) { if (!this.form.store_name) {
tip_title = '请输入主体公司名称!' this.onShowToast('请输入主体公司名称!')
return
} }
if (!this.form.store_cat) { if (!this.form.store_cat) {
tip_title = '请选择主营类目体类目!' tip_title = '请选择主营类目体类目!'
this.onShowToast(tip_title)
return
} }
if (!this.form.store_address) { if (!this.form.store_address) {
tip_title = '请选择公司地址!' tip_title = '请选择公司地址!'
this.onShowToast(tip_title)
return
} }
if (!this.form.store_brand) { if (!this.form.store_brand) {
tip_title = '请输入合作品牌!' tip_title = '请输入合作品牌!'
this.onShowToast(tip_title)
return
} }
if (!this.brand_name) { if (!this.brand_name) {
tip_title = '请选择代理入驻!' tip_title = '请选择代理入驻!'
this.onShowToast(tip_title)
return
} }
if (!this.authorize_name) { if (!this.authorize_name) {
tip_title = '请选择一二级授权!' tip_title = '请选择一二级授权!'
} }
if (!this.rate_name) { if (!this.rate_name) {
tip_title = '请选择可否含税!' tip_title = '请选择可否含税!'
this.onShowToast(tip_title)
return
} }
if (!this.form.user_name) { if (!this.form.user_name) {
tip_title = '请输入联系人姓名!' tip_title = '请输入联系人姓名!'
this.onShowToast(tip_title)
return
} }
if (!this.form.user_position) { if (!this.form.user_position) {
tip_title = '请选择联系人职位!' tip_title = '请选择联系人职位!'
this.onShowToast(tip_title)
return
} }
if (!this.form.user_mobile) { if (!this.form.user_mobile) {
tip_title = '请输入联系人手机号!' tip_title = '请输入联系人手机号!'
this.onShowToast(tip_title)
return
} }
if (this.form.user_mobile && (!/^\+?\d[\d -]{8,12}\d/.test(this.form.user_mobile))) { if (this.form.user_mobile && (!/^\+?\d[\d -]{8,12}\d/.test(this.form.user_mobile))) {
tip_title = '手机号格式不正确!' tip_title = '手机号格式不正确!'
this.onShowToast(tip_title)
return
} }
if (!this.form.user_wx) { if (!this.form.user_wx) {
tip_title = '请输入联系人微信!' tip_title = '请输入联系人微信!'
this.onShowToast(tip_title)
return
} }
if (!this.form.user_email) { if (!this.form.user_email) {
tip_title = '请输入联系人邮箱!' tip_title = '请输入联系人邮箱!'
this.onShowToast(tip_title)
return
} }
if (!this.form.store_model) { if (!this.form.store_model) {
tip_title = '请选择仓库模式!' tip_title = '请选择仓库模式!'
this.onShowToast(tip_title)
return
} }
if (!this.send_name) { if (!this.send_name) {
tip_title = '请选择周末是否发货!' tip_title = '请选择周末是否发货!'
this.onShowToast(tip_title)
return
} }
if (!this.factory_name) { if (!this.factory_name) {
tip_title = '请选择是否自有工厂!' tip_title = '请选择是否自有工厂!'
this.onShowToast(tip_title)
return
} }
if (!this.offline_name) { if (!this.offline_name) {
tip_title = '请选择是否有线下渠道' tip_title = '请选择是否有线下渠道'
this.onShowToast(tip_title)
return
} }
if (!this.shop_name) { if (!this.shop_name) {
tip_title = '请选择是否有电商店铺!' tip_title = '请选择是否有电商店铺!'
this.onShowToast(tip_title)
return
} }
let plat_form = [] let plat_form = []
this.btnList.map(item => { this.btnList.map(item => {
@ -407,19 +447,21 @@ export default {
this.form.store_type = plat_form this.form.store_type = plat_form
if (plat_form.length == 0 && this.form.has_online_shop == 1) { if (plat_form.length == 0 && this.form.has_online_shop == 1) {
tip_title = '请选择电商平台!' tip_title = '请选择电商平台!'
} this.onShowToast(tip_title)
if (tip_title != null) {
uni.showToast({
title: tip_title,
icon: 'none',
duration: 2000
})
return return
} }
help.joinStore(this.form) help.joinStore(this.form)
.then(res => { .then(res => {
if (res.status) { if (res.status) {
this.popShow = true this.popShow = true
this.form = this.$options.data().form
this.send_name = ''
this.factory_name = ''
this.offline_name = ''
this.shop_name = ''
this.btnList.map(item => {
item.active = false
})
} else { } else {
uni.showToast({ uni.showToast({
title: '入驻失败', title: '入驻失败',
@ -429,14 +471,6 @@ export default {
} }
}) })
.finally(() => { .finally(() => {
this.form = this.$options.data().form
this.send_name = ''
this.factory_name = ''
this.offline_name = ''
this.shop_name = ''
this.btnList.map(item => {
item.active = false
})
}) })
}, },
} }

File diff suppressed because it is too large Load Diff

@ -172,8 +172,8 @@ export default {
}, },
onOut() { onOut() {
uni.showModal({ uni.showModal({
title: '友情提示', title: '您是否要注销账号?',
content: '确认要注销吗?', content: '',
success(o) { success(o) {
if (o.confirm) { if (o.confirm) {
uni.removeStorage('token'); uni.removeStorage('token');

@ -62,8 +62,8 @@
<view class="recordTitle"> <view class="recordTitle">
转账记录<text class="intro">最多上传6张</text> 转账记录<text class="intro">最多上传6张</text>
</view> </view>
<u-upload :action="action" :header="header" @on-uploaded="transferSuccess" width="180" height="180" <u-upload :action="action" :header="header" @on-uploaded="transferSuccess" @on-remove="transferRemove"
:file-list="transferList" :custom-btn="true" max-count="6"> width="180" height="180" :file-list="transferList" :custom-btn="true" max-count="6">
<template v-slot:addBtn> <template v-slot:addBtn>
<view class="slot-btn" hover-class="slot-btn__hover" hover-stay-time="150"> <view class="slot-btn" hover-class="slot-btn__hover" hover-stay-time="150">
<image :src="$picUrl+'/static/news/icon-upload.png'"></image> <image :src="$picUrl+'/static/news/icon-upload.png'"></image>
@ -76,8 +76,8 @@
<view class="recordTitle"> <view class="recordTitle">
聊天记录<text class="intro">最多上传6张</text> 聊天记录<text class="intro">最多上传6张</text>
</view> </view>
<u-upload :action="action" :header="header" @on-uploaded="chatSuccess" width="180" height="180" <u-upload :action="action" :header="header" @on-uploaded="chatSuccess" @on-remove="chatRemove"
:file-list="chatList" :custom-btn="true" max-count="6"> width="180" height="180" :file-list="chatList" :custom-btn="true" max-count="6">
<template v-slot:addBtn> <template v-slot:addBtn>
<view class="slot-btn" hover-class="slot-btn__hover" hover-stay-time="150"> <view class="slot-btn" hover-class="slot-btn__hover" hover-stay-time="150">
<image :src="$picUrl+'/static/news/icon-upload.png'"></image> <image :src="$picUrl+'/static/news/icon-upload.png'"></image>
@ -87,9 +87,6 @@
</u-upload> </u-upload>
</view> </view>
</view> </view>
<!-- <view class="footerBtn" @click="onSubmit">
提交
</view> -->
<view class="goods-fd"> <view class="goods-fd">
<view class="btn" @click="onSubmit">提交</view> <view class="btn" @click="onSubmit">提交</view>
</view> </view>
@ -318,6 +315,20 @@
} }
} }
}, },
transferRemove(file, fileList) {
this.form.transfer_image_id = this.handleRemove(file, fileList);
},
handleRemove: function(file, fileList) {
let idList = []
fileList.forEach(item => {
idList.push(item.response.data.fileInfo.file_id)
});
return idList.join(',')
},
chatRemove(file, fileList) {
this.form.transfer_image_id = this.handleRemove(file, fileList);
},
// //
chatSuccess(list) { chatSuccess(list) {
if (list.length > 0) { if (list.length > 0) {

Loading…
Cancel
Save