nx-coupon.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604
  1. <template>
  2. <view class="coupon-item" @tap="selectCoupon">
  3. <view class="coupon_index" >
  4. <view class="coupon_indexs">
  5. <view class="coupon_index_1">
  6. <view class="coupon_index_2">
  7. <view class="coupon_index_3">{{item.typetitle}}</view>
  8. <view class="coupon_index_4">
  9. <view class="coupon_index_4_1">¥{{ item.money }}</view>
  10. <view class="coupon_index_5">满元{{ item.usemoney }}可用</view>
  11. </view>
  12. </view>
  13. <view>
  14. <u-line color="gray" direction="col" length="100%" dashed></u-line>
  15. </view>
  16. <view class="coupon_index_6">
  17. <view class="coupon_index_8">
  18. <view class="coupon_index_8_1">优惠券</view>
  19. <view class="coupon_index_9">领取{{ item.day }}日内有效</view>
  20. </view>
  21. </view>
  22. </view>
  23. <u-line color="#939393" margin="25rpx 10rpx 0 0" ></u-line>
  24. <view class="coupon_index_10" >
  25. <image :src="item.farm_logo"></image>
  26. <view class="coupon_index_10_1">{{item.farm_name}}</view>
  27. </view>
  28. </view>
  29. <view class="coupon_index_11">
  30. <text v-if="item.status===1" @click="gouse(item.type)"> 立 即 使 用</text>
  31. <text v-if="item.status===2">已 使 用</text>
  32. <text v-if="item.status===3">已 过 期</text>
  33. <!-- <view @click.stop="!isover?gouse(item):''" >
  34. {{isover?(item.status==2?'已使用':'已过期'):'立即 使用'}}
  35. </view> -->
  36. </view>
  37. <!-- <view class="coupon_index_11 " v-if="item.status === 0" @click="getcoupon(item.id)">
  38. <text class="coupon_index_11_1"> 立 即 领 取</text>
  39. </view>
  40. <view v-else class="coupon_index_11" >
  41. <text class="coupon_index_11_1"> 已 领 取</text>
  42. </view>
  43. <!-- <view class="coupon_item_jin" ></view> -->
  44. </view>
  45. <!-- <view class="box-con">
  46. <view :class="'box-text'+(!isover?item.type:'')" v-if="item.type==2">商城</view>
  47. <view :class="'box-text'+(!isover?item.type:'')" v-else-if="item.type==3">认养</view>
  48. <view :class="'box-text'+(!isover?item.type:'')" v-else-if="item.type==4">通用</view>
  49. </view> -->
  50. <!-- <view class="coupon-money">
  51. <view class="nick" v-if="!types">ID:{{item.cardno}}</view>
  52. <view class="layof" :style="{color:theme}">¥{{item.money}}</view>
  53. <view class="end_time">{{item.etime}}前使用</view>
  54. <view v-if="!types">
  55. <view class="demand">{{item.title}}</view>
  56. </view>
  57. <view style="padding: 4px 0;text-decoration:underline;" class="demand" @click.stop="gotoDetails()">
  58. 使用规则:满{{item.usemoney}}元,{{item.type==2?'商城':''}}{{item.type==3?'认养':''}}{{item.type==4?'全场':''}}可使用
  59. </view>
  60. </view> -->
  61. <!-- <view style="z-index: 9;">
  62. <view v-if="isShowCheck">
  63. <checkbox class='round orange' :disabled="item.disable" :class="item.checked?'checked':''"
  64. :checked="item.checked?true:false">
  65. </checkbox>
  66. </view>
  67. <view v-else>
  68. <view @click.stop="!isover?gouse(item):''" :class="!isover?'get-btn':'get-btn1'"
  69. :style="{background:solid}">
  70. {{isover?(item.status==2?'已使用':'已过期'):'去使用'}}
  71. </view>
  72. </view>
  73. </view> -->
  74. </view>
  75. </template>
  76. <script>
  77. import { object } from '../../js/underscore';
  78. export default {
  79. components: {
  80. },
  81. data() {
  82. return {
  83. }
  84. },
  85. props: {
  86. index: {
  87. type: Number,
  88. default: 0
  89. },
  90. // 是否有勾选框
  91. isShowCheck: {
  92. type: Boolean,
  93. default: false
  94. },
  95. item: {
  96. type: Object
  97. },
  98. types: {
  99. type: String,
  100. default: ''
  101. },
  102. theme: {
  103. type: String,
  104. default: '#FF4A26'
  105. },
  106. solid: {
  107. type: String,
  108. default: '#ffffff'
  109. },
  110. color: {
  111. type: String,
  112. default: '#FF4A26'
  113. },
  114. isover: {
  115. type: Boolean,
  116. default: false
  117. },
  118. site:{
  119. type:Object
  120. }
  121. },
  122. methods: {
  123. gouse(item) {
  124. if(item==2){
  125. uni.switchTab({
  126. url: '/pages/mall/mall'
  127. })
  128. }else if(item==3){
  129. uni.switchTab({
  130. url: '/pages/index/adoplist/adoplist'
  131. })
  132. }else if(item==4){
  133. uni.switchTab({
  134. url: '/pages/land/land'
  135. })
  136. }
  137. },
  138. // 查看优惠券使用范围
  139. gotoDetails() {
  140. console.log('优惠券使用范围')
  141. },
  142. selectCoupon() {
  143. let that = this;
  144. if (that.isShowCheck) {
  145. that.$bus.$emit('updateChecked', that.index);
  146. }
  147. }
  148. }
  149. }
  150. </script>
  151. <style lang='scss'>
  152. .coupon-item {
  153. /* height: auto; */
  154. /* height: 131px; */
  155. /* display: table; */
  156. border-radius: 20rpx;
  157. /* padding: 0 30upx; */
  158. /* padding: 15px 5px 15px 15px; */
  159. margin-top: 20rpx;
  160. /* border: 1px solid #FFFFFF; */
  161. /* position: relative; */
  162. background-color: #fff;
  163. .coupon_index {
  164. display: flex;
  165. justify-content: space-between;
  166. background-color: #ffffff;
  167. border-radius: 20rpx;
  168. .coupon_indexs {
  169. display: flex;
  170. flex-direction:column;
  171. width: 95%;
  172. .coupon_index_1 {
  173. display: flex;
  174. justify-content: flex-start;
  175. .coupon_index_2 {
  176. width: 13vh;
  177. .coupon_index_3 {
  178. background-color: lightcoral;
  179. width: 6vh;
  180. text-align: center;
  181. border-top-left-radius: 20rpx;
  182. border-bottom-right-radius: 25rpx;
  183. line-height: 40rpx;
  184. color: #fff;
  185. font-size: 25rpx;
  186. }
  187. .coupon_index_4 {
  188. align-items: center;
  189. text-align: center;
  190. .coupon_index_4_1 {
  191. font-size: 50rpx;
  192. color: red;
  193. font-weight: 600;
  194. padding: 10rpx 0;
  195. }
  196. .coupon_index_5 {
  197. font-size: 30rpx;
  198. color: indianred;
  199. }
  200. }
  201. }
  202. .coupon_index_6 {
  203. width: 25vh;
  204. .coupon_index_7 {
  205. background-color: brown;
  206. line-height: 40rpx;
  207. width: 10vh;
  208. text-align: center;
  209. font-size: 24rpx;
  210. color: #fff;
  211. border-radius: 40rpx;
  212. float: right;
  213. margin-top: 20rpx;
  214. margin-bottom: 30rpx;
  215. }
  216. .coupon_index_8 {
  217. margin-left: 1vh;
  218. .coupon_index_8_1 {
  219. font-size: 35rpx;
  220. font-weight: 600;
  221. padding: 90rpx 0 30rpx 0;
  222. }
  223. .coupon_index_9 {
  224. font-size: 26rpx;
  225. color: #939393;
  226. }
  227. }
  228. }
  229. }
  230. }
  231. .coupon_index_10{
  232. display: flex;
  233. justify-content: flex-start;
  234. text-align: center;
  235. align-items: center;
  236. padding: 10rpx;
  237. image{
  238. width: 50rpx;
  239. height: 50rpx;
  240. border-radius: 50%;
  241. }
  242. .coupon_index_10_1{
  243. padding: 0 10rpx;
  244. color: #939393;
  245. font-size: 26rpx;
  246. }
  247. }
  248. .coupon_index_11{
  249. position: relative;
  250. background-color: limegreen;
  251. border-top-right-radius: 20rpx;
  252. border-bottom-right-radius: 20rpx;
  253. display: flex;
  254. width:5vh;
  255. min-height: 20px;
  256. padding: 6px 0 6px 20px;
  257. color: #fff;
  258. align-items: center;
  259. text-align: center;
  260. text{
  261. writing-mode : tb-rl;
  262. color: #fff;
  263. text-align: center;
  264. }
  265. }
  266. .coupon_index_11::before {
  267. content: ' ';
  268. width: 0;
  269. height: 100%;
  270. width: 0;
  271. position: absolute;
  272. border-right: 6px dotted white;
  273. top: 0;
  274. left: -3px;
  275. }
  276. /* // .coupon_index_11::after {
  277. // content: ' ';
  278. // height: 100%;
  279. // position: absolute;
  280. // border-left: 6px dotted white;
  281. // top: 0;
  282. // right: -3px;
  283. // }
  284. }
  285. .box-con {
  286. width: 85px;
  287. height: 88px;
  288. overflow: hidden;
  289. position: absolute;
  290. top: -3px;
  291. right: -3px;
  292. z-index: 1;
  293. }
  294. .box-text {
  295. color: white;
  296. text-align: center;
  297. -webkit-transform: rotate(45deg);
  298. -moz-transform: rotate(45deg);
  299. -ms-transform: rotate(45deg);
  300. -o-transform: rotate(45deg);
  301. position: relative;
  302. padding: 2px 0;
  303. left: 37px;
  304. top: 4px;
  305. width: 65px;
  306. background-color: #eeeeee;
  307. background-image: -webkit-gradient(linear, left top, left bottom, from(#eeeeee), to(#eeeeee));
  308. background-image: -webkit-linear-gradient(top, #eeeeee, #eeeeee);
  309. background-image: -moz-linear-gradient(top, #eeeeee, #eeeeee);
  310. background-image: -ms-linear-gradient(top, #eeeeee, #eeeeee);
  311. background-image: -o-linear-gradient(top, #eeeeee, #eeeeee);
  312. -webkit-box-shadow: 0px 0px 3px #eeeeee;
  313. -moz-box-shadow: 0px 0px 3px #eeeeee;
  314. box-shadow: 0px 0px 3px #eeeeee;
  315. }
  316. .box-text2 {
  317. color: white;
  318. text-align: center;
  319. -webkit-transform: rotate(45deg);
  320. -moz-transform: rotate(45deg);
  321. -ms-transform: rotate(45deg);
  322. -o-transform: rotate(45deg);
  323. position: relative;
  324. padding: 2px 0;
  325. left: 37px;
  326. top: 4px;
  327. width: 65px;
  328. background-color: #76c500;
  329. background-image: -webkit-gradient(linear, left top, left bottom, from(#76c500), to(#76c500));
  330. background-image: -webkit-linear-gradient(top, #76c500, #76c500);
  331. background-image: -moz-linear-gradient(top, #76c500, #76c500);
  332. background-image: -ms-linear-gradient(top, #76c500, #76c500);
  333. background-image: -o-linear-gradient(top, #76c500, #76c500);
  334. -webkit-box-shadow: 0px 0px 3px #76c500;
  335. -moz-box-shadow: 0px 0px 3px #76c500;
  336. box-shadow: 0px 0px 3px #76c500;
  337. }
  338. .box-text2:before,
  339. .box-text2:after {
  340. content: "";
  341. position: absolute;
  342. bottom: -3px;
  343. }
  344. .box-text2:before {
  345. left: 0;
  346. }
  347. .box-text2:after {
  348. right: 0;
  349. }
  350. .box-text3 {
  351. color: white;
  352. text-align: center;
  353. -webkit-transform: rotate(45deg);
  354. -moz-transform: rotate(45deg);
  355. -ms-transform: rotate(45deg);
  356. -o-transform: rotate(45deg);
  357. position: relative;
  358. padding: 2px 0;
  359. left: 37px;
  360. top: 4px;
  361. width: 65px;
  362. background-color: #ff1b40;
  363. background-image: -webkit-gradient(linear, left top, left bottom, from(#ff503e), to(#ff2f50));
  364. background-image: -webkit-linear-gradient(top, #ff503e, #ff2f50);
  365. background-image: -moz-linear-gradient(top, #ff503e, #ff2f50);
  366. background-image: -ms-linear-gradient(top, #ff503e, #ff2f50);
  367. background-image: -o-linear-gradient(top, #ff503e, #ff2f50);
  368. -webkit-box-shadow: 0px 0px 3px #ff1b40;
  369. -moz-box-shadow: 0px 0px 3px #ff1b40;
  370. box-shadow: 0px 0px 3px #ff1b40;
  371. }
  372. .box-text3:before,
  373. .box-text3:after {
  374. content: "";
  375. position: absolute;
  376. bottom: -3px;
  377. }
  378. .box-text3:before {
  379. left: 0;
  380. }
  381. .box-text3:after {
  382. right: 0;
  383. }
  384. .box-text4 {
  385. color: white;
  386. text-align: center;
  387. -webkit-transform: rotate(45deg);
  388. -moz-transform: rotate(45deg);
  389. -ms-transform: rotate(45deg);
  390. -o-transform: rotate(45deg);
  391. position: relative;
  392. padding: 2px 0;
  393. left: 37px;
  394. top: 4px;
  395. width: 65px;
  396. background-color: #aa55ff;
  397. background-image: -webkit-gradient(linear, left top, left bottom, from(#aa55ff), to(#aa55ff));
  398. background-image: -webkit-linear-gradient(top, #aa55ff, #aa55ff);
  399. background-image: -moz-linear-gradient(top, #aa55ff, #aa55ff);
  400. background-image: -ms-linear-gradient(top, #aa55ff, #aa55ff);
  401. background-image: -o-linear-gradient(top, #aa55ff, #aa55ff);
  402. -webkit-box-shadow: 0px 0px 3px #aa55ff;
  403. -moz-box-shadow: 0px 0px 3px #aa55ff;
  404. box-shadow: 0px 0px 3px #aa55ff;
  405. }
  406. .box-text4:before,
  407. .box-text4:after {
  408. content: "";
  409. position: absolute;
  410. bottom: -3px;
  411. }
  412. .box-text4:before {
  413. left: 0;
  414. }
  415. .box-text4:after {
  416. right: 0;
  417. }
  418. .coupon-money {
  419. width: 465upx;
  420. height: auto;
  421. /* display: table;
  422. */
  423. /* float: left; */
  424. /* text-align: left;
  425. padding: 26upx 0;
  426. border-style: none dotted none none;
  427. border-color: #eeeeee; */
  428. /* .nick {
  429. width: 100%;
  430. height: 50upx;
  431. line-height: 30upx;
  432. font-size: $uni-font-size-sm;
  433. color: $uni-text-color-grey;
  434. }
  435. */
  436. /* .tit {
  437. width: 100%;
  438. height: 50upx;
  439. line-height: 50upx;
  440. font-size: $uni-font-size-sm;
  441. color: $uni-text-color-grey;
  442. } */
  443. /* .demand {
  444. width: 100%;
  445. height: 30upx;
  446. line-height: 30upx;
  447. font-size: $uni-font-size-sm;
  448. color: $uni-text-color-grey;
  449. } */
  450. /* .layof {
  451. width: 100%;
  452. height: 48upx;
  453. line-height: 30upx;
  454. font-size: 44upx;
  455. color: #FF4A26;
  456. font-weight: bold;
  457. } */
  458. /* .end_time {
  459. width: 100%;
  460. height: 30upx;
  461. line-height: 30upx;
  462. font-size: $uni-font-size-sm;
  463. color: $uni-text-color-grey;
  464. } */
  465. }
  466. /* .get-btn {
  467. width: 146upx;
  468. height: 52upx;
  469. line-height: 50upx;
  470. z-index: 99999999999999999;
  471. /* position: absolute;
  472. top: 50%;
  473. right: 20upx; */
  474. /* margin-top: -26upx;
  475. text-align: center;
  476. border-radius: 60upx;
  477. color: #FF4A26;
  478. border: 1px solid #FF4A26;
  479. font-size: $uni-font-size-sm; */
  480. /* float: right; */
  481. /* } */
  482. /* .get-btn1 {
  483. width: 146upx;
  484. height: 52upx;
  485. line-height: 50upx;
  486. z-index: 99999999999999999;
  487. margin-top: -26upx;
  488. text-align: center;
  489. border-radius: 60upx;
  490. color: #eeeeee;
  491. border: 1px solid #eeeeee;
  492. font-size: $uni-font-size-sm;
  493. } */
  494. }
  495. /* .coupon-item:after {
  496. width: 40upx;
  497. height: 20upx;
  498. position: absolute;
  499. left: 470upx;
  500. top: -1px;
  501. border-radius: 0 0 40upx 40upx;
  502. content: "";
  503. display: block;
  504. background: #F5F5F7;
  505. border: 1px solid #eeeeee;
  506. border-top: 0px;
  507. } */
  508. /* .coupon-item:before {
  509. width: 40upx;
  510. height: 20upx;
  511. position: absolute;
  512. left: 470upx;
  513. bottom: -1px;
  514. border-radius: 40upx 40upx 0 0;
  515. content: "";
  516. display: block;
  517. background: #F5F5F7;
  518. border: 1px solid #eeeeee;
  519. border-bottom: 0px;
  520. } */
  521. </style>