Browse Source

--当用户注册时,可区分出是哪个业务人员引流--

featrue/v4.4
DESKTOP-A1SENDA\HUzy 4 years ago
parent
commit
3b5feb8a30
9 changed files with 128 additions and 9 deletions
  1. 2
      pages/agent/agent-item/index.wxml
  2. 2
      pages/agent/factory/index.wxml
  3. 21
      pages/home/info/index.js
  4. 1
      pages/home/info/index.wxml
  5. 53
      pages/home/setting/index.js
  6. 4
      pages/home/setting/index.wxml
  7. 47
      pages/home/tab1/index.js
  8. 4
      pages/home/tab1/index.json
  9. 3
      pages/home/tab1/index.wxml

2
pages/agent/agent-item/index.wxml

@ -23,7 +23,7 @@
</text>
<text class="flex" wx:if="{{item.foreignPaybackIntervalString}}">
<text class="text-black">纸厂账期:</text>
<text class="text-red">{{item.foreignPaybackIntervalString}}</text>
<text class="text-red">{{item.foreignPaybackIntervalString}}</text>
</text>
</view>
</view>

2
pages/agent/factory/index.wxml

@ -29,7 +29,7 @@
</view>
<view class="flex" style="margin-left:64rpx" wx:if="{{factoryDetail.foreignPaybackIntervalString}}">
<text class="text-black">纸厂账期:</text>
<text class="text-red">{{factoryDetail.foreignPaybackIntervalString}}</text>
<text class="text-red">{{factoryDetail.foreignPaybackIntervalString}}</text>
</view>
</view>
</view>

21
pages/home/info/index.js

