Authored by 陈峰

Merge branch 'master' of http://git.yoho.cn/fe/yoho-community-web

1 <template> 1 <template>
2 - <div></div> 2 + <div class="comment-item">
  3 + <ImageFormat :src="parentComment.headIco" :width="80" :height="80" class="comment-user-avatar"></ImageFormat>
  4 + <div class="comment">
  5 + <div class="comment-nav">
  6 + <div class="comment-nav-left">
  7 + <p class="comment-user-name">{{parentComment.userName}}</p>
  8 + <p class="comment-time">{{parentComment.createTime}}</p>
  9 + </div>
  10 + <WidgetFav :num="parentComment.praiseTotal"></WidgetFav>
  11 + </div>
  12 +
  13 + <p class="comment-cont" @click="replyComment" :data-parent-id="parentComment.parentId" :data-root-id="parentComment.rootId">
  14 + {{parentComment.content}}
  15 + </p>
  16 + <div class="reply-main">
  17 + <p class="reply-item" v-for="(reply, replyIndex) in childrenComments" :key="replyIndex" v-show="isShowReply(replyIndex)">
  18 + <span class="reply-user">
  19 + {{reply.userName}}
  20 + </span>
  21 + <span v-if="reply.parentUserName">
  22 + 回复<em class="reply-to-user">@{{reply.parentUserName}}</em>
  23 + </span>:
  24 + <span @click="replyComment" :data-parent-id="reply.parentId" :data-root-id="reply.rootId">
  25 + {{reply.content}}
  26 + </span>
  27 + </p>
  28 + <p class="reply-more" v-if="isShowReplyMore" @click="viewMoreReply" v-html="replyMoreText"></p>
  29 + </div>
  30 + </div>
  31 + </div>
3 </template> 32 </template>
4 33
5 <script> 34 <script>
6 export default { 35 export default {
7 - name: 'CommentList' 36 + name: 'CommentList',
  37 + props: {
  38 + parentComment: Object,
  39 + childrenComments: Array,
  40 + columnType: {
  41 + type: Number,
  42 + default: 1001
  43 + }
  44 + },
  45 + data() {
  46 + return {
  47 + showAllReply: false,
  48 + replyMoreText: '',
  49 + moreText: ''
  50 + };
  51 + },
  52 + computed: {
  53 + isShowReplyMore() {
  54 + return this.childrenComments.length > 2;
  55 + },
  56 + viewReplyNum() {
  57 + return this.childrenComments.length - 2;
  58 + }
  59 + },
  60 + created() {
  61 + this.moreText = `查看${this.viewReplyNum}条回复<span class="iconfont icon-right"></span>`;
  62 + this.replyMoreText = this.moreText;
  63 + },
  64 + methods: {
  65 + isShowReply(index) {
  66 + return index <= 1 || this.showAllReply;
  67 + },
  68 + viewMoreReply() {
  69 + this.replyMoreText = this.showAllReply ? this.moreText : '收起';
  70 + this.showAllReply = !this.showAllReply;
  71 + },
  72 + replyComment(e) {
  73 + console.log(e)
  74 + }
  75 + }
8 }; 76 };
9 </script> 77 </script>
  78 +
  79 +<style scoped lang="scss">
  80 +.comment-item {
  81 + display: flex;
  82 + margin-bottom: 20px;
  83 +
  84 + &:last-child {
  85 + margin-bottom: 0;
  86 + }
  87 +
  88 + .comment-user-avatar {
  89 + width: 80px;
  90 + height: 80px;
  91 + border-radius: 50%;
  92 + }
  93 +
  94 + .comment {
  95 + width: 600px;
  96 + margin-left: 10px;
  97 + }
  98 +
  99 + .comment-nav {
  100 + padding-left: 10px;
  101 + box-sizing: border-box;
  102 + display: flex;
  103 + justify-content: space-between;
  104 + }
  105 +
  106 + .comment-nav-left {
  107 + flex: 1;
  108 +
  109 + .comment-user-name {
  110 + font-size: 28px;
  111 + font-weight: bold;
  112 + color: #222;
  113 + line-height: 40px;
  114 + }
  115 +
  116 + .comment-time {
  117 + font-size: 20px;
  118 + color: #B0B0B0;
  119 + line-height: 28px;
  120 + }
  121 + }
  122 +
  123 + .comment-cont {
  124 + font-size: 28px;
  125 + color: #444;
  126 + line-height: 40px;
  127 + margin: 12px 0 20px;
  128 + padding-left: 10px;
  129 + box-sizing: border-box;
  130 + }
  131 +
  132 + .reply-main {
  133 + background: #F0F0F0;
  134 + padding: 20px;
  135 + box-sizing: border-box;
  136 + font-size: 24px;
  137 + color: #444;
  138 + line-height: 34px;
  139 +
  140 + .reply-item {
  141 + margin-bottom: 20px;
  142 + display: flex;
  143 +
  144 + &:last-child {
  145 + margin-bottom: 0;
  146 + }
  147 +
  148 + .reply-to-user {
  149 + color: #4A90E2;
  150 + font-style: normal;
  151 + }
  152 +
  153 + .reply-user {
  154 + font-weight: 500;
  155 + }
  156 + }
  157 +
  158 + .reply-more {
  159 + text-align: right;
  160 + color: #4A90E2;
  161 + margin-top: 10px;
  162 + }
  163 + }
  164 +}
  165 +</style>
  166 +
