Przeglądaj źródła

[兑换][增加]:[小程序增加兑换消费卡的功能]

tags/福建版C.9.1.08欢乐城
meo 5 lat temu
rodzic
commit
9927922566
7 zmienionych plików z 107 dodań i 80 usunięć
  1. +2
    -1
      config/config.js
  2. +13
    -12
      ext.json
  3. +78
    -57
      pages/exchange/exchange.js
  4. +6
    -4
      pages/exchange/exchange.wxml
  5. +6
    -4
      pages/exchange/exchange.wxss
  6. +1
    -1
      project.config.json
  7. +1
    -1
      utils/imgurl.js

+ 2
- 1
config/config.js Wyświetl plik

@@ -312,7 +312,8 @@ var config = {
activitySign:"/wxActivityJoin/sign", activitySign:"/wxActivityJoin/sign",
activityList: "/wxActivityJoin/list", activityList: "/wxActivityJoin/list",
//获取未支付的订单 //获取未支付的订单
getUnPaidOrder: "/order/getUnPaidOrder"
getUnPaidOrder: "/order/getUnPaidOrder",
getCouponOrderByPassword:'/couponPassword/getCouponOrderByPassword'
}, },
weapp: { weapp: {
AppId: weappId AppId: weappId


+ 13
- 12
ext.json Wyświetl plik

@@ -3,29 +3,30 @@
"attr": { "attr": {
"imgProxy": [ "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" "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" "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" "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", "ifStoreApp": "0",
"etcpVersion": "release", "etcpVersion": "release",
"etcpCallbackUrl": "https://admin.malls.iformall.com/api/carCallback/etcpPaidCallback",
"etcpCallbackUrl": "https://ciformall.youlane.cn/api/carCallback/etcpPaidCallback",
"ifHaveWebSocket": "0", "ifHaveWebSocket": "0",
"ifHaveCarModular": "1" "ifHaveCarModular": "1"
}, },
"name": "富茂链客生产版",
"weappId": "wx6a2524a8286d687f",
"appVersion": "C.5.1.1"
"name": "富茂客官开发",
"weappId": "wxea71200db93d756b",
"appVersion": "C.4.5.106"
}, },
"debug": false, "debug": false,
"tabBar": { "tabBar": {
@@ -60,10 +61,10 @@
"window": { "window": {
"backgroundTextStyle": "dark", "backgroundTextStyle": "dark",
"navigationBarTextStyle": "black", "navigationBarTextStyle": "black",
"navigationBarTitleText": "",
"navigationBarBackgroundColor": "#FFFFFF"
"navigationBarTitleText": "WeChat",
"navigationBarBackgroundColor": "#fff"
}, },
"extAppid": "wx6a2524a8286d687f",
"extAppid": "wxea71200db93d756b",
"extEnable": true, "extEnable": true,
"permission": { "permission": {
"scope.userLocation": { "scope.userLocation": {


+ 78
- 57
pages/exchange/exchange.js Wyświetl plik

@@ -11,64 +11,85 @@ Page({
data: { data: {
navigationBarHeight navigationBarHeight
}, },

/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {

},

/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {

},

/**
* 生命周期函数--监听页面显示
*/
onShow: function () {

},

/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {

},

/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {

},

/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {

},

/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {

},

/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {

},
// 兑换 // 兑换
exchange(e){ 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
})
})
} }
}) })

+ 6
- 4
pages/exchange/exchange.wxml Wyświetl plik

@@ -1,8 +1,10 @@
<navbar text="兑换" home back background='#FD832D' color="white"></navbar> <navbar text="兑换" home back background='#FD832D' color="white"></navbar>
<view class="section" style="padding-top:{{navigationBarHeight}};">
<input placeholder="请输入兑换码" clearable/>
<button type="text" size="{{primarySize}}" style="background:#FD832D;color:#fff;" bindtap="exchange">兑换</button>
</view>
<form bindsubmit='exchange' report-submit='true'>
<view class="section" style="padding-top:{{navigationBarHeight}};">
<input name='code'placeholder="请输入兑换码" clearable/>
<button size="{{primarySize}}" style="background:#FD832D;color:#fff;" form-type="submit">兑换</button>
</view>
</form>
<view class="comment"> <view class="comment">
<text class="txt1">如何获取兑换码?</text> <text class="txt1">如何获取兑换码?</text>
<text class="txt2">1.实体卡卡密可刮开卡背面涂层查看;</text> <text class="txt2">1.实体卡卡密可刮开卡背面涂层查看;</text>


+ 6
- 4
pages/exchange/exchange.wxss Wyświetl plik

@@ -1,11 +1,13 @@
/* pages/exchange/exchange.wxss */ /* pages/exchange/exchange.wxss */
.section{ .section{
display: flex;
padding: 0 20rpx; padding: 0 20rpx;
}
.section{
display: flex;
flex: 5; flex: 5;
} }
.section input{
flex: 4;
.section input{
flex: 3;
border: 1px solid #ccc; border: 1px solid #ccc;
border-radius: 10rpx; border-radius: 10rpx;
height: 70rpx; height: 70rpx;
@@ -14,7 +16,7 @@
padding-left: 20rpx; padding-left: 20rpx;
margin-right: 10rpx; margin-right: 10rpx;
} }
.section button{
.section button{
flex: 1; flex: 1;
height: 74rpx; height: 74rpx;
line-height: 74rpx; line-height: 74rpx;


+ 1
- 1
project.config.json Wyświetl plik

@@ -14,7 +14,7 @@
}, },
"compileType": "miniprogram", "compileType": "miniprogram",
"libVersion": "2.5.0", "libVersion": "2.5.0",
"appid": "wx453ae0d37f3550d0",
"appid": "wxb11603577a84a86d",
"projectname": "C%E7%AB%AF%E5%B0%8F%E7%A8%8B%E5%BA%8F", "projectname": "C%E7%AB%AF%E5%B0%8F%E7%A8%8B%E5%BA%8F",
"isGameTourist": false, "isGameTourist": false,
"simulatorType": "wechat", "simulatorType": "wechat",


+ 1
- 1
utils/imgurl.js Wyświetl plik

@@ -586,7 +586,7 @@ module.exports = {
'name': '拼团小图标' 'name': '拼团小图标'
}, },
'duihuan': { 'duihuan': {
'url': baseUrl + 'duihuan.png',
'url': baseUrl + 'exchange01.png',
'name': '兑换小图标' 'name': '兑换小图标'
}, },
'wangmeimeibargin':{ 'wangmeimeibargin':{


Ładowanie…
Anuluj
Zapisz