Browse Source

[新增积分商城]

tags/湖南版5.1.4
刘晖 6 years ago
parent
commit
7018955454
14 changed files with 1891 additions and 1 deletions
  1. +4
    -1
      app.json
  2. +180
    -0
      pages/integralmall/index.js
  3. +10
    -0
      pages/integralmall/index.json
  4. +36
    -0
      pages/integralmall/index.wxml
  5. +291
    -0
      pages/integralmall/index.wxss
  6. +163
    -0
      pages/integralmall/integcoupondetail/index.js
  7. +5
    -0
      pages/integralmall/integcoupondetail/index.json
  8. +62
    -0
      pages/integralmall/integcoupondetail/index.wxml
  9. +396
    -0
      pages/integralmall/integcoupondetail/index.wxss
  10. +232
    -0
      pages/integralmall/payIntegcoupondetail/index.js
  11. +6
    -0
      pages/integralmall/payIntegcoupondetail/index.json
  12. +50
    -0
      pages/integralmall/payIntegcoupondetail/index.wxml
  13. +446
    -0
      pages/integralmall/payIntegcoupondetail/index.wxss
  14. +10
    -0
      pages/user/index.wxml

+ 4
- 1
app.json View File

@@ -1,6 +1,7 @@
{
"pages": [
"pages/index/index",
"pages/integralmall/payIntegcoupondetail/index",
"pages/joinFrDpell/index",
"pages/spellDetail/index",
"pages/spellTimeout/index",
@@ -54,7 +55,9 @@
"pages/ConsumeDetail/ConsumeDetail",
"pages/externallinks/index",
"pages/czdetail/czdetail",
"pages/spellGroup/paySpellGroup/index"
"pages/spellGroup/paySpellGroup/index",
"pages/integralmall/index",
"pages/integralmall/integcoupondetail/index"
],
"navigateToMiniProgramAppIdList": [
"wx192b7d2e8dcbefd0",


+ 180
- 0
pages/integralmall/index.js View File

@@ -0,0 +1,180 @@
var config = require("../../config/config.js");
const Http = require("../../utils/HttpBasics");
const imgurl = require("../../utils/imgurl");
const { spellStatus, spellStatus02 } = require("../../utils/spell");
Page({
/**
* 页面的初始数据
*/
data: {
bannerUrl: imgurl.banner.url,
loadingUrl: imgurl.loading.url,
nodata: imgurl.nodata.url,
list: [],
lists: [],
myLists: [],
page: 1, // 设置加载的第几次,默认是第一次
pageSize: 10, //返回数据的个数
searchLoadingComplete: false, //“没有数据”的变量,默认false,隐藏
allow_load: true, // 是否允许继续加载标识 默认 true 允许,false 加载完成
myorder: false,
actUrl: imgurl.act.url,
loading: true,
content: '数据正在加载中',
reloadIf: false
},
onLoad: function (options) {
let that = this;
that.getBannerlist();
var todayDate = new Date().getTime();
that.setData({
optionsData: options,
todayDate: todayDate
})
if (options && options.from == 'myhtml') {
that.getmyList();
}
else {
that.getList(1);
that.setData({
lists: null
})
}
},
onShow() {
let that = this;
if (this.data.reloadIf) {
wx.setNavigationBarTitle({
title: '积分商城'
})
that.getList(1);
that.setData({
lists: null
})
}
},
/**
* banner
*/
getBannerlist: function () {
let that = this;
Http.get({
url: config.api.bannerlist,
data: {
pageNum: 1,
pageSize: 7
}
}).then(res => {
that.setData({
list: res.data.list
});
});
},
getList(pageNum) {
var that = this;
console.log(pageNum)
if (that.data.allow_load) {
that.setData({
loading: true,
content: '小主,我在玩命加载中...'
})
var param = {};
var param = {
pageNum: pageNum,
pageSize: 10,
targetAd: 5
};
var url = config.api.couponChannelList;
// 请求接口
Http.get({
url: url,
data: param
}).then(res => {
console.log(res)
/**
* 加载完成
*/
if (pageNum >= res.data.pages) {
if (res.data.pages == 0 || res.data.pages == 1) {
that.setData({
allow_load: true,
loading: false,
content: ""
});
} else {
that.setData({
allow_load: false,
loading: true,
content: "——— 再拉裤子就掉了啦 ———",
});
}
}
if (pageNum == 1) {
that.setData({
lists: [],
})
}
var tmpArr = that.data.lists;
tmpArr.push.apply(tmpArr, res.data.list);
that.setData({
lists: tmpArr
})
wx.stopPullDownRefresh();
})
.catch(err => {
wx.stopPullDownRefresh();
wx.showToast({
title: err.message,
icon: 'none',
duration: 2000,
mask: false
});
})
setTimeout(function () {
that.setData({
loading: false,
})
}, 1400);
} else {
that.setData({
loading: true,
content: "——— 再拉裤子就掉了啦 ———"
})
setTimeout(function () {
that.setData({
loading: false,
})
}, 1400)
}
},
/**
*
* @param goto拼团券详情
*/
invite: function (e) {
let couponChannelId = e.currentTarget.dataset.id;
let couponId = e.currentTarget.dataset.couponid;
if (couponChannelId && couponId) {
wx.navigateTo({
url: `/pages/integralmall/integcoupondetail/index?couponChannelId=${couponChannelId}&couponId=${couponId}`
})
}
},
//加载更多
onReachBottom: function () {
let that = this;
that.data.page++;
that.setData({
page: that.data.page
});
that.getList(that.data.page, that.data.flag);
},
/**
* 刷新
*/
onPullDownRefresh: function (e) {
let that = this;
that.getBannerlist();
that.getList(1);
}
})

+ 10
- 0
pages/integralmall/index.json View File

@@ -0,0 +1,10 @@
{
"navigationBarTitleText": "积分商城",
"enablePullDownRefresh": true,
"navigationBarBackgroundColor": "#F13C42",
"usingComponents": {
"c-banner": "../../components/spellbanner/index",
"i-tab": "../../../dist/tab/index",
"i-tabs": "../../../dist/tabs/index"
}
}

+ 36
- 0
pages/integralmall/index.wxml View File

@@ -0,0 +1,36 @@
<view class='content-box' style='{{"padding-bottom:"+(lists.length>0?"200rpx":"0")}}'>
<view class='top' wx:if='{{list.length>0}}'>
<view class="banner" wx:if="{{list.length>0}}" hover-class="none" hover-stop-propagation="false">
<c-banner wx:key="unique" list="{{list}}" />
</view>
</view>
<view class='no-data01' style='{{"margin-top:"+(list.length>0?"320rpx":"20rpx")+";"+"height:"+(list.length>0?"calc(100vh - 460rpx)":"calc(100vh - 160rpx)")}}' wx:if='{{lists.length==0}}'>
<image src='{{nodata}}'></image>
<view class='no-data-text'>暂无数据</view>
</view>
<view class='content' style='{{"margin-top:"+(list.length>0?"320rpx":"20rpx")}}'>
<view class='sepll-list' wx:for="{{lists}}" wx:key="{{index}}" data-couponId='{{item.couponId}}' data-id='{{item.id}}' bindtap='invite'>
<view class='spell-left'>
<image src='{{item.coverImg}}' mode="aspectFill"></image>
</view>
<view class='spell-center'>
<view class='tilte'>{{item.title}}</view>
<view class='remark'>{{item.subTitle}}</view>
<view class='price'>
<view class='price01'>
<view class='price-num'>{{item.salePriceStr}}</view>
<view class='price-unit'>积分</view>
</view>
</view>
<view class='price02'>{{'原价:'+item.priceStr+'元'}}</view>
</view>
<view class='spell-right'>
<view class='right-button'>立即换购</view>
<view class='right-text'>剩余{{item.remainInventory}}</view>
</view>
</view>
</view>
<view class="loading" wx:if="{{loading}}">
{{content}}
</view>
</view>

+ 291
- 0
pages/integralmall/index.wxss View File

@@ -0,0 +1,291 @@
/* pages/spellGroup/spellGroup.wxss */
page {
height: auto;
overflow: auto;
background: #f89132;
background-image: url('https://s3.cn-northwest-1.amazonaws.com.cn/iformall-net/cimg/spell-bg.png');
background-size: cover;
background-repeat: no-repeat;
}
.content-box{
height: auto;
padding-bottom: 200rpx;
}
.loading {
text-align: center;
height: 80rpx;
line-height: 80rpx;
font-size: 26rpx;
color: #fff;
}

.loading image {
width: 60rpx;
height: 60rpx;
vertical-align: middle;
margin-right: 10rpx;
}
.banner{
margin-bottom: 20rpx;
background: none;
border-radius: 16rpx;
}
.banner .bg {
display: block;
width: 100%;
}
image{
padding: 0;
margin: 0;
}
.banner .bannerbg image{
display: none!important;
height: 0;
overflow: hidden;
}
.bannerimg {
display: block;
width: 710rpx;
height: 260rpx;
border-radius: 15rpx;
margin: -132rpx auto 0;
}
.banner .index-slide-view {
margin: -132rpx auto 0;
}
.top{
position: absolute;
top: 30rpx;
width: 710rpx;
height: 260rpx;
background: #fff;
left: 20rpx;
border-radius: 16rpx;
overflow: hidden;
}
.content .sepll-list{
width: 690rpx;
height: 230rpx;
background: #fff;
border-radius: 30rpx;
margin: 30rpx auto 0;
}
.content .spell-left{
width: 230rpx;
height: 230rpx;
float: left;
}
.content .spell-left image{
width: 180rpx;
height: 180rpx;
margin: 25rpx;
}
.content .spell-center{
float: left;
width: 304rpx;
height: 100%;
}
.content .tilte{
font-size:30rpx;
font-family:PingFang-SC-Bold;
font-weight:bold;
color:rgba(51,51,51,1);
line-height:44rpx;
padding-top: 16rpx;
overflow: hidden;
text-overflow:ellipsis;
white-space: nowrap;
}
.content .remark{
width:304rpx;
font-size:24rpx;
font-family:PingFang-SC-Medium;
font-weight:500;
color:rgba(140,140,140,1);
line-height:44rpx;
overflow: hidden;
text-overflow:ellipsis;
white-space: nowrap;
}
.content .spell-num{
width: 95rpx;
border:1px solid rgba(255,50,50,1);
border-radius:10rpx;
font-size:24rpx;
font-family:PingFang-SC-Medium;
font-weight:500;
color:rgba(255,50,50,1);
line-height:30rpx;
margin: 10rpx 0;
text-align: center;
}
.content .price{
overflow: hidden;
margin-top: 10rpx;
}
.content .price01{
font-size:50rpx;
font-family:PingFang-SC-Medium;
font-weight:500;
color:rgba(255,50,50,1);
line-height:44rpx;
}
.content .price02{
font-size: 24rpx;
font-family:PingFang-SC-Medium;
font-weight:500;
text-decoration:line-through;
color:rgba(140,140,140,1);
}
.content .price-num{
display: inline;
}
.content .price-unit{
display: inline;
font-size:24rpx;
margin-right: 10rpx;
}
.content .spell-right{
float: left;
width: 156rpx;
}
.right-button{
width:120rpx;
height:48rpx;
font-size:26rpx;
background:linear-gradient(90deg,rgba(236,59,45,1) 0%,rgba(248,98,52,1) 100%);
border-radius:24rpx;
font-family:PingFang-SC-Medium;
font-weight:500;
text-align: center;
color:rgba(255,255,255,1);
line-height:44rpx;
margin: 110rpx auto 0;
margin-top: 110rpx;
}
.right-text{
font-size:22rpx;
font-family:PingFang-SC-Medium;
font-weight:500;
color:rgba(140,140,140,1);
line-height:60rpx;
text-align: center;
}
.bottom{
width: 690rpx;
height: 85rpx;
position: fixed;
bottom: 26rpx;
left: 30rpx;
/* background:rgba(243,69,58,1); */
border:1px solid rgba(255, 222, 67, 1);
border-radius:40px;
color: #fff;
overflow: hidden;
}
.bottom-left{
width: 50%;
float: left;
margin-left: -1rpx;
text-align: center;
line-height: 85rpx;
font-size:30rpx;
font-family:PingFang-SC-Medium;
font-weight:500;
color:rgba(255,253,245,1);
border-right:1px solid rgba(255, 222, 67, 1);
opacity: 1;
}
.bottom-right{
width: 50%;
float: left;
text-align: center;
line-height: 85rpx;
font-size:30rpx;
font-family:PingFang-SC-Medium;
font-weight:500;
color:rgba(255,253,245,1);
opacity: 1;
}
.spell-bottom{
overflow: hidden;
}
.spell-top{
height: auto;
margin: 0 30rpx;
overflow: hidden;
box-sizing: border-box;
border-bottom: 1rpx solid #EEEEEE;
}
.spell-top-left{
float: left;
width: 60%;
}
.spell-top-right{
float: left;
width: 40%;
}
.top-title{
display: inline;
font-size:24rpx;
font-family:PingFang-SC-Medium;
font-weight:500;
color:rgba(51,51,51,1);
line-height:64rpx;
}
.top-num{
display: inline;
font-size:24rpx;
font-family:PingFang-SC-Medium;
font-weight:500;
color:#FF3232;
line-height:64rpx;
padding-left: 8rpx;
}
.spell-top-right{
text-align: right;
font-size:26rpx;
font-family:PingFang-SC-Medium;
font-weight:500;
color:rgba(255,50,50,1);
line-height:64rpx;
}
.no-data01{
width: 690rpx;
padding-top: 174rpx;
height: calc(100vh - 460rpx);
background: #fff;
margin: 0 auto;
border-radius:15rpx;
box-sizing: border-box;
margin-top: 320rpx;
}
.no-data{
width: 690rpx;
padding-top: 174rpx;
height: calc(100vh - 160rpx);
background: #fff;
margin: 0 auto;
border-radius:15rpx;
box-sizing: border-box;
margin-top:20rpx;
}
.no-data01 image{
width: 261rpx;
height: 272rpx;
display: block;
margin: 0 auto;
}
.no-data image{
width: 261rpx;
height: 272rpx;
display: block;
margin: 0 auto;
}
.no-data-text{
text-align: center;
font-size:34rpx;
font-family:PingFang-SC-Medium;
font-weight:500;
color:rgba(0,0,0,1);
}

+ 163
- 0
pages/integralmall/integcoupondetail/index.js View File

@@ -0,0 +1,163 @@
// pages/spellGroup/mySpellGroup/index.js
var config = require("../../../config/config.js");
const Http = require("../../../utils/HttpBasics");
const imgurl = require("../../../utils/imgurl");
const utils = require("../../../utils/util.js")
Page({

/**
* 页面的初始数据
*/
data: {
teljpgUrl: imgurl.teljpg.url,
wmhome: imgurl.wmhome.url,
couponChannelId: '',
couponId: '',
data: null,
spellData: null,
canSpell: true,
canBuyIf: true,
clock: "00",
day: "00",
hour: "00",
min: "00",
sec: "00",
showTime: true
},

/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
couponChannelId: options.couponChannelId,
couponId: options.couponId
})
if (options && options.couponChannelId) {
this.getDetail(options.couponChannelId);
}
},
gotoIndex: function () {
wx.switchTab({
url: '/pages/main/index',
})
},
/**
* 拨打电话
*/
phone: function (e) {
let that = this;
wx.makePhoneCall({
phoneNumber: e.target.dataset.merchantlinkphone
});
},
/**
* 直接购买
*/
gotoBuy(e) {
console.log(22222)
this.setData({
canBuyIf: false,
formId: e.detail.formId
})
wx.navigateTo({
url: '/pages/integralmall/payIntegcoupondetail/index?couponChannelId=' + this.data.couponChannelId,
})
},
// 时间格式化输出,如11:03 25:19 每1s都会调用一次
dateformat(micro_second) {
// 总秒数
var second = Math.floor(micro_second / 1000);
// 天数
var day = Math.floor(second / 3600 / 24) < 10 ? "0" + Math.floor(second / 3600 / 24) : Math.floor(second / 3600 / 24);
// 小时
var hr = Math.floor(second / 3600 % 24) < 10 ? "0" + Math.floor(second / 3600 % 24) : Math.floor(second / 3600 % 24);
// 分钟
var min = Math.floor(second / 60 % 60) < 10 ? "0" + Math.floor(second / 60 % 60) : Math.floor(second / 60 % 60);
// 秒
var sec = Math.floor(second % 60) < 10 ? "0" + Math.floor(second % 60) : Math.floor(second % 60);

// return day + "天" + hr + "小时" + min + "分钟" + sec + "秒";
return {
a1: day,
b1: hr,
c1: min,
d1: sec
}
},
/**
* 获取券详情信息
*/
getDetail(couponChannelId) {
let that = this;
Http.get({
url: config.api.couponDetail,
data: {
couponChannelId: couponChannelId
}
}).then(res => {
wx.stopPullDownRefresh();
let data = res.data;
data.price = (data.price / 100).toFixed(2)
data.salePrice = (data.salePrice / 100).toFixed(2);
data.validStartDate = utils.formatTime(data.validStartDate, 'yyyy-MM-dd')
data.validEndDate = utils.formatTime(data.validEndDate, 'yyyy-MM-dd')
that.setData({
data
});
});
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {

},

/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.setData({
canSpell: true,
canBuyIf: true,
showTime: true
})
if (this.data.spellData != null) {
this.countdown()
}
},

/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
this.setData({
showTime: false
})
},

