master
lion 1 week ago
parent cb3886a0e1
commit c18d873b42

@ -1,6 +1,6 @@
{
"name" : "wx-dangyuanjiaoyujidi",
"appid" : "__UNI__FC384E5",
"name" : "yxbd",
"appid" : "__UNI__2419A31",
"description" : "",
"versionName" : "1.0.0",
"versionCode" : "100",
@ -50,8 +50,8 @@
"quickapp" : {},
/* */
"mp-weixin" : {
"appid" : "wx35190cc07e73eda1",
"__usePrivacyCheck__": true,
"appid" : "wxdaa5d65b0714696d",
"__usePrivacyCheck__" : true,
"setting" : {
"urlCheck" : false,
"minified" : false

@ -1,18 +1,18 @@
<template>
<view class="containers" :style="{'height':winHeight+'px'}">
<view class="title justify-between">
<text>BD访客</text>
<text @click="toUrl(0)" style="color: #f27707;">我的拜访记录</text>
<view class="title justify-between">
<text>BD访客</text>
<text @click="toUrl(0)" style="color: #f27707;">我的拜访记录</text>
</view>
<view class="bdfk">
<!-- <view>
<u--image :showLoading="true" :src="ptfk" width="315rpx" height="600rpx" @click="toUrl(1)"></u--image>
</view> -->
<view class="sgry">
<u--image :src="xxpx" width="315rpx" height="280rpx" @click="toUrl(5)"></u--image>
<view>
<u--image :src="ptfk" width="315rpx" height="280rpx" @click="toUrl(1)"></u--image>
</view>
</view> -->
<view class="sgry">
<u--image :src="xxpx" width="315rpx" height="280rpx" @click="toUrl(5)"></u--image>
<view>
<u--image :src="ptfk" width="315rpx" height="280rpx" @click="toUrl(1)"></u--image>
</view>
</view>
<view class="sgry">
<u--image :src="wlcl" width="315rpx" height="280rpx" @click="toUrl(3)"></u--image>
@ -21,8 +21,11 @@
</view>
</view>
</view>
<view class="title justify-between">
<text>BD管理员</text>
<view class="vip-entry" @click="toUrl(6)">
VIP访客预约入口
</view>
<view class="title justify-between">
<text>BD管理员</text>
</view>
<view>
<u--image :src="bdgl" width="670rpx" height="336rpx" @click="toUrl(4)"></u--image>
@ -37,34 +40,34 @@
return {
ptfk: require('../../static/img/ptfk.png'),
wlcl: require('../../static/img/wlcl1.png'),
sgry: require('../../static/img/sgry1.png'),
sgry: require('../../static/img/sgry1.png'),
xxpx: require('../../static/img/xxpx.png'),
bdgl: require('../../static/img/bdgl.png'),
winHeight: 0,
winHeight: 0,
isBd:""
}
},
onLoad() {
this.winHeight = uni.getSystemInfoSync().screenHeight - uni.getSystemInfoSync().statusBarHeight * 2-20;
this.winHeight = uni.getSystemInfoSync().screenHeight - uni.getSystemInfoSync().statusBarHeight * 2-20;
},
onShow(){
this.isBd = uni.getStorageSync("userInfo_BD_token").token
console.log("bd",this.isBd)
},
onShareAppMessage() {
return {
title: 'BD访客系统',
path: '/pages/index/index',
// imageUrl: this.logoIndex
}
},
onShareTimeline() {
return {
title: 'BD访客系统',
path: '/pages/index/index',
// imageUrl: this.logoIndex
}
},
onShow(){
this.isBd = uni.getStorageSync("userInfo_BD_token").token
console.log("bd",this.isBd)
},
onShareAppMessage() {
return {
title: 'BD访客系统',
path: '/pages/index/index',
// imageUrl: this.logoIndex
}
},
onShareTimeline() {
return {
title: 'BD访客系统',
path: '/pages/index/index',
// imageUrl: this.logoIndex
}
},
methods: {
toUrl(type) {
@ -78,24 +81,27 @@
break;
case 3:
url = "/pages/visit/addrecord?type=3"
break;
case 0:
url = "/pages/visit/visithistory"
break;
case 5:
url = "/pages/visit/tostudy"
break;
case 4:
if(!this.util.isNull(this.isBd)){
url = "/pages/bd/mine"
}else{
url = "/pages/index/login"
case 6:
url = "/pages/visit/addrecord?type=4"
break;
case 0:
url = "/pages/visit/visithistory"
break;
case 5:
url = "/pages/visit/tostudy"
break;
case 4:
if(!this.util.isNull(this.isBd)){
url = "/pages/bd/mine"
}else{
url = "/pages/index/login"
}
break;
}
uni.navigateTo({
url:url
}
uni.navigateTo({
url:url
})
}
}
@ -105,7 +111,7 @@
<style scoped>
.containers {
background-color: #044ed7;
padding: 0 40rpx;
padding: 0 40rpx;
padding-bottom:20px;
}
@ -115,8 +121,8 @@
padding: 40rpx 0;
padding-top: 70rpx
}
.title:first-child{
padding-top:30rpx
.title:first-child{
padding-top:30rpx
}
.bdfk {
display: flex;
@ -126,4 +132,15 @@
.sgry view {
margin-top: 40rpx
}
</style>
.vip-entry{
margin-top: 40rpx;
height: 88rpx;
line-height: 88rpx;
border-radius: 12rpx;
background: #f27707;
color: #fff;
text-align: center;
font-size: 30rpx;
font-weight: 600;
}
</style>

@ -1,6 +1,21 @@
<template>
<page-meta :page-style="'overflow:'+(adminListShow||configshow||areaShow?'hidden':'visible')"></page-meta>
<view class="containers">
<!-- VIP先核验名单内姓名+手机号 -->
<view v-if="form.type==4 && !vipGatePassed" class="vip-gate-wrap">
<view class="formtext">VIP 访客身份核验</view>
<view class="vip-gate-tip">请填写与后台 VIP 客户名单中一致的姓名与手机号</view>
<uni-forms labelWidth="100px">
<uni-forms-item label="姓名" required>
<uni-easyinput v-model="vipGateForm.name" placeholder="请输入姓名" />
</uni-forms-item>
<uni-forms-item label="联系电话" required>
<uni-easyinput v-model="vipGateForm.mobile" placeholder="请输入手机号" type="number" maxlength="11" />
</uni-forms-item>
</uni-forms>
<button type="primary" style="background-color: #044ed7; margin-top: 24rpx;" @click="submitVipGate"></button>
</view>
<block v-else>
<!-- 拜访须知 -->
<u-popup :show="configshow" :mask-close-able="false" class="configwrap" mode="bottom">
<view class="configtitle">
@ -9,11 +24,11 @@
<view class="configvalue">
<view v-html="configInfo.value">
</view>
<view style="text-align: center;">
<view class="configbtn" @click="closeConfig">
确认
</view>
</view>
<view style="text-align: center;">
<view class="configbtn" @click="closeConfig">
确认
</view>
</view>
</view>
@ -56,7 +71,7 @@
<uni-data-checkbox @change='changeVisitArea' v-model="form.visit_area_id" :localdata="visitArea"
:map="{text:'name',value:'id'}" />
</uni-forms-item>
<uni-forms-item label="到访事由" v-if="form.type==1">
<uni-forms-item label="到访事由" v-if="form.type==1||form.type==4">
<uni-data-select v-model="form.reason" :localdata="reasonList">
</uni-data-select>
</uni-forms-item>
@ -75,12 +90,15 @@
<uni-forms-item label="备注">
<uni-easyinput type="textarea" v-model="form.remark" placeholder="请输入自我备注" />
</uni-forms-item>
<view class="formtext">拜访人信息</view>
<view class="formtext formtext-flex">
<text>拜访人信息</text>
<button v-if="form.type!=4" class="history-btn" type="primary" size="mini" @click="fillLatestVisitorInfo"></button>
</view>
<uni-forms-item label="姓名" required name="name">
<uni-easyinput v-model="form.name" placeholder="请输入姓名" />
<uni-easyinput v-model="form.name" placeholder="请输入姓名" :disabled="form.type==4 && vipGatePassed" />
</uni-forms-item>
<uni-forms-item label="联系电话" required name="mobile">
<uni-easyinput v-model="form.mobile" placeholder="请输入联系电话" />
<uni-easyinput v-model="form.mobile" placeholder="请输入联系电话" :disabled="form.type==4 && vipGatePassed" />
</uni-forms-item>
<uni-forms-item label="证件类型" required name="credent">
<uni-data-select v-model="form.credent" :localdata="credentList">
@ -95,7 +113,7 @@
<uni-forms-item label="单位名称" required name="company_name">
<uni-easyinput v-model="form.company_name" placeholder="请输入单位名称" />
</uni-forms-item>
<uni-forms-item label="CDA编号" required name="cda" v-if="form.type==1&&visitAreaText=='生产区'">
<uni-forms-item label="CDA编号" required name="cda" v-if="(form.type==1||form.type==4)&&visitAreaText=='生产区'">
<uni-easyinput type='textarea' v-model="form.cda" placeholder="请输入CDA编号(如无注明原因)" />
</uni-forms-item>
<uni-forms-item label="到访车辆" v-if="form.type!=3">
@ -176,8 +194,8 @@
<uni-datetime-picker type="date" :start="toadyStart" return-type="string" v-model="form.end_date" />
</uni-forms-item>
</template> -->
<view class="formtext" v-if="form.type==1||form.type==2">访</view>
<uni-forms-item label="被访人" required name="acceptName" v-if="form.type==1||form.type==2">
<view class="formtext" v-if="form.type==1||form.type==2||form.type==4">访</view>
<uni-forms-item label="被访人" required name="acceptName" v-if="form.type==1||form.type==2||form.type==4">
<uni-easyinput @clear="clearAccept('accept')" disabled v-model="form.acceptName"
@tap="adminListShowOpen('accept')" placeholder="请选择联系人员" />
</uni-forms-item>
@ -186,12 +204,12 @@
<uni-forms-item label="收货人" v-if="form.type==3" required name="goodsName">
<uni-easyinput @clear="clearAccept('goods')" disabled v-model="form.goodsName"
@tap="adminListShowOpen('goods')" placeholder="请选择联系人员" />
</uni-forms-item>
<view class="formtext" v-if="visitAreaText=='生产区'"></view>
<uni-forms-item label="陪同人" required name="accompanyName" v-if="visitAreaText=='生产区'">
<uni-easyinput @clear="clearAccept('accompany')" disabled v-model="form.accompanyName"
@tap="adminListShowOpen('accompany')" placeholder="请选择联系人员" />
</uni-forms-item>
<view class="formtext" v-if="visitAreaText=='生产区'"></view>
<uni-forms-item label="陪同人" required name="accompanyName" v-if="visitAreaText=='生产区'">
<uni-easyinput @clear="clearAccept('accompany')" disabled v-model="form.accompanyName"
@tap="adminListShowOpen('accompany')" placeholder="请选择联系人员" />
</uni-forms-item>
<qianziyu-select :show="adminListShow" type="radio" :popupTitle="'联系人员'" name="cworkStationName"
:dataLists="adminList" placeholder="输入陪同人具体姓名或手机号搜索" @search="selectSearch" @submit="submitAccept"
@ -227,6 +245,7 @@
style="background-color: #044ed7;margin-left:8px">确认</button>
</view>
</uni-drawer>
</block>
</view>
@ -463,7 +482,12 @@
adminList: [],
isCall: '', //
goStudy: '提交',
isStudy: false
isStudy: false,
vipGatePassed: true,
vipGateForm: {
name: '',
mobile: ''
}
}
},
@ -472,36 +496,60 @@
// url:'/pages/visit/testStudy?type=3'
// })
// return
this.toadyStart = new Date()
this.form.type = options.type
this.areaShow = options.type == 1 ? true : false
this.configKey = options.type == 1 ? 'ptfk' : (options.type == 2 ? 'sgfk' : 'wlcl')
const now = new Date()
this.toadyStart =
now.getFullYear() +
'-' +
String(now.getMonth() + 1).padStart(2, '0') +
'-' +
String(now.getDate()).padStart(2, '0')
const visitType = parseInt(options.type || 1)
this.form.type = visitType
if (visitType == 4) {
this.vipGatePassed = false
this.areaShow = false
} else {
this.areaShow = (visitType == 1)
}
// VIP 访访使 keyvipxz访 ptfk closeArea
this.configKey =
visitType == 4 ? 'vipxz' :
visitType == 1 ? 'ptfk' :
visitType == 2 ? 'sgfk' : 'wlcl'
this.isCall = options.iscall ? options.iscall : ''
// this.goStudy = this.isCall == 'call' ? '' : ''
this.form.audit_status = this.isCall == 'call' ? 1 : 0
this.showStudy()
if (options.type == 2 || options.type == 3) {
if (visitType !== 4) {
this.showStudy()
}
if (visitType == 2 || visitType == 3) {
this.getConfig()
}
this.init()
if (uni.getStorageSync('formdata')) {
this.form = uni.getStorageSync('formdata')
}
if (parseInt(this.form.type, 10) === 4) {
this.vipGatePassed = false
this.areaShow = false
this.vipGateForm.name = (this.form.name || '').trim()
this.vipGateForm.mobile = (this.form.mobile || '').trim()
}
// this.getAdminList()
},
onShareAppMessage() {
return {
title: 'BD访客系统',
path: '/pages/index/index',
// imageUrl: this.logoIndex
}
},
onShareTimeline() {
return {
title: 'BD访客系统',
path: '/pages/index/index',
// imageUrl: this.logoIndex
}
},
onShareAppMessage() {
return {
title: 'BD访客系统',
path: '/pages/index/index',
// imageUrl: this.logoIndex
}
},
onShareTimeline() {
return {
title: 'BD访客系统',
path: '/pages/index/index',
// imageUrl: this.logoIndex
}
},
onReady() {},
@ -541,9 +589,54 @@
this.form.accompanyName = ''
}
},
fillLatestVisitorInfo() {
const mobile = (this.form.mobile || '').trim()
const idcard = this.form.credent == 2 ? (this.form.passcard || '').trim() : (this.form.idcard || '').trim()
if (!mobile && !idcard) {
this.util.alert('请先填写手机号或证件号,再拉取过往信息')
return
}
let that = this
this.util.request({
api: '/api/mobile/visit/latest-visitor',
method: 'GET',
data: {
mobile: mobile,
idcard: idcard
},
utilSuccess: function(res) {
that.form.name = res.name || that.form.name
that.form.mobile = res.mobile || that.form.mobile
that.form.credent = res.credent || that.form.credent
if (parseInt(that.form.credent) === 2) {
that.form.passcard = res.idcard || that.form.passcard
that.form.idcard = res.idcard || that.form.idcard
} else {
that.form.idcard = res.idcard || that.form.idcard
}
that.form.company_name = res.company_name || that.form.company_name
that.form.cda = res.cda || that.form.cda
if (Array.isArray(res.cars)) {
that.form.cars = res.cars
}
uni.showToast({
title: '已回填最近一条信息',
icon: 'none',
duration: 1500
})
},
utilFail: function(errMsg) {
uni.showToast({
title: errMsg || '未获取到历史数据',
icon: 'none',
duration: 2000
})
}
})
},
submitAccept(e) {
console.log(e)
this.form.accompany_id = e.id
console.log(e)
this.form.accompany_id = e.id
this.form.accompanyName = e.name
if (this.acceptType == 'accept') {
this.form.accept_admin_id = e.id
@ -578,11 +671,72 @@
closeConfig() {
this.configshow = false
},
submitVipGate() {
const name = (this.vipGateForm.name || '').trim()
const mobile = (this.vipGateForm.mobile || '').trim()
if (!name) {
uni.showToast({
title: '请输入姓名',
icon: 'none'
})
return
}
if (!mobile || !/^[1][3-9][\d]{9}$/.test(mobile)) {
uni.showToast({
title: '请输入正确手机号',
icon: 'none'
})
return
}
const that = this
this.util.request({
api: '/api/mobile/user/is-vip',
method: 'GET',
data: {
mobile,
name
},
customLoading: true,
utilSuccess: function(res) {
if (parseInt(res?.is_vip || 0) !== 1) {
uni.showModal({
title: '提示',
content: '您当前还不在vip客户名单中可先联系管理员录入',
showCancel: false,
success: function() {
uni.reLaunch({
url: '/pages/index/index'
})
}
})
return
}
that.vipGatePassed = true
that.form.name = name
that.form.mobile = mobile
that.areaShow = true
that.showStudy()
},
utilFail: function(err) {
uni.showToast({
title: err || '验证失败',
icon: 'none'
})
}
})
},
closeArea() {
if (!this.form.visit_area_id) {
this.util.alert("请先选择前往区域")
return
}
// VIP 访访vipxz ptfk/cjfk/yffk
if (Number(this.form.type) === 4) {
this.configKey = 'vipxz'
this.getConfig()
this.areaShow = false
return
}
if (this.visitAreaText == "生产区") {
this.configKey = 'cjfk'
this.getConfig()
@ -801,15 +955,48 @@
id_arr.push(k.idcard)
}
this.$refs['formdata'].validate().then(res => {
// VIP/
this.checkVipByMobile(this.form.mobile).then(vipRes => {
const isVip = parseInt(vipRes?.is_vip || 0) === 1 ? 1 : 0
uni.setStorageSync('studydata', {
type: this.form.type,
name: this.form.name,
mobile: this.form.mobile,
idcard: this.form.credent == 2 ? this.form.passcard : this.form.idcard,
is_vip: isVip
})
}).catch(() => {
uni.setStorageSync('studydata', {
type: this.form.type,
name: this.form.name,
mobile: this.form.mobile,
idcard: this.form.credent == 2 ? this.form.passcard : this.form.idcard
})
})
this.util.request({
api: '/api/mobile/visit/idcard-check',
method: "post",
data: {
idcard: id_arr
idcard: id_arr,
type: that.form.type
},
utilSuccess: function(res) {
if (res.length > 0) {
let str = res.join("") + '未完成学习培训'
const missing = Array.isArray(res?.missing) ? res.missing : []
const expired = Array.isArray(res?.expired) ? res.expired : []
const invalidLegacy = Array.isArray(res?.invalid) ? res.invalid : (Array.isArray(res) ? res : [])
const hasInvalid = missing.length > 0 || expired.length > 0 || invalidLegacy.length > 0
if (hasInvalid) {
let messageArr = []
if (missing.length > 0) {
messageArr.push(`未学习:${missing.join("")}`)
}
if (expired.length > 0) {
messageArr.push(`已过期:${expired.join("")}`)
}
if (messageArr.length === 0 && invalidLegacy.length > 0) {
messageArr.push(`异常:${invalidLegacy.join("")}`)
}
let str = messageArr.join("") + '。请先完成当前访客类型的学习流程'
that.util.alert(str)
uni.setStorageSync('formdata', that.form)
} else {
@ -852,8 +1039,28 @@
this.submitNoStudy()
} else {
uni.setStorageSync('formdata', this.form)
uni.redirectTo({
url: '/pages/visit/study?type=' + this.form.type
this.checkVipByMobile(this.form.mobile).then(vipRes => {
const isVip = parseInt(vipRes?.is_vip || 0) === 1 ? 1 : 0
uni.setStorageSync('studydata', {
type: this.form.type,
name: this.form.name,
mobile: this.form.mobile,
idcard: this.form.credent == 2 ? this.form.passcard : this.form.idcard,
is_vip: isVip
})
uni.redirectTo({
url: '/pages/visit/study?type=' + this.form.type
})
}).catch(() => {
uni.setStorageSync('studydata', {
type: this.form.type,
name: this.form.name,
mobile: this.form.mobile,
idcard: this.form.credent == 2 ? this.form.passcard : this.form.idcard
})
uni.redirectTo({
url: '/pages/visit/study?type=' + this.form.type
})
})
}
@ -861,9 +1068,43 @@
console.log('err', err);
})
},
checkVipByMobile(mobile) {
const that = this
return new Promise((resolve, reject) => {
if (!mobile) {
resolve({
is_vip: 0
})
return
}
const data = {
mobile: mobile
}
if (parseInt(this.form.type, 10) === 4) {
const n = (this.form.name || '').trim()
if (n) {
data.name = n
}
}
that.util.request({
api: '/api/mobile/user/is-vip',
method: 'GET',
data: data,
customLoading: true,
utilSuccess: function(res) {
resolve(res || {
is_vip: 0
})
},
utilFail: function(err) {
reject(err)
}
})
})
},
submitForm() {
let that = this
console.log("form",this.form)
let that = this
console.log("form",this.form)
// return
this.util.request({
api: '/api/admin/visit/save',
@ -926,8 +1167,9 @@
} else {
//
uni.requestSubscribeMessage({
tmplIds: ['DmzNRREPFdZrMWconNDdbj_ebtVPRWufq27kRQ25eNg',
'IczaKkCmwf55tAAzCcxb_fbbf5L25SWrSKvaBrkIyk4'
tmplIds: [
'O898NDrqGUUeSR42uraqr2PLEg05sNbYVu46I0qLkhE',
'Caa0O6pPtQDHQMPsqE6PHyzueeI11JvlpenbgwkYC0s'
],
success(res) {
console.log("res", res)
@ -962,19 +1204,30 @@
.formtext {
margin-bottom: 20rpx
}
.formtext-flex{
display:flex;
justify-content: space-between;
align-items: center;
}
.history-btn{
background-color:#044ed7 !important;
font-size:24rpx;
line-height:1.8;
padding:0 16rpx;
}
/deep/ .uni-table-td {
::v-deep .uni-table-td {
vertical-align: middle;
}
/deep/ .uni-drawer__content {
::v-deep .uni-drawer__content {
padding: 40rpx
}
.configtitle {
font-size: 40rpx;
text-align: center;
margin-top: 36rpx;
margin-top: 36rpx;
padding-bottom: 20rpx;
}
@ -1007,12 +1260,10 @@
margin-right: 20rpx
}
/deep/ .u-popup__content__close .u-icon__icon {
::v-deep .u-popup__content__close .u-icon__icon {
color: #fff !important
}
.areavalue {}
.areabtn {
background-color: #044ed7;
/* margin-left: 8px; */
@ -1023,7 +1274,17 @@
border-radius: 0;
}
/deep/ .areavalue .uni-data-checklist .checklist-group .checklist-box.is--button {
::v-deep .areavalue .uni-data-checklist .checklist-group .checklist-box.is--button {
padding: 30rpx
}
.vip-gate-wrap {
padding: 24rpx 12rpx;
}
.vip-gate-tip {
font-size: 28rpx;
color: #666;
margin-bottom: 32rpx;
line-height: 1.5;
}
</style>

@ -4,38 +4,38 @@
<uni-steps :options="steps" :active="stepActive" active-color="#044ed7" />
</view>
<view class="study" style="padding:0 20rpx">
<view class="service-show" v-if="studyInfo.file_detail.length>0">
<view v-if="picList.length>0&&showSwiperFlag==0">
<u-swiper :list="picList" @change="changeImg" keyName="url"
:height="'360rpx'" :interval='4000' :duration='500' :autoplay='false' circular>
<view slot="indicator" class="indicator">
<view class="indicator__dot" v-for="(item, index) in picList" :key="index"
:class="[index === imgcurrent && 'indicator__dot--active']">
</view>
</view>
</u-swiper>
</view>
<view v-if="videoList.length>0&&showSwiperFlag==1">
<u-swiper :list="videoList" @change="changeVideo" keyName="url"
:height="'360rpx'" :interval='4000' :duration='500' :autoplay='false' circular>
<view slot="indicator" class="indicator">
<view class="indicator__dot" v-for="(item, index) in videoList" :key="index"
:class="[index === videocurrent && 'indicator__dot--active']">
</view>
</view>
</u-swiper>
</view>
<view class="changePicVideo">
<view @click='changeSwiperImg' v-if="picList.length>0">
<image src="../../static/img/pic.png">
</image>{{picList.length}}
</view>
<view @click='changeSwiperVideo' v-if="videoList.length>0">
<image src="../../static/img/video.png">
</image>{{videoList.length}}
</view>
<view class="service-show" v-if="studyInfo.file_detail && studyInfo.file_detail.length>0">
<view v-if="picList.length>0&&showSwiperFlag==0">
<u-swiper :list="picList" @change="changeImg" keyName="url"
:height="'360rpx'" :interval='4000' :duration='500' :autoplay='false' circular>
<view slot="indicator" class="indicator">
<view class="indicator__dot" v-for="(item, index) in picList" :key="index"
:class="[index === imgcurrent && 'indicator__dot--active']">
</view>
</view>
</u-swiper>
</view>
<view v-if="videoList.length>0&&showSwiperFlag==1">
<u-swiper :list="videoList" @change="changeVideo" keyName="url"
:height="'360rpx'" :interval='4000' :duration='500' :autoplay='false' circular>
<view slot="indicator" class="indicator">
<view class="indicator__dot" v-for="(item, index) in videoList" :key="index"
:class="[index === videocurrent && 'indicator__dot--active']">
</view>
</view>
</u-swiper>
</view>
<view class="changePicVideo">
<view @click='changeSwiperImg' v-if="picList.length>0">
<image src="../../static/img/pic.png">
</image>{{picList.length}}
</view>
<view @click='changeSwiperVideo' v-if="videoList.length>0">
<image src="../../static/img/video.png">
</image>{{videoList.length}}
</view>
</view>
</view>
@ -47,8 +47,8 @@
</view>
<button @click="goTest" :class="studyMin==-1?'goTest':'noTest'" :disabled="studyMin==-1?false:true">
<text v-if="studyMin==-1"></text>
<text v-else>{{studyInfo.minute?studyInfo.minute:""}}({{studyTime}})</text>
<text v-if="studyMin==-1">{{ quizRequired ? '' : '' }}</text>
<text v-else>{{ quizRequired ? (''+(studyInfo.minute?studyInfo.minute:'')+'('+studyTime+')') : (''+studyTime+'') }}</text>
</button>
</view>
@ -67,104 +67,191 @@
title: '完成'
}],
stepActive: 1,
studyInfo: {},
picList:[],
videoList:[],
studyInfo: {},
picList:[],
videoList:[],
showSwiperFlag:0,
imgcurrent: 0,
imgcurrent: 0,
videocurrent:0,
studyTime: "00:00", //
studyMin: -1, //
// null getStudy clear
studyMin: null,
timer: null,
quizRequired: true,
}
},
onLoad(options) {
// uni.navigateTo({
// url:'/pages/visit/testStudy?type=1'
// })
onLoad(options) {
// uni.navigateTo({
// url:'/pages/visit/testStudy?type=1'
// })
// return
let that = this
const that = this
this.type = options.type
if (this.timer) {
clearInterval(this.timer)
this.timer = null
}
this.timer = setInterval(function() {
that.loadTime()
}, 1000)
this.getStudy()
},
onUnload() {
if (this.timer) {
clearInterval(this.timer)
} else {
this.timer = setInterval(function() {
that.loadTime()
}, 1000)
this.timer = null
}
},
onShareAppMessage() {
return {
title: 'BD访客系统',
path: '/pages/index/index',
// imageUrl: this.logoIndex
}
},
onShareTimeline() {
return {
title: 'BD访客系统',
path: '/pages/index/index',
// imageUrl: this.logoIndex
}
},
onShareAppMessage() {
return {
title: 'BD访客系统',
path: '/pages/index/index',
// imageUrl: this.logoIndex
}
},
onShareTimeline() {
return {
title: 'BD访客系统',
path: '/pages/index/index',
// imageUrl: this.logoIndex
}
},
methods: {
async getStudy() {
let that = this
const fd = uni.getStorageSync('formdata') || {}
const sd = uni.getStorageSync('studydata') || {}
const mobileParam = fd.mobile || sd.mobile || ''
this.util.request({
api: '/api/mobile/visit/get-ask',
data: {
type: that.type
type: that.type,
mobile: mobileParam
},
utilSuccess: function(res) {
that.studyInfo = res
for(var k of res.file_detail){
if(k.extension=='mp4'){
that.videoList.push(k)
}else{
that.picList.push(k)
}
}
that.studyInfo = res
that.quizRequired = !(
res.quiz_required === 0 ||
res.quiz_required === false ||
res.quiz_required === '0'
)
const files = res.file_detail || []
for(var k of files){
if(k.extension=='mp4'){
that.videoList.push(k)
}else{
that.picList.push(k)
}
}
that.showSwiperFlag = that.picList.length==0? 1 : 0
that.studyMin = res.minute * 60
// that.studyMin = .1 * 60
const minute = res.minute ? parseFloat(res.minute) : 0
// VIP 1
if (!that.quizRequired && (!minute || minute <= 0)) {
that.studyMin = 60
} else {
that.studyMin = Math.max(0, Math.round(minute * 60))
}
},
utilFail: function(res) {}
})
},
loadTime() {
if (this.studyMin === null || this.studyMin === undefined) {
return
}
if (this.studyMin >= 0) {
let minutes = Math.floor(this.studyMin / 60);
let seconds = Math.floor(this.studyMin % 60);
minutes = minutes < 10 ? "0" + minutes : minutes
seconds = seconds < 10 ? "0" + seconds : seconds
this.studyTime = minutes + ":" + seconds
--this.studyMin;
} else {
clearInterval(this.timer);
this.studyMin--
} else if (this.studyMin === -1) {
if (this.timer) {
clearInterval(this.timer)
this.timer = null
}
}
},
goTest() {
if (!this.quizRequired) {
this.submitWatchOnly()
return
}
const form = uni.getStorageSync('formdata') || {}
const base = {
type: parseInt(this.type),
name: form.name,
mobile: form.mobile,
idcard: form.idcard || form.passcard,
expire_day: this.studyInfo.expire_day
}
const prev = uni.getStorageSync('studydata') || {}
uni.setStorageSync('studydata', Object.assign({}, prev, base))
uni.redirectTo({
url: '/pages/visit/testStudy?type=' + this.type
})
},
changeImg(e){
this.imgcurrent = e.current
},
changeImg(e){
this.videocurrent = e.current
},
changeSwiperImg(){
this.showSwiperFlag=0
this.imgcurrent=0
},
changeSwiperVideo(){
this.showSwiperFlag=1
this.videocurrent=0
}
},
submitWatchOnly() {
const form = uni.getStorageSync('formdata') || uni.getStorageSync('studydata') || {}
const that = this
this.util.request({
api: '/api/mobile/visit/ask-save',
method: 'POST',
data: {
type: parseInt(this.type),
name: form.name,
mobile: form.mobile,
idcard: form.idcard || form.passcard,
expire_day: this.studyInfo.expire_day,
content: [],
ask: []
},
utilSuccess: function(res) {
if (uni.getStorageSync('studydata')) {
uni.removeStorageSync('studydata')
}
uni.showToast({
title: '学习已完成',
duration: 1500,
icon: 'none'
})
setTimeout(function() {
if (uni.getStorageSync('formdata')) {
uni.redirectTo({
url: '/pages/visit/addrecord'
})
} else {
uni.redirectTo({
url: '/pages/index/index'
})
}
}, 1500)
},
utilFail: function(res) {
uni.showToast({
title: res || '提交失败',
duration: 2000,
icon: 'none'
})
}
})
},
changeImg(e) {
this.imgcurrent = e.current
},
changeVideo(e) {
this.videocurrent = e.current
},
changeSwiperImg(){
this.showSwiperFlag=0
this.imgcurrent=0
},
changeSwiperVideo(){
this.showSwiperFlag=1
this.videocurrent=0
}
}
@ -224,24 +311,24 @@
width: 100%;
height: 360rpx;
position: relative;
}
.service-show .changePicVideo{
position: absolute;
right: 80rpx;
bottom: 25rpx;
}
.service-show .changePicVideo view{
background: rgba(0,0,0,0.5);
display: inline-block;
padding: 5rpx 20rpx;
margin: 6rpx;
border-radius: 15rpx;
color: #fff;
font-size: 28rpx;
}
.service-show .changePicVideo view image{
width:24rpx;
height:21rpx;
margin-right: 10rpx;
}
</style>
.service-show .changePicVideo{
position: absolute;
right: 80rpx;
bottom: 25rpx;
}
.service-show .changePicVideo view{
background: rgba(0,0,0,0.5);
display: inline-block;
padding: 5rpx 20rpx;
margin: 6rpx;
border-radius: 15rpx;
color: #fff;
font-size: 28rpx;
}
.service-show .changePicVideo view image{
width:24rpx;
height:21rpx;
margin-right: 10rpx;
}
</style>

@ -2,9 +2,9 @@
<view class="containers">
<view class="steps">
<uni-steps :options="steps" :active="stepActive" active-color="#044ed7" />
</view>
<view class="expire" v-if="studyInfo.expire_day">
通过测验后{{studyInfo.expire_day}}天内可不再重复学习
</view>
<view class="expire" v-if="studyInfo.expire_day">
通过测验后{{studyInfo.expire_day}}天内可不再重复学习
</view>
<view class="asks">
<view v-for="(item,index) in askList">
@ -18,7 +18,7 @@
:localdata="item.answer" :wrap='true' multiple :map="{text:'content',value:'content'}" />
</view>
</view>
</view>
</view>
<view disabled class="justify-between submitBtn">
<text>需要正确率达{{rate}}%</text>
@ -48,68 +48,117 @@
answerList: [],
result: {}, //
resultArr: [], //
formData: {},
askData:{},
formData: {},
askData:{},
askContent:[],
}
},
onLoad(options) {
let that = this
this.type = options.type
this.askData.type = parseInt(options.type)
// for(let i=0;i<20;i++){
// this.resultArr.push([])
// }
this.type = options.type
this.getFormdata()
this.getStudy()
},
onShareAppMessage() {
return {
title: 'BD访客系统',
path: '/pages/index/index',
// imageUrl: this.logoIndex
}
},
onShareTimeline() {
return {
title: 'BD访客系统',
path: '/pages/index/index',
// imageUrl: this.logoIndex
}
if (!this.askData || typeof this.askData !== 'object') {
this.askData = {}
}
this.askData.type = parseInt(options.type)
this.getStudy()
},
onShareAppMessage() {
return {
title: 'BD访客系统',
path: '/pages/index/index',
// imageUrl: this.logoIndex
}
},
onShareTimeline() {
return {
title: 'BD访客系统',
path: '/pages/index/index',
// imageUrl: this.logoIndex
}
},
methods: {
getFormdata(){
// let res = uni.getStorageSync('formdata')
// this.formData = res
let res = uni.getStorageSync('studydata')
this.askData = res
methods: {
getFormdata(){
let res = uni.getStorageSync('studydata') || {}
this.askData = res
},
async getStudy() {
let that = this
const fd = uni.getStorageSync('formdata') || {}
const sd = uni.getStorageSync('studydata') || {}
const mobileParam = (that.askData && that.askData.mobile) || fd.mobile || sd.mobile || ''
this.util.request({
api: '/api/mobile/visit/get-ask',
data: {
type: that.type
type: that.type,
mobile: mobileParam
},
utilSuccess: function(res) {
if (Number(res.quiz_required) === 0) {
that.submitWatchOnlyFromTest(res)
return
}
that.studyInfo = res
that.askList = res.asks
that.rate = parseInt(res.rate)
that.askData.ask = res.asks
that.askData.expire_day = res.expire_day
for(let i=0;i<res.asks.length;i++){
that.resultArr.push([])
that.askList = res.asks || []
that.rate = parseInt(res.rate)
that.askData.ask = res.asks
that.askData.expire_day = res.expire_day
for(let i=0;i<(res.asks || []).length;i++){
that.resultArr.push([])
}
},
utilFail: function(res) {}
})
},
submitWatchOnlyFromTest(studyRes) {
const form = uni.getStorageSync('formdata') || this.askData || {}
const that = this
this.util.request({
api: '/api/mobile/visit/ask-save',
method: 'POST',
data: {
type: parseInt(this.type),
name: form.name,
mobile: form.mobile,
idcard: form.idcard || form.passcard,
expire_day: studyRes.expire_day,
content: [],
ask: []
},
utilSuccess: function(res) {
if (uni.getStorageSync('studydata')) {
uni.removeStorageSync('studydata')
}
uni.showToast({
title: '学习已完成',
duration: 1500,
icon: 'none'
})
setTimeout(function() {
if (uni.getStorageSync('formdata')) {
uni.redirectTo({
url: '/pages/visit/addrecord'
})
} else {
uni.redirectTo({
url: '/pages/index/index'
})
}
}, 1500)
},
utilFail: function(res) {
uni.showToast({
title: res || '提交失败',
duration: 2000,
icon: 'none'
})
}
})
},
//
radioAnswer(e, index) {
this.correctNum[index] = e.detail.data.result
this.correctNum[index] = e.detail.data.result
this.askContent[index] = e.detail.data.content
},
chenckAnswer(e, item, index) {
@ -137,7 +186,7 @@
},
//
submitAnswer() {
let correctLength = 0
let correctLength = 0
console.log("this.correctNum",this.correctNum)
for (var key in this.correctNum) {
if (this.correctNum[key] == 1) {
@ -153,101 +202,110 @@
},
submitForm() {
let that = this
this.resultArr.map((k,index)=>{
if(k.length>0){
this.askContent[index] = k
}
})
this.askData.content = this.askContent
console.log(this.result,this.resultArr,'---',this.askContent)
console.log("askdata",this.askData)
that.submitStudy()
let that = this
this.resultArr.map((k,index)=>{
if(k.length>0){
this.askContent[index] = k
}
})
this.askData.content = this.askContent
console.log(this.result,this.resultArr,'---',this.askContent)
console.log("askdata",this.askData)
that.submitStudy()
return
this.util.request({
api: '/api/mobile/visit/visit-save',
method: "POST",
data: that.formData,
utilSuccess: function(res) {
uni.showToast({
title: res.msg,
duration: 2000,
icon: 'none'
})
uni.showToast({
title: res.msg,
duration: 2000,
icon: 'none'
})
that.newsSubscription()
},
utilFail: function(res) {
console.log(res)
uni.showToast({
title: res,
duration: 2000,
icon: 'none'
})
utilFail: function(res) {
console.log(res)
uni.showToast({
title: res,
duration: 2000,
icon: 'none'
})
}
})
},
submitStudy() {
let that = this
console.log("that.askData",that.askData)
// return
this.util.request({
api: '/api/mobile/visit/ask-save',
method: "POST",
data: that.askData,
utilSuccess: function(res) {
if(uni.getStorageSync('studydata')){
uni.removeStorageSync('studydata')
}
uni.showToast({
title: '提交成功',
duration: 1500,
icon: 'none'
})
setTimeout(function(){
if (uni.getStorageSync('formdata')) {
uni.redirectTo({
url: '/pages/visit/addrecord'
})
} else {
uni.redirectTo({
url: '/pages/index/index'
})
}
},1500)
},
utilFail: function(res) {
uni.showToast({
title: res,
duration: 2000,
icon: 'none'
})
}
})
},
submitStudy() {
let that = this
console.log("that.askData",that.askData)
// return
this.util.request({
api: '/api/mobile/visit/ask-save',
method: "POST",
data: that.askData,
utilSuccess: function(res) {
if(uni.getStorageSync('studydata')){
uni.removeStorageSync('studydata')
}
uni.showToast({
title: '提交成功',
duration: 1500,
icon: 'none'
})
setTimeout(function(){
uni.redirectTo({
url: '/pages/index/index'
})
},1500)
},
utilFail: function(res) {
uni.showToast({
title: res,
duration: 2000,
icon: 'none'
})
}
})
},
newsSubscription() {
uni.getSetting({
withSubscriptions: true, //false
success(res) {
if (res.authSetting['scope.subscribeMessage']) {
uni.removeStorageSync('formdata')
uni.redirectTo({
url: '/pages/visit/successform'
})
} else {
//
uni.requestSubscribeMessage({
tmplIds: ['DmzNRREPFdZrMWconNDdbj_ebtVPRWufq27kRQ25eNg','IczaKkCmwf55tAAzCcxb_fbbf5L25SWrSKvaBrkIyk4'],
success(res) {
console.log("res", res)
uni.showToast({
title:'订阅成功'
})
uni.removeStorageSync('formdata')
uni.redirectTo({
url: '/pages/visit/successform'
})
}
})
}
}
});
},
newsSubscription() {
uni.getSetting({
withSubscriptions: true, //false
success(res) {
if (res.authSetting['scope.subscribeMessage']) {
uni.removeStorageSync('formdata')
uni.redirectTo({
url: '/pages/visit/successform'
})
} else {
//
uni.requestSubscribeMessage({
tmplIds: [
'O898NDrqGUUeSR42uraqr2PLEg05sNbYVu46I0qLkhE',
'Caa0O6pPtQDHQMPsqE6PHyzueeI11JvlpenbgwkYC0s'
],
success(res) {
console.log("res", res)
uni.showToast({
title:'订阅成功'
})
uni.removeStorageSync('formdata')
uni.redirectTo({
url: '/pages/visit/successform'
})
}
})
}
}
});
},
}
@ -259,14 +317,14 @@
background-color: #fff;
padding: 20rpx;
padding-bottom: 60rpx;
position: relative;
position: relative;
overflow: hidden;
}
.asks {
min-height: 80vh;
overflow-y: auto;
padding-bottom:60rpx
.asks {
min-height: 80vh;
overflow-y: auto;
padding-bottom:60rpx
}
.asks>view,
@ -277,7 +335,7 @@
.containers>.submitBtn {
position: fixed;
bottom: 0;
width: 100%;
width: 100%;
left:0
}
@ -306,11 +364,11 @@
.steps {
margin-bottom: 40rpx
}
.expire{
text-align: center;
font-size: 40rpx;
/* padding: 10px; */
margin-bottom: 40rpx;
}
</style>
.expire{
text-align: center;
font-size: 40rpx;
/* padding: 10px; */
margin-bottom: 40rpx;
}
</style>

@ -95,12 +95,12 @@
},
onLoad() {
this.isStudy()
let res = uni.getStorageSync('studydata')
if(res){
const res = uni.getStorageSync('studydata')
if (res) {
console.log(res)
this.form = res
}
this.isStudy()
},
onShareAppMessage() {
return {
@ -115,7 +115,7 @@
path: '/pages/index/index',
// imageUrl: this.logoIndex
}
},
},
methods:{
onAgreePrivacy() {
@ -145,12 +145,17 @@
},
isStudy(){
let that = this
const data = {
type: that.form.type
}
const idcard = (that.form.idcard || '').trim()
if (idcard) {
data.idcard = idcard
}
this.util.request({
api: '/api/mobile/visit/ask-log',
method: "get",
data:{
type:that.form.type
},
data: data,
utilSuccess: function(res) {
if(res.msg=='学习有效中'){
uni.showToast({
@ -183,8 +188,8 @@
padding: 20rpx;
padding-bottom: 60rpx;
}
.formtext {
margin-bottom: 20rpx
.formtext {
margin-bottom: 20rpx
}
.steps {
margin-bottom: 40rpx

@ -20,6 +20,6 @@
"ignore": [],
"include": []
},
"appid": "wx35190cc07e73eda1",
"appid": "wxdaa5d65b0714696d",
"editorSetting": {}
}

@ -1,6 +1,6 @@
{
"libVersion": "3.14.3",
"projectname": "szbd-vistor-wx",
"projectname": "yxbd-vistor-wx",
"setting": {
"urlCheck": true,
"coverView": true,

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save