Browse Source

Merge pull request 'dev' (#1) from dev into master

Reviewed-on: http://code.xmainc.com:3000/panyiping/jundaosuzhou_wechatxcx/pulls/1
master
chenkainan 4 years ago
parent
commit
c6b1d25e2b
  1. 6
      app.js
  2. 7
      app.json
  3. 2
      app.wxss
  4. 18
      pages/component/TitleHeader.js
  5. 1
      pages/index/index.js
  6. 2
      pages/info/museumInfo/index.wxss
  7. 3
      pages/info/postProductInfo/index.js
  8. 2
      pages/info/postProductInfo/index.wxml
  9. 141
      pages/info/sceneProductInfo/index.js
  10. 63
      pages/info/sceneProductInfo/index.wxml
  11. 265
      pages/info/sceneProductInfo/index.wxss
  12. 2
      pages/order/components/contact/index.js
  13. 150
      pages/order/orderList/index.js
  14. 6
      pages/order/orderList/index.json
  15. 63
      pages/order/orderList/index.wxml
  16. 64
      pages/order/orderList/index.wxss
  17. 16
      pages/order/postOrder/index.js
  18. 6
      pages/order/postOrder/index.wxml
  19. 45
      pages/order/scene/index.js
  20. 6
      pages/order/scene/index.wxml
  21. 48
      pages/user/cartlist/list.js
  22. 2
      pages/user/cartlist/list.wxml
  23. 14
      project.private.config.json

6
app.js

@ -143,6 +143,12 @@ App({
safeBottom:0,
product:null,
postProduct:[],
ticketProduct:[],
index: 0,
createDate: null,
list: [],
productPrice: 0,
ticketPrice: 0,
productState:{
"WAIT_PAYMENT":"待付款",
"WAIT_CONFIRM":"待确认",

7
app.json

@ -176,10 +176,17 @@
"pages/culture/index",
"pages/culture/info/index",
"pages/user/logout/index",
"pages/order/orderList/index",
"pages/user/linkman/add/index",
"pages/user/address/add/index",
"pages/user/linkman/index"
],
"plugins": {
"live-player-plugin": {
"version": "1.3.0",
"provider": "wx2b03c6e691cd7370"
}
},
"requiredPrivateInfos": [
"getLocation",
"choosePoi",

2
app.wxss

@ -31,7 +31,7 @@ page{
position: relative;
z-index: 1;
width: 80%;
max-height: 100%;
max-height: 1000rpx;
background: white;
border-radius: 12rpx;
overflow-y: auto;

18
pages/component/TitleHeader.js

@ -53,6 +53,9 @@ Component({
// wx.uma.trackEvent(this.properties.clickid)
// }
const pages = getCurrentPages();
if(pages[pages.length-1].route.indexOf('linkman/add')==-1){
app.globalData.index = app.globalData.index -1
}
if(pages[pages.length-1].route.indexOf('login')!=-1 || pages[pages.length-1].route.indexOf('bindTel')!=-1){
// 如果是登录页面的返回需要返回两层
if(pages.length>2){
@ -66,6 +69,21 @@ Component({
})
}
}
else if (pages[pages.length-1].route.indexOf('cartlist') != -1){
wx.switchTab({
url: '/pages/user/user'
})
}
else if (pages[pages.length-1].route.indexOf('orderList') != -1){
wx.navigateTo({
url: '/pages/user/cartlist/list'
})
}
else if (pages[pages.length-1].route.indexOf('scene') != -1){
wx.reLaunch({
url: "/pages/user/cartlist/list"
})
}
else if (pages.length>1){
wx.navigateBack({
delta: 1

1
pages/index/index.js

@ -248,6 +248,7 @@ Page({
util.gotoDetail(item)
},
gotoPath: function (e) {
console.log(e)
if (e.currentTarget.dataset.event) {
this.pagePoint({ event: e.currentTarget.dataset.event }, 1)
}

2
pages/info/museumInfo/index.wxss

@ -70,7 +70,7 @@
display: flex;
align-items: center;
justify-content: space-around;
z-index: 2;
z-index: 3;
}
.fixed-btn .btn {

3
pages/info/postProductInfo/index.js

@ -45,6 +45,7 @@ Page({
})
// 获取购物车按钮的位置
wx.createSelectorQuery().select('#cart').boundingClientRect(function (res) {
console.log(res)
that.setData({
cartTop: res.top
})
@ -242,6 +243,8 @@ Page({
})
},
order: function () {
app.globalData.postProduct = []
app.globalData.list = []
if (this.data.skuFlag == 'order') {
util.pagePoint({
event: 'product_order',

2
pages/info/postProductInfo/index.wxml

@ -3,7 +3,7 @@
<title title="产品详情"></title>
<view class="iconfont icon-fenxiang" bindtap="share"></view>
<image wx:for="{{info.sku}}" style="{{aniSkuIndex==index?('top:'+cartTop+'px;'):('top:'+top+'px;'+cartImgInfo)}}"
class="headimg{{aniSkuIndex==index?' active':''}}" src="{{item.headimg}}" mode="aspectFill"></image>
class="headimg{{aniSkuIndex==index?' active':''}}" src="{{info.headimg}}" mode="aspectFill"></image>
<swiper class="swiper" indicator-dots="{{true}}" wx:if="{{info}}" autoplay="{{autoPlay}}" interval="{{2000}}"
duration="{{300}}">
<block wx:if="{{info.videourl}}" wx:key="*this">

141
pages/info/sceneProductInfo/index.js

@ -24,6 +24,14 @@ Page({
showShareFlag: false,
showAllowance: false,
allowance_data:null,
//购物车数量
producNum: 1,
skuIndex: 0,
aniSkuIndex: -1,
cartCount: 0,
cartImgInfo: null,
cartTop: 0,
top: 0
},
/**
@ -155,7 +163,6 @@ Page({
scene_id: id
}).then(res => {
if (res.code == 1) {
console.log(isLike)
wx.showToast({
title: '操作成功',
})
@ -196,7 +203,39 @@ Page({
bookingInfo: null
})
},
// order: function(e){
// console.log(e)
// if (e.currentTarget.dataset.disable == 1) return;
// util.pagePoint({
// event: 'scene_order',
// param: {
// type: this.data.info.type,
// id: this.data.info.id
// }
// }, 1)
// wx.setStorageSync('login_from', 'scene_order_login')
// wx.setStorageSync('order_from', 'scene_order_submit')
// app.globalData.couponInfo = null;
// app.globalData.retailId = this.data.retailId;
// // let sku = e.currentTarget.dataset.sku,product = e.currentTarget.dataset.product;
// app.globalData.product = e.currentTarget.dataset;
// wx.navigateTo({
// url: '/pages/order/scene/index',
// })
// },
selectSku: function (e) {
console.log(e)
let index = e.currentTarget.dataset.index;
this.setData({
skuIndex: index
})
},
order: function (e) {
console.log(e,e.currentTarget.dataset.product.sku[this.data.skuIndex])
// console.log(this.data.info,this.data.skuFlag)
app.globalData.postProduct = []
app.globalData.list = []
if (this.data.skuFlag == 'order'){
if (e.currentTarget.dataset.disable == 1) return;
util.pagePoint({
event: 'scene_order',
@ -210,10 +249,49 @@ Page({
app.globalData.couponInfo = null;
app.globalData.retailId = this.data.retailId;
// let sku = e.currentTarget.dataset.sku,product = e.currentTarget.dataset.product;
app.globalData.product = e.currentTarget.dataset;
let sku = {sku:e.currentTarget.dataset.product.sku[this.data.skuIndex]},product = {product: e.currentTarget.dataset.product}
app.globalData.product = {...sku,...product}
// app.globalData.product = e.currentTarget.dataset;
wx.navigateTo({
url: '/pages/order/scene/index',
})
}else {
commonApi.user_post("cart/add_sku", {
sku_id: this.data.info.product[0].sku[this.data.skuIndex].id,
num: this.data.producNum
}).then(res => {
if (res.code == 1) {
commonApi.user_post('cart/get_list', {}).then(res => {
this.setData({
cartCount: res.data.length
})
})
// 加动效
console.log(this.data.skuIndex)
this.setData({
skuFlag: null,
aniSkuIndex: this.data.skuIndex,
cartImgInfo: null
})
setTimeout(() => {
this.setData({
aniSkuIndex: -1
})
wx.showModal({
title: "提示",
content: "去购物车结算?",
success: function (res) {
if (res.confirm) {
wx.navigateTo({
url: '/pages/user/cartlist/list',
})
}
}
})
}, 650)
}
})
}
},
pagePoint: function (e) {
util.pagePoint({
@ -480,6 +558,59 @@ Page({
ctx.fillText(row[b], x, y + b * 40 * ratio, canvasWidth);
}
},
//加入购物车
showCart: function () {
console.log(this.data)
if (this.data.info.product[0].sku.length == 0) {
wx.showToast({
title: '该产品未设置规格,不能加购',
icon: 'none'
})
return;
}
this.setData({
skuFlag: "cart"
})
let that = this
wx.createSelectorQuery().select('#skuImg').boundingClientRect(function (res) {
console.log(res)
that.setData({
cartImgInfo: 'top:' + res.top + 'px;left:' + res.left + 'px;'
})
}).exec()
},
hideSku: function () {
this.setData({
skuFlag: null,
cartImgInfo: null
})
},
//加减数量
minus: function () {
if (this.data.producNum == 1) return;
this.setData({
producNum: this.data.producNum - 1
})
},
add: function () {
this.setData({
producNum: this.data.producNum + 1
})
},
//立即预定
showOrder: function () {
if (this.data.info.product[0].sku.length == 0) {
wx.showToast({
title: '该产品未设置规格,不能购买',
icon: 'none'
})
return;
}
this.setData({
skuFlag: 'order'
})
},
/**
* 生命周期函数--监听页面初次渲染完成
@ -501,6 +632,12 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
commonApi.user_post('cart/get_list', {}).then(res => {
console.log(res,res.data)
this.setData({
cartCount: res.data.length
})
})
if (!wx.getStorageSync('jstrip_token')) {
return;
}

63
pages/info/sceneProductInfo/index.wxml

@ -1,7 +1,10 @@
<!--pages/info/sceneProductInfo/index.wxml-->
<wxs src="../../../utils/filter.wxs" module="tool" />
<title title="产品详情"></title>
<view class="iconfont icon-fenxiang" bindtap="share"></view>
<view class="iconfont {{isLike==1?'icon-shoucang':'icon-xin'}}" bindtap="like"></view>
<!-- <view class="iconfont {{isLike==1?'icon-shoucang':'icon-xin'}}" bindtap="like"></view> -->
<image wx:for="{{info.product}}" style="{{aniSkuIndex==index?('top:689px;'):('top:'+top+'px;'+cartImgInfo)}}"
class="headimg{{aniSkuIndex==index?' active':''}}" src="{{item.headimg}}" mode="aspectFill"></image>
<!-- <view class="audio-box" bindtap="audioGuide">
<view>语音导览</view>
<image src="https://static.ticket.sz-trip.com/xcxImages/info/play-btn.png" mode="widthFix"></image>
@ -54,9 +57,63 @@
</view>
<view class="product-right">
<view class="price"><text>¥</text><text>{{sku.price?sku.price/100:0}}</text><text>起</text></view>
<view bindtap="order" data-sku="{{sku}}" data-product="{{item}}"
<!-- <view bindtap="order" data-sku="{{sku}}" data-product="{{item}}"
data-disable="{{item.flag==0 || sku.flag=='off'?1:0}}"
class="btn{{item.flag==0 || sku.flag=='off'?' disable':''}}">立即预订</view>
class="btn{{item.flag==0 || sku.flag=='off'?' disable':''}}">立即预订</view> -->
</view>
</view>
</view>
<view class="fixed-bottom">
<navigator url="/pages/user/service/index" catchtap="pagePoint" data-event='product_customservice' class="kefu-box">
<view class="iconfont icon-kefu"></view>
<view>客服</view>
</navigator>
<view bindtap="like" class="kefu-box" style="margin-left:70rpx">
<view class="iconfont {{isLike==1?'icon-shoucang':'icon-xin'}}"></view>
<view>收藏</view>
</view>
<view style="flex:1"></view>
<view class="btns">
<view class="btn" bindtap="showCart">加入购物车</view>
<view class="btn" bindtap="showOrder" wx:if="{{info && info.flag==1}}">立即预订</view>
<view class="btn disable" wx:elif="{{info}}">该商品已下架</view>
</view>
</view>
<!-- 购物车悬浮框 -->
<navigator url="/pages/user/cartlist/list" catchtap="pagePoint" data-event='product_cart_click' class="cart-box"
id="cart">
<image src="https://sz-qd.oss-cn-hangzhou.aliyuncs.com/xcxImages/info/cart.png" mode="widthFix"></image>
<view class="cart-num">{{cartCount}}</view>
</navigator>
<view class="mask" wx:if="{{skuFlag}}">
<view class="mask-bg" bindtap="hideSku"></view>
<view class="mask-content">
<view class="iconfont icon-close" bindtap="hideSku"></view>
<view class="sku-info-box">
<image id="skuImg" src="{{info.headimg}}" mode="aspectFill"></image>
<view class="sku-info">
<view class="sku-price">{{info.product[0].sku[skuIndex].price/100}}
<view class="allowance" wx:if="{{allowance_data}}">
补贴价:¥{{ (1 - allowance_data.discount_rate / 100) * info.sku[skuIndex].price / 100 }}</view>
</view>
<view class="sku-name">已选择:{{info.product[0].sku[skuIndex].sku_name}}</view>
</view>
</view>
<view class="sku-names">
<view bindtap="selectSku" data-index="{{index}}" class="sku-name-item textOver{{index==skuIndex?' active':''}}"
wx:for="{{info.product[0].sku}}">{{item.sku_name}}</view>
</view>
<view class="number-box">
<text>数量</text>
<view class="iconfont icon-sami-select" bindtap="minus"></view>
<view class="number">{{producNum}}</view>
<view class="iconfont icon-add-select" bindtap="add"></view>
</view>
<view style="height:138rpx"></view>
<view class="btn-box">
<view class="mask-btn" bindtap="order" data-sku="{{sku}}" data-product="{{item}}" wx:if="{{info && info.flag==1}}" data-disable="{{item.flag==0 || sku.flag=='off'?1:0}}" data-disable="{{item.flag==0 || sku.flag=='off'?1:0}}">{{skuFlag=='cart'?'确认':'立即购买'}}
</view>
<view class="mask-btn disable" wx:else>该商品已下架</view>
</view>
</view>
</view>

265
pages/info/sceneProductInfo/index.wxss

@ -333,7 +333,7 @@ page {
font-size: 28rpx;
}
.icon-xin,
/* .icon-xin,
.icon-shoucang {
position: absolute;
right: 100rpx;
@ -346,7 +346,7 @@ page {
color: #fff;
font-size: 36rpx;
z-index: 1;
}
} */
.icon-shoucang {
color: #D62828;
@ -382,7 +382,6 @@ page {
margin-left: 10rpx;
}
.mask-content {
position: absolute;
left: 0;
@ -537,3 +536,263 @@ page {
text-align: center;
margin-bottom: 20rpx;
}
.fixed-bottom {
position: fixed;
left: 0;
right: 0;
bottom: 0;
height: 140rpx;
background: white;
display: flex;
align-items: center;
box-shadow: 0px 0px 16rpx 0px rgba(6, 0, 1, 0.1);
padding: 0 40rpx;
color: #666666;
font-size: 23rpx;
justify-content: space-between;
text-align: center;
}
.fixed-bottom .iconfont {
font-size: 34rpx;
line-height: 40rpx;
}
.btns {
color: #fff;
font-size: 32rpx;
font-weight: 500;
border-radius: 39rpx;
text-align: center;
display: flex;
align-items: center;
justify-content: center;
}
.btns .btn {
width: 216rpx;
line-height: 78rpx;
background: #D62828;
}
.btns .btn:nth-child(1) {
margin-right: 3rpx;
border-radius: 39rpx 0 0 39rpx;
}
.btns .btn:nth-child(2) {
border-radius: 0 39rpx 39rpx 0;
}
.btns .btn.disable {
background: #ccc;
}
.mask-content {
position: absolute;
left: 0;
right: 0;
bottom: 0;
width: 100%;
}
.mask-content .icon-close {
position: absolute;
right: 40rpx;
top: 40rpx;
}
.sku-info-box {
margin: 50rpx 40rpx;
display: flex;
justify-content: space-between;
}
.sku-info-box image {
width: 218rpx;
height: 180rpx;
border-radius: 13rpx;
display: block;
margin-right: 40rpx;
flex-shrink: 0;
}
.sku-info {
flex: 1;
}
.sku-price {
font-size: 40rpx;
font-weight: 500;
color: #D62828;
margin: 20rpx 0;
display: flex;
justify-content: flex-start;
align-items: center;
}
.sku-price::before {
content: "¥";
font-weight: 400;
font-size: 27rpx;
vertical-align: baseline;
}
.sku-price view {
font-size: 24rpx;
color: #FFFFFF;
background-color: #D62828;
border-radius: 22rpx;
line-height: 44rpx;
margin-left: 7rpx;
padding: 0 20rpx;
}
.sku-name {
font-size: 27rpx;
color: #666666;
}
.sku-names {
display: flex;
font-size: 29rpx;
color: #333;
margin: 0 40rpx;
text-align: center;
flex-wrap: wrap;
margin-bottom: 20rpx;
}
.sku-name-item {
background: #EFEFEF;
border: 1rpx solid #EFEFEF;
width: 318rpx;
line-height: 77rpx;
border-radius: 14rpx;
margin-bottom: 25rpx;
margin-right: 10rpx;
}
.sku-name-item:nth-child(2n) {
margin-right: 0;
}
.sku-name-item.active {
color: #0B898E;
border-color: #0B898E;
background: rgba(11, 137, 142, 0.1);
}
.number-box {
display: flex;
align-items: center;
border-top: 1rpx solid #ccc;
justify-content: space-between;
margin: 0 40rpx;
padding: 40rpx 0;
}
.number-box text {
flex: 1;
font-size: 29rpx;
color: #333;
}
.number-box view {
border: 1rpx solid #666;
border-radius: 7rpx;
text-align: center;
width: 67rpx;
line-height: 67rpx;
font-size: 33rpx;
color: #000;
}
.number-box view.disable {
border-color: #ccc;
color: #999;
}
.number-box view.number {
width: 94rpx;
margin: 0 15rpx;
}
.btn-box {
height: 138rpx;
background: #FFFFFF;
box-shadow: 0px 0px 16rpx 0px rgba(6, 0, 1, 0.1);
display: flex;
align-items: center;
justify-content: center;
position: fixed;
left: 0;
right: 0;
bottom: 0;
}
.mask-btn {
width: 670rpx;
line-height: 78rpx;
background: #D62828;
border-radius: 39rpx;
color: #fff;
text-align: center;
font-size: 33rpx;
font-weight: 500;
}
.mask-btn.disable {
background: #ccc;
}
/* 购物车 */
.cart-box {
position: fixed;
display: flex;
align-items: center;
justify-content: center;
width: 80rpx;
height: 80rpx;
background: #FFFFFF;
box-shadow: 0px 0px 20rpx 0px rgba(0, 0, 0, 0.2);
border-radius: 50%;
right: 20rpx;
bottom: 166rpx;
}
.cart-box image {
display: block;
width: 49rpx;
}
.cart-num {
width: 26rpx;
border: 1rpx solid;
border-radius: 50%;
line-height: 26rpx;
text-align: center;
font-size: 23rpx;
color: #D20000;
position: absolute;
right: -2rpx;
top: -5rpx;
}
.headimg {
position: fixed;
z-index: 3;
left: -218rpx;
width: 218rpx;
height: 180rpx;
top: 0;
}
.headimg.active {
transition: left .6s linear, top .6s cubic-bezier(0.5, -0.5, 1, 1), width .6s ease, height .6s ease;
width: 80rpx;
height: 80rpx;
left: 650rpx;
border-radius: 50%;
}

2
pages/order/components/contact/index.js

@ -219,8 +219,10 @@ Component({
wx.hideLoading()
},
selectIt:function(e){
console.log(e,app.globalData.product)
let item = e.currentTarget.dataset.item,linkmanList = this.data.linkmanList,num = 0,traveller_limit_num = this.properties.maxNum!=-1?this.properties.maxNum:(app.globalData.product.sku.sku_model && app.globalData.product.sku.sku_model.limit_type!=0?app.globalData.product.sku.sku_model.traveller_limit_num:-1);
// 先计算出全部选中的出行人
console.log(111)
linkmanList.map(linkman=>{
if(linkman.selected==1){
num++;

150
pages/order/orderList/index.js

@ -0,0 +1,150 @@
// pages/order/comment/index.js
let app = getApp()
import commonApi from "../../../utils/https/common"
Page({
/**
* 页面的初始数据
*/
data: {
goodsList: [],
ticketList: [],
productPrice: 0,
ticketPrice: 0,
product:"",
sku_id: '',
kjId: null,
gp_id: null,
showPrice: 0,
postFee: 0,
coupon:null,
select_allowance: false,
allowance_data: null,
allowance_price: 0,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
goodsList: app.globalData.postProduct,
ticketList: app.globalData.list,
kjId: app.globalData.kjId,
gp_id: app.globalData.gp_id || app.globalData.team_id,
})
console.log(app.globalData);
let price = 0, sku_id = [];
app.globalData.postProduct.map(item => {
if (!app.globalData.kjId && !this.data.gp_id) {
price = price + item.sku.price * item.productNum;
}
else if (this.data.gp_id) {
price = price + item.sku.event_price * item.productNum;
}
sku_id.push(item.sku.id)
})
app.globalData.list.map(item => {
price = price + item.sku.price * item.num;
sku_id.push(item.sku.id)
})
this.setData({
showPrice: app.globalData.kjId ? 0 : price,
sku_id: sku_id.join(",")
})
if (!this.data.kjId && !this.data.gp_id) {
this.couponCom = this.selectAllComponents("#coupon")[0];
}
console.log(this.data.showPrice)
},
order: function (){
console.log(app.globalData.createDate);
app.globalData.createDate.coupon_id= this.data.coupon ? this.data.coupon.id : null;
let service = "order/create", postData = {data: JSON.stringify(app.globalData.createDate)}
commonApi.user_post(service, postData).then(res => {
})
},
changePrice: function () {
let product = this.data.product, price = 0;
product.map(item => {
price = price + item.sku.price * item.productNum;
if (this.data.allowance_data && this.data.select_allowance && this.data.allowance_price) {
let spread_price = Number(this.data.allowance_data.discount_limit_price - this.data.allowance_data.user_used_price);
price -= this.data.allowance_price * item.productNum < spread_price ? this.data.allowance_price * item.productNum : spread_price
}
})
if (this.data.coupon && this.data.showPrice != price) {
wx.showToast({
title: '订单价格发生变化,请重新选择优惠券',
icon: 'none'
})
app.globalData.couponInfo = null;
if (!this.data.kjId && !this.data.gp_id) {
this.couponCom.setNullCoupon()
}
this.setData({
coupon: null
})
}
this.setData({
showPrice: app.globalData.kjId ? 0 : price
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
inputRemark: function (e) {
app.globalData.createDate.product_list.map((item)=>{
if (item.type.includes('post')) {
item.remark = e.detail.value;
}
})
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.setData({
coupon: app.globalData.couponInfo
})
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})

6
pages/order/orderList/index.json

@ -0,0 +1,6 @@
{
"usingComponents": {
"title":"/pages/component/TitleHeader",
"coupon":"../components/coupon/index"
}
}

63
pages/order/orderList/index.wxml

@ -0,0 +1,63 @@
<title title="订单列表"></title>
<view class="box" wx:if="{{goodsList.length != 0}}">
<view wx:for="{{goodsList}}" wx:key="index">
<view class="item-box">
<view>
{{item.product.title}}
</view>
<view class="price">
¥{{item.sku.price/100}}
</view>
</view>
<view class="item-box">
<view>
{{item.sku.sku_name}}
</view>
<view>
X{{item.productNum}}
</view>
</view>
<view class="item-box">
<view>
运费
</view>
<view class="price">
¥{{item.postFee/100 || 0}}
</view>
</view>
</view>
</view>
<view class="box" wx:if="{{ticketList.length != 0}}">
<view wx:for="{{ticketList}}" wx:key="index">
<view class="item-box">
<view>
{{item.product.title}}
</view>
<view class="price">
¥{{item.sku.price/100}}
</view>
</view>
<view class="item-box">
<view>
{{item.sku.sku_name}}
</view>
<view>
X{{item.num}}
</view>
</view>
</view>
</view>
<view class="box-title">
<view style="flex-shrink:0">订单备注:</view>
<input type="text" bindinput="inputRemark" data-index="{{index}}" placeholder="选填"></input>
</view>
<coupon id="coupon" wx:if="{{!kjId && !gp_id && flag!='mix'}}" money="{{showPrice + postFee}}" sku="{{sku_id}}"></coupon>
<view class="fixed-bottom">
<view class="fixed-price-box">
<text>合计:</text>
<text class="price">¥{{((showPrice + postFee - (coupon?coupon.activity.money:0))>0?(showPrice + postFee - (coupon?coupon.activity.money:0)):0)/100}}</text>
</view>
<view class="fixed-btn" bindtap="order">下一步</view>
</view>

64
pages/order/orderList/index.wxss

@ -0,0 +1,64 @@
page{
background: #f5f5f5;
}
.box{
margin: 30rpx 25rpx;
background: white;
padding: 20rpx;
}
.item-box{
display: flex;
justify-content: space-between;
padding: 10rpx;
}
.price{
color: #D62828;
}
.fixed-bottom {
position: fixed;
left: 0;
right: 0;
bottom: 0;
height: 113rpx;
display: flex;
align-items: center;
justify-content: space-between;
background: white;
z-index: 1;
box-shadow: 0px 0px 16rpx 0px rgba(6, 0, 1, 0.1);
}
.fixed-btn {
width: 320rpx;
line-height: 113rpx;
background: #D62828;
color: #fff;
text-align: center;
font-size: 36rpx;
font-weight: 500;
}
.fixed-price-box {
margin-left: 25rpx;
flex-shrink: 0;
font-size: 29rpx;
color: #333;
font-weight: 500;
}
.fixed-price-box .price {
color: #D62828;
font-size: 36rpx;
margin-left: 10rpx;
}
.box-title {
height: 113rpx;
padding: 0 20rpx;
font-size: 31rpx;
color: #000;
font-weight: 500;
display: flex;
align-items: center;
background-color: #fff;
margin: 30rpx 25rpx;
}

16
pages/order/postOrder/index.js

@ -21,6 +21,7 @@ Page({
allowance_data: null,
allowance_price: 0,
showAllowance: false,
flag:null,
},
/**
@ -31,7 +32,8 @@ Page({
from: options.from,
kjId: app.globalData.kjId,
gp_id: app.globalData.gp_id || app.globalData.team_id,
prizeId: wx.getStorageSync('prizeId')
prizeId: wx.getStorageSync('prizeId'),
flag:options.flag
})
let price = 0, sku_id = [];
app.globalData.postProduct.map(item => {
@ -51,6 +53,7 @@ Page({
if (!this.data.kjId && !this.data.gp_id) {
this.couponCom = this.selectAllComponents("#coupon")[0];
}
console.log(this.data.showPrice)
},
changeAllowance: function () {
this.setData({
@ -142,7 +145,7 @@ Page({
let data = {
source: "WECHATXCX",
product_list: product_list,
coupon: this.data.coupon ? this.data.coupon.id : null,
coupon_id: this.data.coupon ? this.data.coupon.id : null,
originate_order_id: this.data.kjId,
gp_id: app.globalData.gp_id,
team_id: app.globalData.team_id
@ -161,6 +164,7 @@ Page({
if (app.globalData.category_id) {
data.category_id = app.globalData.category_id;
}
if(!app.globalData.list){
commonApi.user_post("order/create", {
data: JSON.stringify(data)
}).then(res => {
@ -178,6 +182,14 @@ Page({
})
this.onLoad({});
})
}else{
app.globalData.productPrice = (this.data.showPrice + this.data.postFee - (this.data.coupon?this.data.coupon.activity.money:0))/100;
app.globalData.createDate = data
console.log(app.globalData.createDate)
wx.navigateTo({
url: '/pages/order/scene/index?flag='+this.data.flag,
})
}
},
getPostFee: function () {
if (!this.data.address) return;

6
pages/order/postOrder/index.wxml

@ -29,7 +29,7 @@
<view style="flex:1">运费</view>
<text>{{item.postFee?(item.postFee==0?'包邮':(item.postFee/100)):item.sku.sku_model.post_template_name}}</text>
</view>
<view class="box-title">
<view class="box-title" wx:if="{{flag!='mix'}}">
<view style="flex-shrink:0" >订单备注:</view>
<input type="text" bindinput="inputRemark" data-index="{{index}}" placeholder="选填"></input>
</view>
@ -47,14 +47,14 @@
</view>
</view>
</view>
<coupon id="coupon" wx:if="{{!kjId && !gp_id}}" money="{{showPrice + postFee}}" sku="{{sku_id}}"></coupon>
<coupon id="coupon" wx:if="{{!kjId && !gp_id && flag!='mix'}}" money="{{showPrice + postFee}}" sku="{{sku_id}}"></coupon>
<view style="height:113rpx"></view>
<view class="fixed-bottom" wx:if="{{product}}">
<view class="fixed-price-box" wx:if="{{!prizeId}}"><text>合计:</text><text
class="price">¥{{((showPrice + postFee - (coupon?coupon.activity.money:0))>0?(showPrice + postFee - (coupon?coupon.activity.money:0)):0)/100}}</text>
</view>
<view class="fixed-price-box" wx:else><text>合计:</text><text class="price">¥{{postFee?(0+postFee)/100:0}}</text></view>
<view class="fixed-btn" bindtap="order">提交订单</view>
<view class="fixed-btn" bindtap="order">下一步</view>
</view>
<view class="mask mask-allowance" wx:if="{{showAllowance}}">
<view bindtap="changeAllowance" class="mask-bg"></view>

45
pages/order/scene/index.js

@ -26,17 +26,21 @@ Page({
showAllowance: false,
allowance_data: null,
allowance_price: 0,
pIndex: 0,
flag:null,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log(app.globalData.product)
this.setData({
type: options.type,
kjId: app.globalData.kjId,
gp_id: app.globalData.gp_id || app.globalData.team_id,
prizeId: wx.getStorageSync('prizeId')
prizeId: wx.getStorageSync('prizeId'),
flag:options.flag
})
if (!app.globalData.product) {
util.back();
@ -46,6 +50,10 @@ Page({
this.setData({
productNum: app.globalData.product.productNum < 1 ? 1 : app.globalData.product.productNum
})
}else{
this.setData({
productNum: app.globalData.product.num < 1 ? 1 : app.globalData.product.num
})
}
this.setData({
product: app.globalData.product,
@ -96,6 +104,7 @@ Page({
this.setData({
productNum: this.data.productNum + 1
})
this.data.product.num = this.data.productNum
this.changePrice()
},
minus: function () {
@ -114,6 +123,7 @@ Page({
productNum: (this.data.productNum - 1),
coupon: null
})
this.data.product.num = this.data.productNum
this.changePrice()
},
changeDate: function (e) {
@ -163,6 +173,7 @@ Page({
this.setData({
singlePrice: app.globalData.kjId ? 0 : price
})
},
order: function () {
let linkmanList = this.data.linkmanList, productNum = this.data.productNum, date = this.data.date, time = this.data.time, remark = this.data.remark, product = this.data.product;
@ -238,7 +249,30 @@ Page({
postData.team_name = this.data.groupName
postData.type = 1;
}
app.globalData.list[app.globalData.index] = this.data.product
app.globalData.ticketPrice += (this.data.singlePrice * this.data.productNum - (this.data.coupon?this.data.coupon.activity.money:0))/100;
if(app.globalData.list.length > app.globalData.index + 1){
if(app.globalData.createDate){
app.globalData.createDate.product_list.push(data.product_list[0])
}else{
app.globalData.createDate = data
}
app.globalData.index = app.globalData.index + 1
app.globalData.product = app.globalData.list[app.globalData.index]
wx.redirectTo({
url: '/pages/order/scene/index?flag='+ this.data.flag,
})
return
}else{
console.log(app.globalData.list.length,app.globalData.postProduct)
if(app.globalData.list.length > 1 || app.globalData.postProduct.length>0){
if(app.globalData.createDate){
app.globalData.createDate.product_list.push(data.product_list[0])
}
wx.redirectTo({
url: '/pages/order/orderList/index'
})
}else{
commonApi.user_post(service, postData).then(res => {
if (app.globalData.kjId) {
this.setData({
@ -259,6 +293,8 @@ Page({
})
}
})
}
}
},
// 活动预约
activityOrder: function () {
@ -311,6 +347,11 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
console.log(this.data.flag);
if(app.globalData.list.length != 0){
app.globalData.product = app.globalData.list[app.globalData.index]
}
console.log(app.globalData.product)
if (!this.data.isLogin) {
commonApi.user_post("token/check").then(res => {
if (res.code == 1) {

6
pages/order/scene/index.wxml

@ -34,10 +34,10 @@
</view>
</view>
</view>
<coupon wx:if="{{!kjId && !gp_id && type!='activity' && product && product.isGroup!=1}}" id="coupon"
<coupon wx:if="{{!kjId && !gp_id && type!='activity' && product && product.isGroup!=1 && flag!='mix'}}" id="coupon"
money="{{singlePrice * productNum}}" sku="{{product.sku.id}}"></coupon>
<view class="box" wx:if="{{type!='activity' && product && product.isGroup!=1}}">
<view class="box-title">
<view class="box-title" wx:if="{{flag!='mix'}}">
<view style="flex-shrink:0">订单备注</view>
<input type="text" bindinput="changeRemark" placeholder="选填"></input>
</view>
@ -50,7 +50,7 @@
<view class="fixed-price-box" wx:else><text>合计:</text><text
class="price">¥{{((singlePrice * productNum - (coupon?coupon.activity.money:0))>0?(singlePrice * productNum - (coupon?coupon.activity.money:0)):0)/ 100}}</text>
</view>
<view class="fixed-btn" bindtap="order">提交订单</view>
<view class="fixed-btn" bindtap="order">下一步</view>
</view>
<view class="fixed-bottom yuyue-box" wx:else>
<view class="fixed-btn yuyue-btn" bindtap="order" wx:if="{{type=='museum'}}">立即预约</view>

48
pages/user/cartlist/list.js

@ -16,7 +16,9 @@ Page({
menuWidth:width - rect.right + rect.width + 6,
list:[],
allChecked:false,
allPrice:0
allPrice:0,
productType:'',
flag:false,//判断订单是否同时有商品和票
},
/**
@ -25,9 +27,14 @@ Page({
onLoad: function (options) {
this.getList();
},
gotoDetail:function(e){
console.log(e)
let item = e.currentTarget.dataset.item.product;
util.gotoDetail(item,1);
},
getList:function(){
commonApi.user_post("cart/get_list",{
// type: '1'
}).then(res=>{
this.setData({
list:res.data
@ -107,28 +114,51 @@ Page({
util.pagePoint({
event:'cart_order'
},1)
let list = this.data.list,price=0,product=[];
let list = this.data.list,price=0,product=[],product1=[]
list.map(item=>{
if(item.checked){
item.product.type="post";
// item.product.type="post";
if(item.product.type == 'post'){
product.push({
product:item.product,
sku:item.sku,
productNum:item.num
})
}else{
product1.push(item)
app.globalData.list = product1
}
if(item.product.type.includes('post')){
this.data.productType = 'post'
}
}
})
if(product.length==0) {
if(product.length==0 && product1.length==0) {
wx.showToast({
title: '请先选择产品',
icon: 'none'
})
return;
}
if (product.length>0 && product1.length>0) {
this.setData({
flag: 'mix'
})
}
app.globalData.postProduct = product;
if(app.globalData.list){
app.globalData.product = app.globalData.list[app.globalData.index]
}
if(this.data.productType == 'post'){
console.log(this.data.flag);
wx.navigateTo({
url: '/pages/order/postOrder/index?from=cart',
url: '/pages/order/postOrder/index?from=cart&flag='+this.data.flag,
})
}else{
wx.navigateTo({
url: '/pages/order/scene/index',
})
}
},
touchStart(e){//移动前点击的位置
console.log(e)
@ -212,6 +242,12 @@ Page({
util.pagePoint({
event:'cart_view'
},1)
app.globalData.list = null
app.globalData.createDate = null
app.globalData.index = 0
app.globalData.productPrice = 0
app.globalData.ticketPrice = 0
this.data.productType = ''
},
/**

2
pages/user/cartlist/list.wxml

@ -5,7 +5,7 @@
<view wx:for="{{list}}" class="goods-item {{item.isTouchMove ? 'touch-move-active' : ''}}" bindtouchstart='touchStart' bindtouchmove='touchmove' data-index="{{index}}">
<view class="item{{(item.product.flag!=1 || item.sku.flag!='on')?' disable':''}}">
<view class="iconfont{{item.checked?' icon-gou':' icon-quan'}}" bindtap="select" data-index="{{index}}"></view>
<image src="{{item.sku.headimg}}" mode="aspectFill"></image>
<image src="{{item.sku.headimg}}" mode="aspectFill" bindtap="gotoDetail" data-item="{{item}}"></image>
<view class="item-info textOver">
<view class="title textOver">{{item.product.title}}</view>
<view class="sku-title textOver">

14
project.private.config.json

@ -6,9 +6,10 @@
"miniprogram": {
"list": [
{
"name": "精彩回顾",
"pathName": "pages/pbService/activity/index",
"query": "id=4407",
"name": "首页",
"pathName": "pages/index/index",
"query": "",
"launchMode": "default",
"scene": null
},
{
@ -48,9 +49,10 @@
"scene": null
},
{
"name": "pages/pbService/web/index",
"pathName": "pages/pbService/web/index",
"query": "id=10973",
"name": "pages/order/orderList/index",
"pathName": "pages/order/orderList/index",
"query": "",
"launchMode": "default",
"scene": null
},
{

Loading…
Cancel
Save