list.vue 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  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. topval:{
  126. type:String,
  127. default () {
  128. return ''
  129. }
  130. }
  131. },
  132. data(){
  133. return{
  134. noiconpimg:require("@/static/images/nodata.png"),
  135. yhbg:require("@/static/images/home/yhbg.png"),
  136. cirimg:require("@/static/images/home/cir.png"),
  137. deva:require("@/static/images/home/deva.png"),
  138. jfico:require("@/static/images/home/jfico.png"),
  139. eye:require("@/static/images/home/eye.png"),
  140. baseUrl:config.baseUrl,
  141. delBtnWidth:66,//左滑默认宽度
  142. }
  143. },
  144. mounted() {
  145. },
  146. methods:{
  147. checkPermi, checkRole,
  148. getDetail(e){
  149. this.$emit('getDetail',e)
  150. },
  151. getAddFn(e){
  152. this.$emit('getAddFn',e)
  153. },
  154. getReadlist(e){
  155. this.$emit('getReadlist',e)
  156. },
  157. getBtnFn(e){
  158. this.$emit('getBtnFn',e)
  159. },
  160. getZhan(idx){
  161. console.log(idx,1)
  162. // var obj=JSON.parse(JSON.stringify(this.datainfo))[idx]
  163. // obj.zhanflag=!obj.zhanflag;
  164. // this.datainfo.splice(idx,1,obj);
  165. this.datainfo[idx].zhanflag=!this.datainfo[idx].zhanflag
  166. },
  167. getPreview(idx,arr) {
  168. var newArr=[];
  169. arr.forEach(ite=>{
  170. var ds=this.baseUrl+ite
  171. newArr.push(ds)
  172. })
  173. uni.previewImage({
  174. urls: newArr,
  175. current:idx,
  176. success: function(data) {},
  177. fail: function(err) {}
  178. });
  179. },
  180. }
  181. }
  182. </script>
  183. <style lang="scss" scoped>
  184. .flex{display: flex;}
  185. .flexc{display: flex;align-items: center;}
  186. .mb10{margin-bottom: 20rpx;}
  187. .kdlists{background: #FFFFFF;box-shadow: 0px 0px 8rpx 0px #CDCDCD;border-radius: 20rpx;margin-bottom: 24rpx;
  188. .kdll{background: #E4EDFF;width: 220rpx;border-radius:20rpx 0 0 20rpx;flex: 0 0 auto;height: 160rpx;position: relative;padding: 30rpx 0 0 24rpx;
  189. .limg{width: 42rpx;height: 42rpx;position: absolute;right: 20rpx;top: 24rpx;}
  190. }
  191. .tit{font-weight: 500;font-size: 24rpx;color: #000000;margin-bottom: 8rpx;}
  192. .time{font-weight: 500;font-size:20rpx;color: #AAAAAA;}
  193. .kdlr{flex: 1;height: 160rpx;padding-left: 20rpx;padding-top: 30rpx;display: flex;
  194. .limg{width: 24rpx;height: 24rpx;margin-right: 16rpx;flex: 0 0 auto;margin-top: 5rpx;}
  195. .txt{font-size: 26rpx;font-weight: 500;color: #000000;margin-bottom: 6rpx;}
  196. }
  197. }
  198. //优惠券
  199. .coubox{display: flex;flex-wrap: nowrap;overflow: auto;padding-left: 24rpx;}
  200. .coulists{width:524rpx;height: 156rpx;margin-right: 24rpx;
  201. position: relative;
  202. .yhbg{position: absolute;left: 0;top: 0;width:524rpx;height: 156rpx;z-index: 0;}
  203. .coulist{width:100%;height: 100%;z-index: 1;
  204. .cltl{width: 156rpx;flex: 0 0 auto;
  205. .tit{font-weight: bold;font-size: 44rpx;color: #FE5A0E;margin-bottom: 2rpx;
  206. text{font-size: 24rpx;}
  207. }
  208. .txt{font-weight: bold;font-size: 20rpx;color: #979797;}
  209. }
  210. .line{width: 2rpx;height: 80rpx;background: #ECD19D;flex: 0 0 auto;}
  211. .cltr{height: 156rpx;padding:24rpx 20rpx 0 16rpx;
  212. .tit{font-size: 28rpx;color: #272727;font-weight: bold;padding-left: 2rpx;margin-bottom: 26rpx;}
  213. .btns{display: flex;align-items: center;
  214. .jfimg{width: 28rpx;height: 28rpx;margin-right: 10rpx;flex: 0 0 auto;}
  215. .txt{font-size: 40rpx;color: #FE5A0E;font-weight: bold;flex: 1;
  216. text{margin-left: 12rpx;font-size: 24rpx;}
  217. }
  218. .btn{min-width: 92rpx;font-weight: bold;font-size: 24rpx;color: #FFFFFF;height:42rpx;background: linear-gradient(129deg, #FFB132, #FE5A0E);border-radius: 11px;}
  219. }
  220. }
  221. }
  222. }
  223. // 资讯
  224. .newslists{border-bottom: 2rpx solid #E5E5E5;padding: 30rpx 0;
  225. .newsll{width: 136rpx;height: 136rpx;border-radius: 24rpx;margin-right: 22rpx;flex: 0 0 auto;}
  226. .newslr{
  227. .tit{font-size: 26rpx;color: #272727;font-weight: bold;}
  228. .num{font-weight: 500;font-size:22rpx;color: #666666;margin-left: 24rpx;flex: 0 0 auto;
  229. image{width: 24rpx;height: 18rpx;margin-right: 10rpx;}
  230. }
  231. .txt{font-weight: 500;font-size: 24rpx;color: #8F8F8F;line-height: 36rpx;}
  232. }
  233. }
  234. // 康养
  235. .healthlist{
  236. padding:26rpx 22rpx;border-bottom: 2rpx solid #E5E5E5;
  237. .hlbox{
  238. .tit{font-weight: bold;font-size: 28rpx;color: #272727;line-height:48rpx;margin-bottom: 10rpx;}
  239. .txt{font-weight: 500;line-height: 36rpx;font-size: 22rpx;color: #AAAAAA;}
  240. .eyeimg{width: 24rpx;height: 18rpx;margin-right: 10rpx;margin-left: 34rpx;}
  241. }
  242. .hrimg{width: 210rpx;height: 138rpx;flex: 0 0 auto;margin-left: 36rpx;}
  243. }
  244. // 商品
  245. .goods{padding: 0 8rpx;align-items: stretch;
  246. .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;
  247. .headimg{height: 298rpx;width: 100%;margin-bottom: 18rpx;}
  248. .glist{padding: 0 12rpx;}
  249. .tit{font-weight: bold;font-size: 28rpx;color: #272727;}
  250. .numbox{
  251. .num{font-size: 40rpx;color: #FE5A0E;font-weight: bold;word-break: break-all;
  252. text{font-size: 20rpx;}
  253. }
  254. }
  255. .txt{font-weight: bold;font-size: 24rpx;color: #AAAAAA;}
  256. }
  257. }
  258. // 无数据
  259. .nodata{display: flex;flex-direction: column;align-items: center;
  260. image{width: 440rpx;height: 440rpx;}
  261. view{font-size: 30rpx;color: #666666;font-weight: bold;}
  262. }
  263. </style>