登录、客户等

master
yujialong 3 years ago
parent 10d6c0331f
commit c28867f2d0
  1. 4
      apis/modules/client.js
  2. 4
      apis/modules/product.js
  3. 6
      apis/modules/user.js
  4. 5
      apis/request.js
  5. 35
      libs/WXBizDataCrypt.js
  6. 57
      pages.json
  7. 64
      pages/addCourse/addCourse.vue
  8. 62
      pages/addMember/addMember.vue
  9. 45
      pages/agreement/agreement.vue
  10. 32
      pages/clients/clients.vue
  11. 95
      pages/login/login.vue
  12. 41
      pages/orderDetail/orderDetail.vue
  13. 3
      pages/products/products.vue
  14. BIN
      static/image/index/index1.png
  15. BIN
      static/image/index/index2.png
  16. BIN
      static/image/index/index3.png
  17. BIN
      static/image/index/index4.png
  18. BIN
      static/image/index/index5.png
  19. BIN
      static/image/index/index6.png
  20. BIN
      static/image/index/index7.png

@ -5,6 +5,10 @@ export const queryCustomer = (data) => {
return post('nakadai/nakadai/customer/queryCustomer', data)
}
export const list = (data) => {
return post('nakadai/nakadai/customer/GetCustomerListBasedOnBusinessManagerId', data)
}
export const queryCustomerDetails = (data) => {
return get('nakadai/nakadai/customer/queryCustomerDetails', data)
}

@ -1,10 +1,6 @@
import request from '@/apis/request.js'
const { get, post } = request
export const curriculumList = (data) => {
return post('nakadai/nakadai/curriculum/curriculumList', data)
}
export const AppletsDataProductList = (data) => {
return post('nakadai/nakadai/dataProduct/AppletsDataProductList', data)
}

@ -0,0 +1,6 @@
import request from '@/apis/request.js'
const { get, post } = request
export const login = (data) => {
return get('users/users/user/weChatAppletCallback', data)
}

