Browse Source

界面

feature/v1.1.0
shuiqing 7 years ago
parent
commit
c57d8e0ace
3 changed files with 20 additions and 12 deletions
  1. 19
      pages/at_present/at_present.js
  2. 10
      pages/at_present/at_present.wxml
  3. 3
      pages/city/city.js

19
pages/at_present/at_present.js

@ -12,13 +12,13 @@ var qqmapsdk;
Page({
data: {
resData: [],
showOrHidden: false,
showorHide: false,
showOrHidden: true,
city: '',
district: '',
cityId: '',
districtId: '',
merchantNo: '',
// groupNo: "",
},
onLoad: function(options) {
// let that = this; 
@ -26,6 +26,9 @@ Page({
key: 'C5KBZ-RISKD-INW4P-PWYQJ-QC6C7-BQBGC'
//正式的上线 key: 'JN7BZ-MJBK5-52SIH-QOKGH-FJE5F-IWFGG'
});
// this.setData({
// groupNo: options.groupNo == undefined ? "" : options.groupNo,
// });
},
onReady: function() {
var that = this;
@ -49,7 +52,8 @@ Page({
},
header: {
'Content-Type': 'application/x-www-form-urlencoded'
},
},
success: function(res) {
// 打印对应想得到的数据
var cityId = res.data.response[0].cityId;
@ -79,14 +83,15 @@ Page({
});
wx.setStorage({
key: 'merchantNo',
data: merchantNo,
data: merchantNo,
});
}
});
},
fail: function(res) {
showorHide: false,
console.log(res.data)
showorHide: false,
wx.showToast({
title: '加载数据失败',
});
@ -97,6 +102,10 @@ Page({
wx.getSetting({
})
},
openGroups: function (e) {
},
openGroup:function(e){
wx.navigateTo({

10
pages/at_present/at_present.wxml

@ -2,16 +2,14 @@
<view class="base_center">
<view class="base_top">当前定位地址:</view>
<view class="base_district">
<text>{{city}}{{district}}</text>
<text bindtap='openGroups'>{{city}}{{district}}</text>
</view>
<!-- {{showorHide?'show':'hide'}} -->
<view class="base_hint {{showorHide?'show':'hide'}}">{{lists}}</view>
<text bindtap='openGroup' class="choice_switchover {{showOrHidden?'show':'hide'}}">手动切换地址</text>
<!-- <navigator url="../city/city?titles={{city}}{{district}}" bindtap='openGroup' class="choice_switchover {{showOrHidden?'show':'hide'}}">手动切换地址</navigator> -->
<view class="choice">
<!-- class="choice_switchover {{showOrHidden?'show':'hide'}}" style='display: {{groupNo == "" ? "block" : "none"}};'-->
<text class="choice_switchover {{showOrHidden?'hide':'show'}}" bindtap='openGroup' >手动切换地址</text>
<view class="choice {{showOrHidden?'show':'hide'}}">
<text class="confirm_left" bindtap='groupTaps'>确定</text>
<text bindtap='openGroup' class="confirm_right">切换</text>
<!-- <navigator url="../city/city?titles={{city}}{{district}}" bindtap='openGroup' class="confirm_right">切换</navigator> -->
</view>
</view>
</view>

3
pages/city/city.js

@ -3,6 +3,7 @@
const app = getApp()
Page({
onLoad: function (options) {
var that = this
// 商家编号
wx.getStorage({
key: 'cityName',
@ -21,7 +22,6 @@ Page({
})
}
});
var that = this
wx.request({
url: app.gw.hostUrl + '/mall/wxa/index/opencitylist',
data: { cityName: 'cityName' },
@ -31,6 +31,7 @@ Page({
},
success: function (res) {
var citys = res.data;
console.log(citys)
that.setData({
citys
});

Loading…
Cancel
Save