log.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298
  1. <template>
  2. <view>
  3. <view class="listCardlog" v-for="(item,index) in plist" :key="index" @tap="goDetail(item.comjobs.id)">
  4. <view class="listCardlog-item">
  5. <view class="item-left">
  6. <image class="item-icon" :src="$getImageUrl('static/images/applet/index/cardA.png')"
  7. mode="widthFix"></image>
  8. <view class="item-content bold">
  9. {{item.comjobs.title}}
  10. <text class="text-red text-sm">(按月)</text>
  11. <text class="text-red text-sm" v-if="item.comjobs.wtype==2">(按时)</text>
  12. <text class="text-red text-sm" v-if="item.comjobs.wtype==3">(按件)</text>
  13. <text class="text-red text-sm" v-if="item.comjobs.wtype==4">(按项目)</text>
  14. </view>
  15. </view>
  16. <view class="item-right">
  17. <!-- <image class="item-icon" :src="$getImageUrl('static/images/applet/index/cardD.png')"
  18. mode="widthFix"></image> -->
  19. <view class="item-content small" style="color: #c3c3c3;" @tap.stop="delLog(index, item.id)">取消报名
  20. </view>
  21. </view>
  22. </view>
  23. <view class="listCardlog-item">
  24. <view class="item-left">
  25. <image class="item-icon" src="../../static/images/comJobs/icon-sum.png" mode="widthFix"></image>
  26. <view class="item-content red">{{item.comjobs.zwagall}}</view>
  27. </view>
  28. <view class="item-right">
  29. <!-- <image class="item-icon" src="../../static/images/comJobs/icon-pageView.png" mode="widthFix">
  30. </image> -->
  31. <view class="item-content red small">{{item.status_text}}</view>
  32. </view>
  33. </view>
  34. <view class="listCardlog-tag">
  35. <view v-for="(titem,tindex) in item.comjobs.tags" :key="tindex" class="tag-item">{{titem}}</view>
  36. </view>
  37. <view class="listCardlog-item">
  38. <view class="item-left">
  39. <!-- <image class="item-icon" src="../../static/images/comJobs/icon-sum.png" mode="widthFix"></image> -->
  40. <view class="item-content bold">{{item.comjobs.worker.title}}</view>
  41. </view>
  42. <view class="item-right">
  43. <image class="item-icon" src="../../static/images/comJobs/icon-pageView.png" mode="widthFix">
  44. </image>
  45. <view class="item-content small">浏览量:{{item.comjobs.volume}}</view>
  46. </view>
  47. </view>
  48. <view style="height: 1rpx;"></view>
  49. </view>
  50. <block v-for="(item,index) in plist" :key="index" v-if="false">
  51. <view class="cu-card dynamic no-card solid-bottom echo-comjobs-item padding-top-sm padding-lr-sm radius">
  52. <view class="cu-item shadow padding-top-sm padding-bottom" @tap="goDetail(item.comjobs.id)">
  53. <view class="padding-lr flex justify-between align-center">
  54. <view class="basis-lg text-bold text-df text-cut">
  55. {{item.comjobs.title}}
  56. <text class="text-red text-sm" v-if="item.comjobs.wtype==1">(按月)</text>
  57. <text class="text-red text-sm" v-if="item.comjobs.wtype==2">(按时)</text>
  58. <text class="text-red text-sm" v-if="item.comjobs.wtype==3">(按件)</text>
  59. <text class="text-red text-sm" v-if="item.comjobs.wtype==4">(按项目)</text>
  60. </view>
  61. <view class="basis-sm text-cut text-right text-gray text-sm">
  62. <view class="basis-xs text-cut text-right text-gray text-sm"
  63. @tap.stop="delLog(index, item.id)">取消报名</view>
  64. </view>
  65. </view>
  66. <view class="padding-lr flex justify-between align-bottom">
  67. <view class="basis-lg text-bold text-df text-cut">
  68. <view><text class="text-red text-bold">{{item.comjobs.zwagall}}</text></view>
  69. </view>
  70. <view class="basis-sm text-cut text-right text-red text-sm">
  71. {{item.status_text}}
  72. </view>
  73. </view>
  74. <view class="padding-lr padding-tb-xs text-cut">
  75. <view v-for="(titem,tindex) in item.comjobs.tags" :key="tindex"
  76. class="cu-tag light bg-blue lg echo-tags-item">{{titem}}</view>
  77. </view>
  78. <view class="padding-lr text-cut text-sm flex justify-between align-center">
  79. <view class="basis-lg text-df text-cut">{{item.comjobs.worker.title}}</view>
  80. <view class="basis-sm text-cut text-right text-sm">
  81. 浏览量:{{item.comjobs.volume}}
  82. </view>
  83. </view>
  84. </view>
  85. </view>
  86. </block>
  87. <uni-load-more :status="pstatus"></uni-load-more>
  88. </view>
  89. </template>
  90. <script>
  91. import uniLoadMore from "@/components/uni-load-more/uni-load-more.vue";
  92. var _this;
  93. export default {
  94. components: {
  95. uniLoadMore
  96. },
  97. data() {
  98. return {
  99. userinfo: {},
  100. pstatus: 'more',
  101. ppage: 1,
  102. psize: 20,
  103. plist: []
  104. };
  105. },
  106. onLoad: function() {
  107. _this = this;
  108. _this.userinfo = _this.checkLogin("/pages/comjobs/log");
  109. if (_this.userinfo === false) {
  110. return false;
  111. }
  112. _this.getMore();
  113. },
  114. onPullDownRefresh: function() {
  115. _this.ppage = 1;
  116. _this.pstatus = 'more';
  117. _this.plist = [];
  118. _this.getMore();
  119. },
  120. onReachBottom: function() {
  121. if (_this.pstatus !== 'more') {
  122. return;
  123. }
  124. _this.getMore();
  125. },
  126. methods: {
  127. delLog: function(index, logid) {
  128. uni.showModal({
  129. title: '温馨提示',
  130. content: '确定要删除吗?',
  131. success(res) {
  132. if (res.confirm) {
  133. _this.$req.ajax({
  134. path: "comjobs/dellog",
  135. data: {
  136. logid: logid,
  137. userid: _this.userinfo.id
  138. }
  139. }).then((data) => {
  140. _this.plist.splice(index, 1);
  141. }).catch((err) => {
  142. uni.showModal({
  143. title: '信息提示',
  144. content: err,
  145. showCancel: false
  146. });
  147. });
  148. }
  149. }
  150. });
  151. },
  152. getMore: function() {
  153. _this.$req.ajax({
  154. path: "comjobs/listlog",
  155. data: {
  156. ppage: _this.ppage,
  157. psize: _this.psize,
  158. userid: _this.userinfo.id
  159. }
  160. }).then((data) => {
  161. _this.pstatus = data.pstatus;
  162. _this.plist = _this.plist.concat(data.plist);
  163. _this.ppage += 1;
  164. console.log("数据", _this.plist)
  165. uni.stopPullDownRefresh();
  166. }).catch((err) => {
  167. uni.showModal({
  168. title: '信息提示',
  169. content: err,
  170. showCancel: false
  171. });
  172. });
  173. },
  174. goDetail: function(comjobsid) {
  175. uni.navigateTo({
  176. url: '/pages/comjobs/detail?comjobsid=' + comjobsid
  177. });
  178. },
  179. goShop: function(workerid) {
  180. uni.navigateTo({
  181. url: '/pages/worker/shop?workerid=' + workerid
  182. });
  183. },
  184. }
  185. }
  186. </script>
  187. <style lang="scss">
  188. .listCardlog {
  189. margin: 0 20rpx 40rpx;
  190. padding: 28rpx 24rpx 0;
  191. background-color: #FFFFFF;
  192. border-radius: 12rpx;
  193. .listCardlog-tag {
  194. display: flex;
  195. flex-wrap: wrap;
  196. .tag-item {
  197. margin-left: 15rpx;
  198. background: #E6F2FF;
  199. font-size: 20rpx;
  200. color: #CA151C;
  201. padding: 5rpx 12rpx;
  202. margin-bottom: 20rpx;
  203. white-space: nowrap;
  204. text-overflow: ellipsis;
  205. white-space: nowrap;
  206. overflow: hidden;
  207. }
  208. }
  209. .listCardlog-item {
  210. display: flex;
  211. margin-bottom: 28rpx;
  212. .item-left {
  213. width: 60%;
  214. display: flex;
  215. align-items: center;
  216. .item-icon {
  217. width: 30rpx;
  218. height: 30rpx;
  219. margin-right: 15rpx;
  220. }
  221. .item-content {
  222. flex: 1;
  223. font-size: 28rpx;
  224. color: #747474;
  225. overflow: hidden;
  226. text-overflow: ellipsis;
  227. -webkit-line-clamp: 1;
  228. display: -webkit-box;
  229. -webkit-box-orient: vertical;
  230. }
  231. .bold {
  232. font-size: 28rpx;
  233. font-weight: 600;
  234. color: #383838;
  235. }
  236. .red {
  237. font-size: 28rpx;
  238. font-weight: 600;
  239. color: #CA151C;
  240. }
  241. }
  242. .item-right {
  243. width: 35%;
  244. margin-left: 15rpx;
  245. display: flex;
  246. justify-content: flex-end;
  247. .item-icon {
  248. width: 30rpx;
  249. height: 30rpx;
  250. margin-right: 15rpx;
  251. }
  252. .item-content {
  253. // flex: 1;
  254. font-size: 28rpx;
  255. line-height: 35rpx;
  256. color: #747474;
  257. // overflow: hidden;
  258. // text-overflow: ellipsis;
  259. // -webkit-line-clamp: 1;
  260. // display: -webkit-box;
  261. // -webkit-box-orient: vertical;
  262. }
  263. .bold {
  264. font-size: 28rpx;
  265. font-weight: 600;
  266. color: #383838;
  267. }
  268. .red {
  269. font-size: 28rpx;
  270. font-weight: 600;
  271. color: #CA151C;
  272. }
  273. .small {
  274. font-size: 24rpx;
  275. }
  276. }
  277. }
  278. }
  279. </style>