作者 刘朕

个人中心公司名称显示,修改信息公司及推荐人流程修改,扫码选择时间错误显示修复,启动页授权跳转修改

... ... @@ -122,17 +122,17 @@
}, 1000)
} else if (token != '' && re_id == 0) {
uni.showToast({
title: '请绑定客户',
icon: "none"
})
setTimeout(function() {
uni.navigateTo({
url: "/pages/binding/binding"
})
}, 1000)
// } else if (token != '' && re_id == 0) {
// uni.showToast({
// title: '请绑定客户',
// icon: "none"
// })
//
// setTimeout(function() {
// uni.navigateTo({
// url: "/pages/binding/binding"
// })
// }, 1000)
} else {
uni.scanCode({
success: function(res) {
... ... @@ -229,18 +229,18 @@
}, 1000)
} else if (token !=''&&re_id == 0) {
// } else if (token !=''&&re_id == 0) {
uni.showToast({
title: '请绑定客户',
icon: "none"
})
setTimeout(function() {
uni.navigateTo({
url: "/pages/binding/binding"
})
}, 1000)
// uni.showToast({
// title: '请绑定客户',
// icon: "none"
// })
//
// setTimeout(function() {
// uni.navigateTo({
// url: "/pages/binding/binding"
// })
// }, 1000)
}else{
if (t.is_allow == 0) {
console.log(123)
... ...
... ... @@ -33,6 +33,23 @@
<view class="gerenitem">
<view class="gerenleft">
公司名称
</view>
<view class="gerenright">
<view class="toutext" v-if="bangdingkehu==''" @click="bangding_kehu">
绑定公司
</view>
<view class="toutext" v-else @click="bangding_kehu">
{{bangdingkehu}}
</view>
<view class="rowright">
<image src="/static/img/rowright.png"></image>
</view>
</view>
</view>
<view class="gerenitem">
<view class="gerenleft">
推荐人
</view>
<view class="gerenright">
... ... @@ -46,8 +63,6 @@
<image src="/static/img/rowright.png"></image>
</view>
</view>
</view>
</view>
<view class="register" v-if="showbang">
... ... @@ -68,6 +83,24 @@
</view>
</view>
</view>
<view class="register" v-if="showbang_kehu">
<view class="registerwrap">
<view class="bangtitle">绑定客户</view>
<view class="tuiphone">
<input placeholder='请输入客户邀请码' placeholder-class='tuishouji' :value="number" @input="entrnnumber" type="text" />
</view>
<view class="tuiwarn" v-if="showfalse">
{{errmsg}}
<!-- 该客户不存在,请重新输入 -->
</view>
<!-- <view class="tuiwarn">{{content}}</view> -->
<view class="tuifoot">
<view class="tuifootleft" @click="hideshowbang_kehu">取消</view>
<view class="tuifootright" @click="quding_kehu">确定</view>
</view>
</view>
</view>
</view>
</template>
... ... @@ -77,31 +110,55 @@
data() {
return {
showbang: false,
showbang_kehu: false,
name: '',
peopleinfo: '',
phone: '',
number: '',
changename: '',
showfalse:false,
avatar:'',
errmsg:'',
bangdingpeople:''
bangdingpeople:'',
bangdingkehu:''
}
},
methods: {
bangding() {
if(this.bangdingpeople != '') {
let re_id = wx.getStorageSync('re_id');
if(re_id == 0) {
uni.showToast({
title: '请先绑定公司',
icon: 'none',
})
} else if(this.bangdingpeople != '') {
uni.showToast({
title: '已绑定推荐人,无法修改',
icon: 'none',
})
} else {
this.errmsg = '';
this.showbang = true
}
},
hideshowbang() {
this.showbang = false
},
bangding_kehu() {
if(this.bangdingkehu != '') {
uni.showToast({
title: '已绑定客户,无法修改',
icon: 'none',
})
} else {
this.errmsg = '';
this.showbang_kehu = true
}
},
hideshowbang_kehu() {
this.showbang_kehu = false
},
// 输入姓名
entername(e) {
this.changename = e.detail.value
... ... @@ -135,7 +192,14 @@
}
console.log(e)
},
entrnnumber(e) {
this.number = e.detail.value;
console.log(this.number)
if(this.number==''){
this.showfalse_kehu=false
}
console.log(e)
},
quding() {
let phone = this.phone;
... ... @@ -177,6 +241,48 @@
this.errmsg=err.msg
this.showfalse=true
});
},
quding_kehu() {
let number = this.number;
if (number.length == 0) {
uni.showToast({
title: "请输入邀请码",
icon: 'none',
})
return false
}
let param = {
code: this.number
}
app.post("api/person/bindKehu", param, 'get')
.then(res => {
console.log(res);
uni.showToast({
title: '绑定成功',
icon: 'none',
})
wx.setStorageSync('re_id',1);
setTimeout(function(){
uni.navigateBack({
checked:true
})
// this.showfalse=false
},1500)
})
.catch(err => {
console.log(err)
// uni.showToast({
// title: err.msg,
// icon: 'none',
// })
this.errmsg=err.msg
this.showfalse=true
});
}
},
onLoad(options) {
... ... @@ -185,7 +291,8 @@
this.peopleinfo = peopleinfo
this.name = peopleinfo.username;
this.avatar=peopleinfo.avatar;
this.bangdingpeople=peopleinfo.company_name
this.bangdingpeople=peopleinfo.recommender
this.bangdingkehu=peopleinfo.company_name
console.log(this.bangdingpeople)
},
... ...
... ... @@ -13,12 +13,12 @@
<view class="infohead">
<view class="infoheadleft">
<view class="infotui">姓名</view>
<view class="infoji" v-if="token!=''">{{peopleinfo.username==''?'暂无':peopleinfo.username}}</view>
<view class="infotui">推荐人</view>
<view class="infoji" v-if="token!=''">{{peopleinfo.recommender==''?'暂无':peopleinfo.recommender}}</view>
<view class="infoji" v-else>{{company}}</view>
</view>
<view class="infoheadleft">
<view class="infotui">推荐人</view>
<view class="infotui">公司名称</view>
<view class="infoji" v-if="token!=''">{{peopleinfo.company_name==''?'暂无':peopleinfo.company_name}}</view>
<view class="infoji" v-else>{{tuijianren}}</view>
</view>
... ... @@ -113,18 +113,18 @@
}, 1000)
} else if (token !=''&&re_id == 0) {
uni.showToast({
title: '请绑定客户',
icon: "none"
})
setTimeout(function() {
uni.navigateTo({
url: "/pages/binding/binding"
})
}, 1000)
// } else if (token !=''&&re_id == 0) {
//
// uni.showToast({
// title: '请绑定客户',
// icon: "none"
// })
//
// setTimeout(function() {
// uni.navigateTo({
// url: "/pages/binding/binding"
// })
// }, 1000)
}else {
let peopleinfo = this.peopleinfo;
peopleinfo = JSON.stringify(peopleinfo)
... ... @@ -154,18 +154,18 @@
}, 1000)
} else if (token !=''&&re_id == 0) {
uni.showToast({
title: '请绑定客户',
icon: "none"
})
setTimeout(function() {
uni.navigateTo({
url: "/pages/binding/binding"
})
}, 1000)
// } else if (token !=''&&re_id == 0) {
//
// uni.showToast({
// title: '请绑定客户',
// icon: "none"
// })
//
// setTimeout(function() {
// uni.navigateTo({
// url: "/pages/binding/binding"
// })
// }, 1000)
}else {
uni.navigateTo({
url: '/pages/myshuju/myshuju'
... ... @@ -190,18 +190,18 @@
}, 1000)
} else if (token !=''&&re_id == 0) {
uni.showToast({
title: '请绑定客户',
icon: "none"
})
setTimeout(function() {
uni.navigateTo({
url: "/pages/binding/binding"
})
}, 1000)
// } else if (token !=''&&re_id == 0) {
//
// uni.showToast({
// title: '请绑定客户',
// icon: "none"
// })
//
// setTimeout(function() {
// uni.navigateTo({
// url: "/pages/binding/binding"
// })
// }, 1000)
}else {
app.post("api/person/getUserInfo", '', 'get')
.then(res => {
... ... @@ -232,18 +232,18 @@
}, 1000)
} else if (token !=''&&re_id == 0) {
uni.showToast({
title: '请绑定客户',
icon: "none"
})
setTimeout(function() {
uni.navigateTo({
url: "/pages/binding/binding"
})
}, 1000)
// } else if (token !=''&&re_id == 0) {
//
// uni.showToast({
// title: '请绑定客户',
// icon: "none"
// })
//
// setTimeout(function() {
// uni.navigateTo({
// url: "/pages/binding/binding"
// })
// }, 1000)
}else {
uni.navigateTo({
url: '/pages/xiaofeijilu/xiaofeijilu',
... ...
... ... @@ -67,14 +67,14 @@
console.log(res,"返回token");
uni.setStorageSync('token', res.userInfo.token);
uni.setStorageSync("openid",res.openid);
uni.setStorageSync("re_id",1);
uni.setStorageSync("re_id",res.userInfo.re_id);
// if(res.userInfo.re_id == 0){
// uni.navigateTo({
// url: '/pages/binding/binding'
// });
// }else{
uni.switchTab({
url: '/pages/taocangoumai/taocangoumai'
url: '/pages/dianshu/dianshu'
});
// }
})
... ... @@ -87,7 +87,7 @@
// 取消登录
cancel() {
uni.switchTab({
url: '/pages/taocangoumai/taocangoumai'
url: '/pages/dianshu/dianshu'
})
}
... ...
... ... @@ -92,12 +92,14 @@
now_data: "",
number: '',
is_share: 0,
interval_number: '',
page: 1
}
},
methods: {
shubandetail(e) {
let that = this;
clearInterval(that.interval_number);
uni.navigateTo({
url: '/pages/shubandetail/shubandetail?id=' + e.id + '&number=' + this.number
})
... ... @@ -112,7 +114,6 @@
// 获取最新的数板信息
get_newdata() {
let t = this;
console.log('9999988888', t.number)
let url = "api/equipment/getNewEquipment";
let param = {
number: t.number,
... ... @@ -120,10 +121,8 @@
time: t.now_time
};
app.post(url, param, 'post').then(r => {
console.log(r, "最新的数板消息");
t.now_data = r.equipment_log;
console.log('1234567', t.now_data)
}).catch(err => {
console.log(err)
})
... ... @@ -139,7 +138,6 @@
// number:this.number
};
app.post(url, param, 'post').then(r => {
console.log(r, "获取数板信息");
t.is_over = r.is_over;
t.equipment = r.equipment;
t.shengyu_time = r.shengyu;
... ... @@ -150,7 +148,6 @@
})
},
get() {
console.log('999999999')
let number = this.shengyu_time;
// // 时间戳处理
var totalSecond = number;
... ... @@ -173,7 +170,6 @@
var secStr = sec.toString();
if (secStr.length == 1) secStr = secStr;
this.shengyu_time = dayStr + '天' + hrStr + '小时' + minStr + "分钟"
console.log('999999', this.shengyu_time)
},
... ... @@ -190,7 +186,6 @@
},
onLoad(options) {
console.log('9999900000', options)
this.number = options.num;
if (options.type == 1) {
this.is_share = 1
... ... @@ -210,10 +205,17 @@
// 获取最新的数板消息
// this.get_newdata()
setInterval(function() {
that.interval_number = setInterval(function() {
that.get_newdata()
}, 2000)
}, 2000);
},
onUnload: function () {
let that = this;
clearInterval(that.interval_number);
},
onHide() {
let that = this;
clearInterval(that.interval_number);
},
//上拉触底事件
onReachBottom: function() {
... ...
... ... @@ -253,8 +253,24 @@
t.saoshuban_number = res.result;
t.shuban_number = res.result;
t.shengyuqixian=t.time;
t.timechange()
let url = "api/equipment/getEquipmentNumber";
let param = {
number: t.shuban_number
};
app.post(url, param, 'post').then(r => {
console.log(r)
t.shengyuqixian=r.time;
t.timechange()
}).catch(err => {
this.shengyuqixian=0;
// this.timechange()
})
// t.shengyuqixian=t.time;
// t.timechange()
// t.isquanxian()
},
fail: function(res) {
... ... @@ -343,18 +359,18 @@
}, 1000)
} else if (token !=''&&re_id == 0) {
uni.showToast({
title: '请绑定客户',
icon: "none"
})
setTimeout(function() {
uni.navigateTo({
url: "/pages/binding/binding"
})
}, 1000)
// } else if (token !=''&&re_id == 0) {
//
// uni.showToast({
// title: '请绑定客户',
// icon: "none"
// })
//
// setTimeout(function() {
// uni.navigateTo({
// url: "/pages/binding/binding"
// })
// }, 1000)
}else{
console.log(t.kindtab);
console.log(t.shuban_number)
... ... @@ -424,18 +440,18 @@
}, 1000)
} else if (token !=''&&re_id == 0) {
uni.showToast({
title: '请绑定客户',
icon: "none"
})
setTimeout(function() {
uni.navigateTo({
url: "/pages/binding/binding"
})
}, 1000)
// } else if (token !=''&&re_id == 0) {
//
// uni.showToast({
// title: '请绑定客户',
// icon: "none"
// })
//
// setTimeout(function() {
// uni.navigateTo({
// url: "/pages/binding/binding"
// })
// }, 1000)
}else{
let is_allow = t.shenyu.is_allow;
console.log(is_allow, "is_allow")
... ... @@ -548,18 +564,18 @@
}, 1000)
} else if (token !=''&&re_id == 0) {
uni.showToast({
title: '请绑定客户',
icon: "none"
})
setTimeout(function() {
uni.navigateTo({
url: "/pages/binding/binding"
})
}, 1000)
// } else if (token !=''&&re_id == 0) {
//
// uni.showToast({
// title: '请绑定客户',
// icon: "none"
// })
//
// setTimeout(function() {
// uni.navigateTo({
// url: "/pages/binding/binding"
// })
// }, 1000)
}else{
let t = this;
let new_arr = t.array;
... ...