@@ -24,7 +24,7 @@ export default { @@ -24,7 +24,7 @@ export default {
24 }; 24 };
25 </script> 25 </script>
26 26
27 -<style type="css"> 27 +<style type="scss" scoped>
28 .product-list-wrap { 28 .product-list-wrap {
29 display: flex; 29 display: flex;
30 justify-content: center; 30 justify-content: center;
@@ -45,7 +45,7 @@ @@ -45,7 +45,7 @@
45 type: String, 45 type: String,
46 default: 'fav' 46 default: 'fav'
47 }, 47 },
48 - text: String, 48 + text: [String, Number],
49 option: { 49 option: {
50 type: Object, 50 type: Object,
51 default() { 51 default() {
@@ -88,12 +88,16 @@ @@ -88,12 +88,16 @@
88 textStyle() { 88 textStyle() {
89 let style = `font-size: ${pxToRem(this.option.textFontSize || defaultOption.textFontSize)};`; 89 let style = `font-size: ${pxToRem(this.option.textFontSize || defaultOption.textFontSize)};`;
90 90
91 - if (['top', 'bottom'].indexOf(this.option.textAlign) >= 0) {  
92 - style += ` vertical-align: ${this.option.textAlign};`; 91 + let textAlign = this.option.textAlign || defaultOption.textAlign;
  92 +
  93 + if (['top', 'bottom'].indexOf(textAlign) >= 0) {
  94 + style += ` vertical-align: ${textAlign};`;
93 } 95 }
94 96
95 - if (Number(this.option.textZoom) !== NaN) {  
96 - style += `transform: scale(${this.option.textZoom}, ${this.option.textZoom});` 97 + let textZoom = this.option.textZoom || defaultOption.textAlign;
  98 +
  99 + if (Number(textZoom) !== NaN) {
  100 + style += `transform: scale(${textZoom}, ${textZoom});`
97 } 101 }
98 102
99 return style; 103 return style;
  1 +<template>
  2 + <Layout>
  3 + <LayoutHeader slot="header" title="潮物详情" :share="shareData"></LayoutHeader>
  4 + <div class="fashion-detail-page">
  5 + <div class="product-info">
  6 + <img src="//img12.static.yhbimg.com/goodsimg/2018/12/24/09/02ce4a371bd58b47e599f8e04c7c7bc250.jpg?imageMogr2/thumbnail/235x314/position/center/quality/60" alt="" class="product-img">
  7 + <div class="product-info-right">
  8 + <div class="product-title">Lee X-LINE系列男士宽松插画印花背带裤</div>
  9 + <div class="product-desc">一年到头,我们总喜欢给过去来个总结。要说今年最火的穿搭元素,我想离不开两个字——“老爹”。满大街的老爹鞋,从去年踩到今年,足以证明这股复古风潮的影响力。</div>
  10 + <div class="product-price">
  11 + <span class="sale-price">¥899</span>
  12 + <span class="market-price">¥1899</span>
  13 + </div>
  14 + </div>
  15 + </div>
  16 +
  17 + <div class="follow">
  18 + <WidgetAvatarGroup :avatars="avatars" :option="{srcKey: 'src', maxDisplayNum: 10}"></WidgetAvatarGroup>
  19 + <span class="follow-num">3998人已种草</span>
  20 + </div>
  21 +
  22 + <div class="hot-comment out-box">
  23 + <div class="comment-title"></div>
  24 + <div class="comment-list">
  25 + <CommentList v-for="(comment, index) in commentInfos" v-bind="comment" :columnType="1003" :key="index"></CommentList>
  26 + </div>
  27 + <span class="more">查看更多</span>
  28 + </div>
  29 +
  30 + <div class="you-like out-box">
  31 + <div class="yoho-like-title"></div>
  32 + <ProductList></ProductList>
  33 + </div>
  34 +
  35 + <div class="fashion-footer">
  36 + <div class="grass-btn"><span class="iconfont icon-grass-fill"></span><em>种草</em></div>
  37 + <div class="comment-btn"><span class="iconfont icon-msg-blod"></span><em>评论</em></div>
  38 + <button class="go-buy">立即购买</button>
  39 + </div>
  40 + </div>
  41 + </Layout>
  42 +</template>
  43 +
  44 +<script>
  45 +export default {
  46 + name: 'fashionDetail',
  47 + data() {
  48 + return {
  49 + shareData: {},
  50 + avatars: [{src: '//img10.static.yhbimg.com/author/2018/11/26/15/01fbe6e21e3b9120685834e1f6173e31c5.jpg?imageView2/2/interlace/1/q/75'},
  51 + {src: '//img10.static.yhbimg.com/author/2018/11/26/15/01fbe6e21e3b9120685834e1f6173e31c5.jpg?imageView2/2/interlace/1/q/75'},
  52 + {src: '//img10.static.yhbimg.com/author/2018/11/26/15/01fbe6e21e3b9120685834e1f6173e31c5.jpg?imageView2/2/interlace/1/q/75'},
  53 + {src: '//img10.static.yhbimg.com/author/2018/11/26/15/01fbe6e21e3b9120685834e1f6173e31c5.jpg?imageView2/2/interlace/1/q/75'},
  54 + {src: '//img10.static.yhbimg.com/author/2018/11/26/15/01fbe6e21e3b9120685834e1f6173e31c5.jpg?imageView2/2/interlace/1/q/75'},
  55 + {src: '//img10.static.yhbimg.com/author/2018/11/26/15/01fbe6e21e3b9120685834e1f6173e31c5.jpg?imageView2/2/interlace/1/q/75'},
  56 + {src: '//img10.static.yhbimg.com/author/2018/11/26/15/01fbe6e21e3b9120685834e1f6173e31c5.jpg?imageView2/2/interlace/1/q/75'},
  57 + {src: '//img10.static.yhbimg.com/author/2018/11/26/15/01fbe6e21e3b9120685834e1f6173e31c5.jpg?imageView2/2/interlace/1/q/75'},
  58 + {src: '//img10.static.yhbimg.com/author/2018/11/26/15/01fbe6e21e3b9120685834e1f6173e31c5.jpg?imageView2/2/interlace/1/q/75'},
  59 + {src: '//img10.static.yhbimg.com/author/2018/11/26/15/01fbe6e21e3b9120685834e1f6173e31c5.jpg?imageView2/2/interlace/1/q/75'}
  60 + ],
  61 + commentInfos: [{
  62 + childrenComments: [
  63 + {
  64 + content: "fdsfdsfsdf对方水电费第三方",
  65 + id: 68,
  66 + isPraise: "Y",
  67 + parentId: 66,
  68 + parentUid: 500030381,
  69 + praiseTotal: "12",
  70 + rootId: 66,
  71 + status: 1,
  72 + uid: 600033622,
  73 + columnType: 1000,
  74 + destId: 600033622,
  75 + createTime: 111,
  76 + userName: "三只松鼠",
  77 + headIco: "//img10.static.yhbimg.com/author/2018/11/26/15/01fbe6e21e3b9120685834e1f6173e31c5.jpg?imageView2/2/interlace/1/q/75",
  78 + parentUserName: "",
  79 + articleType: 1
  80 + },
  81 + {
  82 + content: "fdsfdsfsdf对方水电费第三方",
  83 + id: 68,
  84 + isPraise: "Y",
  85 + parentId: 66,
  86 + parentUid: 500030381,
  87 + praiseTotal: "12",
  88 + rootId: 66,
  89 + status: 1,
  90 + uid: 600033622,
  91 + columnType: 1000,
  92 + destId: 600033622,
  93 + createTime: 111,
  94 + userName: "三只松鼠",
  95 + headIco: "//img10.static.yhbimg.com/author/2018/11/26/15/01fbe6e21e3b9120685834e1f6173e31c5.jpg?imageView2/2/interlace/1/q/75",
  96 + parentUserName: "大松鼠",
  97 + articleType: 1
  98 + },
  99 + {
  100 + content: "fdsfdsfsdf对方水电费第三方",
  101 + id: 68,
  102 + isPraise: "Y",
  103 + parentId: 66,
  104 + parentUid: 500030381,
  105 + praiseTotal: "12",
  106 + rootId: 66,
  107 + status: 1,
  108 + uid: 600033622,
  109 + columnType: 1000,
  110 + destId: 600033622,
  111 + createTime: 111,
  112 + userName: "三只松鼠",
  113 + headIco: "//img10.static.yhbimg.com/author/2018/11/26/15/01fbe6e21e3b9120685834e1f6173e31c5.jpg?imageView2/2/interlace/1/q/75",
  114 + parentUserName: "大松鼠",
  115 + articleType: 1
  116 + }
  117 + ],
  118 + parentComment: {
  119 + articleType: 1,
  120 + content: "fsefs第三方",
  121 + createTime: 23213,
  122 + id: 66,
  123 + isPraise: "Y",
  124 + praiseTotal: "11",
  125 + status: 0,
  126 + uid: 500030381,
  127 + columnType: 1000,
  128 + destId: 600033622,
  129 + articleId: 123,
  130 + userName: "大松鼠",
  131 + headIco: '//img13.static.yhbimg.com/author/2018/12/10/10/02143c5a70e288801cda4ac4f3fa8b9d7b.jpg?imageView2/2/interlace/1/q/75',
  132 + }
  133 + }],
  134 + }
  135 + }
  136 +}
  137 +</script>
  138 +
  139 +<style scoped lang="scss">
  140 +.fashion-detail-page {
  141 + .product-info {
  142 + display: flex;
  143 + padding: 30px;
  144 + box-sizing: border-box;
  145 +
  146 + .product-img {
  147 + width: 320px;
  148 + height: 424px;
  149 + }
  150 +
  151 + .product-info-right {
  152 + width: 350px;
  153 + margin-left: 20px;
  154 + }
  155 +
  156 + .product-title {
  157 + font-size: 30px;
  158 + color: #222;
  159 + line-height: 44px;
  160 + font-weight: bold;
  161 + }
  162 +
  163 + .product-desc {
  164 + font-size: 26px;
  165 + color: #B0B0B0;
  166 + line-height: 36px;
  167 + margin-top: 18px;
  168 + height: 174px;
  169 + overflow: hidden;
  170 + word-break: break-all;
  171 + text-overflow: ellipsis;
  172 + display: -webkit-box;
  173 + -webkit-box-orient: vertical;
  174 + -webkit-line-clamp: 5;
  175 + }
  176 +
  177 + .product-price {
  178 + display: flex;
  179 + align-items: center;
  180 + margin-top: 84px;
  181 + }
  182 +
  183 + .sale-price {
  184 + color: #D0021B;
  185 + font-size: 28px;
  186 + }
  187 +
  188 + .market-price {
  189 + color: #B0B0B0;
  190 + font-size: 20px;
  191 + margin-left: 12px;
  192 + }
  193 + }
  194 +
  195 + .follow {
  196 + margin-bottom: 30px;
  197 + padding: 0 30px;
  198 + clear: both;
  199 + box-sizing: border-box;
  200 + display: flex;
  201 + align-items: center;
  202 + justify-content: space-between;
  203 + }
  204 +
  205 + .out-box {
  206 + border-top: 20px solid #F0F0F0;
  207 + padding: 30px;
  208 + }
  209 +
  210 + .hot-comment {
  211 + display: flex;
  212 + width: 100%;
  213 + flex-direction: column;
  214 +
  215 + .comment-title {
  216 + background: url(../../statics/image/fashion/jcrp_title@2x.png) no-repeat;
  217 + background-size: contain;
  218 + width: 310px;
  219 + height: 78px;
  220 + margin: 0 auto 60px;
  221 + }
  222 +
  223 + .more {
  224 + font-size: 24px;
  225 + color: #B0B0B0;
  226 + margin: 60px auto 30px;
  227 + display: flex;
  228 + align-items: center;
  229 +
  230 + &:before{
  231 + content: "";
  232 + background: #B0B0B0;
  233 + width: 40px;
  234 + height: 2px;
  235 + margin-right: 20px;
  236 + display: inline-block;
  237 + }
  238 +
  239 + &:after{
  240 + content: "";
  241 + background: #B0B0B0;
  242 + width: 40px;
  243 + height: 2px;
  244 + margin-left: 20px;
  245 + display: inline-block;
  246 + }
  247 + }
  248 + }
  249 +
  250 + .yoho-like-title {
  251 + background: url(../../statics/image/fashion/cnxh_title@2x.png) no-repeat;
  252 + background-size: contain;
  253 + width: 250px;
  254 + height: 78px;
  255 + margin: 0 auto;
  256 + }
  257 +
  258 + .fashion-footer {
  259 + height: 120px;
  260 + width: 100%;
  261 + background: #fff ;
  262 + border-top: 1px solid #D8D8D8 ;
  263 + position: fixed;
  264 + bottom: 0;
  265 + display: flex;
  266 + justify-content: space-around;
  267 + align-items: center;
  268 + box-sizing: border-box;
  269 +
  270 + .go-buy {
  271 + background: #D0021B;
  272 + color: #fff;
  273 + text-align: center;
  274 + width: 260px;
  275 + height: 88px;
  276 + border: none;
  277 + outline: none;
  278 + border-radius: 6px;
  279 + margin: 0 30px;
  280 + }
  281 +
  282 + .comment-btn,
  283 + .grass-btn {
  284 + flex: 1;
  285 + display: flex;
  286 + flex-direction: column;
  287 + text-align: center;
  288 + font-size: 18px;
  289 + color: #444;
  290 +
  291 + span {
  292 + font-size: 52px;
  293 + }
  294 +
  295 + em {
  296 + font-style: normal;
  297 + margin-top: -6px;
  298 + }
  299 + }
  300 +
  301 + .comment-btn {
  302 + span {
  303 + color: #b0b0b0;
  304 + }
  305 + }
  306 + }
  307 +}
  308 +</style>
1 export default [{ 1 export default [{
2 - path: '/xxx',  
3 - name: 'xxx', 2 + path: '/fashion/detail',
  3 + name: 'fashionDetail',
4 4
5 - // component: () => import(/* webpackChunkName: "xxx" */ './xxx') 5 + component: () => import(/* webpackChunkName: "fashionDetail" */ './fashion-detail')
6 }]; 6 }];
  1 +<template>
  2 + <div class="article">
  3 + <ArticleBar class="header"></ArticleBar>
  4 + <ArticleBody class="body"></ArticleBody>
  5 + <ArticleFooter class="footer"></ArticleFooter>
  6 + </div>
  7 +</template>
  8 +
  9 +<script>
  10 +
  11 +import ArticleBar from './components2/article-bar';
  12 +import ArticleFooter from './components2/article-footer';
  13 +import ArticleBody from './components2/article-body';
  14 +
  15 +export default {
  16 + name: 'ArticleDetail',
  17 + components: {
  18 + ArticleBar,
  19 + ArticleBody,
  20 + ArticleFooter
  21 + },
  22 + data() {
  23 + return {};
  24 + }
  25 +};
  26 +</script>
  27 +
  28 +<style lang="scss" scoped>
  29 +
  30 +.article {
  31 + width: 100%;
  32 + height: 100vh;
  33 + display: flex;
  34 + flex-direction: column;
  35 +
  36 + .header {
  37 + // pass
  38 + }
  39 +
  40 + .body {
  41 + flex: 1;
  42 + }
  43 +
  44 + .footer {
  45 + // pass
  46 + }
  47 +}
  48 +</style>
@@ -29,8 +29,8 @@ export default { @@ -29,8 +29,8 @@ export default {
29 }, 29 },
30 methods: { 30 methods: {
31 close() { 31 close() {
32 - console.log('close');  
33 this.$emit('close'); 32 this.$emit('close');
  33 + this.$yoho.finishPage({});
34 } 34 }
35 } 35 }
36 }; 36 };
  1 +<template>
  2 + <YohoActionSheet ref="actionSheet" :full="true">
  3 + <div class="content">
  4 + <!--<template v-if="list.length === 0">-->
  5 + <!--<Loading class="loading" :size="50"></Loading>-->
  6 + <!--</template>-->
  7 +
  8 + <CommentScrollView ref="commentList"></CommentScrollView>
  9 + </div>
  10 + </YohoActionSheet>
  11 +</template>
  12 +
  13 +
  14 +<script>
  15 +import {Loading} from 'cube-ui';
  16 +import CommentScrollView from './comment-scroll-view';
  17 +
  18 +export default {
  19 + name: 'CommentActionSheetPage',
  20 + components: {
  21 + Loading,
  22 + CommentScrollView
  23 + },
  24 + data() {
  25 + return {
  26 + };
  27 + },
  28 + methods: {
  29 + click() {
  30 + this.$refs.actionSheet.show();
  31 + this.$refs.commentList.click();
  32 + }
  33 + }
  34 +};
  35 +</script>
  36 +
  37 +<style>
  38 + .content {
  39 + width: 100%;
  40 + height: 80vh;
  41 + background-color: white;
  42 + }
  43 +
  44 + .loading {
  45 + position: absolute;
  46 + left: 50%;
  47 + top: 50%;
  48 + transform: translate(-50%, -50%);
  49 + }
  50 +
  51 +</style>
  1 +<template>
  2 + <div class="comment-scroll-view">
  3 + <div class="header">{{ count }}评论
  4 + </div>
  5 + <Scroll class="scroll-wrapper" ref="scroll" :options="scrollOptions">
  6 + <div v-for="i in list" class="item">huangtao {{i}}</div>
  7 + </Scroll>
  8 + <div class="footer">
  9 + <div class="input">评论</div>
  10 + </div>
  11 + </div>
  12 +</template>
  13 +
  14 +<script>
  15 +
  16 +import {Scroll} from 'cube-ui';
  17 +
  18 +export default {
  19 + name: 'CommentScrollView',
  20 + components: {
  21 + Scroll
  22 + },
  23 + data() {
  24 + return {
  25 + list: [],
  26 + scrollOptions: {
  27 + bounce: false
  28 + }
  29 + };
  30 + },
  31 + computed: {
  32 + count() {
  33 + return this.list.length > 0 ? this.list.length + '条' : '';
  34 + }
  35 + },
  36 + methods: {
  37 + click() {
  38 + this.$nextTick(() => {
  39 + this.initData();
  40 + this.forceUpdate();
  41 + }, 1000);
  42 + },
  43 + forceUpdate() {
  44 + this.$refs.scroll.forceUpdate();
  45 + },
  46 + initData() {
  47 + console.log('click')
  48 + for (let i = 0; i < 100; i++) {
  49 + this.list.push(i);
  50 + }
  51 + }
  52 + }
  53 +};
  54 +
  55 +</script>
  56 +
  57 +<style lang="scss" scoped>
  58 +
  59 +.comment-scroll-view {
  60 + display: flex;
  61 + flex-direction: column;
  62 + width: 100%;
  63 + height: 100%;
  64 +}
  65 +
  66 +.header {
  67 + width: 100%;
  68 + height: 88px;
  69 + border-bottom: 2px solid #e0e0e0;
  70 + text-align: center;
  71 + line-height: 88px;
  72 + font-size: 32px;
  73 +}
  74 +
  75 +.scroll-wrapper {
  76 + flex: 1;
  77 +}
  78 +
  79 +.item {
  80 + background-color: white;
  81 +}
  82 +
  83 +.footer {
  84 + width: 100%;
  85 + height: 100px;
  86 + border-top: 2px solid #e0e0e0;
  87 + display: flex;
  88 + justify-content: center;
  89 + align-items: center;
  90 +}
  91 +
  92 +.input {
  93 + width: 690px;
  94 + height: 72px;
  95 + background-color: #f0f0f0;
  96 + border: 1px solid #e0e0e0;
  97 + border-radius: 8px;
  98 + font-size: 24px;
  99 + color: #b0b0b0;
  100 + padding: 18px 0 18px 22px;
  101 +}
  102 +</style>
@@ -10,8 +10,9 @@ @@ -10,8 +10,9 @@
10 <Products></Products> 10 <Products></Products>
11 </div> 11 </div>
12 <div class="share"> 12 <div class="share">
13 - <WidgetIconBtn type="msg"></WidgetIconBtn>  
14 - <WidgetIconBtn type="zan"></WidgetIconBtn> 13 + <WidgetIconBtn class="item" type="msg" text="100" :option="option" @click="onCommentClick"></WidgetIconBtn>
  14 + <WidgetIconBtn class="item" type="fav" text="100" :option="option" @click="onFavClick"></WidgetIconBtn>
  15 + <WidgetIconBtn class="item" type="fav" text="100" :option="option" @click="onFavClick"></WidgetIconBtn>
15 </div> 16 </div>
16 </div> 17 </div>
17 </div> 18 </div>
@@ -29,13 +30,23 @@ export default { @@ -29,13 +30,23 @@ export default {
29 data() { 30 data() {
30 return { 31 return {
31 text: '很好,能抢到真的不容易!整体感觉很舒服,庆幸下手一定要快准狠!如果能够再抢到一双就更好了,下次加买很多双,很好,能抢到真的不容易!整体感觉很舒服,庆幸下手一定要快准狠!如果能够再抢到一双就更好了,下次加买很多双', 32 text: '很好,能抢到真的不容易!整体感觉很舒服,庆幸下手一定要快准狠!如果能够再抢到一双就更好了,下次加买很多双,很好,能抢到真的不容易!整体感觉很舒服,庆幸下手一定要快准狠!如果能够再抢到一双就更好了,下次加买很多双',
32 - isLimitHeight: true 33 + isLimitHeight: true,
  34 + option: {
  35 + emitName: 'click',
  36 + color: 'white'
  37 + }
33 }; 38 };
34 }, 39 },
35 methods: { 40 methods: {
36 onClick() { 41 onClick() {
37 console.log('展开'); 42 console.log('展开');
38 this.isLimitHeight = false; 43 this.isLimitHeight = false;
  44 + },
  45 + onCommentClick() {
  46 + this.$emit('on-comment-click', {});
  47 + },
  48 + onFavClick() {
  49 + this.$emit('on-favorite-click', {});
39 } 50 }
40 }, 51 },
41 }; 52 };
@@ -58,6 +69,8 @@ export default { @@ -58,6 +69,8 @@ export default {
58 } 69 }
59 70
60 .product-wrapper { 71 .product-wrapper {
  72 + display: flex;
  73 + justify-content: space-between;
61 height: 166px; 74 height: 166px;
62 padding: 0 28px; 75 padding: 0 28px;
63 } 76 }
@@ -72,4 +85,13 @@ export default { @@ -72,4 +85,13 @@ export default {
72 .link { 85 .link {
73 color: #4a90e2; 86 color: #4a90e2;
74 } 87 }
  88 +
  89 +.share {
  90 + height: 100px;
  91 + margin-top: 86px;
  92 +}
  93 +
  94 +.item {
  95 + margin-left: 50px;
  96 +}
75 </style> 97 </style>
1 <template> 1 <template>
2 <div class="order-wrapper"> 2 <div class="order-wrapper">
3 - <!-- <Test class="test"></Test> -->  
4 <Slide :data="list" 3 <Slide :data="list"
5 :loop="false" 4 :loop="false"
6 :autoPlay="false" 5 :autoPlay="false"
@@ -24,7 +23,7 @@ @@ -24,7 +23,7 @@
24 23
25 <AvatarHeader class="avatar-wrapper"></AvatarHeader> 24 <AvatarHeader class="avatar-wrapper"></AvatarHeader>
26 25
27 - <DescFooter class="footer-wrapper"></DescFooter> 26 + <DescFooter class="footer-wrapper" @on-comment-click="onCommentClick"></DescFooter>
28 </div> 27 </div>
29 </template> 28 </template>
30 29
@@ -34,15 +33,13 @@ import {Slide} from 'cube-ui'; @@ -34,15 +33,13 @@ import {Slide} from 'cube-ui';
34 import AvatarHeader from './avatar-header'; 33 import AvatarHeader from './avatar-header';
35 import DescFooter from './desc-footer'; 34 import DescFooter from './desc-footer';
36 35
37 -// const img = require('statics/image/showorder/test.png')  
38 -  
39 export default { 36 export default {
40 name: 'ShowOrderItem', 37 name: 'ShowOrderItem',
41 components: { 38 components: {
42 AvatarHeader, 39 AvatarHeader,
43 DescFooter, 40 DescFooter,
44 Slide, 41 Slide,
45 - SlideItem: Slide.Item 42 + SlideItem: Slide.Item,
46 }, 43 },
47 data() { 44 data() {
48 return { 45 return {
@@ -70,6 +67,9 @@ export default { @@ -70,6 +67,9 @@ export default {
70 }, 67 },
71 slideChangeHandler(currentPageIndex) { 68 slideChangeHandler(currentPageIndex) {
72 this.currentPageIndex = currentPageIndex; 69 this.currentPageIndex = currentPageIndex;
  70 + },
  71 + onCommentClick() {
  72 + this.$emit('on-comment-click', {});
73 } 73 }
74 } 74 }
75 }; 75 };
  1 +<template>
  2 + <div class="bar-wrapper">
  3 + <div class="title">资讯详情</div>
  4 +
  5 + <div class="close" @click="close">
  6 + <i class="iconfont icon-close icon"></i>
  7 + </div>
  8 + </div>
  9 +</template>
  10 +
  11 +<script>
  12 +export default {
  13 + name: 'ArticleBar',
  14 + methods: {
  15 + close() {
  16 +
  17 + }
  18 + },
  19 +};
  20 +</script>
  21 +
  22 +<style lang="scss" scoped>
  23 +
  24 +.bar-wrapper {
  25 + width: 100%;
  26 + height: 88px;
  27 + position: relative;
  28 + background-color: white;
  29 + border-bottom: 1px solid #e0e0e0;
  30 +}
  31 +
  32 +.title {
  33 + font-size: 32px;
  34 + color: #444;
  35 + line-height: 88px;
  36 + text-align: center;
  37 +}
  38 +
  39 +.close {
  40 + color: #444;
  41 + position: absolute;
  42 + top: 20px;
  43 + right: 40px;
  44 +}
  45 +
  46 +.icon {
  47 + font-size: 50px;
  48 +}
  49 +
  50 +</style>
  1 +<template>
  2 + <Scroll class="scroll-wrapper" :options="scrollOpts">
  3 + <div v-for="i in 40">huangtao {{i}}</div>
  4 +
  5 + <Recommend>
  6 + <RecommendProductList></RecommendProductList>
  7 + </Recommend>
  8 + </Scroll>
  9 +</template>
  10 +
  11 +<script>
  12 +
  13 +import {Scroll} from 'cube-ui';
  14 +import RecommendProductList from './recommend-product-list';
  15 +import Recommend from './recommend'
  16 +
  17 +export default {
  18 + name: 'ArticleBody',
  19 + components: {
  20 + Scroll,
  21 + RecommendProductList,
  22 + Recommend
  23 + },
  24 + data() {
  25 + return {
  26 + scrollOpts: {
  27 + eventPassthrough: 'horizontal'
  28 + }
  29 + };
  30 + }
  31 +};
  32 +</script>
  33 +
  34 +<style lang="scss" scoped>
  35 +.scroll-wrapper {
  36 + background-color: white;
  37 +}
  38 +</style>
  1 +<template>
  2 + <div class="article-footer-wrapper">
  3 + <div class="tool-bar">
  4 + <WidgetIconBtn class="item" type="msg" text="100" :option="option" @click="onClick"></WidgetIconBtn>
  5 + <WidgetIconBtn class="item" type="fav" text="100" :option="option" @click="onClick"></WidgetIconBtn>
  6 + <WidgetIconBtn class="item" type="star" text="100" :option="option" @click="onClick"></WidgetIconBtn>
  7 + </div>
  8 + <div class="close ml20">收起</div>
  9 + </div>
  10 +</template>
  11 +
  12 +<script>
  13 +export default {
  14 + name: 'ArticleFooter',
  15 + data() {
  16 + return {
  17 + option: {
  18 + eventName: 'click'
  19 + }
  20 + };
  21 + },
  22 + methods: {
  23 + onClick() {
  24 +
  25 + }
  26 + },
  27 +};
  28 +</script>
  29 +
  30 +<style lang="scss" scoped>
  31 +
  32 +.article-footer-wrapper {
  33 + display: flex;
  34 + height: 100px;
  35 + border-top: 1px solid #e0e0e0;
  36 + background-color: white;
  37 +}
  38 +
  39 +.tool-bar {
  40 + flex: 1;
  41 + display: flex;
  42 + align-items: center;
  43 + justify-content: space-around;
  44 +}
  45 +
  46 +.close {
  47 + width: 200px;
  48 + color: white;
  49 + font-size: 32px;
  50 + line-height: 100px;
  51 + background-color: #d0021b;
  52 + text-align: center;
  53 +}
  54 +
  55 +.ml20 {
  56 + margin-left: 20px;
  57 +}
  58 +
  59 +</style>
  1 +<template>
  2 + <div class="product-item">
  3 + <div class="product-images-wrapper">
  4 + <img class="image" :src="imgUrl"/>
  5 + <div class="price">{{price}}</div>
  6 + </div>
  7 +
  8 + <div class="title line-clamp-2">{{title}}</div>
  9 + </div>
  10 +</template>
  11 +
  12 +<script>
  13 +export default {
  14 + name: 'RecommendProductItem',
  15 + props: {
  16 + price: {
  17 + type: String,
  18 + default() {
  19 + return '¥1111.0';
  20 + },
  21 + },
  22 + imgUrl: {
  23 + type: String,
  24 + default() {
  25 + return '//img12.static.yhbimg.com/goodsimg/2019/01/29/15/022a23864f68c66a6e1ef398ce7bd82efc.jpg?imageView2/2/w/640/h/640/q/60';
  26 + }
  27 + },
  28 + title: {
  29 + type: String,
  30 + default() {
  31 + return 'viishow 套头圆领撞拼条纹针织衫';
  32 + }
  33 + }
  34 + },
  35 + methods: {
  36 +
  37 + }
  38 +};
  39 +</script>
  40 +
  41 +<style lang="scss" scoped>
  42 +
  43 +.product-item {
  44 + display: inline-block;
  45 + width: 170px;
  46 +
  47 + .product-images-wrapper {
  48 + position: relative;
  49 + width: 170px;
  50 + height: 226px;
  51 + margin-bottom: 12px;
  52 +
  53 + .image {
  54 + width: 170px;
  55 + height: 226px;
  56 + }
  57 +
  58 + .price {
  59 + width: 100px;
  60 + height: 40px;
  61 + line-height: 40px;
  62 + position: absolute;
  63 + bottom: 10px;
  64 + margin-left: 82px;
  65 + color: white;
  66 + font-size: 20px;
  67 + background-image: linear-gradient(90deg, #474747 0%, #222 100%);
  68 + box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.3);
  69 + }
  70 + }
  71 +
  72 + .title {
  73 + width: 100%;
  74 + font-size: 20px;
  75 + color: #444;
  76 + word-break: break-all;
  77 + white-space: normal;
  78 + }
  79 +}
  80 +
  81 +</style>
  1 +<template>
  2 + <div class="product-list">
  3 + <RecommendProductItem class="item" v-for="i in 5"></RecommendProductItem>
  4 + </div>
  5 +</template>
  6 +
  7 +<script>
  8 +
  9 +import RecommendProductItem from './recommend-product-item'
  10 +
  11 +export default {
  12 + name: 'RecommendProductList',
  13 + components: {
  14 + RecommendProductItem
  15 + }
  16 +};
  17 +</script>
  18 +
  19 +<style lang="scss" scoped>
  20 +
  21 +.product-list {
  22 + width: 100%;
  23 + overflow: scroll;
  24 + white-space: nowrap;
  25 +}
  26 +
  27 +.item + .item {
  28 + margin-left: 22px;
  29 +}
  30 +
  31 +.item:first-child {
  32 + margin-left: 40px;
  33 +}
  34 +
  35 +.item:last-child {
  36 + margin-right: 40px;
  37 +}
  38 +</style>
  1 +<template>
  2 + <div>
  3 + <div class="title">推荐商品</div>
  4 + <slot></slot>
  5 + </div>
  6 +</template>
  7 +
  8 +<script>
  9 +export default {
  10 + name: 'Recommend'
  11 +};
  12 +</script>
  13 +
  14 +<style lang="scss" scoped>
  15 +.title {
  16 + font-size: 32px;
  17 + color: #222;
  18 + text-align: left;
  19 + margin-bottom: 30px;
  20 + font-weight: bold;
  21 + margin-left: 40px;
  22 +}
  23 +</style>
  1 +<template>
  2 + <div>
  3 +
  4 + </div>
  5 +</template>
  6 +
  7 +<script>
  8 + export default {
  9 + name: 'TextBody'
  10 + }
  11 +</script>
  12 +
  13 +<style scoped>
  14 +
  15 +</style>
1 1
2 -  
3 export default [{ 2 export default [{
4 - path: '/order/:id',  
5 - name: 'order', 3 + path: '/mapp/showorder/:id',
  4 + name: 'showorder',
6 5
7 - component: () => import(/* webpackChunkName: "order" */ './order') 6 + component: () => import(/* webpackChunkName: "order" */ './article-detail')
8 }]; 7 }];
@@ -13,9 +13,11 @@ @@ -13,9 +13,11 @@
13 :options="scrollOpts" 13 :options="scrollOpts"
14 > 14 >
15 <SlideItem v-for="i in list"> 15 <SlideItem v-for="i in list">
16 - <OrderSlideItem></OrderSlideItem> 16 + <OrderSlideItem @on-comment-click="onComment"></OrderSlideItem>
17 </SlideItem> 17 </SlideItem>
18 </Slide> 18 </Slide>
  19 +
  20 + <CommentActionSheet ref="actionsheet"></CommentActionSheet>
19 </Layout> 21 </Layout>
20 </template> 22 </template>
21 23
@@ -23,6 +25,7 @@ @@ -23,6 +25,7 @@
23 25
24 import {Slide} from 'cube-ui'; 26 import {Slide} from 'cube-ui';
25 import OrderSlideItem from './components/order-slide-item'; 27 import OrderSlideItem from './components/order-slide-item';
  28 +import CommentActionSheet from './components/comment-action-sheet';
26 29
27 export default { 30 export default {
28 name: 'ShowOrderPage', 31 name: 'ShowOrderPage',
@@ -30,6 +33,7 @@ export default { @@ -30,6 +33,7 @@ export default {
30 Slide, 33 Slide,
31 SlideItem: Slide.Item, 34 SlideItem: Slide.Item,
32 OrderSlideItem, 35 OrderSlideItem,
  36 + CommentActionSheet
33 }, 37 },
34 data() { 38 data() {
35 return { 39 return {
@@ -71,6 +75,10 @@ export default { @@ -71,6 +75,10 @@ export default {
71 }, 75 },
72 clickHandler(e) { 76 clickHandler(e) {
73 console.log(e); 77 console.log(e);
  78 + },
  79 + onComment() {
  80 + console.log('ok');
  81 + this.$refs.actionsheet.click();
74 } 82 }
75 } 83 }
76 }; 84 };
This diff could not be displayed because it is too large.