From 99279225666a9593f5435bfb7d19a76455655d7b Mon Sep 17 00:00:00 2001
From: meo <18801474720@163.com>
Date: Thu, 19 Sep 2019 17:39:44 +0800
Subject: [PATCH] =?UTF-8?q?[=E5=85=91=E6=8D=A2][=E5=A2=9E=E5=8A=A0]:[?=
=?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E5=A2=9E=E5=8A=A0=E5=85=91=E6=8D=A2?=
=?UTF-8?q?=E6=B6=88=E8=B4=B9=E5=8D=A1=E7=9A=84=E5=8A=9F=E8=83=BD]?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
config/config.js | 3 +-
ext.json | 25 +++----
pages/exchange/exchange.js | 135 ++++++++++++++++++++---------------
pages/exchange/exchange.wxml | 10 +--
pages/exchange/exchange.wxss | 10 +--
project.config.json | 2 +-
utils/imgurl.js | 2 +-
7 files changed, 107 insertions(+), 80 deletions(-)
diff --git a/config/config.js b/config/config.js
index 480214f..be29ef2 100755
--- a/config/config.js
+++ b/config/config.js
@@ -312,7 +312,8 @@ var config = {
activitySign:"/wxActivityJoin/sign",
activityList: "/wxActivityJoin/list",
//获取未支付的订单
- getUnPaidOrder: "/order/getUnPaidOrder"
+ getUnPaidOrder: "/order/getUnPaidOrder",
+ getCouponOrderByPassword:'/couponPassword/getCouponOrderByPassword'
},
weapp: {
AppId: weappId
diff --git a/ext.json b/ext.json
index 302a6e6..d0ad0bb 100644
--- a/ext.json
+++ b/ext.json
@@ -3,29 +3,30 @@
"attr": {
"imgProxy": [
{
- "newUrl": "https://c.malls.iformall.com/img",
+ "newUrl": "https://ciformall.youlane.cn/img",
"orgUrl": "https://iformall-net.s3.cn-northwest-1.amazonaws.com.cn"
},
{
- "newUrl": "https://c.malls.iformall.com/img1",
+ "newUrl": "https://ciformall.youlane.cn/img1",
"orgUrl": "https://s3.cn-northwest-1.amazonaws.com.cn"
},
{
- "newUrl": "https://c.malls.iformall.com/img2",
+ "newUrl": "https://ciformall.youlane.cn/img2",
"orgUrl": "https://wx.qlogo.cn"
}
],
- "configUrl": "https://c.malls.iformall.com/C/api",
- "etcpAppId": "wxc07f9d67923d676d",
+ "configUrl": "https://ciformall.youlane.cn/C/api",
+ "etcpAppId": "wx192b7d2e8dcbefd0",
+ "socketUrl": "wss://mp.youlane.cn/W/ws",
"ifStoreApp": "0",
"etcpVersion": "release",
- "etcpCallbackUrl": "https://admin.malls.iformall.com/api/carCallback/etcpPaidCallback",
+ "etcpCallbackUrl": "https://ciformall.youlane.cn/api/carCallback/etcpPaidCallback",
"ifHaveWebSocket": "0",
"ifHaveCarModular": "1"
},
- "name": "富茂链客生产版",
- "weappId": "wx6a2524a8286d687f",
- "appVersion": "C.5.1.1"
+ "name": "富茂客官开发",
+ "weappId": "wxea71200db93d756b",
+ "appVersion": "C.4.5.106"
},
"debug": false,
"tabBar": {
@@ -60,10 +61,10 @@
"window": {
"backgroundTextStyle": "dark",
"navigationBarTextStyle": "black",
- "navigationBarTitleText": "",
- "navigationBarBackgroundColor": "#FFFFFF"
+ "navigationBarTitleText": "WeChat",
+ "navigationBarBackgroundColor": "#fff"
},
- "extAppid": "wx6a2524a8286d687f",
+ "extAppid": "wxea71200db93d756b",
"extEnable": true,
"permission": {
"scope.userLocation": {
diff --git a/pages/exchange/exchange.js b/pages/exchange/exchange.js
index 16d61ae..fd71a2b 100644
--- a/pages/exchange/exchange.js
+++ b/pages/exchange/exchange.js
@@ -11,64 +11,85 @@ Page({
data: {
navigationBarHeight
},
-
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function (options) {
-
- },
-
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady: function () {
-
- },
-
- /**
- * 生命周期函数--监听页面显示
- */
- onShow: function () {
-
- },
-
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide: function () {
-
- },
-
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload: function () {
-
- },
-
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh: function () {
-
- },
-
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom: function () {
-
- },
-
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage: function () {
-
- },
// 兑换
exchange(e){
-
+ let that = this;
+ let code = e.detail.value.code;
+ let formId = e.detail.formId;
+ if (!code){
+ wx.showToast({
+ title: '请输入兑换码',
+ icon:"none",
+ duration:2500
+ })
+ return;
+ }
+ that.checkPhoneStatus(e.detail.value.code,formId = e.detail.formId);
+ },
+ checkPhoneStatus: function (password, formId) {
+ let that = this;
+ Http.get({
+ url: config.api.checkPhoneStatus,
+ data: {}
+ })
+ .then(res => {
+ that.getCouponOrderByPassword(password, formId);
+ })
+ .catch(err => {
+ if (err.code == 11005) {
+ /**
+ * 手机号没有授权,将值传到用户手机号授权的页面
+ *
+ */
+ wx.redirectTo({
+ url: "/pages/getphoneInfo/index",
+ })
+ } else {
+ wx.showToast({
+ title: err.message,
+ icon: 'none',
+ duration: 2500
+ })
+ }
+ })
+ },
+ getCouponOrderByPassword(password, formId) {
+ let that = this;
+ Http.post({
+ url: config.api.getCouponOrderByPassword,
+ data: {
+ password: password,
+ formId: formId
+ }
+ })
+ .then(res => {
+ wx.showModal({
+ title: '兑换成功',
+ content: '消费卡已发放到"我的卡包"',
+ showCancel: true,
+ cancelText: "知道了",
+ cancelColor: '',
+ confirmText: "去查看",
+ confirmColor: '#FD832D',
+ success: function (res) {
+ if (res.cancel) {
+ //点击取消,默认隐藏弹框
+ } else {
+ wx.redirectTo({
+ url: '/pages/cardorder/index/index',
+ })
+ }
+ },
+ fail: function (res) { },//接口调用失败的回调函数
+ complete: function (res) { },//接口调用结束的回调函数(调用成功、失败都会执行)
+ })
+ })
+ .catch(err => {
+ wx.showToast({
+ title: err.message,
+ icon: 'none',
+ duration: 2000
+ })
+ })
}
})
\ No newline at end of file
diff --git a/pages/exchange/exchange.wxml b/pages/exchange/exchange.wxml
index 7b46d75..05e3e4b 100644
--- a/pages/exchange/exchange.wxml
+++ b/pages/exchange/exchange.wxml
@@ -1,8 +1,10 @@