Commit ac611249 authored by youjie's avatar youjie

优惠券 领取中心

parent 0c6242aa
...@@ -59,6 +59,9 @@ ...@@ -59,6 +59,9 @@
.items-center{ .items-center{
align-items: center; align-items: center;
} }
.justify-center{
justify-content: center;
}
.flex1,.col{ .flex1,.col{
flex: 1; flex: 1;
} }
......
...@@ -203,7 +203,13 @@ ...@@ -203,7 +203,13 @@
{ {
"root": "pages/coupon", "root": "pages/coupon",
"pages": [{ "pages": [{
"path": "list/list" "path": "list/list",
"style": {
"navigationStyle": "custom"
},
"globalStyle": {
"navigationStyle": "custom"
}
}, },
{ {
"path": "details/details", "path": "details/details",
......
...@@ -46,11 +46,20 @@ ...@@ -46,11 +46,20 @@
<view class="cdTiaojianBRight"> <view class="cdTiaojianBRight">
<view class="cdTiaojianBRTitle">使用说明</view> <view class="cdTiaojianBRTitle">使用说明</view>
<view class="cdTiaojianBRText">券类型:{{ g.couponsType==1?'抵用券':'折扣券' }}</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 class="cdTiaojianBRText" v-if="g.remark&&g.remark!=''">备注:{{ g.remark }}</view>
</view> </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>
</view> </view>
</template> </template>
...@@ -98,26 +107,27 @@ ...@@ -98,26 +107,27 @@
console.log("this.g", this.g); console.log("this.g", this.g);
}, },
methods: { methods: {
receive(id) { receive(id){
this.request2({ this.apipost("b2c_post_CustomerGrantCoupon", {
url: '/api/AppletUser/GrantCoupon', Id: id
data: { }, (res) => {
CouponId: id if (res.resultCode == 1) {
} uni.showToast({
}, title: res.message,
(res) => { icon: "none"
if (res.resultCode == 1) { });
uni.showToast({ this.g.couponReceiveCount=1;
title: res.message,
icon: "none"
});
this.g.IsReceive = 1;
}
} }
); }, (failed) => {
uni.showToast({
title: failed.message,
icon: "none",
});
}, (error) => {
})
}, },
gouseUrl(g) { gouseUrl(g) {
uni.redirectTo({ uni.redirectTo({
url: '/pages/index/index' url: '/pages/index/index'
......
This diff is collapsed.
...@@ -148,6 +148,29 @@ function VersionUpdate() { ...@@ -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 { export default {
calcContentHeight, calcContentHeight,
SystemInfo, SystemInfo,
...@@ -157,4 +180,5 @@ export default { ...@@ -157,4 +180,5 @@ export default {
SubscribeMsgAli, SubscribeMsgAli,
// #endif // #endif
VersionUpdate, 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