/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
this.setData({
showTime: false
})
},

/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function (e) {
let that = this;
that.getDetail(that.data.couponChannelId);
},

/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {

}
})

+ 5
- 0
pages/integralmall/integcoupondetail/index.json View File

@@ -0,0 +1,5 @@
{
"navigationBarTitleText": "积分券详情",
"enablePullDownRefresh": true,
"usingComponents": {}
}

+ 62
- 0
pages/integralmall/integcoupondetail/index.wxml View File

@@ -0,0 +1,62 @@
<view class="content-box">
<view class='content'>
<view class='top-img'>
<image src='{{data.coverImg}}'></image>
</view>
<view class='title'>{{data.title}}</view>
<view class='text'>
<view class='remark'>{{data.subTitle}}</view>
<view class='des'>
<view class='des-peoplenum'>售价</view>
<view class='des-saleprice'>{{data.salePriceStr}}积分</view>
</view>
<view class='rest' wx:if="{{data.validType==1}}">有效期:
<text class='time'>{{data.validStartDate}}至{{data.validEndDate}}<text class="use">(请在有效期内使用)</text></text>
</view>
<view class='rest'>
<text class='txt01'>价值:</text>
<text class='time'>{{data.priceStr}}元</text>
</view>
<view class='status' wx:if="{{spellData!=null}}">
<view class='status01 st'>
<image src='{{spellData.avatarUrl}}'></image>
</view>
<view class='status02 st'>{{spellData.nickName}}的团还差<view class='r-p-num'>1人</view></view>
<view class='status03 st'>
<view class='mm'>{{day}}</view><text class='day-box' style='font-size:32rpx;'> 天 </text>
<view class='hh'>{{hour}}</view><text class='mao'>:</text>
<view class='mm'>{{min}}</view><text class='mao'>:</text>
<view class='ss'>{{sec}}</view>
</view>
<view class='status04 st'>
<view class='s-button' bindtap='gotoPartner'>去拼团</view>
</view>
</view>
<view class='p-des'>
<view class='p-title'>购买须知</view>
<view class='p-list'>{{data.remark}}</view>
</view>
<view class='posi'>
<view class='applyshop'>适用门店</view>
<view class='posi_logo' wx:for="{{data.merchantVoList}}" wx:key="index">
<view>
<image src='{{item.merchantImgUrl}}'></image>
</view>
<view>
<text>{{item.merchantName}}</text>
<text>{{item.addr}}{{item.buildingName}}{{item.floorName}}</text>
</view>
<image bindtap='phone' data-merchantLinkPhone='{{item.merchantLinkPhone}}' class="tel" src="{{teljpgUrl}}" mode="widthFix" />
</view>
</view>
<form bindsubmit="submit" report-submit='true' >
<view class='edit'>
<button class='goback' bindtap='gotoIndex'><image src='{{wmhome}}' mode="widthFix"></image></button>
<button class='edit-left' form-type="submit" wx:if='{{data.id}}' bindtap='gotoBuy'>
<view class='edit-left-bottom'>马上兑换</view>
</button>
</view>
</form>
</view>
</view>
</view>

