overlord-meal.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. <template>
  2. <view class="coupon-page">
  3. <u-sticky bgColor="#fff" class="tabs-wrap">
  4. <u-tabs class="tabs" :list="tabs" :itemStyle="itemStyle" :is-scroll="false" :current="active" :activeStyle="{ color: '#1A78F6' }" @change="handTabchange">
  5. </u-tabs>
  6. </u-sticky>
  7. <view class="list-wrap">
  8. <view class="item" v-for="item in lists" :key="item.dineAndDashId" @click="activityInfo(item)">
  9. <view class="icon">
  10. <image class="img" src="../../static/imgs/mine/tjc.png"/>
  11. </view>
  12. <view class="cont">
  13. <view class="row">
  14. <view class="name">{{item.title}}</view>
  15. <view class="date">{{item.startDate|formatDate('MM.dd')}} - {{item.endDate|formatDate('MM.dd')}}</view>
  16. <view class="status-doing" v-if="item.status == 1">进行中{{item.join == 1 ? '(已参加)' : '(未参加)'}}</view>
  17. <view v-else-if="item.status==-1">已失效{{item.join == 1 ? '(已参加)' : '(未参加)'}}</view>
  18. <view class="status-nostart" v-else>未开始{{item.join == 1 ? '(已参加)' : '(未参加)'}}</view>
  19. </view>
  20. <view class="row desc-row">
  21. <view class="desc-title">活动描述</view>
  22. <view class="desc-text">最低总价{{moneyConverter(item.activityPrice)}}/最低单价{{moneyConverter(item.price)}}/活动达标金额{{moneyConverter(item.reachPrice)}}</view>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. </template>
  29. <script>
  30. import {mapState} from 'vuex';
  31. export default {
  32. data () {
  33. return {
  34. getDineAndDashListForStoreUrl: '/dineAndDashActivityApi/getDineAndDashListForStore',
  35. modalTitle: '活动名称',
  36. active: 0,
  37. itemStyle: {
  38. width: '50vw',
  39. height: '80rpx'
  40. },
  41. tabs: [
  42. {
  43. name: '进行中'
  44. },
  45. {
  46. name: '已失效'
  47. }
  48. ],
  49. lists: []
  50. }
  51. },
  52. computed: {
  53. ...mapState(['storeInfo'])
  54. },
  55. methods: {
  56. handTabchange(e) {
  57. this.active = e.index;
  58. this.getDataList();
  59. },
  60. getDataList() {
  61. uni.showLoading({
  62. title: '加载中'
  63. });
  64. var dateStr = (new Date()).getTime();
  65. var sign = this.getSign('' + this.active + dateStr);
  66. this.requst({
  67. url: this.getDineAndDashListForStoreUrl,
  68. data: {
  69. timestamp: dateStr,
  70. sign: sign,
  71. type: this.active,
  72. storeId: this.storeInfo.storeId
  73. },
  74. success: res => {
  75. this.lists = res.data.list;
  76. uni.hideLoading();
  77. },
  78. fail: (e) => {
  79. console.log("接口调用失败:" + JSON.stringify(e));
  80. uni.hideLoading();
  81. },
  82. })
  83. },
  84. activityInfo(item) {
  85. uni.navigateTo({
  86. url: `/pages/activity/overlord-meal-detail?id=${item.dineAndDashId || ''}`
  87. })
  88. }
  89. },
  90. onLoad () {
  91. this.getDataList();
  92. }
  93. }
  94. </script>
  95. <style lang="scss" scoped>
  96. .coupon-page {
  97. width: 100vw;
  98. height: 100vh;
  99. background-color: #f5f5f5;
  100. border-top: 2rpx solid #f5f5f5;
  101. }
  102. .status-doing {
  103. color: red;
  104. }
  105. .status-nostart {
  106. color: #1A78F6;
  107. }
  108. .list-wrap {
  109. height: calc(100vh - 80rpx - 20rpx);
  110. overflow-y: auto;
  111. margin-top: 18rpx;
  112. .item {
  113. @include flexStart;
  114. padding: 40rpx 20rpx;
  115. box-sizing: border-box;
  116. margin-bottom: 20rpx;
  117. background-color: #fff;
  118. font-size: $font-base;
  119. }
  120. .icon {
  121. min-width: 52rpx;
  122. width: 52rpx;
  123. height: 52rpx;
  124. margin-right: 40rpx;
  125. .img {
  126. width: 52rpx;
  127. height: 52rpx;
  128. }
  129. }
  130. .cont {
  131. width: calc(100% - 92rpx);
  132. }
  133. .row {
  134. @include between;
  135. }
  136. .desc-row {
  137. @include between(flex-start);
  138. margin-top: 20rpx;
  139. color: $desc-color;
  140. }
  141. .desc-title {
  142. width: 180rpx;
  143. }
  144. .btn {
  145. padding: 6rpx 20rpx;
  146. background-color: $theme-color;
  147. color: #fff;
  148. border-radius: 10rpx;
  149. }
  150. }
  151. /deep/ .u-modal__content {
  152. padding: 20rpx !important;
  153. }
  154. .container {
  155. width: 100%;
  156. padding: 40rpx 20rpx;
  157. box-sizing: border-box;
  158. .item {
  159. width: 100%;
  160. height: 80rpx;
  161. @include between;
  162. border-bottom: 2rpx solid #f5f5f5;
  163. }
  164. .value {
  165. @include flexEnd;
  166. flex: 1;
  167. }
  168. .text {
  169. margin-left: 20rpx;
  170. }
  171. }
  172. .modal-container {
  173. padding: 20rpx 40rpx 0;
  174. box-sizing: border-box;
  175. .title {
  176. height: 60rpx;
  177. @include flexCenter;
  178. }
  179. .search-wrap {
  180. width: 100%;
  181. @include flexCenter;
  182. border: 2rpx solid $theme-color;
  183. color: $theme-color;
  184. font-size: $font-base;
  185. padding-left: 20rpx;
  186. box-sizing: border-box;
  187. margin-bottom: 20rpx;
  188. .btn {
  189. width: 128rpx;
  190. height: 60rpx;
  191. @include flexCenter;
  192. border-left: 2rpx solid $theme-color;
  193. }
  194. .input-wrap {
  195. flex: 1;
  196. /deep/ .u-input {
  197. width: 100%;
  198. }
  199. }
  200. }
  201. .goods-list {
  202. height: 50vh;
  203. margin-top: 20rpx;
  204. .item {
  205. margin-bottom: 20rpx;
  206. @include flexStart;
  207. }
  208. .cover {
  209. width: 120rpx;
  210. height: 120rpx;
  211. border-radius: 10rpx;
  212. margin-right: 20rpx;
  213. .img {
  214. width: 120rpx;
  215. height: 120rpx;
  216. }
  217. }
  218. .cont {
  219. font-size: $font-base;
  220. .goods-name {
  221. width: 100%;
  222. text-overflow: -o-ellipsis-lastline;
  223. overflow: hidden;
  224. text-overflow: ellipsis;
  225. display: -webkit-box;
  226. -webkit-line-clamp: 2;
  227. -webkit-box-orient: vertical;
  228. color: $text-color;
  229. }
  230. .desc {
  231. color: $desc-color;
  232. }
  233. }
  234. }
  235. }
  236. </style>