Commit 89999e80 by 李伟康

3.16.0

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