Commit faa8d6f9 authored by wangxuelai's avatar wangxuelai

''

parent 3f428277
......@@ -12,7 +12,7 @@
<view class="checkpeople">兑换人: {{item.nickname}}</view>
<view wx:if="{{item.verify_status==1}}" class="checkstatus">待核销</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>
......
......@@ -17,6 +17,10 @@ import {
pointsGoodsGet,
pointsGoodDelate
} from '../../../service/business/points.js';
import {
getExchangeUser,
exchangeOperate
} from '../../../service/business/integral.js';
var app = getApp();
Page({
......@@ -33,7 +37,12 @@ Page({
choiceBoxShow: false,
pointsGoodsList: [],//商品列表
pointsCardList: [],//积分列表
pointsGoodsTotalList: []
pointsGoodsTotalList: [],
exchangeInfo: {
},
exchangeDia: false,
exchangeing: false
},
/**
......@@ -47,6 +56,7 @@ Page({
sid,
})
wx.hideShareMenu();
// this.getExchangeUser();
},
/**
......@@ -212,9 +222,7 @@ Page({
pointsCardList: data.list.filter(item=>item.type==2),
})
}else{
}
}
})
},
......@@ -246,54 +254,74 @@ Page({
}).then(() => {
})
},
chooseImg() {
let access = {};
let filename = '';
cOssAccess().then((acc) => {
access = acc.data;
return wxChooseImage({})
getExchangeUser (verifyCode) {
wx.showLoading({
title: '信息查询中...'
})
getExchangeUser({
school_id: this.data.sid,
verify_code: verifyCode
}).then((res) => {
const {
tempFiles
} = res;
filename = `${access.dir}${getRandomFilename(tempFiles[0].path)}`;
wx.showLoading({
title: '图片上传中'
})
return wxUploadFile({
url: access.host,
formData: {
key: filename,
policy: access.policy,
OSSAccessKeyId: access.accessid,
signature: access.signature,
callback: access.callback,
success_action_status: '200'
},
filePath: tempFiles[0].path,
name: 'file',
})
const {code, data} = res;
wx.hideLoading();
if (code == 200) {
if (data.verify_status == 2) {
wx.showModal({
title: '温馨提示',
content: '该奖品已核销',
showCancel: false
})
return;
}
this.setData({
exchangeDia: true,
exchangeInfo: data
})
}
}).catch((res) => {
wx.hideLoading();
})
},
sureExchange () {
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) => {
const {
data
} = res;
if (data == '{"status":"ok"}') {
const {code, data} = res;
this.data.exchangeing = false;
if (code == 200) {
wx.showToast({
title: '上传成功'
title: '核销成功'
})
this.setData({
img: filename
})
} else {
wx.hideLoading();
wx.showModal({
title: '提示',
content: '上传失败',
showCancel: false
exchangeDia: false,
})
}
}).catch((err) => {
});
}).catch(() => {
wx.hideLoading();
this.data.exchangeing = false;
})
},
hideDialog () {
this.setData({
exchangeDia: false,
})
},
quickExchange () {
const that = this;
wx.scanCode({
success (res) {
const {result} = res;
that.getExchangeUser(result);
}
})
}
})
\ No newline at end of file
......@@ -19,7 +19,7 @@
</view>
<view class="btnname" hover-class="none" hover-stop-propagation="false">兑换记录</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">
<image class="icon scan" src="{{localImageRoot}}2b/scoremgt/scan.png?{{imageVersion}}" mode="aspectFit|aspectFill|widthFix" lazy-load="false" binderror="" bindload=""></image>
</view>
......@@ -80,7 +80,6 @@
</view>
<view class="empty-text" hover-class="none" hover-stop-propagation="false">您还没有添加奖品~</view>
</view>
<view class="choice-boxWrap" wx:if="{{choiceBoxShow}}">
<view class="choice-boxMask" bindtap="closeChoiceBox"></view>
<view class="choice-box">
......@@ -94,4 +93,17 @@
</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>
\ No newline at end of file
......@@ -291,3 +291,65 @@ page{
.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 = {
integralRulesUpdate: `${api}member/integral_rules/update`,
goodsAdd: `${api}member/integral_goods/store`,
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: {
teachersList: `${api}member/teachers`,
......
......@@ -59,11 +59,31 @@ function goodsShow (data) {
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 {
integralRulesAdd,
integralRulesShow,
integralRulesUpdate,
goodsAdd,
goodsUpdate,
goodsShow
goodsShow,
getExchangeUser,
exchangeOperate
}
\ No newline at end of file
......@@ -11,9 +11,9 @@
<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.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>
</view>
</view> -->
</view>
</view>
</view>
......
......@@ -27,6 +27,9 @@ Page({
// tid: options.tid,
sid: options.sid || 0,
});
},
onShow () {
this.setData({
page: 1,
hasmore: true,
......
{
"navigationBarTitleText": "兑换记录",
"enablePullDownRefresh": true,
"usingComponents": {
"list-loading": "../../../components/listloading"
}
......
......@@ -75,7 +75,8 @@ function wxRequest ({url, data, header, method, dataType, responseType, errorres
}
wx.showModal({
title: '提示',
content: messages[data.code] || `${data.code}`,
// content: messages[data.code] || `${data.code}`,
content: data.msg,
showCancel: false,
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