Browse Source

[mergr][砍价merge到dev]

tags/同保楼3.3.1
meo 6 years ago
parent
commit
fdcf2f8a3c
38 changed files with 2040 additions and 290 deletions
  1. +7
    -0
      app.json
  2. BIN
      assets/images/bargaincancel.png
  3. BIN
      assets/images/bargainfail.png
  4. BIN
      assets/images/bargainsuccess.png
  5. BIN
      assets/images/discount.png
  6. BIN
      assets/images/goodsimg.png
  7. BIN
      assets/images/icon004.png
  8. BIN
      assets/images/icon01 (4).png
  9. BIN
      assets/images/success01.png
  10. +23
    -6
      config/config.js
  11. +253
    -0
      pages/bargain/bargain.js
  12. +8
    -0
      pages/bargain/bargain.json
  13. +64
    -0
      pages/bargain/bargain.wxml
  14. +407
    -0
      pages/bargain/bargain.wxss
  15. +503
    -0
      pages/bargain/bargainDatail/bargainDatail.js
  16. +4
    -0
      pages/bargain/bargainDatail/bargainDatail.json
  17. +63
    -0
      pages/bargain/bargainDatail/bargainDatail.wxml
  18. +300
    -0
      pages/bargain/bargainDatail/bargainDatail.wxss
  19. +9
    -0
      pages/cardListDetail/cardListDetail.js
  20. +1
    -0
      pages/cardListDetail/cardListDetail.wxml
  21. +2
    -2
      pages/cardorder/index/index.js
  22. +200
    -184
      pages/coupon/detail/index.js
  23. +21
    -15
      pages/coupon/detail/index.wxml
  24. +40
    -2
      pages/coupon/detail/index.wxss
  25. +63
    -59
      pages/getuserinfo/index.js
  26. +24
    -7
      pages/index/index.js
  27. +4
    -0
      pages/index/index.wxml
  28. +2
    -2
      pages/order/detail/index.wxml
  29. +2
    -2
      pages/order/index/index.js
  30. +7
    -1
      pages/order/index/index.wxml
  31. +6
    -1
      pages/order/index/index.wxss
  32. +1
    -1
      pages/passCar/passCar.js
  33. +4
    -3
      pages/specialcourtesy/specialcourtesy.js
  34. +6
    -3
      pages/specialcourtesy/specialcourtesy.wxml
  35. +10
    -0
      pages/specialcourtesy/specialcourtesy.wxss
  36. +1
    -1
      pages/user/index.wxml
  37. +1
    -1
      project.config.json
  38. +4
    -0
      utils/imgurl.js

+ 7
- 0
app.json View File