@ -1,7 +1,8 @@
import {
zconfig,
getBaseInfo,
updateUserInfoZtb
updateUserInfoZtb,
postRelation
} from '../../api/ztb'
import {
updateUserInfo
@ -102,6 +103,8 @@ Page({
companyAddress: res.data.fullAddress,
userType: res.data.userType,
realName: res.data.realName || res.data.userName,
bizUserId:res.data.bizUserId,
bizUserName:res.data.bizUserName,
})
})
this.cascaderView = this.cascaderView || this.selectComponent('#wux-cascader')
@ -158,6 +161,9 @@ Page({
} else if (e1.currentTarget.dataset.tag == '昵称') {
placeholderName = that.data.userInfo.nickname
}
else if (e1.currentTarget.dataset.tag == '业务人员邀请码') {
placeholderName = that.data.userInfo.bizUserId
}
this.wuxDialog.prompt({
resetOnClose: true,
title: e1.currentTarget.dataset.tag,
@ -174,6 +180,19 @@ Page({
packageFactoryName: response
})
} else
if (e1.currentTarget.dataset.tag == '业务人员邀请码') {
// that.updateUserInfoFct({
// bizUserId: response
// })
postRelation(response).then(result => {
//成功回调
wx.hideLoading()
}).catch(err => {
//异常回调
wx.hideLoading()
util.showToast(err)
})
} else
if (e1.currentTarget.dataset.tag == '打包站占地面积') {
if (parseInt(response)>0 && parseInt(response)==Number(response)) {
that.updateUserInfoFct({

1
pages/home/info/index.wxml

@ -68,6 +68,7 @@
<view slot="header" class="text-gray">企业信息</view>
<view slot="footer" class="text-sg {{userInfo.locateCityTag?'text-blue':'input-grey'}}"></view>
</wux-cell>
</wux-cell-group>
<wux-cropper wx:if="{{visible}}" srcList="{{srcList}}" bindclose="closeCallback" bindcroped="onCropback"></wux-cropper>
<wux-dialog id="wux-dialog" />

53
pages/home/setting/index.js

@ -1,8 +1,13 @@
// pages/home/setting/index.js
import { finalizeToken } from "../../api/user"
import { $wuxDialog } from '../../../components/index'
import {
postRelation,
getBaseInfo
} from '../../api/ztb'
const event = require('../../../utils/event')
const storage = require('../../../utils/storage')
const util = require('../../../utils/util')
const app = getApp()
Page({
@ -12,13 +17,24 @@ Page({
*/
data: {
kg: app.globalData.kg,
version: 2
version: 2,
userInfo: {
bizUserId:null,
bizUserName:null
},
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
getBaseInfo().then(res => {
this.setData({
userInfo: res.data,
bizUserId:res.data.bizUserId,
bizUserName:res.data.bizUserName,
})
})
var pages = getCurrentPages()
for (let index = 0; index < pages.length; index++) {
const element = pages[index]
@ -62,5 +78,38 @@ Page({
}
}]
})
}
},
showDialog: function (e1) {
this.wuxDialog = this.wuxDialog || this.selectComponent('#wux-dialog')
var that = this
var placeholderName = ''
if (e1.currentTarget.dataset.tag == '业务人员邀请码') {
placeholderName = that.data.userInfo.bizUserId
}
this.wuxDialog.prompt({
resetOnClose: true,
title: e1.currentTarget.dataset.tag,
placeholder: placeholderName || '请输入' + e1.currentTarget.dataset.tag,
maxlength: 18,
onConfirm(e, response) {
if (util.isEmpty(response)) {
util.showToast('请输入' + e1.currentTarget.dataset.tag)
return
}
if (e1.currentTarget.dataset.tag == '业务人员邀请码') {
postRelation(response).then(result => {
//成功回调
wx.hideLoading()
}).catch(err => {
//异常回调
wx.hideLoading()
util.showToast(err)
})
}
},
})
},
})

4
pages/home/setting/index.wxml

@ -40,6 +40,10 @@
<view style="height:16rpx"></view>
<wux-cell-group>
<wux-cell title="关于纸通宝" is-link url="/pages/home/about/index"></wux-cell>
<wux-cell disabled="{{userInfo.bizUserName!=null}}" is-link data-cid='bizUserId' data-tag='业务人员邀请码' bind:click="showDialog">
<view slot="header" class="text-black">业务人员邀请码</view>
<view slot="footer" class="{{userInfo.bizUserName? 'text-black':'text-gray'}}">{{userInfo.bizUserName || '点击填写业务人员邀请码'}}</view>
</wux-cell>
</wux-cell-group>
<view class="flex flex-direction" style="padding:56rpx 24px">

47
pages/home/tab1/index.js

@ -1,9 +1,14 @@
// pages/home/tab1/index.js
import {
updateUserInfo,
getBaseInfo
getBaseInfo,
postRelation
} from '../../api/ztb'
const storage = require('../../../utils/storage')
const util = require('../../../utils/util')
const math = require('../../../utils/math')
const event = require('../../../utils/event.js')
const app = getApp()
Page({
/**
@ -19,7 +24,7 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.getUerInfoFct()
this.getUerInfoFct()
},
toNextTab: function () {
wx.navigateTo({
@ -129,6 +134,9 @@ Page({
},
getUerInfoFct: function () {
getBaseInfo().then(res => {
if(res.data.hasShowedLoginTag==false){
this.showDialog()
}
if (res.data.identityTag == '打包站') {
this.setData({
bidType: 1
@ -153,5 +161,40 @@ Page({
}
})
},
showDialog: function(){
this.wuxDialog = this.wuxDialog || this.selectComponent('#wux-dialog')
var that = this
this.wuxDialog.prompt({
resetOnClose: false,
maskClosable: false,
title: '邀请码',
// content: '联系相关业务人员获取邀请码',
placeholder: '填写业务人员邀请码(必填)',
maxlength: 6,
onConfirm(e, response) {
if(util.isEmpty(response)){
util.showToast('请输入邀请码')
that.showDialog()
return
}
that.bindRelation(response)
},
onCancel(){
}
})
},
bindRelation: function(code){
wx.showLoading({ title: '处理中', mask: true })
postRelation(code).then(result => {
//成功回调
wx.hideLoading()
}).catch(err => {
//异常回调
wx.hideLoading()
util.showToast(err)
this.showDialog()
})
},
})

4
pages/home/tab1/index.json

@ -1,3 +1,5 @@
{
"usingComponents": {}
"usingComponents": {
"wux-dialog": "/components/dialog/index"
}
}

3
pages/home/tab1/index.wxml

@ -59,4 +59,5 @@
<view class="otherInpt" wx:if="{{bidType == 4}}" >
<input placeholder="请输入你的身份" value="{{identityTag}}" bindblur="bindblur" />
</view>
</view>
</view>
<wux-dialog id="wux-dialog" />
Loading…
Cancel
Save