+ 396
- 0
pages/integralmall/integcoupondetail/index.wxss View File

@@ -0,0 +1,396 @@
/* pages/spellGroup/mySpellGroup/index.wxss */
.top-img{
width: 100%;
height: 533rpx;
z-index: 1;
}
.top-img image{
width: 100%;
height: 533rpx;
}
.goback {
float:left;
width:122rpx!important;
height:95rpx;
background:rgba(255,255,255,1);
line-height:95rpx;
border:1rpx solid rgba(227,227,227,1);
/* box-shadow:0px 8px 8px 1px rgba(189,189,189,0.32); */
border-radius:48rpx;
margin-right:25rpx;
}
.goback image{
position:absolute;
width:60rpx;
left:0;
right:0;
top:0;
bottom:0;
margin:auto;
height: 80rpx;
}
.content-box{
box-sizing: content-box;
height: auto;
overflow: hidden;
}
.content{
position: relative;
width: 100%;
height: auto;
background: #fff;
overflow: hidden;
padding-bottom: 130rpx;
}
.text{
padding: 0 30rpx;
}
.title{
position: relative;
background-color: #fff;
z-index: 100;
width: 750rpx;
padding-top: 30rpx;
padding-left: 30rpx;
line-height: 50rpx;
border-radius:20rpx 20rpx 0px 0px;
margin-top: -25rpx;
opacity: 1;
font-size:32rpx;
font-weight:bold;
color:rgba(51,51,51,1);
box-sizing: border-box;
}
.remark{
font-size:24rpx;
font-family:PingFang-SC-Medium;
font-weight:500;
color:rgba(134,134,134,1);
line-height: 48rpx;
}
.des{
width: 100%;
height: auto;
padding-top: 6rpx;
border-top: 2rpx solid rgb(240, 238, 238);
}
.des-peoplenum{
display: inline;
font-size:24rpx;
font-family:PingFang-SC-Medium;
font-weight:500;
color:rgba(0,0,0,1);
line-height:44rpx;
margin-right: 5rpx;
}
.des-saleprice{
display: inline;
font-size:40rpx;
font-family:PingFang-SC-Medium;
font-weight:500;
color:rgba(255,53,53,1);
}
.status{
width: 100%;
border-radius: 15rpx;
background:rgba(255,235,229,1);
margin: 30rpx 0;
overflow: hidden;
}
.status01{
float: left;
width: 130rpx;
height: 130rpx;
}
.status01 image{
width: 90rpx;
height: 90rpx;
border-radius: 45rpx;
margin: 20rpx 0 0 20rpx;
}
.status02{
margin-top: 20rpx;
float: left;
width: 140rpx;
font-size:28rpx;
font-family:PingFang-SC-Medium;
font-weight:500;
color:rgba(51,51,51,1);
}
.r-p-num{
display: inline;
color: #FF3535;
}
.status03{
width: 264rpx;
float: left;
padding-left: 10rpx;
color: #F74812;
box-sizing: border-box;
}
.hh,.mm,.ss{
display: inline-block;
font-size:26rpx;
font-family:PingFang-SC-Medium;
font-weight:500;
color:rgba(255,255,255,1);
height: 38rpx;
width: 38rpx;
background: #F74812;
border-radius:10rpx;
margin: 46rpx 0 0 0;
text-align: center;
line-height: 38rpx;
}
.day-box{
width: 40rpx;
text-align: center;
}
.mao{
display: inline-block;
width: 20rpx;
text-align: center;
}
.status04{
float: left;
width: 146rpx;
}
.s-button{
background:#ED3D2E;
width: 120rpx;
height: 48rpx;
font-size:28rpx;
font-family:PingFang-SC-Medium;
font-weight:500;
color:rgba(255,255,255,1);
text-align: center;
line-height: 48rpx;
border-radius: 24rpx;
margin: 40rpx auto 0;
}
.p-title{
font-size:30rpx;
color:rgba(51,51,51,1);
margin: 10rpx 0 20rpx 0;
}
.p-list{
font-size:24rpx;
font-family:PingFang-SC-Medium;
font-weight:500;
color:rgba(51,51,51,1);
line-height:50rpx;
}
.edit{
position:fixed;
bottom:0;
left:0;
right:0;
padding:20rpx 22rpx;
background:#fff;
}
.edit-left{
float: left;
width: 562rpx;
height: 95rpx;
background:rgba(255,169,2,1);
box-shadow:0px 8rpx 8rpx 1rpx rgba(255,169,2,0.32);
border-radius:48rpx;
}
.edit-right{
float: right;
width: 269rpx;
height: 95rpx;
line-height: 46rpx;
background:linear-gradient(90deg,rgba(236,59,45,1) 0%,rgba(248,98,52,1) 100%);
box-shadow:0px 8rpx 8rpx 1rpx rgba(246,93,51,0.32);
border-radius:48rpx;
}
.edit-left-top{
height: 46rpx;
text-align: center;
line-height:65rpx;
}
.price{
display: inline;
font-size:32rpx;
line-height: 32rpx;
font-family:PingFang-SC-Medium;
font-weight:500;
color:rgba(254,254,254,1);
margin-top: 6rpx;
}
.price-unit{
display: inline;
font-size:27rpx;
line-height: 27rpx;
margin-top: 11rpx;
font-family:PingFang-SC-Medium;
font-weight:500;
color:rgba(254,254,254,1);
}
.edit-left-bottom{
text-align: center;
font-size:30rpx;
line-height: 95rpx;
font-family:PingFang-SC-Medium;
font-weight:500;
color:rgba(254,254,254,1);
}

