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

338 lines
6.9 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. <template>
  2. <view class="page">
  3. <navbar title="分享记录" />
  4. <view class="content">
  5. <view class="card" style="padding-left: 0;">
  6. <uv-tabs :list="tabs"
  7. :inactiveStyle="{
  8. color: '#999999',
  9. fontSize: '30rpx',
  10. fontWeight: 500,
  11. whiteSpace: 'nowrap',
  12. }"
  13. :activeStyle="{
  14. color: '#1B1B1B',
  15. fontSize: '38rpx',
  16. fontWeight: 900,
  17. whiteSpace: 'nowrap',
  18. }"
  19. lineHeight="13rpx"
  20. lineWidth="77rpx"
  21. :lineColor="`url('../../static/image/record/slider.png') 100% 100%`"
  22. :scrollable="false"
  23. @click="clickTabs"
  24. >
  25. <template v-slot:right>
  26. <view>
  27. <uv-popup
  28. ref="popup"
  29. :overlayOpacity="0"
  30. :customStyle="{
  31. backgroundColor: 'transparent',
  32. position: 'fixed',
  33. top: '300rpx',
  34. right: '20rpx'
  35. }"
  36. >
  37. <view class="card popup-options">
  38. <view
  39. class="popup-option"
  40. :class="{ 'is-active': item.value === queryParams.auditStatus }"
  41. v-for="item in auditStatusOptions"
  42. :key="item.value"
  43. @click="onSelectAuditStatus(item.value)"
  44. >
  45. <text>{{ item.label }}</text>
  46. </view>
  47. </view>
  48. </uv-popup>
  49. <button class="btn-simple" plain @click="openPicker" >
  50. <image src="../../static/image/record/filter.png" style="width: 30rpx; height: 30rpx;"></image>
  51. </button>
  52. </view>
  53. </template>
  54. </uv-tabs>
  55. </view>
  56. <view v-if="recordList.records.length > 0" class="card list">
  57. <view class="list-item"
  58. v-for="item in recordList.records"
  59. @click="toSharingDetail(item.id)"
  60. :key="item.id"
  61. >
  62. <image class="left" :src="item.imageUrl"></image>
  63. <view class="right">
  64. <view class="title">{{ item.title }}</view>
  65. <view class="desc">{{ item.description }}</view>
  66. <view class="bottom">
  67. <text class="desc">{{ item.createTime }}</text>
  68. <button plain class="btn-simple btn-delete flex" @click="onDelete(item.id)">
  69. <image src="../../static/image/record/delete.png" style="width: 24rpx; height: 24rpx;"></image>
  70. <text style="margin-left: 10rpx;">删除</text>
  71. </button>
  72. </view>
  73. <view class="mark">
  74. <image
  75. :src="auditStatusImgMapping[item.auditStatus]"
  76. style="width: 100rpx; height: 100rpx;"
  77. ></image>
  78. </view>
  79. </view>
  80. </view>
  81. </view>
  82. </view>
  83. <tabber select="record"/>
  84. </view>
  85. </template>
  86. <script>
  87. import tabber from '@/components/base/tabbar.vue'
  88. import { mapGetters } from 'vuex'
  89. const URL_MAPPING = { // state -> url
  90. '-1': '/pages_order/record/personalSharing',
  91. '1': '/pages_order/record/videoSharing',
  92. '2': '/pages_order/record/groupSharing',
  93. '3': '/pages_order/record/articleSharing',
  94. }
  95. export default {
  96. components : {
  97. tabber,
  98. },
  99. computed : {
  100. ...mapGetters(['userShop']),
  101. },
  102. data() {
  103. return {
  104. tabs: [{
  105. name: '个人分享'
  106. },
  107. {
  108. name: '视频分享'
  109. },
  110. {
  111. name: '群分享'
  112. },
  113. {
  114. name: '文章分享'
  115. },
  116. ],
  117. auditStatusOptions: [
  118. {
  119. label: '审核中',
  120. value: 0,
  121. },
  122. {
  123. label: '已通过',
  124. value: 1,
  125. },
  126. {
  127. label: '未通过',
  128. value: 2,
  129. },
  130. ],
  131. queryParams: {
  132. pageNo: 1,
  133. pageSize: 10,
  134. auditStatus: null,
  135. },
  136. recordList: {
  137. records: [
  138. {
  139. id: '001',
  140. imageUrl: '../../static/image/record/temp.png',
  141. times: 10,
  142. qrCode: null,
  143. title: '裂变星轻松获客',
  144. description: '如此好用的赚钱项目,赶快加入吧!',
  145. auditStatus: 0,
  146. createTime: '2025年2月1日',
  147. },
  148. {
  149. id: '002',
  150. imageUrl: '../../static/image/record/temp.png',
  151. times: 10,
  152. qrCode: null,
  153. title: '裂变星轻松获客',
  154. description: '如此好用的赚钱项目,赶快加入吧!',
  155. auditStatus: 1,
  156. createTime: '2025年2月1日',
  157. },
  158. {
  159. id: '002',
  160. imageUrl: '../../static/image/record/temp.png',
  161. times: 10,
  162. qrCode: null,
  163. title: '裂变星轻松获客',
  164. description: '如此好用的赚钱项目,赶快加入吧!',
  165. auditStatus: 2,
  166. createTime: '2025年2月1日',
  167. },
  168. ]
  169. },
  170. // recordList : { // 列表数据
  171. // records : [],
  172. // total : 0,
  173. // },
  174. state : -1,
  175. auditStatusImgMapping: {
  176. 0: '../../static/image/record/audit.png', // 审核中
  177. 1: '../../static/image/record/pass.png', // 已通过
  178. 2: '../../static/image/record/fail.png', // 未通过
  179. }
  180. }
  181. },
  182. onShow() {
  183. this.orderPage()
  184. },
  185. //滚动到屏幕底部
  186. onReachBottom() {
  187. if(this.queryParams.pageSize < this.recordList.total){
  188. this.queryParams.pageSize += 10
  189. this.orderPage()
  190. }
  191. },
  192. methods: {
  193. orderPage(){
  194. // todo
  195. return
  196. let queryParams = {
  197. ...this.queryParams,
  198. }
  199. if(this.state != -1){
  200. queryParams.state = this.state
  201. }
  202. this.$api('orderPage', queryParams, res => {
  203. if(res.code == 200){
  204. this.recordList = res.result
  205. }
  206. })
  207. },
  208. //点击tab栏
  209. clickTabs(index) {
  210. if (index == 0) {
  211. this.state = -1;
  212. } else {
  213. this.state = index - 1;
  214. }
  215. this.queryParams.pageSize = 10
  216. this.orderPage()
  217. },
  218. openPicker() {
  219. this.$refs.popup.open();
  220. },
  221. onSelectAuditStatus(val) {
  222. const selected = this.queryParams.auditStatus
  223. this.queryParams.auditStatus = selected === val ? null : val
  224. },
  225. //跳转分享详情页面
  226. toSharingDetail(id) {
  227. uni.navigateTo({
  228. url: `${URL_MAPPING[this.state]}?id=${id}`
  229. })
  230. },
  231. onDelete(id) {
  232. // todo
  233. },
  234. }
  235. }
  236. </script>
  237. <style scoped lang="scss">
  238. .page{
  239. }
  240. .content {
  241. padding: 20rpx;
  242. }
  243. .list {
  244. margin-top: 20rpx;
  245. padding: 40rpx 59rpx 40rpx 43rpx;
  246. &-item {
  247. font-size: 0;
  248. display: flex;
  249. & + & {
  250. margin-top: 40rpx;
  251. }
  252. .left {
  253. width: 220rpx;
  254. height: 148rpx;
  255. background-color: yellow;
  256. }
  257. .right {
  258. flex: 1;
  259. width: calc(100% - 220rpx);
  260. padding-left: 20rpx;
  261. box-sizing: border-box;
  262. position: relative;
  263. }
  264. }
  265. .title {
  266. color: #1B1B1B;
  267. font-size: 28rpx;
  268. }
  269. .desc {
  270. color: #999999;
  271. font-size: 24rpx;
  272. white-space: nowrap;
  273. text-overflow: ellipsis;
  274. text-align: left;
  275. }
  276. .title + .desc {
  277. margin-top: 18rpx;
  278. }
  279. .bottom {
  280. position: absolute;
  281. bottom: 0;
  282. width: calc(100% - 20rpx);
  283. }
  284. .btn-delete {
  285. float: right;
  286. color: #05D9A2;
  287. font-size: 20rpx;
  288. }
  289. .mark {
  290. position: absolute;
  291. top: 10rpx;
  292. right: 5rpx;
  293. }
  294. }
  295. .popup {
  296. &-options {
  297. box-shadow: 0 2px 12px 0 rgba(0,0,0,.1);
  298. padding: 16rpx 40rpx;
  299. }
  300. &-option {
  301. color: #999999;
  302. font-size: 28rpx;
  303. &.is-active {
  304. color: #1B1B1B;
  305. font-weight: 700;
  306. }
  307. & + & {
  308. margin-top: 16rpx;
  309. }
  310. }
  311. }
  312. </style>