Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
8d8f0f7c5f | ||
|
9dfa21bfdd | ||
|
d6ae812e27 | ||
|
87a1eac740 | ||
|
d7737a9fe1 |
@ -1,17 +1,17 @@
|
|||||||
{
|
{
|
||||||
"pages": [
|
"pages": [
|
||||||
"pages/index/index",
|
"pages/index/index",
|
||||||
"pages/order/show",
|
"pages/address/select",
|
||||||
|
"pages/mine/mine",
|
||||||
"pages/order/quasi",
|
"pages/order/quasi",
|
||||||
|
"pages/order/show",
|
||||||
"pages/shop/show",
|
"pages/shop/show",
|
||||||
"pages/order/list",
|
"pages/order/list",
|
||||||
"pages/order/content",
|
"pages/order/content",
|
||||||
"pages/mine/coupon",
|
"pages/mine/coupon",
|
||||||
"pages/mine/mine",
|
|
||||||
"pages/order/review",
|
"pages/order/review",
|
||||||
"pages/index/search",
|
"pages/index/search",
|
||||||
"pages/index/category",
|
"pages/index/category",
|
||||||
"pages/address/select",
|
|
||||||
"pages/address/list",
|
"pages/address/list",
|
||||||
"pages/index/address",
|
"pages/index/address",
|
||||||
"pages/address/add",
|
"pages/address/add",
|
||||||
|
@ -53,6 +53,14 @@ Page({
|
|||||||
})
|
})
|
||||||
wx.hideNavigationBarLoading()
|
wx.hideNavigationBarLoading()
|
||||||
cb && cb()
|
cb && cb()
|
||||||
|
if(data.length === 0) {
|
||||||
|
wx.navigateTo({
|
||||||
|
url: '/pages/address/add',
|
||||||
|
success: function(res) {},
|
||||||
|
fail: function(res) {},
|
||||||
|
complete: function(res) {},
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
error() {
|
error() {
|
||||||
that.setData({
|
that.setData({
|
||||||
|
@ -12,6 +12,12 @@
|
|||||||
<view class="grey-color">
|
<view class="grey-color">
|
||||||
{{item.addr}} {{item.detail}}
|
{{item.addr}} {{item.detail}}
|
||||||
</view>
|
</view>
|
||||||
|
<view class="address-actions">
|
||||||
|
<navigator url="/pages/address/add?id={{item.addr_id}}&callback=callback" class="address-actions__item">
|
||||||
|
<image class="address-actions__item-img" src="/images/address_edit_white.png">
|
||||||
|
</image>
|
||||||
|
</navigator>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -18,11 +18,15 @@ Page({
|
|||||||
*/
|
*/
|
||||||
onLoad: function (options) {
|
onLoad: function (options) {
|
||||||
this.callback = options.callback || 'callback'
|
this.callback = options.callback || 'callback'
|
||||||
var {content} = options
|
var content = options.content
|
||||||
|
var that = this
|
||||||
if (content) {
|
if (content) {
|
||||||
this.setData({
|
// fix textarea value not work
|
||||||
|
setTimeout(function () {
|
||||||
|
that.setData({
|
||||||
content
|
content
|
||||||
})
|
})
|
||||||
|
}, 200)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<view class="weui-cells weui-cells_after-title">
|
<view class="weui-cells weui-cells_after-title">
|
||||||
<view class="weui-cell">
|
<view class="weui-cell">
|
||||||
<view class="weui-cell__bd">
|
<view class="weui-cell__bd">
|
||||||
<textarea bindinput="onContentInput" value="{{content}}" class="weui-textarea" placeholder="口味, 偏好等要求" style="height: 3.3em" />
|
<textarea bindinput="onContentInput" auto-focus="true" value="{{content}}" class="weui-textarea" placeholder="口味, 偏好等要求" style="height: 3.3em" />
|
||||||
<view class="weui-textarea-counter">{{content.length}}/{{limit}}</view>
|
<view class="weui-textarea-counter">{{content.length}}/{{limit}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -14,7 +14,7 @@ Page({
|
|||||||
},
|
},
|
||||||
onLoad: function (options) {
|
onLoad: function (options) {
|
||||||
// 页面初始化 options为页面跳转所带来的参数
|
// 页面初始化 options为页面跳转所带来的参数
|
||||||
this.id = options.id || '2853'
|
this.id = options.id || '2908'
|
||||||
this.loadData()
|
this.loadData()
|
||||||
},
|
},
|
||||||
onReady: function () {
|
onReady: function () {
|
||||||
@ -130,7 +130,7 @@ Page({
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (!info.receiver_addr_id) {
|
if (!info.receiver_addr_id) {
|
||||||
return alert('请选择用户地址')
|
return alert('请选择收货地址')
|
||||||
}
|
}
|
||||||
this.setData({
|
this.setData({
|
||||||
loading: true
|
loading: true
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</navigator>
|
</navigator>
|
||||||
<navigator wx:else url="/pages/address/select?callback=callbackAddress" class=" weui-media-box weui-media-box_text weui-cell__ft_in-access weui-media-box_address primary-color text-large">
|
<navigator wx:else url="/pages/address/select?callback=callbackAddress" class=" weui-media-box weui-media-box_text weui-cell__ft_in-access weui-media-box_address primary-color text-large">
|
||||||
选择地址
|
选择收货地址
|
||||||
</navigator>
|
</navigator>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -87,15 +87,21 @@ export function login(options) {
|
|||||||
} = options
|
} = options
|
||||||
wx.login({
|
wx.login({
|
||||||
success(res) {
|
success(res) {
|
||||||
|
getApp().getCurrentAddress(address => {
|
||||||
fetch({
|
fetch({
|
||||||
url: 'index.php?m=Api&c=WeixinMall&a=login',
|
url: 'index.php?m=Api&c=WeixinMall&a=login',
|
||||||
data: {
|
data: {
|
||||||
phone, code,
|
phone, code,
|
||||||
wx_code: res['code'],
|
wx_code: res['code'],
|
||||||
session_3rd: wx.getStorageSync('session_3rd')
|
session_3rd: wx.getStorageSync('session_3rd'),
|
||||||
|
city_id: address.city_id,
|
||||||
|
city_name: address.city,
|
||||||
|
district_id: address.district_id,
|
||||||
|
district_name: address.district,
|
||||||
},
|
},
|
||||||
success, error
|
success, error
|
||||||
})
|
})
|
||||||
|
})
|
||||||
},
|
},
|
||||||
error(res) {
|
error(res) {
|
||||||
alert(res['errMsg'])
|
alert(res['errMsg'])
|
||||||
@ -251,7 +257,7 @@ export function updateUserAddr(options) {
|
|||||||
city_id: address.city_id,
|
city_id: address.city_id,
|
||||||
city_name: address.city,
|
city_name: address.city,
|
||||||
district_id: address.district_id,
|
district_id: address.district_id,
|
||||||
district_name: address.district_name,
|
district_name: address.district,
|
||||||
},
|
},
|
||||||
success, error
|
success, error
|
||||||
})
|
})
|
||||||
|
@ -57,8 +57,29 @@ export function getCurrentAddressList(options) {
|
|||||||
},
|
},
|
||||||
fail(res) {
|
fail(res) {
|
||||||
console.log(res.errMsg)
|
console.log(res.errMsg)
|
||||||
|
if (res.errMsg == 'getLocation:fail auth deny' && wx.openSetting) {
|
||||||
|
confirm({
|
||||||
|
content: '若不授权地理位置权限, 则无法正常使用爱跑腿外卖, 请重新授权地理位置权限',
|
||||||
|
cancelText: '不授权',
|
||||||
|
confirmText: '授权',
|
||||||
|
ok() {
|
||||||
|
wx.openSetting({
|
||||||
|
success(res) {
|
||||||
|
console.log(res)
|
||||||
|
if (res.authSetting['scope.userLocation']) {
|
||||||
|
getCurrentAddressList(options)
|
||||||
|
} else {
|
||||||
alert('获取用户地址失败')
|
alert('获取用户地址失败')
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
alert('获取用户地址失败')
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -201,14 +222,15 @@ export function alert(content, callback) {
|
|||||||
// 确认框
|
// 确认框
|
||||||
export function confirm(options) {
|
export function confirm(options) {
|
||||||
var {
|
var {
|
||||||
content, confirmText,
|
content, confirmText, cancelText,
|
||||||
ok,
|
ok,
|
||||||
} = options
|
} = options
|
||||||
confirmText = confirmText || '确定'
|
confirmText = confirmText || '确定'
|
||||||
|
cancelText = cancelText || '关闭'
|
||||||
wx.showModal({
|
wx.showModal({
|
||||||
content,
|
content,
|
||||||
confirmText,
|
confirmText,
|
||||||
cancelText: '关闭',
|
cancelText,
|
||||||
success(res) {
|
success(res) {
|
||||||
if (res.confirm) {
|
if (res.confirm) {
|
||||||
ok && ok()
|
ok && ok()
|
||||||
@ -308,8 +330,29 @@ export function getUserInfo(cb) {
|
|||||||
},
|
},
|
||||||
fail(res) {
|
fail(res) {
|
||||||
console.log(res)
|
console.log(res)
|
||||||
|
if (res.errMsg == 'getUserInfo:fail auth deny' && wx.openSetting) {
|
||||||
|
confirm({
|
||||||
|
content: '若不授用户信息权限, 则无法正常显示用户头像和昵称, 请重新授权用户信息权限',
|
||||||
|
cancelText: '不授权',
|
||||||
|
confirmText: '授权',
|
||||||
|
ok() {
|
||||||
|
wx.openSetting({
|
||||||
|
success(res) {
|
||||||
|
console.log(res)
|
||||||
|
if (res.authSetting['scope.userInfo']) {
|
||||||
|
getUserInfo(cb)
|
||||||
|
} else {
|
||||||
alert('获取用户信息失败')
|
alert('获取用户信息失败')
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
} else {
|
||||||
|
alert('获取用户信息失败')
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user