1. 修改H5 代码

yj-dev
杨杰 3 years ago
parent e7481ee8d2
commit 037292eaf3
  1. 16
      App.vue
  2. 2
      manifest.json
  3. 35
      pages/tabBar/category/category.vue
  4. 48
      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" : "",

@ -60,10 +60,13 @@
{{item.merchantName}} {{item.merchantName}}
</view> </view>
</view> </view>
</wybPopup> --> </wybPopup> -->
<button open-type="contact"> <!-- #ifdef H5 -->
<image :src="imagewxUrl+imgadres5" mode="widthFix" class="xfimg"></image> <image :src="imagewxUrl+imgadres5" mode="widthFix" class="H5xfimg"></image>
</button> <!-- #endif -->
<!-- #ifdef MP-->
<image :src="imagewxUrl+imgadres5" mode="widthFix" class="xfimg"></image>
<!-- #endif -->
</view> </view>
</template> </template>
<script> <script>
@ -81,7 +84,7 @@
data() { data() {
return { return {
showCategoryIndex: '', showCategoryIndex: '',
showCategoryIndexId: '', showCategoryIndexId: '',
headerPosition: "fixed", headerPosition: "fixed",
imagewxUrl: app.globalData.imageWxImg, imagewxUrl: app.globalData.imageWxImg,
imgadres: 'jt.png', imgadres: 'jt.png',
@ -98,7 +101,7 @@
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
isNoMoreData: false isNoMoreData: false
// loadingText: '' // loadingText: ''
} }
}, },
onPageScroll(e) { onPageScroll(e) {
@ -185,7 +188,7 @@
} }
getMerchantList(params).then(res => { getMerchantList(params).then(res => {
if (res.return_code == '000000' && res.return_data != '') { if (res.return_code == '000000' && res.return_data != '') {
this.MerchantList = res.return_data; this.MerchantList = res.return_data;
this.showCategoryIndex = res.return_data[0].merchantName; this.showCategoryIndex = res.return_data[0].merchantName;
this.showCategoryIndexId = res.return_data[0].id; this.showCategoryIndexId = res.return_data[0].id;
this.getStoreListByMerchant(); this.getStoreListByMerchant();
@ -241,7 +244,7 @@
}, },
// //
showCategory(e) { showCategory(e) {
this.showCategoryIndex = this.MerchantList[e.target.value].merchantName; this.showCategoryIndex = this.MerchantList[e.target.value].merchantName;
this.showCategoryIndexId = this.MerchantList[e.target.value].id; this.showCategoryIndexId = this.MerchantList[e.target.value].id;
this.pageNum = 1; this.pageNum = 1;
@ -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;
@ -338,10 +348,11 @@
font-size: 14px; font-size: 14px;
margin-top: 10px; margin-top: 10px;
color: #333333; color: #333333;
} }
.stuimg {
width: 10px; .stuimg {
vertical-align: middle; width: 10px;
vertical-align: middle;
} }
.loading-text { .loading-text {

@ -85,8 +85,13 @@
<wybPopup ref="popup" type="center" height="850" width="600" bgColor="" radius="6" :showCloseIcon="true"> <wybPopup ref="popup" type="center" height="850" width="600" bgColor="" radius="6" :showCloseIcon="true">
<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">
<image :src="imagewxUrl+imgadres4" mode="widthFix" class="xfimg"></image> <!-- #ifdef H5 -->
<image :src="imagewxUrl+imgadres4" mode="widthFix" class="H5xfimg"></image>
<!-- #endif -->
<!-- #ifdef MP-->
<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; // app.globalData.cityId = res.result.ad_info.adcode;
vm.getCouponListArea(); // vm.getCouponListArea();
vm.getCouponListgold(); // vm.getCouponListgold();
uni.hideLoading() // 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 = '500100';
that.getCouponListArea();
that.getCouponListgold();
that.getCmsContent();
that.getCmsAactibity();
that.getCmsContentcmshome();
that.getCmsContentcmsContent();
}) })
.catch(err => { .catch(err => {
uni.hideLoading() uni.hideLoading()
@ -738,6 +759,13 @@
.popImg { .popImg {
width: 300px; width: 300px;
height: 440px; height: 440px;
}
.H5xfimg{
width: 80rpx;
bottom: 140rpx;
position: fixed;
right: 40rpx;
} }
.xfimg { .xfimg {

Loading…
Cancel
Save