Browse Source

二维码,线路

master
caichunsheng 3 years ago
parent
commit
7f414b5800
  1. 84
      pages/info/sceneProductInfo/index.js
  2. 8
      pages/info/sceneProductInfo/index.wxml
  3. 3
      pages/info/sceneProductInfo/index.wxss
  4. 1
      pages/order/road/index.js

84
pages/info/sceneProductInfo/index.js

@ -74,8 +74,8 @@ Page({
// 如果带有指定skuid的话 那么取指定的sku展示
if (options.skuid) {
let pItem = null;
for (let i = 0; i < res.data.product.length; i++) {
for (let j = 0; j < res.data.product[i].sku.length; j++) {
for (let i = 0; i < res.data.product.length; i++) {//3
for (let j = 0; j < res.data.product[i].sku.length; j++) {//4
if (res.data.product[i].sku[j].id == options.skuid) {
res.data.product[i].sku = [res.data.product[i].sku[j]];
pItem = res.data.product[i];
@ -274,7 +274,6 @@ Page({
})
return;
} else {
app.globalData.postProduct = []
app.globalData.list = []
if (this.data.skuFlag == 'order') {
@ -302,9 +301,10 @@ Page({
...sku,
...product
}
wx.navigateTo({
url: '/pages/order/scene/index',
})
wx.navigateTo({
url: '/pages/order/scene/index',
})
} else {
commonApi.user_post("cart/add_sku", {
sku_id: this.data.skuList[this.data.skuIndex].id,
@ -313,7 +313,7 @@ Page({
if (res.code == 1) {
commonApi.user_post('cart/get_list', {}).then(res => {
this.setData({
cartCount: res.data.length
cartCount: res.data.length//5
})
})
// 加动效
@ -661,6 +661,12 @@ Page({
})
return;
}
if (this.data.info.product[0].type=='line') {
wx.navigateTo({
url: '/pages/order/road/index?id=' + this.data.info.product[0].id
})
return
}
this.setData({
skuFlag: 'order'
})
@ -687,7 +693,7 @@ Page({
onShow: function () {
commonApi.user_post('cart/get_list', {}).then(res => {
this.setData({
cartCount: res.data.length
cartCount: res.data.length//1
})
})
if (!wx.getStorageSync('jstrip_token')) {
@ -695,36 +701,38 @@ Page({
}
if (this.data.info && this.data.info.id) {
this.drawImg()
// 获取补贴
if (this.data.product.length == 1) {
commonApi.user_post("product/getProductAllowancePrice", {
product_code: this.data.product[0].product.product_code
}).then(resTwo => {
if (resTwo && resTwo.code == 1) {
this.setData({
allowance_data: resTwo.data
})
let spread_price = Number(this.data.allowance_data.discount_limit_price - this.data.allowance_data.user_used_price)
let sInfo = this.data.product[0].sku
if (spread_price > 0) {
if (spread_price < this.data.allowance_data.discount_rate / 100 * sInfo.price) {
this.setData({
allowance_price: spread_price
})
} else {
this.setData({
allowance_price: this.data.allowance_data.discount_rate / 100 * sInfo.price
})
}
this.changePrice()
} else {
this.setData({
allowance_price: 0
})
}
}
})
}
//// 获取补贴
// if (this.data.product.length == 1) {
// commonApi.user_post("product/getProductAllowancePrice", {
// product_code: this.data.product[0].product.product_code
// }).then(resTwo => {
// if (resTwo && resTwo.code == 1) {
// this.setData({
// allowance_data: resTwo.data
// })
// let spread_price = Number(this.data.allowance_data.discount_limit_price - this.data.allowance_data.user_used_price)
// let sInfo = this.data.product[0].sku
// if (spread_price > 0) {
// if (spread_price < this.data.allowance_data.discount_rate / 100 * sInfo.price) {
// this.setData({
// allowance_price: spread_price
// })
// } else {
// this.setData({
// allowance_price: this.data.allowance_data.discount_rate / 100 * sInfo.price
// })
// }
// this.changePrice()
// } else {
// this.setData({
// allowance_price: 0
// })
// }
// }
// })
// }
//// 获取补贴结束
} else {
setTimeout(() => {
this.onShow()

8
pages/info/sceneProductInfo/index.wxml

@ -26,9 +26,9 @@
<view class="info-address">开园时间:{{info.open_time}}</view>
<navigator url="/pages/info/sceneInfo/index?id={{info.id}}" catchtap="pagePoint" data-event="scene_detail" class="iconfont" style="font-size:27rpx;flex-shrink:0">优待政策 | 景点介绍 <text class="iconfont icon-you" style="font-size:24rpx"></text></navigator>
</view>
<view class="tags-box textOver address-box">
<view class="tags-box textOver address-box" bindtap="gotolocation">
<view class="info-address">地址:{{info.address}}</view>
<view class="iconfont icon-daohang" bindtap="gotolocation"></view>
<view class="iconfont icon-daohang"></view>
</view>
<view class="status-text{{info.garden_flag==0?' disable':''}}" wx:if="{{info.garden_flag_text && info.garden_flag!=1}}">{{info.garden_flag_text}}</view>
</view>
@ -69,8 +69,8 @@
</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" bindtap="showCart" wx:if="{{info.product[0].type!='line'}}">加入购物车</view>
<view class="btn {{info.product[0].type=='line' ? 'btn-r':''}}" bindtap="showOrder" wx:if="{{info && info.flag==1}}">立即预订</view>
<view class="btn disable" wx:elif="{{info}}">该商品已下架</view>
</view>
</view>

3
pages/info/sceneProductInfo/index.wxss

@ -840,4 +840,7 @@ page {
color: #666;
font-size: 24rpx;
margin-top: 8rpx;
}
.btn-r{
border-radius: 39rpx !important;
}

1
pages/order/road/index.js

@ -26,6 +26,7 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log(options.skuid);
this.setData({
id:options.id
})

Loading…
Cancel
Save