.edit-right-top{
line-height: 32rpx;
text-align: center;
margin-top: 13rpx;
}
.real-price{
display: inline;
font-size:32rpx;
font-family:PingFang-SC-Medium;
font-weight:500;
color:rgba(254,254,254,1);
}
.real-price-unit{
display: inline;
font-size:27rpx;
line-height: 27rpx;
font-weight:500;
color:rgba(254,254,254,1);
}
.edit-right-bottom{
text-align: center;
font-size:30rpx;
line-height: 40rpx;
font-weight:500;
color:rgba(254,254,254,1);
}
.posi {
position: relative;
}
.applyshop{
font-size:32rpx;
color:rgba(51,51,51,1);
margin: 10rpx 0 20rpx 0;
}

.posi>view:nth-child(2) {
width: 100%;
height: 87rpx;
display: flex;
justify-content: space-between;
line-height: 87rpx;
}

.posi>view:nth-child(2) text:nth-child(1) {
font-size: 30rpx;
color: #a9a9a9;
}

.posi>view:nth-child(2) text:nth-child(2) {
font-size: 30rpx;
color: #a9a9a9;
}

.posi_logo {
width: 100%;
display: flex;
padding: 20rpx 0;
background: #fff;
height: 100rpx;
margin-bottom: 20rpx;
}

