From 148117721cd0d6f5488b7f2367b688fa14b4964a Mon Sep 17 00:00:00 2001 From: mujinxia <1764373892@qq.com> Date: Thu, 22 Feb 2024 11:12:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=97=E9=93=BA=E8=AE=BE=E7=BD=AE=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=AF=B9=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/help.js | 8 +++- pages/news/consult/storeEdit.vue | 65 +++++++++++++++++++++++--------- 2 files changed, 54 insertions(+), 19 deletions(-) diff --git a/api/help.js b/api/help.js index 7d116c6..6a5a584 100644 --- a/api/help.js +++ b/api/help.js @@ -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) +} + diff --git a/pages/news/consult/storeEdit.vue b/pages/news/consult/storeEdit.vue index be955e0..bc7fc48 100644 --- a/pages/news/consult/storeEdit.vue +++ b/pages/news/consult/storeEdit.vue @@ -18,11 +18,11 @@ 进群分享图 - + @@ -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() } } } @@ -91,23 +116,26 @@ export default {