From ac19fdae298b99dcae1e84f68e3ac5e981867adb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=81=E5=8F=B6?= Date: Tue, 9 Nov 2021 17:35:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=97=E9=93=BA=E6=B5=B7=E6=8A=A5=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commons/js/config.js | 5 ++++- commons/js/utils/apiQuery.js | 14 ++++++++++++++ pages/distribute/storePoster/index.js | 23 +++++++++++++++++------ 3 files changed, 35 insertions(+), 7 deletions(-) diff --git a/commons/js/config.js b/commons/js/config.js index 1b47ea3..e17e090 100644 --- a/commons/js/config.js +++ b/commons/js/config.js @@ -1,4 +1,4 @@ -const env = "d"; +const env = "p"; const version = 1, @@ -84,6 +84,9 @@ api = { appServices:'app/services', //获取代办服务列表 appFine:'app/fine', //获取精品赠送列表 + materialHomeBiz:'material/home/biz', //店铺海报 + materialHomePosters:'material/home/posters', //保存店铺海报 + } //远程图片存储地址 diff --git a/commons/js/utils/apiQuery.js b/commons/js/utils/apiQuery.js index e5f4c7f..1852952 100644 --- a/commons/js/utils/apiQuery.js +++ b/commons/js/utils/apiQuery.js @@ -544,4 +544,18 @@ apiQuery.getAppFine = function (params) { }) } +//店铺海报 +apiQuery.getMaterialHomeBiz = function (params) { + return new Promise(function (resolve, reject) { + HttpRequest(false, Config.api.materialHomeBiz, 2, params, "GET", resolve, reject) + }) +} + +//保存店铺海报 +apiQuery.putMaterialHomePosters = function (params) { + return new Promise(function (resolve, reject) { + HttpRequest(false, Config.api.materialHomePosters, 2, params, "PUT", resolve, reject) + }) +} + export default apiQuery; \ No newline at end of file diff --git a/pages/distribute/storePoster/index.js b/pages/distribute/storePoster/index.js index bfdc49b..1a7b825 100644 --- a/pages/distribute/storePoster/index.js +++ b/pages/distribute/storePoster/index.js @@ -3,7 +3,6 @@ const app = getApp() Page({ data: { poster_full_url:'', - poster_url:'', imgUrl: _.config.imgUrl,//静态图片路径 poster: { isShow: false, @@ -15,6 +14,18 @@ Page({ }, onLoad: function (options) { this.getMaterialHomeQrcode() + this.getMaterialHomeBiz() + }, + + //获取二维码 + getMaterialHomeBiz(){ + _.apiQuery.getMaterialHomeBiz().then(res => { + this.setData({ + poster_full_url:res.data.posters?res.data.posters:'', + 'poster.storName':res.data.biz_name, + 'poster.storaAddress':res.data.address, + }) + }) }, //获取二维码 @@ -54,9 +65,11 @@ Page({ wx.hideLoading(); if (resp.data.code == 200) { - that.setData({ - poster_full_url:resp.data.data.full_url, - poster_url:resp.data.data.url, + ///保存店铺海报 + _.apiQuery.putMaterialHomePosters({posters:resp.data.data.url}).then(resw => { + that.setData({ + poster_full_url:resp.data.data.full_url, + }) }) } @@ -90,8 +103,6 @@ Page({ that.setData({ 'poster.isCreateQrcode':true, 'poster.customPoster':that.data.poster_full_url, - 'poster.storName':that.data.storName, - 'poster.storaAddress':that.data.storaAddress, }) setTimeout(function(){ that.setData({