Compare commits

...

2 Commits

  1. 8
      api/help.js
  2. 104
      pages/news/consult/storeEdit.vue

@ -7,7 +7,8 @@ const api = {
addGoodsSource: 'user/addGoodsSource',
joinStore: 'store/joinStore',
getStoreType: 'store/getStoreType',
storeSet:'store/joinStore'
storeSet:'store/editStore',
storeInfo:'store/getStoreInfo'
}
// 帮助中心列表
@ -34,3 +35,8 @@ export const getStoreType = (param) => {
export const storeSet = (param) => {
return request.post(api.storeSet, param)
}
// 店铺信息
export const storeInfo = (param) => {
return request.get(api.storeInfo, param)
}

@ -1,7 +1,7 @@
<template>
<view class="addressList">
<view class="addressList-hd">
<view class="items">
<!-- <view class="items">
<view class="a">门店相册图片<text>(最多可上传 5 尺寸 230px*236px 大小5M</text></view>
<view class="c">
<u-upload :action="action" :header="header" width="160" @on-uploaded="success" max-count="5"
@ -14,15 +14,15 @@
</template>
</u-upload>
</view>
</view>
</view> -->
<view class="items">
<view class="a">进群分享图<text>(最多可上传 1 </text></view>
<view class="a">进群分享图<text></text></view>
<view class="c">
<u-upload :action="action" :header="header" @on-uploaded="success" width="160" height="160"
:file-list="fileList" :custom-btn="true" max-count="1">
<u-upload :action="action" :header="header" @on-remove="onRemove" @on-uploaded="success" width="160"
height="160" :file-list="fileList" :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>
<image :src="$picUrl + '/static/news/icon-upload.png'"></image>
<view class="1">上传图片</view>
</view>
</template>
@ -42,12 +42,10 @@ import * as help from '@/api/help'
export default {
data() {
return {
checked: false,
action: '',
header: {},
value: "",
fileList: [],
image_ids: []
image_id: '',
};
},
onReady() {
@ -58,6 +56,9 @@ export default {
'platform': "MP-WEIXIN",
}
},
onLoad() {
this.onShowInfo()
},
methods: {
//
success(list) {
@ -67,12 +68,20 @@ export default {
uni.showToast({
title: "上传成功"
})
// this.image_ids = response.data.fileInfo.file_id
this.image_id = response.data.fileInfo.file_id
}
}
},
onSaveSubmit() {
help.storeSet({image_ids:this.image_ids})
if (!this.image_id) {
uni.showToast({
title: '请先上传图片!',
icon: 'none',
duration: 2000
})
return
}
help.storeSet({ group_share_img_id: this.image_id })
.then(res => {
if (res.status) {
uni.showToast({
@ -83,6 +92,22 @@ export default {
}
})
.finally()
},
onRemove() {
this.image_id = ''
this.fileList = []
},
onShowInfo() {
help.storeInfo()
.then(res => {
if (res.status == 200) {
this.fileList = [{
url: res.data.group_share_img
}]
this.image_id = res.data.group_share_img_id
}
})
.finally()
}
}
}
@ -90,58 +115,27 @@ export default {
<style lang="scss" scoped>
.addressList {
padding: 0 0 20rpx;
overflow: hidden;
margin-top: 16rpx;
padding: 24rpx 40rpx 40rpx;
background: #fff;
&-hd {
background-color: #fff;
padding: 0 25rpx 25rpx;
overflow: hidden;
.item {
padding: 20rpx 0;
line-height: 50rpx;
font-size: 28rpx;
color: #212121;
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid #F7F7F7;
.b {
font-size: 28rpx;
color: #9D9D9D;
flex: 1;
text-align: right;
input {
width: 100%;
line-height: 50rpx;
font-size: 28rpx;
color: #212121;
}
.select {
color: #C7C7C7;
&-on {
color: #212121;
}
}
}
}
.items {
padding: 20rpx 0;
line-height: 50rpx;
font-size: 28rpx;
color: #212121;
.a {
font-size: 28rpx;
color: #3B3B3B;
text {
font-size: 24rpx;
font-weight: 400;
color: #ABABAB;
margin-left: 10rpx;
}
}
@ -150,20 +144,20 @@ export default {
overflow: hidden;
.slot-btn {
width: 80px;
height: 80px;
background: #FFFFFF;
border-radius: 10rpx;
width: 184rpx;
height: 184rpx;
background: #F6F6F6;
border-radius: 8rpx;
border: 1px solid #C0C0C0;
text-align: center;
font-size: 24rpx;
font-weight: 500;
color: #D1D1D1;
color: #757575;
image {
width: 50rpx;
height: 50rpx;
margin-top: 20rpx;
margin-top: 40rpx;
}
}
}

Loading…
Cancel
Save