@ -12,12 +12,13 @@ const request = options => {
})
}
const header = Object.assign({}, config.headers, {
token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1c2VyIiwiaWF0IjoxNjUzNjE3NjI4LCJleHAiOjE2NTM2NjA4MjgsImFjY291bnRJZCI6IjEifQ.AmvmMxWkRD4f8J4oWHoRvm1CCrzBm7TH2QDG4E175_s'
token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1c2VyIiwiaWF0IjoxNjUzODc2NDczLCJleHAiOjE2NTM5MTk2NzMsImFjY291bnRJZCI6IjEifQ.sX2qEUJk_EzltbrLOos_ZFuyj_5OrXFhvq_qahbIfmc'
})
return new Promise((resolve, reject)=>{
const { url } = options
uni.request({
header,
url: config.baseURL + options.url,
url: (url.includes('weChatAppletCallback') ? 'http://192.168.31.137:9000/' : config.baseURL) + url,
method: options.method || 'GET', // 请求类型,默认为GET
data: options.data || {}, // 请求参数,默认空对象
success: ({ data }) => {

@ -0,0 +1,35 @@
var crypto = require('crypto')
function WXBizDataCrypt(appId, sessionKey) {
this.appId = appId
this.sessionKey = sessionKey
}
WXBizDataCrypt.prototype.decryptData = function (encryptedData, iv) {
// base64 decode
var sessionKey = new Buffer(this.sessionKey, 'base64')
encryptedData = new Buffer(encryptedData, 'base64')
iv = new Buffer(iv, 'base64')
try {
// 解密
var decipher = crypto.createDecipheriv('aes-128-cbc', sessionKey, iv)
// 设置自动 padding 为 true,删除填充补位
decipher.setAutoPadding(true)
var decoded = decipher.update(encryptedData, 'binary', 'utf8')
decoded += decipher.final('utf8')
decoded = JSON.parse(decoded)
} catch (err) {
throw new Error('Illegal Buffer')
}
if (decoded.watermark.appid !== this.appId) {
throw new Error('Illegal Buffer')
}
return decoded
}
module.exports = WXBizDataCrypt

@ -1,11 +1,19 @@
{
"pages": [
{
"path" : "pages/login/login",
"style" :
{
"navigationBarTitleText": "登录",
"enablePullDownRefresh": false
}
},
{
"path" : "pages/orders/orders",
"style" :
{
"navigationBarTitleText": "订单列表",
"enablePullDownRefresh": false
"enablePullDownRefresh": true
}
},
{
@ -24,20 +32,12 @@
"enablePullDownRefresh": true
}
},
{
"path" : "pages/clientDetail/clientDetail",
"style" :
{
"navigationBarTitleText": "客户详情",
"enablePullDownRefresh": false
}
},
{
"path" : "pages/orderDetail/orderDetail",
"path" : "pages/addCourse/addCourse",
"style" :
{
"navigationBarTitleText": "订单详情",
"enablePullDownRefresh": false
"navigationBarTitleText": "选择产品",
"enablePullDownRefresh": true
}
},
{
@ -46,11 +46,19 @@
"navigationBarTitleText": "首页"
}
},
{
"path" : "pages/clientDetail/clientDetail",
"style" :
{
"navigationBarTitleText": "客户详情",
"enablePullDownRefresh": false
}
},
{
"path" : "pages/login/login",
"path" : "pages/orderDetail/orderDetail",
"style" :
{
"navigationBarTitleText": "登录",
"navigationBarTitleText": "订单详情",
"enablePullDownRefresh": false
}
},
@ -62,14 +70,6 @@
"enablePullDownRefresh": false
}
},
{
"path" : "pages/addMember/addMember",
"style" :
{
"navigationBarTitleText": "添加成员",
"enablePullDownRefresh": false
}
},
{
"path" : "pages/addStaff/addStaff",
"style" :
@ -149,22 +149,23 @@
"navigationBarTitleText": "详情",
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/addCourse/addCourse",
},
{
"path" : "pages/editCourse/editCourse",
"style" :
{
"navigationBarTitleText": "选择产品",
"navigationBarTitleText": "编辑产品",
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/editCourse/editCourse",
"path" : "pages/agreement/agreement",
"style" :
{
"navigationBarTitleText": "编辑产品",
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
],
"condition": { //

@ -12,9 +12,10 @@
<li v-for="item in list">
<uni-data-checkbox class="check" multiple v-model="item.check" :localdata="item.checkData"></uni-data-checkbox>
<image class="icon" src="../../static/image/course1.png" mode="widthFix"></image>
{{ item.curriculumName }}
{{ item.productName }}
</li>
</ul>
<uni-load-more :status="status" />
<view class="btn-wrap">
<uni-data-checkbox class="check" multiple v-model="checkAll" :localdata="checkAllData" @change="checkChange"></uni-data-checkbox>
@ -24,7 +25,7 @@
</template>
<script>
import { curriculumList } from '@/apis/modules/course.js'
import { AppletsDataProductList } from '@/apis/modules/product.js'
import { renew } from '@/apis/modules/order.js'
export default {
data() {
@ -34,7 +35,7 @@
curTab: '',
tabs: [
{
name: '不限',
name: '全部',
id: ''
},
{
@ -47,9 +48,11 @@
},
{
name: '数据产品',
id: 3
id: 2
}
],
reachBottom: 0, // 0->,1->,-1->
status: 'more', // more|loading|noMore
searchTimer: null,
orderStatus: '',
productStatus: '',
@ -80,11 +83,20 @@
},
//
onPullDownRefresh() {
this.getList()
this.initList()
setTimeout(() => {
uni.stopPullDownRefresh()
}, 1500)
},
//
onReachBottom() {
console.log(4444)
if (this.reachBottom >= 0) {
this.reachBottom = 1
this.status = 'loading'
this.getList()
}
},
onShow() {
const pages = getCurrentPages()
const { options } = pages[pages.length - 1]
@ -95,13 +107,14 @@
methods: {
//
getList() {
curriculumList({
curriculumName: this.keyword,
isEnable: 0,
pageNum: 1,
pageSize: 10000
}).then(({ page }) => {
const { records } = page
AppletsDataProductList({
sort: '',
keywords: '',
productType: this.curTab,
pageNum: this.page,
pageSize: this.pageSize
}).then(({ data }) => {
const { records } = data
const list = this.courses
//
records.map(e => {
@ -111,18 +124,30 @@
}
e.check = []
//
if (list.find(n => n.dataOrCourseId == e.cid)) {
if (list.find(n => n.dataOrCourseId == e.id)) {
checkData.disable = true //
e.check = [1]
}
e.checkData = [checkData]
})
this.list = records
// list
this.list = this.reachBottom > 0 ? [...this.list, ...records] : records
this.page++ // page+1
const noMore = this.list.length === data.total //
this.status = noMore ? 'noMore' : 'more' // noMore
this.reachBottom = noMore ? -1 : 0 // -1
}).catch(e => {})
},
initList() {
this.page = 1
this.reachBottom = 0
this.getList()
},
// tab
tabChange(tab) {
this.curTab = tab.id
this.initList()
},
//
checkChange(e) {
@ -132,8 +157,8 @@
//
createParam(e) {
return {
dataOrCourseId: e.cid, // id
productName: e.curriculumName, //
dataOrCourseId: e.id, // id
productName: e.productName, //
periodOfUse: '', // 使
startTime: this.$util.formatDate(new Date(), 'yyyy-MM-dd'), //
endTime: '', //
@ -146,12 +171,14 @@
totalAmount: '', //
isEnable: 1, // 10
ship: 0, // 01
authority: 1, // 01
authority: e.productType === 2 ? 0 : 1, // 01
productType: e.productType, // (0-> 1- 2 )
options: 1,
settlementPrice: '', //
settlementMethod: e.settlementMethod, // 01
settlementPriceUnit: e.settlementPrice, //
businessProportion: e.businessProportion, //
serviceFee: 0 //
}
},
//
@ -197,8 +224,7 @@
<style scoped lang="scss">
.page {
height: calc(100vh - 140rpx);
overflow: auto;
padding-bottom: 130rpx;
}
.list {
li {

@ -1,62 +0,0 @@
<template>
<view class="container">
<uni-section title="基本信息" type="line">
<view class="form">
<uni-forms ref="baseForm" :modelValue="form">
<uni-forms-item label="姓名" name="contact" required>
<uni-easyinput v-model="form.contact" placeholder="请输入姓名" />
</uni-forms-item>
<uni-forms-item label="手机号" name="contact" required>
<uni-easyinput v-model="form.contact" placeholder="请输入手机号" />
</uni-forms-item>
</uni-forms>
<button type="primary" @click="submit('valiForm')">提交</button>
</view>
</uni-section>
</view>
</template>
<script>
export default {
data() {
return {
form: {
name: '',
provience: '',
city: '',
industryId: '',
age: '',
introduction: '',
sex: 2,
hobby: [5],
datetimesingle: 1627529992399
}
}
},
onLoad() {
console.log(getApp())
},
methods: {
onchange(e) {
console.log('---------onchange:', e);
},
submit(ref) {
this.$refs[ref].validate().then(res => {
console.log('success', res);
uni.showToast({
title: `校验通过`
})
}).catch(err => {
console.log('err', err);
})
},
}
}
</script>
<style scoped>
.form {
padding: 15px;
background-color: #fff;
}
</style>

@ -0,0 +1,45 @@
<template>
<view class="page">
<web-view :webview-styles="webviewStyles" :src="src"></web-view>
</view>
</template>
<script>
export default {
data() {
return {
src: '',
webviewStyles: {
progress: {
color: '#FF3333'
}
},
}
},
onShow() {
const pages = getCurrentPages()
const { options } =
this.src = `http://view.xdocin.com/xdoc?_xdoc=${pages[pages.length - 1].options.id == 1 ? 'https://huoran.oss-cn-shenzhen.aliyuncs.com/20220530/docx/1531155187057057792.docx' : 'https://huoran.oss-cn-shenzhen.aliyuncs.com/20220530/docx/1531156166884220928.docx'}`
},
methods: {
}
}
</script>
<style scoped lang="scss">
.page {
padding: 60rpx 40rpx;
background-color: #fff;
}
.title {
margin-bottom: 30rpx;
font-size: 38rpx;
text-align: center;
color: #333;
}
.content {
white-space: pre-wrap;
font-size: 28rpx;
}
</style>

@ -16,13 +16,13 @@
<view class="name">{{ item.customerName }}</view>
<view class="info">
<view class="left">
<view class="text">联系人海文</view>
<view class="text">账号海文</view>
<view class="text">产品到期时间海文</view>
<view class="text">商务经理海文</view>
<view class="text">联系人{{ item.orderContact }}</view>
<view class="text">账号{{ item.account }}</view>
<view class="text">产品到期时间{{ item.expireDate.replace(' 00:00:00', '') }}</view>
<view class="text">商务经理{{ item.account }}</view>
</view>
<view class="type">
试用客户
{{ menuList[0].detailList.find(e => e.value === item.customerType).title }}客户
</view>
</view>
</li>
@ -33,7 +33,7 @@
</template>
<script>
import { queryCustomer } from '@/apis/modules/client.js'
import { list } from '@/apis/modules/client.js'
import slFilter from '@/components/sl-filter/sl-filter.vue'
export default {
data() {
@ -112,18 +112,17 @@
},
methods: {
getList() {
queryCustomer({
countries: '中国',
provinceId: '',
cityId: '',
searchContent: this.keyword,
page: this.page,
size: this.pageSize
}).then(({ message }) => {
list({
businessManagerId: 112,
customerType: this.customerType,
keywords: this.keyword,
pageNum: this.page,
pageSize: this.pageSize
}).then(({ data }) => {
// list
this.list = this.reachBottom > 0 ? [...this.list, ...message.list] : message.list
this.list = this.reachBottom > 0 ? [...this.list, ...data.records] : data.records
this.page++ // page+1
const noMore = this.list.length === message.totalCount //
const noMore = this.list.length === data.total //
this.status = noMore ? 'noMore' : 'more' // noMore
this.reachBottom = noMore ? -1 : 0 // -1
}).catch(e => {})
@ -136,6 +135,7 @@
//
result(val) {
this.customerType = val.customerType
this.initList()
},
// tab
tabChange(tab) {

@ -3,36 +3,107 @@
<view class="wrap">
<image class="logo" src="../../static/image/logo.png" mode=""></image>
<view class="hello">Hi城市合伙人请登录</view>
<view class="btn wechat">
<image src="../../static/image/wechat.png" mode="widthFix"></image>
微信授权登录
</view>
<view class="btn phone">
<button v-if="isLogin && !getPhone" class="btn phone" open-type="getPhoneNumber" @getphonenumber="onGetPhoneNumber">
<image src="../../static/image/phone.png" mode="widthFix"></image>
手机账号登录
</view>
绑定手机
</button>
<template v-else>
<view class="btn wechat" @click="login">
<image src="../../static/image/wechat.png" mode="widthFix"></image>
微信授权登录
</view>
<view class="btn phone">
<image src="../../static/image/phone.png" mode="widthFix"></image>
手机账号登录
</view>
</template>
<view class="agree">
<uni-data-checkbox class="check" multiple v-model="agree" :localdata="agreeData"></uni-data-checkbox>
同意
<text>或然科技城市合伙人服务协议</text>
<text @click="toAgreement(1)">用户服务协议</text>
<text @click="toAgreement(2)">用户隐私协议</text>
</view>
</view>
</view>
</template>
<script>
import { login } from '@/apis/modules/user.js'
export default {
data() {
return {
agree: [],
agreeData: [{
text: '',
value: 0
value: 1
}],
isLogin: true, //
getPhone: true //
}
},
onShow() {
//
this.checkLogin()
},
methods: {
//
checkLogin() {
if (uni.getStorageSync('token')) {
this.$util.to('../index/index')
} else {
this.isLogin = false
this.getPhone = false
}
},
//
login() {
if (this.agree.length) {
const that = this
uni.getUserProfile({
lang: 'zh_CN',
desc: '登录',
success: ({ userInfo }) => {
console.log(33, userInfo)
uni.setStorageSync('userName', userInfo.nickName)
uni.setStorageSync('avatar', userInfo.avatarUrl)
uni.login({
success: ({ code }) => {
if (code) {
this.isLogin = true
login({ code }).then(({ data }) => {
// this.sessionKey =
// uni.setStorageSync('token', userInfo.avatarUrl)
}).catch(e => {})
} else {
that.$util.errMsg('登录失败!')
}
}
})
},
fail(res) {
that.$util.errMsg('登录授权失败!')
}
})
} else {
this.$util.errMsg('请先阅读勾选协议!')
}
},
onGetPhoneNumber(e){
var encryptedData =e.detail.encryptedData;
var iv = e.detail.iv;
//1.使js2.使使js
//WXBizDataCryptjsjs
var WXBizDataCrypt = require('@/libs/WXBizDataCrypt'); //WXBizDataCrypt.js
const accountInfo = uni.getAccountInfoSync(); //appid
let appid = accountInfo.miniProgram.appId
return console.log(11, appid)
var pc = new WXBizDataCrypt(appid , this.sessionKey);
var data = pc.decryptData(encryptedData , iv);
},
toAgreement(id) {
this.$util.to('../agreement/agreement?id=' + id)
}
}
}
</script>
@ -83,6 +154,7 @@
.phone {
color: #007EFF;
border: 1px solid #007EFF;
background-color: #fff;
image {
width: 40rpx;
}
@ -106,6 +178,9 @@
.checklist-box {
margin: 0;
}
.checkbox__inner {
border-radius: 50% !important;
}
}
}
</style>

@ -52,11 +52,11 @@
</view>
</view>
<view class="block pro-wrap">
<view class="l-title">实训课程产品</view>
<view class="block pro-wrap" v-for="c in courses">
<view class="l-title">{{ c.name }}</view>
<uni-icons class="arrow" type="top" size="20" color="#007EFF"></uni-icons>
<ul class="pro-list">
<li v-for="(item, i) in courses">
<li v-for="(item, i) in c.list">
<view class="name">
<view class="left">
<image class="icon" src="../../static/image/course1.png" mode=""></image>
@ -162,6 +162,7 @@
customerName: '',
businessManager: ''
},
courseList: [],
courses: [], //
purchase: 0,
profit: 0,
@ -191,6 +192,7 @@
this.getInfo()
} else if (store) {
//
this.handleProduct(store)
this.courses = store
try {
uni.removeStorageSync('courses')
@ -221,8 +223,41 @@
this.contract = order.contractInformation
this.form = order.order
this.courses = order.orderOther
this.handleProduct(order.orderOther)
this.calcTotal()
}).catch(e => {})
},
//
handleProduct(list) {
const courses = {
practice: {
name: '实训课程产品',
list: []
},
theory: {
name: '理论课程产品',
list: []
},
data: {
name: '数据产品',
list: []
}
}
// 3push(0-> 1- 2 )
list.map(e => {
const type = e.productType
!type ?
courses.theory.list.push(e) :
type === 1 ?
courses.practice.list.push(e) :
courses.data.list.push(e)
})
//
courses.practice.list.length || delete courses.practice
courses.theory.list.length || delete courses.theory
courses.data.list.length || delete courses.data
this.courseList = courses
},
//
getCustomer() {
queryCustomer({

@ -14,6 +14,7 @@
<ul class="list">
<li v-for="item in list">
<view class="pro-name">
<!-- <image v-if="item.id != 13" class="icon" :src="require('../../static/image/product/' + item.id + '.png)" mode="widthFix"></image> -->
<image class="icon" src="../../static/image/course1.png" mode="widthFix"></image>
{{ item.productName }}
</view>
@ -46,7 +47,7 @@
</template>
<script>
import { AppletsDataProductList } from '@/apis/modules/course.js'
import { AppletsDataProductList } from '@/apis/modules/product.js'
import slFilter from '@/components/sl-filter/sl-filter.vue'
export default {
data() {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 115 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 117 KiB

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 975 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 354 B

After

Width:  |  Height:  |  Size: 327 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 842 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 466 B

After

Width:  |  Height:  |  Size: 335 B

Loading…
Cancel
Save