index.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. {include file="/shopro/common/script" /}
  2. <style>
  3. .price-title {
  4. text-decoration: line-through;
  5. margin-right: 8px;
  6. color: var(--sa-subfont);
  7. }
  8. .live-qrcode {
  9. width: 150px;
  10. height: 150px;
  11. }
  12. .empty-data {
  13. width: 210px;
  14. height: 150px;
  15. }
  16. </style>
  17. <div id="index" class="mplive-index panel panel-default panel-intro" v-cloak>
  18. <el-container class="panel-block">
  19. <el-header class="sa-header">
  20. <el-tabs class="sa-tabs" v-model="dispatchType">
  21. <el-tab-pane label="直播间管理" name="live"></el-tab-pane>
  22. <el-tab-pane label="商品库管理" name="goods"></el-tab-pane>
  23. </el-tabs>
  24. <div class="sa-title sa-flex sa-row-between">
  25. <div class="sa-title-left">
  26. <div class="left-name">{{ dispatchType === 'live' ? '直播间管理' : '商品库管理' }}</div>
  27. <sa-filter-condition v-model="state.filter" @filter-delete="onChangeFilter">
  28. </sa-filter-condition>
  29. </div>
  30. <div v-if="dispatchType === 'live'">
  31. <el-popover placement="bottom" :width="180" trigger="click">
  32. <template #reference>
  33. <el-button class="sa-button-refresh">主播端</el-button>
  34. </template>
  35. <img class="live-qrcode" src="/assets/addons/shopro/img/live-qrcode.png" />
  36. </el-popover>
  37. <!-- :loading="loading" -->
  38. {if $auth->check('shopro/app/mplive/room/sync')}
  39. <el-button class="sa-button-refresh" icon="RefreshRight" @click="sync">同步直播间</el-button>
  40. {/if}
  41. {if $auth->check('shopro/app/mplive/room/add')}
  42. <el-button class="sa-button-refresh" type="primary" icon="Plus" @click="addRow">创建直播间</el-button>
  43. {/if}
  44. </div>
  45. <div v-if="dispatchType === 'goods'">
  46. <el-button class="sa-button-refresh" icon="RefreshRight" @click="getData()"></el-button>
  47. <el-button class="sa-button-refresh" icon="Search" @click="openFilter"></el-button>
  48. {if $auth->check('shopro/app/mplive/goods/add')}
  49. <el-button class="sa-button-refresh" type="primary" icon="Plus" @click="addGoods">添加商品</el-button>
  50. {/if}
  51. </div>
  52. </div>
  53. </el-header>
  54. <!-- v-loading="loading" -->
  55. <el-main class="sa-p-0">
  56. <el-table height="100%" class="sa-table" :data="live.data" stripe @sort-change="onChangeSort" v-if="dispatchType === 'live'">
  57. <el-table-column label="房间ID" sortable="custom" min-width="120" align="center">
  58. <template #default="scope">
  59. <div class="sa-table-line-1">{{ scope.row.roomid }}</div>
  60. </template>
  61. </el-table-column>
  62. <el-table-column label="直播类型" min-width="120" align="center">
  63. <template #default="scope">
  64. <div class="sa-table-line-1">{{ scope.row.type_text }}</div>
  65. </template>
  66. </el-table-column>
  67. <el-table-column label="直播间标题" min-width="200" align="center">
  68. <template #default="scope">
  69. <div class="sa-table-line-1">{{ scope.row.name }}</div>
  70. </template>
  71. </el-table-column>
  72. <el-table-column label="主播昵称" min-width="120" align="center">
  73. <template #default="scope">
  74. <div class="sa-table-line-1">{{ scope.row.anchor_name }}</div>
  75. </template>
  76. </el-table-column>
  77. <el-table-column label="状态" min-width="120" align="center">
  78. <template #default="scope">
  79. <div class="sa-table-line-1" :class="
  80. scope.row.status === 101
  81. ? 'sa-color--success'
  82. : scope.row.status === 102
  83. ? 'sa-color--warning'
  84. : scope.row.status === 105
  85. ? 'sa-color--info'
  86. : 'sa-color--danger'
  87. ">{{ scope.row.status_text }}</div>
  88. </template>
  89. </el-table-column>
  90. <el-table-column label="背景图" min-width="80" align="center">
  91. <template #default="scope">
  92. <div class="sa-flex sa-row-center">
  93. <sa-image :url="scope.row.cover_img" size="30">
  94. </sa-image>
  95. </div>
  96. </template>
  97. </el-table-column>
  98. <el-table-column label="分享图" min-width="80" align="center">
  99. <template #default="scope">
  100. <div class="sa-flex sa-row-center">
  101. <sa-image :url="scope.row.share_img" size="30"></sa-image>
  102. </div>
  103. </template>
  104. </el-table-column>
  105. <el-table-column label="封面图" min-width="80" align="center">
  106. <template #default="scope">
  107. <div class="sa-flex sa-row-center">
  108. <sa-image :url="scope.row.feeds_img" size="30"></sa-image>
  109. </div>
  110. </template>
  111. </el-table-column>
  112. <el-table-column label="开播时间" min-width="200" align="center">
  113. <template #default="scope">
  114. <div class="sa-table-line-1">{{
  115. Moment(scope.row.start_time * 1000).format('YYYY-MM-DD HH:mm')
  116. }}</div>
  117. </template>
  118. </el-table-column>
  119. <el-table-column label="结束时间" min-width="200" align="center">
  120. <template #default="scope">
  121. <div class="sa-table-line-1">{{
  122. Moment(scope.row.end_time * 1000).format('YYYY-MM-DD HH:mm')
  123. }}</div>
  124. </template>
  125. </el-table-column>
  126. <el-table-column label="操作" min-width="340" fixed="right" align="center">
  127. <template #default="scope">
  128. {if $auth->check('shopro/app/mplive/room/edit')}
  129. <el-button link type="primary" @click="editRow(scope.row.roomid)">编辑</el-button>
  130. {/if}
  131. {if $auth->check('shopro/app/mplive/room/pushurl')}
  132. <el-button link type="primary" @click="pushUrl(scope.row.roomid)"
  133. v-if="scope.row.type === 1 && (scope.row.status === 101 || scope.row.status === 102)">推流地址</el-button>
  134. {/if}
  135. {if $auth->check('shopro/app/mplive/room/qrcode')}
  136. <el-button link type="primary" @click="shareQrcode(scope.row.roomid)"
  137. v-if="scope.row.status === 101 || scope.row.status === 102">分享二维码</el-button>
  138. {/if}
  139. {if $auth->check('shopro/app/mplive/room/playback')}
  140. <el-button link type="primary" @click="playBack(scope.row.roomid)"
  141. v-if="scope.row.status === 103">回放</el-button>
  142. {/if}
  143. <el-popconfirm width="fit-content" confirm-button-text="确认" cancel-button-text="取消"
  144. title="确认删除这条记录?" @confirm="deleteApi(scope.row.roomid)">
  145. <template #reference>
  146. {if $auth->check('shopro/app/mplive/room/delete')}
  147. <el-button link type="danger">
  148. 删除
  149. </el-button>
  150. {/if}
  151. </template>
  152. </el-popconfirm>
  153. </template>
  154. </el-table-column>
  155. </el-table>
  156. <el-table height="100%" class="sa-table" :data="goods.data" stripe v-if="dispatchType === 'goods'">
  157. <el-table-column prop="id" label="ID" min-width="80"></el-table-column>
  158. <el-table-column label="商品来源" min-width="120" align="center">
  159. <template #default="scope">
  160. <div class="sa-table-line-1">{{ scope.row.type_text }}</div>
  161. </template>
  162. </el-table-column>
  163. <el-table-column label="商品封面" min-width="80" align="center">
  164. <template #default="scope">
  165. <div class="sa-flex sa-row-center">
  166. <sa-image :url="scope.row.cover_img_url" size="30">
  167. </sa-image>
  168. </div>
  169. </template>
  170. </el-table-column>
  171. <el-table-column label="商品名称" min-width="220" align="center">
  172. <template #default="scope">
  173. <div class="sa-table-line-1">{{ scope.row.name }}</div>
  174. </template>
  175. </el-table-column>
  176. <el-table-column label="价格形式" min-width="120" align="center">
  177. <template #default="scope">
  178. <div class="sa-table-line-1">{{ scope.row.price_type_text }}</div>
  179. </template>
  180. </el-table-column>
  181. <el-table-column label="价格" min-width="200" align="center">
  182. <template #default="scope">
  183. <div class="sa-table-line-1">
  184. <div class="sa-flex sa-row-center">
  185. <div :class="{ 'price-title': scope.row.price_type === 3 }">{{ scope.row.price }}元</div>
  186. <div>
  187. {{ formatPrice(scope.row.price2, scope.row.price_type) }}
  188. </div>
  189. </div>
  190. </div>
  191. </template>
  192. </el-table-column>
  193. <el-table-column label="商品路径" min-width="300" align="center">
  194. <template #default="scope">
  195. <div class="sa-table-line-1">{{ scope.row.url }}</div>
  196. </template>
  197. </el-table-column>
  198. <el-table-column label="审核状态" min-width="120" align="center" fixed="right">
  199. <template #default="scope">
  200. <div class="sa-flex sa-row-center">
  201. <div class="sa-table-line-1" :class="
  202. scope.row.audit_status === 2
  203. ? 'sa-color--success'
  204. : scope.row.audit_status === 3
  205. ? 'sa-color--danger'
  206. : scope.row.audit_status === 1 ? 'sa-color--warning' : 'sa-color--info'
  207. ">{{ scope.row.audit_status_text }}</div>
  208. <el-button link icon="RefreshRight" @click="getStatus(scope.row.id)"></el-button>
  209. </div>
  210. </template>
  211. </el-table-column>
  212. <el-table-column label="操作" min-width="200" fixed="right">
  213. <template #default="scope">
  214. {if $auth->check('shopro/app/mplive/goods/edit')}
  215. <el-button link type="primary" @click="editGoods(scope.row.id)">编辑</el-button>
  216. {/if}
  217. {if $auth->check('shopro/app/mplive/goods/audit')}
  218. <el-button link type="primary" @click="check(scope.row.id, 'resubmit')"
  219. v-if="scope.row.audit_status === 0 || scope.row.audit_status === 3">提交审核</el-button>
  220. {/if}
  221. {if $auth->check('shopro/app/mplive/goods/audit')}
  222. <el-button link type="primary" v-if="scope.row.audit_status === 1"
  223. @click="check(scope.row.id, 'reset')">撤回审核</el-button>
  224. {/if}
  225. <el-popconfirm width="fit-content" confirm-button-text="确认" cancel-button-text="取消"
  226. title="确认删除这条记录?" @confirm="deleteGoods(scope.row.id)">
  227. <template #reference>
  228. {if $auth->check('shopro/app/mplive/goods/delete')}
  229. <el-button link type="danger">删除</el-button>
  230. {/if}
  231. </template>
  232. </el-popconfirm>
  233. </template>
  234. </el-table-column>
  235. </el-table>
  236. </el-main>
  237. <el-footer class="sa-footer sa-flex sa-row-between sa-flex-wrap" v-if="dispatchType === 'goods'">
  238. <div class="sa-batch sa-flex">
  239. </div>
  240. <sa-pagination v-model="pagination" @pagination-change="getData"></sa-pagination>
  241. </el-footer>
  242. </el-container>
  243. <sa-filter v-model="state.filter" @filter-change="onChangeFilter"></sa-filter>
  244. </div>