From d32d550b294b47a5de2f6ce9d93ed8ec6d7c6988 Mon Sep 17 00:00:00 2001
From: Enzo <1284707383@qq.com>
Date: Wed, 8 Sep 2021 19:26:48 +0800
Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E6=94=AF=E4=BB=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
common/api.js | 4 +-
common/styles/iconfont.css | 10 ++--
pages.json | 6 +++
pages/goodsDetail/index.vue | 48 ++++++++++++-----
pages/login/index.vue | 2 +-
pages/order/confirm_atonce.vue | 98 ++++++++++++++++++++++++++++++++++
pages/order/confirm_order.vue | 74 +++++++++++++++----------
7 files changed, 198 insertions(+), 44 deletions(-)
create mode 100644 pages/order/confirm_atonce.vue
diff --git a/common/api.js b/common/api.js
index 5025b34..9e3b81f 100644
--- a/common/api.js
+++ b/common/api.js
@@ -70,4 +70,6 @@ export const API_ADDCOLLECT = '/api/fav/create'; //添加收藏
export const API_DELCOLLECT = '/api/fav/delete'; //删除收藏
-export const API_SEARCH_GOODS = '/api/agent_product/search'//搜索接口
\ No newline at end of file
+export const API_SEARCH_GOODS = '/api/agent_product/search'//搜索接口
+
+export const API_LF_PAY= '/api/share_pay'//领峰支付
\ No newline at end of file
diff --git a/common/styles/iconfont.css b/common/styles/iconfont.css
index 1613ab1..2d3fa34 100644
--- a/common/styles/iconfont.css
+++ b/common/styles/iconfont.css
@@ -1,8 +1,8 @@
@font-face {
font-family: "lf-iconfont"; /* Project id 2651793 */
- src: url('//at.alicdn.com/t/font_2651793_eou9l1nql5f.woff2?t=1631006175744') format('woff2'),
- url('//at.alicdn.com/t/font_2651793_eou9l1nql5f.woff?t=1631006175744') format('woff'),
- url('//at.alicdn.com/t/font_2651793_eou9l1nql5f.ttf?t=1631006175744') format('truetype');
+ src: url('//at.alicdn.com/t/font_2651793_2rvexfo9ayn.woff2?t=1631096351657') format('woff2'),
+ url('//at.alicdn.com/t/font_2651793_2rvexfo9ayn.woff?t=1631096351657') format('woff'),
+ url('//at.alicdn.com/t/font_2651793_2rvexfo9ayn.ttf?t=1631096351657') format('truetype');
}
.lf-iconfont {
@@ -13,6 +13,10 @@
-moz-osx-font-smoothing: grayscale;
}
+.lf-icon-dizhi:before {
+ content: "\e814";
+}
+
.lf-icon-zhankaishangxia:before {
content: "\e7b1";
}
diff --git a/pages.json b/pages.json
index 58f37a9..c7a92dd 100644
--- a/pages.json
+++ b/pages.json
@@ -58,6 +58,12 @@
"enablePullDownRefresh": true
}
},
+ {
+ "path": "pages/order/confirm_atonce",
+ "style": {
+ "navigationBarTitleText": "立即支付"
+ }
+ },
{
"path": "pages/order/confirm_order",
"style": {
diff --git a/pages/goodsDetail/index.vue b/pages/goodsDetail/index.vue
index fdccbbc..9384de5 100644
--- a/pages/goodsDetail/index.vue
+++ b/pages/goodsDetail/index.vue
@@ -46,6 +46,13 @@
+
+ {{goods_detail.product.extends.field_2.name}}
+
+ {{goods_detail.product.extends.field_2.address}}
+
+
+
包含项目
@@ -77,6 +84,13 @@
+
+ {{goods_detail.product.extends.field_3.name}}
+
+ {{goods_detail.product.extends.field_3.address}}
+
+
+
包含套餐
@@ -89,16 +103,25 @@
-
- 酒店设施
-
-
-
- {{item.tag}}
+
+
+ 酒店设施
+
+
+
+ {{item.tag}}
+
-
-
+
+
+ {{goods_detail.product.extends.field_1.name}}
+
+ {{goods_detail.product.extends.field_1.address}}
+
+
+
+
@@ -197,11 +220,12 @@
},
methods: {
// 打开地图
- openMap(){
- let { address, lat, lng } = this.goods_detail?.store || {};
+ openMap(address,lat,lng){
+ this.$msg('提示了')
+ // let { address, lat, lng } = this.goods_detail?.store || {};
uni.openLocation({
- longitude: Number(lat),
- latitude: Number(lng),
+ longitude: Number(lng),
+ latitude: Number(lat),
scale: 20,
name: address
});
diff --git a/pages/login/index.vue b/pages/login/index.vue
index 079f53f..f82a858 100644
--- a/pages/login/index.vue
+++ b/pages/login/index.vue
@@ -89,7 +89,7 @@
// 获取用户信息
getUserProfile(){
uni.getUserProfile({
- desc: '您的信息将用于时空网显示',
+ desc: '您的信息将用于小程序显示',
lang: 'zh_CN',
complete: result => {
console.log(result)
diff --git a/pages/order/confirm_atonce.vue b/pages/order/confirm_atonce.vue
new file mode 100644
index 0000000..f544625
--- /dev/null
+++ b/pages/order/confirm_atonce.vue
@@ -0,0 +1,98 @@
+
+
+
+
+
+
+
+
+
diff --git a/pages/order/confirm_order.vue b/pages/order/confirm_order.vue
index 4f6e09c..c46ae59 100644
--- a/pages/order/confirm_order.vue
+++ b/pages/order/confirm_order.vue
@@ -159,35 +159,55 @@
this.$msg('请输入联系电话!');
return;
}
- if(!this.ifPay) return;
- this.ifPay = false;
- this.$http(this.API.API_CREATEORDER,{id: this.goods_id,num: 1,pay_type: this.pay_type,name:this.contact,mobile:this.phone}).then(res => {
- this.order_id = res.data.id
- if(this.pay_type == 1) {
- this.ifPay = true
- this.$url('/pages/payState/paystate?ifSuccess=1&order_id='+this.order_id,{type: 'redirect'})
- }else {
- uni.requestPayment({
- orderInfo: res.data.order_num,
- timeStamp: res.data.timeStamp,
- nonceStr: res.data.nonceStr,
- package: res.data.package,
- signType: res.data.signType,
- paySign: res.data.paySign,
- success: (res) => {
- this.ifPay = true
- this.$url('/pages/payState/paystate?ifSuccess=1&order_id='+this.order_id,{type: 'redirect'})
- },
- fail: (err) => {
- this.ifPay = true
- this.$url('/pages/payState/paystate?ifSuccess=2&order_id='+this.order_id,{type: 'redirect'})
- },
- })
- }
- }).catch(err => {
- this.ifPay = true
+ if(this.goods_details.jump == true) {
+ let that = this;
+ var accountInfo = wx.getAccountInfoSync();
+ var autoappid = accountInfo.miniProgram.appId;
+ wx.navigateToMiniProgram({
+ appId: autoappid,
+ path: '/pages/order/confirm_atonce?order_id=' + this.order_id,
+ envVersion: 'release',
+ success(res) {
+ console.log('---res---')
+ console.log(res)
+ },
+ fail(err) {
+ console.log('---err---')
+ console.log(err)
+ }
})
+ }else {
+ if(!this.ifPay) return;
+ this.ifPay = false;
+ this.$http(this.API.API_CREATEORDER,{id: this.goods_id,num: 1,pay_type: this.pay_type,name:this.contact,mobile:this.phone}).then(res => {
+ this.order_id = res.data.id
+ if(this.pay_type == 1) {
+ this.ifPay = true
+ this.$url('/pages/payState/paystate?ifSuccess=1&order_id='+this.order_id,{type: 'redirect'})
+ }else {
+ uni.requestPayment({
+ orderInfo: res.data.order_num,
+ timeStamp: res.data.timeStamp,
+ nonceStr: res.data.nonceStr,
+ package: res.data.package,
+ signType: res.data.signType,
+ paySign: res.data.paySign,
+ success: (res) => {
+ this.ifPay = true
+ this.$url('/pages/payState/paystate?ifSuccess=1&order_id='+this.order_id,{type: 'redirect'})
+ },
+ fail: (err) => {
+ this.ifPay = true
+ this.$url('/pages/payState/paystate?ifSuccess=2&order_id='+this.order_id,{type: 'redirect'})
+ },
+ })
+ }
+
+ }).catch(err => {
+ this.ifPay = true
+ })
+ }
},
payOnce() {
this.$http(this.API.API_ORDERPAY,{id: this.order_id}).then(res => {