Commit e7a1cca4 authored by 黄奎's avatar 黄奎

11

parent bf0c39da
...@@ -209,7 +209,7 @@ ...@@ -209,7 +209,7 @@
that.apipost("LvXiaoYou_post_GetLvXiaoYouCustomerLogin", b2bLoginParam, b2bRes => { that.apipost("LvXiaoYou_post_GetLvXiaoYouCustomerLogin", b2bLoginParam, b2bRes => {
var b2bData = b2bRes.data; var b2bData = b2bRes.data;
if (b2bRes.resultCode == 1) { if (b2bRes.resultCode == 1) {
b2bResult.accountId = b2bData.accountId; b2bResult.accountId = b2bData.customerAccountId;
b2bResult.customerId = b2bData.customerId; b2bResult.customerId = b2bData.customerId;
b2bResult.customerInfoChildrenId=b2bData.customerInfoChildrenId; b2bResult.customerInfoChildrenId=b2bData.customerInfoChildrenId;
b2bResult.name = b2bData.name; b2bResult.name = b2bData.name;
......
...@@ -4,9 +4,6 @@ ...@@ -4,9 +4,6 @@
<Text class='cd_name'> <Text class='cd_name'>
{{g.Name}} {{g.Name}}
</Text> </Text>
<!-- <Text class='sub_price'>
{{g.sub_price}}
</Text> -->
<view style="display: flex;align-items: flex-end;"> <view style="display: flex;align-items: flex-end;">
<Text style='font-size: 32px;'>{{ g.DiscountsPrice }} </Text> <Text style='font-size: 32px;'>{{ g.DiscountsPrice }} </Text>
<Text style='font-size: 14px;'>{{g.CouponType==2?'折':""}}</Text> <Text style='font-size: 14px;'>{{g.CouponType==2?'折':""}}</Text>
...@@ -14,7 +11,6 @@ ...@@ -14,7 +11,6 @@
<Text class='condition'> <Text class='condition'>
{{g.MinConsumePrice }}可用 {{g.MinConsumePrice }}可用
</Text> </Text>
<!-- <Text v-if='g.type==1'>优惠上限:¥{{Number(g.MaxDiscountsPrice) }}</Text> -->
<view v-if='type==2 && g.IsReceive==0' class="receive" :style="{'background':mainColor}" @click="receive(g.CouponId)"> <view v-if='type==2 && g.IsReceive==0' class="receive" :style="{'background':mainColor}" @click="receive(g.CouponId)">
<Text> <Text>
...@@ -34,22 +30,20 @@ ...@@ -34,22 +30,20 @@
<!-- <Text class='cd_content' >{{g.StartDate}}-{{g.EndDate}}</Text> --> <!-- <Text class='cd_content' >{{g.StartDate}}-{{g.EndDate}}</Text> -->
<Text class='c_name' style='margin-top: 1px;'>使用规则</Text> <Text class='c_name' style='margin-top: 1px;'>使用规则</Text>
<Text class='cd_content' v-if='g.UseType==1'>适用类别: <Text v-for="(item, index) in g.ProductList" :key="index">{{item.Relevance}}</Text> </Text> <Text class='cd_content' v-if='g.UseType==1'>适用类别: <Text v-for="(item, index) in g.ProductList" :key="index">{{item.Relevance}}</Text>
<Text class='cd_content' v-if='g.UseType==2'>适用商品: <Text v-for="(item, index) in g.ProductList" :key="index">{{item.Relevance}}</Text> </Text> </Text>
<Text class='cd_content' v-if='g.UseType==2'>适用商品: <Text v-for="(item, index) in g.ProductList" :key="index">{{item.Relevance}}</Text>
</Text>
<Text class='cd_content' v-if='g.UseType==3'>适用范围:全场通用</Text> <Text class='cd_content' v-if='g.UseType==3'>适用范围:全场通用</Text>
<Text class='cd_content' v-if='g.UseType==4'>适用方式:当面付</Text> <Text class='cd_content' v-if='g.UseType==4'>适用方式:当面付</Text>
<Text class='c_name' style='margin-top: 1px;'>使用说明</Text> <Text class='c_name' style='margin-top: 1px;'>使用说明</Text>
<Text class='cd_content'>{{g.Describe}}</Text> <Text class='cd_content'>{{g.Describe}}</Text>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
export default {
export default {
data() { data() {
return { return {
pageTitle: "优惠券详情", pageTitle: "优惠券详情",
...@@ -57,10 +51,9 @@ export default { ...@@ -57,10 +51,9 @@ export default {
contentHeight: 0, contentHeight: 0,
g: [], g: [],
loading: false, loading: false,
coupon_id:0, coupon_id: 0,
isreceive:false, isreceive: false,
type:0,//type 1是优惠券列表来的 2 是领券中心来的 type: 0, //type 1是优惠券列表来的 2 是领券中心来的
}; };
}, },
created() { created() {
...@@ -70,9 +63,8 @@ export default { ...@@ -70,9 +63,8 @@ export default {
mounted() { mounted() {
let currentPages = getCurrentPages(); let currentPages = getCurrentPages();
let u = "/" + currentPages[currentPages.length - 1].route; let u = "/" + currentPages[currentPages.length - 1].route;
let pages = wx.getStorageSync("basedata") let pages = wx.getStorageSync("basedata") ?
? wx.getStorageSync("basedata").bar_title wx.getStorageSync("basedata").bar_title : [];
: [];
pages.forEach((x) => { pages.forEach((x) => {
if (x.value == u) { if (x.value == u) {
this.pageTitle = x.new_name ? x.new_name : x.name; this.pageTitle = x.new_name ? x.new_name : x.name;
...@@ -82,63 +74,49 @@ export default { ...@@ -82,63 +74,49 @@ export default {
title: this.pageTitle, title: this.pageTitle,
}); });
}, },
onLoad: function (option) { onLoad: function(option) {
this.type = option.type this.type = option.type
let item = JSON.parse(decodeURIComponent(option.item)) let item = JSON.parse(decodeURIComponent(option.item))
this.g = item this.g = item;
console.log("this.g",this.g);
}, },
methods: { methods: {
receive(id) {
receive(id){ this.request2({
this.request2(
{
url: '/api/AppletUser/GrantCoupon', url: '/api/AppletUser/GrantCoupon',
data: { data: {
CouponId:id CouponId: id
} }
}, },
(res) => { (res) => {
if(res.resultCode==1){ if (res.resultCode == 1) {
uni.showToast({ uni.showToast({
title: res.message, title: res.message,
icon: "none" icon: "none"
}); });
this.g.IsReceive=1; this.g.IsReceive = 1;
} }
} }
); );
}, },
gouseUrl(g){ gouseUrl(g) {
// let data = [] uni.redirectTo({
// if(g.UseType==1 || g.UseType==2){ url: '/pages/index/index'
// g.ProductList.forEach(x=>{ });
// data.push(x.ProductId)
// })
// let id = data.toString()
// uni.redirectTo({ url: '/pages/goods/list?coupon_id='+ id+'&UseType='+g.UseType });
// }else{
// uni.redirectTo({ url: '/pages/goods/list'});
// }
uni.redirectTo({ url: '/pages/index/index'});
} }
}, },
};
};
</script> </script>
<style> <style>
.coupondetailsStyle { .coupondetailsStyle {
width: 100%; width: 100%;
height: 100%; height: 100%;
background: #f3f4f6; background: #f3f4f6;
padding-top:10px ; padding-top: 10px;
} }
.coupondetailsStyle .cd_box{
.coupondetailsStyle .cd_box {
width: 94%; width: 94%;
border-radius: 10rpx; border-radius: 10rpx;
background: #fff; background: #fff;
...@@ -148,21 +126,25 @@ export default { ...@@ -148,21 +126,25 @@ export default {
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
padding: 10px; padding: 10px;
} }
.cd_box .cd_name{
.cd_box .cd_name {
font-size: 14px; font-size: 14px;
color: #82848a; color: #82848a;
margin-top: 30px; margin-top: 30px;
} }
.cd_box .sub_price{
.cd_box .sub_price {
font-size: 32px; font-size: 32px;
margin-top: 10px; margin-top: 10px;
} }
.cd_box .condition{
.cd_box .condition {
font-size: 16px; font-size: 16px;
margin-top: 5px; margin-top: 5px;
} }
.cd_box .receive{
.cd_box .receive {
width: 130px; width: 130px;
height: 30px; height: 30px;
display: flex; display: flex;
...@@ -172,8 +154,9 @@ export default { ...@@ -172,8 +154,9 @@ export default {
color: #fff; color: #fff;
margin-top: 15px; margin-top: 15px;
border-radius: 15px; border-radius: 15px;
} }
.cd_box .gouse{
.cd_box .gouse {
width: 130px; width: 130px;
height: 30px; height: 30px;
display: flex; display: flex;
...@@ -184,15 +167,17 @@ export default { ...@@ -184,15 +167,17 @@ export default {
margin-top: 15px; margin-top: 15px;
border-radius: 15px; border-radius: 15px;
background: #6995EE; background: #6995EE;
} }
.cd_box .c_name{
.cd_box .c_name {
width: 90%; width: 90%;
font-size: 14px; font-size: 14px;
color: #82848a; color: #82848a;
} }
.cd_box .cd_content{
.cd_box .cd_content {
padding: 15px 0; padding: 15px 0;
width: 90%; width: 90%;
font-size: 15px; font-size: 15px;
} }
</style> </style>
...@@ -2,22 +2,15 @@ ...@@ -2,22 +2,15 @@
<view class="couponStyle" :style="{ height: contentHeight }"> <view class="couponStyle" :style="{ height: contentHeight }">
<u-tabs :list="list" :is-scroll="false" :current="currentIndex" @change="change" :active-color="mainColor" :show-bar="showBar" <u-tabs :list="list" :is-scroll="false" :current="currentIndex" @change="change" :active-color="mainColor" :show-bar="showBar"
height="100"></u-tabs> height="100"></u-tabs>
<u-empty v-if="g.length == 0 && !loading" text="暂无相关优惠券" mode="coupon"></u-empty> <u-empty v-if="couponDataList.length == 0 && !loading" text="暂无相关优惠券" mode="coupon"></u-empty>
<view v-if="g.length > 0" style=" <view v-if="couponDataList.length > 0" style=" height: calc(100vh - 50px); width: calc(100vw); overflow: hidden;padding-bottom: 50px;">
height: calc(100vh - 50px);
width: calc(100vw);
overflow: hidden;
padding-bottom: 50px;
">
<scroll-view :scroll-y="true" :enable-back-to-top="true" :enable-flex="true" @scrolltolower="lower" :style="{ height: '100%' }"> <scroll-view :scroll-y="true" :enable-back-to-top="true" :enable-flex="true" @scrolltolower="lower" :style="{ height: '100%' }">
<view class="couponList"> <view class="couponList">
<view class="item" v-for="(x, i) in g" :key="i" @click="godetails(x)"> <view class="item" v-for="(x, i) in couponDataList" :key="i" @click="godetails(x)">
<view :class="{'ticket':msg.useState == 1,'ticket2':msg.useState != 1}"> <view :class="{'ticket':msg.CouponStatus == 1,'ticket2':msg.CouponStatus != 1}">
<view class="miane"> <view class="miane">
<view class="money"> <view class="money">
<!-- <text style="font-size: 44px;">{{x.sub_price.toString().split('.')[0]}}</text>
<text v-if="x.coupon.type==1"></text> -->
<text class="small" style="font-family: microsoft yahei ui light;" v-if="x.couponsType == 1"></text> <text class="small" style="font-family: microsoft yahei ui light;" v-if="x.couponsType == 1"></text>
<Text style="font-size: 44px;font-family: nav-font;">{{ Number(x.denomination) }} <Text style="font-size: 44px;font-family: nav-font;">{{ Number(x.denomination) }}
</Text> </Text>
...@@ -25,34 +18,13 @@ ...@@ -25,34 +18,13 @@
</view> </view>
<view class="tiaojian">{{ Number(x.useCondition) }}元可用</view> <view class="tiaojian">{{ Number(x.useCondition) }}元可用</view>
</view> </view>
<view style=" <view style="width: 10px;height: 10px; border-radius: 5px;background: #f3f4f6; position: absolute; right: -5px; top: -5px;"></view>
width: 10px; <view style=" width: 10px; height: 10px; border-radius: 5px; background: #f3f4f6; position: absolute; right: -5px; bottom: -5px; "></view>
height: 10px;
border-radius: 5px;
background: #f3f4f6;
position: absolute;
right: -5px;
top: -5px;
"></view>
<view style="
width: 10px;
height: 10px;
border-radius: 5px;
background: #f3f4f6;
position: absolute;
right: -5px;
bottom: -5px;
"></view>
</view> </view>
<view class="detail"> <view class="detail">
<view class="coupond"> <view class="coupond">
<view class="name" style="font-family:'microsoft yahei ui light';">{{ x.couponsName }}</view> <view class="name" style="font-family:'microsoft yahei ui light';">{{ x.couponName }}</view>
<view class="date">{{ x.expirationDate }} 失效</view> <view class="date">{{ x.expirationDate }} 失效</view>
<Text class="rule" v-if="x.lineTeamName!='' || x.lineName!=''">{{x.lineName}} {{x.lineTeamName}} 可用</Text>
<!-- <Text class="rule" v-if="x.UseTypeStr == 2">限商品</Text>
<Text class="rule" v-if="x.UseTypeStr == 3">全场通用</Text>
<Text class="rule" v-if="x.UseTypeStr == 4">当面付</Text> -->
</view> </view>
</view> </view>
</view> </view>
...@@ -61,22 +33,7 @@ ...@@ -61,22 +33,7 @@
<u-loadmore :status="status" :load-text="loadText" :font-size="24" :margin-top="20" :margin-bottom="20" bg-color="#f3f4f6" /> <u-loadmore :status="status" :load-text="loadText" :font-size="24" :margin-top="20" :margin-bottom="20" bg-color="#f3f4f6" />
</scroll-view> </scroll-view>
</view> </view>
<!-- <view
style="
width: 100%;
height: 50px;
background: #ffffff;
display: flex;
align-items: center;
justify-content: center;
position: absolute;
left: 0;
bottom: 0;
"
@click="goUrl"
>
<Text>去领券</Text>
</view> -->
<!-- 加载中 --> <!-- 加载中 -->
<view class="loading" v-if="loading"> <view class="loading" v-if="loading">
<u-loading mode="flower" size="48">></u-loading> <u-loading mode="flower" size="48">></u-loading>
...@@ -87,7 +44,6 @@ ...@@ -87,7 +44,6 @@
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth="gbAuth"></auth> <auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth="gbAuth"></auth>
</view> </view>
</template> </template>
<script> <script>
import auth from "../../../components/auth/index.vue"; import auth from "../../../components/auth/index.vue";
export default { export default {
...@@ -101,26 +57,25 @@ ...@@ -101,26 +57,25 @@
U: {}, U: {},
list: [{ list: [{
name: "未使用" name: "未使用"
}, { },
{
name: "已使用"
},
{
name: "已过期" name: "已过期"
}], }
],
mainColor: "", mainColor: "",
contentHeight: 0, contentHeight: 0,
currentIndex: 0, currentIndex: 0,
msg: { msg: {
"pageIndex": 1, "pageIndex": 1,
"pageSize": 8, "pageSize": 8,
"useState": 1, "userId": 15625, //CustomerAccountId
"lineId": 0, "CouponStatus": 1, // 优惠券状态 1未使用 2已使用 3已过期
"lineteamId": 0,
"couponsName": "",
"couponsType": 0,
"couponStatus": 1,
"couponEffectStatus": 1, //1 有效;3 无效
"couponsUseScope": 0,
}, },
page_count: 1, page_count: 1,
g: [], couponDataList: [],
loading: false, loading: false,
status: "loadmore", status: "loadmore",
loadText: { loadText: {
...@@ -142,8 +97,7 @@ ...@@ -142,8 +97,7 @@
let currentPages = getCurrentPages(); let currentPages = getCurrentPages();
let u = "/" + currentPages[currentPages.length - 1].route; let u = "/" + currentPages[currentPages.length - 1].route;
let pages = wx.getStorageSync("basedata") ? let pages = wx.getStorageSync("basedata") ?
wx.getStorageSync("basedata").bar_title : wx.getStorageSync("basedata").bar_title : [];
[];
pages.forEach((x) => { pages.forEach((x) => {
if (x.value == u) { if (x.value == u) {
this.pageTitle = x.new_name ? x.new_name : x.name; this.pageTitle = x.new_name ? x.new_name : x.name;
...@@ -154,68 +108,35 @@ ...@@ -154,68 +108,35 @@
}); });
}, },
onLoad: function(option) { onLoad: function(option) {
// this.u = uni.getStorageSync("mall_UserInfo");
// if (!this.u) {
// this.u = {
// nickName: "未登录",
// avatarUrl: "",
// };
// this.showAuth = true;
// } else {
// this.init();
// }
this.loading = true this.loading = true
this.init() this.init()
}, },
methods: { methods: {
change(index) { change(index) {
this.currentIndex = index this.currentIndex = index;
this.msg.useState = index == 0 ? 1 : 3; this.msg.CouponStatus = index + 1;
this.msg.pageIndex = 1; this.msg.pageIndex = 1;
this.g = []; this.couponDataList = [];
this.loading = true; this.loading = true;
this.init(); this.init();
}, },
init() { init() {
uni.showLoading() this.loading = true;
this.apipost("coupon_post_GetUserCanUseCouponPageList", this.msg, (res) => {
// this.apipost("b2b_post_LvXiaoYouBindCustomerInfo", param, (res) => {
// if (res.resultCode == 1) {
// //移除缓存=>跳转到首页重新登录
// uni.removeStorageSync('b2b_user')
// uni.removeStorageSync('mall_UserInfo')
// uni.redirectTo({
// url: '/pages/index/index'
// })
// } else {
// this.loginLoading = false
// uni.hideLoading()
// }
// }, (failed) => {
// this.loginLoading = false;
// uni.showToast({
// title: failed.message,
// icon: "none",
// });
// }, (error) => {
// this.loginLoading = false;
// uni.hideLoading()
// })
this.javaApipost('b2b/user/getUserCouponAllotList', this.msg, (res) => {
this.loading = false; this.loading = false;
this.g = this.g.concat(res.data.pageData); if (res.resultCode == 1) {
this.couponDataList = res.data.pageData;
this.page_count = res.data.pageCount; this.page_count = res.data.pageCount;
if (this.page_count == 1) { console.log("this.couponDataList", this.couponDataList)
this.status = "nomore";
} }
uni.hideLoading() }, (failed) => {
}, (err) => { uni.showToast({
console.log(err) title: failed.message,
uni.hideLoading() icon: "none",
});
this.loading = false;
}, (error) => {
this.loading = false;
}) })
}, },
lower(e) { lower(e) {
...@@ -229,7 +150,6 @@ ...@@ -229,7 +150,6 @@
}, },
reloadUserinfo() { reloadUserinfo() {
this.u = uni.getStorageSync("mall_UserInfo"); this.u = uni.getStorageSync("mall_UserInfo");
// this.showAuth=false;
this.init(); this.init();
}, },
//关闭登录窗口 //关闭登录窗口
......
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