2e2f984e by 杨炀

Merge commit '36d3ae2a'

# Conflicts:
#	common/hotel.js
#	node_modules/.vite/deps/_metadata.json
#	node_modules/.vite/deps/lodash.js
#	pages_hotel/hotel/index.vue
2 parents 1e985242 36d3ae2a
......@@ -3,101 +3,26 @@
import * as api from '@/common/api.js';
import config from '@/config.js';
let firstload = false
export default {
onLaunch: function() {
console.log('App Launch');
firstload = true
this.globalData.baseUrl = config.baseUrl;
this.globalData.baseUrl_api = config.baseUrl_api;
this.globalData.fileUrl = config.fileUrl;
new Promise((resolve, reject) => {
uni.checkSession({
success: res => {
loginServer
.getCurrUser(true)
.catch(() => {
return loginServer.pcLogin();
})
.then(user => {
resolve(user);
});
},
fail: res => {
loginServer
.wxLogin()
.then(loginRes => {
return loginServer.pcLogin(loginRes.code);
})
.then(user => {
resolve(user);
});
}
});
})
.then(()=>{
return loginServer.getNowOpenId()
})
.then(() => {
return loginServer.initData()
// console.log(22222222)
// const currUser = uni.getStorageSync('currUser');
// // console.log(currUser)
// return Promise.all([api.getVenue(), api.getOwnMemberInfo()]).then(res => {
// let ven = res[0].data;
// let men = res[1]?.data;
// if (ven.venuePic) {
// ven.venuePicArr = ven.venuePic.split(',');
// }
// if (ven.businessPeriod) {
// ven.startBus = ven.businessPeriod.split(',')[0];
// ven.endBus = ven.businessPeriod.split(',')[1];
// }
// ven.latitude = ven.lal.split(',')[0];
// ven.longitude = ven.lal.split(',')[1];
// this.globalData.venue = ven;
// this.globalData.isVip = men?.isVip;
// // this.globalData.relateProjectId = men.info.relateProjectId;
// this.globalData.relateProjectIdList = men?.info?.relateProjectIdList;
// this.globalData.relateVenueProjectIdList = men?.info?.relateVenueProjectIdList;
// this.globalData.venueConfig = {
// normalOverDay: ven.resSiteConfig?.normalOrderNum,
// normalPeriodStart: ven.resSiteConfig?.normalOrderPeriod.split(',')[0],
// normalPeriodEnd: ven.resSiteConfig?.normalOrderPeriod.split(',')[1]
// };
// if (men?.isVip) {
// this.globalData.venueConfig.memberOverDay = ven.resSiteConfig?.memberOrderNum;
// this.globalData.venueConfig.memberPeriodStart = ven.resSiteConfig?.memberOrderPeriod.split(',')[0];
// this.globalData.venueConfig.memberPeriodEnd = ven.resSiteConfig?.memberOrderPeriod.split(',')[1];
// }
// });
})
.then(() => {
},
onShow: function() {
console.log('App Show');
uni.getStorage({
key: 'token',
success: () => {
this.globalData.isLogin = true;
let firstLoadCallback = getApp().firstLoadCallback;
if (firstLoadCallback) {
firstLoadCallback();
}
});
},
onShow: function() {
console.log('App Show');
// loginServer.getNowOpenId()
if (!firstload) {
loginServer.getCurrUser(true)
.catch(() => {
return loginServer.pcLogin().then(() => {
uni.redirectTo({
url: getCurrentPages()[getCurrentPages().length - 1].$page.fullPath
})
});
})
}
},
fail: () => {
this.globalData.isLogin = false;
}
})
},
onHide: function() {
console.log('App Hide');
......
import request from './request.js'
import config from '@/config.js'
function getTrainList(params) {
function getTrainList(venueId) {
return request({
url: `/train/info/list`,
method: 'get',
params: params
url: `/train/info/h5List`,
method: 'get'
})
}
function getActivityDetail(id) {
function getTrainDetail(id) {
return request({
url: `/logex/activity/${id}`,
url: `/train/info/${id}`,
method: 'get',
params: id
})
......@@ -231,7 +230,7 @@ function newsSubmitOrderHotel(form) {
params: form
})
}
export {getTrainList,getActivityHotelList,getActivityDetail,getHotelById,getHotelRooms,submitOrder,getbilllist,getbilldetailbyId,
export {getTrainList,getActivityHotelList,getTrainDetail,getHotelById,getHotelRooms,submitOrder,getbilllist,getbilldetailbyId,
payForOrder,cancelOrder,getCanInvoiceBills,submitInvoice,getInvoiceByActiveId,getInvoiceDetailBills,
getInvoiceDetail,getInvoiceByUserId,editInvoice,addAddress,regionsList,addressList,delAddress,
checkResidueRoom,getActivityRestaurantList,getMenuById,
......
import request from './request'
import * as api from '@/common/api.js';
let appId = ''
let appId = ''
// #ifdef MP
const accountInfo = uni.getAccountInfoSync()
const appId = accountInfo.miniProgram.appId;
......@@ -180,6 +180,18 @@ function getNowOpenId() {
})
}
function h5Login(userName) {
return request({
url: `/h5Login`,
method: 'post',
params: {
username: userName
}
}).then((res) => {
uni.setStorageSync('token', 'Bearer ' + res.data.token);
})
}
function initData() {
console.log('initData')
......@@ -188,8 +200,8 @@ function initData() {
return Promise.all([api.getVenue(), api.getOwnMemberInfo()]).then(res => {
let ven = res[0].data;
let men = res[1]?.data;
const app = getApp();
const app = getApp();
if (ven.venuePic) {
ven.venuePicArr = ven.venuePic.split(',');
......@@ -228,5 +240,6 @@ export {
getWxUser,
getWxUserPhone,
checkUserAuth,
h5Login,
initData
}
\ No newline at end of file
......
<template>
<uni-popup class="popYanZhengBox" ref="popYanZheng" type="center">
<view class="popup-content">
<view class="t">温馨提示</view>
<view class="p">该微信未绑定系统内手机号,绑定手机号后正常使用。</view>
<button class="start" type="default" @click="login">绑定手机号</button>
</view>
</uni-popup>
</template>
<script setup>
import {
onMounted,
ref
} from "vue";
import {
h5Login
} from '@/common/login.js';
const app = getApp();
const popYanZheng = ref(null);
onMounted(() => {
if (!app.globalData.isLogin) {
popYanZheng.value.open()
}
})
function login() {
h5Login('12000013583')
.then(() => {
popYanZheng.value.close()
})
}
</script>
<style>
</style>
\ No newline at end of file
// prod
// const baseUrl = 'https://research.wtwuxicenter.com/';
// const baseUrl_api=`${baseUrl}/prod-api`;
// const baseUrl_api = 'https://research.wtwuxicenter.com/';
// uat
// const baseUrl = 'https://jxt.itechtop.cn';
const baseUrl = 'https://jxt.wtwuxicenter.com';
const baseUrl_api = `${baseUrl}/prod-api`;
// staging
// const baseUrl = 'https://5q5re1d432g2.ngrok2.xiaomiqiu123.top';
// const baseUrl = "http://192.168.1.118:8081";
// const baseUrl_api = `${baseUrl}`;
const fileUrl = "http://r.itechtop.cn";
const baseUrl_api = "http://192.168.1.118:8080";
export default {
baseUrl: baseUrl,
fileUrl: fileUrl,
baseUrl_api: baseUrl_api,
baseUrl_api: baseUrl_api
};
\ No newline at end of file
......
import App from './App'
// #ifndef VUE3
import Vue from 'vue'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
...App
})
app.$mount()
// #endif
// #ifdef VUE3
import {
createSSRApp
} from 'vue'
export function createApp() {
const app = createSSRApp(App)
return {
app
}
}
// #endif
import App from './App'
// #ifndef VUE3
import Vue from 'vue'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
...App
})
app.$mount()
// #endif
// #ifdef VUE3
import {
createSSRApp
} from 'vue'
import login from '@/components/login'
export function createApp() {
const app = createSSRApp(App)
app.component('showLogin', login)
return {
app
}
}
// #endif
\ No newline at end of file
......
......@@ -242,7 +242,7 @@
}
}
],
],
"globalStyle": {
"navigationStyle": "default",
"navigationBarTextStyle": "white",
......
<template>
<view class="page">
<show-login></show-login>
<view class="uni-margin-wrap">
<!-- <view class="logobox">
<!-- <view class="logobox">
<image class="logo" :src="venue.venueLogo"></image>
<text>{{venue.venueName}}</text>
</view> -->
<swiper class="swiper" circular :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval"
<!-- <swiper class="swiper" circular :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval"
:duration="duration" indicator-color="rgba(255,255,255,0.6)" indicator-active-color="#fff">
<swiper-item v-for="(p, index) in venue.venuePicArr" :key="index">
<view class="swiper-item">
<image mode="aspectFill" :src="p"></image>
</view>
</swiper-item>
</swiper>
</swiper> -->
</view>
<view class="infoArea">
<view class="contentbox">
<view class="name">
国电培训中心简介
<view class="content" v-html="venue.introdution">
</view>
<view class="content" v-html="venue.introdution">
</view>
</view>
<view class="n9" @click="makeCall">
联系电话:{{ venue.venueTelno }}
......@@ -79,14 +80,17 @@
getWxUserPhone
} from '@/common/login.js';
import {
onLoad,onShow,
onLoad,
onShow,
onReady,
onShareAppMessage,
onShareTimeline,onPullDownRefresh
onShareTimeline,
onPullDownRefresh
} from '@dcloudio/uni-app';
import {
ref,
getCurrentInstance
getCurrentInstance,
nextTick
} from 'vue';
......@@ -117,9 +121,17 @@
let proId;
let goPath;
const svId = ref(null);
const list = ref([{id:0,name:'培训助手',path:'/pages_hotel/hotel/index'},{id:1,name:'我的',path:'/pages_hotel/hotel/mycenter'}]);
onShow(()=>{
const list = ref([{
id: 0,
name: '培训助手',
path: '/pages_hotel/hotel/index'
}, {
id: 1,
name: '我的',
path: '/pages_hotel/hotel/mycenter'
}]);
onShow(() => {
if (app.globalData.isLogin) {
init();
} else {
......@@ -138,22 +150,23 @@
});
onReady(() => {
proxy._mapContext = uni.createMapContext("map", this)
})
})
let currUser
function checkUserPhone(path) {
currUser = uni.getStorageSync('currUser')
if(!currUser){
loginServer.pcLogin().then(()=>{
if (!currUser) {
loginServer.pcLogin().then(() => {
currUser = uni.getStorageSync('currUser')
if (currUser.phonenumber) {
debugger
return true
} else {
popYanZheng.value.open()
goPath = path
return false;
}
return true
} else {
popYanZheng.value.open()
goPath = path
return false;
}
});
} else {
if (currUser.phonenumber) {
......@@ -215,13 +228,13 @@
}
function init() {
venue.value = app.globalData.venue
latitude.value = app.globalData.venue.latitude
longitude.value = app.globalData.venue.longitude
// 修改页头标题
uni.setNavigationBarTitle({
title: venue.value.venueName
});
// venue.value = app.globalData.venue
// latitude.value = app.globalData.venue.latitude
// longitude.value = app.globalData.venue.longitude
// // 修改页头标题
// uni.setNavigationBarTitle({
// title: venue.value.venueName
// });
}
function open() {
......@@ -265,11 +278,11 @@
if (item.path) {
let path = item.path
// if (checkUserPhone(path)) {
uni.navigateTo({
url: item.path
});
uni.navigateTo({
url: item.path
});
// }
}else{
} else {
uni.showToast({
title: `暂未开放`,
icon: 'none'
......@@ -279,7 +292,11 @@
}
</script>
<style scope lang="scss">
.singlePop{ max-height: 60vh;overflow: auto;}
.singlePop {
max-height: 60vh;
overflow: auto;
}
.map {
width: 100rpx;
height: 100rpx;
......@@ -349,4 +366,4 @@
color: #b3b3b3;
border: #fff;
}
</style>
</style>
\ No newline at end of file
......
......@@ -16,8 +16,8 @@
<view class="whiteItem">
<view class="tt"> 培训简介</view>
<view class="pp" :class="allNow?'autoHeight':'onelineHeight'" v-html="form.reserveDes"></view>
<view class="formore" @click="changeIntroductionHeight" v-show="form.reserveDes?.length>20">
<view class="pp" :class="allNow?'autoHeight':'onelineHeight'" v-html="form.introduction"></view>
<view class="formore" @click="changeIntroductionHeight" v-show="form.introduction?.length>20">
<view v-show="!allNow">展开详情 <uni-icons type="bottom" color='#1EC886' size="12"></uni-icons></view>
<view v-show="allNow"> 收起 <uni-icons type="top" color='#1EC886' size="12"></uni-icons></view>
......@@ -59,7 +59,7 @@
</view>
</template>
</uni-list-item>
<uni-list-item :border="true" title="在线客服" :clickable="true">
<!-- <uni-list-item :border="true" title="在线客服" :clickable="true">
<template v-slot:header>
<view class="slot-box">
<image class="slot-image" src="./img/qt04.png" mode="widthFix"></image>
......@@ -70,7 +70,7 @@
<uni-icons type="forward" color="#bbb" size="16"></uni-icons>
</button>
</template>
</uni-list-item>
</uni-list-item> -->
</uni-list>
</view>
......@@ -130,15 +130,15 @@
})
onShow(option => {
if (app.globalData.isLogin) {
getActivity()
getData()
} else {
app.firstLoadCallback = () => {
getActivity()
getData()
};
}
})
onPullDownRefresh(() => {
getActivity()
getData()
})
let goPath
let currUser
......@@ -184,8 +184,8 @@
}
}
function getActivity() {
hotel.getActivityDetail(id.value).then(res => {
function getData() {
hotel.getTrainDetail(id.value).then(res => {
form.value = res.data
app.globalData.carStart = res.data.carStart
app.globalData.carEnd = res.data.carEnd
......
No preview for this file type
<template>
<view class="pb50">
<view style="padding:0 30rpx;">
<uni-segmented-control :current="current" :values="items" @clickItem="onClickItem" styleType="button" activeColor="#15CFAB"></uni-segmented-control>
<view class="active" v-for="(item, index) in list" :key="index" @click="goDetail(item)">
<swiper class="activeSwiper" circular :autoplay="autoplay">
<swiper-item v-for="(pic,index) in item.photos?.split(',')" :key="index">
<image class="cover" mode="aspectFill" :src="pic"></image>
</swiper-item>
</swiper>
<view class="name">{{item.name}}</view>
<view class="pp" style="display: flex;">培训时间:{{item.hdStart.substring(0, 10)}}{{item.hdEnd.substring(0, 10)}}</view>
<view class="pp" style="display: flex;">报道时间:{{item.hdStart.substring(0, 10)}}{{item.hdEnd.substring(0, 10)}}</view>
<view class="pp" style="display: flex;">主办单位:{{item.address}}</view>
<view class="pp" style="display: flex;">承办单位:{{item.address}}</view>
<view class="pp" style="display: flex;">培训地点:{{item.address}}</view>
<button class="btn btn1">点击进入</button>
</view>
<view>
<view class="active" v-for="(item, index) in showList" :key="index" @click="goDetail(item)">
<swiper class="activeSwiper" circular :autoplay="autoplay">
<swiper-item v-for="(pic,index) in item.photos?.split(',')" :key="index">
<image class="cover" mode="aspectFill" :src="pic"></image>
</swiper-item>
</swiper>
<view class="name">{{item.name}}</view>
<view class="pp" style="display: flex;">培训时间:{{item.trainStart.substring(0, 10)}}{{item.trainEnd.substring(0, 10)}}</view>
<view class="pp" style="display: flex;">报道时间:{{item.reportDate.substring(0, 10)}}</view>
<view class="pp" style="display: flex;">主办单位:{{item.organizer}}</view>
<view class="pp" style="display: flex;">承办单位:{{item.address}}</view>
<view class="pp" style="display: flex;">培训地点:{{item.address}}</view>
<button class="btn btn1">点击进入</button>
</view>
</view>
</view>
<view class="nodata" v-if="list.length==0">
<view class="nodata" v-if="showList.length==0">
<image mode="aspectFit" src="/static/nodata.png"></image>
<text> 暂无活动</text>
</view>
<!-- 我的 -->
<view class="myEnter" @click="goMycenter"><image src="./img/user.png" mode="aspectFill"></image></view>
</template>
<script setup>
......@@ -34,13 +35,16 @@
const app = getApp();
const { proxy } = getCurrentInstance();
const data = reactive({
showList: [],
list: [],
list0: [],
list1: [],
query: {},
autoplay:true,
items: ['全部', '进行中', '已过期'],
current: 1
});
const { list,query,autoplay,items,current } = toRefs(data);
const { showList,list,list0,list1,query,autoplay,items,current } = toRefs(data);
onShow(option =>{
if (app.globalData.isLogin) {
......@@ -55,18 +59,23 @@
getList();
});
function getList(){
hotel.getTrainList(query.value).then(res => {
list.value = res.rows;
list0.value = []
list1.value = []
hotel.getTrainList().then(res => {
list.value = res.rows
for(var n of list.value){
if(n.status == 0){
list0.value.push(n)
}
if(n.status == 1){
list1.value.push(n)
}
}
getShowList(current.value)
});
}
function goDetail(item){
let path = `/pages_hotel/hotel/detail?id=${item.id}`;
uni.navigateTo({
url: path
});
}
function goMycenter(){
let path = `/pages_hotel/hotel/mycenter`;
let path = `/pages_hotel/hotel/detail?id=${item.trainId}`;
uni.navigateTo({
url: path
});
......@@ -75,6 +84,20 @@
if(current.value != e.currentIndex){
current.value = e.currentIndex
}
getShowList(e.currentIndex)
}
function getShowList(n){
switch (n){
case 0:
showList.value = list.value
break;
case 1:
showList.value = list0.value
break;
case 2:
showList.value = list1.value
break;
}
}
</script>
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!