.posi_logo view:nth-child(1) {
width: 100rpx;
height: 100rpx;
border-radius: 16rpx;
}

.posi_logo view:nth-child(1) image {
display: block;
width: 100rpx;
height: 100rpx;
border-radius: 16rpx;
border: 1px solid #e5e5e5;
}

.posi_logo view:nth-child(2) {
display: flex;
flex-direction: column;
flex: 8;
padding-left: 30rpx;
}

.posi_logo view:nth-child(2) text:nth-child(1) {
font-size: 32rpx;
color: #333;
letter-spacing: 0;
}

.posi_logo view:nth-child(2) text:nth-child(2) {
font-size: 24rpx;
color: #b8b8b8;
padding-top: 3rpx;
width: 450rpx;
height: 36rpx;
overflow: hidden;
}
.tel {
right: 0;
top: 0;
bottom: 0;
margin: auto;
width: 50rpx;
height: 50rpx;
}
.rest {
font-size: 24rpx;
color: #919191;
letter-spacing: 0;
height: 70rpx;
line-height: 70rpx;
/* border-bottom: 1px solid #eee; */
border-bottom: 1px solid #f9f9f9;
}

.restNum {
font-size: 24rpx;
color: #999;
letter-spacing: 1.16rpx;
text-align: right;
}

.time {
font-size: 24rpx;
color: #333;
letter-spacing: 0;
line-height: 33rpx;
display: inline-block;
}

.txt01 {
font-size: 24rpx;
color: #919191;
letter-spacing: 0;
}

.times {
display: inline-block;
color: #ff4949;
font-weight: bold;
font-size: 26rpx;
text-align: center;
}

.times text {
display: inline-block;
margin: 6rpx;
width: 46rpx;
height: 56rpx;
text-align: center;
font-size: 28rpx;
line-height: 60rpx;
border-radius: 12rpx;
color: #fff;
font-weight: bold;
background: #ff4949;
}

