Commit c4979ed0 authored by 罗超's avatar 罗超

Merge branch 'master' of http://gitlab.oytour.com/zk123/jz_travel

# Conflicts:
#	asset/css/flex.css
#	plugin/utils.js
parents c04b6053 0c23764b
......@@ -203,7 +203,13 @@
{
"root": "pages/coupon",
"pages": [{
"path": "list/list"
"path": "list/list",
"style": {
"navigationStyle": "custom"
},
"globalStyle": {
"navigationStyle": "custom"
}
},
{
"path": "details/details",
......
This diff is collapsed.
......@@ -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'
......
......@@ -408,6 +408,7 @@
}
.couponStyle .item .miane .tiaojian {
width: 146rpx;
font-size: 24rpx;
text-align: center;
margin-top: 2px;
......
This diff is collapsed.
......@@ -17,12 +17,6 @@ function SystemInfo() {//获取屏幕宽高
})
return SystemInfo
}
function getWeekName(date) {
const weeks = ['周日','周一','周二','周三','周四','周五','周六']
const currentDate = new Date(date)
const i = currentDate.getDay()
return weeks[i]
}
function getRect(selector) {//获取元素的信息
return new Promise((resolve) => {
let view = uni.createSelectorQuery().select(selector);
......@@ -154,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,
......@@ -163,5 +180,5 @@ export default {
SubscribeMsgAli,
// #endif
VersionUpdate,
getWeekName
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