Commit e442d3aa authored by lvtz's avatar lvtz

add c线索落地

parent 3671b7f8
......@@ -283,7 +283,8 @@
"orgBindWx",
"teacheradd",
"studentadd",
"index2"
"index2",
"clueadd"
]
},
{
......
......@@ -6,6 +6,7 @@ import {
circleDetail
} from '../../../service/business/circleindex.js';
import {
getMemberMe,
generateCustomerQrcode,
} from '../../../service/common.js';
import {
......@@ -36,7 +37,8 @@ Page({
this.setData({
sid
})
this.cluesDataGet()
this.cluesDataGet();
this.getMemberMeInfo();//c留下线索要用到老师id
this.generateCustomerQrcode()
},
onShow () {
......@@ -44,7 +46,18 @@ Page({
onPullDownRefresh: function() {
},
getMemberMeInfo(){
let that = this;
getMemberMe({
school_id: that.data.sid
}).then(res=>{
if (res.code == 200) {
that.setData({
optId : res.data.schoolTeacher.id
})
}
})
},
cluesDataGet (id) {
cluesData({
school_id: this.data.sid
......@@ -273,9 +286,11 @@ Page({
// TODO 页面参数待换
generateCustomerQrcode({
// scene: `ctd=${visitor && visitor.id}&t=${this.data.tmp}`,
scene: `s=${that.data.sid}`,
page: `src/pages/signup/index`
page: `src/pages/signup/index`,
scene: `s=${that.data.sid}$oid=${this.data.optId}`,
// page: `src/pages/signup/clueadd`
}).then((res) => {
console.log(`s=${that.data.sid}&oid=${this.data.optId}`)
const {
code,
data
......
......@@ -45,7 +45,7 @@
<view class="modal-dialog modal-qrcode" wx:if="{{qrcodeModal}}">
<view class="modal-mask" bindtap="bindGenerateQrcode"></view>
<view class="modal-box">
<view class="title">已通过二维码录入2条信息</view>
<view class="title">已通过二维码录入 {{cluseInfo.qrcode_clue_count || 0}} 条信息</view>
<image class="code" src="{{qrcode}}"></image>
<view class="btn-save" bindtap="saveImg">保存至本地</view>
</view>
......
......@@ -444,6 +444,7 @@ const apis = {
crmclues: `${api}member/crm/clues`,//线索
crmcluerecords: `${api}member/crm/clue_records`,//线索跟进记录
cluesData: `${api}member/crm/clues/clue_data`,
clueLeave: `${api}student/crm`,//c端留下线索
},
commentEditor: {
clockDetail: `${api}common/clock/detail`,
......
......@@ -563,6 +563,9 @@ function formatClueFrom(val){
case 11:
text = '导入';
break;
case 12:
text = '二维码';
break;
default:
break;
}
......
......@@ -116,7 +116,16 @@ function cluerecordsList (data) {
role: '2b',
url: apis.business.potentialCustomer.crmcluerecords,
data,
method: 'Get',
method: 'GET',
errorresolve: 1,
})
}
function clueLeave (data) {
return wxRequest({
role: '2c',
url: apis.business.potentialCustomer.clueLeave,
data,
method: 'POST',
errorresolve: 1,
})
}
......@@ -133,5 +142,6 @@ export {
editCrmclues,
getCrmclue,
addCluerecords,
cluerecordsList
cluerecordsList,
clueLeave
}
\ No newline at end of file
import {
clueLeave
} from '../../../service/business/potentialcustomer.js';
import {LocalStorage,scenQueryGet} from '../../../utilities/index.js';
import regexp from '../../../constants/regexp.js';
var app = getApp();
Page({
data: {
imageRoot: app.globalData.imageRoot,
imageVersion: app.globalData.imageVersion,
localImageRoot: '../../../images/',
sid: 0,
teacherid: 0,
sourceType: 12,//小程序线索(二维码)
submitting: false,
name: '',
mobile: '',
source_type: '',
intent_course_id: ''
},
onLoad: function (options) {
let that = this;
options.scene = 's=3&oid=49';
if(options.scene){
let sceneQuery = scenQueryGet(options.scene);
const {s, oid} = sceneQuery;
that.setData({
sid: s,
teacherid: oid,
})
}else{
}
},
onShow: function () {
},
nameInput(e) {
const {
value
} = e.detail;
this.setData({
name: value
})
},
mobileInput(e) {
const {
value
} = e.detail;
this.setData({
mobile: value
})
},
save(){
let that = this;
const { name, mobile, sourceType, sid, teacherid } = this.data;
if(!name){
wx.showToast({
title: '请填写姓名',
icon: 'none',
duration: 2000
})
return;
}
if(!mobile){
wx.showToast({
title: '请填写电话号码',
icon: 'none',
duration: 2000
})
return;
}
if (!regexp.mobile.test(mobile)) {
wx.showToast({
title: '请填写正确的电话号码',
icon: 'none',
duration: 2000
})
return;
}
if(that.data.submitting){
return
}
this.setData({
submitting: false
})
clueLeave({
name: name,
mobile: mobile,
source_type: sourceType,//二维码
school_id: sid,
teacher_id: teacherid
}).then((res)=>{
const { code, data } = res;
if(code == 200){
this.setData({
submitting: false
})
wx.showToast({
title: '添加成功',
icon: 'success',
duration: 2000,
success(){
wx.reLaunch({
url: `/ucenter/index`
})
}
})
}
}).catch((res) =>{
this.setData({
submitting: false
})
})
}
})
\ No newline at end of file
{
"usingComponents": {},
"navigationBarTitleText": "留下线索"
}
\ No newline at end of file
<view class="container">
<image class="pagebg" mode="cover" src="{{localImageRoot}}2b/potentialcustomer/clueadd_bg.png?{{imageVersion}}"></image>
<view class="inner-container">
<view class="title1">填写信息</view>
<view class="title2">请在下面输入准确信息,方便我们与您联系哦~</view>
<view class="form-box">
<view class="form-item">
<input type="text" class="form-input" maxlength="{{15}}" bindinput="nameInput" value="{{name}}" placeholder="请输入姓名"/>
</view>
<view class="form-item">
<input type="number" class="form-input" maxlength="{{11}}" bindinput="mobileInput" value="{{mobile}}" placeholder="请输入手机号"/>
</view>
<view class="form-item form-submit">
<button class="form-input btn-submit" bindtap="save" disabled="{{!name || mobile.length<11}}">提交</button>
</view>
</view>
</view>
</view>
\ No newline at end of file
page{}
.container{
height: 100vh;
padding: 0 38rpx;
position: relative;
}
.pagebg{
width: 100%;
height: 100%;
position: absolute;
left: 0;
top: 0;
}
.inner-container{
position: relative;
z-index: 9;
line-height: 1;
}
.inner-container .title1{
font-size: 56rpx;
color: #fff;
padding: 53rpx 0 35rpx;
}
.inner-container .title2{
font-size: 24rpx;
color: #fff;
padding-bottom: 60rpx;
}
.form-box{
width: 100%;
height: 842rpx;
background: #fff;
border-radius: 10rpx;
padding: 75rpx 35rpx 0;
}
.form-item{
width: 100%;
padding: 25rpx 0;
}
.form-item .form-input{
width: 100%;
height: 86rpx;
border-radius: 43rpx;
background: #F6F6F6;
font-size: 28rpx;
padding: 0 40rpx;
line-height: 86rpx;
}
.form-item.form-submit{
padding: 45rpx 20rpx;
}
.form-item.form-submit .btn-submit{
background:#386ffd;
font-size: 30rpx;
color: #fff;
text-align: center;
}
.form-item.form-submit .btn-submit[disabled]{
background: #9CB7FE;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment