Browse Source

Merge branch 'feature/medou/mini-v1.1.0' of http://gogs.1hhd.com/1hjz-3N/1hjz-mini into feature/medou/mini-v1.1.0

* 'feature/medou/mini-v1.1.0' of http://gogs.1hhd.com/1hjz-3N/1hjz-mini:
  ..

# Conflicts:
#	pages/at_present/at_present.js
feature/v1.1.0
lfs3 7 years ago
parent
commit
fd358edf8a
10 changed files with 16 additions and 134 deletions
  1. 3
      pages/activity_detail/activity_detail.js
  2. 43
      pages/at_present/at_present.js
  3. 8
      pages/city/city.js
  4. 2
      pages/city/city.wxml
  5. 6
      pages/district/district.js
  6. 41
      pages/index/index.js
  7. 2
      pages/index/index.wxml
  8. 5
      pages/index/index.wxss
  9. 39
      pages/loding/loding.js
  10. 1
      pages/order/order.wxml

3
pages/activity_detail/activity_detail.js

@ -46,7 +46,6 @@ Page({
}], }],
qrImageUrl: "", qrImageUrl: "",
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
@ -61,7 +60,7 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
//获取活动详情
//获取活动详情
this.getActivityDetail(); this.getActivityDetail();
}, },

43
pages/at_present/at_present.js

