提交 8e57c932 编写于 作者: D devil

支付宝、QQ小程序新增获取地址

上级 c8f08f23
......@@ -14,7 +14,8 @@ web端
小程序
1. QQ小程序支持微信支付
2. 百度/微信小程序支持手机号码一键绑定、获取收货地址
2. 支持手机号码一键绑定[百度/微信]
3. 支持获取收货地址[百度/微信/QQ/支付宝]
插件
1. 汇率插件支持货币自由切换
......
......@@ -26,4 +26,12 @@
}
.page {
padding-bottom: 85rpx;
}
.submit-list button {
width: 50%;
}
.submit-list .import-system-address-submit {
background: #07c160 !important;
right: 0;
left: auto;
}
\ No newline at end of file
......@@ -33,7 +33,10 @@
<import src="/pages/common/bottom_line.axml" />
<template is="bottom_line" data="{{status: data_bottom_line_status}}"></template>
<navigator url="/pages/user-address-save/user-address-save" open-type="navigate" hover-class="none">
<button class="submit-fixed submit-bottom" type="default" hover-class="none">新增地址</button>
</navigator>
<view class="submit-list">
<navigator url="/pages/user-address-save/user-address-save" open-type="navigate" hover-class="none">
<button class="submit-fixed submit-bottom" type="default" hover-class="none">添加新地址</button>
</navigator>
<button class="submit-fixed submit-bottom import-system-address-submit" type="default" hover-class="none" onTap="choose_system_address_event">导入支付宝地址</button>
</view>
</view>
\ No newline at end of file
......@@ -237,5 +237,53 @@ Page({
my.navigateBack();
}
},
// 获取系统地址
choose_system_address_event(e) {
var self = this;
my.getAddress({
success (res) {
if(res.resultStatus == '9000') {
var data = {
"name": res.result.fullname || '',
"tel": res.result.mobilePhone || '',
"province": res.result.prov || '',
"city": res.result.city || '',
"county": res.result.area || '',
"town": res.result.street || '',
"address": res.result.address || '',
};
// 加载loding
my.showLoading({ content: "处理中..." });
// 获取数据
my.request({
url: app.get_request_url("outsystemadd", "useraddress"),
method: "POST",
data: data,
dataType: "json",
headers: { 'content-type': 'application/x-www-form-urlencoded' },
success: res => {
my.hideLoading();
if (res.data.code == 0) {
self.get_data_list();
} else {
if (app.is_login_check(res.data)) {
app.showToast(res.data.msg);
} else {
app.showToast('提交失败,请重试!');
}
}
},
fail: () => {
my.hideLoading();
app.showToast("服务器请求出错");
}
});
}
}
});
},
});
......@@ -229,6 +229,7 @@ Page({
// 获取系统地址
choose_system_address_event(e) {
var self = this;
var detail = e.detail;
var data = {
"name": detail.userName || '',
......@@ -249,10 +250,11 @@ Page({
method: "POST",
data: data,
dataType: "json",
headers: { 'content-type': 'application/x-www-form-urlencoded' },
success: res => {
swan.hideLoading();
if (res.data.code == 0) {
this.get_data_list();
self.get_data_list();
} else {
if (app.is_login_check(res.data)) {
app.showToast(res.data.msg);
......
......@@ -45,7 +45,6 @@
</navigator>
</view>
</view>
</view>
<view qq:else>
<import src="/pages/common/nodata.qml" />
......
......@@ -236,5 +236,50 @@ Page({
qq.navigateBack();
}
},
// 获取系统地址
choose_system_address_event(e) {
var self = this;
qq.chooseAddress({
success (res) {
var data = {
"name": res.userName || '',
"tel": res.telNumber || '',
"province": res.provinceName || '',
"city": res.cityName || '',
"county": res.countyName || '',
"address": res.detailInfo || '',
};
// 加载loding
qq.showLoading({ title: "处理中..." });
// 获取数据
qq.request({
url: app.get_request_url("outsystemadd", "useraddress"),
method: "POST",
data: data,
dataType: "json",
headers: { 'content-type': 'application/x-www-form-urlencoded' },
success: res => {
qq.hideLoading();
if (res.data.code == 0) {
self.get_data_list();
} else {
if (app.is_login_check(res.data)) {
app.showToast(res.data.msg);
} else {
app.showToast('提交失败,请重试!');
}
}
},
fail: () => {
qq.hideLoading();
app.showToast("服务器请求出错");
}
});
}
});
},
});
......@@ -32,8 +32,11 @@
<import src="/pages/common/bottom_line.qml" />
<template is="bottom_line" data="{{status: data_bottom_line_status}}"></template>
<navigator url="/pages/user-address-save/user-address-save" open-type="navigate" hover-class="none">
<button class="submit-fixed submit-bottom" type="default" hover-class="none">新增地址</button>
</navigator>
<view class="submit-list">
<navigator url="/pages/user-address-save/user-address-save" open-type="navigate" hover-class="none">
<button class="submit-fixed submit-bottom" type="default" hover-class="none">添加新地址</button>
</navigator>
<button class="submit-fixed submit-bottom import-system-address-submit" type="default" hover-class="none" bindtap="choose_system_address_event">导入QQ地址</button>
</view>
</view>
\ No newline at end of file
......@@ -26,4 +26,12 @@
}
.page {
padding-bottom: 85rpx;
}
.submit-list button {
width: 50%;
}
.submit-list .import-system-address-submit {
background: #07c160 !important;
right: 0;
left: auto;
}
\ No newline at end of file
......@@ -263,6 +263,7 @@ Page({
method: "POST",
data: data,
dataType: "json",
headers: { 'content-type': 'application/x-www-form-urlencoded' },
success: res => {
wx.hideLoading();
if (res.data.code == 0) {
......
......@@ -38,6 +38,6 @@
<navigator url="/pages/user-address-save/user-address-save" open-type="navigate" hover-class="none">
<button class="submit-fixed submit-bottom" type="default" hover-class="none">添加新地址</button>
</navigator>
<button class="submit-fixed submit-bottom import-system-address-submit" type="default" hover-class="none" bindtap="choose_system_address_event">导入百度地址</button>
<button class="submit-fixed submit-bottom import-system-address-submit" type="default" hover-class="none" bindtap="choose_system_address_event">导入微信地址</button>
</view>
</view>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册