diff --git a/package.json b/package.json
index 0a5ecc6..c3a3cc0 100644
--- a/package.json
+++ b/package.json
@@ -43,7 +43,8 @@
"eslintConfig": {
"root": true,
"globals": {
- "wx": true
+ "wx": true,
+ "wechatInstance": true
},
"env": {
"node": true
diff --git a/src/api/index.js b/src/api/index.js
index 73d5cc3..b1e386a 100644
--- a/src/api/index.js
+++ b/src/api/index.js
@@ -132,7 +132,7 @@ const getDynamicDetail = (dynamic_id = '') => service.get(`/api/dynamic/detail?i
const getCommonGoods = (temple_id = '', page, size = 10) => service.get(`/api/common/get-list?temple_id=${temple_id}&page=${page}&size=${size}`);
// 获取订单榜
-const getOrderCompare = (temple_id = '1', page = 1, type = '', goods_id = '', goods_type = '') => service.get(`/api/order/get-compare?temple_id=${temple_id}&page=${page}&type=${type}&goods_id=${goods_id}&goods_type=${goods_type}`);
+const getOrderCompare = (temple_id = '1', page = 1, type = '', goods_id = '', goods_type = '', size = 3) => service.get(`/api/order/get-compare?temple_id=${temple_id}&page=${page}&type=${type}&goods_id=${goods_id}&goods_type=${goods_type}&limit=${size}`);
// 根据agent_id获取订单榜
const getOrderCompareByAgentId = (agent_id = '1', type = '', goods_id = '', goods_type = '') => service.get(`/api/order/get-compare?agent_id=${agent_id}&type=${type}&goods_id=${goods_id}&goods_type=${goods_type}`);
diff --git a/src/common/wechat-web.js b/src/common/wechat-web.js
index c5f85ec..60fd3cb 100644
--- a/src/common/wechat-web.js
+++ b/src/common/wechat-web.js
@@ -79,11 +79,18 @@ function signToWechat(config, shareConfig) {
}
function getLocation() {
- return new Promise(resolve => {
+ return new Promise((resolve, reject) => {
wechatInstance.getLocation({
type: 'wgs84',
success: res => {
- resolve(res);
+ if(res.errMsg === 'getLocation:ok'){
+ resolve(res);
+ } else {
+ reject();
+ }
+ },
+ error: () => {
+ reject();
}
});
});
diff --git a/src/components/temple/index.vue b/src/components/temple/index.vue
index 8295079..f645fe6 100644
--- a/src/components/temple/index.vue
+++ b/src/components/temple/index.vue
@@ -3,8 +3,10 @@
{{data.unit_name}}
- {{data.visit}} 人到访
-
+
+ {{data.visit}} 人到访
+
+
@@ -17,9 +19,9 @@ export default {
type: Object,
default(){
return {
- picture: 'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg8.zol.com.cn%2Fbbs%2Fupload%2F24237%2F24236884.jpg&refer=http%3A%2F%2Fimg8.zol.com.cn&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1638518604&t=074af50479ac14ca13fc6616380fe0f5',
- unit_name: '重庆石林寺',
- visit: 100
+ picture: '',
+ unit_name: '',
+ visit: 0
}
}
}
@@ -27,6 +29,9 @@ export default {
methods: {
onTo(){
this.$router.push({ name: 'temple-home', query: { temple_id: this.data.id }})
+ },
+ onLocationTo(){
+ this.$emit('location-to', this.data)
}
}
}
@@ -44,26 +49,35 @@ export default {
img{
height: 4rem;
width: 100%;
+ vertical-align: top;
}
.info{
- display: flex;
- height: 1.07rem;
- align-items: center;
- padding: 0 .4rem;
+ padding: .4rem .4rem;
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
.name{
font-size: .37rem;
- flex: 1;
- }
- .visitor{
- font-size: .3rem;
- color: #666;
- margin-right: .4rem;
- }
- .iconfont{
- font-size: .4rem;
- padding: 0;
- color: rgb(60, 202, 60);
}
+
+ .location{
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ .visitor{
+ font-size: .3rem;
+ color: #666;
+ margin-right: .1rem;
+ vertical-align: middle;
+ }
+ .iconfont{
+ font-size: .4rem;
+
+ padding: 0;
+ color: rgb(60, 202, 60);
+ vertical-align: middle;
+ }
+ }
}
}
\ No newline at end of file
diff --git a/src/components/user-merit/index.vue b/src/components/user-merit/index.vue
index 4c54deb..48f5454 100644
--- a/src/components/user-merit/index.vue
+++ b/src/components/user-merit/index.vue
@@ -50,6 +50,7 @@ export default {
vertical-align: top;
display: inline-block;
margin-right: .4rem;
+ line-height: 1.3;
}
span:last-child {
font-size: 0.32rem;
diff --git a/src/pages/goods-light-detail/index.vue b/src/pages/goods-light-detail/index.vue
index 6680507..be87f1c 100644
--- a/src/pages/goods-light-detail/index.vue
+++ b/src/pages/goods-light-detail/index.vue
@@ -215,7 +215,7 @@ export default {
// 获取更多感恩功德1
loadMoreFn(){
this.page += 1;
- this.getPayRecords({id: this.listType}, this.page)
+ this.getPayRecords({id: this.listType}, this.page, 10)
},
onToFillMeritName(){
this.$router.push({
@@ -241,7 +241,7 @@ export default {
this.currentLightSize = this.currentLight.children[0].id
await this.getPayRecords({ id: 1}, 1);
this.$nextTick(() => {
- this.paddingBottom = this.$refs.fixedBottom.getOffsetHeight()
+ this.paddingBottom = this.$refs.fixedBottom.getOffsetHeight() - 50
})
this.wechatReady({
...this.data.shareConfig,
@@ -249,10 +249,10 @@ export default {
})
},
// 获取感恩功德
- async getPayRecords(lType, page){
+ async getPayRecords(lType, page, size = 3){
this.listType = lType.id;
this.page = page;
- const res = await getOrderCompare(this.query.temple_id, this.page, this.listType, '', this.query.goods_type );
+ const res = await getOrderCompare(this.query.temple_id, this.page, this.listType, '', this.query.goods_type, size );
if(this.page === 1){
this.payList = [];
}
diff --git a/src/pages/home.vue b/src/pages/home.vue
index d225b53..3cb61f1 100644
--- a/src/pages/home.vue
+++ b/src/pages/home.vue
@@ -162,6 +162,7 @@ export default {
this.data = res;
this.$store.commit('setTempleMeritId', res.temple_merit_id);
this.data.icon_data = this.sliceNav(res.icon_data);
+ console.log(123, this.data)
setTimeout(() => {
document.title = '自在福田';
}, 10)
diff --git a/src/pages/temple-home/index.vue b/src/pages/temple-home/index.vue
index 8cd4580..91bbad4 100644
--- a/src/pages/temple-home/index.vue
+++ b/src/pages/temple-home/index.vue
@@ -241,18 +241,9 @@ export default {
const res = await getTempleIndex(this.query.temple_id);
this.data = res;
this.data.icon_data = this.sliceNav(res.icon_data);
-
setTimeout(() => {
document.title = res.temple_data.unit_name;
}, 30)
-
- // this.wechatReady(wx => {
- // // const { title, desc, link, imageUrl } = res.shareConfig;
- // this.shareToWechat(wx, {
- // ...res.shareConfig,
- // link: location.href,
- // })
- // })
this.wechatReady({
...res.shareConfig,
link: location.href,
diff --git a/src/pages/temple-list/index.vue b/src/pages/temple-list/index.vue
index 6ccbcbb..9f4d798 100644
--- a/src/pages/temple-list/index.vue
+++ b/src/pages/temple-list/index.vue
@@ -8,7 +8,11 @@
-
+
+
+ 正在获取位置...
+
+
重新定位
@@ -23,9 +27,7 @@
-
+
-
+
@@ -50,7 +52,7 @@