裂变星小程序-25.03.04
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

278 lines
5.6 KiB

1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
  1. <template>
  2. <view class="page">
  3. <navbar title="分享记录" />
  4. <view class="content">
  5. <view class="card" style="padding-left: 0; padding-right: 10rpx;">
  6. <uv-tabs
  7. :list="tabs"
  8. @click="clickTabs"
  9. :inactiveStyle="{
  10. color: '#999999',
  11. fontSize: '30rpx',
  12. fontWeight: 500,
  13. whiteSpace: 'nowrap',
  14. }"
  15. :activeStyle="{
  16. color: '#1B1B1B',
  17. fontSize: '38rpx',
  18. fontWeight: 900,
  19. whiteSpace: 'nowrap',
  20. }"
  21. lineHeight="13rpx"
  22. lineWidth="77rpx"
  23. :lineColor="`url(${sliderBgUrl}) 100% 100%`"
  24. :scrollable="false"
  25. >
  26. <template v-slot:right>
  27. <suspendDropdown
  28. v-model="status"
  29. :options="auditStatusOptions"
  30. @change="onAuditStatusChange"
  31. ></suspendDropdown>
  32. </template>
  33. </uv-tabs>
  34. </view>
  35. <view v-if="list.length" class="card list">
  36. <view class="list-item"
  37. v-for="item in list"
  38. @click="toSharingDetail(item.id)"
  39. :key="item.id"
  40. >
  41. <!-- todo: video? -->
  42. <image class="left" :src="item.indexImage || item.headImage"></image>
  43. <view class="right">
  44. <view class="title">{{ item.headTitle || '' }}</view>
  45. <view class="desc">{{ item.textDetails || '' }}</view>
  46. <view class="bottom">
  47. <text class="desc">{{ item.createTime || '' }}</text>
  48. <button plain class="btn-simple btn-delete flex" @click.stop="onDelete(item.id)">
  49. <image src="../../static/image/record/delete.png" style="width: 24rpx; height: 24rpx;"></image>
  50. <text style="margin-left: 10rpx;">删除</text>
  51. </button>
  52. </view>
  53. <view class="mark">
  54. <image
  55. :src="auditStatusImgMapping[item.status]"
  56. style="width: 100rpx; height: 100rpx;"
  57. ></image>
  58. </view>
  59. </view>
  60. </view>
  61. </view>
  62. <!-- todo: empty -->
  63. </view>
  64. <tabber select="record"/>
  65. </view>
  66. </template>
  67. <script>
  68. import { mapGetters } from 'vuex'
  69. import mixinsList from '@/mixins/list.js'
  70. import tabber from '@/components/base/tabbar.vue'
  71. import suspendDropdown from '@/components/base/suspendDropdown.vue'
  72. const URL_MAPPING = { // state -> url
  73. '0': '/pages_order/record/personalSharing',
  74. '1': '/pages_order/record/videoSharing',
  75. '2': '/pages_order/record/groupSharing',
  76. '3': '/pages_order/record/articleSharing',
  77. }
  78. export default {
  79. mixins : [mixinsList],
  80. components : {
  81. tabber,
  82. suspendDropdown,
  83. },
  84. computed : {
  85. ...mapGetters(['userShop']),
  86. },
  87. data() {
  88. return {
  89. tabs: [{
  90. name: '个人分享'
  91. },
  92. {
  93. name: '视频分享'
  94. },
  95. {
  96. name: '群分享'
  97. },
  98. {
  99. name: '文章分享'
  100. },
  101. ],
  102. auditStatusOptions: [
  103. {
  104. label: '审核中',
  105. value: 0,
  106. },
  107. {
  108. label: '已通过',
  109. value: 1,
  110. },
  111. {
  112. label: '未通过',
  113. value: 2,
  114. },
  115. ],
  116. queryParams: {
  117. pageNo: 1,
  118. pageSize: 10,
  119. state: 0,
  120. },
  121. status: null,
  122. recordList : { // 列表数据
  123. records : [],
  124. total : 0,
  125. },
  126. auditStatusImgMapping: {
  127. 0: '../../static/image/record/audit.png', // 审核中
  128. 1: '../../static/image/record/pass.png', // 已通过
  129. 2: '../../static/image/record/fail.png', // 未通过
  130. },
  131. sliderBgUrl: 'https://thumbnail0.baidupcs.com/thumbnail/5128034cfj9ac619ca072da4706a6c90?fid=3983569511-250528-294545550145327&time=1742536800&rt=sh&sign=FDTAER-DCb740ccc5511e5e8fedcff06b081203-iqtAvQatpPXXyCeN8GEAHhPMHEM%3D&expires=8h&chkv=0&chkbd=0&chkpc=&dp-logid=8764190582084176609&dp-callid=0&file_type=0&size=c850_u580&quality=100&vuk=-&ft=video',
  132. mixinsListApi : 'getSharePage',
  133. }
  134. },
  135. methods: {
  136. //点击tab栏
  137. clickTabs(e) {
  138. this.queryParams.state = e.index
  139. this.queryParams.pageNo = 1
  140. this.queryParams.pageSize = 10
  141. this.getData()
  142. },
  143. onAuditStatusChange(status) {
  144. this.status = status
  145. this.queryParams.pageNo = 1
  146. this.queryParams.pageSize = 10
  147. if (status === null) {
  148. delete this.queryParams.status
  149. } else {
  150. this.queryParams.status = status
  151. }
  152. this.getData()
  153. },
  154. //跳转分享详情页面
  155. toSharingDetail(id) {
  156. uni.navigateTo({
  157. url: `${URL_MAPPING[this.queryParams.state]}?id=${id}`
  158. })
  159. },
  160. onDelete(id) {
  161. uni.showModal({
  162. title: '确认删除该分享吗',
  163. success: async (r) => {
  164. if(r.confirm){
  165. await this.$fetch('deleteLog', { id, state: this.queryParams.state })
  166. this.getData()
  167. }
  168. }
  169. })
  170. },
  171. }
  172. }
  173. </script>
  174. <style scoped lang="scss">
  175. .page{
  176. }
  177. .content {
  178. padding: 20rpx;
  179. }
  180. .list {
  181. margin-top: 20rpx;
  182. padding: 40rpx 59rpx 40rpx 43rpx;
  183. &-item {
  184. font-size: 0;
  185. display: flex;
  186. & + & {
  187. margin-top: 40rpx;
  188. }
  189. .left {
  190. width: 220rpx;
  191. height: 148rpx;
  192. }
  193. .right {
  194. flex: 1;
  195. width: calc(100% - 220rpx);
  196. padding-left: 20rpx;
  197. box-sizing: border-box;
  198. position: relative;
  199. }
  200. }
  201. .title {
  202. color: #1B1B1B;
  203. font-size: 28rpx;
  204. }
  205. .desc {
  206. color: #999999;
  207. font-size: 24rpx;
  208. white-space: nowrap;
  209. overflow: hidden;
  210. text-overflow: ellipsis;
  211. text-align: left;
  212. }
  213. .title + .desc {
  214. margin-top: 18rpx;
  215. }
  216. .bottom {
  217. position: absolute;
  218. bottom: 0;
  219. width: calc(100% - 20rpx);
  220. }
  221. .btn-delete {
  222. float: right;
  223. color: #05D9A2;
  224. font-size: 20rpx;
  225. }
  226. .mark {
  227. position: absolute;
  228. top: 10rpx;
  229. right: 5rpx;
  230. }
  231. }
  232. .popup {
  233. &-options {
  234. box-shadow: 0 2px 12px 0 rgba(0,0,0,.1);
  235. padding: 16rpx 40rpx;
  236. }
  237. &-option {
  238. color: #999999;
  239. font-size: 28rpx;
  240. &.is-active {
  241. color: #1B1B1B;
  242. font-weight: 700;
  243. }
  244. & + & {
  245. margin-top: 16rpx;
  246. }
  247. }
  248. }
  249. </style>