|
@@ -419,31 +419,40 @@
|
|
|
})
|
|
|
console.log('submitOrder param',param);
|
|
|
//获取经纬度
|
|
|
- uni.getLocation({
|
|
|
- type: 'gcj02',
|
|
|
- success: (res) => {
|
|
|
- param.latitude = res.latitude;
|
|
|
- param.longitude = res.longitude;
|
|
|
- that.$u.api.submitOrder(param).then(res=>{
|
|
|
- console.log('res',res.data);
|
|
|
+ uni.getLocation({
|
|
|
+ type: 'gcj02',
|
|
|
+ success: (res) => {
|
|
|
+ param.latitude = res.latitude;
|
|
|
+ param.longitude = res.longitude;
|
|
|
+ that.$u.api.submitOrder(param).then(res=>{
|
|
|
+ console.log('res',res.data);
|
|
|
+ that.cansubmit = true;
|
|
|
+ if(res.data.payAmount>0){
|
|
|
+ uni.$u.route('/shopping/pay', {
|
|
|
+ orderId: res.data.orderId,
|
|
|
+ fromPage:that.fromPage,
|
|
|
+ payAmount:res.data.payAmount
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ uni.$u.route('/shopping/paysuccess', {
|
|
|
+ fromPage:'nocash'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }).catch(err=>{
|
|
|
+ that.cansubmit = true;
|
|
|
+ console.log('submitOrder',err);
|
|
|
+ })
|
|
|
+ },
|
|
|
+ fail: (err) => {
|
|
|
+ console.log('getLocationfail',err);
|
|
|
that.cansubmit = true;
|
|
|
- if(res.data.payAmount>0){
|
|
|
- uni.$u.route('/shopping/pay', {
|
|
|
- orderId: res.data.orderId,
|
|
|
- fromPage:that.fromPage,
|
|
|
- payAmount:res.data.payAmount
|
|
|
- });
|
|
|
- }else{
|
|
|
- uni.$u.route('/shopping/paysuccess', {
|
|
|
- fromPage:'nocash'
|
|
|
- });
|
|
|
- }
|
|
|
- }).catch(err=>{
|
|
|
- that.cansubmit = true;
|
|
|
- console.log('submitOrder',err);
|
|
|
- })
|
|
|
- },
|
|
|
- });
|
|
|
+ uni.$u.toast('请允许获取地理位置,以便更好的服务')
|
|
|
+ },
|
|
|
+ complete(e) {
|
|
|
+ console.log('getLocation complete',e);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
},
|
|
|
selectReceiveWay(index){
|
|
|
this.selectReceiveIndex = index;
|