XiangQing.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. <template>
  2. <view class="box">
  3. <u-navbar :autoBack="true" bgColor="rgba(255,255,255,0)" :placeholder="true"></u-navbar>
  4. <!-- 日历 -->
  5. <view class="aaa">
  6. <!-- <uv-calendars readonly="true" :selected="selected" @monthSwitch="monthSwitch" mode="multiple" insert="false" lunar="true" /> -->
  7. <uv-calendars readonly="true" :insert="true" mode="range" lunar="true" :date="date" />
  8. </view>
  9. <view class="map_tit" style="margin-left: 90rpx">
  10. <image style="width: 211rpx; height: 52rpx" src="/static/img/right_img.png"></image>
  11. <view class="">路线明细</view>
  12. <image style="width: 211rpx; height: 52rpx" src="/static/img/left_img.png"></image>
  13. </view>
  14. <view class="ban_box">
  15. <view style="display: flex; justify-content: space-around; margin-top: 100rpx">
  16. <!-- <view class="lx_tn"></view> -->
  17. <view class="time_box">
  18. <view class="">开始时间:{{ list.start_time }}</view>
  19. <view class="">结束时间:{{ list.end_time }}</view>
  20. <!-- <view class="">活动名额:35人</view> -->
  21. </view>
  22. </view>
  23. <!-- 路线 -->
  24. <view class="lx_tit">
  25. <text style="color: #000000">路线:</text>
  26. <text v-for="(item, index) in content_list" :key="item.id">{{ item.title }}{{ index < content_list.length - 1 ? ' →' : '' }}</text>
  27. </view>
  28. <!-- 地图 -->
  29. <view style="height: 560rpx; overflow: hidden">
  30. <mapComponent :height="height" :markers="markers" :latitudeAndLongitude="latitudeAndLongitude"></mapComponent>
  31. </view>
  32. <!-- <view style="font-size: 28rpx; margin-top: 20rpx">福建省厦门市思明区寿山路与思明南路交叉正北方向12米</view> -->
  33. <view style="font-size: 28rpx; margin-top: 20rpx">活动描述:{{ list.desc }}</view>
  34. <view @click="signUp" class="ewm_box">立即报名</view>
  35. </view>
  36. </view>
  37. </template>
  38. <script>
  39. let that;
  40. export default {
  41. data() {
  42. return {
  43. date: ['', ''],
  44. list: {},
  45. content_list: [],
  46. latitudeAndLongitude: {
  47. latitude: '24.503559',
  48. longitude: '118.13093'
  49. },
  50. // 绑定上dateList即可需
  51. dateList: [],
  52. selected: [],
  53. markers: [],
  54. height: '600'
  55. };
  56. },
  57. created() {
  58. // this.updateDateListForCurrentMonth();
  59. // this.dimension();
  60. },
  61. onLoad(o) {
  62. that = this;
  63. this.activityDetails(o.id);
  64. },
  65. methods: {
  66. activityDetails(id) {
  67. this.$api.activityDetails({ main_body_id: 1, id: id }, function (res) {
  68. if (res.code == 1) {
  69. // console.log(res, '研学详情');
  70. that.list = res.data;
  71. that.content_list = Object.values(that.list.content_list);
  72. if (that.content_list.length > 0) {
  73. that.markers = [];
  74. that.latitudeAndLongitude.latitude = that.content_list[0].latitude;
  75. that.latitudeAndLongitude.longitude = that.content_list[0].longitude;
  76. that.content_list.forEach((item, index) => {
  77. that.markers.push({
  78. id: parseFloat(item.id),
  79. latitude: parseFloat(item.latitude), //纬度
  80. longitude: parseFloat(item.longitude), //经度
  81. iconPath: item.thumbnail, //显示的图标
  82. width: 30, //宽
  83. height: 30, //高
  84. title: item.title, //标注点名
  85. label: {
  86. //自定义标记点上方的文本
  87. content: item.title, //文本
  88. color: '#444444', //文字颜色
  89. fontSize: 14, //文本大小
  90. bgColor: '#f1cdb2', // 背景颜色(半透明黑色)
  91. borderRadius: 5, // 边框圆角
  92. padding: [2, 2], // 内边距
  93. textAlign: 'center', // 文本对齐方式
  94. display: 'ALWAYS' // 始终显示标签
  95. },
  96. joinCluster: true
  97. });
  98. });
  99. }
  100. // console.log(that.markers, '地图');
  101. that.date = [];
  102. that.date.push(res.data.start_time.split(' ')[0]);
  103. that.date.push(res.data.end_time.split(' ')[0]);
  104. // console.log(that.date, '日历时间');
  105. }
  106. });
  107. },
  108. signUp() {
  109. if (this.list.status == 1) {
  110. uni.navigateTo({
  111. url: '/index_fenbao/HuoHuaLiYong/YanXue/baoMing?id=' + this.list.id
  112. });
  113. } else if (this.list.status == 2) {
  114. this.$common.errorToShow('当前活动' + this.list.status_text);
  115. } else if (this.list.status == 4) {
  116. this.$common.errorToShow('当前活动' + this.list.status_text);
  117. }
  118. }
  119. // updateDateListForCurrentMonth() {
  120. // const currentDate = new Date();
  121. // this.getSaturdaysOfMonth(currentDate.getFullYear(), currentDate.getMonth() + 1); // 月份是从 0 开始计数的
  122. // },
  123. // getSaturdaysOfMonth(year, month) {
  124. // const daysInMonth = new Date(year, month - 1, 0).getDate();
  125. // this.dateList = [];
  126. // for (let day = 1; day <= daysInMonth; day++) {
  127. // const date = new Date(year, month - 1, day);
  128. // if (date.getDay() === 0) {
  129. // this.dateList.push(date.toISOString().substring(0, 10));
  130. // }
  131. // }
  132. // console.log(this.dateList);
  133. // },
  134. // monthSwitch({ year, month }) {
  135. // this.getSaturdaysOfMonth(year, month);
  136. // this.dimension();
  137. // },
  138. // 周六标注点
  139. // dimension() {
  140. // let a = [];
  141. // this.dateList.forEach((item) => {
  142. // a.push({ date: item, info: '活动' });
  143. // });
  144. // this.selected = a;
  145. // console.log(this.selected);
  146. // }
  147. }
  148. };
  149. </script>
  150. <style>
  151. .box {
  152. width: 100%;
  153. padding-bottom: 50rpx;
  154. background-image: url('https://huli-app.wenlvti.net/app_static/WenWuGuanJia/image/xbg_2.png');
  155. background-size: 100% 100%;
  156. background-attachment: fixed;
  157. background-repeat: repeat-y;
  158. min-height: 100%;
  159. height: auto;
  160. }
  161. /deep/.uv-calendar__content.data-v-0d8ea832 {
  162. background-color: #fff9e9 !important;
  163. }
  164. .uv-calendar__content.data-v-513749fa {
  165. background-color: #fff9e9 !important;
  166. }
  167. .uv-calendar__backtoday.data-v-173dfca3 {
  168. display: none !important;
  169. }
  170. .uv-calendar__backtoday.data-v-5b1004fa {
  171. display: none !important;
  172. }
  173. .uv-calendar-item__weeks-box-item.data-v-101dc4d8 {
  174. height: 90rpx !important;
  175. }
  176. .uv-calendar-item__weeks-box-item.data-v-6a001a42 {
  177. height: 90rpx !important;
  178. }
  179. .map_tit {
  180. display: flex;
  181. align-items: center;
  182. margin-left: 60rpx;
  183. margin-top: 40rpx;
  184. font-size: 40rpx;
  185. font-family: Songti SC, Songti SC;
  186. font-weight: 900;
  187. line-height: 52rpx;
  188. color: #444444;
  189. }
  190. .ban_box {
  191. width: 692rpx;
  192. margin: auto;
  193. margin-top: 20rpx;
  194. padding: 40rpx 40rpx 130rpx 40rpx;
  195. background-image: url('https://huli-app.wenlvti.net/app_static/WenWuGuanJia/image/lx_bg.png');
  196. background-size: 100% 100%;
  197. }
  198. .lx_tn {
  199. width: 163rpx;
  200. height: 150rpx;
  201. background-image: url('/static/img/lx_ta.png');
  202. background-size: 100% 100%;
  203. }
  204. .lx_tit {
  205. color: #894514;
  206. margin: 20rpx 0 20rpx 10rpx;
  207. font-size: 30rpx;
  208. font-weight: 700;
  209. }
  210. .rili {
  211. width: 670rpx;
  212. height: 1054rpx;
  213. margin: auto;
  214. }
  215. .img {
  216. width: 100%;
  217. height: 100%;
  218. }
  219. .xwgg {
  220. width: 170rpx;
  221. height: 89rpx;
  222. margin: auto;
  223. margin-top: 70rpx;
  224. font-size: 32rpx;
  225. font-weight: 900;
  226. text-align: center;
  227. line-height: 89rpx;
  228. letter-spacing: 1px;
  229. color: #feece3;
  230. background-image: url('/static/img/title2.png');
  231. background-size: 100% 100%;
  232. }
  233. .time_box {
  234. height: 96rpx;
  235. font-size: 32rpx;
  236. font-weight: 400;
  237. color: #894514;
  238. line-height: 48rpx;
  239. }
  240. .map_box {
  241. width: 670rpx;
  242. height: 670rpx;
  243. margin: auto;
  244. margin-top: 40rpx;
  245. overflow: hidden;
  246. background: #fcfdfd;
  247. border-radius: 0rpx 0rpx 0rpx 0rpx;
  248. opacity: 1;
  249. }
  250. .ewm_box {
  251. height: 80rpx;
  252. background-color: #efb781;
  253. border-radius: 35rpx;
  254. font-size: 32rpx;
  255. text-align: center;
  256. line-height: 80rpx;
  257. margin: 20rpx 32rpx 0 32rpx;
  258. }
  259. </style>