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

version/0412
fanfan 11 months ago
parent 13f0581736
commit e07618f8a4
  1. 4
      api/address.js
  2. 1
      pages/invoice/index.vue
  3. 14
      pages/news/goods/batchdel.vue
  4. 328
      pages/news/goods/classification.vue
  5. 524
      pages/news/goods/classify.vue
  6. 378
      pages/news/goods/list.vue
  7. 787
      pages/news/goods/oneGrounding.vue
  8. 141
      pages/news/park/addressEdit.vue
  9. 66
      pages/news1/MerchantSettlement.vue
  10. 867
      pages/news1/feedback.vue
  11. 4
      pages/news1/setting.vue
  12. 25
      pages/news3/ManualEntry.vue

@ -50,4 +50,8 @@ export const remove = (addressId) => {
// 收货地址智能解析
export const 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">
<text>+</text>添加发票抬头
</view>
<view v-if="!invoicList.length">暂无相关信息</view>
</view>
</template>

@ -116,7 +116,15 @@
}
</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{
padding: 0 0 130rpx;
overflow: hidden;
@ -153,7 +161,7 @@
box-sizing: border-box;
display: flex;
align-items: center;
background: #F3F3F3;
background: #fff;
border-radius: 60rpx;
image{
width: 28rpx;
@ -239,7 +247,7 @@
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 10rpx;
margin-top: 20rpx;
.price{
font-size: 32rpx;
font-weight: 400;

@ -1,54 +1,54 @@
<template>
<view class="goods">
<view class="goods-bd">
<view class="l">
<view class="a">
<u-icon name="arrow-left"></u-icon>
</view>
<view class="b">
<u-upload :action="action" width="160" height="160" :custom-btn="true" max-count="1">
<template v-slot:addBtn>
<view class="slot-btn" hover-class="slot-btn__hover" hover-stay-time="150">
<image src="/static/news/icon-upload.png"></image>
<view class="1">上传图片</view>
</view>
</template>
</u-upload>
</view>
<view class="a">
<u-icon name="arrow-right"></u-icon>
</view>
</view>
<view class="t">公主1黑色</view>
<view class="goods">
<view class="goods-bd">
<view class="l">
<view class="a">
<u-icon name="arrow-left"></u-icon>
</view>
<view class="b">
<u-upload :action="action" width="160" height="160" :custom-btn="true" max-count="1">
<template v-slot:addBtn>
<view class="slot-btn" hover-class="slot-btn__hover" hover-stay-time="150">
<image src="/static/news/icon-upload.png"></image>
<view class="1">上传图片</view>
</view>
</template>
</u-upload>
</view>
<view class="a">
<u-icon name="arrow-right"></u-icon>
</view>
</view>
<view class="t">公主1黑色</view>
</view>
<view class="goods-hd">
<view class="item">
<view class="a">商品价格<text>*</text></view>
<view class="b">
<input type="text" placeholder="请输入商品价格,最低0.1元" />
</view>
</view>
<view class="item">
<view class="a">商品原价</view>
<view class="b">
<input type="text" placeholder="请输入商品划线价格" />
</view>
</view>
<view class="item">
<view class="a">商品库存<text>*</text></view>
<view class="b">
<input type="number" placeholder="请输入商品库存" />
</view>
</view>
<view class="item">
<view class="a">商品重量<text>*</text></view>
<view class="b">
<input type="text" placeholder="请输入商品重量" />kg
</view>
</view>
</view>
<view class="goods-fd">
<view class="btn">确认</view>
<view class="goods-hd">
<view class="item">
<view class="a">商品价格<text>*</text></view>
<view class="b">
<input type="text" placeholder="请输入商品价格,最低0.1元" />
</view>
</view>
<view class="item">
<view class="a">商品原价</view>
<view class="b">
<input type="text" placeholder="请输入商品划线价格" />
</view>
</view>
<view class="item">
<view class="a">商品库存<text>*</text></view>
<view class="b">
<input type="number" placeholder="请输入商品库存" />
</view>
</view>
<view class="item">
<view class="a">商品重量<text>*</text></view>
<view class="b">
<input type="text" placeholder="请输入商品重量" />kg
</view>
</view>
</view>
<view class="goods-fd">
<view class="btn">确认</view>
</view>
</view>
</template>
@ -56,12 +56,12 @@
<script>
export default {
data() {
return {
fileList: [
{
url: 'http://pics.sc.chinaz.com/files/pic/pic9/201912/hpic1886.jpg',
}
],
return {
fileList: [
{
url: 'http://pics.sc.chinaz.com/files/pic/pic9/201912/hpic1886.jpg',
}
],
checked: false,
value: ""
};
@ -70,117 +70,117 @@
</script>
<style lang="scss" scoped>
.goods{
padding: 0 0 20rpx;
overflow: hidden;
&-hd{
background-color: #fff;
padding: 0 25rpx 0;
overflow: hidden;
.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{
font-size: 28rpx;
color: #212121;
flex: 1;
display: flex;
align-items: center;
input{
font-size: 28rpx;
color: #212121;
flex: 1;
line-height: 50rpx;
font-size: 28rpx;
color: #212121;
text-align: right;
margin-right: 10rpx;
}
.select{
color: #C7C7C7;
&-on{
color: #212121;
}
}
}
}
}
&-bd{
background-color: #fff;
padding: 60rpx;
overflow: hidden;
.l{
height: 260rpx;
display: flex;
align-items: center;
justify-content: center;
.a{
height: 100%;
width: 100rpx;
display: flex;
align-items: center;
justify-content: center;
}
.b{
width: 260rpx;
height: 260rpx;
.slot-btn{
width: 260rpx;
height: 260rpx;
background: #F6F6F6;
border-radius: 10rpx;
border: 1px solid #C0C0C0;
text-align: center;
font-size: 28rpx;
font-weight: 500;
color: #6D6D6D;
image{
width: 50rpx;
height: 50rpx;
margin-top: 80rpx;
margin-bottom: 20rpx;
}
}
}
}
.t{
text-align: center;
.goods{
padding: 0 0 20rpx;
overflow: hidden;
&-hd{
background-color: #fff;
padding: 0 25rpx 0;
overflow: hidden;
.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{
font-size: 28rpx;
color: #212121;
flex: 1;
display: flex;
align-items: center;
input{
font-size: 28rpx;
color: #212121;
flex: 1;
line-height: 50rpx;
font-size: 28rpx;
color: #212121;
text-align: right;
margin-right: 10rpx;
}
.select{
color: #C7C7C7;
&-on{
color: #212121;
}
}
}
}
}
&-bd{
background-color: #fff;
padding: 60rpx;
overflow: hidden;
.l{
height: 260rpx;
display: flex;
align-items: center;
justify-content: center;
.a{
height: 100%;
width: 100rpx;
display: flex;
align-items: center;
justify-content: center;
}
.b{
width: 260rpx;
height: 260rpx;
.slot-btn{
width: 260rpx;
height: 260rpx;
background: #F6F6F6;
border-radius: 10rpx;
border: 1px solid #C0C0C0;
text-align: center;
font-size: 28rpx;
font-weight: 500;
color: #6D6D6D;
image{
width: 50rpx;
height: 50rpx;
margin-top: 80rpx;
margin-bottom: 20rpx;
}
}
}
}
.t{
text-align: center;
margin-top: 20rpx;
font-size: 32rpx;
font-weight: 400;
color: #2D2D2D;
}
}
&-fd{
width: 100%;
position: fixed;
left: 0;
bottom: 0;
padding: 30rpx;
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;
}
}
color: #2D2D2D;
}
}
&-fd{
width: 100%;
position: fixed;
left: 0;
bottom: 0;
padding: 30rpx;
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;
}
}
}
</style>

@ -1,205 +1,291 @@
<template>
<template>
<view class="goods">
<view class="goods-hd">
<view class="item">
<view class="a">分类名称</view>
<view class="b" @click="openPage(1)">
<view class="select">请选择分类名称<u-icon name="arrow-right"></u-icon></view>
<view class="a">商品名称<text>*</text></view>
<view class="b">
<input type="text" v-model="form.goods_name" placeholder="请输入商品名称" />
</view>
</view>
<view class="item">
<view class="a">商品分类</view>
<view class="b">
<view class="select select-on">顶级分类</view>
<view class="a">商品分类<text>*</text></view>
<view class="b" style="width: 350rpx;height: 40rpx;text-align: right;" >
<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 class="items">
<view class="itemImg">
<view class="a">分类照片<text>*</text></view>
<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>
<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="l">1/8</view>
</view>
</template>
</u-upload>
</view>
</view>
<view class="items">
<view class="a" style="justify-content: space-between;">状态<u-switch v-model="checked" active-color="#55BD6A" ></u-switch></view>
<view class="b">
<view class="item-status">
<view class="item" style="border: none;padding-top: 0;">
<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 class="items">
<view class="a">排序<text>*</text><view class="input"><input type="text" placeholder="数字越小越靠前"/></view></view>
<view class="d">1</view>
<view class="item">
<view class="a">排序<text>*</text></view>
<view class="b">
<input type="number" v-model="form.goods_sort" placeholder="请输入排序" />
</view>
</view>
</view>
<view class="goods-fd">
<view class="btn">确认</view>
<view class="btn" @click="onSubmit">确认</view>
</view>
</view>
</template>
<script>
export default {
data() {
</view>
</template>
<script>
import Config from '@/core/config'
export default {
data() {
return {
fileList: [
{
url: 'http://pics.sc.chinaz.com/files/pic/pic9/201912/hpic1886.jpg',
}
],
isShow: false,
checked: false,
fileList: [],
form: {
image_id: [],
goods_type: '',
goods_class: '',
checked: false,
goods_sort: '',
goods_name:'',
},
modeList: [{
text: '店内现货',
id: 0,
}, {
text: '仓库发货',
id: 1,
}],
value: "",
popupType: 1,
tabLIndex: 0,
tabRIndex: 0,
tabMIndex: 0,
tabMIndex1: 0
};
action: '',
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: {
openPage(i){
if(i<= 3){
this.isShow = true;
this.popupType=i
}else if(i == 4){
uni.navigateTo({
url: "/pages/news/goods/classification"
//
async onSubmit() {
const that = this;
if (!that.form.goods_name) {
return that.$toast('请输入商品名称')
}
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
console.log(this.tabLIndex)
},
tabRItem(i){
this.tabRIndex = i
console.log(this.tabRIndex)
},
tabMItem(i){
this.tabMIndex = i
console.log(this.tabMIndex)
//
changeMode(e) {
this.form.goods_class = this.modeList[e.detail.value].text;
this.form.goods_type = this.modeList[e.detail.value].id;
},
tabMItem1(i){
this.tabMIndex1 = i
console.log(this.tabMIndex1)
//
success(list) {
if (list.length > 0) {
const {
response
} = list[0];
if (response.status == 200) {
uni.showToast({
title: "上传成功"
})
let idList = []
list.forEach(item => {
idList.push(item.response.data.fileInfo.file_id)
});
this.form.image_id = idList.join(',');
}
}
},
}
}
</script>
<style lang="scss" scoped>
.goods{
padding: 0 0 130rpx;
overflow: hidden;
&-hd{
background-color: #fff;
padding: 0 25rpx 0;
}
}
</script>
<style lang="scss" scoped>
.goods {
padding: 0 0 20rpx;
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{
.c {
padding-top: 20rpx;
overflow: hidden;
.slot-btn {
width: 180rpx;
height: 180rpx;
background: #F6F6F6;
border-radius: 10rpx;
border: 1px solid #C0C0C0;
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;
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;
color: #212121;
display: flex;
align-items: center;
justify-content: flex-end;
flex: 1;
input{
font-size: 28rpx;
color: #212121;
flex: 1;
line-height: 50rpx;
justify-content: space-between;
border-bottom: 1px solid #F7F7F7;
.a {
text {
color: #F34A40;
margin-left: 5rpx;
}
}
.b {
font-size: 28rpx;
color: #212121;
text-align: right;
margin-right: 10rpx;
}
.select{
width: 100%;
display: flex;
align-items: center;
color: #C7C7C7;
justify-content: flex-end;
&-on{
input {
font-size: 28rpx;
color: #212121;
flex: 1;
line-height: 50rpx;
font-size: 28rpx;
color: #212121;
text-align: right;
margin-right: 10rpx;
}
.select {
color: #C7C7C7;
&-on {
color: #212121;
}
}
}
}
}
.items{
padding: 20rpx 30rpx;
line-height: 50rpx;
font-size: 28rpx;
color: #212121;
border-bottom: 1px solid #F7F7F7;
position: relative;
.a{
flex: 1;
&-bd {
background-color: #fff;
padding: 60rpx;
overflow: hidden;
.l {
height: 260rpx;
display: flex;
align-items: center;
justify-content: center;
.a {
height: 100%;
width: 100rpx;
display: flex;
align-items: center;
input{
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;
}
justify-content: center;
}
.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;
overflow: hidden;
.slot-btn{
width: 180rpx;
height: 180rpx;
.b {
width: 260rpx;
height: 260rpx;
.slot-btn {
width: 260rpx;
height: 260rpx;
background: #F6F6F6;
border-radius: 10rpx;
border: 1px solid #C0C0C0;
@ -207,128 +293,46 @@
font-size: 28rpx;
font-weight: 500;
color: #6D6D6D;
.l{
line-height: 30rpx;
}
image{
image {
width: 50rpx;
height: 50rpx;
display: block;
margin: 0 auto;
margin-top: 30rpx;
margin-top: 80rpx;
margin-bottom: 20rpx;
}
}
}
}
}
&-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{
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;
.t {
text-align: center;
margin-top: 20rpx;
font-size: 32rpx;
font-weight: 400;
color: #2D2D2D;
}
}
&-bd{
overflow: hidden;
display: flex;
align-items: flex-start;
.l{
width: 210rpx;
height: 560rpx;
background-color: #F7F8FA;
.item{
text-overflow: ellipsis;
overflow: hidden;
height: 70rpx;
font-size: 28rpx;
font-weight: 400;
color: #303030;
white-space: nowrap;
line-height: 70rpx;
padding-left: 30rpx;
box-sizing: border-box;
&-on{
background-color: #fff;
font-weight: 500;
}
}
}
.m{
width: 100%;
&-fd {
width: 100%;
position: fixed;
left: 0;
bottom: 0;
padding: 30rpx;
background-color: #fafafa;
box-sizing: border-box;
.btn {
width: 630rpx;
line-height: 88rpx;
background: #F34A40;
border-radius: 88rpx;
text-align: center;
max-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;
}
}
}
.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;
}
}
font-size: 28rpx;
font-weight: 500;
color: #FFFFFF;
margin: auto;
}
}
}
}
</style>

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

@ -1,29 +1,33 @@
<template>
<template>
<view class="goods">
<view class="goods-top">
<input type="text" placeholder="输入SKU直接导入获取商品信息"/>
<view class="btn">一键获取</view>
</view>
<!-- <view class="goods-top">
<input type="textarea" v-model="content" placeholder="输入SKU直接导入获取商品信息" />
<view class="btn" :style="{'opacity': content?1:0.6 }" @click="onClickAccess">一键获取</view>
</view> -->
<view class="goods-hd">
<view class="item">
<view class="a">商品名称<text>*</text></view>
<view class="b">
<input type="text" placeholder="请输入商品价格,最低0.1元" />
<input type="text" v-model="from.goods_name" placeholder="请输入商品价格,最低0.1元" />
</view>
</view>
<view class="item">
<view class="a">商品分类</view>
<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 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">
<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>
<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>
</template>
@ -31,12 +35,17 @@
</view>
</view>
<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">
<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>
<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>
</template>
@ -46,20 +55,23 @@
<view class="items">
<view class="a">商品素材<text>*</text></view>
<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>
<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>
</template>
</u-upload>
</view>
</view>
</view>
</view>
<view class="goods-hd">
<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">
最多添加3个商品规格组生成SKU数量不能超出50个
</view>
@ -67,264 +79,480 @@
<view class="item">
<view class="a">商品价格<text>*</text></view>
<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 class="item">
<view class="a">商品原价</view>
<view class="b">
<input type="text" placeholder="请输入商品划线价格" />
<input type="text" @input="keyOriginalPrice" v-model="from.goods_original_price"
placeholder="请输入商品划线价格" />
</view>
</view>
<view class="item">
<view class="a">商品库存<text>*</text></view>
<view class="b">
<input type="number" placeholder="请输入商品库存" />
<input type="number" v-model="from.goods_stock" placeholder="请输入商品库存" />
</view>
</view>
<view class="item">
<view class="a">商品重量<text>*</text></view>
<view class="b">
<input type="text" placeholder="请输入商品重量" />kg
<input type="text" v-model="from.goods_weight" placeholder="请输入商品重量" />kg
</view>
</view>
</view>
<view class="goods-hd">
<view class="item">
<view class="a">配送方式<text>*</text></view>
<view class="b" @click="openPage(2)">
<view class="select">请选择配送方式<u-icon name="arrow-right"></u-icon></view>
<view class="b" style="width: 350rpx;height: 40rpx;text-align: right;">
<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 class="item">
<view class="a">运费模版<text>*</text></view>
<view class="b" @click="openPage(3)">
<view class="select">全国包邮除偏远地区<u-icon name="arrow-right"></u-icon></view>
<view class="b" style="width: 350rpx;height: 40rpx;text-align: right;">
<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 class="item">
<view class="a">销售状态<text>*</text></view>
<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 class="goods-fd">
<view class="btn">确认</view>
<view class="btn" @click="onSubmit">确认</view>
</view>
<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="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 class="goods-classify-bd">
<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(1)"><view :class="tabLIndex == 0?'item-on':''">食品</view></view>
<view class="item" @click="tabLItem(2)"><view :class="tabLIndex == 0?'item-on':''">服饰鞋包</view></view>
<view class="item" @click="tabLItem(3)"><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>
<view class="item" @click="tabLItem(0)">
<view :class="tabLIndex == 0?'item-on':''">数码</view>
</view>
<view class="item" @click="tabLItem(1)">
<view :class="tabLIndex == 0?'item-on':''">食品</view>
</view>
<view class="item" @click="tabLItem(2)">
<view :class="tabLIndex == 0?'item-on':''">服饰鞋包</view>
</view>
<view class="item" @click="tabLItem(3)">
<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-y class="r">
<view class="item" v-for="(a,i) in 10" @click="tabRItem(i)"><view :class="tabRIndex == i?'item-on':''">水产肉类/新鲜水果</view></view>
</scroll-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>
<view class="item" v-for="(a,i) in 10" @click="tabRItem(i)">
<view :class="tabRIndex == 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>
</view>
</view>
</u-popup>
</view>
</template>
<script>
export default {
data() {
</u-popup>
</view>
</template>
<script>
import Config from '@/core/config'
import * as newFunApi from '@/api/newFun'
export default {
data() {
return {
fileList: [
{
url: 'http://pics.sc.chinaz.com/files/pic/pic9/201912/hpic1886.jpg',
}
],
from: {
goods_name: '',
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,
checked: false,
value: "",
popupType: 1,
tabLIndex: 0,
tabRIndex: 0,
tabMIndex: 0,
tabMIndex1: 0
};
action: '',
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: {
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.popupType=i
}else if(i == 4){
} else if (i == 2) {
this.isShow = false;
uni.navigateTo({
url: "/pages/news/goods/classification"
url: "/pages/news/goods/classify"
})
}
},
tabLItem(i){
tabLItem(i) {
this.tabLIndex = i
console.log(this.tabLIndex)
},
tabRItem(i){
tabRItem(i) {
this.tabRIndex = i
console.log(this.tabRIndex)
},
tabMItem(i){
this.tabMIndex = i
console.log(this.tabMIndex)
},
tabMItem1(i){
this.tabMIndex1 = i
console.log(this.tabMIndex1)
},
}
}
</script>
<style lang="scss" scoped>
.goods{
padding: 0 0 130rpx;
overflow: hidden;
&-top{
background-color: #fff;
padding: 40rpx 25rpx;
overflow: hidden;
margin-bottom: 20rpx;
input{
display: block;
line-height: 60rpx;
font-size: 28rpx;
color: #212121;
}
.btn{
width: 158rpx;
line-height: 50rpx;
background: #FFB8B3;
border-radius: 50rpx;
text-align: center;
font-size: 24rpx;
font-weight: 500;
color: #FFFFFF;
float: right;
}
}
}
&-hd{
background-color: #fff;
padding: 0 25rpx 0;
</script>
<style lang="scss" scoped>
.goods {
padding: 0 0 130rpx;
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{
margin-top: 12rpx;
&-top {
background-color: #fff;
padding: 40rpx 25rpx;
overflow: hidden;
margin-bottom: 20rpx;
input {
display: block;
line-height: 60rpx;
font-size: 28rpx;
color: #212121;
}
.btn {
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: flex-end;
flex: 1;
input{
font-size: 28rpx;
color: #212121;
flex: 1;
line-height: 50rpx;
justify-content: space-between;
border-bottom: 1px solid #F7F7F7;
.a {
text {
color: #F34A40;
margin-left: 5rpx;
}
}
.b {
font-size: 28rpx;
color: #212121;
text-align: right;
margin-right: 10rpx;
}
.select{
width: 100%;
display: flex;
align-items: center;
color: #C7C7C7;
justify-content: flex-end;
&-on{
color: #212121;
flex: 1;
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;
line-height: 50rpx;
font-size: 28rpx;
color: #212121;
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;
display: flex;
align-items: center;
input{
input {
flex: 1;
font-size: 26rpx;
color: #212121;
line-height: 50rpx;
margin-left: 20rpx;
}
text{
text {
color: #F34A40;
margin-left: 5rpx;
}
.select{
.select {
flex: 1;
}
.tip{
margin-left: 15rpx;
font-size: 24rpx;
font-weight: 500;
.tip {
margin-left: 15rpx;
font-size: 24rpx;
font-weight: 500;
color: #9F9F9F;
}
}
.b{
.b {
padding-top: 20rpx;
font-size: 24rpx;
font-weight: 400;
color: #C7C7C7;
}
.c{
.c {
padding-top: 20rpx;
overflow: hidden;
.slot-btn{
.slot-btn {
width: 180rpx;
height: 180rpx;
background: #F6F6F6;
@ -334,7 +562,8 @@
font-size: 28rpx;
font-weight: 500;
color: #6D6D6D;
image{
image {
width: 50rpx;
height: 50rpx;
margin-top: 30rpx;
@ -342,115 +571,141 @@
}
}
}
}
&-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{
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;
&-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;
}
}
&-bd{
&-classify {
width: 100%;
overflow: hidden;
display: flex;
align-items: flex-start;
.l{
width: 210rpx;
height: 560rpx;
background-color: #F7F8FA;
.item{
text-overflow: ellipsis;
overflow: hidden;
height: 70rpx;
&-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: 400;
color: #303030;
white-space: nowrap;
line-height: 70rpx;
padding-left: 30rpx;
box-sizing: border-box;
&-on{
background-color: #fff;
font-weight: 500;
}
font-weight: 500;
color: #FF624F;
position: absolute;
top: 30rpx;
left: 40rpx;
z-index: 2;
}
}
.m{
width: 100%;
text-align: center;
max-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;
&-bd {
overflow: hidden;
display: flex;
align-items: flex-start;
.l {
width: 210rpx;
height: 560rpx;
background-color: #fff;
.item {
text-overflow: ellipsis;
overflow: hidden;
height: 80rpx;
font-size: 28rpx;
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{
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;
.m {
width: 100%;
text-align: center;
max-height: 560rpx;
.item {
text-overflow: ellipsis;
overflow: hidden;
height: 70rpx;
font-size: 28rpx;
font-weight: 400;
color: #303030;
white-space: nowrap;
line-height: 70rpx;
box-sizing: border-box;
&-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>

@ -16,9 +16,12 @@
<view class="item">
<view class="a">所属城市</view>
<view class="b">
<picker mode="region" :value="form.region" @change="bindCityChange">
<view class="select">{{cityInfo.province}}{{cityInfo.city}}{{cityInfo.area}}<u-icon
name="arrow-right"></u-icon></view>
<picker mode="multiSelector" @change="multiChange" @columnchange="columnChange"
value="{{multiIndex}}" :range="multiArray" range-key="name">
<view class="pbox">
{{cityInfo?cityInfo.province+cityInfo.city+cityInfo.area:'请选择省市区'}}
<u-icon name="arrow-right"></u-icon>
</view>
</picker>
</view>
</view>
@ -32,8 +35,8 @@
<view class="addressList-bd" v-if="type=='edit'">
<view class="a">设为默认收货地址</view>
<view class="b">
<u-switch v-model="checked" active-color="#55BD6A" inactive-color="#eee"
@change="setDefault"></u-switch>
<u-switch v-model="checked" active-color="#55BD6A" inactive-color="#eee" @change="setDefault">
</u-switch>
</view>
</view>
<view class="addressList-fd">
@ -49,8 +52,6 @@
data() {
return {
type: 'add',
array: [],
index: 0,
checked: false,
value: "",
cityInfo: {
@ -67,12 +68,15 @@
},
addressDetail: null,
addressId: '',
multiIndex: [0, 0, 0],
multiArray: [],
multiData: []
};
},
onLoad(optios) {
console.log(JSON.parse(optios.addressDetail))
if (optios.addressDetail) {
this.type = 'edit'
this.addressDetail = JSON.parse(optios.addressDetail);
this.addressId = this.addressDetail.address_id
this.cityInfo.province = this.addressDetail.region.province;
@ -92,21 +96,62 @@
}];
this.form.detail = this.addressDetail.detail;
}
this.getProvinceAll()
},
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) {
this.cityInfo.province = e.detail.value[0];
this.cityInfo.city = e.detail.value[1];
this.cityInfo.area = e.detail.value[2];
this.form.region = e.detail.code;
this.form.region = e.detail.id;
this.form.region = [{
value: e.detail.code[0],
value: e.detail.id[0],
label: e.detail.value[0]
}, {
value: e.detail.code[1],
value: e.detail.id[1],
label: e.detail.value[1]
}, {
value: e.detail.code[2],
value: e.detail.id[2],
label: e.detail.value[2]
}];
},
@ -121,6 +166,9 @@
}
if (that.form.region == []) {
return that.$toast('请选择所属地市')
}
let parame = {
}
AddressApi.add(that.form)
.then(result => {
@ -146,8 +194,9 @@
if (that.form.region == []) {
return that.$toast('请选择所属地市')
}
AddressApi.edit(that.form)
AddressApi.edit(that.addressId, that.form)
.then(result => {
return
that.$toast(result.message)
setTimeout(() => {
uni.navigateBack()
@ -275,4 +324,68 @@
}
}
}
</style>
.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>

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

@ -62,8 +62,8 @@
<view class="recordTitle">
转账记录<text class="intro">最多上传6张</text>
</view>
<u-upload :action="action" :header="header" @on-uploaded="transferSuccess" width="180" height="180"
:file-list="transferList" :custom-btn="true" max-count="6">
<u-upload :action="action" :header="header" @on-uploaded="transferSuccess" @on-remove="transferRemove"
width="180" height="180" :file-list="transferList" :custom-btn="true" max-count="6">
<template v-slot:addBtn>
<view class="slot-btn" hover-class="slot-btn__hover" hover-stay-time="150">
<image :src="$picUrl+'/static/news/icon-upload.png'"></image>
@ -76,8 +76,8 @@
<view class="recordTitle">
聊天记录<text class="intro">最多上传6张</text>
</view>
<u-upload :action="action" :header="header" @on-uploaded="chatSuccess" width="180" height="180"
:file-list="chatList" :custom-btn="true" max-count="6">
<u-upload :action="action" :header="header" @on-uploaded="chatSuccess" @on-remove="chatRemove"
width="180" height="180" :file-list="chatList" :custom-btn="true" max-count="6">
<template v-slot:addBtn>
<view class="slot-btn" hover-class="slot-btn__hover" hover-stay-time="150">
<image :src="$picUrl+'/static/news/icon-upload.png'"></image>
@ -87,9 +87,6 @@
</u-upload>
</view>
</view>
<!-- <view class="footerBtn" @click="onSubmit">
提交
</view> -->
<view class="goods-fd">
<view class="btn" @click="onSubmit">提交</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) {
if (list.length > 0) {

Loading…
Cancel
Save