list.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311
  1. <template>
  2. <view class="content">
  3. <!-- 不同条件筛选 -->
  4. <view class="select">
  5. <view class="select_k" :class="selected == 0 ? 'selected' : ''" @click="selece(0)">全部</view>
  6. <view class="select_k" :class="selected == 1 ? 'selected' : ''" @click="selece(1)">已支付</view>
  7. <view class="select_k" :class="selected == 2 ? 'selected' : ''" @click="selece(2)">使用中</view>
  8. <view class="select_k" :class="selected == 3 ? 'selected' : ''" @click="selece(3)">已使用</view>
  9. <view class="select_k" :class="selected == 4 ? 'selected' : ''" @click="selece(4)">已过期</view>
  10. </view>
  11. <!-- 订单列表 -->
  12. <view class="order">
  13. <view class="order_l1">
  14. <view>已支付</view>
  15. <view style="font-size: 24rpx; font-weight: 400">2025-08-11 12:21:21</view>
  16. </view>
  17. <view class="order_line"></view>
  18. <view class="title title2" style="margin-top: 23rpx">
  19. <view class="cicle"></view>
  20. <view style="margin-left: 16rpx">创海便利店(二食堂1楼) 13267827921</view>
  21. </view>
  22. <view class="xiangnei" v-for="(item, index) in 2" :key="index">例假期每天一杯红糖姜茶</view>
  23. <!-- 订单数据 -->
  24. <view class="order_list">
  25. <view v-for="(item, index) in 7" :key="index" class="list_time">
  26. 2025-08-11 10:21:21
  27. <view style="margin-top: 5rpx; font-size: 24rpx">64874983774848987484</view>
  28. </view>
  29. </view>
  30. <!-- 按钮 -->
  31. <view class="button">
  32. <view class="button1">退款</view>
  33. <view class="button2" @click="bianji">编辑</view>
  34. </view>
  35. </view>
  36. <!-- 编辑时间弹框 -->
  37. <u-popup v-model="changeShow" mode="center" :closeable="true" border-radius="20">
  38. <view style="width: 700rpx">
  39. <view class="text-center text-lg text-bold padding-tb">编辑</view>
  40. <view class="popup-list">
  41. <view style="padding-top: 20rpx">第1笔</view>
  42. <view class="popup-yell">2025-08-11 10:21:21</view>
  43. <view style="padding-top: 20rpx">第2笔</view>
  44. <view class="popup-red">2025-08-11 10:21:21</view>
  45. <view style="padding-top: 20rpx">第3笔</view>
  46. <view class="custom-item">
  47. <view class="item-label">
  48. <uni-datetime-picker v-model="datetimerange" :border="false" type="datetimerange" rangeSeparator="~" />
  49. </view>
  50. <view class="item-value">
  51. <!-- 箭头图标,可使用 uni-app 内置图标或自定义图片 -->
  52. <uni-icons type="calendar" color="#000000" />
  53. </view>
  54. </view>
  55. <view style="padding-top: 20rpx">第4笔</view>
  56. <view class="custom-item">
  57. <view class="item-label">
  58. <uni-datetime-picker v-model="datetimerange" :border="false" type="datetimerange" rangeSeparator="~" />
  59. </view>
  60. <view class="item-value">
  61. <!-- 箭头图标,可使用 uni-app 内置图标或自定义图片 -->
  62. <uni-icons type="calendar" color="#000000" />
  63. </view>
  64. </view>
  65. <!-- 按钮 -->
  66. <view class="popup_butt">
  67. <view class="button3">取消</view>
  68. <view class="button4" @click="bianji">确定</view>
  69. </view>
  70. </view>
  71. </view>
  72. </u-popup>
  73. </view>
  74. </template>
  75. <script>
  76. export default {
  77. data() {
  78. return {
  79. selected: 0, //0全部,1已支付,2使用中,3已使用,4已过期
  80. changeShow: false,
  81. datetimerange: []
  82. }
  83. },
  84. onLoad() {
  85. this.getData()
  86. },
  87. methods: {
  88. getData() {
  89. let data = {
  90. page: 1,
  91. limit: 6
  92. }
  93. this.$Request.getT('/app/lover-set/page', data).then((res) => {
  94. console.log(res, 966)
  95. })
  96. },
  97. // 选择条件
  98. selece(e) {
  99. this.selected = e
  100. },
  101. //编辑时间
  102. bianji() {
  103. this.changeShow = true
  104. }
  105. }
  106. }
  107. </script>
  108. <style>
  109. .content {
  110. width: 100%;
  111. height: 100%;
  112. background-color: #f2f2f2;
  113. }
  114. /* 不同条件筛选 */
  115. .select {
  116. display: flex;
  117. width: 100%;
  118. height: 100%;
  119. }
  120. .select_k {
  121. margin: 20rpx 0 0 15rpx;
  122. width: 140rpx;
  123. height: 60rpx;
  124. opacity: 1;
  125. border-radius: 9rpx;
  126. background: #ffffff;
  127. font-size: 28rpx;
  128. line-height: 60rpx;
  129. color: rgba(128, 128, 128, 1);
  130. text-align: center;
  131. }
  132. .selected {
  133. font-weight: 700;
  134. color: rgba(255, 141, 26, 1);
  135. }
  136. /* 订单列表 */
  137. .order {
  138. margin: 30rpx 0 0 20rpx;
  139. width: 710rpx;
  140. height: 100%;
  141. opacity: 1;
  142. border-radius: 9rpx;
  143. background: #ffffff;
  144. }
  145. .order_l1 {
  146. display: flex;
  147. padding: 19rpx 19rpx 0 19rpx;
  148. /* 让子元素两端对齐,价格居左,按钮居右 */
  149. justify-content: space-between;
  150. /* 垂直方向居中(可选,根据需求调整) */
  151. align-items: center;
  152. font-size: 32rpx;
  153. font-weight: 500;
  154. color: rgba(0, 0, 0, 1);
  155. }
  156. .order_line {
  157. margin-top: 31rpx;
  158. width: 100%;
  159. height: 1rpx;
  160. opacity: 1;
  161. background-color: rgba(230, 230, 230, 1);
  162. }
  163. .title {
  164. margin: 13rpx 0 0 23rpx;
  165. font-size: 28rpx;
  166. font-weight: 500;
  167. color: rgba(0, 0, 0, 1);
  168. }
  169. .cicle {
  170. margin: 12rpx 0 0 0;
  171. width: 10rpx;
  172. height: 10rpx;
  173. background: #cccccc;
  174. border-radius: 50%;
  175. }
  176. .title2 {
  177. display: flex;
  178. }
  179. .xiangnei {
  180. width: 633rpx;
  181. display: flex;
  182. /* 让子元素两端对齐,价格居左,按钮居右 */
  183. justify-content: space-between;
  184. /* 垂直方向居中(可选,根据需求调整) */
  185. margin: 0 0 0 45rpx;
  186. padding-top: 10rpx;
  187. font-size: 24rpx;
  188. color: rgba(102, 102, 102, 1);
  189. }
  190. .order_list {
  191. display: flex;
  192. flex-wrap: wrap;
  193. width: 583rpx;
  194. height: 100%;
  195. /* 让子元素两端对齐,价格居左,按钮居右 */
  196. justify-content: space-between;
  197. /* 垂直方向居中(可选,根据需求调整) */
  198. margin: 10rpx 0 0 41rpx;
  199. font-size: 28rpx;
  200. font-weight: 400;
  201. color: rgba(0, 0, 0, 1);
  202. word-wrap: break-word;
  203. word-break: break-all;
  204. }
  205. .list_time {
  206. margin-top: 10rpx;
  207. width: 260rpx;
  208. height: 71rpx;
  209. /* 核心属性:强制文字在一行显示,不自动换行 */
  210. white-space: nowrap;
  211. }
  212. /* 按钮 */
  213. .button {
  214. display: flex;
  215. margin: 39rpx 0 0 278rpx;
  216. height: 100rpx;
  217. font-size: 28rpx;
  218. font-weight: 500;
  219. line-height: 75rpx;
  220. }
  221. .button1 {
  222. width: 190rpx;
  223. height: 75rpx;
  224. opacity: 1;
  225. border-radius: 105rpx;
  226. background: rgba(242, 242, 242, 1);
  227. color: rgba(0, 0, 0, 1);
  228. text-align: center;
  229. }
  230. .button2 {
  231. margin: 0 0 0 29rpx;
  232. width: 190rpx;
  233. height: 75rpx;
  234. opacity: 1;
  235. border-radius: 105rpx;
  236. background: rgba(255, 141, 26, 1);
  237. color: rgba(255, 255, 255, 1);
  238. text-align: center;
  239. }
  240. /* 编辑时间弹框 */
  241. .popup-list {
  242. margin: 25rpx 0 0 41rpx;
  243. font-size: 28rpx;
  244. color: rgba(0, 0, 0, 1);
  245. }
  246. .popup-yell {
  247. color: rgba(255, 141, 26, 1);
  248. font-size: 32rpx;
  249. font-weight: 500;
  250. padding-top: 20rpx;
  251. }
  252. .popup-red {
  253. color: rgba(212, 48, 48, 1);
  254. font-size: 32rpx;
  255. font-weight: 500;
  256. padding-top: 20rpx;
  257. }
  258. .custom-item {
  259. margin: 17rpx 0 0 0;
  260. display: flex;
  261. align-items: center;
  262. justify-content: space-between;
  263. padding: 12rpx 16rpx;
  264. width: 651rpx;
  265. height: 83rpx;
  266. opacity: 1;
  267. border-radius: 130rpx;
  268. background: rgba(242, 242, 242, 1);
  269. }
  270. .item-label {
  271. font-size: 28rpx;
  272. color: rgba(0, 0, 0, 1);
  273. }
  274. .item-value {
  275. display: flex;
  276. font-size: 28rpx;
  277. color: rgba(0, 0, 0, 1);
  278. }
  279. /* 按钮 */
  280. .popup_butt {
  281. display: flex;
  282. align-items: center;
  283. justify-content: space-between;
  284. margin: 54rpx 0 0 0;
  285. height: 200rpx;
  286. font-size: 28rpx;
  287. font-weight: 500;
  288. line-height: 99rpx;
  289. }
  290. .button3 {
  291. width: 250rpx;
  292. height: 99rpx;
  293. opacity: 1;
  294. border-radius: 138rpx;
  295. border: 1px solid rgba(255, 141, 26, 1);
  296. color: rgba(255, 141, 26, 1);
  297. text-align: center;
  298. }
  299. .button4 {
  300. width: 250rpx;
  301. height: 99rpx;
  302. opacity: 1;
  303. border-radius: 105rpx;
  304. background: rgba(255, 141, 26, 1);
  305. color: rgba(255, 255, 255, 1);
  306. text-align: center;
  307. }
  308. </style>