b76deb00 by 杨炀

no message

1 parent 6d5c091f
......@@ -2,6 +2,13 @@ import request from './request.js'
import config from '@/config.js'
import * as loginServer from '@/common/login.js';
function checkReport() {
return request({
url: `/train/apply/getUserApplyInfo`,
method: 'get'
})
}
function getVenue() {
return request({
url: `/systemj/venue/appId`,
......@@ -220,7 +227,7 @@ function miniappData(params) {
export {
export {checkReport,
getVenue,
getOwnMemberInfo,
getSiteList,
......
<template>
<view class="graybg">
<view v-if="formData.type=='0'">
<view v-html="formData.content" class="richContent"></view>
</view>
<view v-if="formData.type=='1'" class="formBox">
<view @click="clickImg">
<image style="width: 100%;height: 50vw;" mode="aspectFit" v-for="p in formData.picArr" :src="p"/>
</view>
<view v-if="formData.content2" v-html="formData.content2" class="richContent2"></view>
<view class="formBox">
<uni-forms ref="baseForm" :modelValue="baseFormData">
<uni-forms-item label="姓名" required v-if="formData.fields.indexOf('0')>-1">
<uni-forms-item label="姓名" required>
<uni-easyinput v-model="baseFormData.name" placeholder="请输入姓名" />
</uni-forms-item>
<uni-forms-item label="手机号" required v-if="formData.fields.indexOf('1')>-1">
<uni-easyinput v-model="baseFormData.telno" placeholder="请输入手机号" />
<uni-forms-item label="身份证" required>
<uni-easyinput v-model="baseFormData.telno" placeholder="请输入身份证号码" />
</uni-forms-item>
<uni-forms-item label="需求描述" required v-if="formData.fields.indexOf('2')>-1">
<uni-forms-item label="备注说明">
<uni-easyinput type="textarea" v-model="baseFormData.requirement" placeholder="请输入需求描述" />
</uni-forms-item>
</uni-forms>
<button type="primary" @click="submit">提交</button>
<button type="primary" @click="submit">核实报名信息</button>
</view>
</view>
<uni-popup ref="alertPayOk" type="dialog">
<uni-popup-dialog type="success" confirmText="返回主页" content="提交成功" @confirm="goIndex">
<uni-popup-dialog type="success" confirmText="确定" content="用户不存在或信息填写错误请再次核实" @confirm="goIndex">
</uni-popup-dialog>
</uni-popup>
</template>
......@@ -47,11 +38,6 @@
const isActive = ref(null);
const formData = ref({})
const baseFormData = ref({})
const rules= ref({
name: {rules: [{required: true,errorMessage: '请输入姓名'}]},
telno: {rules: [{required: true,errorMessage: '请输入手机号'}]},
requirement: {rules: [{required: true,errorMessage: '请输入需求描述'}]},
})
onReady(()=>{
// 修改页头标题
......@@ -60,18 +46,15 @@
});
})
onShow(() => {
formData.value = JSON.parse(app.globalData.venue.miniappCustConfig)
formData.value.picArr = formData.value.pics.split(',')
});
})
function goIndex() {
uni.redirectTo({
url: `/pages/index/index`
})
}
function submit(){
// 姓名
if((formData.value.fields.indexOf('0')>-1) && baseFormData.value.name==undefined){
if(!baseFormData.value.name){
uni.showToast({
title: '请输入姓名',
icon: 'none',
......@@ -80,7 +63,7 @@
return
}
// 手机号
if(formData.value.fields.indexOf('1')>-1&&baseFormData.value.telno==undefined){
if(!baseFormData.value.telno){
uni.showToast({
title: '请输入手机号',
icon: 'none',
......@@ -88,39 +71,16 @@
});
return
}
// 需求描述
if(formData.value.fields.indexOf('2')>-1&&baseFormData.value.requirement==undefined){
uni.showToast({
title: '请输入需求描述',
icon: 'none',
duration: 2000
});
return
}
api.miniappData(baseFormData.value).then((res)=>{
baseFormData.value = []
alertPayOk.value.open()
api.checkReport().then((res)=>{
if(res.data.userNo){
} else {
alertPayOk.value.open()
}
})
}
function clickImg() {
uni.previewImage({
urls: formData.value.picArr,
// current: 0,
success: function(res) {
console.log('success', res)
},
fail: function(res) {
console.log('fail', res)
},
complete: function(res) {
console.log('complete', res)
}
})
}
</script>
<style scoped>
......
......@@ -7,9 +7,9 @@
</swiper>
<view class="whitepobox">
<view>{{form.name}}</view>
<view class="pp">培训时间:{{form.hdStart?.substring(0, 10)}}{{form.hdEnd?.substring(0, 10)}}</view>
<view class="pp">培训时间:{{form.trainStart?.substring(0, 10)}}{{form.trainEnd?.substring(0, 10)}}</view>
<view class="pp">培训地点:{{form.address}}</view>
<view class="pp">报道时间:{{form.address}}</view>
<view class="pp">报道时间:{{form.reportDate?.substring(0, 10)}}</view>
<view class="pp">主办单位:{{form.address}}</view>
<view class="pp">承办单位:{{form.address}}</view>
</view>
......@@ -26,12 +26,10 @@
<view class="whiteItem">
<view class="qbox">
<image class="m1" v-if="form.isJdView == 1" @click="gohotelList" src="./img/btn01.png"></image>
<image class="m1" v-if="isApply == '0'" @click="goTrainForm" src="./img/btn01.png"></image>
<image class="m1" v-else style="filter: grayscale(1);" src="./img/btn01.png"></image>
<image class="m2" v-if="form.isCarView == 1" @click="gocarList" src="./img/btn02.png"></image>
<image class="m2" v-else style="filter: grayscale(1);" src="./img/btn02.png"></image>
<image class="m3" v-if="form.isFoodView == 1" @click="gomealList" src="./img/btn03.png"></image>
<image class="m3" v-else style="filter: grayscale(1);" src="./img/btn03.png"></image>
<image class="m2" style="filter: grayscale(1);" src="./img/btn02.png"></image>
<image class="m3" style="filter: grayscale(1);" src="./img/btn03.png"></image>
</view>
</view>
<view class="whiteItem">
......@@ -78,7 +76,6 @@
</view>
<view class="myEnter" @click="goMycenter"><image src="./img/user.png" mode="aspectFill"></image></view>
<uni-popup class="popYanZhengBox" ref="popYanZheng" type="center">
<view class="popup-content">
......@@ -114,15 +111,19 @@
const data = reactive({
id: null,
form:{},
allNow:false
allNow:false,
isApply: '0'
})
const {
id,form,allNow
id,form,allNow,isApply
} = toRefs(data);
onLoad(option => {
if (option.id) {
id.value = option.id
}
if (option.isApply) {
isApply.value = option.isApply
}
if(option.scene){
id.value = decodeURIComponent(option.scene);
}
......@@ -141,48 +142,6 @@
getData()
})
let goPath
let currUser
function checkUserPhone(path) {
currUser = uni.getStorageSync('currUser')
if(!currUser){
loginServer.pcLogin().then(()=>{
currUser = uni.getStorageSync('currUser')
if (currUser.phonenumber) {
// debugger
return true
} else {
popYanZheng.value.open()
goPath = path
return false;
}
});
} else {
if (currUser.phonenumber) {
return true
} else {
popYanZheng.value.open()
goPath = path
return false;
}
}
}
function decryptPhoneNumber(res) {
// console.log(res)
loading.value = true
if (res.detail.errMsg.indexOf('ok') > -1) {
getWxUserPhone(res.detail).then((data) => {
console.log(data)
popYanZheng.value.close()
uni.redirectTo({
url: goPath
})
}).finally(() => {
loading.value = false
});
} else {
loading.value = false
}
}
function getData() {
hotel.getTrainDetail(id.value).then(res => {
......@@ -194,46 +153,42 @@
})
}
function gohotelList() {
let path = `/pages_hotel/hotel/hotelList?id=${id.value}`;
if (checkUserPhone(path)) {
function goTrainForm() {
let path = `/pages/form/index`;
uni.navigateTo({
url: path
});
}
});
}
function gocarList() {
let path = `/pages_hotel/car/index?activeId=${id.value}`;
if (checkUserPhone(path)) {
uni.navigateTo({
url: path
});
}
}
function gomealList() {
let path = `/pages_hotel/eat/index?activeId=${id.value}`;
if (checkUserPhone(path)) {
uni.navigateTo({
url: path
});
}
}
function goInvoice(){
const remarks = encodeURIComponent(JSON.stringify(form.value.remarks))
let path = `/pages_hotel/hotel/invoice?activeId=${id.value}&remarks=${remarks}&kpType=${form.value.kpType}`;
if (checkUserPhone(path)) {
uni.navigateTo({
url: path
});
}
}
function goIllustrate(){
let path = `/pages_hotel/hotel/illustrate?trainId=${id.value}`;
if (checkUserPhone(path)) {
uni.navigateTo({
url: path
});
}
}
function callphone(number){
uni.makePhoneCall({
......@@ -249,14 +204,6 @@
}
function changeIntroductionHeight(){
allNow.value = !allNow.value
}
function goMycenter(){
let path = `/pages_hotel/hotel/mycenter`;
if (checkUserPhone(path)) {
uni.navigateTo({
url: path
});
}
}
</script>
......

25 KB | W: | H:

12.8 KB | W: | H:

pages_hotel/hotel/img/btn01.png
pages_hotel/hotel/img/btn01.png
pages_hotel/hotel/img/btn01.png
pages_hotel/hotel/img/btn01.png
  • 2-up
  • Swipe
  • Onion skin

19 KB | W: | H:

7.29 KB | W: | H:

pages_hotel/hotel/img/btn02.png
pages_hotel/hotel/img/btn02.png
pages_hotel/hotel/img/btn02.png
pages_hotel/hotel/img/btn02.png
  • 2-up
  • Swipe
  • Onion skin

16.9 KB | W: | H:

8.67 KB | W: | H:

pages_hotel/hotel/img/btn03.png
pages_hotel/hotel/img/btn03.png
pages_hotel/hotel/img/btn03.png
pages_hotel/hotel/img/btn03.png
  • 2-up
  • Swipe
  • Onion skin
No preview for this file type
......@@ -75,7 +75,7 @@
});
}
function goDetail(item){
let path = `/pages_hotel/hotel/detail?id=${item.trainId}`;
let path = `/pages_hotel/hotel/detail?id=${item.trainId}&isApply=${item.isApply}`;
uni.navigateTo({
url: path
});
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!