index.html 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. {include file="/shopro/common/script" /}
  2. <style>
  3. .comment-index .image {
  4. margin-right: 4px;
  5. }
  6. .comment-index .goods-item .goods-image {
  7. margin-right: 8px;
  8. }
  9. .comment-index .goods-item .goods-title {
  10. color: var(--el-color-primary);
  11. cursor: pointer;
  12. }
  13. </style>
  14. <div id="index" class="comment-index panel panel-default panel-intro" v-cloak>
  15. <el-container class="panel-block">
  16. <el-header class="sa-header">
  17. <div class="sa-title sa-flex sa-row-between">
  18. <div class="sa-title-left">
  19. <div class="left-name">评价管理</div>
  20. <sa-filter-condition v-model="state.filter" @filter-delete="onChangeFilter">
  21. </sa-filter-condition>
  22. </div>
  23. <div class="sa-title-right">
  24. <el-button class="sa-button-refresh" icon="RefreshRight" @click="getData"></el-button>
  25. <el-button class="sa-button-refresh" icon="Search" @click="onOpenFilter"></el-button>
  26. {if $auth->check('shopro/goods/comment/add')}
  27. <el-button plain @click="onAdd">添加虚拟评价</el-button>
  28. {/if}
  29. {if $auth->check('shopro/goods/comment/recyclebin')}
  30. <el-button type="danger" icon="Delete" plain @click="onRecyclebin">回收站</el-button>
  31. {/if}
  32. </div>
  33. </div>
  34. </el-header>
  35. <el-main class="sa-main">
  36. <el-table height="100%" class="sa-table" :data="state.data" stripe @selection-change="onChangeSelection">
  37. <el-table-column type="selection" width="48"></el-table-column>
  38. <el-table-column label="商品信息" min-width="310">
  39. <template #default="scope">
  40. <div v-if="scope.row.order_item" class="goods-item sa-flex">
  41. <sa-image class="goods-image" :url="scope.row.order_item.goods_image" size="40"></sa-image>
  42. <div class="right">
  43. <span class="goods-title sa-table-line-1"
  44. @click="onOpenGoodsDetail(scope.row.order_item.goods_id)">
  45. {{ scope.row.order_item.goods_title || '-' }}
  46. </span>
  47. <span v-if="scope.row.order" class="sa-table-line-1">
  48. 订单号:{{ scope.row.order.order_sn }}
  49. <el-icon class="copy-document" @click="onClipboard(scope.row.order.order_sn)">
  50. <copy-document />
  51. </el-icon>
  52. </span>
  53. <span v-else>订单号:-</span>
  54. </div>
  55. </div>
  56. <div v-else-if="scope.row.goods" class="goods-item sa-flex">
  57. <sa-image class="goods-image" :url="scope.row.goods.image" size="40"></sa-image>
  58. <div class="right">
  59. <span class=" goods-title sa-table-line-1"
  60. @click="onOpenGoodsDetail(scope.row.goods.id)">
  61. {{ scope.row.goods.title || '-' }}
  62. </span>
  63. <span>虚拟评价</span>
  64. </div>
  65. </div>
  66. </template>
  67. </el-table-column>
  68. <el-table-column label="用户信息" min-width="96" align="center">
  69. <template #default="scope">
  70. <sa-user-profile :user="scope.row.user" :id="scope.row.user_id" mode="col"
  71. :ishover="scope.row.user_type != 'fake_user'"></sa-user-profile>
  72. </template>
  73. </el-table-column>
  74. <el-table-column label="评价星级" min-width="146">
  75. <template #default="scope">
  76. <el-rate v-model="scope.row.level" disabled></el-rate>
  77. </template>
  78. </el-table-column>
  79. <el-table-column label="评价图片" width="200">
  80. <template #default="scope">
  81. <el-scrollbar>
  82. <div class="sa-flex">
  83. <template v-for="item in scope.row.images" :key="item">
  84. <sa-image class="image" :url="item" size="30"></sa-image>
  85. </template>
  86. </div>
  87. </el-scrollbar>
  88. </template>
  89. </el-table-column>
  90. <el-table-column label="评价内容" min-width="162">
  91. <template #default="scope">
  92. <div class="sa-table-line-1">
  93. {{ scope.row.content || '-' }}
  94. </div>
  95. </template>
  96. </el-table-column>
  97. <el-table-column label="评价时间" width="172">
  98. <template #default="scope">
  99. {{ scope.row.createtime || '-' }}
  100. </template>
  101. </el-table-column>
  102. <el-table-column label="显示状态" min-width="130">
  103. <template #default="scope">
  104. {if $auth->check('shopro/goods/comment/edit')}
  105. <el-dropdown @command="onCommand">
  106. <el-button link>
  107. <el-tag :type="scope.row.status == 'normal' ? 'success' : 'info'">
  108. {{ scope.row.status_text }}
  109. <el-icon>
  110. <arrow-down />
  111. </el-icon>
  112. </el-tag>
  113. </el-button>
  114. <template #dropdown>
  115. <el-dropdown-menu>
  116. <el-dropdown-item :command="{
  117. id: scope.row.id,
  118. type: 'normal',
  119. }">
  120. <span class="status-normal">正常</span>
  121. </el-dropdown-item>
  122. <el-dropdown-item :command="{
  123. id: scope.row.id,
  124. type: 'hidden',
  125. }">
  126. <span class="status-hidden">隐藏</span>
  127. </el-dropdown-item>
  128. </el-dropdown-menu>
  129. </template>
  130. </el-dropdown>
  131. {/if}
  132. </template>
  133. </el-table-column>
  134. <el-table-column fixed="right" label="操作" min-width="120">
  135. <template #default="scope">
  136. {if $auth->check('shopro/goods/comment/edit')}
  137. <el-button type="primary" link @click="onEdit(scope.row.id)">编辑</el-button>
  138. {/if}
  139. <el-popconfirm width="fit-content" confirm-button-text="确认" cancel-button-text="取消"
  140. title="确认删除这条记录?" @confirm="onDelete(scope.row.id)">
  141. <template #reference>
  142. {if $auth->check('shopro/goods/comment/delete')}
  143. <el-button type="danger" link>删除</el-button>
  144. {/if}
  145. </template>
  146. </el-popconfirm>
  147. </template>
  148. </el-table-column>
  149. </el-table>
  150. </el-main>
  151. <el-footer class="sa-footer sa-flex sa-row-between sa-flex-wrap">
  152. <div class="sa-batch sa-flex">
  153. <div class="tip">
  154. 已选择 <span>{{batchHandle.data.length}}</span> 项</div>
  155. <div class="sa-flex">
  156. {if $auth->check('shopro/goods/comment/delete')}
  157. <el-button type="danger" :disabled="!batchHandle.data.length" @click="onBatchHandle('delete')">删除
  158. </el-button>
  159. {/if}
  160. {if $auth->check('shopro/goods/comment/edit')}
  161. <el-button type="success" :disabled="!batchHandle.data.length" @click="onBatchHandle('normal')">正常
  162. </el-button>
  163. {/if}
  164. {if $auth->check('shopro/goods/comment/edit')}
  165. <el-button type="info" :disabled="!batchHandle.data.length" @click="onBatchHandle('hidden')">隐藏
  166. </el-button>
  167. {/if}
  168. </div>
  169. </div>
  170. <sa-pagination v-model="pagination" @pagination-change="getData"></sa-pagination>
  171. </el-footer>
  172. </el-container>
  173. <sa-filter v-model="state.filter" @filter-change="onChangeFilter"></sa-filter>
  174. </div>