Skip to content

Commit

Permalink
增加手机管理端入口
Browse files Browse the repository at this point in the history
  • Loading branch information
woniudiancang committed Oct 7, 2020
1 parent 3497f65 commit 2449bac
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 36 deletions.
48 changes: 15 additions & 33 deletions README.md
Expand Up @@ -8,12 +8,15 @@

# 招募开发者

希望找一些志同道合的朋友一起来完善这个开源项目,持续更新下去,有兴趣的可以加入QQ群 ( 926321567 ) 联系管理员,期待您的加入!
希望找一些志同道合的朋友一起来完善这个开源项目,持续更新下去,有兴趣的可以联系管理员,期待您的加入!

QQ群:926321567

# 荣誉墙

- [@woniudiancang 蜗牛小姐姐,本项目主导者、发起人](https://github.com/woniudiancang)
- [@wangxy2020 Jack Wong](https://github.com/wangxy2020)
- 期待您的加入

# 功能展示
## 首页
Expand Down Expand Up @@ -145,6 +148,17 @@ https://developers.weixin.qq.com/miniprogram/dev/devtools/download.html

[《餐饮口味/加料/配菜/口味选项解决方案》](https://www.it120.cc/help/eoee8a.html)


## 小票打印机

<img src="https://dcdn.it120.cc/2020/10/05/5fc1dd74-130d-421c-83de-ab5555d914bd.png" width="200px">

[《api工厂小票机 / 不干胶标签机配置自动打印》](https://www.it120.cc/help/ggrun8.html)

小票机是打印热敏小票,例如超市购物时候打印的小票;美团、饿了么外卖的打印小票;

标签机是打印的不干胶的,例如奶茶店打印出来贴在杯子上面的;

# 常见问题

## 无法登陆 / 无法获取 openid
Expand All @@ -167,36 +181,4 @@ https://developers.weixin.qq.com/miniprogram/dev/devtools/download.html
- 小程序开发工具中,点击 “编译”按钮,重新编译小程序即可;


# 二次开发说明

## 如何弹出登陆授权框

- wxml 文件中增加:

```xml
<van-dialog id="van-dialog-auth-login" bind:getuserinfo="processLogin" />
```

- js 文件中增加:

```js
// 引入 auth
const AUTH = require('../../utils/auth')
// 弹出框
AUTH.openLoginDialog()
// 处理授权登陆
processLogin(e) {
if (!e.detail.userInfo) {
wx.showToast({
title: '已取消',
icon: 'none',
})
return;
}
AUTH.register(this);
}
```




2 changes: 1 addition & 1 deletion app.js
Expand Up @@ -53,7 +53,7 @@ App({
wx.hideToast()
}
})
WXAPI.queryConfigBatch('mallName,myBg,mapPos,order_hx_uids,subscribe_ids,share_profile,zxdz').then(res => {
WXAPI.queryConfigBatch('mallName,myBg,mapPos,order_hx_uids,subscribe_ids,share_profile,zxdz,admin_uids').then(res => {
if (res.code == 0) {
res.data.forEach(config => {
wx.setStorageSync(config.key, config.value);
Expand Down
4 changes: 2 additions & 2 deletions config.js
@@ -1,5 +1,5 @@
module.exports = {
version: "2.11.0",
note: '增加在线排队取号功能',
version: "2.12.0",
note: '增加手机管理端入口',
subDomain: "beeorder", // 根据教程 https://www.it120.cc/help/qr6l4m.html 查看并设置你自己的 subDomain
}
10 changes: 10 additions & 0 deletions pages/my/index.js
Expand Up @@ -39,6 +39,10 @@ Page({
if (this.data.order_hx_uids && this.data.order_hx_uids.indexOf(res.data.base.id) != -1) {
_data.canHX = true // 具有扫码核销的权限
}
const admin_uids = wx.getStorageSync('admin_uids')
if (admin_uids && admin_uids.indexOf(res.data.base.id) != -1) {
_data.isAdmin = true
}
this.setData(_data)
}
},
Expand Down Expand Up @@ -101,4 +105,10 @@ Page({
url: '/pages/score/logs',
})
},
goadmin() {
wx.navigateToMiniProgram({
appId: 'wx5e5b0066c8d3f33d',
path: 'pages/login/auto?token=' + wx.getStorageSync('token'),
})
}
})
1 change: 1 addition & 0 deletions pages/my/index.wxml
Expand Up @@ -40,5 +40,6 @@
<van-cell icon="orders-o" title="全部订单" size="large" is-link url="/pages/all-orders/index" />
<van-cell icon="location-o" title="收货地址" size="large" is-link url="/pages/ad/index" />
<van-cell icon="info-o" title="关于我们" size="large" is-link url="/pages/about/index" />
<van-cell icon="desktop-o" title="管理员入口" is-link bind:click="goadmin" />
</view>
<view class="version">v{{version}}</view>

0 comments on commit 2449bac

Please sign in to comment.