+ 232
- 0
pages/integralmall/payIntegcoupondetail/index.js View File

@@ -0,0 +1,232 @@
// pages/spellDetail/index.js
var config = require("../../../config/config.js");
const Http = require("../../../utils/HttpBasics");
const imgurl = require("../../../utils/imgurl");
const { spellStatus } = require("../../../utils/spell");
Page({

/**
* 页面的初始数据
*/
data: {
tuanzhang: imgurl.tuanzhang.url,
spellBg: imgurl.spellBg.url,
position: imgurl.position.url,
close03: imgurl.close03.url,
home: imgurl.wmhome.url,
paramData: null,
data: null,
showErr: false,
showAlert: false,
remainingPoints:0
},
getUserInfo: function () {
let that = this;
// 获取用户信息
Http.get({
url: config.api.getScore,
data: {}
})
.then(res => {
console.log(res)
that.setData({
remainingPoints: Number(res.data.credit) - Number(that.data.data.salePriceStr),
userInfo:res.data,
nickName: res.data.nickName,
avatarUrl: res.data.avatarUrl
})
})
},
gotoIndex() {
wx.reLaunch({
url: '/pages/index/index',
})
},
gotoSearch() {
wx.navigateTo({
url: `/pages/spellGroup/spellGroup`,
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
paramData: options
})
this.getDetail(options.couponChannelId);

// 关闭来自于左上角的分享
wx.hideShareMenu()
},
/**
* 支付订单更新
*/
payOrderUpdate: (orderId, payOrderId, status, reason, _this, orderGroupId) => {
console.log(orderGroupId, 7777)
let that = this;
// 支付成功
Http.post({
url: config.api.payOrderUpdate,
data: {
payOrderId: payOrderId,
orderId: orderId,
status: status,
reason: reason
}
})
.then(res => {
wx.hideLoading()
if (res.data.orderStatus == 14) {
_this.setData({
showErr: true
})
return;
}
if (orderGroupId == undefined) {
wx.navigateTo({
url: '/pages/order/detail/index?orderId=' + res.data.id,
})
} else {
_this.goToOrderGroup(orderId, res.data.orderGroupId, _this)
}
})
.catch(err => {
console.log(err);
if (err.code != 12002) {
setTimeout(function () {
_this.payOrderUpdate(orderId, payOrderId, status, reason, _this, orderGroupId);
}, 2000)
}
})
},
gotoPay() {
let that = this;
wx.showLoading({
title: '支付创建中...',
})
Http.post({
url: config.api.payOrderCreate,
data: {
orderId: that.data.paramData.orderId
}
})
.then(res => {
var payOrderId = "" + res.data.payOrderId;
wx.hideLoading();
wx.requestPayment({
timeStamp: res.data.timeStamp,
nonceStr: res.data.nonceStr,
package: res.data.package,
signType: (res.data.signType) ? res.data.signType : "MD5",
paySign: res.data.paySign,
success: res => {
wx.showLoading({
title: '订单正在处理中...',
})
setTimeout(function () {
wx.hideLoading()
}, 5000)
that.payOrderUpdate(that.data.paramData.orderId, payOrderId, 1, '', that, 0);
if (res.errMsg == "requestPayment:ok") {
setTimeout(function () {
wx.hideLoading();
}, 2000);
}
},
fail: res => {
/**
* 支付失败,需要更新订单的状态
*/
that.payOrderUpdate(that.data.paramData.orderId, payOrderId, 2, '', that, 0);
that.setData({
showbutton: false,
canSpell: true,
canBuyIf: true
})
return;
},
complete: res => { }
});
/// End payment --------
})
.catch(err => {
that.setData({
canSpell: true,
canBuyIf: true
})
wx.showToast({
title: err.message,
icon: 'none',
duration: 2000,
mask: false
});
})
},
/**
* 获取券详情信息
*/
getDetail(couponChannelId) {
let that = this;
Http.get({
url: config.api.couponDetail,
data: {
couponChannelId: couponChannelId
}
}).then(res => {
wx.stopPullDownRefresh();
that.getUserInfo()
let data = res.data;
that.setData({
data
});
});
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {

},

/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.setData({
showTime: true
})
},

/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
this.setData({
showTime: false
})
},

/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
this.setData({
showTime: false
})
},

/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
this.getDetail(this.data.paramData);
},

/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {

}
})

+ 6
- 0
pages/integralmall/payIntegcoupondetail/index.json View File

@@ -0,0 +1,6 @@
{
"navigationBarTitleText": "积分换礼",
"usingComponents": {},
"navigationBarBackgroundColor": "#F13C42",
"enablePullDownRefresh": true
}

+ 50
- 0
pages/integralmall/payIntegcoupondetail/index.wxml View File

@@ -0,0 +1,50 @@
<!--pages/spellDetail/index.wxml-->
<view class='container'>
<!-- 拼团产品详情 -->
<view class='detail'>
<view class='return-index' bindtap='gotoIndex'>
<image src='{{home}}' mode="widthFix"></image>
</view>
<view class='detail-top'>
<view class='detail-top01'>
<image src='{{data.coverImg}}' mode="aspectFill"></image>
</view>
<view class='detail-top02'>
<view class='title'>{{data.title}}</view>
<view class='des'>{{data.subTitle}}</view>
<view class='des'>{{'价值:'+data.priceStr+'元'}}</view>
</view>
<view class='detail-top03'>
<view class='detail-p-price'>{{data.salePriceStr}}积分</view>
<view class='detail-p-name'>积分售价</view>
</view>
</view>
</view>

