1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-comment-index"],{"02d7":function(t,e,n){var i=n("4be2");"string"===typeof i&&(i=[[t.i,i,""]]),i.locals&&(t.exports=i.locals);var a=n("4f06").default;a("c0abe53a",i,!0,{sourceMap:!1,shadowMode:!1})},"0a2d":function(t,e,n){"use strict";n("a9e3"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i={props:{url:{type:String,default:""},width:{type:Number,default:90},borderWidth:{type:Number,default:0},borderColor:{type:String,default:"#000000"}},data:function(){return{}},methods:{}};e.default=i},"0dc5":function(t,e,n){"use strict";n("a9e3"),n("e25e"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i={name:"u-rate",props:{value:{type:[Number,String],default:-1},count:{type:[Number,String],default:5},current:{type:[Number,String],default:0},disabled:{type:Boolean,default:!1},size:{type:[Number,String],default:32},inactiveColor:{type:String,default:"#b2b2b2"},activeColor:{type:String,default:"#FA3534"},gutter:{type:[Number,String],default:10},minCount:{type:[Number,String],default:0},allowHalf:{type:Boolean,default:!1},activeIcon:{type:String,default:"star-fill"},inactiveIcon:{type:String,default:"star"},customPrefix:{type:String,default:"uicon"},colors:{type:Array,default:function(){return[]}},icons:{type:Array,default:function(){return[]}}},data:function(){return{elId:this.$u.guid(),elClass:this.$u.guid(),starBoxLeft:0,activeIndex:-1!=this.value?this.value:this.current,starWidth:0,starWidthArr:[]}},watch:{current:function(t){this.activeIndex=t},value:function(t){this.activeIndex=t}},computed:{decimal:function(){return this.disabled?100*this.activeIndex%100:this.allowHalf?50:void 0},elActiveIcon:function(){var t=this.icons.length;if(t&&t<=this.count){var e=Math.round(this.activeIndex/Math.round(this.count/t));return e<1?this.icons[0]:e>t?this.icons[t-1]:this.icons[e-1]}return this.activeIcon},elActiveColor:function(){var t=this.colors.length;if(t&&t<=this.count){var e=Math.round(this.activeIndex/Math.round(this.count/t));return e<1?this.colors[0]:e>t?this.colors[t-1]:this.colors[e-1]}return this.activeColor}},methods:{getElRectById:function(){var t=this;this.$u.getRect("#"+this.elId).then((function(e){t.starBoxLeft=e.left}))},getElRectByClass:function(){var t=this;this.$u.getRect("."+this.elClass).then((function(e){t.starWidth=e.width;for(var n=0;n<t.count;n++)t.starWidthArr[n]=(n+1)*t.starWidth}))},touchMove:function(t){if(!this.disabled&&t.changedTouches[0]){var e=t.changedTouches[0].pageX,n=e-this.starBoxLeft;n<=0&&(this.activeIndex=0);var i=Math.ceil(n/this.starWidth);this.activeIndex=i>this.count?this.count:i,this.activeIndex<this.minCount&&(this.activeIndex=this.minCount),this.emitEvent()}},click:function(t,e){this.disabled||(this.allowHalf,1==t?1==this.activeIndex?this.activeIndex=0:this.activeIndex=1:this.activeIndex=t,this.activeIndex<this.minCount&&(this.activeIndex=this.minCount),this.emitEvent())},emitEvent:function(){this.$emit("change",this.activeIndex),-1!=this.value&&this.$emit("input",this.activeIndex)},showDecimalIcon:function(t){return this.disabled&&parseInt(this.activeIndex)===t}},mounted:function(){this.getElRectById(),this.getElRectByClass()}};e.default=i},"0fd8":function(t,e,n){"use strict";var i=n("02d7"),a=n.n(i);a.a},"1abb":function(t,e,n){"use strict";n.r(e);var i=n("8617"),a=n.n(i);for(var r in i)"default"!==r&&function(t){n.d(e,t,(function(){return i[t]}))}(r);e["default"]=a.a},"32ac":function(t,e,n){"use strict";var i=n("4ea4");Object.defineProperty(e,"__esModule",{value:!0}),e.total=e.listRows=e.list=void 0;var a=i(n("5530")),r=i(n("c05a")),s={list:"comment/list",listRows:"comment/listRows",total:"comment/total"},o=function(t,e,n){return r.default.get(s.list,(0,a.default)((0,a.default)({},e),{},{goodsId:t}),n)};e.list=o;var c=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;return r.default.get(s.listRows,{goodsId:t,limit:e})};e.listRows=c;var u=function(t){return r.default.get(s.total,{goodsId:t})};e.total=u},4094:function(t,e,n){"use strict";n.r(e);var i=n("41d0"),a=n("fcb6");for(var r in a)"default"!==r&&function(t){n.d(e,t,(function(){return a[t]}))}(r);n("a3b1");var s,o=n("f0c5"),c=Object(o["a"])(a["default"],i["b"],i["c"],!1,null,"33483a45",null,!1,i["a"],s);e["default"]=c.exports},"41d0":function(t,e,n){"use strict";var i;n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return r})),n.d(e,"a",(function(){return i}));var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("v-uni-view",{staticClass:"avatar-image"},[n("v-uni-image",{staticClass:"image",style:{width:t.width+"rpx",height:t.width+"rpx",borderWidth:t.borderWidth+"rpx",borderColor:t.borderColor},attrs:{src:t.url?t.url:"/static/default-avatar.png"}})],1)},r=[]},"4be2":function(t,e,n){var i=n("24fb");e=i(!1),e.push([t.i,'@charset "UTF-8";\r\n/**\r\n * 这里是uni-app内置的常用样式变量\r\n *\r\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\r\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\r\n *\r\n */\r\n/**\r\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\r\n *\r\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\r\n */\r\n/* 颜色变量 */\r\n/* 行为相关颜色 */\r\n/* 文字基本颜色 */\r\n/* 背景颜色 */\r\n/* 边框颜色 */\r\n/* 尺寸变量 */\r\n/* 文字尺寸 */\r\n/* 图片尺寸 */\r\n/* Border Radius */\r\n/* 水平间距 */\r\n/* 垂直间距 */\r\n/* 透明度 */\r\n/* 文章场景相关 */\r\n/* 引入uView全局scss变量文件 */.comment-item[data-v-21d8b78b]{padding:%?30?%;box-sizing:border-box;border-bottom:%?1?% solid #f7f7f7;background:#fff}.item-head[data-v-21d8b78b]{display:flex;align-items:center}.item-head .user-info[data-v-21d8b78b]{margin-right:%?15?%;display:flex;align-items:center}.item-head .user-info .user-avatar[data-v-21d8b78b]{margin-right:%?15?%}.item-head .user-info .user-name[data-v-21d8b78b]{color:#999}.item-content[data-v-21d8b78b]{font-size:%?30?%;color:#333;margin:%?16?% 0}.images-list[data-v-21d8b78b]::after{clear:both;content:" ";display:table}.images-list .image-preview[data-v-21d8b78b]{float:left;margin-bottom:%?15?%;margin-right:%?15?%}.images-list .image-preview[data-v-21d8b78b]:nth-child(3n+0){margin-right:0}.images-list .image-preview .image[data-v-21d8b78b]{display:block;width:%?220?%;height:%?220?%}.goods-props[data-v-21d8b78b]{font-size:%?24?%;color:#999}.goods-props .goods-props-item[data-v-21d8b78b]{float:left}.goods-props .goods-props-item .group-name[data-v-21d8b78b]{margin-right:%?6?%}',""]),t.exports=e},"4c10":function(t,e,n){var i=n("52a0");"string"===typeof i&&(i=[[t.i,i,""]]),i.locals&&(t.exports=i.locals);var a=n("4f06").default;a("6b082238",i,!0,{sourceMap:!1,shadowMode:!1})},"52a0":function(t,e,n){var i=n("24fb");e=i(!1),e.push([t.i,'@charset "UTF-8";\r\n/**\r\n * 这里是uni-app内置的常用样式变量\r\n *\r\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\r\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\r\n *\r\n */\r\n/**\r\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\r\n *\r\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\r\n */\r\n/* 颜色变量 */\r\n/* 行为相关颜色 */\r\n/* 文字基本颜色 */\r\n/* 背景颜色 */\r\n/* 边框颜色 */\r\n/* 尺寸变量 */\r\n/* 文字尺寸 */\r\n/* 图片尺寸 */\r\n/* Border Radius */\r\n/* 水平间距 */\r\n/* 垂直间距 */\r\n/* 透明度 */\r\n/* 文章场景相关 */\r\n/* 引入uView全局scss变量文件 */.u-rate[data-v-0bf62930]{display:-webkit-inline-flex;display:inline-flex;align-items:center;margin:0;padding:0}.u-icon[data-v-0bf62930]{box-sizing:border-box}',""]),t.exports=e},"7b88":function(t,e,n){var i=n("be7d");"string"===typeof i&&(i=[[t.i,i,""]]),i.locals&&(t.exports=i.locals);var a=n("4f06").default;a("482f864e",i,!0,{sourceMap:!1,shadowMode:!1})},8617:function(t,e,n){"use strict";var i=n("dbce"),a=n("4ea4");n("d81d"),n("d3b7"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=a(n("cf12")),s=a(n("88b5")),o=a(n("4094")),c=n("c824"),u=i(n("32ac")),l=15,d=[{name:"全部",scoreType:-1},{name:"好评",scoreType:10},{name:"中评",scoreType:20},{name:"差评",scoreType:30}],f={components:{MescrollBody:r.default,AvatarImage:o.default},mixins:[s.default],data:function(){return{goodsId:null,curTab:0,list:(0,c.getEmptyPaginateObj)(),total:{all:0,negative:0,praise:0,review:0},rates:{10:5,20:3,30:1},tabs:d,upOption:{auto:!0,page:{size:l},noMoreSize:4,empty:{tip:"亲,暂无相关商品评价"}}}},onLoad:function(t){this.goodsId=t.goodsId,this.getTotal()},methods:{upCallback:function(t){var e=this;e.getCommentList(t.num).then((function(t){var n=t.data.length,i=t.data.total;e.mescroll.endBySize(n,i)})).catch((function(){return e.mescroll.endErr()}))},getCommentList:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=this;return new Promise((function(n,i){u.list(e.goodsId,{scoreType:e.getScoreType(),page:t},{load:!1}).then((function(i){var a=i.data.list;e.list.data=(0,c.getMoreListData)(a,e.list,t),n(a)}))}))},getScoreType:function(){return this.tabs[this.curTab].scoreType},getTotal:function(){var t=this;u.total(t.goodsId).then((function(e){var n=e.data.total;t.getTabs(n)}))},getTabs:function(t){var e=this.tabs;e[0].name="全部(".concat(t.all,")"),e[1].name="好评(".concat(t.praise,")"),e[2].name="中评(".concat(t.review,")"),e[3].name="差评(".concat(t.negative,")")},onChangeTab:function(t){var e=this;e.curTab=t,e.onRefreshList()},onRefreshList:function(){var t=this;this.list=(0,c.getEmptyPaginateObj)(),setTimeout((function(){t.mescroll.resetUpScroll()}),120)},onPreviewImages:function(t,e){var n=this,i=n.list.data[t].images,a=i.map((function(t){return t.image_url}));uni.previewImage({current:a[e],urls:a})}}};e.default=f},"8b4f":function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return r})),n.d(e,"a",(function(){return i}));var i={uIcon:n("f9d0").default},a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("v-uni-view",{staticClass:"u-rate",attrs:{id:t.elId},on:{touchmove:function(e){e.stopPropagation(),e.preventDefault(),arguments[0]=e=t.$handleEvent(e),t.touchMove.apply(void 0,arguments)}}},t._l(t.count,(function(e,i){return n("v-uni-view",{key:i,staticClass:"u-star-wrap",class:[t.elClass]},[n("u-icon",{attrs:{name:t.activeIndex>i?t.elActiveIcon:t.inactiveIcon,color:t.activeIndex>i?t.elActiveColor:t.inactiveColor,"custom-style":{fontSize:t.size+"rpx",padding:"0 "+t.gutter/2+"rpx"},"custom-prefix":t.customPrefix,"show-decimal-icon":t.showDecimalIcon(i),percent:t.decimal,"inactive-color":t.inactiveColor},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.click(i+1,e)}}})],1)})),1)},r=[]},"8ee1":function(t,e,n){"use strict";var i=n("4c10"),a=n.n(i);a.a},a3b1:function(t,e,n){"use strict";var i=n("7b88"),a=n.n(i);a.a},a84d:function(t,e,n){"use strict";n.r(e);var i=n("0dc5"),a=n.n(i);for(var r in i)"default"!==r&&function(t){n.d(e,t,(function(){return i[t]}))}(r);e["default"]=a.a},bc16:function(t,e,n){"use strict";n.r(e);var i=n("8b4f"),a=n("a84d");for(var r in a)"default"!==r&&function(t){n.d(e,t,(function(){return a[t]}))}(r);n("8ee1");var s,o=n("f0c5"),c=Object(o["a"])(a["default"],i["b"],i["c"],!1,null,"0bf62930",null,!1,i["a"],s);e["default"]=c.exports},be7d:function(t,e,n){var i=n("24fb");e=i(!1),e.push([t.i,'@charset "UTF-8";\r\n/**\r\n * 这里是uni-app内置的常用样式变量\r\n *\r\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\r\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\r\n *\r\n */\r\n/**\r\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\r\n *\r\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\r\n */\r\n/* 颜色变量 */\r\n/* 行为相关颜色 */\r\n/* 文字基本颜色 */\r\n/* 背景颜色 */\r\n/* 边框颜色 */\r\n/* 尺寸变量 */\r\n/* 文字尺寸 */\r\n/* 图片尺寸 */\r\n/* Border Radius */\r\n/* 水平间距 */\r\n/* 垂直间距 */\r\n/* 透明度 */\r\n/* 文章场景相关 */\r\n/* 引入uView全局scss变量文件 */.avatar-image .image[data-v-33483a45]{display:block;width:%?60?%;height:%?60?%;border-radius:50%;border-style:solid}',""]),t.exports=e},c1b3:function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return r})),n.d(e,"a",(function(){return i}));var i={uTabs:n("30e0").default,uRate:n("bc16").default},a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("mescroll-body",{ref:"mescrollRef",attrs:{sticky:!0,down:{use:!1},up:t.upOption},on:{init:function(e){arguments[0]=e=t.$handleEvent(e),t.mescrollInit.apply(void 0,arguments)},up:function(e){arguments[0]=e=t.$handleEvent(e),t.upCallback.apply(void 0,arguments)}}},[n("u-tabs",{attrs:{list:t.tabs,"is-scroll":!1,current:t.curTab,"active-color":"#FA2209",duration:.2},on:{change:function(e){arguments[0]=e=t.$handleEvent(e),t.onChangeTab.apply(void 0,arguments)}}}),n("v-uni-view",{staticClass:"comment-list"},t._l(t.list.data,(function(e,i){return n("v-uni-view",{key:i,staticClass:"comment-item"},[n("v-uni-view",{staticClass:"item-head"},[n("v-uni-view",{staticClass:"user-info"},[n("avatar-image",{staticClass:"user-avatar",attrs:{url:e.user.avatar_url,width:50}}),n("v-uni-text",{staticClass:"user-name f-26"},[t._v(t._s(e.user.nick_name))])],1),n("u-rate",{attrs:{"active-color":"#f4a213",current:t.rates[e.score],disabled:!0}}),n("v-uni-view",{staticClass:"flex-box f-22 col-9 t-r"},[t._v(t._s(e.create_time))])],1),n("v-uni-view",{staticClass:"item-content m-top20"},[n("v-uni-text",{staticClass:"f-26"},[t._v(t._s(e.content))])],1),e.images.length?n("v-uni-view",{staticClass:"images-list clearfix"},t._l(e.images,(function(e,a){return n("v-uni-view",{key:a,staticClass:"image-preview"},[n("v-uni-image",{staticClass:"image",attrs:{mode:"aspectFill",src:e.image_url},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.onPreviewImages(i,a)}}})],1)})),1):t._e(),n("v-uni-view",{staticClass:"goods-props clearfix"},t._l(e.orderGoods.goods_props,(function(e,i){return n("v-uni-view",{key:i,staticClass:"goods-props-item"},[n("v-uni-text",{staticClass:"group-name"},[t._v(t._s(e.group.name)+":")]),n("v-uni-text",[t._v(t._s(e.value.name)+";")])],1)})),1)],1)})),1)],1)},r=[]},f908:function(t,e,n){"use strict";n.r(e);var i=n("c1b3"),a=n("1abb");for(var r in a)"default"!==r&&function(t){n.d(e,t,(function(){return a[t]}))}(r);n("0fd8");var s,o=n("f0c5"),c=Object(o["a"])(a["default"],i["b"],i["c"],!1,null,"21d8b78b",null,!1,i["a"],s);e["default"]=c.exports},fcb6:function(t,e,n){"use strict";n.r(e);var i=n("0a2d"),a=n.n(i);for(var r in i)"default"!==r&&function(t){n.d(e,t,(function(){return i[t]}))}(r);e["default"]=a.a}}]);
|