diff --git a/pages/index/index.js b/pages/index/index.js index 84ba5eb..26d0fec 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -52,7 +52,7 @@ Page({ this.setData({ showTime:true }) - let timer = setInterval(() => { + var timer = setInterval(() => { this.setData({ time: this.data.time - 1 }) @@ -61,8 +61,10 @@ Page({ this.setData({ showFullAdv: false }) - if (!this.data.alertSwipeList>0) - wx.showTabBar() //倒计时结束清楚定时器显示导航栏 + if (this.data.alertSwipeList.length==0) { + wx.showTabBar() //倒计时结束清楚定时器显示导航栏 + } + } }, 1000) @@ -196,7 +198,7 @@ Page({ alertSwipeList: res.data || [], showAdv: true }) - }else{ + }else if(!this.data.showFullAdv){ wx.showTabBar({ animation: true, }) @@ -613,6 +615,7 @@ Page({ }) }, bannerJumpNew(item) { + let that = this item = item.currentTarget.dataset.item if (item.tdata == '') return diff --git a/pages/index/index.wxml b/pages/index/index.wxml index 71e01c4..0341df0 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -24,7 +24,7 @@ - + @@ -220,6 +220,11 @@ 书香借阅 + + + 文化配送 + diff --git a/pages/info/hotelProductInfo/index.js b/pages/info/hotelProductInfo/index.js index eb4c6eb..15b2229 100644 --- a/pages/info/hotelProductInfo/index.js +++ b/pages/info/hotelProductInfo/index.js @@ -218,6 +218,17 @@ Page({ comment: res.data.list, commentTotal: res.data.total }) + let arr = this.data.comment + arr.map((item)=>{ + if (item.img_list) { + item.img_list = item.img_list.split(',') + }else{ + item.img_list=[] + } + }) + this.setData({ + comment:arr + }) }) }, like: function () { diff --git a/pages/info/hotelProductInfo/index.wxml b/pages/info/hotelProductInfo/index.wxml index 5460744..2198ff8 100644 --- a/pages/info/hotelProductInfo/index.wxml +++ b/pages/info/hotelProductInfo/index.wxml @@ -105,12 +105,15 @@ - {{item.user.nickname}} + {{item.nickname}} {{item.create_time}} {{item.content}} + + + 查看全部点评 diff --git a/pages/info/hotelProductInfo/index.wxss b/pages/info/hotelProductInfo/index.wxss index d1ded8a..a8840ba 100644 --- a/pages/info/hotelProductInfo/index.wxss +++ b/pages/info/hotelProductInfo/index.wxss @@ -550,4 +550,10 @@ page { font-size: 31rpx; font-weight: 500; margin-top: 50rpx; +} +.imgs{ + width: 200rpx; + height: 200rpx; + margin: 10rpx; + border-radius: 8rpx; } \ No newline at end of file diff --git a/pages/info/postProductInfo/index.js b/pages/info/postProductInfo/index.js index d02337c..0f20584 100644 --- a/pages/info/postProductInfo/index.js +++ b/pages/info/postProductInfo/index.js @@ -92,6 +92,17 @@ Page({ comment: res.data.list, commentTotal: res.data.total }) + let arr = this.data.comment + arr.map((item)=>{ + if (item.img_list) { + item.img_list = item.img_list.split(',') + }else{ + item.img_list=[] + } + }) + this.setData({ + comment:arr + }) }) }, diff --git a/pages/info/postProductInfo/index.wxml b/pages/info/postProductInfo/index.wxml index 7166da8..9b30638 100644 --- a/pages/info/postProductInfo/index.wxml +++ b/pages/info/postProductInfo/index.wxml @@ -66,13 +66,16 @@ - {{item.user.nickname}} + {{item.nickname}} {{item.create_time}} {{item.content}} + + + 查看全部点评 diff --git a/pages/info/postProductInfo/index.wxss b/pages/info/postProductInfo/index.wxss index bf4277a..655e60e 100644 --- a/pages/info/postProductInfo/index.wxss +++ b/pages/info/postProductInfo/index.wxss @@ -806,4 +806,10 @@ page { .mask-allowance .mask-content .rule-title { text-align: center; margin-bottom: 20rpx; +} +.imgs{ + width: 200rpx; + height: 200rpx; + margin: 10rpx; + border-radius: 8rpx; } \ No newline at end of file diff --git a/pages/info/sceneProductInfo/index.js b/pages/info/sceneProductInfo/index.js index c3c5a2d..242627f 100644 --- a/pages/info/sceneProductInfo/index.js +++ b/pages/info/sceneProductInfo/index.js @@ -96,6 +96,7 @@ Page({ this.setData({ info: res.data }) + console.log(this.data.info); util.pagePoint({ event: 'scene_view', param: { type: res.data.type, id: res.data.id } }, 1) this.BroswerRecord() }) @@ -130,7 +131,17 @@ Page({ comment: res.data.list.splice(0, 3), commentTotal: res.data.total }) - console.log(res) + let arr = this.data.comment + arr.map((item)=>{ + if (item.img_list) { + item.img_list = item.img_list.split(',') + }else{ + item.img_list=[] + } + }) + this.setData({ + comment:arr + }) }) }, changeAllowance: function () { diff --git a/pages/info/sceneProductInfo/index.wxml b/pages/info/sceneProductInfo/index.wxml index a2d5f8d..48758d2 100644 --- a/pages/info/sceneProductInfo/index.wxml +++ b/pages/info/sceneProductInfo/index.wxml @@ -167,13 +167,16 @@ - {{item.user.nickname}} + {{item.nickname}} {{item.create_time}} {{item.content}} + + + 查看全部点评 diff --git a/pages/info/sceneProductInfo/index.wxss b/pages/info/sceneProductInfo/index.wxss index bac3e07..dd66fa4 100644 --- a/pages/info/sceneProductInfo/index.wxss +++ b/pages/info/sceneProductInfo/index.wxss @@ -259,7 +259,7 @@ page { } .comment-content { - margin-left: 72rpx; + margin-left:10rpx; margin-top: 36rpx; font-size: 28rpx; color: #000; @@ -272,6 +272,7 @@ page { color: #999; font-size: 27rpx; font-weight: 500; + margin-bottom:60rpx ; } .more-comment-btn .iconfont { @@ -795,4 +796,10 @@ page { height: 80rpx; left: 650rpx; border-radius: 50%; +} +.imgs{ + width: 200rpx; + height: 200rpx; + margin: 10rpx; + border-radius: 8rpx; } \ No newline at end of file diff --git a/pages/list/comments/index.js b/pages/list/comments/index.js index c8b156d..580e115 100644 --- a/pages/list/comments/index.js +++ b/pages/list/comments/index.js @@ -45,9 +45,30 @@ Page({ total:res.data.total, list:list.concat(res.data.list) }) + let arr = this.data.list + arr.map((item)=>{ + if (item.img_list) { + item.img_list = item.img_list.split(',') + }else{ + item.img_list=[] + } + }) + this.setData({ + list:arr + }) + }) + }, + imgsc:function(e){ + console.log(e); + var src = e.currentTarget.dataset.img;//获取data-src + var imgList = e.currentTarget.dataset.list;//获取data-list + console.log(src) + //图片预览 + wx.previewImage({ + current: src, // 当前显示图片的http链接 + urls: imgList // 需要预览的图片http链接列表 }) }, - /** * 生命周期函数--监听页面初次渲染完成 */ diff --git a/pages/list/comments/index.wxml b/pages/list/comments/index.wxml index 1d3db29..a452885 100644 --- a/pages/list/comments/index.wxml +++ b/pages/list/comments/index.wxml @@ -5,11 +5,15 @@ - {{item.user.nickname}} + {{item.nickname}} {{item.create_time}} {{item.content}} + + + + diff --git a/pages/list/comments/index.wxss b/pages/list/comments/index.wxss index 042b432..c2e2f7d 100644 --- a/pages/list/comments/index.wxss +++ b/pages/list/comments/index.wxss @@ -37,11 +37,17 @@ margin-top: 4rpx; } .comment-detail { - margin-left: 87rpx; + margin-left: 10rpx; font-size: 29rpx; color: #000; margin-top: 25rpx; } .comment-item:last-child { border-bottom: none; +} +.imgs{ + width: 200rpx; + height: 200rpx; + margin: 10rpx; + border-radius: 8rpx; } \ No newline at end of file diff --git a/pages/order/comment/index.js b/pages/order/comment/index.js index 9286452..2b65471 100644 --- a/pages/order/comment/index.js +++ b/pages/order/comment/index.js @@ -45,7 +45,6 @@ Page({ }) }, changeStar: function (e) { - console.log(e) wx.showLoading({ title: '加载中' }) @@ -57,11 +56,9 @@ Page({ info: info, rate:info.order_product_list[index].star }) - console.log(info); wx.hideLoading({}) }, changeContent: function (e) { - console.log(e) let index = e.currentTarget.dataset.index, info = this.data.info; info.order_product_list[index].content = e.detail.value; @@ -81,7 +78,6 @@ Page({ }) flag = false; } - console.log(item); ajax.push(commonApi.user_post("product/product_comment", { product_id: item.product_id, content: item.content, @@ -93,7 +89,6 @@ Page({ }) if (!flag) return; Promise.all(ajax).then(res => { - console.log(res) let flag = false; res.map(item => { if (item.code == 1) { @@ -109,12 +104,11 @@ Page({ //图片上传 // 上传图片 chooseImg: function (e) { - console.log(e); var that = this; var imgs = this.data.imgs; - if (imgs.length >= 8) { + if (imgs.length >= 9) { wx.showToast({ - title: '最多上传八张图片哦..', + title: '最多上传九张图片哦..', icon: 'none' }) return false; @@ -142,48 +136,46 @@ Page({ } var tempFilePaths = res.tempFilePaths; var imgs = that.data.imgs; - wx.uploadFile({ - url: 'https://test.api.cloud.sz-trip.com/api/pbservice.other/upload', //这里是上传的服务器地址 - filePath: tempFilePaths[0], - name: 'file', - header: { - token: wx.getStorageSync('jstrip_token'), - }, - success(res) { + console.log(imgs); + wx.showLoading({ + title: '上传中', + }) - var res = JSON.parse(res.data); - if (res.code!=1) { - wx.showToast({ - title: res.msg, - icon: 'none' - }) - return - } - let img = res.data.url; - let arr = that.data.upImgs - arr.push(img) - that.setData({ - upImgs:arr - }) - console.log(that.data.upImgs); - for (var i = 0; i < tempFilePaths.length; i++) { - if (imgs.length >= 9) { - that.setData({ - imgs: imgs - }); - return false; - } else { - imgs.push(tempFilePaths[i]); + for (let i = 0; i < tempFilePaths.length; i++) { + wx.uploadFile({ + url: 'https://test.api.cloud.sz-trip.com/api/pbservice.other/upload', //这里是上传的服务器地址 + filePath: tempFilePaths[i], + name: 'file', + header: { + token: wx.getStorageSync('jstrip_token'), + }, + success(res) { + wx.hideLoading() + var res = JSON.parse(res.data); + if (res.code!=1) { + wx.showToast({ + title: res.msg, + icon: 'none' + }) + return } + let img = res.data.url; + let arr = that.data.upImgs + arr.push(img) + that.setData({ + upImgs:arr + }) + imgs.push(tempFilePaths[i]); + that.setData({ + imgs: imgs + }); } - // console.log(imgs); - that.setData({ - imgs: imgs - }); - console.log(that.data.imgs); - const data = res.data + }) + if (that.data,imgs.length+i==8) { + return } - }) + } + } }); @@ -218,7 +210,6 @@ Page({ this.setData({ checked:!this.data.checked }) - console.log(this.data.checked); }, /** * 生命周期函数--监听页面初次渲染完成 diff --git a/pages/pbService/index.wxml b/pages/pbService/index.wxml index 43464b2..1940aff 100644 --- a/pages/pbService/index.wxml +++ b/pages/pbService/index.wxml @@ -38,10 +38,10 @@ 12348 - +