Commit ac611249 authored by youjie's avatar youjie

优惠券 领取中心

parent 0c6242aa
......@@ -59,6 +59,9 @@
.items-center{
align-items: center;
}
.justify-center{
justify-content: center;
}
.flex1,.col{
flex: 1;
}
......
......@@ -203,7 +203,13 @@
{
"root": "pages/coupon",
"pages": [{
"path": "list/list"
"path": "list/list",
"style": {
"navigationStyle": "custom"
},
"globalStyle": {
"navigationStyle": "custom"
}
},
{
"path": "details/details",
......
......@@ -46,11 +46,20 @@
<view class="cdTiaojianBRight">
<view class="cdTiaojianBRTitle">使用说明</view>
<view class="cdTiaojianBRText">券类型:{{ g.couponsType==1?'抵用券':'折扣券' }}</view>
<view class="cdTiaojianBRText">使用范围:{{ g.couponsUseScopeName }}</view>
<view class="cdTiaojianBRText">使用范围:
<template v-if="g.couponsUseScopeName">
{{ g.couponsUseScopeName }}
</template>
<template v-if="g.couponsUseScope">
{{ g.couponsUseScope }}
</template>
</view>
<view class="cdTiaojianBRText" v-if="g.remark&&g.remark!=''">备注:{{ g.remark }}</view>
</view>
</view>
<view class="cdTiaojianButtom" @click="gouseUrl(g)">立即使用</view>
<view class="cdTiaojianButtom" v-if="type==1" @click="gouseUrl(g)">立即使用</view>
<view class="cdTiaojianButtom" v-else @click="g.couponReceiveCount==0?receive(g.couponReceiveCount):gouseUrl(g)">{{ g.couponReceiveCount==0?'立即领取':'立即使用' }}</view>
</view>
</view>
</template>
......@@ -98,26 +107,27 @@
console.log("this.g", this.g);
},
methods: {
receive(id) {
this.request2({
url: '/api/AppletUser/GrantCoupon',
data: {
CouponId: id
}
},
(res) => {
if (res.resultCode == 1) {
uni.showToast({
title: res.message,
icon: "none"
});
this.g.IsReceive = 1;
}
receive(id){
this.apipost("b2c_post_CustomerGrantCoupon", {
Id: id
}, (res) => {
if (res.resultCode == 1) {
uni.showToast({
title: res.message,
icon: "none"
});
this.g.couponReceiveCount=1;
}
);
}, (failed) => {
uni.showToast({
title: failed.message,
icon: "none",
});
}, (error) => {
})
},
gouseUrl(g) {
uni.redirectTo({
url: '/pages/index/index'
......
This diff is collapsed.
......@@ -148,6 +148,29 @@ function VersionUpdate() {
}
}
//方法二
function formatDates(date, fmt) {
if (/(y+)/.test(fmt)) {
fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
}
let o = {
'M+': date.getMonth() + 1,
'd+': date.getDate(),
'h+': date.getHours(),
'm+': date.getMinutes(),
's+': date.getSeconds()
};
for (let k in o) {
if (new RegExp(`(${k})`).test(fmt)) {
let str = o[k] + '';
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? str : padLeftZero(str));
}
}
return fmt;
};
function padLeftZero(str) {
return ('00' + str).substr(str.length);
}
export default {
calcContentHeight,
SystemInfo,
......@@ -157,4 +180,5 @@ export default {
SubscribeMsgAli,
// #endif
VersionUpdate,
formatDates,
}
\ No newline at end of file
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