<!-- 拼团订单信息 -->
<view class='order'>
<view class='order-list'>
<view class='order-title'>当前积分总额</view>
<view class='order-text'>{{userInfo.credit}}</view>
</view>
<view class='order-list'>
<view class='order-title'>兑换使用积分</view>
<view class='order-text'>{{data.salePriceStr}}</view>
</view>
<view class='order-list'>
<view class='order-title'>剩余积分</view>
<view class='order-text'>{{remainingPoints}}</view>
</view>
</view>
<view class='edit'>
<button class='user-motto' bindtap='gotoPay'>{{'确认'+data.salePriceStr+'积分支付'}}</button>
</view>
<view class='al-bg' wx:if='{{showErr}}'></view>
<view class='al-content' wx:if='{{showErr}}'>
<view class='al-top'>
<image src='{{orderGroupFail}}' mode="widthFix"></image>
</view>
<view class='al-center'>您的拼团未成功,退款将在24小时内返回到您的支付账号</view>
<view class='al-bottom' bindtap='gotoIndex'>返回首页</view>
</view>
</view>

+ 446
- 0
pages/integralmall/payIntegcoupondetail/index.wxss View File

@@ -0,0 +1,446 @@
/* pages/spellDetail/index.wxss */
page {
height: auto;
overflow: auto;
background: #f89132;
background-image: url('https://s3.cn-northwest-1.amazonaws.com.cn/iformall-net/cimg/spelldetail-bg.png');
background-size: cover;
background-repeat: no-repeat;
}
.container{
margin-bottom:40rpx;
}
.status{
width: 690rpx;
padding:0 28rpx;
margin: 0 auto;
box-sizing: border-box;
background:rgba(255,255,255,1);
border-radius:15rpx;
}
.edit{
position: fixed;
width: 750rpx;
height: 185rpx;
bottom: 60rpx;
left: 0;
}
.status-top{
width: 100%;
height: 75rpx;
box-sizing: border-box;
border-bottom: 1rpx solid #F9F9F9;
/* overflow: hidden; */
}
.p-status{
float: left;
width: 260rpx;
font-size:32rpx;
font-family:PingFang-SC-Bold;
font-weight:bold;
color:rgba(243,69,58,1);
line-height: 75rpx;
}
.p-time{
float: right;
font-size:26rpx;
font-family:PingFang-SC-Medium;
font-weight:500;
color:rgba(243,69,58,1);
width: 38rpx;
height: 30rpx;
margin-top: 22rpx;
background:rgba(252,220,221,1);
border-radius:10rpx;
line-height: 30rpx;
text-align: center;
margin: 22rpx 6rpx;
}
.p-mao{
float: right;
font-size:26rpx;
font-family:PingFang-SC-Medium;
font-weight:500;
color:rgba(243,69,58,1);
line-height: 75rpx;
}
.p-text{
float: right;
font-size:26rpx;
font-family:PingFang-SC-Regular;
font-weight:400;
color:rgba(51,51,51,1);
line-height:75rpx;
}
.status-center{
width: 100%;
overflow: hidden;
padding: 20rpx 0;
text-align: center;
border-bottom: 1rpx solid #F9F9F9;
}
.tuanzhang{
float: left;
width: 120rpx;
height: 120rpx;
position: relative;
box-sizing:border-box;
}
.touxiangitems{
padding: 20rpx;
margin: 0;
overflow: hidden;
}
.touxiang{
width: 80rpx;
height: 80rpx;
border-radius: 40rpx;
overflow: hidden;
}
.no-touxiang{
width: 80rpx;
height: 80rpx;
overflow: hidden;
background:rgba(252,220,221,1);
border:1rpx solid rgba(243,69,58,1);
border-radius:50%;
box-sizing: border-box;
line-height: 78rpx;
text-align: center;
font-size:32rpx;
font-family:PingFang-SC-Regular;
font-weight:400;
color:rgba(243,69,58,1);
margin: 0;
padding: 0;
}
.touxiang image{
width: 80rpx;
height: 80rpx;
}
.tuan-icon{
position: absolute;
bottom:20rpx;
left:28rpx;
width: 64rpx;
height: 27rpx;
}
.tuan-icon image{
display: block;
width: 64rpx;
height: 27rpx;
}
.status-bottom{
width: 100%;
height: auto;
overflow: hidden;
}
.position-icon{
width: 38rpx;
float: left;
}
.position-icon image{
width: 27rpx;
height: 37rpx;
margin-top: 17rpx;
}
.position{
font-size:28rpx;
font-family:PingFang-SC-Medium;
font-weight:500;
color:rgba(51,51,51,1);
line-height: 72rpx;
}
.detail{
position: relative;
width: 690rpx;
padding:0 28rpx;
margin: 30rpx auto 0;
box-sizing: border-box;
background:rgba(255,255,255,1);
border-radius:15rpx;
}
/* .return-index{
position: absolute;
right: 30rpx;
top: 30rpx;
width: 50rpx;
height: 50rpx;
}
.return-index image{
display: block;
width: 50rpx;
height: 50rpx;
} */
.return-index{
position: fixed;
right: 50rpx;
top: 60rpx;
width:100rpx!important;
height:100rpx;
z-index: 100;
background:rgba(255,255,255,1);
line-height: 95rpx;
border:1rpx solid rgba(227,227,227,1);
border-radius:50%;
}
.return-index image{
position: absolute;
width: 60rpx;
left: 0;
right: 0;
top: 0;
bottom: 0;
margin: auto;
}
.detail-top{
width: 100%;
height: auto;
overflow: hidden;
padding-bottom: 12rpx;
}
.detail-top01{
float: left;
width: 180rpx;
}
.detail-top01 image{
width: 180rpx;
height: 180rpx;
margin-top: 33rpx;
}
.detail-top02{
width: 208rpx;
float: left;
margin-left: 16rpx;
}
.title{
font-size:30rpx;
font-family:PingFang-SC-Bold;
font-weight:bold;
color:rgba(51,51,51,1);
line-height:44rpx;
margin-top: 30rpx;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
}
.des{
font-size:26rpx;
font-family:PingFang-SC-Medium;
font-weight:500;
color:rgba(134,134,134,1);
line-height:40rpx;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
}
.detail-top03{
float: left;
padding-top: 180rpx;
width: 230rpx;
}
.detail-p-name{
float: right;
font-size:26rpx;
font-family:PingFang-SC-Medium;
font-weight:500;
color:rgba(134,134,134,1);
line-height:44rpx;
}
.detail-p-price{
float: right;
font-size:26rpx;
font-family:PingFang-SC-Medium;
font-weight:500;
color:rgba(51,51,51,1);
}
.detail-bottom{
border-top: 1rpx solid #F9F9F9;
width: 100%;
overflow: hidden;
height: 86rpx;
}
.b-unit{
float: right;
font-size:24rpx;
font-family:PingFang-SC-Medium;
font-weight:500;
color:rgba(237,63,46,1);
margin-top: 36rpx;
}
.b-price{
float: right;
font-size:40rpx;
font-family:PingFang-SC-Medium;
font-weight:500;
color:rgba(237,63,46,1);
margin-top: 18rpx;
}
.b-name{
float: right;
font-size:26rpx;
font-family:PingFang-SC-Medium;
font-weight:500;
color:rgba(51,51,51,1);
margin-right: 6rpx;
margin-top: 34rpx;
}
.order{
width: 690rpx;
padding:10rpx 28rpx;
margin: 30rpx auto 0;
box-sizing: border-box;
background:rgba(255,255,255,1);
border-radius:15rpx;
}
.order-list{
height: 55rpx;
}
.order-title{
line-height: 55rpx;
float: left;
font-size:26rpx;
font-family:PingFang-SC-Medium;
font-weight:500;
color:rgba(51,51,51,1);
}
.order-text{
float: right;
text-align: right;
line-height: 55rpx;
font-size:26rpx;
font-family:PingFang-SC-Medium;
font-weight:500;
color:rgba(134,134,134,1);
}
.user-motto {
border: 0;
width:650rpx;
height:85rpx;
background:linear-gradient(90deg,rgba(248,85,45,1) 0%,rgba(241,60,66,1) 0%,rgba(248,86,46,1) 100%);
box-shadow:0px 8rpx 8rpx 1rpx rgba(242,61,65,0.32);
border-radius:43rpx;
font-size:36rpx;
font-family:PingFang-SC-Medium;
font-weight:500;
color:rgba(254,254,254,1);
line-height: 85rpx;
margin-top: 100rpx;
}
.user-motto::after {
border: none;
}
.button button:nth-of-type(1){
width:520rpx;
height:95rpx;
margin: 30rpx auto 38rpx;
background:linear-gradient(90deg,rgba(248,85,45,1) 0%,rgba(241,60,66,1) 0%,rgba(248,86,46,1) 100%);
border-radius:47rpx;
color: #fff;
}
.button button:nth-of-type(2){
width:520rpx;
height:95rpx;
background:rgba(255,255,255,1);
border:1rpx solid rgba(190,190,190,1);
border-radius:47rpx;
color:#333333;
margin-bottom: 50rpx;
}
.alert-bg{
width: 100%;
height: 100vh;
position: fixed;
opacity: 0.7;
background: #000;
top: 0;
left: 0;
z-index: 200;
}
.alert-box{
width: 600rpx;
height: 332rpx;
position: fixed;
z-index: 300;
background: #fff;
top: 50vh;
margin-top: -162rpx;
left: 85rpx;
border-radius:15rpx;
}
.alert-close{
position: absolute;
width: 47rpx;
height: 98rpx;
top: -98rpx;
right: 0;
}
.alert-close image{
width: 47rpx;
height: 98rpx;
}
.alert-title{
text-align: center;
font-size:30rpx;
line-height: 30rpx;
margin-top: 79rpx;
font-family:PingFang-SC-Medium;
font-weight:500;
color:rgba(51,51,51,1);
}
.alert-button .share{
width:500rpx;
height:95rpx;
background:linear-gradient(90deg,rgba(248,85,45,1) 0%,rgba(241,60,66,1) 0%,rgba(248,86,46,1) 100%);
border-radius:47rpx;
margin-top: 79rpx;
}
.al-bg{
position: fixed;
width: 100%;
height: 100vh;
top: 0;
left: 0;
background:rgba(0,0,0,1);
opacity:0.65;
z-index: 200;
}
.al-content{
background: #fff;
position: fixed;
width: 545rpx;
z-index: 300;
top: 200rpx;
left: 102rpx;
border-radius: 15rpx;
}
.al-top{
width: 100%;
}
.al-top image{
position: relative;
height: 298rpx;
margin-top: -96rpx;
width: 545rpx;
}
.al-center{
padding: 80rpx 30rpx;
font-size:30rpx;
font-family:PingFang-SC-Regular;
font-weight:400;
color:rgba(51,51,51,1);
}
.al-bottom{
width:462rpx;
height:95rpx;
background:linear-gradient(90deg,rgba(248,85,45,1) 0%,rgba(241,60,66,1) 0%,rgba(248,86,46,1) 100%);
border-radius:47rpx;
font-size:30rpx;
font-family:PingFang-SC-Medium;
font-weight:500;
color:rgba(255,255,255,1);
text-align: center;
line-height: 95rpx;
margin: 0 auto 43rpx;
}

+ 10
- 0
pages/user/index.wxml View File

@@ -73,6 +73,16 @@
</view>
</view>
</navigator>
<navigator url="/pages/integralmall/index">
<view class="user-btn app-border-bottom">
<view>
<image class='icons' src="{{cardiconUrl}}" mode='widthFix'></image>积分商城</view>
<view>
<text class="couponnum" wx:if="{{couponNum2=='couponNum2'}}"></text>
<text class="iconfont icon-right"></text>
</view>
</view>
</navigator>
<!-- <navigator url="/pages/passCar/passCar" open-type="switchTab">
<view class="user-btn app-border-bottom">
<view>


Loading…
Cancel
Save