Commit faa8d6f9 authored by wangxuelai's avatar wangxuelai

''

parent 3f428277
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<view class="checkpeople">兑换人: {{item.nickname}}</view> <view class="checkpeople">兑换人: {{item.nickname}}</view>
<view wx:if="{{item.verify_status==1}}" class="checkstatus">待核销</view> <view wx:if="{{item.verify_status==1}}" class="checkstatus">待核销</view>
</view> </view>
<image class="checkstatus-icon" wx:if="{{item.verify_status==2}}" src="{{localImageRoot}}2b/rulesrecord/record_checked.png?{{imageVersion}}" mode="aspectFit|aspectFill|widthFix"></image> <image class="checkstatus-icon" wx:if="{{item.verify_status==2}}" src="{{localImageRoot}}2c/mall/hasexchange.png?{{imageVersion}}" mode="aspectFit|aspectFill|widthFix"></image>
</view> </view>
</view> </view>
</view> </view>
......
...@@ -17,6 +17,10 @@ import { ...@@ -17,6 +17,10 @@ import {
pointsGoodsGet, pointsGoodsGet,
pointsGoodDelate pointsGoodDelate
} from '../../../service/business/points.js'; } from '../../../service/business/points.js';
import {
getExchangeUser,
exchangeOperate
} from '../../../service/business/integral.js';
var app = getApp(); var app = getApp();
Page({ Page({
...@@ -33,7 +37,12 @@ Page({ ...@@ -33,7 +37,12 @@ Page({
choiceBoxShow: false, choiceBoxShow: false,
pointsGoodsList: [],//商品列表 pointsGoodsList: [],//商品列表
pointsCardList: [],//积分列表 pointsCardList: [],//积分列表
pointsGoodsTotalList: [] pointsGoodsTotalList: [],
exchangeInfo: {
},
exchangeDia: false,
exchangeing: false
}, },
/** /**
...@@ -47,6 +56,7 @@ Page({ ...@@ -47,6 +56,7 @@ Page({
sid, sid,
}) })
wx.hideShareMenu(); wx.hideShareMenu();
// this.getExchangeUser();
}, },
/** /**
...@@ -212,9 +222,7 @@ Page({ ...@@ -212,9 +222,7 @@ Page({
pointsCardList: data.list.filter(item=>item.type==2), pointsCardList: data.list.filter(item=>item.type==2),
}) })
}else{ }else{
} }
} }
}) })
}, },
...@@ -246,54 +254,74 @@ Page({ ...@@ -246,54 +254,74 @@ Page({
}).then(() => { }).then(() => {
}) })
}, },
chooseImg() { getExchangeUser (verifyCode) {
let access = {};
let filename = '';
cOssAccess().then((acc) => {
access = acc.data;
return wxChooseImage({})
}).then((res) => {
const {
tempFiles
} = res;
filename = `${access.dir}${getRandomFilename(tempFiles[0].path)}`;
wx.showLoading({ wx.showLoading({
title: '图片上传中' title: '信息查询中...'
}) })
return wxUploadFile({ getExchangeUser({
url: access.host, school_id: this.data.sid,
formData: { verify_code: verifyCode
key: filename, }).then((res) => {
policy: access.policy, const {code, data} = res;
OSSAccessKeyId: access.accessid, wx.hideLoading();
signature: access.signature, if (code == 200) {
callback: access.callback, if (data.verify_status == 2) {
success_action_status: '200' wx.showModal({
title: '温馨提示',
content: '该奖品已核销',
showCancel: false
})
return;
}
this.setData({
exchangeDia: true,
exchangeInfo: data
})
}
}).catch((res) => {
wx.hideLoading();
})
}, },
filePath: tempFiles[0].path, sureExchange () {
name: 'file', if (this.data.exchangeing) {
return;
}
this.data.exchangeing = true;
wx.showLoading({
title: '核销zhong...'
}) })
exchangeOperate({
goods_id: this.data.exchangeInfo.good.id,
verify_code: this.data.exchangeInfo.verify_code,
school_id: this.data.sid
}).then((res) => { }).then((res) => {
const { const {code, data} = res;
data this.data.exchangeing = false;
} = res; if (code == 200) {
if (data == '{"status":"ok"}') {
wx.showToast({ wx.showToast({
title: '上传成功' title: '核销成功'
}) })
this.setData({ this.setData({
img: filename exchangeDia: false,
}) })
} else { }
}).catch(() => {
wx.hideLoading(); wx.hideLoading();
wx.showModal({ this.data.exchangeing = false;
title: '提示', })
content: '上传失败', },
showCancel: false hideDialog () {
this.setData({
exchangeDia: false,
}) })
},
quickExchange () {
const that = this;
wx.scanCode({
success (res) {
const {result} = res;
that.getExchangeUser(result);
} }
}).catch((err) => { })
});
} }
}) })
\ No newline at end of file
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
</view> </view>
<view class="btnname" hover-class="none" hover-stop-propagation="false">兑换记录</view> <view class="btnname" hover-class="none" hover-stop-propagation="false">兑换记录</view>
</view> </view>
<view class="btnitem" hover-class="none" hover-stop-propagation="false"> <view class="btnitem" hover-class="none" hover-stop-propagation="false" bindtap="quickExchange">
<view class="iconbox" hover-class="none" hover-stop-propagation="false"> <view class="iconbox" hover-class="none" hover-stop-propagation="false">
<image class="icon scan" src="{{localImageRoot}}2b/scoremgt/scan.png?{{imageVersion}}" mode="aspectFit|aspectFill|widthFix" lazy-load="false" binderror="" bindload=""></image> <image class="icon scan" src="{{localImageRoot}}2b/scoremgt/scan.png?{{imageVersion}}" mode="aspectFit|aspectFill|widthFix" lazy-load="false" binderror="" bindload=""></image>
</view> </view>
...@@ -80,7 +80,6 @@ ...@@ -80,7 +80,6 @@
</view> </view>
<view class="empty-text" hover-class="none" hover-stop-propagation="false">您还没有添加奖品~</view> <view class="empty-text" hover-class="none" hover-stop-propagation="false">您还没有添加奖品~</view>
</view> </view>
<view class="choice-boxWrap" wx:if="{{choiceBoxShow}}"> <view class="choice-boxWrap" wx:if="{{choiceBoxShow}}">
<view class="choice-boxMask" bindtap="closeChoiceBox"></view> <view class="choice-boxMask" bindtap="closeChoiceBox"></view>
<view class="choice-box"> <view class="choice-box">
...@@ -94,4 +93,17 @@ ...@@ -94,4 +93,17 @@
</view> </view>
</view> </view>
</view> </view>
<view class="exchangeinfodialog" hover-class="none" hover-stop-propagation="false" wx:if="{{exchangeDia}}">
<view class="dialogcontent" hover-class="none" hover-stop-propagation="false">
<view class="exchange-name" hover-class="none" hover-stop-propagation="false">兑奖人:{{exchangeInfo.nickname}}</view>
<view class="goodinfo" hover-class="none" hover-stop-propagation="false">
<view class="lefttitle" hover-class="none" hover-stop-propagation="false">商品:</view>
<view class="goodtitle" hover-class="none" hover-stop-propagation="false">{{exchangeInfo.good.title}}</view>
</view>
<view class="bottombtn" hover-class="none" hover-stop-propagation="false">
<view class="btn cancel" hover-class="none" hover-stop-propagation="false" bindtap="hideDialog">取消</view>
<view class="btn sure" hover-class="none" hover-stop-propagation="false" bindtap="sureExchange">确认兑换</view>
</view>
</view>
</view>
</view> </view>
\ No newline at end of file
...@@ -291,3 +291,65 @@ page{ ...@@ -291,3 +291,65 @@ page{
.choice-boxWrap .choice-box .choice-item .item-name{ .choice-boxWrap .choice-box .choice-item .item-name{
} }
@keyframes fadeIn {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
.exchangeinfodialog {
position: fixed;
width: 100%;
height: 100%;
left: 0;
top: 0;
z-index: 99;
background-color: rgba(0,0,0,0.5);
display: flex;
align-items: center;
justify-content: center;
animation: fadeIn 0.5s linear 1 forwards;
}
.dialogcontent {
width: 600rpx;
background-color: #fff;
border-radius: 20rpx;
}
.bottombtn {
display: flex;
align-items: center;
border-top: 2rpx solid rgba(0,0,0,0.05);
}
.bottombtn .btn{
flex: 1;
height: 100rpx;
text-align: center;
line-height: 100rpx;
}
.bottombtn .btn.cancel {
border-right: 2rpx solid rgba(0,0,0,0.05);
}
.exchange-name {
padding: 50rpx 0 75rpx 0;
text-align: center;
color: #000;
font-weight: 700;
font-size: 32rpx;
}
.goodinfo {
width: 380rpx;
margin: 0 auto 28rpx;
display: flex;
/* align-items: center */
}
.lefttitle {
width: 70rpx;
font-size: 26rpx;
}
.goodtitle {
font-size: 26rpx;
width: 310rpx;
word-break: break-all;
}
\ No newline at end of file
...@@ -159,7 +159,9 @@ const apis = { ...@@ -159,7 +159,9 @@ const apis = {
integralRulesUpdate: `${api}member/integral_rules/update`, integralRulesUpdate: `${api}member/integral_rules/update`,
goodsAdd: `${api}member/integral_goods/store`, goodsAdd: `${api}member/integral_goods/store`,
goodsUpdate: `${api}member/integral_goods/update`, goodsUpdate: `${api}member/integral_goods/update`,
goodsShow: `${api}member/integral_goods/show` goodsShow: `${api}member/integral_goods/show`,
getExchangeUser: `${api}member/integral_goods/code_exchange`,
exchangeOperate: `${api}member/integral_goods/verify_status`
}, },
teachermgt: { teachermgt: {
teachersList: `${api}member/teachers`, teachersList: `${api}member/teachers`,
......
...@@ -59,11 +59,31 @@ function goodsShow (data) { ...@@ -59,11 +59,31 @@ function goodsShow (data) {
errorresolve: 1, errorresolve: 1,
}) })
} }
function getExchangeUser (data) {
return wxRequest({
role: '2b',
url: apis.business.integral.getExchangeUser,
data,
method: 'GET',
errorresolve: 1,
})
}
function exchangeOperate (data) {
return wxRequest({
role: '2b',
url: apis.business.integral.exchangeOperate,
data,
method: 'POST',
errorresolve: 1,
})
}
export { export {
integralRulesAdd, integralRulesAdd,
integralRulesShow, integralRulesShow,
integralRulesUpdate, integralRulesUpdate,
goodsAdd, goodsAdd,
goodsUpdate, goodsUpdate,
goodsShow goodsShow,
getExchangeUser,
exchangeOperate
} }
\ No newline at end of file
...@@ -11,9 +11,9 @@ ...@@ -11,9 +11,9 @@
<view class="person-name-box" hover-class="none" hover-stop-propagation="false"> <view class="person-name-box" hover-class="none" hover-stop-propagation="false">
<!-- <view class="name" selectable="false" space="false" decode="false">{{userInfo.remark}}</view> --> <!-- <view class="name" selectable="false" space="false" decode="false">{{userInfo.remark}}</view> -->
<view class="name" selectable="false" space="false" decode="false">{{userInfo.nickname}}</view> <view class="name" selectable="false" space="false" decode="false">{{userInfo.nickname}}</view>
<view class="editicon-box" hover-class="none" hover-stop-propagation="false" wx:if="{{selfCustomerId == consumerId}}"> <!-- <view class="editicon-box" hover-class="none" hover-stop-propagation="false" wx:if="{{selfCustomerId == consumerId}}">
<image class="editicon" src="{{imageRoot}}2c/common/bi.png?{{imageVersion}}" mode="aspectFit|aspectFill|widthFix" bindtap="remarkChange" lazy-load="false" binderror="" bindload="" ></image> <image class="editicon" src="{{imageRoot}}2c/common/bi.png?{{imageVersion}}" mode="aspectFit|aspectFill|widthFix" bindtap="remarkChange" lazy-load="false" binderror="" bindload="" ></image>
</view> </view> -->
</view> </view>
</view> </view>
</view> </view>
......
...@@ -27,6 +27,9 @@ Page({ ...@@ -27,6 +27,9 @@ Page({
// tid: options.tid, // tid: options.tid,
sid: options.sid || 0, sid: options.sid || 0,
}); });
},
onShow () {
this.setData({ this.setData({
page: 1, page: 1,
hasmore: true, hasmore: true,
......
{ {
"navigationBarTitleText": "兑换记录", "navigationBarTitleText": "兑换记录",
"enablePullDownRefresh": true,
"usingComponents": { "usingComponents": {
"list-loading": "../../../components/listloading" "list-loading": "../../../components/listloading"
} }
......
...@@ -75,7 +75,8 @@ function wxRequest ({url, data, header, method, dataType, responseType, errorres ...@@ -75,7 +75,8 @@ function wxRequest ({url, data, header, method, dataType, responseType, errorres
} }
wx.showModal({ wx.showModal({
title: '提示', title: '提示',
content: messages[data.code] || `${data.code}`, // content: messages[data.code] || `${data.code}`,
content: data.msg,
showCancel: false, showCancel: false,
confirm: true confirm: true
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment