店铺设置接口对接

version/0412
mujinxia 1 year ago
parent 00ed2ea1f1
commit 148117721c
  1. 8
      api/help.js
  2. 65
      pages/news/consult/storeEdit.vue

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

@ -18,11 +18,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" :header="header" @on-uploaded="success" width="160" height="160" <u-upload :action="action" :header="header" @on-remove="onRemove" @on-uploaded="success" width="160"
:file-list="fileList" :custom-btn="true" max-count="1"> height="160" :file-list="fileList" :custom-btn="true" max-count="1">
<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>
<view class="1">上传图片</view> <view class="1">上传图片</view>
</view> </view>
</template> </template>
@ -42,12 +42,10 @@ import * as help from '@/api/help'
export default { export default {
data() { data() {
return { return {
checked: false,
action: '', action: '',
header: {}, header: {},
value: "",
fileList: [], fileList: [],
image_ids: [] image_id: '',
}; };
}, },
onReady() { onReady() {
@ -58,6 +56,9 @@ export default {
'platform': "MP-WEIXIN", 'platform': "MP-WEIXIN",
} }
}, },
onLoad() {
this.onShowInfo()
},
methods: { methods: {
// //
success(list) { success(list) {
@ -67,12 +68,20 @@ export default {
uni.showToast({ uni.showToast({
title: "上传成功" title: "上传成功"
}) })
// this.image_ids = response.data.fileInfo.file_id this.image_id = response.data.fileInfo.file_id
} }
} }
}, },
onSaveSubmit() { 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 => { .then(res => {
if (res.status) { if (res.status) {
uni.showToast({ uni.showToast({
@ -83,6 +92,22 @@ export default {
} }
}) })
.finally() .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()
} }
} }
} }
@ -91,23 +116,26 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.addressList { .addressList {
margin-top: 16rpx; margin-top: 16rpx;
padding: 24rpx 40rpx 40rpx; padding: 24rpx 40rpx 40rpx;
background: #fff; background: #fff;
&-hd { &-hd {
background-color: #fff; background-color: #fff;
.items {
.items {
line-height: 50rpx; line-height: 50rpx;
font-size: 28rpx; font-size: 28rpx;
color: #212121; color: #212121;
.a { .a {
font-size: 28rpx; font-size: 28rpx;
color: #3B3B3B; color: #3B3B3B;
text { text {
font-size: 24rpx; font-size: 24rpx;
font-weight: 400; font-weight: 400;
color: #ABABAB; color: #ABABAB;
margin-left: 10rpx; margin-left: 10rpx;
} }
} }
@ -117,14 +145,15 @@ export default {
.slot-btn { .slot-btn {
width: 184rpx; width: 184rpx;
height: 184rpx; height: 184rpx;
background: #F6F6F6; background: #F6F6F6;
border-radius: 8rpx; border-radius: 8rpx;
border: 1px solid #C0C0C0; border: 1px solid #C0C0C0;
text-align: center; text-align: center;
font-size: 24rpx; font-size: 24rpx;
font-weight: 500; font-weight: 500;
color: #757575; color: #757575;
image { image {
width: 50rpx; width: 50rpx;
height: 50rpx; height: 50rpx;

Loading…
Cancel
Save