list.vue 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. <template>
  2. <view>
  3. <!-- 第一种样式 人员管理-->
  4. <block v-if="datainfo.length>0">
  5. <!-- 订单 -->
  6. <block v-if="type=='delivery'">
  7. <view class="kdlists flexc" v-for="(ite,idx) in datainfo" :key="idx">
  8. <view class="kdll">
  9. <image :src="deva" class="limg"></image>
  10. <view class="tit pr35">运输中</view>
  11. <view class="over tit">陕西老潼关肉…</view>
  12. <view class="time">12-03 22:05 </view>
  13. </view>
  14. <view class="kdlr">
  15. <image :src="cirimg" class="limg"></image>
  16. <view>
  17. <view class="txt">运输中</view>
  18. <view class="tit overtwo">【沧州市】快件已发往 蚌埠转运中心</view>
  19. <view class="time">12-03 22:05 </view>
  20. </view>
  21. </view>
  22. </view>
  23. </block>
  24. <!-- 优惠券 -->
  25. <view v-if="type=='coupon'" class="coubox">
  26. <view class="coulists flexc" v-for="(ite,idx) in datainfo" :key="idx">
  27. <image :src="yhbg" class="yhbg"></image>
  28. <view class="coulist flexc">
  29. <view class="cltl flexccc">
  30. <view class="tit">30<text>元</text></view>
  31. <view class="txt">满100减30</view>
  32. </view>
  33. <view class="line"></view>
  34. <view class="cltr">
  35. <view class="over tit">合家福商品优惠券满100…</view>
  36. <view class="btns">
  37. <image :src="jfico" class="jfimg"></image>
  38. <view class="txt">1000<text>积分</text></view>
  39. <view class="btn flex0 flexcc">兑换</view>
  40. </view>
  41. </view>
  42. </view>
  43. </view>
  44. </view>
  45. <!-- 资讯 -->
  46. <block v-if="type=='news'">
  47. <view class="newslists flexc" v-for="(ite,idx) in datainfo" :key="idx">
  48. <image :src="jfico" class="newsll"></image>
  49. <view class="newslr over flex1">
  50. <view class="flexc mb8">
  51. <view class="over tit flex1">合肥市跌幅最大的小区房价公布</view>
  52. <view class="num flexc"><image :src="eye"></image>1361</view>
  53. </view>
  54. <view class="overtwo txt">对于合肥市这座城来说,可供选择的项目太多了,合肥市的购房者买房一定要三思而后行,货比三…</view>
  55. </view>
  56. </view>
  57. </block>
  58. <!-- 康养 -->
  59. <block v-if="type=='health'">
  60. <view class="healthlist flexc" v-for="(ite,idx) in datainfo" :key="idx">
  61. <view class="hlbox flex1">
  62. <view class="tit overtwo">吃粗粮能够降血脂吗?这三种吃法让血糖不降反增</view>
  63. <view class="flexc">
  64. <view class="txt">2024-11-14</view>
  65. <view class="flexc">
  66. <image :src="eye" class="eyeimg"></image>
  67. <view class="txt">1361</view>
  68. </view>
  69. </view>
  70. </view>
  71. <image :src="noiconpimg" class="hrimg"></image>
  72. </view>
  73. </block>
  74. <!-- 推荐商品 -->
  75. <view v-if="type=='goods'" class="goods flexcw">
  76. <view class="goodslist" v-for="(ite,idx) in datainfo" :key="idx">
  77. <image :src="noiconpimg" class="headimg"></image>
  78. <view class="glist">
  79. <view class="tit overtwo mb10">年货通用大米礼品包装盒新款五谷杂粮礼盒东北…</view>
  80. <view class="numbox flexc">
  81. <view class="num flex1"><text>¥</text>278</view>
  82. <view class="txt flex0">已售2000+</view>
  83. </view>
  84. </view>
  85. </view>
  86. </view>
  87. <view class="shax" v-if="wtdt">{{wtdt}}</view>
  88. </block>
  89. <!-- 无数据 -->
  90. <view class="nodata" v-else>
  91. <image :src="noiconpimg"></image>
  92. <view>暂无数据</view>
  93. </view>
  94. </view>
  95. </template>
  96. <script>
  97. import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
  98. import config from '@/config'
  99. export default{
  100. props:{
  101. datainfo: {
  102. type: Array,
  103. default () {
  104. return []
  105. }
  106. },
  107. wtdt:{
  108. type:String,
  109. default () {
  110. return ''
  111. }
  112. },
  113. wtdtfalg:{
  114. type:Boolean,
  115. default () {
  116. return true
  117. }
  118. },
  119. type:{
  120. type:String,
  121. default () {
  122. return 0
  123. }
  124. },
  125. },
  126. data(){
  127. return{
  128. noiconpimg:require("@/static/images/nodata.png"),
  129. yhbg:require("@/static/images/home/yhbg.png"),
  130. cirimg:require("@/static/images/home/cir.png"),
  131. deva:require("@/static/images/home/deva.png"),
  132. jfico:require("@/static/images/home/jfico.png"),
  133. eye:require("@/static/images/home/eye.png"),
  134. baseUrl:config.baseUrl,
  135. delBtnWidth:66,//左滑默认宽度
  136. }
  137. },
  138. mounted() {
  139. },
  140. methods:{
  141. checkPermi, checkRole,
  142. getDetail(e){
  143. this.$emit('getDetail',e)
  144. },
  145. getAddFn(e){
  146. this.$emit('getAddFn',e)
  147. },
  148. getReadlist(e){
  149. this.$emit('getReadlist',e)
  150. },
  151. getBtnFn(e){
  152. this.$emit('getBtnFn',e)
  153. },
  154. getZhan(idx){
  155. console.log(idx,1)
  156. // var obj=JSON.parse(JSON.stringify(this.datainfo))[idx]
  157. // obj.zhanflag=!obj.zhanflag;
  158. // this.datainfo.splice(idx,1,obj);
  159. this.datainfo[idx].zhanflag=!this.datainfo[idx].zhanflag
  160. },
  161. getPreview(idx,arr) {
  162. var newArr=[];
  163. arr.forEach(ite=>{
  164. var ds=this.baseUrl+ite
  165. newArr.push(ds)
  166. })
  167. uni.previewImage({
  168. urls: newArr,
  169. current:idx,
  170. success: function(data) {},
  171. fail: function(err) {}
  172. });
  173. },
  174. }
  175. }
  176. </script>
  177. <style lang="scss" scoped>
  178. .flex{display: flex;}
  179. .flexc{display: flex;align-items: center;}
  180. .mb10{margin-bottom: 20rpx;}
  181. .kdlists{background: #FFFFFF;box-shadow: 0px 0px 8rpx 0px #CDCDCD;border-radius: 20rpx;margin-bottom: 24rpx;
  182. .kdll{background: #E4EDFF;width: 220rpx;border-radius:20rpx 0 0 20rpx;flex: 0 0 auto;height: 160rpx;position: relative;padding: 30rpx 0 0 24rpx;
  183. .limg{width: 42rpx;height: 42rpx;position: absolute;right: 20rpx;top: 24rpx;}
  184. }
  185. .tit{font-weight: 500;font-size: 24rpx;color: #000000;margin-bottom: 8rpx;}
  186. .time{font-weight: 500;font-size:20rpx;color: #AAAAAA;}
  187. .kdlr{flex: 1;height: 160rpx;padding-left: 20rpx;padding-top: 30rpx;display: flex;
  188. .limg{width: 24rpx;height: 24rpx;margin-right: 16rpx;flex: 0 0 auto;margin-top: 5rpx;}
  189. .txt{font-size: 26rpx;font-weight: 500;color: #000000;margin-bottom: 6rpx;}
  190. }
  191. }
  192. //优惠券
  193. .coubox{display: flex;flex-wrap: nowrap;overflow: auto;padding-left: 24rpx;}
  194. .coulists{width:524rpx;height: 156rpx;margin-right: 24rpx;
  195. position: relative;
  196. .yhbg{position: absolute;left: 0;top: 0;width:524rpx;height: 156rpx;z-index: 0;}
  197. .coulist{width:100%;height: 100%;z-index: 1;
  198. .cltl{width: 156rpx;flex: 0 0 auto;
  199. .tit{font-weight: bold;font-size: 44rpx;color: #FE5A0E;margin-bottom: 2rpx;
  200. text{font-size: 24rpx;}
  201. }
  202. .txt{font-weight: bold;font-size: 20rpx;color: #979797;}
  203. }
  204. .line{width: 2rpx;height: 80rpx;background: #ECD19D;flex: 0 0 auto;}
  205. .cltr{height: 156rpx;padding:24rpx 20rpx 0 16rpx;
  206. .tit{font-size: 28rpx;color: #272727;font-weight: bold;padding-left: 2rpx;margin-bottom: 26rpx;}
  207. .btns{display: flex;align-items: center;
  208. .jfimg{width: 28rpx;height: 28rpx;margin-right: 10rpx;flex: 0 0 auto;}
  209. .txt{font-size: 40rpx;color: #FE5A0E;font-weight: bold;flex: 1;
  210. text{margin-left: 12rpx;font-size: 24rpx;}
  211. }
  212. .btn{min-width: 92rpx;font-weight: bold;font-size: 24rpx;color: #FFFFFF;height:42rpx;background: linear-gradient(129deg, #FFB132, #FE5A0E);border-radius: 11px;}
  213. }
  214. }
  215. }
  216. }
  217. // 资讯
  218. .newslists{border-bottom: 2rpx solid #E5E5E5;padding: 30rpx 0;
  219. .newsll{width: 136rpx;height: 136rpx;border-radius: 24rpx;margin-right: 22rpx;flex: 0 0 auto;}
  220. .newslr{
  221. .tit{font-size: 26rpx;color: #272727;font-weight: bold;}
  222. .num{font-weight: 500;font-size:22rpx;color: #666666;margin-left: 24rpx;flex: 0 0 auto;
  223. image{width: 24rpx;height: 18rpx;margin-right: 10rpx;}
  224. }
  225. .txt{font-weight: 500;font-size: 24rpx;color: #8F8F8F;line-height: 36rpx;}
  226. }
  227. }
  228. // 康养
  229. .healthlist{
  230. padding:26rpx 22rpx;border-bottom: 2rpx solid #E5E5E5;
  231. .hlbox{
  232. .tit{font-weight: bold;font-size: 28rpx;color: #272727;line-height:48rpx;margin-bottom: 10rpx;}
  233. .txt{font-weight: 500;line-height: 36rpx;font-size: 22rpx;color: #AAAAAA;}
  234. .eyeimg{width: 24rpx;height: 18rpx;margin-right: 10rpx;margin-left: 34rpx;}
  235. }
  236. .hrimg{width: 210rpx;height: 138rpx;flex: 0 0 auto;margin-left: 36rpx;}
  237. }
  238. // 商品
  239. .goods{padding: 0 8rpx;align-items: stretch;
  240. .goodslist{width: 334rpx;min-height: 472rpx;background: #FFFFFF;box-shadow: 0px 0px 18rpx 0px #DADADA;border-radius: 20rpx;border: 2rpx solid #DADADA;margin: 0 16rpx 20rpx;padding-bottom: 8rpx;box-sizing: border-box;
  241. .headimg{height: 298rpx;width: 100%;margin-bottom: 18rpx;}
  242. .glist{padding: 0 12rpx;}
  243. .tit{font-weight: bold;font-size: 28rpx;color: #272727;}
  244. .numbox{
  245. .num{font-size: 40rpx;color: #FE5A0E;font-weight: bold;word-break: break-all;
  246. text{font-size: 20rpx;}
  247. }
  248. }
  249. .txt{font-weight: bold;font-size: 24rpx;color: #AAAAAA;}
  250. }
  251. }
  252. // 无数据
  253. .nodata{display: flex;flex-direction: column;align-items: center;
  254. image{width: 440rpx;height: 440rpx;}
  255. view{font-size: 30rpx;color: #666666;font-weight: bold;}
  256. }
  257. </style>