@@ -1,6 +1,8 @@
{ {
"pages": [ "pages": [
"pages/index/index", "pages/index/index",
"pages/bargain/bargainDatail/bargainDatail",
"pages/bargain/bargain",
"pages/cardorder/index/index", "pages/cardorder/index/index",
"pages/scanPay/scanPay", "pages/scanPay/scanPay",
"pages/edit/edit", "pages/edit/edit",
@@ -49,6 +51,11 @@
"wx192b7d2e8dcbefd0", "wx192b7d2e8dcbefd0",
"wxc07f9d67923d676d" "wxc07f9d67923d676d"
], ],
"permission": {
"scope.userLocation": {
"desc": "你的位置信息将用于小程序位置接口的效果展示"
}
},
"tabBar": { "tabBar": {
"color": "#9F9F9F", "color": "#9F9F9F",
"selectedColor": "#00C0FF", "selectedColor": "#00C0FF",


BIN
assets/images/bargaincancel.png View File

Before After
Width: 140  |  Height: 116  |  Size: 22 KiB

BIN
assets/images/bargainfail.png View File

Before After
Width: 280  |  Height: 232  |  Size: 33 KiB

BIN
assets/images/bargainsuccess.png View File

Before After
Width: 280  |  Height: 232  |  Size: 33 KiB

BIN
assets/images/discount.png View File

Before After
Width: 142  |  Height: 142  |  Size: 27 KiB

BIN
assets/images/goodsimg.png View File

Before After
Width: 360  |  Height: 360  |  Size: 263 KiB

BIN
assets/images/icon004.png View File

Before After
Width: 160  |  Height: 160  |  Size: 13 KiB

BIN
assets/images/icon01 (4).png View File

Before After
Width: 126  |  Height: 126  |  Size: 7.2 KiB

BIN
assets/images/success01.png View File

Before After
Width: 111  |  Height: 111  |  Size: 6.8 KiB

+ 23
- 6
config/config.js View File

@@ -1,11 +1,12 @@
var extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {}; var extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {};
var appId = extConfig.appId; var appId = extConfig.appId;
var config = { var config = {
// url: "https://ciformall.youlane.cn/C/api",
url:"https://c.malls.iformall.com/C/api",
url: "https://ciformall.youlane.cn/C/api",
// url:"https://c.malls.iformall.com/C/api",
// url:'https://ctest.malls.iformall.com/C/api', // url:'https://ctest.malls.iformall.com/C/api',
// url:'http://10.100.33.68:7000/C/api',
// url:'http://10.100.30.173:7000/C/api',
// url: 'http://202.165.179.86:4000/C/api', // url: 'http://202.165.179.86:4000/C/api',
//
api: { api: {
/** /**
* 接口用途:login * 接口用途:login
@@ -191,7 +192,7 @@ var config = {
/** /**
* 获取用户折扣率 * 获取用户折扣率
*/ */
getDiscount:"/user/getDiscount",
getDiscountInfo:"/user/getDiscountInfo",
/** /**
* C端扫B端储值卡交易流水列表接口 * C端扫B端储值卡交易流水列表接口
*/ */
@@ -199,11 +200,27 @@ var config = {
/** /**
* 根据code查询接口 * 根据code查询接口
*/ */
findByCode:"/merchant/findByCode"
findByCode:"/merchant/findByCode",
/**
* 参与砍价
*/
pressOrderJoin:"/press/pressOrderJoin",
/**
* 我的砍价列表
*/
pressOrderList:"/order/pressOrderList",
/**
* 砍价订单详情
*/
pressOrderDetail:"/order/pressOrderDetail",
/**
*
*/
getPressOrderStatus:"/press/getPressOrderStatus"
}, },


weapp: { weapp: {
AppId: "wx30caec1cc16c4634"
AppId: "wxea71200db93d756b"
}, },
ErrorCode: { ErrorCode: {


+ 253
- 0
pages/bargain/bargain.js View File

@@ -0,0 +1,253 @@
var config = require("../../config/config.js");
const Http = require("../../utils/HttpBasics");
const imgurl = require("../../utils/imgurl");

Page({

/**
* 页面的初始数据
*/
data: {
bannerUrl: imgurl.banner.url,
loadingUrl: imgurl.loading.url,
bargaingoods: true,
mybargain: false,
list: [],
lists: [],
page: 1, // 设置加载的第几次,默认是第一次
pageSize: 10, //返回数据的个数
searchLoadingComplete: false, //“没有数据”的变量,默认false,隐藏
allow_load: true, // 是否允许继续加载标识 默认 true 允许,false 加载完成
myorder: false,
actUrl: imgurl.act.url,
loadingUrl: imgurl.loading.url,
flag: null,
},
onShow: function () {
let that = this;
that.getBannerlist();
var todayDate=new Date().getTime();
that.setData({
todayDate:todayDate
})
let myDiscount = wx.getStorageSync('myDiscount');
console.log(myDiscount)
if (myDiscount == 'myDiscount') {
wx.setStorageSync('myDiscount', "dismyDiscount")
that.getList(1, "mybargain");
that.setData({
flag: "mybargain"
})
} else {
wx.setStorageSync('myDiscount', "dismyDiscount")
that.getList(1, "bargaingoods");
that.setData({
flag: "bargaingoods"
})
}
},
/**
* 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, flag) {
var that = this;
if (that.data.allow_load) {
/**
* mybargain: 我的砍价
* bargaingoods: 砍价商品
*/
that.setData({
loading: true,
content: '小主,我在玩命加载中...'
})
var param = {};
if (flag == 'mybargain') {
that.setData({
flag: "mybargain"
})
var param = {
pageNum: pageNum,
pageSize: 6
};
var url = config.api.pressOrderList;
} else if (flag == 'bargaingoods') {
that.setData({
flag: "bargaingoods"
})
var param = {
pageNum: pageNum,
pageSize: 6,
targetAd: 6
};
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
})
})
.catch(err => {
wx.showToast({
title: err.errMsg,
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)
}
},
/**
* 如果是重新砍价,需要重新下单
*/
orderSave: function (couponId,orderId,couponChannelId) {
Http.post({
url: config.api.orderSave,
data: {
couponId: "" + couponId,
couponChannelId:""+couponChannelId,
press: true
}
})
.then(res => {
console.log(res)
wx.navigateTo({
url: `/pages/bargain/bargainDatail/bargainDatail?orderId=${orderId}`
})
})
.catch(err => {
wx.showToast({
title: err.message,
icon: "none"
})
})
},
inviteFriend: function (e) {
/**
* 添加标识
*/
wx.navigateTo({
url: `/pages/bargain/bargainDatail/bargainDatail?orderId=${e.currentTarget.dataset.id}`
})
},
barginAgain: function (e) {
let that = this;
console.log(e)
let couponId = e.currentTarget.dataset.couponid;
let couponChannelId = e.currentTarget.dataset.couponchannelid;
let orderId = e.currentTarget.dataset.id;
that.orderSave(couponId,orderId,couponChannelId)
},
mybargain: function () {
let that = this;
that.setData({
bargaingoods: false,
mybargain: true,
flag: "mybargain",
allow_load: true,
loading: false,
content: ""
})
that.getList(1, 'mybargain');
wx.setNavigationBarTitle({
title: '我的砍价'
})
},
bargaingoods: function () {
let that = this;
that.setData({
bargaingoods: true,
mybargain: false,
flag: "bargaingoods",
allow_load: true,
loading: false,
content: ""
})

that.getList(1, 'bargaingoods');
wx.setNavigationBarTitle({
title: '砍价专场'
})
},
/**
*
* @param {砍价} 邀请好友砍价
*/
invite: function (e) {
console.log(e.currentTarget.dataset.id);
let couponChannelId = e.currentTarget.dataset.id;
let couponId = e.currentTarget.dataset.couponid;
if (couponChannelId && couponId) {
wx.navigateTo({
url: `/pages/coupon/detail/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);
},
})

+ 8
- 0
pages/bargain/bargain.json View File

@@ -0,0 +1,8 @@
{
"navigationBarTitleText": "砍价专场",
"usingComponents": {
"c-banner": "../../components/banner/index",
"i-tab": "../../../dist/tab/index",
"i-tabs": "../../../dist/tabs/index"
}
}

+ 64
- 0
pages/bargain/bargain.wxml View File

@@ -0,0 +1,64 @@
<view class="page" hover-class="none" hover-stop-propagation="false">
<view class="bargaingoods" wx:if="{{bargaingoods}}" hover-class="none" hover-stop-propagation="false">
<view class="banner" wx:if="{{list.length>0}}" hover-class="none" hover-stop-propagation="false">
<c-banner wx:key="unique" list="{{list}}" />
</view>
<view class="list" hover-class="none" hover-stop-propagation="false">
<view class="listitem clearfix" wx:for="{{lists}}" wx:key="{{index}}" hover-class="none" hover-stop-propagation="false">
<image class="fl" src="{{item.coverImg}}" mode="widthFix" lazy-load="true" binderror=""
bindload=""></image>
<view class="fl ri" hover-class="none" hover-stop-propagation="false">
<text class="txt01">{{item.title}}</text>
<text class="txt02">{{item.subTitle}}</text>
<text class="txt03">{{item.priceStr}}元</text>
<text class="txt04">可砍至<text class="money">{{item.salePriceStr}}</text>元</text>
</view>
<view class="botton" hover-class="none" hover-stop-propagation="false" data-couponId='{{item.couponId}}' data-id='{{item.id}}' bindtap='invite'>发起砍价</view>
</view>
<view class='dingdan' wx:if="{{list.length==0}}">
<image src="{{actUrl}}" mode="widthFix"></image>
<text>请您敬请期待</text>
<text>我们正在筹备一大波优惠活动</text>
</view>
<view class="loading" wx:if="{{loading}}"><image src="{{loadingUrl}}" mode="widthFix"></image>{{content}}</view>
<view class='loadingtext' wx:if="{{loadingtext}}">{{loadingtext}}</view>
</view>
</view>
<view class="list mybargain" wx:if="{{mybargain}}" hover-class="none" hover-stop-propagation="false">
<view class="listitem clearfix" wx:for="{{lists}}" wx:key="index" wx:if="{{item.orderStatus == 8||item.orderStatus == 6|| item.orderStatus == 7 || item.orderStatus == 9}}" hover-class="none" hover-stop-propagation="false">
<image class="fl" src="{{item.coverImg}}" mode="widthFix" lazy-load="true" binderror=""
bindload=""></image>
<view class="fl ri" hover-class="none" hover-stop-propagation="false">
<text class="txt01">{{item.title}}</text>
<text class="txt02">{{item.subTitle}}</text>
<text class="txt04 mr" wx:if="{{item.orderStatus != 7}}">距砍价到{{item.salePrice/100}}元还差:{{item.pressCurrentValue/100}}元</text>
<text class="txt04 mr" wx:if="{{item.orderStatus == 7}}">已砍价到底价:{{item.salePrice/100}}元</text>
</view>
<view class="botton1" wx:if="{{item.orderStatus == 6&&todayDate<=item.pressEndDate}}" hover-class="none" hover-stop-propagation="false" data-id="{{item.id}}" bindtap="inviteFriend">邀请好友砍价</view>
<view class="botton3" wx:if="{{item.orderStatus == 6&&todayDate>item.pressEndDate}}" hover-class="none" hover-stop-propagation="false" data-couponChannelId="{{item.couponChannelId}}" data-couponId="{{item.productId}}" data-id="{{item.id}}" bindtap="barginAgain">重新砍价</view>
<view wx:if="{{item.orderStatus == 7}}">
<view class="botton2" hover-class="none" hover-stop-propagation="false" data-id="{{item.id}}" bindtap="inviteFriend">立即支付</view>
<image class="icon" src="./../../assets/images/bargainsuccess.png" lazy-load="true" binderror="" bindload="" />
</view>
<view wx:if="{{item.orderStatus == 8||item.orderStatus == 6&&todayDate>item.pressEndDate}}">
<view class="botton3" hover-class="none" hover-stop-propagation="false" data-couponChannelId="{{item.couponChannelId}}" data-couponId="{{item.productId}}" data-id="{{item.id}}" bindtap="barginAgain">重新砍价</view>
<image class="icon" src="./../../assets/images/bargainfail.png" lazy-load="true" binderror="" bindload="" />
</view>
<view wx:if="{{item.orderStatus == 9}}">
<!-- <view class="botton3" hover-class="none" hover-stop-propagation="false">砍价取消</view> -->
<image class="icon" src="./../../assets/images/bargaincancel.png" lazy-load="true" binderror="" bindload="" />
</view>
</view>
<view class='dingdan' wx:if="{{list.length==0}}">
<image src="{{actUrl}}" mode="widthFix"></image>
<text>请您敬请期待</text>
<text>我们正在筹备一大波优惠活动</text>
</view>
<view class="loading" wx:if="{{loading}}"><image src="{{loadingUrl}}" mode="widthFix"></image>{{content}}</view>
<view class='loadingtext' wx:if="{{loadingtext}}">{{loadingtext}}</view>
</view>
<view class="clearfix buttonfix" hover-class="none" hover-stop-propagation="false">
<view class="{{bargaingoods?'active1':''}}" hover-class="none" hover-stop-propagation="false" bindtap="bargaingoods">砍价商品</view>
<view class="{{ mybargain?'active1':''}} line" hover-class="none" hover-stop-propagation="false" bindtap="mybargain">我的砍价</view>
</view>
</view>

+ 407
- 0
pages/bargain/bargain.wxss View File

@@ -0,0 +1,407 @@
page{
height: auto!important;
}
.banner .bg {
display: block;
width: 100%;
}

.bannerimg {
display: block;
width: 710rpx;
height: 260rpx;
border-radius: 15rpx;
margin: -120rpx auto 0;
}
.list{
padding: 0 32rpx;
}
.listitem .fl {
width: 200rpx;
height: 180rpx!important;
border-radius: 10rpx;
overflow: hidden;
}
.listitem .icon{
width: 140rpx;
height: 116rpx;
position: absolute;
top: 12rpx;
right: 0;
}
.listitem .ri {
margin-left: 26rpx;
width: 305rpx;
}
.ri text{
display: block;
text-align: left;
}
.ri .txt01 {
width: 100%;
font-size:30rpx;
color: rgba(51, 51, 51, 1);
line-height: 44rpx;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
font-weight: bold;
}

.ri .txt02 {
width: 100%;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
font-size: 24rpx;
color: rgba(140, 140, 140, 1);
}
.ri .txt03 {
width: 100%;
font-size:24rpx;
text-decoration:line-through;
color:rgba(140,140,140,1);
}
.ri .txt04 {
width: 100%;
color:#FF3232;
font-size:24rpx;
color:rgba(255,50,50,1);
line-height:44rpx;
}
.money{
display: inline-block!important;
font-size:50rpx;
font-weight:500;
color:rgba(255,50,50,1);
}
.listitem{
position: relative;
padding: 31rpx 0;
border-bottom: 1rpx solid #F9F9F9;
}
.botton{
position: absolute;
right: 0;
text-align: center;
bottom: 40rpx;
width:186rpx;
height:48rpx;
line-height:48rpx;
background:linear-gradient(90deg,rgba(236,59,45,1) 0%,rgba(248,98,52,1) 100%);
border-radius:24rpx;
font-size:26rpx;
color:rgba(255,255,255,1);
}
.botton1{
position: absolute;
right: 0;
text-align: center;
bottom: 31rpx;
width:186rpx;
height:48rpx;
line-height:48rpx;
background:linear-gradient(90deg,rgba(236,59,45,1) 0%,rgba(248,98,52,1) 100%);
border-radius:24rpx;
font-size:26rpx;
color:rgba(255,255,255,1);
}
.botton2{
position: absolute;
right: 0;
text-align: center;
bottom: 31rpx;
border-radius:24rpx;
font-size:26rpx;
line-height:48rpx;
color:rgba(255,255,255,1);
width:134rpx;
height:48rpx;
background:linear-gradient(90deg,rgba(117,158,69,1) 0%,rgba(138,183,79,1) 100%);
}
.botton3{
position: absolute;
right: 0;
text-align: center;
bottom: 31rpx;
line-height:48rpx;
border-radius:24rpx;
font-size:26rpx;
color:rgba(255,255,255,1);
width:134rpx;
height:48rpx;
background:linear-gradient(90deg,rgba(255,145,2,1) 0%,rgba(255,176,22,1) 100%);
}
.buttonfix{
position: fixed;
height: 95rpx;
line-height: 95rpx;
bottom: 0;
left: 0;
right: 0;
display: flex;
flex: 2;
background: #fff;
border-top:1rpx solid #C6C6C6;
justify-content: space-around;
text-align: center;
}
.buttonfix > view{
text-align: center;
font-size: 32rpx;
flex: 1;
}
.active1{
color: #02C0FF!important;
}
.line{
border-left:1rpx solid #C6C6C6;
box-sizing:border-box;
-moz-box-sizing:border-box;
-webkit-box-sizing:border-box;
}
.page{
padding-bottom: 100rpx;
}
.mr{
margin-top: 60rpx;
}
.market {
width: 100%;
height: 100%;
/* background: #f5f5f5; */
}
.tabs {
width: 100% !important;
height: 88rpx;
text-align: center;
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 100000;
}
.i-tab {
width: 25% !important;
display: inline-block;
}
.section {
position: relative;
}
.mms {
position: relative;
width: 690rpx;
height: 197rpx !important;
background: #fff;
padding: 30rpx 0 0;
margin: 0 auto 40rpx;
border-radius: 16rpx;
border-top: 8rpx solid #02b7ff;
box-shadow: 0 6px 20px 0 rgba(0, 0, 0, 0.10);
}
.detail_msg {
display: flex;
padding-bottom: 26rpx;
}
.expiretime {
display: block;
width: 100%;
text-align: left;
text-indent: 1em;
height:54rpx;
line-height:54rpx;
font-size: 26rpx;
color: #333;
letter-spacing: 0;
}
.liness {
display: block;
width: 100%;
}
.logo {
width: 60rpx;
height: 60rpx;
border: 1px solid #f8f8f8;
border-radius: 50rpx;
display: block;
margin-left: 20rpx;
}
.logo image {
width: 60rpx;
height: 60rpx;
border-radius: 50%;
}
.info view:nth-child(1) {
display: flex;
justify-content: space-between;
padding: 0 2%;
}
.info {
width: 100%;
}
.info view:nth-child(1) text {
font-size: 32rpx;
line-height: 32rpx;
height: 32rpx;
color: #333;
letter-spacing: 0;
width: 400rpx;
display: inline-block;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
.info view:nth-child(2) {
padding-left: 2%;
font-size: 22rpx;
color: #333;
letter-spacing: 0;
margin-top: 6rpx;
display: inline-block;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
width: 400rpx;
}
.info view:nth-child(3) {
margin-left: 20rpx;
}
.btns {
position: absolute;
right: 30rpx;
top: 38rpx;
width: 120rpx;
height: 48rpx;
line-height: 48rpx;
text-align: center;
border: 2rpx solid #02c0ff;
border-radius: 60rpx;
color: #02c0ff;
font-size: 28rpx;
}
.active {
color: #fff;
background: #02c0ff;
}
.txt1 {
font-size: 26rpx;
color: #333;
letter-spacing: 0;
}
.nocoupon image {
width: 300rpx;
display: block;
margin: 3% auto 0;
}
.txt001 {
display: block;
line-height: 48rpx;
font-size: 34rpx;
color: #333;
letter-spacing: 0;
text-align: center;
}
.txt002 {
display: block;
margin-top: 1%;
font-size: 28rpx;
color: #999;
letter-spacing: 0;
line-height: 40rpx;
text-align: center;
}
.nocoupon button {
background: #00c0ff;
color: #fff;
font-style: 30rpx;
width: 100%;
border-radius: 60rpx;
}
.loading {
text-align: center;
height: 80rpx;
line-height: 80rpx;
font-size: 26rpx;
color: #999;
}
.loading image {
width: 60rpx;
height: 60rpx;
vertical-align: middle;
margin-right: 10rpx;
}
.active {
opacity: 0.6;
}
.nav {
position: absolute;
bottom: 3.3%;
left: 0;
right: 0;
margin: auto;
width: 670rpx;
border-radius: 60rpx;
background: #02c0ff;
font-size: 32px;
color: #fff;
text-align: center;
line-height: 32px;
}
.sendImg{
position: absolute;
width: 100rpx;
top:109rpx;
right:72rpx;
}
.dingdan {
margin-top: 33rpx;
}
.dingdan text:nth-of-type(1) {
display: block;
font-size: 34rpx;
color: #333;
letter-spacing: 0;
text-align: center;
}
.dingdan text:nth-of-type(2) {
display: block;
font-size: 28rpx;
color: #999;
letter-spacing: 0;
text-align: center;
}
.dingdan image {
display: block;
width: 300rpx;
height: 300rpx;
margin: 0 auto 16rpx;
}

+ 503
- 0
pages/bargain/bargainDatail/bargainDatail.js View File

@@ -0,0 +1,503 @@
var config = require("../../../config/config.js");
var app = getApp();
const Http = require("../../../utils/HttpBasics");
const util = require("../../../utils/util");
const imgurl = require("../../../utils/imgurl");
Page({

/**
* 页面的初始数据
*/
data: {
bannerUrl: imgurl.banner.url,
data: null,
from: null,
hour: null,
min: null,
sec: null,
showPage: false,
},

/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
let that = this;
console.log(options)
if (options.orderId || options.orderId && options.from == 'discount') {
if (options.from) {
that.setData({
orderId: options.orderId,
from: "discount"
})
} else {
that.setData({
orderId: options.orderId
})
}
that.pressOrderDetail(options.orderId);
// that.getPressOrderStatus(options.orderId)
}
},
/**
* 更多砍价商品
*/
gotomore: function() {
wx.navigateTo({
url: '/pages/bargain/bargain',
})
},
/**
* @param {砍价状态(1:我发起的砍价,2:未参与的砍价, 3:已参与的砍价)} orderId
*/
getPressOrderStatus: function(orderId) {
let that = this;
Http.post({
url: config.api.getPressOrderStatus,
data: {
orderId: orderId
}
})
.then(res => {
if (res.data.status == 1) {
that.setData({
discountStatus: 1
})
} else if (res.data.status == 2) {
that.setData({
discountStatus: 2
})
} else if (res.data.status == 3) {
that.setData({
discountStatus: 3
})
}
wx.stopPullDownRefresh();
})
.catch(err => {
wx.stopPullDownRefresh();
wx.showToast({
title: err.message,
icon: "none"
})
})
},
helpDiscount: function() {
let that = this;
that.pressOrderJoin(that.data.orderId);
},
//参与砍价
pressOrderJoin: function(orderId) {
let that = this;
Http.post({
url: config.api.pressOrderJoin,
data: {
orderId: orderId
}
})
.then(res => {
console.log(res);
// id 是订单号
that.pressOrderDetail(orderId);
})
.catch(err => {
console.log(err)
wx.showToast({
title: err.message,
icon: "none"
})
})
},
// 订单详情
pressOrderDetail: function(orderId) {
let that = this;
Http.get({
url: config.api.pressOrderDetail,
data: {
orderId: orderId
}
})
.then(res => {
console.log(res);
that.getPressOrderStatus(orderId);
res.data.orderPressList.map(file => {
file.createDate = diffTime(file.createDate)
})
that.countdown(res.data.pressEndDate);
that.setData({
data: res.data,
already: (res.data.price / 100 - res.data.salePrice / 100 - res.data.pressCurrentValue / 100).toFixed(2),
remain: (res.data.pressCurrentValue / 100).toFixed(2),
showPage: true
})
})
.catch(err => {
wx.showToast({
title: err.message,
icon: "none"
})
wx.stopPullDownRefresh();
})
},
onShow: function() {
let that = this;
wx.setStorageSync('myDiscount', "myDiscount");
var todayDate = new Date().getTime();
that.setData({
todayDate: todayDate,
})
},
countdown(end_time) {
let that = this;
var EndTime = end_time;
var NowTime = new Date().getTime();
var total_micro_second = EndTime - NowTime || [];
// 渲染倒计时时钟
let obj = that.dateformat(total_micro_second);
if (total_micro_second > 0) {
that.setData({
clock: obj,
day: obj.a1,
hour: obj.b1,
min: obj.c1,
sec: obj.d1,
})
} else {
that.setData({
clock: "00",
day: "00",
hour: "00",
min: "00",
sec: "00",
})
}
setTimeout(function() {
total_micro_second -= 1000;
that.countdown(end_time);
}, 1000)
},

// 时间格式化输出,如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
}
},
payOrderUpdate: (orderId, payOrderId, status, reason, type, _this) => {
let that = this;
// 支付成功
Http.post({
url: config.api.payOrderUpdate,
data: {
payOrderId: payOrderId,
orderId: orderId,
status: status,
reason: reason
}
})
.then(res => {
wx.hideLoading()
// 有价券
if (!type && type != 'free') {
wx.navigateTo({
url: `/pages/order/detail/index?orderId=${
orderId
}`
});
} else if (type == 'free') {
wx.navigateTo({
url: `/pages/order/detail/index?orderId=${
orderId
}`
});
}
})
.catch(err => {
console.log(err);
if (!type) {
setTimeout(function() {
_this.payOrderUpdate(orderId, payOrderId, status, reason, type, _this);
}, 2000)
}
})
},
/**
* 发起支付
*/
orderFunc(e) {
var that = this;
console.log(e)
Http.post({
url: config.api.checkPhoneStatus,
data: {}
})
.then(res => {
if (typeof(res) != "undefined") {
let orderId = "" + e.currentTarget.dataset.orderid;
that.setData({
orderId: orderId
});
if (e.currentTarget.dataset.saleprice / 100 > 0 || e.currentTarget.dataset.price / 100 > 0) {
/**
* 支付订单创建
*/
Http.post({
url: config.api.payOrderCreate,
data: {
orderId: 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.orderId, payOrderId, 1, '', '', that);
if (res.errMsg == "requestPayment:ok") {
setTimeout(function() {
wx.hideLoading();
}, 2000);
/**
* 用户支付成功以后跳转到券包列表
*/
if (that.data.cardType == 7) {
wx.setStorage({
key: 'couponNum2',
data: "couponNum2"
})
} else {
wx.setStorage({
key: 'couponNum',
data: "couponNum"
})
}
}
},
fail: res => {
/**
* 支付失败,需要更新订单的状态
*/
that.payOrderUpdate(that.data.orderId, payOrderId, 2, '', 'fail', that);
that.setData({
showbutton: false
})
return;
},
complete: res => {}
});
/// End payment --------
})
.catch(err => {
console.log(err);
wx.showToast({
title: err.message,
icon: 'none',
duration: 2000,
mask: false
});
})
} else {
// 免费券
that.payOrderUpdate(orderId, "0", 1, '', 'free');
if (that.data.cardType == 7) {
wx.setStorage({
key: 'couponNum2',
data: "couponNum2"
})
} else {
wx.setStorage({
key: 'couponNum',
data: "couponNum"
})
}
}
}
})
.catch(err => {
if (err.code == 2011) {
wx.showToast({
title: "商户信息没找到",
image: './../../../assets/images/fail.png',
duration: 2000,
mask: false
});
} else if (err.code == 2013) {
wx.showToast({
title: "商户信息禁用",
image: './../../../assets/images/fail.png',
duration: 2000,
mask: false
});
} else if (err.code == 3000) {
wx.showToast({
title: "库存不足",
image: './../../../assets/images/fail.png',
duration: 2000,
mask: false
});
} else if (err.code == 3001) {
wx.showToast({
title: "领取达到上限",
image: './../../../assets/images/fail.png',
duration: 2000,
mask: false
});
} else if (err.code == 3002) {
wx.showToast({
title: "订单失败",
image: './../../../assets/images/fail.png',
duration: 2000,
mask: false
});
} else if (err.code == 3003) {
wx.showToast({
title: "订单不存在",
image: './../../../assets/images/fail.png',
duration: 2000,
mask: false
});
} else if (err.code == 3004) {
wx.showToast({
title: "订单不存在",
image: './../../../assets/images/fail.png',
duration: 2000,
mask: false
});
} else if (err.code == 4003) {
wx.showToast({
title: "卡券已作废",
image: './../../../assets/images/fail.png',
duration: 2000,
mask: false
});
} else if (err.code == 11005) {
/**
* 将值传到用户手机号授权的页面
*
*/
wx.redirectTo({
url: "/pages/getphoneInfo/index?couponChannelId=" +
that.data.couponChannelId +
"&couponId=" +
that.data.couponId
});
} else if (err.code == 11006) {
// 用户手机已加密
wx.redirectTo({
url: "/pages/phoneinput/phoneinput?couponChannelId=" +
that.data.couponChannelId +
"&couponId=" +
that.data.couponId
});
} else {
wx.showToast({
title: err.message,
icon: 'none',
duration: 2000,
mask: false
});
}
})
},
/**
*
* @param {朋友邀请砍价} e
*/
barginAgain: function(e) {
let couponChannelId = e.currentTarget.dataset.couponchannelid;
let couponId = e.currentTarget.dataset.couponid;
wx.navigateTo({
url: `/pages/coupon/detail/index?couponChannelId=${couponChannelId}&couponId=${couponId}`,
})
},
/**
* 刷新
*/
onPullDownRefresh: function (e) {
let that = this;
if (that.data.orderId || that.data.orderId && that.data.from == 'discount') {
if (that.data.from) {
that.setData({
orderId: that.data.orderId,
from: "discount"
})
} else {
that.setData({
orderId: that.data.orderId
})
}
that.pressOrderDetail(that.data.orderId);
}
},
onShareAppMessage: function(options) {
console.log(options)
var that = this;
console.log(that.data.data.id)
var shareObj = {
title: that.data.data.title,
path: `/pages/index/index?orderId=${that.data.data.id}&from=${"discount"}`,
success: function(res) {
if (res.errMsg == 'shareAppMessage:ok') {}
},
fail: function(error) {
if (res.errMsg == 'shareAppMessage:fail cancel') {} else if (res.errMsg == 'shareAppMessage:fail') {}
}
};
// 来自页面内的按钮的转发
if (options.from == 'button') {
var orderId = options.target.dataset.orderid;
shareObj.path = `/pages/index/index?orderId=${orderId}&from=${"discount"}`;
}
// 返回shareObj
return shareObj;
},
})

function diffTime(startDate) {
var diff = new Date().getTime() - startDate;
var days = Math.floor(diff / (24 * 3600 * 1000));
var leave1 = diff % (24 * 3600 * 1000);
var hours = Math.floor(leave1 / (3600 * 1000));
var leave2 = leave1 % (3600 * 1000);
var minutes = Math.floor(leave2 / (60 * 1000));
var leave3 = leave2 % (60 * 1000);
var seconds = Math.round(leave3 / 1000);

var returnStr = seconds + "秒";
if (minutes > 0) {
returnStr = minutes + "分" + returnStr;
}
if (hours > 0) {
returnStr = hours + "小时" + returnStr;
}
if (days > 0) {
returnStr = days + "天" + returnStr;
}
return returnStr;
}

+ 4
- 0
pages/bargain/bargainDatail/bargainDatail.json View File

@@ -0,0 +1,4 @@
{
"navigationBarTitleText": "砍价详情",
"enablePullDownRefresh": true
}

+ 63
- 0
pages/bargain/bargainDatail/bargainDatail.wxml View File

@@ -0,0 +1,63 @@
<view class="bargainDetail" hover-class="none" hover-stop-propagation="false" wx:if="{{showPage}}">
<view class="listitem clearfix" hover-class="none" hover-stop-propagation="false">
<image class="fl" src="{{data.coverImg}}" lazy-load="true" binderror=""
bindload=""></image>
<view class="fl ri" hover-class="none" hover-stop-propagation="false">
<text class="txt01">{{data.title}}</text>
<text class="txt02">{{data.subTitle}}</text>
<text class="txt03">{{data.price/100}}元</text>
<text class="txt04">可砍至<text class="money">{{data.salePrice/100}}</text>元</text>
</view>
</view>
<view class="progress" hover-class="none" hover-stop-propagation="false" wx:if="{{data.orderStatus != 8}}">
<view class="clearfix progesstext" hover-class="none" hover-stop-propagation="false">
<text class="fl">已砍 <text>{{already}}元</text></text>
<text class="fr" wx:if="{{data.pressCurrentValue/100!=0}}">还剩 <text>{{remain}}元</text></text>
</view>
<progress percent="{{((data.price-data.salePrice-data.pressCurrentValue)/(data.price-data.salePrice))*100}}" color="#FF3535" class="progressbar"border-radius="10px" backgroundColor="#FECFCF" stroke-width="10" />
<view class="time" hover-class="none" hover-stop-propagation="false" wx:if="{{data.orderStatus != 7}}">
还剩 <text>{{hour}}</text>:<text>{{min}}</text>:<text>{{sec}}</text> 结束
</view>
</view>
<view class="fail" hover-class="none" hover-stop-propagation="false" wx:if="{{todayDate>data.pressEndDate && from=='discount'&& discountStatus !=1}}">
好友的砍价已过期
</view>
<view class="status" hover-class="none" hover-stop-propagation="false" wx:if="{{discountStatus==3}}">
<button bindtap="barginAgain" data-couponChannelId="{{data.couponChannelId}}" data-couponId="{{data.productId}}" data-id="{{data.id}}">发起砍价</button>
<button bindtap="gotomore">更多砍价商品</button>
</view>
<view class="success" wx:if="{{data.orderStatus == 7}}" hover-class="none" hover-stop-propagation="false">
<image src="./../../../assets/images/success01.png" mode="widthFix"></image>
<text class="" selectable="false" space="false" decode="false">
砍价成功
</text>
</view>
<view wx:if="{{data.orderStatus == 6&&discountStatus == 2}}">
<button bindtap='helpDiscount' class='helpDiscount'>帮好友砍价</button>
</view>

<view class="people" hover-class="none" hover-stop-propagation="false">
<view class="clearfix person" wx:for="{{data.orderPressList}}" wx:key="index">
<view class="head fl">
<image class="headicon" src="{{item.avatarUrl}}" mode="widthFix" lazy-load="true" binderror="" bindload="" />
<text wx:if="{{item.first==1}}">发起人</text>
</view>
<view class="text fl clearfix">
<text class="text01 fl"><text>{{item.nickName}}</text>砍价成功!</text>
<text class="text02 fl"><text class="fl">砍掉</text><text class="fl">{{item.pressValue/100}}元</text></text>
<text class="text03 fr">{{item.createDate}}前</text>
</view>
</view>
</view>

<view wx:if="{{data.orderStatus != 7&&discountStatus==1}}" class="btns clearfix" hover-class="none" hover-stop-propagation="false">
<view class="fl" bindtap='orderFunc' data-orderId="{{data.id}}" data-price="{{data.price/100}}">
<text>{{data.price/100}}元</text>
<text>立即购买</text>
</view>
<button class='share user-motto fr' data-orderId='{{data.id}}' id="shareBtn" open-type="share" hover-class="other-button-hover">邀请好友继续砍价</button>
</view>
<view wx:if="{{data.orderStatus == 7&&discountStatus == 1}}" class="btns01 clearfix" hover-class="none" hover-stop-propagation="false">
<button bindtap='orderFunc' data-orderId="{{data.id}}" data-salePrice="{{data.salePrice/100}}" hover-class="other-button-hover">{{data.salePrice/100}}元 底价购买</button>
</view>
</view>

+ 300
- 0
pages/bargain/bargainDatail/bargainDatail.wxss View File

@@ -0,0 +1,300 @@
.bargainDetail {
padding: 0 33rpx 0;
}

.listitem .fl {
width: 180rpx;
height: 180rpx;
border-radius:10rpx;
}

.listitem .icon {
width: 140rpx;
height: 116rpx;
position: absolute;
top: 12rpx;
right: 0;
}

.listitem .ri {
margin-left: 26rpx;
width: 305rpx;
}

.ri text {
display: block;
text-align: left;
}

.ri .txt01 {
width: 100%;
color: rgba(51, 51, 51, 1);
line-height: 44rpx;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}

.ri .txt02 {
width: 100%;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
font-size: 24rpx;
color: rgba(140, 140, 140, 1);
}

.ri .txt03 {
width: 100%;
font-size: 24rpx;
text-decoration: line-through;
color: rgba(140, 140, 140, 1);
}

.ri .txt04 {
width: 100%;
font-size: 24rpx;
color: rgba(255, 50, 50, 1);
line-height: 44rpx;
}

.money {
display: inline-block !important;
font-size: 50rpx;
font-weight: 500;
color: rgba(255, 50, 50, 1);
}

.listitem {
position: relative;
padding: 31rpx 0;
}

.progress {
width: 519rpx;
padding: 30rpx 84rpx 50rpx;
/* height: 136rpx; */
background: rgba(255, 245, 240, 1);
border-radius: 10rpx;
margin: 0 auto;
}

.progesstext {
margin-bottom: 13rpx;
}

.progesstext>text {
font-size: 24rpx;
color: rgba(51, 51, 51, 1);
}

.progesstext text text {
color: #FF3535;
}

.time {
margin-top: 20rpx;
font-size: 24rpx;
color: #333;
text-align:center;
}

.time text {
font-size: 30rpx;
color: #fff;
display: inline-block;
width: 40rpx;
text-align: center;
height: 40rpx;
line-height: 40rpx;
background: rgba(51, 51, 51, 1);
border-radius: 10rpx;
}
.head{
width:10%;
height: 90rpx;
position: relative;
}
.head image{
width: 70rpx;
border-radius:10rpx;
}
.head text{
width: 70rpx;
position: absolute;
bottom: 0;
left: 0;
right: 0;
font-size: 20rpx;
background: #ED3F2E;
color: #fff;
text-align: center;
border-radius: 20rpx;
}
.text{
width: 87%;
padding-left: 3%;
display: inline-block;
height: 90rpx;
line-height: 90rpx;
font-size: 26rpx;
}
.text01{
width: 220rpx;
margin-right: 6rpx;
overflow: hidden;
}
.text01 text{
width: 100rpx;
float: left;
height: 90rpx;
line-height: 90rpx;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
.text02{
display: inline-block;
width: 140rpx;
overflow: hidden;
}
.text03{
width: 212rpx;
overflow: hidden;
text-align: right;
font-size:24rpx;
}
.person{
border-bottom: 1px solid #F9F9F9;
padding-bottom: 31rpx;
padding-top: 31rpx;
}
.text02 text:nth-of-type(2){
width: 80rpx;
overflow: hidden;
color: #FF3535;
white-space: nowrap;
text-overflow: ellipsis;
text-align: left;
}
.people{
margin-top: 20rpx;
padding-bottom: 130rpx;
}
.btns{
padding:33rpx;
position: fixed;
left: 0;
right: 0;
bottom: 0;
z-index: 100;
background: #fff;
}
.btns > view,.btns > button{
width: 330rpx;
height: 95rpx;
border-radius:48rpx;
text-align: center;
}
.btns .fl{
color: #fff;
background:rgba(255,169,2,1);
box-shadow:0px 8px 8px 1px rgba(255,169,2,0.32);
}
.btns .fl text{
display: block;
font-size: 30rpx;
line-height: 34rpx;
}
.btns .fl text:nth-of-type(1){
margin-top: 12rpx;
}
.btns .fr{
font-size: 30rpx;
color: #fff;
line-height: 95rpx;
background:linear-gradient(90deg,rgba(236,59,45,1) 0%,rgba(248,98,52,1) 100%);
box-shadow:0px 8px 8px 1px rgba(246,93,51,0.32);
}
.helpDiscount{
display: block;
width: 200rpx;
height: 200rpx;
border-radius:50%;
font-size: 24rpx;
text-align: center;
line-height: 200rpx;
margin-top: 30rpx;
}
.helpDiscount::after{ border: none; }
.success{
margin-top: 50rpx;
}
.success image{
display: block;
width: 74rpx;
height: 74rpx;
margin: 0 auto;
}
.success text{
display: block;
text-align: center;
font-size:30rpx;
line-height: 30rpx;
color:rgba(51,51,51,1);
}
.btns01{
position: fixed;
left: 0;
right: 0;
bottom: 0;
background: #fff;
padding: 30rpx 0;
}
.btns01 button{
color: #fff;
color:rgba(254,254,254,1);
width:650rpx;
height:85rpx;
line-height: 85rpx;
background:linear-gradient(90deg,rgba(236,59,45,1) 0%,rgba(248,98,52,1) 100%);
box-shadow:0px 8px 8px 1px rgba(246,93,51,0.32);
border-radius:43rpx;
}
.fail{
width:687rpx;
height:166rpx;
background:rgba(226,226,226,1);
border-radius:10rpx;
font-size:30rpx;
text-align: center;
line-height: 166rpx;
color:rgba(51,51,51,1);
margin: 20rpx auto 0;
}
.status{
width: 520rpx;
margin: 40rpx auto 0;
}
.status button{
display: block;
width: 520rpx;
height: 95rpx;
line-height: 95rpx;
text-align: center;
border: none;
}
.status button:nth-of-type(1){
background:linear-gradient(90deg,rgba(236,59,45,1) 0%,rgba(248,98,52,1) 100%);
border:1rpx solid rgba(236,59,45,1);
border-radius:48rpx;
margin-bottom: 38rpx;
color: #fff;
}
.status button:nth-of-type(2){
background:rgba(255,255,255,1);
border:1rpx solid rgba(190,190,190,1);
border-radius:48rpx;
width:520rpx;
color: #333;
}

+ 9
- 0
pages/cardListDetail/cardListDetail.js View File

@@ -234,6 +234,15 @@ Page({
that.countdown(res.data.endTime); that.countdown(res.data.endTime);
//当前时间与优惠券下架时间做计算 //当前时间与优惠券下架时间做计算
var endTime = util.formatTime(res.data.endTime, "yyyy-MM-dd hh:mm:ss"); var endTime = util.formatTime(res.data.endTime, "yyyy-MM-dd hh:mm:ss");
if (util.timechuo(endTime).indexOf('-') == 0) {
that.setData({
endtime: "活动已结束",
});
} else {
that.setData({
endtime: util.timechuo(endTime)
});
}
} }
wx.hideLoading(); wx.hideLoading();
that.setData({ that.setData({


+ 1
- 0
pages/cardListDetail/cardListDetail.wxml View File

@@ -1,4 +1,5 @@
<view wx:if="{{showPage}}"> <view wx:if="{{showPage}}">
<!-- 券的详情页面 -->
<view class='coupons'> <view class='coupons'>
<view class="coupons-body"> <view class="coupons-body">
<view class='banner'> <view class='banner'>


+ 2
- 2
pages/cardorder/index/index.js View File

@@ -122,14 +122,14 @@ Page({
var data = { var data = {
pageNum: pageNum, pageNum: pageNum,
pageSize: 6, pageSize: 6,
couponType: "7",
couponType: "100",
couponOrderStatus: 4 couponOrderStatus: 4
} }
} else if (key == '5,6,7') { } else if (key == '5,6,7') {
var data = { var data = {
pageNum: pageNum, pageNum: pageNum,
pageSize: 6, pageSize: 6,
couponType: "7",
couponType: "100",
statusStr: "5,6,7" statusStr: "5,6,7"
} }
} }


+ 200
- 184
pages/coupon/detail/index.js View File

@@ -5,17 +5,17 @@ const util = require("../../../utils/util");
const imgurl = require("../../../utils/imgurl"); const imgurl = require("../../../utils/imgurl");
Page({ Page({
data: { data: {
fenxiangUrl:imgurl.fenxiang.url,
clockUrl:imgurl.clock.url,
teljpgUrl:imgurl.teljpg.url,
closedUrl:imgurl.closed.url,
quesGouUrl:imgurl.ques_gou.url,
headbgUrl:imgurl.headbg.url,
quesBgUrl:imgurl.ques_bg.url,
fenxiangUrl: imgurl.fenxiang.url,
clockUrl: imgurl.clock.url,
teljpgUrl: imgurl.teljpg.url,
closedUrl: imgurl.closed.url,
quesGouUrl: imgurl.ques_gou.url,
headbgUrl: imgurl.headbg.url,
quesBgUrl: imgurl.ques_bg.url,
data: { data: {
title: null title: null
}, },
showPage:false,
showPage: false,
questions1: null, questions1: null,
questions2: null, questions2: null,
carList: [], carList: [],
@@ -42,11 +42,11 @@ Page({
scaleData: null, scaleData: null,
skewData: null, skewData: null,
matrixData: null, matrixData: null,
opacity:0,
queueData:null,
zIndex:11,
display:"none",
showbutton:false
opacity: 0,
queueData: null,
zIndex: 11,
display: "none",
showbutton: false
}, },
phone: function (e) { phone: function (e) {
let that = this; let that = this;
@@ -122,7 +122,7 @@ Page({
let that = this; let that = this;
that.setData({ that.setData({
queueData: null, queueData: null,
showbutton:true
showbutton: true
}) })
Http.get({ Http.get({
url: config.api.getQuestion, url: config.api.getQuestion,
@@ -144,9 +144,9 @@ Page({
}) })
that.setData({ that.setData({
queueData: animation.export(), queueData: animation.export(),
zIndex:9,
opacity:1,
display:"block",
zIndex: 9,
opacity: 1,
display: "block",
questionnaire: JSON.parse(res.data.content), questionnaire: JSON.parse(res.data.content),
questionId: res.data.id questionId: res.data.id
}); });
@@ -223,7 +223,7 @@ Page({
couponId: options.couponId, couponId: options.couponId,
title: that.data.data.title ? that.data.data.title : '', title: that.data.data.title ? that.data.data.title : '',
}); });
if(options.cardType){
if (options.cardType) {
that.setData({ that.setData({
cardType: options.cardType cardType: options.cardType
}) })
@@ -235,54 +235,63 @@ Page({
} }
}; };
Http.get(parmer) Http.get(parmer)
.then(res => {
if(res.code==200){
.then(res => {
if (res.code == 200) {
that.setData({
showPage: true
})
}
if (res.data.type == 7) {
wx.setNavigationBarTitle({
title: "卡详情"
})
}
if (res.data.endTime) {
that.countdown(res.data.endTime);
//当前时间与优惠券下架时间做计算
var endTime = util.formatTime(res.data.endTime, "yyyy-MM-dd hh:mm:ss");
if (util.timechuo(endTime).indexOf('-') == 0) {
that.setData({
endtime: "活动已结束",
});
} else {
that.setData({
endtime: util.timechuo(endTime)
});
}
}
wx.hideLoading();
that.setData({ that.setData({
showPage:true
})
}
if(res.data.type==7){
wx.setNavigationBarTitle({
title: "卡详情"
})
}
if (res.data.endTime) {
that.countdown(res.data.endTime);
//当前时间与优惠券下架时间做计算
var endTime = util.formatTime(res.data.endTime, "yyyy-MM-dd hh:mm:ss");
if (util.timechuo(endTime).indexOf('-') == 0) {
data: res.data
});

if (res.data.validType == 1) {
that.setData({ that.setData({
endtime: "活动已结束",
validStartDate: util.formatTime(res.data.validStartDate, "yyyy-MM-dd"),
validEndDate: util.formatTime(res.data.validEndDate, "yyyy-MM-dd"),
}); });
} else { } else {
that.setData({
endtime: util.timechuo(endTime)
});
if (res.data.validDays) {
that.setData({
validDays: res.data.validDays
});
}
} }
}
wx.hideLoading();
that.setData({
data: res.data
});

if (res.data.validType == 1) {
that.setData({
validStartDate: util.formatTime(res.data.validStartDate, "yyyy-MM-dd"),
validEndDate: util.formatTime(res.data.validEndDate, "yyyy-MM-dd"),
});
} else {
that.setData({
validDays: res.data.validDays
}).catch(err => {
wx.showToast({
title: err.message,
icon: 'none',
duration: 2000,
mask: false
}); });
}
}).catch(err => {
wx.showToast({
title: err.message,
icon: 'none',
duration: 2000,
mask: false
});
})
})
},
/**
* 邀请好友继续砍价
*/
inviteFriend: function () {
let that = this;
that.orderFunc("discount");
}, },
/** /**
* 支付订单更新 * 支付订单更新
@@ -302,13 +311,13 @@ Page({
.then(res => { .then(res => {
wx.hideLoading() wx.hideLoading()
// 有价券 // 有价券
if (!type&&type!='free') {
if (!type && type != 'free') {
wx.navigateTo({ wx.navigateTo({
url: `/pages/order/detail/index?orderId=${ url: `/pages/order/detail/index?orderId=${
orderId orderId
}` }`
}); });
}else if(type=='free'){
} else if (type == 'free') {
wx.navigateTo({ wx.navigateTo({
url: `/pages/order/detail/index?orderId=${ url: `/pages/order/detail/index?orderId=${
orderId orderId
@@ -328,119 +337,126 @@ Page({
/** /**
* 发起支付 * 发起支付
*/ */
orderFunc(flag) {
orderFunc(discount) {
var that = this; var that = this;
// wx.showLoading({
// title: "加载中..."
// });
Http.post({
url: config.api.checkPhoneStatus,
data: {}
})
.then(res => {
Http.post({
url: config.api.checkPhoneStatus,
data: {}
})
.then(res => {
if (discount == 'discount') {
var data = { var data = {
couponChannelId: "" + that.data.couponChannelId, couponChannelId: "" + that.data.couponChannelId,
couponId: "" + that.data.couponId,
press: true
}
} else if (that.data.couponChannelId == null) {
var data = {
couponId: "" + that.data.couponId couponId: "" + that.data.couponId
}; };
if (that.data.couponChannelId == null) {
var data = {
couponId: "" + that.data.couponId
};
} else {
var data = {
couponChannelId: "" + that.data.couponChannelId,
couponId: "" + that.data.couponId,
} }
}
/**
* orderSave 下单
*/
return Http.post({
url: config.api.orderSave,
data: data
});
})
.catch(err => {
console.log(err);
if (err.code == 2011) {
wx.showToast({
title: "商户信息没找到",
image: './../../../assets/images/fail.png',
duration: 2000,
mask: false
});
} else if (err.code == 2013) {
wx.showToast({
title: "商户信息禁用",
image: './../../../assets/images/fail.png',
duration: 2000,
mask: false
});
} else if (err.code == 3000) {
wx.showToast({
title: "库存不足",
image: './../../../assets/images/fail.png',
duration: 2000,
mask: false
});
} else if (err.code == 3001) {
wx.showToast({
title: "领取达到上限",
image: './../../../assets/images/fail.png',
duration: 2000,
mask: false
});
} else if (err.code == 3002) {
wx.showToast({
title: "订单失败",
image: './../../../assets/images/fail.png',
duration: 2000,
mask: false
});
} else if (err.code == 3003) {
wx.showToast({
title: "订单不存在",
image: './../../../assets/images/fail.png',
duration: 2000,
mask: false
});
} else if (err.code == 3004) {
wx.showToast({
title: "订单不存在",
image: './../../../assets/images/fail.png',
duration: 2000,
mask: false
});
} else if (err.code == 4003) {
wx.showToast({
title: "卡券已作废",
image: './../../../assets/images/fail.png',
duration: 2000,
mask: false
});
} else if (err.code == 11005) {
/** /**
* orderSave 下单
* 将值传到用户手机号授权的页面
*
*/ */
return Http.post({
url: config.api.orderSave,
data: data
wx.redirectTo({
url: "/pages/getphoneInfo/index?couponChannelId=" +
that.data.couponChannelId +
"&couponId=" +
that.data.couponId
}); });
})
.catch(err => {
if (err.code == "2011") {
wx.showToast({
title: "商户信息没找到",
image:'./../../../assets/images/fail.png',
duration: 2000,
mask: false
});
} else if (err.code == "2013") {
wx.showToast({
title: "商户信息禁用",
image:'./../../../assets/images/fail.png',
duration: 2000,
mask: false
});
} else if (err.code == "3000") {
wx.showToast({
title: "库存不足",
image:'./../../../assets/images/fail.png',
duration: 2000,
mask: false
});
} else if (err.code == "3001") {
wx.showToast({
title: "领取达到上限",
image:'./../../../assets/images/fail.png',
duration: 2000,
mask: false
});
} else if (err.code == "3002") {
wx.showToast({
title: "订单失败",
image:'./../../../assets/images/fail.png',
duration: 2000,
mask: false
});
} else if (err.code == "3003") {
wx.showToast({
title: "订单不存在",
image:'./../../../assets/images/fail.png',
duration: 2000,
mask: false
});
} else if (err.code == "3004") {
wx.showToast({
title: "订单不存在",
image:'./../../../assets/images/fail.png',
duration: 2000,
mask: false
});
} else if (err.code == "4003") {
wx.showToast({
title: "卡券已作废",
image:'./../../../assets/images/fail.png',
duration: 2000,
mask: false
});
} else if (err.code == 11005) {
/**
* 将值传到用户手机号授权的页面
*
*/
wx.redirectTo({
url: "/pages/getphoneInfo/index?couponChannelId=" +
that.data.couponChannelId +
"&couponId=" +
that.data.couponId
});
} else if (err.code == 11006) {
// 用户手机已加密
wx.redirectTo({
url: "/pages/phoneinput/phoneinput?couponChannelId=" +
that.data.couponChannelId +
"&couponId=" +
that.data.couponId
});
} else {
wx.showToast({
title: err.message,
icon: 'none',
duration: 2000,
mask: false
});
}
})
.then(res => {
} else if (err.code == 11006) {
// 用户手机已加密
wx.redirectTo({
url: "/pages/phoneinput/phoneinput?couponChannelId=" +
that.data.couponChannelId +
"&couponId=" +
that.data.couponId
});
} else {
wx.showToast({
title: err.message,
icon: 'none',
duration: 2000,
mask: false
});
}
})
.then(res => {
console.log(res)
if (discount != 'discount') {
if (typeof (res) != "undefined") { if (typeof (res) != "undefined") {
let orderId = "" + res.data.id; let orderId = "" + res.data.id;
that.setData({ that.setData({
@@ -456,7 +472,8 @@ Page({
data: { data: {
orderId: orderId orderId: orderId
} }
}).then(res => {
})
.then(res => {
var payOrderId = "" + res.data.payOrderId; var payOrderId = "" + res.data.payOrderId;
wx.hideLoading(); wx.hideLoading();
wx.requestPayment({ wx.requestPayment({
@@ -469,9 +486,9 @@ Page({
wx.showLoading({ wx.showLoading({
title: '订单正在处理中...', title: '订单正在处理中...',
}) })
setTimeout(function(){
setTimeout(function () {
wx.hideLoading() wx.hideLoading()
},5000)
}, 5000)
that.payOrderUpdate(that.data.orderId, payOrderId, 1, '', '', that); that.payOrderUpdate(that.data.orderId, payOrderId, 1, '', '', that);
if (res.errMsg == "requestPayment:ok") { if (res.errMsg == "requestPayment:ok") {
setTimeout(function () { setTimeout(function () {
@@ -480,12 +497,12 @@ Page({
/** /**
* 用户支付成功以后跳转到券包列表 * 用户支付成功以后跳转到券包列表
*/ */
if(that.data.cardType == 7){
if (that.data.cardType == 7) {
wx.setStorage({ wx.setStorage({
key: 'couponNum2', key: 'couponNum2',
data: "couponNum2" data: "couponNum2"
}) })
}else{
} else {
wx.setStorage({ wx.setStorage({
key: 'couponNum', key: 'couponNum',
data: "couponNum" data: "couponNum"
@@ -518,12 +535,12 @@ Page({
} else { } else {
// 免费券 // 免费券
that.payOrderUpdate(orderId, "0", 1, '', 'free'); that.payOrderUpdate(orderId, "0", 1, '', 'free');
if(that.data.cardType == 7){
if (that.data.cardType == 7) {
wx.setStorage({ wx.setStorage({
key: 'couponNum2', key: 'couponNum2',
data: "couponNum2" data: "couponNum2"
}) })
}else{
} else {
wx.setStorage({ wx.setStorage({
key: 'couponNum', key: 'couponNum',
data: "couponNum" data: "couponNum"
@@ -531,19 +548,18 @@ Page({
} }
} }
} }
})
.catch(err => {
wx.showToast({
title: err.message,
icon: 'none',
duration: 2000,
mask: false
});
})
} else {
if(res){
wx.navigateTo({
url: `/pages/bargain/bargainDatail/bargainDatail?orderId=${res.data.id}`,
})
}
}
})
}, },
onShow(){
onShow() {
this.setData({ this.setData({
showbutton:false
showbutton: false
}) })
}, },
onShareAppMessage: function (options) { onShareAppMessage: function (options) {


+ 21
- 15
pages/coupon/detail/index.wxml View File

@@ -30,11 +30,16 @@
<text class='title'>{{data.title}}<text class="elecard" wx:if="{{data.type==7}}">电子卡</text></text> <text class='title'>{{data.title}}<text class="elecard" wx:if="{{data.type==7}}">电子卡</text></text>
<text class="subTitle">{{data.subTitle}}</text> <text class="subTitle">{{data.subTitle}}</text>
<view class='salePriceStr clearfix'> <view class='salePriceStr clearfix'>
<view class="fl">售价:
<view class="fl" wx:if="{{data.type!=8}}">售价:
<text class="pri01">{{data.salePriceStr}}</text> <text class="pri01">{{data.salePriceStr}}</text>
<text class="yuan">元</text> <text class="yuan">元</text>
<text class='throgh' wx:if="{{data.unit==0}}">{{data.priceStr}}元</text> <text class='throgh' wx:if="{{data.unit==0}}">{{data.priceStr}}元</text>
<text wx:if="{{data.unit==1}}">{{data.priceStr}}小时</text> <text wx:if="{{data.unit==1}}">{{data.priceStr}}小时</text>
<text class='throgh' wx:if="{{data.unit==0}}">{{data.priceStr}}元</text>
</view>
<view class="fl" wx:if="{{data.type==8}}">可砍至
<text class="pri01">{{data.salePriceStr}}</text>元
<text class='throgh'>{{data.priceStr}}元</text>
</view> </view>
<text class="restNum fr">剩余<text>{{data.remainInventory}}件</text></text> <text class="restNum fr">剩余<text>{{data.remainInventory}}件</text></text>
</view> </view>
@@ -79,7 +84,7 @@
</view> </view>
</view> </view>


<view class="buy-view app-border-top" style="position:fixed;z-index:{{zIndex}};">
<view wx:if="{{data.type!=8}}" class="buy-view app-border-top" style="position:fixed;z-index:{{zIndex}};">
<button bindtap='gotopay' disabled='{{showbutton}}' hover-class='active' class='buy' wx:if="{{data.salePriceStr!=0&&data.remainInventory!=0&&endtime!='活动已结束'}}"> <button bindtap='gotopay' disabled='{{showbutton}}' hover-class='active' class='buy' wx:if="{{data.salePriceStr!=0&&data.remainInventory!=0&&endtime!='活动已结束'}}">
<text class='txt'>{{data.salePriceStr}}元</text>马上购买</button> <text class='txt'>{{data.salePriceStr}}元</text>马上购买</button>
<button bindtap='gotopay' disabled='{{showbutton}}' class='buy' wx:if="{{data.salePriceStr==0&&data.remainInventory!=0&&endtime!='活动已结束'}}">免费领取</button> <button bindtap='gotopay' disabled='{{showbutton}}' class='buy' wx:if="{{data.salePriceStr==0&&data.remainInventory!=0&&endtime!='活动已结束'}}">免费领取</button>
@@ -88,8 +93,16 @@
<button class='buy' disabled='true' wx:if="{{total_micro_second<=0}}">活动已结束</button> <button class='buy' disabled='true' wx:if="{{total_micro_second<=0}}">活动已结束</button>
</view> </view>
</view> </view>


<view wx:if="{{data.type==8}}" class="btns clearfix" hover-class="none" hover-stop-propagation="false">
<button class="fl" bindtap='gotopay' disabled='{{showbutton}}'>
<text>{{data.priceStr}}元</text>
<text>立即购买</text>
</button>
<button class="fr" bindtap='inviteFriend' disabled='{{showbutton}}'>
邀请好友继续砍价
</button>
</view>
<!-- 问卷调查 --> <!-- 问卷调查 -->
<view class="b1" style="opacity:{{opacity}};display: {{display}};" animation="{{queueData}}"> <view class="b1" style="opacity:{{opacity}};display: {{display}};" animation="{{queueData}}">
<view id='con' class='con'> <view id='con' class='con'>
@@ -101,16 +114,9 @@
<text class='titles'>{{questionnaire.title}}</text> <text class='titles'>{{questionnaire.title}}</text>
<!-- 单选 --> <!-- 单选 -->
<radio-group class="radio-group" wx:if="{{questionnaire.flag=='single'}}" data-flags="single" bindchange="formSubmit" data-questionId="{{questionId}}"> <radio-group class="radio-group" wx:if="{{questionnaire.flag=='single'}}" data-flags="single" bindchange="formSubmit" data-questionId="{{questionId}}">
<!-- <label wx:for="{{questionnaire.answers}}" wx:key="{{index}}" data-answer="{{item.name}}" data-answerId="{{item.id}}">
<radio class="radio ques" value="{{item.id}}" />{{item.name}}
</label> -->

<label class="radios" wx:for="{{questionnaire.answers}}" wx:key="{{index}}">
<radio value="{{item.id}}" checked="{{item.checked}}" />{{item.name}}
</label>



<label class="radios" wx:for="{{questionnaire.answers}}" wx:key="{{index}}">
<radio value="{{item.id}}" checked="{{item.checked}}" />{{item.name}}
</label>
</radio-group> </radio-group>
<!-- 多选 --> <!-- 多选 -->
<checkbox-group bindchange="checkboxChange" wx:if="{{questionnaire.flag=='multi'}}" bindchange="checkboxChange"> <checkbox-group bindchange="checkboxChange" wx:if="{{questionnaire.flag=='multi'}}" bindchange="checkboxChange">
@@ -118,7 +124,7 @@
<checkbox value="{{item.id}}" />{{item.name}} <checkbox value="{{item.id}}" />{{item.name}}
</label> </label>
</checkbox-group> </checkbox-group>
<view class='ques btns' wx:if="{{questionnaire.flag=='multi'}}" data-flags='multi' bindtap='formSubmit' data-questionId="{{questionId}}">确定</view>
<view class='ques btnss' wx:if="{{questionnaire.flag=='multi'}}" data-flags='multi' bindtap='formSubmit' data-questionId="{{questionId}}">确定</view>
</view> </view>
</view> </view>
</view> </view>

+ 40
- 2
pages/coupon/detail/index.wxss View File

@@ -130,7 +130,6 @@ page {
font-size: 40rpx; font-size: 40rpx;
color: #ff4949; color: #ff4949;
letter-spacing: 0; letter-spacing: 0;
margin-left: 10rpx;
} }


.salePriceStr .yuan { .salePriceStr .yuan {
@@ -148,10 +147,12 @@ page {
.throgh { .throgh {
text-decoration: line-through; text-decoration: line-through;
margin-left: 10rpx; margin-left: 10rpx;
color: #999!important;
} }


.fl { .fl {
float: left; float: left;
color: red;
} }


.fr { .fr {
@@ -434,7 +435,7 @@ page {
left: 23rpx; left: 23rpx;
} }


.btns {
.btnss {
color: #f8755b; color: #f8755b;
font-weight: bold; font-weight: bold;
font-size: 30rpx !important; font-size: 30rpx !important;
@@ -468,3 +469,40 @@ page {
line-height: 70rpx; line-height: 70rpx;
color: #333; color: #333;
} }
.btns{
padding: 0 33rpx;
position: fixed;
left: 0;
right: 0;
bottom: 0;
padding-bottom: 37rpx;
padding-top:37rpx;
z-index: 100;
background: #fff;
}
.btns > button{
width: 330rpx;
height: 95rpx;
border-radius:48rpx;
text-align: center;
}
.btns .fl{
color: #fff;
background:rgba(255,169,2,1);
box-shadow:0px 8px 8px 1px rgba(255,169,2,0.32);
}
.btns .fl text{
display: block;
font-size: 30rpx;
line-height: 34rpx;
}
.btns .fl text:nth-of-type(1){
margin-top: 12rpx;
}
.btns .fr{
font-size: 30rpx;
color: #fff;
line-height: 95rpx;
background:linear-gradient(90deg,rgba(236,59,45,1) 0%,rgba(248,98,52,1) 100%);
box-shadow:0px 8px 8px 1px rgba(246,93,51,0.32);
}

+ 63
- 59
pages/getuserinfo/index.js View File

@@ -10,85 +10,89 @@ Page({
}, },
onLoad: function(options) { onLoad: function(options) {
var that = this; var that = this;
if (options.couponChannelId && options.couponId){
if (options.couponChannelId && options.couponId||options.orderId) {
that.setData({ that.setData({
couponChannelId: options.couponChannelId, couponChannelId: options.couponChannelId,
couponId: options.couponId, couponId: options.couponId,
orderId:options.orderId
}) })
} }
if (options.path == 'index') { if (options.path == 'index') {
that.path = options.path that.path = options.path
} }
Http.get({ Http.get({
url: config.api.marketicon,
data: {
appId: config.weapp.AppId
}
}).then(res => {
that.setData({
mallImgUrl: res.data.mallImgUrl
});
wx.setNavigationBarTitle({
title: res.data.mallName
url: config.api.marketicon,
data: {
appId: config.weapp.AppId
}
}).then(res => {
that.setData({
mallImgUrl: res.data.mallImgUrl
});
wx.setNavigationBarTitle({
title: res.data.mallName
})
})
.catch(err => {
wx.showToast({
title: err.errMsg,
icon: 'none',
duration: 2000,
mask: false
});
}) })
})
.catch(err => {
wx.showToast({
title: err.errMsg,
icon: 'none',
duration: 2000,
mask: false
});
})
}, },


bindGetUserInfo: function(e) {
let that=this;
bindGetUserInfo: function (e) {
let that = this;
var iv = e.detail.iv; var iv = e.detail.iv;
var encryptedData = e.detail.encryptedData; var encryptedData = e.detail.encryptedData;
Http.post({ Http.post({
url: config.api.getUserInfo,
data: {
encryptedData: encryptedData,
iv: iv
}
})
.then(
function(res) {
console.log(res)
if(that.path=='index'){
wx.reLaunch({
url: "/pages/game/index"
});
url: config.api.getUserInfo,
data: {
encryptedData: encryptedData,
iv: iv
} }
else{
//返回主页
if (that.data.couponChannelId && that.data.couponId){
wx.redirectTo({
url: `/pages/coupon/detail/index?couponChannelId=${that.data.couponChannelId}&couponId=${that.data.couponId}`
});
}else{
wx.switchTab({
url: "/pages/index/index"
})
.then(
function (res) {
console.log(res)
if (that.path == 'index') {
wx.reLaunch({
url: "/pages/game/index"
}); });
} else {
//返回主页
if (that.data.couponChannelId && that.data.couponId) {
wx.redirectTo({
url: `/pages/coupon/detail/index?couponChannelId=${that.data.couponChannelId}&couponId=${that.data.couponId}`
});
} else if (that.data.orderId) {
wx.redirectTo({
url: `/pages/bargain/bargainDatail/bargainDatail?orderId=${that.data.orderId}&from=${"friend"}`
});
} else {
wx.switchTab({
url: "/pages/index/index"
});
}
} }
},
function (error) {
console.log(error)
wx.showToast({
title: "请授权个人信息",
icon: "none"
});
} }
},
function(error) {
console.log(error)
)
.catch(err => {
wx.showToast({ wx.showToast({
title: "请授权个人信息",
icon: "none"
title: err.errMsg,
icon: 'none',
duration: 2000,
mask: false
}); });
}
)
.catch(err => {
wx.showToast({
title: err.errMsg,
icon: 'none',
duration: 2000,
mask: false
});
})
})
} }
}); });

+ 24
- 7
pages/index/index.js View File

@@ -10,6 +10,7 @@ Page({
icon001: imgurl.icon001.url, icon001: imgurl.icon001.url,
icon002: imgurl.icon002.url, icon002: imgurl.icon002.url,
icon003: imgurl.icon003.url, icon003: imgurl.icon003.url,
icon004: imgurl.icon004.url,
market: app.globalData.market, market: app.globalData.market,
list: [], list: [],
loading: true, loading: true,
@@ -167,8 +168,7 @@ Page({
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onLoad: function (options) { onLoad: function (options) {
console.log("AppId:" + config.weapp.AppId)
console.log("-------------------Yesyyy----------------------------------")
wx.setStorageSync('imgurl', imgurl) wx.setStorageSync('imgurl', imgurl)
if (options.played == "true") { if (options.played == "true") {
this.setData({ this.setData({
@@ -186,8 +186,8 @@ Page({
}); });
} }
app.getLocation(); app.getLocation();
if (options.couponChannelId && options.couponId) {
that.userLogin(options.couponChannelId, options.couponId);
if (options.couponChannelId && options.couponId||options.orderId) {
that.userLogin(options.couponChannelId, options.couponId,options.orderId);
} else { } else {
that.userLogin() that.userLogin()
} }
@@ -270,7 +270,7 @@ Page({
/** /**
* 用户登录 * 用户登录
*/ */
userLogin: function (couponChannelId, couponId) {
userLogin: function (couponChannelId, couponId,orderId) {
var that = this; var that = this;
// 登录 // 登录
wx.login({ wx.login({
@@ -327,15 +327,19 @@ Page({
if (app.businessListCallback) { if (app.businessListCallback) {
app.businessListCallback(app.globalData.token); app.businessListCallback(app.globalData.token);
} }
that.checkuerstatus(couponChannelId, couponId);
that.checkuerstatus(couponChannelId, couponId,orderId);


}) })
.catch(err => { .catch(err => {
wx.showToast({
title: err.message,
icon:"none"
})
}); });
} }
}); });
}, },
checkuerstatus(couponChannelId, couponId) {
checkuerstatus(couponChannelId, couponId,orderId) {
Http.post({ Http.post({
url: config.api.checkUserStatus, url: config.api.checkUserStatus,
data: {} data: {}
@@ -345,6 +349,10 @@ Page({
wx.navigateTo({ wx.navigateTo({
url: `/pages/coupon/detail/index?couponChannelId=${couponChannelId}&couponId=${couponId}`, url: `/pages/coupon/detail/index?couponChannelId=${couponChannelId}&couponId=${couponId}`,
}) })
}else if(orderId){
wx.navigateTo({
url: `/pages/bargain/bargainDatail/bargainDatail?orderId=${orderId}&from='${"discount"}`,
})
} }
}) })
.catch(err => { .catch(err => {
@@ -354,6 +362,10 @@ Page({
wx.redirectTo({ wx.redirectTo({
url: `/pages/getuserinfo/index?couponChannelId=${couponChannelId}&couponId=${couponId}` url: `/pages/getuserinfo/index?couponChannelId=${couponChannelId}&couponId=${couponId}`
}); });
} else if (orderId) {
wx.redirectTo({
url: `/pages/getuserinfo/index?orderId=${orderId}&from='${"discount"}`
});
} else { } else {
wx.redirectTo({ wx.redirectTo({
url: '/pages/getuserinfo/index' url: '/pages/getuserinfo/index'
@@ -481,6 +493,11 @@ Page({
} }
}); });
}, },
gotoBargain:function(){
wx.navigateTo({
url: '/pages/bargain/bargain'
})
},
/** /**
* 刷新 * 刷新
*/ */


+ 4
- 0
pages/index/index.wxml View File

@@ -10,6 +10,10 @@
<view bindtap='gotodiscountCardList'> <view bindtap='gotodiscountCardList'>
<image src='{{icon002}}'></image> <image src='{{icon002}}'></image>
<text>消费卡</text> <text>消费卡</text>
</view>
<view bindtap='gotoBargain'>
<image src='{{icon004}}'></image>
<text>砍价专场</text>
</view> </view>
<view bindtap='qrcode'> <view bindtap='qrcode'>
<image src='{{icon003}}'></image> <image src='{{icon003}}'></image>


+ 2
- 2
pages/order/detail/index.wxml View File

@@ -70,10 +70,10 @@
</view> </view>
</view> </view>
<!-- 待付款 显示立即购买的按钮 --> <!-- 待付款 显示立即购买的按钮 -->
<view wx:if="{{order.orderStatus==0&&order.salePrice!=0}}" class="buy-view app-border-top">
<view wx:if="{{order.orderStatus==0&&order.salePrice!=0||order.orderStatus==7&&order.salePrice!=0}}" class="buy-view app-border-top">
<button bindtap='orderFunc' hover-class='active' data-couponChannelId="{{order.id}}" class='buy'>立即支付</button> <button bindtap='orderFunc' hover-class='active' data-couponChannelId="{{order.id}}" class='buy'>立即支付</button>
</view> </view>
<view class='game' bindtap="gotogame" wx-if="{{showIf}}">
<view class='game' bindtap="gotogame" wx-if="{{showIf&&order.orderStatus!=0}}">
<view class='game-entry'> <view class='game-entry'>
<image src="{{newUrl}}" class='gameimg' mode='widthFix'></image> <image src="{{newUrl}}" class='gameimg' mode='widthFix'></image>
</view> </view>


+ 2
- 2
pages/order/index/index.js View File

@@ -22,10 +22,10 @@ Page({
], ],
list: [], list: [],
current: "", current: "",
loading: true, //"上拉加载"的变量,默认false,隐藏
current_scroll: "1", current_scroll: "1",
page: 1,
allow_load: true, allow_load: true,
loading: true, //"上拉加载"的变量,默认false,隐藏
page: 1,
content: "", content: "",
}, },
onLoad(e) { onLoad(e) {


+ 7
- 1
pages/order/index/index.wxml View File

@@ -10,10 +10,16 @@
</view> </view>
<view class='info'> <view class='info'>
<view> <view>
<image wx:if="{{item.orderStatus == 6 || item.orderStatus == 7 || item.orderStatus == 8 || item.orderStatus == 9}}" src="./../../../assets/images/discount.png" class="discount" mode="widthFix"></image>
<image wx:if="{{item.orderStatus == 1&& item.type == 8}}" src="./../../../assets/images/discount.png" class="discount" mode="widthFix"></image>
<text>{{item.title}}</text> <text>{{item.title}}</text>
<text class='wait' wx:if="{{item.orderStatus==0}}">等待付款</text> <text class='wait' wx:if="{{item.orderStatus==0}}">等待付款</text>
<text class='sucess' wx:if="{{item.orderStatus==3}}">待退款</text> <text class='sucess' wx:if="{{item.orderStatus==3}}">待退款</text>
<text class='close' wx:if="{{item.orderStatus==2}}">交易关闭</text> <text class='close' wx:if="{{item.orderStatus==2}}">交易关闭</text>
<text class='close' wx:if="{{item.orderStatus==6}}">砍价中</text>
<text class='sucess' wx:if="{{item.orderStatus==7}}">砍价成功</text>
<text class='close' wx:if="{{item.orderStatus==8}}">砍价失败</text>
<text class='close' wx:if="{{item.orderStatus==9}}">砍价取消</text>
<text class='close' wx:if="{{item.orderStatus==4}}">已退款</text> <text class='close' wx:if="{{item.orderStatus==4}}">已退款</text>
<text class='wait' wx:if="{{item.orderStatus==5}}">退款失败</text> <text class='wait' wx:if="{{item.orderStatus==5}}">退款失败</text>
<text class='sucess' wx:if="{{item.orderStatus==1&&item.salePrice==0}}">免费领取</text> <text class='sucess' wx:if="{{item.orderStatus==1&&item.salePrice==0}}">免费领取</text>
@@ -41,7 +47,7 @@
<view wx:if="{{item.orderStatus==1}}" class="btn" data-id="{{item.id}}" bindtap="gotopay"> <view wx:if="{{item.orderStatus==1}}" class="btn" data-id="{{item.id}}" bindtap="gotopay">
<text>查看详情</text> <text>查看详情</text>
</view> </view>
<view wx:if="{{item.orderStatus==0}}" class="btn" data-id="{{item.id}}" bindtap="gotopay">
<view wx:if="{{item.orderStatus==0 || item.orderStatus==7}}" class="btn" data-id="{{item.id}}" bindtap="gotopay">
<text>去支付</text> <text>去支付</text>
</view> </view>
<view wx:if="{{item.orderStatus==5}}" style="background:#999;opacity: .6;" class="btn"> <view wx:if="{{item.orderStatus==5}}" style="background:#999;opacity: .6;" class="btn">


+ 6
- 1
pages/order/index/index.wxss View File

@@ -84,7 +84,12 @@ text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
.discount{
position: absolute;
width: 100rpx;
top:86rpx;
right:2rpx;
}
.info .sucess { .info .sucess {
display: inline-block; display: inline-block;
width: 123rpx !important; width: 123rpx !important;


+ 1
- 1
pages/passCar/passCar.js View File

@@ -550,7 +550,7 @@ Page({
syncId: res.data.orderId, syncId: res.data.orderId,
payType: 6, // 小程序支付 payType: 6, // 小程序支付
CarNumber: carNumber, CarNumber: carNumber,
returnUrl: "https://admin.malls.iformall.com/api/carCallback/etcpPaidCallback",
returnUrl: "https://admintest.malls.iformall.com/api/carCallback/etcpPaidCallback",
source: "FUMAO-001", source: "FUMAO-001",
actionId: "1" //操作ID,1:小程序支付 actionId: "1" //操作ID,1:小程序支付
} }


+ 4
- 3
pages/specialcourtesy/specialcourtesy.js View File

@@ -36,14 +36,15 @@ Page({
*/ */
onShow: function () { onShow: function () {
let that = this; let that = this;
Http.get({
url: config.api.discountMerchantList,
Http.post({
url: config.api.getDiscountInfo,
data: {} data: {}
}) })
.then(res=>{ .then(res=>{
console.log(res) console.log(res)
that.setData({ that.setData({
discountMerchantList:res.data
discountMerchantList: res.data.levelMerchantList,
level: res.data.level ? res.data.level:''
}) })
}) })
}, },


+ 6
- 3
pages/specialcourtesy/specialcourtesy.wxml View File

@@ -2,16 +2,16 @@
<image src="{{myspeacialUrl}}" mode='widthFix'></image> <image src="{{myspeacialUrl}}" mode='widthFix'></image>
</view> </view>
<view class='con'> <view class='con'>
<view class="title">以下为商城会员对应门店的优惠折扣</view>
<view class="title">以下为商城<text class='level'>{{level}}</text>对应门店的优惠折扣</view>
</view> </view>
<view class='cards clearfix'> <view class='cards clearfix'>
<view class='card' wx:for="{{discountMerchantList}}" wx:key="{{index}}" wx:if="{{item.vipDiscountRate1/1000!=10}}">
<view class='card' wx:for="{{discountMerchantList}}" wx:key="{{index}}" wx:if="{{item.discount/10!=10&&discountMerchantList.length>0}}">
<view class='txt01'> <view class='txt01'>
<view class="triangle"> <view class="triangle">
<text><i>></i></text> <text><i>></i></text>
</view> </view>
<view class='discount'> <view class='discount'>
<text style='display:inline-block;'>{{item.vipDiscountRate1/1000}}</text>折</view>
<text style='display:inline-block;'>{{item.discount/10}}</text>折</view>
<text class='tit'>{{item.merchantName}}</text> <text class='tit'>{{item.merchantName}}</text>
<view class='clearfix footer'> <view class='clearfix footer'>
<text class='fl'>{{item.buildingName}}{{item.floorName}}</text> <text class='fl'>{{item.buildingName}}{{item.floorName}}</text>
@@ -21,4 +21,7 @@
</view> </view>
</view> </view>
</view> </view>
<!-- <view class='none' wx:if="{{item.discount/10==10&&discountMerchantList.length>0}}">
暂无数据
</view> -->
</view> </view>

+ 10
- 0
pages/specialcourtesy/specialcourtesy.wxss View File

@@ -1,6 +1,13 @@
Page{ Page{
background: #C8223C; background: #C8223C;
} }
.none{
font-size: 28rpx;
text-align: center;
margin-top: 30rpx;
color: #fff;
float:none!important;
}
.headerbg image{ .headerbg image{
display: block; display: block;
width: 100%; width: 100%;
@@ -91,3 +98,6 @@ Page{
.discount text{ .discount text{
font-size: 28rpx; font-size: 28rpx;
} }
.level{
color: yellow;
}

+ 1
- 1
pages/user/index.wxml View File

@@ -76,7 +76,7 @@
<view class="margin"></view> <view class="margin"></view>
<!-- <button bindtap="navigateTo" class="user-out-btn">退出登陆</button> --> <!-- <button bindtap="navigateTo" class="user-out-btn">退出登陆</button> -->
<view bindlongtap='showVersion' class='version'> <view bindlongtap='showVersion' class='version'>
<view wx:if="{{flag=='show'}}">版本号:3.2.2</view>
<view wx:if="{{flag=='show'}}">版本号:3.2.3</view>
<view wx:if="{{flag=='hidden'}}"></view> <view wx:if="{{flag=='hidden'}}"></view>
</view> </view>
</view> </view>


+ 1
- 1
project.config.json View File

@@ -13,7 +13,7 @@
}, },
"compileType": "miniprogram", "compileType": "miniprogram",
"libVersion": "2.0.9", "libVersion": "2.0.9",
"appid": "wx649b3be73c1afe47",
"appid": "wxea71200db93d756b",
"projectname": "C", "projectname": "C",
"isGameTourist": false, "isGameTourist": false,
"condition": { "condition": {


+ 4
- 0
utils/imgurl.js View File

@@ -335,5 +335,9 @@ module.exports = {
'icon003': { 'icon003': {
'url': baseUrl + 'icon003.png', 'url': baseUrl + 'icon003.png',
'name': '' 'name': ''
},
'icon004': {
'url': baseUrl + 'icon004.png',
'name': ''
} }
} }

Loading…
Cancel
Save