Commit 89999e80 by 李伟康

3.16.0

1 parent 9f7c565d
import { preReleaseAppId } from '~/config'
const target = ['ip', 'dev', 'uat', 'prod', 'preRelease']
let index = 2
let index = 3
/**
*
......
......@@ -12,7 +12,7 @@ Page({
region: [],
address: '',
isDefault: 0,
platformObj:{}
platformObj: {}
}
},
onLoad: function (options) {
......@@ -41,7 +41,11 @@ Page({
},
useLocation() {
let {
currentAddress: { formatted_addresses, address_component, ad_info }
currentAddress: {
formatted_addresses,
address_component,
ad_info
}
} = this.data
this.setData({
'userObj.address': formatted_addresses.recommend,
......@@ -51,15 +55,20 @@ Page({
},
/**获取当前位置 */
getLocation() {
let { currentAddress } = this.data
let {
currentAddress
} = this.data
if (currentAddress) return
this.setData({
unauthorized: false
})
wx.getLocation({
type: 'gcj02'
})
.then(({ latitude, longitude }) => {
type: 'gcj02'
}).then(({
latitude,
longitude
}) => {
console.log(this)
this.setData({
current: true
})
......@@ -90,20 +99,29 @@ Page({
this.getLocation()
},
input(e) {
let { target } = e.currentTarget.dataset
let { value } = e.detail
let {
target
} = e.currentTarget.dataset
let {
value
} = e.detail
this.setData({
[`userObj.${target}`]: value
})
},
blur(e) {
let { value } = e.detail
let {
value
} = e.detail
this.setData({
'userObj.address': value
})
},
save() {
let { userObj, isChooseAddress } = this.data
let {
userObj,
isChooseAddress
} = this.data
try {
Object.keys(userObj).map(key => {
if (key == 'receiveName' && !userObj[key]) throw '请输入姓名'
......@@ -155,8 +173,13 @@ Page({
},
/**选择地区 */
chooseArea(e) {
let { value, code } = e.detail
let { userObj } = this.data
let {
value,
code
} = e.detail
let {
userObj
} = this.data
userObj.region = [value[0], value[1], value[2]]
userObj.provinceId = code[0]
userObj.cityId = code[1]
......@@ -170,43 +193,43 @@ Page({
'userObj.isDefault': this.data.userObj.isDefault == 0 ? 1 : 0
})
},
showSelect(){
showSelect() {
this.setData({
showAreaSelect:true
showAreaSelect: true
})
},
cancelProvince(){
cancelProvince() {
this.setData({
showAreaSelect:false
showAreaSelect: false
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () { },
onReady: function () {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () { },
onShow: function () {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () { },
onHide: function () {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () { },
onUnload: function () {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () { },
onPullDownRefresh: function () {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () { }
})
onReachBottom: function () {}
})
\ No newline at end of file
......@@ -104,6 +104,7 @@ Page({
app.globalData.goodsPageParam.pageSize = 0
app.globalData.goodsLoaded = false
let { currentAddress } = this.data
if(!currentAddress) return
const { lat, lng } = currentAddress.location
this.toGetCommodity(lat, lng, false, 1)
},
......@@ -117,6 +118,7 @@ Page({
let {
currentAddress
} = this.data
if(!currentAddress) return
const {
lat,
lng
......
/* components/Goods/Goods.wxss */
.text-hide{
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.Goods{
display: flex;
flex-direction: row;
......@@ -73,7 +78,10 @@
margin-top: 12rpx;
vertical-align: middle;
}
.item-box-time .text{
display: flex;
align-items: center;
}
.item-box-price{
margin-top: 12rpx;
display: flex;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!