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

287 lines
5.5 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 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. <popupActivate ref="popupActivate"></popupActivate>
  65. <tabber select="record"/>
  66. </view>
  67. </template>
  68. <script>
  69. import { mapGetters } from 'vuex'
  70. import mixinsList from '@/mixins/list.js'
  71. import tabber from '@/components/base/tabbar.vue'
  72. import suspendDropdown from '@/components/base/suspendDropdown.vue'
  73. import popupActivate from '@/components/center/popupActivate.vue'
  74. const URL_MAPPING = { // state -> url
  75. '0': '/pages_order/record/personalSharing',
  76. '1': '/pages_order/record/videoSharing',
  77. '2': '/pages_order/record/groupSharing',
  78. '3': '/pages_order/record/articleSharing',
  79. }
  80. export default {
  81. mixins : [mixinsList],
  82. components : {
  83. tabber,
  84. suspendDropdown,
  85. popupActivate,
  86. },
  87. computed : {
  88. ...mapGetters(['userShop']),
  89. },
  90. data() {
  91. return {
  92. tabs: [{
  93. name: '个人分享'
  94. },
  95. {
  96. name: '视频分享'
  97. },
  98. {
  99. name: '群分享'
  100. },
  101. {
  102. name: '文章分享'
  103. },
  104. ],
  105. auditStatusOptions: [
  106. {
  107. label: '审核中',
  108. value: 0,
  109. },
  110. {
  111. label: '已通过',
  112. value: 1,
  113. },
  114. {
  115. label: '未通过',
  116. value: 2,
  117. },
  118. ],
  119. queryParams: {
  120. pageNo: 1,
  121. pageSize: 10,
  122. state: 0,
  123. },
  124. status: null,
  125. recordList : { // 列表数据
  126. records : [],
  127. total : 0,
  128. },
  129. auditStatusImgMapping: {
  130. 0: '../../static/image/record/audit.png', // 审核中
  131. 1: '../../static/image/record/pass.png', // 已通过
  132. 2: '../../static/image/record/fail.png', // 未通过
  133. },
  134. // todo
  135. sliderBgUrl: '',
  136. mixinsListApi : 'getSharePage',
  137. }
  138. },
  139. methods: {
  140. //点击tab栏
  141. clickTabs(e) {
  142. this.queryParams.state = e.index
  143. this.queryParams.pageNo = 1
  144. this.queryParams.pageSize = 10
  145. this.getData()
  146. },
  147. onAuditStatusChange(status) {
  148. this.status = status
  149. this.queryParams.pageNo = 1
  150. this.queryParams.pageSize = 10
  151. if (status === null) {
  152. delete this.queryParams.status
  153. } else {
  154. this.queryParams.status = status
  155. }
  156. this.getData()
  157. },
  158. //跳转分享详情页面
  159. toSharingDetail(id) {
  160. if (!this.userInfo.isPay) {
  161. this.$refs.popupActivate.open()
  162. return
  163. }
  164. uni.navigateTo({
  165. url: `${URL_MAPPING[this.queryParams.state]}?id=${id}`
  166. })
  167. },
  168. onDelete(id) {
  169. uni.showModal({
  170. title: '确认删除该分享吗',
  171. success: async (r) => {
  172. if(r.confirm){
  173. await this.$fetch('deleteLog', { id, state: this.queryParams.state })
  174. this.getData()
  175. }
  176. }
  177. })
  178. },
  179. }
  180. }
  181. </script>
  182. <style scoped lang="scss">
  183. .page{
  184. }
  185. .content {
  186. padding: 20rpx;
  187. }
  188. .list {
  189. margin-top: 20rpx;
  190. padding: 40rpx 59rpx 40rpx 43rpx;
  191. &-item {
  192. font-size: 0;
  193. display: flex;
  194. & + & {
  195. margin-top: 40rpx;
  196. }
  197. .left {
  198. width: 220rpx;
  199. height: 148rpx;
  200. }
  201. .right {
  202. flex: 1;
  203. width: calc(100% - 220rpx);
  204. padding-left: 20rpx;
  205. box-sizing: border-box;
  206. position: relative;
  207. }
  208. }
  209. .title {
  210. color: #1B1B1B;
  211. font-size: 28rpx;
  212. }
  213. .desc {
  214. color: #999999;
  215. font-size: 24rpx;
  216. white-space: nowrap;
  217. overflow: hidden;
  218. text-overflow: ellipsis;
  219. text-align: left;
  220. }
  221. .title + .desc {
  222. margin-top: 18rpx;
  223. }
  224. .bottom {
  225. position: absolute;
  226. bottom: 0;
  227. width: calc(100% - 20rpx);
  228. }
  229. .btn-delete {
  230. float: right;
  231. color: #05D9A2;
  232. font-size: 20rpx;
  233. }
  234. .mark {
  235. position: absolute;
  236. top: 10rpx;
  237. right: 5rpx;
  238. }
  239. }
  240. .popup {
  241. &-options {
  242. box-shadow: 0 2px 12px 0 rgba(0,0,0,.1);
  243. padding: 16rpx 40rpx;
  244. }
  245. &-option {
  246. color: #999999;
  247. font-size: 28rpx;
  248. &.is-active {
  249. color: #1B1B1B;
  250. font-weight: 700;
  251. }
  252. & + & {
  253. margin-top: 16rpx;
  254. }
  255. }
  256. }
  257. </style>