店铺海报功能
This commit is contained in:
@@ -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', //保存店铺海报
|
||||
|
||||
}
|
||||
|
||||
//远程图片存储地址
|
||||
|
||||
@@ -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;
|
||||
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user