yyList.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  1. <template>
  2. <view class="content">
  3. <!-- <view class="search-user flex-y-center ">
  4. <view class="search-content flex-y-center">
  5. <icon type="search" size="18" />
  6. <input confirm-type="search" v-model="seTval" @confirm="confirm" @input="getSearch" class="flex-grow-1"
  7. type="text" placeholder-style="font-size:26rpx" placeholder="请输入关键词" />
  8. <view class="flex-center" style="margin-left: 10rpx;" @click.stop="onDel" v-if="seTval">
  9. <icon type="clear" size="18" />
  10. </view>
  11. </view>
  12. <view class="search-btn" @click="search">
  13. 搜索
  14. </view>
  15. </view>
  16. <view class="header-hg100"></view> -->
  17. <view class="list">
  18. <view @click="detail(item.id,item.admin_id)" class="item" v-for="(item,index) in list" :key="index">
  19. <view class="top flex flex-y-center box-pack-between" style="padding: 20rpx 0;">
  20. <view class="name">{{item.type ==1?'位置':'商品'}} </view>
  21. <view class="flex-y-center">
  22. <view class="delBtns flex-center" style="background:#1E9FFF;" @click.stop="menuBtns(0,item.id)">
  23. 编辑 </view>
  24. <view class="delBtns flex-center" style="background: #FF5722;"
  25. @click.stop="menuBtns(1,item.id)">删除</view>
  26. </view>
  27. </view>
  28. <view class="content flex flex-y-center box-pack-between" hover-class="nav-hover">
  29. <view class="cell flex flex-y-center">
  30. <view class="title">预约金额:</view>
  31. <view class="desc">{{item.money}}</view>
  32. </view>
  33. </view>
  34. <view class="content flex flex-y-center box-pack-between" hover-class="nav-hover">
  35. <view class="cell flex flex-y-center">
  36. <view class="title">创建时间:</view>
  37. <view class="desc">{{item.create_time}}</view>
  38. </view>
  39. </view>
  40. </view>
  41. <block v-if='list.length<=0'>
  42. <no-none></no-none>
  43. </block>
  44. </view>
  45. <view class="header-hg100"></view>
  46. <view class="footer-bar">
  47. <view class="content flex flex-center">
  48. <navigator :url="`./yyedit?titaleType=1`" class="btn">+新增预约</navigator>
  49. </view>
  50. </view>
  51. </view>
  52. </template>
  53. <script>
  54. export default {
  55. data() {
  56. return {
  57. type: 2,
  58. seTval: '',
  59. page: 1,
  60. list: [],
  61. admin_id: '',
  62. store_id: '',
  63. is_bottom: false,
  64. keywords: "",
  65. }
  66. },
  67. onLoad(e) {
  68. this.type = e.type;
  69. this.admin_id = uni.getStorageSync("admin_id");
  70. this.store_id = uni.getStorageSync("store_id");
  71. this.list = [];
  72. this.getData(1)
  73. },
  74. onShow() {
  75. // this.list = [];
  76. // this.getData(1)
  77. },
  78. onPullDownRefresh(){
  79. this.list = [];
  80. this.getData(1)
  81. console.log('下拉刷新')
  82. },
  83. onReachBottom() {
  84. if (!this.is_bottom) {
  85. this.getData(this.page + 1)
  86. }
  87. },
  88. methods: {
  89. //操作按钮
  90. menuBtns(e, id) {
  91. const that = this;
  92. let type = e; //0是编辑1是删除
  93. if (type == 0) {
  94. uni.navigateTo({
  95. url: `./yyedit?id=${id}&titaleType=2`
  96. })
  97. } else {
  98. uni.showModal({
  99. title: '提示',
  100. content: '确认要删除吗?',
  101. success: (res) => {
  102. if (res.confirm) {
  103. this.request({
  104. url: 'Smdcshop/delete_yy',
  105. data: {
  106. id: id,
  107. },
  108. }).then(res => {
  109. console.log(res, "res")
  110. if (res.code === 200 || res.code === "200") {
  111. uni.showToast({
  112. title: "删除成功",
  113. icon: "none",
  114. })
  115. setTimeout(() => {
  116. this.getData(1)
  117. }, 2000)
  118. }
  119. }).catch((res) => {
  120. uni.showToast({
  121. title: res.message,
  122. icon: "none",
  123. })
  124. });
  125. } else if (res.cancel) {
  126. console.log('用户点击取消');
  127. }
  128. }
  129. });
  130. }
  131. },
  132. // getSearch(e) {
  133. // if (!e.detail.value) {
  134. // this.list = [];
  135. // this.keywords = "";
  136. // this.getData(1);
  137. // }
  138. // this.keywords = e.detail.value;
  139. // },
  140. // onDel() {
  141. // this.seTval = '';
  142. // this.list = [];
  143. // this.keywords = "";
  144. // this.getData(1);
  145. // },
  146. // confirm(e) {
  147. // this.list = [];
  148. // this.keywords = e.detail.value;
  149. // this.getData(1);
  150. // },
  151. // search(e) {
  152. // this.list = [];
  153. // this.getData(1);
  154. // },
  155. detail(id) {
  156. uni.navigateTo({
  157. url: `./yyDetail?id=${id}`
  158. })
  159. },
  160. getData(page) {
  161. if (page == 1) {
  162. this.list = []
  163. this.page = 1
  164. this.is_bottom = false
  165. }
  166. this.request({
  167. url: 'Smdcshop/yylist',
  168. data: {
  169. // admin_id: this.admin_id,
  170. page,
  171. // serch: this.keywords,
  172. limit: 10,
  173. store_id: this.store_id,
  174. }
  175. }).then(res => {
  176. if (res.code == 200 && res.data.length) {
  177. this.list = this.list.concat(res.data)
  178. this.page = page;
  179. uni.stopPullDownRefresh()
  180. } else {
  181. this.is_bottom = true
  182. }
  183. })
  184. }
  185. }
  186. }
  187. </script>
  188. <style>
  189. @import url("../static/css/common.css");
  190. page {
  191. background: #F9F9F9;
  192. }
  193. .search-user {
  194. z-index: 999;
  195. position: fixed;
  196. left: 0;
  197. width: 100%;
  198. height: 100rpx;
  199. background: #FFFFFF;
  200. margin-left: 15rpx;
  201. }
  202. .search-user .search-content {
  203. width: 83%;
  204. height: 70rpx;
  205. background: #F1F1F1;
  206. border-radius: 100rpx;
  207. padding: 0 20rpx;
  208. }
  209. .search-user .search-content icon {
  210. margin-right: 10rpx;
  211. }
  212. .search-user .search-btn {
  213. margin-left: 20rpx;
  214. font-size: 28rpx;
  215. }
  216. .header-hg100 {
  217. height: 100rpx;
  218. }
  219. .list {
  220. padding: 30rpx 25rpx;
  221. }
  222. .list .item {
  223. border-radius: 8rpx;
  224. overflow: hidden;
  225. padding-left: 30rpx;
  226. background-color: #fff;
  227. margin-bottom: 30rpx;
  228. }
  229. .list .item .top {
  230. border-bottom: 1rpx solid #f5f5f5;
  231. padding: 10rpx 0;
  232. }
  233. .list .item .top .name {
  234. font-size: 34rpx;
  235. font-weight: bold;
  236. }
  237. .list .item .top .type-btn {
  238. zoom: 0.7;
  239. margin-right: 25rpx;
  240. }
  241. .list .item .content {
  242. padding: 20rpx 0 24rpx;
  243. }
  244. .list .item .content .cell {
  245. flex: none;
  246. box-sizing: border-box;
  247. padding-right: 20rpx;
  248. font-size: 26rpx;
  249. line-height: 37rpx;
  250. color: #666;
  251. }
  252. .list .item .content .cell .title {
  253. color: #99A0AD;
  254. }
  255. .delBtns {
  256. width: 100rpx;
  257. height: 44rpx;
  258. font-size: 24rpx;
  259. margin-right: 25rpx;
  260. color: #fff;
  261. border-radius: 15rpx;
  262. }
  263. </style>