@ -23,35 +23,21 @@ Page({
onLoad: function(options) { onLoad: function(options) {
// let that = this;  // let that = this; 
qqmapsdk = new QQMapWX({ qqmapsdk = new QQMapWX({
<<<<<<< HEAD
// key: 'C5KBZ-RISKD-INW4P-PWYQJ-QC6C7-BQBGC'//测试 // key: 'C5KBZ-RISKD-INW4P-PWYQJ-QC6C7-BQBGC'//测试
key: 'JN7BZ-MJBK5-52SIH-QOKGH-FJE5F-IWFGG'//正式 key: 'JN7BZ-MJBK5-52SIH-QOKGH-FJE5F-IWFGG'//正式
=======
key: 'C5KBZ-RISKD-INW4P-PWYQJ-QC6C7-BQBGC'
//正式的上线 key: 'JN7BZ-MJBK5-52SIH-QOKGH-FJE5F-IWFGG'
>>>>>>> 9ce9c0372f32b633e4de2d07306aae87a8c62664
}); });
}, },
//  onShow: function () {
//   var that = this;
//   // 腾讯地图调用接口
//   qqmapsdk.search({
//    success: function (res) {
//    
//    },
//    fail: function (res) {
//     console.log(res);
//    },
//    complete: function (res) {
//     console.log(res);
//    }
//   })
//  },
onReady: function() { onReady: function() {
var that = this; var that = this;
wx.getLocation({ wx.getLocation({
type: 'wgs84', type: 'wgs84',
success: function(res) { success: function(res) {
qqmapsdk.reverseGeocoder({ qqmapsdk.reverseGeocoder({
// qqmapsdk.search({
success: function(res) { success: function(res) {
let district = res.result.address_component.district; let district = res.result.address_component.district;
let city = res.result.address_component.city; let city = res.result.address_component.city;
@ -71,7 +57,6 @@ Page({
}, },
success: function(res) { success: function(res) {
// 打印对应想得到的数据 // 打印对应想得到的数据
console.log(res)
var cityId = res.data.response[0].cityId; var cityId = res.data.response[0].cityId;
var cityName = res.data.response[0].cityName; var cityName = res.data.response[0].cityName;
var districtId = res.data.response[0].districtId; var districtId = res.data.response[0].districtId;
@ -125,24 +110,6 @@ Page({
}, },
groupTaps: function(e) { groupTaps: function(e) {
var that = this; var that = this;
//获取本地数据
// wx.getStorage({
// key: 'merchantNo',
// success: function (res) {
// if (res.data ==''){
// console.log(1111);
// }else{
// console.log(888);
// }
// // console.log(1111);
// // console.log(res.data);
// // that.setData({ merchantNo: res.data });
// // console.log(2222);
// // showOrhide:false;
// }
// });
wx.switchTab({ wx.switchTab({
url: '../index/index' url: '../index/index'
}) })

8
pages/city/city.js

@ -21,12 +21,6 @@ Page({
}) })
} }
}); });
// console.log(2)
// console.log(options.titles)
// console.log(1)
// this.setData({
// titles: options.titles
// });
var that = this var that = this
wx.request({ wx.request({
url: app.gw.hostUrl + '/mall/wxa/index/opencitylist', url: app.gw.hostUrl + '/mall/wxa/index/opencitylist',
@ -36,9 +30,7 @@ Page({
'Content-Type': 'application/x-www-form-urlencoded' 'Content-Type': 'application/x-www-form-urlencoded'
}, },
success: function (res) { success: function (res) {
console.log(res.data)
var citys = res.data; var citys = res.data;
console.log(citys);
that.setData({ that.setData({
citys citys
}); });

2
pages/city/city.wxml

@ -1,5 +1,5 @@
<view class="top"> <view class="top">
<text class="top_area">定位区域</text><text class="top_site"> {{cityName}}{{districtName}}</text>
<text class="top_area">已选区域</text><text class="top_site"> {{cityName}}{{districtName}}</text>
</view> </view>
<view class="top_hint">已开通城市</view> <view class="top_hint">已开通城市</view>
<view wx:for="{{citys.response}}" wx:for-item="citys"> <view wx:for="{{citys.response}}" wx:for-item="citys">

6
pages/district/district.js

@ -9,12 +9,11 @@ Page({
let that = this; let that = this;
// wx.getStorage({ // wx.getStorage({
// key: 'merchantNo', // key: 'merchantNo',
// success: function (res) { // success: function (res) {
// that.setData({ // that.setData({
// merchantNo: res.data // merchantNo: res.data
// }) // })
// console.log(222);
// } // }
// }); // });
wx.getStorage({ wx.getStorage({
@ -26,8 +25,6 @@ Page({
} }
}); });
cityId = options.cityId; cityId = options.cityId;
console.log(cityId);
wx.request({ wx.request({
url: app.gw.hostUrl + '/mall/wxa/index/opendistictlist', url: app.gw.hostUrl + '/mall/wxa/index/opendistictlist',
method: 'get', method: 'get',
@ -39,7 +36,6 @@ Page({
}, },
success: function (res) { success: function (res) {
var districts = res.data; var districts = res.data;
console.log(districts)
that.setData({ that.setData({
districts districts
}); });

41
pages/index/index.js

@ -11,7 +11,9 @@ Page({
interval: 5000, interval: 5000,
duration: 1000, duration: 1000,
imgUrls: [], imgUrls: [],
// merchantNo: '',
// bannerImage: '/images/activity_banner.png', // bannerImage: '/images/activity_banner.png',
menu_list: [ menu_list: [
{ name: '拼团', disabled: false, className: 'green_button' }, { name: '拼团', disabled: false, className: 'green_button' },
{ name: '秒杀', disabled: true, className: 'gray_button' }, { name: '秒杀', disabled: true, className: 'gray_button' },
@ -24,10 +26,6 @@ Page({
pageSize: 20, pageSize: 20,
hasMoreData: true, hasMoreData: true,
img1: '/images/u40.png', img1: '/images/u40.png',
// cityId: 440100000,
// typeNum: 10,
// addrArray: { id: [440100000, 430426000], name: ['长沙', '深圳', '上海', '长沙', '武汉', '杭州', '北京'] },
addrIndex: 0, addrIndex: 0,
districtName: '', districtName: '',
}, },
@ -62,10 +60,11 @@ Page({
wx.getStorage({ wx.getStorage({
key: 'merchantNo', key: 'merchantNo',
success: function (res) { success: function (res) {
// that.setData({
that.setData({
merchantNo: res.data
}),
that.getActivityList(res.data);
merchantNo = res.data merchantNo = res.data
// })
console.log("merchantNo:" +merchantNo);
that.getActivityList(); that.getActivityList();
wx.request({ wx.request({
url: app.gw.hostUrl + '/mall/wxa/activity/banner', url: app.gw.hostUrl + '/mall/wxa/activity/banner',
@ -82,7 +81,6 @@ Page({
if (status == 0) { if (status == 0) {
var data = res.data; var data = res.data;
var status = data.code; var status = data.code;
// console.log(res);
that.setData({ that.setData({
imgUrls: data.response imgUrls: data.response
}) })
@ -116,8 +114,7 @@ Page({
url: app.gw.hostUrl + '/mall/wxa/activity/list', url: app.gw.hostUrl + '/mall/wxa/activity/list',
method: 'get', method: 'get',
data: { data: {
merchantNo: merchantNo,
// selectedCityId: that.data.addrArray.id[that.data.addrIndex] == undefined ? 0 : that.data.addrArray.id[that.data.addrIndex],
merchantNo:merchantNo,
pageNum: that.data.pageNum, pageNum: that.data.pageNum,
pageSize: that.data.pageSize pageSize: that.data.pageSize
}, },
@ -191,29 +188,6 @@ Page({
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
// onShow: function () {
// let that = this;
// //获取本地数据
// // 获取地址
// wx.getStorage({
// key: 'districtName',
// success: function (res) {
// // console.log(res.data)
// that.setData({
// districtName: res.data
// })
// }
// });
// // 商家编号
// wx.getStorage({
// key: 'merchantNo',
// success: function (res) {
// that.setData({
// merchantNo: res.data
// })
// }
// });
// },
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
@ -233,6 +207,7 @@ Page({
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh: function () { onPullDownRefresh: function () {
let that = this;
this.data.pageNum = 1; this.data.pageNum = 1;
this.getActivityList(); this.getActivityList();
}, },

2
pages/index/index.wxml

@ -3,8 +3,6 @@
<view class='header'> <view class='header'>
<view class='top-left'> <view class='top-left'>
<navigator url="../city/city" class="address"><image src='{{img1}}' mode='widthFix' class="imgs"></image> {{districtName}}</navigator> <navigator url="../city/city" class="address"><image src='{{img1}}' mode='widthFix' class="imgs"></image> {{districtName}}</navigator>
<!-- 地址 -->
<!-- <text class='address' bindtap='districtCity'><image src='{{img1}}' mode='widthFix' class="imgs"></image> {{districtName}}</text> -->
</view> </view>
<!-- 暂时top-right不清楚干嘛的 --> <!-- 暂时top-right不清楚干嘛的 -->
<!-- <view class='top-right'></view> --> <!-- <view class='top-right'></view> -->

5
pages/index/index.wxss

@ -21,11 +21,6 @@
width: 20rpx; width: 20rpx;
margin-right:10rpx; margin-right:10rpx;
} }
/* .top-right {
width: 28%;
display: inline-block;
vertical-align: super;
} */
.address { .address {
font-size: 30rpx; font-size: 30rpx;

39
pages/loding/loding.js

@ -16,7 +16,6 @@ Page({
wx.getStorage({ wx.getStorage({
key: "merchantNo", key: "merchantNo",
success: function (res) { success: function (res) {
console.log(res.data);
if (res.data == "") { if (res.data == "") {
that.queryCartList(); that.queryCartList();
} else { } else {
@ -29,7 +28,6 @@ Page({
}); });
}, },
fail: function (res) { fail: function (res) {
console.log(res);
that.queryCartList(); that.queryCartList();
} }
}); });
@ -44,47 +42,10 @@ Page({
}); });
}, },
fail:function(error){ fail:function(error){
console.log(error);
wx.navigateTo({ wx.navigateTo({
url: '../city/city', url: '../city/city',
}) })
} }
}) })
}, },
// handler: function (e) {
// var that = this;
// if (!e.detail.authSetting['scope.userLocation']) {
// that.setData({
// ldata: false
// })
// } else {
// that.setData({
// ldata: true,
// })
// wx.getLocation({
// type: 'gcj02',
// success: function (res) {
// var latitude = res.latitude
// var longitude = res.longitude
// that.setData({
// latitude: latitude,
// longitude: longitude
// })
// wx.openLocation({
// latitude: latitude,
// longitude: longitude,
// scale: 28
// })
// }
// })
// }
// },
// btnTap(e) {
// wx.openLocation({
// latitude: this.data.latitude,
// longitude: this.data.longitude,
// scale: 28
// })
// },
}); });

1
pages/order/order.wxml

@ -10,7 +10,6 @@
<image class="product-img" src="{{item.goodsImgUrl}}" background-size="cover"></image> <image class="product-img" src="{{item.goodsImgUrl}}" background-size="cover"></image>
<view class='product-msg'> <view class='product-msg'>
<view class='title'>{{item.goodsName}}</view> <view class='title'>{{item.goodsName}}</view>
<!-- <view class='intro'>{{item.intro}}</view> -->
</view> </view>
</view> </view>
<view class='line'></view> <view class='line'></view>

Loading…
Cancel
Save