list.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  1. <template>
  2. <view class="content">
  3. <view class="actives">
  4. <view
  5. class="notice-content-box"
  6. v-for="(item, index) in activityList"
  7. :key="index"
  8. style="justify-content: start; padding: 30rpx 0 30rpx 30rpx;border-radius: 0;"
  9. @click="goActiveDeatil(item.id)" >
  10. <image
  11. :src="item.url"
  12. style="
  13. width: 112rpx;
  14. height: 112rpx;
  15. margin-right: 20rpx;
  16. border-radius: 10%;
  17. "
  18. ></image>
  19. <view class="notice-content" style="width: 75%">
  20. <view class="notice-content-font">{{
  21. item.title
  22. }}</view>
  23. <view class="display-flex-start" style="margin-top: 20rpx">
  24. <view class="notice-content-time color-a7adba">
  25. {{item.address}}
  26. </view>
  27. <view class="notice-content-time display-flex-start">
  28. <text class="color-a7adba">¥:</text>
  29. <text class="order-money">{{item.money}}</text>
  30. </view>
  31. </view>
  32. <view class="display-between" style="margin-top: 20rpx">
  33. <view class="notice-content-time color-a7adba" style="visibility: hidden;">
  34. {{item.time}}
  35. </view>
  36. <view class="display-flex-start">
  37. <view class="notice-content-time" style="color: #d9001b;">{{item.orderStatus}}</view>
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. <image src="../../static/nodata.svg" mode="aspectFit" style="width: 100%;" v-if="activityList.length === 0"></image>
  43. </view>
  44. </view>
  45. </template>
  46. <script>
  47. import md5 from "@/common/md5.js";
  48. export default {
  49. data() {
  50. return {
  51. message: "我的活动",
  52. themeColor: "#007AFF",
  53. mode: "selector",
  54. typeActive: true,
  55. indexType: 0,
  56. indexState: 0,
  57. activityList: [
  58. {
  59. url: "/static/order-poster.svg",
  60. title: "2022-2023年度供暖费",
  61. address: "千林郡5号楼1单元10层1001室",
  62. money:'2385.40',
  63. time: "2021-09-05",
  64. orderStatus:'待缴费'
  65. },
  66. {
  67. url: "/static/order-poster.svg",
  68. title: "2022-2023年度供暖费",
  69. address: "千林郡5号楼1单元10层1001室",
  70. money:'2385.40',
  71. time: "2021-09-05",
  72. orderStatus:'已缴费'
  73. },
  74. {
  75. url: "/static/order-poster.svg",
  76. title: "2022-2023年度供暖费",
  77. address: "千林郡5号楼1单元10层1001室",
  78. money:'2385.40',
  79. time: "2021-09-05",
  80. orderStatus:'空置已缴费'
  81. },
  82. ],
  83. activeListCopy: [],
  84. };
  85. },
  86. onLoad() {
  87. this.getActive();
  88. },
  89. methods: {
  90. goDeatil(id) {
  91. uni.navigateTo({
  92. url: "/pages/activity/activity_deatil?id=" + id,
  93. });
  94. },
  95. getActive() {
  96. let md5Sign = md5(
  97. "method=" +
  98. "activity" +
  99. "&timestamp=" +
  100. getApp().globalData.globalTimestamp +
  101. "&secret=" +
  102. getApp().globalData.secret
  103. );
  104. let url =
  105. getApp().globalData.shareUrl +
  106. "api/api.php" +
  107. "?method=activity&source=activity&action=my_list&timestamp=" +
  108. getApp().globalData.globalTimestamp +
  109. "&sign=" +
  110. md5Sign;
  111. let postData = {
  112. // page: 1,
  113. // page_size: 15,
  114. openId:getApp().globalData.open_id
  115. };
  116. uni.request({
  117. url: url,
  118. method: "POST",
  119. header: {
  120. "content-type": "application/x-www-form-urlencoded",
  121. },
  122. data: postData,
  123. success: (res) => {
  124. // console.log(res);
  125. if (res.data.code === 200) {
  126. let list = res.data.data.list;
  127. this.activeList = list.map((item) => {
  128. /*
  129. url: "/static/activity/2.png",
  130. title: "智能制造商标品牌培育系列培训活动",
  131. way: "市场监督管理局",
  132. date: "2021-08-07",
  133. read: 322,
  134. share: 1,
  135. type: 0, //0线下
  136. */
  137. let ob = {
  138. url: "",
  139. title: "",
  140. way: "",
  141. date: "",
  142. read: 0,
  143. share: 0,
  144. type: "",
  145. status:'',
  146. id: "",
  147. status: 0,
  148. };
  149. ob.url = item.pic_url ? getApp().globalData.shareUrl + item.pic_url : '/static/activity/default.png';
  150. ob.title = item.name;
  151. ob.way = item.sponsor;
  152. let time = this.$options.filters["globalTime"](item.start_time);
  153. let timeSecond = this.$options.filters["globalTime"](item.end_time);
  154. ob.date = time + "至" + timeSecond;
  155. ob.read = parseInt(item.base_read_count) + parseInt(item.real_read_count);
  156. ob.share =parseInt(item.real_repost_count) +parseInt(item.base_repost_count);
  157. ob.type = item.type;
  158. ob.status = item.status;
  159. ob.id = item.id;
  160. ob.status = item.status;
  161. return ob;
  162. });
  163. this.activeListCopy = this.activeList;
  164. }
  165. },
  166. fail: () => {
  167. console.log("连接失败");
  168. },
  169. });
  170. },
  171. },
  172. };
  173. </script>
  174. <style lang="scss" scoped>
  175. .content {
  176. display: flex;
  177. flex-direction: column;
  178. align-items: center;
  179. width: 100%;
  180. .choose-box {
  181. padding: 20rpx 0;
  182. width: 100%;
  183. display: flex;
  184. // position: fixed;
  185. height: 50rpx;
  186. top: 0;
  187. // margin-bottom: 50rpx;
  188. .type,
  189. .state {
  190. width: 50%;
  191. display: flex;
  192. justify-content: center;
  193. position: relative;
  194. .packer {
  195. width: 100%;
  196. .picker_title {
  197. z-index: 99;
  198. width: 100%;
  199. height: 100%;
  200. display: flex;
  201. justify-content: center;
  202. }
  203. }
  204. }
  205. .type::after,
  206. .state::after {
  207. z-index: -1;
  208. content: "";
  209. position: absolute;
  210. right: 30%;
  211. top: 20%;
  212. width: 0;
  213. height: 0;
  214. border-top: 15rpx solid rgb(173, 173, 173);
  215. border-left: 15rpx solid transparent;
  216. border-right: 15rpx solid transparent;
  217. }
  218. }
  219. .actives {
  220. width: 90%;
  221. // margin-top: 50rpx;
  222. display: flex;
  223. flex-direction: column;
  224. align-items: center;
  225. .actives-item {
  226. width: 100%;
  227. // height: 150rpx;
  228. box-shadow: 0px 4rpx 32rpx rgba(0, 0, 0, 0.1);
  229. border-radius: 32rpx;
  230. // margin-top: 20px;
  231. padding: 20rpx;
  232. display: flex;
  233. flex-direction: column;
  234. margin-top: 20rpx;
  235. margin-bottom: 10rpx;
  236. .readShare {
  237. display: flex;
  238. justify-content: flex-end;
  239. font-size: 26rpx;
  240. color: rgba(0, 0, 0, 0.3);
  241. margin-top: 20rpx;
  242. align-items: center;
  243. .active-tips-box {
  244. font-size: 28rpx;
  245. padding: 10rpx;
  246. border-radius: 10rpx;
  247. color: #fff;
  248. margin-right: 50rpx;
  249. }
  250. .wait-color {
  251. background-color: #aee359;
  252. }
  253. .ing-color {
  254. background-color: #00a8ea;
  255. }
  256. .end-color {
  257. background-color: #d7d7d7;
  258. }
  259. .read {
  260. width: 20%;
  261. text-align: center;
  262. // margin-right: 60rpx;
  263. }
  264. .share {
  265. width: 20%;
  266. text-align: center;
  267. }
  268. }
  269. }
  270. }
  271. }
  272. .active {
  273. color: $uni-color-primary;
  274. }
  275. .color {
  276. background-color: #589cff !important;
  277. }
  278. .notice-content-box {
  279. display: flex;
  280. padding: 30rpx 20rpx 30rpx 20rpx;
  281. background-color: #ffffff;
  282. box-shadow: 0px 4rpx 32rpx rgba(0, 0, 0, 0.1);
  283. border-radius: 32rpx;
  284. margin-top: 20rpx;
  285. justify-content: space-between;
  286. .notice-content-font {
  287. font-size: 32rpx;
  288. color: #0d1937;
  289. /* font-weight: 600; */
  290. overflow: hidden;
  291. text-overflow: ellipsis;
  292. white-space: nowrap;
  293. }
  294. .notice-content-time {
  295. font-size: 26rpx;
  296. letter-spacing: 0.02em;
  297. color: #333333;
  298. }
  299. .order-money {
  300. color: #d9001b;
  301. font-size: 36rpx;
  302. font-weight: 500;
  303. }
  304. }
  305. </style>