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

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