Skip to content

Commit

Permalink
增加三级分销功能
Browse files Browse the repository at this point in the history
  • Loading branch information
gooking committed Mar 14, 2019
1 parent ee4083b commit 7277640
Show file tree
Hide file tree
Showing 29 changed files with 625 additions and 6 deletions.
7 changes: 6 additions & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ App({
wx.hideToast()
}
});
// 获取接口和后台权限
WXAPI.vipLevel().then(res => {
that.globalData.vipLevel = res.data
})
// 获取商城名称
WXAPI.queryConfig({
key: 'mallName'
Expand Down Expand Up @@ -124,6 +128,7 @@ App({
},
globalData: {
isConnected: true,
launchOption: undefined
launchOption: undefined,
vipLevel: 0
}
})
6 changes: 5 additions & 1 deletion app.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
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.4.0",
note: '增加优惠买单功能',
version: "6.5.0",
note: '增加三级分销功能',
subDomain: "tz", // 如果你的域名是: https://api.it120.cc/abcd 那么这里只要填写 abcd
appid: "wxa46b09d413fbcaff", // 您的小程序的appid,购物单功能需要使用
shareProfile: '百款精品商品,总有一款适合您' // 首页转发的时候话术
Expand Down
Binary file removed images/banner01.jpg
Binary file not shown.
Binary file removed images/banner02.jpg
Binary file not shown.
Binary file removed images/banner03.jpg
Binary file not shown.
Binary file added images/fx.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/fxad.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed images/goods01.png
Binary file not shown.
Binary file removed images/goods02.png
Binary file not shown.
107 changes: 107 additions & 0 deletions pages/fx/apply-status.js
Original file line number Diff line number Diff line change
@@ -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',
})
}
})
3 changes: 3 additions & 0 deletions pages/fx/apply-status.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"navigationBarTitleText": "分销中心"
}
32 changes: 32 additions & 0 deletions pages/fx/apply-status.wxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<view class='noApply' wx:if="{{applyStatus == -1}}">
<form bindsubmit="bindSave" report-submit="true">
<image class="logo" src="/images/fx.png" mode="widthFix" />
<view class="profile">您还不是分销商,无法使用分销功能</view>
<button type="primary" class="mini-btn" formType="submit">申请开通</button>
</form>
</view>

<view class='noApply' wx:if="{{applyStatus == 0}}">
<form bindsubmit="goShop" report-submit="true">
<image class="logo" src="/images/fx.png" mode="widthFix" />
<view class="profile">感谢您的支持,请等待审核!</view>
<button type="primary" class="mini-btn" formType="submit">去商城逛逛</button>
</form>
</view>

<view class='noApply' wx:if="{{applyStatus == 1}}">
<form bindsubmit="goShop" report-submit="true">
<image class="logo" src="/images/fx.png" mode="widthFix" />
<view class="profile">很遗憾,您的申请没有通过</view>
<view wx:if="{{applyInfo.remark}}" class="profile" style="color:red;">{{applyInfo.remark}}</view>
<button type="primary" class="mini-btn" formType="submit">去商城逛逛</button>
</form>
</view>

<view class='noApply' wx:if="{{applyStatus == 2}}">
<form bindsubmit="goShop" report-submit="true">
<image class="logo" src="/images/fx.png" mode="widthFix" />
<view class="profile">恭喜您,您已经是一名合格的分销商!</view>
<button type="primary" class="mini-btn" formType="submit">去商城逛逛</button>
</form>
</view>
18 changes: 18 additions & 0 deletions pages/fx/apply-status.wxss
Original file line number Diff line number Diff line change
@@ -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;
}
103 changes: 103 additions & 0 deletions pages/fx/apply.js
Original file line number Diff line number Diff line change
@@ -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"
})
})
}
})
3 changes: 3 additions & 0 deletions pages/fx/apply.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"navigationBarTitleText": "申请成为分销商"
}
38 changes: 38 additions & 0 deletions pages/fx/apply.wxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<form bindsubmit="bindSave" report-submit="true">
<image class="logo" src="/images/fxad.jpeg" mode="widthFix" />
<view class="weui-cells__title title">请填写申请信息</view>
<view class="weui-cells weui-cells_after-title">
<view class="weui-cell weui-cell_input">
<view class="weui-cell__hd">
<view class="weui-label">邀请人</view>
</view>
<view class="weui-cell__bd">
<input class="weui-input" value="张龙湖 (请确认)" disabled style='color:red;' />
</view>
</view>
<view class="weui-cell weui-cell_input">
<view class="weui-cell__hd">
<view class="weui-label">姓名
<text style='color:red;'>*</text>
</view>
</view>
<view class="weui-cell__bd">
<input name="name" class="weui-input" placeholder="请输入真实姓名" />
</view>
</view>
<view class="weui-cell weui-cell_input">
<view class="weui-cell__hd">
<view class="weui-label">手机
<text style='color:red;'>*</text>
</view>
</view>
<view class="weui-cell__bd">
<input name="mobile" class="weui-input" placeholder="请输入手机号码" />
</view>
</view>
</view>
<view class="weui-cells__tips">成为分销商后卖出商品,您可以获得佣金</view>
<view class="weui-btn-area">
<button class="weui-btn" type="primary" formType="submit">申请成为分销商</button>
</view>
</form>
8 changes: 8 additions & 0 deletions pages/fx/apply.wxss
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.logo {
width: 750rpx;
}
.title {
text-align: center;
color:#333;
font-size:14px;
}
Loading

0 comments on commit 7277640

Please sign in to comment.