1. 修改H5 代码

yj-dev
杨杰 3 years ago
parent e7481ee8d2
commit 037292eaf3
  1. 16
      App.vue
  2. 2
      manifest.json
  3. 15
      pages/tabBar/category/category.vue
  4. 42
      pages/tabBar/home/home.vue

@ -5,15 +5,15 @@
// brestUrl: 'http://192.168.3.4:9302/brest', // brestUrl: 'http://192.168.3.4:9302/brest',
// imgUrl: 'https://192.168.3.4:9301/filesystem/', // imgUrl: 'https://192.168.3.4:9301/filesystem/',
// //
url: 'https://hsg.dctpay.com/crest', // url: 'https://hsg.dctpay.com/crest',
imgUrl: 'https://hsg.dctpay.com/filesystem/', // imgUrl: 'https://hsg.dctpay.com/filesystem/',
brestUrl : 'https://hsg.dctpay.com/brest', // brestUrl : 'https://hsg.dctpay.com/brest',
imageWxImg:'https://hsg.dctpay.com/filesystem/wxApplets/', // imageWxImg:'https://hsg.dctpay.com/filesystem/wxApplets/',
// //
// url: 'https://hsgcs.dctpay.com/crest', url: 'https://hsgcs.dctpay.com/crest',
// brestUrl : 'https://hsgcs.dctpay.com/brest', brestUrl : 'https://hsgcs.dctpay.com/brest',
// imgUrl: 'https://hsgcs.dctpay.com/filesystem/', imgUrl: 'https://hsgcs.dctpay.com/filesystem/',
// imageWxImg:'https://hsgcs.dctpay.com/filesystem/wxApplets/', imageWxImg:'https://hsgcs.dctpay.com/filesystem/wxApplets/',
userInfo: "", userInfo: "",
brestUserInfo : '', brestUserInfo : '',
openId: '', openId: '',

@ -83,7 +83,7 @@
"title" : "嗨加油", "title" : "嗨加油",
"router" : { "router" : {
"mode" : "hash", "mode" : "hash",
"base" : "/H5" "base" : "/hsg-h5"
}, },
"devServer" : { "devServer" : {
"port" : "", "port" : "",

@ -61,9 +61,12 @@
</view> </view>
</view> </view>
</wybPopup> --> </wybPopup> -->
<button open-type="contact"> <!-- #ifdef H5 -->
<image :src="imagewxUrl+imgadres5" mode="widthFix" class="H5xfimg"></image>
<!-- #endif -->
<!-- #ifdef MP-->
<image :src="imagewxUrl+imgadres5" mode="widthFix" class="xfimg"></image> <image :src="imagewxUrl+imgadres5" mode="widthFix" class="xfimg"></image>
</button> <!-- #endif -->
</view> </view>
</template> </template>
<script> <script>
@ -273,6 +276,13 @@
background-color: #f1f3f5; background-color: #f1f3f5;
} }
.H5xfimg {
width: 80rpx;
bottom: 140rpx;
position: fixed;
right: 40rpx;
}
.xfimg { .xfimg {
width: 80rpx; width: 80rpx;
bottom: 60rpx; bottom: 60rpx;
@ -339,6 +349,7 @@
margin-top: 10px; margin-top: 10px;
color: #333333; color: #333333;
} }
.stuimg { .stuimg {
width: 10px; width: 10px;
vertical-align: middle; vertical-align: middle;

@ -86,7 +86,12 @@
<image class="popImg" :src="imageUrl+imgadres3" @click="jumpWeb"></image> <image class="popImg" :src="imageUrl+imgadres3" @click="jumpWeb"></image>
</wybPopup> </wybPopup>
<button open-type="contact"> <button open-type="contact">
<!-- #ifdef H5 -->
<image :src="imagewxUrl+imgadres4" mode="widthFix" class="H5xfimg"></image>
<!-- #endif -->
<!-- #ifdef MP-->
<image :src="imagewxUrl+imgadres4" mode="widthFix" class="xfimg"></image> <image :src="imagewxUrl+imgadres4" mode="widthFix" class="xfimg"></image>
<!-- #endif -->
</button> </button>
<view class="height40"></view> <view class="height40"></view>
<!-- <official-account bindload="bindload" binderror="binderror"></official-account> --> <!-- <official-account bindload="bindload" binderror="binderror"></official-account> -->
@ -349,6 +354,9 @@
app.globalData.latitude = res.latitude; app.globalData.latitude = res.latitude;
app.globalData.longitude = res.longitude; app.globalData.longitude = res.longitude;
// that.findByLatAndLng(res.longitude, res.latitude); // that.findByLatAndLng(res.longitude, res.latitude);
// #ifdef H5
that.getUserLocation(res.longitude, res.latitude);
//#endif
// #ifdef MP // #ifdef MP
uni.request({ uni.request({
url: 'https://apis.map.qq.com/ws/geocoder/v1/?location=' + res.latitude + url: 'https://apis.map.qq.com/ws/geocoder/v1/?location=' + res.latitude +
@ -464,9 +472,9 @@
} }
}); });
}, },
// //H5
getUserLocation(long, lat) { getUserLocation(long, lat) {
let vm = this; let that = this;
let url = let url =
'https://apis.map.qq.com/ws/geocoder/v1?coord_type=5&get_poi=1&output=jsonp&poi_options=page_size=1;page_index=1'; 'https://apis.map.qq.com/ws/geocoder/v1?coord_type=5&get_poi=1&output=jsonp&poi_options=page_size=1;page_index=1';
let locationObj = lat + ',' + long; let locationObj = lat + ',' + long;
@ -475,12 +483,25 @@
location: locationObj location: locationObj
}) })
.then(res => { .then(res => {
vm.city = res.result.address_component.city.replace(/市/g, ''); // vm.city = res.result.address_component.city.replace(//g, '');
app.globalData.cityName = res.result.address_component.city.replace(/市/g, ''); // app.globalData.cityName = res.result.address_component.city.replace(//g, '');
// app.globalData.cityId = res.result.ad_info.adcode;
// vm.getCouponListArea();
// vm.getCouponListgold();
// uni.hideLoading()
uni.hideLoading();
that.city = res.result.address_component.city;
app.globalData.cityName = res.result.address_component
.city;
app.globalData.cityId = res.result.ad_info.adcode; app.globalData.cityId = res.result.ad_info.adcode;
vm.getCouponListArea(); // app.globalData.cityId = '500100';
vm.getCouponListgold(); that.getCouponListArea();
uni.hideLoading() that.getCouponListgold();
that.getCmsContent();
that.getCmsAactibity();
that.getCmsContentcmshome();
that.getCmsContentcmsContent();
}) })
.catch(err => { .catch(err => {
uni.hideLoading() uni.hideLoading()
@ -740,6 +761,13 @@
height: 440px; height: 440px;
} }
.H5xfimg{
width: 80rpx;
bottom: 140rpx;
position: fixed;
right: 40rpx;
}
.xfimg { .xfimg {
width: 80rpx; width: 80rpx;
bottom: 60rpx; bottom: 60rpx;

Loading…
Cancel
Save