diff --git a/app.js b/app.js index 6c7ec847..531c15ca 100644 --- a/app.js +++ b/app.js @@ -54,6 +54,10 @@ App({ wx.hideToast() } }); + // 获取接口和后台权限 + WXAPI.vipLevel().then(res => { + that.globalData.vipLevel = res.data + }) // 获取商城名称 WXAPI.queryConfig({ key: 'mallName' @@ -124,6 +128,7 @@ App({ }, globalData: { isConnected: true, - launchOption: undefined + launchOption: undefined, + vipLevel: 0 } }) \ No newline at end of file diff --git a/app.json b/app.json index 227e9bac..b5cfc00f 100644 --- a/app.json +++ b/app.json @@ -23,7 +23,11 @@ "pages/sign/index", "pages/fetch-coupon/index", "pages/category/category", - "pages/maidan/index" + "pages/maidan/index", + "pages/fx/apply", + "pages/fx/apply-status", + "pages/fx/members", + "pages/fx/commisionLog" ], "window":{ "backgroundTextStyle":"light", diff --git a/config.js b/config.js index 1e5ce0de..601e2676 100644 --- a/config.js +++ b/config.js @@ -1,6 +1,6 @@ module.exports = { - version: "6.4.0", - note: '增加优惠买单功能', + version: "6.5.0", + note: '增加三级分销功能', subDomain: "tz", // 如果你的域名是: https://api.it120.cc/abcd 那么这里只要填写 abcd appid: "wxa46b09d413fbcaff", // 您的小程序的appid,购物单功能需要使用 shareProfile: '百款精品商品,总有一款适合您' // 首页转发的时候话术 diff --git a/images/banner01.jpg b/images/banner01.jpg deleted file mode 100644 index 74d22831..00000000 Binary files a/images/banner01.jpg and /dev/null differ diff --git a/images/banner02.jpg b/images/banner02.jpg deleted file mode 100644 index bd386f42..00000000 Binary files a/images/banner02.jpg and /dev/null differ diff --git a/images/banner03.jpg b/images/banner03.jpg deleted file mode 100644 index abac477f..00000000 Binary files a/images/banner03.jpg and /dev/null differ diff --git a/images/fx.png b/images/fx.png new file mode 100644 index 00000000..07a0ea25 Binary files /dev/null and b/images/fx.png differ diff --git a/images/fxad.jpeg b/images/fxad.jpeg new file mode 100644 index 00000000..dfc2bec4 Binary files /dev/null and b/images/fxad.jpeg differ diff --git a/images/goods01.png b/images/goods01.png deleted file mode 100644 index 5bb1a9c6..00000000 Binary files a/images/goods01.png and /dev/null differ diff --git a/images/goods02.png b/images/goods02.png deleted file mode 100644 index 632b0bb8..00000000 Binary files a/images/goods02.png and /dev/null differ diff --git a/pages/fx/apply-status.js b/pages/fx/apply-status.js new file mode 100644 index 00000000..99380b4a --- /dev/null +++ b/pages/fx/apply-status.js @@ -0,0 +1,107 @@ +const app = getApp() +const WXAPI = require('../../wxapi/main') + +Page({ + + /** + * 页面的初始数据 + */ + data: { + applyStatus: -2, // -1 表示未申请,0 审核中 1 不通过 2 通过 + applyInfo: {} + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + const _this = this + WXAPI.fxApplyProgress(wx.getStorageSync('token')).then(res => { + let applyStatus = -1 + if (res.code == 2000) { + app.goLoginPageTimeOut() + return + } + if (res.code === 700) { + _this.setData({ + applyStatus: -1 + }) + } + if (res.code === 0) { + _this.setData({ + applyStatus: res.data.status, + applyInfo: res.data + }) + } + }) + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + }, + bindSave: function (e) { + WXAPI.addTempleMsgFormid({ + token: wx.getStorageSync('token'), + type: 'form', + formId: e.detail.formId + }) + wx.navigateTo({ + url: "/pages/fx/apply" + }) + }, + goShop: function (e) { + WXAPI.addTempleMsgFormid({ + token: wx.getStorageSync('token'), + type: 'form', + formId: e.detail.formId + }) + wx.switchTab({ + url: '/pages/index/index', + }) + } +}) \ No newline at end of file diff --git a/pages/fx/apply-status.json b/pages/fx/apply-status.json new file mode 100644 index 00000000..19628323 --- /dev/null +++ b/pages/fx/apply-status.json @@ -0,0 +1,3 @@ +{ + "navigationBarTitleText": "分销中心" +} \ No newline at end of file diff --git a/pages/fx/apply-status.wxml b/pages/fx/apply-status.wxml new file mode 100644 index 00000000..50c63e3f --- /dev/null +++ b/pages/fx/apply-status.wxml @@ -0,0 +1,32 @@ + +
+ + 您还不是分销商,无法使用分销功能 + +
+
+ + +
+ + 感谢您的支持,请等待审核! + +
+
+ + +
+ + 很遗憾,您的申请没有通过 + {{applyInfo.remark}} + +
+
+ + +
+ + 恭喜您,您已经是一名合格的分销商! + +
+
\ No newline at end of file diff --git a/pages/fx/apply-status.wxss b/pages/fx/apply-status.wxss new file mode 100644 index 00000000..459b074d --- /dev/null +++ b/pages/fx/apply-status.wxss @@ -0,0 +1,18 @@ +.noApply { + margin-top: 150rpx; + text-align: center; +} +.noApply image { + width: 300rpx; +} +.profile { + text-align: center; + margin-top:30rpx; + font-size: 14px; + color:#888; +} +.mini-btn{ + margin-top: 50rpx; + margin-left: 50px; + margin-right: 50px; +} \ No newline at end of file diff --git a/pages/fx/apply.js b/pages/fx/apply.js new file mode 100644 index 00000000..c5789308 --- /dev/null +++ b/pages/fx/apply.js @@ -0,0 +1,103 @@ +const app = getApp() +const WXAPI = require('../../wxapi/main') + +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + }, + bindSave: function (e) { + WXAPI.addTempleMsgFormid({ + token: wx.getStorageSync('token'), + type: 'form', + formId: e.detail.formId + }) + const name = e.detail.value.name + const mobile = e.detail.value.mobile + if (!name) { + wx.showToast({ + title: '请输入真实姓名', + icon: 'none' + }) + return + } + if (!mobile) { + wx.showToast({ + title: '请输入手机号码', + icon: 'none' + }) + return + } + WXAPI.fxApply(wx.getStorageSync('token'), name, mobile).then(res => { + if (res.code != 0) { + wx.showToast({ + title: res.msg, + icon: 'none' + }) + return + } + wx.navigateTo({ + url: "/pages/fx/apply-status" + }) + }) + } +}) \ No newline at end of file diff --git a/pages/fx/apply.json b/pages/fx/apply.json new file mode 100644 index 00000000..f7a69656 --- /dev/null +++ b/pages/fx/apply.json @@ -0,0 +1,3 @@ +{ + "navigationBarTitleText": "申请成为分销商" +} \ No newline at end of file diff --git a/pages/fx/apply.wxml b/pages/fx/apply.wxml new file mode 100644 index 00000000..088aa0f1 --- /dev/null +++ b/pages/fx/apply.wxml @@ -0,0 +1,38 @@ +
+ + 请填写申请信息 + + + + 邀请人 + + + + + + + + 姓名 + * + + + + + + + + + 手机 + * + + + + + + + + 成为分销商后卖出商品,您可以获得佣金 + + + +
\ No newline at end of file diff --git a/pages/fx/apply.wxss b/pages/fx/apply.wxss new file mode 100644 index 00000000..ff745da0 --- /dev/null +++ b/pages/fx/apply.wxss @@ -0,0 +1,8 @@ +.logo { + width: 750rpx; +} +.title { + text-align: center; + color:#333; + font-size:14px; +} \ No newline at end of file diff --git a/pages/fx/commisionLog.js b/pages/fx/commisionLog.js new file mode 100644 index 00000000..275f4dd5 --- /dev/null +++ b/pages/fx/commisionLog.js @@ -0,0 +1,73 @@ +const app = getApp() +const WXAPI = require('../../wxapi/main') +Page({ + + /** + * 页面的初始数据 + */ + data: { + commisionLog: [] + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + const _this = this + WXAPI.fxCommisionLog({ + token: wx.getStorageSync('token') + }).then(res => { + if (res.code == 0) { + _this.setData({ + commisionLog: res.data.result + }) + } else { + _this.setData({ + commisionLog: [] + }) + } + }) + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + } +}) \ No newline at end of file diff --git a/pages/fx/commisionLog.json b/pages/fx/commisionLog.json new file mode 100644 index 00000000..4e2f48be --- /dev/null +++ b/pages/fx/commisionLog.json @@ -0,0 +1,3 @@ +{ + "navigationBarTitleText": "返佣明细" +} \ No newline at end of file diff --git a/pages/fx/commisionLog.wxml b/pages/fx/commisionLog.wxml new file mode 100644 index 00000000..6266fe19 --- /dev/null +++ b/pages/fx/commisionLog.wxml @@ -0,0 +1,18 @@ + +返佣明细 + + 暂无数据 + + + + + + {{ item.money }} {{item.unit==0?'元':'积分'}} + {{item.level}}级返佣 {{ item.bili }}% + 已到账 + 未到账 + + {{ item.nicks }} 于 {{ item.dateAdd }} 消费 + + + \ No newline at end of file diff --git a/pages/fx/commisionLog.wxss b/pages/fx/commisionLog.wxss new file mode 100644 index 00000000..ff745da0 --- /dev/null +++ b/pages/fx/commisionLog.wxss @@ -0,0 +1,8 @@ +.logo { + width: 750rpx; +} +.title { + text-align: center; + color:#333; + font-size:14px; +} \ No newline at end of file diff --git a/pages/fx/members.js b/pages/fx/members.js new file mode 100644 index 00000000..acb04186 --- /dev/null +++ b/pages/fx/members.js @@ -0,0 +1,106 @@ +const app = getApp() +const WXAPI = require('../../wxapi/main') + +var sliderWidth = 96; +Page({ + + /** + * 页面的初始数据 + */ + data: { + number1: 0, + number2: 0, + activeIndex: 0, + sliderOffset: 0, + sliderLeft: 0, + grids: [0, 1, 2, 3, 4, 5, 6, 7, 8] + }, + + onLoad: function () { + var that = this; + wx.getSystemInfo({ + success: function (res) { + that.setData({ + sliderLeft: (res.windowWidth / 2 - sliderWidth) / 2, + sliderOffset: res.windowWidth / 2 * that.data.activeIndex + }); + } + }); + }, + tabClick: function (e) { + this.setData({ + sliderOffset: e.currentTarget.offsetLeft, + activeIndex: e.currentTarget.id + }); + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + const _this = this + WXAPI.fxMembers({ + token: wx.getStorageSync('token') + }).then(res => { + if (res.code == 700) { + _this.setData({ + members: [], + number1: 0, + number2: 0 + }) + } + if (res.code == 0) { + let number1 = 0 + let number2 = 0 + res.data.result.forEach(ele => { + if (ele.level == 1) { + number1++ + } + if (ele.level == 2) { + number2++ + } + }) + _this.setData({ + members: res.data.result, + number1: number1, + number2: number2 + }) + } + }) + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + } +}) \ No newline at end of file diff --git a/pages/fx/members.json b/pages/fx/members.json new file mode 100644 index 00000000..017f788c --- /dev/null +++ b/pages/fx/members.json @@ -0,0 +1,3 @@ +{ + "navigationBarTitleText": "我的团队" +} \ No newline at end of file diff --git a/pages/fx/members.wxml b/pages/fx/members.wxml new file mode 100644 index 00000000..0eb076c5 --- /dev/null +++ b/pages/fx/members.wxml @@ -0,0 +1,49 @@ + + + + + + + 一级 + {{number1}} + + + + + 二级 + {{number1}} + + + + + + + + + + + \ No newline at end of file diff --git a/pages/fx/members.wxss b/pages/fx/members.wxss new file mode 100644 index 00000000..50103f37 --- /dev/null +++ b/pages/fx/members.wxss @@ -0,0 +1,8 @@ +page, +.page, +.page__bd{ + height: 100%; +} +.page__bd{ + padding-bottom: 0; +} \ No newline at end of file diff --git a/pages/my/index.js b/pages/my/index.js index ae5086ed..60e1189c 100755 --- a/pages/my/index.js +++ b/pages/my/index.js @@ -19,7 +19,8 @@ Page({ } else { that.setData({ userInfo: userInfo, - version: CONFIG.version + version: CONFIG.version, + vipLevel: app.globalData.vipLevel }) } this.getUserApiInfo(); diff --git a/pages/my/index.wxml b/pages/my/index.wxml index a450b6a1..1982b6f2 100755 --- a/pages/my/index.wxml +++ b/pages/my/index.wxml @@ -35,8 +35,22 @@ 待评价 + + - + + 成为分销商 + + + 我的团队 + + + 返佣明细 + + + + + 优惠买单 diff --git a/wxapi/main.js b/wxapi/main.js index edd287a7..15558b4b 100644 --- a/wxapi/main.js +++ b/wxapi/main.js @@ -300,5 +300,20 @@ module.exports = { }, payBill: (data) => { return request('/payBill/pay', true, 'post', data) + }, + vipLevel: () => { + return request('/config/vipLevel', true, 'get') + }, + fxApply: (token, name, mobile) => { + return request('/saleDistribution/apply', true, 'post', { token, name, mobile }) + }, + fxApplyProgress: (token) => { + return request('/saleDistribution/apply/progress', true, 'get', { token }) + }, + fxMembers: (data) => { + return request('/saleDistribution/members', true, 'post', data) + }, + fxCommisionLog: (data) => { + return request('/saleDistribution/commision/log', true, 'post', data) } } \ No newline at end of file