diff --git a/App.vue b/App.vue
index 36c1cff..7c86708 100644
--- a/App.vue
+++ b/App.vue
@@ -1,7 +1,30 @@
+
+
diff --git a/pages/detail/detail.vue b/pages/detail/detail.vue
index 0bfab77..1614240 100644
--- a/pages/detail/detail.vue
+++ b/pages/detail/detail.vue
@@ -1,6 +1,6 @@
-
+
@@ -14,11 +14,42 @@ export default {
uni.navigateTo({
url: '/pages/answer/answer'
})
+ },
+
+ async getDetail (id) {
+ const res = await this.$u.api.baseFormShow({
+ table_name: 'map_points',
+ 'with_relations[0]': 'image',
+ 'with_relations[1]': 'video',
+ id
+ })
+
+ return res
+ },
+ async getVrs (id) {
+ const res = await this.$u.api.baseFormIndex({
+ table_name: 'map_point_contents',
+ 'with_relations[0]': 'image',
+ 'with_relations[1]': 'video',
+ 'filter[0][key]': 'map_point_id',
+ 'filter[0][op]': 'eq',
+ 'filter[0][value]': id
+ })
+
+ return res
}
},
- onLoad() {
+ onLoad(option) {
window.toAnswer = this.toAnswer
- }
+
+ this.$nextTick(() => {
+ this.$refs['iframe'].onload = async () => {
+ let detail = await this.getDetail(option.id)
+ let vrs = await this.getVrs(option.id)
+ this.$refs['iframe'].contentWindow.setDomData({ detail , vrs })
+ }
+ })
+ },
}
diff --git a/pages/map/map.vue b/pages/map/map.vue
index a06109a..c19fd79 100644
--- a/pages/map/map.vue
+++ b/pages/map/map.vue
@@ -13,9 +13,9 @@
v-for="(item, index) in pointers"
:key="index"
:style="{ 'transform': `translate(calc(${area.w * item.x / 100}px - 50%),calc(${area.h * item.y / 100}px - 50%))` }"
- @click="$u.throttle(toDetail)">
+ @click="$u.throttle(() => toDetail(index))">
-

+
@@ -23,7 +23,7 @@
:style="{
'transform': translateText(item.d)
}">
- 苏州革命博物馆
+ {{ item.name }}
@@ -100,15 +100,41 @@ export default {
};
},
methods: {
- toDetail () {
+ toDetail (id) {
uni.navigateTo({
- url: '/pages/detail/detail'
+ url: `/pages/detail/detail?id=${id}`
})
},
load () {
this.area.w = this.$refs['image'].getBoundingClientRect().width
this.area.h = this.$refs['image'].getBoundingClientRect().height
+ },
+
+ async getPoints () {
+ function convertToEquivalentAngle(angle) {
+ if (angle > 180) {
+ return angle - 360;
+ } else if (angle < -180) {
+ return angle + 360;
+ } else {
+ return angle;
+ }
+ }
+ this.pointers = []
+ const res = await this.$u.api.baseFormIndex({
+ table_name: 'map_points',
+ with_relations: ['image']
+ })
+ this.pointers = res.data.map((i, index) => {
+ return {
+ name: i.name,
+ x: typeof i.x === 'string' ? Number(i.x) : 0,
+ y: typeof i.y === 'string' ? Number(i.y) : 0,
+ d: convertToEquivalentAngle(30 * index + 1),
+ image: i.image
+ }
+ })
}
},
@@ -130,6 +156,9 @@ export default {
},
mounted() {
+ },
+ onShow() {
+ this.getPoints()
}
}
diff --git a/static/certificate-bkg.png b/static/certificate-bkg.png
new file mode 100644
index 0000000..706e3b7
Binary files /dev/null and b/static/certificate-bkg.png differ
diff --git a/static/certificate-word.png b/static/certificate-word.png
new file mode 100644
index 0000000..a1577ac
Binary files /dev/null and b/static/certificate-word.png differ
diff --git a/static/html/explanation.html b/static/html/explanation.html
index 85ae6c4..a102272 100644
--- a/static/html/explanation.html
+++ b/static/html/explanation.html
@@ -241,7 +241,7 @@
timer = setInterval(function() {
index = ($(".swiper-btn li.on").index() + 1) % length;
console.log(index);
- $('..swiper-btn li').eq(index).stop().addClass('on');
+ $('.swiper-btn li').eq(index).stop().addClass('on');
$('.swiper-btn li').eq(index).siblings('li').stop().removeClass('on');
$('.swiper-list[data-num=' + index + ']').stop().fadeIn().siblings(".swiper-list").stop().hide();
if(index == 0){
@@ -304,6 +304,10 @@
});
+ function setDomData (obj) {
+ let { detail, vrs } = obj;
+ console.log($('.newstext').children('p')[1].innerHTML = obj.a)
+ }