diff --git a/app.js b/app.js index fab4ac5..7fe404f 100644 --- a/app.js +++ b/app.js @@ -21,7 +21,7 @@ App({ unique_key: "wechatxcx" }).then(res => { let data = JSON.parse(res.data); - data.isTest = data.isTest55? true : false; + data.isTest = data.isTest56? true : false; this.globalData.configJson = data }).then(() => { // 获取ui配置文件 diff --git a/pages/info/sceneProductInfo/index.js b/pages/info/sceneProductInfo/index.js index aad07af..5f9657f 100644 --- a/pages/info/sceneProductInfo/index.js +++ b/pages/info/sceneProductInfo/index.js @@ -25,19 +25,55 @@ Page({ allowance_data: null, //购物车数量 producNum: 1, - skuIndex:null, + skuIndex: null, aniSkuIndex: -1, cartCount: 0, cartImgInfo: null, cartTop: 0, top: 0, skuList: [], //立即预定的列表 + sku_ids: [ + 353954, + 353950, + 353949, + 353951, + 353947, + 353953, + 353685, + 353684, + 353952, + 353686, + 353948, + 354730, + 354409, + 354359, + 345343, + 354756, + 354385, + 354360, + 354361, + 354362, + 355466, + 355465, + 356230, + 356223, + 356207, + 346648, + 357518, + 356233, + 354381, + 354384, + 356324, + 354737, + 355467, + ] }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { + console.log(options); if (!options.id) { util.back() return; @@ -74,8 +110,8 @@ Page({ // 如果带有指定skuid的话 那么取指定的sku展示 if (options.skuid) { let pItem = null; - for (let i = 0; i < res.data.product.length; i++) {//3 - for (let j = 0; j < res.data.product[i].sku.length; j++) {//4 + 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]; @@ -86,6 +122,21 @@ Page({ if (pItem) { res.data.product = [pItem]; } + + } else if (options.zhuanti_type == "yihuFree") { + + let skuArr = this.data.sku_ids + let newArr = [] + for (let i = 0; i < res.data.product.length; i++) { //3 + for (let j = 0; j < res.data.product[i].sku.length; j++) { //4 + for (let k = 0; k < skuArr.length; k++) { + if (res.data.product[i].sku[j].id == skuArr[k]) { + newArr.push(res.data.product[i].sku[j]) + } + } + } + res.data.product[i].sku = newArr; + } } // res.data.listimg = res.data.listimg?res.data.listimg.split(","):[]; res.data.product.map(product => { @@ -250,7 +301,7 @@ Page({ // }, selectSku: function (e) { console.log(e.currentTarget.dataset.item); - if (e.currentTarget.dataset.item.stock == 0 && e.currentTarget.dataset.item.is_third_stock!=1) { + if (e.currentTarget.dataset.item.stock == 0 && e.currentTarget.dataset.item.is_third_stock != 1) { wx.showToast({ title: "该商品暂无库存", icon: 'none' @@ -301,10 +352,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 +364,7 @@ Page({ if (res.code == 1) { commonApi.user_post('cart/get_list', {}).then(res => { this.setData({ - cartCount: res.data.length//5 + cartCount: res.data.length //5 }) }) // 加动效 @@ -661,7 +712,7 @@ Page({ }) return; } - if (this.data.info.product[0].type=='line') { + if (this.data.info.product[0].type == 'line') { wx.navigateTo({ url: '/pages/order/road/index?id=' + this.data.info.product[0].id }) @@ -691,9 +742,10 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { + console.log(11111); commonApi.user_post('cart/get_list', {}).then(res => { this.setData({ - cartCount: res.data.length//1 + cartCount: res.data.length //1 }) }) if (!wx.getStorageSync('jstrip_token')) { @@ -734,8 +786,9 @@ Page({ //// 获取补贴结束 } else { + console.log(2222); setTimeout(() => { - this.onShow() + // this.onShow() }, 200) } diff --git a/pages/user/user.wxml b/pages/user/user.wxml index 9cc4f84..d39a015 100644 --- a/pages/user/user.wxml +++ b/pages/user/user.wxml @@ -66,9 +66,9 @@ 团体预约订单 - + diff --git a/pages/user/videoCoupon/index.js b/pages/user/videoCoupon/index.js index 2f98442..1eb9f1b 100644 --- a/pages/user/videoCoupon/index.js +++ b/pages/user/videoCoupon/index.js @@ -21,8 +21,8 @@ Page({ }, getList(){ if(this.data.list.length>=this.data.total) return; - commonApi.user_post("actonline/video_act/prizeLog",{ - id:5, + commonApi.user_post("sweepstakes/sweepstakes_act/prizeLog",{ + sweepstakes_id:6, page:this.data.page, limit:20 }).then(res=>{ diff --git a/project.private.config.json b/project.private.config.json index d03db11..eedf488 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -65,5 +65,6 @@ } }, "projectname": "%E8%8B%8F%E5%B7%9E%E6%96%87%E6%97%85", - "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html" + "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", + "libVersion": "2.30.0" } \ No newline at end of file