Merge commit '36d3ae2a'
# Conflicts: # common/hotel.js # node_modules/.vite/deps/_metadata.json # node_modules/.vite/deps/lodash.js # pages_hotel/hotel/index.vue
Showing
11 changed files
with
217 additions
and
206 deletions
| ... | @@ -3,101 +3,26 @@ | ... | @@ -3,101 +3,26 @@ |
| 3 | import * as api from '@/common/api.js'; | 3 | import * as api from '@/common/api.js'; |
| 4 | import config from '@/config.js'; | 4 | import config from '@/config.js'; |
| 5 | 5 | ||
| 6 | |||
| 7 | let firstload = false | ||
| 8 | export default { | 6 | export default { |
| 9 | onLaunch: function() { | 7 | onLaunch: function() { |
| 10 | console.log('App Launch'); | 8 | console.log('App Launch'); |
| 11 | firstload = true | ||
| 12 | this.globalData.baseUrl = config.baseUrl; | ||
| 13 | this.globalData.baseUrl_api = config.baseUrl_api; | 9 | this.globalData.baseUrl_api = config.baseUrl_api; |
| 14 | this.globalData.fileUrl = config.fileUrl; | 10 | }, |
| 15 | 11 | onShow: function() { | |
| 16 | new Promise((resolve, reject) => { | 12 | console.log('App Show'); |
| 17 | uni.checkSession({ | 13 | uni.getStorage({ |
| 18 | success: res => { | 14 | key: 'token', |
| 19 | loginServer | 15 | success: () => { |
| 20 | .getCurrUser(true) | ||
| 21 | .catch(() => { | ||
| 22 | return loginServer.pcLogin(); | ||
| 23 | }) | ||
| 24 | .then(user => { | ||
| 25 | resolve(user); | ||
| 26 | }); | ||
| 27 | }, | ||
| 28 | fail: res => { | ||
| 29 | loginServer | ||
| 30 | .wxLogin() | ||
| 31 | .then(loginRes => { | ||
| 32 | return loginServer.pcLogin(loginRes.code); | ||
| 33 | }) | ||
| 34 | .then(user => { | ||
| 35 | resolve(user); | ||
| 36 | }); | ||
| 37 | } | ||
| 38 | }); | ||
| 39 | }) | ||
| 40 | .then(()=>{ | ||
| 41 | return loginServer.getNowOpenId() | ||
| 42 | }) | ||
| 43 | .then(() => { | ||
| 44 | return loginServer.initData() | ||
| 45 | // console.log(22222222) | ||
| 46 | // const currUser = uni.getStorageSync('currUser'); | ||
| 47 | // // console.log(currUser) | ||
| 48 | // return Promise.all([api.getVenue(), api.getOwnMemberInfo()]).then(res => { | ||
| 49 | // let ven = res[0].data; | ||
| 50 | // let men = res[1]?.data; | ||
| 51 | |||
| 52 | // if (ven.venuePic) { | ||
| 53 | // ven.venuePicArr = ven.venuePic.split(','); | ||
| 54 | // } | ||
| 55 | // if (ven.businessPeriod) { | ||
| 56 | // ven.startBus = ven.businessPeriod.split(',')[0]; | ||
| 57 | // ven.endBus = ven.businessPeriod.split(',')[1]; | ||
| 58 | // } | ||
| 59 | // ven.latitude = ven.lal.split(',')[0]; | ||
| 60 | // ven.longitude = ven.lal.split(',')[1]; | ||
| 61 | |||
| 62 | // this.globalData.venue = ven; | ||
| 63 | // this.globalData.isVip = men?.isVip; | ||
| 64 | // // this.globalData.relateProjectId = men.info.relateProjectId; | ||
| 65 | // this.globalData.relateProjectIdList = men?.info?.relateProjectIdList; | ||
| 66 | // this.globalData.relateVenueProjectIdList = men?.info?.relateVenueProjectIdList; | ||
| 67 | |||
| 68 | // this.globalData.venueConfig = { | ||
| 69 | // normalOverDay: ven.resSiteConfig?.normalOrderNum, | ||
| 70 | // normalPeriodStart: ven.resSiteConfig?.normalOrderPeriod.split(',')[0], | ||
| 71 | // normalPeriodEnd: ven.resSiteConfig?.normalOrderPeriod.split(',')[1] | ||
| 72 | // }; | ||
| 73 | // if (men?.isVip) { | ||
| 74 | // this.globalData.venueConfig.memberOverDay = ven.resSiteConfig?.memberOrderNum; | ||
| 75 | // this.globalData.venueConfig.memberPeriodStart = ven.resSiteConfig?.memberOrderPeriod.split(',')[0]; | ||
| 76 | // this.globalData.venueConfig.memberPeriodEnd = ven.resSiteConfig?.memberOrderPeriod.split(',')[1]; | ||
| 77 | // } | ||
| 78 | // }); | ||
| 79 | }) | ||
| 80 | .then(() => { | ||
| 81 | this.globalData.isLogin = true; | 16 | this.globalData.isLogin = true; |
| 82 | let firstLoadCallback = getApp().firstLoadCallback; | 17 | let firstLoadCallback = getApp().firstLoadCallback; |
| 83 | if (firstLoadCallback) { | 18 | if (firstLoadCallback) { |
| 84 | firstLoadCallback(); | 19 | firstLoadCallback(); |
| 85 | } | 20 | } |
| 86 | }); | 21 | }, |
| 87 | }, | 22 | fail: () => { |
| 88 | onShow: function() { | 23 | this.globalData.isLogin = false; |
| 89 | console.log('App Show'); | 24 | } |
| 90 | // loginServer.getNowOpenId() | 25 | }) |
| 91 | if (!firstload) { | ||
| 92 | loginServer.getCurrUser(true) | ||
| 93 | .catch(() => { | ||
| 94 | return loginServer.pcLogin().then(() => { | ||
| 95 | uni.redirectTo({ | ||
| 96 | url: getCurrentPages()[getCurrentPages().length - 1].$page.fullPath | ||
| 97 | }) | ||
| 98 | }); | ||
| 99 | }) | ||
| 100 | } | ||
| 101 | }, | 26 | }, |
| 102 | onHide: function() { | 27 | onHide: function() { |
| 103 | console.log('App Hide'); | 28 | console.log('App Hide'); | ... | ... |
| 1 | import request from './request.js' | 1 | import request from './request.js' |
| 2 | import config from '@/config.js' | 2 | import config from '@/config.js' |
| 3 | 3 | ||
| 4 | function getTrainList(params) { | 4 | function getTrainList(venueId) { |
| 5 | return request({ | 5 | return request({ |
| 6 | url: `/train/info/list`, | 6 | url: `/train/info/h5List`, |
| 7 | method: 'get', | 7 | method: 'get' |
| 8 | params: params | ||
| 9 | }) | 8 | }) |
| 10 | } | 9 | } |
| 11 | function getActivityDetail(id) { | 10 | function getTrainDetail(id) { |
| 12 | return request({ | 11 | return request({ |
| 13 | url: `/logex/activity/${id}`, | 12 | url: `/train/info/${id}`, |
| 14 | method: 'get', | 13 | method: 'get', |
| 15 | params: id | 14 | params: id |
| 16 | }) | 15 | }) |
| ... | @@ -231,7 +230,7 @@ function newsSubmitOrderHotel(form) { | ... | @@ -231,7 +230,7 @@ function newsSubmitOrderHotel(form) { |
| 231 | params: form | 230 | params: form |
| 232 | }) | 231 | }) |
| 233 | } | 232 | } |
| 234 | export {getTrainList,getActivityHotelList,getActivityDetail,getHotelById,getHotelRooms,submitOrder,getbilllist,getbilldetailbyId, | 233 | export {getTrainList,getActivityHotelList,getTrainDetail,getHotelById,getHotelRooms,submitOrder,getbilllist,getbilldetailbyId, |
| 235 | payForOrder,cancelOrder,getCanInvoiceBills,submitInvoice,getInvoiceByActiveId,getInvoiceDetailBills, | 234 | payForOrder,cancelOrder,getCanInvoiceBills,submitInvoice,getInvoiceByActiveId,getInvoiceDetailBills, |
| 236 | getInvoiceDetail,getInvoiceByUserId,editInvoice,addAddress,regionsList,addressList,delAddress, | 235 | getInvoiceDetail,getInvoiceByUserId,editInvoice,addAddress,regionsList,addressList,delAddress, |
| 237 | checkResidueRoom,getActivityRestaurantList,getMenuById, | 236 | checkResidueRoom,getActivityRestaurantList,getMenuById, | ... | ... |
| 1 | import request from './request' | 1 | import request from './request' |
| 2 | import * as api from '@/common/api.js'; | 2 | import * as api from '@/common/api.js'; |
| 3 | 3 | ||
| 4 | let appId = '' | 4 | let appId = '' |
| 5 | // #ifdef MP | 5 | // #ifdef MP |
| 6 | const accountInfo = uni.getAccountInfoSync() | 6 | const accountInfo = uni.getAccountInfoSync() |
| 7 | const appId = accountInfo.miniProgram.appId; | 7 | const appId = accountInfo.miniProgram.appId; |
| ... | @@ -180,6 +180,18 @@ function getNowOpenId() { | ... | @@ -180,6 +180,18 @@ function getNowOpenId() { |
| 180 | }) | 180 | }) |
| 181 | } | 181 | } |
| 182 | 182 | ||
| 183 | function h5Login(userName) { | ||
| 184 | return request({ | ||
| 185 | url: `/h5Login`, | ||
| 186 | method: 'post', | ||
| 187 | params: { | ||
| 188 | username: userName | ||
| 189 | } | ||
| 190 | }).then((res) => { | ||
| 191 | uni.setStorageSync('token', 'Bearer ' + res.data.token); | ||
| 192 | }) | ||
| 193 | } | ||
| 194 | |||
| 183 | function initData() { | 195 | function initData() { |
| 184 | console.log('initData') | 196 | console.log('initData') |
| 185 | 197 | ||
| ... | @@ -188,8 +200,8 @@ function initData() { | ... | @@ -188,8 +200,8 @@ function initData() { |
| 188 | return Promise.all([api.getVenue(), api.getOwnMemberInfo()]).then(res => { | 200 | return Promise.all([api.getVenue(), api.getOwnMemberInfo()]).then(res => { |
| 189 | let ven = res[0].data; | 201 | let ven = res[0].data; |
| 190 | let men = res[1]?.data; | 202 | let men = res[1]?.data; |
| 191 | 203 | ||
| 192 | const app = getApp(); | 204 | const app = getApp(); |
| 193 | 205 | ||
| 194 | if (ven.venuePic) { | 206 | if (ven.venuePic) { |
| 195 | ven.venuePicArr = ven.venuePic.split(','); | 207 | ven.venuePicArr = ven.venuePic.split(','); |
| ... | @@ -228,5 +240,6 @@ export { | ... | @@ -228,5 +240,6 @@ export { |
| 228 | getWxUser, | 240 | getWxUser, |
| 229 | getWxUserPhone, | 241 | getWxUserPhone, |
| 230 | checkUserAuth, | 242 | checkUserAuth, |
| 243 | h5Login, | ||
| 231 | initData | 244 | initData |
| 232 | } | 245 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
components/login/index.vue
0 → 100644
| 1 | <template> | ||
| 2 | <uni-popup class="popYanZhengBox" ref="popYanZheng" type="center"> | ||
| 3 | <view class="popup-content"> | ||
| 4 | <view class="t">温馨提示</view> | ||
| 5 | <view class="p">该微信未绑定系统内手机号,绑定手机号后正常使用。</view> | ||
| 6 | <button class="start" type="default" @click="login">绑定手机号</button> | ||
| 7 | </view> | ||
| 8 | </uni-popup> | ||
| 9 | </template> | ||
| 10 | |||
| 11 | <script setup> | ||
| 12 | import { | ||
| 13 | onMounted, | ||
| 14 | ref | ||
| 15 | } from "vue"; | ||
| 16 | import { | ||
| 17 | h5Login | ||
| 18 | } from '@/common/login.js'; | ||
| 19 | |||
| 20 | const app = getApp(); | ||
| 21 | |||
| 22 | const popYanZheng = ref(null); | ||
| 23 | |||
| 24 | |||
| 25 | onMounted(() => { | ||
| 26 | if (!app.globalData.isLogin) { | ||
| 27 | popYanZheng.value.open() | ||
| 28 | } | ||
| 29 | }) | ||
| 30 | |||
| 31 | function login() { | ||
| 32 | h5Login('12000013583') | ||
| 33 | .then(() => { | ||
| 34 | popYanZheng.value.close() | ||
| 35 | }) | ||
| 36 | } | ||
| 37 | </script> | ||
| 38 | |||
| 39 | <style> | ||
| 40 | |||
| 41 | </style> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 1 | // prod | 1 | // prod |
| 2 | // const baseUrl = 'https://research.wtwuxicenter.com/'; | 2 | // const baseUrl_api = 'https://research.wtwuxicenter.com/'; |
| 3 | // const baseUrl_api=`${baseUrl}/prod-api`; | ||
| 4 | 3 | ||
| 5 | // uat | ||
| 6 | // const baseUrl = 'https://jxt.itechtop.cn'; | ||
| 7 | const baseUrl = 'https://jxt.wtwuxicenter.com'; | ||
| 8 | const baseUrl_api = `${baseUrl}/prod-api`; | ||
| 9 | 4 | ||
| 10 | // staging | 5 | // staging |
| 11 | // const baseUrl = 'https://5q5re1d432g2.ngrok2.xiaomiqiu123.top'; | 6 | const baseUrl_api = "http://192.168.1.118:8080"; |
| 12 | |||
| 13 | // const baseUrl = "http://192.168.1.118:8081"; | ||
| 14 | // const baseUrl_api = `${baseUrl}`; | ||
| 15 | |||
| 16 | const fileUrl = "http://r.itechtop.cn"; | ||
| 17 | 7 | ||
| 18 | export default { | 8 | export default { |
| 19 | baseUrl: baseUrl, | 9 | baseUrl_api: baseUrl_api |
| 20 | fileUrl: fileUrl, | ||
| 21 | baseUrl_api: baseUrl_api, | ||
| 22 | }; | 10 | }; |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| 1 | import App from './App' | 1 | import App from './App' |
| 2 | // #ifndef VUE3 | 2 | |
| 3 | import Vue from 'vue' | 3 | // #ifndef VUE3 |
| 4 | Vue.config.productionTip = false | 4 | import Vue from 'vue' |
| 5 | App.mpType = 'app' | 5 | Vue.config.productionTip = false |
| 6 | const app = new Vue({ | 6 | App.mpType = 'app' |
| 7 | ...App | 7 | const app = new Vue({ |
| 8 | }) | 8 | ...App |
| 9 | app.$mount() | 9 | }) |
| 10 | // #endif | 10 | app.$mount() |
| 11 | 11 | // #endif | |
| 12 | // #ifdef VUE3 | 12 | |
| 13 | import { | 13 | // #ifdef VUE3 |
| 14 | createSSRApp | 14 | import { |
| 15 | } from 'vue' | 15 | createSSRApp |
| 16 | export function createApp() { | 16 | } from 'vue' |
| 17 | const app = createSSRApp(App) | 17 | import login from '@/components/login' |
| 18 | return { | 18 | |
| 19 | app | 19 | export function createApp() { |
| 20 | } | 20 | const app = createSSRApp(App) |
| 21 | } | 21 | app.component('showLogin', login) |
| 22 | // #endif | 22 | |
| 23 | return { | ||
| 24 | app | ||
| 25 | } | ||
| 26 | } | ||
| 27 | // #endif | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| 1 | <template> | 1 | <template> |
| 2 | <view class="page"> | 2 | <view class="page"> |
| 3 | <show-login></show-login> | ||
| 3 | <view class="uni-margin-wrap"> | 4 | <view class="uni-margin-wrap"> |
| 4 | <!-- <view class="logobox"> | 5 | <!-- <view class="logobox"> |
| 5 | <image class="logo" :src="venue.venueLogo"></image> | 6 | <image class="logo" :src="venue.venueLogo"></image> |
| 6 | <text>{{venue.venueName}}</text> | 7 | <text>{{venue.venueName}}</text> |
| 7 | </view> --> | 8 | </view> --> |
| 8 | 9 | ||
| 9 | <swiper class="swiper" circular :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval" | 10 | <!-- <swiper class="swiper" circular :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval" |
| 10 | :duration="duration" indicator-color="rgba(255,255,255,0.6)" indicator-active-color="#fff"> | 11 | :duration="duration" indicator-color="rgba(255,255,255,0.6)" indicator-active-color="#fff"> |
| 11 | <swiper-item v-for="(p, index) in venue.venuePicArr" :key="index"> | 12 | <swiper-item v-for="(p, index) in venue.venuePicArr" :key="index"> |
| 12 | <view class="swiper-item"> | 13 | <view class="swiper-item"> |
| 13 | <image mode="aspectFill" :src="p"></image> | 14 | <image mode="aspectFill" :src="p"></image> |
| 14 | </view> | 15 | </view> |
| 15 | </swiper-item> | 16 | </swiper-item> |
| 16 | </swiper> | 17 | </swiper> --> |
| 17 | </view> | 18 | </view> |
| 18 | <view class="infoArea"> | 19 | <view class="infoArea"> |
| 19 | <view class="contentbox"> | 20 | <view class="contentbox"> |
| 20 | <view class="name"> | 21 | <view class="name"> |
| 21 | 国电培训中心简介 | 22 | 国电培训中心简介 |
| 22 | <view class="content" v-html="venue.introdution"> | 23 | <view class="content" v-html="venue.introdution"> |
| 23 | </view> | 24 | </view> |
| 24 | </view> | 25 | </view> |
| 25 | <view class="n9" @click="makeCall"> | 26 | <view class="n9" @click="makeCall"> |
| 26 | 联系电话:{{ venue.venueTelno }} | 27 | 联系电话:{{ venue.venueTelno }} |
| ... | @@ -79,14 +80,17 @@ | ... | @@ -79,14 +80,17 @@ |
| 79 | getWxUserPhone | 80 | getWxUserPhone |
| 80 | } from '@/common/login.js'; | 81 | } from '@/common/login.js'; |
| 81 | import { | 82 | import { |
| 82 | onLoad,onShow, | 83 | onLoad, |
| 84 | onShow, | ||
| 83 | onReady, | 85 | onReady, |
| 84 | onShareAppMessage, | 86 | onShareAppMessage, |
| 85 | onShareTimeline,onPullDownRefresh | 87 | onShareTimeline, |
| 88 | onPullDownRefresh | ||
| 86 | } from '@dcloudio/uni-app'; | 89 | } from '@dcloudio/uni-app'; |
| 87 | import { | 90 | import { |
| 88 | ref, | 91 | ref, |
| 89 | getCurrentInstance | 92 | getCurrentInstance, |
| 93 | nextTick | ||
| 90 | } from 'vue'; | 94 | } from 'vue'; |
| 91 | 95 | ||
| 92 | 96 | ||
| ... | @@ -117,9 +121,17 @@ | ... | @@ -117,9 +121,17 @@ |
| 117 | let proId; | 121 | let proId; |
| 118 | let goPath; | 122 | let goPath; |
| 119 | const svId = ref(null); | 123 | const svId = ref(null); |
| 120 | const list = ref([{id:0,name:'培训助手',path:'/pages_hotel/hotel/index'},{id:1,name:'我的',path:'/pages_hotel/hotel/mycenter'}]); | 124 | const list = ref([{ |
| 121 | 125 | id: 0, | |
| 122 | onShow(()=>{ | 126 | name: '培训助手', |
| 127 | path: '/pages_hotel/hotel/index' | ||
| 128 | }, { | ||
| 129 | id: 1, | ||
| 130 | name: '我的', | ||
| 131 | path: '/pages_hotel/hotel/mycenter' | ||
| 132 | }]); | ||
| 133 | |||
| 134 | onShow(() => { | ||
| 123 | if (app.globalData.isLogin) { | 135 | if (app.globalData.isLogin) { |
| 124 | init(); | 136 | init(); |
| 125 | } else { | 137 | } else { |
| ... | @@ -138,22 +150,23 @@ | ... | @@ -138,22 +150,23 @@ |
| 138 | }); | 150 | }); |
| 139 | onReady(() => { | 151 | onReady(() => { |
| 140 | proxy._mapContext = uni.createMapContext("map", this) | 152 | proxy._mapContext = uni.createMapContext("map", this) |
| 141 | }) | 153 | }) |
| 142 | 154 | ||
| 143 | let currUser | 155 | let currUser |
| 156 | |||
| 144 | function checkUserPhone(path) { | 157 | function checkUserPhone(path) { |
| 145 | currUser = uni.getStorageSync('currUser') | 158 | currUser = uni.getStorageSync('currUser') |
| 146 | if(!currUser){ | 159 | if (!currUser) { |
| 147 | loginServer.pcLogin().then(()=>{ | 160 | loginServer.pcLogin().then(() => { |
| 148 | currUser = uni.getStorageSync('currUser') | 161 | currUser = uni.getStorageSync('currUser') |
| 149 | if (currUser.phonenumber) { | 162 | if (currUser.phonenumber) { |
| 150 | debugger | 163 | debugger |
| 151 | return true | 164 | return true |
| 152 | } else { | 165 | } else { |
| 153 | popYanZheng.value.open() | 166 | popYanZheng.value.open() |
| 154 | goPath = path | 167 | goPath = path |
| 155 | return false; | 168 | return false; |
| 156 | } | 169 | } |
| 157 | }); | 170 | }); |
| 158 | } else { | 171 | } else { |
| 159 | if (currUser.phonenumber) { | 172 | if (currUser.phonenumber) { |
| ... | @@ -215,13 +228,13 @@ | ... | @@ -215,13 +228,13 @@ |
| 215 | } | 228 | } |
| 216 | 229 | ||
| 217 | function init() { | 230 | function init() { |
| 218 | venue.value = app.globalData.venue | 231 | // venue.value = app.globalData.venue |
| 219 | latitude.value = app.globalData.venue.latitude | 232 | // latitude.value = app.globalData.venue.latitude |
| 220 | longitude.value = app.globalData.venue.longitude | 233 | // longitude.value = app.globalData.venue.longitude |
| 221 | // 修改页头标题 | 234 | // // 修改页头标题 |
| 222 | uni.setNavigationBarTitle({ | 235 | // uni.setNavigationBarTitle({ |
| 223 | title: venue.value.venueName | 236 | // title: venue.value.venueName |
| 224 | }); | 237 | // }); |
| 225 | } | 238 | } |
| 226 | 239 | ||
| 227 | function open() { | 240 | function open() { |
| ... | @@ -265,11 +278,11 @@ | ... | @@ -265,11 +278,11 @@ |
| 265 | if (item.path) { | 278 | if (item.path) { |
| 266 | let path = item.path | 279 | let path = item.path |
| 267 | // if (checkUserPhone(path)) { | 280 | // if (checkUserPhone(path)) { |
| 268 | uni.navigateTo({ | 281 | uni.navigateTo({ |
| 269 | url: item.path | 282 | url: item.path |
| 270 | }); | 283 | }); |
| 271 | // } | 284 | // } |
| 272 | }else{ | 285 | } else { |
| 273 | uni.showToast({ | 286 | uni.showToast({ |
| 274 | title: `暂未开放`, | 287 | title: `暂未开放`, |
| 275 | icon: 'none' | 288 | icon: 'none' |
| ... | @@ -279,7 +292,11 @@ | ... | @@ -279,7 +292,11 @@ |
| 279 | } | 292 | } |
| 280 | </script> | 293 | </script> |
| 281 | <style scope lang="scss"> | 294 | <style scope lang="scss"> |
| 282 | .singlePop{ max-height: 60vh;overflow: auto;} | 295 | .singlePop { |
| 296 | max-height: 60vh; | ||
| 297 | overflow: auto; | ||
| 298 | } | ||
| 299 | |||
| 283 | .map { | 300 | .map { |
| 284 | width: 100rpx; | 301 | width: 100rpx; |
| 285 | height: 100rpx; | 302 | height: 100rpx; |
| ... | @@ -349,4 +366,4 @@ | ... | @@ -349,4 +366,4 @@ |
| 349 | color: #b3b3b3; | 366 | color: #b3b3b3; |
| 350 | border: #fff; | 367 | border: #fff; |
| 351 | } | 368 | } |
| 352 | </style> | 369 | </style> |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -16,8 +16,8 @@ | ... | @@ -16,8 +16,8 @@ |
| 16 | 16 | ||
| 17 | <view class="whiteItem"> | 17 | <view class="whiteItem"> |
| 18 | <view class="tt"> 培训简介</view> | 18 | <view class="tt"> 培训简介</view> |
| 19 | <view class="pp" :class="allNow?'autoHeight':'onelineHeight'" v-html="form.reserveDes"></view> | 19 | <view class="pp" :class="allNow?'autoHeight':'onelineHeight'" v-html="form.introduction"></view> |
| 20 | <view class="formore" @click="changeIntroductionHeight" v-show="form.reserveDes?.length>20"> | 20 | <view class="formore" @click="changeIntroductionHeight" v-show="form.introduction?.length>20"> |
| 21 | <view v-show="!allNow">展开详情 <uni-icons type="bottom" color='#1EC886' size="12"></uni-icons></view> | 21 | <view v-show="!allNow">展开详情 <uni-icons type="bottom" color='#1EC886' size="12"></uni-icons></view> |
| 22 | <view v-show="allNow"> 收起 <uni-icons type="top" color='#1EC886' size="12"></uni-icons></view> | 22 | <view v-show="allNow"> 收起 <uni-icons type="top" color='#1EC886' size="12"></uni-icons></view> |
| 23 | 23 | ||
| ... | @@ -59,7 +59,7 @@ | ... | @@ -59,7 +59,7 @@ |
| 59 | </view> | 59 | </view> |
| 60 | </template> | 60 | </template> |
| 61 | </uni-list-item> | 61 | </uni-list-item> |
| 62 | <uni-list-item :border="true" title="在线客服" :clickable="true"> | 62 | <!-- <uni-list-item :border="true" title="在线客服" :clickable="true"> |
| 63 | <template v-slot:header> | 63 | <template v-slot:header> |
| 64 | <view class="slot-box"> | 64 | <view class="slot-box"> |
| 65 | <image class="slot-image" src="./img/qt04.png" mode="widthFix"></image> | 65 | <image class="slot-image" src="./img/qt04.png" mode="widthFix"></image> |
| ... | @@ -70,7 +70,7 @@ | ... | @@ -70,7 +70,7 @@ |
| 70 | <uni-icons type="forward" color="#bbb" size="16"></uni-icons> | 70 | <uni-icons type="forward" color="#bbb" size="16"></uni-icons> |
| 71 | </button> | 71 | </button> |
| 72 | </template> | 72 | </template> |
| 73 | </uni-list-item> | 73 | </uni-list-item> --> |
| 74 | 74 | ||
| 75 | </uni-list> | 75 | </uni-list> |
| 76 | </view> | 76 | </view> |
| ... | @@ -130,15 +130,15 @@ | ... | @@ -130,15 +130,15 @@ |
| 130 | }) | 130 | }) |
| 131 | onShow(option => { | 131 | onShow(option => { |
| 132 | if (app.globalData.isLogin) { | 132 | if (app.globalData.isLogin) { |
| 133 | getActivity() | 133 | getData() |
| 134 | } else { | 134 | } else { |
| 135 | app.firstLoadCallback = () => { | 135 | app.firstLoadCallback = () => { |
| 136 | getActivity() | 136 | getData() |
| 137 | }; | 137 | }; |
| 138 | } | 138 | } |
| 139 | }) | 139 | }) |
| 140 | onPullDownRefresh(() => { | 140 | onPullDownRefresh(() => { |
| 141 | getActivity() | 141 | getData() |
| 142 | }) | 142 | }) |
| 143 | let goPath | 143 | let goPath |
| 144 | let currUser | 144 | let currUser |
| ... | @@ -184,8 +184,8 @@ | ... | @@ -184,8 +184,8 @@ |
| 184 | } | 184 | } |
| 185 | } | 185 | } |
| 186 | 186 | ||
| 187 | function getActivity() { | 187 | function getData() { |
| 188 | hotel.getActivityDetail(id.value).then(res => { | 188 | hotel.getTrainDetail(id.value).then(res => { |
| 189 | form.value = res.data | 189 | form.value = res.data |
| 190 | app.globalData.carStart = res.data.carStart | 190 | app.globalData.carStart = res.data.carStart |
| 191 | app.globalData.carEnd = res.data.carEnd | 191 | app.globalData.carEnd = res.data.carEnd | ... | ... |
pages_hotel/hotel/img/归档.zip
0 → 100644
No preview for this file type
| 1 | <template> | 1 | <template> |
| 2 | <view class="pb50"> | 2 | <view class="pb50"> |
| 3 | <view style="padding:0 30rpx;"> | ||
| 3 | <uni-segmented-control :current="current" :values="items" @clickItem="onClickItem" styleType="button" activeColor="#15CFAB"></uni-segmented-control> | 4 | <uni-segmented-control :current="current" :values="items" @clickItem="onClickItem" styleType="button" activeColor="#15CFAB"></uni-segmented-control> |
| 4 | 5 | </view> | |
| 5 | <view class="active" v-for="(item, index) in list" :key="index" @click="goDetail(item)"> | 6 | <view> |
| 6 | <swiper class="activeSwiper" circular :autoplay="autoplay"> | 7 | <view class="active" v-for="(item, index) in showList" :key="index" @click="goDetail(item)"> |
| 7 | <swiper-item v-for="(pic,index) in item.photos?.split(',')" :key="index"> | 8 | <swiper class="activeSwiper" circular :autoplay="autoplay"> |
| 8 | <image class="cover" mode="aspectFill" :src="pic"></image> | 9 | <swiper-item v-for="(pic,index) in item.photos?.split(',')" :key="index"> |
| 9 | </swiper-item> | 10 | <image class="cover" mode="aspectFill" :src="pic"></image> |
| 10 | </swiper> | 11 | </swiper-item> |
| 11 | 12 | </swiper> | |
| 12 | <view class="name">{{item.name}}</view> | 13 | |
| 13 | <view class="pp" style="display: flex;">培训时间:{{item.hdStart.substring(0, 10)}} — {{item.hdEnd.substring(0, 10)}}</view> | 14 | <view class="name">{{item.name}}</view> |
| 14 | <view class="pp" style="display: flex;">报道时间:{{item.hdStart.substring(0, 10)}} — {{item.hdEnd.substring(0, 10)}}</view> | 15 | <view class="pp" style="display: flex;">培训时间:{{item.trainStart.substring(0, 10)}} — {{item.trainEnd.substring(0, 10)}}</view> |
| 15 | <view class="pp" style="display: flex;">主办单位:{{item.address}}</view> | 16 | <view class="pp" style="display: flex;">报道时间:{{item.reportDate.substring(0, 10)}}</view> |
| 16 | <view class="pp" style="display: flex;">承办单位:{{item.address}}</view> | 17 | <view class="pp" style="display: flex;">主办单位:{{item.organizer}}</view> |
| 17 | <view class="pp" style="display: flex;">培训地点:{{item.address}}</view> | 18 | <view class="pp" style="display: flex;">承办单位:{{item.address}}</view> |
| 18 | <button class="btn btn1">点击进入</button> | 19 | <view class="pp" style="display: flex;">培训地点:{{item.address}}</view> |
| 20 | <button class="btn btn1">点击进入</button> | ||
| 21 | </view> | ||
| 19 | </view> | 22 | </view> |
| 20 | </view> | 23 | </view> |
| 21 | <view class="nodata" v-if="list.length==0"> | 24 | <view class="nodata" v-if="showList.length==0"> |
| 22 | <image mode="aspectFit" src="/static/nodata.png"></image> | 25 | <image mode="aspectFit" src="/static/nodata.png"></image> |
| 23 | <text> 暂无活动</text> | 26 | <text> 暂无活动</text> |
| 24 | </view> | 27 | </view> |
| 25 | <!-- 我的 --> | ||
| 26 | <view class="myEnter" @click="goMycenter"><image src="./img/user.png" mode="aspectFill"></image></view> | ||
| 27 | </template> | 28 | </template> |
| 28 | 29 | ||
| 29 | <script setup> | 30 | <script setup> |
| ... | @@ -34,13 +35,16 @@ | ... | @@ -34,13 +35,16 @@ |
| 34 | const app = getApp(); | 35 | const app = getApp(); |
| 35 | const { proxy } = getCurrentInstance(); | 36 | const { proxy } = getCurrentInstance(); |
| 36 | const data = reactive({ | 37 | const data = reactive({ |
| 38 | showList: [], | ||
| 37 | list: [], | 39 | list: [], |
| 40 | list0: [], | ||
| 41 | list1: [], | ||
| 38 | query: {}, | 42 | query: {}, |
| 39 | autoplay:true, | 43 | autoplay:true, |
| 40 | items: ['全部', '进行中', '已过期'], | 44 | items: ['全部', '进行中', '已过期'], |
| 41 | current: 1 | 45 | current: 1 |
| 42 | }); | 46 | }); |
| 43 | const { list,query,autoplay,items,current } = toRefs(data); | 47 | const { showList,list,list0,list1,query,autoplay,items,current } = toRefs(data); |
| 44 | 48 | ||
| 45 | onShow(option =>{ | 49 | onShow(option =>{ |
| 46 | if (app.globalData.isLogin) { | 50 | if (app.globalData.isLogin) { |
| ... | @@ -55,18 +59,23 @@ | ... | @@ -55,18 +59,23 @@ |
| 55 | getList(); | 59 | getList(); |
| 56 | }); | 60 | }); |
| 57 | function getList(){ | 61 | function getList(){ |
| 58 | hotel.getTrainList(query.value).then(res => { | 62 | list0.value = [] |
| 59 | list.value = res.rows; | 63 | list1.value = [] |
| 64 | hotel.getTrainList().then(res => { | ||
| 65 | list.value = res.rows | ||
| 66 | for(var n of list.value){ | ||
| 67 | if(n.status == 0){ | ||
| 68 | list0.value.push(n) | ||
| 69 | } | ||
| 70 | if(n.status == 1){ | ||
| 71 | list1.value.push(n) | ||
| 72 | } | ||
| 73 | } | ||
| 74 | getShowList(current.value) | ||
| 60 | }); | 75 | }); |
| 61 | } | 76 | } |
| 62 | function goDetail(item){ | 77 | function goDetail(item){ |
| 63 | let path = `/pages_hotel/hotel/detail?id=${item.id}`; | 78 | let path = `/pages_hotel/hotel/detail?id=${item.trainId}`; |
| 64 | uni.navigateTo({ | ||
| 65 | url: path | ||
| 66 | }); | ||
| 67 | } | ||
| 68 | function goMycenter(){ | ||
| 69 | let path = `/pages_hotel/hotel/mycenter`; | ||
| 70 | uni.navigateTo({ | 79 | uni.navigateTo({ |
| 71 | url: path | 80 | url: path |
| 72 | }); | 81 | }); |
| ... | @@ -75,6 +84,20 @@ | ... | @@ -75,6 +84,20 @@ |
| 75 | if(current.value != e.currentIndex){ | 84 | if(current.value != e.currentIndex){ |
| 76 | current.value = e.currentIndex | 85 | current.value = e.currentIndex |
| 77 | } | 86 | } |
| 87 | getShowList(e.currentIndex) | ||
| 88 | } | ||
| 89 | function getShowList(n){ | ||
| 90 | switch (n){ | ||
| 91 | case 0: | ||
| 92 | showList.value = list.value | ||
| 93 | break; | ||
| 94 | case 1: | ||
| 95 | showList.value = list0.value | ||
| 96 | break; | ||
| 97 | case 2: | ||
| 98 | showList.value = list1.value | ||
| 99 | break; | ||
| 100 | } | ||
| 78 | } | 101 | } |
| 79 | </script> | 102 | </script> |
| 80 | 103 | ... | ... |
-
Please register or sign in to post a comment