Skip to content

Commit

Permalink
小程序启动图后台可管理
Browse files Browse the repository at this point in the history
  • Loading branch information
gooking committed Feb 26, 2019
1 parent d5b72f9 commit ecb9733
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 17 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,15 @@ module.exports = {

5、重启您的小程序开发工具,完成

6、如何在后台管理小程序启动图和首页头部的轮播 banner 图片

```javascript
这两个功能都是使用后台 “系统设置” --> “banner” 管理功能来实现的;
后台发布banner的时候,自定义类型请分别填写 app 和 index;
小程序会自动读取类型为 app 的banner图片作为启动展示图片;
小程序会自动读取类型为 index 的banner图片作为首页头部的轮播图;
```

## 常见问题

- [如何修改小程序商城的标题?](https://www.it120.cc/info/wechat-app-mall/10478)
Expand Down
4 changes: 2 additions & 2 deletions config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
version: "6.1.1",
note: '可领取口令优惠券',
version: "6.2.0",
note: '启动图后台可管理、充值增加单笔满多少金额赠送一定的金额',
subDomain: "tz", // 如果你的域名是: https://api.it120.cc/abcd 那么这里只要填写 abcd
appid: "wxa46b09d413fbcaff", // 您的小程序的appid,购物单功能需要使用
shareProfile: '百款精品商品,总有一款适合您' // 首页转发的时候话术
Expand Down
37 changes: 22 additions & 15 deletions pages/start/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,13 @@ const CONFIG = require('../../config.js')
var app = getApp();
Page({
data: {
banners:[
{
id:1,
picUrl: 'https://cdn.it120.cc/apifactory/2019/02/21/2d2717a2ab4782d5e752ec087b9fa5fe.png'
},
{
id: 2,
picUrl: 'https://cdn.it120.cc/apifactory/2019/02/21/e04ec54592d16c98fc79eb0107a12731.png'
},
{
id: 3,
picUrl: 'https://cdn.it120.cc/apifactory/2019/02/21/70bccd7ef011cbf7c72cdfac1eb157e8.png'
}
],
banners:[],
swiperMaxNumber: 3,
swiperCurrent: 0,
height: wx.getSystemInfoSync().windowHeight
},
onLoad:function(){
onLoad:function(){
const _this = this
wx.setNavigationBarTitle({
title: wx.getStorageSync('mallName')
})
Expand All @@ -31,6 +19,25 @@ Page({
wx.switchTab({
url: '/pages/index/index',
});
} else {
// 展示启动页
WXAPI.banners({
type: 'app'
}).then(function (res) {
if (res.code == 700) {
wx.switchTab({
url: '/pages/index/index',
});
} else {
_this.setData({
banners: res.data
});
}
}).catch(function (e) {
wx.switchTab({
url: '/pages/index/index',
});
})
}
},
onShow:function(){
Expand Down
3 changes: 3 additions & 0 deletions wxapi/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,5 +291,8 @@ module.exports = {
},
cashLogs: (data) => {
return request('/user/cashLog', true, 'post', data)
},
rechargeSendRules: () => {
return request('/user/recharge/send/rule', true, 'get')
}
}

0 comments on commit ecb9733

Please sign in to comment.