jiazhipeng 4 months ago
parent
commit
07f93cd7bd
  1. 2
      app.js
  2. 4
      pages/index/index.js
  3. 6
      pages/order/road/index.js
  4. 6
      pages/order/road/index.wxml
  5. 9
      project.private.config.json

2
app.js

@ -38,7 +38,7 @@ App({
// 获取前端配置文件
commonApi._post("pbservice/Other/getClientConfig", {unique_key: "wechatxcx"}).then(res => {
let data = JSON.parse(res.data);
data.isTest = data.isTest156? true : false;
data.isTest = data.isTest158? true : false;
data.indexSeason = null
this.globalData.configJson = data
}).then(() => {

4
pages/index/index.js

@ -541,8 +541,8 @@ Page({
func_data: (app.globalData.configJson.func_data||{})
})
} else {
// 小程序是3
commonApi._post("adv/get_home_ui", {type_id: 15}).then(res => {
// 小程序是3 测试H5 15
commonApi._post("adv/get_home_ui", {type_id: 3}).then(res => {
let obj = {};
(res.data.content||[]).forEach(item => {
obj[item.id] = item.image

6
pages/order/road/index.js

@ -98,20 +98,22 @@ Page({
stock = stock+i.stock;
})
item.stock = stock;
if(item.stock>0){
// if(item.stock>0){
if (item.info.some(x=>x.stock!=null)){
let date = item.date.split("-").splice(1,2),newDate=[];
console.log(date)
date.map(d=>{
d = parseInt(d);
newDate.push(d)
})
if(!selectDate){
if(!selectDate&&item.stock>0){
selectDate = newDate[1];
selectMonth = newDate[0];
}
prices[newDate.join("-")] = item;
}
})
console.log(prices, "---------------")
this.setData({
prices:prices
})

6
pages/order/road/index.wxml

@ -23,9 +23,9 @@
</view>
<view class="day-item{{selectDate.selectMonth==month[monthIndex] && selectDate.selectDate==(index+1)?' active':''}}" wx:for="{{monthIndex==1?monthDays2[0]:monthDays1[0]}}">
<view class="date-item-in" bindtap="selectDate" data-item="{{item}}">
<view class="date-num{{prices[month[monthIndex]+'-'+(index+1)] && prices[month[monthIndex]+'-'+(index+1)].product_price!=null?' active':''}}">{{(index+1)>=10?(index+1):("0"+(index+1))}}</view>
<view class="price" wx:if="{{prices[month[monthIndex]+'-'+(index+1)] && prices[month[monthIndex]+'-'+(index+1)].product_price!==null && prices[month[monthIndex]+'-'+(index+1)].stock!==null}}">¥{{prices[month[monthIndex]+'-'+(index+1)].m_price/100}}</view>
<view class="date-price-place" wx:elif="{{prices[month[monthIndex]+'-'+(index+1)] && prices[month[monthIndex]+'-'+(index+1)].stock==0}}">售罄</view>
<view class="date-num{{prices[month[monthIndex]+'-'+(index+1)] && prices[month[monthIndex]+'-'+(index+1)].product_price!=null&& prices[month[monthIndex]+'-'+(index+1)].stock>0?' active':''}}">{{(index+1)>=10?(index+1):("0"+(index+1))}}</view>
<view class="price" wx:if="{{prices[month[monthIndex]+'-'+(index+1)] && prices[month[monthIndex]+'-'+(index+1)].product_price!==null && prices[month[monthIndex]+'-'+(index+1)].stock>0}}">¥{{prices[month[monthIndex]+'-'+(index+1)].m_price/100}}</view>
<view class="date-price-place" style="font-size: 23rpx;color: #999;" wx:elif="{{prices[month[monthIndex]+'-'+(index+1)] && prices[month[monthIndex]+'-'+(index+1)].stock===0}}">售罄</view>
<view class="date-price-place" wx:else></view>
</view>
</view>

9
project.private.config.json

@ -9,10 +9,17 @@
{
"name": "pages/info/roadInfo/index",
"pathName": "pages/info/roadInfo/index",
"query": "id=3897",
"query": "id=457033",
"scene": null,
"launchMode": "default"
},
{
"name": "pages/info/roadInfo/index",
"pathName": "pages/info/roadInfo/index",
"query": "id=3897",
"launchMode": "default",
"scene": null
},
{
"name": "pages/user/order/postOrderInfo/index",
"pathName": "pages/user/order/showOrderInfo/index",

Loading…
Cancel
Save