diff --git a/app.json b/app.json index b880fc1..5ac98a3 100644 --- a/app.json +++ b/app.json @@ -52,6 +52,7 @@ "pages/payrule/payrule", "pages/grade/grade", "pages/exchange/exchange", + "pages/exchangeCard/exchangeCard", "pages/game/index", "pages/canvas/index", "pages/specialcourtesy/specialcourtesy", diff --git a/assets/images/scan.png b/assets/images/scan.png new file mode 100644 index 0000000..62f81b1 Binary files /dev/null and b/assets/images/scan.png differ diff --git a/ext.json b/ext.json index dcaba26..34dfe10 100644 --- a/ext.json +++ b/ext.json @@ -2,44 +2,35 @@ "ext": { "attr": { "car": { - "tjd": { - "payPath": "", - "tjdAppId": "wx6945d1bda68d7993" - }, "etcp": { - "payPath": "pages/pay/order-pay-open/main", - "etcpAppId": "wxc07f9d67923d676d", - "etcpCallbackUrl": "https://admin.malls.iformall.com/api/carCallback/etcpPaidCallback" - }, - "bolink": { - "payPath": "pages/park/park", - "bolinkAppId": "wxbd08b4baa10fcc1d" - }, - "version": "release" + "etcpAppId": "wx192b7d2e8dcbefd0", + "etcpVersion": "release", + "etcpCallbackUrl": "https://admintest.malls.iformall.com/api/carCallback/etcpPaidCallback" + } }, - "mchId": "1539123951", + "mchId": "1604439800", "imgProxy": [ { - "newUrl": "https://c.malls.iformall.com/img", + "newUrl": "https://ctest.malls.iformall.com/img", "orgUrl": "https://iformall-net.formall.oss-accelerate.aliyuncs.com" }, { - "newUrl": "https://c.malls.iformall.com/img1", + "newUrl": "https://ctest.malls.iformall.com/img1", "orgUrl": "https://formall.oss-accelerate.aliyuncs.com" }, { - "newUrl": "https://c.malls.iformall.com/img2", + "newUrl": "https://ctest.malls.iformall.com/img2", "orgUrl": "https://wx.qlogo.cn" } ], - "configUrl": "https://c.malls.iformall.com/C/api", - "ifStoreApp": "0", + "configUrl": "https://ctest.malls.iformall.com/C/api", + "businessSwitch": "1", "ifHaveWebSocket": "0", "ifHaveCarModular": "1" }, - "name": "欢乐城万象金街", - "weappId": "wxde54451891094c16", - "appVersion": "C.5.1.1" + "name": "金泸商务", + "weappId": "wx649b3be73c1afe47", + "appVersion": "C.test.5.2.0" }, "debug": false, "tabBar": { @@ -75,7 +66,8 @@ "selectedIconPath": "assets/images/user-a.png" } ], - "custom": true + "color": "#abb1be", + "selectedColor": "#b2743d" }, "window": { "backgroundTextStyle": "dark", @@ -84,12 +76,16 @@ "navigationBarBackgroundColor": "#FFFFFF" }, "plugins": { + "auto-points-plugin": { + "version": "1.3.0", + "provider": "wxfab2bf944bfc4da6" + }, "live-player-plugin": { "version": "1.3.4", "provider": "wx2b03c6e691cd7370" } }, - "extAppid": "wxde54451891094c16", + "extAppid": "wx649b3be73c1afe47", "extEnable": true, "permission": { "scope.userLocation": { diff --git a/index/user.wxml b/index/user.wxml index 96a5973..8044f16 100644 --- a/index/user.wxml +++ b/index/user.wxml @@ -137,6 +137,14 @@ > + + + + 录入实体卡 + > + + + 问券调查 diff --git a/pages/exchange/exchange.js b/pages/exchange/exchange.js index 58673e1..62d22de 100644 --- a/pages/exchange/exchange.js +++ b/pages/exchange/exchange.js @@ -9,33 +9,54 @@ Page({ * 页面的初始数据 */ data: { - navigationBarHeight + navigationBarHeight, + code: "" }, // 兑换 - exchange(e){ + exchange(e) { + console.log(e, 'e'); let that = this; let code = e.detail.value.code; let formId = e.detail.formId; - if (!code || !code.replace(/\s*/g, "")){ + if (!code || !code.replace(/\s*/g, "")) { wx.showToast({ title: '请输入兑换码', - icon:"none", - duration:2500 + icon: "none", + duration: 2500 }) return; } - that.checkPhoneStatus(e.detail.value.code,formId = e.detail.formId); + that.checkPhoneStatus(code, formId); }, + + goScanCode() { + console.log('scan!!!'); + const that = this + wx.scanCode({ + success: (res) => { + console.log(res, 'res'); + const num = res.result + that.setData({ + code: num + }) + that.exchange({ detail: { value: num } }) + }, + fail: (res) => { + console.log(res, 'fail'); + } + }) + }, + checkPhoneStatus: function (password, formId) { let that = this; Http.get({ url: config.api.checkPhoneStatus, data: {} }) - .then(res => { - that.getCouponOrderByPassword(password, formId); - }) - .catch(err => { + .then(res => { + that.getCouponOrderByPassword(password, formId); + }) + .catch(err => { if (err.code == 11005) { /** * 手机号没有授权,将值传到用户手机号授权的页面 @@ -51,7 +72,7 @@ Page({ duration: 2500 }) } - }) + }) }, getCouponOrderByPassword(password, formId) { let that = this; @@ -62,34 +83,34 @@ Page({ 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) { },//接口调用结束的回调函数(调用成功、失败都会执行) + .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 + .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 f8732eb..f652665 100644 --- a/pages/exchange/exchange.wxml +++ b/pages/exchange/exchange.wxml @@ -1,11 +1,13 @@
- - - + + + + + 如何获取兑换码? 1.实体卡卡密可刮开卡背面涂层查看; diff --git a/pages/exchange/exchange.wxss b/pages/exchange/exchange.wxss index ab3678f..ffe85b6 100644 --- a/pages/exchange/exchange.wxss +++ b/pages/exchange/exchange.wxss @@ -1,12 +1,15 @@ /* pages/exchange/exchange.wxss */ -.section{ +.section { padding: 20rpx 20rpx; } -.section{ + +.section { + position: relative; display: flex; flex: 5; } -.section input{ + +.section input { flex: 3; border: 1px solid #ccc; border-radius: 10rpx; @@ -16,29 +19,45 @@ padding-left: 20rpx; margin-right: 10rpx; } -.section button{ + +.section button { flex: 1; height: 74rpx; line-height: 74rpx; font-size: 30rpx; } -.comment{ + +.section .scan { + position: absolute; + right: 255rpx; + bottom: 37rpx; + width: 40rpx; + height: 40rpx; + z-index: 999; +} + +.comment { padding: 0 20rpx; margin-top: 60rpx; } -.comment text{ + +.comment text { display: block; } -.txt1{ + +.txt1 { margin-top: 30rpx; font-size: 34rpx; margin-bottom: 20rpx; } -.txt2,.txt3{ + +.txt2, +.txt3 { font-size: 30rpx; line-height: 40rpx; color: #999; } -.opcaity{ + +.opcaity { opacity: .6; } \ No newline at end of file diff --git a/pages/exchangeCard/exchangeCard.js b/pages/exchangeCard/exchangeCard.js new file mode 100644 index 0000000..cdef2ab --- /dev/null +++ b/pages/exchangeCard/exchangeCard.js @@ -0,0 +1,142 @@ +const navigationBarHeight = (getApp().statusBarHeight + 60) + 'px' +const util = require("../../utils/util.js"); +const Http = require("../../utils/HttpBasics"); +const config = require("../../config/config"); +const imgurl = require("../../utils/imgurl"); +Page({ + + /** + * 页面的初始数据 + */ + data: { + navigationBarHeight, + tabIndex: 0, + pdwSwitch: 0, + isChangePhone: false, + code: "", + name: "叶文沁", + phone: "1379****591", + tempPhone: '', + password: '', + }, + + // 兑换 + exchange(e) { + console.log(e, 'e'); + let that = this; + let code = e.detail.value.code; + console.log(code); + }, + + // 更改手机号 + changePhone() { + this.setData({ + isChangePhone: true, + tempPhone: this.data.phone + }) + }, + + // 输入手机号 + phoneInput(e) { + this.setData({ + phone: e.detail.value + }) + }, + + // 输入密码 + pwdInput(e) { + this.setData({ + password: e.detail.value + }) + }, + + // 确认手机号更改 + confirmPhone() { + const phoneReg = /^(?:(?:\+|00)86)?1[3-9]\d{9}$/ + const phoneValid = phoneReg.test(this.data.phone) + if (!phoneValid) { + wx.showToast({ + title: '请输入正确的手机号!', + icon: 'none' + }) + return + } + this.setData({ + isChangePhone: false, + }) + }, + + // 取消更改 + cancelChangePhone() { + this.setData({ + isChangePhone: false, + phone: this.data.tempPhone + }) + }, + + // 更改tab栏 + changeTabs(e) { + console.log(e, 'changeTabs'); + this.setData({ + tabIndex: e.target.id, + code: '', + password: '' + }) + }, + + // 支付安全设置 + securityChange(e) { + this.setData({ + pdwSwitch: e.detail.value * 1 + }) + }, + + // 扫描二维码 + goScanCode() { + console.log('scan!!!'); + const that = this + wx.scanCode({ + success: (res) => { + console.log(res, 'res'); + const num = res.result + that.setData({ + code: num + }) + that.exchange({ detail: { value: num } }) + }, + fail: (res) => { + console.log(res, 'fail'); + } + }) + }, + + // 检查用户登录状态 + checkPhoneStatus() { + let that = this; + Http.get({ + url: config.api.checkPhoneStatus, + }) + .then(res => { + + }) + .catch(err => { + if (err.code == 11005) { + // 手机号没有授权,将值传到用户手机号授权的页面 + wx.redirectTo({ + url: "/pages/getphoneInfo/index", + }) + } else { + wx.showToast({ + title: err.message, + icon: 'none', + duration: 2500 + }) + } + }) + }, + onLoad() { + setTimeout(() => { + this.checkPhoneStatus() + }, 2000); + } +}) diff --git a/pages/exchangeCard/exchangeCard.json b/pages/exchangeCard/exchangeCard.json new file mode 100644 index 0000000..88eeb8e --- /dev/null +++ b/pages/exchangeCard/exchangeCard.json @@ -0,0 +1,5 @@ +{ + "usingComponents": { + "navbar": "../../components/navbar/navbar" + } +} \ No newline at end of file diff --git a/pages/exchangeCard/exchangeCard.wxml b/pages/exchangeCard/exchangeCard.wxml new file mode 100644 index 0000000..cc00d00 --- /dev/null +++ b/pages/exchangeCard/exchangeCard.wxml @@ -0,0 +1,54 @@ + + + + + + 绑定 + 转增 + + +
+ + + + + +
+ + + 持卡人姓名:{{name}} + 持卡人手机号:{{phone}} 更改 + + 持卡人手机号: + + 确定 + 取消 + + + + 支付安全设置: + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pages/exchangeCard/exchangeCard.wxss b/pages/exchangeCard/exchangeCard.wxss new file mode 100644 index 0000000..f5f6f36 --- /dev/null +++ b/pages/exchangeCard/exchangeCard.wxss @@ -0,0 +1,121 @@ +/* pages/exchange/exchange.wxss */ +.section { + padding: 20rpx 20rpx; +} + +.section { + position: relative; + display: flex; + flex: 5; +} + +.section input { + flex: 3; + border: 1px solid #ccc; + border-radius: 10rpx; + height: 70rpx; + line-height: 70rpx; + font-size: 30rpx; + padding-left: 20rpx; + margin-right: 10rpx; +} + +.section button { + flex: 1; + height: 74rpx; + line-height: 74rpx; + font-size: 30rpx; +} + +.section .scan { + position: absolute; + right: 255rpx; + bottom: 37rpx; + width: 40rpx; + height: 40rpx; + z-index: 999; +} + +.comment { + padding: 0 20rpx; + margin-top: 60rpx; +} + +.comment text { + display: block; +} + +.opcaity { + opacity: .6; +} + +.tab { + display: flex; + justify-content: space-around; + margin-bottom: 25rpx; + z-index: 999; + height: 60rpx; +} + +.tab .tabItem { + width: 100rpx; + text-align: center; + padding-bottom: 15rpx; + transition: all .3s; +} + +.tabItem.active { + font-size: 35rpx; + color: #fd832d; + border-bottom: 5rpx solid #fd832d; +} + +.infoCard { + width: 90%; + text-align: left; + padding: 25rpx 25rpx 5rpx 25rpx; + font-size: 32rpx; + background-color: #fff; + margin: 10rpx auto; + border-radius: 15rpx; +} + +.infoCard view { + margin-bottom: 35rpx; +} + +.infoCard .phone .changePhone, +.infoCard .phone .confirmPhone { + color: #09bb07; +} + +.infoCard .phone .cancelChangePhone { + color: #fd832d; + margin-left: 15rpx; +} + +.infoCard .phone { + position: relative; +} + +.infoCard .phone .phoneInput { + position: relative; + top: 8rpx; + display: inline-block; + width: 240rpx; +} + +.infoCard .radioGroup { + display: inline-block; +} + +.infoCard .pwdBox { + border: 1px solid #5c5c5c; + padding: 15rpx; + border-radius: 15rpx; +} + +.btns { + margin-top: 50rpx; + padding: 0 40rpx; +} \ No newline at end of file diff --git a/pages/getphoneInfo/index.js b/pages/getphoneInfo/index.js index 61e8a15..48007df 100755 --- a/pages/getphoneInfo/index.js +++ b/pages/getphoneInfo/index.js @@ -249,6 +249,11 @@ Page({ } }); } + if (that.data.path == 'exchangeCard') { + wx.navigateTo({ + url: `/pages/exchangeCard/exchangeCard` + }) + } }).catch(err => { wx.showToast({ title: err.message, diff --git a/pages/index/index.js b/pages/index/index.js index 60ee758..1fb6e4b 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -77,6 +77,8 @@ Page({ options.id = this.data.newArr[2]; } else if (options.type == 'ts') { options.id = this.data.newArr[2]; + } else if (options.type == 'ts') { + options.id = this.data.newArr[2]; } } } @@ -344,6 +346,13 @@ Page({ url: '/pages/discountCardList/discountCardList' }) } + // 录入电子卡 + else if (app.globalData.type == 'se') { + // 录入电子卡 + wx.redirectTo({ + url: '/pages/exchangeCard/exchangeCard' + }) + } //直播 else if (app.globalData.type == 'zb') { wx.redirectTo({ @@ -533,6 +542,13 @@ Page({ url: '/pages/discountCardList/discountCardList' }) } + // 录入电子卡 + else if (app.globalData.type == 'se') { + // 录入电子卡 + wx.redirectTo({ + url: '/pages/exchangeCard/exchangeCard' + }) + } // 兑换 else if (app.globalData.type == 'ec') { wx.redirectTo({ diff --git a/project.config.json b/project.config.json index 9dda0a2..e4bfda1 100644 --- a/project.config.json +++ b/project.config.json @@ -35,7 +35,7 @@ }, "compileType": "miniprogram", "libVersion": "2.11.2", - "appid": "wx453ae0d37f3550d0", + "appid": "wxfa336cad86ed598d", "projectname": "C", "simulatorType": "wechat", "simulatorPluginLibVersion": {}, diff --git a/project.private.config.json b/project.private.config.json index 92562bc..dfeade4 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -8,5 +8,17 @@ "useIsolateContext": true }, "libVersion": "2.11.2", - "condition": {} + "condition": { + "miniprogram": { + "list": [ + { + "name": "exchangeCard", + "pathName": "pages/exchangeCard/exchangeCard", + "query": "", + "launchMode": "default", + "scene": null + } + ] + } + } } \ No newline at end of file