裂变星小程序-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.

279 lines
5.3 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. // todo
  132. sliderBgUrl: '',
  133. mixinsListApi : 'getSharePage',
  134. }
  135. },
  136. methods: {
  137. //点击tab栏
  138. clickTabs(e) {
  139. this.queryParams.state = e.index
  140. this.queryParams.pageNo = 1
  141. this.queryParams.pageSize = 10
  142. this.getData()
  143. },
  144. onAuditStatusChange(status) {
  145. this.status = status
  146. this.queryParams.pageNo = 1
  147. this.queryParams.pageSize = 10
  148. if (status === null) {
  149. delete this.queryParams.status
  150. } else {
  151. this.queryParams.status = status
  152. }
  153. this.getData()
  154. },
  155. //跳转分享详情页面
  156. toSharingDetail(id) {
  157. uni.navigateTo({
  158. url: `${URL_MAPPING[this.queryParams.state]}?id=${id}`
  159. })
  160. },
  161. onDelete(id) {
  162. uni.showModal({
  163. title: '确认删除该分享吗',
  164. success: async (r) => {
  165. if(r.confirm){
  166. await this.$fetch('deleteLog', { id, state: this.queryParams.state })
  167. this.getData()
  168. }
  169. }
  170. })
  171. },
  172. }
  173. }
  174. </script>
  175. <style scoped lang="scss">
  176. .page{
  177. }
  178. .content {
  179. padding: 20rpx;
  180. }
  181. .list {
  182. margin-top: 20rpx;
  183. padding: 40rpx 59rpx 40rpx 43rpx;
  184. &-item {
  185. font-size: 0;
  186. display: flex;
  187. & + & {
  188. margin-top: 40rpx;
  189. }
  190. .left {
  191. width: 220rpx;
  192. height: 148rpx;
  193. }
  194. .right {
  195. flex: 1;
  196. width: calc(100% - 220rpx);
  197. padding-left: 20rpx;
  198. box-sizing: border-box;
  199. position: relative;
  200. }
  201. }
  202. .title {
  203. color: #1B1B1B;
  204. font-size: 28rpx;
  205. }
  206. .desc {
  207. color: #999999;
  208. font-size: 24rpx;
  209. white-space: nowrap;
  210. overflow: hidden;
  211. text-overflow: ellipsis;
  212. text-align: left;
  213. }
  214. .title + .desc {
  215. margin-top: 18rpx;
  216. }
  217. .bottom {
  218. position: absolute;
  219. bottom: 0;
  220. width: calc(100% - 20rpx);
  221. }
  222. .btn-delete {
  223. float: right;
  224. color: #05D9A2;
  225. font-size: 20rpx;
  226. }
  227. .mark {
  228. position: absolute;
  229. top: 10rpx;
  230. right: 5rpx;
  231. }
  232. }
  233. .popup {
  234. &-options {
  235. box-shadow: 0 2px 12px 0 rgba(0,0,0,.1);
  236. padding: 16rpx 40rpx;
  237. }
  238. &-option {
  239. color: #999999;
  240. font-size: 28rpx;
  241. &.is-active {
  242. color: #1B1B1B;
  243. font-weight: 700;
  244. }
  245. & + & {
  246. margin-top: 16rpx;
  247. }
  248. }
  249. }
  250. </style>